@arcgis/lumina-compiler 5.0.0-next.94 → 5.0.0-next.95
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/testing/index.js +25 -24
- package/package.json +5 -5
package/dist/testing/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { render as
|
|
1
|
+
import { render as C } from "lit";
|
|
2
2
|
import { unsafeStatic as m, html as b } from "lit/static-html.js";
|
|
3
3
|
import { devOnly$getLitElementTagNameAndRuntime as O, LitElement as x } from "@arcgis/lumina";
|
|
4
4
|
import { camelToKebab as S } from "@arcgis/toolkit/string";
|
|
@@ -6,9 +6,10 @@ import { onTestFinished as _, beforeEach as R, afterEach as j, expect as D } fro
|
|
|
6
6
|
import v from "chalk";
|
|
7
7
|
import M from "js-beautify";
|
|
8
8
|
import { toFunction as z } from "@arcgis/lumina/controllers";
|
|
9
|
-
|
|
9
|
+
import { rethrowError as A } from "@arcgis/toolkit/log";
|
|
10
|
+
async function Z(e, { parent: t = document.body, afterConnect: n, dynamicComponents: f, cleanupAfterTest: r = !0 } = {}) {
|
|
10
11
|
const i = document.createElement("div");
|
|
11
|
-
i.style.display = "contents", t.append(i), r && _(() =>
|
|
12
|
+
i.style.display = "contents", t.append(i), r && _(() => P(i)), g(e);
|
|
12
13
|
const s = f?.some(g);
|
|
13
14
|
let o;
|
|
14
15
|
if (typeof e == "string")
|
|
@@ -30,12 +31,12 @@ async function X(e, { parent: t = document.body, afterConnect: n, dynamicCompone
|
|
|
30
31
|
function u(a) {
|
|
31
32
|
c.push(a.error), a.preventDefault(), a.stopPropagation();
|
|
32
33
|
}
|
|
33
|
-
if (window.addEventListener("error", u),
|
|
34
|
+
if (window.addEventListener("error", u), C(o, i), window.removeEventListener("error", u), c.length === 1)
|
|
34
35
|
throw c[0];
|
|
35
36
|
if (c.length > 1)
|
|
36
37
|
throw new AggregateError(c, "Multiple errors occurred while creating the custom element");
|
|
37
|
-
const l = L(i), N = y,
|
|
38
|
-
|
|
38
|
+
const l = L(i), N = y, w = n?.(l);
|
|
39
|
+
w?.then !== void 0 && await w;
|
|
39
40
|
const h = l;
|
|
40
41
|
typeof h?.componentOnReady == "function" && await h.componentOnReady();
|
|
41
42
|
const p = h?.$component ?? N ?? l;
|
|
@@ -43,17 +44,17 @@ async function X(e, { parent: t = document.body, afterConnect: n, dynamicCompone
|
|
|
43
44
|
el: l,
|
|
44
45
|
component: p,
|
|
45
46
|
async reRender() {
|
|
46
|
-
return typeof e == "function" && !d(e) &&
|
|
47
|
+
return typeof e == "function" && !d(e) && C(e(), t), p.requestUpdate(), await p.updateComplete;
|
|
47
48
|
},
|
|
48
49
|
container: i
|
|
49
50
|
};
|
|
50
51
|
}
|
|
51
52
|
let y;
|
|
52
|
-
const
|
|
53
|
-
|
|
53
|
+
const F = globalThis;
|
|
54
|
+
F.devOnly$luminaComponentRefCallback = (e) => {
|
|
54
55
|
y = e;
|
|
55
56
|
};
|
|
56
|
-
function
|
|
57
|
+
function P(e) {
|
|
57
58
|
for (; e.firstChild; )
|
|
58
59
|
e.removeChild(e.firstChild);
|
|
59
60
|
e instanceof HTMLElement && e.remove();
|
|
@@ -73,7 +74,7 @@ function g(e) {
|
|
|
73
74
|
* If name is a single letter, it was probably minified - thus is not
|
|
74
75
|
* stable, thus don't use it. Example: class produced by wrapController()
|
|
75
76
|
*/
|
|
76
|
-
(e.name.length > 1 ? e.name.replaceAll(
|
|
77
|
+
(e.name.length > 1 ? e.name.replaceAll(q, "") : "") || "Test"
|
|
77
78
|
), c = o === "test" ? "te-st" : o.includes("-") ? o : `${o}-`;
|
|
78
79
|
s = c;
|
|
79
80
|
for (let u = 2, l = customElements.get(s); l !== e && l !== void 0; u += 1)
|
|
@@ -81,7 +82,7 @@ function g(e) {
|
|
|
81
82
|
}
|
|
82
83
|
return globalThis.devOnly$luminaRuntime?.customElement(s, e), Object.defineProperty(e.prototype, "tagName", { value: s.toUpperCase() }), i;
|
|
83
84
|
}
|
|
84
|
-
const d = (e) => typeof e == "function" && "lumina" in e,
|
|
85
|
+
const d = (e) => typeof e == "function" && "lumina" in e, q = /\d+$/gu;
|
|
85
86
|
function L(e) {
|
|
86
87
|
for (const t of e.children)
|
|
87
88
|
if ("lumina" in t.constructor)
|
|
@@ -93,7 +94,7 @@ function L(e) {
|
|
|
93
94
|
}
|
|
94
95
|
return e.firstElementChild ?? y?.el;
|
|
95
96
|
}
|
|
96
|
-
function
|
|
97
|
+
function H() {
|
|
97
98
|
const e = $("warn"), t = $("error");
|
|
98
99
|
R(() => {
|
|
99
100
|
e.beforeEach(), t.beforeEach();
|
|
@@ -121,14 +122,14 @@ function $(e) {
|
|
|
121
122
|
}
|
|
122
123
|
};
|
|
123
124
|
}
|
|
124
|
-
function
|
|
125
|
+
function U() {
|
|
125
126
|
D.addSnapshotSerializer({
|
|
126
127
|
// Using duck typing to detect ShadowRoot. Not using instanceof to keep test fast
|
|
127
128
|
test(e) {
|
|
128
129
|
return typeof e == "object" && e !== null && "innerHTML" in e && "onslotchange" in e;
|
|
129
130
|
},
|
|
130
131
|
serialize(e) {
|
|
131
|
-
const t = e.innerHTML.replaceAll(
|
|
132
|
+
const t = e.innerHTML.replaceAll(I, "");
|
|
132
133
|
return M.html(t, {
|
|
133
134
|
/* eslint-disable @typescript-eslint/naming-convention */
|
|
134
135
|
indent_size: 2,
|
|
@@ -142,17 +143,17 @@ function H() {
|
|
|
142
143
|
}
|
|
143
144
|
});
|
|
144
145
|
}
|
|
145
|
-
const
|
|
146
|
-
function
|
|
147
|
-
E
|
|
146
|
+
const I = /<!--\??(?:lit\$\d+\$)?-->/gu;
|
|
147
|
+
function k() {
|
|
148
|
+
T[E] || (T[E] = !0, H(), U());
|
|
148
149
|
}
|
|
149
|
-
const
|
|
150
|
-
function
|
|
150
|
+
const E = Symbol.for("lumina:didSetupTest"), T = globalThis;
|
|
151
|
+
function ee(e, t) {
|
|
151
152
|
class n extends x {
|
|
152
153
|
constructor() {
|
|
153
154
|
super();
|
|
154
155
|
const r = "prototype" in e ? z(e) : e;
|
|
155
|
-
this.controller = r(this), Promise.resolve(t?.(this)).catch(
|
|
156
|
+
this.controller = r(this), Promise.resolve(t?.(this)).catch(A(this));
|
|
156
157
|
}
|
|
157
158
|
/*
|
|
158
159
|
* Emitting controller's exports here is useful to let controller tests
|
|
@@ -167,7 +168,7 @@ function Z(e, t) {
|
|
|
167
168
|
return n;
|
|
168
169
|
}
|
|
169
170
|
export {
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
171
|
+
Z as mount,
|
|
172
|
+
k as setupLuminaTest,
|
|
173
|
+
ee as wrapController
|
|
173
174
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@arcgis/lumina-compiler",
|
|
3
|
-
"version": "5.0.0-next.
|
|
3
|
+
"version": "5.0.0-next.95",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.js",
|
|
@@ -18,9 +18,9 @@
|
|
|
18
18
|
],
|
|
19
19
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"@arcgis/api-extractor": "5.0.0-next.
|
|
22
|
-
"@arcgis/components-build-utils": "5.0.0-next.
|
|
23
|
-
"@arcgis/toolkit": "~5.0.0-next.
|
|
21
|
+
"@arcgis/api-extractor": "5.0.0-next.95",
|
|
22
|
+
"@arcgis/components-build-utils": "5.0.0-next.95",
|
|
23
|
+
"@arcgis/toolkit": "~5.0.0-next.95",
|
|
24
24
|
"chalk": "^5.4.1",
|
|
25
25
|
"esbuild": "^0.25.12",
|
|
26
26
|
"glob": "^11.0.3",
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"vite-plugin-dts": "^4.5.4"
|
|
31
31
|
},
|
|
32
32
|
"peerDependencies": {
|
|
33
|
-
"@arcgis/lumina": "~5.0.0-next.
|
|
33
|
+
"@arcgis/lumina": "~5.0.0-next.95",
|
|
34
34
|
"lit": "^3.3.0",
|
|
35
35
|
"typescript": "~5.9.3",
|
|
36
36
|
"vite": "^7.2.2",
|