@fileverse-dev/fortune-react 1.2.76 → 1.2.77-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.
@@ -99,6 +99,7 @@ var ConditionRules = function ConditionRules(_a) {
99
99
  setContext(function (ctx) {
100
100
  var index = getSheetIndex(ctx, ctx.currentSheetId);
101
101
  ctx.luckysheetfile[index].conditionRules = {
102
+ editKey: editConditionFormatKey,
102
103
  rulesType: type || "",
103
104
  rulesValue: ctx.conditionRules.rulesValue || "",
104
105
  textColor: {
@@ -145,6 +146,7 @@ var ConditionRules = function ConditionRules(_a) {
145
146
  buttonClickCreateRef.current = false;
146
147
  setCreate(false);
147
148
  setContext(function (ctx) {
149
+ console.log("whole rule", ctx.conditionRules);
148
150
  ctx.conditionRules.textColor.color = colorRules.textColor;
149
151
  ctx.conditionRules.cellColor.color = colorRules.cellColor;
150
152
  ctx.conditionRules.font = {
@@ -227,7 +229,7 @@ var ConditionRules = function ConditionRules(_a) {
227
229
  } else if (rangeDialogType === "") {
228
230
  ctx.conditionRules = {
229
231
  rulesType: type,
230
- rulesValue: "",
232
+ rulesValue: context.conditionRules.rulesValue || "",
231
233
  textColor: {
232
234
  check: true,
233
235
  color: "#000000"
@@ -328,9 +330,11 @@ var ConditionRules = function ConditionRules(_a) {
328
330
  var _a;
329
331
  setEditConditionFormatKey(key);
330
332
  setContext(function (ctx) {
331
- var _a, _b;
333
+ var _a, _b, _c, _d;
332
334
  var index = getSheetIndex(ctx, ctx.currentSheetId);
333
- if (((_b = (_a = ctx.luckysheetfile[index]) === null || _a === void 0 ? void 0 : _a.conditionRules) === null || _b === void 0 ? void 0 : _b.editKey) !== undefined) {
335
+ console.log("why set editkey", (_b = (_a = ctx.luckysheetfile[index]) === null || _a === void 0 ? void 0 : _a.conditionRules) === null || _b === void 0 ? void 0 : _b.editKey);
336
+ if (((_d = (_c = ctx.luckysheetfile[index]) === null || _c === void 0 ? void 0 : _c.conditionRules) === null || _d === void 0 ? void 0 : _d.editKey) === undefined) {
337
+ console.log("set editkey");
334
338
  ctx.luckysheetfile[index].conditionRules.editKey = key;
335
339
  }
336
340
  });
@@ -605,7 +609,7 @@ var ConditionRules = function ConditionRules(_a) {
605
609
  style: {
606
610
  width: 30,
607
611
  height: 30,
608
- backgroundColor: bold ? "hsl(var(--color-bg-default-selected))" : ""
612
+ backgroundColor: bold ? "hsl(var(--color-bg-default-active))" : ""
609
613
  }
610
614
  }, /*#__PURE__*/React.createElement(LucideIcon, {
611
615
  name: "Bold",
@@ -622,7 +626,7 @@ var ConditionRules = function ConditionRules(_a) {
622
626
  style: {
623
627
  width: 30,
624
628
  height: 30,
625
- backgroundColor: italic ? "hsl(var(--color-bg-default-selected))" : ""
629
+ backgroundColor: italic ? "hsl(var(--color-bg-default-active))" : ""
626
630
  }
627
631
  }, /*#__PURE__*/React.createElement(LucideIcon, {
628
632
  name: "Italic",
@@ -639,7 +643,7 @@ var ConditionRules = function ConditionRules(_a) {
639
643
  style: {
640
644
  width: 30,
641
645
  height: 30,
642
- backgroundColor: underline ? "hsl(var(--color-bg-default-selected))" : ""
646
+ backgroundColor: underline ? "hsl(var(--color-bg-default-active))" : ""
643
647
  }
644
648
  }, /*#__PURE__*/React.createElement(LucideIcon, {
645
649
  name: "Underline",
@@ -656,7 +660,7 @@ var ConditionRules = function ConditionRules(_a) {
656
660
  style: {
657
661
  width: 30,
658
662
  height: 30,
659
- backgroundColor: strikethrough ? "hsl(var(--color-bg-default-selected))" : ""
663
+ backgroundColor: strikethrough ? "hsl(var(--color-bg-default-active))" : ""
660
664
  }
661
665
  }, /*#__PURE__*/React.createElement(LucideIcon, {
662
666
  name: "Strikethrough",
@@ -304,7 +304,14 @@ var FxEditor = function FxEditor() {
304
304
  className: "fortune-fx-editor",
305
305
  ref: divRef
306
306
  }, /*#__PURE__*/React.createElement(NameBox, null), /*#__PURE__*/React.createElement("div", {
307
- className: "fortune-fx-icon"
307
+ className: "fortune-fx-icon",
308
+ style: {
309
+ cursor: 'pointer'
310
+ },
311
+ onClick: function onClick() {
312
+ var _a;
313
+ (_a = document.getElementById("function-button")) === null || _a === void 0 ? void 0 : _a.click();
314
+ }
308
315
  }, /*#__PURE__*/React.createElement(LucideIcon, {
309
316
  name: "DSheetOnlyText",
310
317
  fill: "black",
@@ -108,6 +108,7 @@ var ConditionRules = function ConditionRules(_a) {
108
108
  setContext(function (ctx) {
109
109
  var index = (0, _fortuneCore.getSheetIndex)(ctx, ctx.currentSheetId);
110
110
  ctx.luckysheetfile[index].conditionRules = {
111
+ editKey: editConditionFormatKey,
111
112
  rulesType: type || "",
112
113
  rulesValue: ctx.conditionRules.rulesValue || "",
113
114
  textColor: {
@@ -154,6 +155,7 @@ var ConditionRules = function ConditionRules(_a) {
154
155
  buttonClickCreateRef.current = false;
155
156
  setCreate(false);
156
157
  setContext(function (ctx) {
158
+ console.log("whole rule", ctx.conditionRules);
157
159
  ctx.conditionRules.textColor.color = colorRules.textColor;
158
160
  ctx.conditionRules.cellColor.color = colorRules.cellColor;
159
161
  ctx.conditionRules.font = {
@@ -236,7 +238,7 @@ var ConditionRules = function ConditionRules(_a) {
236
238
  } else if (rangeDialogType === "") {
237
239
  ctx.conditionRules = {
238
240
  rulesType: type,
239
- rulesValue: "",
241
+ rulesValue: context.conditionRules.rulesValue || "",
240
242
  textColor: {
241
243
  check: true,
242
244
  color: "#000000"
@@ -337,9 +339,11 @@ var ConditionRules = function ConditionRules(_a) {
337
339
  var _a;
338
340
  setEditConditionFormatKey(key);
339
341
  setContext(function (ctx) {
340
- var _a, _b;
342
+ var _a, _b, _c, _d;
341
343
  var index = (0, _fortuneCore.getSheetIndex)(ctx, ctx.currentSheetId);
342
- if (((_b = (_a = ctx.luckysheetfile[index]) === null || _a === void 0 ? void 0 : _a.conditionRules) === null || _b === void 0 ? void 0 : _b.editKey) !== undefined) {
344
+ console.log("why set editkey", (_b = (_a = ctx.luckysheetfile[index]) === null || _a === void 0 ? void 0 : _a.conditionRules) === null || _b === void 0 ? void 0 : _b.editKey);
345
+ if (((_d = (_c = ctx.luckysheetfile[index]) === null || _c === void 0 ? void 0 : _c.conditionRules) === null || _d === void 0 ? void 0 : _d.editKey) === undefined) {
346
+ console.log("set editkey");
343
347
  ctx.luckysheetfile[index].conditionRules.editKey = key;
344
348
  }
345
349
  });
@@ -614,7 +618,7 @@ var ConditionRules = function ConditionRules(_a) {
614
618
  style: {
615
619
  width: 30,
616
620
  height: 30,
617
- backgroundColor: bold ? "hsl(var(--color-bg-default-selected))" : ""
621
+ backgroundColor: bold ? "hsl(var(--color-bg-default-active))" : ""
618
622
  }
619
623
  }, /*#__PURE__*/_react.default.createElement(_ui.LucideIcon, {
620
624
  name: "Bold",
@@ -631,7 +635,7 @@ var ConditionRules = function ConditionRules(_a) {
631
635
  style: {
632
636
  width: 30,
633
637
  height: 30,
634
- backgroundColor: italic ? "hsl(var(--color-bg-default-selected))" : ""
638
+ backgroundColor: italic ? "hsl(var(--color-bg-default-active))" : ""
635
639
  }
636
640
  }, /*#__PURE__*/_react.default.createElement(_ui.LucideIcon, {
637
641
  name: "Italic",
@@ -648,7 +652,7 @@ var ConditionRules = function ConditionRules(_a) {
648
652
  style: {
649
653
  width: 30,
650
654
  height: 30,
651
- backgroundColor: underline ? "hsl(var(--color-bg-default-selected))" : ""
655
+ backgroundColor: underline ? "hsl(var(--color-bg-default-active))" : ""
652
656
  }
653
657
  }, /*#__PURE__*/_react.default.createElement(_ui.LucideIcon, {
654
658
  name: "Underline",
@@ -665,7 +669,7 @@ var ConditionRules = function ConditionRules(_a) {
665
669
  style: {
666
670
  width: 30,
667
671
  height: 30,
668
- backgroundColor: strikethrough ? "hsl(var(--color-bg-default-selected))" : ""
672
+ backgroundColor: strikethrough ? "hsl(var(--color-bg-default-active))" : ""
669
673
  }
670
674
  }, /*#__PURE__*/_react.default.createElement(_ui.LucideIcon, {
671
675
  name: "Strikethrough",
@@ -313,7 +313,14 @@ var FxEditor = function FxEditor() {
313
313
  className: "fortune-fx-editor",
314
314
  ref: divRef
315
315
  }, /*#__PURE__*/_react.default.createElement(_NameBox.default, null), /*#__PURE__*/_react.default.createElement("div", {
316
- className: "fortune-fx-icon"
316
+ className: "fortune-fx-icon",
317
+ style: {
318
+ cursor: 'pointer'
319
+ },
320
+ onClick: function onClick() {
321
+ var _a;
322
+ (_a = document.getElementById("function-button")) === null || _a === void 0 ? void 0 : _a.click();
323
+ }
317
324
  }, /*#__PURE__*/_react.default.createElement(_LucideIcon.LucideIcon, {
318
325
  name: "DSheetOnlyText",
319
326
  fill: "black",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fileverse-dev/fortune-react",
3
- "version": "1.2.76",
3
+ "version": "1.2.77-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.2.76",
19
+ "@fileverse-dev/fortune-core": "1.2.77-patch-1",
20
20
  "@fileverse/ui": "^4.1.7-patch-40",
21
21
  "@tippyjs/react": "^4.2.6",
22
22
  "@types/regenerator-runtime": "^0.13.6",