@arbidocs/blocks 0.4.110 → 0.4.111
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/{NativeDocxEditor-WODZAURG.cjs → NativeDocxEditor-AQKRZBIU.cjs} +7 -7
- package/dist/{NativeDocxEditor-WODZAURG.cjs.map → NativeDocxEditor-AQKRZBIU.cjs.map} +1 -1
- package/dist/{NativeDocxEditor-4PY4YZYC.js → NativeDocxEditor-IN2HEO5I.js} +3 -3
- package/dist/{NativeDocxEditor-4PY4YZYC.js.map → NativeDocxEditor-IN2HEO5I.js.map} +1 -1
- package/dist/agents/index.cjs +207 -207
- package/dist/agents/index.js +2 -2
- package/dist/calendar/EventEditor.d.ts +1 -1
- package/dist/calendar/draft.d.ts +7 -1
- package/dist/calendar/index.cjs +58 -10
- package/dist/calendar/index.cjs.map +1 -1
- package/dist/calendar/index.d.ts +1 -1
- package/dist/calendar/index.js +56 -11
- package/dist/calendar/index.js.map +1 -1
- package/dist/calendar/types.d.ts +20 -0
- package/dist/calls/CallSidePanel.d.ts +16 -1
- package/dist/calls/ControlBar.d.ts +25 -3
- package/dist/calls/PreJoin.d.ts +6 -2
- package/dist/calls/cards.d.ts +6 -2
- package/dist/calls/index.cjs +1078 -47
- package/dist/calls/index.cjs.map +1 -1
- package/dist/calls/index.d.ts +4 -3
- package/dist/calls/index.js +1067 -51
- package/dist/calls/index.js.map +1 -1
- package/dist/calls/panels.d.ts +11 -0
- package/dist/calls/webinar/ChatPermissionSetting.d.ts +18 -0
- package/dist/calls/webinar/OnStageCheck.d.ts +23 -0
- package/dist/calls/webinar/QAPanel.d.ts +56 -0
- package/dist/calls/webinar/RaiseHandButton.d.ts +14 -0
- package/dist/calls/webinar/WebinarAudiencePanel.d.ts +23 -0
- package/dist/calls/webinar/WebinarViewer.d.ts +39 -0
- package/dist/calls/webinar/WebinarWaiting.d.ts +19 -0
- package/dist/calls/webinar/hooks.d.ts +13 -0
- package/dist/calls/webinar/index.d.ts +14 -0
- package/dist/calls/webinar/live.d.ts +43 -0
- package/dist/calls/webinar/types.d.ts +49 -0
- package/dist/{chunk-GKDWQLVU.js → chunk-2C7TCVQZ.js} +172 -121
- package/dist/chunk-2C7TCVQZ.js.map +1 -0
- package/dist/{chunk-54WBIVHV.cjs → chunk-2WO5L7YT.cjs} +5 -5
- package/dist/{chunk-54WBIVHV.cjs.map → chunk-2WO5L7YT.cjs.map} +1 -1
- package/dist/{chunk-A35KT2II.js → chunk-6Z7DLJU2.js} +3 -3
- package/dist/{chunk-A35KT2II.js.map → chunk-6Z7DLJU2.js.map} +1 -1
- package/dist/{chunk-VZKBI2KJ.cjs → chunk-FXUQZFAN.cjs} +3 -3
- package/dist/{chunk-VZKBI2KJ.cjs.map → chunk-FXUQZFAN.cjs.map} +1 -1
- package/dist/{chunk-SQNAJPNR.js → chunk-GFYGYME3.js} +3 -3
- package/dist/{chunk-SQNAJPNR.js.map → chunk-GFYGYME3.js.map} +1 -1
- package/dist/chunk-GICUGQNN.cjs +76 -0
- package/dist/chunk-GICUGQNN.cjs.map +1 -0
- package/dist/chunk-JJLMCV3T.js +73 -0
- package/dist/chunk-JJLMCV3T.js.map +1 -0
- package/dist/{chunk-W7ZDBPJ3.cjs → chunk-OR4CO743.cjs} +3 -3
- package/dist/{chunk-W7ZDBPJ3.cjs.map → chunk-OR4CO743.cjs.map} +1 -1
- package/dist/{chunk-PEHLUB52.js → chunk-Q6B77ZWZ.js} +3 -3
- package/dist/{chunk-PEHLUB52.js.map → chunk-Q6B77ZWZ.js.map} +1 -1
- package/dist/{chunk-ELDUWTRR.cjs → chunk-TF47ATYS.cjs} +4 -4
- package/dist/{chunk-ELDUWTRR.cjs.map → chunk-TF47ATYS.cjs.map} +1 -1
- package/dist/{chunk-JB32KYAH.js → chunk-WTM65ZNG.js} +3 -3
- package/dist/{chunk-JB32KYAH.js.map → chunk-WTM65ZNG.js.map} +1 -1
- package/dist/{chunk-2NIL2ASF.cjs → chunk-XIGWUDOD.cjs} +170 -119
- package/dist/chunk-XIGWUDOD.cjs.map +1 -0
- package/dist/collaboration/index.cjs +1 -1
- package/dist/collaboration/index.js +1 -1
- package/dist/connect/docx.cjs +6 -6
- package/dist/connect/docx.js +4 -4
- package/dist/connect/index.cjs +31 -31
- package/dist/connect/index.js +7 -7
- package/dist/docx/AgentUndo.d.ts +4 -0
- package/dist/docx/index.cjs +46 -46
- package/dist/docx/index.js +3 -3
- package/dist/files/index.cjs +1 -1
- package/dist/files/index.js +1 -1
- package/dist/index.cjs +332 -332
- package/dist/index.js +6 -6
- package/dist/settings/index.cjs +48 -102
- package/dist/settings/index.cjs.map +1 -1
- package/dist/settings/index.js +10 -70
- package/dist/settings/index.js.map +1 -1
- package/dist/workflow-canvas/index.cjs +9 -9
- package/dist/workflow-canvas/index.js +2 -2
- package/node_modules/@arbidocs/coedit/dist/commands.cjs +179 -9
- package/node_modules/@arbidocs/coedit/dist/commands.cjs.map +1 -1
- package/node_modules/@arbidocs/coedit/dist/commands.d.cts +81 -1
- package/node_modules/@arbidocs/coedit/dist/commands.d.ts +81 -1
- package/node_modules/@arbidocs/coedit/dist/commands.js +173 -11
- package/node_modules/@arbidocs/coedit/dist/commands.js.map +1 -1
- package/node_modules/@arbidocs/coedit/dist/server.cjs +58 -2
- package/node_modules/@arbidocs/coedit/dist/server.cjs.map +1 -1
- package/node_modules/@arbidocs/coedit/dist/server.d.cts +29 -1
- package/node_modules/@arbidocs/coedit/dist/server.d.ts +29 -1
- package/node_modules/@arbidocs/coedit/dist/server.js +58 -3
- package/node_modules/@arbidocs/coedit/dist/server.js.map +1 -1
- package/node_modules/@arbidocs/coedit/package.json +1 -1
- package/package.json +4 -4
- package/dist/chunk-2NIL2ASF.cjs.map +0 -1
- package/dist/chunk-GKDWQLVU.js.map +0 -1
|
@@ -6,7 +6,7 @@ import { unzipSync, strFromU8, strToU8, zipSync } from 'fflate';
|
|
|
6
6
|
import { renderToStaticMarkup } from 'react-dom/server';
|
|
7
7
|
import { AiMarkdown, Dialog, DialogContent, DialogHeader, DialogTitle, cn, DialogDescription, Button, DialogFooter, Tabs, TabsList, TabsTrigger, TabsContent, Input, splitMarkdownBlocks } from '@arbidocs/react/ui';
|
|
8
8
|
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
9
|
-
import React4, { createContext, useContext, useState, useRef, useCallback, useEffect, useLayoutEffect, useMemo, useSyncExternalStore } from 'react';
|
|
9
|
+
import React4, { createContext, useContext, useState, useRef, useCallback, useEffect, useLayoutEffect, useMemo, useSyncExternalStore, useReducer } from 'react';
|
|
10
10
|
import { createPortal } from 'react-dom';
|
|
11
11
|
import { collectReviewItems, revisionItemsOf } from '@docx-editor.dev/core/store';
|
|
12
12
|
import { useDocxEditor, ReviewRailContext, useEditorSnapshot, useEditorState, useChromeTranslate, DocxEditor, useParagraphStyle, normalizeImageBytes, usePageSetup, useEditorCommand } from '@docx-editor.dev/react';
|
|
@@ -14,9 +14,9 @@ import { MessageSquarePlus, MessageSquare, PencilLine, ChevronLeft, ChevronRight
|
|
|
14
14
|
import * as Y from 'yjs';
|
|
15
15
|
import { DOCUMENT_COLLABORATION_VERSIONS, collaborationModule } from '@arbidocs/coedit';
|
|
16
16
|
import { createHocuspocusCollaboration } from '@arbidocs/coedit/hocuspocus';
|
|
17
|
-
import {
|
|
18
|
-
import { readParagraphs, documentNumbering, listTargets, REF_BOOKMARK_PREFIX, filterTargets, paragraphNumber, FIELD_ATOM, staleCrossReferences, brokenCrossReferences, BROKEN_CROSS_REFERENCE_STYLE, CROSS_REFERENCE_STYLE, DEFINED_TERM_STYLE } from '@arbidocs/coedit/commands';
|
|
17
|
+
import { readParagraphs, documentNumbering, listTargets, REF_BOOKMARK_PREFIX, filterTargets, paragraphNumber, FIELD_ATOM, staleCrossReferences, brokenCrossReferences, AGENT_UNDO_MAP, BROKEN_CROSS_REFERENCE_STYLE, CROSS_REFERENCE_STYLE, DEFINED_TERM_STYLE, undoOps } from '@arbidocs/coedit/commands';
|
|
19
18
|
export { listTargets, paragraphNumber } from '@arbidocs/coedit/commands';
|
|
19
|
+
import { defaultLegalTemplate, listBuildingBlocks, attachedTemplateOf, linkedLevelStyles, styleDivergence, buildingBlockFragment, fragmentClipboardHtml, trackInsertion, newFromTemplate } from '@arbidocs/coedit/template';
|
|
20
20
|
import { executeImageCommand } from '@docx-editor.dev/core/editor';
|
|
21
21
|
|
|
22
22
|
function normalizeDocxExport(data) {
|
|
@@ -1403,6 +1403,169 @@ function fragmentHtml(body, covered2, {
|
|
|
1403
1403
|
const bytes = revision ? trackInsertion(untracked, revision, covered2) : untracked;
|
|
1404
1404
|
return `<div data-docx-fragment="${base64(bytes)}" data-docx-fragment-end="${covered2 ? "covered" : "open"}"></div>`;
|
|
1405
1405
|
}
|
|
1406
|
+
var attr = (node, name) => node.attributes?.find((a) => a.localName === name)?.value;
|
|
1407
|
+
function documentStyleIds(root) {
|
|
1408
|
+
const ids = /* @__PURE__ */ new Set();
|
|
1409
|
+
for (const style of root?.children ?? [])
|
|
1410
|
+
if (style.localName === "style") {
|
|
1411
|
+
const id = attr(style, "styleId");
|
|
1412
|
+
if (id) ids.add(id);
|
|
1413
|
+
}
|
|
1414
|
+
return ids;
|
|
1415
|
+
}
|
|
1416
|
+
function editorPort(editor, revision) {
|
|
1417
|
+
const surface = () => {
|
|
1418
|
+
const s = editor.surface;
|
|
1419
|
+
if (!s) throw new Error("The document is not open.");
|
|
1420
|
+
return s;
|
|
1421
|
+
};
|
|
1422
|
+
return {
|
|
1423
|
+
paragraphs: () => readParagraphs(surface().session.part().root),
|
|
1424
|
+
caret: () => {
|
|
1425
|
+
const selection = surface().state().selection;
|
|
1426
|
+
if (!selection) return null;
|
|
1427
|
+
const { anchor, head } = selection;
|
|
1428
|
+
return anchor.paragraphId === head.paragraphId && anchor.offset === head.offset ? { paragraphId: anchor.paragraphId, offset: anchor.offset } : null;
|
|
1429
|
+
},
|
|
1430
|
+
setCaret: (point) => surface().setSelection({ anchor: point, head: point }),
|
|
1431
|
+
deleteRange: (from, to) => {
|
|
1432
|
+
surface().setSelection({ anchor: from, head: to });
|
|
1433
|
+
surface().deleteSelection();
|
|
1434
|
+
},
|
|
1435
|
+
paste: (body, text, covered2, relationships) => {
|
|
1436
|
+
const defined = documentStyleIds(surface().session.stylesRoot());
|
|
1437
|
+
const styles = stylesUsed(body).filter((id) => !defined.has(id));
|
|
1438
|
+
return editor.exec({
|
|
1439
|
+
type: "paste",
|
|
1440
|
+
text,
|
|
1441
|
+
html: fragmentHtml(body, covered2, { revision, relationships, styles })
|
|
1442
|
+
}).ok;
|
|
1443
|
+
},
|
|
1444
|
+
splitParagraph: () => surface().splitParagraph(),
|
|
1445
|
+
typeText: (text) => surface().insertPlainText(text)
|
|
1446
|
+
};
|
|
1447
|
+
}
|
|
1448
|
+
function withDirectEditing(editor, fn) {
|
|
1449
|
+
const mode = editor.getEditingMode();
|
|
1450
|
+
if (mode === "viewing") throw new Error("This document is read only.");
|
|
1451
|
+
if (mode === "suggesting") editor.setEditingMode("editing");
|
|
1452
|
+
try {
|
|
1453
|
+
return fn();
|
|
1454
|
+
} finally {
|
|
1455
|
+
if (mode === "suggesting") editor.setEditingMode("suggesting");
|
|
1456
|
+
}
|
|
1457
|
+
}
|
|
1458
|
+
function holdCaret(editor, { settleMs = 600, maxMs = 2e3 } = {}) {
|
|
1459
|
+
const surface = editor.surface;
|
|
1460
|
+
const selection = surface?.state().selection;
|
|
1461
|
+
if (!surface || !selection) return;
|
|
1462
|
+
const { offset } = selection.head;
|
|
1463
|
+
const paraId = surface.session.paraIdOf(selection.head.paragraphId);
|
|
1464
|
+
if (!paraId) return;
|
|
1465
|
+
let typed = "";
|
|
1466
|
+
let done = false;
|
|
1467
|
+
let settle;
|
|
1468
|
+
const stop = () => {
|
|
1469
|
+
done = true;
|
|
1470
|
+
offChange();
|
|
1471
|
+
clearTimeout(settle);
|
|
1472
|
+
clearTimeout(limit);
|
|
1473
|
+
window.removeEventListener("keydown", key, true);
|
|
1474
|
+
window.removeEventListener("pointerdown", click, true);
|
|
1475
|
+
};
|
|
1476
|
+
const finish = () => {
|
|
1477
|
+
if (done) return;
|
|
1478
|
+
stop();
|
|
1479
|
+
const node = surface.session.nodeIdOf(paraId);
|
|
1480
|
+
if (!node) return;
|
|
1481
|
+
const point = { paragraphId: node, offset };
|
|
1482
|
+
surface.setSelection({ anchor: point, head: point });
|
|
1483
|
+
if (typed) surface.insertPlainText(typed);
|
|
1484
|
+
};
|
|
1485
|
+
const key = (event) => {
|
|
1486
|
+
if (event.key.length === 1 && !event.ctrlKey && !event.metaKey && !event.altKey) {
|
|
1487
|
+
event.preventDefault();
|
|
1488
|
+
event.stopPropagation();
|
|
1489
|
+
typed += event.key;
|
|
1490
|
+
return;
|
|
1491
|
+
}
|
|
1492
|
+
finish();
|
|
1493
|
+
};
|
|
1494
|
+
const click = () => {
|
|
1495
|
+
if (typed) finish();
|
|
1496
|
+
else stop();
|
|
1497
|
+
};
|
|
1498
|
+
const quiet = () => {
|
|
1499
|
+
clearTimeout(settle);
|
|
1500
|
+
settle = setTimeout(finish, settleMs);
|
|
1501
|
+
};
|
|
1502
|
+
const offChange = editor.on("change", quiet);
|
|
1503
|
+
window.addEventListener("keydown", key, true);
|
|
1504
|
+
window.addEventListener("pointerdown", click, true);
|
|
1505
|
+
settle = setTimeout(finish, settleMs);
|
|
1506
|
+
const limit = setTimeout(finish, maxMs);
|
|
1507
|
+
}
|
|
1508
|
+
function preservingCaret(editor, fn) {
|
|
1509
|
+
const surface = editor.surface;
|
|
1510
|
+
const before = surface?.state().selection?.head;
|
|
1511
|
+
const paraId = before && surface?.session.paraIdOf(before.paragraphId);
|
|
1512
|
+
const result = fn();
|
|
1513
|
+
const node = paraId && surface?.session.nodeIdOf(paraId);
|
|
1514
|
+
if (before && node) {
|
|
1515
|
+
const point = { paragraphId: node, offset: before.offset };
|
|
1516
|
+
surface.setSelection({ anchor: point, head: point });
|
|
1517
|
+
holdCaret(editor);
|
|
1518
|
+
}
|
|
1519
|
+
return result;
|
|
1520
|
+
}
|
|
1521
|
+
var AgentUndoRoom = createContext(null);
|
|
1522
|
+
function AgentUndo() {
|
|
1523
|
+
const item = useReviewItem();
|
|
1524
|
+
const review = useReview();
|
|
1525
|
+
const editor = useDocxEditor();
|
|
1526
|
+
const room = useContext(AgentUndoRoom);
|
|
1527
|
+
const records = room?.getMap(AGENT_UNDO_MAP);
|
|
1528
|
+
const [, changed] = useReducer((n) => n + 1, 0);
|
|
1529
|
+
const [error, setError] = useState("");
|
|
1530
|
+
useEffect(() => {
|
|
1531
|
+
if (!records) return;
|
|
1532
|
+
records.observe(changed);
|
|
1533
|
+
return () => records.unobserve(changed);
|
|
1534
|
+
}, [records]);
|
|
1535
|
+
if (!item || item.kind !== "comment" || item.parentId || !records) return null;
|
|
1536
|
+
const id = item.item.id;
|
|
1537
|
+
const record = records.get(id);
|
|
1538
|
+
if (!record) return null;
|
|
1539
|
+
const undo = () => {
|
|
1540
|
+
const surface = editor?.surface;
|
|
1541
|
+
if (!editor || !surface) return;
|
|
1542
|
+
const ops = undoOps(surface.session.part().root, record);
|
|
1543
|
+
if (!ops) return setError("What this changed is no longer in the document.");
|
|
1544
|
+
let applied = false;
|
|
1545
|
+
try {
|
|
1546
|
+
applied = withDirectEditing(editor, () => surface.applyAutomationOps(() => ops)).committed;
|
|
1547
|
+
} catch {
|
|
1548
|
+
}
|
|
1549
|
+
if (!applied) return setError("This change could not be undone.");
|
|
1550
|
+
records.delete(id);
|
|
1551
|
+
review.resolve(item, true);
|
|
1552
|
+
};
|
|
1553
|
+
return /* @__PURE__ */ jsxs("div", { className: "native-docx-comment-extra", "data-review-selectable": "", children: [
|
|
1554
|
+
/* @__PURE__ */ jsx(
|
|
1555
|
+
"button",
|
|
1556
|
+
{
|
|
1557
|
+
type: "button",
|
|
1558
|
+
"data-testid": "docx-agent-undo",
|
|
1559
|
+
onClick: (event) => {
|
|
1560
|
+
event.stopPropagation();
|
|
1561
|
+
undo();
|
|
1562
|
+
},
|
|
1563
|
+
children: "Undo"
|
|
1564
|
+
}
|
|
1565
|
+
),
|
|
1566
|
+
error && /* @__PURE__ */ jsx("p", { role: "status", className: "native-docx-comment-activity", children: error })
|
|
1567
|
+
] });
|
|
1568
|
+
}
|
|
1406
1569
|
|
|
1407
1570
|
// src/docx/definitions/commands.ts
|
|
1408
1571
|
var DEFINITIONS_HEADING = "Definitions";
|
|
@@ -1579,121 +1742,6 @@ function LinkHoverCard({
|
|
|
1579
1742
|
document.body
|
|
1580
1743
|
);
|
|
1581
1744
|
}
|
|
1582
|
-
var attr = (node, name) => node.attributes?.find((a) => a.localName === name)?.value;
|
|
1583
|
-
function documentStyleIds(root) {
|
|
1584
|
-
const ids = /* @__PURE__ */ new Set();
|
|
1585
|
-
for (const style of root?.children ?? [])
|
|
1586
|
-
if (style.localName === "style") {
|
|
1587
|
-
const id = attr(style, "styleId");
|
|
1588
|
-
if (id) ids.add(id);
|
|
1589
|
-
}
|
|
1590
|
-
return ids;
|
|
1591
|
-
}
|
|
1592
|
-
function editorPort(editor, revision) {
|
|
1593
|
-
const surface = () => {
|
|
1594
|
-
const s = editor.surface;
|
|
1595
|
-
if (!s) throw new Error("The document is not open.");
|
|
1596
|
-
return s;
|
|
1597
|
-
};
|
|
1598
|
-
return {
|
|
1599
|
-
paragraphs: () => readParagraphs(surface().session.part().root),
|
|
1600
|
-
caret: () => {
|
|
1601
|
-
const selection = surface().state().selection;
|
|
1602
|
-
if (!selection) return null;
|
|
1603
|
-
const { anchor, head } = selection;
|
|
1604
|
-
return anchor.paragraphId === head.paragraphId && anchor.offset === head.offset ? { paragraphId: anchor.paragraphId, offset: anchor.offset } : null;
|
|
1605
|
-
},
|
|
1606
|
-
setCaret: (point) => surface().setSelection({ anchor: point, head: point }),
|
|
1607
|
-
deleteRange: (from, to) => {
|
|
1608
|
-
surface().setSelection({ anchor: from, head: to });
|
|
1609
|
-
surface().deleteSelection();
|
|
1610
|
-
},
|
|
1611
|
-
paste: (body, text, covered2, relationships) => {
|
|
1612
|
-
const defined = documentStyleIds(surface().session.stylesRoot());
|
|
1613
|
-
const styles = stylesUsed(body).filter((id) => !defined.has(id));
|
|
1614
|
-
return editor.exec({
|
|
1615
|
-
type: "paste",
|
|
1616
|
-
text,
|
|
1617
|
-
html: fragmentHtml(body, covered2, { revision, relationships, styles })
|
|
1618
|
-
}).ok;
|
|
1619
|
-
},
|
|
1620
|
-
splitParagraph: () => surface().splitParagraph(),
|
|
1621
|
-
typeText: (text) => surface().insertPlainText(text)
|
|
1622
|
-
};
|
|
1623
|
-
}
|
|
1624
|
-
function withDirectEditing(editor, fn) {
|
|
1625
|
-
const mode = editor.getEditingMode();
|
|
1626
|
-
if (mode === "viewing") throw new Error("This document is read only.");
|
|
1627
|
-
if (mode === "suggesting") editor.setEditingMode("editing");
|
|
1628
|
-
try {
|
|
1629
|
-
return fn();
|
|
1630
|
-
} finally {
|
|
1631
|
-
if (mode === "suggesting") editor.setEditingMode("suggesting");
|
|
1632
|
-
}
|
|
1633
|
-
}
|
|
1634
|
-
function holdCaret(editor, { settleMs = 600, maxMs = 2e3 } = {}) {
|
|
1635
|
-
const surface = editor.surface;
|
|
1636
|
-
const selection = surface?.state().selection;
|
|
1637
|
-
if (!surface || !selection) return;
|
|
1638
|
-
const { offset } = selection.head;
|
|
1639
|
-
const paraId = surface.session.paraIdOf(selection.head.paragraphId);
|
|
1640
|
-
if (!paraId) return;
|
|
1641
|
-
let typed = "";
|
|
1642
|
-
let done = false;
|
|
1643
|
-
let settle;
|
|
1644
|
-
const stop = () => {
|
|
1645
|
-
done = true;
|
|
1646
|
-
offChange();
|
|
1647
|
-
clearTimeout(settle);
|
|
1648
|
-
clearTimeout(limit);
|
|
1649
|
-
window.removeEventListener("keydown", key, true);
|
|
1650
|
-
window.removeEventListener("pointerdown", click, true);
|
|
1651
|
-
};
|
|
1652
|
-
const finish = () => {
|
|
1653
|
-
if (done) return;
|
|
1654
|
-
stop();
|
|
1655
|
-
const node = surface.session.nodeIdOf(paraId);
|
|
1656
|
-
if (!node) return;
|
|
1657
|
-
const point = { paragraphId: node, offset };
|
|
1658
|
-
surface.setSelection({ anchor: point, head: point });
|
|
1659
|
-
if (typed) surface.insertPlainText(typed);
|
|
1660
|
-
};
|
|
1661
|
-
const key = (event) => {
|
|
1662
|
-
if (event.key.length === 1 && !event.ctrlKey && !event.metaKey && !event.altKey) {
|
|
1663
|
-
event.preventDefault();
|
|
1664
|
-
event.stopPropagation();
|
|
1665
|
-
typed += event.key;
|
|
1666
|
-
return;
|
|
1667
|
-
}
|
|
1668
|
-
finish();
|
|
1669
|
-
};
|
|
1670
|
-
const click = () => {
|
|
1671
|
-
if (typed) finish();
|
|
1672
|
-
else stop();
|
|
1673
|
-
};
|
|
1674
|
-
const quiet = () => {
|
|
1675
|
-
clearTimeout(settle);
|
|
1676
|
-
settle = setTimeout(finish, settleMs);
|
|
1677
|
-
};
|
|
1678
|
-
const offChange = editor.on("change", quiet);
|
|
1679
|
-
window.addEventListener("keydown", key, true);
|
|
1680
|
-
window.addEventListener("pointerdown", click, true);
|
|
1681
|
-
settle = setTimeout(finish, settleMs);
|
|
1682
|
-
const limit = setTimeout(finish, maxMs);
|
|
1683
|
-
}
|
|
1684
|
-
function preservingCaret(editor, fn) {
|
|
1685
|
-
const surface = editor.surface;
|
|
1686
|
-
const before = surface?.state().selection?.head;
|
|
1687
|
-
const paraId = before && surface?.session.paraIdOf(before.paragraphId);
|
|
1688
|
-
const result = fn();
|
|
1689
|
-
const node = paraId && surface?.session.nodeIdOf(paraId);
|
|
1690
|
-
if (before && node) {
|
|
1691
|
-
const point = { paragraphId: node, offset: before.offset };
|
|
1692
|
-
surface.setSelection({ anchor: point, head: point });
|
|
1693
|
-
holdCaret(editor);
|
|
1694
|
-
}
|
|
1695
|
-
return result;
|
|
1696
|
-
}
|
|
1697
1745
|
|
|
1698
1746
|
// src/docx/structural/trackedOrNoted.ts
|
|
1699
1747
|
var revisionDate = (at = /* @__PURE__ */ new Date()) => at.toISOString().replace(/\.\d{3}Z$/, "Z");
|
|
@@ -5097,7 +5145,10 @@ function NativeDocxEditor({
|
|
|
5097
5145
|
notify: adapter.notify,
|
|
5098
5146
|
getAgentStatus: adapter.getAgentStatus,
|
|
5099
5147
|
requestAgent: adapter.requestAgent ? (request) => adapter.requestAgent(documentId, request) : void 0,
|
|
5100
|
-
children: /* @__PURE__ */ jsx(
|
|
5148
|
+
children: /* @__PURE__ */ jsx(AgentUndoRoom.Provider, { value: ready.room?.ydoc ?? null, children: /* @__PURE__ */ jsx(DocxEditorReview, { children: () => /* @__PURE__ */ jsxs(DocxEditorReview.Card, { children: [
|
|
5149
|
+
/* @__PURE__ */ jsx(DocxCommentActivity, {}),
|
|
5150
|
+
/* @__PURE__ */ jsx(AgentUndo, {})
|
|
5151
|
+
] }) }) })
|
|
5101
5152
|
}
|
|
5102
5153
|
),
|
|
5103
5154
|
!compact && /* @__PURE__ */ jsx(DocxEditor.HeaderFooterChrome, {}),
|
|
@@ -5157,5 +5208,5 @@ function NativeDocxEditor({
|
|
|
5157
5208
|
}
|
|
5158
5209
|
|
|
5159
5210
|
export { BUILTIN_TEMPLATE_NAME, CrossReferenceDialog, CrossReferencesProvider, DEFAULT_CROSS_REFERENCES_LABELS, DEFAULT_DEFINED_TERMS_LABELS, DEFINED_TERM_TRIGGER, DefinedTermsProvider, DocxAuthorContext, DocxCommentActivity, DocxEditorReview, DocxMentions, DocxParticipants, DocxRibbon, GenerateImageButton, HouseTemplateProvider, LinkHoverCard, NativeDocxEditor, builtinHouseTemplate, contentPath, editorPort, findDefinitionsSection, insertCrossReference, insertDefinedTerm, insertDocumentReference, normalizeDocxExport, referenceText, referencesPort, resolveHouseTemplate, reviewModule, shortTitle, structuralPort, templateFileName, trackedOrNoted, useCrossReferences, useDefinedTerms, useHouseTemplate, useReview, useReviewItem, useTrackedOrNoted, withDirectEditing };
|
|
5160
|
-
//# sourceMappingURL=chunk-
|
|
5161
|
-
//# sourceMappingURL=chunk-
|
|
5211
|
+
//# sourceMappingURL=chunk-2C7TCVQZ.js.map
|
|
5212
|
+
//# sourceMappingURL=chunk-2C7TCVQZ.js.map
|