@combos-fun/plugin-development-tool 0.0.12 → 0.0.14

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.
@@ -1,5 +1,5 @@
1
- import { Component, System, OBSERVER_TYPE, GameObject, decorators } from '@combos-fun/engine';
2
1
  import { __decorate } from 'tslib';
2
+ import { Component, System, OBSERVER_TYPE, GameObject, decorators } from '@combos-fun/engine';
3
3
  import { Graphics } from '@combos-fun/plugin-renderer-graphics';
4
4
  import { Event, HIT_AREA_TYPE } from '@combos-fun/plugin-renderer-event';
5
5
 
@@ -9,6 +9,10 @@ const COMBOS_DEVELOPMENT_TOOL_SET = 'combos-development-tool:set';
9
9
  const COMBOS_DEVELOPMENT_TOOL_REFRESH = 'combos-development-tool:refresh';
10
10
  /** Emitted to `window.parent` when an object is selected while the tool is on. */
11
11
  const COMBOS_DEVELOPMENT_TOOL_GAMEOBJECT_SELECTED = 'combos-development-tool:gameobject-selected';
12
+ /** Parent → iframe: apply a value to a component field (live preview). */
13
+ const COMBOS_DEVELOPMENT_TOOL_APPLY_PROPERTY = 'combos-development-tool:apply-property';
14
+ /** iframe → parent: game scene bootstrap finished; parent may enable pick mode. */
15
+ const COMBOS_DEVELOPMENT_TOOL_READY = 'combos-development-tool:ready';
12
16
 
13
17
  /**
14
18
  * Optional marker when using `CombosDevelopmentToolSystem` with `scope: 'tagged'`, or to attach
@@ -25,6 +29,243 @@ class CombosDevelopmentToolTarget extends Component {
25
29
  }
26
30
  }
27
31
 
32
+ function isSceneSourceAnchor(v) {
33
+ return (!!v &&
34
+ typeof v === 'object' &&
35
+ typeof v.file === 'string');
36
+ }
37
+
38
+ const SKIP_KEYS = new Set([
39
+ 'gameObject',
40
+ 'name',
41
+ 'started',
42
+ '__componentDefaultParams',
43
+ 'destroyed',
44
+ 'inScene',
45
+ 'worldTransform',
46
+ 'children',
47
+ '_parent',
48
+ ]);
49
+ const COMPONENT_SKIP_KEYS = {
50
+ Physics: new Set([
51
+ 'body',
52
+ 'Body',
53
+ 'PhysicsEngine',
54
+ 'World',
55
+ 'Constraint',
56
+ 'mouseConstraint',
57
+ 'bodyParams',
58
+ ]),
59
+ Event: new Set(['hitArea']),
60
+ };
61
+ function cloneJsonSafe(value, depth = 0) {
62
+ if (value === null || value === undefined)
63
+ return value;
64
+ if (typeof value === 'number' || typeof value === 'string' || typeof value === 'boolean') {
65
+ return value;
66
+ }
67
+ if (depth > 6)
68
+ return undefined;
69
+ if (Array.isArray(value)) {
70
+ return value.map(item => cloneJsonSafe(item, depth + 1));
71
+ }
72
+ if (typeof value === 'object') {
73
+ const out = {};
74
+ for (const [k, v] of Object.entries(value)) {
75
+ if (typeof v === 'function')
76
+ continue;
77
+ const cloned = cloneJsonSafe(v, depth + 1);
78
+ if (cloned !== undefined)
79
+ out[k] = cloned;
80
+ }
81
+ return out;
82
+ }
83
+ return undefined;
84
+ }
85
+ function serializeComponent(comp) {
86
+ const out = {};
87
+ const componentSkips = COMPONENT_SKIP_KEYS[comp.name];
88
+ for (const key of Object.keys(comp)) {
89
+ if (SKIP_KEYS.has(key) || key.startsWith('_'))
90
+ continue;
91
+ if (componentSkips?.has(key))
92
+ continue;
93
+ const value = comp[key];
94
+ if (typeof value === 'function')
95
+ continue;
96
+ const cloned = cloneJsonSafe(value);
97
+ if (cloned !== undefined)
98
+ out[key] = cloned;
99
+ }
100
+ return out;
101
+ }
102
+ function readSourceAnchor(go) {
103
+ const tag = go.getComponent(CombosDevelopmentToolTarget);
104
+ const raw = tag?.payload?.source;
105
+ if (!isSceneSourceAnchor(raw))
106
+ return undefined;
107
+ return {
108
+ file: raw.file,
109
+ anchor: raw.anchor ?? go.name,
110
+ };
111
+ }
112
+ function buildGameObjectSnapshot(go) {
113
+ const components = go.components
114
+ .filter(c => c.name !== 'CombosDevelopmentToolTarget')
115
+ .map(c => ({
116
+ componentName: c.name,
117
+ fields: serializeComponent(c),
118
+ }));
119
+ return {
120
+ id: go.id,
121
+ name: go.name,
122
+ components,
123
+ source: readSourceAnchor(go),
124
+ };
125
+ }
126
+ function applyPropertyValue(go, componentName, path, value) {
127
+ const comp = go.getComponent(componentName);
128
+ if (!comp || !path.length)
129
+ return false;
130
+ let target = comp;
131
+ for (let i = 0; i < path.length - 1; i++) {
132
+ const key = path[i];
133
+ if (target[key] === undefined || target[key] === null) {
134
+ target[key] = {};
135
+ }
136
+ target = target[key];
137
+ }
138
+ target[path[path.length - 1]] = value;
139
+ return true;
140
+ }
141
+ function readPropertyValue(go, componentName, path) {
142
+ const comp = go.getComponent(componentName);
143
+ if (!comp || !path.length)
144
+ return undefined;
145
+ let target = comp;
146
+ for (const key of path) {
147
+ if (target === null || target === undefined || typeof target !== 'object') {
148
+ return undefined;
149
+ }
150
+ target = target[key];
151
+ }
152
+ return target;
153
+ }
154
+
155
+ const TRANSFORM_VECTOR_KEYS = new Set([
156
+ 'position',
157
+ 'size',
158
+ 'origin',
159
+ 'anchor',
160
+ 'scale',
161
+ 'skew',
162
+ ]);
163
+ function asNumber(value) {
164
+ if (typeof value === 'number' && Number.isFinite(value)) {
165
+ return value;
166
+ }
167
+ if (typeof value === 'string' && value.trim() !== '') {
168
+ const next = Number(value);
169
+ return Number.isFinite(next) ? next : undefined;
170
+ }
171
+ return undefined;
172
+ }
173
+ function syncPhysicsBodyFromTransform(go) {
174
+ const physics = go.getComponent('Physics');
175
+ if (!physics?.body) {
176
+ return;
177
+ }
178
+ const { x, y } = go.transform.position;
179
+ if (physics.Body?.setPosition) {
180
+ physics.Body.setPosition(physics.body, { x, y });
181
+ return;
182
+ }
183
+ physics.body.position.x = x;
184
+ physics.body.position.y = y;
185
+ }
186
+ function syncMoverOriginFromTransform(go) {
187
+ const mover = go.getComponent('PlatformerMover');
188
+ if (!mover) {
189
+ return;
190
+ }
191
+ mover.originX = go.transform.position.x;
192
+ mover.originY = go.transform.position.y;
193
+ }
194
+ function applyTransformProperty(go, comp, path, value) {
195
+ const transform = go.transform ?? comp;
196
+ const transformRecord = transform;
197
+ if (path.length === 1 && path[0] === 'rotation') {
198
+ const next = asNumber(value);
199
+ if (next === undefined) {
200
+ return false;
201
+ }
202
+ transform.rotation = next;
203
+ return true;
204
+ }
205
+ if (path.length === 2 && TRANSFORM_VECTOR_KEYS.has(path[0])) {
206
+ const groupKey = path[0];
207
+ const leafKey = path[1];
208
+ const next = asNumber(value);
209
+ if (next === undefined) {
210
+ return false;
211
+ }
212
+ const group = transformRecord[groupKey];
213
+ if (!group || typeof group !== 'object') {
214
+ return false;
215
+ }
216
+ group[leafKey] = next;
217
+ if (groupKey === 'position') {
218
+ syncPhysicsBodyFromTransform(go);
219
+ syncMoverOriginFromTransform(go);
220
+ }
221
+ return true;
222
+ }
223
+ return false;
224
+ }
225
+ function applyTextProperty(_go, comp, path, value) {
226
+ const textComp = comp;
227
+ if (path.length === 1 && path[0] === 'text') {
228
+ textComp.text = String(value ?? '');
229
+ return true;
230
+ }
231
+ if (path.length === 2 && path[0] === 'style') {
232
+ const styleKey = path[1];
233
+ const nextStyle = { ...(textComp.style ?? {}), [styleKey]: value };
234
+ textComp.style = nextStyle;
235
+ return true;
236
+ }
237
+ return false;
238
+ }
239
+ function applySoundProperty(_go, comp, path, value) {
240
+ const soundComp = comp;
241
+ if ((path.length === 1 && path[0] === 'volume') ||
242
+ (path.length === 2 && path[0] === 'config' && path[1] === 'volume')) {
243
+ const next = asNumber(value);
244
+ if (next === undefined) {
245
+ return false;
246
+ }
247
+ soundComp.volume = next;
248
+ return true;
249
+ }
250
+ return false;
251
+ }
252
+ const APPLY_HOOKS = {
253
+ Transform: applyTransformProperty,
254
+ Text: applyTextProperty,
255
+ Sound: applySoundProperty,
256
+ };
257
+ function applyPropertyWithHooks(go, componentName, path, value) {
258
+ const comp = go.getComponent(componentName);
259
+ if (!comp || !path.length) {
260
+ return false;
261
+ }
262
+ const hook = APPLY_HOOKS[componentName];
263
+ if (hook?.(go, comp, path, value)) {
264
+ return true;
265
+ }
266
+ return applyPropertyValue(go, componentName, path, value);
267
+ }
268
+
28
269
  const OUTLINE_GO_NAME = '__combosDevelopmentToolOutline';
29
270
  /**
30
271
  * **Defaults:** `scope: 'scene'`, **off** at start (no tap hijack until enabled).
@@ -48,6 +289,7 @@ let CombosDevelopmentToolSystem = class CombosDevelopmentToolSystem extends Syst
48
289
  /** We added `Event` for hit-testing; remove on teardown when disabling / releaseTap. */
49
290
  this.injectedEvents = new Set();
50
291
  this.needsSceneRescan = false;
292
+ this.needsTaggedRescan = false;
51
293
  this.onWindowSet = (e) => {
52
294
  const d = e.detail;
53
295
  if (d && typeof d.enabled === 'boolean') {
@@ -64,6 +306,9 @@ let CombosDevelopmentToolSystem = class CombosDevelopmentToolSystem extends Syst
64
306
  else if (d.type === COMBOS_DEVELOPMENT_TOOL_REFRESH) {
65
307
  this.requestSceneRescan();
66
308
  }
309
+ else if (d.type === COMBOS_DEVELOPMENT_TOOL_APPLY_PROPERTY) {
310
+ this.handleApplyProperty(d);
311
+ }
67
312
  };
68
313
  this.onGameSet = (payload) => {
69
314
  if (payload && typeof payload.enabled === 'boolean') {
@@ -91,6 +336,9 @@ let CombosDevelopmentToolSystem = class CombosDevelopmentToolSystem extends Syst
91
336
  if (this.enabled && this.scope === 'scene') {
92
337
  this.needsSceneRescan = true;
93
338
  }
339
+ else if (this.enabled && this.scope === 'tagged') {
340
+ this.needsTaggedRescan = true;
341
+ }
94
342
  }
95
343
  onDestroy() {
96
344
  if (typeof window !== 'undefined') {
@@ -110,22 +358,27 @@ let CombosDevelopmentToolSystem = class CombosDevelopmentToolSystem extends Syst
110
358
  this.enabled = on;
111
359
  if (!on) {
112
360
  this.clearSelection();
113
- if (this.scope === 'scene') {
114
- this.detachAllTaps();
115
- }
361
+ this.detachAllTaps();
116
362
  }
117
363
  else if (this.scope === 'scene') {
118
364
  this.needsSceneRescan = true;
119
365
  }
366
+ else {
367
+ this.needsTaggedRescan = true;
368
+ }
120
369
  }
121
370
  get isEnabled() {
122
371
  return this.enabled;
123
372
  }
124
373
  update(e) {
125
- if (this.scope === 'scene' && this.enabled && this.needsSceneRescan) {
374
+ if (this.enabled && this.needsSceneRescan && this.scope === 'scene') {
126
375
  this.needsSceneRescan = false;
127
376
  this.attachSceneTree();
128
377
  }
378
+ if (this.enabled && this.needsTaggedRescan && this.scope === 'tagged') {
379
+ this.needsTaggedRescan = false;
380
+ this.attachTaggedObjects();
381
+ }
129
382
  for (const go of [...this.tapOwners.values()]) {
130
383
  if (go.destroyed) {
131
384
  this.releaseTap(go);
@@ -162,9 +415,29 @@ let CombosDevelopmentToolSystem = class CombosDevelopmentToolSystem extends Syst
162
415
  }
163
416
  /** Re-bind scene taps when `scope === 'scene'` (e.g. after dynamic spawn). */
164
417
  requestSceneRescan() {
165
- if (this.scope !== 'scene' || !this.enabled)
418
+ if (!this.enabled)
166
419
  return;
167
- this.needsSceneRescan = true;
420
+ if (this.scope === 'scene') {
421
+ this.needsSceneRescan = true;
422
+ }
423
+ else {
424
+ this.needsTaggedRescan = true;
425
+ }
426
+ }
427
+ attachTaggedObjects() {
428
+ const list = [];
429
+ for (const tr of this.game.scene.transform.children) {
430
+ this.collectGameObjects(tr.gameObject, list);
431
+ }
432
+ for (const go of list) {
433
+ if (go.name === OUTLINE_GO_NAME)
434
+ continue;
435
+ if (go === this.outlineGo)
436
+ continue;
437
+ if (!go.getComponent(CombosDevelopmentToolTarget))
438
+ continue;
439
+ this.ensureTap(go);
440
+ }
168
441
  }
169
442
  attachSceneTree() {
170
443
  this.detachAllTaps();
@@ -205,7 +478,7 @@ let CombosDevelopmentToolSystem = class CombosDevelopmentToolSystem extends Syst
205
478
  }
206
479
  if (this.tapHandlers.has(go.id))
207
480
  return;
208
- const handler = () => this.onSelect(go);
481
+ const handler = (payload) => this.onSelect(go, payload);
209
482
  this.tapHandlers.set(go.id, handler);
210
483
  this.tapOwners.set(go.id, go);
211
484
  ev.on('tap', handler);
@@ -239,7 +512,7 @@ let CombosDevelopmentToolSystem = class CombosDevelopmentToolSystem extends Syst
239
512
  go.addComponent(new Graphics());
240
513
  this.outlineGo = go;
241
514
  }
242
- onSelect(go) {
515
+ onSelect(go, tap) {
243
516
  if (!this.enabled)
244
517
  return;
245
518
  this.ensureOutline();
@@ -250,11 +523,91 @@ let CombosDevelopmentToolSystem = class CombosDevelopmentToolSystem extends Syst
250
523
  this.outlineGo.remove();
251
524
  }
252
525
  go.addChild(this.outlineGo);
253
- const payload = this.serializeGameObject(go);
526
+ const snapshot = buildGameObjectSnapshot(go);
527
+ const payload = {
528
+ type: COMBOS_DEVELOPMENT_TOOL_GAMEOBJECT_SELECTED,
529
+ snapshot,
530
+ pointer: tap?.data?.position ?? null,
531
+ };
254
532
  if (typeof window !== 'undefined' && window.parent && window.parent !== window) {
255
533
  window.parent.postMessage(payload, this.postMessageOrigin);
256
534
  }
257
535
  }
536
+ findGameObjectById(id) {
537
+ const stack = [];
538
+ for (const tr of this.game.scene.transform.children) {
539
+ this.collectGameObjects(tr.gameObject, stack);
540
+ }
541
+ return stack.find(go => go.id === id) ?? null;
542
+ }
543
+ findGameObjectBySource(source) {
544
+ const stack = [];
545
+ for (const tr of this.game.scene.transform.children) {
546
+ this.collectGameObjects(tr.gameObject, stack);
547
+ }
548
+ const wantFile = source.file.trim();
549
+ const wantAnchor = (source.anchor ?? '').trim();
550
+ if (!wantAnchor) {
551
+ return null;
552
+ }
553
+ for (const go of stack) {
554
+ const anchor = readSourceAnchor(go);
555
+ if (!anchor || anchor.file !== wantFile) {
556
+ continue;
557
+ }
558
+ const resolvedAnchor = anchor.anchor ?? go.name;
559
+ if (resolvedAnchor === wantAnchor) {
560
+ return go;
561
+ }
562
+ }
563
+ return null;
564
+ }
565
+ resolveApplyTarget(payload) {
566
+ if (typeof payload.gameObjectId === 'number') {
567
+ const byId = this.findGameObjectById(payload.gameObjectId);
568
+ if (byId) {
569
+ return byId;
570
+ }
571
+ }
572
+ const file = payload.source?.file?.trim();
573
+ const anchor = payload.source?.anchor?.trim();
574
+ if (!file || !anchor) {
575
+ return null;
576
+ }
577
+ return this.findGameObjectBySource({ file, anchor });
578
+ }
579
+ handleApplyProperty(payload) {
580
+ const componentName = payload.componentName;
581
+ const path = payload.path;
582
+ const hasId = typeof payload.gameObjectId === 'number';
583
+ const hasSource = Boolean(payload.source?.file?.trim()) && Boolean(payload.source?.anchor?.trim());
584
+ if ((!hasId && !hasSource) ||
585
+ typeof componentName !== 'string' ||
586
+ !Array.isArray(path) ||
587
+ path.length === 0) {
588
+ return;
589
+ }
590
+ const go = this.resolveApplyTarget(payload);
591
+ if (!go)
592
+ return;
593
+ const applied = applyPropertyWithHooks(go, componentName, path, payload.value);
594
+ if (!applied)
595
+ return;
596
+ if (this.selected?.id === go.id) {
597
+ this.postSnapshotUpdate(go);
598
+ }
599
+ }
600
+ postSnapshotUpdate(go) {
601
+ const snapshot = buildGameObjectSnapshot(go);
602
+ if (typeof window !== 'undefined' && window.parent && window.parent !== window) {
603
+ window.parent.postMessage({
604
+ type: COMBOS_DEVELOPMENT_TOOL_GAMEOBJECT_SELECTED,
605
+ snapshot,
606
+ pointer: null,
607
+ source: 'property-applied',
608
+ }, this.postMessageOrigin);
609
+ }
610
+ }
258
611
  clearSelection() {
259
612
  this.selected = null;
260
613
  if (this.outlineGo?.parent) {
@@ -265,29 +618,19 @@ let CombosDevelopmentToolSystem = class CombosDevelopmentToolSystem extends Syst
265
618
  gfx.graphics.clear();
266
619
  }
267
620
  }
268
- serializeGameObject(go) {
269
- const tag = go.getComponent(CombosDevelopmentToolTarget);
270
- const pos = go.transform.position;
271
- const size = go.transform.size;
272
- return {
273
- type: COMBOS_DEVELOPMENT_TOOL_GAMEOBJECT_SELECTED,
274
- gameObject: {
275
- name: go.name,
276
- id: go.id,
277
- position: { x: pos.x, y: pos.y },
278
- size: { width: size.width, height: size.height },
279
- rotation: go.transform.rotation,
280
- payload: tag?.payload ?? {},
281
- },
282
- };
283
- }
284
621
  };
285
622
  CombosDevelopmentToolSystem = __decorate([
286
623
  decorators.componentObserver({
287
624
  CombosDevelopmentToolTarget: [],
288
625
  })
289
626
  ], CombosDevelopmentToolSystem);
290
- var CombosDevelopmentToolSystem_default = CombosDevelopmentToolSystem;
627
+ var CombosDevelopmentToolSystem$1 = CombosDevelopmentToolSystem;
628
+
629
+ /** Auto-generated by scripts/build-package.mjs — do not edit. */
630
+ Object.assign(CombosDevelopmentToolSystem$1, {
631
+ packageName: "@combos-fun/plugin-development-tool",
632
+ packageVersion: "0.0.14",
633
+ });
291
634
 
292
- export { COMBOS_DEVELOPMENT_TOOL_GAMEOBJECT_SELECTED, COMBOS_DEVELOPMENT_TOOL_REFRESH, COMBOS_DEVELOPMENT_TOOL_SET, CombosDevelopmentToolSystem_default as CombosDevelopmentToolSystem, CombosDevelopmentToolTarget };
635
+ export { COMBOS_DEVELOPMENT_TOOL_APPLY_PROPERTY, COMBOS_DEVELOPMENT_TOOL_GAMEOBJECT_SELECTED, COMBOS_DEVELOPMENT_TOOL_READY, COMBOS_DEVELOPMENT_TOOL_REFRESH, COMBOS_DEVELOPMENT_TOOL_SET, CombosDevelopmentToolSystem$1 as CombosDevelopmentToolSystem, CombosDevelopmentToolTarget, applyPropertyValue, applyPropertyWithHooks, buildGameObjectSnapshot, readPropertyValue, readSourceAnchor };
293
636
  //# sourceMappingURL=plugin-development-tool.esm.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"plugin-development-tool.esm.js","sources":["../lib/constants.ts","../lib/CombosDevelopmentToolTarget.ts","../lib/CombosDevelopmentToolSystem.ts"],"sourcesContent":["/** Toggle development-tool selection / parent postMessage. Payload: `{ enabled: boolean }`. */\nexport const COMBOS_DEVELOPMENT_TOOL_SET = 'combos-development-tool:set' as const;\n\n/** Re-scan the scene tree (only when `CombosDevelopmentToolSystem` uses `scope: 'scene'`). */\nexport const COMBOS_DEVELOPMENT_TOOL_REFRESH = 'combos-development-tool:refresh' as const;\n\n/** Emitted to `window.parent` when an object is selected while the tool is on. */\nexport const COMBOS_DEVELOPMENT_TOOL_GAMEOBJECT_SELECTED =\n 'combos-development-tool:gameobject-selected' as const;\n","import { Component, ComponentParams } from '@combos-fun/engine';\n\nexport interface CombosDevelopmentToolTargetParams extends ComponentParams {\n /** Extra JSON-serializable fields included in postMessage to parent. */\n payload?: Record<string, unknown>;\n}\n\n/**\n * Optional marker when using `CombosDevelopmentToolSystem` with `scope: 'tagged'`, or to attach\n * extra `payload` on specific objects while using `scope: 'scene'` (serialization reads it if present).\n */\nexport default class CombosDevelopmentToolTarget extends Component<CombosDevelopmentToolTargetParams> {\n static componentName = 'CombosDevelopmentToolTarget';\n\n payload: Record<string, unknown> = {};\n\n init(params?: CombosDevelopmentToolTargetParams) {\n this.payload = params?.payload ? { ...params.payload } : {};\n }\n}\n","import {\n ComponentChanged,\n GameObject,\n OBSERVER_TYPE,\n System,\n UpdateParams,\n decorators,\n} from '@combos-fun/engine';\nimport { Graphics } from '@combos-fun/plugin-renderer-graphics';\nimport { Event, HIT_AREA_TYPE } from '@combos-fun/plugin-renderer-event';\nimport {\n COMBOS_DEVELOPMENT_TOOL_GAMEOBJECT_SELECTED,\n COMBOS_DEVELOPMENT_TOOL_REFRESH,\n COMBOS_DEVELOPMENT_TOOL_SET,\n} from './constants';\nimport CombosDevelopmentToolTarget from './CombosDevelopmentToolTarget';\n\nexport type CombosDevelopmentToolSelectScope = 'tagged' | 'scene';\n\nexport interface CombosDevelopmentToolSystemParams {\n /** postMessage `targetOrigin` when notifying parent (default `'*'`). */\n postMessageOrigin?: string;\n /**\n * - `tagged`: only `GameObject`s with {@link CombosDevelopmentToolTarget} participate (optional `payload`).\n * - `scene`: all objects under `game.scene` (except the outline helper) get tap → outline + postMessage; no marker component required (default).\n */\n scope?: CombosDevelopmentToolSelectScope;\n}\n\nconst OUTLINE_GO_NAME = '__combosDevelopmentToolOutline';\n\ntype SetPayload = { enabled?: boolean };\n\n/**\n * **Defaults:** `scope: 'scene'`, **off** at start (no tap hijack until enabled).\n * Turn on/off via:\n * - `window.dispatchEvent(new CustomEvent(COMBOS_DEVELOPMENT_TOOL_SET, { detail: { enabled: true } }))`\n * - `window.postMessage({ type: COMBOS_DEVELOPMENT_TOOL_SET, enabled: true }, targetOrigin)` (e.g. from parent iframe)\n * - `game.emit(COMBOS_DEVELOPMENT_TOOL_SET, { enabled: true })` or `getSystem(CombosDevelopmentToolSystem).setEnabled(true)`\n *\n * With `scope: 'scene'`, while enabled: `game.emit(COMBOS_DEVELOPMENT_TOOL_REFRESH)`, `window` event `combos-development-tool:refresh`, or `postMessage({ type: 'combos-development-tool:refresh' })` to re-bind after adding/removing objects.\n */\n@decorators.componentObserver({\n CombosDevelopmentToolTarget: [],\n})\nexport default class CombosDevelopmentToolSystem extends System<CombosDevelopmentToolSystemParams> {\n static systemName = 'CombosDevelopmentToolSystem';\n\n private postMessageOrigin = '*';\n private scope: CombosDevelopmentToolSelectScope = 'scene';\n private enabled = false;\n private outlineGo: GameObject | null = null;\n private selected: GameObject | null = null;\n private readonly tapHandlers = new Map<number, () => void>();\n private readonly tapOwners = new Map<number, GameObject>();\n /** We added `Event` for hit-testing; remove on teardown when disabling / releaseTap. */\n private readonly injectedEvents = new Set<number>();\n private needsSceneRescan = false;\n\n private readonly onWindowSet = (e: globalThis.Event) => {\n const d = (e as unknown as CustomEvent<SetPayload>).detail;\n if (d && typeof d.enabled === 'boolean') {\n this.setEnabled(d.enabled);\n }\n };\n\n private readonly onWindowMessage = (e: MessageEvent) => {\n const d = e.data;\n if (!d || typeof d !== 'object') return;\n if (d.type === COMBOS_DEVELOPMENT_TOOL_SET && typeof d.enabled === 'boolean') {\n this.setEnabled(d.enabled);\n } else if (d.type === COMBOS_DEVELOPMENT_TOOL_REFRESH) {\n this.requestSceneRescan();\n }\n };\n\n private readonly onGameSet = (payload: SetPayload) => {\n if (payload && typeof payload.enabled === 'boolean') {\n this.setEnabled(payload.enabled);\n }\n };\n\n private readonly onGameRefresh = () => {\n this.requestSceneRescan();\n };\n\n private readonly onWindowRefresh = () => {\n this.requestSceneRescan();\n };\n\n init(params?: CombosDevelopmentToolSystemParams) {\n this.postMessageOrigin = params?.postMessageOrigin ?? '*';\n this.scope = params?.scope ?? 'scene';\n\n if (typeof window !== 'undefined') {\n window.addEventListener(COMBOS_DEVELOPMENT_TOOL_SET, this.onWindowSet);\n window.addEventListener(COMBOS_DEVELOPMENT_TOOL_REFRESH, this.onWindowRefresh);\n window.addEventListener('message', this.onWindowMessage);\n }\n this.game.on(COMBOS_DEVELOPMENT_TOOL_SET, this.onGameSet);\n this.game.on(COMBOS_DEVELOPMENT_TOOL_REFRESH, this.onGameRefresh);\n\n if (this.enabled && this.scope === 'scene') {\n this.needsSceneRescan = true;\n }\n }\n\n onDestroy() {\n if (typeof window !== 'undefined') {\n window.removeEventListener(COMBOS_DEVELOPMENT_TOOL_SET, this.onWindowSet);\n window.removeEventListener(COMBOS_DEVELOPMENT_TOOL_REFRESH, this.onWindowRefresh);\n window.removeEventListener('message', this.onWindowMessage);\n }\n this.game.off(COMBOS_DEVELOPMENT_TOOL_SET, this.onGameSet);\n this.game.off(COMBOS_DEVELOPMENT_TOOL_REFRESH, this.onGameRefresh);\n this.detachAllTaps();\n this.clearSelection();\n }\n\n /** Programmatic toggle (same effect as events). */\n setEnabled(on: boolean) {\n if (this.enabled === on) return;\n this.enabled = on;\n if (!on) {\n this.clearSelection();\n if (this.scope === 'scene') {\n this.detachAllTaps();\n }\n } else if (this.scope === 'scene') {\n this.needsSceneRescan = true;\n }\n }\n\n get isEnabled(): boolean {\n return this.enabled;\n }\n\n update(e: UpdateParams) {\n if (this.scope === 'scene' && this.enabled && this.needsSceneRescan) {\n this.needsSceneRescan = false;\n this.attachSceneTree();\n }\n\n for (const go of [...this.tapOwners.values()]) {\n if (go.destroyed) {\n this.releaseTap(go);\n }\n }\n\n if (!this.enabled || !this.selected || !this.outlineGo) return;\n\n const gfxComp = this.outlineGo.getComponent(Graphics);\n if (!gfxComp?.graphics) return;\n\n const { width, height } = this.selected.transform.size;\n const g = gfxComp.graphics;\n g.clear();\n const t = typeof performance !== 'undefined' ? performance.now() : e.time;\n const pulse = 0.35 + 0.65 * (0.5 + 0.5 * Math.sin(t * 0.012));\n g.rect(0, 0, Math.max(1, width), Math.max(1, height));\n g.stroke({ width: 4, color: 0x55ffaa, alpha: pulse });\n }\n\n componentChanged(changed: ComponentChanged) {\n if (this.scope === 'scene') return;\n\n const { type, gameObject, componentName } = changed;\n if (!gameObject || componentName !== 'CombosDevelopmentToolTarget') return;\n\n if (type === OBSERVER_TYPE.ADD) {\n this.ensureTap(gameObject);\n } else if (type === OBSERVER_TYPE.REMOVE) {\n this.releaseTap(gameObject);\n if (this.selected === gameObject) {\n this.clearSelection();\n }\n }\n }\n\n /** Re-bind scene taps when `scope === 'scene'` (e.g. after dynamic spawn). */\n requestSceneRescan() {\n if (this.scope !== 'scene' || !this.enabled) return;\n this.needsSceneRescan = true;\n }\n\n private attachSceneTree() {\n this.detachAllTaps();\n const list: GameObject[] = [];\n for (const tr of this.game.scene.transform.children) {\n this.collectGameObjects(tr.gameObject, list);\n }\n for (const go of list) {\n if (go.name === OUTLINE_GO_NAME) continue;\n if (go === this.outlineGo) continue;\n this.ensureTap(go);\n }\n }\n\n private collectGameObjects(go: GameObject, out: GameObject[]) {\n out.push(go);\n for (const tr of go.transform.children) {\n this.collectGameObjects(tr.gameObject, out);\n }\n }\n\n private detachAllTaps() {\n for (const go of [...this.tapOwners.values()]) {\n this.releaseTap(go);\n }\n }\n\n private ensureTap(go: GameObject) {\n let ev = go.getComponent(Event);\n if (!ev) {\n const { width, height } = go.transform.size;\n ev = go.addComponent(\n new Event({\n hitArea: {\n type: HIT_AREA_TYPE.Rect,\n style: { x: 0, y: 0, width: width || 1, height: height || 1 },\n },\n }),\n );\n this.injectedEvents.add(go.id);\n }\n\n if (this.tapHandlers.has(go.id)) return;\n\n const handler = () => this.onSelect(go);\n this.tapHandlers.set(go.id, handler);\n this.tapOwners.set(go.id, go);\n ev.on('tap', handler);\n }\n\n private releaseTap(go: GameObject) {\n const handler = this.tapHandlers.get(go.id);\n if (!handler) return;\n const ev = go.getComponent(Event);\n ev?.off('tap', handler);\n this.tapHandlers.delete(go.id);\n this.tapOwners.delete(go.id);\n if (this.injectedEvents.has(go.id)) {\n try {\n go.removeComponent(Event);\n } catch {\n /* ignore */\n }\n this.injectedEvents.delete(go.id);\n }\n }\n\n private ensureOutline() {\n if (this.outlineGo) return;\n const go = new GameObject(OUTLINE_GO_NAME, {\n size: { width: 1, height: 1 },\n position: { x: 0, y: 0 },\n origin: { x: 0, y: 0 },\n });\n go.addComponent(new Graphics());\n this.outlineGo = go;\n }\n\n private onSelect(go: GameObject) {\n if (!this.enabled) return;\n\n this.ensureOutline();\n if (!this.outlineGo) return;\n\n this.selected = go;\n\n if (this.outlineGo.parent) {\n this.outlineGo.remove();\n }\n go.addChild(this.outlineGo);\n\n const payload = this.serializeGameObject(go);\n if (typeof window !== 'undefined' && window.parent && window.parent !== window) {\n window.parent.postMessage(payload, this.postMessageOrigin);\n }\n }\n\n private clearSelection() {\n this.selected = null;\n if (this.outlineGo?.parent) {\n this.outlineGo.remove();\n }\n const gfx = this.outlineGo?.getComponent(Graphics);\n if (gfx?.graphics) {\n gfx.graphics.clear();\n }\n }\n\n private serializeGameObject(go: GameObject) {\n const tag = go.getComponent(CombosDevelopmentToolTarget);\n const pos = go.transform.position;\n const size = go.transform.size;\n return {\n type: COMBOS_DEVELOPMENT_TOOL_GAMEOBJECT_SELECTED,\n gameObject: {\n name: go.name,\n id: go.id,\n position: { x: pos.x, y: pos.y },\n size: { width: size.width, height: size.height },\n rotation: go.transform.rotation,\n payload: tag?.payload ?? {},\n },\n };\n }\n}\n"],"names":[],"mappings":";;;;;AAAA;AACO,MAAM,2BAA2B,GAAG;AAE3C;AACO,MAAM,+BAA+B,GAAG;AAE/C;AACO,MAAM,2CAA2C,GACtD;;ACDF;;;AAGG;AACW,MAAO,2BAA4B,SAAQ,SAA4C,CAAA;AAArG,IAAA,WAAA,GAAA;;QAGE,IAAA,CAAA,OAAO,GAA4B,EA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AAA,IAAI,EAAE,2CAA2C;AACjD,YAAA,UAAU,EAAE;gBACV,IAAI,EAAE,EAAE,CAAC,IAAI;gBACb,EAAE,EAAE,EAAE,CAAC,EAAE;AACT,gBAAA,QAAQ,EAAE,EAAE,CAAC,EAAE,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,GAAG,CAAC,CAAC,EAAE;AAChC,gBAAA,IAAI,EAAE,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE;AAChD,gBAAA,QAAQ,EAAE,EAAE,CAAC,SAAS,CAAC,QAAQ;AAC/B,gBAAA,OAAO,EAAE,GAAG,EAAE,OAAO,IAAI,EAAE;AAC5B,aAAA;SACF;IACH;;AAtQmB,2BAA2B,GAAA,UAAA,CAAA;IAH/C,UAAU,CAAC,iBAAiB,CAAC;AAC5B,QAAA,2BAA2B,EAAE,EAAE;KAChC;AACoB,CAAA,EAAA,2BAA2B,CAuQ/C;0CAvQoB,2BAA2B;;;;"}
1
+ {"version":3,"file":"plugin-development-tool.esm.js","sources":["../lib/constants.ts","../lib/CombosDevelopmentToolTarget.ts","../lib/sceneEditTypes.ts","../lib/sceneEditSerialize.ts","../lib/sceneEditApplyHooks.ts","../lib/CombosDevelopmentToolSystem.ts","../lib/__combosPackageMeta.gen.ts"],"sourcesContent":["/** Toggle development-tool selection / parent postMessage. Payload: `{ enabled: boolean }`. */\nexport const COMBOS_DEVELOPMENT_TOOL_SET = 'combos-development-tool:set' as const;\n\n/** Re-scan the scene tree (only when `CombosDevelopmentToolSystem` uses `scope: 'scene'`). */\nexport const COMBOS_DEVELOPMENT_TOOL_REFRESH = 'combos-development-tool:refresh' as const;\n\n/** Emitted to `window.parent` when an object is selected while the tool is on. */\nexport const COMBOS_DEVELOPMENT_TOOL_GAMEOBJECT_SELECTED =\n 'combos-development-tool:gameobject-selected' as const;\n\n/** Parent → iframe: apply a value to a component field (live preview). */\nexport const COMBOS_DEVELOPMENT_TOOL_APPLY_PROPERTY =\n 'combos-development-tool:apply-property' as const;\n\n/** iframe → parent: game scene bootstrap finished; parent may enable pick mode. */\nexport const COMBOS_DEVELOPMENT_TOOL_READY = 'combos-development-tool:ready' as const;\n","import { Component, ComponentParams } from '@combos-fun/engine';\n\nexport interface CombosDevelopmentToolTargetParams extends ComponentParams {\n /** Extra JSON-serializable fields included in postMessage to parent. */\n payload?: Record<string, unknown>;\n}\n\n/**\n * Optional marker when using `CombosDevelopmentToolSystem` with `scope: 'tagged'`, or to attach\n * extra `payload` on specific objects while using `scope: 'scene'` (serialization reads it if present).\n */\nexport default class CombosDevelopmentToolTarget extends Component<CombosDevelopmentToolTargetParams> {\n static componentName = 'CombosDevelopmentToolTarget';\n\n payload: Record<string, unknown> = {};\n\n init(params?: CombosDevelopmentToolTargetParams) {\n this.payload = params?.payload ? { ...params.payload } : {};\n }\n}\n","/** Optional bootstrap anchor stored on {@link CombosDevelopmentToolTarget}.payload.source */\nexport interface SceneSourceAnchor {\n /** Project-relative path, e.g. `src/index.ts` */\n file: string;\n /** Variable name in bootstrap (`const poster = …`) or stable key; defaults to gameObject name */\n anchor?: string;\n}\n\nexport interface SceneEditPropertyRef {\n gameObjectId: number;\n gameObjectName: string;\n componentName: string;\n path: string[];\n}\n\nexport interface SceneEditComponentSnapshot {\n componentName: string;\n fields: Record<string, unknown>;\n}\n\nexport interface SceneEditGameObjectSnapshot {\n id: number;\n name: string;\n components: SceneEditComponentSnapshot[];\n source?: SceneSourceAnchor;\n}\n\nexport function isSceneSourceAnchor(v: unknown): v is SceneSourceAnchor {\n return (\n !!v &&\n typeof v === 'object' &&\n typeof (v as SceneSourceAnchor).file === 'string'\n );\n}\n","import { Component, GameObject } from '@combos-fun/engine';\nimport CombosDevelopmentToolTarget from './CombosDevelopmentToolTarget';\nimport {\n isSceneSourceAnchor,\n type SceneEditComponentSnapshot,\n type SceneEditGameObjectSnapshot,\n type SceneSourceAnchor,\n} from './sceneEditTypes';\n\nconst SKIP_KEYS = new Set([\n 'gameObject',\n 'name',\n 'started',\n '__componentDefaultParams',\n 'destroyed',\n 'inScene',\n 'worldTransform',\n 'children',\n '_parent',\n]);\n\nconst COMPONENT_SKIP_KEYS: Record<string, ReadonlySet<string>> = {\n Physics: new Set([\n 'body',\n 'Body',\n 'PhysicsEngine',\n 'World',\n 'Constraint',\n 'mouseConstraint',\n 'bodyParams',\n ]),\n Event: new Set(['hitArea']),\n};\n\nfunction cloneJsonSafe(value: unknown, depth = 0): unknown {\n if (value === null || value === undefined) return value;\n if (typeof value === 'number' || typeof value === 'string' || typeof value === 'boolean') {\n return value;\n }\n if (depth > 6) return undefined;\n if (Array.isArray(value)) {\n return value.map(item => cloneJsonSafe(item, depth + 1));\n }\n if (typeof value === 'object') {\n const out: Record<string, unknown> = {};\n for (const [k, v] of Object.entries(value as Record<string, unknown>)) {\n if (typeof v === 'function') continue;\n const cloned = cloneJsonSafe(v, depth + 1);\n if (cloned !== undefined) out[k] = cloned;\n }\n return out;\n }\n return undefined;\n}\n\nfunction serializeComponent(comp: Component): Record<string, unknown> {\n const out: Record<string, unknown> = {};\n const componentSkips = COMPONENT_SKIP_KEYS[comp.name];\n for (const key of Object.keys(comp)) {\n if (SKIP_KEYS.has(key) || key.startsWith('_')) continue;\n if (componentSkips?.has(key)) continue;\n const value = (comp as Record<string, unknown>)[key];\n if (typeof value === 'function') continue;\n const cloned = cloneJsonSafe(value);\n if (cloned !== undefined) out[key] = cloned;\n }\n return out;\n}\n\nexport function readSourceAnchor(go: GameObject): SceneSourceAnchor | undefined {\n const tag = go.getComponent(CombosDevelopmentToolTarget);\n const raw = tag?.payload?.source;\n if (!isSceneSourceAnchor(raw)) return undefined;\n return {\n file: raw.file,\n anchor: raw.anchor ?? go.name,\n };\n}\n\nexport function buildGameObjectSnapshot(go: GameObject): SceneEditGameObjectSnapshot {\n const components: SceneEditComponentSnapshot[] = go.components\n .filter(c => c.name !== 'CombosDevelopmentToolTarget')\n .map(c => ({\n componentName: c.name,\n fields: serializeComponent(c),\n }));\n\n return {\n id: go.id,\n name: go.name,\n components,\n source: readSourceAnchor(go),\n };\n}\n\nexport function applyPropertyValue(\n go: GameObject,\n componentName: string,\n path: string[],\n value: unknown,\n): boolean {\n const comp = go.getComponent(componentName);\n if (!comp || !path.length) return false;\n\n let target: Record<string, unknown> = comp as unknown as Record<string, unknown>;\n for (let i = 0; i < path.length - 1; i++) {\n const key = path[i];\n if (target[key] === undefined || target[key] === null) {\n target[key] = {};\n }\n target = target[key] as Record<string, unknown>;\n }\n\n target[path[path.length - 1]] = value;\n return true;\n}\n\nexport function readPropertyValue(\n go: GameObject,\n componentName: string,\n path: string[],\n): unknown {\n const comp = go.getComponent(componentName);\n if (!comp || !path.length) return undefined;\n\n let target: unknown = comp;\n for (const key of path) {\n if (target === null || target === undefined || typeof target !== 'object') {\n return undefined;\n }\n target = (target as Record<string, unknown>)[key];\n }\n return target;\n}\n","import type { Component, GameObject } from '@combos-fun/engine';\nimport { applyPropertyValue } from './sceneEditSerialize';\n\ntype SceneEditApplyHook = (\n go: GameObject,\n comp: Component,\n path: string[],\n value: unknown,\n) => boolean;\n\nconst TRANSFORM_VECTOR_KEYS = new Set([\n 'position',\n 'size',\n 'origin',\n 'anchor',\n 'scale',\n 'skew',\n]);\n\ntype PhysicsLike = {\n body?: { position: { x: number; y: number }; angle?: number };\n bodyParams?: { stopRotation?: boolean };\n Body?: { setPosition: (body: unknown, pos: { x: number; y: number }) => void; setAngle?: (body: unknown, angle: number) => void };\n};\n\ntype MoverLike = {\n originX: number;\n originY: number;\n};\n\nfunction asNumber(value: unknown): number | undefined {\n if (typeof value === 'number' && Number.isFinite(value)) {\n return value;\n }\n if (typeof value === 'string' && value.trim() !== '') {\n const next = Number(value);\n return Number.isFinite(next) ? next : undefined;\n }\n return undefined;\n}\n\nfunction syncPhysicsBodyFromTransform(go: GameObject): void {\n const physics = go.getComponent('Physics') as PhysicsLike | undefined;\n if (!physics?.body) {\n return;\n }\n\n const { x, y } = go.transform.position;\n if (physics.Body?.setPosition) {\n physics.Body.setPosition(physics.body, { x, y });\n return;\n }\n\n physics.body.position.x = x;\n physics.body.position.y = y;\n}\n\nfunction syncMoverOriginFromTransform(go: GameObject): void {\n const mover = go.getComponent('PlatformerMover') as MoverLike | undefined;\n if (!mover) {\n return;\n }\n mover.originX = go.transform.position.x;\n mover.originY = go.transform.position.y;\n}\n\nfunction applyTransformProperty(\n go: GameObject,\n comp: Component,\n path: string[],\n value: unknown,\n): boolean {\n const transform = go.transform ?? comp;\n const transformRecord = transform as unknown as Record<string, unknown>;\n\n if (path.length === 1 && path[0] === 'rotation') {\n const next = asNumber(value);\n if (next === undefined) {\n return false;\n }\n transform.rotation = next;\n return true;\n }\n\n if (path.length === 2 && TRANSFORM_VECTOR_KEYS.has(path[0])) {\n const groupKey = path[0];\n const leafKey = path[1];\n const next = asNumber(value);\n if (next === undefined) {\n return false;\n }\n\n const group = transformRecord[groupKey];\n if (!group || typeof group !== 'object') {\n return false;\n }\n\n (group as Record<string, unknown>)[leafKey] = next;\n\n if (groupKey === 'position') {\n syncPhysicsBodyFromTransform(go);\n syncMoverOriginFromTransform(go);\n }\n\n return true;\n }\n\n return false;\n}\n\nfunction applyTextProperty(\n _go: GameObject,\n comp: Component,\n path: string[],\n value: unknown,\n): boolean {\n const textComp = comp as Component & { text?: string; style?: Record<string, unknown> };\n\n if (path.length === 1 && path[0] === 'text') {\n textComp.text = String(value ?? '');\n return true;\n }\n\n if (path.length === 2 && path[0] === 'style') {\n const styleKey = path[1];\n const nextStyle = { ...(textComp.style ?? {}), [styleKey]: value };\n textComp.style = nextStyle;\n return true;\n }\n\n return false;\n}\n\nfunction applySoundProperty(\n _go: GameObject,\n comp: Component,\n path: string[],\n value: unknown,\n): boolean {\n const soundComp = comp as Component & { volume?: number };\n\n if (\n (path.length === 1 && path[0] === 'volume') ||\n (path.length === 2 && path[0] === 'config' && path[1] === 'volume')\n ) {\n const next = asNumber(value);\n if (next === undefined) {\n return false;\n }\n soundComp.volume = next;\n return true;\n }\n\n return false;\n}\n\nconst APPLY_HOOKS: Record<string, SceneEditApplyHook> = {\n Transform: applyTransformProperty,\n Text: applyTextProperty,\n Sound: applySoundProperty,\n};\n\nexport function applyPropertyWithHooks(\n go: GameObject,\n componentName: string,\n path: string[],\n value: unknown,\n): boolean {\n const comp = go.getComponent(componentName);\n if (!comp || !path.length) {\n return false;\n }\n\n const hook = APPLY_HOOKS[componentName];\n if (hook?.(go, comp, path, value)) {\n return true;\n }\n\n return applyPropertyValue(go, componentName, path, value);\n}\n","import {\n ComponentChanged,\n GameObject,\n OBSERVER_TYPE,\n System,\n UpdateParams,\n decorators,\n} from '@combos-fun/engine';\nimport { Graphics } from '@combos-fun/plugin-renderer-graphics';\nimport { Event, HIT_AREA_TYPE } from '@combos-fun/plugin-renderer-event';\nimport {\n COMBOS_DEVELOPMENT_TOOL_APPLY_PROPERTY,\n COMBOS_DEVELOPMENT_TOOL_GAMEOBJECT_SELECTED,\n COMBOS_DEVELOPMENT_TOOL_REFRESH,\n COMBOS_DEVELOPMENT_TOOL_SET,\n} from './constants';\nimport CombosDevelopmentToolTarget from './CombosDevelopmentToolTarget';\nimport { applyPropertyWithHooks } from './sceneEditApplyHooks';\nimport { buildGameObjectSnapshot, readSourceAnchor } from './sceneEditSerialize';\n\nimport type { SceneSourceAnchor } from './sceneEditTypes';\n\ntype TapEventPayload = {\n data?: {\n position?: { x: number; y: number };\n };\n};\n\ntype ApplyPropertyPayload = {\n gameObjectId?: number;\n source?: SceneSourceAnchor;\n componentName?: string;\n path?: string[];\n value?: unknown;\n};\n\nexport type CombosDevelopmentToolSelectScope = 'tagged' | 'scene';\n\nexport interface CombosDevelopmentToolSystemParams {\n /** postMessage `targetOrigin` when notifying parent (default `'*'`). */\n postMessageOrigin?: string;\n /**\n * - `tagged`: only `GameObject`s with {@link CombosDevelopmentToolTarget} participate (optional `payload`).\n * - `scene`: all objects under `game.scene` (except the outline helper) get tap → outline + postMessage; no marker component required (default).\n */\n scope?: CombosDevelopmentToolSelectScope;\n}\n\nconst OUTLINE_GO_NAME = '__combosDevelopmentToolOutline';\n\ntype SetPayload = { enabled?: boolean };\n\n/**\n * **Defaults:** `scope: 'scene'`, **off** at start (no tap hijack until enabled).\n * Turn on/off via:\n * - `window.dispatchEvent(new CustomEvent(COMBOS_DEVELOPMENT_TOOL_SET, { detail: { enabled: true } }))`\n * - `window.postMessage({ type: COMBOS_DEVELOPMENT_TOOL_SET, enabled: true }, targetOrigin)` (e.g. from parent iframe)\n * - `game.emit(COMBOS_DEVELOPMENT_TOOL_SET, { enabled: true })` or `getSystem(CombosDevelopmentToolSystem).setEnabled(true)`\n *\n * With `scope: 'scene'`, while enabled: `game.emit(COMBOS_DEVELOPMENT_TOOL_REFRESH)`, `window` event `combos-development-tool:refresh`, or `postMessage({ type: 'combos-development-tool:refresh' })` to re-bind after adding/removing objects.\n */\n@decorators.componentObserver({\n CombosDevelopmentToolTarget: [],\n})\nexport default class CombosDevelopmentToolSystem extends System<CombosDevelopmentToolSystemParams> {\n static systemName = 'CombosDevelopmentToolSystem';\n\n private postMessageOrigin = '*';\n private scope: CombosDevelopmentToolSelectScope = 'scene';\n private enabled = false;\n private outlineGo: GameObject | null = null;\n private selected: GameObject | null = null;\n private readonly tapHandlers = new Map<number, (payload?: TapEventPayload) => void>();\n private readonly tapOwners = new Map<number, GameObject>();\n /** We added `Event` for hit-testing; remove on teardown when disabling / releaseTap. */\n private readonly injectedEvents = new Set<number>();\n private needsSceneRescan = false;\n private needsTaggedRescan = false;\n\n private readonly onWindowSet = (e: globalThis.Event) => {\n const d = (e as unknown as CustomEvent<SetPayload>).detail;\n if (d && typeof d.enabled === 'boolean') {\n this.setEnabled(d.enabled);\n }\n };\n\n private readonly onWindowMessage = (e: MessageEvent) => {\n const d = e.data;\n if (!d || typeof d !== 'object') return;\n if (d.type === COMBOS_DEVELOPMENT_TOOL_SET && typeof d.enabled === 'boolean') {\n this.setEnabled(d.enabled);\n } else if (d.type === COMBOS_DEVELOPMENT_TOOL_REFRESH) {\n this.requestSceneRescan();\n } else if (d.type === COMBOS_DEVELOPMENT_TOOL_APPLY_PROPERTY) {\n this.handleApplyProperty(d as ApplyPropertyPayload);\n }\n };\n\n private readonly onGameSet = (payload: SetPayload) => {\n if (payload && typeof payload.enabled === 'boolean') {\n this.setEnabled(payload.enabled);\n }\n };\n\n private readonly onGameRefresh = () => {\n this.requestSceneRescan();\n };\n\n private readonly onWindowRefresh = () => {\n this.requestSceneRescan();\n };\n\n init(params?: CombosDevelopmentToolSystemParams) {\n this.postMessageOrigin = params?.postMessageOrigin ?? '*';\n this.scope = params?.scope ?? 'scene';\n\n if (typeof window !== 'undefined') {\n window.addEventListener(COMBOS_DEVELOPMENT_TOOL_SET, this.onWindowSet);\n window.addEventListener(COMBOS_DEVELOPMENT_TOOL_REFRESH, this.onWindowRefresh);\n window.addEventListener('message', this.onWindowMessage);\n }\n this.game.on(COMBOS_DEVELOPMENT_TOOL_SET, this.onGameSet);\n this.game.on(COMBOS_DEVELOPMENT_TOOL_REFRESH, this.onGameRefresh);\n\n if (this.enabled && this.scope === 'scene') {\n this.needsSceneRescan = true;\n } else if (this.enabled && this.scope === 'tagged') {\n this.needsTaggedRescan = true;\n }\n }\n\n onDestroy() {\n if (typeof window !== 'undefined') {\n window.removeEventListener(COMBOS_DEVELOPMENT_TOOL_SET, this.onWindowSet);\n window.removeEventListener(COMBOS_DEVELOPMENT_TOOL_REFRESH, this.onWindowRefresh);\n window.removeEventListener('message', this.onWindowMessage);\n }\n this.game.off(COMBOS_DEVELOPMENT_TOOL_SET, this.onGameSet);\n this.game.off(COMBOS_DEVELOPMENT_TOOL_REFRESH, this.onGameRefresh);\n this.detachAllTaps();\n this.clearSelection();\n }\n\n /** Programmatic toggle (same effect as events). */\n setEnabled(on: boolean) {\n if (this.enabled === on) return;\n this.enabled = on;\n if (!on) {\n this.clearSelection();\n this.detachAllTaps();\n } else if (this.scope === 'scene') {\n this.needsSceneRescan = true;\n } else {\n this.needsTaggedRescan = true;\n }\n }\n\n get isEnabled(): boolean {\n return this.enabled;\n }\n\n update(e: UpdateParams) {\n if (this.enabled && this.needsSceneRescan && this.scope === 'scene') {\n this.needsSceneRescan = false;\n this.attachSceneTree();\n }\n\n if (this.enabled && this.needsTaggedRescan && this.scope === 'tagged') {\n this.needsTaggedRescan = false;\n this.attachTaggedObjects();\n }\n\n for (const go of [...this.tapOwners.values()]) {\n if (go.destroyed) {\n this.releaseTap(go);\n }\n }\n\n if (!this.enabled || !this.selected || !this.outlineGo) return;\n\n const gfxComp = this.outlineGo.getComponent(Graphics);\n if (!gfxComp?.graphics) return;\n\n const { width, height } = this.selected.transform.size;\n const g = gfxComp.graphics;\n g.clear();\n const t = typeof performance !== 'undefined' ? performance.now() : e.time;\n const pulse = 0.35 + 0.65 * (0.5 + 0.5 * Math.sin(t * 0.012));\n g.rect(0, 0, Math.max(1, width), Math.max(1, height));\n g.stroke({ width: 4, color: 0x55ffaa, alpha: pulse });\n }\n\n componentChanged(changed: ComponentChanged) {\n if (this.scope === 'scene') return;\n\n const { type, gameObject, componentName } = changed;\n if (!gameObject || componentName !== 'CombosDevelopmentToolTarget') return;\n\n if (type === OBSERVER_TYPE.ADD) {\n this.ensureTap(gameObject);\n } else if (type === OBSERVER_TYPE.REMOVE) {\n this.releaseTap(gameObject);\n if (this.selected === gameObject) {\n this.clearSelection();\n }\n }\n }\n\n /** Re-bind scene taps when `scope === 'scene'` (e.g. after dynamic spawn). */\n requestSceneRescan() {\n if (!this.enabled) return;\n if (this.scope === 'scene') {\n this.needsSceneRescan = true;\n } else {\n this.needsTaggedRescan = true;\n }\n }\n\n private attachTaggedObjects() {\n const list: GameObject[] = [];\n for (const tr of this.game.scene.transform.children) {\n this.collectGameObjects(tr.gameObject, list);\n }\n for (const go of list) {\n if (go.name === OUTLINE_GO_NAME) continue;\n if (go === this.outlineGo) continue;\n if (!go.getComponent(CombosDevelopmentToolTarget)) continue;\n this.ensureTap(go);\n }\n }\n\n private attachSceneTree() {\n this.detachAllTaps();\n const list: GameObject[] = [];\n for (const tr of this.game.scene.transform.children) {\n this.collectGameObjects(tr.gameObject, list);\n }\n for (const go of list) {\n if (go.name === OUTLINE_GO_NAME) continue;\n if (go === this.outlineGo) continue;\n this.ensureTap(go);\n }\n }\n\n private collectGameObjects(go: GameObject, out: GameObject[]) {\n out.push(go);\n for (const tr of go.transform.children) {\n this.collectGameObjects(tr.gameObject, out);\n }\n }\n\n private detachAllTaps() {\n for (const go of [...this.tapOwners.values()]) {\n this.releaseTap(go);\n }\n }\n\n private ensureTap(go: GameObject) {\n let ev = go.getComponent(Event);\n if (!ev) {\n const { width, height } = go.transform.size;\n ev = go.addComponent(\n new Event({\n hitArea: {\n type: HIT_AREA_TYPE.Rect,\n style: { x: 0, y: 0, width: width || 1, height: height || 1 },\n },\n }),\n );\n this.injectedEvents.add(go.id);\n }\n\n if (this.tapHandlers.has(go.id)) return;\n\n const handler = (payload?: TapEventPayload) => this.onSelect(go, payload);\n this.tapHandlers.set(go.id, handler);\n this.tapOwners.set(go.id, go);\n ev.on('tap', handler);\n }\n\n private releaseTap(go: GameObject) {\n const handler = this.tapHandlers.get(go.id);\n if (!handler) return;\n const ev = go.getComponent(Event);\n ev?.off('tap', handler);\n this.tapHandlers.delete(go.id);\n this.tapOwners.delete(go.id);\n if (this.injectedEvents.has(go.id)) {\n try {\n go.removeComponent(Event);\n } catch {\n /* ignore */\n }\n this.injectedEvents.delete(go.id);\n }\n }\n\n private ensureOutline() {\n if (this.outlineGo) return;\n const go = new GameObject(OUTLINE_GO_NAME, {\n size: { width: 1, height: 1 },\n position: { x: 0, y: 0 },\n origin: { x: 0, y: 0 },\n });\n go.addComponent(new Graphics());\n this.outlineGo = go;\n }\n\n private onSelect(go: GameObject, tap?: TapEventPayload) {\n if (!this.enabled) return;\n\n this.ensureOutline();\n if (!this.outlineGo) return;\n\n this.selected = go;\n\n if (this.outlineGo.parent) {\n this.outlineGo.remove();\n }\n go.addChild(this.outlineGo);\n\n const snapshot = buildGameObjectSnapshot(go);\n const payload = {\n type: COMBOS_DEVELOPMENT_TOOL_GAMEOBJECT_SELECTED,\n snapshot,\n pointer: tap?.data?.position ?? null,\n };\n if (typeof window !== 'undefined' && window.parent && window.parent !== window) {\n window.parent.postMessage(payload, this.postMessageOrigin);\n }\n }\n\n private findGameObjectById(id: number): GameObject | null {\n const stack: GameObject[] = [];\n for (const tr of this.game.scene.transform.children) {\n this.collectGameObjects(tr.gameObject, stack);\n }\n return stack.find(go => go.id === id) ?? null;\n }\n\n private findGameObjectBySource(source: SceneSourceAnchor): GameObject | null {\n const stack: GameObject[] = [];\n for (const tr of this.game.scene.transform.children) {\n this.collectGameObjects(tr.gameObject, stack);\n }\n\n const wantFile = source.file.trim();\n const wantAnchor = (source.anchor ?? '').trim();\n if (!wantAnchor) {\n return null;\n }\n\n for (const go of stack) {\n const anchor = readSourceAnchor(go);\n if (!anchor || anchor.file !== wantFile) {\n continue;\n }\n const resolvedAnchor = anchor.anchor ?? go.name;\n if (resolvedAnchor === wantAnchor) {\n return go;\n }\n }\n\n return null;\n }\n\n private resolveApplyTarget(payload: ApplyPropertyPayload): GameObject | null {\n if (typeof payload.gameObjectId === 'number') {\n const byId = this.findGameObjectById(payload.gameObjectId);\n if (byId) {\n return byId;\n }\n }\n\n const file = payload.source?.file?.trim();\n const anchor = payload.source?.anchor?.trim();\n if (!file || !anchor) {\n return null;\n }\n\n return this.findGameObjectBySource({ file, anchor });\n }\n\n private handleApplyProperty(payload: ApplyPropertyPayload) {\n const componentName = payload.componentName;\n const path = payload.path;\n const hasId = typeof payload.gameObjectId === 'number';\n const hasSource =\n Boolean(payload.source?.file?.trim()) && Boolean(payload.source?.anchor?.trim());\n\n if (\n (!hasId && !hasSource) ||\n typeof componentName !== 'string' ||\n !Array.isArray(path) ||\n path.length === 0\n ) {\n return;\n }\n\n const go = this.resolveApplyTarget(payload);\n if (!go) return;\n\n const applied = applyPropertyWithHooks(go, componentName, path, payload.value);\n if (!applied) return;\n\n if (this.selected?.id === go.id) {\n this.postSnapshotUpdate(go);\n }\n }\n\n private postSnapshotUpdate(go: GameObject) {\n const snapshot = buildGameObjectSnapshot(go);\n if (typeof window !== 'undefined' && window.parent && window.parent !== window) {\n window.parent.postMessage(\n {\n type: COMBOS_DEVELOPMENT_TOOL_GAMEOBJECT_SELECTED,\n snapshot,\n pointer: null,\n source: 'property-applied',\n },\n this.postMessageOrigin,\n );\n }\n }\n\n private clearSelection() {\n this.selected = null;\n if (this.outlineGo?.parent) {\n this.outlineGo.remove();\n }\n const gfx = this.outlineGo?.getComponent(Graphics);\n if (gfx?.graphics) {\n gfx.graphics.clear();\n }\n }\n}\n","/** Auto-generated by scripts/build-package.mjs — do not edit. */\n\nimport CombosDevelopmentToolSystem from './CombosDevelopmentToolSystem';\n\nObject.assign(CombosDevelopmentToolSystem, {\n packageName: \"@combos-fun/plugin-development-tool\",\n packageVersion: \"0.0.14\",\n});\n"],"names":["CombosDevelopmentToolSystem"],"mappings":";;;;;AAAA;AACO,MAAM,2BAA2B,GAAG;AAE3C;AACO,MAAM,+BAA+B,GAAG;AAE/C;AACO,MAAM,2CAA2C,GACtD;AAEF;AACO,MAAM,sCAAsC,GACjD;AAEF;AACO,MAAM,6BAA6B,GAAG;;ACR7C;;;AAGG;AACW,MAAO,2BAA4B,SAAQ,SAA4C,CAAA;AAArG,IAAA,WAAA,GAAA;;QAGE,IAAA,CAAA,OAAO,GAA4B,EAAE;IAKvC;aAPS,IAAA,CAAA,aAAa,GAAG,6BAAH,CAAiC;AAIrD,IAAA,IAAI,CAAC,MAA0C,EAAA;AAC7C,QAAA,IAAI,CAAC,OAAO,GAAG,MAAM,EAAE,OAAO,GAAG,EAAE,GAAG,MAAM,CAAC,OAAO,EAAE,GAAG,EAAE;IAC7D;;;ACSI,SAAU,mBAAmB,CAAC,CAAU,EAAA;IAC5C,QACE,CAAC,CAAC,CAAC;QACH,OAAO,CAAC,KAAK,QAAQ;AACrB,QAAA,OAA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