@fileverse-dev/fortune-react 1.0.2-mod-42 → 1.0.2-mod-44

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/index.js CHANGED
@@ -2035,8 +2035,8 @@ var LinkEditCard = function LinkEditCard(_ref) {
2035
2035
  }, /*#__PURE__*/React__default['default'].createElement(SVGIcon, {
2036
2036
  name: iconId,
2037
2037
  style: {
2038
- width: 18,
2039
- height: 18
2038
+ width: 16,
2039
+ height: 16
2040
2040
  }
2041
2041
  }));
2042
2042
  }, []);
@@ -2133,7 +2133,9 @@ var LinkEditCard = function LinkEditCard(_ref) {
2133
2133
  }, /*#__PURE__*/React__default['default'].createElement("div", {
2134
2134
  className: "input-icon"
2135
2135
  }, /*#__PURE__*/React__default['default'].createElement(SVGIcon, {
2136
- name: "link"
2136
+ name: "link",
2137
+ width: 16,
2138
+ height: 16
2137
2139
  })), /*#__PURE__*/React__default['default'].createElement(ui.TextField, {
2138
2140
  placeholder: "Paste URL",
2139
2141
  value: linkAddress,
@@ -2146,7 +2148,9 @@ var LinkEditCard = function LinkEditCard(_ref) {
2146
2148
  }, /*#__PURE__*/React__default['default'].createElement("div", {
2147
2149
  className: "input-icon"
2148
2150
  }, /*#__PURE__*/React__default['default'].createElement(SVGIcon, {
2149
- name: "link"
2151
+ name: "link",
2152
+ width: 16,
2153
+ height: 16
2150
2154
  })), /*#__PURE__*/React__default['default'].createElement(ui.Select, {
2151
2155
  onValueChange: function onValueChange(value) {
2152
2156
  if (!linkText) setLinkText(value);
@@ -4408,7 +4412,8 @@ var Button = function Button(_ref) {
4408
4412
  iconId = _ref.iconId,
4409
4413
  disabled = _ref.disabled,
4410
4414
  selected = _ref.selected,
4411
- children = _ref.children;
4415
+ children = _ref.children,
4416
+ style = _ref.style;
4412
4417
  return /*#__PURE__*/React__default['default'].createElement("div", {
4413
4418
  className: "fortune-toolbar-button fortune-toolbar-item",
4414
4419
  onClick: onClick,
@@ -4418,9 +4423,11 @@ var Button = function Button(_ref) {
4418
4423
  "aria-label": tooltip,
4419
4424
  style: selected ? {
4420
4425
  backgroundColor: "#E7E5EB"
4421
- } : {}
4426
+ } : style
4422
4427
  }, /*#__PURE__*/React__default['default'].createElement(SVGIcon, {
4423
4428
  name: iconId,
4429
+ width: 16,
4430
+ height: 16,
4424
4431
  style: disabled ? {
4425
4432
  opacity: 0.3
4426
4433
  } : {}
@@ -4509,7 +4516,9 @@ var Combo = function Combo(_ref) {
4509
4516
  "aria-label": "".concat(tooltip, ": ").concat(text !== undefined ? text : ""),
4510
4517
  style: style
4511
4518
  }, iconId ? (/*#__PURE__*/React__default['default'].createElement(SVGIcon, {
4512
- name: iconId
4519
+ name: iconId,
4520
+ width: 16,
4521
+ height: 16
4513
4522
  })) : (/*#__PURE__*/React__default['default'].createElement("span", {
4514
4523
  className: "fortune-toolbar-combo-text"
4515
4524
  }, text !== undefined ? text : "")))) : (/*#__PURE__*/React__default['default'].createElement(ui.IconButton, {
@@ -5225,6 +5234,8 @@ var CustomButton = function CustomButton(_ref) {
5225
5234
  backgroundColor: "#E7E5EB"
5226
5235
  } : {}
5227
5236
  }, /*#__PURE__*/React__default['default'].createElement(CustomIcon, {
5237
+ width: 16,
5238
+ height: 16,
5228
5239
  iconName: iconName,
5229
5240
  content: icon
5230
5241
  }), tooltip && /*#__PURE__*/React__default['default'].createElement("div", {
@@ -5527,7 +5538,7 @@ var getIcon = function getIcon(title) {
5527
5538
  case "align-middle":
5528
5539
  return "AlignVerticalMiddle";
5529
5540
  case "align-bottom":
5530
- return "ArrowDownFromLine";
5541
+ return "ArrowDownToLine";
5531
5542
  case "text-overflow":
5532
5543
  return "TextOverflow";
5533
5544
  case "text-wrap":
@@ -5650,9 +5661,11 @@ var Toolbar = function Toolbar(_ref) {
5650
5661
  var container = containerRef.current;
5651
5662
  if (!container) return;
5652
5663
  var moreButtonWidth = 50;
5664
+ var containerWidth = container.getBoundingClientRect().width;
5665
+ var availableWidth = containerWidth - 30;
5653
5666
  for (var i = itemLocations.length - 1; i >= 0; i -= 1) {
5654
5667
  var loc = itemLocations[i];
5655
- if (loc + moreButtonWidth < container.clientWidth) {
5668
+ if (loc + moreButtonWidth < availableWidth) {
5656
5669
  setToolbarWrapIndex(i - itemLocations.length + settings.toolbarItems.length);
5657
5670
  if (i === itemLocations.length - 1) {
5658
5671
  setMoreItems(null);
@@ -5756,7 +5769,8 @@ var Toolbar = function Toolbar(_ref) {
5756
5769
  className: "fortune-toolbar-menu-line"
5757
5770
  }, /*#__PURE__*/React__default['default'].createElement("div", null, text), /*#__PURE__*/React__default['default'].createElement(SVGIcon, {
5758
5771
  name: "rightArrow",
5759
- width: 14
5772
+ width: 16,
5773
+ height: 16
5760
5774
  })), /*#__PURE__*/React__default['default'].createElement("div", {
5761
5775
  className: "more-format toolbar-item-sub-menu fortune-toolbar-select",
5762
5776
  style: {
@@ -6327,16 +6341,20 @@ var Toolbar = function Toolbar(_ref) {
6327
6341
  if (name === "merge-cell") {
6328
6342
  var itemdata = [{
6329
6343
  text: merge.mergeAll,
6330
- value: "merge-all"
6344
+ value: "merge-all",
6345
+ icon: "MergeAll"
6331
6346
  }, {
6332
6347
  text: merge.mergeV,
6333
- value: "merge-vertical"
6348
+ value: "merge-vertical",
6349
+ icon: "MergeVertical"
6334
6350
  }, {
6335
6351
  text: merge.mergeH,
6336
- value: "merge-horizontal"
6352
+ value: "merge-horizontal",
6353
+ icon: "MergeHorizontal"
6337
6354
  }, {
6338
6355
  text: merge.mergeCancel,
6339
- value: "merge-cancel"
6356
+ value: "merge-cancel",
6357
+ icon: "Unmerge"
6340
6358
  }];
6341
6359
  return /*#__PURE__*/React__default['default'].createElement(Combo, {
6342
6360
  iconId: "merge-all",
@@ -6351,7 +6369,8 @@ var Toolbar = function Toolbar(_ref) {
6351
6369
  }, function (setOpen) {
6352
6370
  return /*#__PURE__*/React__default['default'].createElement(Select, null, itemdata.map(function (_ref8) {
6353
6371
  var text = _ref8.text,
6354
- value = _ref8.value;
6372
+ value = _ref8.value,
6373
+ icon = _ref8.icon;
6355
6374
  return /*#__PURE__*/React__default['default'].createElement(Option, {
6356
6375
  key: value,
6357
6376
  onClick: function onClick() {
@@ -6366,8 +6385,10 @@ var Toolbar = function Toolbar(_ref) {
6366
6385
  alignItems: "center",
6367
6386
  gap: 6
6368
6387
  }
6369
- }, /*#__PURE__*/React__default['default'].createElement(SVGIcon, {
6370
- name: value
6388
+ }, /*#__PURE__*/React__default['default'].createElement(ui.LucideIcon, {
6389
+ name: icon,
6390
+ width: 16,
6391
+ height: 16
6371
6392
  }), text));
6372
6393
  }));
6373
6394
  });
@@ -6375,37 +6396,44 @@ var Toolbar = function Toolbar(_ref) {
6375
6396
  if (name === "border") {
6376
6397
  var _items4 = [{
6377
6398
  text: border.borderTop,
6378
- value: "border-top"
6399
+ value: "border-top",
6400
+ icon: "BorderTop"
6379
6401
  }, {
6380
6402
  text: border.borderBottom,
6381
- value: "border-bottom"
6403
+ value: "border-bottom",
6404
+ icon: "BorderBottom"
6382
6405
  }, {
6383
6406
  text: border.borderLeft,
6384
- value: "border-left"
6407
+ value: "border-left",
6408
+ icon: "BorderLeft"
6385
6409
  }, {
6386
6410
  text: border.borderRight,
6387
- value: "border-right"
6411
+ value: "border-right",
6412
+ icon: "BorderRight"
6388
6413
  }, {
6389
6414
  text: border.borderNone,
6390
- value: "border-none"
6415
+ value: "border-none",
6416
+ icon: "NoBorder"
6391
6417
  }, {
6392
6418
  text: border.borderAll,
6393
- value: "border-all"
6419
+ value: "border-all",
6420
+ icon: "Border"
6394
6421
  }, {
6395
6422
  text: border.borderOutside,
6396
- value: "border-outside"
6423
+ value: "border-outside",
6424
+ icon: "BorderOutside"
6397
6425
  }, {
6398
6426
  text: border.borderInside,
6399
- value: "border-inside"
6427
+ value: "border-inside",
6428
+ icon: "BorderInside"
6400
6429
  }, {
6401
6430
  text: border.borderHorizontal,
6402
- value: "border-horizontal"
6431
+ value: "border-horizontal",
6432
+ icon: "BorderHorizontal"
6403
6433
  }, {
6404
6434
  text: border.borderVertical,
6405
- value: "border-vertical"
6406
- }, {
6407
- text: border.borderSlash,
6408
- value: "border-slash"
6435
+ value: "border-vertical",
6436
+ icon: "BorderVertical"
6409
6437
  }];
6410
6438
  return /*#__PURE__*/React__default['default'].createElement(Combo, {
6411
6439
  iconId: "border-all",
@@ -6422,7 +6450,8 @@ var Toolbar = function Toolbar(_ref) {
6422
6450
  return /*#__PURE__*/React__default['default'].createElement("div", {
6423
6451
  className: "fortune-toolbar-select fortune-border-grid"
6424
6452
  }, _items4.map(function (_ref9) {
6425
- var value = _ref9.value;
6453
+ var value = _ref9.value,
6454
+ icon = _ref9.icon;
6426
6455
  return /*#__PURE__*/React__default['default'].createElement("div", {
6427
6456
  key: value,
6428
6457
  className: "fortune-border-grid-item",
@@ -6432,8 +6461,10 @@ var Toolbar = function Toolbar(_ref) {
6432
6461
  });
6433
6462
  setOpen(false);
6434
6463
  }
6435
- }, /*#__PURE__*/React__default['default'].createElement(SVGIcon, {
6436
- name: value
6464
+ }, /*#__PURE__*/React__default['default'].createElement(ui.LucideIcon, {
6465
+ name: icon,
6466
+ width: 16,
6467
+ height: 16
6437
6468
  }));
6438
6469
  }));
6439
6470
  });
@@ -6477,7 +6508,9 @@ var Toolbar = function Toolbar(_ref) {
6477
6508
  }, /*#__PURE__*/React__default['default'].createElement("div", {
6478
6509
  className: "fortune-toolbar-menu-line"
6479
6510
  }, text, /*#__PURE__*/React__default['default'].createElement(SVGIcon, {
6480
- name: value
6511
+ name: value,
6512
+ width: 16,
6513
+ height: 16
6481
6514
  })));
6482
6515
  }));
6483
6516
  });
@@ -6589,7 +6622,9 @@ var Toolbar = function Toolbar(_ref) {
6589
6622
  }, /*#__PURE__*/React__default['default'].createElement("div", {
6590
6623
  className: "fortune-toolbar-menu-line"
6591
6624
  }, text, /*#__PURE__*/React__default['default'].createElement(SVGIcon, {
6592
- name: iconId
6625
+ name: iconId,
6626
+ width: 16,
6627
+ height: 16
6593
6628
  })));
6594
6629
  }));
6595
6630
  });
@@ -6663,8 +6698,8 @@ var Toolbar = function Toolbar(_ref) {
6663
6698
  }
6664
6699
  }, /*#__PURE__*/React__default['default'].createElement(SVGIcon, {
6665
6700
  name: iconId,
6666
- width: 24,
6667
- height: 18
6701
+ width: 16,
6702
+ height: 16
6668
6703
  }), text))) : (/*#__PURE__*/React__default['default'].createElement(MenuDivider, {
6669
6704
  key: "divider-".concat(index)
6670
6705
  }));
@@ -6688,6 +6723,8 @@ var Toolbar = function Toolbar(_ref) {
6688
6723
  ref: containerRef,
6689
6724
  className: "fortune-toolbar",
6690
6725
  "aria-label": toolbar.toolbar
6726
+ }, /*#__PURE__*/React__default['default'].createElement("div", {
6727
+ className: "fortune-toolbar-left"
6691
6728
  }, settings.customToolbarItems.filter(function (n) {
6692
6729
  return n.key === "import-export";
6693
6730
  }).map(function (n) {
@@ -6714,9 +6751,9 @@ var Toolbar = function Toolbar(_ref) {
6714
6751
  }));
6715
6752
  }
6716
6753
  }
6717
- })) : null, /*#__PURE__*/React__default['default'].createElement(Divider, {
6718
- key: "templateDivider"
6719
- }), settings.customToolbarItems.filter(function (n) {
6754
+ })) : null), /*#__PURE__*/React__default['default'].createElement("div", {
6755
+ className: "fortune-toolbar-right"
6756
+ }, settings.customToolbarItems.filter(function (n) {
6720
6757
  return n.key === "templates";
6721
6758
  }).map(function (n) {
6722
6759
  return /*#__PURE__*/React__default['default'].createElement(CustomButton, {
@@ -6726,8 +6763,6 @@ var Toolbar = function Toolbar(_ref) {
6726
6763
  icon: n.icon,
6727
6764
  iconName: n.iconName
6728
6765
  }, n.children);
6729
- }), /*#__PURE__*/React__default['default'].createElement(Divider, {
6730
- key: "customDivider"
6731
6766
  }), settings.customToolbarItems.filter(function (n) {
6732
6767
  return n.key !== "templates" && n.key !== "import-export";
6733
6768
  }).map(function (n) {
@@ -6745,6 +6780,10 @@ var Toolbar = function Toolbar(_ref) {
6745
6780
  onClick: function onClick() {
6746
6781
  if (context.allowEdit === false) return;
6747
6782
  setShowDuneModal(true);
6783
+ },
6784
+ style: {
6785
+ backgroundColor: "#F4603E2E",
6786
+ borderRadius: "8px"
6748
6787
  }
6749
6788
  }), showDuneModal && (/*#__PURE__*/React__default['default'].createElement(DuneChartsInputModal, {
6750
6789
  isOpen: showDuneModal,
@@ -6760,7 +6799,7 @@ var Toolbar = function Toolbar(_ref) {
6760
6799
  icon: "dune-logo",
6761
6800
  placeholder: "Add Dune chart link to embed",
6762
6801
  submitText: "Embed Dune chart"
6763
- })));
6802
+ }))));
6764
6803
  };
6765
6804
 
6766
6805
  var LocationBox = function LocationBox() {
@@ -7503,8 +7542,8 @@ var ContextMenu = function ContextMenu() {
7503
7542
  className: "context-item"
7504
7543
  }, /*#__PURE__*/React__default['default'].createElement(SVGIcon, {
7505
7544
  name: "freeze-flv",
7506
- width: 18,
7507
- height: 18,
7545
+ width: 16,
7546
+ height: 16,
7508
7547
  style: {
7509
7548
  marginTop: "4px",
7510
7549
  marginRight: "4px"
@@ -8175,10 +8214,12 @@ var ContextMenu = function ContextMenu() {
8175
8214
  className: "flex items-center gap-2"
8176
8215
  }, /*#__PURE__*/React__default['default'].createElement(SVGIcon, {
8177
8216
  name: "conditionFormat",
8178
- width: 18
8217
+ width: 16,
8218
+ height: 16
8179
8219
  }), /*#__PURE__*/React__default['default'].createElement("p", null, rightclick.conditionFormat || "Conditional Format")), /*#__PURE__*/React__default['default'].createElement(SVGIcon, {
8180
8220
  name: "rightArrow",
8181
- width: 18
8221
+ width: 16,
8222
+ height: 16
8182
8223
  })))));
8183
8224
  }
8184
8225
  return null;
@@ -2254,6 +2254,7 @@ input[type="number"].condition-rules-project-input {
2254
2254
  border-bottom: 1px solid #d4d4d4;
2255
2255
  white-space: nowrap;
2256
2256
  align-items: center;
2257
+ gap: 4px;
2257
2258
  }
2258
2259
 
2259
2260
  .fortune-toolbar-divider {
@@ -2289,13 +2290,21 @@ input[type="number"].condition-rules-project-input {
2289
2290
  user-select: none;
2290
2291
  background: 0;
2291
2292
  outline: none;
2292
- padding: 0;
2293
+ padding: 2px;
2293
2294
  list-style: none;
2294
2295
  text-decoration: none;
2295
2296
  display: flex;
2297
+ justify-content: center;
2296
2298
  align-items: center;
2297
- padding: 2px;
2298
- margin: 2px 8px;
2299
+ min-width: 30px;
2300
+ height: 30px;
2301
+ margin: 0;
2302
+ }
2303
+
2304
+ .fortune-toolbar-button svg,
2305
+ .fortune-toolbar-combo svg {
2306
+ width: 16px !important;
2307
+ height: 16px !important;
2299
2308
  }
2300
2309
 
2301
2310
  .fortune-toolbar-combo-button,
@@ -2306,12 +2315,12 @@ input[type="number"].condition-rules-project-input {
2306
2315
 
2307
2316
  .fortune-toolbar-button:hover,
2308
2317
  .fortune-toolbar-combo:hover {
2309
- background-color: rgba(0, 0, 0, 0.06);
2318
+ background-color: #f2f4f5;
2310
2319
  cursor: pointer;
2311
2320
  }
2312
2321
 
2313
2322
  .fortune-toolbar-combo-arrow:hover {
2314
- background-color: rgba(0, 0, 0, 0.06);
2323
+ background-color: #f2f4f5;
2315
2324
  cursor: pointer;
2316
2325
  }
2317
2326
 
@@ -2385,6 +2394,7 @@ input[type="number"].condition-rules-project-input {
2385
2394
  margin: 0 4px;
2386
2395
  font-weight: 500;
2387
2396
  font-size: 14px;
2397
+ line-height: 20px;
2388
2398
  }
2389
2399
 
2390
2400
  .fortune-toolbar-color-picker-item {
@@ -2592,6 +2602,20 @@ input[type="number"].condition-rules-project-input {
2592
2602
  background-color: hsl(var(--color-bg-default-hover));
2593
2603
  }
2594
2604
 
2605
+ .fortune-toolbar-left {
2606
+ display: flex;
2607
+ flex-direction: row;
2608
+ align-items: center;
2609
+ gap: 4px;
2610
+ }
2611
+
2612
+ .fortune-toolbar-right {
2613
+ display: flex;
2614
+ flex-direction: row;
2615
+ align-items: center;
2616
+ gap: 4px;
2617
+ }
2618
+
2595
2619
  #fortune-split-column {
2596
2620
  /* position: absolute;
2597
2621
  padding: 30px 42px;
@@ -2791,7 +2815,7 @@ label {
2791
2815
 
2792
2816
  .input-modal {
2793
2817
  position: fixed;
2794
- top: 25%;
2818
+ top: 16%;
2795
2819
  left: 50%;
2796
2820
  transform: translateX(-50%);
2797
2821
  border-radius: 0.75rem;