@atlaskit/editor-core 172.0.5 → 172.1.2
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 +56 -0
- package/dist/cjs/create-editor/ReactEditorView.js +11 -2
- package/dist/cjs/create-editor/ReactEditorViewContext.js +15 -0
- package/dist/cjs/create-editor/create-plugins-list.js +2 -1
- package/dist/cjs/editor.js +7 -1
- package/dist/cjs/labs/next/mobile.js +5 -3
- package/dist/cjs/messages.js +5 -0
- package/dist/cjs/plugins/analytics/types/enums.js +1 -0
- package/dist/cjs/plugins/block-type/ui/ToolbarBlockType/styled.js +1 -1
- package/dist/cjs/plugins/card/nodeviews/inlineCard.js +8 -0
- package/dist/cjs/plugins/card/pm-plugins/doc.js +2 -26
- package/dist/cjs/plugins/card/toolbar.js +118 -86
- package/dist/cjs/plugins/code-block/nodeviews/code-block.js +9 -2
- package/dist/cjs/plugins/code-block/pm-plugins/ide-ux.js +37 -1
- package/dist/cjs/plugins/code-block/toolbar.js +3 -1
- package/dist/cjs/plugins/code-block/ui/class-names.js +2 -0
- package/dist/cjs/plugins/feature-flags-context/feature-flags-from-props.js +4 -3
- package/dist/cjs/plugins/floating-toolbar/ui/EmojiPickerButton.js +3 -1
- package/dist/cjs/plugins/floating-toolbar/ui/Toolbar.js +42 -2
- package/dist/cjs/plugins/hyperlink/Toolbar.js +43 -8
- package/dist/cjs/plugins/media/commands/helpers.js +1 -8
- package/dist/cjs/plugins/media/index.js +1 -1
- package/dist/cjs/plugins/media/nodeviews/mediaNodeView/index.js +0 -10
- package/dist/cjs/plugins/media/nodeviews/mediaNodeView/media.js +2 -3
- package/dist/cjs/plugins/media/nodeviews/mediaSingle.js +10 -0
- package/dist/cjs/plugins/media/picker-facade.js +1 -0
- package/dist/cjs/plugins/media/pm-plugins/main.js +3 -13
- package/dist/cjs/plugins/panel/pm-plugins/keymaps.js +1 -1
- package/dist/cjs/plugins/paste/handlers.js +9 -20
- package/dist/cjs/plugins/paste/md.js +8 -2
- package/dist/cjs/plugins/paste/newline-md-plugin.js +67 -0
- package/dist/cjs/plugins/paste/paragraph-md-plugin.js +72 -0
- package/dist/cjs/plugins/table/commands/hover.js +4 -4
- package/dist/cjs/plugins/table/ui/TableFloatingControls/CornerControls/index.js +2 -1
- package/dist/cjs/plugins/table/ui/common-styles.js +1 -1
- package/dist/cjs/plugins/table/utils/decoration.js +53 -3
- package/dist/cjs/plugins/tasks-and-decisions/nodeviews/taskItem.js +1 -0
- package/dist/cjs/plugins/type-ahead/ui/InputQuery.js +3 -2
- package/dist/cjs/plugins/type-ahead/ui/TypeAheadList.js +78 -53
- package/dist/cjs/plugins/type-ahead/ui/TypeAheadPopup.js +1 -1
- package/dist/cjs/ui/Addon/ClickAreaBlock/index.js +7 -2
- package/dist/cjs/ui/Addon/ClickAreaMobile/index.js +8 -2
- package/dist/cjs/ui/Appearance/Comment/Comment.js +13 -13
- package/dist/cjs/ui/Appearance/FullPage/FullPage.js +8 -7
- package/dist/cjs/ui/Appearance/FullPage/FullPageContentArea.js +2 -1
- package/dist/cjs/ui/Appearance/Mobile.js +4 -2
- package/dist/cjs/ui/AppearanceComponents/Mobile.js +5 -4
- package/dist/cjs/ui/DropList/index.js +1 -1
- package/dist/cjs/ui/DropdownMenu/index.js +5 -5
- package/dist/cjs/ui/with-outer-listeners.js +105 -50
- package/dist/cjs/utils/deprecation-warnings.js +4 -0
- package/dist/cjs/utils/linking-utils.js +40 -1
- package/dist/cjs/version-wrapper.js +1 -1
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/create-editor/ReactEditorView.js +11 -2
- package/dist/es2019/create-editor/ReactEditorViewContext.js +3 -0
- package/dist/es2019/create-editor/create-plugins-list.js +2 -1
- package/dist/es2019/editor.js +7 -1
- package/dist/es2019/labs/next/mobile.js +5 -3
- package/dist/es2019/messages.js +5 -0
- package/dist/es2019/plugins/analytics/types/enums.js +1 -0
- package/dist/es2019/plugins/block-type/ui/ToolbarBlockType/styled.js +1 -1
- package/dist/es2019/plugins/card/nodeviews/inlineCard.js +10 -0
- package/dist/es2019/plugins/card/pm-plugins/doc.js +1 -24
- package/dist/es2019/plugins/card/toolbar.js +114 -86
- package/dist/es2019/plugins/code-block/nodeviews/code-block.js +9 -2
- package/dist/es2019/plugins/code-block/pm-plugins/ide-ux.js +40 -2
- package/dist/es2019/plugins/code-block/toolbar.js +2 -1
- package/dist/es2019/plugins/code-block/ui/class-names.js +2 -0
- package/dist/es2019/plugins/feature-flags-context/feature-flags-from-props.js +4 -3
- package/dist/es2019/plugins/floating-toolbar/ui/EmojiPickerButton.js +3 -2
- package/dist/es2019/plugins/floating-toolbar/ui/Toolbar.js +37 -0
- package/dist/es2019/plugins/hyperlink/Toolbar.js +40 -9
- package/dist/es2019/plugins/media/commands/helpers.js +0 -2
- package/dist/es2019/plugins/media/index.js +1 -1
- package/dist/es2019/plugins/media/nodeviews/mediaNodeView/index.js +0 -7
- package/dist/es2019/plugins/media/nodeviews/mediaNodeView/media.js +2 -3
- package/dist/es2019/plugins/media/nodeviews/mediaSingle.js +10 -0
- package/dist/es2019/plugins/media/picker-facade.js +1 -0
- package/dist/es2019/plugins/media/pm-plugins/main.js +3 -13
- package/dist/es2019/plugins/panel/pm-plugins/keymaps.js +1 -1
- package/dist/es2019/plugins/paste/handlers.js +7 -19
- package/dist/es2019/plugins/paste/md.js +6 -2
- package/dist/es2019/plugins/paste/newline-md-plugin.js +56 -0
- package/dist/es2019/plugins/paste/paragraph-md-plugin.js +61 -0
- package/dist/es2019/plugins/table/commands/hover.js +4 -4
- package/dist/es2019/plugins/table/ui/TableFloatingControls/CornerControls/index.js +2 -1
- package/dist/es2019/plugins/table/ui/common-styles.js +39 -0
- package/dist/es2019/plugins/table/utils/decoration.js +60 -24
- package/dist/es2019/plugins/tasks-and-decisions/nodeviews/taskItem.js +1 -0
- package/dist/es2019/plugins/type-ahead/ui/InputQuery.js +4 -3
- package/dist/es2019/plugins/type-ahead/ui/TypeAheadList.js +78 -59
- package/dist/es2019/plugins/type-ahead/ui/TypeAheadPopup.js +2 -2
- package/dist/es2019/ui/Addon/ClickAreaBlock/index.js +6 -2
- package/dist/es2019/ui/Addon/ClickAreaMobile/index.js +7 -2
- package/dist/es2019/ui/Appearance/Comment/Comment.js +12 -6
- package/dist/es2019/ui/Appearance/FullPage/FullPage.js +7 -2
- package/dist/es2019/ui/Appearance/FullPage/FullPageContentArea.js +2 -1
- package/dist/es2019/ui/Appearance/Mobile.js +4 -2
- package/dist/es2019/ui/AppearanceComponents/Mobile.js +5 -4
- package/dist/es2019/ui/DropList/index.js +1 -1
- package/dist/es2019/ui/DropdownMenu/index.js +10 -6
- package/dist/es2019/ui/with-outer-listeners.js +83 -33
- package/dist/es2019/utils/deprecation-warnings.js +4 -0
- package/dist/es2019/utils/linking-utils.js +37 -0
- package/dist/es2019/version-wrapper.js +1 -1
- package/dist/es2019/version.json +1 -1
- package/dist/esm/create-editor/ReactEditorView.js +11 -2
- package/dist/esm/create-editor/ReactEditorViewContext.js +3 -0
- package/dist/esm/create-editor/create-plugins-list.js +2 -1
- package/dist/esm/editor.js +7 -1
- package/dist/esm/labs/next/mobile.js +5 -3
- package/dist/esm/messages.js +5 -0
- package/dist/esm/plugins/analytics/types/enums.js +1 -0
- package/dist/esm/plugins/block-type/ui/ToolbarBlockType/styled.js +1 -1
- package/dist/esm/plugins/card/nodeviews/inlineCard.js +9 -0
- package/dist/esm/plugins/card/pm-plugins/doc.js +1 -20
- package/dist/esm/plugins/card/toolbar.js +108 -83
- package/dist/esm/plugins/code-block/nodeviews/code-block.js +9 -2
- package/dist/esm/plugins/code-block/pm-plugins/ide-ux.js +37 -2
- package/dist/esm/plugins/code-block/toolbar.js +2 -1
- package/dist/esm/plugins/code-block/ui/class-names.js +2 -0
- package/dist/esm/plugins/feature-flags-context/feature-flags-from-props.js +4 -3
- package/dist/esm/plugins/floating-toolbar/ui/EmojiPickerButton.js +3 -2
- package/dist/esm/plugins/floating-toolbar/ui/Toolbar.js +41 -2
- package/dist/esm/plugins/hyperlink/Toolbar.js +43 -10
- package/dist/esm/plugins/media/commands/helpers.js +0 -4
- package/dist/esm/plugins/media/index.js +1 -1
- package/dist/esm/plugins/media/nodeviews/mediaNodeView/index.js +0 -8
- package/dist/esm/plugins/media/nodeviews/mediaNodeView/media.js +2 -3
- package/dist/esm/plugins/media/nodeviews/mediaSingle.js +10 -0
- package/dist/esm/plugins/media/picker-facade.js +1 -0
- package/dist/esm/plugins/media/pm-plugins/main.js +3 -15
- package/dist/esm/plugins/panel/pm-plugins/keymaps.js +1 -1
- package/dist/esm/plugins/paste/handlers.js +11 -22
- package/dist/esm/plugins/paste/md.js +6 -2
- package/dist/esm/plugins/paste/newline-md-plugin.js +58 -0
- package/dist/esm/plugins/paste/paragraph-md-plugin.js +63 -0
- package/dist/esm/plugins/table/commands/hover.js +4 -4
- package/dist/esm/plugins/table/ui/TableFloatingControls/CornerControls/index.js +2 -1
- package/dist/esm/plugins/table/ui/common-styles.js +1 -1
- package/dist/esm/plugins/table/utils/decoration.js +50 -3
- package/dist/esm/plugins/tasks-and-decisions/nodeviews/taskItem.js +1 -0
- package/dist/esm/plugins/type-ahead/ui/InputQuery.js +4 -3
- package/dist/esm/plugins/type-ahead/ui/TypeAheadList.js +77 -51
- package/dist/esm/plugins/type-ahead/ui/TypeAheadPopup.js +2 -2
- package/dist/esm/ui/Addon/ClickAreaBlock/index.js +7 -2
- package/dist/esm/ui/Addon/ClickAreaMobile/index.js +8 -2
- package/dist/esm/ui/Appearance/Comment/Comment.js +12 -12
- package/dist/esm/ui/Appearance/FullPage/FullPage.js +7 -6
- package/dist/esm/ui/Appearance/FullPage/FullPageContentArea.js +2 -1
- package/dist/esm/ui/Appearance/Mobile.js +4 -2
- package/dist/esm/ui/AppearanceComponents/Mobile.js +5 -4
- package/dist/esm/ui/DropList/index.js +1 -1
- package/dist/esm/ui/DropdownMenu/index.js +5 -5
- package/dist/esm/ui/with-outer-listeners.js +105 -51
- package/dist/esm/utils/deprecation-warnings.js +4 -0
- package/dist/esm/utils/linking-utils.js +37 -0
- package/dist/esm/version-wrapper.js +1 -1
- package/dist/esm/version.json +1 -1
- package/dist/types/create-editor/ReactEditorView.d.ts +3 -0
- package/dist/types/create-editor/ReactEditorViewContext.d.ts +8 -0
- package/dist/types/messages.d.ts +5 -0
- package/dist/types/plugins/analytics/types/enums.d.ts +1 -0
- package/dist/types/plugins/analytics/types/events.d.ts +2 -2
- package/dist/types/plugins/analytics/types/link-tool-bar-events.d.ts +1 -0
- package/dist/types/plugins/card/nodeviews/inlineCard.d.ts +3 -0
- package/dist/types/plugins/card/pm-plugins/doc.d.ts +1 -2
- package/dist/types/plugins/card/toolbar.d.ts +1 -0
- package/dist/types/plugins/card/ui/ResizableEmbedCard.d.ts +1 -1
- package/dist/types/plugins/code-block/pm-plugins/ide-ux.d.ts +4 -1
- package/dist/types/plugins/code-block/ui/class-names.d.ts +2 -0
- package/dist/types/plugins/hyperlink/types.d.ts +1 -0
- package/dist/types/plugins/media/commands/helpers.d.ts +0 -1
- package/dist/types/plugins/media/nodeviews/mediaNodeView/index.d.ts +0 -1
- package/dist/types/plugins/media/nodeviews/mediaNodeView/media.d.ts +0 -1
- package/dist/types/plugins/media/pm-plugins/main.d.ts +0 -2
- package/dist/types/plugins/media/pm-plugins/types.d.ts +0 -2
- package/dist/types/plugins/media/ui/ResizableMediaSingle/index.d.ts +1 -1
- package/dist/types/plugins/paste/newline-md-plugin.d.ts +2 -0
- package/dist/types/plugins/paste/paragraph-md-plugin.d.ts +2 -0
- package/dist/types/plugins/table/utils/decoration.d.ts +1 -1
- package/dist/types/types/editor-appearance-component.d.ts +1 -0
- package/dist/types/types/feature-flags.d.ts +9 -0
- package/dist/types/ui/Addon/ClickAreaBlock/index.d.ts +1 -0
- package/dist/types/ui/Addon/ClickAreaMobile/index.d.ts +1 -0
- package/dist/types/ui/Appearance/FullPage/FullPage.d.ts +1 -0
- package/dist/types/ui/Appearance/FullPage/StyledComponents.d.ts +3 -3
- package/dist/types/ui/Appearance/Mobile.d.ts +1 -1
- package/dist/types/ui/AppearanceComponents/Mobile.d.ts +2 -1
- package/dist/types/ui/ContentStyles/index.d.ts +2 -2
- package/dist/types/ui/Dropdown/index.d.ts +1 -1
- package/dist/types/ui/with-outer-listeners.d.ts +2 -1
- package/dist/types/utils/linking-utils.d.ts +1 -0
- package/package.json +39 -41
- package/dist/cjs/plugins/type-ahead/ui/DynamicHeightListItem.js +0 -77
- package/dist/cjs/plugins/type-ahead/ui/hooks/use-dynamic-list-height-calculation.js +0 -118
- package/dist/cjs/plugins/type-ahead/ui/hooks/use-resize-observer.js +0 -70
- package/dist/es2019/plugins/type-ahead/ui/DynamicHeightListItem.js +0 -51
- package/dist/es2019/plugins/type-ahead/ui/hooks/use-dynamic-list-height-calculation.js +0 -97
- package/dist/es2019/plugins/type-ahead/ui/hooks/use-resize-observer.js +0 -53
- package/dist/esm/plugins/type-ahead/ui/DynamicHeightListItem.js +0 -51
- package/dist/esm/plugins/type-ahead/ui/hooks/use-dynamic-list-height-calculation.js +0 -101
- package/dist/esm/plugins/type-ahead/ui/hooks/use-resize-observer.js +0 -48
- package/dist/types/plugins/type-ahead/ui/DynamicHeightListItem.d.ts +0 -21
- package/dist/types/plugins/type-ahead/ui/hooks/use-dynamic-list-height-calculation.d.ts +0 -25
- package/dist/types/plugins/type-ahead/ui/hooks/use-resize-observer.d.ts +0 -8
|
@@ -8,6 +8,8 @@ exports.codeBlockClassNames = void 0;
|
|
|
8
8
|
var _styles = require("@atlaskit/editor-common/styles");
|
|
9
9
|
|
|
10
10
|
var codeBlockClassNames = {
|
|
11
|
+
start: _styles.CodeBlockSharedCssClassName.CODEBLOCK_START,
|
|
12
|
+
end: _styles.CodeBlockSharedCssClassName.CODEBLOCK_END,
|
|
11
13
|
gutter: _styles.CodeBlockSharedCssClassName.CODEBLOCK_LINE_NUMBER_GUTTER,
|
|
12
14
|
content: _styles.CodeBlockSharedCssClassName.CODEBLOCK_CONTENT
|
|
13
15
|
};
|
|
@@ -43,7 +43,7 @@ function getSpellCheck(featureFlags) {
|
|
|
43
43
|
|
|
44
44
|
|
|
45
45
|
function createFeatureFlagsFromProps(props) {
|
|
46
|
-
var _props$allowTextColor, _props$allowLayouts, _props$performanceTra, _props$performanceTra2, _props$featureFlags, _props$featureFlags2, _props$allowTables, _props$featureFlags3, _props$featureFlags4, _props$allowTables2, _props$featureFlags5, _props$featureFlags6, _props$allowTables3, _props$featureFlags7, _props$featureFlags8, _props$allowTables4, _props$featureFlags9, _props$featureFlags10, _props$
|
|
46
|
+
var _props$allowTextColor, _props$allowLayouts, _props$performanceTra, _props$performanceTra2, _props$featureFlags, _props$featureFlags2, _props$allowTables, _props$featureFlags3, _props$featureFlags4, _props$allowTables2, _props$featureFlags5, _props$featureFlags6, _props$allowTables3, _props$featureFlags7, _props$featureFlags8, _props$allowTables4, _props$allowTables5, _props$featureFlags9, _props$featureFlags10, _props$allowTables6, _props$allowExtension, _props$featureFlags11, _props$featureFlags12, _props$featureFlags13, _props$featureFlags14, _props$featureFlags15, _props$featureFlags16, _props$featureFlags17, _props$featureFlags18, _props$featureFlags19, _props$featureFlags20, _props$featureFlags21, _props$featureFlags22, _props$featureFlags23, _props$featureFlags24, _props$featureFlags25, _props$featureFlags26, _props$featureFlags27, _props$featureFlags28, _props$featureFlags29, _props$featureFlags30, _props$collabEdit, _props$collabEdit2, _props$featureFlags31, _props$featureFlags32, _props$featureFlags33, _props$featureFlags34, _props$featureFlags35, _props$featureFlags36, _props$featureFlags37, _props$featureFlags38, _props$featureFlags39;
|
|
47
47
|
|
|
48
48
|
var normalizedFeatureFlags = (0, _normalizeFeatureFlags.normalizeFeatureFlags)(props.featureFlags);
|
|
49
49
|
return _objectSpread(_objectSpread({}, normalizedFeatureFlags), {}, {
|
|
@@ -62,8 +62,8 @@ function createFeatureFlagsFromProps(props) {
|
|
|
62
62
|
stickyHeadersOptimization: typeof ((_props$featureFlags = props.featureFlags) === null || _props$featureFlags === void 0 ? void 0 : _props$featureFlags.stickyHeadersOptimization) === 'boolean' ? !!((_props$featureFlags2 = props.featureFlags) !== null && _props$featureFlags2 !== void 0 && _props$featureFlags2.stickyHeadersOptimization) : (0, _typeof2.default)(props.allowTables) === 'object' && !!((_props$allowTables = props.allowTables) !== null && _props$allowTables !== void 0 && _props$allowTables.stickyHeadersOptimization),
|
|
63
63
|
initialRenderOptimization: typeof ((_props$featureFlags3 = props.featureFlags) === null || _props$featureFlags3 === void 0 ? void 0 : _props$featureFlags3.initialRenderOptimization) === 'boolean' ? !!((_props$featureFlags4 = props.featureFlags) !== null && _props$featureFlags4 !== void 0 && _props$featureFlags4.initialRenderOptimization) : (0, _typeof2.default)(props.allowTables) === 'object' && !!((_props$allowTables2 = props.allowTables) !== null && _props$allowTables2 !== void 0 && _props$allowTables2.initialRenderOptimization),
|
|
64
64
|
mouseMoveOptimization: typeof ((_props$featureFlags5 = props.featureFlags) === null || _props$featureFlags5 === void 0 ? void 0 : _props$featureFlags5.mouseMoveOptimization) === 'boolean' ? !!((_props$featureFlags6 = props.featureFlags) !== null && _props$featureFlags6 !== void 0 && _props$featureFlags6.mouseMoveOptimization) : (0, _typeof2.default)(props.allowTables) === 'object' && !!((_props$allowTables3 = props.allowTables) !== null && _props$allowTables3 !== void 0 && _props$allowTables3.mouseMoveOptimization),
|
|
65
|
-
tableRenderOptimization: typeof ((_props$featureFlags7 = props.featureFlags) === null || _props$featureFlags7 === void 0 ? void 0 : _props$featureFlags7.tableRenderOptimization) === 'boolean' ? !!((_props$featureFlags8 = props.featureFlags) !== null && _props$featureFlags8 !== void 0 && _props$featureFlags8.tableRenderOptimization) : (0, _typeof2.default)(props.allowTables) === 'object' &&
|
|
66
|
-
tableOverflowShadowsOptimization: typeof ((_props$featureFlags9 = props.featureFlags) === null || _props$featureFlags9 === void 0 ? void 0 : _props$featureFlags9.tableOverflowShadowsOptimization) === 'boolean' ? !!((_props$featureFlags10 = props.featureFlags) !== null && _props$featureFlags10 !== void 0 && _props$featureFlags10.tableOverflowShadowsOptimization) : (0, _typeof2.default)(props.allowTables) === 'object' && !!((_props$
|
|
65
|
+
tableRenderOptimization: typeof ((_props$featureFlags7 = props.featureFlags) === null || _props$featureFlags7 === void 0 ? void 0 : _props$featureFlags7.tableRenderOptimization) === 'boolean' ? !!((_props$featureFlags8 = props.featureFlags) !== null && _props$featureFlags8 !== void 0 && _props$featureFlags8.tableRenderOptimization) : (0, _typeof2.default)(props.allowTables) === 'object' && typeof ((_props$allowTables4 = props.allowTables) === null || _props$allowTables4 === void 0 ? void 0 : _props$allowTables4.tableRenderOptimization) === 'boolean' ? (_props$allowTables5 = props.allowTables) === null || _props$allowTables5 === void 0 ? void 0 : _props$allowTables5.tableRenderOptimization : true,
|
|
66
|
+
tableOverflowShadowsOptimization: typeof ((_props$featureFlags9 = props.featureFlags) === null || _props$featureFlags9 === void 0 ? void 0 : _props$featureFlags9.tableOverflowShadowsOptimization) === 'boolean' ? !!((_props$featureFlags10 = props.featureFlags) !== null && _props$featureFlags10 !== void 0 && _props$featureFlags10.tableOverflowShadowsOptimization) : (0, _typeof2.default)(props.allowTables) === 'object' && !!((_props$allowTables6 = props.allowTables) !== null && _props$allowTables6 !== void 0 && _props$allowTables6.tableOverflowShadowsOptimization),
|
|
67
67
|
extendFloatingToolbar: Boolean((0, _typeof2.default)(props.allowExtension) === 'object' && ((_props$allowExtension = props.allowExtension) === null || _props$allowExtension === void 0 ? void 0 : _props$allowExtension.allowExtendFloatingToolbars)),
|
|
68
68
|
useUnpredictableInputRule: Boolean(typeof ((_props$featureFlags11 = props.featureFlags) === null || _props$featureFlags11 === void 0 ? void 0 : _props$featureFlags11.useUnpredictableInputRule) === 'boolean' ? !!((_props$featureFlags12 = props.featureFlags) !== null && _props$featureFlags12 !== void 0 && _props$featureFlags12.useUnpredictableInputRule) : props.UNSAFE_allowUndoRedoButtons ? false : true),
|
|
69
69
|
showAvatarGroupAsPlugin: Boolean(typeof ((_props$featureFlags13 = props.featureFlags) === null || _props$featureFlags13 === void 0 ? void 0 : _props$featureFlags13.showAvatarGroupAsPlugin) === 'boolean' ? !!((_props$featureFlags14 = props.featureFlags) !== null && _props$featureFlags14 !== void 0 && _props$featureFlags14.showAvatarGroupAsPlugin) : false),
|
|
@@ -81,6 +81,7 @@ function createFeatureFlagsFromProps(props) {
|
|
|
81
81
|
showHoverPreview: Boolean(typeof ((_props$featureFlags33 = props.featureFlags) === null || _props$featureFlags33 === void 0 ? void 0 : _props$featureFlags33.showHoverPreview) === 'boolean' ? !!((_props$featureFlags34 = props.featureFlags) !== null && _props$featureFlags34 !== void 0 && _props$featureFlags34.showHoverPreview) : false),
|
|
82
82
|
indentationButtonsInTheToolbar: Boolean(typeof normalizedFeatureFlags.indentationButtonsInTheToolbar === 'boolean' && !!normalizedFeatureFlags.indentationButtonsInTheToolbar || (typeof ((_props$featureFlags35 = props.featureFlags) === null || _props$featureFlags35 === void 0 ? void 0 : _props$featureFlags35.indentationButtonsInTheToolbar) === 'boolean' ? !!((_props$featureFlags36 = props.featureFlags) !== null && _props$featureFlags36 !== void 0 && _props$featureFlags36.indentationButtonsInTheToolbar) : false)),
|
|
83
83
|
floatingToolbarCopyButton: Boolean(typeof normalizedFeatureFlags.floatingToolbarCopyButton === 'boolean' && !!normalizedFeatureFlags.floatingToolbarCopyButton || (typeof ((_props$featureFlags37 = props.featureFlags) === null || _props$featureFlags37 === void 0 ? void 0 : _props$featureFlags37.floatingToolbarCopyButton) === 'boolean' ? !!((_props$featureFlags38 = props.featureFlags) !== null && _props$featureFlags38 !== void 0 && _props$featureFlags38.floatingToolbarCopyButton) : false)),
|
|
84
|
+
floatingToolbarLinkSettingsButton: typeof ((_props$featureFlags39 = props.featureFlags) === null || _props$featureFlags39 === void 0 ? void 0 : _props$featureFlags39['floating-toolbar-link-settings-button']) === 'string' ? props.featureFlags['floating-toolbar-link-settings-button'] || undefined : undefined,
|
|
84
85
|
disableSpellcheckByBrowser: getSpellCheck(props.featureFlags)
|
|
85
86
|
});
|
|
86
87
|
}
|
|
@@ -27,6 +27,8 @@ var _tooltip = _interopRequireDefault(require("@atlaskit/tooltip"));
|
|
|
27
27
|
|
|
28
28
|
var _EditorEmojiAddIcon = _interopRequireDefault(require("./EditorEmojiAddIcon"));
|
|
29
29
|
|
|
30
|
+
var _withOuterListeners = _interopRequireDefault(require("../../../ui/with-outer-listeners"));
|
|
31
|
+
|
|
30
32
|
var _templateObject, _templateObject2;
|
|
31
33
|
|
|
32
34
|
// helps adjusts position of popup
|
|
@@ -44,7 +46,7 @@ var EmojiPickerButton = function EmojiPickerButton(props) {
|
|
|
44
46
|
isPopupOpen = _React$useState2[0],
|
|
45
47
|
setIsPopupOpen = _React$useState2[1];
|
|
46
48
|
|
|
47
|
-
var EmojiPickerWithListener = (0,
|
|
49
|
+
var EmojiPickerWithListener = (0, _withOuterListeners.default)(_emoji.EmojiPicker);
|
|
48
50
|
|
|
49
51
|
var togglePopup = function togglePopup() {
|
|
50
52
|
setIsPopupOpen(!isPopupOpen);
|
|
@@ -63,6 +63,8 @@ var _messages = _interopRequireDefault(require("./messages"));
|
|
|
63
63
|
|
|
64
64
|
var _tokens = require("@atlaskit/tokens");
|
|
65
65
|
|
|
66
|
+
var _decoration = require("../../base/pm-plugins/decoration");
|
|
67
|
+
|
|
66
68
|
var _templateObject, _templateObject2;
|
|
67
69
|
|
|
68
70
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
@@ -175,6 +177,44 @@ var Toolbar = /*#__PURE__*/function (_Component) {
|
|
|
175
177
|
}
|
|
176
178
|
|
|
177
179
|
(0, _createClass2.default)(Toolbar, [{
|
|
180
|
+
key: "resetStyling",
|
|
181
|
+
value: // remove any decorations added by toolbar buttons i.e danger and selected styling
|
|
182
|
+
// this prevents https://product-fabric.atlassian.net/browse/ED-10207
|
|
183
|
+
function resetStyling(_ref) {
|
|
184
|
+
var table = _ref.table;
|
|
185
|
+
|
|
186
|
+
if (this.props.editorView) {
|
|
187
|
+
var _this$props$editorVie = this.props.editorView,
|
|
188
|
+
state = _this$props$editorVie.state,
|
|
189
|
+
dispatch = _this$props$editorVie.dispatch; // tables use their own decorations
|
|
190
|
+
// TODO fix for tables https://product-fabric.atlassian.net/jira/servicedesk/projects/DTR/queues/issue/DTR-617
|
|
191
|
+
|
|
192
|
+
if (table) {
|
|
193
|
+
return null;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
dispatch(state.tr.setMeta(_decoration.decorationStateKey, {
|
|
197
|
+
action: _decoration.ACTIONS.DECORATION_REMOVE
|
|
198
|
+
}));
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
}, {
|
|
202
|
+
key: "componentDidUpdate",
|
|
203
|
+
value: function componentDidUpdate(prevProps) {
|
|
204
|
+
if (this.props.node !== prevProps.node) {
|
|
205
|
+
this.resetStyling({
|
|
206
|
+
table: (prevProps === null || prevProps === void 0 ? void 0 : prevProps.node.type.name) === 'table'
|
|
207
|
+
});
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
}, {
|
|
211
|
+
key: "componentWillUnmount",
|
|
212
|
+
value: function componentWillUnmount() {
|
|
213
|
+
this.resetStyling({
|
|
214
|
+
table: this.props.node.type.name === 'table'
|
|
215
|
+
});
|
|
216
|
+
}
|
|
217
|
+
}, {
|
|
178
218
|
key: "render",
|
|
179
219
|
value: function render() {
|
|
180
220
|
var _this$props = this.props,
|
|
@@ -345,8 +385,8 @@ var Toolbar = /*#__PURE__*/function (_Component) {
|
|
|
345
385
|
return null;
|
|
346
386
|
}
|
|
347
387
|
|
|
348
|
-
var
|
|
349
|
-
extendFloatingToolbar =
|
|
388
|
+
var _ref2 = (0, _featureFlagsContext.getFeatureFlags)(editorView.state) || {},
|
|
389
|
+
extendFloatingToolbar = _ref2.extendFloatingToolbar;
|
|
350
390
|
|
|
351
391
|
if (!extendFloatingToolbar) {
|
|
352
392
|
return null;
|
|
@@ -21,6 +21,8 @@ var _HyperlinkAddToolbar = _interopRequireDefault(require("./ui/HyperlinkAddTool
|
|
|
21
21
|
|
|
22
22
|
var _unlink = _interopRequireDefault(require("@atlaskit/icon/glyph/editor/unlink"));
|
|
23
23
|
|
|
24
|
+
var _settings = _interopRequireDefault(require("@atlaskit/icon/glyph/editor/settings"));
|
|
25
|
+
|
|
24
26
|
var _shortcut = _interopRequireDefault(require("@atlaskit/icon/glyph/shortcut"));
|
|
25
27
|
|
|
26
28
|
var _utils = require("./utils");
|
|
@@ -39,6 +41,8 @@ var _linkingUtils = require("../../utils/linking-utils");
|
|
|
39
41
|
|
|
40
42
|
var _toolbar = require("../copy-button/toolbar");
|
|
41
43
|
|
|
44
|
+
var _featureFlagsContext = require("../feature-flags-context");
|
|
45
|
+
|
|
42
46
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
43
47
|
|
|
44
48
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
@@ -48,12 +52,22 @@ function isEditLink(linkMark) {
|
|
|
48
52
|
return linkMark.pos !== undefined;
|
|
49
53
|
}
|
|
50
54
|
|
|
55
|
+
var dispatchAnalytics = function dispatchAnalytics(dispatch, state, analyticsBuilder) {
|
|
56
|
+
if (dispatch) {
|
|
57
|
+
dispatch((0, _analytics.addAnalytics)(state, state.tr, analyticsBuilder(_analytics.ACTION_SUBJECT_ID.HYPERLINK)));
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
|
|
51
61
|
var visitHyperlink = function visitHyperlink() {
|
|
52
62
|
return function (state, dispatch) {
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
63
|
+
dispatchAnalytics(dispatch, state, _linkingUtils.buildVisitedLinkPayload);
|
|
64
|
+
return true;
|
|
65
|
+
};
|
|
66
|
+
};
|
|
56
67
|
|
|
68
|
+
var openLinkSettings = function openLinkSettings() {
|
|
69
|
+
return function (state, dispatch) {
|
|
70
|
+
dispatchAnalytics(dispatch, state, _linkingUtils.buildOpenedSettingsPayload);
|
|
57
71
|
return true;
|
|
58
72
|
};
|
|
59
73
|
};
|
|
@@ -76,6 +90,29 @@ function getLinkText(activeLinkMark, state) {
|
|
|
76
90
|
return activeLinkMark.node.text;
|
|
77
91
|
}
|
|
78
92
|
|
|
93
|
+
var getCopyButtonGroup = function getCopyButtonGroup(state, intl, nodeType) {
|
|
94
|
+
return state && (0, _toolbar.showCopyButton)(state) ? [{
|
|
95
|
+
type: 'separator'
|
|
96
|
+
}, (0, _toolbar.getCopyButtonConfig)(state, intl.formatMessage, nodeType)] : [];
|
|
97
|
+
};
|
|
98
|
+
|
|
99
|
+
var getSettingsButtonGroup = function getSettingsButtonGroup(state, intl) {
|
|
100
|
+
var _getFeatureFlags = (0, _featureFlagsContext.getFeatureFlags)(state),
|
|
101
|
+
floatingToolbarLinkSettingsButton = _getFeatureFlags.floatingToolbarLinkSettingsButton;
|
|
102
|
+
|
|
103
|
+
return floatingToolbarLinkSettingsButton === 'true' ? [{
|
|
104
|
+
type: 'separator'
|
|
105
|
+
}, {
|
|
106
|
+
id: 'editor.link.settings',
|
|
107
|
+
type: 'button',
|
|
108
|
+
icon: _settings.default,
|
|
109
|
+
title: intl.formatMessage(_messages.linkToolbarMessages.settingsLink),
|
|
110
|
+
onClick: openLinkSettings(),
|
|
111
|
+
href: 'https://id.atlassian.com/manage-profile/link-preferences',
|
|
112
|
+
target: '_blank'
|
|
113
|
+
}] : [];
|
|
114
|
+
};
|
|
115
|
+
|
|
79
116
|
var getToolbarConfig = function getToolbarConfig(options) {
|
|
80
117
|
return function (state, intl, providerFactory) {
|
|
81
118
|
var formatMessage = intl.formatMessage;
|
|
@@ -131,8 +168,8 @@ var getToolbarConfig = function getToolbarConfig(options) {
|
|
|
131
168
|
editorView: editorView,
|
|
132
169
|
editorState: state,
|
|
133
170
|
cardOptions: options === null || options === void 0 ? void 0 : options.cardOptions,
|
|
134
|
-
providerFactory: providerFactory
|
|
135
|
-
|
|
171
|
+
providerFactory: providerFactory,
|
|
172
|
+
platform: options === null || options === void 0 ? void 0 : options.platform
|
|
136
173
|
});
|
|
137
174
|
}
|
|
138
175
|
}, {
|
|
@@ -168,9 +205,7 @@ var getToolbarConfig = function getToolbarConfig(options) {
|
|
|
168
205
|
title: labelUnlink,
|
|
169
206
|
icon: _unlink.default,
|
|
170
207
|
tabIndex: null
|
|
171
|
-
}].concat((0, _toConsumableArray2.default)(state
|
|
172
|
-
type: 'separator'
|
|
173
|
-
}, (0, _toolbar.getCopyButtonConfig)(state, intl.formatMessage, hyperLinkToolbar.nodeType)] : []))
|
|
208
|
+
}].concat((0, _toConsumableArray2.default)(getCopyButtonGroup(state, intl, hyperLinkToolbar.nodeType)), (0, _toConsumableArray2.default)(getSettingsButtonGroup(state, intl)))
|
|
174
209
|
});
|
|
175
210
|
}
|
|
176
211
|
|
|
@@ -5,7 +5,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
|
-
exports.updateMediaNodeAttrs = exports.updateAllMediaNodesAttrs = exports.replaceExternalMedia = exports.
|
|
8
|
+
exports.updateMediaNodeAttrs = exports.updateAllMediaNodesAttrs = exports.replaceExternalMedia = exports.isMediaNode = exports.findMediaSingleNode = exports.findMediaNode = exports.findMediaInlineNode = exports.findAllMediaSingleNodes = void 0;
|
|
9
9
|
|
|
10
10
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
11
11
|
|
|
@@ -79,13 +79,6 @@ var findMediaNode = function findMediaNode(mediaPluginState, id, isMediaSingle)
|
|
|
79
79
|
|
|
80
80
|
exports.findMediaNode = findMediaNode;
|
|
81
81
|
|
|
82
|
-
var isMobileUploadCompleted = function isMobileUploadCompleted(mediaPluginState, mediaId) {
|
|
83
|
-
return !!mediaPluginState.mediaOptions && // This flag tells us that it's a 'mobile' env.
|
|
84
|
-
!!mediaPluginState.mediaOptions.allowMarkingUploadsAsIncomplete && typeof mediaPluginState.mobileUploadComplete[mediaId] === 'boolean' ? mediaPluginState.mobileUploadComplete[mediaId] : undefined;
|
|
85
|
-
};
|
|
86
|
-
|
|
87
|
-
exports.isMobileUploadCompleted = isMobileUploadCompleted;
|
|
88
|
-
|
|
89
82
|
var isMediaNode = function isMediaNode(pos, state) {
|
|
90
83
|
var node = state.doc.nodeAt(pos);
|
|
91
84
|
return node && ['media', 'mediaInline'].includes(node.type.name);
|
|
@@ -216,7 +216,7 @@ var mediaPlugin = function mediaPlugin(options) {
|
|
|
216
216
|
title: formatMessage(_messages.messages.filesAndImages),
|
|
217
217
|
description: formatMessage(_messages.messages.filesAndImagesDescription),
|
|
218
218
|
priority: 400,
|
|
219
|
-
keywords: ['attachment', 'gif', 'media', 'picture'],
|
|
219
|
+
keywords: ['attachment', 'gif', 'media', 'picture', 'image', 'video'],
|
|
220
220
|
icon: function icon() {
|
|
221
221
|
return /*#__PURE__*/_react.default.createElement(_assets.IconImages, null);
|
|
222
222
|
},
|
|
@@ -39,10 +39,6 @@ var _WithPluginState = _interopRequireDefault(require("../../../../ui/WithPlugin
|
|
|
39
39
|
|
|
40
40
|
var _width = require("../../../width");
|
|
41
41
|
|
|
42
|
-
var _helpers = require("../../commands/helpers");
|
|
43
|
-
|
|
44
|
-
var _pluginKey = require("../../pm-plugins/plugin-key");
|
|
45
|
-
|
|
46
42
|
var _media = _interopRequireDefault(require("./media"));
|
|
47
43
|
|
|
48
44
|
var _mediaClient = require("@atlaskit/media-client");
|
|
@@ -116,7 +112,6 @@ var MediaNodeView = /*#__PURE__*/function (_SelectionBasedNodeVi) {
|
|
|
116
112
|
url: url,
|
|
117
113
|
mediaProvider: mediaProvider,
|
|
118
114
|
contextIdentifierProvider: contextIdentifierProvider,
|
|
119
|
-
uploadComplete: _this.uploadComplete(),
|
|
120
115
|
mediaOptions: mediaOptions
|
|
121
116
|
});
|
|
122
117
|
};
|
|
@@ -183,11 +178,6 @@ var MediaNodeView = /*#__PURE__*/function (_SelectionBasedNodeVi) {
|
|
|
183
178
|
var attrs = this.getAttrs();
|
|
184
179
|
return (0, _mediaCommon.isMediaBlobUrlFromAttrs)(attrs);
|
|
185
180
|
}
|
|
186
|
-
}, {
|
|
187
|
-
key: "uploadComplete",
|
|
188
|
-
value: function uploadComplete() {
|
|
189
|
-
return (0, _helpers.isMobileUploadCompleted)(_pluginKey.stateKey.getState(this.view.state), this.node.attrs.id);
|
|
190
|
-
}
|
|
191
181
|
}, {
|
|
192
182
|
key: "render",
|
|
193
183
|
value: function render() {
|
|
@@ -141,7 +141,7 @@ var MediaNode = /*#__PURE__*/function (_Component) {
|
|
|
141
141
|
value: function shouldComponentUpdate(nextProps, nextState) {
|
|
142
142
|
var hasNewViewMediaClientConfig = !this.state.viewMediaClientConfig && nextState.viewMediaClientConfig;
|
|
143
143
|
|
|
144
|
-
if (this.props.selected !== nextProps.selected || this.props.
|
|
144
|
+
if (this.props.selected !== nextProps.selected || this.props.node.attrs.id !== nextProps.node.attrs.id || this.props.node.attrs.collection !== nextProps.node.attrs.collection || this.props.maxDimensions.height !== nextProps.maxDimensions.height || this.props.maxDimensions.width !== nextProps.maxDimensions.width || this.props.contextIdentifierProvider !== nextProps.contextIdentifierProvider || this.props.isLoading !== nextProps.isLoading || this.props.mediaProvider !== nextProps.mediaProvider || hasNewViewMediaClientConfig) {
|
|
145
145
|
return true;
|
|
146
146
|
}
|
|
147
147
|
|
|
@@ -210,7 +210,6 @@ var MediaNode = /*#__PURE__*/function (_Component) {
|
|
|
210
210
|
var _this$props = this.props,
|
|
211
211
|
node = _this$props.node,
|
|
212
212
|
selected = _this$props.selected,
|
|
213
|
-
uploadComplete = _this$props.uploadComplete,
|
|
214
213
|
originalDimensions = _this$props.originalDimensions,
|
|
215
214
|
isLoading = _this$props.isLoading,
|
|
216
215
|
maxDimensions = _this$props.maxDimensions,
|
|
@@ -225,7 +224,7 @@ var MediaNode = /*#__PURE__*/function (_Component) {
|
|
|
225
224
|
url = _node$attrs.url,
|
|
226
225
|
alt = _node$attrs.alt;
|
|
227
226
|
|
|
228
|
-
if (isLoading || type !== 'external' &&
|
|
227
|
+
if (isLoading || type !== 'external' && !viewMediaClientConfig) {
|
|
229
228
|
return /*#__PURE__*/_react.default.createElement(_styles.MediaCardWrapper, {
|
|
230
229
|
dimensions: originalDimensions
|
|
231
230
|
}, /*#__PURE__*/_react.default.createElement(_mediaCard.CardLoading, null));
|
|
@@ -286,6 +286,16 @@ var MediaSingleNode = /*#__PURE__*/function (_Component) {
|
|
|
286
286
|
width: width
|
|
287
287
|
}));
|
|
288
288
|
tr.setMeta('scrollIntoView', false);
|
|
289
|
+
/**
|
|
290
|
+
* Any changes to attributes of a node count the node as "recreated" in Prosemirror[1]
|
|
291
|
+
* This makes it so Prosemirror resets the selection to the child i.e. "media" instead of "media-single"
|
|
292
|
+
* The recommended fix is to reset the selection.[2]
|
|
293
|
+
*
|
|
294
|
+
* [1] https://discuss.prosemirror.net/t/setnodemarkup-loses-current-nodeselection/976
|
|
295
|
+
* [2] https://discuss.prosemirror.net/t/setnodemarkup-and-deselect/3673
|
|
296
|
+
*/
|
|
297
|
+
|
|
298
|
+
tr.setSelection(_prosemirrorState.NodeSelection.create(tr.doc, pos));
|
|
289
299
|
return dispatch(tr);
|
|
290
300
|
});
|
|
291
301
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "clickPlaceholder", function () {
|
|
@@ -120,7 +120,6 @@ var MediaPluginStateImplementation = /*#__PURE__*/function () {
|
|
|
120
120
|
(0, _defineProperty2.default)(this, "layout", 'center');
|
|
121
121
|
(0, _defineProperty2.default)(this, "mediaNodes", []);
|
|
122
122
|
(0, _defineProperty2.default)(this, "mediaGroupNodes", {});
|
|
123
|
-
(0, _defineProperty2.default)(this, "mobileUploadComplete", {});
|
|
124
123
|
(0, _defineProperty2.default)(this, "pendingTask", Promise.resolve(null));
|
|
125
124
|
(0, _defineProperty2.default)(this, "destroyed", false);
|
|
126
125
|
(0, _defineProperty2.default)(this, "removeOnCloseListener", function () {});
|
|
@@ -294,7 +293,7 @@ var MediaPluginStateImplementation = /*#__PURE__*/function () {
|
|
|
294
293
|
return type === mediaSingle;
|
|
295
294
|
});
|
|
296
295
|
(0, _defineProperty2.default)(this, "insertFile", function (mediaState, onMediaStateChanged, pickerType) {
|
|
297
|
-
var _this$mediaOptions2;
|
|
296
|
+
var _mediaState$collectio, _this$mediaOptions2;
|
|
298
297
|
|
|
299
298
|
var state = _this.view.state;
|
|
300
299
|
|
|
@@ -302,14 +301,10 @@ var MediaPluginStateImplementation = /*#__PURE__*/function () {
|
|
|
302
301
|
contextId: _this.contextIdentifierProvider ? _this.contextIdentifierProvider.objectId : undefined
|
|
303
302
|
});
|
|
304
303
|
|
|
305
|
-
var collection = _this.collectionFromProvider();
|
|
304
|
+
var collection = (_mediaState$collectio = mediaState.collection) !== null && _mediaState$collectio !== void 0 ? _mediaState$collectio : _this.collectionFromProvider();
|
|
306
305
|
|
|
307
306
|
if (collection === undefined) {
|
|
308
307
|
return;
|
|
309
|
-
}
|
|
310
|
-
|
|
311
|
-
if (_this.mediaOptions && _this.mediaOptions.allowMarkingUploadsAsIncomplete) {
|
|
312
|
-
_this.mobileUploadComplete[mediaStateWithContext.id] = false;
|
|
313
308
|
} // We need to dispatch the change to event dispatcher only for successful files
|
|
314
309
|
|
|
315
310
|
|
|
@@ -501,17 +496,12 @@ var MediaPluginStateImplementation = /*#__PURE__*/function () {
|
|
|
501
496
|
attrs.collection = state.collection;
|
|
502
497
|
}
|
|
503
498
|
|
|
504
|
-
_this.updateMediaNodeAttrs(state.id, attrs, (0, _mediaSingle.isMediaSingle)(_this.view.state.schema, state.fileMimeType));
|
|
499
|
+
_this.updateMediaNodeAttrs(state.id, attrs, (0, _mediaSingle.isMediaSingle)(_this.view.state.schema, state.fileMimeType));
|
|
505
500
|
|
|
506
|
-
|
|
507
|
-
_this.mobileUploadComplete[attrs.id] = true;
|
|
508
501
|
delete _this.mediaGroupNodes[state.id];
|
|
509
502
|
break;
|
|
510
503
|
}
|
|
511
504
|
});
|
|
512
|
-
(0, _defineProperty2.default)(this, "isMobileUploadCompleted", function (mediaId) {
|
|
513
|
-
return helpers.isMobileUploadCompleted(_this, mediaId);
|
|
514
|
-
});
|
|
515
505
|
(0, _defineProperty2.default)(this, "removeNodeById", function (state) {
|
|
516
506
|
var id = state.id;
|
|
517
507
|
var mediaNodeWithPos = helpers.findMediaNode(_this, id, (0, _isImage.isImage)(state.fileMimeType));
|
|
@@ -60,7 +60,7 @@ function keymapPlugin() {
|
|
|
60
60
|
|
|
61
61
|
if (isPreviousNodeAPanel && !isParentNodeAPanel || isInsideAnEmptyNode(selection, panel, state.schema) || isInsideAnEmptyNode(selection, blockquote, state.schema)) {
|
|
62
62
|
var content = $from.node($from.depth).content;
|
|
63
|
-
var insertPos = previousPos.pos
|
|
63
|
+
var insertPos = previousPos.pos;
|
|
64
64
|
deleteCurrentItem($from, tr).insert(insertPos, content);
|
|
65
65
|
|
|
66
66
|
if (dispatch) {
|
|
@@ -334,12 +334,12 @@ function handlePastePreservingMarks(slice) {
|
|
|
334
334
|
};
|
|
335
335
|
}
|
|
336
336
|
|
|
337
|
-
function
|
|
338
|
-
return
|
|
337
|
+
function getSmartLinkAdf(_x, _x2, _x3) {
|
|
338
|
+
return _getSmartLinkAdf.apply(this, arguments);
|
|
339
339
|
}
|
|
340
340
|
|
|
341
|
-
function
|
|
342
|
-
|
|
341
|
+
function _getSmartLinkAdf() {
|
|
342
|
+
_getSmartLinkAdf = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(text, type, cardOptions) {
|
|
343
343
|
var provider;
|
|
344
344
|
return _regenerator.default.wrap(function _callee$(_context) {
|
|
345
345
|
while (1) {
|
|
@@ -371,7 +371,7 @@ function _isLinkSmart() {
|
|
|
371
371
|
}
|
|
372
372
|
}, _callee);
|
|
373
373
|
}));
|
|
374
|
-
return
|
|
374
|
+
return _getSmartLinkAdf.apply(this, arguments);
|
|
375
375
|
}
|
|
376
376
|
|
|
377
377
|
function insertAutoMacro(slice, macro, view) {
|
|
@@ -391,7 +391,7 @@ function insertAutoMacro(slice, macro, view) {
|
|
|
391
391
|
}
|
|
392
392
|
|
|
393
393
|
function handleMacroAutoConvert(text, slice, cardsOptions, extensionAutoConverter) {
|
|
394
|
-
return function (state,
|
|
394
|
+
return function (state, dispatch, view) {
|
|
395
395
|
var macro = null; // try to use auto convert from extension provider first
|
|
396
396
|
|
|
397
397
|
if (extensionAutoConverter) {
|
|
@@ -416,21 +416,10 @@ function handleMacroAutoConvert(text, slice, cardsOptions, extensionAutoConverte
|
|
|
416
416
|
return insertAutoMacro(slice, macro, view);
|
|
417
417
|
}
|
|
418
418
|
|
|
419
|
-
|
|
420
|
-
if (
|
|
421
|
-
|
|
422
|
-
}
|
|
423
|
-
|
|
424
|
-
var _view$state = view.state,
|
|
425
|
-
schema = _view$state.schema,
|
|
426
|
-
tr = _view$state.tr;
|
|
427
|
-
var cardAdf = (0, _utils.processRawValue)(schema, cardData);
|
|
428
|
-
|
|
429
|
-
if (!cardAdf) {
|
|
430
|
-
throw new Error('Received invalid ADF from CardProvider');
|
|
419
|
+
getSmartLinkAdf(text, 'inline', cardsOptions).then(function () {
|
|
420
|
+
if (dispatch) {
|
|
421
|
+
handleMarkdown(slice)(state, dispatch);
|
|
431
422
|
}
|
|
432
|
-
|
|
433
|
-
view.dispatch((0, _doc.insertCard)(tr, cardAdf, schema));
|
|
434
423
|
}).catch(function () {
|
|
435
424
|
return insertAutoMacro(slice, macro, view);
|
|
436
425
|
});
|
|
@@ -11,13 +11,19 @@ var _markdownIt = _interopRequireDefault(require("markdown-it"));
|
|
|
11
11
|
|
|
12
12
|
var _linkifyMdPlugin = _interopRequireDefault(require("./linkify-md-plugin"));
|
|
13
13
|
|
|
14
|
+
var _newlineMdPlugin = _interopRequireDefault(require("./newline-md-plugin"));
|
|
15
|
+
|
|
16
|
+
var _paragraphMdPlugin = _interopRequireDefault(require("./paragraph-md-plugin"));
|
|
17
|
+
|
|
14
18
|
var md = (0, _markdownIt.default)('zero', {
|
|
15
19
|
html: false
|
|
16
20
|
});
|
|
17
21
|
exports.md = md;
|
|
18
22
|
md.enable([// Process html entity - {, ¯, ", ...
|
|
19
23
|
'entity', // Process escaped chars and hardbreaks
|
|
20
|
-
'escape', 'newline']);
|
|
24
|
+
'escape', 'newline']);
|
|
25
|
+
md.use(_paragraphMdPlugin.default); // enable modified version of linkify plugin
|
|
21
26
|
// @see https://product-fabric.atlassian.net/browse/ED-3097
|
|
22
27
|
|
|
23
|
-
md.use(_linkifyMdPlugin.default);
|
|
28
|
+
md.use(_linkifyMdPlugin.default);
|
|
29
|
+
md.use(_newlineMdPlugin.default);
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
|
|
8
|
+
// ED-15363: modified version of the original newline plugin
|
|
9
|
+
// https://github.com/markdown-it/markdown-it/blob/master/lib/rules_inline/newline.js
|
|
10
|
+
var newline = function newline(state, silent) {
|
|
11
|
+
var pmax,
|
|
12
|
+
// ED-15363: unread variables
|
|
13
|
+
// max,
|
|
14
|
+
// ws,
|
|
15
|
+
pos = state.pos;
|
|
16
|
+
|
|
17
|
+
if (state.src.charCodeAt(pos) !== 0x0a
|
|
18
|
+
/* \n */
|
|
19
|
+
) {
|
|
20
|
+
return false;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
pmax = state.pending.length - 1; // ED-15363: unread variable
|
|
24
|
+
// max = state.posMax;
|
|
25
|
+
// ' \n' -> hardbreak
|
|
26
|
+
// Lookup in pending chars is bad practice! Don't copy to other rules!
|
|
27
|
+
// Pending string is stored in concat mode, indexed lookups will cause
|
|
28
|
+
// convertion to flat mode.
|
|
29
|
+
|
|
30
|
+
if (!silent) {
|
|
31
|
+
if (pmax >= 0 && state.pending.charCodeAt(pmax) === 0x20) {
|
|
32
|
+
if (pmax >= 1 && state.pending.charCodeAt(pmax - 1) === 0x20) {
|
|
33
|
+
// ED-15363: We commented out this logic to preserve trailing whitespaces
|
|
34
|
+
// for each line of text when pasting plain text
|
|
35
|
+
// // Find whitespaces tail of pending chars.
|
|
36
|
+
// ws = pmax - 1;
|
|
37
|
+
// while (ws >= 1 && state.pending.charCodeAt(ws - 1) === 0x20) {
|
|
38
|
+
// ws--;
|
|
39
|
+
// }
|
|
40
|
+
// state.pending = state.pending.slice(0, ws);
|
|
41
|
+
state.push('hardbreak', 'br', 0);
|
|
42
|
+
} else {
|
|
43
|
+
state.pending = state.pending.slice(0, -1);
|
|
44
|
+
state.push('softbreak', 'br', 0);
|
|
45
|
+
}
|
|
46
|
+
} else {
|
|
47
|
+
state.push('softbreak', 'br', 0);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
pos++; // ED-15363: We commented out this logic from the original library to
|
|
52
|
+
// preserve leading whitespaces for each line of text when pasting plain
|
|
53
|
+
// text (to preserve whitespace-based indentation).
|
|
54
|
+
// // skip heading spaces for next line
|
|
55
|
+
// while (pos < max && isSpace(state.src.charCodeAt(pos))) {
|
|
56
|
+
// pos++;
|
|
57
|
+
// }
|
|
58
|
+
|
|
59
|
+
state.pos = pos;
|
|
60
|
+
return true;
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
var _default = function _default(md) {
|
|
64
|
+
return md.inline.ruler.at('newline', newline);
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
exports.default = _default;
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
|
|
8
|
+
// ED-15363: modified version of the original paragraph plugin
|
|
9
|
+
// https://github.com/markdown-it/markdown-it/blob/master/lib/rules_block/paragraph.js
|
|
10
|
+
var paragraph = function paragraph(state, startLine) {
|
|
11
|
+
var content,
|
|
12
|
+
terminate,
|
|
13
|
+
i,
|
|
14
|
+
l,
|
|
15
|
+
token,
|
|
16
|
+
oldParentType,
|
|
17
|
+
nextLine = startLine + 1,
|
|
18
|
+
terminatorRules = state.md.block.ruler.getRules('paragraph'),
|
|
19
|
+
endLine = state.lineMax;
|
|
20
|
+
oldParentType = state.parentType;
|
|
21
|
+
state.parentType = 'paragraph'; // jump line-by-line until empty one or EOF
|
|
22
|
+
|
|
23
|
+
for (; nextLine < endLine && !state.isEmpty(nextLine); nextLine++) {
|
|
24
|
+
// this would be a code block normally, but after paragraph
|
|
25
|
+
// it's considered a lazy continuation regardless of what's there
|
|
26
|
+
if (state.sCount[nextLine] - state.blkIndent > 3) {
|
|
27
|
+
continue;
|
|
28
|
+
} // quirk for blockquotes, this line should already be checked by that rule
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
if (state.sCount[nextLine] < 0) {
|
|
32
|
+
continue;
|
|
33
|
+
} // Some tags can terminate paragraph without empty line.
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
terminate = false;
|
|
37
|
+
|
|
38
|
+
for (i = 0, l = terminatorRules.length; i < l; i++) {
|
|
39
|
+
if (terminatorRules[i](state, nextLine, endLine, true)) {
|
|
40
|
+
terminate = true;
|
|
41
|
+
break;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
if (terminate) {
|
|
46
|
+
break;
|
|
47
|
+
}
|
|
48
|
+
} // ED-15363: We removed .trim() from this logic from the original library to
|
|
49
|
+
// preserve leading whitespaces at the beginning and end of paragraph blocks
|
|
50
|
+
// when pasting plain text (to preserve whitespace-based indentation, at the
|
|
51
|
+
// beginning and end of paragraphs).
|
|
52
|
+
// content = state.getLines(startLine, nextLine, state.blkIndent, false) .trim()
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
content = state.getLines(startLine, nextLine, state.blkIndent, false);
|
|
56
|
+
state.line = nextLine;
|
|
57
|
+
token = state.push('paragraph_open', 'p', 1);
|
|
58
|
+
token.map = [startLine, state.line];
|
|
59
|
+
token = state.push('inline', '', 0);
|
|
60
|
+
token.content = content;
|
|
61
|
+
token.map = [startLine, state.line];
|
|
62
|
+
token.children = [];
|
|
63
|
+
token = state.push('paragraph_close', 'p', -1);
|
|
64
|
+
state.parentType = oldParentType;
|
|
65
|
+
return true;
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
var _default = function _default(md) {
|
|
69
|
+
return md.block.ruler.at('paragraph', paragraph);
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
exports.default = _default;
|