proto-logo-wc 0.0.277 → 0.0.280
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-da0ffc9e.js → index-35d55756.js} +185 -45
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/my-logo.cjs.entry.js +1 -1
- package/dist/cjs/proto-logo-wc.cjs.js +2 -2
- package/dist/collection/collection-manifest.json +2 -2
- package/dist/collection/components/my-logo/my-logo.js +85 -88
- package/dist/esm/{index-465eacf3.js → index-d3d03569.js} +185 -45
- package/dist/esm/loader.js +2 -2
- package/dist/esm/my-logo.entry.js +1 -1
- package/dist/esm/proto-logo-wc.js +2 -2
- package/dist/proto-logo-wc/{p-d0803070.entry.js → p-78315aa1.entry.js} +1 -1
- package/dist/proto-logo-wc/{p-7fc1767c.js → p-8375f33f.js} +0 -0
- package/dist/proto-logo-wc/proto-logo-wc.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
|
|
@@ -252,7 +252,7 @@ const setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
|
|
|
252
252
|
}
|
|
253
253
|
}
|
|
254
254
|
}
|
|
255
|
-
else if ((!isProp || flags & 4 /* isHost */ || isSvg) && !isComplex) {
|
|
255
|
+
else if ((!isProp || flags & 4 /* VNODE_FLAGS.isHost */ || isSvg) && !isComplex) {
|
|
256
256
|
newValue = newValue === true ? '' : newValue;
|
|
257
257
|
{
|
|
258
258
|
elm.setAttribute(memberName, newValue);
|
|
@@ -265,7 +265,7 @@ const updateElement = (oldVnode, newVnode, isSvgMode, memberName) => {
|
|
|
265
265
|
// if the element passed in is a shadow root, which is a document fragment
|
|
266
266
|
// then we want to be adding attrs/props to the shadow root's "host" element
|
|
267
267
|
// if it's not a shadow root, then we add attrs/props to the same element
|
|
268
|
-
const elm = newVnode.$elm$.nodeType === 11 /* DocumentFragment */ && newVnode.$elm$.host
|
|
268
|
+
const elm = newVnode.$elm$.nodeType === 11 /* NODE_TYPE.DocumentFragment */ && newVnode.$elm$.host
|
|
269
269
|
? newVnode.$elm$.host
|
|
270
270
|
: newVnode.$elm$;
|
|
271
271
|
const oldVnodeAttrs = (oldVnode && oldVnode.$attrs$) || EMPTY_OBJ;
|
|
@@ -283,6 +283,16 @@ const updateElement = (oldVnode, newVnode, isSvgMode, memberName) => {
|
|
|
283
283
|
setAccessor(elm, memberName, oldVnodeAttrs[memberName], newVnodeAttrs[memberName], isSvgMode, newVnode.$flags$);
|
|
284
284
|
}
|
|
285
285
|
};
|
|
286
|
+
/**
|
|
287
|
+
* Create a DOM Node corresponding to one of the children of a given VNode.
|
|
288
|
+
*
|
|
289
|
+
* @param oldParentVNode the parent VNode from the previous render
|
|
290
|
+
* @param newParentVNode the parent VNode from the current render
|
|
291
|
+
* @param childIndex the index of the VNode, in the _new_ parent node's
|
|
292
|
+
* children, for which we will create a new DOM node
|
|
293
|
+
* @param parentElm the parent DOM node which our new node will be a child of
|
|
294
|
+
* @returns the newly created node
|
|
295
|
+
*/
|
|
286
296
|
const createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
|
|
287
297
|
// tslint:disable-next-line: prefer-const
|
|
288
298
|
const newVNode = newParentVNode.$children$[childIndex];
|
|
@@ -357,6 +367,74 @@ const removeVnodes = (vnodes, startIdx, endIdx, vnode, elm) => {
|
|
|
357
367
|
}
|
|
358
368
|
}
|
|
359
369
|
};
|
|
370
|
+
/**
|
|
371
|
+
* Reconcile the children of a new VNode with the children of an old VNode by
|
|
372
|
+
* traversing the two collections of children, identifying nodes that are
|
|
373
|
+
* conserved or changed, calling out to `patch` to make any necessary
|
|
374
|
+
* updates to the DOM, and rearranging DOM nodes as needed.
|
|
375
|
+
*
|
|
376
|
+
* The algorithm for reconciling children works by analyzing two 'windows' onto
|
|
377
|
+
* the two arrays of children (`oldCh` and `newCh`). We keep track of the
|
|
378
|
+
* 'windows' by storing start and end indices and references to the
|
|
379
|
+
* corresponding array entries. Initially the two 'windows' are basically equal
|
|
380
|
+
* to the entire array, but we progressively narrow the windows until there are
|
|
381
|
+
* no children left to update by doing the following:
|
|
382
|
+
*
|
|
383
|
+
* 1. Skip any `null` entries at the beginning or end of the two arrays, so
|
|
384
|
+
* that if we have an initial array like the following we'll end up dealing
|
|
385
|
+
* only with a window bounded by the highlighted elements:
|
|
386
|
+
*
|
|
387
|
+
* [null, null, VNode1 , ... , VNode2, null, null]
|
|
388
|
+
* ^^^^^^ ^^^^^^
|
|
389
|
+
*
|
|
390
|
+
* 2. Check to see if the elements at the head and tail positions are equal
|
|
391
|
+
* across the windows. This will basically detect elements which haven't
|
|
392
|
+
* been added, removed, or changed position, i.e. if you had the following
|
|
393
|
+
* VNode elements (represented as HTML):
|
|
394
|
+
*
|
|
395
|
+
* oldVNode: `<div><p><span>HEY</span></p></div>`
|
|
396
|
+
* newVNode: `<div><p><span>THERE</span></p></div>`
|
|
397
|
+
*
|
|
398
|
+
* Then when comparing the children of the `<div>` tag we check the equality
|
|
399
|
+
* of the VNodes corresponding to the `<p>` tags and, since they are the
|
|
400
|
+
* same tag in the same position, we'd be able to avoid completely
|
|
401
|
+
* re-rendering the subtree under them with a new DOM element and would just
|
|
402
|
+
* call out to `patch` to handle reconciling their children and so on.
|
|
403
|
+
*
|
|
404
|
+
* 3. Check, for both windows, to see if the element at the beginning of the
|
|
405
|
+
* window corresponds to the element at the end of the other window. This is
|
|
406
|
+
* a heuristic which will let us identify _some_ situations in which
|
|
407
|
+
* elements have changed position, for instance it _should_ detect that the
|
|
408
|
+
* children nodes themselves have not changed but merely moved in the
|
|
409
|
+
* following example:
|
|
410
|
+
*
|
|
411
|
+
* oldVNode: `<div><element-one /><element-two /></div>`
|
|
412
|
+
* newVNode: `<div><element-two /><element-one /></div>`
|
|
413
|
+
*
|
|
414
|
+
* If we find cases like this then we also need to move the concrete DOM
|
|
415
|
+
* elements corresponding to the moved children to write the re-order to the
|
|
416
|
+
* DOM.
|
|
417
|
+
*
|
|
418
|
+
* 4. Finally, if VNodes have the `key` attribute set on them we check for any
|
|
419
|
+
* nodes in the old children which have the same key as the first element in
|
|
420
|
+
* our window on the new children. If we find such a node we handle calling
|
|
421
|
+
* out to `patch`, moving relevant DOM nodes, and so on, in accordance with
|
|
422
|
+
* what we find.
|
|
423
|
+
*
|
|
424
|
+
* Finally, once we've narrowed our 'windows' to the point that either of them
|
|
425
|
+
* collapse (i.e. they have length 0) we then handle any remaining VNode
|
|
426
|
+
* insertion or deletion that needs to happen to get a DOM state that correctly
|
|
427
|
+
* reflects the new child VNodes. If, for instance, after our window on the old
|
|
428
|
+
* children has collapsed we still have more nodes on the new children that
|
|
429
|
+
* we haven't dealt with yet then we need to add them, or if the new children
|
|
430
|
+
* collapse but we still have unhandled _old_ children then we need to make
|
|
431
|
+
* sure the corresponding DOM nodes are removed.
|
|
432
|
+
*
|
|
433
|
+
* @param parentElm the node into which the parent VNode is rendered
|
|
434
|
+
* @param oldCh the old children of the parent node
|
|
435
|
+
* @param newVNode the new VNode which will replace the parent
|
|
436
|
+
* @param newCh the new children of the parent node
|
|
437
|
+
*/
|
|
360
438
|
const updateChildren = (parentElm, oldCh, newVNode, newCh) => {
|
|
361
439
|
let oldStartIdx = 0;
|
|
362
440
|
let newStartIdx = 0;
|
|
@@ -369,7 +447,7 @@ const updateChildren = (parentElm, oldCh, newVNode, newCh) => {
|
|
|
369
447
|
let node;
|
|
370
448
|
while (oldStartIdx <= oldEndIdx && newStartIdx <= newEndIdx) {
|
|
371
449
|
if (oldStartVnode == null) {
|
|
372
|
-
//
|
|
450
|
+
// VNode might have been moved left
|
|
373
451
|
oldStartVnode = oldCh[++oldStartIdx];
|
|
374
452
|
}
|
|
375
453
|
else if (oldEndVnode == null) {
|
|
@@ -382,34 +460,67 @@ const updateChildren = (parentElm, oldCh, newVNode, newCh) => {
|
|
|
382
460
|
newEndVnode = newCh[--newEndIdx];
|
|
383
461
|
}
|
|
384
462
|
else if (isSameVnode(oldStartVnode, newStartVnode)) {
|
|
463
|
+
// if the start nodes are the same then we should patch the new VNode
|
|
464
|
+
// onto the old one, and increment our `newStartIdx` and `oldStartIdx`
|
|
465
|
+
// indices to reflect that. We don't need to move any DOM Nodes around
|
|
466
|
+
// since things are matched up in order.
|
|
385
467
|
patch(oldStartVnode, newStartVnode);
|
|
386
468
|
oldStartVnode = oldCh[++oldStartIdx];
|
|
387
469
|
newStartVnode = newCh[++newStartIdx];
|
|
388
470
|
}
|
|
389
471
|
else if (isSameVnode(oldEndVnode, newEndVnode)) {
|
|
472
|
+
// likewise, if the end nodes are the same we patch new onto old and
|
|
473
|
+
// decrement our end indices, and also likewise in this case we don't
|
|
474
|
+
// need to move any DOM Nodes.
|
|
390
475
|
patch(oldEndVnode, newEndVnode);
|
|
391
476
|
oldEndVnode = oldCh[--oldEndIdx];
|
|
392
477
|
newEndVnode = newCh[--newEndIdx];
|
|
393
478
|
}
|
|
394
479
|
else if (isSameVnode(oldStartVnode, newEndVnode)) {
|
|
395
480
|
patch(oldStartVnode, newEndVnode);
|
|
481
|
+
// We need to move the element for `oldStartVnode` into a position which
|
|
482
|
+
// will be appropriate for `newEndVnode`. For this we can use
|
|
483
|
+
// `.insertBefore` and `oldEndVnode.$elm$.nextSibling`. If there is a
|
|
484
|
+
// sibling for `oldEndVnode.$elm$` then we want to move the DOM node for
|
|
485
|
+
// `oldStartVnode` between `oldEndVnode` and it's sibling, like so:
|
|
486
|
+
//
|
|
487
|
+
// <old-start-node />
|
|
488
|
+
// <some-intervening-node />
|
|
489
|
+
// <old-end-node />
|
|
490
|
+
// <!-- -> <-- `oldStartVnode.$elm$` should be inserted here
|
|
491
|
+
// <next-sibling />
|
|
492
|
+
//
|
|
493
|
+
// If instead `oldEndVnode.$elm$` has no sibling then we just want to put
|
|
494
|
+
// the node for `oldStartVnode` at the end of the children of
|
|
495
|
+
// `parentElm`. Luckily, `Node.nextSibling` will return `null` if there
|
|
496
|
+
// aren't any siblings, and passing `null` to `Node.insertBefore` will
|
|
497
|
+
// append it to the children of the parent element.
|
|
396
498
|
parentElm.insertBefore(oldStartVnode.$elm$, oldEndVnode.$elm$.nextSibling);
|
|
397
499
|
oldStartVnode = oldCh[++oldStartIdx];
|
|
398
500
|
newEndVnode = newCh[--newEndIdx];
|
|
399
501
|
}
|
|
400
502
|
else if (isSameVnode(oldEndVnode, newStartVnode)) {
|
|
401
503
|
patch(oldEndVnode, newStartVnode);
|
|
504
|
+
// We've already checked above if `oldStartVnode` and `newStartVnode` are
|
|
505
|
+
// the same node, so since we're here we know that they are not. Thus we
|
|
506
|
+
// can move the element for `oldEndVnode` _before_ the element for
|
|
507
|
+
// `oldStartVnode`, leaving `oldStartVnode` to be reconciled in the
|
|
508
|
+
// future.
|
|
402
509
|
parentElm.insertBefore(oldEndVnode.$elm$, oldStartVnode.$elm$);
|
|
403
510
|
oldEndVnode = oldCh[--oldEndIdx];
|
|
404
511
|
newStartVnode = newCh[++newStartIdx];
|
|
405
512
|
}
|
|
406
513
|
else {
|
|
407
514
|
{
|
|
408
|
-
//
|
|
515
|
+
// We either didn't find an element in the old children that matches
|
|
516
|
+
// the key of the first new child OR the build is not using `key`
|
|
517
|
+
// attributes at all. In either case we need to create a new element
|
|
518
|
+
// for the new node.
|
|
409
519
|
node = createElm(oldCh && oldCh[newStartIdx], newVNode, newStartIdx);
|
|
410
520
|
newStartVnode = newCh[++newStartIdx];
|
|
411
521
|
}
|
|
412
522
|
if (node) {
|
|
523
|
+
// if we created a new node then handle inserting it to the DOM
|
|
413
524
|
{
|
|
414
525
|
oldStartVnode.$elm$.parentNode.insertBefore(node, oldStartVnode.$elm$);
|
|
415
526
|
}
|
|
@@ -417,20 +528,49 @@ const updateChildren = (parentElm, oldCh, newVNode, newCh) => {
|
|
|
417
528
|
}
|
|
418
529
|
}
|
|
419
530
|
if (oldStartIdx > oldEndIdx) {
|
|
531
|
+
// we have some more new nodes to add which don't match up with old nodes
|
|
420
532
|
addVnodes(parentElm, newCh[newEndIdx + 1] == null ? null : newCh[newEndIdx + 1].$elm$, newVNode, newCh, newStartIdx, newEndIdx);
|
|
421
533
|
}
|
|
422
534
|
else if (newStartIdx > newEndIdx) {
|
|
535
|
+
// there are nodes in the `oldCh` array which no longer correspond to nodes
|
|
536
|
+
// in the new array, so lets remove them (which entails cleaning up the
|
|
537
|
+
// relevant DOM nodes)
|
|
423
538
|
removeVnodes(oldCh, oldStartIdx, oldEndIdx);
|
|
424
539
|
}
|
|
425
540
|
};
|
|
426
|
-
|
|
541
|
+
/**
|
|
542
|
+
* Compare two VNodes to determine if they are the same
|
|
543
|
+
*
|
|
544
|
+
* **NB**: This function is an equality _heuristic_ based on the available
|
|
545
|
+
* information set on the two VNodes and can be misleading under certain
|
|
546
|
+
* circumstances. In particular, if the two nodes do not have `key` attrs
|
|
547
|
+
* (available under `$key$` on VNodes) then the function falls back on merely
|
|
548
|
+
* checking that they have the same tag.
|
|
549
|
+
*
|
|
550
|
+
* So, in other words, if `key` attrs are not set on VNodes which may be
|
|
551
|
+
* changing order within a `children` array or something along those lines then
|
|
552
|
+
* we could obtain a false positive and then have to do needless re-rendering.
|
|
553
|
+
*
|
|
554
|
+
* @param leftVNode the first VNode to check
|
|
555
|
+
* @param rightVNode the second VNode to check
|
|
556
|
+
* @returns whether they're equal or not
|
|
557
|
+
*/
|
|
558
|
+
const isSameVnode = (leftVNode, rightVNode) => {
|
|
427
559
|
// compare if two vnode to see if they're "technically" the same
|
|
428
560
|
// need to have the same element tag, and same key to be the same
|
|
429
|
-
if (
|
|
561
|
+
if (leftVNode.$tag$ === rightVNode.$tag$) {
|
|
430
562
|
return true;
|
|
431
563
|
}
|
|
432
564
|
return false;
|
|
433
565
|
};
|
|
566
|
+
/**
|
|
567
|
+
* Handle reconciling an outdated VNode with a new one which corresponds to
|
|
568
|
+
* it. This function handles flushing updates to the DOM and reconciling the
|
|
569
|
+
* children of the two nodes (if any).
|
|
570
|
+
*
|
|
571
|
+
* @param oldVNode an old VNode whose DOM element and children we want to update
|
|
572
|
+
* @param newVNode a new VNode representing an updated version of the old one
|
|
573
|
+
*/
|
|
434
574
|
const patch = (oldVNode, newVNode) => {
|
|
435
575
|
const elm = (newVNode.$elm$ = oldVNode.$elm$);
|
|
436
576
|
const oldChildren = oldVNode.$children$;
|
|
@@ -442,7 +582,6 @@ const patch = (oldVNode, newVNode) => {
|
|
|
442
582
|
// only add this to the when the compiler sees we're using an svg somewhere
|
|
443
583
|
isSvgMode = tag === 'svg' ? true : tag === 'foreignObject' ? false : isSvgMode;
|
|
444
584
|
}
|
|
445
|
-
// element node
|
|
446
585
|
{
|
|
447
586
|
{
|
|
448
587
|
// either this is the first render of an element OR it's an update
|
|
@@ -453,6 +592,7 @@ const patch = (oldVNode, newVNode) => {
|
|
|
453
592
|
}
|
|
454
593
|
if (oldChildren !== null && newChildren !== null) {
|
|
455
594
|
// looks like there's child vnodes for both the old and new vnodes
|
|
595
|
+
// so we need to call `updateChildren` to reconcile them
|
|
456
596
|
updateChildren(elm, oldChildren, newVNode, newChildren);
|
|
457
597
|
}
|
|
458
598
|
else if (newChildren !== null) {
|
|
@@ -474,7 +614,7 @@ const renderVdom = (hostRef, renderFnResults) => {
|
|
|
474
614
|
const rootVnode = isHost(renderFnResults) ? renderFnResults : h(null, null, renderFnResults);
|
|
475
615
|
hostTagName = hostElm.tagName;
|
|
476
616
|
rootVnode.$tag$ = null;
|
|
477
|
-
rootVnode.$flags$ |= 4 /* isHost */;
|
|
617
|
+
rootVnode.$flags$ |= 4 /* VNODE_FLAGS.isHost */;
|
|
478
618
|
hostRef.$vnode$ = rootVnode;
|
|
479
619
|
rootVnode.$elm$ = oldVNode.$elm$ = (hostElm.shadowRoot || hostElm );
|
|
480
620
|
{
|
|
@@ -502,10 +642,10 @@ const attachToAncestor = (hostRef, ancestorComponent) => {
|
|
|
502
642
|
};
|
|
503
643
|
const scheduleUpdate = (hostRef, isInitialLoad) => {
|
|
504
644
|
{
|
|
505
|
-
hostRef.$flags$ |= 16 /* isQueuedForUpdate */;
|
|
645
|
+
hostRef.$flags$ |= 16 /* HOST_FLAGS.isQueuedForUpdate */;
|
|
506
646
|
}
|
|
507
|
-
if (hostRef.$flags$ & 4 /* isWaitingForChildren */) {
|
|
508
|
-
hostRef.$flags$ |= 512 /* needsRerender */;
|
|
647
|
+
if (hostRef.$flags$ & 4 /* HOST_FLAGS.isWaitingForChildren */) {
|
|
648
|
+
hostRef.$flags$ |= 512 /* HOST_FLAGS.needsRerender */;
|
|
509
649
|
return;
|
|
510
650
|
}
|
|
511
651
|
attachToAncestor(hostRef, hostRef.$ancestorComponent$);
|
|
@@ -552,7 +692,7 @@ const updateComponent = async (hostRef, instance, isInitialLoad) => {
|
|
|
552
692
|
}
|
|
553
693
|
else {
|
|
554
694
|
Promise.all(childrenPromises).then(postUpdate);
|
|
555
|
-
hostRef.$flags$ |= 4 /* isWaitingForChildren */;
|
|
695
|
+
hostRef.$flags$ |= 4 /* HOST_FLAGS.isWaitingForChildren */;
|
|
556
696
|
childrenPromises.length = 0;
|
|
557
697
|
}
|
|
558
698
|
}
|
|
@@ -561,10 +701,10 @@ const callRender = (hostRef, instance, elm) => {
|
|
|
561
701
|
try {
|
|
562
702
|
instance = instance.render() ;
|
|
563
703
|
{
|
|
564
|
-
hostRef.$flags$ &= ~16 /* isQueuedForUpdate */;
|
|
704
|
+
hostRef.$flags$ &= ~16 /* HOST_FLAGS.isQueuedForUpdate */;
|
|
565
705
|
}
|
|
566
706
|
{
|
|
567
|
-
hostRef.$flags$ |= 2 /* hasRendered */;
|
|
707
|
+
hostRef.$flags$ |= 2 /* HOST_FLAGS.hasRendered */;
|
|
568
708
|
}
|
|
569
709
|
{
|
|
570
710
|
{
|
|
@@ -587,8 +727,8 @@ const postUpdateComponent = (hostRef) => {
|
|
|
587
727
|
const elm = hostRef.$hostElement$;
|
|
588
728
|
const endPostUpdate = createTime('postUpdate', tagName);
|
|
589
729
|
const ancestorComponent = hostRef.$ancestorComponent$;
|
|
590
|
-
if (!(hostRef.$flags$ & 64 /* hasLoadedComponent */)) {
|
|
591
|
-
hostRef.$flags$ |= 64 /* hasLoadedComponent */;
|
|
730
|
+
if (!(hostRef.$flags$ & 64 /* HOST_FLAGS.hasLoadedComponent */)) {
|
|
731
|
+
hostRef.$flags$ |= 64 /* HOST_FLAGS.hasLoadedComponent */;
|
|
592
732
|
{
|
|
593
733
|
// DOM WRITE!
|
|
594
734
|
addHydratedFlag(elm);
|
|
@@ -611,10 +751,10 @@ const postUpdateComponent = (hostRef) => {
|
|
|
611
751
|
hostRef.$onRenderResolve$();
|
|
612
752
|
hostRef.$onRenderResolve$ = undefined;
|
|
613
753
|
}
|
|
614
|
-
if (hostRef.$flags$ & 512 /* needsRerender */) {
|
|
754
|
+
if (hostRef.$flags$ & 512 /* HOST_FLAGS.needsRerender */) {
|
|
615
755
|
nextTick(() => scheduleUpdate(hostRef, false));
|
|
616
756
|
}
|
|
617
|
-
hostRef.$flags$ &= ~(4 /* isWaitingForChildren */ | 512 /* needsRerender */);
|
|
757
|
+
hostRef.$flags$ &= ~(4 /* HOST_FLAGS.isWaitingForChildren */ | 512 /* HOST_FLAGS.needsRerender */);
|
|
618
758
|
}
|
|
619
759
|
// ( •_•)
|
|
620
760
|
// ( •_•)>⌐■-■
|
|
@@ -659,11 +799,11 @@ const addHydratedFlag = (elm) => elm.classList.add('hydrated')
|
|
|
659
799
|
const parsePropertyValue = (propValue, propType) => {
|
|
660
800
|
// ensure this value is of the correct prop type
|
|
661
801
|
if (propValue != null && !isComplexType(propValue)) {
|
|
662
|
-
if (propType & 2 /* Number */) {
|
|
802
|
+
if (propType & 2 /* MEMBER_FLAGS.Number */) {
|
|
663
803
|
// force it to be a number
|
|
664
804
|
return parseFloat(propValue);
|
|
665
805
|
}
|
|
666
|
-
if (propType & 1 /* String */) {
|
|
806
|
+
if (propType & 1 /* MEMBER_FLAGS.String */) {
|
|
667
807
|
// could have been passed as a number or boolean
|
|
668
808
|
// but we still want it as a string
|
|
669
809
|
return String(propValue);
|
|
@@ -686,12 +826,12 @@ const setValue = (ref, propName, newVal, cmpMeta) => {
|
|
|
686
826
|
// explicitly check for NaN on both sides, as `NaN === NaN` is always false
|
|
687
827
|
const areBothNaN = Number.isNaN(oldVal) && Number.isNaN(newVal);
|
|
688
828
|
const didValueChange = newVal !== oldVal && !areBothNaN;
|
|
689
|
-
if ((!(flags & 8 /* isConstructingInstance */) || oldVal === undefined) && didValueChange) {
|
|
829
|
+
if ((!(flags & 8 /* HOST_FLAGS.isConstructingInstance */) || oldVal === undefined) && didValueChange) {
|
|
690
830
|
// gadzooks! the property's value has changed!!
|
|
691
831
|
// set our new value!
|
|
692
832
|
hostRef.$instanceValues$.set(propName, newVal);
|
|
693
833
|
if (instance) {
|
|
694
|
-
if ((flags & (2 /* hasRendered */ | 16 /* isQueuedForUpdate */)) === 2 /* hasRendered */) {
|
|
834
|
+
if ((flags & (2 /* HOST_FLAGS.hasRendered */ | 16 /* HOST_FLAGS.isQueuedForUpdate */)) === 2 /* HOST_FLAGS.hasRendered */) {
|
|
695
835
|
// looks like this value actually changed, so we've got work to do!
|
|
696
836
|
// but only if we've already rendered, otherwise just chill out
|
|
697
837
|
// queue that we need to do an update, but don't worry about queuing
|
|
@@ -707,8 +847,8 @@ const proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
|
707
847
|
const members = Object.entries(cmpMeta.$members$);
|
|
708
848
|
const prototype = Cstr.prototype;
|
|
709
849
|
members.map(([memberName, [memberFlags]]) => {
|
|
710
|
-
if ((memberFlags & 31 /* Prop */ ||
|
|
711
|
-
((flags & 2 /* proxyState */) && memberFlags & 32 /* State */))) {
|
|
850
|
+
if ((memberFlags & 31 /* MEMBER_FLAGS.Prop */ ||
|
|
851
|
+
((flags & 2 /* PROXY_FLAGS.proxyState */) && memberFlags & 32 /* MEMBER_FLAGS.State */))) {
|
|
712
852
|
// proxyComponent - prop
|
|
713
853
|
Object.defineProperty(prototype, memberName, {
|
|
714
854
|
get() {
|
|
@@ -724,7 +864,7 @@ const proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
|
724
864
|
});
|
|
725
865
|
}
|
|
726
866
|
});
|
|
727
|
-
if ((flags & 1 /* isElementConstructor */)) {
|
|
867
|
+
if ((flags & 1 /* PROXY_FLAGS.isElementConstructor */)) {
|
|
728
868
|
const attrNameToPropName = new Map();
|
|
729
869
|
prototype.attributeChangedCallback = function (attrName, _oldValue, newValue) {
|
|
730
870
|
plt.jmp(() => {
|
|
@@ -780,7 +920,7 @@ const proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
|
780
920
|
// create an array of attributes to observe
|
|
781
921
|
// and also create a map of html attribute name to js property name
|
|
782
922
|
Cstr.observedAttributes = members
|
|
783
|
-
.filter(([_, m]) => m[0] & 15 /* HasAttribute */) // filter to only keep props that should match attributes
|
|
923
|
+
.filter(([_, m]) => m[0] & 15 /* MEMBER_FLAGS.HasAttribute */) // filter to only keep props that should match attributes
|
|
784
924
|
.map(([propName, m]) => {
|
|
785
925
|
const attrName = m[1] || propName;
|
|
786
926
|
attrNameToPropName.set(attrName, propName);
|
|
@@ -792,10 +932,10 @@ const proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
|
792
932
|
};
|
|
793
933
|
const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId, Cstr) => {
|
|
794
934
|
// initializeComponent
|
|
795
|
-
if ((hostRef.$flags$ & 32 /* hasInitializedComponent */) === 0) {
|
|
935
|
+
if ((hostRef.$flags$ & 32 /* HOST_FLAGS.hasInitializedComponent */) === 0) {
|
|
796
936
|
{
|
|
797
937
|
// we haven't initialized this element yet
|
|
798
|
-
hostRef.$flags$ |= 32 /* hasInitializedComponent */;
|
|
938
|
+
hostRef.$flags$ |= 32 /* HOST_FLAGS.hasInitializedComponent */;
|
|
799
939
|
// lazy loaded components
|
|
800
940
|
// request the component's implementation to be
|
|
801
941
|
// wired up with the host element
|
|
@@ -807,7 +947,7 @@ const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId, Cstr) =>
|
|
|
807
947
|
endLoad();
|
|
808
948
|
}
|
|
809
949
|
if (!Cstr.isProxied) {
|
|
810
|
-
proxyComponent(Cstr, cmpMeta, 2 /* proxyState */);
|
|
950
|
+
proxyComponent(Cstr, cmpMeta, 2 /* PROXY_FLAGS.proxyState */);
|
|
811
951
|
Cstr.isProxied = true;
|
|
812
952
|
}
|
|
813
953
|
const endNewInstance = createTime('createInstance', cmpMeta.$tagName$);
|
|
@@ -815,7 +955,7 @@ const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId, Cstr) =>
|
|
|
815
955
|
// but let's keep track of when we start and stop
|
|
816
956
|
// so that the getters/setters don't incorrectly step on data
|
|
817
957
|
{
|
|
818
|
-
hostRef.$flags$ |= 8 /* isConstructingInstance */;
|
|
958
|
+
hostRef.$flags$ |= 8 /* HOST_FLAGS.isConstructingInstance */;
|
|
819
959
|
}
|
|
820
960
|
// construct the lazy-loaded component implementation
|
|
821
961
|
// passing the hostRef is very important during
|
|
@@ -828,7 +968,7 @@ const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId, Cstr) =>
|
|
|
828
968
|
consoleError(e);
|
|
829
969
|
}
|
|
830
970
|
{
|
|
831
|
-
hostRef.$flags$ &= ~8 /* isConstructingInstance */;
|
|
971
|
+
hostRef.$flags$ &= ~8 /* HOST_FLAGS.isConstructingInstance */;
|
|
832
972
|
}
|
|
833
973
|
endNewInstance();
|
|
834
974
|
}
|
|
@@ -838,7 +978,7 @@ const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId, Cstr) =>
|
|
|
838
978
|
const scopeId = getScopeId(cmpMeta);
|
|
839
979
|
if (!styles.has(scopeId)) {
|
|
840
980
|
const endRegisterStyles = createTime('registerStyles', cmpMeta.$tagName$);
|
|
841
|
-
registerStyle(scopeId, style, !!(cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */));
|
|
981
|
+
registerStyle(scopeId, style, !!(cmpMeta.$flags$ & 1 /* CMP_FLAGS.shadowDomEncapsulation */));
|
|
842
982
|
endRegisterStyles();
|
|
843
983
|
}
|
|
844
984
|
}
|
|
@@ -860,13 +1000,13 @@ const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId, Cstr) =>
|
|
|
860
1000
|
}
|
|
861
1001
|
};
|
|
862
1002
|
const connectedCallback = (elm) => {
|
|
863
|
-
if ((plt.$flags$ & 1 /* isTmpDisconnected */) === 0) {
|
|
1003
|
+
if ((plt.$flags$ & 1 /* PLATFORM_FLAGS.isTmpDisconnected */) === 0) {
|
|
864
1004
|
const hostRef = getHostRef(elm);
|
|
865
1005
|
const cmpMeta = hostRef.$cmpMeta$;
|
|
866
1006
|
const endConnected = createTime('connectedCallback', cmpMeta.$tagName$);
|
|
867
|
-
if (!(hostRef.$flags$ & 1 /* hasConnected */)) {
|
|
1007
|
+
if (!(hostRef.$flags$ & 1 /* HOST_FLAGS.hasConnected */)) {
|
|
868
1008
|
// first time this component has connected
|
|
869
|
-
hostRef.$flags$ |= 1 /* hasConnected */;
|
|
1009
|
+
hostRef.$flags$ |= 1 /* HOST_FLAGS.hasConnected */;
|
|
870
1010
|
{
|
|
871
1011
|
// find the first ancestor component (if there is one) and register
|
|
872
1012
|
// this component as one of the actively loading child components for its ancestor
|
|
@@ -886,7 +1026,7 @@ const connectedCallback = (elm) => {
|
|
|
886
1026
|
// https://developers.google.com/web/fundamentals/web-components/best-practices#lazy-properties
|
|
887
1027
|
if (cmpMeta.$members$) {
|
|
888
1028
|
Object.entries(cmpMeta.$members$).map(([memberName, [memberFlags]]) => {
|
|
889
|
-
if (memberFlags & 31 /* Prop */ && elm.hasOwnProperty(memberName)) {
|
|
1029
|
+
if (memberFlags & 31 /* MEMBER_FLAGS.Prop */ && elm.hasOwnProperty(memberName)) {
|
|
890
1030
|
const value = elm[memberName];
|
|
891
1031
|
delete elm[memberName];
|
|
892
1032
|
elm[memberName] = value;
|
|
@@ -901,7 +1041,7 @@ const connectedCallback = (elm) => {
|
|
|
901
1041
|
}
|
|
902
1042
|
};
|
|
903
1043
|
const disconnectedCallback = (elm) => {
|
|
904
|
-
if ((plt.$flags$ & 1 /* isTmpDisconnected */) === 0) {
|
|
1044
|
+
if ((plt.$flags$ & 1 /* PLATFORM_FLAGS.isTmpDisconnected */) === 0) {
|
|
905
1045
|
getHostRef(elm);
|
|
906
1046
|
}
|
|
907
1047
|
};
|
|
@@ -937,7 +1077,7 @@ const bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
937
1077
|
super(self);
|
|
938
1078
|
self = this;
|
|
939
1079
|
registerHost(self, cmpMeta);
|
|
940
|
-
if (cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) {
|
|
1080
|
+
if (cmpMeta.$flags$ & 1 /* CMP_FLAGS.shadowDomEncapsulation */) {
|
|
941
1081
|
// this component is using shadow dom
|
|
942
1082
|
// and this browser supports shadow dom
|
|
943
1083
|
// add the read-only property "shadowRoot" to the host element
|
|
@@ -972,7 +1112,7 @@ const bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
972
1112
|
cmpMeta.$lazyBundleId$ = lazyBundle[0];
|
|
973
1113
|
if (!exclude.includes(tagName) && !customElements.get(tagName)) {
|
|
974
1114
|
cmpTags.push(tagName);
|
|
975
|
-
customElements.define(tagName, proxyComponent(HostElement, cmpMeta, 1 /* isElementConstructor */));
|
|
1115
|
+
customElements.define(tagName, proxyComponent(HostElement, cmpMeta, 1 /* PROXY_FLAGS.isElementConstructor */));
|
|
976
1116
|
}
|
|
977
1117
|
});
|
|
978
1118
|
});
|
|
@@ -994,7 +1134,7 @@ const bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
994
1134
|
// Fallback appLoad event
|
|
995
1135
|
endBootstrap();
|
|
996
1136
|
};
|
|
997
|
-
const hostRefs = new WeakMap();
|
|
1137
|
+
const hostRefs = /*@__PURE__*/ new WeakMap();
|
|
998
1138
|
const getHostRef = (ref) => hostRefs.get(ref);
|
|
999
1139
|
const registerInstance = (lazyInstance, hostRef) => hostRefs.set((hostRef.$lazyInstance$ = lazyInstance), hostRef);
|
|
1000
1140
|
const registerHost = (elm, cmpMeta) => {
|
|
@@ -1035,14 +1175,14 @@ const loadModule = (cmpMeta, hostRef, hmrVersionId) => {
|
|
|
1035
1175
|
return importedModule[exportName];
|
|
1036
1176
|
}, consoleError);
|
|
1037
1177
|
};
|
|
1038
|
-
const styles = new Map();
|
|
1178
|
+
const styles = /*@__PURE__*/ new Map();
|
|
1039
1179
|
const queueDomReads = [];
|
|
1040
1180
|
const queueDomWrites = [];
|
|
1041
1181
|
const queueTask = (queue, write) => (cb) => {
|
|
1042
1182
|
queue.push(cb);
|
|
1043
1183
|
if (!queuePending) {
|
|
1044
1184
|
queuePending = true;
|
|
1045
|
-
if (write && plt.$flags$ & 4 /* queueSync */) {
|
|
1185
|
+
if (write && plt.$flags$ & 4 /* PLATFORM_FLAGS.queueSync */) {
|
|
1046
1186
|
nextTick(flush);
|
|
1047
1187
|
}
|
|
1048
1188
|
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-35d55756.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-35d55756.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-logo-wc.cjs.js', document.baseURI).href));
|