@pod-os/elements 0.26.1-rc.37aef21.0 → 0.26.1-rc.52f6cf9.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/ion-icon_31.cjs.entry.js +9 -8
- package/dist/cjs/ion-icon_31.cjs.entry.js.map +1 -1
- package/dist/collection/components/pos-add-new-thing/pos-add-new-thing.css +2 -2
- package/dist/collection/components/pos-make-findable/pos-make-findable.css +3 -3
- package/dist/collection/components/pos-navigation/bar/pos-navigation-bar.css +2 -1
- package/dist/collection/components/pos-navigation/pos-navigation.css +10 -5
- package/dist/collection/components/pos-navigation/pos-navigation.js +4 -3
- package/dist/collection/components/pos-navigation/pos-navigation.js.map +1 -1
- package/dist/collection/components/pos-rich-link/pos-rich-link.css +1 -1
- package/dist/components/pos-add-new-thing2.js +1 -1
- package/dist/components/pos-add-new-thing2.js.map +1 -1
- package/dist/components/pos-make-findable2.js +1 -1
- package/dist/components/pos-make-findable2.js.map +1 -1
- package/dist/components/pos-navigation-bar2.js +1 -1
- package/dist/components/pos-navigation-bar2.js.map +1 -1
- package/dist/components/pos-navigation2.js +5 -4
- package/dist/components/pos-navigation2.js.map +1 -1
- package/dist/components/pos-rich-link2.js +1 -1
- package/dist/components/pos-rich-link2.js.map +1 -1
- package/dist/elements/elements.esm.js +1 -1
- package/dist/elements/{p-6b134df2.entry.js → p-111699ee.entry.js} +2 -2
- package/dist/elements/p-111699ee.entry.js.map +1 -0
- package/dist/esm/ion-icon_31.entry.js +9 -8
- package/dist/esm/ion-icon_31.entry.js.map +1 -1
- package/dist/types/components/pos-navigation/pos-navigation.d.ts +1 -0
- package/package.json +1 -1
- package/dist/elements/p-6b134df2.entry.js.map +0 -1
|
@@ -9,8 +9,8 @@ button#new {
|
|
|
9
9
|
align-items: center;
|
|
10
10
|
justify-content: center;
|
|
11
11
|
border: none;
|
|
12
|
-
width: var(--
|
|
13
|
-
height: var(--
|
|
12
|
+
width: var(--size-10);
|
|
13
|
+
height: var(--size-10);
|
|
14
14
|
background-color: var(--pos-primary-color);
|
|
15
15
|
color: var(--pos-primary-text-color);
|
|
16
16
|
font-size: var(--scale-6);
|
|
@@ -8,8 +8,8 @@ button.main {
|
|
|
8
8
|
max-width: var(--size-40);
|
|
9
9
|
flex-direction: row;
|
|
10
10
|
overflow: hidden;
|
|
11
|
-
height: var(--
|
|
12
|
-
width: var(--
|
|
11
|
+
height: var(--pos-navigation-bar-height);
|
|
12
|
+
width: var(--pos-navigation-bar-height);
|
|
13
13
|
align-items: center;
|
|
14
14
|
justify-content: center;
|
|
15
15
|
border-radius: var(--radius-md);
|
|
@@ -99,7 +99,7 @@ button.open {
|
|
|
99
99
|
background: var(--color-green-200);
|
|
100
100
|
}
|
|
101
101
|
width: var(--size-full);
|
|
102
|
-
height: var(--
|
|
102
|
+
height: var(--pos-navigation-bar-height);
|
|
103
103
|
background: var(--pos-background-color);
|
|
104
104
|
color: var(--pos-normal-text-color);
|
|
105
105
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
section.current {
|
|
2
2
|
display: flex;
|
|
3
|
-
height: var(--
|
|
3
|
+
height: var(--pos-navigation-bar-height);
|
|
4
4
|
flex-grow: 1;
|
|
5
5
|
gap: 0;
|
|
6
6
|
background-color: var(--pos-input-background-color);
|
|
@@ -13,6 +13,7 @@ section.current {
|
|
|
13
13
|
|
|
14
14
|
section.current button {
|
|
15
15
|
cursor: pointer;
|
|
16
|
+
font-size: var(--scale-1);
|
|
16
17
|
flex-grow: 1;
|
|
17
18
|
background: none;
|
|
18
19
|
color: var(--pos-normal-text-color);
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
:host {
|
|
2
|
+
--pos-navigation-bar-height: var(--size-10);
|
|
3
|
+
}
|
|
4
|
+
|
|
1
5
|
search {
|
|
2
6
|
position: relative;
|
|
3
7
|
}
|
|
@@ -41,7 +45,7 @@ search {
|
|
|
41
45
|
|
|
42
46
|
dialog {
|
|
43
47
|
position: absolute;
|
|
44
|
-
margin-top: calc(-1 * var(--
|
|
48
|
+
margin-top: calc(-1 * var(--pos-navigation-bar-height));
|
|
45
49
|
padding: 0;
|
|
46
50
|
width: 100%;
|
|
47
51
|
max-width: 100%;
|
|
@@ -61,7 +65,8 @@ dialog {
|
|
|
61
65
|
align-items: center;
|
|
62
66
|
input {
|
|
63
67
|
display: flex;
|
|
64
|
-
|
|
68
|
+
font-size: var(--scale-1);
|
|
69
|
+
height: var(--pos-navigation-bar-height);
|
|
65
70
|
border-top-left-radius: var(--radius-md);
|
|
66
71
|
border-top-right-radius: var(--radius-md);
|
|
67
72
|
padding-left: var(--size-2);
|
|
@@ -88,13 +93,13 @@ dialog[open] {
|
|
|
88
93
|
dialog {
|
|
89
94
|
margin-top: var(--size-1);
|
|
90
95
|
top: 0;
|
|
91
|
-
width:
|
|
96
|
+
width: 95dvw;
|
|
92
97
|
max-width: unset;
|
|
93
98
|
min-width: unset;
|
|
94
99
|
form {
|
|
95
100
|
input {
|
|
96
|
-
height: var(--size-
|
|
97
|
-
font-size: var(--scale-fluid-
|
|
101
|
+
height: var(--size-12);
|
|
102
|
+
font-size: var(--scale-fluid-3);
|
|
98
103
|
}
|
|
99
104
|
}
|
|
100
105
|
}
|
|
@@ -55,13 +55,14 @@ export class PosNavigation {
|
|
|
55
55
|
this.searchIndex.rebuild();
|
|
56
56
|
}
|
|
57
57
|
openNavigationDialog(e) {
|
|
58
|
-
var _a;
|
|
58
|
+
var _a, _b;
|
|
59
59
|
this.resource = e.detail;
|
|
60
60
|
if (e.detail) {
|
|
61
61
|
this.inputValue = e.detail.uri;
|
|
62
62
|
this.search();
|
|
63
63
|
}
|
|
64
|
-
(_a = this.
|
|
64
|
+
(_a = this.inputRef) === null || _a === void 0 ? void 0 : _a.select();
|
|
65
|
+
(_b = this.dialogRef) === null || _b === void 0 ? void 0 : _b.show();
|
|
65
66
|
}
|
|
66
67
|
clearSearchIndex() {
|
|
67
68
|
var _a;
|
|
@@ -112,7 +113,7 @@ export class PosNavigation {
|
|
|
112
113
|
}
|
|
113
114
|
}
|
|
114
115
|
render() {
|
|
115
|
-
return (h("nav", { key: '
|
|
116
|
+
return (h("nav", { key: 'f09437fdd0bdfc5912af62658f1f32ab54c439c8' }, h("search", { key: 'fa09fec64bacfe1460a1fad256e509a480dd6a01' }, h("pos-navigation-bar", { key: '8dcd35cad5858da049ae942152f3cebe884aa761', searchIndexReady: this.searchIndex !== undefined, current: this.resource }), h("dialog", { key: '3ad61d48a6c5fcd0b010950c702e9488a9fd5160', ref: el => (this.dialogRef = el) }, h("form", { key: '1c23af28daf15f635d4c36002ca6fe153e33b48e', method: "dialog", onSubmit: () => this.onSubmit() }, h("input", { key: 'f11ff492c9333e5f6110630b9b6b3f3b5c127660', ref: el => (this.inputRef = el), enterkeyhint: "search", placeholder: "Search or enter URI", value: this.uri, onChange: e => this.onChange(e), onInput: e => this.onChange(e) }), this.suggestions.length > 0 ? (h("div", { class: "suggestions" }, h("ol", null, this.suggestions.map((it, index) => (h("li", { class: index === this.selectedIndex ? 'selected' : '' }, h("pos-rich-link", { uri: it.ref }))))))) : null)))));
|
|
116
117
|
}
|
|
117
118
|
static get is() { return "pos-navigation"; }
|
|
118
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;
|
|
1
|
+
{"version":3,"file":"pos-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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"]}
|
|
@@ -4,7 +4,7 @@ import { d as defineCustomElement$3 } from './pos-dialog2.js';
|
|
|
4
4
|
import { d as defineCustomElement$2 } from './pos-new-thing-form2.js';
|
|
5
5
|
import { d as defineCustomElement$1 } from './pos-select-term2.js';
|
|
6
6
|
|
|
7
|
-
const posAddNewThingCss = ":host{font-family:var(--font-sans);display:block}button#new{cursor:pointer;display:flex;align-items:center;justify-content:center;border:none;width:var(--
|
|
7
|
+
const posAddNewThingCss = ":host{font-family:var(--font-sans);display:block}button#new{cursor:pointer;display:flex;align-items:center;justify-content:center;border:none;width:var(--size-10);height:var(--size-10);background-color:var(--pos-primary-color);color:var(--pos-primary-text-color);font-size:var(--scale-6);border-radius:var(--radius-xs)}button#new:hover,button#new:focus{outline:none;filter:brightness(110%);box-shadow:var(--shadow-sm)}pos-new-thing-form{margin:var(--scale-3)}";
|
|
8
8
|
const PosAddNewThingStyle0 = posAddNewThingCss;
|
|
9
9
|
|
|
10
10
|
const PosAddNewThing = /*@__PURE__*/ proxyCustomElement(class PosAddNewThing extends HTMLElement {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"pos-add-new-thing2.js","mappings":";;;;;;AAAA,MAAM,iBAAiB,GAAG,6cAA6c,CAAC;AACxe,6BAAe,iBAAiB;;MCMnB,cAAc;;;;;;IAKzB,UAAU;QACR,IAAI,CAAC,MAAM,CAAC,SAAS,EAAE,CAAC;KACzB;IAED,MAAM;QACJ,QACE,EAAC,IAAI,uDACH,+DAAQ,EAAE,EAAC,KAAK,EAAC,KAAK,EAAC,iBAAiB,EAAC,OAAO,EAAE,MAAM,IAAI,CAAC,UAAU,EAAE,IACvE,iEAAU,IAAI,EAAC,oBAAoB,GAAY,CACxC,EACT,mEAAY,GAAG,EAAE,EAAE,KAAK,IAAI,CAAC,MAAM,GAAG,EAA0B,CAAC,IAC/D,6DAAM,IAAI,EAAC,OAAO,sBAAuB,EACzC,2EAAoB,IAAI,EAAC,SAAS,EAAC,YAAY,EAAE,IAAI,CAAC,YAAY,GAAI,CAC3D,CACR,EACP;KACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["src/components/pos-add-new-thing/pos-add-new-thing.css?tag=pos-add-new-thing&encapsulation=shadow","src/components/pos-add-new-thing/pos-add-new-thing.tsx"],"sourcesContent":[":host {\n font-family: var(--font-sans);\n display: block;\n}\n\nbutton#new {\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: center;\n border: none;\n width: var(--
|
|
1
|
+
{"file":"pos-add-new-thing2.js","mappings":";;;;;;AAAA,MAAM,iBAAiB,GAAG,6cAA6c,CAAC;AACxe,6BAAe,iBAAiB;;MCMnB,cAAc;;;;;;IAKzB,UAAU;QACR,IAAI,CAAC,MAAM,CAAC,SAAS,EAAE,CAAC;KACzB;IAED,MAAM;QACJ,QACE,EAAC,IAAI,uDACH,+DAAQ,EAAE,EAAC,KAAK,EAAC,KAAK,EAAC,iBAAiB,EAAC,OAAO,EAAE,MAAM,IAAI,CAAC,UAAU,EAAE,IACvE,iEAAU,IAAI,EAAC,oBAAoB,GAAY,CACxC,EACT,mEAAY,GAAG,EAAE,EAAE,KAAK,IAAI,CAAC,MAAM,GAAG,EAA0B,CAAC,IAC/D,6DAAM,IAAI,EAAC,OAAO,sBAAuB,EACzC,2EAAoB,IAAI,EAAC,SAAS,EAAC,YAAY,EAAE,IAAI,CAAC,YAAY,GAAI,CAC3D,CACR,EACP;KACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["src/components/pos-add-new-thing/pos-add-new-thing.css?tag=pos-add-new-thing&encapsulation=shadow","src/components/pos-add-new-thing/pos-add-new-thing.tsx"],"sourcesContent":[":host {\n font-family: var(--font-sans);\n display: block;\n}\n\nbutton#new {\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: center;\n border: none;\n width: var(--size-10);\n height: var(--size-10);\n background-color: var(--pos-primary-color);\n color: var(--pos-primary-text-color);\n font-size: var(--scale-6);\n border-radius: var(--radius-xs);\n}\n\nbutton#new:hover,\nbutton#new:focus {\n outline: none;\n filter: brightness(110%);\n box-shadow: var(--shadow-sm);\n}\n\npos-new-thing-form {\n margin: var(--scale-3);\n}\n","import { Component, Host, h, Prop } from '@stencil/core';\n\n@Component({\n tag: 'pos-add-new-thing',\n styleUrl: 'pos-add-new-thing.css',\n shadow: true,\n})\nexport class PosAddNewThing {\n @Prop() referenceUri!: string;\n\n private dialog: HTMLPosDialogElement;\n\n openDialog() {\n this.dialog.showModal();\n }\n\n render() {\n return (\n <Host>\n <button id=\"new\" title=\"Add a new thing\" onClick={() => this.openDialog()}>\n <ion-icon name=\"add-circle-outline\"></ion-icon>\n </button>\n <pos-dialog ref={el => (this.dialog = el as HTMLPosDialogElement)}>\n <span slot=\"title\">Add a new thing</span>\n <pos-new-thing-form slot=\"content\" referenceUri={this.referenceUri} />\n </pos-dialog>\n </Host>\n );\n }\n}\n"],"version":3}
|
|
@@ -6,7 +6,7 @@ import { d as defineCustomElement$3 } from './progress-bar.js';
|
|
|
6
6
|
import { d as defineCustomElement$2 } from './pos-label2.js';
|
|
7
7
|
import { d as defineCustomElement$1 } from './pos-resource2.js';
|
|
8
8
|
|
|
9
|
-
const posMakeFindableCss = "button.main {\n display: flex;\n transition:\n width 200ms,\n background-color 500ms,\n color 500ms,\n border-color 500ms;\n max-width: var(--size-40);\n flex-direction: row;\n overflow: hidden;\n height: var(--
|
|
9
|
+
const posMakeFindableCss = "button.main {\n display: flex;\n transition:\n width 200ms,\n background-color 500ms,\n color 500ms,\n border-color 500ms;\n max-width: var(--size-40);\n flex-direction: row;\n overflow: hidden;\n height: var(--pos-navigation-bar-height);\n width: var(--pos-navigation-bar-height);\n align-items: center;\n justify-content: center;\n border-radius: var(--radius-md);\n color: var(--pos-subtle-text-color);\n border: var(--size-px) dashed var(--pos-subtle-text-color);\n background-color: var(--pos-background-color);\n\n p {\n padding: 0;\n margin: 0;\n display: none;\n white-space: nowrap;\n }\n\n &.success {\n color: var(--color-green-700);\n border-color: var(--color-green-700);\n border-style: solid;\n background-color: var(--color-green-100);\n }\n\n &:active {\n transform: scale(0.99);\n filter: brightness(90%);\n }\n &:focus {\n outline: var(--pos-input-focus-outline);\n }\n}\n\n.options {\n position: absolute;\n animation: fadeIn 300ms;\n padding: 0;\n margin-top: var(--size-1);\n z-index: var(--layer-top);\n\n ol {\n display: flex;\n flex-direction: column;\n box-shadow: var(--shadow-md);\n backdrop-filter: var(--blur-md);\n border-radius: var(--radius-xs);\n overflow: hidden;\n color: var(--color-grey-900);\n background-color: var(--color-grey-200);\n padding: 0;\n margin: 0;\n list-style: none;\n label {\n display: flex;\n justify-content: flex-start;\n align-items: center;\n transition: all 300ms var(--ease-in-out-sine);\n margin: 0;\n border: none;\n outline: none;\n padding: var(--size-2);\n width: var(--size-full);\n\n &:hover,\n &:focus {\n filter: brightness(80%);\n }\n\n &:active {\n filter: brightness(90%);\n }\n }\n }\n label:has(input:checked) {\n background-color: var(--color-green-100);\n }\n}\n\nsvg {\n display: inline-block;\n height: var(--size-6);\n flex-shrink: 0;\n flex-grow: 0;\n width: var(--size-6);\n}\n\nbutton.main:hover,\nbutton.open {\n &.success {\n background: var(--color-green-200);\n }\n width: var(--size-full);\n height: var(--pos-navigation-bar-height);\n background: var(--pos-background-color);\n color: var(--pos-normal-text-color);\n\n p {\n display: inline-block;\n }\n}\n\n@keyframes fadeIn {\n 0% {\n opacity: 0;\n }\n 100% {\n opacity: 1;\n }\n}\n";
|
|
10
10
|
const PosMakeFindableStyle0 = posMakeFindableCss;
|
|
11
11
|
|
|
12
12
|
const PosMakeFindable = /*@__PURE__*/ proxyCustomElement(class PosMakeFindable extends HTMLElement {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"pos-make-findable2.js","mappings":";;;;;;;;AAAA,MAAM,kBAAkB,GAAG,g2EAAg2E,CAAC;AAC53E,8BAAe,kBAAkB;;MCQpB,eAAe;IAJ5B;;;;;;;QASW,YAAO,GAAiB,EAAE,CAAC;QAM3B,gBAAW,GAAG,KAAK,CAAC;QACpB,cAAS,GAAG,KAAK,CAAC;QAyC3B,iBAAY,GAAG,OAAO,EAAS;YAC7B,IAAI,CAAC,EAAE,GAAG,EAAE,CAAC;YACb,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;YACzC,IAAI,CAAC,eAAe,CAACA,KAAO,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;YAC5C,IAAI,CAAC,wBAAwB,GAAGA,KAAO,CAAC,QAAQ,CAAC,SAAS,EAAE,OAAO;gBACjE,IAAI,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC;aAC/B,CAAC,CAAC;SACJ,CAAC;KA0FH;IAlIC,iBAAiB;QACf,cAAc,CAAC,IAAI,CAAC,CAAC;KACtB;IAED,oBAAoB;QAClB,IAAI,CAAC,wBAAwB,IAAI,IAAI,CAAC,wBAAwB,EAAE,CAAC;KAClE;IAGD,WAAW,CAAC,KAAiB;;QAE3B,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,QAAQ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,EAAC,WAAW,kBACN,KAAK,EAClB,MAAM,EAAC,cAAc,IAErB,8BACiB,OAAO,qBACN,OAAO,EACvB,CAAC,EAAC,gSAAgS,GAClS,CACE,CACP,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["session"],"sources":["src/components/pos-make-findable/pos-make-findable.css?tag=pos-make-findable","src/components/pos-make-findable/pos-make-findable.tsx"],"sourcesContent":["button.main {\n display: flex;\n transition:\n width 200ms,\n background-color 500ms,\n color 500ms,\n border-color 500ms;\n max-width: var(--size-40);\n flex-direction: row;\n overflow: hidden;\n height: var(--size-8);\n width: var(--size-8);\n align-items: center;\n justify-content: center;\n border-radius: var(--radius-md);\n color: var(--pos-subtle-text-color);\n border: var(--size-px) dashed var(--pos-subtle-text-color);\n background-color: var(--pos-background-color);\n\n p {\n padding: 0;\n margin: 0;\n display: none;\n white-space: nowrap;\n }\n\n &.success {\n color: var(--color-green-700);\n border-color: var(--color-green-700);\n border-style: solid;\n background-color: var(--color-green-100);\n }\n\n &:active {\n transform: scale(0.99);\n filter: brightness(90%);\n }\n &:focus {\n outline: var(--pos-input-focus-outline);\n }\n}\n\n.options {\n position: absolute;\n animation: fadeIn 300ms;\n padding: 0;\n margin-top: var(--size-1);\n z-index: var(--layer-top);\n\n ol {\n display: flex;\n flex-direction: column;\n box-shadow: var(--shadow-md);\n backdrop-filter: var(--blur-md);\n border-radius: var(--radius-xs);\n overflow: hidden;\n color: var(--color-grey-900);\n background-color: var(--color-grey-200);\n padding: 0;\n margin: 0;\n list-style: none;\n label {\n display: flex;\n justify-content: flex-start;\n align-items: center;\n transition: all 300ms var(--ease-in-out-sine);\n margin: 0;\n border: none;\n outline: none;\n padding: var(--size-2);\n width: var(--size-full);\n\n &:hover,\n &:focus {\n filter: brightness(80%);\n }\n\n &:active {\n filter: brightness(90%);\n }\n }\n }\n label:has(input:checked) {\n background-color: var(--color-green-100);\n }\n}\n\nsvg {\n display: inline-block;\n height: var(--size-6);\n flex-shrink: 0;\n flex-grow: 0;\n width: var(--size-6);\n}\n\nbutton.main:hover,\nbutton.open {\n &.success {\n background: var(--color-green-200);\n }\n width: var(--size-full);\n height: var(--size-8);\n background: var(--pos-background-color);\n color: var(--pos-normal-text-color);\n\n p {\n display: inline-block;\n }\n}\n\n@keyframes fadeIn {\n 0% {\n opacity: 0;\n }\n 100% {\n opacity: 1;\n }\n}\n","import { Component, Element, Event, EventEmitter, h, Host, Listen, Prop, State, Watch } from '@stencil/core';\nimport { LabelIndex, PodOS, Thing, WebIdProfile } from '@pod-os/core';\nimport { PodOsAware, PodOsEventEmitter, subscribePodOs } from '../events/PodOsAware';\nimport session from '../../store/session';\n\n@Component({\n tag: 'pos-make-findable',\n styleUrl: 'pos-make-findable.css',\n})\nexport class PosMakeFindable implements PodOsAware {\n @Prop() uri!: string;\n\n @State() os: PodOS;\n @State() thing: Thing;\n @State() indexes: LabelIndex[] = [];\n\n @Event({ eventName: 'pod-os:init' }) subscribePodOs: PodOsEventEmitter;\n\n @State() unsubscribeSessionChange: undefined | (() => void);\n\n @State() showOptions = false;\n @State() isIndexed = false;\n\n @Event({ eventName: 'pod-os:error' }) errorEmitter: EventEmitter;\n @Event({ eventName: 'pod-os:search:index-updated' }) indexUpdatedEmitter: EventEmitter;\n @Event({ eventName: 'pod-os:search:index-created' }) indexCreatedEmitter: EventEmitter;\n\n @Element() el: HTMLElement;\n\n componentWillLoad() {\n subscribePodOs(this);\n }\n\n disconnectedCallback() {\n this.unsubscribeSessionChange && this.unsubscribeSessionChange();\n }\n\n @Listen('click', { target: 'document' })\n hideOptions(event: MouseEvent) {\n // @ts-ignore\n if (!this.el.contains(event.target)) {\n this.showOptions = false;\n }\n }\n\n @Listen('keydown')\n handleKeyDown(ev: KeyboardEvent) {\n if (ev.key === 'Escape') {\n this.showOptions = false;\n }\n }\n\n @Watch('uri')\n updateUri(uri: string) {\n this.thing = this.os.store.get(uri);\n this.isIndexed = this.checkIfIndexed(uri);\n }\n\n private checkIfIndexed(uri: string) {\n return this.indexes.some(it => it.contains(uri));\n }\n\n receivePodOs = async (os: PodOS) => {\n this.os = os;\n this.thing = this.os.store.get(this.uri);\n this.getLabelIndexes(session.state.profile);\n this.unsubscribeSessionChange = session.onChange('profile', profile => {\n this.getLabelIndexes(profile);\n });\n };\n\n private getLabelIndexes(profile: WebIdProfile) {\n if (profile) {\n this.indexes = profile.getPrivateLabelIndexes().map(it => this.os.store.get(it).assume(LabelIndex));\n this.isIndexed = this.checkIfIndexed(this.uri);\n }\n }\n\n private async onClick(e: MouseEvent) {\n e.preventDefault();\n if (this.indexes.length === 1) {\n const index = this.indexes[0];\n await this.addToLabelIndex(index);\n this.indexUpdatedEmitter.emit(index);\n } else if (this.indexes.length > 1) {\n this.showOptions = !this.showOptions;\n } else {\n const index = await this.createDefaultLabelIndex();\n await this.addToLabelIndex(index);\n this.indexCreatedEmitter.emit(index);\n }\n }\n\n private async addToLabelIndex(index: LabelIndex) {\n try {\n await this.os.addToLabelIndex(this.thing, index);\n this.isIndexed = true;\n } catch (e) {\n this.errorEmitter.emit(e);\n }\n\n this.showOptions = false;\n }\n\n private async createDefaultLabelIndex(): Promise<LabelIndex> {\n try {\n return await this.os.createDefaultLabelIndex(session.state.profile);\n } catch (e) {\n this.errorEmitter.emit(e);\n }\n }\n\n render() {\n if (!session.state.isLoggedIn || !this.uri) {\n return null;\n }\n\n const label = 'Make this findable';\n return (\n <Host>\n <button\n type=\"button\"\n aria-label={label}\n class={{ main: true, open: this.showOptions, success: this.isIndexed }}\n onClick={e => this.onClick(e)}\n title=\"\"\n >\n {this.isIndexed ? <IconSuccess /> : <IconMakeFindable />}\n <p>{label}</p>\n </button>\n {this.showOptions && (\n <div class=\"options\">\n <ol role=\"listbox\">\n {this.indexes.map((index: LabelIndex) => (\n <li role=\"option\">\n <label>\n <input\n type=\"checkbox\"\n checked={index.contains(this.uri)}\n onChange={e => this.chooseOption(e, index)}\n />\n <pos-resource uri={index.uri} lazy={true}>\n <pos-label></pos-label>\n </pos-resource>\n </label>\n </li>\n ))}\n </ol>\n </div>\n )}\n </Host>\n );\n }\n\n private async chooseOption(e: Event, index: LabelIndex) {\n e.preventDefault();\n await this.addToLabelIndex(index);\n this.indexUpdatedEmitter.emit(index);\n }\n}\n\nconst IconMakeFindable = () => (\n <svg\n role=\"presentation\"\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=\"M19.5 14.25v-2.625a3.375 3.375 0 0 0-3.375-3.375h-1.5A1.125 1.125 0 0 1 13.5 7.125v-1.5a3.375 3.375 0 0 0-3.375-3.375H8.25m5.231 13.481L15 17.25m-4.5-15H5.625c-.621 0-1.125.504-1.125 1.125v16.5c0 .621.504 1.125 1.125 1.125h12.75c.621 0 1.125-.504 1.125-1.125V11.25a9 9 0 0 0-9-9Zm3.75 11.625a2.625 2.625 0 1 1-5.25 0 2.625 2.625 0 0 1 5.25 0Z\"\n />\n </svg>\n);\n\nconst IconSuccess = () => (\n <svg\n role=\"presentation\"\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=\"M10.125 2.25h-4.5c-.621 0-1.125.504-1.125 1.125v17.25c0 .621.504 1.125 1.125 1.125h12.75c.621 0 1.125-.504 1.125-1.125v-9M10.125 2.25h.375a9 9 0 0 1 9 9v.375M10.125 2.25A3.375 3.375 0 0 1 13.5 5.625v1.5c0 .621.504 1.125 1.125 1.125h1.5a3.375 3.375 0 0 1 3.375 3.375M9 15l2.25 2.25L15 12\"\n />\n </svg>\n);\n"],"version":3}
|
|
1
|
+
{"file":"pos-make-findable2.js","mappings":";;;;;;;;AAAA,MAAM,kBAAkB,GAAG,y5EAAy5E,CAAC;AACr7E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IAAI,IAAI,CAAC,YAAY,CAAC,CAAC,EAAE,KAAK,CAAC,GAC1C,EACF,oBAAc,GAAG,EAAE,KAAK,CAAC,GAAG,EAAE,IAAI,EAAE,IAAI,IACtC,oBAAuB,CACV,CACT,CACL,CACN,CAAC,CACC,CACD,CACP,CACI,EACP;KACH;IAEO,MAAM,YAAY,CAAC,CAAQ,EAAE,KAAiB;QACpD,CAAC,CAAC,cAAc,EAAE,CAAC;QACnB,MAAM,IAAI,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC;QAClC,IAAI,CAAC,mBAAmB,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;KACtC;;;;;;;;;;;;;;;;;AAGH,MAAM,gBAAgB,GAAG,OACvB,WACE,IAAI,EAAC,cAAc,EACnB,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,wVAAwV,GAC1V,CACE,CACP,CAAC;AAEF,MAAM,WAAW,GAAG,OAClB,WACE,IAAI,EAAC,cAAc,EACnB,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,gSAAgS,GAClS,CACE,CACP,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["session"],"sources":["src/components/pos-make-findable/pos-make-findable.css?tag=pos-make-findable","src/components/pos-make-findable/pos-make-findable.tsx"],"sourcesContent":["button.main {\n display: flex;\n transition:\n width 200ms,\n background-color 500ms,\n color 500ms,\n border-color 500ms;\n max-width: var(--size-40);\n flex-direction: row;\n overflow: hidden;\n height: var(--pos-navigation-bar-height);\n width: var(--pos-navigation-bar-height);\n align-items: center;\n justify-content: center;\n border-radius: var(--radius-md);\n color: var(--pos-subtle-text-color);\n border: var(--size-px) dashed var(--pos-subtle-text-color);\n background-color: var(--pos-background-color);\n\n p {\n padding: 0;\n margin: 0;\n display: none;\n white-space: nowrap;\n }\n\n &.success {\n color: var(--color-green-700);\n border-color: var(--color-green-700);\n border-style: solid;\n background-color: var(--color-green-100);\n }\n\n &:active {\n transform: scale(0.99);\n filter: brightness(90%);\n }\n &:focus {\n outline: var(--pos-input-focus-outline);\n }\n}\n\n.options {\n position: absolute;\n animation: fadeIn 300ms;\n padding: 0;\n margin-top: var(--size-1);\n z-index: var(--layer-top);\n\n ol {\n display: flex;\n flex-direction: column;\n box-shadow: var(--shadow-md);\n backdrop-filter: var(--blur-md);\n border-radius: var(--radius-xs);\n overflow: hidden;\n color: var(--color-grey-900);\n background-color: var(--color-grey-200);\n padding: 0;\n margin: 0;\n list-style: none;\n label {\n display: flex;\n justify-content: flex-start;\n align-items: center;\n transition: all 300ms var(--ease-in-out-sine);\n margin: 0;\n border: none;\n outline: none;\n padding: var(--size-2);\n width: var(--size-full);\n\n &:hover,\n &:focus {\n filter: brightness(80%);\n }\n\n &:active {\n filter: brightness(90%);\n }\n }\n }\n label:has(input:checked) {\n background-color: var(--color-green-100);\n }\n}\n\nsvg {\n display: inline-block;\n height: var(--size-6);\n flex-shrink: 0;\n flex-grow: 0;\n width: var(--size-6);\n}\n\nbutton.main:hover,\nbutton.open {\n &.success {\n background: var(--color-green-200);\n }\n width: var(--size-full);\n height: var(--pos-navigation-bar-height);\n background: var(--pos-background-color);\n color: var(--pos-normal-text-color);\n\n p {\n display: inline-block;\n }\n}\n\n@keyframes fadeIn {\n 0% {\n opacity: 0;\n }\n 100% {\n opacity: 1;\n }\n}\n","import { Component, Element, Event, EventEmitter, h, Host, Listen, Prop, State, Watch } from '@stencil/core';\nimport { LabelIndex, PodOS, Thing, WebIdProfile } from '@pod-os/core';\nimport { PodOsAware, PodOsEventEmitter, subscribePodOs } from '../events/PodOsAware';\nimport session from '../../store/session';\n\n@Component({\n tag: 'pos-make-findable',\n styleUrl: 'pos-make-findable.css',\n})\nexport class PosMakeFindable implements PodOsAware {\n @Prop() uri!: string;\n\n @State() os: PodOS;\n @State() thing: Thing;\n @State() indexes: LabelIndex[] = [];\n\n @Event({ eventName: 'pod-os:init' }) subscribePodOs: PodOsEventEmitter;\n\n @State() unsubscribeSessionChange: undefined | (() => void);\n\n @State() showOptions = false;\n @State() isIndexed = false;\n\n @Event({ eventName: 'pod-os:error' }) errorEmitter: EventEmitter;\n @Event({ eventName: 'pod-os:search:index-updated' }) indexUpdatedEmitter: EventEmitter;\n @Event({ eventName: 'pod-os:search:index-created' }) indexCreatedEmitter: EventEmitter;\n\n @Element() el: HTMLElement;\n\n componentWillLoad() {\n subscribePodOs(this);\n }\n\n disconnectedCallback() {\n this.unsubscribeSessionChange && this.unsubscribeSessionChange();\n }\n\n @Listen('click', { target: 'document' })\n hideOptions(event: MouseEvent) {\n // @ts-ignore\n if (!this.el.contains(event.target)) {\n this.showOptions = false;\n }\n }\n\n @Listen('keydown')\n handleKeyDown(ev: KeyboardEvent) {\n if (ev.key === 'Escape') {\n this.showOptions = false;\n }\n }\n\n @Watch('uri')\n updateUri(uri: string) {\n this.thing = this.os.store.get(uri);\n this.isIndexed = this.checkIfIndexed(uri);\n }\n\n private checkIfIndexed(uri: string) {\n return this.indexes.some(it => it.contains(uri));\n }\n\n receivePodOs = async (os: PodOS) => {\n this.os = os;\n this.thing = this.os.store.get(this.uri);\n this.getLabelIndexes(session.state.profile);\n this.unsubscribeSessionChange = session.onChange('profile', profile => {\n this.getLabelIndexes(profile);\n });\n };\n\n private getLabelIndexes(profile: WebIdProfile) {\n if (profile) {\n this.indexes = profile.getPrivateLabelIndexes().map(it => this.os.store.get(it).assume(LabelIndex));\n this.isIndexed = this.checkIfIndexed(this.uri);\n }\n }\n\n private async onClick(e: MouseEvent) {\n e.preventDefault();\n if (this.indexes.length === 1) {\n const index = this.indexes[0];\n await this.addToLabelIndex(index);\n this.indexUpdatedEmitter.emit(index);\n } else if (this.indexes.length > 1) {\n this.showOptions = !this.showOptions;\n } else {\n const index = await this.createDefaultLabelIndex();\n await this.addToLabelIndex(index);\n this.indexCreatedEmitter.emit(index);\n }\n }\n\n private async addToLabelIndex(index: LabelIndex) {\n try {\n await this.os.addToLabelIndex(this.thing, index);\n this.isIndexed = true;\n } catch (e) {\n this.errorEmitter.emit(e);\n }\n\n this.showOptions = false;\n }\n\n private async createDefaultLabelIndex(): Promise<LabelIndex> {\n try {\n return await this.os.createDefaultLabelIndex(session.state.profile);\n } catch (e) {\n this.errorEmitter.emit(e);\n }\n }\n\n render() {\n if (!session.state.isLoggedIn || !this.uri) {\n return null;\n }\n\n const label = 'Make this findable';\n return (\n <Host>\n <button\n type=\"button\"\n aria-label={label}\n class={{ main: true, open: this.showOptions, success: this.isIndexed }}\n onClick={e => this.onClick(e)}\n title=\"\"\n >\n {this.isIndexed ? <IconSuccess /> : <IconMakeFindable />}\n <p>{label}</p>\n </button>\n {this.showOptions && (\n <div class=\"options\">\n <ol role=\"listbox\">\n {this.indexes.map((index: LabelIndex) => (\n <li role=\"option\">\n <label>\n <input\n type=\"checkbox\"\n checked={index.contains(this.uri)}\n onChange={e => this.chooseOption(e, index)}\n />\n <pos-resource uri={index.uri} lazy={true}>\n <pos-label></pos-label>\n </pos-resource>\n </label>\n </li>\n ))}\n </ol>\n </div>\n )}\n </Host>\n );\n }\n\n private async chooseOption(e: Event, index: LabelIndex) {\n e.preventDefault();\n await this.addToLabelIndex(index);\n this.indexUpdatedEmitter.emit(index);\n }\n}\n\nconst IconMakeFindable = () => (\n <svg\n role=\"presentation\"\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=\"M19.5 14.25v-2.625a3.375 3.375 0 0 0-3.375-3.375h-1.5A1.125 1.125 0 0 1 13.5 7.125v-1.5a3.375 3.375 0 0 0-3.375-3.375H8.25m5.231 13.481L15 17.25m-4.5-15H5.625c-.621 0-1.125.504-1.125 1.125v16.5c0 .621.504 1.125 1.125 1.125h12.75c.621 0 1.125-.504 1.125-1.125V11.25a9 9 0 0 0-9-9Zm3.75 11.625a2.625 2.625 0 1 1-5.25 0 2.625 2.625 0 0 1 5.25 0Z\"\n />\n </svg>\n);\n\nconst IconSuccess = () => (\n <svg\n role=\"presentation\"\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=\"M10.125 2.25h-4.5c-.621 0-1.125.504-1.125 1.125v17.25c0 .621.504 1.125 1.125 1.125h12.75c.621 0 1.125-.504 1.125-1.125v-9M10.125 2.25h.375a9 9 0 0 1 9 9v.375M10.125 2.25A3.375 3.375 0 0 1 13.5 5.625v1.5c0 .621.504 1.125 1.125 1.125h1.5a3.375 3.375 0 0 1 3.375 3.375M9 15l2.25 2.25L15 12\"\n />\n </svg>\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(--
|
|
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";
|
|
8
8
|
const PosNavigationBarStyle0 = posNavigationBarCss;
|
|
9
9
|
|
|
10
10
|
const PosNavigationBar = /*@__PURE__*/ proxyCustomElement(class PosNavigationBar extends HTMLElement {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"pos-navigation-bar2.js","mappings":";;;;;;AAAA,MAAM,mBAAmB,GAAG,
|
|
1
|
+
{"file":"pos-navigation-bar2.js","mappings":";;;;;;AAAA,MAAM,mBAAmB,GAAG,omBAAomB,CAAC;AACjoB,+BAAe,mBAAmB;;MCOrB,gBAAgB;;;;;;;IAMnB,OAAO;QACb,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;KAClC;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,IACzD,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,qBAAqB,CACrD,CACD,EACV;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 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","import { Component, Event, EventEmitter, h, 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 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 {this.current ? this.current.label() : 'Search or enter URI'}\n </button>\n </section>\n );\n }\n}\n"],"version":3}
|
|
@@ -202,7 +202,7 @@ function debounceTime(dueTime, scheduler = asyncScheduler) {
|
|
|
202
202
|
});
|
|
203
203
|
}
|
|
204
204
|
|
|
205
|
-
const posNavigationCss = "
|
|
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 &.selected {\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 {
|
|
@@ -263,13 +263,14 @@ const PosNavigation = /*@__PURE__*/ proxyCustomElement(class PosNavigation exten
|
|
|
263
263
|
this.searchIndex.rebuild();
|
|
264
264
|
}
|
|
265
265
|
openNavigationDialog(e) {
|
|
266
|
-
var _a;
|
|
266
|
+
var _a, _b;
|
|
267
267
|
this.resource = e.detail;
|
|
268
268
|
if (e.detail) {
|
|
269
269
|
this.inputValue = e.detail.uri;
|
|
270
270
|
this.search();
|
|
271
271
|
}
|
|
272
|
-
(_a = this.
|
|
272
|
+
(_a = this.inputRef) === null || _a === void 0 ? void 0 : _a.select();
|
|
273
|
+
(_b = this.dialogRef) === null || _b === void 0 ? void 0 : _b.show();
|
|
273
274
|
}
|
|
274
275
|
clearSearchIndex() {
|
|
275
276
|
var _a;
|
|
@@ -320,7 +321,7 @@ const PosNavigation = /*@__PURE__*/ proxyCustomElement(class PosNavigation exten
|
|
|
320
321
|
}
|
|
321
322
|
}
|
|
322
323
|
render() {
|
|
323
|
-
return (h("nav", { key: '
|
|
324
|
+
return (h("nav", { key: 'f09437fdd0bdfc5912af62658f1f32ab54c439c8' }, h("search", { key: 'fa09fec64bacfe1460a1fad256e509a480dd6a01' }, h("pos-navigation-bar", { key: '8dcd35cad5858da049ae942152f3cebe884aa761', searchIndexReady: this.searchIndex !== undefined, current: this.resource }), h("dialog", { key: '3ad61d48a6c5fcd0b010950c702e9488a9fd5160', ref: el => (this.dialogRef = el) }, h("form", { key: '1c23af28daf15f635d4c36002ca6fe153e33b48e', method: "dialog", onSubmit: () => this.onSubmit() }, h("input", { key: 'f11ff492c9333e5f6110630b9b6b3f3b5c127660', ref: el => (this.inputRef = el), enterkeyhint: "search", placeholder: "Search or enter URI", value: this.uri, onChange: e => this.onChange(e), onInput: e => this.onChange(e) }), this.suggestions.length > 0 ? (h("div", { class: "suggestions" }, h("ol", null, this.suggestions.map((it, index) => (h("li", { class: index === this.selectedIndex ? 'selected' : '' }, h("pos-rich-link", { uri: it.ref }))))))) : null)))));
|
|
324
325
|
}
|
|
325
326
|
static get watchers() { return {
|
|
326
327
|
"uri": ["updateResource"],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"pos-navigation2.js","mappings":";;;;;;;;;;;;AAAO,MAAM,qBAAqB,GAAG;AACrC,IAAI,GAAG,GAAG;AACV,QAAQ,OAAO,CAAC,qBAAqB,CAAC,QAAQ,IAAI,IAAI,EAAE,GAAG,EAAE,CAAC;AAC9D,KAAK;A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AC;SACjE;aAAM;YACL,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;SACxC;KACF;IAED,MAAM;QACJ,QACE,8DACE,iEACE,2EACE,gBAAgB,EAAE,IAAI,CAAC,WAAW,KAAK,SAAS,EAChD,OAAO,EAAE,IAAI,CAAC,QAAQ,GACF,EACtB,+DAAQ,GAAG,EAAE,EAAE,KAAK,IAAI,CAAC,SAAS,GAAG,EAAE,CAAC,IACtC,6DAAM,MAAM,EAAC,QAAQ,EAAC,QAAQ,EAAE,MAAM,IAAI,CAAC,QAAQ,EAAE,IACnD,8DACE,YAAY,EAAC,QAAQ,EACrB,WAAW,EAAC,qBAAqB,EACjC,KAAK,EAAE,IAAI,CAAC,GAAG,EACf,QAAQ,EAAE,CAAC,IAAI,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,EAC/B,OAAO,EAAE,CAAC,IAAI,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,GAC9B,EACD,IAAI,CAAC,WAAW,CAAC,MAAM,GAAG,CAAC,IAC1B,WAAK,KAAK,EAAC,aAAa,IACtB,cACG,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,KAAK,MAC9B,UAAI,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC,aAAa,GAAG,UAAU,GAAG,EAAE,IACvD,qBAAe,GAAG,EAAE,EAAE,CAAC,GAAG,GAAkB,CACzC,CACN,CAAC,CACC,CACD,IACJ,IAAI,CACH,CACA,CACF,CACL,EACN;KACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["session"],"sources":["../node_modules/rxjs/dist/esm/internal/scheduler/dateTimestampProvider.js","../node_modules/rxjs/dist/esm/internal/scheduler/Action.js","../node_modules/rxjs/dist/esm/internal/scheduler/intervalProvider.js","../node_modules/rxjs/dist/esm/internal/scheduler/AsyncAction.js","../node_modules/rxjs/dist/esm/internal/Scheduler.js","../node_modules/rxjs/dist/esm/internal/scheduler/AsyncScheduler.js","../node_modules/rxjs/dist/esm/internal/scheduler/async.js","../node_modules/rxjs/dist/esm/internal/operators/debounceTime.js","src/components/pos-navigation/pos-navigation.css?tag=pos-navigation&encapsulation=shadow","src/components/pos-navigation/pos-navigation.tsx"],"sourcesContent":["export const dateTimestampProvider = {\n now() {\n return (dateTimestampProvider.delegate || Date).now();\n },\n delegate: undefined,\n};\n//# sourceMappingURL=dateTimestampProvider.js.map","import { Subscription } from '../Subscription';\nexport class Action extends Subscription {\n constructor(scheduler, work) {\n super();\n }\n schedule(state, delay = 0) {\n return this;\n }\n}\n//# sourceMappingURL=Action.js.map","export const intervalProvider = {\n setInterval(handler, timeout, ...args) {\n const { delegate } = intervalProvider;\n if (delegate === null || delegate === void 0 ? void 0 : delegate.setInterval) {\n return delegate.setInterval(handler, timeout, ...args);\n }\n return setInterval(handler, timeout, ...args);\n },\n clearInterval(handle) {\n const { delegate } = intervalProvider;\n return ((delegate === null || delegate === void 0 ? void 0 : delegate.clearInterval) || clearInterval)(handle);\n },\n delegate: undefined,\n};\n//# sourceMappingURL=intervalProvider.js.map","import { Action } from './Action';\nimport { intervalProvider } from './intervalProvider';\nimport { arrRemove } from '../util/arrRemove';\nexport class AsyncAction extends Action {\n constructor(scheduler, work) {\n super(scheduler, work);\n this.scheduler = scheduler;\n this.work = work;\n this.pending = false;\n }\n schedule(state, delay = 0) {\n var _a;\n if (this.closed) {\n return this;\n }\n this.state = state;\n const id = this.id;\n const scheduler = this.scheduler;\n if (id != null) {\n this.id = this.recycleAsyncId(scheduler, id, delay);\n }\n this.pending = true;\n this.delay = delay;\n this.id = (_a = this.id) !== null && _a !== void 0 ? _a : this.requestAsyncId(scheduler, this.id, delay);\n return this;\n }\n requestAsyncId(scheduler, _id, delay = 0) {\n return intervalProvider.setInterval(scheduler.flush.bind(scheduler, this), delay);\n }\n recycleAsyncId(_scheduler, id, delay = 0) {\n if (delay != null && this.delay === delay && this.pending === false) {\n return id;\n }\n if (id != null) {\n intervalProvider.clearInterval(id);\n }\n return undefined;\n }\n execute(state, delay) {\n if (this.closed) {\n return new Error('executing a cancelled action');\n }\n this.pending = false;\n const error = this._execute(state, delay);\n if (error) {\n return error;\n }\n else if (this.pending === false && this.id != null) {\n this.id = this.recycleAsyncId(this.scheduler, this.id, null);\n }\n }\n _execute(state, _delay) {\n let errored = false;\n let errorValue;\n try {\n this.work(state);\n }\n catch (e) {\n errored = true;\n errorValue = e ? e : new Error('Scheduled action threw falsy error');\n }\n if (errored) {\n this.unsubscribe();\n return errorValue;\n }\n }\n unsubscribe() {\n if (!this.closed) {\n const { id, scheduler } = this;\n const { actions } = scheduler;\n this.work = this.state = this.scheduler = null;\n this.pending = false;\n arrRemove(actions, this);\n if (id != null) {\n this.id = this.recycleAsyncId(scheduler, id, null);\n }\n this.delay = null;\n super.unsubscribe();\n }\n }\n}\n//# sourceMappingURL=AsyncAction.js.map","import { dateTimestampProvider } from './scheduler/dateTimestampProvider';\nexport class Scheduler {\n constructor(schedulerActionCtor, now = Scheduler.now) {\n this.schedulerActionCtor = schedulerActionCtor;\n this.now = now;\n }\n schedule(work, delay = 0, state) {\n return new this.schedulerActionCtor(this, work).schedule(state, delay);\n }\n}\nScheduler.now = dateTimestampProvider.now;\n//# sourceMappingURL=Scheduler.js.map","import { Scheduler } from '../Scheduler';\nexport class AsyncScheduler extends Scheduler {\n constructor(SchedulerAction, now = Scheduler.now) {\n super(SchedulerAction, now);\n this.actions = [];\n this._active = false;\n }\n flush(action) {\n const { actions } = this;\n if (this._active) {\n actions.push(action);\n return;\n }\n let error;\n this._active = true;\n do {\n if ((error = action.execute(action.state, action.delay))) {\n break;\n }\n } while ((action = actions.shift()));\n this._active = false;\n if (error) {\n while ((action = actions.shift())) {\n action.unsubscribe();\n }\n throw error;\n }\n }\n}\n//# sourceMappingURL=AsyncScheduler.js.map","import { AsyncAction } from './AsyncAction';\nimport { AsyncScheduler } from './AsyncScheduler';\nexport const asyncScheduler = new AsyncScheduler(AsyncAction);\nexport const async = asyncScheduler;\n//# sourceMappingURL=async.js.map","import { asyncScheduler } from '../scheduler/async';\nimport { operate } from '../util/lift';\nimport { createOperatorSubscriber } from './OperatorSubscriber';\nexport function debounceTime(dueTime, scheduler = asyncScheduler) {\n return operate((source, subscriber) => {\n let activeTask = null;\n let lastValue = null;\n let lastTime = null;\n const emit = () => {\n if (activeTask) {\n activeTask.unsubscribe();\n activeTask = null;\n const value = lastValue;\n lastValue = null;\n subscriber.next(value);\n }\n };\n function emitWhenIdle() {\n const targetTime = lastTime + dueTime;\n const now = scheduler.now();\n if (now < targetTime) {\n activeTask = this.schedule(undefined, targetTime - now);\n subscriber.add(activeTask);\n return;\n }\n emit();\n }\n source.subscribe(createOperatorSubscriber(subscriber, (value) => {\n lastValue = value;\n lastTime = scheduler.now();\n if (!activeTask) {\n activeTask = scheduler.schedule(emitWhenIdle, dueTime);\n subscriber.add(activeTask);\n }\n }, () => {\n emit();\n subscriber.complete();\n }, undefined, () => {\n lastValue = activeTask = null;\n }));\n });\n}\n//# sourceMappingURL=debounceTime.js.map","search {\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 &.selected {\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(--size-8));\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 height: var(--size-8);\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: 99dvw;\n max-width: unset;\n min-width: unset;\n form {\n input {\n height: var(--size-10);\n font-size: var(--scale-fluid-2);\n }\n }\n }\n}\n\n@keyframes fadeIn {\n from {\n opacity: 0;\n }\n to {\n opacity: 1;\n }\n}\n","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 @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.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 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"],"version":3}
|
|
1
|
+
{"file":"pos-navigation2.js","mappings":";;;;;;;;;;;;AAAO,MAAM,qBAAqB,GAAG;AACrC,IAAI,GAAG,GAAG;AACV,QAAQ,OAAO,CAAC,qBAAqB,CAAC,QAAQ,IAAI,IAAI,EAAE,GAAG,EAAE,CAAC;AAC9D,KAAK;AACL,IAAI,QAAQ,EAAE,SAAS;AACvB,CAAC;;ACJM,MAAM,MAAM,SAAS,YAAY,CAAC;AACzC,IAAI,WAAW,CAAC,SAAS,EAAE,IAAI,EAAE;AACjC,QAAQ,KAAK,EAAE,CAAC;AAChB,KAAK;AACL,IAAI,QAAQ,CAAC,KAAK,EAAE,KAAK,GAAG,CAAC,EAAE;AAC/B,QAAQ,OAAO,IAAI,CAAC;AACpB,KAAK;AACL;;ACRO,MAAM,gBAAgB,GAAG;AAChC,IAAI,WAAW,CAAC,OAAO,EAAE,OAAO,EAAE,GA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IACtC,6DAAM,MAAM,EAAC,QAAQ,EAAC,QAAQ,EAAE,MAAM,IAAI,CAAC,QAAQ,EAAE,IACnD,8DACE,GAAG,EAAE,EAAE,KAAK,IAAI,CAAC,QAAQ,GAAG,EAAE,CAAC,EAC/B,YAAY,EAAC,QAAQ,EACrB,WAAW,EAAC,qBAAqB,EACjC,KAAK,EAAE,IAAI,CAAC,GAAG,EACf,QAAQ,EAAE,CAAC,IAAI,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,EAC/B,OAAO,EAAE,CAAC,IAAI,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,GAC9B,EACD,IAAI,CAAC,WAAW,CAAC,MAAM,GAAG,CAAC,IAC1B,WAAK,KAAK,EAAC,aAAa,IACtB,cACG,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,KAAK,MAC9B,UAAI,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC,aAAa,GAAG,UAAU,GAAG,EAAE,IACvD,qBAAe,GAAG,EAAE,EAAE,CAAC,GAAG,GAAkB,CACzC,CACN,CAAC,CACC,CACD,IACJ,IAAI,CACH,CACA,CACF,CACL,EACN;KACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["session"],"sources":["../node_modules/rxjs/dist/esm/internal/scheduler/dateTimestampProvider.js","../node_modules/rxjs/dist/esm/internal/scheduler/Action.js","../node_modules/rxjs/dist/esm/internal/scheduler/intervalProvider.js","../node_modules/rxjs/dist/esm/internal/scheduler/AsyncAction.js","../node_modules/rxjs/dist/esm/internal/Scheduler.js","../node_modules/rxjs/dist/esm/internal/scheduler/AsyncScheduler.js","../node_modules/rxjs/dist/esm/internal/scheduler/async.js","../node_modules/rxjs/dist/esm/internal/operators/debounceTime.js","src/components/pos-navigation/pos-navigation.css?tag=pos-navigation&encapsulation=shadow","src/components/pos-navigation/pos-navigation.tsx"],"sourcesContent":["export const dateTimestampProvider = {\n now() {\n return (dateTimestampProvider.delegate || Date).now();\n },\n delegate: undefined,\n};\n//# sourceMappingURL=dateTimestampProvider.js.map","import { Subscription } from '../Subscription';\nexport class Action extends Subscription {\n constructor(scheduler, work) {\n super();\n }\n schedule(state, delay = 0) {\n return this;\n }\n}\n//# sourceMappingURL=Action.js.map","export const intervalProvider = {\n setInterval(handler, timeout, ...args) {\n const { delegate } = intervalProvider;\n if (delegate === null || delegate === void 0 ? void 0 : delegate.setInterval) {\n return delegate.setInterval(handler, timeout, ...args);\n }\n return setInterval(handler, timeout, ...args);\n },\n clearInterval(handle) {\n const { delegate } = intervalProvider;\n return ((delegate === null || delegate === void 0 ? void 0 : delegate.clearInterval) || clearInterval)(handle);\n },\n delegate: undefined,\n};\n//# sourceMappingURL=intervalProvider.js.map","import { Action } from './Action';\nimport { intervalProvider } from './intervalProvider';\nimport { arrRemove } from '../util/arrRemove';\nexport class AsyncAction extends Action {\n constructor(scheduler, work) {\n super(scheduler, work);\n this.scheduler = scheduler;\n this.work = work;\n this.pending = false;\n }\n schedule(state, delay = 0) {\n var _a;\n if (this.closed) {\n return this;\n }\n this.state = state;\n const id = this.id;\n const scheduler = this.scheduler;\n if (id != null) {\n this.id = this.recycleAsyncId(scheduler, id, delay);\n }\n this.pending = true;\n this.delay = delay;\n this.id = (_a = this.id) !== null && _a !== void 0 ? _a : this.requestAsyncId(scheduler, this.id, delay);\n return this;\n }\n requestAsyncId(scheduler, _id, delay = 0) {\n return intervalProvider.setInterval(scheduler.flush.bind(scheduler, this), delay);\n }\n recycleAsyncId(_scheduler, id, delay = 0) {\n if (delay != null && this.delay === delay && this.pending === false) {\n return id;\n }\n if (id != null) {\n intervalProvider.clearInterval(id);\n }\n return undefined;\n }\n execute(state, delay) {\n if (this.closed) {\n return new Error('executing a cancelled action');\n }\n this.pending = false;\n const error = this._execute(state, delay);\n if (error) {\n return error;\n }\n else if (this.pending === false && this.id != null) {\n this.id = this.recycleAsyncId(this.scheduler, this.id, null);\n }\n }\n _execute(state, _delay) {\n let errored = false;\n let errorValue;\n try {\n this.work(state);\n }\n catch (e) {\n errored = true;\n errorValue = e ? e : new Error('Scheduled action threw falsy error');\n }\n if (errored) {\n this.unsubscribe();\n return errorValue;\n }\n }\n unsubscribe() {\n if (!this.closed) {\n const { id, scheduler } = this;\n const { actions } = scheduler;\n this.work = this.state = this.scheduler = null;\n this.pending = false;\n arrRemove(actions, this);\n if (id != null) {\n this.id = this.recycleAsyncId(scheduler, id, null);\n }\n this.delay = null;\n super.unsubscribe();\n }\n }\n}\n//# sourceMappingURL=AsyncAction.js.map","import { dateTimestampProvider } from './scheduler/dateTimestampProvider';\nexport class Scheduler {\n constructor(schedulerActionCtor, now = Scheduler.now) {\n this.schedulerActionCtor = schedulerActionCtor;\n this.now = now;\n }\n schedule(work, delay = 0, state) {\n return new this.schedulerActionCtor(this, work).schedule(state, delay);\n }\n}\nScheduler.now = dateTimestampProvider.now;\n//# sourceMappingURL=Scheduler.js.map","import { Scheduler } from '../Scheduler';\nexport class AsyncScheduler extends Scheduler {\n constructor(SchedulerAction, now = Scheduler.now) {\n super(SchedulerAction, now);\n this.actions = [];\n this._active = false;\n }\n flush(action) {\n const { actions } = this;\n if (this._active) {\n actions.push(action);\n return;\n }\n let error;\n this._active = true;\n do {\n if ((error = action.execute(action.state, action.delay))) {\n break;\n }\n } while ((action = actions.shift()));\n this._active = false;\n if (error) {\n while ((action = actions.shift())) {\n action.unsubscribe();\n }\n throw error;\n }\n }\n}\n//# sourceMappingURL=AsyncScheduler.js.map","import { AsyncAction } from './AsyncAction';\nimport { AsyncScheduler } from './AsyncScheduler';\nexport const asyncScheduler = new AsyncScheduler(AsyncAction);\nexport const async = asyncScheduler;\n//# sourceMappingURL=async.js.map","import { asyncScheduler } from '../scheduler/async';\nimport { operate } from '../util/lift';\nimport { createOperatorSubscriber } from './OperatorSubscriber';\nexport function debounceTime(dueTime, scheduler = asyncScheduler) {\n return operate((source, subscriber) => {\n let activeTask = null;\n let lastValue = null;\n let lastTime = null;\n const emit = () => {\n if (activeTask) {\n activeTask.unsubscribe();\n activeTask = null;\n const value = lastValue;\n lastValue = null;\n subscriber.next(value);\n }\n };\n function emitWhenIdle() {\n const targetTime = lastTime + dueTime;\n const now = scheduler.now();\n if (now < targetTime) {\n activeTask = this.schedule(undefined, targetTime - now);\n subscriber.add(activeTask);\n return;\n }\n emit();\n }\n source.subscribe(createOperatorSubscriber(subscriber, (value) => {\n lastValue = value;\n lastTime = scheduler.now();\n if (!activeTask) {\n activeTask = scheduler.schedule(emitWhenIdle, dueTime);\n subscriber.add(activeTask);\n }\n }, () => {\n emit();\n subscriber.complete();\n }, undefined, () => {\n lastValue = activeTask = null;\n }));\n });\n}\n//# sourceMappingURL=debounceTime.js.map",":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 &.selected {\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","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"],"version":3}
|
|
@@ -4,7 +4,7 @@ import { d as defineCustomElement$3 } from './pos-description2.js';
|
|
|
4
4
|
import { d as defineCustomElement$2 } from './pos-label2.js';
|
|
5
5
|
import { d as defineCustomElement$1 } from './pos-resource2.js';
|
|
6
6
|
|
|
7
|
-
const posRichLinkCss = ":host {\n --background-color: inherit;\n --label-color: var(--pos-normal-text-color);\n --description-color: var(--pos-normal-text-color);\n --uri-color: var(--pos-subtle-text-color);\n --font-family: var(--font-sans);\n}\n\np.content {\n background-color: var(--background-color);\n line-height: var(--line-xs);\n margin: 0;\n display: flex;\n flex-direction: column;\n align-items: baseline;\n gap: var(--size-1);\n\n .url {\n font-size: var(--scale-fluid-1);\n color: var(--pos-subtle-text-color);\n }\n}\n\na {\n color: var(--label-color);\n max-width: var(--prose-lg);\n text-decoration: underline;\n overflow: hidden;\n white-space: nowrap;\n text-overflow: ellipsis;\n text-decoration-thickness: var(--size-px);\n}\n\npos-label {\n color: var(--label-color);\n font-size: var(--scale-fluid-2);\n margin-bottom: var(--size-1);\n}\n\npos-description {\n display: -webkit-box;\n -webkit-box-orient: vertical;\n -webkit-line-clamp: 2;\n text-overflow: ellipsis;\n overflow: hidden;\n font-weight: var(--weight-light);\n color: var(--description-color);\n font-size: var(--scale-fluid-2);\n}\n\n@media (min-width: 640px) {\n pos-label {\n font-size: var(--scale-fluid-0);\n }\n pos-description {\n font-size: var(--scale-fluid-1);\n }\n\n p.content {\n .url {\n font-size: var(--scale-fluid-000);\n }\n }\n}\n";
|
|
7
|
+
const posRichLinkCss = ":host {\n --background-color: inherit;\n --label-color: var(--pos-normal-text-color);\n --description-color: var(--pos-normal-text-color);\n --uri-color: var(--pos-subtle-text-color);\n --font-family: var(--font-sans);\n}\n\np.content {\n background-color: var(--background-color);\n line-height: var(--line-xs);\n margin: 0;\n display: flex;\n flex-direction: column;\n align-items: baseline;\n gap: var(--size-1);\n\n .url {\n font-size: var(--scale-fluid-1);\n color: var(--pos-subtle-text-color);\n }\n}\n\na {\n color: var(--label-color);\n max-width: min(100%, var(--prose-lg));\n text-decoration: underline;\n overflow: hidden;\n white-space: nowrap;\n text-overflow: ellipsis;\n text-decoration-thickness: var(--size-px);\n}\n\npos-label {\n color: var(--label-color);\n font-size: var(--scale-fluid-2);\n margin-bottom: var(--size-1);\n}\n\npos-description {\n display: -webkit-box;\n -webkit-box-orient: vertical;\n -webkit-line-clamp: 2;\n text-overflow: ellipsis;\n overflow: hidden;\n font-weight: var(--weight-light);\n color: var(--description-color);\n font-size: var(--scale-fluid-2);\n}\n\n@media (min-width: 640px) {\n pos-label {\n font-size: var(--scale-fluid-0);\n }\n pos-description {\n font-size: var(--scale-fluid-1);\n }\n\n p.content {\n .url {\n font-size: var(--scale-fluid-000);\n }\n }\n}\n";
|
|
8
8
|
const PosRichLinkStyle0 = posRichLinkCss;
|
|
9
9
|
|
|
10
10
|
const PosRichLink = /*@__PURE__*/ proxyCustomElement(class PosRichLink extends HTMLElement {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"pos-rich-link2.js","mappings":";;;;;;AAAA,MAAM,cAAc,GAAG,
|
|
1
|
+
{"file":"pos-rich-link2.js","mappings":";;;;;;AAAA,MAAM,cAAc,GAAG,y2CAAy2C,CAAC;AACj4C,0BAAe,cAAc;;MCMhB,WAAW;;;;;;;IAKtB,MAAM;QACJ,QACE,qEAAc,IAAI,EAAE,IAAI,EAAE,GAAG,EAAE,IAAI,CAAC,GAAG,IACrC,0DAAG,KAAK,EAAC,SAAS,IAChB,0DACE,IAAI,EAAE,IAAI,CAAC,GAAG,EACd,OAAO,EAAE,CAAC;gBACR,CAAC,CAAC,cAAc,EAAE,CAAC;gBACnB,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;aACjC,IAED,mEAAa,CACX,EACJ,6DAAM,KAAK,EAAC,KAAK,IAAE,IAAI,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,CAAQ,EACjD,yEAAmB,CACjB,CACS,EACf;KACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["src/components/pos-rich-link/pos-rich-link.css?tag=pos-rich-link&encapsulation=shadow","src/components/pos-rich-link/pos-rich-link.tsx"],"sourcesContent":[":host {\n --background-color: inherit;\n --label-color: var(--pos-normal-text-color);\n --description-color: var(--pos-normal-text-color);\n --uri-color: var(--pos-subtle-text-color);\n --font-family: var(--font-sans);\n}\n\np.content {\n background-color: var(--background-color);\n line-height: var(--line-xs);\n margin: 0;\n display: flex;\n flex-direction: column;\n align-items: baseline;\n gap: var(--size-1);\n\n .url {\n font-size: var(--scale-fluid-1);\n color: var(--pos-subtle-text-color);\n }\n}\n\na {\n color: var(--label-color);\n max-width: min(100%, var(--prose-lg));\n text-decoration: underline;\n overflow: hidden;\n white-space: nowrap;\n text-overflow: ellipsis;\n text-decoration-thickness: var(--size-px);\n}\n\npos-label {\n color: var(--label-color);\n font-size: var(--scale-fluid-2);\n margin-bottom: var(--size-1);\n}\n\npos-description {\n display: -webkit-box;\n -webkit-box-orient: vertical;\n -webkit-line-clamp: 2;\n text-overflow: ellipsis;\n overflow: hidden;\n font-weight: var(--weight-light);\n color: var(--description-color);\n font-size: var(--scale-fluid-2);\n}\n\n@media (min-width: 640px) {\n pos-label {\n font-size: var(--scale-fluid-0);\n }\n pos-description {\n font-size: var(--scale-fluid-1);\n }\n\n p.content {\n .url {\n font-size: var(--scale-fluid-000);\n }\n }\n}\n","import { Component, Event, EventEmitter, h, Prop } from '@stencil/core';\n\n@Component({\n tag: 'pos-rich-link',\n shadow: true,\n styleUrl: 'pos-rich-link.css',\n})\nexport class PosRichLink {\n @Prop() uri: string;\n\n @Event({ eventName: 'pod-os:link' }) linkEmitter: EventEmitter;\n\n render() {\n return (\n <pos-resource lazy={true} uri={this.uri}>\n <p class=\"content\">\n <a\n href={this.uri}\n onClick={e => {\n e.preventDefault();\n this.linkEmitter.emit(this.uri);\n }}\n >\n <pos-label />\n </a>\n <span class=\"url\">{new URL(this.uri).host}</span>\n <pos-description />\n </p>\n </pos-resource>\n );\n }\n}\n"],"version":3}
|