@nice2dev/ui-3d 1.3.15 → 1.3.16

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 +9 -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,40 +1,92 @@
1
- import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
2
- import { NiceAppShell } from '@nice2dev/ui';
3
- import { EditorAskDialog } from '../core/editorAsk.js';
4
- import { useNiceTranslation } from '../core/i18n.js';
5
- import styles from './ModelEditor.module.css.js';
6
- import ModelEditorLeftPanel from './ModelEditorLeftPanel.js';
7
- import ModelEditorMenuBar from './ModelEditorMenuBar.js';
8
- import ModelEditorRightPanel from './ModelEditorRightPanel.js';
9
- import ModelEditorTimeline from './ModelEditorTimeline.js';
10
- import ModelEditorToolbar from './ModelEditorToolbar.js';
11
- import { SUPPORTED_EXTENSIONS } from './modelEditorTypes.js';
12
- import ModelEditorViewport from './ModelEditorViewport.js';
13
- import { useModelEditor } from './useModelEditor.js';
14
-
15
- const ACCEPT = /* @__PURE__ */ SUPPORTED_EXTENSIONS.map((e) => `.${e}`).join(',');
16
- const NiceModelEditor = ({ className, onSaveToLibrary, onAIPoseVideo, }) => {
17
- const { t } = useNiceTranslation();
18
- const api = useModelEditor({ onSaveToLibrary, onAIPoseVideo });
19
- return (jsxs(Fragment, { children: [jsx("input", { ref: api.fileInputRef, type: "file", accept: ACCEPT, style: { display: 'none' }, onChange: (e) => {
20
- var _a;
21
- const f = (_a = e.target.files) === null || _a === void 0 ? void 0 : _a[0];
22
- if (f) {
23
- api.loadFile(f);
24
- }
25
- e.target.value = '';
26
- } }), jsx("input", { ref: api.mergeInputRef, type: "file", accept: ".fbx", style: { display: 'none' }, onChange: (e) => {
27
- var _a;
28
- const f = (_a = e.target.files) === null || _a === void 0 ? void 0 : _a[0];
29
- if (f) {
30
- api.mergeAnimationFBX(f);
31
- }
32
- e.target.value = '';
33
- } }), jsx("input", { ref: api.videoInputRef, type: "file", accept: "video/*", style: { display: 'none' }, onChange: api.handleAIVideo }), jsx(EditorAskDialog, { ask: api.pendingAsk }), jsx(NiceAppShell, { className: `${styles.root} ${className !== null && className !== void 0 ? className : ''}`, flush: true, menubar: jsx(ModelEditorMenuBar, { api: api, hasOnSaveToLibrary: !!onSaveToLibrary }), sidebar: jsxs("div", { style: { display: 'flex', minHeight: 0 }, children: [jsx(ModelEditorLeftPanel, { api: api }), jsx(ModelEditorToolbar, { api: api })] }), rightSidebar: jsx(ModelEditorRightPanel, { api: api }), bottomPanel: jsx(ModelEditorTimeline, { api: api }), statusBar: jsxs("div", { className: styles.statusBar, children: [jsx("span", { children: api.statusText }), jsx("span", { style: { marginLeft: 'auto' }, children: t('modelEditor.trianglesMeshesBonesAnimS', '{polyCount} triangles · {meshCount} meshes · {boneCount} bones · {animations} anim(s)')
34
- .replace('{polyCount}', String(api.polyCount.toLocaleString()))
35
- .replace('{meshCount}', String(api.meshCount))
36
- .replace('{boneCount}', String(api.boneCount))
37
- .replace('{animations}', String(api.animations.length)) })] }), children: jsx(ModelEditorViewport, { api: api }) })] }));
1
+ import { jsxs, Fragment, jsx } from "react/jsx-runtime";
2
+ import { NiceAppShell } from "@nice2dev/ui";
3
+ import { EditorAskDialog } from "../core/editorAsk.js";
4
+ import { useNiceTranslation } from "../core/i18n.js";
5
+ import styles from "./ModelEditor.module.css.js";
6
+ import ModelEditorLeftPanel from "./ModelEditorLeftPanel.js";
7
+ import ModelEditorMenuBar from "./ModelEditorMenuBar.js";
8
+ import ModelEditorRightPanel from "./ModelEditorRightPanel.js";
9
+ import ModelEditorTimeline from "./ModelEditorTimeline.js";
10
+ import ModelEditorToolbar from "./ModelEditorToolbar.js";
11
+ import { SUPPORTED_EXTENSIONS } from "./modelEditorTypes.js";
12
+ import ModelEditorViewport from "./ModelEditorViewport.js";
13
+ import { useModelEditor } from "./useModelEditor.js";
14
+ const ACCEPT = /* @__PURE__ */ SUPPORTED_EXTENSIONS.map((e) => `.${e}`).join(",");
15
+ const NiceModelEditor = ({
16
+ className,
17
+ onSaveToLibrary,
18
+ onAIPoseVideo
19
+ }) => {
20
+ const { t } = useNiceTranslation();
21
+ const api = useModelEditor({ onSaveToLibrary, onAIPoseVideo });
22
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
23
+ /* @__PURE__ */ jsx(
24
+ "input",
25
+ {
26
+ ref: api.fileInputRef,
27
+ type: "file",
28
+ accept: ACCEPT,
29
+ style: { display: "none" },
30
+ onChange: (e) => {
31
+ const f = e.target.files?.[0];
32
+ if (f) {
33
+ api.loadFile(f);
34
+ }
35
+ e.target.value = "";
36
+ }
37
+ }
38
+ ),
39
+ /* @__PURE__ */ jsx(
40
+ "input",
41
+ {
42
+ ref: api.mergeInputRef,
43
+ type: "file",
44
+ accept: ".fbx",
45
+ style: { display: "none" },
46
+ onChange: (e) => {
47
+ const f = e.target.files?.[0];
48
+ if (f) {
49
+ api.mergeAnimationFBX(f);
50
+ }
51
+ e.target.value = "";
52
+ }
53
+ }
54
+ ),
55
+ /* @__PURE__ */ jsx(
56
+ "input",
57
+ {
58
+ ref: api.videoInputRef,
59
+ type: "file",
60
+ accept: "video/*",
61
+ style: { display: "none" },
62
+ onChange: api.handleAIVideo
63
+ }
64
+ ),
65
+ /* @__PURE__ */ jsx(EditorAskDialog, { ask: api.pendingAsk }),
66
+ /* @__PURE__ */ jsx(
67
+ NiceAppShell,
68
+ {
69
+ className: `${styles.root} ${className ?? ""}`,
70
+ flush: true,
71
+ menubar: /* @__PURE__ */ jsx(ModelEditorMenuBar, { api, hasOnSaveToLibrary: !!onSaveToLibrary }),
72
+ sidebar: /* @__PURE__ */ jsxs("div", { style: { display: "flex", minHeight: 0 }, children: [
73
+ /* @__PURE__ */ jsx(ModelEditorLeftPanel, { api }),
74
+ /* @__PURE__ */ jsx(ModelEditorToolbar, { api })
75
+ ] }),
76
+ rightSidebar: /* @__PURE__ */ jsx(ModelEditorRightPanel, { api }),
77
+ bottomPanel: /* @__PURE__ */ jsx(ModelEditorTimeline, { api }),
78
+ statusBar: /* @__PURE__ */ jsxs("div", { className: styles.statusBar, children: [
79
+ /* @__PURE__ */ jsx("span", { children: api.statusText }),
80
+ /* @__PURE__ */ jsx("span", { style: { marginLeft: "auto" }, children: t(
81
+ "modelEditor.trianglesMeshesBonesAnimS",
82
+ "{polyCount} triangles · {meshCount} meshes · {boneCount} bones · {animations} anim(s)"
83
+ ).replace("{polyCount}", String(api.polyCount.toLocaleString())).replace("{meshCount}", String(api.meshCount)).replace("{boneCount}", String(api.boneCount)).replace("{animations}", String(api.animations.length)) })
84
+ ] }),
85
+ children: /* @__PURE__ */ jsx(ModelEditorViewport, { api })
86
+ }
87
+ )
88
+ ] });
89
+ };
90
+ export {
91
+ NiceModelEditor
38
92
  };
39
-
40
- export { NiceModelEditor };
@@ -1,3 +1,257 @@
1
- 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"};
2
-
3
- export { styles as default };
1
+ const root = "_root_lw12r_5";
2
+ const menuBar = "_menuBar_lw12r_35";
3
+ const menuBtn = "_menuBtn_lw12r_55";
4
+ const menuSep = "_menuSep_lw12r_91";
5
+ const menuLabel = "_menuLabel_lw12r_103";
6
+ const menuRight = "_menuRight_lw12r_115";
7
+ const leftPanel = "_leftPanel_lw12r_141";
8
+ const toolbar = "_toolbar_lw12r_163";
9
+ const toolBtn = "_toolBtn_lw12r_183";
10
+ const toolSep = "_toolSep_lw12r_229";
11
+ const viewportContainer = "_viewportContainer_lw12r_243";
12
+ const viewportOverlay = "_viewportOverlay_lw12r_277";
13
+ const viewportBadge = "_viewportBadge_lw12r_293";
14
+ const viewportDropZone = "_viewportDropZone_lw12r_309";
15
+ const rightPanel = "_rightPanel_lw12r_349";
16
+ const panelSection = "_panelSection_lw12r_371";
17
+ const panelTitle = "_panelTitle_lw12r_379";
18
+ const panelContent = "_panelContent_lw12r_425";
19
+ const treeItem = "_treeItem_lw12r_441";
20
+ const treeItemActive = "_treeItemActive_lw12r_471";
21
+ const treeIcon = "_treeIcon_lw12r_479";
22
+ const treeToggle = "_treeToggle_lw12r_503";
23
+ const treeVisibility = "_treeVisibility_lw12r_519";
24
+ const propRow = "_propRow_lw12r_543";
25
+ const propLabel = "_propLabel_lw12r_555";
26
+ const propInput = "_propInput_lw12r_567";
27
+ const propVec3 = "_propVec3_lw12r_595";
28
+ const propVec3X = "_propVec3X_lw12r_635";
29
+ const propVec3Y = "_propVec3Y_lw12r_641";
30
+ const propVec3Z = "_propVec3Z_lw12r_647";
31
+ const propSelect = "_propSelect_lw12r_699";
32
+ const bottomPanel = "_bottomPanel_lw12r_727";
33
+ const bottomPanelCollapsed = "_bottomPanelCollapsed_lw12r_745";
34
+ const bottomPanelHeader = "_bottomPanelHeader_lw12r_751";
35
+ const bottomPanelTitle = "_bottomPanelTitle_lw12r_769";
36
+ const bottomToggle = "_bottomToggle_lw12r_783";
37
+ const transportBar = "_transportBar_lw12r_799";
38
+ const transportBtn = "_transportBtn_lw12r_809";
39
+ const transportTime = "_transportTime_lw12r_841";
40
+ const animListArea = "_animListArea_lw12r_857";
41
+ const animList = "_animList_lw12r_857";
42
+ const animItem = "_animItem_lw12r_881";
43
+ const animItemActive = "_animItemActive_lw12r_905";
44
+ const animDuration = "_animDuration_lw12r_913";
45
+ const timelineArea = "_timelineArea_lw12r_927";
46
+ const timelineRuler = "_timelineRuler_lw12r_939";
47
+ const rulerTick = "_rulerTick_lw12r_951";
48
+ const rulerLabel = "_rulerLabel_lw12r_965";
49
+ const playhead = "_playhead_lw12r_979";
50
+ const playheadHandle = "_playheadHandle_lw12r_995";
51
+ const timelineTracks = "_timelineTracks_lw12r_1013";
52
+ const statusBar = "_statusBar_lw12r_1057";
53
+ const materialCard = "_materialCard_lw12r_1089";
54
+ const materialCardActive = "_materialCardActive_lw12r_1103";
55
+ const materialHeader = "_materialHeader_lw12r_1109";
56
+ const materialName = "_materialName_lw12r_1145";
57
+ const textureSlot = "_textureSlot_lw12r_1165";
58
+ const textureThumb = "_textureThumb_lw12r_1177";
59
+ const textureInfo = "_textureInfo_lw12r_1205";
60
+ const textureName = "_textureName_lw12r_1213";
61
+ const btnSecondary = "_btnSecondary_lw12r_1295";
62
+ const aiPanel = "_aiPanel_lw12r_1357";
63
+ const aiHeader = "_aiHeader_lw12r_1371";
64
+ const aiBtnRow = "_aiBtnRow_lw12r_1419";
65
+ const aiBtn = "_aiBtn_lw12r_1419";
66
+ const aiStatus = "_aiStatus_lw12r_1457";
67
+ const dragOver = "_dragOver_lw12r_1475";
68
+ const contextMenu = "_contextMenu_lw12r_1491";
69
+ const contextItem = "_contextItem_lw12r_1511";
70
+ const contextSep = "_contextSep_lw12r_1535";
71
+ const contextKey = "_contextKey_lw12r_1545";
72
+ const modeSelect = "_modeSelect_lw12r_1645";
73
+ const menuDropdownWrap = "_menuDropdownWrap_lw12r_1687";
74
+ const dropdownMenu = "_dropdownMenu_lw12r_1693";
75
+ const dropdownTitle = "_dropdownTitle_lw12r_1721";
76
+ const dropdownItem = "_dropdownItem_lw12r_1737";
77
+ const dropdownSep = "_dropdownSep_lw12r_1765";
78
+ const viewportShadingBar = "_viewportShadingBar_lw12r_1803";
79
+ const shadingBtn = "_shadingBtn_lw12r_1827";
80
+ const shadingBtnActive = "_shadingBtnActive_lw12r_1857";
81
+ const viewportGizmoInfo = "_viewportGizmoInfo_lw12r_1875";
82
+ const propTabs = "_propTabs_lw12r_1895";
83
+ const propTabBtn = "_propTabBtn_lw12r_1907";
84
+ const outlinerSearch = "_outlinerSearch_lw12r_1955";
85
+ const styles = {
86
+ root,
87
+ menuBar,
88
+ menuBtn,
89
+ menuSep,
90
+ menuLabel,
91
+ menuRight,
92
+ leftPanel,
93
+ toolbar,
94
+ toolBtn,
95
+ toolSep,
96
+ viewportContainer,
97
+ viewportOverlay,
98
+ viewportBadge,
99
+ viewportDropZone,
100
+ rightPanel,
101
+ panelSection,
102
+ panelTitle,
103
+ panelContent,
104
+ treeItem,
105
+ treeItemActive,
106
+ treeIcon,
107
+ treeToggle,
108
+ treeVisibility,
109
+ propRow,
110
+ propLabel,
111
+ propInput,
112
+ propVec3,
113
+ propVec3X,
114
+ propVec3Y,
115
+ propVec3Z,
116
+ propSelect,
117
+ bottomPanel,
118
+ bottomPanelCollapsed,
119
+ bottomPanelHeader,
120
+ bottomPanelTitle,
121
+ bottomToggle,
122
+ transportBar,
123
+ transportBtn,
124
+ transportTime,
125
+ animListArea,
126
+ animList,
127
+ animItem,
128
+ animItemActive,
129
+ animDuration,
130
+ timelineArea,
131
+ timelineRuler,
132
+ rulerTick,
133
+ rulerLabel,
134
+ playhead,
135
+ playheadHandle,
136
+ timelineTracks,
137
+ statusBar,
138
+ materialCard,
139
+ materialCardActive,
140
+ materialHeader,
141
+ materialName,
142
+ textureSlot,
143
+ textureThumb,
144
+ textureInfo,
145
+ textureName,
146
+ btnSecondary,
147
+ aiPanel,
148
+ aiHeader,
149
+ aiBtnRow,
150
+ aiBtn,
151
+ aiStatus,
152
+ dragOver,
153
+ contextMenu,
154
+ contextItem,
155
+ contextSep,
156
+ contextKey,
157
+ modeSelect,
158
+ menuDropdownWrap,
159
+ dropdownMenu,
160
+ dropdownTitle,
161
+ dropdownItem,
162
+ dropdownSep,
163
+ viewportShadingBar,
164
+ shadingBtn,
165
+ shadingBtnActive,
166
+ viewportGizmoInfo,
167
+ propTabs,
168
+ propTabBtn,
169
+ outlinerSearch
170
+ };
171
+ export {
172
+ aiBtn,
173
+ aiBtnRow,
174
+ aiHeader,
175
+ aiPanel,
176
+ aiStatus,
177
+ animDuration,
178
+ animItem,
179
+ animItemActive,
180
+ animList,
181
+ animListArea,
182
+ bottomPanel,
183
+ bottomPanelCollapsed,
184
+ bottomPanelHeader,
185
+ bottomPanelTitle,
186
+ bottomToggle,
187
+ btnSecondary,
188
+ contextItem,
189
+ contextKey,
190
+ contextMenu,
191
+ contextSep,
192
+ styles as default,
193
+ dragOver,
194
+ dropdownItem,
195
+ dropdownMenu,
196
+ dropdownSep,
197
+ dropdownTitle,
198
+ leftPanel,
199
+ materialCard,
200
+ materialCardActive,
201
+ materialHeader,
202
+ materialName,
203
+ menuBar,
204
+ menuBtn,
205
+ menuDropdownWrap,
206
+ menuLabel,
207
+ menuRight,
208
+ menuSep,
209
+ modeSelect,
210
+ outlinerSearch,
211
+ panelContent,
212
+ panelSection,
213
+ panelTitle,
214
+ playhead,
215
+ playheadHandle,
216
+ propInput,
217
+ propLabel,
218
+ propRow,
219
+ propSelect,
220
+ propTabBtn,
221
+ propTabs,
222
+ propVec3,
223
+ propVec3X,
224
+ propVec3Y,
225
+ propVec3Z,
226
+ rightPanel,
227
+ root,
228
+ rulerLabel,
229
+ rulerTick,
230
+ shadingBtn,
231
+ shadingBtnActive,
232
+ statusBar,
233
+ textureInfo,
234
+ textureName,
235
+ textureSlot,
236
+ textureThumb,
237
+ timelineArea,
238
+ timelineRuler,
239
+ timelineTracks,
240
+ toolBtn,
241
+ toolSep,
242
+ toolbar,
243
+ transportBar,
244
+ transportBtn,
245
+ transportTime,
246
+ treeIcon,
247
+ treeItem,
248
+ treeItemActive,
249
+ treeToggle,
250
+ treeVisibility,
251
+ viewportBadge,
252
+ viewportContainer,
253
+ viewportDropZone,
254
+ viewportGizmoInfo,
255
+ viewportOverlay,
256
+ viewportShadingBar
257
+ };
@@ -1,50 +1,131 @@
1
- import { jsx, jsxs } from 'react/jsx-runtime';
2
- import { NiceIcon, NiceButton, NiceTextInput, clickOnActivationKey } from '@nice2dev/ui';
3
- import React from 'react';
4
- import { useNiceTranslation } from '../core/i18n.js';
5
- import styles from './ModelEditor.module.css.js';
6
-
1
+ import { jsx, jsxs } from "react/jsx-runtime";
2
+ import { NiceIcon, NiceButton, NiceTextInput, clickOnActivationKey } from "@nice2dev/ui";
3
+ import React from "react";
4
+ import { useNiceTranslation } from "../core/i18n.js";
5
+ import styles from "./ModelEditor.module.css.js";
7
6
  const ModelEditorLeftPanel = /* @__PURE__ */ Object.assign(
8
- /* @__PURE__ */ React.memo(({ api }) => {
7
+ /* @__PURE__ */ React.memo(({ api }) => {
9
8
  const { t } = useNiceTranslation();
10
- const { sceneTree, selectedId, outlinerSearch, setOutlinerSearch, selectObject, rebuildTree, toggleNodeExpanded, toggleNodeVisibility, } = api;
9
+ const {
10
+ sceneTree,
11
+ selectedId,
12
+ outlinerSearch,
13
+ setOutlinerSearch,
14
+ selectObject,
15
+ rebuildTree,
16
+ toggleNodeExpanded,
17
+ toggleNodeVisibility
18
+ } = api;
11
19
  const renderTreeNode = (node, depth) => {
12
- // Outliner search filter
13
- if (outlinerSearch) {
14
- const q = outlinerSearch.toLowerCase();
15
- const match = node.name.toLowerCase().includes(q);
16
- const childMatch = node.children.some(function cm(c) {
17
- return c.name.toLowerCase().includes(q) || c.children.some(cm);
18
- });
19
- if (!match && !childMatch) {
20
- return null;
21
- }
20
+ if (outlinerSearch) {
21
+ const q = outlinerSearch.toLowerCase();
22
+ const match = node.name.toLowerCase().includes(q);
23
+ const childMatch = node.children.some(function cm(c) {
24
+ return c.name.toLowerCase().includes(q) || c.children.some(cm);
25
+ });
26
+ if (!match && !childMatch) {
27
+ return null;
22
28
  }
23
- const hasChildren = node.children.length > 0;
24
- const icon = node.type === 'mesh'
25
- ? 'box'
26
- : node.type === 'bone'
27
- ? 'target'
28
- : node.type === 'light'
29
- ? 'lightbulb'
30
- : node.type === 'camera'
31
- ? 'camera'
32
- : node.type === 'helper'
33
- ? 'hexagon'
34
- : 'folder';
35
- return (jsxs(React.Fragment, { children: [jsxs("div", { role: "button", tabIndex: 0, onKeyDown: clickOnActivationKey, className: `${styles.treeItem} ${selectedId === node.id ? styles.treeItemActive : ''}`, style: { paddingLeft: depth * 16 + 4 }, onClick: () => selectObject(node), children: [hasChildren ? (jsx("span", { role: "button", tabIndex: 0, "aria-label": t(node.expanded ? 'controls.collapse' : 'controls.expand', node.expanded ? 'Collapse' : 'Expand'), onKeyDown: clickOnActivationKey, className: styles.treeToggle, onClick: (e) => {
36
- e.stopPropagation();
37
- toggleNodeExpanded(node);
38
- }, children: jsx(NiceIcon, { name: node.expanded ? 'chevron-down' : 'chevron-right', size: 14 }) })) : (jsx("span", { className: styles.treeToggle })), jsx("span", { className: styles.treeIcon, children: jsx(NiceIcon, { name: icon, size: 14 }) }), jsx("span", { style: { flex: 1, overflow: 'hidden', textOverflow: 'ellipsis' }, children: node.name }), jsx("span", { role: "button", tabIndex: 0, "aria-label": t(node.visible ? 'hide' : 'show', node.visible ? 'Hide' : 'Show'), onKeyDown: clickOnActivationKey, className: styles.treeVisibility, onClick: (e) => {
39
- e.stopPropagation();
40
- toggleNodeVisibility(node);
41
- }, children: jsx(NiceIcon, { name: node.visible ? 'eye' : 'eye-off', size: 14 }) })] }), node.expanded && node.children.map((c) => renderTreeNode(c, depth + 1))] }, node.id));
29
+ }
30
+ const hasChildren = node.children.length > 0;
31
+ const icon = node.type === "mesh" ? "box" : node.type === "bone" ? "target" : node.type === "light" ? "lightbulb" : node.type === "camera" ? "camera" : node.type === "helper" ? "hexagon" : "folder";
32
+ return /* @__PURE__ */ jsxs(React.Fragment, { children: [
33
+ /* @__PURE__ */ jsxs(
34
+ "div",
35
+ {
36
+ role: "button",
37
+ tabIndex: 0,
38
+ onKeyDown: clickOnActivationKey,
39
+ className: `${styles.treeItem} ${selectedId === node.id ? styles.treeItemActive : ""}`,
40
+ style: { paddingLeft: depth * 16 + 4 },
41
+ onClick: () => selectObject(node),
42
+ children: [
43
+ hasChildren ? /* @__PURE__ */ jsx(
44
+ "span",
45
+ {
46
+ role: "button",
47
+ tabIndex: 0,
48
+ "aria-label": t(
49
+ node.expanded ? "controls.collapse" : "controls.expand",
50
+ node.expanded ? "Collapse" : "Expand"
51
+ ),
52
+ onKeyDown: clickOnActivationKey,
53
+ className: styles.treeToggle,
54
+ onClick: (e) => {
55
+ e.stopPropagation();
56
+ toggleNodeExpanded(node);
57
+ },
58
+ children: /* @__PURE__ */ jsx(NiceIcon, { name: node.expanded ? "chevron-down" : "chevron-right", size: 14 })
59
+ }
60
+ ) : /* @__PURE__ */ jsx("span", { className: styles.treeToggle }),
61
+ /* @__PURE__ */ jsx("span", { className: styles.treeIcon, children: /* @__PURE__ */ jsx(NiceIcon, { name: icon, size: 14 }) }),
62
+ /* @__PURE__ */ jsx("span", { style: { flex: 1, overflow: "hidden", textOverflow: "ellipsis" }, children: node.name }),
63
+ /* @__PURE__ */ jsx(
64
+ "span",
65
+ {
66
+ role: "button",
67
+ tabIndex: 0,
68
+ "aria-label": t(node.visible ? "hide" : "show", node.visible ? "Hide" : "Show"),
69
+ onKeyDown: clickOnActivationKey,
70
+ className: styles.treeVisibility,
71
+ onClick: (e) => {
72
+ e.stopPropagation();
73
+ toggleNodeVisibility(node);
74
+ },
75
+ children: /* @__PURE__ */ jsx(NiceIcon, { name: node.visible ? "eye" : "eye-off", size: 14 })
76
+ }
77
+ )
78
+ ]
79
+ }
80
+ ),
81
+ node.expanded && node.children.map((c) => renderTreeNode(c, depth + 1))
82
+ ] }, node.id);
42
83
  };
43
- return (jsx("div", { className: styles.leftPanel, children: jsxs("div", { className: styles.panelSection, children: [jsxs("div", { className: styles.panelTitle, children: [jsx(NiceIcon, { name: "clipboard", size: 14 }), " ", t('modelEditorLeftPanel.outliner', 'Outliner'), jsx(NiceButton, { variant: "ghost", size: "sm", onClick: rebuildTree, title: t('modelEditorLeftPanel.refresh', 'Refresh'), "aria-label": t('modelEditorLeftPanel.refreshOutliner', 'Refresh outliner'), children: jsx(NiceIcon, { name: "refresh", size: 14 }) })] }), jsx("div", { className: styles.outlinerSearch, children: jsx(NiceTextInput, { className: styles.propInput, placeholder: t('modelEditorLeftPanel.filter', 'Filter...'), value: outlinerSearch, onChange: (val) => setOutlinerSearch(val), style: { width: '100%', marginBottom: 4 } }) }), jsxs("div", { className: styles.panelContent, style: { overflowY: 'auto', flex: 1 }, children: [sceneTree.length === 0 && (jsx("div", { style: {
44
- color: 'var(--nice-text-secondary, #666)',
45
- fontSize: 10,
46
- padding: '8px 0',
47
- }, children: t('modelEditorLeftPanel.dropA3dFileTo', 'Drop a 3D file to begin') })), sceneTree.map((n) => renderTreeNode(n, 0))] })] }) }));
48
- }), { displayName: 'ModelEditorLeftPanel' });
49
-
50
- export { ModelEditorLeftPanel as default };
84
+ return /* @__PURE__ */ jsx("div", { className: styles.leftPanel, children: /* @__PURE__ */ jsxs("div", { className: styles.panelSection, children: [
85
+ /* @__PURE__ */ jsxs("div", { className: styles.panelTitle, children: [
86
+ /* @__PURE__ */ jsx(NiceIcon, { name: "clipboard", size: 14 }),
87
+ " ",
88
+ t("modelEditorLeftPanel.outliner", "Outliner"),
89
+ /* @__PURE__ */ jsx(
90
+ NiceButton,
91
+ {
92
+ variant: "ghost",
93
+ size: "sm",
94
+ onClick: rebuildTree,
95
+ title: t("modelEditorLeftPanel.refresh", "Refresh"),
96
+ "aria-label": t("modelEditorLeftPanel.refreshOutliner", "Refresh outliner"),
97
+ children: /* @__PURE__ */ jsx(NiceIcon, { name: "refresh", size: 14 })
98
+ }
99
+ )
100
+ ] }),
101
+ /* @__PURE__ */ jsx("div", { className: styles.outlinerSearch, children: /* @__PURE__ */ jsx(
102
+ NiceTextInput,
103
+ {
104
+ className: styles.propInput,
105
+ placeholder: t("modelEditorLeftPanel.filter", "Filter..."),
106
+ value: outlinerSearch,
107
+ onChange: (val) => setOutlinerSearch(val),
108
+ style: { width: "100%", marginBottom: 4 }
109
+ }
110
+ ) }),
111
+ /* @__PURE__ */ jsxs("div", { className: styles.panelContent, style: { overflowY: "auto", flex: 1 }, children: [
112
+ sceneTree.length === 0 && /* @__PURE__ */ jsx(
113
+ "div",
114
+ {
115
+ style: {
116
+ color: "var(--nice-text-secondary, #666)",
117
+ fontSize: 10,
118
+ padding: "8px 0"
119
+ },
120
+ children: t("modelEditorLeftPanel.dropA3dFileTo", "Drop a 3D file to begin")
121
+ }
122
+ ),
123
+ sceneTree.map((n) => renderTreeNode(n, 0))
124
+ ] })
125
+ ] }) });
126
+ }),
127
+ { displayName: "ModelEditorLeftPanel" }
128
+ );
129
+ export {
130
+ ModelEditorLeftPanel as default
131
+ };