@office-kit/pptx-editor 0.2.4 → 0.3.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/dist/index.js +1 -1
- package/dist/internal.js +1 -1
- package/dist/{src-CVQKI0m3.js → src-B16RJRSK.js} +131 -139
- package/dist/src-B16RJRSK.js.map +1 -0
- package/package.json +1 -1
- package/dist/src-CVQKI0m3.js.map +0 -1
package/dist/index.js
CHANGED
package/dist/internal.js
CHANGED
|
@@ -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;
|
|
@@ -25327,7 +25319,7 @@ function MenuBar($$anchor, $$props) {
|
|
|
25327
25319
|
set_attribute(button_1, "data-item", get(entry).id);
|
|
25328
25320
|
button_1.disabled = get(action).disabled || !get(action).run;
|
|
25329
25321
|
set_attribute(button_1, "title", $0);
|
|
25330
|
-
set_text(text_1, get(action).checked ?
|
|
25322
|
+
set_text(text_1, get(action).checked ? "✓" : "");
|
|
25331
25323
|
set_text(text_2, get(name));
|
|
25332
25324
|
}, [() => get(action).disabled && get(action).reason ? t(get(action).reason) : void 0]);
|
|
25333
25325
|
delegated("mousedown", button_1, (event) => {
|
|
@@ -25359,7 +25351,7 @@ function MenuBar($$anchor, $$props) {
|
|
|
25359
25351
|
append($$anchor, div);
|
|
25360
25352
|
};
|
|
25361
25353
|
const editor = getEditor();
|
|
25362
|
-
const menus = /* @__PURE__ */ user_derived(() =>
|
|
25354
|
+
const menus = /* @__PURE__ */ user_derived(() => visibleMenus(editor));
|
|
25363
25355
|
let openMenu = /* @__PURE__ */ state(null);
|
|
25364
25356
|
let path = /* @__PURE__ */ state(proxy([]));
|
|
25365
25357
|
let fullScreen = /* @__PURE__ */ state(false);
|
|
@@ -25423,7 +25415,7 @@ function MenuBar($$anchor, $$props) {
|
|
|
25423
25415
|
show(get(menus)[(index + delta + get(menus).length) % get(menus).length].id);
|
|
25424
25416
|
}
|
|
25425
25417
|
function onMenuKeydown(event, depth) {
|
|
25426
|
-
if (menuItemForKey(
|
|
25418
|
+
if (menuItemForKey(nativeMenus(), event)) return;
|
|
25427
25419
|
event.stopPropagation();
|
|
25428
25420
|
const target = event.target;
|
|
25429
25421
|
const items = rows(target.closest(".menu"));
|
|
@@ -35636,7 +35628,7 @@ function ArrangeMenu($$anchor, $$props) {
|
|
|
35636
35628
|
} };
|
|
35637
35629
|
}
|
|
35638
35630
|
function keys(event) {
|
|
35639
|
-
if (!event.isComposing && menuItemForKey(nativeMenus(
|
|
35631
|
+
if (!event.isComposing && menuItemForKey(nativeMenus(), event)) {
|
|
35640
35632
|
close(false);
|
|
35641
35633
|
return;
|
|
35642
35634
|
}
|
|
@@ -76968,7 +76960,7 @@ function EditorApp($$anchor, $$props) {
|
|
|
76968
76960
|
return;
|
|
76969
76961
|
}
|
|
76970
76962
|
const hasShapes = doc.selection.kind === "shape" || doc.selection.kind === "cell";
|
|
76971
|
-
const menuKey = menuItemForKey(nativeMenus(
|
|
76963
|
+
const menuKey = menuItemForKey(nativeMenus(), e)?.id;
|
|
76972
76964
|
if (menuKey === "edit/undo") {
|
|
76973
76965
|
e.preventDefault();
|
|
76974
76966
|
doc.undo();
|
|
@@ -77676,4 +77668,4 @@ function mountEditor(target, options = {}) {
|
|
|
77676
77668
|
//#endregion
|
|
77677
77669
|
export { devHostOptions as n, mountEditor as t };
|
|
77678
77670
|
|
|
77679
|
-
//# sourceMappingURL=src-
|
|
77671
|
+
//# sourceMappingURL=src-B16RJRSK.js.map
|