@nice2dev/ui-3d 1.3.15 → 1.3.17

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.
Files changed (108) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/dist/cjs/collaborative/collaborativeScene.js +160 -206
  3. package/dist/cjs/core/editorAsk.js +51 -41
  4. package/dist/cjs/core/i18n.js +13 -14
  5. package/dist/cjs/core/threeCompat.js +29 -42
  6. package/dist/cjs/dance/DanceBridge.js +148 -177
  7. package/dist/cjs/dance/DanceScoreEngine.js +209 -221
  8. package/dist/cjs/dance/PoseDetector.js +302 -275
  9. package/dist/cjs/index.js +110 -113
  10. package/dist/cjs/material/MaterialEditor.module.css.js +242 -5
  11. package/dist/cjs/material/NiceMaterialEditor.js +1213 -757
  12. package/dist/cjs/material/materialEditorTypes.js +35 -49
  13. package/dist/cjs/material/materialEditorUtils.js +684 -747
  14. package/dist/cjs/material/materialNodeDefinitions.js +1411 -1459
  15. package/dist/cjs/model/ModelEditor.js +90 -40
  16. package/dist/cjs/model/ModelEditor.module.css.js +257 -5
  17. package/dist/cjs/model/ModelEditorLeftPanel.js +126 -47
  18. package/dist/cjs/model/ModelEditorMenuBar.js +359 -32
  19. package/dist/cjs/model/ModelEditorRightPanel.js +647 -131
  20. package/dist/cjs/model/ModelEditorSubComponents.js +277 -112
  21. package/dist/cjs/model/ModelEditorTimeline.js +232 -34
  22. package/dist/cjs/model/ModelEditorToolbar.js +170 -14
  23. package/dist/cjs/model/ModelEditorViewport.js +231 -39
  24. package/dist/cjs/model/ModelViewer.js +388 -63
  25. package/dist/cjs/model/ModelViewer.module.css.js +77 -5
  26. package/dist/cjs/model/NiceArmatureEditor.js +473 -274
  27. package/dist/cjs/model/NiceMorphTargetEditor.js +333 -227
  28. package/dist/cjs/model/NiceOctree.js +372 -320
  29. package/dist/cjs/model/NicePhysicsSimulation.js +528 -298
  30. package/dist/cjs/model/NiceProceduralGeometry.js +673 -300
  31. package/dist/cjs/model/NiceTerrainEditor.js +595 -385
  32. package/dist/cjs/model/NiceWeightPainter.js +384 -261
  33. package/dist/cjs/model/NiceXRPreview.js +385 -308
  34. package/dist/cjs/model/cadModeUtils.js +103 -106
  35. package/dist/cjs/model/editorShortcuts.js +171 -194
  36. package/dist/cjs/model/modelEditorTypes.js +100 -118
  37. package/dist/cjs/model/modelEditorUtils.js +1061 -1146
  38. package/dist/cjs/model/simsModeUtils.js +1023 -1053
  39. package/dist/cjs/model/useModelEditor.js +1977 -1933
  40. package/dist/cjs/model/useModelViewer.js +633 -665
  41. package/dist/cjs/nice2dev-ui-3d.css +1 -1
  42. package/dist/cjs/particle/NiceParticleEditor.js +1186 -571
  43. package/dist/cjs/particle/ParticleEditor.module.css.js +122 -5
  44. package/dist/cjs/particle/particleEditorTypes.js +62 -70
  45. package/dist/cjs/particle/particleEditorUtils.js +998 -1013
  46. package/dist/cjs/rendering/NiceCascadedShadows.js +381 -259
  47. package/dist/cjs/rendering/NiceRenderExport.js +424 -337
  48. package/dist/cjs/rendering/NiceSSAO.js +454 -337
  49. package/dist/cjs/rendering/NiceSSR.js +387 -261
  50. package/dist/cjs/rendering/NiceWebGPURenderer.js +359 -230
  51. package/dist/cjs/uv/NiceUVEditor.js +787 -550
  52. package/dist/cjs/uv/UVEditor.module.css.js +53 -5
  53. package/dist/cjs/uv/uvEditorTypes.js +59 -76
  54. package/dist/cjs/uv/uvEditorUtils.js +501 -575
  55. package/dist/esm/collaborative/collaborativeScene.js +163 -205
  56. package/dist/esm/core/editorAsk.js +53 -40
  57. package/dist/esm/core/i18n.js +15 -13
  58. package/dist/esm/core/threeCompat.js +18 -26
  59. package/dist/esm/dance/DanceBridge.js +151 -176
  60. package/dist/esm/dance/DanceScoreEngine.js +211 -220
  61. package/dist/esm/dance/PoseDetector.js +304 -274
  62. package/dist/esm/index.js +258 -36
  63. package/dist/esm/material/MaterialEditor.module.css.js +242 -3
  64. package/dist/esm/material/NiceMaterialEditor.js +1215 -756
  65. package/dist/esm/material/materialEditorTypes.js +45 -48
  66. package/dist/esm/material/materialEditorUtils.js +713 -746
  67. package/dist/esm/material/materialNodeDefinitions.js +1415 -1458
  68. package/dist/esm/model/ModelEditor.js +91 -39
  69. package/dist/esm/model/ModelEditor.module.css.js +257 -3
  70. package/dist/esm/model/ModelEditorLeftPanel.js +126 -45
  71. package/dist/esm/model/ModelEditorMenuBar.js +359 -30
  72. package/dist/esm/model/ModelEditorRightPanel.js +634 -114
  73. package/dist/esm/model/ModelEditorSubComponents.js +265 -94
  74. package/dist/esm/model/ModelEditorTimeline.js +232 -32
  75. package/dist/esm/model/ModelEditorToolbar.js +170 -12
  76. package/dist/esm/model/ModelEditorViewport.js +231 -37
  77. package/dist/esm/model/ModelViewer.js +389 -62
  78. package/dist/esm/model/ModelViewer.module.css.js +77 -3
  79. package/dist/esm/model/NiceArmatureEditor.js +462 -258
  80. package/dist/esm/model/NiceMorphTargetEditor.js +322 -211
  81. package/dist/esm/model/NiceOctree.js +361 -304
  82. package/dist/esm/model/NicePhysicsSimulation.js +517 -282
  83. package/dist/esm/model/NiceProceduralGeometry.js +667 -284
  84. package/dist/esm/model/NiceTerrainEditor.js +584 -369
  85. package/dist/esm/model/NiceWeightPainter.js +373 -245
  86. package/dist/esm/model/NiceXRPreview.js +374 -292
  87. package/dist/esm/model/cadModeUtils.js +95 -88
  88. package/dist/esm/model/editorShortcuts.js +172 -193
  89. package/dist/esm/model/modelEditorTypes.js +90 -100
  90. package/dist/esm/model/modelEditorUtils.js +1056 -1128
  91. package/dist/esm/model/simsModeUtils.js +1021 -1035
  92. package/dist/esm/model/useModelEditor.js +1946 -1920
  93. package/dist/esm/model/useModelViewer.js +619 -647
  94. package/dist/esm/nice2dev-ui-3d.css +1 -1
  95. package/dist/esm/particle/NiceParticleEditor.js +1188 -570
  96. package/dist/esm/particle/ParticleEditor.module.css.js +122 -3
  97. package/dist/esm/particle/particleEditorTypes.js +69 -69
  98. package/dist/esm/particle/particleEditorUtils.js +1027 -1012
  99. package/dist/esm/rendering/NiceCascadedShadows.js +370 -243
  100. package/dist/esm/rendering/NiceRenderExport.js +413 -321
  101. package/dist/esm/rendering/NiceSSAO.js +450 -328
  102. package/dist/esm/rendering/NiceSSR.js +383 -252
  103. package/dist/esm/rendering/NiceWebGPURenderer.js +326 -214
  104. package/dist/esm/uv/NiceUVEditor.js +788 -549
  105. package/dist/esm/uv/UVEditor.module.css.js +53 -3
  106. package/dist/esm/uv/uvEditorTypes.js +68 -75
  107. package/dist/esm/uv/uvEditorUtils.js +515 -557
  108. package/package.json +7 -12
@@ -1,42 +1,92 @@
1
- 'use strict';
2
-
3
- var jsxRuntime = require('react/jsx-runtime');
4
- var ui = require('@nice2dev/ui');
5
- var editorAsk = require('../core/editorAsk.js');
6
- var i18n = require('../core/i18n.js');
7
- var ModelEditor_module = require('./ModelEditor.module.css.js');
8
- var ModelEditorLeftPanel = require('./ModelEditorLeftPanel.js');
9
- var ModelEditorMenuBar = require('./ModelEditorMenuBar.js');
10
- var ModelEditorRightPanel = require('./ModelEditorRightPanel.js');
11
- var ModelEditorTimeline = require('./ModelEditorTimeline.js');
12
- var ModelEditorToolbar = require('./ModelEditorToolbar.js');
13
- var modelEditorTypes = require('./modelEditorTypes.js');
14
- var ModelEditorViewport = require('./ModelEditorViewport.js');
15
- var useModelEditor = require('./useModelEditor.js');
16
-
17
- const ACCEPT = /* @__PURE__ */ modelEditorTypes.SUPPORTED_EXTENSIONS.map((e) => `.${e}`).join(',');
18
- const NiceModelEditor = ({ className, onSaveToLibrary, onAIPoseVideo, }) => {
19
- const { t } = i18n.useNiceTranslation();
20
- const api = useModelEditor.useModelEditor({ onSaveToLibrary, onAIPoseVideo });
21
- return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx("input", { ref: api.fileInputRef, type: "file", accept: ACCEPT, style: { display: 'none' }, onChange: (e) => {
22
- var _a;
23
- const f = (_a = e.target.files) === null || _a === void 0 ? void 0 : _a[0];
24
- if (f) {
25
- api.loadFile(f);
26
- }
27
- e.target.value = '';
28
- } }), jsxRuntime.jsx("input", { ref: api.mergeInputRef, type: "file", accept: ".fbx", style: { display: 'none' }, onChange: (e) => {
29
- var _a;
30
- const f = (_a = e.target.files) === null || _a === void 0 ? void 0 : _a[0];
31
- if (f) {
32
- api.mergeAnimationFBX(f);
33
- }
34
- e.target.value = '';
35
- } }), jsxRuntime.jsx("input", { ref: api.videoInputRef, type: "file", accept: "video/*", style: { display: 'none' }, onChange: api.handleAIVideo }), jsxRuntime.jsx(editorAsk.EditorAskDialog, { ask: api.pendingAsk }), jsxRuntime.jsx(ui.NiceAppShell, { className: `${ModelEditor_module.root} ${className !== null && className !== void 0 ? className : ''}`, flush: true, menubar: jsxRuntime.jsx(ModelEditorMenuBar, { api: api, hasOnSaveToLibrary: !!onSaveToLibrary }), sidebar: jsxRuntime.jsxs("div", { style: { display: 'flex', minHeight: 0 }, children: [jsxRuntime.jsx(ModelEditorLeftPanel, { api: api }), jsxRuntime.jsx(ModelEditorToolbar, { api: api })] }), rightSidebar: jsxRuntime.jsx(ModelEditorRightPanel, { api: api }), bottomPanel: jsxRuntime.jsx(ModelEditorTimeline, { api: api }), statusBar: jsxRuntime.jsxs("div", { className: ModelEditor_module.statusBar, children: [jsxRuntime.jsx("span", { children: api.statusText }), jsxRuntime.jsx("span", { style: { marginLeft: 'auto' }, children: t('modelEditor.trianglesMeshesBonesAnimS', '{polyCount} triangles · {meshCount} meshes · {boneCount} bones · {animations} anim(s)')
36
- .replace('{polyCount}', String(api.polyCount.toLocaleString()))
37
- .replace('{meshCount}', String(api.meshCount))
38
- .replace('{boneCount}', String(api.boneCount))
39
- .replace('{animations}', String(api.animations.length)) })] }), children: jsxRuntime.jsx(ModelEditorViewport, { api: api }) })] }));
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const jsxRuntime = require("react/jsx-runtime");
4
+ const ui = require("@nice2dev/ui");
5
+ const editorAsk = require("../core/editorAsk.js");
6
+ const i18n = require("../core/i18n.js");
7
+ const ModelEditor_module = require("./ModelEditor.module.css.js");
8
+ const ModelEditorLeftPanel = require("./ModelEditorLeftPanel.js");
9
+ const ModelEditorMenuBar = require("./ModelEditorMenuBar.js");
10
+ const ModelEditorRightPanel = require("./ModelEditorRightPanel.js");
11
+ const ModelEditorTimeline = require("./ModelEditorTimeline.js");
12
+ const ModelEditorToolbar = require("./ModelEditorToolbar.js");
13
+ const modelEditorTypes = require("./modelEditorTypes.js");
14
+ const ModelEditorViewport = require("./ModelEditorViewport.js");
15
+ const useModelEditor = require("./useModelEditor.js");
16
+ const ACCEPT = /* @__PURE__ */ modelEditorTypes.SUPPORTED_EXTENSIONS.map((e) => `.${e}`).join(",");
17
+ const NiceModelEditor = ({
18
+ className,
19
+ onSaveToLibrary,
20
+ onAIPoseVideo
21
+ }) => {
22
+ const { t } = i18n.useNiceTranslation();
23
+ const api = useModelEditor.useModelEditor({ onSaveToLibrary, onAIPoseVideo });
24
+ return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
25
+ /* @__PURE__ */ jsxRuntime.jsx(
26
+ "input",
27
+ {
28
+ ref: api.fileInputRef,
29
+ type: "file",
30
+ accept: ACCEPT,
31
+ style: { display: "none" },
32
+ onChange: (e) => {
33
+ const f = e.target.files?.[0];
34
+ if (f) {
35
+ api.loadFile(f);
36
+ }
37
+ e.target.value = "";
38
+ }
39
+ }
40
+ ),
41
+ /* @__PURE__ */ jsxRuntime.jsx(
42
+ "input",
43
+ {
44
+ ref: api.mergeInputRef,
45
+ type: "file",
46
+ accept: ".fbx",
47
+ style: { display: "none" },
48
+ onChange: (e) => {
49
+ const f = e.target.files?.[0];
50
+ if (f) {
51
+ api.mergeAnimationFBX(f);
52
+ }
53
+ e.target.value = "";
54
+ }
55
+ }
56
+ ),
57
+ /* @__PURE__ */ jsxRuntime.jsx(
58
+ "input",
59
+ {
60
+ ref: api.videoInputRef,
61
+ type: "file",
62
+ accept: "video/*",
63
+ style: { display: "none" },
64
+ onChange: api.handleAIVideo
65
+ }
66
+ ),
67
+ /* @__PURE__ */ jsxRuntime.jsx(editorAsk.EditorAskDialog, { ask: api.pendingAsk }),
68
+ /* @__PURE__ */ jsxRuntime.jsx(
69
+ ui.NiceAppShell,
70
+ {
71
+ className: `${ModelEditor_module.default.root} ${className ?? ""}`,
72
+ flush: true,
73
+ menubar: /* @__PURE__ */ jsxRuntime.jsx(ModelEditorMenuBar.default, { api, hasOnSaveToLibrary: !!onSaveToLibrary }),
74
+ sidebar: /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { display: "flex", minHeight: 0 }, children: [
75
+ /* @__PURE__ */ jsxRuntime.jsx(ModelEditorLeftPanel.default, { api }),
76
+ /* @__PURE__ */ jsxRuntime.jsx(ModelEditorToolbar.default, { api })
77
+ ] }),
78
+ rightSidebar: /* @__PURE__ */ jsxRuntime.jsx(ModelEditorRightPanel.default, { api }),
79
+ bottomPanel: /* @__PURE__ */ jsxRuntime.jsx(ModelEditorTimeline.default, { api }),
80
+ statusBar: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: ModelEditor_module.default.statusBar, children: [
81
+ /* @__PURE__ */ jsxRuntime.jsx("span", { children: api.statusText }),
82
+ /* @__PURE__ */ jsxRuntime.jsx("span", { style: { marginLeft: "auto" }, children: t(
83
+ "modelEditor.trianglesMeshesBonesAnimS",
84
+ "{polyCount} triangles · {meshCount} meshes · {boneCount} bones · {animations} anim(s)"
85
+ ).replace("{polyCount}", String(api.polyCount.toLocaleString())).replace("{meshCount}", String(api.meshCount)).replace("{boneCount}", String(api.boneCount)).replace("{animations}", String(api.animations.length)) })
86
+ ] }),
87
+ children: /* @__PURE__ */ jsxRuntime.jsx(ModelEditorViewport.default, { api })
88
+ }
89
+ )
90
+ ] });
40
91
  };
41
-
42
92
  exports.NiceModelEditor = NiceModelEditor;
@@ -1,5 +1,257 @@
1
- 'use strict';
2
-
3
- var styles = {"root":"ModelEditor-module_root__Aiqom","menuBar":"ModelEditor-module_menuBar__5P6Wi","menuBtn":"ModelEditor-module_menuBtn__f1u-N","menuSep":"ModelEditor-module_menuSep__Jilgu","menuLabel":"ModelEditor-module_menuLabel__gn6yQ","menuRight":"ModelEditor-module_menuRight__YQWk7","leftPanel":"ModelEditor-module_leftPanel__sVsxG","toolbar":"ModelEditor-module_toolbar__l8uKC","toolBtn":"ModelEditor-module_toolBtn__8DzAf","toolSep":"ModelEditor-module_toolSep__5I72j","viewportContainer":"ModelEditor-module_viewportContainer__O-e-6","viewportOverlay":"ModelEditor-module_viewportOverlay__LXDnT","viewportBadge":"ModelEditor-module_viewportBadge__-5C9w","viewportDropZone":"ModelEditor-module_viewportDropZone__PBrTo","rightPanel":"ModelEditor-module_rightPanel__oJf3N","panelSection":"ModelEditor-module_panelSection__yb-jc","panelTitle":"ModelEditor-module_panelTitle__rp8tH","panelContent":"ModelEditor-module_panelContent__IMNnR","treeItem":"ModelEditor-module_treeItem__MiVWT","treeItemActive":"ModelEditor-module_treeItemActive__4ntXK","treeIcon":"ModelEditor-module_treeIcon__PzniU","treeToggle":"ModelEditor-module_treeToggle__Ge5PW","treeVisibility":"ModelEditor-module_treeVisibility__BjKaL","propRow":"ModelEditor-module_propRow__AONtp","propLabel":"ModelEditor-module_propLabel__bwkAK","propInput":"ModelEditor-module_propInput__aFI4Q","propVec3":"ModelEditor-module_propVec3__2FcMf","propVec3X":"ModelEditor-module_propVec3X__lfQtN","propVec3Y":"ModelEditor-module_propVec3Y__PmF5p","propVec3Z":"ModelEditor-module_propVec3Z__swB76","propSelect":"ModelEditor-module_propSelect__1YXcX","bottomPanel":"ModelEditor-module_bottomPanel__ojUaN","bottomPanelCollapsed":"ModelEditor-module_bottomPanelCollapsed__P2I6E","bottomPanelHeader":"ModelEditor-module_bottomPanelHeader__z9D6b","bottomPanelTitle":"ModelEditor-module_bottomPanelTitle__0P32m","bottomToggle":"ModelEditor-module_bottomToggle__fsUEB","transportBar":"ModelEditor-module_transportBar__bh6Sb","transportBtn":"ModelEditor-module_transportBtn__egXSB","transportTime":"ModelEditor-module_transportTime__7RzUh","animListArea":"ModelEditor-module_animListArea__rzc1e","animList":"ModelEditor-module_animList__lGNt5","animItem":"ModelEditor-module_animItem__lZGOY","animItemActive":"ModelEditor-module_animItemActive__8pKLd","animDuration":"ModelEditor-module_animDuration__CAwuG","timelineArea":"ModelEditor-module_timelineArea__WFBHa","timelineRuler":"ModelEditor-module_timelineRuler__jlW8F","rulerTick":"ModelEditor-module_rulerTick__VhJRA","rulerLabel":"ModelEditor-module_rulerLabel__Pwl9a","playhead":"ModelEditor-module_playhead__Rd4rh","playheadHandle":"ModelEditor-module_playheadHandle__rIBHA","timelineTracks":"ModelEditor-module_timelineTracks__joMHo","statusBar":"ModelEditor-module_statusBar__AJMzx","materialCard":"ModelEditor-module_materialCard__1IGe7","materialCardActive":"ModelEditor-module_materialCardActive__VEnBX","materialHeader":"ModelEditor-module_materialHeader__WtTh3","materialName":"ModelEditor-module_materialName__TvRhs","textureSlot":"ModelEditor-module_textureSlot__PLqef","textureThumb":"ModelEditor-module_textureThumb__PdCTD","textureInfo":"ModelEditor-module_textureInfo__XOzZI","textureName":"ModelEditor-module_textureName__H-2d3","btnSecondary":"ModelEditor-module_btnSecondary__nJpgi","aiPanel":"ModelEditor-module_aiPanel__-U1jO","aiHeader":"ModelEditor-module_aiHeader__WMZF5","aiBtnRow":"ModelEditor-module_aiBtnRow__F-S-Z","aiBtn":"ModelEditor-module_aiBtn__8dcrE","aiStatus":"ModelEditor-module_aiStatus__Y5g59","dragOver":"ModelEditor-module_dragOver__2VGIz","contextMenu":"ModelEditor-module_contextMenu__sEb9s","contextItem":"ModelEditor-module_contextItem__W90fc","contextSep":"ModelEditor-module_contextSep__QCWTX","contextKey":"ModelEditor-module_contextKey__HxGV6","modeSelect":"ModelEditor-module_modeSelect__KroPg","menuDropdownWrap":"ModelEditor-module_menuDropdownWrap__6dicW","dropdownMenu":"ModelEditor-module_dropdownMenu__ixJxD","dropdownTitle":"ModelEditor-module_dropdownTitle__zzdA6","dropdownItem":"ModelEditor-module_dropdownItem__4dllG","dropdownSep":"ModelEditor-module_dropdownSep__oFx30","viewportShadingBar":"ModelEditor-module_viewportShadingBar__NOK0h","shadingBtn":"ModelEditor-module_shadingBtn__SAIR9","shadingBtnActive":"ModelEditor-module_shadingBtnActive__ST5YT","viewportGizmoInfo":"ModelEditor-module_viewportGizmoInfo__k0ily","propTabs":"ModelEditor-module_propTabs__Vw0-u","propTabBtn":"ModelEditor-module_propTabBtn__s8xDE","outlinerSearch":"ModelEditor-module_outlinerSearch__p5L46"};
4
-
5
- module.exports = styles;
1
+ "use strict";
2
+ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
3
+ const root = "_root_lw12r_5";
4
+ const menuBar = "_menuBar_lw12r_35";
5
+ const menuBtn = "_menuBtn_lw12r_55";
6
+ const menuSep = "_menuSep_lw12r_91";
7
+ const menuLabel = "_menuLabel_lw12r_103";
8
+ const menuRight = "_menuRight_lw12r_115";
9
+ const leftPanel = "_leftPanel_lw12r_141";
10
+ const toolbar = "_toolbar_lw12r_163";
11
+ const toolBtn = "_toolBtn_lw12r_183";
12
+ const toolSep = "_toolSep_lw12r_229";
13
+ const viewportContainer = "_viewportContainer_lw12r_243";
14
+ const viewportOverlay = "_viewportOverlay_lw12r_277";
15
+ const viewportBadge = "_viewportBadge_lw12r_293";
16
+ const viewportDropZone = "_viewportDropZone_lw12r_309";
17
+ const rightPanel = "_rightPanel_lw12r_349";
18
+ const panelSection = "_panelSection_lw12r_371";
19
+ const panelTitle = "_panelTitle_lw12r_379";
20
+ const panelContent = "_panelContent_lw12r_425";
21
+ const treeItem = "_treeItem_lw12r_441";
22
+ const treeItemActive = "_treeItemActive_lw12r_471";
23
+ const treeIcon = "_treeIcon_lw12r_479";
24
+ const treeToggle = "_treeToggle_lw12r_503";
25
+ const treeVisibility = "_treeVisibility_lw12r_519";
26
+ const propRow = "_propRow_lw12r_543";
27
+ const propLabel = "_propLabel_lw12r_555";
28
+ const propInput = "_propInput_lw12r_567";
29
+ const propVec3 = "_propVec3_lw12r_595";
30
+ const propVec3X = "_propVec3X_lw12r_635";
31
+ const propVec3Y = "_propVec3Y_lw12r_641";
32
+ const propVec3Z = "_propVec3Z_lw12r_647";
33
+ const propSelect = "_propSelect_lw12r_699";
34
+ const bottomPanel = "_bottomPanel_lw12r_727";
35
+ const bottomPanelCollapsed = "_bottomPanelCollapsed_lw12r_745";
36
+ const bottomPanelHeader = "_bottomPanelHeader_lw12r_751";
37
+ const bottomPanelTitle = "_bottomPanelTitle_lw12r_769";
38
+ const bottomToggle = "_bottomToggle_lw12r_783";
39
+ const transportBar = "_transportBar_lw12r_799";
40
+ const transportBtn = "_transportBtn_lw12r_809";
41
+ const transportTime = "_transportTime_lw12r_841";
42
+ const animListArea = "_animListArea_lw12r_857";
43
+ const animList = "_animList_lw12r_857";
44
+ const animItem = "_animItem_lw12r_881";
45
+ const animItemActive = "_animItemActive_lw12r_905";
46
+ const animDuration = "_animDuration_lw12r_913";
47
+ const timelineArea = "_timelineArea_lw12r_927";
48
+ const timelineRuler = "_timelineRuler_lw12r_939";
49
+ const rulerTick = "_rulerTick_lw12r_951";
50
+ const rulerLabel = "_rulerLabel_lw12r_965";
51
+ const playhead = "_playhead_lw12r_979";
52
+ const playheadHandle = "_playheadHandle_lw12r_995";
53
+ const timelineTracks = "_timelineTracks_lw12r_1013";
54
+ const statusBar = "_statusBar_lw12r_1057";
55
+ const materialCard = "_materialCard_lw12r_1089";
56
+ const materialCardActive = "_materialCardActive_lw12r_1103";
57
+ const materialHeader = "_materialHeader_lw12r_1109";
58
+ const materialName = "_materialName_lw12r_1145";
59
+ const textureSlot = "_textureSlot_lw12r_1165";
60
+ const textureThumb = "_textureThumb_lw12r_1177";
61
+ const textureInfo = "_textureInfo_lw12r_1205";
62
+ const textureName = "_textureName_lw12r_1213";
63
+ const btnSecondary = "_btnSecondary_lw12r_1295";
64
+ const aiPanel = "_aiPanel_lw12r_1357";
65
+ const aiHeader = "_aiHeader_lw12r_1371";
66
+ const aiBtnRow = "_aiBtnRow_lw12r_1419";
67
+ const aiBtn = "_aiBtn_lw12r_1419";
68
+ const aiStatus = "_aiStatus_lw12r_1457";
69
+ const dragOver = "_dragOver_lw12r_1475";
70
+ const contextMenu = "_contextMenu_lw12r_1491";
71
+ const contextItem = "_contextItem_lw12r_1511";
72
+ const contextSep = "_contextSep_lw12r_1535";
73
+ const contextKey = "_contextKey_lw12r_1545";
74
+ const modeSelect = "_modeSelect_lw12r_1645";
75
+ const menuDropdownWrap = "_menuDropdownWrap_lw12r_1687";
76
+ const dropdownMenu = "_dropdownMenu_lw12r_1693";
77
+ const dropdownTitle = "_dropdownTitle_lw12r_1721";
78
+ const dropdownItem = "_dropdownItem_lw12r_1737";
79
+ const dropdownSep = "_dropdownSep_lw12r_1765";
80
+ const viewportShadingBar = "_viewportShadingBar_lw12r_1803";
81
+ const shadingBtn = "_shadingBtn_lw12r_1827";
82
+ const shadingBtnActive = "_shadingBtnActive_lw12r_1857";
83
+ const viewportGizmoInfo = "_viewportGizmoInfo_lw12r_1875";
84
+ const propTabs = "_propTabs_lw12r_1895";
85
+ const propTabBtn = "_propTabBtn_lw12r_1907";
86
+ const outlinerSearch = "_outlinerSearch_lw12r_1955";
87
+ const styles = {
88
+ root,
89
+ menuBar,
90
+ menuBtn,
91
+ menuSep,
92
+ menuLabel,
93
+ menuRight,
94
+ leftPanel,
95
+ toolbar,
96
+ toolBtn,
97
+ toolSep,
98
+ viewportContainer,
99
+ viewportOverlay,
100
+ viewportBadge,
101
+ viewportDropZone,
102
+ rightPanel,
103
+ panelSection,
104
+ panelTitle,
105
+ panelContent,
106
+ treeItem,
107
+ treeItemActive,
108
+ treeIcon,
109
+ treeToggle,
110
+ treeVisibility,
111
+ propRow,
112
+ propLabel,
113
+ propInput,
114
+ propVec3,
115
+ propVec3X,
116
+ propVec3Y,
117
+ propVec3Z,
118
+ propSelect,
119
+ bottomPanel,
120
+ bottomPanelCollapsed,
121
+ bottomPanelHeader,
122
+ bottomPanelTitle,
123
+ bottomToggle,
124
+ transportBar,
125
+ transportBtn,
126
+ transportTime,
127
+ animListArea,
128
+ animList,
129
+ animItem,
130
+ animItemActive,
131
+ animDuration,
132
+ timelineArea,
133
+ timelineRuler,
134
+ rulerTick,
135
+ rulerLabel,
136
+ playhead,
137
+ playheadHandle,
138
+ timelineTracks,
139
+ statusBar,
140
+ materialCard,
141
+ materialCardActive,
142
+ materialHeader,
143
+ materialName,
144
+ textureSlot,
145
+ textureThumb,
146
+ textureInfo,
147
+ textureName,
148
+ btnSecondary,
149
+ aiPanel,
150
+ aiHeader,
151
+ aiBtnRow,
152
+ aiBtn,
153
+ aiStatus,
154
+ dragOver,
155
+ contextMenu,
156
+ contextItem,
157
+ contextSep,
158
+ contextKey,
159
+ modeSelect,
160
+ menuDropdownWrap,
161
+ dropdownMenu,
162
+ dropdownTitle,
163
+ dropdownItem,
164
+ dropdownSep,
165
+ viewportShadingBar,
166
+ shadingBtn,
167
+ shadingBtnActive,
168
+ viewportGizmoInfo,
169
+ propTabs,
170
+ propTabBtn,
171
+ outlinerSearch
172
+ };
173
+ exports.aiBtn = aiBtn;
174
+ exports.aiBtnRow = aiBtnRow;
175
+ exports.aiHeader = aiHeader;
176
+ exports.aiPanel = aiPanel;
177
+ exports.aiStatus = aiStatus;
178
+ exports.animDuration = animDuration;
179
+ exports.animItem = animItem;
180
+ exports.animItemActive = animItemActive;
181
+ exports.animList = animList;
182
+ exports.animListArea = animListArea;
183
+ exports.bottomPanel = bottomPanel;
184
+ exports.bottomPanelCollapsed = bottomPanelCollapsed;
185
+ exports.bottomPanelHeader = bottomPanelHeader;
186
+ exports.bottomPanelTitle = bottomPanelTitle;
187
+ exports.bottomToggle = bottomToggle;
188
+ exports.btnSecondary = btnSecondary;
189
+ exports.contextItem = contextItem;
190
+ exports.contextKey = contextKey;
191
+ exports.contextMenu = contextMenu;
192
+ exports.contextSep = contextSep;
193
+ exports.default = styles;
194
+ exports.dragOver = dragOver;
195
+ exports.dropdownItem = dropdownItem;
196
+ exports.dropdownMenu = dropdownMenu;
197
+ exports.dropdownSep = dropdownSep;
198
+ exports.dropdownTitle = dropdownTitle;
199
+ exports.leftPanel = leftPanel;
200
+ exports.materialCard = materialCard;
201
+ exports.materialCardActive = materialCardActive;
202
+ exports.materialHeader = materialHeader;
203
+ exports.materialName = materialName;
204
+ exports.menuBar = menuBar;
205
+ exports.menuBtn = menuBtn;
206
+ exports.menuDropdownWrap = menuDropdownWrap;
207
+ exports.menuLabel = menuLabel;
208
+ exports.menuRight = menuRight;
209
+ exports.menuSep = menuSep;
210
+ exports.modeSelect = modeSelect;
211
+ exports.outlinerSearch = outlinerSearch;
212
+ exports.panelContent = panelContent;
213
+ exports.panelSection = panelSection;
214
+ exports.panelTitle = panelTitle;
215
+ exports.playhead = playhead;
216
+ exports.playheadHandle = playheadHandle;
217
+ exports.propInput = propInput;
218
+ exports.propLabel = propLabel;
219
+ exports.propRow = propRow;
220
+ exports.propSelect = propSelect;
221
+ exports.propTabBtn = propTabBtn;
222
+ exports.propTabs = propTabs;
223
+ exports.propVec3 = propVec3;
224
+ exports.propVec3X = propVec3X;
225
+ exports.propVec3Y = propVec3Y;
226
+ exports.propVec3Z = propVec3Z;
227
+ exports.rightPanel = rightPanel;
228
+ exports.root = root;
229
+ exports.rulerLabel = rulerLabel;
230
+ exports.rulerTick = rulerTick;
231
+ exports.shadingBtn = shadingBtn;
232
+ exports.shadingBtnActive = shadingBtnActive;
233
+ exports.statusBar = statusBar;
234
+ exports.textureInfo = textureInfo;
235
+ exports.textureName = textureName;
236
+ exports.textureSlot = textureSlot;
237
+ exports.textureThumb = textureThumb;
238
+ exports.timelineArea = timelineArea;
239
+ exports.timelineRuler = timelineRuler;
240
+ exports.timelineTracks = timelineTracks;
241
+ exports.toolBtn = toolBtn;
242
+ exports.toolSep = toolSep;
243
+ exports.toolbar = toolbar;
244
+ exports.transportBar = transportBar;
245
+ exports.transportBtn = transportBtn;
246
+ exports.transportTime = transportTime;
247
+ exports.treeIcon = treeIcon;
248
+ exports.treeItem = treeItem;
249
+ exports.treeItemActive = treeItemActive;
250
+ exports.treeToggle = treeToggle;
251
+ exports.treeVisibility = treeVisibility;
252
+ exports.viewportBadge = viewportBadge;
253
+ exports.viewportContainer = viewportContainer;
254
+ exports.viewportDropZone = viewportDropZone;
255
+ exports.viewportGizmoInfo = viewportGizmoInfo;
256
+ exports.viewportOverlay = viewportOverlay;
257
+ exports.viewportShadingBar = viewportShadingBar;
@@ -1,52 +1,131 @@
1
- 'use strict';
2
-
3
- var jsxRuntime = require('react/jsx-runtime');
4
- var ui = require('@nice2dev/ui');
5
- var React = require('react');
6
- var i18n = require('../core/i18n.js');
7
- var ModelEditor_module = require('./ModelEditor.module.css.js');
8
-
1
+ "use strict";
2
+ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
3
+ const jsxRuntime = require("react/jsx-runtime");
4
+ const ui = require("@nice2dev/ui");
5
+ const React = require("react");
6
+ const i18n = require("../core/i18n.js");
7
+ const ModelEditor_module = require("./ModelEditor.module.css.js");
9
8
  const ModelEditorLeftPanel = /* @__PURE__ */ Object.assign(
10
- /* @__PURE__ */ React.memo(({ api }) => {
9
+ /* @__PURE__ */ React.memo(({ api }) => {
11
10
  const { t } = i18n.useNiceTranslation();
12
- const { sceneTree, selectedId, outlinerSearch, setOutlinerSearch, selectObject, rebuildTree, toggleNodeExpanded, toggleNodeVisibility, } = api;
11
+ const {
12
+ sceneTree,
13
+ selectedId,
14
+ outlinerSearch,
15
+ setOutlinerSearch,
16
+ selectObject,
17
+ rebuildTree,
18
+ toggleNodeExpanded,
19
+ toggleNodeVisibility
20
+ } = api;
13
21
  const renderTreeNode = (node, depth) => {
14
- // Outliner search filter
15
- if (outlinerSearch) {
16
- const q = outlinerSearch.toLowerCase();
17
- const match = node.name.toLowerCase().includes(q);
18
- const childMatch = node.children.some(function cm(c) {
19
- return c.name.toLowerCase().includes(q) || c.children.some(cm);
20
- });
21
- if (!match && !childMatch) {
22
- return null;
23
- }
22
+ if (outlinerSearch) {
23
+ const q = outlinerSearch.toLowerCase();
24
+ const match = node.name.toLowerCase().includes(q);
25
+ const childMatch = node.children.some(function cm(c) {
26
+ return c.name.toLowerCase().includes(q) || c.children.some(cm);
27
+ });
28
+ if (!match && !childMatch) {
29
+ return null;
24
30
  }
25
- const hasChildren = node.children.length > 0;
26
- const icon = node.type === 'mesh'
27
- ? 'box'
28
- : node.type === 'bone'
29
- ? 'target'
30
- : node.type === 'light'
31
- ? 'lightbulb'
32
- : node.type === 'camera'
33
- ? 'camera'
34
- : node.type === 'helper'
35
- ? 'hexagon'
36
- : 'folder';
37
- return (jsxRuntime.jsxs(React.Fragment, { children: [jsxRuntime.jsxs("div", { role: "button", tabIndex: 0, onKeyDown: ui.clickOnActivationKey, className: `${ModelEditor_module.treeItem} ${selectedId === node.id ? ModelEditor_module.treeItemActive : ''}`, style: { paddingLeft: depth * 16 + 4 }, onClick: () => selectObject(node), children: [hasChildren ? (jsxRuntime.jsx("span", { role: "button", tabIndex: 0, "aria-label": t(node.expanded ? 'controls.collapse' : 'controls.expand', node.expanded ? 'Collapse' : 'Expand'), onKeyDown: ui.clickOnActivationKey, className: ModelEditor_module.treeToggle, onClick: (e) => {
38
- e.stopPropagation();
39
- toggleNodeExpanded(node);
40
- }, children: jsxRuntime.jsx(ui.NiceIcon, { name: node.expanded ? 'chevron-down' : 'chevron-right', size: 14 }) })) : (jsxRuntime.jsx("span", { className: ModelEditor_module.treeToggle })), jsxRuntime.jsx("span", { className: ModelEditor_module.treeIcon, children: jsxRuntime.jsx(ui.NiceIcon, { name: icon, size: 14 }) }), jsxRuntime.jsx("span", { style: { flex: 1, overflow: 'hidden', textOverflow: 'ellipsis' }, children: node.name }), jsxRuntime.jsx("span", { role: "button", tabIndex: 0, "aria-label": t(node.visible ? 'hide' : 'show', node.visible ? 'Hide' : 'Show'), onKeyDown: ui.clickOnActivationKey, className: ModelEditor_module.treeVisibility, onClick: (e) => {
41
- e.stopPropagation();
42
- toggleNodeVisibility(node);
43
- }, children: jsxRuntime.jsx(ui.NiceIcon, { name: node.visible ? 'eye' : 'eye-off', size: 14 }) })] }), node.expanded && node.children.map((c) => renderTreeNode(c, depth + 1))] }, node.id));
31
+ }
32
+ const hasChildren = node.children.length > 0;
33
+ const icon = node.type === "mesh" ? "box" : node.type === "bone" ? "target" : node.type === "light" ? "lightbulb" : node.type === "camera" ? "camera" : node.type === "helper" ? "hexagon" : "folder";
34
+ return /* @__PURE__ */ jsxRuntime.jsxs(React.Fragment, { children: [
35
+ /* @__PURE__ */ jsxRuntime.jsxs(
36
+ "div",
37
+ {
38
+ role: "button",
39
+ tabIndex: 0,
40
+ onKeyDown: ui.clickOnActivationKey,
41
+ className: `${ModelEditor_module.default.treeItem} ${selectedId === node.id ? ModelEditor_module.default.treeItemActive : ""}`,
42
+ style: { paddingLeft: depth * 16 + 4 },
43
+ onClick: () => selectObject(node),
44
+ children: [
45
+ hasChildren ? /* @__PURE__ */ jsxRuntime.jsx(
46
+ "span",
47
+ {
48
+ role: "button",
49
+ tabIndex: 0,
50
+ "aria-label": t(
51
+ node.expanded ? "controls.collapse" : "controls.expand",
52
+ node.expanded ? "Collapse" : "Expand"
53
+ ),
54
+ onKeyDown: ui.clickOnActivationKey,
55
+ className: ModelEditor_module.default.treeToggle,
56
+ onClick: (e) => {
57
+ e.stopPropagation();
58
+ toggleNodeExpanded(node);
59
+ },
60
+ children: /* @__PURE__ */ jsxRuntime.jsx(ui.NiceIcon, { name: node.expanded ? "chevron-down" : "chevron-right", size: 14 })
61
+ }
62
+ ) : /* @__PURE__ */ jsxRuntime.jsx("span", { className: ModelEditor_module.default.treeToggle }),
63
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: ModelEditor_module.default.treeIcon, children: /* @__PURE__ */ jsxRuntime.jsx(ui.NiceIcon, { name: icon, size: 14 }) }),
64
+ /* @__PURE__ */ jsxRuntime.jsx("span", { style: { flex: 1, overflow: "hidden", textOverflow: "ellipsis" }, children: node.name }),
65
+ /* @__PURE__ */ jsxRuntime.jsx(
66
+ "span",
67
+ {
68
+ role: "button",
69
+ tabIndex: 0,
70
+ "aria-label": t(node.visible ? "hide" : "show", node.visible ? "Hide" : "Show"),
71
+ onKeyDown: ui.clickOnActivationKey,
72
+ className: ModelEditor_module.default.treeVisibility,
73
+ onClick: (e) => {
74
+ e.stopPropagation();
75
+ toggleNodeVisibility(node);
76
+ },
77
+ children: /* @__PURE__ */ jsxRuntime.jsx(ui.NiceIcon, { name: node.visible ? "eye" : "eye-off", size: 14 })
78
+ }
79
+ )
80
+ ]
81
+ }
82
+ ),
83
+ node.expanded && node.children.map((c) => renderTreeNode(c, depth + 1))
84
+ ] }, node.id);
44
85
  };
45
- return (jsxRuntime.jsx("div", { className: ModelEditor_module.leftPanel, children: jsxRuntime.jsxs("div", { className: ModelEditor_module.panelSection, children: [jsxRuntime.jsxs("div", { className: ModelEditor_module.panelTitle, children: [jsxRuntime.jsx(ui.NiceIcon, { name: "clipboard", size: 14 }), " ", t('modelEditorLeftPanel.outliner', 'Outliner'), jsxRuntime.jsx(ui.NiceButton, { variant: "ghost", size: "sm", onClick: rebuildTree, title: t('modelEditorLeftPanel.refresh', 'Refresh'), "aria-label": t('modelEditorLeftPanel.refreshOutliner', 'Refresh outliner'), children: jsxRuntime.jsx(ui.NiceIcon, { name: "refresh", size: 14 }) })] }), jsxRuntime.jsx("div", { className: ModelEditor_module.outlinerSearch, children: jsxRuntime.jsx(ui.NiceTextInput, { className: ModelEditor_module.propInput, placeholder: t('modelEditorLeftPanel.filter', 'Filter...'), value: outlinerSearch, onChange: (val) => setOutlinerSearch(val), style: { width: '100%', marginBottom: 4 } }) }), jsxRuntime.jsxs("div", { className: ModelEditor_module.panelContent, style: { overflowY: 'auto', flex: 1 }, children: [sceneTree.length === 0 && (jsxRuntime.jsx("div", { style: {
46
- color: 'var(--nice-text-secondary, #666)',
47
- fontSize: 10,
48
- padding: '8px 0',
49
- }, children: t('modelEditorLeftPanel.dropA3dFileTo', 'Drop a 3D file to begin') })), sceneTree.map((n) => renderTreeNode(n, 0))] })] }) }));
50
- }), { displayName: 'ModelEditorLeftPanel' });
51
-
52
- module.exports = ModelEditorLeftPanel;
86
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className: ModelEditor_module.default.leftPanel, children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: ModelEditor_module.default.panelSection, children: [
87
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: ModelEditor_module.default.panelTitle, children: [
88
+ /* @__PURE__ */ jsxRuntime.jsx(ui.NiceIcon, { name: "clipboard", size: 14 }),
89
+ " ",
90
+ t("modelEditorLeftPanel.outliner", "Outliner"),
91
+ /* @__PURE__ */ jsxRuntime.jsx(
92
+ ui.NiceButton,
93
+ {
94
+ variant: "ghost",
95
+ size: "sm",
96
+ onClick: rebuildTree,
97
+ title: t("modelEditorLeftPanel.refresh", "Refresh"),
98
+ "aria-label": t("modelEditorLeftPanel.refreshOutliner", "Refresh outliner"),
99
+ children: /* @__PURE__ */ jsxRuntime.jsx(ui.NiceIcon, { name: "refresh", size: 14 })
100
+ }
101
+ )
102
+ ] }),
103
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: ModelEditor_module.default.outlinerSearch, children: /* @__PURE__ */ jsxRuntime.jsx(
104
+ ui.NiceTextInput,
105
+ {
106
+ className: ModelEditor_module.default.propInput,
107
+ placeholder: t("modelEditorLeftPanel.filter", "Filter..."),
108
+ value: outlinerSearch,
109
+ onChange: (val) => setOutlinerSearch(val),
110
+ style: { width: "100%", marginBottom: 4 }
111
+ }
112
+ ) }),
113
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: ModelEditor_module.default.panelContent, style: { overflowY: "auto", flex: 1 }, children: [
114
+ sceneTree.length === 0 && /* @__PURE__ */ jsxRuntime.jsx(
115
+ "div",
116
+ {
117
+ style: {
118
+ color: "var(--nice-text-secondary, #666)",
119
+ fontSize: 10,
120
+ padding: "8px 0"
121
+ },
122
+ children: t("modelEditorLeftPanel.dropA3dFileTo", "Drop a 3D file to begin")
123
+ }
124
+ ),
125
+ sceneTree.map((n) => renderTreeNode(n, 0))
126
+ ] })
127
+ ] }) });
128
+ }),
129
+ { displayName: "ModelEditorLeftPanel" }
130
+ );
131
+ exports.default = ModelEditorLeftPanel;