@atlaskit/editor-core 165.0.0 → 166.0.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 +43 -0
- package/dist/cjs/actions/index.js +9 -0
- package/dist/cjs/create-editor/ReactEditorView.js +14 -6
- package/dist/cjs/create-editor/create-plugins-list.js +1 -2
- package/dist/cjs/editor.js +13 -0
- package/dist/cjs/event-dispatcher/index.js +9 -0
- package/dist/cjs/nodeviews/ReactNodeView.js +1 -11
- package/dist/cjs/nodeviews/getInlineNodeViewProducer.styles.js +1 -1
- package/dist/cjs/plugins/analytics/types/enums.js +1 -0
- package/dist/cjs/plugins/annotation/pm-plugins/inline-comment.js +2 -2
- package/dist/cjs/plugins/base/pm-plugins/frozen-editor.js +128 -79
- package/dist/cjs/plugins/base/utils/input-latency-tracking.js +157 -0
- package/dist/cjs/plugins/card/styles.js +3 -1
- package/dist/cjs/plugins/code-block/styles.js +6 -4
- package/dist/cjs/plugins/collab-edit/index.js +2 -2
- package/dist/cjs/plugins/collab-edit/plugin-state.js +23 -5
- package/dist/cjs/plugins/collab-edit/provider/channel.js +2 -2
- package/dist/cjs/plugins/date/styles.js +3 -1
- package/dist/cjs/plugins/emoji/index.js +30 -34
- package/dist/cjs/plugins/emoji/nodeviews/emoji.js +12 -66
- package/dist/cjs/plugins/emoji/styles.js +3 -17
- package/dist/cjs/plugins/expand/ui/styles.js +2 -2
- package/dist/cjs/plugins/extension/context-panel.js +2 -2
- package/dist/cjs/plugins/extension/pm-plugins/main.js +2 -2
- package/dist/cjs/plugins/extension/ui/styles.js +3 -1
- package/dist/cjs/plugins/feature-flags-context/feature-flags-from-props.js +20 -22
- package/dist/cjs/plugins/floating-toolbar/ui/ExtensionsPlaceholder.js +2 -2
- package/dist/cjs/plugins/hyperlink/pm-plugins/input-rule.js +1 -9
- package/dist/cjs/plugins/hyperlink/pm-plugins/keymap.js +1 -9
- package/dist/cjs/plugins/hyperlink/ui/HyperlinkAddToolbar/HyperlinkAddToolbar.js +2 -2
- package/dist/cjs/plugins/layout/styles.js +3 -1
- package/dist/cjs/plugins/list/commands/indent-list.js +5 -1
- package/dist/cjs/plugins/list/commands/outdent-list.js +5 -1
- package/dist/cjs/plugins/list/transforms.js +11 -3
- package/dist/cjs/plugins/macro/actions.js +2 -2
- package/dist/cjs/plugins/media/nodeviews/mediaInline.js +2 -2
- package/dist/cjs/plugins/media/nodeviews/mediaSingle.js +2 -2
- package/dist/cjs/plugins/media/styles.js +3 -1
- package/dist/cjs/plugins/media/ui/ResizableMediaSingle/index.js +2 -2
- package/dist/cjs/plugins/mentions/index.js +10 -14
- package/dist/cjs/plugins/mentions/nodeviews/mention.js +15 -67
- package/dist/cjs/plugins/mentions/pm-plugins/main.js +19 -10
- package/dist/cjs/plugins/mentions/type-ahead/index.js +7 -2
- package/dist/cjs/plugins/panel/styles.js +3 -1
- package/dist/cjs/plugins/placeholder-text/placeholder-text-nodeview.js +3 -1
- package/dist/cjs/plugins/rule/styles.js +3 -1
- package/dist/cjs/plugins/selection/utils.js +39 -23
- package/dist/cjs/plugins/table/event-handlers.js +3 -3
- package/dist/cjs/plugins/table/pm-plugins/sticky-headers/nodeviews/tableRow.js +24 -0
- package/dist/cjs/plugins/table/ui/common-styles.js +1 -1
- package/dist/cjs/plugins/table/ui/consts.js +6 -4
- package/dist/cjs/plugins/tasks-and-decisions/styles.js +3 -1
- package/dist/cjs/plugins/text-formatting/utils.js +1 -1
- package/dist/cjs/plugins/type-ahead/index.js +6 -2
- package/dist/cjs/plugins/unsupported-content/index.js +22 -10
- package/dist/cjs/plugins/unsupported-content/styles.js +4 -2
- package/dist/cjs/plugins/unsupported-content/unsupported-inline-node-view.js +21 -0
- package/dist/cjs/ui/Appearance/Chromeless.js +6 -3
- package/dist/cjs/ui/Appearance/Comment/Comment.js +6 -4
- package/dist/cjs/ui/ChromeCollapsed/styles.js +3 -1
- package/dist/cjs/ui/ConfigPanel/ConfigPanel.js +2 -2
- package/dist/cjs/ui/ConfigPanel/Fields/CustomSelect.js +2 -2
- package/dist/cjs/ui/ConfigPanel/Fields/UserSelect.js +2 -2
- package/dist/cjs/ui/ConfigPanel/transformers.js +2 -2
- package/dist/cjs/ui/ContentStyles/index.js +2 -2
- package/dist/cjs/version-wrapper.js +1 -1
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/actions/index.js +12 -1
- package/dist/es2019/create-editor/ReactEditorView.js +14 -6
- package/dist/es2019/create-editor/create-plugins-list.js +1 -2
- package/dist/es2019/editor.js +14 -0
- package/dist/es2019/event-dispatcher/index.js +8 -0
- package/dist/es2019/nodeviews/ReactNodeView.js +1 -10
- package/dist/es2019/nodeviews/getInlineNodeViewProducer.styles.js +9 -0
- package/dist/es2019/plugins/analytics/types/enums.js +1 -0
- package/dist/es2019/plugins/base/pm-plugins/frozen-editor.js +138 -80
- package/dist/es2019/plugins/base/utils/input-latency-tracking.js +128 -0
- package/dist/es2019/plugins/card/styles.js +9 -5
- package/dist/es2019/plugins/code-block/styles.js +11 -8
- package/dist/es2019/plugins/collab-edit/plugin-state.js +23 -8
- package/dist/es2019/plugins/date/styles.js +3 -1
- package/dist/es2019/plugins/emoji/index.js +16 -21
- package/dist/es2019/plugins/emoji/nodeviews/emoji.js +12 -31
- package/dist/es2019/plugins/emoji/styles.js +1 -82
- package/dist/es2019/plugins/expand/ui/styles.js +2 -2
- package/dist/es2019/plugins/extension/ui/styles.js +4 -2
- package/dist/es2019/plugins/feature-flags-context/feature-flags-from-props.js +20 -22
- package/dist/es2019/plugins/hyperlink/pm-plugins/input-rule.js +1 -8
- package/dist/es2019/plugins/hyperlink/pm-plugins/keymap.js +1 -8
- package/dist/es2019/plugins/layout/styles.js +3 -2
- package/dist/es2019/plugins/list/commands/indent-list.js +4 -1
- package/dist/es2019/plugins/list/commands/outdent-list.js +4 -1
- package/dist/es2019/plugins/list/transforms.js +9 -4
- package/dist/es2019/plugins/media/styles.js +9 -7
- package/dist/es2019/plugins/mentions/index.js +1 -6
- package/dist/es2019/plugins/mentions/nodeviews/mention.js +16 -35
- package/dist/es2019/plugins/mentions/pm-plugins/main.js +18 -10
- package/dist/es2019/plugins/mentions/type-ahead/index.js +7 -2
- package/dist/es2019/plugins/panel/styles.js +5 -4
- package/dist/es2019/plugins/placeholder-text/placeholder-text-nodeview.js +3 -1
- package/dist/es2019/plugins/rule/styles.js +2 -1
- package/dist/es2019/plugins/selection/utils.js +35 -20
- package/dist/es2019/plugins/table/pm-plugins/sticky-headers/nodeviews/tableRow.js +22 -0
- package/dist/es2019/plugins/table/ui/common-styles.js +4 -0
- package/dist/es2019/plugins/table/ui/consts.js +5 -4
- package/dist/es2019/plugins/tasks-and-decisions/styles.js +4 -2
- package/dist/es2019/plugins/text-formatting/utils.js +1 -1
- package/dist/es2019/plugins/type-ahead/index.js +5 -1
- package/dist/es2019/plugins/unsupported-content/index.js +23 -12
- package/dist/es2019/plugins/unsupported-content/styles.js +5 -3
- package/dist/es2019/plugins/unsupported-content/unsupported-inline-node-view.js +7 -0
- package/dist/es2019/ui/Appearance/Chromeless.js +5 -2
- package/dist/es2019/ui/Appearance/Comment/Comment.js +5 -2
- package/dist/es2019/ui/ChromeCollapsed/styles.js +2 -1
- package/dist/es2019/ui/ContentStyles/index.js +3 -3
- package/dist/es2019/version-wrapper.js +1 -1
- package/dist/es2019/version.json +1 -1
- package/dist/esm/actions/index.js +9 -1
- package/dist/esm/create-editor/ErrorBoundary.js +1 -1
- package/dist/esm/create-editor/ReactEditorView.js +14 -6
- package/dist/esm/create-editor/create-plugins-list.js +1 -2
- package/dist/esm/editor.js +16 -1
- package/dist/esm/event-dispatcher/index.js +9 -0
- package/dist/esm/nodeviews/ReactNodeView.js +1 -10
- package/dist/esm/nodeviews/getInlineNodeViewProducer.styles.js +1 -1
- package/dist/esm/plugins/analytics/types/enums.js +1 -0
- package/dist/esm/plugins/annotation/pm-plugins/inline-comment.js +1 -1
- package/dist/esm/plugins/base/pm-plugins/frozen-editor.js +128 -79
- package/dist/esm/plugins/base/utils/input-latency-tracking.js +149 -0
- package/dist/esm/plugins/card/styles.js +2 -1
- package/dist/esm/plugins/code-block/styles.js +5 -4
- package/dist/esm/plugins/collab-edit/index.js +1 -1
- package/dist/esm/plugins/collab-edit/plugin-state.js +21 -6
- package/dist/esm/plugins/collab-edit/provider/channel.js +1 -1
- package/dist/esm/plugins/custom-autoformat/doc.js +1 -1
- package/dist/esm/plugins/custom-autoformat/index.js +1 -1
- package/dist/esm/plugins/date/styles.js +2 -1
- package/dist/esm/plugins/emoji/index.js +26 -29
- package/dist/esm/plugins/emoji/nodeviews/emoji.js +11 -56
- package/dist/esm/plugins/emoji/styles.js +3 -14
- package/dist/esm/plugins/expand/ui/styles.js +2 -2
- package/dist/esm/plugins/extension/actions.js +1 -1
- package/dist/esm/plugins/extension/context-panel.js +1 -1
- package/dist/esm/plugins/extension/pm-plugins/main.js +1 -1
- package/dist/esm/plugins/extension/ui/Extension/ExtensionComponent.js +1 -1
- package/dist/esm/plugins/extension/ui/styles.js +2 -1
- package/dist/esm/plugins/feature-flags-context/feature-flags-from-props.js +20 -22
- package/dist/esm/plugins/feedback-dialog/index.js +1 -1
- package/dist/esm/plugins/feedback-dialog/loadJiraCollectorDialogScript.js +1 -1
- package/dist/esm/plugins/find-replace/utils/batch-decorations.js +1 -1
- package/dist/esm/plugins/floating-toolbar/ui/ExtensionsPlaceholder.js +1 -1
- package/dist/esm/plugins/hyperlink/HyperlinkToolbarAppearance.js +1 -1
- package/dist/esm/plugins/hyperlink/pm-plugins/input-rule.js +1 -8
- package/dist/esm/plugins/hyperlink/pm-plugins/keymap.js +1 -8
- package/dist/esm/plugins/hyperlink/ui/HyperlinkAddToolbar/HyperlinkAddToolbar.js +2 -1
- package/dist/esm/plugins/image-upload/pm-plugins/main.js +1 -1
- package/dist/esm/plugins/layout/styles.js +2 -1
- package/dist/esm/plugins/list/commands/indent-list.js +4 -1
- package/dist/esm/plugins/list/commands/outdent-list.js +4 -1
- package/dist/esm/plugins/list/transforms.js +9 -4
- package/dist/esm/plugins/macro/actions.js +1 -1
- package/dist/esm/plugins/media/nodeviews/mediaGroup.js +1 -1
- package/dist/esm/plugins/media/nodeviews/mediaInline.js +2 -1
- package/dist/esm/plugins/media/nodeviews/mediaNodeUpdater.js +1 -1
- package/dist/esm/plugins/media/nodeviews/mediaNodeView/media.js +1 -1
- package/dist/esm/plugins/media/nodeviews/mediaSingle.js +1 -1
- package/dist/esm/plugins/media/picker-facade.js +1 -1
- package/dist/esm/plugins/media/pm-plugins/main.js +1 -1
- package/dist/esm/plugins/media/styles.js +2 -1
- package/dist/esm/plugins/media/toolbar/utils.js +1 -1
- package/dist/esm/plugins/media/ui/MediaPicker/PickerFacadeProvider.js +1 -1
- package/dist/esm/plugins/media/ui/ResizableMediaSingle/index.js +1 -1
- package/dist/esm/plugins/media/utils/check-media-type.js +1 -1
- package/dist/esm/plugins/mentions/index.js +10 -14
- package/dist/esm/plugins/mentions/nodeviews/mention.js +13 -58
- package/dist/esm/plugins/mentions/pm-plugins/main.js +18 -10
- package/dist/esm/plugins/mentions/type-ahead/index.js +7 -2
- package/dist/esm/plugins/panel/styles.js +2 -1
- package/dist/esm/plugins/paste/handlers.js +1 -1
- package/dist/esm/plugins/paste/pm-plugins/main.js +1 -1
- package/dist/esm/plugins/placeholder-text/placeholder-text-nodeview.js +3 -1
- package/dist/esm/plugins/quick-insert/index.js +1 -1
- package/dist/esm/plugins/rule/styles.js +2 -1
- package/dist/esm/plugins/selection/utils.js +35 -20
- package/dist/esm/plugins/table/event-handlers.js +3 -3
- package/dist/esm/plugins/table/pm-plugins/sticky-headers/nodeviews/tableRow.js +23 -0
- package/dist/esm/plugins/table/ui/common-styles.js +1 -1
- package/dist/esm/plugins/table/ui/consts.js +5 -4
- package/dist/esm/plugins/tasks-and-decisions/styles.js +2 -1
- package/dist/esm/plugins/tasks-and-decisions/ui/Task/task-item-with-providers.js +1 -1
- package/dist/esm/plugins/text-formatting/utils.js +1 -1
- package/dist/esm/plugins/type-ahead/index.js +6 -2
- package/dist/esm/plugins/unsupported-content/index.js +21 -11
- package/dist/esm/plugins/unsupported-content/styles.js +3 -2
- package/dist/esm/plugins/unsupported-content/unsupported-inline-node-view.js +7 -0
- package/dist/esm/ui/Appearance/Chromeless.js +6 -3
- package/dist/esm/ui/Appearance/Comment/Comment.js +6 -4
- package/dist/esm/ui/ChromeCollapsed/styles.js +2 -1
- package/dist/esm/ui/ConfigPanel/ConfigPanel.js +1 -1
- package/dist/esm/ui/ConfigPanel/Fields/CustomSelect.js +1 -1
- package/dist/esm/ui/ConfigPanel/Fields/UserSelect.js +1 -1
- package/dist/esm/ui/ConfigPanel/FormErrorBoundary.js +1 -1
- package/dist/esm/ui/ConfigPanel/transformers.js +1 -1
- package/dist/esm/ui/ContentStyles/index.js +3 -3
- package/dist/esm/ui/LinkSearch/index.js +1 -1
- package/dist/esm/ui/ToolbarFeedback/index.js +1 -1
- package/dist/esm/utils/action.js +1 -1
- package/dist/esm/utils/clipboard.js +1 -1
- package/dist/esm/utils/extensions.js +1 -1
- package/dist/esm/version-wrapper.js +1 -1
- package/dist/esm/version.json +1 -1
- package/dist/types/actions/index.d.ts +3 -1
- package/dist/types/editor.d.ts +3 -0
- package/dist/types/event-dispatcher/index.d.ts +1 -0
- package/dist/types/nodeviews/ReactNodeView.d.ts +1 -5
- 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/general-events.d.ts +10 -1
- package/dist/types/plugins/base/utils/input-latency-tracking.d.ts +44 -0
- package/dist/types/plugins/collab-edit/plugin-state.d.ts +4 -0
- package/dist/types/plugins/emoji/index.d.ts +2 -6
- package/dist/types/plugins/emoji/nodeviews/emoji.d.ts +4 -14
- package/dist/types/plugins/emoji/styles.d.ts +0 -1
- package/dist/types/plugins/emoji/types.d.ts +0 -1
- package/dist/types/plugins/list/transforms.d.ts +10 -1
- package/dist/types/plugins/mentions/nodeviews/mention.d.ts +6 -14
- package/dist/types/plugins/mentions/pm-plugins/main.d.ts +2 -5
- package/dist/types/plugins/selection/utils.d.ts +7 -15
- package/dist/types/plugins/table/pm-plugins/sticky-headers/nodeviews/tableRow.d.ts +3 -0
- package/dist/types/plugins/table/ui/consts.d.ts +2 -2
- package/dist/types/plugins/type-ahead/types.d.ts +1 -0
- package/dist/types/plugins/unsupported-content/unsupported-inline-node-view.d.ts +11 -0
- package/dist/types/types/editor-appearance-component.d.ts +1 -0
- package/dist/types/types/editor-props.d.ts +1 -0
- package/dist/types/types/feature-flags.d.ts +0 -14
- package/dist/types/ui/Appearance/Chromeless.d.ts +1 -0
- package/dist/types/ui/Appearance/Comment/Comment.d.ts +1 -0
- package/dist/types/ui/Appearance/FullPage/StyledComponents.d.ts +4 -4
- package/dist/types/ui/ContentStyles/index.d.ts +2 -2
- package/package.json +23 -23
- package/dist/cjs/plugins/emoji/nodeviews/emoji-next.js +0 -250
- package/dist/es2019/plugins/emoji/nodeviews/emoji-next.js +0 -177
- package/dist/esm/plugins/emoji/nodeviews/emoji-next.js +0 -234
- package/dist/types/plugins/emoji/nodeviews/emoji-next.d.ts +0 -31
|
@@ -12,7 +12,7 @@ const safeNumberFeatureFlag = value => {
|
|
|
12
12
|
|
|
13
13
|
|
|
14
14
|
export function createFeatureFlagsFromProps(props) {
|
|
15
|
-
var _props$allowTextColor, _props$allowLayouts, _props$performanceTra, _props$performanceTra2, _props$featureFlags, _props$featureFlags2, _props$
|
|
15
|
+
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$allowTables5, _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$featureFlags31, _props$featureFlags32, _props$featureFlags33, _props$collabEdit, _props$collabEdit2, _props$featureFlags34, _props$featureFlags35;
|
|
16
16
|
|
|
17
17
|
const normalizedFeatureFlags = normalizeFeatureFlags(props.featureFlags);
|
|
18
18
|
return { ...normalizedFeatureFlags,
|
|
@@ -28,29 +28,27 @@ export function createFeatureFlagsFromProps(props) {
|
|
|
28
28
|
singleLayout: typeof props.allowLayouts === 'object' && !!((_props$allowLayouts = props.allowLayouts) !== null && _props$allowLayouts !== void 0 && _props$allowLayouts.UNSAFE_allowSingleColumnLayout),
|
|
29
29
|
undoRedoButtons: props.UNSAFE_allowUndoRedoButtons,
|
|
30
30
|
catchAllTracking: (_props$performanceTra = props.performanceTracking) === null || _props$performanceTra === void 0 ? void 0 : (_props$performanceTra2 = _props$performanceTra.catchAllTracking) === null || _props$performanceTra2 === void 0 ? void 0 : _props$performanceTra2.enabled,
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
tableOverflowShadowsOptimization: typeof ((_props$featureFlags10 = props.featureFlags) === null || _props$featureFlags10 === void 0 ? void 0 : _props$featureFlags10.tableOverflowShadowsOptimization) === 'boolean' ? !!((_props$featureFlags11 = props.featureFlags) !== null && _props$featureFlags11 !== void 0 && _props$featureFlags11.tableOverflowShadowsOptimization) : typeof props.allowTables === 'object' && !!((_props$allowTables5 = props.allowTables) !== null && _props$allowTables5 !== void 0 && _props$allowTables5.tableOverflowShadowsOptimization),
|
|
31
|
+
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) : typeof props.allowTables === 'object' && !!((_props$allowTables = props.allowTables) !== null && _props$allowTables !== void 0 && _props$allowTables.stickyHeadersOptimization),
|
|
32
|
+
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) : typeof props.allowTables === 'object' && !!((_props$allowTables2 = props.allowTables) !== null && _props$allowTables2 !== void 0 && _props$allowTables2.initialRenderOptimization),
|
|
33
|
+
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) : typeof props.allowTables === 'object' && !!((_props$allowTables3 = props.allowTables) !== null && _props$allowTables3 !== void 0 && _props$allowTables3.mouseMoveOptimization),
|
|
34
|
+
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) : typeof props.allowTables === 'object' && !!((_props$allowTables4 = props.allowTables) !== null && _props$allowTables4 !== void 0 && _props$allowTables4.tableRenderOptimization),
|
|
35
|
+
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) : typeof props.allowTables === 'object' && !!((_props$allowTables5 = props.allowTables) !== null && _props$allowTables5 !== void 0 && _props$allowTables5.tableOverflowShadowsOptimization),
|
|
37
36
|
extendFloatingToolbar: Boolean(typeof props.allowExtension === 'object' && ((_props$allowExtension = props.allowExtension) === null || _props$allowExtension === void 0 ? void 0 : _props$allowExtension.allowExtendFloatingToolbars)),
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
ufo: Boolean(typeof ((_props$featureFlags28 = props.featureFlags) === null || _props$featureFlags28 === void 0 ? void 0 : _props$featureFlags28.ufo) === 'boolean' ? !!((_props$featureFlags29 = props.featureFlags) !== null && _props$featureFlags29 !== void 0 && _props$featureFlags29.ufo) : false),
|
|
37
|
+
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),
|
|
38
|
+
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),
|
|
39
|
+
errorBoundaryDocStructure: Boolean(typeof ((_props$featureFlags15 = props.featureFlags) === null || _props$featureFlags15 === void 0 ? void 0 : _props$featureFlags15.useErrorBoundaryDocStructure) === 'boolean' ? !!((_props$featureFlags16 = props.featureFlags) !== null && _props$featureFlags16 !== void 0 && _props$featureFlags16.useErrorBoundaryDocStructure) : false),
|
|
40
|
+
synchronyErrorDocStructure: Boolean(typeof ((_props$featureFlags17 = props.featureFlags) === null || _props$featureFlags17 === void 0 ? void 0 : _props$featureFlags17.synchronyErrorDocStructure) === 'boolean' ? !!((_props$featureFlags18 = props.featureFlags) !== null && _props$featureFlags18 !== void 0 && _props$featureFlags18.synchronyErrorDocStructure) : false),
|
|
41
|
+
enableViewUpdateSubscription: Boolean(typeof ((_props$featureFlags19 = props.featureFlags) === null || _props$featureFlags19 === void 0 ? void 0 : _props$featureFlags19.enableViewUpdateSubscription) === 'boolean' ? !!((_props$featureFlags20 = props.featureFlags) !== null && _props$featureFlags20 !== void 0 && _props$featureFlags20.enableViewUpdateSubscription) : false),
|
|
42
|
+
plainTextPasteLinkification: Boolean(typeof ((_props$featureFlags21 = props.featureFlags) === null || _props$featureFlags21 === void 0 ? void 0 : _props$featureFlags21.plainTextPasteLinkification) === 'boolean' ? !!((_props$featureFlags22 = props.featureFlags) !== null && _props$featureFlags22 !== void 0 && _props$featureFlags22.plainTextPasteLinkification) : false),
|
|
43
|
+
collabAvatarScroll: Boolean(typeof ((_props$featureFlags23 = props.featureFlags) === null || _props$featureFlags23 === void 0 ? void 0 : _props$featureFlags23.collabAvatarScroll) === 'boolean' ? !!((_props$featureFlags24 = props.featureFlags) !== null && _props$featureFlags24 !== void 0 && _props$featureFlags24.collabAvatarScroll) : false),
|
|
44
|
+
ufo: Boolean(typeof ((_props$featureFlags25 = props.featureFlags) === null || _props$featureFlags25 === void 0 ? void 0 : _props$featureFlags25.ufo) === 'boolean' ? !!((_props$featureFlags26 = props.featureFlags) !== null && _props$featureFlags26 !== void 0 && _props$featureFlags26.ufo) : false),
|
|
47
45
|
codeBlockSyntaxHighlighting: Boolean(typeof normalizedFeatureFlags.codeBlockSyntaxHighlighting === 'boolean' ? !!normalizedFeatureFlags.codeBlockSyntaxHighlighting && !browser.safari : false),
|
|
48
|
-
twoLineEditorToolbar: Boolean(typeof ((_props$
|
|
49
|
-
codeBidiWarnings: Boolean(typeof ((_props$
|
|
50
|
-
saferDispatchedTransactions: Boolean(typeof normalizedFeatureFlags.saferDispatchedTransactions === 'boolean' && !!normalizedFeatureFlags.saferDispatchedTransactions || (typeof ((_props$
|
|
51
|
-
maxUnsafeChromeSpellcheckingVersion: safeNumberFeatureFlag((_props$
|
|
46
|
+
twoLineEditorToolbar: Boolean(typeof ((_props$featureFlags27 = props.featureFlags) === null || _props$featureFlags27 === void 0 ? void 0 : _props$featureFlags27.twoLineEditorToolbar) === 'boolean' ? !!((_props$featureFlags28 = props.featureFlags) !== null && _props$featureFlags28 !== void 0 && _props$featureFlags28.twoLineEditorToolbar) : false),
|
|
47
|
+
codeBidiWarnings: Boolean(typeof ((_props$featureFlags29 = props.featureFlags) === null || _props$featureFlags29 === void 0 ? void 0 : _props$featureFlags29.codeBidiWarnings) === 'boolean' ? !!((_props$featureFlags30 = props.featureFlags) !== null && _props$featureFlags30 !== void 0 && _props$featureFlags30.codeBidiWarnings) : true),
|
|
48
|
+
saferDispatchedTransactions: Boolean(typeof normalizedFeatureFlags.saferDispatchedTransactions === 'boolean' && !!normalizedFeatureFlags.saferDispatchedTransactions || (typeof ((_props$featureFlags31 = props.featureFlags) === null || _props$featureFlags31 === void 0 ? void 0 : _props$featureFlags31.saferDispatchedTransactions) === 'boolean' ? !!((_props$featureFlags32 = props.featureFlags) !== null && _props$featureFlags32 !== void 0 && _props$featureFlags32.saferDispatchedTransactions) : false)),
|
|
49
|
+
maxUnsafeChromeSpellcheckingVersion: safeNumberFeatureFlag((_props$featureFlags33 = props.featureFlags) === null || _props$featureFlags33 === void 0 ? void 0 : _props$featureFlags33.maxUnsafeChromeSpellcheckingVersion),
|
|
52
50
|
useNativeCollabPlugin: Boolean(typeof ((_props$collabEdit = props.collabEdit) === null || _props$collabEdit === void 0 ? void 0 : _props$collabEdit.useNativePlugin) === 'boolean' ? !!((_props$collabEdit2 = props.collabEdit) !== null && _props$collabEdit2 !== void 0 && _props$collabEdit2.useNativePlugin) : false),
|
|
53
|
-
chromeCursorHandlerFixedVersion: typeof ((_props$
|
|
54
|
-
viewChangingExperimentToolbarStyle: typeof ((_props$
|
|
51
|
+
chromeCursorHandlerFixedVersion: typeof ((_props$featureFlags34 = props.featureFlags) === null || _props$featureFlags34 === void 0 ? void 0 : _props$featureFlags34.chromeCursorHandlerFixedVersion) === 'string' ? Number(props.featureFlags.chromeCursorHandlerFixedVersion) || undefined : undefined,
|
|
52
|
+
viewChangingExperimentToolbarStyle: typeof ((_props$featureFlags35 = props.featureFlags) === null || _props$featureFlags35 === void 0 ? void 0 : _props$featureFlags35['view-changing-experiment-toolbar-style']) === 'string' ? props.featureFlags['view-changing-experiment-toolbar-style'] || undefined : undefined
|
|
55
53
|
};
|
|
56
54
|
}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { createRule, createPlugin } from '../../../utils/input-rules';
|
|
2
2
|
import { LinkMatcher, normalizeUrl } from '../utils';
|
|
3
|
-
import { queueCards } from '../../card/pm-plugins/actions';
|
|
4
3
|
import { INPUT_METHOD, addAnalytics } from '../../analytics';
|
|
5
4
|
import { getLinkCreationAnalyticsEvent } from '../analytics';
|
|
6
5
|
export function createLinkInputRule(regexp, skipAnalytics = false, useUnpredictableInputRule = true) {
|
|
@@ -21,13 +20,7 @@ export function createLinkInputRule(regexp, skipAnalytics = false, useUnpredicta
|
|
|
21
20
|
});
|
|
22
21
|
const from = start;
|
|
23
22
|
const to = Math.min(start + link.text.length, state.doc.content.size);
|
|
24
|
-
const tr =
|
|
25
|
-
url: link.url,
|
|
26
|
-
pos: from,
|
|
27
|
-
appearance: 'inline',
|
|
28
|
-
compareLinkText: true,
|
|
29
|
-
source: INPUT_METHOD.AUTO_DETECT
|
|
30
|
-
}])(state.tr.addMark(from, to, markType)); // Keep old behavior that will delete the space after the link
|
|
23
|
+
const tr = state.tr.addMark(from, to, markType); // Keep old behavior that will delete the space after the link
|
|
31
24
|
|
|
32
25
|
if (useUnpredictableInputRule || to === end) {
|
|
33
26
|
tr.insertText(' ');
|
|
@@ -3,7 +3,6 @@ import { getLinkMatch } from '@atlaskit/adf-schema';
|
|
|
3
3
|
import * as keymaps from '../../../keymaps';
|
|
4
4
|
import { stateKey } from '../pm-plugins/main';
|
|
5
5
|
import { showLinkToolbar, hideLinkToolbar } from '../commands';
|
|
6
|
-
import { queueCards } from '../../card/pm-plugins/actions';
|
|
7
6
|
import { INPUT_METHOD, addAnalytics } from '../../analytics';
|
|
8
7
|
import { getLinkCreationAnalyticsEvent } from '../analytics';
|
|
9
8
|
export function createKeymapPlugin(skipAnalytics = false) {
|
|
@@ -54,13 +53,7 @@ const mayConvertLastWordToHyperlink = skipAnalytics => {
|
|
|
54
53
|
const markType = state.schema.mark('link', {
|
|
55
54
|
href: url
|
|
56
55
|
});
|
|
57
|
-
const tr =
|
|
58
|
-
url,
|
|
59
|
-
pos: start,
|
|
60
|
-
appearance: 'inline',
|
|
61
|
-
compareLinkText: true,
|
|
62
|
-
source: INPUT_METHOD.AUTO_DETECT
|
|
63
|
-
}])(state.tr.addMark(start, end, markType));
|
|
56
|
+
const tr = state.tr.addMark(start, end, markType);
|
|
64
57
|
|
|
65
58
|
if (dispatch) {
|
|
66
59
|
if (skipAnalytics) {
|
|
@@ -3,6 +3,7 @@ import { gridSize } from '@atlaskit/theme/constants';
|
|
|
3
3
|
import { N40A, N50A } from '@atlaskit/theme/colors';
|
|
4
4
|
import { columnLayoutSharedStyle } from '@atlaskit/editor-common/styles';
|
|
5
5
|
import { gridMediumMaxWidth, akEditorDeleteBackground, akEditorDeleteBorder, akEditorSelectedBorderSize, akLayoutGutterOffset, akEditorSwoopCubicBezier, SelectionStyle, getSelectionStyles, akEditorSelectedNodeClassName } from '@atlaskit/editor-shared-styles';
|
|
6
|
+
import { token } from '@atlaskit/tokens';
|
|
6
7
|
import { TableCssClassName } from '../table/types';
|
|
7
8
|
import { tableMarginFullWidthMode } from '../table/ui/consts';
|
|
8
9
|
export const LAYOUT_SECTION_MARGIN = gridSize();
|
|
@@ -91,8 +92,8 @@ export const layoutStyles = css`
|
|
|
91
92
|
}
|
|
92
93
|
|
|
93
94
|
&.selected.danger > [data-layout-column] {
|
|
94
|
-
background-color: ${akEditorDeleteBackground};
|
|
95
|
-
border-color: ${akEditorDeleteBorder};
|
|
95
|
+
background-color: ${token('color.background.danger', akEditorDeleteBackground)};
|
|
96
|
+
border-color: ${token('color.border.danger', akEditorDeleteBorder)};
|
|
96
97
|
}
|
|
97
98
|
|
|
98
99
|
&.${akEditorSelectedNodeClassName}:not(.danger) {
|
|
@@ -6,6 +6,7 @@ import { findFirstParentListNode } from '../utils/find';
|
|
|
6
6
|
import { MAX_NESTED_LIST_INDENTATION } from '../types';
|
|
7
7
|
import { isInsideListItem, isInsideTableCell, getListItemAttributes } from '../utils/selection';
|
|
8
8
|
import { getCommonListAnalyticsAttributes } from '../utils/analytics';
|
|
9
|
+
import { closeHistory } from 'prosemirror-history';
|
|
9
10
|
export function indentList(inputMethod = INPUT_METHOD.KEYBOARD) {
|
|
10
11
|
return function (state, dispatch) {
|
|
11
12
|
const {
|
|
@@ -17,8 +18,10 @@ export function indentList(inputMethod = INPUT_METHOD.KEYBOARD) {
|
|
|
17
18
|
|
|
18
19
|
if (!isInsideListItem(state)) {
|
|
19
20
|
return false;
|
|
20
|
-
}
|
|
21
|
+
} // Save the history, so it could undo/revert to the same state before the indent, see https://product-fabric.atlassian.net/browse/ED-14753
|
|
22
|
+
|
|
21
23
|
|
|
24
|
+
closeHistory(tr);
|
|
22
25
|
const firstListItemSelectedAttributes = getListItemAttributes($from);
|
|
23
26
|
const parentListNode = findFirstParentListNode($from);
|
|
24
27
|
|
|
@@ -4,6 +4,7 @@ import { isBulletList } from '../utils/node';
|
|
|
4
4
|
import { findFirstParentListNode } from '../utils/find';
|
|
5
5
|
import { getCommonListAnalyticsAttributes } from '../utils/analytics';
|
|
6
6
|
import { outdentListItemsSelected as outdentListAction } from '../actions/outdent-list-items-selected';
|
|
7
|
+
import { closeHistory } from 'prosemirror-history';
|
|
7
8
|
export function outdentList(inputMethod = INPUT_METHOD.KEYBOARD) {
|
|
8
9
|
return function (state, dispatch) {
|
|
9
10
|
if (!isInsideListItem(state)) {
|
|
@@ -18,8 +19,10 @@ export function outdentList(inputMethod = INPUT_METHOD.KEYBOARD) {
|
|
|
18
19
|
if (!parentListNode) {
|
|
19
20
|
// Even though this is a non-operation, we don't want to send this event to the browser. Because if we return false, the browser will move the focus to another place
|
|
20
21
|
return true;
|
|
21
|
-
}
|
|
22
|
+
} // Save the history, so it could undo/revert to the same state before the outdent, see https://product-fabric.atlassian.net/browse/ED-14753
|
|
23
|
+
|
|
22
24
|
|
|
25
|
+
closeHistory(state.tr);
|
|
23
26
|
const actionSubjectId = isBulletList(parentListNode.node) ? ACTION_SUBJECT_ID.FORMAT_LIST_BULLET : ACTION_SUBJECT_ID.FORMAT_LIST_NUMBER;
|
|
24
27
|
let customTr = state.tr;
|
|
25
28
|
outdentListAction(customTr);
|
|
@@ -227,7 +227,7 @@ const extractListFromParagraph = (node, parent, schema) => {
|
|
|
227
227
|
*/
|
|
228
228
|
|
|
229
229
|
|
|
230
|
-
const splitIntoParagraphs = ({
|
|
230
|
+
export const splitIntoParagraphs = ({
|
|
231
231
|
fragment,
|
|
232
232
|
blockMarks = [],
|
|
233
233
|
schema
|
|
@@ -239,8 +239,14 @@ const splitIntoParagraphs = ({
|
|
|
239
239
|
hardBreak,
|
|
240
240
|
paragraph
|
|
241
241
|
} = schema.nodes;
|
|
242
|
-
fragment.forEach(node => {
|
|
243
|
-
|
|
242
|
+
fragment.forEach((node, i) => {
|
|
243
|
+
// ED-14725 Fixed the issue that it make duplicated line
|
|
244
|
+
// when pasting <br /> from google docs.
|
|
245
|
+
if (i === 0 && node.type === hardBreak) {
|
|
246
|
+
paragraphs.push(paragraph.createChecked(undefined, curChildren, [...blockMarks]));
|
|
247
|
+
lastNode = node;
|
|
248
|
+
return;
|
|
249
|
+
} else if (lastNode && lastNode.type === hardBreak && node.type === hardBreak) {
|
|
244
250
|
// double hardbreak
|
|
245
251
|
// backtrack a little; remove the trailing hardbreak we added last loop
|
|
246
252
|
curChildren.pop(); // create a new paragraph
|
|
@@ -261,7 +267,6 @@ const splitIntoParagraphs = ({
|
|
|
261
267
|
|
|
262
268
|
return Fragment.from(paragraphs.length ? paragraphs : [paragraph.createAndFill(undefined, undefined, [...blockMarks])]);
|
|
263
269
|
};
|
|
264
|
-
|
|
265
270
|
export const splitParagraphs = (slice, schema) => {
|
|
266
271
|
// exclude Text nodes with a code mark, since we transform those later
|
|
267
272
|
// into a codeblock
|
|
@@ -3,6 +3,7 @@ import { mediaSingleSharedStyle, richMediaClassName } from '@atlaskit/editor-com
|
|
|
3
3
|
import { akEditorDeleteBorder, akEditorDeleteBackground, akEditorSelectedBorderBoldSize, akEditorMediaResizeHandlerPaddingWide, akEditorMediaResizeHandlerPadding, akEditorSelectedNodeClassName, akEditorDeleteIconColor } from '@atlaskit/editor-shared-styles';
|
|
4
4
|
import { N60, B200 } from '@atlaskit/theme/colors';
|
|
5
5
|
import { fileCardImageViewSelector, fileCardImageViewSelectedSelector, inlinePlayerClassName, newFileExperienceClassName } from '@atlaskit/media-card';
|
|
6
|
+
import { token } from '@atlaskit/tokens';
|
|
6
7
|
export const mediaStyles = css`
|
|
7
8
|
.ProseMirror {
|
|
8
9
|
${mediaSingleSharedStyle} & [layout='full-width'] .${richMediaClassName},
|
|
@@ -115,35 +116,36 @@ export const mediaStyles = css`
|
|
|
115
116
|
/* Danger when top level node for smart cards / inline links */
|
|
116
117
|
.danger > div > div > .media-card-frame,
|
|
117
118
|
.danger > span > a {
|
|
118
|
-
background-color: ${akEditorDeleteBackground};
|
|
119
|
+
background-color: ${token('color.background.danger', akEditorDeleteBackground)};
|
|
119
120
|
box-shadow: 0px 0px 0px ${akEditorSelectedBorderBoldSize}px
|
|
120
|
-
${akEditorDeleteBorder};
|
|
121
|
+
${token('color.border.danger', akEditorDeleteBorder)};
|
|
121
122
|
transition: background-color 0s, box-shadow 0s;
|
|
122
123
|
}
|
|
123
124
|
.mediaGroupView-content-wrap.danger {
|
|
124
125
|
/* Media inline */
|
|
125
126
|
.${fileCardImageViewSelectedSelector}::after {
|
|
126
|
-
border: 1px solid ${akEditorDeleteIconColor};
|
|
127
|
+
border: 1px solid ${token('color.border.danger', akEditorDeleteIconColor)};
|
|
127
128
|
}
|
|
128
129
|
}
|
|
129
130
|
/* Danger when nested node or common */
|
|
130
131
|
.danger {
|
|
131
132
|
/* Media single */
|
|
132
133
|
.${richMediaClassName} .${fileCardImageViewSelector}::after {
|
|
133
|
-
border: 1px solid ${akEditorDeleteIconColor};
|
|
134
|
+
border: 1px solid ${token('color.border.danger', akEditorDeleteIconColor)};
|
|
134
135
|
}
|
|
135
136
|
/* Media single video player */
|
|
136
137
|
.${richMediaClassName} .${inlinePlayerClassName}::after {
|
|
137
|
-
border: 1px solid ${akEditorDeleteIconColor};
|
|
138
|
+
border: 1px solid ${token('color.border.danger', akEditorDeleteIconColor)};
|
|
138
139
|
}
|
|
139
140
|
/* New file experience */
|
|
140
141
|
.${richMediaClassName} .${newFileExperienceClassName} {
|
|
141
|
-
box-shadow: 0 0 0 1px
|
|
142
|
+
box-shadow: 0 0 0 1px
|
|
143
|
+
${token('color.border.danger', akEditorDeleteIconColor)} !important;
|
|
142
144
|
}
|
|
143
145
|
/* Media resize handlers */
|
|
144
146
|
.richMedia-resize-handle-right::after,
|
|
145
147
|
.richMedia-resize-handle-left::after {
|
|
146
|
-
background: ${akEditorDeleteIconColor};
|
|
148
|
+
background: ${token('color.icon.danger', akEditorDeleteIconColor)};
|
|
147
149
|
}
|
|
148
150
|
|
|
149
151
|
/* Smart cards */
|
|
@@ -52,12 +52,7 @@ const mentionsPlugin = options => {
|
|
|
52
52
|
pmPlugins() {
|
|
53
53
|
return [{
|
|
54
54
|
name: 'mention',
|
|
55
|
-
plugin: (
|
|
56
|
-
providerFactory,
|
|
57
|
-
dispatch,
|
|
58
|
-
portalProviderAPI,
|
|
59
|
-
eventDispatcher
|
|
60
|
-
}) => createMentionPlugin(dispatch, providerFactory, portalProviderAPI, eventDispatcher, fireEvent, options)
|
|
55
|
+
plugin: pmPluginFactoryParams => createMentionPlugin(pmPluginFactoryParams, fireEvent, options)
|
|
61
56
|
}];
|
|
62
57
|
},
|
|
63
58
|
|
|
@@ -1,37 +1,18 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { ZERO_WIDTH_SPACE } from '@atlaskit/editor-common/utils';
|
|
3
2
|
import Mention from '../ui/Mention';
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Mention, {
|
|
21
|
-
id: id,
|
|
22
|
-
text: text,
|
|
23
|
-
accessLevel: accessLevel,
|
|
24
|
-
providers: providerFactory
|
|
25
|
-
}), options && options.allowZeroWidthSpaceAfter && ZERO_WIDTH_SPACE);
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
}
|
|
29
|
-
export default function mentionNodeView(portalProviderAPI, eventDispatcher, providerFactory, options) {
|
|
30
|
-
return (node, view, getPos) => {
|
|
31
|
-
const hasIntlContext = true;
|
|
32
|
-
return new MentionNodeView(node, view, getPos, portalProviderAPI, eventDispatcher, {
|
|
33
|
-
providerFactory,
|
|
34
|
-
options
|
|
35
|
-
}, undefined, undefined, undefined, hasIntlContext).init();
|
|
36
|
-
};
|
|
37
|
-
}
|
|
3
|
+
export const MentionNodeView = props => {
|
|
4
|
+
const {
|
|
5
|
+
providerFactory
|
|
6
|
+
} = props;
|
|
7
|
+
const {
|
|
8
|
+
id,
|
|
9
|
+
text,
|
|
10
|
+
accessLevel
|
|
11
|
+
} = props.node.attrs;
|
|
12
|
+
return /*#__PURE__*/React.createElement(Mention, {
|
|
13
|
+
id: id,
|
|
14
|
+
text: text,
|
|
15
|
+
accessLevel: accessLevel,
|
|
16
|
+
providers: providerFactory
|
|
17
|
+
});
|
|
18
|
+
};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
2
2
|
import { SLI_EVENT_TYPE, SMART_EVENT_TYPE, buildSliPayload } from '@atlaskit/mention/resource';
|
|
3
|
-
import
|
|
3
|
+
import { getInlineNodeViewProducer } from '../../../nodeviews/getInlineNodeViewProducer';
|
|
4
|
+
import { MentionNodeView } from '../nodeviews/mention';
|
|
4
5
|
import { mentionPluginKey } from './key';
|
|
5
6
|
const ACTIONS = {
|
|
6
7
|
SET_PROVIDER: 'SET_PROVIDER',
|
|
@@ -32,7 +33,7 @@ export const setContext = context => (state, dispatch) => {
|
|
|
32
33
|
|
|
33
34
|
return true;
|
|
34
35
|
};
|
|
35
|
-
export function createMentionPlugin(
|
|
36
|
+
export function createMentionPlugin(pmPluginFactoryParams, fireEvent, options) {
|
|
36
37
|
let mentionProvider;
|
|
37
38
|
|
|
38
39
|
const sendAnalytics = (event, actionSubject, action, attributes) => {
|
|
@@ -63,14 +64,14 @@ export function createMentionPlugin(dispatch, providerFactory, portalProviderAPI
|
|
|
63
64
|
newPluginState = { ...pluginState,
|
|
64
65
|
mentionProvider: params.provider
|
|
65
66
|
};
|
|
66
|
-
dispatch(mentionPluginKey, newPluginState);
|
|
67
|
+
pmPluginFactoryParams.dispatch(mentionPluginKey, newPluginState);
|
|
67
68
|
return newPluginState;
|
|
68
69
|
|
|
69
70
|
case ACTIONS.SET_CONTEXT:
|
|
70
71
|
newPluginState = { ...pluginState,
|
|
71
72
|
contextIdentifierProvider: params.context
|
|
72
73
|
};
|
|
73
|
-
dispatch(mentionPluginKey, newPluginState);
|
|
74
|
+
pmPluginFactoryParams.dispatch(mentionPluginKey, newPluginState);
|
|
74
75
|
return newPluginState;
|
|
75
76
|
}
|
|
76
77
|
|
|
@@ -80,7 +81,14 @@ export function createMentionPlugin(dispatch, providerFactory, portalProviderAPI
|
|
|
80
81
|
},
|
|
81
82
|
props: {
|
|
82
83
|
nodeViews: {
|
|
83
|
-
mention:
|
|
84
|
+
mention: getInlineNodeViewProducer({
|
|
85
|
+
pmPluginFactoryParams,
|
|
86
|
+
Component: MentionNodeView,
|
|
87
|
+
extraComponentProps: {
|
|
88
|
+
providerFactory: pmPluginFactoryParams.providerFactory,
|
|
89
|
+
options
|
|
90
|
+
}
|
|
91
|
+
})
|
|
84
92
|
}
|
|
85
93
|
},
|
|
86
94
|
|
|
@@ -117,13 +125,13 @@ export function createMentionPlugin(dispatch, providerFactory, portalProviderAPI
|
|
|
117
125
|
return;
|
|
118
126
|
};
|
|
119
127
|
|
|
120
|
-
providerFactory.subscribe('mentionProvider', providerHandler);
|
|
121
|
-
providerFactory.subscribe('contextIdentifierProvider', providerHandler);
|
|
128
|
+
pmPluginFactoryParams.providerFactory.subscribe('mentionProvider', providerHandler);
|
|
129
|
+
pmPluginFactoryParams.providerFactory.subscribe('contextIdentifierProvider', providerHandler);
|
|
122
130
|
return {
|
|
123
131
|
destroy() {
|
|
124
|
-
if (providerFactory) {
|
|
125
|
-
providerFactory.unsubscribe('mentionProvider', providerHandler);
|
|
126
|
-
providerFactory.unsubscribe('contextIdentifierProvider', providerHandler);
|
|
132
|
+
if (pmPluginFactoryParams.providerFactory) {
|
|
133
|
+
pmPluginFactoryParams.providerFactory.unsubscribe('mentionProvider', providerHandler);
|
|
134
|
+
pmPluginFactoryParams.providerFactory.unsubscribe('contextIdentifierProvider', providerHandler);
|
|
127
135
|
}
|
|
128
136
|
|
|
129
137
|
if (mentionProvider) {
|
|
@@ -364,11 +364,16 @@ export const createTypeAheadConfig = ({
|
|
|
364
364
|
dismiss({
|
|
365
365
|
editorState,
|
|
366
366
|
query,
|
|
367
|
-
stats
|
|
367
|
+
stats,
|
|
368
|
+
wasItemInserted
|
|
368
369
|
}) {
|
|
369
370
|
firstQueryWithoutResults = null;
|
|
370
371
|
const pickerElapsedTime = stats.startedAt ? Date.now() - stats.startedAt : 0;
|
|
371
|
-
|
|
372
|
+
|
|
373
|
+
if (!wasItemInserted) {
|
|
374
|
+
fireEvent(buildTypeAheadCancelPayload(pickerElapsedTime, stats.keyCount.arrowUp, stats.keyCount.arrowDown, sessionId, query || ''));
|
|
375
|
+
}
|
|
376
|
+
|
|
372
377
|
const pluginState = getMentionPluginState(editorState);
|
|
373
378
|
|
|
374
379
|
if (pluginState !== null && pluginState !== void 0 && pluginState.mentionProvider) {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { css } from '@emotion/react';
|
|
2
2
|
import { panelSharedStyles, PanelSharedCssClassName } from '@atlaskit/editor-common/panel';
|
|
3
3
|
import { SelectionStyle, getSelectionStyles, akEditorDeleteBackground, akEditorDeleteBackgroundWithOpacity, akEditorDeleteBorder, akEditorSelectedBorderSize, akEditorDeleteIconColor, akEditorSelectedNodeClassName } from '@atlaskit/editor-shared-styles';
|
|
4
|
+
import { token } from '@atlaskit/tokens';
|
|
4
5
|
export const panelStyles = props => css`
|
|
5
6
|
.ProseMirror {
|
|
6
7
|
.${PanelSharedCssClassName.prefix} {
|
|
@@ -10,10 +11,10 @@ export const panelStyles = props => css`
|
|
|
10
11
|
&.danger {
|
|
11
12
|
box-shadow: 0 0 0 ${akEditorSelectedBorderSize}px
|
|
12
13
|
${akEditorDeleteBorder};
|
|
13
|
-
background-color: ${akEditorDeleteBackground} !important;
|
|
14
|
+
background-color: ${token('color.background.danger', akEditorDeleteBackground)} !important;
|
|
14
15
|
|
|
15
16
|
.${PanelSharedCssClassName.icon} {
|
|
16
|
-
color: ${akEditorDeleteIconColor} !important;
|
|
17
|
+
color: ${token('color.icon.danger', akEditorDeleteIconColor)} !important;
|
|
17
18
|
}
|
|
18
19
|
}
|
|
19
20
|
}
|
|
@@ -25,10 +26,10 @@ export const panelStyles = props => css`
|
|
|
25
26
|
/* Danger when nested node */
|
|
26
27
|
.danger .${PanelSharedCssClassName.prefix} {
|
|
27
28
|
&[data-panel-type] {
|
|
28
|
-
background-color: ${akEditorDeleteBackgroundWithOpacity};
|
|
29
|
+
background-color: ${token('color.blanket.danger', akEditorDeleteBackgroundWithOpacity)};
|
|
29
30
|
|
|
30
31
|
.${PanelSharedCssClassName.icon} {
|
|
31
|
-
color: ${akEditorDeleteIconColor};
|
|
32
|
+
color: ${token('color.icon.danger', akEditorDeleteIconColor)};
|
|
32
33
|
}
|
|
33
34
|
}
|
|
34
35
|
}
|
|
@@ -3,7 +3,9 @@ import { browser, ZERO_WIDTH_SPACE } from '@atlaskit/editor-common/utils';
|
|
|
3
3
|
|
|
4
4
|
const serializePlaceholderNode = node => {
|
|
5
5
|
const element = document.createElement('span');
|
|
6
|
-
element.classList.add('pm-placeholder');
|
|
6
|
+
element.classList.add('pm-placeholder'); // the inline node api test suite requires the following class name
|
|
7
|
+
|
|
8
|
+
element.classList.add('placeholderView-content-wrap');
|
|
7
9
|
|
|
8
10
|
if (browser.gecko) {
|
|
9
11
|
element.setAttribute('contenteditable', 'true');
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { css } from '@emotion/react';
|
|
2
2
|
import { ruleSharedStyles } from '@atlaskit/editor-common/styles';
|
|
3
3
|
import { akEditorLineHeight, akEditorSelectedBorderColor, akEditorSelectedNodeClassName } from '@atlaskit/editor-shared-styles';
|
|
4
|
+
import { token } from '@atlaskit/tokens';
|
|
4
5
|
export const ruleStyles = props => css`
|
|
5
6
|
.ProseMirror {
|
|
6
7
|
${ruleSharedStyles(props)};
|
|
@@ -13,7 +14,7 @@ export const ruleStyles = props => css`
|
|
|
13
14
|
|
|
14
15
|
&.${akEditorSelectedNodeClassName} {
|
|
15
16
|
outline: none;
|
|
16
|
-
background-color: ${akEditorSelectedBorderColor};
|
|
17
|
+
background-color: ${token('color.border.selected', akEditorSelectedBorderColor)};
|
|
17
18
|
}
|
|
18
19
|
}
|
|
19
20
|
}
|
|
@@ -39,7 +39,7 @@ export const getDecorations = tr => {
|
|
|
39
39
|
}
|
|
40
40
|
|
|
41
41
|
if (tr.selection instanceof TextSelection || tr.selection instanceof AllSelection) {
|
|
42
|
-
const decorations =
|
|
42
|
+
const decorations = getNodesToDecorateFromSelection(tr.selection, tr.doc).map(({
|
|
43
43
|
node,
|
|
44
44
|
pos
|
|
45
45
|
}) => {
|
|
@@ -92,24 +92,17 @@ export function getCellSelectionAnalyticsPayload(state) {
|
|
|
92
92
|
};
|
|
93
93
|
}
|
|
94
94
|
}
|
|
95
|
+
const topLevelBlockNodesThatHaveSelectionStyles = ['table', 'panel', 'expand', 'layoutSection', 'decisionList', 'decisionItem', 'codeBlock'];
|
|
95
96
|
/**
|
|
96
|
-
* Use `
|
|
97
|
-
* a list of
|
|
98
|
-
*
|
|
99
|
-
*
|
|
100
|
-
*
|
|
101
|
-
*
|
|
102
|
-
* For example, using the following document:
|
|
103
|
-
* ```
|
|
104
|
-
* doc(p('{<}one'), blockquote(p('hello')), p(expand({ title: 'two' })(p('three'))), p('four{>}'))))
|
|
105
|
-
* ```
|
|
106
|
-
* we would expect `getTopLevelNodesFromSelection` to return:
|
|
107
|
-
* ```
|
|
108
|
-
* [blockquote(p('hello')), expand({ title: 'two' })(p('three')))]
|
|
109
|
-
* ```
|
|
97
|
+
* Use `getNodesToDecorateFromSelection` to collect and return
|
|
98
|
+
* a list of nodes within the Selection that should have Selection
|
|
99
|
+
* decorations applied. This allows selection styles to be added to
|
|
100
|
+
* nested nodes. It will ignore text nodes as decorations are
|
|
101
|
+
* applied natively and also ignore nodes that don't completely
|
|
102
|
+
* sit within the given `Selection`.
|
|
110
103
|
*/
|
|
111
104
|
|
|
112
|
-
export const
|
|
105
|
+
export const getNodesToDecorateFromSelection = (selection, doc) => {
|
|
113
106
|
const nodes = [];
|
|
114
107
|
|
|
115
108
|
if (selection.from !== selection.to) {
|
|
@@ -118,14 +111,36 @@ export const getTopLevelNodesFromSelection = (selection, doc) => {
|
|
|
118
111
|
to
|
|
119
112
|
} = selection;
|
|
120
113
|
doc.nodesBetween(from, to, (node, pos) => {
|
|
121
|
-
const withinSelection = from <= pos && pos + node.nodeSize <= to;
|
|
122
|
-
|
|
123
|
-
|
|
114
|
+
const withinSelection = from <= pos && pos + node.nodeSize <= to; // The reason we need to check for these nodes is to stop
|
|
115
|
+
// traversing their children if they are within a selection -
|
|
116
|
+
// this is to prevent selection styles from being added to
|
|
117
|
+
// the children as well as the parent node.
|
|
118
|
+
// Example scenario is if an entire table has been selected
|
|
119
|
+
// we should not traverse its children so we can apply the
|
|
120
|
+
// selection styles to the table. But if an entire tableRow
|
|
121
|
+
// has been selected (but the parent table has not) we should
|
|
122
|
+
// traverse it as it could contain other nodes that need
|
|
123
|
+
// selection styles. I couldn’t see a clear way to differentiate
|
|
124
|
+
// without explicitly stating which nodes should be traversed
|
|
125
|
+
// and which shouldn’t.
|
|
126
|
+
|
|
127
|
+
const isTopLevelNodeThatHasSelectionStyles = topLevelBlockNodesThatHaveSelectionStyles.includes(node.type.name); // If the node is a top-level block node and completely sits within
|
|
128
|
+
// the selection, we do not recurse it's children to prevent selection
|
|
129
|
+
// styles being added to its child nodes. The expected behaviour
|
|
130
|
+
// is that selection styles are only added to the parent.
|
|
131
|
+
|
|
132
|
+
if (node && withinSelection && isTopLevelNodeThatHasSelectionStyles) {
|
|
133
|
+
nodes.push({
|
|
134
|
+
node,
|
|
135
|
+
pos
|
|
136
|
+
});
|
|
137
|
+
return false; // Otherwise we recurse the children and return them so we can apply
|
|
138
|
+
// selection styles. Text is handled by the browser.
|
|
139
|
+
} else if (node && withinSelection && !node.isText) {
|
|
124
140
|
nodes.push({
|
|
125
141
|
node,
|
|
126
142
|
pos
|
|
127
143
|
});
|
|
128
|
-
return false;
|
|
129
144
|
}
|
|
130
145
|
|
|
131
146
|
return true;
|