ooxml-ui 1.12.2 → 1.13.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 +19 -4
- package/dist/chrome/status-layout.d.ts +23 -0
- package/dist/{chunk-GI3WX6LZ.js → chunk-3XST4F6J.js} +1 -1
- package/dist/{chunk-S6ZXU442.js → chunk-7E3HU7RL.js} +1 -1
- package/dist/{chunk-PXIYHFZ5.js → chunk-ANPFMQ6E.js} +1 -1
- package/dist/{chunk-FUQYUUIQ.js → chunk-BFPHRWEB.js} +356 -99
- package/dist/{chunk-OGNNNTKI.js → chunk-CWBSXK7P.js} +1 -1
- package/dist/{chunk-3H5NR32A.js → chunk-D7JPVAYS.js} +319 -202
- package/dist/{chunk-NLJVBHLG.js → chunk-EL2A3BDM.js} +5 -5
- package/dist/{chunk-L7JV5FVE.js → chunk-KNC2UEUR.js} +1 -1
- package/dist/{chunk-SPNWHKSR.js → chunk-LD3K2RDN.js} +7 -5
- package/dist/chunk-UBBC5FH7.js +31 -0
- package/dist/{chunk-HZSYGNNB.js → chunk-VRVFLYGI.js} +1 -0
- package/dist/controls.d.ts +2 -1
- package/dist/controls.d.ts.map +1 -1
- package/dist/controls.js +4 -4
- package/dist/dialog/options-categories.d.ts +39 -0
- package/dist/dialog/options-categories.d.ts.map +1 -0
- package/dist/dialog/options-controls.d.ts +49 -0
- package/dist/dialog/options-controls.d.ts.map +1 -0
- package/dist/dialog/options-dialog.d.ts +35 -41
- package/dist/dialog/options-dialog.d.ts.map +1 -1
- package/dist/docx/auto-fit.d.ts +10 -0
- package/dist/docx/backstage-customize.d.ts +7 -0
- package/dist/docx/backstage-options.d.ts +13 -3
- package/dist/docx/backstage-pages.d.ts +0 -6
- package/dist/docx/backstage.d.ts +3 -0
- package/dist/docx/canvas-click.d.ts +7 -0
- package/dist/docx/locales/en-app.d.ts +1 -0
- package/dist/docx/locales/en.d.ts +5 -0
- package/dist/docx/locales/options.d.ts +11 -0
- package/dist/docx/localization-strings.d.ts +5 -0
- package/dist/docx/page-controller.d.ts +17 -3
- package/dist/docx/print-editing.d.ts +2 -0
- package/dist/docx/print-layout-view.d.ts +2 -0
- package/dist/docx/status-bar.d.ts +1 -1
- package/dist/docx.js +531 -218
- package/dist/form/color-swatches.d.ts +8 -5
- package/dist/form/color-swatches.d.ts.map +1 -1
- package/dist/index.js +10 -10
- package/dist/pptx/{chunk-5AD3V3PA.mjs → chunk-CB2DZVKL.mjs} +127 -1
- package/dist/pptx/{chunk-4EHNTVSN.mjs → chunk-DZUSNYRA.mjs} +1310 -216
- package/dist/pptx/{chunk-Y7CDPPMZ.cjs → chunk-J3GEBMYK.cjs} +127 -1
- package/dist/pptx/{chunk-LMZK4UNY.cjs → chunk-J4HVGXPW.cjs} +1333 -213
- package/dist/pptx/dom/elements/table.d.ts.map +1 -1
- package/dist/pptx/dom/index.cjs +209 -206
- package/dist/pptx/dom/index.mjs +8 -5
- package/dist/pptx/dom/load-presentation.d.ts +3 -1
- package/dist/pptx/dom/load-presentation.d.ts.map +1 -1
- package/dist/pptx/dom/slide-stage.d.ts +3 -1
- package/dist/pptx/dom/slide-stage.d.ts.map +1 -1
- package/dist/pptx/dom/types.d.ts +6 -1
- package/dist/pptx/dom/types.d.ts.map +1 -1
- package/dist/pptx/i18n/index.cjs +6 -6
- package/dist/pptx/i18n/index.mjs +1 -1
- package/dist/pptx/i18n/translations-en-galleries-data.d.ts.map +1 -1
- package/dist/pptx/i18n/translations-en-table-layout.d.ts +3 -0
- package/dist/pptx/i18n/translations-en-table-layout.d.ts.map +1 -0
- package/dist/pptx/i18n/translations-en.d.ts.map +1 -1
- package/dist/pptx/index.cjs +2838 -2758
- package/dist/pptx/index.mjs +2 -2
- package/dist/pptx/render/action-buttons.d.ts +2 -0
- package/dist/pptx/render/action-buttons.d.ts.map +1 -1
- package/dist/pptx/render/comment-navigation.d.ts +51 -0
- package/dist/pptx/render/comment-navigation.d.ts.map +1 -0
- package/dist/pptx/render/customization/ribbon-control-catalog-tail.d.ts +61 -0
- package/dist/pptx/render/customization/ribbon-control-catalog-tail.d.ts.map +1 -1
- package/dist/pptx/render/customization/ribbon-control-catalog.d.ts +61 -0
- package/dist/pptx/render/customization/ribbon-control-catalog.d.ts.map +1 -1
- package/dist/pptx/render/index.d.ts +2 -0
- package/dist/pptx/render/index.d.ts.map +1 -1
- package/dist/pptx/render/review-comment-commands.d.ts +42 -0
- package/dist/pptx/render/review-comment-commands.d.ts.map +1 -0
- package/dist/pptx/render/ribbon-galleries/gallery-placements.d.ts.map +1 -1
- package/dist/pptx/render/ribbon-galleries/gallery-registry.d.ts.map +1 -1
- package/dist/pptx/render/ribbon-galleries/gallery-types.d.ts +17 -1
- package/dist/pptx/render/ribbon-galleries/gallery-types.d.ts.map +1 -1
- package/dist/pptx/render/ribbon-galleries/gallery-view.d.ts.map +1 -1
- package/dist/pptx/render/ribbon-galleries/index.d.ts +2 -0
- package/dist/pptx/render/ribbon-galleries/index.d.ts.map +1 -1
- package/dist/pptx/render/ribbon-galleries/shape-styles-gallery.d.ts.map +1 -1
- package/dist/pptx/render/ribbon-galleries/table-layout-commands.d.ts +7 -0
- package/dist/pptx/render/ribbon-galleries/table-layout-commands.d.ts.map +1 -0
- package/dist/pptx/render/ribbon-galleries/table-layout-ops.d.ts +64 -0
- package/dist/pptx/render/ribbon-galleries/table-layout-ops.d.ts.map +1 -0
- package/dist/pptx/render/ribbon-galleries/table-style-tile-svg.d.ts +7 -3
- package/dist/pptx/render/ribbon-galleries/table-style-tile-svg.d.ts.map +1 -1
- package/dist/pptx/render/ribbon-galleries/table-styles-gallery.d.ts.map +1 -1
- package/dist/pptx/render/ribbon-galleries/table-text-direction-gallery.d.ts +3 -0
- package/dist/pptx/render/ribbon-galleries/table-text-direction-gallery.d.ts.map +1 -0
- package/dist/pptx/render/ribbon-galleries/theme-colors-gallery.d.ts.map +1 -1
- package/dist/pptx/render/ribbon-galleries/theme-fonts-gallery.d.ts.map +1 -1
- package/dist/pptx/render/ribbon-home-families-objects.d.ts.map +1 -1
- package/dist/pptx/render/ribbon-home-spec.d.ts +10 -6
- package/dist/pptx/render/ribbon-home-spec.d.ts.map +1 -1
- package/dist/pptx/render/ribbon-review-commands.d.ts +7 -0
- package/dist/pptx/render/ribbon-review-commands.d.ts.map +1 -1
- package/dist/pptx/render/shape-quick-styles.d.ts +6 -0
- package/dist/pptx/render/shape-quick-styles.d.ts.map +1 -1
- package/dist/pptx/render/table-style-borders.d.ts.map +1 -1
- package/dist/pptx/render/table-style-builtins-data.d.ts +7 -1
- package/dist/pptx/render/table-style-builtins-data.d.ts.map +1 -1
- package/dist/pptx/render/table-style-scheme.d.ts +2 -0
- package/dist/pptx/render/table-style-scheme.d.ts.map +1 -1
- package/dist/pptx/render/table-style-theme-refs.d.ts +16 -0
- package/dist/pptx/render/table-style-theme-refs.d.ts.map +1 -0
- package/dist/pptx/render/table-style.d.ts +7 -1
- package/dist/pptx/render/table-style.d.ts.map +1 -1
- package/dist/pptx/render/theme-color-swatches.d.ts +1 -1
- package/dist/pptx/render/theme-color-swatches.d.ts.map +1 -1
- package/dist/pptx/render/toolbar-actions.d.ts +1 -1
- package/dist/pptx/render/toolbar-actions.d.ts.map +1 -1
- package/dist/pptx/web-components/ribbon-draw-view.d.ts.map +1 -1
- package/dist/pptx/web-components/ribbon-home-colour.d.ts.map +1 -1
- package/dist/pptx/web-components/ribbon-insert-view.d.ts.map +1 -1
- package/dist/presence.js +3 -3
- package/dist/{presentation-preview-VIIU7E2S.js → presentation-preview-HVKJ3KJN.js} +1 -1
- package/dist/ribbon/auto-collapse.d.ts +8 -0
- package/dist/ribbon/auto-collapse.d.ts.map +1 -0
- package/dist/ribbon/group-overflow.d.ts +7 -0
- package/dist/ribbon/group-overflow.d.ts.map +1 -1
- package/dist/ribbon/overflow.d.ts +7 -0
- package/dist/ribbon/overflow.d.ts.map +1 -1
- package/dist/ribbon/ribbon-tabs.d.ts +5 -0
- package/dist/ribbon/ribbon-tabs.d.ts.map +1 -1
- package/dist/ribbon/scroll-more.d.ts +17 -0
- package/dist/ribbon/scroll-more.d.ts.map +1 -0
- package/dist/smartart.js +3 -3
- package/dist/teams/app/activity.d.ts +5 -0
- package/dist/teams/app/pinned-bar.d.ts +24 -0
- package/dist/teams/app/profile-menu.d.ts +18 -1
- package/dist/teams/app/teams-app.d.ts +8 -3
- package/dist/teams/app-rail.d.ts +3 -1
- package/dist/teams/avatar.d.ts +2 -2
- package/dist/teams/chat-list.d.ts +10 -2
- package/dist/teams.js +7 -7
- package/dist/theme.js +2 -2
- package/dist/tokens.d.ts +7 -5
- package/dist/tokens.d.ts.map +1 -1
- package/dist/visio/viewer-gesture-state.d.ts +54 -0
- package/dist/visio/viewer-options-categories.d.ts +8 -0
- package/dist/visio/viewer-options.d.ts +3 -7
- package/dist/visio/viewer-touch-gestures.d.ts +17 -0
- package/dist/visio/viewer-touch-hit.d.ts +3 -0
- package/dist/visio/viewer-touch-long-press.d.ts +13 -0
- package/dist/visio/viewer-touch-math.d.ts +44 -0
- package/dist/visio.js +319 -149
- package/dist/xlsx/backstage/index.d.ts +3 -0
- package/dist/xlsx/backstage/options-customize.d.ts +7 -0
- package/dist/xlsx/backstage/options-dialog.d.ts +13 -0
- package/dist/xlsx/ribbon/ribbon.d.ts +1 -1
- package/dist/xlsx/status-bar.d.ts +1 -1
- package/dist/xlsx.js +282 -172
- package/package.json +2 -2
- package/dist/teams/app/navigation-drawer.d.ts +0 -26
- package/dist/xlsx/backstage/pages-options.d.ts +0 -7
package/dist/docx.js
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
1
|
+
import { statusLayout, watchStatusWidth, compactPageText } from './chunk-UBBC5FH7.js';
|
|
2
|
+
import { syncRibbonAddIns } from './chunk-3XST4F6J.js';
|
|
3
|
+
export { RIBBON_ADD_IN_EVENT } from './chunk-3XST4F6J.js';
|
|
4
|
+
import { defineSmartArt } from './chunk-ANPFMQ6E.js';
|
|
5
|
+
import { shadcnBridge } from './chunk-7E3HU7RL.js';
|
|
6
|
+
import { createRibbonOverflow, defineRibbon, defineRuler, defineCommentsPane, defineDialog, defineSearchField, defineSwitch, defineTitleBar, defineRibbonActions, defineBackstage, defineStatusBar, defineZoomSlider, defineContextMenu, defineColorGrid, runKeyTips, defineOptionsDialog, assignKeyTips, optionsLabels, userInterfaceSection, personalizeSection, optionText, unavailableCategory } from './chunk-BFPHRWEB.js';
|
|
6
7
|
import { registerIcon } from './chunk-M6GF5ED2.js';
|
|
7
|
-
import './chunk-
|
|
8
|
-
import './chunk-
|
|
9
|
-
import './chunk-
|
|
10
|
-
import { normalizeLocale, SUPPORTED_OFFICE_LOCALES, interpolate } from 'ooxml-core/i18n';
|
|
8
|
+
import './chunk-KNC2UEUR.js';
|
|
9
|
+
import './chunk-CWBSXK7P.js';
|
|
10
|
+
import './chunk-LD3K2RDN.js';
|
|
11
|
+
import { optionStrings, normalizeLocale, SUPPORTED_OFFICE_LOCALES, interpolate } from 'ooxml-core/i18n';
|
|
11
12
|
import { createDocument, saveDocx, sectionsFromLayout, sectionLayoutJson, sectionsOf, pageSizeOf, columnPreset, applyPageSetup, withSection, computeListLabels, numberNotesInOrder, tocEntries, tableOfFiguresInstruction, findTableOfContents, ensureListDefinition, resolveNumberingLevel, 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, reviewDocumentFormatting, reviewFormattingWarnings, listRevisions, plainText, tocHyperlinks, DEFAULT_TOC_INSTRUCTION, tocBookmarks, buildTableOfContents, tocCaptionLabel, isFieldLocked, twips as twips$1, signedTwips, formatListNumber, columnTextWidth, validColumnDraft, validatePageSetup, presetOf, LIGATURE_VALUES, isLigatures, reviewRunFormatting, resolveRunFormatting, resolveThemeColorReference, lineSpacingValue, isStHighlightColor, transformCase, DEFAULT_TABLE_BORDERS, parseLineSpacingValue, twipsAttr, twipsFromPixels, headingLevel, reviewParagraphFormatting, isValidLanguageTag, WORD, isHeadingListKind, lineSpacingOptions, halfPointsFromPoints, changeColumnWidth, changeColumnGap, createListDefinition, linkStylesToList, headingListLevels, documentStats, fieldName } from 'ooxml-core/docx';
|
|
12
13
|
import { Schema, DOMSerializer, Fragment } from 'prosemirror-model';
|
|
13
14
|
import { markSpecs, imageNodeSpec, fieldMarkerNodeSpec, noteReferenceNodeSpec, pageBreakNodeSpec, hardBreakNodeSpec, commentHistoryAttributes, tableCellStyle, tableStyle, createToggleFormat, expectDefined, paragraphBoxCss, themeToCssVars, lightTheme, darkTheme, normalizeThemeMode, applyThemeColors, refreshWordYjsPresence, normalizeRibbonActions, DirtyState, isWordYjsRemoteTransaction, REMOTE_TRANSACTION_META, repairCollaborativeDocumentIds, HEADER_FOOTER_INPUT, restoreSectionParts, commentThreadsFromDoc, restoreNoteParts, CollaborationClient, createCollaborationIdGenerator, WordYjsCollaboration, sectionPartsJson, NotePartsStep, notePartsJson, SectionPartsStep, fitZoomPercent, hasChangeAtCursor, hasAnyChange, commentIdsAtSelection, commentAnchors, documentWordCount, fieldGuardPlugin, tableStructureGuardPlugin, trackChangesPlugin, wordYjsPresencePlugin, chartNodeSpec, placementClass, removeCommentThread, removeCommentAnchor, deleteComment, updateCommentThreads, addComment, toggleTrackChanges, goToNextChange, goToPreviousChange, rejectAllChanges, acceptAllChanges, rejectChangeAtCursor, acceptChangeAtCursor, goToComment, appendInlineNode, sameJson, sameRuns, PARAGRAPH_KEEP_KEYS, paragraphFromAttrs, parseBordersJson, isNavigableHref, wordYjsPluginKey, setReviewRecordingPreferences, nodeNumbering, paragraphFormattingRevision, inlineNodeRun, formattingRevision, insertWordHardBreak, paragraphAttrs, resolveCellVisuals, themeDrawing, ribbonActionIdForLabel, removeWordLink, fieldResultRanges, wordLinkRangeAt, ligatureCss as ligatureCss$1, wordYjsRedo, wordYjsUndo, runToInlineNodes as runToInlineNodes$1, backstageFocus, applyRunFormattingPatch, clearDirectRunFormatting, applyWordLink, ligatureStyle, wordHighlightColors, swatchColor, cssBorderSide, deleteFieldSelection, countWords, resolveComment, replyToComment, CollaborationAuthority } from 'ooxml-core/docx/ui';
|
|
@@ -23,6 +24,42 @@ import { sanitizeColor, sanitizeUserName, SequenceTracker, isValidId, classifyVe
|
|
|
23
24
|
import { keymap } from 'prosemirror-keymap';
|
|
24
25
|
import { chainCommands, baseKeymap, selectAll } from 'prosemirror-commands';
|
|
25
26
|
|
|
27
|
+
var enOptions = {
|
|
28
|
+
...optionStrings.en,
|
|
29
|
+
"Change how document content is displayed on the screen.": "Change how document content is displayed on the screen.",
|
|
30
|
+
"Page display options": "Page display options",
|
|
31
|
+
"Formatting marks": "Formatting marks",
|
|
32
|
+
"Check spelling as you type": "Check spelling as you type"
|
|
33
|
+
};
|
|
34
|
+
var frOptions = {
|
|
35
|
+
...optionStrings.fr,
|
|
36
|
+
"Change how document content is displayed on the screen.": "Modifiez l\u2019affichage du contenu du document \xE0 l\u2019\xE9cran.",
|
|
37
|
+
"Page display options": "Options d\u2019affichage des pages",
|
|
38
|
+
"Formatting marks": "Marques de mise en forme",
|
|
39
|
+
"Check spelling as you type": "V\xE9rifier l\u2019orthographe au cours de la frappe"
|
|
40
|
+
};
|
|
41
|
+
var deOptions = {
|
|
42
|
+
...optionStrings.de,
|
|
43
|
+
"Change how document content is displayed on the screen.": "\xC4ndern Sie, wie der Dokumentinhalt auf dem Bildschirm angezeigt wird.",
|
|
44
|
+
"Page display options": "Seitenanzeigeoptionen",
|
|
45
|
+
"Formatting marks": "Formatierungszeichen",
|
|
46
|
+
"Check spelling as you type": "Rechtschreibung w\xE4hrend der Eingabe \xFCberpr\xFCfen"
|
|
47
|
+
};
|
|
48
|
+
var esOptions = {
|
|
49
|
+
...optionStrings.es,
|
|
50
|
+
"Change how document content is displayed on the screen.": "Cambie la forma en que se muestra el contenido del documento en pantalla.",
|
|
51
|
+
"Page display options": "Opciones de presentaci\xF3n de p\xE1gina",
|
|
52
|
+
"Formatting marks": "Marcas de formato",
|
|
53
|
+
"Check spelling as you type": "Revisar la ortograf\xEDa mientras escribe"
|
|
54
|
+
};
|
|
55
|
+
var zhOptions = {
|
|
56
|
+
...optionStrings["zh-CN"],
|
|
57
|
+
"Change how document content is displayed on the screen.": "\u66F4\u6539\u6587\u6863\u5185\u5BB9\u5728\u5C4F\u5E55\u4E0A\u7684\u663E\u793A\u65B9\u5F0F\u3002",
|
|
58
|
+
"Page display options": "\u9875\u9762\u663E\u793A\u9009\u9879",
|
|
59
|
+
"Formatting marks": "\u683C\u5F0F\u6807\u8BB0",
|
|
60
|
+
"Check spelling as you type": "\u952E\u5165\u65F6\u68C0\u67E5\u62FC\u5199"
|
|
61
|
+
};
|
|
62
|
+
|
|
26
63
|
// src/docx/locales/columns.ts
|
|
27
64
|
var enColumns = {
|
|
28
65
|
Column: "Column",
|
|
@@ -702,6 +739,7 @@ var deApp = {
|
|
|
702
739
|
"Theme Colors": "Designfarben",
|
|
703
740
|
"Standard Colors": "Standardfarben",
|
|
704
741
|
"More Colors\u2026": "Weitere Farben\u2026",
|
|
742
|
+
More: "Mehr",
|
|
705
743
|
"No Color": "Keine Farbe",
|
|
706
744
|
"Dark Red": "Dunkelrot",
|
|
707
745
|
"Light Green": "Hellgr\xFCn",
|
|
@@ -1334,6 +1372,7 @@ var deRibbon = {
|
|
|
1334
1372
|
|
|
1335
1373
|
// src/docx/locales/de.ts
|
|
1336
1374
|
var de = {
|
|
1375
|
+
...deOptions,
|
|
1337
1376
|
...deRibbon,
|
|
1338
1377
|
...deApp,
|
|
1339
1378
|
...deTableProperties,
|
|
@@ -1528,6 +1567,7 @@ var enApp = {
|
|
|
1528
1567
|
"Theme Colors": "Theme Colors",
|
|
1529
1568
|
"Standard Colors": "Standard Colors",
|
|
1530
1569
|
"More Colors\u2026": "More Colors\u2026",
|
|
1570
|
+
More: "More",
|
|
1531
1571
|
"No Color": "No Color",
|
|
1532
1572
|
"Dark Red": "Dark Red",
|
|
1533
1573
|
"Light Green": "Light Green",
|
|
@@ -2030,6 +2070,7 @@ var enRibbon = {
|
|
|
2030
2070
|
|
|
2031
2071
|
// src/docx/locales/en.ts
|
|
2032
2072
|
var en = {
|
|
2073
|
+
...enOptions,
|
|
2033
2074
|
...enRibbon,
|
|
2034
2075
|
...enApp,
|
|
2035
2076
|
...enTableProperties,
|
|
@@ -2224,6 +2265,7 @@ var esApp = {
|
|
|
2224
2265
|
"Theme Colors": "Colores del tema",
|
|
2225
2266
|
"Standard Colors": "Colores est\xE1ndar",
|
|
2226
2267
|
"More Colors\u2026": "M\xE1s colores\u2026",
|
|
2268
|
+
More: "M\xE1s",
|
|
2227
2269
|
"No Color": "Sin color",
|
|
2228
2270
|
"Dark Red": "Rojo oscuro",
|
|
2229
2271
|
"Light Green": "Verde claro",
|
|
@@ -2726,6 +2768,7 @@ var esRibbon = {
|
|
|
2726
2768
|
|
|
2727
2769
|
// src/docx/locales/es.ts
|
|
2728
2770
|
var es = {
|
|
2771
|
+
...esOptions,
|
|
2729
2772
|
...esRibbon,
|
|
2730
2773
|
...esApp,
|
|
2731
2774
|
...esTableProperties,
|
|
@@ -2920,6 +2963,7 @@ var frApp = {
|
|
|
2920
2963
|
"Theme Colors": "Couleurs du th\xE8me",
|
|
2921
2964
|
"Standard Colors": "Couleurs standard",
|
|
2922
2965
|
"More Colors\u2026": "Autres couleurs\u2026",
|
|
2966
|
+
More: "Plus",
|
|
2923
2967
|
"No Color": "Aucune couleur",
|
|
2924
2968
|
"Dark Red": "Rouge fonc\xE9",
|
|
2925
2969
|
"Light Green": "Vert clair",
|
|
@@ -3422,6 +3466,7 @@ var frRibbon = {
|
|
|
3422
3466
|
|
|
3423
3467
|
// src/docx/locales/fr.ts
|
|
3424
3468
|
var fr = {
|
|
3469
|
+
...frOptions,
|
|
3425
3470
|
...frRibbon,
|
|
3426
3471
|
...frApp,
|
|
3427
3472
|
...frTableProperties,
|
|
@@ -3616,6 +3661,7 @@ var zhCNApp = {
|
|
|
3616
3661
|
"Theme Colors": "\u4E3B\u9898\u989C\u8272",
|
|
3617
3662
|
"Standard Colors": "\u6807\u51C6\u8272",
|
|
3618
3663
|
"More Colors\u2026": "\u5176\u4ED6\u989C\u8272\u2026",
|
|
3664
|
+
More: "\u66F4\u591A",
|
|
3619
3665
|
"No Color": "\u65E0\u989C\u8272",
|
|
3620
3666
|
"Dark Red": "\u6DF1\u7EA2",
|
|
3621
3667
|
"Light Green": "\u6D45\u7EFF",
|
|
@@ -4118,6 +4164,7 @@ var zhCNRibbon = {
|
|
|
4118
4164
|
|
|
4119
4165
|
// src/docx/locales/zh-CN.ts
|
|
4120
4166
|
var zhCN = {
|
|
4167
|
+
...zhOptions,
|
|
4121
4168
|
...zhCNRibbon,
|
|
4122
4169
|
...zhCNApp,
|
|
4123
4170
|
...zhTableProperties,
|
|
@@ -6664,6 +6711,8 @@ var GROUP_ICONS = {
|
|
|
6664
6711
|
};
|
|
6665
6712
|
var overflow = createRibbonOverflow({
|
|
6666
6713
|
icon: (_doc, name, size) => ribbonIcon(name, size),
|
|
6714
|
+
// Read per sync from the panel's own locale, so a language change reaches the chevron.
|
|
6715
|
+
moreLabel: (panel) => translate(localeOf(panel), "More"),
|
|
6667
6716
|
groupIcons: GROUP_ICONS,
|
|
6668
6717
|
fallbackIcon: "moreStyles",
|
|
6669
6718
|
ribbon: ".dve-ribbon",
|
|
@@ -15750,6 +15799,114 @@ function pageSetupChange(model, index, section3, key2, value) {
|
|
|
15750
15799
|
return setTitlePage(model, index, !section3.titlePage);
|
|
15751
15800
|
}
|
|
15752
15801
|
}
|
|
15802
|
+
|
|
15803
|
+
// src/docx/auto-fit.ts
|
|
15804
|
+
var AUTO_FIT_MIN = 25;
|
|
15805
|
+
function autoFitZoom(availableWidth, pageWidth) {
|
|
15806
|
+
if (!(availableWidth > 0) || !(pageWidth > 0)) return void 0;
|
|
15807
|
+
if (availableWidth >= pageWidth) return 100;
|
|
15808
|
+
return Math.max(AUTO_FIT_MIN, Math.floor(availableWidth / pageWidth * 100));
|
|
15809
|
+
}
|
|
15810
|
+
function pinchZoom(startPercent, scale, min, max) {
|
|
15811
|
+
if (!(scale > 0)) return startPercent;
|
|
15812
|
+
return Math.min(max, Math.max(min, Math.round(startPercent * scale)));
|
|
15813
|
+
}
|
|
15814
|
+
|
|
15815
|
+
// src/docx/status-bar.ts
|
|
15816
|
+
var ZOOM_MIN = AUTO_FIT_MIN;
|
|
15817
|
+
var ZOOM_MAX = 200;
|
|
15818
|
+
var LAYOUT_ICONS = {
|
|
15819
|
+
webLayout: "M3 5h14v10H3z M3 8h14",
|
|
15820
|
+
printLayout: "M5 3h10v14H5z M8 7h4 M8 10h4"
|
|
15821
|
+
};
|
|
15822
|
+
function createStatusBar(handlers) {
|
|
15823
|
+
defineStatusBar();
|
|
15824
|
+
defineZoomSlider();
|
|
15825
|
+
for (const [name, d] of Object.entries(LAYOUT_ICONS)) registerIcon(name, d);
|
|
15826
|
+
const element = document.createElement("office-ui-status-bar");
|
|
15827
|
+
element.className = "dve-status";
|
|
15828
|
+
const slider = document.createElement("office-ui-zoom-slider");
|
|
15829
|
+
slider.slot = "end";
|
|
15830
|
+
slider.setAttribute("min", String(ZOOM_MIN));
|
|
15831
|
+
slider.setAttribute("max", String(ZOOM_MAX));
|
|
15832
|
+
slider.className = "dve-zoom";
|
|
15833
|
+
element.append(slider);
|
|
15834
|
+
const model = { page: "", words: "", language: "", notes: 0, mode: "draft", zoom: 100 };
|
|
15835
|
+
let layout = statusLayout(0);
|
|
15836
|
+
const locale = () => normalizeEditorLocale(element.dataset.editorLocale);
|
|
15837
|
+
const render = () => {
|
|
15838
|
+
const t = locale();
|
|
15839
|
+
const noteKey = model.notes === 1 ? "status.note" : "status.notes";
|
|
15840
|
+
const view = (mode, key2) => ({
|
|
15841
|
+
id: mode,
|
|
15842
|
+
icon: mode === "draft" ? "webLayout" : "printLayout",
|
|
15843
|
+
label: translate(t, key2),
|
|
15844
|
+
pressed: model.mode === mode
|
|
15845
|
+
});
|
|
15846
|
+
element.state = {
|
|
15847
|
+
items: [
|
|
15848
|
+
{
|
|
15849
|
+
id: "page",
|
|
15850
|
+
text: layout.compactPage ? compactPageText(model.page) : model.page,
|
|
15851
|
+
title: layout.compactPage ? `${model.page}. ${translate(t, "nav.approximate")}` : translate(t, "nav.approximate"),
|
|
15852
|
+
live: true
|
|
15853
|
+
},
|
|
15854
|
+
...layout.words ? [{ id: "words", text: model.words }] : [],
|
|
15855
|
+
...model.language && layout.language ? [{ id: "language", text: model.language, narrowHide: true }] : []
|
|
15856
|
+
],
|
|
15857
|
+
toggles: [
|
|
15858
|
+
{
|
|
15859
|
+
id: "notes",
|
|
15860
|
+
icon: "warning",
|
|
15861
|
+
label: translate(t, noteKey).replace("{count}", String(model.notes)),
|
|
15862
|
+
text: translate(t, noteKey).replace("{count}", String(model.notes)),
|
|
15863
|
+
hidden: model.notes === 0
|
|
15864
|
+
}
|
|
15865
|
+
],
|
|
15866
|
+
views: layout.views ? [view("draft", "Web Layout"), view("print", "Print Layout")] : false
|
|
15867
|
+
};
|
|
15868
|
+
slider.setAttribute("out-label", translate(t, "Zoom out"));
|
|
15869
|
+
slider.setAttribute("in-label", translate(t, "Zoom in"));
|
|
15870
|
+
slider.setAttribute("slider-label", translate(t, "Zoom level"));
|
|
15871
|
+
slider.value = model.zoom;
|
|
15872
|
+
};
|
|
15873
|
+
element.addEventListener("office-status-activate", (event) => {
|
|
15874
|
+
const { id } = event.detail;
|
|
15875
|
+
if (id === "notes") handlers.showCompatibilityNotes();
|
|
15876
|
+
else if (id === "draft" || id === "print") handlers.setViewMode(id);
|
|
15877
|
+
});
|
|
15878
|
+
slider.addEventListener("input", () => handlers.setZoom(slider.value));
|
|
15879
|
+
render();
|
|
15880
|
+
watchStatusWidth(element, (width) => {
|
|
15881
|
+
layout = statusLayout(width);
|
|
15882
|
+
render();
|
|
15883
|
+
});
|
|
15884
|
+
return {
|
|
15885
|
+
element,
|
|
15886
|
+
setPageAndWords(pageText, wordText) {
|
|
15887
|
+
model.page = pageText;
|
|
15888
|
+
model.words = wordText;
|
|
15889
|
+
render();
|
|
15890
|
+
},
|
|
15891
|
+
setLanguage(value) {
|
|
15892
|
+
model.language = value;
|
|
15893
|
+
render();
|
|
15894
|
+
},
|
|
15895
|
+
setNoteCount(count) {
|
|
15896
|
+
model.notes = count;
|
|
15897
|
+
render();
|
|
15898
|
+
},
|
|
15899
|
+
setViewMode(mode) {
|
|
15900
|
+
model.mode = mode;
|
|
15901
|
+
render();
|
|
15902
|
+
},
|
|
15903
|
+
setZoom(value) {
|
|
15904
|
+
model.zoom = value;
|
|
15905
|
+
render();
|
|
15906
|
+
},
|
|
15907
|
+
relocalize: render
|
|
15908
|
+
};
|
|
15909
|
+
}
|
|
15753
15910
|
var PageController = class {
|
|
15754
15911
|
constructor(host) {
|
|
15755
15912
|
this.host = host;
|
|
@@ -15757,6 +15914,9 @@ var PageController = class {
|
|
|
15757
15914
|
host;
|
|
15758
15915
|
zoom = 1;
|
|
15759
15916
|
viewMode = "draft";
|
|
15917
|
+
/** True once the user picked a zoom; the automatic fit to a narrow viewport then stays out. */
|
|
15918
|
+
userZoomed = false;
|
|
15919
|
+
observed;
|
|
15760
15920
|
/** Page setup applies to the section holding the selection, as in Word, and is undoable. */
|
|
15761
15921
|
changePageSetup(key2, value) {
|
|
15762
15922
|
const view = this.host.view();
|
|
@@ -15941,6 +16101,7 @@ var PageController = class {
|
|
|
15941
16101
|
const paper = this.host.paper();
|
|
15942
16102
|
if (!paper) return;
|
|
15943
16103
|
const model = this.host.model();
|
|
16104
|
+
this.observeViewport(paper.parentElement);
|
|
15944
16105
|
applyPageStyles(paper, model, this.zoom);
|
|
15945
16106
|
const sections = model.sections ?? [];
|
|
15946
16107
|
const columns = sections.length === 1 ? sections[0]?.columns : void 0;
|
|
@@ -15971,8 +16132,65 @@ var PageController = class {
|
|
|
15971
16132
|
mode === "pages"
|
|
15972
16133
|
);
|
|
15973
16134
|
}
|
|
15974
|
-
/**
|
|
16135
|
+
/** A zoom the user chose (slider, ribbon, dialog, pinch); it ends the automatic fit. */
|
|
15975
16136
|
setZoom(percent, sideBySide = false) {
|
|
16137
|
+
this.userZoomed = true;
|
|
16138
|
+
this.applyZoom(percent, sideBySide);
|
|
16139
|
+
}
|
|
16140
|
+
/**
|
|
16141
|
+
* Fits the page to the canvas width while the user has not chosen a zoom, so a phone or a narrow
|
|
16142
|
+
* window shows the whole page width (as Word for the web and mobile do) and the zoom returns to
|
|
16143
|
+
* 100% when the window grows. Runs on resize and orientation change.
|
|
16144
|
+
*/
|
|
16145
|
+
autoFit() {
|
|
16146
|
+
if (this.userZoomed) return;
|
|
16147
|
+
const canvas = this.host.paper()?.parentElement;
|
|
16148
|
+
if (!canvas || canvas.hasAttribute("data-multipage")) return;
|
|
16149
|
+
const style = getComputedStyle(canvas);
|
|
16150
|
+
const available = canvas.clientWidth - (parseFloat(style.paddingLeft) || 0) - (parseFloat(style.paddingRight) || 0);
|
|
16151
|
+
const percent = autoFitZoom(available, this.host.model().page.width);
|
|
16152
|
+
if (percent !== void 0 && Math.round(this.zoom * 100) !== percent) this.applyZoom(percent);
|
|
16153
|
+
}
|
|
16154
|
+
observeViewport(canvas) {
|
|
16155
|
+
if (!canvas || this.observed === canvas) return;
|
|
16156
|
+
this.observed = canvas;
|
|
16157
|
+
this.watchPinch(canvas);
|
|
16158
|
+
if (typeof ResizeObserver === "undefined") return;
|
|
16159
|
+
let width = canvas.clientWidth;
|
|
16160
|
+
new ResizeObserver(() => {
|
|
16161
|
+
if (canvas.clientWidth === width) return;
|
|
16162
|
+
width = canvas.clientWidth;
|
|
16163
|
+
this.autoFit();
|
|
16164
|
+
}).observe(canvas);
|
|
16165
|
+
queueMicrotask(() => this.autoFit());
|
|
16166
|
+
}
|
|
16167
|
+
/** Two-finger pinch over the canvas zooms the page; one finger keeps scrolling. */
|
|
16168
|
+
watchPinch(canvas) {
|
|
16169
|
+
let start;
|
|
16170
|
+
const distance = (e) => {
|
|
16171
|
+
const [a, b] = [e.touches[0], e.touches[1]];
|
|
16172
|
+
return a && b ? Math.hypot(a.clientX - b.clientX, a.clientY - b.clientY) : 0;
|
|
16173
|
+
};
|
|
16174
|
+
canvas.addEventListener(
|
|
16175
|
+
"touchstart",
|
|
16176
|
+
(e) => {
|
|
16177
|
+
start = e.touches.length === 2 ? { distance: distance(e), percent: Math.round(this.zoom * 100) } : void 0;
|
|
16178
|
+
},
|
|
16179
|
+
{ passive: true }
|
|
16180
|
+
);
|
|
16181
|
+
canvas.addEventListener(
|
|
16182
|
+
"touchmove",
|
|
16183
|
+
(e) => {
|
|
16184
|
+
if (!start || e.touches.length !== 2 || start.distance <= 0) return;
|
|
16185
|
+
if (e.cancelable) e.preventDefault();
|
|
16186
|
+
this.setZoom(pinchZoom(start.percent, distance(e) / start.distance, ZOOM_MIN, ZOOM_MAX));
|
|
16187
|
+
},
|
|
16188
|
+
{ passive: false }
|
|
16189
|
+
);
|
|
16190
|
+
canvas.addEventListener("touchend", () => start = void 0, { passive: true });
|
|
16191
|
+
}
|
|
16192
|
+
/** `sideBySide` lays Print Layout's pages out two across (View > Multiple Pages). */
|
|
16193
|
+
applyZoom(percent, sideBySide = false) {
|
|
15976
16194
|
this.zoom = percent / 100;
|
|
15977
16195
|
this.host.paper()?.parentElement?.toggleAttribute("data-multipage", sideBySide);
|
|
15978
16196
|
this.refreshPageStyles();
|
|
@@ -15984,6 +16202,7 @@ var PageController = class {
|
|
|
15984
16202
|
}
|
|
15985
16203
|
/** Switches between continuous and paginated presentations of the existing editor. */
|
|
15986
16204
|
setViewMode(mode) {
|
|
16205
|
+
const wasPrint = this.viewMode === "print";
|
|
15987
16206
|
this.viewMode = mode;
|
|
15988
16207
|
const printLayout = this.host.printLayout();
|
|
15989
16208
|
printLayout?.setActive(mode === "print");
|
|
@@ -15994,13 +16213,16 @@ var PageController = class {
|
|
|
15994
16213
|
const toolbar = this.host.toolbar();
|
|
15995
16214
|
const select2 = toolbar && findLocalizedControl(toolbar, "Layout view");
|
|
15996
16215
|
if (select2) select2.value = mode;
|
|
15997
|
-
if (mode === "print") printLayout?.scheduleRelayout(this.host.model());
|
|
16216
|
+
if (mode === "print" && !wasPrint) printLayout?.scheduleRelayout(this.host.model());
|
|
15998
16217
|
this.host.statusBar()?.setViewMode(mode);
|
|
15999
16218
|
this.host.refreshControls();
|
|
16000
16219
|
}
|
|
16001
|
-
/** Re-lays out Print Layout after a model change (coalesced
|
|
16002
|
-
relayout() {
|
|
16003
|
-
if (this.viewMode
|
|
16220
|
+
/** Re-lays out Print Layout after a model change (coalesced unless `immediate`, for a swapped document). */
|
|
16221
|
+
relayout(immediate = false) {
|
|
16222
|
+
if (this.viewMode !== "print") return;
|
|
16223
|
+
const printLayout = this.host.printLayout();
|
|
16224
|
+
if (immediate) printLayout?.relayoutNow(this.host.model());
|
|
16225
|
+
else printLayout?.scheduleRelayout(this.host.model());
|
|
16004
16226
|
}
|
|
16005
16227
|
print() {
|
|
16006
16228
|
this.host.printLayout()?.print(this.host.model(), (message) => emit(this.host.element, "document-warning", message));
|
|
@@ -16941,13 +17163,13 @@ var underline_default = `/* Styled runs paint their own underline. Do not superi
|
|
|
16941
17163
|
`;
|
|
16942
17164
|
|
|
16943
17165
|
// raw-css:/home/runner/work/ooxml/ooxml/src/ui/src/docx/styles/print.css?raw
|
|
16944
|
-
var print_default = ".dve-print-pages {\n display: flex;\n flex-direction: column;\n align-items: center;\n gap: 24px;\n margin: 0 auto;\n zoom: var(--dve-zoom, 1);\n}\n.dve-print-pages[hidden] {\n display: none;\n}\n.dve-print-page {\n position: relative;\n flex: none;\n background: var(--dve-page-color, #fff);\n color: #202124;\n box-shadow:\n 0 1px 3px #20212430,\n 0 4px 12px #20212420;\n overflow: hidden;\n}\n.dve-print-column {\n position: absolute;\n z-index: 1;\n}\n/* Floating pictures sit in front of text unless anchored behind it (wp:anchor/@behindDoc). */\n.dve-print-float {\n z-index: 2;\n}\n.dve-print-float-behind {\n z-index: 0;\n}\n.dve-print-picture-missing {\n box-sizing: border-box;\n border: 1px dashed #8a8886;\n background: #f3f2f1;\n}\n.dve-print-chart {\n overflow: hidden;\n background: #fff;\n}\n.dve-print-chart > svg {\n display: block;\n width: 100%;\n height: 100%;\n}\n.dve-print-chart-frame {\n display: grid;\n place-items: center;\n color: #605e5c;\n font-size: 11px;\n}\n.dve-print-block {\n position: absolute;\n left: 0;\n width: 100%;\n}\n.dve-print-line {\n position: absolute;\n left: 0;\n width: 100%;\n font:\n 11pt/1.2 Calibri,\n Arial,\n sans-serif;\n cursor: text;\n}\n.dve-print-line span {\n position: absolute;\n top: 0;\n}\n.dve-print-row {\n position: absolute;\n left: 0;\n width: 100%;\n}\n/* Cells sit at their grid positions; borders come from the document (Word prints no gridlines). */\n.dve-print-cell {\n position: absolute;\n top: 0;\n box-sizing: border-box;\n}\n.dve-print-cell-content {\n position: absolute;\n bottom: 0;\n}\n@media print {\n .dve-ribbon,\n .dve-status,\n .multilingual-controls {\n display: none !important;\n }\n .dve-canvas {\n overflow: visible !important;\n padding: 0 !important;\n }\n .dve-paper {\n display: none !important;\n }\n .dve-print-pages {\n gap: 0 !important;\n zoom: 1 !important;\n }\n .dve-print-page {\n /* Like Word, page colours are not printed unless asked for. */\n background: #fff !important;\n box-shadow: none !important;\n break-after: page;\n }\n}\n.dve-print-header,\n.dve-print-footer {\n position: absolute;\n color: var(--ink);\n font-size: 11pt;\n pointer-events: none;\n}\n.dve-print-header p,\n.dve-print-footer p {\n margin: 0;\n}\n.dve-print-header table,\n.dve-print-footer table {\n width: 100%;\n border-collapse: collapse;\n}\n\n/* Complex field begin/code/separate/end markers: kept in the document, never shown. */\n.dve-field-marker {\n display: inline;\n font-size: 0;\n}\n\n/* TOC entries link to hidden _Toc bookmarks; Word draws them in the entry's style, not as links. */\na.dve-link[data-anchor^='_Toc'] {\n color: inherit;\n text-decoration: none;\n}\n\n/* Tabs sized to Word's tab stops by tab-stops-view.ts; leaders fill the tab's width. */\n.dve-tab {\n display: inline-block;\n overflow: hidden;\n white-space: pre;\n vertical-align: baseline;\n text-indent: 0;\n}\n.dve-tab-leader-dot,\n.dve-tab-leader-middleDot {\n background-image: radial-gradient(circle, currentColor 0.8px, transparent 1.1px);\n background-size: 4px 4px;\n background-repeat: repeat-x;\n background-position: right 0 bottom 0.25em;\n}\n.dve-tab-leader-hyphen {\n background-image: linear-gradient(to right, currentColor 50%, transparent 50%);\n background-size: 6px 1px;\n background-repeat: repeat-x;\n background-position: right 0 bottom 0.4em;\n}\n.dve-tab-leader-underscore,\n.dve-tab-leader-heavy {\n border-bottom: 1px solid currentColor;\n}\n.dve-tab-leader-heavy {\n border-bottom-width: 2px;\n}\n\n/* Footnotes above the bottom margin; the separator is Word's 2-inch rule. */\n.dve-print-footnotes {\n position: absolute;\n z-index: 1;\n}\n.dve-print-footnote-separator {\n position: absolute;\n top: -7px;\n left: 0;\n width: 192px;\n border-top: 1px solid currentColor;\n}\n.dve-print-footnote-continuation-separator {\n width: 100%;\n}\n.dve-print-footnote {\n position: absolute;\n left: 0;\n width: 100%;\n}\n\n[data-print-view] .dve-notes-container {\n display: none;\n}\n\n/* Word draws superscript and subscript at about two thirds size without growing the line. */\n.dve-paper sup,\n.dve-paper sub {\n font-size: 0.65em;\n line-height: 0;\n}\n/* Exact-height rows clip content that does not fit, as Word does. */\n.dve-print-cell {\n overflow: hidden;\n}\n.dve-print-paragraph-frame {\n position: absolute;\n top: 0;\n box-sizing: border-box;\n}\n\n/* View > Multiple Pages: Print Layout's sheets sit side by side and wrap, instead of one column. */\n.dve-canvas[data-multipage] .dve-print-pages {\n flex-direction: row;\n flex-wrap: wrap;\n align-items: flex-start;\n justify-content: center;\n}\n\n/* Layout > Line Numbers: numbers in the left margin, one per printed line. */\n.dve-print-line-number {\n position: absolute;\n width: 40px;\n text-align: right;\n font:\n 10px 'Segoe UI',\n Arial,\n sans-serif;\n color: #444;\n pointer-events: none;\n}\n\n/* Native input stays mounted while page geometry supplies the visible selection. */\n.dve-paper.dve-print-input {\n position: fixed;\n top: 0;\n left: 0;\n margin: 0;\n opacity: 0;\n max-height: 1px;\n overflow: hidden;\n pointer-events: none;\n z-index: -1;\n}\n.dve-print-pages {\n position: relative;\n}\n.dve-print-selection-layer {\n position: absolute;\n inset: 0;\n pointer-events: none;\n z-index: 3;\n}\n.dve-print-caret,\n.dve-print-selection {\n position: absolute;\n pointer-events: none;\n}\n.dve-print-caret {\n background: currentColor;\n animation: dve-print-caret-blink 1s step-end infinite;\n}\n.dve-print-selection {\n background: Highlight;\n opacity: 0.3;\n}\n@keyframes dve-print-caret-blink {\n 50% {\n opacity: 0;\n }\n}\n@media print {\n .dve-print-input,\n .dve-print-selection-layer {\n display: none !important;\n }\n}\n";
|
|
17166
|
+
var print_default = ".dve-print-pages {\n display: flex;\n flex-direction: column;\n align-items: center;\n gap: 24px;\n margin: 0 auto;\n zoom: var(--dve-zoom, 1);\n}\n/* The view wraps the layout's own pages container; zoom the pair once, not twice. */\n.dve-print-pages > .dve-print-pages {\n zoom: 1;\n}\n.dve-print-pages[hidden] {\n display: none;\n}\n.dve-print-page {\n position: relative;\n flex: none;\n background: var(--dve-page-color, #fff);\n color: #202124;\n box-shadow:\n 0 1px 3px #20212430,\n 0 4px 12px #20212420;\n overflow: hidden;\n}\n.dve-print-column {\n position: absolute;\n z-index: 1;\n}\n/* Floating pictures sit in front of text unless anchored behind it (wp:anchor/@behindDoc). */\n.dve-print-float {\n z-index: 2;\n}\n.dve-print-float-behind {\n z-index: 0;\n}\n.dve-print-picture-missing {\n box-sizing: border-box;\n border: 1px dashed #8a8886;\n background: #f3f2f1;\n}\n.dve-print-chart {\n overflow: hidden;\n background: #fff;\n}\n.dve-print-chart > svg {\n display: block;\n width: 100%;\n height: 100%;\n}\n.dve-print-chart-frame {\n display: grid;\n place-items: center;\n color: #605e5c;\n font-size: 11px;\n}\n.dve-print-block {\n position: absolute;\n left: 0;\n width: 100%;\n}\n.dve-print-line {\n position: absolute;\n left: 0;\n width: 100%;\n font:\n 11pt/1.2 Calibri,\n Arial,\n sans-serif;\n cursor: text;\n}\n.dve-print-line span {\n position: absolute;\n top: 0;\n}\n.dve-print-row {\n position: absolute;\n left: 0;\n width: 100%;\n}\n/* Cells sit at their grid positions; borders come from the document (Word prints no gridlines). */\n.dve-print-cell {\n position: absolute;\n top: 0;\n box-sizing: border-box;\n}\n.dve-print-cell-content {\n position: absolute;\n bottom: 0;\n}\n@media print {\n .dve-ribbon,\n .dve-status,\n .multilingual-controls {\n display: none !important;\n }\n .dve-canvas {\n overflow: visible !important;\n padding: 0 !important;\n }\n .dve-paper {\n display: none !important;\n }\n .dve-print-pages {\n gap: 0 !important;\n zoom: 1 !important;\n }\n .dve-print-page {\n /* Like Word, page colours are not printed unless asked for. */\n background: #fff !important;\n box-shadow: none !important;\n break-after: page;\n }\n}\n.dve-print-header,\n.dve-print-footer {\n position: absolute;\n color: var(--ink);\n font-size: 11pt;\n pointer-events: none;\n}\n.dve-print-header p,\n.dve-print-footer p {\n margin: 0;\n}\n.dve-print-header table,\n.dve-print-footer table {\n width: 100%;\n border-collapse: collapse;\n}\n\n/* Complex field begin/code/separate/end markers: kept in the document, never shown. */\n.dve-field-marker {\n display: inline;\n font-size: 0;\n}\n\n/* TOC entries link to hidden _Toc bookmarks; Word draws them in the entry's style, not as links. */\na.dve-link[data-anchor^='_Toc'] {\n color: inherit;\n text-decoration: none;\n}\n\n/* Tabs sized to Word's tab stops by tab-stops-view.ts; leaders fill the tab's width. */\n.dve-tab {\n display: inline-block;\n overflow: hidden;\n white-space: pre;\n vertical-align: baseline;\n text-indent: 0;\n}\n.dve-tab-leader-dot,\n.dve-tab-leader-middleDot {\n background-image: radial-gradient(circle, currentColor 0.8px, transparent 1.1px);\n background-size: 4px 4px;\n background-repeat: repeat-x;\n background-position: right 0 bottom 0.25em;\n}\n.dve-tab-leader-hyphen {\n background-image: linear-gradient(to right, currentColor 50%, transparent 50%);\n background-size: 6px 1px;\n background-repeat: repeat-x;\n background-position: right 0 bottom 0.4em;\n}\n.dve-tab-leader-underscore,\n.dve-tab-leader-heavy {\n border-bottom: 1px solid currentColor;\n}\n.dve-tab-leader-heavy {\n border-bottom-width: 2px;\n}\n\n/* Footnotes above the bottom margin; the separator is Word's 2-inch rule. */\n.dve-print-footnotes {\n position: absolute;\n z-index: 1;\n}\n.dve-print-footnote-separator {\n position: absolute;\n top: -7px;\n left: 0;\n width: 192px;\n border-top: 1px solid currentColor;\n}\n.dve-print-footnote-continuation-separator {\n width: 100%;\n}\n.dve-print-footnote {\n position: absolute;\n left: 0;\n width: 100%;\n}\n\n[data-print-view] .dve-notes-container {\n display: none;\n}\n\n/* Word draws superscript and subscript at about two thirds size without growing the line. */\n.dve-paper sup,\n.dve-paper sub {\n font-size: 0.65em;\n line-height: 0;\n}\n/* Exact-height rows clip content that does not fit, as Word does. */\n.dve-print-cell {\n overflow: hidden;\n}\n.dve-print-paragraph-frame {\n position: absolute;\n top: 0;\n box-sizing: border-box;\n}\n\n/* View > Multiple Pages: Print Layout's sheets sit side by side and wrap, instead of one column. */\n.dve-canvas[data-multipage] .dve-print-pages {\n flex-direction: row;\n flex-wrap: wrap;\n align-items: flex-start;\n justify-content: center;\n}\n\n/* Layout > Line Numbers: numbers in the left margin, one per printed line. */\n.dve-print-line-number {\n position: absolute;\n width: 40px;\n text-align: right;\n font:\n 10px 'Segoe UI',\n Arial,\n sans-serif;\n color: #444;\n pointer-events: none;\n}\n\n/* Native input stays mounted while page geometry supplies the visible selection. */\n.dve-paper.dve-print-input {\n position: fixed;\n top: 0;\n left: 0;\n margin: 0;\n opacity: 0;\n max-height: 1px;\n overflow: hidden;\n pointer-events: none;\n z-index: -1;\n}\n.dve-print-pages {\n position: relative;\n}\n.dve-print-selection-layer {\n position: absolute;\n inset: 0;\n pointer-events: none;\n z-index: 3;\n}\n.dve-print-caret,\n.dve-print-selection {\n position: absolute;\n pointer-events: none;\n}\n.dve-print-caret {\n background: currentColor;\n animation: dve-print-caret-blink 1s step-end infinite;\n}\n.dve-print-selection {\n background: Highlight;\n opacity: 0.3;\n}\n@keyframes dve-print-caret-blink {\n 50% {\n opacity: 0;\n }\n}\n@media print {\n .dve-print-input,\n .dve-print-selection-layer {\n display: none !important;\n }\n}\n";
|
|
16945
17167
|
|
|
16946
17168
|
// raw-css:/home/runner/work/ooxml/ooxml/src/ui/src/docx/styles/chrome-titlebar.css?raw
|
|
16947
17169
|
var chrome_titlebar_default = ".dve-frame {\n position: relative;\n border: 0;\n box-shadow: none;\n}\n.dve-icon {\n flex: none;\n}\n.dve-icon-button {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n min-width: 28px;\n height: 28px;\n padding: 0 6px;\n border: 0;\n border-radius: 4px;\n background: none;\n color: inherit;\n cursor: pointer;\n}\n.dve-icon-button:hover:not(:disabled),\n.dve-icon-button[aria-pressed='true'] {\n background: var(--word-soft);\n}\n.dve-icon-button:disabled {\n opacity: 0.4;\n cursor: default;\n}\n\n/* Title bar: drawn by the shared office-ui-title-bar; these colour it. */\n.dve-titlebar {\n flex: none;\n --office-title-bar-height: 40px;\n --office-title-bar-background: var(--chrome);\n --office-title-bar-border: var(--line);\n --office-title-bar-mark-background: var(--word);\n --office-title-bar-mark-foreground: var(--dve-primary-foreground);\n}\n";
|
|
16948
17170
|
|
|
16949
17171
|
// raw-css:/home/runner/work/ooxml/ooxml/src/ui/src/docx/styles/backstage.css?raw
|
|
16950
|
-
var backstage_default = "/* Backstage: the shared office-ui-backstage draws the frame; these colour it and style the pages. */\n.dve-backstage {\n --office-backstage-nav-width: 220px;\n --office-backstage-nav-background: var(--word);\n --office-backstage-nav-foreground: var(--dve-primary-foreground);\n --office-backstage-item-hover: var(--word-strong);\n z-index: 40;\n background: var(--surface);\n}\n.dve-backstage-content {\n overflow: auto;\n padding: 28px 40px;\n color: var(--ink);\n}\n.dve-backstage-content h2 {\n margin: 0 0 20px;\n font-size: 30px;\n font-weight: 300;\n}\n.dve-backstage-content h3 {\n margin: 24px 0 10px;\n font-size: 15px;\n font-weight: 600;\n}\n.dve-backstage-facts {\n display: grid;\n grid-template-columns: max-content minmax(0, 1fr);\n gap: 6px 24px;\n margin: 0;\n}\n.dve-backstage-facts dt {\n color: var(--muted);\n}\n.dve-backstage-facts dd {\n margin: 0;\n overflow-wrap: anywhere;\n}\n.dve-compatibility-notes {\n display: grid;\n gap: 8px;\n max-width: 760px;\n margin: 0;\n padding: 0;\n list-style: none;\n}\n.dve-compatibility-notes li {\n display: flex;\n gap: 8px;\n padding: 10px 12px;\n border: 1px solid var(--line);\n border-radius: 6px;\n line-height: 1.45;\n}\n.dve-compatibility-notes .dve-icon {\n margin-top: 2px;\n color: #b7791f;\n}\n.dve-backstage-tile {\n display: inline-flex;\n flex-direction: column;\n gap: 8px;\n padding: 8px;\n border: 1px solid transparent;\n border-radius: 6px;\n background: none;\n color: var(--ink);\n font: inherit;\n cursor: pointer;\n}\n.dve-backstage-tile:hover {\n border-color: var(--line);\n background: var(--word-soft);\n}\n.dve-backstage-tile-preview {\n width: 150px;\n height: 190px;\n border: 1px solid var(--line);\n background: #fff;\n box-shadow: 0 1px 3px #0002;\n}\n.dve-backstage-primary {\n padding: 8px 18px;\n border: 0;\n border-radius: 4px;\n background: var(--word);\n color: var(--dve-primary-foreground);\n font: inherit;\n cursor: pointer;\n}\n.dve-backstage-muted {\n color: var(--muted);\n}\n\n.dve-backstage-title {\n margin: 0 0 4px;\n font-size: 26px;\n font-weight: 400;\n overflow-wrap: anywhere;\n}\n.dve-backstage-columns {\n display: grid;\n grid-template-columns: minmax(0, 1fr) 300px;\n gap: 40px;\n align-items: start;\n}\n.dve-backstage-properties {\n padding: 4px 0 0 24px;\n border-left: 1px solid var(--line);\n}\n.dve-backstage-properties h3 {\n margin-top: 0;\n}\n.dve-backstage-card {\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: 24px;\n max-width: 760px;\n margin-bottom: 12px;\n padding: 14px 18px;\n border: 1px solid var(--line);\n border-radius: 6px;\n}\n.dve-backstage-card h3 {\n margin: 0 0 4px;\n}\n.dve-backstage-card p {\n margin: 0;\n}\n.dve-backstage-field {\n display: grid;\n gap: 4px;\n max-width: 420px;\n margin-bottom: 14px;\n color: var(--muted);\n font-size: 12px;\n}\n.dve-backstage-field input,\n.dve-backstage-field select {\n height: 32px;\n padding: 0 8px;\n border: 1px solid var(--line);\n border-radius: 4px;\n background: var(--surface);\n color: var(--ink);\n font:\n 14px 'Segoe UI',\n Arial,\n sans-serif;\n}\n.dve-backstage-home-actions {\n display: flex;\n flex-wrap: wrap;\n gap: 12px;\n margin: 24px 0;\n}\n.dve-backstage-toggle {\n display: flex;\n align-items: center;\n gap: 12px;\n}\n.dve-backstage-toggle input {\n width: 18px;\n height: 18px;\n}\n@media (max-width: 760px) {\n .dve-backstage-content {\n padding: 20px;\n }\n .dve-backstage-card {\n align-items: stretch;\n flex-direction: column;\n }\n .dve-backstage-columns {\n grid-template-columns: minmax(0, 1fr);\n }\n .dve-backstage-properties {\n padding-left: 0;\n border-left: 0;\n }\n}\n\n/* Customize Ribbon: one block per tab, one fieldset per group, a checkbox per command. */\n.dve-customize-tab h3 {\n margin:
|
|
17172
|
+
var backstage_default = "/* Backstage: the shared office-ui-backstage draws the frame; these colour it and style the pages. */\n.dve-backstage {\n --office-backstage-nav-width: 220px;\n --office-backstage-nav-background: var(--word);\n --office-backstage-nav-foreground: var(--dve-primary-foreground);\n --office-backstage-item-hover: var(--word-strong);\n z-index: 40;\n background: var(--surface);\n}\n.dve-backstage-content {\n overflow: auto;\n padding: 28px 40px;\n color: var(--ink);\n}\n.dve-backstage-content h2 {\n margin: 0 0 20px;\n font-size: 30px;\n font-weight: 300;\n}\n.dve-backstage-content h3 {\n margin: 24px 0 10px;\n font-size: 15px;\n font-weight: 600;\n}\n.dve-backstage-facts {\n display: grid;\n grid-template-columns: max-content minmax(0, 1fr);\n gap: 6px 24px;\n margin: 0;\n}\n.dve-backstage-facts dt {\n color: var(--muted);\n}\n.dve-backstage-facts dd {\n margin: 0;\n overflow-wrap: anywhere;\n}\n.dve-compatibility-notes {\n display: grid;\n gap: 8px;\n max-width: 760px;\n margin: 0;\n padding: 0;\n list-style: none;\n}\n.dve-compatibility-notes li {\n display: flex;\n gap: 8px;\n padding: 10px 12px;\n border: 1px solid var(--line);\n border-radius: 6px;\n line-height: 1.45;\n}\n.dve-compatibility-notes .dve-icon {\n margin-top: 2px;\n color: #b7791f;\n}\n.dve-backstage-tile {\n display: inline-flex;\n flex-direction: column;\n gap: 8px;\n padding: 8px;\n border: 1px solid transparent;\n border-radius: 6px;\n background: none;\n color: var(--ink);\n font: inherit;\n cursor: pointer;\n}\n.dve-backstage-tile:hover {\n border-color: var(--line);\n background: var(--word-soft);\n}\n.dve-backstage-tile-preview {\n width: 150px;\n height: 190px;\n border: 1px solid var(--line);\n background: #fff;\n box-shadow: 0 1px 3px #0002;\n}\n.dve-backstage-primary {\n padding: 8px 18px;\n border: 0;\n border-radius: 4px;\n background: var(--word);\n color: var(--dve-primary-foreground);\n font: inherit;\n cursor: pointer;\n}\n.dve-backstage-muted {\n color: var(--muted);\n}\n\n.dve-backstage-title {\n margin: 0 0 4px;\n font-size: 26px;\n font-weight: 400;\n overflow-wrap: anywhere;\n}\n.dve-backstage-columns {\n display: grid;\n grid-template-columns: minmax(0, 1fr) 300px;\n gap: 40px;\n align-items: start;\n}\n.dve-backstage-properties {\n padding: 4px 0 0 24px;\n border-left: 1px solid var(--line);\n}\n.dve-backstage-properties h3 {\n margin-top: 0;\n}\n.dve-backstage-card {\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: 24px;\n max-width: 760px;\n margin-bottom: 12px;\n padding: 14px 18px;\n border: 1px solid var(--line);\n border-radius: 6px;\n}\n.dve-backstage-card h3 {\n margin: 0 0 4px;\n}\n.dve-backstage-card p {\n margin: 0;\n}\n.dve-backstage-field {\n display: grid;\n gap: 4px;\n max-width: 420px;\n margin-bottom: 14px;\n color: var(--muted);\n font-size: 12px;\n}\n.dve-backstage-field input,\n.dve-backstage-field select {\n height: 32px;\n padding: 0 8px;\n border: 1px solid var(--line);\n border-radius: 4px;\n background: var(--surface);\n color: var(--ink);\n font:\n 14px 'Segoe UI',\n Arial,\n sans-serif;\n}\n.dve-backstage-home-actions {\n display: flex;\n flex-wrap: wrap;\n gap: 12px;\n margin: 24px 0;\n}\n.dve-backstage-toggle {\n display: flex;\n align-items: center;\n gap: 12px;\n}\n.dve-backstage-toggle input {\n width: 18px;\n height: 18px;\n}\n@media (max-width: 760px) {\n .dve-backstage-content {\n padding: 20px;\n }\n .dve-backstage-card {\n align-items: stretch;\n flex-direction: column;\n }\n .dve-backstage-columns {\n grid-template-columns: minmax(0, 1fr);\n }\n .dve-backstage-properties {\n padding-left: 0;\n border-left: 0;\n }\n}\n\n/* File > Options > Customize Ribbon: one block per tab, one fieldset per group, a checkbox per command. */\n.dve-options-note {\n margin: 0 0 8px;\n color: var(--muted);\n font-size: 11px;\n}\n.dve-options-action {\n margin: 0 0 8px;\n padding: 6px 11px;\n border: 1px solid var(--line);\n border-radius: 4px;\n background: transparent;\n color: inherit;\n font: inherit;\n font-size: 12px;\n cursor: pointer;\n}\n.dve-customize-tab h3 {\n margin: 14px 0 4px;\n padding-bottom: 2px;\n border-bottom: 1px solid var(--line);\n color: var(--muted);\n font-size: 10px;\n font-weight: 700;\n letter-spacing: 0.04em;\n text-transform: uppercase;\n}\n.dve-customize-group {\n margin: 0 0 8px;\n padding: 6px 10px 8px;\n border: 1px solid var(--line);\n border-radius: 4px;\n}\n.dve-customize-group legend {\n padding: 0 4px;\n color: var(--muted);\n font-size: 11px;\n}\n.dve-customize-row {\n display: inline-flex;\n align-items: center;\n gap: 6px;\n min-width: 180px;\n padding: 2px 8px 2px 0;\n font-size: 12px;\n}\n";
|
|
16951
17173
|
|
|
16952
17174
|
// raw-css:/home/runner/work/ooxml/ooxml/src/ui/src/docx/styles/status-dialogs.css?raw
|
|
16953
17175
|
var status_dialogs_default = "/* Status bar: drawn by the shared office-ui-status-bar; this only places it in the frame. */\n.dve-status {\n display: block;\n flex: none;\n min-width: 0;\n border-top: 1px solid var(--line);\n}\n\n@media (max-width: 760px) {\n .dve-backstage-content {\n padding: 20px;\n }\n}\n\n/* Dialogs: the shared office-ui-dialog draws the modal frame; these style the fields inside it. */\n.dve-dialog {\n --office-dialog-width: min(440px, calc(100vw - 32px));\n}\n/* The fields are the dialog's light-DOM children, laid out in the shared body. */\n.dve-dialog > :not([slot]) + :not([slot]) {\n margin-top: 10px;\n}\n.dve-dialog label {\n display: grid;\n gap: 4px;\n color: var(--muted);\n font-size: 12px;\n}\n.dve-dialog input,\n.dve-dialog select {\n height: 30px;\n padding: 0 8px;\n border: 1px solid var(--line);\n border-radius: 4px;\n background: var(--surface);\n color: var(--ink);\n font: inherit;\n}\n.dve-dialog-actions {\n display: flex;\n justify-content: flex-end;\n gap: 8px;\n}\n.dve-dialog-actions button {\n min-height: 30px;\n padding: 0 14px;\n border: 1px solid var(--line);\n border-radius: 4px;\n background: var(--surface);\n color: var(--ink);\n font: inherit;\n cursor: pointer;\n}\n.dve-dialog-actions .dve-dialog-primary {\n border-color: var(--word);\n background: var(--word);\n color: var(--dve-primary-foreground);\n}\n";
|
|
@@ -18137,6 +18359,12 @@ function createPrintLayoutController(scrollContainer, onRequestCursor, pictureUr
|
|
|
18137
18359
|
pendingModel = null;
|
|
18138
18360
|
}
|
|
18139
18361
|
},
|
|
18362
|
+
relayoutNow(model) {
|
|
18363
|
+
if (timer) clearTimeout(timer);
|
|
18364
|
+
timer = void 0;
|
|
18365
|
+
pendingModel = null;
|
|
18366
|
+
relayout(model);
|
|
18367
|
+
},
|
|
18140
18368
|
scheduleRelayout(model) {
|
|
18141
18369
|
pendingModel = model;
|
|
18142
18370
|
if (timer !== void 0) return;
|
|
@@ -18520,6 +18748,7 @@ function createPrintEditingBridge(pages, paper, getView, resolveHit, scrollConta
|
|
|
18520
18748
|
let nativeX = 0;
|
|
18521
18749
|
let nativeY = 0;
|
|
18522
18750
|
let dragging = false;
|
|
18751
|
+
let skipScroll = false;
|
|
18523
18752
|
let previousDoc;
|
|
18524
18753
|
let previousHead = -1;
|
|
18525
18754
|
let preferredPage;
|
|
@@ -18595,7 +18824,9 @@ function createPrintEditingBridge(pages, paper, getView, resolveHit, scrollConta
|
|
|
18595
18824
|
marker.style.background = "transparent";
|
|
18596
18825
|
marker.style.animation = "none";
|
|
18597
18826
|
}
|
|
18598
|
-
|
|
18827
|
+
const settle = skipScroll;
|
|
18828
|
+
skipScroll = false;
|
|
18829
|
+
if (!dragging && !settle && !view.composing && (previousDoc !== view.state.doc || previousHead !== head))
|
|
18599
18830
|
marker.scrollIntoView?.({ block: "nearest", inline: "nearest" });
|
|
18600
18831
|
previousDoc = view.state.doc;
|
|
18601
18832
|
previousHead = head;
|
|
@@ -18636,9 +18867,30 @@ function createPrintEditingBridge(pages, paper, getView, resolveHit, scrollConta
|
|
|
18636
18867
|
const root = pages.getRootNode();
|
|
18637
18868
|
const target = root.elementFromPoint?.(event.clientX, event.clientY);
|
|
18638
18869
|
const line = target?.closest(".dve-print-line[data-block-id]");
|
|
18639
|
-
if (
|
|
18870
|
+
if (line && pages.contains(line)) {
|
|
18871
|
+
preferredPage = line.closest(".dve-print-page")?.dataset.pageIndex;
|
|
18872
|
+
return resolveHit(target, event.clientX) ?? void 0;
|
|
18873
|
+
}
|
|
18874
|
+
const origin = event.target instanceof Element ? event.target : target;
|
|
18875
|
+
if (origin?.closest('button, a, input, textarea, select, [contenteditable="true"]'))
|
|
18876
|
+
return void 0;
|
|
18877
|
+
const view = getView();
|
|
18878
|
+
if (!view || view.isDestroyed) return void 0;
|
|
18879
|
+
index.update(view.state.doc);
|
|
18880
|
+
const nearest = index.nearest(event.clientX, event.clientY);
|
|
18881
|
+
if (!nearest) return void 0;
|
|
18882
|
+
preferredPage = nearest.closest(".dve-print-page")?.dataset.pageIndex;
|
|
18883
|
+
return resolveHit(nearest, event.clientX) ?? void 0;
|
|
18884
|
+
}
|
|
18885
|
+
function selectNearest(x, y) {
|
|
18886
|
+
const view = getView();
|
|
18887
|
+
if (!active || !view || view.isDestroyed) return false;
|
|
18888
|
+
index.update(view.state.doc);
|
|
18889
|
+
const line = index.nearest(x, y);
|
|
18890
|
+
const target = line && resolveHit(line, x);
|
|
18891
|
+
if (!line || !target) return false;
|
|
18640
18892
|
preferredPage = line.closest(".dve-print-page")?.dataset.pageIndex;
|
|
18641
|
-
return
|
|
18893
|
+
return select2(target.blockId, target.offset);
|
|
18642
18894
|
}
|
|
18643
18895
|
function extendAt(x, y) {
|
|
18644
18896
|
const view = getView();
|
|
@@ -18657,6 +18909,7 @@ function createPrintEditingBridge(pages, paper, getView, resolveHit, scrollConta
|
|
|
18657
18909
|
dragScroll.update(event.clientX, event.clientY);
|
|
18658
18910
|
}
|
|
18659
18911
|
function up() {
|
|
18912
|
+
if (dragging) skipScroll = true;
|
|
18660
18913
|
dragging = false;
|
|
18661
18914
|
dragScroll.stop();
|
|
18662
18915
|
window.removeEventListener("pointermove", move);
|
|
@@ -18765,7 +19018,8 @@ function createPrintEditingBridge(pages, paper, getView, resolveHit, scrollConta
|
|
|
18765
19018
|
previousDoc = void 0;
|
|
18766
19019
|
},
|
|
18767
19020
|
refresh,
|
|
18768
|
-
select: select2
|
|
19021
|
+
select: select2,
|
|
19022
|
+
selectNearest
|
|
18769
19023
|
};
|
|
18770
19024
|
}
|
|
18771
19025
|
function moveCursorToBlock(view, blockId, offset) {
|
|
@@ -19092,79 +19346,6 @@ function icon(name) {
|
|
|
19092
19346
|
svg.append(path);
|
|
19093
19347
|
return svg;
|
|
19094
19348
|
}
|
|
19095
|
-
|
|
19096
|
-
// src/docx/backstage-options.ts
|
|
19097
|
-
function renderOptions({ handlers, t, content }) {
|
|
19098
|
-
const current2 = handlers.options();
|
|
19099
|
-
const heading2 = (text, tag) => {
|
|
19100
|
-
const el = document.createElement(tag);
|
|
19101
|
-
el.textContent = t(text);
|
|
19102
|
-
return el;
|
|
19103
|
-
};
|
|
19104
|
-
const field2 = (text, control) => {
|
|
19105
|
-
const label = document.createElement("label");
|
|
19106
|
-
label.className = "dve-backstage-field";
|
|
19107
|
-
const caption = document.createElement("span");
|
|
19108
|
-
caption.textContent = t(text);
|
|
19109
|
-
control.setAttribute("aria-label", t(text));
|
|
19110
|
-
label.append(caption, control);
|
|
19111
|
-
return label;
|
|
19112
|
-
};
|
|
19113
|
-
const select2 = (key2, values2) => {
|
|
19114
|
-
const el = document.createElement("select");
|
|
19115
|
-
for (const [value, text] of values2) el.append(new Option(t(text), value));
|
|
19116
|
-
el.value = current2[key2];
|
|
19117
|
-
el.addEventListener("change", () => handlers.setOption(key2, el.value));
|
|
19118
|
-
return el;
|
|
19119
|
-
};
|
|
19120
|
-
const author = document.createElement("input");
|
|
19121
|
-
author.type = "text";
|
|
19122
|
-
author.value = current2.author;
|
|
19123
|
-
author.addEventListener("change", () => handlers.setOption("author", author.value));
|
|
19124
|
-
const language = select2("locale", [
|
|
19125
|
-
["en", "English"],
|
|
19126
|
-
["fr", "Fran\xE7ais"],
|
|
19127
|
-
["de", "Deutsch"],
|
|
19128
|
-
["es", "Espa\xF1ol"],
|
|
19129
|
-
["zh-CN", "\u7B80\u4F53\u4E2D\u6587"]
|
|
19130
|
-
]);
|
|
19131
|
-
const theme = select2("theme", [
|
|
19132
|
-
["auto", "Automatic"],
|
|
19133
|
-
["light", "Light"],
|
|
19134
|
-
["dark", "Dark"]
|
|
19135
|
-
]);
|
|
19136
|
-
if (!theme.value) theme.value = "auto";
|
|
19137
|
-
const controls = [];
|
|
19138
|
-
for (const [key2, label] of [
|
|
19139
|
-
["spellCheck", "Spelling"],
|
|
19140
|
-
["showRuler", "Ruler"],
|
|
19141
|
-
["showMarks", "Show paragraph marks"],
|
|
19142
|
-
["showThumbnails", "Page thumbnails"]
|
|
19143
|
-
]) {
|
|
19144
|
-
if (current2[key2] === void 0) continue;
|
|
19145
|
-
const input = document.createElement("input");
|
|
19146
|
-
input.type = "checkbox";
|
|
19147
|
-
input.checked = current2[key2];
|
|
19148
|
-
input.addEventListener("change", () => handlers.setOption(key2, String(input.checked)));
|
|
19149
|
-
const row3 = field2(label, input);
|
|
19150
|
-
row3.classList.add("dve-backstage-toggle");
|
|
19151
|
-
controls.push(row3);
|
|
19152
|
-
}
|
|
19153
|
-
const note = document.createElement("p");
|
|
19154
|
-
note.className = "dve-backstage-muted";
|
|
19155
|
-
note.textContent = t("Options apply to this editor and are not stored between sessions.");
|
|
19156
|
-
content.replaceChildren(
|
|
19157
|
-
heading2("Options", "h2"),
|
|
19158
|
-
heading2("General", "h3"),
|
|
19159
|
-
field2("Display language", language),
|
|
19160
|
-
field2("Theme", theme),
|
|
19161
|
-
field2("Author name", author),
|
|
19162
|
-
...controls.length ? [heading2("View", "h3"), ...controls] : [],
|
|
19163
|
-
note
|
|
19164
|
-
);
|
|
19165
|
-
}
|
|
19166
|
-
|
|
19167
|
-
// src/docx/backstage-pages.ts
|
|
19168
19349
|
var heading = (text, level = "h2") => {
|
|
19169
19350
|
const element = document.createElement(level);
|
|
19170
19351
|
element.textContent = text;
|
|
@@ -19398,7 +19579,9 @@ function renderExport({ handlers, t, content }) {
|
|
|
19398
19579
|
)
|
|
19399
19580
|
);
|
|
19400
19581
|
}
|
|
19401
|
-
|
|
19582
|
+
|
|
19583
|
+
// src/docx/backstage-customize.ts
|
|
19584
|
+
function renderCustomizeRibbon(host, handlers, t) {
|
|
19402
19585
|
const ribbon = handlers.ribbon();
|
|
19403
19586
|
const hidden = new Set(handlers.hiddenActions());
|
|
19404
19587
|
const seen = /* @__PURE__ */ new Set();
|
|
@@ -19408,7 +19591,9 @@ function renderCustomize({ handlers, t, content }) {
|
|
|
19408
19591
|
for (const panel of ribbon ? panelsOf(ribbon) : []) {
|
|
19409
19592
|
const tabSection = document.createElement("section");
|
|
19410
19593
|
tabSection.className = "dve-customize-tab";
|
|
19411
|
-
|
|
19594
|
+
const title = document.createElement("h3");
|
|
19595
|
+
title.textContent = panel.dataset.label ?? "";
|
|
19596
|
+
tabSection.append(title);
|
|
19412
19597
|
for (const group3 of panel.querySelectorAll(".ribbon-group")) {
|
|
19413
19598
|
const list = document.createElement("fieldset");
|
|
19414
19599
|
list.className = "dve-customize-group";
|
|
@@ -19437,16 +19622,185 @@ function renderCustomize({ handlers, t, content }) {
|
|
|
19437
19622
|
}
|
|
19438
19623
|
if (tabSection.children.length > 1) sections.push(tabSection);
|
|
19439
19624
|
}
|
|
19440
|
-
const
|
|
19625
|
+
const note = document.createElement("p");
|
|
19626
|
+
note.className = "dve-options-note";
|
|
19627
|
+
note.textContent = t("Choose which commands the ribbon shows.");
|
|
19628
|
+
const reset = document.createElement("button");
|
|
19629
|
+
reset.type = "button";
|
|
19630
|
+
reset.className = "dve-options-action";
|
|
19631
|
+
reset.textContent = t("Reset all customizations");
|
|
19632
|
+
reset.addEventListener("click", () => {
|
|
19441
19633
|
for (const box2 of boxes) box2.input.checked = true;
|
|
19442
19634
|
commit();
|
|
19443
19635
|
});
|
|
19444
|
-
|
|
19445
|
-
|
|
19446
|
-
|
|
19447
|
-
|
|
19448
|
-
|
|
19449
|
-
|
|
19636
|
+
host.replaceChildren(note, reset, ...sections);
|
|
19637
|
+
}
|
|
19638
|
+
|
|
19639
|
+
// src/docx/backstage-options.ts
|
|
19640
|
+
var LANGUAGES = [
|
|
19641
|
+
["en", "English"],
|
|
19642
|
+
["fr", "Fran\xE7ais"],
|
|
19643
|
+
["de", "Deutsch"],
|
|
19644
|
+
["es", "Espa\xF1ol"],
|
|
19645
|
+
["zh-CN", "\u7B80\u4F53\u4E2D\u6587"]
|
|
19646
|
+
];
|
|
19647
|
+
var BOOLEAN_KEYS = [
|
|
19648
|
+
"spellCheck",
|
|
19649
|
+
"showRuler",
|
|
19650
|
+
"showMarks",
|
|
19651
|
+
"showThumbnails"
|
|
19652
|
+
];
|
|
19653
|
+
var KEYS = ["locale", "theme", "author", ...BOOLEAN_KEYS];
|
|
19654
|
+
function wordCategories(context2, current2) {
|
|
19655
|
+
const { t } = context2;
|
|
19656
|
+
const toggle = (key2, label) => current2[key2] === void 0 ? [] : [{ kind: "toggle", key: key2, label: t(label) }];
|
|
19657
|
+
const display = [
|
|
19658
|
+
{
|
|
19659
|
+
id: "page",
|
|
19660
|
+
title: t("Page display options"),
|
|
19661
|
+
controls: [...toggle("showRuler", "Ruler"), ...toggle("showThumbnails", "Page thumbnails")]
|
|
19662
|
+
},
|
|
19663
|
+
{
|
|
19664
|
+
id: "marks",
|
|
19665
|
+
title: t("Formatting marks"),
|
|
19666
|
+
controls: toggle("showMarks", "Show paragraph marks")
|
|
19667
|
+
}
|
|
19668
|
+
].filter((section3) => section3.controls.length);
|
|
19669
|
+
const spelling = toggle("spellCheck", "Check spelling as you type");
|
|
19670
|
+
return [
|
|
19671
|
+
{
|
|
19672
|
+
id: "general",
|
|
19673
|
+
label: t("General"),
|
|
19674
|
+
description: optionText(context2, "General options for working with {product}."),
|
|
19675
|
+
sections: [
|
|
19676
|
+
userInterfaceSection(context2),
|
|
19677
|
+
personalizeSection(
|
|
19678
|
+
context2,
|
|
19679
|
+
[
|
|
19680
|
+
{ kind: "text", key: "author", label: t("User name"), maxLength: 64 },
|
|
19681
|
+
{
|
|
19682
|
+
kind: "select",
|
|
19683
|
+
key: "theme",
|
|
19684
|
+
label: t("Office Theme"),
|
|
19685
|
+
choices: [
|
|
19686
|
+
{ value: "auto", label: t("Automatic") },
|
|
19687
|
+
{ value: "light", label: t("Light") },
|
|
19688
|
+
{ value: "dark", label: t("Dark") }
|
|
19689
|
+
]
|
|
19690
|
+
}
|
|
19691
|
+
],
|
|
19692
|
+
t("Options apply to this editor and are not stored between sessions.")
|
|
19693
|
+
)
|
|
19694
|
+
]
|
|
19695
|
+
},
|
|
19696
|
+
{
|
|
19697
|
+
id: "display",
|
|
19698
|
+
label: t("Display"),
|
|
19699
|
+
description: t("Change how document content is displayed on the screen."),
|
|
19700
|
+
sections: display,
|
|
19701
|
+
...display.length ? {} : { disabled: t("Not available yet. The editing behaviour is fixed.") }
|
|
19702
|
+
},
|
|
19703
|
+
spelling.length ? {
|
|
19704
|
+
id: "proofing",
|
|
19705
|
+
label: t("Proofing"),
|
|
19706
|
+
description: optionText(context2, "Change how {product} corrects and formats your text."),
|
|
19707
|
+
sections: [{ id: "spelling", title: t("Spelling"), controls: spelling }]
|
|
19708
|
+
} : unavailableCategory(context2, "proofing"),
|
|
19709
|
+
unavailableCategory(context2, "save"),
|
|
19710
|
+
{
|
|
19711
|
+
id: "language",
|
|
19712
|
+
label: t("Language"),
|
|
19713
|
+
description: t("Set the Office Language Preferences."),
|
|
19714
|
+
sections: [
|
|
19715
|
+
{
|
|
19716
|
+
id: "display-language",
|
|
19717
|
+
title: t("Office display language"),
|
|
19718
|
+
description: t("Choose the language for menus, buttons and messages."),
|
|
19719
|
+
controls: [
|
|
19720
|
+
{
|
|
19721
|
+
kind: "select",
|
|
19722
|
+
key: "locale",
|
|
19723
|
+
label: t("Display language"),
|
|
19724
|
+
choices: LANGUAGES.map(([value, label]) => ({ value, label }))
|
|
19725
|
+
}
|
|
19726
|
+
]
|
|
19727
|
+
}
|
|
19728
|
+
]
|
|
19729
|
+
},
|
|
19730
|
+
unavailableCategory(context2, "accessibility"),
|
|
19731
|
+
unavailableCategory(context2, "advanced"),
|
|
19732
|
+
{
|
|
19733
|
+
id: "ribbon",
|
|
19734
|
+
label: t("Customize Ribbon"),
|
|
19735
|
+
description: t("Customize the Ribbon and keyboard shortcuts."),
|
|
19736
|
+
sections: [],
|
|
19737
|
+
custom: true
|
|
19738
|
+
},
|
|
19739
|
+
unavailableCategory(context2, "qat"),
|
|
19740
|
+
unavailableCategory(context2, "addins"),
|
|
19741
|
+
unavailableCategory(context2, "trust")
|
|
19742
|
+
];
|
|
19743
|
+
}
|
|
19744
|
+
function dialogValues(current2) {
|
|
19745
|
+
const values2 = {
|
|
19746
|
+
locale: current2.locale,
|
|
19747
|
+
theme: current2.theme === "light" || current2.theme === "dark" ? current2.theme : "auto",
|
|
19748
|
+
author: current2.author
|
|
19749
|
+
};
|
|
19750
|
+
for (const key2 of BOOLEAN_KEYS) {
|
|
19751
|
+
const value = current2[key2];
|
|
19752
|
+
if (value !== void 0) values2[key2] = value;
|
|
19753
|
+
}
|
|
19754
|
+
return values2;
|
|
19755
|
+
}
|
|
19756
|
+
function createWordOptions(handlers, t) {
|
|
19757
|
+
defineOptionsDialog();
|
|
19758
|
+
const element = document.createElement("office-ui-options-dialog");
|
|
19759
|
+
element.className = "dve-options";
|
|
19760
|
+
const ribbon = document.createElement("div");
|
|
19761
|
+
ribbon.slot = "pane-ribbon";
|
|
19762
|
+
ribbon.className = "dve-options-ribbon";
|
|
19763
|
+
element.append(ribbon);
|
|
19764
|
+
const context2 = { product: "Word", t };
|
|
19765
|
+
let hiddenOnOpen = [];
|
|
19766
|
+
const build2 = () => {
|
|
19767
|
+
const current2 = handlers.options();
|
|
19768
|
+
element.setAttribute("heading", t("Options"));
|
|
19769
|
+
element.labels = optionsLabels(context2);
|
|
19770
|
+
element.categories = wordCategories(context2, current2);
|
|
19771
|
+
element.values = dialogValues(current2);
|
|
19772
|
+
element.defaults = {
|
|
19773
|
+
theme: "auto",
|
|
19774
|
+
...Object.fromEntries(
|
|
19775
|
+
BOOLEAN_KEYS.filter((key2) => current2[key2] !== void 0).map((key2) => [
|
|
19776
|
+
key2,
|
|
19777
|
+
key2 === "spellCheck"
|
|
19778
|
+
])
|
|
19779
|
+
)
|
|
19780
|
+
};
|
|
19781
|
+
};
|
|
19782
|
+
element.addEventListener("office-options-change", (event) => {
|
|
19783
|
+
const { values: values2, changed } = event.detail;
|
|
19784
|
+
for (const key2 of KEYS) if (changed.includes(key2)) handlers.setOption(key2, String(values2[key2]));
|
|
19785
|
+
build2();
|
|
19786
|
+
});
|
|
19787
|
+
element.addEventListener("office-options-cancel", () => {
|
|
19788
|
+
if (hiddenOnOpen.join() !== handlers.hiddenActions().join())
|
|
19789
|
+
handlers.setHiddenActions([...hiddenOnOpen]);
|
|
19790
|
+
});
|
|
19791
|
+
for (const name of ["office-options-change", "office-options-cancel"])
|
|
19792
|
+
element.addEventListener(name, () => setTimeout(() => handlers.close(), 0));
|
|
19793
|
+
return {
|
|
19794
|
+
element,
|
|
19795
|
+
show(category = "general") {
|
|
19796
|
+
build2();
|
|
19797
|
+
hiddenOnOpen = [...handlers.hiddenActions()];
|
|
19798
|
+
renderCustomizeRibbon(ribbon, handlers, t);
|
|
19799
|
+
element.category = category;
|
|
19800
|
+
element.show();
|
|
19801
|
+
},
|
|
19802
|
+
relocalize: build2
|
|
19803
|
+
};
|
|
19450
19804
|
}
|
|
19451
19805
|
|
|
19452
19806
|
// src/docx/backstage.ts
|
|
@@ -19459,8 +19813,7 @@ var NAV = [
|
|
|
19459
19813
|
{ id: "saveAs", label: "Save As" },
|
|
19460
19814
|
{ id: "print", label: "Print" },
|
|
19461
19815
|
{ id: "export", label: "Export" },
|
|
19462
|
-
{ id: "options", label: "Options", footer: true }
|
|
19463
|
-
{ id: "customize", label: "Customize Ribbon", footer: true }
|
|
19816
|
+
{ id: "options", label: "Options", footer: true }
|
|
19464
19817
|
];
|
|
19465
19818
|
var RENDERERS = {
|
|
19466
19819
|
home: renderHome,
|
|
@@ -19469,9 +19822,7 @@ var RENDERERS = {
|
|
|
19469
19822
|
open: renderOpen,
|
|
19470
19823
|
saveAs: renderSaveAs,
|
|
19471
19824
|
print: renderPrint,
|
|
19472
|
-
export: renderExport
|
|
19473
|
-
options: renderOptions,
|
|
19474
|
-
customize: renderCustomize
|
|
19825
|
+
export: renderExport
|
|
19475
19826
|
};
|
|
19476
19827
|
function createBackstage(handlers) {
|
|
19477
19828
|
defineBackstage();
|
|
@@ -19481,7 +19832,7 @@ function createBackstage(handlers) {
|
|
|
19481
19832
|
const t = (text) => translateUiText(element, text);
|
|
19482
19833
|
const pages = /* @__PURE__ */ new Map();
|
|
19483
19834
|
for (const { id } of NAV) {
|
|
19484
|
-
if (id === "save") continue;
|
|
19835
|
+
if (id === "save" || id === "options") continue;
|
|
19485
19836
|
const page2 = document.createElement("div");
|
|
19486
19837
|
page2.className = "dve-backstage-content";
|
|
19487
19838
|
page2.dataset.backstagePage = id;
|
|
@@ -19490,25 +19841,18 @@ function createBackstage(handlers) {
|
|
|
19490
19841
|
element.append(page2);
|
|
19491
19842
|
}
|
|
19492
19843
|
let current2 = "info";
|
|
19493
|
-
const
|
|
19494
|
-
...handlers,
|
|
19495
|
-
setOption(key2, value) {
|
|
19496
|
-
const content = pages.get(current2);
|
|
19497
|
-
const active = element.getRootNode().activeElement;
|
|
19498
|
-
const label = active instanceof HTMLElement && content.contains(active) ? active.getAttribute("aria-label") : null;
|
|
19499
|
-
handlers.setOption(key2, value);
|
|
19500
|
-
queueMicrotask(() => {
|
|
19501
|
-
if (!element.open) return;
|
|
19502
|
-
draw(current2);
|
|
19503
|
-
if (label)
|
|
19504
|
-
[...content.querySelectorAll("[aria-label]")].find((control) => control.getAttribute("aria-label") === label)?.focus();
|
|
19505
|
-
});
|
|
19506
|
-
}
|
|
19507
|
-
};
|
|
19844
|
+
const options = createWordOptions(handlers, t);
|
|
19508
19845
|
const draw = (page2) => {
|
|
19509
19846
|
current2 = page2;
|
|
19510
|
-
|
|
19511
|
-
|
|
19847
|
+
RENDERERS[page2]({ handlers, t, content: pages.get(page2) });
|
|
19848
|
+
};
|
|
19849
|
+
const showOptions = (category) => {
|
|
19850
|
+
if (element.open) {
|
|
19851
|
+
element.open = false;
|
|
19852
|
+
focus.close();
|
|
19853
|
+
}
|
|
19854
|
+
handlers.close();
|
|
19855
|
+
options.show(category);
|
|
19512
19856
|
};
|
|
19513
19857
|
const localize = () => {
|
|
19514
19858
|
const locale = normalizeEditorLocale(element.dataset.editorLocale);
|
|
@@ -19527,6 +19871,9 @@ function createBackstage(handlers) {
|
|
|
19527
19871
|
event.preventDefault();
|
|
19528
19872
|
handlers.close();
|
|
19529
19873
|
handlers.fileCommand("save");
|
|
19874
|
+
} else if (id === "options") {
|
|
19875
|
+
event.preventDefault();
|
|
19876
|
+
showOptions();
|
|
19530
19877
|
} else draw(id);
|
|
19531
19878
|
});
|
|
19532
19879
|
element.addEventListener("office-backstage-close", (event) => {
|
|
@@ -19536,7 +19883,12 @@ function createBackstage(handlers) {
|
|
|
19536
19883
|
});
|
|
19537
19884
|
return {
|
|
19538
19885
|
element,
|
|
19886
|
+
optionsDialog: options.element,
|
|
19539
19887
|
open(page2 = "home") {
|
|
19888
|
+
if (page2 === "options" || page2 === "customize") {
|
|
19889
|
+
showOptions(page2 === "customize" ? "ribbon" : void 0);
|
|
19890
|
+
return;
|
|
19891
|
+
}
|
|
19540
19892
|
focus.open();
|
|
19541
19893
|
draw(page2);
|
|
19542
19894
|
element.show(page2);
|
|
@@ -19550,6 +19902,7 @@ function createBackstage(handlers) {
|
|
|
19550
19902
|
},
|
|
19551
19903
|
relocalize() {
|
|
19552
19904
|
localize();
|
|
19905
|
+
options.relocalize();
|
|
19553
19906
|
if (element.open) draw(current2);
|
|
19554
19907
|
}
|
|
19555
19908
|
};
|
|
@@ -19640,97 +19993,6 @@ function createRibbonActions(handlers) {
|
|
|
19640
19993
|
};
|
|
19641
19994
|
}
|
|
19642
19995
|
|
|
19643
|
-
// src/docx/status-bar.ts
|
|
19644
|
-
var ZOOM_MIN = 50;
|
|
19645
|
-
var ZOOM_MAX = 200;
|
|
19646
|
-
var LAYOUT_ICONS = {
|
|
19647
|
-
webLayout: "M3 5h14v10H3z M3 8h14",
|
|
19648
|
-
printLayout: "M5 3h10v14H5z M8 7h4 M8 10h4"
|
|
19649
|
-
};
|
|
19650
|
-
function createStatusBar(handlers) {
|
|
19651
|
-
defineStatusBar();
|
|
19652
|
-
defineZoomSlider();
|
|
19653
|
-
for (const [name, d] of Object.entries(LAYOUT_ICONS)) registerIcon(name, d);
|
|
19654
|
-
const element = document.createElement("office-ui-status-bar");
|
|
19655
|
-
element.className = "dve-status";
|
|
19656
|
-
const slider = document.createElement("office-ui-zoom-slider");
|
|
19657
|
-
slider.slot = "end";
|
|
19658
|
-
slider.setAttribute("min", String(ZOOM_MIN));
|
|
19659
|
-
slider.setAttribute("max", String(ZOOM_MAX));
|
|
19660
|
-
slider.className = "dve-zoom";
|
|
19661
|
-
element.append(slider);
|
|
19662
|
-
const model = { page: "", words: "", language: "", notes: 0, mode: "draft", zoom: 100 };
|
|
19663
|
-
const locale = () => normalizeEditorLocale(element.dataset.editorLocale);
|
|
19664
|
-
const render = () => {
|
|
19665
|
-
const t = locale();
|
|
19666
|
-
const noteKey = model.notes === 1 ? "status.note" : "status.notes";
|
|
19667
|
-
const layout = (mode, key2) => ({
|
|
19668
|
-
id: mode,
|
|
19669
|
-
icon: mode === "draft" ? "webLayout" : "printLayout",
|
|
19670
|
-
label: translate(t, key2),
|
|
19671
|
-
pressed: model.mode === mode
|
|
19672
|
-
});
|
|
19673
|
-
element.state = {
|
|
19674
|
-
items: [
|
|
19675
|
-
{
|
|
19676
|
-
id: "page",
|
|
19677
|
-
text: model.page,
|
|
19678
|
-
title: translate(t, "nav.approximate"),
|
|
19679
|
-
live: true
|
|
19680
|
-
},
|
|
19681
|
-
{ id: "words", text: model.words },
|
|
19682
|
-
...model.language ? [{ id: "language", text: model.language, narrowHide: true }] : []
|
|
19683
|
-
],
|
|
19684
|
-
toggles: [
|
|
19685
|
-
{
|
|
19686
|
-
id: "notes",
|
|
19687
|
-
icon: "warning",
|
|
19688
|
-
label: translate(t, noteKey).replace("{count}", String(model.notes)),
|
|
19689
|
-
text: translate(t, noteKey).replace("{count}", String(model.notes)),
|
|
19690
|
-
hidden: model.notes === 0
|
|
19691
|
-
}
|
|
19692
|
-
],
|
|
19693
|
-
views: [layout("draft", "Web Layout"), layout("print", "Print Layout")]
|
|
19694
|
-
};
|
|
19695
|
-
slider.setAttribute("out-label", translate(t, "Zoom out"));
|
|
19696
|
-
slider.setAttribute("in-label", translate(t, "Zoom in"));
|
|
19697
|
-
slider.setAttribute("slider-label", translate(t, "Zoom level"));
|
|
19698
|
-
slider.value = model.zoom;
|
|
19699
|
-
};
|
|
19700
|
-
element.addEventListener("office-status-activate", (event) => {
|
|
19701
|
-
const { id } = event.detail;
|
|
19702
|
-
if (id === "notes") handlers.showCompatibilityNotes();
|
|
19703
|
-
else if (id === "draft" || id === "print") handlers.setViewMode(id);
|
|
19704
|
-
});
|
|
19705
|
-
slider.addEventListener("input", () => handlers.setZoom(slider.value));
|
|
19706
|
-
render();
|
|
19707
|
-
return {
|
|
19708
|
-
element,
|
|
19709
|
-
setPageAndWords(pageText, wordText) {
|
|
19710
|
-
model.page = pageText;
|
|
19711
|
-
model.words = wordText;
|
|
19712
|
-
render();
|
|
19713
|
-
},
|
|
19714
|
-
setLanguage(value) {
|
|
19715
|
-
model.language = value;
|
|
19716
|
-
render();
|
|
19717
|
-
},
|
|
19718
|
-
setNoteCount(count) {
|
|
19719
|
-
model.notes = count;
|
|
19720
|
-
render();
|
|
19721
|
-
},
|
|
19722
|
-
setViewMode(mode) {
|
|
19723
|
-
model.mode = mode;
|
|
19724
|
-
render();
|
|
19725
|
-
},
|
|
19726
|
-
setZoom(value) {
|
|
19727
|
-
model.zoom = value;
|
|
19728
|
-
render();
|
|
19729
|
-
},
|
|
19730
|
-
relocalize: render
|
|
19731
|
-
};
|
|
19732
|
-
}
|
|
19733
|
-
|
|
19734
19996
|
// src/docx/title-bar.ts
|
|
19735
19997
|
var SAVE_STATE_TEXT = {
|
|
19736
19998
|
saved: "Saved",
|
|
@@ -19912,7 +20174,12 @@ var EditorChrome = class {
|
|
|
19912
20174
|
/** Adds the chrome around an existing frame: title bar first, status bar and backstage last. */
|
|
19913
20175
|
mount(frame, ribbon) {
|
|
19914
20176
|
frame.prepend(this.titleBar.element);
|
|
19915
|
-
frame.append(
|
|
20177
|
+
frame.append(
|
|
20178
|
+
this.statusBar.element,
|
|
20179
|
+
this.backstage.element,
|
|
20180
|
+
this.backstage.optionsDialog,
|
|
20181
|
+
this.fileInput
|
|
20182
|
+
);
|
|
19916
20183
|
this.ribbon = ribbon;
|
|
19917
20184
|
ribbon.append(this.ribbonActions.element);
|
|
19918
20185
|
ribbon.addEventListener("office-ribbon-file", () => this.backstage.open("home"));
|
|
@@ -21034,6 +21301,51 @@ var HeadingNavigator = class {
|
|
|
21034
21301
|
}
|
|
21035
21302
|
}
|
|
21036
21303
|
};
|
|
21304
|
+
var clamp = (value, low, high) => Math.min(Math.max(value, low), Math.max(low, high));
|
|
21305
|
+
function attachCanvasClick(core) {
|
|
21306
|
+
const canvas = core.shell.canvas;
|
|
21307
|
+
if (!canvas) return;
|
|
21308
|
+
const editable2 = () => {
|
|
21309
|
+
const view = core.view;
|
|
21310
|
+
return view && !view.isDestroyed && view.editable && !core.readOnly && core.targetView() === view ? view : void 0;
|
|
21311
|
+
};
|
|
21312
|
+
canvas.addEventListener("pointerdown", (event) => {
|
|
21313
|
+
const view = editable2();
|
|
21314
|
+
if (!view || event.button !== 0) return;
|
|
21315
|
+
if (event.target !== canvas && event.target !== core.shell.paper) return;
|
|
21316
|
+
const frame = canvas.getBoundingClientRect();
|
|
21317
|
+
if (event.clientX - frame.left >= canvas.clientWidth || event.clientY - frame.top >= canvas.clientHeight)
|
|
21318
|
+
return;
|
|
21319
|
+
if (core.pages.viewMode === "print") {
|
|
21320
|
+
if (core.shell.printEditing?.selectNearest(event.clientX, event.clientY))
|
|
21321
|
+
event.preventDefault();
|
|
21322
|
+
return;
|
|
21323
|
+
}
|
|
21324
|
+
const box2 = view.dom.getBoundingClientRect();
|
|
21325
|
+
const found = view.posAtCoords({
|
|
21326
|
+
left: clamp(event.clientX, box2.left + 1, box2.right - 1),
|
|
21327
|
+
top: clamp(event.clientY, box2.top + 1, box2.bottom - 1)
|
|
21328
|
+
});
|
|
21329
|
+
if (!found) return;
|
|
21330
|
+
event.preventDefault();
|
|
21331
|
+
view.dispatch(
|
|
21332
|
+
view.state.tr.setSelection(TextSelection.near(view.state.doc.resolve(found.pos)))
|
|
21333
|
+
);
|
|
21334
|
+
view.focus();
|
|
21335
|
+
});
|
|
21336
|
+
let armed2 = 0;
|
|
21337
|
+
canvas.addEventListener(
|
|
21338
|
+
"pointerdown",
|
|
21339
|
+
(event) => {
|
|
21340
|
+
const target = event.target instanceof Element ? event.target : null;
|
|
21341
|
+
armed2 = editable2() && event.button === 0 && !target?.closest('[data-read-only="true"]') ? Date.now() + 1e3 : 0;
|
|
21342
|
+
},
|
|
21343
|
+
{ capture: true }
|
|
21344
|
+
);
|
|
21345
|
+
canvas.addEventListener("focus", (event) => {
|
|
21346
|
+
if (event.target === canvas && Date.now() < armed2) editable2()?.focus();
|
|
21347
|
+
});
|
|
21348
|
+
}
|
|
21037
21349
|
|
|
21038
21350
|
// src/docx/context-menu-items.ts
|
|
21039
21351
|
var TABLE_ITEMS = [
|
|
@@ -21297,6 +21609,7 @@ function attachEditorInteractions(core, frame) {
|
|
|
21297
21609
|
const { element, shell } = core;
|
|
21298
21610
|
const activeElement = () => element.shadowRoot?.activeElement ?? null;
|
|
21299
21611
|
shell.canvas.tabIndex = -1;
|
|
21612
|
+
attachCanvasClick(core);
|
|
21300
21613
|
const toDocument = () => {
|
|
21301
21614
|
const view = core.targetView();
|
|
21302
21615
|
if (view?.editable) focusView(view);
|
|
@@ -21907,7 +22220,7 @@ function renderDocument(core) {
|
|
|
21907
22220
|
core.detachedState = void 0;
|
|
21908
22221
|
core.inserts.syncPaper();
|
|
21909
22222
|
core.parts.render(canvas, paper);
|
|
21910
|
-
core.pages.relayout();
|
|
22223
|
+
core.pages.relayout(true);
|
|
21911
22224
|
core.refreshControls();
|
|
21912
22225
|
core.scheduleCollaborationSend();
|
|
21913
22226
|
}
|