@arbidocs/blocks 0.4.106 → 0.4.108
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/bin/arbidocs-render-take.mjs +27 -0
- package/dist/NativeDocxEditor-UAZUKZ77.js +10 -0
- package/dist/NativeDocxEditor-UAZUKZ77.js.map +1 -0
- package/dist/NativeDocxEditor-YX7B7OFH.cjs +31 -0
- package/dist/NativeDocxEditor-YX7B7OFH.cjs.map +1 -0
- package/dist/{chunk-W2RTZOK3.js → chunk-A2MN2ZLX.js} +1750 -1779
- package/dist/chunk-A2MN2ZLX.js.map +1 -0
- package/dist/{chunk-3R6XBYL7.cjs → chunk-DTBSGG36.cjs} +7 -2
- package/dist/chunk-DTBSGG36.cjs.map +1 -0
- package/dist/{chunk-4GFB5U3K.js → chunk-EGDWNEAG.js} +4 -3
- package/dist/chunk-EGDWNEAG.js.map +1 -0
- package/dist/chunk-GYAUJ4KT.js +71 -0
- package/dist/chunk-GYAUJ4KT.js.map +1 -0
- package/dist/{chunk-PIT2YZCK.js → chunk-JQVPGMLU.js} +3 -3
- package/dist/{chunk-PIT2YZCK.js.map → chunk-JQVPGMLU.js.map} +1 -1
- package/dist/{chunk-LGX6UFYG.js → chunk-P2KPDPFF.js} +8 -3
- package/dist/chunk-P2KPDPFF.js.map +1 -0
- package/dist/{chunk-ZWWN4CUL.cjs → chunk-QT6EGMAJ.cjs} +1748 -1778
- package/dist/chunk-QT6EGMAJ.cjs.map +1 -0
- package/dist/chunk-S24XEVPS.cjs +73 -0
- package/dist/chunk-S24XEVPS.cjs.map +1 -0
- package/dist/{chunk-TP3FAP5J.cjs → chunk-TTXK62YI.cjs} +5 -5
- package/dist/{chunk-TP3FAP5J.cjs.map → chunk-TTXK62YI.cjs.map} +1 -1
- package/dist/{chunk-7LLLQUM7.cjs → chunk-ZYSY4L5L.cjs} +6 -5
- package/dist/chunk-ZYSY4L5L.cjs.map +1 -0
- package/dist/collaboration/index.cjs +15 -15
- package/dist/collaboration/index.js +1 -1
- package/dist/collaboration/mail/MailMessageView.d.ts +3 -1
- package/dist/connect/docx.cjs +7 -6
- package/dist/connect/docx.cjs.map +1 -1
- package/dist/connect/docx.js +5 -4
- package/dist/connect/docx.js.map +1 -1
- package/dist/connect/index.cjs +368 -52
- package/dist/connect/index.cjs.map +1 -1
- package/dist/connect/index.js +356 -41
- package/dist/connect/index.js.map +1 -1
- package/dist/connection/mail/ConnectedMailComposer.d.ts +12 -2
- package/dist/connection/mail/ConnectedMailMessage.d.ts +19 -0
- package/dist/connection/mail/ConnectedMailbox.d.ts +7 -3
- package/dist/connection/mail/MailComposerForm.d.ts +12 -2
- package/dist/connection/mail/index.d.ts +2 -1
- package/dist/connection/mail/types.d.ts +15 -0
- package/dist/connection/mail/useWordBody.d.ts +48 -0
- package/dist/docx/NativeDocxEditor.d.ts +9 -1
- package/dist/docx/index.cjs +51 -50
- package/dist/docx/index.cjs.map +1 -1
- package/dist/docx/index.js +4 -3
- package/dist/docx/index.js.map +1 -1
- package/dist/docx/template/HouseTemplate.d.ts +5 -0
- package/dist/index.cjs +15 -15
- package/dist/index.js +1 -1
- package/dist/record/index.cjs +307 -66
- package/dist/record/index.cjs.map +1 -1
- package/dist/record/index.d.ts +145 -26
- package/dist/record/index.js +301 -67
- package/dist/record/index.js.map +1 -1
- package/node_modules/@arbidocs/coedit/package.json +1 -1
- package/package.json +8 -5
- package/record/render-overlays.mjs +152 -0
- package/record/render-take.py +985 -0
- package/src/docx/styles.css +22 -0
- package/dist/chunk-3R6XBYL7.cjs.map +0 -1
- package/dist/chunk-4GFB5U3K.js.map +0 -1
- package/dist/chunk-7LLLQUM7.cjs.map +0 -1
- package/dist/chunk-LGX6UFYG.js.map +0 -1
- package/dist/chunk-W2RTZOK3.js.map +0 -1
- package/dist/chunk-ZWWN4CUL.cjs.map +0 -1
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
*/
|
|
8
8
|
import { type RefObject } from 'react';
|
|
9
9
|
import { type MailAccount, type MailCompose, type MailMessage } from '@arbidocs/react';
|
|
10
|
-
import type { MailDocumentSource, MailNotify, MailOfflineSupport } from './types';
|
|
10
|
+
import type { MailDocumentSource, MailNotify, MailOfflineSupport, MailWordEditor } from './types';
|
|
11
11
|
export interface ConnectedMailComposerProps {
|
|
12
12
|
/** Open this saved draft (from the account's Drafts) instead of a new message. */
|
|
13
13
|
draftId?: string;
|
|
@@ -36,5 +36,15 @@ export interface ConnectedMailComposerProps {
|
|
|
36
36
|
/** Workspace documents to attach ("From workspace"). Absent: not offered. */
|
|
37
37
|
documents?: MailDocumentSource;
|
|
38
38
|
notify?: MailNotify;
|
|
39
|
+
/** A native draft's body in the Word editor (see {@link MailWordEditor}). Absent: the rich-text body. */
|
|
40
|
+
word?: MailWordEditor;
|
|
41
|
+
/** This compose session, stable across remounts (its Word room is kept for it). */
|
|
42
|
+
sessionKey?: string;
|
|
43
|
+
/** Open this Word room as the body (a new message whose body ARBI wrote). */
|
|
44
|
+
roomId?: string;
|
|
45
|
+
/** A reply to this email (its id): the composer starts addressed and threaded as one; the body is `roomId`. */
|
|
46
|
+
replyTo?: string;
|
|
47
|
+
/** The host's header for this message (a panel's title bar): who ARBI's work is billed to shows there. */
|
|
48
|
+
headerSlot?: HTMLElement | null;
|
|
39
49
|
}
|
|
40
|
-
export declare function ConnectedMailComposer({ draftId, initial, account: accountProp, mailbox, maxBytes: maxBytesProp, ready: readyProp, drafts: draftsProp, notify, offline, ...rest }: ConnectedMailComposerProps): import("react").JSX.Element;
|
|
50
|
+
export declare function ConnectedMailComposer({ draftId, initial, account: accountProp, mailbox, maxBytes: maxBytesProp, ready: readyProp, drafts: draftsProp, notify, offline, replyTo, ...rest }: ConnectedMailComposerProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* One email of the mail client in scope, shown on its own (e.g. in a panel beside a chat): its actions,
|
|
3
|
+
* sender, recipients, attachments and body, as the mailbox shows it. Replying hands the new message to
|
|
4
|
+
* the host (`onCompose`), and so does asking ARBI to draft the reply (`onReplyWithArbi`).
|
|
5
|
+
*/
|
|
6
|
+
import { type MailAccount, type MailCompose, type MailMessage } from '@arbidocs/react';
|
|
7
|
+
export interface ConnectedMailMessageProps {
|
|
8
|
+
messageId: string;
|
|
9
|
+
/** The account the message is in: an id, or `'native'` (default). */
|
|
10
|
+
mailbox?: string;
|
|
11
|
+
/** The folder it is in (replying from Sent goes to its recipients). Default: the inbox. */
|
|
12
|
+
folderRole?: string;
|
|
13
|
+
onClose: () => void;
|
|
14
|
+
/** Reply / reply all / forward: the new message, to open in a composer. */
|
|
15
|
+
onCompose: (initial: MailCompose) => void;
|
|
16
|
+
/** Ask ARBI to draft the reply. Absent: not offered. */
|
|
17
|
+
onReplyWithArbi?: (message: MailMessage, account: MailAccount) => void;
|
|
18
|
+
}
|
|
19
|
+
export declare function ConnectedMailMessage({ messageId, mailbox, folderRole, onClose, onCompose, onReplyWithArbi, }: ConnectedMailMessageProps): import("react").JSX.Element;
|
|
@@ -10,9 +10,9 @@
|
|
|
10
10
|
*/
|
|
11
11
|
import { type ReactNode } from 'react';
|
|
12
12
|
import type { GridState } from 'ag-grid-community';
|
|
13
|
-
import { type MailAddress, type MailAttachment } from '@arbidocs/react';
|
|
13
|
+
import { type MailAddress, type MailAccount, type MailAttachment, type MailMessage } from '@arbidocs/react';
|
|
14
14
|
import { type MailAliasUser } from './ConnectedMailAccounts';
|
|
15
|
-
import type { MailDocumentSource, MailNotify, MailOfflineSupport, MailPanelProps, MailSaveToWorkspace } from './types';
|
|
15
|
+
import type { MailDocumentSource, MailNotify, MailOfflineSupport, MailPanelProps, MailSaveToWorkspace, MailWordEditor } from './types';
|
|
16
16
|
export interface ConnectedMailboxProps {
|
|
17
17
|
/** Which mailbox: an account id, or `'native'` for the user's own inbox. Default: the first. */
|
|
18
18
|
mailbox?: string;
|
|
@@ -44,6 +44,10 @@ export interface ConnectedMailboxProps {
|
|
|
44
44
|
documents?: MailDocumentSource;
|
|
45
45
|
/** Saving an email into a workspace ("Save to workspace" on native mail). */
|
|
46
46
|
saveToWorkspace?: MailSaveToWorkspace;
|
|
47
|
+
/** Native drafts' bodies in the Word editor, where ARBI's edits are suggestions. Absent: rich text. */
|
|
48
|
+
word?: MailWordEditor;
|
|
49
|
+
/** "Reply with ARBI" on a native message: the host starts the chat that drafts it. Absent: not offered. */
|
|
50
|
+
onReplyWithArbi?: (message: MailMessage, account: MailAccount) => void;
|
|
47
51
|
/** A calendar invite card for a message with an .ics part. */
|
|
48
52
|
renderInvite?: (props: {
|
|
49
53
|
accountId: string;
|
|
@@ -62,4 +66,4 @@ export interface ConnectedMailboxProps {
|
|
|
62
66
|
initialMessageId?: string | null;
|
|
63
67
|
notify?: MailNotify;
|
|
64
68
|
}
|
|
65
|
-
export declare function ConnectedMailbox({ mailbox, draftId, onDraftOpened, folder: requestedFolder, onFolderOpened, composeAttachments, onComposeOpened, onOpenDocument, user, productName, oauthReturnPath, personLabel, offline, documents, saveToWorkspace, renderInvite, renderPanel, onViewerOpenChange, gridState, onGridStateChange, initialMessageId, notify, }: ConnectedMailboxProps): import("react").JSX.Element;
|
|
69
|
+
export declare function ConnectedMailbox({ mailbox, draftId, onDraftOpened, folder: requestedFolder, onFolderOpened, composeAttachments, onComposeOpened, onOpenDocument, user, productName, oauthReturnPath, personLabel, offline, documents, saveToWorkspace, word, onReplyWithArbi, renderInvite, renderPanel, onViewerOpenChange, gridState, onGridStateChange, initialMessageId, notify, }: ConnectedMailboxProps): import("react").JSX.Element;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type RefObject } from 'react';
|
|
2
2
|
import { type MailAccount, type MailCompose, type MailMessage } from '@arbidocs/react';
|
|
3
|
-
import type { MailDocumentSource, MailNotify, MailOfflineSupport } from './types';
|
|
3
|
+
import type { MailDocumentSource, MailNotify, MailOfflineSupport, MailWordEditor } from './types';
|
|
4
4
|
export interface MailComposerFormProps {
|
|
5
5
|
account?: MailAccount;
|
|
6
6
|
initial: MailCompose;
|
|
@@ -11,6 +11,8 @@ export interface MailComposerFormProps {
|
|
|
11
11
|
onClose: () => void;
|
|
12
12
|
/** Open a saved draft (from the "already in Drafts" notice). Absent: the notice has no button. */
|
|
13
13
|
onOpenDraft?: (id: string) => void;
|
|
14
|
+
/** Reopen this form on a newer version of its draft, saved elsewhere (by ARBI, or in another tab). */
|
|
15
|
+
onReload?: (draftId: string) => void;
|
|
14
16
|
/** Reports every edit so the parent can re-seed this form if it remounts (e.g. docked → overlay). */
|
|
15
17
|
onChange?: (value: MailCompose) => void;
|
|
16
18
|
embedded?: boolean;
|
|
@@ -20,6 +22,14 @@ export interface MailComposerFormProps {
|
|
|
20
22
|
offline?: MailOfflineSupport;
|
|
21
23
|
documents?: MailDocumentSource;
|
|
22
24
|
notify: MailNotify;
|
|
25
|
+
/** A native draft's body in the Word editor. Absent: the rich-text body. */
|
|
26
|
+
word?: MailWordEditor;
|
|
27
|
+
/** This compose session, stable across remounts (its Word room is kept for it). */
|
|
28
|
+
sessionKey?: string;
|
|
29
|
+
/** Open this Word room as the body (a new message whose body ARBI wrote) instead of a new one. */
|
|
30
|
+
roomId?: string;
|
|
31
|
+
/** The host's header for this message (a panel's title bar): who ARBI's work is billed to shows there. */
|
|
32
|
+
headerSlot?: HTMLElement | null;
|
|
23
33
|
}
|
|
24
34
|
/** Write, save and send one message. */
|
|
25
|
-
export declare function MailComposerForm({ account, initial, maxBytes, ready, drafts, onClose, onOpenDraft, onChange, embedded, closeRequestRef, localDraftId: initialLocalDraftId, offline, documents, notify, }: MailComposerFormProps): import("react").JSX.Element;
|
|
35
|
+
export declare function MailComposerForm({ account, initial, maxBytes, ready, drafts, onClose, onOpenDraft, onReload, onChange, embedded, closeRequestRef, localDraftId: initialLocalDraftId, offline, documents, notify, word, sessionKey, roomId, headerSlot, }: MailComposerFormProps): import("react").JSX.Element;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export { ConnectedMailbox, type ConnectedMailboxProps } from './ConnectedMailbox';
|
|
2
2
|
export { ConnectedMailComposer, type ConnectedMailComposerProps } from './ConnectedMailComposer';
|
|
3
|
+
export { ConnectedMailMessage, type ConnectedMailMessageProps } from './ConnectedMailMessage';
|
|
3
4
|
export { defaultMailNotify, resolveMailbox } from './mailbox';
|
|
4
5
|
export { ConnectedMailAccounts, type ConnectedMailAccountsProps, type MailAliasUser, } from './ConnectedMailAccounts';
|
|
5
6
|
export { ConnectedMailSetup } from './ConnectedMailSetup';
|
|
6
|
-
export type { MailNotify, MailLocalDraft, MailOutboxEntry, MailOutboxRequest, MailOfflineSupport, MailDocumentSource, MailSaveToWorkspace, MailPanelProps, } from './types';
|
|
7
|
+
export type { MailNotify, MailLocalDraft, MailOutboxEntry, MailOutboxRequest, MailOfflineSupport, MailDocumentSource, MailSaveToWorkspace, MailPanelProps, MailWordEditor, } from './types';
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { ReactNode } from 'react';
|
|
2
2
|
import type { MailAccount, MailAttachment, MailCompose } from '@arbidocs/react';
|
|
3
3
|
import type { MailAttachableDocument } from '../../collaboration/mail/MailDocumentPicker';
|
|
4
|
+
import type { NativeDocxAdapter } from '../../docx/NativeDocxEditor';
|
|
4
5
|
/** Tell the user how an action went (a toast). Default: `notify` from `@arbidocs/react`. */
|
|
5
6
|
export type MailNotify = (message: string, variant: 'success' | 'info' | 'error', options?: {
|
|
6
7
|
description?: string;
|
|
@@ -83,6 +84,20 @@ export interface MailSaveToWorkspace {
|
|
|
83
84
|
/** Upload the .eml; resolves with the new document's id when known. */
|
|
84
85
|
save(workspaceId: string, file: File): Promise<string | void>;
|
|
85
86
|
}
|
|
87
|
+
/**
|
|
88
|
+
* A native draft's body in the Word editor (the compact `NativeDocxEditor`), so it is edited like a
|
|
89
|
+
* document: ARBI's edits arrive as tracked changes to accept or reject before sending. Sessions come
|
|
90
|
+
* from the mail client (`openDraftEditor`); the host supplies the editor's integration.
|
|
91
|
+
*/
|
|
92
|
+
export interface MailWordEditor {
|
|
93
|
+
/** Fonts, the collaboration base URL, notices and token renewal: the host's document adapter. */
|
|
94
|
+
adapter: Pick<NativeDocxAdapter, 'request' | 'loadFonts' | 'baseUrl' | 'notify' | 'subscribeTokenChanges' | 'author'>;
|
|
95
|
+
/**
|
|
96
|
+
* The draft's room opened (its id): the host shows it to the chat as the open document, so ARBI
|
|
97
|
+
* edits it there. Returns what to do when it closes.
|
|
98
|
+
*/
|
|
99
|
+
onRoomOpened?: (roomId: string) => (() => void) | void;
|
|
100
|
+
}
|
|
86
101
|
/** Where the reader and the composer open. */
|
|
87
102
|
export interface MailPanelProps {
|
|
88
103
|
isOpen: boolean;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A composer's body in the Word editor: its draft room (opened, reopened after a reconnect or a
|
|
3
|
+
* remount, shown to the chat while open) and the room's save, send and body calls.
|
|
4
|
+
*
|
|
5
|
+
* The room is the body: it saves itself as it is typed into, ARBI's edits land in it as tracked
|
|
6
|
+
* changes, and the draft's text and HTML are made from it on the server when it is saved or sent.
|
|
7
|
+
*/
|
|
8
|
+
import { type MailClient, type MailCompose, type MailProject } from '@arbidocs/react';
|
|
9
|
+
import type { NativeDocxAdapter } from '../../docx/NativeDocxEditor';
|
|
10
|
+
import type { MailWordEditor } from './types';
|
|
11
|
+
export interface WordBody {
|
|
12
|
+
adapter: NativeDocxAdapter;
|
|
13
|
+
/** The editor's document key: stable for this compose session. */
|
|
14
|
+
documentKey: string;
|
|
15
|
+
stateRef: React.MutableRefObject<(() => string | undefined) | null>;
|
|
16
|
+
/** Opened: saving and sending can go through the room. */
|
|
17
|
+
ready: boolean;
|
|
18
|
+
save(compose: MailCompose): Promise<{
|
|
19
|
+
id: string;
|
|
20
|
+
}>;
|
|
21
|
+
/** Send it (`request_id`: the send's idempotency key, as `/send` takes). */
|
|
22
|
+
send(compose: MailCompose & {
|
|
23
|
+
request_id: string;
|
|
24
|
+
}): Promise<{
|
|
25
|
+
id: string;
|
|
26
|
+
status: string;
|
|
27
|
+
}>;
|
|
28
|
+
/** The body as text and HTML (`final`: refused while suggestions wait). */
|
|
29
|
+
body(final: boolean): Promise<{
|
|
30
|
+
text: string;
|
|
31
|
+
html: string;
|
|
32
|
+
}>;
|
|
33
|
+
/** The project ARBI's work on this email is billed to (known once the room opens). */
|
|
34
|
+
project?: MailProject | null;
|
|
35
|
+
/** Bill another project the person may bill (null: their own). */
|
|
36
|
+
chooseProject(projectExtId: string | null): Promise<void>;
|
|
37
|
+
}
|
|
38
|
+
export declare function useWordBody({ word, client, initial, sessionKey, roomId: givenRoomId, onBodyChange, }: {
|
|
39
|
+
word: MailWordEditor;
|
|
40
|
+
client: MailClient;
|
|
41
|
+
initial: MailCompose;
|
|
42
|
+
/** This compose session (stable across remounts); absent: one per mount. */
|
|
43
|
+
sessionKey?: string;
|
|
44
|
+
/** An existing room to open as the body (a new message whose body ARBI wrote). */
|
|
45
|
+
roomId?: string;
|
|
46
|
+
/** The person changed the body (it is not in Drafts until saved). */
|
|
47
|
+
onBodyChange: () => void;
|
|
48
|
+
}): WordBody;
|
|
@@ -79,6 +79,14 @@ export interface NativeDocxEditorProps {
|
|
|
79
79
|
busy: boolean;
|
|
80
80
|
error?: string | null;
|
|
81
81
|
};
|
|
82
|
+
/**
|
|
83
|
+
* Embedded as a body field (an email draft): a small formatting toolbar instead of the ribbon, no
|
|
84
|
+
* page furniture or save bar (the host saves), and the person types directly; others' edits (ARBI's)
|
|
85
|
+
* still arrive as tracked changes to accept or reject.
|
|
86
|
+
*/
|
|
87
|
+
compact?: boolean;
|
|
88
|
+
/** Receives a reader of the live room's state, so the host's save can include the latest keystrokes. */
|
|
89
|
+
stateRef?: React.MutableRefObject<(() => string | undefined) | null>;
|
|
82
90
|
}
|
|
83
91
|
export declare function DocxParticipants({ session }: {
|
|
84
92
|
session?: DocxCollaborationSession;
|
|
@@ -90,4 +98,4 @@ export declare function DocxRibbon({ onSave, badge, imageGeneration, }: {
|
|
|
90
98
|
/** A short state label at the end of the row, such as "Co-edit mode". */
|
|
91
99
|
badge?: React.ReactNode;
|
|
92
100
|
}): React.JSX.Element;
|
|
93
|
-
export declare function NativeDocxEditor({ documentId, title, draftContent, initialCommentId, snapshot, onSaved, stream, adapter, }: NativeDocxEditorProps): React.JSX.Element;
|
|
101
|
+
export declare function NativeDocxEditor({ documentId, title, draftContent, initialCommentId, snapshot, onSaved, stream, adapter, compact, stateRef, }: NativeDocxEditorProps): React.JSX.Element;
|
package/dist/docx/index.cjs
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
|
-
var
|
|
5
|
-
var
|
|
4
|
+
var chunkTTXK62YI_cjs = require('../chunk-TTXK62YI.cjs');
|
|
5
|
+
var chunkS24XEVPS_cjs = require('../chunk-S24XEVPS.cjs');
|
|
6
|
+
var chunkQT6EGMAJ_cjs = require('../chunk-QT6EGMAJ.cjs');
|
|
6
7
|
require('../chunk-5FYU7ZIU.cjs');
|
|
7
8
|
require('../chunk-2A4MDHJR.cjs');
|
|
8
9
|
require('../chunk-RC25WMVB.cjs');
|
|
@@ -61,7 +62,7 @@ function NativeDocxComparison({
|
|
|
61
62
|
if (!documentId)
|
|
62
63
|
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "native-docx-error", role: "status", children: "Comparing Word documents\u2026" });
|
|
63
64
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
64
|
-
|
|
65
|
+
chunkQT6EGMAJ_cjs.NativeDocxEditor,
|
|
65
66
|
{
|
|
66
67
|
adapter,
|
|
67
68
|
documentId,
|
|
@@ -73,179 +74,179 @@ function NativeDocxComparison({
|
|
|
73
74
|
|
|
74
75
|
Object.defineProperty(exports, "StreamedWordArtifact", {
|
|
75
76
|
enumerable: true,
|
|
76
|
-
get: function () { return
|
|
77
|
+
get: function () { return chunkTTXK62YI_cjs.StreamedWordArtifact; }
|
|
78
|
+
});
|
|
79
|
+
Object.defineProperty(exports, "loadDocxFonts", {
|
|
80
|
+
enumerable: true,
|
|
81
|
+
get: function () { return chunkS24XEVPS_cjs.loadDocxFonts; }
|
|
77
82
|
});
|
|
78
83
|
Object.defineProperty(exports, "BUILTIN_TEMPLATE_NAME", {
|
|
79
84
|
enumerable: true,
|
|
80
|
-
get: function () { return
|
|
85
|
+
get: function () { return chunkQT6EGMAJ_cjs.BUILTIN_TEMPLATE_NAME; }
|
|
81
86
|
});
|
|
82
87
|
Object.defineProperty(exports, "CrossReferenceDialog", {
|
|
83
88
|
enumerable: true,
|
|
84
|
-
get: function () { return
|
|
89
|
+
get: function () { return chunkQT6EGMAJ_cjs.CrossReferenceDialog; }
|
|
85
90
|
});
|
|
86
91
|
Object.defineProperty(exports, "CrossReferencesProvider", {
|
|
87
92
|
enumerable: true,
|
|
88
|
-
get: function () { return
|
|
93
|
+
get: function () { return chunkQT6EGMAJ_cjs.CrossReferencesProvider; }
|
|
89
94
|
});
|
|
90
95
|
Object.defineProperty(exports, "DEFAULT_CROSS_REFERENCES_LABELS", {
|
|
91
96
|
enumerable: true,
|
|
92
|
-
get: function () { return
|
|
97
|
+
get: function () { return chunkQT6EGMAJ_cjs.DEFAULT_CROSS_REFERENCES_LABELS; }
|
|
93
98
|
});
|
|
94
99
|
Object.defineProperty(exports, "DEFAULT_DEFINED_TERMS_LABELS", {
|
|
95
100
|
enumerable: true,
|
|
96
|
-
get: function () { return
|
|
101
|
+
get: function () { return chunkQT6EGMAJ_cjs.DEFAULT_DEFINED_TERMS_LABELS; }
|
|
97
102
|
});
|
|
98
103
|
Object.defineProperty(exports, "DEFINED_TERM_TRIGGER", {
|
|
99
104
|
enumerable: true,
|
|
100
|
-
get: function () { return
|
|
105
|
+
get: function () { return chunkQT6EGMAJ_cjs.DEFINED_TERM_TRIGGER; }
|
|
101
106
|
});
|
|
102
107
|
Object.defineProperty(exports, "DefinedTermsProvider", {
|
|
103
108
|
enumerable: true,
|
|
104
|
-
get: function () { return
|
|
109
|
+
get: function () { return chunkQT6EGMAJ_cjs.DefinedTermsProvider; }
|
|
105
110
|
});
|
|
106
111
|
Object.defineProperty(exports, "DocxAuthorContext", {
|
|
107
112
|
enumerable: true,
|
|
108
|
-
get: function () { return
|
|
113
|
+
get: function () { return chunkQT6EGMAJ_cjs.DocxAuthorContext; }
|
|
109
114
|
});
|
|
110
115
|
Object.defineProperty(exports, "DocxCommentActivity", {
|
|
111
116
|
enumerable: true,
|
|
112
|
-
get: function () { return
|
|
117
|
+
get: function () { return chunkQT6EGMAJ_cjs.DocxCommentActivity; }
|
|
113
118
|
});
|
|
114
119
|
Object.defineProperty(exports, "DocxEditorReview", {
|
|
115
120
|
enumerable: true,
|
|
116
|
-
get: function () { return
|
|
121
|
+
get: function () { return chunkQT6EGMAJ_cjs.DocxEditorReview; }
|
|
117
122
|
});
|
|
118
123
|
Object.defineProperty(exports, "DocxMentions", {
|
|
119
124
|
enumerable: true,
|
|
120
|
-
get: function () { return
|
|
125
|
+
get: function () { return chunkQT6EGMAJ_cjs.DocxMentions; }
|
|
121
126
|
});
|
|
122
127
|
Object.defineProperty(exports, "DocxParticipants", {
|
|
123
128
|
enumerable: true,
|
|
124
|
-
get: function () { return
|
|
129
|
+
get: function () { return chunkQT6EGMAJ_cjs.DocxParticipants; }
|
|
125
130
|
});
|
|
126
131
|
Object.defineProperty(exports, "DocxRibbon", {
|
|
127
132
|
enumerable: true,
|
|
128
|
-
get: function () { return
|
|
133
|
+
get: function () { return chunkQT6EGMAJ_cjs.DocxRibbon; }
|
|
129
134
|
});
|
|
130
135
|
Object.defineProperty(exports, "GenerateImageButton", {
|
|
131
136
|
enumerable: true,
|
|
132
|
-
get: function () { return
|
|
137
|
+
get: function () { return chunkQT6EGMAJ_cjs.GenerateImageButton; }
|
|
133
138
|
});
|
|
134
139
|
Object.defineProperty(exports, "HouseTemplateProvider", {
|
|
135
140
|
enumerable: true,
|
|
136
|
-
get: function () { return
|
|
141
|
+
get: function () { return chunkQT6EGMAJ_cjs.HouseTemplateProvider; }
|
|
137
142
|
});
|
|
138
143
|
Object.defineProperty(exports, "LinkHoverCard", {
|
|
139
144
|
enumerable: true,
|
|
140
|
-
get: function () { return
|
|
145
|
+
get: function () { return chunkQT6EGMAJ_cjs.LinkHoverCard; }
|
|
141
146
|
});
|
|
142
147
|
Object.defineProperty(exports, "NativeDocxEditor", {
|
|
143
148
|
enumerable: true,
|
|
144
|
-
get: function () { return
|
|
149
|
+
get: function () { return chunkQT6EGMAJ_cjs.NativeDocxEditor; }
|
|
145
150
|
});
|
|
146
151
|
Object.defineProperty(exports, "builtinHouseTemplate", {
|
|
147
152
|
enumerable: true,
|
|
148
|
-
get: function () { return
|
|
153
|
+
get: function () { return chunkQT6EGMAJ_cjs.builtinHouseTemplate; }
|
|
149
154
|
});
|
|
150
155
|
Object.defineProperty(exports, "contentPath", {
|
|
151
156
|
enumerable: true,
|
|
152
|
-
get: function () { return
|
|
157
|
+
get: function () { return chunkQT6EGMAJ_cjs.contentPath; }
|
|
153
158
|
});
|
|
154
159
|
Object.defineProperty(exports, "editorPort", {
|
|
155
160
|
enumerable: true,
|
|
156
|
-
get: function () { return
|
|
161
|
+
get: function () { return chunkQT6EGMAJ_cjs.editorPort; }
|
|
157
162
|
});
|
|
158
163
|
Object.defineProperty(exports, "findDefinitionsSection", {
|
|
159
164
|
enumerable: true,
|
|
160
|
-
get: function () { return
|
|
165
|
+
get: function () { return chunkQT6EGMAJ_cjs.findDefinitionsSection; }
|
|
161
166
|
});
|
|
162
167
|
Object.defineProperty(exports, "insertCrossReference", {
|
|
163
168
|
enumerable: true,
|
|
164
|
-
get: function () { return
|
|
169
|
+
get: function () { return chunkQT6EGMAJ_cjs.insertCrossReference; }
|
|
165
170
|
});
|
|
166
171
|
Object.defineProperty(exports, "insertDefinedTerm", {
|
|
167
172
|
enumerable: true,
|
|
168
|
-
get: function () { return
|
|
173
|
+
get: function () { return chunkQT6EGMAJ_cjs.insertDefinedTerm; }
|
|
169
174
|
});
|
|
170
175
|
Object.defineProperty(exports, "insertDocumentReference", {
|
|
171
176
|
enumerable: true,
|
|
172
|
-
get: function () { return
|
|
177
|
+
get: function () { return chunkQT6EGMAJ_cjs.insertDocumentReference; }
|
|
173
178
|
});
|
|
174
179
|
Object.defineProperty(exports, "listTargets", {
|
|
175
180
|
enumerable: true,
|
|
176
|
-
get: function () { return
|
|
177
|
-
});
|
|
178
|
-
Object.defineProperty(exports, "loadDocxFonts", {
|
|
179
|
-
enumerable: true,
|
|
180
|
-
get: function () { return chunkZWWN4CUL_cjs.loadDocxFonts; }
|
|
181
|
+
get: function () { return chunkQT6EGMAJ_cjs.listTargets; }
|
|
181
182
|
});
|
|
182
183
|
Object.defineProperty(exports, "normalizeDocxExport", {
|
|
183
184
|
enumerable: true,
|
|
184
|
-
get: function () { return
|
|
185
|
+
get: function () { return chunkQT6EGMAJ_cjs.normalizeDocxExport; }
|
|
185
186
|
});
|
|
186
187
|
Object.defineProperty(exports, "paragraphNumber", {
|
|
187
188
|
enumerable: true,
|
|
188
|
-
get: function () { return
|
|
189
|
+
get: function () { return chunkQT6EGMAJ_cjs.paragraphNumber; }
|
|
189
190
|
});
|
|
190
191
|
Object.defineProperty(exports, "referenceText", {
|
|
191
192
|
enumerable: true,
|
|
192
|
-
get: function () { return
|
|
193
|
+
get: function () { return chunkQT6EGMAJ_cjs.referenceText; }
|
|
193
194
|
});
|
|
194
195
|
Object.defineProperty(exports, "referencesPort", {
|
|
195
196
|
enumerable: true,
|
|
196
|
-
get: function () { return
|
|
197
|
+
get: function () { return chunkQT6EGMAJ_cjs.referencesPort; }
|
|
197
198
|
});
|
|
198
199
|
Object.defineProperty(exports, "resolveHouseTemplate", {
|
|
199
200
|
enumerable: true,
|
|
200
|
-
get: function () { return
|
|
201
|
+
get: function () { return chunkQT6EGMAJ_cjs.resolveHouseTemplate; }
|
|
201
202
|
});
|
|
202
203
|
Object.defineProperty(exports, "reviewModule", {
|
|
203
204
|
enumerable: true,
|
|
204
|
-
get: function () { return
|
|
205
|
+
get: function () { return chunkQT6EGMAJ_cjs.reviewModule; }
|
|
205
206
|
});
|
|
206
207
|
Object.defineProperty(exports, "shortTitle", {
|
|
207
208
|
enumerable: true,
|
|
208
|
-
get: function () { return
|
|
209
|
+
get: function () { return chunkQT6EGMAJ_cjs.shortTitle; }
|
|
209
210
|
});
|
|
210
211
|
Object.defineProperty(exports, "structuralPort", {
|
|
211
212
|
enumerable: true,
|
|
212
|
-
get: function () { return
|
|
213
|
+
get: function () { return chunkQT6EGMAJ_cjs.structuralPort; }
|
|
213
214
|
});
|
|
214
215
|
Object.defineProperty(exports, "templateFileName", {
|
|
215
216
|
enumerable: true,
|
|
216
|
-
get: function () { return
|
|
217
|
+
get: function () { return chunkQT6EGMAJ_cjs.templateFileName; }
|
|
217
218
|
});
|
|
218
219
|
Object.defineProperty(exports, "trackedOrNoted", {
|
|
219
220
|
enumerable: true,
|
|
220
|
-
get: function () { return
|
|
221
|
+
get: function () { return chunkQT6EGMAJ_cjs.trackedOrNoted; }
|
|
221
222
|
});
|
|
222
223
|
Object.defineProperty(exports, "useCrossReferences", {
|
|
223
224
|
enumerable: true,
|
|
224
|
-
get: function () { return
|
|
225
|
+
get: function () { return chunkQT6EGMAJ_cjs.useCrossReferences; }
|
|
225
226
|
});
|
|
226
227
|
Object.defineProperty(exports, "useDefinedTerms", {
|
|
227
228
|
enumerable: true,
|
|
228
|
-
get: function () { return
|
|
229
|
+
get: function () { return chunkQT6EGMAJ_cjs.useDefinedTerms; }
|
|
229
230
|
});
|
|
230
231
|
Object.defineProperty(exports, "useHouseTemplate", {
|
|
231
232
|
enumerable: true,
|
|
232
|
-
get: function () { return
|
|
233
|
+
get: function () { return chunkQT6EGMAJ_cjs.useHouseTemplate; }
|
|
233
234
|
});
|
|
234
235
|
Object.defineProperty(exports, "useReview", {
|
|
235
236
|
enumerable: true,
|
|
236
|
-
get: function () { return
|
|
237
|
+
get: function () { return chunkQT6EGMAJ_cjs.useReview; }
|
|
237
238
|
});
|
|
238
239
|
Object.defineProperty(exports, "useReviewItem", {
|
|
239
240
|
enumerable: true,
|
|
240
|
-
get: function () { return
|
|
241
|
+
get: function () { return chunkQT6EGMAJ_cjs.useReviewItem; }
|
|
241
242
|
});
|
|
242
243
|
Object.defineProperty(exports, "useTrackedOrNoted", {
|
|
243
244
|
enumerable: true,
|
|
244
|
-
get: function () { return
|
|
245
|
+
get: function () { return chunkQT6EGMAJ_cjs.useTrackedOrNoted; }
|
|
245
246
|
});
|
|
246
247
|
Object.defineProperty(exports, "withDirectEditing", {
|
|
247
248
|
enumerable: true,
|
|
248
|
-
get: function () { return
|
|
249
|
+
get: function () { return chunkQT6EGMAJ_cjs.withDirectEditing; }
|
|
249
250
|
});
|
|
250
251
|
Object.defineProperty(exports, "DocxEditor", {
|
|
251
252
|
enumerable: true,
|
package/dist/docx/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/docx/NativeDocxComparison.tsx"],"names":["parseVersionRef","useRef","useState","useEffect","error","jsxs","jsx","NativeDocxEditor"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../src/docx/NativeDocxComparison.tsx"],"names":["parseVersionRef","useRef","useState","useEffect","error","jsxs","jsx","NativeDocxEditor"],"mappings":";;;;;;;;;;;;;;;;;AAaA,SAAS,YAAA,CAAa,QAAgB,SAAA,EAAoC;AACxE,EAAA,MAAM,IAAA,GAAOA,0BAAgB,MAAM,CAAA;AACnC,EAAA,MAAM,OAAA,GAAUA,0BAAgB,SAAS,CAAA;AACzC,EAAA,MAAM,KAAA,GAAQ,IAAI,eAAA,CAAgB,EAAE,WAAA,EAAa,KAAK,KAAA,EAAO,cAAA,EAAgB,OAAA,CAAQ,KAAA,EAAO,CAAA;AAC5F,EAAA,IAAI,IAAA,CAAK,SAAS,KAAA,CAAM,GAAA,CAAI,gBAAgB,MAAA,CAAO,IAAA,CAAK,OAAO,CAAC,CAAA;AAChE,EAAA,IAAI,OAAA,CAA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port { parseVersionRef } from '@arbidocs/react/artifacts'\nimport { NativeDocxEditor, type NativeDocxAdapter } from './NativeDocxEditor'\n\nexport interface NativeDocxComparisonProps {\n adapter: NativeDocxAdapter\n baseId: string\n revisedId: string\n title: string\n onCompared?: (documentId: string) => void | Promise<void>\n}\n\n/** A `doc-…@v{n}` side names an older version: the endpoint takes its document and version apart. */\nfunction redlineQuery(baseId: string, revisedId: string): URLSearchParams {\n const base = parseVersionRef(baseId)\n const revised = parseVersionRef(revisedId)\n const query = new URLSearchParams({ base_ext_id: base.docId, revised_ext_id: revised.docId })\n if (base.version) query.set('base_version', String(base.version))\n if (revised.version) query.set('revised_version', String(revised.version))\n return query\n}\n\n/** Word comparison through the host's authenticated transport and LibreOffice service. */\nexport function NativeDocxComparison({\n adapter,\n baseId,\n revisedId,\n title,\n onCompared,\n}: NativeDocxComparisonProps) {\n const host = useRef({ adapter, onCompared })\n host.current = { adapter, onCompared }\n const [documentId, setDocumentId] = useState('')\n const [error, setError] = useState('')\n const [attempt, setAttempt] = useState(0)\n useEffect(() => {\n let cancelled = false\n setDocumentId('')\n setError('')\n void host.current.adapter\n .request(`/redline?${redlineQuery(baseId, revisedId)}`, { method: 'POST' })\n .then((response) => response.json())\n .then((result: { document_ext_id: string }) => {\n if (!result.document_ext_id) throw new Error('Comparison did not return a Word document.')\n if (!cancelled) {\n setDocumentId(result.document_ext_id)\n void Promise.resolve(host.current.onCompared?.(result.document_ext_id)).catch(() => {})\n }\n })\n .catch((error) => {\n if (!cancelled) setError(error instanceof Error ? error.message : String(error))\n })\n return () => {\n cancelled = true\n }\n }, [baseId, revisedId, attempt])\n if (error)\n return (\n <div className=\"native-docx-error\" role=\"alert\">\n <p>{error}</p>\n <button onClick={() => setAttempt((value) => value + 1)}>Retry comparison</button>\n </div>\n )\n if (!documentId)\n return (\n <div className=\"native-docx-error\" role=\"status\">\n Comparing Word documents…\n </div>\n )\n return (\n <NativeDocxEditor\n key={documentId}\n adapter={adapter}\n documentId={documentId}\n title={`${title.replace(/\\.[^.]+$/, '')} (redline).docx`}\n />\n )\n}\n"]}
|
package/dist/docx/index.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
export { StreamedWordArtifact } from '../chunk-
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
export { StreamedWordArtifact } from '../chunk-JQVPGMLU.js';
|
|
3
|
+
export { loadDocxFonts } from '../chunk-GYAUJ4KT.js';
|
|
4
|
+
import { NativeDocxEditor } from '../chunk-A2MN2ZLX.js';
|
|
5
|
+
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, listTargets, normalizeDocxExport, paragraphNumber, referenceText, referencesPort, resolveHouseTemplate, reviewModule, shortTitle, structuralPort, templateFileName, trackedOrNoted, useCrossReferences, useDefinedTerms, useHouseTemplate, useReview, useReviewItem, useTrackedOrNoted, withDirectEditing } from '../chunk-A2MN2ZLX.js';
|
|
5
6
|
import '../chunk-HFZ45FD3.js';
|
|
6
7
|
import '../chunk-EPHGD4YV.js';
|
|
7
8
|
import '../chunk-AF6RDAJF.js';
|
package/dist/docx/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/docx/NativeDocxComparison.tsx"],"names":["error"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../src/docx/NativeDocxComparison.tsx"],"names":["error"],"mappings":";;;;;;;;;;;;;;;;AAaA,SAAS,YAAA,CAAa,QAAgB,SAAA,EAAoC;AACxE,EAAA,MAAM,IAAA,GAAO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oB,IAAA,EAAK,UAAS,QAAA,EAAA,gCAAA,EAEjD,CAAA;AAEJ,EAAA,uBACE,GAAA;AAAA,IAAC,gBAAA;AAAA,IAAA;AAAA,MAEC,OAAA;AAAA,MACA,UAAA;AAAA,MACA,OAAO,CAAA,EAAG,KAAA,CAAM,OAAA,CAAQ,UAAA,EAAY,EAAE,CAAC,CAAA,eAAA;AAAA,KAAA;AAAA,IAHlC;AAAA,GAIP;AAEJ","file":"index.js","sourcesContent":["import { useEffect, useRef, useState } from 'react'\nimport { parseVersionRef } from '@arbidocs/react/artifacts'\nimport { NativeDocxEditor, type NativeDocxAdapter } from './NativeDocxEditor'\n\nexport interface NativeDocxComparisonProps {\n adapter: NativeDocxAdapter\n baseId: string\n revisedId: string\n title: string\n onCompared?: (documentId: string) => void | Promise<void>\n}\n\n/** A `doc-…@v{n}` side names an older version: the endpoint takes its document and version apart. */\nfunction redlineQuery(baseId: string, revisedId: string): URLSearchParams {\n const base = parseVersionRef(baseId)\n const revised = parseVersionRef(revisedId)\n const query = new URLSearchParams({ base_ext_id: base.docId, revised_ext_id: revised.docId })\n if (base.version) query.set('base_version', String(base.version))\n if (revised.version) query.set('revised_version', String(revised.version))\n return query\n}\n\n/** Word comparison through the host's authenticated transport and LibreOffice service. */\nexport function NativeDocxComparison({\n adapter,\n baseId,\n revisedId,\n title,\n onCompared,\n}: NativeDocxComparisonProps) {\n const host = useRef({ adapter, onCompared })\n host.current = { adapter, onCompared }\n const [documentId, setDocumentId] = useState('')\n const [error, setError] = useState('')\n const [attempt, setAttempt] = useState(0)\n useEffect(() => {\n let cancelled = false\n setDocumentId('')\n setError('')\n void host.current.adapter\n .request(`/redline?${redlineQuery(baseId, revisedId)}`, { method: 'POST' })\n .then((response) => response.json())\n .then((result: { document_ext_id: string }) => {\n if (!result.document_ext_id) throw new Error('Comparison did not return a Word document.')\n if (!cancelled) {\n setDocumentId(result.document_ext_id)\n void Promise.resolve(host.current.onCompared?.(result.document_ext_id)).catch(() => {})\n }\n })\n .catch((error) => {\n if (!cancelled) setError(error instanceof Error ? error.message : String(error))\n })\n return () => {\n cancelled = true\n }\n }, [baseId, revisedId, attempt])\n if (error)\n return (\n <div className=\"native-docx-error\" role=\"alert\">\n <p>{error}</p>\n <button onClick={() => setAttempt((value) => value + 1)}>Retry comparison</button>\n </div>\n )\n if (!documentId)\n return (\n <div className=\"native-docx-error\" role=\"status\">\n Comparing Word documents…\n </div>\n )\n return (\n <NativeDocxEditor\n key={documentId}\n adapter={adapter}\n documentId={documentId}\n title={`${title.replace(/\\.[^.]+$/, '')} (redline).docx`}\n />\n )\n}\n"]}
|
|
@@ -25,6 +25,11 @@ export interface HouseTemplateHost {
|
|
|
25
25
|
* (a workspace owner) and the server stores house templates.
|
|
26
26
|
*/
|
|
27
27
|
setFromDocument?: (documentId: string) => Promise<void>;
|
|
28
|
+
/**
|
|
29
|
+
* Whether a document may be the house template (a shared Word document, of this workspace or a
|
|
30
|
+
* public one). When it is not, the Design tab does not offer to make it one. Absent: any may.
|
|
31
|
+
*/
|
|
32
|
+
isEligible?: (documentId: string) => boolean;
|
|
28
33
|
}
|
|
29
34
|
export declare const BUILTIN_TEMPLATE_NAME = "ARBI legal template";
|
|
30
35
|
/** The file name a document records as its attached template (`w:attachedTemplate`). */
|
package/dist/index.cjs
CHANGED
|
@@ -45,7 +45,7 @@ var chunkC54XEN5T_cjs = require('./chunk-C54XEN5T.cjs');
|
|
|
45
45
|
var chunkKDG6FER6_cjs = require('./chunk-KDG6FER6.cjs');
|
|
46
46
|
var chunkC2HRZSAT_cjs = require('./chunk-C2HRZSAT.cjs');
|
|
47
47
|
require('./chunk-7G2LJMUG.cjs');
|
|
48
|
-
var
|
|
48
|
+
var chunkDTBSGG36_cjs = require('./chunk-DTBSGG36.cjs');
|
|
49
49
|
var chunkVLCY46K6_cjs = require('./chunk-VLCY46K6.cjs');
|
|
50
50
|
require('./chunk-ULWRNGGE.cjs');
|
|
51
51
|
require('./chunk-IXALYQT7.cjs');
|
|
@@ -3764,59 +3764,59 @@ Object.defineProperty(exports, "vCardFilename", {
|
|
|
3764
3764
|
});
|
|
3765
3765
|
Object.defineProperty(exports, "MailDeliveryBadge", {
|
|
3766
3766
|
enumerable: true,
|
|
3767
|
-
get: function () { return
|
|
3767
|
+
get: function () { return chunkDTBSGG36_cjs.MailDeliveryBadge; }
|
|
3768
3768
|
});
|
|
3769
3769
|
Object.defineProperty(exports, "MailDeliveryList", {
|
|
3770
3770
|
enumerable: true,
|
|
3771
|
-
get: function () { return
|
|
3771
|
+
get: function () { return chunkDTBSGG36_cjs.MailDeliveryList; }
|
|
3772
3772
|
});
|
|
3773
3773
|
Object.defineProperty(exports, "MailDocumentPicker", {
|
|
3774
3774
|
enumerable: true,
|
|
3775
|
-
get: function () { return
|
|
3775
|
+
get: function () { return chunkDTBSGG36_cjs.MailDocumentPicker; }
|
|
3776
3776
|
});
|
|
3777
3777
|
Object.defineProperty(exports, "MailGrid", {
|
|
3778
3778
|
enumerable: true,
|
|
3779
|
-
get: function () { return
|
|
3779
|
+
get: function () { return chunkDTBSGG36_cjs.MailGrid; }
|
|
3780
3780
|
});
|
|
3781
3781
|
Object.defineProperty(exports, "MailMessagePreview", {
|
|
3782
3782
|
enumerable: true,
|
|
3783
|
-
get: function () { return
|
|
3783
|
+
get: function () { return chunkDTBSGG36_cjs.MailMessagePreview; }
|
|
3784
3784
|
});
|
|
3785
3785
|
Object.defineProperty(exports, "MailMessageView", {
|
|
3786
3786
|
enumerable: true,
|
|
3787
|
-
get: function () { return
|
|
3787
|
+
get: function () { return chunkDTBSGG36_cjs.MailMessageView; }
|
|
3788
3788
|
});
|
|
3789
3789
|
Object.defineProperty(exports, "NEEDS_CONNECTION", {
|
|
3790
3790
|
enumerable: true,
|
|
3791
|
-
get: function () { return
|
|
3791
|
+
get: function () { return chunkDTBSGG36_cjs.NEEDS_CONNECTION; }
|
|
3792
3792
|
});
|
|
3793
3793
|
Object.defineProperty(exports, "PlainMailBodyEditor", {
|
|
3794
3794
|
enumerable: true,
|
|
3795
|
-
get: function () { return
|
|
3795
|
+
get: function () { return chunkDTBSGG36_cjs.PlainMailBodyEditor; }
|
|
3796
3796
|
});
|
|
3797
3797
|
Object.defineProperty(exports, "draftMailCompose", {
|
|
3798
3798
|
enumerable: true,
|
|
3799
|
-
get: function () { return
|
|
3799
|
+
get: function () { return chunkDTBSGG36_cjs.draftMailCompose; }
|
|
3800
3800
|
});
|
|
3801
3801
|
Object.defineProperty(exports, "emptyMailCompose", {
|
|
3802
3802
|
enumerable: true,
|
|
3803
|
-
get: function () { return
|
|
3803
|
+
get: function () { return chunkDTBSGG36_cjs.emptyMailCompose; }
|
|
3804
3804
|
});
|
|
3805
3805
|
Object.defineProperty(exports, "hasCalendarPart", {
|
|
3806
3806
|
enumerable: true,
|
|
3807
|
-
get: function () { return
|
|
3807
|
+
get: function () { return chunkDTBSGG36_cjs.hasCalendarPart; }
|
|
3808
3808
|
});
|
|
3809
3809
|
Object.defineProperty(exports, "mailAddressLabel", {
|
|
3810
3810
|
enumerable: true,
|
|
3811
|
-
get: function () { return
|
|
3811
|
+
get: function () { return chunkDTBSGG36_cjs.mailAddressLabel; }
|
|
3812
3812
|
});
|
|
3813
3813
|
Object.defineProperty(exports, "parseMailRecipients", {
|
|
3814
3814
|
enumerable: true,
|
|
3815
|
-
get: function () { return
|
|
3815
|
+
get: function () { return chunkDTBSGG36_cjs.parseMailRecipients; }
|
|
3816
3816
|
});
|
|
3817
3817
|
Object.defineProperty(exports, "replyMailCompose", {
|
|
3818
3818
|
enumerable: true,
|
|
3819
|
-
get: function () { return
|
|
3819
|
+
get: function () { return chunkDTBSGG36_cjs.replyMailCompose; }
|
|
3820
3820
|
});
|
|
3821
3821
|
Object.defineProperty(exports, "DEFAULT_SHARE_CONTROL_LABELS", {
|
|
3822
3822
|
enumerable: true,
|