@pixerate/editor-react 0.16.0 → 0.17.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/README.md +2 -2
- package/dist/canvas/index.cjs +406 -142
- package/dist/canvas/index.cjs.map +1 -1
- package/dist/canvas/index.d.cts +66 -3
- package/dist/canvas/index.d.ts +66 -3
- package/dist/canvas/index.js +277 -0
- package/dist/canvas/index.js.map +1 -1
- package/dist/chunk-I3E4KSA2.js +515 -0
- package/dist/chunk-I3E4KSA2.js.map +1 -0
- package/dist/chunk-JR5ZBDR7.js +2012 -0
- package/dist/chunk-JR5ZBDR7.js.map +1 -0
- package/dist/{chunk-XTFR3IMK.js → chunk-ZU54BMDC.js} +473 -160
- package/dist/chunk-ZU54BMDC.js.map +1 -0
- package/dist/generation/index.cjs +290 -0
- package/dist/generation/index.cjs.map +1 -1
- package/dist/generation/index.d.cts +66 -2
- package/dist/generation/index.d.ts +66 -2
- package/dist/generation/index.js +7 -1
- package/dist/image-editor/index.cjs +490 -187
- package/dist/image-editor/index.cjs.map +1 -1
- package/dist/image-editor/index.d.cts +34 -2
- package/dist/image-editor/index.d.ts +34 -2
- package/dist/image-editor/index.js +5 -1
- package/dist/index.cjs +2372 -731
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +88 -6
- package/dist/index.d.ts +88 -6
- package/dist/index.js +334 -96
- package/dist/index.js.map +1 -1
- package/dist/spreadsheet/index.cjs +943 -112
- package/dist/spreadsheet/index.cjs.map +1 -1
- package/dist/spreadsheet/index.d.cts +119 -7
- package/dist/spreadsheet/index.d.ts +119 -7
- package/dist/spreadsheet/index.js +11 -1
- package/dist/tokens/index.cjs +395 -0
- package/dist/tokens/index.cjs.map +1 -0
- package/dist/tokens/index.d.cts +54 -0
- package/dist/tokens/index.d.ts +54 -0
- package/dist/tokens/index.js +375 -0
- package/dist/tokens/index.js.map +1 -0
- package/package.json +10 -2
- package/dist/chunk-7SPRQZ6H.js +0 -216
- package/dist/chunk-7SPRQZ6H.js.map +0 -1
- package/dist/chunk-FYIPXHAE.js +0 -1169
- package/dist/chunk-FYIPXHAE.js.map +0 -1
- package/dist/chunk-XTFR3IMK.js.map +0 -1
package/dist/index.js
CHANGED
|
@@ -1,21 +1,28 @@
|
|
|
1
1
|
import {
|
|
2
2
|
FormulaHints,
|
|
3
|
+
NameManager,
|
|
4
|
+
SheetTabs,
|
|
5
|
+
SpreadsheetConditionalFormatPanel,
|
|
3
6
|
SpreadsheetContextMenu,
|
|
7
|
+
SpreadsheetDataValidationPanel,
|
|
4
8
|
SpreadsheetEditor,
|
|
5
9
|
SpreadsheetGroupRow,
|
|
10
|
+
SpreadsheetValidationDialog,
|
|
6
11
|
useFillHandle,
|
|
7
12
|
useSpreadsheetClipboard,
|
|
8
13
|
useSpreadsheetEditor
|
|
9
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-JR5ZBDR7.js";
|
|
10
15
|
import {
|
|
11
16
|
AdjustmentLayersPanel,
|
|
12
17
|
ControlSlider,
|
|
13
18
|
CurvesEditor,
|
|
14
19
|
Histogram,
|
|
15
20
|
ImageEditor,
|
|
21
|
+
RefineEdgePanel,
|
|
22
|
+
SelectionOptionsBar,
|
|
16
23
|
useImageEditor,
|
|
17
24
|
useImageHistogram
|
|
18
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-ZU54BMDC.js";
|
|
19
26
|
import {
|
|
20
27
|
CommandPalette,
|
|
21
28
|
useCommandPalette,
|
|
@@ -27,11 +34,14 @@ import {
|
|
|
27
34
|
useAutosave
|
|
28
35
|
} from "./chunk-XWFU2CSG.js";
|
|
29
36
|
import {
|
|
37
|
+
AssetMentionChips,
|
|
38
|
+
GenerationHistory,
|
|
30
39
|
GenerationSettings,
|
|
31
40
|
JobProgress,
|
|
32
41
|
useGenerationPlan,
|
|
42
|
+
useGenerationRecords,
|
|
33
43
|
useJobProgress
|
|
34
|
-
} from "./chunk-
|
|
44
|
+
} from "./chunk-I3E4KSA2.js";
|
|
35
45
|
|
|
36
46
|
// src/hooks/usePromptEditor.ts
|
|
37
47
|
import { useMemo, useEffect, useRef } from "react";
|
|
@@ -576,7 +586,8 @@ function useHistoryShortcuts(manager, options = {}) {
|
|
|
576
586
|
// src/hooks/useFileImport.ts
|
|
577
587
|
import { useEffect as useEffect5, useMemo as useMemo3, useRef as useRef6, useSyncExternalStore as useSyncExternalStore3 } from "react";
|
|
578
588
|
import {
|
|
579
|
-
FileImportController
|
|
589
|
+
FileImportController,
|
|
590
|
+
summarizeImportStructure
|
|
580
591
|
} from "@pixerate/editor";
|
|
581
592
|
function useFileImport(editor, options = {}) {
|
|
582
593
|
const editorRef = useRef6(editor);
|
|
@@ -592,8 +603,10 @@ function useFileImport(editor, options = {}) {
|
|
|
592
603
|
controller.setOptions(options);
|
|
593
604
|
});
|
|
594
605
|
const state = useSyncExternalStore3(controller.subscribe, controller.getState, controller.getState);
|
|
606
|
+
const structureSummary = useMemo3(() => summarizeImportStructure(state.lastOutcomes), [state.lastOutcomes]);
|
|
595
607
|
return {
|
|
596
608
|
...state,
|
|
609
|
+
structureSummary,
|
|
597
610
|
accept: controller.accept,
|
|
598
611
|
openFilePicker: controller.openFilePicker,
|
|
599
612
|
importFiles: controller.importFiles
|
|
@@ -1216,6 +1229,168 @@ var OutlinePanel = ({
|
|
|
1216
1229
|
] });
|
|
1217
1230
|
};
|
|
1218
1231
|
|
|
1232
|
+
// src/hooks/useParagraphStyles.ts
|
|
1233
|
+
import { useMemo as useMemo8, useSyncExternalStore as useSyncExternalStore5 } from "react";
|
|
1234
|
+
import {
|
|
1235
|
+
createParagraphStylesStore,
|
|
1236
|
+
getStyleRegistry
|
|
1237
|
+
} from "@pixerate/editor";
|
|
1238
|
+
function useParagraphStyles(editor) {
|
|
1239
|
+
const store = useMemo8(() => createParagraphStylesStore(editor), [editor]);
|
|
1240
|
+
const snapshot = useSyncExternalStore5(store.subscribe, store.getSnapshot, store.getSnapshot);
|
|
1241
|
+
return useMemo8(() => {
|
|
1242
|
+
const registry = getStyleRegistry(editor);
|
|
1243
|
+
const live = () => editor && !editor.isDestroyed ? editor : null;
|
|
1244
|
+
return {
|
|
1245
|
+
...snapshot,
|
|
1246
|
+
registry,
|
|
1247
|
+
currentStyle: snapshot.currentStyleId && registry?.get(snapshot.currentStyleId) || null,
|
|
1248
|
+
apply: (id) => !!live()?.chain().focus().setParagraphStyle(id).run(),
|
|
1249
|
+
clear: () => !!live()?.chain().focus().clearParagraphStyle().run(),
|
|
1250
|
+
updateFromSelection: (id) => !!live()?.chain().focus().updateParagraphStyleFromSelection(id).run(),
|
|
1251
|
+
createFromSelection: (name, options) => {
|
|
1252
|
+
const e = live();
|
|
1253
|
+
if (!e || !registry) return null;
|
|
1254
|
+
const id = options?.id ?? registry.newId(name.trim());
|
|
1255
|
+
const ok = e.chain().focus().createParagraphStyleFromSelection(name, { ...options, id }).run();
|
|
1256
|
+
return ok ? id : null;
|
|
1257
|
+
},
|
|
1258
|
+
applyCharacterStyle: (id) => !!live()?.chain().focus().setCharacterStyle(id).run()
|
|
1259
|
+
};
|
|
1260
|
+
}, [snapshot, editor]);
|
|
1261
|
+
}
|
|
1262
|
+
|
|
1263
|
+
// src/components/StylesGallery.tsx
|
|
1264
|
+
import { useState as useState8 } from "react";
|
|
1265
|
+
import { jsx as jsx6, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
1266
|
+
var camel = (property) => property.replace(/-([a-z])/g, (_, c) => c.toUpperCase());
|
|
1267
|
+
var keepSelection = (event) => event.preventDefault();
|
|
1268
|
+
var StylesGallery = ({
|
|
1269
|
+
editor,
|
|
1270
|
+
variant = "dropdown",
|
|
1271
|
+
showAllStyles = false,
|
|
1272
|
+
showActions = true,
|
|
1273
|
+
preview = true,
|
|
1274
|
+
className = "relative inline-flex flex-wrap items-center gap-1 text-sm",
|
|
1275
|
+
itemClassName = "rounded px-2 py-1 text-left text-xs text-foreground hover:bg-muted",
|
|
1276
|
+
activeItemClassName = "bg-primary/10 text-primary",
|
|
1277
|
+
onChange
|
|
1278
|
+
}) => {
|
|
1279
|
+
const styles = useParagraphStyles(editor);
|
|
1280
|
+
const [open, setOpen] = useState8(false);
|
|
1281
|
+
const [creating, setCreating] = useState8(false);
|
|
1282
|
+
const [name, setName] = useState8("");
|
|
1283
|
+
const list = showAllStyles ? styles.styles : styles.gallery;
|
|
1284
|
+
const current = styles.currentStyle;
|
|
1285
|
+
const expanded = variant === "gallery" || open;
|
|
1286
|
+
const close = () => {
|
|
1287
|
+
if (variant === "dropdown") setOpen(false);
|
|
1288
|
+
setCreating(false);
|
|
1289
|
+
setName("");
|
|
1290
|
+
};
|
|
1291
|
+
const previewStyle = (id) => {
|
|
1292
|
+
if (!preview || !styles.registry) return void 0;
|
|
1293
|
+
return Object.fromEntries(
|
|
1294
|
+
Object.entries(styles.registry.previewDeclarations(id)).map(([k, v]) => [camel(k), v])
|
|
1295
|
+
);
|
|
1296
|
+
};
|
|
1297
|
+
const apply = (id) => {
|
|
1298
|
+
if (styles.apply(id)) onChange?.({ type: "apply", id });
|
|
1299
|
+
close();
|
|
1300
|
+
};
|
|
1301
|
+
const create = (event) => {
|
|
1302
|
+
event.preventDefault();
|
|
1303
|
+
const id = name.trim() ? styles.createFromSelection(name) : null;
|
|
1304
|
+
if (id) onChange?.({ type: "create", id });
|
|
1305
|
+
close();
|
|
1306
|
+
};
|
|
1307
|
+
return /* @__PURE__ */ jsxs5("div", { className, role: "group", "aria-label": "Paragraph styles", "data-styles-gallery": variant, children: [
|
|
1308
|
+
variant === "dropdown" && /* @__PURE__ */ jsxs5(
|
|
1309
|
+
"button",
|
|
1310
|
+
{
|
|
1311
|
+
type: "button",
|
|
1312
|
+
className: itemClassName,
|
|
1313
|
+
"aria-haspopup": "listbox",
|
|
1314
|
+
"aria-expanded": open,
|
|
1315
|
+
disabled: !editor || !styles.registry,
|
|
1316
|
+
onMouseDown: keepSelection,
|
|
1317
|
+
onClick: () => setOpen((value) => !value),
|
|
1318
|
+
children: [
|
|
1319
|
+
current?.name ?? "Styles",
|
|
1320
|
+
" \u25BE"
|
|
1321
|
+
]
|
|
1322
|
+
}
|
|
1323
|
+
),
|
|
1324
|
+
expanded && /* @__PURE__ */ jsxs5(
|
|
1325
|
+
"div",
|
|
1326
|
+
{
|
|
1327
|
+
className: variant === "dropdown" ? "absolute left-0 top-full z-20 mt-1 flex min-w-[12rem] flex-col gap-0.5 rounded-md border border-border bg-background p-1 shadow-md" : "flex flex-wrap items-center gap-1",
|
|
1328
|
+
children: [
|
|
1329
|
+
/* @__PURE__ */ jsx6("div", { role: "listbox", "aria-label": "Styles", className: variant === "dropdown" ? "flex flex-col gap-0.5" : "flex flex-wrap gap-1", children: list.map((style) => {
|
|
1330
|
+
const active = style.id === styles.currentStyleId;
|
|
1331
|
+
return /* @__PURE__ */ jsx6(
|
|
1332
|
+
"button",
|
|
1333
|
+
{
|
|
1334
|
+
type: "button",
|
|
1335
|
+
role: "option",
|
|
1336
|
+
"aria-selected": active,
|
|
1337
|
+
"data-style-id": style.id,
|
|
1338
|
+
className: active ? `${itemClassName} ${activeItemClassName}` : itemClassName,
|
|
1339
|
+
style: previewStyle(style.id),
|
|
1340
|
+
onMouseDown: keepSelection,
|
|
1341
|
+
onClick: () => apply(style.id),
|
|
1342
|
+
children: style.name
|
|
1343
|
+
},
|
|
1344
|
+
style.id
|
|
1345
|
+
);
|
|
1346
|
+
}) }),
|
|
1347
|
+
showActions && /* @__PURE__ */ jsxs5("div", { className: variant === "dropdown" ? "mt-1 flex flex-col gap-0.5 border-t border-border pt-1" : "flex items-center gap-1", children: [
|
|
1348
|
+
/* @__PURE__ */ jsx6(
|
|
1349
|
+
"button",
|
|
1350
|
+
{
|
|
1351
|
+
type: "button",
|
|
1352
|
+
className: itemClassName,
|
|
1353
|
+
disabled: !current,
|
|
1354
|
+
onMouseDown: keepSelection,
|
|
1355
|
+
onClick: () => {
|
|
1356
|
+
if (current && styles.updateFromSelection(current.id)) {
|
|
1357
|
+
onChange?.({ type: "update", id: current.id });
|
|
1358
|
+
}
|
|
1359
|
+
close();
|
|
1360
|
+
},
|
|
1361
|
+
children: current ? `Update ${current.name} to match selection` : "Update to match selection"
|
|
1362
|
+
}
|
|
1363
|
+
),
|
|
1364
|
+
creating ? /* @__PURE__ */ jsxs5("form", { className: "flex items-center gap-1", onSubmit: create, children: [
|
|
1365
|
+
/* @__PURE__ */ jsx6(
|
|
1366
|
+
"input",
|
|
1367
|
+
{
|
|
1368
|
+
"aria-label": "New style name",
|
|
1369
|
+
className: "w-32 rounded border border-border bg-background px-1 py-0.5 text-xs",
|
|
1370
|
+
value: name,
|
|
1371
|
+
autoFocus: true,
|
|
1372
|
+
onChange: (event) => setName(event.target.value)
|
|
1373
|
+
}
|
|
1374
|
+
),
|
|
1375
|
+
/* @__PURE__ */ jsx6("button", { type: "submit", className: itemClassName, disabled: !name.trim(), children: "Create" })
|
|
1376
|
+
] }) : /* @__PURE__ */ jsx6(
|
|
1377
|
+
"button",
|
|
1378
|
+
{
|
|
1379
|
+
type: "button",
|
|
1380
|
+
className: itemClassName,
|
|
1381
|
+
disabled: !editor || !styles.registry,
|
|
1382
|
+
onMouseDown: keepSelection,
|
|
1383
|
+
onClick: () => setCreating(true),
|
|
1384
|
+
children: "New style from selection"
|
|
1385
|
+
}
|
|
1386
|
+
)
|
|
1387
|
+
] })
|
|
1388
|
+
]
|
|
1389
|
+
}
|
|
1390
|
+
)
|
|
1391
|
+
] });
|
|
1392
|
+
};
|
|
1393
|
+
|
|
1219
1394
|
// src/index.ts
|
|
1220
1395
|
import {
|
|
1221
1396
|
DirtyTracker as DirtyTracker2,
|
|
@@ -1228,10 +1403,10 @@ import {
|
|
|
1228
1403
|
} from "@pixerate/editor";
|
|
1229
1404
|
|
|
1230
1405
|
// src/slots.tsx
|
|
1231
|
-
import { createContext, useContext, useMemo as
|
|
1232
|
-
import { jsx as
|
|
1406
|
+
import { createContext, useContext, useMemo as useMemo9 } from "react";
|
|
1407
|
+
import { jsx as jsx7, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
1233
1408
|
var defaultSlots = {
|
|
1234
|
-
Button: (props) => /* @__PURE__ */
|
|
1409
|
+
Button: (props) => /* @__PURE__ */ jsx7(
|
|
1235
1410
|
"button",
|
|
1236
1411
|
{
|
|
1237
1412
|
type: "button",
|
|
@@ -1241,26 +1416,26 @@ var defaultSlots = {
|
|
|
1241
1416
|
children: props.children
|
|
1242
1417
|
}
|
|
1243
1418
|
),
|
|
1244
|
-
Tooltip: (props) => /* @__PURE__ */
|
|
1245
|
-
NodeHeader: (props) => /* @__PURE__ */
|
|
1246
|
-
/* @__PURE__ */
|
|
1419
|
+
Tooltip: (props) => /* @__PURE__ */ jsx7("div", { className: `pixerate-tooltip-container ${props.className || ""}`, title: String(props.content), children: props.children }),
|
|
1420
|
+
NodeHeader: (props) => /* @__PURE__ */ jsxs6("div", { className: `pixerate-node-header flex items-center justify-between ${props.className || ""}`, children: [
|
|
1421
|
+
/* @__PURE__ */ jsxs6("div", { className: "flex items-center gap-2", children: [
|
|
1247
1422
|
props.icon,
|
|
1248
|
-
/* @__PURE__ */
|
|
1423
|
+
/* @__PURE__ */ jsx7("span", { className: "font-semibold", children: props.title })
|
|
1249
1424
|
] }),
|
|
1250
|
-
props.onClose && /* @__PURE__ */
|
|
1425
|
+
props.onClose && /* @__PURE__ */ jsx7("button", { type: "button", onClick: props.onClose, className: "opacity-70 hover:opacity-100", children: "\xD7" })
|
|
1251
1426
|
] })
|
|
1252
1427
|
};
|
|
1253
1428
|
var EditorSlotsContext = createContext(defaultSlots);
|
|
1254
1429
|
function EditorSlotsProvider({ slots, children }) {
|
|
1255
|
-
const mergedSlots =
|
|
1256
|
-
return /* @__PURE__ */
|
|
1430
|
+
const mergedSlots = useMemo9(() => ({ ...defaultSlots, ...slots }), [slots]);
|
|
1431
|
+
return /* @__PURE__ */ jsx7(EditorSlotsContext.Provider, { value: mergedSlots, children });
|
|
1257
1432
|
}
|
|
1258
1433
|
function useEditorSlots() {
|
|
1259
1434
|
return useContext(EditorSlotsContext);
|
|
1260
1435
|
}
|
|
1261
1436
|
|
|
1262
1437
|
// src/review/useReview.ts
|
|
1263
|
-
import { useCallback as useCallback6, useMemo as
|
|
1438
|
+
import { useCallback as useCallback6, useMemo as useMemo10, useSyncExternalStore as useSyncExternalStore6 } from "react";
|
|
1264
1439
|
import {
|
|
1265
1440
|
getCommentStore,
|
|
1266
1441
|
getTrackChangesStore
|
|
@@ -1287,8 +1462,8 @@ function useComments(source) {
|
|
|
1287
1462
|
[store]
|
|
1288
1463
|
);
|
|
1289
1464
|
const getSnapshot = () => store?.getSnapshot() ?? EMPTY_COMMENTS;
|
|
1290
|
-
const snapshot =
|
|
1291
|
-
return
|
|
1465
|
+
const snapshot = useSyncExternalStore6(subscribe, getSnapshot, getSnapshot);
|
|
1466
|
+
return useMemo10(() => ({ ...snapshot, store }), [snapshot, store]);
|
|
1292
1467
|
}
|
|
1293
1468
|
function useTrackChanges(editor) {
|
|
1294
1469
|
const store = getTrackChangesStore(editor ?? null);
|
|
@@ -1297,8 +1472,8 @@ function useTrackChanges(editor) {
|
|
|
1297
1472
|
[store]
|
|
1298
1473
|
);
|
|
1299
1474
|
const getSnapshot = () => store?.getSnapshot() ?? EMPTY_TRACK_CHANGES;
|
|
1300
|
-
const snapshot =
|
|
1301
|
-
return
|
|
1475
|
+
const snapshot = useSyncExternalStore6(subscribe, getSnapshot, getSnapshot);
|
|
1476
|
+
return useMemo10(() => {
|
|
1302
1477
|
const run = (fn) => () => {
|
|
1303
1478
|
if (editor && !editor.isDestroyed) fn(editor);
|
|
1304
1479
|
};
|
|
@@ -1312,18 +1487,21 @@ function useTrackChanges(editor) {
|
|
|
1312
1487
|
acceptAll: run((e) => e.commands.acceptAllChanges()),
|
|
1313
1488
|
rejectAll: run((e) => e.commands.rejectAllChanges()),
|
|
1314
1489
|
next: run((e) => e.chain().focus().selectNextChange().run()),
|
|
1315
|
-
previous: run((e) => e.chain().focus().selectPreviousChange().run())
|
|
1490
|
+
previous: run((e) => e.chain().focus().selectPreviousChange().run()),
|
|
1491
|
+
select: (id) => run((e) => e.chain().focus().selectChange(id).run())(),
|
|
1492
|
+
acceptMove: (id) => run((e) => e.commands.acceptMove(id))(),
|
|
1493
|
+
rejectMove: (id) => run((e) => e.commands.rejectMove(id))()
|
|
1316
1494
|
};
|
|
1317
1495
|
}, [snapshot, editor]);
|
|
1318
1496
|
}
|
|
1319
1497
|
|
|
1320
1498
|
// src/review/CommentsPanel.tsx
|
|
1321
|
-
import { useState as
|
|
1499
|
+
import { useState as useState9 } from "react";
|
|
1322
1500
|
import {
|
|
1323
1501
|
formatReviewTime,
|
|
1324
1502
|
getCommentAuthor
|
|
1325
1503
|
} from "@pixerate/editor";
|
|
1326
|
-
import { jsx as
|
|
1504
|
+
import { jsx as jsx8, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
1327
1505
|
var buttonClass = "rounded px-2 py-1 text-xs text-muted-foreground hover:bg-muted hover:text-foreground disabled:opacity-50";
|
|
1328
1506
|
var primaryButtonClass = "rounded px-2 py-1 text-xs bg-primary/10 text-primary hover:bg-primary/20 disabled:opacity-50";
|
|
1329
1507
|
var textareaClass = "w-full resize-y rounded-md border border-input bg-background p-2 text-sm text-foreground focus:outline-none focus:ring-2 focus:ring-primary";
|
|
@@ -1337,18 +1515,18 @@ var CommentsPanel = ({
|
|
|
1337
1515
|
emptyMessage = "No comments yet. Select text and add a comment."
|
|
1338
1516
|
}) => {
|
|
1339
1517
|
const { threads, activeThreadId, store } = useComments(storeProp ?? editor);
|
|
1340
|
-
const [showResolved, setShowResolved] =
|
|
1518
|
+
const [showResolved, setShowResolved] = useState9(showResolvedInitial);
|
|
1341
1519
|
const author = authorProp ?? getCommentAuthor(editor) ?? { id: "anonymous", name: "Anonymous" };
|
|
1342
1520
|
const visible = threads.filter((t) => showResolved || !t.resolved);
|
|
1343
1521
|
const resolvedCount = threads.filter((t) => t.resolved).length;
|
|
1344
|
-
return /* @__PURE__ */
|
|
1345
|
-
/* @__PURE__ */
|
|
1346
|
-
/* @__PURE__ */
|
|
1522
|
+
return /* @__PURE__ */ jsxs7("aside", { className, "aria-label": "Comments", children: [
|
|
1523
|
+
/* @__PURE__ */ jsxs7("div", { className: "flex items-center justify-between gap-2", children: [
|
|
1524
|
+
/* @__PURE__ */ jsxs7("span", { className: "text-xs font-medium text-muted-foreground", children: [
|
|
1347
1525
|
threads.length - resolvedCount,
|
|
1348
1526
|
" open",
|
|
1349
1527
|
resolvedCount > 0 ? ` \xB7 ${resolvedCount} resolved` : ""
|
|
1350
1528
|
] }),
|
|
1351
|
-
resolvedCount > 0 && /* @__PURE__ */
|
|
1529
|
+
resolvedCount > 0 && /* @__PURE__ */ jsx8(
|
|
1352
1530
|
"button",
|
|
1353
1531
|
{
|
|
1354
1532
|
type: "button",
|
|
@@ -1359,7 +1537,7 @@ var CommentsPanel = ({
|
|
|
1359
1537
|
}
|
|
1360
1538
|
)
|
|
1361
1539
|
] }),
|
|
1362
|
-
visible.length === 0 ? /* @__PURE__ */
|
|
1540
|
+
visible.length === 0 ? /* @__PURE__ */ jsx8("p", { className: "text-xs text-muted-foreground", children: emptyMessage }) : /* @__PURE__ */ jsx8("ul", { className: "flex flex-col gap-2", role: "list", children: visible.map((thread) => /* @__PURE__ */ jsx8(
|
|
1363
1541
|
CommentThreadCard,
|
|
1364
1542
|
{
|
|
1365
1543
|
thread,
|
|
@@ -1381,7 +1559,7 @@ var CommentThreadCard = ({
|
|
|
1381
1559
|
author,
|
|
1382
1560
|
formatTime
|
|
1383
1561
|
}) => {
|
|
1384
|
-
const [draft, setDraft] =
|
|
1562
|
+
const [draft, setDraft] = useState9("");
|
|
1385
1563
|
const isDraft = thread.body === "";
|
|
1386
1564
|
const quote = thread.anchor?.quote ?? thread.lastQuote ?? "";
|
|
1387
1565
|
const live = editor && !editor.isDestroyed ? editor : null;
|
|
@@ -1407,7 +1585,7 @@ var CommentThreadCard = ({
|
|
|
1407
1585
|
setDraft("");
|
|
1408
1586
|
};
|
|
1409
1587
|
const stop = (e) => e.stopPropagation();
|
|
1410
|
-
return /* @__PURE__ */
|
|
1588
|
+
return /* @__PURE__ */ jsxs7(
|
|
1411
1589
|
"li",
|
|
1412
1590
|
{
|
|
1413
1591
|
className: `flex flex-col gap-2 rounded-md border bg-background p-3 cursor-pointer ${active ? "border-primary ring-1 ring-primary" : "border-border"} ${thread.resolved ? "opacity-70" : ""}`,
|
|
@@ -1423,24 +1601,24 @@ var CommentThreadCard = ({
|
|
|
1423
1601
|
}
|
|
1424
1602
|
},
|
|
1425
1603
|
children: [
|
|
1426
|
-
/* @__PURE__ */
|
|
1427
|
-
/* @__PURE__ */
|
|
1428
|
-
/* @__PURE__ */
|
|
1604
|
+
/* @__PURE__ */ jsxs7("div", { className: "flex items-baseline justify-between gap-2", children: [
|
|
1605
|
+
/* @__PURE__ */ jsx8("span", { className: "font-medium", children: thread.author.name }),
|
|
1606
|
+
/* @__PURE__ */ jsx8("span", { className: "text-xs text-muted-foreground", children: formatTime(thread.createdAt) })
|
|
1429
1607
|
] }),
|
|
1430
|
-
quote && /* @__PURE__ */
|
|
1431
|
-
thread.orphaned && /* @__PURE__ */
|
|
1432
|
-
thread.resolved && /* @__PURE__ */
|
|
1433
|
-
!isDraft && /* @__PURE__ */
|
|
1434
|
-
thread.replies.length > 0 && /* @__PURE__ */
|
|
1435
|
-
/* @__PURE__ */
|
|
1436
|
-
/* @__PURE__ */
|
|
1608
|
+
quote && /* @__PURE__ */ jsx8("blockquote", { className: "border-l-2 border-border pl-2 text-xs text-muted-foreground line-clamp-2", children: quote }),
|
|
1609
|
+
thread.orphaned && /* @__PURE__ */ jsx8("span", { className: "text-xs text-destructive", children: "The commented text was deleted." }),
|
|
1610
|
+
thread.resolved && /* @__PURE__ */ jsx8("span", { className: "text-xs text-muted-foreground", children: "Resolved" }),
|
|
1611
|
+
!isDraft && /* @__PURE__ */ jsx8("p", { className: "whitespace-pre-wrap break-words", children: thread.body }),
|
|
1612
|
+
thread.replies.length > 0 && /* @__PURE__ */ jsx8("ul", { className: "flex flex-col gap-2 border-l border-border pl-3", role: "list", children: thread.replies.map((reply) => /* @__PURE__ */ jsxs7("li", { className: "flex flex-col gap-0.5", "data-reply-id": reply.id, children: [
|
|
1613
|
+
/* @__PURE__ */ jsxs7("span", { className: "text-xs", children: [
|
|
1614
|
+
/* @__PURE__ */ jsx8("span", { className: "font-medium", children: reply.author.name }),
|
|
1437
1615
|
" ",
|
|
1438
|
-
/* @__PURE__ */
|
|
1616
|
+
/* @__PURE__ */ jsx8("span", { className: "text-muted-foreground", children: formatTime(reply.createdAt) })
|
|
1439
1617
|
] }),
|
|
1440
|
-
/* @__PURE__ */
|
|
1618
|
+
/* @__PURE__ */ jsx8("p", { className: "whitespace-pre-wrap break-words", children: reply.body })
|
|
1441
1619
|
] }, reply.id)) }),
|
|
1442
|
-
(active || isDraft) && !thread.resolved && /* @__PURE__ */
|
|
1443
|
-
/* @__PURE__ */
|
|
1620
|
+
(active || isDraft) && !thread.resolved && /* @__PURE__ */ jsxs7("div", { className: "flex flex-col gap-1", onClick: stop, children: [
|
|
1621
|
+
/* @__PURE__ */ jsx8(
|
|
1444
1622
|
"textarea",
|
|
1445
1623
|
{
|
|
1446
1624
|
className: textareaClass,
|
|
@@ -1458,9 +1636,9 @@ var CommentThreadCard = ({
|
|
|
1458
1636
|
}
|
|
1459
1637
|
}
|
|
1460
1638
|
),
|
|
1461
|
-
/* @__PURE__ */
|
|
1462
|
-
isDraft && /* @__PURE__ */
|
|
1463
|
-
/* @__PURE__ */
|
|
1639
|
+
/* @__PURE__ */ jsxs7("div", { className: "flex justify-end gap-1", children: [
|
|
1640
|
+
isDraft && /* @__PURE__ */ jsx8("button", { type: "button", className: buttonClass, onClick: remove, children: "Cancel" }),
|
|
1641
|
+
/* @__PURE__ */ jsx8(
|
|
1464
1642
|
"button",
|
|
1465
1643
|
{
|
|
1466
1644
|
type: "button",
|
|
@@ -1472,9 +1650,9 @@ var CommentThreadCard = ({
|
|
|
1472
1650
|
)
|
|
1473
1651
|
] })
|
|
1474
1652
|
] }),
|
|
1475
|
-
!isDraft && /* @__PURE__ */
|
|
1476
|
-
/* @__PURE__ */
|
|
1477
|
-
/* @__PURE__ */
|
|
1653
|
+
!isDraft && /* @__PURE__ */ jsxs7("div", { className: "flex justify-end gap-1", onClick: stop, children: [
|
|
1654
|
+
/* @__PURE__ */ jsx8("button", { type: "button", className: buttonClass, onClick: () => setResolved(!thread.resolved), children: thread.resolved ? "Reopen" : "Resolve" }),
|
|
1655
|
+
/* @__PURE__ */ jsx8(
|
|
1478
1656
|
"button",
|
|
1479
1657
|
{
|
|
1480
1658
|
type: "button",
|
|
@@ -1490,7 +1668,7 @@ var CommentThreadCard = ({
|
|
|
1490
1668
|
};
|
|
1491
1669
|
|
|
1492
1670
|
// src/review/ReviewToolbar.tsx
|
|
1493
|
-
import { jsx as
|
|
1671
|
+
import { jsx as jsx9, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
1494
1672
|
var defaultDescriptionClass = "max-w-[16rem] truncate px-1 text-xs text-muted-foreground";
|
|
1495
1673
|
var buttonClass2 = "rounded px-2 py-1 text-xs text-foreground hover:bg-muted disabled:opacity-40 disabled:hover:bg-transparent";
|
|
1496
1674
|
var ReviewToolbar = ({
|
|
@@ -1503,8 +1681,8 @@ var ReviewToolbar = ({
|
|
|
1503
1681
|
const count = review.changes.length;
|
|
1504
1682
|
const current = review.currentChange;
|
|
1505
1683
|
const index = current ? review.changes.findIndex((c) => c.id === current.id) + 1 : 0;
|
|
1506
|
-
return /* @__PURE__ */
|
|
1507
|
-
/* @__PURE__ */
|
|
1684
|
+
return /* @__PURE__ */ jsxs8("div", { className, role: "toolbar", "aria-label": "Review", children: [
|
|
1685
|
+
/* @__PURE__ */ jsx9(
|
|
1508
1686
|
"button",
|
|
1509
1687
|
{
|
|
1510
1688
|
type: "button",
|
|
@@ -1515,8 +1693,8 @@ var ReviewToolbar = ({
|
|
|
1515
1693
|
children: review.enabled ? "Tracking on" : "Track changes"
|
|
1516
1694
|
}
|
|
1517
1695
|
),
|
|
1518
|
-
/* @__PURE__ */
|
|
1519
|
-
/* @__PURE__ */
|
|
1696
|
+
/* @__PURE__ */ jsx9("span", { className: "mx-1 h-4 w-px bg-border", "aria-hidden": "true" }),
|
|
1697
|
+
/* @__PURE__ */ jsx9(
|
|
1520
1698
|
"button",
|
|
1521
1699
|
{
|
|
1522
1700
|
type: "button",
|
|
@@ -1527,8 +1705,8 @@ var ReviewToolbar = ({
|
|
|
1527
1705
|
children: "\u2039"
|
|
1528
1706
|
}
|
|
1529
1707
|
),
|
|
1530
|
-
/* @__PURE__ */
|
|
1531
|
-
/* @__PURE__ */
|
|
1708
|
+
/* @__PURE__ */ jsx9("span", { className: "min-w-[4rem] text-center text-xs text-muted-foreground", "aria-live": "polite", children: count === 0 ? "No changes" : current ? `${index} of ${count}` : `${count} changes` }),
|
|
1709
|
+
/* @__PURE__ */ jsx9(
|
|
1532
1710
|
"button",
|
|
1533
1711
|
{
|
|
1534
1712
|
type: "button",
|
|
@@ -1539,7 +1717,7 @@ var ReviewToolbar = ({
|
|
|
1539
1717
|
children: "\u203A"
|
|
1540
1718
|
}
|
|
1541
1719
|
),
|
|
1542
|
-
showDescription && current && /* @__PURE__ */
|
|
1720
|
+
showDescription && current && /* @__PURE__ */ jsxs8(
|
|
1543
1721
|
"span",
|
|
1544
1722
|
{
|
|
1545
1723
|
className: descriptionClassName,
|
|
@@ -1551,8 +1729,8 @@ var ReviewToolbar = ({
|
|
|
1551
1729
|
]
|
|
1552
1730
|
}
|
|
1553
1731
|
),
|
|
1554
|
-
/* @__PURE__ */
|
|
1555
|
-
/* @__PURE__ */
|
|
1732
|
+
/* @__PURE__ */ jsx9("span", { className: "mx-1 h-4 w-px bg-border", "aria-hidden": "true" }),
|
|
1733
|
+
/* @__PURE__ */ jsx9(
|
|
1556
1734
|
"button",
|
|
1557
1735
|
{
|
|
1558
1736
|
type: "button",
|
|
@@ -1562,7 +1740,7 @@ var ReviewToolbar = ({
|
|
|
1562
1740
|
children: "Accept"
|
|
1563
1741
|
}
|
|
1564
1742
|
),
|
|
1565
|
-
/* @__PURE__ */
|
|
1743
|
+
/* @__PURE__ */ jsx9(
|
|
1566
1744
|
"button",
|
|
1567
1745
|
{
|
|
1568
1746
|
type: "button",
|
|
@@ -1572,18 +1750,18 @@ var ReviewToolbar = ({
|
|
|
1572
1750
|
children: "Reject"
|
|
1573
1751
|
}
|
|
1574
1752
|
),
|
|
1575
|
-
/* @__PURE__ */
|
|
1576
|
-
/* @__PURE__ */
|
|
1753
|
+
/* @__PURE__ */ jsx9("button", { type: "button", className: buttonClass2, disabled: count === 0, onClick: review.acceptAll, children: "Accept all" }),
|
|
1754
|
+
/* @__PURE__ */ jsx9("button", { type: "button", className: buttonClass2, disabled: count === 0, onClick: review.rejectAll, children: "Reject all" })
|
|
1577
1755
|
] });
|
|
1578
1756
|
};
|
|
1579
1757
|
|
|
1580
1758
|
// src/review/CommentButton.tsx
|
|
1581
|
-
import { jsx as
|
|
1759
|
+
import { jsx as jsx10 } from "react/jsx-runtime";
|
|
1582
1760
|
var CommentButton = ({
|
|
1583
1761
|
editor,
|
|
1584
1762
|
className = "rounded px-2 py-1 text-xs text-popover-foreground hover:bg-muted",
|
|
1585
1763
|
children = "Comment"
|
|
1586
|
-
}) => /* @__PURE__ */
|
|
1764
|
+
}) => /* @__PURE__ */ jsx10(
|
|
1587
1765
|
"button",
|
|
1588
1766
|
{
|
|
1589
1767
|
type: "button",
|
|
@@ -1595,12 +1773,12 @@ var CommentButton = ({
|
|
|
1595
1773
|
);
|
|
1596
1774
|
|
|
1597
1775
|
// src/review/useDocumentCompare.ts
|
|
1598
|
-
import { useCallback as useCallback7, useMemo as
|
|
1776
|
+
import { useCallback as useCallback7, useMemo as useMemo11, useRef as useRef8, useState as useState10 } from "react";
|
|
1599
1777
|
import {
|
|
1600
1778
|
applyDocumentComparison
|
|
1601
1779
|
} from "@pixerate/editor";
|
|
1602
1780
|
function useDocumentCompare(editor, options) {
|
|
1603
|
-
const [summary, setSummary] =
|
|
1781
|
+
const [summary, setSummary] = useState10(null);
|
|
1604
1782
|
const defaults = useRef8(options);
|
|
1605
1783
|
defaults.current = options;
|
|
1606
1784
|
const compare = useCallback7(
|
|
@@ -1616,11 +1794,58 @@ function useDocumentCompare(editor, options) {
|
|
|
1616
1794
|
[editor]
|
|
1617
1795
|
);
|
|
1618
1796
|
const clear = useCallback7(() => setSummary(null), []);
|
|
1619
|
-
return
|
|
1797
|
+
return useMemo11(() => ({ summary, compare, clear }), [summary, compare, clear]);
|
|
1620
1798
|
}
|
|
1621
1799
|
|
|
1800
|
+
// src/review/TrackedChangesList.tsx
|
|
1801
|
+
import { trackedChangeLabel } from "@pixerate/editor";
|
|
1802
|
+
import { jsx as jsx11, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
1803
|
+
var buttonClass3 = "rounded px-1.5 py-0.5 text-xs text-foreground hover:bg-muted disabled:opacity-40";
|
|
1804
|
+
var TrackedChangesList = ({
|
|
1805
|
+
editor,
|
|
1806
|
+
className = "flex flex-col gap-1 text-sm",
|
|
1807
|
+
itemClassName = "flex items-center gap-2 rounded px-2 py-1 hover:bg-muted/50",
|
|
1808
|
+
activeItemClassName = "bg-primary/10",
|
|
1809
|
+
emptyState = "No tracked changes."
|
|
1810
|
+
}) => {
|
|
1811
|
+
const review = useTrackChanges(editor);
|
|
1812
|
+
if (review.changes.length === 0) {
|
|
1813
|
+
return /* @__PURE__ */ jsx11("div", { className, "data-tracked-changes-list": "", children: /* @__PURE__ */ jsx11("div", { className: "pixerate-changes-empty text-xs text-muted-foreground", children: emptyState }) });
|
|
1814
|
+
}
|
|
1815
|
+
return /* @__PURE__ */ jsx11("ul", { className, role: "list", "aria-label": "Tracked changes", "data-tracked-changes-list": "", children: review.changes.map((change) => {
|
|
1816
|
+
const active = change.id === review.currentChangeId;
|
|
1817
|
+
return /* @__PURE__ */ jsxs9(
|
|
1818
|
+
"li",
|
|
1819
|
+
{
|
|
1820
|
+
className: active ? `${itemClassName} ${activeItemClassName}` : itemClassName,
|
|
1821
|
+
"data-change-type": change.type,
|
|
1822
|
+
"data-change-id": change.id,
|
|
1823
|
+
children: [
|
|
1824
|
+
/* @__PURE__ */ jsxs9(
|
|
1825
|
+
"button",
|
|
1826
|
+
{
|
|
1827
|
+
type: "button",
|
|
1828
|
+
className: "min-w-0 flex-1 truncate text-left text-xs",
|
|
1829
|
+
title: `${change.author.name}: ${change.description}`,
|
|
1830
|
+
onClick: () => review.select(change.id),
|
|
1831
|
+
children: [
|
|
1832
|
+
/* @__PURE__ */ jsx11("span", { className: "font-medium", children: trackedChangeLabel(change) }),
|
|
1833
|
+
change.author.name ? ` \xB7 ${change.author.name}` : "",
|
|
1834
|
+
/* @__PURE__ */ jsx11("span", { className: "block truncate text-muted-foreground", children: change.description })
|
|
1835
|
+
]
|
|
1836
|
+
}
|
|
1837
|
+
),
|
|
1838
|
+
/* @__PURE__ */ jsx11("button", { type: "button", className: buttonClass3, onClick: () => review.accept(change.id), children: "Accept" }),
|
|
1839
|
+
/* @__PURE__ */ jsx11("button", { type: "button", className: buttonClass3, onClick: () => review.reject(change.id), children: "Reject" })
|
|
1840
|
+
]
|
|
1841
|
+
},
|
|
1842
|
+
`${change.type}:${change.id}`
|
|
1843
|
+
);
|
|
1844
|
+
}) });
|
|
1845
|
+
};
|
|
1846
|
+
|
|
1622
1847
|
// src/find-replace/useFindReplace.ts
|
|
1623
|
-
import { useCallback as useCallback8, useMemo as
|
|
1848
|
+
import { useCallback as useCallback8, useMemo as useMemo12, useSyncExternalStore as useSyncExternalStore7 } from "react";
|
|
1624
1849
|
import {
|
|
1625
1850
|
EMPTY_FIND_REPLACE_SNAPSHOT,
|
|
1626
1851
|
getFindReplaceStore
|
|
@@ -1634,8 +1859,8 @@ function useFindReplace(editor) {
|
|
|
1634
1859
|
[store]
|
|
1635
1860
|
);
|
|
1636
1861
|
const getSnapshot = () => store?.getSnapshot() ?? EMPTY_FIND_REPLACE_SNAPSHOT;
|
|
1637
|
-
const snapshot =
|
|
1638
|
-
return
|
|
1862
|
+
const snapshot = useSyncExternalStore7(subscribe, getSnapshot, getSnapshot);
|
|
1863
|
+
return useMemo12(() => {
|
|
1639
1864
|
const run = (fn) => {
|
|
1640
1865
|
if (editor && !editor.isDestroyed && store) fn(editor);
|
|
1641
1866
|
};
|
|
@@ -1659,12 +1884,12 @@ function useFindReplace(editor) {
|
|
|
1659
1884
|
}
|
|
1660
1885
|
|
|
1661
1886
|
// src/find-replace/FindReplaceBar.tsx
|
|
1662
|
-
import { useEffect as useEffect8, useRef as useRef9, useState as
|
|
1887
|
+
import { useEffect as useEffect8, useRef as useRef9, useState as useState11 } from "react";
|
|
1663
1888
|
import { FIND_OPTION_TOGGLES, formatFindStatus } from "@pixerate/editor";
|
|
1664
|
-
import { jsx as
|
|
1889
|
+
import { jsx as jsx12, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
1665
1890
|
var inputClass = "min-w-0 flex-1 rounded border border-input bg-background px-2 py-1 text-xs text-foreground focus:outline-none focus:ring-1 focus:ring-ring";
|
|
1666
|
-
var
|
|
1667
|
-
var toggleClass = (on) => `${
|
|
1891
|
+
var buttonClass4 = "rounded px-2 py-1 text-xs text-foreground hover:bg-muted disabled:opacity-40 disabled:hover:bg-transparent";
|
|
1892
|
+
var toggleClass = (on) => `${buttonClass4} font-mono ${on ? "bg-primary/10 text-primary" : "text-muted-foreground"}`;
|
|
1668
1893
|
var isMod = (e) => e.metaKey || e.ctrlKey;
|
|
1669
1894
|
var FindReplaceBar = ({
|
|
1670
1895
|
editor,
|
|
@@ -1675,7 +1900,7 @@ var FindReplaceBar = ({
|
|
|
1675
1900
|
}) => {
|
|
1676
1901
|
const find = useFindReplace(editor);
|
|
1677
1902
|
const findInput = useRef9(null);
|
|
1678
|
-
const [moreOpen, setMoreOpen] =
|
|
1903
|
+
const [moreOpen, setMoreOpen] = useState11(false);
|
|
1679
1904
|
const visible = find.available && (alwaysOpen || find.open);
|
|
1680
1905
|
useEffect8(() => {
|
|
1681
1906
|
if (!visible || find.focusRequest === 0) return;
|
|
@@ -1715,20 +1940,20 @@ var FindReplaceBar = ({
|
|
|
1715
1940
|
if (isMod(e)) find.replaceAll();
|
|
1716
1941
|
else find.replace();
|
|
1717
1942
|
};
|
|
1718
|
-
return /* @__PURE__ */
|
|
1719
|
-
/* @__PURE__ */
|
|
1720
|
-
/* @__PURE__ */
|
|
1943
|
+
return /* @__PURE__ */ jsxs10("div", { className, role: "search", "aria-label": "Find and replace", onKeyDown: onBarKeyDown, children: [
|
|
1944
|
+
/* @__PURE__ */ jsxs10("div", { className: "flex items-center gap-1", children: [
|
|
1945
|
+
/* @__PURE__ */ jsx12(
|
|
1721
1946
|
"button",
|
|
1722
1947
|
{
|
|
1723
1948
|
type: "button",
|
|
1724
|
-
className:
|
|
1949
|
+
className: buttonClass4,
|
|
1725
1950
|
"aria-label": "Toggle replace",
|
|
1726
1951
|
"aria-expanded": showReplace,
|
|
1727
1952
|
onClick: () => find.show(showReplace ? "find" : "replace"),
|
|
1728
1953
|
children: showReplace ? "\u25BE" : "\u25B8"
|
|
1729
1954
|
}
|
|
1730
1955
|
),
|
|
1731
|
-
/* @__PURE__ */
|
|
1956
|
+
/* @__PURE__ */ jsx12(
|
|
1732
1957
|
"input",
|
|
1733
1958
|
{
|
|
1734
1959
|
ref: findInput,
|
|
@@ -1742,7 +1967,7 @@ var FindReplaceBar = ({
|
|
|
1742
1967
|
onKeyDown: onFindKeyDown
|
|
1743
1968
|
}
|
|
1744
1969
|
),
|
|
1745
|
-
FIND_OPTION_TOGGLES.filter((t) => !t.advanced).map((t) => /* @__PURE__ */
|
|
1970
|
+
FIND_OPTION_TOGGLES.filter((t) => !t.advanced).map((t) => /* @__PURE__ */ jsx12(
|
|
1746
1971
|
"button",
|
|
1747
1972
|
{
|
|
1748
1973
|
type: "button",
|
|
@@ -1755,7 +1980,7 @@ var FindReplaceBar = ({
|
|
|
1755
1980
|
},
|
|
1756
1981
|
t.key
|
|
1757
1982
|
)),
|
|
1758
|
-
/* @__PURE__ */
|
|
1983
|
+
/* @__PURE__ */ jsx12(
|
|
1759
1984
|
"span",
|
|
1760
1985
|
{
|
|
1761
1986
|
className: `min-w-[5rem] px-1 text-center text-xs ${find.error ? "text-destructive" : "text-muted-foreground"}`,
|
|
@@ -1765,23 +1990,23 @@ var FindReplaceBar = ({
|
|
|
1765
1990
|
children: status
|
|
1766
1991
|
}
|
|
1767
1992
|
),
|
|
1768
|
-
/* @__PURE__ */
|
|
1769
|
-
/* @__PURE__ */
|
|
1770
|
-
showMoreOptions && /* @__PURE__ */
|
|
1993
|
+
/* @__PURE__ */ jsx12("button", { type: "button", className: buttonClass4, "aria-label": "Previous match", disabled: !hasMatches, onClick: find.previous, children: "\u2191" }),
|
|
1994
|
+
/* @__PURE__ */ jsx12("button", { type: "button", className: buttonClass4, "aria-label": "Next match", disabled: !hasMatches, onClick: find.next, children: "\u2193" }),
|
|
1995
|
+
showMoreOptions && /* @__PURE__ */ jsx12(
|
|
1771
1996
|
"button",
|
|
1772
1997
|
{
|
|
1773
1998
|
type: "button",
|
|
1774
|
-
className:
|
|
1999
|
+
className: buttonClass4,
|
|
1775
2000
|
"aria-label": "More options",
|
|
1776
2001
|
"aria-expanded": moreOpen,
|
|
1777
2002
|
onClick: () => setMoreOpen((v) => !v),
|
|
1778
2003
|
children: "\u2026"
|
|
1779
2004
|
}
|
|
1780
2005
|
),
|
|
1781
|
-
/* @__PURE__ */
|
|
2006
|
+
/* @__PURE__ */ jsx12("button", { type: "button", className: buttonClass4, "aria-label": "Close find", onClick: close, children: "\xD7" })
|
|
1782
2007
|
] }),
|
|
1783
|
-
showReplace && /* @__PURE__ */
|
|
1784
|
-
/* @__PURE__ */
|
|
2008
|
+
showReplace && /* @__PURE__ */ jsxs10("div", { className: "flex items-center gap-1 pl-7", children: [
|
|
2009
|
+
/* @__PURE__ */ jsx12(
|
|
1785
2010
|
"input",
|
|
1786
2011
|
{
|
|
1787
2012
|
type: "text",
|
|
@@ -1793,21 +2018,21 @@ var FindReplaceBar = ({
|
|
|
1793
2018
|
onKeyDown: onReplaceKeyDown
|
|
1794
2019
|
}
|
|
1795
2020
|
),
|
|
1796
|
-
/* @__PURE__ */
|
|
2021
|
+
/* @__PURE__ */ jsx12(
|
|
1797
2022
|
"button",
|
|
1798
2023
|
{
|
|
1799
2024
|
type: "button",
|
|
1800
|
-
className:
|
|
2025
|
+
className: buttonClass4,
|
|
1801
2026
|
disabled: !hasMatches || find.currentIndex < 0,
|
|
1802
2027
|
onClick: find.replace,
|
|
1803
2028
|
children: "Replace"
|
|
1804
2029
|
}
|
|
1805
2030
|
),
|
|
1806
|
-
/* @__PURE__ */
|
|
1807
|
-
find.lastReplaceCount !== null && /* @__PURE__ */
|
|
2031
|
+
/* @__PURE__ */ jsx12("button", { type: "button", className: buttonClass4, disabled: !hasMatches, onClick: find.replaceAll, children: "Replace all" }),
|
|
2032
|
+
find.lastReplaceCount !== null && /* @__PURE__ */ jsx12("span", { className: "px-1 text-xs text-muted-foreground", "aria-live": "polite", children: find.lastReplaceCount === 1 ? "1 replaced" : `${find.lastReplaceCount} replaced` })
|
|
1808
2033
|
] }),
|
|
1809
|
-
showMoreOptions && moreOpen && /* @__PURE__ */
|
|
1810
|
-
/* @__PURE__ */
|
|
2034
|
+
showMoreOptions && moreOpen && /* @__PURE__ */ jsx12("div", { className: "flex flex-wrap items-center gap-x-3 gap-y-1 pl-7 text-xs text-muted-foreground", children: FIND_OPTION_TOGGLES.filter((t) => t.advanced).map((t) => /* @__PURE__ */ jsxs10("label", { className: "flex items-center gap-1", children: [
|
|
2035
|
+
/* @__PURE__ */ jsx12(
|
|
1811
2036
|
"input",
|
|
1812
2037
|
{
|
|
1813
2038
|
type: "checkbox",
|
|
@@ -1821,6 +2046,7 @@ var FindReplaceBar = ({
|
|
|
1821
2046
|
};
|
|
1822
2047
|
export {
|
|
1823
2048
|
AdjustmentLayersPanel,
|
|
2049
|
+
AssetMentionChips,
|
|
1824
2050
|
BubbleMenu,
|
|
1825
2051
|
CommandPalette,
|
|
1826
2052
|
CommentButton,
|
|
@@ -1832,19 +2058,29 @@ export {
|
|
|
1832
2058
|
EditorSlotsProvider,
|
|
1833
2059
|
FindReplaceBar,
|
|
1834
2060
|
FormulaHints,
|
|
2061
|
+
GenerationHistory,
|
|
1835
2062
|
GenerationSettings,
|
|
1836
2063
|
Histogram,
|
|
1837
2064
|
HistoryManager2 as HistoryManager,
|
|
1838
2065
|
ImageEditor,
|
|
1839
2066
|
JobProgress,
|
|
1840
2067
|
MergePreview,
|
|
2068
|
+
NameManager,
|
|
1841
2069
|
OutlinePanel,
|
|
1842
2070
|
RecoveryPrompt,
|
|
2071
|
+
RefineEdgePanel,
|
|
1843
2072
|
ReviewToolbar,
|
|
2073
|
+
SelectionOptionsBar,
|
|
2074
|
+
SheetTabs,
|
|
2075
|
+
SpreadsheetConditionalFormatPanel,
|
|
1844
2076
|
SpreadsheetContextMenu,
|
|
2077
|
+
SpreadsheetDataValidationPanel,
|
|
1845
2078
|
SpreadsheetEditor,
|
|
1846
2079
|
SpreadsheetGroupRow,
|
|
2080
|
+
SpreadsheetValidationDialog,
|
|
2081
|
+
StylesGallery,
|
|
1847
2082
|
TemplateRenderer,
|
|
2083
|
+
TrackedChangesList,
|
|
1848
2084
|
VariableForm,
|
|
1849
2085
|
bindDirtyToHistory2 as bindDirtyToHistory,
|
|
1850
2086
|
createDirtyTracker,
|
|
@@ -1863,6 +2099,7 @@ export {
|
|
|
1863
2099
|
useFillHandle,
|
|
1864
2100
|
useFindReplace,
|
|
1865
2101
|
useGenerationPlan,
|
|
2102
|
+
useGenerationRecords,
|
|
1866
2103
|
useHistory,
|
|
1867
2104
|
useHistoryDirty,
|
|
1868
2105
|
useHistoryShortcuts,
|
|
@@ -1872,6 +2109,7 @@ export {
|
|
|
1872
2109
|
useMergePreview,
|
|
1873
2110
|
useNavigationGuard,
|
|
1874
2111
|
useOutline,
|
|
2112
|
+
useParagraphStyles,
|
|
1875
2113
|
usePromptEditor,
|
|
1876
2114
|
useRegisterCommands,
|
|
1877
2115
|
useSpreadsheetClipboard,
|