proto-tinker-wc 0.0.1

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 (75) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +25 -0
  3. package/dist/cjs/index-cea62b03.js +1176 -0
  4. package/dist/cjs/index.cjs.js +2 -0
  5. package/dist/cjs/loader.cjs.js +21 -0
  6. package/dist/cjs/proto-tinker-wc.cjs.js +19 -0
  7. package/dist/cjs/proto-tinker.cjs.entry.js +2524 -0
  8. package/dist/collection/collection-manifest.json +12 -0
  9. package/dist/collection/components/proto-tinker/chevron-double-left.js +14 -0
  10. package/dist/collection/components/proto-tinker/close.js +14 -0
  11. package/dist/collection/components/proto-tinker/color-picker.js +16 -0
  12. package/dist/collection/components/proto-tinker/data-source.js +25 -0
  13. package/dist/collection/components/proto-tinker/data-values.js +17 -0
  14. package/dist/collection/components/proto-tinker/eswat2-io.js +10 -0
  15. package/dist/collection/components/proto-tinker/fingerprint.js +14 -0
  16. package/dist/collection/components/proto-tinker/proto-tinker.css +152 -0
  17. package/dist/collection/components/proto-tinker/proto-tinker.js +46 -0
  18. package/dist/collection/components/proto-tinker/radio.js +15 -0
  19. package/dist/collection/components/proto-tinker/refresh.js +14 -0
  20. package/dist/collection/components/proto-tinker/tw-label.js +9 -0
  21. package/dist/collection/index.js +1 -0
  22. package/dist/collection/utils/color-plugin.js +36 -0
  23. package/dist/collection/utils/funnel-defs.js +10 -0
  24. package/dist/collection/utils/index.js +5 -0
  25. package/dist/collection/utils/named-colors.js +51 -0
  26. package/dist/collection/utils/store.js +25 -0
  27. package/dist/collection/utils/types.js +1 -0
  28. package/dist/components/index.d.ts +26 -0
  29. package/dist/components/index.js +1 -0
  30. package/dist/components/proto-tinker.d.ts +11 -0
  31. package/dist/components/proto-tinker.js +2541 -0
  32. package/dist/esm/index-b22d500f.js +1149 -0
  33. package/dist/esm/index.js +1 -0
  34. package/dist/esm/loader.js +17 -0
  35. package/dist/esm/polyfills/core-js.js +11 -0
  36. package/dist/esm/polyfills/css-shim.js +1 -0
  37. package/dist/esm/polyfills/dom.js +79 -0
  38. package/dist/esm/polyfills/es5-html-element.js +1 -0
  39. package/dist/esm/polyfills/index.js +34 -0
  40. package/dist/esm/polyfills/system.js +6 -0
  41. package/dist/esm/proto-tinker-wc.js +17 -0
  42. package/dist/esm/proto-tinker.entry.js +2520 -0
  43. package/dist/index.cjs.js +1 -0
  44. package/dist/index.js +1 -0
  45. package/dist/proto-tinker-wc/index.esm.js +0 -0
  46. package/dist/proto-tinker-wc/p-18633a0f.entry.js +1 -0
  47. package/dist/proto-tinker-wc/p-b3c235a0.js +1 -0
  48. package/dist/proto-tinker-wc/proto-tinker-wc.esm.js +1 -0
  49. package/dist/types/components/proto-tinker/chevron-double-left.d.ts +5 -0
  50. package/dist/types/components/proto-tinker/close.d.ts +5 -0
  51. package/dist/types/components/proto-tinker/color-picker.d.ts +4 -0
  52. package/dist/types/components/proto-tinker/data-source.d.ts +4 -0
  53. package/dist/types/components/proto-tinker/data-values.d.ts +4 -0
  54. package/dist/types/components/proto-tinker/eswat2-io.d.ts +4 -0
  55. package/dist/types/components/proto-tinker/fingerprint.d.ts +5 -0
  56. package/dist/types/components/proto-tinker/proto-tinker.d.ts +4 -0
  57. package/dist/types/components/proto-tinker/radio.d.ts +5 -0
  58. package/dist/types/components/proto-tinker/refresh.d.ts +5 -0
  59. package/dist/types/components/proto-tinker/tw-label.d.ts +4 -0
  60. package/dist/types/components.d.ts +39 -0
  61. package/dist/types/index.d.ts +1 -0
  62. package/dist/types/stencil-public-runtime.d.ts +1563 -0
  63. package/dist/types/utils/color-plugin.d.ts +14 -0
  64. package/dist/types/utils/funnel-defs.d.ts +5 -0
  65. package/dist/types/utils/index.d.ts +5 -0
  66. package/dist/types/utils/named-colors.d.ts +24 -0
  67. package/dist/types/utils/store.d.ts +5 -0
  68. package/dist/types/utils/types.d.ts +42 -0
  69. package/loader/cdn.js +3 -0
  70. package/loader/index.cjs.js +3 -0
  71. package/loader/index.d.ts +12 -0
  72. package/loader/index.es2017.js +3 -0
  73. package/loader/index.js +4 -0
  74. package/loader/package.json +10 -0
  75. package/package.json +46 -0
@@ -0,0 +1,12 @@
1
+ {
2
+ "entries": [
3
+ "./components/proto-tinker/proto-tinker.js"
4
+ ],
5
+ "compiler": {
6
+ "name": "@stencil/core",
7
+ "version": "2.12.0",
8
+ "typescriptVersion": "4.3.5"
9
+ },
10
+ "collections": [],
11
+ "bundles": []
12
+ }
@@ -0,0 +1,14 @@
1
+ import { h } from '@stencil/core';
2
+ const ChevronDoubleLeft = props => {
3
+ const hex = props.hex || 'currentColor';
4
+ const klass = props.class;
5
+ const label = props.label || 'chevron-double-left';
6
+ const size = props.size || 24;
7
+ return (h("svg", { class: klass, width: size, height: size, viewBox: "0 0 24 24", role: "img", "aria-label": "title" },
8
+ h("title", null, label),
9
+ h("g", { fill: hex },
10
+ h("path", { d: "M18.41,7.41L17,6L11,12L17,18L18.41,16.59L13.83,12L18.41,7.41M12.41,7.41L11,6L5,12L11,18L12.41,16.59L7.83,12L12.41,7.41Z" })),
11
+ h("path", { d: "M0 0h24v24H0z", fill: "none" })));
12
+ };
13
+ export { ChevronDoubleLeft };
14
+ export default ChevronDoubleLeft;
@@ -0,0 +1,14 @@
1
+ import { h } from '@stencil/core';
2
+ const Close = props => {
3
+ const hex = props.hex || 'currentColor';
4
+ const klass = props.class;
5
+ const label = props.label || 'close';
6
+ const size = props.size || 24;
7
+ return (h("svg", { class: klass, width: size, height: size, viewBox: "0 0 24 24", role: "img", "aria-label": "title" },
8
+ h("title", null, label),
9
+ h("g", { fill: hex },
10
+ h("path", { d: "M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z" })),
11
+ h("path", { d: "M0 0h24v24H0z", fill: "none" })));
12
+ };
13
+ export { Close };
14
+ export default Close;
@@ -0,0 +1,16 @@
1
+ import { h } from '@stencil/core';
2
+ import { Radio } from './radio';
3
+ import { colorKeys, colorFor, store, actions } from '../../utils';
4
+ const ColorPicker = _props => {
5
+ const { pick } = store.state;
6
+ return (h("div", { id: "toolbar", class: "flex flex-wrap", role: "radiogroup" }, colorKeys.map((key) => {
7
+ const hex = colorFor(key);
8
+ const selected = pick == key;
9
+ return (h("div", { "aria-label": key, role: "radio", title: key, onClick: () => {
10
+ actions.updatePick(key);
11
+ } },
12
+ h(Radio, { hex: hex, selected: selected })));
13
+ })));
14
+ };
15
+ export { ColorPicker };
16
+ export default ColorPicker;
@@ -0,0 +1,25 @@
1
+ import { h } from '@stencil/core';
2
+ import { ChevronDoubleLeft } from './chevron-double-left';
3
+ import { Close } from './close';
4
+ import { Refresh } from './refresh';
5
+ import { store, actions } from '../../utils';
6
+ const help = 'click a button... ';
7
+ const DataSource = _props => {
8
+ const { count } = store.state;
9
+ return (h("div", { class: "flex mt-3 mb-10px items-center" },
10
+ h("button", { "aria-label": "Refresh", title: "Refresh", class: "ds1-button data-button bg-clrs-blue", onClick: () => {
11
+ actions.refresh();
12
+ } },
13
+ h(Refresh, null)),
14
+ h("button", { "aria-label": "Reset", title: "Reset", class: "ds1-button data-button bg-clrs-red", onClick: () => {
15
+ actions.reset();
16
+ } },
17
+ h(Close, null)),
18
+ h("span", { class: "flex items-center" },
19
+ h(ChevronDoubleLeft, { size: 28 }),
20
+ h("span", { class: "italic" },
21
+ help,
22
+ h("sup", null, count)))));
23
+ };
24
+ export { DataSource };
25
+ export default DataSource;
@@ -0,0 +1,17 @@
1
+ import { h } from '@stencil/core';
2
+ import { TwLabel } from './tw-label';
3
+ import { store } from '../../utils';
4
+ const DataValues = _props => {
5
+ const { values, pick, count } = store.state;
6
+ return (h("div", { class: "flex" },
7
+ h("div", { class: "flex flex-col" },
8
+ h("div", { class: "flex" },
9
+ h("span", { class: "font-bold mr-10px" }, "color:"),
10
+ h("span", { class: "italic text-clrs-slate4" }, pick)),
11
+ h("div", { class: "flex mt-5px" },
12
+ h("span", { class: "font-bold mr-10px" }, "sample:"),
13
+ h("span", { class: "italic text-clrs-slate4" }, `${count > 0 ? values : '...'}`))),
14
+ h(TwLabel, null)));
15
+ };
16
+ export { DataValues };
17
+ export default DataValues;
@@ -0,0 +1,10 @@
1
+ import { h } from '@stencil/core';
2
+ import { Fingerprint } from './fingerprint';
3
+ const url = 'https://eswat2.dev';
4
+ const who = 'eswat2';
5
+ const Eswat2Io = _props => {
6
+ return (h("a", { class: "absolute top-8 right-8 text-clrs-gray hover:text-clrs-navy", href: url, "aria-label": who, title: who },
7
+ h(Fingerprint, { label: "eswat2" })));
8
+ };
9
+ export { Eswat2Io };
10
+ export default Eswat2Io;
@@ -0,0 +1,14 @@
1
+ import { h } from '@stencil/core';
2
+ const Fingerprint = props => {
3
+ const hex = props.hex || 'currentColor';
4
+ const klass = props.class;
5
+ const label = props.label || 'fingerprint';
6
+ const size = props.size || 24;
7
+ return (h("svg", { class: klass, width: size, height: size, viewBox: "0 0 24 24", role: "img", "aria-label": "title" },
8
+ h("title", null, label),
9
+ h("g", { fill: hex },
10
+ h("path", { d: "M17.81,4.47C17.73,4.47 17.65,4.45 17.58,4.41C15.66,3.42 14,3\n 12,3C10.03,3 8.15,3.47 6.44,4.41C6.2,4.54 5.9,4.45 5.76,4.21C5.63,3.97\n 5.72,3.66 5.96,3.53C7.82,2.5 9.86,2 12,2C14.14,2 16,2.47\n 18.04,3.5C18.29,3.65 18.38,3.95 18.25,4.19C18.16,4.37 18,4.47\n 17.81,4.47M3.5,9.72C3.4,9.72 3.3,9.69 3.21,9.63C3,9.47 2.93,9.16\n 3.09,8.93C4.08,7.53 5.34,6.43 6.84,5.66C10,4.04 14,4.03\n 17.15,5.65C18.65,6.42 19.91,7.5 20.9,8.9C21.06,9.12 21,9.44\n 20.78,9.6C20.55,9.76 20.24,9.71 20.08,9.5C19.18,8.22 18.04,7.23\n 16.69,6.54C13.82,5.07 10.15,5.07 7.29,6.55C5.93,7.25 4.79,8.25\n 3.89,9.5C3.81,9.65 3.66,9.72 3.5,9.72M9.75,21.79C9.62,21.79 9.5,21.74\n 9.4,21.64C8.53,20.77 8.06,20.21 7.39,19C6.7,17.77 6.34,16.27\n 6.34,14.66C6.34,11.69 8.88,9.27 12,9.27C15.12,9.27 17.66,11.69\n 17.66,14.66A0.5,0.5 0 0,1 17.16,15.16A0.5,0.5 0 0,1\n 16.66,14.66C16.66,12.24 14.57,10.27 12,10.27C9.43,10.27 7.34,12.24\n 7.34,14.66C7.34,16.1 7.66,17.43 8.27,18.5C8.91,19.66 9.35,20.15\n 10.12,20.93C10.31,21.13 10.31,21.44 10.12,21.64C10,21.74 9.88,21.79\n 9.75,21.79M16.92,19.94C15.73,19.94 14.68,19.64 13.82,19.05C12.33,18.04\n 11.44,16.4 11.44,14.66A0.5,0.5 0 0,1 11.94,14.16A0.5,0.5 0 0,1\n 12.44,14.66C12.44,16.07 13.16,17.4 14.38,18.22C15.09,18.7 15.92,18.93\n 16.92,18.93C17.16,18.93 17.56,18.9 17.96,18.83C18.23,18.78 18.5,18.96\n 18.54,19.24C18.59,19.5 18.41,19.77 18.13,19.82C17.56,19.93 17.06,19.94\n 16.92,19.94M14.91,22C14.87,22 14.82,22 14.78,22C13.19,21.54 12.15,20.95\n 11.06,19.88C9.66,18.5 8.89,16.64 8.89,14.66C8.89,13.04 10.27,11.72\n 11.97,11.72C13.67,11.72 15.05,13.04 15.05,14.66C15.05,15.73 16,16.6\n 17.13,16.6C18.28,16.6 19.21,15.73 19.21,14.66C19.21,10.89 15.96,7.83\n 11.96,7.83C9.12,7.83 6.5,9.41 5.35,11.86C4.96,12.67 4.76,13.62\n 4.76,14.66C4.76,15.44 4.83,16.67 5.43,18.27C5.53,18.53 5.4,18.82\n 5.14,18.91C4.88,19 4.59,18.87 4.5,18.62C4,17.31 3.77,16\n 3.77,14.66C3.77,13.46 4,12.37 4.45,11.42C5.78,8.63 8.73,6.82\n 11.96,6.82C16.5,6.82 20.21,10.33 20.21,14.65C20.21,16.27 18.83,17.59\n 17.13,17.59C15.43,17.59 14.05,16.27 14.05,14.65C14.05,13.58 13.12,12.71\n 11.97,12.71C10.82,12.71 9.89,13.58 9.89,14.65C9.89,16.36 10.55,17.96\n 11.76,19.16C12.71,20.1 13.62,20.62 15.03,21C15.3,21.08 15.45,21.36\n 15.38,21.62C15.33,21.85 15.12,22 14.91,22Z" })),
11
+ h("path", { d: "M0 0h24v24H0z", fill: "none" })));
12
+ };
13
+ export { Fingerprint };
14
+ export default Fingerprint;
@@ -0,0 +1,152 @@
1
+ *,
2
+ ::before,
3
+ ::after {
4
+ --tw-ring-offset-shadow: 0 0 #0000;
5
+ --tw-ring-shadow: 0 0 #0000;
6
+ --tw-shadow: 0 0 #0000;
7
+ --tw-shadow-colored: 0 0 #0000;
8
+ }
9
+
10
+ .ds1-main {
11
+ display: flex;
12
+ flex-direction: column;
13
+ padding: 1rem;
14
+ font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
15
+ 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans', sans-serif,
16
+ 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji';
17
+ color: var(--clrs-navy, #001f3f);
18
+ -webkit-font-smoothing: antialiased;
19
+ -moz-osx-font-smoothing: grayscale;
20
+ }
21
+
22
+ .ds1-button {
23
+ display: flex;
24
+ align-items: center;
25
+ border-style: solid;
26
+ border-color: var(--clrs-slate, #708090);
27
+ color: var(--clrs-white, #ffffff);
28
+ }
29
+
30
+ .ds1-button:active {
31
+ background-color: var(--clrs-gray, #aaaaaa);
32
+ color: var(--clrs-navy, #001f3f);
33
+ }
34
+
35
+ .absolute {
36
+ position: absolute;
37
+ }
38
+
39
+ .top-8 {
40
+ top: 2rem;
41
+ }
42
+
43
+ .right-8 {
44
+ right: 2rem;
45
+ }
46
+
47
+ .mt-3 {
48
+ margin-top: 0.75rem;
49
+ }
50
+
51
+ .mb-10px {
52
+ margin-bottom: 10px;
53
+ }
54
+
55
+ .mr-10px {
56
+ margin-right: 10px;
57
+ }
58
+
59
+ .mt-5px {
60
+ margin-top: 5px;
61
+ }
62
+
63
+ .mr-0 {
64
+ margin-right: 0px;
65
+ }
66
+
67
+ .ml-0 {
68
+ margin-left: 0px;
69
+ }
70
+
71
+ .ml-auto {
72
+ margin-left: auto;
73
+ }
74
+
75
+ .flex {
76
+ display: flex;
77
+ }
78
+
79
+ .flex-col {
80
+ flex-direction: column;
81
+ }
82
+
83
+ .flex-wrap {
84
+ flex-wrap: wrap;
85
+ }
86
+
87
+ .items-center {
88
+ align-items: center;
89
+ }
90
+
91
+ .bg-clrs-blue {
92
+ background-color: var(--clrs-blue, #0074d9);
93
+ }
94
+
95
+ .bg-clrs-red {
96
+ background-color: var(--clrs-red, #ff4136);
97
+ }
98
+
99
+ .align-top {
100
+ vertical-align: top;
101
+ }
102
+
103
+ .text-xs {
104
+ font-size: 0.75rem;
105
+ line-height: 1rem;
106
+ }
107
+
108
+ .font-bold {
109
+ font-weight: 700;
110
+ }
111
+
112
+ .italic {
113
+ font-style: italic;
114
+ }
115
+
116
+ .text-clrs-slate4 {
117
+ color: var(--clrs-slate4, #4e5964);
118
+ }
119
+
120
+ .text-clrs-gray {
121
+ color: var(--clrs-gray, #aaaaaa);
122
+ }
123
+
124
+ .shadow {
125
+ --tw-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
126
+ --tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color),
127
+ 0 1px 2px -1px var(--tw-shadow-color);
128
+ box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000),
129
+ var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);
130
+ }
131
+
132
+ .data-button {
133
+ border-radius: 5px;
134
+ border-width: 1px;
135
+ padding: 5px;
136
+ margin: 0px;
137
+ margin-right: 5px;
138
+ cursor: pointer;
139
+ }
140
+
141
+ .funnel {
142
+ width: calc(100% - 20px);
143
+ height: 100%;
144
+ padding: 10px;
145
+ padding-bottom: 7px;
146
+ border-radius: 10px;
147
+ border-width: 1px;
148
+ }
149
+
150
+ .hover\:text-clrs-navy:hover {
151
+ color: var(--clrs-navy, #001f3f);
152
+ }
@@ -0,0 +1,46 @@
1
+ import { Component, h, Prop } from '@stencil/core';
2
+ import { ColorPicker } from './color-picker';
3
+ import { DataSource } from './data-source';
4
+ import { DataValues } from './data-values';
5
+ import { Eswat2Io } from './eswat2-io';
6
+ export class ProtoTinker {
7
+ constructor() {
8
+ this.tag = 'proto-tinker';
9
+ }
10
+ render() {
11
+ return (h("div", { id: "app", class: "ds1-main" },
12
+ h(Eswat2Io, null),
13
+ h(DataSource, null),
14
+ h(ColorPicker, null),
15
+ h("hr", { class: "mr-0 ml-0" }),
16
+ h(DataValues, null)));
17
+ }
18
+ static get is() { return "proto-tinker"; }
19
+ static get encapsulation() { return "shadow"; }
20
+ static get originalStyleUrls() { return {
21
+ "$": ["./proto-tinker.css"]
22
+ }; }
23
+ static get styleUrls() { return {
24
+ "$": ["proto-tinker.css"]
25
+ }; }
26
+ static get properties() { return {
27
+ "tag": {
28
+ "type": "string",
29
+ "mutable": false,
30
+ "complexType": {
31
+ "original": "string",
32
+ "resolved": "string",
33
+ "references": {}
34
+ },
35
+ "required": false,
36
+ "optional": false,
37
+ "docs": {
38
+ "tags": [],
39
+ "text": ""
40
+ },
41
+ "attribute": "tag",
42
+ "reflect": false,
43
+ "defaultValue": "'proto-tinker'"
44
+ }
45
+ }; }
46
+ }
@@ -0,0 +1,15 @@
1
+ import { h } from '@stencil/core';
2
+ const Radio = props => {
3
+ const hex = props.hex || 'currentColor';
4
+ const klass = props.class;
5
+ const label = props.label || 'radio';
6
+ const selected = props.selected || false;
7
+ const size = props.size || 24;
8
+ return (h("svg", { class: klass, width: size, height: size, viewBox: "0 0 24 24", role: "img", "aria-label": "title" },
9
+ h("title", null, label),
10
+ ' ',
11
+ h("g", { fill: hex }, selected ? (h("path", { d: "M12 7c-2.76 0-5 2.24-5 5s2.24 5 5 5 5-2.24 5-5-2.24-5-5-5zm0-5C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z" })) : (h("path", { d: "M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z" }))),
12
+ h("path", { d: "M0 0h24v24H0z", fill: "none" })));
13
+ };
14
+ export { Radio };
15
+ export default Radio;
@@ -0,0 +1,14 @@
1
+ import { h } from '@stencil/core';
2
+ const Refresh = props => {
3
+ const hex = props.hex || 'currentColor';
4
+ const klass = props.class;
5
+ const label = props.label || 'refresh';
6
+ const size = props.size || 24;
7
+ return (h("svg", { class: klass, width: size, height: size, viewBox: "0 0 24 24", role: "img", "aria-label": "title" },
8
+ h("title", null, label),
9
+ h("g", { fill: hex },
10
+ h("path", { d: "M17.65 6.35C16.2 4.9 14.21 4 12 4c-4.42 0-7.99 3.58-7.99\n 8s3.57 8 7.99 8c3.73 0 6.84-2.55 7.73-6h-2.08c-.82 2.33-3.04 4-5.65\n 4-3.31 0-6-2.69-6-6s2.69-6 6-6c1.66 0 3.14.69 4.22 1.78L13 11h7V4l-2.35\n 2.35z" })),
11
+ h("path", { d: "M0 0h24v24H0z", fill: "none" })));
12
+ };
13
+ export { Refresh };
14
+ export default Refresh;
@@ -0,0 +1,9 @@
1
+ import { h } from '@stencil/core';
2
+ const TW_VERSION = '3.0.2';
3
+ const TwLabel = _props => {
4
+ return (h("label", { class: "ml-auto align-top text-xs italic text-clrs-slate4" },
5
+ "Tailwind ",
6
+ TW_VERSION));
7
+ };
8
+ export { TwLabel };
9
+ export default TwLabel;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,36 @@
1
+ import Color from 'color';
2
+ import colorString from 'color-string';
3
+ import lerp from 'lerp';
4
+ const ColorPlugin = {
5
+ name: 'color',
6
+ test(startValue) {
7
+ // rgb(255, 0, 0)
8
+ return (typeof startValue === 'string' &&
9
+ (startValue.indexOf('rgb') >= 0 ||
10
+ startValue.indexOf('#') >= 0 ||
11
+ startValue.indexOf('hsl') >= 0 ||
12
+ colorString.get.rgb(startValue))); // true
13
+ },
14
+ initialize(startValue, destValue) {
15
+ return {
16
+ data: {
17
+ format: (startValue.indexOf('rgba') >= 0 && 'rgba') ||
18
+ (startValue.indexOf('rgb') >= 0 && 'rgb') ||
19
+ (startValue.indexOf('#') >= 0 && 'hex') ||
20
+ Color(startValue).model,
21
+ },
22
+ startValue: Color(startValue).rgb(),
23
+ destValue: Color(destValue).rgb(),
24
+ };
25
+ },
26
+ interpolate(startValue, destValue, progress, data) {
27
+ const r = lerp(startValue.color[0], destValue.color[0], progress);
28
+ const g = lerp(startValue.color[1], destValue.color[1], progress);
29
+ const b = lerp(startValue.color[2], destValue.color[2], progress);
30
+ const a = lerp(startValue.valpha, destValue.valpha, progress);
31
+ const color = Color.rgb(r, g, b, a)[data.format === 'rgba' ? 'rgb' : data.format]();
32
+ return typeof color === 'string' ? color : color.string();
33
+ },
34
+ };
35
+ export { ColorPlugin };
36
+ export default ColorPlugin;
@@ -0,0 +1,10 @@
1
+ const funnelDefs = [
2
+ { id: 1, height: 400, width: 100, x: 10, y: 10, drop: 20 },
3
+ { id: 2, height: 356, width: 100, x: 120, y: 32, drop: 20 },
4
+ { id: 3, height: 312, width: 100, x: 230, y: 54, drop: 20 },
5
+ { id: 4, height: 268, width: 100, x: 340, y: 76, drop: 20 },
6
+ { id: 5, height: 224, width: 100, x: 450, y: 98, drop: 20 },
7
+ ];
8
+ const sample = funnelDefs.map(() => 0);
9
+ export { funnelDefs, sample };
10
+ export default funnelDefs;
@@ -0,0 +1,5 @@
1
+ export * from './color-plugin';
2
+ export * from './funnel-defs';
3
+ export * from './named-colors';
4
+ export * from './store';
5
+ export * from './types';
@@ -0,0 +1,51 @@
1
+ /* NOTE: colors from clrs.cc - A nicer color palette for the web...
2
+ */
3
+ const navy = '#001f3f';
4
+ const blue = '#0074d9';
5
+ const aqua = '#7fdbff';
6
+ const teal = '#39cccc';
7
+ const olive = '#3d9970';
8
+ const green = '#2ecc40';
9
+ const lime = '#01ff70';
10
+ const yellow = '#ffdc00';
11
+ const orange = '#ff851b';
12
+ const red = '#ff4136';
13
+ const maroon = '#85144b';
14
+ const fuchsia = '#f012be';
15
+ const purple = '#b10dc9';
16
+ const black = '#111111';
17
+ const gray = '#aaaaaa';
18
+ const silver = '#dddddd';
19
+ const bada55 = '#bada55';
20
+ const slate = '#708090';
21
+ const slate4 = '#4e5964';
22
+ const white = '#ffffff';
23
+ // NOTE: this is ONLY used internally...
24
+ const _namedColors = {
25
+ bada55,
26
+ navy,
27
+ blue,
28
+ aqua,
29
+ teal,
30
+ olive,
31
+ green,
32
+ lime,
33
+ yellow,
34
+ orange,
35
+ red,
36
+ maroon,
37
+ fuchsia,
38
+ purple,
39
+ black,
40
+ gray,
41
+ silver,
42
+ };
43
+ const _altColors = {
44
+ slate,
45
+ slate4,
46
+ white,
47
+ };
48
+ const colorFor = (key) => _namedColors[key] || _altColors[key];
49
+ const colorKeys = Object.keys(_namedColors);
50
+ export { navy, blue, aqua, teal, olive, green, lime, yellow, orange, red, maroon, fuchsia, purple, black, gray, silver, bada55, slate, slate4, white, colorFor, colorKeys, };
51
+ export default colorFor;
@@ -0,0 +1,25 @@
1
+ import { createStore } from '@stencil/store';
2
+ import { sample } from './funnel-defs';
3
+ const initStore = {
4
+ count: 0,
5
+ pick: 'bada55',
6
+ values: [...sample],
7
+ };
8
+ const store = createStore(initStore);
9
+ const { state } = store;
10
+ const actions = {
11
+ refresh: () => {
12
+ const values = sample.map(() => Math.floor(Math.random() * 100));
13
+ state.count = state.count + 1;
14
+ state.values = values;
15
+ },
16
+ reset: () => {
17
+ state.count = 0;
18
+ state.values = [...sample];
19
+ },
20
+ updatePick: pick => {
21
+ state.pick = pick;
22
+ },
23
+ };
24
+ export { store, actions };
25
+ export default store;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,26 @@
1
+ /* ProtoTinkerWc custom elements */
2
+
3
+ import type { Components, JSX } from "../types/components";
4
+
5
+ /**
6
+ * Used to manually set the base path where assets can be found.
7
+ * If the script is used as "module", it's recommended to use "import.meta.url",
8
+ * such as "setAssetPath(import.meta.url)". Other options include
9
+ * "setAssetPath(document.currentScript.src)", or using a bundler's replace plugin to
10
+ * dynamically set the path at build time, such as "setAssetPath(process.env.ASSET_PATH)".
11
+ * But do note that this configuration depends on how your script is bundled, or lack of
12
+ * bunding, and where your assets can be loaded from. Additionally custom bundling
13
+ * will have to ensure the static assets are copied to its build directory.
14
+ */
15
+ export declare const setAssetPath: (path: string) => void;
16
+
17
+ export interface SetPlatformOptions {
18
+ raf?: (c: FrameRequestCallback) => number;
19
+ ael?: (el: EventTarget, eventName: string, listener: EventListenerOrEventListenerObject, options: boolean | AddEventListenerOptions) => void;
20
+ rel?: (el: EventTarget, eventName: string, listener: EventListenerOrEventListenerObject, options: boolean | AddEventListenerOptions) => void;
21
+ }
22
+ export declare const setPlatformOptions: (opts: SetPlatformOptions) => void;
23
+
24
+ export type { Components, JSX };
25
+
26
+ export * from '../types';
@@ -0,0 +1 @@
1
+ export { setAssetPath, setPlatformOptions } from '@stencil/core/internal/client';
@@ -0,0 +1,11 @@
1
+ import type { Components, JSX } from "../types/components";
2
+
3
+ interface ProtoTinker extends Components.ProtoTinker, HTMLElement {}
4
+ export const ProtoTinker: {
5
+ prototype: ProtoTinker;
6
+ new (): ProtoTinker;
7
+ };
8
+ /**
9
+ * Used to define this component and all nested components recursively.
10
+ */
11
+ export const defineCustomElement: () => void;