@arbidocs/blocks 0.4.96 → 0.4.98

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.
Files changed (78) hide show
  1. package/dist/agents/index.cjs +280 -280
  2. package/dist/agents/index.js +4 -4
  3. package/dist/{chunk-3WW32OUU.cjs → chunk-3US5OIDQ.cjs} +3 -3
  4. package/dist/{chunk-3WW32OUU.cjs.map → chunk-3US5OIDQ.cjs.map} +1 -1
  5. package/dist/{chunk-SJVUKXS6.js → chunk-5NQIBJPP.js} +5 -5
  6. package/dist/{chunk-SJVUKXS6.js.map → chunk-5NQIBJPP.js.map} +1 -1
  7. package/dist/{chunk-Y52CEKVD.js → chunk-6B2AWE3I.js} +3 -3
  8. package/dist/{chunk-Y52CEKVD.js.map → chunk-6B2AWE3I.js.map} +1 -1
  9. package/dist/chunk-D54JXTPG.cjs +164 -0
  10. package/dist/chunk-D54JXTPG.cjs.map +1 -0
  11. package/dist/{chunk-MROSCSPW.cjs → chunk-DDYXFALG.cjs} +43 -43
  12. package/dist/{chunk-MROSCSPW.cjs.map → chunk-DDYXFALG.cjs.map} +1 -1
  13. package/dist/{chunk-K27SDLLN.js → chunk-FIEAWH4K.js} +644 -116
  14. package/dist/chunk-FIEAWH4K.js.map +1 -0
  15. package/dist/{chunk-PSN4VWI7.cjs → chunk-LENXDIMY.cjs} +5 -5
  16. package/dist/{chunk-PSN4VWI7.cjs.map → chunk-LENXDIMY.cjs.map} +1 -1
  17. package/dist/{chunk-H4SVY5FH.js → chunk-LZ5AFAWC.js} +3 -3
  18. package/dist/{chunk-H4SVY5FH.js.map → chunk-LZ5AFAWC.js.map} +1 -1
  19. package/dist/{chunk-7RI3G5BO.cjs → chunk-MIMVRMKC.cjs} +647 -112
  20. package/dist/chunk-MIMVRMKC.cjs.map +1 -0
  21. package/dist/{chunk-SC33PQTQ.cjs → chunk-MUYZP5FB.cjs} +5 -5
  22. package/dist/{chunk-SC33PQTQ.cjs.map → chunk-MUYZP5FB.cjs.map} +1 -1
  23. package/dist/{chunk-SF4BDUZS.js → chunk-PGDL26TQ.js} +3 -3
  24. package/dist/{chunk-SF4BDUZS.js.map → chunk-PGDL26TQ.js.map} +1 -1
  25. package/dist/{chunk-CK6TU76J.cjs → chunk-VJO66VVF.cjs} +5 -5
  26. package/dist/{chunk-CK6TU76J.cjs.map → chunk-VJO66VVF.cjs.map} +1 -1
  27. package/dist/{chunk-JID3CZSY.js → chunk-Z3G65XHZ.js} +3 -3
  28. package/dist/{chunk-JID3CZSY.js.map → chunk-Z3G65XHZ.js.map} +1 -1
  29. package/dist/chunk-ZCOVDK2E.js +153 -0
  30. package/dist/chunk-ZCOVDK2E.js.map +1 -0
  31. package/dist/components/DetailPanel.d.ts +106 -0
  32. package/dist/connect/docx.cjs +6 -6
  33. package/dist/connect/docx.js +4 -4
  34. package/dist/connect/index.cjs +25 -25
  35. package/dist/connect/index.js +5 -5
  36. package/dist/databases/DatabaseRowDetail.d.ts +32 -0
  37. package/dist/databases/DatabaseTable.d.ts +3 -1
  38. package/dist/databases/DatabaseToolbar.d.ts +9 -1
  39. package/dist/databases/PickCellEditor.d.ts +8 -1
  40. package/dist/databases/SelectCellEditor.d.ts +6 -1
  41. package/dist/databases/column-types.d.ts +5 -0
  42. package/dist/databases/databaseColumns.d.ts +7 -0
  43. package/dist/databases/index.cjs +381 -11
  44. package/dist/databases/index.cjs.map +1 -1
  45. package/dist/databases/index.d.ts +7 -5
  46. package/dist/databases/index.js +379 -14
  47. package/dist/databases/index.js.map +1 -1
  48. package/dist/databases/linkCells.d.ts +4 -2
  49. package/dist/docx/NativeDocxEditor.d.ts +7 -0
  50. package/dist/docx/RibbonMenu.d.ts +17 -0
  51. package/dist/docx/StyleGallery.d.ts +9 -0
  52. package/dist/docx/WordReferences.d.ts +21 -0
  53. package/dist/docx/index.cjs +52 -24
  54. package/dist/docx/index.d.ts +2 -0
  55. package/dist/docx/index.js +3 -3
  56. package/dist/docx/template/HouseTemplate.d.ts +64 -0
  57. package/dist/docx/template/HouseTemplatePanel.d.ts +6 -0
  58. package/dist/docx/template/QuickParts.d.ts +7 -0
  59. package/dist/docx/wordStyles.d.ts +24 -0
  60. package/dist/files/index.cjs +308 -0
  61. package/dist/files/index.cjs.map +1 -1
  62. package/dist/files/index.js +298 -2
  63. package/dist/files/index.js.map +1 -1
  64. package/dist/files/views/gridViews.d.ts +80 -0
  65. package/dist/files/views/index.d.ts +2 -0
  66. package/dist/files/views/useGridViews.d.ts +38 -0
  67. package/dist/index.cjs +428 -428
  68. package/dist/index.cjs.map +1 -1
  69. package/dist/index.d.ts +1 -0
  70. package/dist/index.js +87 -126
  71. package/dist/index.js.map +1 -1
  72. package/dist/tags/TagDetail.d.ts +1 -0
  73. package/dist/workflow-canvas/index.cjs +47 -47
  74. package/dist/workflow-canvas/index.js +4 -4
  75. package/package.json +4 -4
  76. package/src/docx/styles.css +193 -0
  77. package/dist/chunk-7RI3G5BO.cjs.map +0 -1
  78. package/dist/chunk-K27SDLLN.js.map +0 -1
@@ -34,15 +34,17 @@ export declare function PersonCell({ value, titles }: {
34
34
  value: unknown;
35
35
  titles?: Record<string, string>;
36
36
  }): import("react").JSX.Element | null;
37
- export declare function LinkChipsCell({ value, titles, kind, onOpenDocument, }: {
37
+ export declare function LinkChipsCell({ value, titles, kind, onOpenDocument, wrap, }: {
38
38
  value: unknown;
39
39
  titles?: Record<string, string>;
40
40
  kind: 'document' | 'relation';
41
41
  onOpenDocument?: (id: string) => void;
42
+ wrap?: boolean;
42
43
  }): import("react").JSX.Element | null;
43
44
  /** A lookup's values: related rows and documents as chips, anything else as quiet tags. */
44
- export declare function LookupCell({ value, titles, locale, }: {
45
+ export declare function LookupCell({ value, titles, locale, wrap, }: {
45
46
  value: unknown;
46
47
  titles?: Record<string, string>;
47
48
  locale?: string;
49
+ wrap?: boolean;
48
50
  }): import("react").JSX.Element | null;
@@ -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 HouseTemplateHost } from './template/HouseTemplate';
6
7
  /**
7
8
  * The editor path of a document's DOCX bytes. A version reference (`doc-…@v2`, a read-only
8
9
  * snapshot of an older version) reads that version; a plain id the current one.
@@ -44,6 +45,12 @@ export interface NativeDocxAdapter {
44
45
  * Defined term and Update definitions, and typing `@@` in the body opens the term type-ahead.
45
46
  */
46
47
  definitions?: () => Promise<DefinitionSource[]>;
48
+ /**
49
+ * The workspace's house template. Present: a blank note starts from it (its styles, numbering,
50
+ * page setup, headers and footers), Insert offers its Quick Parts, and the Design tab and the
51
+ * style box show where the document's styles differ from it.
52
+ */
53
+ houseTemplate?: HouseTemplateHost;
47
54
  }
48
55
  export interface NativeDocxEditorProps {
49
56
  adapter: NativeDocxAdapter;
@@ -0,0 +1,17 @@
1
+ import React from 'react';
2
+ /**
3
+ * A ribbon button that opens a panel under the ribbon (Font, More formatting, the style gallery).
4
+ * Pressing the trigger never takes the caret out of the document; the panel closes on Escape or a
5
+ * press outside it. `children` may be a function that receives `close`, for panels that close
6
+ * themselves once the user has picked something.
7
+ */
8
+ export declare function RibbonMenu({ label, icon, children, className, testId, title, }: {
9
+ label: string;
10
+ /** Tooltip; defaults to `label`. */
11
+ title?: string;
12
+ /** Trigger content: an icon, or a short text label with a `className` that widens it. */
13
+ icon: React.ReactNode;
14
+ children: React.ReactNode | ((close: () => void) => React.ReactNode);
15
+ className?: string;
16
+ testId?: string;
17
+ }): React.JSX.Element;
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Word's Styles group for the native editor's Home tab: a box showing the current paragraph's
3
+ * style that opens a gallery of the document's own paragraph styles (from its `styles.xml`, so a
4
+ * firm template's styles appear beside the built-ins), each drawn in its own face, with Normal,
5
+ * Title and Headings 1-3 as quick picks. Applying a style writes `w:pStyle`.
6
+ */
7
+ import React from 'react';
8
+ /** The Home tab's style box: the current paragraph style, opening the gallery. */
9
+ export declare function StyleGallery(): React.JSX.Element;
@@ -0,0 +1,21 @@
1
+ /**
2
+ * Footnotes and endnotes for the native editor's References tab, and Word's keyboard shortcuts
3
+ * for notes and paragraph styles.
4
+ *
5
+ * The engine owns notes end to end: Insert footnote writes a `w:footnoteReference` at the caret
6
+ * and its note in `footnotes.xml` (creating the part on a document that has none), moves the caret
7
+ * into the note so the user types it straight away, numbers notes in document order, and lays
8
+ * them out at the foot of the page, where an existing note is edited in place. What it leaves out
9
+ * is Word's note paragraph style, so a new note is given the document's "footnote text" (or
10
+ * "endnote text") style when it defines one.
11
+ */
12
+ import React, { type RefObject } from 'react';
13
+ /** References tab: Insert footnote, Insert endnote. */
14
+ export declare function NoteButtons(): React.JSX.Element;
15
+ /**
16
+ * Binds Word's note and style shortcuts to key presses inside `scope` (the editor's page area),
17
+ * ahead of the editor's own handling. Renders nothing; mount it inside `DocxEditor.Root`.
18
+ */
19
+ export declare function WordShortcuts({ scope }: {
20
+ scope: RefObject<HTMLElement | null>;
21
+ }): null;
@@ -1,8 +1,8 @@
1
1
  "use client";
2
2
  'use strict';
3
3
 
4
- var chunkSC33PQTQ_cjs = require('../chunk-SC33PQTQ.cjs');
5
- var chunk7RI3G5BO_cjs = require('../chunk-7RI3G5BO.cjs');
4
+ var chunkMUYZP5FB_cjs = require('../chunk-MUYZP5FB.cjs');
5
+ var chunkMIMVRMKC_cjs = require('../chunk-MIMVRMKC.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
- chunk7RI3G5BO_cjs.NativeDocxEditor,
63
+ chunkMIMVRMKC_cjs.NativeDocxEditor,
64
64
  {
65
65
  adapter,
66
66
  documentId,
@@ -72,87 +72,115 @@ function NativeDocxComparison({
72
72
 
73
73
  Object.defineProperty(exports, "StreamedWordArtifact", {
74
74
  enumerable: true,
75
- get: function () { return chunkSC33PQTQ_cjs.StreamedWordArtifact; }
75
+ get: function () { return chunkMUYZP5FB_cjs.StreamedWordArtifact; }
76
+ });
77
+ Object.defineProperty(exports, "BUILTIN_TEMPLATE_NAME", {
78
+ enumerable: true,
79
+ get: function () { return chunkMIMVRMKC_cjs.BUILTIN_TEMPLATE_NAME; }
76
80
  });
77
81
  Object.defineProperty(exports, "DEFAULT_DEFINED_TERMS_LABELS", {
78
82
  enumerable: true,
79
- get: function () { return chunk7RI3G5BO_cjs.DEFAULT_DEFINED_TERMS_LABELS; }
83
+ get: function () { return chunkMIMVRMKC_cjs.DEFAULT_DEFINED_TERMS_LABELS; }
80
84
  });
81
85
  Object.defineProperty(exports, "DEFINED_TERM_TRIGGER", {
82
86
  enumerable: true,
83
- get: function () { return chunk7RI3G5BO_cjs.DEFINED_TERM_TRIGGER; }
87
+ get: function () { return chunkMIMVRMKC_cjs.DEFINED_TERM_TRIGGER; }
84
88
  });
85
89
  Object.defineProperty(exports, "DefinedTermsProvider", {
86
90
  enumerable: true,
87
- get: function () { return chunk7RI3G5BO_cjs.DefinedTermsProvider; }
91
+ get: function () { return chunkMIMVRMKC_cjs.DefinedTermsProvider; }
88
92
  });
89
93
  Object.defineProperty(exports, "DocxCommentActivity", {
90
94
  enumerable: true,
91
- get: function () { return chunk7RI3G5BO_cjs.DocxCommentActivity; }
95
+ get: function () { return chunkMIMVRMKC_cjs.DocxCommentActivity; }
92
96
  });
93
97
  Object.defineProperty(exports, "DocxEditorReview", {
94
98
  enumerable: true,
95
- get: function () { return chunk7RI3G5BO_cjs.DocxEditorReview; }
99
+ get: function () { return chunkMIMVRMKC_cjs.DocxEditorReview; }
96
100
  });
97
101
  Object.defineProperty(exports, "DocxMentions", {
98
102
  enumerable: true,
99
- get: function () { return chunk7RI3G5BO_cjs.DocxMentions; }
103
+ get: function () { return chunkMIMVRMKC_cjs.DocxMentions; }
100
104
  });
101
105
  Object.defineProperty(exports, "DocxParticipants", {
102
106
  enumerable: true,
103
- get: function () { return chunk7RI3G5BO_cjs.DocxParticipants; }
107
+ get: function () { return chunkMIMVRMKC_cjs.DocxParticipants; }
104
108
  });
105
109
  Object.defineProperty(exports, "DocxRibbon", {
106
110
  enumerable: true,
107
- get: function () { return chunk7RI3G5BO_cjs.DocxRibbon; }
111
+ get: function () { return chunkMIMVRMKC_cjs.DocxRibbon; }
112
+ });
113
+ Object.defineProperty(exports, "HouseTemplateProvider", {
114
+ enumerable: true,
115
+ get: function () { return chunkMIMVRMKC_cjs.HouseTemplateProvider; }
108
116
  });
109
117
  Object.defineProperty(exports, "NativeDocxEditor", {
110
118
  enumerable: true,
111
- get: function () { return chunk7RI3G5BO_cjs.NativeDocxEditor; }
119
+ get: function () { return chunkMIMVRMKC_cjs.NativeDocxEditor; }
120
+ });
121
+ Object.defineProperty(exports, "builtinHouseTemplate", {
122
+ enumerable: true,
123
+ get: function () { return chunkMIMVRMKC_cjs.builtinHouseTemplate; }
124
+ });
125
+ Object.defineProperty(exports, "contentPath", {
126
+ enumerable: true,
127
+ get: function () { return chunkMIMVRMKC_cjs.contentPath; }
112
128
  });
113
129
  Object.defineProperty(exports, "editorPort", {
114
130
  enumerable: true,
115
- get: function () { return chunk7RI3G5BO_cjs.editorPort; }
131
+ get: function () { return chunkMIMVRMKC_cjs.editorPort; }
116
132
  });
117
133
  Object.defineProperty(exports, "findDefinitionsSection", {
118
134
  enumerable: true,
119
- get: function () { return chunk7RI3G5BO_cjs.findDefinitionsSection; }
135
+ get: function () { return chunkMIMVRMKC_cjs.findDefinitionsSection; }
120
136
  });
121
137
  Object.defineProperty(exports, "insertDefinedTerm", {
122
138
  enumerable: true,
123
- get: function () { return chunk7RI3G5BO_cjs.insertDefinedTerm; }
139
+ get: function () { return chunkMIMVRMKC_cjs.insertDefinedTerm; }
124
140
  });
125
141
  Object.defineProperty(exports, "loadDocxFonts", {
126
142
  enumerable: true,
127
- get: function () { return chunk7RI3G5BO_cjs.loadDocxFonts; }
143
+ get: function () { return chunkMIMVRMKC_cjs.loadDocxFonts; }
128
144
  });
129
145
  Object.defineProperty(exports, "normalizeDocxExport", {
130
146
  enumerable: true,
131
- get: function () { return chunk7RI3G5BO_cjs.normalizeDocxExport; }
147
+ get: function () { return chunkMIMVRMKC_cjs.normalizeDocxExport; }
148
+ });
149
+ Object.defineProperty(exports, "resolveHouseTemplate", {
150
+ enumerable: true,
151
+ get: function () { return chunkMIMVRMKC_cjs.resolveHouseTemplate; }
132
152
  });
133
153
  Object.defineProperty(exports, "reviewModule", {
134
154
  enumerable: true,
135
- get: function () { return chunk7RI3G5BO_cjs.reviewModule; }
155
+ get: function () { return chunkMIMVRMKC_cjs.reviewModule; }
156
+ });
157
+ Object.defineProperty(exports, "templateFileName", {
158
+ enumerable: true,
159
+ get: function () { return chunkMIMVRMKC_cjs.templateFileName; }
136
160
  });
137
161
  Object.defineProperty(exports, "updateDefinitions", {
138
162
  enumerable: true,
139
- get: function () { return chunk7RI3G5BO_cjs.updateDefinitions; }
163
+ get: function () { return chunkMIMVRMKC_cjs.updateDefinitions; }
140
164
  });
141
165
  Object.defineProperty(exports, "useDefinedTerms", {
142
166
  enumerable: true,
143
- get: function () { return chunk7RI3G5BO_cjs.useDefinedTerms; }
167
+ get: function () { return chunkMIMVRMKC_cjs.useDefinedTerms; }
168
+ });
169
+ Object.defineProperty(exports, "useHouseTemplate", {
170
+ enumerable: true,
171
+ get: function () { return chunkMIMVRMKC_cjs.useHouseTemplate; }
144
172
  });
145
173
  Object.defineProperty(exports, "useReview", {
146
174
  enumerable: true,
147
- get: function () { return chunk7RI3G5BO_cjs.useReview; }
175
+ get: function () { return chunkMIMVRMKC_cjs.useReview; }
148
176
  });
149
177
  Object.defineProperty(exports, "useReviewItem", {
150
178
  enumerable: true,
151
- get: function () { return chunk7RI3G5BO_cjs.useReviewItem; }
179
+ get: function () { return chunkMIMVRMKC_cjs.useReviewItem; }
152
180
  });
153
181
  Object.defineProperty(exports, "withDirectEditing", {
154
182
  enumerable: true,
155
- get: function () { return chunk7RI3G5BO_cjs.withDirectEditing; }
183
+ get: function () { return chunkMIMVRMKC_cjs.withDirectEditing; }
156
184
  });
157
185
  Object.defineProperty(exports, "DocxEditor", {
158
186
  enumerable: true,
@@ -12,3 +12,5 @@ export { NativeDocxComparison, type NativeDocxComparisonProps } from './NativeDo
12
12
  export { DefinedTermsProvider, useDefinedTerms, DEFINED_TERM_TRIGGER, DEFAULT_DEFINED_TERMS_LABELS, type DefinedTermsProviderProps, type DefinedTermsLabels, } from './definitions/DefinedTerms';
13
13
  export { insertDefinedTerm, updateDefinitions, findDefinitionsSection, type UpdateDefinitionsResult, } from './definitions/commands';
14
14
  export { editorPort, withDirectEditing, type DefinitionsPort } from './definitions/port';
15
+ export { contentPath } from './NativeDocxEditor';
16
+ export { HouseTemplateProvider, useHouseTemplate, builtinHouseTemplate, resolveHouseTemplate, templateFileName, BUILTIN_TEMPLATE_NAME, type HouseTemplate, type HouseTemplateHost, type HouseTemplateSource, } from './template/HouseTemplate';
@@ -1,7 +1,7 @@
1
1
  "use client";
2
- export { StreamedWordArtifact } from '../chunk-Y52CEKVD.js';
3
- import { NativeDocxEditor } from '../chunk-K27SDLLN.js';
4
- export { DEFAULT_DEFINED_TERMS_LABELS, DEFINED_TERM_TRIGGER, DefinedTermsProvider, DocxCommentActivity, DocxEditorReview, DocxMentions, DocxParticipants, DocxRibbon, NativeDocxEditor, editorPort, findDefinitionsSection, insertDefinedTerm, loadDocxFonts, normalizeDocxExport, reviewModule, updateDefinitions, useDefinedTerms, useReview, useReviewItem, withDirectEditing } from '../chunk-K27SDLLN.js';
2
+ export { StreamedWordArtifact } from '../chunk-6B2AWE3I.js';
3
+ import { NativeDocxEditor } from '../chunk-FIEAWH4K.js';
4
+ export { BUILTIN_TEMPLATE_NAME, DEFAULT_DEFINED_TERMS_LABELS, DEFINED_TERM_TRIGGER, DefinedTermsProvider, DocxCommentActivity, DocxEditorReview, DocxMentions, DocxParticipants, DocxRibbon, HouseTemplateProvider, NativeDocxEditor, builtinHouseTemplate, contentPath, editorPort, findDefinitionsSection, insertDefinedTerm, loadDocxFonts, normalizeDocxExport, resolveHouseTemplate, reviewModule, templateFileName, updateDefinitions, useDefinedTerms, useHouseTemplate, useReview, useReviewItem, withDirectEditing } from '../chunk-FIEAWH4K.js';
5
5
  import '../chunk-D3QPYKZG.js';
6
6
  import '../chunk-AF6RDAJF.js';
7
7
  import '../chunk-AA3PT6KR.js';
@@ -0,0 +1,64 @@
1
+ /**
2
+ * The house template inside the Word editor: which template applies (the workspace's, else the
3
+ * deployment's, else ARBI's built-in legal template), its Quick Parts, and where this document's
4
+ * styles have drifted from it. Mount `HouseTemplateProvider` inside `DocxEditor.Root`; the ribbon's
5
+ * Quick Parts, Design tab and the style box read it from context.
6
+ */
7
+ import React from 'react';
8
+ import { type LinkedLevel, type BuildingBlockInfo, type StyleDivergence } from '@arbidocs/coedit/template';
9
+ export type HouseTemplateSource = 'workspace' | 'deployment' | 'builtin';
10
+ export interface HouseTemplate {
11
+ /** The .dotx/.docx bytes. */
12
+ bytes: Uint8Array;
13
+ /** What to call it: its filename, or "ARBI legal template". */
14
+ name: string;
15
+ source: HouseTemplateSource;
16
+ /** The workspace document it is, when it is one. */
17
+ documentId?: string;
18
+ }
19
+ /** How the host stores and resolves house templates. */
20
+ export interface HouseTemplateHost {
21
+ /** The template that applies in this workspace. Falls back to the built-in one when it fails. */
22
+ load: () => Promise<HouseTemplate>;
23
+ /**
24
+ * Make a workspace document the workspace's house template. Present only when the user may
25
+ * (a workspace owner) and the server stores house templates.
26
+ */
27
+ setFromDocument?: (documentId: string) => Promise<void>;
28
+ }
29
+ export declare const BUILTIN_TEMPLATE_NAME = "ARBI legal template";
30
+ /** The file name a document records as its attached template (`w:attachedTemplate`). */
31
+ export declare const templateFileName: (t: Pick<HouseTemplate, "name">) => string;
32
+ /** ARBI's built-in UK legal template, with its Quick Parts. */
33
+ export declare function builtinHouseTemplate(): HouseTemplate;
34
+ /** The template a host resolves, or the built-in one when there is no host or it fails. */
35
+ export declare function resolveHouseTemplate(host?: HouseTemplateHost): Promise<HouseTemplate>;
36
+ interface HouseTemplateContextValue {
37
+ template: HouseTemplate;
38
+ blocks: readonly BuildingBlockInfo[];
39
+ /** Null until measured (or for a document that cannot be read). */
40
+ divergence: StyleDivergence | null;
41
+ /** The document was started from this template (it records it as attached). */
42
+ basedOnTemplate: boolean;
43
+ /** Outline levels linked to styles in this document (Level 1 → Level 2 …), by style id. */
44
+ levels: Readonly<Record<string, LinkedLevel>>;
45
+ /** Insert a Quick Part at the caret, with the styles, numbering and pictures it uses. */
46
+ insertBlock: (name: string) => boolean;
47
+ /** Measure the divergence again (after something brought styles in). */
48
+ refresh: () => void;
49
+ /** Present when this document may become the workspace's house template. */
50
+ setAsHouseTemplate?: () => Promise<void>;
51
+ editable: boolean;
52
+ }
53
+ export declare const useHouseTemplate: () => HouseTemplateContextValue | null;
54
+ export declare function HouseTemplateProvider({ host, documentId, editable, notify, enabled, children, }: {
55
+ /** False for a generating draft: no template chrome, no measuring. */
56
+ enabled?: boolean;
57
+ host?: HouseTemplateHost;
58
+ /** The stored document this editor shows; absent for an unsaved note. */
59
+ documentId?: string;
60
+ editable: boolean;
61
+ notify?: (message: string, kind: 'success' | 'error') => void;
62
+ children: React.ReactNode;
63
+ }): React.JSX.Element;
64
+ export {};
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Design › House template: which template new documents start from, whether this document's
3
+ * styles still match it, and — for a workspace owner — making this document the house template.
4
+ */
5
+ import React from 'react';
6
+ export declare function HouseTemplatePanel(): React.JSX.Element | null;
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Insert › Quick Parts: the house template's building blocks (execution blocks, document markings,
3
+ * document skeletons) by category, each with a preview of its text; picking one inserts it at the
4
+ * caret with the styles, numbering and pictures it uses.
5
+ */
6
+ import React from 'react';
7
+ export declare function QuickParts(): React.JSX.Element | null;
@@ -0,0 +1,24 @@
1
+ /**
2
+ * Word's paragraph-style vocabulary for the native editor's chrome: finding a built-in style in
3
+ * the document's own list, showing its name the way Word does, and Word's keyboard shortcuts for
4
+ * styles and notes.
5
+ */
6
+ import type { ParagraphStyleOption } from '@docx-editor.dev/react';
7
+ import type { StyleDivergence } from '@arbidocs/coedit/template';
8
+ /** Word's quick picks, by the built-in style names `styles.xml` gives them. */
9
+ export declare const QUICK_STYLES: readonly ["Normal", "Title", "heading 1", "heading 2", "heading 3"];
10
+ /**
11
+ * The style `name` names, matched the way Word matches built-in names (case-insensitively), with
12
+ * the conventional id (`Heading1` for "heading 1") as a fallback for documents that name their
13
+ * styles differently but keep Word's ids.
14
+ */
15
+ export declare function findStyle(options: readonly ParagraphStyleOption[], name: string): ParagraphStyleOption | undefined;
16
+ /** A style's name as Word shows it: built-in names are stored lower-case ("heading 1"). */
17
+ export declare function styleLabel(name: string): string;
18
+ /**
19
+ * Word's shortcut for a keydown, or null. Ctrl+Alt (Cmd+Option on a Mac) with F, D or 1-3, and
20
+ * Ctrl+Shift+N; read from `code` so a keyboard layout cannot move them.
21
+ */
22
+ export declare function wordShortcut(event: Pick<KeyboardEvent, 'ctrlKey' | 'metaKey' | 'altKey' | 'shiftKey' | 'code'>): 'footnote' | 'endnote' | 'heading 1' | 'heading 2' | 'heading 3' | 'Normal' | null;
23
+ /** A summary of how the document differs, for a tooltip; null when it matches. */
24
+ export declare function divergenceSummary(divergence: StyleDivergence | null): string | null;