@pod-os/elements 0.22.2-0b8a8a5.0 → 0.22.2-0de2b9c.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/{session-6106c9ff.js → BrokenFile-769cb073.js} +23 -1
- package/dist/cjs/BrokenFile-769cb073.js.map +1 -0
- package/dist/cjs/elements.cjs.js +1 -1
- package/dist/cjs/{ion-card_30.cjs.entry.js → ion-card_31.cjs.entry.js} +112 -21
- package/dist/cjs/ion-card_31.cjs.entry.js.map +1 -0
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/pos-document.cjs.entry.js +2 -3
- package/dist/cjs/pos-document.cjs.entry.js.map +1 -1
- package/dist/collection/components/pos-make-findable/pos-make-findable.css +16 -1
- package/dist/collection/components/pos-make-findable/pos-make-findable.js +54 -6
- package/dist/collection/components/pos-make-findable/pos-make-findable.js.map +1 -1
- package/dist/collection/components/pos-navigation-bar/pos-navigation-bar.css +15 -4
- package/dist/collection/components/pos-navigation-bar/pos-navigation-bar.js +1 -10
- package/dist/collection/components/pos-navigation-bar/pos-navigation-bar.js.map +1 -1
- package/dist/collection/components/pos-new-thing-form/pos-new-thing-form.js +1 -1
- package/dist/collection/components/pos-rich-link/pos-rich-link.js +2 -2
- package/dist/collection/components/pos-router/pos-router.js +1 -1
- package/dist/collection/components/pos-select-term/pos-select-term.js +1 -1
- package/dist/components/index10.js +1 -1
- package/dist/components/pos-app-browser.js +48 -42
- package/dist/components/pos-app-browser.js.map +1 -1
- package/dist/components/pos-container-contents2.js +1 -1
- package/dist/components/pos-make-findable.js +1 -136
- package/dist/components/pos-make-findable.js.map +1 -1
- package/dist/components/pos-make-findable2.js +168 -0
- package/dist/components/pos-make-findable2.js.map +1 -0
- package/dist/components/pos-navigation-bar2.js +27 -24
- package/dist/components/pos-navigation-bar2.js.map +1 -1
- package/dist/components/pos-new-thing-form2.js +1 -1
- package/dist/components/pos-rich-link2.js +2 -2
- package/dist/components/pos-router2.js +1 -1
- package/dist/components/pos-select-term2.js +1 -1
- package/dist/elements/elements.esm.js +1 -1
- package/dist/elements/elements.esm.js.map +1 -1
- package/dist/elements/p-4ccc1b59.js +2 -0
- package/dist/elements/p-4ccc1b59.js.map +1 -0
- package/dist/elements/p-4e2d793c.entry.js +2 -0
- package/dist/elements/{p-a23915ba.entry.js.map → p-4e2d793c.entry.js.map} +1 -1
- package/dist/elements/p-684de5a7.entry.js +2 -0
- package/dist/elements/{p-ddba19aa.entry.js.map → p-684de5a7.entry.js.map} +1 -1
- package/dist/esm/{session-a852782a.js → BrokenFile-5180c05c.js} +24 -3
- package/dist/esm/BrokenFile-5180c05c.js.map +1 -0
- package/dist/esm/elements.js +1 -1
- package/dist/esm/{ion-card_30.entry.js → ion-card_31.entry.js} +105 -15
- package/dist/esm/ion-card_31.entry.js.map +1 -0
- package/dist/esm/loader.js +1 -1
- package/dist/esm/pos-document.entry.js +1 -2
- package/dist/esm/pos-document.entry.js.map +1 -1
- package/dist/types/components/pos-make-findable/pos-make-findable.d.ts +4 -0
- package/dist/types/components/pos-navigation-bar/pos-navigation-bar.d.ts +0 -1
- package/dist/types/components.d.ts +2 -0
- package/package.json +1 -1
- package/dist/cjs/BrokenFile-51b1f89b.js +0 -28
- package/dist/cjs/BrokenFile-51b1f89b.js.map +0 -1
- package/dist/cjs/ion-card_30.cjs.entry.js.map +0 -1
- package/dist/cjs/pos-make-findable.cjs.entry.js +0 -79
- package/dist/cjs/pos-make-findable.cjs.entry.js.map +0 -1
- package/dist/cjs/session-6106c9ff.js.map +0 -1
- package/dist/elements/p-49b70074.js +0 -2
- package/dist/elements/p-49b70074.js.map +0 -1
- package/dist/elements/p-65ea5489.entry.js +0 -2
- package/dist/elements/p-65ea5489.entry.js.map +0 -1
- package/dist/elements/p-6c7ca160.js +0 -2
- package/dist/elements/p-6c7ca160.js.map +0 -1
- package/dist/elements/p-a23915ba.entry.js +0 -2
- package/dist/elements/p-ddba19aa.entry.js +0 -2
- package/dist/esm/BrokenFile-47b11850.js +0 -26
- package/dist/esm/BrokenFile-47b11850.js.map +0 -1
- package/dist/esm/ion-card_30.entry.js.map +0 -1
- package/dist/esm/pos-make-findable.entry.js +0 -75
- package/dist/esm/pos-make-findable.entry.js.map +0 -1
- package/dist/esm/session-a852782a.js.map +0 -1
|
@@ -19,7 +19,7 @@ export class PosSelectTerm {
|
|
|
19
19
|
this.termSelected.emit({ uri: event.target.value });
|
|
20
20
|
}
|
|
21
21
|
render() {
|
|
22
|
-
return (h(Host, { key: '
|
|
22
|
+
return (h(Host, { key: 'ded0e73b0c40db8f2c6f54e55f014c82b8134ab3' }, h("input", { key: '032c78e077685319599fe76f60b6457602310c95', part: "input", list: "terms", placeholder: this.placeholder, value: this.value, onChange: ev => this.handleChange(ev) }), h("datalist", { key: '12fb5283fd009920a385f085e455ef2999f138a0', part: "terms", id: "terms" }, this.terms.map(term => (h("option", { value: term.uri }, term.shorthand))))));
|
|
23
23
|
}
|
|
24
24
|
static get is() { return "pos-select-term"; }
|
|
25
25
|
static get encapsulation() { return "shadow"; }
|
|
@@ -60138,6 +60138,6 @@ lunr/lunr.js:
|
|
|
60138
60138
|
*)
|
|
60139
60139
|
*/
|
|
60140
60140
|
|
|
60141
|
-
export {
|
|
60141
|
+
export { LabelIndex as L, Namespace as N, PodOS as P, RdfDocument as R, __toESM as _, LdpContainer as a, lit2 as b, __commonJS as c, isNamedNode as i, labelFromUri as l, namedNode3 as n, require_short_unique_id as r, st2 as s };
|
|
60142
60142
|
|
|
60143
60143
|
//# sourceMappingURL=index10.js.map
|
|
@@ -1,25 +1,26 @@
|
|
|
1
1
|
import { proxyCustomElement, HTMLElement, h, Host } from '@stencil/core/internal/client';
|
|
2
|
-
import { d as defineCustomElement$
|
|
3
|
-
import { d as defineCustomElement$
|
|
4
|
-
import { d as defineCustomElement$
|
|
5
|
-
import { d as defineCustomElement$
|
|
6
|
-
import { d as defineCustomElement$
|
|
7
|
-
import { d as defineCustomElement$
|
|
8
|
-
import { d as defineCustomElement$
|
|
9
|
-
import { d as defineCustomElement$
|
|
10
|
-
import { d as defineCustomElement$
|
|
11
|
-
import { d as defineCustomElement$
|
|
12
|
-
import { d as defineCustomElement$
|
|
13
|
-
import { d as defineCustomElement$
|
|
14
|
-
import { d as defineCustomElement$
|
|
15
|
-
import { d as defineCustomElement$
|
|
16
|
-
import { d as defineCustomElement$
|
|
17
|
-
import { d as defineCustomElement$
|
|
18
|
-
import { d as defineCustomElement$
|
|
19
|
-
import { d as defineCustomElement$
|
|
20
|
-
import { d as defineCustomElement$
|
|
21
|
-
import { d as defineCustomElement$
|
|
22
|
-
import { d as defineCustomElement$
|
|
2
|
+
import { d as defineCustomElement$v } from './card.js';
|
|
3
|
+
import { d as defineCustomElement$u } from './card-content.js';
|
|
4
|
+
import { d as defineCustomElement$t } from './card-header.js';
|
|
5
|
+
import { d as defineCustomElement$s } from './icon.js';
|
|
6
|
+
import { d as defineCustomElement$r } from './progress-bar.js';
|
|
7
|
+
import { d as defineCustomElement$q } from './ripple-effect.js';
|
|
8
|
+
import { d as defineCustomElement$p } from './searchbar.js';
|
|
9
|
+
import { d as defineCustomElement$o } from './skeleton-text.js';
|
|
10
|
+
import { d as defineCustomElement$n } from './pos-add-new-thing2.js';
|
|
11
|
+
import { d as defineCustomElement$m } from './pos-app2.js';
|
|
12
|
+
import { d as defineCustomElement$l } from './pos-app-dashboard2.js';
|
|
13
|
+
import { d as defineCustomElement$k } from './pos-description2.js';
|
|
14
|
+
import { d as defineCustomElement$j } from './pos-dialog2.js';
|
|
15
|
+
import { d as defineCustomElement$i } from './pos-error-toast2.js';
|
|
16
|
+
import { d as defineCustomElement$h } from './pos-example-resources2.js';
|
|
17
|
+
import { d as defineCustomElement$g } from './pos-getting-started2.js';
|
|
18
|
+
import { d as defineCustomElement$f } from './pos-image2.js';
|
|
19
|
+
import { d as defineCustomElement$e } from './pos-internal-router2.js';
|
|
20
|
+
import { d as defineCustomElement$d } from './pos-label2.js';
|
|
21
|
+
import { d as defineCustomElement$c } from './pos-login2.js';
|
|
22
|
+
import { d as defineCustomElement$b } from './pos-login-form2.js';
|
|
23
|
+
import { d as defineCustomElement$a } from './pos-make-findable2.js';
|
|
23
24
|
import { d as defineCustomElement$9 } from './pos-navigation-bar2.js';
|
|
24
25
|
import { d as defineCustomElement$8 } from './pos-new-thing-form2.js';
|
|
25
26
|
import { d as defineCustomElement$7 } from './pos-picture2.js';
|
|
@@ -74,7 +75,7 @@ function defineCustomElement$1() {
|
|
|
74
75
|
if (typeof customElements === "undefined") {
|
|
75
76
|
return;
|
|
76
77
|
}
|
|
77
|
-
const components = ["pos-app-browser", "ion-card", "ion-card-content", "ion-card-header", "ion-icon", "ion-progress-bar", "ion-ripple-effect", "ion-searchbar", "ion-skeleton-text", "pos-add-new-thing", "pos-app", "pos-app-dashboard", "pos-description", "pos-dialog", "pos-error-toast", "pos-example-resources", "pos-getting-started", "pos-image", "pos-internal-router", "pos-label", "pos-login", "pos-login-form", "pos-navigation-bar", "pos-new-thing-form", "pos-picture", "pos-resource", "pos-rich-link", "pos-router", "pos-select-term", "pos-type-router"];
|
|
78
|
+
const components = ["pos-app-browser", "ion-card", "ion-card-content", "ion-card-header", "ion-icon", "ion-progress-bar", "ion-ripple-effect", "ion-searchbar", "ion-skeleton-text", "pos-add-new-thing", "pos-app", "pos-app-dashboard", "pos-description", "pos-dialog", "pos-error-toast", "pos-example-resources", "pos-getting-started", "pos-image", "pos-internal-router", "pos-label", "pos-login", "pos-login-form", "pos-make-findable", "pos-navigation-bar", "pos-new-thing-form", "pos-picture", "pos-resource", "pos-rich-link", "pos-router", "pos-select-term", "pos-type-router"];
|
|
78
79
|
components.forEach(tagName => { switch (tagName) {
|
|
79
80
|
case "pos-app-browser":
|
|
80
81
|
if (!customElements.get(tagName)) {
|
|
@@ -83,105 +84,110 @@ function defineCustomElement$1() {
|
|
|
83
84
|
break;
|
|
84
85
|
case "ion-card":
|
|
85
86
|
if (!customElements.get(tagName)) {
|
|
86
|
-
defineCustomElement$
|
|
87
|
+
defineCustomElement$v();
|
|
87
88
|
}
|
|
88
89
|
break;
|
|
89
90
|
case "ion-card-content":
|
|
90
91
|
if (!customElements.get(tagName)) {
|
|
91
|
-
defineCustomElement$
|
|
92
|
+
defineCustomElement$u();
|
|
92
93
|
}
|
|
93
94
|
break;
|
|
94
95
|
case "ion-card-header":
|
|
95
96
|
if (!customElements.get(tagName)) {
|
|
96
|
-
defineCustomElement$
|
|
97
|
+
defineCustomElement$t();
|
|
97
98
|
}
|
|
98
99
|
break;
|
|
99
100
|
case "ion-icon":
|
|
100
101
|
if (!customElements.get(tagName)) {
|
|
101
|
-
defineCustomElement$
|
|
102
|
+
defineCustomElement$s();
|
|
102
103
|
}
|
|
103
104
|
break;
|
|
104
105
|
case "ion-progress-bar":
|
|
105
106
|
if (!customElements.get(tagName)) {
|
|
106
|
-
defineCustomElement$
|
|
107
|
+
defineCustomElement$r();
|
|
107
108
|
}
|
|
108
109
|
break;
|
|
109
110
|
case "ion-ripple-effect":
|
|
110
111
|
if (!customElements.get(tagName)) {
|
|
111
|
-
defineCustomElement$
|
|
112
|
+
defineCustomElement$q();
|
|
112
113
|
}
|
|
113
114
|
break;
|
|
114
115
|
case "ion-searchbar":
|
|
115
116
|
if (!customElements.get(tagName)) {
|
|
116
|
-
defineCustomElement$
|
|
117
|
+
defineCustomElement$p();
|
|
117
118
|
}
|
|
118
119
|
break;
|
|
119
120
|
case "ion-skeleton-text":
|
|
120
121
|
if (!customElements.get(tagName)) {
|
|
121
|
-
defineCustomElement$
|
|
122
|
+
defineCustomElement$o();
|
|
122
123
|
}
|
|
123
124
|
break;
|
|
124
125
|
case "pos-add-new-thing":
|
|
125
126
|
if (!customElements.get(tagName)) {
|
|
126
|
-
defineCustomElement$
|
|
127
|
+
defineCustomElement$n();
|
|
127
128
|
}
|
|
128
129
|
break;
|
|
129
130
|
case "pos-app":
|
|
130
131
|
if (!customElements.get(tagName)) {
|
|
131
|
-
defineCustomElement$
|
|
132
|
+
defineCustomElement$m();
|
|
132
133
|
}
|
|
133
134
|
break;
|
|
134
135
|
case "pos-app-dashboard":
|
|
135
136
|
if (!customElements.get(tagName)) {
|
|
136
|
-
defineCustomElement$
|
|
137
|
+
defineCustomElement$l();
|
|
137
138
|
}
|
|
138
139
|
break;
|
|
139
140
|
case "pos-description":
|
|
140
141
|
if (!customElements.get(tagName)) {
|
|
141
|
-
defineCustomElement$
|
|
142
|
+
defineCustomElement$k();
|
|
142
143
|
}
|
|
143
144
|
break;
|
|
144
145
|
case "pos-dialog":
|
|
145
146
|
if (!customElements.get(tagName)) {
|
|
146
|
-
defineCustomElement$
|
|
147
|
+
defineCustomElement$j();
|
|
147
148
|
}
|
|
148
149
|
break;
|
|
149
150
|
case "pos-error-toast":
|
|
150
151
|
if (!customElements.get(tagName)) {
|
|
151
|
-
defineCustomElement$
|
|
152
|
+
defineCustomElement$i();
|
|
152
153
|
}
|
|
153
154
|
break;
|
|
154
155
|
case "pos-example-resources":
|
|
155
156
|
if (!customElements.get(tagName)) {
|
|
156
|
-
defineCustomElement$
|
|
157
|
+
defineCustomElement$h();
|
|
157
158
|
}
|
|
158
159
|
break;
|
|
159
160
|
case "pos-getting-started":
|
|
160
161
|
if (!customElements.get(tagName)) {
|
|
161
|
-
defineCustomElement$
|
|
162
|
+
defineCustomElement$g();
|
|
162
163
|
}
|
|
163
164
|
break;
|
|
164
165
|
case "pos-image":
|
|
165
166
|
if (!customElements.get(tagName)) {
|
|
166
|
-
defineCustomElement$
|
|
167
|
+
defineCustomElement$f();
|
|
167
168
|
}
|
|
168
169
|
break;
|
|
169
170
|
case "pos-internal-router":
|
|
170
171
|
if (!customElements.get(tagName)) {
|
|
171
|
-
defineCustomElement$
|
|
172
|
+
defineCustomElement$e();
|
|
172
173
|
}
|
|
173
174
|
break;
|
|
174
175
|
case "pos-label":
|
|
175
176
|
if (!customElements.get(tagName)) {
|
|
176
|
-
defineCustomElement$
|
|
177
|
+
defineCustomElement$d();
|
|
177
178
|
}
|
|
178
179
|
break;
|
|
179
180
|
case "pos-login":
|
|
180
181
|
if (!customElements.get(tagName)) {
|
|
181
|
-
defineCustomElement$
|
|
182
|
+
defineCustomElement$c();
|
|
182
183
|
}
|
|
183
184
|
break;
|
|
184
185
|
case "pos-login-form":
|
|
186
|
+
if (!customElements.get(tagName)) {
|
|
187
|
+
defineCustomElement$b();
|
|
188
|
+
}
|
|
189
|
+
break;
|
|
190
|
+
case "pos-make-findable":
|
|
185
191
|
if (!customElements.get(tagName)) {
|
|
186
192
|
defineCustomElement$a();
|
|
187
193
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"pos-app-browser.js","mappings":"
|
|
1
|
+
{"file":"pos-app-browser.js","mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,MAAM,gBAAgB,GAAG,mpBAAmpB,CAAC;AAC7qB,4BAAe,gBAAgB;;MCKlBA,eAAa;IAJ1B;;;QAKU,2BAAsB,GAAY,KAAK,CAAC;;;;;;;QAQxC,SAAI,GAAyB,YAAY,CAAC;QAEzC,QAAG,GAAG,EAAE,CAAC;KAgCnB;IA9BC,MAAM;QACJ,QACE,EAAC,IAAI,uDACH,gEAAS,sBAAsB,EAAE,IAAI,CAAC,sBAAsB,IAC1D,0EACE,mEAAY,IAAI,EAAE,IAAI,CAAC,IAAI,4BAA0B,CAAC,KAAK,IAAI,CAAC,GAAG,GAAG,CAAC,CAAC,MAAM,CAAC,IAC7E,iEACE,0EAAmB,YAAY,EAAE,IAAI,CAAC,GAAG,GAAsB,EAC/D,2EAAoB,GAAG,EAAE,IAAI,CAAC,GAAG,KAAK,kBAAkB,GAAG,EAAE,GAAG,IAAI,CAAC,GAAG,GAAuB,EAC/F,mEAAuB,CAChB,EACT,+DACG,IAAI,CAAC,GAAG,CAAC,UAAU,CAAC,SAAS,CAAC,IAC7B,2BAAqB,GAAG,EAAE,IAAI,CAAC,GAAG,GAAI,KAEtC,oBAAc,GAAG,EAAE,IAAI,CAAC,GAAG,EAAE,GAAG,EAAE,IAAI,CAAC,GAAG,IACxC,0BAAmB,CACN,CAChB,CACI,EACP,iEACE,EAAC,IAAI,sDAAG,EACR,+EAA0B,CACnB,CACE,CACG,CACV,CACL,EACP;KACH;;;;;;;AAGH,MAAM,IAAI,GAAG;IACX,QACE,WAAK,OAAO,EAAC,aAAa,EAAC,KAAK,EAAC,4BAA4B,IAC3D,YACE,CAAC,EAAC,6CAA6C,EAC/C,KAAK,EAAE;YACL,MAAM,EAAE,SAAS;YACjB,QAAQ,EAAE,SAAS;YACnB,cAAc,EAAE,IAAI;SACrB,qBACe,OAAO,GACvB,EAEF,YACE,CAAC,EAAC,0EAA0E,EAC5E,KAAK,EAAE;YACL,MAAM,EAAE,OAAO;YACf,QAAQ,EAAE,OAAO;YACjB,cAAc,EAAE,IAAI;SACrB,qBACe,OAAO,GACvB,EAEF,YACE,CAAC,EAAC,gDAAgD,EAClD,KAAK,EAAE;YACL,MAAM,EAAE,SAAS;YACjB,QAAQ,EAAE,SAAS;YACnB,cAAc,EAAE,IAAI;SACrB,qBACe,OAAO,GACvB,CACE,EACN;AACJ,CAAC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["PosAppBrowser"],"sources":["src/apps/pos-app-browser/pos-app-browser.css?tag=pos-app-browser","src/apps/pos-app-browser/pos-app-browser.tsx"],"sourcesContent":["pos-router {\n margin: 0;\n padding: 0;\n display: flex;\n flex-direction: column;\n height: 100%;\n}\n\npos-navigation-bar {\n max-width: var(--width-lg);\n margin: 0;\n}\n\npos-add-new-thing,\npos-login {\n flex: 0 1 auto; /* Behält die Breite des Inhalts bei */\n}\n\nheader,\nfooter {\n display: flex;\n gap: var(--size-1);\n height: auto;\n justify-content: center;\n align-items: center;\n padding: var(--size-1);\n}\n\nfooter svg {\n width: var(--size-5);\n height: var(--size-5);\n}\n\nfooter {\n font-size: var(--scale-fluid-000);\n}\n\nheader {\n flex-wrap: wrap;\n padding: 0 var(--size-8);\n}\n\nmain {\n flex: 1;\n max-height: 100vh;\n overflow: auto;\n}\n\n@media (max-width: 640px) {\n header {\n padding: 0 var(--size-1) var(--size-1);\n justify-content: space-between;\n }\n\n pos-navigation-bar {\n flex-basis: 100%;\n order: 0;\n }\n\n pos-add-new-thing,\n pos-login {\n order: 1;\n }\n}\n","import { Component, h, Host, Prop, State } from '@stencil/core';\n\n@Component({\n tag: 'pos-app-browser',\n styleUrl: 'pos-app-browser.css',\n})\nexport class PosAppBrowser {\n @Prop() restorePreviousSession: boolean = false;\n\n /**\n * The mode the app is running in:\n *\n * - standalone: use this when you deploy it as a standalone web application\n * - pod: use this when you host this app as a default interface for you pod\n */\n @Prop() mode: 'standalone' | 'pod' = 'standalone';\n\n @State() uri = '';\n\n render() {\n return (\n <Host>\n <pos-app restorePreviousSession={this.restorePreviousSession}>\n <pos-error-toast>\n <pos-router mode={this.mode} onPod-os:route-changed={e => (this.uri = e.detail)}>\n <header>\n <pos-add-new-thing referenceUri={this.uri}></pos-add-new-thing>\n <pos-navigation-bar uri={this.uri === 'pod-os:dashboard' ? '' : this.uri}></pos-navigation-bar>\n <pos-login></pos-login>\n </header>\n <main>\n {this.uri.startsWith('pod-os:') ? (\n <pos-internal-router uri={this.uri} />\n ) : (\n <pos-resource key={this.uri} uri={this.uri}>\n <pos-type-router />\n </pos-resource>\n )}\n </main>\n <footer>\n <Logo />\n <span>PodOS Browser</span>\n </footer>\n </pos-router>\n </pos-error-toast>\n </pos-app>\n </Host>\n );\n }\n}\n\nconst Logo = () => {\n return (\n <svg viewBox=\"0 0 400 400\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n d=\"M50 350 L50 100 L200 50 L350 100 L350 350 Z\"\n style={{\n 'fill': '#008BF8',\n 'stroke': '#008BF8',\n 'stroke-width': '70',\n }}\n stroke-linejoin=\"round\"\n />\n\n <path\n d=\"M100 300 L100 150 L200 120 L300 150 L300 300 L130 300 L130 370 L100 370Z\"\n style={{\n 'fill': 'white',\n 'stroke': 'white',\n 'stroke-width': '45',\n }}\n stroke-linejoin=\"round\"\n />\n\n <path\n d=\"M150 250 L150 200 L200 180 L250 200 L250 250 Z\"\n style={{\n 'fill': '#DC0073',\n 'stroke': '#DC0073',\n 'stroke-width': '20',\n }}\n stroke-linejoin=\"round\"\n />\n </svg>\n );\n};\n"],"version":3}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { proxyCustomElement, HTMLElement, createEvent, h } from '@stencil/core/internal/client';
|
|
2
|
-
import {
|
|
2
|
+
import { a as LdpContainer } from './index10.js';
|
|
3
3
|
import { s as subscribeResource } from './ResourceAware.js';
|
|
4
4
|
import { d as defineCustomElement$a } from './card.js';
|
|
5
5
|
import { d as defineCustomElement$9 } from './card-content.js';
|
|
@@ -1,139 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { a as LabelIndex } from './index10.js';
|
|
3
|
-
import { s as subscribePodOs } from './PodOsAware.js';
|
|
4
|
-
import { s as store } from './session.js';
|
|
5
|
-
import { d as defineCustomElement$8 } from './card.js';
|
|
6
|
-
import { d as defineCustomElement$7 } from './card-content.js';
|
|
7
|
-
import { d as defineCustomElement$6 } from './card-header.js';
|
|
8
|
-
import { d as defineCustomElement$5 } from './progress-bar.js';
|
|
9
|
-
import { d as defineCustomElement$4 } from './ripple-effect.js';
|
|
10
|
-
import { d as defineCustomElement$3 } from './pos-label2.js';
|
|
11
|
-
import { d as defineCustomElement$2 } from './pos-resource2.js';
|
|
12
|
-
|
|
13
|
-
const posMakeFindableCss = "button.main {\n display: flex;\n transition: width 200ms;\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-xs);\n color: var(--color-grey-500);\n border: var(--size-px) dashed var(--color-grey-500);\n background: none;\n\n p {\n padding: 0;\n margin: 0;\n display: none;\n white-space: nowrap;\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 background-color: var(--color-grey-200);\n padding: 0;\n margin: 0;\n list-style: none;\n button {\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 filter: brightness(80%);\n }\n\n &:active {\n filter: brightness(90%);\n }\n }\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 width: var(--size-full);\n height: var(--size-8);\n background: var(--color-grey-200);\n color: var(--color-grey-700);\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";
|
|
14
|
-
const PosMakeFindableStyle0 = posMakeFindableCss;
|
|
15
|
-
|
|
16
|
-
const PosMakeFindable$1 = /*@__PURE__*/ proxyCustomElement(class PosMakeFindable extends HTMLElement {
|
|
17
|
-
constructor() {
|
|
18
|
-
super();
|
|
19
|
-
this.__registerHost();
|
|
20
|
-
this.subscribePodOs = createEvent(this, "pod-os:init", 7);
|
|
21
|
-
this.indexes = [];
|
|
22
|
-
this.showOptions = false;
|
|
23
|
-
this.receivePodOs = async (os) => {
|
|
24
|
-
this.os = os;
|
|
25
|
-
this.thing = this.os.store.get(this.uri);
|
|
26
|
-
this.getLabelIndexes(store.state.profile);
|
|
27
|
-
this.unsubscribeSessionChange = store.onChange('profile', profile => {
|
|
28
|
-
this.getLabelIndexes(profile);
|
|
29
|
-
});
|
|
30
|
-
};
|
|
31
|
-
}
|
|
32
|
-
componentWillLoad() {
|
|
33
|
-
subscribePodOs(this);
|
|
34
|
-
}
|
|
35
|
-
disconnectedCallback() {
|
|
36
|
-
this.unsubscribeSessionChange && this.unsubscribeSessionChange();
|
|
37
|
-
}
|
|
38
|
-
hideOptions(event) {
|
|
39
|
-
// @ts-ignore
|
|
40
|
-
if (event.target.parentNode !== this.el) {
|
|
41
|
-
this.showOptions = false;
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
updateUri(uri) {
|
|
45
|
-
this.thing = this.os.store.get(uri);
|
|
46
|
-
}
|
|
47
|
-
getLabelIndexes(profile) {
|
|
48
|
-
if (profile) {
|
|
49
|
-
this.indexes = profile.getPrivateLabelIndexes().map(it => this.os.store.get(it).assume(LabelIndex));
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
async onClick(e) {
|
|
53
|
-
e.preventDefault();
|
|
54
|
-
if (this.indexes.length === 1) {
|
|
55
|
-
await this.addToLabelIndex(this.indexes[0]);
|
|
56
|
-
}
|
|
57
|
-
else if (this.indexes.length > 1) {
|
|
58
|
-
this.showOptions = true;
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
async addToLabelIndex(index) {
|
|
62
|
-
await this.os.addToLabelIndex(this.thing, index);
|
|
63
|
-
}
|
|
64
|
-
render() {
|
|
65
|
-
if (!store.state.isLoggedIn) {
|
|
66
|
-
return null;
|
|
67
|
-
}
|
|
68
|
-
return (h(Host, null, h("button", { class: { main: true, open: this.showOptions }, onClick: e => this.onClick(e), title: "" }, h("svg", { 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: "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" })), h("p", null, "Make this findable")), this.showOptions && (h("div", { class: "options" }, h("ol", { role: "listbox" }, this.indexes.map((index) => (h("li", { role: "option" }, h("button", { onClick: e => this.chooseOption(e, index) }, h("pos-resource", { uri: index.uri, lazy: true }, h("pos-label", null)))))))))));
|
|
69
|
-
}
|
|
70
|
-
async chooseOption(e, index) {
|
|
71
|
-
e.preventDefault();
|
|
72
|
-
await this.addToLabelIndex(index);
|
|
73
|
-
}
|
|
74
|
-
get el() { return this; }
|
|
75
|
-
static get watchers() { return {
|
|
76
|
-
"uri": ["updateUri"]
|
|
77
|
-
}; }
|
|
78
|
-
static get style() { return PosMakeFindableStyle0; }
|
|
79
|
-
}, [0, "pos-make-findable", {
|
|
80
|
-
"uri": [1],
|
|
81
|
-
"os": [32],
|
|
82
|
-
"thing": [32],
|
|
83
|
-
"indexes": [32],
|
|
84
|
-
"unsubscribeSessionChange": [32],
|
|
85
|
-
"showOptions": [32]
|
|
86
|
-
}, [[8, "click", "hideOptions"]], {
|
|
87
|
-
"uri": ["updateUri"]
|
|
88
|
-
}]);
|
|
89
|
-
function defineCustomElement$1() {
|
|
90
|
-
if (typeof customElements === "undefined") {
|
|
91
|
-
return;
|
|
92
|
-
}
|
|
93
|
-
const components = ["pos-make-findable", "ion-card", "ion-card-content", "ion-card-header", "ion-progress-bar", "ion-ripple-effect", "pos-label", "pos-resource"];
|
|
94
|
-
components.forEach(tagName => { switch (tagName) {
|
|
95
|
-
case "pos-make-findable":
|
|
96
|
-
if (!customElements.get(tagName)) {
|
|
97
|
-
customElements.define(tagName, PosMakeFindable$1);
|
|
98
|
-
}
|
|
99
|
-
break;
|
|
100
|
-
case "ion-card":
|
|
101
|
-
if (!customElements.get(tagName)) {
|
|
102
|
-
defineCustomElement$8();
|
|
103
|
-
}
|
|
104
|
-
break;
|
|
105
|
-
case "ion-card-content":
|
|
106
|
-
if (!customElements.get(tagName)) {
|
|
107
|
-
defineCustomElement$7();
|
|
108
|
-
}
|
|
109
|
-
break;
|
|
110
|
-
case "ion-card-header":
|
|
111
|
-
if (!customElements.get(tagName)) {
|
|
112
|
-
defineCustomElement$6();
|
|
113
|
-
}
|
|
114
|
-
break;
|
|
115
|
-
case "ion-progress-bar":
|
|
116
|
-
if (!customElements.get(tagName)) {
|
|
117
|
-
defineCustomElement$5();
|
|
118
|
-
}
|
|
119
|
-
break;
|
|
120
|
-
case "ion-ripple-effect":
|
|
121
|
-
if (!customElements.get(tagName)) {
|
|
122
|
-
defineCustomElement$4();
|
|
123
|
-
}
|
|
124
|
-
break;
|
|
125
|
-
case "pos-label":
|
|
126
|
-
if (!customElements.get(tagName)) {
|
|
127
|
-
defineCustomElement$3();
|
|
128
|
-
}
|
|
129
|
-
break;
|
|
130
|
-
case "pos-resource":
|
|
131
|
-
if (!customElements.get(tagName)) {
|
|
132
|
-
defineCustomElement$2();
|
|
133
|
-
}
|
|
134
|
-
break;
|
|
135
|
-
} });
|
|
136
|
-
}
|
|
1
|
+
import { P as PosMakeFindable$1, d as defineCustomElement$1 } from './pos-make-findable2.js';
|
|
137
2
|
|
|
138
3
|
const PosMakeFindable = PosMakeFindable$1;
|
|
139
4
|
const defineCustomElement = defineCustomElement$1;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"pos-make-findable.js","mappings":"
|
|
1
|
+
{"file":"pos-make-findable.js","mappings":";;;;;;;","names":[],"sources":[],"sourcesContent":[],"version":3}
|
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client';
|
|
2
|
+
import { L as LabelIndex } from './index10.js';
|
|
3
|
+
import { s as subscribePodOs } from './PodOsAware.js';
|
|
4
|
+
import { s as store } from './session.js';
|
|
5
|
+
import { d as defineCustomElement$7 } from './card.js';
|
|
6
|
+
import { d as defineCustomElement$6 } from './card-content.js';
|
|
7
|
+
import { d as defineCustomElement$5 } from './card-header.js';
|
|
8
|
+
import { d as defineCustomElement$4 } from './progress-bar.js';
|
|
9
|
+
import { d as defineCustomElement$3 } from './ripple-effect.js';
|
|
10
|
+
import { d as defineCustomElement$2 } from './pos-label2.js';
|
|
11
|
+
import { d as defineCustomElement$1 } from './pos-resource2.js';
|
|
12
|
+
|
|
13
|
+
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(--size-8);\n width: var(--size-8);\n align-items: center;\n justify-content: center;\n border-radius: var(--radius-xs);\n color: var(--color-grey-500);\n border: var(--size-px) dashed var(--color-grey-500);\n background: none;\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\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 background-color: var(--color-grey-200);\n padding: 0;\n margin: 0;\n list-style: none;\n button {\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 filter: brightness(80%);\n }\n\n &:active {\n filter: brightness(90%);\n }\n }\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(--color-grey-200);\n color: var(--color-grey-700);\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";
|
|
14
|
+
const PosMakeFindableStyle0 = posMakeFindableCss;
|
|
15
|
+
|
|
16
|
+
const PosMakeFindable = /*@__PURE__*/ proxyCustomElement(class PosMakeFindable extends HTMLElement {
|
|
17
|
+
constructor() {
|
|
18
|
+
super();
|
|
19
|
+
this.__registerHost();
|
|
20
|
+
this.subscribePodOs = createEvent(this, "pod-os:init", 7);
|
|
21
|
+
this.errorEmitter = createEvent(this, "pod-os:error", 7);
|
|
22
|
+
this.indexes = [];
|
|
23
|
+
this.showOptions = false;
|
|
24
|
+
this.success = false;
|
|
25
|
+
this.receivePodOs = async (os) => {
|
|
26
|
+
this.os = os;
|
|
27
|
+
this.thing = this.os.store.get(this.uri);
|
|
28
|
+
this.getLabelIndexes(store.state.profile);
|
|
29
|
+
this.unsubscribeSessionChange = store.onChange('profile', profile => {
|
|
30
|
+
this.getLabelIndexes(profile);
|
|
31
|
+
});
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
componentWillLoad() {
|
|
35
|
+
subscribePodOs(this);
|
|
36
|
+
}
|
|
37
|
+
disconnectedCallback() {
|
|
38
|
+
this.unsubscribeSessionChange && this.unsubscribeSessionChange();
|
|
39
|
+
}
|
|
40
|
+
hideOptions(event) {
|
|
41
|
+
// @ts-ignore
|
|
42
|
+
if (!this.el.contains(event.target)) {
|
|
43
|
+
this.showOptions = false;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
handleKeyDown(ev) {
|
|
47
|
+
if (ev.key === 'Escape') {
|
|
48
|
+
this.showOptions = false;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
updateUri(uri) {
|
|
52
|
+
this.thing = this.os.store.get(uri);
|
|
53
|
+
this.success = false;
|
|
54
|
+
}
|
|
55
|
+
getLabelIndexes(profile) {
|
|
56
|
+
if (profile) {
|
|
57
|
+
this.indexes = profile.getPrivateLabelIndexes().map(it => this.os.store.get(it).assume(LabelIndex));
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
async onClick(e) {
|
|
61
|
+
e.preventDefault();
|
|
62
|
+
this.success = false;
|
|
63
|
+
if (this.indexes.length === 1) {
|
|
64
|
+
await this.addToLabelIndex(this.indexes[0]);
|
|
65
|
+
}
|
|
66
|
+
else if (this.indexes.length > 1) {
|
|
67
|
+
this.showOptions = true;
|
|
68
|
+
}
|
|
69
|
+
else {
|
|
70
|
+
if (window.confirm(`🔎 To use search you have to configure a label index.
|
|
71
|
+
For now you have to do this manually unfortunately.
|
|
72
|
+
|
|
73
|
+
📖 Do you want to open a page that describes how to create a label index?`)) {
|
|
74
|
+
window.open('https://github.com/pod-os/PodOS/blob/main/docs/features/full-text-search.md#full-text-search', '_blank');
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
async addToLabelIndex(index) {
|
|
79
|
+
try {
|
|
80
|
+
await this.os.addToLabelIndex(this.thing, index);
|
|
81
|
+
this.success = true;
|
|
82
|
+
}
|
|
83
|
+
catch (e) {
|
|
84
|
+
this.errorEmitter.emit(e);
|
|
85
|
+
}
|
|
86
|
+
this.showOptions = false;
|
|
87
|
+
}
|
|
88
|
+
render() {
|
|
89
|
+
if (!store.state.isLoggedIn || !this.uri) {
|
|
90
|
+
return null;
|
|
91
|
+
}
|
|
92
|
+
const label = 'Make this findable';
|
|
93
|
+
return (h(Host, null, h("button", { type: "button", "aria-label": label, class: { main: true, open: this.showOptions, success: this.success }, onClick: e => this.onClick(e), title: "" }, this.success ? h(IconSuccess, null) : h(IconMakeFindable, null), h("p", null, label)), this.showOptions && (h("div", { class: "options" }, h("ol", { role: "listbox" }, this.indexes.map((index) => (h("li", { role: "option" }, h("button", { onClick: e => this.chooseOption(e, index) }, h("pos-resource", { uri: index.uri, lazy: true }, h("pos-label", null)))))))))));
|
|
94
|
+
}
|
|
95
|
+
async chooseOption(e, index) {
|
|
96
|
+
e.preventDefault();
|
|
97
|
+
await this.addToLabelIndex(index);
|
|
98
|
+
}
|
|
99
|
+
get el() { return this; }
|
|
100
|
+
static get watchers() { return {
|
|
101
|
+
"uri": ["updateUri"]
|
|
102
|
+
}; }
|
|
103
|
+
static get style() { return PosMakeFindableStyle0; }
|
|
104
|
+
}, [0, "pos-make-findable", {
|
|
105
|
+
"uri": [1],
|
|
106
|
+
"os": [32],
|
|
107
|
+
"thing": [32],
|
|
108
|
+
"indexes": [32],
|
|
109
|
+
"unsubscribeSessionChange": [32],
|
|
110
|
+
"showOptions": [32],
|
|
111
|
+
"success": [32]
|
|
112
|
+
}, [[4, "click", "hideOptions"], [0, "keydown", "handleKeyDown"]], {
|
|
113
|
+
"uri": ["updateUri"]
|
|
114
|
+
}]);
|
|
115
|
+
const IconMakeFindable = () => (h("svg", { role: "presentation", 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: "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" })));
|
|
116
|
+
const IconSuccess = () => (h("svg", { role: "presentation", 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: "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" })));
|
|
117
|
+
function defineCustomElement() {
|
|
118
|
+
if (typeof customElements === "undefined") {
|
|
119
|
+
return;
|
|
120
|
+
}
|
|
121
|
+
const components = ["pos-make-findable", "ion-card", "ion-card-content", "ion-card-header", "ion-progress-bar", "ion-ripple-effect", "pos-label", "pos-resource"];
|
|
122
|
+
components.forEach(tagName => { switch (tagName) {
|
|
123
|
+
case "pos-make-findable":
|
|
124
|
+
if (!customElements.get(tagName)) {
|
|
125
|
+
customElements.define(tagName, PosMakeFindable);
|
|
126
|
+
}
|
|
127
|
+
break;
|
|
128
|
+
case "ion-card":
|
|
129
|
+
if (!customElements.get(tagName)) {
|
|
130
|
+
defineCustomElement$7();
|
|
131
|
+
}
|
|
132
|
+
break;
|
|
133
|
+
case "ion-card-content":
|
|
134
|
+
if (!customElements.get(tagName)) {
|
|
135
|
+
defineCustomElement$6();
|
|
136
|
+
}
|
|
137
|
+
break;
|
|
138
|
+
case "ion-card-header":
|
|
139
|
+
if (!customElements.get(tagName)) {
|
|
140
|
+
defineCustomElement$5();
|
|
141
|
+
}
|
|
142
|
+
break;
|
|
143
|
+
case "ion-progress-bar":
|
|
144
|
+
if (!customElements.get(tagName)) {
|
|
145
|
+
defineCustomElement$4();
|
|
146
|
+
}
|
|
147
|
+
break;
|
|
148
|
+
case "ion-ripple-effect":
|
|
149
|
+
if (!customElements.get(tagName)) {
|
|
150
|
+
defineCustomElement$3();
|
|
151
|
+
}
|
|
152
|
+
break;
|
|
153
|
+
case "pos-label":
|
|
154
|
+
if (!customElements.get(tagName)) {
|
|
155
|
+
defineCustomElement$2();
|
|
156
|
+
}
|
|
157
|
+
break;
|
|
158
|
+
case "pos-resource":
|
|
159
|
+
if (!customElements.get(tagName)) {
|
|
160
|
+
defineCustomElement$1();
|
|
161
|
+
}
|
|
162
|
+
break;
|
|
163
|
+
} });
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
export { PosMakeFindable as P, defineCustomElement as d };
|
|
167
|
+
|
|
168
|
+
//# sourceMappingURL=pos-make-findable2.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"file":"pos-make-findable2.js","mappings":"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","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-xs);\n color: var(--color-grey-500);\n border: var(--size-px) dashed var(--color-grey-500);\n background: none;\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\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 background-color: var(--color-grey-200);\n padding: 0;\n margin: 0;\n list-style: none;\n button {\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 filter: brightness(80%);\n }\n\n &:active {\n filter: brightness(90%);\n }\n }\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(--color-grey-200);\n color: var(--color-grey-700);\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() success = false;\n\n @Event({ eventName: 'pod-os:error' }) errorEmitter: 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.success = false;\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 }\n }\n\n private async onClick(e: MouseEvent) {\n e.preventDefault();\n this.success = false;\n if (this.indexes.length === 1) {\n await this.addToLabelIndex(this.indexes[0]);\n } else if (this.indexes.length > 1) {\n this.showOptions = true;\n } else {\n if (\n window.confirm(\n `🔎 To use search you have to configure a label index.\n For now you have to do this manually unfortunately.\n\n 📖 Do you want to open a page that describes how to create a label index?`,\n )\n ) {\n window.open(\n 'https://github.com/pod-os/PodOS/blob/main/docs/features/full-text-search.md#full-text-search',\n '_blank',\n );\n }\n }\n }\n\n private async addToLabelIndex(index: LabelIndex) {\n try {\n await this.os.addToLabelIndex(this.thing, index);\n this.success = true;\n } catch (e) {\n this.errorEmitter.emit(e);\n }\n\n this.showOptions = false;\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.success }}\n onClick={e => this.onClick(e)}\n title=\"\"\n >\n {this.success ? <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 <button onClick={e => this.chooseOption(e, index)}>\n <pos-resource uri={index.uri} lazy={true}>\n <pos-label></pos-label>\n </pos-resource>\n </button>\n </li>\n ))}\n </ol>\n </div>\n )}\n </Host>\n );\n }\n\n private async chooseOption(e: MouseEvent, index: LabelIndex) {\n e.preventDefault();\n await this.addToLabelIndex(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}
|