@fileverse-dev/dsheet 0.0.57 → 0.0.58

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 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 t = () => {
677
- const o = document.getElementsByClassName("template-button")[0];
678
- o && (o.style.backgroundColor = r ? "#FFDE0A" : "");
679
- }, a = () => {
680
- const o = document.getElementsByClassName("export-button")[0];
681
- o && (o.style.backgroundColor = e ? "#FFDE0A" : "");
682
- }, n = setInterval(() => {
683
- t(), a();
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(n);
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(() => {
@@ -290101,7 +290121,7 @@ const Mwt = ({
290101
290121
  currentDataRef: y,
290102
290122
  setForceSheetRender: F,
290103
290123
  sheetEditorRef: g
290104
- }), PK({ exportDropdownOpen: u, isTemplateOpen: s });
290124
+ }), PK({ exportDropdownOpen: u, isTemplateOpen: s, isReadOnly: t, loading: v });
290105
290125
  const w = {
290106
290126
  sheetEditorRef: g,
290107
290127
  currentDataRef: y,
@@ -290118,7 +290138,7 @@ const Mwt = ({
290118
290138
  {
290119
290139
  id: "Navbar",
290120
290140
  className: yC(
290121
- `h-14 color-bg-default py-2 px-4 flex gap-2 items-center
290141
+ `h-[44px] color-bg-default px-4 flex gap-2 items-center
290122
290142
  justify-between w-screen fixed left-0 top-0 border-b
290123
290143
  color-border-default z-50 transition-transform duration-300`,
290124
290144
  {
@@ -290132,7 +290152,7 @@ const Mwt = ({
290132
290152
  /* @__PURE__ */ vr.jsxs(
290133
290153
  "div",
290134
290154
  {
290135
- style: { height: "96.4%", marginTop: "56px" },
290155
+ style: { height: "97.8%", marginTop: "44px" },
290136
290156
  className: "relative overflow-hidden",
290137
290157
  children: [
290138
290158
  /* @__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;