pollination-react-io 1.76.0 → 1.76.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.
package/build/index.js CHANGED
@@ -53220,43 +53220,51 @@ styleInject(css_248z$7);
53220
53220
 
53221
53221
  var BaseDropdown = function (_a) {
53222
53222
  var options = _a.options, children = _a.children, _b = _a.overlayStyle, overlayStyle = _b === void 0 ? {
53223
- border: 'solid 1px #000',
53223
+ border: 'solid 1px #606470',
53224
53224
  backgroundColor: '#fff',
53225
53225
  padding: '5px',
53226
- borderRadius: '5px'
53226
+ borderRadius: '5px',
53227
53227
  } : _b, _c = _a.childOverlayStyle, childOverlayStyle = _c === void 0 ? {
53228
53228
  padding: '10px',
53229
- cursor: 'pointer'
53230
- } : _c, _d = _a.triggerStyle, triggerStyle = _d === void 0 ? {} : _d, _e = _a.placement, placement = _e === void 0 ? 'bottomCenter' : _e, _f = _a.icon, icon = _f === void 0 ? React__default["default"].createElement(CaretDownFill$1, { size: 12 }) : _f, _g = _a.onSelect, onSelect = _g === void 0 ? function (option) { } : _g, _h = _a.disabled, disabled = _h === void 0 ? false : _h, _j = _a.action, action = _j === void 0 ? 'click' : _j;
53229
+ cursor: 'pointer',
53230
+ } : _c, _d = _a.triggerStyle, triggerStyle = _d === void 0 ? {} : _d, _e = _a.placement, placement = _e === void 0 ? 'bottomCenter' : _e, _f = _a.icon, icon = _f === void 0 ? React__default["default"].createElement(CaretDownFill$1, { size: 12 }) : _f, _g = _a.onSelect, onSelect = _g === void 0 ? function (option) { } : _g, _h = _a.disabled, disabled = _h === void 0 ? false : _h, _j = _a.action, action = _j === void 0 ? 'click' : _j, _k = _a.activeId, activeId = _k === void 0 ? undefined : _k, _l = _a.selectedStyle, selectedStyle = _l === void 0 ? {
53231
+ backgroundColor: '#40a9ff',
53232
+ color: '#fff',
53233
+ fontWeight: 'bold'
53234
+ } : _l;
53235
+ var _m = React.useState(activeId), selection = _m[0], setSelection = _m[1];
53231
53236
  var renderItem = React.useCallback(function (o) {
53232
53237
  switch (o.type) {
53233
53238
  case 'link':
53234
- return (React__default["default"].createElement("div", { style: childOverlayStyle, className: 'basedropdown-overlay-child', key: o.id, tabIndex: 0, role: 'button', onClick: function (e) {
53235
- e.stopPropagation();
53239
+ return (React__default["default"].createElement("div", { style: o.id == selection
53240
+ ? __assign(__assign({}, childOverlayStyle), selectedStyle) : childOverlayStyle, className: 'basedropdown-overlay-child', key: o.id, tabIndex: 0, role: 'button', onClick: function (e) {
53236
53241
  window.location.href = o.to;
53242
+ setSelection(o.id);
53237
53243
  } },
53238
53244
  o.icon && React__default["default"].createElement("span", { style: { marginRight: '5px' } }, o.icon),
53239
53245
  o.label));
53240
53246
  case 'label':
53241
- return (React__default["default"].createElement("div", { style: childOverlayStyle, key: o.id, tabIndex: 0, role: 'button', onClick: function (e) {
53242
- e.stopPropagation();
53247
+ return (React__default["default"].createElement("div", { style: o.id == selection
53248
+ ? __assign(__assign({}, childOverlayStyle), selectedStyle) : childOverlayStyle, key: o.id, tabIndex: 0, role: 'button', onClick: function (e) {
53243
53249
  onSelect(o);
53250
+ setSelection(o.id);
53244
53251
  } },
53245
53252
  o.icon && React__default["default"].createElement("span", { style: { marginRight: '5px' } }, o.icon),
53246
53253
  o.label));
53247
53254
  default:
53248
- return (React__default["default"].createElement(Button, { style: childOverlayStyle, key: o.id, onClick: function (e) {
53249
- e.stopPropagation();
53255
+ return (React__default["default"].createElement(Button, { style: o.id == selection
53256
+ ? __assign(__assign({}, childOverlayStyle), selectedStyle) : childOverlayStyle, key: o.id, onClick: function (e) {
53250
53257
  onSelect(o);
53258
+ setSelection(o.id);
53251
53259
  } },
53252
53260
  o.icon,
53253
53261
  o.label));
53254
53262
  }
53255
- }, []);
53263
+ }, [selection]);
53256
53264
  return (React__default["default"].createElement("div", null,
53257
53265
  React__default["default"].createElement("div", { style: { display: 'flex' } },
53258
53266
  children,
53259
- React__default["default"].createElement(Dropdown$1, { trigger: [action], overlayStyle: overlayStyle, placement: placement, animation: 'slide-up',
53267
+ React__default["default"].createElement(Dropdown$1, { trigger: [action], overlayStyle: overlayStyle, placement: placement, animation: 'slide-up', onOverlayClick: function (e) { return e.stopPropagation(); },
53260
53268
  // @ts-ignore
53261
53269
  overlay: options && options.map(renderItem) },
53262
53270
  React__default["default"].createElement("button", { disabled: disabled, className: 'poll-button', style: triggerStyle, onClick: function (e) { return e.stopPropagation(); } }, icon)))));
@@ -53356,23 +53364,18 @@ var SendGeometry = function (_a) {
53356
53364
  clear: "Clear geometry from the ".concat(host, " viewport"),
53357
53365
  'subscribe-preview': "Render geometry in the ".concat(host, " viewport"),
53358
53366
  };
53359
- return React__default["default"].createElement(BaseDropdown, { icon: React__default["default"].createElement(Logo, { size: 18 }), childOverlayStyle: {
53367
+ return React__default["default"].createElement(BaseDropdown, { childOverlayStyle: {
53360
53368
  width: 'auto',
53361
53369
  backgroundColor: 'white',
53362
- color: 'black',
53370
+ color: '#393e46',
53363
53371
  fontSize: '14px',
53364
53372
  padding: '10px',
53365
53373
  cursor: 'pointer'
53366
- }, triggerStyle: {
53367
- backgroundColor: 'white',
53368
- color: 'black',
53369
- border: 'solid 1px #000'
53370
- }, disabled: disabled, action: 'hover', onSelect: onSelect, options: values },
53374
+ }, placement: 'bottomRight', activeId: defaultAction, disabled: disabled, action: 'hover', onSelect: onSelect, options: values },
53371
53375
  React__default["default"].createElement(Button, { title: helpTextButton[currOption === null || currOption === void 0 ? void 0 : currOption.id], disabled: disabled, style: {
53372
- backgroundColor: 'white',
53373
- color: 'black',
53376
+ width: '100%',
53374
53377
  fontSize: '14px',
53375
- border: 'solid 1px #000'
53378
+ border: 'solid 1px #fff'
53376
53379
  }, onClick: function (e) {
53377
53380
  e.stopPropagation();
53378
53381
  if (disabled)
@@ -53493,23 +53496,18 @@ var SendModel = function (_a) {
53493
53496
  replace: "Replace the model in the ".concat(host, " viewport"),
53494
53497
  'subscribe-preview': "Render the model in the ".concat(host, " viewport"),
53495
53498
  };
53496
- return React__default["default"].createElement(BaseDropdown, { icon: React__default["default"].createElement(Logo, { size: 18 }), childOverlayStyle: {
53499
+ return React__default["default"].createElement(BaseDropdown, { childOverlayStyle: {
53497
53500
  width: 'auto',
53498
53501
  backgroundColor: 'white',
53499
- color: 'black',
53502
+ color: '#393e46',
53500
53503
  fontSize: '14px',
53501
53504
  padding: '10px',
53502
53505
  cursor: 'pointer'
53503
- }, triggerStyle: {
53504
- backgroundColor: 'white',
53505
- color: 'black',
53506
- border: 'solid 1px #000'
53507
- }, disabled: disabled, onSelect: onSelect, action: 'hover', options: values },
53506
+ }, placement: 'bottomRight', activeId: defaultAction, disabled: disabled, onSelect: onSelect, action: 'hover', options: values },
53508
53507
  React__default["default"].createElement(Button, { title: helpTextButton[currOption === null || currOption === void 0 ? void 0 : currOption.id], disabled: disabled, style: {
53509
- backgroundColor: 'white',
53510
- color: 'black',
53508
+ width: '100%',
53511
53509
  fontSize: '14px',
53512
- border: 'solid 1px #000'
53510
+ border: 'solid 1px #fff'
53513
53511
  }, onClick: function (e) {
53514
53512
  e.stopPropagation();
53515
53513
  if (disabled)
@@ -53628,23 +53626,18 @@ var SendResults = function (_a) {
53628
53626
  clear: "Clear results from the ".concat(host, " viewport"),
53629
53627
  'subscribe-preview': "Render results in the ".concat(host, " viewport"),
53630
53628
  };
53631
- return React__default["default"].createElement(BaseDropdown, { icon: React__default["default"].createElement(Logo, { size: 18 }), childOverlayStyle: {
53629
+ return React__default["default"].createElement(BaseDropdown, { childOverlayStyle: {
53632
53630
  width: 'auto',
53633
53631
  backgroundColor: 'white',
53634
- color: 'black',
53632
+ color: '#393e46',
53635
53633
  fontSize: '14px',
53636
53634
  padding: '10px',
53637
53635
  cursor: 'pointer'
53638
- }, triggerStyle: {
53639
- backgroundColor: 'white',
53640
- color: 'black',
53641
- border: 'solid 1px #000'
53642
- }, action: 'hover', disabled: disabled, onSelect: onSelect, options: values },
53636
+ }, placement: 'bottomRight', activeId: defaultAction, action: 'hover', disabled: disabled, onSelect: onSelect, options: values },
53643
53637
  React__default["default"].createElement(Button, { title: helpTextButton[currOption === null || currOption === void 0 ? void 0 : currOption.id], disabled: disabled, style: {
53644
- backgroundColor: 'white',
53645
- color: 'black',
53638
+ width: '100%',
53646
53639
  fontSize: '14px',
53647
- border: 'solid 1px #000'
53640
+ border: 'solid 1px #fff'
53648
53641
  }, onClick: function (e) {
53649
53642
  e.stopPropagation();
53650
53643
  if (disabled)
@@ -56085,7 +56078,7 @@ var FileCard = function (_a) {
56085
56078
  add: true,
56086
56079
  delete: false,
56087
56080
  'subscribe-preview': false,
56088
- clear: true,
56081
+ clear: false,
56089
56082
  preview: true,
56090
56083
  replace: true,
56091
56084
  }, key: CADdata.id, defaultKey: CADdata.id }),
@@ -56095,7 +56088,7 @@ var FileCard = function (_a) {
56095
56088
  add: true,
56096
56089
  delete: (host === 'revit'),
56097
56090
  'subscribe-preview': false,
56098
- clear: (host !== 'revit'),
56091
+ clear: false,
56099
56092
  preview: (host !== 'revit')
56100
56093
  }, key: CADdata.id, defaultKey: CADdata.id })),
56101
56094
  open && React__default["default"].createElement("div", { className: 'card-description' }, description));