@operato/scene-visualizer 10.0.0-beta.4 → 10.0.0-beta.7

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.
@@ -143,6 +143,7 @@ const NATURE = {
143
143
  const WEBGL_NO_SUPPORT_TEXT = 'WebGL no support';
144
144
  let Visualizer = class Visualizer extends ThreeContainer {
145
145
  _legendTarget;
146
+ _focused_stock;
146
147
  _objects = {};
147
148
  _stock_materials = [];
148
149
  _default_material;
@@ -151,7 +152,7 @@ let Visualizer = class Visualizer extends ThreeContainer {
151
152
  return !!this.getState('hideEmptyStock');
152
153
  }
153
154
  get legendTarget() {
154
- var { legendTarget } = this.state;
155
+ const { legendTarget } = this.state;
155
156
  if (!this._legendTarget && legendTarget) {
156
157
  this._legendTarget = this.root.findById?.(legendTarget);
157
158
  this._legendTarget && this._legendTarget.on('change', this.onLegendTargetChanged, this);
@@ -193,25 +194,14 @@ let Visualizer = class Visualizer extends ThreeContainer {
193
194
  if (typeof this.data !== 'object') {
194
195
  return;
195
196
  }
196
- var data = this.data;
197
- var locationField = this.getState('locationField') || 'location';
197
+ let data = this.data;
198
+ const locationField = this.getState('locationField') || 'location';
198
199
  if (data instanceof Array) {
199
- /**
200
- * Array type data
201
- * (e.g. data: [{
202
- * 'location' : 'A0101-01',
203
- * 'description': 'description1',
204
- * ...
205
- * }, {
206
- * ...
207
- * }])
208
- */
209
200
  data = data.reduce((acc, value, i, arr) => {
210
- var location = value[locationField];
201
+ const location = value[locationField];
211
202
  if (!location) {
212
203
  return acc;
213
204
  }
214
- // 하나의 로케이션에 여러 레코드 정보가 올 수 있으므로, 하나이 로케이션의 스탁정보를 items 배열에 담는다.
215
205
  if (acc[location]) {
216
206
  acc[location]['items'].push(value);
217
207
  }
@@ -221,18 +211,10 @@ let Visualizer = class Visualizer extends ThreeContainer {
221
211
  return acc;
222
212
  }, {});
223
213
  }
224
- /**
225
- * Object type data
226
- * (e.g. data: {
227
- * 'A0101-01': { items: [{ location: 'A0101-01', qty: 10, description: 'description', ... }, {...}] },
228
- * ...
229
- * })
230
- */
231
- for (var key in data) {
232
- let id = key;
233
- if (data.hasOwnProperty(id)) {
234
- let d = data[id];
235
- let object = this.getObject(id);
214
+ for (const key in data) {
215
+ if (data.hasOwnProperty(key)) {
216
+ const d = data[key];
217
+ const object = this.getObject(key);
236
218
  if (object) {
237
219
  ;
238
220
  object.onchangeStockData(d);
@@ -245,29 +227,46 @@ let Visualizer = class Visualizer extends ThreeContainer {
245
227
  this.resetMaterials();
246
228
  }
247
229
  onmouseup(e) {
248
- if (this.controlsManager.isActive) {
249
- const { popupScene, left, top, width, height } = this.state;
250
- const pointer = this.transcoordC2S(e.offsetX, e.offsetY);
251
- this.eventManager.updateMouseNDC(pointer.x, pointer.y, left, top, width, height);
252
- const realObject = this.eventManager.handleClick(this.cameraManager.camera, this.sceneManager.scene, e);
253
- if (realObject) {
254
- if (popupScene && realObject instanceof Stock) {
255
- realObject.onmouseup(e, this, (data) => {
256
- ScenePopup.show(this, popupScene, {
257
- data,
258
- modal: false,
259
- closable: true,
260
- output: false,
261
- location: this.state.popupPosition || 'right-top'
262
- });
263
- });
264
- }
265
- }
266
- else {
267
- ScenePopup.hide(this.root);
230
+ if (!this.controlsManager.isActive)
231
+ return;
232
+ // v10: ThreeContainer 기본 mouseup 처리 (기즈모, 선택 등)
233
+ super.onmouseup(e);
234
+ // Visualizer 고유: Stock 클릭 시 팝업 표시
235
+ const { popupScene } = this.state;
236
+ if (!popupScene)
237
+ return;
238
+ const camera = this.cameraManager.activeCamera;
239
+ const scene3d = this.sceneManager.scene;
240
+ if (!camera || !scene3d)
241
+ return;
242
+ const realObject = this.eventManager.handleClick(camera, scene3d, e);
243
+ if (realObject && realObject instanceof Stock) {
244
+ // 이전 focused 해제
245
+ if (this._focused_stock && this._focused_stock !== realObject) {
246
+ this._focused_stock._focused = false;
268
247
  }
248
+ // 클릭한 Stock에 focused 설정 → onBeforeRender에서 회전 애니메이션
249
+ realObject._focused = true;
250
+ realObject._focusedAt = performance.now();
251
+ this._focused_stock = realObject;
269
252
  this.invalidate();
270
- e.stopPropagation();
253
+ realObject.onmouseup(e, this, (data) => {
254
+ ScenePopup.show(this, popupScene, {
255
+ data,
256
+ modal: false,
257
+ closable: true,
258
+ output: false,
259
+ location: this.state.popupPosition || 'right-top'
260
+ });
261
+ });
262
+ }
263
+ else if (!realObject) {
264
+ // 빈 공간 클릭 시 focused 해제
265
+ if (this._focused_stock) {
266
+ this._focused_stock._focused = false;
267
+ delete this._focused_stock;
268
+ }
269
+ ScenePopup.hide(this.root);
271
270
  }
272
271
  }
273
272
  };
@@ -1 +1 @@
1
- {"version":3,"file":"visualizer.js","sourceRoot":"","sources":["../src/visualizer.ts"],"names":[],"mappings":"AAAA;;GAEG;;AAEH,OAAO,EAAa,UAAU,EAA+B,cAAc,EAAc,cAAc,EAAE,MAAM,wBAAwB,CAAA;AAEvI,OAAO,EAAE,KAAK,EAA8B,MAAM,YAAY,CAAA;AAE9D,MAAM,MAAM,GAAoB;IAC9B,OAAO,EAAE,KAAK;IACd,SAAS,EAAE,IAAI;IACf,SAAS,EAAE,IAAI;IACf,UAAU,EAAE;QACV;YACE,IAAI,EAAE,QAAQ;YACd,KAAK,EAAE,KAAK;YACZ,IAAI,EAAE,KAAK;YACX,QAAQ,EAAE,KAAK;SAChB;QACD;YACE,IAAI,EAAE,QAAQ;YACd,KAAK,EAAE,MAAM;YACb,IAAI,EAAE,MAAM;YACZ,QAAQ,EAAE,MAAM;SACjB;QACD;YACE,IAAI,EAAE,QAAQ;YACd,KAAK,EAAE,KAAK;YACZ,IAAI,EAAE,KAAK;YACX,QAAQ,EAAE,KAAK;SAChB;QACD;YACE,IAAI,EAAE,QAAQ;YACd,KAAK,EAAE,MAAM;YACb,IAAI,EAAE,MAAM;YACZ,QAAQ,EAAE,MAAM;SACjB;QACD;YACE,IAAI,EAAE,QAAQ;YACd,KAAK,EAAE,UAAU;YACjB,IAAI,EAAE,SAA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4BACJ,KAAK,EAAE,KAAK;4BACZ,QAAQ,EAAE,IAAI;4BACd,MAAM,EAAE,KAAK;4BACb,QAAQ,EAAE,IAAI,CAAC,KAAK,CAAC,aAAa,IAAI,WAAW;yBAC3C,CAAC,CAAA;oBACX,CAAC,CAAC,CAAA;gBACJ,CAAC;YACH,CAAC;iBAAM,CAAC;gBACN,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,IAAW,CAAC,CAAA;YACnC,CAAC;YAED,IAAI,CAAC,UAAU,EAAE,CAAA;YACjB,CAAC,CAAC,eAAe,EAAE,CAAA;QACrB,CAAC;IACH,CAAC;CACF,CAAA;AA9JY,UAAU;IADtB,cAAc,CAAC,YAAY,CAAC;GAChB,UAAU,CA8JtB","sourcesContent":["/*\n * Copyright © HatioLab Inc. All rights reserved.\n */\n\nimport { Component, ScenePopup, Properties, ComponentNature, sceneComponent, RealObject, ThreeContainer } from '@hatiolab/things-scene'\nimport * as THREE from 'three'\nimport { Stock, type StockMaterialProvider } from './stock.js'\n\nconst NATURE: ComponentNature = {\n mutable: false,\n resizable: true,\n rotatable: true,\n properties: [\n {\n type: 'number',\n label: 'fov',\n name: 'fov',\n property: 'fov'\n },\n {\n type: 'number',\n label: 'near',\n name: 'near',\n property: 'near'\n },\n {\n type: 'number',\n label: 'far',\n name: 'far',\n property: 'far'\n },\n {\n type: 'number',\n label: 'zoom',\n name: 'zoom',\n property: 'zoom'\n },\n {\n type: 'number',\n label: 'camera-x',\n name: 'cameraX'\n },\n {\n type: 'number',\n label: 'camera-y',\n name: 'cameraY'\n },\n {\n type: 'number',\n label: 'camera-z',\n name: 'cameraZ'\n },\n {\n type: 'select',\n label: 'precision',\n name: 'precision',\n property: {\n options: [\n {\n display: 'High',\n value: 'highp'\n },\n {\n display: 'Medium',\n value: 'mediump'\n },\n {\n display: 'Low',\n value: 'lowp'\n }\n ]\n }\n },\n {\n type: 'checkbox',\n label: 'anti-alias',\n name: 'antialias',\n property: 'antialias'\n },\n {\n type: 'checkbox',\n label: 'auto-rotate',\n name: 'autoRotate',\n property: 'autoRotate'\n },\n {\n type: 'checkbox',\n label: '3dmode',\n name: 'threed',\n property: 'threed'\n },\n {\n type: 'checkbox',\n label: 'debug',\n name: 'debug',\n property: 'debug'\n },\n {\n type: 'string',\n label: 'location-field',\n name: 'locationField',\n placeholder: 'location'\n },\n {\n type: 'board-selector',\n label: 'popup-scene',\n name: 'popupScene'\n },\n {\n type: 'id-input',\n label: 'legend-target',\n name: 'legendTarget',\n property: {\n component: 'legend'\n }\n },\n {\n type: 'number',\n label: 'rotation-speed',\n name: 'rotationSpeed'\n },\n {\n type: 'checkbox',\n label: 'hide-empty-stock',\n name: 'hideEmptyStock'\n },\n {\n type: 'select',\n label: 'popup-position',\n name: 'popupPosition',\n property: {\n options: [\n { display: '', value: '' },\n { display: 'CENTER', value: 'center' },\n { display: 'LEFTTOP', value: 'left-top' },\n { display: 'RIGHTTOP', value: 'right-top' },\n { display: 'LEFTBOTTOM', value: 'left-bottom' },\n { display: 'RIGHTBOTTOM', value: 'right-bottom' }\n ]\n }\n }\n ],\n help: 'scene/component/visualizer'\n}\n\nconst WEBGL_NO_SUPPORT_TEXT = 'WebGL no support'\n\n@sceneComponent('visualizer')\nexport class Visualizer extends ThreeContainer implements StockMaterialProvider {\n _legendTarget?: Component\n\n _objects: { [id: string]: RealObject } = {}\n\n _stock_materials: THREE.Material[] = []\n _default_material?: THREE.Material\n _empty_material?: THREE.Material\n\n get hideEmptyStock(): boolean {\n return !!this.getState('hideEmptyStock')\n }\n\n get legendTarget() {\n var { legendTarget } = this.state\n\n if (!this._legendTarget && legendTarget) {\n this._legendTarget = this.root.findById?.(legendTarget)\n this._legendTarget && this._legendTarget.on('change', this.onLegendTargetChanged, this)\n }\n\n return this._legendTarget\n }\n\n putObject(id: string, object: RealObject) {\n id && (this._objects[id] = object)\n }\n\n getObject(id: string): RealObject {\n return this._objects[id]\n }\n\n /* Container Overides .. */\n\n dispose() {\n this._legendTarget && this._legendTarget.off('change', this.onLegendTargetChanged, this)\n delete this._legendTarget\n\n super.dispose()\n }\n\n get nature(): ComponentNature {\n return NATURE\n }\n\n resetMaterials() {\n this._stock_materials.forEach(m => {\n if (m.dispose) m.dispose()\n })\n\n this._stock_materials = []\n }\n\n /* Event Handlers */\n\n onchange(after: Properties, before: Properties) {\n if (before.hasOwnProperty('legendTarget') || after.hasOwnProperty('legendTarget')) {\n this._legendTarget && this._legendTarget.off('change', this.onLegendTargetChanged, this)\n delete this._legendTarget\n this.resetMaterials()\n }\n\n super.onchange(after, before)\n }\n\n onchangeData(): void {\n if (typeof this.data !== 'object') {\n return\n }\n\n var data = this.data\n var locationField = this.getState('locationField') || 'location'\n\n if (data instanceof Array) {\n /**\n * Array type data\n * (e.g. data: [{\n * 'location' : 'A0101-01',\n * 'description': 'description1',\n * ...\n * }, {\n * ...\n * }])\n */\n\n data = data.reduce((acc, value, i, arr) => {\n var location = value[locationField]\n\n if (!location) {\n return acc\n }\n\n // 하나의 로케이션에 여러 레코드 정보가 올 수 있으므로, 하나이 로케이션의 스탁정보를 items 배열에 담는다.\n if (acc[location]) {\n acc[location]['items'].push(value)\n } else {\n acc[location] = { items: [value] }\n }\n\n return acc\n }, {})\n }\n\n /**\n * Object type data\n * (e.g. data: {\n * 'A0101-01': { items: [{ location: 'A0101-01', qty: 10, description: 'description', ... }, {...}] },\n * ...\n * })\n */\n for (var key in data) {\n let id = key\n if (data.hasOwnProperty(id)) {\n let d = data[id]\n let object = this.getObject(id)\n if (object) {\n ;(object as Stock).onchangeStockData(d)\n }\n }\n }\n }\n\n onLegendTargetChanged(after: { [key: string]: any }, before: { [key: string]: any }) {\n if (after.hasOwnProperty('status') && before.hasOwnProperty('status')) this.resetMaterials()\n }\n\n onmouseup(e: MouseEvent) {\n if (this.controlsManager.isActive) {\n const { popupScene, left, top, width, height } = this.state\n const pointer = this.transcoordC2S(e.offsetX, e.offsetY)\n this.eventManager.updateMouseNDC(pointer.x, pointer.y, left, top, width, height)\n\n const realObject = this.eventManager.handleClick(\n this.cameraManager.camera!,\n this.sceneManager.scene!,\n e\n )\n\n if (realObject) {\n if (popupScene && realObject instanceof Stock) {\n realObject.onmouseup(e, this, (data: any) => {\n ScenePopup.show(this as any, popupScene, {\n data,\n modal: false,\n closable: true,\n output: false,\n location: this.state.popupPosition || 'right-top'\n } as any)\n })\n }\n } else {\n ScenePopup.hide(this.root as any)\n }\n\n this.invalidate()\n e.stopPropagation()\n }\n }\n}\n"]}
1
+ {"version":3,"file":"visualizer.js","sourceRoot":"","sources":["../src/visualizer.ts"],"names":[],"mappings":"AAAA;;GAEG;;AAEH,OAAO,EAAa,UAAU,EAA+B,cAAc,EAAc,cAAc,EAAE,MAAM,wBAAwB,CAAA;AAEvI,OAAO,EAAE,KAAK,EAA8B,MAAM,YAAY,CAAA;AAE9D,MAAM,MAAM,GAAoB;IAC9B,OAAO,EAAE,KAAK;IACd,SAAS,EAAE,IAAI;IACf,SAAS,EAAE,IAAI;IACf,UAAU,EAAE;QACV;YACE,IAAI,EAAE,QAAQ;YACd,KAAK,EAAE,KAAK;YACZ,IAAI,EAAE,KAAK;YACX,QAAQ,EAAE,KAAK;SAChB;QACD;YACE,IAAI,EAAE,QAAQ;YACd,KAAK,EAAE,MAAM;YACb,IAAI,EAAE,MAAM;YACZ,QAAQ,EAAE,MAAM;SACjB;QACD;YACE,IAAI,EAAE,QAAQ;YACd,KAAK,EAAE,KAAK;YACZ,IAAI,EAAE,KAAK;YACX,QAAQ,EAAE,KAAK;SAChB;QACD;YACE,IAAI,EAAE,QAAQ;YACd,KAAK,EAAE,MAAM;YACb,IAAI,EAAE,MAAM;YACZ,QAAQ,EAAE,MAAM;SACjB;QACD;YACE,IAAI,EAAE,QAAQ;YACd,KAAK,EAAE,UAAU;YACjB,IAAI,EAAE,SAAS;SAChB;QACD;YACE,IAAI,EAAE,QAAQ;YACd,KAAK,EAAE,UAAU;YACjB,IAAI,EAAE,SAAS;SAChB;QACD;YACE,IAAI,EAAE,QAAQ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CAAC,IAAS,EAAE,EAAE;gBAC1C,UAAU,CAAC,IAAI,CAAC,IAAW,EAAE,UAAU,EAAE;oBACvC,IAAI;oBACJ,KAAK,EAAE,KAAK;oBACZ,QAAQ,EAAE,IAAI;oBACd,MAAM,EAAE,KAAK;oBACb,QAAQ,EAAE,IAAI,CAAC,KAAK,CAAC,aAAa,IAAI,WAAW;iBAC3C,CAAC,CAAA;YACX,CAAC,CAAC,CAAA;QACJ,CAAC;aAAM,IAAI,CAAC,UAAU,EAAE,CAAC;YACvB,uBAAuB;YACvB,IAAI,IAAI,CAAC,cAAc,EAAE,CAAC;gBACxB,IAAI,CAAC,cAAc,CAAC,QAAQ,GAAG,KAAK,CAAA;gBACpC,OAAO,IAAI,CAAC,cAAc,CAAA;YAC5B,CAAC;YACD,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,IAAW,CAAC,CAAA;QACnC,CAAC;IACH,CAAC;CACF,CAAA;AAxJY,UAAU;IADtB,cAAc,CAAC,YAAY,CAAC;GAChB,UAAU,CAwJtB","sourcesContent":["/*\n * Copyright © HatioLab Inc. All rights reserved.\n */\n\nimport { Component, ScenePopup, Properties, ComponentNature, sceneComponent, RealObject, ThreeContainer } from '@hatiolab/things-scene'\nimport * as THREE from 'three'\nimport { Stock, type StockMaterialProvider } from './stock.js'\n\nconst NATURE: ComponentNature = {\n mutable: false,\n resizable: true,\n rotatable: true,\n properties: [\n {\n type: 'number',\n label: 'fov',\n name: 'fov',\n property: 'fov'\n },\n {\n type: 'number',\n label: 'near',\n name: 'near',\n property: 'near'\n },\n {\n type: 'number',\n label: 'far',\n name: 'far',\n property: 'far'\n },\n {\n type: 'number',\n label: 'zoom',\n name: 'zoom',\n property: 'zoom'\n },\n {\n type: 'number',\n label: 'camera-x',\n name: 'cameraX'\n },\n {\n type: 'number',\n label: 'camera-y',\n name: 'cameraY'\n },\n {\n type: 'number',\n label: 'camera-z',\n name: 'cameraZ'\n },\n {\n type: 'select',\n label: 'precision',\n name: 'precision',\n property: {\n options: [\n {\n display: 'High',\n value: 'highp'\n },\n {\n display: 'Medium',\n value: 'mediump'\n },\n {\n display: 'Low',\n value: 'lowp'\n }\n ]\n }\n },\n {\n type: 'checkbox',\n label: 'anti-alias',\n name: 'antialias',\n property: 'antialias'\n },\n {\n type: 'checkbox',\n label: 'auto-rotate',\n name: 'autoRotate',\n property: 'autoRotate'\n },\n {\n type: 'checkbox',\n label: '3dmode',\n name: 'threed',\n property: 'threed'\n },\n {\n type: 'checkbox',\n label: 'debug',\n name: 'debug',\n property: 'debug'\n },\n {\n type: 'string',\n label: 'location-field',\n name: 'locationField',\n placeholder: 'location'\n },\n {\n type: 'board-selector',\n label: 'popup-scene',\n name: 'popupScene'\n },\n {\n type: 'id-input',\n label: 'legend-target',\n name: 'legendTarget',\n property: {\n component: 'legend'\n }\n },\n {\n type: 'number',\n label: 'rotation-speed',\n name: 'rotationSpeed'\n },\n {\n type: 'checkbox',\n label: 'hide-empty-stock',\n name: 'hideEmptyStock'\n },\n {\n type: 'select',\n label: 'popup-position',\n name: 'popupPosition',\n property: {\n options: [\n { display: '', value: '' },\n { display: 'CENTER', value: 'center' },\n { display: 'LEFTTOP', value: 'left-top' },\n { display: 'RIGHTTOP', value: 'right-top' },\n { display: 'LEFTBOTTOM', value: 'left-bottom' },\n { display: 'RIGHTBOTTOM', value: 'right-bottom' }\n ]\n }\n }\n ],\n help: 'scene/component/visualizer'\n}\n\nconst WEBGL_NO_SUPPORT_TEXT = 'WebGL no support'\n\n@sceneComponent('visualizer')\nexport class Visualizer extends ThreeContainer implements StockMaterialProvider {\n _legendTarget?: Component\n _focused_stock?: Stock\n\n _objects: { [id: string]: RealObject } = {}\n\n _stock_materials: THREE.Material[] = []\n _default_material?: THREE.Material\n _empty_material?: THREE.Material\n\n get hideEmptyStock(): boolean {\n return !!this.getState('hideEmptyStock')\n }\n\n get legendTarget() {\n const { legendTarget } = this.state\n\n if (!this._legendTarget && legendTarget) {\n this._legendTarget = this.root.findById?.(legendTarget)\n this._legendTarget && this._legendTarget.on('change', this.onLegendTargetChanged, this)\n }\n\n return this._legendTarget\n }\n\n putObject(id: string, object: RealObject) {\n id && (this._objects[id] = object)\n }\n\n getObject(id: string): RealObject {\n return this._objects[id]\n }\n\n /* Container Overides .. */\n\n dispose() {\n this._legendTarget && this._legendTarget.off('change', this.onLegendTargetChanged, this)\n delete this._legendTarget\n\n super.dispose()\n }\n\n get nature(): ComponentNature {\n return NATURE\n }\n\n resetMaterials() {\n this._stock_materials.forEach(m => {\n if (m.dispose) m.dispose()\n })\n\n this._stock_materials = []\n }\n\n /* Event Handlers */\n\n onchange(after: Properties, before: Properties) {\n if (before.hasOwnProperty('legendTarget') || after.hasOwnProperty('legendTarget')) {\n this._legendTarget && this._legendTarget.off('change', this.onLegendTargetChanged, this)\n delete this._legendTarget\n this.resetMaterials()\n }\n\n super.onchange(after, before)\n }\n\n onchangeData(): void {\n if (typeof this.data !== 'object') {\n return\n }\n\n let data = this.data as any\n const locationField = this.getState('locationField') || 'location'\n\n if (data instanceof Array) {\n data = data.reduce((acc, value, i, arr) => {\n const location = value[locationField]\n\n if (!location) {\n return acc\n }\n\n if (acc[location]) {\n acc[location]['items'].push(value)\n } else {\n acc[location] = { items: [value] }\n }\n\n return acc\n }, {})\n }\n\n for (const key in data) {\n if (data.hasOwnProperty(key)) {\n const d = data[key]\n const object = this.getObject(key)\n if (object) {\n ;(object as Stock).onchangeStockData(d)\n }\n }\n }\n }\n\n onLegendTargetChanged(after: { [key: string]: any }, before: { [key: string]: any }) {\n if (after.hasOwnProperty('status') && before.hasOwnProperty('status')) this.resetMaterials()\n }\n\n onmouseup(e: MouseEvent) {\n if (!this.controlsManager.isActive) return\n\n // v10: ThreeContainer 기본 mouseup 처리 (기즈모, 선택 등)\n super.onmouseup(e)\n\n // Visualizer 고유: Stock 클릭 시 팝업 표시\n const { popupScene } = this.state\n if (!popupScene) return\n\n const camera = this.cameraManager.activeCamera\n const scene3d = this.sceneManager.scene\n if (!camera || !scene3d) return\n\n const realObject = this.eventManager.handleClick(camera, scene3d, e)\n\n if (realObject && realObject instanceof Stock) {\n // 이전 focused 해제\n if (this._focused_stock && this._focused_stock !== realObject) {\n this._focused_stock._focused = false\n }\n // 클릭한 Stock에 focused 설정 → onBeforeRender에서 회전 애니메이션\n realObject._focused = true\n realObject._focusedAt = performance.now()\n this._focused_stock = realObject\n this.invalidate()\n\n realObject.onmouseup(e, this, (data: any) => {\n ScenePopup.show(this as any, popupScene, {\n data,\n modal: false,\n closable: true,\n output: false,\n location: this.state.popupPosition || 'right-top'\n } as any)\n })\n } else if (!realObject) {\n // 빈 공간 클릭 시 focused 해제\n if (this._focused_stock) {\n this._focused_stock._focused = false\n delete this._focused_stock\n }\n ScenePopup.hide(this.root as any)\n }\n }\n}\n"]}
Binary file
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@operato/scene-visualizer",
3
3
  "description": "visualizer component for operato-scene",
4
4
  "author": "heartyoh",
5
- "version": "10.0.0-beta.4",
5
+ "version": "10.0.0-beta.7",
6
6
  "type": "module",
7
7
  "main": "dist/index.js",
8
8
  "module": "dist/index.js",
@@ -63,5 +63,5 @@
63
63
  "prettier --write"
64
64
  ]
65
65
  },
66
- "gitHead": "934cd74528c987fcce55b753b9f225dca33f405b"
66
+ "gitHead": "703631c6240e8d44f00cf3c6c51981ba9da9adbc"
67
67
  }