@fileverse-dev/ddoc 3.0.53-patch-26 → 3.0.53-patch-29

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.
Files changed (2) hide show
  1. package/dist/index.es.js +35 -54
  2. package/package.json +1 -1
package/dist/index.es.js CHANGED
@@ -184004,21 +184004,19 @@ const Aqe = "space-xsm gap-xsm hover:color-bg-default-hover cursor-pointer h-[30
184004
184004
  isVersionHistoryMode: f
184005
184005
  }) => {
184006
184006
  var C, j;
184007
- const [g, m] = Ne(!0), b = Qe(
184008
- `panel-${Math.random().toString(36).slice(2, 8)}`
184009
- ), y = e.findIndex((S) => S.id === t), x = e.find((S) => S.id === t), v = (h == null ? void 0 : h.defaultTabId) || ku, D = (x == null ? void 0 : x.id) === v, w = y > 0, k = y >= 0 && y < e.length - 1, E = (S, I) => {
184007
+ const [g, m] = Ne(!1), b = e.findIndex((S) => S.id === t), y = e.find((S) => S.id === t), x = (h == null ? void 0 : h.defaultTabId) || ku, v = (y == null ? void 0 : y.id) === x, D = b > 0, w = b >= 0 && b < e.length - 1, k = (S, I) => {
184010
184008
  a(S, { newName: I });
184011
- }, A = (S, I) => {
184009
+ }, E = (S, I) => {
184012
184010
  a(S, { emoji: I });
184011
+ }, A = () => {
184012
+ if (!D) return;
184013
+ const S = e[b - 1];
184014
+ S && n(S.id);
184013
184015
  }, L = () => {
184014
184016
  if (!w) return;
184015
- const S = e[y - 1];
184016
- S && n(S.id);
184017
- }, O = () => {
184018
- if (!k) return;
184019
- const S = e[y + 1];
184017
+ const S = e[b + 1];
184020
184018
  S && n(S.id);
184021
- }, _ = [
184019
+ }, O = [
184022
184020
  [
184023
184021
  {
184024
184022
  id: "new-tab",
@@ -184033,22 +184031,22 @@ const Aqe = "space-xsm gap-xsm hover:color-bg-default-hover cursor-pointer h-[30
184033
184031
  label: "Rename",
184034
184032
  icon: "SquarePen",
184035
184033
  onSelect: () => {
184036
- if (!x || typeof window > "u") return;
184037
- const S = window.prompt("Rename tab", x.name);
184034
+ if (!y || typeof window > "u") return;
184035
+ const S = window.prompt("Rename tab", y.name);
184038
184036
  if (!S) return;
184039
184037
  const I = S.trim();
184040
- I && a(x.id, { newName: I });
184038
+ I && a(y.id, { newName: I });
184041
184039
  },
184042
- visible: !!x
184040
+ visible: !!y
184043
184041
  },
184044
184042
  {
184045
184043
  id: "duplicate",
184046
184044
  label: "Duplicate",
184047
184045
  icon: "Copy",
184048
184046
  onSelect: () => {
184049
- x && u(x.id);
184047
+ y && u(y.id);
184050
184048
  },
184051
- visible: !!x
184049
+ visible: !!y
184052
184050
  }
184053
184051
  ],
184054
184052
  [
@@ -184058,9 +184056,9 @@ const Aqe = "space-xsm gap-xsm hover:color-bg-default-hover cursor-pointer h-[30
184058
184056
  icon: "Share2",
184059
184057
  onSelect: () => {
184060
184058
  var S;
184061
- x && ((S = h == null ? void 0 : h.onCopyTabLink) == null || S.call(h, x.id));
184059
+ y && ((S = h == null ? void 0 : h.onCopyTabLink) == null || S.call(h, y.id));
184062
184060
  },
184063
- visible: !!(x && (h != null && h.onCopyTabLink))
184061
+ visible: !!(y && (h != null && h.onCopyTabLink))
184064
184062
  }
184065
184063
  ],
184066
184064
  [
@@ -184071,35 +184069,18 @@ const Aqe = "space-xsm gap-xsm hover:color-bg-default-hover cursor-pointer h-[30
184071
184069
  textClassName: "color-text-danger",
184072
184070
  iconStroke: "#FB3449",
184073
184071
  onSelect: () => {
184074
- !x || !c || D || c(x.id);
184072
+ !y || !c || v || c(y.id);
184075
184073
  },
184076
- visible: !!(x && c && !D)
184074
+ visible: !!(y && c && !v)
184077
184075
  }
184078
184076
  ]
184079
- ], N = f || p;
184080
- return Ie(() => {
184081
- console.log("[DocumentMobileTabPanel] state", {
184082
- panelInstanceId: b.current,
184083
- isPreviewMode: p,
184084
- isVersionHistoryMode: f,
184085
- showContent: g,
184086
- tabCount: e.length
184087
- });
184088
- }, [p, f, g, e.length]), /* @__PURE__ */ F.jsx(
184077
+ ], _ = f || p, N = g && !f;
184078
+ return /* @__PURE__ */ F.jsx(
184089
184079
  "div",
184090
184080
  {
184091
- "data-ddoc-mobile-tab-panel": b.current,
184092
184081
  className: "fixed z-[999] w-full flex flex-col transition-[bottom] duration-300 ease-[cubic-bezier(0.22,1,0.36,1)]",
184093
- onClick: () => {
184094
- console.log("[DocumentMobileTabPanel] clicked", {
184095
- panelInstanceId: b.current,
184096
- isPreviewMode: p,
184097
- isVersionHistoryMode: f,
184098
- showContent: g
184099
- });
184100
- },
184101
184082
  style: {
184102
- bottom: g ? "0px" : f ? "var(--version-sheet-bottom, 24px)" : "24px"
184083
+ bottom: N ? "0px" : f ? "var(--version-sheet-bottom, 24px)" : "24px"
184103
184084
  },
184104
184085
  children: /* @__PURE__ */ F.jsx(
184105
184086
  "div",
@@ -184107,9 +184088,9 @@ const Aqe = "space-xsm gap-xsm hover:color-bg-default-hover cursor-pointer h-[30
184107
184088
  className: ut(
184108
184089
  "rounded-t-[12px] color-bg-default flex flex-col w-full gap-[8px] overflow-hidden",
184109
184090
  "transition-all duration-400 ease-[cubic-bezier(0.16,1,0.3,1)]",
184110
- g ? "h-[300px] space-md shadow-[0_-12px_32px_rgba(0,0,0,0.18)]" : "h-[54px] px-[8px] py-[4px] border color-bg-secondary shadow-none"
184091
+ N ? "h-[300px] space-md shadow-[0_-12px_32px_rgba(0,0,0,0.18)]" : "h-[54px] px-[8px] py-[4px] border color-bg-secondary shadow-none"
184111
184092
  ),
184112
- children: g ? /* @__PURE__ */ F.jsxs(F.Fragment, { children: [
184093
+ children: N ? /* @__PURE__ */ F.jsxs(F.Fragment, { children: [
184113
184094
  /* @__PURE__ */ F.jsxs(
184114
184095
  "div",
184115
184096
  {
@@ -184151,8 +184132,8 @@ const Aqe = "space-xsm gap-xsm hover:color-bg-default-hover cursor-pointer h-[30
184151
184132
  hideContentMenu: !0,
184152
184133
  name: S.name,
184153
184134
  emoji: S.emoji || "",
184154
- onNameChange: (I) => E(S.id, I),
184155
- onEmojiChange: (I) => A(S.id, I),
184135
+ onNameChange: (I) => k(S.id, I),
184136
+ onEmojiChange: (I) => E(S.id, I),
184156
184137
  onDuplicate: () => u(S.id),
184157
184138
  isActive: S.id === t,
184158
184139
  onClick: () => n(S.id),
@@ -184188,7 +184169,7 @@ const Aqe = "space-xsm gap-xsm hover:color-bg-default-hover cursor-pointer h-[30
184188
184169
  ))
184189
184170
  }
184190
184171
  )
184191
- ] }) : N ? /* @__PURE__ */ F.jsxs(
184172
+ ] }) : _ ? /* @__PURE__ */ F.jsxs(
184192
184173
  "div",
184193
184174
  {
184194
184175
  id: "tab-nav",
@@ -184201,12 +184182,12 @@ const Aqe = "space-xsm gap-xsm hover:color-bg-default-hover cursor-pointer h-[30
184201
184182
  "button",
184202
184183
  {
184203
184184
  type: "button",
184204
- onClick: L,
184205
- disabled: !w,
184185
+ onClick: A,
184186
+ disabled: !D,
184206
184187
  "aria-label": "Go to previous tab",
184207
184188
  className: ut(
184208
184189
  "h-[32px] w-[32px] flex items-center justify-center transition-opacity duration-200",
184209
- w ? "cursor-pointer" : "opacity-40 cursor-not-allowed"
184190
+ D ? "cursor-pointer" : "opacity-40 cursor-not-allowed"
184210
184191
  ),
184211
184192
  children: /* @__PURE__ */ F.jsx(Ue, { name: "ChevronLeft", className: "w-[20px] h-[20px]" })
184212
184193
  }
@@ -184215,7 +184196,7 @@ const Aqe = "space-xsm gap-xsm hover:color-bg-default-hover cursor-pointer h-[30
184215
184196
  "div",
184216
184197
  {
184217
184198
  onClick: () => !f && m(!0),
184218
- className: "flex flex-col px-[12px] cursor-pointer transition-opacity duration-200 hover:opacity-80",
184199
+ className: "flex flex-col px-[12px] items-center cursor-pointer transition-opacity duration-200 hover:opacity-80",
184219
184200
  children: [
184220
184201
  /* @__PURE__ */ F.jsxs("div", { className: "flex items-center gap-[8px] justify-center py-[4px]", children: [
184221
184202
  /* @__PURE__ */ F.jsx(
@@ -184227,7 +184208,7 @@ const Aqe = "space-xsm gap-xsm hover:color-bg-default-hover cursor-pointer h-[30
184227
184208
  ),
184228
184209
  /* @__PURE__ */ F.jsx("p", { className: "text-heading-xsm", children: ((C = e.find((S) => S.id === t)) == null ? void 0 : C.name) ?? "Tab name" })
184229
184210
  ] }),
184230
- /* @__PURE__ */ F.jsxs("div", { className: "h-[16px] flex items-center", children: [
184211
+ !f && /* @__PURE__ */ F.jsxs("div", { className: "h-[16px] flex items-center", children: [
184231
184212
  /* @__PURE__ */ F.jsxs("span", { className: "text-helper-text-sm color-text-secondary", children: [
184232
184213
  e.length,
184233
184214
  " tabs."
@@ -184241,12 +184222,12 @@ const Aqe = "space-xsm gap-xsm hover:color-bg-default-hover cursor-pointer h-[30
184241
184222
  "button",
184242
184223
  {
184243
184224
  type: "button",
184244
- onClick: O,
184245
- disabled: !k,
184225
+ onClick: L,
184226
+ disabled: !w,
184246
184227
  "aria-label": "Go to next tab",
184247
184228
  className: ut(
184248
184229
  "h-[32px] w-[32px] flex items-center justify-center transition-opacity duration-200",
184249
- k ? "cursor-pointer" : "opacity-40 cursor-not-allowed"
184230
+ w ? "cursor-pointer" : "opacity-40 cursor-not-allowed"
184250
184231
  ),
184251
184232
  children: /* @__PURE__ */ F.jsx(Ue, { name: "ChevronRight", className: "w-[20px] h-[20px]" })
184252
184233
  }
@@ -184287,7 +184268,7 @@ const Aqe = "space-xsm gap-xsm hover:color-bg-default-hover cursor-pointer h-[30
184287
184268
  ]
184288
184269
  }
184289
184270
  ),
184290
- /* @__PURE__ */ F.jsx(lQ, { sections: _ })
184271
+ /* @__PURE__ */ F.jsx(lQ, { sections: O })
184291
184272
  ]
184292
184273
  }
184293
184274
  )
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@fileverse-dev/ddoc",
3
3
  "private": false,
4
4
  "description": "DDoc",
5
- "version": "3.0.53-patch-26",
5
+ "version": "3.0.53-patch-29",
6
6
  "main": "dist/index.es.js",
7
7
  "module": "dist/index.es.js",
8
8
  "exports": {