solid-ui 5.0.0-0 → 5.0.0-1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunks/{account-CWdjQDsQ.js → account-CSKDoS_I.js} +7 -7
- package/dist/chunks/{account-CWdjQDsQ.js.map → account-CSKDoS_I.js.map} +1 -1
- package/dist/chunks/{auth-DdvFEHuV.js → auth-YsyyEh_c.js} +2 -2
- package/dist/chunks/{auth-DdvFEHuV.js.map → auth-YsyyEh_c.js.map} +1 -1
- package/dist/chunks/{avatar-3eUQtxXZ.js → avatar-BXaBs_3q.js} +2 -2
- package/dist/chunks/{avatar-3eUQtxXZ.js.map → avatar-BXaBs_3q.js.map} +1 -1
- package/dist/chunks/{guard-6zSfmr4k.js → guard-BTbfcRR6.js} +2 -2
- package/dist/chunks/{guard-6zSfmr4k.js.map → guard-BTbfcRR6.js.map} +1 -1
- package/dist/chunks/{index.esm-Bu7WXI60.js → index.esm-C63HBmfn.js} +1457 -1349
- package/dist/chunks/index.esm-C63HBmfn.js.map +1 -0
- package/dist/chunks/{jsonld-B2M5QgXx.js → jsonld-DrQpMD8o.js} +2 -2
- package/dist/chunks/{jsonld-B2M5QgXx.js.map → jsonld-DrQpMD8o.js.map} +1 -1
- package/dist/chunks/{login-button-Boh1eEJ5.js → login-button-DZb_CXCo.js} +2 -2
- package/dist/chunks/{login-button-Boh1eEJ5.js.map → login-button-DZb_CXCo.js.map} +1 -1
- package/dist/chunks/{logout-button-BJfE_daI.js → logout-button-CaD4ESfx.js} +2 -2
- package/dist/chunks/{logout-button-BJfE_daI.js.map → logout-button-CaD4ESfx.js.map} +1 -1
- package/dist/chunks/{menu-hMtmUkel.js → menu-BiqIAf-j.js} +264 -228
- package/dist/chunks/menu-BiqIAf-j.js.map +1 -0
- package/dist/chunks/{provider-BJ8rXsnl.js → provider-BZsO0FFR.js} +2 -2
- package/dist/chunks/{provider-BJ8rXsnl.js.map → provider-BZsO0FFR.js.map} +1 -1
- package/dist/chunks/{rdf-form-PagO7EXg.js → rdf-form-C2zcf1F0.js} +3 -3
- package/dist/chunks/{rdf-form-PagO7EXg.js.map → rdf-form-C2zcf1F0.js.map} +1 -1
- package/dist/chunks/{rdf-input-Dsbbxbva.js → rdf-input-CiQNdkKK.js} +3 -3
- package/dist/chunks/{rdf-input-Dsbbxbva.js.map → rdf-input-CiQNdkKK.js.map} +1 -1
- package/dist/chunks/{signup-button-14Bh_nyp.js → signup-button-DufShSEV.js} +2 -2
- package/dist/chunks/{signup-button-14Bh_nyp.js.map → signup-button-DufShSEV.js.map} +1 -1
- package/dist/chunks/{src-CZXvZVWH.js → src-CbkVtLGQ.js} +5 -5
- package/dist/chunks/{src-CZXvZVWH.js.map → src-CbkVtLGQ.js.map} +1 -1
- package/dist/chunks/{style-BsMewYKg.js → style-DI3buiHt.js} +2 -2
- package/dist/chunks/{style-BsMewYKg.js.map → style-DI3buiHt.js.map} +1 -1
- package/dist/components/account.js +1 -1
- package/dist/components/avatar.js +1 -1
- package/dist/components/guard.js +1 -1
- package/dist/components/login-button.js +1 -1
- package/dist/components/login-modal.js +1 -1
- package/dist/components/logout-button.js +1 -1
- package/dist/components/menu.js +1 -1
- package/dist/components/provider.js +1 -1
- package/dist/components/rdf-form.js +1 -1
- package/dist/components/rdf-input.js +1 -1
- package/dist/components/signup-button.js +1 -1
- package/dist/components.js +11 -11
- package/dist/index.js +4 -4
- package/dist/lib/file-explorer/context.cjs.js.map +1 -1
- package/dist/lib/file-explorer/context.d.ts +1 -1
- package/dist/lib/file-explorer/context.d.ts.map +1 -1
- package/dist/lib/file-explorer/context.esm.js.map +1 -1
- package/dist/loader.js +4 -4
- package/dist/solid-ui.js +101 -85
- package/dist/solid-ui.min.js +101 -85
- package/dist/solid-ui.min.js.map +1 -1
- package/package.json +1 -1
- package/dist/chunks/index.esm-Bu7WXI60.js.map +0 -1
- package/dist/chunks/menu-hMtmUkel.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rdf-input-Dsbbxbva.js","names":["sym","parse","ns","baseUri","loadDocument","store","documentSource","documentName","documentURI","preferRemote","finalDocumentUri","document","holds","undefined","removeStatements","statementsMatching","parseSource","Promise","resolve","reject","err","console","error","fetcher","load","force","clearPreviousData","then","catch","trim","length","Error","fetchData","sortBySequence","list","subfields","map","p","k","any","ui","seq","Number","value","isNaN","sort","a","b","pair","mostSpecificClassURI","subject","typeUri","findTypeURIs","specificTypes","bottomTypeURIs","finalTypes","t","push","findForm","sourceUri","docUrl","split","fragment","includes","candidate","rdf","forms","each","found","find","term","termType","ns","style","fieldParams","ui","uri","size","type","dt","pattern","namedNode","defaultInputValue","formGroupStyle","element","commentStyle","formHeadingStyle","NoopStore","store","Error","createContext","NoopStore","DEFAULT_STORE","storeContext","Symbol","property","state","html","ns","customElement","generateId","WebComponent","Literal","st","label","mostSpecificClassURI","fieldParams","fieldTypeParams","DEFAULT_STORE","storeContext","consume","_classDecs","_RDFInput","_A","WeakMap","_B","_C","_D","_E","_F","_ref","_storeContextDecs","context","subscribe","_formSubjectDecs","attribute","type","Object","_dataSubjectDecs","_storeVersionDecs","Number","_localInputValueDecs","_readonlyDecs","Boolean","reflect","RDFInput","_classPrivateFieldGet","v","_classPrivateFieldSet","formSubject","dataSubject","storeVersion","localInputValue","readonly","constructor","_classPrivateFieldInitSpec","_initProto","_init_storeContext","_init_formSubject","_init_dataSubject","_init_storeVersion","_init_localInputValue","_defineProperty","_init_readonly","id","render","formDocument","getDocument","uiPropertyTerm","getFormProperty","ui","inputLabel","getInputLabel","getReadOnly","fieldType","store","undefined","params","inputType","selectedTerm","getSelectedTerm","placeholder","defaultInputValue","inputValue","_updateInFlight","_pendingUpdateValue","termToInputValue","updateData","subject","doc","graph","any","formFieldSubject","uiLabel","propertyLabel","value","anyJS","defaultTerm","inputTerm","term","decodeURIComponent","String","stripped","replace","e","newValue","target","runPendingUpdate","dataDocument","updater","editable","toDeleteSt","statementsMatching","toInsertSt","objectFromNewValue","namedNode","sym","encodeURIComponent","dt","trim","xsd","map","statement","predicate","why","length","updateMany","err","console","error","_RDFInput2","c","_initClass","_applyDecs","default","RDFInput"],"sources":["../../src/lib/forms/rdfFormsHelper.ts","../../src/lib/forms/fieldParams.ts","../../src/lib/forms/store/NoopStore.ts","../../src/lib/forms/store/StoreContext.ts","../../src/components/rdf-input/RDFInput.ts","../../src/components/rdf-input/index.ts"],"sourcesContent":["import { sym, LiveStore, parse } from 'rdflib'\nimport type { Term } from 'rdflib/lib/tf-types'\n// eslint-disable-next-line camelcase\nimport type { Quad_Subject, NamedNode } from 'rdflib/lib/tf-types'\nimport ns from '../../lib/ns'\n\nconst baseUri = 'https://solidos.github.io/solid-ui/src/ontology/'\n\nexport function loadDocument (\n store: LiveStore,\n documentSource: string,\n documentName: string,\n documentURI?: string,\n preferRemote = false\n) {\n const finalDocumentUri = documentURI || baseUri + documentName // Full URI to the file\n const document = sym(finalDocumentUri) // rdflib NamedNode for the document\n\n if (store.holds(undefined, undefined, undefined, document)) {\n store.removeStatements(store.statementsMatching(undefined, undefined, undefined, document))\n }\n\n const parseSource = () => {\n return new Promise<void>((resolve, reject) => {\n parse(documentSource, store, finalDocumentUri, 'text/turtle', (err) => {\n if (err) {\n console.error('Parse document error for ', finalDocumentUri, err)\n reject(err)\n } else {\n resolve()\n }\n })\n })\n }\n\n if (preferRemote && documentURI) {\n return store.fetcher.load(documentURI, {\n force: true,\n clearPreviousData: true,\n }).then(() => {}).catch((err) => {\n if (documentSource && documentSource.trim().length > 0) {\n return parseSource()\n }\n throw err\n })\n }\n\n if (documentSource && documentSource.trim().length > 0) {\n return parseSource()\n }\n\n if (documentURI) {\n return store.fetcher.load(documentURI, {\n force: true,\n clearPreviousData: true,\n }).then(() => {})\n }\n\n return Promise.reject(new Error(`No document source or URI for ${documentName}`))\n}\n\nexport async function fetchData (\n store: LiveStore,\n documentURI: string\n) {\n const document = sym(documentURI) // rdflib NamedNode for the document\n\n if (store.holds(undefined, undefined, undefined, document)) {\n store.removeStatements(store.statementsMatching(undefined, undefined, undefined, document))\n }\n\n return await store.fetcher.load(documentURI, {\n force: true,\n clearPreviousData: true,\n })\n}\n\nexport function sortBySequence (\n store: LiveStore,\n list: Term[]\n) {\n const subfields = list.map((p) => {\n const k = store.any(p as any, ns.ui('sequence'))\n const seq = k ? Number((k as { value: string }).value) : 9999\n return [Number.isNaN(seq) ? 9999 : seq, p] as const\n })\n\n subfields.sort((a, b) => a[0] - b[0])\n\n return subfields.map(pair => pair[1])\n}\n\n/**\n * Which class of field is this? Relies on http://www.w3.org/2000/01/rdf-schema#subClassOf and\n * https://linkeddata.github.io/rdflib.js/doc/classes/formula.html#bottomtypeuris\n * to find the most specific RDF type if there are multiple.\n *\n * @param subject a form field, e.g. `namedNode('https://timbl.com/timbl/Public/Test/Forms/individualForm.ttl#fullNameField')`\n * @returns the URI of the most specific known class, e.g. `http://www.w3.org/ns/ui#SingleLineTextField`\n */\n// eslint-disable-next-line camelcase\nexport function mostSpecificClassURI (store: LiveStore, subject: Quad_Subject): string {\n const typeUri = store.findTypeURIs(subject)\n const specificTypes = store.bottomTypeURIs(typeUri) // most specific\n const finalTypes: any[] = []\n for (const t in specificTypes) finalTypes.push(t)\n // if (finalTypes.length > 1) throw \"Didn't expect \"+subject+\" to have multiple bottom types: \"+finalTypes\n return finalTypes[0]\n}\n\n// Find the first ui:Form node in a store, optionally matching a fragment.\n// code based on Jeff Zucker's sol-components: https://github.com/jeff-zucker/sol-components (core/form-utils.js)\nexport function findForm (store: LiveStore, sourceUri: string): NamedNode | null {\n const docUrl = sourceUri.split('#')[0]\n const fragment = sourceUri.includes('#') ? sourceUri.split('#')[1] : null\n if (fragment) {\n const candidate = sym(docUrl + '#' + fragment)\n if (store.holds(candidate, ns.rdf('type'), ns.ui('Form'))) return candidate\n }\n const forms = store.each(null, ns.rdf('type'), ns.ui('Form'))\n const found = forms.find((term) => term.termType === 'NamedNode')\n return found ? (found as NamedNode) : null\n}\n","import ns from '../../lib/ns'\nimport { style } from '../../lib/style'\n\nexport type InputType =\n | 'hidden'\n | 'text'\n | 'search'\n | 'tel'\n | 'url'\n | 'email'\n | 'password'\n | 'datetime'\n | 'date'\n | 'month'\n | 'week'\n | 'time'\n | 'datetime-local'\n | 'number'\n | 'range'\n | 'color'\n | 'checkbox'\n | 'radio'\n | 'file'\n | 'submit'\n | 'image'\n | 'reset'\n | 'button'\n\nexport type FieldParamsObject = {\n size?: number, // input element size attribute\n type?: InputType, // input element type attribute. Default: 'text' (not for Comment and Heading)\n element?: string, // element type to use (Comment and Heading only)\n style?: string, // style to use\n dt?: string, // xsd data type for the RDF Literal corresponding to the field value. Default: xsd:string\n defaultInputValue?: string, // e.g. 'mailto:'. Default value in input field, will be removed when displaying actual value to user.\n namedNode?: boolean, // if true, field value corresponds to the URI of an RDF NamedNode. Overrides dt and defaultInputValue.\n pattern?: RegExp // for client-side input validation; field will go red if violated, green if ok\n}\n\n/**\n * The fieldParams object defines various constants\n * for use in various form fields. Depending on the\n * field in questions, different values may be read\n * from here.\n */\nexport const fieldParams: { [ fieldUri: string ]: FieldParamsObject } = {\n /**\n * Text field\n *\n * For possible date popups see e.g. http://www.dynamicdrive.com/dynamicindex7/jasoncalendar.htm\n * or use HTML5: http://www.w3.org/TR/2011/WD-html-markup-20110113/input.date.html\n */\n [ns.ui('ColorField').uri]: {\n size: 9,\n type: 'color',\n style: 'height: 3em;', // around 1.5em is padding\n dt: 'color',\n pattern: /^\\s*#[0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]([0-9a-f][0-9a-f])?\\s*$/\n }, // https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/color\n\n [ns.ui('DateField').uri]: {\n size: 20,\n type: 'date',\n dt: 'date',\n pattern: /^\\s*[0-9][0-9][0-9][0-9](-[0-1]?[0-9]-[0-3]?[0-9])?Z?\\s*$/\n },\n\n [ns.ui('DateTimeField').uri]: {\n size: 20,\n type: 'datetime-local', // See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/datetime\n dt: 'dateTime',\n pattern: /^\\s*[0-9][0-9][0-9][0-9](-[0-1]?[0-9]-[0-3]?[0-9])?(T[0-2][0-9]:[0-5][0-9](:[0-5][0-9])?)?Z?\\s*$/\n },\n\n [ns.ui('TimeField').uri]: {\n size: 10,\n type: 'time',\n dt: 'time',\n pattern: /^\\s*([0-2]?[0-9]:[0-5][0-9](:[0-5][0-9])?)\\s*$/\n },\n\n [ns.ui('IntegerField').uri]: {\n size: 12,\n style: 'text-align: right;',\n dt: 'integer',\n pattern: /^\\s*-?[0-9]+\\s*$/\n },\n\n [ns.ui('DecimalField').uri]: {\n size: 12,\n style: 'text-align: right;',\n dt: 'decimal',\n pattern: /^\\s*-?[0-9]*(\\.[0-9]*)?\\s*$/\n },\n\n [ns.ui('FloatField').uri]: {\n size: 12,\n style: 'text-align: right;',\n dt: 'float',\n pattern: /^\\s*-?[0-9]*(\\.[0-9]*)?((e|E)-?[0-9]*)?\\s*$/\n },\n\n [ns.ui('SingleLineTextField').uri]: {\n\n },\n [ns.ui('NamedNodeURIField').uri]: {\n namedNode: true\n },\n [ns.ui('TextField').uri]: {\n\n },\n\n [ns.ui('PhoneField').uri]: {\n size: 20,\n defaultInputValue: 'tel:',\n pattern: /^\\+?[\\d-]+[\\d]*$/\n },\n\n [ns.ui('EmailField').uri]: {\n size: 30,\n defaultInputValue: 'mailto:',\n pattern: /^\\s*.*@.*\\..*\\s*$/ // @@ Get the right regexp here\n },\n\n [ns.ui('Group').uri]: {\n style: style.formGroupStyle\n },\n\n /**\n * Non-interactive fields\n */\n [ns.ui('Comment').uri]: {\n element: 'p',\n style: style.commentStyle\n },\n [ns.ui('Heading').uri]: {\n element: 'h3',\n style: style.formHeadingStyle\n }\n}\n","import { LiveStore } from 'rdflib'\nimport { StoreContext } from './StoreContext'\n\nexport default class NoopStore implements StoreContext {\n get store (): LiveStore {\n throw new Error('Cannot use RDF forms without a store')\n }\n}\n","import { createContext } from '@lit/context'\nimport { LiveStore } from 'rdflib'\nimport NoopStore from './NoopStore'\n\nexport interface StoreContext {\n store: LiveStore\n}\n\nexport const DEFAULT_STORE = new NoopStore()\nexport const storeContext = createContext<StoreContext>(Symbol('storeContext'))\n","import { property, state } from 'lit/decorators.js'\nimport { html } from 'lit/html.js'\nimport ns from '../../lib/ns'\nimport { customElement, generateId, WebComponent } from '@/lib/components'\nimport { Literal, NamedNode, st } from 'rdflib'\nimport { label } from '../../utils'\nimport { mostSpecificClassURI } from '../../lib/forms/rdfFormsHelper'\nimport { FieldParamsObject, fieldParams as fieldTypeParams, InputType } from '../../lib/forms/fieldParams'\nimport { DEFAULT_STORE, storeContext, StoreContext } from '@/lib/forms/store/StoreContext'\nimport { consume } from '@lit/context'\nimport '@/components/input'\n\n@customElement('solid-ui-rdf-input')\nexport default class RDFInput extends WebComponent {\n // example RDF Turtle format source:\n // :nameField a ui:SingleLineTextField ;\n // ui:property vcard:fn;\n // ui:label \"name\" .\n\n // formSubject describes the field metadata\n // dataSubject points to the data resource containing the value\n\n @consume({ context: storeContext, subscribe: true })\n private accessor storeContext: StoreContext = DEFAULT_STORE\n\n @property({ attribute: false, type: Object })\n accessor formSubject: NamedNode | null = null\n\n @property({ attribute: false, type: Object })\n accessor dataSubject: NamedNode | null = null\n\n @property({ type: Number })\n accessor storeVersion = 0\n\n @state()\n private accessor localInputValue: string | null = null\n\n private _updateInFlight = false\n private _pendingUpdateValue: string | null = null\n\n @property({ type: Boolean, reflect: true })\n accessor readonly: boolean = true // to protect data, we default to not editable\n\n constructor () {\n super()\n\n this.id = generateId()\n }\n\n render () {\n const formDocument = this.getDocument(this.formSubject)\n\n // for building the HTML input element\n const uiPropertyTerm = this.getFormProperty(this.formSubject, ns.ui('property'), formDocument)\n const inputLabel = this.getInputLabel(this.formSubject, uiPropertyTerm, formDocument)\n const readonly = this.getReadOnly(this.readonly, this.formSubject, formDocument)\n\n const fieldType = this.formSubject ? mostSpecificClassURI(this.storeContext.store, this.formSubject) : undefined\n const params = fieldType ? fieldTypeParams[fieldType] ?? {} : {}\n const inputType: InputType = params.type ?? 'text'\n\n // for populating the HTML input element\n const selectedTerm = this.getSelectedTerm(this.dataSubject, uiPropertyTerm, this.formSubject, params)\n const placeholder = readonly ? '' : this.defaultInputValue(params)\n const inputValue = this._updateInFlight || this._pendingUpdateValue !== null\n ? this.localInputValue ?? ''\n : this.termToInputValue(selectedTerm)\n\n return html`\n <solid-ui-input\n label=\"${inputLabel}\"\n name=\"name-${this.id}\"\n .value=${inputValue}\n .placeholder=${placeholder}\n type=\"${inputType}\"\n ?readonly=${readonly}\n @input=${this.updateData}\n ></solid-ui-input>`\n }\n\n private getDocument (subject: NamedNode | null | undefined) {\n return subject?.doc ? subject.doc() : undefined\n }\n\n private getFormProperty (subject: NamedNode | null | undefined, property: NamedNode, graph?: any): NamedNode | undefined {\n if (!subject) return undefined\n return this.storeContext.store.any(subject, property, null, graph) as NamedNode | undefined\n }\n\n private getInputLabel (formFieldSubject: NamedNode | null | undefined, uiPropertyTerm?: NamedNode, graph?: any): string {\n if (!formFieldSubject) return ''\n const uiLabel = this.storeContext.store.any(formFieldSubject, ns.ui('label'), null, graph)\n const propertyLabel = uiPropertyTerm ? label(uiPropertyTerm, true) : ''\n return uiLabel ? uiLabel.value : propertyLabel\n }\n\n private getReadOnly (readonly: boolean, formFieldSubject?: NamedNode | null, graph?: any): boolean {\n if (formFieldSubject && readonly === false) { // if readonly is false, we can ovverride it if the field is marked as uneditable in the form\n return !!this.storeContext.store.anyJS(formFieldSubject, ns.ui('suppressEmptyUneditable'), null, graph)\n }\n return readonly\n }\n\n private getSelectedTerm (\n dataSubject?: NamedNode | null,\n uiPropertyTerm?: NamedNode,\n formFieldSubject?: NamedNode | null,\n params?: { defaultInputValue?: string }\n ) {\n const defaultTerm = formFieldSubject\n ? this.storeContext.store.any(formFieldSubject, ns.ui('default'))\n : undefined\n\n if (!uiPropertyTerm || !dataSubject) {\n return defaultTerm\n }\n\n const inputTerm = this.storeContext.store.any(dataSubject, uiPropertyTerm)\n return inputTerm || defaultTerm\n }\n\n private termToInputValue (term: any) {\n if (!term || !('value' in term) || !term.value) return ''\n\n try {\n return decodeURIComponent(term.value)\n } catch {\n return String(term.value)\n }\n }\n\n private defaultInputValue (params: { defaultInputValue?: string } = {}) {\n const stripped = params.defaultInputValue ?? ''\n return stripped.replace(/ /g, '')\n }\n\n private async updateData (e: CustomEvent) {\n const newValue = (e.target as HTMLInputElement).value\n this.localInputValue = newValue\n this._pendingUpdateValue = newValue\n\n if (this._updateInFlight) {\n return\n }\n\n await this.runPendingUpdate()\n }\n\n private async runPendingUpdate () {\n if (this._pendingUpdateValue === null) {\n return\n }\n\n const newValue = this._pendingUpdateValue\n this._pendingUpdateValue = null\n this._updateInFlight = true\n\n const uiPropertyTerm = this.getFormProperty(this.formSubject, ns.ui('property'), this.getDocument(this.formSubject))\n if (!uiPropertyTerm || !this.dataSubject) {\n this._updateInFlight = false\n this.localInputValue = ''\n return\n }\n\n const dataDocument = this.getDocument(this.dataSubject)\n if (dataDocument && this.storeContext.store.updater?.editable(dataDocument) === false) {\n this._updateInFlight = false\n return\n }\n\n const toDeleteSt = this.storeContext.store.statementsMatching(this.dataSubject, uiPropertyTerm)\n let toInsertSt: Array<ReturnType<typeof st>> = []\n\n if (newValue) {\n let objectFromNewValue\n const fieldType = this.formSubject ? mostSpecificClassURI(this.storeContext.store, this.formSubject) : undefined\n const params: FieldParamsObject = fieldType ? fieldTypeParams[fieldType] ?? {} : {}\n if (params.namedNode) {\n objectFromNewValue = this.storeContext.store.sym(newValue)\n } else if (params.defaultInputValue) {\n objectFromNewValue = encodeURIComponent(newValue.replace(/ /g, ''))\n objectFromNewValue = this.storeContext.store.sym(params.defaultInputValue + objectFromNewValue)\n } else {\n if (params.dt) {\n objectFromNewValue = new Literal(\n newValue.trim(),\n undefined,\n ns.xsd(params.dt)\n )\n } else {\n objectFromNewValue = new Literal(newValue)\n }\n }\n toInsertSt = toDeleteSt.map((statement) => st(statement.subject, statement.predicate, objectFromNewValue, statement.why))\n if (toInsertSt.length === 0) {\n toInsertSt = [st(this.dataSubject, uiPropertyTerm, objectFromNewValue, this.getDocument(this.dataSubject))]\n }\n }\n\n try {\n await this.storeContext.store.updater.updateMany(toDeleteSt, toInsertSt as any)\n this.storeVersion += 1\n } catch (err) {\n console.error('RDFInput update failed', err)\n } finally {\n this._updateInFlight = false\n }\n\n if (this._pendingUpdateValue !== null) {\n await this.runPendingUpdate()\n }\n }\n}\n","import RDFInput from './RDFInput'\n\nexport { RDFInput }\nexport default RDFInput\n"],"mappings":";;;;;AA6DA,eAAsBgC,EACpB3B,GACAG,GACA;CACA,IAAMG,IAAWX,EAAIQ,CAAW;CAMhC,OAJIH,EAAMO,MAAMC,KAAAA,GAAWA,KAAAA,GAAWA,KAAAA,GAAWF,CAAQ,KACvDN,EAAMS,iBAAiBT,EAAMU,mBAAmBF,KAAAA,GAAWA,KAAAA,GAAWA,KAAAA,GAAWF,CAAQ,CAAC,GAGrF,MAAMN,EAAMkB,QAAQC,KAAKhB,GAAa;EAC3CiB,OAAO;EACPC,mBAAmB;CACrB,CAAC;AACH;AAEA,SAAgBO,EACd5B,GACA6B,GACA;CACA,IAAMC,IAAYD,EAAKE,KAAKC,MAAM;EAChC,IAAMC,IAAIjC,EAAMkC,IAAIF,GAAUnC,EAAGsC,GAAG,UAAU,CAAC,GACzCC,IAAMH,IAAII,OAAQJ,EAAwBK,KAAK,IAAI;EACzD,OAAO,CAACD,OAAOE,MAAMH,CAAG,IAAI,OAAOA,GAAKJ,CAAC;CAC3C,CAAC;CAID,OAFAF,EAAUU,MAAMC,GAAGC,MAAMD,EAAE,KAAKC,EAAE,EAAE,GAE7BZ,EAAUC,KAAIY,MAAQA,EAAK,EAAE;AACtC;AAWA,SAAgBC,EAAsB5C,GAAkB6C,GAA+B;CACrF,IAAMC,IAAU9C,EAAM+C,aAAaF,CAAO,GACpCG,IAAgBhD,EAAMiD,eAAeH,CAAO,GAC5CI,IAAoB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yC,KACY,IAAI1G,EACvB6F,EAASc,KAAK,GACd3C,KAAAA,GACApE,EAAGgH,IAAI3C,EAAOyC,EAAE,CAClB,IAEqB,IAAI1G,EAAQ6F,CAAQ,GAG7CQ,IAAaF,EAAWU,KAAKC,MAAc7G,EAAG6G,EAAUlC,SAASkC,EAAUC,WAAWT,GAAoBQ,EAAUE,GAAG,CAAC,GACpHX,EAAWY,WAAW,MACxBZ,IAAa,CAACpG,EAAG,KAAKqC,aAAakB,GAAgB8C,GAAoB,KAAK/C,YAAY,KAAKjB,WAAW,CAAC,CAAC;EAE9G;EAEA,IAAI;GAEF,AADA,MAAM,KAAK/B,aAAawD,MAAMkC,QAAQiB,WAAWf,GAAYE,CAAiB,GAC9E,KAAK9D,gBAAgB;EACvB,SAAS4E,GAAK;GACZC,QAAQC,MAAM,0BAA0BF,CAAG;EAC7C,UAAU;GACR,KAAK3C,kBAAkB;EACzB;EAEA,AAAI,KAAKC,wBAAwB,QAC/B,MAAM,KAAKsB,iBAAiB;CAEhC;AACF,GAAC,CAAAH,GAAA,CAAA/C,GAAAC,GAAAC,GAAAC,GAAAC,GAAAE,GAAAP,IAAA2E,GAAA,CAAA7G,GAAA8G,MAAAC,EAAAH,GAAA;CAAA;EAAAnG;EAAA;EAAA;CAAA;CAAA;EAAAG;EAAA;EAAA;CAAA;CAAA;EAAAI;EAAA;EAAA;CAAA;CAAA;EAAAC;EAAA;EAAA;CAAA;CAAA;EAAAE;EAAA;EAAA;CAAA;CAAA;EAAAC;EAAA;EAAA;CAAA;AAAA,GAAArB,GAAA,GAAA,KAAA,GAvMqCV,CAAY,GAAAyH,EAAA;;;ACVlD,IAAA,KAAeG"}
|
|
1
|
+
{"version":3,"file":"rdf-input-CiQNdkKK.js","names":["sym","parse","ns","baseUri","loadDocument","store","documentSource","documentName","documentURI","preferRemote","finalDocumentUri","document","holds","undefined","removeStatements","statementsMatching","parseSource","Promise","resolve","reject","err","console","error","fetcher","load","force","clearPreviousData","then","catch","trim","length","Error","fetchData","sortBySequence","list","subfields","map","p","k","any","ui","seq","Number","value","isNaN","sort","a","b","pair","mostSpecificClassURI","subject","typeUri","findTypeURIs","specificTypes","bottomTypeURIs","finalTypes","t","push","findForm","sourceUri","docUrl","split","fragment","includes","candidate","rdf","forms","each","found","find","term","termType","ns","style","fieldParams","ui","uri","size","type","dt","pattern","namedNode","defaultInputValue","formGroupStyle","element","commentStyle","formHeadingStyle","NoopStore","store","Error","createContext","NoopStore","DEFAULT_STORE","storeContext","Symbol","property","state","html","ns","customElement","generateId","WebComponent","Literal","st","label","mostSpecificClassURI","fieldParams","fieldTypeParams","DEFAULT_STORE","storeContext","consume","_classDecs","_RDFInput","_A","WeakMap","_B","_C","_D","_E","_F","_ref","_storeContextDecs","context","subscribe","_formSubjectDecs","attribute","type","Object","_dataSubjectDecs","_storeVersionDecs","Number","_localInputValueDecs","_readonlyDecs","Boolean","reflect","RDFInput","_classPrivateFieldGet","v","_classPrivateFieldSet","formSubject","dataSubject","storeVersion","localInputValue","readonly","constructor","_classPrivateFieldInitSpec","_initProto","_init_storeContext","_init_formSubject","_init_dataSubject","_init_storeVersion","_init_localInputValue","_defineProperty","_init_readonly","id","render","formDocument","getDocument","uiPropertyTerm","getFormProperty","ui","inputLabel","getInputLabel","getReadOnly","fieldType","store","undefined","params","inputType","selectedTerm","getSelectedTerm","placeholder","defaultInputValue","inputValue","_updateInFlight","_pendingUpdateValue","termToInputValue","updateData","subject","doc","graph","any","formFieldSubject","uiLabel","propertyLabel","value","anyJS","defaultTerm","inputTerm","term","decodeURIComponent","String","stripped","replace","e","newValue","target","runPendingUpdate","dataDocument","updater","editable","toDeleteSt","statementsMatching","toInsertSt","objectFromNewValue","namedNode","sym","encodeURIComponent","dt","trim","xsd","map","statement","predicate","why","length","updateMany","err","console","error","_RDFInput2","c","_initClass","_applyDecs","default","RDFInput"],"sources":["../../src/lib/forms/rdfFormsHelper.ts","../../src/lib/forms/fieldParams.ts","../../src/lib/forms/store/NoopStore.ts","../../src/lib/forms/store/StoreContext.ts","../../src/components/rdf-input/RDFInput.ts","../../src/components/rdf-input/index.ts"],"sourcesContent":["import { sym, LiveStore, parse } from 'rdflib'\nimport type { Term } from 'rdflib/lib/tf-types'\n// eslint-disable-next-line camelcase\nimport type { Quad_Subject, NamedNode } from 'rdflib/lib/tf-types'\nimport ns from '../../lib/ns'\n\nconst baseUri = 'https://solidos.github.io/solid-ui/src/ontology/'\n\nexport function loadDocument (\n store: LiveStore,\n documentSource: string,\n documentName: string,\n documentURI?: string,\n preferRemote = false\n) {\n const finalDocumentUri = documentURI || baseUri + documentName // Full URI to the file\n const document = sym(finalDocumentUri) // rdflib NamedNode for the document\n\n if (store.holds(undefined, undefined, undefined, document)) {\n store.removeStatements(store.statementsMatching(undefined, undefined, undefined, document))\n }\n\n const parseSource = () => {\n return new Promise<void>((resolve, reject) => {\n parse(documentSource, store, finalDocumentUri, 'text/turtle', (err) => {\n if (err) {\n console.error('Parse document error for ', finalDocumentUri, err)\n reject(err)\n } else {\n resolve()\n }\n })\n })\n }\n\n if (preferRemote && documentURI) {\n return store.fetcher.load(documentURI, {\n force: true,\n clearPreviousData: true,\n }).then(() => {}).catch((err) => {\n if (documentSource && documentSource.trim().length > 0) {\n return parseSource()\n }\n throw err\n })\n }\n\n if (documentSource && documentSource.trim().length > 0) {\n return parseSource()\n }\n\n if (documentURI) {\n return store.fetcher.load(documentURI, {\n force: true,\n clearPreviousData: true,\n }).then(() => {})\n }\n\n return Promise.reject(new Error(`No document source or URI for ${documentName}`))\n}\n\nexport async function fetchData (\n store: LiveStore,\n documentURI: string\n) {\n const document = sym(documentURI) // rdflib NamedNode for the document\n\n if (store.holds(undefined, undefined, undefined, document)) {\n store.removeStatements(store.statementsMatching(undefined, undefined, undefined, document))\n }\n\n return await store.fetcher.load(documentURI, {\n force: true,\n clearPreviousData: true,\n })\n}\n\nexport function sortBySequence (\n store: LiveStore,\n list: Term[]\n) {\n const subfields = list.map((p) => {\n const k = store.any(p as any, ns.ui('sequence'))\n const seq = k ? Number((k as { value: string }).value) : 9999\n return [Number.isNaN(seq) ? 9999 : seq, p] as const\n })\n\n subfields.sort((a, b) => a[0] - b[0])\n\n return subfields.map(pair => pair[1])\n}\n\n/**\n * Which class of field is this? Relies on http://www.w3.org/2000/01/rdf-schema#subClassOf and\n * https://linkeddata.github.io/rdflib.js/doc/classes/formula.html#bottomtypeuris\n * to find the most specific RDF type if there are multiple.\n *\n * @param subject a form field, e.g. `namedNode('https://timbl.com/timbl/Public/Test/Forms/individualForm.ttl#fullNameField')`\n * @returns the URI of the most specific known class, e.g. `http://www.w3.org/ns/ui#SingleLineTextField`\n */\n// eslint-disable-next-line camelcase\nexport function mostSpecificClassURI (store: LiveStore, subject: Quad_Subject): string {\n const typeUri = store.findTypeURIs(subject)\n const specificTypes = store.bottomTypeURIs(typeUri) // most specific\n const finalTypes: any[] = []\n for (const t in specificTypes) finalTypes.push(t)\n // if (finalTypes.length > 1) throw \"Didn't expect \"+subject+\" to have multiple bottom types: \"+finalTypes\n return finalTypes[0]\n}\n\n// Find the first ui:Form node in a store, optionally matching a fragment.\n// code based on Jeff Zucker's sol-components: https://github.com/jeff-zucker/sol-components (core/form-utils.js)\nexport function findForm (store: LiveStore, sourceUri: string): NamedNode | null {\n const docUrl = sourceUri.split('#')[0]\n const fragment = sourceUri.includes('#') ? sourceUri.split('#')[1] : null\n if (fragment) {\n const candidate = sym(docUrl + '#' + fragment)\n if (store.holds(candidate, ns.rdf('type'), ns.ui('Form'))) return candidate\n }\n const forms = store.each(null, ns.rdf('type'), ns.ui('Form'))\n const found = forms.find((term) => term.termType === 'NamedNode')\n return found ? (found as NamedNode) : null\n}\n","import ns from '../../lib/ns'\nimport { style } from '../../lib/style'\n\nexport type InputType =\n | 'hidden'\n | 'text'\n | 'search'\n | 'tel'\n | 'url'\n | 'email'\n | 'password'\n | 'datetime'\n | 'date'\n | 'month'\n | 'week'\n | 'time'\n | 'datetime-local'\n | 'number'\n | 'range'\n | 'color'\n | 'checkbox'\n | 'radio'\n | 'file'\n | 'submit'\n | 'image'\n | 'reset'\n | 'button'\n\nexport type FieldParamsObject = {\n size?: number, // input element size attribute\n type?: InputType, // input element type attribute. Default: 'text' (not for Comment and Heading)\n element?: string, // element type to use (Comment and Heading only)\n style?: string, // style to use\n dt?: string, // xsd data type for the RDF Literal corresponding to the field value. Default: xsd:string\n defaultInputValue?: string, // e.g. 'mailto:'. Default value in input field, will be removed when displaying actual value to user.\n namedNode?: boolean, // if true, field value corresponds to the URI of an RDF NamedNode. Overrides dt and defaultInputValue.\n pattern?: RegExp // for client-side input validation; field will go red if violated, green if ok\n}\n\n/**\n * The fieldParams object defines various constants\n * for use in various form fields. Depending on the\n * field in questions, different values may be read\n * from here.\n */\nexport const fieldParams: { [ fieldUri: string ]: FieldParamsObject } = {\n /**\n * Text field\n *\n * For possible date popups see e.g. http://www.dynamicdrive.com/dynamicindex7/jasoncalendar.htm\n * or use HTML5: http://www.w3.org/TR/2011/WD-html-markup-20110113/input.date.html\n */\n [ns.ui('ColorField').uri]: {\n size: 9,\n type: 'color',\n style: 'height: 3em;', // around 1.5em is padding\n dt: 'color',\n pattern: /^\\s*#[0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]([0-9a-f][0-9a-f])?\\s*$/\n }, // https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/color\n\n [ns.ui('DateField').uri]: {\n size: 20,\n type: 'date',\n dt: 'date',\n pattern: /^\\s*[0-9][0-9][0-9][0-9](-[0-1]?[0-9]-[0-3]?[0-9])?Z?\\s*$/\n },\n\n [ns.ui('DateTimeField').uri]: {\n size: 20,\n type: 'datetime-local', // See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/datetime\n dt: 'dateTime',\n pattern: /^\\s*[0-9][0-9][0-9][0-9](-[0-1]?[0-9]-[0-3]?[0-9])?(T[0-2][0-9]:[0-5][0-9](:[0-5][0-9])?)?Z?\\s*$/\n },\n\n [ns.ui('TimeField').uri]: {\n size: 10,\n type: 'time',\n dt: 'time',\n pattern: /^\\s*([0-2]?[0-9]:[0-5][0-9](:[0-5][0-9])?)\\s*$/\n },\n\n [ns.ui('IntegerField').uri]: {\n size: 12,\n style: 'text-align: right;',\n dt: 'integer',\n pattern: /^\\s*-?[0-9]+\\s*$/\n },\n\n [ns.ui('DecimalField').uri]: {\n size: 12,\n style: 'text-align: right;',\n dt: 'decimal',\n pattern: /^\\s*-?[0-9]*(\\.[0-9]*)?\\s*$/\n },\n\n [ns.ui('FloatField').uri]: {\n size: 12,\n style: 'text-align: right;',\n dt: 'float',\n pattern: /^\\s*-?[0-9]*(\\.[0-9]*)?((e|E)-?[0-9]*)?\\s*$/\n },\n\n [ns.ui('SingleLineTextField').uri]: {\n\n },\n [ns.ui('NamedNodeURIField').uri]: {\n namedNode: true\n },\n [ns.ui('TextField').uri]: {\n\n },\n\n [ns.ui('PhoneField').uri]: {\n size: 20,\n defaultInputValue: 'tel:',\n pattern: /^\\+?[\\d-]+[\\d]*$/\n },\n\n [ns.ui('EmailField').uri]: {\n size: 30,\n defaultInputValue: 'mailto:',\n pattern: /^\\s*.*@.*\\..*\\s*$/ // @@ Get the right regexp here\n },\n\n [ns.ui('Group').uri]: {\n style: style.formGroupStyle\n },\n\n /**\n * Non-interactive fields\n */\n [ns.ui('Comment').uri]: {\n element: 'p',\n style: style.commentStyle\n },\n [ns.ui('Heading').uri]: {\n element: 'h3',\n style: style.formHeadingStyle\n }\n}\n","import { LiveStore } from 'rdflib'\nimport { StoreContext } from './StoreContext'\n\nexport default class NoopStore implements StoreContext {\n get store (): LiveStore {\n throw new Error('Cannot use RDF forms without a store')\n }\n}\n","import { createContext } from '@lit/context'\nimport { LiveStore } from 'rdflib'\nimport NoopStore from './NoopStore'\n\nexport interface StoreContext {\n store: LiveStore\n}\n\nexport const DEFAULT_STORE = new NoopStore()\nexport const storeContext = createContext<StoreContext>(Symbol('storeContext'))\n","import { property, state } from 'lit/decorators.js'\nimport { html } from 'lit/html.js'\nimport ns from '../../lib/ns'\nimport { customElement, generateId, WebComponent } from '@/lib/components'\nimport { Literal, NamedNode, st } from 'rdflib'\nimport { label } from '../../utils'\nimport { mostSpecificClassURI } from '../../lib/forms/rdfFormsHelper'\nimport { FieldParamsObject, fieldParams as fieldTypeParams, InputType } from '../../lib/forms/fieldParams'\nimport { DEFAULT_STORE, storeContext, StoreContext } from '@/lib/forms/store/StoreContext'\nimport { consume } from '@lit/context'\nimport '@/components/input'\n\n@customElement('solid-ui-rdf-input')\nexport default class RDFInput extends WebComponent {\n // example RDF Turtle format source:\n // :nameField a ui:SingleLineTextField ;\n // ui:property vcard:fn;\n // ui:label \"name\" .\n\n // formSubject describes the field metadata\n // dataSubject points to the data resource containing the value\n\n @consume({ context: storeContext, subscribe: true })\n private accessor storeContext: StoreContext = DEFAULT_STORE\n\n @property({ attribute: false, type: Object })\n accessor formSubject: NamedNode | null = null\n\n @property({ attribute: false, type: Object })\n accessor dataSubject: NamedNode | null = null\n\n @property({ type: Number })\n accessor storeVersion = 0\n\n @state()\n private accessor localInputValue: string | null = null\n\n private _updateInFlight = false\n private _pendingUpdateValue: string | null = null\n\n @property({ type: Boolean, reflect: true })\n accessor readonly: boolean = true // to protect data, we default to not editable\n\n constructor () {\n super()\n\n this.id = generateId()\n }\n\n render () {\n const formDocument = this.getDocument(this.formSubject)\n\n // for building the HTML input element\n const uiPropertyTerm = this.getFormProperty(this.formSubject, ns.ui('property'), formDocument)\n const inputLabel = this.getInputLabel(this.formSubject, uiPropertyTerm, formDocument)\n const readonly = this.getReadOnly(this.readonly, this.formSubject, formDocument)\n\n const fieldType = this.formSubject ? mostSpecificClassURI(this.storeContext.store, this.formSubject) : undefined\n const params = fieldType ? fieldTypeParams[fieldType] ?? {} : {}\n const inputType: InputType = params.type ?? 'text'\n\n // for populating the HTML input element\n const selectedTerm = this.getSelectedTerm(this.dataSubject, uiPropertyTerm, this.formSubject, params)\n const placeholder = readonly ? '' : this.defaultInputValue(params)\n const inputValue = this._updateInFlight || this._pendingUpdateValue !== null\n ? this.localInputValue ?? ''\n : this.termToInputValue(selectedTerm)\n\n return html`\n <solid-ui-input\n label=\"${inputLabel}\"\n name=\"name-${this.id}\"\n .value=${inputValue}\n .placeholder=${placeholder}\n type=\"${inputType}\"\n ?readonly=${readonly}\n @input=${this.updateData}\n ></solid-ui-input>`\n }\n\n private getDocument (subject: NamedNode | null | undefined) {\n return subject?.doc ? subject.doc() : undefined\n }\n\n private getFormProperty (subject: NamedNode | null | undefined, property: NamedNode, graph?: any): NamedNode | undefined {\n if (!subject) return undefined\n return this.storeContext.store.any(subject, property, null, graph) as NamedNode | undefined\n }\n\n private getInputLabel (formFieldSubject: NamedNode | null | undefined, uiPropertyTerm?: NamedNode, graph?: any): string {\n if (!formFieldSubject) return ''\n const uiLabel = this.storeContext.store.any(formFieldSubject, ns.ui('label'), null, graph)\n const propertyLabel = uiPropertyTerm ? label(uiPropertyTerm, true) : ''\n return uiLabel ? uiLabel.value : propertyLabel\n }\n\n private getReadOnly (readonly: boolean, formFieldSubject?: NamedNode | null, graph?: any): boolean {\n if (formFieldSubject && readonly === false) { // if readonly is false, we can ovverride it if the field is marked as uneditable in the form\n return !!this.storeContext.store.anyJS(formFieldSubject, ns.ui('suppressEmptyUneditable'), null, graph)\n }\n return readonly\n }\n\n private getSelectedTerm (\n dataSubject?: NamedNode | null,\n uiPropertyTerm?: NamedNode,\n formFieldSubject?: NamedNode | null,\n params?: { defaultInputValue?: string }\n ) {\n const defaultTerm = formFieldSubject\n ? this.storeContext.store.any(formFieldSubject, ns.ui('default'))\n : undefined\n\n if (!uiPropertyTerm || !dataSubject) {\n return defaultTerm\n }\n\n const inputTerm = this.storeContext.store.any(dataSubject, uiPropertyTerm)\n return inputTerm || defaultTerm\n }\n\n private termToInputValue (term: any) {\n if (!term || !('value' in term) || !term.value) return ''\n\n try {\n return decodeURIComponent(term.value)\n } catch {\n return String(term.value)\n }\n }\n\n private defaultInputValue (params: { defaultInputValue?: string } = {}) {\n const stripped = params.defaultInputValue ?? ''\n return stripped.replace(/ /g, '')\n }\n\n private async updateData (e: CustomEvent) {\n const newValue = (e.target as HTMLInputElement).value\n this.localInputValue = newValue\n this._pendingUpdateValue = newValue\n\n if (this._updateInFlight) {\n return\n }\n\n await this.runPendingUpdate()\n }\n\n private async runPendingUpdate () {\n if (this._pendingUpdateValue === null) {\n return\n }\n\n const newValue = this._pendingUpdateValue\n this._pendingUpdateValue = null\n this._updateInFlight = true\n\n const uiPropertyTerm = this.getFormProperty(this.formSubject, ns.ui('property'), this.getDocument(this.formSubject))\n if (!uiPropertyTerm || !this.dataSubject) {\n this._updateInFlight = false\n this.localInputValue = ''\n return\n }\n\n const dataDocument = this.getDocument(this.dataSubject)\n if (dataDocument && this.storeContext.store.updater?.editable(dataDocument) === false) {\n this._updateInFlight = false\n return\n }\n\n const toDeleteSt = this.storeContext.store.statementsMatching(this.dataSubject, uiPropertyTerm)\n let toInsertSt: Array<ReturnType<typeof st>> = []\n\n if (newValue) {\n let objectFromNewValue\n const fieldType = this.formSubject ? mostSpecificClassURI(this.storeContext.store, this.formSubject) : undefined\n const params: FieldParamsObject = fieldType ? fieldTypeParams[fieldType] ?? {} : {}\n if (params.namedNode) {\n objectFromNewValue = this.storeContext.store.sym(newValue)\n } else if (params.defaultInputValue) {\n objectFromNewValue = encodeURIComponent(newValue.replace(/ /g, ''))\n objectFromNewValue = this.storeContext.store.sym(params.defaultInputValue + objectFromNewValue)\n } else {\n if (params.dt) {\n objectFromNewValue = new Literal(\n newValue.trim(),\n undefined,\n ns.xsd(params.dt)\n )\n } else {\n objectFromNewValue = new Literal(newValue)\n }\n }\n toInsertSt = toDeleteSt.map((statement) => st(statement.subject, statement.predicate, objectFromNewValue, statement.why))\n if (toInsertSt.length === 0) {\n toInsertSt = [st(this.dataSubject, uiPropertyTerm, objectFromNewValue, this.getDocument(this.dataSubject))]\n }\n }\n\n try {\n await this.storeContext.store.updater.updateMany(toDeleteSt, toInsertSt as any)\n this.storeVersion += 1\n } catch (err) {\n console.error('RDFInput update failed', err)\n } finally {\n this._updateInFlight = false\n }\n\n if (this._pendingUpdateValue !== null) {\n await this.runPendingUpdate()\n }\n }\n}\n","import RDFInput from './RDFInput'\n\nexport { RDFInput }\nexport default RDFInput\n"],"mappings":";;;;;AA6DA,eAAsBgC,EACpB3B,GACAG,GACA;CACA,IAAMG,IAAWX,EAAIQ,CAAW;CAMhC,OAJIH,EAAMO,MAAMC,KAAAA,GAAWA,KAAAA,GAAWA,KAAAA,GAAWF,CAAQ,KACvDN,EAAMS,iBAAiBT,EAAMU,mBAAmBF,KAAAA,GAAWA,KAAAA,GAAWA,KAAAA,GAAWF,CAAQ,CAAC,GAGrF,MAAMN,EAAMkB,QAAQC,KAAKhB,GAAa;EAC3CiB,OAAO;EACPC,mBAAmB;CACrB,CAAC;AACH;AAEA,SAAgBO,EACd5B,GACA6B,GACA;CACA,IAAMC,IAAYD,EAAKE,KAAKC,MAAM;EAChC,IAAMC,IAAIjC,EAAMkC,IAAIF,GAAUnC,EAAGsC,GAAG,UAAU,CAAC,GACzCC,IAAMH,IAAII,OAAQJ,EAAwBK,KAAK,IAAI;EACzD,OAAO,CAACD,OAAOE,MAAMH,CAAG,IAAI,OAAOA,GAAKJ,CAAC;CAC3C,CAAC;CAID,OAFAF,EAAUU,MAAMC,GAAGC,MAAMD,EAAE,KAAKC,EAAE,EAAE,GAE7BZ,EAAUC,KAAIY,MAAQA,EAAK,EAAE;AACtC;AAWA,SAAgBC,EAAsB5C,GAAkB6C,GAA+B;CACrF,IAAMC,IAAU9C,EAAM+C,aAAaF,CAAO,GACpCG,IAAgBhD,EAAMiD,eAAeH,CAAO,GAC5CI,IAAoB,CAAA;CAC1B,KAAK,IAAMC,KAAKH,GAAeE,EAAWE,KAAKD,CAAC;CAEhD,OAAOD,EAAW;AACpB;AAIA,SAAgBG,EAAUrD,GAAkBsD,GAAqC;CAC/E,IAAMC,IAASD,EAAUE,MAAM,GAAG,CAAC,CAAC,IAC9BC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kC,EAAUC,WAAWT,GAAoBQ,EAAUE,GAAG,CAAC,GACpHX,EAAWY,WAAW,MACxBZ,IAAa,CAACpG,EAAG,KAAKqC,aAAakB,GAAgB8C,GAAoB,KAAK/C,YAAY,KAAKjB,WAAW,CAAC,CAAC;EAE9G;EAEA,IAAI;GAEF,AADA,MAAM,KAAK/B,aAAawD,MAAMkC,QAAQiB,WAAWf,GAAYE,CAAiB,GAC9E,KAAK9D,gBAAgB;EACvB,SAAS4E,GAAK;GACZC,QAAQC,MAAM,0BAA0BF,CAAG;EAC7C,UAAU;GACR,KAAK3C,kBAAkB;EACzB;EAEA,AAAI,KAAKC,wBAAwB,QAC/B,MAAM,KAAKsB,iBAAiB;CAEhC;AACF,GAAC,CAAAH,GAAA,CAAA/C,GAAAC,GAAAC,GAAAC,GAAAC,GAAAE,GAAAP,IAAA2E,GAAA,CAAA7G,GAAA8G,MAAAC,EAAAH,GAAA;CAAA;EAAAnG;EAAA;EAAA;CAAA;CAAA;EAAAG;EAAA;EAAA;CAAA;CAAA;EAAAI;EAAA;EAAA;CAAA;CAAA;EAAAC;EAAA;EAAA;CAAA;CAAA;EAAAE;EAAA;EAAA;CAAA;CAAA;EAAAC;EAAA;EAAA;CAAA;AAAA,GAAArB,GAAA,GAAA,KAAA,GAvMqCV,CAAY,GAAAyH,EAAA;;;ACVlD,IAAA,KAAeG"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as e, o as t } from "./auth-
|
|
1
|
+
import { a as e, o as t } from "./auth-YsyyEh_c.js";
|
|
2
2
|
import { b as n, g as r, o as i, u as a } from "./components-BHoVP7zE.js";
|
|
3
3
|
import "./button-CnmrOsEf.js";
|
|
4
4
|
//#region src/components/signup-button/SignupButton.ts
|
|
@@ -206,4 +206,4 @@ var T = C;
|
|
|
206
206
|
//#endregion
|
|
207
207
|
export { C as n, T as t };
|
|
208
208
|
|
|
209
|
-
//# sourceMappingURL=signup-button-
|
|
209
|
+
//# sourceMappingURL=signup-button-DufShSEV.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"signup-button-
|
|
1
|
+
{"version":3,"file":"signup-button-DufShSEV.js","names":["customElement","WebComponent","consume","html","authContext","DEFAULT_AUTH_CONTEXT","_classDecs","_SignupButton","_A","WeakMap","_ref","_authDecs","context","subscribe","SignupButton","constructor","args","_classPrivateFieldInitSpec","_initProto","_init_auth","_classPrivateFieldGet","auth","v","_classPrivateFieldSet","render","onClick","click","signup","e","preventDefault","_SignupButton2","c","_initClass","_applyDecs","default","SignupButton"],"sources":["../../src/components/signup-button/SignupButton.ts","../../src/components/signup-button/index.ts"],"sourcesContent":["import { customElement, WebComponent } from '@/lib/components'\nimport { consume } from '@lit/context'\nimport { html } from 'lit'\nimport { authContext, AuthContext, DEFAULT_AUTH_CONTEXT } from '@/lib/auth'\n\nimport '@/components/button'\n\n@customElement('solid-ui-signup-button')\nexport default class SignupButton extends WebComponent {\n @consume({ context: authContext, subscribe: true })\n private accessor auth: AuthContext = DEFAULT_AUTH_CONTEXT\n\n protected render () {\n return html`\n <slot name=\"trigger\" @click=${this.onClick}>\n <solid-ui-button>\n <slot>\n Sign Up\n </slot>\n </solid-ui-button>\n </slot>\n `\n }\n\n click () {\n this.auth.signup()\n }\n\n private onClick (e: MouseEvent) {\n e.preventDefault()\n\n this.click()\n }\n}\n","import SignupButton from './SignupButton'\n\nexport { SignupButton }\nexport default SignupButton\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAK4BM,IAAA,CAE3BN,EAAc,wBAAwB,CAAC;AAAA,IAAAO,GAAAC,kBAAA,IAAAC,QAAA;AAAAC,KAAAC,IAErCT,EAAQ;CAAEU,SAASR;CAAaS,WAAW;AAAK,CAAC,GAAC,SAwBpDiB,IAAAhB,cAzByCb,EAAa;CAAAc,YAAA,GAAAC,GAAA;EAAAC,AAAA,MAAA,GAAAD,CAAA,GAAAC,EAAA,MAAAT,IAAAU,EAAA,IAAA,GAAAC,EAAA,MAEhBd,CAAoB,EAAA;CAAA;CAAA,KAAAK,KAAA;EAAA,OAAAU,EAAAZ,GAAA,IAAA;CAAA;CAAA,IAAxCa,KAAIC,GAAA;EAAAC,EAAAf,GAAA,MAAAc,CAAA;CAAA;CAEXE,SAAU;EAClB,OAAOrB,CAAI;oCACqB,KAAKsB,QAAO;;;;;;;;CAQ9C;CAEAC,QAAS;EACP,KAAKL,KAAKM,OAAO;CACnB;CAEQF,QAASG,GAAe;EAG9B,AAFAA,EAAEC,eAAe,GAEjB,KAAKH,MAAM;CACb;AACF,GAAC,CAAAE,GAAA,CAAAT,GAAAD,IAAAa,GAAA,CAAAxB,GAAAyB,MAAAC,EAAAH,GAAA,CAAA;CAAAnB;CAAA;CAAA;AAAA,CAAA,GAAAL,GAAA,GAAA,KAAA,GAzByCL,CAAY,GAAA+B,EAAA;;;ACLtD,IAAA,IAAeG"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { A as e, B as t, C as n, D as r, E as i, F as a, H as o, I as s, L as c, M as l, N as u, O as d, P as f, R as p, S as m, T as h, U as g, V as _, _ as v, a as y, b, c as x, d as S, f as C, g as w, h as T, i as E, j as ee, k as D, l as te, m as O, n as ne, o as re, p as ie, r as ae, s as oe, t as k, u as se, v as ce, w as le, x as A, y as ue, z as de } from "./index.esm-
|
|
2
|
-
import { l as fe } from "./auth-
|
|
3
|
-
import { a as pe, c as me, d as he, f as ge, i as _e, l as ve, m as ye, n as be, o as xe, p as Se, r as Ce, s as we, t as j, u as M } from "./style-
|
|
1
|
+
import { A as e, B as t, C as n, D as r, E as i, F as a, H as o, I as s, L as c, M as l, N as u, O as d, P as f, R as p, S as m, T as h, U as g, V as _, _ as v, a as y, b, c as x, d as S, f as C, g as w, h as T, i as E, j as ee, k as D, l as te, m as O, n as ne, o as re, p as ie, r as ae, s as oe, t as k, u as se, v as ce, w as le, x as A, y as ue, z as de } from "./index.esm-C63HBmfn.js";
|
|
2
|
+
import { l as fe } from "./auth-YsyyEh_c.js";
|
|
3
|
+
import { a as pe, c as me, d as he, f as ge, i as _e, l as ve, m as ye, n as be, o as xe, p as Se, r as Ce, s as we, t as j, u as M } from "./style-DI3buiHt.js";
|
|
4
4
|
import { x as Te } from "./components-BHoVP7zE.js";
|
|
5
5
|
import "./dialogs-D2n-R0lI.js";
|
|
6
6
|
//#region src/lib/debug.ts
|
|
@@ -15577,7 +15577,7 @@ function lu(e, t, n, r, i) {
|
|
|
15577
15577
|
//#region src/create/types.ts
|
|
15578
15578
|
var uu = /* @__PURE__ */ _({}), du = Te(Symbol("file-explorer")), fu = [], pu = [];
|
|
15579
15579
|
(() => {
|
|
15580
|
-
let e = "lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,
|
|
15580
|
+
let e = "lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,1n,9,16,o,,x,1i,3,,i,,7,a,2,t,3,1k,,,7,2,2,2,3,9,,a,2,q,,2,3,1k,,,5,4,2,2,3,3,,u,2,3,,b,3,1k,,,8,,3,,3,k,2,m,6,,3,1k,,,7,2,2,2,3,7,3,a,2,u,,1n,5,3,3,,4,9,,14,5,1j,,,7,,3,,4,7,2,b,2,t,3,1k,,,7,,3,,4,7,2,b,2,f,,c,4,1j,2,,7,,3,,4,9,,a,2,t,3,1y,,4,6,,,,8,i,2,1p,,,8,c,8,2q,,,a,b,7,21,2,r,,,,,,4,2,1d,k,,2,5,b,,10,9,,2u,b,,6,n,4,4,3,g,4,d,,,3,6,,f,,jj,3,qa,4,s,3,t,2,u,2,1s,w,9,,19,3,,,39,2,y,,3a,c,4,c,63,5,1l,a,,,,,2,o,2,,1c,1a,2,c,k,5,1b,h,12,9,c,3,u,d,1k,e,1c,k,48,3,,l,4,,6,,2,3,5i,1s,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,n,5,4,,2b,2,1e,i,q,i,d,,12,8,p,d,18,4,1b,e,10,,1v,e,c,,8,2,1a,,1f,,,3,2,2,5,2,,,15,5,5,2,6k,8,,2,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,1t,5,8t,2,25,6,1y,b,1d,4,3e,3,1h,f,15,,2,2,a,4,19,b,7,,1p,3,10,e,g,2,18,,c,3,1c,e,8,4,,2,2k,c,6,,2,,4d,c,l,4,1j,2,,7,2,2,2,3,9,,a,2,2,7,3,5,1v,9,,,2,,,4,,5,,,e,2,2a,i,n,,29,k,6j,7,2,9,r,2,2a,h,2y,d,2t,3,2,a,74,f,6t,6,,2,2,4,,,,2,3x,7,2,7,3,,s,a,14,7,,4,8,,9,b,1a,g,5i,8,5j,8,,8,2a,m,,e,3e,6,3,,,2,,7,,,1u,5,,2,,5,9n,4,9,2,,,1c,7,3,5,n,,44l,,6,f,8ug,i,1xc,5,1n,7,t4,,,1j,7,4,29,,b,2,f57,2,3mp,1a,2,n,f2,5,3,6,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,2s,,4g,7,af,,1p,4,e4,4,72,2,6r,,2,,7,2,5,,d6,7,31,7,240,5".split(",").map((e) => e ? parseInt(e, 36) : 1);
|
|
15581
15581
|
for (let t = 0, n = 0; t < e.length; t++) (t % 2 ? pu : fu).push(n += e[t]);
|
|
15582
15582
|
})();
|
|
15583
15583
|
function mu(e) {
|
|
@@ -32789,4 +32789,4 @@ var $j = {
|
|
|
32789
32789
|
//#endregion
|
|
32790
32790
|
export { I as S, Zi as _, su as a, ni as b, Nl as c, Lc as d, jc as f, ta as g, ia as h, uu as i, Sl as l, ua as m, eM as n, Jl as o, fa as p, du as r, Pl as s, tM as t, xl as u, Qi as v, Bn as x, ai as y };
|
|
32791
32791
|
|
|
32792
|
-
//# sourceMappingURL=src-
|
|
32792
|
+
//# sourceMappingURL=src-CbkVtLGQ.js.map
|