@stencil/core 2.9.0 → 2.12.0

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 (70) hide show
  1. package/cli/index.cjs +16 -5
  2. package/cli/index.js +16 -5
  3. package/cli/package.json +1 -1
  4. package/compiler/lib.dom.d.ts +263 -648
  5. package/compiler/lib.dom.iterable.d.ts +1 -5
  6. package/compiler/lib.es2015.core.d.ts +2 -2
  7. package/compiler/lib.es2015.iterable.d.ts +1 -1
  8. package/compiler/lib.es2015.symbol.wellknown.d.ts +10 -10
  9. package/compiler/lib.es2018.asynciterable.d.ts +1 -1
  10. package/compiler/lib.es2020.bigint.d.ts +1 -1
  11. package/compiler/lib.es2020.intl.d.ts +6 -7
  12. package/compiler/lib.es2020.symbol.wellknown.d.ts +1 -1
  13. package/compiler/lib.es2021.d.ts +24 -0
  14. package/compiler/lib.es2021.full.d.ts +25 -0
  15. package/compiler/lib.es2021.promise.d.ts +43 -0
  16. package/compiler/lib.es2021.string.d.ts +35 -0
  17. package/compiler/lib.es2021.weakref.d.ts +75 -0
  18. package/compiler/lib.es5.d.ts +9 -9
  19. package/compiler/lib.esnext.d.ts +1 -4
  20. package/compiler/lib.esnext.promise.d.ts +26 -26
  21. package/compiler/lib.esnext.string.d.ts +18 -18
  22. package/compiler/lib.esnext.weakref.d.ts +58 -58
  23. package/compiler/lib.webworker.d.ts +98 -153
  24. package/compiler/lib.webworker.iterable.d.ts +1 -1
  25. package/compiler/package.json +1 -1
  26. package/compiler/stencil.js +497 -725
  27. package/compiler/stencil.min.js +2 -2
  28. package/dependencies.json +6 -1
  29. package/dev-server/client/index.js +1 -1
  30. package/dev-server/client/package.json +1 -1
  31. package/dev-server/connector.html +2 -2
  32. package/dev-server/index.js +1 -1
  33. package/dev-server/package.json +1 -1
  34. package/dev-server/server-process.js +2 -2
  35. package/internal/app-data/package.json +1 -1
  36. package/internal/client/css-shim.js +1 -1
  37. package/internal/client/dom.js +1 -1
  38. package/internal/client/index.js +119 -102
  39. package/internal/client/package.json +1 -1
  40. package/internal/client/patch-browser.js +1 -1
  41. package/internal/client/patch-esm.js +1 -1
  42. package/internal/client/shadow-css.js +9 -10
  43. package/internal/hydrate/index.js +44 -40
  44. package/internal/hydrate/package.json +1 -1
  45. package/internal/hydrate/shadow-css.js +59 -62
  46. package/internal/index.js +1 -0
  47. package/internal/package.json +1 -1
  48. package/internal/stencil-public-compiler.d.ts +1 -1
  49. package/internal/testing/index.js +54 -47
  50. package/internal/testing/package.json +1 -1
  51. package/internal/testing/shadow-css.js +54 -57
  52. package/mock-doc/index.cjs +5 -2
  53. package/mock-doc/index.d.ts +6 -6
  54. package/mock-doc/index.js +5 -2
  55. package/mock-doc/package.json +1 -1
  56. package/package.json +17 -9
  57. package/screenshot/index.js +1 -1
  58. package/screenshot/package.json +1 -1
  59. package/sys/node/autoprefixer.js +2 -2
  60. package/sys/node/index.js +1 -1
  61. package/sys/node/package.json +1 -1
  62. package/sys/node/worker.js +1 -1
  63. package/testing/index.js +84 -73
  64. package/testing/jest/jest-environment.d.ts +1 -0
  65. package/testing/jest/jest-preprocessor.d.ts +56 -8
  66. package/testing/jest-preset.js +5 -0
  67. package/testing/mocks.d.ts +1 -5
  68. package/testing/package.json +1 -1
  69. package/testing/testing-sys.d.ts +6 -1
  70. package/screenshot/index.js.map +0 -1
@@ -11,7 +11,7 @@ let renderingRef = null;
11
11
  let queueCongestion = 0;
12
12
  let queuePending = false;
13
13
  /*
14
- Stencil Client Platform v2.9.0 | MIT Licensed | https://stenciljs.com
14
+ Stencil Client Platform v2.12.0 | MIT Licensed | https://stenciljs.com
15
15
  */
16
16
  import { BUILD, NAMESPACE } from '@stencil/core/internal/app-data';
17
17
  const win = typeof window !== 'undefined' ? window : {};
@@ -594,7 +594,6 @@ const setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
594
594
  // Workaround for Safari, moving the <input> caret when re-assigning the same valued
595
595
  if (memberName === 'list') {
596
596
  isProp = false;
597
- // tslint:disable-next-line: triple-equals
598
597
  }
599
598
  else if (oldValue == null || elm[memberName] != n) {
600
599
  elm[memberName] = n;
@@ -1952,14 +1951,14 @@ const proxyComponent = (Cstr, cmpMeta, flags) => {
1952
1951
  prototype.attributeChangedCallback = function (attrName, _oldValue, newValue) {
1953
1952
  plt.jmp(() => {
1954
1953
  const propName = attrNameToPropName.get(attrName);
1955
- // In a webcomponent lifecyle the attributeChangedCallback runs prior to connectedCallback
1954
+ // In a web component lifecycle the attributeChangedCallback runs prior to connectedCallback
1956
1955
  // in the case where an attribute was set inline.
1957
1956
  // ```html
1958
1957
  // <my-component some-attribute="some-value"></my-component>
1959
1958
  // ```
1960
1959
  //
1961
- // There is an edge case where a developer sets the attribute inline on a custom element and then programatically
1962
- // changes it before it has been upgraded as shown below:
1960
+ // There is an edge case where a developer sets the attribute inline on a custom element and then
1961
+ // programmatically changes it before it has been upgraded as shown below:
1963
1962
  //
1964
1963
  // ```html
1965
1964
  // <!-- this component has _not_ been upgraded yet -->
@@ -1969,13 +1968,13 @@ const proxyComponent = (Cstr, cmpMeta, flags) => {
1969
1968
  // el = document.querySelector("#test");
1970
1969
  // el.someAttribute = "another-value";
1971
1970
  // // upgrade component
1972
- // cutsomElements.define('my-component', MyComponent);
1971
+ // customElements.define('my-component', MyComponent);
1973
1972
  // </script>
1974
1973
  // ```
1975
1974
  // In this case if we do not unshadow here and use the value of the shadowing property, attributeChangedCallback
1976
1975
  // will be called with `newValue = "some-value"` and will set the shadowed property (this.someAttribute = "another-value")
1977
1976
  // to the value that was set inline i.e. "some-value" from above example. When
1978
- // the connectedCallback attempts to unshadow it will use "some-value" as the intial value rather than "another-value"
1977
+ // the connectedCallback attempts to unshadow it will use "some-value" as the initial value rather than "another-value"
1979
1978
  //
1980
1979
  // The case where the attribute was NOT set inline but was not set programmatically shall be handled/unshadowed
1981
1980
  // by connectedCallback as this attributeChangedCallback will not fire.
@@ -1989,6 +1988,14 @@ const proxyComponent = (Cstr, cmpMeta, flags) => {
1989
1988
  newValue = this[propName];
1990
1989
  delete this[propName];
1991
1990
  }
1991
+ else if (prototype.hasOwnProperty(propName) &&
1992
+ typeof this[propName] === 'number' &&
1993
+ this[propName] == newValue) {
1994
+ // if the propName exists on the prototype of `Cstr`, this update may be a result of Stencil using native
1995
+ // APIs to reflect props as attributes. Calls to `setAttribute(someElement, propName)` will result in
1996
+ // `propName` to be converted to a `DOMString`, which may not be what we want for other primitive props.
1997
+ return;
1998
+ }
1992
1999
  this[propName] = newValue === null && typeof this[propName] === 'boolean' ? false : newValue;
1993
2000
  });
1994
2001
  };
@@ -2100,7 +2107,7 @@ const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId, Cstr) =>
2100
2107
  const ancestorComponent = hostRef.$ancestorComponent$;
2101
2108
  const schedule = () => scheduleUpdate(hostRef, true);
2102
2109
  if (BUILD.asyncLoading && ancestorComponent && ancestorComponent['s-rc']) {
2103
- // this is the intial load and this component it has an ancestor component
2110
+ // this is the initial load and this component it has an ancestor component
2104
2111
  // but the ancestor component has NOT fired its will update lifecycle yet
2105
2112
  // so let's just cool our jets and wait for the ancestor to continue first
2106
2113
  // this will get fired off when the ancestor component
@@ -2279,6 +2286,22 @@ const proxyCustomElement = (Cstr, compactMeta) => {
2279
2286
  originalDisconnectedCallback.call(this);
2280
2287
  }
2281
2288
  },
2289
+ __attachShadow() {
2290
+ if (supportsShadow) {
2291
+ if (BUILD.shadowDelegatesFocus) {
2292
+ this.attachShadow({
2293
+ mode: 'open',
2294
+ delegatesFocus: !!(cmpMeta.$flags$ & 16 /* shadowDelegatesFocus */),
2295
+ });
2296
+ }
2297
+ else {
2298
+ this.attachShadow({ mode: 'open' });
2299
+ }
2300
+ }
2301
+ else {
2302
+ this.shadowRoot = this;
2303
+ }
2304
+ },
2282
2305
  });
2283
2306
  Cstr.is = cmpMeta.$tagName$;
2284
2307
  return proxyComponent(Cstr, cmpMeta, 1 /* isElementConstructor */ | 2 /* proxyState */);
@@ -2305,14 +2328,6 @@ const forceModeUpdate = (elm) => {
2305
2328
  }
2306
2329
  }
2307
2330
  };
2308
- const attachShadow = (el) => {
2309
- if (supportsShadow) {
2310
- el.attachShadow({ mode: 'open' });
2311
- }
2312
- else {
2313
- el.shadowRoot = el;
2314
- }
2315
- };
2316
2331
  const hmrStart = (elm, cmpMeta, hmrVersionId) => {
2317
2332
  // ¯\_(ツ)_/¯
2318
2333
  const hostRef = getHostRef(elm);
@@ -2542,102 +2557,104 @@ const bootstrapLazy = (lazyBundles, options = {}) => {
2542
2557
  registerStyle(styles[i].getAttribute(HYDRATED_STYLE_ID), convertScopedToShadow(styles[i].innerHTML), true);
2543
2558
  }
2544
2559
  }
2545
- lazyBundles.map((lazyBundle) => lazyBundle[1].map((compactMeta) => {
2546
- const cmpMeta = {
2547
- $flags$: compactMeta[0],
2548
- $tagName$: compactMeta[1],
2549
- $members$: compactMeta[2],
2550
- $listeners$: compactMeta[3],
2551
- };
2552
- if (BUILD.member) {
2553
- cmpMeta.$members$ = compactMeta[2];
2554
- }
2555
- if (BUILD.hostListener) {
2556
- cmpMeta.$listeners$ = compactMeta[3];
2557
- }
2558
- if (BUILD.reflect) {
2559
- cmpMeta.$attrsToReflect$ = [];
2560
- }
2561
- if (BUILD.watchCallback) {
2562
- cmpMeta.$watchers$ = {};
2563
- }
2564
- if (BUILD.shadowDom && !supportsShadow && cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) {
2565
- cmpMeta.$flags$ |= 8 /* needsShadowDomShim */;
2566
- }
2567
- const tagName = BUILD.transformTagName && options.transformTagName
2568
- ? options.transformTagName(cmpMeta.$tagName$)
2569
- : cmpMeta.$tagName$;
2570
- const HostElement = class extends HTMLElement {
2571
- // StencilLazyHost
2572
- constructor(self) {
2573
- // @ts-ignore
2574
- super(self);
2575
- self = this;
2576
- registerHost(self, cmpMeta);
2577
- if (BUILD.shadowDom && cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) {
2578
- // this component is using shadow dom
2579
- // and this browser supports shadow dom
2580
- // add the read-only property "shadowRoot" to the host element
2581
- // adding the shadow root build conditionals to minimize runtime
2582
- if (supportsShadow) {
2583
- if (BUILD.shadowDelegatesFocus) {
2584
- self.attachShadow({
2585
- mode: 'open',
2586
- delegatesFocus: !!(cmpMeta.$flags$ & 16 /* shadowDelegatesFocus */),
2587
- });
2560
+ lazyBundles.map((lazyBundle) => {
2561
+ lazyBundle[1].map((compactMeta) => {
2562
+ const cmpMeta = {
2563
+ $flags$: compactMeta[0],
2564
+ $tagName$: compactMeta[1],
2565
+ $members$: compactMeta[2],
2566
+ $listeners$: compactMeta[3],
2567
+ };
2568
+ if (BUILD.member) {
2569
+ cmpMeta.$members$ = compactMeta[2];
2570
+ }
2571
+ if (BUILD.hostListener) {
2572
+ cmpMeta.$listeners$ = compactMeta[3];
2573
+ }
2574
+ if (BUILD.reflect) {
2575
+ cmpMeta.$attrsToReflect$ = [];
2576
+ }
2577
+ if (BUILD.watchCallback) {
2578
+ cmpMeta.$watchers$ = {};
2579
+ }
2580
+ if (BUILD.shadowDom && !supportsShadow && cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) {
2581
+ cmpMeta.$flags$ |= 8 /* needsShadowDomShim */;
2582
+ }
2583
+ const tagName = BUILD.transformTagName && options.transformTagName
2584
+ ? options.transformTagName(cmpMeta.$tagName$)
2585
+ : cmpMeta.$tagName$;
2586
+ const HostElement = class extends HTMLElement {
2587
+ // StencilLazyHost
2588
+ constructor(self) {
2589
+ // @ts-ignore
2590
+ super(self);
2591
+ self = this;
2592
+ registerHost(self, cmpMeta);
2593
+ if (BUILD.shadowDom && cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) {
2594
+ // this component is using shadow dom
2595
+ // and this browser supports shadow dom
2596
+ // add the read-only property "shadowRoot" to the host element
2597
+ // adding the shadow root build conditionals to minimize runtime
2598
+ if (supportsShadow) {
2599
+ if (BUILD.shadowDelegatesFocus) {
2600
+ self.attachShadow({
2601
+ mode: 'open',
2602
+ delegatesFocus: !!(cmpMeta.$flags$ & 16 /* shadowDelegatesFocus */),
2603
+ });
2604
+ }
2605
+ else {
2606
+ self.attachShadow({ mode: 'open' });
2607
+ }
2588
2608
  }
2589
- else {
2590
- self.attachShadow({ mode: 'open' });
2609
+ else if (!BUILD.hydrateServerSide && !('shadowRoot' in self)) {
2610
+ self.shadowRoot = self;
2591
2611
  }
2592
2612
  }
2593
- else if (!BUILD.hydrateServerSide && !('shadowRoot' in self)) {
2594
- self.shadowRoot = self;
2613
+ if (BUILD.slotChildNodesFix) {
2614
+ patchChildSlotNodes(self, cmpMeta);
2595
2615
  }
2596
2616
  }
2597
- if (BUILD.slotChildNodesFix) {
2598
- patchChildSlotNodes(self, cmpMeta);
2599
- }
2600
- }
2601
- connectedCallback() {
2602
- if (appLoadFallback) {
2603
- clearTimeout(appLoadFallback);
2604
- appLoadFallback = null;
2617
+ connectedCallback() {
2618
+ if (appLoadFallback) {
2619
+ clearTimeout(appLoadFallback);
2620
+ appLoadFallback = null;
2621
+ }
2622
+ if (isBootstrapping) {
2623
+ // connectedCallback will be processed once all components have been registered
2624
+ deferredConnectedCallbacks.push(this);
2625
+ }
2626
+ else {
2627
+ plt.jmp(() => connectedCallback(this));
2628
+ }
2605
2629
  }
2606
- if (isBootstrapping) {
2607
- // connectedCallback will be processed once all components have been registered
2608
- deferredConnectedCallbacks.push(this);
2630
+ disconnectedCallback() {
2631
+ plt.jmp(() => disconnectedCallback(this));
2609
2632
  }
2610
- else {
2611
- plt.jmp(() => connectedCallback(this));
2633
+ componentOnReady() {
2634
+ return getHostRef(this).$onReadyPromise$;
2612
2635
  }
2636
+ };
2637
+ if (BUILD.cloneNodeFix) {
2638
+ patchCloneNode(HostElement.prototype);
2613
2639
  }
2614
- disconnectedCallback() {
2615
- plt.jmp(() => disconnectedCallback(this));
2640
+ if (BUILD.appendChildSlotFix) {
2641
+ patchSlotAppendChild(HostElement.prototype);
2616
2642
  }
2617
- componentOnReady() {
2618
- return getHostRef(this).$onReadyPromise$;
2643
+ if (BUILD.hotModuleReplacement) {
2644
+ HostElement.prototype['s-hmr'] = function (hmrVersionId) {
2645
+ hmrStart(this, cmpMeta, hmrVersionId);
2646
+ };
2619
2647
  }
2620
- };
2621
- if (BUILD.cloneNodeFix) {
2622
- patchCloneNode(HostElement.prototype);
2623
- }
2624
- if (BUILD.appendChildSlotFix) {
2625
- patchSlotAppendChild(HostElement.prototype);
2626
- }
2627
- if (BUILD.hotModuleReplacement) {
2628
- HostElement.prototype['s-hmr'] = function (hmrVersionId) {
2629
- hmrStart(this, cmpMeta, hmrVersionId);
2630
- };
2631
- }
2632
- if (BUILD.scopedSlotTextContentFix) {
2633
- patchTextContent(HostElement.prototype, cmpMeta);
2634
- }
2635
- cmpMeta.$lazyBundleId$ = lazyBundle[0];
2636
- if (!exclude.includes(tagName) && !customElements.get(tagName)) {
2637
- cmpTags.push(tagName);
2638
- customElements.define(tagName, proxyComponent(HostElement, cmpMeta, 1 /* isElementConstructor */));
2639
- }
2640
- }));
2648
+ if (BUILD.scopedSlotTextContentFix) {
2649
+ patchTextContent(HostElement.prototype, cmpMeta);
2650
+ }
2651
+ cmpMeta.$lazyBundleId$ = lazyBundle[0];
2652
+ if (!exclude.includes(tagName) && !customElements.get(tagName)) {
2653
+ cmpTags.push(tagName);
2654
+ customElements.define(tagName, proxyComponent(HostElement, cmpMeta, 1 /* isElementConstructor */));
2655
+ }
2656
+ });
2657
+ });
2641
2658
  if (BUILD.invisiblePrehydration && (BUILD.hydratedClass || BUILD.hydratedAttribute)) {
2642
2659
  visibilityStyle.innerHTML = cmpTags + HYDRATED_CSS;
2643
2660
  visibilityStyle.setAttribute('data-styles', '');
@@ -3007,4 +3024,4 @@ const Build = {
3007
3024
  isTesting: BUILD.isTesting ? true : false,
3008
3025
  };
3009
3026
  export { BUILD, Env, NAMESPACE } from '@stencil/core/internal/app-data';
3010
- export { Build, CSS, Context, Fragment, H, H as HTMLElement, Host, STENCIL_DEV_MODE, addHostEventListeners, attachShadow, bootstrapLazy, cmpModules, connectedCallback, consoleDevError, consoleDevInfo, consoleDevWarn, consoleError, createEvent, defineCustomElement, disconnectedCallback, doc, forceModeUpdate, forceUpdate, getAssetPath, getConnect, getContext, getElement, getHostRef, getMode, getRenderingRef, getValue, h, insertVdomAnnotations, isMemberInElement, loadModule, modeResolutionChain, nextTick, parsePropertyValue, plt, postUpdateComponent, promiseResolve, proxyComponent, proxyCustomElement, readTask, registerHost, registerInstance, renderVdom, setAssetPath, setErrorHandler, setMode, setPlatformHelpers, setPlatformOptions, setValue, styles, supportsConstructibleStylesheets, supportsListenerOptions, supportsShadow, win, writeTask };
3027
+ export { Build, CSS, Context, Fragment, H, H as HTMLElement, Host, STENCIL_DEV_MODE, addHostEventListeners, bootstrapLazy, cmpModules, connectedCallback, consoleDevError, consoleDevInfo, consoleDevWarn, consoleError, createEvent, defineCustomElement, disconnectedCallback, doc, forceModeUpdate, forceUpdate, getAssetPath, getConnect, getContext, getElement, getHostRef, getMode, getRenderingRef, getValue, h, insertVdomAnnotations, isMemberInElement, loadModule, modeResolutionChain, nextTick, parsePropertyValue, plt, postUpdateComponent, promiseResolve, proxyComponent, proxyCustomElement, readTask, registerHost, registerInstance, renderVdom, setAssetPath, setErrorHandler, setMode, setPlatformHelpers, setPlatformOptions, setValue, styles, supportsConstructibleStylesheets, supportsListenerOptions, supportsShadow, win, writeTask };
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stencil/core/internal/client",
3
- "version": "2.9.0",
3
+ "version": "2.12.0",
4
4
  "description": "Stencil internal client platform to be imported by the Stencil Compiler and internal runtime. Breaking changes can and will happen at any time.",
5
5
  "main": "./index.js",
6
6
  "private": true,
@@ -1,5 +1,5 @@
1
1
  /*
2
- Stencil Client Patch Browser v2.9.0 | MIT Licensed | https://stenciljs.com
2
+ Stencil Client Patch Browser v2.12.0 | MIT Licensed | https://stenciljs.com
3
3
  */
4
4
  import { BUILD, NAMESPACE } from '@stencil/core/internal/app-data';
5
5
  import { consoleDevInfo, plt, win, doc, promiseResolve, H } from '@stencil/core';
@@ -1,5 +1,5 @@
1
1
  /*
2
- Stencil Client Patch Esm v2.9.0 | MIT Licensed | https://stenciljs.com
2
+ Stencil Client Patch Esm v2.12.0 | MIT Licensed | https://stenciljs.com
3
3
  */
4
4
  import { BUILD } from '@stencil/core/internal/app-data';
5
5
  import { CSS, plt, win, promiseResolve } from '@stencil/core';
@@ -1,5 +1,5 @@
1
1
  /*
2
- Stencil Client Platform v2.9.0 | MIT Licensed | https://stenciljs.com
2
+ Stencil Client Platform v2.12.0 | MIT Licensed | https://stenciljs.com
3
3
  */
4
4
  /**
5
5
  * @license
@@ -67,6 +67,7 @@ const extractCommentsWithHash = (input) => {
67
67
  };
68
68
  const _ruleRe = /(\s*)([^;\{\}]+?)(\s*)((?:{%BLOCK%}?\s*;?)|(?:\s*;))/g;
69
69
  const _curlyRe = /([{}])/g;
70
+ const _selectorPartsRe = /(^.*?[^\\])??((:+)(.*)|$)/;
70
71
  const OPEN_CURLY = '{';
71
72
  const CLOSE_CURLY = '}';
72
73
  const BLOCK_PLACEHOLDER = '%BLOCK%';
@@ -219,17 +220,18 @@ const selectorNeedsScoping = (selector, scopeSelector) => {
219
220
  const re = makeScopeMatcher(scopeSelector);
220
221
  return !re.test(selector);
221
222
  };
223
+ const injectScopingSelector = (selector, scopingSelector) => {
224
+ return selector.replace(_selectorPartsRe, (_, before = '', _colonGroup, colon = '', after = '') => {
225
+ return before + scopingSelector + colon + after;
226
+ });
227
+ };
222
228
  const applySimpleSelectorScope = (selector, scopeSelector, hostSelector) => {
223
229
  // In Android browser, the lastIndex is not reset when the regex is used in String.replace()
224
230
  _polyfillHostRe.lastIndex = 0;
225
231
  if (_polyfillHostRe.test(selector)) {
226
232
  const replaceBy = `.${hostSelector}`;
227
233
  return selector
228
- .replace(_polyfillHostNoCombinatorRe, (_, selector) => {
229
- return selector.replace(/([^:]*)(:*)(.*)/, (_, before, colon, after) => {
230
- return before + replaceBy + colon + after;
231
- });
232
- })
234
+ .replace(_polyfillHostNoCombinatorRe, (_, selector) => injectScopingSelector(selector, replaceBy))
233
235
  .replace(_polyfillHostRe, replaceBy + ' ');
234
236
  }
235
237
  return scopeSelector + ' ' + selector;
@@ -250,10 +252,7 @@ const applyStrictSelectorScope = (selector, scopeSelector, hostSelector) => {
250
252
  // remove :host since it should be unnecessary
251
253
  const t = p.replace(_polyfillHostRe, '');
252
254
  if (t.length > 0) {
253
- const matches = t.match(/([^:]*)(:*)(.*)/);
254
- if (matches) {
255
- scopedP = matches[1] + className + matches[2] + matches[3];
256
- }
255
+ scopedP = injectScopingSelector(t, className);
257
256
  }
258
257
  }
259
258
  return scopedP;
@@ -639,7 +639,8 @@ const callRender = (e, t, o) => {
639
639
  s.attributeChangedCallback = function(e, t, n) {
640
640
  plt.jmp((() => {
641
641
  const t = o.get(e);
642
- this.hasOwnProperty(t) && (n = this[t], delete this[t]), this[t] = (null !== n || "boolean" != typeof this[t]) && n;
642
+ if (this.hasOwnProperty(t)) n = this[t], delete this[t]; else if (s.hasOwnProperty(t) && "number" == typeof this[t] && this[t] == n) return;
643
+ this[t] = (null !== n || "boolean" != typeof this[t]) && n;
643
644
  }));
644
645
  }, e.observedAttributes = n.filter((([e, t]) => 15 & t[0])).map((([e, n]) => {
645
646
  const s = n[1] || e;
@@ -759,6 +760,9 @@ const callRender = (e, t, o) => {
759
760
  },
760
761
  disconnectedCallback() {
761
762
  disconnectedCallback(this), BUILD.disconnectedCallback && s && s.call(this);
763
+ },
764
+ __attachShadow() {
765
+ this.shadowRoot = this;
762
766
  }
763
767
  }), e.is = o.$tagName$, proxyComponent(e, o, 3);
764
768
  }, forceModeUpdate = e => {
@@ -770,8 +774,6 @@ const callRender = (e, t, o) => {
770
774
  attachStyles(o), forceUpdate$1(e));
771
775
  }
772
776
  }
773
- }, attachShadow = e => {
774
- e.shadowRoot = e;
775
777
  }, patchCloneNode = e => {
776
778
  const t = e.cloneNode;
777
779
  e.cloneNode = function(e) {
@@ -906,42 +908,44 @@ const callRender = (e, t, o) => {
906
908
  if (Object.assign(plt, t), plt.$resourcesUrl$ = new URL(t.resourcesUrl || "./", doc.baseURI).href,
907
909
  BUILD.asyncQueue && t.syncQueue && (plt.$flags$ |= 4), BUILD.hydrateClientSide && (plt.$flags$ |= 2),
908
910
  BUILD.hydrateClientSide && BUILD.shadowDom) for (;p < c.length; p++) registerStyle(c[p].getAttribute("sty-id"), c[p].innerHTML.replace(/\/\*!@([^\/]+)\*\/[^\{]+\{/g, "$1{"));
909
- e.map((e => e[1].map((o => {
910
- const a = {
911
- $flags$: o[0],
912
- $tagName$: o[1],
913
- $members$: o[2],
914
- $listeners$: o[3]
915
- };
916
- BUILD.member && (a.$members$ = o[2]), BUILD.hostListener && (a.$listeners$ = o[3]),
917
- BUILD.reflect && (a.$attrsToReflect$ = []), BUILD.watchCallback && (a.$watchers$ = {}),
918
- BUILD.shadowDom && !supportsShadow && 1 & a.$flags$ && (a.$flags$ |= 8);
919
- const r = BUILD.transformTagName && t.transformTagName ? t.transformTagName(a.$tagName$) : a.$tagName$, i = class extends HTMLElement {
920
- constructor(e) {
921
- super(e), registerHost(e = this, a), BUILD.shadowDom && 1 & a.$flags$ && (BUILD.hydrateServerSide || "shadowRoot" in e || (e.shadowRoot = e)),
922
- BUILD.slotChildNodesFix && patchChildSlotNodes(e, a);
923
- }
924
- connectedCallback() {
925
- $ && (clearTimeout($), $ = null), m ? d.push(this) : plt.jmp((() => connectedCallback(this)));
926
- }
927
- disconnectedCallback() {
928
- plt.jmp((() => disconnectedCallback(this)));
929
- }
930
- componentOnReady() {
931
- return getHostRef(this).$onReadyPromise$;
932
- }
933
- };
934
- BUILD.cloneNodeFix && patchCloneNode(i.prototype), BUILD.appendChildSlotFix && patchSlotAppendChild(i.prototype),
935
- BUILD.hotModuleReplacement && (i.prototype["s-hmr"] = function(e) {
936
- ((e, t, o) => {
937
- const n = getHostRef(e);
938
- n.$flags$ = 1, e["s-hmr-load"] = () => {
939
- delete e["s-hmr-load"];
940
- }, initializeComponent(e, n, t);
941
- })(this, a);
942
- }), BUILD.scopedSlotTextContentFix && patchTextContent(i.prototype, a), a.$lazyBundleId$ = e[0],
943
- s.includes(r) || l.get(r) || (n.push(r), l.define(r, proxyComponent(i, a, 1)));
944
- })))), BUILD.invisiblePrehydration && (BUILD.hydratedClass || BUILD.hydratedAttribute) && (i.innerHTML = n + "{visibility:hidden}.hydrated{visibility:inherit}",
911
+ e.map((e => {
912
+ e[1].map((o => {
913
+ const a = {
914
+ $flags$: o[0],
915
+ $tagName$: o[1],
916
+ $members$: o[2],
917
+ $listeners$: o[3]
918
+ };
919
+ BUILD.member && (a.$members$ = o[2]), BUILD.hostListener && (a.$listeners$ = o[3]),
920
+ BUILD.reflect && (a.$attrsToReflect$ = []), BUILD.watchCallback && (a.$watchers$ = {}),
921
+ BUILD.shadowDom && !supportsShadow && 1 & a.$flags$ && (a.$flags$ |= 8);
922
+ const r = BUILD.transformTagName && t.transformTagName ? t.transformTagName(a.$tagName$) : a.$tagName$, i = class extends HTMLElement {
923
+ constructor(e) {
924
+ super(e), registerHost(e = this, a), BUILD.shadowDom && 1 & a.$flags$ && (BUILD.hydrateServerSide || "shadowRoot" in e || (e.shadowRoot = e)),
925
+ BUILD.slotChildNodesFix && patchChildSlotNodes(e, a);
926
+ }
927
+ connectedCallback() {
928
+ $ && (clearTimeout($), $ = null), m ? d.push(this) : plt.jmp((() => connectedCallback(this)));
929
+ }
930
+ disconnectedCallback() {
931
+ plt.jmp((() => disconnectedCallback(this)));
932
+ }
933
+ componentOnReady() {
934
+ return getHostRef(this).$onReadyPromise$;
935
+ }
936
+ };
937
+ BUILD.cloneNodeFix && patchCloneNode(i.prototype), BUILD.appendChildSlotFix && patchSlotAppendChild(i.prototype),
938
+ BUILD.hotModuleReplacement && (i.prototype["s-hmr"] = function(e) {
939
+ ((e, t, o) => {
940
+ const n = getHostRef(e);
941
+ n.$flags$ = 1, e["s-hmr-load"] = () => {
942
+ delete e["s-hmr-load"];
943
+ }, initializeComponent(e, n, t);
944
+ })(this, a);
945
+ }), BUILD.scopedSlotTextContentFix && patchTextContent(i.prototype, a), a.$lazyBundleId$ = e[0],
946
+ s.includes(r) || l.get(r) || (n.push(r), l.define(r, proxyComponent(i, a, 1)));
947
+ }));
948
+ })), BUILD.invisiblePrehydration && (BUILD.hydratedClass || BUILD.hydratedAttribute) && (i.innerHTML = n + "{visibility:hidden}.hydrated{visibility:inherit}",
945
949
  i.setAttribute("data-styles", ""), a.insertBefore(i, r ? r.nextSibling : a.firstChild)),
946
950
  m = !1, d.length ? d.map((e => e.connectedCallback())) : BUILD.profile ? plt.jmp((() => $ = setTimeout(appDidLoad, 30, "timeout"))) : plt.jmp((() => $ = setTimeout(appDidLoad, 30))),
947
951
  o();
@@ -1117,4 +1121,4 @@ const cmpModules = new Map, getModule = e => {
1117
1121
  isTesting: !1
1118
1122
  }, styles = new Map, modeResolutionChain = [];
1119
1123
 
1120
- export { Build, Context, Fragment, Host, addHostEventListeners, attachShadow, bootstrapLazy, cmpModules, connectedCallback, consoleDevError, consoleDevInfo, consoleDevWarn, consoleError, createEvent, defineCustomElement, disconnectedCallback, doc, forceModeUpdate, forceUpdate$1 as forceUpdate, getAssetPath, getConnect, getContext, getElement, getHostRef, getMode, getRenderingRef, getValue, hAsync as h, hydrateApp, insertVdomAnnotations, isMemberInElement, loadModule, modeResolutionChain, nextTick, parsePropertyValue, plt, postUpdateComponent, proxyComponent, proxyCustomElement, readTask, registerComponents, registerHost, registerInstance, renderVdom, setAssetPath, setErrorHandler, setMode, setPlatformHelpers, setValue, styles, supportsConstructibleStylesheets, supportsListenerOptions, supportsShadow, win, writeTask };
1124
+ export { Build, Context, Fragment, Host, addHostEventListeners, bootstrapLazy, cmpModules, connectedCallback, consoleDevError, consoleDevInfo, consoleDevWarn, consoleError, createEvent, defineCustomElement, disconnectedCallback, doc, forceModeUpdate, forceUpdate$1 as forceUpdate, getAssetPath, getConnect, getContext, getElement, getHostRef, getMode, getRenderingRef, getValue, hAsync as h, hydrateApp, insertVdomAnnotations, isMemberInElement, loadModule, modeResolutionChain, nextTick, parsePropertyValue, plt, postUpdateComponent, proxyComponent, proxyCustomElement, readTask, registerComponents, registerHost, registerInstance, renderVdom, setAssetPath, setErrorHandler, setMode, setPlatformHelpers, setValue, styles, supportsConstructibleStylesheets, supportsListenerOptions, supportsShadow, win, writeTask };
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stencil/core/internal/hydrate",
3
- "version": "2.9.0",
3
+ "version": "2.12.0",
4
4
  "description": "Stencil internal hydrate platform to be imported by the Stencil Compiler. Breaking changes can and will happen at any time.",
5
5
  "main": "./index.js",
6
6
  "private": true