analog-clock-components 0.1.302 → 0.1.303
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/analog-clock/analog-clock.esm.js +1 -1
- package/dist/analog-clock/{p-c54c9f6a.js → p-bd83218f.js} +0 -0
- package/dist/analog-clock/{p-97a8952d.entry.js → p-d97e4317.entry.js} +1 -1
- package/dist/cjs/analog-clock.cjs.entry.js +1 -1
- package/dist/cjs/analog-clock.cjs.js +2 -2
- package/dist/cjs/{index-b03b1653.js → index-5ea1be96.js} +184 -44
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/collection/collection-manifest.json +2 -2
- package/dist/collection/components/analog-clock/analog-clock.js +56 -52
- package/dist/esm/analog-clock.entry.js +1 -1
- package/dist/esm/analog-clock.js +2 -2
- package/dist/esm/{index-d143a91e.js → index-feecb2c4.js} +184 -44
- package/dist/esm/loader.js +2 -2
- package/loader/package.json +1 -0
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
import{p as e,b as o}from"./p-
|
|
1
|
+
import{p as e,b as o}from"./p-bd83218f.js";(()=>{const o=import.meta.url,t={};return""!==o&&(t.resourcesUrl=new URL(".",o).href),e(t)})().then((e=>o([["p-d97e4317",[[1,"analog-clock",{size:[2],timeZone:[2,"time-zone"],time:[32]}]]]],e)));
|
|
File without changes
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as t,h as e}from"./p-
|
|
1
|
+
import{r as t,h as e}from"./p-bd83218f.js";const r=class{constructor(e){t(this,e),this.size=void 0,this.timeZone=0,this.time=Date.now()}componentDidLoad(){this.timer=window.setInterval((()=>{this.time=Date.now()}),250)}disconnectedCallback(){clearInterval(this.timer)}get hour(){return new Date(this.time).getHours()}get minute(){return new Date(this.time).getMinutes()}get second(){return new Date(this.time).getSeconds()}hourToDegrees(){const t=this.hour+this.timeZone;return Math.floor(this.minute/2)+30*t}minuteToDegrees(){return Math.floor(this.second/10)+6*this.minute}secondToDegrees(){return 6*this.second}render(){return e("svg",{class:"clock",viewBox:"0 0 200 200",width:this.size,height:this.size},e("circle",{id:"circle",cx:"100",cy:"100",r:"95","stroke-width":"10",fill:"transparent"}),e("line",{id:"hour",transform:`rotate(${this.hourToDegrees()}, 100, 100)`,x1:"100",y1:"100",x2:"100",y2:"60","stroke-width":"10","stroke-linecap":"round"}),e("line",{id:"minute",transform:`rotate(${this.minuteToDegrees()}, 100, 100)`,x1:"100",y1:"100",x2:"100",y2:"30","stroke-width":"8","stroke-linecap":"round"}),e("line",{id:"second",transform:`rotate(${this.secondToDegrees()}, 100, 100)`,x1:"100",y1:"100",x2:"100",y2:"20","stroke-width":"2","stroke-linecap":"round"}))}};r.style=".clock #circle{stroke:var(--clock-circle-color, black)}.clock #hour{stroke:var(--clock-hour-color, black)}.clock #minute{stroke:var(--clock-minute-color, black)}.clock #second{stroke:var(--clock-second-color, black)}";export{r as analog_clock}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const index = require('./index-
|
|
5
|
+
const index = require('./index-5ea1be96.js');
|
|
6
6
|
|
|
7
7
|
const analogClockCss = ".clock #circle{stroke:var(--clock-circle-color, black)}.clock #hour{stroke:var(--clock-hour-color, black)}.clock #minute{stroke:var(--clock-minute-color, black)}.clock #second{stroke:var(--clock-second-color, black)}";
|
|
8
8
|
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
const index = require('./index-
|
|
3
|
+
const index = require('./index-5ea1be96.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('analog-clock.cjs.js', document.baseURI).href));
|
|
@@ -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
|
|
@@ -272,7 +272,7 @@ const setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
|
|
|
272
272
|
}
|
|
273
273
|
}
|
|
274
274
|
}
|
|
275
|
-
else if ((!isProp || flags & 4 /* isHost */ || isSvg) && !isComplex) {
|
|
275
|
+
else if ((!isProp || flags & 4 /* VNODE_FLAGS.isHost */ || isSvg) && !isComplex) {
|
|
276
276
|
newValue = newValue === true ? '' : newValue;
|
|
277
277
|
{
|
|
278
278
|
elm.setAttribute(memberName, newValue);
|
|
@@ -287,7 +287,7 @@ const updateElement = (oldVnode, newVnode, isSvgMode, memberName) => {
|
|
|
287
287
|
// if the element passed in is a shadow root, which is a document fragment
|
|
288
288
|
// then we want to be adding attrs/props to the shadow root's "host" element
|
|
289
289
|
// if it's not a shadow root, then we add attrs/props to the same element
|
|
290
|
-
const elm = newVnode.$elm$.nodeType === 11 /* DocumentFragment */ && newVnode.$elm$.host
|
|
290
|
+
const elm = newVnode.$elm$.nodeType === 11 /* NODE_TYPE.DocumentFragment */ && newVnode.$elm$.host
|
|
291
291
|
? newVnode.$elm$.host
|
|
292
292
|
: newVnode.$elm$;
|
|
293
293
|
const oldVnodeAttrs = (oldVnode && oldVnode.$attrs$) || EMPTY_OBJ;
|
|
@@ -305,6 +305,16 @@ const updateElement = (oldVnode, newVnode, isSvgMode, memberName) => {
|
|
|
305
305
|
setAccessor(elm, memberName, oldVnodeAttrs[memberName], newVnodeAttrs[memberName], isSvgMode, newVnode.$flags$);
|
|
306
306
|
}
|
|
307
307
|
};
|
|
308
|
+
/**
|
|
309
|
+
* Create a DOM Node corresponding to one of the children of a given VNode.
|
|
310
|
+
*
|
|
311
|
+
* @param oldParentVNode the parent VNode from the previous render
|
|
312
|
+
* @param newParentVNode the parent VNode from the current render
|
|
313
|
+
* @param childIndex the index of the VNode, in the _new_ parent node's
|
|
314
|
+
* children, for which we will create a new DOM node
|
|
315
|
+
* @param parentElm the parent DOM node which our new node will be a child of
|
|
316
|
+
* @returns the newly created node
|
|
317
|
+
*/
|
|
308
318
|
const createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
|
|
309
319
|
// tslint:disable-next-line: prefer-const
|
|
310
320
|
const newVNode = newParentVNode.$children$[childIndex];
|
|
@@ -379,6 +389,74 @@ const removeVnodes = (vnodes, startIdx, endIdx, vnode, elm) => {
|
|
|
379
389
|
}
|
|
380
390
|
}
|
|
381
391
|
};
|
|
392
|
+
/**
|
|
393
|
+
* Reconcile the children of a new VNode with the children of an old VNode by
|
|
394
|
+
* traversing the two collections of children, identifying nodes that are
|
|
395
|
+
* conserved or changed, calling out to `patch` to make any necessary
|
|
396
|
+
* updates to the DOM, and rearranging DOM nodes as needed.
|
|
397
|
+
*
|
|
398
|
+
* The algorithm for reconciling children works by analyzing two 'windows' onto
|
|
399
|
+
* the two arrays of children (`oldCh` and `newCh`). We keep track of the
|
|
400
|
+
* 'windows' by storing start and end indices and references to the
|
|
401
|
+
* corresponding array entries. Initially the two 'windows' are basically equal
|
|
402
|
+
* to the entire array, but we progressively narrow the windows until there are
|
|
403
|
+
* no children left to update by doing the following:
|
|
404
|
+
*
|
|
405
|
+
* 1. Skip any `null` entries at the beginning or end of the two arrays, so
|
|
406
|
+
* that if we have an initial array like the following we'll end up dealing
|
|
407
|
+
* only with a window bounded by the highlighted elements:
|
|
408
|
+
*
|
|
409
|
+
* [null, null, VNode1 , ... , VNode2, null, null]
|
|
410
|
+
* ^^^^^^ ^^^^^^
|
|
411
|
+
*
|
|
412
|
+
* 2. Check to see if the elements at the head and tail positions are equal
|
|
413
|
+
* across the windows. This will basically detect elements which haven't
|
|
414
|
+
* been added, removed, or changed position, i.e. if you had the following
|
|
415
|
+
* VNode elements (represented as HTML):
|
|
416
|
+
*
|
|
417
|
+
* oldVNode: `<div><p><span>HEY</span></p></div>`
|
|
418
|
+
* newVNode: `<div><p><span>THERE</span></p></div>`
|
|
419
|
+
*
|
|
420
|
+
* Then when comparing the children of the `<div>` tag we check the equality
|
|
421
|
+
* of the VNodes corresponding to the `<p>` tags and, since they are the
|
|
422
|
+
* same tag in the same position, we'd be able to avoid completely
|
|
423
|
+
* re-rendering the subtree under them with a new DOM element and would just
|
|
424
|
+
* call out to `patch` to handle reconciling their children and so on.
|
|
425
|
+
*
|
|
426
|
+
* 3. Check, for both windows, to see if the element at the beginning of the
|
|
427
|
+
* window corresponds to the element at the end of the other window. This is
|
|
428
|
+
* a heuristic which will let us identify _some_ situations in which
|
|
429
|
+
* elements have changed position, for instance it _should_ detect that the
|
|
430
|
+
* children nodes themselves have not changed but merely moved in the
|
|
431
|
+
* following example:
|
|
432
|
+
*
|
|
433
|
+
* oldVNode: `<div><element-one /><element-two /></div>`
|
|
434
|
+
* newVNode: `<div><element-two /><element-one /></div>`
|
|
435
|
+
*
|
|
436
|
+
* If we find cases like this then we also need to move the concrete DOM
|
|
437
|
+
* elements corresponding to the moved children to write the re-order to the
|
|
438
|
+
* DOM.
|
|
439
|
+
*
|
|
440
|
+
* 4. Finally, if VNodes have the `key` attribute set on them we check for any
|
|
441
|
+
* nodes in the old children which have the same key as the first element in
|
|
442
|
+
* our window on the new children. If we find such a node we handle calling
|
|
443
|
+
* out to `patch`, moving relevant DOM nodes, and so on, in accordance with
|
|
444
|
+
* what we find.
|
|
445
|
+
*
|
|
446
|
+
* Finally, once we've narrowed our 'windows' to the point that either of them
|
|
447
|
+
* collapse (i.e. they have length 0) we then handle any remaining VNode
|
|
448
|
+
* insertion or deletion that needs to happen to get a DOM state that correctly
|
|
449
|
+
* reflects the new child VNodes. If, for instance, after our window on the old
|
|
450
|
+
* children has collapsed we still have more nodes on the new children that
|
|
451
|
+
* we haven't dealt with yet then we need to add them, or if the new children
|
|
452
|
+
* collapse but we still have unhandled _old_ children then we need to make
|
|
453
|
+
* sure the corresponding DOM nodes are removed.
|
|
454
|
+
*
|
|
455
|
+
* @param parentElm the node into which the parent VNode is rendered
|
|
456
|
+
* @param oldCh the old children of the parent node
|
|
457
|
+
* @param newVNode the new VNode which will replace the parent
|
|
458
|
+
* @param newCh the new children of the parent node
|
|
459
|
+
*/
|
|
382
460
|
const updateChildren = (parentElm, oldCh, newVNode, newCh) => {
|
|
383
461
|
let oldStartIdx = 0;
|
|
384
462
|
let newStartIdx = 0;
|
|
@@ -391,7 +469,7 @@ const updateChildren = (parentElm, oldCh, newVNode, newCh) => {
|
|
|
391
469
|
let node;
|
|
392
470
|
while (oldStartIdx <= oldEndIdx && newStartIdx <= newEndIdx) {
|
|
393
471
|
if (oldStartVnode == null) {
|
|
394
|
-
//
|
|
472
|
+
// VNode might have been moved left
|
|
395
473
|
oldStartVnode = oldCh[++oldStartIdx];
|
|
396
474
|
}
|
|
397
475
|
else if (oldEndVnode == null) {
|
|
@@ -404,34 +482,67 @@ const updateChildren = (parentElm, oldCh, newVNode, newCh) => {
|
|
|
404
482
|
newEndVnode = newCh[--newEndIdx];
|
|
405
483
|
}
|
|
406
484
|
else if (isSameVnode(oldStartVnode, newStartVnode)) {
|
|
485
|
+
// if the start nodes are the same then we should patch the new VNode
|
|
486
|
+
// onto the old one, and increment our `newStartIdx` and `oldStartIdx`
|
|
487
|
+
// indices to reflect that. We don't need to move any DOM Nodes around
|
|
488
|
+
// since things are matched up in order.
|
|
407
489
|
patch(oldStartVnode, newStartVnode);
|
|
408
490
|
oldStartVnode = oldCh[++oldStartIdx];
|
|
409
491
|
newStartVnode = newCh[++newStartIdx];
|
|
410
492
|
}
|
|
411
493
|
else if (isSameVnode(oldEndVnode, newEndVnode)) {
|
|
494
|
+
// likewise, if the end nodes are the same we patch new onto old and
|
|
495
|
+
// decrement our end indices, and also likewise in this case we don't
|
|
496
|
+
// need to move any DOM Nodes.
|
|
412
497
|
patch(oldEndVnode, newEndVnode);
|
|
413
498
|
oldEndVnode = oldCh[--oldEndIdx];
|
|
414
499
|
newEndVnode = newCh[--newEndIdx];
|
|
415
500
|
}
|
|
416
501
|
else if (isSameVnode(oldStartVnode, newEndVnode)) {
|
|
417
502
|
patch(oldStartVnode, newEndVnode);
|
|
503
|
+
// We need to move the element for `oldStartVnode` into a position which
|
|
504
|
+
// will be appropriate for `newEndVnode`. For this we can use
|
|
505
|
+
// `.insertBefore` and `oldEndVnode.$elm$.nextSibling`. If there is a
|
|
506
|
+
// sibling for `oldEndVnode.$elm$` then we want to move the DOM node for
|
|
507
|
+
// `oldStartVnode` between `oldEndVnode` and it's sibling, like so:
|
|
508
|
+
//
|
|
509
|
+
// <old-start-node />
|
|
510
|
+
// <some-intervening-node />
|
|
511
|
+
// <old-end-node />
|
|
512
|
+
// <!-- -> <-- `oldStartVnode.$elm$` should be inserted here
|
|
513
|
+
// <next-sibling />
|
|
514
|
+
//
|
|
515
|
+
// If instead `oldEndVnode.$elm$` has no sibling then we just want to put
|
|
516
|
+
// the node for `oldStartVnode` at the end of the children of
|
|
517
|
+
// `parentElm`. Luckily, `Node.nextSibling` will return `null` if there
|
|
518
|
+
// aren't any siblings, and passing `null` to `Node.insertBefore` will
|
|
519
|
+
// append it to the children of the parent element.
|
|
418
520
|
parentElm.insertBefore(oldStartVnode.$elm$, oldEndVnode.$elm$.nextSibling);
|
|
419
521
|
oldStartVnode = oldCh[++oldStartIdx];
|
|
420
522
|
newEndVnode = newCh[--newEndIdx];
|
|
421
523
|
}
|
|
422
524
|
else if (isSameVnode(oldEndVnode, newStartVnode)) {
|
|
423
525
|
patch(oldEndVnode, newStartVnode);
|
|
526
|
+
// We've already checked above if `oldStartVnode` and `newStartVnode` are
|
|
527
|
+
// the same node, so since we're here we know that they are not. Thus we
|
|
528
|
+
// can move the element for `oldEndVnode` _before_ the element for
|
|
529
|
+
// `oldStartVnode`, leaving `oldStartVnode` to be reconciled in the
|
|
530
|
+
// future.
|
|
424
531
|
parentElm.insertBefore(oldEndVnode.$elm$, oldStartVnode.$elm$);
|
|
425
532
|
oldEndVnode = oldCh[--oldEndIdx];
|
|
426
533
|
newStartVnode = newCh[++newStartIdx];
|
|
427
534
|
}
|
|
428
535
|
else {
|
|
429
536
|
{
|
|
430
|
-
//
|
|
537
|
+
// We either didn't find an element in the old children that matches
|
|
538
|
+
// the key of the first new child OR the build is not using `key`
|
|
539
|
+
// attributes at all. In either case we need to create a new element
|
|
540
|
+
// for the new node.
|
|
431
541
|
node = createElm(oldCh && oldCh[newStartIdx], newVNode, newStartIdx);
|
|
432
542
|
newStartVnode = newCh[++newStartIdx];
|
|
433
543
|
}
|
|
434
544
|
if (node) {
|
|
545
|
+
// if we created a new node then handle inserting it to the DOM
|
|
435
546
|
{
|
|
436
547
|
oldStartVnode.$elm$.parentNode.insertBefore(node, oldStartVnode.$elm$);
|
|
437
548
|
}
|
|
@@ -439,20 +550,49 @@ const updateChildren = (parentElm, oldCh, newVNode, newCh) => {
|
|
|
439
550
|
}
|
|
440
551
|
}
|
|
441
552
|
if (oldStartIdx > oldEndIdx) {
|
|
553
|
+
// we have some more new nodes to add which don't match up with old nodes
|
|
442
554
|
addVnodes(parentElm, newCh[newEndIdx + 1] == null ? null : newCh[newEndIdx + 1].$elm$, newVNode, newCh, newStartIdx, newEndIdx);
|
|
443
555
|
}
|
|
444
556
|
else if (newStartIdx > newEndIdx) {
|
|
557
|
+
// there are nodes in the `oldCh` array which no longer correspond to nodes
|
|
558
|
+
// in the new array, so lets remove them (which entails cleaning up the
|
|
559
|
+
// relevant DOM nodes)
|
|
445
560
|
removeVnodes(oldCh, oldStartIdx, oldEndIdx);
|
|
446
561
|
}
|
|
447
562
|
};
|
|
448
|
-
|
|
563
|
+
/**
|
|
564
|
+
* Compare two VNodes to determine if they are the same
|
|
565
|
+
*
|
|
566
|
+
* **NB**: This function is an equality _heuristic_ based on the available
|
|
567
|
+
* information set on the two VNodes and can be misleading under certain
|
|
568
|
+
* circumstances. In particular, if the two nodes do not have `key` attrs
|
|
569
|
+
* (available under `$key$` on VNodes) then the function falls back on merely
|
|
570
|
+
* checking that they have the same tag.
|
|
571
|
+
*
|
|
572
|
+
* So, in other words, if `key` attrs are not set on VNodes which may be
|
|
573
|
+
* changing order within a `children` array or something along those lines then
|
|
574
|
+
* we could obtain a false positive and then have to do needless re-rendering.
|
|
575
|
+
*
|
|
576
|
+
* @param leftVNode the first VNode to check
|
|
577
|
+
* @param rightVNode the second VNode to check
|
|
578
|
+
* @returns whether they're equal or not
|
|
579
|
+
*/
|
|
580
|
+
const isSameVnode = (leftVNode, rightVNode) => {
|
|
449
581
|
// compare if two vnode to see if they're "technically" the same
|
|
450
582
|
// need to have the same element tag, and same key to be the same
|
|
451
|
-
if (
|
|
583
|
+
if (leftVNode.$tag$ === rightVNode.$tag$) {
|
|
452
584
|
return true;
|
|
453
585
|
}
|
|
454
586
|
return false;
|
|
455
587
|
};
|
|
588
|
+
/**
|
|
589
|
+
* Handle reconciling an outdated VNode with a new one which corresponds to
|
|
590
|
+
* it. This function handles flushing updates to the DOM and reconciling the
|
|
591
|
+
* children of the two nodes (if any).
|
|
592
|
+
*
|
|
593
|
+
* @param oldVNode an old VNode whose DOM element and children we want to update
|
|
594
|
+
* @param newVNode a new VNode representing an updated version of the old one
|
|
595
|
+
*/
|
|
456
596
|
const patch = (oldVNode, newVNode) => {
|
|
457
597
|
const elm = (newVNode.$elm$ = oldVNode.$elm$);
|
|
458
598
|
const oldChildren = oldVNode.$children$;
|
|
@@ -464,7 +604,6 @@ const patch = (oldVNode, newVNode) => {
|
|
|
464
604
|
// only add this to the when the compiler sees we're using an svg somewhere
|
|
465
605
|
isSvgMode = tag === 'svg' ? true : tag === 'foreignObject' ? false : isSvgMode;
|
|
466
606
|
}
|
|
467
|
-
// element node
|
|
468
607
|
{
|
|
469
608
|
{
|
|
470
609
|
// either this is the first render of an element OR it's an update
|
|
@@ -475,6 +614,7 @@ const patch = (oldVNode, newVNode) => {
|
|
|
475
614
|
}
|
|
476
615
|
if (oldChildren !== null && newChildren !== null) {
|
|
477
616
|
// looks like there's child vnodes for both the old and new vnodes
|
|
617
|
+
// so we need to call `updateChildren` to reconcile them
|
|
478
618
|
updateChildren(elm, oldChildren, newVNode, newChildren);
|
|
479
619
|
}
|
|
480
620
|
else if (newChildren !== null) {
|
|
@@ -496,7 +636,7 @@ const renderVdom = (hostRef, renderFnResults) => {
|
|
|
496
636
|
const rootVnode = isHost(renderFnResults) ? renderFnResults : h(null, null, renderFnResults);
|
|
497
637
|
hostTagName = hostElm.tagName;
|
|
498
638
|
rootVnode.$tag$ = null;
|
|
499
|
-
rootVnode.$flags$ |= 4 /* isHost */;
|
|
639
|
+
rootVnode.$flags$ |= 4 /* VNODE_FLAGS.isHost */;
|
|
500
640
|
hostRef.$vnode$ = rootVnode;
|
|
501
641
|
rootVnode.$elm$ = oldVNode.$elm$ = (hostElm.shadowRoot || hostElm );
|
|
502
642
|
{
|
|
@@ -524,10 +664,10 @@ const attachToAncestor = (hostRef, ancestorComponent) => {
|
|
|
524
664
|
};
|
|
525
665
|
const scheduleUpdate = (hostRef, isInitialLoad) => {
|
|
526
666
|
{
|
|
527
|
-
hostRef.$flags$ |= 16 /* isQueuedForUpdate */;
|
|
667
|
+
hostRef.$flags$ |= 16 /* HOST_FLAGS.isQueuedForUpdate */;
|
|
528
668
|
}
|
|
529
|
-
if (hostRef.$flags$ & 4 /* isWaitingForChildren */) {
|
|
530
|
-
hostRef.$flags$ |= 512 /* needsRerender */;
|
|
669
|
+
if (hostRef.$flags$ & 4 /* HOST_FLAGS.isWaitingForChildren */) {
|
|
670
|
+
hostRef.$flags$ |= 512 /* HOST_FLAGS.needsRerender */;
|
|
531
671
|
return;
|
|
532
672
|
}
|
|
533
673
|
attachToAncestor(hostRef, hostRef.$ancestorComponent$);
|
|
@@ -574,7 +714,7 @@ const updateComponent = async (hostRef, instance, isInitialLoad) => {
|
|
|
574
714
|
}
|
|
575
715
|
else {
|
|
576
716
|
Promise.all(childrenPromises).then(postUpdate);
|
|
577
|
-
hostRef.$flags$ |= 4 /* isWaitingForChildren */;
|
|
717
|
+
hostRef.$flags$ |= 4 /* HOST_FLAGS.isWaitingForChildren */;
|
|
578
718
|
childrenPromises.length = 0;
|
|
579
719
|
}
|
|
580
720
|
}
|
|
@@ -583,10 +723,10 @@ const callRender = (hostRef, instance, elm) => {
|
|
|
583
723
|
try {
|
|
584
724
|
instance = instance.render() ;
|
|
585
725
|
{
|
|
586
|
-
hostRef.$flags$ &= ~16 /* isQueuedForUpdate */;
|
|
726
|
+
hostRef.$flags$ &= ~16 /* HOST_FLAGS.isQueuedForUpdate */;
|
|
587
727
|
}
|
|
588
728
|
{
|
|
589
|
-
hostRef.$flags$ |= 2 /* hasRendered */;
|
|
729
|
+
hostRef.$flags$ |= 2 /* HOST_FLAGS.hasRendered */;
|
|
590
730
|
}
|
|
591
731
|
{
|
|
592
732
|
{
|
|
@@ -610,8 +750,8 @@ const postUpdateComponent = (hostRef) => {
|
|
|
610
750
|
const endPostUpdate = createTime('postUpdate', tagName);
|
|
611
751
|
const instance = hostRef.$lazyInstance$ ;
|
|
612
752
|
const ancestorComponent = hostRef.$ancestorComponent$;
|
|
613
|
-
if (!(hostRef.$flags$ & 64 /* hasLoadedComponent */)) {
|
|
614
|
-
hostRef.$flags$ |= 64 /* hasLoadedComponent */;
|
|
753
|
+
if (!(hostRef.$flags$ & 64 /* HOST_FLAGS.hasLoadedComponent */)) {
|
|
754
|
+
hostRef.$flags$ |= 64 /* HOST_FLAGS.hasLoadedComponent */;
|
|
615
755
|
{
|
|
616
756
|
// DOM WRITE!
|
|
617
757
|
addHydratedFlag(elm);
|
|
@@ -637,10 +777,10 @@ const postUpdateComponent = (hostRef) => {
|
|
|
637
777
|
hostRef.$onRenderResolve$();
|
|
638
778
|
hostRef.$onRenderResolve$ = undefined;
|
|
639
779
|
}
|
|
640
|
-
if (hostRef.$flags$ & 512 /* needsRerender */) {
|
|
780
|
+
if (hostRef.$flags$ & 512 /* HOST_FLAGS.needsRerender */) {
|
|
641
781
|
nextTick(() => scheduleUpdate(hostRef, false));
|
|
642
782
|
}
|
|
643
|
-
hostRef.$flags$ &= ~(4 /* isWaitingForChildren */ | 512 /* needsRerender */);
|
|
783
|
+
hostRef.$flags$ &= ~(4 /* HOST_FLAGS.isWaitingForChildren */ | 512 /* HOST_FLAGS.needsRerender */);
|
|
644
784
|
}
|
|
645
785
|
// ( •_•)
|
|
646
786
|
// ( •_•)>⌐■-■
|
|
@@ -696,7 +836,7 @@ const addHydratedFlag = (elm) => elm.classList.add('hydrated')
|
|
|
696
836
|
const parsePropertyValue = (propValue, propType) => {
|
|
697
837
|
// ensure this value is of the correct prop type
|
|
698
838
|
if (propValue != null && !isComplexType(propValue)) {
|
|
699
|
-
if (propType & 2 /* Number */) {
|
|
839
|
+
if (propType & 2 /* MEMBER_FLAGS.Number */) {
|
|
700
840
|
// force it to be a number
|
|
701
841
|
return parseFloat(propValue);
|
|
702
842
|
}
|
|
@@ -718,12 +858,12 @@ const setValue = (ref, propName, newVal, cmpMeta) => {
|
|
|
718
858
|
// explicitly check for NaN on both sides, as `NaN === NaN` is always false
|
|
719
859
|
const areBothNaN = Number.isNaN(oldVal) && Number.isNaN(newVal);
|
|
720
860
|
const didValueChange = newVal !== oldVal && !areBothNaN;
|
|
721
|
-
if ((!(flags & 8 /* isConstructingInstance */) || oldVal === undefined) && didValueChange) {
|
|
861
|
+
if ((!(flags & 8 /* HOST_FLAGS.isConstructingInstance */) || oldVal === undefined) && didValueChange) {
|
|
722
862
|
// gadzooks! the property's value has changed!!
|
|
723
863
|
// set our new value!
|
|
724
864
|
hostRef.$instanceValues$.set(propName, newVal);
|
|
725
865
|
if (instance) {
|
|
726
|
-
if ((flags & (2 /* hasRendered */ | 16 /* isQueuedForUpdate */)) === 2 /* hasRendered */) {
|
|
866
|
+
if ((flags & (2 /* HOST_FLAGS.hasRendered */ | 16 /* HOST_FLAGS.isQueuedForUpdate */)) === 2 /* HOST_FLAGS.hasRendered */) {
|
|
727
867
|
// looks like this value actually changed, so we've got work to do!
|
|
728
868
|
// but only if we've already rendered, otherwise just chill out
|
|
729
869
|
// queue that we need to do an update, but don't worry about queuing
|
|
@@ -739,8 +879,8 @@ const proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
|
739
879
|
const members = Object.entries(cmpMeta.$members$);
|
|
740
880
|
const prototype = Cstr.prototype;
|
|
741
881
|
members.map(([memberName, [memberFlags]]) => {
|
|
742
|
-
if ((memberFlags & 31 /* Prop */ ||
|
|
743
|
-
((flags & 2 /* proxyState */) && memberFlags & 32 /* State */))) {
|
|
882
|
+
if ((memberFlags & 31 /* MEMBER_FLAGS.Prop */ ||
|
|
883
|
+
((flags & 2 /* PROXY_FLAGS.proxyState */) && memberFlags & 32 /* MEMBER_FLAGS.State */))) {
|
|
744
884
|
// proxyComponent - prop
|
|
745
885
|
Object.defineProperty(prototype, memberName, {
|
|
746
886
|
get() {
|
|
@@ -756,7 +896,7 @@ const proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
|
756
896
|
});
|
|
757
897
|
}
|
|
758
898
|
});
|
|
759
|
-
if ((flags & 1 /* isElementConstructor */)) {
|
|
899
|
+
if ((flags & 1 /* PROXY_FLAGS.isElementConstructor */)) {
|
|
760
900
|
const attrNameToPropName = new Map();
|
|
761
901
|
prototype.attributeChangedCallback = function (attrName, _oldValue, newValue) {
|
|
762
902
|
plt.jmp(() => {
|
|
@@ -812,7 +952,7 @@ const proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
|
812
952
|
// create an array of attributes to observe
|
|
813
953
|
// and also create a map of html attribute name to js property name
|
|
814
954
|
Cstr.observedAttributes = members
|
|
815
|
-
.filter(([_, m]) => m[0] & 15 /* HasAttribute */) // filter to only keep props that should match attributes
|
|
955
|
+
.filter(([_, m]) => m[0] & 15 /* MEMBER_FLAGS.HasAttribute */) // filter to only keep props that should match attributes
|
|
816
956
|
.map(([propName, m]) => {
|
|
817
957
|
const attrName = m[1] || propName;
|
|
818
958
|
attrNameToPropName.set(attrName, propName);
|
|
@@ -824,10 +964,10 @@ const proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
|
824
964
|
};
|
|
825
965
|
const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId, Cstr) => {
|
|
826
966
|
// initializeComponent
|
|
827
|
-
if ((hostRef.$flags$ & 32 /* hasInitializedComponent */) === 0) {
|
|
967
|
+
if ((hostRef.$flags$ & 32 /* HOST_FLAGS.hasInitializedComponent */) === 0) {
|
|
828
968
|
{
|
|
829
969
|
// we haven't initialized this element yet
|
|
830
|
-
hostRef.$flags$ |= 32 /* hasInitializedComponent */;
|
|
970
|
+
hostRef.$flags$ |= 32 /* HOST_FLAGS.hasInitializedComponent */;
|
|
831
971
|
// lazy loaded components
|
|
832
972
|
// request the component's implementation to be
|
|
833
973
|
// wired up with the host element
|
|
@@ -839,7 +979,7 @@ const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId, Cstr) =>
|
|
|
839
979
|
endLoad();
|
|
840
980
|
}
|
|
841
981
|
if (!Cstr.isProxied) {
|
|
842
|
-
proxyComponent(Cstr, cmpMeta, 2 /* proxyState */);
|
|
982
|
+
proxyComponent(Cstr, cmpMeta, 2 /* PROXY_FLAGS.proxyState */);
|
|
843
983
|
Cstr.isProxied = true;
|
|
844
984
|
}
|
|
845
985
|
const endNewInstance = createTime('createInstance', cmpMeta.$tagName$);
|
|
@@ -847,7 +987,7 @@ const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId, Cstr) =>
|
|
|
847
987
|
// but let's keep track of when we start and stop
|
|
848
988
|
// so that the getters/setters don't incorrectly step on data
|
|
849
989
|
{
|
|
850
|
-
hostRef.$flags$ |= 8 /* isConstructingInstance */;
|
|
990
|
+
hostRef.$flags$ |= 8 /* HOST_FLAGS.isConstructingInstance */;
|
|
851
991
|
}
|
|
852
992
|
// construct the lazy-loaded component implementation
|
|
853
993
|
// passing the hostRef is very important during
|
|
@@ -860,7 +1000,7 @@ const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId, Cstr) =>
|
|
|
860
1000
|
consoleError(e);
|
|
861
1001
|
}
|
|
862
1002
|
{
|
|
863
|
-
hostRef.$flags$ &= ~8 /* isConstructingInstance */;
|
|
1003
|
+
hostRef.$flags$ &= ~8 /* HOST_FLAGS.isConstructingInstance */;
|
|
864
1004
|
}
|
|
865
1005
|
endNewInstance();
|
|
866
1006
|
}
|
|
@@ -870,7 +1010,7 @@ const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId, Cstr) =>
|
|
|
870
1010
|
const scopeId = getScopeId(cmpMeta);
|
|
871
1011
|
if (!styles.has(scopeId)) {
|
|
872
1012
|
const endRegisterStyles = createTime('registerStyles', cmpMeta.$tagName$);
|
|
873
|
-
registerStyle(scopeId, style, !!(cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */));
|
|
1013
|
+
registerStyle(scopeId, style, !!(cmpMeta.$flags$ & 1 /* CMP_FLAGS.shadowDomEncapsulation */));
|
|
874
1014
|
endRegisterStyles();
|
|
875
1015
|
}
|
|
876
1016
|
}
|
|
@@ -892,13 +1032,13 @@ const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId, Cstr) =>
|
|
|
892
1032
|
}
|
|
893
1033
|
};
|
|
894
1034
|
const connectedCallback = (elm) => {
|
|
895
|
-
if ((plt.$flags$ & 1 /* isTmpDisconnected */) === 0) {
|
|
1035
|
+
if ((plt.$flags$ & 1 /* PLATFORM_FLAGS.isTmpDisconnected */) === 0) {
|
|
896
1036
|
const hostRef = getHostRef(elm);
|
|
897
1037
|
const cmpMeta = hostRef.$cmpMeta$;
|
|
898
1038
|
const endConnected = createTime('connectedCallback', cmpMeta.$tagName$);
|
|
899
|
-
if (!(hostRef.$flags$ & 1 /* hasConnected */)) {
|
|
1039
|
+
if (!(hostRef.$flags$ & 1 /* HOST_FLAGS.hasConnected */)) {
|
|
900
1040
|
// first time this component has connected
|
|
901
|
-
hostRef.$flags$ |= 1 /* hasConnected */;
|
|
1041
|
+
hostRef.$flags$ |= 1 /* HOST_FLAGS.hasConnected */;
|
|
902
1042
|
{
|
|
903
1043
|
// find the first ancestor component (if there is one) and register
|
|
904
1044
|
// this component as one of the actively loading child components for its ancestor
|
|
@@ -918,7 +1058,7 @@ const connectedCallback = (elm) => {
|
|
|
918
1058
|
// https://developers.google.com/web/fundamentals/web-components/best-practices#lazy-properties
|
|
919
1059
|
if (cmpMeta.$members$) {
|
|
920
1060
|
Object.entries(cmpMeta.$members$).map(([memberName, [memberFlags]]) => {
|
|
921
|
-
if (memberFlags & 31 /* Prop */ && elm.hasOwnProperty(memberName)) {
|
|
1061
|
+
if (memberFlags & 31 /* MEMBER_FLAGS.Prop */ && elm.hasOwnProperty(memberName)) {
|
|
922
1062
|
const value = elm[memberName];
|
|
923
1063
|
delete elm[memberName];
|
|
924
1064
|
elm[memberName] = value;
|
|
@@ -933,7 +1073,7 @@ const connectedCallback = (elm) => {
|
|
|
933
1073
|
}
|
|
934
1074
|
};
|
|
935
1075
|
const disconnectedCallback = (elm) => {
|
|
936
|
-
if ((plt.$flags$ & 1 /* isTmpDisconnected */) === 0) {
|
|
1076
|
+
if ((plt.$flags$ & 1 /* PLATFORM_FLAGS.isTmpDisconnected */) === 0) {
|
|
937
1077
|
const hostRef = getHostRef(elm);
|
|
938
1078
|
const instance = hostRef.$lazyInstance$ ;
|
|
939
1079
|
{
|
|
@@ -973,7 +1113,7 @@ const bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
973
1113
|
super(self);
|
|
974
1114
|
self = this;
|
|
975
1115
|
registerHost(self, cmpMeta);
|
|
976
|
-
if (cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) {
|
|
1116
|
+
if (cmpMeta.$flags$ & 1 /* CMP_FLAGS.shadowDomEncapsulation */) {
|
|
977
1117
|
// this component is using shadow dom
|
|
978
1118
|
// and this browser supports shadow dom
|
|
979
1119
|
// add the read-only property "shadowRoot" to the host element
|
|
@@ -1008,7 +1148,7 @@ const bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
1008
1148
|
cmpMeta.$lazyBundleId$ = lazyBundle[0];
|
|
1009
1149
|
if (!exclude.includes(tagName) && !customElements.get(tagName)) {
|
|
1010
1150
|
cmpTags.push(tagName);
|
|
1011
|
-
customElements.define(tagName, proxyComponent(HostElement, cmpMeta, 1 /* isElementConstructor */));
|
|
1151
|
+
customElements.define(tagName, proxyComponent(HostElement, cmpMeta, 1 /* PROXY_FLAGS.isElementConstructor */));
|
|
1012
1152
|
}
|
|
1013
1153
|
});
|
|
1014
1154
|
});
|
|
@@ -1030,7 +1170,7 @@ const bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
1030
1170
|
// Fallback appLoad event
|
|
1031
1171
|
endBootstrap();
|
|
1032
1172
|
};
|
|
1033
|
-
const hostRefs = new WeakMap();
|
|
1173
|
+
const hostRefs = /*@__PURE__*/ new WeakMap();
|
|
1034
1174
|
const getHostRef = (ref) => hostRefs.get(ref);
|
|
1035
1175
|
const registerInstance = (lazyInstance, hostRef) => hostRefs.set((hostRef.$lazyInstance$ = lazyInstance), hostRef);
|
|
1036
1176
|
const registerHost = (elm, cmpMeta) => {
|
|
@@ -1071,14 +1211,14 @@ const loadModule = (cmpMeta, hostRef, hmrVersionId) => {
|
|
|
1071
1211
|
return importedModule[exportName];
|
|
1072
1212
|
}, consoleError);
|
|
1073
1213
|
};
|
|
1074
|
-
const styles = new Map();
|
|
1214
|
+
const styles = /*@__PURE__*/ new Map();
|
|
1075
1215
|
const queueDomReads = [];
|
|
1076
1216
|
const queueDomWrites = [];
|
|
1077
1217
|
const queueTask = (queue, write) => (cb) => {
|
|
1078
1218
|
queue.push(cb);
|
|
1079
1219
|
if (!queuePending) {
|
|
1080
1220
|
queuePending = true;
|
|
1081
|
-
if (write && plt.$flags$ & 4 /* queueSync */) {
|
|
1221
|
+
if (write && plt.$flags$ & 4 /* PLATFORM_FLAGS.queueSync */) {
|
|
1082
1222
|
nextTick(flush);
|
|
1083
1223
|
}
|
|
1084
1224
|
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-5ea1be96.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,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { h } from '@stencil/core';
|
|
2
2
|
export class AnalogClock {
|
|
3
3
|
constructor() {
|
|
4
4
|
this.size = undefined;
|
|
@@ -33,59 +33,63 @@ export class AnalogClock {
|
|
|
33
33
|
return this.second * 6;
|
|
34
34
|
}
|
|
35
35
|
render() {
|
|
36
|
-
return (h("svg", { class: "clock", viewBox: "0 0 200 200", width: this.size, height: this.size },
|
|
37
|
-
h("circle", { id: "circle", cx: "100", cy: "100", r: "95", "stroke-width": "10", fill: "transparent" }),
|
|
38
|
-
h("line", { id: "hour", transform: `rotate(${this.hourToDegrees()}, 100, 100)`, x1: "100", y1: "100", x2: "100", y2: "60", "stroke-width": "10", "stroke-linecap": "round" }),
|
|
39
|
-
h("line", { id: "minute", transform: `rotate(${this.minuteToDegrees()}, 100, 100)`, x1: "100", y1: "100", x2: "100", y2: "30", "stroke-width": "8", "stroke-linecap": "round" }),
|
|
40
|
-
h("line", { id: "second", transform: `rotate(${this.secondToDegrees()}, 100, 100)`, x1: "100", y1: "100", x2: "100", y2: "20", "stroke-width": "2", "stroke-linecap": "round" })));
|
|
36
|
+
return (h("svg", { class: "clock", viewBox: "0 0 200 200", width: this.size, height: this.size }, h("circle", { id: "circle", cx: "100", cy: "100", r: "95", "stroke-width": "10", fill: "transparent" }), h("line", { id: "hour", transform: `rotate(${this.hourToDegrees()}, 100, 100)`, x1: "100", y1: "100", x2: "100", y2: "60", "stroke-width": "10", "stroke-linecap": "round" }), h("line", { id: "minute", transform: `rotate(${this.minuteToDegrees()}, 100, 100)`, x1: "100", y1: "100", x2: "100", y2: "30", "stroke-width": "8", "stroke-linecap": "round" }), h("line", { id: "second", transform: `rotate(${this.secondToDegrees()}, 100, 100)`, x1: "100", y1: "100", x2: "100", y2: "20", "stroke-width": "2", "stroke-linecap": "round" })));
|
|
41
37
|
}
|
|
42
38
|
static get is() { return "analog-clock"; }
|
|
43
39
|
static get encapsulation() { return "shadow"; }
|
|
44
|
-
static get originalStyleUrls() {
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
"
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
"original": "number",
|
|
74
|
-
"resolved": "number",
|
|
75
|
-
"references": {}
|
|
76
|
-
},
|
|
77
|
-
"required": false,
|
|
78
|
-
"optional": false,
|
|
79
|
-
"docs": {
|
|
80
|
-
"tags": [],
|
|
81
|
-
"text": ""
|
|
40
|
+
static get originalStyleUrls() {
|
|
41
|
+
return {
|
|
42
|
+
"$": ["analog-clock.css"]
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
static get styleUrls() {
|
|
46
|
+
return {
|
|
47
|
+
"$": ["analog-clock.css"]
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
static get properties() {
|
|
51
|
+
return {
|
|
52
|
+
"size": {
|
|
53
|
+
"type": "number",
|
|
54
|
+
"mutable": false,
|
|
55
|
+
"complexType": {
|
|
56
|
+
"original": "number",
|
|
57
|
+
"resolved": "number",
|
|
58
|
+
"references": {}
|
|
59
|
+
},
|
|
60
|
+
"required": false,
|
|
61
|
+
"optional": false,
|
|
62
|
+
"docs": {
|
|
63
|
+
"tags": [],
|
|
64
|
+
"text": ""
|
|
65
|
+
},
|
|
66
|
+
"attribute": "size",
|
|
67
|
+
"reflect": false,
|
|
68
|
+
"defaultValue": "undefined"
|
|
82
69
|
},
|
|
83
|
-
"
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
70
|
+
"timeZone": {
|
|
71
|
+
"type": "number",
|
|
72
|
+
"mutable": false,
|
|
73
|
+
"complexType": {
|
|
74
|
+
"original": "number",
|
|
75
|
+
"resolved": "number",
|
|
76
|
+
"references": {}
|
|
77
|
+
},
|
|
78
|
+
"required": false,
|
|
79
|
+
"optional": false,
|
|
80
|
+
"docs": {
|
|
81
|
+
"tags": [],
|
|
82
|
+
"text": ""
|
|
83
|
+
},
|
|
84
|
+
"attribute": "time-zone",
|
|
85
|
+
"reflect": false,
|
|
86
|
+
"defaultValue": "0"
|
|
87
|
+
}
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
static get states() {
|
|
91
|
+
return {
|
|
92
|
+
"time": {}
|
|
93
|
+
};
|
|
94
|
+
}
|
|
91
95
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { r as registerInstance, h } from './index-
|
|
1
|
+
import { r as registerInstance, h } from './index-feecb2c4.js';
|
|
2
2
|
|
|
3
3
|
const analogClockCss = ".clock #circle{stroke:var(--clock-circle-color, black)}.clock #hour{stroke:var(--clock-hour-color, black)}.clock #minute{stroke:var(--clock-minute-color, black)}.clock #second{stroke:var(--clock-second-color, black)}";
|
|
4
4
|
|
package/dist/esm/analog-clock.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { p as promiseResolve, b as bootstrapLazy } from './index-
|
|
1
|
+
import { p as promiseResolve, b as bootstrapLazy } from './index-feecb2c4.js';
|
|
2
2
|
|
|
3
3
|
/*
|
|
4
|
-
Stencil Client Patch Browser v2.
|
|
4
|
+
Stencil Client Patch Browser v2.18.0 | MIT Licensed | https://stenciljs.com
|
|
5
5
|
*/
|
|
6
6
|
const patchBrowser = () => {
|
|
7
7
|
const importMeta = import.meta.url;
|
|
@@ -40,7 +40,7 @@ const uniqueTime = (key, measureText) => {
|
|
|
40
40
|
};
|
|
41
41
|
}
|
|
42
42
|
};
|
|
43
|
-
const rootAppliedStyles = new WeakMap();
|
|
43
|
+
const rootAppliedStyles = /*@__PURE__*/ new WeakMap();
|
|
44
44
|
const registerStyle = (scopeId, cssText, allowCS) => {
|
|
45
45
|
let style = styles.get(scopeId);
|
|
46
46
|
if (supportsConstructableStylesheets && allowCS) {
|
|
@@ -62,7 +62,7 @@ const addStyle = (styleContainerNode, cmpMeta, mode, hostElm) => {
|
|
|
62
62
|
const style = styles.get(scopeId);
|
|
63
63
|
// if an element is NOT connected then getRootNode() will return the wrong root node
|
|
64
64
|
// so the fallback is to always use the document for the root node in those cases
|
|
65
|
-
styleContainerNode = styleContainerNode.nodeType === 11 /* DocumentFragment */ ? styleContainerNode : doc;
|
|
65
|
+
styleContainerNode = styleContainerNode.nodeType === 11 /* NODE_TYPE.DocumentFragment */ ? styleContainerNode : doc;
|
|
66
66
|
if (style) {
|
|
67
67
|
if (typeof style === 'string') {
|
|
68
68
|
styleContainerNode = styleContainerNode.head || styleContainerNode;
|
|
@@ -96,7 +96,7 @@ const attachStyles = (hostRef) => {
|
|
|
96
96
|
const flags = cmpMeta.$flags$;
|
|
97
97
|
const endAttachStyles = createTime('attachStyles', cmpMeta.$tagName$);
|
|
98
98
|
const scopeId = addStyle(elm.shadowRoot ? elm.shadowRoot : elm.getRootNode(), cmpMeta);
|
|
99
|
-
if (flags & 10 /* needsScopedEncapsulation */) {
|
|
99
|
+
if (flags & 10 /* CMP_FLAGS.needsScopedEncapsulation */) {
|
|
100
100
|
// only required when we're NOT using native shadow dom (slot)
|
|
101
101
|
// or this browser doesn't support native shadow dom
|
|
102
102
|
// and this host element was NOT created with SSR
|
|
@@ -250,7 +250,7 @@ const setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
|
|
|
250
250
|
}
|
|
251
251
|
}
|
|
252
252
|
}
|
|
253
|
-
else if ((!isProp || flags & 4 /* isHost */ || isSvg) && !isComplex) {
|
|
253
|
+
else if ((!isProp || flags & 4 /* VNODE_FLAGS.isHost */ || isSvg) && !isComplex) {
|
|
254
254
|
newValue = newValue === true ? '' : newValue;
|
|
255
255
|
{
|
|
256
256
|
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
|
{
|
|
@@ -588,8 +728,8 @@ const postUpdateComponent = (hostRef) => {
|
|
|
588
728
|
const endPostUpdate = createTime('postUpdate', tagName);
|
|
589
729
|
const instance = hostRef.$lazyInstance$ ;
|
|
590
730
|
const ancestorComponent = hostRef.$ancestorComponent$;
|
|
591
|
-
if (!(hostRef.$flags$ & 64 /* hasLoadedComponent */)) {
|
|
592
|
-
hostRef.$flags$ |= 64 /* hasLoadedComponent */;
|
|
731
|
+
if (!(hostRef.$flags$ & 64 /* HOST_FLAGS.hasLoadedComponent */)) {
|
|
732
|
+
hostRef.$flags$ |= 64 /* HOST_FLAGS.hasLoadedComponent */;
|
|
593
733
|
{
|
|
594
734
|
// DOM WRITE!
|
|
595
735
|
addHydratedFlag(elm);
|
|
@@ -615,10 +755,10 @@ const postUpdateComponent = (hostRef) => {
|
|
|
615
755
|
hostRef.$onRenderResolve$();
|
|
616
756
|
hostRef.$onRenderResolve$ = undefined;
|
|
617
757
|
}
|
|
618
|
-
if (hostRef.$flags$ & 512 /* needsRerender */) {
|
|
758
|
+
if (hostRef.$flags$ & 512 /* HOST_FLAGS.needsRerender */) {
|
|
619
759
|
nextTick(() => scheduleUpdate(hostRef, false));
|
|
620
760
|
}
|
|
621
|
-
hostRef.$flags$ &= ~(4 /* isWaitingForChildren */ | 512 /* needsRerender */);
|
|
761
|
+
hostRef.$flags$ &= ~(4 /* HOST_FLAGS.isWaitingForChildren */ | 512 /* HOST_FLAGS.needsRerender */);
|
|
622
762
|
}
|
|
623
763
|
// ( •_•)
|
|
624
764
|
// ( •_•)>⌐■-■
|
|
@@ -674,7 +814,7 @@ const addHydratedFlag = (elm) => elm.classList.add('hydrated')
|
|
|
674
814
|
const parsePropertyValue = (propValue, propType) => {
|
|
675
815
|
// ensure this value is of the correct prop type
|
|
676
816
|
if (propValue != null && !isComplexType(propValue)) {
|
|
677
|
-
if (propType & 2 /* Number */) {
|
|
817
|
+
if (propType & 2 /* MEMBER_FLAGS.Number */) {
|
|
678
818
|
// force it to be a number
|
|
679
819
|
return parseFloat(propValue);
|
|
680
820
|
}
|
|
@@ -696,12 +836,12 @@ const setValue = (ref, propName, newVal, cmpMeta) => {
|
|
|
696
836
|
// explicitly check for NaN on both sides, as `NaN === NaN` is always false
|
|
697
837
|
const areBothNaN = Number.isNaN(oldVal) && Number.isNaN(newVal);
|
|
698
838
|
const didValueChange = newVal !== oldVal && !areBothNaN;
|
|
699
|
-
if ((!(flags & 8 /* isConstructingInstance */) || oldVal === undefined) && didValueChange) {
|
|
839
|
+
if ((!(flags & 8 /* HOST_FLAGS.isConstructingInstance */) || oldVal === undefined) && didValueChange) {
|
|
700
840
|
// gadzooks! the property's value has changed!!
|
|
701
841
|
// set our new value!
|
|
702
842
|
hostRef.$instanceValues$.set(propName, newVal);
|
|
703
843
|
if (instance) {
|
|
704
|
-
if ((flags & (2 /* hasRendered */ | 16 /* isQueuedForUpdate */)) === 2 /* hasRendered */) {
|
|
844
|
+
if ((flags & (2 /* HOST_FLAGS.hasRendered */ | 16 /* HOST_FLAGS.isQueuedForUpdate */)) === 2 /* HOST_FLAGS.hasRendered */) {
|
|
705
845
|
// looks like this value actually changed, so we've got work to do!
|
|
706
846
|
// but only if we've already rendered, otherwise just chill out
|
|
707
847
|
// queue that we need to do an update, but don't worry about queuing
|
|
@@ -717,8 +857,8 @@ const proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
|
717
857
|
const members = Object.entries(cmpMeta.$members$);
|
|
718
858
|
const prototype = Cstr.prototype;
|
|
719
859
|
members.map(([memberName, [memberFlags]]) => {
|
|
720
|
-
if ((memberFlags & 31 /* Prop */ ||
|
|
721
|
-
((flags & 2 /* proxyState */) && memberFlags & 32 /* State */))) {
|
|
860
|
+
if ((memberFlags & 31 /* MEMBER_FLAGS.Prop */ ||
|
|
861
|
+
((flags & 2 /* PROXY_FLAGS.proxyState */) && memberFlags & 32 /* MEMBER_FLAGS.State */))) {
|
|
722
862
|
// proxyComponent - prop
|
|
723
863
|
Object.defineProperty(prototype, memberName, {
|
|
724
864
|
get() {
|
|
@@ -734,7 +874,7 @@ const proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
|
734
874
|
});
|
|
735
875
|
}
|
|
736
876
|
});
|
|
737
|
-
if ((flags & 1 /* isElementConstructor */)) {
|
|
877
|
+
if ((flags & 1 /* PROXY_FLAGS.isElementConstructor */)) {
|
|
738
878
|
const attrNameToPropName = new Map();
|
|
739
879
|
prototype.attributeChangedCallback = function (attrName, _oldValue, newValue) {
|
|
740
880
|
plt.jmp(() => {
|
|
@@ -790,7 +930,7 @@ const proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
|
790
930
|
// create an array of attributes to observe
|
|
791
931
|
// and also create a map of html attribute name to js property name
|
|
792
932
|
Cstr.observedAttributes = members
|
|
793
|
-
.filter(([_, m]) => m[0] & 15 /* HasAttribute */) // filter to only keep props that should match attributes
|
|
933
|
+
.filter(([_, m]) => m[0] & 15 /* MEMBER_FLAGS.HasAttribute */) // filter to only keep props that should match attributes
|
|
794
934
|
.map(([propName, m]) => {
|
|
795
935
|
const attrName = m[1] || propName;
|
|
796
936
|
attrNameToPropName.set(attrName, propName);
|
|
@@ -802,10 +942,10 @@ const proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
|
802
942
|
};
|
|
803
943
|
const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId, Cstr) => {
|
|
804
944
|
// initializeComponent
|
|
805
|
-
if ((hostRef.$flags$ & 32 /* hasInitializedComponent */) === 0) {
|
|
945
|
+
if ((hostRef.$flags$ & 32 /* HOST_FLAGS.hasInitializedComponent */) === 0) {
|
|
806
946
|
{
|
|
807
947
|
// we haven't initialized this element yet
|
|
808
|
-
hostRef.$flags$ |= 32 /* hasInitializedComponent */;
|
|
948
|
+
hostRef.$flags$ |= 32 /* HOST_FLAGS.hasInitializedComponent */;
|
|
809
949
|
// lazy loaded components
|
|
810
950
|
// request the component's implementation to be
|
|
811
951
|
// wired up with the host element
|
|
@@ -817,7 +957,7 @@ const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId, Cstr) =>
|
|
|
817
957
|
endLoad();
|
|
818
958
|
}
|
|
819
959
|
if (!Cstr.isProxied) {
|
|
820
|
-
proxyComponent(Cstr, cmpMeta, 2 /* proxyState */);
|
|
960
|
+
proxyComponent(Cstr, cmpMeta, 2 /* PROXY_FLAGS.proxyState */);
|
|
821
961
|
Cstr.isProxied = true;
|
|
822
962
|
}
|
|
823
963
|
const endNewInstance = createTime('createInstance', cmpMeta.$tagName$);
|
|
@@ -825,7 +965,7 @@ const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId, Cstr) =>
|
|
|
825
965
|
// but let's keep track of when we start and stop
|
|
826
966
|
// so that the getters/setters don't incorrectly step on data
|
|
827
967
|
{
|
|
828
|
-
hostRef.$flags$ |= 8 /* isConstructingInstance */;
|
|
968
|
+
hostRef.$flags$ |= 8 /* HOST_FLAGS.isConstructingInstance */;
|
|
829
969
|
}
|
|
830
970
|
// construct the lazy-loaded component implementation
|
|
831
971
|
// passing the hostRef is very important during
|
|
@@ -838,7 +978,7 @@ const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId, Cstr) =>
|
|
|
838
978
|
consoleError(e);
|
|
839
979
|
}
|
|
840
980
|
{
|
|
841
|
-
hostRef.$flags$ &= ~8 /* isConstructingInstance */;
|
|
981
|
+
hostRef.$flags$ &= ~8 /* HOST_FLAGS.isConstructingInstance */;
|
|
842
982
|
}
|
|
843
983
|
endNewInstance();
|
|
844
984
|
}
|
|
@@ -848,7 +988,7 @@ const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId, Cstr) =>
|
|
|
848
988
|
const scopeId = getScopeId(cmpMeta);
|
|
849
989
|
if (!styles.has(scopeId)) {
|
|
850
990
|
const endRegisterStyles = createTime('registerStyles', cmpMeta.$tagName$);
|
|
851
|
-
registerStyle(scopeId, style, !!(cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */));
|
|
991
|
+
registerStyle(scopeId, style, !!(cmpMeta.$flags$ & 1 /* CMP_FLAGS.shadowDomEncapsulation */));
|
|
852
992
|
endRegisterStyles();
|
|
853
993
|
}
|
|
854
994
|
}
|
|
@@ -870,13 +1010,13 @@ const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId, Cstr) =>
|
|
|
870
1010
|
}
|
|
871
1011
|
};
|
|
872
1012
|
const connectedCallback = (elm) => {
|
|
873
|
-
if ((plt.$flags$ & 1 /* isTmpDisconnected */) === 0) {
|
|
1013
|
+
if ((plt.$flags$ & 1 /* PLATFORM_FLAGS.isTmpDisconnected */) === 0) {
|
|
874
1014
|
const hostRef = getHostRef(elm);
|
|
875
1015
|
const cmpMeta = hostRef.$cmpMeta$;
|
|
876
1016
|
const endConnected = createTime('connectedCallback', cmpMeta.$tagName$);
|
|
877
|
-
if (!(hostRef.$flags$ & 1 /* hasConnected */)) {
|
|
1017
|
+
if (!(hostRef.$flags$ & 1 /* HOST_FLAGS.hasConnected */)) {
|
|
878
1018
|
// first time this component has connected
|
|
879
|
-
hostRef.$flags$ |= 1 /* hasConnected */;
|
|
1019
|
+
hostRef.$flags$ |= 1 /* HOST_FLAGS.hasConnected */;
|
|
880
1020
|
{
|
|
881
1021
|
// find the first ancestor component (if there is one) and register
|
|
882
1022
|
// this component as one of the actively loading child components for its ancestor
|
|
@@ -896,7 +1036,7 @@ const connectedCallback = (elm) => {
|
|
|
896
1036
|
// https://developers.google.com/web/fundamentals/web-components/best-practices#lazy-properties
|
|
897
1037
|
if (cmpMeta.$members$) {
|
|
898
1038
|
Object.entries(cmpMeta.$members$).map(([memberName, [memberFlags]]) => {
|
|
899
|
-
if (memberFlags & 31 /* Prop */ && elm.hasOwnProperty(memberName)) {
|
|
1039
|
+
if (memberFlags & 31 /* MEMBER_FLAGS.Prop */ && elm.hasOwnProperty(memberName)) {
|
|
900
1040
|
const value = elm[memberName];
|
|
901
1041
|
delete elm[memberName];
|
|
902
1042
|
elm[memberName] = value;
|
|
@@ -911,7 +1051,7 @@ const connectedCallback = (elm) => {
|
|
|
911
1051
|
}
|
|
912
1052
|
};
|
|
913
1053
|
const disconnectedCallback = (elm) => {
|
|
914
|
-
if ((plt.$flags$ & 1 /* isTmpDisconnected */) === 0) {
|
|
1054
|
+
if ((plt.$flags$ & 1 /* PLATFORM_FLAGS.isTmpDisconnected */) === 0) {
|
|
915
1055
|
const hostRef = getHostRef(elm);
|
|
916
1056
|
const instance = hostRef.$lazyInstance$ ;
|
|
917
1057
|
{
|
|
@@ -951,7 +1091,7 @@ const bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
951
1091
|
super(self);
|
|
952
1092
|
self = this;
|
|
953
1093
|
registerHost(self, cmpMeta);
|
|
954
|
-
if (cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) {
|
|
1094
|
+
if (cmpMeta.$flags$ & 1 /* CMP_FLAGS.shadowDomEncapsulation */) {
|
|
955
1095
|
// this component is using shadow dom
|
|
956
1096
|
// and this browser supports shadow dom
|
|
957
1097
|
// add the read-only property "shadowRoot" to the host element
|
|
@@ -986,7 +1126,7 @@ const bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
986
1126
|
cmpMeta.$lazyBundleId$ = lazyBundle[0];
|
|
987
1127
|
if (!exclude.includes(tagName) && !customElements.get(tagName)) {
|
|
988
1128
|
cmpTags.push(tagName);
|
|
989
|
-
customElements.define(tagName, proxyComponent(HostElement, cmpMeta, 1 /* isElementConstructor */));
|
|
1129
|
+
customElements.define(tagName, proxyComponent(HostElement, cmpMeta, 1 /* PROXY_FLAGS.isElementConstructor */));
|
|
990
1130
|
}
|
|
991
1131
|
});
|
|
992
1132
|
});
|
|
@@ -1008,7 +1148,7 @@ const bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
1008
1148
|
// Fallback appLoad event
|
|
1009
1149
|
endBootstrap();
|
|
1010
1150
|
};
|
|
1011
|
-
const hostRefs = new WeakMap();
|
|
1151
|
+
const hostRefs = /*@__PURE__*/ new WeakMap();
|
|
1012
1152
|
const getHostRef = (ref) => hostRefs.get(ref);
|
|
1013
1153
|
const registerInstance = (lazyInstance, hostRef) => hostRefs.set((hostRef.$lazyInstance$ = lazyInstance), hostRef);
|
|
1014
1154
|
const registerHost = (elm, cmpMeta) => {
|
|
@@ -1049,14 +1189,14 @@ const loadModule = (cmpMeta, hostRef, hmrVersionId) => {
|
|
|
1049
1189
|
return importedModule[exportName];
|
|
1050
1190
|
}, consoleError);
|
|
1051
1191
|
};
|
|
1052
|
-
const styles = new Map();
|
|
1192
|
+
const styles = /*@__PURE__*/ new Map();
|
|
1053
1193
|
const queueDomReads = [];
|
|
1054
1194
|
const queueDomWrites = [];
|
|
1055
1195
|
const queueTask = (queue, write) => (cb) => {
|
|
1056
1196
|
queue.push(cb);
|
|
1057
1197
|
if (!queuePending) {
|
|
1058
1198
|
queuePending = true;
|
|
1059
|
-
if (write && plt.$flags$ & 4 /* queueSync */) {
|
|
1199
|
+
if (write && plt.$flags$ & 4 /* PLATFORM_FLAGS.queueSync */) {
|
|
1060
1200
|
nextTick(flush);
|
|
1061
1201
|
}
|
|
1062
1202
|
else {
|
package/dist/esm/loader.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { p as promiseResolve, b as bootstrapLazy } from './index-
|
|
1
|
+
import { p as promiseResolve, b as bootstrapLazy } from './index-feecb2c4.js';
|
|
2
2
|
|
|
3
3
|
/*
|
|
4
|
-
Stencil Client Patch Esm v2.
|
|
4
|
+
Stencil Client Patch Esm v2.18.0 | MIT Licensed | https://stenciljs.com
|
|
5
5
|
*/
|
|
6
6
|
const patchEsm = () => {
|
|
7
7
|
return promiseResolve();
|
package/loader/package.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "analog-clock-components",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.303",
|
|
4
4
|
"description": "Stencil Component Starter",
|
|
5
5
|
"main": "dist/index.cjs.js",
|
|
6
6
|
"module": "dist/index.js",
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"format": "prettier --write src"
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@stencil/core": "2.
|
|
30
|
+
"@stencil/core": "2.18.0"
|
|
31
31
|
},
|
|
32
32
|
"license": "MIT",
|
|
33
33
|
"devDependencies": {
|