@pod-os/elements 0.24.2-rc.2a139ac.0 → 0.24.2-rc.fd22901.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-badge_8.cjs.entry.js +1 -1
- package/dist/cjs/ion-card_34.cjs.entry.js +19 -19
- package/dist/cjs/ion-card_34.cjs.entry.js.map +1 -1
- package/dist/cjs/pos-app-generic.cjs.entry.js +1 -1
- package/dist/cjs/pos-app-ldp-container.cjs.entry.js +1 -1
- package/dist/cjs/pos-app-rdf-document.cjs.entry.js +1 -1
- package/dist/collection/apps/pos-app-browser/pos-app-browser.css +13 -0
- package/dist/collection/apps/pos-app-browser/pos-app-browser.js +1 -1
- package/dist/collection/apps/pos-app-browser/pos-app-browser.js.map +1 -1
- package/dist/collection/apps/pos-app-dashboard/pos-app-dashboard.js +1 -1
- package/dist/collection/apps/pos-app-dashboard/pos-example-resources/pos-example-resources.js +1 -1
- package/dist/collection/apps/pos-app-dashboard/pos-getting-started/pos-getting-started.js +1 -1
- package/dist/collection/apps/pos-app-generic/pos-app-generic.js +1 -1
- package/dist/collection/apps/pos-app-ldp-container/pos-app-ldp-container.js +1 -1
- package/dist/collection/apps/pos-app-rdf-document/pos-app-rdf-document.js +1 -1
- package/dist/collection/apps/pos-app-settings/pos-app-settings.js +1 -1
- package/dist/collection/apps/pos-app-settings/pos-getting-started/pos-setting-offline-cache.js +2 -1
- package/dist/collection/apps/pos-app-settings/pos-getting-started/pos-setting-offline-cache.js.map +1 -1
- package/dist/collection/components/pos-add-new-thing/pos-add-new-thing.js +1 -1
- package/dist/collection/components/pos-app/pos-app.js +1 -1
- package/dist/collection/components/pos-dialog/pos-dialog.js +1 -1
- package/dist/collection/components/pos-error-toast/pos-error-toast.js +1 -1
- package/dist/collection/components/pos-literals/pos-literals.js +1 -1
- package/dist/collection/components/pos-login/pos-login.js +1 -1
- package/dist/collection/components/pos-login-form/pos-login-form.js +1 -1
- package/dist/collection/components/pos-navigation-bar/pos-navigation-bar.js +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/index11.js +170 -172
- package/dist/components/index11.js.map +1 -1
- package/dist/components/index12.js +198 -0
- package/dist/components/index12.js.map +1 -0
- package/dist/components/ion-app.js +1 -1
- package/dist/components/pos-add-new-thing2.js +1 -1
- package/dist/components/pos-app-browser.js +2 -2
- package/dist/components/pos-app-browser.js.map +1 -1
- package/dist/components/pos-app-dashboard2.js +1 -1
- package/dist/components/pos-app-generic.js +1 -1
- package/dist/components/pos-app-ldp-container.js +1 -1
- package/dist/components/pos-app-rdf-document.js +1 -1
- package/dist/components/pos-app-settings2.js +1 -1
- package/dist/components/pos-app2.js +3 -26
- package/dist/components/pos-app2.js.map +1 -1
- package/dist/components/pos-dialog2.js +1 -1
- package/dist/components/pos-error-toast2.js +1 -1
- package/dist/components/pos-example-resources2.js +1 -1
- package/dist/components/pos-getting-started2.js +1 -1
- package/dist/components/pos-literals2.js +1 -1
- package/dist/components/pos-login-form2.js +1 -1
- package/dist/components/pos-login2.js +1 -1
- package/dist/components/pos-navigation-bar2.js +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/components/pos-setting-offline-cache2.js +2 -1
- package/dist/components/pos-setting-offline-cache2.js.map +1 -1
- package/dist/components/session.js +2 -193
- package/dist/components/session.js.map +1 -1
- package/dist/components/settings.js +29 -0
- package/dist/components/settings.js.map +1 -0
- package/dist/elements/elements.esm.js +1 -1
- package/dist/elements/p-48f2cf16.entry.js +2 -0
- package/dist/elements/p-6e0e0f54.entry.js +2 -0
- package/dist/elements/{p-83d99403.entry.js → p-8cea7540.entry.js} +8 -8
- package/dist/elements/{p-83d99403.entry.js.map → p-8cea7540.entry.js.map} +1 -1
- package/dist/elements/{p-4b8c7388.entry.js → p-8eb66b39.entry.js} +2 -2
- package/dist/elements/p-b58b6be4.entry.js +2 -0
- package/dist/esm/ion-badge_8.entry.js +1 -1
- package/dist/esm/ion-card_34.entry.js +19 -19
- package/dist/esm/ion-card_34.entry.js.map +1 -1
- package/dist/esm/pos-app-generic.entry.js +1 -1
- package/dist/esm/pos-app-ldp-container.entry.js +1 -1
- package/dist/esm/pos-app-rdf-document.entry.js +1 -1
- package/package.json +1 -1
- package/dist/elements/p-52678615.entry.js +0 -2
- package/dist/elements/p-a1fbbc32.entry.js +0 -2
- package/dist/elements/p-c7b331ce.entry.js +0 -2
- /package/dist/elements/{p-a1fbbc32.entry.js.map → p-48f2cf16.entry.js.map} +0 -0
- /package/dist/elements/{p-52678615.entry.js.map → p-6e0e0f54.entry.js.map} +0 -0
- /package/dist/elements/{p-4b8c7388.entry.js.map → p-8eb66b39.entry.js.map} +0 -0
- /package/dist/elements/{p-c7b331ce.entry.js.map → p-b58b6be4.entry.js.map} +0 -0
|
@@ -19,7 +19,7 @@ const PosExampleResources = /*@__PURE__*/ proxyCustomElement(class PosExampleRes
|
|
|
19
19
|
this.__attachShadow();
|
|
20
20
|
}
|
|
21
21
|
render() {
|
|
22
|
-
return (h(Host, { key: '
|
|
22
|
+
return (h(Host, { key: 'b6a491caa9ea624cdba3cca92fcc9444a3c38290' }, h("div", { key: '458ceb259d7070d38eb13aea9f3b303f174a5c56' }, h("h2", { key: '1d571afb47c256f2ac873840c6fe8bc8408cc9a6' }, "Try these... \uD83D\uDCA1"), h("p", { key: '7de1dac7a92becb01ec7aab4cf96c45fa95f7de6' }, "No idea where to start? Try these example resources, and follow your nose \uD83D\uDC43"), h("div", { key: 'b94cc5571f5b7af0bcc660fc8812ca08ca2db482', class: "links" }, h("pos-rich-link", { key: 'e2c414d51b79e27667a42d04fa66e879a2ecf2a2', uri: "https://pod-os.solidcommunity.net/profile/card#me" }), h("pos-rich-link", { key: 'e54479349363d67d027612bbcdb2167f9ab6ec03', uri: "https://angelo.veltens.org/profile/card#me" }), h("pos-rich-link", { key: '1c743eafd11d46f6bdd31face3bf1083abd1e045', uri: "https://angelo.veltens.org/public/bookmarks" }), h("pos-rich-link", { key: '3e47cd67a0ab44a1921ec4f0e5e9f24404826494', uri: "https://solidos.solidcommunity.net/profile/card#me" })))));
|
|
23
23
|
}
|
|
24
24
|
static get style() { return PosExampleResourcesStyle0; }
|
|
25
25
|
}, [1, "pos-example-resources"]);
|
|
@@ -10,7 +10,7 @@ const PosGettingStarted = /*@__PURE__*/ proxyCustomElement(class PosGettingStart
|
|
|
10
10
|
this.__attachShadow();
|
|
11
11
|
}
|
|
12
12
|
render() {
|
|
13
|
-
return (h(Host, { key: '
|
|
13
|
+
return (h(Host, { key: 'a31a64545a5960ce8e34f0c612d2755e465c1131' }, h("div", { key: '29ec2c449fd5334e47199dece7c01c2a71ab6d98' }, h("h2", { key: 'e680003831826c8cd4615de083f9f9c305513c29' }, "Getting started \uD83D\uDE80"), h("p", { key: '8e80305087bee4c8ec05ac7cb16096caf0c61ad0' }, "\uD83D\uDD0E Enter a URL into the above navigation bar to browse through the web of data. "), h("p", { key: '4d7ba95047694e636934cb7a03c291adb0678bb6' }, "\uD83D\uDD10 Sign in to access private resources on your Solid Pod or those of your friends or coworkers.")), h("div", { key: '167ac903fa88b9be6cf00f2f5bfea23d8dfd14c9' }, h("p", { key: 'a0b06f944e534b889502a96c935686a3b7f349d0', class: "question" }, "New to Solid?"), h("p", { key: '8c26c4d20d0fcdb075ad4c0ea5ff012d22dee081' }, h("a", { key: 'd9bc5b7bfd213012078729e25e42b4ea8b970573', href: "https://solidproject.org/for-developers#hosted-pod-services" }, "Get a Pod \u2192"))), h("div", { key: '223f171699e3acf5f1c5c4819621bddc49db41f1' }, h("p", { key: 'e83cfd2b01c5abaf30f0053ef261c68ae0919f0a', class: "question" }, "Want to dig deeper into PodOS?"), h("p", { key: '8ccdbd60a250850c4105e99545f09755109ced86' }, h("a", { key: 'f72a83533b846bd8e8e798b0dd71cfc585a8d104', href: "http://pod-os.org" }, "Learn more \u2192")))));
|
|
14
14
|
}
|
|
15
15
|
static get style() { return PosGettingStartedStyle0; }
|
|
16
16
|
}, [1, "pos-getting-started"]);
|
|
@@ -41,7 +41,7 @@ const PosLiterals = /*@__PURE__*/ proxyCustomElement(class PosLiterals extends H
|
|
|
41
41
|
}
|
|
42
42
|
}
|
|
43
43
|
render() {
|
|
44
|
-
return (h(Host, { key: '
|
|
44
|
+
return (h(Host, { key: 'fbfc96a94c8a225a94cbf8d230b9ec36b935523b' }, this.data.length > 0 ? (h("dl", null, this.data.map(it => (h("div", { class: "predicate-values" }, h("dt", null, h("pos-predicate", { uri: it.predicate, label: it.label })), h("div", { class: "values" }, it.values.map(value => (h("dd", null, value))))))))) : null, h("pos-add-literal-value", { key: 'f0b7dda5edb7d590301a8c04a6309a774c074ccb', "onPod-os:added-literal-value": event => this.literalValueAdded(event.detail) })));
|
|
45
45
|
}
|
|
46
46
|
static get style() { return PosLiteralsStyle0; }
|
|
47
47
|
}, [1, "pos-literals", {
|
|
@@ -16,7 +16,7 @@ const PosLoginForm = /*@__PURE__*/ proxyCustomElement(class PosLoginForm extends
|
|
|
16
16
|
this.canSubmit = Boolean(this.idpUrl);
|
|
17
17
|
}
|
|
18
18
|
render() {
|
|
19
|
-
return (h("form", { key: '
|
|
19
|
+
return (h("form", { key: 'ad94a827203fead2cc5976e65d5dd11b76929a37', method: "dialog", onSubmit: () => this.handleSubmit() }, h("label", { key: '042115e98ac3dc97aa941b9a086a930c532bab19', htmlFor: "idpUrl" }, "Please enter your Identity Provider"), h("input", { key: '45a4621d9a21a5b21ec82f81025b2be68d5505ae', id: "idpUrl", type: "url", value: this.idpUrl, required: true, onInput: e => this.handleChange(e), list: "suggestedIssuers", placeholder: "Type to search..." }), h("datalist", { key: '1f4dd4962470e796d1a175ea2ec2d03663390a0d', id: "suggestedIssuers" }, h("option", { key: 'f00f189f9f7babbda5c109a57d380d4d44d68f79', value: "https://solidcommunity.net" }, "solidcommunity.net"), h("option", { key: 'a0a1e4171ef87cd219cb8f0c68b68d0901d3fa55', value: "https://solidweb.org" }, "solidweb.org"), h("option", { key: '4361294b71ba9b7b123dd5d1deb2692b2edfa59e', value: "https://solidweb.me" }, "solidweb.me"), h("option", { key: '0fcee23d732415ef206d8c9a4d18c31f2bcd8eca', value: "https://inrupt.net" }, "inrupt.net"), h("option", { key: '267b177e9765e09ee2aa592c8a4d4c152ad7fb0b', value: "https://login.inrupt.com" }, "Inrupt PodSpaces"), h("option", { key: '302a4d517fedeafb146d9f8a3938383c57e24f7e', value: "https://trinpod.us" }, "trinpod.us"), h("option", { key: '83fd1b92688b24f575d3ee17a9cb394c8ab16eab', value: "https://use.id" }, "use.id"), h("option", { key: '007f814795f747d9b74f7b16db986502a9b746af', value: "https://solid.redpencil.io" }, "redpencil.io"), h("option", { key: '5477d60737d194bce4c50f24a75930427b6dc9bb', value: "https://datapod.grant.io" }, "Data Pod (grant.io)"), h("option", { key: 'e289736fcc31902f783efae443f17dfda532ba9f', value: "https://teamid.live" }, "teamid.live")), h("input", { key: '69a61d727a4e2c88a7f3594b98cca42f934b649a', id: "login", type: "submit", value: "Login", disabled: !this.canSubmit })));
|
|
20
20
|
}
|
|
21
21
|
handleChange(event) {
|
|
22
22
|
this.validate();
|
|
@@ -41,7 +41,7 @@ const PosLogin = /*@__PURE__*/ proxyCustomElement(class PosLogin extends HTMLEle
|
|
|
41
41
|
this.dialog.showModal();
|
|
42
42
|
}
|
|
43
43
|
render() {
|
|
44
|
-
return (h(Host, { key: '
|
|
44
|
+
return (h(Host, { key: '246bea632b952b0a004e1237697a86bd0ebfeea4' }, h("div", { key: 'cdcb1905deb0d27f79adc4ed1eeae0adb47b37f6', class: "container" }, store.state.isLoggedIn ? (h("pos-resource", { uri: store.state.webId }, h("span", { class: "user-data" }, h("pos-picture", null), h("pos-label", null)))) : (''), !store.state.isLoggedIn && (h("button", { key: 'dc3a1072af920e9495a2e003c1e2edf8d282de29', id: "login", onClick: () => this.openDialog() }, "Login")), store.state.isLoggedIn && (h("button", { key: 'ca04ffb1126cd26d1c80060673c036048b403c82', id: "logout", onClick: () => this.logout() }, "Logout"))), h("pos-dialog", { key: 'f832ac8272a695e1bcf826d5aa5d62843bfb4de5', ref: el => (this.dialog = el) }, h("span", { key: 'd2dd84554a068af4a044cba963aa4417b8232d93', slot: "title" }, "Sign in to your Pod"), h("pos-login-form", { key: '98b542c2ddc6828fe99857632ee90a0dae6fdf96', "onPod-os:idp-url-selected": ev => this.login(ev), slot: "content" }))));
|
|
45
45
|
}
|
|
46
46
|
static get style() { return PosLoginStyle0; }
|
|
47
47
|
}, [1, "pos-login", {
|
|
@@ -93,7 +93,7 @@ const PosNavigationBar = /*@__PURE__*/ proxyCustomElement(class PosNavigationBar
|
|
|
93
93
|
}
|
|
94
94
|
}
|
|
95
95
|
render() {
|
|
96
|
-
return (h("form", { key: '
|
|
96
|
+
return (h("form", { key: 'dadf35124fd0908c3623ef2e358f1e751a0b7242', onSubmit: e => this.onSubmit(e) }, this.searchIndex && this.uri ? h("pos-make-findable", { uri: this.uri }) : '', h("div", { key: '64d85b0b51298e2d1b3d6ff32f36db3f80fa1796', class: "bar" }, h("ion-searchbar", { key: 'cd51737238ab42315ace5bebdcc0b4c561b02c38', enterkeyhint: "search", placeholder: "Search or enter URI", value: this.uri, debounce: 300, onIonChange: e => this.onChange(e), onIonInput: 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)));
|
|
97
97
|
}
|
|
98
98
|
static get style() { return PosNavigationBarStyle0; }
|
|
99
99
|
}, [1, "pos-navigation-bar", {
|
|
@@ -25,7 +25,7 @@ const PosNewThingForm = /*@__PURE__*/ proxyCustomElement(class PosNewThingForm e
|
|
|
25
25
|
subscribePodOs(this);
|
|
26
26
|
}
|
|
27
27
|
render() {
|
|
28
|
-
return (h("form", { key: '
|
|
28
|
+
return (h("form", { key: 'd231729bb8d01ffa9e1f88d9488fa92041f33460', method: "dialog", onSubmit: e => this.handleSubmit(e) }, h("label", { key: '739f893b508ffe8baa0b575594af48f6f690425c', htmlFor: "type" }, "Type"), h("pos-select-term", { key: '9973af04355cf8dec838a4217f711e4c8669dab4', id: "type", placeholder: "", value: this.selectedTypeUri, "onPod-os:term-selected": e => this.onTermSelected(e) }), h("label", { key: '4fac8ecca95c2e16c98c35ae92ea9b7f6bd6a94a', htmlFor: "name" }, "Name"), h("input", { key: 'c922c03e656d194c3235fb374ef90fce205f7ee7', id: "name", type: "text", value: this.name, onInput: e => this.handleChange(e) }), this.newUri ? (h("div", { id: "new-uri", title: "This will be the URI of the new thing" }, this.newUri)) : null, h("input", { key: 'fb39eb6c09e67315326f13e184aab93a4ed786c6', id: "create", type: "submit", value: "Create", disabled: !this.canSubmit })));
|
|
29
29
|
}
|
|
30
30
|
handleChange(event) {
|
|
31
31
|
this.name = event.target.value;
|
|
@@ -19,10 +19,10 @@ const PosRichLink = /*@__PURE__*/ proxyCustomElement(class PosRichLink extends H
|
|
|
19
19
|
this.linkEmitter = createEvent(this, "pod-os:link", 7);
|
|
20
20
|
}
|
|
21
21
|
render() {
|
|
22
|
-
return (h("pos-resource", { key: '
|
|
22
|
+
return (h("pos-resource", { key: 'e9f1c8b7ca9ded161eebf1b4886b21ec2a23e042', lazy: true, uri: this.uri }, h("p", { key: '022cebbb522c3a04f1f6b83e9aeb8ad890642bdd', class: "content" }, h("a", { key: '105415deeb645e99e36d34f1750da0fa444c6ba8', href: this.uri, onClick: e => {
|
|
23
23
|
e.preventDefault();
|
|
24
24
|
this.linkEmitter.emit(this.uri);
|
|
25
|
-
} }, h("pos-label", { key: '
|
|
25
|
+
} }, h("pos-label", { key: '4530f9511b81d37229f7c4f57915da035002bdfb' })), h("span", { key: '341e91a6167d36881d2bb5e96365aa7f2f7f2f9b', class: "url" }, new URL(this.uri).host), h("pos-description", { key: 'c8e3875a219a76fa401a558d9c4eaa6813206a19' }))));
|
|
26
26
|
}
|
|
27
27
|
static get style() { return PosRichLinkStyle0; }
|
|
28
28
|
}, [1, "pos-rich-link", {
|
|
@@ -327,7 +327,7 @@ const PosRouter = /*@__PURE__*/ proxyCustomElement(class PosRouter extends HTMLE
|
|
|
327
327
|
this.routeChanged.emit(this.uri);
|
|
328
328
|
}
|
|
329
329
|
render() {
|
|
330
|
-
return h("slot", { key: '
|
|
330
|
+
return h("slot", { key: '4c9986b609d72550130ca76675dee260ca1cf373' });
|
|
331
331
|
}
|
|
332
332
|
static get style() { return PosRouterStyle0; }
|
|
333
333
|
}, [4, "pos-router", {
|
|
@@ -28,7 +28,7 @@ const PosSelectTerm = /*@__PURE__*/ proxyCustomElement(class PosSelectTerm exten
|
|
|
28
28
|
this.termSelected.emit({ uri: event.target.value });
|
|
29
29
|
}
|
|
30
30
|
render() {
|
|
31
|
-
return (h(Host, { key: '
|
|
31
|
+
return (h(Host, { key: '0c84c241534e981ac22797ca058622c79aa2c661' }, h("input", { key: '0dd0c1d3ed228a3e2c333e440eb5044e99110252', part: "input", list: "terms", placeholder: this.placeholder, value: this.value, onChange: ev => this.handleChange(ev) }), h("datalist", { key: 'b792a879f92d1b95b094cef9cab81738205a503b', part: "terms", id: "terms" }, this.terms.map(term => (h("option", { value: term.uri }, term.shorthand))))));
|
|
32
32
|
}
|
|
33
33
|
static get delegatesFocus() { return true; }
|
|
34
34
|
static get watchers() { return {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { proxyCustomElement, HTMLElement, h, Host } from '@stencil/core/internal/client';
|
|
2
|
+
import { l as localSettings } from './settings.js';
|
|
2
3
|
|
|
3
4
|
const posSettingOfflineCacheCss = ":host{border:var(--size-px) solid var(--color-grey-100);border-radius:var(--radius-lg);box-shadow:var(--shadow-md);padding:var(--size-8);max-width:var(--size-96);background:var(--color-white)}svg{width:var(--size-8)}h2{display:flex;align-items:center}p{padding:var(--size-2)}.info{background-color:var(--color-blue-200)}.warn{background-color:var(--color-yellow-200)}";
|
|
4
5
|
const PosSettingOfflineCacheStyle0 = posSettingOfflineCacheCss;
|
|
@@ -10,7 +11,7 @@ const PosSettingOfflineCache = /*@__PURE__*/ proxyCustomElement(class PosSetting
|
|
|
10
11
|
this.__attachShadow();
|
|
11
12
|
}
|
|
12
13
|
render() {
|
|
13
|
-
return (h(Host, { key: '
|
|
14
|
+
return (h(Host, { key: 'a98de97ba1e0930b485a4a3610102deb02d927a7' }, h("div", { key: '5cf196a71b95fdfed7e5d990b272e12d2b9dd3ff' }, h("h2", { key: '99ddd9827f3ccc5a5277cc64e3952a3f5170f7bc' }, h("svg", { key: 'd9ce3722957428524cc9b264265320119f2e5c88', xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 24 24", "stroke-width": "1.5", stroke: "currentColor" }, h("path", { key: '8e4e7af37df231e3141ba30b17a02517737cbe85', "stroke-linecap": "round", "stroke-linejoin": "round", d: "M20.25 6.375c0 2.278-3.694 4.125-8.25 4.125S3.75 8.653 3.75 6.375m16.5 0c0-2.278-3.694-4.125-8.25-4.125S3.75 4.097 3.75 6.375m16.5 0v11.25c0 2.278-3.694 4.125-8.25 4.125s-8.25-1.847-8.25-4.125V6.375m16.5 0v3.75m-16.5-3.75v3.75m16.5 0v3.75C20.25 16.153 16.556 18 12 18s-8.25-1.847-8.25-4.125v-3.75m16.5 0c0 2.278-3.694 4.125-8.25 4.125s-8.25-1.847-8.25-4.125" })), "Cache Settings"), h("p", { key: '7175929cd9327bc705db305294afa362cb2f648c', class: "info" }, "\u2139 Enable offline cache to be able to access previously loaded data while offline."), h("p", { key: '784fd9141b339165fdab6a98c084430299ff7ed5', class: "warn" }, "\u26A0 Private data may be stored on this device. Only enable it, if you trust this device."), h("label", { key: 'dac2cddf6b6c374d1a2ef3c4d9bad63a9cb7b8d9' }, h("input", { key: 'e39adb18d03ce622a85dd48a28c6d3c0dc2ce7f4', type: "checkbox", checked: localSettings.state.offlineCache, onChange: ev => (localSettings.state.offlineCache = ev.target.checked) }), "Enable offline cache"))));
|
|
14
15
|
}
|
|
15
16
|
static get style() { return PosSettingOfflineCacheStyle0; }
|
|
16
17
|
}, [1, "pos-setting-offline-cache"]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"pos-setting-offline-cache2.js","mappings":"
|
|
1
|
+
{"file":"pos-setting-offline-cache2.js","mappings":";;;AAAA,MAAM,yBAAyB,GAAG,iXAAiX,CAAC;AACpZ,qCAAe,yBAAyB;;MCO3B,sBAAsB;;;;;;IACjC,MAAM;QACJ,QACE,EAAC,IAAI,uDACH,8DACE,6DACE,4DACE,KAAK,EAAC,4BAA4B,EAClC,IAAI,EAAC,MAAM,EACX,OAAO,EAAC,WAAW,kBACN,KAAK,EAClB,MAAM,EAAC,cAAc,IAErB,+EACiB,OAAO,qBACN,OAAO,EACvB,CAAC,EAAC,uWAAuW,GACzW,CACE,mBAEH,EACL,0DAAG,KAAK,EAAC,MAAM,6FAAsF,EACrG,0DAAG,KAAK,EAAC,MAAM,kGAA2F,EAC1G,gEACE,8DACE,IAAI,EAAC,UAAU,EACf,OAAO,EAAE,aAAa,CAAC,KAAK,CAAC,YAAY,EACzC,QAAQ,EAAE,EAAE,KAAK,aAAa,CAAC,KAAK,CAAC,YAAY,GAAI,EAAE,CAAC,MAA2B,CAAC,OAAO,CAAC,GACrF,yBAEH,CACJ,CACD,EACP;KACH;;;;;;;;;;;;;;;;;;;","names":[],"sources":["src/apps/pos-app-settings/pos-getting-started/pos-setting-offline-cache.css?tag=pos-setting-offline-cache&encapsulation=shadow","src/apps/pos-app-settings/pos-getting-started/pos-setting-offline-cache.tsx"],"sourcesContent":[":host {\n border: var(--size-px) solid var(--color-grey-100);\n border-radius: var(--radius-lg);\n box-shadow: var(--shadow-md);\n padding: var(--size-8);\n max-width: var(--size-96);\n background: var(--color-white);\n}\n\nsvg {\n width: var(--size-8);\n}\n\nh2 {\n display: flex;\n align-items: center;\n}\n\np {\n padding: var(--size-2);\n}\n\n.info {\n background-color: var(--color-blue-200);\n}\n.warn {\n background-color: var(--color-yellow-200);\n}\n","import { Component, h, Host } from '@stencil/core';\nimport { localSettings } from '../../../store/settings';\n\n@Component({\n tag: 'pos-setting-offline-cache',\n styleUrl: 'pos-setting-offline-cache.css',\n shadow: true,\n})\nexport class PosSettingOfflineCache {\n render() {\n return (\n <Host>\n <div>\n <h2>\n <svg\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=\"M20.25 6.375c0 2.278-3.694 4.125-8.25 4.125S3.75 8.653 3.75 6.375m16.5 0c0-2.278-3.694-4.125-8.25-4.125S3.75 4.097 3.75 6.375m16.5 0v11.25c0 2.278-3.694 4.125-8.25 4.125s-8.25-1.847-8.25-4.125V6.375m16.5 0v3.75m-16.5-3.75v3.75m16.5 0v3.75C20.25 16.153 16.556 18 12 18s-8.25-1.847-8.25-4.125v-3.75m16.5 0c0 2.278-3.694 4.125-8.25 4.125s-8.25-1.847-8.25-4.125\"\n />\n </svg>\n Cache Settings\n </h2>\n <p class=\"info\">ℹ Enable offline cache to be able to access previously loaded data while offline.</p>\n <p class=\"warn\">⚠ Private data may be stored on this device. Only enable it, if you trust this device.</p>\n <label>\n <input\n type=\"checkbox\"\n checked={localSettings.state.offlineCache}\n onChange={ev => (localSettings.state.offlineCache = (ev.target as HTMLInputElement).checked)}\n ></input>\n Enable offline cache\n </label>\n </div>\n </Host>\n );\n }\n}\n"],"version":3}
|
|
@@ -1,195 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
const appendToMap = (map, propName, value) => {
|
|
4
|
-
const items = map.get(propName);
|
|
5
|
-
if (!items) {
|
|
6
|
-
map.set(propName, [value]);
|
|
7
|
-
}
|
|
8
|
-
else if (!items.includes(value)) {
|
|
9
|
-
items.push(value);
|
|
10
|
-
}
|
|
11
|
-
};
|
|
12
|
-
const debounce = (fn, ms) => {
|
|
13
|
-
let timeoutId;
|
|
14
|
-
return (...args) => {
|
|
15
|
-
if (timeoutId) {
|
|
16
|
-
clearTimeout(timeoutId);
|
|
17
|
-
}
|
|
18
|
-
timeoutId = setTimeout(() => {
|
|
19
|
-
timeoutId = 0;
|
|
20
|
-
fn(...args);
|
|
21
|
-
}, ms);
|
|
22
|
-
};
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
/**
|
|
26
|
-
* Check if a possible element isConnected.
|
|
27
|
-
* The property might not be there, so we check for it.
|
|
28
|
-
*
|
|
29
|
-
* We want it to return true if isConnected is not a property,
|
|
30
|
-
* otherwise we would remove these elements and would not update.
|
|
31
|
-
*
|
|
32
|
-
* Better leak in Edge than to be useless.
|
|
33
|
-
*/
|
|
34
|
-
const isConnected = (maybeElement) => !('isConnected' in maybeElement) || maybeElement.isConnected;
|
|
35
|
-
const cleanupElements = debounce((map) => {
|
|
36
|
-
for (let key of map.keys()) {
|
|
37
|
-
map.set(key, map.get(key).filter(isConnected));
|
|
38
|
-
}
|
|
39
|
-
}, 2000);
|
|
40
|
-
const stencilSubscription = () => {
|
|
41
|
-
if (typeof getRenderingRef !== 'function') {
|
|
42
|
-
// If we are not in a stencil project, we do nothing.
|
|
43
|
-
// This function is not really exported by @stencil/core.
|
|
44
|
-
return {};
|
|
45
|
-
}
|
|
46
|
-
const elmsToUpdate = new Map();
|
|
47
|
-
return {
|
|
48
|
-
dispose: () => elmsToUpdate.clear(),
|
|
49
|
-
get: (propName) => {
|
|
50
|
-
const elm = getRenderingRef();
|
|
51
|
-
if (elm) {
|
|
52
|
-
appendToMap(elmsToUpdate, propName, elm);
|
|
53
|
-
}
|
|
54
|
-
},
|
|
55
|
-
set: (propName) => {
|
|
56
|
-
const elements = elmsToUpdate.get(propName);
|
|
57
|
-
if (elements) {
|
|
58
|
-
elmsToUpdate.set(propName, elements.filter(forceUpdate));
|
|
59
|
-
}
|
|
60
|
-
cleanupElements(elmsToUpdate);
|
|
61
|
-
},
|
|
62
|
-
reset: () => {
|
|
63
|
-
elmsToUpdate.forEach((elms) => elms.forEach(forceUpdate));
|
|
64
|
-
cleanupElements(elmsToUpdate);
|
|
65
|
-
},
|
|
66
|
-
};
|
|
67
|
-
};
|
|
68
|
-
|
|
69
|
-
const unwrap = (val) => (typeof val === 'function' ? val() : val);
|
|
70
|
-
const createObservableMap = (defaultState, shouldUpdate = (a, b) => a !== b) => {
|
|
71
|
-
const unwrappedState = unwrap(defaultState);
|
|
72
|
-
let states = new Map(Object.entries(unwrappedState !== null && unwrappedState !== void 0 ? unwrappedState : {}));
|
|
73
|
-
const handlers = {
|
|
74
|
-
dispose: [],
|
|
75
|
-
get: [],
|
|
76
|
-
set: [],
|
|
77
|
-
reset: [],
|
|
78
|
-
};
|
|
79
|
-
const reset = () => {
|
|
80
|
-
var _a;
|
|
81
|
-
// When resetting the state, the default state may be a function - unwrap it to invoke it.
|
|
82
|
-
// otherwise, the state won't be properly reset
|
|
83
|
-
states = new Map(Object.entries((_a = unwrap(defaultState)) !== null && _a !== void 0 ? _a : {}));
|
|
84
|
-
handlers.reset.forEach((cb) => cb());
|
|
85
|
-
};
|
|
86
|
-
const dispose = () => {
|
|
87
|
-
// Call first dispose as resetting the state would
|
|
88
|
-
// cause less updates ;)
|
|
89
|
-
handlers.dispose.forEach((cb) => cb());
|
|
90
|
-
reset();
|
|
91
|
-
};
|
|
92
|
-
const get = (propName) => {
|
|
93
|
-
handlers.get.forEach((cb) => cb(propName));
|
|
94
|
-
return states.get(propName);
|
|
95
|
-
};
|
|
96
|
-
const set = (propName, value) => {
|
|
97
|
-
const oldValue = states.get(propName);
|
|
98
|
-
if (shouldUpdate(value, oldValue, propName)) {
|
|
99
|
-
states.set(propName, value);
|
|
100
|
-
handlers.set.forEach((cb) => cb(propName, value, oldValue));
|
|
101
|
-
}
|
|
102
|
-
};
|
|
103
|
-
const state = (typeof Proxy === 'undefined'
|
|
104
|
-
? {}
|
|
105
|
-
: new Proxy(unwrappedState, {
|
|
106
|
-
get(_, propName) {
|
|
107
|
-
return get(propName);
|
|
108
|
-
},
|
|
109
|
-
ownKeys(_) {
|
|
110
|
-
return Array.from(states.keys());
|
|
111
|
-
},
|
|
112
|
-
getOwnPropertyDescriptor() {
|
|
113
|
-
return {
|
|
114
|
-
enumerable: true,
|
|
115
|
-
configurable: true,
|
|
116
|
-
};
|
|
117
|
-
},
|
|
118
|
-
has(_, propName) {
|
|
119
|
-
return states.has(propName);
|
|
120
|
-
},
|
|
121
|
-
set(_, propName, value) {
|
|
122
|
-
set(propName, value);
|
|
123
|
-
return true;
|
|
124
|
-
},
|
|
125
|
-
}));
|
|
126
|
-
const on = (eventName, callback) => {
|
|
127
|
-
handlers[eventName].push(callback);
|
|
128
|
-
return () => {
|
|
129
|
-
removeFromArray(handlers[eventName], callback);
|
|
130
|
-
};
|
|
131
|
-
};
|
|
132
|
-
const onChange = (propName, cb) => {
|
|
133
|
-
const unSet = on('set', (key, newValue) => {
|
|
134
|
-
if (key === propName) {
|
|
135
|
-
cb(newValue);
|
|
136
|
-
}
|
|
137
|
-
});
|
|
138
|
-
// We need to unwrap the defaultState because it might be a function.
|
|
139
|
-
// Otherwise we might not be sending the right reset value.
|
|
140
|
-
const unReset = on('reset', () => cb(unwrap(defaultState)[propName]));
|
|
141
|
-
return () => {
|
|
142
|
-
unSet();
|
|
143
|
-
unReset();
|
|
144
|
-
};
|
|
145
|
-
};
|
|
146
|
-
const use = (...subscriptions) => {
|
|
147
|
-
const unsubs = subscriptions.reduce((unsubs, subscription) => {
|
|
148
|
-
if (subscription.set) {
|
|
149
|
-
unsubs.push(on('set', subscription.set));
|
|
150
|
-
}
|
|
151
|
-
if (subscription.get) {
|
|
152
|
-
unsubs.push(on('get', subscription.get));
|
|
153
|
-
}
|
|
154
|
-
if (subscription.reset) {
|
|
155
|
-
unsubs.push(on('reset', subscription.reset));
|
|
156
|
-
}
|
|
157
|
-
if (subscription.dispose) {
|
|
158
|
-
unsubs.push(on('dispose', subscription.dispose));
|
|
159
|
-
}
|
|
160
|
-
return unsubs;
|
|
161
|
-
}, []);
|
|
162
|
-
return () => unsubs.forEach((unsub) => unsub());
|
|
163
|
-
};
|
|
164
|
-
const forceUpdate = (key) => {
|
|
165
|
-
const oldValue = states.get(key);
|
|
166
|
-
handlers.set.forEach((cb) => cb(key, oldValue, oldValue));
|
|
167
|
-
};
|
|
168
|
-
return {
|
|
169
|
-
state,
|
|
170
|
-
get,
|
|
171
|
-
set,
|
|
172
|
-
on,
|
|
173
|
-
onChange,
|
|
174
|
-
use,
|
|
175
|
-
dispose,
|
|
176
|
-
reset,
|
|
177
|
-
forceUpdate,
|
|
178
|
-
};
|
|
179
|
-
};
|
|
180
|
-
const removeFromArray = (array, item) => {
|
|
181
|
-
const index = array.indexOf(item);
|
|
182
|
-
if (index >= 0) {
|
|
183
|
-
array[index] = array[array.length - 1];
|
|
184
|
-
array.length--;
|
|
185
|
-
}
|
|
186
|
-
};
|
|
187
|
-
|
|
188
|
-
const createStore = (defaultState, shouldUpdate) => {
|
|
189
|
-
const map = createObservableMap(defaultState, shouldUpdate);
|
|
190
|
-
map.use(stencilSubscription());
|
|
191
|
-
return map;
|
|
192
|
-
};
|
|
1
|
+
import { c as createStore } from './index11.js';
|
|
193
2
|
|
|
194
3
|
const store = createStore({
|
|
195
4
|
isLoggedIn: false,
|
|
@@ -197,6 +6,6 @@ const store = createStore({
|
|
|
197
6
|
profile: null
|
|
198
7
|
});
|
|
199
8
|
|
|
200
|
-
export {
|
|
9
|
+
export { store as s };
|
|
201
10
|
|
|
202
11
|
//# sourceMappingURL=session.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"session.js","mappings":";;AAEA,MAAM,WAAW,GAAG,CAAC,GAAG,EAAE,QA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M,GAAG,CAAC,CAAC,CAAC;AAC/C,QAAQ,KAAK,CAAC,MAAM,EAAE,CAAC;AACvB,KAAK;AACL,CAAC,CAAC;AACF;AACK,MAAC,WAAW,GAAG,CAAC,YAAY,EAAE,YAAY,KAAK;AACpD,IAAI,MAAM,GAAG,GAAG,mBAAmB,CAAC,YAAY,EAAE,YAAY,CAAC,CAAC;AAChE,IAAI,GAAG,CAAC,GAAG,CAAC,mBAAmB,EAAE,CAAC,CAAC;AACnC,IAAI,OAAO,GAAG,CAAC;AACf;;MC5LM,KAAK,GAAG,WAAW,CAAC;IACxB,UAAU,EAAE,KAAK;IACjB,KAAK,EAAE,EAAE;IACT,OAAO,EAAE,IAAoB;CAC9B;;;;","names":[],"sources":["../node_modules/@stencil/store/dist/index.mjs","src/store/session.ts"],"sourcesContent":["import { getRenderingRef, forceUpdate } from '@stencil/core';\n\nconst appendToMap = (map, propName, value) => {\n const items = map.get(propName);\n if (!items) {\n map.set(propName, [value]);\n }\n else if (!items.includes(value)) {\n items.push(value);\n }\n};\nconst debounce = (fn, ms) => {\n let timeoutId;\n return (...args) => {\n if (timeoutId) {\n clearTimeout(timeoutId);\n }\n timeoutId = setTimeout(() => {\n timeoutId = 0;\n fn(...args);\n }, ms);\n };\n};\n\n/**\n * Check if a possible element isConnected.\n * The property might not be there, so we check for it.\n *\n * We want it to return true if isConnected is not a property,\n * otherwise we would remove these elements and would not update.\n *\n * Better leak in Edge than to be useless.\n */\nconst isConnected = (maybeElement) => !('isConnected' in maybeElement) || maybeElement.isConnected;\nconst cleanupElements = debounce((map) => {\n for (let key of map.keys()) {\n map.set(key, map.get(key).filter(isConnected));\n }\n}, 2000);\nconst stencilSubscription = () => {\n if (typeof getRenderingRef !== 'function') {\n // If we are not in a stencil project, we do nothing.\n // This function is not really exported by @stencil/core.\n return {};\n }\n const elmsToUpdate = new Map();\n return {\n dispose: () => elmsToUpdate.clear(),\n get: (propName) => {\n const elm = getRenderingRef();\n if (elm) {\n appendToMap(elmsToUpdate, propName, elm);\n }\n },\n set: (propName) => {\n const elements = elmsToUpdate.get(propName);\n if (elements) {\n elmsToUpdate.set(propName, elements.filter(forceUpdate));\n }\n cleanupElements(elmsToUpdate);\n },\n reset: () => {\n elmsToUpdate.forEach((elms) => elms.forEach(forceUpdate));\n cleanupElements(elmsToUpdate);\n },\n };\n};\n\nconst unwrap = (val) => (typeof val === 'function' ? val() : val);\nconst createObservableMap = (defaultState, shouldUpdate = (a, b) => a !== b) => {\n const unwrappedState = unwrap(defaultState);\n let states = new Map(Object.entries(unwrappedState !== null && unwrappedState !== void 0 ? unwrappedState : {}));\n const handlers = {\n dispose: [],\n get: [],\n set: [],\n reset: [],\n };\n const reset = () => {\n var _a;\n // When resetting the state, the default state may be a function - unwrap it to invoke it.\n // otherwise, the state won't be properly reset\n states = new Map(Object.entries((_a = unwrap(defaultState)) !== null && _a !== void 0 ? _a : {}));\n handlers.reset.forEach((cb) => cb());\n };\n const dispose = () => {\n // Call first dispose as resetting the state would\n // cause less updates ;)\n handlers.dispose.forEach((cb) => cb());\n reset();\n };\n const get = (propName) => {\n handlers.get.forEach((cb) => cb(propName));\n return states.get(propName);\n };\n const set = (propName, value) => {\n const oldValue = states.get(propName);\n if (shouldUpdate(value, oldValue, propName)) {\n states.set(propName, value);\n handlers.set.forEach((cb) => cb(propName, value, oldValue));\n }\n };\n const state = (typeof Proxy === 'undefined'\n ? {}\n : new Proxy(unwrappedState, {\n get(_, propName) {\n return get(propName);\n },\n ownKeys(_) {\n return Array.from(states.keys());\n },\n getOwnPropertyDescriptor() {\n return {\n enumerable: true,\n configurable: true,\n };\n },\n has(_, propName) {\n return states.has(propName);\n },\n set(_, propName, value) {\n set(propName, value);\n return true;\n },\n }));\n const on = (eventName, callback) => {\n handlers[eventName].push(callback);\n return () => {\n removeFromArray(handlers[eventName], callback);\n };\n };\n const onChange = (propName, cb) => {\n const unSet = on('set', (key, newValue) => {\n if (key === propName) {\n cb(newValue);\n }\n });\n // We need to unwrap the defaultState because it might be a function.\n // Otherwise we might not be sending the right reset value.\n const unReset = on('reset', () => cb(unwrap(defaultState)[propName]));\n return () => {\n unSet();\n unReset();\n };\n };\n const use = (...subscriptions) => {\n const unsubs = subscriptions.reduce((unsubs, subscription) => {\n if (subscription.set) {\n unsubs.push(on('set', subscription.set));\n }\n if (subscription.get) {\n unsubs.push(on('get', subscription.get));\n }\n if (subscription.reset) {\n unsubs.push(on('reset', subscription.reset));\n }\n if (subscription.dispose) {\n unsubs.push(on('dispose', subscription.dispose));\n }\n return unsubs;\n }, []);\n return () => unsubs.forEach((unsub) => unsub());\n };\n const forceUpdate = (key) => {\n const oldValue = states.get(key);\n handlers.set.forEach((cb) => cb(key, oldValue, oldValue));\n };\n return {\n state,\n get,\n set,\n on,\n onChange,\n use,\n dispose,\n reset,\n forceUpdate,\n };\n};\nconst removeFromArray = (array, item) => {\n const index = array.indexOf(item);\n if (index >= 0) {\n array[index] = array[array.length - 1];\n array.length--;\n }\n};\n\nconst createStore = (defaultState, shouldUpdate) => {\n const map = createObservableMap(defaultState, shouldUpdate);\n map.use(stencilSubscription());\n return map;\n};\n\nexport { createObservableMap, createStore };\n","import { WebIdProfile } from '@pod-os/core';\nimport { createStore } from '@stencil/store';\n\nconst store = createStore({\n isLoggedIn: false,\n webId: '',\n profile: null as WebIdProfile\n});\n\nexport default store;\n"],"version":3}
|
|
1
|
+
{"file":"session.js","mappings":";;MAGM,KAAK,GAAG,WAAW,CAAC;IACxB,UAAU,EAAE,KAAK;IACjB,KAAK,EAAE,EAAE;IACT,OAAO,EAAE,IAAoB;CAC9B;;;;","names":[],"sources":["src/store/session.ts"],"sourcesContent":["import { WebIdProfile } from '@pod-os/core';\nimport { createStore } from '@stencil/store';\n\nconst store = createStore({\n isLoggedIn: false,\n webId: '',\n profile: null as WebIdProfile\n});\n\nexport default store;\n"],"version":3}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { c as createStore } from './index11.js';
|
|
2
|
+
|
|
3
|
+
const storedSettings = localStorage.getItem('settings');
|
|
4
|
+
const initialSettings = storedSettings
|
|
5
|
+
? JSON.parse(storedSettings)
|
|
6
|
+
: {
|
|
7
|
+
offlineCache: false,
|
|
8
|
+
};
|
|
9
|
+
const localSettings = createStore(initialSettings);
|
|
10
|
+
persistChanges();
|
|
11
|
+
syncChangesAcrossTabs();
|
|
12
|
+
function persistChanges() {
|
|
13
|
+
localSettings.on('set', () => {
|
|
14
|
+
const snapshot = JSON.stringify(localSettings.state);
|
|
15
|
+
localStorage.setItem('settings', snapshot);
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
function syncChangesAcrossTabs() {
|
|
19
|
+
window.addEventListener('storage', event => {
|
|
20
|
+
if (event.key === 'settings' && event.newValue) {
|
|
21
|
+
const newSettings = JSON.parse(event.newValue);
|
|
22
|
+
localSettings.state.offlineCache = newSettings.offlineCache;
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export { localSettings as l };
|
|
28
|
+
|
|
29
|
+
//# sourceMappingURL=settings.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"file":"settings.js","mappings":";;AAMA,MAAM,cAAc,GAAG,YAAY,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;AACxD,MAAM,eAAe,GAAG,cAAc;MAClC,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC;MAC1B;QACE,YAAY,EAAE,KAAK;KACpB,CAAC;MAEO,aAAa,GAAG,WAAW,CAAgB,eAAe,EAAE;AAEzE,cAAc,EAAE,CAAC;AACjB,qBAAqB,EAAE,CAAC;AAExB,SAAS,cAAc;IACrB,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE;QACtB,MAAM,QAAQ,GAAG,IAAI,CAAC,SAAS,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;QACrD,YAAY,CAAC,OAAO,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC;KAC5C,CAAC,CAAC;AACL,CAAC;AACD,SAAS,qBAAqB;IAC5B,MAAM,CAAC,gBAAgB,CAAC,SAAS,EAAE,KAAK;QACtC,IAAI,KAAK,CAAC,GAAG,KAAK,UAAU,IAAI,KAAK,CAAC,QAAQ,EAAE;YAC9C,MAAM,WAAW,GAAkB,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;YAC9D,aAAa,CAAC,KAAK,CAAC,YAAY,GAAG,WAAW,CAAC,YAAY,CAAC;SAC7D;KACF,CAAC,CAAC;AACL;;;;","names":[],"sources":["src/store/settings.ts"],"sourcesContent":["import { createStore } from '@stencil/store';\n\nexport interface LocalSettings {\n offlineCache: boolean;\n}\n\nconst storedSettings = localStorage.getItem('settings');\nconst initialSettings = storedSettings\n ? JSON.parse(storedSettings)\n : {\n offlineCache: false,\n };\n\nexport const localSettings = createStore<LocalSettings>(initialSettings);\n\npersistChanges();\nsyncChangesAcrossTabs();\n\nfunction persistChanges() {\n localSettings.on('set', () => {\n const snapshot = JSON.stringify(localSettings.state);\n localStorage.setItem('settings', snapshot);\n });\n}\nfunction syncChangesAcrossTabs() {\n window.addEventListener('storage', event => {\n if (event.key === 'settings' && event.newValue) {\n const newSettings: LocalSettings = JSON.parse(event.newValue);\n localSettings.state.offlineCache = newSettings.offlineCache;\n }\n });\n}\n"],"version":3}
|