@xmachines/play-solid 1.0.0-beta.2 → 1.0.0-beta.21

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 (61) hide show
  1. package/README.md +209 -66
  2. package/dist/PlayRenderer.js +55 -29
  3. package/dist/PlayRenderer.js.map +1 -1
  4. package/dist/index.js +4 -5
  5. package/dist/node_modules/@json-render/core/dist/chunk-AFLK3Q4T.js +111 -0
  6. package/dist/node_modules/@json-render/core/dist/chunk-AFLK3Q4T.js.map +1 -0
  7. package/dist/node_modules/@json-render/core/dist/index.js +863 -0
  8. package/dist/node_modules/@json-render/core/dist/index.js.map +1 -0
  9. package/dist/node_modules/@json-render/core/dist/store-utils.js +1 -0
  10. package/dist/node_modules/@json-render/solid/dist/chunk-XTSB6FIM.js +57 -0
  11. package/dist/node_modules/@json-render/solid/dist/chunk-XTSB6FIM.js.map +1 -0
  12. package/dist/node_modules/@json-render/solid/dist/index.js +617 -0
  13. package/dist/node_modules/@json-render/solid/dist/index.js.map +1 -0
  14. package/dist/node_modules/@json-render/xstate/dist/index.js +20 -0
  15. package/dist/node_modules/@json-render/xstate/dist/index.js.map +1 -0
  16. package/dist/node_modules/@xstate/store/dist/store-69e7e2d5.esm.js +227 -0
  17. package/dist/node_modules/@xstate/store/dist/store-69e7e2d5.esm.js.map +1 -0
  18. package/dist/node_modules/zod/v4/classic/errors.js +25 -0
  19. package/dist/node_modules/zod/v4/classic/errors.js.map +1 -0
  20. package/dist/node_modules/zod/v4/classic/iso.js +33 -0
  21. package/dist/node_modules/zod/v4/classic/iso.js.map +1 -0
  22. package/dist/node_modules/zod/v4/classic/parse.js +8 -0
  23. package/dist/node_modules/zod/v4/classic/parse.js.map +1 -0
  24. package/dist/node_modules/zod/v4/classic/schemas.js +362 -0
  25. package/dist/node_modules/zod/v4/classic/schemas.js.map +1 -0
  26. package/dist/node_modules/zod/v4/core/api.js +530 -0
  27. package/dist/node_modules/zod/v4/core/api.js.map +1 -0
  28. package/dist/node_modules/zod/v4/core/checks.js +285 -0
  29. package/dist/node_modules/zod/v4/core/checks.js.map +1 -0
  30. package/dist/node_modules/zod/v4/core/core.js +46 -0
  31. package/dist/node_modules/zod/v4/core/core.js.map +1 -0
  32. package/dist/node_modules/zod/v4/core/doc.js +25 -0
  33. package/dist/node_modules/zod/v4/core/doc.js.map +1 -0
  34. package/dist/node_modules/zod/v4/core/errors.js +43 -0
  35. package/dist/node_modules/zod/v4/core/errors.js.map +1 -0
  36. package/dist/node_modules/zod/v4/core/json-schema-processors.js +183 -0
  37. package/dist/node_modules/zod/v4/core/json-schema-processors.js.map +1 -0
  38. package/dist/node_modules/zod/v4/core/parse.js +70 -0
  39. package/dist/node_modules/zod/v4/core/parse.js.map +1 -0
  40. package/dist/node_modules/zod/v4/core/regexes.js +27 -0
  41. package/dist/node_modules/zod/v4/core/regexes.js.map +1 -0
  42. package/dist/node_modules/zod/v4/core/registries.js +42 -0
  43. package/dist/node_modules/zod/v4/core/registries.js.map +1 -0
  44. package/dist/node_modules/zod/v4/core/schemas.js +823 -0
  45. package/dist/node_modules/zod/v4/core/schemas.js.map +1 -0
  46. package/dist/node_modules/zod/v4/core/to-json-schema.js +224 -0
  47. package/dist/node_modules/zod/v4/core/to-json-schema.js.map +1 -0
  48. package/dist/node_modules/zod/v4/core/util.js +268 -0
  49. package/dist/node_modules/zod/v4/core/util.js.map +1 -0
  50. package/dist/node_modules/zod/v4/core/versions.js +10 -0
  51. package/dist/node_modules/zod/v4/core/versions.js.map +1 -0
  52. package/dist/useActor.js +12 -0
  53. package/dist/useActor.js.map +1 -0
  54. package/package.json +27 -17
  55. package/dist/PlayRenderer.d.ts +0 -63
  56. package/dist/PlayRenderer.d.ts.map +0 -1
  57. package/dist/index.d.ts +0 -8
  58. package/dist/index.d.ts.map +0 -1
  59. package/dist/index.js.map +0 -1
  60. package/dist/types.d.ts +0 -28
  61. package/dist/types.d.ts.map +0 -1
@@ -0,0 +1,268 @@
1
+ //#region ../../node_modules/zod/v4/core/util.js
2
+ function e(e) {
3
+ let t = Object.values(e).filter((e) => typeof e == "number");
4
+ return Object.entries(e).filter(([e, n]) => t.indexOf(+e) === -1).map(([e, t]) => t);
5
+ }
6
+ function t(e, t) {
7
+ return typeof t == "bigint" ? t.toString() : t;
8
+ }
9
+ function n(e) {
10
+ return { get value() {
11
+ {
12
+ let t = e();
13
+ return Object.defineProperty(this, "value", { value: t }), t;
14
+ }
15
+ throw Error("cached value already set");
16
+ } };
17
+ }
18
+ function r(e) {
19
+ return e == null;
20
+ }
21
+ function i(e) {
22
+ let t = e.startsWith("^") ? 1 : 0, n = e.endsWith("$") ? e.length - 1 : e.length;
23
+ return e.slice(t, n);
24
+ }
25
+ function a(e, t) {
26
+ let n = (e.toString().split(".")[1] || "").length, r = t.toString(), i = (r.split(".")[1] || "").length;
27
+ if (i === 0 && /\d?e-\d?/.test(r)) {
28
+ let e = r.match(/\d?e-(\d?)/);
29
+ e?.[1] && (i = Number.parseInt(e[1]));
30
+ }
31
+ let a = n > i ? n : i;
32
+ return Number.parseInt(e.toFixed(a).replace(".", "")) % Number.parseInt(t.toFixed(a).replace(".", "")) / 10 ** a;
33
+ }
34
+ var o = Symbol("evaluating");
35
+ function s(e, t, n) {
36
+ let r;
37
+ Object.defineProperty(e, t, {
38
+ get() {
39
+ if (r !== o) return r === void 0 && (r = o, r = n()), r;
40
+ },
41
+ set(n) {
42
+ Object.defineProperty(e, t, { value: n });
43
+ },
44
+ configurable: !0
45
+ });
46
+ }
47
+ function c(e, t, n) {
48
+ Object.defineProperty(e, t, {
49
+ value: n,
50
+ writable: !0,
51
+ enumerable: !0,
52
+ configurable: !0
53
+ });
54
+ }
55
+ function l(...e) {
56
+ let t = {};
57
+ for (let n of e) Object.assign(t, Object.getOwnPropertyDescriptors(n));
58
+ return Object.defineProperties({}, t);
59
+ }
60
+ function u(e) {
61
+ return JSON.stringify(e);
62
+ }
63
+ function d(e) {
64
+ return e.toLowerCase().trim().replace(/[^\w\s-]/g, "").replace(/[\s_-]+/g, "-").replace(/^-+|-+$/g, "");
65
+ }
66
+ var f = "captureStackTrace" in Error ? Error.captureStackTrace : (...e) => {};
67
+ function p(e) {
68
+ return typeof e == "object" && !!e && !Array.isArray(e);
69
+ }
70
+ var m = n(() => {
71
+ if (typeof navigator < "u" && navigator?.userAgent?.includes("Cloudflare")) return !1;
72
+ try {
73
+ return Function(""), !0;
74
+ } catch {
75
+ return !1;
76
+ }
77
+ });
78
+ function h(e) {
79
+ if (p(e) === !1) return !1;
80
+ let t = e.constructor;
81
+ if (t === void 0 || typeof t != "function") return !0;
82
+ let n = t.prototype;
83
+ return !(p(n) === !1 || Object.prototype.hasOwnProperty.call(n, "isPrototypeOf") === !1);
84
+ }
85
+ function g(e) {
86
+ return h(e) ? { ...e } : Array.isArray(e) ? [...e] : e;
87
+ }
88
+ var _ = new Set([
89
+ "string",
90
+ "number",
91
+ "symbol"
92
+ ]);
93
+ function v(e) {
94
+ return e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
95
+ }
96
+ function y(e, t, n) {
97
+ let r = new e._zod.constr(t ?? e._zod.def);
98
+ return (!t || n?.parent) && (r._zod.parent = e), r;
99
+ }
100
+ function b(e) {
101
+ let t = e;
102
+ if (!t) return {};
103
+ if (typeof t == "string") return { error: () => t };
104
+ if (t?.message !== void 0) {
105
+ if (t?.error !== void 0) throw Error("Cannot specify both `message` and `error` params");
106
+ t.error = t.message;
107
+ }
108
+ return delete t.message, typeof t.error == "string" ? {
109
+ ...t,
110
+ error: () => t.error
111
+ } : t;
112
+ }
113
+ function x(e) {
114
+ return Object.keys(e).filter((t) => e[t]._zod.optin === "optional" && e[t]._zod.optout === "optional");
115
+ }
116
+ var S = {
117
+ safeint: [-(2 ** 53 - 1), 2 ** 53 - 1],
118
+ int32: [-2147483648, 2147483647],
119
+ uint32: [0, 4294967295],
120
+ float32: [-34028234663852886e22, 34028234663852886e22],
121
+ float64: [-Number.MAX_VALUE, Number.MAX_VALUE]
122
+ };
123
+ function C(e, t) {
124
+ let n = e._zod.def, r = n.checks;
125
+ if (r && r.length > 0) throw Error(".pick() cannot be used on object schemas containing refinements");
126
+ return y(e, l(e._zod.def, {
127
+ get shape() {
128
+ let e = {};
129
+ for (let r in t) {
130
+ if (!(r in n.shape)) throw Error(`Unrecognized key: "${r}"`);
131
+ t[r] && (e[r] = n.shape[r]);
132
+ }
133
+ return c(this, "shape", e), e;
134
+ },
135
+ checks: []
136
+ }));
137
+ }
138
+ function w(e, t) {
139
+ let n = e._zod.def, r = n.checks;
140
+ if (r && r.length > 0) throw Error(".omit() cannot be used on object schemas containing refinements");
141
+ return y(e, l(e._zod.def, {
142
+ get shape() {
143
+ let r = { ...e._zod.def.shape };
144
+ for (let e in t) {
145
+ if (!(e in n.shape)) throw Error(`Unrecognized key: "${e}"`);
146
+ t[e] && delete r[e];
147
+ }
148
+ return c(this, "shape", r), r;
149
+ },
150
+ checks: []
151
+ }));
152
+ }
153
+ function T(e, t) {
154
+ if (!h(t)) throw Error("Invalid input to extend: expected a plain object");
155
+ let n = e._zod.def.checks;
156
+ if (n && n.length > 0) {
157
+ let n = e._zod.def.shape;
158
+ for (let e in t) if (Object.getOwnPropertyDescriptor(n, e) !== void 0) throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.");
159
+ }
160
+ return y(e, l(e._zod.def, { get shape() {
161
+ let n = {
162
+ ...e._zod.def.shape,
163
+ ...t
164
+ };
165
+ return c(this, "shape", n), n;
166
+ } }));
167
+ }
168
+ function E(e, t) {
169
+ if (!h(t)) throw Error("Invalid input to safeExtend: expected a plain object");
170
+ return y(e, l(e._zod.def, { get shape() {
171
+ let n = {
172
+ ...e._zod.def.shape,
173
+ ...t
174
+ };
175
+ return c(this, "shape", n), n;
176
+ } }));
177
+ }
178
+ function D(e, t) {
179
+ return y(e, l(e._zod.def, {
180
+ get shape() {
181
+ let n = {
182
+ ...e._zod.def.shape,
183
+ ...t._zod.def.shape
184
+ };
185
+ return c(this, "shape", n), n;
186
+ },
187
+ get catchall() {
188
+ return t._zod.def.catchall;
189
+ },
190
+ checks: []
191
+ }));
192
+ }
193
+ function O(e, t, n) {
194
+ let r = t._zod.def.checks;
195
+ if (r && r.length > 0) throw Error(".partial() cannot be used on object schemas containing refinements");
196
+ return y(t, l(t._zod.def, {
197
+ get shape() {
198
+ let r = t._zod.def.shape, i = { ...r };
199
+ if (n) for (let t in n) {
200
+ if (!(t in r)) throw Error(`Unrecognized key: "${t}"`);
201
+ n[t] && (i[t] = e ? new e({
202
+ type: "optional",
203
+ innerType: r[t]
204
+ }) : r[t]);
205
+ }
206
+ else for (let t in r) i[t] = e ? new e({
207
+ type: "optional",
208
+ innerType: r[t]
209
+ }) : r[t];
210
+ return c(this, "shape", i), i;
211
+ },
212
+ checks: []
213
+ }));
214
+ }
215
+ function k(e, t, n) {
216
+ return y(t, l(t._zod.def, { get shape() {
217
+ let r = t._zod.def.shape, i = { ...r };
218
+ if (n) for (let t in n) {
219
+ if (!(t in i)) throw Error(`Unrecognized key: "${t}"`);
220
+ n[t] && (i[t] = new e({
221
+ type: "nonoptional",
222
+ innerType: r[t]
223
+ }));
224
+ }
225
+ else for (let t in r) i[t] = new e({
226
+ type: "nonoptional",
227
+ innerType: r[t]
228
+ });
229
+ return c(this, "shape", i), i;
230
+ } }));
231
+ }
232
+ function A(e, t = 0) {
233
+ if (e.aborted === !0) return !0;
234
+ for (let n = t; n < e.issues.length; n++) if (e.issues[n]?.continue !== !0) return !0;
235
+ return !1;
236
+ }
237
+ function j(e, t) {
238
+ return t.map((t) => {
239
+ var n;
240
+ return (n = t).path ?? (n.path = []), t.path.unshift(e), t;
241
+ });
242
+ }
243
+ function M(e) {
244
+ return typeof e == "string" ? e : e?.message;
245
+ }
246
+ function N(e, t, n) {
247
+ let r = {
248
+ ...e,
249
+ path: e.path ?? []
250
+ };
251
+ return e.message || (r.message = M(e.inst?._zod.def?.error?.(e)) ?? M(t?.error?.(e)) ?? M(n.customError?.(e)) ?? M(n.localeError?.(e)) ?? "Invalid input"), delete r.inst, delete r.continue, t?.reportInput || delete r.input, r;
252
+ }
253
+ function P(e) {
254
+ return Array.isArray(e) ? "array" : typeof e == "string" ? "string" : "unknown";
255
+ }
256
+ function F(...e) {
257
+ let [t, n, r] = e;
258
+ return typeof t == "string" ? {
259
+ message: t,
260
+ code: "custom",
261
+ input: n,
262
+ inst: r
263
+ } : { ...t };
264
+ }
265
+ //#endregion
266
+ export { S as NUMBER_FORMAT_RANGES, A as aborted, m as allowsEval, n as cached, f as captureStackTrace, i as cleanRegex, y as clone, s as defineLazy, u as esc, v as escapeRegex, T as extend, N as finalizeIssue, a as floatSafeRemainder, e as getEnumValues, P as getLengthableOrigin, p as isObject, h as isPlainObject, F as issue, t as jsonStringifyReplacer, D as merge, l as mergeDefs, b as normalizeParams, r as nullish, w as omit, x as optionalKeys, O as partial, C as pick, j as prefixIssues, _ as propertyKeyTypes, k as required, E as safeExtend, g as shallowClone, d as slugify };
267
+
268
+ //# sourceMappingURL=util.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"util.js","names":[],"sources":["../../../../../../../node_modules/zod/v4/core/util.js"],"sourcesContent":["// functions\nexport function assertEqual(val) {\n return val;\n}\nexport function assertNotEqual(val) {\n return val;\n}\nexport function assertIs(_arg) { }\nexport function assertNever(_x) {\n throw new Error(\"Unexpected value in exhaustive check\");\n}\nexport function assert(_) { }\nexport function getEnumValues(entries) {\n const numericValues = Object.values(entries).filter((v) => typeof v === \"number\");\n const values = Object.entries(entries)\n .filter(([k, _]) => numericValues.indexOf(+k) === -1)\n .map(([_, v]) => v);\n return values;\n}\nexport function joinValues(array, separator = \"|\") {\n return array.map((val) => stringifyPrimitive(val)).join(separator);\n}\nexport function jsonStringifyReplacer(_, value) {\n if (typeof value === \"bigint\")\n return value.toString();\n return value;\n}\nexport function cached(getter) {\n const set = false;\n return {\n get value() {\n if (!set) {\n const value = getter();\n Object.defineProperty(this, \"value\", { value });\n return value;\n }\n throw new Error(\"cached value already set\");\n },\n };\n}\nexport function nullish(input) {\n return input === null || input === undefined;\n}\nexport function cleanRegex(source) {\n const start = source.startsWith(\"^\") ? 1 : 0;\n const end = source.endsWith(\"$\") ? source.length - 1 : source.length;\n return source.slice(start, end);\n}\nexport function floatSafeRemainder(val, step) {\n const valDecCount = (val.toString().split(\".\")[1] || \"\").length;\n const stepString = step.toString();\n let stepDecCount = (stepString.split(\".\")[1] || \"\").length;\n if (stepDecCount === 0 && /\\d?e-\\d?/.test(stepString)) {\n const match = stepString.match(/\\d?e-(\\d?)/);\n if (match?.[1]) {\n stepDecCount = Number.parseInt(match[1]);\n }\n }\n const decCount = valDecCount > stepDecCount ? valDecCount : stepDecCount;\n const valInt = Number.parseInt(val.toFixed(decCount).replace(\".\", \"\"));\n const stepInt = Number.parseInt(step.toFixed(decCount).replace(\".\", \"\"));\n return (valInt % stepInt) / 10 ** decCount;\n}\nconst EVALUATING = Symbol(\"evaluating\");\nexport function defineLazy(object, key, getter) {\n let value = undefined;\n Object.defineProperty(object, key, {\n get() {\n if (value === EVALUATING) {\n // Circular reference detected, return undefined to break the cycle\n return undefined;\n }\n if (value === undefined) {\n value = EVALUATING;\n value = getter();\n }\n return value;\n },\n set(v) {\n Object.defineProperty(object, key, {\n value: v,\n // configurable: true,\n });\n // object[key] = v;\n },\n configurable: true,\n });\n}\nexport function objectClone(obj) {\n return Object.create(Object.getPrototypeOf(obj), Object.getOwnPropertyDescriptors(obj));\n}\nexport function assignProp(target, prop, value) {\n Object.defineProperty(target, prop, {\n value,\n writable: true,\n enumerable: true,\n configurable: true,\n });\n}\nexport function mergeDefs(...defs) {\n const mergedDescriptors = {};\n for (const def of defs) {\n const descriptors = Object.getOwnPropertyDescriptors(def);\n Object.assign(mergedDescriptors, descriptors);\n }\n return Object.defineProperties({}, mergedDescriptors);\n}\nexport function cloneDef(schema) {\n return mergeDefs(schema._zod.def);\n}\nexport function getElementAtPath(obj, path) {\n if (!path)\n return obj;\n return path.reduce((acc, key) => acc?.[key], obj);\n}\nexport function promiseAllObject(promisesObj) {\n const keys = Object.keys(promisesObj);\n const promises = keys.map((key) => promisesObj[key]);\n return Promise.all(promises).then((results) => {\n const resolvedObj = {};\n for (let i = 0; i < keys.length; i++) {\n resolvedObj[keys[i]] = results[i];\n }\n return resolvedObj;\n });\n}\nexport function randomString(length = 10) {\n const chars = \"abcdefghijklmnopqrstuvwxyz\";\n let str = \"\";\n for (let i = 0; i < length; i++) {\n str += chars[Math.floor(Math.random() * chars.length)];\n }\n return str;\n}\nexport function esc(str) {\n return JSON.stringify(str);\n}\nexport function slugify(input) {\n return input\n .toLowerCase()\n .trim()\n .replace(/[^\\w\\s-]/g, \"\")\n .replace(/[\\s_-]+/g, \"-\")\n .replace(/^-+|-+$/g, \"\");\n}\nexport const captureStackTrace = (\"captureStackTrace\" in Error ? Error.captureStackTrace : (..._args) => { });\nexport function isObject(data) {\n return typeof data === \"object\" && data !== null && !Array.isArray(data);\n}\nexport const allowsEval = cached(() => {\n // @ts-ignore\n if (typeof navigator !== \"undefined\" && navigator?.userAgent?.includes(\"Cloudflare\")) {\n return false;\n }\n try {\n const F = Function;\n new F(\"\");\n return true;\n }\n catch (_) {\n return false;\n }\n});\nexport function isPlainObject(o) {\n if (isObject(o) === false)\n return false;\n // modified constructor\n const ctor = o.constructor;\n if (ctor === undefined)\n return true;\n if (typeof ctor !== \"function\")\n return true;\n // modified prototype\n const prot = ctor.prototype;\n if (isObject(prot) === false)\n return false;\n // ctor doesn't have static `isPrototypeOf`\n if (Object.prototype.hasOwnProperty.call(prot, \"isPrototypeOf\") === false) {\n return false;\n }\n return true;\n}\nexport function shallowClone(o) {\n if (isPlainObject(o))\n return { ...o };\n if (Array.isArray(o))\n return [...o];\n return o;\n}\nexport function numKeys(data) {\n let keyCount = 0;\n for (const key in data) {\n if (Object.prototype.hasOwnProperty.call(data, key)) {\n keyCount++;\n }\n }\n return keyCount;\n}\nexport const getParsedType = (data) => {\n const t = typeof data;\n switch (t) {\n case \"undefined\":\n return \"undefined\";\n case \"string\":\n return \"string\";\n case \"number\":\n return Number.isNaN(data) ? \"nan\" : \"number\";\n case \"boolean\":\n return \"boolean\";\n case \"function\":\n return \"function\";\n case \"bigint\":\n return \"bigint\";\n case \"symbol\":\n return \"symbol\";\n case \"object\":\n if (Array.isArray(data)) {\n return \"array\";\n }\n if (data === null) {\n return \"null\";\n }\n if (data.then && typeof data.then === \"function\" && data.catch && typeof data.catch === \"function\") {\n return \"promise\";\n }\n if (typeof Map !== \"undefined\" && data instanceof Map) {\n return \"map\";\n }\n if (typeof Set !== \"undefined\" && data instanceof Set) {\n return \"set\";\n }\n if (typeof Date !== \"undefined\" && data instanceof Date) {\n return \"date\";\n }\n // @ts-ignore\n if (typeof File !== \"undefined\" && data instanceof File) {\n return \"file\";\n }\n return \"object\";\n default:\n throw new Error(`Unknown data type: ${t}`);\n }\n};\nexport const propertyKeyTypes = new Set([\"string\", \"number\", \"symbol\"]);\nexport const primitiveTypes = new Set([\"string\", \"number\", \"bigint\", \"boolean\", \"symbol\", \"undefined\"]);\nexport function escapeRegex(str) {\n return str.replace(/[.*+?^${}()|[\\]\\\\]/g, \"\\\\$&\");\n}\n// zod-specific utils\nexport function clone(inst, def, params) {\n const cl = new inst._zod.constr(def ?? inst._zod.def);\n if (!def || params?.parent)\n cl._zod.parent = inst;\n return cl;\n}\nexport function normalizeParams(_params) {\n const params = _params;\n if (!params)\n return {};\n if (typeof params === \"string\")\n return { error: () => params };\n if (params?.message !== undefined) {\n if (params?.error !== undefined)\n throw new Error(\"Cannot specify both `message` and `error` params\");\n params.error = params.message;\n }\n delete params.message;\n if (typeof params.error === \"string\")\n return { ...params, error: () => params.error };\n return params;\n}\nexport function createTransparentProxy(getter) {\n let target;\n return new Proxy({}, {\n get(_, prop, receiver) {\n target ?? (target = getter());\n return Reflect.get(target, prop, receiver);\n },\n set(_, prop, value, receiver) {\n target ?? (target = getter());\n return Reflect.set(target, prop, value, receiver);\n },\n has(_, prop) {\n target ?? (target = getter());\n return Reflect.has(target, prop);\n },\n deleteProperty(_, prop) {\n target ?? (target = getter());\n return Reflect.deleteProperty(target, prop);\n },\n ownKeys(_) {\n target ?? (target = getter());\n return Reflect.ownKeys(target);\n },\n getOwnPropertyDescriptor(_, prop) {\n target ?? (target = getter());\n return Reflect.getOwnPropertyDescriptor(target, prop);\n },\n defineProperty(_, prop, descriptor) {\n target ?? (target = getter());\n return Reflect.defineProperty(target, prop, descriptor);\n },\n });\n}\nexport function stringifyPrimitive(value) {\n if (typeof value === \"bigint\")\n return value.toString() + \"n\";\n if (typeof value === \"string\")\n return `\"${value}\"`;\n return `${value}`;\n}\nexport function optionalKeys(shape) {\n return Object.keys(shape).filter((k) => {\n return shape[k]._zod.optin === \"optional\" && shape[k]._zod.optout === \"optional\";\n });\n}\nexport const NUMBER_FORMAT_RANGES = {\n safeint: [Number.MIN_SAFE_INTEGER, Number.MAX_SAFE_INTEGER],\n int32: [-2147483648, 2147483647],\n uint32: [0, 4294967295],\n float32: [-3.4028234663852886e38, 3.4028234663852886e38],\n float64: [-Number.MAX_VALUE, Number.MAX_VALUE],\n};\nexport const BIGINT_FORMAT_RANGES = {\n int64: [/* @__PURE__*/ BigInt(\"-9223372036854775808\"), /* @__PURE__*/ BigInt(\"9223372036854775807\")],\n uint64: [/* @__PURE__*/ BigInt(0), /* @__PURE__*/ BigInt(\"18446744073709551615\")],\n};\nexport function pick(schema, mask) {\n const currDef = schema._zod.def;\n const checks = currDef.checks;\n const hasChecks = checks && checks.length > 0;\n if (hasChecks) {\n throw new Error(\".pick() cannot be used on object schemas containing refinements\");\n }\n const def = mergeDefs(schema._zod.def, {\n get shape() {\n const newShape = {};\n for (const key in mask) {\n if (!(key in currDef.shape)) {\n throw new Error(`Unrecognized key: \"${key}\"`);\n }\n if (!mask[key])\n continue;\n newShape[key] = currDef.shape[key];\n }\n assignProp(this, \"shape\", newShape); // self-caching\n return newShape;\n },\n checks: [],\n });\n return clone(schema, def);\n}\nexport function omit(schema, mask) {\n const currDef = schema._zod.def;\n const checks = currDef.checks;\n const hasChecks = checks && checks.length > 0;\n if (hasChecks) {\n throw new Error(\".omit() cannot be used on object schemas containing refinements\");\n }\n const def = mergeDefs(schema._zod.def, {\n get shape() {\n const newShape = { ...schema._zod.def.shape };\n for (const key in mask) {\n if (!(key in currDef.shape)) {\n throw new Error(`Unrecognized key: \"${key}\"`);\n }\n if (!mask[key])\n continue;\n delete newShape[key];\n }\n assignProp(this, \"shape\", newShape); // self-caching\n return newShape;\n },\n checks: [],\n });\n return clone(schema, def);\n}\nexport function extend(schema, shape) {\n if (!isPlainObject(shape)) {\n throw new Error(\"Invalid input to extend: expected a plain object\");\n }\n const checks = schema._zod.def.checks;\n const hasChecks = checks && checks.length > 0;\n if (hasChecks) {\n // Only throw if new shape overlaps with existing shape\n // Use getOwnPropertyDescriptor to check key existence without accessing values\n const existingShape = schema._zod.def.shape;\n for (const key in shape) {\n if (Object.getOwnPropertyDescriptor(existingShape, key) !== undefined) {\n throw new Error(\"Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.\");\n }\n }\n }\n const def = mergeDefs(schema._zod.def, {\n get shape() {\n const _shape = { ...schema._zod.def.shape, ...shape };\n assignProp(this, \"shape\", _shape); // self-caching\n return _shape;\n },\n });\n return clone(schema, def);\n}\nexport function safeExtend(schema, shape) {\n if (!isPlainObject(shape)) {\n throw new Error(\"Invalid input to safeExtend: expected a plain object\");\n }\n const def = mergeDefs(schema._zod.def, {\n get shape() {\n const _shape = { ...schema._zod.def.shape, ...shape };\n assignProp(this, \"shape\", _shape); // self-caching\n return _shape;\n },\n });\n return clone(schema, def);\n}\nexport function merge(a, b) {\n const def = mergeDefs(a._zod.def, {\n get shape() {\n const _shape = { ...a._zod.def.shape, ...b._zod.def.shape };\n assignProp(this, \"shape\", _shape); // self-caching\n return _shape;\n },\n get catchall() {\n return b._zod.def.catchall;\n },\n checks: [], // delete existing checks\n });\n return clone(a, def);\n}\nexport function partial(Class, schema, mask) {\n const currDef = schema._zod.def;\n const checks = currDef.checks;\n const hasChecks = checks && checks.length > 0;\n if (hasChecks) {\n throw new Error(\".partial() cannot be used on object schemas containing refinements\");\n }\n const def = mergeDefs(schema._zod.def, {\n get shape() {\n const oldShape = schema._zod.def.shape;\n const shape = { ...oldShape };\n if (mask) {\n for (const key in mask) {\n if (!(key in oldShape)) {\n throw new Error(`Unrecognized key: \"${key}\"`);\n }\n if (!mask[key])\n continue;\n // if (oldShape[key]!._zod.optin === \"optional\") continue;\n shape[key] = Class\n ? new Class({\n type: \"optional\",\n innerType: oldShape[key],\n })\n : oldShape[key];\n }\n }\n else {\n for (const key in oldShape) {\n // if (oldShape[key]!._zod.optin === \"optional\") continue;\n shape[key] = Class\n ? new Class({\n type: \"optional\",\n innerType: oldShape[key],\n })\n : oldShape[key];\n }\n }\n assignProp(this, \"shape\", shape); // self-caching\n return shape;\n },\n checks: [],\n });\n return clone(schema, def);\n}\nexport function required(Class, schema, mask) {\n const def = mergeDefs(schema._zod.def, {\n get shape() {\n const oldShape = schema._zod.def.shape;\n const shape = { ...oldShape };\n if (mask) {\n for (const key in mask) {\n if (!(key in shape)) {\n throw new Error(`Unrecognized key: \"${key}\"`);\n }\n if (!mask[key])\n continue;\n // overwrite with non-optional\n shape[key] = new Class({\n type: \"nonoptional\",\n innerType: oldShape[key],\n });\n }\n }\n else {\n for (const key in oldShape) {\n // overwrite with non-optional\n shape[key] = new Class({\n type: \"nonoptional\",\n innerType: oldShape[key],\n });\n }\n }\n assignProp(this, \"shape\", shape); // self-caching\n return shape;\n },\n });\n return clone(schema, def);\n}\n// invalid_type | too_big | too_small | invalid_format | not_multiple_of | unrecognized_keys | invalid_union | invalid_key | invalid_element | invalid_value | custom\nexport function aborted(x, startIndex = 0) {\n if (x.aborted === true)\n return true;\n for (let i = startIndex; i < x.issues.length; i++) {\n if (x.issues[i]?.continue !== true) {\n return true;\n }\n }\n return false;\n}\nexport function prefixIssues(path, issues) {\n return issues.map((iss) => {\n var _a;\n (_a = iss).path ?? (_a.path = []);\n iss.path.unshift(path);\n return iss;\n });\n}\nexport function unwrapMessage(message) {\n return typeof message === \"string\" ? message : message?.message;\n}\nexport function finalizeIssue(iss, ctx, config) {\n const full = { ...iss, path: iss.path ?? [] };\n // for backwards compatibility\n if (!iss.message) {\n const message = unwrapMessage(iss.inst?._zod.def?.error?.(iss)) ??\n unwrapMessage(ctx?.error?.(iss)) ??\n unwrapMessage(config.customError?.(iss)) ??\n unwrapMessage(config.localeError?.(iss)) ??\n \"Invalid input\";\n full.message = message;\n }\n // delete (full as any).def;\n delete full.inst;\n delete full.continue;\n if (!ctx?.reportInput) {\n delete full.input;\n }\n return full;\n}\nexport function getSizableOrigin(input) {\n if (input instanceof Set)\n return \"set\";\n if (input instanceof Map)\n return \"map\";\n // @ts-ignore\n if (input instanceof File)\n return \"file\";\n return \"unknown\";\n}\nexport function getLengthableOrigin(input) {\n if (Array.isArray(input))\n return \"array\";\n if (typeof input === \"string\")\n return \"string\";\n return \"unknown\";\n}\nexport function parsedType(data) {\n const t = typeof data;\n switch (t) {\n case \"number\": {\n return Number.isNaN(data) ? \"nan\" : \"number\";\n }\n case \"object\": {\n if (data === null) {\n return \"null\";\n }\n if (Array.isArray(data)) {\n return \"array\";\n }\n const obj = data;\n if (obj && Object.getPrototypeOf(obj) !== Object.prototype && \"constructor\" in obj && obj.constructor) {\n return obj.constructor.name;\n }\n }\n }\n return t;\n}\nexport function issue(...args) {\n const [iss, input, inst] = args;\n if (typeof iss === \"string\") {\n return {\n message: iss,\n code: \"custom\",\n input,\n inst,\n };\n }\n return { ...iss };\n}\nexport function cleanEnum(obj) {\n return Object.entries(obj)\n .filter(([k, _]) => {\n // return true if NaN, meaning it's not a number, thus a string key\n return Number.isNaN(Number.parseInt(k, 10));\n })\n .map((el) => el[1]);\n}\n// Codec utility functions\nexport function base64ToUint8Array(base64) {\n const binaryString = atob(base64);\n const bytes = new Uint8Array(binaryString.length);\n for (let i = 0; i < binaryString.length; i++) {\n bytes[i] = binaryString.charCodeAt(i);\n }\n return bytes;\n}\nexport function uint8ArrayToBase64(bytes) {\n let binaryString = \"\";\n for (let i = 0; i < bytes.length; i++) {\n binaryString += String.fromCharCode(bytes[i]);\n }\n return btoa(binaryString);\n}\nexport function base64urlToUint8Array(base64url) {\n const base64 = base64url.replace(/-/g, \"+\").replace(/_/g, \"/\");\n const padding = \"=\".repeat((4 - (base64.length % 4)) % 4);\n return base64ToUint8Array(base64 + padding);\n}\nexport function uint8ArrayToBase64url(bytes) {\n return uint8ArrayToBase64(bytes).replace(/\\+/g, \"-\").replace(/\\//g, \"_\").replace(/=/g, \"\");\n}\nexport function hexToUint8Array(hex) {\n const cleanHex = hex.replace(/^0x/, \"\");\n if (cleanHex.length % 2 !== 0) {\n throw new Error(\"Invalid hex string length\");\n }\n const bytes = new Uint8Array(cleanHex.length / 2);\n for (let i = 0; i < cleanHex.length; i += 2) {\n bytes[i / 2] = Number.parseInt(cleanHex.slice(i, i + 2), 16);\n }\n return bytes;\n}\nexport function uint8ArrayToHex(bytes) {\n return Array.from(bytes)\n .map((b) => b.toString(16).padStart(2, \"0\"))\n .join(\"\");\n}\n// instanceof\nexport class Class {\n constructor(..._args) { }\n}\n"],"x_google_ignoreList":[0],"mappings":";AAYA,SAAgB,EAAc,GAAS;CACnC,IAAM,IAAgB,OAAO,OAAO,EAAQ,CAAC,QAAQ,MAAM,OAAO,KAAM,SAAS;AAIjF,QAHe,OAAO,QAAQ,EAAQ,CACjC,QAAQ,CAAC,GAAG,OAAO,EAAc,QAAQ,CAAC,EAAE,KAAK,GAAG,CACpD,KAAK,CAAC,GAAG,OAAO,EAAE;;AAM3B,SAAgB,EAAsB,GAAG,GAAO;AAG5C,QAFI,OAAO,KAAU,WACV,EAAM,UAAU,GACpB;;AAEX,SAAgB,EAAO,GAAQ;AAE3B,QAAO,EACH,IAAI,QAAQ;EACE;GACN,IAAM,IAAQ,GAAQ;AAEtB,UADA,OAAO,eAAe,MAAM,SAAS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,OAAO,KAAU,WACV,WACJ;;AAuBX,SAAgB,EAAM,GAAG,GAAM;CAC3B,IAAM,CAAC,GAAK,GAAO,KAAQ;AAS3B,QARI,OAAO,KAAQ,WACR;EACH,SAAS;EACT,MAAM;EACN;EACA;EACH,GAEE,EAAE,GAAG,GAAK"}
@@ -0,0 +1,10 @@
1
+ //#region ../../node_modules/zod/v4/core/versions.js
2
+ var e = {
3
+ major: 4,
4
+ minor: 3,
5
+ patch: 6
6
+ };
7
+ //#endregion
8
+ export { e as version };
9
+
10
+ //# sourceMappingURL=versions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"versions.js","names":[],"sources":["../../../../../../../node_modules/zod/v4/core/versions.js"],"sourcesContent":["export const version = {\n major: 4,\n minor: 3,\n patch: 6,\n};\n"],"x_google_ignoreList":[0],"mappings":";AAAA,IAAa,IAAU;CACnB,OAAO;CACP,OAAO;CACP,OAAO;CACV"}
@@ -0,0 +1,12 @@
1
+ import { createContext as e, useContext as t } from "solid-js";
2
+ //#region src/useActor.ts
3
+ var n = e(null), r = n.Provider;
4
+ function i() {
5
+ let e = t(n);
6
+ if (!e) throw Error("useActor() must be called inside <PlayRenderer>");
7
+ return e;
8
+ }
9
+ //#endregion
10
+ export { r as ActorProvider, i as useActor };
11
+
12
+ //# sourceMappingURL=useActor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useActor.js","names":[],"sources":["../src/useActor.ts"],"sourcesContent":["/**\n * useActor — SolidJS hook for accessing the raw actor inside a PlayRenderer tree.\n *\n * Components rendered inside PlayRenderer can call useActor() to get direct\n * access to the actor instance without prop drilling.\n *\n * @throws {Error} If called outside a PlayRenderer tree\n *\n * @example\n * ```typescript\n * import { useActor } from \"@xmachines/play-solid\";\n *\n * function MyComponent() {\n * const actor = useActor();\n * return <button onClick={() => actor.send({ type: \"SUBMIT\" })}>Submit</button>;\n * }\n * ```\n *\n * @packageDocumentation\n */\n\nimport { createContext, useContext } from \"solid-js\";\nimport type { AbstractActor } from \"@xmachines/play-actor\";\nimport type { AnyActorLogic } from \"xstate\";\n\nexport type PlayActor = AbstractActor<AnyActorLogic>;\n\nconst ActorContext = createContext<PlayActor | null>(null);\n\n/**\n * SolidJS context `Provider` component for the actor.\n *\n * `PlayRenderer` uses this internally to make the actor available to all child\n * components via `useActor()`. Not typically needed outside framework internals\n * unless building a custom renderer wrapper.\n *\n * @example\n * ```tsx\n * // Custom wrapper that provides its own actor:\n * import { ActorProvider } from \"@xmachines/play-solid\";\n *\n * <ActorProvider value={myActor}>\n * <MyComponents />\n * </ActorProvider>\n * ```\n */\nexport const ActorProvider = ActorContext.Provider;\n\nexport function useActor(): PlayActor {\n\tconst actor = useContext(ActorContext);\n\tif (!actor) throw new Error(\"useActor() must be called inside <PlayRenderer>\");\n\treturn actor;\n}\n"],"mappings":";;AA2BA,IAAM,IAAe,EAAgC,KAAK,EAmB7C,IAAgB,EAAa;AAE1C,SAAgB,IAAsB;CACrC,IAAM,IAAQ,EAAW,EAAa;AACtC,KAAI,CAAC,EAAO,OAAU,MAAM,kDAAkD;AAC9E,QAAO"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xmachines/play-solid",
3
- "version": "1.0.0-beta.2",
3
+ "version": "1.0.0-beta.21",
4
4
  "description": "SolidJS renderer for XMachines Play architecture",
5
5
  "keywords": [
6
6
  "catalog",
@@ -20,37 +20,47 @@
20
20
  "type": "module",
21
21
  "exports": {
22
22
  ".": {
23
+ "source": "./src/index.ts",
23
24
  "types": "./dist/index.d.ts",
24
25
  "default": "./dist/index.js"
25
26
  }
26
27
  },
28
+ "publishConfig": {
29
+ "access": "public"
30
+ },
27
31
  "scripts": {
28
32
  "build": "vite build && tsc --build",
29
- "clean": "rm -rf dist tsconfig.tsbuildinfo",
30
- "typecheck": "tsc --noEmit",
31
- "test": "vitest run",
33
+ "clean": "rm -rf dist *.tsbuildinfo coverage .vitest-attachments test/browser/__screenshots__",
34
+ "test": "vitest",
32
35
  "test:watch": "vitest",
33
36
  "test:ui": "vitest --ui",
34
37
  "prepublishOnly": "npm run build"
35
38
  },
36
39
  "dependencies": {
37
- "@xmachines/play-actor": "1.0.0-beta.2",
38
- "@xmachines/play-catalog": "1.0.0-beta.2",
39
- "@xmachines/play-signals": "1.0.0-beta.2"
40
+ "@xmachines/play-actor": "1.0.0-beta.21",
41
+ "@xmachines/play-signals": "1.0.0-beta.21"
40
42
  },
41
43
  "devDependencies": {
44
+ "@json-render/core": "^0.16.0",
45
+ "@json-render/solid": "^0.16.0",
46
+ "@json-render/xstate": "^0.16.0",
42
47
  "@solidjs/testing-library": "^0.8.10",
43
- "@types/node": "^25.4.0",
44
- "solid-js": "^1.9.3",
45
- "typescript": "^5.7.0",
46
- "vite": "^7.3.1",
47
- "vite-plugin-solid": "^2.11.4",
48
- "vitest": "^4.0.18"
48
+ "@testing-library/jest-dom": "^6.9.1",
49
+ "@types/node": "^25.5.0",
50
+ "@xmachines/shared": "1.0.0-beta.21",
51
+ "@xstate/store": ">=3.17.0",
52
+ "jsdom": "^29.0.1",
53
+ "solid-js": "^1.9.12",
54
+ "typescript": "^5.9.3 || ^6.0.2",
55
+ "vite": "^8.0.0",
56
+ "vite-plugin-solid": "^2.11.11",
57
+ "vitest": "^4.1.2"
49
58
  },
50
59
  "peerDependencies": {
51
- "solid-js": "^1.8.0 || ^1.9.0"
52
- },
53
- "publishConfig": {
54
- "access": "public"
60
+ "@json-render/core": "^0.16.0",
61
+ "@json-render/solid": "^0.16.0",
62
+ "@json-render/xstate": "^0.16.0",
63
+ "@xstate/store": ">=3.17.0",
64
+ "solid-js": "^1.8.0"
55
65
  }
56
66
  }
@@ -1,63 +0,0 @@
1
- /**
2
- * PlayRenderer - Main SolidJS renderer component for XMachines Play architecture
3
- *
4
- * @packageDocumentation
5
- */
6
- import { type Component } from "solid-js";
7
- import type { PlayRendererProps } from "./types.js";
8
- /**
9
- * Main renderer component that subscribes to actor signals and renders UI
10
- *
11
- * Architecture (per XMachines Play patterns):
12
- * - Subscribes to actor.currentView signal via TC39 Signal.subtle.Watcher
13
- * - Dynamically renders catalog components based on view.component string
14
- * - Forwards user events to actor via actor.send()
15
- * - SolidJS signal only for triggering renders, NOT business logic
16
- *
17
- * Invariant: Actor Authority - Actor decides all state transitions via guards.
18
- * Invariant: Passive Infrastructure - Component observes signals and sends events.
19
- * Invariant: Signal-Only Reactivity - Business logic state lives in actor signals.
20
- *
21
- * @example
22
- * ```typescript
23
- * import { PlayRenderer } from "@xmachines/play-solidjs";
24
- * import { definePlayer } from "@xmachines/play-xstate";
25
- *
26
- * const actor = definePlayer({ machine, catalog })();
27
- * actor.start();
28
- *
29
- * const components = {
30
- * Dashboard: (props) => <div>User: {props.userId}</div>,
31
- * LoginForm: (props) => (
32
- * <form onSubmit={(e) => {
33
- * e.preventDefault();
34
- * props.send({ type: "auth.login", payload: {...} });
35
- * }}>...</form>
36
- * )
37
- * };
38
- *
39
- * <PlayRenderer actor={actor} components={components} />
40
- * ```
41
- *
42
- * @param props - Component props
43
- * @returns SolidJS element rendering current view from actor
44
- *
45
- * @remarks
46
- * **Component lookup:** Dynamically looks up component from `components` map
47
- * using `view.component` string from actor.currentView signal.
48
- *
49
- * **Event forwarding:** Injects `send` function as prop to components. Components
50
- * call `send(event)` to forward intents to actor. Actor guards decide validity.
51
- *
52
- * **Error handling:** If component not found in catalog, logs error and shows
53
- * fallback. This indicates missing component registration, not runtime error.
54
- *
55
- * **Signal bridge:** Uses one-shot re-watch pattern. TC39 Signal watchers stop
56
- * watching after notification, so watcher.watch() must be called in microtask
57
- * after getPending() to re-arm for next notification.
58
- *
59
- * **CRITICAL:** Never call actor.send() during render - only in event handlers.
60
- * Calling send during render causes infinite render loops.
61
- */
62
- export declare const PlayRenderer: Component<PlayRendererProps>;
63
- //# sourceMappingURL=PlayRenderer.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"PlayRenderer.d.ts","sourceRoot":"","sources":["../src/PlayRenderer.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAyB,KAAK,SAAS,EAAE,MAAM,UAAU,CAAC;AAGjE,OAAO,KAAK,EAAE,iBAAiB,EAAa,MAAM,YAAY,CAAC;AAE/D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqDG;AACH,eAAO,MAAM,YAAY,EAAE,SAAS,CAAC,iBAAiB,CA2ErD,CAAC"}
package/dist/index.d.ts DELETED
@@ -1,8 +0,0 @@
1
- /**
2
- * SolidJS renderer for XMachines Play architecture
3
- *
4
- * @packageDocumentation
5
- */
6
- export { PlayRenderer } from "./PlayRenderer.js";
7
- export type { PlayRendererProps } from "./types.js";
8
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,YAAY,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC"}
package/dist/index.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
package/dist/types.d.ts DELETED
@@ -1,28 +0,0 @@
1
- /**
2
- * TypeScript type definitions for play-solidjs
3
- *
4
- * @packageDocumentation
5
- */
6
- import type { AbstractActor, Viewable } from "@xmachines/play-actor";
7
- import type { JSX, ValidComponent } from "solid-js";
8
- import type { AnyActorLogic } from "xstate";
9
- export type SolidView = {
10
- component: string;
11
- props: Record<string, unknown>;
12
- } | null;
13
- /**
14
- * Props for PlayRenderer component
15
- *
16
- * @property actor - Actor instance with currentView signal (requires Viewable capability)
17
- * @property components - Map of component names to SolidJS components
18
- * @property fallback - Optional element shown when currentView is null
19
- */
20
- export interface PlayRendererProps {
21
- /** Actor instance with currentView signal (requires Viewable capability) */
22
- actor: AbstractActor<AnyActorLogic> & Viewable;
23
- /** Map of component names to SolidJS components */
24
- components: Record<string, ValidComponent>;
25
- /** Optional element shown when currentView is null */
26
- fallback?: JSX.Element;
27
- }
28
- //# sourceMappingURL=types.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACrE,OAAO,KAAK,EAAE,GAAG,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AACpD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;AAE5C,MAAM,MAAM,SAAS,GAAG;IAAE,SAAS,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CAAE,GAAG,IAAI,CAAC;AAErF;;;;;;GAMG;AACH,MAAM,WAAW,iBAAiB;IACjC,4EAA4E;IAC5E,KAAK,EAAE,aAAa,CAAC,aAAa,CAAC,GAAG,QAAQ,CAAC;IAE/C,mDAAmD;IACnD,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC;IAE3C,sDAAsD;IACtD,QAAQ,CAAC,EAAE,GAAG,CAAC,OAAO,CAAC;CACvB"}