ooxml-ui 1.35.0 → 1.36.0
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/custom-elements.json +14 -1
- package/dist/chart/format-pane-analysis.d.ts +0 -1
- package/dist/chart/format-pane-effects.d.ts +0 -1
- package/dist/chart/format-pane-fill-kinds.d.ts +0 -1
- package/dist/chart/format-pane-fill-line.d.ts +0 -1
- package/dist/chart/format-pane-targets.d.ts +0 -1
- package/dist/chart/format-pane-text.d.ts +0 -1
- package/dist/chrome/tab-drag.d.ts +27 -0
- package/dist/chrome/tab-drag.d.ts.map +1 -0
- package/dist/chrome/tab-strip.d.ts +25 -1
- package/dist/chrome/tab-strip.d.ts.map +1 -1
- package/dist/{chunk-CDC5MAZS.js → chunk-6VF4FEMY.js} +1 -1
- package/dist/{chunk-D5IRYZLP.js → chunk-7RRN2GPO.js} +1 -1
- package/dist/{chunk-FFM3WVLU.js → chunk-7ST5QRD5.js} +1 -1
- package/dist/{chunk-KYXSQFDB.js → chunk-QAX4FAB7.js} +139 -4
- package/dist/{chunk-TGG36HHF.js → chunk-Z4DML5NW.js} +2 -2
- package/dist/controls.d.ts +1 -1
- package/dist/controls.d.ts.map +1 -1
- package/dist/controls.js +1 -1
- package/dist/docx/building-blocks-actions.d.ts +2 -2
- package/dist/docx/editable-region-view.d.ts +4 -0
- package/dist/docx/editor-chrome.d.ts +1 -1
- package/dist/docx/editor-core.d.ts +4 -0
- package/dist/docx/editor-plugins.d.ts +3 -0
- package/dist/docx/file-commands.d.ts +5 -0
- package/dist/docx/format-dialogs.d.ts +6 -1
- package/dist/docx/insert-controller.d.ts +5 -0
- package/dist/docx/list-commands.d.ts +3 -1
- package/dist/docx/list-marker-display.d.ts +1 -1
- package/dist/docx/locales/en-app.d.ts +0 -1
- package/dist/docx/locales/en-ribbon.d.ts +51 -0
- package/dist/docx/locales/en.d.ts +51 -1
- package/dist/docx/localization-strings.d.ts +51 -1
- package/dist/docx/paragraph-styles.d.ts +1 -1
- package/dist/docx/protection-controls.d.ts +4 -0
- package/dist/docx/restrict-editing-pane.d.ts +14 -0
- package/dist/docx/ribbon-action.d.ts +4 -0
- package/dist/docx/ribbon-icons.d.ts +1 -0
- package/dist/docx/search-controller.d.ts +12 -5
- package/dist/docx/search-document.d.ts +32 -0
- package/dist/docx.js +1182 -384
- package/dist/export/pdf-embedded-font.d.ts +65 -0
- package/dist/export/pdf-fonts.d.ts +14 -0
- package/dist/export/pdf-vector.d.ts +84 -0
- package/dist/fonts/catalog.d.ts +1 -0
- package/dist/index.js +4 -4
- package/dist/pptx/ai/bridge-factory.d.ts +4 -1
- package/dist/pptx/ai/bridge-factory.d.ts.map +1 -1
- package/dist/pptx/ai/config.d.ts +1 -1
- package/dist/pptx/ai/config.d.ts.map +1 -1
- package/dist/pptx/ai/host.cjs +36 -36
- package/dist/pptx/ai/host.mjs +1 -1
- package/dist/pptx/ai/index.cjs +50 -43
- package/dist/pptx/ai/index.mjs +10 -3
- package/dist/pptx/ai/system-prompt.d.ts +1 -1
- package/dist/pptx/ai/system-prompt.d.ts.map +1 -1
- package/dist/pptx/ai/tool-summary.d.ts.map +1 -1
- package/dist/pptx/ai/tools/mcp-registry.d.ts.map +1 -1
- package/dist/pptx/{chunk-KGDMMWIY.mjs → chunk-2AK5MS6H.mjs} +11 -0
- package/dist/pptx/{chunk-M55PNMFQ.cjs → chunk-4OKSYRYA.cjs} +11 -0
- package/dist/pptx/{chunk-GPQP2R5Y.mjs → chunk-4RSRCNRM.mjs} +177 -13
- package/dist/pptx/{chunk-NPYNJOK2.cjs → chunk-6JJD3LFT.cjs} +182 -17
- package/dist/pptx/{chunk-46HIE4IE.cjs → chunk-CRV7G4GC.cjs} +8 -0
- package/dist/pptx/{chunk-5EERUTDC.mjs → chunk-KNCCSPAV.mjs} +1 -1
- package/dist/pptx/{chunk-GKQULDFF.cjs → chunk-SI7GQYSL.cjs} +42 -42
- package/dist/pptx/{chunk-6MEBLCNK.mjs → chunk-WQI3NLMY.mjs} +8 -0
- package/dist/pptx/dom/index.cjs +384 -384
- package/dist/pptx/dom/index.mjs +6 -6
- package/dist/pptx/i18n/index.cjs +6 -6
- package/dist/pptx/i18n/index.mjs +1 -1
- package/dist/pptx/i18n/translations-en.d.ts.map +1 -1
- package/dist/pptx/index.cjs +3037 -3033
- package/dist/pptx/index.mjs +2 -2
- package/dist/pptx/render/controller/custom-shows-controller.d.ts +93 -0
- package/dist/pptx/render/controller/custom-shows-controller.d.ts.map +1 -0
- package/dist/pptx/render/controller/index.d.ts +2 -0
- package/dist/pptx/render/controller/index.d.ts.map +1 -1
- package/dist/pptx/render/custom-shows.d.ts +10 -2
- package/dist/pptx/render/custom-shows.d.ts.map +1 -1
- package/dist/pptx/{smartart-insert-preview-6BITTUI4.mjs → smartart-insert-preview-JH5TXECK.mjs} +3 -3
- package/dist/pptx/{smartart-insert-preview-BUOS5XQR.cjs → smartart-insert-preview-QWROEVZL.cjs} +4 -4
- package/dist/smartart/smartart-text-pane-tools.d.ts +0 -1
- package/dist/teams.js +2 -2
- package/dist/theme.d.ts +0 -1
- package/dist/touch-targets.d.ts +0 -1
- package/dist/visio/binding.d.ts +2 -1
- package/dist/visio/canvas-editing.d.ts +2 -0
- package/dist/visio/controller.d.ts +3 -0
- package/dist/visio/pdf-path.d.ts +37 -0
- package/dist/visio/pdf-svg-gradient.d.ts +23 -0
- package/dist/visio/pdf-svg-style.d.ts +20 -0
- package/dist/visio/pdf-svg-text.d.ts +8 -0
- package/dist/visio/pdf-svg.d.ts +22 -0
- package/dist/visio/ribbon-action.d.ts +47 -5
- package/dist/visio/ribbon-arrange.d.ts +9 -0
- package/dist/visio/ribbon-contextual-formats.d.ts +18 -0
- package/dist/visio/ribbon-org-chart.d.ts +7 -0
- package/dist/visio/ribbon-router.d.ts +18 -0
- package/dist/visio/ribbon-shape-format.d.ts +7 -0
- package/dist/visio/ribbon-size-fields.d.ts +5 -0
- package/dist/visio/ribbon-swimlane.d.ts +9 -0
- package/dist/visio/ribbon-themes.d.ts +13 -3
- package/dist/visio/ribbon.d.ts +5 -1
- package/dist/visio/shapes-files-ui.d.ts +1 -1
- package/dist/visio/template-thumbnails.d.ts +10 -0
- package/dist/visio/viewer-backstage.d.ts +9 -3
- package/dist/visio/viewer-contextual-tabs.d.ts +21 -0
- package/dist/visio/viewer-diagram-parts.d.ts +9 -1
- package/dist/visio/viewer-element.d.ts +10 -0
- package/dist/visio/viewer-export.d.ts +1 -6
- package/dist/visio/viewer-file-commands.d.ts +6 -1
- package/dist/visio/viewer-guides.d.ts +8 -1
- package/dist/visio/viewer-inline-size.d.ts +15 -0
- package/dist/visio/viewer-insert-dialog.d.ts +1 -0
- package/dist/visio/viewer-new-drawing.d.ts +3 -2
- package/dist/visio/viewer-org-chart.d.ts +19 -0
- package/dist/visio/viewer-pdf-options.d.ts +26 -0
- package/dist/visio/viewer-pdf.d.ts +47 -0
- package/dist/visio/viewer-picture-format.d.ts +20 -0
- package/dist/visio/viewer-resize-handles.d.ts +13 -1
- package/dist/visio/viewer-swimlanes.d.ts +34 -0
- package/dist/visio.js +4038 -733
- package/dist/xlsx/dialogs/audit-dialogs.d.ts +9 -0
- package/dist/xlsx/dialogs/custom-lists.d.ts +6 -0
- package/dist/xlsx/dialogs/help-dialogs.d.ts +2 -2
- package/dist/xlsx/dialogs/sort-dialog.d.ts +3 -3
- package/dist/xlsx/dialogs/watch-window.d.ts +4 -0
- package/dist/xlsx/grid/audit-layer.d.ts +3 -0
- package/dist/xlsx/grid/grid-view.d.ts +23 -1
- package/dist/xlsx/grid/pane-chrome.d.ts +2 -0
- package/dist/xlsx/grid/split-bars.d.ts +2 -0
- package/dist/xlsx/grid/styles.d.ts +1 -1
- package/dist/xlsx/sheet-tabs/drag.d.ts +1 -2
- package/dist/xlsx.js +1074 -239
- package/package.json +2 -2
package/dist/docx.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { defineChartExOptions, statusLayout, watchStatusWidth, compactPageText } from './chunk-C4KI635Q.js';
|
|
2
|
-
import { chartExSpaceFormatSource } from './chunk-
|
|
3
|
-
import { syncRibbonAddIns, createHostBackstagePages, withHostMenuItems } from './chunk-
|
|
4
|
-
export { RIBBON_ADD_IN_EVENT } from './chunk-
|
|
2
|
+
import { chartExSpaceFormatSource } from './chunk-7RRN2GPO.js';
|
|
3
|
+
import { syncRibbonAddIns, createHostBackstagePages, withHostMenuItems } from './chunk-6VF4FEMY.js';
|
|
4
|
+
export { RIBBON_ADD_IN_EVENT } from './chunk-6VF4FEMY.js';
|
|
5
5
|
import { defineSmartArt, smartArtColorsGalleryState, smartArtStylesGalleryState, SmartArtTextPaneController, pictureNeedsSvg, pictureSvg, defineSmartArtPicker } from './chunk-GZNBWWJ5.js';
|
|
6
6
|
import { legacyThemeAliases, legacyThemeBridge, installOfficeUiThemeFor } from './chunk-T5ARELU2.js';
|
|
7
|
-
import { createRibbonOverflow, defineRibbon, defineChartFormatPane, defineRuler, defineChartDataSheet, defineChartPicker, createDialogSession, defineCommentsPane, defineDialog, buildFontCatalog, defineGallery, defineSearchField, defineSwitch, defineTitleBar, defineRibbonActions, defineBackstage, defineStatusBar, defineZoomSlider, defineContextMenu, defineColorGrid, runKeyTips, defineOptionsDialog, assignKeyTips, optionsLabels, userInterfaceSection, personalizeSection, optionText, unavailableCategory } from './chunk-
|
|
7
|
+
import { createRibbonOverflow, defineRibbon, defineChartFormatPane, defineRuler, defineChartDataSheet, defineChartPicker, createDialogSession, defineCommentsPane, defineDialog, buildFontCatalog, defineGallery, defineSearchField, defineSwitch, defineTitleBar, defineRibbonActions, defineBackstage, defineStatusBar, defineZoomSlider, defineContextMenu, defineColorGrid, runKeyTips, defineOptionsDialog, assignKeyTips, optionsLabels, userInterfaceSection, personalizeSection, optionText, unavailableCategory } from './chunk-QAX4FAB7.js';
|
|
8
8
|
import { registerIcon } from './chunk-M6GF5ED2.js';
|
|
9
9
|
import './chunk-4OBMFPGF.js';
|
|
10
10
|
import './chunk-YZH2QS7J.js';
|
|
@@ -13,11 +13,11 @@ import './chunk-QLHCGV4C.js';
|
|
|
13
13
|
import './chunk-XL77FR4B.js';
|
|
14
14
|
import { optionStrings, normalizeLocale, SUPPORTED_OFFICE_LOCALES, interpolate } from 'ooxml-core/i18n';
|
|
15
15
|
import { DIAGRAM_UI_STRINGS, DIAGRAM_ADD_SHAPE_COMMANDS, DEFAULT_GENERATED_DIAGRAM_SCHEME, DIAGRAM_DESIGN_GROUPS, DIAGRAM_INSERT_PRESETS, DIAGRAM_DESIGN_COMMANDS, DIAGRAM_COLOR_ENTRIES, DIAGRAM_STYLE_ENTRIES, DIAGRAM_INSERT_CATEGORIES, DIAGRAM_ADD_SHAPE_LABEL } from 'ooxml-core/diagram';
|
|
16
|
-
import { markSpecs, imageNodeSpec, fieldMarkerNodeSpec, noteReferenceNodeSpec, pageBreakNodeSpec, hardBreakNodeSpec, commentHistoryAttributes, tableCellStyle, tableStyle, createToggleFormat, expectDefined, controlFromData, paragraphBoxCss, WORD_CAPABILITY_ACTIONS, normalizeThemeMode, applyThemeColors, refreshWordYjsPresence, tableGrid, RESTRUCTURE_TABLE_META, normalizeRibbonActions, DirtyState,
|
|
16
|
+
import { markSpecs, imageNodeSpec, fieldMarkerNodeSpec, noteReferenceNodeSpec, pageBreakNodeSpec, hardBreakNodeSpec, commentHistoryAttributes, tableCellStyle, tableStyle, createToggleFormat, expectDefined, controlFromData, paragraphBoxCss, WORD_CAPABILITY_ACTIONS, normalizeThemeMode, applyThemeColors, refreshWordYjsPresence, tableGrid, RESTRUCTURE_TABLE_META, normalizeRibbonActions, DirtyState, locksStories, isWordYjsRemoteTransaction, REMOTE_TRANSACTION_META, repairCollaborativeDocumentIds, HEADER_FOOTER_INPUT, splitCell, closeRect, mergeCells, deleteColumns, insertColumn, deleteRow, insertRow, rowSpanOf, continuationsOf, wordYjsPluginKey, wordYjsRedo, wordYjsUndo, documentWordCount, restoreSectionParts, commentThreadsFromDoc, restoreNoteParts, CollaborationClient, createCollaborationIdGenerator, WordYjsCollaboration, insertContentControl, sectionPartsJson, NotePartsStep, notePartsJson, SectionPartsStep, fitZoomPercent, hasChangeAtCursor, hasAnyChange, commentIdsAtSelection, commentAnchors, forcesTrackChanges, fieldGuardPlugin, tableStructureGuardPlugin, contentControlPlugin, formFieldGuardPlugin, editRestrictionPlugin, symbolFontPlugin, positionalTabInputPlugin, trackChangesPlugin, wordYjsPresencePlugin, placementClass, removeCommentThread, removeCommentAnchor, deleteComment, updateCommentThreads, addComment, toggleTrackChanges, goToNextChange, goToPreviousChange, rejectAllChanges, acceptAllChanges, rejectChangeAtCursor, acceptChangeAtCursor, goToComment, selectedChart, appendInlineNode, sameJson, sameRuns, PARAGRAPH_KEEP_KEYS, paragraphFromAttrs, parseBordersJson, isNavigableHref, setReviewRecordingPreferences, setEditableRegion, insertChartImage, nodeNumbering, controlAtSelection, paragraphFormattingRevision, inlineNodeRun, formattingRevision, editRestrictionOf, editableRanges, insertWordHardBreak, paragraphAttrs, resolveCellVisuals, previewDocxDiagram, themeDrawing, chartNodeSpec, FindPatternError, replacementParts, replaceSelectedChart, ribbonActionIdForLabel, removeWordLink, fieldResultRanges, wordLinkRangeAt, nextEditableRegion, editRestrictionKey, ligatureCss as ligatureCss$1, toggleCheckboxControl, formFieldBeside, formFieldOfNode, formFieldLocked, toggleFormCheckboxAt, runToInlineNodes as runToInlineNodes$1, findMatches, backstageFocus, applyRunFormattingPatch, clearDirectRunFormatting, applyWordLink, deleteFieldSelection, emptySimpleFieldResult, ligatureStyle, wordHighlightColors, swatchColor, cssBorderSide, countWords, FIND_OBJECT, FIND_PARAGRAPH_MARK, FIND_LINE_BREAK, FIND_PAGE_BREAK, insertedTextMarks, chooseListItem, chooseDate, selectFormDropDownAt, updateControlProperties, WORD_CAPABILITY_MENU_ITEMS, WORD_CAPABILITY_SHORTCUTS, WORD_CAPABILITY_BACKSTAGE_PAGES, WORD_CAPABILITY_FILE_COMMANDS, resolveComment, replyToComment, CollaborationAuthority } from 'ooxml-core/docx/ui';
|
|
17
17
|
export { CollaborationAuthority, CollaborationClient, RIBBON_ACTION_IDS, RIBBON_ACTION_LABELS, WORD_CAPABILITY_IDS, createCollaborationIdGenerator, darkTheme, isRibbonActionId, lightTheme, normalizeRibbonActions, repairCollaborativeDocumentIds, themeToCssVars } from 'ooxml-core/docx/ui';
|
|
18
|
-
import { createDocument, saveDocx, sectionsFromLayout, sectionLayoutJson, sectionsOf, pageSizeOf, columnPreset, applyPageSetup, withSection, computeListLabels, numberNotesInOrder, tocEntries, editDocxChartEx, editDocxChart, resolveNumberingLevel, formatDocxDiagram, createDocxDiagram, insertedDiagramPartNames, changeDocxDiagramLayout, tableOfFiguresInstruction, findTableOfContents, applyDocxChartDataSheetEdits, docxChartDataSheet, newDocxChart, newChartImage, docxChartPaint, ensureListDefinition, equalColumnDraft, readColumnDraft, PAGE_SIZE_OPTIONS, PAGE_SIZES, readPageSetup, isRunHiddenForReview, resolveTableStyleFormatting, resolveParagraphFormatting, displayListLabel, setTitlePage, setLineNumbering, setVerticalAlign, setPageNumbering, ST_NumberFormat, unequalColumnPreset, setColumns, setOrientation, setPageSize, setMargins, lineSpacingLabel, formatNoteNumber, cellSourceBlocks, reviewDocumentFormatting, reviewFormattingWarnings, listRevisions, diagramColorTheme, plainText, resolveRunFormatting, removedByEdit, editDocxDiagram, tocHyperlinks, DEFAULT_TOC_INSTRUCTION, tocBookmarks, buildTableOfContents, tocCaptionLabel, twips as twips$1, signedTwips, formatListNumber, columnTextWidth, validColumnDraft, validatePageSetup, presetOf, LIGATURE_VALUES, isLigatures, reviewRunFormatting, resolveThemeColorReference, lineSpacingValue, canEditControlContent, controlDate, formDropDownIndex, shapeSvg, isStHighlightColor, transformCase, DEFAULT_TABLE_BORDERS, parseLineSpacingValue, twipsAttr, SHAPE_PALETTE, isHeadingListKind, twipsFromPixels, isFieldLocked, styleRefSource, parseStyleReference, bodyStyleRefResult, isDirectionalPreset, headingLevel, reviewParagraphFormatting, isValidLanguageTag, WORD, newShape, withFieldCodeFormatting, fieldResultRun, DEFAULT_DRAWN_SHAPE, fieldName, lineSpacingOptions,
|
|
18
|
+
import { createDocument, saveDocx, sectionsFromLayout, sectionLayoutJson, sectionsOf, pageSizeOf, columnPreset, applyPageSetup, withSection, computeListLabels, numberNotesInOrder, tocEntries, editDocxChartEx, editDocxChart, resolveNumberingLevel, formatDocxDiagram, createDocxDiagram, insertedDiagramPartNames, changeDocxDiagramLayout, tableOfFiguresInstruction, findTableOfContents, enforceProtection, verifyProtectionPassword, applyDocxChartDataSheetEdits, docxChartDataSheet, newDocxChart, newChartImage, docxChartPaint, ensureListDefinition, equalColumnDraft, readColumnDraft, PAGE_SIZE_OPTIONS, PAGE_SIZES, readPageSetup, isRunHiddenForReview, resolveTableStyleFormatting, resolveParagraphFormatting, displayListLabel, setTitlePage, setLineNumbering, setVerticalAlign, setPageNumbering, ST_NumberFormat, unequalColumnPreset, setColumns, setOrientation, setPageSize, setMargins, lineSpacingLabel, formatNoteNumber, cellSourceBlocks, reviewDocumentFormatting, reviewFormattingWarnings, listRevisions, diagramColorTheme, plainText, resolveRunFormatting, removedByEdit, editDocxDiagram, tocHyperlinks, DEFAULT_TOC_INSTRUCTION, tocBookmarks, buildTableOfContents, tocCaptionLabel, twips as twips$1, signedTwips, formatListNumber, columnTextWidth, validColumnDraft, validatePageSetup, presetOf, LIGATURE_VALUES, isLigatures, reviewRunFormatting, resolveThemeColorReference, pictureBulletSizePt, lineSpacingValue, canEditControlContent, controlDate, formDropDownIndex, shapeSvg, isStHighlightColor, transformCase, DEFAULT_TABLE_BORDERS, parseLineSpacingValue, twipsAttr, SHAPE_PALETTE, isHeadingListKind, headingListLevels, createListDefinition, linkStylesToList, twipsFromPixels, isFieldLocked, styleRefSource, parseStyleReference, bodyStyleRefResult, isDirectionalPreset, headingLevel, reviewParagraphFormatting, isValidLanguageTag, WORD, newShape, withFieldCodeFormatting, fieldResultRun, DEFAULT_DRAWN_SHAPE, fieldName, lineSpacingOptions, createPictureBulletList, halfPointsFromPoints, changeColumnWidth, changeColumnGap, documentStats } from 'ooxml-core/docx';
|
|
19
19
|
import { loadDocument } from 'ooxml-core/docx/load';
|
|
20
|
-
import { Schema, Fragment, DOMSerializer, Mark } from 'prosemirror-model';
|
|
20
|
+
import { Schema, Fragment, DOMSerializer, Slice, Mark } from 'prosemirror-model';
|
|
21
21
|
import { parseOmml, convertOmmlToLatex, convertOmmlToMathMl, EQUATION_GALLERY, latexToOmmlXml } from 'ooxml-core/math';
|
|
22
22
|
import { closeHistory, redo, undo, history } from 'prosemirror-history';
|
|
23
23
|
import { PluginKey, TextSelection, Selection, EditorState, Plugin, NodeSelection } from 'prosemirror-state';
|
|
@@ -39,7 +39,7 @@ var enSplitCells = {
|
|
|
39
39
|
"Split the cell into this many columns and rows.": "Split the cell into this many columns and rows."
|
|
40
40
|
};
|
|
41
41
|
var fromValues = (values2) => Object.fromEntries(
|
|
42
|
-
Object.keys(enSplitCells).map((
|
|
42
|
+
Object.keys(enSplitCells).map((key3, index) => [key3, values2[index]])
|
|
43
43
|
);
|
|
44
44
|
var frSplitCells = fromValues([
|
|
45
45
|
"Fusionner les cellules",
|
|
@@ -113,7 +113,7 @@ var enColumns = {
|
|
|
113
113
|
"Unequal column widths are preserved. Select Equal column width to replace them with equal columns.": "Unequal column widths are preserved. Select Equal column width to replace them with equal columns.",
|
|
114
114
|
"Enter whole columns and spacing that leaves at least 0.5 inch for each column.": "Enter whole columns and spacing that leaves at least 0.5 inch for each column."
|
|
115
115
|
};
|
|
116
|
-
var fromValues2 = (values2) => Object.fromEntries(Object.keys(enColumns).map((
|
|
116
|
+
var fromValues2 = (values2) => Object.fromEntries(Object.keys(enColumns).map((key3, index) => [key3, values2[index]]));
|
|
117
117
|
var frColumns = fromValues2([
|
|
118
118
|
"Colonne",
|
|
119
119
|
"Autres colonnes\u2026",
|
|
@@ -194,7 +194,7 @@ var keys = [
|
|
|
194
194
|
"(No style)",
|
|
195
195
|
"Add tab stop at (inches)"
|
|
196
196
|
];
|
|
197
|
-
var from = (values2) => Object.fromEntries(keys.map((
|
|
197
|
+
var from = (values2) => Object.fromEntries(keys.map((key3, i) => [key3, values2[i]]));
|
|
198
198
|
var enMultilevelList = from(keys);
|
|
199
199
|
var frMultilevelList = from([
|
|
200
200
|
"D\xE9finir une nouvelle liste \xE0 plusieurs niveaux",
|
|
@@ -345,7 +345,7 @@ var enFontAdvanced = {
|
|
|
345
345
|
"Review advanced formatting in Print Layout.": "Review advanced formatting in Print Layout."
|
|
346
346
|
};
|
|
347
347
|
var values = (items) => Object.fromEntries(
|
|
348
|
-
Object.keys(enFontAdvanced).map((
|
|
348
|
+
Object.keys(enFontAdvanced).map((key3, index) => [key3, items[index]])
|
|
349
349
|
);
|
|
350
350
|
var frFontAdvanced = values([
|
|
351
351
|
"Param\xE8tres avanc\xE9s",
|
|
@@ -408,7 +408,7 @@ var labels = [
|
|
|
408
408
|
"Contextual Historical Discretional"
|
|
409
409
|
];
|
|
410
410
|
function translated(words) {
|
|
411
|
-
const basic = new Map(labels.slice(0, 6).map((
|
|
411
|
+
const basic = new Map(labels.slice(0, 6).map((key3, index) => [key3, words[index]]));
|
|
412
412
|
return Object.fromEntries(
|
|
413
413
|
labels.map((label2) => [
|
|
414
414
|
label2,
|
|
@@ -461,7 +461,7 @@ var enNavigation = {
|
|
|
461
461
|
"Apply a heading style to see document headings here.": "Apply a heading style to see document headings here."
|
|
462
462
|
};
|
|
463
463
|
var fromValues3 = (values2) => Object.fromEntries(
|
|
464
|
-
Object.keys(enNavigation).map((
|
|
464
|
+
Object.keys(enNavigation).map((key3, index) => [key3, values2[index]])
|
|
465
465
|
);
|
|
466
466
|
var frNavigation = fromValues3([
|
|
467
467
|
"Volet de navigation",
|
|
@@ -507,7 +507,7 @@ var enDropCap = {
|
|
|
507
507
|
"Lines to drop": "Lines to drop",
|
|
508
508
|
"Enter a font, 1 to 10 lines and a distance from 0 to 22 inches.": "Enter a font, 1 to 10 lines and a distance from 0 to 22 inches."
|
|
509
509
|
};
|
|
510
|
-
var fromValues4 = (values2) => Object.fromEntries(Object.keys(enDropCap).map((
|
|
510
|
+
var fromValues4 = (values2) => Object.fromEntries(Object.keys(enDropCap).map((key3, index) => [key3, values2[index]]));
|
|
511
511
|
var frDropCap = fromValues4([
|
|
512
512
|
"Options de lettrine",
|
|
513
513
|
"Options de lettrine\u2026",
|
|
@@ -547,7 +547,7 @@ var enLineNumbers = {
|
|
|
547
547
|
"Enter whole numbers from 1 to 32767 and a distance from 0 to 22 inches.": "Enter whole numbers from 1 to 32767 and a distance from 0 to 22 inches."
|
|
548
548
|
};
|
|
549
549
|
var fromValues5 = (values2) => Object.fromEntries(
|
|
550
|
-
Object.keys(enLineNumbers).map((
|
|
550
|
+
Object.keys(enLineNumbers).map((key3, index) => [key3, values2[index]])
|
|
551
551
|
);
|
|
552
552
|
var frLineNumbers = fromValues5([
|
|
553
553
|
"Ajouter la num\xE9rotation des lignes",
|
|
@@ -1474,7 +1474,6 @@ var deApp = {
|
|
|
1474
1474
|
"Save As": "Speichern unter",
|
|
1475
1475
|
"Save a copy of this document to your device.": "Speichern Sie eine Kopie dieses Dokuments auf Ihrem Ger\xE4t.",
|
|
1476
1476
|
"Word Document (*.docx)": "Word-Dokument (*.docx)",
|
|
1477
|
-
"Word 97-2003 Document (*.doc)": "Word 97-2003-Dokument (*.doc)",
|
|
1478
1477
|
"Paper size": "Papierformat",
|
|
1479
1478
|
"Printing uses the browser print dialog. Page breaks come from Print Layout, which approximates Word.": "Der Druck verwendet den Druckdialog des Browsers. Seitenumbr\xFCche stammen aus dem Seitenlayout, das Word nur ann\xE4hert.",
|
|
1480
1479
|
Export: "Exportieren",
|
|
@@ -1716,7 +1715,7 @@ var enTableProperties = {
|
|
|
1716
1715
|
"Enter a measurement within the displayed range.": "Enter a measurement within the displayed range."
|
|
1717
1716
|
};
|
|
1718
1717
|
var fromValues6 = (values2) => Object.fromEntries(
|
|
1719
|
-
Object.keys(enTableProperties).map((
|
|
1718
|
+
Object.keys(enTableProperties).map((key3, index) => [key3, values2[index]])
|
|
1720
1719
|
);
|
|
1721
1720
|
var frTableProperties = fromValues6([
|
|
1722
1721
|
"Propri\xE9t\xE9s du tableau",
|
|
@@ -2087,6 +2086,7 @@ var deRibbon = {
|
|
|
2087
2086
|
"Numbered list": "Nummerierung",
|
|
2088
2087
|
"Decrease list level": "Listenebene verringern",
|
|
2089
2088
|
"Increase list level": "Listenebene erh\xF6hen",
|
|
2089
|
+
"Picture bullet...": "Bildaufz\xE4hlungszeichen...",
|
|
2090
2090
|
"Remove list": "Liste entfernen",
|
|
2091
2091
|
"Insert row above": "Zeile oberhalb einf\xFCgen",
|
|
2092
2092
|
"Insert row below": "Zeile unterhalb einf\xFCgen",
|
|
@@ -2143,6 +2143,29 @@ var deRibbon = {
|
|
|
2143
2143
|
"Close search": "Suche schlie\xDFen",
|
|
2144
2144
|
"Search results": "Suchergebnisse",
|
|
2145
2145
|
"Enter text to search": "Suchtext eingeben",
|
|
2146
|
+
"Invalid search pattern": "Ung\xFCltiges Suchmuster",
|
|
2147
|
+
"More >>": "Mehr >>",
|
|
2148
|
+
"<< Less": "<< Weniger",
|
|
2149
|
+
"Search options": "Suchoptionen",
|
|
2150
|
+
"Find whole words only": "Nur ganze W\xF6rter suchen",
|
|
2151
|
+
"Use wildcards": "Platzhalter verwenden",
|
|
2152
|
+
"Match prefix": "Pr\xE4fix ber\xFCcksichtigen",
|
|
2153
|
+
"Match suffix": "Suffix ber\xFCcksichtigen",
|
|
2154
|
+
"Ignore punctuation characters": "Satzzeichen ignorieren",
|
|
2155
|
+
"Ignore white-space characters": "Leerraum ignorieren",
|
|
2156
|
+
"Special characters": "Sonderzeichen",
|
|
2157
|
+
"Paragraph Mark": "Absatzmarke",
|
|
2158
|
+
"Tab Character": "Tabstoppzeichen",
|
|
2159
|
+
"Any Character": "Beliebiges Zeichen",
|
|
2160
|
+
"Any Digit": "Beliebige Ziffer",
|
|
2161
|
+
"Any Letter": "Beliebiger Buchstabe",
|
|
2162
|
+
"Caret Character": "Caret-Zeichen",
|
|
2163
|
+
"Manual Line Break": "Manueller Zeilenumbruch",
|
|
2164
|
+
"Page Break": "Seitenwechsel",
|
|
2165
|
+
"Optional Hyphen": "Bedingter Trennstrich",
|
|
2166
|
+
"Nonbreaking Hyphen": "Gesch\xFCtzter Bindestrich",
|
|
2167
|
+
"Nonbreaking Space": "Gesch\xFCtztes Leerzeichen",
|
|
2168
|
+
"White Space": "Leerraum",
|
|
2146
2169
|
"No matches": "Keine Treffer",
|
|
2147
2170
|
"matches one": "Treffer",
|
|
2148
2171
|
"matches many": "Treffer",
|
|
@@ -2249,7 +2272,34 @@ var deRibbon = {
|
|
|
2249
2272
|
Finish: "Fertig stellen",
|
|
2250
2273
|
"Finish & Merge": "Fertig stellen und zusammenf\xFChren",
|
|
2251
2274
|
Help: "Hilfe",
|
|
2252
|
-
"Not available in this editor": "In diesem Editor nicht verf\xFCgbar"
|
|
2275
|
+
"Not available in this editor": "In diesem Editor nicht verf\xFCgbar",
|
|
2276
|
+
Protect: "Sch\xFCtzen",
|
|
2277
|
+
"Restrict editing": "Bearbeitung einschr\xE4nken",
|
|
2278
|
+
"Formatting restrictions": "Formatierungseinschr\xE4nkungen",
|
|
2279
|
+
"Limit formatting to a selection of styles": "Formatierung auf eine Auswahl von Formatvorlagen beschr\xE4nken",
|
|
2280
|
+
"Editing restrictions": "Bearbeitungseinschr\xE4nkungen",
|
|
2281
|
+
"Allow only this type of editing in the document": "Nur diese Art der Bearbeitung im Dokument zulassen",
|
|
2282
|
+
"No changes (Read only)": "Keine \xC4nderungen (schreibgesch\xFCtzt)",
|
|
2283
|
+
"Filling in forms": "Ausf\xFCllen von Formularen",
|
|
2284
|
+
"Exceptions (optional)": "Ausnahmen (optional)",
|
|
2285
|
+
Everyone: "Jeder",
|
|
2286
|
+
"Start enforcement": "Schutz anwenden",
|
|
2287
|
+
"Yes, start enforcing protection": "Ja, Schutz jetzt anwenden",
|
|
2288
|
+
"Enter new password (optional)": "Neues Kennwort eingeben (optional)",
|
|
2289
|
+
"Reenter password to confirm": "Kennwort zur Best\xE4tigung erneut eingeben",
|
|
2290
|
+
Password: "Kennwort",
|
|
2291
|
+
"Stop protection": "Schutz aufheben",
|
|
2292
|
+
"The document is protected": "Das Dokument ist gesch\xFCtzt",
|
|
2293
|
+
"The passwords do not match": "Die Kennw\xF6rter stimmen nicht \xFCberein",
|
|
2294
|
+
"Incorrect password": "Falsches Kennwort",
|
|
2295
|
+
"This protection uses a password that cannot be checked here": "Dieser Schutz verwendet ein Kennwort, das hier nicht gepr\xFCft werden kann",
|
|
2296
|
+
"Select text first": "Markieren Sie zuerst Text",
|
|
2297
|
+
"This exception continues into another paragraph; change it in Word": "Diese Ausnahme reicht in einen anderen Absatz; \xE4ndern Sie sie in Word",
|
|
2298
|
+
"Choose the type of editing to allow": "W\xE4hlen Sie die zul\xE4ssige Art der Bearbeitung",
|
|
2299
|
+
"Editing is restricted by document protection": "Die Bearbeitung ist durch den Dokumentschutz eingeschr\xE4nkt",
|
|
2300
|
+
"Highlight the regions I can edit": "Bereiche hervorheben, die ich bearbeiten kann",
|
|
2301
|
+
"Find next region I can edit": "N\xE4chsten Bereich suchen, den ich bearbeiten kann",
|
|
2302
|
+
"There are no regions you can edit": "Es gibt keine Bereiche, die Sie bearbeiten k\xF6nnen"
|
|
2253
2303
|
};
|
|
2254
2304
|
|
|
2255
2305
|
// src/docx/locales/de.ts
|
|
@@ -2308,7 +2358,6 @@ var enApp = {
|
|
|
2308
2358
|
"Save As": "Save As",
|
|
2309
2359
|
"Save a copy of this document to your device.": "Save a copy of this document to your device.",
|
|
2310
2360
|
"Word Document (*.docx)": "Word Document (*.docx)",
|
|
2311
|
-
"Word 97-2003 Document (*.doc)": "Word 97-2003 Document (*.doc)",
|
|
2312
2361
|
"Paper size": "Paper size",
|
|
2313
2362
|
"Printing uses the browser print dialog. Page breaks come from Print Layout, which approximates Word.": "Printing uses the browser print dialog. Page breaks come from Print Layout, which approximates Word.",
|
|
2314
2363
|
Export: "Export",
|
|
@@ -2791,6 +2840,7 @@ var enRibbon = {
|
|
|
2791
2840
|
"Numbered list": "Numbered list",
|
|
2792
2841
|
"Decrease list level": "Decrease list level",
|
|
2793
2842
|
"Increase list level": "Increase list level",
|
|
2843
|
+
"Picture bullet...": "Picture bullet...",
|
|
2794
2844
|
"Remove list": "Remove list",
|
|
2795
2845
|
"Insert row above": "Insert row above",
|
|
2796
2846
|
"Insert row below": "Insert row below",
|
|
@@ -2847,6 +2897,29 @@ var enRibbon = {
|
|
|
2847
2897
|
"Close search": "Close search",
|
|
2848
2898
|
"Search results": "Search results",
|
|
2849
2899
|
"Enter text to search": "Enter text to search",
|
|
2900
|
+
"Invalid search pattern": "Invalid search pattern",
|
|
2901
|
+
"More >>": "More >>",
|
|
2902
|
+
"<< Less": "<< Less",
|
|
2903
|
+
"Search options": "Search options",
|
|
2904
|
+
"Find whole words only": "Find whole words only",
|
|
2905
|
+
"Use wildcards": "Use wildcards",
|
|
2906
|
+
"Match prefix": "Match prefix",
|
|
2907
|
+
"Match suffix": "Match suffix",
|
|
2908
|
+
"Ignore punctuation characters": "Ignore punctuation characters",
|
|
2909
|
+
"Ignore white-space characters": "Ignore white-space characters",
|
|
2910
|
+
"Special characters": "Special characters",
|
|
2911
|
+
"Paragraph Mark": "Paragraph Mark",
|
|
2912
|
+
"Tab Character": "Tab Character",
|
|
2913
|
+
"Any Character": "Any Character",
|
|
2914
|
+
"Any Digit": "Any Digit",
|
|
2915
|
+
"Any Letter": "Any Letter",
|
|
2916
|
+
"Caret Character": "Caret Character",
|
|
2917
|
+
"Manual Line Break": "Manual Line Break",
|
|
2918
|
+
"Page Break": "Page Break",
|
|
2919
|
+
"Optional Hyphen": "Optional Hyphen",
|
|
2920
|
+
"Nonbreaking Hyphen": "Nonbreaking Hyphen",
|
|
2921
|
+
"Nonbreaking Space": "Nonbreaking Space",
|
|
2922
|
+
"White Space": "White Space",
|
|
2850
2923
|
"No matches": "0 matches",
|
|
2851
2924
|
"matches one": "match",
|
|
2852
2925
|
"matches many": "matches",
|
|
@@ -2953,7 +3026,34 @@ var enRibbon = {
|
|
|
2953
3026
|
Finish: "Finish",
|
|
2954
3027
|
"Finish & Merge": "Finish & Merge",
|
|
2955
3028
|
Help: "Help",
|
|
2956
|
-
"Not available in this editor": "Not available in this editor"
|
|
3029
|
+
"Not available in this editor": "Not available in this editor",
|
|
3030
|
+
Protect: "Protect",
|
|
3031
|
+
"Restrict editing": "Restrict editing",
|
|
3032
|
+
"Formatting restrictions": "Formatting restrictions",
|
|
3033
|
+
"Limit formatting to a selection of styles": "Limit formatting to a selection of styles",
|
|
3034
|
+
"Editing restrictions": "Editing restrictions",
|
|
3035
|
+
"Allow only this type of editing in the document": "Allow only this type of editing in the document",
|
|
3036
|
+
"No changes (Read only)": "No changes (Read only)",
|
|
3037
|
+
"Filling in forms": "Filling in forms",
|
|
3038
|
+
"Exceptions (optional)": "Exceptions (optional)",
|
|
3039
|
+
Everyone: "Everyone",
|
|
3040
|
+
"Start enforcement": "Start enforcement",
|
|
3041
|
+
"Yes, start enforcing protection": "Yes, start enforcing protection",
|
|
3042
|
+
"Enter new password (optional)": "Enter new password (optional)",
|
|
3043
|
+
"Reenter password to confirm": "Reenter password to confirm",
|
|
3044
|
+
Password: "Password",
|
|
3045
|
+
"Stop protection": "Stop protection",
|
|
3046
|
+
"The document is protected": "The document is protected",
|
|
3047
|
+
"The passwords do not match": "The passwords do not match",
|
|
3048
|
+
"Incorrect password": "Incorrect password",
|
|
3049
|
+
"This protection uses a password that cannot be checked here": "This protection uses a password that cannot be checked here",
|
|
3050
|
+
"Select text first": "Select text first",
|
|
3051
|
+
"This exception continues into another paragraph; change it in Word": "This exception continues into another paragraph; change it in Word",
|
|
3052
|
+
"Choose the type of editing to allow": "Choose the type of editing to allow",
|
|
3053
|
+
"Editing is restricted by document protection": "Editing is restricted by document protection",
|
|
3054
|
+
"Highlight the regions I can edit": "Highlight the regions I can edit",
|
|
3055
|
+
"Find next region I can edit": "Find next region I can edit",
|
|
3056
|
+
"There are no regions you can edit": "There are no regions you can edit"
|
|
2957
3057
|
};
|
|
2958
3058
|
|
|
2959
3059
|
// src/docx/locales/en.ts
|
|
@@ -3012,7 +3112,6 @@ var esApp = {
|
|
|
3012
3112
|
"Save As": "Guardar como",
|
|
3013
3113
|
"Save a copy of this document to your device.": "Guarde una copia de este documento en su dispositivo.",
|
|
3014
3114
|
"Word Document (*.docx)": "Documento de Word (*.docx)",
|
|
3015
|
-
"Word 97-2003 Document (*.doc)": "Documento de Word 97-2003 (*.doc)",
|
|
3016
3115
|
"Paper size": "Tama\xF1o del papel",
|
|
3017
3116
|
"Printing uses the browser print dialog. Page breaks come from Print Layout, which approximates Word.": "La impresi\xF3n usa el cuadro de di\xE1logo del navegador. Los saltos de p\xE1gina provienen del dise\xF1o de impresi\xF3n, que aproxima a Word.",
|
|
3018
3117
|
Export: "Exportar",
|
|
@@ -3495,6 +3594,7 @@ var esRibbon = {
|
|
|
3495
3594
|
"Numbered list": "Numeraci\xF3n",
|
|
3496
3595
|
"Decrease list level": "Disminuir nivel de lista",
|
|
3497
3596
|
"Increase list level": "Aumentar nivel de lista",
|
|
3597
|
+
"Picture bullet...": "Vi\xF1eta de imagen...",
|
|
3498
3598
|
"Remove list": "Quitar lista",
|
|
3499
3599
|
"Insert row above": "Insertar fila encima",
|
|
3500
3600
|
"Insert row below": "Insertar fila debajo",
|
|
@@ -3551,6 +3651,29 @@ var esRibbon = {
|
|
|
3551
3651
|
"Close search": "Cerrar b\xFAsqueda",
|
|
3552
3652
|
"Search results": "Resultados de la b\xFAsqueda",
|
|
3553
3653
|
"Enter text to search": "Escriba el texto que desea buscar",
|
|
3654
|
+
"Invalid search pattern": "Patr\xF3n de b\xFAsqueda no v\xE1lido",
|
|
3655
|
+
"More >>": "M\xE1s >>",
|
|
3656
|
+
"<< Less": "<< Menos",
|
|
3657
|
+
"Search options": "Opciones de b\xFAsqueda",
|
|
3658
|
+
"Find whole words only": "Buscar solo palabras completas",
|
|
3659
|
+
"Use wildcards": "Usar comodines",
|
|
3660
|
+
"Match prefix": "Coincidir con el prefijo",
|
|
3661
|
+
"Match suffix": "Coincidir con el sufijo",
|
|
3662
|
+
"Ignore punctuation characters": "Ignorar signos de puntuaci\xF3n",
|
|
3663
|
+
"Ignore white-space characters": "Ignorar espacios en blanco",
|
|
3664
|
+
"Special characters": "Caracteres especiales",
|
|
3665
|
+
"Paragraph Mark": "Marca de p\xE1rrafo",
|
|
3666
|
+
"Tab Character": "Car\xE1cter de tabulaci\xF3n",
|
|
3667
|
+
"Any Character": "Cualquier car\xE1cter",
|
|
3668
|
+
"Any Digit": "Cualquier d\xEDgito",
|
|
3669
|
+
"Any Letter": "Cualquier letra",
|
|
3670
|
+
"Caret Character": "Car\xE1cter de intercalaci\xF3n",
|
|
3671
|
+
"Manual Line Break": "Salto de l\xEDnea manual",
|
|
3672
|
+
"Page Break": "Salto de p\xE1gina",
|
|
3673
|
+
"Optional Hyphen": "Guion condicional",
|
|
3674
|
+
"Nonbreaking Hyphen": "Guion no separable",
|
|
3675
|
+
"Nonbreaking Space": "Espacio no separable",
|
|
3676
|
+
"White Space": "Espacio en blanco",
|
|
3554
3677
|
"No matches": "Sin coincidencias",
|
|
3555
3678
|
"matches one": "coincidencia",
|
|
3556
3679
|
"matches many": "coincidencias",
|
|
@@ -3657,7 +3780,34 @@ var esRibbon = {
|
|
|
3657
3780
|
Finish: "Finalizar",
|
|
3658
3781
|
"Finish & Merge": "Finalizar y combinar",
|
|
3659
3782
|
Help: "Ayuda",
|
|
3660
|
-
"Not available in this editor": "No disponible en este editor"
|
|
3783
|
+
"Not available in this editor": "No disponible en este editor",
|
|
3784
|
+
Protect: "Proteger",
|
|
3785
|
+
"Restrict editing": "Restringir edici\xF3n",
|
|
3786
|
+
"Formatting restrictions": "Restricciones de formato",
|
|
3787
|
+
"Limit formatting to a selection of styles": "Limitar el formato a una selecci\xF3n de estilos",
|
|
3788
|
+
"Editing restrictions": "Restricciones de edici\xF3n",
|
|
3789
|
+
"Allow only this type of editing in the document": "Permitir solo este tipo de edici\xF3n en el documento",
|
|
3790
|
+
"No changes (Read only)": "Sin cambios (solo lectura)",
|
|
3791
|
+
"Filling in forms": "Rellenar formularios",
|
|
3792
|
+
"Exceptions (optional)": "Excepciones (opcional)",
|
|
3793
|
+
Everyone: "Todos",
|
|
3794
|
+
"Start enforcement": "Comenzar a aplicar",
|
|
3795
|
+
"Yes, start enforcing protection": "S\xED, aplicar la protecci\xF3n",
|
|
3796
|
+
"Enter new password (optional)": "Escriba la nueva contrase\xF1a (opcional)",
|
|
3797
|
+
"Reenter password to confirm": "Vuelva a escribir la contrase\xF1a para confirmarla",
|
|
3798
|
+
Password: "Contrase\xF1a",
|
|
3799
|
+
"Stop protection": "Suspender protecci\xF3n",
|
|
3800
|
+
"The document is protected": "El documento est\xE1 protegido",
|
|
3801
|
+
"The passwords do not match": "Las contrase\xF1as no coinciden",
|
|
3802
|
+
"Incorrect password": "Contrase\xF1a incorrecta",
|
|
3803
|
+
"This protection uses a password that cannot be checked here": "Esta protecci\xF3n usa una contrase\xF1a que no se puede comprobar aqu\xED",
|
|
3804
|
+
"Select text first": "Seleccione primero el texto",
|
|
3805
|
+
"This exception continues into another paragraph; change it in Word": "Esta excepci\xF3n contin\xFAa en otro p\xE1rrafo; c\xE1mbiela en Word",
|
|
3806
|
+
"Choose the type of editing to allow": "Elija el tipo de edici\xF3n que se permite",
|
|
3807
|
+
"Editing is restricted by document protection": "La edici\xF3n est\xE1 restringida por la protecci\xF3n del documento",
|
|
3808
|
+
"Highlight the regions I can edit": "Resaltar las regiones que puedo editar",
|
|
3809
|
+
"Find next region I can edit": "Buscar la siguiente regi\xF3n que puedo editar",
|
|
3810
|
+
"There are no regions you can edit": "No hay regiones que pueda editar"
|
|
3661
3811
|
};
|
|
3662
3812
|
|
|
3663
3813
|
// src/docx/locales/es.ts
|
|
@@ -3716,7 +3866,6 @@ var frApp = {
|
|
|
3716
3866
|
"Save As": "Enregistrer sous",
|
|
3717
3867
|
"Save a copy of this document to your device.": "Enregistrez une copie de ce document sur votre appareil.",
|
|
3718
3868
|
"Word Document (*.docx)": "Document Word (*.docx)",
|
|
3719
|
-
"Word 97-2003 Document (*.doc)": "Document Word 97-2003 (*.doc)",
|
|
3720
3869
|
"Paper size": "Taille du papier",
|
|
3721
3870
|
"Printing uses the browser print dialog. Page breaks come from Print Layout, which approximates Word.": "L\u2019impression utilise la bo\xEEte de dialogue du navigateur. Les sauts de page viennent de la mise en page Impression, qui approche Word.",
|
|
3722
3871
|
Export: "Exporter",
|
|
@@ -4199,6 +4348,7 @@ var frRibbon = {
|
|
|
4199
4348
|
"Numbered list": "Liste num\xE9rot\xE9e",
|
|
4200
4349
|
"Decrease list level": "R\xE9duire le niveau de liste",
|
|
4201
4350
|
"Increase list level": "Augmenter le niveau de liste",
|
|
4351
|
+
"Picture bullet...": "Puce image...",
|
|
4202
4352
|
"Remove list": "Supprimer la liste",
|
|
4203
4353
|
"Insert row above": "Ins\xE9rer une ligne au-dessus",
|
|
4204
4354
|
"Insert row below": "Ins\xE9rer une ligne au-dessous",
|
|
@@ -4255,6 +4405,29 @@ var frRibbon = {
|
|
|
4255
4405
|
"Close search": "Fermer la recherche",
|
|
4256
4406
|
"Search results": "R\xE9sultats de recherche",
|
|
4257
4407
|
"Enter text to search": "Saisissez le texte \xE0 rechercher",
|
|
4408
|
+
"Invalid search pattern": "Mod\xE8le de recherche non valide",
|
|
4409
|
+
"More >>": "Plus >>",
|
|
4410
|
+
"<< Less": "<< Moins",
|
|
4411
|
+
"Search options": "Options de recherche",
|
|
4412
|
+
"Find whole words only": "Rechercher les mots entiers uniquement",
|
|
4413
|
+
"Use wildcards": "Utiliser les caract\xE8res g\xE9n\xE9riques",
|
|
4414
|
+
"Match prefix": "Respecter le pr\xE9fixe",
|
|
4415
|
+
"Match suffix": "Respecter le suffixe",
|
|
4416
|
+
"Ignore punctuation characters": "Ignorer la ponctuation",
|
|
4417
|
+
"Ignore white-space characters": "Ignorer les espaces",
|
|
4418
|
+
"Special characters": "Caract\xE8res sp\xE9ciaux",
|
|
4419
|
+
"Paragraph Mark": "Marque de paragraphe",
|
|
4420
|
+
"Tab Character": "Caract\xE8re de tabulation",
|
|
4421
|
+
"Any Character": "N'importe quel caract\xE8re",
|
|
4422
|
+
"Any Digit": "N'importe quel chiffre",
|
|
4423
|
+
"Any Letter": "N'importe quelle lettre",
|
|
4424
|
+
"Caret Character": "Accent circonflexe",
|
|
4425
|
+
"Manual Line Break": "Saut de ligne manuel",
|
|
4426
|
+
"Page Break": "Saut de page",
|
|
4427
|
+
"Optional Hyphen": "Trait d\u2019union conditionnel",
|
|
4428
|
+
"Nonbreaking Hyphen": "Trait d\u2019union ins\xE9cable",
|
|
4429
|
+
"Nonbreaking Space": "Espace ins\xE9cable",
|
|
4430
|
+
"White Space": "Espace blanc",
|
|
4258
4431
|
"No matches": "Aucun r\xE9sultat",
|
|
4259
4432
|
"matches one": "r\xE9sultat",
|
|
4260
4433
|
"matches many": "r\xE9sultats",
|
|
@@ -4361,7 +4534,34 @@ var frRibbon = {
|
|
|
4361
4534
|
Finish: "Terminer",
|
|
4362
4535
|
"Finish & Merge": "Terminer et fusionner",
|
|
4363
4536
|
Help: "Aide",
|
|
4364
|
-
"Not available in this editor": "Indisponible dans cet \xE9diteur"
|
|
4537
|
+
"Not available in this editor": "Indisponible dans cet \xE9diteur",
|
|
4538
|
+
Protect: "Prot\xE9ger",
|
|
4539
|
+
"Restrict editing": "Restreindre la modification",
|
|
4540
|
+
"Formatting restrictions": "Restrictions de mise en forme",
|
|
4541
|
+
"Limit formatting to a selection of styles": "Limiter la mise en forme \xE0 une s\xE9lection de styles",
|
|
4542
|
+
"Editing restrictions": "Restrictions de modification",
|
|
4543
|
+
"Allow only this type of editing in the document": "Autoriser uniquement ce type de modification dans le document",
|
|
4544
|
+
"No changes (Read only)": "Aucune modification (lecture seule)",
|
|
4545
|
+
"Filling in forms": "Remplissage de formulaires",
|
|
4546
|
+
"Exceptions (optional)": "Exceptions (facultatif)",
|
|
4547
|
+
Everyone: "Tout le monde",
|
|
4548
|
+
"Start enforcement": "D\xE9marrer l\u2019application",
|
|
4549
|
+
"Yes, start enforcing protection": "Oui, appliquer la protection",
|
|
4550
|
+
"Enter new password (optional)": "Entrez un nouveau mot de passe (facultatif)",
|
|
4551
|
+
"Reenter password to confirm": "Entrez \xE0 nouveau le mot de passe pour confirmer",
|
|
4552
|
+
Password: "Mot de passe",
|
|
4553
|
+
"Stop protection": "D\xE9sactiver la protection",
|
|
4554
|
+
"The document is protected": "Le document est prot\xE9g\xE9",
|
|
4555
|
+
"The passwords do not match": "Les mots de passe ne correspondent pas",
|
|
4556
|
+
"Incorrect password": "Mot de passe incorrect",
|
|
4557
|
+
"This protection uses a password that cannot be checked here": "Cette protection utilise un mot de passe qui ne peut pas \xEAtre v\xE9rifi\xE9 ici",
|
|
4558
|
+
"Select text first": "S\xE9lectionnez d\u2019abord du texte",
|
|
4559
|
+
"This exception continues into another paragraph; change it in Word": "Cette exception se poursuit dans un autre paragraphe ; modifiez-la dans Word",
|
|
4560
|
+
"Choose the type of editing to allow": "Choisissez le type de modification autoris\xE9",
|
|
4561
|
+
"Editing is restricted by document protection": "La modification est restreinte par la protection du document",
|
|
4562
|
+
"Highlight the regions I can edit": "Mettre en \xE9vidence les zones que je peux modifier",
|
|
4563
|
+
"Find next region I can edit": "Rechercher la prochaine zone que je peux modifier",
|
|
4564
|
+
"There are no regions you can edit": "Aucune zone ne peut \xEAtre modifi\xE9e par vous"
|
|
4365
4565
|
};
|
|
4366
4566
|
|
|
4367
4567
|
// src/docx/locales/fr.ts
|
|
@@ -4420,7 +4620,6 @@ var zhCNApp = {
|
|
|
4420
4620
|
"Save As": "\u53E6\u5B58\u4E3A",
|
|
4421
4621
|
"Save a copy of this document to your device.": "\u5C06\u6B64\u6587\u6863\u7684\u526F\u672C\u4FDD\u5B58\u5230\u60A8\u7684\u8BBE\u5907\u3002",
|
|
4422
4622
|
"Word Document (*.docx)": "Word \u6587\u6863 (*.docx)",
|
|
4423
|
-
"Word 97-2003 Document (*.doc)": "Word 97-2003 \u6587\u6863 (*.doc)",
|
|
4424
4623
|
"Paper size": "\u7EB8\u5F20\u5927\u5C0F",
|
|
4425
4624
|
"Printing uses the browser print dialog. Page breaks come from Print Layout, which approximates Word.": "\u6253\u5370\u4F7F\u7528\u6D4F\u89C8\u5668\u7684\u6253\u5370\u5BF9\u8BDD\u6846\u3002\u5206\u9875\u6765\u81EA\u9875\u9762\u89C6\u56FE\uFF0C\u5B83\u53EA\u662F\u8FD1\u4F3C Word \u7684\u5206\u9875\u3002",
|
|
4426
4625
|
Export: "\u5BFC\u51FA",
|
|
@@ -4903,6 +5102,7 @@ var zhCNRibbon = {
|
|
|
4903
5102
|
"Numbered list": "\u7F16\u53F7",
|
|
4904
5103
|
"Decrease list level": "\u964D\u4F4E\u5217\u8868\u7EA7\u522B",
|
|
4905
5104
|
"Increase list level": "\u63D0\u9AD8\u5217\u8868\u7EA7\u522B",
|
|
5105
|
+
"Picture bullet...": "\u56FE\u7247\u9879\u76EE\u7B26\u53F7...",
|
|
4906
5106
|
"Remove list": "\u5220\u9664\u5217\u8868",
|
|
4907
5107
|
"Insert row above": "\u5728\u4E0A\u65B9\u63D2\u5165\u884C",
|
|
4908
5108
|
"Insert row below": "\u5728\u4E0B\u65B9\u63D2\u5165\u884C",
|
|
@@ -4959,6 +5159,29 @@ var zhCNRibbon = {
|
|
|
4959
5159
|
"Close search": "\u5173\u95ED\u641C\u7D22",
|
|
4960
5160
|
"Search results": "\u641C\u7D22\u7ED3\u679C",
|
|
4961
5161
|
"Enter text to search": "\u8BF7\u8F93\u5165\u8981\u641C\u7D22\u7684\u6587\u672C",
|
|
5162
|
+
"Invalid search pattern": "\u641C\u7D22\u6A21\u5F0F\u65E0\u6548",
|
|
5163
|
+
"More >>": "\u66F4\u591A >>",
|
|
5164
|
+
"<< Less": "<< \u6536\u8D77",
|
|
5165
|
+
"Search options": "\u641C\u7D22\u9009\u9879",
|
|
5166
|
+
"Find whole words only": "\u4EC5\u67E5\u627E\u5B8C\u6574\u5355\u8BCD",
|
|
5167
|
+
"Use wildcards": "\u4F7F\u7528\u901A\u914D\u7B26",
|
|
5168
|
+
"Match prefix": "\u5339\u914D\u524D\u7F00",
|
|
5169
|
+
"Match suffix": "\u5339\u914D\u540E\u7F00",
|
|
5170
|
+
"Ignore punctuation characters": "\u5FFD\u7565\u6807\u70B9\u7B26\u53F7",
|
|
5171
|
+
"Ignore white-space characters": "\u5FFD\u7565\u7A7A\u767D\u5B57\u7B26",
|
|
5172
|
+
"Special characters": "\u7279\u6B8A\u5B57\u7B26",
|
|
5173
|
+
"Paragraph Mark": "\u6BB5\u843D\u6807\u8BB0",
|
|
5174
|
+
"Tab Character": "\u5236\u8868\u7B26",
|
|
5175
|
+
"Any Character": "\u4EFB\u610F\u5B57\u7B26",
|
|
5176
|
+
"Any Digit": "\u4EFB\u610F\u6570\u5B57",
|
|
5177
|
+
"Any Letter": "\u4EFB\u610F\u5B57\u6BCD",
|
|
5178
|
+
"Caret Character": "\u63D2\u5165\u7B26",
|
|
5179
|
+
"Manual Line Break": "\u624B\u52A8\u6362\u884C\u7B26",
|
|
5180
|
+
"Page Break": "\u5206\u9875\u7B26",
|
|
5181
|
+
"Optional Hyphen": "\u53EF\u9009\u8FDE\u5B57\u7B26",
|
|
5182
|
+
"Nonbreaking Hyphen": "\u4E0D\u95F4\u65AD\u8FDE\u5B57\u7B26",
|
|
5183
|
+
"Nonbreaking Space": "\u4E0D\u95F4\u65AD\u7A7A\u683C",
|
|
5184
|
+
"White Space": "\u7A7A\u767D\u5B57\u7B26",
|
|
4962
5185
|
"No matches": "\u65E0\u5339\u914D\u9879",
|
|
4963
5186
|
"matches one": "\u4E2A\u5339\u914D\u9879",
|
|
4964
5187
|
"matches many": "\u4E2A\u5339\u914D\u9879",
|
|
@@ -5065,7 +5288,34 @@ var zhCNRibbon = {
|
|
|
5065
5288
|
Finish: "\u5B8C\u6210",
|
|
5066
5289
|
"Finish & Merge": "\u5B8C\u6210\u5E76\u5408\u5E76",
|
|
5067
5290
|
Help: "\u5E2E\u52A9",
|
|
5068
|
-
"Not available in this editor": "\u6B64\u7F16\u8F91\u5668\u5C1A\u4E0D\u652F\u6301"
|
|
5291
|
+
"Not available in this editor": "\u6B64\u7F16\u8F91\u5668\u5C1A\u4E0D\u652F\u6301",
|
|
5292
|
+
Protect: "\u4FDD\u62A4",
|
|
5293
|
+
"Restrict editing": "\u9650\u5236\u7F16\u8F91",
|
|
5294
|
+
"Formatting restrictions": "\u683C\u5F0F\u8BBE\u7F6E\u9650\u5236",
|
|
5295
|
+
"Limit formatting to a selection of styles": "\u9650\u5236\u5BF9\u9009\u5B9A\u7684\u6837\u5F0F\u8BBE\u7F6E\u683C\u5F0F",
|
|
5296
|
+
"Editing restrictions": "\u7F16\u8F91\u9650\u5236",
|
|
5297
|
+
"Allow only this type of editing in the document": "\u4EC5\u5141\u8BB8\u5728\u6587\u6863\u4E2D\u8FDB\u884C\u6B64\u7C7B\u578B\u7684\u7F16\u8F91",
|
|
5298
|
+
"No changes (Read only)": "\u4E0D\u5141\u8BB8\u4EFB\u4F55\u66F4\u6539(\u53EA\u8BFB)",
|
|
5299
|
+
"Filling in forms": "\u586B\u5199\u7A97\u4F53",
|
|
5300
|
+
"Exceptions (optional)": "\u4F8B\u5916\u9879(\u53EF\u9009)",
|
|
5301
|
+
Everyone: "\u6BCF\u4E2A\u4EBA",
|
|
5302
|
+
"Start enforcement": "\u542F\u52A8\u5F3A\u5236\u4FDD\u62A4",
|
|
5303
|
+
"Yes, start enforcing protection": "\u662F,\u542F\u52A8\u5F3A\u5236\u4FDD\u62A4",
|
|
5304
|
+
"Enter new password (optional)": "\u8F93\u5165\u65B0\u5BC6\u7801(\u53EF\u9009)",
|
|
5305
|
+
"Reenter password to confirm": "\u786E\u8BA4\u65B0\u5BC6\u7801",
|
|
5306
|
+
Password: "\u5BC6\u7801",
|
|
5307
|
+
"Stop protection": "\u505C\u6B62\u4FDD\u62A4",
|
|
5308
|
+
"The document is protected": "\u6587\u6863\u5DF2\u53D7\u4FDD\u62A4",
|
|
5309
|
+
"The passwords do not match": "\u4E24\u6B21\u8F93\u5165\u7684\u5BC6\u7801\u4E0D\u4E00\u81F4",
|
|
5310
|
+
"Incorrect password": "\u5BC6\u7801\u4E0D\u6B63\u786E",
|
|
5311
|
+
"This protection uses a password that cannot be checked here": "\u6B64\u4FDD\u62A4\u4F7F\u7528\u7684\u5BC6\u7801\u65E0\u6CD5\u5728\u6B64\u5904\u68C0\u67E5",
|
|
5312
|
+
"Select text first": "\u8BF7\u5148\u9009\u62E9\u6587\u672C",
|
|
5313
|
+
"This exception continues into another paragraph; change it in Word": "\u6B64\u4F8B\u5916\u9879\u5EF6\u7EED\u5230\u53E6\u4E00\u4E2A\u6BB5\u843D,\u8BF7\u5728 Word \u4E2D\u66F4\u6539",
|
|
5314
|
+
"Choose the type of editing to allow": "\u8BF7\u9009\u62E9\u5141\u8BB8\u7684\u7F16\u8F91\u7C7B\u578B",
|
|
5315
|
+
"Editing is restricted by document protection": "\u6587\u6863\u4FDD\u62A4\u9650\u5236\u4E86\u7F16\u8F91",
|
|
5316
|
+
"Highlight the regions I can edit": "\u7A81\u51FA\u663E\u793A\u6211\u53EF\u4EE5\u7F16\u8F91\u7684\u533A\u57DF",
|
|
5317
|
+
"Find next region I can edit": "\u67E5\u627E\u6211\u53EF\u4EE5\u7F16\u8F91\u7684\u4E0B\u4E00\u4E2A\u533A\u57DF",
|
|
5318
|
+
"There are no regions you can edit": "\u6CA1\u6709\u60A8\u53EF\u4EE5\u7F16\u8F91\u7684\u533A\u57DF"
|
|
5069
5319
|
};
|
|
5070
5320
|
|
|
5071
5321
|
// src/docx/locales/zh-CN.ts
|
|
@@ -5096,11 +5346,11 @@ var EDITOR_LOCALES = SUPPORTED_OFFICE_LOCALES;
|
|
|
5096
5346
|
function normalizeEditorLocale(value) {
|
|
5097
5347
|
return normalizeLocale(value, EDITOR_LOCALES, "en");
|
|
5098
5348
|
}
|
|
5099
|
-
function translate(locale,
|
|
5100
|
-
return strings[locale][
|
|
5349
|
+
function translate(locale, key3) {
|
|
5350
|
+
return strings[locale][key3] ?? strings.en[key3] ?? key3;
|
|
5101
5351
|
}
|
|
5102
|
-
function translateTemplate(locale,
|
|
5103
|
-
return interpolate(translate(locale,
|
|
5352
|
+
function translateTemplate(locale, key3, values2) {
|
|
5353
|
+
return interpolate(translate(locale, key3), values2);
|
|
5104
5354
|
}
|
|
5105
5355
|
function translateDynamic(locale, text) {
|
|
5106
5356
|
if (locale === "en") return text;
|
|
@@ -5231,14 +5481,14 @@ function parse(spec) {
|
|
|
5231
5481
|
let result = parsed.get(spec);
|
|
5232
5482
|
if (result) return result;
|
|
5233
5483
|
const parts = spec.split("+");
|
|
5234
|
-
const
|
|
5484
|
+
const key3 = (parts.pop() ?? "").toLowerCase();
|
|
5235
5485
|
const modifiers = new Set(parts.map((part) => part.toLowerCase()));
|
|
5236
5486
|
result = {
|
|
5237
5487
|
mod: modifiers.has("mod"),
|
|
5238
5488
|
shift: modifiers.has("shift"),
|
|
5239
5489
|
alt: modifiers.has("alt"),
|
|
5240
|
-
key:
|
|
5241
|
-
tap:
|
|
5490
|
+
key: key3,
|
|
5491
|
+
tap: key3 === "alt" && !modifiers.size
|
|
5242
5492
|
};
|
|
5243
5493
|
parsed.set(spec, result);
|
|
5244
5494
|
return result;
|
|
@@ -5592,6 +5842,7 @@ var paths = {
|
|
|
5592
5842
|
firstPage: "M6 3h9l3 3v15H6z M9 8h6 M9 12h6 M9 16h3",
|
|
5593
5843
|
oddEven: "M3 5h8v14H3z M13 5h8v14h-8z M6 9h2 M16 9h2",
|
|
5594
5844
|
track: "M4 20l4-1 11-11-3-3L5 16z M14 20h7",
|
|
5845
|
+
protect: "M7 11V8a5 5 0 0 1 10 0v3 M5 11h14v10H5z M12 15v2",
|
|
5595
5846
|
previous: "M6 14l6-6 6 6",
|
|
5596
5847
|
next: "M6 10l6 6 6-6",
|
|
5597
5848
|
accept: "M5 12.5l4.5 4.5L19 7",
|
|
@@ -6051,7 +6302,7 @@ var NS2 = "http://www.w3.org/2000/svg";
|
|
|
6051
6302
|
var inches = (twips7) => `${+(twips7 / 1440).toFixed(2)}"`;
|
|
6052
6303
|
function shape(name, attrs) {
|
|
6053
6304
|
const el = document.createElementNS(NS2, name);
|
|
6054
|
-
for (const [
|
|
6305
|
+
for (const [key3, value] of Object.entries(attrs)) el.setAttribute(key3, String(value));
|
|
6055
6306
|
return el;
|
|
6056
6307
|
}
|
|
6057
6308
|
function page(w, h, ...body) {
|
|
@@ -6302,17 +6553,18 @@ function underlineSplit() {
|
|
|
6302
6553
|
(value) => ({ type: "underline", value })
|
|
6303
6554
|
);
|
|
6304
6555
|
}
|
|
6305
|
-
function listSplit(
|
|
6306
|
-
const label2 =
|
|
6307
|
-
const icon2 =
|
|
6556
|
+
function listSplit(key3) {
|
|
6557
|
+
const label2 = key3 === "bullet" ? "Bulleted list" : "Numbered list";
|
|
6558
|
+
const icon2 = key3 === "bullet" ? "bullets" : "numbering";
|
|
6308
6559
|
return split(
|
|
6309
|
-
tool(label2, icon2, { type: "list", key:
|
|
6310
|
-
|
|
6560
|
+
tool(label2, icon2, { type: "list", key: key3 }),
|
|
6561
|
+
key3 === "bullet" ? "Bullets options" : "Numbering options",
|
|
6311
6562
|
[
|
|
6312
|
-
[
|
|
6563
|
+
[key3, label2],
|
|
6564
|
+
...key3 === "bullet" ? [["picture", "Picture bullet..."]] : [],
|
|
6313
6565
|
["remove", "Remove list"]
|
|
6314
6566
|
],
|
|
6315
|
-
(value) =>
|
|
6567
|
+
(value) => value === "picture" ? { type: "pictureBullet" } : { type: "list", key: value }
|
|
6316
6568
|
);
|
|
6317
6569
|
}
|
|
6318
6570
|
|
|
@@ -6811,19 +7063,19 @@ function showCommandTips(root, panel, onDone) {
|
|
|
6811
7063
|
}
|
|
6812
7064
|
|
|
6813
7065
|
// src/docx/ribbon-tab-api.ts
|
|
6814
|
-
function panelOf(ribbon,
|
|
6815
|
-
return ribbon.querySelector(`[data-ribbon-tab="${
|
|
7066
|
+
function panelOf(ribbon, key3) {
|
|
7067
|
+
return ribbon.querySelector(`[data-ribbon-tab="${key3}"]`);
|
|
6816
7068
|
}
|
|
6817
7069
|
function panelsOf(ribbon) {
|
|
6818
7070
|
return [...ribbon.children].filter(
|
|
6819
7071
|
(child) => child instanceof HTMLElement && !!child.dataset.ribbonTab
|
|
6820
7072
|
);
|
|
6821
7073
|
}
|
|
6822
|
-
function selectTab(ribbon,
|
|
6823
|
-
ribbon.selected =
|
|
7074
|
+
function selectTab(ribbon, key3) {
|
|
7075
|
+
ribbon.selected = key3;
|
|
6824
7076
|
}
|
|
6825
|
-
function setTabHidden(ribbon,
|
|
6826
|
-
ribbon.setTabHidden(
|
|
7077
|
+
function setTabHidden(ribbon, key3, reason, hidden) {
|
|
7078
|
+
ribbon.setTabHidden(key3, reason, hidden);
|
|
6827
7079
|
}
|
|
6828
7080
|
var isTabHidden = (panel) => panel.hasAttribute("data-tab-hidden");
|
|
6829
7081
|
function tabButtons(ribbon) {
|
|
@@ -6864,15 +7116,15 @@ function attachRibbonBehavior(root) {
|
|
|
6864
7116
|
panel: tab.dataset.tab
|
|
6865
7117
|
}))
|
|
6866
7118
|
];
|
|
6867
|
-
const badges = targets.flatMap(({ tab, key:
|
|
6868
|
-
if (!
|
|
7119
|
+
const badges = targets.flatMap(({ tab, key: key3, panel }) => {
|
|
7120
|
+
if (!key3) return [];
|
|
6869
7121
|
const badge = document.createElement("span");
|
|
6870
7122
|
badge.className = "dve-keytip";
|
|
6871
7123
|
badge.style.cssText = BADGE_STYLE;
|
|
6872
|
-
badge.textContent =
|
|
7124
|
+
badge.textContent = key3;
|
|
6873
7125
|
badge.setAttribute("aria-hidden", "true");
|
|
6874
7126
|
tab.append(badge);
|
|
6875
|
-
return [{ badge, key:
|
|
7127
|
+
return [{ badge, key: key3, tab, panel }];
|
|
6876
7128
|
});
|
|
6877
7129
|
const stop = () => {
|
|
6878
7130
|
for (const { badge } of badges) badge.remove();
|
|
@@ -6883,7 +7135,7 @@ function attachRibbonBehavior(root) {
|
|
|
6883
7135
|
};
|
|
6884
7136
|
const onKey = (event) => {
|
|
6885
7137
|
if (event.key === "Alt" || event.key === "Shift") return;
|
|
6886
|
-
const match = badges.find(({ key:
|
|
7138
|
+
const match = badges.find(({ key: key3 }) => key3 === event.key.toUpperCase());
|
|
6887
7139
|
stop();
|
|
6888
7140
|
if (!match || event.ctrlKey || event.metaKey) return;
|
|
6889
7141
|
event.preventDefault();
|
|
@@ -7109,6 +7361,8 @@ var schema = new Schema({
|
|
|
7109
7361
|
tabStops: { default: null },
|
|
7110
7362
|
/** Read-only bookmark names starting in this paragraph; not user-editable. */
|
|
7111
7363
|
bookmarks: { default: [] },
|
|
7364
|
+
/** Editable ranges (`w:permStart`/`w:permEnd`) in this paragraph; read-only. */
|
|
7365
|
+
permissions: { default: null },
|
|
7112
7366
|
/** Block-level content control (`w:sdt`) around this paragraph, as an object. */
|
|
7113
7367
|
contentControl: { default: null }
|
|
7114
7368
|
},
|
|
@@ -7266,16 +7520,16 @@ var schema = new Schema({
|
|
|
7266
7520
|
},
|
|
7267
7521
|
marks: markSpecs
|
|
7268
7522
|
});
|
|
7269
|
-
function languageMarkAttrs(mark,
|
|
7523
|
+
function languageMarkAttrs(mark, key3, value) {
|
|
7270
7524
|
const attrs = {
|
|
7271
7525
|
language: mark?.attrs.language ?? null,
|
|
7272
7526
|
eastAsiaLanguage: mark?.attrs.eastAsiaLanguage ?? null,
|
|
7273
7527
|
bidiLanguage: mark?.attrs.bidiLanguage ?? null
|
|
7274
7528
|
};
|
|
7275
|
-
attrs[
|
|
7529
|
+
attrs[key3] = value || null;
|
|
7276
7530
|
return attrs;
|
|
7277
7531
|
}
|
|
7278
|
-
function applyLanguage(view,
|
|
7532
|
+
function applyLanguage(view, key3, value) {
|
|
7279
7533
|
const tag = value.trim();
|
|
7280
7534
|
if (tag && !isValidLanguageTag(tag)) return;
|
|
7281
7535
|
const { state } = view;
|
|
@@ -7283,7 +7537,7 @@ function applyLanguage(view, key2, value) {
|
|
|
7283
7537
|
if (state.selection.empty) {
|
|
7284
7538
|
const marks2 = state.storedMarks || state.selection.$from.marks();
|
|
7285
7539
|
const existing = marks2.find((mark) => mark.type === type);
|
|
7286
|
-
const attrs = languageMarkAttrs(existing,
|
|
7540
|
+
const attrs = languageMarkAttrs(existing, key3, tag);
|
|
7287
7541
|
const next = Object.values(attrs).some(Boolean) ? type.create(attrs) : void 0;
|
|
7288
7542
|
view.dispatch(
|
|
7289
7543
|
state.tr.setStoredMarks([
|
|
@@ -7299,7 +7553,7 @@ function applyLanguage(view, key2, value) {
|
|
|
7299
7553
|
const start2 = Math.max(pos, state.selection.from);
|
|
7300
7554
|
const end2 = Math.min(pos + node.nodeSize, state.selection.to);
|
|
7301
7555
|
const existing = node.marks.find((mark) => mark.type === type);
|
|
7302
|
-
const attrs = languageMarkAttrs(existing,
|
|
7556
|
+
const attrs = languageMarkAttrs(existing, key3, tag);
|
|
7303
7557
|
const next = Object.values(attrs).some(Boolean) ? type.create(attrs) : void 0;
|
|
7304
7558
|
transaction = transaction.removeMark(start2, end2, type);
|
|
7305
7559
|
if (next) transaction = transaction.addMark(start2, end2, next);
|
|
@@ -7373,7 +7627,7 @@ var languageOptions = [
|
|
|
7373
7627
|
function emit2(control, detail2) {
|
|
7374
7628
|
emit(control, "ribbon-action", detail2);
|
|
7375
7629
|
}
|
|
7376
|
-
function languageControl(label2,
|
|
7630
|
+
function languageControl(label2, key3) {
|
|
7377
7631
|
const wrapper = document.createElement("label");
|
|
7378
7632
|
wrapper.className = "multilingual-language-control";
|
|
7379
7633
|
const visibleLabel = document.createElement("span");
|
|
@@ -7391,7 +7645,7 @@ function languageControl(label2, key2) {
|
|
|
7391
7645
|
const input = wrapper.querySelector("input");
|
|
7392
7646
|
input.value = "";
|
|
7393
7647
|
input.setCustomValidity("");
|
|
7394
|
-
emit2(wrapper, { type: "language", key:
|
|
7648
|
+
emit2(wrapper, { type: "language", key: key3, value: select2.value });
|
|
7395
7649
|
});
|
|
7396
7650
|
const custom = document.createElement("input");
|
|
7397
7651
|
custom.type = "text";
|
|
@@ -7410,7 +7664,7 @@ function languageControl(label2, key2) {
|
|
|
7410
7664
|
}
|
|
7411
7665
|
custom.setCustomValidity("");
|
|
7412
7666
|
select2.value = "";
|
|
7413
|
-
emit2(wrapper, { type: "language", key:
|
|
7667
|
+
emit2(wrapper, { type: "language", key: key3, value });
|
|
7414
7668
|
});
|
|
7415
7669
|
wrapper.append(visibleLabel, select2, custom);
|
|
7416
7670
|
return wrapper;
|
|
@@ -7511,10 +7765,10 @@ function syncMultilingualControls(toolbar, state) {
|
|
|
7511
7765
|
["eastAsiaLanguage", "East Asian language"],
|
|
7512
7766
|
["bidiLanguage", "Complex script language"]
|
|
7513
7767
|
];
|
|
7514
|
-
for (const [
|
|
7768
|
+
for (const [key3, label2] of languageKeys) {
|
|
7515
7769
|
const values2 = marks2.map((items) => {
|
|
7516
7770
|
const mark = items.find((item) => item.type === schema.marks.language);
|
|
7517
|
-
return mark?.attrs[
|
|
7771
|
+
return mark?.attrs[key3] ?? null;
|
|
7518
7772
|
});
|
|
7519
7773
|
const value = commonValue(values2);
|
|
7520
7774
|
setSelectValue(
|
|
@@ -7586,7 +7840,11 @@ function createReviewControls() {
|
|
|
7586
7840
|
tool("Next comment", "next", { type: "comments", key: "next" }, big),
|
|
7587
7841
|
tool("Comments", "comments", { type: "comments", key: "toggle" }, big)
|
|
7588
7842
|
);
|
|
7589
|
-
|
|
7843
|
+
const protect = group2(
|
|
7844
|
+
"Protect",
|
|
7845
|
+
tool("Restrict editing", "protect", { type: "formatDialog", kind: "restrictEditing" }, big)
|
|
7846
|
+
);
|
|
7847
|
+
return [tracking, changes, comments, protect];
|
|
7590
7848
|
}
|
|
7591
7849
|
|
|
7592
7850
|
// src/docx/insert-text-commands.ts
|
|
@@ -8762,7 +9020,7 @@ function smartArtFormatGallery(kind) {
|
|
|
8762
9020
|
}
|
|
8763
9021
|
function syncSmartArtFormatGalleries(root, disabled, colorsId, styleId) {
|
|
8764
9022
|
const locale = normalizeEditorLocale(root.dataset.editorLocale);
|
|
8765
|
-
const t = (
|
|
9023
|
+
const t = (key3) => translate(locale, key3);
|
|
8766
9024
|
for (const gallery of root.querySelectorAll("[data-smartart-format]")) {
|
|
8767
9025
|
const state = gallery.dataset.smartartFormat === "colors" ? smartArtColorsGalleryState(
|
|
8768
9026
|
{},
|
|
@@ -8783,7 +9041,7 @@ function syncSmartArtFormatGalleries(root, disabled, colorsId, styleId) {
|
|
|
8783
9041
|
|
|
8784
9042
|
// src/docx/smartart-design-ribbon.ts
|
|
8785
9043
|
var ADD_SHAPE = DIAGRAM_ADD_SHAPE_COMMANDS.map((c) => [c.key, c.label]);
|
|
8786
|
-
var label = (
|
|
9044
|
+
var label = (key3) => DIAGRAM_DESIGN_COMMANDS.find((command) => command.key === key3)?.label ?? key3;
|
|
8787
9045
|
function buildSmartArtDesignPanel(panel) {
|
|
8788
9046
|
panel.append(
|
|
8789
9047
|
group(
|
|
@@ -8939,13 +9197,13 @@ function createRibbon(locale = "en") {
|
|
|
8939
9197
|
"SmartArt Design",
|
|
8940
9198
|
"Chart Design"
|
|
8941
9199
|
]) {
|
|
8942
|
-
const
|
|
9200
|
+
const key3 = name === "Header & Footer" ? "header-footer" : name.toLowerCase().replace(/ /g, "-");
|
|
8943
9201
|
const panel = document.createElement("div");
|
|
8944
9202
|
panel.className = "ribbon-panel";
|
|
8945
|
-
panel.dataset.ribbonTab =
|
|
9203
|
+
panel.dataset.ribbonTab = key3;
|
|
8946
9204
|
panel.dataset.label = name;
|
|
8947
9205
|
panel.dataset.panel = name;
|
|
8948
|
-
panel.id = `dve-panel-${
|
|
9206
|
+
panel.id = `dve-panel-${key3}`;
|
|
8949
9207
|
panel.tabIndex = 0;
|
|
8950
9208
|
if (["Table", "Header & Footer", "Shape Format", "Chart Design", "SmartArt Design"].includes(name))
|
|
8951
9209
|
panel.dataset.contextual = "";
|
|
@@ -8959,8 +9217,8 @@ function createRibbon(locale = "en") {
|
|
|
8959
9217
|
buildSmartArtDesignPanel(panels.get("SmartArt Design"));
|
|
8960
9218
|
buildChartDesignPanel(panels.get("Chart Design"));
|
|
8961
9219
|
for (const panel of panels.values()) root.append(panel);
|
|
8962
|
-
for (const
|
|
8963
|
-
setTabHidden(root,
|
|
9220
|
+
for (const key3 of ["table", "header-footer", "shape-format", "chart-design", "smartart-design"])
|
|
9221
|
+
setTabHidden(root, key3, "contextual", true);
|
|
8964
9222
|
setComboValue(root.querySelector('[aria-label="Font family"]'), "Calibri");
|
|
8965
9223
|
setComboValue(root.querySelector('[aria-label="Font size"]'), "11");
|
|
8966
9224
|
root.querySelector('[aria-label="Zoom"]').value = "100";
|
|
@@ -9047,14 +9305,14 @@ function slotsOf(table) {
|
|
|
9047
9305
|
const cell = cells[next++];
|
|
9048
9306
|
if (!cell) break;
|
|
9049
9307
|
const span = Number(cell.attrs.colspan) || 1;
|
|
9050
|
-
const
|
|
9051
|
-
slots.push({ row: r, col, span, cell, offset: 0, key:
|
|
9308
|
+
const key3 = String(cell.attrs.sourceCellKey || "");
|
|
9309
|
+
slots.push({ row: r, col, span, cell, offset: 0, key: key3 });
|
|
9052
9310
|
const rowspan = Number(cell.attrs.rowspan) || 1;
|
|
9053
9311
|
const names = keysOf(cell);
|
|
9054
9312
|
for (let k = 1; k < rowspan; k++)
|
|
9055
9313
|
pending.set(r + k, [
|
|
9056
9314
|
...pending.get(r + k) ?? [],
|
|
9057
|
-
{ row: r + k, col, span, cell, offset: k, key: names[k - 1] ?? `${
|
|
9315
|
+
{ row: r + k, col, span, cell, offset: k, key: names[k - 1] ?? `${key3}~${k}` }
|
|
9058
9316
|
]);
|
|
9059
9317
|
col += span;
|
|
9060
9318
|
}
|
|
@@ -9133,7 +9391,7 @@ function paragraphNode(model, known) {
|
|
|
9133
9391
|
if (existing) return existing;
|
|
9134
9392
|
const attrs = { id: model.id };
|
|
9135
9393
|
const source = model;
|
|
9136
|
-
for (const
|
|
9394
|
+
for (const key3 of FORMAT_KEYS) if (source[key3] !== void 0) attrs[key3] = source[key3];
|
|
9137
9395
|
return schema.nodes.paragraph.create(attrs);
|
|
9138
9396
|
}
|
|
9139
9397
|
function nodeFromResult(old, result) {
|
|
@@ -9703,7 +9961,7 @@ function docToModel(doc, prior, previousDoc) {
|
|
|
9703
9961
|
if (!runs.length) runs.push({ text: "" });
|
|
9704
9962
|
const id = String(node.attrs.id || `p-edit-${++nextId}`);
|
|
9705
9963
|
const previous = previousParagraphs.get(id);
|
|
9706
|
-
if (previous && (previous.sourceParagraphPropertiesXml ?? null) === (node.attrs.sourceParagraphPropertiesXml ?? null) && (previous.restoredParagraphPropertiesXml ?? null) === (node.attrs.restoredParagraphPropertiesXml ?? null) && sameJson(previous.markRevision ?? null, node.attrs.markRevision ?? null) && sameJson(previous.formatRevision ?? null, node.attrs.formatRevision ?? null) && sameRuns(previous.runs, runs) && previous.align === (node.attrs.align ?? void 0) && previous.justification === (node.attrs.justification ?? void 0) && previous.outlineLevel === (node.attrs.outlineLevel ?? void 0) && previous.direction === (node.attrs.direction ?? void 0) && (previous.style || "") === (node.attrs.style || "") && previous.spacingBeforeTwips === (node.attrs.spacingBeforeTwips ?? void 0) && previous.spacingAfterTwips === (node.attrs.spacingAfterTwips ?? void 0) && previous.lineSpacingTwips === (node.attrs.lineSpacingTwips ?? void 0) && previous.lineSpacingRule === (node.attrs.lineSpacingRule ?? void 0) && previous.indentLeftTwips === (node.attrs.indentLeftTwips ?? void 0) && previous.indentRightTwips === (node.attrs.indentRightTwips ?? void 0) && previous.indentStartTwips === (node.attrs.indentStartTwips ?? void 0) && previous.indentEndTwips === (node.attrs.indentEndTwips ?? void 0) && previous.firstLineTwips === (node.attrs.firstLineTwips ?? void 0) && previous.hangingTwips === (node.attrs.hangingTwips ?? void 0) && (previous.numbering?.numId ?? null) === (node.attrs.numId ?? null) && (previous.numbering ? previous.numbering.level : null) === (node.attrs.ilvl ?? null) && (previous.pageBreakBefore ?? null) === node.attrs.pageBreakBefore && sameJson(previous.tabStops ?? null, node.attrs.tabStops ?? null) && PARAGRAPH_KEEP_KEYS.every((
|
|
9964
|
+
if (previous && (previous.sourceParagraphPropertiesXml ?? null) === (node.attrs.sourceParagraphPropertiesXml ?? null) && (previous.restoredParagraphPropertiesXml ?? null) === (node.attrs.restoredParagraphPropertiesXml ?? null) && sameJson(previous.markRevision ?? null, node.attrs.markRevision ?? null) && sameJson(previous.formatRevision ?? null, node.attrs.formatRevision ?? null) && sameRuns(previous.runs, runs) && previous.align === (node.attrs.align ?? void 0) && previous.justification === (node.attrs.justification ?? void 0) && previous.outlineLevel === (node.attrs.outlineLevel ?? void 0) && previous.direction === (node.attrs.direction ?? void 0) && (previous.style || "") === (node.attrs.style || "") && previous.spacingBeforeTwips === (node.attrs.spacingBeforeTwips ?? void 0) && previous.spacingAfterTwips === (node.attrs.spacingAfterTwips ?? void 0) && previous.lineSpacingTwips === (node.attrs.lineSpacingTwips ?? void 0) && previous.lineSpacingRule === (node.attrs.lineSpacingRule ?? void 0) && previous.indentLeftTwips === (node.attrs.indentLeftTwips ?? void 0) && previous.indentRightTwips === (node.attrs.indentRightTwips ?? void 0) && previous.indentStartTwips === (node.attrs.indentStartTwips ?? void 0) && previous.indentEndTwips === (node.attrs.indentEndTwips ?? void 0) && previous.firstLineTwips === (node.attrs.firstLineTwips ?? void 0) && previous.hangingTwips === (node.attrs.hangingTwips ?? void 0) && (previous.numbering?.numId ?? null) === (node.attrs.numId ?? null) && (previous.numbering ? previous.numbering.level : null) === (node.attrs.ilvl ?? null) && (previous.pageBreakBefore ?? null) === node.attrs.pageBreakBefore && sameJson(previous.tabStops ?? null, node.attrs.tabStops ?? null) && PARAGRAPH_KEEP_KEYS.every((key3) => (previous[key3] ?? null) === (node.attrs[key3] ?? null)) && sameJson(previous.dropCap ?? null, node.attrs.dropCap ?? null) && sameJson(previous.borders ?? null, node.attrs.borders ?? null) && (previous.shadingFill ?? null) === (node.attrs.shadingFill ?? null) && sameJson(previous.bookmarks ?? [], node.attrs.bookmarks ?? []) && sameJson(previous.permissions ?? null, node.attrs.permissions ?? null) && sameJson(previous.contentControl ?? null, node.attrs.contentControl ?? null))
|
|
9707
9965
|
return previous;
|
|
9708
9966
|
return paragraphFromAttrs(node.attrs, id, runs);
|
|
9709
9967
|
};
|
|
@@ -9821,25 +10079,25 @@ function createCanvasMeasurer() {
|
|
|
9821
10079
|
};
|
|
9822
10080
|
const fontString = (font) => `${font.italic ? "italic " : ""}${font.bold ? "bold " : ""}${font.sizePx}px ${cssFontStack(font.family)}`;
|
|
9823
10081
|
const metricsOf = (c, font) => {
|
|
9824
|
-
const
|
|
9825
|
-
const cached = metricCache.get(
|
|
10082
|
+
const key3 = fontString(font);
|
|
10083
|
+
const cached = metricCache.get(key3);
|
|
9826
10084
|
if (cached) return cached;
|
|
9827
|
-
c.font =
|
|
10085
|
+
c.font = key3;
|
|
9828
10086
|
const measured = c.measureText("Mg");
|
|
9829
10087
|
const metrics = {
|
|
9830
10088
|
ascent: measured.fontBoundingBoxAscent ?? font.sizePx * 0.95,
|
|
9831
10089
|
height: measured.fontBoundingBoxAscent !== void 0 && measured.fontBoundingBoxDescent !== void 0 ? measured.fontBoundingBoxAscent + measured.fontBoundingBoxDescent : font.sizePx * 1.22
|
|
9832
10090
|
};
|
|
9833
10091
|
if (metricCache.size >= 256) metricCache.delete(metricCache.keys().next().value);
|
|
9834
|
-
metricCache.set(
|
|
10092
|
+
metricCache.set(key3, metrics);
|
|
9835
10093
|
return metrics;
|
|
9836
10094
|
};
|
|
9837
10095
|
return {
|
|
9838
10096
|
widthOf(text, font) {
|
|
9839
10097
|
const c = ctx();
|
|
9840
10098
|
if (!c) return fallback.widthOf(text, font);
|
|
9841
|
-
const
|
|
9842
|
-
const cached = widthCache.get(
|
|
10099
|
+
const key3 = `${fontString(font)}\0${font.kerning ?? "auto"}\0${font.ligatures ?? "auto"}\0${font.smallCaps ?? false}\0${text}`;
|
|
10100
|
+
const cached = widthCache.get(key3);
|
|
9843
10101
|
if (cached !== void 0) return cached;
|
|
9844
10102
|
c.font = fontString(font);
|
|
9845
10103
|
c.fontKerning = font.kerning ?? "auto";
|
|
@@ -9861,7 +10119,7 @@ function createCanvasMeasurer() {
|
|
|
9861
10119
|
}
|
|
9862
10120
|
}
|
|
9863
10121
|
if (widthCache.size >= 2e4) widthCache.delete(widthCache.keys().next().value);
|
|
9864
|
-
widthCache.set(
|
|
10122
|
+
widthCache.set(key3, width);
|
|
9865
10123
|
return width;
|
|
9866
10124
|
},
|
|
9867
10125
|
ascentOf(font) {
|
|
@@ -10420,8 +10678,8 @@ function setDropCap(view, style, options) {
|
|
|
10420
10678
|
return true;
|
|
10421
10679
|
}
|
|
10422
10680
|
var toggleFormat = createToggleFormat(schema, styleModelOf);
|
|
10423
|
-
function applyFont(view,
|
|
10424
|
-
const patch =
|
|
10681
|
+
function applyFont(view, key3, value) {
|
|
10682
|
+
const patch = key3 === "family" ? { fontFamily: value } : key3 === "size" ? { fontSize: Number(value) } : { color: value };
|
|
10425
10683
|
applyRunFormattingPatch(patch)(view.state, view.dispatch, view);
|
|
10426
10684
|
}
|
|
10427
10685
|
function clearFormatting(view) {
|
|
@@ -10459,11 +10717,11 @@ function insertTable(view, idGenerator, size = {}) {
|
|
|
10459
10717
|
);
|
|
10460
10718
|
view.dispatch(closeHistory(view.state.tr.replaceSelectionWith(table)).scrollIntoView());
|
|
10461
10719
|
}
|
|
10462
|
-
function updateParagraphs(view,
|
|
10720
|
+
function updateParagraphs(view, key3, value) {
|
|
10463
10721
|
const { state } = view;
|
|
10464
|
-
if (
|
|
10722
|
+
if (key3 === "lineSpacing") {
|
|
10465
10723
|
if (value !== "inherit" && !parseLineSpacingValue(value)) return;
|
|
10466
|
-
} else if (
|
|
10724
|
+
} else if (key3 !== "indent" && value !== "inherit" && (!Number.isFinite(Number(value)) || Number(value) < 0))
|
|
10467
10725
|
return;
|
|
10468
10726
|
const positions = [];
|
|
10469
10727
|
state.doc.nodesBetween(state.selection.from, state.selection.to, (node, pos) => {
|
|
@@ -10475,7 +10733,7 @@ function updateParagraphs(view, key2, value) {
|
|
|
10475
10733
|
for (const pos of positions) {
|
|
10476
10734
|
const node = transaction.doc.nodeAt(pos);
|
|
10477
10735
|
if (!node) continue;
|
|
10478
|
-
if (
|
|
10736
|
+
if (key3 === "indent") {
|
|
10479
10737
|
const logical = node.attrs.indentStartTwips != null;
|
|
10480
10738
|
const attr = logical ? "indentStartTwips" : "indentLeftTwips";
|
|
10481
10739
|
const current2 = Number(node.attrs[attr] ?? 0);
|
|
@@ -10484,12 +10742,12 @@ function updateParagraphs(view, key2, value) {
|
|
|
10484
10742
|
...node.attrs,
|
|
10485
10743
|
[attr]: next
|
|
10486
10744
|
});
|
|
10487
|
-
} else if (
|
|
10745
|
+
} else if (key3 === "spacingAfter") {
|
|
10488
10746
|
transaction = transaction.setNodeMarkup(pos, void 0, {
|
|
10489
10747
|
...node.attrs,
|
|
10490
10748
|
spacingAfterTwips: value === "inherit" ? null : twipsAttr(Number(value)) ?? null
|
|
10491
10749
|
});
|
|
10492
|
-
} else if (
|
|
10750
|
+
} else if (key3 === "spacingBefore") {
|
|
10493
10751
|
transaction = transaction.setNodeMarkup(pos, void 0, {
|
|
10494
10752
|
...node.attrs,
|
|
10495
10753
|
spacingBeforeTwips: value === "inherit" ? null : twipsAttr(Number(value)) ?? null
|
|
@@ -11313,13 +11571,20 @@ function applyCustomList(view, model, levels) {
|
|
|
11313
11571
|
return created.numId;
|
|
11314
11572
|
});
|
|
11315
11573
|
}
|
|
11316
|
-
function
|
|
11317
|
-
|
|
11318
|
-
|
|
11319
|
-
|
|
11320
|
-
|
|
11574
|
+
function applyPictureBulletList(view, model, picture) {
|
|
11575
|
+
toggleList(view, false, () => {
|
|
11576
|
+
const created = createPictureBulletList(model.numberingCatalog, picture);
|
|
11577
|
+
model.numberingCatalog = created.catalog;
|
|
11578
|
+
return created.numId;
|
|
11579
|
+
});
|
|
11580
|
+
}
|
|
11581
|
+
function runListAction(view, key3, model) {
|
|
11582
|
+
if (key3 === "remove") removeList(view);
|
|
11583
|
+
else if (key3 === "increaseLevel") changeListLevel(view, 1);
|
|
11584
|
+
else if (key3 === "decreaseLevel") changeListLevel(view, -1);
|
|
11585
|
+
else if (isHeadingListKind(key3)) {
|
|
11321
11586
|
toggleList(view, false, () => {
|
|
11322
|
-
const levels = headingListLevels(
|
|
11587
|
+
const levels = headingListLevels(key3).map(
|
|
11323
11588
|
(level) => model.paragraphStyles?.styles[level.paragraphStyleId] ? level : (({ paragraphStyleId: _removed, ...rest }) => rest)(level)
|
|
11324
11589
|
);
|
|
11325
11590
|
const created = createListDefinition(model.numberingCatalog, levels);
|
|
@@ -11328,14 +11593,14 @@ function runListAction(view, key2, model) {
|
|
|
11328
11593
|
if (linked) model.paragraphStyles = linked;
|
|
11329
11594
|
return created.numId;
|
|
11330
11595
|
});
|
|
11331
|
-
} else if (
|
|
11596
|
+
} else if (key3 === "multilevel" || key3 === "outline") {
|
|
11332
11597
|
toggleList(view, false, () => {
|
|
11333
|
-
const created = ensureListDefinition(model.numberingCatalog,
|
|
11598
|
+
const created = ensureListDefinition(model.numberingCatalog, key3);
|
|
11334
11599
|
model.numberingCatalog = created.catalog;
|
|
11335
11600
|
return created.numId;
|
|
11336
11601
|
});
|
|
11337
11602
|
} else {
|
|
11338
|
-
const kind =
|
|
11603
|
+
const kind = key3 === "bullet" ? "bullet" : "decimal";
|
|
11339
11604
|
const already = selectionIsListKind(view, kind, model.numberingCatalog);
|
|
11340
11605
|
toggleList(view, already, () => {
|
|
11341
11606
|
const created = ensureListDefinition(model.numberingCatalog, kind);
|
|
@@ -11524,7 +11789,7 @@ function applyCellBorderSettings(view, settings) {
|
|
|
11524
11789
|
if (!view.editable || !ctx) return false;
|
|
11525
11790
|
const rect = settings.scope === "table" ? wholeTable(ctx) : ctx.rect;
|
|
11526
11791
|
const edits = [];
|
|
11527
|
-
for (const [
|
|
11792
|
+
for (const [key3, preset] of [
|
|
11528
11793
|
["top", "top"],
|
|
11529
11794
|
["bottom", "bottom"],
|
|
11530
11795
|
["left", "left"],
|
|
@@ -11533,7 +11798,7 @@ function applyCellBorderSettings(view, settings) {
|
|
|
11533
11798
|
["insideV", "insideV"]
|
|
11534
11799
|
])
|
|
11535
11800
|
for (const edge of edgesOf(preset, rect))
|
|
11536
|
-
edits.push({ ...edge, pen: settings.sides[
|
|
11801
|
+
edits.push({ ...edge, pen: settings.sides[key3] ? settings.pen : null });
|
|
11537
11802
|
return applyEdits(
|
|
11538
11803
|
view,
|
|
11539
11804
|
ctx,
|
|
@@ -11547,9 +11812,9 @@ function readCellBorderSettings(state, scope) {
|
|
|
11547
11812
|
const rect = scope === "table" ? wholeTable(ctx) : ctx.rect;
|
|
11548
11813
|
const sides2 = {};
|
|
11549
11814
|
let pen;
|
|
11550
|
-
for (const
|
|
11551
|
-
const edges = edgesOf(
|
|
11552
|
-
sides2[
|
|
11815
|
+
for (const key3 of ["top", "bottom", "left", "right", "insideH", "insideV"]) {
|
|
11816
|
+
const edges = edgesOf(key3, rect);
|
|
11817
|
+
sides2[key3] = edges.length > 0 && edges.every((edge) => {
|
|
11553
11818
|
const side = current(ctx, state, edge.row, edge.column)[edge.side];
|
|
11554
11819
|
if (visible(side) && !pen)
|
|
11555
11820
|
pen = {
|
|
@@ -11610,8 +11875,8 @@ var editorBindings = {
|
|
|
11610
11875
|
};
|
|
11611
11876
|
function editorKeymap(showSearch) {
|
|
11612
11877
|
const shortcuts = Object.fromEntries(
|
|
11613
|
-
Object.entries({ ...baseKeymap, ...editorBindings }).map(([
|
|
11614
|
-
|
|
11878
|
+
Object.entries({ ...baseKeymap, ...editorBindings }).map(([key3, command]) => [
|
|
11879
|
+
key3,
|
|
11615
11880
|
editable(command)
|
|
11616
11881
|
])
|
|
11617
11882
|
);
|
|
@@ -11882,9 +12147,9 @@ function operate2(view, el) {
|
|
|
11882
12147
|
});
|
|
11883
12148
|
return true;
|
|
11884
12149
|
}
|
|
11885
|
-
function keyEdits(view,
|
|
12150
|
+
function keyEdits(view, key3) {
|
|
11886
12151
|
let tr;
|
|
11887
|
-
if (
|
|
12152
|
+
if (key3 === " ") tr = view.state.tr.insertText(" ");
|
|
11888
12153
|
else splitBlock(view.state, (split2) => tr = split2);
|
|
11889
12154
|
return Boolean(tr) && view.state.plugins.every(
|
|
11890
12155
|
(plugin) => plugin.spec.filterTransaction?.call(plugin, tr, view.state) ?? true
|
|
@@ -11930,7 +12195,23 @@ function formFieldViewPlugin(model) {
|
|
|
11930
12195
|
}
|
|
11931
12196
|
});
|
|
11932
12197
|
}
|
|
11933
|
-
var key = new PluginKey("
|
|
12198
|
+
var key = new PluginKey("docx-editable-regions");
|
|
12199
|
+
function editableRegionViewPlugin(protection, user, enabled = () => true) {
|
|
12200
|
+
return new Plugin({
|
|
12201
|
+
key,
|
|
12202
|
+
props: {
|
|
12203
|
+
decorations(state) {
|
|
12204
|
+
const restriction = editRestrictionOf(protection());
|
|
12205
|
+
if (!restriction || restriction === "trackedChanges" || !enabled()) return null;
|
|
12206
|
+
const decorations2 = editableRanges(state, user()).filter((range) => range.to > range.from).map(
|
|
12207
|
+
(range) => Decoration.inline(range.from, range.to, { class: "dve-editable-region" })
|
|
12208
|
+
);
|
|
12209
|
+
return decorations2.length ? DecorationSet.create(state.doc, decorations2) : null;
|
|
12210
|
+
}
|
|
12211
|
+
}
|
|
12212
|
+
});
|
|
12213
|
+
}
|
|
12214
|
+
var key2 = new PluginKey("dve-tab-stops");
|
|
11934
12215
|
var MAX_PASSES = 4;
|
|
11935
12216
|
var stopsOf = (paragraph2) => (paragraph2.attrs.tabStops ?? []).map((stop) => ({
|
|
11936
12217
|
posPx: stop.posTwips / 15,
|
|
@@ -12011,12 +12292,12 @@ function sameBoxes(set, boxes, state) {
|
|
|
12011
12292
|
}
|
|
12012
12293
|
function tabStopsPlugin() {
|
|
12013
12294
|
return new Plugin({
|
|
12014
|
-
key,
|
|
12295
|
+
key: key2,
|
|
12015
12296
|
state: {
|
|
12016
12297
|
init: () => DecorationSet.empty,
|
|
12017
|
-
apply: (tr, set) => tr.getMeta(
|
|
12298
|
+
apply: (tr, set) => tr.getMeta(key2) ?? set.map(tr.mapping, tr.doc)
|
|
12018
12299
|
},
|
|
12019
|
-
props: { decorations: (state) =>
|
|
12300
|
+
props: { decorations: (state) => key2.getState(state) },
|
|
12020
12301
|
view(view) {
|
|
12021
12302
|
let frame = 0;
|
|
12022
12303
|
let passes = 0;
|
|
@@ -12029,11 +12310,11 @@ function tabStopsPlugin() {
|
|
|
12029
12310
|
} catch {
|
|
12030
12311
|
return;
|
|
12031
12312
|
}
|
|
12032
|
-
const set =
|
|
12313
|
+
const set = key2.getState(view.state) ?? DecorationSet.empty;
|
|
12033
12314
|
if (sameBoxes(set, boxes, view.state)) return;
|
|
12034
12315
|
passes++;
|
|
12035
12316
|
view.dispatch(
|
|
12036
|
-
view.state.tr.setMeta(
|
|
12317
|
+
view.state.tr.setMeta(key2, decorations(view.state, boxes)).setMeta("addToHistory", false)
|
|
12037
12318
|
);
|
|
12038
12319
|
};
|
|
12039
12320
|
const schedule = () => {
|
|
@@ -12045,7 +12326,7 @@ function tabStopsPlugin() {
|
|
|
12045
12326
|
update(next, previous) {
|
|
12046
12327
|
const changed = next.state.doc !== previous.doc;
|
|
12047
12328
|
if (changed) passes = 0;
|
|
12048
|
-
if (changed ||
|
|
12329
|
+
if (changed || key2.getState(next.state) !== key2.getState(previous)) schedule();
|
|
12049
12330
|
},
|
|
12050
12331
|
destroy() {
|
|
12051
12332
|
if (frame) cancelAnimationFrame(frame);
|
|
@@ -12070,8 +12351,8 @@ function referenceFormatting(model, kind) {
|
|
|
12070
12351
|
};
|
|
12071
12352
|
}
|
|
12072
12353
|
function insertNote(view, model, kind) {
|
|
12073
|
-
const
|
|
12074
|
-
const id = nextNoteId(model[
|
|
12354
|
+
const key3 = kind === "footnote" ? "footnotes" : "endnotes";
|
|
12355
|
+
const id = nextNoteId(model[key3]);
|
|
12075
12356
|
const formatting = referenceFormatting(model, kind);
|
|
12076
12357
|
const textStyle = STYLES[kind].text;
|
|
12077
12358
|
const paragraph2 = {
|
|
@@ -12082,7 +12363,7 @@ function insertNote(view, model, kind) {
|
|
|
12082
12363
|
};
|
|
12083
12364
|
const next = {
|
|
12084
12365
|
...model,
|
|
12085
|
-
[
|
|
12366
|
+
[key3]: [...model[key3] ?? [], { id, blocks: [paragraph2] }]
|
|
12086
12367
|
};
|
|
12087
12368
|
const reference = schema.nodes.noteReference.create({
|
|
12088
12369
|
kind,
|
|
@@ -12119,7 +12400,7 @@ function noteNumberingPlugin() {
|
|
|
12119
12400
|
}
|
|
12120
12401
|
});
|
|
12121
12402
|
}
|
|
12122
|
-
function listMarkerDisplay(node, paragraph2, label2, model, measurer) {
|
|
12403
|
+
function listMarkerDisplay(node, paragraph2, label2, model, measurer, pictureUrl) {
|
|
12123
12404
|
if (!label2 || paragraph2.direction === "rtl")
|
|
12124
12405
|
return { css: "", attributes: { "data-list-marker": "" } };
|
|
12125
12406
|
const runs = [];
|
|
@@ -12141,7 +12422,10 @@ function listMarkerDisplay(node, paragraph2, label2, model, measurer) {
|
|
|
12141
12422
|
const text = displayListLabel(label2.text);
|
|
12142
12423
|
const color = own?.color ?? format.color ?? (format.colorTheme && model.theme ? resolveThemeColorReference(format.colorTheme, model.theme) : void 0);
|
|
12143
12424
|
const safeColor2 = color && /^#[0-9a-f]{6}$/i.test(color) ? color : "inherit";
|
|
12144
|
-
const
|
|
12425
|
+
const picture = label2.picture;
|
|
12426
|
+
const url = picture && pictureUrl?.(picture.partName, picture.contentType);
|
|
12427
|
+
const size = picture && url ? pictureBulletSizePt(picture, font.sizePx * 3 / 4) : void 0;
|
|
12428
|
+
const width = size ? size.widthPt * 4 / 3 : measurer.widthOf(text, font);
|
|
12145
12429
|
const indent = (paragraph2.indentStartTwips ?? paragraph2.indentLeftTwips ?? label2.indentLeftTwips ?? 0) / 15;
|
|
12146
12430
|
const ownFirst = paragraph2.hangingTwips !== void 0 || paragraph2.firstLineTwips !== void 0;
|
|
12147
12431
|
const hanging = ownFirst ? paragraph2.hangingTwips : label2.hangingTwips;
|
|
@@ -12161,8 +12445,11 @@ function listMarkerDisplay(node, paragraph2, label2, model, measurer) {
|
|
|
12161
12445
|
body = custom ? custom.posTwips / 15 : indent > end2 + 0.5 ? indent : (Math.floor(end2 / 48) + 1) * 48;
|
|
12162
12446
|
}
|
|
12163
12447
|
return {
|
|
12164
|
-
attributes: {
|
|
12165
|
-
|
|
12448
|
+
attributes: {
|
|
12449
|
+
"data-list-marker": text,
|
|
12450
|
+
...size ? { "data-list-marker-picture": "" } : {}
|
|
12451
|
+
},
|
|
12452
|
+
css: `${size && url ? `--dve-marker-image:url("${url.replace(/"/g, "%22")}");--dve-marker-pic-w:${size.widthPt * 4 / 3}px;--dve-marker-pic-h:${size.heightPt * 4 / 3}px;` : ""}position:relative;text-indent:${body - indent}px;--dve-marker-left:${anchor - width * factor - indent}px;--dve-marker-family:${cssFontStack(font.family)};--dve-marker-size:${font.sizePx}px;--dve-marker-weight:${font.bold ? "bold" : "normal"};--dve-marker-style:${font.italic ? "italic" : "normal"};--dve-marker-color:${safeColor2}`
|
|
12166
12453
|
};
|
|
12167
12454
|
}
|
|
12168
12455
|
|
|
@@ -12271,9 +12558,9 @@ function markSelectedTiles(root, selected, disabled) {
|
|
|
12271
12558
|
}
|
|
12272
12559
|
}
|
|
12273
12560
|
function syncStyleGallery(gallery, styles, selected, model, choose, disabled) {
|
|
12274
|
-
const
|
|
12275
|
-
if (gallery.dataset.key !==
|
|
12276
|
-
gallery.dataset.key =
|
|
12561
|
+
const key3 = JSON.stringify(styles);
|
|
12562
|
+
if (gallery.dataset.key !== key3) {
|
|
12563
|
+
gallery.dataset.key = key3;
|
|
12277
12564
|
gallery.replaceChildren(
|
|
12278
12565
|
...styles.map((style) => createStyleTile(style, model, "paragraph", choose))
|
|
12279
12566
|
);
|
|
@@ -12288,7 +12575,7 @@ function createStylesPane(onClose) {
|
|
|
12288
12575
|
element.className = "dve-styles-pane";
|
|
12289
12576
|
element.setAttribute("role", "complementary");
|
|
12290
12577
|
element.hidden = true;
|
|
12291
|
-
let
|
|
12578
|
+
let key3 = "";
|
|
12292
12579
|
let locale = "en";
|
|
12293
12580
|
const close3 = () => {
|
|
12294
12581
|
element.hidden = true;
|
|
@@ -12318,8 +12605,8 @@ function createStylesPane(onClose) {
|
|
|
12318
12605
|
data.selectedCharacter,
|
|
12319
12606
|
data.disabled
|
|
12320
12607
|
]);
|
|
12321
|
-
const listsChanged = signature !==
|
|
12322
|
-
|
|
12608
|
+
const listsChanged = signature !== key3;
|
|
12609
|
+
key3 = signature;
|
|
12323
12610
|
if (listsChanged) {
|
|
12324
12611
|
const header = document.createElement("div");
|
|
12325
12612
|
header.className = "dve-styles-pane-header";
|
|
@@ -12635,7 +12922,7 @@ function resetStylePicker(toolbar) {
|
|
|
12635
12922
|
}
|
|
12636
12923
|
|
|
12637
12924
|
// src/docx/paragraph-styles.ts
|
|
12638
|
-
function paragraphStylesPlugin(getModel, getMode = () => "all") {
|
|
12925
|
+
function paragraphStylesPlugin(getModel, getMode = () => "all", pictureUrl) {
|
|
12639
12926
|
let measurer = scaleMeasurer();
|
|
12640
12927
|
const cache = new DecorationCache();
|
|
12641
12928
|
const projections = new AttributeCache();
|
|
@@ -12688,6 +12975,7 @@ function paragraphStylesPlugin(getModel, getMode = () => "all") {
|
|
|
12688
12975
|
mode,
|
|
12689
12976
|
measurer,
|
|
12690
12977
|
JSON.stringify(label2),
|
|
12978
|
+
pictureUrl,
|
|
12691
12979
|
label2 ? node.firstChild : void 0
|
|
12692
12980
|
];
|
|
12693
12981
|
const rendered = attributes.resolve(node.attrs, dependencies, () => {
|
|
@@ -12700,7 +12988,8 @@ function paragraphStylesPlugin(getModel, getMode = () => "all") {
|
|
|
12700
12988
|
{ ...paragraph2, ...effective },
|
|
12701
12989
|
label2,
|
|
12702
12990
|
model,
|
|
12703
|
-
measurer
|
|
12991
|
+
measurer,
|
|
12992
|
+
pictureUrl
|
|
12704
12993
|
);
|
|
12705
12994
|
const list = label2 ? {
|
|
12706
12995
|
listIndentLeftTwips: label2.indentLeftTwips ?? null,
|
|
@@ -12835,6 +13124,15 @@ function bodyPlugins(host) {
|
|
|
12835
13124
|
contentControlPlugin(),
|
|
12836
13125
|
contentControlViewPlugin(),
|
|
12837
13126
|
formFieldGuardPlugin(() => host.model().protection),
|
|
13127
|
+
editRestrictionPlugin(
|
|
13128
|
+
() => host.model().protection,
|
|
13129
|
+
() => host.reviewAuthor()
|
|
13130
|
+
),
|
|
13131
|
+
editableRegionViewPlugin(
|
|
13132
|
+
() => host.model().protection,
|
|
13133
|
+
() => host.reviewAuthor(),
|
|
13134
|
+
() => host.highlightEditableRegions?.() ?? true
|
|
13135
|
+
),
|
|
12838
13136
|
formFieldViewPlugin(() => host.model()),
|
|
12839
13137
|
symbolFontPlugin(),
|
|
12840
13138
|
positionalTabInputPlugin(),
|
|
@@ -12850,11 +13148,12 @@ function bodyPlugins(host) {
|
|
|
12850
13148
|
),
|
|
12851
13149
|
paragraphStylesPlugin(
|
|
12852
13150
|
() => host.model(),
|
|
12853
|
-
() => host.reviewDisplayMode()
|
|
13151
|
+
() => host.reviewDisplayMode(),
|
|
13152
|
+
(partName, contentType) => host.pictureUrl?.(partName, contentType)
|
|
12854
13153
|
),
|
|
12855
13154
|
trackChangesPlugin(
|
|
12856
13155
|
() => host.reviewAuthor(),
|
|
12857
|
-
() => Boolean(host.model().trackChanges),
|
|
13156
|
+
() => Boolean(host.model().trackChanges) || forcesTrackChanges(host.model().protection),
|
|
12858
13157
|
host.revisionIds
|
|
12859
13158
|
),
|
|
12860
13159
|
reviewDisplayPlugin(() => host.reviewDisplayMode()),
|
|
@@ -13287,7 +13586,9 @@ function renderDocument(core) {
|
|
|
13287
13586
|
doc: yjs?.doc ?? modelToDoc(core.model),
|
|
13288
13587
|
plugins: bodyPlugins({
|
|
13289
13588
|
model: () => core.model,
|
|
13589
|
+
pictureUrl: (partName, contentType) => core.imageMedia.urlFor(partName, contentType),
|
|
13290
13590
|
reviewAuthor: () => core.reviewAuthor,
|
|
13591
|
+
highlightEditableRegions: () => core.highlightEditableRegions,
|
|
13291
13592
|
reviewDisplayMode: () => core.reviewDisplayMode,
|
|
13292
13593
|
insertNote: (kind) => core.parts.insertNote(kind, canvas, paper),
|
|
13293
13594
|
// ProseMirror's Mod-f reaches here before the shortcut registry: honour `find: false`.
|
|
@@ -13643,7 +13944,7 @@ function setSelectedChartLegend(view, value) {
|
|
|
13643
13944
|
|
|
13644
13945
|
// src/docx/chart-sheet-labels.ts
|
|
13645
13946
|
function sheetLabels(locale) {
|
|
13646
|
-
const t = (
|
|
13947
|
+
const t = (key3) => translate(locale, `chart.sheet.${key3}`);
|
|
13647
13948
|
return {
|
|
13648
13949
|
heading: t("heading"),
|
|
13649
13950
|
addCategory: t("addCategory"),
|
|
@@ -14015,10 +14316,10 @@ function batchFontFormat(view, apply2) {
|
|
|
14015
14316
|
scroll ||= transaction.scrolledIntoView;
|
|
14016
14317
|
};
|
|
14017
14318
|
const draft = new Proxy(view, {
|
|
14018
|
-
get(target,
|
|
14019
|
-
if (
|
|
14020
|
-
if (
|
|
14021
|
-
return Reflect.get(target,
|
|
14319
|
+
get(target, key3) {
|
|
14320
|
+
if (key3 === "state") return state;
|
|
14321
|
+
if (key3 === "dispatch") return dispatch;
|
|
14322
|
+
return Reflect.get(target, key3, target);
|
|
14022
14323
|
}
|
|
14023
14324
|
});
|
|
14024
14325
|
apply2(draft);
|
|
@@ -14112,17 +14413,17 @@ function readFontFormat(state) {
|
|
|
14112
14413
|
}
|
|
14113
14414
|
return result;
|
|
14114
14415
|
}
|
|
14115
|
-
function shows(state,
|
|
14416
|
+
function shows(state, key3) {
|
|
14116
14417
|
const values2 = formatsOf(state).map(
|
|
14117
|
-
(format) =>
|
|
14418
|
+
(format) => key3 === "underline" ? format.underline !== "none" : format[key3]
|
|
14118
14419
|
);
|
|
14119
14420
|
if (values2.every(Boolean)) return true;
|
|
14120
14421
|
return values2.some(Boolean) ? null : false;
|
|
14121
14422
|
}
|
|
14122
|
-
function setToggle(view,
|
|
14423
|
+
function setToggle(view, key3, desired) {
|
|
14123
14424
|
for (let attempt = 0; attempt < 2; attempt++) {
|
|
14124
|
-
if (shows(view.state,
|
|
14125
|
-
toggleFormat(
|
|
14425
|
+
if (shows(view.state, key3) === desired) return;
|
|
14426
|
+
toggleFormat(key3)(view.state, view.dispatch, view);
|
|
14126
14427
|
}
|
|
14127
14428
|
}
|
|
14128
14429
|
function patchExtraProps(view, patch) {
|
|
@@ -14251,13 +14552,13 @@ function createFontAdvanced(mark) {
|
|
|
14251
14552
|
},
|
|
14252
14553
|
valid(dirty, reveal = () => {
|
|
14253
14554
|
}) {
|
|
14254
|
-
for (const [
|
|
14555
|
+
for (const [key3, input] of [
|
|
14255
14556
|
["scale", scale],
|
|
14256
14557
|
["spacing", spacingBy],
|
|
14257
14558
|
["position", positionBy],
|
|
14258
14559
|
["kerning", kerningBy]
|
|
14259
14560
|
])
|
|
14260
|
-
if (dirty.has(
|
|
14561
|
+
if (dirty.has(key3) && !input.checkValidity()) {
|
|
14261
14562
|
reveal();
|
|
14262
14563
|
input.reportValidity();
|
|
14263
14564
|
return false;
|
|
@@ -14459,8 +14760,8 @@ function createFontDialog(getView, getHistoryView = getView) {
|
|
|
14459
14760
|
if (dirty.has("underline")) changes.underline = underline.value;
|
|
14460
14761
|
if (dirty.has("underlineColor"))
|
|
14461
14762
|
changes.underlineColor = automatic.input.checked ? null : underlineColor.value;
|
|
14462
|
-
for (const
|
|
14463
|
-
if (dirty.has(
|
|
14763
|
+
for (const key3 of ["strike", "doubleStrike", "smallCaps", "caps", "hidden"])
|
|
14764
|
+
if (dirty.has(key3)) changes[key3] = effects[key3 === "hidden" ? "hidden" : key3].input.checked;
|
|
14464
14765
|
if (dirty.has("script"))
|
|
14465
14766
|
changes.script = effects.superscript.input.checked ? "superscript" : effects.subscript.input.checked ? "subscript" : "none";
|
|
14466
14767
|
Object.assign(changes, advanced.collect(dirty));
|
|
@@ -15151,9 +15452,9 @@ function createContentControlDialog(getView) {
|
|
|
15151
15452
|
const span = view && controlAtSelection(view.state);
|
|
15152
15453
|
if (!view?.editable || !span || !target) return hide();
|
|
15153
15454
|
const next = { ...span.control };
|
|
15154
|
-
const set = (
|
|
15155
|
-
if (value) next[
|
|
15156
|
-
else delete next[
|
|
15455
|
+
const set = (key3, value) => {
|
|
15456
|
+
if (value) next[key3] = value;
|
|
15457
|
+
else delete next[key3];
|
|
15157
15458
|
};
|
|
15158
15459
|
set("alias", title.value);
|
|
15159
15460
|
set("tag", tag.value);
|
|
@@ -16531,7 +16832,7 @@ var num = (value) => typeof value === "number" && Number.isFinite(value) ? value
|
|
|
16531
16832
|
function resolvedAttrs(attrs, model) {
|
|
16532
16833
|
const direct = Object.fromEntries(
|
|
16533
16834
|
Object.entries(attrs).filter(
|
|
16534
|
-
([
|
|
16835
|
+
([key3, value]) => value != null && (key3 !== "style" || value !== "")
|
|
16535
16836
|
)
|
|
16536
16837
|
);
|
|
16537
16838
|
const catalog = model?.paragraphStyles;
|
|
@@ -16635,7 +16936,7 @@ function attrChanges(node, changes) {
|
|
|
16635
16936
|
out.lineSpacingTwips = rule === "single" ? 240 : rule === "oneAndHalf" ? 360 : rule === "double" ? 480 : Math.max(24, twips(changes.lineAt ?? 1, 240));
|
|
16636
16937
|
}
|
|
16637
16938
|
}
|
|
16638
|
-
for (const
|
|
16939
|
+
for (const key3 of [
|
|
16639
16940
|
"contextualSpacing",
|
|
16640
16941
|
"widowControl",
|
|
16641
16942
|
"keepNext",
|
|
@@ -16643,7 +16944,7 @@ function attrChanges(node, changes) {
|
|
|
16643
16944
|
"pageBreakBefore",
|
|
16644
16945
|
"suppressLineNumbers"
|
|
16645
16946
|
])
|
|
16646
|
-
if (changes[
|
|
16947
|
+
if (changes[key3] !== void 0) out[key3] = changes[key3];
|
|
16647
16948
|
return out;
|
|
16648
16949
|
}
|
|
16649
16950
|
function applyParagraphFormat(view, changes) {
|
|
@@ -16773,8 +17074,8 @@ function createParagraphDialog(getView, getModel) {
|
|
|
16773
17074
|
out.lineAt = number2(lineAt);
|
|
16774
17075
|
}
|
|
16775
17076
|
for (const [field2, item] of toggles) if (dirty.has(field2)) out[field2] = item.input.checked;
|
|
16776
|
-
for (const
|
|
16777
|
-
if (out[
|
|
17077
|
+
for (const key3 of Object.keys(out))
|
|
17078
|
+
if (out[key3] === void 0) delete out[key3];
|
|
16778
17079
|
return out;
|
|
16779
17080
|
};
|
|
16780
17081
|
const close3 = () => {
|
|
@@ -17094,8 +17395,8 @@ function applyTableProperties(view, rowPatch, marginPatch, cellMarginPatch, cell
|
|
|
17094
17395
|
for (const row3 of context2.rows) {
|
|
17095
17396
|
const node = tr.doc.nodeAt(row3.pos);
|
|
17096
17397
|
const properties = { ...row3.properties, ...rowPatch };
|
|
17097
|
-
for (const
|
|
17098
|
-
if (properties[
|
|
17398
|
+
for (const key3 of Object.keys(properties))
|
|
17399
|
+
if (properties[key3] === void 0) delete properties[key3];
|
|
17099
17400
|
tr.setNodeMarkup(row3.pos, void 0, {
|
|
17100
17401
|
...node.attrs,
|
|
17101
17402
|
properties,
|
|
@@ -17178,7 +17479,7 @@ function createTablePropertiesDialog(viewOf) {
|
|
|
17178
17479
|
const validate = () => {
|
|
17179
17480
|
height.disabled = rule.disabled = !specified.input.checked;
|
|
17180
17481
|
const invalid = Object.entries(controls).some(
|
|
17181
|
-
([
|
|
17482
|
+
([key3, control]) => changed.has(key3) && control instanceof HTMLInputElement && control.type === "number" && (key3 !== "height" || specified.input.checked) && (control.value === "" || !Number.isFinite(Number(control.value)) || Number(control.value) < Number(control.min) || Number(control.value) > Number(control.max))
|
|
17182
17483
|
);
|
|
17183
17484
|
const invalidCell = !cellMargins.valid();
|
|
17184
17485
|
ok.disabled = invalid || invalidCell;
|
|
@@ -17186,13 +17487,13 @@ function createTablePropertiesDialog(viewOf) {
|
|
|
17186
17487
|
localizeElement(message, locale);
|
|
17187
17488
|
return !invalid && !invalidCell;
|
|
17188
17489
|
};
|
|
17189
|
-
for (const [
|
|
17490
|
+
for (const [key3, control] of Object.entries(controls)) {
|
|
17190
17491
|
control.addEventListener("input", () => {
|
|
17191
|
-
changed.add(
|
|
17492
|
+
changed.add(key3);
|
|
17192
17493
|
validate();
|
|
17193
17494
|
});
|
|
17194
17495
|
control.addEventListener("change", () => {
|
|
17195
|
-
changed.add(
|
|
17496
|
+
changed.add(key3);
|
|
17196
17497
|
validate();
|
|
17197
17498
|
});
|
|
17198
17499
|
}
|
|
@@ -18056,6 +18357,198 @@ function createReviewOptionsDialog(getView) {
|
|
|
18056
18357
|
}
|
|
18057
18358
|
};
|
|
18058
18359
|
}
|
|
18360
|
+
var TYPES = [
|
|
18361
|
+
["readOnly", "No changes (Read only)"],
|
|
18362
|
+
["trackedChanges", "Tracked changes"],
|
|
18363
|
+
["comments", "Comments"],
|
|
18364
|
+
["forms", "Filling in forms"]
|
|
18365
|
+
];
|
|
18366
|
+
var STYLE = `.dve-restrict-pane{flex:0 0 300px;min-width:0;max-width:40vw;display:flex;flex-direction:column;overflow:auto;background:var(--surface,#fff);border-left:1px solid var(--line,#ddd);font:13px/1.4 'Segoe UI',sans-serif;color:var(--ink,#222)}
|
|
18367
|
+
.dve-restrict-pane[hidden]{display:none}.dve-restrict-head{display:flex;justify-content:space-between;align-items:center;padding:12px}.dve-restrict-head button{border:0;background:none;color:inherit;font-size:20px;cursor:pointer}.dve-restrict-body{padding:0 12px 12px;display:flex;flex-direction:column;gap:8px}.dve-restrict-body fieldset{border:0;border-top:1px solid var(--line,#ddd);margin:0;padding:8px 0;display:flex;flex-direction:column;gap:6px}.dve-restrict-body legend{font-weight:600;padding:0 4px 0 0}.dve-restrict-body label{display:flex;flex-direction:column;gap:2px}.dve-restrict-body label.dve-dialog-check{flex-direction:row;align-items:center;gap:6px}.dve-restrict-body p{margin:0;color:var(--muted,#666)}.dve-restrict-actions{display:flex;gap:8px;flex-wrap:wrap}`;
|
|
18368
|
+
var password = () => {
|
|
18369
|
+
const input = textInput();
|
|
18370
|
+
input.type = "password";
|
|
18371
|
+
input.autocomplete = "new-password";
|
|
18372
|
+
return input;
|
|
18373
|
+
};
|
|
18374
|
+
function createRestrictEditingPane(host) {
|
|
18375
|
+
const element = document.createElement("aside");
|
|
18376
|
+
element.className = "dve-restrict-pane";
|
|
18377
|
+
element.setAttribute("aria-label", "Restrict editing");
|
|
18378
|
+
element.dataset.title = "Restrict editing";
|
|
18379
|
+
element.hidden = true;
|
|
18380
|
+
let locale = "en";
|
|
18381
|
+
const messages = [document.createElement("p"), document.createElement("p")];
|
|
18382
|
+
for (const message of messages) message.setAttribute("role", "alert");
|
|
18383
|
+
const say = (key3) => {
|
|
18384
|
+
for (const message of messages) message.textContent = key3 ? translate(locale, key3) : "";
|
|
18385
|
+
};
|
|
18386
|
+
const formatting = checkbox("Limit formatting to a selection of styles");
|
|
18387
|
+
const restrict = checkbox("Allow only this type of editing in the document");
|
|
18388
|
+
const type = selectOf(TYPES);
|
|
18389
|
+
type.setAttribute("aria-label", "Allow only this type of editing in the document");
|
|
18390
|
+
const everyone = checkbox("Everyone");
|
|
18391
|
+
const first = password();
|
|
18392
|
+
const again = password();
|
|
18393
|
+
const secret = password();
|
|
18394
|
+
const start2 = dialogButton("Yes, start enforcing protection", true);
|
|
18395
|
+
const stop = dialogButton("Stop protection", true);
|
|
18396
|
+
const highlights = [];
|
|
18397
|
+
const regionControls = () => {
|
|
18398
|
+
const highlight = checkbox("Highlight the regions I can edit");
|
|
18399
|
+
const find = dialogButton("Find next region I can edit");
|
|
18400
|
+
highlights.push(highlight.input);
|
|
18401
|
+
highlight.input.addEventListener("change", () => host.setHighlight(highlight.input.checked));
|
|
18402
|
+
find.addEventListener("click", () => {
|
|
18403
|
+
const view = host.view();
|
|
18404
|
+
const range = view && nextEditableRegion(view.state, host.user());
|
|
18405
|
+
if (!view || !range) return say("There are no regions you can edit");
|
|
18406
|
+
say("");
|
|
18407
|
+
view.dispatch(view.state.tr.setSelection(range).scrollIntoView());
|
|
18408
|
+
view.focus();
|
|
18409
|
+
});
|
|
18410
|
+
return [find, highlight.wrapper];
|
|
18411
|
+
};
|
|
18412
|
+
const enforcedView = [
|
|
18413
|
+
fieldset("Editing restrictions", messages[0]),
|
|
18414
|
+
fieldset("Exceptions (optional)", ...regionControls()),
|
|
18415
|
+
labelled("Password", secret),
|
|
18416
|
+
stop
|
|
18417
|
+
];
|
|
18418
|
+
const settingsView = [
|
|
18419
|
+
fieldset("Formatting restrictions", formatting.wrapper),
|
|
18420
|
+
fieldset("Editing restrictions", restrict.wrapper, type),
|
|
18421
|
+
fieldset("Exceptions (optional)", everyone.wrapper, ...regionControls()),
|
|
18422
|
+
fieldset(
|
|
18423
|
+
"Start enforcement",
|
|
18424
|
+
labelled("Enter new password (optional)", first),
|
|
18425
|
+
labelled("Reenter password to confirm", again),
|
|
18426
|
+
messages[1],
|
|
18427
|
+
start2
|
|
18428
|
+
)
|
|
18429
|
+
];
|
|
18430
|
+
const head = document.createElement("div");
|
|
18431
|
+
head.className = "dve-restrict-head";
|
|
18432
|
+
const title = document.createElement("strong");
|
|
18433
|
+
title.textContent = "Restrict editing";
|
|
18434
|
+
const closeButton = document.createElement("button");
|
|
18435
|
+
closeButton.type = "button";
|
|
18436
|
+
closeButton.textContent = "\xD7";
|
|
18437
|
+
closeButton.setAttribute("aria-label", "Close");
|
|
18438
|
+
const body = document.createElement("div");
|
|
18439
|
+
body.className = "dve-restrict-body";
|
|
18440
|
+
const style = document.createElement("style");
|
|
18441
|
+
style.textContent = STYLE;
|
|
18442
|
+
head.append(title, closeButton);
|
|
18443
|
+
const close3 = () => {
|
|
18444
|
+
element.hidden = true;
|
|
18445
|
+
element.replaceChildren();
|
|
18446
|
+
focusView(host.view());
|
|
18447
|
+
};
|
|
18448
|
+
const enforced = () => {
|
|
18449
|
+
const protection = host.protection();
|
|
18450
|
+
return Boolean(protection?.enforced && protection.edit !== "none");
|
|
18451
|
+
};
|
|
18452
|
+
const selectionIsEditable = () => {
|
|
18453
|
+
const view = host.view();
|
|
18454
|
+
if (!view) return false;
|
|
18455
|
+
const { from: from2, to } = view.state.selection;
|
|
18456
|
+
return from2 < to && (editRestrictionKey.getState(view.state) ?? []).some(
|
|
18457
|
+
(range) => range.group === "everyone" && range.from <= from2 && range.to >= to
|
|
18458
|
+
);
|
|
18459
|
+
};
|
|
18460
|
+
const render = () => {
|
|
18461
|
+
say("");
|
|
18462
|
+
const protection = host.protection();
|
|
18463
|
+
const current2 = enforced();
|
|
18464
|
+
body.replaceChildren(...current2 ? enforcedView : settingsView);
|
|
18465
|
+
for (const input of highlights) input.checked = host.highlight();
|
|
18466
|
+
if (current2) {
|
|
18467
|
+
secret.value = "";
|
|
18468
|
+
secret.parentElement.hidden = !protection?.password && !protection?.unverifiablePassword;
|
|
18469
|
+
say("The document is protected");
|
|
18470
|
+
} else {
|
|
18471
|
+
formatting.input.checked = Boolean(protection?.formatting);
|
|
18472
|
+
const edit = protection?.edit;
|
|
18473
|
+
restrict.input.checked = Boolean(edit && edit !== "none");
|
|
18474
|
+
type.value = edit && edit !== "none" ? edit : "readOnly";
|
|
18475
|
+
type.disabled = !restrict.input.checked;
|
|
18476
|
+
first.value = again.value = "";
|
|
18477
|
+
everyone.input.checked = selectionIsEditable();
|
|
18478
|
+
}
|
|
18479
|
+
localizeElement(element, locale);
|
|
18480
|
+
title.textContent = translate(locale, "Restrict editing");
|
|
18481
|
+
closeButton.setAttribute("aria-label", translate(locale, "Close"));
|
|
18482
|
+
};
|
|
18483
|
+
restrict.input.addEventListener("change", () => {
|
|
18484
|
+
type.disabled = !restrict.input.checked;
|
|
18485
|
+
});
|
|
18486
|
+
everyone.input.addEventListener("change", () => {
|
|
18487
|
+
const view = host.view();
|
|
18488
|
+
if (!view) return;
|
|
18489
|
+
const result = setEditableRegion(view.state, everyone.input.checked);
|
|
18490
|
+
if ("tr" in result) {
|
|
18491
|
+
view.dispatch(result.tr);
|
|
18492
|
+
say("");
|
|
18493
|
+
} else {
|
|
18494
|
+
everyone.input.checked = selectionIsEditable();
|
|
18495
|
+
say(
|
|
18496
|
+
result.error === "empty" ? "Select text first" : "This exception continues into another paragraph; change it in Word"
|
|
18497
|
+
);
|
|
18498
|
+
}
|
|
18499
|
+
});
|
|
18500
|
+
start2.addEventListener("click", () => {
|
|
18501
|
+
const edit = restrict.input.checked ? type.value : "none";
|
|
18502
|
+
if (edit === "none") return say("Choose the type of editing to allow");
|
|
18503
|
+
if (first.value !== again.value) return say("The passwords do not match");
|
|
18504
|
+
host.apply(
|
|
18505
|
+
enforceProtection(edit, {
|
|
18506
|
+
...first.value && { password: first.value },
|
|
18507
|
+
...formatting.input.checked && { formatting: true }
|
|
18508
|
+
})
|
|
18509
|
+
);
|
|
18510
|
+
const view = host.view();
|
|
18511
|
+
if (edit === "trackedChanges" && view && !view.state.doc.attrs.trackChanges)
|
|
18512
|
+
view.dispatch(view.state.tr.setDocAttribute("trackChanges", true));
|
|
18513
|
+
render();
|
|
18514
|
+
});
|
|
18515
|
+
stop.addEventListener("click", () => {
|
|
18516
|
+
const protection = host.protection();
|
|
18517
|
+
const verdict = verifyProtectionPassword(protection, secret.value);
|
|
18518
|
+
if (verdict === void 0)
|
|
18519
|
+
return say("This protection uses a password that cannot be checked here");
|
|
18520
|
+
if (!verdict) return say("Incorrect password");
|
|
18521
|
+
host.apply(
|
|
18522
|
+
protection && {
|
|
18523
|
+
edit: protection.edit,
|
|
18524
|
+
enforced: false,
|
|
18525
|
+
...protection.formatting && { formatting: true }
|
|
18526
|
+
}
|
|
18527
|
+
);
|
|
18528
|
+
render();
|
|
18529
|
+
});
|
|
18530
|
+
closeButton.addEventListener("click", close3);
|
|
18531
|
+
element.addEventListener("keydown", (event) => {
|
|
18532
|
+
if (event.key === "Escape") close3();
|
|
18533
|
+
});
|
|
18534
|
+
return {
|
|
18535
|
+
element,
|
|
18536
|
+
get isOpen() {
|
|
18537
|
+
return !element.hidden;
|
|
18538
|
+
},
|
|
18539
|
+
open() {
|
|
18540
|
+
element.replaceChildren(style, head, body);
|
|
18541
|
+
render();
|
|
18542
|
+
element.hidden = false;
|
|
18543
|
+
element.querySelector("input, select, button")?.focus();
|
|
18544
|
+
},
|
|
18545
|
+
close: close3,
|
|
18546
|
+
setLocale(value) {
|
|
18547
|
+
locale = value;
|
|
18548
|
+
if (!element.hidden) render();
|
|
18549
|
+
}
|
|
18550
|
+
};
|
|
18551
|
+
}
|
|
18059
18552
|
|
|
18060
18553
|
// src/docx/format-dialogs.ts
|
|
18061
18554
|
var FormatDialogs = class {
|
|
@@ -18136,11 +18629,23 @@ var FormatDialogs = class {
|
|
|
18136
18629
|
insertChart: createChartTypeDialog(charts, false),
|
|
18137
18630
|
changeChartType: createChartTypeDialog(charts, true),
|
|
18138
18631
|
chartData: createChartDataDialog(charts),
|
|
18632
|
+
restrictEditing: createRestrictEditingPane({
|
|
18633
|
+
view: () => host.reviewView ? host.reviewView() : host.view(),
|
|
18634
|
+
protection: () => host.restrictEditing?.protection(),
|
|
18635
|
+
apply: (protection) => host.restrictEditing?.apply(protection),
|
|
18636
|
+
user: () => host.restrictEditing?.user() ?? "Author",
|
|
18637
|
+
highlight: () => host.restrictEditing?.highlight() ?? true,
|
|
18638
|
+
setHighlight: (on2) => host.restrictEditing?.setHighlight(on2)
|
|
18639
|
+
}),
|
|
18139
18640
|
tracking: createReviewOptionsDialog(
|
|
18140
18641
|
() => host.reviewView ? host.reviewView() : host.view()
|
|
18141
18642
|
)
|
|
18142
18643
|
};
|
|
18143
18644
|
}
|
|
18645
|
+
/** The Restrict Editing pane docks beside the page; the shell mounts it, not the frame. */
|
|
18646
|
+
get restrictEditingPane() {
|
|
18647
|
+
return this.dialogs.restrictEditing.element;
|
|
18648
|
+
}
|
|
18144
18649
|
get elements() {
|
|
18145
18650
|
return Object.values(this.dialogs).map((dialog) => dialog.element);
|
|
18146
18651
|
}
|
|
@@ -18162,11 +18667,11 @@ var FormatDialogs = class {
|
|
|
18162
18667
|
};
|
|
18163
18668
|
function syncFormatControls(toolbar, state) {
|
|
18164
18669
|
const marked = /* @__PURE__ */ new Map();
|
|
18165
|
-
for (const
|
|
18166
|
-
marked.set(
|
|
18670
|
+
for (const key3 of ["bold", "italic", "underline", "strike", "verticalAlign"])
|
|
18671
|
+
marked.set(key3, /* @__PURE__ */ new Set());
|
|
18167
18672
|
const addMarks = (marks2) => {
|
|
18168
|
-
for (const
|
|
18169
|
-
marked.get(
|
|
18673
|
+
for (const key3 of ["bold", "italic", "underline", "strike"])
|
|
18674
|
+
marked.get(key3).add(marks2.some((mark) => mark.type.name === key3));
|
|
18170
18675
|
const align2 = marks2.find((mark) => mark.type.name === "verticalAlign");
|
|
18171
18676
|
marked.get("verticalAlign").add(Boolean(align2));
|
|
18172
18677
|
};
|
|
@@ -18186,8 +18691,8 @@ function syncFormatControls(toolbar, state) {
|
|
|
18186
18691
|
underline: "Underline",
|
|
18187
18692
|
strike: "Strikethrough"
|
|
18188
18693
|
};
|
|
18189
|
-
for (const [
|
|
18190
|
-
const values2 = marked.get(
|
|
18694
|
+
for (const [key3, label2] of Object.entries(labels3)) {
|
|
18695
|
+
const values2 = marked.get(key3);
|
|
18191
18696
|
findLocalizedControl(toolbar, label2)?.setAttribute(
|
|
18192
18697
|
"aria-pressed",
|
|
18193
18698
|
String(values2.size === 1 && values2.has(true))
|
|
@@ -18280,7 +18785,7 @@ var ALIGN_BUTTONS = [
|
|
|
18280
18785
|
function effectiveAlignment(attrs, model) {
|
|
18281
18786
|
const direct = Object.fromEntries(
|
|
18282
18787
|
Object.entries(attrs).filter(
|
|
18283
|
-
([
|
|
18788
|
+
([key3, value]) => value != null && (key3 !== "style" || value !== "")
|
|
18284
18789
|
)
|
|
18285
18790
|
);
|
|
18286
18791
|
const catalog = model.paragraphStyles;
|
|
@@ -18442,6 +18947,37 @@ function syncRuler(toolbar, view, model) {
|
|
|
18442
18947
|
const zoom = Number(paper?.style.getPropertyValue("--dve-zoom")) || 1;
|
|
18443
18948
|
updateRuler(ruler, rulerGeometry(view, model), zoom);
|
|
18444
18949
|
}
|
|
18950
|
+
var EDITING_PANELS = ["Home", "Insert", "Layout", "References", "Mailings", "Table"];
|
|
18951
|
+
var STAYS_ON = /* @__PURE__ */ new Set(["Copy", "Select all", "Find and replace", "Show paragraph marks"]);
|
|
18952
|
+
var REVIEW_LABELS = ["Track changes", "Accept", "Reject", "Accept all", "Reject all"];
|
|
18953
|
+
var REASON = "Editing is restricted by document protection";
|
|
18954
|
+
var TITLE = "data-protection-title";
|
|
18955
|
+
function syncProtectionControls(toolbar, protection, locale) {
|
|
18956
|
+
const restriction = editRestrictionOf(protection);
|
|
18957
|
+
const lock = (control) => {
|
|
18958
|
+
control.disabled = true;
|
|
18959
|
+
if (!control.hasAttribute(TITLE)) control.setAttribute(TITLE, control.title);
|
|
18960
|
+
control.title = translate(locale, REASON);
|
|
18961
|
+
};
|
|
18962
|
+
for (const control of toolbar.querySelectorAll(`[${TITLE}]`)) {
|
|
18963
|
+
control.title = control.getAttribute(TITLE) ?? "";
|
|
18964
|
+
control.removeAttribute(TITLE);
|
|
18965
|
+
}
|
|
18966
|
+
if (!restriction) return;
|
|
18967
|
+
if (restriction !== "trackedChanges")
|
|
18968
|
+
for (const panel of EDITING_PANELS)
|
|
18969
|
+
for (const control of toolbar.querySelectorAll(
|
|
18970
|
+
`.ribbon-panel[data-panel="${panel}"] button, .ribbon-panel[data-panel="${panel}"] select, .ribbon-panel[data-panel="${panel}"] input`
|
|
18971
|
+
)) {
|
|
18972
|
+
const label2 = control.dataset.localearialabel ?? control.getAttribute("aria-label") ?? "";
|
|
18973
|
+
if (!STAYS_ON.has(label2)) lock(control);
|
|
18974
|
+
}
|
|
18975
|
+
const reviewLabels = restriction === "readOnly" ? [...REVIEW_LABELS, "Add comment", "Delete comment"] : REVIEW_LABELS;
|
|
18976
|
+
for (const label2 of reviewLabels) {
|
|
18977
|
+
const control = findLocalizedControl(toolbar, label2);
|
|
18978
|
+
if (control) lock(control);
|
|
18979
|
+
}
|
|
18980
|
+
}
|
|
18445
18981
|
|
|
18446
18982
|
// src/docx/editor-controls.ts
|
|
18447
18983
|
function refreshEditorControls(toolbar, view, model, readOnly, collaboration, locale, language, printPageStatus, commentsOpen = false, canEditComments = !readOnly && !collaboration) {
|
|
@@ -18522,6 +19058,8 @@ function refreshEditorControls(toolbar, view, model, readOnly, collaboration, lo
|
|
|
18522
19058
|
const control = findLocalizedControl(toolbar, label2);
|
|
18523
19059
|
if (control) control.disabled = readOnly || !enabled;
|
|
18524
19060
|
}
|
|
19061
|
+
if (forcesTrackChanges(model.protection)) trackButton?.setAttribute("aria-pressed", "true");
|
|
19062
|
+
syncProtectionControls(toolbar, model.protection, locale);
|
|
18525
19063
|
}
|
|
18526
19064
|
const words = documentWordCount(state.doc, language || void 0);
|
|
18527
19065
|
const pageText = printPageStatus ? formatPageStatus(locale, printPageStatus.current, printPageStatus.total) : formatPageStatus(locale, 1, 1);
|
|
@@ -19553,7 +20091,11 @@ var PartsController = class {
|
|
|
19553
20091
|
reviewDisplayPlugin(this.reviewMode),
|
|
19554
20092
|
reviewRunMarksPlugin(this.reviewMode),
|
|
19555
20093
|
runStylesPlugin(() => this.host.model(), this.reviewMode),
|
|
19556
|
-
paragraphStylesPlugin(
|
|
20094
|
+
paragraphStylesPlugin(
|
|
20095
|
+
() => this.host.model(),
|
|
20096
|
+
this.reviewMode,
|
|
20097
|
+
(partName, contentType) => this.host.images().urlFor(partName, contentType)
|
|
20098
|
+
)
|
|
19557
20099
|
],
|
|
19558
20100
|
keepOpenWithin: () => this.host.keepOpenWithin(),
|
|
19559
20101
|
activate: (view) => {
|
|
@@ -19574,13 +20116,13 @@ var PartsController = class {
|
|
|
19574
20116
|
registerClose: (close3) => {
|
|
19575
20117
|
this.closeActive = close3;
|
|
19576
20118
|
},
|
|
19577
|
-
...header ? { history: (
|
|
20119
|
+
...header ? { history: (key3) => this.runHistory(key3) } : {}
|
|
19578
20120
|
};
|
|
19579
20121
|
}
|
|
19580
20122
|
/** Header/footer typing and insertion use the body history; notes retain their local stack. */
|
|
19581
|
-
runHistory(
|
|
20123
|
+
runHistory(key3) {
|
|
19582
20124
|
const view = this.host.view();
|
|
19583
|
-
return !!view?.editable && (
|
|
20125
|
+
return !!view?.editable && (key3 === "undo" ? undo : redo)(view.state, view.dispatch);
|
|
19584
20126
|
}
|
|
19585
20127
|
usesBodyHistory() {
|
|
19586
20128
|
return !!this.headerContext;
|
|
@@ -19677,10 +20219,10 @@ var PartsController = class {
|
|
|
19677
20219
|
if (!view?.editable || !this.host.canEditOutsideBody()) return;
|
|
19678
20220
|
const replace = (notes) => notes.map((note) => note.id === id ? { ...note, blocks: structuredClone(blocks) } : note);
|
|
19679
20221
|
const model = this.host.model();
|
|
19680
|
-
const
|
|
20222
|
+
const key3 = kind === "footnote" ? "footnotes" : "endnotes";
|
|
19681
20223
|
const next = {
|
|
19682
20224
|
...model,
|
|
19683
|
-
...model[
|
|
20225
|
+
...model[key3] && { [key3]: replace(model[key3]) }
|
|
19684
20226
|
};
|
|
19685
20227
|
view.dispatch(
|
|
19686
20228
|
view.state.tr.step(new NotePartsStep(notePartsJson(next))).setMeta(HEADER_FOOTER_INPUT, true)
|
|
@@ -19753,10 +20295,10 @@ function withWatermark(model, spec, newId) {
|
|
|
19753
20295
|
base = withBlankHeaderFooter(base, "headers", newId, 0, "default");
|
|
19754
20296
|
const updated = /* @__PURE__ */ new Map();
|
|
19755
20297
|
const change = (content) => {
|
|
19756
|
-
const
|
|
19757
|
-
if (!
|
|
19758
|
-
if (!updated.has(
|
|
19759
|
-
return { ...content, blocks: structuredClone(updated.get(
|
|
20298
|
+
const key3 = content.partName ?? "";
|
|
20299
|
+
if (!key3) return { ...content, blocks: withWatermarkRun(content.blocks, spec, newId) };
|
|
20300
|
+
if (!updated.has(key3)) updated.set(key3, withWatermarkRun(content.blocks, spec, newId));
|
|
20301
|
+
return { ...content, blocks: structuredClone(updated.get(key3)) };
|
|
19760
20302
|
};
|
|
19761
20303
|
return {
|
|
19762
20304
|
...base,
|
|
@@ -19772,8 +20314,8 @@ function withWatermark(model, spec, newId) {
|
|
|
19772
20314
|
};
|
|
19773
20315
|
}
|
|
19774
20316
|
var ALIGNMENTS = ["top", "center", "both", "bottom"];
|
|
19775
|
-
function pageSetupChange(model, index, section3,
|
|
19776
|
-
switch (
|
|
20317
|
+
function pageSetupChange(model, index, section3, key3, value) {
|
|
20318
|
+
switch (key3) {
|
|
19777
20319
|
case "margin":
|
|
19778
20320
|
return setMargins(model, index, value);
|
|
19779
20321
|
case "size":
|
|
@@ -19843,10 +20385,10 @@ function createStatusBar(handlers) {
|
|
|
19843
20385
|
const render = () => {
|
|
19844
20386
|
const t = locale();
|
|
19845
20387
|
const noteKey = model.notes === 1 ? "status.note" : "status.notes";
|
|
19846
|
-
const view = (mode,
|
|
20388
|
+
const view = (mode, key3) => ({
|
|
19847
20389
|
id: mode,
|
|
19848
20390
|
icon: mode === "draft" ? "webLayout" : "printLayout",
|
|
19849
|
-
label: translate(t,
|
|
20391
|
+
label: translate(t, key3),
|
|
19850
20392
|
pressed: model.mode === mode
|
|
19851
20393
|
});
|
|
19852
20394
|
element.state = {
|
|
@@ -19924,14 +20466,14 @@ var PageController = class {
|
|
|
19924
20466
|
userZoomed = false;
|
|
19925
20467
|
observed;
|
|
19926
20468
|
/** Page setup applies to the section holding the selection, as in Word, and is undoable. */
|
|
19927
|
-
changePageSetup(
|
|
20469
|
+
changePageSetup(key3, value) {
|
|
19928
20470
|
const view = this.host.view();
|
|
19929
20471
|
if (!view?.editable || !this.host.canEditOutsideBody()) return;
|
|
19930
20472
|
const model = this.host.model();
|
|
19931
20473
|
const index = currentSectionIndex(view, model);
|
|
19932
20474
|
const section3 = sectionsOf(model)[index];
|
|
19933
20475
|
if (!section3) return;
|
|
19934
|
-
const next = pageSetupChange(model, index, section3,
|
|
20476
|
+
const next = pageSetupChange(model, index, section3, key3, value);
|
|
19935
20477
|
this.dispatchSections(next);
|
|
19936
20478
|
}
|
|
19937
20479
|
/** Shows the selection's section settings in the Layout tab. */
|
|
@@ -20752,7 +21294,7 @@ function createSmartArtDialog(restoreFocus) {
|
|
|
20752
21294
|
element.append(picker, dialogActions(cancel, confirm2));
|
|
20753
21295
|
let locale = "en";
|
|
20754
21296
|
let onChoose;
|
|
20755
|
-
const t = (
|
|
21297
|
+
const t = (key3) => translate(locale, key3);
|
|
20756
21298
|
const fill = () => {
|
|
20757
21299
|
picker.labels = { categories: t("SmartArt categories"), layouts: t("SmartArt layouts") };
|
|
20758
21300
|
picker.categories = DIAGRAM_INSERT_CATEGORIES.map((category) => ({
|
|
@@ -20869,20 +21411,20 @@ var SmartArtController = class {
|
|
|
20869
21411
|
this.run(action.key);
|
|
20870
21412
|
return true;
|
|
20871
21413
|
}
|
|
20872
|
-
run(
|
|
21414
|
+
run(key3) {
|
|
20873
21415
|
const view = this.host.view();
|
|
20874
21416
|
if (!view || !selectedDiagram(view.state)) return;
|
|
20875
|
-
if (
|
|
21417
|
+
if (key3 === "textPane") {
|
|
20876
21418
|
this.text.setOpen(!this.text.open);
|
|
20877
21419
|
return;
|
|
20878
21420
|
}
|
|
20879
|
-
if (
|
|
21421
|
+
if (key3 === "changeLayout") {
|
|
20880
21422
|
this.dialog.open((preset) => void this.relayout(preset), void 0);
|
|
20881
21423
|
return;
|
|
20882
21424
|
}
|
|
20883
21425
|
this.refocus = true;
|
|
20884
21426
|
try {
|
|
20885
|
-
this.text.runCommand(
|
|
21427
|
+
this.text.runCommand(key3);
|
|
20886
21428
|
} finally {
|
|
20887
21429
|
this.refocus = false;
|
|
20888
21430
|
}
|
|
@@ -20968,7 +21510,7 @@ var SmartArtController = class {
|
|
|
20968
21510
|
setLocale(locale) {
|
|
20969
21511
|
this.locale = locale;
|
|
20970
21512
|
this.dialog.setLocale(locale);
|
|
20971
|
-
this.text.setLabels((
|
|
21513
|
+
this.text.setLabels((key3) => translate(locale, key3));
|
|
20972
21514
|
}
|
|
20973
21515
|
/** A new document: no current node, and the text pane closed. */
|
|
20974
21516
|
reset() {
|
|
@@ -20992,6 +21534,12 @@ var InsertController = class {
|
|
|
20992
21534
|
this.pictureInput.hidden = true;
|
|
20993
21535
|
this.pictureInput.className = "dve-picture-input";
|
|
20994
21536
|
this.pictureInput.addEventListener("change", () => void this.insertSelectedPicture());
|
|
21537
|
+
this.bulletInput = document.createElement("input");
|
|
21538
|
+
this.bulletInput.type = "file";
|
|
21539
|
+
this.bulletInput.accept = Object.keys(PICTURE_TYPES).join(",");
|
|
21540
|
+
this.bulletInput.hidden = true;
|
|
21541
|
+
this.bulletInput.className = "dve-picture-bullet-input";
|
|
21542
|
+
this.bulletInput.addEventListener("change", () => void this.applySelectedPictureBullet());
|
|
20995
21543
|
this.smartArt = new SmartArtController({
|
|
20996
21544
|
view: () => host.view(),
|
|
20997
21545
|
contentWidth: () => host.contentWidth(),
|
|
@@ -21007,6 +21555,8 @@ var InsertController = class {
|
|
|
21007
21555
|
linkDialog;
|
|
21008
21556
|
pictureDialog;
|
|
21009
21557
|
pictureInput;
|
|
21558
|
+
/** File chooser behind Bullets > Picture bullet. */
|
|
21559
|
+
bulletInput;
|
|
21010
21560
|
/** Bytes for pictures inserted since the document was loaded; passed to save. */
|
|
21011
21561
|
pendingMedia = /* @__PURE__ */ new Map();
|
|
21012
21562
|
/** The shape Insert > Shapes armed for the next drag on the page. */
|
|
@@ -21024,6 +21574,8 @@ var InsertController = class {
|
|
|
21024
21574
|
if (this.smartArt.handle(action)) return true;
|
|
21025
21575
|
if (action.type === "insertPicture") {
|
|
21026
21576
|
if (editable2) this.pictureInput.click();
|
|
21577
|
+
} else if (action.type === "pictureBullet") {
|
|
21578
|
+
if (editable2) this.bulletInput.click();
|
|
21027
21579
|
} else if (action.type === "insertContentControl") {
|
|
21028
21580
|
const tr = view?.editable && insertContentControl(view.state, action.value);
|
|
21029
21581
|
if (view && tr) view.dispatch(tr.scrollIntoView());
|
|
@@ -21107,13 +21659,13 @@ var InsertController = class {
|
|
|
21107
21659
|
];
|
|
21108
21660
|
}
|
|
21109
21661
|
runShapeAction(view, action) {
|
|
21110
|
-
const { key:
|
|
21111
|
-
if (
|
|
21112
|
-
else if (
|
|
21113
|
-
else if (
|
|
21114
|
-
else if (
|
|
21115
|
-
else if (
|
|
21116
|
-
else if (
|
|
21662
|
+
const { key: key3, value } = action;
|
|
21663
|
+
if (key3 === "fill") setShapeFill(view, String(value));
|
|
21664
|
+
else if (key3 === "outline") setShapeOutline(view, String(value));
|
|
21665
|
+
else if (key3 === "weight") setShapeWeight(view, Number(value));
|
|
21666
|
+
else if (key3 === "width") setShapeSize(view, Number(value) * 96, void 0);
|
|
21667
|
+
else if (key3 === "height") setShapeSize(view, void 0, Number(value) * 96);
|
|
21668
|
+
else if (key3 === "wrap") setShapeWrap(view, String(value));
|
|
21117
21669
|
}
|
|
21118
21670
|
handleClick(view, pos, event) {
|
|
21119
21671
|
return (event.ctrlKey || event.metaKey) && followLinkAt(view, pos);
|
|
@@ -21134,6 +21686,7 @@ var InsertController = class {
|
|
|
21134
21686
|
this.pictureDialog.setLocale(locale);
|
|
21135
21687
|
this.smartArt.setLocale(locale);
|
|
21136
21688
|
this.pictureInput.setAttribute("aria-label", translate(locale, "Insert picture"));
|
|
21689
|
+
this.bulletInput.setAttribute("aria-label", translate(locale, "Picture bullet..."));
|
|
21137
21690
|
}
|
|
21138
21691
|
/** Re-applies the hidden-text display state after the paper is rebuilt. */
|
|
21139
21692
|
syncPaper() {
|
|
@@ -21183,6 +21736,34 @@ var InsertController = class {
|
|
|
21183
21736
|
this.pictureInput.value = "";
|
|
21184
21737
|
if (file) await this.insertPictureFile(file);
|
|
21185
21738
|
}
|
|
21739
|
+
async applySelectedPictureBullet() {
|
|
21740
|
+
const file = this.bulletInput.files?.[0];
|
|
21741
|
+
this.bulletInput.value = "";
|
|
21742
|
+
if (file) await this.applyPictureBulletFile(file);
|
|
21743
|
+
}
|
|
21744
|
+
/** Stages `file` as a new picture bullet and starts a list that uses it. */
|
|
21745
|
+
async applyPictureBulletFile(file) {
|
|
21746
|
+
const view = this.host.view();
|
|
21747
|
+
if (!view?.editable) return false;
|
|
21748
|
+
try {
|
|
21749
|
+
const contentType = file.type.toLowerCase();
|
|
21750
|
+
if (!PICTURE_TYPES[contentType])
|
|
21751
|
+
throw new Error("Choose a PNG, JPEG, GIF or BMP picture for a picture bullet.");
|
|
21752
|
+
const bytes = await readBytes(file);
|
|
21753
|
+
if (this.host.view() !== view || !view.editable) return false;
|
|
21754
|
+
const partName = (this.host.newMediaPartName ?? newPicturePartName)(contentType);
|
|
21755
|
+
const part = { bytes, contentType };
|
|
21756
|
+
this.host.stageMedia?.(partName, part);
|
|
21757
|
+
this.pendingMedia.set(partName, part);
|
|
21758
|
+
applyPictureBulletList(view, this.host.model(), { partName, contentType });
|
|
21759
|
+
this.host.refresh?.();
|
|
21760
|
+
focusView(view);
|
|
21761
|
+
return true;
|
|
21762
|
+
} catch (cause) {
|
|
21763
|
+
this.host.reportError(cause instanceof Error ? cause : new Error(String(cause)));
|
|
21764
|
+
return false;
|
|
21765
|
+
}
|
|
21766
|
+
}
|
|
21186
21767
|
/** Stages `file` and inserts it at the selection; false when it could not be inserted. */
|
|
21187
21768
|
async insertPictureFile(file) {
|
|
21188
21769
|
const view = this.host.view();
|
|
@@ -21415,6 +21996,16 @@ var EditorCore = class {
|
|
|
21415
21996
|
section: () => this.pages.currentSection(),
|
|
21416
21997
|
canEdit: () => !this.readOnly && !this.collab.active,
|
|
21417
21998
|
apply: (columns, footnoteColumns) => this.pages.applyColumns(columns, footnoteColumns)
|
|
21999
|
+
},
|
|
22000
|
+
restrictEditing: {
|
|
22001
|
+
protection: () => this.model.protection,
|
|
22002
|
+
apply: (protection) => this.applyProtection(protection),
|
|
22003
|
+
user: () => this.reviewAuthor,
|
|
22004
|
+
highlight: () => this.highlightEditableRegions,
|
|
22005
|
+
setHighlight: (on2) => {
|
|
22006
|
+
this.highlightEditableRegions = on2;
|
|
22007
|
+
this.view?.dispatch(this.view.state.tr.setMeta("docx-protection", true));
|
|
22008
|
+
}
|
|
21418
22009
|
}
|
|
21419
22010
|
});
|
|
21420
22011
|
this.imageMedia = new ImageMediaCache(
|
|
@@ -21429,7 +22020,7 @@ var EditorCore = class {
|
|
|
21429
22020
|
},
|
|
21430
22021
|
locale: () => this.locale,
|
|
21431
22022
|
// A document protected for forms lets only its body's fields change, as in Word.
|
|
21432
|
-
canEditOutsideBody: () => !this.readOnly && !this.collab.active && !
|
|
22023
|
+
canEditOutsideBody: () => !this.readOnly && !this.collab.active && !locksStories(this.model.protection),
|
|
21433
22024
|
edited: () => this.markEditedOutsideBody(),
|
|
21434
22025
|
reportError: (cause) => dispatchDocumentError(element, cause)
|
|
21435
22026
|
};
|
|
@@ -21550,6 +22141,18 @@ var EditorCore = class {
|
|
|
21550
22141
|
contentWidth() {
|
|
21551
22142
|
return this.model.page.width - this.model.page.marginLeft - this.model.page.marginRight;
|
|
21552
22143
|
}
|
|
22144
|
+
/** Review > Restrict Editing > Highlight the regions I can edit. */
|
|
22145
|
+
highlightEditableRegions = true;
|
|
22146
|
+
/** Starts or stops Review > Restrict Editing; saving writes it to settings.xml. */
|
|
22147
|
+
applyProtection(protection) {
|
|
22148
|
+
const { protection: _previous, ...rest } = this.model;
|
|
22149
|
+
this.model = protection ? { ...rest, protection } : rest;
|
|
22150
|
+
if (locksStories(protection) && this.parts.activeView())
|
|
22151
|
+
this.parts.closeHeaderFooter(this.shell.canvas, this.shell.paper);
|
|
22152
|
+
this.view?.dispatch(this.view.state.tr.setMeta("docx-protection", true));
|
|
22153
|
+
this.markEditedOutsideBody();
|
|
22154
|
+
this.refreshControls();
|
|
22155
|
+
}
|
|
21553
22156
|
canEditBody() {
|
|
21554
22157
|
return !this.readOnly && (!this.collab.yjs || this.collab.yjs.session.canWrite());
|
|
21555
22158
|
}
|
|
@@ -21718,7 +22321,7 @@ var ribbon_polish_default = "/* Ribbon polish: distinct pressed state and Word's
|
|
|
21718
22321
|
var ribbon_home_menus_default = ".ribbon-command-split {\n flex: none;\n height: 28px;\n}\n.ribbon-command-split .ribbon-menu.ribbon-menu-caret {\n width: 14px;\n height: 28px;\n}\n.ribbon-command-split-large {\n flex-direction: column;\n height: 74px;\n}\n.ribbon-group .ribbon-command-split-large .ribbon-large {\n height: 56px;\n min-height: 56px;\n}\n.ribbon-command-split-large .ribbon-menu.ribbon-menu-caret {\n width: 100%;\n height: 18px;\n}\n.ribbon-command-split[data-dve-hidden] {\n display: none;\n}\n";
|
|
21719
22322
|
|
|
21720
22323
|
// raw-css:/home/runner/work/ooxml/ooxml/src/ui/src/docx/styles/document.css?raw
|
|
21721
|
-
var document_default = ".dve-revision-insert {\n color: var(--dve-revision-color, inherit);\n text-decoration: underline;\n text-decoration-color: var(--dve-revision-color, currentColor);\n}\n.dve-revision-delete {\n color: var(--dve-revision-color, inherit);\n text-decoration: line-through;\n text-decoration-color: var(--dve-revision-color, currentColor);\n}\n/* Moved text, like Word: green, double underline at the destination, double strike at the source. */\n.dve-revision-move {\n --dve-revision-color: #2e7d32;\n text-decoration-style: double;\n}\n.ProseMirror .dve-revision-hidden {\n /* Review visibility takes precedence over picture/equation node-view display rules. */\n display: none !important;\n}\n[data-review-display]:not([data-review-display='all']) .dve-revision-insert,\n[data-review-display]:not([data-review-display='all']) .dve-revision-delete {\n color: inherit;\n text-decoration: none;\n}\n[data-review-display]:not([data-review-display='all']) .dve-comment-range {\n background: transparent;\n}\n.dve-revision-format-markup {\n outline: 1px dotted currentColor;\n outline-offset: 2px;\n}\n.dve-comment-range {\n background: rgba(255, 212, 0, 0.28);\n}\n.dve-paper {\n box-sizing: border-box;\n position: relative;\n flex: none;\n margin: 0 auto;\n background: var(--dve-page-color, var(--office-paper, #fff));\n color: #202124;\n box-shadow:\n 0 1px 3px #20212430,\n 0 4px 12px #20212420;\n outline: none;\n /* Single spacing and no paragraph gap unless the document's styles set them, as in Word. */\n font:\n 11pt/1.2 Calibri,\n Carlito,\n Arial,\n sans-serif;\n zoom: var(--dve-zoom, 1);\n}\n.dve-paper p {\n min-height: 1.2em;\n margin: 0;\n white-space: pre-wrap;\n}\n.dve-paper p:last-child {\n margin-bottom: 0;\n}\n/* The caret marks focus in the document, as in Word; no ring around the editable area. */\n.dve-paper .ProseMirror:focus,\n.dve-paper .ProseMirror:focus-visible {\n outline: none;\n}\n.dve-paper:focus {\n box-shadow:\n 0 1px 3px #20212430,\n 0 4px 12px #20212420,\n 0 0 0 1px var(--blue);\n}\n/* Columns follow the table's grid and cell widths (equal when it has none), as Word lays them out;\n tables add no space around themselves. */\n.dve-paper table {\n width: 100%;\n table-layout: fixed;\n border-collapse: collapse;\n margin: 0;\n}\n.dve-paper td {\n min-width: 44px;\n border: var(--dve-cell-border, 1px dashed #c8c6c4);\n vertical-align: top;\n}\n.dve-paper td p {\n margin: 0;\n}\n.dve-paper p[data-list-label]::before {\n content: attr(data-list-label);\n white-space: pre;\n user-select: none;\n}\n.dve-paper p[data-list-marker]:not([data-list-marker=''])::before {\n content: attr(data-list-marker);\n position: absolute;\n left: var(--dve-marker-left);\n text-indent: 0;\n font-family: var(--dve-marker-family);\n font-size: var(--dve-marker-size);\n font-weight: var(--dve-marker-weight);\n font-style: var(--dve-marker-style);\n color: var(--dve-marker-color);\n}\n.multilingual-controls {\n flex: 1 1 100%;\n align-items: flex-start;\n gap: 9px 14px;\n}\n.multilingual-language-control {\n display: grid;\n grid-template-columns: minmax(145px, 180px);\n gap: 4px;\n color: var(--muted);\n font-size: 11px;\n}\n.multilingual-language-control select,\n.multilingual-language-control input {\n box-sizing: border-box;\n width: 180px;\n}\n.multilingual-language-control input {\n height: 26px;\n border: 1px solid var(--line);\n border-radius: 3px;\n background: var(--surface);\n padding: 0 7px;\n color: var(--ink);\n font: 11px var(--office-font, system-ui, sans-serif);\n}\n.multilingual-note {\n align-self: end;\n max-width: 240px;\n color: var(--muted);\n font-size: 11px;\n}\n@media (max-width: 650px) {\n .ribbon-panel {\n min-height: 96px;\n padding: 6px;\n gap: 4px;\n }\n .ribbon-group {\n padding-right: 7px;\n }\n .ribbon-panel[data-panel='Home'] .ribbon-group[data-label='Font'] {\n width: 340px;\n }\n .ribbon-panel[data-panel='Home'] .ribbon-group[data-label='Paragraph'] {\n width: 280px;\n }\n .ribbon-panel[data-panel='Home'] .ribbon-group[data-label='Editing'] {\n width: auto;\n }\n .ribbon-group button {\n min-width: 34px;\n min-height: 34px;\n }\n .ribbon-group select {\n max-width: min(150px, 42vw);\n }\n .dve-canvas {\n padding: 18px 8px 38px;\n align-items: flex-start;\n }\n .ribbon-group select.font-family-select {\n width: 120px;\n max-width: 38vw;\n }\n .ribbon-group select.font-size-select {\n width: 56px;\n }\n .ribbon-group select.spacing-select {\n width: min(128px, 36vw);\n }\n .ribbon-group select.line-spacing-select {\n width: min(112px, 32vw);\n }\n}\n.dve-break-marker {\n display: block;\n margin: 0.4em 0;\n padding: 2px 0;\n border-top: 1px dashed var(--muted);\n border-bottom: 1px dashed var(--muted);\n color: var(--muted);\n font-size: 10px;\n text-align: center;\n text-transform: uppercase;\n letter-spacing: 0.04em;\n user-select: none;\n}\n.dve-note-reference {\n color: var(--blue);\n cursor: default;\n}\n.dve-header,\n.dve-footer {\n box-sizing: border-box;\n width: 816px;\n max-width: 100%;\n margin: 0 auto;\n padding: 10px clamp(16px, 5vw, 70px);\n background: var(--surface);\n color: var(--muted);\n font:\n 10pt/1.35 Calibri,\n Arial,\n sans-serif;\n}\n.dve-header {\n border-bottom: 1px dashed var(--line);\n}\n.dve-footer {\n border-top: 1px dashed var(--line);\n}\n.dve-header-footer-label {\n margin-bottom: 2px;\n color: var(--muted);\n font-size: 10px;\n text-transform: uppercase;\n letter-spacing: 0.04em;\n}\n.dve-notes-container {\n box-sizing: border-box;\n width: 816px;\n max-width: 100%;\n margin: 12px auto 0;\n}\n.dve-notes {\n box-sizing: border-box;\n padding: 10px clamp(16px, 5vw, 70px);\n background: var(--surface);\n border-top: 1px solid var(--line);\n font:\n 10pt/1.35 Calibri,\n Arial,\n sans-serif;\n}\n.dve-notes-heading {\n margin: 0 0 6px;\n color: var(--ink);\n font-size: 12px;\n}\n.dve-note-list {\n margin: 0;\n padding: 0;\n list-style: none;\n}\n.dve-note-list li {\n display: flex;\n gap: 4px;\n align-items: baseline;\n margin-bottom: 4px;\n}\n.dve-note-marker {\n flex: none;\n color: var(--muted);\n}\n@media (prefers-reduced-motion: reduce) {\n * {\n scroll-behavior: auto !important;\n }\n}\n\n/* Print Layout: a read-only, paginated render kept beside the continuous\n editing surface (see print-layout.ts / print-layout-view.ts). */\n";
|
|
22324
|
+
var document_default = ".dve-revision-insert {\n color: var(--dve-revision-color, inherit);\n text-decoration: underline;\n text-decoration-color: var(--dve-revision-color, currentColor);\n}\n.dve-revision-delete {\n color: var(--dve-revision-color, inherit);\n text-decoration: line-through;\n text-decoration-color: var(--dve-revision-color, currentColor);\n}\n/* Moved text, like Word: green, double underline at the destination, double strike at the source. */\n.dve-revision-move {\n --dve-revision-color: #2e7d32;\n text-decoration-style: double;\n}\n.ProseMirror .dve-revision-hidden {\n /* Review visibility takes precedence over picture/equation node-view display rules. */\n display: none !important;\n}\n[data-review-display]:not([data-review-display='all']) .dve-revision-insert,\n[data-review-display]:not([data-review-display='all']) .dve-revision-delete {\n color: inherit;\n text-decoration: none;\n}\n[data-review-display]:not([data-review-display='all']) .dve-comment-range {\n background: transparent;\n}\n.dve-revision-format-markup {\n outline: 1px dotted currentColor;\n outline-offset: 2px;\n}\n.dve-comment-range {\n background: rgba(255, 212, 0, 0.28);\n}\n.dve-paper {\n box-sizing: border-box;\n position: relative;\n flex: none;\n margin: 0 auto;\n background: var(--dve-page-color, var(--office-paper, #fff));\n color: #202124;\n box-shadow:\n 0 1px 3px #20212430,\n 0 4px 12px #20212420;\n outline: none;\n /* Single spacing and no paragraph gap unless the document's styles set them, as in Word. */\n font:\n 11pt/1.2 Calibri,\n Carlito,\n Arial,\n sans-serif;\n zoom: var(--dve-zoom, 1);\n}\n.dve-paper p {\n min-height: 1.2em;\n margin: 0;\n white-space: pre-wrap;\n}\n.dve-paper p:last-child {\n margin-bottom: 0;\n}\n/* The caret marks focus in the document, as in Word; no ring around the editable area. */\n.dve-paper .ProseMirror:focus,\n.dve-paper .ProseMirror:focus-visible {\n outline: none;\n}\n.dve-paper:focus {\n box-shadow:\n 0 1px 3px #20212430,\n 0 4px 12px #20212420,\n 0 0 0 1px var(--blue);\n}\n/* Columns follow the table's grid and cell widths (equal when it has none), as Word lays them out;\n tables add no space around themselves. */\n.dve-paper table {\n width: 100%;\n table-layout: fixed;\n border-collapse: collapse;\n margin: 0;\n}\n.dve-paper td {\n min-width: 44px;\n border: var(--dve-cell-border, 1px dashed #c8c6c4);\n vertical-align: top;\n}\n.dve-paper td p {\n margin: 0;\n}\n.dve-paper p[data-list-label]::before {\n content: attr(data-list-label);\n white-space: pre;\n user-select: none;\n}\n.dve-paper p[data-list-marker]:not([data-list-marker=''])::before {\n content: attr(data-list-marker);\n position: absolute;\n left: var(--dve-marker-left);\n text-indent: 0;\n font-family: var(--dve-marker-family);\n font-size: var(--dve-marker-size);\n font-weight: var(--dve-marker-weight);\n font-style: var(--dve-marker-style);\n color: var(--dve-marker-color);\n}\n/* A picture bullet replaces the marker text with its image, sized by the list-marker display. */\n.dve-paper p[data-list-marker-picture]::before {\n content: '';\n display: block;\n width: var(--dve-marker-pic-w);\n height: var(--dve-marker-pic-h);\n background: var(--dve-marker-image) center / contain no-repeat;\n}\n.multilingual-controls {\n flex: 1 1 100%;\n align-items: flex-start;\n gap: 9px 14px;\n}\n.multilingual-language-control {\n display: grid;\n grid-template-columns: minmax(145px, 180px);\n gap: 4px;\n color: var(--muted);\n font-size: 11px;\n}\n.multilingual-language-control select,\n.multilingual-language-control input {\n box-sizing: border-box;\n width: 180px;\n}\n.multilingual-language-control input {\n height: 26px;\n border: 1px solid var(--line);\n border-radius: 3px;\n background: var(--surface);\n padding: 0 7px;\n color: var(--ink);\n font: 11px var(--office-font, system-ui, sans-serif);\n}\n.multilingual-note {\n align-self: end;\n max-width: 240px;\n color: var(--muted);\n font-size: 11px;\n}\n@media (max-width: 650px) {\n .ribbon-panel {\n min-height: 96px;\n padding: 6px;\n gap: 4px;\n }\n .ribbon-group {\n padding-right: 7px;\n }\n .ribbon-panel[data-panel='Home'] .ribbon-group[data-label='Font'] {\n width: 340px;\n }\n .ribbon-panel[data-panel='Home'] .ribbon-group[data-label='Paragraph'] {\n width: 280px;\n }\n .ribbon-panel[data-panel='Home'] .ribbon-group[data-label='Editing'] {\n width: auto;\n }\n .ribbon-group button {\n min-width: 34px;\n min-height: 34px;\n }\n .ribbon-group select {\n max-width: min(150px, 42vw);\n }\n .dve-canvas {\n padding: 18px 8px 38px;\n align-items: flex-start;\n }\n .ribbon-group select.font-family-select {\n width: 120px;\n max-width: 38vw;\n }\n .ribbon-group select.font-size-select {\n width: 56px;\n }\n .ribbon-group select.spacing-select {\n width: min(128px, 36vw);\n }\n .ribbon-group select.line-spacing-select {\n width: min(112px, 32vw);\n }\n}\n.dve-break-marker {\n display: block;\n margin: 0.4em 0;\n padding: 2px 0;\n border-top: 1px dashed var(--muted);\n border-bottom: 1px dashed var(--muted);\n color: var(--muted);\n font-size: 10px;\n text-align: center;\n text-transform: uppercase;\n letter-spacing: 0.04em;\n user-select: none;\n}\n.dve-note-reference {\n color: var(--blue);\n cursor: default;\n}\n.dve-header,\n.dve-footer {\n box-sizing: border-box;\n width: 816px;\n max-width: 100%;\n margin: 0 auto;\n padding: 10px clamp(16px, 5vw, 70px);\n background: var(--surface);\n color: var(--muted);\n font:\n 10pt/1.35 Calibri,\n Arial,\n sans-serif;\n}\n.dve-header {\n border-bottom: 1px dashed var(--line);\n}\n.dve-footer {\n border-top: 1px dashed var(--line);\n}\n.dve-header-footer-label {\n margin-bottom: 2px;\n color: var(--muted);\n font-size: 10px;\n text-transform: uppercase;\n letter-spacing: 0.04em;\n}\n.dve-notes-container {\n box-sizing: border-box;\n width: 816px;\n max-width: 100%;\n margin: 12px auto 0;\n}\n.dve-notes {\n box-sizing: border-box;\n padding: 10px clamp(16px, 5vw, 70px);\n background: var(--surface);\n border-top: 1px solid var(--line);\n font:\n 10pt/1.35 Calibri,\n Arial,\n sans-serif;\n}\n.dve-notes-heading {\n margin: 0 0 6px;\n color: var(--ink);\n font-size: 12px;\n}\n.dve-note-list {\n margin: 0;\n padding: 0;\n list-style: none;\n}\n.dve-note-list li {\n display: flex;\n gap: 4px;\n align-items: baseline;\n margin-bottom: 4px;\n}\n.dve-note-marker {\n flex: none;\n color: var(--muted);\n}\n@media (prefers-reduced-motion: reduce) {\n * {\n scroll-behavior: auto !important;\n }\n}\n\n/* Print Layout: a read-only, paginated render kept beside the continuous\n editing surface (see print-layout.ts / print-layout-view.ts). */\n";
|
|
21722
22325
|
|
|
21723
22326
|
// raw-css:/home/runner/work/ooxml/ooxml/src/ui/src/docx/styles/underline.css?raw
|
|
21724
22327
|
var underline_default = `/* Styled runs paint their own underline. Do not superimpose the semantic mark's single line. */
|
|
@@ -21768,7 +22371,7 @@ var keyboard_menu_default = "/* Keyboard shortcut help. The context menu is the
|
|
|
21768
22371
|
var smartart_default = "/* SmartArt: a read-only display of the diagram's saved drawing */\n.dve-smartart {\n position: relative;\n max-width: 100%;\n box-sizing: border-box;\n vertical-align: bottom;\n line-height: normal;\n}\n.dve-smartart:not(.dve-float-left):not(.dve-float-right):not(.dve-float-block) {\n display: inline-block;\n}\n.dve-smartart:focus-visible {\n outline: 2px solid var(--word);\n outline-offset: 2px;\n}\n.dve-smartart-selected {\n outline: 2px solid var(--word);\n outline-offset: 1px;\n}\n.dve-smartart-drawing {\n display: block;\n width: 100%;\n height: 100%;\n}\n.dve-smartart-box {\n overflow: auto;\n border: 1px dashed var(--line);\n background: var(--canvas);\n color: var(--text, #1f1f1f);\n font-size: 12px;\n}\n.dve-smartart-placeholder {\n display: block;\n padding: 6px 8px;\n}\n.dve-smartart-heading {\n display: block;\n color: var(--muted);\n font-size: 11px;\n}\n.dve-smartart-placeholder ul,\n.dve-smartart-notes ul {\n margin: 4px 0 0;\n padding-left: 18px;\n}\n.dve-smartart-info {\n position: absolute;\n top: 2px;\n right: 2px;\n display: none;\n width: 20px;\n height: 20px;\n padding: 0;\n border: 1px solid var(--line);\n border-radius: 50%;\n background: var(--surface, #fff);\n color: var(--muted);\n font: italic 700 12px/1 serif;\n cursor: pointer;\n}\n.dve-smartart:hover .dve-smartart-info,\n.dve-smartart:focus-within .dve-smartart-info,\n.dve-smartart-selected .dve-smartart-info,\n.dve-smartart-info[aria-expanded='true'] {\n display: block;\n}\n.dve-smartart-notes {\n position: absolute;\n z-index: 3;\n top: 26px;\n right: 2px;\n width: max-content;\n max-width: min(320px, 90%);\n padding: 6px 8px;\n border: 1px solid var(--line);\n border-radius: var(--dve-radius, var(--office-radius, 4px));\n background: var(--surface, #fff);\n color: var(--text, #1f1f1f);\n font-size: 11px;\n text-align: left;\n box-shadow: 0 2px 8px rgb(0 0 0 / 0.18);\n}\n.dve-smartart-notes[hidden] {\n display: none;\n}\n/* The SmartArt text pane docks beside the page while a SmartArt is selected and the pane is open. */\n.dve-smartart-text-pane {\n flex: none;\n align-self: flex-start;\n width: 260px;\n max-width: 40%;\n margin: 12px 12px 0 0;\n}\n.dve-smartart-text-pane[hidden] {\n display: none;\n}\n.dve-smartart-dialog .dve-smartart-picker {\n display: grid;\n width: min(760px, 86vw);\n}\n";
|
|
21769
22372
|
|
|
21770
22373
|
// raw-css:/home/runner/work/ooxml/ooxml/src/ui/src/docx/styles/content-controls.css?raw
|
|
21771
|
-
var content_controls_default = "/* Content controls (w:sdt): Word's hover and selected outline, title tab and grey placeholder. */\n.dve-sdt {\n position: relative;\n box-decoration-break: clone;\n -webkit-box-decoration-break: clone;\n}\n.dve-sdt[data-sdt-placeholder],\np[data-sdt-block] .dve-sdt[data-sdt-placeholder],\ntd[data-sdt-cell][data-sdt-placeholder] {\n color: #808080;\n}\n.dve-sdt:hover,\n.dve-sdt.dve-sdt-active,\np[data-sdt-block]:hover,\np[data-sdt-block].dve-sdt-active,\ntd[data-sdt-cell]:hover,\ntd[data-sdt-cell].dve-sdt-active {\n outline: 1px solid var(--dve-sdt-outline, #b6b6b6);\n outline-offset: 1px;\n}\n/* A control around a table cell outlines the cell inside its borders. */\ntd[data-sdt-cell] {\n position: relative;\n}\ntd[data-sdt-cell]:hover,\ntd[data-sdt-cell].dve-sdt-active {\n outline-offset: -2px;\n}\n.dve-sdt.dve-sdt-active,\np[data-sdt-block].dve-sdt-active,\ntd[data-sdt-cell].dve-sdt-active {\n outline-color: var(--dve-sdt-active, #4472c4);\n}\n/* The title tab sits above the control while it is hovered or holds the caret. */\n.dve-sdt[data-sdt-title]:hover::before,\n.dve-sdt[data-sdt-title].dve-sdt-active::before,\np[data-sdt-block][data-sdt-title]:hover::before,\np[data-sdt-block][data-sdt-title].dve-sdt-active::before,\ntd[data-sdt-cell][data-sdt-title]:hover::before,\ntd[data-sdt-cell][data-sdt-title].dve-sdt-active::before {\n content: attr(data-sdt-title);\n position: absolute;\n left: -1px;\n bottom: 100%;\n max-width: 22em;\n padding: 0 6px;\n overflow: hidden;\n background: var(--dve-sdt-active, #4472c4);\n color: #fff;\n font: 11px/16px var(--office-font, system-ui, sans-serif);\n text-overflow: ellipsis;\n white-space: nowrap;\n pointer-events: none;\n z-index: 2;\n}\np[data-sdt-block] {\n position: relative;\n}\np[data-sdt-block][data-sdt-title]:hover::before,\np[data-sdt-block][data-sdt-title].dve-sdt-active::before,\ntd[data-sdt-cell][data-sdt-title]:hover::before,\ntd[data-sdt-cell][data-sdt-title].dve-sdt-active::before {\n bottom: auto;\n top: -17px;\n}\n/* A drop-down, combo box or date picker shows its arrow at the end. */\n.dve-sdt[data-sdt-kind='dropDownList'].dve-sdt-active::after,\n.dve-sdt[data-sdt-kind='comboBox'].dve-sdt-active::after,\n.dve-sdt[data-sdt-kind='date'].dve-sdt-active::after,\n.dve-sdt[data-sdt-kind='dropDownList']:hover::after,\n.dve-sdt[data-sdt-kind='comboBox']:hover::after,\n.dve-sdt[data-sdt-kind='date']:hover::after {\n content: '\\25be';\n display: inline-block;\n width: 16px;\n margin-left: 4px;\n background: var(--dve-sdt-active, #4472c4);\n color: #fff;\n font-size: 11px;\n line-height: 16px;\n text-align: center;\n vertical-align: baseline;\n cursor: pointer;\n}\n.dve-sdt[data-sdt-kind='date']:hover::after,\n.dve-sdt[data-sdt-kind='date'].dve-sdt-active::after {\n content: '\\25bc';\n font-size: 8px;\n}\n.dve-sdt[data-sdt-kind='checkbox'],\ntd[data-sdt-cell][data-sdt-kind='checkbox'],\ntd[data-sdt-cell][data-sdt-kind='dropDownList'] {\n cursor: pointer;\n}\n/* A drop-down or date cell shows its arrow at the cell's top right corner. */\ntd[data-sdt-cell][data-sdt-kind='dropDownList']:is(:hover, .dve-sdt-active)::after,\ntd[data-sdt-cell][data-sdt-kind='comboBox']:is(:hover, .dve-sdt-active)::after,\ntd[data-sdt-cell][data-sdt-kind='date']:is(:hover, .dve-sdt-active)::after {\n content: '\\25be';\n position: absolute;\n top: 2px;\n right: 2px;\n width: 16px;\n background: var(--dve-sdt-active, #4472c4);\n color: #fff;\n font-size: 11px;\n line-height: 16px;\n text-align: center;\n pointer-events: none;\n}\n.dve-sdt[data-sdt-lock='sdtLocked']:hover,\n.dve-sdt[data-sdt-lock='sdtContentLocked']:hover {\n outline-style: solid;\n}\n\n/* The calendar and list popups of drop-down, combo box and date controls. */\n.ribbon-popover.sdt-calendar {\n display: grid;\n gap: 6px;\n width: 224px;\n padding: 8px;\n}\n.sdt-calendar-head {\n display: flex;\n align-items: center;\n justify-content: space-between;\n color: var(--ink);\n font: 600 13px var(--office-font, system-ui, sans-serif);\n}\n.sdt-calendar-head button,\n.sdt-calendar-foot button {\n min-width: 26px;\n height: 24px;\n border: 1px solid transparent;\n background: transparent;\n color: var(--ink);\n font: inherit;\n cursor: pointer;\n}\n.sdt-calendar-head button:hover,\n.sdt-calendar-foot button:hover {\n background: var(--accent-soft);\n}\n.sdt-calendar-grid {\n display: grid;\n grid-template-columns: repeat(7, 1fr);\n gap: 1px;\n text-align: center;\n}\n.sdt-calendar-grid span,\n.sdt-calendar-grid button {\n height: 26px;\n border: 1px solid transparent;\n background: transparent;\n color: var(--ink);\n font: 12px var(--office-font, system-ui, sans-serif);\n line-height: 24px;\n}\n.sdt-calendar-grid span {\n color: var(--muted);\n}\n.sdt-calendar-grid button {\n cursor: pointer;\n}\n.sdt-calendar-grid button:hover,\n.sdt-calendar-grid button:focus-visible {\n background: var(--accent-soft);\n}\n.sdt-calendar-grid button.outside {\n color: var(--muted);\n}\n.sdt-calendar-grid button.today {\n border-color: var(--blue);\n}\n.sdt-calendar-grid button.selected {\n background: var(--blue);\n color: #fff;\n}\n.sdt-calendar-foot {\n display: flex;\n justify-content: center;\n}\n\n/* Insert > Equation dialog: the LaTeX source and the live preview. */\n.dve-equation-source {\n width: 100%;\n box-sizing: border-box;\n font:\n 13px/1.4 Consolas,\n 'Cascadia Mono',\n monospace;\n}\n.dve-equation-preview {\n display: flex;\n align-items: center;\n justify-content: center;\n min-height: 64px;\n padding: 8px;\n overflow: auto;\n border: 1px solid var(--line);\n background: var(--surface);\n color: var(--ink);\n font-size: 20px;\n}\n\n/* Legacy form fields: Word shades a text field's result, and draws a check box or a drop-down's\n entry from the field's data on its (otherwise hidden) begin marker. */\n.ProseMirror:not([data-form-shading='off']) span[data-field='FORMTEXT'],\n.ProseMirror:not([data-form-shading='off']) .dve-form-field {\n background-color: var(--dve-form-field-shading, #d9d9d9);\n}\n.dve-field-marker.dve-form-field {\n font-size: inherit;\n cursor: default;\n}\n";
|
|
22374
|
+
var content_controls_default = "/* Content controls (w:sdt): Word's hover and selected outline, title tab and grey placeholder. */\n.dve-sdt {\n position: relative;\n box-decoration-break: clone;\n -webkit-box-decoration-break: clone;\n}\n.dve-sdt[data-sdt-placeholder],\np[data-sdt-block] .dve-sdt[data-sdt-placeholder],\ntd[data-sdt-cell][data-sdt-placeholder] {\n color: #808080;\n}\n.dve-sdt:hover,\n.dve-sdt.dve-sdt-active,\np[data-sdt-block]:hover,\np[data-sdt-block].dve-sdt-active,\ntd[data-sdt-cell]:hover,\ntd[data-sdt-cell].dve-sdt-active {\n outline: 1px solid var(--dve-sdt-outline, #b6b6b6);\n outline-offset: 1px;\n}\n/* A control around a table cell outlines the cell inside its borders. */\ntd[data-sdt-cell] {\n position: relative;\n}\ntd[data-sdt-cell]:hover,\ntd[data-sdt-cell].dve-sdt-active {\n outline-offset: -2px;\n}\n.dve-sdt.dve-sdt-active,\np[data-sdt-block].dve-sdt-active,\ntd[data-sdt-cell].dve-sdt-active {\n outline-color: var(--dve-sdt-active, #4472c4);\n}\n/* The title tab sits above the control while it is hovered or holds the caret. */\n.dve-sdt[data-sdt-title]:hover::before,\n.dve-sdt[data-sdt-title].dve-sdt-active::before,\np[data-sdt-block][data-sdt-title]:hover::before,\np[data-sdt-block][data-sdt-title].dve-sdt-active::before,\ntd[data-sdt-cell][data-sdt-title]:hover::before,\ntd[data-sdt-cell][data-sdt-title].dve-sdt-active::before {\n content: attr(data-sdt-title);\n position: absolute;\n left: -1px;\n bottom: 100%;\n max-width: 22em;\n padding: 0 6px;\n overflow: hidden;\n background: var(--dve-sdt-active, #4472c4);\n color: #fff;\n font: 11px/16px var(--office-font, system-ui, sans-serif);\n text-overflow: ellipsis;\n white-space: nowrap;\n pointer-events: none;\n z-index: 2;\n}\np[data-sdt-block] {\n position: relative;\n}\np[data-sdt-block][data-sdt-title]:hover::before,\np[data-sdt-block][data-sdt-title].dve-sdt-active::before,\ntd[data-sdt-cell][data-sdt-title]:hover::before,\ntd[data-sdt-cell][data-sdt-title].dve-sdt-active::before {\n bottom: auto;\n top: -17px;\n}\n/* A drop-down, combo box or date picker shows its arrow at the end. */\n.dve-sdt[data-sdt-kind='dropDownList'].dve-sdt-active::after,\n.dve-sdt[data-sdt-kind='comboBox'].dve-sdt-active::after,\n.dve-sdt[data-sdt-kind='date'].dve-sdt-active::after,\n.dve-sdt[data-sdt-kind='dropDownList']:hover::after,\n.dve-sdt[data-sdt-kind='comboBox']:hover::after,\n.dve-sdt[data-sdt-kind='date']:hover::after {\n content: '\\25be';\n display: inline-block;\n width: 16px;\n margin-left: 4px;\n background: var(--dve-sdt-active, #4472c4);\n color: #fff;\n font-size: 11px;\n line-height: 16px;\n text-align: center;\n vertical-align: baseline;\n cursor: pointer;\n}\n.dve-sdt[data-sdt-kind='date']:hover::after,\n.dve-sdt[data-sdt-kind='date'].dve-sdt-active::after {\n content: '\\25bc';\n font-size: 8px;\n}\n.dve-sdt[data-sdt-kind='checkbox'],\ntd[data-sdt-cell][data-sdt-kind='checkbox'],\ntd[data-sdt-cell][data-sdt-kind='dropDownList'] {\n cursor: pointer;\n}\n/* A drop-down or date cell shows its arrow at the cell's top right corner. */\ntd[data-sdt-cell][data-sdt-kind='dropDownList']:is(:hover, .dve-sdt-active)::after,\ntd[data-sdt-cell][data-sdt-kind='comboBox']:is(:hover, .dve-sdt-active)::after,\ntd[data-sdt-cell][data-sdt-kind='date']:is(:hover, .dve-sdt-active)::after {\n content: '\\25be';\n position: absolute;\n top: 2px;\n right: 2px;\n width: 16px;\n background: var(--dve-sdt-active, #4472c4);\n color: #fff;\n font-size: 11px;\n line-height: 16px;\n text-align: center;\n pointer-events: none;\n}\n.dve-sdt[data-sdt-lock='sdtLocked']:hover,\n.dve-sdt[data-sdt-lock='sdtContentLocked']:hover {\n outline-style: solid;\n}\n\n/* The calendar and list popups of drop-down, combo box and date controls. */\n.ribbon-popover.sdt-calendar {\n display: grid;\n gap: 6px;\n width: 224px;\n padding: 8px;\n}\n.sdt-calendar-head {\n display: flex;\n align-items: center;\n justify-content: space-between;\n color: var(--ink);\n font: 600 13px var(--office-font, system-ui, sans-serif);\n}\n.sdt-calendar-head button,\n.sdt-calendar-foot button {\n min-width: 26px;\n height: 24px;\n border: 1px solid transparent;\n background: transparent;\n color: var(--ink);\n font: inherit;\n cursor: pointer;\n}\n.sdt-calendar-head button:hover,\n.sdt-calendar-foot button:hover {\n background: var(--accent-soft);\n}\n.sdt-calendar-grid {\n display: grid;\n grid-template-columns: repeat(7, 1fr);\n gap: 1px;\n text-align: center;\n}\n.sdt-calendar-grid span,\n.sdt-calendar-grid button {\n height: 26px;\n border: 1px solid transparent;\n background: transparent;\n color: var(--ink);\n font: 12px var(--office-font, system-ui, sans-serif);\n line-height: 24px;\n}\n.sdt-calendar-grid span {\n color: var(--muted);\n}\n.sdt-calendar-grid button {\n cursor: pointer;\n}\n.sdt-calendar-grid button:hover,\n.sdt-calendar-grid button:focus-visible {\n background: var(--accent-soft);\n}\n.sdt-calendar-grid button.outside {\n color: var(--muted);\n}\n.sdt-calendar-grid button.today {\n border-color: var(--blue);\n}\n.sdt-calendar-grid button.selected {\n background: var(--blue);\n color: #fff;\n}\n.sdt-calendar-foot {\n display: flex;\n justify-content: center;\n}\n\n/* Insert > Equation dialog: the LaTeX source and the live preview. */\n.dve-equation-source {\n width: 100%;\n box-sizing: border-box;\n font:\n 13px/1.4 Consolas,\n 'Cascadia Mono',\n monospace;\n}\n.dve-equation-preview {\n display: flex;\n align-items: center;\n justify-content: center;\n min-height: 64px;\n padding: 8px;\n overflow: auto;\n border: 1px solid var(--line);\n background: var(--surface);\n color: var(--ink);\n font-size: 20px;\n}\n\n/* Legacy form fields: Word shades a text field's result, and draws a check box or a drop-down's\n entry from the field's data on its (otherwise hidden) begin marker. */\n.ProseMirror:not([data-form-shading='off']) span[data-field='FORMTEXT'],\n.ProseMirror:not([data-form-shading='off']) .dve-form-field {\n background-color: var(--dve-form-field-shading, #d9d9d9);\n}\n.dve-field-marker.dve-form-field {\n font-size: inherit;\n cursor: default;\n}\n\n/* Restrict Editing: the regions the document lets the current user edit, highlighted as Word does. */\n.ProseMirror .dve-editable-region {\n background-color: var(--dve-editable-region, rgba(255, 213, 79, 0.35));\n box-shadow: inset 0 -1px 0 rgba(191, 144, 0, 0.55);\n}\n";
|
|
21772
22375
|
|
|
21773
22376
|
// raw-css:/home/runner/work/ooxml/ooxml/src/ui/src/docx/styles/shapes.css?raw
|
|
21774
22377
|
var shapes_default = "/* Drawing shapes on the editing surface, the draw tool and the Insert > Shapes gallery. */\n.ProseMirror p {\n position: relative;\n}\n.dve-shape {\n display: inline-block;\n position: relative;\n vertical-align: bottom;\n line-height: 0;\n}\n.dve-shape svg {\n display: block;\n}\n.dve-shape-floating {\n position: absolute;\n z-index: 2;\n}\n.dve-shape-floating.dve-shape-behind {\n z-index: 0;\n}\n.dve-shape-selected {\n outline: 2px solid var(--blue, #2b579a);\n outline-offset: 2px;\n}\n.dve-shape-handle {\n display: none;\n position: absolute;\n right: -6px;\n bottom: -6px;\n width: 9px;\n height: 9px;\n border: 1px solid var(--blue, #2b579a);\n background: #fff;\n cursor: nwse-resize;\n}\n.dve-shape-selected .dve-shape-handle {\n display: block;\n}\n.dve-drawing-shape,\n.dve-drawing-shape * {\n cursor: crosshair !important;\n}\n.dve-shape-rubber {\n position: fixed;\n z-index: 1000;\n border: 1px dashed var(--blue, #2b579a);\n background: rgba(68, 114, 196, 0.12);\n pointer-events: none;\n}\n\n.ribbon-popover.shape-picker {\n width: 244px;\n max-height: 420px;\n padding: 6px 8px 8px;\n overflow-y: auto;\n}\n.shape-picker h4 {\n margin: 6px 0 4px;\n color: var(--muted);\n font: 600 11px var(--office-font, system-ui, sans-serif);\n}\n.shape-picker-grid {\n display: grid;\n grid-template-columns: repeat(8, 26px);\n gap: 2px;\n}\n.shape-picker-grid button {\n display: flex;\n align-items: center;\n justify-content: center;\n width: 26px;\n height: 26px;\n padding: 0;\n border: 1px solid transparent;\n background: transparent;\n cursor: pointer;\n}\n.shape-picker-grid button:hover,\n.shape-picker-grid button:focus-visible {\n border-color: var(--blue, #2b579a);\n background: var(--accent-soft);\n}\n";
|
|
@@ -21802,77 +22405,66 @@ var editorStyleText = [
|
|
|
21802
22405
|
content_controls_default,
|
|
21803
22406
|
shapes_default
|
|
21804
22407
|
].join("\n");
|
|
21805
|
-
function
|
|
21806
|
-
|
|
21807
|
-
|
|
21808
|
-
|
|
21809
|
-
const
|
|
21810
|
-
|
|
21811
|
-
|
|
21812
|
-
|
|
21813
|
-
|
|
21814
|
-
|
|
21815
|
-
|
|
21816
|
-
|
|
21817
|
-
|
|
21818
|
-
|
|
21819
|
-
|
|
21820
|
-
|
|
21821
|
-
|
|
21822
|
-
}
|
|
21823
|
-
|
|
21824
|
-
|
|
21825
|
-
|
|
21826
|
-
|
|
21827
|
-
|
|
21828
|
-
|
|
21829
|
-
|
|
21830
|
-
|
|
22408
|
+
function findableText(doc) {
|
|
22409
|
+
let text = "";
|
|
22410
|
+
const from2 = [];
|
|
22411
|
+
const to = [];
|
|
22412
|
+
const add = (char, start2, end2) => {
|
|
22413
|
+
text += char;
|
|
22414
|
+
from2.push(start2);
|
|
22415
|
+
to.push(end2);
|
|
22416
|
+
};
|
|
22417
|
+
let previous = null;
|
|
22418
|
+
const inline = (parent, start2) => {
|
|
22419
|
+
parent.forEach((child, offset) => {
|
|
22420
|
+
const pos = start2 + offset;
|
|
22421
|
+
if (child.isText) {
|
|
22422
|
+
const value = child.text ?? "";
|
|
22423
|
+
for (let index = 0; index < value.length; index++)
|
|
22424
|
+
add(value.charAt(index), pos + index, pos + index + 1);
|
|
22425
|
+
} else if (child.type.name === "hardBreak") {
|
|
22426
|
+
add(FIND_LINE_BREAK, pos, pos + child.nodeSize);
|
|
22427
|
+
} else if (child.type.name === "pageBreak" && child.attrs.kind !== "column") {
|
|
22428
|
+
add(FIND_PAGE_BREAK, pos, pos + child.nodeSize);
|
|
22429
|
+
} else if (child.isLeaf) {
|
|
22430
|
+
add(FIND_OBJECT, pos, pos + child.nodeSize);
|
|
22431
|
+
} else {
|
|
22432
|
+
inline(child, pos + 1);
|
|
22433
|
+
}
|
|
22434
|
+
});
|
|
21831
22435
|
};
|
|
21832
|
-
|
|
21833
|
-
|
|
21834
|
-
|
|
21835
|
-
|
|
21836
|
-
|
|
21837
|
-
|
|
21838
|
-
|
|
21839
|
-
|
|
21840
|
-
|
|
21841
|
-
|
|
21842
|
-
|
|
21843
|
-
|
|
21844
|
-
|
|
21845
|
-
|
|
21846
|
-
|
|
21847
|
-
|
|
21848
|
-
|
|
21849
|
-
|
|
21850
|
-
kept += text[index];
|
|
21851
|
-
offsets.push(index);
|
|
21852
|
-
}
|
|
21853
|
-
return { text: kept, offsets };
|
|
21854
|
-
}
|
|
21855
|
-
function collectMatches(doc, query, caseSensitive) {
|
|
21856
|
-
const literal = query.replaceAll(SOFT_HYPHEN, "");
|
|
21857
|
-
if (!literal) return [];
|
|
21858
|
-
const expression = new RegExp(escapedLiteral(literal), caseSensitive ? "gu" : "giu");
|
|
21859
|
-
const matches = [];
|
|
21860
|
-
doc.descendants((node, pos) => {
|
|
21861
|
-
if (node.type.name !== "paragraph") return;
|
|
21862
|
-
for (const segment of paragraphSegments(node, pos)) {
|
|
21863
|
-
const boundaries = graphemeBoundaries(segment.text);
|
|
21864
|
-
const { text, offsets } = withoutSoftHyphens(segment.text);
|
|
21865
|
-
expression.lastIndex = 0;
|
|
21866
|
-
for (const match of text.matchAll(expression)) {
|
|
21867
|
-
const start2 = offsets[match.index];
|
|
21868
|
-
const end2 = offsets[match.index + match[0].length - 1] + 1;
|
|
21869
|
-
if (boundaries.has(start2) && boundaries.has(end2))
|
|
21870
|
-
matches.push({ from: segment.from + start2, to: segment.from + end2 });
|
|
22436
|
+
const block = (parent, start2) => {
|
|
22437
|
+
parent.forEach((child, offset) => {
|
|
22438
|
+
const pos = start2 + offset;
|
|
22439
|
+
if (child.isTextblock) {
|
|
22440
|
+
const contentStart = pos + 1;
|
|
22441
|
+
if (previous)
|
|
22442
|
+
add(
|
|
22443
|
+
previous.parent === parent ? FIND_PARAGRAPH_MARK : FIND_OBJECT,
|
|
22444
|
+
previous.end,
|
|
22445
|
+
contentStart
|
|
22446
|
+
);
|
|
22447
|
+
inline(child, contentStart);
|
|
22448
|
+
previous = { parent, end: pos + child.nodeSize - 1 };
|
|
22449
|
+
} else if (child.isLeaf) {
|
|
22450
|
+
add(FIND_OBJECT, pos, pos + child.nodeSize);
|
|
22451
|
+
previous = null;
|
|
22452
|
+
} else {
|
|
22453
|
+
block(child, pos + 1);
|
|
21871
22454
|
}
|
|
21872
|
-
}
|
|
21873
|
-
|
|
21874
|
-
|
|
21875
|
-
return
|
|
22455
|
+
});
|
|
22456
|
+
};
|
|
22457
|
+
block(doc, 0);
|
|
22458
|
+
return { text, from: from2, to };
|
|
22459
|
+
}
|
|
22460
|
+
function findDocumentMatches(doc, query, options = {}) {
|
|
22461
|
+
const flat = findableText(doc);
|
|
22462
|
+
return findMatches(flat.text, query, options).map((match) => ({
|
|
22463
|
+
from: expectDefined(flat.from[match.start], "match start"),
|
|
22464
|
+
to: expectDefined(flat.to[match.end - 1], "match end"),
|
|
22465
|
+
text: match.text,
|
|
22466
|
+
groups: match.groups
|
|
22467
|
+
}));
|
|
21876
22468
|
}
|
|
21877
22469
|
function marksAt(doc, pos) {
|
|
21878
22470
|
const $pos = doc.resolve(pos);
|
|
@@ -21880,32 +22472,126 @@ function marksAt(doc, pos) {
|
|
|
21880
22472
|
if ($pos.nodeBefore?.isText) return $pos.nodeBefore.marks;
|
|
21881
22473
|
return $pos.marks();
|
|
21882
22474
|
}
|
|
22475
|
+
function replacementParagraphs(schema2, parts, marks2) {
|
|
22476
|
+
const paragraphs = [[]];
|
|
22477
|
+
let buffer = "";
|
|
22478
|
+
const flush = () => {
|
|
22479
|
+
if (!buffer) return;
|
|
22480
|
+
const content = paragraphs[paragraphs.length - 1];
|
|
22481
|
+
content?.push(schema2.text(buffer, insertedTextMarks(marks2, buffer)));
|
|
22482
|
+
buffer = "";
|
|
22483
|
+
};
|
|
22484
|
+
const inline = (node) => {
|
|
22485
|
+
flush();
|
|
22486
|
+
paragraphs[paragraphs.length - 1]?.push(node);
|
|
22487
|
+
};
|
|
22488
|
+
const text = (value) => {
|
|
22489
|
+
for (const char of value) {
|
|
22490
|
+
if (char === FIND_PARAGRAPH_MARK) {
|
|
22491
|
+
flush();
|
|
22492
|
+
paragraphs.push([]);
|
|
22493
|
+
} else if (char === FIND_LINE_BREAK) {
|
|
22494
|
+
inline(
|
|
22495
|
+
expectDefined(schema2.nodes.hardBreak, "hardBreak node type").create(null, null, marks2)
|
|
22496
|
+
);
|
|
22497
|
+
} else if (char === FIND_PAGE_BREAK) {
|
|
22498
|
+
inline(
|
|
22499
|
+
expectDefined(schema2.nodes.pageBreak, "pageBreak node type").create(
|
|
22500
|
+
{ kind: "page" },
|
|
22501
|
+
null,
|
|
22502
|
+
marks2
|
|
22503
|
+
)
|
|
22504
|
+
);
|
|
22505
|
+
} else if (char !== FIND_OBJECT) {
|
|
22506
|
+
buffer += char;
|
|
22507
|
+
}
|
|
22508
|
+
}
|
|
22509
|
+
};
|
|
22510
|
+
for (const part of parts) {
|
|
22511
|
+
if (part.kind === "text") text(part.text);
|
|
22512
|
+
else if (part.kind === "paragraph") {
|
|
22513
|
+
flush();
|
|
22514
|
+
paragraphs.push([]);
|
|
22515
|
+
} else if (part.kind === "lineBreak") text(FIND_LINE_BREAK);
|
|
22516
|
+
else if (part.kind === "pageBreak") text(FIND_PAGE_BREAK);
|
|
22517
|
+
else if (part.kind === "tab") text(" ");
|
|
22518
|
+
else if (part.kind === "optionalHyphen") text("\xAD");
|
|
22519
|
+
else if (part.kind === "nonBreakingHyphen") text("\u2011");
|
|
22520
|
+
else text("\xA0");
|
|
22521
|
+
}
|
|
22522
|
+
flush();
|
|
22523
|
+
return paragraphs;
|
|
22524
|
+
}
|
|
22525
|
+
function replaceTargets(state, targets) {
|
|
22526
|
+
const { schema: schema2 } = state;
|
|
22527
|
+
const ids = /* @__PURE__ */ new Set();
|
|
22528
|
+
state.doc.descendants((node) => {
|
|
22529
|
+
if (typeof node.attrs.id === "string" && node.attrs.id) ids.add(node.attrs.id);
|
|
22530
|
+
});
|
|
22531
|
+
let counter3 = 0;
|
|
22532
|
+
const nextId = () => {
|
|
22533
|
+
let id = "";
|
|
22534
|
+
do
|
|
22535
|
+
id = `dve-find-${++counter3}`;
|
|
22536
|
+
while (ids.has(id));
|
|
22537
|
+
ids.add(id);
|
|
22538
|
+
return id;
|
|
22539
|
+
};
|
|
22540
|
+
const paragraph2 = expectDefined(schema2.nodes.paragraph, "paragraph node type");
|
|
22541
|
+
let transaction = state.tr;
|
|
22542
|
+
for (const target of [...targets].sort((left, right) => right.from - left.from)) {
|
|
22543
|
+
const $from = state.doc.resolve(target.from);
|
|
22544
|
+
const attrs = $from.parent.attrs;
|
|
22545
|
+
const blocks = replacementParagraphs(schema2, target.parts, marksAt(state.doc, target.from));
|
|
22546
|
+
const nodes = blocks.map(
|
|
22547
|
+
(content, index) => paragraph2.create(index === 0 ? attrs : { ...attrs, id: nextId() }, content)
|
|
22548
|
+
);
|
|
22549
|
+
transaction = transaction.replace(
|
|
22550
|
+
target.from,
|
|
22551
|
+
target.to,
|
|
22552
|
+
new Slice(Fragment.from(nodes), 1, 1)
|
|
22553
|
+
);
|
|
22554
|
+
}
|
|
22555
|
+
return transaction;
|
|
22556
|
+
}
|
|
22557
|
+
|
|
22558
|
+
// src/docx/search-controller.ts
|
|
21883
22559
|
var SearchController = class {
|
|
21884
22560
|
constructor(getView) {
|
|
21885
22561
|
this.getView = getView;
|
|
21886
22562
|
}
|
|
21887
22563
|
getView;
|
|
21888
22564
|
query = "";
|
|
21889
|
-
|
|
22565
|
+
options = {};
|
|
21890
22566
|
matches = [];
|
|
21891
22567
|
activeIndex = -1;
|
|
22568
|
+
invalid = false;
|
|
21892
22569
|
get status() {
|
|
21893
22570
|
return {
|
|
21894
22571
|
query: this.query,
|
|
21895
22572
|
count: this.matches.length,
|
|
21896
22573
|
active: this.activeIndex < 0 ? 0 : this.activeIndex + 1,
|
|
21897
|
-
readOnly: !this.getView()?.editable
|
|
22574
|
+
readOnly: !this.getView()?.editable,
|
|
22575
|
+
invalid: this.invalid
|
|
21898
22576
|
};
|
|
21899
22577
|
}
|
|
21900
|
-
search(query,
|
|
22578
|
+
search(query, options = this.options) {
|
|
21901
22579
|
this.query = query;
|
|
21902
|
-
this.
|
|
21903
|
-
|
|
21904
|
-
this.activeIndex = this.indexAtSelection();
|
|
21905
|
-
return this.status;
|
|
22580
|
+
this.options = options;
|
|
22581
|
+
return this.refresh();
|
|
21906
22582
|
}
|
|
21907
22583
|
refresh() {
|
|
21908
|
-
|
|
22584
|
+
const view = this.getView();
|
|
22585
|
+
this.matches = [];
|
|
22586
|
+
this.invalid = false;
|
|
22587
|
+
if (view) {
|
|
22588
|
+
try {
|
|
22589
|
+
this.matches = findDocumentMatches(view.state.doc, this.query, this.options);
|
|
22590
|
+
} catch (error) {
|
|
22591
|
+
if (!(error instanceof FindPatternError)) throw error;
|
|
22592
|
+
this.invalid = true;
|
|
22593
|
+
}
|
|
22594
|
+
}
|
|
21909
22595
|
this.activeIndex = this.indexAtSelection();
|
|
21910
22596
|
return this.status;
|
|
21911
22597
|
}
|
|
@@ -21947,8 +22633,7 @@ var SearchController = class {
|
|
|
21947
22633
|
if (this.activeIndex < 0 && !this.findNext()) return false;
|
|
21948
22634
|
const match = this.matches[this.activeIndex];
|
|
21949
22635
|
if (!match) return false;
|
|
21950
|
-
this.replace(view, [match], replacement);
|
|
21951
|
-
return true;
|
|
22636
|
+
return this.replace(view, [match], replacement);
|
|
21952
22637
|
}
|
|
21953
22638
|
replaceAll(replacement) {
|
|
21954
22639
|
const view = this.getView();
|
|
@@ -21956,12 +22641,7 @@ var SearchController = class {
|
|
|
21956
22641
|
this.refresh();
|
|
21957
22642
|
if (!this.matches.length) return 0;
|
|
21958
22643
|
const targets = [...this.matches];
|
|
21959
|
-
this.replace(view, targets, replacement);
|
|
21960
|
-
return targets.length;
|
|
21961
|
-
}
|
|
21962
|
-
currentMatches() {
|
|
21963
|
-
const view = this.getView();
|
|
21964
|
-
return view ? collectMatches(view.state.doc, this.query, this.caseSensitive) : [];
|
|
22644
|
+
return this.replace(view, targets, replacement) ? targets.length : 0;
|
|
21965
22645
|
}
|
|
21966
22646
|
indexAtSelection() {
|
|
21967
22647
|
const selection = this.getView()?.state.selection;
|
|
@@ -21979,35 +22659,29 @@ var SearchController = class {
|
|
|
21979
22659
|
);
|
|
21980
22660
|
return match;
|
|
21981
22661
|
}
|
|
22662
|
+
/** Replaces the matches (in document order) in one undoable step; false if the replacement is invalid. */
|
|
21982
22663
|
replace(view, matches, replacement) {
|
|
21983
|
-
const
|
|
21984
|
-
let
|
|
21985
|
-
|
|
21986
|
-
|
|
21987
|
-
|
|
21988
|
-
|
|
21989
|
-
|
|
21990
|
-
|
|
21991
|
-
|
|
21992
|
-
|
|
21993
|
-
|
|
21994
|
-
|
|
22664
|
+
const wildcards = Boolean(this.options.wildcards);
|
|
22665
|
+
let targets;
|
|
22666
|
+
try {
|
|
22667
|
+
targets = matches.map((match) => ({
|
|
22668
|
+
from: match.from,
|
|
22669
|
+
to: match.to,
|
|
22670
|
+
parts: replacementParts(replacement, match, wildcards)
|
|
22671
|
+
}));
|
|
22672
|
+
} catch (error) {
|
|
22673
|
+
if (!(error instanceof FindPatternError)) throw error;
|
|
22674
|
+
this.invalid = true;
|
|
22675
|
+
return false;
|
|
22676
|
+
}
|
|
22677
|
+
const transaction = replaceTargets(view.state, targets);
|
|
22678
|
+
const cursor = transaction.mapping.map(expectDefined(matches[0], "first match").to, 1);
|
|
22679
|
+
const selection = TextSelection.near(transaction.doc.resolve(cursor));
|
|
22680
|
+
view.dispatch(closeHistory(transaction.setSelection(selection).scrollIntoView()));
|
|
21995
22681
|
this.refresh();
|
|
22682
|
+
return true;
|
|
21996
22683
|
}
|
|
21997
22684
|
};
|
|
21998
|
-
function replacementFragment(schema2, replacement, marks2) {
|
|
21999
|
-
if (!replacement) return Fragment.empty;
|
|
22000
|
-
const lines3 = replacement.split(/\r\n|\r|\n/);
|
|
22001
|
-
const content = [];
|
|
22002
|
-
lines3.forEach((line, index) => {
|
|
22003
|
-
if (line) content.push(schema2.text(line, insertedTextMarks(marks2, line)));
|
|
22004
|
-
if (index < lines3.length - 1)
|
|
22005
|
-
content.push(
|
|
22006
|
-
expectDefined(schema2.nodes.hardBreak, "hardBreak node type").create(null, null, marks2)
|
|
22007
|
-
);
|
|
22008
|
-
});
|
|
22009
|
-
return Fragment.fromArray(content);
|
|
22010
|
-
}
|
|
22011
22685
|
|
|
22012
22686
|
// src/docx/search-panel.ts
|
|
22013
22687
|
var styleText = `
|
|
@@ -22016,11 +22690,45 @@ var styleText = `
|
|
|
22016
22690
|
.dve-search-panel label{display:flex;flex-direction:column;gap:3px;color:var(--muted,#666)}
|
|
22017
22691
|
.dve-search-panel input[type=search],.dve-search-panel input[type=text]{box-sizing:border-box;width:clamp(130px,20vw,220px);height:29px;padding:4px 7px;border:1px solid var(--line,#ddd);border-radius:3px;background:var(--surface,#fff);color:var(--ink,#222);font:inherit}
|
|
22018
22692
|
.dve-search-panel .case{flex-direction:row;align-items:center;align-self:center;gap:5px;white-space:nowrap}
|
|
22693
|
+
.dve-search-panel .dve-search-options{display:flex;flex-basis:100%;flex-wrap:wrap;gap:6px 16px;padding-top:4px}
|
|
22694
|
+
.dve-search-panel .dve-search-options[hidden]{display:none}
|
|
22695
|
+
.dve-search-panel .dve-search-options label{flex-direction:row;align-items:center;gap:5px;white-space:nowrap}
|
|
22696
|
+
.dve-search-panel .dve-search-options label[aria-disabled=true]{opacity:.55}
|
|
22697
|
+
.dve-search-panel select{height:29px;padding:0 6px;border:1px solid var(--line,#ddd);border-radius:3px;background:var(--surface,#fff);color:var(--ink,#222);font:inherit}
|
|
22019
22698
|
.dve-search-panel button{height:29px;padding:0 9px;border:1px solid var(--line,#ddd);border-radius:3px;background:var(--surface,#fff);color:var(--ink,#222);font:inherit;cursor:pointer}
|
|
22020
22699
|
.dve-search-panel button:hover:not(:disabled){border-color:var(--blue,#1769aa)}
|
|
22021
22700
|
.dve-search-panel button:disabled{opacity:.55;cursor:default}
|
|
22022
22701
|
.dve-search-panel [role=status]{min-width:100px;color:var(--muted,#666)}
|
|
22023
22702
|
`;
|
|
22703
|
+
var SPECIAL_CODES = [
|
|
22704
|
+
["Paragraph Mark", "^p"],
|
|
22705
|
+
["Tab Character", "^t"],
|
|
22706
|
+
["Any Character", "^?"],
|
|
22707
|
+
["Any Digit", "^#"],
|
|
22708
|
+
["Any Letter", "^$"],
|
|
22709
|
+
["Caret Character", "^^"],
|
|
22710
|
+
["Manual Line Break", "^l"],
|
|
22711
|
+
["Page Break", "^m"],
|
|
22712
|
+
["Optional Hyphen", "^-"],
|
|
22713
|
+
["Nonbreaking Hyphen", "^~"],
|
|
22714
|
+
["Nonbreaking Space", "^s"],
|
|
22715
|
+
["White Space", "^w"]
|
|
22716
|
+
];
|
|
22717
|
+
var OPTION_LABELS = [
|
|
22718
|
+
["wholeWords", "Find whole words only"],
|
|
22719
|
+
["wildcards", "Use wildcards"],
|
|
22720
|
+
["matchPrefix", "Match prefix"],
|
|
22721
|
+
["matchSuffix", "Match suffix"],
|
|
22722
|
+
["ignorePunctuation", "Ignore punctuation characters"],
|
|
22723
|
+
["ignoreWhitespace", "Ignore white-space characters"]
|
|
22724
|
+
];
|
|
22725
|
+
var WILDCARD_DISABLED = /* @__PURE__ */ new Set([
|
|
22726
|
+
"wholeWords",
|
|
22727
|
+
"matchPrefix",
|
|
22728
|
+
"matchSuffix",
|
|
22729
|
+
"ignorePunctuation",
|
|
22730
|
+
"ignoreWhitespace"
|
|
22731
|
+
]);
|
|
22024
22732
|
function createSearchPanel(options, initialLocale = "en") {
|
|
22025
22733
|
let locale = normalizeEditorLocale(initialLocale);
|
|
22026
22734
|
const controller = new SearchController(options.getView);
|
|
@@ -22060,20 +22768,98 @@ function createSearchPanel(options, initialLocale = "en") {
|
|
|
22060
22768
|
const next = button3("Find next");
|
|
22061
22769
|
const replace = button3("Replace");
|
|
22062
22770
|
const replaceAll = button3("Replace all");
|
|
22771
|
+
const more = button3("More >>");
|
|
22772
|
+
more.setAttribute("aria-expanded", "false");
|
|
22063
22773
|
const close3 = button3("Close search");
|
|
22064
22774
|
const result = document.createElement("span");
|
|
22065
22775
|
result.setAttribute("role", "status");
|
|
22066
22776
|
result.setAttribute("aria-label", "Search results");
|
|
22067
22777
|
result.setAttribute("aria-live", "polite");
|
|
22778
|
+
const optionsSection = document.createElement("div");
|
|
22779
|
+
optionsSection.className = "dve-search-options";
|
|
22780
|
+
optionsSection.setAttribute("role", "group");
|
|
22781
|
+
optionsSection.setAttribute("aria-label", "Search options");
|
|
22782
|
+
optionsSection.hidden = true;
|
|
22783
|
+
const optionBoxes = /* @__PURE__ */ new Map();
|
|
22784
|
+
for (const [name, text] of OPTION_LABELS) {
|
|
22785
|
+
const label2 = document.createElement("label");
|
|
22786
|
+
const box2 = document.createElement("input");
|
|
22787
|
+
box2.type = "checkbox";
|
|
22788
|
+
box2.setAttribute("aria-label", text);
|
|
22789
|
+
label2.append(box2, document.createTextNode(text));
|
|
22790
|
+
optionsSection.append(label2);
|
|
22791
|
+
optionBoxes.set(name, { box: box2, label: label2 });
|
|
22792
|
+
}
|
|
22793
|
+
let lastField = findInput;
|
|
22794
|
+
const special = document.createElement("select");
|
|
22795
|
+
special.className = "dve-search-special";
|
|
22796
|
+
special.setAttribute("aria-label", "Special characters");
|
|
22797
|
+
const placeholder2 = document.createElement("option");
|
|
22798
|
+
placeholder2.value = "";
|
|
22799
|
+
placeholder2.textContent = "Special characters";
|
|
22800
|
+
special.append(placeholder2);
|
|
22801
|
+
for (const [label2, code] of SPECIAL_CODES) {
|
|
22802
|
+
const option = document.createElement("option");
|
|
22803
|
+
option.value = code;
|
|
22804
|
+
option.textContent = label2;
|
|
22805
|
+
special.append(option);
|
|
22806
|
+
}
|
|
22807
|
+
const insertCode = (code) => {
|
|
22808
|
+
const start2 = lastField.selectionStart ?? lastField.value.length;
|
|
22809
|
+
const end2 = lastField.selectionEnd ?? start2;
|
|
22810
|
+
lastField.value = lastField.value.slice(0, start2) + code + lastField.value.slice(end2);
|
|
22811
|
+
lastField.setSelectionRange(start2 + code.length, start2 + code.length);
|
|
22812
|
+
lastField.dispatchEvent(new Event("input", { bubbles: true }));
|
|
22813
|
+
lastField.focus();
|
|
22814
|
+
};
|
|
22815
|
+
special.addEventListener("change", () => {
|
|
22816
|
+
if (special.value) insertCode(special.value);
|
|
22817
|
+
special.value = "";
|
|
22818
|
+
});
|
|
22819
|
+
for (const field2 of [findInput, replaceInput])
|
|
22820
|
+
field2.addEventListener("focus", () => {
|
|
22821
|
+
lastField = field2;
|
|
22822
|
+
});
|
|
22823
|
+
const checked = (name) => optionBoxes.get(name)?.box.checked === true;
|
|
22824
|
+
const currentOptions = () => ({
|
|
22825
|
+
matchCase: caseInput.checked,
|
|
22826
|
+
wholeWords: checked("wholeWords"),
|
|
22827
|
+
wildcards: checked("wildcards"),
|
|
22828
|
+
matchPrefix: checked("matchPrefix"),
|
|
22829
|
+
matchSuffix: checked("matchSuffix"),
|
|
22830
|
+
ignorePunctuation: checked("ignorePunctuation"),
|
|
22831
|
+
ignoreWhitespace: checked("ignoreWhitespace")
|
|
22832
|
+
});
|
|
22833
|
+
const syncWildcards = () => {
|
|
22834
|
+
const wildcards = optionBoxes.get("wildcards")?.box.checked ?? false;
|
|
22835
|
+
for (const name of WILDCARD_DISABLED) {
|
|
22836
|
+
const entry = optionBoxes.get(name);
|
|
22837
|
+
if (!entry) continue;
|
|
22838
|
+
entry.box.disabled = wildcards;
|
|
22839
|
+
entry.label.setAttribute("aria-disabled", String(wildcards));
|
|
22840
|
+
}
|
|
22841
|
+
};
|
|
22068
22842
|
const renderStatus = (status) => {
|
|
22069
|
-
result.textContent = !status.query ? translate(locale, "Enter text to search") : !status.count ? translate(locale, "No matches") : status.active ? `${status.active} ${translate(locale, "of")} ${status.count} ${translate(locale, status.count === 1 ? "matches one" : "matches many")}` : `${status.count} ${translate(locale, status.count === 1 ? "matches one" : "matches many")}`;
|
|
22843
|
+
result.textContent = status.invalid ? translate(locale, "Invalid search pattern") : !status.query ? translate(locale, "Enter text to search") : !status.count ? translate(locale, "No matches") : status.active ? `${status.active} ${translate(locale, "of")} ${status.count} ${translate(locale, status.count === 1 ? "matches one" : "matches many")}` : `${status.count} ${translate(locale, status.count === 1 ? "matches one" : "matches many")}`;
|
|
22070
22844
|
replace.disabled = status.readOnly || !status.count;
|
|
22071
22845
|
replaceAll.disabled = status.readOnly || !status.count;
|
|
22072
22846
|
previous.disabled = next.disabled = !status.count;
|
|
22073
22847
|
};
|
|
22074
|
-
const refreshQuery = () => renderStatus(controller.search(findInput.value,
|
|
22848
|
+
const refreshQuery = () => renderStatus(controller.search(findInput.value, currentOptions()));
|
|
22075
22849
|
findInput.addEventListener("input", refreshQuery);
|
|
22076
22850
|
caseInput.addEventListener("change", refreshQuery);
|
|
22851
|
+
for (const [name] of OPTION_LABELS)
|
|
22852
|
+
optionBoxes.get(name)?.box.addEventListener("change", () => {
|
|
22853
|
+
syncWildcards();
|
|
22854
|
+
refreshQuery();
|
|
22855
|
+
});
|
|
22856
|
+
more.addEventListener("click", () => {
|
|
22857
|
+
const expanded = optionsSection.hidden;
|
|
22858
|
+
optionsSection.hidden = !expanded;
|
|
22859
|
+
more.setAttribute("aria-expanded", String(expanded));
|
|
22860
|
+
more.textContent = translate(locale, expanded ? "<< Less" : "More >>");
|
|
22861
|
+
more.setAttribute("aria-label", more.textContent);
|
|
22862
|
+
});
|
|
22077
22863
|
previous.addEventListener("click", () => {
|
|
22078
22864
|
controller.findPrevious();
|
|
22079
22865
|
renderStatus(controller.status);
|
|
@@ -22115,12 +22901,15 @@ function createSearchPanel(options, initialLocale = "en") {
|
|
|
22115
22901
|
findLabel,
|
|
22116
22902
|
replaceLabel,
|
|
22117
22903
|
caseLabel,
|
|
22904
|
+
special,
|
|
22118
22905
|
previous,
|
|
22119
22906
|
next,
|
|
22120
22907
|
replace,
|
|
22121
22908
|
replaceAll,
|
|
22909
|
+
more,
|
|
22122
22910
|
result,
|
|
22123
|
-
close3
|
|
22911
|
+
close3,
|
|
22912
|
+
optionsSection
|
|
22124
22913
|
);
|
|
22125
22914
|
localizeElement(panel, locale);
|
|
22126
22915
|
renderStatus(controller.status);
|
|
@@ -22137,12 +22926,13 @@ function createSearchPanel(options, initialLocale = "en") {
|
|
|
22137
22926
|
},
|
|
22138
22927
|
close: closePanel,
|
|
22139
22928
|
refresh() {
|
|
22140
|
-
controller.search(findInput.value,
|
|
22929
|
+
controller.search(findInput.value, currentOptions());
|
|
22141
22930
|
renderStatus(controller.status);
|
|
22142
22931
|
},
|
|
22143
22932
|
setLocale(value) {
|
|
22144
22933
|
locale = normalizeEditorLocale(value);
|
|
22145
22934
|
localizeElement(panel, locale);
|
|
22935
|
+
more.textContent = translate(locale, optionsSection.hidden ? "More >>" : "<< Less");
|
|
22146
22936
|
renderStatus(controller.status);
|
|
22147
22937
|
}
|
|
22148
22938
|
};
|
|
@@ -22159,8 +22949,8 @@ function measuredBorderWidth(css, fallback) {
|
|
|
22159
22949
|
cache = /* @__PURE__ */ new Map();
|
|
22160
22950
|
widths.set(document, cache);
|
|
22161
22951
|
}
|
|
22162
|
-
const
|
|
22163
|
-
const cached = cache.get(
|
|
22952
|
+
const key3 = `${view.devicePixelRatio}|${css}`;
|
|
22953
|
+
const cached = cache.get(key3);
|
|
22164
22954
|
if (cached !== void 0) return cached;
|
|
22165
22955
|
const probe = document.createElement("span");
|
|
22166
22956
|
probe.dataset.printBorderProbe = "true";
|
|
@@ -22181,7 +22971,7 @@ function measuredBorderWidth(css, fallback) {
|
|
|
22181
22971
|
try {
|
|
22182
22972
|
const actual = Number.parseFloat(view.getComputedStyle(probe).borderLeftWidth);
|
|
22183
22973
|
const width = Number.isFinite(actual) ? actual : fallback;
|
|
22184
|
-
cache.set(
|
|
22974
|
+
cache.set(key3, width);
|
|
22185
22975
|
return width;
|
|
22186
22976
|
} finally {
|
|
22187
22977
|
probe.remove();
|
|
@@ -24481,7 +25271,7 @@ function wordCommentThreads(comments) {
|
|
|
24481
25271
|
}));
|
|
24482
25272
|
}
|
|
24483
25273
|
function labels2(locale) {
|
|
24484
|
-
const t = (
|
|
25274
|
+
const t = (key3) => translate(locale, key3);
|
|
24485
25275
|
return {
|
|
24486
25276
|
heading: t("Comments"),
|
|
24487
25277
|
list: t("Comments"),
|
|
@@ -24664,8 +25454,10 @@ var ReviewController = class {
|
|
|
24664
25454
|
if (comment && commentThreadsFromDoc(view.state.doc) === void 0)
|
|
24665
25455
|
this.updateComments([...this.host.getModel().comments ?? [], comment]);
|
|
24666
25456
|
}
|
|
24667
|
-
handleReview(
|
|
24668
|
-
if (
|
|
25457
|
+
handleReview(key3) {
|
|
25458
|
+
if (forcesTrackChanges(this.host.getModel().protection) && ["trackChanges", "acceptOne", "rejectOne", "acceptAll", "rejectAll"].includes(key3))
|
|
25459
|
+
return;
|
|
25460
|
+
if (key3 === "trackChanges") {
|
|
24669
25461
|
const view2 = this.host.getView();
|
|
24670
25462
|
if (view2) toggleTrackChanges(view2.state, view2.dispatch, view2);
|
|
24671
25463
|
return;
|
|
@@ -24680,20 +25472,20 @@ var ReviewController = class {
|
|
|
24680
25472
|
previous: goToPreviousChange,
|
|
24681
25473
|
next: goToNextChange
|
|
24682
25474
|
};
|
|
24683
|
-
byKey[
|
|
25475
|
+
byKey[key3]?.(view);
|
|
24684
25476
|
}
|
|
24685
|
-
handleComments(
|
|
25477
|
+
handleComments(key3) {
|
|
24686
25478
|
const view = this.host.getView();
|
|
24687
|
-
if (
|
|
25479
|
+
if (key3 === "delete") {
|
|
24688
25480
|
const id = view && commentIdsAtSelection(view)[0];
|
|
24689
25481
|
if (id) this.deleteById(id);
|
|
24690
25482
|
return;
|
|
24691
25483
|
}
|
|
24692
|
-
if (
|
|
24693
|
-
if (view) goToComment(view,
|
|
25484
|
+
if (key3 === "previous" || key3 === "next") {
|
|
25485
|
+
if (view) goToComment(view, key3);
|
|
24694
25486
|
return;
|
|
24695
25487
|
}
|
|
24696
|
-
if (
|
|
25488
|
+
if (key3 === "toggle") {
|
|
24697
25489
|
if (this.commentsPanel.isOpen) this.commentsPanel.close();
|
|
24698
25490
|
else this.commentsPanel.open();
|
|
24699
25491
|
} else this.commentsPanel.open();
|
|
@@ -24826,11 +25618,11 @@ var PROPERTY_LABELS = [
|
|
|
24826
25618
|
function propertyFields(model, handlers, t) {
|
|
24827
25619
|
const list = document.createElement("div");
|
|
24828
25620
|
list.className = "dve-backstage-property-fields";
|
|
24829
|
-
for (const [
|
|
25621
|
+
for (const [key3, label2] of PROPERTY_LABELS) {
|
|
24830
25622
|
const input = document.createElement("input");
|
|
24831
25623
|
input.type = "text";
|
|
24832
|
-
input.value = model.properties?.[
|
|
24833
|
-
input.addEventListener("change", () => handlers.setProperty(
|
|
25624
|
+
input.value = model.properties?.[key3] ?? "";
|
|
25625
|
+
input.addEventListener("change", () => handlers.setProperty(key3, input.value));
|
|
24834
25626
|
list.append(labelled3(t(label2), input));
|
|
24835
25627
|
}
|
|
24836
25628
|
return list;
|
|
@@ -24932,7 +25724,7 @@ function renderSaveAs({ handlers, t, content }) {
|
|
|
24932
25724
|
const format = document.createElement("input");
|
|
24933
25725
|
format.type = "text";
|
|
24934
25726
|
format.readOnly = true;
|
|
24935
|
-
format.value =
|
|
25727
|
+
format.value = t("Word Document (*.docx)");
|
|
24936
25728
|
const save = () => {
|
|
24937
25729
|
if (!name.value.trim()) return;
|
|
24938
25730
|
handlers.close();
|
|
@@ -25076,7 +25868,7 @@ var BOOLEAN_KEYS = [
|
|
|
25076
25868
|
var KEYS = ["locale", "theme", "author", ...BOOLEAN_KEYS];
|
|
25077
25869
|
function wordCategories(context2, current2) {
|
|
25078
25870
|
const { t } = context2;
|
|
25079
|
-
const toggle = (
|
|
25871
|
+
const toggle = (key3, label2) => current2[key3] === void 0 ? [] : [{ kind: "toggle", key: key3, label: t(label2) }];
|
|
25080
25872
|
const display = [
|
|
25081
25873
|
{
|
|
25082
25874
|
id: "page",
|
|
@@ -25170,9 +25962,9 @@ function dialogValues(current2) {
|
|
|
25170
25962
|
theme: current2.theme === "light" || current2.theme === "dark" ? current2.theme : "auto",
|
|
25171
25963
|
author: current2.author
|
|
25172
25964
|
};
|
|
25173
|
-
for (const
|
|
25174
|
-
const value = current2[
|
|
25175
|
-
if (value !== void 0) values2[
|
|
25965
|
+
for (const key3 of BOOLEAN_KEYS) {
|
|
25966
|
+
const value = current2[key3];
|
|
25967
|
+
if (value !== void 0) values2[key3] = value;
|
|
25176
25968
|
}
|
|
25177
25969
|
return values2;
|
|
25178
25970
|
}
|
|
@@ -25195,16 +25987,16 @@ function createWordOptions(handlers, t) {
|
|
|
25195
25987
|
element.defaults = {
|
|
25196
25988
|
theme: "auto",
|
|
25197
25989
|
...Object.fromEntries(
|
|
25198
|
-
BOOLEAN_KEYS.filter((
|
|
25199
|
-
|
|
25200
|
-
|
|
25990
|
+
BOOLEAN_KEYS.filter((key3) => current2[key3] !== void 0).map((key3) => [
|
|
25991
|
+
key3,
|
|
25992
|
+
key3 === "spellCheck"
|
|
25201
25993
|
])
|
|
25202
25994
|
)
|
|
25203
25995
|
};
|
|
25204
25996
|
};
|
|
25205
25997
|
element.addEventListener("office-options-change", (event) => {
|
|
25206
25998
|
const { values: values2, changed } = event.detail;
|
|
25207
|
-
for (const
|
|
25999
|
+
for (const key3 of KEYS) if (changed.includes(key3)) handlers.setOption(key3, String(values2[key3]));
|
|
25208
26000
|
build2();
|
|
25209
26001
|
});
|
|
25210
26002
|
element.addEventListener("office-options-cancel", () => {
|
|
@@ -25386,6 +26178,9 @@ function withExtension(fileName, extension) {
|
|
|
25386
26178
|
const base = fileName.replace(/\.[^./\\]+$/, "") || "Document";
|
|
25387
26179
|
return `${base}.${extension}`;
|
|
25388
26180
|
}
|
|
26181
|
+
function docxFileName(fileName) {
|
|
26182
|
+
return /\.doc$/i.test(fileName) ? withExtension(fileName, "docx") : fileName;
|
|
26183
|
+
}
|
|
25389
26184
|
|
|
25390
26185
|
// src/docx/ribbon-actions.ts
|
|
25391
26186
|
function createRibbonActions(handlers) {
|
|
@@ -25555,7 +26350,7 @@ var EditorChrome = class {
|
|
|
25555
26350
|
this.host = host;
|
|
25556
26351
|
this.titleBar = createTitleBar({
|
|
25557
26352
|
fileCommand: (command) => void this.run(command),
|
|
25558
|
-
history: (
|
|
26353
|
+
history: (key3) => host.history(key3),
|
|
25559
26354
|
ribbon: () => host.ribbon()
|
|
25560
26355
|
});
|
|
25561
26356
|
this.ribbonActions = createRibbonActions({
|
|
@@ -25574,13 +26369,13 @@ var EditorChrome = class {
|
|
|
25574
26369
|
saveState: this.state
|
|
25575
26370
|
}),
|
|
25576
26371
|
options: () => host.options(),
|
|
25577
|
-
setOption: (
|
|
25578
|
-
setProperty: (
|
|
26372
|
+
setOption: (key3, value) => host.setOption(key3, value),
|
|
26373
|
+
setProperty: (key3, value) => {
|
|
25579
26374
|
const model = host.model();
|
|
25580
|
-
if ((model.properties?.[
|
|
26375
|
+
if ((model.properties?.[key3] ?? "") === value) return;
|
|
25581
26376
|
const next = { ...model.properties };
|
|
25582
|
-
if (value) next[
|
|
25583
|
-
else delete next[
|
|
26377
|
+
if (value) next[key3] = value;
|
|
26378
|
+
else delete next[key3];
|
|
25584
26379
|
if (Object.keys(next).length) model.properties = next;
|
|
25585
26380
|
else delete model.properties;
|
|
25586
26381
|
this.setSaveState("dirty");
|
|
@@ -25633,7 +26428,7 @@ var EditorChrome = class {
|
|
|
25633
26428
|
return this._fileName;
|
|
25634
26429
|
}
|
|
25635
26430
|
set fileName(value) {
|
|
25636
|
-
this._fileName = value || DEFAULT_FILE_NAME2;
|
|
26431
|
+
this._fileName = docxFileName(value) || DEFAULT_FILE_NAME2;
|
|
25637
26432
|
this.titleBar.setFileName(this._fileName);
|
|
25638
26433
|
}
|
|
25639
26434
|
get isDirty() {
|
|
@@ -25693,17 +26488,13 @@ var EditorChrome = class {
|
|
|
25693
26488
|
else if (command === "saveAs") {
|
|
25694
26489
|
const name = (fileName ?? "").trim();
|
|
25695
26490
|
if (!name) return;
|
|
25696
|
-
|
|
25697
|
-
this.fileName = withExtension(name, extension);
|
|
26491
|
+
this.fileName = withExtension(name, "docx");
|
|
25698
26492
|
if (this.host.customization().fileCommands.has("save"))
|
|
25699
26493
|
await this.saveDocument("saveAs", false);
|
|
25700
26494
|
else if (announceFileCommand(this.host.element, "save")) await this.saveDocument("saveAs");
|
|
25701
26495
|
} else if (command === "save") await this.saveDocument("save");
|
|
25702
26496
|
else if (command === "export")
|
|
25703
|
-
downloadBytes(
|
|
25704
|
-
await saveDocx(structuredClone(this.host.model())),
|
|
25705
|
-
withExtension(this._fileName, "docx")
|
|
25706
|
-
);
|
|
26497
|
+
downloadBytes(await this.host.save(), withExtension(this._fileName, "docx"));
|
|
25707
26498
|
} catch (cause) {
|
|
25708
26499
|
if (command === "save" || command === "saveAs") this.setSaveState("dirty");
|
|
25709
26500
|
this.host.reportError(cause instanceof Error ? cause : new Error(String(cause)));
|
|
@@ -26290,13 +27081,13 @@ function toggleFormatPainter(view, onChange) {
|
|
|
26290
27081
|
function withHeaderFooterDistance(model, index, kind, inches3) {
|
|
26291
27082
|
const sections = sectionsOf(model);
|
|
26292
27083
|
if (!Number.isFinite(inches3) || inches3 < 0 || inches3 > 22 || !sections[index]) return model;
|
|
26293
|
-
const
|
|
27084
|
+
const key3 = kind === "header" ? "headerDistanceTwips" : "footerDistanceTwips";
|
|
26294
27085
|
const distance = twips$1(Math.round(inches3 * 1440));
|
|
26295
|
-
if ((sections[index][
|
|
27086
|
+
if ((sections[index][key3] ?? 720) === distance) return model;
|
|
26296
27087
|
return {
|
|
26297
27088
|
...model,
|
|
26298
27089
|
sections: sections.map(
|
|
26299
|
-
(section3, i) => i === index ? { ...section3, [
|
|
27090
|
+
(section3, i) => i === index ? { ...section3, [key3]: distance } : section3
|
|
26300
27091
|
)
|
|
26301
27092
|
};
|
|
26302
27093
|
}
|
|
@@ -27093,11 +27884,11 @@ function computeMenuItems(state) {
|
|
|
27093
27884
|
]);
|
|
27094
27885
|
if (state.inTable)
|
|
27095
27886
|
groups.push(
|
|
27096
|
-
TABLE_ITEMS.map(([
|
|
27097
|
-
id: `table-${
|
|
27887
|
+
TABLE_ITEMS.map(([key3, label2]) => ({
|
|
27888
|
+
id: `table-${key3}`,
|
|
27098
27889
|
label: label2,
|
|
27099
|
-
command:
|
|
27100
|
-
disabled: state.readOnly || !state.canTable(
|
|
27890
|
+
command: key3 === "splitCell" ? { kind: "ribbon", action: { type: "formatDialog", kind: "splitCells" } } : { kind: "ribbon", action: { type: "tableEdit", key: key3 } },
|
|
27891
|
+
disabled: state.readOnly || !state.canTable(key3)
|
|
27101
27892
|
}))
|
|
27102
27893
|
);
|
|
27103
27894
|
return groups.flatMap(
|
|
@@ -27311,10 +28102,10 @@ function createShortcutHelp(onClose) {
|
|
|
27311
28102
|
closeButton.textContent = translate(locale, "shortcut.close");
|
|
27312
28103
|
table.replaceChildren();
|
|
27313
28104
|
const head = table.createTHead().insertRow();
|
|
27314
|
-
for (const
|
|
28105
|
+
for (const key3 of ["shortcut.columnAction", "shortcut.columnKeys"]) {
|
|
27315
28106
|
const cell = document.createElement("th");
|
|
27316
28107
|
cell.scope = "col";
|
|
27317
|
-
cell.textContent = translate(locale,
|
|
28108
|
+
cell.textContent = translate(locale, key3);
|
|
27318
28109
|
head.append(cell);
|
|
27319
28110
|
}
|
|
27320
28111
|
const body = table.createTBody();
|
|
@@ -27580,10 +28371,10 @@ function createChrome(core, api) {
|
|
|
27580
28371
|
if (state !== "saving") core.dirtyState.set(state === "dirty");
|
|
27581
28372
|
},
|
|
27582
28373
|
print: () => core.pages.print(),
|
|
27583
|
-
history: (
|
|
28374
|
+
history: (key3) => {
|
|
27584
28375
|
if (!core.view) return;
|
|
27585
|
-
if (core.parts.usesBodyHistory()) core.parts.runHistory(
|
|
27586
|
-
else runRibbonCommand(core.view, { type: "history", key:
|
|
28376
|
+
if (core.parts.usesBodyHistory()) core.parts.runHistory(key3);
|
|
28377
|
+
else runRibbonCommand(core.view, { type: "history", key: key3 }, core.collab.ids);
|
|
27587
28378
|
if (typeof document.execCommand === "function") core.targetView()?.focus();
|
|
27588
28379
|
},
|
|
27589
28380
|
toggleComments: () => shell.review?.handleComments("toggle"),
|
|
@@ -27599,17 +28390,17 @@ function createChrome(core, api) {
|
|
|
27599
28390
|
showMarks: shell.paper?.hasAttribute("data-show-marks") ?? false,
|
|
27600
28391
|
showThumbnails: core.viewOptions.showThumbnails
|
|
27601
28392
|
}),
|
|
27602
|
-
setOption: (
|
|
27603
|
-
if (
|
|
28393
|
+
setOption: (key3, value) => {
|
|
28394
|
+
if (key3 === "spellCheck") {
|
|
27604
28395
|
if (core.view) core.view.dom.spellcheck = value === "true";
|
|
27605
28396
|
core.refreshControls();
|
|
27606
|
-
} else if (
|
|
28397
|
+
} else if (key3 === "showThumbnails")
|
|
27607
28398
|
element.toggleAttribute("show-thumbnails", value === "true");
|
|
27608
|
-
else if (
|
|
27609
|
-
const current2 =
|
|
28399
|
+
else if (key3 === "showRuler" || key3 === "showMarks") {
|
|
28400
|
+
const current2 = key3 === "showRuler" ? Boolean(shell.canvas?.querySelector(".dve-ruler")) : shell.paper?.hasAttribute("data-show-marks") ?? false;
|
|
27610
28401
|
if (current2 !== (value === "true"))
|
|
27611
|
-
core.inserts.handle({ type:
|
|
27612
|
-
} else element.setAttribute(
|
|
28402
|
+
core.inserts.handle({ type: key3 === "showRuler" ? "ruler" : "showMarks" });
|
|
28403
|
+
} else element.setAttribute(key3 === "author" ? "review-author" : key3, value);
|
|
27613
28404
|
},
|
|
27614
28405
|
hiddenActions: () => host().hiddenActions,
|
|
27615
28406
|
setHiddenActions: (ids) => {
|
|
@@ -27738,7 +28529,8 @@ function buildShell(core, api) {
|
|
|
27738
28529
|
canvas,
|
|
27739
28530
|
core.inserts.smartArt.pane,
|
|
27740
28531
|
review.commentsPanel.element,
|
|
27741
|
-
shell.chartFormat.element
|
|
28532
|
+
shell.chartFormat.element,
|
|
28533
|
+
core.formatDialogs.restrictEditingPane
|
|
27742
28534
|
);
|
|
27743
28535
|
frame.append(toolbar, shell.searchPanel.element, body);
|
|
27744
28536
|
const chrome = createChrome(core, api);
|
|
@@ -27748,8 +28540,9 @@ function buildShell(core, api) {
|
|
|
27748
28540
|
core.inserts.linkDialog.element,
|
|
27749
28541
|
core.inserts.pictureDialog.element,
|
|
27750
28542
|
core.inserts.smartArt.dialog.element,
|
|
27751
|
-
...core.formatDialogs.elements,
|
|
27752
|
-
core.inserts.pictureInput
|
|
28543
|
+
...core.formatDialogs.elements.filter((el) => el !== core.formatDialogs.restrictEditingPane),
|
|
28544
|
+
core.inserts.pictureInput,
|
|
28545
|
+
core.inserts.bulletInput
|
|
27753
28546
|
);
|
|
27754
28547
|
if (core.pendingFileName) chrome.fileName = core.pendingFileName;
|
|
27755
28548
|
root.append(style, frame);
|
|
@@ -27831,7 +28624,7 @@ function findReplaceRequest(core) {
|
|
|
27831
28624
|
get canReplace() {
|
|
27832
28625
|
return core.canEditBody();
|
|
27833
28626
|
},
|
|
27834
|
-
search: (query,
|
|
28627
|
+
search: (query, options) => controller.search(query, options),
|
|
27835
28628
|
findNext: () => controller.findNext() !== null,
|
|
27836
28629
|
findPrevious: () => controller.findPrevious() !== null,
|
|
27837
28630
|
replaceOne: (replacement) => core.canEditBody() && controller.replaceOne(replacement),
|
|
@@ -27918,16 +28711,16 @@ function wordToolbarProps(core) {
|
|
|
27918
28711
|
const state = view?.state;
|
|
27919
28712
|
const canEdit = Boolean(view?.editable && core.canEditBody() && !core.loading);
|
|
27920
28713
|
const values2 = /* @__PURE__ */ new Map();
|
|
27921
|
-
const add = (
|
|
27922
|
-
if (!values2.has(
|
|
27923
|
-
values2.get(
|
|
28714
|
+
const add = (key3, value2) => {
|
|
28715
|
+
if (!values2.has(key3)) values2.set(key3, /* @__PURE__ */ new Set());
|
|
28716
|
+
values2.get(key3).add(value2);
|
|
27924
28717
|
};
|
|
27925
28718
|
if (state) {
|
|
27926
28719
|
const sample = (text, paragraph2) => {
|
|
27927
|
-
for (const
|
|
28720
|
+
for (const key3 of ["bold", "italic", "underline"])
|
|
27928
28721
|
add(
|
|
27929
|
-
|
|
27930
|
-
text.marks.some((mark) => mark.type.name ===
|
|
28722
|
+
key3,
|
|
28723
|
+
text.marks.some((mark) => mark.type.name === key3)
|
|
27931
28724
|
);
|
|
27932
28725
|
const font = effectiveFont(state, text, paragraph2);
|
|
27933
28726
|
add("fontFamily", font.family);
|
|
@@ -27944,8 +28737,8 @@ function wordToolbarProps(core) {
|
|
|
27944
28737
|
if (node.isText && parent) sample(node, parent);
|
|
27945
28738
|
});
|
|
27946
28739
|
}
|
|
27947
|
-
const value = (
|
|
27948
|
-
const set = values2.get(
|
|
28740
|
+
const value = (key3, fallback) => {
|
|
28741
|
+
const set = values2.get(key3);
|
|
27949
28742
|
return set?.size ? set.size === 1 ? [...set][0] : null : fallback;
|
|
27950
28743
|
};
|
|
27951
28744
|
const run = (action) => {
|
|
@@ -28239,8 +29032,10 @@ var DocxEditorApi = class extends HTMLElementBase {
|
|
|
28239
29032
|
...core.collab.yjs?.media.all() ?? []
|
|
28240
29033
|
]);
|
|
28241
29034
|
const media = pending.size ? pending : void 0;
|
|
28242
|
-
if (core.loaded)
|
|
28243
|
-
|
|
29035
|
+
if (core.loaded) {
|
|
29036
|
+
const options = { modified: modifiedStamp(core.reviewAuthor) };
|
|
29037
|
+
return core.loaded.saveDocx ? core.loaded.saveDocx(core.model, media, options) : core.loaded.save(core.model, media, options);
|
|
29038
|
+
}
|
|
28244
29039
|
return saveDocx(core.model, media);
|
|
28245
29040
|
}
|
|
28246
29041
|
/** The saved document as a Blob. Does not change `dirty`; call `markClean()` after persisting it. */
|
|
@@ -28250,7 +29045,10 @@ var DocxEditorApi = class extends HTMLElementBase {
|
|
|
28250
29045
|
/** Saves and starts a browser download, then marks the document clean. */
|
|
28251
29046
|
async download(fileName) {
|
|
28252
29047
|
const name = fileName || this.fileName;
|
|
28253
|
-
downloadBytes(
|
|
29048
|
+
downloadBytes(
|
|
29049
|
+
await this.saveBytes(),
|
|
29050
|
+
/\.[^./\\]+$/.test(name) ? docxFileName(name) : `${name}.docx`
|
|
29051
|
+
);
|
|
28254
29052
|
this.markClean();
|
|
28255
29053
|
}
|
|
28256
29054
|
};
|