@fileverse-dev/fortune-react 1.0.2-mod-36 → 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/components/DuneChartsInputModal/DuneChartsInputModal.d.ts +12 -0
- package/dist/components/DunePreview/DunePreview.d.ts +13 -0
- package/dist/components/IFrameBoxs/iFrameBoxs.d.ts +3 -0
- package/dist/components/Workbook/api.d.ts +8 -0
- package/dist/components/Workbook/index.d.ts +8 -0
- package/dist/index.css +157 -0
- package/dist/index.esm.css +157 -0
- package/dist/index.esm.js +352 -10
- package/dist/index.js +351 -9
- package/dist/index.umd.css +157 -0
- package/dist/index.umd.js +353 -11
- package/dist/index.umd.min.css +1 -1
- package/dist/index.umd.min.js +9 -9
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -3523,6 +3523,118 @@ var DropDownList = function DropDownList() {
|
|
|
3523
3523
|
}));
|
|
3524
3524
|
};
|
|
3525
3525
|
|
|
3526
|
+
var IframeBoxs = function IframeBoxs() {
|
|
3527
|
+
var _context$insertedIfra;
|
|
3528
|
+
var _useContext = React.useContext(WorkbookContext),
|
|
3529
|
+
context = _useContext.context,
|
|
3530
|
+
setContext = _useContext.setContext,
|
|
3531
|
+
refs = _useContext.refs;
|
|
3532
|
+
var containerRef = React.useRef(null);
|
|
3533
|
+
React.useEffect(function () {
|
|
3534
|
+
var handleClickOutside = function handleClickOutside(e) {
|
|
3535
|
+
if (!containerRef.current) return;
|
|
3536
|
+
var iframeBoxes = containerRef.current.querySelectorAll(".luckysheet-modal-dialog-iframe");
|
|
3537
|
+
var clickedInsideSomeIframe = Array.from(iframeBoxes).some(function (el) {
|
|
3538
|
+
return el.contains(e.target);
|
|
3539
|
+
});
|
|
3540
|
+
if (!clickedInsideSomeIframe && context.activeIframe !== undefined) {
|
|
3541
|
+
setContext(function (ctx) {
|
|
3542
|
+
ctx.activeIframe = undefined;
|
|
3543
|
+
});
|
|
3544
|
+
}
|
|
3545
|
+
};
|
|
3546
|
+
document.addEventListener("mousedown", handleClickOutside);
|
|
3547
|
+
return function () {
|
|
3548
|
+
document.removeEventListener("mousedown", handleClickOutside);
|
|
3549
|
+
};
|
|
3550
|
+
}, [context.activeIframe, setContext]);
|
|
3551
|
+
return /*#__PURE__*/React__default['default'].createElement("div", {
|
|
3552
|
+
id: "fortune-iframe-boxes",
|
|
3553
|
+
ref: containerRef
|
|
3554
|
+
}, (_context$insertedIfra = context.insertedIframes) === null || _context$insertedIfra === void 0 ? void 0 : _context$insertedIfra.map(function (frame) {
|
|
3555
|
+
var isActive = frame.id === context.activeIframe;
|
|
3556
|
+
var style = {
|
|
3557
|
+
width: frame.width * context.zoomRatio,
|
|
3558
|
+
height: frame.height * context.zoomRatio,
|
|
3559
|
+
left: frame.left * context.zoomRatio,
|
|
3560
|
+
top: frame.top * context.zoomRatio,
|
|
3561
|
+
position: "absolute",
|
|
3562
|
+
padding: 0,
|
|
3563
|
+
zIndex: isActive ? 300 : 200
|
|
3564
|
+
};
|
|
3565
|
+
return /*#__PURE__*/React__default['default'].createElement("div", {
|
|
3566
|
+
key: frame.id,
|
|
3567
|
+
id: isActive ? "fortune-modal-dialog-activeIframe" : frame.id,
|
|
3568
|
+
className: "luckysheet-modal-dialog luckysheet-modal-dialog-iframe",
|
|
3569
|
+
style: style,
|
|
3570
|
+
onClick: function onClick(e) {
|
|
3571
|
+
if (!isActive) {
|
|
3572
|
+
setContext(function (ctx) {
|
|
3573
|
+
ctx.activeIframe = frame.id;
|
|
3574
|
+
});
|
|
3575
|
+
}
|
|
3576
|
+
e.stopPropagation();
|
|
3577
|
+
},
|
|
3578
|
+
onMouseDown: function onMouseDown(e) {
|
|
3579
|
+
if (isActive) {
|
|
3580
|
+
fortuneCore.onIframeMoveStart(context, refs.globalCache, e.nativeEvent);
|
|
3581
|
+
}
|
|
3582
|
+
e.stopPropagation();
|
|
3583
|
+
}
|
|
3584
|
+
}, /*#__PURE__*/React__default['default'].createElement("div", {
|
|
3585
|
+
className: "luckysheet-modal-dialog-content",
|
|
3586
|
+
style: {
|
|
3587
|
+
width: "100%",
|
|
3588
|
+
height: "100%",
|
|
3589
|
+
overflow: "hidden"
|
|
3590
|
+
}
|
|
3591
|
+
}, /*#__PURE__*/React__default['default'].createElement("iframe", {
|
|
3592
|
+
title: "iframe-".concat(frame.id),
|
|
3593
|
+
src: frame.src,
|
|
3594
|
+
style: {
|
|
3595
|
+
width: "100%",
|
|
3596
|
+
height: "100%",
|
|
3597
|
+
border: "none",
|
|
3598
|
+
pointerEvents: "none"
|
|
3599
|
+
}
|
|
3600
|
+
})), /*#__PURE__*/React__default['default'].createElement("div", {
|
|
3601
|
+
className: "luckysheet-modal-dialog-border"
|
|
3602
|
+
}), isActive && (/*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, /*#__PURE__*/React__default['default'].createElement("div", {
|
|
3603
|
+
className: "luckysheet-modal-dialog-resize"
|
|
3604
|
+
}, ["lt", "mt", "lm", "rm", "rt", "lb", "mb", "rb"].map(function (dir) {
|
|
3605
|
+
return /*#__PURE__*/React__default['default'].createElement("div", {
|
|
3606
|
+
key: dir,
|
|
3607
|
+
className: "luckysheet-modal-dialog-resize-item luckysheet-modal-dialog-resize-item-".concat(dir),
|
|
3608
|
+
"data-type": dir,
|
|
3609
|
+
style: {
|
|
3610
|
+
zIndex: 300,
|
|
3611
|
+
position: "absolute"
|
|
3612
|
+
},
|
|
3613
|
+
onMouseDown: function onMouseDown(e) {
|
|
3614
|
+
fortuneCore.onIframeResizeStart(context, refs.globalCache, e.nativeEvent, dir);
|
|
3615
|
+
e.stopPropagation();
|
|
3616
|
+
}
|
|
3617
|
+
});
|
|
3618
|
+
})), /*#__PURE__*/React__default['default'].createElement("div", {
|
|
3619
|
+
className: "luckysheet-modal-dialog-controll"
|
|
3620
|
+
}, /*#__PURE__*/React__default['default'].createElement("span", {
|
|
3621
|
+
className: "luckysheet-modal-controll-btn luckysheet-modal-controll-del",
|
|
3622
|
+
role: "button",
|
|
3623
|
+
tabIndex: 0,
|
|
3624
|
+
title: "Delete",
|
|
3625
|
+
onClick: function onClick() {
|
|
3626
|
+
setContext(function (ctx) {
|
|
3627
|
+
var _ctx$insertedIframes;
|
|
3628
|
+
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) {
|
|
3629
|
+
return f.id !== frame.id;
|
|
3630
|
+
});
|
|
3631
|
+
ctx.activeIframe = undefined;
|
|
3632
|
+
});
|
|
3633
|
+
}
|
|
3634
|
+
}, "DELETE")))));
|
|
3635
|
+
}));
|
|
3636
|
+
};
|
|
3637
|
+
|
|
3526
3638
|
var SheetOverlay = function SheetOverlay() {
|
|
3527
3639
|
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;
|
|
3528
3640
|
var _useContext = React.useContext(WorkbookContext),
|
|
@@ -3965,7 +4077,7 @@ var SheetOverlay = function SheetOverlay() {
|
|
|
3965
4077
|
id: "luckysheet-multipleRange-show"
|
|
3966
4078
|
}), /*#__PURE__*/React__default['default'].createElement("div", {
|
|
3967
4079
|
id: "luckysheet-dynamicArray-hightShow"
|
|
3968
|
-
}), /*#__PURE__*/React__default['default'].createElement(ImgBoxs, null), /*#__PURE__*/React__default['default'].createElement("div", {
|
|
4080
|
+
}), /*#__PURE__*/React__default['default'].createElement(ImgBoxs, null), /*#__PURE__*/React__default['default'].createElement(IframeBoxs, null), /*#__PURE__*/React__default['default'].createElement("div", {
|
|
3969
4081
|
id: "luckysheet-dataVerification-dropdown-btn",
|
|
3970
4082
|
onClick: function onClick() {
|
|
3971
4083
|
setContext(function (ctx) {
|
|
@@ -5259,6 +5371,97 @@ var FormatSearch = function FormatSearch(_ref) {
|
|
|
5259
5371
|
}, button.cancel)));
|
|
5260
5372
|
};
|
|
5261
5373
|
|
|
5374
|
+
var DuneChartsInputModal = function DuneChartsInputModal(_ref) {
|
|
5375
|
+
var isOpen = _ref.isOpen,
|
|
5376
|
+
onClose = _ref.onClose,
|
|
5377
|
+
onSubmit = _ref.onSubmit,
|
|
5378
|
+
icon = _ref.icon,
|
|
5379
|
+
_ref$submitText = _ref.submitText,
|
|
5380
|
+
submitText = _ref$submitText === void 0 ? "Submit" : _ref$submitText,
|
|
5381
|
+
_ref$placeholder = _ref.placeholder,
|
|
5382
|
+
placeholder = _ref$placeholder === void 0 ? "Enter a value..." : _ref$placeholder;
|
|
5383
|
+
var _useState = React.useState(""),
|
|
5384
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
5385
|
+
url = _useState2[0],
|
|
5386
|
+
setUrl = _useState2[1];
|
|
5387
|
+
var _useState3 = React.useState(false),
|
|
5388
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
5389
|
+
showError = _useState4[0],
|
|
5390
|
+
setShowError = _useState4[1];
|
|
5391
|
+
var inputRef = React.useRef(null);
|
|
5392
|
+
React.useEffect(function () {
|
|
5393
|
+
if (isOpen && inputRef.current) {
|
|
5394
|
+
var timer = setTimeout(function () {
|
|
5395
|
+
var _inputRef$current;
|
|
5396
|
+
(_inputRef$current = inputRef.current) === null || _inputRef$current === void 0 ? void 0 : _inputRef$current.focus();
|
|
5397
|
+
}, 100);
|
|
5398
|
+
return function () {
|
|
5399
|
+
return clearTimeout(timer);
|
|
5400
|
+
};
|
|
5401
|
+
}
|
|
5402
|
+
return undefined;
|
|
5403
|
+
}, [isOpen]);
|
|
5404
|
+
if (!isOpen) return null;
|
|
5405
|
+
var handleSubmit = function handleSubmit() {
|
|
5406
|
+
var trimmed = url.trim();
|
|
5407
|
+
if (trimmed && fortuneCore.sanitizeDuneUrl(trimmed)) {
|
|
5408
|
+
onSubmit(trimmed);
|
|
5409
|
+
setUrl("");
|
|
5410
|
+
setShowError(false);
|
|
5411
|
+
onClose();
|
|
5412
|
+
} else {
|
|
5413
|
+
setShowError(true);
|
|
5414
|
+
}
|
|
5415
|
+
};
|
|
5416
|
+
var handleKeyDown = function handleKeyDown(e) {
|
|
5417
|
+
e.stopPropagation();
|
|
5418
|
+
if (e.key === "Enter") {
|
|
5419
|
+
handleSubmit();
|
|
5420
|
+
}
|
|
5421
|
+
};
|
|
5422
|
+
return /*#__PURE__*/React__default['default'].createElement("div", {
|
|
5423
|
+
className: "custom-overlay",
|
|
5424
|
+
onClick: onClose
|
|
5425
|
+
}, /*#__PURE__*/React__default['default'].createElement("div", {
|
|
5426
|
+
className: "input-modal",
|
|
5427
|
+
style: {
|
|
5428
|
+
transformOrigin: "top center"
|
|
5429
|
+
},
|
|
5430
|
+
onClick: function onClick(e) {
|
|
5431
|
+
return e.stopPropagation();
|
|
5432
|
+
},
|
|
5433
|
+
onKeyDown: handleKeyDown
|
|
5434
|
+
}, /*#__PURE__*/React__default['default'].createElement("div", {
|
|
5435
|
+
className: "modal-header"
|
|
5436
|
+
}, /*#__PURE__*/React__default['default'].createElement(SVGIcon, {
|
|
5437
|
+
name: icon
|
|
5438
|
+
}), /*#__PURE__*/React__default['default'].createElement("input", {
|
|
5439
|
+
ref: inputRef,
|
|
5440
|
+
className: "modal-input",
|
|
5441
|
+
type: "text",
|
|
5442
|
+
placeholder: placeholder,
|
|
5443
|
+
value: url,
|
|
5444
|
+
onChange: function onChange(e) {
|
|
5445
|
+
setUrl(e.target.value);
|
|
5446
|
+
setShowError(false);
|
|
5447
|
+
},
|
|
5448
|
+
onKeyDown: handleKeyDown
|
|
5449
|
+
})), showError && (/*#__PURE__*/React__default['default'].createElement("div", {
|
|
5450
|
+
className: "modal-error-message"
|
|
5451
|
+
}, /*#__PURE__*/React__default['default'].createElement(SVGIcon, {
|
|
5452
|
+
style: {
|
|
5453
|
+
width: "14px",
|
|
5454
|
+
height: "14px"
|
|
5455
|
+
},
|
|
5456
|
+
name: "circle-alert"
|
|
5457
|
+
}), /*#__PURE__*/React__default['default'].createElement("span", null, "Please make sure the URL is a valid Dune chart link"))), url.length > 0 && !showError && (/*#__PURE__*/React__default['default'].createElement("div", {
|
|
5458
|
+
className: "modal-footer"
|
|
5459
|
+
}, /*#__PURE__*/React__default['default'].createElement(ui.Button, {
|
|
5460
|
+
onClick: handleSubmit,
|
|
5461
|
+
className: "modal-button"
|
|
5462
|
+
}, submitText)))));
|
|
5463
|
+
};
|
|
5464
|
+
|
|
5262
5465
|
var getIcon = function getIcon(title) {
|
|
5263
5466
|
switch (title) {
|
|
5264
5467
|
case "align-left":
|
|
@@ -5304,6 +5507,10 @@ var Toolbar = function Toolbar(_ref) {
|
|
|
5304
5507
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
5305
5508
|
itemLocations = _useState4[0],
|
|
5306
5509
|
setItemLocations = _useState4[1];
|
|
5510
|
+
var _useState5 = React.useState(false),
|
|
5511
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
5512
|
+
showDuneModal = _useState6[0],
|
|
5513
|
+
setShowDuneModal = _useState6[1];
|
|
5307
5514
|
var _useDialog = useDialog(),
|
|
5308
5515
|
showDialog = _useDialog.showDialog,
|
|
5309
5516
|
hideDialog = _useDialog.hideDialog;
|
|
@@ -5334,12 +5541,12 @@ var Toolbar = function Toolbar(_ref) {
|
|
|
5334
5541
|
var sheetWidth = context.luckysheetTableContentHW[0];
|
|
5335
5542
|
var currency = settings.currency;
|
|
5336
5543
|
var defaultFormat = defaultFmt(currency);
|
|
5337
|
-
var
|
|
5338
|
-
_useState6 = _slicedToArray(_useState5, 1),
|
|
5339
|
-
customColor = _useState6[0];
|
|
5340
|
-
var _useState7 = React.useState("1"),
|
|
5544
|
+
var _useState7 = React.useState("#000000"),
|
|
5341
5545
|
_useState8 = _slicedToArray(_useState7, 1),
|
|
5342
|
-
|
|
5546
|
+
customColor = _useState8[0];
|
|
5547
|
+
var _useState9 = React.useState("1"),
|
|
5548
|
+
_useState0 = _slicedToArray(_useState9, 1),
|
|
5549
|
+
customStyle = _useState0[0];
|
|
5343
5550
|
var showSubMenu = React.useCallback(function (e, className) {
|
|
5344
5551
|
var target = e.target;
|
|
5345
5552
|
var menuItem = target.className === "fortune-toolbar-menu-line" ? target.parentElement : target;
|
|
@@ -6424,7 +6631,7 @@ var Toolbar = function Toolbar(_ref) {
|
|
|
6424
6631
|
});
|
|
6425
6632
|
}
|
|
6426
6633
|
});
|
|
6427
|
-
}, [toolbar, cell, setContext, refs.cellInput, refs.fxInput, refs.globalCache, defaultFormat, align, handleUndo, handleRedo, flowdata, formula,
|
|
6634
|
+
}, [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]);
|
|
6428
6635
|
return /*#__PURE__*/React__default['default'].createElement("div", {
|
|
6429
6636
|
ref: containerRef,
|
|
6430
6637
|
className: "fortune-toolbar",
|
|
@@ -6479,7 +6686,29 @@ var Toolbar = function Toolbar(_ref) {
|
|
|
6479
6686
|
icon: n.icon,
|
|
6480
6687
|
iconName: n.iconName
|
|
6481
6688
|
}, n.children);
|
|
6482
|
-
})
|
|
6689
|
+
}), /*#__PURE__*/React__default['default'].createElement(Button, {
|
|
6690
|
+
iconId: "dune-logo",
|
|
6691
|
+
tooltip: "Insert Dune Chart",
|
|
6692
|
+
key: "dune-charts",
|
|
6693
|
+
onClick: function onClick() {
|
|
6694
|
+
if (context.allowEdit === false) return;
|
|
6695
|
+
setShowDuneModal(true);
|
|
6696
|
+
}
|
|
6697
|
+
}), showDuneModal && (/*#__PURE__*/React__default['default'].createElement(DuneChartsInputModal, {
|
|
6698
|
+
isOpen: showDuneModal,
|
|
6699
|
+
onSubmit: function onSubmit(url) {
|
|
6700
|
+
setContext(function (draftCtx) {
|
|
6701
|
+
fortuneCore.insertDuneChart(draftCtx, url);
|
|
6702
|
+
});
|
|
6703
|
+
setShowDuneModal(false);
|
|
6704
|
+
},
|
|
6705
|
+
onClose: function onClose() {
|
|
6706
|
+
return setShowDuneModal(false);
|
|
6707
|
+
},
|
|
6708
|
+
icon: "dune-logo",
|
|
6709
|
+
placeholder: "Add Dune chart link to embed",
|
|
6710
|
+
submitText: "Embed Dune chart"
|
|
6711
|
+
})));
|
|
6483
6712
|
};
|
|
6484
6713
|
|
|
6485
6714
|
var LocationBox = function LocationBox() {
|
|
@@ -9611,6 +9840,59 @@ var SVGDefines = function SVGDefines(_ref) {
|
|
|
9611
9840
|
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",
|
|
9612
9841
|
fill: "#363B3F"
|
|
9613
9842
|
})), /*#__PURE__*/React__default['default'].createElement("symbol", {
|
|
9843
|
+
id: "dune-logo",
|
|
9844
|
+
viewBox: "0 0 18 16",
|
|
9845
|
+
fill: "none"
|
|
9846
|
+
}, /*#__PURE__*/React__default['default'].createElement("svg", {
|
|
9847
|
+
width: "18",
|
|
9848
|
+
height: "16",
|
|
9849
|
+
viewBox: "0 0 18 16",
|
|
9850
|
+
fill: "none",
|
|
9851
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
9852
|
+
}, /*#__PURE__*/React__default['default'].createElement("g", {
|
|
9853
|
+
"clip-path": "url(#clip0_80_246690)"
|
|
9854
|
+
}, /*#__PURE__*/React__default['default'].createElement("path", {
|
|
9855
|
+
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",
|
|
9856
|
+
fill: "#F4603E"
|
|
9857
|
+
}), /*#__PURE__*/React__default['default'].createElement("path", {
|
|
9858
|
+
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",
|
|
9859
|
+
fill: "#1E1870"
|
|
9860
|
+
})), /*#__PURE__*/React__default['default'].createElement("defs", null, /*#__PURE__*/React__default['default'].createElement("clipPath", {
|
|
9861
|
+
id: "clip0_80_246690"
|
|
9862
|
+
}, /*#__PURE__*/React__default['default'].createElement("rect", {
|
|
9863
|
+
width: "16",
|
|
9864
|
+
height: "16",
|
|
9865
|
+
fill: "white"
|
|
9866
|
+
}))))), /*#__PURE__*/React__default['default'].createElement("symbol", {
|
|
9867
|
+
id: "circle-alert",
|
|
9868
|
+
viewBox: "0 0 14 14",
|
|
9869
|
+
fill: "none"
|
|
9870
|
+
}, /*#__PURE__*/React__default['default'].createElement("svg", {
|
|
9871
|
+
width: "14",
|
|
9872
|
+
height: "14",
|
|
9873
|
+
viewBox: "0 0 14 14",
|
|
9874
|
+
fill: "none",
|
|
9875
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
9876
|
+
}, /*#__PURE__*/React__default['default'].createElement("g", {
|
|
9877
|
+
"clip-path": "url(#clip0_138_127604)"
|
|
9878
|
+
}, /*#__PURE__*/React__default['default'].createElement("path", {
|
|
9879
|
+
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",
|
|
9880
|
+
fill: "#FB3449"
|
|
9881
|
+
}), /*#__PURE__*/React__default['default'].createElement("path", {
|
|
9882
|
+
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",
|
|
9883
|
+
fill: "#FB3449"
|
|
9884
|
+
}), /*#__PURE__*/React__default['default'].createElement("path", {
|
|
9885
|
+
"fill-rule": "evenodd",
|
|
9886
|
+
"clip-rule": "evenodd",
|
|
9887
|
+
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",
|
|
9888
|
+
fill: "#FB3449"
|
|
9889
|
+
})), /*#__PURE__*/React__default['default'].createElement("defs", null, /*#__PURE__*/React__default['default'].createElement("clipPath", {
|
|
9890
|
+
id: "clip0_138_127604"
|
|
9891
|
+
}, /*#__PURE__*/React__default['default'].createElement("rect", {
|
|
9892
|
+
width: "14",
|
|
9893
|
+
height: "14",
|
|
9894
|
+
fill: "white"
|
|
9895
|
+
}))))), /*#__PURE__*/React__default['default'].createElement("symbol", {
|
|
9614
9896
|
id: "caret-down-fill",
|
|
9615
9897
|
width: "14",
|
|
9616
9898
|
height: "14",
|
|
@@ -10987,6 +11269,48 @@ var SheetList = function SheetList() {
|
|
|
10987
11269
|
}));
|
|
10988
11270
|
};
|
|
10989
11271
|
|
|
11272
|
+
var DunePreview = function DunePreview(_ref) {
|
|
11273
|
+
var url = _ref.url,
|
|
11274
|
+
position = _ref.position,
|
|
11275
|
+
onKeepAsLink = _ref.onKeepAsLink,
|
|
11276
|
+
onEmbed = _ref.onEmbed;
|
|
11277
|
+
var embedUrl = fortuneCore.sanitizeDuneUrl(url);
|
|
11278
|
+
if (!embedUrl) return null;
|
|
11279
|
+
return /*#__PURE__*/React__default['default'].createElement("div", {
|
|
11280
|
+
className: "fortune-dune-preview",
|
|
11281
|
+
style: {
|
|
11282
|
+
left: position.left,
|
|
11283
|
+
top: position.top
|
|
11284
|
+
},
|
|
11285
|
+
onClick: function onClick(e) {
|
|
11286
|
+
return e.stopPropagation();
|
|
11287
|
+
}
|
|
11288
|
+
}, /*#__PURE__*/React__default['default'].createElement("div", {
|
|
11289
|
+
className: "fortune-dune-preview-header"
|
|
11290
|
+
}, /*#__PURE__*/React__default['default'].createElement("span", {
|
|
11291
|
+
className: "fortune-dune-preview-title"
|
|
11292
|
+
}, "Detected Dune chart link")), /*#__PURE__*/React__default['default'].createElement("div", {
|
|
11293
|
+
className: "fortune-dune-preview-content"
|
|
11294
|
+
}, /*#__PURE__*/React__default['default'].createElement("iframe", {
|
|
11295
|
+
src: embedUrl,
|
|
11296
|
+
title: "Dune Chart Preview",
|
|
11297
|
+
style: {
|
|
11298
|
+
width: "100%",
|
|
11299
|
+
height: "100%",
|
|
11300
|
+
border: "none"
|
|
11301
|
+
}
|
|
11302
|
+
})), /*#__PURE__*/React__default['default'].createElement("p", null, "Do you want to insert Dune chart?"), /*#__PURE__*/React__default['default'].createElement("div", {
|
|
11303
|
+
className: "fortune-dune-preview-footer"
|
|
11304
|
+
}, /*#__PURE__*/React__default['default'].createElement(ui.Button, {
|
|
11305
|
+
variant: "ghost",
|
|
11306
|
+
onClick: onKeepAsLink,
|
|
11307
|
+
className: "!w-fit px-0"
|
|
11308
|
+
}, "Keep as Link"), /*#__PURE__*/React__default['default'].createElement(ui.Button, {
|
|
11309
|
+
onClick: onEmbed,
|
|
11310
|
+
className: "!w-fit px-0"
|
|
11311
|
+
}, "Embed")));
|
|
11312
|
+
};
|
|
11313
|
+
|
|
10990
11314
|
var _excluded = ["onChange", "onOp", "data"];
|
|
10991
11315
|
produce.enablePatches();
|
|
10992
11316
|
var triggerGroupValuesRefresh = function triggerGroupValuesRefresh(ctx) {
|
|
@@ -11519,7 +11843,25 @@ var Workbook = /*#__PURE__*/React__default['default'].forwardRef(function (_ref,
|
|
|
11519
11843
|
style: {
|
|
11520
11844
|
width: "60px"
|
|
11521
11845
|
}
|
|
11522
|
-
}, formula.count, ": ", calInfo.count)), !!calInfo.numberC && !!calInfo.sum && (/*#__PURE__*/React__default['default'].createElement("div", null, formula.sum, ": ", calInfo.sum)), !!calInfo.numberC && !!calInfo.average && (/*#__PURE__*/React__default['default'].createElement("div", null, formula.average, ": ", calInfo.average)), !!calInfo.numberC && !!calInfo.max && (/*#__PURE__*/React__default['default'].createElement("div", null, formula.max, ": ", calInfo.max)), !!calInfo.numberC && !!calInfo.min && (/*#__PURE__*/React__default['default'].createElement("div", null, formula.min, ": ", calInfo.min))))
|
|
11846
|
+
}, formula.count, ": ", calInfo.count)), !!calInfo.numberC && !!calInfo.sum && (/*#__PURE__*/React__default['default'].createElement("div", null, formula.sum, ": ", calInfo.sum)), !!calInfo.numberC && !!calInfo.average && (/*#__PURE__*/React__default['default'].createElement("div", null, formula.average, ": ", calInfo.average)), !!calInfo.numberC && !!calInfo.max && (/*#__PURE__*/React__default['default'].createElement("div", null, formula.max, ": ", calInfo.max)), !!calInfo.numberC && !!calInfo.min && (/*#__PURE__*/React__default['default'].createElement("div", null, formula.min, ": ", calInfo.min)))), context.showDunePreview && (/*#__PURE__*/React__default['default'].createElement(DunePreview, {
|
|
11847
|
+
url: context.showDunePreview.url,
|
|
11848
|
+
position: context.showDunePreview.position,
|
|
11849
|
+
onKeepAsLink: function onKeepAsLink() {
|
|
11850
|
+
setContextWithProduce(function (draftCtx) {
|
|
11851
|
+
draftCtx.showDunePreview = undefined;
|
|
11852
|
+
}, {
|
|
11853
|
+
noHistory: true
|
|
11854
|
+
});
|
|
11855
|
+
},
|
|
11856
|
+
onEmbed: function onEmbed() {
|
|
11857
|
+
setContextWithProduce(function (draftCtx) {
|
|
11858
|
+
fortuneCore.insertDuneChart(draftCtx, context.showDunePreview.url);
|
|
11859
|
+
draftCtx.showDunePreview = undefined;
|
|
11860
|
+
}, {
|
|
11861
|
+
noHistory: true
|
|
11862
|
+
});
|
|
11863
|
+
}
|
|
11864
|
+
})))));
|
|
11523
11865
|
});
|
|
11524
11866
|
|
|
11525
11867
|
exports.Workbook = Workbook;
|
package/dist/index.umd.css
CHANGED
|
@@ -2778,6 +2778,99 @@ label {
|
|
|
2778
2778
|
overflow-y: scroll;
|
|
2779
2779
|
}
|
|
2780
2780
|
|
|
2781
|
+
.custom-overlay {
|
|
2782
|
+
position: absolute;
|
|
2783
|
+
top: 0;
|
|
2784
|
+
left: 0;
|
|
2785
|
+
z-index: 50;
|
|
2786
|
+
height: 100vh;
|
|
2787
|
+
width: 100%;
|
|
2788
|
+
display: grid;
|
|
2789
|
+
place-items: center;
|
|
2790
|
+
}
|
|
2791
|
+
|
|
2792
|
+
.input-modal {
|
|
2793
|
+
position: fixed;
|
|
2794
|
+
top: 25%;
|
|
2795
|
+
left: 50%;
|
|
2796
|
+
transform: translateX(-50%);
|
|
2797
|
+
border-radius: 0.75rem;
|
|
2798
|
+
background-color: #ffffff;
|
|
2799
|
+
padding: 0;
|
|
2800
|
+
border: none;
|
|
2801
|
+
box-shadow: 0px 8px 32px 0px #00000026;
|
|
2802
|
+
animation: fadeIn 0.2s ease-in-out;
|
|
2803
|
+
}
|
|
2804
|
+
|
|
2805
|
+
.modal-header {
|
|
2806
|
+
display: flex;
|
|
2807
|
+
gap: 0.5rem;
|
|
2808
|
+
align-items: center;
|
|
2809
|
+
padding: 0.75rem;
|
|
2810
|
+
border-bottom: 1px solid #e5e7eb;
|
|
2811
|
+
}
|
|
2812
|
+
|
|
2813
|
+
.fetch-url-button {
|
|
2814
|
+
cursor: pointer;
|
|
2815
|
+
}
|
|
2816
|
+
|
|
2817
|
+
.modal-input {
|
|
2818
|
+
border: none;
|
|
2819
|
+
padding: 0;
|
|
2820
|
+
outline: none;
|
|
2821
|
+
-webkit-user-select: text;
|
|
2822
|
+
-moz-user-select: text;
|
|
2823
|
+
user-select: text;
|
|
2824
|
+
max-width: 150px;
|
|
2825
|
+
flex: 1;
|
|
2826
|
+
}
|
|
2827
|
+
|
|
2828
|
+
@media (min-width: 768px) {
|
|
2829
|
+
.modal-input {
|
|
2830
|
+
max-width: 400px;
|
|
2831
|
+
width: 380px !important;
|
|
2832
|
+
}
|
|
2833
|
+
}
|
|
2834
|
+
|
|
2835
|
+
.modal-input:disabled {
|
|
2836
|
+
opacity: 1;
|
|
2837
|
+
}
|
|
2838
|
+
|
|
2839
|
+
@keyframes fadeIn {
|
|
2840
|
+
from {
|
|
2841
|
+
opacity: 0;
|
|
2842
|
+
transform: translateX(-50%) scale(0.95);
|
|
2843
|
+
}
|
|
2844
|
+
to {
|
|
2845
|
+
opacity: 1;
|
|
2846
|
+
transform: translateX(-50%) scale(1);
|
|
2847
|
+
}
|
|
2848
|
+
}
|
|
2849
|
+
|
|
2850
|
+
.modal-footer {
|
|
2851
|
+
display: flex;
|
|
2852
|
+
justify-content: flex-end;
|
|
2853
|
+
padding: 8px 16px;
|
|
2854
|
+
}
|
|
2855
|
+
|
|
2856
|
+
.modal-button {
|
|
2857
|
+
width: 100%;
|
|
2858
|
+
margin: 8px;
|
|
2859
|
+
}
|
|
2860
|
+
|
|
2861
|
+
.modal-error-message {
|
|
2862
|
+
color: #ef4e2f;
|
|
2863
|
+
background: #fff5f5;
|
|
2864
|
+
margin: 8px 16px;
|
|
2865
|
+
padding: 4px 8px;
|
|
2866
|
+
border-radius: 4px;
|
|
2867
|
+
display: flex;
|
|
2868
|
+
align-items: center;
|
|
2869
|
+
gap: 8px;
|
|
2870
|
+
font-size: 12px;
|
|
2871
|
+
font-weight: 400;
|
|
2872
|
+
}
|
|
2873
|
+
|
|
2781
2874
|
.fortune-fx-editor {
|
|
2782
2875
|
display: flex;
|
|
2783
2876
|
flex-direction: row;
|
|
@@ -3637,3 +3730,67 @@ label {
|
|
|
3637
3730
|
display: inline-block;
|
|
3638
3731
|
margin-left: 15px;
|
|
3639
3732
|
}
|
|
3733
|
+
|
|
3734
|
+
.fortune-dune-preview {
|
|
3735
|
+
position: absolute;
|
|
3736
|
+
background-color: #fff;
|
|
3737
|
+
border: 1px solid #e5e5e5;
|
|
3738
|
+
border-radius: 8px;
|
|
3739
|
+
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
|
|
3740
|
+
width: 270px;
|
|
3741
|
+
height: 250px;
|
|
3742
|
+
z-index: 1000;
|
|
3743
|
+
display: flex;
|
|
3744
|
+
flex-direction: column;
|
|
3745
|
+
padding: 8px;
|
|
3746
|
+
gap: 8px;
|
|
3747
|
+
}
|
|
3748
|
+
|
|
3749
|
+
.fortune-dune-preview-header {
|
|
3750
|
+
display: flex;
|
|
3751
|
+
justify-content: space-between;
|
|
3752
|
+
align-items: center;
|
|
3753
|
+
}
|
|
3754
|
+
|
|
3755
|
+
.fortune-dune-preview-title {
|
|
3756
|
+
font-size: 14px;
|
|
3757
|
+
font-weight: 500;
|
|
3758
|
+
color: #363b3f;
|
|
3759
|
+
}
|
|
3760
|
+
|
|
3761
|
+
.fortune-dune-preview-content {
|
|
3762
|
+
flex: 1;
|
|
3763
|
+
overflow: hidden;
|
|
3764
|
+
position: relative;
|
|
3765
|
+
border-radius: 4px;
|
|
3766
|
+
border: 1px solid #f8f9fa;
|
|
3767
|
+
}
|
|
3768
|
+
|
|
3769
|
+
.fortune-dune-preview-footer {
|
|
3770
|
+
display: flex;
|
|
3771
|
+
justify-content: flex-end;
|
|
3772
|
+
gap: 8px;
|
|
3773
|
+
padding: 8px;
|
|
3774
|
+
}
|
|
3775
|
+
|
|
3776
|
+
.fortune-dune-preview-button {
|
|
3777
|
+
padding: 6px 12px;
|
|
3778
|
+
border-radius: 4px;
|
|
3779
|
+
font-size: 14px;
|
|
3780
|
+
cursor: pointer;
|
|
3781
|
+
transition: all 0.2s ease;
|
|
3782
|
+
}
|
|
3783
|
+
|
|
3784
|
+
.fortune-dune-preview-button:hover {
|
|
3785
|
+
background-color: #f5f5f5;
|
|
3786
|
+
}
|
|
3787
|
+
|
|
3788
|
+
.fortune-dune-preview-button-primary {
|
|
3789
|
+
background-color: #1e1870;
|
|
3790
|
+
border-color: #1e1870;
|
|
3791
|
+
color: #fff;
|
|
3792
|
+
}
|
|
3793
|
+
|
|
3794
|
+
.fortune-dune-preview-button-primary:hover {
|
|
3795
|
+
background-color: #2a2379;
|
|
3796
|
+
}
|