proto-daisy-db 0.0.32 → 0.0.35
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-69b24cc8.js → index-71a69513.js} +184 -44
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/proto-daisy-db.cjs.js +2 -2
- package/dist/cjs/proto-daisy-db_5.cjs.entry.js +1 -1
- package/dist/collection/collection-manifest.json +2 -2
- package/dist/collection/components/proto-daisy-db/proto-daisy-db.js +33 -27
- package/dist/collection/components/proto-faux-keys/proto-faux-keys.js +31 -25
- package/dist/collection/components/proto-faux-stamp/proto-faux-stamp.js +32 -27
- package/dist/collection/components/proto-faux-trigger/proto-faux-trigger.js +49 -49
- package/dist/collection/components/proto-faux-type/proto-faux-type.js +51 -46
- package/dist/esm/{index-1d7e6324.js → index-9b5001c6.js} +184 -44
- package/dist/esm/loader.js +2 -2
- package/dist/esm/proto-daisy-db.js +2 -2
- package/dist/esm/proto-daisy-db_5.entry.js +1 -1
- package/dist/proto-daisy-db/{p-8ed5301c.entry.js → p-301a5077.entry.js} +1 -1
- package/dist/proto-daisy-db/{p-39bf50a0.js → p-5f1daad3.js} +0 -0
- package/dist/proto-daisy-db/proto-daisy-db.esm.js +1 -1
- package/loader/package.json +1 -0
- package/package.json +5 -5
|
@@ -62,7 +62,7 @@ const uniqueTime = (key, measureText) => {
|
|
|
62
62
|
};
|
|
63
63
|
}
|
|
64
64
|
};
|
|
65
|
-
const rootAppliedStyles = new WeakMap();
|
|
65
|
+
const rootAppliedStyles = /*@__PURE__*/ new WeakMap();
|
|
66
66
|
const registerStyle = (scopeId, cssText, allowCS) => {
|
|
67
67
|
let style = styles.get(scopeId);
|
|
68
68
|
if (supportsConstructableStylesheets && allowCS) {
|
|
@@ -84,7 +84,7 @@ const addStyle = (styleContainerNode, cmpMeta, mode, hostElm) => {
|
|
|
84
84
|
const style = styles.get(scopeId);
|
|
85
85
|
// if an element is NOT connected then getRootNode() will return the wrong root node
|
|
86
86
|
// so the fallback is to always use the document for the root node in those cases
|
|
87
|
-
styleContainerNode = styleContainerNode.nodeType === 11 /* DocumentFragment */ ? styleContainerNode : doc;
|
|
87
|
+
styleContainerNode = styleContainerNode.nodeType === 11 /* NODE_TYPE.DocumentFragment */ ? styleContainerNode : doc;
|
|
88
88
|
if (style) {
|
|
89
89
|
if (typeof style === 'string') {
|
|
90
90
|
styleContainerNode = styleContainerNode.head || styleContainerNode;
|
|
@@ -118,7 +118,7 @@ const attachStyles = (hostRef) => {
|
|
|
118
118
|
const flags = cmpMeta.$flags$;
|
|
119
119
|
const endAttachStyles = createTime('attachStyles', cmpMeta.$tagName$);
|
|
120
120
|
const scopeId = addStyle(elm.shadowRoot ? elm.shadowRoot : elm.getRootNode(), cmpMeta);
|
|
121
|
-
if (flags & 10 /* needsScopedEncapsulation */) {
|
|
121
|
+
if (flags & 10 /* CMP_FLAGS.needsScopedEncapsulation */) {
|
|
122
122
|
// only required when we're NOT using native shadow dom (slot)
|
|
123
123
|
// or this browser doesn't support native shadow dom
|
|
124
124
|
// and this host element was NOT created with SSR
|
|
@@ -306,7 +306,7 @@ const setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
|
|
|
306
306
|
}
|
|
307
307
|
}
|
|
308
308
|
}
|
|
309
|
-
else if ((!isProp || flags & 4 /* isHost */ || isSvg) && !isComplex) {
|
|
309
|
+
else if ((!isProp || flags & 4 /* VNODE_FLAGS.isHost */ || isSvg) && !isComplex) {
|
|
310
310
|
newValue = newValue === true ? '' : newValue;
|
|
311
311
|
{
|
|
312
312
|
elm.setAttribute(memberName, newValue);
|
|
@@ -321,7 +321,7 @@ const updateElement = (oldVnode, newVnode, isSvgMode, memberName) => {
|
|
|
321
321
|
// if the element passed in is a shadow root, which is a document fragment
|
|
322
322
|
// then we want to be adding attrs/props to the shadow root's "host" element
|
|
323
323
|
// if it's not a shadow root, then we add attrs/props to the same element
|
|
324
|
-
const elm = newVnode.$elm$.nodeType === 11 /* DocumentFragment */ && newVnode.$elm$.host
|
|
324
|
+
const elm = newVnode.$elm$.nodeType === 11 /* NODE_TYPE.DocumentFragment */ && newVnode.$elm$.host
|
|
325
325
|
? newVnode.$elm$.host
|
|
326
326
|
: newVnode.$elm$;
|
|
327
327
|
const oldVnodeAttrs = (oldVnode && oldVnode.$attrs$) || EMPTY_OBJ;
|
|
@@ -339,6 +339,16 @@ const updateElement = (oldVnode, newVnode, isSvgMode, memberName) => {
|
|
|
339
339
|
setAccessor(elm, memberName, oldVnodeAttrs[memberName], newVnodeAttrs[memberName], isSvgMode, newVnode.$flags$);
|
|
340
340
|
}
|
|
341
341
|
};
|
|
342
|
+
/**
|
|
343
|
+
* Create a DOM Node corresponding to one of the children of a given VNode.
|
|
344
|
+
*
|
|
345
|
+
* @param oldParentVNode the parent VNode from the previous render
|
|
346
|
+
* @param newParentVNode the parent VNode from the current render
|
|
347
|
+
* @param childIndex the index of the VNode, in the _new_ parent node's
|
|
348
|
+
* children, for which we will create a new DOM node
|
|
349
|
+
* @param parentElm the parent DOM node which our new node will be a child of
|
|
350
|
+
* @returns the newly created node
|
|
351
|
+
*/
|
|
342
352
|
const createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
|
|
343
353
|
// tslint:disable-next-line: prefer-const
|
|
344
354
|
const newVNode = newParentVNode.$children$[childIndex];
|
|
@@ -400,6 +410,74 @@ const removeVnodes = (vnodes, startIdx, endIdx, vnode, elm) => {
|
|
|
400
410
|
}
|
|
401
411
|
}
|
|
402
412
|
};
|
|
413
|
+
/**
|
|
414
|
+
* Reconcile the children of a new VNode with the children of an old VNode by
|
|
415
|
+
* traversing the two collections of children, identifying nodes that are
|
|
416
|
+
* conserved or changed, calling out to `patch` to make any necessary
|
|
417
|
+
* updates to the DOM, and rearranging DOM nodes as needed.
|
|
418
|
+
*
|
|
419
|
+
* The algorithm for reconciling children works by analyzing two 'windows' onto
|
|
420
|
+
* the two arrays of children (`oldCh` and `newCh`). We keep track of the
|
|
421
|
+
* 'windows' by storing start and end indices and references to the
|
|
422
|
+
* corresponding array entries. Initially the two 'windows' are basically equal
|
|
423
|
+
* to the entire array, but we progressively narrow the windows until there are
|
|
424
|
+
* no children left to update by doing the following:
|
|
425
|
+
*
|
|
426
|
+
* 1. Skip any `null` entries at the beginning or end of the two arrays, so
|
|
427
|
+
* that if we have an initial array like the following we'll end up dealing
|
|
428
|
+
* only with a window bounded by the highlighted elements:
|
|
429
|
+
*
|
|
430
|
+
* [null, null, VNode1 , ... , VNode2, null, null]
|
|
431
|
+
* ^^^^^^ ^^^^^^
|
|
432
|
+
*
|
|
433
|
+
* 2. Check to see if the elements at the head and tail positions are equal
|
|
434
|
+
* across the windows. This will basically detect elements which haven't
|
|
435
|
+
* been added, removed, or changed position, i.e. if you had the following
|
|
436
|
+
* VNode elements (represented as HTML):
|
|
437
|
+
*
|
|
438
|
+
* oldVNode: `<div><p><span>HEY</span></p></div>`
|
|
439
|
+
* newVNode: `<div><p><span>THERE</span></p></div>`
|
|
440
|
+
*
|
|
441
|
+
* Then when comparing the children of the `<div>` tag we check the equality
|
|
442
|
+
* of the VNodes corresponding to the `<p>` tags and, since they are the
|
|
443
|
+
* same tag in the same position, we'd be able to avoid completely
|
|
444
|
+
* re-rendering the subtree under them with a new DOM element and would just
|
|
445
|
+
* call out to `patch` to handle reconciling their children and so on.
|
|
446
|
+
*
|
|
447
|
+
* 3. Check, for both windows, to see if the element at the beginning of the
|
|
448
|
+
* window corresponds to the element at the end of the other window. This is
|
|
449
|
+
* a heuristic which will let us identify _some_ situations in which
|
|
450
|
+
* elements have changed position, for instance it _should_ detect that the
|
|
451
|
+
* children nodes themselves have not changed but merely moved in the
|
|
452
|
+
* following example:
|
|
453
|
+
*
|
|
454
|
+
* oldVNode: `<div><element-one /><element-two /></div>`
|
|
455
|
+
* newVNode: `<div><element-two /><element-one /></div>`
|
|
456
|
+
*
|
|
457
|
+
* If we find cases like this then we also need to move the concrete DOM
|
|
458
|
+
* elements corresponding to the moved children to write the re-order to the
|
|
459
|
+
* DOM.
|
|
460
|
+
*
|
|
461
|
+
* 4. Finally, if VNodes have the `key` attribute set on them we check for any
|
|
462
|
+
* nodes in the old children which have the same key as the first element in
|
|
463
|
+
* our window on the new children. If we find such a node we handle calling
|
|
464
|
+
* out to `patch`, moving relevant DOM nodes, and so on, in accordance with
|
|
465
|
+
* what we find.
|
|
466
|
+
*
|
|
467
|
+
* Finally, once we've narrowed our 'windows' to the point that either of them
|
|
468
|
+
* collapse (i.e. they have length 0) we then handle any remaining VNode
|
|
469
|
+
* insertion or deletion that needs to happen to get a DOM state that correctly
|
|
470
|
+
* reflects the new child VNodes. If, for instance, after our window on the old
|
|
471
|
+
* children has collapsed we still have more nodes on the new children that
|
|
472
|
+
* we haven't dealt with yet then we need to add them, or if the new children
|
|
473
|
+
* collapse but we still have unhandled _old_ children then we need to make
|
|
474
|
+
* sure the corresponding DOM nodes are removed.
|
|
475
|
+
*
|
|
476
|
+
* @param parentElm the node into which the parent VNode is rendered
|
|
477
|
+
* @param oldCh the old children of the parent node
|
|
478
|
+
* @param newVNode the new VNode which will replace the parent
|
|
479
|
+
* @param newCh the new children of the parent node
|
|
480
|
+
*/
|
|
403
481
|
const updateChildren = (parentElm, oldCh, newVNode, newCh) => {
|
|
404
482
|
let oldStartIdx = 0;
|
|
405
483
|
let newStartIdx = 0;
|
|
@@ -412,7 +490,7 @@ const updateChildren = (parentElm, oldCh, newVNode, newCh) => {
|
|
|
412
490
|
let node;
|
|
413
491
|
while (oldStartIdx <= oldEndIdx && newStartIdx <= newEndIdx) {
|
|
414
492
|
if (oldStartVnode == null) {
|
|
415
|
-
//
|
|
493
|
+
// VNode might have been moved left
|
|
416
494
|
oldStartVnode = oldCh[++oldStartIdx];
|
|
417
495
|
}
|
|
418
496
|
else if (oldEndVnode == null) {
|
|
@@ -425,34 +503,67 @@ const updateChildren = (parentElm, oldCh, newVNode, newCh) => {
|
|
|
425
503
|
newEndVnode = newCh[--newEndIdx];
|
|
426
504
|
}
|
|
427
505
|
else if (isSameVnode(oldStartVnode, newStartVnode)) {
|
|
506
|
+
// if the start nodes are the same then we should patch the new VNode
|
|
507
|
+
// onto the old one, and increment our `newStartIdx` and `oldStartIdx`
|
|
508
|
+
// indices to reflect that. We don't need to move any DOM Nodes around
|
|
509
|
+
// since things are matched up in order.
|
|
428
510
|
patch(oldStartVnode, newStartVnode);
|
|
429
511
|
oldStartVnode = oldCh[++oldStartIdx];
|
|
430
512
|
newStartVnode = newCh[++newStartIdx];
|
|
431
513
|
}
|
|
432
514
|
else if (isSameVnode(oldEndVnode, newEndVnode)) {
|
|
515
|
+
// likewise, if the end nodes are the same we patch new onto old and
|
|
516
|
+
// decrement our end indices, and also likewise in this case we don't
|
|
517
|
+
// need to move any DOM Nodes.
|
|
433
518
|
patch(oldEndVnode, newEndVnode);
|
|
434
519
|
oldEndVnode = oldCh[--oldEndIdx];
|
|
435
520
|
newEndVnode = newCh[--newEndIdx];
|
|
436
521
|
}
|
|
437
522
|
else if (isSameVnode(oldStartVnode, newEndVnode)) {
|
|
438
523
|
patch(oldStartVnode, newEndVnode);
|
|
524
|
+
// We need to move the element for `oldStartVnode` into a position which
|
|
525
|
+
// will be appropriate for `newEndVnode`. For this we can use
|
|
526
|
+
// `.insertBefore` and `oldEndVnode.$elm$.nextSibling`. If there is a
|
|
527
|
+
// sibling for `oldEndVnode.$elm$` then we want to move the DOM node for
|
|
528
|
+
// `oldStartVnode` between `oldEndVnode` and it's sibling, like so:
|
|
529
|
+
//
|
|
530
|
+
// <old-start-node />
|
|
531
|
+
// <some-intervening-node />
|
|
532
|
+
// <old-end-node />
|
|
533
|
+
// <!-- -> <-- `oldStartVnode.$elm$` should be inserted here
|
|
534
|
+
// <next-sibling />
|
|
535
|
+
//
|
|
536
|
+
// If instead `oldEndVnode.$elm$` has no sibling then we just want to put
|
|
537
|
+
// the node for `oldStartVnode` at the end of the children of
|
|
538
|
+
// `parentElm`. Luckily, `Node.nextSibling` will return `null` if there
|
|
539
|
+
// aren't any siblings, and passing `null` to `Node.insertBefore` will
|
|
540
|
+
// append it to the children of the parent element.
|
|
439
541
|
parentElm.insertBefore(oldStartVnode.$elm$, oldEndVnode.$elm$.nextSibling);
|
|
440
542
|
oldStartVnode = oldCh[++oldStartIdx];
|
|
441
543
|
newEndVnode = newCh[--newEndIdx];
|
|
442
544
|
}
|
|
443
545
|
else if (isSameVnode(oldEndVnode, newStartVnode)) {
|
|
444
546
|
patch(oldEndVnode, newStartVnode);
|
|
547
|
+
// We've already checked above if `oldStartVnode` and `newStartVnode` are
|
|
548
|
+
// the same node, so since we're here we know that they are not. Thus we
|
|
549
|
+
// can move the element for `oldEndVnode` _before_ the element for
|
|
550
|
+
// `oldStartVnode`, leaving `oldStartVnode` to be reconciled in the
|
|
551
|
+
// future.
|
|
445
552
|
parentElm.insertBefore(oldEndVnode.$elm$, oldStartVnode.$elm$);
|
|
446
553
|
oldEndVnode = oldCh[--oldEndIdx];
|
|
447
554
|
newStartVnode = newCh[++newStartIdx];
|
|
448
555
|
}
|
|
449
556
|
else {
|
|
450
557
|
{
|
|
451
|
-
//
|
|
558
|
+
// We either didn't find an element in the old children that matches
|
|
559
|
+
// the key of the first new child OR the build is not using `key`
|
|
560
|
+
// attributes at all. In either case we need to create a new element
|
|
561
|
+
// for the new node.
|
|
452
562
|
node = createElm(oldCh && oldCh[newStartIdx], newVNode, newStartIdx);
|
|
453
563
|
newStartVnode = newCh[++newStartIdx];
|
|
454
564
|
}
|
|
455
565
|
if (node) {
|
|
566
|
+
// if we created a new node then handle inserting it to the DOM
|
|
456
567
|
{
|
|
457
568
|
oldStartVnode.$elm$.parentNode.insertBefore(node, oldStartVnode.$elm$);
|
|
458
569
|
}
|
|
@@ -460,27 +571,55 @@ const updateChildren = (parentElm, oldCh, newVNode, newCh) => {
|
|
|
460
571
|
}
|
|
461
572
|
}
|
|
462
573
|
if (oldStartIdx > oldEndIdx) {
|
|
574
|
+
// we have some more new nodes to add which don't match up with old nodes
|
|
463
575
|
addVnodes(parentElm, newCh[newEndIdx + 1] == null ? null : newCh[newEndIdx + 1].$elm$, newVNode, newCh, newStartIdx, newEndIdx);
|
|
464
576
|
}
|
|
465
577
|
else if (newStartIdx > newEndIdx) {
|
|
578
|
+
// there are nodes in the `oldCh` array which no longer correspond to nodes
|
|
579
|
+
// in the new array, so lets remove them (which entails cleaning up the
|
|
580
|
+
// relevant DOM nodes)
|
|
466
581
|
removeVnodes(oldCh, oldStartIdx, oldEndIdx);
|
|
467
582
|
}
|
|
468
583
|
};
|
|
469
|
-
|
|
584
|
+
/**
|
|
585
|
+
* Compare two VNodes to determine if they are the same
|
|
586
|
+
*
|
|
587
|
+
* **NB**: This function is an equality _heuristic_ based on the available
|
|
588
|
+
* information set on the two VNodes and can be misleading under certain
|
|
589
|
+
* circumstances. In particular, if the two nodes do not have `key` attrs
|
|
590
|
+
* (available under `$key$` on VNodes) then the function falls back on merely
|
|
591
|
+
* checking that they have the same tag.
|
|
592
|
+
*
|
|
593
|
+
* So, in other words, if `key` attrs are not set on VNodes which may be
|
|
594
|
+
* changing order within a `children` array or something along those lines then
|
|
595
|
+
* we could obtain a false positive and then have to do needless re-rendering.
|
|
596
|
+
*
|
|
597
|
+
* @param leftVNode the first VNode to check
|
|
598
|
+
* @param rightVNode the second VNode to check
|
|
599
|
+
* @returns whether they're equal or not
|
|
600
|
+
*/
|
|
601
|
+
const isSameVnode = (leftVNode, rightVNode) => {
|
|
470
602
|
// compare if two vnode to see if they're "technically" the same
|
|
471
603
|
// need to have the same element tag, and same key to be the same
|
|
472
|
-
if (
|
|
604
|
+
if (leftVNode.$tag$ === rightVNode.$tag$) {
|
|
473
605
|
return true;
|
|
474
606
|
}
|
|
475
607
|
return false;
|
|
476
608
|
};
|
|
609
|
+
/**
|
|
610
|
+
* Handle reconciling an outdated VNode with a new one which corresponds to
|
|
611
|
+
* it. This function handles flushing updates to the DOM and reconciling the
|
|
612
|
+
* children of the two nodes (if any).
|
|
613
|
+
*
|
|
614
|
+
* @param oldVNode an old VNode whose DOM element and children we want to update
|
|
615
|
+
* @param newVNode a new VNode representing an updated version of the old one
|
|
616
|
+
*/
|
|
477
617
|
const patch = (oldVNode, newVNode) => {
|
|
478
618
|
const elm = (newVNode.$elm$ = oldVNode.$elm$);
|
|
479
619
|
const oldChildren = oldVNode.$children$;
|
|
480
620
|
const newChildren = newVNode.$children$;
|
|
481
621
|
const text = newVNode.$text$;
|
|
482
622
|
if (text === null) {
|
|
483
|
-
// element node
|
|
484
623
|
{
|
|
485
624
|
{
|
|
486
625
|
// either this is the first render of an element OR it's an update
|
|
@@ -491,6 +630,7 @@ const patch = (oldVNode, newVNode) => {
|
|
|
491
630
|
}
|
|
492
631
|
if (oldChildren !== null && newChildren !== null) {
|
|
493
632
|
// looks like there's child vnodes for both the old and new vnodes
|
|
633
|
+
// so we need to call `updateChildren` to reconcile them
|
|
494
634
|
updateChildren(elm, oldChildren, newVNode, newChildren);
|
|
495
635
|
}
|
|
496
636
|
else if (newChildren !== null) {
|
|
@@ -519,7 +659,7 @@ const renderVdom = (hostRef, renderFnResults) => {
|
|
|
519
659
|
const rootVnode = isHost(renderFnResults) ? renderFnResults : h(null, null, renderFnResults);
|
|
520
660
|
hostTagName = hostElm.tagName;
|
|
521
661
|
rootVnode.$tag$ = null;
|
|
522
|
-
rootVnode.$flags$ |= 4 /* isHost */;
|
|
662
|
+
rootVnode.$flags$ |= 4 /* VNODE_FLAGS.isHost */;
|
|
523
663
|
hostRef.$vnode$ = rootVnode;
|
|
524
664
|
rootVnode.$elm$ = oldVNode.$elm$ = (hostElm.shadowRoot || hostElm );
|
|
525
665
|
{
|
|
@@ -547,10 +687,10 @@ const attachToAncestor = (hostRef, ancestorComponent) => {
|
|
|
547
687
|
};
|
|
548
688
|
const scheduleUpdate = (hostRef, isInitialLoad) => {
|
|
549
689
|
{
|
|
550
|
-
hostRef.$flags$ |= 16 /* isQueuedForUpdate */;
|
|
690
|
+
hostRef.$flags$ |= 16 /* HOST_FLAGS.isQueuedForUpdate */;
|
|
551
691
|
}
|
|
552
|
-
if (hostRef.$flags$ & 4 /* isWaitingForChildren */) {
|
|
553
|
-
hostRef.$flags$ |= 512 /* needsRerender */;
|
|
692
|
+
if (hostRef.$flags$ & 4 /* HOST_FLAGS.isWaitingForChildren */) {
|
|
693
|
+
hostRef.$flags$ |= 512 /* HOST_FLAGS.needsRerender */;
|
|
554
694
|
return;
|
|
555
695
|
}
|
|
556
696
|
attachToAncestor(hostRef, hostRef.$ancestorComponent$);
|
|
@@ -597,7 +737,7 @@ const updateComponent = async (hostRef, instance, isInitialLoad) => {
|
|
|
597
737
|
}
|
|
598
738
|
else {
|
|
599
739
|
Promise.all(childrenPromises).then(postUpdate);
|
|
600
|
-
hostRef.$flags$ |= 4 /* isWaitingForChildren */;
|
|
740
|
+
hostRef.$flags$ |= 4 /* HOST_FLAGS.isWaitingForChildren */;
|
|
601
741
|
childrenPromises.length = 0;
|
|
602
742
|
}
|
|
603
743
|
}
|
|
@@ -606,10 +746,10 @@ const callRender = (hostRef, instance, elm) => {
|
|
|
606
746
|
try {
|
|
607
747
|
instance = instance.render() ;
|
|
608
748
|
{
|
|
609
|
-
hostRef.$flags$ &= ~16 /* isQueuedForUpdate */;
|
|
749
|
+
hostRef.$flags$ &= ~16 /* HOST_FLAGS.isQueuedForUpdate */;
|
|
610
750
|
}
|
|
611
751
|
{
|
|
612
|
-
hostRef.$flags$ |= 2 /* hasRendered */;
|
|
752
|
+
hostRef.$flags$ |= 2 /* HOST_FLAGS.hasRendered */;
|
|
613
753
|
}
|
|
614
754
|
{
|
|
615
755
|
{
|
|
@@ -633,8 +773,8 @@ const postUpdateComponent = (hostRef) => {
|
|
|
633
773
|
const endPostUpdate = createTime('postUpdate', tagName);
|
|
634
774
|
const instance = hostRef.$lazyInstance$ ;
|
|
635
775
|
const ancestorComponent = hostRef.$ancestorComponent$;
|
|
636
|
-
if (!(hostRef.$flags$ & 64 /* hasLoadedComponent */)) {
|
|
637
|
-
hostRef.$flags$ |= 64 /* hasLoadedComponent */;
|
|
776
|
+
if (!(hostRef.$flags$ & 64 /* HOST_FLAGS.hasLoadedComponent */)) {
|
|
777
|
+
hostRef.$flags$ |= 64 /* HOST_FLAGS.hasLoadedComponent */;
|
|
638
778
|
{
|
|
639
779
|
// DOM WRITE!
|
|
640
780
|
addHydratedFlag(elm);
|
|
@@ -660,10 +800,10 @@ const postUpdateComponent = (hostRef) => {
|
|
|
660
800
|
hostRef.$onRenderResolve$();
|
|
661
801
|
hostRef.$onRenderResolve$ = undefined;
|
|
662
802
|
}
|
|
663
|
-
if (hostRef.$flags$ & 512 /* needsRerender */) {
|
|
803
|
+
if (hostRef.$flags$ & 512 /* HOST_FLAGS.needsRerender */) {
|
|
664
804
|
nextTick(() => scheduleUpdate(hostRef, false));
|
|
665
805
|
}
|
|
666
|
-
hostRef.$flags$ &= ~(4 /* isWaitingForChildren */ | 512 /* needsRerender */);
|
|
806
|
+
hostRef.$flags$ &= ~(4 /* HOST_FLAGS.isWaitingForChildren */ | 512 /* HOST_FLAGS.needsRerender */);
|
|
667
807
|
}
|
|
668
808
|
// ( •_•)
|
|
669
809
|
// ( •_•)>⌐■-■
|
|
@@ -719,7 +859,7 @@ const addHydratedFlag = (elm) => elm.classList.add('hydrated')
|
|
|
719
859
|
const parsePropertyValue = (propValue, propType) => {
|
|
720
860
|
// ensure this value is of the correct prop type
|
|
721
861
|
if (propValue != null && !isComplexType(propValue)) {
|
|
722
|
-
if (propType & 1 /* String */) {
|
|
862
|
+
if (propType & 1 /* MEMBER_FLAGS.String */) {
|
|
723
863
|
// could have been passed as a number or boolean
|
|
724
864
|
// but we still want it as a string
|
|
725
865
|
return String(propValue);
|
|
@@ -742,12 +882,12 @@ const setValue = (ref, propName, newVal, cmpMeta) => {
|
|
|
742
882
|
// explicitly check for NaN on both sides, as `NaN === NaN` is always false
|
|
743
883
|
const areBothNaN = Number.isNaN(oldVal) && Number.isNaN(newVal);
|
|
744
884
|
const didValueChange = newVal !== oldVal && !areBothNaN;
|
|
745
|
-
if ((!(flags & 8 /* isConstructingInstance */) || oldVal === undefined) && didValueChange) {
|
|
885
|
+
if ((!(flags & 8 /* HOST_FLAGS.isConstructingInstance */) || oldVal === undefined) && didValueChange) {
|
|
746
886
|
// gadzooks! the property's value has changed!!
|
|
747
887
|
// set our new value!
|
|
748
888
|
hostRef.$instanceValues$.set(propName, newVal);
|
|
749
889
|
if (instance) {
|
|
750
|
-
if ((flags & (2 /* hasRendered */ | 16 /* isQueuedForUpdate */)) === 2 /* hasRendered */) {
|
|
890
|
+
if ((flags & (2 /* HOST_FLAGS.hasRendered */ | 16 /* HOST_FLAGS.isQueuedForUpdate */)) === 2 /* HOST_FLAGS.hasRendered */) {
|
|
751
891
|
// looks like this value actually changed, so we've got work to do!
|
|
752
892
|
// but only if we've already rendered, otherwise just chill out
|
|
753
893
|
// queue that we need to do an update, but don't worry about queuing
|
|
@@ -763,8 +903,8 @@ const proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
|
763
903
|
const members = Object.entries(cmpMeta.$members$);
|
|
764
904
|
const prototype = Cstr.prototype;
|
|
765
905
|
members.map(([memberName, [memberFlags]]) => {
|
|
766
|
-
if ((memberFlags & 31 /* Prop */ ||
|
|
767
|
-
((flags & 2 /* proxyState */) && memberFlags & 32 /* State */))) {
|
|
906
|
+
if ((memberFlags & 31 /* MEMBER_FLAGS.Prop */ ||
|
|
907
|
+
((flags & 2 /* PROXY_FLAGS.proxyState */) && memberFlags & 32 /* MEMBER_FLAGS.State */))) {
|
|
768
908
|
// proxyComponent - prop
|
|
769
909
|
Object.defineProperty(prototype, memberName, {
|
|
770
910
|
get() {
|
|
@@ -780,7 +920,7 @@ const proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
|
780
920
|
});
|
|
781
921
|
}
|
|
782
922
|
});
|
|
783
|
-
if ((flags & 1 /* isElementConstructor */)) {
|
|
923
|
+
if ((flags & 1 /* PROXY_FLAGS.isElementConstructor */)) {
|
|
784
924
|
const attrNameToPropName = new Map();
|
|
785
925
|
prototype.attributeChangedCallback = function (attrName, _oldValue, newValue) {
|
|
786
926
|
plt.jmp(() => {
|
|
@@ -836,7 +976,7 @@ const proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
|
836
976
|
// create an array of attributes to observe
|
|
837
977
|
// and also create a map of html attribute name to js property name
|
|
838
978
|
Cstr.observedAttributes = members
|
|
839
|
-
.filter(([_, m]) => m[0] & 15 /* HasAttribute */) // filter to only keep props that should match attributes
|
|
979
|
+
.filter(([_, m]) => m[0] & 15 /* MEMBER_FLAGS.HasAttribute */) // filter to only keep props that should match attributes
|
|
840
980
|
.map(([propName, m]) => {
|
|
841
981
|
const attrName = m[1] || propName;
|
|
842
982
|
attrNameToPropName.set(attrName, propName);
|
|
@@ -848,10 +988,10 @@ const proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
|
848
988
|
};
|
|
849
989
|
const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId, Cstr) => {
|
|
850
990
|
// initializeComponent
|
|
851
|
-
if ((hostRef.$flags$ & 32 /* hasInitializedComponent */) === 0) {
|
|
991
|
+
if ((hostRef.$flags$ & 32 /* HOST_FLAGS.hasInitializedComponent */) === 0) {
|
|
852
992
|
{
|
|
853
993
|
// we haven't initialized this element yet
|
|
854
|
-
hostRef.$flags$ |= 32 /* hasInitializedComponent */;
|
|
994
|
+
hostRef.$flags$ |= 32 /* HOST_FLAGS.hasInitializedComponent */;
|
|
855
995
|
// lazy loaded components
|
|
856
996
|
// request the component's implementation to be
|
|
857
997
|
// wired up with the host element
|
|
@@ -863,7 +1003,7 @@ const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId, Cstr) =>
|
|
|
863
1003
|
endLoad();
|
|
864
1004
|
}
|
|
865
1005
|
if (!Cstr.isProxied) {
|
|
866
|
-
proxyComponent(Cstr, cmpMeta, 2 /* proxyState */);
|
|
1006
|
+
proxyComponent(Cstr, cmpMeta, 2 /* PROXY_FLAGS.proxyState */);
|
|
867
1007
|
Cstr.isProxied = true;
|
|
868
1008
|
}
|
|
869
1009
|
const endNewInstance = createTime('createInstance', cmpMeta.$tagName$);
|
|
@@ -871,7 +1011,7 @@ const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId, Cstr) =>
|
|
|
871
1011
|
// but let's keep track of when we start and stop
|
|
872
1012
|
// so that the getters/setters don't incorrectly step on data
|
|
873
1013
|
{
|
|
874
|
-
hostRef.$flags$ |= 8 /* isConstructingInstance */;
|
|
1014
|
+
hostRef.$flags$ |= 8 /* HOST_FLAGS.isConstructingInstance */;
|
|
875
1015
|
}
|
|
876
1016
|
// construct the lazy-loaded component implementation
|
|
877
1017
|
// passing the hostRef is very important during
|
|
@@ -884,7 +1024,7 @@ const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId, Cstr) =>
|
|
|
884
1024
|
consoleError(e);
|
|
885
1025
|
}
|
|
886
1026
|
{
|
|
887
|
-
hostRef.$flags$ &= ~8 /* isConstructingInstance */;
|
|
1027
|
+
hostRef.$flags$ &= ~8 /* HOST_FLAGS.isConstructingInstance */;
|
|
888
1028
|
}
|
|
889
1029
|
endNewInstance();
|
|
890
1030
|
}
|
|
@@ -894,7 +1034,7 @@ const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId, Cstr) =>
|
|
|
894
1034
|
const scopeId = getScopeId(cmpMeta);
|
|
895
1035
|
if (!styles.has(scopeId)) {
|
|
896
1036
|
const endRegisterStyles = createTime('registerStyles', cmpMeta.$tagName$);
|
|
897
|
-
registerStyle(scopeId, style, !!(cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */));
|
|
1037
|
+
registerStyle(scopeId, style, !!(cmpMeta.$flags$ & 1 /* CMP_FLAGS.shadowDomEncapsulation */));
|
|
898
1038
|
endRegisterStyles();
|
|
899
1039
|
}
|
|
900
1040
|
}
|
|
@@ -916,13 +1056,13 @@ const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId, Cstr) =>
|
|
|
916
1056
|
}
|
|
917
1057
|
};
|
|
918
1058
|
const connectedCallback = (elm) => {
|
|
919
|
-
if ((plt.$flags$ & 1 /* isTmpDisconnected */) === 0) {
|
|
1059
|
+
if ((plt.$flags$ & 1 /* PLATFORM_FLAGS.isTmpDisconnected */) === 0) {
|
|
920
1060
|
const hostRef = getHostRef(elm);
|
|
921
1061
|
const cmpMeta = hostRef.$cmpMeta$;
|
|
922
1062
|
const endConnected = createTime('connectedCallback', cmpMeta.$tagName$);
|
|
923
|
-
if (!(hostRef.$flags$ & 1 /* hasConnected */)) {
|
|
1063
|
+
if (!(hostRef.$flags$ & 1 /* HOST_FLAGS.hasConnected */)) {
|
|
924
1064
|
// first time this component has connected
|
|
925
|
-
hostRef.$flags$ |= 1 /* hasConnected */;
|
|
1065
|
+
hostRef.$flags$ |= 1 /* HOST_FLAGS.hasConnected */;
|
|
926
1066
|
{
|
|
927
1067
|
// find the first ancestor component (if there is one) and register
|
|
928
1068
|
// this component as one of the actively loading child components for its ancestor
|
|
@@ -942,7 +1082,7 @@ const connectedCallback = (elm) => {
|
|
|
942
1082
|
// https://developers.google.com/web/fundamentals/web-components/best-practices#lazy-properties
|
|
943
1083
|
if (cmpMeta.$members$) {
|
|
944
1084
|
Object.entries(cmpMeta.$members$).map(([memberName, [memberFlags]]) => {
|
|
945
|
-
if (memberFlags & 31 /* Prop */ && elm.hasOwnProperty(memberName)) {
|
|
1085
|
+
if (memberFlags & 31 /* MEMBER_FLAGS.Prop */ && elm.hasOwnProperty(memberName)) {
|
|
946
1086
|
const value = elm[memberName];
|
|
947
1087
|
delete elm[memberName];
|
|
948
1088
|
elm[memberName] = value;
|
|
@@ -957,7 +1097,7 @@ const connectedCallback = (elm) => {
|
|
|
957
1097
|
}
|
|
958
1098
|
};
|
|
959
1099
|
const disconnectedCallback = (elm) => {
|
|
960
|
-
if ((plt.$flags$ & 1 /* isTmpDisconnected */) === 0) {
|
|
1100
|
+
if ((plt.$flags$ & 1 /* PLATFORM_FLAGS.isTmpDisconnected */) === 0) {
|
|
961
1101
|
getHostRef(elm);
|
|
962
1102
|
}
|
|
963
1103
|
};
|
|
@@ -993,7 +1133,7 @@ const bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
993
1133
|
super(self);
|
|
994
1134
|
self = this;
|
|
995
1135
|
registerHost(self, cmpMeta);
|
|
996
|
-
if (cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) {
|
|
1136
|
+
if (cmpMeta.$flags$ & 1 /* CMP_FLAGS.shadowDomEncapsulation */) {
|
|
997
1137
|
// this component is using shadow dom
|
|
998
1138
|
// and this browser supports shadow dom
|
|
999
1139
|
// add the read-only property "shadowRoot" to the host element
|
|
@@ -1028,7 +1168,7 @@ const bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
1028
1168
|
cmpMeta.$lazyBundleId$ = lazyBundle[0];
|
|
1029
1169
|
if (!exclude.includes(tagName) && !customElements.get(tagName)) {
|
|
1030
1170
|
cmpTags.push(tagName);
|
|
1031
|
-
customElements.define(tagName, proxyComponent(HostElement, cmpMeta, 1 /* isElementConstructor */));
|
|
1171
|
+
customElements.define(tagName, proxyComponent(HostElement, cmpMeta, 1 /* PROXY_FLAGS.isElementConstructor */));
|
|
1032
1172
|
}
|
|
1033
1173
|
});
|
|
1034
1174
|
});
|
|
@@ -1050,7 +1190,7 @@ const bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
1050
1190
|
// Fallback appLoad event
|
|
1051
1191
|
endBootstrap();
|
|
1052
1192
|
};
|
|
1053
|
-
const hostRefs = new WeakMap();
|
|
1193
|
+
const hostRefs = /*@__PURE__*/ new WeakMap();
|
|
1054
1194
|
const getHostRef = (ref) => hostRefs.get(ref);
|
|
1055
1195
|
const registerInstance = (lazyInstance, hostRef) => hostRefs.set((hostRef.$lazyInstance$ = lazyInstance), hostRef);
|
|
1056
1196
|
const registerHost = (elm, cmpMeta) => {
|
|
@@ -1091,14 +1231,14 @@ const loadModule = (cmpMeta, hostRef, hmrVersionId) => {
|
|
|
1091
1231
|
return importedModule[exportName];
|
|
1092
1232
|
}, consoleError);
|
|
1093
1233
|
};
|
|
1094
|
-
const styles = new Map();
|
|
1234
|
+
const styles = /*@__PURE__*/ new Map();
|
|
1095
1235
|
const queueDomReads = [];
|
|
1096
1236
|
const queueDomWrites = [];
|
|
1097
1237
|
const queueTask = (queue, write) => (cb) => {
|
|
1098
1238
|
queue.push(cb);
|
|
1099
1239
|
if (!queuePending) {
|
|
1100
1240
|
queuePending = true;
|
|
1101
|
-
if (write && plt.$flags$ & 4 /* queueSync */) {
|
|
1241
|
+
if (write && plt.$flags$ & 4 /* PLATFORM_FLAGS.queueSync */) {
|
|
1102
1242
|
nextTick(flush);
|
|
1103
1243
|
}
|
|
1104
1244
|
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-71a69513.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-71a69513.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-daisy-db.cjs.js', document.baseURI).href));
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { h } from '@stencil/core';
|
|
2
2
|
import { bag } from '../../utils';
|
|
3
3
|
export class ProtoDaisyDB {
|
|
4
4
|
constructor() {
|
|
@@ -31,30 +31,36 @@ export class ProtoDaisyDB {
|
|
|
31
31
|
}
|
|
32
32
|
static get is() { return "proto-daisy-db"; }
|
|
33
33
|
static get encapsulation() { return "shadow"; }
|
|
34
|
-
static get originalStyleUrls() {
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
"
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
34
|
+
static get originalStyleUrls() {
|
|
35
|
+
return {
|
|
36
|
+
"$": ["proto-daisy-db.css"]
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
static get styleUrls() {
|
|
40
|
+
return {
|
|
41
|
+
"$": ["proto-daisy-db.css"]
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
static get properties() {
|
|
45
|
+
return {
|
|
46
|
+
"emitter": {
|
|
47
|
+
"type": "string",
|
|
48
|
+
"mutable": false,
|
|
49
|
+
"complexType": {
|
|
50
|
+
"original": "string",
|
|
51
|
+
"resolved": "string",
|
|
52
|
+
"references": {}
|
|
53
|
+
},
|
|
54
|
+
"required": false,
|
|
55
|
+
"optional": false,
|
|
56
|
+
"docs": {
|
|
57
|
+
"tags": [],
|
|
58
|
+
"text": ""
|
|
59
|
+
},
|
|
60
|
+
"attribute": "emitter",
|
|
61
|
+
"reflect": false,
|
|
62
|
+
"defaultValue": "undefined"
|
|
63
|
+
}
|
|
64
|
+
};
|
|
65
|
+
}
|
|
60
66
|
}
|