@xmachines/play-vue 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 (74) hide show
  1. package/README.md +214 -84
  2. package/dist/PlayRenderer.js +7 -0
  3. package/dist/PlayRenderer.js.map +1 -0
  4. package/dist/PlayRenderer.vue_vue_type_script_lang.js +57 -0
  5. package/dist/PlayRenderer.vue_vue_type_script_lang.js.map +1 -0
  6. package/dist/define-registry.d.ts +79 -0
  7. package/dist/define-registry.d.ts.map +1 -0
  8. package/dist/define-registry.js +21 -0
  9. package/dist/define-registry.js.map +1 -0
  10. package/dist/index.d.ts +15 -1
  11. package/dist/index.d.ts.map +1 -1
  12. package/dist/index.js +5 -5
  13. package/dist/node_modules/@json-render/core/dist/chunk-AFLK3Q4T.js +111 -0
  14. package/dist/node_modules/@json-render/core/dist/chunk-AFLK3Q4T.js.map +1 -0
  15. package/dist/node_modules/@json-render/core/dist/index.js +956 -0
  16. package/dist/node_modules/@json-render/core/dist/index.js.map +1 -0
  17. package/dist/node_modules/@json-render/core/dist/store-utils.js +1 -0
  18. package/dist/node_modules/@json-render/vue/dist/chunk-WIPZLAF7.js +57 -0
  19. package/dist/node_modules/@json-render/vue/dist/chunk-WIPZLAF7.js.map +1 -0
  20. package/dist/node_modules/@json-render/vue/dist/index.js +796 -0
  21. package/dist/node_modules/@json-render/vue/dist/index.js.map +1 -0
  22. package/dist/node_modules/@json-render/xstate/dist/index.js +20 -0
  23. package/dist/node_modules/@json-render/xstate/dist/index.js.map +1 -0
  24. package/dist/node_modules/@xstate/store/dist/store-69e7e2d5.esm.js +227 -0
  25. package/dist/node_modules/@xstate/store/dist/store-69e7e2d5.esm.js.map +1 -0
  26. package/dist/node_modules/zod/v4/classic/errors.js +25 -0
  27. package/dist/node_modules/zod/v4/classic/errors.js.map +1 -0
  28. package/dist/node_modules/zod/v4/classic/iso.js +33 -0
  29. package/dist/node_modules/zod/v4/classic/iso.js.map +1 -0
  30. package/dist/node_modules/zod/v4/classic/parse.js +8 -0
  31. package/dist/node_modules/zod/v4/classic/parse.js.map +1 -0
  32. package/dist/node_modules/zod/v4/classic/schemas.js +362 -0
  33. package/dist/node_modules/zod/v4/classic/schemas.js.map +1 -0
  34. package/dist/node_modules/zod/v4/core/api.js +530 -0
  35. package/dist/node_modules/zod/v4/core/api.js.map +1 -0
  36. package/dist/node_modules/zod/v4/core/checks.js +285 -0
  37. package/dist/node_modules/zod/v4/core/checks.js.map +1 -0
  38. package/dist/node_modules/zod/v4/core/core.js +46 -0
  39. package/dist/node_modules/zod/v4/core/core.js.map +1 -0
  40. package/dist/node_modules/zod/v4/core/doc.js +25 -0
  41. package/dist/node_modules/zod/v4/core/doc.js.map +1 -0
  42. package/dist/node_modules/zod/v4/core/errors.js +43 -0
  43. package/dist/node_modules/zod/v4/core/errors.js.map +1 -0
  44. package/dist/node_modules/zod/v4/core/json-schema-processors.js +183 -0
  45. package/dist/node_modules/zod/v4/core/json-schema-processors.js.map +1 -0
  46. package/dist/node_modules/zod/v4/core/parse.js +70 -0
  47. package/dist/node_modules/zod/v4/core/parse.js.map +1 -0
  48. package/dist/node_modules/zod/v4/core/regexes.js +27 -0
  49. package/dist/node_modules/zod/v4/core/regexes.js.map +1 -0
  50. package/dist/node_modules/zod/v4/core/registries.js +42 -0
  51. package/dist/node_modules/zod/v4/core/registries.js.map +1 -0
  52. package/dist/node_modules/zod/v4/core/schemas.js +823 -0
  53. package/dist/node_modules/zod/v4/core/schemas.js.map +1 -0
  54. package/dist/node_modules/zod/v4/core/to-json-schema.js +224 -0
  55. package/dist/node_modules/zod/v4/core/to-json-schema.js.map +1 -0
  56. package/dist/node_modules/zod/v4/core/util.js +268 -0
  57. package/dist/node_modules/zod/v4/core/util.js.map +1 -0
  58. package/dist/node_modules/zod/v4/core/versions.js +10 -0
  59. package/dist/node_modules/zod/v4/core/versions.js.map +1 -0
  60. package/dist/types.d.ts +31 -7
  61. package/dist/types.d.ts.map +1 -1
  62. package/dist/useActor.d.ts +35 -0
  63. package/dist/useActor.d.ts.map +1 -0
  64. package/dist/useActor.js +15 -0
  65. package/dist/useActor.js.map +1 -0
  66. package/package.json +31 -23
  67. package/dist/PlayRenderer.vue.js +0 -8
  68. package/dist/PlayRenderer.vue.js.map +0 -1
  69. package/dist/PlayRenderer.vue2.js +0 -48
  70. package/dist/PlayRenderer.vue2.js.map +0 -1
  71. package/dist/_virtual/_plugin-vue_export-helper.js +0 -10
  72. package/dist/_virtual/_plugin-vue_export-helper.js.map +0 -1
  73. package/dist/index.css +0 -1
  74. package/dist/index.js.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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GAAK,GAAQ;CAC5C,IAAM,IAAO;EAAE,GAAG;EAAK,MAAM,EAAI,QAAQ,EAAE;EAAE;AAgB7C,QAdK,EAAI,YAML,EAAK,UALW,EAAc,EAAI,MAAM,KAAK,KAAK,QAAQ,EAAI,CAAC,IAC3D,EAAc,GAAK,QAAQ,EAAI,CAAC,IAChC,EAAc,EAAO,cAAc,EAAI,CAAC,IACxC,EAAc,EAAO,cAAc,EAAI,CAAC,IACxC,kBAIR,OAAO,EAAK,MACZ,OAAO,EAAK,UACP,GAAK,eACN,OAAO,EAAK,OAET;;AAYX,SAAgB,EAAoB,GAAO;AAKvC,QAJI,MAAM,QAAQ,EAAM,GACb,UACP,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"}
package/dist/types.d.ts CHANGED
@@ -3,19 +3,43 @@
3
3
  *
4
4
  * @packageDocumentation
5
5
  */
6
+ import type { ComponentRegistry } from "@json-render/vue";
7
+ import type { StateStore } from "@json-render/core";
6
8
  import type { AbstractActor, Viewable } from "@xmachines/play-actor";
7
- import type { Component } from "vue";
8
- import type { AnyActorLogic } from "xstate";
9
+ import type { AnyActorLogic, EventFromLogic } from "xstate";
9
10
  /**
10
11
  * Props for PlayRenderer component
11
12
  *
13
+ * @typeParam TLogic - The XState actor logic type. Defaults to `AnyActorLogic` for
14
+ * non-generic usage. When a specific machine type is provided, the `actions` values
15
+ * are constrained to the event type strings that the machine actually accepts.
16
+ *
12
17
  * @property actor - Actor instance with currentView signal (requires Viewable capability)
13
- * @property components - Map of component names to Vue components
18
+ * @property registry - Component registry from @json-render/vue defineRegistry
19
+ * @property actions - Optional map of json-render action names to XState event type strings.
20
+ * Values are constrained to `EventFromLogic<TLogic>["type"]` — passing a non-existent
21
+ * event type string is a compile error when TLogic is specified.
14
22
  */
15
- export interface PlayRendererProps {
23
+ export interface PlayRendererProps<TLogic extends AnyActorLogic = AnyActorLogic> {
16
24
  /** Actor instance with currentView signal (requires Viewable capability) */
17
- actor: AbstractActor<AnyActorLogic> & Viewable;
18
- /** Map of component names to Vue components */
19
- components: Record<string, Component>;
25
+ actor: AbstractActor<TLogic> & Viewable;
26
+ /** Component registry from @json-render/vue defineRegistry */
27
+ registry: ComponentRegistry;
28
+ /**
29
+ * Optional external StateStore (e.g. from `xstateStoreStateStore` in @json-render/xstate).
30
+ * When provided, PlayRenderer operates in controlled mode — spec.state is ignored and
31
+ * this store is the single source of truth for UI state (form values, etc.).
32
+ * When omitted, a fresh @xstate/store atom is created internally per view transition,
33
+ * seeded from spec.state.
34
+ */
35
+ store?: StateStore;
36
+ /**
37
+ * Optional map of json-render action names to XState event type strings.
38
+ * Values are constrained to valid event types for TLogic — wrong event type strings
39
+ * are caught at compile time when TLogic is specified.
40
+ */
41
+ actions?: {
42
+ [actionName: string]: EventFromLogic<TLogic>["type"];
43
+ };
20
44
  }
21
45
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
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,SAAS,EAAE,MAAM,KAAK,CAAC;AACrC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;AAE5C;;;;;GAKG;AACH,MAAM,WAAW,iBAAiB;IACjC,4EAA4E;IAC5E,KAAK,EAAE,aAAa,CAAC,aAAa,CAAC,GAAG,QAAQ,CAAC;IAE/C,+CAA+C;IAC/C,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;CACtC"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAC1D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,KAAK,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACrE,OAAO,KAAK,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,QAAQ,CAAC;AAE5D;;;;;;;;;;;;GAYG;AACH,MAAM,WAAW,iBAAiB,CAAC,MAAM,SAAS,aAAa,GAAG,aAAa;IAC9E,4EAA4E;IAC5E,KAAK,EAAE,aAAa,CAAC,MAAM,CAAC,GAAG,QAAQ,CAAC;IAExC,8DAA8D;IAC9D,QAAQ,EAAE,iBAAiB,CAAC;IAE5B;;;;;;OAMG;IACH,KAAK,CAAC,EAAE,UAAU,CAAC;IAEnB;;;;OAIG;IACH,OAAO,CAAC,EAAE;QAAE,CAAC,UAAU,EAAE,MAAM,GAAG,cAAc,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,CAAA;KAAE,CAAC;CACnE"}
@@ -0,0 +1,35 @@
1
+ /**
2
+ * useActor — Vue composable for accessing the raw actor inside a PlayRenderer tree.
3
+ *
4
+ * Components rendered inside PlayRenderer can call useActor() to get direct
5
+ * access to the actor instance without prop drilling.
6
+ *
7
+ * @throws {Error} If called outside a PlayRenderer tree
8
+ *
9
+ * @example
10
+ * ```typescript
11
+ * import { useActor } from "@xmachines/play-vue";
12
+ *
13
+ * const actor = useActor();
14
+ * actor.send({ type: "SUBMIT" });
15
+ * ```
16
+ *
17
+ * @packageDocumentation
18
+ */
19
+ import type { InjectionKey } from "vue";
20
+ import type { AbstractActor } from "@xmachines/play-actor";
21
+ import type { AnyActorLogic } from "xstate";
22
+ export type PlayActor = AbstractActor<AnyActorLogic>;
23
+ export declare const ActorKey: InjectionKey<PlayActor>;
24
+ /**
25
+ * Provide the actor to all descendant components via Vue's inject/provide mechanism.
26
+ *
27
+ * Called inside `PlayRenderer.vue`'s `setup()` to make the actor available to any
28
+ * child component that calls `useActor()`. Not typically needed outside framework
29
+ * internals unless building a custom renderer wrapper.
30
+ *
31
+ * @param actor - The actor instance to inject into the component tree.
32
+ */
33
+ export declare function provideActor(actor: PlayActor): void;
34
+ export declare function useActor(): PlayActor;
35
+ //# sourceMappingURL=useActor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useActor.d.ts","sourceRoot":"","sources":["../src/useActor.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAGH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,KAAK,CAAC;AACxC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;AAE5C,MAAM,MAAM,SAAS,GAAG,aAAa,CAAC,aAAa,CAAC,CAAC;AAErD,eAAO,MAAM,QAAQ,EAAE,YAAY,CAAC,SAAS,CAA6B,CAAC;AAE3E;;;;;;;;GAQG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,SAAS,GAAG,IAAI,CAEnD;AAED,wBAAgB,QAAQ,IAAI,SAAS,CAIpC"}
@@ -0,0 +1,15 @@
1
+ import { inject as e, provide as t } from "vue";
2
+ //#region src/useActor.ts
3
+ var n = Symbol("xmachines.actor");
4
+ function r(e) {
5
+ t(n, e);
6
+ }
7
+ function i() {
8
+ let t = e(n);
9
+ if (!t) throw Error("useActor() must be called inside <PlayRenderer>");
10
+ return t;
11
+ }
12
+ //#endregion
13
+ export { r as provideActor, i as useActor };
14
+
15
+ //# sourceMappingURL=useActor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useActor.js","names":[],"sources":["../src/useActor.ts"],"sourcesContent":["/**\n * useActor — Vue composable 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-vue\";\n *\n * const actor = useActor();\n * actor.send({ type: \"SUBMIT\" });\n * ```\n *\n * @packageDocumentation\n */\n\nimport { inject, provide } from \"vue\";\nimport type { InjectionKey } from \"vue\";\nimport type { AbstractActor } from \"@xmachines/play-actor\";\nimport type { AnyActorLogic } from \"xstate\";\n\nexport type PlayActor = AbstractActor<AnyActorLogic>;\n\nexport const ActorKey: InjectionKey<PlayActor> = Symbol(\"xmachines.actor\");\n\n/**\n * Provide the actor to all descendant components via Vue's inject/provide mechanism.\n *\n * Called inside `PlayRenderer.vue`'s `setup()` to make the actor available to any\n * child component that calls `useActor()`. Not typically needed outside framework\n * internals unless building a custom renderer wrapper.\n *\n * @param actor - The actor instance to inject into the component tree.\n */\nexport function provideActor(actor: PlayActor): void {\n\tprovide(ActorKey, actor);\n}\n\nexport function useActor(): PlayActor {\n\tconst actor = inject(ActorKey);\n\tif (!actor) throw new Error(\"useActor() must be called inside <PlayRenderer>\");\n\treturn actor;\n}\n"],"mappings":";;AA0BA,IAAa,IAAoC,OAAO,kBAAkB;AAW1E,SAAgB,EAAa,GAAwB;AACpD,GAAQ,GAAU,EAAM;;AAGzB,SAAgB,IAAsB;CACrC,IAAM,IAAQ,EAAO,EAAS;AAC9B,KAAI,CAAC,EAAO,OAAU,MAAM,kDAAkD;AAC9E,QAAO"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xmachines/play-vue",
3
- "version": "1.0.0-beta.2",
3
+ "version": "1.0.0-beta.21",
4
4
  "description": "Vue renderer for XMachines Play architecture",
5
5
  "keywords": [
6
6
  "reactive",
@@ -14,46 +14,54 @@
14
14
  "type": "git",
15
15
  "url": "git@gitlab.com:xmachin-es/xmachines-js.git"
16
16
  },
17
+ "files": [
18
+ "dist",
19
+ "README.md",
20
+ "LICENSE"
21
+ ],
17
22
  "type": "module",
18
23
  "main": "./dist/index.js",
19
24
  "types": "./dist/index.d.ts",
20
25
  "exports": {
21
26
  ".": {
27
+ "source": "./src/index.ts",
22
28
  "types": "./dist/index.d.ts",
23
29
  "default": "./dist/index.js"
24
30
  }
25
31
  },
32
+ "publishConfig": {
33
+ "access": "public"
34
+ },
26
35
  "scripts": {
27
36
  "build": "vite build && tsc --build --force",
28
- "clean": "rm -rf dist",
29
- "typecheck": "tsc --noEmit",
30
- "test": "vitest run",
37
+ "clean": "rm -rf dist *.tsbuildinfo coverage .vitest-attachments test/browser/__screenshots__",
38
+ "test": "vitest",
31
39
  "test:watch": "vitest",
32
40
  "prepublishOnly": "npm run build"
33
41
  },
34
42
  "dependencies": {
35
- "@xmachines/play-actor": "1.0.0-beta.2",
36
- "@xmachines/play-catalog": "1.0.0-beta.2",
37
- "@xmachines/play-signals": "1.0.0-beta.2"
43
+ "@xmachines/play": "1.0.0-beta.21",
44
+ "@xmachines/play-actor": "1.0.0-beta.21",
45
+ "@xmachines/play-signals": "1.0.0-beta.21"
38
46
  },
39
47
  "devDependencies": {
40
- "@types/node": "^25.4.0",
41
- "@vitejs/plugin-vue": "^6.0.4",
48
+ "@json-render/core": "^0.16.0",
49
+ "@json-render/vue": "^0.16.0",
50
+ "@json-render/xstate": "^0.16.0",
51
+ "@types/node": "^25.5.0",
52
+ "@vitejs/plugin-vue": "^6.0.5",
42
53
  "@vue/test-utils": "^2.4.6",
43
- "jsdom": "^28.0.0",
44
- "typescript": "^5.7.0",
45
- "vitest": "^4.0.18",
46
- "vue": "^3.5.30"
54
+ "@xmachines/shared": "1.0.0-beta.21",
55
+ "@xstate/store": ">=3.17.0",
56
+ "typescript": "^5.9.3 || ^6.0.2",
57
+ "vitest": "^4.1.2",
58
+ "vue": "^3.5.31"
47
59
  },
48
60
  "peerDependencies": {
49
- "vue": "^3.5.30"
50
- },
51
- "publishConfig": {
52
- "access": "public"
53
- },
54
- "files": [
55
- "dist",
56
- "README.md",
57
- "LICENSE"
58
- ]
61
+ "@json-render/core": "^0.16.0",
62
+ "@json-render/vue": "^0.16.0",
63
+ "@json-render/xstate": "^0.16.0",
64
+ "@xstate/store": ">=3.17.0",
65
+ "vue": "^3.5.0"
66
+ }
59
67
  }
@@ -1,8 +0,0 @@
1
- import e from "./PlayRenderer.vue2.js";
2
- /* empty css */
3
- import o from "./_virtual/_plugin-vue_export-helper.js";
4
- const m = /* @__PURE__ */ o(e, [["__scopeId", "data-v-275eda6e"]]);
5
- export {
6
- m as default
7
- };
8
- //# sourceMappingURL=PlayRenderer.vue.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"PlayRenderer.vue.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}
@@ -1,48 +0,0 @@
1
- import { defineComponent as m, toRaw as a, ref as d, onUnmounted as p, computed as f, h as l } from "vue";
2
- import { Signal as v } from "@xmachines/play-signals";
3
- const g = m({
4
- name: "PlayRenderer",
5
- props: {
6
- actor: {
7
- type: Object,
8
- required: !0
9
- },
10
- components: {
11
- type: Object,
12
- required: !0
13
- }
14
- },
15
- setup(t, { slots: r }) {
16
- const n = a(t.actor), i = n.currentView.get(), e = d(i), o = new v.subtle.Watcher(() => {
17
- queueMicrotask(() => {
18
- o.getPending(), e.value = n.currentView.get(), o.watch(n.currentView);
19
- });
20
- });
21
- o.watch(n.currentView), p(() => {
22
- o.unwatch(n.currentView);
23
- });
24
- const s = n.send.bind(n), c = f(() => {
25
- if (!e.value) return null;
26
- if (!t.components)
27
- return console.error(
28
- `Components catalog is ${t.components === null ? "null" : "undefined"}. Cannot render component "${e.value.component}".`
29
- ), null;
30
- const u = a(t.components[e.value.component]);
31
- return u || (console.error(
32
- `Component "${e.value.component}" not found in catalog. Available components: ${Object.keys(t.components).join(", ")}`
33
- ), null);
34
- });
35
- return () => e.value ? c.value ? l(c.value, {
36
- ...e.value.props,
37
- send: s
38
- }) : l(
39
- "div",
40
- { class: "play-renderer-error" },
41
- `Component "${e.value.component}" not found in catalog`
42
- ) : r.fallback ? r.fallback() : null;
43
- }
44
- });
45
- export {
46
- g as default
47
- };
48
- //# sourceMappingURL=PlayRenderer.vue2.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"PlayRenderer.vue2.js","sources":["../src/PlayRenderer.vue"],"sourcesContent":["<script lang=\"ts\">\n/**\n * PlayRenderer - Main Vue renderer component for XMachines Play architecture\n *\n * Architecture (per RESEARCH.md Pattern 1):\n * - Subscribes to actor.currentView signal via Signal.subtle.Watcher\n * - Dynamically renders catalog components based on view.component string\n * - Forwards user events to actor via actor.send()\n * - Vue ref only for triggering renders, NOT business logic\n *\n * Signal bridge uses one-shot re-watch pattern:\n * TC39 Signal watchers stop watching after notification, so watcher.watch()\n * must be called inside a microtask after getPending() to re-arm for the\n * next notification.\n *\n * CRITICAL: Never call signal.get() or signal.set() inside the Watcher's\n * notify callback. The callback runs synchronously during the signal graph's\n * dirty-propagation phase. All reads must be deferred to a queueMicrotask.\n *\n * @invariant Actor Authority - Actor decides all state transitions via guards\n * @invariant Passive Infrastructure - Component observes signals, sends events\n * @invariant Signal-Only Reactivity - Business logic state lives in actor signals\n */\n\nimport { defineComponent, ref, computed, toRaw, onUnmounted, h, type PropType } from \"vue\";\nimport { Signal } from \"@xmachines/play-signals\";\nimport type { PlayRendererProps } from \"./types.js\";\nimport type { AbstractActor, Viewable } from \"@xmachines/play-actor\";\nimport type { AnyActorLogic } from \"xstate\";\nimport type { Component } from \"vue\";\n\nexport default defineComponent({\n\tname: \"PlayRenderer\",\n\tprops: {\n\t\tactor: {\n\t\t\ttype: Object as PropType<AbstractActor<AnyActorLogic> & Viewable>,\n\t\t\trequired: true,\n\t\t},\n\t\tcomponents: {\n\t\t\ttype: Object as PropType<Record<string, Component>>,\n\t\t\trequired: true,\n\t\t},\n\t},\n\tsetup(props, { slots }) {\n\t\t// Unwrap actor from Vue's reactive proxy to access raw Signal objects\n\t\t// CRITICAL: toRaw() preserves Signal's 'this' binding for .get() and watcher operations\n\t\tconst actor = toRaw(props.actor);\n\n\t\t// Get initial value from unwrapped signal\n\t\tconst initialView = actor.currentView.get();\n\n\t\t// Vue ref for triggering re-renders (NOT business logic state)\n\t\t// Signal is source of truth, ref is just Vue's render trigger\n\t\tconst view = ref<{ component: string; props: Record<string, unknown> } | null>(initialView);\n\n\t\t// Signal watcher for bridging TC39 Signals to Vue reactivity\n\t\t// Created immediately (not in onMounted) so signal changes during the\n\t\t// synchronous mount phase are captured.\n\t\t//\n\t\t// The notify callback runs synchronously during the signal graph's\n\t\t// dirty-propagation phase. NEVER read (.get()) or write (.set()) signals\n\t\t// inside it. Only schedule a microtask to do the actual work.\n\t\tconst watcher = new Signal.subtle.Watcher(() => {\n\t\t\tqueueMicrotask(() => {\n\t\t\t\t// Step 1: Acknowledge notification (clears watcher's dirty flags)\n\t\t\t\twatcher.getPending();\n\n\t\t\t\t// Step 2: Read signal value (safe — notification phase is over)\n\t\t\t\tview.value = actor.currentView.get();\n\n\t\t\t\t// Step 3: Re-watch for next notification (one-shot pattern)\n\t\t\t\t// TC39 watchers stop notifying after first notification until re-armed\n\t\t\t\twatcher.watch(actor.currentView);\n\t\t\t});\n\t\t});\n\n\t\t// Start watching the signal\n\t\twatcher.watch(actor.currentView);\n\n\t\tonUnmounted(() => {\n\t\t\t// Unwatch to stop receiving notifications\n\t\t\twatcher.unwatch(actor.currentView);\n\t\t});\n\n\t\t// Bind send function to actor for correct 'this' context\n\t\tconst sendBound = actor.send.bind(actor);\n\n\t\t// Compute Component from view.component lookup\n\t\tconst ResolvedComponent = computed(() => {\n\t\t\tif (!view.value) return null;\n\n\t\t\t// Handle null/undefined components catalog gracefully\n\t\t\tif (!props.components) {\n\t\t\t\tconsole.error(\n\t\t\t\t\t`Components catalog is ${props.components === null ? \"null\" : \"undefined\"}. ` +\n\t\t\t\t\t\t`Cannot render component \"${view.value.component}\".`,\n\t\t\t\t);\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\t// Look up component from catalog\n\t\t\tconst comp = toRaw(props.components[view.value.component]);\n\n\t\t\tif (!comp) {\n\t\t\t\tconsole.error(\n\t\t\t\t\t`Component \"${view.value.component}\" not found in catalog. ` +\n\t\t\t\t\t\t`Available components: ${Object.keys(props.components).join(\", \")}`,\n\t\t\t\t);\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\treturn comp;\n\t\t});\n\n\t\t// Use render function to avoid Vue 3.5 SFC template <slot> + jsdom renderSlot crash\n\t\treturn () => {\n\t\t\t// No view — show fallback slot\n\t\t\tif (!view.value) {\n\t\t\t\treturn slots.fallback ? slots.fallback() : null;\n\t\t\t}\n\n\t\t\t// View exists but component not found\n\t\t\tif (!ResolvedComponent.value) {\n\t\t\t\treturn h(\n\t\t\t\t\t\"div\",\n\t\t\t\t\t{ class: \"play-renderer-error\" },\n\t\t\t\t\t`Component \"${view.value.component}\" not found in catalog`,\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t// Render matched component dynamically\n\t\t\treturn h(ResolvedComponent.value, {\n\t\t\t\t...view.value.props,\n\t\t\t\tsend: sendBound,\n\t\t\t});\n\t\t};\n\t},\n});\n</script>\n\n<style scoped>\n.play-renderer-error {\n\tpadding: 1rem;\n\tbackground-color: #fee;\n\tborder: 1px solid #fcc;\n\tborder-radius: 4px;\n\tcolor: #c00;\n\tfont-family: monospace;\n}\n</style>\n"],"names":["_sfc_main","defineComponent","props","slots","actor","toRaw","initialView","view","ref","watcher","Signal","onUn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EH,EAAkB,OAAO;AAAA,MACjC,GAAGN,EAAK,MAAM;AAAA,MACd,MAAMK;AAAA,IAAA,CACN,IAXOI;AAAA,MACN;AAAA,MACA,EAAE,OAAO,sBAAA;AAAA,MACT,cAAcT,EAAK,MAAM,SAAS;AAAA,IAAA,IAR5BJ,EAAM,WAAWA,EAAM,SAAA,IAAa;AAAA,EAkB9C;AACD,CAAC;"}
@@ -1,10 +0,0 @@
1
- const s = (t, e) => {
2
- const o = t.__vccOpts || t;
3
- for (const [r, c] of e)
4
- o[r] = c;
5
- return o;
6
- };
7
- export {
8
- s as default
9
- };
10
- //# sourceMappingURL=_plugin-vue_export-helper.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"_plugin-vue_export-helper.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;"}