@arbidocs/blocks 0.4.99 → 0.4.101
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/{chunk-44TPPPRJ.cjs → chunk-FAGQTB3D.cjs} +958 -272
- package/dist/chunk-FAGQTB3D.cjs.map +1 -0
- package/dist/{chunk-C5RF47LD.js → chunk-G5JH2YMQ.js} +3 -3
- package/dist/{chunk-C5RF47LD.js.map → chunk-G5JH2YMQ.js.map} +1 -1
- package/dist/{chunk-4ZTIMQ7Z.js → chunk-MYALCKDR.js} +963 -277
- package/dist/chunk-MYALCKDR.js.map +1 -0
- package/dist/{chunk-MABEOI4S.cjs → chunk-Y5XW57U4.cjs} +5 -5
- package/dist/{chunk-MABEOI4S.cjs.map → chunk-Y5XW57U4.cjs.map} +1 -1
- package/dist/{chunk-3ICWR3BK.js → chunk-YGREW5TZ.js} +3 -3
- package/dist/{chunk-3ICWR3BK.js.map → chunk-YGREW5TZ.js.map} +1 -1
- package/dist/{chunk-QBEUCOC7.cjs → chunk-ZT2EBBSC.cjs} +5 -5
- package/dist/{chunk-QBEUCOC7.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/docx/NativeDocxEditor.d.ts +7 -2
- package/dist/docx/definitions/DefinedTerms.d.ts +1 -12
- package/dist/docx/definitions/commands.d.ts +3 -27
- package/dist/docx/index.cjs +38 -38
- package/dist/docx/index.d.ts +2 -1
- package/dist/docx/index.js +3 -3
- package/dist/docx/layout/GenerateImage.d.ts +50 -0
- package/dist/docx/layout/LayoutRibbon.d.ts +32 -0
- package/dist/docx/layout/LayoutTabs.d.ts +20 -0
- package/dist/docx/layout/PictureRibbon.d.ts +23 -0
- package/dist/docx/layout/TableKeys.d.ts +25 -0
- package/dist/docx/layout/TableRibbon.d.ts +11 -0
- package/dist/docx/layout/caption.d.ts +38 -0
- package/dist/docx/layout/presets.d.ts +40 -0
- package/dist/index.cjs +5 -5
- package/dist/index.js +1 -1
- package/package.json +5 -4
- package/src/docx/README.md +24 -3
- package/src/docx/layout/layout.css +120 -0
- package/src/docx/styles.css +2 -0
- package/dist/chunk-44TPPPRJ.cjs.map +0 -1
- package/dist/chunk-4ZTIMQ7Z.js.map +0 -1
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
4
|
var chunkMUMH3Z6K_cjs = require('./chunk-MUMH3Z6K.cjs');
|
|
5
|
-
var
|
|
5
|
+
var chunkFAGQTB3D_cjs = require('./chunk-FAGQTB3D.cjs');
|
|
6
6
|
var react$1 = require('react');
|
|
7
7
|
var reactQuery = require('@tanstack/react-query');
|
|
8
8
|
var react = require('@arbidocs/react');
|
|
@@ -13,7 +13,7 @@ function ConnectedNativeDocxEditor({
|
|
|
13
13
|
...props
|
|
14
14
|
}) {
|
|
15
15
|
const adapter = useConnectedNativeDocxAdapter(fontBaseUrl);
|
|
16
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
16
|
+
return /* @__PURE__ */ jsxRuntime.jsx(chunkFAGQTB3D_cjs.NativeDocxEditor, { ...props, adapter });
|
|
17
17
|
}
|
|
18
18
|
function useConnectedNativeDocxAdapter(fontBaseUrl = "/native-docx/fonts") {
|
|
19
19
|
const arbi = react.useArbi();
|
|
@@ -42,7 +42,7 @@ function useConnectedNativeDocxAdapter(fontBaseUrl = "/native-docx/fonts") {
|
|
|
42
42
|
headers: { "Content-Type": "application/json" },
|
|
43
43
|
body: JSON.stringify({ state })
|
|
44
44
|
})).json(),
|
|
45
|
-
loadFonts: () =>
|
|
45
|
+
loadFonts: () => chunkFAGQTB3D_cjs.loadDocxFonts(fontBaseUrl),
|
|
46
46
|
baseUrl: apiUrl,
|
|
47
47
|
author: user?.name || "You",
|
|
48
48
|
onVersionSaved: async (id) => {
|
|
@@ -91,5 +91,5 @@ function useConnectedNativeDocxAdapter(fontBaseUrl = "/native-docx/fonts") {
|
|
|
91
91
|
|
|
92
92
|
exports.ConnectedNativeDocxEditor = ConnectedNativeDocxEditor;
|
|
93
93
|
exports.useConnectedNativeDocxAdapter = useConnectedNativeDocxAdapter;
|
|
94
|
-
//# sourceMappingURL=chunk-
|
|
95
|
-
//# sourceMappingURL=chunk-
|
|
94
|
+
//# sourceMappingURL=chunk-Y5XW57U4.cjs.map
|
|
95
|
+
//# sourceMappingURL=chunk-Y5XW57U4.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/connection/ConnectedNativeDocxEditor.tsx"],"names":["jsx","NativeDocxEditor","useArbi","useConnection","useQueryClient","useQuery","useMemo","loadDocxFonts","arbiQueryKeys","notify"],"mappings":";;;;;;;;;AAYO,SAAS,yBAAA,CAA0B;AAAA,EACxC,WAAA,GAAc,oBAAA;AAAA,EACd,GAAG;AACL,CAAA,EAAsE;AACpE,EAAA,MAAM,OAAA,GAAU,8BAA8B,WAAW,CAAA;AACzD,EAAA,uBAAOA,cAAA,CAACC,kCAAA,EAAA,EAAkB,GAAG,KAAA,EAAO,OAAA,EAAkB,CAAA;AACxD;AAEO,SAAS,6BAAA,CAA8B,cAAc,oBAAA,EAAsB;AAChF,EAAA,MAAM,OAAOC,aAAA,EAAQ;AACrB,EAAA,MAAM,EAAE,WAAA,EAAa,MAAA,EAAQ,IAAA,EAAM,mBAAA,KAAwBC,+BAAA,EAAc;AACzE,EAAA,MAAM,UAAUC,yBAAA,EAAe;AAC/B,EAAA,MAAM,EAAE,IAAA,EAAM,OAAA,EAAQ,GAAIC,mBAAA,CAAS;AAAA,IACjC,UAAU,CAAC,qBAAA,EAAuB,MAAA,EAAQ,IAAA,EAAM,YAAY,WAAW,CAAA;AAAA,IACvE,OAAA,EAAS,IAAA,CAAK,UAAA,IAAc,CAAC,CAAC,WAAA;AAAA,IAC9B,SAAS,YAAY;AACnB,MAAA,MAAM,mBAAA,EA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UAChF,MAAA,EAAQ,MAAA;AAAA,UACR,OAAA,EAAS,EAAE,cAAA,EAAgB,kBAAA,EAAmB;AAAA,UAC9C,IAAA,EAAM,KAAK,SAAA,CAAU;AAAA,YACnB,YAAY,OAAA,CAAQ,SAAA;AAAA,YACpB,aAAa,OAAA,CAAQ,WAAA;AAAA,YACrB,YAAY,OAAA,CAAQ,SAAA;AAAA,YACpB,eAAe,OAAA,CAAQ;AAAA,WACxB;AAAA,SACF,CAAA;AACD,QAAA,MAAM,QAAA,GAAY,MAAM,QAAA,CAAS,IAAA,EAAK;AACtC,QAAAA,YAAA,CAAO,QAAQ,oBAAoB,CAAA;AACnC,QAAA,OAAO,EAAE,WAAA,EAAa,QAAA,CAAS,YAAA,IAAgB,EAAC,EAAE;AAAA,MACpD,CAAA;AAAA,MACA,cAAA,EAAgB,OAAO,UAAA,KAAA,CAAgB,MAAM,KAAK,SAAA,CAAU,WAAA,CAAY,UAAU,CAAA,EAAG;AAAA,KACvF,CAAA;AAAA,IACA,CAAC,MAAM,MAAA,EAAQ,IAAA,EAAM,MAAM,OAAA,EAAS,mBAAA,EAAqB,WAAA,EAAa,OAAA,EAAS,WAAW;AAAA,GAC5F;AACA,EAAA,OAAO,OAAA;AACT","file":"chunk-
|
|
1
|
+
{"version":3,"sources":["../src/connection/ConnectedNativeDocxEditor.tsx"],"names":["jsx","NativeDocxEditor","useArbi","useConnection","useQueryClient","useQuery","useMemo","loadDocxFonts","arbiQueryKeys","notify"],"mappings":";;;;;;;;;AAYO,SAAS,yBAAA,CAA0B;AAAA,EACxC,WAAA,GAAc,oBAAA;AAAA,EACd,GAAG;AACL,CAAA,EAAsE;AACpE,EAAA,MAAM,OAAA,GAAU,8BAA8B,WAAW,CAAA;AACzD,EAAA,uBAAOA,cAAA,CAACC,kCAAA,EAAA,EAAkB,GAAG,KAAA,EAAO,OAAA,EAAkB,CAAA;AACxD;AAEO,SAAS,6BAAA,CAA8B,cAAc,oBAAA,EAAsB;AAChF,EAAA,M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emo } from 'react'\nimport { useQuery, useQueryClient } from '@tanstack/react-query'\nimport { useArbi, notify, arbiQueryKeys } from '@arbidocs/react'\nimport { useConnection } from './ConnectionProvider'\nimport {\n NativeDocxEditor,\n type NativeDocxAdapter,\n type NativeDocxEditorProps,\n} from '../docx/NativeDocxEditor'\nimport { loadDocxFonts } from '../docx/fonts'\n\n/** Native Word widget bound to the standard blocks connection and SDK session. */\nexport function ConnectedNativeDocxEditor({\n fontBaseUrl = '/native-docx/fonts',\n ...props\n}: Omit<NativeDocxEditorProps, 'adapter'> & { fontBaseUrl?: string }) {\n const adapter = useConnectedNativeDocxAdapter(fontBaseUrl)\n return <NativeDocxEditor {...props} adapter={adapter} />\n}\n\nexport function useConnectedNativeDocxAdapter(fontBaseUrl = '/native-docx/fonts') {\n const arbi = useArbi()\n const { workspaceId, apiUrl, user, ensureWorkspaceOpen } = useConnection()\n const queries = useQueryClient()\n const { data: members } = useQuery({\n queryKey: ['native-docx-members', apiUrl, user?.externalId, workspaceId],\n enabled: arbi.isLoggedIn && !!workspaceId,\n queryFn: async () => {\n await ensureWorkspaceOpen()\n return arbi.workspaces.listUsers()\n },\n })\n const adapter = useMemo<NativeDocxAdapter>(\n () => ({\n request: async (path, options) => {\n await ensureWorkspaceOpen()\n return arbi.editor.request(path, options)\n },\n open: async (id) => {\n await ensureWorkspaceOpen()\n return (\n await arbi.editor.request(`/${encodeURIComponent(id)}/session`, { method: 'POST' })\n ).json()\n },\n save: async (id, state) =>\n (\n await arbi.editor.request(`/${encodeURIComponent(id)}/save`, {\n method: 'POST',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify({ state }),\n })\n ).json(),\n loadFonts: () => loadDocxFonts(fontBaseUrl),\n baseUrl: apiUrl,\n author: user?.name || 'You',\n onVersionSaved: async (id) => {\n if (!workspaceId) return\n const key = arbiQueryKeys.documents(workspaceId)\n try {\n const documents = await arbi.documents.get([id])\n if (!documents.length) throw new Error('The saved version is not available yet.')\n queries.setQueryData<Awaited<ReturnType<typeof arbi.documents.list>>>(key, (previous) => [\n ...documents,\n ...(previous || []).filter(\n (doc) => !documents.some((saved) => saved.external_id === doc.external_id)\n ),\n ])\n } catch {\n await queries.invalidateQueries({ queryKey: key })\n }\n },\n notify: (message, kind) => notify[kind](message),\n mentions: members?.map(({ user: member }) => ({\n id: member.external_id,\n name: [member.given_name, member.family_name].filter(Boolean).join(' '),\n kind: member.external_id.startsWith('agt-') ? 'agent' : 'human',\n })),\n requestAgent: async (id, request) => {\n const response = await arbi.editor.request(`/${encodeURIComponent(id)}/mentions`, {\n method: 'POST',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify({\n comment_id: request.commentId,\n instruction: request.instruction,\n request_id: request.requestId,\n recipient_ids: request.recipientIds,\n }),\n })\n const delivery = (await response.json()) as { response_ids: string[] }\n notify.success('Mention delivered.')\n return { responseIds: delivery.response_ids || [] }\n },\n getAgentStatus: async (responseId) => (await arbi.assistant.getResponse(responseId)).status,\n }),\n [arbi, apiUrl, user?.name, members, ensureWorkspaceOpen, fontBaseUrl, queries, workspaceId]\n )\n return adapter\n}\n"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { NativeDocxEditor } from './chunk-
|
|
2
|
+
import { NativeDocxEditor } from './chunk-MYALCKDR.js';
|
|
3
3
|
import { jsx } from 'react/jsx-runtime';
|
|
4
4
|
|
|
5
5
|
function StreamedWordArtifact({
|
|
@@ -37,5 +37,5 @@ function StreamedWordArtifact({
|
|
|
37
37
|
}
|
|
38
38
|
|
|
39
39
|
export { StreamedWordArtifact };
|
|
40
|
-
//# sourceMappingURL=chunk-
|
|
41
|
-
//# sourceMappingURL=chunk-
|
|
40
|
+
//# sourceMappingURL=chunk-YGREW5TZ.js.map
|
|
41
|
+
//# sourceMappingURL=chunk-YGREW5TZ.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/docx/StreamedWordArtifact.tsx"],"names":[],"mappings":";;;AA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,EAAQ,EAAE,OAAA,EAAS,IAAA,EAAM,KAAA;AAAM,KAAA;AAAA,IAL3B;AAAA,GAMN;AAEJ","file":"chunk-YGREW5TZ.js","sourcesContent":["import { NativeDocxEditor, type NativeDocxAdapter } from './NativeDocxEditor'\n\nexport interface StreamedWordArtifactProps {\n adapter: NativeDocxAdapter\n /** Streamed Markdown, shown as a read-only preview while the draft is generated. */\n content: string\n title: string\n busy: boolean\n error?: string | null\n /** The DOCX draft the server stored for this generation (`doc-…`), once known. */\n documentId?: string\n onSaved?: (documentId: string) => void\n}\n\n/**\n * One drafting surface for an AI document draft. The server stores every draft as DOCX, so\n * this component never creates a document: it previews the streamed Markdown until generation\n * ends and the stored DOCX is known, then opens that DOCX in the live collaborative editor.\n */\nexport function StreamedWordArtifact({\n adapter,\n content,\n title,\n busy,\n error,\n documentId,\n onSaved,\n}: StreamedWordArtifactProps) {\n if (!busy && documentId) {\n return (\n <NativeDocxEditor\n key={documentId}\n adapter={adapter}\n documentId={documentId}\n title={title}\n onSaved={onSaved}\n />\n )\n }\n return (\n <NativeDocxEditor\n key=\"stream-preview\"\n adapter={adapter}\n documentId=\"stream-preview\"\n title={title}\n draftContent=\"\"\n stream={{ content, busy, error }}\n />\n )\n}\n"]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var chunkFAGQTB3D_cjs = require('./chunk-FAGQTB3D.cjs');
|
|
5
5
|
var jsxRuntime = require('react/jsx-runtime');
|
|
6
6
|
|
|
7
7
|
function StreamedWordArtifact({
|
|
@@ -15,7 +15,7 @@ function StreamedWordArtifact({
|
|
|
15
15
|
}) {
|
|
16
16
|
if (!busy && documentId) {
|
|
17
17
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
18
|
-
|
|
18
|
+
chunkFAGQTB3D_cjs.NativeDocxEditor,
|
|
19
19
|
{
|
|
20
20
|
adapter,
|
|
21
21
|
documentId,
|
|
@@ -26,7 +26,7 @@ function StreamedWordArtifact({
|
|
|
26
26
|
);
|
|
27
27
|
}
|
|
28
28
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
29
|
-
|
|
29
|
+
chunkFAGQTB3D_cjs.NativeDocxEditor,
|
|
30
30
|
{
|
|
31
31
|
adapter,
|
|
32
32
|
documentId: "stream-preview",
|
|
@@ -39,5 +39,5 @@ function StreamedWordArtifact({
|
|
|
39
39
|
}
|
|
40
40
|
|
|
41
41
|
exports.StreamedWordArtifact = StreamedWordArtifact;
|
|
42
|
-
//# sourceMappingURL=chunk-
|
|
43
|
-
//# sourceMappingURL=chunk-
|
|
42
|
+
//# sourceMappingURL=chunk-ZT2EBBSC.cjs.map
|
|
43
|
+
//# sourceMappingURL=chunk-ZT2EBBSC.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/docx/StreamedWordArtifact.tsx"],"names":["jsx","NativeDocxEditor"],"mappings":";;;;;AAmBO,SAAS,oBAAA,CAAqB;AAAA,EACnC,OAAA;AAAA,EACA,OAAA;AAAA,EACA,KAAA;AAAA,EACA,IAAA;AAAA,EACA,KAAA;AAAA,EACA,UAAA;AAAA,EACA;AACF,CAAA,EAA8B;AAC5B,EAAA,IAAI,CAAC,QAAQ,UAAA,EAAY;AACvB,IAAA,uBACEA,cAAA;AAAA,MAACC,kCAAA;AAAA,MAAA;AAAA,QAEC,OAAA;AAAA,QACA,UAAA;AAAA,QACA,KAAA;AAAA,QACA;AAAA,OAAA;AAAA,MAJK;AAAA,KAKP;AAAA,EAEJ;AACA,EAAA,uBACED,cAAA;AAAA,IAACC,kCAAA;AAAA,IAAA;AAAA,MAEC,OAAA;AAAA,MACA,UAAA,EAAW,gBAAA;AAAA,MACX,KAAA;AAAA,MACA,YAAA,EAAa,EAAA;AAAA,MACb,MAAA,EAAQ,EAAE,OAAA,EAAS,IAAA,EAAM,KAAA;AAAM,KAAA;AAAA,IAL3B;AAAA,GAMN;AAEJ","file":"chunk-
|
|
1
|
+
{"version":3,"sources":["../src/docx/StreamedWordArtifact.tsx"],"names":["jsx","NativeDocxEditor"],"mappings":";;;;;AAmBO,SAAS,oBAAA,CAAqB;AAAA,EACnC,OAAA;AAAA,EACA,OAAA;AAAA,EACA,KAAA;AAAA,EACA,IAAA;AAAA,EACA,KAAA;AAAA,EACA,UAAA;AAAA,EACA;AACF,CAAA,EAA8B;AAC5B,EAAA,IAAI,CAAC,QAAQ,UAAA,EAAY;AACvB,IAAA,uBACEA,cAAA;AAAA,MAACC,kCAAA;AAAA,MAAA;AAAA,QAEC,OAAA;AAAA,QACA,UAAA;AAAA,QACA,KAAA;AAAA,QACA;AAAA,OAAA;AAAA,MAJK;AAAA,KAKP;AAAA,EAEJ;AACA,EAAA,uBACED,cAAA;AAAA,IAACC,kCAAA;AAAA,IAAA;AAAA,MAEC,OAAA;AAAA,MACA,UAAA,EAAW,gBAAA;AAAA,MACX,KAAA;AAAA,MACA,YAAA,EAAa,EAAA;AAAA,MACb,MAAA,EAAQ,EAAE,OAAA,EAAS,IAAA,EAAM,KAAA;AAAM,KAAA;AAAA,IAL3B;AAAA,GAMN;AAEJ","file":"chunk-ZT2EBBSC.cjs","sourcesContent":["import { NativeDocxEditor, type NativeDocxAdapter } from './NativeDocxEditor'\n\nexport interface StreamedWordArtifactProps {\n adapter: NativeDocxAdapter\n /** Streamed Markdown, shown as a read-only preview while the draft is generated. */\n content: string\n title: string\n busy: boolean\n error?: string | null\n /** The DOCX draft the server stored for this generation (`doc-…`), once known. */\n documentId?: string\n onSaved?: (documentId: string) => void\n}\n\n/**\n * One drafting surface for an AI document draft. The server stores every draft as DOCX, so\n * this component never creates a document: it previews the streamed Markdown until generation\n * ends and the stored DOCX is known, then opens that DOCX in the live collaborative editor.\n */\nexport function StreamedWordArtifact({\n adapter,\n content,\n title,\n busy,\n error,\n documentId,\n onSaved,\n}: StreamedWordArtifactProps) {\n if (!busy && documentId) {\n return (\n <NativeDocxEditor\n key={documentId}\n adapter={adapter}\n documentId={documentId}\n title={title}\n onSaved={onSaved}\n />\n )\n }\n return (\n <NativeDocxEditor\n key=\"stream-preview\"\n adapter={adapter}\n documentId=\"stream-preview\"\n title={title}\n draftContent=\"\"\n stream={{ content, busy, error }}\n />\n )\n}\n"]}
|
package/dist/connect/docx.cjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var chunkY5XW57U4_cjs = require('../chunk-Y5XW57U4.cjs');
|
|
5
5
|
require('../chunk-MUMH3Z6K.cjs');
|
|
6
|
-
var
|
|
7
|
-
require('../chunk-
|
|
6
|
+
var chunkZT2EBBSC_cjs = require('../chunk-ZT2EBBSC.cjs');
|
|
7
|
+
require('../chunk-FAGQTB3D.cjs');
|
|
8
8
|
require('../chunk-AOFATOT3.cjs');
|
|
9
9
|
require('../chunk-RC25WMVB.cjs');
|
|
10
10
|
require('../chunk-7UTB4PHM.cjs');
|
|
@@ -16,13 +16,13 @@ function ConnectedStreamedWordArtifact({
|
|
|
16
16
|
fontBaseUrl,
|
|
17
17
|
...props
|
|
18
18
|
}) {
|
|
19
|
-
const adapter =
|
|
20
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
19
|
+
const adapter = chunkY5XW57U4_cjs.useConnectedNativeDocxAdapter(fontBaseUrl);
|
|
20
|
+
return /* @__PURE__ */ jsxRuntime.jsx(chunkZT2EBBSC_cjs.StreamedWordArtifact, { ...props, adapter });
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
Object.defineProperty(exports, "ConnectedNativeDocxEditor", {
|
|
24
24
|
enumerable: true,
|
|
25
|
-
get: function () { return
|
|
25
|
+
get: function () { return chunkY5XW57U4_cjs.ConnectedNativeDocxEditor; }
|
|
26
26
|
});
|
|
27
27
|
exports.ConnectedStreamedWordArtifact = ConnectedStreamedWordArtifact;
|
|
28
28
|
//# sourceMappingURL=docx.cjs.map
|
package/dist/connect/docx.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { useConnectedNativeDocxAdapter } from '../chunk-
|
|
3
|
-
export { ConnectedNativeDocxEditor } from '../chunk-
|
|
2
|
+
import { useConnectedNativeDocxAdapter } from '../chunk-G5JH2YMQ.js';
|
|
3
|
+
export { ConnectedNativeDocxEditor } from '../chunk-G5JH2YMQ.js';
|
|
4
4
|
import '../chunk-OYMWV45N.js';
|
|
5
|
-
import { StreamedWordArtifact } from '../chunk-
|
|
6
|
-
import '../chunk-
|
|
5
|
+
import { StreamedWordArtifact } from '../chunk-YGREW5TZ.js';
|
|
6
|
+
import '../chunk-MYALCKDR.js';
|
|
7
7
|
import '../chunk-D3QPYKZG.js';
|
|
8
8
|
import '../chunk-AF6RDAJF.js';
|
|
9
9
|
import '../chunk-AA3PT6KR.js';
|
package/dist/connect/index.cjs
CHANGED
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
|
|
4
4
|
var chunk5YXG342J_cjs = require('../chunk-5YXG342J.cjs');
|
|
5
5
|
var chunkXMBYDLZQ_cjs = require('../chunk-XMBYDLZQ.cjs');
|
|
6
|
-
var
|
|
6
|
+
var chunkY5XW57U4_cjs = require('../chunk-Y5XW57U4.cjs');
|
|
7
7
|
var chunkMUMH3Z6K_cjs = require('../chunk-MUMH3Z6K.cjs');
|
|
8
8
|
var chunkJH6JTI76_cjs = require('../chunk-JH6JTI76.cjs');
|
|
9
|
-
require('../chunk-
|
|
9
|
+
require('../chunk-FAGQTB3D.cjs');
|
|
10
10
|
var chunkO4YPVYPO_cjs = require('../chunk-O4YPVYPO.cjs');
|
|
11
11
|
var chunkLENXDIMY_cjs = require('../chunk-LENXDIMY.cjs');
|
|
12
12
|
var chunkAOFATOT3_cjs = require('../chunk-AOFATOT3.cjs');
|
|
@@ -663,7 +663,7 @@ function WorkflowWordDialog({
|
|
|
663
663
|
title: title ?? labels.wordTitle,
|
|
664
664
|
size: "xl",
|
|
665
665
|
testId: "workflow-word-dialog",
|
|
666
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(chunkULWRNGGE_cjs.ModalScaffold.Body, { className: "h-[70dvh] p-0", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
666
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(chunkULWRNGGE_cjs.ModalScaffold.Body, { className: "h-[70dvh] p-0", children: /* @__PURE__ */ jsxRuntime.jsx(chunkY5XW57U4_cjs.ConnectedNativeDocxEditor, { documentId: id, title: title ?? labels.wordTitle }) })
|
|
667
667
|
}
|
|
668
668
|
);
|
|
669
669
|
}
|
package/dist/connect/index.js
CHANGED
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
import { SettingsSection, ProfileCard, AvatarPicker, IdentityVerificationCard, IdentityVerificationDialog, RequireVerified, SettingsCard, SettingsActionRow, PasswordChangeDialog, EMAIL_NOTIFICATION_KEYS, EMAIL_NOTIFICATION_CATEGORIES, NotificationCategoryList, toNotificationCategories, toActiveSessionViews, SettingsRow, ActiveSessionsDialog, LogoutDialog, toLogoutSessionViews, SettingsDangerZone, DeleteAccountDialog, toDeleteBlockerViews } from '../chunk-W7NZRZ54.js';
|
|
3
3
|
import { useWorkspaceDocs } from '../chunk-XQDM6T6C.js';
|
|
4
4
|
export { ConnectedAssistantDock, redlineStats, textToArtifact, toRedlineMarkdown, useConnectedAiTask, useConnectedChat, useSemanticSearch, useWorkspaceDocs } from '../chunk-XQDM6T6C.js';
|
|
5
|
-
import { ConnectedNativeDocxEditor } from '../chunk-
|
|
5
|
+
import { ConnectedNativeDocxEditor } from '../chunk-G5JH2YMQ.js';
|
|
6
6
|
import { ConnectionProvider, useConnection } from '../chunk-OYMWV45N.js';
|
|
7
7
|
export { ConnectionProvider, SESSION_EXPIRED_MESSAGE, isAuthenticated, useConnection } from '../chunk-OYMWV45N.js';
|
|
8
8
|
import { SignDocumentDialog } from '../chunk-2YOVK524.js';
|
|
9
|
-
import '../chunk-
|
|
9
|
+
import '../chunk-MYALCKDR.js';
|
|
10
10
|
import { FilesFilterBar, FolderFilterButton, FolderPickerRow } from '../chunk-7RJTEWYM.js';
|
|
11
11
|
import { WorkspaceActivityList, WorkspaceNotificationMenu, ThreadFollowMenuItem, ThreadFollowButton, TagTable, tagTableDocx } from '../chunk-Z3G65XHZ.js';
|
|
12
12
|
import { DOCX_MIME_TYPE } from '../chunk-D3QPYKZG.js';
|
|
@@ -3,6 +3,7 @@ import React from 'react';
|
|
|
3
3
|
import { type FontConfiguration } from '@docx-editor.dev/react';
|
|
4
4
|
import type { DocxCollaborationSession } from '@arbidocs/coedit';
|
|
5
5
|
import type { DefinitionSource } from '../tags/definitions';
|
|
6
|
+
import { type DocxImageGeneration } from './layout/GenerateImage';
|
|
6
7
|
import { type HouseTemplateHost } from './template/HouseTemplate';
|
|
7
8
|
/**
|
|
8
9
|
* The editor path of a document's DOCX bytes. A version reference (`doc-…@v2`, a read-only
|
|
@@ -42,9 +43,11 @@ export interface NativeDocxAdapter {
|
|
|
42
43
|
getAgentStatus?: (responseId: string) => Promise<DocxAgentRunStatus>;
|
|
43
44
|
/**
|
|
44
45
|
* The workspace's definitions: facts labelled "Definitions". Present: the Insert tab offers
|
|
45
|
-
* Defined term
|
|
46
|
+
* Defined term, and typing `@@` in the body opens the term type-ahead.
|
|
46
47
|
*/
|
|
47
48
|
definitions?: () => Promise<DefinitionSource[]>;
|
|
49
|
+
/** The platform's image generation. Present: the Insert tab offers Generate image. */
|
|
50
|
+
imageGeneration?: DocxImageGeneration;
|
|
48
51
|
/**
|
|
49
52
|
* The workspace's house template. Present: a blank note starts from it (its styles, numbering,
|
|
50
53
|
* page setup, headers and footers), Insert offers its Quick Parts, and the Design tab and the
|
|
@@ -74,8 +77,10 @@ export interface NativeDocxEditorProps {
|
|
|
74
77
|
export declare function DocxParticipants({ session }: {
|
|
75
78
|
session?: DocxCollaborationSession;
|
|
76
79
|
}): React.JSX.Element;
|
|
77
|
-
export declare function DocxRibbon({ onSave, badge, }: {
|
|
80
|
+
export declare function DocxRibbon({ onSave, badge, imageGeneration, }: {
|
|
78
81
|
onSave: () => void;
|
|
82
|
+
/** Insert › Generate image, when the host can generate images. */
|
|
83
|
+
imageGeneration?: DocxImageGeneration;
|
|
79
84
|
/** A short state label at the end of the row, such as "Co-edit mode". */
|
|
80
85
|
badge?: React.ReactNode;
|
|
81
86
|
}): React.JSX.Element;
|
|
@@ -1,16 +1,14 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Defined terms in the Word editor: a type-ahead of the workspace's definitions (typing `@@` in the
|
|
3
|
-
* body, or Insert › Defined term)
|
|
3
|
+
* body, or Insert › Defined term) and a hover card on an inserted term. Mount
|
|
4
4
|
* `DefinedTermsProvider` inside `DocxEditor.Root`; the ribbon's buttons read it from context.
|
|
5
5
|
*/
|
|
6
6
|
import React from 'react';
|
|
7
7
|
import { type DefinitionSource } from '../../tags/definitions';
|
|
8
|
-
import { type UpdateDefinitionsResult } from './commands';
|
|
9
8
|
/** Typing this in the body opens the type-ahead. */
|
|
10
9
|
export declare const DEFINED_TERM_TRIGGER = "@@";
|
|
11
10
|
export interface DefinedTermsLabels {
|
|
12
11
|
insert: string;
|
|
13
|
-
update: string;
|
|
14
12
|
search: string;
|
|
15
13
|
allAgreements: string;
|
|
16
14
|
loading: string;
|
|
@@ -19,20 +17,11 @@ export interface DefinedTermsLabels {
|
|
|
19
17
|
hint: string;
|
|
20
18
|
preferred: string;
|
|
21
19
|
alsoIn: (source: string) => string;
|
|
22
|
-
updated: string;
|
|
23
|
-
updateSummary: (r: UpdateDefinitionsResult) => string;
|
|
24
|
-
unusedTitle: string;
|
|
25
|
-
unusedNone: string;
|
|
26
|
-
unknownTitle: string;
|
|
27
|
-
show: string;
|
|
28
|
-
close: string;
|
|
29
20
|
}
|
|
30
21
|
export declare const DEFAULT_DEFINED_TERMS_LABELS: DefinedTermsLabels;
|
|
31
22
|
interface DefinedTermsContextValue {
|
|
32
23
|
/** Open the type-ahead at the caret, with a search box. */
|
|
33
24
|
openPicker: (anchor?: HTMLElement | null) => void;
|
|
34
|
-
/** Update the Definitions section and show what changed. */
|
|
35
|
-
update: () => void;
|
|
36
25
|
labels: DefinedTermsLabels;
|
|
37
26
|
}
|
|
38
27
|
/** The defined-term commands, or `null` where the editor has no definitions to offer. */
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* The defined-term commands: insert a term as a link to its definition (adding the definition to
|
|
3
|
-
* the document's Definitions section when it is not there yet)
|
|
4
|
-
*
|
|
5
|
-
*
|
|
3
|
+
* the document's Definitions section when it is not there yet). Written against
|
|
4
|
+
* {@link DefinitionsPort}, so they run on the live editor and on the in-memory model the tests use
|
|
5
|
+
* alike.
|
|
6
6
|
*
|
|
7
7
|
* Where the Definitions section is: the first top-level paragraph titled "Definitions",
|
|
8
8
|
* "Definitions and interpretation", "Interpretation", "Defined terms" or "Glossary" (clause numbers
|
|
@@ -48,30 +48,6 @@ export interface InsertTermResult {
|
|
|
48
48
|
export declare function insertDefinedTerm(port: DefinitionsPort, definition: Definition, options?: {
|
|
49
49
|
replace?: number;
|
|
50
50
|
}): InsertTermResult;
|
|
51
|
-
/** A definition in the section that nothing in the document uses. */
|
|
52
|
-
export interface UnusedDefinition {
|
|
53
|
-
term: string;
|
|
54
|
-
paragraphId: string;
|
|
55
|
-
}
|
|
56
|
-
export interface UpdateDefinitionsResult {
|
|
57
|
-
/** Terms whose definitions were added (linked from the text, missing from the section). */
|
|
58
|
-
added: string[];
|
|
59
|
-
/** Terms whose wording changed to the fact's current text. */
|
|
60
|
-
refreshed: string[];
|
|
61
|
-
/** Terms moved back into alphabetical order. */
|
|
62
|
-
reordered: string[];
|
|
63
|
-
/** Definitions in the section never used in the rest of the document (left in place). */
|
|
64
|
-
unused: UnusedDefinition[];
|
|
65
|
-
/** Linked bookmarks whose definition fact no longer exists or is no longer a definition. */
|
|
66
|
-
unknown: string[];
|
|
67
|
-
}
|
|
68
|
-
/**
|
|
69
|
-
* Update the Definitions section from the definition facts (`definitions`, by fact id): add the
|
|
70
|
-
* definitions the text links to but the section lacks, refresh the wording of the ones it has,
|
|
71
|
-
* put them back in alphabetical order, and report — without removing anything — the definitions
|
|
72
|
-
* in the section the rest of the document never uses.
|
|
73
|
-
*/
|
|
74
|
-
export declare function updateDefinitions(port: DefinitionsPort, definitions: ReadonlyMap<string, Definition>): UpdateDefinitionsResult;
|
|
75
51
|
/** Term groups keyed for quick lookup of the definition a bookmark points at. */
|
|
76
52
|
export declare function definitionsById(definitions: readonly Definition[]): Map<string, Definition>;
|
|
77
53
|
/** The definition an internal link points at, from its bookmark name. */
|
package/dist/docx/index.cjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
|
-
var
|
|
5
|
-
var
|
|
4
|
+
var chunkZT2EBBSC_cjs = require('../chunk-ZT2EBBSC.cjs');
|
|
5
|
+
var chunkFAGQTB3D_cjs = require('../chunk-FAGQTB3D.cjs');
|
|
6
6
|
require('../chunk-AOFATOT3.cjs');
|
|
7
7
|
require('../chunk-RC25WMVB.cjs');
|
|
8
8
|
require('../chunk-7UTB4PHM.cjs');
|
|
@@ -60,7 +60,7 @@ function NativeDocxComparison({
|
|
|
60
60
|
if (!documentId)
|
|
61
61
|
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "native-docx-error", role: "status", children: "Comparing Word documents\u2026" });
|
|
62
62
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
63
|
-
|
|
63
|
+
chunkFAGQTB3D_cjs.NativeDocxEditor,
|
|
64
64
|
{
|
|
65
65
|
adapter,
|
|
66
66
|
documentId,
|
|
@@ -72,131 +72,131 @@ function NativeDocxComparison({
|
|
|
72
72
|
|
|
73
73
|
Object.defineProperty(exports, "StreamedWordArtifact", {
|
|
74
74
|
enumerable: true,
|
|
75
|
-
get: function () { return
|
|
75
|
+
get: function () { return chunkZT2EBBSC_cjs.StreamedWordArtifact; }
|
|
76
76
|
});
|
|
77
77
|
Object.defineProperty(exports, "BUILTIN_TEMPLATE_NAME", {
|
|
78
78
|
enumerable: true,
|
|
79
|
-
get: function () { return
|
|
79
|
+
get: function () { return chunkFAGQTB3D_cjs.BUILTIN_TEMPLATE_NAME; }
|
|
80
80
|
});
|
|
81
81
|
Object.defineProperty(exports, "DEFAULT_DEFINED_TERMS_LABELS", {
|
|
82
82
|
enumerable: true,
|
|
83
|
-
get: function () { return
|
|
83
|
+
get: function () { return chunkFAGQTB3D_cjs.DEFAULT_DEFINED_TERMS_LABELS; }
|
|
84
84
|
});
|
|
85
85
|
Object.defineProperty(exports, "DEFINED_TERM_TRIGGER", {
|
|
86
86
|
enumerable: true,
|
|
87
|
-
get: function () { return
|
|
87
|
+
get: function () { return chunkFAGQTB3D_cjs.DEFINED_TERM_TRIGGER; }
|
|
88
88
|
});
|
|
89
89
|
Object.defineProperty(exports, "DefinedTermsProvider", {
|
|
90
90
|
enumerable: true,
|
|
91
|
-
get: function () { return
|
|
91
|
+
get: function () { return chunkFAGQTB3D_cjs.DefinedTermsProvider; }
|
|
92
92
|
});
|
|
93
93
|
Object.defineProperty(exports, "DocxAuthorContext", {
|
|
94
94
|
enumerable: true,
|
|
95
|
-
get: function () { return
|
|
95
|
+
get: function () { return chunkFAGQTB3D_cjs.DocxAuthorContext; }
|
|
96
96
|
});
|
|
97
97
|
Object.defineProperty(exports, "DocxCommentActivity", {
|
|
98
98
|
enumerable: true,
|
|
99
|
-
get: function () { return
|
|
99
|
+
get: function () { return chunkFAGQTB3D_cjs.DocxCommentActivity; }
|
|
100
100
|
});
|
|
101
101
|
Object.defineProperty(exports, "DocxEditorReview", {
|
|
102
102
|
enumerable: true,
|
|
103
|
-
get: function () { return
|
|
103
|
+
get: function () { return chunkFAGQTB3D_cjs.DocxEditorReview; }
|
|
104
104
|
});
|
|
105
105
|
Object.defineProperty(exports, "DocxMentions", {
|
|
106
106
|
enumerable: true,
|
|
107
|
-
get: function () { return
|
|
107
|
+
get: function () { return chunkFAGQTB3D_cjs.DocxMentions; }
|
|
108
108
|
});
|
|
109
109
|
Object.defineProperty(exports, "DocxParticipants", {
|
|
110
110
|
enumerable: true,
|
|
111
|
-
get: function () { return
|
|
111
|
+
get: function () { return chunkFAGQTB3D_cjs.DocxParticipants; }
|
|
112
112
|
});
|
|
113
113
|
Object.defineProperty(exports, "DocxRibbon", {
|
|
114
114
|
enumerable: true,
|
|
115
|
-
get: function () { return
|
|
115
|
+
get: function () { return chunkFAGQTB3D_cjs.DocxRibbon; }
|
|
116
|
+
});
|
|
117
|
+
Object.defineProperty(exports, "GenerateImageButton", {
|
|
118
|
+
enumerable: true,
|
|
119
|
+
get: function () { return chunkFAGQTB3D_cjs.GenerateImageButton; }
|
|
116
120
|
});
|
|
117
121
|
Object.defineProperty(exports, "HouseTemplateProvider", {
|
|
118
122
|
enumerable: true,
|
|
119
|
-
get: function () { return
|
|
123
|
+
get: function () { return chunkFAGQTB3D_cjs.HouseTemplateProvider; }
|
|
120
124
|
});
|
|
121
125
|
Object.defineProperty(exports, "NativeDocxEditor", {
|
|
122
126
|
enumerable: true,
|
|
123
|
-
get: function () { return
|
|
127
|
+
get: function () { return chunkFAGQTB3D_cjs.NativeDocxEditor; }
|
|
124
128
|
});
|
|
125
129
|
Object.defineProperty(exports, "builtinHouseTemplate", {
|
|
126
130
|
enumerable: true,
|
|
127
|
-
get: function () { return
|
|
131
|
+
get: function () { return chunkFAGQTB3D_cjs.builtinHouseTemplate; }
|
|
128
132
|
});
|
|
129
133
|
Object.defineProperty(exports, "contentPath", {
|
|
130
134
|
enumerable: true,
|
|
131
|
-
get: function () { return
|
|
135
|
+
get: function () { return chunkFAGQTB3D_cjs.contentPath; }
|
|
132
136
|
});
|
|
133
137
|
Object.defineProperty(exports, "editorPort", {
|
|
134
138
|
enumerable: true,
|
|
135
|
-
get: function () { return
|
|
139
|
+
get: function () { return chunkFAGQTB3D_cjs.editorPort; }
|
|
136
140
|
});
|
|
137
141
|
Object.defineProperty(exports, "findDefinitionsSection", {
|
|
138
142
|
enumerable: true,
|
|
139
|
-
get: function () { return
|
|
143
|
+
get: function () { return chunkFAGQTB3D_cjs.findDefinitionsSection; }
|
|
140
144
|
});
|
|
141
145
|
Object.defineProperty(exports, "insertDefinedTerm", {
|
|
142
146
|
enumerable: true,
|
|
143
|
-
get: function () { return
|
|
147
|
+
get: function () { return chunkFAGQTB3D_cjs.insertDefinedTerm; }
|
|
144
148
|
});
|
|
145
149
|
Object.defineProperty(exports, "loadDocxFonts", {
|
|
146
150
|
enumerable: true,
|
|
147
|
-
get: function () { return
|
|
151
|
+
get: function () { return chunkFAGQTB3D_cjs.loadDocxFonts; }
|
|
148
152
|
});
|
|
149
153
|
Object.defineProperty(exports, "normalizeDocxExport", {
|
|
150
154
|
enumerable: true,
|
|
151
|
-
get: function () { return
|
|
155
|
+
get: function () { return chunkFAGQTB3D_cjs.normalizeDocxExport; }
|
|
152
156
|
});
|
|
153
157
|
Object.defineProperty(exports, "resolveHouseTemplate", {
|
|
154
158
|
enumerable: true,
|
|
155
|
-
get: function () { return
|
|
159
|
+
get: function () { return chunkFAGQTB3D_cjs.resolveHouseTemplate; }
|
|
156
160
|
});
|
|
157
161
|
Object.defineProperty(exports, "reviewModule", {
|
|
158
162
|
enumerable: true,
|
|
159
|
-
get: function () { return
|
|
163
|
+
get: function () { return chunkFAGQTB3D_cjs.reviewModule; }
|
|
160
164
|
});
|
|
161
165
|
Object.defineProperty(exports, "structuralPort", {
|
|
162
166
|
enumerable: true,
|
|
163
|
-
get: function () { return
|
|
167
|
+
get: function () { return chunkFAGQTB3D_cjs.structuralPort; }
|
|
164
168
|
});
|
|
165
169
|
Object.defineProperty(exports, "templateFileName", {
|
|
166
170
|
enumerable: true,
|
|
167
|
-
get: function () { return
|
|
171
|
+
get: function () { return chunkFAGQTB3D_cjs.templateFileName; }
|
|
168
172
|
});
|
|
169
173
|
Object.defineProperty(exports, "trackedOrNoted", {
|
|
170
174
|
enumerable: true,
|
|
171
|
-
get: function () { return
|
|
172
|
-
});
|
|
173
|
-
Object.defineProperty(exports, "updateDefinitions", {
|
|
174
|
-
enumerable: true,
|
|
175
|
-
get: function () { return chunk44TPPPRJ_cjs.updateDefinitions; }
|
|
175
|
+
get: function () { return chunkFAGQTB3D_cjs.trackedOrNoted; }
|
|
176
176
|
});
|
|
177
177
|
Object.defineProperty(exports, "useDefinedTerms", {
|
|
178
178
|
enumerable: true,
|
|
179
|
-
get: function () { return
|
|
179
|
+
get: function () { return chunkFAGQTB3D_cjs.useDefinedTerms; }
|
|
180
180
|
});
|
|
181
181
|
Object.defineProperty(exports, "useHouseTemplate", {
|
|
182
182
|
enumerable: true,
|
|
183
|
-
get: function () { return
|
|
183
|
+
get: function () { return chunkFAGQTB3D_cjs.useHouseTemplate; }
|
|
184
184
|
});
|
|
185
185
|
Object.defineProperty(exports, "useReview", {
|
|
186
186
|
enumerable: true,
|
|
187
|
-
get: function () { return
|
|
187
|
+
get: function () { return chunkFAGQTB3D_cjs.useReview; }
|
|
188
188
|
});
|
|
189
189
|
Object.defineProperty(exports, "useReviewItem", {
|
|
190
190
|
enumerable: true,
|
|
191
|
-
get: function () { return
|
|
191
|
+
get: function () { return chunkFAGQTB3D_cjs.useReviewItem; }
|
|
192
192
|
});
|
|
193
193
|
Object.defineProperty(exports, "useTrackedOrNoted", {
|
|
194
194
|
enumerable: true,
|
|
195
|
-
get: function () { return
|
|
195
|
+
get: function () { return chunkFAGQTB3D_cjs.useTrackedOrNoted; }
|
|
196
196
|
});
|
|
197
197
|
Object.defineProperty(exports, "withDirectEditing", {
|
|
198
198
|
enumerable: true,
|
|
199
|
-
get: function () { return
|
|
199
|
+
get: function () { return chunkFAGQTB3D_cjs.withDirectEditing; }
|
|
200
200
|
});
|
|
201
201
|
Object.defineProperty(exports, "DocxEditor", {
|
|
202
202
|
enumerable: true,
|
package/dist/docx/index.d.ts
CHANGED
|
@@ -10,8 +10,9 @@ export { normalizeDocxExport } from './export';
|
|
|
10
10
|
export { StreamedWordArtifact, type StreamedWordArtifactProps } from './StreamedWordArtifact';
|
|
11
11
|
export { NativeDocxComparison, type NativeDocxComparisonProps } from './NativeDocxComparison';
|
|
12
12
|
export { DefinedTermsProvider, useDefinedTerms, DEFINED_TERM_TRIGGER, DEFAULT_DEFINED_TERMS_LABELS, type DefinedTermsProviderProps, type DefinedTermsLabels, } from './definitions/DefinedTerms';
|
|
13
|
-
export { insertDefinedTerm,
|
|
13
|
+
export { insertDefinedTerm, findDefinitionsSection } from './definitions/commands';
|
|
14
14
|
export { editorPort, withDirectEditing, type DefinitionsPort } from './definitions/port';
|
|
15
|
+
export { GenerateImageButton, type DocxImageGeneration } from './layout/GenerateImage';
|
|
15
16
|
export { structuralPort, trackedOrNoted, type StructuralInsert, type StructuralOutcome, type StructuralPort, } from './structural/trackedOrNoted';
|
|
16
17
|
export { DocxAuthorContext, useTrackedOrNoted } from './structural/useTrackedOrNoted';
|
|
17
18
|
export { contentPath } from './NativeDocxEditor';
|
package/dist/docx/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
export { StreamedWordArtifact } from '../chunk-
|
|
3
|
-
import { NativeDocxEditor } from '../chunk-
|
|
4
|
-
export { BUILTIN_TEMPLATE_NAME, DEFAULT_DEFINED_TERMS_LABELS, DEFINED_TERM_TRIGGER, DefinedTermsProvider, DocxAuthorContext, DocxCommentActivity, DocxEditorReview, DocxMentions, DocxParticipants, DocxRibbon, HouseTemplateProvider, NativeDocxEditor, builtinHouseTemplate, contentPath, editorPort, findDefinitionsSection, insertDefinedTerm, loadDocxFonts, normalizeDocxExport, resolveHouseTemplate, reviewModule, structuralPort, templateFileName, trackedOrNoted,
|
|
2
|
+
export { StreamedWordArtifact } from '../chunk-YGREW5TZ.js';
|
|
3
|
+
import { NativeDocxEditor } from '../chunk-MYALCKDR.js';
|
|
4
|
+
export { BUILTIN_TEMPLATE_NAME, DEFAULT_DEFINED_TERMS_LABELS, DEFINED_TERM_TRIGGER, DefinedTermsProvider, DocxAuthorContext, DocxCommentActivity, DocxEditorReview, DocxMentions, DocxParticipants, DocxRibbon, GenerateImageButton, HouseTemplateProvider, NativeDocxEditor, builtinHouseTemplate, contentPath, editorPort, findDefinitionsSection, insertDefinedTerm, loadDocxFonts, normalizeDocxExport, resolveHouseTemplate, reviewModule, structuralPort, templateFileName, trackedOrNoted, useDefinedTerms, useHouseTemplate, useReview, useReviewItem, useTrackedOrNoted, withDirectEditing } from '../chunk-MYALCKDR.js';
|
|
5
5
|
import '../chunk-D3QPYKZG.js';
|
|
6
6
|
import '../chunk-AF6RDAJF.js';
|
|
7
7
|
import '../chunk-AA3PT6KR.js';
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Insert › Generate image: a prompt goes to the host's image generation (the platform's `/image`
|
|
3
|
+
* command), and the picture that comes back is inserted where the caret was when Generate was
|
|
4
|
+
* pressed, as an ordinary inline picture whose alt text is the prompt. The engine stores the bytes
|
|
5
|
+
* as the document's own media part, so the picture saves with the DOCX like any inserted one.
|
|
6
|
+
*
|
|
7
|
+
* Generation takes a while. The caret is remembered by the paragraph's `w14:paraId`, which survives
|
|
8
|
+
* a collaboration room re-installing the document meanwhile, and the person may keep writing. The
|
|
9
|
+
* ribbon may even be remounted meanwhile (a new editor instance over the same room): the picture
|
|
10
|
+
* then goes into whichever mounted editor holds that paragraph.
|
|
11
|
+
*/
|
|
12
|
+
import React from 'react';
|
|
13
|
+
import { useDocxEditor } from '@docx-editor.dev/react';
|
|
14
|
+
/** The host's image generation, as the editor uses it. */
|
|
15
|
+
export interface DocxImageGeneration {
|
|
16
|
+
/** Generate one image from `prompt` and return its bytes (PNG, JPEG, GIF or WebP). */
|
|
17
|
+
generate: (prompt: string, options: {
|
|
18
|
+
aspectRatio?: string;
|
|
19
|
+
signal?: AbortSignal;
|
|
20
|
+
}) => Promise<Uint8Array>;
|
|
21
|
+
/** The aspect ratios the image model accepts; none offers only the model's default. */
|
|
22
|
+
aspectRatios?: readonly {
|
|
23
|
+
value: string;
|
|
24
|
+
label: string;
|
|
25
|
+
}[];
|
|
26
|
+
notify?: (message: string, kind: 'success' | 'error') => void;
|
|
27
|
+
}
|
|
28
|
+
type Editor = NonNullable<ReturnType<typeof useDocxEditor>>;
|
|
29
|
+
interface Caret {
|
|
30
|
+
paraId: string | null;
|
|
31
|
+
paragraphId: string;
|
|
32
|
+
offset: number;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* The editor to insert into: the one the request came from while it is still mounted, else the
|
|
36
|
+
* newest mounted editor whose document holds the remembered paragraph. Null when the document was
|
|
37
|
+
* closed meanwhile.
|
|
38
|
+
*/
|
|
39
|
+
export declare function insertionTarget(origin: Editor, caret: Caret | null, editors?: readonly Editor[]): Editor | null;
|
|
40
|
+
/** Insert `bytes` at `caret` as an inline picture. Throws with a readable reason on refusal. */
|
|
41
|
+
export declare function insertGeneratedImage(editor: Editor, bytes: Uint8Array, prompt: string, caret: Caret | null): Promise<void>;
|
|
42
|
+
/**
|
|
43
|
+
* Make this ribbon's editor a place a running generation can land. The ribbon calls it whatever its
|
|
44
|
+
* tab: a remounted editor opens on Home, without the Generate image button.
|
|
45
|
+
*/
|
|
46
|
+
export declare function useGenerateImageTarget(): void;
|
|
47
|
+
export declare function GenerateImageButton({ generation }: {
|
|
48
|
+
generation: DocxImageGeneration;
|
|
49
|
+
}): React.JSX.Element | null;
|
|
50
|
+
export {};
|