@pod-os/elements 0.26.1-rc.6fb2bdc.0 → 0.26.1-rc.82a37be.0
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/cjs/elements.cjs.js +1 -1
- package/dist/cjs/ion-badge_5.cjs.entry.js +1 -1
- package/dist/cjs/ion-icon_31.cjs.entry.js +33 -14
- package/dist/cjs/ion-icon_31.cjs.entry.js.map +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/pos-app-generic.cjs.entry.js +1 -1
- package/dist/cjs/pos-app-ldp-container.cjs.entry.js +1 -1
- package/dist/cjs/pos-app-rdf-document.cjs.entry.js +1 -1
- package/dist/collection/apps/pos-app-dashboard/pos-getting-started/pos-getting-started.css +12 -0
- package/dist/collection/apps/pos-app-dashboard/pos-getting-started/pos-getting-started.js +19 -1
- package/dist/collection/apps/pos-app-dashboard/pos-getting-started/pos-getting-started.js.map +1 -1
- package/dist/collection/apps/pos-app-generic/pos-app-generic.js +1 -1
- package/dist/collection/apps/pos-app-ldp-container/pos-app-ldp-container.js +1 -1
- package/dist/collection/apps/pos-app-rdf-document/pos-app-rdf-document.js +1 -1
- package/dist/collection/apps/pos-app-settings/pos-app-settings.js +1 -1
- package/dist/collection/apps/pos-app-settings/pos-setting-offline-cache/pos-setting-offline-cache.js +1 -1
- package/dist/collection/components/pos-add-new-thing/pos-add-new-thing.js +1 -1
- package/dist/collection/components/pos-app/pos-app.js +1 -1
- package/dist/collection/components/pos-dialog/pos-dialog.js +1 -1
- package/dist/collection/components/pos-error-toast/pos-error-toast.js +1 -1
- package/dist/collection/components/pos-literals/pos-literals.js +1 -1
- package/dist/collection/components/pos-login/pos-login.js +27 -2
- package/dist/collection/components/pos-login/pos-login.js.map +1 -1
- package/dist/collection/components/pos-login-form/pos-login-form.js +1 -1
- package/dist/collection/components/pos-navigation/bar/pos-navigation-bar.css +10 -0
- package/dist/collection/components/pos-navigation/bar/pos-navigation-bar.js +4 -1
- package/dist/collection/components/pos-navigation/bar/pos-navigation-bar.js.map +1 -1
- package/dist/collection/components/pos-navigation/pos-navigation.css +1 -1
- package/dist/collection/components/pos-navigation/pos-navigation.js +1 -1
- package/dist/collection/components/pos-navigation/pos-navigation.js.map +1 -1
- package/dist/components/pos-add-new-thing2.js +1 -1
- package/dist/components/pos-app-generic.js +1 -1
- package/dist/components/pos-app-ldp-container.js +1 -1
- package/dist/components/pos-app-rdf-document.js +1 -1
- package/dist/components/pos-app-settings2.js +1 -1
- package/dist/components/pos-app2.js +1 -1
- package/dist/components/pos-dialog2.js +1 -1
- package/dist/components/pos-error-toast2.js +1 -1
- package/dist/components/pos-getting-started2.js +4 -3
- package/dist/components/pos-getting-started2.js.map +1 -1
- package/dist/components/pos-literals2.js +1 -1
- package/dist/components/pos-login-form2.js +1 -1
- package/dist/components/pos-login2.js +19 -3
- package/dist/components/pos-login2.js.map +1 -1
- package/dist/components/pos-navigation-bar2.js +5 -2
- package/dist/components/pos-navigation-bar2.js.map +1 -1
- package/dist/components/pos-navigation2.js +2 -2
- package/dist/components/pos-navigation2.js.map +1 -1
- package/dist/components/pos-setting-offline-cache2.js +1 -1
- package/dist/elements/elements.esm.js +1 -1
- package/dist/elements/elements.esm.js.map +1 -1
- package/dist/elements/p-0252f287.entry.js +20 -0
- package/dist/elements/p-0252f287.entry.js.map +1 -0
- package/dist/elements/{p-c466d5bf.entry.js → p-178b3852.entry.js} +2 -2
- package/dist/elements/{p-dbb94429.entry.js → p-2cda3231.entry.js} +2 -2
- package/dist/elements/p-c27a94bc.entry.js +2 -0
- package/dist/elements/p-e1957ea1.entry.js +2 -0
- package/dist/esm/elements.js +1 -1
- package/dist/esm/ion-badge_5.entry.js +1 -1
- package/dist/esm/ion-icon_31.entry.js +33 -14
- package/dist/esm/ion-icon_31.entry.js.map +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/pos-app-generic.entry.js +1 -1
- package/dist/esm/pos-app-ldp-container.entry.js +1 -1
- package/dist/esm/pos-app-rdf-document.entry.js +1 -1
- package/dist/types/apps/pos-app-dashboard/pos-getting-started/pos-getting-started.d.ts +2 -0
- package/dist/types/components/pos-login/pos-login.d.ts +5 -0
- package/dist/types/components/pos-navigation/bar/pos-navigation-bar.d.ts +1 -0
- package/dist/types/components.d.ts +16 -0
- package/package.json +1 -1
- package/dist/elements/p-7c14c1f9.entry.js +0 -20
- package/dist/elements/p-7c14c1f9.entry.js.map +0 -1
- package/dist/elements/p-b1de75a4.entry.js +0 -2
- package/dist/elements/p-ff684bff.entry.js +0 -2
- /package/dist/elements/{p-c466d5bf.entry.js.map → p-178b3852.entry.js.map} +0 -0
- /package/dist/elements/{p-dbb94429.entry.js.map → p-2cda3231.entry.js.map} +0 -0
- /package/dist/elements/{p-ff684bff.entry.js.map → p-c27a94bc.entry.js.map} +0 -0
- /package/dist/elements/{p-b1de75a4.entry.js.map → p-e1957ea1.entry.js.map} +0 -0
|
@@ -14,6 +14,9 @@ section.current {
|
|
|
14
14
|
section.current button {
|
|
15
15
|
cursor: pointer;
|
|
16
16
|
font-size: var(--scale-1);
|
|
17
|
+
display: flex;
|
|
18
|
+
align-items: center;
|
|
19
|
+
justify-content: center;
|
|
17
20
|
flex-grow: 1;
|
|
18
21
|
background: none;
|
|
19
22
|
color: var(--pos-normal-text-color);
|
|
@@ -25,4 +28,11 @@ section.current button {
|
|
|
25
28
|
&:focus {
|
|
26
29
|
text-decoration: underline;
|
|
27
30
|
}
|
|
31
|
+
:first-child {
|
|
32
|
+
flex-grow: 1;
|
|
33
|
+
}
|
|
34
|
+
svg {
|
|
35
|
+
width: var(--size-6);
|
|
36
|
+
color: var(--pos-subtle-text-color);
|
|
37
|
+
}
|
|
28
38
|
}
|
|
@@ -11,7 +11,10 @@ export class PosNavigationBar {
|
|
|
11
11
|
}
|
|
12
12
|
render() {
|
|
13
13
|
const ariaLabel = this.current ? `${this.current.label()} (Click to search or enter URI)` : 'Search or enter URI';
|
|
14
|
-
return (h("section", { key: '
|
|
14
|
+
return (h("section", { key: '1b507d50bd24f257023fe980f1ffdb3abe903577', class: "current" }, this.current && this.searchIndexReady && h("pos-make-findable", { key: 'e96559f40418154a26350705ae6e3dbf8057a424', uri: this.current.uri }), h("button", { key: '2ac476bd89918e71ca10cc945952f8c9905865df', "aria-label": ariaLabel, onClick: () => this.onClick() }, h("div", { key: 'd34b73e2090f08cab8533d03a7b206d420bfa8c2' }, this.current ? this.current.label() : 'Search or enter URI'), this.icon())));
|
|
15
|
+
}
|
|
16
|
+
icon() {
|
|
17
|
+
return (h("svg", { "aria-hidden": "true", xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 24 24", "stroke-width": "1.5", stroke: "currentColor" }, h("path", { "stroke-linecap": "round", "stroke-linejoin": "round", d: "m21 21-5.197-5.197m0 0A7.5 7.5 0 1 0 5.196 5.196a7.5 7.5 0 0 0 10.607 10.607Z" })));
|
|
15
18
|
}
|
|
16
19
|
static get is() { return "pos-navigation-bar"; }
|
|
17
20
|
static get encapsulation() { return "shadow"; }
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pos-navigation-bar.js","sourceRoot":"","sources":["../../../../../src/components/pos-navigation/bar/pos-navigation-bar.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAgB,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAQhF,MAAM,OAAO,gBAAgB;IAMnB,OAAO;QACb,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IACnC,CAAC;IAGD,QAAQ,CAAC,CAAgB;QACvB,IAAI,CAAC,CAAC,CAAC,OAAO,IAAI,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,GAAG,KAAK,GAAG,EAAE,CAAC;YAC9C,CAAC,CAAC,cAAc,EAAE,CAAC;YACnB,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAA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AAS;YACrB,IAAI,CAAC,OAAO,IAAI,IAAI,CAAC,gBAAgB,IAAI,0EAAmB,GAAG,EAAE,IAAI,CAAC,OAAO,CAAC,GAAG,GAAsB;YACxG,6EAAoB,SAAS,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,OAAO,EAAE;gBAC1D,8DAAM,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,qBAAqB,CAAO;gBACvE,IAAI,CAAC,IAAI,EAAE,CACL,CACD,CACX,CAAC;IACJ,CAAC;IAEO,IAAI;QACV,OAAO,CACL,0BACc,MAAM,EAClB,KAAK,EAAC,4BAA4B,EAClC,IAAI,EAAC,MAAM,EACX,OAAO,EAAC,WAAW,kBACN,KAAK,EAClB,MAAM,EAAC,cAAc;YAErB,8BACiB,OAAO,qBACN,OAAO,EACvB,CAAC,EAAC,+EAA+E,GACjF,CACE,CACP,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Event, EventEmitter, h, Listen, Prop } from '@stencil/core';\nimport { Thing } from '@pod-os/core';\n\n@Component({\n tag: 'pos-navigation-bar',\n shadow: true,\n styleUrl: 'pos-navigation-bar.css',\n})\nexport class PosNavigationBar {\n @Prop() current?: Thing;\n @Prop() searchIndexReady: boolean;\n\n @Event({ eventName: 'pod-os:navigate' }) navigate: EventEmitter;\n\n private onClick() {\n this.navigate.emit(this.current);\n }\n\n @Listen('keydown', { target: 'document' })\n activate(e: KeyboardEvent) {\n if ((e.ctrlKey || e.metaKey) && e.key === 'k') {\n e.preventDefault();\n this.navigate.emit(this.current);\n }\n }\n\n render() {\n const ariaLabel = this.current ? `${this.current.label()} (Click to search or enter URI)` : 'Search or enter URI';\n\n return (\n <section class=\"current\">\n {this.current && this.searchIndexReady && <pos-make-findable uri={this.current.uri}></pos-make-findable>}\n <button aria-label={ariaLabel} onClick={() => this.onClick()}>\n <div>{this.current ? this.current.label() : 'Search or enter URI'}</div>\n {this.icon()}\n </button>\n </section>\n );\n }\n\n private icon() {\n return (\n <svg\n aria-hidden=\"true\"\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n stroke-width=\"1.5\"\n stroke=\"currentColor\"\n >\n <path\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n d=\"m21 21-5.197-5.197m0 0A7.5 7.5 0 1 0 5.196 5.196a7.5 7.5 0 0 0 10.607 10.607Z\"\n />\n </svg>\n );\n }\n}\n"]}
|
|
@@ -113,7 +113,7 @@ export class PosNavigation {
|
|
|
113
113
|
}
|
|
114
114
|
}
|
|
115
115
|
render() {
|
|
116
|
-
return (h("nav", { key: '
|
|
116
|
+
return (h("nav", { key: '5c6c07b6b2f9ccb0e45bd59b5e477d8ed3d52c2d' }, h("search", { key: '19997ad34212d679547ad5e1bb2f5ea53e576361' }, h("pos-navigation-bar", { key: '2d1c073b2c53ba8cd5afbb595cc95015e5a50e5b', searchIndexReady: this.searchIndex !== undefined, current: this.resource }), h("dialog", { key: '55de5a58604feaf54426b643b434560dbc55a9a1', ref: el => (this.dialogRef = el) }, h("form", { key: '50c064938ec275b53bde81d9bb6c86e0c708a625', method: "dialog", onSubmit: () => this.onSubmit() }, h("input", { key: 'ca06fd69e8346cb8bb0868560f39987b4545c8f5', ref: el => (this.inputRef = el), enterkeyhint: "search", "aria-label": "Search or enter URI", placeholder: "Search or enter URI", value: this.uri, onChange: e => this.onChange(e), onInput: e => this.onChange(e), role: "combobox", "aria-autocomplete": "list", "aria-expanded": this.suggestions.length > 0, "aria-controls": "suggestions-list", "aria-activedescendant": this.selectedIndex >= 0 ? `option-${this.selectedIndex}` : null }), this.suggestions.length > 0 ? (h("div", { class: "suggestions" }, h("ol", { id: "suggestions-list", role: "listbox", "aria-label": "Search results" }, this.suggestions.map((it, index) => (h("li", { id: `option-${index}`, role: "option", "aria-selected": index === this.selectedIndex ? 'true' : 'false' }, h("pos-rich-link", { uri: it.ref }))))))) : null)))));
|
|
117
117
|
}
|
|
118
118
|
static get is() { return "pos-navigation"; }
|
|
119
119
|
static get encapsulation() { return "shadow"; }
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pos-navigation.js","sourceRoot":"","sources":["../../../../src/components/pos-navigation/pos-navigation.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAgB,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAC9F,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAE7C,OAAO,OAAO,MAAM,qBAAqB,CAAC;AAC1C,OAAO,EAAiC,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAWrF,MAAM,OAAO,aAAa;IAL1B;QAaE;;WAEG;QACK,QAAG,GAAW,EAAE,CAAC;QAEzB;;WAEG;QACc,eAAU,GAAW,IAAI,CAAC,GAAG,CAAC;QAItC,gBAAW,GAAiB,SAAS,CAAC;QAE9B,gBAAW,GAAG,EAAE,CAAC;QAEjB,kBAAa,GAAG,CAAC,CAAC,CAAC;QAEnB,aAAQ,GAAU,IAAI,CAAC;QAEvB,iBAAY,GAAG,IAAI,OAAO,EAAQ,CAAC;QAC5C,oBAAe,GAAG,IAAI,CAAC;QAsD/B,iBAAY,GAAG,KAAK,EAAE,EAAS,EAAE,EAAE;YACjC,IAAI,CAAC,EAAE,GAAG,EAAE,CAAC;QACf,CAAC,CAAC;KAuFH;IA3IC,cAAc;;QACZ,IAAI,CAAC;YACH,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,MAAA,IAAI,CAAC,EAAE,0CAAE,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,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AAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,GAC9B;wBACD,IAAI,CAAC,WAAW,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,CAC7B,WAAK,KAAK,EAAC,aAAa;4BACtB,cACG,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,KAAK,EAAE,EAAE,CAAC,CACnC,UAAI,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE;gCACvD,qBAAe,GAAG,EAAE,EAAE,CAAC,GAAG,GAAkB,CACzC,CACN,CAAC,CACC,CACD,CACP,CAAC,CAAC,CAAC,IAAI,CACH,CACA,CACF,CACL,CACP,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { PodOS, SearchIndex, Thing } from '@pod-os/core';\nimport { Component, Event, EventEmitter, h, Listen, Prop, State, Watch } from '@stencil/core';\nimport { debounceTime, Subject } from 'rxjs';\n\nimport session from '../../store/session';\nimport { PodOsAware, PodOsEventEmitter, subscribePodOs } from '../events/PodOsAware';\n\ninterface NavigateEvent {\n detail: Thing | null;\n}\n\n@Component({\n tag: 'pos-navigation',\n shadow: true,\n styleUrl: 'pos-navigation.css',\n})\nexport class PosNavigation implements PodOsAware {\n @State() private os: PodOS;\n private dialogRef?: HTMLDialogElement;\n\n private inputRef?: HTMLInputElement;\n\n @Event({ eventName: 'pod-os:init' }) subscribePodOs: PodOsEventEmitter;\n\n /**\n * Initial value of the navigation bar\n */\n @Prop() uri: string = '';\n\n /**\n * Current value of the input field\n */\n @State() private inputValue: string = this.uri;\n\n @Event({ eventName: 'pod-os:link' }) linkEmitter: EventEmitter;\n\n @State() searchIndex?: SearchIndex = undefined;\n\n @State() private suggestions = [];\n\n @State() private selectedIndex = -1;\n\n @State() private resource: Thing = null;\n\n private readonly changeEvents = new Subject<void>();\n private debouncedSearch = null;\n\n @Watch('uri')\n @Watch('os')\n updateResource(): void {\n try {\n this.resource = this.uri ? this.os?.store.get(this.uri) : null;\n } catch {\n this.resource = null;\n }\n }\n\n componentWillLoad() {\n subscribePodOs(this);\n this.updateResource();\n session.onChange('isLoggedIn', async isLoggedIn => {\n if (isLoggedIn) {\n await this.buildSearchIndex();\n } else {\n this.clearSearchIndex();\n }\n });\n this.debouncedSearch = this.changeEvents.pipe(debounceTime(300)).subscribe(() => this.search());\n }\n\n disconnectedCallback() {\n this.debouncedSearch?.unsubscribe();\n }\n\n @Listen('pod-os:search:index-created')\n private async buildSearchIndex() {\n this.searchIndex = await this.os.buildSearchIndex(session.state.profile);\n }\n\n @Listen('pod-os:search:index-updated')\n rebuildSearchIndex() {\n this.searchIndex.rebuild();\n }\n\n @Listen('pod-os:navigate')\n openNavigationDialog(e: NavigateEvent) {\n this.resource = e.detail;\n if (e.detail) {\n this.inputValue = e.detail.uri;\n this.search();\n }\n this.inputRef?.select();\n this.dialogRef?.show();\n }\n\n private clearSearchIndex() {\n this.searchIndex?.clear();\n }\n\n receivePodOs = async (os: PodOS) => {\n this.os = os;\n };\n\n private onChange(event) {\n this.inputValue = event.target.value;\n this.changeEvents.next();\n }\n\n @Listen('click', { target: 'document' })\n closeDialog() {\n this.dialogRef?.close();\n this.selectedIndex = -1;\n }\n\n @Listen('pod-os:link')\n clearSuggestions() {\n this.suggestions = [];\n this.dialogRef?.close();\n this.selectedIndex = -1;\n }\n\n @Listen('click')\n onClickSelf(event) {\n event.stopPropagation();\n }\n\n @Listen('keydown')\n handleKeyDown(ev: KeyboardEvent) {\n if (ev.key === 'Escape') {\n this.closeDialog();\n } else if (ev.key === 'ArrowDown') {\n ev.preventDefault();\n this.selectedIndex = Math.min(this.selectedIndex + 1, this.suggestions.length - 1);\n } else if (ev.key === 'ArrowUp') {\n ev.preventDefault();\n this.selectedIndex = Math.max(this.selectedIndex - 1, 0);\n }\n }\n\n private search() {\n if (this.searchIndex) {\n this.suggestions = this.inputValue ? this.searchIndex.search(this.inputValue) : [];\n }\n }\n\n private onSubmit() {\n if (this.suggestions && this.selectedIndex > -1) {\n this.linkEmitter.emit(this.suggestions[this.selectedIndex].ref);\n } else {\n this.linkEmitter.emit(this.inputValue);\n }\n }\n\n render() {\n return (\n <nav>\n <search>\n <pos-navigation-bar\n searchIndexReady={this.searchIndex !== undefined}\n current={this.resource}\n ></pos-navigation-bar>\n <dialog ref={el => (this.dialogRef = el)}>\n <form method=\"dialog\" onSubmit={() => this.onSubmit()}>\n <input\n ref={el => (this.inputRef = el)}\n enterkeyhint=\"search\"\n placeholder=\"Search or enter URI\"\n value={this.uri}\n onChange={e => this.onChange(e)}\n onInput={e => this.onChange(e)}\n />\n {this.suggestions.length > 0 ? (\n <div class=\"suggestions\">\n <ol>\n {this.suggestions.map((it, index) => (\n <li class={index === this.selectedIndex ? 'selected' : ''}>\n <pos-rich-link uri={it.ref}></pos-rich-link>\n </li>\n ))}\n </ol>\n </div>\n ) : null}\n </form>\n </dialog>\n </search>\n </nav>\n );\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"pos-navigation.js","sourceRoot":"","sources":["../../../../src/components/pos-navigation/pos-navigation.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAgB,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAC9F,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAE7C,OAAO,OAAO,MAAM,qBAAqB,CAAC;AAC1C,OAAO,EAAiC,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAWrF,MAAM,OAAO,aAAa;IAL1B;QAaE;;WAEG;QACK,QAAG,GAAW,EAAE,CAAC;QAEzB;;WAEG;QACc,eAAU,GAAW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,qBAAe,GAAG,EAAE,EAAE,CAAC,GAAG,GAAkB,CACzC,CACN,CAAC,CACC,CACD,CACP,CAAC,CAAC,CAAC,IAAI,CACH,CACA,CACF,CACL,CACP,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { PodOS, SearchIndex, Thing } from '@pod-os/core';\nimport { Component, Event, EventEmitter, h, Listen, Prop, State, Watch } from '@stencil/core';\nimport { debounceTime, Subject } from 'rxjs';\n\nimport session from '../../store/session';\nimport { PodOsAware, PodOsEventEmitter, subscribePodOs } from '../events/PodOsAware';\n\ninterface NavigateEvent {\n detail: Thing | null;\n}\n\n@Component({\n tag: 'pos-navigation',\n shadow: true,\n styleUrl: 'pos-navigation.css',\n})\nexport class PosNavigation implements PodOsAware {\n @State() private os: PodOS;\n private dialogRef?: HTMLDialogElement;\n\n private inputRef?: HTMLInputElement;\n\n @Event({ eventName: 'pod-os:init' }) subscribePodOs: PodOsEventEmitter;\n\n /**\n * Initial value of the navigation bar\n */\n @Prop() uri: string = '';\n\n /**\n * Current value of the input field\n */\n @State() private inputValue: string = this.uri;\n\n @Event({ eventName: 'pod-os:link' }) linkEmitter: EventEmitter;\n\n @State() searchIndex?: SearchIndex = undefined;\n\n @State() private suggestions = [];\n\n @State() private selectedIndex = -1;\n\n @State() private resource: Thing = null;\n\n private readonly changeEvents = new Subject<void>();\n private debouncedSearch = null;\n\n @Watch('uri')\n @Watch('os')\n updateResource(): void {\n try {\n this.resource = this.uri ? this.os?.store.get(this.uri) : null;\n } catch {\n this.resource = null;\n }\n }\n\n componentWillLoad() {\n subscribePodOs(this);\n this.updateResource();\n session.onChange('isLoggedIn', async isLoggedIn => {\n if (isLoggedIn) {\n await this.buildSearchIndex();\n } else {\n this.clearSearchIndex();\n }\n });\n this.debouncedSearch = this.changeEvents.pipe(debounceTime(300)).subscribe(() => this.search());\n }\n\n disconnectedCallback() {\n this.debouncedSearch?.unsubscribe();\n }\n\n @Listen('pod-os:search:index-created')\n private async buildSearchIndex() {\n this.searchIndex = await this.os.buildSearchIndex(session.state.profile);\n }\n\n @Listen('pod-os:search:index-updated')\n rebuildSearchIndex() {\n this.searchIndex.rebuild();\n }\n\n @Listen('pod-os:navigate')\n openNavigationDialog(e: NavigateEvent) {\n this.resource = e.detail;\n if (e.detail) {\n this.inputValue = e.detail.uri;\n this.search();\n }\n this.inputRef?.select();\n this.dialogRef?.show();\n }\n\n private clearSearchIndex() {\n this.searchIndex?.clear();\n }\n\n receivePodOs = async (os: PodOS) => {\n this.os = os;\n };\n\n private onChange(event) {\n this.inputValue = event.target.value;\n this.changeEvents.next();\n }\n\n @Listen('click', { target: 'document' })\n closeDialog() {\n this.dialogRef?.close();\n this.selectedIndex = -1;\n }\n\n @Listen('pod-os:link')\n clearSuggestions() {\n this.suggestions = [];\n this.dialogRef?.close();\n this.selectedIndex = -1;\n }\n\n @Listen('click')\n onClickSelf(event) {\n event.stopPropagation();\n }\n\n @Listen('keydown')\n handleKeyDown(ev: KeyboardEvent) {\n if (ev.key === 'Escape') {\n this.closeDialog();\n } else if (ev.key === 'ArrowDown') {\n ev.preventDefault();\n this.selectedIndex = Math.min(this.selectedIndex + 1, this.suggestions.length - 1);\n } else if (ev.key === 'ArrowUp') {\n ev.preventDefault();\n this.selectedIndex = Math.max(this.selectedIndex - 1, 0);\n }\n }\n\n private search() {\n if (this.searchIndex) {\n this.suggestions = this.inputValue ? this.searchIndex.search(this.inputValue) : [];\n }\n }\n\n private onSubmit() {\n if (this.suggestions && this.selectedIndex > -1) {\n this.linkEmitter.emit(this.suggestions[this.selectedIndex].ref);\n } else {\n this.linkEmitter.emit(this.inputValue);\n }\n }\n\n render() {\n return (\n <nav>\n <search>\n <pos-navigation-bar\n searchIndexReady={this.searchIndex !== undefined}\n current={this.resource}\n ></pos-navigation-bar>\n <dialog ref={el => (this.dialogRef = el)}>\n <form method=\"dialog\" onSubmit={() => this.onSubmit()}>\n <input\n ref={el => (this.inputRef = el)}\n enterkeyhint=\"search\"\n aria-label=\"Search or enter URI\"\n placeholder=\"Search or enter URI\"\n value={this.uri}\n onChange={e => this.onChange(e)}\n onInput={e => this.onChange(e)}\n role=\"combobox\"\n aria-autocomplete=\"list\"\n aria-expanded={this.suggestions.length > 0}\n aria-controls=\"suggestions-list\"\n aria-activedescendant={this.selectedIndex >= 0 ? `option-${this.selectedIndex}` : null}\n />\n {this.suggestions.length > 0 ? (\n <div class=\"suggestions\">\n <ol id=\"suggestions-list\" role=\"listbox\" aria-label=\"Search results\">\n {this.suggestions.map((it, index) => (\n <li\n id={`option-${index}`}\n role=\"option\"\n aria-selected={index === this.selectedIndex ? 'true' : 'false'}\n >\n <pos-rich-link uri={it.ref}></pos-rich-link>\n </li>\n ))}\n </ol>\n </div>\n ) : null}\n </form>\n </dialog>\n </search>\n </nav>\n );\n }\n}\n"]}
|
|
@@ -17,7 +17,7 @@ const PosAddNewThing = /*@__PURE__*/ proxyCustomElement(class PosAddNewThing ext
|
|
|
17
17
|
this.dialog.showModal();
|
|
18
18
|
}
|
|
19
19
|
render() {
|
|
20
|
-
return (h(Host, { key: '
|
|
20
|
+
return (h(Host, { key: '5ed3ba3982467778ed2b9b02090c230acb6b1762' }, h("button", { key: '96ff5dbd0ba4ca4d8c1d25045efa06fea062e9cf', id: "new", title: "Add a new thing", onClick: () => this.openDialog() }, h("ion-icon", { key: '201a19c8ecb39e0e913d3fb8cf1ebee06bc41df5', name: "add-circle-outline" })), h("pos-dialog", { key: '421da81e6faf52119fe600cc388663299eab67ec', ref: el => (this.dialog = el) }, h("span", { key: '454e6e05dc478e9c1b378cb3308f006fab4d8738', slot: "title" }, "Add a new thing"), h("pos-new-thing-form", { key: 'a469379848776a4c7e9f8e3f94da76ba048d7fab', slot: "content", referenceUri: this.referenceUri }))));
|
|
21
21
|
}
|
|
22
22
|
static get style() { return PosAddNewThingStyle0; }
|
|
23
23
|
}, [1, "pos-add-new-thing", {
|
|
@@ -27,7 +27,7 @@ const PosAppGeneric$1 = /*@__PURE__*/ proxyCustomElement(class PosAppGeneric ext
|
|
|
27
27
|
this.__attachShadow();
|
|
28
28
|
}
|
|
29
29
|
render() {
|
|
30
|
-
return (h(Host, { key: '
|
|
30
|
+
return (h(Host, { key: 'afbda65361df3b386348ee06a65c08b407d65708' }, h("section", { key: '78e6810a94e06e79e7f373c217de914e975d9a76' }, h("article", { key: 'daa8864317ef4354554a92d7e9de6f6bf7bbe24e', "aria-labelledby": "thing-title" }, h("header", { key: 'ca81075f3cfd0acf9915f738b691598759f554cd' }, h("pos-picture", { key: '682ea8c946bae1886a60f5985d13f3dc696d5108', blurredBackground: true }), h("h1", { key: '8e97b2c9b38c919eda5d896f2072c3ed1906daf2', id: "thing-title" }, h("pos-label", { key: '4e35e238dd6913756742f8eee0da96c7442fe12b' })), h("pos-type-badges", { key: '552b29a529807a1ea14316f620db410019b7a232' })), h("main", { key: '5ff73a76535daf5de695335adea4711f9c67355f' }, h("pos-description", { key: '3b4731fc93bd11c5221630c0547bdd1e5a78e416' })))), h("section", { key: 'e8f9950a602d197ec9bb0b28cc64ed68fd3989f4' }, h("pos-literals", { key: 'b2aae4058c620be3790cf1e4bb223667e2311247' })), h("section", { key: 'b9ad586436b66c12b562402a779289a97f3fbdd0' }, h("pos-relations", { key: '123da027d9a78aa1465d6d5bea91f671d48a8a90' }), h("pos-reverse-relations", { key: '97d3a4f3b7a276668c58aed5cee1b97683e333ce' }))));
|
|
31
31
|
}
|
|
32
32
|
static get style() { return PosAppGenericStyle0; }
|
|
33
33
|
}, [1, "pos-app-generic"]);
|
|
@@ -28,7 +28,7 @@ const PosAppLdpContainer$1 = /*@__PURE__*/ proxyCustomElement(class PosAppLdpCon
|
|
|
28
28
|
this.__attachShadow();
|
|
29
29
|
}
|
|
30
30
|
render() {
|
|
31
|
-
return (h(Host, { key: '
|
|
31
|
+
return (h(Host, { key: 'd1073c803fe6786740408b1e66fd415f0e26de90' }, h("section", { key: '288eaceb2e30282f9018c6bf6759586df637cfaf' }, h("pos-container-contents", { key: '9a6522288ea9df7b902dc5169ee69157a0df5840' }), h("details", { key: 'acf9410c0aec5244a2e1d1bb207aff32f9b21786' }, h("summary", { key: '27b26d9f81a9f4e20d793b28e70476063ff94374' }, "All subjects"), h("pos-subjects", { key: 'abaee22e92eabe54ea7a4b12c66419d78da0ae6d' }))), h("section", { key: '5d74265b93009aaa9cf6df0cc6fe18f5f91ca64f' }, h("article", { key: '81e460004603c914734133b39b7b77af50a439eb' }, h("header", { key: '16fa3a62c8c5cf4e0d07d57e007341679e33c195' }, h("h1", { key: 'a98c66bddb8294caa635d6c75cc7d6d28fac8b88' }, h("pos-label", { key: '9f3f29c4a49529dba5c34fb3c2e08a58c6621c7b' })), h("pos-type-badges", { key: '08866ce24fd093422a9ee6ec52ef9aa9197735e8' })), h("pos-literals", { key: '8e7dfe19b317a49a167e607e2e658b7c66e9b289' })))));
|
|
32
32
|
}
|
|
33
33
|
static get style() { return PosAppLdpContainerStyle0 + PosAppLdpContainerStyle1; }
|
|
34
34
|
}, [1, "pos-app-ldp-container"]);
|
|
@@ -26,7 +26,7 @@ const PosAppRdfDocument$1 = /*@__PURE__*/ proxyCustomElement(class PosAppRdfDocu
|
|
|
26
26
|
this.__attachShadow();
|
|
27
27
|
}
|
|
28
28
|
render() {
|
|
29
|
-
return (h(Host, { key: '
|
|
29
|
+
return (h(Host, { key: '065921cc8beaab90ca56ff993a5d77673af22e18' }, h("section", { key: '9beb103877957c15a494d1604e2ae844172ddc03' }, h("pos-subjects", { key: '5e65e4c5f343e4f0a9ae124dfee4424894e181ff' })), h("section", { key: 'e8beb80dea5f126bcec14a2a3bec7b07aa7c0c15' }, h("article", { key: '38b1603b9bd834b219b4a3ab506c74a12f8d0569', "aria-labelledby": "doc-title" }, h("header", { key: 'c9818e9bd0795205821dab36057469d32e255c15' }, h("h1", { key: '2d676a39fb302e22a07c831e738d96587cfcc3a0', id: "doc-title" }, h("pos-label", { key: 'f5344016de55d828fb9a17c1e0fe43a699593244' })), h("pos-type-badges", { key: 'c273ec23e82f59a89fab79eeff367a23992796a3' })), h("pos-literals", { key: 'ffc386e8934568cf677e105f05d2a1e55d374463' })))));
|
|
30
30
|
}
|
|
31
31
|
static get style() { return PosAppRdfDocumentStyle0 + PosAppRdfDocumentStyle1; }
|
|
32
32
|
}, [1, "pos-app-rdf-document"]);
|
|
@@ -11,7 +11,7 @@ const PosAppSettings = /*@__PURE__*/ proxyCustomElement(class PosAppSettings ext
|
|
|
11
11
|
this.__attachShadow();
|
|
12
12
|
}
|
|
13
13
|
render() {
|
|
14
|
-
return h("pos-setting-offline-cache", { key: '
|
|
14
|
+
return h("pos-setting-offline-cache", { key: '0da588136a4c7c4238e0387bfe0649464ccd1c7d' });
|
|
15
15
|
}
|
|
16
16
|
static get style() { return PosAppSettingsStyle0; }
|
|
17
17
|
}, [1, "pos-app-settings"]);
|
|
@@ -610,7 +610,7 @@ const PosApp = /*@__PURE__*/ proxyCustomElement(class PosApp extends HTMLElement
|
|
|
610
610
|
}
|
|
611
611
|
}
|
|
612
612
|
render() {
|
|
613
|
-
return h("slot", { key: '
|
|
613
|
+
return h("slot", { key: '402887f3383b6053da157df211c28977720db8e2' });
|
|
614
614
|
}
|
|
615
615
|
}, [4, "pos-app", {
|
|
616
616
|
"restorePreviousSession": [4, "restore-previous-session"],
|
|
@@ -16,7 +16,7 @@ const PosDialog = /*@__PURE__*/ proxyCustomElement(class PosDialog extends HTMLE
|
|
|
16
16
|
this.dialog.close();
|
|
17
17
|
}
|
|
18
18
|
render() {
|
|
19
|
-
return (h(Host, { key: '
|
|
19
|
+
return (h(Host, { key: '307e23d3f92eae595a6bb9fd3e2487387d9b02c2' }, h("dialog", { key: '4c21714a0e2e84d809fe46b75d875c961ff8240c', ref: el => (this.dialog = el) }, h("header", { key: '0b9276c31a8deffa524a65b744d0ced04a753c1b' }, h("slot", { key: 'f4bcf72fcb25ea2619a0d7a40f524a10a91c0ca6', name: "title" }), h("button", { key: '8afb0911e29f8b4c81ff31f498266b398125327a', tabindex: -1, id: "close", title: "Close", onClick: () => this.close() }, h("ion-icon", { key: '464669b8a7f2aa1a1d274f933bb394a61abffc99', name: "close-outline" }))), h("slot", { key: 'f9fa43f73f8c295b6c728b4c7e7e3bf5c3be8948', name: "content" }))));
|
|
20
20
|
}
|
|
21
21
|
static get style() { return PosDialogStyle0; }
|
|
22
22
|
}, [4, "pos-dialog", {
|
|
@@ -37,7 +37,7 @@ const PosErrorToast = /*@__PURE__*/ proxyCustomElement(class PosErrorToast exten
|
|
|
37
37
|
await toast.present();
|
|
38
38
|
}
|
|
39
39
|
render() {
|
|
40
|
-
return (h(Host, { key: '
|
|
40
|
+
return (h(Host, { key: '0dce513e04101d3b9011c635f5aab8897a246385' }, h("ion-toast", { key: '956224c61589fca317f8143055344c857aa894cf', trigger: "never", message: "Workarround to preload ion-toast and ion-ripple-effect to be able to show errors while offline", duration: 0 }, h("ion-ripple-effect", { key: 'e96e65e2f06b61970e241639e7c429a90404517e' })), h("slot", { key: '8869125c64fb97f9736e30df0a748c9ce6aec1da' })));
|
|
41
41
|
}
|
|
42
42
|
}, [1, "pos-error-toast", undefined, [[8, "unhandledrejection", "unhandledRejection"], [0, "pod-os:error", "catchError"]]]);
|
|
43
43
|
function defineCustomElement() {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { proxyCustomElement, HTMLElement, h, Host } from '@stencil/core/internal/client';
|
|
1
|
+
import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client';
|
|
2
2
|
|
|
3
|
-
const posGettingStartedCss = ":host{border:var(--size-px) solid var(--pos-border-color);border-radius:var(--radius-lg);box-shadow:var(--shadow-md);padding:var(--size-8);max-width:var(--size-96);background:var(--pos-card-background)}.question{font-weight:var(--weight-semibold)}a{font-weight:var(--weight-bold);color:var(--pos-primary-color)}";
|
|
3
|
+
const posGettingStartedCss = ":host{border:var(--size-px) solid var(--pos-border-color);border-radius:var(--radius-lg);box-shadow:var(--shadow-md);padding:var(--size-8);max-width:var(--size-96);background:var(--pos-card-background)}.question{font-weight:var(--weight-semibold)}a{font-weight:var(--weight-bold);color:var(--pos-primary-color)}button.login{background:none;color:var(--pos-primary-color);display:inline;text-decoration:underline;border:none;padding:0;margin:0;cursor:pointer;font-size:unset}";
|
|
4
4
|
const PosGettingStartedStyle0 = posGettingStartedCss;
|
|
5
5
|
|
|
6
6
|
const PosGettingStarted = /*@__PURE__*/ proxyCustomElement(class PosGettingStarted extends HTMLElement {
|
|
@@ -8,9 +8,10 @@ const PosGettingStarted = /*@__PURE__*/ proxyCustomElement(class PosGettingStart
|
|
|
8
8
|
super();
|
|
9
9
|
this.__registerHost();
|
|
10
10
|
this.__attachShadow();
|
|
11
|
+
this.login = createEvent(this, "pod-os:login", 7);
|
|
11
12
|
}
|
|
12
13
|
render() {
|
|
13
|
-
return (h(Host, { key: '
|
|
14
|
+
return (h(Host, { key: '963476081378811bc5623921ca7f4dc5ac18b9f7' }, h("div", { key: 'df6a7a5bab3c026d1960c03a4d008f8bff0b1c9d' }, h("h2", { key: '9e7a1e2c081f87275641fe99afb72c1f8ef65115' }, "Getting started \uD83D\uDE80"), h("p", { key: 'dac8ca58a733d66ab80fa79ef59d62a254b3b83f' }, "\uD83D\uDD0E Enter a URL into the above navigation bar to browse through the web of data. "), h("p", { key: 'c90fbc4f7c09893f6ded65befe4c77f673df6db2' }, "\uD83D\uDD10", ' ', h("button", { key: '2688b10503c6d518a7a48601f35e1f20741d71c7', class: "login", onClick: () => this.login.emit() }, "Sign in"), ' ', "to access private resources on your Solid Pod or those of your friends or coworkers.")), h("div", { key: '5990c65adc978df16ec7b73c3be2b6b4b3a48ce3' }, h("p", { key: '8fd4cb0941da30c3b438338a557a6d4fb9d7ff33', class: "question" }, "New to Solid?"), h("p", { key: 'd6b06063acaac1d55dc0aea86c3d80f4e7c8ca6f' }, h("a", { key: 'b0a49b4e170c89f736cf9bd2dd567cfafbcec31c', href: "https://solidproject.org/for-developers#hosted-pod-services" }, "Get a Pod \u2192"))), h("div", { key: '7c88ea4bb3982346343cf10e6196d2d07057a24e' }, h("p", { key: '22cfb601fada05ca7b5f274f0b6a81d360344764', class: "question" }, "Want to dig deeper into PodOS?"), h("p", { key: 'fb03d0f84714feb53b1b053390a5e7b9686e610e' }, h("a", { key: '1681d6d1c860589ca1624abc3c05121ccde3f951', href: "http://pod-os.org" }, "Learn more \u2192")))));
|
|
14
15
|
}
|
|
15
16
|
static get style() { return PosGettingStartedStyle0; }
|
|
16
17
|
}, [1, "pos-getting-started"]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"pos-getting-started2.js","mappings":";;AAAA,MAAM,oBAAoB,GAAG,
|
|
1
|
+
{"file":"pos-getting-started2.js","mappings":";;AAAA,MAAM,oBAAoB,GAAG,4dAA4d,CAAC;AAC1f,gCAAe,oBAAoB;;MCMtB,iBAAiB;;;;;;;IAI5B,MAAM;QACJ,QACE,EAAC,IAAI,uDACH,8DACE,4FAA2B,EAC3B,yJAAuF,EACvF,4EACK,GAAG,EACN,+DAAQ,KAAK,EAAC,OAAO,EAAC,OAAO,EAAE,MAAM,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,cAE7C,EAAC,GAAG,yFAEX,CACA,EACN,8DACE,0DAAG,KAAK,EAAC,UAAU,oBAAkB,EACrC,4DACE,0DAAG,IAAI,EAAC,6DAA6D,uBAAqB,CACxF,CACA,EACN,8DACE,0DAAG,KAAK,EAAC,UAAU,qCAAmC,EACtD,4DACE,0DAAG,IAAI,EAAC,mBAAmB,wBAAsB,CAC/C,CACA,CACD,EACP;KACH;;;;;;;;;;;;;;;;;;;","names":[],"sources":["src/apps/pos-app-dashboard/pos-getting-started/pos-getting-started.css?tag=pos-getting-started&encapsulation=shadow","src/apps/pos-app-dashboard/pos-getting-started/pos-getting-started.tsx"],"sourcesContent":[":host {\n border: var(--size-px) solid var(--pos-border-color);\n border-radius: var(--radius-lg);\n box-shadow: var(--shadow-md);\n padding: var(--size-8);\n max-width: var(--size-96);\n background: var(--pos-card-background);\n}\n\n.question {\n font-weight: var(--weight-semibold);\n}\n\na {\n font-weight: var(--weight-bold);\n color: var(--pos-primary-color);\n}\n\nbutton.login {\n background: none;\n color: var(--pos-primary-color);\n display: inline;\n text-decoration: underline;\n border: none;\n padding: 0;\n margin: 0;\n cursor: pointer;\n font-size: unset;\n}\n","import { Component, Event, EventEmitter, h, Host } from '@stencil/core';\n\n@Component({\n tag: 'pos-getting-started',\n styleUrl: 'pos-getting-started.css',\n shadow: true,\n})\nexport class PosGettingStarted {\n @Event({ eventName: 'pod-os:login' })\n login: EventEmitter<void>;\n\n render() {\n return (\n <Host>\n <div>\n <h2>Getting started 🚀</h2>\n <p>🔎 Enter a URL into the above navigation bar to browse through the web of data. </p>\n <p>\n 🔐{' '}\n <button class=\"login\" onClick={() => this.login.emit()}>\n Sign in\n </button>{' '}\n to access private resources on your Solid Pod or those of your friends or coworkers.\n </p>\n </div>\n <div>\n <p class=\"question\">New to Solid?</p>\n <p>\n <a href=\"https://solidproject.org/for-developers#hosted-pod-services\">Get a Pod →</a>\n </p>\n </div>\n <div>\n <p class=\"question\">Want to dig deeper into PodOS?</p>\n <p>\n <a href=\"http://pod-os.org\">Learn more →</a>\n </p>\n </div>\n </Host>\n );\n }\n}\n"],"version":3}
|
|
@@ -40,7 +40,7 @@ const PosLiterals = /*@__PURE__*/ proxyCustomElement(class PosLiterals extends H
|
|
|
40
40
|
}
|
|
41
41
|
}
|
|
42
42
|
render() {
|
|
43
|
-
return (h(Host, { key: '
|
|
43
|
+
return (h(Host, { key: '571f571381d9a9c4bcf0188a782c46485266a3d8' }, this.data.length > 0 ? (h("dl", null, this.data.map(it => (h("div", { class: "predicate-values" }, h("dt", null, h("pos-predicate", { uri: it.predicate, label: it.label })), h("div", { class: "values" }, it.values.map(value => (h("dd", null, value))))))))) : null, h("pos-add-literal-value", { key: 'e1b58aba48a56e60ec8bb1087f054972bb2c437c', "onPod-os:added-literal-value": event => this.literalValueAdded(event.detail) })));
|
|
44
44
|
}
|
|
45
45
|
static get style() { return PosLiteralsStyle0; }
|
|
46
46
|
}, [1, "pos-literals", {
|
|
@@ -16,7 +16,7 @@ const PosLoginForm = /*@__PURE__*/ proxyCustomElement(class PosLoginForm extends
|
|
|
16
16
|
this.canSubmit = Boolean(this.idpUrl);
|
|
17
17
|
}
|
|
18
18
|
render() {
|
|
19
|
-
return (h("form", { key: '
|
|
19
|
+
return (h("form", { key: 'ddd05b4f905b65b2b5da556b3e9562bbff1812b0', method: "dialog", onSubmit: () => this.handleSubmit() }, h("label", { key: 'a23f430387db8339efe42d680d0659122b4503c2', htmlFor: "idpUrl" }, "Please enter your Identity Provider"), h("input", { key: '23c7209c3a4ecd79f305dc23961508f41ede85d3', id: "idpUrl", type: "url", value: this.idpUrl, required: true, onInput: e => this.handleChange(e), list: "suggestedIssuers", placeholder: "Type to search..." }), h("datalist", { key: '663730bddeb65eb5c58116ea329e00eee4b64a0f', id: "suggestedIssuers" }, h("option", { key: '71f0b94980ae6b38732f5f4319e1a5d4dad36f77', value: "https://solidcommunity.net" }, "solidcommunity.net"), h("option", { key: 'a18600e5fd7c6892f64b1b8e70480d564e9c39f6', value: "https://solidweb.org" }, "solidweb.org"), h("option", { key: '5528ee847f979c29d8d9725a13d51f7ae88cb82c', value: "https://solidweb.me" }, "solidweb.me"), h("option", { key: '9f1b85fbc78dc9870112053c61ece17d20dd89ec', value: "https://inrupt.net" }, "inrupt.net"), h("option", { key: '6bdaac53eae2b6830a2146e980542565dead33b7', value: "https://login.inrupt.com" }, "Inrupt PodSpaces"), h("option", { key: 'd5f243d1e7656bbca35b1c9920d4e2b867abed68', value: "https://trinpod.us" }, "trinpod.us"), h("option", { key: '1a9f2aab20d25a09b31ae47858c638e065ac27b5', value: "https://use.id" }, "use.id"), h("option", { key: 'f275d341b26be71158d6e5bd44ed138f54da823e', value: "https://solid.redpencil.io" }, "redpencil.io"), h("option", { key: '0945f4829972e9bdb37deb406d24d63e5bf30e8f', value: "https://datapod.grant.io" }, "Data Pod (grant.io)"), h("option", { key: '4cce12430b365c241a126ece63865c8dfa6e195e', value: "https://teamid.live" }, "teamid.live")), h("input", { key: 'd46215b8314e845b4ba6df750537ec6c8a14f8ed', id: "login", type: "submit", value: "Login", disabled: !this.canSubmit })));
|
|
20
20
|
}
|
|
21
21
|
handleChange(event) {
|
|
22
22
|
this.validate();
|
|
@@ -19,11 +19,13 @@ const PosLogin = /*@__PURE__*/ proxyCustomElement(class PosLogin extends HTMLEle
|
|
|
19
19
|
this.__registerHost();
|
|
20
20
|
this.__attachShadow();
|
|
21
21
|
this.initializeOsEmitter = createEvent(this, "pod-os:init", 7);
|
|
22
|
+
this.customLoggedInComponent = false;
|
|
22
23
|
this.setOs = async (os) => {
|
|
23
24
|
this.os = os;
|
|
24
25
|
};
|
|
25
26
|
}
|
|
26
27
|
componentWillLoad() {
|
|
28
|
+
this.customLoggedInComponent = !!this.host.querySelector('[slot="if-logged-in"]');
|
|
27
29
|
this.initializeOsEmitter.emit(this.setOs);
|
|
28
30
|
}
|
|
29
31
|
login(event) {
|
|
@@ -33,16 +35,30 @@ const PosLogin = /*@__PURE__*/ proxyCustomElement(class PosLogin extends HTMLEle
|
|
|
33
35
|
logout() {
|
|
34
36
|
this.os.logout();
|
|
35
37
|
}
|
|
38
|
+
onLogin() {
|
|
39
|
+
this.openDialog();
|
|
40
|
+
}
|
|
36
41
|
openDialog() {
|
|
37
42
|
this.dialog.showModal();
|
|
38
43
|
}
|
|
39
44
|
render() {
|
|
40
|
-
return (h(Host, { key: '
|
|
45
|
+
return (h(Host, { key: '7e69a8cba87f4f7ccc1fdcf2945d240997191354' }, h("div", { key: '5083252a92113e3e215828a954bc1c5feb30db2b', class: "container" }, !store.state.isLoggedIn ? (h("button", { id: "login", onClick: () => this.openDialog() }, "Login")) : (this.loggedInComponents())), h("pos-dialog", { key: '17499523a10346d3f120aee19287e7d8788e2d04', ref: el => (this.dialog = el) }, h("span", { key: 'e7b066d3f2a2d5f4867412d4d399bb9bd261eee4', slot: "title" }, "Sign in to your Pod"), h("pos-login-form", { key: 'd44157b3ec87726c2ad89ad453899bdeb37a293e', "onPod-os:idp-url-selected": ev => this.login(ev), slot: "content" }))));
|
|
46
|
+
}
|
|
47
|
+
loggedInComponents() {
|
|
48
|
+
return this.customLoggedInComponent ? h("slot", { name: "if-logged-in" }) : this.defaultLoggedInComponents();
|
|
49
|
+
}
|
|
50
|
+
defaultLoggedInComponents() {
|
|
51
|
+
return [
|
|
52
|
+
h("pos-resource", { uri: store.state.webId }, h("span", { class: "user-data" }, h("pos-picture", null), h("pos-label", null))),
|
|
53
|
+
h("button", { id: "logout", onClick: () => this.logout() }, "Logout"),
|
|
54
|
+
];
|
|
41
55
|
}
|
|
56
|
+
get host() { return this; }
|
|
42
57
|
static get style() { return PosLoginStyle0; }
|
|
43
58
|
}, [1, "pos-login", {
|
|
44
|
-
"os": [32]
|
|
45
|
-
|
|
59
|
+
"os": [32],
|
|
60
|
+
"customLoggedInComponent": [32]
|
|
61
|
+
}, [[4, "pod-os:login", "onLogin"]]]);
|
|
46
62
|
function defineCustomElement() {
|
|
47
63
|
if (typeof customElements === "undefined") {
|
|
48
64
|
return;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"pos-login2.js","mappings":";;;;;;;;;;;;AAAA,MAAM,WAAW,GAAG,2wBAA2wB,CAAC;AAChyB,uBAAe,WAAW;;MCSb,QAAQ;IALrB;;;;;
|
|
1
|
+
{"file":"pos-login2.js","mappings":";;;;;;;;;;;;AAAA,MAAM,WAAW,GAAG,2wBAA2wB,CAAC;AAChyB,uBAAe,WAAW;;MCSb,QAAQ;IALrB;;;;;QAaU,4BAAuB,GAAY,KAAK,CAAC;QAOjD,UAAK,GAAG,OAAO,EAAS;YACtB,IAAI,CAAC,EAAE,GAAG,EAAE,CAAC;SACd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AC,WAAW,IACrB,sBAAe,EACf,oBAAa,CACR,CACM;YACf,cAAQ,EAAE,EAAC,QAAQ,EAAC,OAAO,EAAE,MAAM,IAAI,CAAC,MAAM,EAAE,aAEvC;SACV,CAAC;KACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["session"],"sources":["src/components/pos-login/pos-login.css?tag=pos-login&encapsulation=shadow","src/components/pos-login/pos-login.tsx"],"sourcesContent":[".container {\n display: flex;\n align-items: center;\n gap: var(--size-2);\n}\n.user-data {\n align-items: center;\n display: inline-flex;\n gap: 10px;\n}\n.user-data pos-picture {\n --width: 40px;\n --height: 40px;\n --border-radius: 50%;\n}\n\npos-login-form {\n margin: var(--size-2);\n}\n\ndialog {\n margin-top: var(--size-10);\n}\n\nbutton#login,\nbutton#logout {\n outline: none;\n font-weight: var(--weight-bold);\n letter-spacing: var(--letter-xl);\n border: none;\n box-sizing: border-box;\n border-radius: var(--radius-xs);\n padding: var(--size-2);\n box-shadow: var(--shadow-sm);\n color: var(--pos-primary-text-color);\n background-color: var(--pos-primary-color);\n}\n\nbutton#login:focus-within,\nbutton#logout:focus-within {\n outline: var(--pos-input-focus-outline);\n}\n\nbutton#login:focus,\nbutton#login:hover,\nbutton#logout:focus,\nbutton#logout:hover {\n filter: brightness(110%);\n box-shadow: var(--shadow-md);\n}\n","import { PodOS } from '@pod-os/core';\nimport { Component, Element, Event, EventEmitter, h, Host, Listen, State } from '@stencil/core';\n\nimport session from '../../store/session';\n\n@Component({\n tag: 'pos-login',\n shadow: true,\n styleUrl: 'pos-login.css',\n})\nexport class PosLogin {\n @Event({ eventName: 'pod-os:init' }) initializeOsEmitter: EventEmitter;\n\n @State() os: PodOS;\n\n @Element() host: HTMLElement;\n\n @State()\n private customLoggedInComponent: boolean = false;\n\n componentWillLoad() {\n this.customLoggedInComponent = !!this.host.querySelector('[slot=\"if-logged-in\"]');\n this.initializeOsEmitter.emit(this.setOs);\n }\n\n setOs = async (os: PodOS) => {\n this.os = os;\n };\n\n login(event: CustomEvent<string>) {\n const idpUrl = event.detail;\n this.os.login(idpUrl);\n }\n\n logout() {\n this.os.logout();\n }\n\n private dialog: HTMLPosDialogElement;\n\n @Listen('pod-os:login', { target: 'document' })\n onLogin() {\n this.openDialog();\n }\n\n openDialog() {\n this.dialog.showModal();\n }\n\n render() {\n return (\n <Host>\n <div class=\"container\">\n {!session.state.isLoggedIn ? (\n <button id=\"login\" onClick={() => this.openDialog()}>\n Login\n </button>\n ) : (\n this.loggedInComponents()\n )}\n </div>\n <pos-dialog ref={el => (this.dialog = el)}>\n <span slot=\"title\">Sign in to your Pod</span>\n <pos-login-form onPod-os:idp-url-selected={ev => this.login(ev)} slot=\"content\" />\n </pos-dialog>\n </Host>\n );\n }\n\n private loggedInComponents() {\n return this.customLoggedInComponent ? <slot name=\"if-logged-in\"></slot> : this.defaultLoggedInComponents();\n }\n\n private defaultLoggedInComponents() {\n return [\n <pos-resource uri={session.state.webId}>\n <span class=\"user-data\">\n <pos-picture />\n <pos-label />\n </span>\n </pos-resource>,\n <button id=\"logout\" onClick={() => this.logout()}>\n Logout\n </button>,\n ];\n }\n}\n"],"version":3}
|
|
@@ -4,7 +4,7 @@ import { d as defineCustomElement$3 } from './pos-label2.js';
|
|
|
4
4
|
import { d as defineCustomElement$2 } from './pos-make-findable2.js';
|
|
5
5
|
import { d as defineCustomElement$1 } from './pos-resource2.js';
|
|
6
6
|
|
|
7
|
-
const posNavigationBarCss = "section.current {\n display: flex;\n height: var(--pos-navigation-bar-height);\n flex-grow: 1;\n gap: 0;\n background-color: var(--pos-input-background-color);\n border-radius: var(--radius-md);\n width: 100%;\n &:focus-within {\n outline: var(--pos-input-focus-outline);\n }\n}\n\nsection.current button {\n cursor: pointer;\n font-size: var(--scale-1);\n flex-grow: 1;\n background: none;\n color: var(--pos-normal-text-color);\n outline: none;\n border: none;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n &:focus {\n text-decoration: underline;\n }\n}\n";
|
|
7
|
+
const posNavigationBarCss = "section.current {\n display: flex;\n height: var(--pos-navigation-bar-height);\n flex-grow: 1;\n gap: 0;\n background-color: var(--pos-input-background-color);\n border-radius: var(--radius-md);\n width: 100%;\n &:focus-within {\n outline: var(--pos-input-focus-outline);\n }\n}\n\nsection.current button {\n cursor: pointer;\n font-size: var(--scale-1);\n display: flex;\n align-items: center;\n justify-content: center;\n flex-grow: 1;\n background: none;\n color: var(--pos-normal-text-color);\n outline: none;\n border: none;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n &:focus {\n text-decoration: underline;\n }\n :first-child {\n flex-grow: 1;\n }\n svg {\n width: var(--size-6);\n color: var(--pos-subtle-text-color);\n }\n}\n";
|
|
8
8
|
const PosNavigationBarStyle0 = posNavigationBarCss;
|
|
9
9
|
|
|
10
10
|
const PosNavigationBar = /*@__PURE__*/ proxyCustomElement(class PosNavigationBar extends HTMLElement {
|
|
@@ -25,7 +25,10 @@ const PosNavigationBar = /*@__PURE__*/ proxyCustomElement(class PosNavigationBar
|
|
|
25
25
|
}
|
|
26
26
|
render() {
|
|
27
27
|
const ariaLabel = this.current ? `${this.current.label()} (Click to search or enter URI)` : 'Search or enter URI';
|
|
28
|
-
return (h("section", { key: '
|
|
28
|
+
return (h("section", { key: '1b507d50bd24f257023fe980f1ffdb3abe903577', class: "current" }, this.current && this.searchIndexReady && h("pos-make-findable", { key: 'e96559f40418154a26350705ae6e3dbf8057a424', uri: this.current.uri }), h("button", { key: '2ac476bd89918e71ca10cc945952f8c9905865df', "aria-label": ariaLabel, onClick: () => this.onClick() }, h("div", { key: 'd34b73e2090f08cab8533d03a7b206d420bfa8c2' }, this.current ? this.current.label() : 'Search or enter URI'), this.icon())));
|
|
29
|
+
}
|
|
30
|
+
icon() {
|
|
31
|
+
return (h("svg", { "aria-hidden": "true", xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 24 24", "stroke-width": "1.5", stroke: "currentColor" }, h("path", { "stroke-linecap": "round", "stroke-linejoin": "round", d: "m21 21-5.197-5.197m0 0A7.5 7.5 0 1 0 5.196 5.196a7.5 7.5 0 0 0 10.607 10.607Z" })));
|
|
29
32
|
}
|
|
30
33
|
static get style() { return PosNavigationBarStyle0; }
|
|
31
34
|
}, [1, "pos-navigation-bar", {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"pos-navigation-bar2.js","mappings":";;;;;;AAAA,MAAM,mBAAmB,GAAG,
|
|
1
|
+
{"file":"pos-navigation-bar2.js","mappings":";;;;;;AAAA,MAAM,mBAAmB,GAAG,uyBAAuyB,CAAC;AACp0B,+BAAe,mBAAmB;;MCOrB,gBAAgB;;;;;;;IAMnB,OAAO;QACb,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;KAClC;IAGD,QAAQ,CAAC,CAAgB;QACvB,IAAI,CAAC,CAAC,CAAC,OAAO,IAAI,CAAC,CAAC,OAAO,KAAK,CAAC,CAAC,GAAG,KAAK,GAAG,EAAE;YAC7C,CAAC,CAAC,cAAc,EAAE,CAAC;YACnB,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;SAClC;KACF;IAED,MAAM;QACJ,MAAM,SAAS,GAAG,IAAI,CAAC,OAAO,GAAG,GAAG,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,iCAAiC,GAAG,qBAAqB,CAAC;QAElH,QACE,gEAAS,KAAK,EAAC,SAAS,IACrB,IAAI,CAAC,OAAO,IAAI,IAAI,CAAC,gBAAgB,IAAI,0EAAmB,GAAG,EAAE,IAAI,CAAC,OAAO,CAAC,GAAG,GAAsB,EACxG,6EAAoB,SAAS,EAAE,OAAO,EAAE,MAAM,IAAI,CAAC,OAAO,EAAE,IAC1D,8DAAM,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,qBAAqB,CAAO,EACvE,IAAI,CAAC,IAAI,EAAE,CACL,CACD,EACV;KACH;IAEO,IAAI;QACV,QACE,0BACc,MAAM,EAClB,KAAK,EAAC,4BAA4B,EAClC,IAAI,EAAC,MAAM,EACX,OAAO,EAAC,WAAW,kBACN,KAAK,EAClB,MAAM,EAAC,cAAc,IAErB,8BACiB,OAAO,qBACN,OAAO,EACvB,CAAC,EAAC,+EAA+E,GACjF,CACE,EACN;KACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["src/components/pos-navigation/bar/pos-navigation-bar.css?tag=pos-navigation-bar&encapsulation=shadow","src/components/pos-navigation/bar/pos-navigation-bar.tsx"],"sourcesContent":["section.current {\n display: flex;\n height: var(--pos-navigation-bar-height);\n flex-grow: 1;\n gap: 0;\n background-color: var(--pos-input-background-color);\n border-radius: var(--radius-md);\n width: 100%;\n &:focus-within {\n outline: var(--pos-input-focus-outline);\n }\n}\n\nsection.current button {\n cursor: pointer;\n font-size: var(--scale-1);\n display: flex;\n align-items: center;\n justify-content: center;\n flex-grow: 1;\n background: none;\n color: var(--pos-normal-text-color);\n outline: none;\n border: none;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n &:focus {\n text-decoration: underline;\n }\n :first-child {\n flex-grow: 1;\n }\n svg {\n width: var(--size-6);\n color: var(--pos-subtle-text-color);\n }\n}\n","import { Component, Event, EventEmitter, h, Listen, Prop } from '@stencil/core';\nimport { Thing } from '@pod-os/core';\n\n@Component({\n tag: 'pos-navigation-bar',\n shadow: true,\n styleUrl: 'pos-navigation-bar.css',\n})\nexport class PosNavigationBar {\n @Prop() current?: Thing;\n @Prop() searchIndexReady: boolean;\n\n @Event({ eventName: 'pod-os:navigate' }) navigate: EventEmitter;\n\n private onClick() {\n this.navigate.emit(this.current);\n }\n\n @Listen('keydown', { target: 'document' })\n activate(e: KeyboardEvent) {\n if ((e.ctrlKey || e.metaKey) && e.key === 'k') {\n e.preventDefault();\n this.navigate.emit(this.current);\n }\n }\n\n render() {\n const ariaLabel = this.current ? `${this.current.label()} (Click to search or enter URI)` : 'Search or enter URI';\n\n return (\n <section class=\"current\">\n {this.current && this.searchIndexReady && <pos-make-findable uri={this.current.uri}></pos-make-findable>}\n <button aria-label={ariaLabel} onClick={() => this.onClick()}>\n <div>{this.current ? this.current.label() : 'Search or enter URI'}</div>\n {this.icon()}\n </button>\n </section>\n );\n }\n\n private icon() {\n return (\n <svg\n aria-hidden=\"true\"\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n stroke-width=\"1.5\"\n stroke=\"currentColor\"\n >\n <path\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n d=\"m21 21-5.197-5.197m0 0A7.5 7.5 0 1 0 5.196 5.196a7.5 7.5 0 0 0 10.607 10.607Z\"\n />\n </svg>\n );\n }\n}\n"],"version":3}
|
|
@@ -202,7 +202,7 @@ function debounceTime(dueTime, scheduler = asyncScheduler) {
|
|
|
202
202
|
});
|
|
203
203
|
}
|
|
204
204
|
|
|
205
|
-
const posNavigationCss = ":host {\n --pos-navigation-bar-height: var(--size-10);\n}\n\nsearch {\n position: relative;\n}\n\n.suggestions ol {\n border: 1px solid var(--pos-border-color);\n display: flex;\n flex-direction: column;\n margin: 0;\n padding: 0;\n list-style-type: none;\n}\n\n.suggestions {\n width: 100%;\n overflow-y: auto;\n max-height: 90dvh;\n li {\n padding: 1rem;\n background-color: var(--pos-background-color);\n pos-rich-link {\n --background-color: inherit;\n }\n
|
|
205
|
+
const posNavigationCss = ":host {\n --pos-navigation-bar-height: var(--size-10);\n}\n\nsearch {\n position: relative;\n}\n\n.suggestions ol {\n border: 1px solid var(--pos-border-color);\n display: flex;\n flex-direction: column;\n margin: 0;\n padding: 0;\n list-style-type: none;\n}\n\n.suggestions {\n width: 100%;\n overflow-y: auto;\n max-height: 90dvh;\n li {\n padding: 1rem;\n background-color: var(--pos-background-color);\n pos-rich-link {\n --background-color: inherit;\n }\n &[aria-selected='true'] {\n background-color: var(--pos-primary-color);\n &:hover {\n background-color: var(--pos-primary-color);\n }\n }\n &:hover {\n background-color: var(--pos-border-color);\n }\n }\n}\n\n.suggestions li.selected pos-rich-link {\n --label-color: white;\n --description-color: var(--pos-border-color);\n --uri-color: var(--pos-subtle-text-color);\n}\n\ndialog {\n position: absolute;\n margin-top: calc(-1 * var(--pos-navigation-bar-height));\n padding: 0;\n width: 100%;\n max-width: 100%;\n min-width: 100%;\n overflow: hidden;\n max-height: 100dvh;\n background-color: var(--pos-background-color);\n color: var(--pos-normal-text-color);\n border: var(--pos-border-color);\n border-radius: var(--radius-md);\n box-shadow: var(--shadow-md);\n form {\n display: flex;\n flex-direction: column;\n height: 100%;\n width: 100%;\n align-items: center;\n input {\n display: flex;\n font-size: var(--scale-1);\n height: var(--pos-navigation-bar-height);\n border-top-left-radius: var(--radius-md);\n border-top-right-radius: var(--radius-md);\n padding-left: var(--size-2);\n width: 100%;\n border: none;\n outline: none;\n color: var(--pos-normal-text-color);\n background-color: var(--pos-input-background-color);\n box-sizing: border-box;\n }\n }\n}\n\ndialog[open] {\n display: flex;\n z-index: var(--layer-top);\n animation: slideIn 100ms ease-out;\n}\n\n@media (max-width: 640px) {\n search {\n position: unset;\n }\n dialog {\n margin-top: var(--size-1);\n top: 0;\n width: 95dvw;\n max-width: unset;\n min-width: unset;\n form {\n input {\n height: var(--size-12);\n font-size: var(--scale-fluid-3);\n }\n }\n }\n}\n\n@keyframes fadeIn {\n from {\n opacity: 0;\n }\n to {\n opacity: 1;\n }\n}\n";
|
|
206
206
|
const PosNavigationStyle0 = posNavigationCss;
|
|
207
207
|
|
|
208
208
|
const PosNavigation = /*@__PURE__*/ proxyCustomElement(class PosNavigation extends HTMLElement {
|
|
@@ -321,7 +321,7 @@ const PosNavigation = /*@__PURE__*/ proxyCustomElement(class PosNavigation exten
|
|
|
321
321
|
}
|
|
322
322
|
}
|
|
323
323
|
render() {
|
|
324
|
-
return (h("nav", { key: '
|
|
324
|
+
return (h("nav", { key: '5c6c07b6b2f9ccb0e45bd59b5e477d8ed3d52c2d' }, h("search", { key: '19997ad34212d679547ad5e1bb2f5ea53e576361' }, h("pos-navigation-bar", { key: '2d1c073b2c53ba8cd5afbb595cc95015e5a50e5b', searchIndexReady: this.searchIndex !== undefined, current: this.resource }), h("dialog", { key: '55de5a58604feaf54426b643b434560dbc55a9a1', ref: el => (this.dialogRef = el) }, h("form", { key: '50c064938ec275b53bde81d9bb6c86e0c708a625', method: "dialog", onSubmit: () => this.onSubmit() }, h("input", { key: 'ca06fd69e8346cb8bb0868560f39987b4545c8f5', ref: el => (this.inputRef = el), enterkeyhint: "search", "aria-label": "Search or enter URI", placeholder: "Search or enter URI", value: this.uri, onChange: e => this.onChange(e), onInput: e => this.onChange(e), role: "combobox", "aria-autocomplete": "list", "aria-expanded": this.suggestions.length > 0, "aria-controls": "suggestions-list", "aria-activedescendant": this.selectedIndex >= 0 ? `option-${this.selectedIndex}` : null }), this.suggestions.length > 0 ? (h("div", { class: "suggestions" }, h("ol", { id: "suggestions-list", role: "listbox", "aria-label": "Search results" }, this.suggestions.map((it, index) => (h("li", { id: `option-${index}`, role: "option", "aria-selected": index === this.selectedIndex ? 'true' : 'false' }, h("pos-rich-link", { uri: it.ref }))))))) : null)))));
|
|
325
325
|
}
|
|
326
326
|
static get watchers() { return {
|
|
327
327
|
"uri": ["updateResource"],
|