@stll/folio-core 0.2.0 → 0.3.1

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.
@@ -6,6 +6,12 @@ type Messages = {
6
6
  "alignCenter": "Center";
7
7
  "alignLeft": "Align Left";
8
8
  "alignRight": "Align Right";
9
+ "alignment": {
10
+ "alignLeftShortcut": "Ctrl+L";
11
+ "alignRightShortcut": "Ctrl+R";
12
+ "centerShortcut": "Ctrl+E";
13
+ "justifyShortcut": "Ctrl+J";
14
+ };
9
15
  "alignmentGroup": "Alignment";
10
16
  "bold": "Bold";
11
17
  "boldShortcut": "Bold (Ctrl+B)";
@@ -14,6 +20,26 @@ type Messages = {
14
20
  "checkingDocxEditTitle": "Checking document";
15
21
  "clearDate": "Clear date";
16
22
  "clipboardReadFailed": "Couldn't read the clipboard. Check clipboard permissions and try again.";
23
+ "colorPicker": {
24
+ "ariaLabel": "{type} picker";
25
+ "automatic": "Automatic";
26
+ "colors": {
27
+ "blue": "Blue";
28
+ "darkBlue": "Dark Blue";
29
+ "darkRed": "Dark Red";
30
+ "green": "Green";
31
+ "lightBlue": "Light Blue";
32
+ "lightGreen": "Light Green";
33
+ "orange": "Orange";
34
+ "purple": "Purple";
35
+ "red": "Red";
36
+ "yellow": "Yellow";
37
+ };
38
+ "customColor": "Custom Color";
39
+ "noColor": "No color";
40
+ "standardColors": "Standard Colors";
41
+ "themeColors": "Theme Colors";
42
+ };
17
43
  "comment": "Comment";
18
44
  "comments": {
19
45
  "addPlaceholder": "Add a comment...";
@@ -27,17 +53,220 @@ type Messages = {
27
53
  "unknownAuthor": "Unknown";
28
54
  "visibility": "Comments";
29
55
  };
56
+ "common": {
57
+ "apply": "Apply";
58
+ "cancel": "Cancel";
59
+ "closeDialog": "Close";
60
+ "insert": "Insert";
61
+ "px": "px";
62
+ "update": "Update";
63
+ };
30
64
  "contentControlDateAriaLabel": "Pick a date";
31
65
  "contentControlDropdownAriaLabel": "Dropdown options";
32
66
  "contentControlDropdownNoOptions": "No options";
67
+ "contextMenu": {
68
+ "copy": "Copy";
69
+ "copyShortcut": "Ctrl+C";
70
+ "cut": "Cut";
71
+ "cutShortcut": "Ctrl+X";
72
+ "delete": "Delete";
73
+ "deleteShortcut": "Del";
74
+ "paste": "Paste";
75
+ "pastePlainTextShortcut": "Ctrl+Shift+V";
76
+ "pasteShortcut": "Ctrl+V";
77
+ "selectAllShortcut": "Ctrl+A";
78
+ };
33
79
  "copy": "Copy";
34
80
  "copyLink": "Copy link";
35
81
  "cut": "Cut";
82
+ "decreaseFontSize": "Decrease font size";
36
83
  "decreaseIndent": "Decrease Indent";
37
84
  "delete": "Delete";
38
85
  "deleteColumn": "Delete column";
39
86
  "deleteRow": "Delete row";
40
87
  "deleted": "Deleted";
88
+ "dialogs": {
89
+ "findReplace": {
90
+ "matchesFound": "{total} matches found";
91
+ "replaceButton": "Replace";
92
+ "toggleReplace": "Toggle replace";
93
+ };
94
+ "footnoteProperties": {
95
+ "endnotePositions": {
96
+ "endOfDocument": "End of document";
97
+ "endOfSection": "End of section";
98
+ };
99
+ "endnotes": "Endnotes";
100
+ "footnotePositions": {
101
+ "belowText": "Below text";
102
+ "bottomOfPage": "Bottom of page";
103
+ };
104
+ "footnotes": "Footnotes";
105
+ "formats": {
106
+ "decimal": "1, 2, 3, ...";
107
+ "lowerAlpha": "a, b, c, ...";
108
+ "lowerRoman": "i, ii, iii, ...";
109
+ "symbols": "*, †, ‡, ...";
110
+ "upperAlpha": "A, B, C, ...";
111
+ "upperRoman": "I, II, III, ...";
112
+ };
113
+ "numberFormat": "Number format";
114
+ "numbering": "Numbering";
115
+ "numberingOptions": {
116
+ "continuous": "Continuous";
117
+ "restartPage": "Restart each page";
118
+ "restartSection": "Restart each section";
119
+ };
120
+ "position": "Position";
121
+ "startAt": "Start at";
122
+ "title": "Footnote & Endnote Properties";
123
+ };
124
+ "hyperlink": {
125
+ "bookmarkLabel": "Bookmark";
126
+ "bookmarkPlaceholder": "Select a bookmark";
127
+ "displayTextHint": "Defaults to the selected text";
128
+ "displayTextLabel": "Display text";
129
+ "displayTextPlaceholder": "Text to display";
130
+ "invalidUrl": "Enter a valid URL";
131
+ "removeLink": "Remove link";
132
+ "tabBookmark": "Bookmark";
133
+ "tabWebAddress": "Web address";
134
+ "titleEdit": "Edit hyperlink";
135
+ "titleInsert": "Insert hyperlink";
136
+ "tooltipLabel": "Tooltip";
137
+ "tooltipPlaceholder": "Optional tooltip text";
138
+ "urlHint": "Include a full web address, or a mailto: / tel: link";
139
+ "urlLabel": "URL";
140
+ "urlPlaceholder": "https://example.com";
141
+ "urlRequired": "Enter a URL";
142
+ };
143
+ "imagePosition": {
144
+ "align": "Align";
145
+ "alignOptions": {
146
+ "bottom": "Bottom";
147
+ "center": "Center";
148
+ "left": "Left";
149
+ "right": "Right";
150
+ "top": "Top";
151
+ };
152
+ "alignment": "Alignment";
153
+ "horizontal": "Horizontal";
154
+ "offset": "Offset";
155
+ "offsetPx": "Offset (px)";
156
+ "relativeOptions": {
157
+ "character": "Character";
158
+ "column": "Column";
159
+ "line": "Line";
160
+ "margin": "Margin";
161
+ "page": "Page";
162
+ "paragraph": "Paragraph";
163
+ };
164
+ "relativeTo": "Relative to";
165
+ "title": "Image Position";
166
+ "vertical": "Vertical";
167
+ };
168
+ "imageProperties": {
169
+ "altText": "Alt Text";
170
+ "altTextPlaceholder": "Describe this image for accessibility...";
171
+ "border": "Border";
172
+ "borderStyles": {
173
+ "dashed": "Dashed";
174
+ "dotted": "Dotted";
175
+ "double": "Double";
176
+ "solid": "Solid";
177
+ };
178
+ "color": "Color";
179
+ "dimensions": "Dimensions";
180
+ "heightLabel": "Height";
181
+ "lockAspectRatio": "Lock aspect ratio";
182
+ "style": "Style";
183
+ "textWrapping": "Text wrapping";
184
+ "title": "Image Properties";
185
+ "width": "Width";
186
+ "widthLabel": "Width";
187
+ "wrapOptions": {
188
+ "behind": "Behind text";
189
+ "inFront": "In front of text";
190
+ "inline": "In line with text";
191
+ "topAndBottom": "Top and bottom";
192
+ "wrapLeft": "Wrap left";
193
+ "wrapRight": "Wrap right";
194
+ };
195
+ };
196
+ "insertSymbol": {
197
+ "categories": {
198
+ "arrows": "Arrows";
199
+ "common": "Common";
200
+ "currency": "Currency";
201
+ "greek": "Greek";
202
+ "math": "Math";
203
+ "shapes": "Shapes";
204
+ };
205
+ "noResults": "No symbols found for \"{query}\"";
206
+ "noResultsEmpty": "No symbols in this category";
207
+ "recent": "Recent";
208
+ "searchPlaceholder": "Search symbols...";
209
+ "title": "Insert symbol";
210
+ };
211
+ "insertTable": {
212
+ "autofit": "Autofit";
213
+ "columnWidthLabel": "Column width";
214
+ "columnsLabel": "Columns";
215
+ "fixedWidth": "Fixed width";
216
+ "hoverToSelect": "Hover to select table size";
217
+ "insertButton": "Insert";
218
+ "orSpecifySize": "Or specify size";
219
+ "rowsLabel": "Rows";
220
+ "sizeSelector": "Table size selector";
221
+ "style": "Style";
222
+ "tableSize": "{cols} × {rows} table";
223
+ "title": "Insert table";
224
+ "validationHint": "Rows: {minRows}–{maxRows}, columns: {minCols}–{maxCols}";
225
+ };
226
+ "pageSetup": {
227
+ "bottom": "Bottom";
228
+ "custom": "Custom";
229
+ "landscape": "Landscape";
230
+ "left": "Left";
231
+ "margins": "Margins";
232
+ "orientation": "Orientation";
233
+ "pageSize": "Page Size";
234
+ "pageSizes": {
235
+ "a3": "A3";
236
+ "a4": "A4";
237
+ "a5": "A5";
238
+ "b5": "B5";
239
+ "executive": "Executive";
240
+ "legal": "Legal";
241
+ "letter": "Letter";
242
+ };
243
+ "portrait": "Portrait";
244
+ "right": "Right";
245
+ "sizeLabel": "Size";
246
+ "title": "Page Setup";
247
+ "top": "Top";
248
+ };
249
+ "tableProperties": {
250
+ "alignOptions": {
251
+ "center": "Center";
252
+ "left": "Left";
253
+ "right": "Right";
254
+ };
255
+ "alignmentLabel": "Alignment";
256
+ "title": "Table Properties";
257
+ "units": {
258
+ "fiftiethsPercent": "(50ths of %)";
259
+ "twips": "tw";
260
+ };
261
+ "widthLabel": "Width";
262
+ "widthType": "Width type";
263
+ "widthTypes": {
264
+ "auto": "Auto";
265
+ "fixed": "Fixed (twips)";
266
+ "percentage": "Percentage";
267
+ };
268
+ };
269
+ };
41
270
  "discardChanges": "Discard";
42
271
  "dismiss": "Dismiss";
43
272
  "displayText": "Display text";
@@ -52,6 +281,15 @@ type Messages = {
52
281
  "editPermissionDenied": "You do not have permission to edit this document.";
53
282
  "editSaveFailedTitle": "Could not save DOCX";
54
283
  "editSessionTakenOver": "Another tab, window, or device opened this document for editing, so this session was released. Unsaved local changes are preserved — reopen the doc to continue.";
284
+ "editor": {
285
+ "editing": "Editing";
286
+ "editingDescription": "Edit the document directly";
287
+ "showDocumentOutline": "Document outline";
288
+ "suggesting": "Suggesting";
289
+ "suggestingDescription": "Edits become tracked suggestions";
290
+ "viewing": "Viewing";
291
+ "viewingDescription": "Read or print the final document";
292
+ };
55
293
  "findReplace": {
56
294
  "close": "Close search";
57
295
  "find": "Find";
@@ -72,14 +310,74 @@ type Messages = {
72
310
  "wholeWords": "Whole words";
73
311
  };
74
312
  "finishEditing": "Finish editing";
313
+ "font": {
314
+ "documentFonts": "Document Fonts";
315
+ "monospace": "Monospace";
316
+ "other": "Other";
317
+ "sansSerif": "Sans Serif";
318
+ "selectAriaLabel": "Select font";
319
+ "serif": "Serif";
320
+ };
75
321
  "fontColor": "Font color";
76
322
  "fontGroup": "Font";
77
323
  "fontSize": "Font size";
78
324
  "formatPainter": "Format Painter";
79
325
  "formatPainterShortcut": "Format Painter (Ctrl+Shift+C)";
326
+ "formattingBar": {
327
+ "clearFormatting": "Clear formatting";
328
+ "commentsAndChanges": "Comments & Changes";
329
+ "highlightColor": "Highlight color";
330
+ "imageProperties": "Image Properties";
331
+ "imagePropertiesShortcut": "Image Properties";
332
+ "insertLink": "Insert link";
333
+ "insertLinkShortcut": "Insert link (Ctrl+K)";
334
+ "strikethrough": "Strikethrough";
335
+ "subscript": "Subscript";
336
+ "subscriptShortcut": "Subscript (Ctrl+=)";
337
+ "superscript": "Superscript";
338
+ "superscriptShortcut": "Superscript (Ctrl+Shift+=)";
339
+ };
80
340
  "formattingToolbar": "Formatting toolbar";
81
341
  "hideDetails": "Hide details";
82
342
  "historyGroup": "History";
343
+ "imageOverlay": {
344
+ "deleteImage": "Delete image";
345
+ "replaceImage": "Replace image";
346
+ "rotate": "Rotate";
347
+ };
348
+ "imageTransform": {
349
+ "flipHorizontal": "Flip horizontal";
350
+ "flipVertical": "Flip vertical";
351
+ "rotateClockwise": "Rotate clockwise";
352
+ "rotateCounterClockwise": "Rotate counterclockwise";
353
+ "tooltip": "Rotate or flip";
354
+ };
355
+ "imageWrap": {
356
+ "behindText": "Behind text";
357
+ "floatLeft": "Wrap left";
358
+ "floatRight": "Wrap right";
359
+ "inFrontOfText": "In front of text";
360
+ "inline": "In line with text";
361
+ "menu": {
362
+ "ariaLabel": "Image wrap options";
363
+ "behindText": "Behind text";
364
+ "imageProperties": "Image Properties";
365
+ "inFrontOfText": "In front of text";
366
+ "inLineWithText": "In line with text";
367
+ "squareLeft": "Square (left)";
368
+ "squareRight": "Square (right)";
369
+ };
370
+ "menuDesc": {
371
+ "behindText": "Place the image behind the text so it does not affect text position.";
372
+ "inFrontOfText": "Place the image in front of the text, overlapping it.";
373
+ "inLineWithText": "Move the image with the surrounding text, like a text character.";
374
+ "squareLeft": "Text wraps around the image on the right; the image sits on the left.";
375
+ "squareRight": "Text wraps around the image on the left; the image sits on the right.";
376
+ };
377
+ "tooltipPrefix": "Wrap text: {label}";
378
+ "topAndBottom": "Top and bottom";
379
+ };
380
+ "increaseFontSize": "Increase font size";
83
381
  "increaseIndent": "Increase Indent";
84
382
  "insertColumnLeft": "Insert column left";
85
383
  "insertColumnRight": "Insert column right";
@@ -94,6 +392,11 @@ type Messages = {
94
392
  "italic": "Italic";
95
393
  "italicShortcut": "Italic (Ctrl+I)";
96
394
  "justify": "Justify";
395
+ "lineSpacing": {
396
+ "double": "Double";
397
+ "label": "Line spacing";
398
+ "single": "Single";
399
+ };
97
400
  "listFormatting": "List formatting";
98
401
  "listsGroup": "Lists";
99
402
  "loadingDocument": "Loading document...";
@@ -119,6 +422,21 @@ type Messages = {
119
422
  "rejectChange": "Reject Change";
120
423
  "removeLink": "Remove link";
121
424
  "renderErrorDescription": "Something went wrong showing this part of the document. Reload the page — if it keeps happening, let us know.";
425
+ "revisions": {
426
+ "cellDeleted": "Cell deleted";
427
+ "cellInserted": "Cell inserted";
428
+ "cellMerged": "Cells merged";
429
+ "cellPropertiesChanged": "Cell formatting changed";
430
+ "paragraphMarkDeleted": "Paragraph mark deleted";
431
+ "paragraphMarkInserted": "Paragraph mark inserted";
432
+ "paragraphPropertiesChanged": "Paragraph formatting changed";
433
+ "rowDeleted": "Row deleted";
434
+ "rowInserted": "Row inserted";
435
+ "rowPropertiesChanged": "Row formatting changed";
436
+ "tableDeleted": "Table deleted";
437
+ "tableInserted": "Table inserted";
438
+ "tablePropertiesChanged": "Table formatting changed";
439
+ };
122
440
  "ruler": {
123
441
  "bottomMargin": "Bottom margin";
124
442
  "firstLineIndent": "First line indent";
@@ -139,14 +457,107 @@ type Messages = {
139
457
  "selectAll": "Select all";
140
458
  "showDetails": "Show details";
141
459
  "somethingWentWrong": "Something went wrong";
460
+ "styles": {
461
+ "heading1": "Heading 1";
462
+ "heading2": "Heading 2";
463
+ "heading3": "Heading 3";
464
+ "normalText": "Normal";
465
+ "selectAriaLabel": "Select paragraph style";
466
+ "subtitle": "Subtitle";
467
+ "title": "Title";
468
+ };
142
469
  "synced": "Synced";
143
470
  "syncing": "Syncing";
471
+ "table": {
472
+ "borderColor": "Border color";
473
+ "cellFillColor": "Cell fill color";
474
+ "deleteTable": "Delete table";
475
+ "mergeCells": "Merge cells";
476
+ "selectTable": "Select table";
477
+ "splitCell": "Split cell";
478
+ "styles": {
479
+ "gridTable1Light": "Grid Table 1 Light";
480
+ "gridTable4Accent1": "Grid Table 4 Accent 1";
481
+ "gridTable4Accent5": "Grid Table 4 Accent 5";
482
+ "gridTable4Accent6": "Grid Table 4 Accent 6";
483
+ "gridTable5Dark": "Grid Table 5 Dark";
484
+ "gridTableLight": "Grid Table Light";
485
+ "listTable3Accent2": "List Table 3 Accent 2";
486
+ "listTable4Accent3": "List Table 4 Accent 3";
487
+ "normalTable": "Normal Table";
488
+ "plainTable1": "Plain Table 1";
489
+ "plainTable2": "Plain Table 2";
490
+ "plainTable3": "Plain Table 3";
491
+ "plainTable4": "Plain Table 4";
492
+ "tableGrid": "Table Grid";
493
+ };
494
+ };
495
+ "tableAdvanced": {
496
+ "alignTableCenter": "Center table";
497
+ "alignTableLeft": "Align table left";
498
+ "alignTableRight": "Align table right";
499
+ "autoFit": "Autofit";
500
+ "bottom": "Bottom";
501
+ "cellMargins": "Cell margins";
502
+ "distributeColumns": "Distribute columns";
503
+ "height": "Height";
504
+ "heightRules": {
505
+ "atLeast": "At least";
506
+ "auto": "Auto";
507
+ "exact": "Exactly";
508
+ };
509
+ "middle": "Middle";
510
+ "rowHeight": "Row height";
511
+ "rule": "Rule";
512
+ "tableAlignment": "Table alignment";
513
+ "tableOptions": "Table options";
514
+ "tableOptionsMenu": "Table options menu";
515
+ "tableProperties": "Table properties";
516
+ "textDirections": {
517
+ "horizontal": "Horizontal";
518
+ "verticalLR": "Vertical (bottom to top)";
519
+ "verticalRL": "Vertical (top to bottom)";
520
+ };
521
+ "toggleHeaderRow": "Toggle header row";
522
+ "toggleNoWrap": "Toggle no wrap";
523
+ "top": "Top";
524
+ "verticalAlignment": "Vertical alignment";
525
+ };
144
526
  "tableBordersAll": "All borders";
145
527
  "tableBordersNone": "No borders";
146
528
  "textDirection": "Text direction";
147
529
  "textEditingMenu": "Text editing menu";
148
530
  "textFormattingGroup": "Text formatting";
149
531
  "toggleTrackChanges": "Toggle Track Changes";
532
+ "toolbar": {
533
+ "break": "Break";
534
+ "file": "File";
535
+ "findReplace": "Find and replace";
536
+ "findReplaceShortcut": "Ctrl+F";
537
+ "format": "Format";
538
+ "help": "Help";
539
+ "image": "Image";
540
+ "insert": "Insert";
541
+ "leftToRight": "Left to Right";
542
+ "open": "Open";
543
+ "openShortcut": "Ctrl+O";
544
+ "pageBreak": "Page Break";
545
+ "pageSetup": "Page Setup";
546
+ "reportIssue": "Report Issue";
547
+ "rightToLeft": "Right to Left";
548
+ "save": "Save";
549
+ "saveShortcut": "Ctrl+S";
550
+ "sectionBreakContinuous": "Section Break (Continuous)";
551
+ "sectionBreakNextPage": "Section Break (Next Page)";
552
+ "table": "Table";
553
+ "tableOfContents": "Table of Contents";
554
+ "watermark": "Watermark";
555
+ };
556
+ "trackedChanges": {
557
+ "replaced": "Replaced";
558
+ "unknown": "Unknown";
559
+ "with": "with";
560
+ };
150
561
  "trackingOff": "Tracking: Off";
151
562
  "trackingOn": "Tracking: On";
152
563
  "tryAgain": "Try Again";
@@ -159,6 +570,14 @@ type Messages = {
159
570
  "unsupportedDocxEditDescription": "This DOCX contains structures Folio cannot safely rewrite. To avoid corrupting the file, download it and edit it in Word.";
160
571
  "unsupportedDocxEditTitle": "Editing blocked";
161
572
  "viewGroup": "View";
573
+ "viewer": {
574
+ "pageIndicator": "Page {current} of {total}";
575
+ };
576
+ "zoom": {
577
+ "zoomIn": "Zoom in";
578
+ "zoomLevel": "Zoom level";
579
+ "zoomOut": "Zoom out";
580
+ };
162
581
  "zoomGroup": "Zoom";
163
582
  };
164
583
  };
package/dist/index.d.ts CHANGED
@@ -8,21 +8,22 @@ import { AIBarStatus, AIChatMode, AICitation, AICitationSource, AIGenerateInput,
8
8
  import { ApplyResult, applySuggestions } from "./ai-suggestions/apply.js";
9
9
  import { ResolvedAnchor, isSuggestionStale, resolveSuggestionAnchor } from "./ai-suggestions/conflict.js";
10
10
  import { PositionalText, buildPositionalText } from "./ai-suggestions/text-positions.js";
11
- import { TemplatePreviewSpan, TemplatePreviewValue, TemplatePreviewValues, setTemplatePreviewValues } from "./prosemirror/plugins/templatePreviewValues.js";
12
- import { DocxCompatibility } from "./docx/compatibility.js";
13
- import { createDocx } from "./docx/rezip.js";
14
- import { EmbeddedFont, EmbeddedFontParts, extractEmbeddedFonts, getEmbeddedFontFaces } from "./fonts/embeddedFonts.js";
15
11
  import { CreateEmptyDocumentOptions, createEmptyDocument } from "./utils/createDocument.js";
12
+ import { createDocx } from "./docx/rezip.js";
13
+ import { DocxCompatibility } from "./docx/compatibility.js";
16
14
  import { setAISuggestionsMeta, setFocusedSuggestionMeta } from "./prosemirror/plugins/aiSuggestionDecorations.js";
17
15
  import { scrollFolioPositionIntoView } from "./paged-layout/scrollToPmPosition.js";
18
16
  import { getFolioCaretViewportRect, getFolioSelectionViewportRect } from "./paged-layout/selectionViewportRect.js";
19
17
  import { AICitationRange, createAICitationDecorationsPlugin, setAICitationsMeta, setActiveCitationMeta } from "./prosemirror/plugins/aiCitationDecorations.js";
20
18
  import { AnonymizationMatch, AnonymizationTerm, anonymizationDecorationsKey, getAnonymizationMatches, setAnonymizationTermsMeta } from "./prosemirror/plugins/anonymizationDecorations.js";
21
19
  import { DirectiveKind, DirectiveRange, getTemplateDirectives, scanDirectives } from "./prosemirror/plugins/templateDirectives.js";
20
+ import { TemplatePreviewSpan, TemplatePreviewValue, TemplatePreviewValues, setTemplatePreviewValues } from "./prosemirror/plugins/templatePreviewValues.js";
22
21
  import { TemplateSlashMenuKeyAction, TemplateSlashMenuState, clearTemplateSlashMenu, consumeTemplateSlashQuery, getTemplateSlashMenu, resetTemplateSlashQuery, templateSlashMenuKey } from "./prosemirror/plugins/templateSlashMenu.js";
23
22
  import { AcceptAutocompleteResult, AutocompleteSuggestionPluginOptions, AutocompleteSuggestionState, AutocompleteSuggestionStatus, AutocompleteTriggerCheck, AutocompleteTriggerOptions, AutocompleteTriggerSkipReason, DEFAULT_AUTOCOMPLETE_DEAD_ZONE_NODES, acceptAutocompleteSuggestion, acceptAutocompleteWord, appendAutocompleteToken, autocompleteSuggestionKey, autocompleteSuggestionPlugin, clearAutocompleteSuggestion, finishAutocompleteSuggestion, getAutocompleteSuggestion, shouldTriggerAutocomplete, startAutocompleteSuggestion } from "./prosemirror/plugins/autocompleteSuggestion.js";
24
23
  import { ImageMeta, ImageRef, MarkdownOptions, MarkdownResult } from "./markdown/types.js";
25
24
  import { fromMarkdown } from "./markdown/fromMarkdown.js";
26
25
  import { toMarkdown, toMarkdownResult } from "./markdown/index.js";
26
+ import { EmbeddedFont, EmbeddedFontParts, extractEmbeddedFonts, getEmbeddedFontFaces } from "./fonts/embeddedFonts.js";
27
+ import { getGoogleFontsEnabled, setGoogleFontsEnabled } from "./utils/fontResolver.js";
27
28
  type Document = document_d_exports.Document;
28
- export { type AIBarStatus, type AIChatMode, type AICitation, type AICitationRange, type AICitationSource, type AIGenerateInput, type AISuggestion, type AISuggestionApplyMode, type AISuggestionPreset, type AISuggestionSeverity, type AISuggestionStatus, type AcceptAutocompleteResult, type AnonymizationMatch, type AnonymizationTerm, type ApplyResult, type AutocompleteSuggestionPluginOptions, type AutocompleteSuggestionState, type AutocompleteSuggestionStatus, type AutocompleteTriggerCheck, type AutocompleteTriggerOptions, type AutocompleteTriggerSkipReason, type CreateEmptyDocumentOptions, DEFAULT_AI_SUGGESTION_PRESETS, DEFAULT_AUTOCOMPLETE_DEAD_ZONE_NODES, type DeriveBlockIdInput, type DirectiveKind, type DirectiveRange, type Document, type DocxCompatibility, type EmbeddedFont, type EmbeddedFontParts, type FolioAIBlock, type FolioAIBlockAnchor, type FolioAIBlockKind, type FolioAIBlockPreviewRun, type FolioAIComment, type FolioAIEditAppliedOperation, type FolioAIEditApplyMode, type FolioAIEditApplyResult, type FolioAIEditOperation, type FolioAIEditReviewMeta, type FolioAIEditSeverity, type FolioAIEditSkipReason, type FolioAIEditSkippedOperation, type FolioAIEditSnapshot, type FolioAISignatureParty, type FolioBlockId, type ImageMeta, type ImageRef, type MarkdownOptions, type MarkdownResult, type PositionalText, type ResolvedAnchor, type TemplatePreviewSpan, type TemplatePreviewValue, type TemplatePreviewValues, type TemplateSlashMenuKeyAction, type TemplateSlashMenuState, type WordDiffSegment, acceptAutocompleteSuggestion, acceptAutocompleteWord, anonymizationDecorationsKey, appendAutocompleteToken, applyFolioAIEditOperations, applySuggestions, autocompleteSuggestionKey, autocompleteSuggestionPlugin, buildPositionalText, clearAutocompleteSuggestion, clearTemplateSlashMenu, consumeTemplateSlashQuery, createAICitationDecorationsPlugin, createDocx, createEmptyDocument, createFolioAIEditSnapshot, deriveBlockId, diffWordSegments, extractEmbeddedFonts, finishAutocompleteSuggestion, fromMarkdown, getAnonymizationMatches, getAutocompleteSuggestion, getEmbeddedFontFaces, getFolioCaretViewportRect, getFolioParaIdFromBlockId, getFolioSelectionViewportRect, getTemplateDirectives, getTemplateSlashMenu, hashFolioAIBlockText, isFolioBlockId, isSequentialFolioBlockId, isSuggestionStale, normalizeFolioAIBlockText, resetTemplateSlashQuery, resolveSuggestionAnchor, scanDirectives, scrollFolioPositionIntoView, setAICitationsMeta, setAISuggestionsMeta, setActiveCitationMeta, setAnonymizationTermsMeta, setFocusedSuggestionMeta, setTemplatePreviewValues, shouldTriggerAutocomplete, startAutocompleteSuggestion, templateSlashMenuKey, toMarkdown, toMarkdownResult };
29
+ export { type AIBarStatus, type AIChatMode, type AICitation, type AICitationRange, type AICitationSource, type AIGenerateInput, type AISuggestion, type AISuggestionApplyMode, type AISuggestionPreset, type AISuggestionSeverity, type AISuggestionStatus, type AcceptAutocompleteResult, type AnonymizationMatch, type AnonymizationTerm, type ApplyResult, type AutocompleteSuggestionPluginOptions, type AutocompleteSuggestionState, type AutocompleteSuggestionStatus, type AutocompleteTriggerCheck, type AutocompleteTriggerOptions, type AutocompleteTriggerSkipReason, type CreateEmptyDocumentOptions, DEFAULT_AI_SUGGESTION_PRESETS, DEFAULT_AUTOCOMPLETE_DEAD_ZONE_NODES, type DeriveBlockIdInput, type DirectiveKind, type DirectiveRange, type Document, type DocxCompatibility, type EmbeddedFont, type EmbeddedFontParts, type FolioAIBlock, type FolioAIBlockAnchor, type FolioAIBlockKind, type FolioAIBlockPreviewRun, type FolioAIComment, type FolioAIEditAppliedOperation, type FolioAIEditApplyMode, type FolioAIEditApplyResult, type FolioAIEditOperation, type FolioAIEditReviewMeta, type FolioAIEditSeverity, type FolioAIEditSkipReason, type FolioAIEditSkippedOperation, type FolioAIEditSnapshot, type FolioAISignatureParty, type FolioBlockId, type ImageMeta, type ImageRef, type MarkdownOptions, type MarkdownResult, type PositionalText, type ResolvedAnchor, type TemplatePreviewSpan, type TemplatePreviewValue, type TemplatePreviewValues, type TemplateSlashMenuKeyAction, type TemplateSlashMenuState, type WordDiffSegment, acceptAutocompleteSuggestion, acceptAutocompleteWord, anonymizationDecorationsKey, appendAutocompleteToken, applyFolioAIEditOperations, applySuggestions, autocompleteSuggestionKey, autocompleteSuggestionPlugin, buildPositionalText, clearAutocompleteSuggestion, clearTemplateSlashMenu, consumeTemplateSlashQuery, createAICitationDecorationsPlugin, createDocx, createEmptyDocument, createFolioAIEditSnapshot, deriveBlockId, diffWordSegments, extractEmbeddedFonts, finishAutocompleteSuggestion, fromMarkdown, getAnonymizationMatches, getAutocompleteSuggestion, getEmbeddedFontFaces, getFolioCaretViewportRect, getFolioParaIdFromBlockId, getFolioSelectionViewportRect, getGoogleFontsEnabled, getTemplateDirectives, getTemplateSlashMenu, hashFolioAIBlockText, isFolioBlockId, isSequentialFolioBlockId, isSuggestionStale, normalizeFolioAIBlockText, resetTemplateSlashQuery, resolveSuggestionAnchor, scanDirectives, scrollFolioPositionIntoView, setAICitationsMeta, setAISuggestionsMeta, setActiveCitationMeta, setAnonymizationTermsMeta, setFocusedSuggestionMeta, setGoogleFontsEnabled, setTemplatePreviewValues, shouldTriggerAutocomplete, startAutocompleteSuggestion, templateSlashMenuKey, toMarkdown, toMarkdownResult };
package/dist/index.js CHANGED
@@ -9,6 +9,7 @@ import { createFolioAIEditSnapshot, hashFolioAIBlockText, normalizeFolioAIBlockT
9
9
  import { diffWordSegments } from "./ai-edits/word-diff.js";
10
10
  import { applyFolioAIEditOperations } from "./ai-edits/apply.js";
11
11
  import { setAISuggestionsMeta, setFocusedSuggestionMeta } from "./prosemirror/plugins/aiSuggestionDecorations.js";
12
+ import { getGoogleFontsEnabled, setGoogleFontsEnabled } from "./utils/fontResolver.js";
12
13
  import { scrollFolioPositionIntoView } from "./paged-layout/scrollToPmPosition.js";
13
14
  import { getFolioCaretViewportRect, getFolioSelectionViewportRect } from "./paged-layout/selectionViewportRect.js";
14
15
  import { createAICitationDecorationsPlugin, setAICitationsMeta, setActiveCitationMeta } from "./prosemirror/plugins/aiCitationDecorations.js";
@@ -20,4 +21,4 @@ import { DEFAULT_AUTOCOMPLETE_DEAD_ZONE_NODES, acceptAutocompleteSuggestion, acc
20
21
  import { fromMarkdown } from "./markdown/fromMarkdown.js";
21
22
  import { toMarkdown, toMarkdownResult } from "./markdown/index.js";
22
23
  import { extractEmbeddedFonts, getEmbeddedFontFaces } from "./fonts/embeddedFonts.js";
23
- export { DEFAULT_AI_SUGGESTION_PRESETS, DEFAULT_AUTOCOMPLETE_DEAD_ZONE_NODES, acceptAutocompleteSuggestion, acceptAutocompleteWord, anonymizationDecorationsKey, appendAutocompleteToken, applyFolioAIEditOperations, applySuggestions, autocompleteSuggestionKey, autocompleteSuggestionPlugin, buildPositionalText, clearAutocompleteSuggestion, clearTemplateSlashMenu, consumeTemplateSlashQuery, createAICitationDecorationsPlugin, createDocx, createEmptyDocument, createFolioAIEditSnapshot, deriveBlockId, diffWordSegments, extractEmbeddedFonts, finishAutocompleteSuggestion, fromMarkdown, getAnonymizationMatches, getAutocompleteSuggestion, getEmbeddedFontFaces, getFolioCaretViewportRect, getFolioParaIdFromBlockId, getFolioSelectionViewportRect, getTemplateDirectives, getTemplateSlashMenu, hashFolioAIBlockText, isFolioBlockId, isSequentialFolioBlockId, isSuggestionStale, normalizeFolioAIBlockText, resetTemplateSlashQuery, resolveSuggestionAnchor, scanDirectives, scrollFolioPositionIntoView, setAICitationsMeta, setAISuggestionsMeta, setActiveCitationMeta, setAnonymizationTermsMeta, setFocusedSuggestionMeta, setTemplatePreviewValues, shouldTriggerAutocomplete, startAutocompleteSuggestion, templateSlashMenuKey, toMarkdown, toMarkdownResult };
24
+ export { DEFAULT_AI_SUGGESTION_PRESETS, DEFAULT_AUTOCOMPLETE_DEAD_ZONE_NODES, acceptAutocompleteSuggestion, acceptAutocompleteWord, anonymizationDecorationsKey, appendAutocompleteToken, applyFolioAIEditOperations, applySuggestions, autocompleteSuggestionKey, autocompleteSuggestionPlugin, buildPositionalText, clearAutocompleteSuggestion, clearTemplateSlashMenu, consumeTemplateSlashQuery, createAICitationDecorationsPlugin, createDocx, createEmptyDocument, createFolioAIEditSnapshot, deriveBlockId, diffWordSegments, extractEmbeddedFonts, finishAutocompleteSuggestion, fromMarkdown, getAnonymizationMatches, getAutocompleteSuggestion, getEmbeddedFontFaces, getFolioCaretViewportRect, getFolioParaIdFromBlockId, getFolioSelectionViewportRect, getGoogleFontsEnabled, getTemplateDirectives, getTemplateSlashMenu, hashFolioAIBlockText, isFolioBlockId, isSequentialFolioBlockId, isSuggestionStale, normalizeFolioAIBlockText, resetTemplateSlashQuery, resolveSuggestionAnchor, scanDirectives, scrollFolioPositionIntoView, setAICitationsMeta, setAISuggestionsMeta, setActiveCitationMeta, setAnonymizationTermsMeta, setFocusedSuggestionMeta, setGoogleFontsEnabled, setTemplatePreviewValues, shouldTriggerAutocomplete, startAutocompleteSuggestion, templateSlashMenuKey, toMarkdown, toMarkdownResult };
@@ -1,5 +1,5 @@
1
- import { FlowBlock } from "../../layout-engine/types.js";
2
1
  import { TemplatePreviewValue } from "../../prosemirror/plugins/templatePreviewValues.js";
2
+ import { FlowBlock } from "../../layout-engine/types.js";
3
3
 
4
4
  //#region src/layout-bridge/convert/templatePreviewFlow.d.ts
5
5
  /** One marker→value substitution, in PM doc positions. */
package/dist/server.d.ts CHANGED
@@ -1,7 +1,8 @@
1
1
  import { FolioAIBlock, FolioAIBlockAnchor, FolioAIBlockKind, FolioAIBlockPreviewRun, FolioAIComment, FolioAIEditApplyMode, FolioAIEditApplyResult, FolioAIEditOperation, FolioAIEditSnapshot } from "./ai-edits/types.js";
2
- import { ApplyFolioAIEditsToBufferOptions, ApplyFolioAIEditsToBufferResult, FolioApplyOperationsOptions, FolioDocxReviewer, FolioDocxReviewerOptions, FolioReviewChange, FolioReviewChangeFilter, FolioReviewChangeKind, FolioReviewComment, FolioReviewCommentFilter, FolioReviewCommentReply, FolioReviewReplyInput, applyFolioAIEditsToBuffer } from "./ai-edits/headless.js";
2
+ import { FolioReviewChange, FolioReviewChangeKind } from "./ai-edits/read.js";
3
+ import { ApplyFolioAIEditsToBufferOptions, ApplyFolioAIEditsToBufferResult, FolioApplyOperationsOptions, FolioDocxReviewer, FolioDocxReviewerOptions, FolioReviewChangeFilter, FolioReviewComment, FolioReviewCommentFilter, FolioReviewCommentReply, FolioReviewReplyInput, applyFolioAIEditsToBuffer } from "./ai-edits/headless.js";
3
4
  import { DeriveBlockIdInput, FolioBlockId, deriveBlockId, getFolioParaIdFromBlockId, isFolioBlockId, isSequentialFolioBlockId } from "./types/block-id.js";
4
- import { CreateCommentReplyInput, replyToComment } from "./docx/replyToComment.js";
5
- import { createDocx } from "./docx/rezip.js";
6
5
  import { CreateEmptyDocumentOptions, createEmptyDocument } from "./utils/createDocument.js";
6
+ import { createDocx } from "./docx/rezip.js";
7
+ import { CreateCommentReplyInput, replyToComment } from "./docx/replyToComment.js";
7
8
  export { type ApplyFolioAIEditsToBufferOptions, type ApplyFolioAIEditsToBufferResult, type CreateCommentReplyInput, type CreateEmptyDocumentOptions, type DeriveBlockIdInput, type FolioAIBlock, type FolioAIBlockAnchor, type FolioAIBlockKind, type FolioAIBlockPreviewRun, type FolioAIComment, type FolioAIEditApplyMode, type FolioAIEditApplyResult, type FolioAIEditOperation, type FolioAIEditSnapshot, type FolioApplyOperationsOptions, type FolioBlockId, FolioDocxReviewer, type FolioDocxReviewerOptions, type FolioReviewChange, type FolioReviewChangeFilter, type FolioReviewChangeKind, type FolioReviewComment, type FolioReviewCommentFilter, type FolioReviewCommentReply, type FolioReviewReplyInput, applyFolioAIEditsToBuffer, createDocx, createEmptyDocument, deriveBlockId, getFolioParaIdFromBlockId, isFolioBlockId, isSequentialFolioBlockId, replyToComment };
@@ -38,6 +38,8 @@ declare function isCjkFont(family: string): boolean;
38
38
  * used for width measurement or painting.
39
39
  */
40
40
  declare const CJK_FALLBACK_FONT_FAMILY = "MS Mincho";
41
+ declare const setGoogleFontsEnabled: (enabled: boolean) => void;
42
+ declare const getGoogleFontsEnabled: () => boolean;
41
43
  declare function resolveFontFamily(docxFontName: string): ResolvedFont;
42
44
  /**
43
45
  * Resolve a theme font reference to actual font names
@@ -77,4 +79,4 @@ declare function getGoogleFontEquivalent(docxFontName: string): string | null;
77
79
  */
78
80
  declare function hasGoogleFontEquivalent(docxFontName: string): boolean;
79
81
  //#endregion
80
- export { CJK_FALLBACK_FONT_FAMILY, DEFAULT_SINGLE_LINE_RATIO, ResolvedFont, buildFontFamilyString, getGoogleFontEquivalent, getGoogleFontsToLoad, hasGoogleFontEquivalent, isCjkFont, resolveFontFamily, resolveThemeFont };
82
+ export { CJK_FALLBACK_FONT_FAMILY, DEFAULT_SINGLE_LINE_RATIO, ResolvedFont, buildFontFamilyString, getGoogleFontEquivalent, getGoogleFontsEnabled, getGoogleFontsToLoad, hasGoogleFontEquivalent, isCjkFont, resolveFontFamily, resolveThemeFont, setGoogleFontsEnabled };
@@ -723,6 +723,11 @@ const CJK_FALLBACK_FONT_FAMILY = "MS Mincho";
723
723
  const ARABIC_FALLBACK = "\"Noto Sans Arabic\"";
724
724
  const TRAILING_GENERIC = /,\s*(?<generic>sans-serif|serif|monospace|cursive)\s*$/u;
725
725
  const withArabicFallback = (stack) => TRAILING_GENERIC.test(stack) ? stack.replace(TRAILING_GENERIC, `, ${ARABIC_FALLBACK}, $<generic>`) : `${stack}, ${ARABIC_FALLBACK}`;
726
+ let googleFontsEnabled = true;
727
+ const setGoogleFontsEnabled = (enabled) => {
728
+ googleFontsEnabled = enabled;
729
+ };
730
+ const getGoogleFontsEnabled = () => googleFontsEnabled;
726
731
  function resolveFontFamily(docxFontName) {
727
732
  const normalizedName = docxFontName.trim().toLowerCase();
728
733
  const aliasTarget = CJK_FONT_ALIASES[normalizedName];
@@ -730,10 +735,10 @@ function resolveFontFamily(docxFontName) {
730
735
  if (mapping) {
731
736
  const fallbackStack = aliasTarget && !mapping.fallbackStack.some((f) => f.toLowerCase() === normalizedName) ? [docxFontName, ...mapping.fallbackStack] : mapping.fallbackStack;
732
737
  return {
733
- googleFont: mapping.googleFont,
738
+ googleFont: googleFontsEnabled ? mapping.googleFont : null,
734
739
  cssFallback: withArabicFallback(fallbackStack.map(quoteFontName).join(", ")),
735
740
  originalFont: docxFontName,
736
- hasGoogleEquivalent: true,
741
+ hasGoogleEquivalent: googleFontsEnabled,
737
742
  singleLineRatio: mapping.singleLineRatio
738
743
  };
739
744
  }
@@ -830,7 +835,9 @@ function getGoogleFontEquivalent(docxFontName) {
830
835
  * @returns true if there's a Google Fonts equivalent
831
836
  */
832
837
  function hasGoogleFontEquivalent(docxFontName) {
833
- return docxFontName.trim().toLowerCase() in FONT_MAPPINGS;
838
+ if (!googleFontsEnabled) return false;
839
+ const normalizedName = docxFontName.trim().toLowerCase();
840
+ return (CJK_FONT_ALIASES[normalizedName] ?? normalizedName) in FONT_MAPPINGS;
834
841
  }
835
842
  //#endregion
836
- export { CJK_FALLBACK_FONT_FAMILY, DEFAULT_SINGLE_LINE_RATIO, buildFontFamilyString, getGoogleFontEquivalent, getGoogleFontsToLoad, hasGoogleFontEquivalent, isCjkFont, resolveFontFamily, resolveThemeFont };
843
+ export { CJK_FALLBACK_FONT_FAMILY, DEFAULT_SINGLE_LINE_RATIO, buildFontFamilyString, getGoogleFontEquivalent, getGoogleFontsEnabled, getGoogleFontsToLoad, hasGoogleFontEquivalent, isCjkFont, resolveFontFamily, resolveThemeFont, setGoogleFontsEnabled };