@office-kit/pptx-editor 0.2.4 → 0.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{agent-tools-BrFS9zmU.js → agent-tools-H2QRduWT.js} +499 -23
- package/dist/{agent-tools-BrFS9zmU.js.map → agent-tools-H2QRduWT.js.map} +1 -1
- package/dist/{deck-merge-DVduyH_q.js → deck-merge-_cAoyPu8.js} +3 -2
- package/dist/deck-merge-_cAoyPu8.js.map +1 -0
- package/dist/headless.js +1 -1
- package/dist/index.js +1 -1
- package/dist/internal.js +1 -1
- package/dist/merge.js +1 -1
- package/dist/{src-CVQKI0m3.js → src-3V4AbzLD.js} +159 -155
- package/dist/src-3V4AbzLD.js.map +1 -0
- package/package.json +3 -3
- package/dist/deck-merge-DVduyH_q.js.map +0 -1
- package/dist/src-CVQKI0m3.js.map +0 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { a as availableOperands, c as selectedSlideIndices, l as topLevelShapes, o as selectedShapeId, r as selectionShapeRefs, s as selectedShapeIds, t as reconcileSelection } from "./shape-ref-B5iNfYWh.js";
|
|
2
2
|
import { n as createAnimationPlayer } from "./animation-player-D2mt2MI8.js";
|
|
3
|
-
import { i as sameDeck, r as mergeDecks } from "./deck-merge-
|
|
3
|
+
import { i as sameDeck, r as mergeDecks } from "./deck-merge-_cAoyPu8.js";
|
|
4
4
|
import * as pptx from "@office-kit/pptx";
|
|
5
5
|
import { BUILTIN_PICTURE_STYLES, BUILTIN_TABLE_STYLES, SLIDE_SIZE_16_10, SLIDE_SIZE_16_9, SLIDE_SIZE_4_3, addBlankSlide, addSlide, addSlideAt, addSlideChart, addSlideComment, addSlideImage, addSlideLine, addSlideMedia, addSlidePlaceholder, addSlideShape, addSlideTable, addSlideTextBox, addTitleSlide, asColor, clearAllSlideComments, clearShapeEffects, clearShapeFill, clearShapeStroke, clearSlideBackground, clearSlideComments, clearSlideTransition, clearTableCellFill, cm, compactPackage, copyShape, copySlideBackground, createPresentation, emu, findShapeById, findSlideLayout, findSlideLayoutByPartName, findSlidePlaceholder, findSlidesByLayoutPartName, getCollapsedOutlineSlides, getCommentAuthor, getCommentParent, getCommentStatus, getCommentText, getCustomShows, getDrawingGuides, getDrawingGuidesVisible, getEffectiveColorMap, getGridSpacing, getGroupChildren, getGroupTransform, getHandoutMasterPlaceholders, getHandoutSlidesPerPage, getMaxShapeId, getNotesMasterPlaceholders, getNotesPageSize, getParagraphBulletStyle, getParagraphElementLanguages, getParagraphEndFormat, getParagraphLevel, getParagraphPropertiesEffective, getPresentationFonts, getPresentationTheme, getShape3D, getShapeBodyPrEffective, getShapeBounds, getShapeBoundsResolved, getShapeChartSpec, getShapeClickAction, getShapeCustomGeometry, getShapeDescription, getShapeEffects, getShapeFill, getShapeFillColorResolved, getShapeFillEffective, getShapeFillOpacity, getShapeFlip, getShapeGradientFill, getShapeGradientFillEffective, getShapeHyperlink, getShapeHyperlinkTooltip, getShapeId, getShapeImageArtisticEffect, getShapeImageBiLevelThreshold, getShapeImageBrightness, getShapeImageBytes, getShapeImageContrast, getShapeImageCrop, getShapeImageDuotone, getShapeImageFillBytes, getShapeImageFillLayout, getShapeImageFormat, getShapeImageIntrinsicSize, getShapeImageOpacity, getShapeKind, getShapeMedia, getShapeMediaPlayback, getShapeName, getShapeParagraphCount, getShapeParagraphElements, getShapePatternFill, getShapePictureStyle, getShapePlaceholderType, getShapePreset, getShapeRotation, getShapeRunClickAction, getShapeRunFormatEffective, getShapeRunHyperlinkTooltip, getShapeSlide, getShapeStroke, getShapeStrokeArrow, getShapeStrokeCap, getShapeStrokeColorResolved, getShapeStrokeCompound, getShapeStrokeDash, getShapeStrokeEffective, getShapeStrokeGradient, getShapeStrokeJoin, getShapeStrokeOpacity, getShapeStrokeSketch, getShapeStrokeWidth, getShapeText, getShapeText3D, getShapeTextAnchor, getShapeTextBodyRotationDeg, getShapeTextDirection, getShapeTextFlat, getShapeTextLanguage, getShapeXmlString, getSlideAnimations, getSlideBackground, getSlideBackgroundGradientFill, getSlideBackgroundImageFillLayout, getSlideBackgroundImageOpacity, getSlideBackgroundPatternFill, getSlideCharts, getSlideComments, getSlideIndex, getSlideLayout, getSlideLayoutBackground, getSlideLayoutBackgroundGradientFill, getSlideLayoutBackgroundPatternFill, getSlideLayoutName, getSlideLayoutPartName, getSlideLayoutPlaceholders, getSlideLayoutType, getSlideLayouts, getSlideMasterBackground, getSlideMasterBackgroundGradientFill, getSlideMasterBackgroundPatternFill, getSlideMasterBackgroundStyles, getSlideMasterLayouts, getSlideMasterPartName, getSlideMasterPartNames, getSlideMasterPlaceholders, getSlideMasterUsageCounts, getSlideNotes, getSlideNotesLineBreaks, getSlideNotesParagraphEndFormat, getSlideNotesTextFormats, getSlidePartName, getSlideSections, getSlideShapes, getSlideShowProperties, getSlideSize, getSlideTitle, getSlideTransition, getSlideTransitionSound, getSlides, getSnapToGrid, getTableCell, getTableCellAlignment, getTableCellAnchor, getTableCellAppearanceEffective, getTableCellFill, getTableCellMargins, getTableCellParagraphs, getTableCellPosition, getTableCellRunFormatEffective, getTableCellSpan, getTableCellText, getTableCellTextDirection, getTableCells, getTableColumnWidths, getTableRowHeights, getTableSize, getTableStyleFlags, getTableStyleId, groupShapes, hasShapeText, importSlide, inches, insertTableColumn, insertTableRow, isChartSpec, isShapeAspectRatioLocked, isShapeHidden, isShapeImageGrayscale, isShapeLocked, isShapePlaceholder, isShapeTextBox, isSlideBackgroundGraphicsHidden, isSlideHidden, isSlideLayoutBackgroundGraphicsHidden, isSlideMasterPreserved, isTableShape, loadPresentation, mergeTableCells, moveSlide, moveSlideAnimation, pt, removeShape, removeSlide, removeSlideAnimation, removeSlideComment, removeTableColumn, removeTableRow, renameShape, replaceTextInPresentation, replaceTextInSlide, resetShapeImageColorEffects, resetShapeVideoFormatting, resolveDrawingColor, resolveSlideNotesTextColor, savePresentation, setChartSpec, setCommentStatus, setCommentText, setCustomShows, setDrawingGuides, setGridSpacing, setParagraphAlignment, setParagraphBullet, setParagraphIndent, setParagraphLevel, setParagraphLineSpacing, setParagraphSpacing, setParagraphTabs, setParagraphTypography, setPresentationFonts, setPresentationTheme, setShape3D, setShapeAlignment, setShapeAnimation, setShapeAspectRatioLocked, setShapeBounds, setShapeClickAction, setShapeCustomGeometry, setShapeFill, setShapeFlip, setShapeGlow, setShapeGradientFill, setShapeHidden, setShapeHyperlink, setShapeImage, setShapeImageBrightness, setShapeImageCompressionState, setShapeImageContrast, setShapeImageCrop, setShapeImageFill, setShapeImageFillLayout, setShapeImageOpacity, setShapeImageRecolor, setShapeInnerShadow, setShapeLocked, setShapeMediaPlayback, setShapeNoFill, setShapeNoStroke, setShapeParagraphs, setShapePatternFill, setShapePictureStyle, setShapePreset, setShapeReflection, setShapeRotation, setShapeShadow, setShapeSlideBackgroundFill, setShapeSoftEdge, setShapeStroke, setShapeStrokeArrow, setShapeStrokeCap, setShapeStrokeCompound, setShapeStrokeDash, setShapeStrokeJoin, setShapeStrokeSketch, setShapeStyle, setShapeText, setShapeText3D, setShapeTextAnchor, setShapeTextAutoFit, setShapeTextColumns, setShapeTextDirection, setShapeTextField, setShapeTextFlat, setShapeTextFormat, setShapeTextLanguage, setShapeTextMargins, setShapeTextWrap, setShapeZIndex, setSlideBackground, setSlideBackgroundGradientFill, setSlideBackgroundGraphicsHidden, setSlideBackgroundImage, setSlideBackgroundImageFillLayout, setSlideBackgroundImageOpacity, setSlideBackgroundPatternFill, setSlideHidden, setSlideLayout, setSlideMasterBackgroundStyle, setSlideMasterPlaceholderIncluded, setSlideNotes, setSlideNotesFormat, setSlideOutlineCollapsed, setSlideSections, setSlideShowProperties, setSlideSize, setSlideTransition, setSlideTransitionSound, setSnapToGrid, setTableCellAlignment, setTableCellAnchor, setTableCellBorders, setTableCellClickAction, setTableCellFill, setTableCellMargins, setTableCellText, setTableCellTextDirection, setTableCellTextFormat, setTableColumnWidth, setTableRowHeight, setTableStyleFlags, setTableStyleId, splitTableCell, toWritableTextFormat, transformSlideNotesCase, updateSlideAnimation } from "@office-kit/pptx";
|
|
6
6
|
import { ARIAL, MONO, SANS, SERIF, TIMES, decimalSeparatorOf, paragraphNumberLabels, renderSlideLayoutToSvg, renderSlideToSvg, renderTextEffectsSvg, resolveTextBodyRect, shapeAutoFitScale, shapeTextAnchorOffset, shapeTextRect, textColumnsStyle, textUnderlineStyle, verticalTextStyle } from "@office-kit/pptx-preview";
|
|
@@ -9993,6 +9993,39 @@ const NATIVE_MENUBAR = {
|
|
|
9993
9993
|
}
|
|
9994
9994
|
]
|
|
9995
9995
|
};
|
|
9996
|
+
//#endregion
|
|
9997
|
+
//#region src/core/menubar-visible.ts
|
|
9998
|
+
/**
|
|
9999
|
+
* The menus without the items `hide` names. A submenu left with no items goes
|
|
10000
|
+
* too, as does a menu, and separators never lead, trail or double up.
|
|
10001
|
+
*/
|
|
10002
|
+
function pruneMenus(menus, hide) {
|
|
10003
|
+
return menus.filter((menu) => !hide(menu.id)).map((menu) => ({
|
|
10004
|
+
...menu,
|
|
10005
|
+
items: pruneEntries(menu.items, hide)
|
|
10006
|
+
})).filter((menu) => menu.items.length > 0);
|
|
10007
|
+
}
|
|
10008
|
+
function pruneEntries(entries, hide) {
|
|
10009
|
+
const out = [];
|
|
10010
|
+
for (const entry of entries) {
|
|
10011
|
+
if (entry === "-") {
|
|
10012
|
+
if (out.length > 0 && out.at(-1) !== "-") out.push(entry);
|
|
10013
|
+
continue;
|
|
10014
|
+
}
|
|
10015
|
+
if (hide(entry.id)) continue;
|
|
10016
|
+
if (!entry.children?.length) {
|
|
10017
|
+
out.push(entry);
|
|
10018
|
+
continue;
|
|
10019
|
+
}
|
|
10020
|
+
const children = pruneEntries(entry.children, hide);
|
|
10021
|
+
if (children.length > 0) out.push({
|
|
10022
|
+
...entry,
|
|
10023
|
+
children
|
|
10024
|
+
});
|
|
10025
|
+
}
|
|
10026
|
+
if (out.at(-1) === "-") out.pop();
|
|
10027
|
+
return out;
|
|
10028
|
+
}
|
|
9996
10029
|
const DEFAULT_TITLE_PT = 44;
|
|
9997
10030
|
const DEFAULT_SUBTITLE_PT = 32;
|
|
9998
10031
|
const DEFAULT_FOOTER_PT = 12;
|
|
@@ -12049,39 +12082,14 @@ const ja = {
|
|
|
12049
12082
|
"Search (⌘?)": "検索 (⌘?)",
|
|
12050
12083
|
"Can't Undo": "元に戻せません",
|
|
12051
12084
|
"Can't Repeat": "繰り返しできません",
|
|
12052
|
-
"The editor has no template gallery.": "このエディタにはテンプレート ギャラリーがありません。",
|
|
12053
|
-
"The browser keeps no list of recent files.": "ブラウザーは最近使ったファイルの一覧を保持しません。",
|
|
12054
|
-
"Close the browser tab to close the presentation.": "プレゼンテーションを閉じるには、ブラウザーのタブを閉じてください。",
|
|
12055
|
-
"The editor cannot save templates.": "このエディタではテンプレートを保存できません。",
|
|
12056
|
-
"Export to other formats is not available in this editor.": "このエディタでは他の形式へのエクスポートを利用できません。",
|
|
12057
|
-
"The editor cannot mark a file read-only.": "このエディタではファイルを読み取り専用に設定できません。",
|
|
12058
|
-
"Restricting permissions needs a rights management service.": "アクセスの制限には権利管理サービスが必要です。",
|
|
12059
|
-
"Password protection is not available in this editor.": "このエディタではパスワード保護を利用できません。",
|
|
12060
|
-
"Printing is not available in this editor.": "このエディタでは印刷を利用できません。",
|
|
12061
12085
|
"Paste and Match Formatting pastes into text being edited.": "[ペーストしてスタイルを合わせる] は編集中の文字列にペーストします。",
|
|
12062
|
-
"Press Delete to remove the selection.": "選択したものを削除するには Delete キーを押してください。",
|
|
12063
12086
|
"The current slide is not in a section.": "現在のスライドはセクションに含まれていません。",
|
|
12064
|
-
"Rename sections from Home ▸ Section.": "セクション名は [ホーム] ▸ [セクション] から変更してください。",
|
|
12065
|
-
"Use Next match and Previous match in the Find dialog.": "検索ダイアログの [次の一致] と [前の一致] を使ってください。",
|
|
12066
|
-
"The editor has no Replace Fonts dialog yet.": "このエディタにはまだ [フォントの置換] ダイアログがありません。",
|
|
12067
|
-
"The editor has no message bar.": "このエディタにはメッセージ バーがありません。",
|
|
12068
12087
|
"The browser does not allow full screen here.": "ここではブラウザーが全画面表示を許可していません。",
|
|
12069
12088
|
"Place the cursor in text to insert a symbol.": "記号を挿入するには、文字列内にカーソルを置いてください。",
|
|
12070
|
-
"Use Animations ▸ Animation Painter.": "[アニメーション] ▸ [アニメーションのコピー/貼り付け] を使ってください。",
|
|
12071
|
-
"Choose theme colors from Design ▸ Variants.": "テーマの配色は [デザイン] ▸ [バリエーション] から選んでください。",
|
|
12072
|
-
"Choose the proofing language from Review ▸ Language.": "校正言語は [校閲] ▸ [言語] から選んでください。",
|
|
12073
|
-
"AutoCorrect is not available in this editor.": "このエディタではオートコレクトを利用できません。",
|
|
12074
12089
|
"The presentation has no custom shows.": "このプレゼンテーションには目的別スライド ショーがありません。",
|
|
12075
|
-
"The editor keeps no application data to clear.": "このエディタには消去するアプリケーション データがありません。",
|
|
12076
|
-
"The editor updates with its npm package.": "このエディタは npm パッケージと一緒に更新されます。",
|
|
12077
|
-
"Needs a presentation saved to cloud storage.": "クラウド ストレージに保存されたプレゼンテーションが必要です。",
|
|
12078
|
-
"The browser manages its own windows.": "ウインドウはブラウザーが管理します。",
|
|
12079
12090
|
"The slide show runs in the preview page around the editor.": "スライド ショーはエディタを囲むプレビュー ページで実行されます。",
|
|
12080
12091
|
"Press ⌘V to paste into the outline.": "アウトラインにペーストするには ⌘V を押してください。",
|
|
12081
12092
|
"Edit the text on the slide to use this.": "これを使うには、スライド上の文字列を編集してください。",
|
|
12082
|
-
"Importing slides from another file is not available in this editor.": "このエディタでは他のファイルからスライドを取り込めません。",
|
|
12083
|
-
"Action buttons are not in the editor’s shape gallery yet.": "動作設定ボタンはまだエディタの図形ギャラリーにありません。",
|
|
12084
|
-
"macOS provides this to native apps, not to web pages.": "これは macOS がネイティブ アプリに提供する機能で、Web ページでは使えません。",
|
|
12085
12093
|
"Notes {n} of {count}": "ノート {n} / {count}",
|
|
12086
12094
|
"Currently in Slide Master View.": "現在のモード: スライド マスター表示",
|
|
12087
12095
|
"Currently in Handout Master View.": "現在のモード: 配布資料マスター表示",
|
|
@@ -12337,34 +12345,11 @@ function rotateSelection(editor, action) {
|
|
|
12337
12345
|
//#endregion
|
|
12338
12346
|
//#region src/ui/menubar-commands.ts
|
|
12339
12347
|
const FEEDBACK = "help/feedback";
|
|
12340
|
-
function withoutFeedback(menus) {
|
|
12341
|
-
return menus.map((menu) => {
|
|
12342
|
-
const at = menu.items.findIndex((item) => item !== "-" && item.id === FEEDBACK);
|
|
12343
|
-
if (at < 0) return menu;
|
|
12344
|
-
return {
|
|
12345
|
-
...menu,
|
|
12346
|
-
items: menu.items.filter((_, index) => index !== at && index !== at - 1)
|
|
12347
|
-
};
|
|
12348
|
-
});
|
|
12349
|
-
}
|
|
12350
|
-
const MENUS_WITHOUT_FEEDBACK = {
|
|
12351
|
-
en: withoutFeedback(NATIVE_MENUBAR.en),
|
|
12352
|
-
ja: withoutFeedback(NATIVE_MENUBAR.ja)
|
|
12353
|
-
};
|
|
12354
|
-
function nativeMenus(editor) {
|
|
12355
|
-
return (editor.feedbackUrl === void 0 ? MENUS_WITHOUT_FEEDBACK : NATIVE_MENUBAR)[getLocale()];
|
|
12356
|
-
}
|
|
12357
12348
|
const unavailable = (reason) => ({
|
|
12358
12349
|
disabled: true,
|
|
12359
12350
|
reason
|
|
12360
12351
|
});
|
|
12361
|
-
const NO_CLOUD = "Needs a presentation saved to cloud storage.";
|
|
12362
|
-
const WINDOWS = "The browser manages its own windows.";
|
|
12363
|
-
const SUBTITLES = "Live subtitles need an online service.";
|
|
12364
12352
|
const SLIDE_SHOW_HOST = "The slide show runs in the preview page around the editor.";
|
|
12365
|
-
const ONLINE = "Online pictures need an online image service.";
|
|
12366
|
-
const MEDIA_LIBRARY = "The Photos and Music libraries are not available in the browser.";
|
|
12367
|
-
const OS_TEXT_SERVICE = "macOS provides this to native apps, not to web pages.";
|
|
12368
12353
|
const OUTLINE_PASTE = "Press ⌘V to paste into the outline.";
|
|
12369
12354
|
const SLIDE_TEXT = "Edit the text on the slide to use this.";
|
|
12370
12355
|
const SHAPES$1 = {
|
|
@@ -12420,19 +12405,95 @@ const PARAGRAPH_ALIGN = {
|
|
|
12420
12405
|
"format/alignment/justify": "justify",
|
|
12421
12406
|
"format/alignment/distributed": "distribute"
|
|
12422
12407
|
};
|
|
12423
|
-
const
|
|
12424
|
-
|
|
12425
|
-
|
|
12426
|
-
|
|
12427
|
-
|
|
12428
|
-
|
|
12429
|
-
|
|
12430
|
-
|
|
12431
|
-
|
|
12432
|
-
|
|
12433
|
-
|
|
12434
|
-
|
|
12408
|
+
const HIDDEN = new Set([
|
|
12409
|
+
"file/new-from-template",
|
|
12410
|
+
"file/close",
|
|
12411
|
+
"file/save-as-template",
|
|
12412
|
+
"file/export",
|
|
12413
|
+
"file/move",
|
|
12414
|
+
"file/rename",
|
|
12415
|
+
"file/browse-version-history",
|
|
12416
|
+
"file/always-open-read-only",
|
|
12417
|
+
"file/restrict-permissions",
|
|
12418
|
+
"file/passwords",
|
|
12419
|
+
"file/print",
|
|
12420
|
+
"edit/paste-special",
|
|
12421
|
+
"edit/clear",
|
|
12422
|
+
"edit/rename-section",
|
|
12423
|
+
"edit/find/find-next",
|
|
12424
|
+
"edit/find/find-previous",
|
|
12425
|
+
"edit/find/replace-fonts",
|
|
12426
|
+
"edit/start-dictation",
|
|
12427
|
+
"edit/emoji-and-symbols",
|
|
12428
|
+
"view/message-bar",
|
|
12429
|
+
"view/markup",
|
|
12430
|
+
"view/advanced-markup",
|
|
12431
|
+
"insert/picture/photo-browser",
|
|
12432
|
+
"insert/picture/stock-images",
|
|
12433
|
+
"insert/picture/online-pictures",
|
|
12434
|
+
"insert/picture/brand-images",
|
|
12435
|
+
"insert/audio/audio-browser",
|
|
12436
|
+
"insert/audio/record-audio",
|
|
12437
|
+
"insert/video/movie-browser",
|
|
12438
|
+
"insert/video/stock-videos",
|
|
12439
|
+
"insert/video/online-movie",
|
|
12440
|
+
"insert/cameo",
|
|
12441
|
+
"insert/equation",
|
|
12442
|
+
"insert/icons",
|
|
12443
|
+
"insert/object",
|
|
12444
|
+
"format/bullets-and-numbering",
|
|
12445
|
+
"format/animation-painter",
|
|
12446
|
+
"format/replace-fonts",
|
|
12447
|
+
"format/theme-colors",
|
|
12448
|
+
"arrange/reorder-objects",
|
|
12449
|
+
"tools/spelling",
|
|
12450
|
+
"tools/thesaurus",
|
|
12451
|
+
"tools/translate",
|
|
12452
|
+
"tools/set-proofing-language",
|
|
12453
|
+
"tools/autocorrect-options",
|
|
12454
|
+
"tools/add-ins",
|
|
12455
|
+
"slide-show/rehearse-with-coach",
|
|
12456
|
+
"slide-show/always-use-subtitles",
|
|
12457
|
+
"help/clear-application-data",
|
|
12458
|
+
"help/check-for-updates"
|
|
12459
|
+
]);
|
|
12460
|
+
const HIDDEN_GROUPS = [
|
|
12461
|
+
"file/open-recent",
|
|
12462
|
+
"file/share",
|
|
12463
|
+
"edit/autofill",
|
|
12464
|
+
"insert/slides-from",
|
|
12465
|
+
"insert/smartart",
|
|
12466
|
+
"insert/3d-models",
|
|
12467
|
+
"insert/zoom",
|
|
12468
|
+
"insert/action-buttons",
|
|
12469
|
+
"tools/macro",
|
|
12470
|
+
"slide-show/subtitle-settings",
|
|
12471
|
+
"window"
|
|
12435
12472
|
];
|
|
12473
|
+
function isHidden(id) {
|
|
12474
|
+
if (HIDDEN.has(id)) return true;
|
|
12475
|
+
if (id.startsWith("insert/chart/")) return !(id in CHARTS);
|
|
12476
|
+
return HIDDEN_GROUPS.some((group) => id === group || id.startsWith(`${group}/`));
|
|
12477
|
+
}
|
|
12478
|
+
const MENUS = {
|
|
12479
|
+
en: pruneMenus(NATIVE_MENUBAR.en, isHidden),
|
|
12480
|
+
ja: pruneMenus(NATIVE_MENUBAR.ja, isHidden)
|
|
12481
|
+
};
|
|
12482
|
+
const MENUS_WITHOUT_FEEDBACK = {
|
|
12483
|
+
en: pruneMenus(MENUS.en, (id) => id === FEEDBACK),
|
|
12484
|
+
ja: pruneMenus(MENUS.ja, (id) => id === FEEDBACK)
|
|
12485
|
+
};
|
|
12486
|
+
/** The menus the menu bar shows. */
|
|
12487
|
+
function visibleMenus(editor) {
|
|
12488
|
+
return (editor.feedbackUrl === void 0 ? MENUS_WITHOUT_FEEDBACK : MENUS)[getLocale()];
|
|
12489
|
+
}
|
|
12490
|
+
/**
|
|
12491
|
+
* Every menu item, for keyboard shortcuts: a hidden item's shortcut still
|
|
12492
|
+
* resolves, so the browser does not act on it (⌘P would print the page).
|
|
12493
|
+
*/
|
|
12494
|
+
function nativeMenus() {
|
|
12495
|
+
return NATIVE_MENUBAR[getLocale()];
|
|
12496
|
+
}
|
|
12436
12497
|
/** The command behind a menu-bar item in the editor's current state. */
|
|
12437
12498
|
function menuCommand(editor, host, id) {
|
|
12438
12499
|
const doc = editor.doc;
|
|
@@ -12447,6 +12508,7 @@ function menuCommand(editor, host, id) {
|
|
|
12447
12508
|
run: () => editor.runOrPrompt(command, args)
|
|
12448
12509
|
});
|
|
12449
12510
|
const present = (action) => editor.canPresent ? { run: () => editor.present(action) } : unavailable(SLIDE_SHOW_HOST);
|
|
12511
|
+
if (isHidden(id)) return { disabled: true };
|
|
12450
12512
|
if (id in VIEWS) {
|
|
12451
12513
|
const mode = VIEWS[id];
|
|
12452
12514
|
return {
|
|
@@ -12505,25 +12567,11 @@ function menuCommand(editor, host, id) {
|
|
|
12505
12567
|
const canCopy = !!text || doc.selection.kind === "slide" || selectedShapeIds(doc.selection).length > 0;
|
|
12506
12568
|
switch (id) {
|
|
12507
12569
|
case "file/new-presentation": return { run: host.newPresentation };
|
|
12508
|
-
case "file/new-from-template": return unavailable("The editor has no template gallery.");
|
|
12509
12570
|
case "file/open": return { run: host.open };
|
|
12510
|
-
case "file/open-recent": return {};
|
|
12511
|
-
case "file/open-recent/more": return unavailable("The browser keeps no list of recent files.");
|
|
12512
|
-
case "file/close": return unavailable("Close the browser tab to close the presentation.");
|
|
12513
12571
|
case "file/save": return { run: host.save };
|
|
12514
12572
|
case "file/save-as": return { run: host.download };
|
|
12515
|
-
case "file/save-as-template": return unavailable("The editor cannot save templates.");
|
|
12516
|
-
case "file/export": return unavailable("Export to other formats is not available in this editor.");
|
|
12517
|
-
case "file/move":
|
|
12518
|
-
case "file/rename":
|
|
12519
|
-
case "file/browse-version-history":
|
|
12520
|
-
case "file/share": return id === "file/share" ? {} : unavailable(NO_CLOUD);
|
|
12521
|
-
case "file/always-open-read-only": return unavailable("The editor cannot mark a file read-only.");
|
|
12522
|
-
case "file/restrict-permissions": return unavailable("Restricting permissions needs a rights management service.");
|
|
12523
|
-
case "file/passwords": return unavailable("Password protection is not available in this editor.");
|
|
12524
12573
|
case "file/compress-pictures": return { run: () => editor.activeDialog = "compressPictures" };
|
|
12525
12574
|
case "file/page-setup": return run("setSlideSize");
|
|
12526
|
-
case "file/print": return unavailable("Printing is not available in this editor.");
|
|
12527
12575
|
case "file/properties": return run("setCoreProperties");
|
|
12528
12576
|
case "edit/undo": return {
|
|
12529
12577
|
disabled: !doc.canUndo,
|
|
@@ -12553,11 +12601,9 @@ function menuCommand(editor, host, id) {
|
|
|
12553
12601
|
case "edit/paste":
|
|
12554
12602
|
if (!text) return { run: () => void editor.paste() };
|
|
12555
12603
|
return text.clipboard ? { run: () => text.clipboard("paste") } : unavailable(OUTLINE_PASTE);
|
|
12556
|
-
case "edit/paste-special": return unavailable("Paste Special needs the system clipboard formats, which the browser does not expose.");
|
|
12557
12604
|
case "edit/paste-and-match-formatting":
|
|
12558
12605
|
if (!text) return unavailable("Paste and Match Formatting pastes into text being edited.");
|
|
12559
12606
|
return text.pastePlain ? { run: text.pastePlain } : unavailable(OUTLINE_PASTE);
|
|
12560
|
-
case "edit/clear": return unavailable("Press Delete to remove the selection.");
|
|
12561
12607
|
case "edit/select-all": return {
|
|
12562
12608
|
disabled: !slide,
|
|
12563
12609
|
run: () => text ? document.execCommand("selectAll") : editor.selectAll()
|
|
@@ -12571,22 +12617,15 @@ function menuCommand(editor, host, id) {
|
|
|
12571
12617
|
run: () => editor.invoke("removeSlide")
|
|
12572
12618
|
};
|
|
12573
12619
|
case "edit/remove-section": return section ? { run: () => doc.transact(t("Remove Section"), () => removeSection(doc.pres, section.start)) } : unavailable("The current slide is not in a section.");
|
|
12574
|
-
case "edit/rename-section": return unavailable(section ? "Rename sections from Home ▸ Section." : "The current slide is not in a section.");
|
|
12575
12620
|
case "edit/find": return {};
|
|
12576
12621
|
case "edit/find/find":
|
|
12577
12622
|
case "edit/find/advanced-find":
|
|
12578
12623
|
case "edit/find/replace": return { run: () => editor.runOrPrompt("replaceTextInPresentation") };
|
|
12579
|
-
case "edit/find/find-next":
|
|
12580
|
-
case "edit/find/find-previous": return unavailable("Use Next match and Previous match in the Find dialog.");
|
|
12581
|
-
case "edit/find/replace-fonts": return unavailable("The editor has no Replace Fonts dialog yet.");
|
|
12582
12624
|
case "edit/select-data": return run("setChartSpec");
|
|
12583
12625
|
case "edit/toggle-drawing": return {
|
|
12584
12626
|
disabled: !slide,
|
|
12585
12627
|
run: () => editor.ink.toggle("pen")
|
|
12586
12628
|
};
|
|
12587
|
-
case "edit/autofill": return {};
|
|
12588
|
-
case "edit/start-dictation":
|
|
12589
|
-
case "edit/emoji-and-symbols": return unavailable(OS_TEXT_SERVICE);
|
|
12590
12629
|
case "view/reading-view": return { run: () => editor.openReadingView() };
|
|
12591
12630
|
case "view/presenter-view": return present("presenter");
|
|
12592
12631
|
case "view/slide-show": return present("start");
|
|
@@ -12599,14 +12638,11 @@ function menuCommand(editor, host, id) {
|
|
|
12599
12638
|
checked: editor.ribbonVisible,
|
|
12600
12639
|
run: () => editor.ribbonVisible = !editor.ribbonVisible
|
|
12601
12640
|
};
|
|
12602
|
-
case "view/message-bar": return unavailable("The editor has no message bar.");
|
|
12603
12641
|
case "view/header-and-footer":
|
|
12604
12642
|
case "insert/header-and-footer": return {
|
|
12605
12643
|
disabled: !slide,
|
|
12606
12644
|
run: () => editor.activeDialog = "headerFooter"
|
|
12607
12645
|
};
|
|
12608
|
-
case "view/markup":
|
|
12609
|
-
case "view/advanced-markup": return unavailable("Co-authoring is not available here.");
|
|
12610
12646
|
case "view/ruler": return {
|
|
12611
12647
|
disabled: sorter,
|
|
12612
12648
|
checked: editor.view.ruler,
|
|
@@ -12675,23 +12711,11 @@ function menuCommand(editor, host, id) {
|
|
|
12675
12711
|
case "insert/slide-number": return run("setShapeTextField", { type: "slidenum" });
|
|
12676
12712
|
case "insert/table": return run("addSlideTable");
|
|
12677
12713
|
case "insert/chart":
|
|
12678
|
-
case "insert/smartart":
|
|
12679
12714
|
case "insert/picture":
|
|
12680
12715
|
case "insert/audio":
|
|
12681
12716
|
case "insert/video":
|
|
12682
|
-
case "insert/shape":
|
|
12683
|
-
case "insert/3d-models":
|
|
12684
|
-
case "insert/zoom":
|
|
12685
|
-
case "insert/action-buttons":
|
|
12686
|
-
case "insert/slides-from": return {};
|
|
12717
|
+
case "insert/shape": return {};
|
|
12687
12718
|
case "insert/picture/picture-from-file": return run("addSlideImage");
|
|
12688
|
-
case "insert/picture/photo-browser":
|
|
12689
|
-
case "insert/audio/audio-browser":
|
|
12690
|
-
case "insert/video/movie-browser": return unavailable(MEDIA_LIBRARY);
|
|
12691
|
-
case "insert/picture/stock-images":
|
|
12692
|
-
case "insert/picture/online-pictures":
|
|
12693
|
-
case "insert/picture/brand-images":
|
|
12694
|
-
case "insert/video/stock-videos": return unavailable(ONLINE);
|
|
12695
12719
|
case "insert/audio/audio-from-file": return {
|
|
12696
12720
|
disabled: !slide,
|
|
12697
12721
|
run: () => void insertMedia(editor, "audio", t("Audio"))
|
|
@@ -12700,17 +12724,11 @@ function menuCommand(editor, host, id) {
|
|
|
12700
12724
|
disabled: !slide,
|
|
12701
12725
|
run: () => void insertMedia(editor, "video", t("Video"))
|
|
12702
12726
|
};
|
|
12703
|
-
case "insert/audio/record-audio":
|
|
12704
|
-
case "insert/cameo": return unavailable("Recording is not available in the browser.");
|
|
12705
|
-
case "insert/video/online-movie": return unavailable("Online videos are not supported by the library yet.");
|
|
12706
|
-
case "insert/equation": return unavailable("Equations are not supported by the library yet.");
|
|
12707
12727
|
case "insert/symbol": return text?.insertText ? { run: () => {
|
|
12708
12728
|
const anchor = host.anchor();
|
|
12709
12729
|
if (anchor) editor.openSymbolPicker(anchor);
|
|
12710
12730
|
} } : unavailable("Place the cursor in text to insert a symbol.");
|
|
12711
|
-
case "insert/icons": return unavailable("The icon library is not available here.");
|
|
12712
12731
|
case "insert/action-settings": return run("setShapeClickAction");
|
|
12713
|
-
case "insert/object": return unavailable("Embedded OLE objects are not supported by the library yet.");
|
|
12714
12732
|
case "insert/hyperlink":
|
|
12715
12733
|
if (text) {
|
|
12716
12734
|
if (!text.hyperlink) return unavailable(SLIDE_TEXT);
|
|
@@ -12725,7 +12743,6 @@ function menuCommand(editor, host, id) {
|
|
|
12725
12743
|
disabled: !paragraphs,
|
|
12726
12744
|
run: () => editor.openParagraphDialog(text?.element?.())
|
|
12727
12745
|
};
|
|
12728
|
-
case "format/bullets-and-numbering": return unavailable("The editor has no Bullets and Numbering dialog yet.");
|
|
12729
12746
|
case "format/columns": return {
|
|
12730
12747
|
disabled: !textShapes || locked,
|
|
12731
12748
|
run: host.columns
|
|
@@ -12747,9 +12764,6 @@ function menuCommand(editor, host, id) {
|
|
|
12747
12764
|
disabled: true,
|
|
12748
12765
|
label: APPLY_TO_DEFAULTS[getLocale()]
|
|
12749
12766
|
};
|
|
12750
|
-
case "format/animation-painter": return unavailable("Use Animations ▸ Animation Painter.");
|
|
12751
|
-
case "format/replace-fonts": return unavailable("The editor has no Replace Fonts dialog yet.");
|
|
12752
|
-
case "format/theme-colors": return unavailable("Choose theme colors from Design ▸ Variants.");
|
|
12753
12767
|
case "format/slide-background": return {
|
|
12754
12768
|
disabled: !slide,
|
|
12755
12769
|
run: () => editor.showBackgroundFormat()
|
|
@@ -12759,7 +12773,6 @@ function menuCommand(editor, host, id) {
|
|
|
12759
12773
|
disabled: !objectSelected,
|
|
12760
12774
|
run: () => editor.showShapeFormat()
|
|
12761
12775
|
};
|
|
12762
|
-
case "arrange/reorder-objects": return unavailable("The layered stacking view is not available in this editor.");
|
|
12763
12776
|
case "arrange/reorder-overlapping-objects": return {
|
|
12764
12777
|
disabled: editor.reorderMembers().length < 2,
|
|
12765
12778
|
run: () => editor.activeDialog = "reorderObjects"
|
|
@@ -12795,19 +12808,11 @@ function menuCommand(editor, host, id) {
|
|
|
12795
12808
|
editor.setViewMode("normal");
|
|
12796
12809
|
editor.selectionPaneVisible = !editor.selectionPaneVisible;
|
|
12797
12810
|
} };
|
|
12798
|
-
case "tools/spelling": return unavailable("Spelling is checked by the browser as you type.");
|
|
12799
|
-
case "tools/thesaurus": return unavailable("The thesaurus needs an online reference service.");
|
|
12800
|
-
case "tools/translate": return unavailable("Translation needs an online translation service.");
|
|
12801
|
-
case "tools/set-proofing-language": return unavailable("Choose the proofing language from Review ▸ Language.");
|
|
12802
|
-
case "tools/autocorrect-options": return unavailable("AutoCorrect is not available in this editor.");
|
|
12803
12811
|
case "tools/check-accessibility": return { run: () => editor.accessibilityOpen = true };
|
|
12804
|
-
case "tools/macro": return {};
|
|
12805
|
-
case "tools/add-ins": return unavailable("Add-ins are not available in this editor.");
|
|
12806
12812
|
case "slide-show/play-from-start": return present("start");
|
|
12807
12813
|
case "slide-show/play-from-current-slide": return present("current");
|
|
12808
12814
|
case "slide-show/custom-slide-show": return doc.customShows.length ? {} : unavailable("The presentation has no custom shows.");
|
|
12809
12815
|
case "slide-show/custom-slide-show/custom-shows": return { run: () => editor.openCustomShows() };
|
|
12810
|
-
case "slide-show/rehearse-with-coach": return unavailable("Rehearse with Coach needs an online service.");
|
|
12811
12816
|
case "slide-show/presenter-view": return present("presenter");
|
|
12812
12817
|
case "slide-show/rehearse-timings": return present("rehearse");
|
|
12813
12818
|
case "slide-show/record-slide-show": return present("start");
|
|
@@ -12819,25 +12824,12 @@ function menuCommand(editor, host, id) {
|
|
|
12819
12824
|
})
|
|
12820
12825
|
};
|
|
12821
12826
|
case "slide-show/set-up-show": return { run: () => editor.activeDialog = "showProperties" };
|
|
12822
|
-
case "slide-show/always-use-subtitles": return unavailable(SUBTITLES);
|
|
12823
|
-
case "slide-show/subtitle-settings": return {};
|
|
12824
|
-
case "window/move-and-resize": return {};
|
|
12825
|
-
case "window/document": return {
|
|
12826
|
-
checked: true,
|
|
12827
|
-
bullet: true,
|
|
12828
|
-
label: doc.fileName.replace(/\.pptx$/i, ""),
|
|
12829
|
-
run: () => {}
|
|
12830
|
-
};
|
|
12831
12827
|
case "help/editor-help": return { run: () => editor.togglePalette(true) };
|
|
12832
12828
|
case FEEDBACK: {
|
|
12833
12829
|
const url = editor.feedbackUrl;
|
|
12834
12830
|
return url === void 0 ? { disabled: true } : { run: () => void window.open(url, "_blank", "noopener") };
|
|
12835
12831
|
}
|
|
12836
|
-
case "help/clear-application-data": return unavailable("The editor keeps no application data to clear.");
|
|
12837
|
-
case "help/check-for-updates": return unavailable("The editor updates with its npm package.");
|
|
12838
12832
|
}
|
|
12839
|
-
const group = UNAVAILABLE_GROUPS.find(([prefix]) => id.startsWith(prefix));
|
|
12840
|
-
if (group) return unavailable(group[1]);
|
|
12841
12833
|
throw new Error(`Menu item ${id} has no command`);
|
|
12842
12834
|
}
|
|
12843
12835
|
const TEXT_KEYS = new Set([
|
|
@@ -12878,7 +12870,7 @@ const DOCUMENT_SCOPE = [
|
|
|
12878
12870
|
* itself owns.
|
|
12879
12871
|
*/
|
|
12880
12872
|
function menuKeyLeavesText(editor, event) {
|
|
12881
|
-
const item = menuItemForKey(nativeMenus(
|
|
12873
|
+
const item = menuItemForKey(nativeMenus(), event);
|
|
12882
12874
|
if (!item || TEXT_KEYS.has(item.id)) return false;
|
|
12883
12875
|
const chord = parseShortcut(item.shortcut);
|
|
12884
12876
|
return chord !== null && isModifiedChord(chord);
|
|
@@ -12886,7 +12878,7 @@ function menuKeyLeavesText(editor, event) {
|
|
|
12886
12878
|
/** Runs the menu item a key event names. Returns true when the key was taken. */
|
|
12887
12879
|
function runMenuKey(editor, host, event) {
|
|
12888
12880
|
if (event.isComposing || event.defaultPrevented || editor.activeDialog || !editor.ownsEvent(event)) return false;
|
|
12889
|
-
const item = menuItemForKey(nativeMenus(
|
|
12881
|
+
const item = menuItemForKey(nativeMenus(), event);
|
|
12890
12882
|
if (!item || WINDOW_KEYS.has(item.id)) return false;
|
|
12891
12883
|
const origin = eventTarget(event);
|
|
12892
12884
|
const target = origin instanceof HTMLElement ? origin : null;
|
|
@@ -13490,6 +13482,13 @@ const cornerBounds = (pres) => {
|
|
|
13490
13482
|
};
|
|
13491
13483
|
};
|
|
13492
13484
|
//#endregion
|
|
13485
|
+
//#region src/core/text-elements.ts
|
|
13486
|
+
/**
|
|
13487
|
+
* A paragraph's runs, fields and breaks without its equations. The core
|
|
13488
|
+
* text-range APIs count only these, so editor offsets must skip equations too.
|
|
13489
|
+
*/
|
|
13490
|
+
const textElements = (elements) => elements.filter((e) => e.kind !== "math");
|
|
13491
|
+
//#endregion
|
|
13493
13492
|
//#region src/core/text-format-selection.ts
|
|
13494
13493
|
/** Character formats at a caret or intersecting a selected text range. */
|
|
13495
13494
|
function textFormatsInRange(shape, range, cell, context) {
|
|
@@ -13504,8 +13503,11 @@ function textFormatsInRange(shape, range, cell, context) {
|
|
|
13504
13503
|
}
|
|
13505
13504
|
let offset = 0;
|
|
13506
13505
|
const tableCell = cell ? getTableCells(shape)[cell.row][cell.col] : void 0;
|
|
13507
|
-
const paragraphs = tableCell ? getTableCellParagraphs(tableCell)
|
|
13508
|
-
|
|
13506
|
+
const paragraphs = tableCell ? getTableCellParagraphs(tableCell).map((p) => ({
|
|
13507
|
+
...p,
|
|
13508
|
+
elements: textElements(p.elements)
|
|
13509
|
+
})) : Array.from({ length: getShapeParagraphCount(shape) }, (_, i) => ({
|
|
13510
|
+
elements: textElements(getShapeParagraphElements(shape, i)),
|
|
13509
13511
|
endFormat: getParagraphEndFormat(shape, i)
|
|
13510
13512
|
}));
|
|
13511
13513
|
for (const [paragraphIndex, { elements, endFormat }] of paragraphs.entries()) {
|
|
@@ -22938,7 +22940,7 @@ function validReflection(value) {
|
|
|
22938
22940
|
});
|
|
22939
22941
|
}
|
|
22940
22942
|
function copyTextRange(shape, start, end, cell, resolveRunFormat) {
|
|
22941
|
-
const paragraphs = cell ? getTableCellParagraphs(getTableCells(shape)[cell.row][cell.col]).map((p) => p.elements) : getShapeParagraphElements(shape);
|
|
22943
|
+
const paragraphs = cell ? getTableCellParagraphs(getTableCells(shape)[cell.row][cell.col]).map((p) => textElements(p.elements)) : getShapeParagraphElements(shape).map((p) => textElements(p));
|
|
22942
22944
|
let text = "";
|
|
22943
22945
|
const formats = [];
|
|
22944
22946
|
function append(value, format) {
|
|
@@ -23251,7 +23253,7 @@ function withoutThemeFontTokens(format) {
|
|
|
23251
23253
|
*/
|
|
23252
23254
|
function paragraphBlocks(pres, { shape, cell }) {
|
|
23253
23255
|
const cellData = cell ? getTableCells(shape)[cell.row][cell.col] : void 0;
|
|
23254
|
-
const paragraphs = cellData ? getTableCellParagraphs(cellData).map((paragraph) => paragraph.elements) : getShapeParagraphElements(shape);
|
|
23256
|
+
const paragraphs = cellData ? getTableCellParagraphs(cellData).map((paragraph) => textElements(paragraph.elements)) : getShapeParagraphElements(shape).map((p) => textElements(p));
|
|
23255
23257
|
const blocks = [];
|
|
23256
23258
|
let list = null;
|
|
23257
23259
|
let offset = 0;
|
|
@@ -25327,7 +25329,7 @@ function MenuBar($$anchor, $$props) {
|
|
|
25327
25329
|
set_attribute(button_1, "data-item", get(entry).id);
|
|
25328
25330
|
button_1.disabled = get(action).disabled || !get(action).run;
|
|
25329
25331
|
set_attribute(button_1, "title", $0);
|
|
25330
|
-
set_text(text_1, get(action).checked ?
|
|
25332
|
+
set_text(text_1, get(action).checked ? "✓" : "");
|
|
25331
25333
|
set_text(text_2, get(name));
|
|
25332
25334
|
}, [() => get(action).disabled && get(action).reason ? t(get(action).reason) : void 0]);
|
|
25333
25335
|
delegated("mousedown", button_1, (event) => {
|
|
@@ -25359,7 +25361,7 @@ function MenuBar($$anchor, $$props) {
|
|
|
25359
25361
|
append($$anchor, div);
|
|
25360
25362
|
};
|
|
25361
25363
|
const editor = getEditor();
|
|
25362
|
-
const menus = /* @__PURE__ */ user_derived(() =>
|
|
25364
|
+
const menus = /* @__PURE__ */ user_derived(() => visibleMenus(editor));
|
|
25363
25365
|
let openMenu = /* @__PURE__ */ state(null);
|
|
25364
25366
|
let path = /* @__PURE__ */ state(proxy([]));
|
|
25365
25367
|
let fullScreen = /* @__PURE__ */ state(false);
|
|
@@ -25423,7 +25425,7 @@ function MenuBar($$anchor, $$props) {
|
|
|
25423
25425
|
show(get(menus)[(index + delta + get(menus).length) % get(menus).length].id);
|
|
25424
25426
|
}
|
|
25425
25427
|
function onMenuKeydown(event, depth) {
|
|
25426
|
-
if (menuItemForKey(
|
|
25428
|
+
if (menuItemForKey(nativeMenus(), event)) return;
|
|
25427
25429
|
event.stopPropagation();
|
|
25428
25430
|
const target = event.target;
|
|
25429
25431
|
const items = rows(target.closest(".menu"));
|
|
@@ -35636,7 +35638,7 @@ function ArrangeMenu($$anchor, $$props) {
|
|
|
35636
35638
|
} };
|
|
35637
35639
|
}
|
|
35638
35640
|
function keys(event) {
|
|
35639
|
-
if (!event.isComposing && menuItemForKey(nativeMenus(
|
|
35641
|
+
if (!event.isComposing && menuItemForKey(nativeMenus(), event)) {
|
|
35640
35642
|
close(false);
|
|
35641
35643
|
return;
|
|
35642
35644
|
}
|
|
@@ -38764,7 +38766,7 @@ function stepShapeFontSize(pres, shape, direction, source = shape, range) {
|
|
|
38764
38766
|
let formatIndex = 0;
|
|
38765
38767
|
let changed = false;
|
|
38766
38768
|
for (let paragraphIndex = 0; paragraphIndex < getShapeParagraphCount(shape); paragraphIndex++) {
|
|
38767
|
-
const elements = getShapeParagraphElements(shape, paragraphIndex);
|
|
38769
|
+
const elements = textElements(getShapeParagraphElements(shape, paragraphIndex));
|
|
38768
38770
|
if (!elements.some((element) => (element.kind === "br" ? 1 : element.text.length) > 0)) {
|
|
38769
38771
|
if (!range || (range.start === range.end ? range.start === offset : range.start <= offset && range.end > offset)) {
|
|
38770
38772
|
const endFormat = getParagraphEndFormat(shape, paragraphIndex);
|
|
@@ -38799,7 +38801,7 @@ function stepTableCellFontSize(cell, direction, range) {
|
|
|
38799
38801
|
let offset = 0;
|
|
38800
38802
|
let changed = false;
|
|
38801
38803
|
for (const [paragraphIndex, paragraph] of getTableCellParagraphs(cell).entries()) {
|
|
38802
|
-
const elements = paragraph.elements;
|
|
38804
|
+
const elements = textElements(paragraph.elements);
|
|
38803
38805
|
if (!elements.some((element) => (element.kind === "br" ? 1 : element.text.length) > 0)) {
|
|
38804
38806
|
if (!range || (range.start === range.end ? range.start === offset : range.start <= offset && range.end > offset)) {
|
|
38805
38807
|
const emptyRun = elements.find((element) => element.kind !== "br");
|
|
@@ -48195,7 +48197,7 @@ function deleteOutlineTitleBodyRange(slide, start, end) {
|
|
|
48195
48197
|
} });
|
|
48196
48198
|
const text = getShapeText(title);
|
|
48197
48199
|
let boundary = 0;
|
|
48198
|
-
for (const paragraph of getShapeParagraphElements(title)) {
|
|
48200
|
+
for (const paragraph of getShapeParagraphElements(title).map((p) => textElements(p))) {
|
|
48199
48201
|
boundary += paragraph.reduce((length, element) => length + (element.kind === "br" ? 1 : element.text.length), 0);
|
|
48200
48202
|
if (boundary >= start.offset) break;
|
|
48201
48203
|
boundary += 1;
|
|
@@ -48224,7 +48226,8 @@ function outlineSlots(pres) {
|
|
|
48224
48226
|
}
|
|
48225
48227
|
function paragraphSpans(shape) {
|
|
48226
48228
|
let offset = 0;
|
|
48227
|
-
return getShapeParagraphElements(shape).map((
|
|
48229
|
+
return getShapeParagraphElements(shape).map((all) => {
|
|
48230
|
+
const elements = textElements(all);
|
|
48228
48231
|
const start = offset;
|
|
48229
48232
|
const end = start + elements.reduce((length, element) => length + (element.kind === "br" ? 1 : element.text.length), 0);
|
|
48230
48233
|
offset = end + 1;
|
|
@@ -48456,7 +48459,7 @@ function splitOutlineTitleRange(pres, slide, start, end) {
|
|
|
48456
48459
|
if (from < 0 || to <= from) return null;
|
|
48457
48460
|
const source = findShapeById(slide, end.id);
|
|
48458
48461
|
const text = getShapeText(source);
|
|
48459
|
-
const paragraphs = getShapeParagraphElements(source);
|
|
48462
|
+
const paragraphs = getShapeParagraphElements(source).map((p) => textElements(p));
|
|
48460
48463
|
let boundary = 0;
|
|
48461
48464
|
for (const paragraph of paragraphs) {
|
|
48462
48465
|
boundary += paragraph.reduce((length, element) => length + (element.kind === "br" ? 1 : element.text.length), 0);
|
|
@@ -48511,7 +48514,7 @@ function outlineTitleMove(pres, slide, direction) {
|
|
|
48511
48514
|
const after = getShapeText(body);
|
|
48512
48515
|
const source = direction === -1 ? previous : body;
|
|
48513
48516
|
if (!(direction === -1 ? before : after)) return null;
|
|
48514
|
-
const paragraphs = getShapeParagraphElements(source);
|
|
48517
|
+
const paragraphs = getShapeParagraphElements(source).map((p) => textElements(p));
|
|
48515
48518
|
const length = (direction === -1 ? paragraphs.at(-1) : paragraphs[0]).reduce((sum, element) => sum + (element.kind === "br" ? 1 : element.text.length), 0);
|
|
48516
48519
|
const separator = before && after ? 1 : 0;
|
|
48517
48520
|
const total = before.length + separator + after.length;
|
|
@@ -48595,7 +48598,7 @@ function promoteOutlineBody(pres, slide, source, range) {
|
|
|
48595
48598
|
start: 0,
|
|
48596
48599
|
end: text.length
|
|
48597
48600
|
});
|
|
48598
|
-
const elementsByParagraph = getShapeParagraphElements(source);
|
|
48601
|
+
const elementsByParagraph = getShapeParagraphElements(source).map((p) => textElements(p));
|
|
48599
48602
|
if (levels.length < elementsByParagraph.length) levels.push(getParagraphLevel(source, elementsByParagraph.length - 1));
|
|
48600
48603
|
let offset = 0;
|
|
48601
48604
|
const paragraphs = elementsByParagraph.map((elements, index) => {
|
|
@@ -48659,7 +48662,8 @@ function promoteOutlineBody(pres, slide, source, range) {
|
|
|
48659
48662
|
function outlineParagraphMove(source, range, direction) {
|
|
48660
48663
|
getParagraphLevel(source, range);
|
|
48661
48664
|
let offset = 0;
|
|
48662
|
-
const paragraphs = getShapeParagraphElements(source).map((
|
|
48665
|
+
const paragraphs = getShapeParagraphElements(source).map((all) => {
|
|
48666
|
+
const elements = textElements(all);
|
|
48663
48667
|
const start = offset;
|
|
48664
48668
|
const end = start + elements.reduce((length, element) => length + (element.kind === "br" ? 1 : element.text.length), 0);
|
|
48665
48669
|
offset = end + 1;
|
|
@@ -49280,7 +49284,7 @@ delegate([
|
|
|
49280
49284
|
//#region src/core/outline-text-html.ts
|
|
49281
49285
|
/** Outline indentation stays independent of slide paragraph margins. */
|
|
49282
49286
|
function outlineTextHtml(pres, shape, title, showFormatting = false, source = shape) {
|
|
49283
|
-
const paragraphs = getShapeParagraphElements(shape);
|
|
49287
|
+
const paragraphs = getShapeParagraphElements(shape).map((p) => textElements(p));
|
|
49284
49288
|
const properties = paragraphs.map((_, index) => getParagraphPropertiesEffective(pres, shape, index, { inheritanceSource: source }));
|
|
49285
49289
|
const labels = paragraphNumberLabels(properties.map((p) => ({
|
|
49286
49290
|
bulletStyle: p.bullet,
|
|
@@ -52251,7 +52255,7 @@ function inlineTextHtml(pres, shape, source, cell) {
|
|
|
52251
52255
|
const target = tableCell ?? shape;
|
|
52252
52256
|
const defaults = defaultTextMetrics(pres, shape);
|
|
52253
52257
|
const themeFonts = getPresentationFonts(pres);
|
|
52254
|
-
const paragraphs = tableCell ? getTableCellParagraphs(tableCell).map((p) => p.elements) : Array.from({ length: getShapeParagraphCount(shape) }, (_, index) => getShapeParagraphElements(shape, index));
|
|
52258
|
+
const paragraphs = tableCell ? getTableCellParagraphs(tableCell).map((p) => textElements(p.elements)) : Array.from({ length: getShapeParagraphCount(shape) }, (_, index) => textElements(getShapeParagraphElements(shape, index)));
|
|
52255
52259
|
const container = document.createElement("div");
|
|
52256
52260
|
const scaled = (value, unit) => `calc(${value}${unit} * var(--text-zoom))`;
|
|
52257
52261
|
const resolve = tableCell ? (paragraph, run) => getTableCellRunFormatEffective(pres, tableCell, paragraph, run) : (paragraph, run) => getShapeRunFormatEffective(pres, shape, paragraph, run, { inheritanceSource: source });
|
|
@@ -76968,7 +76972,7 @@ function EditorApp($$anchor, $$props) {
|
|
|
76968
76972
|
return;
|
|
76969
76973
|
}
|
|
76970
76974
|
const hasShapes = doc.selection.kind === "shape" || doc.selection.kind === "cell";
|
|
76971
|
-
const menuKey = menuItemForKey(nativeMenus(
|
|
76975
|
+
const menuKey = menuItemForKey(nativeMenus(), e)?.id;
|
|
76972
76976
|
if (menuKey === "edit/undo") {
|
|
76973
76977
|
e.preventDefault();
|
|
76974
76978
|
doc.undo();
|
|
@@ -77596,7 +77600,7 @@ function mountEditor(target, options = {}) {
|
|
|
77596
77600
|
if (destroyed) throw new Error("The editor has been destroyed.");
|
|
77597
77601
|
if (!opened) throw new Error("The editor is not ready yet; await `ready` first.");
|
|
77598
77602
|
}
|
|
77599
|
-
const agentTools = () => import("./agent-tools-
|
|
77603
|
+
const agentTools = () => import("./agent-tools-H2QRduWT.js").then((n) => n.t);
|
|
77600
77604
|
const handle = {
|
|
77601
77605
|
ready,
|
|
77602
77606
|
get dirty() {
|
|
@@ -77676,4 +77680,4 @@ function mountEditor(target, options = {}) {
|
|
|
77676
77680
|
//#endregion
|
|
77677
77681
|
export { devHostOptions as n, mountEditor as t };
|
|
77678
77682
|
|
|
77679
|
-
//# sourceMappingURL=src-
|
|
77683
|
+
//# sourceMappingURL=src-3V4AbzLD.js.map
|