proto-daisy-db 0.0.2

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.
Files changed (66) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +6 -0
  3. package/dist/cjs/index-69b24cc8.js +1141 -0
  4. package/dist/cjs/index.cjs.js +2 -0
  5. package/dist/cjs/loader.cjs.js +21 -0
  6. package/dist/cjs/proto-daisy-db.cjs.js +19 -0
  7. package/dist/cjs/proto-daisy-db_4.cjs.entry.js +137 -0
  8. package/dist/collection/collection-manifest.json +15 -0
  9. package/dist/collection/components/proto-daisy-db/proto-daisy-db.css +0 -0
  10. package/dist/collection/components/proto-daisy-db/proto-daisy-db.js +60 -0
  11. package/dist/collection/components/proto-faux-keys/proto-faux-keys.css +0 -0
  12. package/dist/collection/components/proto-faux-keys/proto-faux-keys.js +35 -0
  13. package/dist/collection/components/proto-faux-stamp/proto-faux-stamp.css +0 -0
  14. package/dist/collection/components/proto-faux-stamp/proto-faux-stamp.js +36 -0
  15. package/dist/collection/components/proto-faux-trigger/proto-faux-trigger.css +189 -0
  16. package/dist/collection/components/proto-faux-trigger/proto-faux-trigger.js +84 -0
  17. package/dist/collection/index.js +1 -0
  18. package/dist/collection/utils/bag.js +25 -0
  19. package/dist/collection/utils/index.js +2 -0
  20. package/dist/collection/utils/tw-version.js +4 -0
  21. package/dist/components/index.d.ts +25 -0
  22. package/dist/components/index.js +5 -0
  23. package/dist/components/proto-daisy-db.d.ts +11 -0
  24. package/dist/components/proto-daisy-db.js +82 -0
  25. package/dist/components/proto-faux-keys.d.ts +11 -0
  26. package/dist/components/proto-faux-keys.js +6 -0
  27. package/dist/components/proto-faux-keys2.js +33 -0
  28. package/dist/components/proto-faux-stamp.d.ts +11 -0
  29. package/dist/components/proto-faux-stamp.js +6 -0
  30. package/dist/components/proto-faux-stamp2.js +33 -0
  31. package/dist/components/proto-faux-trigger.d.ts +11 -0
  32. package/dist/components/proto-faux-trigger.js +75 -0
  33. package/dist/esm/index-1d7e6324.js +1116 -0
  34. package/dist/esm/index.js +1 -0
  35. package/dist/esm/loader.js +17 -0
  36. package/dist/esm/polyfills/core-js.js +11 -0
  37. package/dist/esm/polyfills/css-shim.js +1 -0
  38. package/dist/esm/polyfills/dom.js +79 -0
  39. package/dist/esm/polyfills/es5-html-element.js +1 -0
  40. package/dist/esm/polyfills/index.js +34 -0
  41. package/dist/esm/polyfills/system.js +6 -0
  42. package/dist/esm/proto-daisy-db.js +17 -0
  43. package/dist/esm/proto-daisy-db_4.entry.js +130 -0
  44. package/dist/index.cjs.js +1 -0
  45. package/dist/index.js +1 -0
  46. package/dist/proto-daisy-db/index.esm.js +0 -0
  47. package/dist/proto-daisy-db/p-05fdda3d.entry.js +1 -0
  48. package/dist/proto-daisy-db/p-39bf50a0.js +2 -0
  49. package/dist/proto-daisy-db/proto-daisy-db.esm.js +1 -0
  50. package/dist/types/components/proto-daisy-db/proto-daisy-db.d.ts +5 -0
  51. package/dist/types/components/proto-faux-keys/proto-faux-keys.d.ts +4 -0
  52. package/dist/types/components/proto-faux-stamp/proto-faux-stamp.d.ts +4 -0
  53. package/dist/types/components/proto-faux-trigger/proto-faux-trigger.d.ts +8 -0
  54. package/dist/types/components.d.ts +86 -0
  55. package/dist/types/index.d.ts +1 -0
  56. package/dist/types/stencil-public-runtime.d.ts +1565 -0
  57. package/dist/types/utils/bag.d.ts +6 -0
  58. package/dist/types/utils/index.d.ts +2 -0
  59. package/dist/types/utils/tw-version.d.ts +3 -0
  60. package/loader/cdn.js +3 -0
  61. package/loader/index.cjs.js +3 -0
  62. package/loader/index.d.ts +12 -0
  63. package/loader/index.es2017.js +3 -0
  64. package/loader/index.js +4 -0
  65. package/loader/package.json +10 -0
  66. package/package.json +50 -0
@@ -0,0 +1,11 @@
1
+ import type { Components, JSX } from "../types/components";
2
+
3
+ interface ProtoDaisyDb extends Components.ProtoDaisyDb, HTMLElement {}
4
+ export const ProtoDaisyDb: {
5
+ prototype: ProtoDaisyDb;
6
+ new (): ProtoDaisyDb;
7
+ };
8
+ /**
9
+ * Used to define this component and all nested components recursively.
10
+ */
11
+ export const defineCustomElement: () => void;
@@ -0,0 +1,82 @@
1
+ import { proxyCustomElement, HTMLElement, h } from '@stencil/core/internal/client';
2
+
3
+ const KEY = 'proto-daisy-db:app-data';
4
+ const promisedParseJSON = (json) => {
5
+ return new Promise((resolve, reject) => {
6
+ try {
7
+ resolve(JSON.parse(json));
8
+ }
9
+ catch (e) {
10
+ reject(e);
11
+ }
12
+ });
13
+ };
14
+ // localStorage implementation... [ generic storage ]
15
+ const bag = {
16
+ get: () => {
17
+ const json = localStorage.getItem(KEY);
18
+ return promisedParseJSON(json);
19
+ },
20
+ store: (data) => {
21
+ // NOTE: this assumes you're passing REAL data, not a proxy...
22
+ const json = JSON.stringify(data);
23
+ localStorage.setItem(KEY, json);
24
+ },
25
+ };
26
+
27
+ const protoDaisyDbCss = "";
28
+
29
+ const ProtoDaisyDB = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
30
+ constructor() {
31
+ super();
32
+ this.__registerHost();
33
+ this.__attachShadow();
34
+ this.emitter = undefined;
35
+ }
36
+ componentDidLoad() {
37
+ if (this.emitter && window[this.emitter]) {
38
+ const emitter = window[this.emitter];
39
+ emitter.on('app-data:get', _e => {
40
+ console.log('app-data:get');
41
+ bag
42
+ .get()
43
+ .then(value => {
44
+ emitter.emit('app-data:value', value);
45
+ })
46
+ .catch(reason => {
47
+ console.log(reason);
48
+ });
49
+ });
50
+ emitter.on('app-data:store', e => {
51
+ console.log('app-data:store', e);
52
+ bag.store(e);
53
+ });
54
+ const data = { ready: true };
55
+ emitter.emit('proto-daisy-db', data);
56
+ }
57
+ }
58
+ render() {
59
+ return h("div", null);
60
+ }
61
+ static get style() { return protoDaisyDbCss; }
62
+ }, [1, "proto-daisy-db", {
63
+ "emitter": [1]
64
+ }]);
65
+ function defineCustomElement$1() {
66
+ if (typeof customElements === "undefined") {
67
+ return;
68
+ }
69
+ const components = ["proto-daisy-db"];
70
+ components.forEach(tagName => { switch (tagName) {
71
+ case "proto-daisy-db":
72
+ if (!customElements.get(tagName)) {
73
+ customElements.define(tagName, ProtoDaisyDB);
74
+ }
75
+ break;
76
+ } });
77
+ }
78
+
79
+ const ProtoDaisyDb = ProtoDaisyDB;
80
+ const defineCustomElement = defineCustomElement$1;
81
+
82
+ export { ProtoDaisyDb, defineCustomElement };
@@ -0,0 +1,11 @@
1
+ import type { Components, JSX } from "../types/components";
2
+
3
+ interface ProtoFauxKeys extends Components.ProtoFauxKeys, HTMLElement {}
4
+ export const ProtoFauxKeys: {
5
+ prototype: ProtoFauxKeys;
6
+ new (): ProtoFauxKeys;
7
+ };
8
+ /**
9
+ * Used to define this component and all nested components recursively.
10
+ */
11
+ export const defineCustomElement: () => void;
@@ -0,0 +1,6 @@
1
+ import { P as ProtoFauxKeys$1, d as defineCustomElement$1 } from './proto-faux-keys2.js';
2
+
3
+ const ProtoFauxKeys = ProtoFauxKeys$1;
4
+ const defineCustomElement = defineCustomElement$1;
5
+
6
+ export { ProtoFauxKeys, defineCustomElement };
@@ -0,0 +1,33 @@
1
+ import { proxyCustomElement, HTMLElement, h } from '@stencil/core/internal/client';
2
+
3
+ const protoFauxKeysCss = "";
4
+
5
+ const ProtoFauxKeys = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
6
+ constructor() {
7
+ super();
8
+ this.__registerHost();
9
+ this.data = undefined;
10
+ }
11
+ render() {
12
+ const keys = this.data ? Object.keys(this.data) : [];
13
+ return (h("div", { class: "flex flex-col" }, keys.map(key => (h("span", null, key)))));
14
+ }
15
+ static get style() { return protoFauxKeysCss; }
16
+ }, [0, "proto-faux-keys", {
17
+ "data": [16]
18
+ }]);
19
+ function defineCustomElement() {
20
+ if (typeof customElements === "undefined") {
21
+ return;
22
+ }
23
+ const components = ["proto-faux-keys"];
24
+ components.forEach(tagName => { switch (tagName) {
25
+ case "proto-faux-keys":
26
+ if (!customElements.get(tagName)) {
27
+ customElements.define(tagName, ProtoFauxKeys);
28
+ }
29
+ break;
30
+ } });
31
+ }
32
+
33
+ export { ProtoFauxKeys as P, defineCustomElement as d };
@@ -0,0 +1,11 @@
1
+ import type { Components, JSX } from "../types/components";
2
+
3
+ interface ProtoFauxStamp extends Components.ProtoFauxStamp, HTMLElement {}
4
+ export const ProtoFauxStamp: {
5
+ prototype: ProtoFauxStamp;
6
+ new (): ProtoFauxStamp;
7
+ };
8
+ /**
9
+ * Used to define this component and all nested components recursively.
10
+ */
11
+ export const defineCustomElement: () => void;
@@ -0,0 +1,6 @@
1
+ import { P as ProtoFauxStamp$1, d as defineCustomElement$1 } from './proto-faux-stamp2.js';
2
+
3
+ const ProtoFauxStamp = ProtoFauxStamp$1;
4
+ const defineCustomElement = defineCustomElement$1;
5
+
6
+ export { ProtoFauxStamp, defineCustomElement };
@@ -0,0 +1,33 @@
1
+ import { proxyCustomElement, HTMLElement, h } from '@stencil/core/internal/client';
2
+
3
+ const protoFauxStampCss = "";
4
+
5
+ const ProtoFauxStamp = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
6
+ constructor() {
7
+ super();
8
+ this.__registerHost();
9
+ this.data = undefined;
10
+ }
11
+ render() {
12
+ const stamp = this.data ? this.data['stamp'] : '';
13
+ return (h("div", { class: "flex" }, h("span", null, stamp)));
14
+ }
15
+ static get style() { return protoFauxStampCss; }
16
+ }, [0, "proto-faux-stamp", {
17
+ "data": [16]
18
+ }]);
19
+ function defineCustomElement() {
20
+ if (typeof customElements === "undefined") {
21
+ return;
22
+ }
23
+ const components = ["proto-faux-stamp"];
24
+ components.forEach(tagName => { switch (tagName) {
25
+ case "proto-faux-stamp":
26
+ if (!customElements.get(tagName)) {
27
+ customElements.define(tagName, ProtoFauxStamp);
28
+ }
29
+ break;
30
+ } });
31
+ }
32
+
33
+ export { ProtoFauxStamp as P, defineCustomElement as d };
@@ -0,0 +1,11 @@
1
+ import type { Components, JSX } from "../types/components";
2
+
3
+ interface ProtoFauxTrigger extends Components.ProtoFauxTrigger, HTMLElement {}
4
+ export const ProtoFauxTrigger: {
5
+ prototype: ProtoFauxTrigger;
6
+ new (): ProtoFauxTrigger;
7
+ };
8
+ /**
9
+ * Used to define this component and all nested components recursively.
10
+ */
11
+ export const defineCustomElement: () => void;
@@ -0,0 +1,75 @@
1
+ import { proxyCustomElement, HTMLElement, h } from '@stencil/core/internal/client';
2
+ import { d as defineCustomElement$3 } from './proto-faux-keys2.js';
3
+ import { d as defineCustomElement$2 } from './proto-faux-stamp2.js';
4
+
5
+ const protoFauxTriggerCss = "*,::before,::after{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-scroll-snap-strictness:proximity;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgb(59 130 246 / 0.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;}::-webkit-backdrop{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-scroll-snap-strictness:proximity;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgb(59 130 246 / 0.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;}::backdrop{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-scroll-snap-strictness:proximity;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgb(59 130 246 / 0.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;}.mt-4{margin-top:1rem}.mt-2{margin-top:0.5rem}.flex{display:flex}.flex-row{flex-direction:row}.flex-col{flex-direction:column}.content-center{align-content:center}.gap-2{gap:0.5rem}.font-sans{font-family:ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,\n 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans', sans-serif,\n 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji'}.text-xs{font-size:0.75rem;line-height:1rem}.shadow{--tw-shadow:0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);--tw-shadow-colored:0 1px 3px 0 var(--tw-shadow-color),\n 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),\n var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)}";
6
+
7
+ const ProtoFauxTrigger$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
8
+ constructor() {
9
+ super();
10
+ this.__registerHost();
11
+ this.emitter = undefined;
12
+ this.data = undefined;
13
+ }
14
+ componentDidLoad() {
15
+ if (this.emitter && window[this.emitter]) {
16
+ const emitter = window[this.emitter];
17
+ emitter.on('app-data:value', e => {
18
+ this.data = e;
19
+ });
20
+ }
21
+ }
22
+ emitData() {
23
+ if (this.emitter && window[this.emitter]) {
24
+ const emitter = window[this.emitter];
25
+ const login = true;
26
+ const stamp = Date.now();
27
+ const theme = 'dark';
28
+ const dealers = [];
29
+ const data = { login, stamp, theme, dealers };
30
+ this.data = undefined;
31
+ emitter.emit('app-data:store', data);
32
+ }
33
+ }
34
+ fetchData() {
35
+ if (this.emitter && window[this.emitter]) {
36
+ const emitter = window[this.emitter];
37
+ emitter.emit('app-data:get', 42);
38
+ }
39
+ }
40
+ render() {
41
+ return (h("div", { class: "flex flex-col font-sans" }, h("div", { class: "flex flex-row content-center gap-2" }, h("button", { onClick: () => this.emitData() }, "Save"), h("button", { onClick: () => this.fetchData() }, "Fetch")), h("proto-faux-stamp", { class: "mt-4 text-xs", data: this.data }), h("proto-faux-keys", { class: "mt-2", data: this.data })));
42
+ }
43
+ static get style() { return protoFauxTriggerCss; }
44
+ }, [0, "proto-faux-trigger", {
45
+ "emitter": [1],
46
+ "data": [1040]
47
+ }]);
48
+ function defineCustomElement$1() {
49
+ if (typeof customElements === "undefined") {
50
+ return;
51
+ }
52
+ const components = ["proto-faux-trigger", "proto-faux-keys", "proto-faux-stamp"];
53
+ components.forEach(tagName => { switch (tagName) {
54
+ case "proto-faux-trigger":
55
+ if (!customElements.get(tagName)) {
56
+ customElements.define(tagName, ProtoFauxTrigger$1);
57
+ }
58
+ break;
59
+ case "proto-faux-keys":
60
+ if (!customElements.get(tagName)) {
61
+ defineCustomElement$3();
62
+ }
63
+ break;
64
+ case "proto-faux-stamp":
65
+ if (!customElements.get(tagName)) {
66
+ defineCustomElement$2();
67
+ }
68
+ break;
69
+ } });
70
+ }
71
+
72
+ const ProtoFauxTrigger = ProtoFauxTrigger$1;
73
+ const defineCustomElement = defineCustomElement$1;
74
+
75
+ export { ProtoFauxTrigger, defineCustomElement };