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
|
@@ -16,6 +16,10 @@ export declare class Selection<T extends IVimObject> {
|
|
|
16
16
|
* If true, reselecting the currently selected single object will toggle it instead of doing nothing.
|
|
17
17
|
*/
|
|
18
18
|
toggleOnRepeatSelect: boolean;
|
|
19
|
+
/**
|
|
20
|
+
* If true, the selection manager is enabled and can modify the selection.
|
|
21
|
+
*/
|
|
22
|
+
enabled: boolean;
|
|
19
23
|
/**
|
|
20
24
|
* Creates a new Selection manager.
|
|
21
25
|
* @param adapter - Adapter responsible for visual selection feedback.
|
|
@@ -16,6 +16,6 @@ export declare function createViewer(container?: Container | HTMLElement): Promi
|
|
|
16
16
|
*/
|
|
17
17
|
export declare function Viewer(props: {
|
|
18
18
|
container: Container;
|
|
19
|
-
|
|
19
|
+
core: Core.Ultra.Viewer;
|
|
20
20
|
onMount: (viewer: ViewerRef) => void;
|
|
21
21
|
}): import("react/jsx-runtime").JSX.Element;
|
package/dist/vim-web.iife.js
CHANGED
|
@@ -55248,6 +55248,10 @@ void main() {
|
|
|
55248
55248
|
* If true, reselecting the currently selected single object will toggle it instead of doing nothing.
|
|
55249
55249
|
*/
|
|
55250
55250
|
__publicField(this, "toggleOnRepeatSelect", false);
|
|
55251
|
+
/**
|
|
55252
|
+
* If true, the selection manager is enabled and can modify the selection.
|
|
55253
|
+
*/
|
|
55254
|
+
__publicField(this, "enabled", true);
|
|
55251
55255
|
this._adapter = adapter;
|
|
55252
55256
|
}
|
|
55253
55257
|
/**
|
|
@@ -55287,6 +55291,7 @@ void main() {
|
|
|
55287
55291
|
return Array.isArray(oneOrMore) ? oneOrMore : [oneOrMore];
|
|
55288
55292
|
}
|
|
55289
55293
|
select(objectOrObjects) {
|
|
55294
|
+
if (!this.enabled) return;
|
|
55290
55295
|
if (!objectOrObjects) {
|
|
55291
55296
|
this.clear();
|
|
55292
55297
|
return;
|
|
@@ -55310,6 +55315,7 @@ void main() {
|
|
|
55310
55315
|
this._onSelectionChanged.requestDispatch();
|
|
55311
55316
|
}
|
|
55312
55317
|
toggle(objectOrObjects) {
|
|
55318
|
+
if (!this.enabled) return;
|
|
55313
55319
|
const objects = this.toArray(objectOrObjects);
|
|
55314
55320
|
let changed = false;
|
|
55315
55321
|
for (const obj of objects) {
|
|
@@ -55328,6 +55334,7 @@ void main() {
|
|
|
55328
55334
|
}
|
|
55329
55335
|
}
|
|
55330
55336
|
add(objectOrObjects) {
|
|
55337
|
+
if (!this.enabled) return;
|
|
55331
55338
|
const objects = this.toArray(objectOrObjects);
|
|
55332
55339
|
let changed = false;
|
|
55333
55340
|
for (const obj of objects) {
|
|
@@ -55342,6 +55349,7 @@ void main() {
|
|
|
55342
55349
|
}
|
|
55343
55350
|
}
|
|
55344
55351
|
remove(objectOrObjects) {
|
|
55352
|
+
if (!this.enabled) return;
|
|
55345
55353
|
const objects = this.toArray(objectOrObjects);
|
|
55346
55354
|
let changed = false;
|
|
55347
55355
|
for (const obj of objects) {
|
|
@@ -55358,6 +55366,7 @@ void main() {
|
|
|
55358
55366
|
* Clears the entire selection.
|
|
55359
55367
|
*/
|
|
55360
55368
|
clear() {
|
|
55369
|
+
if (!this.enabled) return;
|
|
55361
55370
|
if (this._selection.size === 0) return;
|
|
55362
55371
|
for (const obj of this._selection) {
|
|
55363
55372
|
this._adapter.outline(obj, false);
|
|
@@ -76372,11 +76381,11 @@ Averrage Date/Second ${avgDataRatePS} kb
|
|
|
76372
76381
|
function createViewer(container) {
|
|
76373
76382
|
const promise = new DeferredPromise();
|
|
76374
76383
|
const cmpContainer = container instanceof HTMLElement ? createContainer(container) : container ?? createContainer();
|
|
76375
|
-
const
|
|
76384
|
+
const core = Viewer$2.createWithCanvas(cmpContainer.gfx);
|
|
76376
76385
|
const reactRoot = clientExports.createRoot(cmpContainer.ui);
|
|
76377
76386
|
const attachDispose = (cmp) => {
|
|
76378
76387
|
cmp.dispose = () => {
|
|
76379
|
-
|
|
76388
|
+
core.dispose();
|
|
76380
76389
|
cmpContainer.dispose();
|
|
76381
76390
|
reactRoot.unmount();
|
|
76382
76391
|
};
|
|
@@ -76387,7 +76396,7 @@ Averrage Date/Second ${avgDataRatePS} kb
|
|
|
76387
76396
|
Viewer,
|
|
76388
76397
|
{
|
|
76389
76398
|
container: cmpContainer,
|
|
76390
|
-
|
|
76399
|
+
core,
|
|
76391
76400
|
onMount: (cmp) => promise.resolve(attachDispose(cmp))
|
|
76392
76401
|
}
|
|
76393
76402
|
)
|
|
@@ -76396,21 +76405,21 @@ Averrage Date/Second ${avgDataRatePS} kb
|
|
|
76396
76405
|
}
|
|
76397
76406
|
function Viewer(props) {
|
|
76398
76407
|
const modal = React2.useRef(null);
|
|
76399
|
-
const sectionBox2 = useUltraSectionBox(props.
|
|
76400
|
-
const camera2 = useUltraCamera(props.
|
|
76408
|
+
const sectionBox2 = useUltraSectionBox(props.core);
|
|
76409
|
+
const camera2 = useUltraCamera(props.core, sectionBox2);
|
|
76401
76410
|
const side = useSideState(true, 400);
|
|
76402
76411
|
const [_, setSelectState] = React2.useState(0);
|
|
76403
76412
|
const [controlBarCustom, setControlBarCustom] = React2.useState(() => (c) => c);
|
|
76404
|
-
const isolation = useUltraIsolation(props.
|
|
76405
|
-
const controlBar = useUltraControlBar(props.
|
|
76406
|
-
useViewerInput(props.
|
|
76413
|
+
const isolation = useUltraIsolation(props.core);
|
|
76414
|
+
const controlBar = useUltraControlBar(props.core, sectionBox2, isolation, camera2, (_2) => _2);
|
|
76415
|
+
useViewerInput(props.core.inputs, camera2);
|
|
76407
76416
|
React2.useEffect(() => {
|
|
76408
|
-
props.
|
|
76409
|
-
props.
|
|
76417
|
+
props.core.onStateChanged.subscribe((state) => updateModal(modal, state));
|
|
76418
|
+
props.core.selection.onSelectionChanged.subscribe(() => {
|
|
76410
76419
|
setSelectState((i2) => (i2 + 1) % 2);
|
|
76411
76420
|
});
|
|
76412
76421
|
props.onMount({
|
|
76413
|
-
|
|
76422
|
+
core: props.core,
|
|
76414
76423
|
get modal() {
|
|
76415
76424
|
return modal.current;
|
|
76416
76425
|
},
|
|
@@ -76422,14 +76431,14 @@ Averrage Date/Second ${avgDataRatePS} kb
|
|
|
76422
76431
|
controlBar: {
|
|
76423
76432
|
customize: (v) => setControlBarCustom(() => v)
|
|
76424
76433
|
},
|
|
76425
|
-
load: patchLoad(props.
|
|
76434
|
+
load: patchLoad(props.core, modal)
|
|
76426
76435
|
});
|
|
76427
76436
|
}, []);
|
|
76428
76437
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
76429
76438
|
/* @__PURE__ */ jsxRuntimeExports.jsx(RestOfScreen, { side, content: () => {
|
|
76430
76439
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
76431
76440
|
whenTrue(true, /* @__PURE__ */ jsxRuntimeExports.jsx(LogoMemo, {})),
|
|
76432
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(Overlay, { canvas: props.
|
|
76441
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Overlay, { canvas: props.core.viewport.canvas }),
|
|
76433
76442
|
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
76434
76443
|
ControlBar,
|
|
76435
76444
|
{
|