@stencil/core 5.0.0-beta.13 → 5.0.0-beta.15

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.
@@ -7,11 +7,80 @@ const BUILD = {
7
7
  lazyLoad: true
8
8
  };
9
9
  //#endregion
10
+ //#region src/runtime/runtime-constants.ts
11
+ /**
12
+ * Bit flags for recording various properties of VDom nodes
13
+ */
14
+ const VNODE_FLAGS = {
15
+ /**
16
+ * Whether or not a vdom node is a slot reference
17
+ */
18
+ isSlotReference: 1,
19
+ /**
20
+ * Whether or not a slot element has fallback content
21
+ */
22
+ isSlotFallback: 2,
23
+ /**
24
+ * Whether or not an element is a host element
25
+ */
26
+ isHost: 4
27
+ };
28
+ const PROXY_FLAGS = {
29
+ isElementConstructor: 1,
30
+ proxyState: 2
31
+ };
32
+ const PLATFORM_FLAGS = {
33
+ /**
34
+ * designates a node in the DOM as being actively moved by the runtime
35
+ */
36
+ isTmpDisconnected: 1,
37
+ appLoaded: 2,
38
+ queueSync: 4,
39
+ queueMask: 6
40
+ };
41
+ /**
42
+ * A (subset) of node types which are relevant for the Stencil runtime. These
43
+ * values are based on the values which can possibly be returned by the
44
+ * `.nodeType` property of a DOM node. See here for details:
45
+ *
46
+ * {@link https://dom.spec.whatwg.org/#ref-for-dom-node-nodetype%E2%91%A0}
47
+ */
48
+ const NODE_TYPE = {
49
+ ElementNode: 1,
50
+ TextNode: 3,
51
+ CommentNode: 8,
52
+ DocumentNode: 9,
53
+ DocumentTypeNode: 10,
54
+ DocumentFragment: 11
55
+ };
56
+ const HYDRATE_ID = "s-id";
57
+ const HYDRATED_STYLE_ID = "sty-id";
58
+ const HYDRATE_CHILD_ID = "c-id";
59
+ const HYDRATED_CSS = "{visibility:hidden}.hydrated{visibility:inherit}";
60
+ /**
61
+ * Constant for styles to be globally applied to `slot-fb` elements for pseudo-slot behavior.
62
+ *
63
+ * Two cascading rules must be used instead of a `:not()` selector due to Stencil browser
64
+ * support as of Stencil v4.
65
+ */
66
+ const SLOT_FB_CSS = "slot-fb{display:contents}slot-fb[hidden]{display:none}";
67
+ const XLINK_NS = "http://www.w3.org/1999/xlink";
68
+ /**
69
+ * Minimum delay, in milliseconds, before retrying a failed lazy component load.
70
+ */
71
+ const LAZY_LOAD_RETRY_INTERVAL_MS = 1e3;
72
+ const FORM_ASSOCIATED_CUSTOM_ELEMENT_CALLBACKS = [
73
+ "formAssociatedCallback",
74
+ "formResetCallback",
75
+ "formDisabledCallback",
76
+ "formStateRestoreCallback"
77
+ ];
78
+ //#endregion
10
79
  //#region src/client/client-build.ts
11
80
  const Build = {
12
- isDev: BUILD.isDev,
13
81
  isBrowser: true,
14
82
  isServer: false,
83
+ isDev: BUILD.isDev,
15
84
  isTesting: BUILD.isTesting
16
85
  };
17
86
  //#endregion
@@ -498,75 +567,6 @@ const modeResolver = [];
498
567
  const setScopedSSR = (_opts) => {};
499
568
  const needsScopedSSR = () => false;
500
569
  //#endregion
501
- //#region src/runtime/runtime-constants.ts
502
- /**
503
- * Bit flags for recording various properties of VDom nodes
504
- */
505
- const VNODE_FLAGS = {
506
- /**
507
- * Whether or not a vdom node is a slot reference
508
- */
509
- isSlotReference: 1,
510
- /**
511
- * Whether or not a slot element has fallback content
512
- */
513
- isSlotFallback: 2,
514
- /**
515
- * Whether or not an element is a host element
516
- */
517
- isHost: 4
518
- };
519
- const PROXY_FLAGS = {
520
- isElementConstructor: 1,
521
- proxyState: 2
522
- };
523
- const PLATFORM_FLAGS = {
524
- /**
525
- * designates a node in the DOM as being actively moved by the runtime
526
- */
527
- isTmpDisconnected: 1,
528
- appLoaded: 2,
529
- queueSync: 4,
530
- queueMask: 6
531
- };
532
- /**
533
- * A (subset) of node types which are relevant for the Stencil runtime. These
534
- * values are based on the values which can possibly be returned by the
535
- * `.nodeType` property of a DOM node. See here for details:
536
- *
537
- * {@link https://dom.spec.whatwg.org/#ref-for-dom-node-nodetype%E2%91%A0}
538
- */
539
- const NODE_TYPE = {
540
- ElementNode: 1,
541
- TextNode: 3,
542
- CommentNode: 8,
543
- DocumentNode: 9,
544
- DocumentTypeNode: 10,
545
- DocumentFragment: 11
546
- };
547
- const HYDRATE_ID = "s-id";
548
- const HYDRATED_STYLE_ID = "sty-id";
549
- const HYDRATE_CHILD_ID = "c-id";
550
- const HYDRATED_CSS = "{visibility:hidden}.hydrated{visibility:inherit}";
551
- /**
552
- * Constant for styles to be globally applied to `slot-fb` elements for pseudo-slot behavior.
553
- *
554
- * Two cascading rules must be used instead of a `:not()` selector due to Stencil browser
555
- * support as of Stencil v4.
556
- */
557
- const SLOT_FB_CSS = "slot-fb{display:contents}slot-fb[hidden]{display:none}";
558
- const XLINK_NS = "http://www.w3.org/1999/xlink";
559
- /**
560
- * Minimum delay, in milliseconds, before retrying a failed lazy component load.
561
- */
562
- const LAZY_LOAD_RETRY_INTERVAL_MS = 1e3;
563
- const FORM_ASSOCIATED_CUSTOM_ELEMENT_CALLBACKS = [
564
- "formAssociatedCallback",
565
- "formResetCallback",
566
- "formDisabledCallback",
567
- "formStateRestoreCallback"
568
- ];
569
- //#endregion
570
570
  //#region src/client/client-window.ts
571
571
  const win = typeof window !== "undefined" ? window : {};
572
572
  const H = win.HTMLElement || class {};
@@ -607,7 +607,7 @@ let queuePending = false;
607
607
  const queueDomReads = [];
608
608
  const queueDomWrites = [];
609
609
  const queueDomWritesLow = [];
610
- const scheduleFlush = () => win.document?.hidden ? nextTick(flush) : plt.raf(flush);
610
+ const scheduleFlush = () => win.document?.hidden ? setTimeout(flush, 16) : plt.raf(flush);
611
611
  const queueTask = (queue, write) => (cb) => {
612
612
  queue.push(cb);
613
613
  if (!queuePending) {
@@ -3237,9 +3237,7 @@ const h = (nodeName, vnodeData, ...children) => {
3237
3237
  if (classData && !(BUILD.vdomSignals && isSignalLike(classData))) vnodeData.class = typeof classData !== "object" ? classData : Object.keys(classData).filter((k) => classData[k]).join(" ");
3238
3238
  }
3239
3239
  }
3240
- if (BUILD.isDev && vNodeChildren.some(isHost)) consoleDevError(`The <Host> must be the single root component. Make sure:
3241
- - You are NOT using hostData() and <Host> in the same component.
3242
- - <Host> is used once, and it's the single root component of the render() function.`);
3240
+ if (BUILD.isDev && vNodeChildren.some(isHost)) consoleDevError(`The <Host> must be used once, and be the single root component of the render() function.`);
3243
3241
  if (BUILD.vdomFunctional && typeof nodeName === "function") return nodeName(vnodeData === null ? {} : vnodeData, vNodeChildren, vdomFnUtils);
3244
3242
  const vnode = newVNode(nodeName, null);
3245
3243
  vnode.$attrs$ = vnodeData;
@@ -4015,7 +4013,7 @@ const scopeSelector = (selector, scopeSelectorText, hostSelector, slotSelector)
4015
4013
  else return shallowPart.trim();
4016
4014
  }).join(", ");
4017
4015
  };
4018
- const isScopableAtRule = (selector) => selector.startsWith("@media") || selector.startsWith("@supports") || selector.startsWith("@page") || selector.startsWith("@document") || selector.startsWith("@layer");
4016
+ const isScopableAtRule = (selector) => selector.startsWith("@media") || selector.startsWith("@supports") || selector.startsWith("@page") || selector.startsWith("@document") || selector.startsWith("@layer") || selector.startsWith("@container");
4019
4017
  const scopeSelectors = (cssText, scopeSelectorText, hostSelector, slotSelector, commentOriginalSelector) => {
4020
4018
  return processRules(cssText, (rule) => {
4021
4019
  let selector = rule.selector;
@@ -4650,9 +4648,16 @@ const connectedCallback = (elm) => {
4650
4648
  }
4651
4649
  if (BUILD.asyncLoading) {
4652
4650
  let ancestorComponent = elm;
4653
- while (ancestorComponent = ancestorComponent.parentNode || ancestorComponent.host) if (BUILD.hydrateClientSide && ancestorComponent.nodeType === NODE_TYPE.ElementNode && ancestorComponent.hasAttribute("s-id") && ancestorComponent["s-p"] || ancestorComponent["s-p"]) {
4654
- attachToAncestor(hostRef, hostRef.$ancestorComponent$ = ancestorComponent);
4655
- break;
4651
+ while (ancestorComponent = ancestorComponent.parentNode || ancestorComponent.host) {
4652
+ if (BUILD.hydrateClientSide && !ancestorComponent["s-p"] && ancestorComponent.nodeType === NODE_TYPE.ElementNode && ancestorComponent.hasAttribute("s-id")) {
4653
+ ancestorComponent["s-p"] = [];
4654
+ ancestorComponent["s-rc"] = [];
4655
+ ancestorComponent["s-pc"] = [];
4656
+ }
4657
+ if (ancestorComponent["s-p"]) {
4658
+ attachToAncestor(hostRef, hostRef.$ancestorComponent$ = ancestorComponent);
4659
+ break;
4660
+ }
4656
4661
  }
4657
4662
  }
4658
4663
  if (BUILD.prop && !BUILD.hydrateServerSide && cmpMeta.$members$) Object.entries(cmpMeta.$members$).map(([memberName, [memberFlags]]) => {
@@ -1491,7 +1491,7 @@ interface SerializeDocumentOptions extends SsrDocumentOptions {
1491
1491
  * Note that this is "approximate", in that HTML may often not be able
1492
1492
  * to be split at an exact line width. Additionally, new lines created
1493
1493
  * is where HTML naturally already has whitespace, such as before an
1494
- * attribute or spaces between words. Defaults to `100`.
1494
+ * attribute or spaces between words. Defaults to no wrapping (`100` when prerendering).
1495
1495
  */
1496
1496
  approximateLineWidth?: number;
1497
1497
  /**
@@ -1509,12 +1509,12 @@ interface SerializeDocumentOptions extends SsrDocumentOptions {
1509
1509
  prettyHtml?: boolean;
1510
1510
  /**
1511
1511
  * Remove quotes from attribute values when possible.
1512
- * Defaults to `true`.
1512
+ * Defaults to `false` (`true` when prerendering).
1513
1513
  */
1514
1514
  removeAttributeQuotes?: boolean;
1515
1515
  /**
1516
1516
  * Remove the `=""` from standardized `boolean` attributes,
1517
- * such as `hidden` or `checked`. Defaults to `true`.
1517
+ * such as `hidden` or `checked`. Defaults to `false` (`true` when prerendering).
1518
1518
  */
1519
1519
  removeBooleanAttributeQuotes?: boolean;
1520
1520
  /**
@@ -1523,7 +1523,7 @@ interface SerializeDocumentOptions extends SsrDocumentOptions {
1523
1523
  */
1524
1524
  removeEmptyAttributes?: boolean;
1525
1525
  /**
1526
- * Remove HTML comments. Defaults to `true`.
1526
+ * Remove HTML comments. Defaults to `false` (`true` when prerendering).
1527
1527
  */
1528
1528
  removeHtmlComments?: boolean;
1529
1529
  /**
@@ -1,11 +1,80 @@
1
1
  import { BUILD, BUILD as BUILD$1, Env, NAMESPACE, NAMESPACE as NAMESPACE$1 } from "@stencil/core/app-data";
2
2
  import { globalStyles } from "@stencil/core/app-globals";
3
3
  import * as SignalsCore from "@preact/signals-core";
4
+ //#region src/runtime/runtime-constants.ts
5
+ /**
6
+ * Bit flags for recording various properties of VDom nodes
7
+ */
8
+ const VNODE_FLAGS = {
9
+ /**
10
+ * Whether or not a vdom node is a slot reference
11
+ */
12
+ isSlotReference: 1,
13
+ /**
14
+ * Whether or not a slot element has fallback content
15
+ */
16
+ isSlotFallback: 2,
17
+ /**
18
+ * Whether or not an element is a host element
19
+ */
20
+ isHost: 4
21
+ };
22
+ const PROXY_FLAGS = {
23
+ isElementConstructor: 1,
24
+ proxyState: 2
25
+ };
26
+ const PLATFORM_FLAGS = {
27
+ /**
28
+ * designates a node in the DOM as being actively moved by the runtime
29
+ */
30
+ isTmpDisconnected: 1,
31
+ appLoaded: 2,
32
+ queueSync: 4,
33
+ queueMask: 6
34
+ };
35
+ /**
36
+ * A (subset) of node types which are relevant for the Stencil runtime. These
37
+ * values are based on the values which can possibly be returned by the
38
+ * `.nodeType` property of a DOM node. See here for details:
39
+ *
40
+ * {@link https://dom.spec.whatwg.org/#ref-for-dom-node-nodetype%E2%91%A0}
41
+ */
42
+ const NODE_TYPE = {
43
+ ElementNode: 1,
44
+ TextNode: 3,
45
+ CommentNode: 8,
46
+ DocumentNode: 9,
47
+ DocumentTypeNode: 10,
48
+ DocumentFragment: 11
49
+ };
50
+ const HYDRATE_ID = "s-id";
51
+ const HYDRATED_STYLE_ID = "sty-id";
52
+ const HYDRATE_CHILD_ID = "c-id";
53
+ const HYDRATED_CSS = "{visibility:hidden}.hydrated{visibility:inherit}";
54
+ /**
55
+ * Constant for styles to be globally applied to `slot-fb` elements for pseudo-slot behavior.
56
+ *
57
+ * Two cascading rules must be used instead of a `:not()` selector due to Stencil browser
58
+ * support as of Stencil v4.
59
+ */
60
+ const SLOT_FB_CSS = "slot-fb{display:contents}slot-fb[hidden]{display:none}";
61
+ const XLINK_NS = "http://www.w3.org/1999/xlink";
62
+ /**
63
+ * Minimum delay, in milliseconds, before retrying a failed lazy component load.
64
+ */
65
+ const LAZY_LOAD_RETRY_INTERVAL_MS = 1e3;
66
+ const FORM_ASSOCIATED_CUSTOM_ELEMENT_CALLBACKS = [
67
+ "formAssociatedCallback",
68
+ "formResetCallback",
69
+ "formDisabledCallback",
70
+ "formStateRestoreCallback"
71
+ ];
72
+ //#endregion
4
73
  //#region src/client/client-build.ts
5
74
  const Build = {
6
- isDev: BUILD$1.isDev,
7
75
  isBrowser: true,
8
76
  isServer: false,
77
+ isDev: BUILD$1.isDev,
9
78
  isTesting: BUILD$1.isTesting
10
79
  };
11
80
  //#endregion
@@ -492,75 +561,6 @@ const modeResolver = [];
492
561
  const setScopedSSR = (_opts) => {};
493
562
  const needsScopedSSR = () => false;
494
563
  //#endregion
495
- //#region src/runtime/runtime-constants.ts
496
- /**
497
- * Bit flags for recording various properties of VDom nodes
498
- */
499
- const VNODE_FLAGS = {
500
- /**
501
- * Whether or not a vdom node is a slot reference
502
- */
503
- isSlotReference: 1,
504
- /**
505
- * Whether or not a slot element has fallback content
506
- */
507
- isSlotFallback: 2,
508
- /**
509
- * Whether or not an element is a host element
510
- */
511
- isHost: 4
512
- };
513
- const PROXY_FLAGS = {
514
- isElementConstructor: 1,
515
- proxyState: 2
516
- };
517
- const PLATFORM_FLAGS = {
518
- /**
519
- * designates a node in the DOM as being actively moved by the runtime
520
- */
521
- isTmpDisconnected: 1,
522
- appLoaded: 2,
523
- queueSync: 4,
524
- queueMask: 6
525
- };
526
- /**
527
- * A (subset) of node types which are relevant for the Stencil runtime. These
528
- * values are based on the values which can possibly be returned by the
529
- * `.nodeType` property of a DOM node. See here for details:
530
- *
531
- * {@link https://dom.spec.whatwg.org/#ref-for-dom-node-nodetype%E2%91%A0}
532
- */
533
- const NODE_TYPE = {
534
- ElementNode: 1,
535
- TextNode: 3,
536
- CommentNode: 8,
537
- DocumentNode: 9,
538
- DocumentTypeNode: 10,
539
- DocumentFragment: 11
540
- };
541
- const HYDRATE_ID = "s-id";
542
- const HYDRATED_STYLE_ID = "sty-id";
543
- const HYDRATE_CHILD_ID = "c-id";
544
- const HYDRATED_CSS = "{visibility:hidden}.hydrated{visibility:inherit}";
545
- /**
546
- * Constant for styles to be globally applied to `slot-fb` elements for pseudo-slot behavior.
547
- *
548
- * Two cascading rules must be used instead of a `:not()` selector due to Stencil browser
549
- * support as of Stencil v4.
550
- */
551
- const SLOT_FB_CSS = "slot-fb{display:contents}slot-fb[hidden]{display:none}";
552
- const XLINK_NS = "http://www.w3.org/1999/xlink";
553
- /**
554
- * Minimum delay, in milliseconds, before retrying a failed lazy component load.
555
- */
556
- const LAZY_LOAD_RETRY_INTERVAL_MS = 1e3;
557
- const FORM_ASSOCIATED_CUSTOM_ELEMENT_CALLBACKS = [
558
- "formAssociatedCallback",
559
- "formResetCallback",
560
- "formDisabledCallback",
561
- "formStateRestoreCallback"
562
- ];
563
- //#endregion
564
564
  //#region src/client/client-window.ts
565
565
  const win = typeof window !== "undefined" ? window : {};
566
566
  const H = win.HTMLElement || class {};
@@ -601,7 +601,7 @@ let queuePending = false;
601
601
  const queueDomReads = [];
602
602
  const queueDomWrites = [];
603
603
  const queueDomWritesLow = [];
604
- const scheduleFlush = () => win.document?.hidden ? nextTick(flush) : plt.raf(flush);
604
+ const scheduleFlush = () => win.document?.hidden ? setTimeout(flush, 16) : plt.raf(flush);
605
605
  const queueTask = (queue, write) => (cb) => {
606
606
  queue.push(cb);
607
607
  if (!queuePending) {
@@ -3231,9 +3231,7 @@ const h = (nodeName, vnodeData, ...children) => {
3231
3231
  if (classData && !(BUILD$1.vdomSignals && isSignalLike(classData))) vnodeData.class = typeof classData !== "object" ? classData : Object.keys(classData).filter((k) => classData[k]).join(" ");
3232
3232
  }
3233
3233
  }
3234
- if (BUILD$1.isDev && vNodeChildren.some(isHost)) consoleDevError(`The <Host> must be the single root component. Make sure:
3235
- - You are NOT using hostData() and <Host> in the same component.
3236
- - <Host> is used once, and it's the single root component of the render() function.`);
3234
+ if (BUILD$1.isDev && vNodeChildren.some(isHost)) consoleDevError(`The <Host> must be used once, and be the single root component of the render() function.`);
3237
3235
  if (BUILD$1.vdomFunctional && typeof nodeName === "function") return nodeName(vnodeData === null ? {} : vnodeData, vNodeChildren, vdomFnUtils);
3238
3236
  const vnode = newVNode(nodeName, null);
3239
3237
  vnode.$attrs$ = vnodeData;
@@ -4009,7 +4007,7 @@ const scopeSelector = (selector, scopeSelectorText, hostSelector, slotSelector)
4009
4007
  else return shallowPart.trim();
4010
4008
  }).join(", ");
4011
4009
  };
4012
- const isScopableAtRule = (selector) => selector.startsWith("@media") || selector.startsWith("@supports") || selector.startsWith("@page") || selector.startsWith("@document") || selector.startsWith("@layer");
4010
+ const isScopableAtRule = (selector) => selector.startsWith("@media") || selector.startsWith("@supports") || selector.startsWith("@page") || selector.startsWith("@document") || selector.startsWith("@layer") || selector.startsWith("@container");
4013
4011
  const scopeSelectors = (cssText, scopeSelectorText, hostSelector, slotSelector, commentOriginalSelector) => {
4014
4012
  return processRules(cssText, (rule) => {
4015
4013
  let selector = rule.selector;
@@ -4644,9 +4642,16 @@ const connectedCallback = (elm) => {
4644
4642
  }
4645
4643
  if (BUILD$1.asyncLoading) {
4646
4644
  let ancestorComponent = elm;
4647
- while (ancestorComponent = ancestorComponent.parentNode || ancestorComponent.host) if (BUILD$1.hydrateClientSide && ancestorComponent.nodeType === NODE_TYPE.ElementNode && ancestorComponent.hasAttribute("s-id") && ancestorComponent["s-p"] || ancestorComponent["s-p"]) {
4648
- attachToAncestor(hostRef, hostRef.$ancestorComponent$ = ancestorComponent);
4649
- break;
4645
+ while (ancestorComponent = ancestorComponent.parentNode || ancestorComponent.host) {
4646
+ if (BUILD$1.hydrateClientSide && !ancestorComponent["s-p"] && ancestorComponent.nodeType === NODE_TYPE.ElementNode && ancestorComponent.hasAttribute("s-id")) {
4647
+ ancestorComponent["s-p"] = [];
4648
+ ancestorComponent["s-rc"] = [];
4649
+ ancestorComponent["s-pc"] = [];
4650
+ }
4651
+ if (ancestorComponent["s-p"]) {
4652
+ attachToAncestor(hostRef, hostRef.$ancestorComponent$ = ancestorComponent);
4653
+ break;
4654
+ }
4650
4655
  }
4651
4656
  }
4652
4657
  if (BUILD$1.prop && !BUILD$1.hydrateServerSide && cmpMeta.$members$) Object.entries(cmpMeta.$members$).map(([memberName, [memberFlags]]) => {
@@ -1,11 +1,80 @@
1
1
  import { BUILD } from "../app-data/index.js";
2
2
  import "../app-globals/index.js";
3
3
  import * as SignalsCore from "@preact/signals-core";
4
+ //#region src/runtime/runtime-constants.ts
5
+ /**
6
+ * Bit flags for recording various properties of VDom nodes
7
+ */
8
+ const VNODE_FLAGS = {
9
+ /**
10
+ * Whether or not a vdom node is a slot reference
11
+ */
12
+ isSlotReference: 1,
13
+ /**
14
+ * Whether or not a slot element has fallback content
15
+ */
16
+ isSlotFallback: 2,
17
+ /**
18
+ * Whether or not an element is a host element
19
+ */
20
+ isHost: 4
21
+ };
22
+ const PROXY_FLAGS = {
23
+ isElementConstructor: 1,
24
+ proxyState: 2
25
+ };
26
+ const PLATFORM_FLAGS = {
27
+ /**
28
+ * designates a node in the DOM as being actively moved by the runtime
29
+ */
30
+ isTmpDisconnected: 1,
31
+ appLoaded: 2,
32
+ queueSync: 4,
33
+ queueMask: 6
34
+ };
35
+ /**
36
+ * A (subset) of node types which are relevant for the Stencil runtime. These
37
+ * values are based on the values which can possibly be returned by the
38
+ * `.nodeType` property of a DOM node. See here for details:
39
+ *
40
+ * {@link https://dom.spec.whatwg.org/#ref-for-dom-node-nodetype%E2%91%A0}
41
+ */
42
+ const NODE_TYPE = {
43
+ ElementNode: 1,
44
+ TextNode: 3,
45
+ CommentNode: 8,
46
+ DocumentNode: 9,
47
+ DocumentTypeNode: 10,
48
+ DocumentFragment: 11
49
+ };
50
+ const HYDRATE_ID = "s-id";
51
+ const HYDRATED_STYLE_ID = "sty-id";
52
+ const HYDRATE_CHILD_ID = "c-id";
53
+ const HYDRATED_CSS = "{visibility:hidden}.hydrated{visibility:inherit}";
54
+ /**
55
+ * Constant for styles to be globally applied to `slot-fb` elements for pseudo-slot behavior.
56
+ *
57
+ * Two cascading rules must be used instead of a `:not()` selector due to Stencil browser
58
+ * support as of Stencil v4.
59
+ */
60
+ const SLOT_FB_CSS = "slot-fb{display:contents}slot-fb[hidden]{display:none}";
61
+ const XLINK_NS = "http://www.w3.org/1999/xlink";
62
+ /**
63
+ * Minimum delay, in milliseconds, before retrying a failed lazy component load.
64
+ */
65
+ const LAZY_LOAD_RETRY_INTERVAL_MS = 1e3;
66
+ const FORM_ASSOCIATED_CUSTOM_ELEMENT_CALLBACKS = [
67
+ "formAssociatedCallback",
68
+ "formResetCallback",
69
+ "formDisabledCallback",
70
+ "formStateRestoreCallback"
71
+ ];
72
+ //#endregion
4
73
  //#region src/client/client-build.ts
5
74
  const Build = {
6
- isDev: BUILD.isDev,
7
75
  isBrowser: true,
8
76
  isServer: false,
77
+ isDev: BUILD.isDev,
9
78
  isTesting: BUILD.isTesting
10
79
  };
11
80
  const MEMBER_FLAGS = {
@@ -374,75 +443,6 @@ const styles = /*@__PURE__*/ new Map();
374
443
  const modeResolver = [];
375
444
  const needsScopedSSR = () => false;
376
445
  //#endregion
377
- //#region src/runtime/runtime-constants.ts
378
- /**
379
- * Bit flags for recording various properties of VDom nodes
380
- */
381
- const VNODE_FLAGS = {
382
- /**
383
- * Whether or not a vdom node is a slot reference
384
- */
385
- isSlotReference: 1,
386
- /**
387
- * Whether or not a slot element has fallback content
388
- */
389
- isSlotFallback: 2,
390
- /**
391
- * Whether or not an element is a host element
392
- */
393
- isHost: 4
394
- };
395
- const PROXY_FLAGS = {
396
- isElementConstructor: 1,
397
- proxyState: 2
398
- };
399
- const PLATFORM_FLAGS = {
400
- /**
401
- * designates a node in the DOM as being actively moved by the runtime
402
- */
403
- isTmpDisconnected: 1,
404
- appLoaded: 2,
405
- queueSync: 4,
406
- queueMask: 6
407
- };
408
- /**
409
- * A (subset) of node types which are relevant for the Stencil runtime. These
410
- * values are based on the values which can possibly be returned by the
411
- * `.nodeType` property of a DOM node. See here for details:
412
- *
413
- * {@link https://dom.spec.whatwg.org/#ref-for-dom-node-nodetype%E2%91%A0}
414
- */
415
- const NODE_TYPE = {
416
- ElementNode: 1,
417
- TextNode: 3,
418
- CommentNode: 8,
419
- DocumentNode: 9,
420
- DocumentTypeNode: 10,
421
- DocumentFragment: 11
422
- };
423
- const HYDRATE_ID = "s-id";
424
- const HYDRATED_STYLE_ID = "sty-id";
425
- const HYDRATE_CHILD_ID = "c-id";
426
- const HYDRATED_CSS = "{visibility:hidden}.hydrated{visibility:inherit}";
427
- /**
428
- * Constant for styles to be globally applied to `slot-fb` elements for pseudo-slot behavior.
429
- *
430
- * Two cascading rules must be used instead of a `:not()` selector due to Stencil browser
431
- * support as of Stencil v4.
432
- */
433
- const SLOT_FB_CSS = "slot-fb{display:contents}slot-fb[hidden]{display:none}";
434
- const XLINK_NS = "http://www.w3.org/1999/xlink";
435
- /**
436
- * Minimum delay, in milliseconds, before retrying a failed lazy component load.
437
- */
438
- const LAZY_LOAD_RETRY_INTERVAL_MS = 1e3;
439
- const FORM_ASSOCIATED_CUSTOM_ELEMENT_CALLBACKS = [
440
- "formAssociatedCallback",
441
- "formResetCallback",
442
- "formDisabledCallback",
443
- "formStateRestoreCallback"
444
- ];
445
- //#endregion
446
446
  //#region src/client/client-window.ts
447
447
  const win = typeof window !== "undefined" ? window : {};
448
448
  win.HTMLElement;
@@ -480,7 +480,7 @@ let queuePending = false;
480
480
  const queueDomReads = [];
481
481
  const queueDomWrites = [];
482
482
  const queueDomWritesLow = [];
483
- const scheduleFlush = () => win.document?.hidden ? nextTick(flush) : plt.raf(flush);
483
+ const scheduleFlush = () => win.document?.hidden ? setTimeout(flush, 16) : plt.raf(flush);
484
484
  const queueTask = (queue, write) => (cb) => {
485
485
  queue.push(cb);
486
486
  if (!queuePending) {
@@ -3103,9 +3103,7 @@ const h = (nodeName, vnodeData, ...children) => {
3103
3103
  if (classData && !(BUILD.vdomSignals && isSignalLike(classData))) vnodeData.class = typeof classData !== "object" ? classData : Object.keys(classData).filter((k) => classData[k]).join(" ");
3104
3104
  }
3105
3105
  }
3106
- if (BUILD.isDev && vNodeChildren.some(isHost)) consoleDevError(`The <Host> must be the single root component. Make sure:
3107
- - You are NOT using hostData() and <Host> in the same component.
3108
- - <Host> is used once, and it's the single root component of the render() function.`);
3106
+ if (BUILD.isDev && vNodeChildren.some(isHost)) consoleDevError(`The <Host> must be used once, and be the single root component of the render() function.`);
3109
3107
  if (BUILD.vdomFunctional && typeof nodeName === "function") return nodeName(vnodeData === null ? {} : vnodeData, vNodeChildren, vdomFnUtils);
3110
3108
  const vnode = newVNode(nodeName, null);
3111
3109
  vnode.$attrs$ = vnodeData;
@@ -3881,7 +3879,7 @@ const scopeSelector = (selector, scopeSelectorText, hostSelector, slotSelector)
3881
3879
  else return shallowPart.trim();
3882
3880
  }).join(", ");
3883
3881
  };
3884
- const isScopableAtRule = (selector) => selector.startsWith("@media") || selector.startsWith("@supports") || selector.startsWith("@page") || selector.startsWith("@document") || selector.startsWith("@layer");
3882
+ const isScopableAtRule = (selector) => selector.startsWith("@media") || selector.startsWith("@supports") || selector.startsWith("@page") || selector.startsWith("@document") || selector.startsWith("@layer") || selector.startsWith("@container");
3885
3883
  const scopeSelectors = (cssText, scopeSelectorText, hostSelector, slotSelector, commentOriginalSelector) => {
3886
3884
  return processRules(cssText, (rule) => {
3887
3885
  let selector = rule.selector;
@@ -4516,9 +4514,16 @@ const connectedCallback = (elm) => {
4516
4514
  }
4517
4515
  if (BUILD.asyncLoading) {
4518
4516
  let ancestorComponent = elm;
4519
- while (ancestorComponent = ancestorComponent.parentNode || ancestorComponent.host) if (BUILD.hydrateClientSide && ancestorComponent.nodeType === NODE_TYPE.ElementNode && ancestorComponent.hasAttribute("s-id") && ancestorComponent["s-p"] || ancestorComponent["s-p"]) {
4520
- attachToAncestor(hostRef, hostRef.$ancestorComponent$ = ancestorComponent);
4521
- break;
4517
+ while (ancestorComponent = ancestorComponent.parentNode || ancestorComponent.host) {
4518
+ if (BUILD.hydrateClientSide && !ancestorComponent["s-p"] && ancestorComponent.nodeType === NODE_TYPE.ElementNode && ancestorComponent.hasAttribute("s-id")) {
4519
+ ancestorComponent["s-p"] = [];
4520
+ ancestorComponent["s-rc"] = [];
4521
+ ancestorComponent["s-pc"] = [];
4522
+ }
4523
+ if (ancestorComponent["s-p"]) {
4524
+ attachToAncestor(hostRef, hostRef.$ancestorComponent$ = ancestorComponent);
4525
+ break;
4526
+ }
4522
4527
  }
4523
4528
  }
4524
4529
  if (BUILD.prop && !BUILD.hydrateServerSide && cmpMeta.$members$) Object.entries(cmpMeta.$members$).map(([memberName, [memberFlags]]) => {
@@ -298,7 +298,7 @@ interface SerializeDocumentOptions extends SsrDocumentOptions {
298
298
  * Note that this is "approximate", in that HTML may often not be able
299
299
  * to be split at an exact line width. Additionally, new lines created
300
300
  * is where HTML naturally already has whitespace, such as before an
301
- * attribute or spaces between words. Defaults to `100`.
301
+ * attribute or spaces between words. Defaults to no wrapping (`100` when prerendering).
302
302
  */
303
303
  approximateLineWidth?: number;
304
304
  /**
@@ -316,12 +316,12 @@ interface SerializeDocumentOptions extends SsrDocumentOptions {
316
316
  prettyHtml?: boolean;
317
317
  /**
318
318
  * Remove quotes from attribute values when possible.
319
- * Defaults to `true`.
319
+ * Defaults to `false` (`true` when prerendering).
320
320
  */
321
321
  removeAttributeQuotes?: boolean;
322
322
  /**
323
323
  * Remove the `=""` from standardized `boolean` attributes,
324
- * such as `hidden` or `checked`. Defaults to `true`.
324
+ * such as `hidden` or `checked`. Defaults to `false` (`true` when prerendering).
325
325
  */
326
326
  removeBooleanAttributeQuotes?: boolean;
327
327
  /**
@@ -330,7 +330,7 @@ interface SerializeDocumentOptions extends SsrDocumentOptions {
330
330
  */
331
331
  removeEmptyAttributes?: boolean;
332
332
  /**
333
- * Remove HTML comments. Defaults to `true`.
333
+ * Remove HTML comments. Defaults to `false` (`true` when prerendering).
334
334
  */
335
335
  removeHtmlComments?: boolean;
336
336
  /**