@atlaskit/editor-core 161.0.0 → 162.0.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/CHANGELOG.md +44 -0
- package/dist/cjs/actions/index.js +76 -48
- package/dist/cjs/extensibility.js +2 -2
- package/dist/cjs/labs/next/full-page.js +1 -1
- package/dist/cjs/plugins/block-type/styles.js +5 -2
- package/dist/cjs/plugins/block-type/ui/ToolbarBlockType/index.js +13 -11
- package/dist/cjs/plugins/block-type/ui/ToolbarBlockType/styled.js +11 -7
- package/dist/cjs/plugins/card/messages.js +4 -4
- package/dist/cjs/plugins/card/ui/LinkToolbarAppearance.js +29 -11
- package/dist/cjs/plugins/card/ui/LinkToolbarButtonGroup.js +66 -7
- package/dist/cjs/plugins/card/ui/LinkToolbarIconDropdown.js +166 -7
- package/dist/cjs/plugins/card/ui/ResizableEmbedCard.js +9 -6
- package/dist/cjs/plugins/card/ui/assets/card.js +1 -1
- package/dist/cjs/plugins/card/ui/assets/embed.js +1 -1
- package/dist/cjs/plugins/card/ui/assets/inline.js +1 -1
- package/dist/cjs/plugins/card/ui/assets/url.js +1 -1
- package/dist/cjs/plugins/card/ui/link-toolbar-button-group-options.js +60 -0
- package/dist/cjs/plugins/card/ui/link-toolbar-icon-dropdown-options.js +66 -0
- package/dist/cjs/plugins/card/ui/styled.js +5 -13
- package/dist/cjs/plugins/card/ui/types.js +5 -0
- package/dist/cjs/plugins/clipboard/pm-plugins/main.js +99 -3
- package/dist/cjs/plugins/code-block/styles.js +45 -38
- package/dist/cjs/plugins/extension/plugin-factory.js +4 -1
- package/dist/cjs/plugins/extension/pm-plugins/main.js +34 -11
- package/dist/cjs/plugins/extension/utils.js +57 -12
- package/dist/cjs/plugins/find-replace/ui/Find.js +12 -12
- package/dist/cjs/plugins/find-replace/ui/FindReplace.js +5 -5
- package/dist/cjs/plugins/find-replace/ui/Replace.js +5 -5
- package/dist/cjs/plugins/find-replace/ui/styles.js +12 -15
- package/dist/cjs/plugins/layout/styles.js +2 -2
- package/dist/cjs/plugins/list/actions/wrap-and-join-lists.js +180 -0
- package/dist/cjs/plugins/list/commands/index.js +35 -38
- package/dist/cjs/plugins/list/utils/replace-content.js +31 -0
- package/dist/cjs/plugins/media/nodeviews/mediaNodeUpdater.js +3 -3
- package/dist/cjs/plugins/media/styles.js +2 -2
- package/dist/cjs/plugins/media/utils/media-single.js +15 -2
- package/dist/cjs/plugins/paste/handlers.js +19 -5
- package/dist/cjs/plugins/paste/pm-plugins/analytics.js +1 -1
- package/dist/cjs/plugins/placeholder-text/index.js +45 -1
- package/dist/cjs/plugins/placeholder-text/placeholder-text-nodeview.js +66 -22
- package/dist/cjs/plugins/placeholder-text/selection-utils.js +19 -0
- package/dist/cjs/plugins/placeholder-text/styles.js +3 -1
- package/dist/cjs/plugins/table/commands/index.js +0 -6
- package/dist/cjs/plugins/table/commands/insert.js +1 -1
- package/dist/cjs/plugins/table/commands/misc.js +5 -18
- package/dist/cjs/plugins/table/commands-with-analytics.js +1 -1
- package/dist/cjs/plugins/table/handlers.js +6 -2
- package/dist/cjs/plugins/table/index.js +7 -13
- package/dist/cjs/plugins/table/nodeviews/TableComponent.js +2 -2
- package/dist/cjs/plugins/table/nodeviews/table.js +7 -38
- package/dist/cjs/plugins/table/pm-plugins/decorations/plugin.js +2 -2
- package/dist/cjs/plugins/table/pm-plugins/main.js +3 -1
- package/dist/cjs/plugins/table/pm-plugins/plugin-factory.js +4 -7
- package/dist/cjs/plugins/table/pm-plugins/plugin-key.js +11 -0
- package/dist/cjs/plugins/table/pm-plugins/safari-delayed-dom-selection-syncing-workaround.js +2 -0
- package/dist/cjs/plugins/table/pm-plugins/sticky-headers/nodeviews/tableRow.js +3 -3
- package/dist/cjs/plugins/table/reducer.js +0 -7
- package/dist/cjs/plugins/table/toolbar.js +5 -15
- package/dist/cjs/plugins/table/transforms/metadata.js +2 -2
- package/dist/cjs/plugins/table/ui/FloatingContextualMenu/index.js +3 -1
- package/dist/cjs/plugins/table/ui/FloatingInsertButton/index.js +1 -1
- package/dist/cjs/plugins/table/ui/LayoutButton/index.js +1 -2
- package/dist/cjs/plugins/table/ui/common-styles.css.js +17 -8
- package/dist/cjs/plugins/table/ui/ui-styles.css.js +39 -25
- package/dist/cjs/plugins/table/utils/nodes.js +15 -15
- package/dist/cjs/plugins/tasks-and-decisions/commands.js +15 -1
- package/dist/cjs/plugins/text-formatting/styles.js +5 -2
- package/dist/cjs/plugins/text-formatting/ui/Toolbar/index.js +71 -1
- package/dist/cjs/plugins/text-formatting/ui/Toolbar/toolbar-messages.js +30 -0
- package/dist/cjs/plugins/text-formatting/utils.js +30 -2
- package/dist/cjs/plugins/type-ahead/api.js +32 -1
- package/dist/cjs/plugins/type-ahead/transforms/open-typeahead-at-cursor.js +20 -5
- package/dist/cjs/plugins/type-ahead/utils.js +22 -4
- package/dist/cjs/ui/Appearance/Comment/Comment.js +1 -1
- package/dist/cjs/ui/Appearance/FullPage/StyledComponents.js +1 -1
- package/dist/cjs/ui/ContentStyles/index.js +32 -9
- package/dist/cjs/utils/index.js +1 -8
- package/dist/cjs/utils/insert.js +1 -9
- package/dist/cjs/utils/selection.js +2 -9
- package/dist/cjs/version-wrapper.js +1 -1
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/actions/index.js +20 -23
- package/dist/es2019/extensibility.js +1 -1
- package/dist/es2019/labs/next/full-page.js +2 -2
- package/dist/es2019/plugins/block-type/styles.js +3 -3
- package/dist/es2019/plugins/block-type/ui/ToolbarBlockType/index.js +15 -12
- package/dist/es2019/plugins/block-type/ui/ToolbarBlockType/styled.js +19 -14
- package/dist/es2019/plugins/card/messages.js +4 -4
- package/dist/es2019/plugins/card/ui/LinkToolbarAppearance.js +21 -9
- package/dist/es2019/plugins/card/ui/LinkToolbarButtonGroup.js +54 -3
- package/dist/es2019/plugins/card/ui/LinkToolbarIconDropdown.js +145 -3
- package/dist/es2019/plugins/card/ui/ResizableEmbedCard.js +10 -6
- package/dist/es2019/plugins/card/ui/assets/card.js +1 -1
- package/dist/es2019/plugins/card/ui/assets/embed.js +1 -1
- package/dist/es2019/plugins/card/ui/assets/inline.js +1 -1
- package/dist/es2019/plugins/card/ui/assets/url.js +1 -1
- package/dist/es2019/plugins/card/ui/link-toolbar-button-group-options.js +45 -0
- package/dist/es2019/plugins/card/ui/link-toolbar-icon-dropdown-options.js +51 -0
- package/dist/es2019/plugins/card/ui/styled.js +2 -2
- package/dist/es2019/plugins/card/ui/types.js +1 -0
- package/dist/es2019/plugins/clipboard/pm-plugins/main.js +91 -9
- package/dist/es2019/plugins/code-block/styles.js +14 -14
- package/dist/es2019/plugins/extension/plugin-factory.js +3 -1
- package/dist/es2019/plugins/extension/pm-plugins/main.js +38 -12
- package/dist/es2019/plugins/extension/utils.js +37 -2
- package/dist/es2019/plugins/find-replace/ui/Find.js +1 -1
- package/dist/es2019/plugins/find-replace/ui/FindReplace.js +1 -1
- package/dist/es2019/plugins/find-replace/ui/Replace.js +1 -1
- package/dist/es2019/plugins/find-replace/ui/styles.js +14 -9
- package/dist/es2019/plugins/layout/styles.js +5 -1
- package/dist/es2019/plugins/list/actions/wrap-and-join-lists.js +163 -0
- package/dist/es2019/plugins/list/commands/index.js +29 -28
- package/dist/es2019/plugins/list/utils/replace-content.js +22 -0
- package/dist/es2019/plugins/media/nodeviews/mediaNodeUpdater.js +3 -3
- package/dist/es2019/plugins/media/styles.js +1 -1
- package/dist/es2019/plugins/media/utils/media-single.js +14 -1
- package/dist/es2019/plugins/paste/handlers.js +19 -5
- package/dist/es2019/plugins/paste/pm-plugins/analytics.js +2 -2
- package/dist/es2019/plugins/placeholder-text/index.js +46 -1
- package/dist/es2019/plugins/placeholder-text/placeholder-text-nodeview.js +66 -20
- package/dist/es2019/plugins/placeholder-text/selection-utils.js +9 -0
- package/dist/es2019/plugins/placeholder-text/styles.js +22 -0
- package/dist/es2019/plugins/table/commands/index.js +1 -1
- package/dist/es2019/plugins/table/commands/insert.js +1 -1
- package/dist/es2019/plugins/table/commands/misc.js +5 -11
- package/dist/es2019/plugins/table/commands-with-analytics.js +1 -1
- package/dist/es2019/plugins/table/handlers.js +6 -2
- package/dist/es2019/plugins/table/index.js +4 -8
- package/dist/es2019/plugins/table/nodeviews/TableComponent.js +2 -2
- package/dist/es2019/plugins/table/nodeviews/table.js +2 -16
- package/dist/es2019/plugins/table/pm-plugins/decorations/plugin.js +1 -1
- package/dist/es2019/plugins/table/pm-plugins/main.js +2 -1
- package/dist/es2019/plugins/table/pm-plugins/plugin-factory.js +1 -2
- package/dist/es2019/plugins/table/pm-plugins/plugin-key.js +2 -0
- package/dist/es2019/plugins/table/pm-plugins/safari-delayed-dom-selection-syncing-workaround.js +2 -0
- package/dist/es2019/plugins/table/pm-plugins/sticky-headers/nodeviews/tableRow.js +1 -1
- package/dist/es2019/plugins/table/reducer.js +0 -9
- package/dist/es2019/plugins/table/toolbar.js +1 -4
- package/dist/es2019/plugins/table/transforms/metadata.js +1 -1
- package/dist/es2019/plugins/table/ui/FloatingContextualMenu/index.js +2 -1
- package/dist/es2019/plugins/table/ui/FloatingInsertButton/index.js +1 -1
- package/dist/es2019/plugins/table/ui/LayoutButton/index.js +1 -2
- package/dist/es2019/plugins/table/ui/common-styles.css.js +51 -26
- package/dist/es2019/plugins/table/ui/ui-styles.css.js +57 -56
- package/dist/es2019/plugins/table/utils/nodes.js +11 -11
- package/dist/es2019/plugins/tasks-and-decisions/commands.js +13 -1
- package/dist/es2019/plugins/text-formatting/styles.js +3 -3
- package/dist/es2019/plugins/text-formatting/ui/Toolbar/index.js +61 -2
- package/dist/es2019/plugins/text-formatting/ui/Toolbar/toolbar-messages.js +30 -0
- package/dist/es2019/plugins/text-formatting/utils.js +13 -1
- package/dist/es2019/plugins/type-ahead/api.js +31 -2
- package/dist/es2019/plugins/type-ahead/transforms/open-typeahead-at-cursor.js +17 -5
- package/dist/es2019/plugins/type-ahead/utils.js +15 -0
- package/dist/es2019/ui/Appearance/Comment/Comment.js +2 -2
- package/dist/es2019/ui/Appearance/FullPage/StyledComponents.js +2 -2
- package/dist/es2019/ui/ContentStyles/index.js +45 -23
- package/dist/es2019/utils/index.js +1 -1
- package/dist/es2019/utils/insert.js +2 -10
- package/dist/es2019/utils/selection.js +1 -6
- package/dist/es2019/version-wrapper.js +1 -1
- package/dist/es2019/version.json +1 -1
- package/dist/esm/actions/index.js +76 -48
- package/dist/esm/extensibility.js +1 -1
- package/dist/esm/labs/next/full-page.js +2 -2
- package/dist/esm/plugins/block-type/styles.js +4 -2
- package/dist/esm/plugins/block-type/ui/ToolbarBlockType/index.js +14 -12
- package/dist/esm/plugins/block-type/ui/ToolbarBlockType/styled.js +9 -5
- package/dist/esm/plugins/card/messages.js +4 -4
- package/dist/esm/plugins/card/ui/LinkToolbarAppearance.js +25 -9
- package/dist/esm/plugins/card/ui/LinkToolbarButtonGroup.js +57 -5
- package/dist/esm/plugins/card/ui/LinkToolbarIconDropdown.js +154 -5
- package/dist/esm/plugins/card/ui/ResizableEmbedCard.js +9 -6
- package/dist/esm/plugins/card/ui/assets/card.js +1 -1
- package/dist/esm/plugins/card/ui/assets/embed.js +1 -1
- package/dist/esm/plugins/card/ui/assets/inline.js +1 -1
- package/dist/esm/plugins/card/ui/assets/url.js +1 -1
- package/dist/esm/plugins/card/ui/link-toolbar-button-group-options.js +45 -0
- package/dist/esm/plugins/card/ui/link-toolbar-icon-dropdown-options.js +51 -0
- package/dist/esm/plugins/card/ui/styled.js +2 -2
- package/dist/esm/plugins/card/ui/types.js +1 -0
- package/dist/esm/plugins/clipboard/pm-plugins/main.js +91 -2
- package/dist/esm/plugins/code-block/styles.js +42 -38
- package/dist/esm/plugins/extension/plugin-factory.js +3 -1
- package/dist/esm/plugins/extension/pm-plugins/main.js +34 -11
- package/dist/esm/plugins/extension/utils.js +51 -9
- package/dist/esm/plugins/find-replace/ui/Find.js +1 -1
- package/dist/esm/plugins/find-replace/ui/FindReplace.js +1 -1
- package/dist/esm/plugins/find-replace/ui/Replace.js +1 -1
- package/dist/esm/plugins/find-replace/ui/styles.js +6 -10
- package/dist/esm/plugins/layout/styles.js +2 -2
- package/dist/esm/plugins/list/actions/wrap-and-join-lists.js +168 -0
- package/dist/esm/plugins/list/commands/index.js +33 -34
- package/dist/esm/plugins/list/utils/replace-content.js +21 -0
- package/dist/esm/plugins/media/nodeviews/mediaNodeUpdater.js +3 -3
- package/dist/esm/plugins/media/styles.js +1 -1
- package/dist/esm/plugins/media/utils/media-single.js +12 -1
- package/dist/esm/plugins/paste/handlers.js +19 -5
- package/dist/esm/plugins/paste/pm-plugins/analytics.js +2 -2
- package/dist/esm/plugins/placeholder-text/index.js +44 -1
- package/dist/esm/plugins/placeholder-text/placeholder-text-nodeview.js +67 -20
- package/dist/esm/plugins/placeholder-text/selection-utils.js +9 -0
- package/dist/esm/plugins/placeholder-text/styles.js +2 -1
- package/dist/esm/plugins/table/commands/index.js +1 -1
- package/dist/esm/plugins/table/commands/insert.js +1 -1
- package/dist/esm/plugins/table/commands/misc.js +5 -15
- package/dist/esm/plugins/table/commands-with-analytics.js +1 -1
- package/dist/esm/plugins/table/handlers.js +6 -2
- package/dist/esm/plugins/table/index.js +6 -11
- package/dist/esm/plugins/table/nodeviews/TableComponent.js +2 -2
- package/dist/esm/plugins/table/nodeviews/table.js +6 -37
- package/dist/esm/plugins/table/pm-plugins/decorations/plugin.js +1 -1
- package/dist/esm/plugins/table/pm-plugins/main.js +2 -1
- package/dist/esm/plugins/table/pm-plugins/plugin-factory.js +1 -2
- package/dist/esm/plugins/table/pm-plugins/plugin-key.js +2 -0
- package/dist/esm/plugins/table/pm-plugins/safari-delayed-dom-selection-syncing-workaround.js +2 -0
- package/dist/esm/plugins/table/pm-plugins/sticky-headers/nodeviews/tableRow.js +1 -1
- package/dist/esm/plugins/table/reducer.js +0 -7
- package/dist/esm/plugins/table/toolbar.js +1 -10
- package/dist/esm/plugins/table/transforms/metadata.js +1 -1
- package/dist/esm/plugins/table/ui/FloatingContextualMenu/index.js +2 -1
- package/dist/esm/plugins/table/ui/FloatingInsertButton/index.js +1 -1
- package/dist/esm/plugins/table/ui/LayoutButton/index.js +1 -2
- package/dist/esm/plugins/table/ui/common-styles.css.js +10 -6
- package/dist/esm/plugins/table/ui/ui-styles.css.js +20 -11
- package/dist/esm/plugins/table/utils/nodes.js +14 -14
- package/dist/esm/plugins/tasks-and-decisions/commands.js +13 -1
- package/dist/esm/plugins/text-formatting/styles.js +4 -2
- package/dist/esm/plugins/text-formatting/ui/Toolbar/index.js +69 -2
- package/dist/esm/plugins/text-formatting/ui/Toolbar/toolbar-messages.js +30 -0
- package/dist/esm/plugins/text-formatting/utils.js +18 -0
- package/dist/esm/plugins/type-ahead/api.js +30 -2
- package/dist/esm/plugins/type-ahead/transforms/open-typeahead-at-cursor.js +16 -4
- package/dist/esm/plugins/type-ahead/utils.js +17 -3
- package/dist/esm/ui/Appearance/Comment/Comment.js +2 -2
- package/dist/esm/ui/Appearance/FullPage/StyledComponents.js +2 -2
- package/dist/esm/ui/ContentStyles/index.js +27 -9
- package/dist/esm/utils/index.js +1 -1
- package/dist/esm/utils/insert.js +2 -10
- package/dist/esm/utils/selection.js +1 -6
- package/dist/esm/version-wrapper.js +1 -1
- package/dist/esm/version.json +1 -1
- package/dist/types/actions/index.d.ts +2 -2
- package/dist/types/extensibility.d.ts +1 -1
- package/dist/types/plugins/analytics/types/list-events.d.ts +0 -1
- package/dist/types/plugins/block-type/styles.d.ts +2 -1
- package/dist/types/plugins/block-type/ui/ToolbarBlockType/index.d.ts +1 -0
- package/dist/types/plugins/block-type/ui/ToolbarBlockType/styled.d.ts +2 -7
- package/dist/types/plugins/card/messages.d.ts +2 -2
- package/dist/types/plugins/card/ui/LinkToolbarButtonGroup.d.ts +18 -2
- package/dist/types/plugins/card/ui/LinkToolbarIconDropdown.d.ts +23 -3
- package/dist/types/plugins/card/ui/ResizableEmbedCard.d.ts +3 -1
- package/dist/types/plugins/card/ui/link-toolbar-button-group-options.d.ts +5 -0
- package/dist/types/plugins/card/ui/link-toolbar-icon-dropdown-options.d.ts +5 -0
- package/dist/types/plugins/card/ui/styled.d.ts +2 -3
- package/dist/types/plugins/card/ui/types.d.ts +12 -0
- package/dist/types/plugins/clipboard/pm-plugins/main.d.ts +10 -1
- package/dist/types/plugins/code-block/styles.d.ts +3 -2
- package/dist/types/plugins/extension/pm-plugins/main.d.ts +2 -1
- package/dist/types/plugins/extension/types.d.ts +1 -0
- package/dist/types/plugins/extension/utils.d.ts +3 -1
- package/dist/types/plugins/find-replace/ui/FindReplace.d.ts +2 -1
- package/dist/types/plugins/find-replace/ui/styles.d.ts +5 -5
- package/dist/types/plugins/layout/styles.d.ts +1 -1
- package/dist/types/plugins/list/actions/wrap-and-join-lists.d.ts +25 -0
- package/dist/types/plugins/list/commands/index.d.ts +0 -1
- package/dist/types/plugins/list/utils/replace-content.d.ts +8 -0
- package/dist/types/plugins/media/nodeviews/mediaNodeUpdater.d.ts +2 -2
- package/dist/types/plugins/media/styles.d.ts +1 -1
- package/dist/types/plugins/media/utils/media-single.d.ts +1 -0
- package/dist/types/plugins/panel/styles.d.ts +1 -1
- package/dist/types/plugins/paste/handlers.d.ts +1 -1
- package/dist/types/plugins/placeholder-text/placeholder-text-nodeview.d.ts +3 -2
- package/dist/types/plugins/placeholder-text/selection-utils.d.ts +2 -0
- package/dist/types/plugins/rule/styles.d.ts +1 -1
- package/dist/types/plugins/table/commands/index.d.ts +1 -1
- package/dist/types/plugins/table/commands/misc.d.ts +0 -1
- package/dist/types/plugins/table/nodeviews/table.d.ts +0 -1
- package/dist/types/plugins/table/pm-plugins/plugin-factory.d.ts +1 -4
- package/dist/types/plugins/table/pm-plugins/plugin-key.d.ts +3 -0
- package/dist/types/plugins/table/types.d.ts +1 -8
- package/dist/types/plugins/table/ui/LayoutButton/index.d.ts +0 -1
- package/dist/types/plugins/table/ui/common-styles.css.d.ts +6 -3
- package/dist/types/plugins/table/ui/ui-styles.css.d.ts +15 -14
- package/dist/types/plugins/table/utils/nodes.d.ts +6 -6
- package/dist/types/plugins/text-formatting/pm-plugins/smart-input-rule.d.ts +1 -1
- package/dist/types/plugins/text-formatting/styles.d.ts +2 -1
- package/dist/types/plugins/text-formatting/ui/Toolbar/toolbar-messages.d.ts +30 -0
- package/dist/types/plugins/text-formatting/utils.d.ts +4 -0
- package/dist/types/plugins/type-ahead/api.d.ts +11 -1
- package/dist/types/plugins/type-ahead/transforms/open-typeahead-at-cursor.d.ts +1 -0
- package/dist/types/plugins/type-ahead/utils.d.ts +4 -0
- package/dist/types/ui/ContentStyles/index.d.ts +1 -0
- package/dist/types/utils/index.d.ts +1 -1
- package/dist/types/utils/selection.d.ts +0 -1
- package/package.json +28 -26
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
+
|
|
3
|
+
/** @jsx jsx */
|
|
2
4
|
import React from 'react';
|
|
5
|
+
import { jsx } from '@emotion/react';
|
|
3
6
|
import { injectIntl } from 'react-intl-next';
|
|
4
7
|
import { akEditorMenuZIndex } from '@atlaskit/editor-shared-styles';
|
|
5
8
|
import DropdownMenu from '../../../../ui/DropdownMenu';
|
|
6
9
|
import { Separator, Wrapper, MenuWrapper } from '../../../../ui/styles';
|
|
7
10
|
import { NORMAL_TEXT } from '../../types';
|
|
8
|
-
import {
|
|
11
|
+
import { blockTypeMenuItemStyle, KeyboardShortcut } from './styled';
|
|
9
12
|
import { tooltip, findKeymapByDescription } from '../../../../keymaps';
|
|
10
13
|
import { BlockTypeButton } from './blocktype-button';
|
|
11
14
|
|
|
@@ -41,16 +44,16 @@ class ToolbarBlockType extends React.PureComponent {
|
|
|
41
44
|
} = this.props.pluginState;
|
|
42
45
|
const items = availableBlockTypes.map((blockType, index) => {
|
|
43
46
|
const isActive = currentBlockType === blockType;
|
|
44
|
-
const
|
|
47
|
+
const tagName = blockType.tagName || 'p';
|
|
48
|
+
const Tag = tagName;
|
|
45
49
|
return {
|
|
46
|
-
content:
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
}, /*#__PURE__*/React.createElement(Tag, null, formatMessage(blockType.title))),
|
|
50
|
+
content: jsx("div", {
|
|
51
|
+
css: blockTypeMenuItemStyle(tagName, isActive)
|
|
52
|
+
}, jsx(Tag, null, formatMessage(blockType.title))),
|
|
50
53
|
value: blockType,
|
|
51
54
|
label: formatMessage(blockType.title),
|
|
52
55
|
key: `${blockType.name}-${index}`,
|
|
53
|
-
elemAfter:
|
|
56
|
+
elemAfter: jsx(KeyboardShortcut, {
|
|
54
57
|
selected: isActive
|
|
55
58
|
}, tooltip(findKeymapByDescription(blockType.title.defaultMessage))),
|
|
56
59
|
isActive
|
|
@@ -105,7 +108,7 @@ class ToolbarBlockType extends React.PureComponent {
|
|
|
105
108
|
|
|
106
109
|
if (!this.props.isDisabled && !blockTypesDisabled) {
|
|
107
110
|
const items = this.createItems();
|
|
108
|
-
return
|
|
111
|
+
return jsx(MenuWrapper, null, jsx(DropdownMenu, {
|
|
109
112
|
items: items,
|
|
110
113
|
onOpenChange: this.onOpenChange,
|
|
111
114
|
onItemActivated: this.handleSelectBlockType,
|
|
@@ -117,7 +120,7 @@ class ToolbarBlockType extends React.PureComponent {
|
|
|
117
120
|
fitHeight: 360,
|
|
118
121
|
fitWidth: 106,
|
|
119
122
|
shouldUseDefaultRole: true
|
|
120
|
-
},
|
|
123
|
+
}, jsx(BlockTypeButton, {
|
|
121
124
|
isSmall: isSmall,
|
|
122
125
|
isReducedSpacing: isReducedSpacing,
|
|
123
126
|
selected: active,
|
|
@@ -126,10 +129,10 @@ class ToolbarBlockType extends React.PureComponent {
|
|
|
126
129
|
onClick: this.handleTriggerClick,
|
|
127
130
|
formatMessage: formatMessage,
|
|
128
131
|
"aria-expanded": active
|
|
129
|
-
}, longestDropdownMenuItem)),
|
|
132
|
+
}, longestDropdownMenuItem)), jsx(Separator, null));
|
|
130
133
|
}
|
|
131
134
|
|
|
132
|
-
return
|
|
135
|
+
return jsx(Wrapper, null, jsx(BlockTypeButton, {
|
|
133
136
|
isSmall: isSmall,
|
|
134
137
|
isReducedSpacing: isReducedSpacing,
|
|
135
138
|
selected: active,
|
|
@@ -138,7 +141,7 @@ class ToolbarBlockType extends React.PureComponent {
|
|
|
138
141
|
onClick: this.handleTriggerClick,
|
|
139
142
|
formatMessage: formatMessage,
|
|
140
143
|
"aria-expanded": active
|
|
141
|
-
}, longestDropdownMenuItem),
|
|
144
|
+
}, longestDropdownMenuItem), jsx(Separator, null));
|
|
142
145
|
}
|
|
143
146
|
|
|
144
147
|
}
|
|
@@ -1,22 +1,27 @@
|
|
|
1
|
+
/** @jsx jsx */
|
|
2
|
+
import { css } from '@emotion/react';
|
|
1
3
|
import { N400 } from '@atlaskit/theme/colors';
|
|
2
4
|
import styled from 'styled-components';
|
|
3
5
|
import { headingsSharedStyles } from '@atlaskit/editor-common/styles';
|
|
4
6
|
import { Shortcut } from '../../../../ui/styles';
|
|
5
|
-
export const
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
7
|
+
export const blockTypeMenuItemStyle = (tagName, selected) => {
|
|
8
|
+
// TEMP FIX: See https://product-fabric.atlassian.net/browse/ED-13878
|
|
9
|
+
const selectedStyle = selected ? `${tagName} { color: white !important; }` : '';
|
|
10
|
+
return themeProps => css`
|
|
11
|
+
${headingsSharedStyles(themeProps)};
|
|
12
|
+
> {
|
|
13
|
+
h1,
|
|
14
|
+
h2,
|
|
15
|
+
h3,
|
|
16
|
+
h4,
|
|
17
|
+
h5,
|
|
18
|
+
h6 {
|
|
19
|
+
margin-top: 0;
|
|
20
|
+
}
|
|
15
21
|
}
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
`;
|
|
22
|
+
${selectedStyle};
|
|
23
|
+
`;
|
|
24
|
+
};
|
|
20
25
|
export const KeyboardShortcut = styled(Shortcut)`
|
|
21
26
|
${props => props.selected ? `color: ${N400};` : ''}
|
|
22
27
|
margin-left: 16px;
|
|
@@ -45,8 +45,8 @@ export const messages = defineMessages({
|
|
|
45
45
|
defaultMessage: 'URL',
|
|
46
46
|
description: 'Title for option to convert the card to become a regular text-based hyperlink.'
|
|
47
47
|
},
|
|
48
|
-
|
|
49
|
-
id: 'fabric.editor.
|
|
48
|
+
blockTitle: {
|
|
49
|
+
id: 'fabric.editor.blockTitle',
|
|
50
50
|
defaultMessage: 'Card',
|
|
51
51
|
description: 'Title for option to display link in the card view.'
|
|
52
52
|
},
|
|
@@ -65,8 +65,8 @@ export const messages = defineMessages({
|
|
|
65
65
|
defaultMessage: 'Display link as URL',
|
|
66
66
|
description: 'Description for option to convert the card to become a regular text-based hyperlink.'
|
|
67
67
|
},
|
|
68
|
-
|
|
69
|
-
id: 'fabric.editor.
|
|
68
|
+
blockDescription: {
|
|
69
|
+
id: 'fabric.editor.blockDescription',
|
|
70
70
|
defaultMessage: 'Display more information about a link, including a summary and actions',
|
|
71
71
|
description: 'Description for option to display link in the card view.'
|
|
72
72
|
},
|
|
@@ -8,8 +8,10 @@ import Dropdown from '../../floating-toolbar/ui/Dropdown';
|
|
|
8
8
|
import { messages } from '../messages';
|
|
9
9
|
import nodeNames from '../../../messages';
|
|
10
10
|
import { getFeatureFlags } from '../../../plugins/feature-flags-context';
|
|
11
|
-
import LinkToolbarIconDropdown from './LinkToolbarIconDropdown';
|
|
12
|
-
import LinkToolbarButtonGroup from './LinkToolbarButtonGroup';
|
|
11
|
+
import { LinkToolbarIconDropdown } from './LinkToolbarIconDropdown';
|
|
12
|
+
import { LinkToolbarButtonGroup } from './LinkToolbarButtonGroup';
|
|
13
|
+
import { getButtonGroupOption } from './link-toolbar-button-group-options';
|
|
14
|
+
import { getIconDropdownOption } from './link-toolbar-icon-dropdown-options';
|
|
13
15
|
export class LinkToolbarAppearance extends React.Component {
|
|
14
16
|
constructor(...args) {
|
|
15
17
|
super(...args);
|
|
@@ -38,6 +40,7 @@ export class LinkToolbarAppearance extends React.Component {
|
|
|
38
40
|
const isSmartLinkSupportedInParent = isSupportedInParent(editorState, Fragment.from(editorState.schema.nodes.blockCard.createChecked({})), currentAppearance);
|
|
39
41
|
const tooltip = isSmartLinkSupportedInParent ? undefined : parentNodeName(editorState, intl);
|
|
40
42
|
const embedOption = allowEmbeds && preview && {
|
|
43
|
+
appearance: 'embed',
|
|
41
44
|
title: intl.formatMessage(messages.embed),
|
|
42
45
|
onClick: setSelectedCardAppearance('embed'),
|
|
43
46
|
selected: currentAppearance === 'embed',
|
|
@@ -52,24 +55,27 @@ export class LinkToolbarAppearance extends React.Component {
|
|
|
52
55
|
selected: !currentAppearance,
|
|
53
56
|
testId: 'url-appearance'
|
|
54
57
|
}, {
|
|
58
|
+
appearance: 'inline',
|
|
55
59
|
title: intl.formatMessage(messages.inline),
|
|
56
60
|
onClick: setSelectedCardAppearance('inline'),
|
|
57
61
|
selected: currentAppearance === 'inline',
|
|
58
|
-
hidden: false,
|
|
59
62
|
testId: 'inline-appearance'
|
|
60
63
|
}, {
|
|
64
|
+
appearance: 'block',
|
|
61
65
|
title: intl.formatMessage(messages.block),
|
|
62
66
|
onClick: setSelectedCardAppearance('block'),
|
|
63
67
|
selected: currentAppearance === 'block',
|
|
64
|
-
hidden: false,
|
|
65
68
|
testId: 'block-appearance',
|
|
66
69
|
disabled: !isSmartLinkSupportedInParent,
|
|
67
70
|
tooltip
|
|
68
71
|
}];
|
|
69
|
-
const title = intl.formatMessage(currentAppearance ? messages[currentAppearance] : messages.url);
|
|
70
72
|
|
|
71
73
|
const dispatchCommand = fn => {
|
|
72
|
-
fn && fn(editorState, view && view.dispatch);
|
|
74
|
+
fn && fn(editorState, view && view.dispatch); // Refocus the view to ensure the editor has focus
|
|
75
|
+
|
|
76
|
+
if (view && !view.hasFocus()) {
|
|
77
|
+
view.focus();
|
|
78
|
+
}
|
|
73
79
|
};
|
|
74
80
|
|
|
75
81
|
if (embedOption) {
|
|
@@ -82,18 +88,24 @@ export class LinkToolbarAppearance extends React.Component {
|
|
|
82
88
|
|
|
83
89
|
if (viewChangingExperimentToolbarStyle === 'toolbarIcons') {
|
|
84
90
|
return /*#__PURE__*/React.createElement(LinkToolbarButtonGroup, {
|
|
85
|
-
key: "link-toolbar-button-group"
|
|
91
|
+
key: "link-toolbar-button-group",
|
|
92
|
+
options: options.map(option => getButtonGroupOption(intl, dispatchCommand, option))
|
|
86
93
|
});
|
|
87
94
|
}
|
|
88
95
|
|
|
89
96
|
if (viewChangingExperimentToolbarStyle === 'newDropdown') {
|
|
90
97
|
return /*#__PURE__*/React.createElement(LinkToolbarIconDropdown, {
|
|
91
|
-
key: "link-toolbar-icon-dropdown"
|
|
98
|
+
key: "link-toolbar-icon-dropdown",
|
|
99
|
+
title: "Change view",
|
|
100
|
+
buttonTestId: "link-toolbar-appearance-button",
|
|
101
|
+
dispatchCommand: dispatchCommand,
|
|
102
|
+
options: options.map(option => getIconDropdownOption(intl, dispatchCommand, option))
|
|
92
103
|
});
|
|
93
104
|
}
|
|
94
105
|
|
|
106
|
+
const title = intl.formatMessage(currentAppearance ? messages[currentAppearance] : messages.url);
|
|
95
107
|
return /*#__PURE__*/React.createElement(Dropdown, {
|
|
96
|
-
key:
|
|
108
|
+
key: "link-toolbar",
|
|
97
109
|
buttonTestId: "link-toolbar-appearance-button",
|
|
98
110
|
title: title,
|
|
99
111
|
dispatchCommand: dispatchCommand,
|
|
@@ -1,7 +1,58 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import styled from 'styled-components';
|
|
3
|
+
import { ButtonGroup } from '@atlaskit/button';
|
|
4
|
+
import Button from '../../floating-toolbar/ui/Button';
|
|
5
|
+
/**
|
|
6
|
+
* Applying `pointer-events: none;` when disabled allows the Tooltip to be displayed
|
|
7
|
+
*/
|
|
2
8
|
|
|
3
|
-
const
|
|
4
|
-
|
|
9
|
+
export const StyledButton = styled(Button)`
|
|
10
|
+
pointer-events: ${({
|
|
11
|
+
disabled
|
|
12
|
+
}) => disabled ? 'none' : 'auto'};
|
|
13
|
+
`;
|
|
14
|
+
|
|
15
|
+
const DisallowedWrapper = ({
|
|
16
|
+
disabled,
|
|
17
|
+
...props
|
|
18
|
+
}) => {
|
|
19
|
+
return /*#__PURE__*/React.createElement("div", props);
|
|
5
20
|
};
|
|
21
|
+
/**
|
|
22
|
+
* The button requires `pointer-events: none;` in order to fix the tooltip, hence
|
|
23
|
+
* leaving us without a disabled cursor, the following fixes this:
|
|
24
|
+
*/
|
|
25
|
+
|
|
6
26
|
|
|
7
|
-
|
|
27
|
+
const StyledDisallowedWrapper = styled(DisallowedWrapper)`
|
|
28
|
+
cursor: ${({
|
|
29
|
+
disabled
|
|
30
|
+
}) => disabled ? 'not-allowed' : 'pointer'};
|
|
31
|
+
`;
|
|
32
|
+
export const LinkToolbarButtonGroup = ({
|
|
33
|
+
options
|
|
34
|
+
}) => {
|
|
35
|
+
return /*#__PURE__*/React.createElement(ButtonGroup, null, options.map(({
|
|
36
|
+
onClick,
|
|
37
|
+
selected,
|
|
38
|
+
disabled,
|
|
39
|
+
testId,
|
|
40
|
+
tooltipContent,
|
|
41
|
+
title,
|
|
42
|
+
icon: Icon
|
|
43
|
+
}) => /*#__PURE__*/React.createElement(StyledDisallowedWrapper, {
|
|
44
|
+
key: testId,
|
|
45
|
+
disabled: disabled
|
|
46
|
+
}, /*#__PURE__*/React.createElement(StyledButton, {
|
|
47
|
+
title: title,
|
|
48
|
+
icon: /*#__PURE__*/React.createElement(Icon, {
|
|
49
|
+
size: "medium",
|
|
50
|
+
label: title
|
|
51
|
+
}),
|
|
52
|
+
selected: selected,
|
|
53
|
+
onClick: onClick,
|
|
54
|
+
testId: testId,
|
|
55
|
+
disabled: disabled,
|
|
56
|
+
tooltipContent: tooltipContent
|
|
57
|
+
}))));
|
|
58
|
+
};
|
|
@@ -1,7 +1,149 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
+
|
|
3
|
+
/** @jsx jsx */
|
|
1
4
|
import React from 'react';
|
|
5
|
+
import { css, jsx } from '@emotion/react';
|
|
6
|
+
import { MenuGroup, Section, CustomItem } from '@atlaskit/menu';
|
|
7
|
+
import { borderRadius } from '@atlaskit/theme/constants';
|
|
8
|
+
import { B50, N20, B400 } from '@atlaskit/theme/colors';
|
|
9
|
+
import { token } from '@atlaskit/tokens';
|
|
10
|
+
import Tooltip from '@atlaskit/tooltip';
|
|
11
|
+
import Dropdown from '../../floating-toolbar/ui/Dropdown';
|
|
12
|
+
export const ICON_HEIGHT = 40;
|
|
13
|
+
export const ICON_WIDTH = 40;
|
|
14
|
+
const iconBoxStyles = css({
|
|
15
|
+
width: ICON_HEIGHT,
|
|
16
|
+
height: ICON_WIDTH,
|
|
17
|
+
overflow: 'hidden',
|
|
18
|
+
border: '1px solid rgba(223, 225, 229, 0.5)'
|
|
19
|
+
/* N60 at 50% */
|
|
20
|
+
,
|
|
21
|
+
borderRadius: borderRadius(),
|
|
22
|
+
boxSizing: 'border-box',
|
|
23
|
+
display: 'flex',
|
|
24
|
+
justifyContent: 'center',
|
|
25
|
+
alignItems: 'center',
|
|
26
|
+
backgroundColor: token('color.background.default', 'white')
|
|
27
|
+
});
|
|
28
|
+
const primitiveStyles = css({
|
|
29
|
+
padding: '0.75rem',
|
|
30
|
+
alignItems: 'flex-start'
|
|
31
|
+
});
|
|
32
|
+
const interactiveStyles = css({
|
|
33
|
+
'&:active': {
|
|
34
|
+
backgroundColor: token('color.background.brand.pressed', B50),
|
|
35
|
+
color: token('color.text.accent.blue', B400)
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
const unselectedStyles = css({
|
|
39
|
+
'&:hover': {
|
|
40
|
+
backgroundColor: token('color.background.neutral.subtle.hovered', N20),
|
|
41
|
+
color: token('color.text.brand', 'currentColor')
|
|
42
|
+
}
|
|
43
|
+
});
|
|
44
|
+
const selectedOptionStyles = css({
|
|
45
|
+
backgroundColor: token('color.background.brand.pressed', B50),
|
|
46
|
+
color: token('color.text.brand', 'currentColor'),
|
|
47
|
+
'&:hover': {
|
|
48
|
+
backgroundColor: token('color.background.brand.pressed', B50),
|
|
49
|
+
color: token('color.text.brand', 'currentColor')
|
|
50
|
+
}
|
|
51
|
+
});
|
|
52
|
+
const titleOffsetStyles = css({
|
|
53
|
+
marginTop: '0.125rem'
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
const getCustomStyles = (selected, disabled) => {
|
|
57
|
+
if (disabled) {
|
|
58
|
+
return [primitiveStyles];
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
if (selected) {
|
|
62
|
+
return [primitiveStyles, selectedOptionStyles, interactiveStyles];
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
return [primitiveStyles, unselectedStyles, interactiveStyles];
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
const OptionRoot = props => jsx("div", _extends({}, props, {
|
|
69
|
+
tabIndex: 0
|
|
70
|
+
}));
|
|
71
|
+
|
|
72
|
+
const Option = ({
|
|
73
|
+
title,
|
|
74
|
+
description,
|
|
75
|
+
selected,
|
|
76
|
+
disabled,
|
|
77
|
+
onClick,
|
|
78
|
+
icon: Icon,
|
|
79
|
+
testId,
|
|
80
|
+
tooltipContent,
|
|
81
|
+
hide
|
|
82
|
+
}) => {
|
|
83
|
+
const option = jsx(CustomItem, {
|
|
84
|
+
"aria-label": title,
|
|
85
|
+
component: OptionRoot,
|
|
86
|
+
iconBefore: jsx("div", {
|
|
87
|
+
css: iconBoxStyles
|
|
88
|
+
}, jsx(Icon, {
|
|
89
|
+
width: 38,
|
|
90
|
+
height: 38,
|
|
91
|
+
label: title
|
|
92
|
+
})),
|
|
93
|
+
css: getCustomStyles(selected, disabled),
|
|
94
|
+
description: description,
|
|
95
|
+
testId: testId,
|
|
96
|
+
onClick: event => {
|
|
97
|
+
event.preventDefault();
|
|
98
|
+
|
|
99
|
+
if (!disabled) {
|
|
100
|
+
onClick();
|
|
101
|
+
hide();
|
|
102
|
+
}
|
|
103
|
+
},
|
|
104
|
+
onKeyDown: event => {
|
|
105
|
+
if (event.key === 'Enter' || event.key === 'Space') {
|
|
106
|
+
event.preventDefault();
|
|
107
|
+
|
|
108
|
+
if (!disabled) {
|
|
109
|
+
onClick();
|
|
110
|
+
hide();
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
},
|
|
114
|
+
role: "option",
|
|
115
|
+
"aria-selected": selected,
|
|
116
|
+
isSelected: selected,
|
|
117
|
+
isDisabled: disabled,
|
|
118
|
+
shouldDescriptionWrap: true
|
|
119
|
+
}, jsx("div", {
|
|
120
|
+
css: titleOffsetStyles
|
|
121
|
+
}, title));
|
|
122
|
+
|
|
123
|
+
if (tooltipContent) {
|
|
124
|
+
return jsx(Tooltip, {
|
|
125
|
+
content: tooltipContent
|
|
126
|
+
}, option);
|
|
127
|
+
}
|
|
2
128
|
|
|
3
|
-
|
|
4
|
-
return /*#__PURE__*/React.createElement("span", null);
|
|
129
|
+
return option;
|
|
5
130
|
};
|
|
6
131
|
|
|
7
|
-
export
|
|
132
|
+
export const LinkToolbarIconDropdown = ({
|
|
133
|
+
options,
|
|
134
|
+
...rest
|
|
135
|
+
}) => jsx(Dropdown, _extends({}, rest, {
|
|
136
|
+
options: {
|
|
137
|
+
render: ({
|
|
138
|
+
hide
|
|
139
|
+
}) => jsx(MenuGroup, null, jsx("div", {
|
|
140
|
+
role: "listbox"
|
|
141
|
+
}, jsx(Section, null, options.map(props => jsx(Option, _extends({
|
|
142
|
+
key: props.testId
|
|
143
|
+
}, props, {
|
|
144
|
+
hide: hide
|
|
145
|
+
})))))),
|
|
146
|
+
width: 320,
|
|
147
|
+
height: 200
|
|
148
|
+
}
|
|
149
|
+
}));
|
|
@@ -1,15 +1,18 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
3
|
+
|
|
4
|
+
/** @jsx jsx */
|
|
3
5
|
import React from 'react';
|
|
6
|
+
import { jsx } from '@emotion/react';
|
|
4
7
|
import { findParentNodeOfTypeClosestToPos, hasParentNodeOfType } from 'prosemirror-utils';
|
|
5
8
|
import { calcColumnsFromPx, calcPctFromPx, calcPxFromColumns, wrappedLayouts } from '@atlaskit/editor-common/ui';
|
|
6
9
|
import { akEditorMediaResizeHandlerPaddingWide, akEditorBreakoutPadding, akEditorWideLayoutWidth, breakoutWideScaleRatio, DEFAULT_EMBED_CARD_HEIGHT, DEFAULT_EMBED_CARD_WIDTH } from '@atlaskit/editor-shared-styles';
|
|
7
|
-
import { embedHeaderHeight } from '@atlaskit/
|
|
10
|
+
import { embedHeaderHeight } from '@atlaskit/smart-card';
|
|
8
11
|
import { Wrapper } from '../../../ui/Resizer/styled';
|
|
9
12
|
import Resizer from '../../../ui/Resizer';
|
|
10
13
|
import { handleSides, imageAlignmentMap, snapTo } from '../../../ui/Resizer/utils';
|
|
11
14
|
import { calcMediaPxWidth } from '../../../plugins/media/utils/media-single';
|
|
12
|
-
import {
|
|
15
|
+
import { embedSpacingStyles } from './styled';
|
|
13
16
|
export default class ResizableEmbedCard extends React.Component {
|
|
14
17
|
constructor(...args) {
|
|
15
18
|
super(...args);
|
|
@@ -321,7 +324,7 @@ export default class ResizableEmbedCard extends React.Component {
|
|
|
321
324
|
};
|
|
322
325
|
}
|
|
323
326
|
|
|
324
|
-
return
|
|
327
|
+
return jsx("span", {
|
|
325
328
|
"data-testid": 'resizable-embed-card-height-definer',
|
|
326
329
|
style: {
|
|
327
330
|
display: 'block',
|
|
@@ -352,15 +355,16 @@ export default class ResizableEmbedCard extends React.Component {
|
|
|
352
355
|
enable[side] = false;
|
|
353
356
|
}
|
|
354
357
|
});
|
|
355
|
-
return
|
|
358
|
+
return jsx("div", {
|
|
359
|
+
css: embedSpacingStyles,
|
|
356
360
|
"data-testid": "resizable-embed-card-spacing"
|
|
357
|
-
},
|
|
361
|
+
}, jsx(Wrapper, {
|
|
358
362
|
layout: layout,
|
|
359
363
|
isResized: !!pctWidth,
|
|
360
364
|
containerWidth: containerWidth || DEFAULT_EMBED_CARD_WIDTH,
|
|
361
365
|
innerRef: elem => this.wrapper = elem,
|
|
362
366
|
fullWidthMode: fullWidthMode
|
|
363
|
-
},
|
|
367
|
+
}, jsx(Resizer, _extends({}, this.props, {
|
|
364
368
|
width: initialWidth // Starting or initial width of embed <iframe> itself.
|
|
365
369
|
,
|
|
366
370
|
enable: enable,
|
|
@@ -13,7 +13,7 @@ const IconCardGlyph = props => {
|
|
|
13
13
|
fillRule: "evenodd",
|
|
14
14
|
clipRule: "evenodd",
|
|
15
15
|
d: "M8 9c-1.10457 0-2 .89543-2 2v10c0 1.1046.89543 2 2 2h16c1.1046 0 2-.8954 2-2V11c0-1.10457-.8954-2-2-2H8Zm0 3c0-.5523.44772-1 1-1h2c.5523 0 1 .4477 1 1v2c0 .5523-.4477 1-1 1H9c-.55228 0-1-.4477-1-1v-2Zm5 1c0-.2761.2239-.5.5-.5h10c.2761 0 .5.2239.5.5s-.2239.5-.5.5h-10c-.2761 0-.5-.2239-.5-.5Zm-4 3c-.55228 0-1 .4477-1 1s.44772 1 1 1h14c.5523 0 1-.4477 1-1s-.4477-1-1-1H9Zm-1 4c0-.5523.44772-1 1-1h6c.5523 0 1 .4477 1 1s-.4477 1-1 1H9c-.55228 0-1-.4477-1-1Z",
|
|
16
|
-
fill: "
|
|
16
|
+
fill: "currentColor"
|
|
17
17
|
}));
|
|
18
18
|
};
|
|
19
19
|
|
|
@@ -13,7 +13,7 @@ const IconEmbedGlyph = props => {
|
|
|
13
13
|
fillRule: "evenodd",
|
|
14
14
|
clipRule: "evenodd",
|
|
15
15
|
d: "M8 6c-1.10457 0-2 .89543-2 2v16c0 1.1046.89543 2 2 2h16c1.1046 0 2-.8954 2-2V8c0-1.10457-.8954-2-2-2H8Zm1 2c-.55228 0-1 .44772-1 1v2c0 .5523.44772 1 1 1h2c.5523 0 1-.4477 1-1V9c0-.55228-.4477-1-1-1H9Zm4.5 1.5c-.2761 0-.5.22386-.5.5 0 .2761.2239.5.5.5h10c.2761 0 .5-.2239.5-.5 0-.27614-.2239-.5-.5-.5h-10ZM9 14c-.55228 0-1 .4477-1 1v8c0 .5523.44772 1 1 1h14c.5523 0 1-.4477 1-1v-8c0-.5523-.4477-1-1-1H9Zm6 2.5c0 .8284-.6716 1.5-1.5 1.5s-1.5-.6716-1.5-1.5.6716-1.5 1.5-1.5 1.5.6716 1.5 1.5Zm0 5.5-1-1-2 2h8v-1.8L18 19l-3 3Z",
|
|
16
|
-
fill: "
|
|
16
|
+
fill: "currentColor"
|
|
17
17
|
}));
|
|
18
18
|
};
|
|
19
19
|
|
|
@@ -13,7 +13,7 @@ const IconInlineGlyph = props => {
|
|
|
13
13
|
fillRule: "evenodd",
|
|
14
14
|
clipRule: "evenodd",
|
|
15
15
|
d: "M8 12c-1.10457 0-2 .8954-2 2v4c0 1.1046.89543 2 2 2h16c1.1046 0 2-.8954 2-2v-4c0-1.1046-.8954-2-2-2H8Zm0 3c0-.5523.44772-1 1-1h2c.5523 0 1 .4477 1 1v2c0 .5523-.4477 1-1 1H9c-.55228 0-1-.4477-1-1v-2Zm5 1c0-.2761.2239-.5.5-.5h10c.2761 0 .5.2239.5.5s-.2239.5-.5.5h-10c-.2761 0-.5-.2239-.5-.5Z",
|
|
16
|
-
fill: "
|
|
16
|
+
fill: "currentColor"
|
|
17
17
|
}));
|
|
18
18
|
};
|
|
19
19
|
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { messages } from '../messages';
|
|
2
|
+
import { IconCard } from './assets/card';
|
|
3
|
+
import { IconEmbed } from './assets/embed';
|
|
4
|
+
import { IconInline } from './assets/inline';
|
|
5
|
+
import { IconUrl } from './assets/url';
|
|
6
|
+
const appearancePropsMap = {
|
|
7
|
+
url: {
|
|
8
|
+
title: messages.urlTitle,
|
|
9
|
+
icon: IconUrl
|
|
10
|
+
},
|
|
11
|
+
inline: {
|
|
12
|
+
title: messages.inlineTitle,
|
|
13
|
+
icon: IconInline
|
|
14
|
+
},
|
|
15
|
+
block: {
|
|
16
|
+
title: messages.blockTitle,
|
|
17
|
+
icon: IconCard
|
|
18
|
+
},
|
|
19
|
+
embed: {
|
|
20
|
+
title: messages.embedTitle,
|
|
21
|
+
icon: IconEmbed
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
export const getButtonGroupOption = (intl, dispatchCommand, {
|
|
25
|
+
disabled,
|
|
26
|
+
onClick,
|
|
27
|
+
selected,
|
|
28
|
+
appearance,
|
|
29
|
+
testId,
|
|
30
|
+
tooltip
|
|
31
|
+
}) => {
|
|
32
|
+
const {
|
|
33
|
+
title,
|
|
34
|
+
icon
|
|
35
|
+
} = appearancePropsMap[appearance !== null && appearance !== void 0 ? appearance : 'url'];
|
|
36
|
+
return {
|
|
37
|
+
title: intl.formatMessage(title),
|
|
38
|
+
icon,
|
|
39
|
+
onClick: () => dispatchCommand(onClick),
|
|
40
|
+
disabled: Boolean(disabled),
|
|
41
|
+
tooltipContent: tooltip || null,
|
|
42
|
+
testId,
|
|
43
|
+
selected
|
|
44
|
+
};
|
|
45
|
+
};
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { messages } from '../messages';
|
|
2
|
+
import { IconCard } from './assets/card';
|
|
3
|
+
import { IconEmbed } from './assets/embed';
|
|
4
|
+
import { IconInline } from './assets/inline';
|
|
5
|
+
import { IconUrl } from './assets/url';
|
|
6
|
+
const appearancePropsMap = {
|
|
7
|
+
url: {
|
|
8
|
+
title: messages.urlTitle,
|
|
9
|
+
description: messages.urlDescription,
|
|
10
|
+
icon: IconUrl
|
|
11
|
+
},
|
|
12
|
+
inline: {
|
|
13
|
+
title: messages.inlineTitle,
|
|
14
|
+
description: messages.inlineDescription,
|
|
15
|
+
icon: IconInline
|
|
16
|
+
},
|
|
17
|
+
block: {
|
|
18
|
+
title: messages.blockTitle,
|
|
19
|
+
description: messages.blockDescription,
|
|
20
|
+
icon: IconCard
|
|
21
|
+
},
|
|
22
|
+
embed: {
|
|
23
|
+
title: messages.embedTitle,
|
|
24
|
+
description: messages.embedDescription,
|
|
25
|
+
icon: IconEmbed
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
export const getIconDropdownOption = (intl, dispatchCommand, {
|
|
29
|
+
disabled,
|
|
30
|
+
onClick,
|
|
31
|
+
selected,
|
|
32
|
+
appearance,
|
|
33
|
+
testId,
|
|
34
|
+
tooltip
|
|
35
|
+
}) => {
|
|
36
|
+
const {
|
|
37
|
+
title,
|
|
38
|
+
description,
|
|
39
|
+
icon
|
|
40
|
+
} = appearancePropsMap[appearance !== null && appearance !== void 0 ? appearance : 'url'];
|
|
41
|
+
return {
|
|
42
|
+
title: intl.formatMessage(title),
|
|
43
|
+
description: intl.formatMessage(description),
|
|
44
|
+
icon,
|
|
45
|
+
onClick: () => dispatchCommand(onClick),
|
|
46
|
+
selected: Boolean(selected),
|
|
47
|
+
disabled: Boolean(disabled),
|
|
48
|
+
tooltipContent: tooltip,
|
|
49
|
+
testId
|
|
50
|
+
};
|
|
51
|
+
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { css } from '@emotion/react';
|
|
2
2
|
export const embedCardStyles = css`
|
|
3
3
|
.ProseMirror {
|
|
4
4
|
.embedCardView-content-wrap[layout^='wrap-'] {
|
|
@@ -19,6 +19,6 @@ export const embedCardStyles = css`
|
|
|
19
19
|
}
|
|
20
20
|
}
|
|
21
21
|
`;
|
|
22
|
-
export const
|
|
22
|
+
export const embedSpacingStyles = css`
|
|
23
23
|
margin: 0 10px;
|
|
24
24
|
`;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|