proto-sudoku-wc 0.0.463 → 0.0.466
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/{index-b3b98bf7.js → index-02cc516d.js} +185 -45
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/proto-sudoku-wc.cjs.js +2 -2
- package/dist/cjs/proto-sudoku.cjs.entry.js +1 -1
- package/dist/collection/collection-manifest.json +2 -2
- package/dist/collection/components/proto-sudoku/alert.js +1 -6
- package/dist/collection/components/proto-sudoku/alerts.js +1 -5
- package/dist/collection/components/proto-sudoku/alien.js +1 -5
- package/dist/collection/components/proto-sudoku/eswat2-io.js +1 -2
- package/dist/collection/components/proto-sudoku/fingerprint.js +1 -5
- package/dist/collection/components/proto-sudoku/keys.js +3 -5
- package/dist/collection/components/proto-sudoku/proto-sudoku.js +34 -35
- package/dist/collection/components/proto-sudoku/spinner.js +1 -6
- package/dist/collection/components/proto-sudoku/tool-bar.js +1 -4
- package/dist/collection/components/proto-sudoku/tw-label.js +1 -3
- package/dist/esm/{index-eeaca3e8.js → index-f468fcee.js} +185 -45
- package/dist/esm/loader.js +2 -2
- package/dist/esm/proto-sudoku-wc.js +2 -2
- package/dist/esm/proto-sudoku.entry.js +1 -1
- package/dist/proto-sudoku-wc/{p-9f6ae661.js → p-3561d2f7.js} +0 -0
- package/dist/proto-sudoku-wc/{p-c6c5708f.entry.js → p-cdd2af37.entry.js} +1 -1
- package/dist/proto-sudoku-wc/proto-sudoku-wc.esm.js +1 -1
- package/loader/package.json +1 -0
- package/package.json +7 -7
@@ -41,7 +41,7 @@ const uniqueTime = (key, measureText) => {
|
|
41
41
|
};
|
42
42
|
}
|
43
43
|
};
|
44
|
-
const rootAppliedStyles = new WeakMap();
|
44
|
+
const rootAppliedStyles = /*@__PURE__*/ new WeakMap();
|
45
45
|
const registerStyle = (scopeId, cssText, allowCS) => {
|
46
46
|
let style = styles.get(scopeId);
|
47
47
|
if (supportsConstructableStylesheets && allowCS) {
|
@@ -63,7 +63,7 @@ const addStyle = (styleContainerNode, cmpMeta, mode, hostElm) => {
|
|
63
63
|
const style = styles.get(scopeId);
|
64
64
|
// if an element is NOT connected then getRootNode() will return the wrong root node
|
65
65
|
// so the fallback is to always use the document for the root node in those cases
|
66
|
-
styleContainerNode = styleContainerNode.nodeType === 11 /* DocumentFragment */ ? styleContainerNode : doc;
|
66
|
+
styleContainerNode = styleContainerNode.nodeType === 11 /* NODE_TYPE.DocumentFragment */ ? styleContainerNode : doc;
|
67
67
|
if (style) {
|
68
68
|
if (typeof style === 'string') {
|
69
69
|
styleContainerNode = styleContainerNode.head || styleContainerNode;
|
@@ -97,7 +97,7 @@ const attachStyles = (hostRef) => {
|
|
97
97
|
const flags = cmpMeta.$flags$;
|
98
98
|
const endAttachStyles = createTime('attachStyles', cmpMeta.$tagName$);
|
99
99
|
const scopeId = addStyle(elm.shadowRoot ? elm.shadowRoot : elm.getRootNode(), cmpMeta);
|
100
|
-
if (flags & 10 /* needsScopedEncapsulation */) {
|
100
|
+
if (flags & 10 /* CMP_FLAGS.needsScopedEncapsulation */) {
|
101
101
|
// only required when we're NOT using native shadow dom (slot)
|
102
102
|
// or this browser doesn't support native shadow dom
|
103
103
|
// and this host element was NOT created with SSR
|
@@ -330,7 +330,7 @@ const setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
|
|
330
330
|
}
|
331
331
|
}
|
332
332
|
}
|
333
|
-
else if ((!isProp || flags & 4 /* isHost */ || isSvg) && !isComplex) {
|
333
|
+
else if ((!isProp || flags & 4 /* VNODE_FLAGS.isHost */ || isSvg) && !isComplex) {
|
334
334
|
newValue = newValue === true ? '' : newValue;
|
335
335
|
{
|
336
336
|
elm.setAttribute(memberName, newValue);
|
@@ -345,7 +345,7 @@ const updateElement = (oldVnode, newVnode, isSvgMode, memberName) => {
|
|
345
345
|
// if the element passed in is a shadow root, which is a document fragment
|
346
346
|
// then we want to be adding attrs/props to the shadow root's "host" element
|
347
347
|
// if it's not a shadow root, then we add attrs/props to the same element
|
348
|
-
const elm = newVnode.$elm$.nodeType === 11 /* DocumentFragment */ && newVnode.$elm$.host
|
348
|
+
const elm = newVnode.$elm$.nodeType === 11 /* NODE_TYPE.DocumentFragment */ && newVnode.$elm$.host
|
349
349
|
? newVnode.$elm$.host
|
350
350
|
: newVnode.$elm$;
|
351
351
|
const oldVnodeAttrs = (oldVnode && oldVnode.$attrs$) || EMPTY_OBJ;
|
@@ -363,6 +363,16 @@ const updateElement = (oldVnode, newVnode, isSvgMode, memberName) => {
|
|
363
363
|
setAccessor(elm, memberName, oldVnodeAttrs[memberName], newVnodeAttrs[memberName], isSvgMode, newVnode.$flags$);
|
364
364
|
}
|
365
365
|
};
|
366
|
+
/**
|
367
|
+
* Create a DOM Node corresponding to one of the children of a given VNode.
|
368
|
+
*
|
369
|
+
* @param oldParentVNode the parent VNode from the previous render
|
370
|
+
* @param newParentVNode the parent VNode from the current render
|
371
|
+
* @param childIndex the index of the VNode, in the _new_ parent node's
|
372
|
+
* children, for which we will create a new DOM node
|
373
|
+
* @param parentElm the parent DOM node which our new node will be a child of
|
374
|
+
* @returns the newly created node
|
375
|
+
*/
|
366
376
|
const createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
|
367
377
|
// tslint:disable-next-line: prefer-const
|
368
378
|
const newVNode = newParentVNode.$children$[childIndex];
|
@@ -442,6 +452,74 @@ const removeVnodes = (vnodes, startIdx, endIdx, vnode, elm) => {
|
|
442
452
|
}
|
443
453
|
}
|
444
454
|
};
|
455
|
+
/**
|
456
|
+
* Reconcile the children of a new VNode with the children of an old VNode by
|
457
|
+
* traversing the two collections of children, identifying nodes that are
|
458
|
+
* conserved or changed, calling out to `patch` to make any necessary
|
459
|
+
* updates to the DOM, and rearranging DOM nodes as needed.
|
460
|
+
*
|
461
|
+
* The algorithm for reconciling children works by analyzing two 'windows' onto
|
462
|
+
* the two arrays of children (`oldCh` and `newCh`). We keep track of the
|
463
|
+
* 'windows' by storing start and end indices and references to the
|
464
|
+
* corresponding array entries. Initially the two 'windows' are basically equal
|
465
|
+
* to the entire array, but we progressively narrow the windows until there are
|
466
|
+
* no children left to update by doing the following:
|
467
|
+
*
|
468
|
+
* 1. Skip any `null` entries at the beginning or end of the two arrays, so
|
469
|
+
* that if we have an initial array like the following we'll end up dealing
|
470
|
+
* only with a window bounded by the highlighted elements:
|
471
|
+
*
|
472
|
+
* [null, null, VNode1 , ... , VNode2, null, null]
|
473
|
+
* ^^^^^^ ^^^^^^
|
474
|
+
*
|
475
|
+
* 2. Check to see if the elements at the head and tail positions are equal
|
476
|
+
* across the windows. This will basically detect elements which haven't
|
477
|
+
* been added, removed, or changed position, i.e. if you had the following
|
478
|
+
* VNode elements (represented as HTML):
|
479
|
+
*
|
480
|
+
* oldVNode: `<div><p><span>HEY</span></p></div>`
|
481
|
+
* newVNode: `<div><p><span>THERE</span></p></div>`
|
482
|
+
*
|
483
|
+
* Then when comparing the children of the `<div>` tag we check the equality
|
484
|
+
* of the VNodes corresponding to the `<p>` tags and, since they are the
|
485
|
+
* same tag in the same position, we'd be able to avoid completely
|
486
|
+
* re-rendering the subtree under them with a new DOM element and would just
|
487
|
+
* call out to `patch` to handle reconciling their children and so on.
|
488
|
+
*
|
489
|
+
* 3. Check, for both windows, to see if the element at the beginning of the
|
490
|
+
* window corresponds to the element at the end of the other window. This is
|
491
|
+
* a heuristic which will let us identify _some_ situations in which
|
492
|
+
* elements have changed position, for instance it _should_ detect that the
|
493
|
+
* children nodes themselves have not changed but merely moved in the
|
494
|
+
* following example:
|
495
|
+
*
|
496
|
+
* oldVNode: `<div><element-one /><element-two /></div>`
|
497
|
+
* newVNode: `<div><element-two /><element-one /></div>`
|
498
|
+
*
|
499
|
+
* If we find cases like this then we also need to move the concrete DOM
|
500
|
+
* elements corresponding to the moved children to write the re-order to the
|
501
|
+
* DOM.
|
502
|
+
*
|
503
|
+
* 4. Finally, if VNodes have the `key` attribute set on them we check for any
|
504
|
+
* nodes in the old children which have the same key as the first element in
|
505
|
+
* our window on the new children. If we find such a node we handle calling
|
506
|
+
* out to `patch`, moving relevant DOM nodes, and so on, in accordance with
|
507
|
+
* what we find.
|
508
|
+
*
|
509
|
+
* Finally, once we've narrowed our 'windows' to the point that either of them
|
510
|
+
* collapse (i.e. they have length 0) we then handle any remaining VNode
|
511
|
+
* insertion or deletion that needs to happen to get a DOM state that correctly
|
512
|
+
* reflects the new child VNodes. If, for instance, after our window on the old
|
513
|
+
* children has collapsed we still have more nodes on the new children that
|
514
|
+
* we haven't dealt with yet then we need to add them, or if the new children
|
515
|
+
* collapse but we still have unhandled _old_ children then we need to make
|
516
|
+
* sure the corresponding DOM nodes are removed.
|
517
|
+
*
|
518
|
+
* @param parentElm the node into which the parent VNode is rendered
|
519
|
+
* @param oldCh the old children of the parent node
|
520
|
+
* @param newVNode the new VNode which will replace the parent
|
521
|
+
* @param newCh the new children of the parent node
|
522
|
+
*/
|
445
523
|
const updateChildren = (parentElm, oldCh, newVNode, newCh) => {
|
446
524
|
let oldStartIdx = 0;
|
447
525
|
let newStartIdx = 0;
|
@@ -454,7 +532,7 @@ const updateChildren = (parentElm, oldCh, newVNode, newCh) => {
|
|
454
532
|
let node;
|
455
533
|
while (oldStartIdx <= oldEndIdx && newStartIdx <= newEndIdx) {
|
456
534
|
if (oldStartVnode == null) {
|
457
|
-
//
|
535
|
+
// VNode might have been moved left
|
458
536
|
oldStartVnode = oldCh[++oldStartIdx];
|
459
537
|
}
|
460
538
|
else if (oldEndVnode == null) {
|
@@ -467,34 +545,67 @@ const updateChildren = (parentElm, oldCh, newVNode, newCh) => {
|
|
467
545
|
newEndVnode = newCh[--newEndIdx];
|
468
546
|
}
|
469
547
|
else if (isSameVnode(oldStartVnode, newStartVnode)) {
|
548
|
+
// if the start nodes are the same then we should patch the new VNode
|
549
|
+
// onto the old one, and increment our `newStartIdx` and `oldStartIdx`
|
550
|
+
// indices to reflect that. We don't need to move any DOM Nodes around
|
551
|
+
// since things are matched up in order.
|
470
552
|
patch(oldStartVnode, newStartVnode);
|
471
553
|
oldStartVnode = oldCh[++oldStartIdx];
|
472
554
|
newStartVnode = newCh[++newStartIdx];
|
473
555
|
}
|
474
556
|
else if (isSameVnode(oldEndVnode, newEndVnode)) {
|
557
|
+
// likewise, if the end nodes are the same we patch new onto old and
|
558
|
+
// decrement our end indices, and also likewise in this case we don't
|
559
|
+
// need to move any DOM Nodes.
|
475
560
|
patch(oldEndVnode, newEndVnode);
|
476
561
|
oldEndVnode = oldCh[--oldEndIdx];
|
477
562
|
newEndVnode = newCh[--newEndIdx];
|
478
563
|
}
|
479
564
|
else if (isSameVnode(oldStartVnode, newEndVnode)) {
|
480
565
|
patch(oldStartVnode, newEndVnode);
|
566
|
+
// We need to move the element for `oldStartVnode` into a position which
|
567
|
+
// will be appropriate for `newEndVnode`. For this we can use
|
568
|
+
// `.insertBefore` and `oldEndVnode.$elm$.nextSibling`. If there is a
|
569
|
+
// sibling for `oldEndVnode.$elm$` then we want to move the DOM node for
|
570
|
+
// `oldStartVnode` between `oldEndVnode` and it's sibling, like so:
|
571
|
+
//
|
572
|
+
// <old-start-node />
|
573
|
+
// <some-intervening-node />
|
574
|
+
// <old-end-node />
|
575
|
+
// <!-- -> <-- `oldStartVnode.$elm$` should be inserted here
|
576
|
+
// <next-sibling />
|
577
|
+
//
|
578
|
+
// If instead `oldEndVnode.$elm$` has no sibling then we just want to put
|
579
|
+
// the node for `oldStartVnode` at the end of the children of
|
580
|
+
// `parentElm`. Luckily, `Node.nextSibling` will return `null` if there
|
581
|
+
// aren't any siblings, and passing `null` to `Node.insertBefore` will
|
582
|
+
// append it to the children of the parent element.
|
481
583
|
parentElm.insertBefore(oldStartVnode.$elm$, oldEndVnode.$elm$.nextSibling);
|
482
584
|
oldStartVnode = oldCh[++oldStartIdx];
|
483
585
|
newEndVnode = newCh[--newEndIdx];
|
484
586
|
}
|
485
587
|
else if (isSameVnode(oldEndVnode, newStartVnode)) {
|
486
588
|
patch(oldEndVnode, newStartVnode);
|
589
|
+
// We've already checked above if `oldStartVnode` and `newStartVnode` are
|
590
|
+
// the same node, so since we're here we know that they are not. Thus we
|
591
|
+
// can move the element for `oldEndVnode` _before_ the element for
|
592
|
+
// `oldStartVnode`, leaving `oldStartVnode` to be reconciled in the
|
593
|
+
// future.
|
487
594
|
parentElm.insertBefore(oldEndVnode.$elm$, oldStartVnode.$elm$);
|
488
595
|
oldEndVnode = oldCh[--oldEndIdx];
|
489
596
|
newStartVnode = newCh[++newStartIdx];
|
490
597
|
}
|
491
598
|
else {
|
492
599
|
{
|
493
|
-
//
|
600
|
+
// We either didn't find an element in the old children that matches
|
601
|
+
// the key of the first new child OR the build is not using `key`
|
602
|
+
// attributes at all. In either case we need to create a new element
|
603
|
+
// for the new node.
|
494
604
|
node = createElm(oldCh && oldCh[newStartIdx], newVNode, newStartIdx);
|
495
605
|
newStartVnode = newCh[++newStartIdx];
|
496
606
|
}
|
497
607
|
if (node) {
|
608
|
+
// if we created a new node then handle inserting it to the DOM
|
498
609
|
{
|
499
610
|
oldStartVnode.$elm$.parentNode.insertBefore(node, oldStartVnode.$elm$);
|
500
611
|
}
|
@@ -502,20 +613,49 @@ const updateChildren = (parentElm, oldCh, newVNode, newCh) => {
|
|
502
613
|
}
|
503
614
|
}
|
504
615
|
if (oldStartIdx > oldEndIdx) {
|
616
|
+
// we have some more new nodes to add which don't match up with old nodes
|
505
617
|
addVnodes(parentElm, newCh[newEndIdx + 1] == null ? null : newCh[newEndIdx + 1].$elm$, newVNode, newCh, newStartIdx, newEndIdx);
|
506
618
|
}
|
507
619
|
else if (newStartIdx > newEndIdx) {
|
620
|
+
// there are nodes in the `oldCh` array which no longer correspond to nodes
|
621
|
+
// in the new array, so lets remove them (which entails cleaning up the
|
622
|
+
// relevant DOM nodes)
|
508
623
|
removeVnodes(oldCh, oldStartIdx, oldEndIdx);
|
509
624
|
}
|
510
625
|
};
|
511
|
-
|
626
|
+
/**
|
627
|
+
* Compare two VNodes to determine if they are the same
|
628
|
+
*
|
629
|
+
* **NB**: This function is an equality _heuristic_ based on the available
|
630
|
+
* information set on the two VNodes and can be misleading under certain
|
631
|
+
* circumstances. In particular, if the two nodes do not have `key` attrs
|
632
|
+
* (available under `$key$` on VNodes) then the function falls back on merely
|
633
|
+
* checking that they have the same tag.
|
634
|
+
*
|
635
|
+
* So, in other words, if `key` attrs are not set on VNodes which may be
|
636
|
+
* changing order within a `children` array or something along those lines then
|
637
|
+
* we could obtain a false positive and then have to do needless re-rendering.
|
638
|
+
*
|
639
|
+
* @param leftVNode the first VNode to check
|
640
|
+
* @param rightVNode the second VNode to check
|
641
|
+
* @returns whether they're equal or not
|
642
|
+
*/
|
643
|
+
const isSameVnode = (leftVNode, rightVNode) => {
|
512
644
|
// compare if two vnode to see if they're "technically" the same
|
513
645
|
// need to have the same element tag, and same key to be the same
|
514
|
-
if (
|
646
|
+
if (leftVNode.$tag$ === rightVNode.$tag$) {
|
515
647
|
return true;
|
516
648
|
}
|
517
649
|
return false;
|
518
650
|
};
|
651
|
+
/**
|
652
|
+
* Handle reconciling an outdated VNode with a new one which corresponds to
|
653
|
+
* it. This function handles flushing updates to the DOM and reconciling the
|
654
|
+
* children of the two nodes (if any).
|
655
|
+
*
|
656
|
+
* @param oldVNode an old VNode whose DOM element and children we want to update
|
657
|
+
* @param newVNode a new VNode representing an updated version of the old one
|
658
|
+
*/
|
519
659
|
const patch = (oldVNode, newVNode) => {
|
520
660
|
const elm = (newVNode.$elm$ = oldVNode.$elm$);
|
521
661
|
const oldChildren = oldVNode.$children$;
|
@@ -528,7 +668,6 @@ const patch = (oldVNode, newVNode) => {
|
|
528
668
|
// only add this to the when the compiler sees we're using an svg somewhere
|
529
669
|
isSvgMode = tag === 'svg' ? true : tag === 'foreignObject' ? false : isSvgMode;
|
530
670
|
}
|
531
|
-
// element node
|
532
671
|
{
|
533
672
|
{
|
534
673
|
// either this is the first render of an element OR it's an update
|
@@ -539,6 +678,7 @@ const patch = (oldVNode, newVNode) => {
|
|
539
678
|
}
|
540
679
|
if (oldChildren !== null && newChildren !== null) {
|
541
680
|
// looks like there's child vnodes for both the old and new vnodes
|
681
|
+
// so we need to call `updateChildren` to reconcile them
|
542
682
|
updateChildren(elm, oldChildren, newVNode, newChildren);
|
543
683
|
}
|
544
684
|
else if (newChildren !== null) {
|
@@ -576,7 +716,7 @@ const renderVdom = (hostRef, renderFnResults) => {
|
|
576
716
|
const rootVnode = isHost(renderFnResults) ? renderFnResults : h(null, null, renderFnResults);
|
577
717
|
hostTagName = hostElm.tagName;
|
578
718
|
rootVnode.$tag$ = null;
|
579
|
-
rootVnode.$flags$ |= 4 /* isHost */;
|
719
|
+
rootVnode.$flags$ |= 4 /* VNODE_FLAGS.isHost */;
|
580
720
|
hostRef.$vnode$ = rootVnode;
|
581
721
|
rootVnode.$elm$ = oldVNode.$elm$ = (hostElm.shadowRoot || hostElm );
|
582
722
|
{
|
@@ -604,10 +744,10 @@ const attachToAncestor = (hostRef, ancestorComponent) => {
|
|
604
744
|
};
|
605
745
|
const scheduleUpdate = (hostRef, isInitialLoad) => {
|
606
746
|
{
|
607
|
-
hostRef.$flags$ |= 16 /* isQueuedForUpdate */;
|
747
|
+
hostRef.$flags$ |= 16 /* HOST_FLAGS.isQueuedForUpdate */;
|
608
748
|
}
|
609
|
-
if (hostRef.$flags$ & 4 /* isWaitingForChildren */) {
|
610
|
-
hostRef.$flags$ |= 512 /* needsRerender */;
|
749
|
+
if (hostRef.$flags$ & 4 /* HOST_FLAGS.isWaitingForChildren */) {
|
750
|
+
hostRef.$flags$ |= 512 /* HOST_FLAGS.needsRerender */;
|
611
751
|
return;
|
612
752
|
}
|
613
753
|
attachToAncestor(hostRef, hostRef.$ancestorComponent$);
|
@@ -654,7 +794,7 @@ const updateComponent = async (hostRef, instance, isInitialLoad) => {
|
|
654
794
|
}
|
655
795
|
else {
|
656
796
|
Promise.all(childrenPromises).then(postUpdate);
|
657
|
-
hostRef.$flags$ |= 4 /* isWaitingForChildren */;
|
797
|
+
hostRef.$flags$ |= 4 /* HOST_FLAGS.isWaitingForChildren */;
|
658
798
|
childrenPromises.length = 0;
|
659
799
|
}
|
660
800
|
}
|
@@ -664,10 +804,10 @@ const callRender = (hostRef, instance, elm) => {
|
|
664
804
|
renderingRef = instance;
|
665
805
|
instance = instance.render() ;
|
666
806
|
{
|
667
|
-
hostRef.$flags$ &= ~16 /* isQueuedForUpdate */;
|
807
|
+
hostRef.$flags$ &= ~16 /* HOST_FLAGS.isQueuedForUpdate */;
|
668
808
|
}
|
669
809
|
{
|
670
|
-
hostRef.$flags$ |= 2 /* hasRendered */;
|
810
|
+
hostRef.$flags$ |= 2 /* HOST_FLAGS.hasRendered */;
|
671
811
|
}
|
672
812
|
{
|
673
813
|
{
|
@@ -693,8 +833,8 @@ const postUpdateComponent = (hostRef) => {
|
|
693
833
|
const endPostUpdate = createTime('postUpdate', tagName);
|
694
834
|
const instance = hostRef.$lazyInstance$ ;
|
695
835
|
const ancestorComponent = hostRef.$ancestorComponent$;
|
696
|
-
if (!(hostRef.$flags$ & 64 /* hasLoadedComponent */)) {
|
697
|
-
hostRef.$flags$ |= 64 /* hasLoadedComponent */;
|
836
|
+
if (!(hostRef.$flags$ & 64 /* HOST_FLAGS.hasLoadedComponent */)) {
|
837
|
+
hostRef.$flags$ |= 64 /* HOST_FLAGS.hasLoadedComponent */;
|
698
838
|
{
|
699
839
|
// DOM WRITE!
|
700
840
|
addHydratedFlag(elm);
|
@@ -720,10 +860,10 @@ const postUpdateComponent = (hostRef) => {
|
|
720
860
|
hostRef.$onRenderResolve$();
|
721
861
|
hostRef.$onRenderResolve$ = undefined;
|
722
862
|
}
|
723
|
-
if (hostRef.$flags$ & 512 /* needsRerender */) {
|
863
|
+
if (hostRef.$flags$ & 512 /* HOST_FLAGS.needsRerender */) {
|
724
864
|
nextTick(() => scheduleUpdate(hostRef, false));
|
725
865
|
}
|
726
|
-
hostRef.$flags$ &= ~(4 /* isWaitingForChildren */ | 512 /* needsRerender */);
|
866
|
+
hostRef.$flags$ &= ~(4 /* HOST_FLAGS.isWaitingForChildren */ | 512 /* HOST_FLAGS.needsRerender */);
|
727
867
|
}
|
728
868
|
// ( •_•)
|
729
869
|
// ( •_•)>⌐■-■
|
@@ -734,7 +874,7 @@ const forceUpdate = (ref) => {
|
|
734
874
|
const hostRef = getHostRef(ref);
|
735
875
|
const isConnected = hostRef.$hostElement$.isConnected;
|
736
876
|
if (isConnected &&
|
737
|
-
(hostRef.$flags$ & (2 /* hasRendered */ | 16 /* isQueuedForUpdate */)) === 2 /* hasRendered */) {
|
877
|
+
(hostRef.$flags$ & (2 /* HOST_FLAGS.hasRendered */ | 16 /* HOST_FLAGS.isQueuedForUpdate */)) === 2 /* HOST_FLAGS.hasRendered */) {
|
738
878
|
scheduleUpdate(hostRef, false);
|
739
879
|
}
|
740
880
|
// Returns "true" when the forced update was successfully scheduled
|
@@ -791,7 +931,7 @@ const addHydratedFlag = (elm) => elm.classList.add('hydrated')
|
|
791
931
|
const parsePropertyValue = (propValue, propType) => {
|
792
932
|
// ensure this value is of the correct prop type
|
793
933
|
if (propValue != null && !isComplexType(propValue)) {
|
794
|
-
if (propType & 1 /* String */) {
|
934
|
+
if (propType & 1 /* MEMBER_FLAGS.String */) {
|
795
935
|
// could have been passed as a number or boolean
|
796
936
|
// but we still want it as a string
|
797
937
|
return String(propValue);
|
@@ -814,12 +954,12 @@ const setValue = (ref, propName, newVal, cmpMeta) => {
|
|
814
954
|
// explicitly check for NaN on both sides, as `NaN === NaN` is always false
|
815
955
|
const areBothNaN = Number.isNaN(oldVal) && Number.isNaN(newVal);
|
816
956
|
const didValueChange = newVal !== oldVal && !areBothNaN;
|
817
|
-
if ((!(flags & 8 /* isConstructingInstance */) || oldVal === undefined) && didValueChange) {
|
957
|
+
if ((!(flags & 8 /* HOST_FLAGS.isConstructingInstance */) || oldVal === undefined) && didValueChange) {
|
818
958
|
// gadzooks! the property's value has changed!!
|
819
959
|
// set our new value!
|
820
960
|
hostRef.$instanceValues$.set(propName, newVal);
|
821
961
|
if (instance) {
|
822
|
-
if ((flags & (2 /* hasRendered */ | 16 /* isQueuedForUpdate */)) === 2 /* hasRendered */) {
|
962
|
+
if ((flags & (2 /* HOST_FLAGS.hasRendered */ | 16 /* HOST_FLAGS.isQueuedForUpdate */)) === 2 /* HOST_FLAGS.hasRendered */) {
|
823
963
|
// looks like this value actually changed, so we've got work to do!
|
824
964
|
// but only if we've already rendered, otherwise just chill out
|
825
965
|
// queue that we need to do an update, but don't worry about queuing
|
@@ -835,8 +975,8 @@ const proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
835
975
|
const members = Object.entries(cmpMeta.$members$);
|
836
976
|
const prototype = Cstr.prototype;
|
837
977
|
members.map(([memberName, [memberFlags]]) => {
|
838
|
-
if ((memberFlags & 31 /* Prop */ ||
|
839
|
-
((flags & 2 /* proxyState */) && memberFlags & 32 /* State */))) {
|
978
|
+
if ((memberFlags & 31 /* MEMBER_FLAGS.Prop */ ||
|
979
|
+
((flags & 2 /* PROXY_FLAGS.proxyState */) && memberFlags & 32 /* MEMBER_FLAGS.State */))) {
|
840
980
|
// proxyComponent - prop
|
841
981
|
Object.defineProperty(prototype, memberName, {
|
842
982
|
get() {
|
@@ -852,7 +992,7 @@ const proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
852
992
|
});
|
853
993
|
}
|
854
994
|
});
|
855
|
-
if ((flags & 1 /* isElementConstructor */)) {
|
995
|
+
if ((flags & 1 /* PROXY_FLAGS.isElementConstructor */)) {
|
856
996
|
const attrNameToPropName = new Map();
|
857
997
|
prototype.attributeChangedCallback = function (attrName, _oldValue, newValue) {
|
858
998
|
plt.jmp(() => {
|
@@ -908,7 +1048,7 @@ const proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
908
1048
|
// create an array of attributes to observe
|
909
1049
|
// and also create a map of html attribute name to js property name
|
910
1050
|
Cstr.observedAttributes = members
|
911
|
-
.filter(([_, m]) => m[0] & 15 /* HasAttribute */) // filter to only keep props that should match attributes
|
1051
|
+
.filter(([_, m]) => m[0] & 15 /* MEMBER_FLAGS.HasAttribute */) // filter to only keep props that should match attributes
|
912
1052
|
.map(([propName, m]) => {
|
913
1053
|
const attrName = m[1] || propName;
|
914
1054
|
attrNameToPropName.set(attrName, propName);
|
@@ -920,10 +1060,10 @@ const proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
920
1060
|
};
|
921
1061
|
const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId, Cstr) => {
|
922
1062
|
// initializeComponent
|
923
|
-
if ((hostRef.$flags$ & 32 /* hasInitializedComponent */) === 0) {
|
1063
|
+
if ((hostRef.$flags$ & 32 /* HOST_FLAGS.hasInitializedComponent */) === 0) {
|
924
1064
|
{
|
925
1065
|
// we haven't initialized this element yet
|
926
|
-
hostRef.$flags$ |= 32 /* hasInitializedComponent */;
|
1066
|
+
hostRef.$flags$ |= 32 /* HOST_FLAGS.hasInitializedComponent */;
|
927
1067
|
// lazy loaded components
|
928
1068
|
// request the component's implementation to be
|
929
1069
|
// wired up with the host element
|
@@ -935,7 +1075,7 @@ const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId, Cstr) =>
|
|
935
1075
|
endLoad();
|
936
1076
|
}
|
937
1077
|
if (!Cstr.isProxied) {
|
938
|
-
proxyComponent(Cstr, cmpMeta, 2 /* proxyState */);
|
1078
|
+
proxyComponent(Cstr, cmpMeta, 2 /* PROXY_FLAGS.proxyState */);
|
939
1079
|
Cstr.isProxied = true;
|
940
1080
|
}
|
941
1081
|
const endNewInstance = createTime('createInstance', cmpMeta.$tagName$);
|
@@ -943,7 +1083,7 @@ const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId, Cstr) =>
|
|
943
1083
|
// but let's keep track of when we start and stop
|
944
1084
|
// so that the getters/setters don't incorrectly step on data
|
945
1085
|
{
|
946
|
-
hostRef.$flags$ |= 8 /* isConstructingInstance */;
|
1086
|
+
hostRef.$flags$ |= 8 /* HOST_FLAGS.isConstructingInstance */;
|
947
1087
|
}
|
948
1088
|
// construct the lazy-loaded component implementation
|
949
1089
|
// passing the hostRef is very important during
|
@@ -956,7 +1096,7 @@ const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId, Cstr) =>
|
|
956
1096
|
consoleError(e);
|
957
1097
|
}
|
958
1098
|
{
|
959
|
-
hostRef.$flags$ &= ~8 /* isConstructingInstance */;
|
1099
|
+
hostRef.$flags$ &= ~8 /* HOST_FLAGS.isConstructingInstance */;
|
960
1100
|
}
|
961
1101
|
endNewInstance();
|
962
1102
|
}
|
@@ -966,7 +1106,7 @@ const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId, Cstr) =>
|
|
966
1106
|
const scopeId = getScopeId(cmpMeta);
|
967
1107
|
if (!styles.has(scopeId)) {
|
968
1108
|
const endRegisterStyles = createTime('registerStyles', cmpMeta.$tagName$);
|
969
|
-
registerStyle(scopeId, style, !!(cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */));
|
1109
|
+
registerStyle(scopeId, style, !!(cmpMeta.$flags$ & 1 /* CMP_FLAGS.shadowDomEncapsulation */));
|
970
1110
|
endRegisterStyles();
|
971
1111
|
}
|
972
1112
|
}
|
@@ -988,13 +1128,13 @@ const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId, Cstr) =>
|
|
988
1128
|
}
|
989
1129
|
};
|
990
1130
|
const connectedCallback = (elm) => {
|
991
|
-
if ((plt.$flags$ & 1 /* isTmpDisconnected */) === 0) {
|
1131
|
+
if ((plt.$flags$ & 1 /* PLATFORM_FLAGS.isTmpDisconnected */) === 0) {
|
992
1132
|
const hostRef = getHostRef(elm);
|
993
1133
|
const cmpMeta = hostRef.$cmpMeta$;
|
994
1134
|
const endConnected = createTime('connectedCallback', cmpMeta.$tagName$);
|
995
|
-
if (!(hostRef.$flags$ & 1 /* hasConnected */)) {
|
1135
|
+
if (!(hostRef.$flags$ & 1 /* HOST_FLAGS.hasConnected */)) {
|
996
1136
|
// first time this component has connected
|
997
|
-
hostRef.$flags$ |= 1 /* hasConnected */;
|
1137
|
+
hostRef.$flags$ |= 1 /* HOST_FLAGS.hasConnected */;
|
998
1138
|
{
|
999
1139
|
// find the first ancestor component (if there is one) and register
|
1000
1140
|
// this component as one of the actively loading child components for its ancestor
|
@@ -1014,7 +1154,7 @@ const connectedCallback = (elm) => {
|
|
1014
1154
|
// https://developers.google.com/web/fundamentals/web-components/best-practices#lazy-properties
|
1015
1155
|
if (cmpMeta.$members$) {
|
1016
1156
|
Object.entries(cmpMeta.$members$).map(([memberName, [memberFlags]]) => {
|
1017
|
-
if (memberFlags & 31 /* Prop */ && elm.hasOwnProperty(memberName)) {
|
1157
|
+
if (memberFlags & 31 /* MEMBER_FLAGS.Prop */ && elm.hasOwnProperty(memberName)) {
|
1018
1158
|
const value = elm[memberName];
|
1019
1159
|
delete elm[memberName];
|
1020
1160
|
elm[memberName] = value;
|
@@ -1029,7 +1169,7 @@ const connectedCallback = (elm) => {
|
|
1029
1169
|
}
|
1030
1170
|
};
|
1031
1171
|
const disconnectedCallback = (elm) => {
|
1032
|
-
if ((plt.$flags$ & 1 /* isTmpDisconnected */) === 0) {
|
1172
|
+
if ((plt.$flags$ & 1 /* PLATFORM_FLAGS.isTmpDisconnected */) === 0) {
|
1033
1173
|
getHostRef(elm);
|
1034
1174
|
}
|
1035
1175
|
};
|
@@ -1065,7 +1205,7 @@ const bootstrapLazy = (lazyBundles, options = {}) => {
|
|
1065
1205
|
super(self);
|
1066
1206
|
self = this;
|
1067
1207
|
registerHost(self, cmpMeta);
|
1068
|
-
if (cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) {
|
1208
|
+
if (cmpMeta.$flags$ & 1 /* CMP_FLAGS.shadowDomEncapsulation */) {
|
1069
1209
|
// this component is using shadow dom
|
1070
1210
|
// and this browser supports shadow dom
|
1071
1211
|
// add the read-only property "shadowRoot" to the host element
|
@@ -1100,7 +1240,7 @@ const bootstrapLazy = (lazyBundles, options = {}) => {
|
|
1100
1240
|
cmpMeta.$lazyBundleId$ = lazyBundle[0];
|
1101
1241
|
if (!exclude.includes(tagName) && !customElements.get(tagName)) {
|
1102
1242
|
cmpTags.push(tagName);
|
1103
|
-
customElements.define(tagName, proxyComponent(HostElement, cmpMeta, 1 /* isElementConstructor */));
|
1243
|
+
customElements.define(tagName, proxyComponent(HostElement, cmpMeta, 1 /* PROXY_FLAGS.isElementConstructor */));
|
1104
1244
|
}
|
1105
1245
|
});
|
1106
1246
|
});
|
@@ -1122,7 +1262,7 @@ const bootstrapLazy = (lazyBundles, options = {}) => {
|
|
1122
1262
|
// Fallback appLoad event
|
1123
1263
|
endBootstrap();
|
1124
1264
|
};
|
1125
|
-
const hostRefs = new WeakMap();
|
1265
|
+
const hostRefs = /*@__PURE__*/ new WeakMap();
|
1126
1266
|
const getHostRef = (ref) => hostRefs.get(ref);
|
1127
1267
|
const registerInstance = (lazyInstance, hostRef) => hostRefs.set((hostRef.$lazyInstance$ = lazyInstance), hostRef);
|
1128
1268
|
const registerHost = (elm, cmpMeta) => {
|
@@ -1163,14 +1303,14 @@ const loadModule = (cmpMeta, hostRef, hmrVersionId) => {
|
|
1163
1303
|
return importedModule[exportName];
|
1164
1304
|
}, consoleError);
|
1165
1305
|
};
|
1166
|
-
const styles = new Map();
|
1306
|
+
const styles = /*@__PURE__*/ new Map();
|
1167
1307
|
const queueDomReads = [];
|
1168
1308
|
const queueDomWrites = [];
|
1169
1309
|
const queueTask = (queue, write) => (cb) => {
|
1170
1310
|
queue.push(cb);
|
1171
1311
|
if (!queuePending) {
|
1172
1312
|
queuePending = true;
|
1173
|
-
if (write && plt.$flags$ & 4 /* queueSync */) {
|
1313
|
+
if (write && plt.$flags$ & 4 /* PLATFORM_FLAGS.queueSync */) {
|
1174
1314
|
nextTick(flush);
|
1175
1315
|
}
|
1176
1316
|
else {
|
package/dist/esm/loader.js
CHANGED
@@ -1,7 +1,7 @@
|
|
1
|
-
import { p as promiseResolve, b as bootstrapLazy } from './index-
|
1
|
+
import { p as promiseResolve, b as bootstrapLazy } from './index-f468fcee.js';
|
2
2
|
|
3
3
|
/*
|
4
|
-
Stencil Client Patch Esm v2.
|
4
|
+
Stencil Client Patch Esm v2.18.0 | MIT Licensed | https://stenciljs.com
|
5
5
|
*/
|
6
6
|
const patchEsm = () => {
|
7
7
|
return promiseResolve();
|
@@ -1,7 +1,7 @@
|
|
1
|
-
import { p as promiseResolve, b as bootstrapLazy } from './index-
|
1
|
+
import { p as promiseResolve, b as bootstrapLazy } from './index-f468fcee.js';
|
2
2
|
|
3
3
|
/*
|
4
|
-
Stencil Client Patch Browser v2.
|
4
|
+
Stencil Client Patch Browser v2.18.0 | MIT Licensed | https://stenciljs.com
|
5
5
|
*/
|
6
6
|
const patchBrowser = () => {
|
7
7
|
const importMeta = import.meta.url;
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { h, g as getRenderingRef, f as forceUpdate, r as registerInstance } from './index-
|
1
|
+
import { h, g as getRenderingRef, f as forceUpdate, r as registerInstance } from './index-f468fcee.js';
|
2
2
|
|
3
3
|
const Alien = props => {
|
4
4
|
const hex = props.hex || 'currentColor';
|
File without changes
|