@arbidocs/blocks 0.4.100 → 0.4.102
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/agents/index.cjs +207 -207
- package/dist/agents/index.js +2 -2
- package/dist/{chunk-NJX774HB.js → chunk-5NQIBJPP.js} +3 -3
- package/dist/{chunk-NJX774HB.js.map → chunk-5NQIBJPP.js.map} +1 -1
- package/dist/chunk-6MG62I5B.cjs +272 -0
- package/dist/chunk-6MG62I5B.cjs.map +1 -0
- package/dist/{chunk-NW3LFDZL.cjs → chunk-DDYXFALG.cjs} +3 -3
- package/dist/{chunk-NW3LFDZL.cjs.map → chunk-DDYXFALG.cjs.map} +1 -1
- package/dist/chunk-EQB3WELX.js +269 -0
- package/dist/chunk-EQB3WELX.js.map +1 -0
- package/dist/{chunk-B7P73VHX.cjs → chunk-FAGQTB3D.cjs} +30 -214
- package/dist/chunk-FAGQTB3D.cjs.map +1 -0
- package/dist/{chunk-6HZNFOHW.js → chunk-G5JH2YMQ.js} +3 -3
- package/dist/{chunk-6HZNFOHW.js.map → chunk-G5JH2YMQ.js.map} +1 -1
- package/dist/{chunk-72PQ42YI.js → chunk-MYALCKDR.js} +34 -217
- package/dist/chunk-MYALCKDR.js.map +1 -0
- package/dist/{chunk-O24WPHLD.cjs → chunk-Y5XW57U4.cjs} +5 -5
- package/dist/{chunk-O24WPHLD.cjs.map → chunk-Y5XW57U4.cjs.map} +1 -1
- package/dist/{chunk-E2QWWLK5.js → chunk-YGREW5TZ.js} +3 -3
- package/dist/{chunk-E2QWWLK5.js.map → chunk-YGREW5TZ.js.map} +1 -1
- package/dist/{chunk-IE55TWIG.cjs → chunk-ZT2EBBSC.cjs} +5 -5
- package/dist/{chunk-IE55TWIG.cjs.map → chunk-ZT2EBBSC.cjs.map} +1 -1
- package/dist/connect/docx.cjs +6 -6
- package/dist/connect/docx.js +4 -4
- package/dist/connect/index.cjs +3 -3
- package/dist/connect/index.js +2 -2
- package/dist/document-tools/AdoptSignatureDialog.d.ts +25 -0
- package/dist/document-tools/DocumentToolButtons.d.ts +2 -0
- package/dist/document-tools/SignatureRequestBanner.d.ts +18 -0
- package/dist/document-tools/index.cjs +175 -0
- package/dist/document-tools/index.cjs.map +1 -1
- package/dist/document-tools/index.d.ts +3 -1
- package/dist/document-tools/index.js +168 -3
- package/dist/document-tools/index.js.map +1 -1
- package/dist/document-tools/viewer/GuidedSigningViewer.d.ts +26 -0
- package/dist/document-tools/viewer/SignatureFieldsOverlay.d.ts +41 -0
- package/dist/document-tools/viewer/SignatureRequestEditor.d.ts +26 -0
- package/dist/document-tools/viewer/index.cjs +983 -0
- package/dist/document-tools/viewer/index.cjs.map +1 -1
- package/dist/document-tools/viewer/index.d.ts +3 -0
- package/dist/document-tools/viewer/index.js +983 -5
- package/dist/document-tools/viewer/index.js.map +1 -1
- package/dist/docx/NativeDocxEditor.d.ts +1 -1
- package/dist/docx/definitions/DefinedTerms.d.ts +1 -12
- package/dist/docx/definitions/commands.d.ts +3 -27
- package/dist/docx/index.cjs +35 -39
- package/dist/docx/index.d.ts +1 -1
- package/dist/docx/index.js +3 -3
- package/dist/facts/index.cjs +1 -1
- package/dist/facts/index.js +1 -1
- package/dist/files/index.cjs +1 -1
- package/dist/files/index.js +1 -1
- package/dist/home/index.cjs +1 -1
- package/dist/home/index.js +1 -1
- package/dist/index.cjs +253 -253
- package/dist/index.js +3 -3
- package/dist/shell/index.cjs +1 -1
- package/dist/shell/index.js +1 -1
- package/dist/studio/index.cjs +1 -1
- package/dist/studio/index.js +1 -1
- package/dist/workflow-canvas/index.cjs +9 -9
- package/dist/workflow-canvas/index.js +2 -2
- package/node_modules/@arbidocs/coedit/LICENSE +21 -0
- package/node_modules/@arbidocs/coedit/dist/encoding.cjs +751 -0
- package/node_modules/@arbidocs/coedit/dist/encoding.cjs.map +1 -0
- package/node_modules/@arbidocs/coedit/dist/encoding.d.cts +192 -0
- package/node_modules/@arbidocs/coedit/dist/encoding.d.ts +192 -0
- package/node_modules/@arbidocs/coedit/dist/encoding.js +716 -0
- package/node_modules/@arbidocs/coedit/dist/encoding.js.map +1 -0
- package/node_modules/@arbidocs/coedit/dist/hocuspocus.cjs +1759 -0
- package/node_modules/@arbidocs/coedit/dist/hocuspocus.cjs.map +1 -0
- package/node_modules/@arbidocs/coedit/dist/hocuspocus.d.cts +39 -0
- package/node_modules/@arbidocs/coedit/dist/hocuspocus.d.ts +39 -0
- package/node_modules/@arbidocs/coedit/dist/hocuspocus.js +1736 -0
- package/node_modules/@arbidocs/coedit/dist/hocuspocus.js.map +1 -0
- package/node_modules/@arbidocs/coedit/dist/index.cjs +1692 -0
- package/node_modules/@arbidocs/coedit/dist/index.cjs.map +1 -0
- package/node_modules/@arbidocs/coedit/dist/index.d.cts +16 -0
- package/node_modules/@arbidocs/coedit/dist/index.d.ts +16 -0
- package/node_modules/@arbidocs/coedit/dist/index.js +1664 -0
- package/node_modules/@arbidocs/coedit/dist/index.js.map +1 -0
- package/node_modules/@arbidocs/coedit/dist/server.cjs +1852 -0
- package/node_modules/@arbidocs/coedit/dist/server.cjs.map +1 -0
- package/node_modules/@arbidocs/coedit/dist/server.d.cts +43 -0
- package/node_modules/@arbidocs/coedit/dist/server.d.ts +43 -0
- package/node_modules/@arbidocs/coedit/dist/server.js +1822 -0
- package/node_modules/@arbidocs/coedit/dist/server.js.map +1 -0
- package/node_modules/@arbidocs/coedit/dist/session-Cf9iu1Vt.d.cts +82 -0
- package/node_modules/@arbidocs/coedit/dist/session-Cf9iu1Vt.d.ts +82 -0
- package/node_modules/@arbidocs/coedit/dist/template.cjs +1627 -0
- package/node_modules/@arbidocs/coedit/dist/template.cjs.map +1 -0
- package/node_modules/@arbidocs/coedit/dist/template.d.cts +125 -0
- package/node_modules/@arbidocs/coedit/dist/template.d.ts +125 -0
- package/node_modules/@arbidocs/coedit/dist/template.js +1612 -0
- package/node_modules/@arbidocs/coedit/dist/template.js.map +1 -0
- package/node_modules/@arbidocs/coedit/dist/versions-DXiFQMA6.d.cts +8 -0
- package/node_modules/@arbidocs/coedit/dist/versions-DXiFQMA6.d.ts +8 -0
- package/node_modules/@arbidocs/coedit/package.json +68 -0
- package/node_modules/@docx-editor.dev/core/LICENSE +201 -0
- package/node_modules/@docx-editor.dev/core/README.md +125 -0
- package/node_modules/@docx-editor.dev/core/THIRD_PARTY_NOTICES.md +56 -0
- package/node_modules/@docx-editor.dev/core/dist/automation.cjs +1 -0
- package/node_modules/@docx-editor.dev/core/dist/automation.d.ts +162 -0
- package/node_modules/@docx-editor.dev/core/dist/automation.js +1 -0
- package/node_modules/@docx-editor.dev/core/dist/binding.cjs +1 -0
- package/node_modules/@docx-editor.dev/core/dist/binding.d.ts +164 -0
- package/node_modules/@docx-editor.dev/core/dist/binding.js +1 -0
- package/node_modules/@docx-editor.dev/core/dist/chunk-2GO5T2JU.cjs +1 -0
- package/node_modules/@docx-editor.dev/core/dist/chunk-2RC2EPND.js +3 -0
- package/node_modules/@docx-editor.dev/core/dist/chunk-4GBTELJV.cjs +28 -0
- package/node_modules/@docx-editor.dev/core/dist/chunk-4R3TEXMN.js +18 -0
- package/node_modules/@docx-editor.dev/core/dist/chunk-5CSUYANV.js +1 -0
- package/node_modules/@docx-editor.dev/core/dist/chunk-6APGXLBB.cjs +3 -0
- package/node_modules/@docx-editor.dev/core/dist/chunk-6AWEKBLB.cjs +1 -0
- package/node_modules/@docx-editor.dev/core/dist/chunk-6EYYL7FL.js +1 -0
- package/node_modules/@docx-editor.dev/core/dist/chunk-6JIJOZDW.js +1 -0
- package/node_modules/@docx-editor.dev/core/dist/chunk-BTQKU64Q.cjs +1 -0
- package/node_modules/@docx-editor.dev/core/dist/chunk-E7BQA6UP.js +2 -0
- package/node_modules/@docx-editor.dev/core/dist/chunk-EO4C5QJW.cjs +2 -0
- package/node_modules/@docx-editor.dev/core/dist/chunk-ETTO6GK3.js +1 -0
- package/node_modules/@docx-editor.dev/core/dist/chunk-FIJZIQXA.cjs +18 -0
- package/node_modules/@docx-editor.dev/core/dist/chunk-FRXAOVTB.js +28 -0
- package/node_modules/@docx-editor.dev/core/dist/chunk-J6BVWIDB.js +2 -0
- package/node_modules/@docx-editor.dev/core/dist/chunk-JGNVNT2A.cjs +2 -0
- package/node_modules/@docx-editor.dev/core/dist/chunk-K5U2PLDP.cjs +2 -0
- package/node_modules/@docx-editor.dev/core/dist/chunk-KKIJG3C6.js +2 -0
- package/node_modules/@docx-editor.dev/core/dist/chunk-LWDSDCMO.js +27 -0
- package/node_modules/@docx-editor.dev/core/dist/chunk-NBCVVZOM.cjs +1 -0
- package/node_modules/@docx-editor.dev/core/dist/chunk-O2AL2HSJ.cjs +1 -0
- package/node_modules/@docx-editor.dev/core/dist/chunk-O5INAWZQ.js +1 -0
- package/node_modules/@docx-editor.dev/core/dist/chunk-QMLCVPCD.cjs +1 -0
- package/node_modules/@docx-editor.dev/core/dist/chunk-RCHS4ZEH.cjs +27 -0
- package/node_modules/@docx-editor.dev/core/dist/chunk-RIYSCEFQ.js +2 -0
- package/node_modules/@docx-editor.dev/core/dist/chunk-S6J4O5XP.js +1 -0
- package/node_modules/@docx-editor.dev/core/dist/chunk-SRPILEWV.cjs +5 -0
- package/node_modules/@docx-editor.dev/core/dist/chunk-TSLBZ26X.js +1 -0
- package/node_modules/@docx-editor.dev/core/dist/chunk-UKVVUHZL.cjs +1 -0
- package/node_modules/@docx-editor.dev/core/dist/chunk-VDNNLG6X.js +2 -0
- package/node_modules/@docx-editor.dev/core/dist/chunk-VHAVHCQY.js +7 -0
- package/node_modules/@docx-editor.dev/core/dist/chunk-VX43VBAX.cjs +7 -0
- package/node_modules/@docx-editor.dev/core/dist/chunk-Z6WBFXJU.js +5 -0
- package/node_modules/@docx-editor.dev/core/dist/chunk-ZUHOMK52.cjs +2 -0
- package/node_modules/@docx-editor.dev/core/dist/collaboration/replication.cjs +1 -0
- package/node_modules/@docx-editor.dev/core/dist/collaboration/replication.d.ts +270 -0
- package/node_modules/@docx-editor.dev/core/dist/collaboration/replication.js +1 -0
- package/node_modules/@docx-editor.dev/core/dist/collaboration.cjs +1 -0
- package/node_modules/@docx-editor.dev/core/dist/collaboration.d.ts +269 -0
- package/node_modules/@docx-editor.dev/core/dist/collaboration.js +1 -0
- package/node_modules/@docx-editor.dev/core/dist/contracts/document.cjs +1 -0
- package/node_modules/@docx-editor.dev/core/dist/contracts/document.d.ts +290 -0
- package/node_modules/@docx-editor.dev/core/dist/contracts/document.js +0 -0
- package/node_modules/@docx-editor.dev/core/dist/contracts/editor.cjs +1 -0
- package/node_modules/@docx-editor.dev/core/dist/contracts/editor.d.ts +22 -0
- package/node_modules/@docx-editor.dev/core/dist/contracts/editor.js +1 -0
- package/node_modules/@docx-editor.dev/core/dist/contracts/interaction.cjs +1 -0
- package/node_modules/@docx-editor.dev/core/dist/contracts/interaction.d.ts +103 -0
- package/node_modules/@docx-editor.dev/core/dist/contracts/interaction.js +0 -0
- package/node_modules/@docx-editor.dev/core/dist/contracts/modules.cjs +1 -0
- package/node_modules/@docx-editor.dev/core/dist/contracts/modules.d.ts +143 -0
- package/node_modules/@docx-editor.dev/core/dist/contracts/modules.js +1 -0
- package/node_modules/@docx-editor.dev/core/dist/contracts/types.cjs +1 -0
- package/node_modules/@docx-editor.dev/core/dist/contracts/types.d.ts +11 -0
- package/node_modules/@docx-editor.dev/core/dist/contracts/types.js +0 -0
- package/node_modules/@docx-editor.dev/core/dist/custom-node-writes-cvL5rhcD.d.ts +323 -0
- package/node_modules/@docx-editor.dev/core/dist/dist-PKZR6RSH.js +2 -0
- package/node_modules/@docx-editor.dev/core/dist/document-protection-BAGVGqaP.d.ts +20 -0
- package/node_modules/@docx-editor.dev/core/dist/editor-Ci7IZGmG.d.ts +2448 -0
- package/node_modules/@docx-editor.dev/core/dist/editor-scope-OHPwVQ5l.d.ts +84 -0
- package/node_modules/@docx-editor.dev/core/dist/editor.cjs +1 -0
- package/node_modules/@docx-editor.dev/core/dist/editor.css +15 -0
- package/node_modules/@docx-editor.dev/core/dist/editor.d.ts +1394 -0
- package/node_modules/@docx-editor.dev/core/dist/editor.js +1 -0
- package/node_modules/@docx-editor.dev/core/dist/export.cjs +2 -0
- package/node_modules/@docx-editor.dev/core/dist/export.d.ts +391 -0
- package/node_modules/@docx-editor.dev/core/dist/export.js +2 -0
- package/node_modules/@docx-editor.dev/core/dist/failure-NS2lsya4.d.ts +115 -0
- package/node_modules/@docx-editor.dev/core/dist/font-resolver-BVQB14qT.d.ts +256 -0
- package/node_modules/@docx-editor.dev/core/dist/harfbuzz.wasm +0 -0
- package/node_modules/@docx-editor.dev/core/dist/headless-document-view-qH331moE.d.ts +143 -0
- package/node_modules/@docx-editor.dev/core/dist/image-resources-BN-hUgCn.d.ts +211 -0
- package/node_modules/@docx-editor.dev/core/dist/index-Bsg7oIKP.d.ts +3869 -0
- package/node_modules/@docx-editor.dev/core/dist/index.cjs +1 -0
- package/node_modules/@docx-editor.dev/core/dist/index.d.ts +53 -0
- package/node_modules/@docx-editor.dev/core/dist/index.js +1 -0
- package/node_modules/@docx-editor.dev/core/dist/layout-shaping-BEyuiQOk.d.ts +246 -0
- package/node_modules/@docx-editor.dev/core/dist/layout.cjs +1 -0
- package/node_modules/@docx-editor.dev/core/dist/layout.d.ts +3151 -0
- package/node_modules/@docx-editor.dev/core/dist/layout.js +1 -0
- package/node_modules/@docx-editor.dev/core/dist/node-module-shim-TTKTT66I.js +1 -0
- package/node_modules/@docx-editor.dev/core/dist/note-properties-4Y9o6Gyk.d.ts +68 -0
- package/node_modules/@docx-editor.dev/core/dist/omml-equation-CuzBL5DD.d.ts +85 -0
- package/node_modules/@docx-editor.dev/core/dist/output.cjs +1 -0
- package/node_modules/@docx-editor.dev/core/dist/output.d.ts +97 -0
- package/node_modules/@docx-editor.dev/core/dist/output.js +1 -0
- package/node_modules/@docx-editor.dev/core/dist/protocol-Bqk4Izjc.d.ts +1651 -0
- package/node_modules/@docx-editor.dev/core/dist/review-pane-D9jm8DcY.d.ts +128 -0
- package/node_modules/@docx-editor.dev/core/dist/review-paragraph-order-DT-n6ouC.d.ts +85 -0
- package/node_modules/@docx-editor.dev/core/dist/revision-projection-DZ4kKVev.d.ts +242 -0
- package/node_modules/@docx-editor.dev/core/dist/semantic-cell-selection-D9D1KSXq.d.ts +464 -0
- package/node_modules/@docx-editor.dev/core/dist/semantic-interaction-CIC-PooQ.d.ts +135 -0
- package/node_modules/@docx-editor.dev/core/dist/semantic-paint-BME37OMv.d.ts +326 -0
- package/node_modules/@docx-editor.dev/core/dist/semantic-record-queries-CBlZqZNa.d.ts +177 -0
- package/node_modules/@docx-editor.dev/core/dist/semantic-records-4B3WwFAi.d.ts +3532 -0
- package/node_modules/@docx-editor.dev/core/dist/store.cjs +1 -0
- package/node_modules/@docx-editor.dev/core/dist/store.d.ts +2706 -0
- package/node_modules/@docx-editor.dev/core/dist/store.js +1 -0
- package/node_modules/@docx-editor.dev/core/dist/tree-package-fragment-BeeKxDw8.d.ts +1201 -0
- package/node_modules/@docx-editor.dev/core/dist/tree-session-contract-CVbmlMlq.d.ts +664 -0
- package/node_modules/@docx-editor.dev/core/dist/types-barrel-D3xCgQX6.d.ts +4269 -0
- package/node_modules/@docx-editor.dev/core/licenses/HarfBuzz-COPYING.txt +42 -0
- package/node_modules/@docx-editor.dev/core/package.json +140 -0
- package/node_modules/@docx-editor.dev/react/LICENSE +201 -0
- package/node_modules/@docx-editor.dev/react/README.md +141 -0
- package/node_modules/@docx-editor.dev/react/THIRD_PARTY_NOTICES.md +18 -0
- package/node_modules/@docx-editor.dev/react/dist/index.d.mts +4928 -0
- package/node_modules/@docx-editor.dev/react/dist/index.d.ts +4928 -0
- package/node_modules/@docx-editor.dev/react/dist/index.js +4 -0
- package/node_modules/@docx-editor.dev/react/dist/index.mjs +4 -0
- package/node_modules/@docx-editor.dev/react/package.json +74 -0
- package/node_modules/@docx-editor.dev/react/src/styles/editor.css +6 -0
- package/node_modules/@docx-editor.dev/react/src/styles/zIndex.ts +28 -0
- package/package.json +26 -15
- package/src/docx/README.md +2 -3
- package/dist/chunk-72PQ42YI.js.map +0 -1
- package/dist/chunk-B7P73VHX.cjs.map +0 -1
|
@@ -897,18 +897,18 @@ function ReviewCardSlot({ children }) {
|
|
|
897
897
|
var DocxEditorReview = Object.assign(DocxEditorReviewRail, { Card: ReviewCardSlot });
|
|
898
898
|
|
|
899
899
|
// src/docx/mentions.ts
|
|
900
|
-
function mentionCandidates(
|
|
900
|
+
function mentionCandidates(mentions) {
|
|
901
901
|
return [
|
|
902
902
|
{ id: "arbi", label: "ARBI", kind: "assistant" },
|
|
903
|
-
...
|
|
903
|
+
...mentions.filter((person) => person.name.trim()).map((person) => ({
|
|
904
904
|
id: person.id,
|
|
905
905
|
label: person.name,
|
|
906
906
|
kind: person.kind === "agent" ? "assistant" : "user"
|
|
907
907
|
}))
|
|
908
908
|
];
|
|
909
909
|
}
|
|
910
|
-
function mentionedDocxRecipients(text,
|
|
911
|
-
return chunk7UTB4PHM_cjs.extractMentions(text, mentionCandidates(
|
|
910
|
+
function mentionedDocxRecipients(text, mentions) {
|
|
911
|
+
return chunk7UTB4PHM_cjs.extractMentions(text, mentionCandidates(mentions)).map((person) => person.id);
|
|
912
912
|
}
|
|
913
913
|
var ActivityContext = React3.createContext({});
|
|
914
914
|
function DocxCommentActivity() {
|
|
@@ -984,7 +984,7 @@ function DocxCommentActivity() {
|
|
|
984
984
|
}
|
|
985
985
|
function DocxMentions({
|
|
986
986
|
children,
|
|
987
|
-
mentions
|
|
987
|
+
mentions = [],
|
|
988
988
|
initialCommentId,
|
|
989
989
|
requestAgent,
|
|
990
990
|
getAgentStatus,
|
|
@@ -1043,7 +1043,7 @@ function DocxMentions({
|
|
|
1043
1043
|
const [suggestions, setSuggestions] = React3.useState(null);
|
|
1044
1044
|
const [selected, setSelected] = React3.useState(0);
|
|
1045
1045
|
const candidates = chunk7UTB4PHM_cjs.filterMentionCandidates(
|
|
1046
|
-
mentionCandidates(
|
|
1046
|
+
mentionCandidates(mentions),
|
|
1047
1047
|
suggestions?.query || ""
|
|
1048
1048
|
).slice(0, 8);
|
|
1049
1049
|
React3.useEffect(() => {
|
|
@@ -1064,7 +1064,7 @@ function DocxMentions({
|
|
|
1064
1064
|
}));
|
|
1065
1065
|
};
|
|
1066
1066
|
const hasAgent = submission.recipientIds.some(
|
|
1067
|
-
(id) => id === "arbi" ||
|
|
1067
|
+
(id) => id === "arbi" || mentions.some((person) => person.id === id && person.kind === "agent")
|
|
1068
1068
|
);
|
|
1069
1069
|
if (hasAgent) update("delivering");
|
|
1070
1070
|
void requestAgent({
|
|
@@ -1098,7 +1098,7 @@ function DocxMentions({
|
|
|
1098
1098
|
"error"
|
|
1099
1099
|
);
|
|
1100
1100
|
});
|
|
1101
|
-
}, [review.items, requestAgent, getAgentStatus,
|
|
1101
|
+
}, [review.items, requestAgent, getAgentStatus, mentions, notify]);
|
|
1102
1102
|
const choose = (name) => {
|
|
1103
1103
|
const field = input.current;
|
|
1104
1104
|
if (!field || !suggestions) return;
|
|
@@ -1116,7 +1116,7 @@ function DocxMentions({
|
|
|
1116
1116
|
'[data-testid="review-draft-input"], [data-testid="review-reply-input"]'
|
|
1117
1117
|
);
|
|
1118
1118
|
if (!field || field.readOnly || !requestAgent) return false;
|
|
1119
|
-
const recipientIds = mentionedDocxRecipients(field.value,
|
|
1119
|
+
const recipientIds = mentionedDocxRecipients(field.value, mentions);
|
|
1120
1120
|
if (!recipientIds.length) return false;
|
|
1121
1121
|
pending.current = {
|
|
1122
1122
|
ids: new Set(review.items.filter((i) => i.kind === "comment").map((i) => i.item.id)),
|
|
@@ -1163,7 +1163,7 @@ function DocxMentions({
|
|
|
1163
1163
|
(entry) => entry.kind === "comment" && entry.parentId === commentId
|
|
1164
1164
|
);
|
|
1165
1165
|
const author = replies.at(-1)?.author || target.author;
|
|
1166
|
-
const agent =
|
|
1166
|
+
const agent = mentions.find((person) => person.kind === "agent" && person.name === author);
|
|
1167
1167
|
if (agent || author === "ARBI" || author === "Assistant")
|
|
1168
1168
|
prefixMention(
|
|
1169
1169
|
field,
|
|
@@ -1241,7 +1241,7 @@ function DocxMentions({
|
|
|
1241
1241
|
onMouseDown: (event) => event.preventDefault(),
|
|
1242
1242
|
onClick: (event) => {
|
|
1243
1243
|
event.stopPropagation();
|
|
1244
|
-
if (!mentionedDocxRecipients(field.value,
|
|
1244
|
+
if (!mentionedDocxRecipients(field.value, mentions).includes("arbi"))
|
|
1245
1245
|
prefixMention(field);
|
|
1246
1246
|
else field.focus();
|
|
1247
1247
|
},
|
|
@@ -1296,7 +1296,6 @@ function definitionTooltip(definition) {
|
|
|
1296
1296
|
const line = `\u201C${definition.term}\u201D${definition.rest}`.replace(/\s+/g, " ").trim();
|
|
1297
1297
|
return line.length > 255 ? `${line.slice(0, 254)}\u2026` : line;
|
|
1298
1298
|
}
|
|
1299
|
-
var definitionParagraphText = (definition) => `\u201C${definition.term}\u201D${definition.rest}`;
|
|
1300
1299
|
function definitionParagraphXml(definition, bookmark, id = 0) {
|
|
1301
1300
|
return `<w:p><w:bookmarkStart w:id="${id}" w:name="${chunkAOFATOT3_cjs.esc(bookmark)}"/>${textRun("\u201C")}${textRun(
|
|
1302
1301
|
definition.term,
|
|
@@ -1417,95 +1416,6 @@ function insertDefinedTerm(port, definition, options = {}) {
|
|
|
1417
1416
|
port.setCaret({ paragraphId: caret.paragraphId, offset: caret.offset + definition.term.length });
|
|
1418
1417
|
return { addedDefinition };
|
|
1419
1418
|
}
|
|
1420
|
-
var escapeRegExp = (s) => s.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
1421
|
-
var mentions = (text, term) => new RegExp(`(^|[^\\p{L}\\p{N}])${escapeRegExp(term)}($|[^\\p{L}\\p{N}])`, "iu").test(text);
|
|
1422
|
-
function updateDefinitions(port, definitions) {
|
|
1423
|
-
const result = {
|
|
1424
|
-
added: [],
|
|
1425
|
-
refreshed: [],
|
|
1426
|
-
reordered: [],
|
|
1427
|
-
unused: [],
|
|
1428
|
-
unknown: []
|
|
1429
|
-
};
|
|
1430
|
-
let paragraphs = port.paragraphs();
|
|
1431
|
-
const linked = new Set(
|
|
1432
|
-
paragraphs.flatMap(
|
|
1433
|
-
(p) => p.links.map((l) => l.anchor).filter((a) => a.startsWith(chunkAOFATOT3_cjs.DEFINITION_BOOKMARK_PREFIX))
|
|
1434
|
-
)
|
|
1435
|
-
);
|
|
1436
|
-
const declared = /* @__PURE__ */ new Map();
|
|
1437
|
-
for (const p of paragraphs)
|
|
1438
|
-
for (const b of p.bookmarks)
|
|
1439
|
-
if (b.startsWith(chunkAOFATOT3_cjs.DEFINITION_BOOKMARK_PREFIX) && !declared.has(b)) declared.set(b, p);
|
|
1440
|
-
const factOf = (bookmark) => {
|
|
1441
|
-
const id = chunkAOFATOT3_cjs.definitionIdOfBookmark(bookmark);
|
|
1442
|
-
return id ? definitions.get(id) : void 0;
|
|
1443
|
-
};
|
|
1444
|
-
for (const bookmark of [...linked, ...declared.keys()])
|
|
1445
|
-
if (!factOf(bookmark) && !result.unknown.includes(bookmark)) result.unknown.push(bookmark);
|
|
1446
|
-
const section = findDefinitionsSection(paragraphs);
|
|
1447
|
-
const rewrite = /* @__PURE__ */ new Map();
|
|
1448
|
-
for (const [bookmark, paragraph] of declared) {
|
|
1449
|
-
const fact = factOf(bookmark);
|
|
1450
|
-
if (fact && paragraph.text !== definitionParagraphText(fact)) {
|
|
1451
|
-
rewrite.set(paragraph.id, fact);
|
|
1452
|
-
result.refreshed.push(fact.term);
|
|
1453
|
-
}
|
|
1454
|
-
}
|
|
1455
|
-
if (section) {
|
|
1456
|
-
let previous = null;
|
|
1457
|
-
for (let i = section.start; i < section.end; i++) {
|
|
1458
|
-
const p = paragraphs[i];
|
|
1459
|
-
const term = termOf(p);
|
|
1460
|
-
if (term === null) continue;
|
|
1461
|
-
const bookmark = p.bookmarks.find((b) => b.startsWith(chunkAOFATOT3_cjs.DEFINITION_BOOKMARK_PREFIX));
|
|
1462
|
-
const fact = bookmark ? factOf(bookmark) : void 0;
|
|
1463
|
-
if (previous !== null && chunkAOFATOT3_cjs.compareTerms(term, previous) < 0 && fact) {
|
|
1464
|
-
if (!rewrite.has(p.id)) result.reordered.push(fact.term);
|
|
1465
|
-
rewrite.set(p.id, fact);
|
|
1466
|
-
continue;
|
|
1467
|
-
}
|
|
1468
|
-
previous = term;
|
|
1469
|
-
}
|
|
1470
|
-
}
|
|
1471
|
-
for (const id of [...rewrite.keys()].reverse()) {
|
|
1472
|
-
const index = paragraphs.findIndex((p) => p.id === id);
|
|
1473
|
-
const previous = paragraphs[index - 1];
|
|
1474
|
-
const target = paragraphs[index];
|
|
1475
|
-
if (!previous) continue;
|
|
1476
|
-
port.deleteRange(
|
|
1477
|
-
{ paragraphId: previous.id, offset: previous.text.length },
|
|
1478
|
-
{ paragraphId: target.id, offset: target.text.length }
|
|
1479
|
-
);
|
|
1480
|
-
paragraphs = port.paragraphs();
|
|
1481
|
-
}
|
|
1482
|
-
const toAdd = [...rewrite.values()];
|
|
1483
|
-
for (const bookmark of linked) {
|
|
1484
|
-
const fact = factOf(bookmark);
|
|
1485
|
-
if (fact && !declared.has(bookmark) && !toAdd.some((d) => d.id === fact.id)) {
|
|
1486
|
-
toAdd.push(fact);
|
|
1487
|
-
result.added.push(fact.term);
|
|
1488
|
-
}
|
|
1489
|
-
}
|
|
1490
|
-
toAdd.sort((a, b) => chunkAOFATOT3_cjs.compareTerms(a.term, b.term));
|
|
1491
|
-
for (const definition of toAdd) addDefinition(port, definition);
|
|
1492
|
-
paragraphs = port.paragraphs();
|
|
1493
|
-
const after = findDefinitionsSection(paragraphs);
|
|
1494
|
-
if (after) {
|
|
1495
|
-
const inSection = (i) => i >= after.title && i < after.end;
|
|
1496
|
-
const outside = paragraphs.filter((_, i) => !inSection(i));
|
|
1497
|
-
const linkedNow = new Set(outside.flatMap((p) => p.links.map((l) => l.anchor)));
|
|
1498
|
-
const outsideText = outside.map((p) => p.text).join("\n");
|
|
1499
|
-
for (let i = after.start; i < after.end; i++) {
|
|
1500
|
-
const p = paragraphs[i];
|
|
1501
|
-
const term = termOf(p);
|
|
1502
|
-
if (term === null) continue;
|
|
1503
|
-
const used = p.bookmarks.some((b) => linkedNow.has(b)) || mentions(outsideText, term);
|
|
1504
|
-
if (!used) result.unused.push({ term, paragraphId: p.id });
|
|
1505
|
-
}
|
|
1506
|
-
}
|
|
1507
|
-
return result;
|
|
1508
|
-
}
|
|
1509
1419
|
function definitionOfAnchor(anchor, definitions) {
|
|
1510
1420
|
const id = chunkAOFATOT3_cjs.definitionIdOfBookmark(anchor.replace(/^#/, ""));
|
|
1511
1421
|
return id ? definitions.get(id) : void 0;
|
|
@@ -1713,7 +1623,6 @@ var MAX_GROUPS = 8;
|
|
|
1713
1623
|
var STALE_AFTER_MS = 3e4;
|
|
1714
1624
|
var DEFAULT_DEFINED_TERMS_LABELS = {
|
|
1715
1625
|
insert: "Defined term",
|
|
1716
|
-
update: "Update definitions",
|
|
1717
1626
|
search: "Search defined terms",
|
|
1718
1627
|
allAgreements: "All definitions",
|
|
1719
1628
|
loading: "Loading definitions\u2026",
|
|
@@ -1721,18 +1630,7 @@ var DEFAULT_DEFINED_TERMS_LABELS = {
|
|
|
1721
1630
|
noMatch: "No defined term matches.",
|
|
1722
1631
|
hint: "Enter to insert \xB7 Esc to close",
|
|
1723
1632
|
preferred: "Preferred",
|
|
1724
|
-
alsoIn: (source) => `Also defined${source ? ` in ${source}` : ""}
|
|
1725
|
-
updated: "Definitions updated",
|
|
1726
|
-
updateSummary: (r) => [
|
|
1727
|
-
r.added.length ? `${r.added.length} added` : "",
|
|
1728
|
-
r.refreshed.length ? `${r.refreshed.length} reworded` : "",
|
|
1729
|
-
r.reordered.length ? `${r.reordered.length} reordered` : ""
|
|
1730
|
-
].filter(Boolean).join(" \xB7 ") || "The Definitions section is up to date.",
|
|
1731
|
-
unusedTitle: "Defined but never used",
|
|
1732
|
-
unusedNone: "Every definition in the section is used.",
|
|
1733
|
-
unknownTitle: "Links to definitions that no longer exist",
|
|
1734
|
-
show: "Show",
|
|
1735
|
-
close: "Close"
|
|
1633
|
+
alsoIn: (source) => `Also defined${source ? ` in ${source}` : ""}`
|
|
1736
1634
|
};
|
|
1737
1635
|
var DefinedTermsContext = React3.createContext(null);
|
|
1738
1636
|
var useDefinedTerms = () => React3.useContext(DefinedTermsContext);
|
|
@@ -1758,7 +1656,6 @@ function DefinedTermsProvider({
|
|
|
1758
1656
|
const [labelId, setLabelId] = React3.useState(null);
|
|
1759
1657
|
const [picker, setPicker] = React3.useState(null);
|
|
1760
1658
|
const [selected, setSelected] = React3.useState(0);
|
|
1761
|
-
const [report, setReport] = React3.useState(null);
|
|
1762
1659
|
const marker = React3.useRef(null);
|
|
1763
1660
|
const dismissedAt = React3.useRef(null);
|
|
1764
1661
|
const refresh = React3.useCallback(
|
|
@@ -1917,31 +1814,9 @@ function DefinedTermsProvider({
|
|
|
1917
1814
|
window.addEventListener("keydown", keys, true);
|
|
1918
1815
|
return () => window.removeEventListener("keydown", keys, true);
|
|
1919
1816
|
}, [picker, rows, selected, pick]);
|
|
1920
|
-
const update = React3.useCallback(() => {
|
|
1921
|
-
if (!editor || !editable) return;
|
|
1922
|
-
void refresh(true).then((list) => {
|
|
1923
|
-
const definitions = new Map(
|
|
1924
|
-
list.flatMap((s) => {
|
|
1925
|
-
const d = chunkAOFATOT3_cjs.toDefinition(s);
|
|
1926
|
-
return d ? [[d.id, d]] : [];
|
|
1927
|
-
})
|
|
1928
|
-
);
|
|
1929
|
-
const surface = editor.surface;
|
|
1930
|
-
const before = surface?.state().selection?.head;
|
|
1931
|
-
const paraId = before && surface?.session.paraIdOf(before.paragraphId);
|
|
1932
|
-
const result = run(() => updateDefinitions(editorPort(editor), definitions));
|
|
1933
|
-
const node = paraId && surface?.session.nodeIdOf(paraId);
|
|
1934
|
-
if (result && before && node) {
|
|
1935
|
-
const point = { paragraphId: node, offset: before.offset };
|
|
1936
|
-
surface.setSelection({ anchor: point, head: point });
|
|
1937
|
-
holdCaret(editor);
|
|
1938
|
-
}
|
|
1939
|
-
if (result) setReport(result);
|
|
1940
|
-
});
|
|
1941
|
-
}, [editor, editable, refresh, run]);
|
|
1942
1817
|
const value = React3.useMemo(
|
|
1943
|
-
() => load && editable ? { openPicker,
|
|
1944
|
-
[load, editable, openPicker,
|
|
1818
|
+
() => load && editable ? { openPicker, labels: l } : null,
|
|
1819
|
+
[load, editable, openPicker, l]
|
|
1945
1820
|
);
|
|
1946
1821
|
return /* @__PURE__ */ jsxRuntime.jsxs(DefinedTermsContext.Provider, { value, children: [
|
|
1947
1822
|
/* @__PURE__ */ jsxRuntime.jsx("span", { ref: marker, hidden: true }),
|
|
@@ -1976,50 +1851,7 @@ function DefinedTermsProvider({
|
|
|
1976
1851
|
}
|
|
1977
1852
|
),
|
|
1978
1853
|
document.body
|
|
1979
|
-
)
|
|
1980
|
-
/* @__PURE__ */ jsxRuntime.jsx(ui.Dialog, { open: !!report, onOpenChange: (open) => !open && setReport(null), children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1981
|
-
ui.DialogContent,
|
|
1982
|
-
{
|
|
1983
|
-
className: "max-h-[85dvh] overflow-y-auto",
|
|
1984
|
-
"data-testid": "docx-definitions-report",
|
|
1985
|
-
children: [
|
|
1986
|
-
/* @__PURE__ */ jsxRuntime.jsxs(ui.DialogHeader, { children: [
|
|
1987
|
-
/* @__PURE__ */ jsxRuntime.jsx(ui.DialogTitle, { children: l.updated }),
|
|
1988
|
-
/* @__PURE__ */ jsxRuntime.jsx(ui.DialogDescription, { children: report && l.updateSummary(report) })
|
|
1989
|
-
] }),
|
|
1990
|
-
report && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-4 text-sm", children: [
|
|
1991
|
-
/* @__PURE__ */ jsxRuntime.jsxs("section", { children: [
|
|
1992
|
-
/* @__PURE__ */ jsxRuntime.jsx("h3", { className: "mb-1 font-medium", children: l.unusedTitle }),
|
|
1993
|
-
report.unused.length ? /* @__PURE__ */ jsxRuntime.jsx("ul", { className: "space-y-1", "data-testid": "docx-definitions-unused", children: report.unused.map((u) => /* @__PURE__ */ jsxRuntime.jsxs("li", { className: "flex items-center justify-between gap-2", children: [
|
|
1994
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { children: u.term }),
|
|
1995
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1996
|
-
ui.Button,
|
|
1997
|
-
{
|
|
1998
|
-
size: "sm",
|
|
1999
|
-
variant: "ghost",
|
|
2000
|
-
onClick: () => {
|
|
2001
|
-
const surface = editor?.surface;
|
|
2002
|
-
surface?.setSelection({
|
|
2003
|
-
anchor: { paragraphId: u.paragraphId, offset: 0 },
|
|
2004
|
-
head: { paragraphId: u.paragraphId, offset: 0 }
|
|
2005
|
-
});
|
|
2006
|
-
surface?.revealParagraph(u.paragraphId);
|
|
2007
|
-
setReport(null);
|
|
2008
|
-
},
|
|
2009
|
-
children: l.show
|
|
2010
|
-
}
|
|
2011
|
-
)
|
|
2012
|
-
] }, u.paragraphId)) }) : /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-muted-foreground", children: l.unusedNone })
|
|
2013
|
-
] }),
|
|
2014
|
-
report.unknown.length > 0 && /* @__PURE__ */ jsxRuntime.jsxs("section", { children: [
|
|
2015
|
-
/* @__PURE__ */ jsxRuntime.jsx("h3", { className: "mb-1 font-medium", children: l.unknownTitle }),
|
|
2016
|
-
/* @__PURE__ */ jsxRuntime.jsx("ul", { className: "list-disc pl-5 text-muted-foreground", children: report.unknown.map((name) => /* @__PURE__ */ jsxRuntime.jsx("li", { children: name }, name)) })
|
|
2017
|
-
] })
|
|
2018
|
-
] }),
|
|
2019
|
-
/* @__PURE__ */ jsxRuntime.jsx(ui.DialogFooter, { children: /* @__PURE__ */ jsxRuntime.jsx(ui.Button, { variant: "outline", onClick: () => setReport(null), children: l.close }) })
|
|
2020
|
-
]
|
|
2021
|
-
}
|
|
2022
|
-
) })
|
|
1854
|
+
)
|
|
2023
1855
|
] });
|
|
2024
1856
|
}
|
|
2025
1857
|
function DefinedTermMenu({
|
|
@@ -3779,34 +3611,19 @@ function DocxParticipants({ session }) {
|
|
|
3779
3611
|
function DefinedTermButtons() {
|
|
3780
3612
|
const terms = useDefinedTerms();
|
|
3781
3613
|
if (!terms) return null;
|
|
3782
|
-
return /* @__PURE__ */ jsxRuntime.
|
|
3783
|
-
|
|
3784
|
-
|
|
3785
|
-
|
|
3786
|
-
|
|
3787
|
-
|
|
3788
|
-
|
|
3789
|
-
|
|
3790
|
-
|
|
3791
|
-
|
|
3792
|
-
|
|
3793
|
-
|
|
3794
|
-
|
|
3795
|
-
),
|
|
3796
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3797
|
-
"button",
|
|
3798
|
-
{
|
|
3799
|
-
type: "button",
|
|
3800
|
-
className: "native-docx-ribbon-trigger",
|
|
3801
|
-
"aria-label": terms.labels.update,
|
|
3802
|
-
title: terms.labels.update,
|
|
3803
|
-
"data-testid": "docx-update-definitions",
|
|
3804
|
-
onMouseDown: (event) => event.preventDefault(),
|
|
3805
|
-
onClick: () => terms.update(),
|
|
3806
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ListRestart, { size: 16 })
|
|
3807
|
-
}
|
|
3808
|
-
)
|
|
3809
|
-
] });
|
|
3614
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
3615
|
+
"button",
|
|
3616
|
+
{
|
|
3617
|
+
type: "button",
|
|
3618
|
+
className: "native-docx-ribbon-trigger",
|
|
3619
|
+
"aria-label": terms.labels.insert,
|
|
3620
|
+
title: `${terms.labels.insert} (type @@)`,
|
|
3621
|
+
"data-testid": "docx-insert-defined-term",
|
|
3622
|
+
onMouseDown: (event) => event.preventDefault(),
|
|
3623
|
+
onClick: (event) => terms.openPicker(event.currentTarget),
|
|
3624
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.BookA, { size: 16 })
|
|
3625
|
+
}
|
|
3626
|
+
);
|
|
3810
3627
|
}
|
|
3811
3628
|
function DocxRibbon({
|
|
3812
3629
|
onSave,
|
|
@@ -4409,12 +4226,11 @@ exports.reviewModule = reviewModule;
|
|
|
4409
4226
|
exports.structuralPort = structuralPort;
|
|
4410
4227
|
exports.templateFileName = templateFileName;
|
|
4411
4228
|
exports.trackedOrNoted = trackedOrNoted;
|
|
4412
|
-
exports.updateDefinitions = updateDefinitions;
|
|
4413
4229
|
exports.useDefinedTerms = useDefinedTerms;
|
|
4414
4230
|
exports.useHouseTemplate = useHouseTemplate;
|
|
4415
4231
|
exports.useReview = useReview;
|
|
4416
4232
|
exports.useReviewItem = useReviewItem;
|
|
4417
4233
|
exports.useTrackedOrNoted = useTrackedOrNoted;
|
|
4418
4234
|
exports.withDirectEditing = withDirectEditing;
|
|
4419
|
-
//# sourceMappingURL=chunk-
|
|
4420
|
-
//# sourceMappingURL=chunk-
|
|
4235
|
+
//# sourceMappingURL=chunk-FAGQTB3D.cjs.map
|
|
4236
|
+
//# sourceMappingURL=chunk-FAGQTB3D.cjs.map
|