proto-ikons-wc 0.0.97 → 0.0.99

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-a05e070d.js');
5
+ const index = require('./index-a9bc1503.js');
6
6
 
7
7
  const acuraIkonCss = "";
8
8
 
@@ -492,15 +492,16 @@ const addVnodes = (parentElm, before, parentVNode, vnodes, startIdx, endIdx) =>
492
492
  * @param vnodes a list of virtual DOM nodes to remove
493
493
  * @param startIdx the index at which to start removing nodes (inclusive)
494
494
  * @param endIdx the index at which to stop removing nodes (inclusive)
495
- * @param vnode a VNode
496
- * @param elm an element
497
495
  */
498
- const removeVnodes = (vnodes, startIdx, endIdx, vnode, elm) => {
499
- for (; startIdx <= endIdx; ++startIdx) {
500
- if ((vnode = vnodes[startIdx])) {
501
- elm = vnode.$elm$;
502
- // remove the vnode's element from the dom
503
- elm.remove();
496
+ const removeVnodes = (vnodes, startIdx, endIdx) => {
497
+ for (let index = startIdx; index <= endIdx; ++index) {
498
+ const vnode = vnodes[index];
499
+ if (vnode) {
500
+ const elm = vnode.$elm$;
501
+ if (elm) {
502
+ // remove the vnode's element from the dom
503
+ elm.remove();
504
+ }
504
505
  }
505
506
  }
506
507
  };
@@ -800,15 +801,54 @@ const scheduleUpdate = (hostRef, isInitialLoad) => {
800
801
  const dispatch = () => dispatchHooks(hostRef, isInitialLoad);
801
802
  return writeTask(dispatch) ;
802
803
  };
804
+ /**
805
+ * Dispatch initial-render and update lifecycle hooks, enqueuing calls to
806
+ * component lifecycle methods like `componentWillLoad` as well as
807
+ * {@link updateComponent}, which will kick off the virtual DOM re-render.
808
+ *
809
+ * @param hostRef a reference to a host DOM node
810
+ * @param isInitialLoad whether we're on the initial load or not
811
+ * @returns an empty Promise which is used to enqueue a series of operations for
812
+ * the component
813
+ */
803
814
  const dispatchHooks = (hostRef, isInitialLoad) => {
804
815
  const endSchedule = createTime('scheduleUpdate', hostRef.$cmpMeta$.$tagName$);
805
816
  const instance = hostRef.$lazyInstance$ ;
806
- let promise;
817
+ // We're going to use this variable together with `enqueue` to implement a
818
+ // little promise-based queue. We start out with it `undefined`. When we add
819
+ // the first function to the queue we'll set this variable to be that
820
+ // function's return value. When we attempt to add subsequent values to the
821
+ // queue we'll check that value and, if it was a `Promise`, we'll then chain
822
+ // the new function off of that `Promise` using `.then()`. This will give our
823
+ // queue two nice properties:
824
+ //
825
+ // 1. If all functions added to the queue are synchronous they'll be called
826
+ // synchronously right away.
827
+ // 2. If all functions added to the queue are asynchronous they'll all be
828
+ // called in order after `dispatchHooks` exits.
829
+ let maybePromise;
807
830
  endSchedule();
808
- return then(promise, () => updateComponent(hostRef, instance, isInitialLoad));
831
+ return enqueue(maybePromise, () => updateComponent(hostRef, instance, isInitialLoad));
809
832
  };
833
+ /**
834
+ * This function uses a Promise to implement a simple first-in, first-out queue
835
+ * of functions to be called.
836
+ *
837
+ * The queue is ordered on the basis of the first argument. If it's
838
+ * `undefined`, then nothing is on the queue yet, so the provided function can
839
+ * be called synchronously (although note that this function may return a
840
+ * `Promise`). The idea is that then the return value of that enqueueing
841
+ * operation is kept around, so that if it was a `Promise` then subsequent
842
+ * functions can be enqueued by calling this function again with that `Promise`
843
+ * as the first argument.
844
+ *
845
+ * @param maybePromise either a `Promise` which should resolve before the next function is called or an 'empty' sentinel
846
+ * @param fn a function to enqueue
847
+ * @returns either a `Promise` or the return value of the provided function
848
+ */
849
+ const enqueue = (maybePromise, fn) => maybePromise instanceof Promise ? maybePromise.then(fn) : fn();
810
850
  const updateComponent = async (hostRef, instance, isInitialLoad) => {
811
- // updateComponent
851
+ var _a;
812
852
  const elm = hostRef.$hostElement$;
813
853
  const endUpdate = createTime('update', hostRef.$cmpMeta$.$tagName$);
814
854
  const rc = elm['s-rc'];
@@ -830,7 +870,7 @@ const updateComponent = async (hostRef, instance, isInitialLoad) => {
830
870
  endRender();
831
871
  endUpdate();
832
872
  {
833
- const childrenPromises = elm['s-p'];
873
+ const childrenPromises = (_a = elm['s-p']) !== null && _a !== void 0 ? _a : [];
834
874
  const postUpdate = () => postUpdateComponent(hostRef);
835
875
  if (childrenPromises.length === 0) {
836
876
  postUpdate();
@@ -913,9 +953,6 @@ const appDidLoad = (who) => {
913
953
  }
914
954
  nextTick(() => emitEvent(win, 'appload', { detail: { namespace: NAMESPACE } }));
915
955
  };
916
- const then = (promise, thenFn) => {
917
- return promise && promise.then ? promise.then(thenFn) : thenFn();
918
- };
919
956
  const addHydratedFlag = (elm) => elm.classList.add('hydrated')
920
957
  ;
921
958
  const getValue = (ref, propName) => getHostRef(ref).$instanceValues$.get(propName);
@@ -1046,9 +1083,9 @@ const proxyComponent = (Cstr, cmpMeta, flags) => {
1046
1083
  const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId, Cstr) => {
1047
1084
  // initializeComponent
1048
1085
  if ((hostRef.$flags$ & 32 /* HOST_FLAGS.hasInitializedComponent */) === 0) {
1086
+ // Let the runtime know that the component has been initialized
1087
+ hostRef.$flags$ |= 32 /* HOST_FLAGS.hasInitializedComponent */;
1049
1088
  {
1050
- // we haven't initialized this element yet
1051
- hostRef.$flags$ |= 32 /* HOST_FLAGS.hasInitializedComponent */;
1052
1089
  // lazy loaded components
1053
1090
  // request the component's implementation to be
1054
1091
  // wired up with the host element
@@ -2,10 +2,10 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const index = require('./index-a05e070d.js');
5
+ const index = require('./index-a9bc1503.js');
6
6
 
7
7
  /*
8
- Stencil Client Patch Esm v3.2.1 | MIT Licensed | https://stenciljs.com
8
+ Stencil Client Patch Esm v3.3.0 | MIT Licensed | https://stenciljs.com
9
9
  */
10
10
  const patchEsm = () => {
11
11
  return index.promiseResolve();
@@ -2,10 +2,10 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const index = require('./index-a05e070d.js');
5
+ const index = require('./index-a9bc1503.js');
6
6
 
7
7
  /*
8
- Stencil Client Patch Browser v3.2.1 | MIT Licensed | https://stenciljs.com
8
+ Stencil Client Patch Browser v3.3.0 | MIT Licensed | https://stenciljs.com
9
9
  */
10
10
  const patchBrowser = () => {
11
11
  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,8 +122,8 @@
122
122
  ],
123
123
  "compiler": {
124
124
  "name": "@stencil/core",
125
- "version": "3.2.1",
126
- "typescriptVersion": "4.9.5"
125
+ "version": "3.3.0",
126
+ "typescriptVersion": "5.0.4"
127
127
  },
128
128
  "collections": [],
129
129
  "bundles": []
@@ -1,4 +1,4 @@
1
- import { r as registerInstance, h } from './index-abf2be46.js';
1
+ import { r as registerInstance, h } from './index-6c6b5fb4.js';
2
2
 
3
3
  const acuraIkonCss = "";
4
4
 
@@ -470,15 +470,16 @@ const addVnodes = (parentElm, before, parentVNode, vnodes, startIdx, endIdx) =>
470
470
  * @param vnodes a list of virtual DOM nodes to remove
471
471
  * @param startIdx the index at which to start removing nodes (inclusive)
472
472
  * @param endIdx the index at which to stop removing nodes (inclusive)
473
- * @param vnode a VNode
474
- * @param elm an element
475
473
  */
476
- const removeVnodes = (vnodes, startIdx, endIdx, vnode, elm) => {
477
- for (; startIdx <= endIdx; ++startIdx) {
478
- if ((vnode = vnodes[startIdx])) {
479
- elm = vnode.$elm$;
480
- // remove the vnode's element from the dom
481
- elm.remove();
474
+ const removeVnodes = (vnodes, startIdx, endIdx) => {
475
+ for (let index = startIdx; index <= endIdx; ++index) {
476
+ const vnode = vnodes[index];
477
+ if (vnode) {
478
+ const elm = vnode.$elm$;
479
+ if (elm) {
480
+ // remove the vnode's element from the dom
481
+ elm.remove();
482
+ }
482
483
  }
483
484
  }
484
485
  };
@@ -778,15 +779,54 @@ const scheduleUpdate = (hostRef, isInitialLoad) => {
778
779
  const dispatch = () => dispatchHooks(hostRef, isInitialLoad);
779
780
  return writeTask(dispatch) ;
780
781
  };
782
+ /**
783
+ * Dispatch initial-render and update lifecycle hooks, enqueuing calls to
784
+ * component lifecycle methods like `componentWillLoad` as well as
785
+ * {@link updateComponent}, which will kick off the virtual DOM re-render.
786
+ *
787
+ * @param hostRef a reference to a host DOM node
788
+ * @param isInitialLoad whether we're on the initial load or not
789
+ * @returns an empty Promise which is used to enqueue a series of operations for
790
+ * the component
791
+ */
781
792
  const dispatchHooks = (hostRef, isInitialLoad) => {
782
793
  const endSchedule = createTime('scheduleUpdate', hostRef.$cmpMeta$.$tagName$);
783
794
  const instance = hostRef.$lazyInstance$ ;
784
- let promise;
795
+ // We're going to use this variable together with `enqueue` to implement a
796
+ // little promise-based queue. We start out with it `undefined`. When we add
797
+ // the first function to the queue we'll set this variable to be that
798
+ // function's return value. When we attempt to add subsequent values to the
799
+ // queue we'll check that value and, if it was a `Promise`, we'll then chain
800
+ // the new function off of that `Promise` using `.then()`. This will give our
801
+ // queue two nice properties:
802
+ //
803
+ // 1. If all functions added to the queue are synchronous they'll be called
804
+ // synchronously right away.
805
+ // 2. If all functions added to the queue are asynchronous they'll all be
806
+ // called in order after `dispatchHooks` exits.
807
+ let maybePromise;
785
808
  endSchedule();
786
- return then(promise, () => updateComponent(hostRef, instance, isInitialLoad));
809
+ return enqueue(maybePromise, () => updateComponent(hostRef, instance, isInitialLoad));
787
810
  };
811
+ /**
812
+ * This function uses a Promise to implement a simple first-in, first-out queue
813
+ * of functions to be called.
814
+ *
815
+ * The queue is ordered on the basis of the first argument. If it's
816
+ * `undefined`, then nothing is on the queue yet, so the provided function can
817
+ * be called synchronously (although note that this function may return a
818
+ * `Promise`). The idea is that then the return value of that enqueueing
819
+ * operation is kept around, so that if it was a `Promise` then subsequent
820
+ * functions can be enqueued by calling this function again with that `Promise`
821
+ * as the first argument.
822
+ *
823
+ * @param maybePromise either a `Promise` which should resolve before the next function is called or an 'empty' sentinel
824
+ * @param fn a function to enqueue
825
+ * @returns either a `Promise` or the return value of the provided function
826
+ */
827
+ const enqueue = (maybePromise, fn) => maybePromise instanceof Promise ? maybePromise.then(fn) : fn();
788
828
  const updateComponent = async (hostRef, instance, isInitialLoad) => {
789
- // updateComponent
829
+ var _a;
790
830
  const elm = hostRef.$hostElement$;
791
831
  const endUpdate = createTime('update', hostRef.$cmpMeta$.$tagName$);
792
832
  const rc = elm['s-rc'];
@@ -808,7 +848,7 @@ const updateComponent = async (hostRef, instance, isInitialLoad) => {
808
848
  endRender();
809
849
  endUpdate();
810
850
  {
811
- const childrenPromises = elm['s-p'];
851
+ const childrenPromises = (_a = elm['s-p']) !== null && _a !== void 0 ? _a : [];
812
852
  const postUpdate = () => postUpdateComponent(hostRef);
813
853
  if (childrenPromises.length === 0) {
814
854
  postUpdate();
@@ -891,9 +931,6 @@ const appDidLoad = (who) => {
891
931
  }
892
932
  nextTick(() => emitEvent(win, 'appload', { detail: { namespace: NAMESPACE } }));
893
933
  };
894
- const then = (promise, thenFn) => {
895
- return promise && promise.then ? promise.then(thenFn) : thenFn();
896
- };
897
934
  const addHydratedFlag = (elm) => elm.classList.add('hydrated')
898
935
  ;
899
936
  const getValue = (ref, propName) => getHostRef(ref).$instanceValues$.get(propName);
@@ -1024,9 +1061,9 @@ const proxyComponent = (Cstr, cmpMeta, flags) => {
1024
1061
  const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId, Cstr) => {
1025
1062
  // initializeComponent
1026
1063
  if ((hostRef.$flags$ & 32 /* HOST_FLAGS.hasInitializedComponent */) === 0) {
1064
+ // Let the runtime know that the component has been initialized
1065
+ hostRef.$flags$ |= 32 /* HOST_FLAGS.hasInitializedComponent */;
1027
1066
  {
1028
- // we haven't initialized this element yet
1029
- hostRef.$flags$ |= 32 /* HOST_FLAGS.hasInitializedComponent */;
1030
1067
  // lazy loaded components
1031
1068
  // request the component's implementation to be
1032
1069
  // wired up with the host element
@@ -1,8 +1,8 @@
1
- import { p as promiseResolve, b as bootstrapLazy } from './index-abf2be46.js';
2
- export { s as setNonce } from './index-abf2be46.js';
1
+ import { p as promiseResolve, b as bootstrapLazy } from './index-6c6b5fb4.js';
2
+ export { s as setNonce } from './index-6c6b5fb4.js';
3
3
 
4
4
  /*
5
- Stencil Client Patch Esm v3.2.1 | MIT Licensed | https://stenciljs.com
5
+ Stencil Client Patch Esm v3.3.0 | MIT Licensed | https://stenciljs.com
6
6
  */
7
7
  const patchEsm = () => {
8
8
  return promiseResolve();
@@ -1,8 +1,8 @@
1
- import { p as promiseResolve, b as bootstrapLazy } from './index-abf2be46.js';
2
- export { s as setNonce } from './index-abf2be46.js';
1
+ import { p as promiseResolve, b as bootstrapLazy } from './index-6c6b5fb4.js';
2
+ export { s as setNonce } from './index-6c6b5fb4.js';
3
3
 
4
4
  /*
5
- Stencil Client Patch Browser v3.2.1 | MIT Licensed | https://stenciljs.com
5
+ Stencil Client Patch Browser v3.3.0 | MIT Licensed | https://stenciljs.com
6
6
  */
7
7
  const patchBrowser = () => {
8
8
  const importMeta = import.meta.url;