base-screen 0.1.2 → 0.2.0

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.
Files changed (133) hide show
  1. package/README.md +12 -5
  2. package/dist/_internal/engine/browser/controllers/blueprint/designer-blueprint-workbench-callbacks.d.ts +2 -0
  3. package/dist/_internal/engine/browser/controllers/blueprint/designer-blueprint-workbench-controller.d.ts +73 -16
  4. package/dist/_internal/engine/browser/controllers/blueprint/designer-blueprint-workbench-panel.d.ts +41 -0
  5. package/dist/_internal/engine/browser/controllers/dataset/designer-dataset-panel-controller.d.ts +62 -0
  6. package/dist/_internal/engine/browser/controllers/designer-size-tier-controller.d.ts +60 -0
  7. package/dist/_internal/engine/browser/controllers/panel/designer-material-group-navigation-controller.d.ts +2 -0
  8. package/dist/_internal/engine/browser/controllers/panel/designer-panel-controller.d.ts +2 -0
  9. package/dist/_internal/engine/browser/controllers/panel/designer-panel-inspector-controller.d.ts +6 -0
  10. package/dist/_internal/engine/browser/controllers/panel/designer-panel-material-controller.d.ts +1 -0
  11. package/dist/_internal/engine/browser/controllers/workbench/designer-panel-layout-controller.d.ts +22 -1
  12. package/dist/_internal/engine/browser/controllers/workbench/designer-workbench-controller.d.ts +5 -0
  13. package/dist/_internal/engine/browser/controllers/workbench/designer-workbench-tabs-controller.d.ts +1 -0
  14. package/dist/_internal/engine/browser/dom/workspace/designer-workspace-markup.d.ts +2 -0
  15. package/dist/_internal/engine/browser/dom/workspace/designer-workspace-skeleton.d.ts +7 -0
  16. package/dist/_internal/engine/browser/dom/workspace/designer-workspace.d.ts +1 -1
  17. package/dist/_internal/engine/common/ui-text/designer-blueprint-ui-text.d.ts +1 -0
  18. package/dist/_internal/engine/common/ui-text/designer-ui-text.d.ts +5 -1
  19. package/dist/_internal/engine/designer-blueprint-workbench-panel-C2MoZwKA.js +3548 -0
  20. package/dist/_internal/engine/designer-dataset-controller-CPytVNBK.js +4426 -0
  21. package/dist/_internal/engine/designer-element/runtime/designer-element-rendering.d.ts +7 -0
  22. package/dist/_internal/engine/designer-element/runtime/designer-element-skeleton.d.ts +14 -0
  23. package/dist/_internal/engine/designer-element/runtime/designer-element-state.d.ts +12 -2
  24. package/dist/_internal/engine/designer-left-panel-groups-dom-WMsH33zw.js +573 -0
  25. package/dist/_internal/engine/designer-ui-primitives-CH4RNiMa.js +2155 -0
  26. package/dist/_internal/engine/host-resource-selection-5Cf_gclK.js +2188 -0
  27. package/dist/_internal/engine/index.js +4944 -17147
  28. package/dist/_internal/renderer/index.js +266 -216
  29. package/dist/_internal/renderer/viewer/viewer-skeleton.d.ts +10 -0
  30. package/dist/_internal/renderer/viewer/viewer-variable-controller.d.ts +2 -0
  31. package/dist/_internal/renderer/viewer/viewer.d.ts +8 -0
  32. package/dist/_internal/sdk/auto-register.js +7 -7
  33. package/dist/_internal/sdk/designer-auto-register.js +2 -2
  34. package/dist/_internal/sdk/designer.d.ts +6 -0
  35. package/dist/_internal/sdk/designer.js +11 -1
  36. package/dist/_internal/sdk/index.d.ts +1 -1
  37. package/dist/_internal/sdk/index.js +6 -6
  38. package/dist/authoring-EcyK2YVN.js +103 -0
  39. package/dist/authoring-EcyK2YVN.js.map +1 -0
  40. package/dist/auto-register.js +12 -10
  41. package/dist/auto-register.js.map +1 -1
  42. package/dist/contracts.js +5 -4
  43. package/dist/contracts.js.map +1 -1
  44. package/dist/{contrast-B4TH-dvm.js → contrast-CZFqj1I5.js} +23 -23
  45. package/dist/{contrast-B4TH-dvm.js.map → contrast-CZFqj1I5.js.map} +1 -1
  46. package/dist/core.js +10 -8
  47. package/dist/core.js.map +1 -1
  48. package/dist/designer-Byw45cUM.js +21 -0
  49. package/dist/designer-Byw45cUM.js.map +1 -0
  50. package/dist/designer-auto-register.js +5 -3
  51. package/dist/designer-auto-register.js.map +1 -1
  52. package/dist/designer-blueprint-workbench-panel-C2MoZwKA-CbXkv78O.js +3517 -0
  53. package/dist/designer-blueprint-workbench-panel-C2MoZwKA-CbXkv78O.js.map +1 -0
  54. package/dist/designer-dataset-controller-CPytVNBK-DWL3SRTP.js +4354 -0
  55. package/dist/designer-dataset-controller-CPytVNBK-DWL3SRTP.js.map +1 -0
  56. package/dist/designer-left-panel-groups-dom-WMsH33zw-B9pl8loh.js +557 -0
  57. package/dist/designer-left-panel-groups-dom-WMsH33zw-B9pl8loh.js.map +1 -0
  58. package/dist/designer-ui-primitives-CH4RNiMa-BNXQwJPZ.js +2146 -0
  59. package/dist/designer-ui-primitives-CH4RNiMa-BNXQwJPZ.js.map +1 -0
  60. package/dist/designer.js +5 -3
  61. package/dist/{dist-CR13A2Yb.js → dist-BHTClwId.js} +4785 -16808
  62. package/dist/dist-BHTClwId.js.map +1 -0
  63. package/dist/{dist-CAdGDmU3.js → dist-DfAV2jGI.js} +277 -227
  64. package/dist/dist-DfAV2jGI.js.map +1 -0
  65. package/dist/editor-descriptor-schema-Be30Wv8w.js +190 -0
  66. package/dist/editor-descriptor-schema-Be30Wv8w.js.map +1 -0
  67. package/dist/engine.js +4 -2
  68. package/dist/hierarchy-BQZrZWbC.js +86 -0
  69. package/dist/hierarchy-BQZrZWbC.js.map +1 -0
  70. package/dist/host-resource-selection-5Cf_gclK-Sv4Z8UXS.js +2141 -0
  71. package/dist/host-resource-selection-5Cf_gclK-Sv4Z8UXS.js.map +1 -0
  72. package/dist/index.js +11 -9
  73. package/dist/{manager-Bhqi_KmD.js → manager-B2CZ2b5I.js} +2 -2
  74. package/dist/{manager-Bhqi_KmD.js.map → manager-B2CZ2b5I.js.map} +1 -1
  75. package/dist/material-BPlvEmDi.js +12 -0
  76. package/dist/material-BPlvEmDi.js.map +1 -0
  77. package/dist/material-auto-register.d.ts +1 -0
  78. package/dist/material-auto-register.js +16 -0
  79. package/dist/material-auto-register.js.map +1 -0
  80. package/dist/{material-definition-BJ4ujhuj.js → material-definition-B9xCZcD-.js} +2 -2
  81. package/dist/{material-definition-BJ4ujhuj.js.map → material-definition-B9xCZcD-.js.map} +1 -1
  82. package/dist/{material-manifest-LdgIkzgH.js → material-manifest-bsGl6vZZ.js} +70 -256
  83. package/dist/material-manifest-bsGl6vZZ.js.map +1 -0
  84. package/dist/material.js +3 -2
  85. package/dist/parse-B0hwp_yj.js +264 -0
  86. package/dist/parse-B0hwp_yj.js.map +1 -0
  87. package/dist/plugin-core.js +3 -2
  88. package/dist/plugin-manager.js +1 -1
  89. package/dist/{plugin-package-BfZLl3ru.js → plugin-package-BT-pCoTt.js} +3 -3
  90. package/dist/{plugin-package-BfZLl3ru.js.map → plugin-package-BT-pCoTt.js.map} +1 -1
  91. package/dist/{plugin-registration-CYtTqIxF.js → plugin-registration-BjS_CXJU.js} +2 -2
  92. package/dist/{plugin-registration-CYtTqIxF.js.map → plugin-registration-BjS_CXJU.js.map} +1 -1
  93. package/dist/plugin-sdk.js +3 -3
  94. package/dist/{plugins-DRaykV9c.js → plugins-B9bwk-t6.js} +2 -2
  95. package/dist/{plugins-DRaykV9c.js.map → plugins-B9bwk-t6.js.map} +1 -1
  96. package/dist/plugins.js +5 -5
  97. package/dist/renderer.js +1 -1
  98. package/dist/runtime-dispatch-Dt9fhcI5.js +360 -0
  99. package/dist/runtime-dispatch-Dt9fhcI5.js.map +1 -0
  100. package/dist/{src-Bm7u11mN-BPS5TRsq.js → src-Bm7u11mN-BMeb9fvV.js} +40 -39
  101. package/dist/{src-Bm7u11mN-BPS5TRsq.js.map → src-Bm7u11mN-BMeb9fvV.js.map} +1 -1
  102. package/dist/{material-2XmHe-aH.js → text-BVzTcUas.js} +44 -52
  103. package/dist/text-BVzTcUas.js.map +1 -0
  104. package/dist/value-ref-y4_YKUP5.js +278 -0
  105. package/dist/value-ref-y4_YKUP5.js.map +1 -0
  106. package/dist/{viewer-CrJupI8I-D2BtwLsA.js → viewer-CrJupI8I-DZZfdHXr.js} +5 -5
  107. package/dist/{viewer-CrJupI8I-D2BtwLsA.js.map → viewer-CrJupI8I-DZZfdHXr.js.map} +1 -1
  108. package/dist/viewer-auto-register.js +2 -2
  109. package/dist/viewer.js +2 -2
  110. package/package.json +12 -17
  111. package/dist/_internal/react/components.d.ts +0 -32
  112. package/dist/_internal/react/index.d.ts +0 -14
  113. package/dist/_internal/react/index.js +0 -215
  114. package/dist/_internal/vue/components.d.ts +0 -36
  115. package/dist/_internal/vue/global-styles.d.ts +0 -10
  116. package/dist/_internal/vue/index.d.ts +0 -14
  117. package/dist/_internal/vue/index.js +0 -290
  118. package/dist/designer-xtN0h7PL.js +0 -11
  119. package/dist/designer-xtN0h7PL.js.map +0 -1
  120. package/dist/dist-CAdGDmU3.js.map +0 -1
  121. package/dist/dist-CR13A2Yb.js.map +0 -1
  122. package/dist/material-2XmHe-aH.js.map +0 -1
  123. package/dist/material-manifest-LdgIkzgH.js.map +0 -1
  124. package/dist/parse-CYwxTDJU.js +0 -364
  125. package/dist/parse-CYwxTDJU.js.map +0 -1
  126. package/dist/react.d.ts +0 -1
  127. package/dist/react.js +0 -213
  128. package/dist/react.js.map +0 -1
  129. package/dist/value-ref-Z0o70Vy6.js +0 -716
  130. package/dist/value-ref-Z0o70Vy6.js.map +0 -1
  131. package/dist/vue.d.ts +0 -1
  132. package/dist/vue.js +0 -288
  133. package/dist/vue.js.map +0 -1
@@ -1,364 +0,0 @@
1
- import { f as e, i as t, u as n } from "./image-url-D6mUcjY1.js";
2
- import { f as r } from "./schema-C38FI_z2.js";
3
- import { i } from "./parse-BQw3u9_4.js";
4
- //#region ../contracts/dist/document/serialize.js
5
- var a = class extends Error {
6
- name = "ScreenSerializationError";
7
- diagnostics;
8
- constructor(e) {
9
- super("Screen document failed canonical validation."), this.diagnostics = e;
10
- }
11
- };
12
- function o(t) {
13
- let r = new e(), o = i(t, r);
14
- if (o === void 0) throw new a(r.done());
15
- return n(o);
16
- }
17
- //#endregion
18
- //#region ../contracts/dist/types/authoring.js
19
- var s = "base-screen-authoring-request", c = 128, l = 262144, u = 32, d = 262144, f = 1048576, p = /* @__PURE__ */ new Set([
20
- "kind",
21
- "requestId",
22
- "documentRevision"
23
- ]);
24
- function m(e) {
25
- if (typeof e != "object" || !e || Array.isArray(e)) return b("AUTHORING_REQUEST_INVALID", [], "Authoring request must be an object.");
26
- let t = e;
27
- if (t.kind === "component-text") {
28
- for (let e of Object.keys(t)) if (!p.has(e) && e !== "componentId" && e !== "maxBytes" && e !== "target" && e !== "source" && e !== "format") return b("AUTHORING_REQUEST_INVALID", [e], "Unknown request field.");
29
- return _(t.requestId) ? typeof t.componentId != "string" || t.componentId.length === 0 ? b("AUTHORING_REQUEST_INVALID", ["componentId"], "Component id is invalid.") : t.documentRevision !== null && typeof t.documentRevision != "string" ? b("AUTHORING_REQUEST_INVALID", ["documentRevision"], "Document revision must be a string or null.") : t.target !== "props" && t.target !== "style" && t.target !== "data" ? b("AUTHORING_REQUEST_INVALID", ["target"], "Target is unsupported.") : typeof t.source == "string" ? y(t.source) > 262144 ? b("AUTHORING_LIMIT_EXCEEDED", ["source"], "Source exceeds the authoring byte limit.") : t.format !== "json" && t.format !== "expression" ? b("AUTHORING_REQUEST_INVALID", ["format"], "Format is unsupported.") : v(t.maxBytes) ? {
30
- ok: !0,
31
- value: {
32
- kind: "component-text",
33
- requestId: t.requestId,
34
- componentId: t.componentId,
35
- documentRevision: t.documentRevision,
36
- target: t.target,
37
- source: t.source,
38
- format: t.format,
39
- maxBytes: t.maxBytes
40
- },
41
- diagnostics: []
42
- } : b("AUTHORING_REQUEST_INVALID", ["maxBytes"], "Byte budget is invalid.") : b("AUTHORING_REQUEST_INVALID", ["source"], "Source must be a string.") : b("AUTHORING_REQUEST_INVALID", ["requestId"], "Request id is invalid.");
43
- }
44
- return b("AUTHORING_REQUEST_INVALID", ["kind"], "Request kind is unsupported.");
45
- }
46
- function h(e) {
47
- if (typeof e != "object" || !e || Array.isArray(e)) return x("AUTHORING_REQUEST_INVALID", [], "Editor context must be an object.");
48
- let t = e;
49
- if (typeof t.instanceId != "string" || t.instanceId.length === 0) return x("AUTHORING_REQUEST_INVALID", ["instanceId"], "Instance id is invalid.");
50
- if (!_(t.requestId)) return x("AUTHORING_REQUEST_INVALID", ["requestId"], "Request id is invalid.");
51
- if (t.componentId !== null && typeof t.componentId != "string") return x("AUTHORING_REQUEST_INVALID", ["componentId"], "Component id must be a string or null.");
52
- if (t.documentRevision !== null && typeof t.documentRevision != "string") return x("AUTHORING_REQUEST_INVALID", ["documentRevision"], "Document revision must be a string or null.");
53
- for (let e of [
54
- "componentSnapshot",
55
- "manifest",
56
- "blueprint"
57
- ]) if (t[e] !== null && (t[e] === void 0 || t[e] === null || typeof t[e] != "object")) return x("AUTHORING_REQUEST_INVALID", [e], "Detached snapshot is invalid.");
58
- let n = t.limits;
59
- return typeof n != "object" || !n || !v(n.maxSourceBytes) || !v(n.maxCandidateBytes) || typeof n.maxJsonDepth != "number" || !Number.isInteger(n.maxJsonDepth) || n.maxJsonDepth < 1 || n.maxJsonDepth > 128 ? x("AUTHORING_REQUEST_INVALID", ["limits"], "Editor limits are invalid.") : {
60
- ok: !0,
61
- value: t,
62
- diagnostics: []
63
- };
64
- }
65
- function g(e) {
66
- return m(e).ok;
67
- }
68
- function _(e) {
69
- return typeof e == "string" && e.length > 0 && e.length <= 128;
70
- }
71
- function v(e) {
72
- return typeof e == "number" && Number.isInteger(e) && e >= 1024 && e <= 262144;
73
- }
74
- function y(e) {
75
- let t = 0;
76
- for (let n = 0; n < e.length; n++) {
77
- let r = e.charCodeAt(n);
78
- t += r <= 127 ? 1 : r <= 2047 ? 2 : r >= 55296 && r <= 57343 ? 4 : 3;
79
- }
80
- return t;
81
- }
82
- function b(e, t, n) {
83
- return {
84
- ok: !1,
85
- diagnostics: [{
86
- severity: "error",
87
- code: e,
88
- path: t,
89
- message: n
90
- }]
91
- };
92
- }
93
- function x(e, t, n) {
94
- return {
95
- ok: !1,
96
- diagnostics: [{
97
- severity: "error",
98
- code: e,
99
- path: t,
100
- message: n
101
- }]
102
- };
103
- }
104
- function S(e) {
105
- if (Array.isArray(e)) {
106
- let t = 0;
107
- for (let n of e) t = Math.max(t, S(n));
108
- return t + 1;
109
- }
110
- if (typeof e == "object" && e) {
111
- let t = 0, n = e;
112
- for (let e of Object.keys(n)) t = Math.max(t, S(n[e]));
113
- return t + 1;
114
- }
115
- return 0;
116
- }
117
- //#endregion
118
- //#region ../contracts/dist/types/host.js
119
- function C(e) {
120
- if (typeof e != "object" || !e || Array.isArray(e)) return w("Designer host adapter must be an object.");
121
- let t = e, n = t.capabilities;
122
- if (typeof n != "object" || !n || Array.isArray(n)) return w("Designer host capabilities must be an object.");
123
- let r = n;
124
- for (let [e, n, i] of [
125
- [
126
- "projectCatalog",
127
- "projectCatalog",
128
- [
129
- "list",
130
- "create",
131
- "clone",
132
- "delete",
133
- "import",
134
- "export"
135
- ]
136
- ],
137
- [
138
- "projectPreview",
139
- "projectPreview",
140
- ["load"]
141
- ],
142
- [
143
- "projectSnapshots",
144
- "projectSnapshots",
145
- [
146
- "list",
147
- "create",
148
- "restore",
149
- "delete"
150
- ]
151
- ],
152
- [
153
- "resources",
154
- "resources",
155
- ["resolve"]
156
- ],
157
- [
158
- "datasets",
159
- "datasets",
160
- [
161
- "list",
162
- "describe",
163
- "query"
164
- ]
165
- ],
166
- [
167
- "hostCatalog",
168
- "hostCatalog",
169
- [
170
- "list",
171
- "describe",
172
- "resolve"
173
- ]
174
- ],
175
- [
176
- "actions",
177
- "actions",
178
- ["execute"]
179
- ]
180
- ]) {
181
- if (typeof r[e] != "boolean") return w(`Designer host capability "${e}" must be boolean.`);
182
- let a = t[n], o = typeof a == "object" && !!a && i.every((e) => typeof a[e] == "function");
183
- if (r[e] === !0 && !o || r[e] === !1 && a !== void 0) return w(`Designer host capability "${e}" does not match its port.`);
184
- }
185
- return {
186
- ok: !0,
187
- value: t,
188
- diagnostics: []
189
- };
190
- }
191
- function w(e) {
192
- return {
193
- ok: !1,
194
- diagnostics: [{
195
- severity: "error",
196
- code: "PROJECT_ADAPTER_INVALID",
197
- path: [],
198
- message: e
199
- }]
200
- };
201
- }
202
- //#endregion
203
- //#region ../contracts/dist/variable/parse.js
204
- var T = 50, E = 262144, D = /[\u0000-\u001f\u007f-\u009f]/u, O = 256, k = 4096, A = 4096, j = 64, M = 256, N = /* @__PURE__ */ new Set([
205
- "string",
206
- "number",
207
- "boolean",
208
- "date"
209
- ]);
210
- function P(e) {
211
- let t = I(e);
212
- if (!t.ok) return t;
213
- let n = [];
214
- if (!H(t.value)) return W([], "Host catalog descriptor must be an object.");
215
- B(t.value, /* @__PURE__ */ new Set([
216
- "sourceId",
217
- "name",
218
- "description",
219
- "parameters",
220
- "readOnly",
221
- "previewable"
222
- ]), [], n), z(t.value, [], n), typeof t.value.previewable != "boolean" && n.push(U(["previewable"], "Host catalog previewable flag must be boolean.")), t.value.readOnly !== void 0 && typeof t.value.readOnly != "boolean" && n.push(U(["readOnly"], "Host catalog readOnly flag must be boolean."));
223
- let r = L(t.value.parameters, n);
224
- if (n.length > 0) return G(n);
225
- let i = t.value.readOnly;
226
- return {
227
- ok: !0,
228
- value: {
229
- sourceId: t.value.sourceId,
230
- name: t.value.name,
231
- description: t.value.description,
232
- parameters: r,
233
- ...i === !0 ? { readOnly: !0 } : {},
234
- previewable: t.value.previewable
235
- },
236
- diagnostics: []
237
- };
238
- }
239
- function F(e) {
240
- let t = I(e);
241
- if (!t.ok) return t;
242
- let n = [];
243
- if (!H(t.value)) return W([], "Host catalog page must be an object.");
244
- B(t.value, /* @__PURE__ */ new Set(["items", "nextCursor"]), [], n), (!Array.isArray(t.value.items) || t.value.items.length > 50) && n.push(U(["items"], "Host catalog page items are invalid."));
245
- let r = [], i = /* @__PURE__ */ new Set();
246
- return Array.isArray(t.value.items) && t.value.items.forEach((e, t) => {
247
- let a = ["items", t];
248
- if (!H(e)) {
249
- n.push(U(a, "Host catalog summary must be an object."));
250
- return;
251
- }
252
- B(e, /* @__PURE__ */ new Set([
253
- "sourceId",
254
- "name",
255
- "description"
256
- ]), a, n);
257
- let o = n.length;
258
- z(e, a, n), typeof e.sourceId == "string" && (i.has(e.sourceId) && n.push(U([...a, "sourceId"], "Host catalog page contains a duplicate id.")), i.add(e.sourceId)), n.length === o && r.push({
259
- sourceId: e.sourceId,
260
- name: e.name,
261
- description: e.description
262
- });
263
- }), t.value.nextCursor !== void 0 && !V(t.value.nextCursor) && n.push(U(["nextCursor"], "Host catalog page cursor is invalid.")), n.length > 0 ? G(n) : {
264
- ok: !0,
265
- value: {
266
- items: r,
267
- ...t.value.nextCursor === void 0 ? {} : { nextCursor: t.value.nextCursor }
268
- },
269
- diagnostics: []
270
- };
271
- }
272
- function I(e) {
273
- let n = t(e, { maxBytes: E });
274
- return n.ok ? n : {
275
- ok: !1,
276
- diagnostics: n.diagnostics.map((e) => ({
277
- ...e,
278
- code: "HOST_VARIABLE_DESCRIPTOR_INVALID"
279
- }))
280
- };
281
- }
282
- function L(e, t) {
283
- if (!Array.isArray(e) || e.length > j) return t.push(U(["parameters"], "Host catalog parameters are invalid.")), [];
284
- let n = [];
285
- return e.forEach((e, i) => {
286
- let a = ["parameters", i];
287
- if (!H(e)) {
288
- t.push(U(a, "Host catalog parameter must be an object."));
289
- return;
290
- }
291
- B(e, /* @__PURE__ */ new Set([
292
- "name",
293
- "label",
294
- "valueType",
295
- "required",
296
- "defaultValue",
297
- "minimum",
298
- "maximum",
299
- "maxLength",
300
- "allowedValues"
301
- ]), a, t);
302
- let o = t.length;
303
- r(e.name) || t.push(U([...a, "name"], "Host catalog parameter name is invalid.")), (typeof e.label != "string" || e.label.length === 0 || [...e.label].length > k) && t.push(U([...a, "label"], "Host catalog parameter label is invalid.")), (typeof e.valueType != "string" || !N.has(e.valueType)) && t.push(U([...a, "valueType"], "Host catalog parameter valueType is invalid.")), typeof e.required != "boolean" && t.push(U([...a, "required"], "Host catalog parameter required flag is invalid.")), e.defaultValue !== void 0 && !R(e.defaultValue) && t.push(U([...a, "defaultValue"], "Host catalog parameter default is invalid."));
304
- for (let n of ["minimum", "maximum"]) e[n] !== void 0 && typeof e[n] != "number" && t.push(U([...a, n], "Host catalog parameter bound is invalid."));
305
- if (e.maxLength !== void 0) {
306
- let n = e.maxLength;
307
- (typeof n != "number" || !Number.isInteger(n) || n < 0) && t.push(U([...a, "maxLength"], "Host catalog parameter maxLength is invalid."));
308
- }
309
- if (e.allowedValues !== void 0) {
310
- let n = e.allowedValues;
311
- (!Array.isArray(n) || n.length > M || !n.every((e) => R(e))) && t.push(U([...a, "allowedValues"], "Host catalog parameter allowedValues is invalid."));
312
- }
313
- t.length === o && n.push({
314
- name: e.name,
315
- label: e.label,
316
- valueType: e.valueType,
317
- required: e.required,
318
- ...e.defaultValue === void 0 ? {} : { defaultValue: e.defaultValue },
319
- ...e.minimum === void 0 ? {} : { minimum: e.minimum },
320
- ...e.maximum === void 0 ? {} : { maximum: e.maximum },
321
- ...e.maxLength === void 0 ? {} : { maxLength: e.maxLength },
322
- ...e.allowedValues === void 0 ? {} : { allowedValues: e.allowedValues }
323
- });
324
- }), n;
325
- }
326
- function R(e) {
327
- return typeof e == "string" || typeof e == "number" || typeof e == "boolean";
328
- }
329
- function z(e, t, n) {
330
- (typeof e.sourceId != "string" || e.sourceId.length === 0 || e.sourceId.length > O || D.test(e.sourceId)) && n.push(U([...t, "sourceId"], "Host catalog source id is invalid.")), r(e.name) || n.push(U([...t, "name"], "Host catalog name is invalid.")), e.description !== null && (typeof e.description != "string" || [...e.description].length > k || D.test(e.description)) && n.push(U([...t, "description"], "Host catalog description is invalid."));
331
- }
332
- function B(e, t, n, r) {
333
- for (let i of Object.keys(e)) t.has(i) || r.push(U([...n, i], "Unknown host catalog field."));
334
- }
335
- function V(e) {
336
- return typeof e == "string" && e.length > 0 && e.length <= A && !D.test(e);
337
- }
338
- function H(e) {
339
- return typeof e == "object" && !!e && !Array.isArray(e);
340
- }
341
- function U(e, t) {
342
- return {
343
- severity: "error",
344
- code: "HOST_VARIABLE_DESCRIPTOR_INVALID",
345
- path: e,
346
- message: t
347
- };
348
- }
349
- function W(e, t) {
350
- return {
351
- ok: !1,
352
- diagnostics: [U(e, t)]
353
- };
354
- }
355
- function G(e) {
356
- return {
357
- ok: !1,
358
- diagnostics: [...e].sort((e, t) => e.path.join("/") < t.path.join("/") ? -1 : 1)
359
- };
360
- }
361
- //#endregion
362
- export { o as _, C as a, u as c, s as d, g as f, a as g, m as h, F as i, c as l, h as m, T as n, d as o, S as p, P as r, f as s, E as t, l as u };
363
-
364
- //# sourceMappingURL=parse-CYwxTDJU.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"parse-CYwxTDJU.js","names":[],"sources":["../../contracts/dist/document/serialize.js","../../contracts/dist/types/authoring.js","../../contracts/dist/types/host.js","../../contracts/dist/variable/parse.js"],"sourcesContent":["import { DiagnosticCollector } from '../diagnostics/collector.js';\nimport { serializeCanonicalJson } from '../json/canonical.js';\nimport { validateDocument } from './validate.js';\nexport class ScreenSerializationError extends Error {\n name = 'ScreenSerializationError';\n diagnostics;\n constructor(diagnostics) {\n super('Screen document failed canonical validation.');\n this.diagnostics = diagnostics;\n }\n}\nexport function serializeScreenDocument(document) {\n const collector = new DiagnosticCollector();\n const validated = validateDocument(document, collector);\n if (validated === undefined) {\n throw new ScreenSerializationError(collector.done());\n }\n return serializeCanonicalJson(validated);\n}\n//# sourceMappingURL=serialize.js.map","export const SCREEN_AUTHORING_REQUEST_EVENT = 'base-screen-authoring-request';\nexport const MAX_AUTHORING_REQUEST_ID_LENGTH = 128;\nexport const MAX_AUTHORING_SOURCE_BYTES = 256 * 1024;\nexport const MAX_AUTHORING_JSON_DEPTH = 32;\nexport const MAX_AUTHORING_CANDIDATE_BYTES = 256 * 1024;\nexport const MAX_AUTHORING_COMPONENT_SNAPSHOT_BYTES = 1024 * 1024;\nconst REQUEST_FIELDS_COMMON = new Set(['kind', 'requestId', 'documentRevision']);\nexport function parseScreenAuthoringRequest(input) {\n if (input === null || typeof input !== 'object' || Array.isArray(input)) {\n return authoringFailure('AUTHORING_REQUEST_INVALID', [], 'Authoring request must be an object.');\n }\n const record = input;\n const kind = record.kind;\n if (kind === 'component-text') {\n for (const key of Object.keys(record)) {\n if (!REQUEST_FIELDS_COMMON.has(key) &&\n key !== 'componentId' &&\n key !== 'maxBytes' &&\n key !== 'target' &&\n key !== 'source' &&\n key !== 'format') {\n return authoringFailure('AUTHORING_REQUEST_INVALID', [key], 'Unknown request field.');\n }\n }\n if (!isRequestId(record.requestId)) {\n return authoringFailure('AUTHORING_REQUEST_INVALID', ['requestId'], 'Request id is invalid.');\n }\n if (typeof record.componentId !== 'string' || record.componentId.length === 0) {\n return authoringFailure('AUTHORING_REQUEST_INVALID', ['componentId'], 'Component id is invalid.');\n }\n if (record.documentRevision !== null && typeof record.documentRevision !== 'string') {\n return authoringFailure('AUTHORING_REQUEST_INVALID', ['documentRevision'], 'Document revision must be a string or null.');\n }\n if (record.target !== 'props' && record.target !== 'style' && record.target !== 'data') {\n return authoringFailure('AUTHORING_REQUEST_INVALID', ['target'], 'Target is unsupported.');\n }\n if (typeof record.source !== 'string') {\n return authoringFailure('AUTHORING_REQUEST_INVALID', ['source'], 'Source must be a string.');\n }\n if (byteLength(record.source) > MAX_AUTHORING_SOURCE_BYTES) {\n return authoringFailure('AUTHORING_LIMIT_EXCEEDED', ['source'], 'Source exceeds the authoring byte limit.');\n }\n if (record.format !== 'json' && record.format !== 'expression') {\n return authoringFailure('AUTHORING_REQUEST_INVALID', ['format'], 'Format is unsupported.');\n }\n if (!isByteBudget(record.maxBytes)) {\n return authoringFailure('AUTHORING_REQUEST_INVALID', ['maxBytes'], 'Byte budget is invalid.');\n }\n return {\n ok: true,\n value: {\n kind: 'component-text',\n requestId: record.requestId,\n componentId: record.componentId,\n documentRevision: record.documentRevision,\n target: record.target,\n source: record.source,\n format: record.format,\n maxBytes: record.maxBytes,\n },\n diagnostics: [],\n };\n }\n return authoringFailure('AUTHORING_REQUEST_INVALID', ['kind'], 'Request kind is unsupported.');\n}\nexport function parseScreenAuthoringEditorContext(input) {\n if (input === null || typeof input !== 'object' || Array.isArray(input)) {\n return contextFailure('AUTHORING_REQUEST_INVALID', [], 'Editor context must be an object.');\n }\n const record = input;\n if (typeof record.instanceId !== 'string' || record.instanceId.length === 0) {\n return contextFailure('AUTHORING_REQUEST_INVALID', ['instanceId'], 'Instance id is invalid.');\n }\n if (!isRequestId(record.requestId)) {\n return contextFailure('AUTHORING_REQUEST_INVALID', ['requestId'], 'Request id is invalid.');\n }\n if (record.componentId !== null && typeof record.componentId !== 'string') {\n return contextFailure('AUTHORING_REQUEST_INVALID', ['componentId'], 'Component id must be a string or null.');\n }\n if (record.documentRevision !== null && typeof record.documentRevision !== 'string') {\n return contextFailure('AUTHORING_REQUEST_INVALID', ['documentRevision'], 'Document revision must be a string or null.');\n }\n for (const field of ['componentSnapshot', 'manifest', 'blueprint']) {\n if (record[field] !== null &&\n (record[field] === undefined || record[field] === null || typeof record[field] !== 'object')) {\n return contextFailure('AUTHORING_REQUEST_INVALID', [field], 'Detached snapshot is invalid.');\n }\n }\n const limits = record.limits;\n if (limits === null ||\n typeof limits !== 'object' ||\n !isByteBudget(limits.maxSourceBytes) ||\n !isByteBudget(limits.maxCandidateBytes) ||\n typeof limits.maxJsonDepth !== 'number' ||\n !Number.isInteger(limits.maxJsonDepth) ||\n limits.maxJsonDepth < 1 ||\n limits.maxJsonDepth > 128) {\n return contextFailure('AUTHORING_REQUEST_INVALID', ['limits'], 'Editor limits are invalid.');\n }\n return {\n ok: true,\n value: record,\n diagnostics: [],\n };\n}\nexport function isScreenAuthoringRequest(value) {\n return parseScreenAuthoringRequest(value).ok;\n}\nfunction isRequestId(value) {\n return (typeof value === 'string' && value.length > 0 && value.length <= MAX_AUTHORING_REQUEST_ID_LENGTH);\n}\nfunction isByteBudget(value) {\n return (typeof value === 'number' &&\n Number.isInteger(value) &&\n value >= 1024 &&\n value <= MAX_AUTHORING_CANDIDATE_BYTES);\n}\nfunction byteLength(value) {\n let bytes = 0;\n for (let index = 0; index < value.length; index++) {\n const code = value.charCodeAt(index);\n bytes += code <= 0x7f ? 1 : code <= 0x7ff ? 2 : code >= 0xd800 && code <= 0xdfff ? 4 : 3;\n }\n return bytes;\n}\nfunction authoringFailure(code, path, message) {\n return { ok: false, diagnostics: [{ severity: 'error', code, path, message }] };\n}\nfunction contextFailure(code, path, message) {\n return { ok: false, diagnostics: [{ severity: 'error', code, path, message }] };\n}\nexport function jsonDepth(value) {\n if (Array.isArray(value)) {\n let depth = 0;\n for (const item of value)\n depth = Math.max(depth, jsonDepth(item));\n return depth + 1;\n }\n if (value !== null && typeof value === 'object') {\n let depth = 0;\n const record = value;\n for (const key of Object.keys(record))\n depth = Math.max(depth, jsonDepth(record[key]));\n return depth + 1;\n }\n return 0;\n}\n//# sourceMappingURL=authoring.js.map","export function validateScreenDesignerHostAdapter(input) {\n if (input === null || typeof input !== 'object' || Array.isArray(input)) {\n return invalidDesignerHostAdapter('Designer host adapter must be an object.');\n }\n const adapter = input;\n const capabilities = adapter.capabilities;\n if (capabilities === null || typeof capabilities !== 'object' || Array.isArray(capabilities)) {\n return invalidDesignerHostAdapter('Designer host capabilities must be an object.');\n }\n const capabilityRecord = capabilities;\n const checks = [\n ['projectCatalog', 'projectCatalog', ['list', 'create', 'clone', 'delete', 'import', 'export']],\n ['projectPreview', 'projectPreview', ['load']],\n ['projectSnapshots', 'projectSnapshots', ['list', 'create', 'restore', 'delete']],\n ['resources', 'resources', ['resolve']],\n ['datasets', 'datasets', ['list', 'describe', 'query']],\n ['hostCatalog', 'hostCatalog', ['list', 'describe', 'resolve']],\n ['actions', 'actions', ['execute']],\n ];\n for (const [capability, port, methods] of checks) {\n if (typeof capabilityRecord[capability] !== 'boolean') {\n return invalidDesignerHostAdapter(`Designer host capability \"${capability}\" must be boolean.`);\n }\n const portValue = adapter[port];\n const hasValidPort = portValue !== null &&\n typeof portValue === 'object' &&\n methods.every((method) => typeof portValue[method] === 'function');\n if ((capabilityRecord[capability] === true && !hasValidPort) ||\n (capabilityRecord[capability] === false && portValue !== undefined)) {\n return invalidDesignerHostAdapter(`Designer host capability \"${capability}\" does not match its port.`);\n }\n }\n return { ok: true, value: adapter, diagnostics: [] };\n}\nfunction invalidDesignerHostAdapter(message) {\n return {\n ok: false,\n diagnostics: [{ severity: 'error', code: 'PROJECT_ADAPTER_INVALID', path: [], message }],\n };\n}\n//# sourceMappingURL=host.js.map","import { isScreenVariableName } from '../document/schema.js';\nimport { parseScreenJsonValue } from '../json/parse.js';\nexport const MAX_HOST_CATALOG_PAGE_ITEMS = 50;\nexport const MAX_HOST_CATALOG_BYTES = 256 * 1024;\nconst CONTROL_CHARACTER_PATTERN = /[\\u0000-\\u001f\\u007f-\\u009f]/u;\nconst MAX_VARIABLE_ID_CODE_UNITS = 256;\nconst MAX_DESCRIPTION_CODE_POINTS = 4_096;\nconst MAX_CURSOR_CODE_UNITS = 4_096;\nconst MAX_PARAMETER_DEFINITIONS = 64;\nconst MAX_ALLOWED_VALUES = 256;\nconst VALUE_TYPES = new Set(['string', 'number', 'boolean', 'date']);\nexport function parseScreenHostCatalogDescriptor(input) {\n const parsed = parseCatalogJson(input);\n if (!parsed.ok)\n return parsed;\n const diagnostics = [];\n if (!isRecord(parsed.value)) {\n return invalidCatalog([], 'Host catalog descriptor must be an object.');\n }\n checkExact(parsed.value, new Set(['sourceId', 'name', 'description', 'parameters', 'readOnly', 'previewable']), [], diagnostics);\n validateSummaryFields(parsed.value, [], diagnostics);\n if (typeof parsed.value.previewable !== 'boolean') {\n diagnostics.push(diagnostic(['previewable'], 'Host catalog previewable flag must be boolean.'));\n }\n if (parsed.value.readOnly !== undefined && typeof parsed.value.readOnly !== 'boolean') {\n diagnostics.push(diagnostic(['readOnly'], 'Host catalog readOnly flag must be boolean.'));\n }\n const parameters = parseParameters(parsed.value.parameters, diagnostics);\n if (diagnostics.length > 0)\n return invalidWith(diagnostics);\n const readOnly = parsed.value.readOnly;\n return {\n ok: true,\n value: {\n sourceId: parsed.value.sourceId,\n name: parsed.value.name,\n description: parsed.value.description,\n parameters,\n ...(readOnly === true ? { readOnly: true } : {}),\n previewable: parsed.value.previewable,\n },\n diagnostics: [],\n };\n}\nexport function parseScreenHostCatalogPage(input) {\n const parsed = parseCatalogJson(input);\n if (!parsed.ok)\n return parsed;\n const diagnostics = [];\n if (!isRecord(parsed.value)) {\n return invalidCatalog([], 'Host catalog page must be an object.');\n }\n checkExact(parsed.value, new Set(['items', 'nextCursor']), [], diagnostics);\n if (!Array.isArray(parsed.value.items) ||\n parsed.value.items.length > MAX_HOST_CATALOG_PAGE_ITEMS) {\n diagnostics.push(diagnostic(['items'], 'Host catalog page items are invalid.'));\n }\n const items = [];\n const ids = new Set();\n if (Array.isArray(parsed.value.items)) {\n parsed.value.items.forEach((item, index) => {\n const path = ['items', index];\n if (!isRecord(item)) {\n diagnostics.push(diagnostic(path, 'Host catalog summary must be an object.'));\n return;\n }\n checkExact(item, new Set(['sourceId', 'name', 'description']), path, diagnostics);\n const before = diagnostics.length;\n validateSummaryFields(item, path, diagnostics);\n if (typeof item.sourceId === 'string') {\n if (ids.has(item.sourceId)) {\n diagnostics.push(diagnostic([...path, 'sourceId'], 'Host catalog page contains a duplicate id.'));\n }\n ids.add(item.sourceId);\n }\n if (diagnostics.length === before) {\n items.push({\n sourceId: item.sourceId,\n name: item.name,\n description: item.description,\n });\n }\n });\n }\n if (parsed.value.nextCursor !== undefined && !isCursor(parsed.value.nextCursor)) {\n diagnostics.push(diagnostic(['nextCursor'], 'Host catalog page cursor is invalid.'));\n }\n if (diagnostics.length > 0)\n return invalidWith(diagnostics);\n return {\n ok: true,\n value: {\n items,\n ...(parsed.value.nextCursor === undefined\n ? {}\n : { nextCursor: parsed.value.nextCursor }),\n },\n diagnostics: [],\n };\n}\nfunction parseCatalogJson(input) {\n const parsed = parseScreenJsonValue(input, { maxBytes: MAX_HOST_CATALOG_BYTES });\n if (parsed.ok)\n return parsed;\n return {\n ok: false,\n diagnostics: parsed.diagnostics.map((item) => ({\n ...item,\n code: 'HOST_VARIABLE_DESCRIPTOR_INVALID',\n })),\n };\n}\n/** 目录项参数:与数据集参数定义同形(`ScreenDatasetParameterDefinition`)。 */\nfunction parseParameters(input, diagnostics) {\n if (!Array.isArray(input) || input.length > MAX_PARAMETER_DEFINITIONS) {\n diagnostics.push(diagnostic(['parameters'], 'Host catalog parameters are invalid.'));\n return [];\n }\n const parameters = [];\n input.forEach((entry, index) => {\n const path = ['parameters', index];\n if (!isRecord(entry)) {\n diagnostics.push(diagnostic(path, 'Host catalog parameter must be an object.'));\n return;\n }\n checkExact(entry, new Set([\n 'name',\n 'label',\n 'valueType',\n 'required',\n 'defaultValue',\n 'minimum',\n 'maximum',\n 'maxLength',\n 'allowedValues',\n ]), path, diagnostics);\n const before = diagnostics.length;\n if (!isScreenVariableName(entry.name)) {\n diagnostics.push(diagnostic([...path, 'name'], 'Host catalog parameter name is invalid.'));\n }\n if (typeof entry.label !== 'string' ||\n entry.label.length === 0 ||\n [...entry.label].length > MAX_DESCRIPTION_CODE_POINTS) {\n diagnostics.push(diagnostic([...path, 'label'], 'Host catalog parameter label is invalid.'));\n }\n if (typeof entry.valueType !== 'string' || !VALUE_TYPES.has(entry.valueType)) {\n diagnostics.push(diagnostic([...path, 'valueType'], 'Host catalog parameter valueType is invalid.'));\n }\n if (typeof entry.required !== 'boolean') {\n diagnostics.push(diagnostic([...path, 'required'], 'Host catalog parameter required flag is invalid.'));\n }\n if (entry.defaultValue !== undefined && !isParameterValue(entry.defaultValue)) {\n diagnostics.push(diagnostic([...path, 'defaultValue'], 'Host catalog parameter default is invalid.'));\n }\n for (const key of ['minimum', 'maximum']) {\n if (entry[key] !== undefined && typeof entry[key] !== 'number') {\n diagnostics.push(diagnostic([...path, key], 'Host catalog parameter bound is invalid.'));\n }\n }\n if (entry.maxLength !== undefined) {\n const maxLength = entry.maxLength;\n if (typeof maxLength !== 'number' || !Number.isInteger(maxLength) || maxLength < 0) {\n diagnostics.push(diagnostic([...path, 'maxLength'], 'Host catalog parameter maxLength is invalid.'));\n }\n }\n if (entry.allowedValues !== undefined) {\n const allowedValues = entry.allowedValues;\n if (!Array.isArray(allowedValues) ||\n allowedValues.length > MAX_ALLOWED_VALUES ||\n !allowedValues.every((value) => isParameterValue(value))) {\n diagnostics.push(diagnostic([...path, 'allowedValues'], 'Host catalog parameter allowedValues is invalid.'));\n }\n }\n if (diagnostics.length !== before)\n return;\n parameters.push({\n name: entry.name,\n label: entry.label,\n valueType: entry.valueType,\n required: entry.required,\n ...(entry.defaultValue === undefined\n ? {}\n : { defaultValue: entry.defaultValue }),\n ...(entry.minimum === undefined ? {} : { minimum: entry.minimum }),\n ...(entry.maximum === undefined ? {} : { maximum: entry.maximum }),\n ...(entry.maxLength === undefined ? {} : { maxLength: entry.maxLength }),\n ...(entry.allowedValues === undefined\n ? {}\n : { allowedValues: entry.allowedValues }),\n });\n });\n return parameters;\n}\nfunction isParameterValue(value) {\n return typeof value === 'string' || typeof value === 'number' || typeof value === 'boolean';\n}\nfunction validateSummaryFields(value, path, diagnostics) {\n if (typeof value.sourceId !== 'string' ||\n value.sourceId.length === 0 ||\n value.sourceId.length > MAX_VARIABLE_ID_CODE_UNITS ||\n CONTROL_CHARACTER_PATTERN.test(value.sourceId)) {\n diagnostics.push(diagnostic([...path, 'sourceId'], 'Host catalog source id is invalid.'));\n }\n if (!isScreenVariableName(value.name)) {\n diagnostics.push(diagnostic([...path, 'name'], 'Host catalog name is invalid.'));\n }\n if (value.description !== null &&\n (typeof value.description !== 'string' ||\n [...value.description].length > MAX_DESCRIPTION_CODE_POINTS ||\n CONTROL_CHARACTER_PATTERN.test(value.description))) {\n diagnostics.push(diagnostic([...path, 'description'], 'Host catalog description is invalid.'));\n }\n}\nfunction checkExact(value, allowed, path, diagnostics) {\n for (const key of Object.keys(value)) {\n if (!allowed.has(key)) {\n diagnostics.push(diagnostic([...path, key], 'Unknown host catalog field.'));\n }\n }\n}\nfunction isCursor(value) {\n return (typeof value === 'string' &&\n value.length > 0 &&\n value.length <= MAX_CURSOR_CODE_UNITS &&\n !CONTROL_CHARACTER_PATTERN.test(value));\n}\nfunction isRecord(value) {\n return value !== null && typeof value === 'object' && !Array.isArray(value);\n}\nfunction diagnostic(path, message) {\n return {\n severity: 'error',\n code: 'HOST_VARIABLE_DESCRIPTOR_INVALID',\n path,\n message,\n };\n}\nfunction invalidCatalog(path, message) {\n return { ok: false, diagnostics: [diagnostic(path, message)] };\n}\nfunction invalidWith(diagnostics) {\n return {\n ok: false,\n diagnostics: [...diagnostics].sort((left, right) => left.path.join('/') < right.path.join('/') ? -1 : 1),\n };\n}\n//# sourceMappingURL=parse.js.map"],"mappings":";;;;AAGA,IAAa,IAAb,cAA8C,MAAM;CAChD,OAAO;CACP;CACA,YAAY,GAAa;EAErB,AADA,MAAM,8CAA8C,GACpD,KAAK,cAAc;CACvB;AACJ;AACA,SAAgB,EAAwB,GAAU;CAC9C,IAAM,IAAY,IAAI,EAAoB,GACpC,IAAY,EAAiB,GAAU,CAAS;CACtD,IAAI,MAAc,KAAA,GACd,MAAM,IAAI,EAAyB,EAAU,KAAK,CAAC;CAEvD,OAAO,EAAuB,CAAS;AAC3C;;;AClBA,IAAa,IAAiC,iCACjC,IAAkC,KAClC,IAA6B,QAC7B,IAA2B,IAC3B,IAAgC,QAChC,IAAyC,SAChD,oBAAwB,IAAI,IAAI;CAAC;CAAQ;CAAa;AAAkB,CAAC;AAC/E,SAAgB,EAA4B,GAAO;CAC/C,IAAsB,OAAO,KAAU,aAAnC,KAA+C,MAAM,QAAQ,CAAK,GAClE,OAAO,EAAiB,6BAA6B,CAAC,GAAG,sCAAsC;CAEnG,IAAM,IAAS;CAEf,IADa,EAAO,SACP,kBAAkB;EAC3B,KAAK,IAAM,KAAO,OAAO,KAAK,CAAM,GAChC,IAAI,CAAC,EAAsB,IAAI,CAAG,KAC9B,MAAQ,iBACR,MAAQ,cACR,MAAQ,YACR,MAAQ,YACR,MAAQ,UACR,OAAO,EAAiB,6BAA6B,CAAC,CAAG,GAAG,wBAAwB;EA2B5F,OAxBK,EAAY,EAAO,SAAS,IAG7B,OAAO,EAAO,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AAK,EAAW,CAAC,GAAG,GAAM,aAAa,GAAG,sCAAsC,CAAC;AAErG;AACA,SAAS,EAAW,GAAO,GAAS,GAAM,GAAa;CACnD,KAAK,IAAM,KAAO,OAAO,KAAK,CAAK,GAC/B,AAAK,EAAQ,IAAI,CAAG,KAChB,EAAY,KAAK,EAAW,CAAC,GAAG,GAAM,CAAG,GAAG,6BAA6B,CAAC;AAGtF;AACA,SAAS,EAAS,GAAO;CACrB,OAAQ,OAAO,KAAU,YACrB,EAAM,SAAS,KACf,EAAM,UAAU,KAChB,CAAC,EAA0B,KAAK,CAAK;AAC7C;AACA,SAAS,EAAS,GAAO;CACrB,OAAyB,OAAO,KAAU,cAAnC,KAA+C,CAAC,MAAM,QAAQ,CAAK;AAC9E;AACA,SAAS,EAAW,GAAM,GAAS;CAC/B,OAAO;EACH,UAAU;EACV,MAAM;EACN;EACA;CACJ;AACJ;AACA,SAAS,EAAe,GAAM,GAAS;CACnC,OAAO;EAAE,IAAI;EAAO,aAAa,CAAC,EAAW,GAAM,CAAO,CAAC;CAAE;AACjE;AACA,SAAS,EAAY,GAAa;CAC9B,OAAO;EACH,IAAI;EACJ,aAAa,CAAC,GAAG,CAAW,CAAC,CAAC,MAAM,GAAM,MAAU,EAAK,KAAK,KAAK,GAAG,IAAI,EAAM,KAAK,KAAK,GAAG,IAAI,KAAK,CAAC;CAC3G;AACJ"}
package/dist/react.d.ts DELETED
@@ -1 +0,0 @@
1
- export * from './_internal/react/index.js';
package/dist/react.js DELETED
@@ -1,213 +0,0 @@
1
- import { parseScreenJsonValue as e } from "base-screen/contracts";
2
- import { createMaterialDefinition as t } from "base-screen/plugin-sdk";
3
- import { createElement as n, useEffect as r, useRef as i, useState as a } from "react";
4
- import { createRoot as o } from "react-dom/client";
5
- import { createBaseScreenDesignerMountController as s, createBaseScreenViewerMountController as c } from "base-screen";
6
- //#region ../react/dist/index.js
7
- var l = Object.freeze([]);
8
- function u(e) {
9
- let t = i(null), [n, o] = a({
10
- diagnostics: l,
11
- context: void 0
12
- }), s = i({
13
- onMounted: e.onMounted,
14
- onDiagnostics: e.onDiagnostics,
15
- onProjectState: e.onProjectState
16
- });
17
- s.current = {
18
- onMounted: e.onMounted,
19
- onDiagnostics: e.onDiagnostics,
20
- onProjectState: e.onProjectState
21
- };
22
- let c = i(e.createController);
23
- c.current = e.createController;
24
- let u = i(null), d = i(Promise.resolve());
25
- return r(() => {
26
- let n = t.current, r = e.runtime, i = e.mountOptions;
27
- if (n === null || r === null || i === null) {
28
- o({
29
- diagnostics: l,
30
- context: void 0
31
- });
32
- return;
33
- }
34
- let a = !1, f = c.current({
35
- runtime: r,
36
- options: i,
37
- onMounted: (e) => {
38
- if (!a) return s.current.onMounted?.(e);
39
- },
40
- onProjectState: e.onProjectState === void 0 ? void 0 : (e) => {
41
- a || s.current.onProjectState?.(e);
42
- },
43
- onDiagnostics: (e, t) => {
44
- a || (o({
45
- diagnostics: e,
46
- context: t
47
- }), s.current.onDiagnostics?.(e, t));
48
- }
49
- });
50
- return u.current = f, d.current.then(() => {
51
- if (!a) return f.attach(n);
52
- }), () => {
53
- a = !0, u.current = null, o({
54
- diagnostics: l,
55
- context: void 0
56
- });
57
- let e = d.current, t = f.detach();
58
- d.current = Promise.all([e, t]);
59
- };
60
- }, [
61
- e.runtime,
62
- e.mountOptions === null,
63
- e.remountKey,
64
- ...e.identity
65
- ]), r(() => {
66
- let t = e.mountOptions;
67
- t !== null && u.current?.updateOptions(t);
68
- }, [e.mountOptions, e.mountOptions?.catalog]), {
69
- containerRef: t,
70
- diagnostics: n.diagnostics,
71
- diagnosticContext: n.context
72
- };
73
- }
74
- function d(e, t, r) {
75
- return e.length === 0 ? null : r === void 0 ? n("div", { role: "alert" }, e.map((e) => e.message).join("; ")) : r(e, t);
76
- }
77
- function f(e) {
78
- let { runtime: t, mountOptions: r, remountKey: i, onMounted: a, onDiagnostics: o, renderFallback: c, className: l, style: f } = e, p = u({
79
- runtime: t,
80
- mountOptions: r,
81
- remountKey: i,
82
- onMounted: a,
83
- onDiagnostics: o,
84
- identity: [
85
- r?.projectId,
86
- r?.document,
87
- r?.element
88
- ],
89
- onProjectState: e.onProjectState,
90
- createController: (e) => s({
91
- runtime: e.runtime,
92
- options: e.options,
93
- onMounted: e.onMounted,
94
- ...e.onProjectState === void 0 ? {} : { onProjectState: e.onProjectState },
95
- onDiagnostics: e.onDiagnostics
96
- })
97
- });
98
- return n("div", {
99
- ref: p.containerRef,
100
- className: l,
101
- style: f
102
- }, d(p.diagnostics, p.diagnosticContext, c));
103
- }
104
- function p(e) {
105
- let { runtime: t, mountOptions: r, remountKey: i, onMounted: a, onDiagnostics: o, renderFallback: s, className: l, style: f } = e, p = u({
106
- runtime: t,
107
- mountOptions: r,
108
- remountKey: i,
109
- onMounted: a,
110
- onDiagnostics: o,
111
- identity: [
112
- r?.projectId,
113
- r?.document,
114
- r?.documentRevision,
115
- r?.element
116
- ],
117
- createController: (e) => c({
118
- runtime: e.runtime,
119
- options: e.options,
120
- onMounted: e.onMounted,
121
- onDiagnostics: e.onDiagnostics
122
- })
123
- });
124
- return n("div", {
125
- ref: p.containerRef,
126
- className: l,
127
- style: f
128
- }, d(p.diagnostics, p.diagnosticContext, s));
129
- }
130
- var m = "base-screen-bridge-interactive-styles", h = "[data-base-screen-interactive=\"false\"] * { pointer-events: none; }";
131
- function g(e) {
132
- let r = globalThis.HTMLElement ?? class {}, i = e.eventProps ?? {};
133
- class a extends r {
134
- static manifest = e.manifest;
135
- #e;
136
- #t;
137
- #n = !1;
138
- get model() {
139
- if (this.#e === void 0) throw Error("Material model has not been set.");
140
- return this.#e;
141
- }
142
- set model(e) {
143
- this.#e = e, this.dataset.baseScreenInteractive = String(e.interactive), this.render();
144
- }
145
- connectedCallback() {
146
- this.#n = !1, this.#t === void 0 && (this.#t = o(this)), this.render();
147
- }
148
- disconnectedCallback() {
149
- this.#n || (this.#n = !0, queueMicrotask(() => {
150
- this.#n = !1, !this.isConnected && this.#t !== void 0 && (this.#t.unmount(), this.#t = void 0);
151
- }));
152
- }
153
- render() {
154
- if (this.#t === void 0 || this.#e === void 0) return;
155
- this.ensureInteractiveStyleSheet();
156
- let t = {
157
- ...e.mapModel === void 0 ? this.#e.props : e.mapModel(this.#e),
158
- ...this.createEventProps()
159
- }, r = n(e.component, t);
160
- this.#t.render(e.wrapRoot === void 0 ? r : e.wrapRoot(r, this.#e));
161
- }
162
- ensureInteractiveStyleSheet() {
163
- let e = this.getRootNode();
164
- if (e instanceof ShadowRoot) {
165
- if (e.querySelector(`style[data-bridge-style-key="${m}"]`) !== null) return;
166
- let t = this.ownerDocument.createElement("style");
167
- t.dataset.bridgeStyleKey = m, t.textContent = h, e.appendChild(t);
168
- return;
169
- }
170
- if (e instanceof Document && e.getElementById(m) === null) {
171
- let t = this.ownerDocument.createElement("style");
172
- t.id = m, t.textContent = h, e.head.appendChild(t);
173
- }
174
- }
175
- createEventProps() {
176
- let e = {};
177
- for (let [t, n] of Object.entries(i)) e[n] = (e) => this.dispatchMaterialEvent(t, e);
178
- return e;
179
- }
180
- dispatchMaterialEvent(t, n) {
181
- if (this.#e?.interactive !== !0 || !e.manifest.events.includes(t)) return;
182
- let r = _(n);
183
- r !== void 0 && this.dispatchEvent(new CustomEvent("base-screen-material-event", {
184
- bubbles: !0,
185
- composed: !0,
186
- detail: {
187
- name: t,
188
- payload: r
189
- }
190
- }));
191
- }
192
- }
193
- let s = t({
194
- manifest: e.manifest,
195
- element: a
196
- });
197
- return s.ok ? {
198
- ok: !0,
199
- value: {
200
- manifest: s.value.manifest,
201
- constructor: s.value.element
202
- },
203
- diagnostics: []
204
- } : s;
205
- }
206
- function _(t) {
207
- let n = e(t, { maxBytes: 65536 });
208
- return n.ok ? n.value : void 0;
209
- }
210
- //#endregion
211
- export { f as BaseScreenDesigner, p as BaseScreenViewer, g as createReactMaterialDefinition };
212
-
213
- //# sourceMappingURL=react.js.map