File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11import * as UI from ' ../../lib'
22
33import { Canvas , Meta , Story } from ' @storybook/addon-docs/blocks'
4+ import { rawJsonDecorator } from ' ./decorators'
45
56<Meta title = " RDF utilities" />
67
@@ -11,9 +12,7 @@ Retrieve all RDF class URIs from solid-ui's RDF store
1112[ API Documentation] ( https://solid.github.io/solid-ui/Documentation/api/modules/_widgets_buttons_.html#allclassuris )
1213
1314<Canvas withSource = " open" >
14- <Story name = " allClassUris" decorators = { [ (Story ) => {
15- return ` <pre>${JSON .stringify (Story (), null , 2 )}</pre> `
16- }]} >
15+ <Story name = " allClassUris" decorators = { [rawJsonDecorator ]} >
1716 { () => {
1817 UI .store .add (
1918 UI .rdf .namedNode (' http://example.com/#some-thing' ),
@@ -38,9 +37,7 @@ Make a URI in the Tabulator.org annotation store out of the URI of the thing to
3837[ API Documentation] ( https://solid.github.io/solid-ui/Documentation/api/modules/_widgets_buttons_.html#defaultannotationstore )
3938
4039<Canvas withSource = " open" >
41- <Story name = " defaultAnnotationStore" decorators = { [ (Story ) => {
42- return ` <pre>${JSON .stringify (Story (), null , 2 )}</pre> `
43- }]} >
40+ <Story name = " defaultAnnotationStore" decorators = { [rawJsonDecorator ]} >
4441 { () => {
4542 const url = ' http://example.com/a/b.html'
4643 return UI .widgets .defaultAnnotationStore (UI .rdf .namedNode (url ))
Original file line number Diff line number Diff line change 1+ export const rawJsonDecorator = ( Story ) => {
2+ return `<pre>${ JSON . stringify ( Story ( ) , null , 2 ) } </pre>`
3+ }
Original file line number Diff line number Diff line change 11import * as UI from ' ../../lib'
22
33import { Canvas , Meta , Story } from ' @storybook/addon-docs/blocks'
4+ import { rawJsonDecorator } from ' ./decorators'
45
56export const imageDecorator = (Story ) => {
67 const result = Story ()
@@ -110,4 +111,26 @@ Find an image for this thing as a class
110111 UI .widgets .findImageFromURI (UI .rdf .namedNode (' mailto:user@mail.example' ))
111112 }
112113 </Story >
114+ </Canvas >
115+
116+ ## imagesOf
117+
118+ Set of suitable images
119+
120+ [ API Documentation] ( https://solid.github.io/solid-ui/Documentation/api/modules/_widgets_buttons_.html#imagesof )
121+
122+ <Canvas withSource = " open" >
123+ <Story name = " imagesOf" decorators = { [rawJsonDecorator ]} >
124+ {
125+ () => {
126+ const store = UI .rdf .graph ()
127+ const thing = UI .rdf .namedNode (' http://thing.example/resource#it' )
128+ const avatar = UI .rdf .namedNode (' https://pod.example/image1.png' )
129+ const image = UI .rdf .namedNode (' https://pod.example/image2.jpg' )
130+ store .add (thing , UI .ns .sioc (' avatar' ), avatar )
131+ store .add (thing , UI .ns .foaf (' img' ), image )
132+ return UI .widgets .imagesOf (thing , store )
133+ }
134+ }
135+ </Story >
113136</Canvas >
You can’t perform that action at this time.
0 commit comments