vim-web 0.3.44-dev.62 → 0.3.44-dev.64
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/types/core-viewers/shared/selection.d.ts +4 -0
- package/dist/types/react-viewers/ultra/viewer.d.ts +1 -1
- package/dist/types/react-viewers/ultra/viewerRef.d.ts +1 -1
- package/dist/vim-web.iife.js +22 -13
- package/dist/vim-web.iife.js.map +1 -1
- package/dist/vim-web.js +22 -13
- package/dist/vim-web.js.map +1 -1
- package/package.json +1 -1
package/dist/vim-web.js
CHANGED
|
@@ -55232,6 +55232,10 @@ class Selection {
|
|
|
55232
55232
|
* If true, reselecting the currently selected single object will toggle it instead of doing nothing.
|
|
55233
55233
|
*/
|
|
55234
55234
|
__publicField(this, "toggleOnRepeatSelect", false);
|
|
55235
|
+
/**
|
|
55236
|
+
* If true, the selection manager is enabled and can modify the selection.
|
|
55237
|
+
*/
|
|
55238
|
+
__publicField(this, "enabled", true);
|
|
55235
55239
|
this._adapter = adapter;
|
|
55236
55240
|
}
|
|
55237
55241
|
/**
|
|
@@ -55271,6 +55275,7 @@ class Selection {
|
|
|
55271
55275
|
return Array.isArray(oneOrMore) ? oneOrMore : [oneOrMore];
|
|
55272
55276
|
}
|
|
55273
55277
|
select(objectOrObjects) {
|
|
55278
|
+
if (!this.enabled) return;
|
|
55274
55279
|
if (!objectOrObjects) {
|
|
55275
55280
|
this.clear();
|
|
55276
55281
|
return;
|
|
@@ -55294,6 +55299,7 @@ class Selection {
|
|
|
55294
55299
|
this._onSelectionChanged.requestDispatch();
|
|
55295
55300
|
}
|
|
55296
55301
|
toggle(objectOrObjects) {
|
|
55302
|
+
if (!this.enabled) return;
|
|
55297
55303
|
const objects = this.toArray(objectOrObjects);
|
|
55298
55304
|
let changed = false;
|
|
55299
55305
|
for (const obj of objects) {
|
|
@@ -55312,6 +55318,7 @@ class Selection {
|
|
|
55312
55318
|
}
|
|
55313
55319
|
}
|
|
55314
55320
|
add(objectOrObjects) {
|
|
55321
|
+
if (!this.enabled) return;
|
|
55315
55322
|
const objects = this.toArray(objectOrObjects);
|
|
55316
55323
|
let changed = false;
|
|
55317
55324
|
for (const obj of objects) {
|
|
@@ -55326,6 +55333,7 @@ class Selection {
|
|
|
55326
55333
|
}
|
|
55327
55334
|
}
|
|
55328
55335
|
remove(objectOrObjects) {
|
|
55336
|
+
if (!this.enabled) return;
|
|
55329
55337
|
const objects = this.toArray(objectOrObjects);
|
|
55330
55338
|
let changed = false;
|
|
55331
55339
|
for (const obj of objects) {
|
|
@@ -55342,6 +55350,7 @@ class Selection {
|
|
|
55342
55350
|
* Clears the entire selection.
|
|
55343
55351
|
*/
|
|
55344
55352
|
clear() {
|
|
55353
|
+
if (!this.enabled) return;
|
|
55345
55354
|
if (this._selection.size === 0) return;
|
|
55346
55355
|
for (const obj of this._selection) {
|
|
55347
55356
|
this._adapter.outline(obj, false);
|
|
@@ -76356,11 +76365,11 @@ function allButSelection(viewer, vim) {
|
|
|
76356
76365
|
function createViewer(container) {
|
|
76357
76366
|
const promise = new DeferredPromise();
|
|
76358
76367
|
const cmpContainer = container instanceof HTMLElement ? createContainer(container) : container ?? createContainer();
|
|
76359
|
-
const
|
|
76368
|
+
const core = Viewer$2.createWithCanvas(cmpContainer.gfx);
|
|
76360
76369
|
const reactRoot = clientExports.createRoot(cmpContainer.ui);
|
|
76361
76370
|
const attachDispose = (cmp) => {
|
|
76362
76371
|
cmp.dispose = () => {
|
|
76363
|
-
|
|
76372
|
+
core.dispose();
|
|
76364
76373
|
cmpContainer.dispose();
|
|
76365
76374
|
reactRoot.unmount();
|
|
76366
76375
|
};
|
|
@@ -76371,7 +76380,7 @@ function createViewer(container) {
|
|
|
76371
76380
|
Viewer3,
|
|
76372
76381
|
{
|
|
76373
76382
|
container: cmpContainer,
|
|
76374
|
-
|
|
76383
|
+
core,
|
|
76375
76384
|
onMount: (cmp) => promise.resolve(attachDispose(cmp))
|
|
76376
76385
|
}
|
|
76377
76386
|
)
|
|
@@ -76380,21 +76389,21 @@ function createViewer(container) {
|
|
|
76380
76389
|
}
|
|
76381
76390
|
function Viewer3(props) {
|
|
76382
76391
|
const modal = useRef(null);
|
|
76383
|
-
const sectionBox2 = useUltraSectionBox(props.
|
|
76384
|
-
const camera2 = useUltraCamera(props.
|
|
76392
|
+
const sectionBox2 = useUltraSectionBox(props.core);
|
|
76393
|
+
const camera2 = useUltraCamera(props.core, sectionBox2);
|
|
76385
76394
|
const side = useSideState(true, 400);
|
|
76386
76395
|
const [_, setSelectState] = useState(0);
|
|
76387
76396
|
const [controlBarCustom, setControlBarCustom] = useState(() => (c) => c);
|
|
76388
|
-
const isolation = useUltraIsolation(props.
|
|
76389
|
-
const controlBar = useUltraControlBar(props.
|
|
76390
|
-
useViewerInput(props.
|
|
76397
|
+
const isolation = useUltraIsolation(props.core);
|
|
76398
|
+
const controlBar = useUltraControlBar(props.core, sectionBox2, isolation, camera2, (_2) => _2);
|
|
76399
|
+
useViewerInput(props.core.inputs, camera2);
|
|
76391
76400
|
useEffect(() => {
|
|
76392
|
-
props.
|
|
76393
|
-
props.
|
|
76401
|
+
props.core.onStateChanged.subscribe((state) => updateModal(modal, state));
|
|
76402
|
+
props.core.selection.onSelectionChanged.subscribe(() => {
|
|
76394
76403
|
setSelectState((i) => (i + 1) % 2);
|
|
76395
76404
|
});
|
|
76396
76405
|
props.onMount({
|
|
76397
|
-
|
|
76406
|
+
core: props.core,
|
|
76398
76407
|
get modal() {
|
|
76399
76408
|
return modal.current;
|
|
76400
76409
|
},
|
|
@@ -76406,14 +76415,14 @@ function Viewer3(props) {
|
|
|
76406
76415
|
controlBar: {
|
|
76407
76416
|
customize: (v) => setControlBarCustom(() => v)
|
|
76408
76417
|
},
|
|
76409
|
-
load: patchLoad(props.
|
|
76418
|
+
load: patchLoad(props.core, modal)
|
|
76410
76419
|
});
|
|
76411
76420
|
}, []);
|
|
76412
76421
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
76413
76422
|
/* @__PURE__ */ jsxRuntimeExports.jsx(RestOfScreen, { side, content: () => {
|
|
76414
76423
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
76415
76424
|
whenTrue(true, /* @__PURE__ */ jsxRuntimeExports.jsx(LogoMemo, {})),
|
|
76416
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(Overlay, { canvas: props.
|
|
76425
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Overlay, { canvas: props.core.viewport.canvas }),
|
|
76417
76426
|
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
76418
76427
|
ControlBar,
|
|
76419
76428
|
{
|