@arcgis/lumina 4.32.0-next.10 → 4.32.0-next.12

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.
@@ -2,9 +2,6 @@
2
2
  var lazyMetaGroupJoiner = ";";
3
3
  var lazyMetaItemJoiner = ",";
4
4
  var lazyMetaSubItemJoiner = ":";
5
- var defaultEventBubbles = true;
6
- var defaultEventCancelable = true;
7
- var defaultEventComposed = true;
8
5
  var PropertyFlags = /* @__PURE__ */ ((PropertyFlags2) => {
9
6
  PropertyFlags2[PropertyFlags2["ATTRIBUTE"] = 1] = "ATTRIBUTE";
10
7
  PropertyFlags2[PropertyFlags2["REFLECT"] = 2] = "REFLECT";
@@ -20,8 +17,5 @@ export {
20
17
  lazyMetaGroupJoiner,
21
18
  lazyMetaItemJoiner,
22
19
  lazyMetaSubItemJoiner,
23
- defaultEventBubbles,
24
- defaultEventCancelable,
25
- defaultEventComposed,
26
20
  PropertyFlags
27
21
  };
package/dist/config.d.ts CHANGED
@@ -6,14 +6,6 @@
6
6
  export declare const lazyMetaGroupJoiner = ";";
7
7
  export declare const lazyMetaItemJoiner = ",";
8
8
  export declare const lazyMetaSubItemJoiner = ":";
9
- /**
10
- * While these defaults don't match DOM defaults (all false), they match
11
- * Stencil and Shoelace defaults. Also, they make more sense for our
12
- * usage (i.e why would you want events to not be cancelable by default?)
13
- */
14
- export declare const defaultEventBubbles = true;
15
- export declare const defaultEventCancelable = true;
16
- export declare const defaultEventComposed = true;
17
9
  /**
18
10
  * By default in Lit, the `@property()` decorator accepts an object. However, to
19
11
  * keep the bundle size smaller, in production builds, instead of passing it an
package/dist/config.js CHANGED
@@ -1,17 +1,11 @@
1
1
  import {
2
2
  PropertyFlags,
3
- defaultEventBubbles,
4
- defaultEventCancelable,
5
- defaultEventComposed,
6
3
  lazyMetaGroupJoiner,
7
4
  lazyMetaItemJoiner,
8
5
  lazyMetaSubItemJoiner
9
- } from "./chunk-CH52Q2MB.js";
6
+ } from "./chunk-PGHUBTOM.js";
10
7
  export {
11
8
  PropertyFlags,
12
- defaultEventBubbles,
13
- defaultEventCancelable,
14
- defaultEventComposed,
15
9
  lazyMetaGroupJoiner,
16
10
  lazyMetaItemJoiner,
17
11
  lazyMetaSubItemJoiner
@@ -1,4 +1,9 @@
1
1
  import type { BaseComponent, EventEmitter } from "@arcgis/components-controllers";
2
+ /**
3
+ * While these defaults don't match DOM defaults (all false), they match
4
+ * Stencil and Shoelace defaults. Also, they make more sense for our
5
+ * usage (i.e why would you want events to not be cancelable by default?)
6
+ */
2
7
  export type EventOptions = {
3
8
  /**
4
9
  * A Boolean indicating whether the event bubbles up through the DOM or not.
package/dist/index.js CHANGED
@@ -1,11 +1,8 @@
1
1
  import {
2
- defaultEventBubbles,
3
- defaultEventCancelable,
4
- defaultEventComposed,
5
2
  lazyMetaGroupJoiner,
6
3
  lazyMetaItemJoiner,
7
4
  lazyMetaSubItemJoiner
8
- } from "./chunk-CH52Q2MB.js";
5
+ } from "./chunk-PGHUBTOM.js";
9
6
 
10
7
  // src/createEvent.ts
11
8
  import { retrieveComponent, trackPropertyKey, keyTrackResolve } from "@arcgis/components-controllers";
@@ -25,9 +22,9 @@ var createEventFactory = (eventName = "", options = {}, component = retrieveComp
25
22
  }
26
23
  const event = new CustomEvent(eventName, {
27
24
  detail: payload,
28
- cancelable: defaultEventCancelable,
29
- bubbles: defaultEventBubbles,
30
- composed: defaultEventComposed,
25
+ cancelable: true,
26
+ bubbles: true,
27
+ composed: true,
31
28
  ...options
32
29
  });
33
30
  component.el.dispatchEvent(event);
@@ -334,7 +331,7 @@ var ProxyComponent = class extends HtmlElement {
334
331
  }
335
332
  connectedCallback() {
336
333
  if (this._litElement) {
337
- this._litElement.connectedCallback();
334
+ this._litElement.connectedCallback?.();
338
335
  } else {
339
336
  queueMicrotask(() => {
340
337
  this._ancestorLoad = attachToAncestor(this);
@@ -342,7 +339,7 @@ var ProxyComponent = class extends HtmlElement {
342
339
  }
343
340
  }
344
341
  disconnectedCallback() {
345
- this._litElement?.disconnectedCallback();
342
+ this._litElement?.disconnectedCallback?.();
346
343
  }
347
344
  /**
348
345
  * Create a promise that resolves once component is fully loaded
@@ -486,6 +483,21 @@ function handleHmrUpdate(newModules) {
486
483
  }
487
484
  function reInitialize(instance, newModule) {
488
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
+ }
489
501
  const properties = PreviousLitConstructor.elementProperties;
490
502
  const preservedProperties = Array.from(properties.entries()).filter(
491
503
  ([propertyName, descriptor]) => typeof propertyName === "string" && (instance._hmrSetProps.has(propertyName) || typeof descriptor.attribute === "string" && instance._hmrSetAttributes.has(descriptor.attribute))
@@ -503,10 +515,11 @@ function handleComponentMetaUpdate(meta) {
503
515
  return;
504
516
  }
505
517
  const attributes = meta.properties.map(([property2, attribute]) => attribute ?? camelToKebab2(property2)).filter(Boolean);
518
+ const observedAttributes = initializeAttributeObserver();
506
519
  observedAttributes[meta.tagName] ??= {};
507
520
  observedAttributes[meta.tagName].original ??= new Set(ProxyClass.observedAttributes);
508
521
  const originallyObserved = observedAttributes[meta.tagName].original;
509
- observedAttributes[meta.tagName].manuallyObserved ??= new Set(
522
+ observedAttributes[meta.tagName].manuallyObserved = new Set(
510
523
  /**
511
524
  * Never manually observe attributes that were in the original
512
525
  * observedAttributes as those would be observed by the browser
@@ -518,27 +531,30 @@ function handleComponentMetaUpdate(meta) {
518
531
  ProxyClass._properties = meta.properties.map(([name]) => name);
519
532
  ProxyClass.observedAttributes = attributes;
520
533
  }
521
- var observedAttributesSymbol = Symbol.for("@arcgis/lumina:observedAttributes");
522
- var globalThisWithObservedAttributes = globalThis;
523
- var alreadyHadObservers = observedAttributesSymbol in globalThisWithObservedAttributes;
524
- globalThisWithObservedAttributes[observedAttributesSymbol] ??= {};
525
- var observedAttributes = globalThisWithObservedAttributes[observedAttributesSymbol];
526
- if (!alreadyHadObservers) {
527
- const makeObserver = (original) => function observeAttributes(qualifiedName, ...rest) {
528
- const observed = observedAttributes[this.tagName.toLowerCase()]?.manuallyObserved;
529
- if (observed?.has(qualifiedName)) {
530
- const oldValue = this.getAttribute(qualifiedName);
531
- const returns = original.call(this, qualifiedName, ...rest);
532
- const newValue = this.getAttribute(qualifiedName);
533
- this.attributeChangedCallback(qualifiedName, oldValue, newValue);
534
- return returns;
535
- } else {
536
- return original.call(this, qualifiedName, ...rest);
537
- }
538
- };
539
- ProxyComponent.prototype.setAttribute = makeObserver(ProxyComponent.prototype.setAttribute);
540
- ProxyComponent.prototype.toggleAttribute = makeObserver(ProxyComponent.prototype.toggleAttribute);
541
- ProxyComponent.prototype.removeAttribute = makeObserver(ProxyComponent.prototype.removeAttribute);
534
+ function initializeAttributeObserver() {
535
+ const observedAttributesSymbol = Symbol.for("@arcgis/lumina:observedAttributes");
536
+ const globalThisWithObservedAttributes = globalThis;
537
+ const alreadyHadObservers = observedAttributesSymbol in globalThisWithObservedAttributes;
538
+ globalThisWithObservedAttributes[observedAttributesSymbol] ??= {};
539
+ const observedAttributes = globalThisWithObservedAttributes[observedAttributesSymbol];
540
+ if (!alreadyHadObservers) {
541
+ const makeObserver = (original) => function observeAttributes(qualifiedName, ...rest) {
542
+ const observed = observedAttributes[this.tagName.toLowerCase()]?.manuallyObserved;
543
+ if (observed?.has(qualifiedName)) {
544
+ const oldValue = this.getAttribute(qualifiedName);
545
+ const returns = original.call(this, qualifiedName, ...rest);
546
+ const newValue = this.getAttribute(qualifiedName);
547
+ this.attributeChangedCallback(qualifiedName, oldValue, newValue);
548
+ return returns;
549
+ } else {
550
+ return original.call(this, qualifiedName, ...rest);
551
+ }
552
+ };
553
+ ProxyComponent.prototype.setAttribute = makeObserver(ProxyComponent.prototype.setAttribute);
554
+ ProxyComponent.prototype.toggleAttribute = makeObserver(ProxyComponent.prototype.toggleAttribute);
555
+ ProxyComponent.prototype.removeAttribute = makeObserver(ProxyComponent.prototype.removeAttribute);
556
+ }
557
+ return observedAttributes;
542
558
  }
543
559
 
544
560
  // src/LitElement.ts
@@ -608,8 +624,7 @@ var LitElement = class _LitElement extends OriginalLitElement {
608
624
  styles = styles.filter(Boolean);
609
625
  }
610
626
  const finalizedStyles = super.finalizeStyles(styles);
611
- const options = this.constructor.shadowRootOptions;
612
- const useLightDom = options === noShadowRoot;
627
+ const useLightDom = this.shadowRootOptions === noShadowRoot;
613
628
  return this.runtime?.commonStyles === void 0 || useLightDom ? finalizedStyles : [this.runtime.commonStyles, ...finalizedStyles];
614
629
  }
615
630
  static createProperty(name, options) {
package/dist/jsx/jsx.d.ts CHANGED
@@ -6,7 +6,6 @@
6
6
  * /// <reference types="@arcgis/lumina/typings" />
7
7
  * ```
8
8
  */
9
- /// <reference path="../typings/jsxGlobals.d.ts" />
10
9
  import type { Properties as CssProperties } from "csstype";
11
10
  import type { TemplateResult } from "lit-html";
12
11
  import type { DirectiveResult } from "lit-html/directive.js";
@@ -2,7 +2,6 @@
2
2
  * Lots of silencing of ESLint in this file to be compatible with Stencil's
3
3
  * unsafe typings.
4
4
  */
5
- /// <reference types="node" />
6
5
  import { type RenderInfo } from "@lit-labs/ssr/lib/render.js";
7
6
  import type { Readable } from "node:stream";
8
7
  /**
@@ -1,4 +1,4 @@
1
- /// <reference path="jsxGlobals.d.ts" />
2
- /// <reference path="loadLitCss.d.ts" />
3
- /// <reference path="viteEnv.d.ts" />
4
- /// <reference path="importMeta.d.ts" />
1
+ /// <reference path="jsxGlobals.d.ts" preserve="true" />
2
+ /// <reference path="loadLitCss.d.ts" preserve="true" />
3
+ /// <reference path="viteEnv.d.ts" preserve="true" />
4
+ /// <reference path="importMeta.d.ts" preserve="true" />
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arcgis/lumina",
3
- "version": "4.32.0-next.10",
3
+ "version": "4.32.0-next.12",
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.10",
23
- "@arcgis/components-utils": "4.32.0-next.10",
22
+ "@arcgis/components-controllers": "4.32.0-next.12",
23
+ "@arcgis/components-utils": "4.32.0-next.12",
24
24
  "@lit-labs/ssr": "^3.2.2",
25
25
  "@lit-labs/ssr-client": "^1.1.7",
26
26
  "csstype": "^3.1.3",