@arcgis/lumina 4.32.0-next.26 → 4.32.0-next.28

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.
@@ -5,7 +5,7 @@ import {
5
5
  } from "./chunk-PGHUBTOM.js";
6
6
 
7
7
  // src/lazyLoad.ts
8
- import { Deferred, camelToKebab } from "@arcgis/components-utils";
8
+ import { Deferred, camelToKebab, isEsriInternalEnv } from "@arcgis/components-utils";
9
9
 
10
10
  // src/devOnlyDetectIncorrectLazyUsages.ts
11
11
  function devOnlyDetectIncorrectLazyUsages(LitClass) {
@@ -148,7 +148,7 @@ var ProxyComponent = class extends HtmlElement {
148
148
  * Direct offspring that should be awaited before loaded() is emitted
149
149
  */
150
150
  this._offspring = [];
151
- if (process.env.NODE_ENV !== "production") {
151
+ if (typeof process === "object" && process.env.NODE_ENV !== "production" && isEsriInternalEnv()) {
152
152
  this._hmrSetProps = /* @__PURE__ */ new Set();
153
153
  this._hmrSetAttributes = /* @__PURE__ */ new Set();
154
154
  globalThis.devOnly$createdElements ??= [];
@@ -166,7 +166,7 @@ var ProxyComponent = class extends HtmlElement {
166
166
  });
167
167
  });
168
168
  }
169
- if (process.env.NODE_ENV !== "production") {
169
+ if (typeof process === "object" && process.env.NODE_ENV !== "production" && isEsriInternalEnv()) {
170
170
  ProxyClass._hmrInstances ??= [];
171
171
  ProxyClass._hmrInstances.push(new WeakRef(this));
172
172
  Object.defineProperty(this, "_store", {
@@ -194,7 +194,7 @@ var ProxyComponent = class extends HtmlElement {
194
194
  },
195
195
  set(value) {
196
196
  this._store[propName] = value;
197
- if (process.env.NODE_ENV !== "production") {
197
+ if (typeof process === "object" && process.env.NODE_ENV !== "production" && isEsriInternalEnv()) {
198
198
  this._hmrSetProps.add(propName);
199
199
  }
200
200
  }
@@ -215,7 +215,7 @@ var ProxyComponent = class extends HtmlElement {
215
215
  static _bindSync(methodName) {
216
216
  defineProperty(this.prototype, methodName, {
217
217
  value(...args) {
218
- if (process.env.NODE_ENV === "development" && !this._litElement) {
218
+ if (typeof process === "object" && process.env.NODE_ENV !== "production" && !this._litElement) {
219
219
  const ProxyClass = this.constructor;
220
220
  throw new Error(
221
221
  `Tried to call method ${methodName}() on <${ProxyClass._name}> component before it's fully loaded. Please do 'await component.componentOnReady();' before calling this method.`
@@ -276,7 +276,7 @@ var ProxyComponent = class extends HtmlElement {
276
276
  if (!this._litElement) {
277
277
  this._pendingAttributes.push(name);
278
278
  }
279
- if (process.env.NODE_ENV !== "production") {
279
+ if (typeof process === "object" && process.env.NODE_ENV !== "production" && isEsriInternalEnv()) {
280
280
  this._hmrSetAttributes.add(name);
281
281
  }
282
282
  }
@@ -304,7 +304,7 @@ var ProxyComponent = class extends HtmlElement {
304
304
  const ProxyClass = this.constructor;
305
305
  const tagName = ProxyClass._name;
306
306
  const store = this._store;
307
- if (process.env.NODE_ENV !== "production") {
307
+ if (typeof process === "object" && process.env.NODE_ENV !== "production" && isEsriInternalEnv()) {
308
308
  Object.entries(module).forEach(([name, LitConstructor2]) => {
309
309
  if (name !== "exportsForTests" && typeof LitConstructor2 !== "function" || typeof LitConstructor2.tagName !== "string") {
310
310
  console.warn(
@@ -316,12 +316,12 @@ var ProxyComponent = class extends HtmlElement {
316
316
  const LitConstructor = Object.values(module).find(
317
317
  (LitConstructor2) => LitConstructor2.tagName === tagName
318
318
  );
319
- if (process.env.NODE_ENV !== "production" && !LitConstructor) {
319
+ if (typeof process === "object" && process.env.NODE_ENV !== "production" && isEsriInternalEnv() && !LitConstructor) {
320
320
  throw new Error(
321
321
  `Unable to find the LitElement class for the "${tagName}" custom element in the lazy-loaded module`
322
322
  );
323
323
  }
324
- const lazyTagName = process.env.NODE_ENV === "production" ? `${tagName}--lazy` : (ProxyClass._hmrIndex ?? 0) === 0 ? `${tagName}--lazy` : `${tagName}--lazy-${ProxyClass._hmrIndex}`;
324
+ const lazyTagName = typeof process === "object" && process.env.NODE_ENV !== "production" && isEsriInternalEnv() ? (ProxyClass._hmrIndex ?? 0) === 0 ? `${tagName}--lazy` : `${tagName}--lazy-${ProxyClass._hmrIndex}` : `${tagName}--lazy`;
325
325
  let parentClass = LitConstructor;
326
326
  while (parentClass && !Object.hasOwn(parentClass, "lumina")) {
327
327
  parentClass = Object.getPrototypeOf(parentClass);
@@ -342,7 +342,7 @@ var ProxyComponent = class extends HtmlElement {
342
342
  }
343
343
  });
344
344
  }
345
- if (process.env.NODE_ENV !== "production") {
345
+ if (typeof process === "object" && process.env.NODE_ENV !== "production" && isEsriInternalEnv()) {
346
346
  devOnlyDetectIncorrectLazyUsages(parentClass);
347
347
  }
348
348
  const isFirstInitialization = !ProxyClass._LitConstructor;
@@ -353,7 +353,7 @@ var ProxyComponent = class extends HtmlElement {
353
353
  LitConstructor.lazy = this;
354
354
  const litElement = document.createElement(lazyTagName);
355
355
  LitConstructor.lazy = void 0;
356
- if (process.env.NODE_ENV !== "production") {
356
+ if (typeof process === "object" && process.env.NODE_ENV !== "production" && isEsriInternalEnv()) {
357
357
  Object.defineProperty(this, "_litElement", {
358
358
  value: litElement,
359
359
  configurable: true,
@@ -373,7 +373,7 @@ var ProxyComponent = class extends HtmlElement {
373
373
  );
374
374
  });
375
375
  Object.entries(store).forEach(syncLitElement, litElement);
376
- if (process.env.NODE_ENV !== "production") {
376
+ if (typeof process === "object" && process.env.NODE_ENV !== "production" && isEsriInternalEnv()) {
377
377
  const litObserved = LitConstructor.observedAttributes ?? [];
378
378
  const lazyObserved = ProxyClass.observedAttributes ?? [];
379
379
  const missingFromLazy = litObserved.filter((attribute) => !lazyObserved.includes(attribute));
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  ProxyComponent,
3
3
  noShadowRoot
4
- } from "./chunk-PEVP6JYY.js";
4
+ } from "./chunk-DNENDZQM.js";
5
5
  import "./chunk-PGHUBTOM.js";
6
6
 
7
7
  // src/hmrSupport.ts
package/dist/index.js CHANGED
@@ -2,7 +2,7 @@ import {
2
2
  attachToAncestor,
3
3
  makeDefineCustomElements,
4
4
  noShadowRoot
5
- } from "./chunk-PEVP6JYY.js";
5
+ } from "./chunk-DNENDZQM.js";
6
6
  import "./chunk-PGHUBTOM.js";
7
7
 
8
8
  // src/context.ts
@@ -23,17 +23,18 @@ function useContextConsumer(options) {
23
23
 
24
24
  // src/createEvent.ts
25
25
  import { retrieveComponent as retrieveComponent2, trackPropertyKey, keyTrackResolve } from "@arcgis/components-controllers";
26
+ import { isEsriInternalEnv } from "@arcgis/components-utils";
26
27
  var createEventFactory = (eventName = "", options = {}, component = retrieveComponent2()) => {
27
28
  const emitter = {
28
29
  emit: (payload) => {
29
- if (process.env.NODE_ENV !== "production" && !component.el.isConnected) {
30
+ if (typeof process === "object" && process.env.NODE_ENV !== "production" && isEsriInternalEnv() && !component.el.isConnected) {
30
31
  console.warn(
31
32
  `Trying to emit an ${eventName} event on a disconnected element ${component.el.tagName.toLowerCase()}`
32
33
  );
33
34
  }
34
35
  if (eventName === "") {
35
36
  keyTrackResolve();
36
- if (process.env.NODE_ENV !== "production" && eventName === "") {
37
+ if (typeof process === "object" && process.env.NODE_ENV !== "production" && isEsriInternalEnv() && eventName === "") {
37
38
  throw new Error("Unable to resolve event name from property name");
38
39
  }
39
40
  }
@@ -52,7 +53,7 @@ var createEventFactory = (eventName = "", options = {}, component = retrieveComp
52
53
  trackPropertyKey(
53
54
  component,
54
55
  (key) => {
55
- if (process.env.NODE_ENV !== "production" && key === void 0) {
56
+ if (typeof process === "object" && process.env.NODE_ENV !== "production" && isEsriInternalEnv() && key === void 0) {
56
57
  throw new Error(`createEvent must be called in property default value only`);
57
58
  }
58
59
  eventName = key;
@@ -71,7 +72,7 @@ var property = litProperty;
71
72
  var method = void 0;
72
73
 
73
74
  // src/LitElement.ts
74
- import { Deferred, camelToKebab } from "@arcgis/components-utils";
75
+ import { Deferred, camelToKebab, isEsriInternalEnv as isEsriInternalEnv2 } from "@arcgis/components-utils";
75
76
  import { LitElement as OriginalLitElement, isServer } from "lit";
76
77
  import { useControllerManager } from "@arcgis/components-controllers";
77
78
  var emptyFunction = () => void 0;
@@ -122,7 +123,7 @@ var LitElement = class _LitElement extends OriginalLitElement {
122
123
  this._originalShouldUpdate = this.shouldUpdate;
123
124
  this.shouldUpdate = ourShouldUpdate;
124
125
  }
125
- if (process.env.NODE_ENV !== "production") {
126
+ if (typeof process === "object" && process.env.NODE_ENV !== "production" && isEsriInternalEnv2()) {
126
127
  globalThis.devOnly$luminaComponentRefCallback?.(this);
127
128
  }
128
129
  if (isServer) {
@@ -133,7 +134,7 @@ var LitElement = class _LitElement extends OriginalLitElement {
133
134
  * Customize Lit's default style handling to support non-shadow-root styles
134
135
  */
135
136
  static finalizeStyles(styles) {
136
- if (process.env.NODE_ENV === "test" && Array.isArray(styles)) {
137
+ if (typeof process === "object" && process.env.NODE_ENV === "test" && Array.isArray(styles)) {
137
138
  styles = styles.filter(Boolean);
138
139
  }
139
140
  const finalizedStyles = super.finalizeStyles(styles);
@@ -213,7 +214,7 @@ var LitElement = class _LitElement extends OriginalLitElement {
213
214
  value: renderRoot
214
215
  });
215
216
  if (existingShadowRoot) {
216
- if (process.env.NODE_ENV === "production") {
217
+ if (typeof process !== "object" || process.env.NODE_ENV === "production") {
217
218
  OriginalLitElement.prototype.createRenderRoot.call(this);
218
219
  }
219
220
  return existingShadowRoot;
@@ -285,7 +286,7 @@ var LitElement = class _LitElement extends OriginalLitElement {
285
286
  }
286
287
  };
287
288
  LitElement.$createEvent = createEventFactory;
288
- if (process.env.NODE_ENV !== "production") {
289
+ if (typeof process === "object" && process.env.NODE_ENV !== "production" && isEsriInternalEnv2()) {
289
290
  const globalWithLit = globalThis;
290
291
  globalWithLit.litIssuedWarnings ??= /* @__PURE__ */ new Set();
291
292
  globalWithLit.litIssuedWarnings.add(
@@ -294,6 +295,7 @@ if (process.env.NODE_ENV !== "production") {
294
295
  }
295
296
 
296
297
  // src/runtime.ts
298
+ import { isEsriInternalEnv as isEsriInternalEnv3 } from "@arcgis/components-utils";
297
299
  function makeRuntime(options) {
298
300
  let assetPath;
299
301
  const setAssetPath = (path) => {
@@ -316,7 +318,7 @@ function makeRuntime(options) {
316
318
  }
317
319
  };
318
320
  setAssetPath(options.defaultAssetPath);
319
- if (process.env.NODE_ENV !== "production") {
321
+ if (typeof process === "object" && process.env.NODE_ENV !== "production" && isEsriInternalEnv3()) {
320
322
  globalThis.devOnly$luminaRuntime = runtime;
321
323
  }
322
324
  return runtime;
@@ -361,10 +363,10 @@ function createPrototypeProxy(tagName) {
361
363
  get prototype() {
362
364
  const customElementPrototype = customElements.get(tagName)?.prototype;
363
365
  if (!customElementPrototype) {
364
- if (process.env.NODE_ENV === "production") {
365
- throw new Error(`Custom element "${tagName}" not found`);
366
- } else {
366
+ if (typeof process === "object" && process.env.NODE_ENV !== "production") {
367
367
  return Object.create(HTMLElement.prototype);
368
+ } else {
369
+ throw new Error(`Custom element "${tagName}" not found`);
368
370
  }
369
371
  }
370
372
  Object.defineProperty(customElement, "prototype", { value: customElementPrototype });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arcgis/lumina",
3
- "version": "4.32.0-next.26",
3
+ "version": "4.32.0-next.28",
4
4
  "type": "module",
5
5
  "main": "dist/index.cjs",
6
6
  "module": "dist/index.js",
@@ -20,8 +20,8 @@
20
20
  ],
21
21
  "license": "SEE LICENSE IN LICENSE.md",
22
22
  "dependencies": {
23
- "@arcgis/components-controllers": "4.32.0-next.26",
24
- "@arcgis/components-utils": "4.32.0-next.26",
23
+ "@arcgis/components-controllers": "4.32.0-next.28",
24
+ "@arcgis/components-utils": "4.32.0-next.28",
25
25
  "@lit-labs/ssr": "^3.2.2",
26
26
  "@lit-labs/ssr-client": "^1.1.7",
27
27
  "@lit/context": "^1.1.3",