@arcgis/lumina 4.32.0-next.1 → 4.32.0-next.3

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.
package/dist/index.d.ts CHANGED
@@ -10,7 +10,7 @@ export type { PublicLitElement } from "./PublicLitElement";
10
10
  export type { Runtime, RuntimeOptions, DevOnlyGlobalRuntime, DevOnlyGlobalComponentRefCallback } from "./runtime";
11
11
  export { makeRuntime } from "./runtime";
12
12
  export * from "./jsx/jsx";
13
- export { safeClassMap, safeStyleMap, directive, dynamicValueDirective, live } from "./jsx/directives";
13
+ export { safeClassMap, safeStyleMap, directive, live } from "./jsx/directives";
14
14
  export { nothing, noChange, setAttribute, stringOrBoolean } from "./jsx/utils";
15
15
  export { noShadowRoot } from "./utils";
16
16
  export { createPrototypeProxy } from "./wrappersUtils";
package/dist/index.js CHANGED
@@ -8,19 +8,20 @@ import {
8
8
  } from "./chunk-CH52Q2MB.js";
9
9
 
10
10
  // src/createEvent.ts
11
- import { retrieveComponent, trackPropertyKey } from "@arcgis/components-controllers";
11
+ import { retrieveComponent, trackPropertyKey, keyTrackResolve } from "@arcgis/components-controllers";
12
12
  var createEventFactory = (eventName = "", options = {}, component = retrieveComponent()) => {
13
13
  const emitter = {
14
14
  emit: (payload) => {
15
- if (process.env.NODE_ENV !== "production") {
16
- if (eventName === "") {
15
+ if (process.env.NODE_ENV !== "production" && !component.el.isConnected) {
16
+ console.warn(
17
+ `Trying to emit an ${eventName} event on a disconnected element ${component.el.tagName.toLowerCase()}`
18
+ );
19
+ }
20
+ if (eventName === "") {
21
+ keyTrackResolve();
22
+ if (process.env.NODE_ENV !== "production" && eventName === "") {
17
23
  throw new Error("Unable to resolve event name from property name");
18
24
  }
19
- if (!component.el.isConnected) {
20
- console.warn(
21
- `Trying to emit an ${eventName} event on a disconnected element ${component.el.tagName.toLowerCase()}`
22
- );
23
- }
24
25
  }
25
26
  const event = new CustomEvent(eventName, {
26
27
  detail: payload,
@@ -211,8 +212,10 @@ var ProxyComponent = class extends HtmlElement {
211
212
  this._initializeComponent({ a: ProxyClass._LitConstructor });
212
213
  } else {
213
214
  void ProxyClass._loadPromise.then(this._initializeComponent.bind(this)).catch((error) => {
214
- console.error(error);
215
215
  this._postLoaded.reject(error);
216
+ setTimeout(() => {
217
+ throw error;
218
+ });
216
219
  });
217
220
  }
218
221
  if (process.env.NODE_ENV !== "production") {
@@ -654,8 +657,10 @@ var LitElement = class _LitElement extends OriginalLitElement {
654
657
  queueMicrotask(
655
658
  // eslint-disable-next-line @typescript-eslint/no-misused-promises, @typescript-eslint/promise-function-async
656
659
  () => this._load().catch((error) => {
657
- console.error(error);
658
660
  this._postLoaded.reject(error);
661
+ setTimeout(() => {
662
+ throw error;
663
+ });
659
664
  })
660
665
  );
661
666
  }
@@ -682,11 +687,13 @@ var LitElement = class _LitElement extends OriginalLitElement {
682
687
  }
683
688
  return existingShadowRoot;
684
689
  }
685
- const domRoot = renderRoot.getRootNode();
686
- domRoot.adoptedStyleSheets = [
687
- ...domRoot.adoptedStyleSheets,
688
- ...Class.elementStyles.map((stylesheet) => "styleSheet" in stylesheet ? stylesheet.styleSheet : stylesheet)
689
- ];
690
+ if (this.isConnected) {
691
+ const domRoot = renderRoot.getRootNode();
692
+ domRoot.adoptedStyleSheets = [
693
+ ...domRoot.adoptedStyleSheets,
694
+ ...Class.elementStyles.map((stylesheet) => "styleSheet" in stylesheet ? stylesheet.styleSheet : stylesheet)
695
+ ];
696
+ }
690
697
  return renderRoot;
691
698
  }
692
699
  /** Do asynchronous component load */
@@ -794,47 +801,11 @@ var bindEvent = void 0;
794
801
  // src/jsx/directives.ts
795
802
  import { classMap } from "lit-html/directives/class-map.js";
796
803
  import { styleMap } from "lit/directives/style-map.js";
797
- import { Directive } from "lit-html/directive.js";
798
804
  import { directive as litDirective } from "lit-html/directive.js";
799
805
  import { live as litLive } from "lit-html/directives/live.js";
800
806
  var safeClassMap = (parameters) => typeof parameters === "object" && parameters != null ? classMap(parameters) : parameters;
801
807
  var safeStyleMap = (parameters) => typeof parameters === "object" && parameters != null ? styleMap(parameters) : parameters;
802
808
  var directive = litDirective;
803
- var DynamicHtmlValueDirective = class extends Directive {
804
- update(part, [prop, value]) {
805
- if (process.env.NODE_ENV !== "production") {
806
- if (part.type !== 6) {
807
- throw new Error("DynamicHtmlValueDirective can only be used in the element part position");
808
- }
809
- if (prop !== "value" && prop !== "defaultValue") {
810
- throw new Error('Expected the first argument to DynamicHtmlValueDirective to be "value" or "defaultValue"');
811
- }
812
- if (typeof value === "object" && value != null) {
813
- if ("_$litDirective$" in value) {
814
- throw new Error(
815
- "Directive is not supported as a value for the `value` or `defaultValue` prop when the tag name is dynamic."
816
- );
817
- } else {
818
- throw new Error(
819
- `Tried to set an object as the value/defaultValue prop in a <${part.element.tagName}> element.`
820
- );
821
- }
822
- }
823
- }
824
- const element = part.element;
825
- const tagName = element.tagName;
826
- if (prop === "value" ? tagName === "INPUT" : tagName === "BUTTON" || tagName === "DATA") {
827
- if (element[prop] !== value) {
828
- element[prop] = value;
829
- }
830
- } else if (value != null) {
831
- element.setAttribute("value", value);
832
- } else {
833
- element.removeAttribute("value");
834
- }
835
- }
836
- };
837
- var dynamicValueDirective = directive(DynamicHtmlValueDirective);
838
809
  var live = litLive;
839
810
 
840
811
  // src/jsx/utils.ts
@@ -881,7 +852,6 @@ export {
881
852
  createEvent,
882
853
  createPrototypeProxy,
883
854
  directive,
884
- dynamicValueDirective,
885
855
  handleComponentMetaUpdate,
886
856
  handleHmrUpdate,
887
857
  live,
@@ -60,14 +60,6 @@ export declare const safeStyleMap: (parameters: CssProperties | Nil | string) =>
60
60
  * "never" to allow it be set as a value for any JSX attribute.
61
61
  */
62
62
  export declare const directive: <C extends DirectiveClass>(c: C) => (...values: Parameters<InstanceType<C>["render"]>) => never;
63
- /**
64
- * Do not import this directly. It will be inserted automatically by JSX to
65
- * lit-html transformer when you are setting "value" or "defaultValue" JSX prop
66
- * in an element with dynamic tag name.
67
- *
68
- * @internal
69
- */
70
- export declare const dynamicValueDirective: (...values: never) => never;
71
63
  /**
72
64
  * Checks binding values against live DOM values, instead of previously bound
73
65
  * values, when determining whether to update the value.
package/dist/jsx/jsx.d.ts CHANGED
@@ -1293,6 +1293,8 @@ export declare namespace LuminaJsx {
1293
1293
  form?: string;
1294
1294
  for?: string;
1295
1295
  name?: string;
1296
+ value?: string | number;
1297
+ defaultValue?: string | number;
1296
1298
  }
1297
1299
  interface ProgressHTMLAttributes<T> extends HTMLAttributes<T> {
1298
1300
  max?: number | string;
@@ -1862,7 +1864,7 @@ export declare namespace LuminaJsx {
1862
1864
  base: BaseHTMLAttributes<HTMLBaseElement>;
1863
1865
  bdi: HTMLAttributes;
1864
1866
  bdo: HTMLAttributes;
1865
- blockquote: BlockquoteHTMLAttributes<HTMLElement>;
1867
+ blockquote: BlockquoteHTMLAttributes<HTMLQuoteElement>;
1866
1868
  body: HTMLAttributes<HTMLBodyElement>;
1867
1869
  br: HTMLAttributes<HTMLBRElement>;
1868
1870
  button: ButtonHTMLAttributes<HTMLButtonElement>;
@@ -1872,7 +1874,7 @@ export declare namespace LuminaJsx {
1872
1874
  code: HTMLAttributes;
1873
1875
  col: ColHTMLAttributes<HTMLTableColElement>;
1874
1876
  colgroup: ColgroupHTMLAttributes<HTMLTableColElement>;
1875
- data: DataHTMLAttributes<HTMLElement>;
1877
+ data: DataHTMLAttributes<HTMLDataElement>;
1876
1878
  datalist: HTMLAttributes<HTMLDataListElement>;
1877
1879
  dd: HTMLAttributes;
1878
1880
  del: HTMLAttributes;
@@ -1914,16 +1916,16 @@ export declare namespace LuminaJsx {
1914
1916
  map: MapHTMLAttributes<HTMLMapElement>;
1915
1917
  math: MathMLAttributes;
1916
1918
  mark: HTMLAttributes;
1917
- menu: MenuHTMLAttributes<HTMLElement>;
1919
+ menu: MenuHTMLAttributes<HTMLMenuElement>;
1918
1920
  meta: MetaHTMLAttributes<HTMLMetaElement>;
1919
- meter: MeterHTMLAttributes<HTMLElement>;
1921
+ meter: MeterHTMLAttributes<HTMLMeterElement>;
1920
1922
  nav: HTMLAttributes;
1921
1923
  noscript: HTMLAttributes;
1922
1924
  object: ObjectHTMLAttributes<HTMLObjectElement>;
1923
1925
  ol: OlHTMLAttributes<HTMLOListElement>;
1924
1926
  optgroup: OptgroupHTMLAttributes<HTMLOptGroupElement>;
1925
1927
  option: OptionHTMLAttributes<HTMLOptionElement>;
1926
- output: OutputHTMLAttributes<HTMLElement>;
1928
+ output: OutputHTMLAttributes<HTMLOutputElement>;
1927
1929
  p: HTMLAttributes<HTMLParagraphElement>;
1928
1930
  picture: HTMLAttributes;
1929
1931
  pre: HTMLAttributes<HTMLPreElement>;
@@ -1961,7 +1963,7 @@ export declare namespace LuminaJsx {
1961
1963
  tfoot: HTMLAttributes<HTMLTableSectionElement>;
1962
1964
  th: ThHTMLAttributes<HTMLTableCellElement>;
1963
1965
  thead: HTMLAttributes<HTMLTableSectionElement>;
1964
- time: TimeHTMLAttributes<HTMLElement>;
1966
+ time: TimeHTMLAttributes<HTMLTimeElement>;
1965
1967
  title: HTMLAttributes<HTMLTitleElement>;
1966
1968
  tr: HTMLAttributes<HTMLTableRowElement>;
1967
1969
  track: TrackHTMLAttributes<HTMLTrackElement>;
@@ -1,4 +1,4 @@
1
- // src/stencil-ssr-compatibility/index.ts
1
+ // src/stencilSsrCompatibility/index.ts
2
2
  import { getWindow } from "@lit-labs/ssr/lib/dom-shim.js";
3
3
  import { render } from "@lit-labs/ssr/lib/render.js";
4
4
  import { html } from "@lit-labs/ssr/lib/server-template.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arcgis/lumina",
3
- "version": "4.32.0-next.1",
3
+ "version": "4.32.0-next.3",
4
4
  "type": "module",
5
5
  "main": "dist/index.cjs",
6
6
  "module": "dist/index.js",
@@ -8,7 +8,7 @@
8
8
  "exports": {
9
9
  ".": "./dist/index.js",
10
10
  "./config": "./dist/config.js",
11
- "./stencil-ssr-compatibility": "./dist/stencil-ssr-compatibility/index.js",
11
+ "./stencilSsrCompatibility": "./dist/stencilSsrCompatibility/index.js",
12
12
  "./typings": {
13
13
  "types": "./dist/typings/index.d.ts"
14
14
  },
@@ -29,21 +29,21 @@
29
29
  "clean": "rimraf ./dist ./build ./turbo ./node_modules"
30
30
  },
31
31
  "dependencies": {
32
- "@arcgis/components-controllers": "4.32.0-next.1",
33
- "@arcgis/components-utils": "4.32.0-next.1",
32
+ "@arcgis/components-controllers": "4.32.0-next.3",
33
+ "@arcgis/components-utils": "4.32.0-next.3",
34
34
  "@lit-labs/ssr": "^3.2.2",
35
35
  "@lit-labs/ssr-client": "^1.1.7",
36
36
  "csstype": "^3.1.3",
37
- "lit": "^3.1.2",
37
+ "lit": "^3.2.0",
38
38
  "tslib": "^2.7.0"
39
39
  },
40
40
  "devDependencies": {
41
- "@arcgis/typescript-config": "4.32.0-next.1",
41
+ "@arcgis/typescript-config": "4.32.0-next.3",
42
42
  "@types/node": "^20.2.5",
43
43
  "eslint": "^8.55.0",
44
44
  "rimraf": "^5.0.0",
45
45
  "tsup": "^8.3.0",
46
46
  "typescript": "~5.4.0"
47
47
  },
48
- "gitHead": "e5c61e5426551da5fa01c269b3b138133e620ca0"
48
+ "gitHead": "afc83258caec2a09162da0def77c2ff3867212c1"
49
49
  }