@vertexvis/viewer-toolkit-react 0.0.2-canary.0 → 0.0.2-canary.2

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.
@@ -1,35 +1,69 @@
1
1
  'use strict';
2
2
 
3
3
  var jsxRuntime = require('react/jsx-runtime');
4
- var React = require('react');
5
4
  var uiReact = require('@vertexvis/ui-react');
5
+ var classNames = require('classnames');
6
+ var React = require('react');
6
7
  var utils = require('@vertexvis/utils');
7
8
  var recoil = require('recoil');
8
9
  var geometry = require('@vertexvis/geometry');
9
10
  var Pino = require('pino');
10
11
  var viewerReact = require('@vertexvis/viewer-react');
11
- var classNames = require('classnames');
12
12
  var loader = require('@vertexvis/viewer/loader');
13
13
 
14
14
  function _interopNamespaceDefault(e) {
15
- var n = Object.create(null);
16
- if (e) {
17
- Object.keys(e).forEach(function (k) {
18
- if (k !== 'default') {
19
- var d = Object.getOwnPropertyDescriptor(e, k);
20
- Object.defineProperty(n, k, d.get ? d : {
21
- enumerable: true,
22
- get: function () { return e[k]; }
23
- });
24
- }
25
- });
26
- }
27
- n.default = e;
28
- return Object.freeze(n);
15
+ var n = Object.create(null);
16
+ if (e) {
17
+ Object.keys(e).forEach(function (k) {
18
+ if (k !== 'default') {
19
+ var d = Object.getOwnPropertyDescriptor(e, k);
20
+ Object.defineProperty(n, k, d.get ? d : {
21
+ enumerable: true,
22
+ get: function () { return e[k]; }
23
+ });
24
+ }
25
+ });
26
+ }
27
+ n.default = e;
28
+ return Object.freeze(n);
29
29
  }
30
30
 
31
31
  var React__namespace = /*#__PURE__*/_interopNamespaceDefault(React);
32
32
 
33
+ const DEFAULT_VERTICAL_SCALE = 1;
34
+ const VertexResizableContent = ({ displayShadow, heading, id, initialScale, position = 'left', children, onResize, }) => {
35
+ const isHorizontallyPositioned = position === 'left' || position === 'right';
36
+ const isVerticallyPositioned = position === 'top';
37
+ function getHorizontalResizeDirection() {
38
+ switch (position) {
39
+ case 'left':
40
+ return 'right';
41
+ case 'right':
42
+ return 'left';
43
+ default:
44
+ return 'none';
45
+ }
46
+ }
47
+ function getVerticalResizeDirection() {
48
+ return position === 'top' ? 'top' : 'none';
49
+ }
50
+ const initialVerticalScale = initialScale != null ? initialScale : DEFAULT_VERTICAL_SCALE;
51
+ return (jsxRuntime.jsx(uiReact.VertexResizable, { id: id, "data-testid": `resizable-content-position-${position}`, className: classNames('pointer-events-auto z-popover md:z-overlay bg-white bg-opacity-95 flex-grow-0 flex-shrink-0', {
52
+ ['border-r min-w-75 max-w-half']: position === 'left',
53
+ ['sidebar-shadow-right']: position === 'left' && displayShadow,
54
+ ['border-l right-0 relative']: position === 'right',
55
+ ['sidebar-shadow-left']: position === 'right' && displayShadow,
56
+ ['border-t bottom-0 fixed']: position === 'top',
57
+ ['min-h-12 sheet']: isVerticallyPositioned,
58
+ }), style: {
59
+ // This corrects an issue on mobile where `100vh` reflects the space
60
+ // under the address bar and bottom toolbar in CSS.
61
+ maxHeight: position === 'top' ? window.innerHeight : undefined,
62
+ }, initialHorizontalScale: isHorizontallyPositioned ? initialScale : undefined, initialVerticalScale: isVerticallyPositioned ? initialVerticalScale : undefined, horizontalDirection: getHorizontalResizeDirection(), verticalDirection: getVerticalResizeDirection(), position: position === 'right' || position === 'top' ? 'absolute' : 'relative', onResizeEnd: () => onResize === null || onResize === void 0 ? void 0 : onResize(), children: jsxRuntime.jsxs("div", { className: "flex flex-col h-full w-full", children: [jsxRuntime.jsx("div", { className: "flex justify-center w-full", children: jsxRuntime.jsx("div", { className: "block md:hidden w-20 h-0.5 mt-0.5 bg-neutral-600 rounded" }) }), heading, jsxRuntime.jsx("div", { className: classNames('w-full flex flex-col h-0 flex-grow', {
63
+ ['right-0']: position === 'right',
64
+ }), children: children })] }) }));
65
+ };
66
+
33
67
  // DEPRECATED - avoid if possible
34
68
  const useRecoilReducer = ({ reducer, atom, }) => {
35
69
  const state = recoil.useRecoilValue(atom);
@@ -1155,27 +1189,27 @@ function useCrossSectioningActions() {
1155
1189
  }
1156
1190
 
1157
1191
  var index$3 = /*#__PURE__*/Object.freeze({
1158
- __proto__: null,
1159
- DEFAULT_ALIGN_TO_PLANE_ANIMATION_DURATION_MS: DEFAULT_ALIGN_TO_PLANE_ANIMATION_DURATION_MS,
1160
- DEFAULT_SLIDER_RANGE: DEFAULT_SLIDER_RANGE,
1161
- crossSectioningActiveAxis: crossSectioningActiveAxis,
1162
- crossSectioningAdditionalToolsOpen: crossSectioningAdditionalToolsOpen,
1163
- crossSectioningAlignment: crossSectioningAlignment,
1164
- crossSectioningAlignmentToolsOpen: crossSectioningAlignmentToolsOpen,
1165
- crossSectioningAvailableAxes: crossSectioningAvailableAxes,
1166
- crossSectioningAxisToolsOpen: crossSectioningAxisToolsOpen,
1167
- crossSectioningBorderWidth: crossSectioningBorderWidth,
1168
- crossSectioningEnabled: crossSectioningEnabled,
1169
- crossSectioningHighlightColor: crossSectioningHighlightColor,
1170
- crossSectioningInteractionHandler: crossSectioningInteractionHandler,
1171
- crossSectioningIsInteractive: crossSectioningIsInteractive,
1172
- crossSectioningOffsetScalar: crossSectioningOffsetScalar,
1173
- crossSectioningPlaneDisplayOffset: crossSectioningPlaneDisplayOffset,
1174
- crossSectioningPlanes: crossSectioningPlanes,
1175
- crossSectioningSliderRange: crossSectioningSliderRange,
1176
- crossSectioningTargetBoundingBox: crossSectioningTargetBoundingBox,
1177
- useCrossSectioning: useCrossSectioning,
1178
- useCrossSectioningActions: useCrossSectioningActions
1192
+ __proto__: null,
1193
+ DEFAULT_ALIGN_TO_PLANE_ANIMATION_DURATION_MS: DEFAULT_ALIGN_TO_PLANE_ANIMATION_DURATION_MS,
1194
+ DEFAULT_SLIDER_RANGE: DEFAULT_SLIDER_RANGE,
1195
+ crossSectioningActiveAxis: crossSectioningActiveAxis,
1196
+ crossSectioningAdditionalToolsOpen: crossSectioningAdditionalToolsOpen,
1197
+ crossSectioningAlignment: crossSectioningAlignment,
1198
+ crossSectioningAlignmentToolsOpen: crossSectioningAlignmentToolsOpen,
1199
+ crossSectioningAvailableAxes: crossSectioningAvailableAxes,
1200
+ crossSectioningAxisToolsOpen: crossSectioningAxisToolsOpen,
1201
+ crossSectioningBorderWidth: crossSectioningBorderWidth,
1202
+ crossSectioningEnabled: crossSectioningEnabled,
1203
+ crossSectioningHighlightColor: crossSectioningHighlightColor,
1204
+ crossSectioningInteractionHandler: crossSectioningInteractionHandler,
1205
+ crossSectioningIsInteractive: crossSectioningIsInteractive,
1206
+ crossSectioningOffsetScalar: crossSectioningOffsetScalar,
1207
+ crossSectioningPlaneDisplayOffset: crossSectioningPlaneDisplayOffset,
1208
+ crossSectioningPlanes: crossSectioningPlanes,
1209
+ crossSectioningSliderRange: crossSectioningSliderRange,
1210
+ crossSectioningTargetBoundingBox: crossSectioningTargetBoundingBox,
1211
+ useCrossSectioning: useCrossSectioning,
1212
+ useCrossSectioningActions: useCrossSectioningActions
1179
1213
  });
1180
1214
 
1181
1215
  const useHitActions = () => {
@@ -1257,15 +1291,15 @@ const hitState = recoil.selector({
1257
1291
  });
1258
1292
 
1259
1293
  var index$2 = /*#__PURE__*/Object.freeze({
1260
- __proto__: null,
1261
- currentHitResult: currentHitResult,
1262
- hitResult: hitResult,
1263
- hitResultsLongPressDetails: hitResultsLongPressDetails,
1264
- hitResultsSkipNextTap: hitResultsSkipNextTap,
1265
- hitResultsTapDetails: hitResultsTapDetails,
1266
- hitState: hitState,
1267
- previousHitResult: previousHitResult,
1268
- useHitActions: useHitActions
1294
+ __proto__: null,
1295
+ currentHitResult: currentHitResult,
1296
+ hitResult: hitResult,
1297
+ hitResultsLongPressDetails: hitResultsLongPressDetails,
1298
+ hitResultsSkipNextTap: hitResultsSkipNextTap,
1299
+ hitResultsTapDetails: hitResultsTapDetails,
1300
+ hitState: hitState,
1301
+ previousHitResult: previousHitResult,
1302
+ useHitActions: useHitActions
1269
1303
  });
1270
1304
 
1271
1305
  function useContextMenuActions() {
@@ -1647,18 +1681,18 @@ const selectionState = recoil.selector({
1647
1681
  });
1648
1682
 
1649
1683
  var index$1 = /*#__PURE__*/Object.freeze({
1650
- __proto__: null,
1651
- selectionHighestSelectedAncestor: selectionHighestSelectedAncestor,
1652
- selectionLastSelectWasMultiSelect: selectionLastSelectWasMultiSelect,
1653
- selectionLastSelected: selectionLastSelected,
1654
- selectionLastSelectionFromViewer: selectionLastSelectionFromViewer,
1655
- selectionPreviousVisibleSummary: selectionPreviousVisibleSummary,
1656
- selectionSelectedItemIds: selectionSelectedItemIds,
1657
- selectionSelectedItems: selectionSelectedItems,
1658
- selectionState: selectionState,
1659
- selectionVisibleCount: selectionVisibleCount,
1660
- selectionVisibleSummary: selectionVisibleSummary,
1661
- useSelectionActions: useSelectionActions
1684
+ __proto__: null,
1685
+ selectionHighestSelectedAncestor: selectionHighestSelectedAncestor,
1686
+ selectionLastSelectWasMultiSelect: selectionLastSelectWasMultiSelect,
1687
+ selectionLastSelected: selectionLastSelected,
1688
+ selectionLastSelectionFromViewer: selectionLastSelectionFromViewer,
1689
+ selectionPreviousVisibleSummary: selectionPreviousVisibleSummary,
1690
+ selectionSelectedItemIds: selectionSelectedItemIds,
1691
+ selectionSelectedItems: selectionSelectedItems,
1692
+ selectionState: selectionState,
1693
+ selectionVisibleCount: selectionVisibleCount,
1694
+ selectionVisibleSummary: selectionVisibleSummary,
1695
+ useSelectionActions: useSelectionActions
1662
1696
  });
1663
1697
 
1664
1698
  const VertexFitSelectedMenuItem = () => {
@@ -2074,13 +2108,13 @@ const VertexSceneTree = (_a) => {
2074
2108
  }
2075
2109
  onPointerDown === null || onPointerDown === void 0 ? void 0 : onPointerDown(event);
2076
2110
  };
2077
- return (jsxRuntime.jsxs(viewerReact.VertexSceneTree, Object.assign({ id: id !== null && id !== void 0 ? id : 'vertex-scene-tree', "data-testid": "vertex-scene-tree", config: config, ref: callbackRef, className: classNames('shrink-0', className), style: Object.assign(Object.assign(Object.assign({}, styleFromOptionalFont(font)), styleFromOptionalBackgroundColors(backgroundColors)), style), onConnectionError: (e) => {
2078
- logger.error('Scene Tree Connection Error: ', e.detail);
2079
- }, viewer: viewer, onPointerDown: handlePointerDown, onClick: handleClick, rowData: (row) => {
2080
- var _a;
2081
- const providedRowData = (_a = rowData === null || rowData === void 0 ? void 0 : rowData(row)) !== null && _a !== void 0 ? _a : {};
2082
- return Object.assign({ handleExpansion: wrappedExpansionHandler, handleSelection: wrappedSelectionHandler, handleVisibility: wrappedVisibilityHandler }, providedRowData);
2083
- } }, sdkProps, { children: [jsxRuntime.jsx(VertexSceneTreeToolbar, {}), jsxRuntime.jsx(VertexSceneTreeTableLayout, {}), children] })));
2111
+ return (jsxRuntime.jsx("div", { className: "flex flex-col w-full h-full", children: jsxRuntime.jsx("div", { className: "flex group h-full", children: jsxRuntime.jsxs(viewerReact.VertexSceneTree, Object.assign({ id: id !== null && id !== void 0 ? id : 'vertex-scene-tree', "data-testid": "vertex-scene-tree", config: config, ref: callbackRef, className: classNames('flex-1', className), style: Object.assign(Object.assign(Object.assign({}, styleFromOptionalFont(font)), styleFromOptionalBackgroundColors(backgroundColors)), style), onConnectionError: (e) => {
2112
+ logger.error('Scene Tree Connection Error: ', e.detail);
2113
+ }, viewer: viewer, onPointerDown: handlePointerDown, onClick: handleClick, rowData: (row) => {
2114
+ var _a;
2115
+ const providedRowData = (_a = rowData === null || rowData === void 0 ? void 0 : rowData(row)) !== null && _a !== void 0 ? _a : {};
2116
+ return Object.assign({ handleExpansion: wrappedExpansionHandler, handleSelection: wrappedSelectionHandler, handleVisibility: wrappedVisibilityHandler }, providedRowData);
2117
+ } }, sdkProps, { children: [jsxRuntime.jsx(VertexSceneTreeToolbar, {}), jsxRuntime.jsx(VertexSceneTreeTableLayout, {}), children] })) }) }));
2084
2118
  };
2085
2119
 
2086
2120
  const useSynchronizedProp = (state, value) => {
@@ -2537,8 +2571,8 @@ const VertexViewerToolkitRootConfig = ({ config, children, }) => {
2537
2571
  };
2538
2572
 
2539
2573
  var index = /*#__PURE__*/Object.freeze({
2540
- __proto__: null,
2541
- get AssemblyFontFace () { return AssemblyFontFace; }
2574
+ __proto__: null,
2575
+ get AssemblyFontFace () { return AssemblyFontFace; }
2542
2576
  });
2543
2577
 
2544
2578
  exports.CrossSection = index$3;
@@ -2553,6 +2587,7 @@ exports.VertexHideAllMenuItem = VertexHideAllMenuItem;
2553
2587
  exports.VertexHidePartMenuItem = VertexHidePartMenuItem;
2554
2588
  exports.VertexHideSelectedMenuItem = VertexHideSelectedMenuItem;
2555
2589
  exports.VertexPanButton = VertexPanButton;
2590
+ exports.VertexResizableContent = VertexResizableContent;
2556
2591
  exports.VertexRotateButton = VertexRotateButton;
2557
2592
  exports.VertexSceneTree = VertexSceneTree;
2558
2593
  exports.VertexSceneTreeContextMenu = VertexSceneTreeContextMenu;