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

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.js CHANGED
@@ -391,9 +391,7 @@ class LitElement extends LitElement$1 {
391
391
  const useLightDom = options === noShadowRoot;
392
392
  const renderRoot = existingShadowRoot ?? (useLightDom ? this.el : this.el.attachShadow(options));
393
393
  if (existingShadowRoot) {
394
- if (process.env.NODE_ENV === "production") {
395
- LitElement$1.prototype.createRenderRoot.call(this);
396
- }
394
+ LitElement$1.prototype.createRenderRoot.call(this);
397
395
  return existingShadowRoot;
398
396
  }
399
397
  if (this.isConnected) {
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.45",
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,9 +22,7 @@
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",
25
+ "@arcgis/components-utils": "4.34.0-next.45",
29
26
  "@lit/context": "^1.1.5",
30
27
  "csstype": "^3.1.3",
31
28
  "lit": "^3.3.0",
@@ -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
- };