@stencil/core 5.0.0-beta.1 → 5.0.0-beta.11

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.
Files changed (32) hide show
  1. package/dist/app-data/index.d.ts +1 -1
  2. package/dist/{client-BRu0GtRn.mjs → client-CdFmjaQa.mjs} +40 -15
  3. package/dist/compiler/browser.d.ts +1 -1
  4. package/dist/compiler/browser.js +77 -41
  5. package/dist/compiler/index.d.mts +1 -1
  6. package/dist/compiler/index.mjs +2 -2
  7. package/dist/compiler/utils/index.d.mts +1 -1
  8. package/dist/{compiler-CJG6qvQt.mjs → compiler-2EypBn_Y.mjs} +346 -122
  9. package/dist/declarations/stencil-public-compiler.d.ts +6 -1
  10. package/dist/declarations/stencil-public-runtime.d.ts +57 -55
  11. package/dist/{index-BXAcVN2j.d.ts → index-BHciXst1.d.ts} +57 -55
  12. package/dist/{index-DmHmu3y0.d.mts → index-CKnzMkZC.d.mts} +1 -1
  13. package/dist/{index-BopBfjPu.d.mts → index-Cw1NW9FW.d.mts} +6 -1
  14. package/dist/index.mjs +1 -1
  15. package/dist/jsx-runtime.mjs +1 -1
  16. package/dist/{node-75gQKkFz.mjs → node-HKfDhPR3.mjs} +1 -1
  17. package/dist/runtime/client/lazy.js +63 -31
  18. package/dist/runtime/client/runtime.d.ts +57 -55
  19. package/dist/runtime/client/runtime.js +63 -31
  20. package/dist/runtime/index.d.ts +1 -1
  21. package/dist/runtime/index.js +63 -31
  22. package/dist/runtime/server/index.d.mts +2 -1
  23. package/dist/runtime/server/index.mjs +83 -44
  24. package/dist/runtime/server/runner.mjs +8 -5
  25. package/dist/signals/index.d.ts +11 -2
  26. package/dist/signals/index.js +11 -1
  27. package/dist/sys/node/index.d.mts +1 -1
  28. package/dist/sys/node/index.mjs +1 -1
  29. package/dist/sys/node/worker.mjs +2 -2
  30. package/dist/testing/index.d.mts +6 -1
  31. package/dist/testing/index.mjs +64 -32
  32. package/package.json +4 -4
@@ -239,7 +239,7 @@ interface VNode {
239
239
  $signal$?: any;
240
240
  }
241
241
  declare namespace JSXBase {
242
- interface IntrinsicElements {
242
+ export interface IntrinsicElements {
243
243
  slot: JSXBase.SlotAttributes<HTMLSlotElement>;
244
244
  a: JSXBase.AnchorHTMLAttributes<HTMLAnchorElement>;
245
245
  abbr: JSXBase.HTMLAttributes;
@@ -410,12 +410,12 @@ declare namespace JSXBase {
410
410
  use: JSXBase.SVGAttributes;
411
411
  view: JSXBase.SVGAttributes;
412
412
  }
413
- interface SlotAttributes<T = HTMLSlotElement> extends JSXAttributes<T> {
413
+ export interface SlotAttributes<T = HTMLSlotElement> extends JSXAttributes<T> {
414
414
  name?: string;
415
415
  slot?: string;
416
416
  onSlotchange?: (event: Event$1) => void;
417
417
  }
418
- interface AnchorHTMLAttributes<T> extends HTMLAttributes<T> {
418
+ export interface AnchorHTMLAttributes<T> extends HTMLAttributes<T> {
419
419
  download?: any;
420
420
  href?: string;
421
421
  hrefLang?: string;
@@ -426,8 +426,8 @@ declare namespace JSXBase {
426
426
  target?: string;
427
427
  referrerPolicy?: ReferrerPolicy;
428
428
  }
429
- interface AudioHTMLAttributes<T> extends MediaHTMLAttributes<T> {}
430
- interface AreaHTMLAttributes<T> extends HTMLAttributes<T> {
429
+ export interface AudioHTMLAttributes<T> extends MediaHTMLAttributes<T> {}
430
+ export interface AreaHTMLAttributes<T> extends HTMLAttributes<T> {
431
431
  alt?: string;
432
432
  coords?: string;
433
433
  download?: any;
@@ -439,14 +439,14 @@ declare namespace JSXBase {
439
439
  shape?: string;
440
440
  target?: string;
441
441
  }
442
- interface BaseHTMLAttributes<T> extends HTMLAttributes<T> {
442
+ export interface BaseHTMLAttributes<T> extends HTMLAttributes<T> {
443
443
  href?: string;
444
444
  target?: string;
445
445
  }
446
- interface BlockquoteHTMLAttributes<T> extends HTMLAttributes<T> {
446
+ export interface BlockquoteHTMLAttributes<T> extends HTMLAttributes<T> {
447
447
  cite?: string;
448
448
  }
449
- interface ButtonHTMLAttributes<T> extends HTMLAttributes<T> {
449
+ export interface ButtonHTMLAttributes<T> extends HTMLAttributes<T> {
450
450
  disabled?: boolean;
451
451
  form?: string;
452
452
  formAction?: string;
@@ -469,45 +469,45 @@ declare namespace JSXBase {
469
469
  commandFor?: string;
470
470
  commandfor?: string;
471
471
  }
472
- interface CanvasHTMLAttributes<T> extends HTMLAttributes<T> {
472
+ export interface CanvasHTMLAttributes<T> extends HTMLAttributes<T> {
473
473
  height?: number | string;
474
474
  width?: number | string;
475
475
  }
476
- interface ColHTMLAttributes<T> extends HTMLAttributes<T> {
476
+ export interface ColHTMLAttributes<T> extends HTMLAttributes<T> {
477
477
  span?: number;
478
478
  }
479
- interface ColgroupHTMLAttributes<T> extends HTMLAttributes<T> {
479
+ export interface ColgroupHTMLAttributes<T> extends HTMLAttributes<T> {
480
480
  span?: number;
481
481
  }
482
- interface DetailsHTMLAttributes<T> extends HTMLAttributes<T> {
482
+ export interface DetailsHTMLAttributes<T> extends HTMLAttributes<T> {
483
483
  open?: boolean;
484
484
  name?: string;
485
485
  onToggle?: (event: ToggleEvent) => void;
486
486
  }
487
- interface DelHTMLAttributes<T> extends HTMLAttributes<T> {
487
+ export interface DelHTMLAttributes<T> extends HTMLAttributes<T> {
488
488
  cite?: string;
489
489
  dateTime?: string;
490
490
  datetime?: string;
491
491
  }
492
- interface DialogHTMLAttributes<T> extends HTMLAttributes<T> {
492
+ export interface DialogHTMLAttributes<T> extends HTMLAttributes<T> {
493
493
  onCancel?: (event: Event$1) => void;
494
494
  onClose?: (event: Event$1) => void;
495
495
  open?: boolean;
496
496
  returnValue?: string;
497
497
  closedby?: 'any' | 'closerequest' | 'none';
498
498
  }
499
- interface EmbedHTMLAttributes<T> extends HTMLAttributes<T> {
499
+ export interface EmbedHTMLAttributes<T> extends HTMLAttributes<T> {
500
500
  height?: number | string;
501
501
  src?: string;
502
502
  type?: string;
503
503
  width?: number | string;
504
504
  }
505
- interface FieldsetHTMLAttributes<T> extends HTMLAttributes<T> {
505
+ export interface FieldsetHTMLAttributes<T> extends HTMLAttributes<T> {
506
506
  disabled?: boolean;
507
507
  form?: string;
508
508
  name?: string;
509
509
  }
510
- interface FormHTMLAttributes<T> extends HTMLAttributes<T> {
510
+ export interface FormHTMLAttributes<T> extends HTMLAttributes<T> {
511
511
  acceptCharset?: string;
512
512
  acceptcharset?: string;
513
513
  action?: string;
@@ -521,10 +521,10 @@ declare namespace JSXBase {
521
521
  novalidate?: boolean | string;
522
522
  target?: string;
523
523
  }
524
- interface HtmlHTMLAttributes<T> extends HTMLAttributes<T> {
524
+ export interface HtmlHTMLAttributes<T> extends HTMLAttributes<T> {
525
525
  manifest?: string;
526
526
  }
527
- interface IframeHTMLAttributes<T> extends HTMLAttributes<T> {
527
+ export interface IframeHTMLAttributes<T> extends HTMLAttributes<T> {
528
528
  allow?: string;
529
529
  allowFullScreen?: boolean;
530
530
  allowfullScreen?: string | boolean;
@@ -551,7 +551,7 @@ declare namespace JSXBase {
551
551
  srcdoc?: string;
552
552
  width?: number | string;
553
553
  }
554
- interface ImgHTMLAttributes<T> extends HTMLAttributes<T> {
554
+ export interface ImgHTMLAttributes<T> extends HTMLAttributes<T> {
555
555
  alt?: string;
556
556
  crossOrigin?: string;
557
557
  crossorigin?: string;
@@ -570,12 +570,12 @@ declare namespace JSXBase {
570
570
  usemap?: string;
571
571
  width?: number | string;
572
572
  }
573
- interface InsHTMLAttributes<T> extends HTMLAttributes<T> {
573
+ export interface InsHTMLAttributes<T> extends HTMLAttributes<T> {
574
574
  cite?: string;
575
575
  dateTime?: string;
576
576
  datetime?: string;
577
577
  }
578
- interface InputHTMLAttributes<T> extends HTMLAttributes<T> {
578
+ export interface InputHTMLAttributes<T> extends HTMLAttributes<T> {
579
579
  accept?: string;
580
580
  allowdirs?: boolean;
581
581
  alt?: string;
@@ -638,7 +638,7 @@ declare namespace JSXBase {
638
638
  popoverTargetElement?: globalThis.Element | null;
639
639
  popoverTarget?: string;
640
640
  }
641
- interface KeygenHTMLAttributes<T> extends HTMLAttributes<T> {
641
+ export interface KeygenHTMLAttributes<T> extends HTMLAttributes<T> {
642
642
  challenge?: string;
643
643
  disabled?: boolean;
644
644
  form?: string;
@@ -648,14 +648,14 @@ declare namespace JSXBase {
648
648
  keyparams?: string;
649
649
  name?: string;
650
650
  }
651
- interface LabelHTMLAttributes<T> extends HTMLAttributes<T> {
651
+ export interface LabelHTMLAttributes<T> extends HTMLAttributes<T> {
652
652
  form?: string;
653
653
  htmlFor?: string;
654
654
  }
655
- interface LiHTMLAttributes<T> extends HTMLAttributes<T> {
655
+ export interface LiHTMLAttributes<T> extends HTMLAttributes<T> {
656
656
  value?: string | string[] | number;
657
657
  }
658
- interface LinkHTMLAttributes<T> extends HTMLAttributes<T> {
658
+ export interface LinkHTMLAttributes<T> extends HTMLAttributes<T> {
659
659
  as?: string;
660
660
  fetchPriority?: 'high' | 'low' | 'auto';
661
661
  fetchpriority?: 'high' | 'low' | 'auto';
@@ -669,13 +669,13 @@ declare namespace JSXBase {
669
669
  sizes?: string;
670
670
  type?: string;
671
671
  }
672
- interface MapHTMLAttributes<T> extends HTMLAttributes<T> {
672
+ export interface MapHTMLAttributes<T> extends HTMLAttributes<T> {
673
673
  name?: string;
674
674
  }
675
- interface MenuHTMLAttributes<T> extends HTMLAttributes<T> {
675
+ export interface MenuHTMLAttributes<T> extends HTMLAttributes<T> {
676
676
  type?: string;
677
677
  }
678
- interface MediaHTMLAttributes<T> extends HTMLAttributes<T> {
678
+ export interface MediaHTMLAttributes<T> extends HTMLAttributes<T> {
679
679
  autoPlay?: boolean;
680
680
  autoplay?: boolean | string;
681
681
  controls?: boolean;
@@ -715,7 +715,7 @@ declare namespace JSXBase {
715
715
  onVolumeChange?: (event: Event$1) => void;
716
716
  onWaiting?: (event: Event$1) => void;
717
717
  }
718
- interface MetaHTMLAttributes<T> extends HTMLAttributes<T> {
718
+ export interface MetaHTMLAttributes<T> extends HTMLAttributes<T> {
719
719
  charSet?: string;
720
720
  charset?: string;
721
721
  content?: string;
@@ -723,7 +723,7 @@ declare namespace JSXBase {
723
723
  httpequiv?: string;
724
724
  name?: string;
725
725
  }
726
- interface MeterHTMLAttributes<T> extends HTMLAttributes<T> {
726
+ export interface MeterHTMLAttributes<T> extends HTMLAttributes<T> {
727
727
  form?: string;
728
728
  high?: number;
729
729
  low?: number;
@@ -732,10 +732,10 @@ declare namespace JSXBase {
732
732
  optimum?: number;
733
733
  value?: string | string[] | number;
734
734
  }
735
- interface QuoteHTMLAttributes<T> extends HTMLAttributes<T> {
735
+ export interface QuoteHTMLAttributes<T> extends HTMLAttributes<T> {
736
736
  cite?: string;
737
737
  }
738
- interface ObjectHTMLAttributes<T> extends HTMLAttributes<T> {
738
+ export interface ObjectHTMLAttributes<T> extends HTMLAttributes<T> {
739
739
  classID?: string;
740
740
  classid?: string;
741
741
  data?: string;
@@ -748,34 +748,34 @@ declare namespace JSXBase {
748
748
  width?: number | string;
749
749
  wmode?: string;
750
750
  }
751
- interface OlHTMLAttributes<T> extends HTMLAttributes<T> {
751
+ export interface OlHTMLAttributes<T> extends HTMLAttributes<T> {
752
752
  reversed?: boolean;
753
753
  start?: number;
754
754
  }
755
- interface OptgroupHTMLAttributes<T> extends HTMLAttributes<T> {
755
+ export interface OptgroupHTMLAttributes<T> extends HTMLAttributes<T> {
756
756
  disabled?: boolean;
757
757
  label?: string;
758
758
  }
759
- interface OptionHTMLAttributes<T> extends HTMLAttributes<T> {
759
+ export interface OptionHTMLAttributes<T> extends HTMLAttributes<T> {
760
760
  disabled?: boolean;
761
761
  label?: string;
762
762
  selected?: boolean;
763
763
  value?: string | string[] | number;
764
764
  }
765
- interface OutputHTMLAttributes<T> extends HTMLAttributes<T> {
765
+ export interface OutputHTMLAttributes<T> extends HTMLAttributes<T> {
766
766
  form?: string;
767
767
  htmlFor?: string;
768
768
  name?: string;
769
769
  }
770
- interface ParamHTMLAttributes<T> extends HTMLAttributes<T> {
770
+ export interface ParamHTMLAttributes<T> extends HTMLAttributes<T> {
771
771
  name?: string;
772
772
  value?: string | string[] | number;
773
773
  }
774
- interface ProgressHTMLAttributes<T> extends HTMLAttributes<T> {
774
+ export interface ProgressHTMLAttributes<T> extends HTMLAttributes<T> {
775
775
  max?: number | string;
776
776
  value?: string | string[] | number;
777
777
  }
778
- interface ScriptHTMLAttributes<T> extends HTMLAttributes<T> {
778
+ export interface ScriptHTMLAttributes<T> extends HTMLAttributes<T> {
779
779
  async?: boolean;
780
780
  charSet?: string;
781
781
  charset?: string;
@@ -790,7 +790,7 @@ declare namespace JSXBase {
790
790
  src?: string;
791
791
  type?: string;
792
792
  }
793
- interface SelectHTMLAttributes<T> extends HTMLAttributes<T> {
793
+ export interface SelectHTMLAttributes<T> extends HTMLAttributes<T> {
794
794
  disabled?: boolean;
795
795
  form?: string;
796
796
  multiple?: boolean;
@@ -800,7 +800,7 @@ declare namespace JSXBase {
800
800
  autoComplete?: string;
801
801
  autocomplete?: string;
802
802
  }
803
- interface SourceHTMLAttributes<T> extends HTMLAttributes<T> {
803
+ export interface SourceHTMLAttributes<T> extends HTMLAttributes<T> {
804
804
  height?: number;
805
805
  media?: string;
806
806
  sizes?: string;
@@ -809,20 +809,20 @@ declare namespace JSXBase {
809
809
  type?: string;
810
810
  width?: number;
811
811
  }
812
- interface StyleHTMLAttributes<T> extends HTMLAttributes<T> {
812
+ export interface StyleHTMLAttributes<T> extends HTMLAttributes<T> {
813
813
  media?: string;
814
814
  nonce?: string;
815
815
  scoped?: boolean;
816
816
  type?: string;
817
817
  }
818
- interface TableHTMLAttributes<T> extends HTMLAttributes<T> {
818
+ export interface TableHTMLAttributes<T> extends HTMLAttributes<T> {
819
819
  cellPadding?: number | string;
820
820
  cellpadding?: number | string;
821
821
  cellSpacing?: number | string;
822
822
  cellspacing?: number | string;
823
823
  summary?: string;
824
824
  }
825
- interface TextareaHTMLAttributes<T> extends HTMLAttributes<T> {
825
+ export interface TextareaHTMLAttributes<T> extends HTMLAttributes<T> {
826
826
  autoComplete?: string;
827
827
  autocomplete?: string;
828
828
  cols?: number;
@@ -843,12 +843,12 @@ declare namespace JSXBase {
843
843
  value?: string | string[] | number;
844
844
  wrap?: string;
845
845
  }
846
- interface TdHTMLAttributes<T> extends HTMLAttributes<T> {
846
+ export interface TdHTMLAttributes<T> extends HTMLAttributes<T> {
847
847
  colSpan?: number;
848
848
  headers?: string;
849
849
  rowSpan?: number;
850
850
  }
851
- interface ThHTMLAttributes<T> extends HTMLAttributes<T> {
851
+ export interface ThHTMLAttributes<T> extends HTMLAttributes<T> {
852
852
  abbr?: string;
853
853
  colSpan?: number;
854
854
  headers?: string;
@@ -856,10 +856,10 @@ declare namespace JSXBase {
856
856
  rowspan?: number | string;
857
857
  scope?: string;
858
858
  }
859
- interface TimeHTMLAttributes<T> extends HTMLAttributes<T> {
859
+ export interface TimeHTMLAttributes<T> extends HTMLAttributes<T> {
860
860
  dateTime?: string;
861
861
  }
862
- interface TrackHTMLAttributes<T> extends HTMLAttributes<T> {
862
+ export interface TrackHTMLAttributes<T> extends HTMLAttributes<T> {
863
863
  default?: boolean;
864
864
  kind?: string;
865
865
  label?: string;
@@ -867,14 +867,14 @@ declare namespace JSXBase {
867
867
  srcLang?: string;
868
868
  srclang?: string;
869
869
  }
870
- interface VideoHTMLAttributes<T> extends MediaHTMLAttributes<T> {
870
+ export interface VideoHTMLAttributes<T> extends MediaHTMLAttributes<T> {
871
871
  height?: number | string;
872
872
  playsInline?: boolean;
873
873
  playsinline?: boolean | string;
874
874
  poster?: string;
875
875
  width?: number | string;
876
876
  }
877
- interface HTMLAttributes<T = HTMLElement> extends DOMAttributes<T> {
877
+ export interface HTMLAttributes<T = HTMLElement> extends DOMAttributes<T> {
878
878
  innerHTML?: string;
879
879
  accessKey?: string;
880
880
  autoFocus?: boolean;
@@ -940,7 +940,7 @@ declare namespace JSXBase {
940
940
  security?: string;
941
941
  unselectable?: boolean;
942
942
  }
943
- interface SVGAttributes<T = SVGElement> extends DOMAttributes<T> {
943
+ export interface SVGAttributes<T = SVGElement> extends DOMAttributes<T> {
944
944
  class?: string | {
945
945
  [className: string]: boolean;
946
946
  } | SignalRef<string>;
@@ -1202,13 +1202,15 @@ declare namespace JSXBase {
1202
1202
  zoomAndPan?: string;
1203
1203
  }
1204
1204
  /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ToggleEvent) */
1205
- interface ToggleEvent extends Event$1 {
1205
+ export interface ToggleEvent extends Event$1 {
1206
1206
  /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ToggleEvent/newState) */
1207
1207
  readonly newState: string;
1208
1208
  /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ToggleEvent/oldState) */
1209
1209
  readonly oldState: string;
1210
1210
  }
1211
- interface DOMAttributes<T> extends JSXAttributes<T> {
1211
+ type AriaIDLPropertyName = { [K in keyof ARIAMixin]: ARIAMixin[K] extends string | null ? K : never; }[keyof ARIAMixin];
1212
+ type JSXAriaProperties = { [K in AriaIDLPropertyName]?: string | boolean | undefined; };
1213
+ export interface DOMAttributes<T> extends JSXAttributes<T>, JSXAriaProperties {
1212
1214
  slot?: string;
1213
1215
  part?: string;
1214
1216
  exportparts?: string;
@@ -1338,8 +1340,8 @@ declare namespace JSXBase {
1338
1340
  onTransitionStart?: (event: TransitionEvent) => void;
1339
1341
  onTransitionStartCapture?: (event: TransitionEvent) => void;
1340
1342
  [key: `aria-${string}`]: string | boolean | undefined;
1341
- [key: `aria${string}`]: string | boolean | undefined;
1342
1343
  }
1344
+ export {};
1343
1345
  }
1344
1346
  interface JSXAttributes<T = globalThis.Element> {
1345
1347
  key?: string | number;
@@ -1,6 +1,6 @@
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
- import { effect, effect as effect$1, signal } from "@preact/signals-core";
3
+ import * as SignalsCore from "@preact/signals-core";
4
4
  //#region src/client/client-build.ts
5
5
  const Build = {
6
6
  isDev: BUILD$1.isDev,
@@ -1685,6 +1685,13 @@ const isComplexType = (o) => {
1685
1685
  return o === "object" || o === "function";
1686
1686
  };
1687
1687
  //#endregion
1688
+ //#region src/runtime/signals-core.ts
1689
+ const getCore = () => globalThis[Symbol.for("stencil.preact-signals-core")] ??= SignalsCore;
1690
+ const effect = (fn, options) => getCore().effect(fn, options);
1691
+ function signal(value, options) {
1692
+ return getCore().signal(value, options);
1693
+ }
1694
+ //#endregion
1688
1695
  //#region src/runtime/event-emitter.ts
1689
1696
  const createEvent = (ref, name, flags) => {
1690
1697
  const elm = getElement(ref);
@@ -1760,7 +1767,7 @@ const setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags, initialR
1760
1767
  attrMap.get(memberName)?.();
1761
1768
  if (!signalAttrDisposers.has(elm)) signalAttrDisposers.set(elm, attrMap);
1762
1769
  let prevVal = oldValue;
1763
- attrMap.set(memberName, effect$1(() => {
1770
+ attrMap.set(memberName, effect(() => {
1764
1771
  const curVal = newValue.value;
1765
1772
  setAccessor(elm, memberName, prevVal, curVal, isSvg, flags);
1766
1773
  prevVal = curVal;
@@ -1977,16 +1984,33 @@ const signalNodeDisposers = /* @__PURE__ */ new WeakMap();
1977
1984
  const disposeSignalVNode = (vnode) => {
1978
1985
  const elm = vnode.$elm$;
1979
1986
  if (elm) {
1980
- const dispose = signalNodeDisposers.get(elm);
1981
- if (dispose) {
1982
- dispose();
1983
- signalNodeDisposers.delete(elm);
1984
- }
1987
+ disposeTextSignal(elm);
1985
1988
  disposeAllSignalAttrs(elm);
1986
1989
  }
1987
1990
  vnode.$children$?.forEach(disposeSignalVNode);
1988
1991
  };
1989
1992
  /**
1993
+ * Tear down a text node's signal subscription, if it has one.
1994
+ * @param textNode the text node to unsubscribe
1995
+ */
1996
+ const disposeTextSignal = (textNode) => {
1997
+ const dispose = signalNodeDisposers.get(textNode);
1998
+ if (dispose) {
1999
+ dispose();
2000
+ signalNodeDisposers.delete(textNode);
2001
+ }
2002
+ };
2003
+ /**
2004
+ * Subscribe a text node to a signal, keeping its `data` in sync on every change.
2005
+ * @param textNode the text node to keep in sync
2006
+ * @param textSig the signal to subscribe to
2007
+ */
2008
+ const wireTextSignal = (textNode, textSig) => {
2009
+ signalNodeDisposers.set(textNode, effect(() => {
2010
+ textNode.data = String(textSig.value);
2011
+ }));
2012
+ };
2013
+ /**
1990
2014
  * Create a DOM Node corresponding to one of the children of a given VNode.
1991
2015
  *
1992
2016
  * @param oldParentVNode the parent VNode from the previous render
@@ -2008,13 +2032,7 @@ const createElm = (oldParentVNode, newParentVNode, childIndex) => {
2008
2032
  if (BUILD$1.isDev && newVNode.$elm$) consoleDevError(`The JSX ${newVNode.$text$ !== null ? `"${newVNode.$text$}" text` : `"${String(newVNode.$tag$)}" element`} node should not be shared within the same renderer. The renderer caches element lookups in order to improve performance. However, a side effect from this is that the exact same JSX node should not be reused. For more information please see https://stenciljs.com/docs/templating-jsx#avoid-shared-jsx-nodes`);
2009
2033
  if (BUILD$1.vdomText && newVNode.$text$ != null) {
2010
2034
  elm = newVNode.$elm$ = win.document.createTextNode(newVNode.$text$);
2011
- if (BUILD$1.vdomSignals && newVNode.$signal$) {
2012
- const textSig = newVNode.$signal$;
2013
- const textNode = elm;
2014
- signalNodeDisposers.set(textNode, effect$1(() => {
2015
- textNode.data = String(textSig.value);
2016
- }));
2017
- }
2035
+ if (BUILD$1.vdomSignals && newVNode.$signal$) wireTextSignal(elm, newVNode.$signal$);
2018
2036
  } else if (BUILD$1.slotRelocation && newVNode.$flags$ & VNODE_FLAGS.isSlotReference) {
2019
2037
  elm = newVNode.$elm$ = BUILD$1.isDebug || BUILD$1.hydrateServerSide ? slotReferenceDebugNode(newVNode) : win.document.createTextNode("");
2020
2038
  if (typeof newVNode.$attrs$?.slot === "string") elm["s-sa"] = newVNode.$attrs$.slot;
@@ -2282,7 +2300,7 @@ const updateChildren = (parentElm, oldCh, newVNode, newCh, isInitialRender = fal
2282
2300
  }
2283
2301
  if (BUILD$1.vdomKey && idxInOld >= 0) {
2284
2302
  elmToMove = oldCh[idxInOld];
2285
- if (elmToMove.$tag$ !== newStartVnode.$tag$) node = createElm(oldCh && oldCh[newStartIdx], newVNode, idxInOld);
2303
+ if (elmToMove.$tag$ !== newStartVnode.$tag$) node = createElm(oldCh && oldCh[newStartIdx], newVNode, newStartIdx);
2286
2304
  else {
2287
2305
  patch(elmToMove, newStartVnode, isInitialRender);
2288
2306
  oldCh[idxInOld] = void 0;
@@ -2375,7 +2393,17 @@ const patch = (oldVNode, newVNode, isInitialRender = false) => {
2375
2393
  else if (BUILD$1.hydrateClientSide && isInitialRender && BUILD$1.updatable && oldChildren !== null && newChildren === null) newVNode.$children$ = oldChildren;
2376
2394
  if (BUILD$1.svg && isSvgMode && tag === "svg") isSvgMode = false;
2377
2395
  } else if (BUILD$1.vdomText && BUILD$1.slotRelocation && (defaultHolder = elm["s-cr"])) defaultHolder.parentNode.textContent = text;
2378
- else if (BUILD$1.vdomText && oldVNode.$text$ !== text) elm.data = text;
2396
+ else if (BUILD$1.vdomText) {
2397
+ if (BUILD$1.vdomSignals && newVNode.$signal$) {
2398
+ if (newVNode.$signal$ !== oldVNode.$signal$) {
2399
+ disposeTextSignal(elm);
2400
+ wireTextSignal(elm, newVNode.$signal$);
2401
+ }
2402
+ } else {
2403
+ if (BUILD$1.vdomSignals && oldVNode.$signal$) disposeTextSignal(elm);
2404
+ if (oldVNode.$text$ !== text) elm.data = text;
2405
+ }
2406
+ }
2379
2407
  };
2380
2408
  /**
2381
2409
  * Component-global information about nodes which are either currently being
@@ -3075,8 +3103,7 @@ const initializeSignals = (elm, hostRef, cmpMeta) => {
3075
3103
  const instance = BUILD$1.lazyLoad ? hostRef.$lazyInstance$ : elm;
3076
3104
  for (const [memberName, [memberFlags]] of Object.entries(cmpMeta.$members$ ?? {})) {
3077
3105
  if (!(memberFlags & MEMBER_FLAGS.PropLike)) continue;
3078
- const initialVal = hostRef.$instanceValues$.get(memberName);
3079
- const sig = signal(initialVal);
3106
+ const sig = signal(hostRef.$instanceValues$.get(memberName));
3080
3107
  hostRef.$signalValues$.set(memberName, sig);
3081
3108
  let prevScheduleVal = sig.peek();
3082
3109
  disposers.push(effect(() => {
@@ -3982,12 +4009,13 @@ const scopeSelector = (selector, scopeSelectorText, hostSelector, slotSelector)
3982
4009
  else return shallowPart.trim();
3983
4010
  }).join(", ");
3984
4011
  };
4012
+ const isScopableAtRule = (selector) => selector.startsWith("@media") || selector.startsWith("@supports") || selector.startsWith("@page") || selector.startsWith("@document") || selector.startsWith("@layer");
3985
4013
  const scopeSelectors = (cssText, scopeSelectorText, hostSelector, slotSelector, commentOriginalSelector) => {
3986
4014
  return processRules(cssText, (rule) => {
3987
4015
  let selector = rule.selector;
3988
4016
  let content = rule.content;
3989
4017
  if (rule.selector[0] !== "@") selector = scopeSelector(rule.selector, scopeSelectorText, hostSelector, slotSelector);
3990
- else if (rule.selector.startsWith("@media") || rule.selector.startsWith("@supports") || rule.selector.startsWith("@page") || rule.selector.startsWith("@document")) content = scopeSelectors(rule.content, scopeSelectorText, hostSelector, slotSelector, commentOriginalSelector);
4018
+ else if (isScopableAtRule(rule.selector)) content = scopeSelectors(rule.content, scopeSelectorText, hostSelector, slotSelector, commentOriginalSelector);
3991
4019
  return {
3992
4020
  selector: selector.replace(/\s{2,}/g, " ").trim(),
3993
4021
  content
@@ -4079,14 +4107,12 @@ const scopeCss = (cssText, scopeId, commentOriginalSelector) => {
4079
4107
  rule.selector = placeholder + rule.selector;
4080
4108
  return rule;
4081
4109
  };
4082
- cssText = processRules(cssText, (rule) => {
4110
+ const commentSelectors = (input) => processRules(input, (rule) => {
4083
4111
  if (rule.selector[0] !== "@") return processCommentedSelector(rule);
4084
- else if (rule.selector.startsWith("@media") || rule.selector.startsWith("@supports") || rule.selector.startsWith("@page") || rule.selector.startsWith("@document")) {
4085
- rule.content = processRules(rule.content, processCommentedSelector);
4086
- return rule;
4087
- }
4112
+ if (isScopableAtRule(rule.selector)) rule.content = commentSelectors(rule.content);
4088
4113
  return rule;
4089
4114
  });
4115
+ cssText = commentSelectors(cssText);
4090
4116
  }
4091
4117
  const scoped = scopeCssText(cssText, scopeId, hostScopeId, slotScopeId, commentOriginalSelector);
4092
4118
  cssText = [scoped.cssText, ...commentsWithHash].join("\n");
@@ -4383,16 +4409,21 @@ const proxyComponent = (Cstr, cmpMeta, flags) => {
4383
4409
  });
4384
4410
  return;
4385
4411
  }
4386
- const setterSetVal = () => {
4412
+ const parsedValue = parsePropertyValue(newValue, memberFlags, BUILD$1.formAssociated && !!(cmpMeta.$flags$ & CMP_FLAGS.formAssociated));
4413
+ const setterSetVal = (val) => {
4387
4414
  const currentValue = ref.$lazyInstance$[memberName];
4388
4415
  if (!ref.$instanceValues$.get(memberName) && currentValue) ref.$instanceValues$.set(memberName, currentValue);
4389
- ref.$lazyInstance$[memberName] = parsePropertyValue(newValue, memberFlags, BUILD$1.formAssociated && !!(cmpMeta.$flags$ & CMP_FLAGS.formAssociated));
4416
+ ref.$lazyInstance$[memberName] = val;
4390
4417
  setValue(this, memberName, ref.$lazyInstance$[memberName], cmpMeta);
4391
4418
  };
4392
- if (ref.$lazyInstance$) setterSetVal();
4393
- else ref.$fetchedCbList$.push(() => {
4394
- setterSetVal();
4395
- });
4419
+ if (ref.$lazyInstance$) setterSetVal(parsedValue);
4420
+ else {
4421
+ ref.$instanceValues$.set(memberName, parsedValue);
4422
+ ref.$fetchedCbList$.push(() => {
4423
+ const pendingValue = ref.$instanceValues$.get(memberName);
4424
+ if (ref.$lazyInstance$[memberName] !== pendingValue) setterSetVal(pendingValue);
4425
+ });
4426
+ }
4396
4427
  }
4397
4428
  } });
4398
4429
  } else if (BUILD$1.lazyLoad && BUILD$1.method && flags & PROXY_FLAGS.isElementConstructor && memberFlags & MEMBER_FLAGS.Method) Object.defineProperty(prototype, memberName, { value(...args) {
@@ -4445,8 +4476,9 @@ const proxyComponent = (Cstr, cmpMeta, flags) => {
4445
4476
  if (BUILD$1.reflect && propMemberFlags & MEMBER_FLAGS.ReflectAttr && propMemberFlags & MEMBER_FLAGS.Any && !isComplexType(this[propName]) && reflectedAttrValue(this[propName]) === newValue) return;
4446
4477
  const isSpuriousBooleanRemoval = isBooleanTarget && newValue === null && this[propName] === void 0;
4447
4478
  if (isBooleanTarget) newValue = !(newValue === null || newValue === "false");
4479
+ const currentValue = BUILD$1.lazyLoad && propMemberFlags & MEMBER_FLAGS.Setter ? hostRef.$instanceValues$.get(propName) : this[propName];
4448
4480
  const propDesc = Object.getOwnPropertyDescriptor(prototype, propName);
4449
- if (!isSpuriousBooleanRemoval && newValue != this[propName] && (!propDesc.get || !!propDesc.set)) this[propName] = newValue;
4481
+ if (!isSpuriousBooleanRemoval && newValue != currentValue && (!propDesc.get || !!propDesc.set)) this[propName] = newValue;
4450
4482
  });
4451
4483
  };
4452
4484
  Cstr.observedAttributes = Array.from(/* @__PURE__ */ new Set([...Object.keys(cmpMeta.$watchers$ ?? {}), ...members.filter(([_, m]) => m[0] & MEMBER_FLAGS.HasAttribute).map(([propName, m]) => {
@@ -1,4 +1,4 @@
1
- import { C as ReactiveControllerHostInterface, E as VNode, S as MixedInCtor, T as TagTransformer, _ as ComponentInterface, a as ComponentConstructor, b as HTMLStencilElement, c as ComponentRuntimeMeta, d as HostRef, f as LazyBundlesRuntimeData, g as RuntimeRef, h as RenderNode, i as ChildType, l as ComponentRuntimeMetaCompact, m as PropsType, o as ComponentConstructorChangeHandlers, p as PlatformRuntime, s as ComponentRuntimeHostListener, u as HostElement, v as CustomElementsDefineOptions, w as ResolutionHandler, x as JSXBase, y as FunctionalComponent } from "../index-BXAcVN2j.js";
1
+ import { C as ReactiveControllerHostInterface, E as VNode, S as MixedInCtor, T as TagTransformer, _ as ComponentInterface, a as ComponentConstructor, b as HTMLStencilElement, c as ComponentRuntimeMeta, d as HostRef, f as LazyBundlesRuntimeData, g as RuntimeRef, h as RenderNode, i as ChildType, l as ComponentRuntimeMetaCompact, m as PropsType, o as ComponentConstructorChangeHandlers, p as PlatformRuntime, s as ComponentRuntimeHostListener, u as HostElement, v as CustomElementsDefineOptions, w as ResolutionHandler, x as JSXBase, y as FunctionalComponent } from "../index-BHciXst1.js";
2
2
  //#region src/runtime/asset-path.d.ts
3
3
  declare const getAssetPath: (path: string) => string;
4
4
  declare const setAssetPath: (path: string) => string;