@fileverse-dev/fortune-react 1.0.2-mod-41-patch-1 → 1.0.2-mod-43

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,6 +1,6 @@
1
1
  import React from "react";
2
2
  import "./index.css";
3
- export declare const getIcon: (title: string) => "AlignLeft" | "AlignCenter" | "AlignRight" | "ArrowUpFromLine" | "AlignVerticalMiddle" | "ArrowDownFromLine" | "TextOverflow" | "WrapText" | "TextClip" | "";
3
+ export declare const getIcon: (title: string) => "AlignLeft" | "AlignCenter" | "AlignRight" | "ArrowUpFromLine" | "AlignVerticalMiddle" | "ArrowDownToLine" | "TextOverflow" | "WrapText" | "TextClip" | "";
4
4
  declare const Toolbar: React.FC<{
5
5
  setMoreItems: React.Dispatch<React.SetStateAction<React.ReactNode>>;
6
6
  moreItemsOpen: boolean;
package/dist/index.css CHANGED
@@ -2254,6 +2254,8 @@ 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
+ flex-wrap: wrap;
2258
+ gap: 4px;
2257
2259
  }
2258
2260
 
2259
2261
  .fortune-toolbar-divider {
@@ -2289,13 +2291,21 @@ input[type="number"].condition-rules-project-input {
2289
2291
  user-select: none;
2290
2292
  background: 0;
2291
2293
  outline: none;
2292
- padding: 0;
2294
+ padding: 2px;
2293
2295
  list-style: none;
2294
2296
  text-decoration: none;
2295
2297
  display: flex;
2298
+ justify-content: center;
2296
2299
  align-items: center;
2297
- padding: 2px;
2298
- margin: 2px 8px;
2300
+ min-width: 30px;
2301
+ height: 30px;
2302
+ margin: 0;
2303
+ }
2304
+
2305
+ .fortune-toolbar-button svg,
2306
+ .fortune-toolbar-combo svg {
2307
+ width: 16px !important;
2308
+ height: 16px !important;
2299
2309
  }
2300
2310
 
2301
2311
  .fortune-toolbar-combo-button,
@@ -2306,12 +2316,12 @@ input[type="number"].condition-rules-project-input {
2306
2316
 
2307
2317
  .fortune-toolbar-button:hover,
2308
2318
  .fortune-toolbar-combo:hover {
2309
- background-color: rgba(0, 0, 0, 0.06);
2319
+ background-color: #f2f4f5;
2310
2320
  cursor: pointer;
2311
2321
  }
2312
2322
 
2313
2323
  .fortune-toolbar-combo-arrow:hover {
2314
- background-color: rgba(0, 0, 0, 0.06);
2324
+ background-color: #f2f4f5;
2315
2325
  cursor: pointer;
2316
2326
  }
2317
2327
 
@@ -2385,6 +2395,7 @@ input[type="number"].condition-rules-project-input {
2385
2395
  margin: 0 4px;
2386
2396
  font-weight: 500;
2387
2397
  font-size: 14px;
2398
+ line-height: 20px;
2388
2399
  }
2389
2400
 
2390
2401
  .fortune-toolbar-color-picker-item {
@@ -2592,6 +2603,20 @@ input[type="number"].condition-rules-project-input {
2592
2603
  background-color: hsl(var(--color-bg-default-hover));
2593
2604
  }
2594
2605
 
2606
+ .fortune-toolbar-left {
2607
+ display: flex;
2608
+ flex-direction: row;
2609
+ align-items: center;
2610
+ gap: 4px;
2611
+ }
2612
+
2613
+ .fortune-toolbar-right {
2614
+ display: flex;
2615
+ flex-direction: row;
2616
+ align-items: center;
2617
+ gap: 4px;
2618
+ }
2619
+
2595
2620
  #fortune-split-column {
2596
2621
  /* position: absolute;
2597
2622
  padding: 30px 42px;
@@ -2254,6 +2254,8 @@ 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
+ flex-wrap: wrap;
2258
+ gap: 4px;
2257
2259
  }
2258
2260
 
2259
2261
  .fortune-toolbar-divider {
@@ -2289,13 +2291,21 @@ input[type="number"].condition-rules-project-input {
2289
2291
  user-select: none;
2290
2292
  background: 0;
2291
2293
  outline: none;
2292
- padding: 0;
2294
+ padding: 2px;
2293
2295
  list-style: none;
2294
2296
  text-decoration: none;
2295
2297
  display: flex;
2298
+ justify-content: center;
2296
2299
  align-items: center;
2297
- padding: 2px;
2298
- margin: 2px 8px;
2300
+ min-width: 30px;
2301
+ height: 30px;
2302
+ margin: 0;
2303
+ }
2304
+
2305
+ .fortune-toolbar-button svg,
2306
+ .fortune-toolbar-combo svg {
2307
+ width: 16px !important;
2308
+ height: 16px !important;
2299
2309
  }
2300
2310
 
2301
2311
  .fortune-toolbar-combo-button,
@@ -2306,12 +2316,12 @@ input[type="number"].condition-rules-project-input {
2306
2316
 
2307
2317
  .fortune-toolbar-button:hover,
2308
2318
  .fortune-toolbar-combo:hover {
2309
- background-color: rgba(0, 0, 0, 0.06);
2319
+ background-color: #f2f4f5;
2310
2320
  cursor: pointer;
2311
2321
  }
2312
2322
 
2313
2323
  .fortune-toolbar-combo-arrow:hover {
2314
- background-color: rgba(0, 0, 0, 0.06);
2324
+ background-color: #f2f4f5;
2315
2325
  cursor: pointer;
2316
2326
  }
2317
2327
 
@@ -2385,6 +2395,7 @@ input[type="number"].condition-rules-project-input {
2385
2395
  margin: 0 4px;
2386
2396
  font-weight: 500;
2387
2397
  font-size: 14px;
2398
+ line-height: 20px;
2388
2399
  }
2389
2400
 
2390
2401
  .fortune-toolbar-color-picker-item {
@@ -2592,6 +2603,20 @@ input[type="number"].condition-rules-project-input {
2592
2603
  background-color: hsl(var(--color-bg-default-hover));
2593
2604
  }
2594
2605
 
2606
+ .fortune-toolbar-left {
2607
+ display: flex;
2608
+ flex-direction: row;
2609
+ align-items: center;
2610
+ gap: 4px;
2611
+ }
2612
+
2613
+ .fortune-toolbar-right {
2614
+ display: flex;
2615
+ flex-direction: row;
2616
+ align-items: center;
2617
+ gap: 4px;
2618
+ }
2619
+
2595
2620
  #fortune-split-column {
2596
2621
  /* position: absolute;
2597
2622
  padding: 30px 42px;
package/dist/index.esm.js CHANGED
@@ -2023,8 +2023,8 @@ var LinkEditCard = function LinkEditCard(_ref) {
2023
2023
  }, /*#__PURE__*/React.createElement(SVGIcon, {
2024
2024
  name: iconId,
2025
2025
  style: {
2026
- width: 18,
2027
- height: 18
2026
+ width: 16,
2027
+ height: 16
2028
2028
  }
2029
2029
  }));
2030
2030
  }, []);
@@ -2121,7 +2121,9 @@ var LinkEditCard = function LinkEditCard(_ref) {
2121
2121
  }, /*#__PURE__*/React.createElement("div", {
2122
2122
  className: "input-icon"
2123
2123
  }, /*#__PURE__*/React.createElement(SVGIcon, {
2124
- name: "link"
2124
+ name: "link",
2125
+ width: 16,
2126
+ height: 16
2125
2127
  })), /*#__PURE__*/React.createElement(TextField, {
2126
2128
  placeholder: "Paste URL",
2127
2129
  value: linkAddress,
@@ -2134,7 +2136,9 @@ var LinkEditCard = function LinkEditCard(_ref) {
2134
2136
  }, /*#__PURE__*/React.createElement("div", {
2135
2137
  className: "input-icon"
2136
2138
  }, /*#__PURE__*/React.createElement(SVGIcon, {
2137
- name: "link"
2139
+ name: "link",
2140
+ width: 16,
2141
+ height: 16
2138
2142
  })), /*#__PURE__*/React.createElement(Select$1, {
2139
2143
  onValueChange: function onValueChange(value) {
2140
2144
  if (!linkText) setLinkText(value);
@@ -4409,6 +4413,8 @@ var Button = function Button(_ref) {
4409
4413
  } : {}
4410
4414
  }, /*#__PURE__*/React.createElement(SVGIcon, {
4411
4415
  name: iconId,
4416
+ width: 16,
4417
+ height: 16,
4412
4418
  style: disabled ? {
4413
4419
  opacity: 0.3
4414
4420
  } : {}
@@ -4497,7 +4503,9 @@ var Combo = function Combo(_ref) {
4497
4503
  "aria-label": "".concat(tooltip, ": ").concat(text !== undefined ? text : ""),
4498
4504
  style: style
4499
4505
  }, iconId ? (/*#__PURE__*/React.createElement(SVGIcon, {
4500
- name: iconId
4506
+ name: iconId,
4507
+ width: 16,
4508
+ height: 16
4501
4509
  })) : (/*#__PURE__*/React.createElement("span", {
4502
4510
  className: "fortune-toolbar-combo-text"
4503
4511
  }, text !== undefined ? text : "")))) : (/*#__PURE__*/React.createElement(IconButton, {
@@ -5213,6 +5221,8 @@ var CustomButton = function CustomButton(_ref) {
5213
5221
  backgroundColor: "#E7E5EB"
5214
5222
  } : {}
5215
5223
  }, /*#__PURE__*/React.createElement(CustomIcon, {
5224
+ width: 16,
5225
+ height: 16,
5216
5226
  iconName: iconName,
5217
5227
  content: icon
5218
5228
  }), tooltip && /*#__PURE__*/React.createElement("div", {
@@ -5515,7 +5525,7 @@ var getIcon = function getIcon(title) {
5515
5525
  case "align-middle":
5516
5526
  return "AlignVerticalMiddle";
5517
5527
  case "align-bottom":
5518
- return "ArrowDownFromLine";
5528
+ return "ArrowDownToLine";
5519
5529
  case "text-overflow":
5520
5530
  return "TextOverflow";
5521
5531
  case "text-wrap":
@@ -5638,9 +5648,11 @@ var Toolbar = function Toolbar(_ref) {
5638
5648
  var container = containerRef.current;
5639
5649
  if (!container) return;
5640
5650
  var moreButtonWidth = 50;
5651
+ var containerWidth = container.getBoundingClientRect().width;
5652
+ var availableWidth = containerWidth - 30;
5641
5653
  for (var i = itemLocations.length - 1; i >= 0; i -= 1) {
5642
5654
  var loc = itemLocations[i];
5643
- if (loc + moreButtonWidth < container.clientWidth) {
5655
+ if (loc + moreButtonWidth < availableWidth) {
5644
5656
  setToolbarWrapIndex(i - itemLocations.length + settings.toolbarItems.length);
5645
5657
  if (i === itemLocations.length - 1) {
5646
5658
  setMoreItems(null);
@@ -5744,7 +5756,8 @@ var Toolbar = function Toolbar(_ref) {
5744
5756
  className: "fortune-toolbar-menu-line"
5745
5757
  }, /*#__PURE__*/React.createElement("div", null, text), /*#__PURE__*/React.createElement(SVGIcon, {
5746
5758
  name: "rightArrow",
5747
- width: 14
5759
+ width: 16,
5760
+ height: 16
5748
5761
  })), /*#__PURE__*/React.createElement("div", {
5749
5762
  className: "more-format toolbar-item-sub-menu fortune-toolbar-select",
5750
5763
  style: {
@@ -6315,16 +6328,20 @@ var Toolbar = function Toolbar(_ref) {
6315
6328
  if (name === "merge-cell") {
6316
6329
  var itemdata = [{
6317
6330
  text: merge.mergeAll,
6318
- value: "merge-all"
6331
+ value: "merge-all",
6332
+ icon: "MergeAll"
6319
6333
  }, {
6320
6334
  text: merge.mergeV,
6321
- value: "merge-vertical"
6335
+ value: "merge-vertical",
6336
+ icon: "MergeVertical"
6322
6337
  }, {
6323
6338
  text: merge.mergeH,
6324
- value: "merge-horizontal"
6339
+ value: "merge-horizontal",
6340
+ icon: "MergeHorizontal"
6325
6341
  }, {
6326
6342
  text: merge.mergeCancel,
6327
- value: "merge-cancel"
6343
+ value: "merge-cancel",
6344
+ icon: "Unmerge"
6328
6345
  }];
6329
6346
  return /*#__PURE__*/React.createElement(Combo, {
6330
6347
  iconId: "merge-all",
@@ -6339,7 +6356,8 @@ var Toolbar = function Toolbar(_ref) {
6339
6356
  }, function (setOpen) {
6340
6357
  return /*#__PURE__*/React.createElement(Select, null, itemdata.map(function (_ref8) {
6341
6358
  var text = _ref8.text,
6342
- value = _ref8.value;
6359
+ value = _ref8.value,
6360
+ icon = _ref8.icon;
6343
6361
  return /*#__PURE__*/React.createElement(Option, {
6344
6362
  key: value,
6345
6363
  onClick: function onClick() {
@@ -6354,8 +6372,10 @@ var Toolbar = function Toolbar(_ref) {
6354
6372
  alignItems: "center",
6355
6373
  gap: 6
6356
6374
  }
6357
- }, /*#__PURE__*/React.createElement(SVGIcon, {
6358
- name: value
6375
+ }, /*#__PURE__*/React.createElement(LucideIcon, {
6376
+ name: icon,
6377
+ width: 16,
6378
+ height: 16
6359
6379
  }), text));
6360
6380
  }));
6361
6381
  });
@@ -6363,37 +6383,44 @@ var Toolbar = function Toolbar(_ref) {
6363
6383
  if (name === "border") {
6364
6384
  var _items4 = [{
6365
6385
  text: border.borderTop,
6366
- value: "border-top"
6386
+ value: "border-top",
6387
+ icon: "BorderTop"
6367
6388
  }, {
6368
6389
  text: border.borderBottom,
6369
- value: "border-bottom"
6390
+ value: "border-bottom",
6391
+ icon: "BorderBottom"
6370
6392
  }, {
6371
6393
  text: border.borderLeft,
6372
- value: "border-left"
6394
+ value: "border-left",
6395
+ icon: "BorderLeft"
6373
6396
  }, {
6374
6397
  text: border.borderRight,
6375
- value: "border-right"
6398
+ value: "border-right",
6399
+ icon: "BorderRight"
6376
6400
  }, {
6377
6401
  text: border.borderNone,
6378
- value: "border-none"
6402
+ value: "border-none",
6403
+ icon: "NoBorder"
6379
6404
  }, {
6380
6405
  text: border.borderAll,
6381
- value: "border-all"
6406
+ value: "border-all",
6407
+ icon: "Border"
6382
6408
  }, {
6383
6409
  text: border.borderOutside,
6384
- value: "border-outside"
6410
+ value: "border-outside",
6411
+ icon: "BorderOutside"
6385
6412
  }, {
6386
6413
  text: border.borderInside,
6387
- value: "border-inside"
6414
+ value: "border-inside",
6415
+ icon: "BorderInside"
6388
6416
  }, {
6389
6417
  text: border.borderHorizontal,
6390
- value: "border-horizontal"
6418
+ value: "border-horizontal",
6419
+ icon: "BorderHorizontal"
6391
6420
  }, {
6392
6421
  text: border.borderVertical,
6393
- value: "border-vertical"
6394
- }, {
6395
- text: border.borderSlash,
6396
- value: "border-slash"
6422
+ value: "border-vertical",
6423
+ icon: "BorderVertical"
6397
6424
  }];
6398
6425
  return /*#__PURE__*/React.createElement(Combo, {
6399
6426
  iconId: "border-all",
@@ -6410,7 +6437,8 @@ var Toolbar = function Toolbar(_ref) {
6410
6437
  return /*#__PURE__*/React.createElement("div", {
6411
6438
  className: "fortune-toolbar-select fortune-border-grid"
6412
6439
  }, _items4.map(function (_ref9) {
6413
- var value = _ref9.value;
6440
+ var value = _ref9.value,
6441
+ icon = _ref9.icon;
6414
6442
  return /*#__PURE__*/React.createElement("div", {
6415
6443
  key: value,
6416
6444
  className: "fortune-border-grid-item",
@@ -6420,8 +6448,10 @@ var Toolbar = function Toolbar(_ref) {
6420
6448
  });
6421
6449
  setOpen(false);
6422
6450
  }
6423
- }, /*#__PURE__*/React.createElement(SVGIcon, {
6424
- name: value
6451
+ }, /*#__PURE__*/React.createElement(LucideIcon, {
6452
+ name: icon,
6453
+ width: 16,
6454
+ height: 16
6425
6455
  }));
6426
6456
  }));
6427
6457
  });
@@ -6465,7 +6495,9 @@ var Toolbar = function Toolbar(_ref) {
6465
6495
  }, /*#__PURE__*/React.createElement("div", {
6466
6496
  className: "fortune-toolbar-menu-line"
6467
6497
  }, text, /*#__PURE__*/React.createElement(SVGIcon, {
6468
- name: value
6498
+ name: value,
6499
+ width: 16,
6500
+ height: 16
6469
6501
  })));
6470
6502
  }));
6471
6503
  });
@@ -6577,7 +6609,9 @@ var Toolbar = function Toolbar(_ref) {
6577
6609
  }, /*#__PURE__*/React.createElement("div", {
6578
6610
  className: "fortune-toolbar-menu-line"
6579
6611
  }, text, /*#__PURE__*/React.createElement(SVGIcon, {
6580
- name: iconId
6612
+ name: iconId,
6613
+ width: 16,
6614
+ height: 16
6581
6615
  })));
6582
6616
  }));
6583
6617
  });
@@ -6651,8 +6685,8 @@ var Toolbar = function Toolbar(_ref) {
6651
6685
  }
6652
6686
  }, /*#__PURE__*/React.createElement(SVGIcon, {
6653
6687
  name: iconId,
6654
- width: 24,
6655
- height: 18
6688
+ width: 16,
6689
+ height: 16
6656
6690
  }), text))) : (/*#__PURE__*/React.createElement(MenuDivider, {
6657
6691
  key: "divider-".concat(index)
6658
6692
  }));
@@ -6676,6 +6710,8 @@ var Toolbar = function Toolbar(_ref) {
6676
6710
  ref: containerRef,
6677
6711
  className: "fortune-toolbar",
6678
6712
  "aria-label": toolbar.toolbar
6713
+ }, /*#__PURE__*/React.createElement("div", {
6714
+ className: "fortune-toolbar-left"
6679
6715
  }, settings.customToolbarItems.filter(function (n) {
6680
6716
  return n.key === "import-export";
6681
6717
  }).map(function (n) {
@@ -6702,9 +6738,9 @@ var Toolbar = function Toolbar(_ref) {
6702
6738
  }));
6703
6739
  }
6704
6740
  }
6705
- })) : null, /*#__PURE__*/React.createElement(Divider, {
6706
- key: "templateDivider"
6707
- }), settings.customToolbarItems.filter(function (n) {
6741
+ })) : null), /*#__PURE__*/React.createElement("div", {
6742
+ className: "fortune-toolbar-right"
6743
+ }, settings.customToolbarItems.filter(function (n) {
6708
6744
  return n.key === "templates";
6709
6745
  }).map(function (n) {
6710
6746
  return /*#__PURE__*/React.createElement(CustomButton, {
@@ -6714,8 +6750,6 @@ var Toolbar = function Toolbar(_ref) {
6714
6750
  icon: n.icon,
6715
6751
  iconName: n.iconName
6716
6752
  }, n.children);
6717
- }), /*#__PURE__*/React.createElement(Divider, {
6718
- key: "customDivider"
6719
6753
  }), settings.customToolbarItems.filter(function (n) {
6720
6754
  return n.key !== "templates" && n.key !== "import-export";
6721
6755
  }).map(function (n) {
@@ -6748,7 +6782,7 @@ var Toolbar = function Toolbar(_ref) {
6748
6782
  icon: "dune-logo",
6749
6783
  placeholder: "Add Dune chart link to embed",
6750
6784
  submitText: "Embed Dune chart"
6751
- })));
6785
+ }))));
6752
6786
  };
6753
6787
 
6754
6788
  var LocationBox = function LocationBox() {
@@ -7491,8 +7525,8 @@ var ContextMenu = function ContextMenu() {
7491
7525
  className: "context-item"
7492
7526
  }, /*#__PURE__*/React.createElement(SVGIcon, {
7493
7527
  name: "freeze-flv",
7494
- width: 18,
7495
- height: 18,
7528
+ width: 16,
7529
+ height: 16,
7496
7530
  style: {
7497
7531
  marginTop: "4px",
7498
7532
  marginRight: "4px"
@@ -8163,10 +8197,12 @@ var ContextMenu = function ContextMenu() {
8163
8197
  className: "flex items-center gap-2"
8164
8198
  }, /*#__PURE__*/React.createElement(SVGIcon, {
8165
8199
  name: "conditionFormat",
8166
- width: 18
8200
+ width: 16,
8201
+ height: 16
8167
8202
  }), /*#__PURE__*/React.createElement("p", null, rightclick.conditionFormat || "Conditional Format")), /*#__PURE__*/React.createElement(SVGIcon, {
8168
8203
  name: "rightArrow",
8169
- width: 18
8204
+ width: 16,
8205
+ height: 16
8170
8206
  })))));
8171
8207
  }
8172
8208
  return null;