Skip to content

Latest commit

 

History

History
148 lines (124 loc) · 3.94 KB

File metadata and controls

148 lines (124 loc) · 3.94 KB

import * as UI from '../../src/index'

import { Canvas, Meta, Story } from "@storybook/addon-docs";

import { action } from "@storybook/addon-actions";

Ask name

API docs

{() => { const div = document.createElement("div"); UI.widgets .askName(document, SolidLogic.store, div) .then((name) => window.alert(`You picked "${name}"`)); return div; }}

Attachment list

Component that displays a list of resources, for instance the attachments of a message, or the various documents related to a meeting. Accepts dropping URLs onto it to add attachments to it.

API docs

{() => { const div = document.createElement("div"); SolidLogic.store.add( $rdf.namedNode("https://example-user.inrupt.net/public/some-message.ttl#this"), UI.ns.wf("attachment"), $rdf.namedNode("http://example.com/#some-attachment") ); UI.widgets.attachmentList( document, $rdf.namedNode("https://example-user.inrupt.net/public/some-message.ttl" + "#this"), div ); return div; }}

personTR

A TR to represent a draggable person, etc in a list

API docs

{() => { const michiel = $rdf.namedNode("https://michielbdejong.inrupt.net/profile/card#me"); return UI.widgets.personTR(document, null, michiel); }}

renderAsDIV

A Div to represent a draggable person, etc in a list

API docs

{() => { const michiel = $rdf.namedNode("https://michielbdejong.inrupt.net/profile/card#me"); const options = { wrapInATR: true, }; return UI.widgets.renderAsDiv(document, michiel, options); }}

selectorPanel

API docs

{() => { const kb = $rdf.graph(); const type = $rdf.namedNode("http://example.com/#type"); const predicate = $rdf.namedNode("http://example.com/#pred"); const inverse = false; const possible = [ $rdf.namedNode("http://example.com/#blue"), $rdf.namedNode("http://example.com/#green"), $rdf.namedNode("http://example.com/#yellow"), ]; const options = {}; return UI.widgets.selectorPanel( document, kb, type, predicate, inverse, possible, options, action("selection"), action("link clicked") ); }}

selectorPanelRefresh

API docs

{() => { const list = document.createElement("div"); const kb = $rdf.graph(); const type = $rdf.namedNode("http://example.com/#type"); const predicate = $rdf.namedNode("http://example.com/#pred"); const inverse = false; const possible = [ $rdf.namedNode("http://example.com/#blue"), $rdf.namedNode("http://example.com/#green"), $rdf.namedNode("http://example.com/#yellow"), ]; const options = {}; return UI.widgets.selectorPanelRefresh( list, document, kb, type, predicate, inverse, possible, options, action("selection"), action("link clicked") ); }}