proto-sudoku-wc 0.0.464 → 0.0.465
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 +3 -3
@@ -63,7 +63,7 @@ const uniqueTime = (key, measureText) => {
|
|
63
63
|
};
|
64
64
|
}
|
65
65
|
};
|
66
|
-
const rootAppliedStyles = new WeakMap();
|
66
|
+
const rootAppliedStyles = /*@__PURE__*/ new WeakMap();
|
67
67
|
const registerStyle = (scopeId, cssText, allowCS) => {
|
68
68
|
let style = styles.get(scopeId);
|
69
69
|
if (supportsConstructableStylesheets && allowCS) {
|
@@ -85,7 +85,7 @@ const addStyle = (styleContainerNode, cmpMeta, mode, hostElm) => {
|
|
85
85
|
const style = styles.get(scopeId);
|
86
86
|
// if an element is NOT connected then getRootNode() will return the wrong root node
|
87
87
|
// so the fallback is to always use the document for the root node in those cases
|
88
|
-
styleContainerNode = styleContainerNode.nodeType === 11 /* DocumentFragment */ ? styleContainerNode : doc;
|
88
|
+
styleContainerNode = styleContainerNode.nodeType === 11 /* NODE_TYPE.DocumentFragment */ ? styleContainerNode : doc;
|
89
89
|
if (style) {
|
90
90
|
if (typeof style === 'string') {
|
91
91
|
styleContainerNode = styleContainerNode.head || styleContainerNode;
|
@@ -119,7 +119,7 @@ const attachStyles = (hostRef) => {
|
|
119
119
|
const flags = cmpMeta.$flags$;
|
120
120
|
const endAttachStyles = createTime('attachStyles', cmpMeta.$tagName$);
|
121
121
|
const scopeId = addStyle(elm.shadowRoot ? elm.shadowRoot : elm.getRootNode(), cmpMeta);
|
122
|
-
if (flags & 10 /* needsScopedEncapsulation */) {
|
122
|
+
if (flags & 10 /* CMP_FLAGS.needsScopedEncapsulation */) {
|
123
123
|
// only required when we're NOT using native shadow dom (slot)
|
124
124
|
// or this browser doesn't support native shadow dom
|
125
125
|
// and this host element was NOT created with SSR
|
@@ -352,7 +352,7 @@ const setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
|
|
352
352
|
}
|
353
353
|
}
|
354
354
|
}
|
355
|
-
else if ((!isProp || flags & 4 /* isHost */ || isSvg) && !isComplex) {
|
355
|
+
else if ((!isProp || flags & 4 /* VNODE_FLAGS.isHost */ || isSvg) && !isComplex) {
|
356
356
|
newValue = newValue === true ? '' : newValue;
|
357
357
|
{
|
358
358
|
elm.setAttribute(memberName, newValue);
|
@@ -367,7 +367,7 @@ const updateElement = (oldVnode, newVnode, isSvgMode, memberName) => {
|
|
367
367
|
// if the element passed in is a shadow root, which is a document fragment
|
368
368
|
// then we want to be adding attrs/props to the shadow root's "host" element
|
369
369
|
// if it's not a shadow root, then we add attrs/props to the same element
|
370
|
-
const elm = newVnode.$elm$.nodeType === 11 /* DocumentFragment */ && newVnode.$elm$.host
|
370
|
+
const elm = newVnode.$elm$.nodeType === 11 /* NODE_TYPE.DocumentFragment */ && newVnode.$elm$.host
|
371
371
|
? newVnode.$elm$.host
|
372
372
|
: newVnode.$elm$;
|
373
373
|
const oldVnodeAttrs = (oldVnode && oldVnode.$attrs$) || EMPTY_OBJ;
|
@@ -385,6 +385,16 @@ const updateElement = (oldVnode, newVnode, isSvgMode, memberName) => {
|
|
385
385
|
setAccessor(elm, memberName, oldVnodeAttrs[memberName], newVnodeAttrs[memberName], isSvgMode, newVnode.$flags$);
|
386
386
|
}
|
387
387
|
};
|
388
|
+
/**
|
389
|
+
* Create a DOM Node corresponding to one of the children of a given VNode.
|
390
|
+
*
|
391
|
+
* @param oldParentVNode the parent VNode from the previous render
|
392
|
+
* @param newParentVNode the parent VNode from the current render
|
393
|
+
* @param childIndex the index of the VNode, in the _new_ parent node's
|
394
|
+
* children, for which we will create a new DOM node
|
395
|
+
* @param parentElm the parent DOM node which our new node will be a child of
|
396
|
+
* @returns the newly created node
|
397
|
+
*/
|
388
398
|
const createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
|
389
399
|
// tslint:disable-next-line: prefer-const
|
390
400
|
const newVNode = newParentVNode.$children$[childIndex];
|
@@ -464,6 +474,74 @@ const removeVnodes = (vnodes, startIdx, endIdx, vnode, elm) => {
|
|
464
474
|
}
|
465
475
|
}
|
466
476
|
};
|
477
|
+
/**
|
478
|
+
* Reconcile the children of a new VNode with the children of an old VNode by
|
479
|
+
* traversing the two collections of children, identifying nodes that are
|
480
|
+
* conserved or changed, calling out to `patch` to make any necessary
|
481
|
+
* updates to the DOM, and rearranging DOM nodes as needed.
|
482
|
+
*
|
483
|
+
* The algorithm for reconciling children works by analyzing two 'windows' onto
|
484
|
+
* the two arrays of children (`oldCh` and `newCh`). We keep track of the
|
485
|
+
* 'windows' by storing start and end indices and references to the
|
486
|
+
* corresponding array entries. Initially the two 'windows' are basically equal
|
487
|
+
* to the entire array, but we progressively narrow the windows until there are
|
488
|
+
* no children left to update by doing the following:
|
489
|
+
*
|
490
|
+
* 1. Skip any `null` entries at the beginning or end of the two arrays, so
|
491
|
+
* that if we have an initial array like the following we'll end up dealing
|
492
|
+
* only with a window bounded by the highlighted elements:
|
493
|
+
*
|
494
|
+
* [null, null, VNode1 , ... , VNode2, null, null]
|
495
|
+
* ^^^^^^ ^^^^^^
|
496
|
+
*
|
497
|
+
* 2. Check to see if the elements at the head and tail positions are equal
|
498
|
+
* across the windows. This will basically detect elements which haven't
|
499
|
+
* been added, removed, or changed position, i.e. if you had the following
|
500
|
+
* VNode elements (represented as HTML):
|
501
|
+
*
|
502
|
+
* oldVNode: `<div><p><span>HEY</span></p></div>`
|
503
|
+
* newVNode: `<div><p><span>THERE</span></p></div>`
|
504
|
+
*
|
505
|
+
* Then when comparing the children of the `<div>` tag we check the equality
|
506
|
+
* of the VNodes corresponding to the `<p>` tags and, since they are the
|
507
|
+
* same tag in the same position, we'd be able to avoid completely
|
508
|
+
* re-rendering the subtree under them with a new DOM element and would just
|
509
|
+
* call out to `patch` to handle reconciling their children and so on.
|
510
|
+
*
|
511
|
+
* 3. Check, for both windows, to see if the element at the beginning of the
|
512
|
+
* window corresponds to the element at the end of the other window. This is
|
513
|
+
* a heuristic which will let us identify _some_ situations in which
|
514
|
+
* elements have changed position, for instance it _should_ detect that the
|
515
|
+
* children nodes themselves have not changed but merely moved in the
|
516
|
+
* following example:
|
517
|
+
*
|
518
|
+
* oldVNode: `<div><element-one /><element-two /></div>`
|
519
|
+
* newVNode: `<div><element-two /><element-one /></div>`
|
520
|
+
*
|
521
|
+
* If we find cases like this then we also need to move the concrete DOM
|
522
|
+
* elements corresponding to the moved children to write the re-order to the
|
523
|
+
* DOM.
|
524
|
+
*
|
525
|
+
* 4. Finally, if VNodes have the `key` attribute set on them we check for any
|
526
|
+
* nodes in the old children which have the same key as the first element in
|
527
|
+
* our window on the new children. If we find such a node we handle calling
|
528
|
+
* out to `patch`, moving relevant DOM nodes, and so on, in accordance with
|
529
|
+
* what we find.
|
530
|
+
*
|
531
|
+
* Finally, once we've narrowed our 'windows' to the point that either of them
|
532
|
+
* collapse (i.e. they have length 0) we then handle any remaining VNode
|
533
|
+
* insertion or deletion that needs to happen to get a DOM state that correctly
|
534
|
+
* reflects the new child VNodes. If, for instance, after our window on the old
|
535
|
+
* children has collapsed we still have more nodes on the new children that
|
536
|
+
* we haven't dealt with yet then we need to add them, or if the new children
|
537
|
+
* collapse but we still have unhandled _old_ children then we need to make
|
538
|
+
* sure the corresponding DOM nodes are removed.
|
539
|
+
*
|
540
|
+
* @param parentElm the node into which the parent VNode is rendered
|
541
|
+
* @param oldCh the old children of the parent node
|
542
|
+
* @param newVNode the new VNode which will replace the parent
|
543
|
+
* @param newCh the new children of the parent node
|
544
|
+
*/
|
467
545
|
const updateChildren = (parentElm, oldCh, newVNode, newCh) => {
|
468
546
|
let oldStartIdx = 0;
|
469
547
|
let newStartIdx = 0;
|
@@ -476,7 +554,7 @@ const updateChildren = (parentElm, oldCh, newVNode, newCh) => {
|
|
476
554
|
let node;
|
477
555
|
while (oldStartIdx <= oldEndIdx && newStartIdx <= newEndIdx) {
|
478
556
|
if (oldStartVnode == null) {
|
479
|
-
//
|
557
|
+
// VNode might have been moved left
|
480
558
|
oldStartVnode = oldCh[++oldStartIdx];
|
481
559
|
}
|
482
560
|
else if (oldEndVnode == null) {
|
@@ -489,34 +567,67 @@ const updateChildren = (parentElm, oldCh, newVNode, newCh) => {
|
|
489
567
|
newEndVnode = newCh[--newEndIdx];
|
490
568
|
}
|
491
569
|
else if (isSameVnode(oldStartVnode, newStartVnode)) {
|
570
|
+
// if the start nodes are the same then we should patch the new VNode
|
571
|
+
// onto the old one, and increment our `newStartIdx` and `oldStartIdx`
|
572
|
+
// indices to reflect that. We don't need to move any DOM Nodes around
|
573
|
+
// since things are matched up in order.
|
492
574
|
patch(oldStartVnode, newStartVnode);
|
493
575
|
oldStartVnode = oldCh[++oldStartIdx];
|
494
576
|
newStartVnode = newCh[++newStartIdx];
|
495
577
|
}
|
496
578
|
else if (isSameVnode(oldEndVnode, newEndVnode)) {
|
579
|
+
// likewise, if the end nodes are the same we patch new onto old and
|
580
|
+
// decrement our end indices, and also likewise in this case we don't
|
581
|
+
// need to move any DOM Nodes.
|
497
582
|
patch(oldEndVnode, newEndVnode);
|
498
583
|
oldEndVnode = oldCh[--oldEndIdx];
|
499
584
|
newEndVnode = newCh[--newEndIdx];
|
500
585
|
}
|
501
586
|
else if (isSameVnode(oldStartVnode, newEndVnode)) {
|
502
587
|
patch(oldStartVnode, newEndVnode);
|
588
|
+
// We need to move the element for `oldStartVnode` into a position which
|
589
|
+
// will be appropriate for `newEndVnode`. For this we can use
|
590
|
+
// `.insertBefore` and `oldEndVnode.$elm$.nextSibling`. If there is a
|
591
|
+
// sibling for `oldEndVnode.$elm$` then we want to move the DOM node for
|
592
|
+
// `oldStartVnode` between `oldEndVnode` and it's sibling, like so:
|
593
|
+
//
|
594
|
+
// <old-start-node />
|
595
|
+
// <some-intervening-node />
|
596
|
+
// <old-end-node />
|
597
|
+
// <!-- -> <-- `oldStartVnode.$elm$` should be inserted here
|
598
|
+
// <next-sibling />
|
599
|
+
//
|
600
|
+
// If instead `oldEndVnode.$elm$` has no sibling then we just want to put
|
601
|
+
// the node for `oldStartVnode` at the end of the children of
|
602
|
+
// `parentElm`. Luckily, `Node.nextSibling` will return `null` if there
|
603
|
+
// aren't any siblings, and passing `null` to `Node.insertBefore` will
|
604
|
+
// append it to the children of the parent element.
|
503
605
|
parentElm.insertBefore(oldStartVnode.$elm$, oldEndVnode.$elm$.nextSibling);
|
504
606
|
oldStartVnode = oldCh[++oldStartIdx];
|
505
607
|
newEndVnode = newCh[--newEndIdx];
|
506
608
|
}
|
507
609
|
else if (isSameVnode(oldEndVnode, newStartVnode)) {
|
508
610
|
patch(oldEndVnode, newStartVnode);
|
611
|
+
// We've already checked above if `oldStartVnode` and `newStartVnode` are
|
612
|
+
// the same node, so since we're here we know that they are not. Thus we
|
613
|
+
// can move the element for `oldEndVnode` _before_ the element for
|
614
|
+
// `oldStartVnode`, leaving `oldStartVnode` to be reconciled in the
|
615
|
+
// future.
|
509
616
|
parentElm.insertBefore(oldEndVnode.$elm$, oldStartVnode.$elm$);
|
510
617
|
oldEndVnode = oldCh[--oldEndIdx];
|
511
618
|
newStartVnode = newCh[++newStartIdx];
|
512
619
|
}
|
513
620
|
else {
|
514
621
|
{
|
515
|
-
//
|
622
|
+
// We either didn't find an element in the old children that matches
|
623
|
+
// the key of the first new child OR the build is not using `key`
|
624
|
+
// attributes at all. In either case we need to create a new element
|
625
|
+
// for the new node.
|
516
626
|
node = createElm(oldCh && oldCh[newStartIdx], newVNode, newStartIdx);
|
517
627
|
newStartVnode = newCh[++newStartIdx];
|
518
628
|
}
|
519
629
|
if (node) {
|
630
|
+
// if we created a new node then handle inserting it to the DOM
|
520
631
|
{
|
521
632
|
oldStartVnode.$elm$.parentNode.insertBefore(node, oldStartVnode.$elm$);
|
522
633
|
}
|
@@ -524,20 +635,49 @@ const updateChildren = (parentElm, oldCh, newVNode, newCh) => {
|
|
524
635
|
}
|
525
636
|
}
|
526
637
|
if (oldStartIdx > oldEndIdx) {
|
638
|
+
// we have some more new nodes to add which don't match up with old nodes
|
527
639
|
addVnodes(parentElm, newCh[newEndIdx + 1] == null ? null : newCh[newEndIdx + 1].$elm$, newVNode, newCh, newStartIdx, newEndIdx);
|
528
640
|
}
|
529
641
|
else if (newStartIdx > newEndIdx) {
|
642
|
+
// there are nodes in the `oldCh` array which no longer correspond to nodes
|
643
|
+
// in the new array, so lets remove them (which entails cleaning up the
|
644
|
+
// relevant DOM nodes)
|
530
645
|
removeVnodes(oldCh, oldStartIdx, oldEndIdx);
|
531
646
|
}
|
532
647
|
};
|
533
|
-
|
648
|
+
/**
|
649
|
+
* Compare two VNodes to determine if they are the same
|
650
|
+
*
|
651
|
+
* **NB**: This function is an equality _heuristic_ based on the available
|
652
|
+
* information set on the two VNodes and can be misleading under certain
|
653
|
+
* circumstances. In particular, if the two nodes do not have `key` attrs
|
654
|
+
* (available under `$key$` on VNodes) then the function falls back on merely
|
655
|
+
* checking that they have the same tag.
|
656
|
+
*
|
657
|
+
* So, in other words, if `key` attrs are not set on VNodes which may be
|
658
|
+
* changing order within a `children` array or something along those lines then
|
659
|
+
* we could obtain a false positive and then have to do needless re-rendering.
|
660
|
+
*
|
661
|
+
* @param leftVNode the first VNode to check
|
662
|
+
* @param rightVNode the second VNode to check
|
663
|
+
* @returns whether they're equal or not
|
664
|
+
*/
|
665
|
+
const isSameVnode = (leftVNode, rightVNode) => {
|
534
666
|
// compare if two vnode to see if they're "technically" the same
|
535
667
|
// need to have the same element tag, and same key to be the same
|
536
|
-
if (
|
668
|
+
if (leftVNode.$tag$ === rightVNode.$tag$) {
|
537
669
|
return true;
|
538
670
|
}
|
539
671
|
return false;
|
540
672
|
};
|
673
|
+
/**
|
674
|
+
* Handle reconciling an outdated VNode with a new one which corresponds to
|
675
|
+
* it. This function handles flushing updates to the DOM and reconciling the
|
676
|
+
* children of the two nodes (if any).
|
677
|
+
*
|
678
|
+
* @param oldVNode an old VNode whose DOM element and children we want to update
|
679
|
+
* @param newVNode a new VNode representing an updated version of the old one
|
680
|
+
*/
|
541
681
|
const patch = (oldVNode, newVNode) => {
|
542
682
|
const elm = (newVNode.$elm$ = oldVNode.$elm$);
|
543
683
|
const oldChildren = oldVNode.$children$;
|
@@ -550,7 +690,6 @@ const patch = (oldVNode, newVNode) => {
|
|
550
690
|
// only add this to the when the compiler sees we're using an svg somewhere
|
551
691
|
isSvgMode = tag === 'svg' ? true : tag === 'foreignObject' ? false : isSvgMode;
|
552
692
|
}
|
553
|
-
// element node
|
554
693
|
{
|
555
694
|
{
|
556
695
|
// either this is the first render of an element OR it's an update
|
@@ -561,6 +700,7 @@ const patch = (oldVNode, newVNode) => {
|
|
561
700
|
}
|
562
701
|
if (oldChildren !== null && newChildren !== null) {
|
563
702
|
// looks like there's child vnodes for both the old and new vnodes
|
703
|
+
// so we need to call `updateChildren` to reconcile them
|
564
704
|
updateChildren(elm, oldChildren, newVNode, newChildren);
|
565
705
|
}
|
566
706
|
else if (newChildren !== null) {
|
@@ -598,7 +738,7 @@ const renderVdom = (hostRef, renderFnResults) => {
|
|
598
738
|
const rootVnode = isHost(renderFnResults) ? renderFnResults : h(null, null, renderFnResults);
|
599
739
|
hostTagName = hostElm.tagName;
|
600
740
|
rootVnode.$tag$ = null;
|
601
|
-
rootVnode.$flags$ |= 4 /* isHost */;
|
741
|
+
rootVnode.$flags$ |= 4 /* VNODE_FLAGS.isHost */;
|
602
742
|
hostRef.$vnode$ = rootVnode;
|
603
743
|
rootVnode.$elm$ = oldVNode.$elm$ = (hostElm.shadowRoot || hostElm );
|
604
744
|
{
|
@@ -626,10 +766,10 @@ const attachToAncestor = (hostRef, ancestorComponent) => {
|
|
626
766
|
};
|
627
767
|
const scheduleUpdate = (hostRef, isInitialLoad) => {
|
628
768
|
{
|
629
|
-
hostRef.$flags$ |= 16 /* isQueuedForUpdate */;
|
769
|
+
hostRef.$flags$ |= 16 /* HOST_FLAGS.isQueuedForUpdate */;
|
630
770
|
}
|
631
|
-
if (hostRef.$flags$ & 4 /* isWaitingForChildren */) {
|
632
|
-
hostRef.$flags$ |= 512 /* needsRerender */;
|
771
|
+
if (hostRef.$flags$ & 4 /* HOST_FLAGS.isWaitingForChildren */) {
|
772
|
+
hostRef.$flags$ |= 512 /* HOST_FLAGS.needsRerender */;
|
633
773
|
return;
|
634
774
|
}
|
635
775
|
attachToAncestor(hostRef, hostRef.$ancestorComponent$);
|
@@ -676,7 +816,7 @@ const updateComponent = async (hostRef, instance, isInitialLoad) => {
|
|
676
816
|
}
|
677
817
|
else {
|
678
818
|
Promise.all(childrenPromises).then(postUpdate);
|
679
|
-
hostRef.$flags$ |= 4 /* isWaitingForChildren */;
|
819
|
+
hostRef.$flags$ |= 4 /* HOST_FLAGS.isWaitingForChildren */;
|
680
820
|
childrenPromises.length = 0;
|
681
821
|
}
|
682
822
|
}
|
@@ -686,10 +826,10 @@ const callRender = (hostRef, instance, elm) => {
|
|
686
826
|
renderingRef = instance;
|
687
827
|
instance = instance.render() ;
|
688
828
|
{
|
689
|
-
hostRef.$flags$ &= ~16 /* isQueuedForUpdate */;
|
829
|
+
hostRef.$flags$ &= ~16 /* HOST_FLAGS.isQueuedForUpdate */;
|
690
830
|
}
|
691
831
|
{
|
692
|
-
hostRef.$flags$ |= 2 /* hasRendered */;
|
832
|
+
hostRef.$flags$ |= 2 /* HOST_FLAGS.hasRendered */;
|
693
833
|
}
|
694
834
|
{
|
695
835
|
{
|
@@ -715,8 +855,8 @@ const postUpdateComponent = (hostRef) => {
|
|
715
855
|
const endPostUpdate = createTime('postUpdate', tagName);
|
716
856
|
const instance = hostRef.$lazyInstance$ ;
|
717
857
|
const ancestorComponent = hostRef.$ancestorComponent$;
|
718
|
-
if (!(hostRef.$flags$ & 64 /* hasLoadedComponent */)) {
|
719
|
-
hostRef.$flags$ |= 64 /* hasLoadedComponent */;
|
858
|
+
if (!(hostRef.$flags$ & 64 /* HOST_FLAGS.hasLoadedComponent */)) {
|
859
|
+
hostRef.$flags$ |= 64 /* HOST_FLAGS.hasLoadedComponent */;
|
720
860
|
{
|
721
861
|
// DOM WRITE!
|
722
862
|
addHydratedFlag(elm);
|
@@ -742,10 +882,10 @@ const postUpdateComponent = (hostRef) => {
|
|
742
882
|
hostRef.$onRenderResolve$();
|
743
883
|
hostRef.$onRenderResolve$ = undefined;
|
744
884
|
}
|
745
|
-
if (hostRef.$flags$ & 512 /* needsRerender */) {
|
885
|
+
if (hostRef.$flags$ & 512 /* HOST_FLAGS.needsRerender */) {
|
746
886
|
nextTick(() => scheduleUpdate(hostRef, false));
|
747
887
|
}
|
748
|
-
hostRef.$flags$ &= ~(4 /* isWaitingForChildren */ | 512 /* needsRerender */);
|
888
|
+
hostRef.$flags$ &= ~(4 /* HOST_FLAGS.isWaitingForChildren */ | 512 /* HOST_FLAGS.needsRerender */);
|
749
889
|
}
|
750
890
|
// ( •_•)
|
751
891
|
// ( •_•)>⌐■-■
|
@@ -756,7 +896,7 @@ const forceUpdate = (ref) => {
|
|
756
896
|
const hostRef = getHostRef(ref);
|
757
897
|
const isConnected = hostRef.$hostElement$.isConnected;
|
758
898
|
if (isConnected &&
|
759
|
-
(hostRef.$flags$ & (2 /* hasRendered */ | 16 /* isQueuedForUpdate */)) === 2 /* hasRendered */) {
|
899
|
+
(hostRef.$flags$ & (2 /* HOST_FLAGS.hasRendered */ | 16 /* HOST_FLAGS.isQueuedForUpdate */)) === 2 /* HOST_FLAGS.hasRendered */) {
|
760
900
|
scheduleUpdate(hostRef, false);
|
761
901
|
}
|
762
902
|
// Returns "true" when the forced update was successfully scheduled
|
@@ -813,7 +953,7 @@ const addHydratedFlag = (elm) => elm.classList.add('hydrated')
|
|
813
953
|
const parsePropertyValue = (propValue, propType) => {
|
814
954
|
// ensure this value is of the correct prop type
|
815
955
|
if (propValue != null && !isComplexType(propValue)) {
|
816
|
-
if (propType & 1 /* String */) {
|
956
|
+
if (propType & 1 /* MEMBER_FLAGS.String */) {
|
817
957
|
// could have been passed as a number or boolean
|
818
958
|
// but we still want it as a string
|
819
959
|
return String(propValue);
|
@@ -836,12 +976,12 @@ const setValue = (ref, propName, newVal, cmpMeta) => {
|
|
836
976
|
// explicitly check for NaN on both sides, as `NaN === NaN` is always false
|
837
977
|
const areBothNaN = Number.isNaN(oldVal) && Number.isNaN(newVal);
|
838
978
|
const didValueChange = newVal !== oldVal && !areBothNaN;
|
839
|
-
if ((!(flags & 8 /* isConstructingInstance */) || oldVal === undefined) && didValueChange) {
|
979
|
+
if ((!(flags & 8 /* HOST_FLAGS.isConstructingInstance */) || oldVal === undefined) && didValueChange) {
|
840
980
|
// gadzooks! the property's value has changed!!
|
841
981
|
// set our new value!
|
842
982
|
hostRef.$instanceValues$.set(propName, newVal);
|
843
983
|
if (instance) {
|
844
|
-
if ((flags & (2 /* hasRendered */ | 16 /* isQueuedForUpdate */)) === 2 /* hasRendered */) {
|
984
|
+
if ((flags & (2 /* HOST_FLAGS.hasRendered */ | 16 /* HOST_FLAGS.isQueuedForUpdate */)) === 2 /* HOST_FLAGS.hasRendered */) {
|
845
985
|
// looks like this value actually changed, so we've got work to do!
|
846
986
|
// but only if we've already rendered, otherwise just chill out
|
847
987
|
// queue that we need to do an update, but don't worry about queuing
|
@@ -857,8 +997,8 @@ const proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
857
997
|
const members = Object.entries(cmpMeta.$members$);
|
858
998
|
const prototype = Cstr.prototype;
|
859
999
|
members.map(([memberName, [memberFlags]]) => {
|
860
|
-
if ((memberFlags & 31 /* Prop */ ||
|
861
|
-
((flags & 2 /* proxyState */) && memberFlags & 32 /* State */))) {
|
1000
|
+
if ((memberFlags & 31 /* MEMBER_FLAGS.Prop */ ||
|
1001
|
+
((flags & 2 /* PROXY_FLAGS.proxyState */) && memberFlags & 32 /* MEMBER_FLAGS.State */))) {
|
862
1002
|
// proxyComponent - prop
|
863
1003
|
Object.defineProperty(prototype, memberName, {
|
864
1004
|
get() {
|
@@ -874,7 +1014,7 @@ const proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
874
1014
|
});
|
875
1015
|
}
|
876
1016
|
});
|
877
|
-
if ((flags & 1 /* isElementConstructor */)) {
|
1017
|
+
if ((flags & 1 /* PROXY_FLAGS.isElementConstructor */)) {
|
878
1018
|
const attrNameToPropName = new Map();
|
879
1019
|
prototype.attributeChangedCallback = function (attrName, _oldValue, newValue) {
|
880
1020
|
plt.jmp(() => {
|
@@ -930,7 +1070,7 @@ const proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
930
1070
|
// create an array of attributes to observe
|
931
1071
|
// and also create a map of html attribute name to js property name
|
932
1072
|
Cstr.observedAttributes = members
|
933
|
-
.filter(([_, m]) => m[0] & 15 /* HasAttribute */) // filter to only keep props that should match attributes
|
1073
|
+
.filter(([_, m]) => m[0] & 15 /* MEMBER_FLAGS.HasAttribute */) // filter to only keep props that should match attributes
|
934
1074
|
.map(([propName, m]) => {
|
935
1075
|
const attrName = m[1] || propName;
|
936
1076
|
attrNameToPropName.set(attrName, propName);
|
@@ -942,10 +1082,10 @@ const proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
942
1082
|
};
|
943
1083
|
const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId, Cstr) => {
|
944
1084
|
// initializeComponent
|
945
|
-
if ((hostRef.$flags$ & 32 /* hasInitializedComponent */) === 0) {
|
1085
|
+
if ((hostRef.$flags$ & 32 /* HOST_FLAGS.hasInitializedComponent */) === 0) {
|
946
1086
|
{
|
947
1087
|
// we haven't initialized this element yet
|
948
|
-
hostRef.$flags$ |= 32 /* hasInitializedComponent */;
|
1088
|
+
hostRef.$flags$ |= 32 /* HOST_FLAGS.hasInitializedComponent */;
|
949
1089
|
// lazy loaded components
|
950
1090
|
// request the component's implementation to be
|
951
1091
|
// wired up with the host element
|
@@ -957,7 +1097,7 @@ const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId, Cstr) =>
|
|
957
1097
|
endLoad();
|
958
1098
|
}
|
959
1099
|
if (!Cstr.isProxied) {
|
960
|
-
proxyComponent(Cstr, cmpMeta, 2 /* proxyState */);
|
1100
|
+
proxyComponent(Cstr, cmpMeta, 2 /* PROXY_FLAGS.proxyState */);
|
961
1101
|
Cstr.isProxied = true;
|
962
1102
|
}
|
963
1103
|
const endNewInstance = createTime('createInstance', cmpMeta.$tagName$);
|
@@ -965,7 +1105,7 @@ const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId, Cstr) =>
|
|
965
1105
|
// but let's keep track of when we start and stop
|
966
1106
|
// so that the getters/setters don't incorrectly step on data
|
967
1107
|
{
|
968
|
-
hostRef.$flags$ |= 8 /* isConstructingInstance */;
|
1108
|
+
hostRef.$flags$ |= 8 /* HOST_FLAGS.isConstructingInstance */;
|
969
1109
|
}
|
970
1110
|
// construct the lazy-loaded component implementation
|
971
1111
|
// passing the hostRef is very important during
|
@@ -978,7 +1118,7 @@ const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId, Cstr) =>
|
|
978
1118
|
consoleError(e);
|
979
1119
|
}
|
980
1120
|
{
|
981
|
-
hostRef.$flags$ &= ~8 /* isConstructingInstance */;
|
1121
|
+
hostRef.$flags$ &= ~8 /* HOST_FLAGS.isConstructingInstance */;
|
982
1122
|
}
|
983
1123
|
endNewInstance();
|
984
1124
|
}
|
@@ -988,7 +1128,7 @@ const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId, Cstr) =>
|
|
988
1128
|
const scopeId = getScopeId(cmpMeta);
|
989
1129
|
if (!styles.has(scopeId)) {
|
990
1130
|
const endRegisterStyles = createTime('registerStyles', cmpMeta.$tagName$);
|
991
|
-
registerStyle(scopeId, style, !!(cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */));
|
1131
|
+
registerStyle(scopeId, style, !!(cmpMeta.$flags$ & 1 /* CMP_FLAGS.shadowDomEncapsulation */));
|
992
1132
|
endRegisterStyles();
|
993
1133
|
}
|
994
1134
|
}
|
@@ -1010,13 +1150,13 @@ const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId, Cstr) =>
|
|
1010
1150
|
}
|
1011
1151
|
};
|
1012
1152
|
const connectedCallback = (elm) => {
|
1013
|
-
if ((plt.$flags$ & 1 /* isTmpDisconnected */) === 0) {
|
1153
|
+
if ((plt.$flags$ & 1 /* PLATFORM_FLAGS.isTmpDisconnected */) === 0) {
|
1014
1154
|
const hostRef = getHostRef(elm);
|
1015
1155
|
const cmpMeta = hostRef.$cmpMeta$;
|
1016
1156
|
const endConnected = createTime('connectedCallback', cmpMeta.$tagName$);
|
1017
|
-
if (!(hostRef.$flags$ & 1 /* hasConnected */)) {
|
1157
|
+
if (!(hostRef.$flags$ & 1 /* HOST_FLAGS.hasConnected */)) {
|
1018
1158
|
// first time this component has connected
|
1019
|
-
hostRef.$flags$ |= 1 /* hasConnected */;
|
1159
|
+
hostRef.$flags$ |= 1 /* HOST_FLAGS.hasConnected */;
|
1020
1160
|
{
|
1021
1161
|
// find the first ancestor component (if there is one) and register
|
1022
1162
|
// this component as one of the actively loading child components for its ancestor
|
@@ -1036,7 +1176,7 @@ const connectedCallback = (elm) => {
|
|
1036
1176
|
// https://developers.google.com/web/fundamentals/web-components/best-practices#lazy-properties
|
1037
1177
|
if (cmpMeta.$members$) {
|
1038
1178
|
Object.entries(cmpMeta.$members$).map(([memberName, [memberFlags]]) => {
|
1039
|
-
if (memberFlags & 31 /* Prop */ && elm.hasOwnProperty(memberName)) {
|
1179
|
+
if (memberFlags & 31 /* MEMBER_FLAGS.Prop */ && elm.hasOwnProperty(memberName)) {
|
1040
1180
|
const value = elm[memberName];
|
1041
1181
|
delete elm[memberName];
|
1042
1182
|
elm[memberName] = value;
|
@@ -1051,7 +1191,7 @@ const connectedCallback = (elm) => {
|
|
1051
1191
|
}
|
1052
1192
|
};
|
1053
1193
|
const disconnectedCallback = (elm) => {
|
1054
|
-
if ((plt.$flags$ & 1 /* isTmpDisconnected */) === 0) {
|
1194
|
+
if ((plt.$flags$ & 1 /* PLATFORM_FLAGS.isTmpDisconnected */) === 0) {
|
1055
1195
|
getHostRef(elm);
|
1056
1196
|
}
|
1057
1197
|
};
|
@@ -1087,7 +1227,7 @@ const bootstrapLazy = (lazyBundles, options = {}) => {
|
|
1087
1227
|
super(self);
|
1088
1228
|
self = this;
|
1089
1229
|
registerHost(self, cmpMeta);
|
1090
|
-
if (cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) {
|
1230
|
+
if (cmpMeta.$flags$ & 1 /* CMP_FLAGS.shadowDomEncapsulation */) {
|
1091
1231
|
// this component is using shadow dom
|
1092
1232
|
// and this browser supports shadow dom
|
1093
1233
|
// add the read-only property "shadowRoot" to the host element
|
@@ -1122,7 +1262,7 @@ const bootstrapLazy = (lazyBundles, options = {}) => {
|
|
1122
1262
|
cmpMeta.$lazyBundleId$ = lazyBundle[0];
|
1123
1263
|
if (!exclude.includes(tagName) && !customElements.get(tagName)) {
|
1124
1264
|
cmpTags.push(tagName);
|
1125
|
-
customElements.define(tagName, proxyComponent(HostElement, cmpMeta, 1 /* isElementConstructor */));
|
1265
|
+
customElements.define(tagName, proxyComponent(HostElement, cmpMeta, 1 /* PROXY_FLAGS.isElementConstructor */));
|
1126
1266
|
}
|
1127
1267
|
});
|
1128
1268
|
});
|
@@ -1144,7 +1284,7 @@ const bootstrapLazy = (lazyBundles, options = {}) => {
|
|
1144
1284
|
// Fallback appLoad event
|
1145
1285
|
endBootstrap();
|
1146
1286
|
};
|
1147
|
-
const hostRefs = new WeakMap();
|
1287
|
+
const hostRefs = /*@__PURE__*/ new WeakMap();
|
1148
1288
|
const getHostRef = (ref) => hostRefs.get(ref);
|
1149
1289
|
const registerInstance = (lazyInstance, hostRef) => hostRefs.set((hostRef.$lazyInstance$ = lazyInstance), hostRef);
|
1150
1290
|
const registerHost = (elm, cmpMeta) => {
|
@@ -1185,14 +1325,14 @@ const loadModule = (cmpMeta, hostRef, hmrVersionId) => {
|
|
1185
1325
|
return importedModule[exportName];
|
1186
1326
|
}, consoleError);
|
1187
1327
|
};
|
1188
|
-
const styles = new Map();
|
1328
|
+
const styles = /*@__PURE__*/ new Map();
|
1189
1329
|
const queueDomReads = [];
|
1190
1330
|
const queueDomWrites = [];
|
1191
1331
|
const queueTask = (queue, write) => (cb) => {
|
1192
1332
|
queue.push(cb);
|
1193
1333
|
if (!queuePending) {
|
1194
1334
|
queuePending = true;
|
1195
|
-
if (write && plt.$flags$ & 4 /* queueSync */) {
|
1335
|
+
if (write && plt.$flags$ & 4 /* PLATFORM_FLAGS.queueSync */) {
|
1196
1336
|
nextTick(flush);
|
1197
1337
|
}
|
1198
1338
|
else {
|
package/dist/cjs/loader.cjs.js
CHANGED
@@ -2,10 +2,10 @@
|
|
2
2
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
4
4
|
|
5
|
-
const index = require('./index-
|
5
|
+
const index = require('./index-02cc516d.js');
|
6
6
|
|
7
7
|
/*
|
8
|
-
Stencil Client Patch Esm v2.
|
8
|
+
Stencil Client Patch Esm v2.18.0 | 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-
|
3
|
+
const index = require('./index-02cc516d.js');
|
4
4
|
|
5
5
|
/*
|
6
|
-
Stencil Client Patch Browser v2.
|
6
|
+
Stencil Client Patch Browser v2.18.0 | 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-sudoku-wc.cjs.js', document.baseURI).href));
|
@@ -3,12 +3,7 @@ import { Alien } from './alien';
|
|
3
3
|
import { Spinner } from './spinner';
|
4
4
|
const Alert = props => {
|
5
5
|
const { message, salute, spinner = false } = props;
|
6
|
-
return (h("div", { class: "mt-5 flex h-24px flex-row items-center" },
|
7
|
-
spinner ? h(Spinner, { class: "mr-2" }) : h(Alien, { class: "mr-2" }),
|
8
|
-
salute ? h("label", { class: "mr-1 font-bold" },
|
9
|
-
salute,
|
10
|
-
":") : '',
|
11
|
-
h("label", { class: "italic" }, message)));
|
6
|
+
return (h("div", { class: "mt-5 flex h-24px flex-row items-center" }, spinner ? h(Spinner, { class: "mr-2" }) : h(Alien, { class: "mr-2" }), salute ? h("label", { class: "mr-1 font-bold" }, salute, ":") : '', h("label", { class: "italic" }, message)));
|
12
7
|
};
|
13
8
|
export { Alert };
|
14
9
|
export default Alert;
|
@@ -4,11 +4,7 @@ import { state } from '../../utils';
|
|
4
4
|
const Alerts = _props => {
|
5
5
|
const { solved, loading, error } = state;
|
6
6
|
const play = !loading && !error && !solved;
|
7
|
-
return (h("div", { class: "flex flex-col" },
|
8
|
-
play ? h(Alert, { message: "Welcome, are you ready to play?..." }) : '',
|
9
|
-
loading ? h(Alert, { message: "Loading...", spinner: true }) : '',
|
10
|
-
error ? h(Alert, { message: error, salute: "ERROR" }) : '',
|
11
|
-
solved ? h(Alert, { message: "You solved the puzzle!!" }) : ''));
|
7
|
+
return (h("div", { class: "flex flex-col" }, play ? h(Alert, { message: "Welcome, are you ready to play?..." }) : '', loading ? h(Alert, { message: "Loading...", spinner: true }) : '', error ? h(Alert, { message: error, salute: "ERROR" }) : '', solved ? h(Alert, { message: "You solved the puzzle!!" }) : ''));
|
12
8
|
};
|
13
9
|
export { Alerts };
|
14
10
|
export default Alert;
|
@@ -4,11 +4,7 @@ const Alien = props => {
|
|
4
4
|
const klass = props.class;
|
5
5
|
const label = props.label || 'alien';
|
6
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: "M10.31 10.93C11.33 12.57 11.18 14.5 9.96 15.28C8.74 16.04 6.92 15.33\n 5.89 13.69C4.87 12.05 5.03 10.1 6.25 9.34C7.47 8.58 9.29 9.29 10.31\n 10.93M12 17.75C14 17.75 14.5 17 14.5 17C14.5 17 14 19 12 19C10 19 9.5\n 17.03 9.5 17C9.5 17 10 17.75 12 17.75M17.75 9.34C18.97 10.1 19.13 12.05\n 18.11 13.69C17.08 15.33 15.26 16.04 14.04 15.28C12.82 14.5 12.67 12.57\n 13.69 10.93C14.71 9.29 16.53 8.58 17.75 9.34M12 20C14.5 20 20 14.86 20\n 11C20 7.14 16.41 4 12 4C7.59 4 4 7.14 4 11C4 14.86 9.5 20 12 20M12 2C17.5\n 2 22 6.04 22 11C22 15.08 16.32 22 12 22C7.68 22 2 15.08 2 11C2 6.04 6.5 2\n 12 2Z" })),
|
11
|
-
h("path", { d: "M0 0h24v24H0z", fill: "none" })));
|
7
|
+
return (h("svg", { class: klass, width: size, height: size, viewBox: "0 0 24 24", role: "img", "aria-label": "title" }, h("title", null, label), h("g", { fill: hex }, h("path", { d: "M10.31 10.93C11.33 12.57 11.18 14.5 9.96 15.28C8.74 16.04 6.92 15.33\n 5.89 13.69C4.87 12.05 5.03 10.1 6.25 9.34C7.47 8.58 9.29 9.29 10.31\n 10.93M12 17.75C14 17.75 14.5 17 14.5 17C14.5 17 14 19 12 19C10 19 9.5\n 17.03 9.5 17C9.5 17 10 17.75 12 17.75M17.75 9.34C18.97 10.1 19.13 12.05\n 18.11 13.69C17.08 15.33 15.26 16.04 14.04 15.28C12.82 14.5 12.67 12.57\n 13.69 10.93C14.71 9.29 16.53 8.58 17.75 9.34M12 20C14.5 20 20 14.86 20\n 11C20 7.14 16.41 4 12 4C7.59 4 4 7.14 4 11C4 14.86 9.5 20 12 20M12 2C17.5\n 2 22 6.04 22 11C22 15.08 16.32 22 12 22C7.68 22 2 15.08 2 11C2 6.04 6.5 2\n 12 2Z" })), h("path", { d: "M0 0h24v24H0z", fill: "none" })));
|
12
8
|
};
|
13
9
|
export { Alien };
|
14
10
|
export default Alien;
|
@@ -3,8 +3,7 @@ import { Fingerprint } from './fingerprint';
|
|
3
3
|
const url = 'https://eswat2.dev';
|
4
4
|
const who = 'eswat2';
|
5
5
|
const Eswat2Io = _props => {
|
6
|
-
return (h("a", { class: "absolute top-0 right-0 text-clrs-gray hover:text-clrs-navy", href: url, "aria-label": who, title: who },
|
7
|
-
h(Fingerprint, { label: who })));
|
6
|
+
return (h("a", { class: "absolute top-0 right-0 text-clrs-gray hover:text-clrs-navy", href: url, "aria-label": who, title: who }, h(Fingerprint, { label: who })));
|
8
7
|
};
|
9
8
|
export { Eswat2Io };
|
10
9
|
export default Eswat2Io;
|