@fileverse-dev/dsheet 0.0.57 → 0.0.59
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.es.js +40 -16
- package/dist/package/hooks/use-document-style.d.ts +3 -1
- package/dist/style.css +1 -1
- package/package.json +3 -3
package/dist/index.es.js
CHANGED
|
@@ -670,22 +670,42 @@ var vr = g5.exports, gC = { exports: {} };
|
|
|
670
670
|
var OK = gC.exports;
|
|
671
671
|
const yC = /* @__PURE__ */ R0(OK), PK = ({
|
|
672
672
|
exportDropdownOpen: e = !1,
|
|
673
|
-
isTemplateOpen: r = !1
|
|
673
|
+
isTemplateOpen: r = !1,
|
|
674
|
+
isReadOnly: t = !1,
|
|
675
|
+
loading: a = !1
|
|
674
676
|
}) => {
|
|
675
677
|
Yt(() => {
|
|
676
|
-
const
|
|
677
|
-
const
|
|
678
|
-
|
|
679
|
-
},
|
|
680
|
-
const
|
|
681
|
-
|
|
682
|
-
},
|
|
683
|
-
|
|
678
|
+
const n = () => {
|
|
679
|
+
const s = document.getElementsByClassName("template-button")[0];
|
|
680
|
+
s && (s.style.backgroundColor = r ? "#FFDE0A" : "");
|
|
681
|
+
}, o = () => {
|
|
682
|
+
const s = document.getElementsByClassName("export-button")[0];
|
|
683
|
+
s && (s.style.backgroundColor = e ? "#FFDE0A" : "");
|
|
684
|
+
}, i = setInterval(() => {
|
|
685
|
+
n(), o();
|
|
684
686
|
}, 300);
|
|
685
687
|
return () => {
|
|
686
|
-
clearInterval(
|
|
688
|
+
clearInterval(i);
|
|
687
689
|
};
|
|
688
|
-
}, [e, r])
|
|
690
|
+
}, [e, r]), Yt(() => {
|
|
691
|
+
if (t && a) {
|
|
692
|
+
const n = document.querySelectorAll(".luckysheet-sheets-item-name"), o = (s) => {
|
|
693
|
+
for (let u of s)
|
|
694
|
+
if (u.type === "attributes" && u.attributeName === "contenteditable") {
|
|
695
|
+
const l = u.target, c = u.oldValue;
|
|
696
|
+
console.log(`contenteditable changed from '${c}' to '${l.contentEditable}'`), l.contentEditable === "true" && (console.log("Attempted to set contenteditable to true, forcing it to false."), l.contentEditable = "false");
|
|
697
|
+
}
|
|
698
|
+
}, i = new MutationObserver(o);
|
|
699
|
+
n.forEach((s) => {
|
|
700
|
+
i.observe(s, {
|
|
701
|
+
attributes: !0,
|
|
702
|
+
// Watch for changes to attributes
|
|
703
|
+
attributeOldValue: !0
|
|
704
|
+
// Track the old value of attributes
|
|
705
|
+
});
|
|
706
|
+
});
|
|
707
|
+
}
|
|
708
|
+
}, [t, a]);
|
|
689
709
|
}, h3 = "animate-[pulse_2s_ease-in-out_infinite]", qK = (e) => {
|
|
690
710
|
const [r, t] = _t({ width: 0, height: 0 });
|
|
691
711
|
return Yt(() => {
|
|
@@ -161117,7 +161137,7 @@ var T4t = function() {
|
|
|
161117
161137
|
ref: d.canvas
|
|
161118
161138
|
}), /* @__PURE__ */ V.createElement(M4t, null));
|
|
161119
161139
|
}, a1 = function(r) {
|
|
161120
|
-
var t = r.tooltip, a = r.onClick, n = r.iconId, o = r.disabled, i = r.selected, s = r.children;
|
|
161140
|
+
var t = r.tooltip, a = r.onClick, n = r.iconId, o = r.disabled, i = r.selected, s = r.children, u = r.style;
|
|
161121
161141
|
return /* @__PURE__ */ V.createElement("div", {
|
|
161122
161142
|
className: "fortune-toolbar-button fortune-toolbar-item",
|
|
161123
161143
|
onClick: a,
|
|
@@ -161127,7 +161147,7 @@ var T4t = function() {
|
|
|
161127
161147
|
"aria-label": t,
|
|
161128
161148
|
style: i ? {
|
|
161129
161149
|
backgroundColor: "#E7E5EB"
|
|
161130
|
-
} :
|
|
161150
|
+
} : u
|
|
161131
161151
|
}, /* @__PURE__ */ V.createElement(Tr, {
|
|
161132
161152
|
name: n,
|
|
161133
161153
|
width: 16,
|
|
@@ -162996,6 +163016,10 @@ var T4t = function() {
|
|
|
162996
163016
|
key: "dune-charts",
|
|
162997
163017
|
onClick: function() {
|
|
162998
163018
|
u.allowEdit !== !1 && j(!0);
|
|
163019
|
+
},
|
|
163020
|
+
style: {
|
|
163021
|
+
backgroundColor: "#F4603E2E",
|
|
163022
|
+
borderRadius: "8px"
|
|
162999
163023
|
}
|
|
163000
163024
|
}), D && /* @__PURE__ */ V.createElement(B4t, {
|
|
163001
163025
|
isOpen: D,
|
|
@@ -290101,7 +290125,7 @@ const Mwt = ({
|
|
|
290101
290125
|
currentDataRef: y,
|
|
290102
290126
|
setForceSheetRender: F,
|
|
290103
290127
|
sheetEditorRef: g
|
|
290104
|
-
}), PK({ exportDropdownOpen: u, isTemplateOpen: s });
|
|
290128
|
+
}), PK({ exportDropdownOpen: u, isTemplateOpen: s, isReadOnly: t, loading: v });
|
|
290105
290129
|
const w = {
|
|
290106
290130
|
sheetEditorRef: g,
|
|
290107
290131
|
currentDataRef: y,
|
|
@@ -290118,7 +290142,7 @@ const Mwt = ({
|
|
|
290118
290142
|
{
|
|
290119
290143
|
id: "Navbar",
|
|
290120
290144
|
className: yC(
|
|
290121
|
-
`h-
|
|
290145
|
+
`h-[44px] color-bg-default px-4 flex gap-2 items-center
|
|
290122
290146
|
justify-between w-screen fixed left-0 top-0 border-b
|
|
290123
290147
|
color-border-default z-50 transition-transform duration-300`,
|
|
290124
290148
|
{
|
|
@@ -290132,7 +290156,7 @@ const Mwt = ({
|
|
|
290132
290156
|
/* @__PURE__ */ vr.jsxs(
|
|
290133
290157
|
"div",
|
|
290134
290158
|
{
|
|
290135
|
-
style: { height: "
|
|
290159
|
+
style: { height: "97.8%", marginTop: "44px" },
|
|
290136
290160
|
className: "relative overflow-hidden",
|
|
290137
290161
|
children: [
|
|
290138
290162
|
/* @__PURE__ */ vr.jsx(hC, { show: v, children: /* @__PURE__ */ vr.jsx(GK, { isReadOnly: t }) }),
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
export declare const useFortuneDocumentStyle: ({ exportDropdownOpen, isTemplateOpen, }: {
|
|
1
|
+
export declare const useFortuneDocumentStyle: ({ exportDropdownOpen, isTemplateOpen, isReadOnly, loading }: {
|
|
2
2
|
exportDropdownOpen: boolean;
|
|
3
3
|
isTemplateOpen: boolean | undefined;
|
|
4
|
+
isReadOnly: boolean | undefined;
|
|
5
|
+
loading: boolean;
|
|
4
6
|
}) => void;
|