@xmachines/play-actor 1.0.0-beta.55 → 1.0.0-beta.57
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md
CHANGED
|
@@ -9,13 +9,13 @@ Part of the [xmachines-js monorepo](../../README.md).
|
|
|
9
9
|
## Installation
|
|
10
10
|
|
|
11
11
|
```bash
|
|
12
|
-
|
|
12
|
+
pnpm add @xmachines/play-actor
|
|
13
13
|
```
|
|
14
14
|
|
|
15
15
|
**Peer dependencies** — install alongside the package:
|
|
16
16
|
|
|
17
17
|
```bash
|
|
18
|
-
|
|
18
|
+
pnpm add xstate @xmachines/play @xmachines/play-signals
|
|
19
19
|
```
|
|
20
20
|
|
|
21
21
|
## Overview
|
|
@@ -103,7 +103,7 @@ meta: {
|
|
|
103
103
|
|
|
104
104
|
### `PlaySpec`
|
|
105
105
|
|
|
106
|
-
Extends `@json-render
|
|
106
|
+
Extends `@xmachines/json-render-core`'s `Spec` with an optional `contextProps` field — an explicit allowlist of machine context fields that are merged into element props at view derivation time.
|
|
107
107
|
|
|
108
108
|
```ts
|
|
109
109
|
import type { PlaySpec } from "@xmachines/play-actor";
|
|
@@ -156,7 +156,7 @@ Framework-agnostic base props shared by every `ActorProvider` implementation (Re
|
|
|
156
156
|
|
|
157
157
|
```ts
|
|
158
158
|
import type { BaseActorProviderProps } from "@xmachines/play-actor";
|
|
159
|
-
import type { DefineRegistryResult } from "@json-render
|
|
159
|
+
import type { DefineRegistryResult } from "@xmachines/json-render-react";
|
|
160
160
|
|
|
161
161
|
interface ActorProviderProps extends BaseActorProviderProps<DefineRegistryResult> {
|
|
162
162
|
fallback?: React.ReactNode;
|
|
@@ -174,13 +174,13 @@ Run the test suite for this package in isolation:
|
|
|
174
174
|
|
|
175
175
|
```bash
|
|
176
176
|
# From the package directory
|
|
177
|
-
|
|
177
|
+
pnpm test
|
|
178
178
|
|
|
179
179
|
# From the monorepo root (workspace-scoped)
|
|
180
|
-
|
|
180
|
+
pnpm --filter @xmachines/play-actor test
|
|
181
181
|
|
|
182
182
|
# Watch mode
|
|
183
|
-
|
|
183
|
+
pnpm --filter @xmachines/play-actor run test:watch
|
|
184
184
|
```
|
|
185
185
|
|
|
186
186
|
## Requirements
|
package/dist/abstract-actor.d.ts
CHANGED
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
*/
|
|
19
19
|
import { Actor, type AnyActorLogic, type EventObject } from "xstate";
|
|
20
20
|
import type { Signal } from "@xmachines/play-signals";
|
|
21
|
-
import type { Spec, StateStore, RenderErrorHandler, ActionHandler } from "@json-render
|
|
21
|
+
import type { Spec, StateStore, RenderErrorHandler, ActionHandler } from "@xmachines/json-render-core";
|
|
22
22
|
/**
|
|
23
23
|
* Optional capability: Routing support
|
|
24
24
|
*/
|
|
@@ -27,7 +27,7 @@ export interface Routable {
|
|
|
27
27
|
readonly initialRoute: string | null;
|
|
28
28
|
}
|
|
29
29
|
/**
|
|
30
|
-
* XMachines extension of `@json-render
|
|
30
|
+
* XMachines extension of `@xmachines/json-render-core` `Spec`.
|
|
31
31
|
*
|
|
32
32
|
* Adds `contextProps` — an explicit allowlist of machine context fields that
|
|
33
33
|
* `deriveCurrentView` merges into element props as low-priority slots. Only
|
|
@@ -103,7 +103,7 @@ export interface Viewable {
|
|
|
103
103
|
* `registry` is framework-specific (each framework has its own `ComponentRegistry`
|
|
104
104
|
* type) so it is typed via `TRegistry` — the same generic used in `BaseActorProviderProps`.
|
|
105
105
|
*
|
|
106
|
-
* @typeParam TRegistry - The framework's component registry type (e.g. `ComponentRegistry` from `@json-render
|
|
106
|
+
* @typeParam TRegistry - The framework's component registry type (e.g. `ComponentRegistry` from `@xmachines/json-render-react`).
|
|
107
107
|
*/
|
|
108
108
|
export interface BaseViewContextValue<TRegistry extends object> {
|
|
109
109
|
/** The current PlaySpec to render. */
|
|
@@ -119,7 +119,7 @@ export interface BaseViewContextValue<TRegistry extends object> {
|
|
|
119
119
|
* Framework-agnostic base props shared by every `ActorProvider` implementation
|
|
120
120
|
* (React, Vue, Solid, Svelte). `TRegistry` captures the framework-specific
|
|
121
121
|
* `DefineRegistryResult` type; `RenderErrorHandler` is sourced from
|
|
122
|
-
* `@json-render
|
|
122
|
+
* `@xmachines/json-render-core` so no second generic is needed.
|
|
123
123
|
*
|
|
124
124
|
* Framework packages extend this with their `fallback`, `onError`, and `children` fields.
|
|
125
125
|
*
|
|
@@ -128,7 +128,7 @@ export interface BaseViewContextValue<TRegistry extends object> {
|
|
|
128
128
|
* @example
|
|
129
129
|
* ```ts
|
|
130
130
|
* import type { BaseActorProviderProps } from "@xmachines/play-actor";
|
|
131
|
-
* import type { DefineRegistryResult } from "@json-render
|
|
131
|
+
* import type { DefineRegistryResult } from "@xmachines/json-render-react";
|
|
132
132
|
*
|
|
133
133
|
* interface ActorProviderProps extends BaseActorProviderProps<DefineRegistryResult> {
|
|
134
134
|
* fallback?: React.ReactNode;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"abstract-actor.d.ts","sourceRoot":"","sources":["../src/abstract-actor.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,EAAE,KAAK,EAAE,KAAK,aAAa,EAAE,KAAK,WAAW,EAAE,MAAM,QAAQ,CAAC;AACrE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AACtD,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"abstract-actor.d.ts","sourceRoot":"","sources":["../src/abstract-actor.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,EAAE,KAAK,EAAE,KAAK,aAAa,EAAE,KAAK,WAAW,EAAE,MAAM,QAAQ,CAAC;AACrE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AACtD,OAAO,KAAK,EACX,IAAI,EACJ,UAAU,EACV,kBAAkB,EAClB,aAAa,EACb,MAAM,6BAA6B,CAAC;AAErC;;G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AC7E,KAAK,EAAE,aAAa,CAAC,aAAa,CAAC,GAAG,QAAQ,CAAC;IAC/C,uGAAuG;IACvG,cAAc,EAAE,SAAS,CAAC;IAC1B;;;;OAIG;IACH,KAAK,CAAC,EAAE,UAAU,CAAC;IACnB;;;OAGG;IACH,aAAa,CAAC,EAAE,kBAAkB,CAAC;CACnC;AAED;;;;;;;;;GASG;AACH,8BAAsB,aAAa,CAClC,MAAM,SAAS,aAAa,EAC5B,MAAM,SAAS,WAAW,GAAG,WAAW,CACvC,SAAQ,KAAK,CAAC,MAAM,CAAC;IACtB;;;;;OAKG;IACH,SAAgB,KAAK,EAAE,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;IAE7C;;;;OAIG;aACsB,IAAI,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;CAClD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"abstract-actor.js","sourceRoot":"","sources":["../src/abstract-actor.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,EAAE,KAAK,EAAwC,MAAM,QAAQ,CAAC;
|
|
1
|
+
{"version":3,"file":"abstract-actor.js","sourceRoot":"","sources":["../src/abstract-actor.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,EAAE,KAAK,EAAwC,MAAM,QAAQ,CAAC;AAuCrE;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,MAAM,UAAU,SAAS,CACxB,IAEC;IAED,OAAO,IAAgB,CAAC;AACzB,CAAC;AAiFD;;;;;;;;;GASG;AACH,MAAM,OAAgB,aAGpB,SAAQ,KAAa;CAetB"}
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
*
|
|
15
15
|
* @packageDocumentation
|
|
16
16
|
*/
|
|
17
|
-
import type { RenderErrorHandler } from "@json-render
|
|
17
|
+
import type { RenderErrorHandler } from "@xmachines/json-render-core";
|
|
18
18
|
/**
|
|
19
19
|
* Safely coerce a spec's `state` field to a plain object for `createAtom`.
|
|
20
20
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"provider-guards.d.ts","sourceRoot":"","sources":["../src/provider-guards.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"provider-guards.d.ts","sourceRoot":"","sources":["../src/provider-guards.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AAEtE;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAQnE;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,wBAAwB,CAAC,SAAS,SAAS,MAAM,EAChE,QAAQ,EAAE,SAAS,EACnB,OAAO,EAAE,kBAAkB,GACzB,SAAS,CAQX"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xmachines/play-actor",
|
|
3
|
-
"version": "1.0.0-beta.
|
|
3
|
+
"version": "1.0.0-beta.57",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Abstract Actor base class for XMachines Play Architecture",
|
|
6
6
|
"keywords": [
|
|
@@ -44,20 +44,20 @@
|
|
|
44
44
|
"prepublishOnly": "npm run build"
|
|
45
45
|
},
|
|
46
46
|
"dependencies": {
|
|
47
|
-
"@json-render
|
|
47
|
+
"@xmachines/json-render-core": "^0.19.0-xm.2"
|
|
48
48
|
},
|
|
49
49
|
"devDependencies": {
|
|
50
50
|
"@testing-library/jest-dom": "^6.9.1",
|
|
51
51
|
"@types/node": "^25.6.0",
|
|
52
|
-
"@xmachines/shared": "1.0.0-beta.
|
|
52
|
+
"@xmachines/shared": "1.0.0-beta.57",
|
|
53
53
|
"oxfmt": "^0.47.0",
|
|
54
54
|
"oxlint": "^1.62.0",
|
|
55
55
|
"vitest": "^4.1.5",
|
|
56
56
|
"xstate": "^5.31.0"
|
|
57
57
|
},
|
|
58
58
|
"peerDependencies": {
|
|
59
|
-
"@xmachines/play": "1.0.0-beta.
|
|
60
|
-
"@xmachines/play-signals": "1.0.0-beta.
|
|
59
|
+
"@xmachines/play": "1.0.0-beta.57",
|
|
60
|
+
"@xmachines/play-signals": "1.0.0-beta.57",
|
|
61
61
|
"xstate": "^5.31.0"
|
|
62
62
|
},
|
|
63
63
|
"engines": {
|