@stll/folio-react 0.33.0 → 0.34.0
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/{CommentsSidebar-CQJT9gei.js → CommentsSidebar-4XdScjMH.js} +1 -1
- package/dist/{TextContextMenu-BxnNvhJg.js → TextContextMenu-jOBgICwD.js} +110 -97
- package/dist/compat/eigenpal.js +1 -1
- package/dist/index.js +1 -1
- package/dist/{renderAsync-C4XgGuNC.js → renderAsync-B1Y5l8tt.js} +478 -467
- package/package.json +2 -2
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as useDrawerFocus, s as containedHandler } from "./renderAsync-
|
|
1
|
+
import { a as useDrawerFocus, s as containedHandler } from "./renderAsync-B1Y5l8tt.js";
|
|
2
2
|
import { useCallback, useEffect, useEffectEvent, useLayoutEffect, useMemo, useRef, useState } from "react";
|
|
3
3
|
import { CheckIcon, MoreVerticalIcon } from "lucide-react";
|
|
4
4
|
import { useLocale, useTranslations } from "use-intl";
|
|
@@ -99,7 +99,7 @@ function itemIconColor(item) {
|
|
|
99
99
|
return "var(--muted-foreground, var(--doc-text-muted, #737373))";
|
|
100
100
|
}
|
|
101
101
|
const MenuItemComponent = (t0) => {
|
|
102
|
-
const $ = c(
|
|
102
|
+
const $ = c(49);
|
|
103
103
|
const { item, isHighlighted, navigableIndex, onItemClick, onItemEnter } = t0;
|
|
104
104
|
let t1;
|
|
105
105
|
if ($[0] !== item || $[1] !== onItemClick) {
|
|
@@ -138,89 +138,99 @@ const MenuItemComponent = (t0) => {
|
|
|
138
138
|
const t3 = `docx-text-context-menu-item ${isHighlighted ? "docx-text-context-menu-item-highlighted" : ""} ${item.disabled ? "docx-text-context-menu-item-disabled" : ""}`;
|
|
139
139
|
const t4 = item.disabled;
|
|
140
140
|
const t5 = item.disabled;
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
$[
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
141
|
+
let t6;
|
|
142
|
+
if ($[8] !== item.disabled || $[9] !== item.disabledReason) {
|
|
143
|
+
t6 = item.disabled && item.disabledReason !== void 0 && {
|
|
144
|
+
title: item.disabledReason,
|
|
145
|
+
"aria-description": item.disabledReason
|
|
146
|
+
};
|
|
147
|
+
$[8] = item.disabled;
|
|
148
|
+
$[9] = item.disabledReason;
|
|
149
|
+
$[10] = t6;
|
|
150
|
+
} else t6 = $[10];
|
|
151
|
+
const t7 = isHighlighted && !item.disabled ? "var(--accent, var(--doc-primary-light, #f3f4f6))" : "transparent";
|
|
152
|
+
const t8 = item.disabled ? "not-allowed" : "pointer";
|
|
153
|
+
let t9;
|
|
154
|
+
if ($[11] !== item) {
|
|
155
|
+
t9 = itemTextColor(item);
|
|
156
|
+
$[11] = item;
|
|
157
|
+
$[12] = t9;
|
|
158
|
+
} else t9 = $[12];
|
|
159
|
+
const t10 = item.emphasis ? 500 : 400;
|
|
160
|
+
const t11 = item.disabled ? .6 : 1;
|
|
161
|
+
let t12;
|
|
162
|
+
if ($[13] !== t10 || $[14] !== t11 || $[15] !== t7 || $[16] !== t8 || $[17] !== t9) {
|
|
163
|
+
t12 = {
|
|
154
164
|
display: "flex",
|
|
155
165
|
alignItems: "center",
|
|
156
166
|
gap: "10px",
|
|
157
167
|
width: "100%",
|
|
158
168
|
padding: "8px 12px",
|
|
159
169
|
border: "none",
|
|
160
|
-
background:
|
|
161
|
-
cursor:
|
|
170
|
+
background: t7,
|
|
171
|
+
cursor: t8,
|
|
162
172
|
fontSize: "13px",
|
|
163
|
-
color:
|
|
164
|
-
fontWeight:
|
|
173
|
+
color: t9,
|
|
174
|
+
fontWeight: t10,
|
|
165
175
|
textAlign: "left",
|
|
166
|
-
opacity:
|
|
176
|
+
opacity: t11
|
|
167
177
|
};
|
|
168
|
-
$[
|
|
169
|
-
$[
|
|
170
|
-
$[
|
|
171
|
-
$[
|
|
172
|
-
$[
|
|
173
|
-
$[
|
|
174
|
-
} else
|
|
175
|
-
let t12;
|
|
176
|
-
if ($[16] !== item) {
|
|
177
|
-
t12 = itemIconColor(item);
|
|
178
|
-
$[16] = item;
|
|
179
|
-
$[17] = t12;
|
|
180
|
-
} else t12 = $[17];
|
|
178
|
+
$[13] = t10;
|
|
179
|
+
$[14] = t11;
|
|
180
|
+
$[15] = t7;
|
|
181
|
+
$[16] = t8;
|
|
182
|
+
$[17] = t9;
|
|
183
|
+
$[18] = t12;
|
|
184
|
+
} else t12 = $[18];
|
|
181
185
|
let t13;
|
|
182
|
-
if ($[
|
|
183
|
-
t13 =
|
|
186
|
+
if ($[19] !== item) {
|
|
187
|
+
t13 = itemIconColor(item);
|
|
188
|
+
$[19] = item;
|
|
189
|
+
$[20] = t13;
|
|
190
|
+
} else t13 = $[20];
|
|
191
|
+
let t14;
|
|
192
|
+
if ($[21] !== t13) {
|
|
193
|
+
t14 = {
|
|
184
194
|
display: "flex",
|
|
185
|
-
color:
|
|
195
|
+
color: t13
|
|
186
196
|
};
|
|
187
|
-
$[
|
|
188
|
-
$[19] = t13;
|
|
189
|
-
} else t13 = $[19];
|
|
190
|
-
let t14;
|
|
191
|
-
if ($[20] !== item.action || $[21] !== item.icon) {
|
|
192
|
-
t14 = item.icon ?? getActionIcon(item.action);
|
|
193
|
-
$[20] = item.action;
|
|
194
|
-
$[21] = item.icon;
|
|
197
|
+
$[21] = t13;
|
|
195
198
|
$[22] = t14;
|
|
196
199
|
} else t14 = $[22];
|
|
197
200
|
let t15;
|
|
198
|
-
if ($[23] !==
|
|
199
|
-
t15 =
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
});
|
|
203
|
-
$[23] = t13;
|
|
204
|
-
$[24] = t14;
|
|
201
|
+
if ($[23] !== item.action || $[24] !== item.icon) {
|
|
202
|
+
t15 = item.icon ?? getActionIcon(item.action);
|
|
203
|
+
$[23] = item.action;
|
|
204
|
+
$[24] = item.icon;
|
|
205
205
|
$[25] = t15;
|
|
206
206
|
} else t15 = $[25];
|
|
207
207
|
let t16;
|
|
208
|
-
if ($[26]
|
|
209
|
-
t16 =
|
|
210
|
-
|
|
211
|
-
|
|
208
|
+
if ($[26] !== t14 || $[27] !== t15) {
|
|
209
|
+
t16 = /* @__PURE__ */ jsx("span", {
|
|
210
|
+
style: t14,
|
|
211
|
+
children: t15
|
|
212
|
+
});
|
|
213
|
+
$[26] = t14;
|
|
214
|
+
$[27] = t15;
|
|
215
|
+
$[28] = t16;
|
|
216
|
+
} else t16 = $[28];
|
|
212
217
|
let t17;
|
|
213
|
-
if ($[
|
|
214
|
-
t17 =
|
|
215
|
-
|
|
218
|
+
if ($[29] === Symbol.for("react.memo_cache_sentinel")) {
|
|
219
|
+
t17 = { flex: 1 };
|
|
220
|
+
$[29] = t17;
|
|
221
|
+
} else t17 = $[29];
|
|
222
|
+
let t18;
|
|
223
|
+
if ($[30] !== item.label) {
|
|
224
|
+
t18 = /* @__PURE__ */ jsx("span", {
|
|
225
|
+
style: t17,
|
|
216
226
|
children: item.label
|
|
217
227
|
});
|
|
218
|
-
$[
|
|
219
|
-
$[
|
|
220
|
-
} else
|
|
221
|
-
let
|
|
222
|
-
if ($[
|
|
223
|
-
|
|
228
|
+
$[30] = item.label;
|
|
229
|
+
$[31] = t18;
|
|
230
|
+
} else t18 = $[31];
|
|
231
|
+
let t19;
|
|
232
|
+
if ($[32] !== item.shortcut) {
|
|
233
|
+
t19 = item.shortcut && /* @__PURE__ */ jsx("span", {
|
|
224
234
|
style: {
|
|
225
235
|
fontSize: "11px",
|
|
226
236
|
color: "var(--muted-foreground, var(--doc-text-subtle, #737373))",
|
|
@@ -228,12 +238,12 @@ const MenuItemComponent = (t0) => {
|
|
|
228
238
|
},
|
|
229
239
|
children: item.shortcut
|
|
230
240
|
});
|
|
231
|
-
$[
|
|
232
|
-
$[
|
|
233
|
-
} else
|
|
234
|
-
let
|
|
235
|
-
if ($[
|
|
236
|
-
|
|
241
|
+
$[32] = item.shortcut;
|
|
242
|
+
$[33] = t19;
|
|
243
|
+
} else t19 = $[33];
|
|
244
|
+
let t20;
|
|
245
|
+
if ($[34] !== handleClick || $[35] !== handleMouseEnter || $[36] !== item.disabled || $[37] !== t12 || $[38] !== t16 || $[39] !== t18 || $[40] !== t19 || $[41] !== t3 || $[42] !== t6) {
|
|
246
|
+
t20 = /* @__PURE__ */ jsxs("button", {
|
|
237
247
|
type: "button",
|
|
238
248
|
className: t3,
|
|
239
249
|
onClick: handleClick,
|
|
@@ -241,26 +251,28 @@ const MenuItemComponent = (t0) => {
|
|
|
241
251
|
disabled: t4,
|
|
242
252
|
role: "menuitem",
|
|
243
253
|
"aria-disabled": t5,
|
|
244
|
-
|
|
254
|
+
...t6,
|
|
255
|
+
style: t12,
|
|
245
256
|
children: [
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
257
|
+
t16,
|
|
258
|
+
t18,
|
|
259
|
+
t19
|
|
249
260
|
]
|
|
250
261
|
});
|
|
251
|
-
$[
|
|
252
|
-
$[
|
|
253
|
-
$[
|
|
254
|
-
$[
|
|
255
|
-
$[
|
|
256
|
-
$[
|
|
257
|
-
$[
|
|
258
|
-
$[
|
|
259
|
-
$[
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
262
|
+
$[34] = handleClick;
|
|
263
|
+
$[35] = handleMouseEnter;
|
|
264
|
+
$[36] = item.disabled;
|
|
265
|
+
$[37] = t12;
|
|
266
|
+
$[38] = t16;
|
|
267
|
+
$[39] = t18;
|
|
268
|
+
$[40] = t19;
|
|
269
|
+
$[41] = t3;
|
|
270
|
+
$[42] = t6;
|
|
271
|
+
$[43] = t20;
|
|
272
|
+
} else t20 = $[43];
|
|
273
|
+
let t21;
|
|
274
|
+
if ($[44] !== item.dividerAfter) {
|
|
275
|
+
t21 = item.dividerAfter && /* @__PURE__ */ jsx("div", {
|
|
264
276
|
className: "docx-text-context-menu-separator",
|
|
265
277
|
style: {
|
|
266
278
|
height: "1px",
|
|
@@ -268,17 +280,17 @@ const MenuItemComponent = (t0) => {
|
|
|
268
280
|
margin: "4px 12px"
|
|
269
281
|
}
|
|
270
282
|
});
|
|
271
|
-
$[
|
|
272
|
-
$[
|
|
273
|
-
} else
|
|
274
|
-
let
|
|
275
|
-
if ($[
|
|
276
|
-
|
|
277
|
-
$[
|
|
278
|
-
$[
|
|
279
|
-
$[
|
|
280
|
-
} else
|
|
281
|
-
return
|
|
283
|
+
$[44] = item.dividerAfter;
|
|
284
|
+
$[45] = t21;
|
|
285
|
+
} else t21 = $[45];
|
|
286
|
+
let t22;
|
|
287
|
+
if ($[46] !== t20 || $[47] !== t21) {
|
|
288
|
+
t22 = /* @__PURE__ */ jsxs(Fragment, { children: [t20, t21] });
|
|
289
|
+
$[46] = t20;
|
|
290
|
+
$[47] = t21;
|
|
291
|
+
$[48] = t22;
|
|
292
|
+
} else t22 = $[48];
|
|
293
|
+
return t22;
|
|
282
294
|
};
|
|
283
295
|
const TextContextMenu = ({ isOpen, position, hasSelection, isEditable, hasClipboardContent = true, onAction, onClose, items, className = "" }) => {
|
|
284
296
|
const menuRef = useRef(null);
|
|
@@ -318,6 +330,7 @@ const TextContextMenu = ({ isOpen, position, hasSelection, isEditable, hasClipbo
|
|
|
318
330
|
};
|
|
319
331
|
if (item.shortcut !== void 0) menuItem.shortcut = item.shortcut;
|
|
320
332
|
if (item.dividerAfter !== void 0) menuItem.dividerAfter = item.dividerAfter;
|
|
333
|
+
if (item.disabledReason !== void 0) menuItem.disabledReason = item.disabledReason;
|
|
321
334
|
return menuItem;
|
|
322
335
|
});
|
|
323
336
|
const navigableItems = menuItems.filter((item_0) => item_0.action !== "separator");
|
package/dist/compat/eigenpal.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as DocxEditor$1, t as renderAsync } from "../renderAsync-
|
|
1
|
+
import { n as DocxEditor$1, t as renderAsync } from "../renderAsync-B1Y5l8tt.js";
|
|
2
2
|
import { t as messages_exports } from "../messages-DjrCTI3y.js";
|
|
3
3
|
import { c } from "react-compiler-runtime";
|
|
4
4
|
import { forwardRef } from "react";
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { c as ZOOM_PRESETS, d as parseZoom, f as useWheelZoom, i as ZoomControl, l as clampZoom, n as DocxEditor, o as AutocompleteCaretOverlay, r as FormattingBar, t as renderAsync, u as formatZoom } from "./renderAsync-
|
|
1
|
+
import { c as ZOOM_PRESETS, d as parseZoom, f as useWheelZoom, i as ZoomControl, l as clampZoom, n as DocxEditor, o as AutocompleteCaretOverlay, r as FormattingBar, t as renderAsync, u as formatZoom } from "./renderAsync-B1Y5l8tt.js";
|
|
2
2
|
import { n as FolioUIProvider } from "./folio-ui-CEFqJgCh.js";
|
|
3
3
|
import { t as FindReplaceDialog } from "./FindReplaceDialog-DbbzquBV.js";
|
|
4
4
|
import { t as FootnotePropertiesDialog } from "./FootnotePropertiesDialog-BBq9iBzN.js";
|