@ignifx/editor-host 0.12.0 → 0.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +497 -230
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +789 -162
- package/dist/index.js.map +1 -1
- package/package.json +10 -10
- package/skills/editor-host/SKILL.md +27 -4
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ignifx/editor-host",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.13.0",
|
|
4
4
|
"description": "ignifx editor host: runs a project's own engine inside the ignifx editor's scene view and play view, over a versioned protocol.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ignifx"
|
|
@@ -52,19 +52,19 @@
|
|
|
52
52
|
"typescript-native": "npm:typescript@7.0.2",
|
|
53
53
|
"vite": "^8.2.2",
|
|
54
54
|
"vitest": "^5.0.0",
|
|
55
|
-
"@ignifx/2d": "0.
|
|
56
|
-
"@ignifx/3d": "0.
|
|
57
|
-
"@ignifx/core": "0.
|
|
58
|
-
"@ignifx/input": "0.
|
|
59
|
-
"@ignifx/physics": "0.
|
|
60
|
-
"@ignifx/physics-2d": "0.
|
|
61
|
-
"@ignifx/vite-plugin": "0.
|
|
55
|
+
"@ignifx/2d": "0.13.0",
|
|
56
|
+
"@ignifx/3d": "0.13.0",
|
|
57
|
+
"@ignifx/core": "0.13.0",
|
|
58
|
+
"@ignifx/input": "0.13.0",
|
|
59
|
+
"@ignifx/physics": "0.13.0",
|
|
60
|
+
"@ignifx/physics-2d": "0.13.0",
|
|
61
|
+
"@ignifx/vite-plugin": "0.13.0"
|
|
62
62
|
},
|
|
63
63
|
"peerDependencies": {
|
|
64
64
|
"@babylonjs/lite": "1.34.0",
|
|
65
65
|
"vite": "^8.2.2",
|
|
66
|
-
"@ignifx/core": "0.
|
|
67
|
-
"@ignifx/vite-plugin": "0.
|
|
66
|
+
"@ignifx/core": "0.13.0",
|
|
67
|
+
"@ignifx/vite-plugin": "0.13.0"
|
|
68
68
|
},
|
|
69
69
|
"peerDependenciesMeta": {
|
|
70
70
|
"@ignifx/vite-plugin": {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: editor-host
|
|
3
|
-
description: Connects an ignifx project to the ignifx editor with @ignifx/editor-host: the Vite plugin that serves the editor's scene view from the project's own dev server, the virtual:ignifx/editor play controls a game's main.ts hands its app to (play, pause, step, stop, playState, playStateChanged, playStats), and the host half of the editor protocol 0.3 over a MessagePort (hello/ready, heartbeat, and the scene document methods openScene, applyOps, readBack, select, pick, frame, setGizmo, setViewMode, screenshot, getSchemas, describeSettings, setAnimateMaterials, getColliderOutlines, sampleAnimation), including the 2D view mode
|
|
3
|
+
description: Connects an ignifx project to the ignifx editor with @ignifx/editor-host: the Vite plugin that serves the editor's scene view from the project's own dev server, the virtual:ignifx/editor play controls a game's main.ts hands its app to (play, pause, step, stop, playState, playStateChanged, playStats, screenshot, queryRuntime, sendInput), and the host half of the editor protocol 0.3 over a MessagePort (hello/ready, heartbeat, and the scene document methods openScene, applyOps, readBack, select, pick, frame, setGizmo, setViewMode, screenshot, getSchemas, describeSettings, setAnimateMaterials, getColliderOutlines, sampleAnimation), including the 2D view mode. Use when wiring a project or template for the editor, when the user mentions @ignifx/editor-host, editorHostPlugin, attachEditorPlayControls, virtual:ignifx/editor, startEditorHost or /__ignifx_editor__/, or when debugging why the editor cannot connect to a view or why the scene view disagrees with the editor's document.
|
|
4
4
|
license: Apache-2.0
|
|
5
5
|
metadata:
|
|
6
|
-
ignifx-version: "0.
|
|
6
|
+
ignifx-version: "0.13.0"
|
|
7
7
|
---
|
|
8
8
|
|
|
9
9
|
# @ignifx/editor-host
|
|
@@ -25,7 +25,7 @@ editor's, even though its name starts with `editor-`.
|
|
|
25
25
|
|
|
26
26
|
## Environment
|
|
27
27
|
|
|
28
|
-
- Engine: ignifx `0.
|
|
28
|
+
- Engine: ignifx `0.13.0`; this package targets `@ignifx/core` `>=0.0.0 <1.0.0`.
|
|
29
29
|
- Peers: `@ignifx/core` and `@babylonjs/lite` (the scene view's gizmos); for the `./vite` entry,
|
|
30
30
|
`@ignifx/vite-plugin` and `vite`.
|
|
31
31
|
- A development dependency of the project, at the same version as its `@ignifx/core`.
|
|
@@ -71,7 +71,8 @@ each view ◀── MessagePort ──▶ editor JSON-RPC 2.0, protocol 0.3
|
|
|
71
71
|
/ setAnimateMaterials / getColliderOutlines / sampleAnimation
|
|
72
72
|
← sceneOpened, selectionChanged, transformDragging/Dragged, hotReloaded, assetReloaded,
|
|
73
73
|
hostError, log
|
|
74
|
-
play view: play / pause / step / stop / playState / playStats
|
|
74
|
+
play view: play / pause / step / stop / playState / playStats / screenshot (with a canvas)
|
|
75
|
+
/ queryRuntime / sendInput (with app.input)
|
|
75
76
|
← playStateChanged, log, hostError, hotReloaded (logRelay; kept from before hello)
|
|
76
77
|
```
|
|
77
78
|
|
|
@@ -321,6 +322,28 @@ object `openScene` sends, through `world.loadSceneFile`; `readBack` answers with
|
|
|
321
322
|
- **Scene methods answer `notReady` until the app has started.** The host answers `hello` at once;
|
|
322
323
|
its first `schemasChanged` is the cue that `openScene` and the rest are accepted. `applyOps`,
|
|
323
324
|
`readBack` and `frame` answer `noScene` while no scene is open.
|
|
325
|
+
- **The play view's `screenshot` needs a running game.** It takes the scene view's parameters and
|
|
326
|
+
answers the same `{ dataUrl, width, height }` from the game's canvas, paused or not. While the
|
|
327
|
+
frame loop does not run (before Play, after `stop` or `step`) it answers `notPlaying`, and before
|
|
328
|
+
the first frame `notReady`. Only a game with a canvas lists `screenshot` in `ready`; an older or
|
|
329
|
+
headless play view answers `methodNotFound`.
|
|
330
|
+
- **The play view's `queryRuntime` reads one live entity.** `{ entity: uid, components?: typeId[] }`
|
|
331
|
+
answers the entity as `serializeEntity` writes it (serialized props only, no expressions), with at
|
|
332
|
+
most 64 components, prop strings clipped to 64 Ki, objects cut to 256 keys, keys and names
|
|
333
|
+
clipped to 256 characters (`omittedEntries` counts the keys, items and tags left out), and the
|
|
334
|
+
whole answer within 262,144 characters of JSON: components past the budget, in order, are counted
|
|
335
|
+
in `omittedComponents`. An
|
|
336
|
+
unknown uid answers `unknownEntity`; a stopped game `notPlaying`. A paused or stepped game
|
|
337
|
+
answers, so pause, `step`, `queryRuntime` reads a game frame by frame. Spawned entities get new
|
|
338
|
+
uids each run; a scene's own keep their file uids.
|
|
339
|
+
- **The play view's `sendInput` drives the game's own input.** `{ events }` (1 to 64) of
|
|
340
|
+
`{ type: "keydown" | "keyup", control: "w" }` (a `<Keyboard>` control name) and
|
|
341
|
+
`{ type: "pointermove" | "pointerdown" | "pointerup", x, y, button? }` (`x`, `y` as 0–1 fractions of
|
|
342
|
+
the canvas) go to `app.input.simulateEvent` and resolve on the game's next frame; nothing reaches
|
|
343
|
+
the DOM, the editor's window or the OS. A bad event or unknown key answers `invalidParams` and
|
|
344
|
+
queues nothing; a stopped game `notPlaying`. A stepped game resolves the events only on its next
|
|
345
|
+
`step`, so step after sending. A held key stays down until its `keyup`. Only a game
|
|
346
|
+
with `app.input` lists `sendInput`; others answer `methodNotFound`.
|
|
324
347
|
- **The scene view keeps the project's `rendering.msaaSamples`.** The gizmos and the outline draw in
|
|
325
348
|
core's render overlay (`app.renderer.openOverlay()`), which works at every MSAA setting.
|
|
326
349
|
- **A headless host lists only `heartbeat`.** Without a canvas there are no gizmos, no `screenshot`,
|