Comments (9)
can you try with a fully qualified name in your block?
%Story{
id: :tabs,
attributes: %{},
block: """
<BrmblWeb.UI.Navigation.Tabs.tab is_active to="/" label="Tab1" />
<BrmblWeb.UI.Navigation.Tabs.tab to="/hi" label="Tab2" />
"""
}
from phoenix_storybook.
Thanks for that - this un-blocks me for now!
from phoenix_storybook.
from phoenix_storybook.
An entry example using new custom aliases / imports
defmodule NestedComponent do
use PhxLiveStorybook.Entry, :component
def function, do: &NestedComponent.nested_component/1
def aliases, do: [MyStorybook.Helpers.JSHelpers]
def imports, do: [{NestedComponent, nested: 1}]
def stories do
[
%Story{
id: :default,
block: """
<.nested phx-click={JSHelpers.toggle()}>hello</.nested>
<.nested phx-click={JSHelpers.toggle()}>world</.nested>
"""
}
]
end
end
from phoenix_storybook.
@cblavier just spotted this. Awesome stuff mate.
You got a release candidate, or some other tag we can pull from?
from phoenix_storybook.
no release now, still a few tickets to ship.
In the meantime you can pull main
branch. The issue is that, since it's not a proper hex release, you won't have the assets
in your mix.exs
:
defp deps do
[{:phx_live_storybook, github: "phenixdigital/phx_live_storybook"}]
end
then from your shell
mix deps.get
cd deps/phx_live_storybook
mix deps.get
npm ci --prefix assets
mix assets.build
you should be ready to go, and take care of recent changes in router.ex
(see CHANGELOG.md
)
from phoenix_storybook.
That gets it to compile
The generated story remains verbose however:
<.tabs>
<BrmblWeb.UI.Navigation.Tabs.tab is_active to="/" label="Tab1" />
<BrmblWeb.UI.Navigation.Tabs.tab to="/hi" label="Tab2" />
<./tabs>
(indentation appears broken, but Ive noticed that elsewhere)
from phoenix_storybook.
proper slots indentation 👌
from phoenix_storybook.
yeah I spotted those changes in the Changelog. I gave it a stab yesterday, but the assets were tripping me up. Thanks a bunch for the workaround!
from phoenix_storybook.
Related Issues (20)
- Fails to run `mix phx.gen.storybook` on phoenix `1.7.3` HOT 4
- Dialyzer is no longer working HOT 1
- Internal assets aren't being found even that they exist HOT 5
- Export formatter rules for `live_storybook/2` HOT 7
- Stories with large attributes fail to load HOT 3
- Hex release not independently compilable HOT 2
- Make CSRF token optional
- Generated stories have `Elixir.` prefix in aliases and for function components
- Compile failure with earmark 1.4.41 HOT 3
- `theme` Attribute does not render in the example code HOT 4
- Cannot get any of my own components to display properly in the stories view HOT 11
- Strange whitebar on chrome/safari since MacOS Sonoma update
- Inter font makes request to external source
- Add `defer` attribute to `<script>` tag HOT 1
- Global Color Change HOT 1
- Prefix event names in StoryLive
- Elixir warning for slice with negative steps
- allow passing additional options to story HOT 1
- Compatibility with Phoenix HTML 4.0.0
- error: undefined function (there is no such import) nofile:1 HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from phoenix_storybook.