@fileverse-dev/fortune-react 1.1.60 → 1.1.62-patch-1

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.
@@ -75,16 +75,16 @@ export var DraggableDiv = function DraggableDiv(_a) {
75
75
  var newY = e.clientY - dragOffset.y;
76
76
  var elementWidth = ((_a = divRef.current) === null || _a === void 0 ? void 0 : _a.offsetWidth) || 0;
77
77
  var elementHeight = ((_b = divRef.current) === null || _b === void 0 ? void 0 : _b.offsetHeight) || 0;
78
- if (newX + initialWindowPos.x + 150 > window.innerWidth - elementWidth) {
78
+ if (newX + initialWindowPos.x + 320 > window.innerWidth - elementWidth) {
79
79
  newX = current.x;
80
80
  }
81
- if (newY + initialWindowPos.y + 200 > window.innerHeight - elementHeight) {
81
+ if (newY + initialWindowPos.y + 275 > window.innerHeight - elementHeight) {
82
82
  newY = current.y;
83
83
  }
84
- if (newX + initialWindowPos.x < 0) {
84
+ if (newX + initialWindowPos.x - 35 < 0) {
85
85
  newX = current.x;
86
86
  }
87
- if (newY + initialWindowPos.y < 0) {
87
+ if (newY + initialWindowPos.y - 60 < 0) {
88
88
  newY = current.y;
89
89
  }
90
90
  return {
@@ -104,16 +104,16 @@ export var DraggableDiv = function DraggableDiv(_a) {
104
104
  var newY = touch.clientY - dragOffset.y;
105
105
  var elementWidth = ((_a = divRef.current) === null || _a === void 0 ? void 0 : _a.offsetWidth) || 0;
106
106
  var elementHeight = ((_b = divRef.current) === null || _b === void 0 ? void 0 : _b.offsetHeight) || 0;
107
- if (newX + initialWindowPos.x + 100 > window.innerWidth - elementWidth) {
107
+ if (newX + initialWindowPos.x + 250 > window.innerWidth - elementWidth) {
108
108
  newX = current.x;
109
109
  }
110
- if (newY + initialWindowPos.y + 200 > window.innerHeight - elementHeight) {
110
+ if (newY + initialWindowPos.y + 220 > window.innerHeight - elementHeight) {
111
111
  newY = current.y;
112
112
  }
113
- if (newX + initialWindowPos.x < 0) {
113
+ if (newX + initialWindowPos.x - 10 < 0) {
114
114
  newX = current.x;
115
115
  }
116
- if (newY + initialWindowPos.y < 0) {
116
+ if (newY + initialWindowPos.y - 25 < 0) {
117
117
  newY = current.y;
118
118
  }
119
119
  return {
@@ -11,6 +11,16 @@
11
11
  justify-content: space-between;
12
12
  }
13
13
 
14
+ .scrollbar-hidden {
15
+ overflow: auto; /* enables scrolling */
16
+ -ms-overflow-style: none; /* IE and Edge */
17
+ scrollbar-width: none; /* Firefox */
18
+ }
19
+
20
+ .scrollbar-hidden::-webkit-scrollbar {
21
+ display: none; /* Chrome, Safari, Opera */
22
+ }
23
+
14
24
  .fortune-toolbar-divider {
15
25
  width: 1px;
16
26
  height: 20px;
@@ -638,7 +638,7 @@ var Toolbar = function Toolbar(_a) {
638
638
  }));
639
639
  }
640
640
  if (name === "format") {
641
- var currentFmt = defaultFormat[0].text;
641
+ var currentFmt_1 = defaultFormat[0].text;
642
642
  if (cell) {
643
643
  var curr_2 = normalizedCellAttr(cell, "ct");
644
644
  var format = _.find(defaultFormat, function (v) {
@@ -646,16 +646,16 @@ var Toolbar = function Toolbar(_a) {
646
646
  });
647
647
  if ((curr_2 === null || curr_2 === void 0 ? void 0 : curr_2.fa) != null) {
648
648
  if (format != null) {
649
- currentFmt = format.text;
649
+ currentFmt_1 = format.text;
650
650
  } else if (((_a = curr_2 === null || curr_2 === void 0 ? void 0 : curr_2.fa) === null || _a === void 0 ? void 0 : _a.includes("#,##0")) || (curr_2 === null || curr_2 === void 0 ? void 0 : curr_2.fa) === "0" || (curr_2 === null || curr_2 === void 0 ? void 0 : curr_2.fa) === "0.00") {
651
- currentFmt = "Number";
651
+ currentFmt_1 = "Number";
652
652
  } else {
653
- currentFmt = defaultFormat[defaultFormat.length - 1].text;
653
+ currentFmt_1 = defaultFormat[defaultFormat.length - 1].text;
654
654
  }
655
655
  }
656
656
  }
657
657
  return /*#__PURE__*/React.createElement(Combo, {
658
- text: currentFmt,
658
+ text: currentFmt_1,
659
659
  key: name,
660
660
  tooltip: tooltip,
661
661
  showArrow: false
@@ -681,9 +681,17 @@ var Toolbar = function Toolbar(_a) {
681
681
  }
682
682
  }, /*#__PURE__*/React.createElement("div", {
683
683
  className: "fortune-toolbar-menu-line"
684
- }, /*#__PURE__*/React.createElement("div", null, text), /*#__PURE__*/React.createElement("div", {
685
- className: "fortune-toolbar-subtext"
686
- }, example)));
684
+ }, /*#__PURE__*/React.createElement("div", {
685
+ className: "flex gap-2 items-center"
686
+ }, currentFmt_1 === text ? (/*#__PURE__*/React.createElement(LucideIcon, {
687
+ name: "Check",
688
+ className: "w-4 h-4"
689
+ })) : (/*#__PURE__*/React.createElement("span", {
690
+ className: "w-4 h-4"
691
+ })), /*#__PURE__*/React.createElement("div", null, text)), /*#__PURE__*/React.createElement(LucideIcon, {
692
+ name: "ChevronRight",
693
+ className: "w-4 h-4 color-icon-secondary"
694
+ })));
687
695
  }
688
696
  return /*#__PURE__*/React.createElement(Option, {
689
697
  key: value,
@@ -696,8 +704,18 @@ var Toolbar = function Toolbar(_a) {
696
704
  });
697
705
  }
698
706
  }, /*#__PURE__*/React.createElement("div", {
699
- className: "fortune-toolbar-menu-line"
700
- }, /*#__PURE__*/React.createElement("div", null, text), /*#__PURE__*/React.createElement("div", {
707
+ style: {
708
+ overflowX: "scroll"
709
+ },
710
+ className: "fortune-toolbar-menu-line scrollbar-hidden w-full"
711
+ }, /*#__PURE__*/React.createElement("div", {
712
+ className: "flex gap-2 items-center"
713
+ }, currentFmt_1 === text ? (/*#__PURE__*/React.createElement(LucideIcon, {
714
+ name: "Check",
715
+ className: "w-4 h-4"
716
+ })) : (/*#__PURE__*/React.createElement("span", {
717
+ className: "w-4 h-4"
718
+ })), /*#__PURE__*/React.createElement("div", null, text)), /*#__PURE__*/React.createElement("div", {
701
719
  className: "fortune-toolbar-subtext"
702
720
  }, example)));
703
721
  }));
@@ -82,16 +82,16 @@ var DraggableDiv = exports.DraggableDiv = function DraggableDiv(_a) {
82
82
  var newY = e.clientY - dragOffset.y;
83
83
  var elementWidth = ((_a = divRef.current) === null || _a === void 0 ? void 0 : _a.offsetWidth) || 0;
84
84
  var elementHeight = ((_b = divRef.current) === null || _b === void 0 ? void 0 : _b.offsetHeight) || 0;
85
- if (newX + initialWindowPos.x + 150 > window.innerWidth - elementWidth) {
85
+ if (newX + initialWindowPos.x + 320 > window.innerWidth - elementWidth) {
86
86
  newX = current.x;
87
87
  }
88
- if (newY + initialWindowPos.y + 200 > window.innerHeight - elementHeight) {
88
+ if (newY + initialWindowPos.y + 275 > window.innerHeight - elementHeight) {
89
89
  newY = current.y;
90
90
  }
91
- if (newX + initialWindowPos.x < 0) {
91
+ if (newX + initialWindowPos.x - 35 < 0) {
92
92
  newX = current.x;
93
93
  }
94
- if (newY + initialWindowPos.y < 0) {
94
+ if (newY + initialWindowPos.y - 60 < 0) {
95
95
  newY = current.y;
96
96
  }
97
97
  return {
@@ -111,16 +111,16 @@ var DraggableDiv = exports.DraggableDiv = function DraggableDiv(_a) {
111
111
  var newY = touch.clientY - dragOffset.y;
112
112
  var elementWidth = ((_a = divRef.current) === null || _a === void 0 ? void 0 : _a.offsetWidth) || 0;
113
113
  var elementHeight = ((_b = divRef.current) === null || _b === void 0 ? void 0 : _b.offsetHeight) || 0;
114
- if (newX + initialWindowPos.x + 100 > window.innerWidth - elementWidth) {
114
+ if (newX + initialWindowPos.x + 250 > window.innerWidth - elementWidth) {
115
115
  newX = current.x;
116
116
  }
117
- if (newY + initialWindowPos.y + 200 > window.innerHeight - elementHeight) {
117
+ if (newY + initialWindowPos.y + 220 > window.innerHeight - elementHeight) {
118
118
  newY = current.y;
119
119
  }
120
- if (newX + initialWindowPos.x < 0) {
120
+ if (newX + initialWindowPos.x - 10 < 0) {
121
121
  newX = current.x;
122
122
  }
123
- if (newY + initialWindowPos.y < 0) {
123
+ if (newY + initialWindowPos.y - 25 < 0) {
124
124
  newY = current.y;
125
125
  }
126
126
  return {
@@ -11,6 +11,16 @@
11
11
  justify-content: space-between;
12
12
  }
13
13
 
14
+ .scrollbar-hidden {
15
+ overflow: auto; /* enables scrolling */
16
+ -ms-overflow-style: none; /* IE and Edge */
17
+ scrollbar-width: none; /* Firefox */
18
+ }
19
+
20
+ .scrollbar-hidden::-webkit-scrollbar {
21
+ display: none; /* Chrome, Safari, Opera */
22
+ }
23
+
14
24
  .fortune-toolbar-divider {
15
25
  width: 1px;
16
26
  height: 20px;
@@ -647,7 +647,7 @@ var Toolbar = function Toolbar(_a) {
647
647
  }));
648
648
  }
649
649
  if (name === "format") {
650
- var currentFmt = defaultFormat[0].text;
650
+ var currentFmt_1 = defaultFormat[0].text;
651
651
  if (cell) {
652
652
  var curr_2 = (0, _fortuneCore.normalizedCellAttr)(cell, "ct");
653
653
  var format = _lodash.default.find(defaultFormat, function (v) {
@@ -655,16 +655,16 @@ var Toolbar = function Toolbar(_a) {
655
655
  });
656
656
  if ((curr_2 === null || curr_2 === void 0 ? void 0 : curr_2.fa) != null) {
657
657
  if (format != null) {
658
- currentFmt = format.text;
658
+ currentFmt_1 = format.text;
659
659
  } else if (((_a = curr_2 === null || curr_2 === void 0 ? void 0 : curr_2.fa) === null || _a === void 0 ? void 0 : _a.includes("#,##0")) || (curr_2 === null || curr_2 === void 0 ? void 0 : curr_2.fa) === "0" || (curr_2 === null || curr_2 === void 0 ? void 0 : curr_2.fa) === "0.00") {
660
- currentFmt = "Number";
660
+ currentFmt_1 = "Number";
661
661
  } else {
662
- currentFmt = defaultFormat[defaultFormat.length - 1].text;
662
+ currentFmt_1 = defaultFormat[defaultFormat.length - 1].text;
663
663
  }
664
664
  }
665
665
  }
666
666
  return /*#__PURE__*/_react.default.createElement(_Combo.default, {
667
- text: currentFmt,
667
+ text: currentFmt_1,
668
668
  key: name,
669
669
  tooltip: tooltip,
670
670
  showArrow: false
@@ -690,9 +690,17 @@ var Toolbar = function Toolbar(_a) {
690
690
  }
691
691
  }, /*#__PURE__*/_react.default.createElement("div", {
692
692
  className: "fortune-toolbar-menu-line"
693
- }, /*#__PURE__*/_react.default.createElement("div", null, text), /*#__PURE__*/_react.default.createElement("div", {
694
- className: "fortune-toolbar-subtext"
695
- }, example)));
693
+ }, /*#__PURE__*/_react.default.createElement("div", {
694
+ className: "flex gap-2 items-center"
695
+ }, currentFmt_1 === text ? (/*#__PURE__*/_react.default.createElement(_ui.LucideIcon, {
696
+ name: "Check",
697
+ className: "w-4 h-4"
698
+ })) : (/*#__PURE__*/_react.default.createElement("span", {
699
+ className: "w-4 h-4"
700
+ })), /*#__PURE__*/_react.default.createElement("div", null, text)), /*#__PURE__*/_react.default.createElement(_ui.LucideIcon, {
701
+ name: "ChevronRight",
702
+ className: "w-4 h-4 color-icon-secondary"
703
+ })));
696
704
  }
697
705
  return /*#__PURE__*/_react.default.createElement(_Select.Option, {
698
706
  key: value,
@@ -705,8 +713,18 @@ var Toolbar = function Toolbar(_a) {
705
713
  });
706
714
  }
707
715
  }, /*#__PURE__*/_react.default.createElement("div", {
708
- className: "fortune-toolbar-menu-line"
709
- }, /*#__PURE__*/_react.default.createElement("div", null, text), /*#__PURE__*/_react.default.createElement("div", {
716
+ style: {
717
+ overflowX: "scroll"
718
+ },
719
+ className: "fortune-toolbar-menu-line scrollbar-hidden w-full"
720
+ }, /*#__PURE__*/_react.default.createElement("div", {
721
+ className: "flex gap-2 items-center"
722
+ }, currentFmt_1 === text ? (/*#__PURE__*/_react.default.createElement(_ui.LucideIcon, {
723
+ name: "Check",
724
+ className: "w-4 h-4"
725
+ })) : (/*#__PURE__*/_react.default.createElement("span", {
726
+ className: "w-4 h-4"
727
+ })), /*#__PURE__*/_react.default.createElement("div", null, text)), /*#__PURE__*/_react.default.createElement("div", {
710
728
  className: "fortune-toolbar-subtext"
711
729
  }, example)));
712
730
  }));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fileverse-dev/fortune-react",
3
- "version": "1.1.60",
3
+ "version": "1.1.62-patch-1",
4
4
  "main": "lib/index.js",
5
5
  "types": "lib/index.d.ts",
6
6
  "module": "es/index.js",
@@ -16,7 +16,7 @@
16
16
  "tsc": "tsc"
17
17
  },
18
18
  "dependencies": {
19
- "@fileverse-dev/fortune-core": "1.1.60",
19
+ "@fileverse-dev/fortune-core": "1.1.62",
20
20
  "@fileverse/ui": "^4.1.7-patch-21",
21
21
  "@tippyjs/react": "^4.2.6",
22
22
  "@types/regenerator-runtime": "^0.13.6",