Skip to content

Commit

Permalink
Remove promotion button from menubar (#18)
Browse files Browse the repository at this point in the history
  • Loading branch information
curdopet authored Oct 15, 2024
1 parent ad5a40e commit dcd14c9
Show file tree
Hide file tree
Showing 12 changed files with 1 addition and 179 deletions.
1 change: 0 additions & 1 deletion modules/mcagar/src/main/ts/ephox/mcagar/api/McEditor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ const pFromElement = <T extends EditorType = EditorType>(element: SugarElement<E
return new Promise((resolve, reject) => {
const nuSettings: Record<string, any> = {
toolbar_mode: 'wrap',
promotion: false,
...settings
};

Expand Down
1 change: 0 additions & 1 deletion modules/mcagar/src/main/ts/ephox/mcagar/loader/Loader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,6 @@ const setup = (callbacks: Callbacks, settings: Record<string, any>, elementOpt:
const targetSettings = SugarShadowDom.isInShadowRoot(target) ? ({ target: target.dom }) : ({ selector: '#' + randomId });

tinymce.init({
promotion: false,
...settings,
...targetSettings,
setup: (editor: Editor) => {
Expand Down
4 changes: 0 additions & 4 deletions modules/oxide/src/less/theme/components/menubar/menubar.less
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,4 @@
grid-row: 1;
padding: 0 @menubar-padding-x 0 (@menubar-padding-x + @menubar-select-spacing-x);
}

.tox-promotion + .tox-menubar {
grid-column: 1;
}
}
42 changes: 0 additions & 42 deletions modules/oxide/src/less/theme/components/menubar/promotion.less

This file was deleted.

1 change: 0 additions & 1 deletion modules/oxide/src/less/theme/theme.less
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@
@import 'components/insert-table-picker/insert-table-picker';
@import 'components/menu/menu';
@import 'components/menubar/menubar';
@import 'components/menubar/promotion';
@import 'components/menubar/menubar-button';
@import 'components/notification/notification';
@import 'components/pop/pop';
Expand Down
2 changes: 0 additions & 2 deletions modules/tinymce/src/core/main/ts/api/OptionTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,6 @@ interface BaseEditorOptions {
placeholder?: string;
preserve_cdata?: boolean;
preview_styles?: false | string;
promotion?: boolean;
protect?: RegExp[];
readonly?: boolean;
referrer_policy?: ReferrerPolicy;
Expand Down Expand Up @@ -338,7 +337,6 @@ export interface EditorOptions extends NormalizedEditorOptions {
pad_empty_with_br: boolean;
paste_as_text: boolean;
preview_styles: string;
promotion: boolean;
readonly: boolean;
removed_menuitems: string;
sandbox_iframes: boolean;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,6 @@ describe('browser.tinymce.core.init.EditorInitializationTest', () => {
return EditorManager.init({
selector: '.tinymce-editor',
inline: true,
promotion: false,
toolbar_mode: 'wrap'
});
};
Expand Down
15 changes: 1 addition & 14 deletions modules/tinymce/src/themes/silver/main/ts/Render.ts
Original file line number Diff line number Diff line change
Expand Up @@ -209,8 +209,6 @@ const setup = (editor: Editor, setupForTheme: ThemeRenderSetup): RenderInfo => {
const hasMultipleToolbar = Options.isMultipleToolbars(editor);
const hasToolbar = Options.isToolbarEnabled(editor);
const hasMenubar = Options.isMenubarEnabled(editor);
const shouldHavePromotion = Options.promotionEnabled(editor);
const partPromotion = makePromotion();
const hasAnyContents = hasMultipleToolbar || hasToolbar || hasMenubar;

const getPartToolbar = () => {
Expand All @@ -223,8 +221,6 @@ const setup = (editor: Editor, setupForTheme: ThemeRenderSetup): RenderInfo => {
}
};

const menubarCollection = shouldHavePromotion ? [ partPromotion, partMenubar ] : [ partMenubar ];

return OuterContainer.parts.header({
dom: {
tag: 'div',
Expand All @@ -233,7 +229,7 @@ const setup = (editor: Editor, setupForTheme: ThemeRenderSetup): RenderInfo => {
...verticalDirAttributes
},
components: Arr.flatten<AlloySpec>([
hasMenubar ? menubarCollection : [ ],
hasMenubar ? [ partMenubar ] : [ ],
getPartToolbar(),
// fixed_toolbar_container anchors to the editable area, else add an anchor bar
Options.useFixedContainer(editor) ? [ ] : [ memAnchorBar.asSpec() ]
Expand All @@ -245,15 +241,6 @@ const setup = (editor: Editor, setupForTheme: ThemeRenderSetup): RenderInfo => {
});
};

const makePromotion = () => {
return OuterContainer.parts.promotion({
dom: {
tag: 'div',
classes: [ 'tox-promotion' ],
},
});
};

const makeSidebarDefinition = (): SimpleSpec => {
const partSocket: AlloySpec = OuterContainer.parts.socket({
dom: {
Expand Down
7 changes: 0 additions & 7 deletions modules/tinymce/src/themes/silver/main/ts/api/Options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -267,11 +267,6 @@ const register = (editor: Editor): void => {
default: true
});

registerOption('promotion', {
processor: 'boolean',
default: true
});

registerOption('resize', {
processor: (value) => value === 'both' || Type.isBoolean(value),
// Editor resize doesn't work on touch devices at this stage
Expand Down Expand Up @@ -329,7 +324,6 @@ const useBranding = option('branding');
const getResize = option('resize');
const getPasteAsText = option('paste_as_text');
const getSidebarShow = option('sidebar_show');
const promotionEnabled = option('promotion');
const useHelpAccessibility = option('help_accessibility');
const getDefaultFontStack = option('default_font_stack');

Expand Down Expand Up @@ -480,7 +474,6 @@ export {
getFontSizeInputDefaultUnit,
useStatusBar,
useElementPath,
promotionEnabled,
useBranding,
getResize,
getPasteAsText,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import { ToolbarMode } from '../../api/Options';
import { UiFactoryBackstageProviders } from '../../backstage/Backstage';
import { HeaderSpec, renderHeader } from '../header/CommonHeader';
import SilverMenubar, { MenubarItemSpec, SilverMenubarSpec } from '../menus/menubar/SilverMenubar';
import { renderPromotion } from '../promotion/Promotion';
import * as Sidebar from '../sidebar/Sidebar';
import * as Throbber from '../throbber/Throbber';
import {
Expand Down Expand Up @@ -317,16 +316,6 @@ const partHeader = Composite.partType.optional<OuterContainerSketchDetail, Heade
]
});

const partPromotion = Composite.partType.optional<OuterContainerSketchDetail, HeaderSpec>({
factory: {
sketch: renderPromotion
},
name: 'promotion',
schema: [
FieldSchema.required('dom')
]
});

const partSocket = Composite.partType.optional({
// factory: Fun.identity,
name: 'socket',
Expand Down Expand Up @@ -394,7 +383,6 @@ export default Sketcher.composite<OuterContainerSketchSpec, OuterContainerSketch
partMultipleToolbar,
partSocket,
partSidebar,
partPromotion,
partThrobber,
partViewWrapper,
partEditorContainer
Expand Down

This file was deleted.

This file was deleted.

0 comments on commit dcd14c9

Please sign in to comment.