proto-ikons-wc 0.0.71 → 0.0.73

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.
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const index = require('./index-f1aead39.js');
5
+ const index = require('./index-70c493e0.js');
6
6
 
7
7
  const acuraIkonCss = "";
8
8
 
@@ -22,31 +22,16 @@ function _interopNamespace(e) {
22
22
 
23
23
  const NAMESPACE = 'proto-ikons-wc';
24
24
 
25
+ /**
26
+ * Virtual DOM patching algorithm based on Snabbdom by
27
+ * Simon Friis Vindum (@paldepind)
28
+ * Licensed under the MIT License
29
+ * https://github.com/snabbdom/snabbdom/blob/master/LICENSE
30
+ *
31
+ * Modified for Stencil's renderer and slot projection
32
+ */
25
33
  let isSvgMode = false;
26
34
  let queuePending = false;
27
- const win = typeof window !== 'undefined' ? window : {};
28
- const doc = win.document || { head: {} };
29
- const plt = {
30
- $flags$: 0,
31
- $resourcesUrl$: '',
32
- jmp: (h) => h(),
33
- raf: (h) => requestAnimationFrame(h),
34
- ael: (el, eventName, listener, opts) => el.addEventListener(eventName, listener, opts),
35
- rel: (el, eventName, listener, opts) => el.removeEventListener(eventName, listener, opts),
36
- ce: (eventName, opts) => new CustomEvent(eventName, opts),
37
- };
38
- const promiseResolve = (v) => Promise.resolve(v);
39
- const supportsConstructableStylesheets = /*@__PURE__*/ (() => {
40
- try {
41
- new CSSStyleSheet();
42
- return typeof new CSSStyleSheet().replaceSync === 'function';
43
- }
44
- catch (e) { }
45
- return false;
46
- })()
47
- ;
48
- const HYDRATED_CSS = '{visibility:hidden}.hydrated{visibility:inherit}';
49
- const XLINK_NS = 'http://www.w3.org/1999/xlink';
50
35
  const createTime = (fnName, tagName = '') => {
51
36
  {
52
37
  return () => {
@@ -61,64 +46,8 @@ const uniqueTime = (key, measureText) => {
61
46
  };
62
47
  }
63
48
  };
64
- const rootAppliedStyles = /*@__PURE__*/ new WeakMap();
65
- const registerStyle = (scopeId, cssText, allowCS) => {
66
- let style = styles.get(scopeId);
67
- if (supportsConstructableStylesheets && allowCS) {
68
- style = (style || new CSSStyleSheet());
69
- if (typeof style === 'string') {
70
- style = cssText;
71
- }
72
- else {
73
- style.replaceSync(cssText);
74
- }
75
- }
76
- else {
77
- style = cssText;
78
- }
79
- styles.set(scopeId, style);
80
- };
81
- const addStyle = (styleContainerNode, cmpMeta, mode, hostElm) => {
82
- let scopeId = getScopeId(cmpMeta);
83
- const style = styles.get(scopeId);
84
- // if an element is NOT connected then getRootNode() will return the wrong root node
85
- // so the fallback is to always use the document for the root node in those cases
86
- styleContainerNode = styleContainerNode.nodeType === 11 /* NODE_TYPE.DocumentFragment */ ? styleContainerNode : doc;
87
- if (style) {
88
- if (typeof style === 'string') {
89
- styleContainerNode = styleContainerNode.head || styleContainerNode;
90
- let appliedStyles = rootAppliedStyles.get(styleContainerNode);
91
- let styleElm;
92
- if (!appliedStyles) {
93
- rootAppliedStyles.set(styleContainerNode, (appliedStyles = new Set()));
94
- }
95
- if (!appliedStyles.has(scopeId)) {
96
- {
97
- {
98
- styleElm = doc.createElement('style');
99
- styleElm.innerHTML = style;
100
- }
101
- styleContainerNode.insertBefore(styleElm, styleContainerNode.querySelector('link'));
102
- }
103
- if (appliedStyles) {
104
- appliedStyles.add(scopeId);
105
- }
106
- }
107
- }
108
- else if (!styleContainerNode.adoptedStyleSheets.includes(style)) {
109
- styleContainerNode.adoptedStyleSheets = [...styleContainerNode.adoptedStyleSheets, style];
110
- }
111
- }
112
- return scopeId;
113
- };
114
- const attachStyles = (hostRef) => {
115
- const cmpMeta = hostRef.$cmpMeta$;
116
- const elm = hostRef.$hostElement$;
117
- const endAttachStyles = createTime('attachStyles', cmpMeta.$tagName$);
118
- addStyle(elm.getRootNode(), cmpMeta);
119
- endAttachStyles();
120
- };
121
- const getScopeId = (cmp, mode) => 'sc-' + (cmp.$tagName$);
49
+ const HYDRATED_CSS = '{visibility:hidden}.hydrated{visibility:inherit}';
50
+ const XLINK_NS = 'http://www.w3.org/1999/xlink';
122
51
  /**
123
52
  * Default style mode id
124
53
  */
@@ -211,6 +140,123 @@ const newVNode = (tag, text) => {
211
140
  };
212
141
  const Host = {};
213
142
  const isHost = (node) => node && node.$tag$ === Host;
143
+ /**
144
+ * Parse a new property value for a given property type.
145
+ *
146
+ * While the prop value can reasonably be expected to be of `any` type as far as TypeScript's type checker is concerned,
147
+ * it is not safe to assume that the string returned by evaluating `typeof propValue` matches:
148
+ * 1. `any`, the type given to `propValue` in the function signature
149
+ * 2. the type stored from `propType`.
150
+ *
151
+ * This function provides the capability to parse/coerce a property's value to potentially any other JavaScript type.
152
+ *
153
+ * Property values represented in TSX preserve their type information. In the example below, the number 0 is passed to
154
+ * a component. This `propValue` will preserve its type information (`typeof propValue === 'number'`). Note that is
155
+ * based on the type of the value being passed in, not the type declared of the class member decorated with `@Prop`.
156
+ * ```tsx
157
+ * <my-cmp prop-val={0}></my-cmp>
158
+ * ```
159
+ *
160
+ * HTML prop values on the other hand, will always a string
161
+ *
162
+ * @param propValue the new value to coerce to some type
163
+ * @param propType the type of the prop, expressed as a binary number
164
+ * @returns the parsed/coerced value
165
+ */
166
+ const parsePropertyValue = (propValue, propType) => {
167
+ // ensure this value is of the correct prop type
168
+ if (propValue != null && !isComplexType(propValue)) {
169
+ if (propType & 4 /* MEMBER_FLAGS.Boolean */) {
170
+ // per the HTML spec, any string value means it is a boolean true value
171
+ // but we'll cheat here and say that the string "false" is the boolean false
172
+ return propValue === 'false' ? false : propValue === '' || !!propValue;
173
+ }
174
+ if (propType & 2 /* MEMBER_FLAGS.Number */) {
175
+ // force it to be a number
176
+ return parseFloat(propValue);
177
+ }
178
+ if (propType & 1 /* MEMBER_FLAGS.String */) {
179
+ // could have been passed as a number or boolean
180
+ // but we still want it as a string
181
+ return String(propValue);
182
+ }
183
+ // redundant return here for better minification
184
+ return propValue;
185
+ }
186
+ // not sure exactly what type we want
187
+ // so no need to change to a different type
188
+ return propValue;
189
+ };
190
+ /**
191
+ * Helper function to create & dispatch a custom Event on a provided target
192
+ * @param elm the target of the Event
193
+ * @param name the name to give the custom Event
194
+ * @param opts options for configuring a custom Event
195
+ * @returns the custom Event
196
+ */
197
+ const emitEvent = (elm, name, opts) => {
198
+ const ev = plt.ce(name, opts);
199
+ elm.dispatchEvent(ev);
200
+ return ev;
201
+ };
202
+ const rootAppliedStyles = /*@__PURE__*/ new WeakMap();
203
+ const registerStyle = (scopeId, cssText, allowCS) => {
204
+ let style = styles.get(scopeId);
205
+ if (supportsConstructableStylesheets && allowCS) {
206
+ style = (style || new CSSStyleSheet());
207
+ if (typeof style === 'string') {
208
+ style = cssText;
209
+ }
210
+ else {
211
+ style.replaceSync(cssText);
212
+ }
213
+ }
214
+ else {
215
+ style = cssText;
216
+ }
217
+ styles.set(scopeId, style);
218
+ };
219
+ const addStyle = (styleContainerNode, cmpMeta, mode, hostElm) => {
220
+ let scopeId = getScopeId(cmpMeta);
221
+ const style = styles.get(scopeId);
222
+ // if an element is NOT connected then getRootNode() will return the wrong root node
223
+ // so the fallback is to always use the document for the root node in those cases
224
+ styleContainerNode = styleContainerNode.nodeType === 11 /* NODE_TYPE.DocumentFragment */ ? styleContainerNode : doc;
225
+ if (style) {
226
+ if (typeof style === 'string') {
227
+ styleContainerNode = styleContainerNode.head || styleContainerNode;
228
+ let appliedStyles = rootAppliedStyles.get(styleContainerNode);
229
+ let styleElm;
230
+ if (!appliedStyles) {
231
+ rootAppliedStyles.set(styleContainerNode, (appliedStyles = new Set()));
232
+ }
233
+ if (!appliedStyles.has(scopeId)) {
234
+ {
235
+ {
236
+ styleElm = doc.createElement('style');
237
+ styleElm.innerHTML = style;
238
+ }
239
+ styleContainerNode.insertBefore(styleElm, styleContainerNode.querySelector('link'));
240
+ }
241
+ if (appliedStyles) {
242
+ appliedStyles.add(scopeId);
243
+ }
244
+ }
245
+ }
246
+ else if (!styleContainerNode.adoptedStyleSheets.includes(style)) {
247
+ styleContainerNode.adoptedStyleSheets = [...styleContainerNode.adoptedStyleSheets, style];
248
+ }
249
+ }
250
+ return scopeId;
251
+ };
252
+ const attachStyles = (hostRef) => {
253
+ const cmpMeta = hostRef.$cmpMeta$;
254
+ const elm = hostRef.$hostElement$;
255
+ const endAttachStyles = createTime('attachStyles', cmpMeta.$tagName$);
256
+ addStyle(elm.getRootNode(), cmpMeta);
257
+ endAttachStyles();
258
+ };
259
+ const getScopeId = (cmp, mode) => 'sc-' + (cmp.$tagName$);
214
260
  /**
215
261
  * Production setAccessor() function based on Preact by
216
262
  * Jason Miller (@developit)
@@ -654,18 +700,6 @@ const renderVdom = (hostRef, renderFnResults) => {
654
700
  // synchronous patch
655
701
  patch(oldVNode, rootVnode);
656
702
  };
657
- /**
658
- * Helper function to create & dispatch a custom Event on a provided target
659
- * @param elm the target of the Event
660
- * @param name the name to give the custom Event
661
- * @param opts options for configuring a custom Event
662
- * @returns the custom Event
663
- */
664
- const emitEvent = (elm, name, opts) => {
665
- const ev = plt.ce(name, opts);
666
- elm.dispatchEvent(ev);
667
- return ev;
668
- };
669
703
  const attachToAncestor = (hostRef, ancestorComponent) => {
670
704
  if (ancestorComponent && !hostRef.$onRenderResolve$ && ancestorComponent['s-p']) {
671
705
  ancestorComponent['s-p'].push(new Promise((r) => (hostRef.$onRenderResolve$ = r)));
@@ -804,53 +838,6 @@ const then = (promise, thenFn) => {
804
838
  };
805
839
  const addHydratedFlag = (elm) => elm.classList.add('hydrated')
806
840
  ;
807
- /**
808
- * Parse a new property value for a given property type.
809
- *
810
- * While the prop value can reasonably be expected to be of `any` type as far as TypeScript's type checker is concerned,
811
- * it is not safe to assume that the string returned by evaluating `typeof propValue` matches:
812
- * 1. `any`, the type given to `propValue` in the function signature
813
- * 2. the type stored from `propType`.
814
- *
815
- * This function provides the capability to parse/coerce a property's value to potentially any other JavaScript type.
816
- *
817
- * Property values represented in TSX preserve their type information. In the example below, the number 0 is passed to
818
- * a component. This `propValue` will preserve its type information (`typeof propValue === 'number'`). Note that is
819
- * based on the type of the value being passed in, not the type declared of the class member decorated with `@Prop`.
820
- * ```tsx
821
- * <my-cmp prop-val={0}></my-cmp>
822
- * ```
823
- *
824
- * HTML prop values on the other hand, will always a string
825
- *
826
- * @param propValue the new value to coerce to some type
827
- * @param propType the type of the prop, expressed as a binary number
828
- * @returns the parsed/coerced value
829
- */
830
- const parsePropertyValue = (propValue, propType) => {
831
- // ensure this value is of the correct prop type
832
- if (propValue != null && !isComplexType(propValue)) {
833
- if (propType & 4 /* MEMBER_FLAGS.Boolean */) {
834
- // per the HTML spec, any string value means it is a boolean true value
835
- // but we'll cheat here and say that the string "false" is the boolean false
836
- return propValue === 'false' ? false : propValue === '' || !!propValue;
837
- }
838
- if (propType & 2 /* MEMBER_FLAGS.Number */) {
839
- // force it to be a number
840
- return parseFloat(propValue);
841
- }
842
- if (propType & 1 /* MEMBER_FLAGS.String */) {
843
- // could have been passed as a number or boolean
844
- // but we still want it as a string
845
- return String(propValue);
846
- }
847
- // redundant return here for better minification
848
- return propValue;
849
- }
850
- // not sure exactly what type we want
851
- // so no need to change to a different type
852
- return propValue;
853
- };
854
841
  const getValue = (ref, propName) => getHostRef(ref).$instanceValues$.get(propName);
855
842
  const setValue = (ref, propName, newVal, cmpMeta) => {
856
843
  // check our new property value against our internal value
@@ -877,6 +864,16 @@ const setValue = (ref, propName, newVal, cmpMeta) => {
877
864
  }
878
865
  }
879
866
  };
867
+ /**
868
+ * Attach a series of runtime constructs to a compiled Stencil component
869
+ * constructor, including getters and setters for the `@Prop` and `@State`
870
+ * decorators, callbacks for when attributes change, and so on.
871
+ *
872
+ * @param Cstr the constructor for a component that we need to process
873
+ * @param cmpMeta metadata collected previously about the component
874
+ * @param flags a number used to store a series of bit flags
875
+ * @returns a reference to the same constructor passed in (but now mutated)
876
+ */
880
877
  const proxyComponent = (Cstr, cmpMeta, flags) => {
881
878
  if (cmpMeta.$members$) {
882
879
  // It's better to have a const than two Object.entries()
@@ -1201,6 +1198,27 @@ const loadModule = (cmpMeta, hostRef, hmrVersionId) => {
1201
1198
  }, consoleError);
1202
1199
  };
1203
1200
  const styles = /*@__PURE__*/ new Map();
1201
+ const win = typeof window !== 'undefined' ? window : {};
1202
+ const doc = win.document || { head: {} };
1203
+ const plt = {
1204
+ $flags$: 0,
1205
+ $resourcesUrl$: '',
1206
+ jmp: (h) => h(),
1207
+ raf: (h) => requestAnimationFrame(h),
1208
+ ael: (el, eventName, listener, opts) => el.addEventListener(eventName, listener, opts),
1209
+ rel: (el, eventName, listener, opts) => el.removeEventListener(eventName, listener, opts),
1210
+ ce: (eventName, opts) => new CustomEvent(eventName, opts),
1211
+ };
1212
+ const promiseResolve = (v) => Promise.resolve(v);
1213
+ const supportsConstructableStylesheets = /*@__PURE__*/ (() => {
1214
+ try {
1215
+ new CSSStyleSheet();
1216
+ return typeof new CSSStyleSheet().replaceSync === 'function';
1217
+ }
1218
+ catch (e) { }
1219
+ return false;
1220
+ })()
1221
+ ;
1204
1222
  const queueDomReads = [];
1205
1223
  const queueDomWrites = [];
1206
1224
  const queueTask = (queue, write) => (cb) => {
@@ -2,10 +2,10 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const index = require('./index-f1aead39.js');
5
+ const index = require('./index-70c493e0.js');
6
6
 
7
7
  /*
8
- Stencil Client Patch Esm v2.18.0 | MIT Licensed | https://stenciljs.com
8
+ Stencil Client Patch Esm v2.18.1 | MIT Licensed | https://stenciljs.com
9
9
  */
10
10
  const patchEsm = () => {
11
11
  return index.promiseResolve();
@@ -1,9 +1,9 @@
1
1
  'use strict';
2
2
 
3
- const index = require('./index-f1aead39.js');
3
+ const index = require('./index-70c493e0.js');
4
4
 
5
5
  /*
6
- Stencil Client Patch Browser v2.18.0 | MIT Licensed | https://stenciljs.com
6
+ Stencil Client Patch Browser v2.18.1 | MIT Licensed | https://stenciljs.com
7
7
  */
8
8
  const patchBrowser = () => {
9
9
  const importMeta = (typeof document === 'undefined' ? new (require('u' + 'rl').URL)('file:' + __filename).href : (document.currentScript && document.currentScript.src || new URL('proto-ikons-wc.cjs.js', document.baseURI).href));
@@ -122,7 +122,7 @@
122
122
  ],
123
123
  "compiler": {
124
124
  "name": "@stencil/core",
125
- "version": "2.18.0",
125
+ "version": "2.18.1",
126
126
  "typescriptVersion": "4.7.4"
127
127
  },
128
128
  "collections": [],
@@ -1,4 +1,4 @@
1
- import { r as registerInstance, h } from './index-9c78a3f2.js';
1
+ import { r as registerInstance, h } from './index-08330180.js';
2
2
 
3
3
  const acuraIkonCss = "";
4
4