@arcgis/lumina 4.34.0-next.44 → 4.34.0-next.46

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,9 @@ import { default as Accessor } from '@arcgis/core/core/Accessor.js';
2
2
  /**
3
3
  * See https://qawebgis.esri.com/components/lumina/controllers/useAccessor#createstore-utility
4
4
  */
5
- export declare const createStore: <T extends Record<string, unknown>>(initializer: T | (() => T)) => __esri.Accessor & T;
5
+ export declare const createStore: <T extends object>(initializer: T | (() => T)) => __esri.Accessor & T;
6
6
  /** @deprecated Use {@link createStore} instead */
7
- export declare const createLegacyStore: <T extends Record<string, unknown>>(defaultState: T | (() => T)) => ObservableMap<T>;
7
+ export declare const createLegacyStore: <T extends object>(defaultState: T | (() => T)) => ObservableMap<T>;
8
8
  /** @deprecated Use {@link createStore} instead */
9
9
  export type ObservableMap<T> = {
10
10
  state: Accessor & T;
package/dist/index.d.ts CHANGED
@@ -1,4 +1,3 @@
1
- import { useContextProvider as useContextProviderImplementation, useContextConsumer as useContextConsumerImplementation } from './context';
2
1
  export type { EventEmitter, EventOptions } from './createEvent';
3
2
  export { createEvent } from './createEvent';
4
3
  export { state, property, method } from './decorators';
@@ -15,11 +14,3 @@ export { nothing, noChange, setAttribute, stringOrBoolean } from './jsx/utils';
15
14
  export { noShadowRoot, devOnly$getLitElementTagNameAndRuntime } from './utils';
16
15
  export { makeReactWrapperFactory, getReactWrapperOptions } from './wrappersUtils';
17
16
  export { renderElement } from './render';
18
- /**
19
- * @deprecated Use `useContextProvider` from `@arcgis/lumina/context` instead.
20
- */
21
- export declare const useContextProvider: typeof useContextProviderImplementation;
22
- /**
23
- * @deprecated Use `useContextConsumer` from `@arcgis/lumina/context` instead.
24
- */
25
- export declare const useContextConsumer: typeof useContextConsumerImplementation;
package/dist/index.js CHANGED
@@ -13,7 +13,6 @@ import { styleMap } from "lit/directives/style-map.js";
13
13
  import { directive as directive$1, Directive } from "lit-html/directive.js";
14
14
  import { live as live$1 } from "lit-html/directives/live.js";
15
15
  import { nothing as nothing$2, noChange as noChange$2, render } from "lit-html";
16
- import { useContextProvider as useContextProvider$1, useContextConsumer as useContextConsumer$1 } from "./context.js";
17
16
  const property = property$1;
18
17
  const method = void 0;
19
18
  class ControllerManager extends GenericController {
@@ -391,9 +390,7 @@ class LitElement extends LitElement$1 {
391
390
  const useLightDom = options === noShadowRoot;
392
391
  const renderRoot = existingShadowRoot ?? (useLightDom ? this.el : this.el.attachShadow(options));
393
392
  if (existingShadowRoot) {
394
- if (process.env.NODE_ENV === "production") {
395
- LitElement$1.prototype.createRenderRoot.call(this);
396
- }
393
+ LitElement$1.prototype.createRenderRoot.call(this);
397
394
  return existingShadowRoot;
398
395
  }
399
396
  if (this.isConnected) {
@@ -644,8 +641,6 @@ const renderElement = (element) => {
644
641
  render(element, container);
645
642
  return container.firstElementChild;
646
643
  };
647
- const useContextProvider = useContextProvider$1;
648
- const useContextConsumer = useContextConsumer$1;
649
644
  export {
650
645
  Fragment,
651
646
  LitElement,
@@ -673,7 +668,5 @@ export {
673
668
  safeStyleMap,
674
669
  setAttribute,
675
670
  state,
676
- stringOrBoolean,
677
- useContextConsumer,
678
- useContextProvider
671
+ stringOrBoolean
679
672
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arcgis/lumina",
3
- "version": "4.34.0-next.44",
3
+ "version": "4.34.0-next.46",
4
4
  "type": "module",
5
5
  "main": "dist/index.cjs",
6
6
  "module": "dist/index.js",
@@ -10,7 +10,6 @@
10
10
  "./config": "./dist/config.js",
11
11
  "./context": "./dist/context.js",
12
12
  "./hmrSupport": "./dist/hmrSupport.js",
13
- "./stencilSsrCompatibility": "./dist/stencilSsrCompatibility/index.js",
14
13
  "./typings": {
15
14
  "types": "./dist/typings/index.d.ts"
16
15
  },
@@ -23,12 +22,17 @@
23
22
  ],
24
23
  "license": "SEE LICENSE IN LICENSE.md",
25
24
  "dependencies": {
26
- "@arcgis/components-utils": "4.34.0-next.44",
27
- "@lit-labs/ssr": "^3.2.2",
28
- "@lit-labs/ssr-client": "^1.1.7",
29
- "@lit/context": "^1.1.5",
25
+ "@arcgis/components-utils": "4.34.0-next.46",
30
26
  "csstype": "^3.1.3",
31
- "lit": "^3.3.0",
32
27
  "tslib": "^2.8.1"
28
+ },
29
+ "peerDependencies": {
30
+ "@lit/context": "^1.1.5",
31
+ "lit": "^3.3.0"
32
+ },
33
+ "peerDependenciesMeta": {
34
+ "@lit/context": {
35
+ "optional": true
36
+ }
33
37
  }
34
38
  }
@@ -1,73 +0,0 @@
1
- import { RenderInfo } from '@lit-labs/ssr/lib/render.js';
2
- import { Readable } from 'node:stream';
3
- /**
4
- * @deprecated
5
- * Use `render` from `@lit-labs/ssr` instead.
6
- *
7
- * @see https://lit.dev/docs/ssr/server-usage/
8
- */
9
- export interface HydrateResults {
10
- buildId: string;
11
- diagnostics: any[];
12
- url: string;
13
- host: string;
14
- hostname: string;
15
- href: string;
16
- port: string;
17
- pathname: string;
18
- search: string;
19
- hash: string;
20
- html: string;
21
- components: HydrateComponent[];
22
- anchors: any[];
23
- imgs: any[];
24
- scripts: any[];
25
- styles: any[];
26
- staticData: any[];
27
- title: string;
28
- hydratedCount: number;
29
- httpStatus: number;
30
- }
31
- export interface HydrateComponent {
32
- tag: string;
33
- mode: string;
34
- count: number;
35
- depth: number;
36
- }
37
- /**
38
- * @deprecated
39
- * Use `getWindow` from `@lit-labs/ssr/lib/dom-shim` instead.
40
- *
41
- * @see https://lit.dev/docs/ssr/server-usage/
42
- */
43
- export declare function createWindowFromHtml(templateHtml: string, uniqueId?: string): any;
44
- /**
45
- * @deprecated
46
- * Use `RenderResultReadable` from `@lit-labs/ssr` instead.
47
- *
48
- * @see https://lit.dev/docs/ssr/server-usage/
49
- */
50
- export declare function streamToString(html: any, options?: Partial<RenderInfo>): Readable;
51
- /**
52
- * @deprecated
53
- * Use `render` from `@lit-labs/ssr` instead.
54
- *
55
- * @see https://lit.dev/docs/ssr/server-usage/
56
- */
57
- export declare function renderToString(html: any, options?: Partial<RenderInfo>): Promise<HydrateResults>;
58
- export declare function renderToString(html: any, options: Partial<RenderInfo> | undefined, asStream: true): Readable;
59
- /**
60
- * @deprecated
61
- * Use `render` from `@lit-labs/ssr` instead.
62
- *
63
- * @see https://lit.dev/docs/ssr/server-usage/
64
- */
65
- export declare function hydrateDocument(doc: any, options?: Partial<RenderInfo>): Promise<HydrateResults>;
66
- export declare function hydrateDocument(doc: any, options: Partial<RenderInfo> | undefined, asStream: true): Readable;
67
- /**
68
- * @deprecated
69
- * Use `render` from `@lit-labs/ssr` instead.
70
- *
71
- * @see https://lit.dev/docs/ssr/server-usage/
72
- */
73
- export declare function serializeDocumentToString(doc: any, _unused?: unknown): string;
@@ -1,87 +0,0 @@
1
- import { getWindow } from "@lit-labs/ssr/lib/dom-shim.js";
2
- import { render } from "@lit-labs/ssr/lib/render.js";
3
- import { html } from "@lit-labs/ssr/lib/server-template.js";
4
- import { withStatic, unsafeStatic } from "lit-html/static.js";
5
- import { collectResult } from "@lit-labs/ssr/lib/render-result.js";
6
- import { RenderResultReadable } from "@lit-labs/ssr/lib/render-result-readable.js";
7
- const staticHtml = withStatic(html);
8
- function createWindowFromHtml(templateHtml, uniqueId = Math.random().toString()) {
9
- const window = getWindow({ includeJSBuiltIns: true });
10
- window.document.defaultView = window;
11
- window.document.templateHtml = templateHtml;
12
- window.document.buildId = uniqueId;
13
- return window;
14
- }
15
- function streamToString(html2, options) {
16
- const { result } = getRenderResult(html2, options);
17
- return new RenderResultReadable(result);
18
- }
19
- function getRenderResult(rawSource, options) {
20
- const maybeDocument = typeof rawSource === "object" && rawSource !== null ? "document" in rawSource ? rawSource.document : rawSource : void 0;
21
- const source = maybeDocument && "templateHtml" in maybeDocument ? maybeDocument.templateHtml : maybeDocument && "documentElement" in maybeDocument ? maybeDocument.documentElement?.outerHTML ?? maybeDocument : rawSource;
22
- const renderTemplate = typeof source === "string" ? staticHtml`${unsafeStatic(source)}` : source;
23
- const tagNames = [];
24
- const result = render(renderTemplate, {
25
- customElementRendered(tagName) {
26
- tagNames.push(tagName);
27
- },
28
- ...options
29
- });
30
- return { result, maybeDocument, tagNames };
31
- }
32
- function renderToString(html2, options, asStream = false) {
33
- if (asStream) {
34
- return streamToString(html2, options);
35
- } else {
36
- return resultsToString(html2, options);
37
- }
38
- }
39
- async function resultsToString(html2, options) {
40
- const { result, tagNames, maybeDocument } = getRenderResult(html2, options);
41
- const collected = await collectResult(result);
42
- const renderResult = {
43
- buildId: maybeDocument?.buildId ?? Math.random().toString(),
44
- diagnostics: [],
45
- url: globalThis?.location?.href ?? "https://hydrate.stenciljs.com/",
46
- host: globalThis?.location?.host ?? "hydrate.stenciljs.com",
47
- hostname: globalThis?.location?.hostname ?? "hydrate.stenciljs.com",
48
- href: globalThis?.location?.href ?? "https://hydrate.stenciljs.com/",
49
- port: globalThis?.location?.port ?? "",
50
- pathname: globalThis?.location?.pathname ?? "/",
51
- search: globalThis?.location?.search ?? "",
52
- hash: globalThis?.location?.hash ?? "",
53
- html: collected,
54
- httpStatus: 200,
55
- hydratedCount: tagNames.length,
56
- anchors: [],
57
- components: tagNames.map((tag) => ({
58
- tag,
59
- mode: "$",
60
- count: 1,
61
- depth: 1
62
- })),
63
- imgs: [],
64
- scripts: [],
65
- staticData: [],
66
- styles: [],
67
- title: globalThis?.document?.title ?? "Vite + TS"
68
- };
69
- if (maybeDocument && "templateHtml" in maybeDocument) {
70
- maybeDocument.outerHtml = collected;
71
- }
72
- return renderResult;
73
- }
74
- function hydrateDocument(doc, options, asStream) {
75
- return renderToString(doc, options, asStream);
76
- }
77
- function serializeDocumentToString(doc, _unused) {
78
- const maybeDocument = doc;
79
- return maybeDocument.outerHtml ?? maybeDocument.templateHtml ?? String(maybeDocument);
80
- }
81
- export {
82
- createWindowFromHtml,
83
- hydrateDocument,
84
- renderToString,
85
- serializeDocumentToString,
86
- streamToString
87
- };