vim-web 0.3.44-dev.22 → 0.3.44-dev.23

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/vim-web.js CHANGED
@@ -72102,31 +72102,10 @@ function VimContextMenu(props) {
72102
72102
  };
72103
72103
  const viewer = props.viewer;
72104
72104
  const camera2 = props.camera;
72105
- const [section, setSection] = useState({
72106
- visible: viewer.gizmos.sectionBox.visible,
72107
- clip: viewer.gizmos.sectionBox.clip
72108
- });
72109
- const isClipping = () => {
72110
- return !viewer.gizmos.sectionBox.box.containsBox(viewer.renderer.getBoundingBox());
72111
- };
72112
- const [clipping, setClipping] = useState(isClipping());
72113
72105
  const [, setVersion] = useState(0);
72114
72106
  const hidden2 = props.isolation.isActive();
72115
72107
  useEffect(() => {
72116
- const subState = viewer.gizmos.sectionBox.onStateChanged.subscribe(() => {
72117
- setSection({
72118
- visible: viewer.gizmos.sectionBox.visible,
72119
- clip: viewer.gizmos.sectionBox.clip
72120
- });
72121
- });
72122
- const subConfirm = viewer.gizmos.sectionBox.onBoxConfirm.subscribe(
72123
- () => setClipping(isClipping())
72124
- );
72125
72108
  props.isolation.onChanged.subscribe(() => setVersion((v) => v + 1));
72126
- return () => {
72127
- subState();
72128
- subConfirm();
72129
- };
72130
72109
  }, []);
72131
72110
  const onShowControlsBtn = (e) => {
72132
72111
  props.modal.help(true);
@@ -72162,30 +72141,13 @@ function VimContextMenu(props) {
72162
72141
  props.isolation.show(getSelection(), "contextMenu");
72163
72142
  e.stopPropagation();
72164
72143
  };
72165
- const onSelectionClearBtn = (e) => {
72166
- viewer.selection.clear();
72167
- e.stopPropagation();
72168
- };
72169
72144
  const onShowAllBtn = (e) => {
72170
72145
  props.isolation.clear("contextMenu");
72171
72146
  e.stopPropagation();
72172
72147
  };
72173
- const onSectionToggleBtn = (e) => {
72174
- viewer.gizmos.sectionBox.clip = !viewer.gizmos.sectionBox.clip;
72175
- };
72176
- const onSectionResetBtn = (e) => {
72177
- viewer.gizmos.sectionBox.fitBox(viewer.renderer.getBoundingBox());
72178
- e.stopPropagation();
72179
- };
72180
72148
  const onMeasureDeleteBtn = (e) => {
72181
72149
  viewer.gizmos.measure.abort();
72182
72150
  };
72183
- const onFitSectionToSelectionBtn = (e) => {
72184
- const box = viewer.selection.getBoundingBox();
72185
- if (box) {
72186
- viewer.gizmos.sectionBox.fitBox(box);
72187
- }
72188
- };
72189
72151
  const createButton2 = (button) => {
72190
72152
  if (!button.enabled) return null;
72191
72153
  return /* @__PURE__ */ jsxRuntimeExports.jsxs(
@@ -72232,10 +72194,10 @@ function VimContextMenu(props) {
72232
72194
  },
72233
72195
  {
72234
72196
  id: contextMenuElementIds.zoomToFit,
72235
- label: "Zoom to Fit",
72197
+ label: "Focus Camera",
72236
72198
  keyboard: "F",
72237
72199
  action: onCameraFrameBtn,
72238
- enabled: true
72200
+ enabled: hasSelection
72239
72201
  },
72240
72202
  {
72241
72203
  id: contextMenuElementIds.dividerSelection,
@@ -72269,13 +72231,6 @@ function VimContextMenu(props) {
72269
72231
  action: onSelectionShowBtn,
72270
72232
  enabled: hasSelection && !hasVisibleSelection
72271
72233
  },
72272
- {
72273
- id: contextMenuElementIds.clearSelection,
72274
- label: "Clear Selection",
72275
- keyboard: "Esc",
72276
- action: onSelectionClearBtn,
72277
- enabled: hasSelection
72278
- },
72279
72234
  {
72280
72235
  id: contextMenuElementIds.showAll,
72281
72236
  label: "Show All",
@@ -72290,31 +72245,6 @@ function VimContextMenu(props) {
72290
72245
  keyboard: "",
72291
72246
  action: onMeasureDeleteBtn,
72292
72247
  enabled: measuring
72293
- },
72294
- {
72295
- id: contextMenuElementIds.dividerSection,
72296
- enabled: clipping || section.visible
72297
- },
72298
- {
72299
- id: contextMenuElementIds.ignoreSection,
72300
- label: section.clip ? "Ignore Section Box" : "Apply Section Box",
72301
- keyboard: "",
72302
- action: onSectionToggleBtn,
72303
- enabled: clipping
72304
- },
72305
- {
72306
- id: contextMenuElementIds.resetSection,
72307
- label: "Reset Section Box",
72308
- keyboard: "",
72309
- action: onSectionResetBtn,
72310
- enabled: clipping
72311
- },
72312
- {
72313
- id: contextMenuElementIds.fitSectionToSelection,
72314
- label: "Fit Section Box to Selection",
72315
- keyboard: "",
72316
- action: onFitSectionToSelectionBtn,
72317
- enabled: section.visible && hasSelection
72318
72248
  }
72319
72249
  ];
72320
72250
  elements = ((_c = props.customization) == null ? void 0 : _c.call(props, elements)) ?? elements;