@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
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { GameObject, Component, ComponentParams, System, UpdateParams, ComponentChanged } from '@combos-fun/engine';
|
|
2
2
|
|
|
3
|
-
/**
|
|
4
|
-
declare const
|
|
5
|
-
/** iframe → parent
|
|
6
|
-
declare const
|
|
3
|
+
/** Parent → iframe (also `window` CustomEvent / `game.emit`): toggle pick mode. Payload: `{ enabled: boolean }`. */
|
|
4
|
+
declare const COMBOS_DEVELOPMENT_TOOL_SET_PICK_MODE: "combos-development-tool:set-pick-mode";
|
|
5
|
+
/** iframe → parent (and `game.emit`): pick mode finished attaching (enable) or restoring (disable). Payload: `{ enabled: boolean }`. */
|
|
6
|
+
declare const COMBOS_DEVELOPMENT_TOOL_PICK_MODE_SUCCESS: "combos-development-tool:pick-mode-success";
|
|
7
7
|
/** Re-scan the scene tree while the development tool is enabled. */
|
|
8
8
|
declare const COMBOS_DEVELOPMENT_TOOL_REFRESH: "combos-development-tool:refresh";
|
|
9
9
|
/** Emitted to `window.parent` when an object is selected while the tool is on. */
|
|
@@ -136,9 +136,9 @@ interface CombosDevelopmentToolSystemParams {
|
|
|
136
136
|
* - attaches pick `Event` + outline only on nodes with {@link CombosDevelopmentToolTarget}.
|
|
137
137
|
*
|
|
138
138
|
* Turn on/off via:
|
|
139
|
-
* - `window.dispatchEvent(new CustomEvent(
|
|
140
|
-
* - `window.postMessage({ type:
|
|
141
|
-
* - `game.emit(
|
|
139
|
+
* - `window.dispatchEvent(new CustomEvent(COMBOS_DEVELOPMENT_TOOL_SET_PICK_MODE, { detail: { enabled: true } }))`
|
|
140
|
+
* - `window.postMessage({ type: COMBOS_DEVELOPMENT_TOOL_SET_PICK_MODE, enabled: true }, targetOrigin)` (e.g. from parent iframe)
|
|
141
|
+
* - `game.emit(COMBOS_DEVELOPMENT_TOOL_SET_PICK_MODE, { enabled: true })` or `getSystem(CombosDevelopmentToolSystem).setEnabled(true)`
|
|
142
142
|
*
|
|
143
143
|
* Mute (independent of pick mode; parent toolbar or in-game debug UI):
|
|
144
144
|
* - `postMessage({ type: COMBOS_DEVELOPMENT_TOOL_SET_MUTED, muted: true })`
|
|
@@ -181,12 +181,12 @@ declare class CombosDevelopmentToolSystem extends System<CombosDevelopmentToolSy
|
|
|
181
181
|
private needsMarkerRescan;
|
|
182
182
|
/** ownerGoId → its marker GO (icon child, Graphics only). */
|
|
183
183
|
private readonly markerGoByOwner;
|
|
184
|
-
private readonly
|
|
184
|
+
private readonly onWindowSetPickMode;
|
|
185
185
|
private readonly onWindowSetMuted;
|
|
186
186
|
private readonly onWindowSetMarkerOverlay;
|
|
187
187
|
private readonly onGameSetMarkerOverlay;
|
|
188
188
|
private readonly onWindowMessage;
|
|
189
|
-
private readonly
|
|
189
|
+
private readonly onGameSetPickMode;
|
|
190
190
|
private readonly onGameRefresh;
|
|
191
191
|
private readonly onGameSetMuted;
|
|
192
192
|
private readonly onWindowRefresh;
|
|
@@ -325,5 +325,5 @@ declare function buildGameObjectDeselectedPayload(reason: DevelopmentToolDeselec
|
|
|
325
325
|
declare function shouldNotifyGameObjectDeselected(hadSelection: boolean): boolean;
|
|
326
326
|
declare function isClearSelectionMessage(data: unknown): boolean;
|
|
327
327
|
|
|
328
|
-
export { COMBOS_DEVELOPMENT_TOOL_APPLY_PROPERTY, COMBOS_DEVELOPMENT_TOOL_CLEAR_SELECTION, COMBOS_DEVELOPMENT_TOOL_GAMEOBJECT_DESELECTED, COMBOS_DEVELOPMENT_TOOL_GAMEOBJECT_SELECTED, COMBOS_DEVELOPMENT_TOOL_MARKER_OVERLAY_SUCCESS, COMBOS_DEVELOPMENT_TOOL_READY, COMBOS_DEVELOPMENT_TOOL_REFRESH,
|
|
328
|
+
export { COMBOS_DEVELOPMENT_TOOL_APPLY_PROPERTY, COMBOS_DEVELOPMENT_TOOL_CLEAR_SELECTION, COMBOS_DEVELOPMENT_TOOL_GAMEOBJECT_DESELECTED, COMBOS_DEVELOPMENT_TOOL_GAMEOBJECT_SELECTED, COMBOS_DEVELOPMENT_TOOL_MARKER_OVERLAY_SUCCESS, COMBOS_DEVELOPMENT_TOOL_PICK_MODE_SUCCESS, COMBOS_DEVELOPMENT_TOOL_READY, COMBOS_DEVELOPMENT_TOOL_REFRESH, COMBOS_DEVELOPMENT_TOOL_SET_MARKER_OVERLAY, COMBOS_DEVELOPMENT_TOOL_SET_MUTED, COMBOS_DEVELOPMENT_TOOL_SET_PICK_MODE, COMBOS_DEVELOPMENT_TOOL_STATE_CHANGED, CombosDevelopmentToolSystem, CombosDevelopmentToolTarget, DEFAULT_ALLOWED_MESSAGE_HOST_SUFFIXES, MARKER_COMPONENTS, MARKER_ICON_SIZE, applyPropertyValue, applyPropertyWithHooks, buildGameObjectDeselectedPayload, buildGameObjectSnapshot, drawMarkerIcon, isAllowedMessageOrigin, isClearSelectionMessage, mergeAllowedMessageOrigins, readPropertyValue, readSourceAnchor, resolveMarkerDef, shouldNotifyGameObjectDeselected };
|
|
329
329
|
export type { CombosDevelopmentToolSystemParams, CombosDevelopmentToolTargetParams, DevelopmentToolDeselectReason, MarkerComponentDef, MarkerGlyph, MarkerGraphicsLike, SceneEditComponentSnapshot, SceneEditGameObjectSnapshot, SceneEditPropertyRef, SceneSourceAnchor };
|
|
@@ -5,10 +5,10 @@ import { Graphics } from '@combos-fun/plugin-renderer-graphics';
|
|
|
5
5
|
import { Event, HIT_AREA_TYPE } from '@combos-fun/plugin-renderer-event';
|
|
6
6
|
import { IDE_PROPERTY_METADATA } from '@combos-fun/inspector-decorator';
|
|
7
7
|
|
|
8
|
-
/**
|
|
9
|
-
const
|
|
10
|
-
/** iframe → parent
|
|
11
|
-
const
|
|
8
|
+
/** Parent → iframe (also `window` CustomEvent / `game.emit`): toggle pick mode. Payload: `{ enabled: boolean }`. */
|
|
9
|
+
const COMBOS_DEVELOPMENT_TOOL_SET_PICK_MODE = 'combos-development-tool:set-pick-mode';
|
|
10
|
+
/** iframe → parent (and `game.emit`): pick mode finished attaching (enable) or restoring (disable). Payload: `{ enabled: boolean }`. */
|
|
11
|
+
const COMBOS_DEVELOPMENT_TOOL_PICK_MODE_SUCCESS = 'combos-development-tool:pick-mode-success';
|
|
12
12
|
/** Re-scan the scene tree while the development tool is enabled. */
|
|
13
13
|
const COMBOS_DEVELOPMENT_TOOL_REFRESH = 'combos-development-tool:refresh';
|
|
14
14
|
/** Emitted to `window.parent` when an object is selected while the tool is on. */
|
|
@@ -595,9 +595,9 @@ const MARKER_GO_NAME_PREFIX = '__combosDevelopmentToolMarker:';
|
|
|
595
595
|
* - attaches pick `Event` + outline only on nodes with {@link CombosDevelopmentToolTarget}.
|
|
596
596
|
*
|
|
597
597
|
* Turn on/off via:
|
|
598
|
-
* - `window.dispatchEvent(new CustomEvent(
|
|
599
|
-
* - `window.postMessage({ type:
|
|
600
|
-
* - `game.emit(
|
|
598
|
+
* - `window.dispatchEvent(new CustomEvent(COMBOS_DEVELOPMENT_TOOL_SET_PICK_MODE, { detail: { enabled: true } }))`
|
|
599
|
+
* - `window.postMessage({ type: COMBOS_DEVELOPMENT_TOOL_SET_PICK_MODE, enabled: true }, targetOrigin)` (e.g. from parent iframe)
|
|
600
|
+
* - `game.emit(COMBOS_DEVELOPMENT_TOOL_SET_PICK_MODE, { enabled: true })` or `getSystem(CombosDevelopmentToolSystem).setEnabled(true)`
|
|
601
601
|
*
|
|
602
602
|
* Mute (independent of pick mode; parent toolbar or in-game debug UI):
|
|
603
603
|
* - `postMessage({ type: COMBOS_DEVELOPMENT_TOOL_SET_MUTED, muted: true })`
|
|
@@ -641,7 +641,7 @@ let CombosDevelopmentToolSystem = class CombosDevelopmentToolSystem extends Syst
|
|
|
641
641
|
this.needsMarkerRescan = false;
|
|
642
642
|
/** ownerGoId → its marker GO (icon child, Graphics only). */
|
|
643
643
|
this.markerGoByOwner = new Map();
|
|
644
|
-
this.
|
|
644
|
+
this.onWindowSetPickMode = (e) => {
|
|
645
645
|
const d = e.detail;
|
|
646
646
|
if (d && typeof d.enabled === 'boolean') {
|
|
647
647
|
this.setEnabled(d.enabled);
|
|
@@ -671,7 +671,7 @@ let CombosDevelopmentToolSystem = class CombosDevelopmentToolSystem extends Syst
|
|
|
671
671
|
const d = e.data;
|
|
672
672
|
if (!d || typeof d !== 'object')
|
|
673
673
|
return;
|
|
674
|
-
if (d.type ===
|
|
674
|
+
if (d.type === COMBOS_DEVELOPMENT_TOOL_SET_PICK_MODE && typeof d.enabled === 'boolean') {
|
|
675
675
|
this.setEnabled(d.enabled);
|
|
676
676
|
}
|
|
677
677
|
else if (d.type === COMBOS_DEVELOPMENT_TOOL_SET_MUTED && typeof d.muted === 'boolean') {
|
|
@@ -691,7 +691,7 @@ let CombosDevelopmentToolSystem = class CombosDevelopmentToolSystem extends Syst
|
|
|
691
691
|
this.handleApplyProperty(d);
|
|
692
692
|
}
|
|
693
693
|
};
|
|
694
|
-
this.
|
|
694
|
+
this.onGameSetPickMode = (payload) => {
|
|
695
695
|
if (payload && typeof payload.enabled === 'boolean') {
|
|
696
696
|
this.setEnabled(payload.enabled);
|
|
697
697
|
}
|
|
@@ -713,13 +713,13 @@ let CombosDevelopmentToolSystem = class CombosDevelopmentToolSystem extends Syst
|
|
|
713
713
|
this.postMessageOrigin = params?.postMessageOrigin ?? '*';
|
|
714
714
|
this.allowedMessageOrigins = mergeAllowedMessageOrigins(params?.allowedMessageOrigins);
|
|
715
715
|
if (typeof window !== 'undefined') {
|
|
716
|
-
window.addEventListener(
|
|
716
|
+
window.addEventListener(COMBOS_DEVELOPMENT_TOOL_SET_PICK_MODE, this.onWindowSetPickMode);
|
|
717
717
|
window.addEventListener(COMBOS_DEVELOPMENT_TOOL_SET_MUTED, this.onWindowSetMuted);
|
|
718
718
|
window.addEventListener(COMBOS_DEVELOPMENT_TOOL_SET_MARKER_OVERLAY, this.onWindowSetMarkerOverlay);
|
|
719
719
|
window.addEventListener(COMBOS_DEVELOPMENT_TOOL_REFRESH, this.onWindowRefresh);
|
|
720
720
|
window.addEventListener('message', this.onWindowMessage);
|
|
721
721
|
}
|
|
722
|
-
this.game.on(
|
|
722
|
+
this.game.on(COMBOS_DEVELOPMENT_TOOL_SET_PICK_MODE, this.onGameSetPickMode);
|
|
723
723
|
this.game.on(COMBOS_DEVELOPMENT_TOOL_SET_MUTED, this.onGameSetMuted);
|
|
724
724
|
this.game.on(COMBOS_DEVELOPMENT_TOOL_SET_MARKER_OVERLAY, this.onGameSetMarkerOverlay);
|
|
725
725
|
this.game.on(COMBOS_DEVELOPMENT_TOOL_REFRESH, this.onGameRefresh);
|
|
@@ -729,13 +729,13 @@ let CombosDevelopmentToolSystem = class CombosDevelopmentToolSystem extends Syst
|
|
|
729
729
|
}
|
|
730
730
|
onDestroy() {
|
|
731
731
|
if (typeof window !== 'undefined') {
|
|
732
|
-
window.removeEventListener(
|
|
732
|
+
window.removeEventListener(COMBOS_DEVELOPMENT_TOOL_SET_PICK_MODE, this.onWindowSetPickMode);
|
|
733
733
|
window.removeEventListener(COMBOS_DEVELOPMENT_TOOL_SET_MUTED, this.onWindowSetMuted);
|
|
734
734
|
window.removeEventListener(COMBOS_DEVELOPMENT_TOOL_SET_MARKER_OVERLAY, this.onWindowSetMarkerOverlay);
|
|
735
735
|
window.removeEventListener(COMBOS_DEVELOPMENT_TOOL_REFRESH, this.onWindowRefresh);
|
|
736
736
|
window.removeEventListener('message', this.onWindowMessage);
|
|
737
737
|
}
|
|
738
|
-
this.game.off(
|
|
738
|
+
this.game.off(COMBOS_DEVELOPMENT_TOOL_SET_PICK_MODE, this.onGameSetPickMode);
|
|
739
739
|
this.game.off(COMBOS_DEVELOPMENT_TOOL_SET_MUTED, this.onGameSetMuted);
|
|
740
740
|
this.game.off(COMBOS_DEVELOPMENT_TOOL_SET_MARKER_OVERLAY, this.onGameSetMarkerOverlay);
|
|
741
741
|
this.game.off(COMBOS_DEVELOPMENT_TOOL_REFRESH, this.onGameRefresh);
|
|
@@ -1094,13 +1094,13 @@ let CombosDevelopmentToolSystem = class CombosDevelopmentToolSystem extends Syst
|
|
|
1094
1094
|
}
|
|
1095
1095
|
postSetSuccess(enabled) {
|
|
1096
1096
|
const payload = {
|
|
1097
|
-
type:
|
|
1097
|
+
type: COMBOS_DEVELOPMENT_TOOL_PICK_MODE_SUCCESS,
|
|
1098
1098
|
enabled,
|
|
1099
1099
|
};
|
|
1100
1100
|
if (typeof window !== 'undefined' && window.parent && window.parent !== window) {
|
|
1101
1101
|
window.parent.postMessage(payload, this.postMessageOrigin);
|
|
1102
1102
|
}
|
|
1103
|
-
this.game.emit(
|
|
1103
|
+
this.game.emit(COMBOS_DEVELOPMENT_TOOL_PICK_MODE_SUCCESS, { enabled });
|
|
1104
1104
|
}
|
|
1105
1105
|
postStateChanged() {
|
|
1106
1106
|
const state = {
|
|
@@ -1373,8 +1373,8 @@ var CombosDevelopmentToolSystem$1 = CombosDevelopmentToolSystem;
|
|
|
1373
1373
|
/** Auto-generated by scripts/build-package.mjs — do not edit. */
|
|
1374
1374
|
Object.assign(CombosDevelopmentToolSystem$1, {
|
|
1375
1375
|
packageName: "@combos-fun/plugin-development-tool",
|
|
1376
|
-
packageVersion: "0.0.
|
|
1376
|
+
packageVersion: "0.0.39",
|
|
1377
1377
|
});
|
|
1378
1378
|
|
|
1379
|
-
export { COMBOS_DEVELOPMENT_TOOL_APPLY_PROPERTY, COMBOS_DEVELOPMENT_TOOL_CLEAR_SELECTION, COMBOS_DEVELOPMENT_TOOL_GAMEOBJECT_DESELECTED, COMBOS_DEVELOPMENT_TOOL_GAMEOBJECT_SELECTED, COMBOS_DEVELOPMENT_TOOL_MARKER_OVERLAY_SUCCESS, COMBOS_DEVELOPMENT_TOOL_READY, COMBOS_DEVELOPMENT_TOOL_REFRESH,
|
|
1379
|
+
export { COMBOS_DEVELOPMENT_TOOL_APPLY_PROPERTY, COMBOS_DEVELOPMENT_TOOL_CLEAR_SELECTION, COMBOS_DEVELOPMENT_TOOL_GAMEOBJECT_DESELECTED, COMBOS_DEVELOPMENT_TOOL_GAMEOBJECT_SELECTED, COMBOS_DEVELOPMENT_TOOL_MARKER_OVERLAY_SUCCESS, COMBOS_DEVELOPMENT_TOOL_PICK_MODE_SUCCESS, COMBOS_DEVELOPMENT_TOOL_READY, COMBOS_DEVELOPMENT_TOOL_REFRESH, COMBOS_DEVELOPMENT_TOOL_SET_MARKER_OVERLAY, COMBOS_DEVELOPMENT_TOOL_SET_MUTED, COMBOS_DEVELOPMENT_TOOL_SET_PICK_MODE, COMBOS_DEVELOPMENT_TOOL_STATE_CHANGED, CombosDevelopmentToolSystem$1 as CombosDevelopmentToolSystem, CombosDevelopmentToolTarget, DEFAULT_ALLOWED_MESSAGE_HOST_SUFFIXES, MARKER_COMPONENTS, MARKER_ICON_SIZE, applyPropertyValue, applyPropertyWithHooks, buildGameObjectDeselectedPayload, buildGameObjectSnapshot, drawMarkerIcon, isAllowedMessageOrigin, isClearSelectionMessage, mergeAllowedMessageOrigins, readPropertyValue, readSourceAnchor, resolveMarkerDef, shouldNotifyGameObjectDeselected };
|
|
1380
1380
|
//# sourceMappingURL=plugin-development-tool.esm.js.map
|