@arcgis/lumina 4.32.0-next.11 → 4.32.0-next.13

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 (2) hide show
  1. package/dist/index.js +18 -4
  2. package/package.json +3 -3
package/dist/index.js CHANGED
@@ -331,7 +331,7 @@ var ProxyComponent = class extends HtmlElement {
331
331
  }
332
332
  connectedCallback() {
333
333
  if (this._litElement) {
334
- this._litElement.connectedCallback();
334
+ this._litElement.connectedCallback?.();
335
335
  } else {
336
336
  queueMicrotask(() => {
337
337
  this._ancestorLoad = attachToAncestor(this);
@@ -339,7 +339,7 @@ var ProxyComponent = class extends HtmlElement {
339
339
  }
340
340
  }
341
341
  disconnectedCallback() {
342
- this._litElement?.disconnectedCallback();
342
+ this._litElement?.disconnectedCallback?.();
343
343
  }
344
344
  /**
345
345
  * Create a promise that resolves once component is fully loaded
@@ -483,6 +483,21 @@ function handleHmrUpdate(newModules) {
483
483
  }
484
484
  function reInitialize(instance, newModule) {
485
485
  const PreviousLitConstructor = instance._litElement.constructor;
486
+ const isShadowRoot = PreviousLitConstructor.shadowRootOptions !== noShadowRoot;
487
+ if (!isShadowRoot) {
488
+ const root = instance.getRootNode() ?? document;
489
+ if ("adoptedStyleSheets" in root) {
490
+ const rootStyles = Array.from(root.adoptedStyleSheets);
491
+ PreviousLitConstructor.elementStyles.forEach((style) => {
492
+ const styleSheet = "styleSheet" in style ? style.styleSheet : style;
493
+ const index = rootStyles.lastIndexOf(styleSheet);
494
+ if (index > -1) {
495
+ rootStyles.splice(index, 1);
496
+ }
497
+ });
498
+ root.adoptedStyleSheets = rootStyles;
499
+ }
500
+ }
486
501
  const properties = PreviousLitConstructor.elementProperties;
487
502
  const preservedProperties = Array.from(properties.entries()).filter(
488
503
  ([propertyName, descriptor]) => typeof propertyName === "string" && (instance._hmrSetProps.has(propertyName) || typeof descriptor.attribute === "string" && instance._hmrSetAttributes.has(descriptor.attribute))
@@ -609,8 +624,7 @@ var LitElement = class _LitElement extends OriginalLitElement {
609
624
  styles = styles.filter(Boolean);
610
625
  }
611
626
  const finalizedStyles = super.finalizeStyles(styles);
612
- const options = this.constructor.shadowRootOptions;
613
- const useLightDom = options === noShadowRoot;
627
+ const useLightDom = this.shadowRootOptions === noShadowRoot;
614
628
  return this.runtime?.commonStyles === void 0 || useLightDom ? finalizedStyles : [this.runtime.commonStyles, ...finalizedStyles];
615
629
  }
616
630
  static createProperty(name, options) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arcgis/lumina",
3
- "version": "4.32.0-next.11",
3
+ "version": "4.32.0-next.13",
4
4
  "type": "module",
5
5
  "main": "dist/index.cjs",
6
6
  "module": "dist/index.js",
@@ -19,8 +19,8 @@
19
19
  ],
20
20
  "license": "SEE LICENSE IN LICENSE.md",
21
21
  "dependencies": {
22
- "@arcgis/components-controllers": "4.32.0-next.11",
23
- "@arcgis/components-utils": "4.32.0-next.11",
22
+ "@arcgis/components-controllers": "4.32.0-next.13",
23
+ "@arcgis/components-utils": "4.32.0-next.13",
24
24
  "@lit-labs/ssr": "^3.2.2",
25
25
  "@lit-labs/ssr-client": "^1.1.7",
26
26
  "csstype": "^3.1.3",