@fileverse-dev/fortune-react 1.0.2-mod-35 → 1.0.2-mod-37

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.esm.js CHANGED
@@ -1,4 +1,4 @@
1
- import { defaultContext, defaultSettings, getSheetIndex, colLocationByIndex, fixPositionOnFrozenCells, colLocation, getFlowdata, isAllowEdit, handleColumnHeaderMouseDown, handleColSizeHandleMouseDown, handleColFreezeHandleMouseDown, handleContextMenu, selectTitlesMap, selectTitlesRange, fixColumnStyleOverflowInFreeze, rowLocationByIndex, rowLocation, handleRowHeaderMouseDown, handleRowSizeHandleMouseDown, handleRowFreezeHandleMouseDown, fixRowStyleOverflowInFreeze, locale, getStyleByCell, getCellValue, createRangeHightlight, isInlineStringCell, getInlineStringHTML, valueShowEs, escapeHTMLTag, escapeScriptTag, moveToEnd, isShowHidenCR, getrangeseleciton, cancelNormalSelected, moveHighlightCell, israngeseleciton, handleFormulaInput, onSearchDialogMoveStart, replaceAll, replace, searchAll, searchNext, normalizeSelection, scrollToHighlightCell, isLinkValid, goToLink, replaceHtml, removeHyperlink, saveHyperlink, createFilterOptions, onImageMoveStart, onImageResizeStart, showComments, setEditingComment, onCommentBoxMoveStart, confirmMessage, getRangeByTxt, getDropdownList, setCellValue, getRangetxt, setConditionRules, mergeBorder, setDropcownValue, handleCellAreaMouseDown, handleCellAreaDoubleClick, selectAll, showLinkCard, getCellRowColumn, getCellHyperlink, handleOverlayMouseMove, handleOverlayMouseUp, handleKeydownForZoom, handleOverlayTouchStart, handleOverlayTouchMove, handleOverlayTouchEnd, insertRowCol, drawArrow, onCellsMoveStart, createDropCellRange, updateContextWithSheetData, updateContextWithCanvas, initFreeze, Canvas, handleGlobalWheel, getDataArr, updateMoreCell, getRegStr, getOptionValue, getSelectRange, applyLocation, updateItem, update, normalizedCellAttr, updateFormat, handleTextSize, handleHorizontalAlign, handleVerticalAlign, handleScreenShot, showImgChooser, insertImage, editComment, deleteComment, showHideComment, showHideAllComments, newComment, handleSum, autoSelectionFormula, handleMerge, handleBorder, handleFreeze, handleSort, createFilter, clearFilter, toolbarItemSelectedFunc, toolbarItemClickHandler, handleTextColor, handleTextBackground, getInlineStringNoStyle, rangeHightlightselected, updateCell, editSheetName, cancelActiveImgItem, MAX_ZOOM_RATIO, MIN_ZOOM_RATIO, addSheet, getFreezeState, toggleFreeze, jfrefreshgrid, handleCopy, deleteRowCol, hideSelected, showSelected, api, removeActiveImage, deleteSelectedCellText, sortSelection, handleLink, handlePasteByClick, deleteSheet, opToPatch, setCaretPosition, orderbydatafiler, getFilterColumnValues, getFilterColumnColors, saveFilter, calcSelectionInfo, patchToOp, filterPatch, inverseRowColOptions, ensureSheetIndex, initSheetIndex, handleGlobalKeyDown, handlePaste, groupValuesRefresh } from '@fileverse-dev/fortune-core';
1
+ import { defaultContext, defaultSettings, getSheetIndex, colLocationByIndex, fixPositionOnFrozenCells, colLocation, getFlowdata, isAllowEdit, handleColumnHeaderMouseDown, handleColSizeHandleMouseDown, handleColFreezeHandleMouseDown, handleContextMenu, selectTitlesMap, selectTitlesRange, fixColumnStyleOverflowInFreeze, rowLocationByIndex, rowLocation, handleRowHeaderMouseDown, handleRowSizeHandleMouseDown, handleRowFreezeHandleMouseDown, fixRowStyleOverflowInFreeze, locale, getStyleByCell, getCellValue, createRangeHightlight, isInlineStringCell, getInlineStringHTML, valueShowEs, escapeHTMLTag, escapeScriptTag, moveToEnd, isShowHidenCR, getrangeseleciton, cancelNormalSelected, moveHighlightCell, israngeseleciton, handleFormulaInput, onSearchDialogMoveStart, replaceAll, replace, searchAll, searchNext, normalizeSelection, scrollToHighlightCell, isLinkValid, goToLink, replaceHtml, removeHyperlink, saveHyperlink, createFilterOptions, onImageMoveStart, onImageResizeStart, showComments, setEditingComment, onCommentBoxMoveStart, confirmMessage, getRangeByTxt, getDropdownList, setCellValue, getRangetxt, setConditionRules, mergeBorder, setDropdownValue, onIframeMoveStart, onIframeResizeStart, handleCellAreaMouseDown, handleCellAreaDoubleClick, selectAll, showLinkCard, getCellRowColumn, getCellHyperlink, handleOverlayMouseMove, handleOverlayMouseUp, handleKeydownForZoom, handleOverlayTouchStart, handleOverlayTouchMove, handleOverlayTouchEnd, insertRowCol, drawArrow, onCellsMoveStart, createDropCellRange, updateContextWithSheetData, updateContextWithCanvas, initFreeze, Canvas, handleGlobalWheel, getDataArr, updateMoreCell, getRegStr, getOptionValue, getSelectRange, applyLocation, updateItem, update, sanitizeDuneUrl, normalizedCellAttr, updateFormat, handleTextSize, handleHorizontalAlign, handleVerticalAlign, handleScreenShot, showImgChooser, insertImage, editComment, deleteComment, showHideComment, showHideAllComments, newComment, handleSum, autoSelectionFormula, handleMerge, handleBorder, handleFreeze, handleSort, createFilter, clearFilter, toolbarItemSelectedFunc, toolbarItemClickHandler, insertDuneChart, handleTextColor, handleTextBackground, getInlineStringNoStyle, rangeHightlightselected, updateCell, editSheetName, cancelActiveImgItem, MAX_ZOOM_RATIO, MIN_ZOOM_RATIO, addSheet, getFreezeState, toggleFreeze, jfrefreshgrid, handleCopy, deleteRowCol, hideSelected, showSelected, api, removeActiveImage, deleteSelectedCellText, sortSelection, handleLink, handlePasteByClick, deleteSheet, opToPatch, setCaretPosition, orderbydatafiler, getFilterColumnValues, getFilterColumnColors, saveFilter, calcSelectionInfo, patchToOp, filterPatch, inverseRowColOptions, ensureSheetIndex, initSheetIndex, handleGlobalKeyDown, handlePaste, groupValuesRefresh } from '@fileverse-dev/fortune-core';
2
2
  import React, { useContext, useRef, useState, useMemo, useCallback, useEffect, useLayoutEffect, useImperativeHandle } from 'react';
3
3
  import produce, { applyPatches, enablePatches, produceWithPatches } from 'immer';
4
4
  import _ from 'lodash';
@@ -172,7 +172,7 @@ function _regenerator() {
172
172
  i = p[t],
173
173
  d = G.p,
174
174
  l = i[2];
175
- r > 3 ? (o = l === n) && (c = i[4] || 3, u = i[5] === e ? i[3] : i[5], i[4] = 3, i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0));
175
+ r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0));
176
176
  }
177
177
  if (o || r > 1) return a;
178
178
  throw y = !0, n;
@@ -2559,8 +2559,18 @@ function useDialog() {
2559
2559
  };
2560
2560
  }
2561
2561
 
2562
+ var datepickerStyles = "\n .datepicker-toggle {\n display: inline-block;\n position: relative;\n width: 100%;\n }\n \n .datepicker-toggle-button {\n opacity: 0.3;\n position: absolute;\n right: 12px;\n top: 50%;\n transform: translateY(-50%);\n width: 16px;\n height: 16px;\n background-image: url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIiBzdHJva2U9ImN1cnJlbnRDb2xvciIgc3Ryb2tlLXdpZHRoPSIyIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiPjxyZWN0IHg9IjMiIHk9IjQiIHdpZHRoPSIxOCIgaGVpZ2h0PSIxOCIgcng9IjIiIHJ5PSIyIj48L3JlY3Q+PGxpbmUgeDE9IjE2IiB5MT0iMiIgeDI9IjE2IiB5Mj0iNiI+PC9saW5lPjxsaW5lIHgxPSI4IiB5MT0iMiIgeDI9IjgiIHkyPSI2Ij48L2xpbmU+PGxpbmUgeDE9IjMiIHkxPSIxMCIgeDI9IjIxIiB5Mj0iMTAiPjwvbGluZT48L3N2Zz4=');\n background-repeat: no-repeat;\n background-position: center;\n pointer-events: none;\n }\n \n .datepicker-input {\n width: 100%;\n padding: 8px 12px;\n border: 1px solid #e2e8f0;\n border-radius: 6px;\n font-size: 14px;\n line-height: 1.5;\n color: #1a202c;\n background-color: #fff;\n cursor: pointer;\n }\n \n .datepicker-input::-webkit-calendar-picker-indicator {\n position: absolute;\n left: 0;\n top: 0;\n width: 100%;\n height: 100%;\n margin: 0;\n padding: 0;\n cursor: pointer;\n opacity: 0;\n }\n \n .datepicker-input:focus {\n outline: none;\n border-color: #4299e1;\n box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.1);\n }\n";
2563
+ var injectDatepickerStyles = function injectDatepickerStyles() {
2564
+ if (typeof document !== "undefined") {
2565
+ var styleSheet = document.createElement("style");
2566
+ styleSheet.textContent = datepickerStyles;
2567
+ document.head.appendChild(styleSheet);
2568
+ }
2569
+ };
2570
+
2571
+ injectDatepickerStyles();
2562
2572
  var DataVerification = function DataVerification() {
2563
- var _context$dataVerifica, _context$dataVerifica2, _context$dataVerifica3, _context$dataVerifica4, _context$dataVerifica5, _context$dataVerifica6, _context$dataVerifica7, _context$dataVerifica8, _context$dataVerifica9, _context$dataVerifica0, _context$dataVerifica1, _context$dataVerifica10, _context$dataVerifica11, _context$dataVerifica12, _context$dataVerifica13, _context$dataVerifica14, _context$dataVerifica15, _context$dataVerifica16, _context$dataVerifica17, _context$dataVerifica18, _context$dataVerifica19, _context$dataVerifica20, _context$dataVerifica21, _context$dataVerifica22, _context$dataVerifica23;
2573
+ var _context$dataVerifica, _context$dataVerifica2, _context$dataVerifica3, _context$dataVerifica4, _context$dataVerifica5, _context$dataVerifica6, _context$dataVerifica7, _context$dataVerifica8, _context$dataVerifica9, _context$dataVerifica0, _context$dataVerifica1, _context$dataVerifica10, _context$dataVerifica11;
2564
2574
  var _useContext = useContext(WorkbookContext),
2565
2575
  context = _useContext.context,
2566
2576
  setContext = _useContext.setContext;
@@ -2569,15 +2579,11 @@ var DataVerification = function DataVerification() {
2569
2579
  hideDialog = _useDialog.hideDialog;
2570
2580
  var _locale = locale(context),
2571
2581
  dataVerification = _locale.dataVerification,
2572
- toolbar = _locale.toolbar,
2573
2582
  button = _locale.button,
2574
2583
  generalDialog = _locale.generalDialog;
2575
- var _useState = useState(["between", "notBetween", "equal", "notEqualTo", "moreThanThe", "lessThan", "greaterOrEqualTo", "lessThanOrEqualTo"]),
2584
+ var _useState = useState(["between", "notBetween", "equal", "notEqualTo", "earlierThan", "noEarlierThan", "laterThan", "noLaterThan"]),
2576
2585
  _useState2 = _slicedToArray(_useState, 1),
2577
- numberCondition = _useState2[0];
2578
- var _useState3 = useState(["between", "notBetween", "equal", "notEqualTo", "earlierThan", "noEarlierThan", "laterThan", "noLaterThan"]),
2579
- _useState4 = _slicedToArray(_useState3, 1),
2580
- dateCondition = _useState4[0];
2586
+ dateCondition = _useState2[0];
2581
2587
  var dataSelectRange = useCallback(function (type, value) {
2582
2588
  hideDialog();
2583
2589
  setContext(function (ctx) {
@@ -2712,48 +2718,36 @@ var DataVerification = function DataVerification() {
2712
2718
  return /*#__PURE__*/React.createElement("div", {
2713
2719
  id: "fortune-data-verification"
2714
2720
  }, /*#__PURE__*/React.createElement("div", {
2715
- className: "title"
2716
- }, toolbar.dataVerification), /*#__PURE__*/React.createElement("div", {
2717
- className: "box"
2721
+ className: "flex flex-col gap-4"
2718
2722
  }, /*#__PURE__*/React.createElement("div", {
2719
- className: "box-item",
2720
- style: {
2721
- borderTop: "1px solid #E1E4E8"
2722
- }
2723
+ className: "flex flex-col"
2723
2724
  }, /*#__PURE__*/React.createElement("div", {
2724
- className: "box-item-title"
2725
- }, dataVerification.cellRange), /*#__PURE__*/React.createElement("div", {
2726
- className: "data-verification-range"
2727
- }, /*#__PURE__*/React.createElement("input", {
2728
- className: "formulaInputFocus",
2729
- spellCheck: "false",
2725
+ className: "text-heading-xsm mb-2"
2726
+ }, dataVerification.cellRange), /*#__PURE__*/React.createElement(TextField, {
2727
+ rightIcon: /*#__PURE__*/React.createElement(LucideIcon, {
2728
+ name: "Grid2x2",
2729
+ size: "sm"
2730
+ }),
2731
+ "aria-hidden": "true",
2732
+ readOnly: true,
2730
2733
  value: (_context$dataVerifica = context.dataVerification.dataRegulation) === null || _context$dataVerifica === void 0 ? void 0 : _context$dataVerifica.rangeTxt,
2731
2734
  onChange: function onChange(e) {
2732
2735
  var value = e.target.value;
2733
2736
  setContext(function (ctx) {
2734
2737
  ctx.dataVerification.dataRegulation.rangeTxt = value;
2735
2738
  });
2736
- }
2737
- }), /*#__PURE__*/React.createElement("i", {
2738
- className: "icon",
2739
- "aria-hidden": "true",
2739
+ },
2740
2740
  onClick: function onClick() {
2741
2741
  hideDialog();
2742
2742
  dataSelectRange("rangeTxt", context.dataVerification.dataRegulation.value1);
2743
- },
2744
- tabIndex: 0
2745
- }, /*#__PURE__*/React.createElement(SVGIcon, {
2746
- name: "tab",
2747
- width: 18
2748
- })))), /*#__PURE__*/React.createElement("div", {
2749
- className: "box-item"
2743
+ }
2744
+ })), /*#__PURE__*/React.createElement("div", {
2745
+ className: "flex flex-col"
2750
2746
  }, /*#__PURE__*/React.createElement("div", {
2751
- className: "box-item-title"
2752
- }, dataVerification.verificationCondition), /*#__PURE__*/React.createElement("select", {
2753
- className: "data-verification-type-select",
2747
+ className: "text-heading-xsm mb-2"
2748
+ }, dataVerification.verificationCondition), /*#__PURE__*/React.createElement(Select$1, {
2754
2749
  value: context.dataVerification.dataRegulation.type,
2755
- onChange: function onChange(e) {
2756
- var value = e.target.value;
2750
+ onValueChange: function onValueChange(value) {
2757
2751
  setContext(function (ctx) {
2758
2752
  ctx.dataVerification.dataRegulation.type = value;
2759
2753
  if (value === "dropdown" || value === "checkbox") {
@@ -2769,18 +2763,14 @@ var DataVerification = function DataVerification() {
2769
2763
  ctx.dataVerification.dataRegulation.value2 = "";
2770
2764
  });
2771
2765
  }
2772
- }, ["dropdown", "checkbox", "number", "number_integer", "number_decimal", "text_content", "text_length", "date", "validity"].map(function (v) {
2773
- return /*#__PURE__*/React.createElement("option", {
2766
+ }, /*#__PURE__*/React.createElement(SelectTrigger, null, /*#__PURE__*/React.createElement(SelectValue, null)), /*#__PURE__*/React.createElement(SelectContent, null, ["dropdown", "checkbox", "date"].map(function (v) {
2767
+ return /*#__PURE__*/React.createElement(SelectItem$1, {
2774
2768
  value: v,
2775
2769
  key: v
2776
2770
  }, dataVerification[v]);
2777
- })), ((_context$dataVerifica2 = context.dataVerification) === null || _context$dataVerifica2 === void 0 ? void 0 : (_context$dataVerifica3 = _context$dataVerifica2.dataRegulation) === null || _context$dataVerifica3 === void 0 ? void 0 : _context$dataVerifica3.type) === "dropdown" && (/*#__PURE__*/React.createElement("div", {
2778
- className: "show-box-item"
2779
- }, /*#__PURE__*/React.createElement("div", {
2780
- className: "data-verification-range"
2781
- }, /*#__PURE__*/React.createElement("input", {
2782
- className: "formulaInputFocus",
2783
- spellCheck: "false",
2771
+ }))), ((_context$dataVerifica2 = context.dataVerification) === null || _context$dataVerifica2 === void 0 ? void 0 : (_context$dataVerifica3 = _context$dataVerifica2.dataRegulation) === null || _context$dataVerifica3 === void 0 ? void 0 : _context$dataVerifica3.type) === "dropdown" && (/*#__PURE__*/React.createElement("div", {
2772
+ className: "mt-4"
2773
+ }, /*#__PURE__*/React.createElement(TextField, {
2784
2774
  value: context.dataVerification.dataRegulation.value1,
2785
2775
  placeholder: dataVerification.placeholder1,
2786
2776
  onChange: function onChange(e) {
@@ -2789,39 +2779,28 @@ var DataVerification = function DataVerification() {
2789
2779
  ctx.dataVerification.dataRegulation.value1 = value;
2790
2780
  });
2791
2781
  }
2792
- }), /*#__PURE__*/React.createElement("i", {
2793
- className: "icon",
2794
- "aria-hidden": "true",
2795
- onClick: function onClick() {
2796
- return dataSelectRange("dropDown", context.dataVerification.dataRegulation.value1);
2797
- },
2798
- tabIndex: 0
2799
- }, /*#__PURE__*/React.createElement(SVGIcon, {
2800
- name: "tab",
2801
- width: 18
2802
- }))), /*#__PURE__*/React.createElement("div", {
2803
- className: "check"
2804
- }, /*#__PURE__*/React.createElement("input", {
2805
- type: "checkbox",
2782
+ }), /*#__PURE__*/React.createElement("div", {
2783
+ className: "mt-4 flex items-center"
2784
+ }, /*#__PURE__*/React.createElement(Checkbox, {
2785
+ className: "border-2",
2806
2786
  checked: context.dataVerification.dataRegulation.type2 === "true",
2807
- id: "mul",
2808
- onChange: function onChange(e) {
2787
+ onCheckedChange: function onCheckedChange(e) {
2809
2788
  var checked = e.target.checked;
2810
2789
  setContext(function (ctx) {
2811
2790
  ctx.dataVerification.dataRegulation.type2 = "".concat(checked);
2812
2791
  });
2813
2792
  }
2814
- }), /*#__PURE__*/React.createElement("label", {
2815
- htmlFor: "mul"
2793
+ }), /*#__PURE__*/React.createElement("span", {
2794
+ className: "ml-2"
2816
2795
  }, dataVerification.allowMultiSelect)))), ((_context$dataVerifica4 = context.dataVerification) === null || _context$dataVerifica4 === void 0 ? void 0 : (_context$dataVerifica5 = _context$dataVerifica4.dataRegulation) === null || _context$dataVerifica5 === void 0 ? void 0 : _context$dataVerifica5.type) === "checkbox" && (/*#__PURE__*/React.createElement("div", {
2817
- className: "show-box-item"
2796
+ className: "mt-4 space-y-2"
2818
2797
  }, /*#__PURE__*/React.createElement("div", {
2819
- className: "check-box"
2820
- }, /*#__PURE__*/React.createElement("span", null, dataVerification.selected, " \u2014\u2014 "), /*#__PURE__*/React.createElement("input", {
2821
- type: "text",
2822
- className: "data-verification-value1",
2823
- placeholder: dataVerification.placeholder2,
2798
+ className: "flex items-center gap-2"
2799
+ }, /*#__PURE__*/React.createElement("span", {
2800
+ className: "data-verification-checkbox-label"
2801
+ }, dataVerification.selected), /*#__PURE__*/React.createElement(TextField, {
2824
2802
  value: (_context$dataVerifica6 = context.dataVerification) === null || _context$dataVerifica6 === void 0 ? void 0 : (_context$dataVerifica7 = _context$dataVerifica6.dataRegulation) === null || _context$dataVerifica7 === void 0 ? void 0 : _context$dataVerifica7.value1,
2803
+ placeholder: dataVerification.placeholder2,
2825
2804
  onChange: function onChange(e) {
2826
2805
  var value = e.target.value;
2827
2806
  setContext(function (ctx) {
@@ -2829,129 +2808,41 @@ var DataVerification = function DataVerification() {
2829
2808
  });
2830
2809
  }
2831
2810
  })), /*#__PURE__*/React.createElement("div", {
2832
- className: "check-box"
2833
- }, /*#__PURE__*/React.createElement("span", null, dataVerification.notSelected, " \u2014\u2014 "), /*#__PURE__*/React.createElement("input", {
2834
- type: "text",
2835
- className: "data-verification-value2",
2836
- placeholder: dataVerification.placeholder2,
2811
+ className: "flex items-center gap-2"
2812
+ }, /*#__PURE__*/React.createElement("span", {
2813
+ className: "data-verification-checkbox-label"
2814
+ }, dataVerification.notSelected), /*#__PURE__*/React.createElement(TextField, {
2837
2815
  value: (_context$dataVerifica8 = context.dataVerification) === null || _context$dataVerifica8 === void 0 ? void 0 : (_context$dataVerifica9 = _context$dataVerifica8.dataRegulation) === null || _context$dataVerifica9 === void 0 ? void 0 : _context$dataVerifica9.value2,
2816
+ placeholder: dataVerification.placeholder2,
2838
2817
  onChange: function onChange(e) {
2839
2818
  var value = e.target.value;
2840
2819
  setContext(function (ctx) {
2841
2820
  ctx.dataVerification.dataRegulation.value2 = value;
2842
2821
  });
2843
2822
  }
2844
- })))), (((_context$dataVerifica0 = context.dataVerification) === null || _context$dataVerifica0 === void 0 ? void 0 : (_context$dataVerifica1 = _context$dataVerifica0.dataRegulation) === null || _context$dataVerifica1 === void 0 ? void 0 : _context$dataVerifica1.type) === "number" || ((_context$dataVerifica10 = context.dataVerification) === null || _context$dataVerifica10 === void 0 ? void 0 : (_context$dataVerifica11 = _context$dataVerifica10.dataRegulation) === null || _context$dataVerifica11 === void 0 ? void 0 : _context$dataVerifica11.type) === "number_integer" || ((_context$dataVerifica12 = context.dataVerification) === null || _context$dataVerifica12 === void 0 ? void 0 : (_context$dataVerifica13 = _context$dataVerifica12.dataRegulation) === null || _context$dataVerifica13 === void 0 ? void 0 : _context$dataVerifica13.type) === "number_decimal" || ((_context$dataVerifica14 = context.dataVerification) === null || _context$dataVerifica14 === void 0 ? void 0 : (_context$dataVerifica15 = _context$dataVerifica14.dataRegulation) === null || _context$dataVerifica15 === void 0 ? void 0 : _context$dataVerifica15.type) === "text_length") && (/*#__PURE__*/React.createElement("div", {
2845
- className: "show-box-item"
2846
- }, /*#__PURE__*/React.createElement("select", {
2847
- className: "data-verification-type-select",
2848
- value: context.dataVerification.dataRegulation.type2,
2849
- onChange: function onChange(e) {
2850
- var value = e.target.value;
2851
- setContext(function (ctx) {
2852
- ctx.dataVerification.dataRegulation.type2 = value;
2853
- ctx.dataVerification.dataRegulation.value1 = "";
2854
- ctx.dataVerification.dataRegulation.value2 = "";
2855
- });
2856
- }
2857
- }, numberCondition.map(function (v) {
2858
- return /*#__PURE__*/React.createElement("option", {
2859
- value: v,
2860
- key: v
2861
- }, dataVerification[v]);
2862
- })), context.dataVerification.dataRegulation.type2 === "between" || context.dataVerification.dataRegulation.type2 === "notBetween" ? (/*#__PURE__*/React.createElement("div", {
2863
- className: "input-box"
2864
- }, /*#__PURE__*/React.createElement("input", {
2865
- type: "number",
2866
- placeholder: "1",
2867
- value: context.dataVerification.dataRegulation.value1,
2868
- onChange: function onChange(e) {
2869
- var value = e.target.value;
2870
- setContext(function (ctx) {
2871
- ctx.dataVerification.dataRegulation.value1 = value;
2872
- });
2873
- }
2874
- }), /*#__PURE__*/React.createElement("span", null, "-"), /*#__PURE__*/React.createElement("input", {
2875
- type: "number",
2876
- placeholder: "100",
2877
- value: context.dataVerification.dataRegulation.value2,
2878
- onChange: function onChange(e) {
2879
- var value = e.target.value;
2880
- setContext(function (ctx) {
2881
- ctx.dataVerification.dataRegulation.value2 = value;
2882
- });
2883
- }
2884
- }))) : (/*#__PURE__*/React.createElement("div", {
2885
- className: "input-box"
2886
- }, /*#__PURE__*/React.createElement("input", {
2887
- type: "number",
2888
- style: {
2889
- width: "100%"
2890
- },
2891
- placeholder: dataVerification.placeholder3,
2892
- value: context.dataVerification.dataRegulation.value1,
2893
- onChange: function onChange(e) {
2894
- var value = e.target.value;
2895
- setContext(function (ctx) {
2896
- ctx.dataVerification.dataRegulation.value1 = value;
2897
- });
2898
- }
2899
- }))))), ((_context$dataVerifica16 = context.dataVerification) === null || _context$dataVerifica16 === void 0 ? void 0 : (_context$dataVerifica17 = _context$dataVerifica16.dataRegulation) === null || _context$dataVerifica17 === void 0 ? void 0 : _context$dataVerifica17.type) === "text_content" && (/*#__PURE__*/React.createElement("div", {
2900
- className: "show-box-item"
2901
- }, /*#__PURE__*/React.createElement("select", {
2902
- className: "data-verification-type-select",
2823
+ })))), ((_context$dataVerifica0 = context.dataVerification) === null || _context$dataVerifica0 === void 0 ? void 0 : (_context$dataVerifica1 = _context$dataVerifica0.dataRegulation) === null || _context$dataVerifica1 === void 0 ? void 0 : _context$dataVerifica1.type) === "date" && (/*#__PURE__*/React.createElement("div", {
2824
+ className: "mt-4"
2825
+ }, /*#__PURE__*/React.createElement(Select$1, {
2903
2826
  value: context.dataVerification.dataRegulation.type2,
2904
- onChange: function onChange(e) {
2905
- var value = e.target.value;
2906
- setContext(function (ctx) {
2907
- ctx.dataVerification.dataRegulation.type2 = value;
2908
- ctx.dataVerification.dataRegulation.value1 = "";
2909
- ctx.dataVerification.dataRegulation.value2 = "";
2910
- });
2911
- }
2912
- }, ["include", "exclude", "equal"].map(function (v) {
2913
- return /*#__PURE__*/React.createElement("option", {
2914
- value: v,
2915
- key: v
2916
- }, dataVerification[v]);
2917
- })), /*#__PURE__*/React.createElement("div", {
2918
- className: "input-box"
2919
- }, /*#__PURE__*/React.createElement("input", {
2920
- type: "text",
2921
- style: {
2922
- width: "100%"
2923
- },
2924
- placeholder: dataVerification.placeholder4,
2925
- value: context.dataVerification.dataRegulation.value1,
2926
- onChange: function onChange(e) {
2927
- var value = e.target.value;
2928
- setContext(function (ctx) {
2929
- ctx.dataVerification.dataRegulation.value1 = value;
2930
- });
2931
- }
2932
- })))), ((_context$dataVerifica18 = context.dataVerification) === null || _context$dataVerifica18 === void 0 ? void 0 : (_context$dataVerifica19 = _context$dataVerifica18.dataRegulation) === null || _context$dataVerifica19 === void 0 ? void 0 : _context$dataVerifica19.type) === "date" && (/*#__PURE__*/React.createElement("div", {
2933
- className: "show-box-item"
2934
- }, /*#__PURE__*/React.createElement("select", {
2935
- className: "data-verification-type-select",
2936
- value: context.dataVerification.dataRegulation.type2,
2937
- onChange: function onChange(e) {
2938
- var value = e.target.value;
2827
+ onValueChange: function onValueChange(value) {
2939
2828
  setContext(function (ctx) {
2940
2829
  ctx.dataVerification.dataRegulation.type2 = value;
2941
2830
  ctx.dataVerification.dataRegulation.value1 = "";
2942
2831
  ctx.dataVerification.dataRegulation.value2 = "";
2943
2832
  });
2944
2833
  }
2945
- }, dateCondition.map(function (v) {
2946
- return /*#__PURE__*/React.createElement("option", {
2834
+ }, /*#__PURE__*/React.createElement(SelectTrigger, null, /*#__PURE__*/React.createElement(SelectValue, null)), /*#__PURE__*/React.createElement(SelectContent, null, dateCondition.map(function (v) {
2835
+ return /*#__PURE__*/React.createElement(SelectItem$1, {
2947
2836
  value: v,
2948
2837
  key: v
2949
2838
  }, dataVerification[v]);
2950
- })), context.dataVerification.dataRegulation.type2 === "between" || context.dataVerification.dataRegulation.type2 === "notBetween" ? (/*#__PURE__*/React.createElement("div", {
2951
- className: "input-box"
2839
+ }))), context.dataVerification.dataRegulation.type2 === "between" || context.dataVerification.dataRegulation.type2 === "notBetween" ? (/*#__PURE__*/React.createElement("div", {
2840
+ className: "mt-4 flex gap-2 items-center"
2841
+ }, /*#__PURE__*/React.createElement("div", {
2842
+ className: "datepicker-toggle"
2952
2843
  }, /*#__PURE__*/React.createElement("input", {
2953
2844
  type: "date",
2954
- placeholder: "1",
2845
+ className: "datepicker-input",
2955
2846
  value: context.dataVerification.dataRegulation.value1,
2956
2847
  onChange: function onChange(e) {
2957
2848
  var value = e.target.value;
@@ -2959,9 +2850,13 @@ var DataVerification = function DataVerification() {
2959
2850
  ctx.dataVerification.dataRegulation.value1 = value;
2960
2851
  });
2961
2852
  }
2962
- }), /*#__PURE__*/React.createElement("span", null, "-"), /*#__PURE__*/React.createElement("input", {
2853
+ }), /*#__PURE__*/React.createElement("span", {
2854
+ className: "datepicker-toggle-button"
2855
+ })), /*#__PURE__*/React.createElement("span", null, "-"), /*#__PURE__*/React.createElement("div", {
2856
+ className: "datepicker-toggle"
2857
+ }, /*#__PURE__*/React.createElement("input", {
2963
2858
  type: "date",
2964
- placeholder: "100",
2859
+ className: "datepicker-input",
2965
2860
  value: context.dataVerification.dataRegulation.value2,
2966
2861
  onChange: function onChange(e) {
2967
2862
  var value = e.target.value;
@@ -2969,13 +2864,15 @@ var DataVerification = function DataVerification() {
2969
2864
  ctx.dataVerification.dataRegulation.value2 = value;
2970
2865
  });
2971
2866
  }
2972
- }))) : (/*#__PURE__*/React.createElement("div", {
2973
- className: "input-box"
2867
+ }), /*#__PURE__*/React.createElement("span", {
2868
+ className: "datepicker-toggle-button"
2869
+ })))) : (/*#__PURE__*/React.createElement("div", {
2870
+ className: "mt-4"
2871
+ }, /*#__PURE__*/React.createElement("div", {
2872
+ className: "datepicker-toggle"
2974
2873
  }, /*#__PURE__*/React.createElement("input", {
2975
2874
  type: "date",
2976
- style: {
2977
- width: "100%"
2978
- },
2875
+ className: "datepicker-input",
2979
2876
  placeholder: dataVerification.placeholder3,
2980
2877
  value: context.dataVerification.dataRegulation.value1,
2981
2878
  onChange: function onChange(e) {
@@ -2984,57 +2881,35 @@ var DataVerification = function DataVerification() {
2984
2881
  ctx.dataVerification.dataRegulation.value1 = value;
2985
2882
  });
2986
2883
  }
2987
- }))))), ((_context$dataVerifica20 = context.dataVerification) === null || _context$dataVerifica20 === void 0 ? void 0 : (_context$dataVerifica21 = _context$dataVerifica20.dataRegulation) === null || _context$dataVerifica21 === void 0 ? void 0 : _context$dataVerifica21.type) === "validity" && (/*#__PURE__*/React.createElement("div", {
2988
- className: "show-box-item"
2989
- }, /*#__PURE__*/React.createElement("select", {
2990
- className: "data-verification-type-select",
2991
- value: context.dataVerification.dataRegulation.type2,
2992
- onChange: function onChange(e) {
2993
- var value = e.target.value;
2994
- setContext(function (ctx) {
2995
- ctx.dataVerification.dataRegulation.type2 = value;
2996
- ctx.dataVerification.dataRegulation.value1 = "";
2997
- ctx.dataVerification.dataRegulation.value2 = "";
2998
- });
2999
- }
3000
- }, ["identificationNumber", "phoneNumber"].map(function (v) {
3001
- return /*#__PURE__*/React.createElement("option", {
3002
- value: v,
3003
- key: v
3004
- }, dataVerification[v]);
3005
- }))))), /*#__PURE__*/React.createElement("div", {
3006
- className: "box-item"
2884
+ }), /*#__PURE__*/React.createElement("span", {
2885
+ className: "datepicker-toggle-button"
2886
+ }))))))), /*#__PURE__*/React.createElement(Divider$2, {
2887
+ className: "w-full border-t-[1px]"
2888
+ }), /*#__PURE__*/React.createElement("div", {
2889
+ className: "flex flex-col gap-2"
3007
2890
  }, ["prohibitInput", "hintShow"].map(function (v) {
3008
2891
  return /*#__PURE__*/React.createElement("div", {
3009
- className: "check",
3010
- key: "div".concat(v)
3011
- }, /*#__PURE__*/React.createElement("input", {
3012
- type: "checkbox",
3013
- id: v,
3014
- key: "input".concat(v),
2892
+ key: v,
2893
+ className: "flex items-center"
2894
+ }, /*#__PURE__*/React.createElement(Checkbox, {
2895
+ className: "border-2",
3015
2896
  checked: context.dataVerification.dataRegulation[v],
3016
- onChange: function onChange() {
2897
+ onCheckedChange: function onCheckedChange(e) {
2898
+ var checked = e.target.checked;
3017
2899
  setContext(function (ctx) {
3018
2900
  var _ctx$dataVerification5;
3019
2901
  var dataRegulation = (_ctx$dataVerification5 = ctx.dataVerification) === null || _ctx$dataVerification5 === void 0 ? void 0 : _ctx$dataVerification5.dataRegulation;
3020
2902
  if (v === "prohibitInput") {
3021
- dataRegulation.prohibitInput = !dataRegulation.prohibitInput;
2903
+ dataRegulation.prohibitInput = checked;
3022
2904
  } else if (v === "hintShow") {
3023
- dataRegulation.hintShow = !dataRegulation.hintShow;
2905
+ dataRegulation.hintShow = checked;
3024
2906
  }
3025
2907
  });
3026
2908
  }
3027
- }), /*#__PURE__*/React.createElement("label", {
3028
- htmlFor: v,
3029
- key: "label".concat(v)
2909
+ }), /*#__PURE__*/React.createElement("span", {
2910
+ className: "ml-2"
3030
2911
  }, dataVerification[v]));
3031
- }), ((_context$dataVerifica22 = context.dataVerification) === null || _context$dataVerifica22 === void 0 ? void 0 : (_context$dataVerifica23 = _context$dataVerifica22.dataRegulation) === null || _context$dataVerifica23 === void 0 ? void 0 : _context$dataVerifica23.hintShow) && (/*#__PURE__*/React.createElement("div", {
3032
- className: "input-box"
3033
- }, /*#__PURE__*/React.createElement("input", {
3034
- type: "text",
3035
- style: {
3036
- width: "100%"
3037
- },
2912
+ }), ((_context$dataVerifica10 = context.dataVerification) === null || _context$dataVerifica10 === void 0 ? void 0 : (_context$dataVerifica11 = _context$dataVerifica10.dataRegulation) === null || _context$dataVerifica11 === void 0 ? void 0 : _context$dataVerifica11.hintShow) && (/*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(TextField, {
3038
2913
  placeholder: dataVerification.placeholder5,
3039
2914
  value: context.dataVerification.dataRegulation.hintValue,
3040
2915
  onChange: function onChange(e) {
@@ -3043,25 +2918,37 @@ var DataVerification = function DataVerification() {
3043
2918
  ctx.dataVerification.dataRegulation.hintValue = value;
3044
2919
  });
3045
2920
  }
3046
- }))))), /*#__PURE__*/React.createElement("div", {
3047
- className: "button-basic button-primary",
2921
+ }))))), /*#__PURE__*/React.createElement(Divider$2, {
2922
+ className: "w-full border-t-[1px] my-4"
2923
+ }), /*#__PURE__*/React.createElement("div", {
2924
+ className: "flex gap-2 justify-between items-center"
2925
+ }, /*#__PURE__*/React.createElement(Button$1, {
2926
+ variant: "secondary",
2927
+ style: {
2928
+ minWidth: "80px"
2929
+ },
3048
2930
  onClick: function onClick() {
3049
- btn("confirm");
2931
+ btn("close");
2932
+ }
2933
+ }, button.cancel), /*#__PURE__*/React.createElement("div", {
2934
+ className: "flex gap-2"
2935
+ }, /*#__PURE__*/React.createElement(Button$1, {
2936
+ variant: "secondary",
2937
+ style: {
2938
+ minWidth: "80px"
3050
2939
  },
3051
- tabIndex: 0
3052
- }, button.confirm), /*#__PURE__*/React.createElement("div", {
3053
- className: "button-basic button-close",
3054
2940
  onClick: function onClick() {
3055
2941
  btn("delete");
2942
+ }
2943
+ }, dataVerification.deleteVerification), /*#__PURE__*/React.createElement(Button$1, {
2944
+ variant: "default",
2945
+ style: {
2946
+ minWidth: "80px"
3056
2947
  },
3057
- tabIndex: 0
3058
- }, dataVerification.deleteVerification), /*#__PURE__*/React.createElement("div", {
3059
- className: "button-basic button-close",
3060
2948
  onClick: function onClick() {
3061
- btn("close");
3062
- },
3063
- tabIndex: 0
3064
- }, button.cancel));
2949
+ btn("confirm");
2950
+ }
2951
+ }, button.confirm))));
3065
2952
  };
3066
2953
 
3067
2954
  function getDisplayedRangeTxt(context) {
@@ -3073,12 +2960,7 @@ function getDisplayedRangeTxt(context) {
3073
2960
  return (_context$rangeDialog$ = (_context$rangeDialog = context.rangeDialog) === null || _context$rangeDialog === void 0 ? void 0 : _context$rangeDialog.rangeTxt) !== null && _context$rangeDialog$ !== void 0 ? _context$rangeDialog$ : "";
3074
2961
  }
3075
2962
 
3076
- var datepickerStyles = "\n .datepicker-toggle {\n display: inline-block;\n position: relative;\n width: 100%;\n }\n \n .datepicker-toggle-button {\n opacity: 0.3;\n position: absolute;\n right: 12px;\n top: 50%;\n transform: translateY(-50%);\n width: 16px;\n height: 16px;\n background-image: url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIiBzdHJva2U9ImN1cnJlbnRDb2xvciIgc3Ryb2tlLXdpZHRoPSIyIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiPjxyZWN0IHg9IjMiIHk9IjQiIHdpZHRoPSIxOCIgaGVpZ2h0PSIxOCIgcng9IjIiIHJ5PSIyIj48L3JlY3Q+PGxpbmUgeDE9IjE2IiB5MT0iMiIgeDI9IjE2IiB5Mj0iNiI+PC9saW5lPjxsaW5lIHgxPSI4IiB5MT0iMiIgeDI9IjgiIHkyPSI2Ij48L2xpbmU+PGxpbmUgeDE9IjMiIHkxPSIxMCIgeDI9IjIxIiB5Mj0iMTAiPjwvbGluZT48L3N2Zz4=');\n background-repeat: no-repeat;\n background-position: center;\n pointer-events: none;\n }\n \n .datepicker-input {\n width: 100%;\n padding: 8px 12px;\n border: 1px solid #e2e8f0;\n border-radius: 6px;\n font-size: 14px;\n line-height: 1.5;\n color: #1a202c;\n background-color: #fff;\n cursor: pointer;\n }\n \n .datepicker-input::-webkit-calendar-picker-indicator {\n position: absolute;\n left: 0;\n top: 0;\n width: 100%;\n height: 100%;\n margin: 0;\n padding: 0;\n cursor: pointer;\n opacity: 0;\n }\n \n .datepicker-input:focus {\n outline: none;\n border-color: #4299e1;\n box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.1);\n }\n";
3077
- if (typeof document !== "undefined") {
3078
- var styleSheet = document.createElement("style");
3079
- styleSheet.textContent = datepickerStyles;
3080
- document.head.appendChild(styleSheet);
3081
- }
2963
+ injectDatepickerStyles();
3082
2964
  var ConditionRules = function ConditionRules(_ref) {
3083
2965
  var type = _ref.type;
3084
2966
  var _useContext = useContext(WorkbookContext),
@@ -3399,7 +3281,8 @@ var RangeDialog = function RangeDialog() {
3399
3281
  showDialog = _useDialog.showDialog;
3400
3282
  var _locale = locale(context),
3401
3283
  dataVerification = _locale.dataVerification,
3402
- button = _locale.button;
3284
+ button = _locale.button,
3285
+ toolbar = _locale.toolbar;
3403
3286
  var _useState = useState(getDisplayedRangeTxt(context)),
3404
3287
  _useState2 = _slicedToArray(_useState, 2),
3405
3288
  rangeTxt2 = _useState2[0],
@@ -3424,7 +3307,7 @@ var RangeDialog = function RangeDialog() {
3424
3307
  }), undefined, locale(context).conditionformat["conditionformat_".concat(rulesType)]);
3425
3308
  return;
3426
3309
  }
3427
- showDialog(/*#__PURE__*/React.createElement(DataVerification, null));
3310
+ showDialog(/*#__PURE__*/React.createElement(DataVerification, null), undefined, toolbar.dataVerification);
3428
3311
  }, [setContext, showDialog, context]);
3429
3312
  useEffect(function () {
3430
3313
  setRangeTxt2(getDisplayedRangeTxt(context));
@@ -3613,7 +3496,7 @@ var DropDownList = function DropDownList() {
3613
3496
  arr.splice(index, 1);
3614
3497
  }
3615
3498
  setSelected(arr);
3616
- setDropcownValue(ctx, v, arr);
3499
+ setDropdownValue(ctx, v, arr);
3617
3500
  });
3618
3501
  },
3619
3502
  tabIndex: 0
@@ -3628,6 +3511,118 @@ var DropDownList = function DropDownList() {
3628
3511
  }));
3629
3512
  };
3630
3513
 
3514
+ var IframeBoxs = function IframeBoxs() {
3515
+ var _context$insertedIfra;
3516
+ var _useContext = useContext(WorkbookContext),
3517
+ context = _useContext.context,
3518
+ setContext = _useContext.setContext,
3519
+ refs = _useContext.refs;
3520
+ var containerRef = useRef(null);
3521
+ useEffect(function () {
3522
+ var handleClickOutside = function handleClickOutside(e) {
3523
+ if (!containerRef.current) return;
3524
+ var iframeBoxes = containerRef.current.querySelectorAll(".luckysheet-modal-dialog-iframe");
3525
+ var clickedInsideSomeIframe = Array.from(iframeBoxes).some(function (el) {
3526
+ return el.contains(e.target);
3527
+ });
3528
+ if (!clickedInsideSomeIframe && context.activeIframe !== undefined) {
3529
+ setContext(function (ctx) {
3530
+ ctx.activeIframe = undefined;
3531
+ });
3532
+ }
3533
+ };
3534
+ document.addEventListener("mousedown", handleClickOutside);
3535
+ return function () {
3536
+ document.removeEventListener("mousedown", handleClickOutside);
3537
+ };
3538
+ }, [context.activeIframe, setContext]);
3539
+ return /*#__PURE__*/React.createElement("div", {
3540
+ id: "fortune-iframe-boxes",
3541
+ ref: containerRef
3542
+ }, (_context$insertedIfra = context.insertedIframes) === null || _context$insertedIfra === void 0 ? void 0 : _context$insertedIfra.map(function (frame) {
3543
+ var isActive = frame.id === context.activeIframe;
3544
+ var style = {
3545
+ width: frame.width * context.zoomRatio,
3546
+ height: frame.height * context.zoomRatio,
3547
+ left: frame.left * context.zoomRatio,
3548
+ top: frame.top * context.zoomRatio,
3549
+ position: "absolute",
3550
+ padding: 0,
3551
+ zIndex: isActive ? 300 : 200
3552
+ };
3553
+ return /*#__PURE__*/React.createElement("div", {
3554
+ key: frame.id,
3555
+ id: isActive ? "fortune-modal-dialog-activeIframe" : frame.id,
3556
+ className: "luckysheet-modal-dialog luckysheet-modal-dialog-iframe",
3557
+ style: style,
3558
+ onClick: function onClick(e) {
3559
+ if (!isActive) {
3560
+ setContext(function (ctx) {
3561
+ ctx.activeIframe = frame.id;
3562
+ });
3563
+ }
3564
+ e.stopPropagation();
3565
+ },
3566
+ onMouseDown: function onMouseDown(e) {
3567
+ if (isActive) {
3568
+ onIframeMoveStart(context, refs.globalCache, e.nativeEvent);
3569
+ }
3570
+ e.stopPropagation();
3571
+ }
3572
+ }, /*#__PURE__*/React.createElement("div", {
3573
+ className: "luckysheet-modal-dialog-content",
3574
+ style: {
3575
+ width: "100%",
3576
+ height: "100%",
3577
+ overflow: "hidden"
3578
+ }
3579
+ }, /*#__PURE__*/React.createElement("iframe", {
3580
+ title: "iframe-".concat(frame.id),
3581
+ src: frame.src,
3582
+ style: {
3583
+ width: "100%",
3584
+ height: "100%",
3585
+ border: "none",
3586
+ pointerEvents: "none"
3587
+ }
3588
+ })), /*#__PURE__*/React.createElement("div", {
3589
+ className: "luckysheet-modal-dialog-border"
3590
+ }), isActive && (/*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
3591
+ className: "luckysheet-modal-dialog-resize"
3592
+ }, ["lt", "mt", "lm", "rm", "rt", "lb", "mb", "rb"].map(function (dir) {
3593
+ return /*#__PURE__*/React.createElement("div", {
3594
+ key: dir,
3595
+ className: "luckysheet-modal-dialog-resize-item luckysheet-modal-dialog-resize-item-".concat(dir),
3596
+ "data-type": dir,
3597
+ style: {
3598
+ zIndex: 300,
3599
+ position: "absolute"
3600
+ },
3601
+ onMouseDown: function onMouseDown(e) {
3602
+ onIframeResizeStart(context, refs.globalCache, e.nativeEvent, dir);
3603
+ e.stopPropagation();
3604
+ }
3605
+ });
3606
+ })), /*#__PURE__*/React.createElement("div", {
3607
+ className: "luckysheet-modal-dialog-controll"
3608
+ }, /*#__PURE__*/React.createElement("span", {
3609
+ className: "luckysheet-modal-controll-btn luckysheet-modal-controll-del",
3610
+ role: "button",
3611
+ tabIndex: 0,
3612
+ title: "Delete",
3613
+ onClick: function onClick() {
3614
+ setContext(function (ctx) {
3615
+ var _ctx$insertedIframes;
3616
+ ctx.insertedIframes = ctx === null || ctx === void 0 ? void 0 : (_ctx$insertedIframes = ctx.insertedIframes) === null || _ctx$insertedIframes === void 0 ? void 0 : _ctx$insertedIframes.filter(function (f) {
3617
+ return f.id !== frame.id;
3618
+ });
3619
+ ctx.activeIframe = undefined;
3620
+ });
3621
+ }
3622
+ }, "DELETE")))));
3623
+ }));
3624
+ };
3625
+
3631
3626
  var SheetOverlay = function SheetOverlay() {
3632
3627
  var _refs$cellArea$curren, _refs$cellArea$curren2, _context$luckysheet_s, _context$luckysheet_s2, _context$luckysheet_s3, _context$luckysheet_s4, _context$luckysheet_s5, _context$luckysheet_s6, _context$presences$le, _context$presences, _context$linkCard, _context$rangeDialog;
3633
3628
  var _useContext = useContext(WorkbookContext),
@@ -4070,7 +4065,7 @@ var SheetOverlay = function SheetOverlay() {
4070
4065
  id: "luckysheet-multipleRange-show"
4071
4066
  }), /*#__PURE__*/React.createElement("div", {
4072
4067
  id: "luckysheet-dynamicArray-hightShow"
4073
- }), /*#__PURE__*/React.createElement(ImgBoxs, null), /*#__PURE__*/React.createElement("div", {
4068
+ }), /*#__PURE__*/React.createElement(ImgBoxs, null), /*#__PURE__*/React.createElement(IframeBoxs, null), /*#__PURE__*/React.createElement("div", {
4074
4069
  id: "luckysheet-dataVerification-dropdown-btn",
4075
4070
  onClick: function onClick() {
4076
4071
  setContext(function (ctx) {
@@ -4083,8 +4078,9 @@ var SheetOverlay = function SheetOverlay() {
4083
4078
  display: "none"
4084
4079
  }
4085
4080
  }, /*#__PURE__*/React.createElement(SVGIcon, {
4086
- name: "combo-arrow",
4087
- width: 16
4081
+ name: "caret-down-fill",
4082
+ width: 16,
4083
+ height: 16
4088
4084
  })), context.dataVerificationDropDownList && /*#__PURE__*/React.createElement(DropDownList, null), /*#__PURE__*/React.createElement("div", {
4089
4085
  id: "luckysheet-dataVerification-showHintBox",
4090
4086
  className: "luckysheet-mousedown-cancel",
@@ -4403,6 +4399,9 @@ var Combo = function Combo(_ref) {
4403
4399
  setPopupPosition = _useState4[1];
4404
4400
  var popupRef = useRef(null);
4405
4401
  var buttonRef = useRef(null);
4402
+ var isLucideIcon = useMemo(function () {
4403
+ return (iconId === null || iconId === void 0 ? void 0 : iconId.startsWith("align-")) || ["text-overflow", "text-wrap", "text-clip"].includes(iconId);
4404
+ }, [iconId]);
4406
4405
  useOutsideClick(popupRef, function () {
4407
4406
  setOpen(false);
4408
4407
  });
@@ -4430,7 +4429,7 @@ var Combo = function Combo(_ref) {
4430
4429
  }, /*#__PURE__*/React.createElement("div", {
4431
4430
  ref: buttonRef,
4432
4431
  className: "fortune-toolbar-combo"
4433
- }, /*#__PURE__*/React.createElement("div", {
4432
+ }, !isLucideIcon ? (/*#__PURE__*/React.createElement("div", {
4434
4433
  className: "fortune-toolbar-combo-button",
4435
4434
  onClick: function onClick(e) {
4436
4435
  if (_onClick) {
@@ -4449,7 +4448,13 @@ var Combo = function Combo(_ref) {
4449
4448
  name: iconId
4450
4449
  })) : (/*#__PURE__*/React.createElement("span", {
4451
4450
  className: "fortune-toolbar-combo-text"
4452
- }, text !== undefined ? text : ""))), showArrow && (/*#__PURE__*/React.createElement("div", {
4451
+ }, text !== undefined ? text : "")))) : (/*#__PURE__*/React.createElement(IconButton, {
4452
+ icon: getIcon(iconId),
4453
+ variant: "ghost",
4454
+ onClick: function onClick() {
4455
+ return setOpen(!open);
4456
+ }
4457
+ })), showArrow && (/*#__PURE__*/React.createElement("div", {
4453
4458
  className: "fortune-toolbar-combo-arrow",
4454
4459
  onClick: function onClick() {
4455
4460
  return setOpen(!open);
@@ -5354,6 +5359,121 @@ var FormatSearch = function FormatSearch(_ref) {
5354
5359
  }, button.cancel)));
5355
5360
  };
5356
5361
 
5362
+ var DuneChartsInputModal = function DuneChartsInputModal(_ref) {
5363
+ var isOpen = _ref.isOpen,
5364
+ onClose = _ref.onClose,
5365
+ onSubmit = _ref.onSubmit,
5366
+ icon = _ref.icon,
5367
+ _ref$submitText = _ref.submitText,
5368
+ submitText = _ref$submitText === void 0 ? "Submit" : _ref$submitText,
5369
+ _ref$placeholder = _ref.placeholder,
5370
+ placeholder = _ref$placeholder === void 0 ? "Enter a value..." : _ref$placeholder;
5371
+ var _useState = useState(""),
5372
+ _useState2 = _slicedToArray(_useState, 2),
5373
+ url = _useState2[0],
5374
+ setUrl = _useState2[1];
5375
+ var _useState3 = useState(false),
5376
+ _useState4 = _slicedToArray(_useState3, 2),
5377
+ showError = _useState4[0],
5378
+ setShowError = _useState4[1];
5379
+ var inputRef = useRef(null);
5380
+ useEffect(function () {
5381
+ if (isOpen && inputRef.current) {
5382
+ var timer = setTimeout(function () {
5383
+ var _inputRef$current;
5384
+ (_inputRef$current = inputRef.current) === null || _inputRef$current === void 0 ? void 0 : _inputRef$current.focus();
5385
+ }, 100);
5386
+ return function () {
5387
+ return clearTimeout(timer);
5388
+ };
5389
+ }
5390
+ return undefined;
5391
+ }, [isOpen]);
5392
+ if (!isOpen) return null;
5393
+ var handleSubmit = function handleSubmit() {
5394
+ var trimmed = url.trim();
5395
+ if (trimmed && sanitizeDuneUrl(trimmed)) {
5396
+ onSubmit(trimmed);
5397
+ setUrl("");
5398
+ setShowError(false);
5399
+ onClose();
5400
+ } else {
5401
+ setShowError(true);
5402
+ }
5403
+ };
5404
+ var handleKeyDown = function handleKeyDown(e) {
5405
+ e.stopPropagation();
5406
+ if (e.key === "Enter") {
5407
+ handleSubmit();
5408
+ }
5409
+ };
5410
+ return /*#__PURE__*/React.createElement("div", {
5411
+ className: "custom-overlay",
5412
+ onClick: onClose
5413
+ }, /*#__PURE__*/React.createElement("div", {
5414
+ className: "input-modal",
5415
+ style: {
5416
+ transformOrigin: "top center"
5417
+ },
5418
+ onClick: function onClick(e) {
5419
+ return e.stopPropagation();
5420
+ },
5421
+ onKeyDown: handleKeyDown
5422
+ }, /*#__PURE__*/React.createElement("div", {
5423
+ className: "modal-header"
5424
+ }, /*#__PURE__*/React.createElement(SVGIcon, {
5425
+ name: icon
5426
+ }), /*#__PURE__*/React.createElement("input", {
5427
+ ref: inputRef,
5428
+ className: "modal-input",
5429
+ type: "text",
5430
+ placeholder: placeholder,
5431
+ value: url,
5432
+ onChange: function onChange(e) {
5433
+ setUrl(e.target.value);
5434
+ setShowError(false);
5435
+ },
5436
+ onKeyDown: handleKeyDown
5437
+ })), showError && (/*#__PURE__*/React.createElement("div", {
5438
+ className: "modal-error-message"
5439
+ }, /*#__PURE__*/React.createElement(SVGIcon, {
5440
+ style: {
5441
+ width: "14px",
5442
+ height: "14px"
5443
+ },
5444
+ name: "circle-alert"
5445
+ }), /*#__PURE__*/React.createElement("span", null, "Please make sure the URL is a valid Dune chart link"))), url.length > 0 && !showError && (/*#__PURE__*/React.createElement("div", {
5446
+ className: "modal-footer"
5447
+ }, /*#__PURE__*/React.createElement(Button$1, {
5448
+ onClick: handleSubmit,
5449
+ className: "modal-button"
5450
+ }, submitText)))));
5451
+ };
5452
+
5453
+ var getIcon = function getIcon(title) {
5454
+ switch (title) {
5455
+ case "align-left":
5456
+ return "AlignLeft";
5457
+ case "align-center":
5458
+ return "AlignCenter";
5459
+ case "align-right":
5460
+ return "AlignRight";
5461
+ case "align-top":
5462
+ return "ArrowUpFromLine";
5463
+ case "align-middle":
5464
+ return "AlignVerticalMiddle";
5465
+ case "align-bottom":
5466
+ return "ArrowDownFromLine";
5467
+ case "text-overflow":
5468
+ return "TextOverflow";
5469
+ case "text-wrap":
5470
+ return "WrapText";
5471
+ case "text-clip":
5472
+ return "TextClip";
5473
+ default:
5474
+ return "";
5475
+ }
5476
+ };
5357
5477
  var Toolbar = function Toolbar(_ref) {
5358
5478
  var _context$luckysheet_s, _flowdata$row, _settings$customToolb;
5359
5479
  var setMoreItems = _ref.setMoreItems,
@@ -5375,6 +5495,10 @@ var Toolbar = function Toolbar(_ref) {
5375
5495
  _useState4 = _slicedToArray(_useState3, 2),
5376
5496
  itemLocations = _useState4[0],
5377
5497
  setItemLocations = _useState4[1];
5498
+ var _useState5 = useState(false),
5499
+ _useState6 = _slicedToArray(_useState5, 2),
5500
+ showDuneModal = _useState6[0],
5501
+ setShowDuneModal = _useState6[1];
5378
5502
  var _useDialog = useDialog(),
5379
5503
  showDialog = _useDialog.showDialog,
5380
5504
  hideDialog = _useDialog.hideDialog;
@@ -5405,12 +5529,12 @@ var Toolbar = function Toolbar(_ref) {
5405
5529
  var sheetWidth = context.luckysheetTableContentHW[0];
5406
5530
  var currency = settings.currency;
5407
5531
  var defaultFormat = defaultFmt(currency);
5408
- var _useState5 = useState("#000000"),
5409
- _useState6 = _slicedToArray(_useState5, 1),
5410
- customColor = _useState6[0];
5411
- var _useState7 = useState("1"),
5532
+ var _useState7 = useState("#000000"),
5412
5533
  _useState8 = _slicedToArray(_useState7, 1),
5413
- customStyle = _useState8[0];
5534
+ customColor = _useState8[0];
5535
+ var _useState9 = useState("1"),
5536
+ _useState0 = _slicedToArray(_useState9, 1),
5537
+ customStyle = _useState0[0];
5414
5538
  var showSubMenu = useCallback(function (e, className) {
5415
5539
  var target = e.target;
5416
5540
  var menuItem = target.className === "fortune-toolbar-menu-line" ? target.parentElement : target;
@@ -5690,27 +5814,38 @@ var Toolbar = function Toolbar(_ref) {
5690
5814
  tooltip: toolbar.horizontalAlign,
5691
5815
  showArrow: false
5692
5816
  }, function (setOpen) {
5693
- return /*#__PURE__*/React.createElement(Select, null, items.map(function (_ref3) {
5694
- var text = _ref3.text,
5695
- title = _ref3.title;
5696
- return /*#__PURE__*/React.createElement(Option, {
5817
+ return /*#__PURE__*/React.createElement(Select, {
5818
+ style: {
5819
+ minWidth: "fit-content",
5820
+ display: "flex",
5821
+ flexDirection: "row",
5822
+ alignItems: "center",
5823
+ justifyContent: "center",
5824
+ gap: 4
5825
+ }
5826
+ }, items.map(function (_ref3) {
5827
+ var _$find2;
5828
+ var title = _ref3.title;
5829
+ return /*#__PURE__*/React.createElement(IconButton, {
5697
5830
  key: title,
5831
+ isActive: ((_$find2 = _.find(items, function (item) {
5832
+ return "".concat(item.value) === "".concat(cell === null || cell === void 0 ? void 0 : cell.ht);
5833
+ })) === null || _$find2 === void 0 ? void 0 : _$find2.title) === title,
5834
+ icon: getIcon(title),
5835
+ variant: "ghost",
5698
5836
  onClick: function onClick() {
5699
5837
  setContext(function (ctx) {
5700
5838
  handleHorizontalAlign(ctx, refs.cellInput.current, title.replace("align-", ""));
5701
5839
  });
5702
5840
  setOpen(false);
5703
- }
5704
- }, /*#__PURE__*/React.createElement("div", {
5705
- className: "fortune-toolbar-menu-line"
5706
- }, text, /*#__PURE__*/React.createElement(SVGIcon, {
5707
- name: title
5708
- })));
5841
+ },
5842
+ tabIndex: 0
5843
+ });
5709
5844
  }));
5710
5845
  });
5711
5846
  }
5712
5847
  if (name === "vertical-align") {
5713
- var _$find2;
5848
+ var _$find3;
5714
5849
  var _items = [{
5715
5850
  title: "align-top",
5716
5851
  text: align.top,
@@ -5725,29 +5860,40 @@ var Toolbar = function Toolbar(_ref) {
5725
5860
  value: 2
5726
5861
  }];
5727
5862
  return /*#__PURE__*/React.createElement(Combo, {
5728
- iconId: ((_$find2 = _.find(_items, function (item) {
5863
+ iconId: ((_$find3 = _.find(_items, function (item) {
5729
5864
  return "".concat(item.value) === "".concat(cell === null || cell === void 0 ? void 0 : cell.vt);
5730
- })) === null || _$find2 === void 0 ? void 0 : _$find2.title) || "align-top",
5865
+ })) === null || _$find3 === void 0 ? void 0 : _$find3.title) || "align-top",
5731
5866
  key: name,
5732
5867
  tooltip: toolbar.verticalAlign,
5733
5868
  showArrow: false
5734
5869
  }, function (setOpen) {
5735
- return /*#__PURE__*/React.createElement(Select, null, _items.map(function (_ref4) {
5736
- var text = _ref4.text,
5737
- title = _ref4.title;
5738
- return /*#__PURE__*/React.createElement(Option, {
5870
+ return /*#__PURE__*/React.createElement(Select, {
5871
+ style: {
5872
+ minWidth: "fit-content",
5873
+ display: "flex",
5874
+ flexDirection: "row",
5875
+ alignItems: "center",
5876
+ justifyContent: "center",
5877
+ gap: 4
5878
+ }
5879
+ }, _items.map(function (_ref4) {
5880
+ var _$find4;
5881
+ var title = _ref4.title;
5882
+ return /*#__PURE__*/React.createElement(IconButton, {
5739
5883
  key: title,
5884
+ isActive: ((_$find4 = _.find(_items, function (item) {
5885
+ return "".concat(item.value) === "".concat(cell === null || cell === void 0 ? void 0 : cell.vt);
5886
+ })) === null || _$find4 === void 0 ? void 0 : _$find4.title) === title,
5887
+ icon: getIcon(title),
5888
+ variant: "ghost",
5740
5889
  onClick: function onClick() {
5741
5890
  setContext(function (ctx) {
5742
5891
  handleVerticalAlign(ctx, refs.cellInput.current, title.replace("align-", ""));
5743
5892
  });
5744
5893
  setOpen(false);
5745
- }
5746
- }, /*#__PURE__*/React.createElement("div", {
5747
- className: "fortune-toolbar-menu-line"
5748
- }, text, /*#__PURE__*/React.createElement(SVGIcon, {
5749
- name: title
5750
- })));
5894
+ },
5895
+ tabIndex: 0
5896
+ });
5751
5897
  }));
5752
5898
  });
5753
5899
  }
@@ -5822,7 +5968,7 @@ var Toolbar = function Toolbar(_ref) {
5822
5968
  key: name,
5823
5969
  onClick: function onClick() {
5824
5970
  if (context.allowEdit === false) return;
5825
- showDialog(/*#__PURE__*/React.createElement(DataVerification, null));
5971
+ showDialog(/*#__PURE__*/React.createElement(DataVerification, null), undefined, toolbar.dataVerification);
5826
5972
  }
5827
5973
  });
5828
5974
  }
@@ -6296,12 +6442,23 @@ var Toolbar = function Toolbar(_ref) {
6296
6442
  tooltip: toolbar.textWrap,
6297
6443
  showArrow: false
6298
6444
  }, function (setOpen) {
6299
- return /*#__PURE__*/React.createElement(Select, null, _items6.map(function (_ref1) {
6300
- var text = _ref1.text,
6301
- iconId = _ref1.iconId,
6445
+ return /*#__PURE__*/React.createElement(Select, {
6446
+ style: {
6447
+ minWidth: "fit-content",
6448
+ display: "flex",
6449
+ flexDirection: "row",
6450
+ alignItems: "center",
6451
+ justifyContent: "center",
6452
+ gap: 4
6453
+ }
6454
+ }, _items6.map(function (_ref1) {
6455
+ var iconId = _ref1.iconId,
6302
6456
  value = _ref1.value;
6303
- return /*#__PURE__*/React.createElement(Option, {
6457
+ return /*#__PURE__*/React.createElement(IconButton, {
6304
6458
  key: value,
6459
+ isActive: _curr.value === value,
6460
+ icon: getIcon(iconId),
6461
+ variant: "ghost",
6305
6462
  onClick: function onClick() {
6306
6463
  setContext(function (ctx) {
6307
6464
  var d = getFlowdata(ctx);
@@ -6309,12 +6466,9 @@ var Toolbar = function Toolbar(_ref) {
6309
6466
  updateFormat(ctx, refs.cellInput.current, d, "tb", value);
6310
6467
  });
6311
6468
  setOpen(false);
6312
- }
6313
- }, /*#__PURE__*/React.createElement("div", {
6314
- className: "fortune-toolbar-menu-line"
6315
- }, text, /*#__PURE__*/React.createElement(SVGIcon, {
6316
- name: iconId
6317
- })));
6469
+ },
6470
+ tabIndex: 0
6471
+ });
6318
6472
  }));
6319
6473
  });
6320
6474
  }
@@ -6465,7 +6619,7 @@ var Toolbar = function Toolbar(_ref) {
6465
6619
  });
6466
6620
  }
6467
6621
  });
6468
- }, [toolbar, cell, setContext, refs.cellInput, refs.fxInput, refs.globalCache, defaultFormat, align, handleUndo, handleRedo, flowdata, formula, showDialog, hideDialog, merge, border, freezen, screenshot, sort, textWrap, rotation, filter, splitText, findAndReplace, context.luckysheet_select_save, context.defaultFontSize, context.allowEdit, comment, fontarray, hideSubMenu, showSubMenu, refs.canvas, customColor, customStyle, toolbarFormat.moreCurrency]);
6622
+ }, [toolbar, cell, setContext, refs.cellInput, refs.fxInput, refs.globalCache, defaultFormat, align, handleUndo, handleRedo, flowdata, formula, showDuneModal, merge, border, freezen, screenshot, sort, textWrap, rotation, filter, splitText, findAndReplace, context.luckysheet_select_save, context.defaultFontSize, context.allowEdit, comment, fontarray, hideSubMenu, showSubMenu, refs.canvas, customColor, customStyle, toolbarFormat.moreCurrency]);
6469
6623
  return /*#__PURE__*/React.createElement("div", {
6470
6624
  ref: containerRef,
6471
6625
  className: "fortune-toolbar",
@@ -6520,7 +6674,29 @@ var Toolbar = function Toolbar(_ref) {
6520
6674
  icon: n.icon,
6521
6675
  iconName: n.iconName
6522
6676
  }, n.children);
6523
- }));
6677
+ }), /*#__PURE__*/React.createElement(Button, {
6678
+ iconId: "dune-logo",
6679
+ tooltip: "Insert Dune Chart",
6680
+ key: "dune-charts",
6681
+ onClick: function onClick() {
6682
+ if (context.allowEdit === false) return;
6683
+ setShowDuneModal(true);
6684
+ }
6685
+ }), showDuneModal && (/*#__PURE__*/React.createElement(DuneChartsInputModal, {
6686
+ isOpen: showDuneModal,
6687
+ onSubmit: function onSubmit(url) {
6688
+ setContext(function (draftCtx) {
6689
+ insertDuneChart(draftCtx, url);
6690
+ });
6691
+ setShowDuneModal(false);
6692
+ },
6693
+ onClose: function onClose() {
6694
+ return setShowDuneModal(false);
6695
+ },
6696
+ icon: "dune-logo",
6697
+ placeholder: "Add Dune chart link to embed",
6698
+ submitText: "Embed Dune chart"
6699
+ })));
6524
6700
  };
6525
6701
 
6526
6702
  var LocationBox = function LocationBox() {
@@ -9651,6 +9827,74 @@ var SVGDefines = function SVGDefines(_ref) {
9651
9827
  "clip-rule": "evenodd",
9652
9828
  d: "M12.75 2.25C13.1642 2.25 13.5 2.58579 13.5 3V15C13.5 15.4142 13.1642 15.75 12.75 15.75C12.3358 15.75 12 15.4142 12 15V3C12 2.58579 12.3358 2.25 12.75 2.25Z",
9653
9829
  fill: "#363B3F"
9830
+ })), /*#__PURE__*/React.createElement("symbol", {
9831
+ id: "dune-logo",
9832
+ viewBox: "0 0 18 16",
9833
+ fill: "none"
9834
+ }, /*#__PURE__*/React.createElement("svg", {
9835
+ width: "18",
9836
+ height: "16",
9837
+ viewBox: "0 0 18 16",
9838
+ fill: "none",
9839
+ xmlns: "http://www.w3.org/2000/svg"
9840
+ }, /*#__PURE__*/React.createElement("g", {
9841
+ "clip-path": "url(#clip0_80_246690)"
9842
+ }, /*#__PURE__*/React.createElement("path", {
9843
+ d: "M7.99485 15.9875C12.4102 15.9875 15.9896 12.4085 15.9896 7.99373C15.9896 3.57891 12.4102 0 7.99485 0C3.57941 0 0 3.57891 0 7.99373C0 12.4085 3.57941 15.9875 7.99485 15.9875Z",
9844
+ fill: "#F4603E"
9845
+ }), /*#__PURE__*/React.createElement("path", {
9846
+ d: "M1.39258 12.5028C1.39258 12.5028 6.67562 10.7723 15.9868 7.73633C15.9868 7.73633 16.4968 12.7082 11.3424 15.3015C11.3424 15.3015 8.80068 16.5197 6.01215 15.7383C6.01215 15.7383 3.23545 15.2142 1.39258 12.5028Z",
9847
+ fill: "#1E1870"
9848
+ })), /*#__PURE__*/React.createElement("defs", null, /*#__PURE__*/React.createElement("clipPath", {
9849
+ id: "clip0_80_246690"
9850
+ }, /*#__PURE__*/React.createElement("rect", {
9851
+ width: "16",
9852
+ height: "16",
9853
+ fill: "white"
9854
+ }))))), /*#__PURE__*/React.createElement("symbol", {
9855
+ id: "circle-alert",
9856
+ viewBox: "0 0 14 14",
9857
+ fill: "none"
9858
+ }, /*#__PURE__*/React.createElement("svg", {
9859
+ width: "14",
9860
+ height: "14",
9861
+ viewBox: "0 0 14 14",
9862
+ fill: "none",
9863
+ xmlns: "http://www.w3.org/2000/svg"
9864
+ }, /*#__PURE__*/React.createElement("g", {
9865
+ "clip-path": "url(#clip0_138_127604)"
9866
+ }, /*#__PURE__*/React.createElement("path", {
9867
+ d: "M6.99967 4.0835C7.32184 4.0835 7.58301 4.34466 7.58301 4.66683V7.00016C7.58301 7.32233 7.32184 7.5835 6.99967 7.5835C6.67751 7.5835 6.41634 7.32233 6.41634 7.00016V4.66683C6.41634 4.34466 6.67751 4.0835 6.99967 4.0835Z",
9868
+ fill: "#FB3449"
9869
+ }), /*#__PURE__*/React.createElement("path", {
9870
+ d: "M6.99967 8.75016C6.67751 8.75016 6.41634 9.01133 6.41634 9.3335C6.41634 9.65566 6.67751 9.91683 6.99967 9.91683H7.00551C7.32767 9.91683 7.58884 9.65566 7.58884 9.3335C7.58884 9.01133 7.32767 8.75016 7.00551 8.75016H6.99967Z",
9871
+ fill: "#FB3449"
9872
+ }), /*#__PURE__*/React.createElement("path", {
9873
+ "fill-rule": "evenodd",
9874
+ "clip-rule": "evenodd",
9875
+ d: "M0.583008 7.00016C0.583008 3.45634 3.45585 0.583496 6.99967 0.583496C10.5435 0.583496 13.4163 3.45634 13.4163 7.00016C13.4163 10.544 10.5435 13.4168 6.99967 13.4168C3.45585 13.4168 0.583008 10.544 0.583008 7.00016ZM6.99967 1.75016C4.10018 1.75016 1.74967 4.10067 1.74967 7.00016C1.74967 9.89966 4.10018 12.2502 6.99967 12.2502C9.89917 12.2502 12.2497 9.89966 12.2497 7.00016C12.2497 4.10067 9.89917 1.75016 6.99967 1.75016Z",
9876
+ fill: "#FB3449"
9877
+ })), /*#__PURE__*/React.createElement("defs", null, /*#__PURE__*/React.createElement("clipPath", {
9878
+ id: "clip0_138_127604"
9879
+ }, /*#__PURE__*/React.createElement("rect", {
9880
+ width: "14",
9881
+ height: "14",
9882
+ fill: "white"
9883
+ }))))), /*#__PURE__*/React.createElement("symbol", {
9884
+ id: "caret-down-fill",
9885
+ width: "14",
9886
+ height: "14",
9887
+ viewBox: "0 0 14 14",
9888
+ fill: "none"
9889
+ }, /*#__PURE__*/React.createElement("rect", {
9890
+ width: "14",
9891
+ height: "14",
9892
+ rx: "4",
9893
+ fill: "black",
9894
+ "fill-opacity": "0.1"
9895
+ }), /*#__PURE__*/React.createElement("path", {
9896
+ d: "M6.64775 8.97978L3.77152 6.10355C3.45654 5.78857 3.67962 5.25 4.12507 5.25H9.87753C10.323 5.25 10.5461 5.78857 10.2311 6.10355L7.35486 8.97978C7.15959 9.17504 6.84301 9.17504 6.64775 8.97978Z",
9897
+ fill: "#363B3F"
9654
9898
  }))));
9655
9899
  };
9656
9900
 
@@ -11013,6 +11257,48 @@ var SheetList = function SheetList() {
11013
11257
  }));
11014
11258
  };
11015
11259
 
11260
+ var DunePreview = function DunePreview(_ref) {
11261
+ var url = _ref.url,
11262
+ position = _ref.position,
11263
+ onKeepAsLink = _ref.onKeepAsLink,
11264
+ onEmbed = _ref.onEmbed;
11265
+ var embedUrl = sanitizeDuneUrl(url);
11266
+ if (!embedUrl) return null;
11267
+ return /*#__PURE__*/React.createElement("div", {
11268
+ className: "fortune-dune-preview",
11269
+ style: {
11270
+ left: position.left,
11271
+ top: position.top
11272
+ },
11273
+ onClick: function onClick(e) {
11274
+ return e.stopPropagation();
11275
+ }
11276
+ }, /*#__PURE__*/React.createElement("div", {
11277
+ className: "fortune-dune-preview-header"
11278
+ }, /*#__PURE__*/React.createElement("span", {
11279
+ className: "fortune-dune-preview-title"
11280
+ }, "Detected Dune chart link")), /*#__PURE__*/React.createElement("div", {
11281
+ className: "fortune-dune-preview-content"
11282
+ }, /*#__PURE__*/React.createElement("iframe", {
11283
+ src: embedUrl,
11284
+ title: "Dune Chart Preview",
11285
+ style: {
11286
+ width: "100%",
11287
+ height: "100%",
11288
+ border: "none"
11289
+ }
11290
+ })), /*#__PURE__*/React.createElement("p", null, "Do you want to insert Dune chart?"), /*#__PURE__*/React.createElement("div", {
11291
+ className: "fortune-dune-preview-footer"
11292
+ }, /*#__PURE__*/React.createElement(Button$1, {
11293
+ variant: "ghost",
11294
+ onClick: onKeepAsLink,
11295
+ className: "!w-fit px-0"
11296
+ }, "Keep as Link"), /*#__PURE__*/React.createElement(Button$1, {
11297
+ onClick: onEmbed,
11298
+ className: "!w-fit px-0"
11299
+ }, "Embed")));
11300
+ };
11301
+
11016
11302
  var _excluded = ["onChange", "onOp", "data"];
11017
11303
  enablePatches();
11018
11304
  var triggerGroupValuesRefresh = function triggerGroupValuesRefresh(ctx) {
@@ -11545,7 +11831,25 @@ var Workbook = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
11545
11831
  style: {
11546
11832
  width: "60px"
11547
11833
  }
11548
- }, formula.count, ": ", calInfo.count)), !!calInfo.numberC && !!calInfo.sum && (/*#__PURE__*/React.createElement("div", null, formula.sum, ": ", calInfo.sum)), !!calInfo.numberC && !!calInfo.average && (/*#__PURE__*/React.createElement("div", null, formula.average, ": ", calInfo.average)), !!calInfo.numberC && !!calInfo.max && (/*#__PURE__*/React.createElement("div", null, formula.max, ": ", calInfo.max)), !!calInfo.numberC && !!calInfo.min && (/*#__PURE__*/React.createElement("div", null, formula.min, ": ", calInfo.min)))))));
11834
+ }, formula.count, ": ", calInfo.count)), !!calInfo.numberC && !!calInfo.sum && (/*#__PURE__*/React.createElement("div", null, formula.sum, ": ", calInfo.sum)), !!calInfo.numberC && !!calInfo.average && (/*#__PURE__*/React.createElement("div", null, formula.average, ": ", calInfo.average)), !!calInfo.numberC && !!calInfo.max && (/*#__PURE__*/React.createElement("div", null, formula.max, ": ", calInfo.max)), !!calInfo.numberC && !!calInfo.min && (/*#__PURE__*/React.createElement("div", null, formula.min, ": ", calInfo.min)))), context.showDunePreview && (/*#__PURE__*/React.createElement(DunePreview, {
11835
+ url: context.showDunePreview.url,
11836
+ position: context.showDunePreview.position,
11837
+ onKeepAsLink: function onKeepAsLink() {
11838
+ setContextWithProduce(function (draftCtx) {
11839
+ draftCtx.showDunePreview = undefined;
11840
+ }, {
11841
+ noHistory: true
11842
+ });
11843
+ },
11844
+ onEmbed: function onEmbed() {
11845
+ setContextWithProduce(function (draftCtx) {
11846
+ insertDuneChart(draftCtx, context.showDunePreview.url);
11847
+ draftCtx.showDunePreview = undefined;
11848
+ }, {
11849
+ noHistory: true
11850
+ });
11851
+ }
11852
+ })))));
11549
11853
  });
11550
11854
 
11551
11855
  export { Workbook };