@combos-fun/plugin-development-tool 0.0.37 → 0.0.39
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/agent-skill.md +7 -23
- package/combos-plugin.json +2 -2
- package/dist/plugin-development-tool.cjs.js +19 -19
- package/dist/plugin-development-tool.cjs.js.map +1 -1
- package/dist/plugin-development-tool.cjs.prod.js +1 -1
- package/dist/plugin-development-tool.d.ts +10 -10
- package/dist/plugin-development-tool.esm.js +18 -18
- package/dist/plugin-development-tool.esm.js.map +1 -1
- package/package.json +6 -6
package/agent-skill.md
CHANGED
|
@@ -16,7 +16,7 @@ import {
|
|
|
16
16
|
COMBOS_DEVELOPMENT_TOOL_CLEAR_SELECTION,
|
|
17
17
|
COMBOS_DEVELOPMENT_TOOL_GAMEOBJECT_DESELECTED,
|
|
18
18
|
COMBOS_DEVELOPMENT_TOOL_REFRESH,
|
|
19
|
-
|
|
19
|
+
COMBOS_DEVELOPMENT_TOOL_SET_PICK_MODE,
|
|
20
20
|
type CombosDevelopmentToolTargetParams,
|
|
21
21
|
type CombosDevelopmentToolSystemParams,
|
|
22
22
|
type CombosDevelopmentToolSelectScope,
|
|
@@ -33,22 +33,7 @@ import {
|
|
|
33
33
|
|
|
34
34
|
| Field | Type | Notes |
|
|
35
35
|
|---|---|---|
|
|
36
|
-
| `payload` | `Record<string, unknown>?` |
|
|
37
|
-
|
|
38
|
-
Creator source persistence uses the optional `payload.source` convention:
|
|
39
|
-
|
|
40
|
-
```ts
|
|
41
|
-
go.addComponent(new CombosDevelopmentToolTarget({
|
|
42
|
-
payload: {
|
|
43
|
-
source: {
|
|
44
|
-
file: 'src/scenes/main-scene.ts', // project-relative
|
|
45
|
-
anchor: 'hero', // stable source key; defaults to go.name in snapshots
|
|
46
|
-
},
|
|
47
|
-
},
|
|
48
|
-
}));
|
|
49
|
-
```
|
|
50
|
-
|
|
51
|
-
Use a stable `file` + `anchor` pair when property edits must resolve the same GameObject after reload. The Target accepts arbitrary JSON-safe payload fields, but only `payload.source.file` and `payload.source.anchor` participate in source lookup.
|
|
36
|
+
| `payload` | `Record<string, unknown>?` | Snapshot extras. Creator persist needs `payload.source.file` + `payload.source.anchor`. Who to tag and how to pick the pair: `$combos-engine-development` → `references/development-tool-target-policy.md`. |
|
|
52
37
|
|
|
53
38
|
## Required setup
|
|
54
39
|
|
|
@@ -93,6 +78,7 @@ Set `transform.size` for `Img`, `Text`, `Sprite`, and `SpriteAnimation` GameObje
|
|
|
93
78
|
| Parent frame never receives messages | The page must be in an iframe / embedded context; `window.parent !== window` |
|
|
94
79
|
| Parent postMessage ignored | Check `allowedMessageOrigins` — defaults allow `knoffice.tech` and `converge.ai` (+ subdomains). Pass `['localhost']` to merge local dev hosts |
|
|
95
80
|
| Selection stuck after a parent-driven structural replacement | Have the parent/tooling send `COMBOS_DEVELOPMENT_TOOL_REFRESH`; ordinary Target add/remove is automatic |
|
|
81
|
+
| Scene Edit cannot persist / object not found after reload | Target is missing `payload.source.file` + `payload.source.anchor` |
|
|
96
82
|
|
|
97
83
|
## Inbound postMessage security
|
|
98
84
|
|
|
@@ -116,7 +102,8 @@ Outbound `postMessageOrigin` is separate — it limits which parent origin recei
|
|
|
116
102
|
|
|
117
103
|
| Direction | type | Payload | Behavior |
|
|
118
104
|
|-----------|------|---------|----------|
|
|
119
|
-
| parent → iframe | `combos-development-tool:set` | `{ enabled: boolean }` | Enable/disable pick mode |
|
|
105
|
+
| parent → iframe | `combos-development-tool:set-pick-mode` | `{ enabled: boolean }` | Enable/disable pick mode |
|
|
106
|
+
| iframe → parent | `combos-development-tool:pick-mode-success` | `{ enabled: boolean }` | Pick mode finished attaching or restoring |
|
|
120
107
|
| parent → iframe | `combos-development-tool:clear-selection` | `{}` | Clear in-canvas outline |
|
|
121
108
|
| parent → iframe | `combos-development-tool:apply-property` | component field mutation | Live preview |
|
|
122
109
|
| parent → iframe | `combos-development-tool:set-marker-overlay` | `{ enabled: boolean }` | Toggle the marker overlay (independent of pick mode) |
|
|
@@ -140,11 +127,8 @@ triggers / spawn points later) but nothing else is registered yet.
|
|
|
140
127
|
`CombosDevelopmentToolTarget` pick gets a clickable hit area, so selecting and
|
|
141
128
|
editing (e.g. `Sound.volume`) go through the normal
|
|
142
129
|
selection → snapshot (`fieldDescriptors`) → `apply-property` flow and **persist to source** like any
|
|
143
|
-
other scene edit.
|
|
144
|
-
|
|
145
|
-
component must be given a Target when they should be editable even when they
|
|
146
|
-
render nothing. Space independently editable Sound GameObjects apart so their
|
|
147
|
-
marker badges do not overlap.
|
|
130
|
+
other scene edit. Sound objects that should be editable need a Target (source
|
|
131
|
+
pair and spacing: Target policy).
|
|
148
132
|
- On (re)build it posts `combos-development-tool:marker-overlay-success` with per-component counts.
|
|
149
133
|
|
|
150
134
|
## Scene Edit fieldDescriptors
|
package/combos-plugin.json
CHANGED
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"CombosDevelopmentToolTarget",
|
|
17
17
|
"COMBOS_DEVELOPMENT_TOOL_GAMEOBJECT_SELECTED",
|
|
18
18
|
"COMBOS_DEVELOPMENT_TOOL_REFRESH",
|
|
19
|
-
"
|
|
20
|
-
"
|
|
19
|
+
"COMBOS_DEVELOPMENT_TOOL_SET_PICK_MODE",
|
|
20
|
+
"COMBOS_DEVELOPMENT_TOOL_PICK_MODE_SUCCESS"
|
|
21
21
|
]
|
|
22
22
|
}
|
|
@@ -7,10 +7,10 @@ var pluginRendererGraphics = require('@combos-fun/plugin-renderer-graphics');
|
|
|
7
7
|
var pluginRendererEvent = require('@combos-fun/plugin-renderer-event');
|
|
8
8
|
var inspectorDecorator = require('@combos-fun/inspector-decorator');
|
|
9
9
|
|
|
10
|
-
/**
|
|
11
|
-
const
|
|
12
|
-
/** iframe → parent
|
|
13
|
-
const
|
|
10
|
+
/** Parent → iframe (also `window` CustomEvent / `game.emit`): toggle pick mode. Payload: `{ enabled: boolean }`. */
|
|
11
|
+
const COMBOS_DEVELOPMENT_TOOL_SET_PICK_MODE = 'combos-development-tool:set-pick-mode';
|
|
12
|
+
/** iframe → parent (and `game.emit`): pick mode finished attaching (enable) or restoring (disable). Payload: `{ enabled: boolean }`. */
|
|
13
|
+
const COMBOS_DEVELOPMENT_TOOL_PICK_MODE_SUCCESS = 'combos-development-tool:pick-mode-success';
|
|
14
14
|
/** Re-scan the scene tree while the development tool is enabled. */
|
|
15
15
|
const COMBOS_DEVELOPMENT_TOOL_REFRESH = 'combos-development-tool:refresh';
|
|
16
16
|
/** Emitted to `window.parent` when an object is selected while the tool is on. */
|
|
@@ -597,9 +597,9 @@ const MARKER_GO_NAME_PREFIX = '__combosDevelopmentToolMarker:';
|
|
|
597
597
|
* - attaches pick `Event` + outline only on nodes with {@link CombosDevelopmentToolTarget}.
|
|
598
598
|
*
|
|
599
599
|
* Turn on/off via:
|
|
600
|
-
* - `window.dispatchEvent(new CustomEvent(
|
|
601
|
-
* - `window.postMessage({ type:
|
|
602
|
-
* - `game.emit(
|
|
600
|
+
* - `window.dispatchEvent(new CustomEvent(COMBOS_DEVELOPMENT_TOOL_SET_PICK_MODE, { detail: { enabled: true } }))`
|
|
601
|
+
* - `window.postMessage({ type: COMBOS_DEVELOPMENT_TOOL_SET_PICK_MODE, enabled: true }, targetOrigin)` (e.g. from parent iframe)
|
|
602
|
+
* - `game.emit(COMBOS_DEVELOPMENT_TOOL_SET_PICK_MODE, { enabled: true })` or `getSystem(CombosDevelopmentToolSystem).setEnabled(true)`
|
|
603
603
|
*
|
|
604
604
|
* Mute (independent of pick mode; parent toolbar or in-game debug UI):
|
|
605
605
|
* - `postMessage({ type: COMBOS_DEVELOPMENT_TOOL_SET_MUTED, muted: true })`
|
|
@@ -643,7 +643,7 @@ let CombosDevelopmentToolSystem$1 = class CombosDevelopmentToolSystem extends en
|
|
|
643
643
|
this.needsMarkerRescan = false;
|
|
644
644
|
/** ownerGoId → its marker GO (icon child, Graphics only). */
|
|
645
645
|
this.markerGoByOwner = new Map();
|
|
646
|
-
this.
|
|
646
|
+
this.onWindowSetPickMode = (e) => {
|
|
647
647
|
const d = e.detail;
|
|
648
648
|
if (d && typeof d.enabled === 'boolean') {
|
|
649
649
|
this.setEnabled(d.enabled);
|
|
@@ -673,7 +673,7 @@ let CombosDevelopmentToolSystem$1 = class CombosDevelopmentToolSystem extends en
|
|
|
673
673
|
const d = e.data;
|
|
674
674
|
if (!d || typeof d !== 'object')
|
|
675
675
|
return;
|
|
676
|
-
if (d.type ===
|
|
676
|
+
if (d.type === COMBOS_DEVELOPMENT_TOOL_SET_PICK_MODE && typeof d.enabled === 'boolean') {
|
|
677
677
|
this.setEnabled(d.enabled);
|
|
678
678
|
}
|
|
679
679
|
else if (d.type === COMBOS_DEVELOPMENT_TOOL_SET_MUTED && typeof d.muted === 'boolean') {
|
|
@@ -693,7 +693,7 @@ let CombosDevelopmentToolSystem$1 = class CombosDevelopmentToolSystem extends en
|
|
|
693
693
|
this.handleApplyProperty(d);
|
|
694
694
|
}
|
|
695
695
|
};
|
|
696
|
-
this.
|
|
696
|
+
this.onGameSetPickMode = (payload) => {
|
|
697
697
|
if (payload && typeof payload.enabled === 'boolean') {
|
|
698
698
|
this.setEnabled(payload.enabled);
|
|
699
699
|
}
|
|
@@ -715,13 +715,13 @@ let CombosDevelopmentToolSystem$1 = class CombosDevelopmentToolSystem extends en
|
|
|
715
715
|
this.postMessageOrigin = params?.postMessageOrigin ?? '*';
|
|
716
716
|
this.allowedMessageOrigins = mergeAllowedMessageOrigins(params?.allowedMessageOrigins);
|
|
717
717
|
if (typeof window !== 'undefined') {
|
|
718
|
-
window.addEventListener(
|
|
718
|
+
window.addEventListener(COMBOS_DEVELOPMENT_TOOL_SET_PICK_MODE, this.onWindowSetPickMode);
|
|
719
719
|
window.addEventListener(COMBOS_DEVELOPMENT_TOOL_SET_MUTED, this.onWindowSetMuted);
|
|
720
720
|
window.addEventListener(COMBOS_DEVELOPMENT_TOOL_SET_MARKER_OVERLAY, this.onWindowSetMarkerOverlay);
|
|
721
721
|
window.addEventListener(COMBOS_DEVELOPMENT_TOOL_REFRESH, this.onWindowRefresh);
|
|
722
722
|
window.addEventListener('message', this.onWindowMessage);
|
|
723
723
|
}
|
|
724
|
-
this.game.on(
|
|
724
|
+
this.game.on(COMBOS_DEVELOPMENT_TOOL_SET_PICK_MODE, this.onGameSetPickMode);
|
|
725
725
|
this.game.on(COMBOS_DEVELOPMENT_TOOL_SET_MUTED, this.onGameSetMuted);
|
|
726
726
|
this.game.on(COMBOS_DEVELOPMENT_TOOL_SET_MARKER_OVERLAY, this.onGameSetMarkerOverlay);
|
|
727
727
|
this.game.on(COMBOS_DEVELOPMENT_TOOL_REFRESH, this.onGameRefresh);
|
|
@@ -731,13 +731,13 @@ let CombosDevelopmentToolSystem$1 = class CombosDevelopmentToolSystem extends en
|
|
|
731
731
|
}
|
|
732
732
|
onDestroy() {
|
|
733
733
|
if (typeof window !== 'undefined') {
|
|
734
|
-
window.removeEventListener(
|
|
734
|
+
window.removeEventListener(COMBOS_DEVELOPMENT_TOOL_SET_PICK_MODE, this.onWindowSetPickMode);
|
|
735
735
|
window.removeEventListener(COMBOS_DEVELOPMENT_TOOL_SET_MUTED, this.onWindowSetMuted);
|
|
736
736
|
window.removeEventListener(COMBOS_DEVELOPMENT_TOOL_SET_MARKER_OVERLAY, this.onWindowSetMarkerOverlay);
|
|
737
737
|
window.removeEventListener(COMBOS_DEVELOPMENT_TOOL_REFRESH, this.onWindowRefresh);
|
|
738
738
|
window.removeEventListener('message', this.onWindowMessage);
|
|
739
739
|
}
|
|
740
|
-
this.game.off(
|
|
740
|
+
this.game.off(COMBOS_DEVELOPMENT_TOOL_SET_PICK_MODE, this.onGameSetPickMode);
|
|
741
741
|
this.game.off(COMBOS_DEVELOPMENT_TOOL_SET_MUTED, this.onGameSetMuted);
|
|
742
742
|
this.game.off(COMBOS_DEVELOPMENT_TOOL_SET_MARKER_OVERLAY, this.onGameSetMarkerOverlay);
|
|
743
743
|
this.game.off(COMBOS_DEVELOPMENT_TOOL_REFRESH, this.onGameRefresh);
|
|
@@ -1096,13 +1096,13 @@ let CombosDevelopmentToolSystem$1 = class CombosDevelopmentToolSystem extends en
|
|
|
1096
1096
|
}
|
|
1097
1097
|
postSetSuccess(enabled) {
|
|
1098
1098
|
const payload = {
|
|
1099
|
-
type:
|
|
1099
|
+
type: COMBOS_DEVELOPMENT_TOOL_PICK_MODE_SUCCESS,
|
|
1100
1100
|
enabled,
|
|
1101
1101
|
};
|
|
1102
1102
|
if (typeof window !== 'undefined' && window.parent && window.parent !== window) {
|
|
1103
1103
|
window.parent.postMessage(payload, this.postMessageOrigin);
|
|
1104
1104
|
}
|
|
1105
|
-
this.game.emit(
|
|
1105
|
+
this.game.emit(COMBOS_DEVELOPMENT_TOOL_PICK_MODE_SUCCESS, { enabled });
|
|
1106
1106
|
}
|
|
1107
1107
|
postStateChanged() {
|
|
1108
1108
|
const state = {
|
|
@@ -1375,7 +1375,7 @@ var CombosDevelopmentToolSystem = CombosDevelopmentToolSystem$1;
|
|
|
1375
1375
|
/** Auto-generated by scripts/build-package.mjs — do not edit. */
|
|
1376
1376
|
Object.assign(CombosDevelopmentToolSystem, {
|
|
1377
1377
|
packageName: "@combos-fun/plugin-development-tool",
|
|
1378
|
-
packageVersion: "0.0.
|
|
1378
|
+
packageVersion: "0.0.39",
|
|
1379
1379
|
});
|
|
1380
1380
|
|
|
1381
1381
|
exports.COMBOS_DEVELOPMENT_TOOL_APPLY_PROPERTY = COMBOS_DEVELOPMENT_TOOL_APPLY_PROPERTY;
|
|
@@ -1383,12 +1383,12 @@ exports.COMBOS_DEVELOPMENT_TOOL_CLEAR_SELECTION = COMBOS_DEVELOPMENT_TOOL_CLEAR_
|
|
|
1383
1383
|
exports.COMBOS_DEVELOPMENT_TOOL_GAMEOBJECT_DESELECTED = COMBOS_DEVELOPMENT_TOOL_GAMEOBJECT_DESELECTED;
|
|
1384
1384
|
exports.COMBOS_DEVELOPMENT_TOOL_GAMEOBJECT_SELECTED = COMBOS_DEVELOPMENT_TOOL_GAMEOBJECT_SELECTED;
|
|
1385
1385
|
exports.COMBOS_DEVELOPMENT_TOOL_MARKER_OVERLAY_SUCCESS = COMBOS_DEVELOPMENT_TOOL_MARKER_OVERLAY_SUCCESS;
|
|
1386
|
+
exports.COMBOS_DEVELOPMENT_TOOL_PICK_MODE_SUCCESS = COMBOS_DEVELOPMENT_TOOL_PICK_MODE_SUCCESS;
|
|
1386
1387
|
exports.COMBOS_DEVELOPMENT_TOOL_READY = COMBOS_DEVELOPMENT_TOOL_READY;
|
|
1387
1388
|
exports.COMBOS_DEVELOPMENT_TOOL_REFRESH = COMBOS_DEVELOPMENT_TOOL_REFRESH;
|
|
1388
|
-
exports.COMBOS_DEVELOPMENT_TOOL_SET = COMBOS_DEVELOPMENT_TOOL_SET;
|
|
1389
1389
|
exports.COMBOS_DEVELOPMENT_TOOL_SET_MARKER_OVERLAY = COMBOS_DEVELOPMENT_TOOL_SET_MARKER_OVERLAY;
|
|
1390
1390
|
exports.COMBOS_DEVELOPMENT_TOOL_SET_MUTED = COMBOS_DEVELOPMENT_TOOL_SET_MUTED;
|
|
1391
|
-
exports.
|
|
1391
|
+
exports.COMBOS_DEVELOPMENT_TOOL_SET_PICK_MODE = COMBOS_DEVELOPMENT_TOOL_SET_PICK_MODE;
|
|
1392
1392
|
exports.COMBOS_DEVELOPMENT_TOOL_STATE_CHANGED = COMBOS_DEVELOPMENT_TOOL_STATE_CHANGED;
|
|
1393
1393
|
exports.CombosDevelopmentToolSystem = CombosDevelopmentToolSystem;
|
|
1394
1394
|
exports.CombosDevelopmentToolTarget = CombosDevelopmentToolTarget;
|