@atlaskit/editor-core 187.15.0 → 187.16.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +17 -0
- package/dist/cjs/create-editor/create-plugins-list.js +2 -7
- package/dist/cjs/create-editor/feature-flags-from-props.js +23 -28
- package/dist/cjs/index.js +0 -7
- package/dist/cjs/plugins/media/toolbar/alt-text.js +5 -2
- package/dist/cjs/plugins/media/toolbar/index.js +7 -5
- package/dist/cjs/plugins/media/toolbar/linking-toolbar-appearance.js +3 -4
- package/dist/cjs/plugins/media/ui/MediaLinkingToolbar.js +1 -2
- package/dist/cjs/plugins/panel/pm-plugins/keymaps.js +13 -4
- package/dist/cjs/plugins/type-ahead/index.js +1 -4
- package/dist/cjs/plugins/type-ahead/pm-plugins/decorations.js +2 -4
- package/dist/cjs/plugins/type-ahead/pm-plugins/main.js +2 -4
- package/dist/cjs/plugins/type-ahead/ui/InputQuery.js +21 -40
- package/dist/cjs/plugins/type-ahead/ui/WrapperTypeAhead.js +5 -9
- package/dist/cjs/plugins/type-ahead/utils.js +15 -19
- package/dist/cjs/version-wrapper.js +1 -1
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/create-editor/create-plugins-list.js +2 -7
- package/dist/es2019/create-editor/feature-flags-from-props.js +23 -28
- package/dist/es2019/index.js +0 -1
- package/dist/es2019/plugins/media/toolbar/alt-text.js +6 -4
- package/dist/es2019/plugins/media/toolbar/index.js +7 -5
- package/dist/es2019/plugins/media/toolbar/linking-toolbar-appearance.js +1 -1
- package/dist/es2019/plugins/media/ui/MediaLinkingToolbar.js +1 -2
- package/dist/es2019/plugins/panel/pm-plugins/keymaps.js +13 -4
- package/dist/es2019/plugins/type-ahead/index.js +1 -4
- package/dist/es2019/plugins/type-ahead/pm-plugins/decorations.js +2 -4
- package/dist/es2019/plugins/type-ahead/pm-plugins/main.js +2 -4
- package/dist/es2019/plugins/type-ahead/ui/InputQuery.js +21 -40
- package/dist/es2019/plugins/type-ahead/ui/WrapperTypeAhead.js +5 -9
- package/dist/es2019/plugins/type-ahead/utils.js +15 -19
- package/dist/es2019/version-wrapper.js +1 -1
- package/dist/es2019/version.json +1 -1
- package/dist/esm/create-editor/create-plugins-list.js +2 -7
- package/dist/esm/create-editor/feature-flags-from-props.js +23 -28
- package/dist/esm/index.js +0 -1
- package/dist/esm/plugins/media/toolbar/alt-text.js +6 -4
- package/dist/esm/plugins/media/toolbar/index.js +7 -5
- package/dist/esm/plugins/media/toolbar/linking-toolbar-appearance.js +1 -1
- package/dist/esm/plugins/media/ui/MediaLinkingToolbar.js +1 -2
- package/dist/esm/plugins/panel/pm-plugins/keymaps.js +13 -4
- package/dist/esm/plugins/type-ahead/index.js +1 -4
- package/dist/esm/plugins/type-ahead/pm-plugins/decorations.js +2 -4
- package/dist/esm/plugins/type-ahead/pm-plugins/main.js +2 -4
- package/dist/esm/plugins/type-ahead/ui/InputQuery.js +21 -40
- package/dist/esm/plugins/type-ahead/ui/WrapperTypeAhead.js +5 -9
- package/dist/esm/plugins/type-ahead/utils.js +15 -19
- package/dist/esm/version-wrapper.js +1 -1
- package/dist/esm/version.json +1 -1
- package/dist/types/create-editor/create-plugins-list.d.ts +6 -6
- package/dist/types/index.d.ts +0 -5
- package/dist/types/plugins/annotation/toolbar.d.ts +1 -1
- package/dist/types/plugins/code-block/toolbar.d.ts +1 -2
- package/dist/types/plugins/copy-button/toolbar.d.ts +1 -1
- package/dist/types/plugins/expand/toolbar.d.ts +1 -1
- package/dist/types/plugins/extension/toolbar.d.ts +1 -1
- package/dist/types/plugins/floating-toolbar/index.d.ts +3 -6
- package/dist/types/plugins/floating-toolbar/ui/CheckboxModal.d.ts +2 -2
- package/dist/types/plugins/floating-toolbar/ui/ConfirmationModal.d.ts +2 -2
- package/dist/types/plugins/floating-toolbar/ui/Dropdown.d.ts +1 -1
- package/dist/types/plugins/floating-toolbar/ui/DropdownMenu.d.ts +1 -1
- package/dist/types/plugins/floating-toolbar/ui/SimpleModal.d.ts +2 -2
- package/dist/types/plugins/floating-toolbar/ui/Toolbar.d.ts +1 -1
- package/dist/types/plugins/layout/index.d.ts +1 -1
- package/dist/types/plugins/layout/toolbar.d.ts +1 -1
- package/dist/types/plugins/media/toolbar/alt-text.d.ts +3 -1
- package/dist/types/plugins/media/toolbar/index.d.ts +1 -1
- package/dist/types/plugins/media/toolbar/linking.d.ts +1 -1
- package/dist/types/plugins/panel/toolbar.d.ts +1 -1
- package/dist/types/plugins/type-ahead/index.d.ts +0 -1
- package/dist/types/plugins/type-ahead/pm-plugins/decorations.d.ts +1 -2
- package/dist/types/plugins/type-ahead/pm-plugins/main.d.ts +1 -2
- package/dist/types/plugins/type-ahead/ui/InputQuery.d.ts +0 -1
- package/dist/types/plugins/type-ahead/ui/WrapperTypeAhead.d.ts +0 -1
- package/dist/types/plugins/type-ahead/utils.d.ts +1 -2
- package/dist/types-ts4.5/create-editor/create-plugins-list.d.ts +6 -6
- package/dist/types-ts4.5/index.d.ts +0 -5
- package/dist/types-ts4.5/plugins/annotation/toolbar.d.ts +1 -1
- package/dist/types-ts4.5/plugins/code-block/toolbar.d.ts +1 -2
- package/dist/types-ts4.5/plugins/copy-button/toolbar.d.ts +1 -1
- package/dist/types-ts4.5/plugins/expand/toolbar.d.ts +1 -1
- package/dist/types-ts4.5/plugins/extension/toolbar.d.ts +1 -1
- package/dist/types-ts4.5/plugins/floating-toolbar/index.d.ts +3 -6
- package/dist/types-ts4.5/plugins/floating-toolbar/ui/CheckboxModal.d.ts +2 -2
- package/dist/types-ts4.5/plugins/floating-toolbar/ui/ConfirmationModal.d.ts +2 -2
- package/dist/types-ts4.5/plugins/floating-toolbar/ui/Dropdown.d.ts +1 -1
- package/dist/types-ts4.5/plugins/floating-toolbar/ui/DropdownMenu.d.ts +1 -1
- package/dist/types-ts4.5/plugins/floating-toolbar/ui/SimpleModal.d.ts +2 -2
- package/dist/types-ts4.5/plugins/floating-toolbar/ui/Toolbar.d.ts +1 -1
- package/dist/types-ts4.5/plugins/layout/index.d.ts +1 -1
- package/dist/types-ts4.5/plugins/layout/toolbar.d.ts +1 -1
- package/dist/types-ts4.5/plugins/media/toolbar/alt-text.d.ts +3 -1
- package/dist/types-ts4.5/plugins/media/toolbar/index.d.ts +1 -1
- package/dist/types-ts4.5/plugins/media/toolbar/linking.d.ts +1 -1
- package/dist/types-ts4.5/plugins/panel/toolbar.d.ts +1 -1
- package/dist/types-ts4.5/plugins/type-ahead/index.d.ts +0 -1
- package/dist/types-ts4.5/plugins/type-ahead/pm-plugins/decorations.d.ts +1 -2
- package/dist/types-ts4.5/plugins/type-ahead/pm-plugins/main.d.ts +1 -2
- package/dist/types-ts4.5/plugins/type-ahead/ui/InputQuery.d.ts +0 -1
- package/dist/types-ts4.5/plugins/type-ahead/ui/WrapperTypeAhead.d.ts +0 -1
- package/dist/types-ts4.5/plugins/type-ahead/utils.d.ts +1 -2
- package/package.json +2 -2
- package/report.api.md +1 -48
- package/tmp/api-report-tmp.d.ts +1 -46
- package/dist/cjs/plugins/floating-toolbar/types.js +0 -5
- package/dist/cjs/plugins/floating-toolbar/ui/types.js +0 -5
- package/dist/es2019/plugins/floating-toolbar/types.js +0 -1
- package/dist/es2019/plugins/floating-toolbar/ui/types.js +0 -1
- package/dist/esm/plugins/floating-toolbar/types.js +0 -1
- package/dist/esm/plugins/floating-toolbar/ui/types.js +0 -1
- package/dist/types/plugins/floating-toolbar/types.d.ts +0 -1
- package/dist/types/plugins/floating-toolbar/ui/types.d.ts +0 -1
- package/dist/types-ts4.5/plugins/floating-toolbar/types.d.ts +0 -1
- package/dist/types-ts4.5/plugins/floating-toolbar/ui/types.d.ts +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
# @atlaskit/editor-core
|
|
2
2
|
|
|
3
|
+
## 187.16.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [`3413f770f2b`](https://bitbucket.org/atlassian/atlassian-frontend/commits/3413f770f2b) - Moving references to floating-toolbar types to `editor-common`
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- [`3a43f854e59`](https://bitbucket.org/atlassian/atlassian-frontend/commits/3a43f854e59) - [ux] ED-18841: When cursor inside panel, at start of content, is backspaced, it should lift panel line of content out of panel, instead of only selecting the node above it (such as an expand or table node).
|
|
12
|
+
- Updated dependencies
|
|
13
|
+
|
|
14
|
+
## 187.15.1
|
|
15
|
+
|
|
16
|
+
### Patch Changes
|
|
17
|
+
|
|
18
|
+
- [`3df14c86161`](https://bitbucket.org/atlassian/atlassian-frontend/commits/3df14c86161) - Cleaning up better typeahead feature flag.
|
|
19
|
+
|
|
3
20
|
## 187.15.0
|
|
4
21
|
|
|
5
22
|
### Minor Changes
|
|
@@ -44,21 +44,16 @@ function getScrollGutterOptions(props) {
|
|
|
44
44
|
return undefined;
|
|
45
45
|
}
|
|
46
46
|
function getDefaultPresetOptionsFromEditorProps(props, createAnalyticsEvent) {
|
|
47
|
-
var _props$performanceTra, _props$linking,
|
|
47
|
+
var _props$performanceTra, _props$linking, _props$performanceTra2, _props$textFormatting, _props$linking2;
|
|
48
48
|
var appearance = props.appearance;
|
|
49
49
|
var isMobile = appearance === 'mobile';
|
|
50
50
|
var inputTracking = (_props$performanceTra = props.performanceTracking) === null || _props$performanceTra === void 0 ? void 0 : _props$performanceTra.inputTracking;
|
|
51
51
|
var cardOptions = ((_props$linking = props.linking) === null || _props$linking === void 0 ? void 0 : _props$linking.smartLinks) || props.smartLinks || props.UNSAFE_cards;
|
|
52
|
-
|
|
53
|
-
// duplicated logic from `feature-flags-from-props.ts` due to presets not being finalised
|
|
54
|
-
var pseudoNormalisedUseBetterTypeaheadNavigation = (_ref = (_props$featureFlags$u = (_props$featureFlags = props.featureFlags) === null || _props$featureFlags === void 0 ? void 0 : _props$featureFlags['use-better-typeahead-navigation']) !== null && _props$featureFlags$u !== void 0 ? _props$featureFlags$u : (_props$featureFlags2 = props.featureFlags) === null || _props$featureFlags2 === void 0 ? void 0 : _props$featureFlags2.useBetterTypeaheadNavigation) !== null && _ref !== void 0 ? _ref : null;
|
|
55
|
-
var useBetterTypeaheadNavigation = Boolean(typeof pseudoNormalisedUseBetterTypeaheadNavigation === 'boolean' ? !!pseudoNormalisedUseBetterTypeaheadNavigation : true);
|
|
56
52
|
return _objectSpread(_objectSpread({}, props), {}, {
|
|
57
53
|
createAnalyticsEvent: createAnalyticsEvent,
|
|
58
54
|
typeAhead: {
|
|
59
55
|
createAnalyticsEvent: createAnalyticsEvent,
|
|
60
|
-
isMobile: isMobile
|
|
61
|
-
useBetterTypeaheadNavigation: useBetterTypeaheadNavigation
|
|
56
|
+
isMobile: isMobile
|
|
62
57
|
},
|
|
63
58
|
featureFlags: (0, _featureFlagsFromProps.createFeatureFlagsFromProps)(props),
|
|
64
59
|
paste: {
|
|
@@ -32,12 +32,9 @@ function getSpellCheck(featureFlags) {
|
|
|
32
32
|
* which is used by both current and archv3 editors.
|
|
33
33
|
*/
|
|
34
34
|
function createFeatureFlagsFromProps(props) {
|
|
35
|
-
var _props$featureFlags,
|
|
35
|
+
var _props$featureFlags, _props$allowLayouts, _props$performanceTra, _props$performanceTra2, _props$featureFlags2, _props$featureFlags3, _props$allowTables, _props$featureFlags4, _props$featureFlags5, _props$allowTables2, _props$featureFlags6, _props$featureFlags7, _props$allowTables3, _props$featureFlags8, _props$featureFlags9, _props$allowTables4, _props$allowTables5, _props$featureFlags10, _props$featureFlags11, _props$allowTables6, _props$allowExtension, _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$collabEdit, _props$collabEdit2, _props$featureFlags30, _props$featureFlags31, _props$featureFlags32, _props$featureFlags33, _props$featureFlags34, _props$featureFlags35, _props$featureFlags36, _props$featureFlags37, _props$featureFlags38, _props$featureFlags39, _props$featureFlags40, _props$featureFlags41, _props$featureFlags42;
|
|
36
36
|
var normalizedFeatureFlags = (0, _normalizeFeatureFlags.normalizeFeatureFlags)(props.featureFlags);
|
|
37
37
|
var tableCellOptionsInFloatingToolbar = normalizedFeatureFlags.tableCellOptionsInFloatingToolbar || ((_props$featureFlags = props.featureFlags) === null || _props$featureFlags === void 0 ? void 0 : _props$featureFlags.tableCellOptionsInFloatingToolbar) || undefined;
|
|
38
|
-
|
|
39
|
-
// duplicated logic from `feature-flags-from-props.ts` due to presets not being finalised
|
|
40
|
-
var pseudoNormalisedUseBetterTypeaheadNavigation = (_ref = (_props$featureFlags$u = (_props$featureFlags2 = props.featureFlags) === null || _props$featureFlags2 === void 0 ? void 0 : _props$featureFlags2['use-better-typeahead-navigation']) !== null && _props$featureFlags$u !== void 0 ? _props$featureFlags$u : (_props$featureFlags3 = props.featureFlags) === null || _props$featureFlags3 === void 0 ? void 0 : _props$featureFlags3.useBetterTypeaheadNavigation) !== null && _ref !== void 0 ? _ref : null;
|
|
41
38
|
return _objectSpread(_objectSpread({}, normalizedFeatureFlags), {}, {
|
|
42
39
|
newInsertionBehaviour: props.allowNewInsertionBehaviour,
|
|
43
40
|
interactiveExpand: typeof props.allowExpand === 'boolean' ? props.allowExpand : Boolean(props.allowExpand && props.allowExpand.allowInteractiveExpand !== false),
|
|
@@ -48,36 +45,34 @@ function createFeatureFlagsFromProps(props) {
|
|
|
48
45
|
singleLayout: (0, _typeof2.default)(props.allowLayouts) === 'object' && !!((_props$allowLayouts = props.allowLayouts) !== null && _props$allowLayouts !== void 0 && _props$allowLayouts.UNSAFE_allowSingleColumnLayout),
|
|
49
46
|
undoRedoButtons: props.allowUndoRedoButtons,
|
|
50
47
|
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,
|
|
51
|
-
stickyHeadersOptimization: typeof ((_props$
|
|
52
|
-
initialRenderOptimization: typeof ((_props$
|
|
53
|
-
mouseMoveOptimization: typeof ((_props$
|
|
54
|
-
tableRenderOptimization: typeof ((_props$
|
|
55
|
-
tableOverflowShadowsOptimization: typeof ((_props$
|
|
48
|
+
stickyHeadersOptimization: typeof ((_props$featureFlags2 = props.featureFlags) === null || _props$featureFlags2 === void 0 ? void 0 : _props$featureFlags2.stickyHeadersOptimization) === 'boolean' ? !!((_props$featureFlags3 = props.featureFlags) !== null && _props$featureFlags3 !== void 0 && _props$featureFlags3.stickyHeadersOptimization) : (0, _typeof2.default)(props.allowTables) === 'object' && !!((_props$allowTables = props.allowTables) !== null && _props$allowTables !== void 0 && _props$allowTables.stickyHeadersOptimization),
|
|
49
|
+
initialRenderOptimization: typeof ((_props$featureFlags4 = props.featureFlags) === null || _props$featureFlags4 === void 0 ? void 0 : _props$featureFlags4.initialRenderOptimization) === 'boolean' ? !!((_props$featureFlags5 = props.featureFlags) !== null && _props$featureFlags5 !== void 0 && _props$featureFlags5.initialRenderOptimization) : (0, _typeof2.default)(props.allowTables) === 'object' && !!((_props$allowTables2 = props.allowTables) !== null && _props$allowTables2 !== void 0 && _props$allowTables2.initialRenderOptimization),
|
|
50
|
+
mouseMoveOptimization: typeof ((_props$featureFlags6 = props.featureFlags) === null || _props$featureFlags6 === void 0 ? void 0 : _props$featureFlags6.mouseMoveOptimization) === 'boolean' ? !!((_props$featureFlags7 = props.featureFlags) !== null && _props$featureFlags7 !== void 0 && _props$featureFlags7.mouseMoveOptimization) : (0, _typeof2.default)(props.allowTables) === 'object' && !!((_props$allowTables3 = props.allowTables) !== null && _props$allowTables3 !== void 0 && _props$allowTables3.mouseMoveOptimization),
|
|
51
|
+
tableRenderOptimization: typeof ((_props$featureFlags8 = props.featureFlags) === null || _props$featureFlags8 === void 0 ? void 0 : _props$featureFlags8.tableRenderOptimization) === 'boolean' ? !!((_props$featureFlags9 = props.featureFlags) !== null && _props$featureFlags9 !== void 0 && _props$featureFlags9.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,
|
|
52
|
+
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) : (0, _typeof2.default)(props.allowTables) === 'object' && !!((_props$allowTables6 = props.allowTables) !== null && _props$allowTables6 !== void 0 && _props$allowTables6.tableOverflowShadowsOptimization),
|
|
56
53
|
extendFloatingToolbar: Boolean((0, _typeof2.default)(props.allowExtension) === 'object' && ((_props$allowExtension = props.allowExtension) === null || _props$allowExtension === void 0 ? void 0 : _props$allowExtension.allowExtendFloatingToolbars)),
|
|
57
|
-
showAvatarGroupAsPlugin: Boolean(typeof ((_props$
|
|
58
|
-
errorBoundaryDocStructure: Boolean(typeof ((_props$
|
|
59
|
-
synchronyErrorDocStructure: Boolean(typeof ((_props$
|
|
60
|
-
enableViewUpdateSubscription: Boolean(typeof ((_props$
|
|
61
|
-
collabAvatarScroll: Boolean(typeof ((_props$
|
|
62
|
-
ufo: Boolean(typeof ((_props$
|
|
63
|
-
twoLineEditorToolbar: Boolean(typeof ((_props$
|
|
64
|
-
saferDispatchedTransactions: Boolean(typeof normalizedFeatureFlags.saferDispatchedTransactions === 'boolean' && !!normalizedFeatureFlags.saferDispatchedTransactions || (typeof ((_props$
|
|
65
|
-
saferDispatchedTransactionsAnalyticsOnly: Boolean(typeof normalizedFeatureFlags.saferDispatchedTransactionsAnalyticsOnly === 'boolean' && !!normalizedFeatureFlags.saferDispatchedTransactionsAnalyticsOnly || (typeof ((_props$
|
|
54
|
+
showAvatarGroupAsPlugin: Boolean(typeof ((_props$featureFlags12 = props.featureFlags) === null || _props$featureFlags12 === void 0 ? void 0 : _props$featureFlags12.showAvatarGroupAsPlugin) === 'boolean' ? !!((_props$featureFlags13 = props.featureFlags) !== null && _props$featureFlags13 !== void 0 && _props$featureFlags13.showAvatarGroupAsPlugin) : false),
|
|
55
|
+
errorBoundaryDocStructure: Boolean(typeof ((_props$featureFlags14 = props.featureFlags) === null || _props$featureFlags14 === void 0 ? void 0 : _props$featureFlags14.useErrorBoundaryDocStructure) === 'boolean' ? !!((_props$featureFlags15 = props.featureFlags) !== null && _props$featureFlags15 !== void 0 && _props$featureFlags15.useErrorBoundaryDocStructure) : false),
|
|
56
|
+
synchronyErrorDocStructure: Boolean(typeof ((_props$featureFlags16 = props.featureFlags) === null || _props$featureFlags16 === void 0 ? void 0 : _props$featureFlags16.synchronyErrorDocStructure) === 'boolean' ? !!((_props$featureFlags17 = props.featureFlags) !== null && _props$featureFlags17 !== void 0 && _props$featureFlags17.synchronyErrorDocStructure) : false),
|
|
57
|
+
enableViewUpdateSubscription: Boolean(typeof ((_props$featureFlags18 = props.featureFlags) === null || _props$featureFlags18 === void 0 ? void 0 : _props$featureFlags18.enableViewUpdateSubscription) === 'boolean' ? !!((_props$featureFlags19 = props.featureFlags) !== null && _props$featureFlags19 !== void 0 && _props$featureFlags19.enableViewUpdateSubscription) : false),
|
|
58
|
+
collabAvatarScroll: Boolean(typeof ((_props$featureFlags20 = props.featureFlags) === null || _props$featureFlags20 === void 0 ? void 0 : _props$featureFlags20.collabAvatarScroll) === 'boolean' ? !!((_props$featureFlags21 = props.featureFlags) !== null && _props$featureFlags21 !== void 0 && _props$featureFlags21.collabAvatarScroll) : false),
|
|
59
|
+
ufo: Boolean(typeof ((_props$featureFlags22 = props.featureFlags) === null || _props$featureFlags22 === void 0 ? void 0 : _props$featureFlags22.ufo) === 'boolean' ? !!((_props$featureFlags23 = props.featureFlags) !== null && _props$featureFlags23 !== void 0 && _props$featureFlags23.ufo) : false),
|
|
60
|
+
twoLineEditorToolbar: Boolean(typeof ((_props$featureFlags24 = props.featureFlags) === null || _props$featureFlags24 === void 0 ? void 0 : _props$featureFlags24.twoLineEditorToolbar) === 'boolean' ? !!((_props$featureFlags25 = props.featureFlags) !== null && _props$featureFlags25 !== void 0 && _props$featureFlags25.twoLineEditorToolbar) : false),
|
|
61
|
+
saferDispatchedTransactions: Boolean(typeof normalizedFeatureFlags.saferDispatchedTransactions === 'boolean' && !!normalizedFeatureFlags.saferDispatchedTransactions || (typeof ((_props$featureFlags26 = props.featureFlags) === null || _props$featureFlags26 === void 0 ? void 0 : _props$featureFlags26.saferDispatchedTransactions) === 'boolean' ? !!((_props$featureFlags27 = props.featureFlags) !== null && _props$featureFlags27 !== void 0 && _props$featureFlags27.saferDispatchedTransactions) : false)),
|
|
62
|
+
saferDispatchedTransactionsAnalyticsOnly: Boolean(typeof normalizedFeatureFlags.saferDispatchedTransactionsAnalyticsOnly === 'boolean' && !!normalizedFeatureFlags.saferDispatchedTransactionsAnalyticsOnly || (typeof ((_props$featureFlags28 = props.featureFlags) === null || _props$featureFlags28 === void 0 ? void 0 : _props$featureFlags28.saferDispatchedTransactionsAnalyticsOnly) === 'boolean' ? !!((_props$featureFlags29 = props.featureFlags) !== null && _props$featureFlags29 !== void 0 && _props$featureFlags29.saferDispatchedTransactionsAnalyticsOnly) : false)),
|
|
66
63
|
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),
|
|
67
|
-
chromeCursorHandlerFixedVersion: typeof ((_props$
|
|
64
|
+
chromeCursorHandlerFixedVersion: typeof ((_props$featureFlags30 = props.featureFlags) === null || _props$featureFlags30 === void 0 ? void 0 : _props$featureFlags30.chromeCursorHandlerFixedVersion) === 'string' ? Number(props.featureFlags.chromeCursorHandlerFixedVersion) || undefined : undefined,
|
|
68
65
|
tableCellOptionsInFloatingToolbar: typeof tableCellOptionsInFloatingToolbar === 'boolean' ? tableCellOptionsInFloatingToolbar : false,
|
|
69
|
-
showHoverPreview: Boolean(typeof ((_props$
|
|
70
|
-
indentationButtonsInTheToolbar: Boolean(typeof normalizedFeatureFlags.indentationButtonsInTheToolbar === 'boolean' && !!normalizedFeatureFlags.indentationButtonsInTheToolbar || (typeof ((_props$
|
|
71
|
-
floatingToolbarCopyButton: Boolean(typeof normalizedFeatureFlags.floatingToolbarCopyButton === 'boolean' && !!normalizedFeatureFlags.floatingToolbarCopyButton || (typeof ((_props$
|
|
72
|
-
floatingToolbarLinkSettingsButton: typeof ((_props$
|
|
66
|
+
showHoverPreview: Boolean(typeof ((_props$featureFlags31 = props.featureFlags) === null || _props$featureFlags31 === void 0 ? void 0 : _props$featureFlags31.showHoverPreview) === 'boolean' ? !!((_props$featureFlags32 = props.featureFlags) !== null && _props$featureFlags32 !== void 0 && _props$featureFlags32.showHoverPreview) : false),
|
|
67
|
+
indentationButtonsInTheToolbar: Boolean(typeof normalizedFeatureFlags.indentationButtonsInTheToolbar === 'boolean' && !!normalizedFeatureFlags.indentationButtonsInTheToolbar || (typeof ((_props$featureFlags33 = props.featureFlags) === null || _props$featureFlags33 === void 0 ? void 0 : _props$featureFlags33.indentationButtonsInTheToolbar) === 'boolean' ? !!((_props$featureFlags34 = props.featureFlags) !== null && _props$featureFlags34 !== void 0 && _props$featureFlags34.indentationButtonsInTheToolbar) : false)),
|
|
68
|
+
floatingToolbarCopyButton: Boolean(typeof normalizedFeatureFlags.floatingToolbarCopyButton === 'boolean' && !!normalizedFeatureFlags.floatingToolbarCopyButton || (typeof ((_props$featureFlags35 = props.featureFlags) === null || _props$featureFlags35 === void 0 ? void 0 : _props$featureFlags35.floatingToolbarCopyButton) === 'boolean' ? !!((_props$featureFlags36 = props.featureFlags) !== null && _props$featureFlags36 !== void 0 && _props$featureFlags36.floatingToolbarCopyButton) : false)),
|
|
69
|
+
floatingToolbarLinkSettingsButton: typeof ((_props$featureFlags37 = props.featureFlags) === null || _props$featureFlags37 === void 0 ? void 0 : _props$featureFlags37['floating-toolbar-link-settings-button']) === 'string' ? props.featureFlags['floating-toolbar-link-settings-button'] || undefined : undefined,
|
|
73
70
|
disableSpellcheckByBrowser: getSpellCheck(props.featureFlags),
|
|
74
71
|
// Including fallback to props.featureFlags so that mobile feature flags
|
|
75
72
|
// are included (they are not kebab cased)
|
|
76
|
-
restartNumberedLists: normalizedFeatureFlags.restartNumberedLists === true || ((_props$
|
|
77
|
-
useSomewhatSemanticTextColorNames: Boolean(typeof normalizedFeatureFlags.useSomewhatSemanticTextColorNames === 'boolean' && !!normalizedFeatureFlags.useSomewhatSemanticTextColorNames || (typeof ((_props$
|
|
73
|
+
restartNumberedLists: normalizedFeatureFlags.restartNumberedLists === true || ((_props$featureFlags38 = props.featureFlags) === null || _props$featureFlags38 === void 0 ? void 0 : _props$featureFlags38.restartNumberedLists) === true,
|
|
74
|
+
useSomewhatSemanticTextColorNames: Boolean(typeof normalizedFeatureFlags.useSomewhatSemanticTextColorNames === 'boolean' && !!normalizedFeatureFlags.useSomewhatSemanticTextColorNames || (typeof ((_props$featureFlags39 = props.featureFlags) === null || _props$featureFlags39 === void 0 ? void 0 : _props$featureFlags39.useSomewhatSemanticTextColorNames) === 'boolean' ? !!((_props$featureFlags40 = props.featureFlags) !== null && _props$featureFlags40 !== void 0 && _props$featureFlags40.useSomewhatSemanticTextColorNames) : false)),
|
|
78
75
|
lpLinkPickerFocusTrap: Boolean(normalizedFeatureFlags.lpLinkPickerFocusTrap),
|
|
79
|
-
preventPopupOverflow: Boolean(typeof ((_props$
|
|
80
|
-
// duplicated logic from `create-plugins-list.ts` due to presets not being finalised
|
|
81
|
-
useBetterTypeaheadNavigation: Boolean(typeof pseudoNormalisedUseBetterTypeaheadNavigation === 'boolean' ? !!pseudoNormalisedUseBetterTypeaheadNavigation : true)
|
|
76
|
+
preventPopupOverflow: Boolean(typeof ((_props$featureFlags41 = props.featureFlags) === null || _props$featureFlags41 === void 0 ? void 0 : _props$featureFlags41['prevent-popup-overflow']) === 'boolean' ? !!((_props$featureFlags42 = props.featureFlags) !== null && _props$featureFlags42 !== void 0 && _props$featureFlags42['prevent-popup-overflow']) : false)
|
|
82
77
|
});
|
|
83
78
|
}
|
package/dist/cjs/index.js
CHANGED
|
@@ -263,12 +263,6 @@ Object.defineProperty(exports, "deleteDate", {
|
|
|
263
263
|
return _actions.deleteDate;
|
|
264
264
|
}
|
|
265
265
|
});
|
|
266
|
-
Object.defineProperty(exports, "floatingToolbarPluginKey", {
|
|
267
|
-
enumerable: true,
|
|
268
|
-
get: function get() {
|
|
269
|
-
return _floatingToolbar.pluginKey;
|
|
270
|
-
}
|
|
271
|
-
});
|
|
272
266
|
Object.defineProperty(exports, "getDefaultPresetOptionsFromEditorProps", {
|
|
273
267
|
enumerable: true,
|
|
274
268
|
get: function get() {
|
|
@@ -556,7 +550,6 @@ var _gapCursorSelection = require("./plugins/selection/gap-cursor-selection");
|
|
|
556
550
|
var _mobileSelection = require("./plugins/mobile-selection");
|
|
557
551
|
var _commands7 = require("./plugins/expand/commands");
|
|
558
552
|
var _WithPluginState = _interopRequireDefault(require("./ui/WithPluginState"));
|
|
559
|
-
var _floatingToolbar = require("./plugins/floating-toolbar");
|
|
560
553
|
var _statusColorPalette = require("./ui/ColorPalette/Palettes/statusColorPalette");
|
|
561
554
|
var _common = require("./ui/ColorPalette/Palettes/common");
|
|
562
555
|
var _messages = _interopRequireWildcard(require("./messages"));
|
|
@@ -14,7 +14,6 @@ var _messages = require("../pm-plugins/alt-text/messages");
|
|
|
14
14
|
var _AltTextEdit = _interopRequireWildcard(require("../pm-plugins/alt-text/ui/AltTextEdit"));
|
|
15
15
|
var _mediaCommon = require("../utils/media-common");
|
|
16
16
|
var _style = require("../pm-plugins/alt-text/style");
|
|
17
|
-
var _forceFocus = require("../../floating-toolbar/pm-plugins/force-focus");
|
|
18
17
|
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); }
|
|
19
18
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
20
19
|
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; }
|
|
@@ -55,9 +54,13 @@ var altTextEditComponent = function altTextEditComponent(options) {
|
|
|
55
54
|
* and not close the floating toolbar.
|
|
56
55
|
*/
|
|
57
56
|
var handleEsc = function handleEsc() {
|
|
57
|
+
var _options$forceFocusSe;
|
|
58
58
|
var tr = view.state.tr,
|
|
59
59
|
dispatch = view.dispatch;
|
|
60
|
-
|
|
60
|
+
var newTr = options === null || options === void 0 ? void 0 : (_options$forceFocusSe = options.forceFocusSelector) === null || _options$forceFocusSe === void 0 ? void 0 : _options$forceFocusSe.call(options, "[data-testid=\"".concat(testId, "\"]"))(tr);
|
|
61
|
+
if (newTr) {
|
|
62
|
+
dispatch(newTr);
|
|
63
|
+
}
|
|
61
64
|
};
|
|
62
65
|
return /*#__PURE__*/_react.default.createElement(_AltTextEdit.default, {
|
|
63
66
|
view: view,
|
|
@@ -425,8 +425,10 @@ var floatingToolbar = function floatingToolbar(state, intl) {
|
|
|
425
425
|
if (allowAltTextOnImages) {
|
|
426
426
|
var mediaAltTextPluginState = (0, _altText.getPluginState)(state);
|
|
427
427
|
if (mediaAltTextPluginState.isAltTextEditorOpen) {
|
|
428
|
+
var _pluginInjectionApi$d9;
|
|
428
429
|
return (0, _altText2.getAltTextToolbar)(baseToolbar, {
|
|
429
|
-
altTextValidator: altTextValidator
|
|
430
|
+
altTextValidator: altTextValidator,
|
|
431
|
+
forceFocusSelector: pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$d9 = pluginInjectionApi.dependencies.floatingToolbar.actions) === null || _pluginInjectionApi$d9 === void 0 ? void 0 : _pluginInjectionApi$d9.forceFocusSelector
|
|
430
432
|
});
|
|
431
433
|
}
|
|
432
434
|
}
|
|
@@ -437,22 +439,22 @@ var floatingToolbar = function floatingToolbar(state, intl) {
|
|
|
437
439
|
selectedNodeType = state.selection.node.type;
|
|
438
440
|
}
|
|
439
441
|
if (allowMediaInline && (parentMediaGroupNode === null || parentMediaGroupNode === void 0 ? void 0 : parentMediaGroupNode.node.type) === mediaGroup) {
|
|
440
|
-
var _pluginInjectionApi$
|
|
442
|
+
var _pluginInjectionApi$d10, _pluginInjectionApi$d11;
|
|
441
443
|
var mediaOffset = state.selection.$from.parentOffset + 1;
|
|
442
444
|
baseToolbar.getDomRef = function () {
|
|
443
445
|
var _mediaPluginState$ele;
|
|
444
446
|
var selector = (0, _mediaFilmstrip.mediaFilmstripItemDOMSelector)(mediaOffset);
|
|
445
447
|
return (_mediaPluginState$ele = mediaPluginState.element) === null || _mediaPluginState$ele === void 0 ? void 0 : _mediaPluginState$ele.querySelector(selector);
|
|
446
448
|
};
|
|
447
|
-
items = generateMediaCardFloatingToolbar(state, intl, mediaPluginState, hoverDecoration, pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$
|
|
449
|
+
items = generateMediaCardFloatingToolbar(state, intl, mediaPluginState, hoverDecoration, pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$d10 = pluginInjectionApi.dependencies) === null || _pluginInjectionApi$d10 === void 0 ? void 0 : (_pluginInjectionApi$d11 = _pluginInjectionApi$d10.analytics) === null || _pluginInjectionApi$d11 === void 0 ? void 0 : _pluginInjectionApi$d11.actions);
|
|
448
450
|
} else if (allowMediaInline && selectedNodeType && selectedNodeType === mediaInline) {
|
|
449
|
-
var _pluginInjectionApi$
|
|
451
|
+
var _pluginInjectionApi$d12, _pluginInjectionApi$d13;
|
|
450
452
|
baseToolbar.getDomRef = function () {
|
|
451
453
|
var _mediaPluginState$ele2;
|
|
452
454
|
var element = (_mediaPluginState$ele2 = mediaPluginState.element) === null || _mediaPluginState$ele2 === void 0 ? void 0 : _mediaPluginState$ele2.querySelector(".".concat(_styles.MediaInlineNodeSelector));
|
|
453
455
|
return element || mediaPluginState.element;
|
|
454
456
|
};
|
|
455
|
-
items = generateMediaInlineFloatingToolbar(state, intl, mediaPluginState, hoverDecoration, pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$
|
|
457
|
+
items = generateMediaInlineFloatingToolbar(state, intl, mediaPluginState, hoverDecoration, pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$d12 = pluginInjectionApi.dependencies) === null || _pluginInjectionApi$d12 === void 0 ? void 0 : (_pluginInjectionApi$d13 = _pluginInjectionApi$d12.analytics) === null || _pluginInjectionApi$d13 === void 0 ? void 0 : _pluginInjectionApi$d13.actions);
|
|
456
458
|
} else {
|
|
457
459
|
baseToolbar.getDomRef = function () {
|
|
458
460
|
var _mediaPluginState$ele3;
|
|
@@ -15,7 +15,6 @@ var _shortcut = _interopRequireDefault(require("@atlaskit/icon/glyph/shortcut"))
|
|
|
15
15
|
var _adfSchema = require("@atlaskit/adf-schema");
|
|
16
16
|
var _checkMediaType = require("../utils/check-media-type");
|
|
17
17
|
var _ui = require("@atlaskit/editor-common/ui");
|
|
18
|
-
var _Separator = _interopRequireDefault(require("../../floating-toolbar/ui/Separator"));
|
|
19
18
|
var _messages = require("../../../messages");
|
|
20
19
|
var _messages2 = require("@atlaskit/editor-common/messages");
|
|
21
20
|
var _keymaps = require("../../../keymaps");
|
|
@@ -73,7 +72,7 @@ var LinkToolbarAppearance = function LinkToolbarAppearance(_ref) {
|
|
|
73
72
|
testId: "edit-link-button"
|
|
74
73
|
}, title)), (0, _react2.jsx)("div", {
|
|
75
74
|
css: wrapper
|
|
76
|
-
}, (0, _react2.jsx)(
|
|
75
|
+
}, (0, _react2.jsx)(_ui.FloatingToolbarSeparator, null)), (0, _react2.jsx)(_ui.FloatingToolbarButton, {
|
|
77
76
|
target: "_blank",
|
|
78
77
|
href: isValidUrl ? mediaLinkingState.link : undefined,
|
|
79
78
|
disabled: !isValidUrl,
|
|
@@ -83,7 +82,7 @@ var LinkToolbarAppearance = function LinkToolbarAppearance(_ref) {
|
|
|
83
82
|
label: linkTitle
|
|
84
83
|
}),
|
|
85
84
|
className: "hyperlink-open-link"
|
|
86
|
-
}), (0, _react2.jsx)(
|
|
85
|
+
}), (0, _react2.jsx)(_ui.FloatingToolbarSeparator, null));
|
|
87
86
|
} else {
|
|
88
87
|
var _title = intl.formatMessage(_messages2.linkToolbarMessages.addLink);
|
|
89
88
|
return (0, _react2.jsx)(_react.Fragment, null, (0, _react2.jsx)(_ui.FloatingToolbarButton, {
|
|
@@ -97,7 +96,7 @@ var LinkToolbarAppearance = function LinkToolbarAppearance(_ref) {
|
|
|
97
96
|
icon: (0, _react2.jsx)(_link.default, {
|
|
98
97
|
label: _title
|
|
99
98
|
})
|
|
100
|
-
}), (0, _react2.jsx)(
|
|
99
|
+
}), (0, _react2.jsx)(_ui.FloatingToolbarSeparator, null));
|
|
101
100
|
}
|
|
102
101
|
};
|
|
103
102
|
exports.LinkToolbarAppearance = LinkToolbarAppearance;
|
|
@@ -19,7 +19,6 @@ var _react2 = require("@emotion/react");
|
|
|
19
19
|
var _ui = require("@atlaskit/editor-common/ui");
|
|
20
20
|
var _chevronLeftLarge = _interopRequireDefault(require("@atlaskit/icon/glyph/chevron-left-large"));
|
|
21
21
|
var _unlink = _interopRequireDefault(require("@atlaskit/icon/glyph/editor/unlink"));
|
|
22
|
-
var _Separator = _interopRequireDefault(require("../../floating-toolbar/ui/Separator"));
|
|
23
22
|
var _link = require("@atlaskit/editor-common/link");
|
|
24
23
|
var _messages = require("@atlaskit/editor-common/messages");
|
|
25
24
|
var _utils = require("@atlaskit/editor-common/utils");
|
|
@@ -143,7 +142,7 @@ var LinkAddToolbar = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
143
142
|
_onChange(value);
|
|
144
143
|
},
|
|
145
144
|
onKeyDown: onKeyDown
|
|
146
|
-
}), (0, _utils.normalizeUrl)(displayUrl) && (0, _react2.jsx)(_react.Fragment, null, (0, _react2.jsx)(
|
|
145
|
+
}), (0, _utils.normalizeUrl)(displayUrl) && (0, _react2.jsx)(_react.Fragment, null, (0, _react2.jsx)(_ui.FloatingToolbarSeparator, null), (0, _react2.jsx)(_ui.FloatingToolbarButton, {
|
|
147
146
|
title: formatUnlinkText,
|
|
148
147
|
icon: (0, _react2.jsx)(_unlink.default, {
|
|
149
148
|
label: formatUnlinkText
|
|
@@ -27,6 +27,7 @@ function keymapPlugin() {
|
|
|
27
27
|
};
|
|
28
28
|
var keymaps = {
|
|
29
29
|
Backspace: function Backspace(state, dispatch) {
|
|
30
|
+
var _nodeBeforePanel$type, _nodeBeforePanel$type2;
|
|
30
31
|
var selection = state.selection,
|
|
31
32
|
nodes = state.schema.nodes,
|
|
32
33
|
tr = state.tr;
|
|
@@ -43,17 +44,25 @@ function keymapPlugin() {
|
|
|
43
44
|
if ($from.parentOffset !== 0) {
|
|
44
45
|
return false;
|
|
45
46
|
}
|
|
46
|
-
var previousPos = tr.doc.resolve(Math.max(0, $from.before($from.depth) - 1));
|
|
47
|
-
var previousNodeType = previousPos.pos > 0 && previousPos.parent && previousPos.parent.type;
|
|
47
|
+
var $previousPos = tr.doc.resolve(Math.max(0, $from.before($from.depth) - 1));
|
|
48
|
+
var previousNodeType = $previousPos.pos > 0 && $previousPos.parent && $previousPos.parent.type;
|
|
48
49
|
var parentNodeType = $from.parent.type;
|
|
49
50
|
var isPreviousNodeAPanel = previousNodeType === panel;
|
|
50
51
|
var isParentNodeAPanel = parentNodeType === panel;
|
|
52
|
+
var nodeBeforePanel = $previousPos === null || $previousPos === void 0 ? void 0 : $previousPos.nodeBefore;
|
|
51
53
|
|
|
52
54
|
// Stops merging panels when deleting empty paragraph in between
|
|
53
55
|
// Stops merging blockquotes with panels when deleting from start of blockquote
|
|
54
|
-
|
|
56
|
+
|
|
57
|
+
if (isPreviousNodeAPanel && !isParentNodeAPanel || isInsideAnEmptyNode(selection, panel, state.schema) || (0, _utils.hasParentNodeOfType)(blockquote)(selection) ||
|
|
58
|
+
// Lift line of panel content up and out of the panel, when backspacing
|
|
59
|
+
// at the start of a panel, if the node before the panel is an 'isolating' node
|
|
60
|
+
// (for e.g. a table, or an expand), otherwise the default prosemirror backspace
|
|
61
|
+
// behaviour will fallback to 'select node backward' logic because the node
|
|
62
|
+
// before is an isolating node.
|
|
63
|
+
nodeBeforePanel !== null && nodeBeforePanel !== void 0 && (_nodeBeforePanel$type = nodeBeforePanel.type) !== null && _nodeBeforePanel$type !== void 0 && (_nodeBeforePanel$type2 = _nodeBeforePanel$type.spec) !== null && _nodeBeforePanel$type2 !== void 0 && _nodeBeforePanel$type2.isolating && (0, _utils.hasParentNodeOfType)(panel)(selection)) {
|
|
55
64
|
var content = $from.node($from.depth).content;
|
|
56
|
-
var insertPos = previousPos.pos;
|
|
65
|
+
var insertPos = $previousPos.pos;
|
|
57
66
|
deleteCurrentItem($from, tr).insert(insertPos, content);
|
|
58
67
|
if (dispatch) {
|
|
59
68
|
dispatch((0, _utils.setTextSelection)(insertPos)(tr).scrollIntoView());
|
|
@@ -127,8 +127,6 @@ var TypeAheadMenu = /*#__PURE__*/_react.default.memo(function (_ref) {
|
|
|
127
127
|
*
|
|
128
128
|
*/
|
|
129
129
|
var typeAheadPlugin = function typeAheadPlugin(options) {
|
|
130
|
-
var _options$useBetterTyp;
|
|
131
|
-
var useBetterTypeaheadNavigation = (_options$useBetterTyp = options === null || options === void 0 ? void 0 : options.useBetterTypeaheadNavigation) !== null && _options$useBetterTyp !== void 0 ? _options$useBetterTyp : true;
|
|
132
130
|
var fireAnalyticsCallback = (0, _analytics.fireAnalyticsEvent)(options === null || options === void 0 ? void 0 : options.createAnalyticsEvent);
|
|
133
131
|
var popupMountRef = {
|
|
134
132
|
current: null
|
|
@@ -155,8 +153,7 @@ var typeAheadPlugin = function typeAheadPlugin(options) {
|
|
|
155
153
|
popupMountRef: popupMountRef,
|
|
156
154
|
reactDispatch: dispatch,
|
|
157
155
|
typeAheadHandlers: typeAhead,
|
|
158
|
-
createAnalyticsEvent: options === null || options === void 0 ? void 0 : options.createAnalyticsEvent
|
|
159
|
-
useBetterTypeaheadNavigation: useBetterTypeaheadNavigation
|
|
156
|
+
createAnalyticsEvent: options === null || options === void 0 ? void 0 : options.createAnalyticsEvent
|
|
160
157
|
});
|
|
161
158
|
}
|
|
162
159
|
}, {
|
|
@@ -22,8 +22,7 @@ var _closeTypeAhead = require("../transforms/close-type-ahead");
|
|
|
22
22
|
var factoryDecorations = function factoryDecorations(_ref) {
|
|
23
23
|
var intl = _ref.intl,
|
|
24
24
|
popupMountRef = _ref.popupMountRef,
|
|
25
|
-
createAnalyticsEvent = _ref.createAnalyticsEvent
|
|
26
|
-
useBetterTypeaheadNavigation = _ref.useBetterTypeaheadNavigation;
|
|
25
|
+
createAnalyticsEvent = _ref.createAnalyticsEvent;
|
|
27
26
|
var createDecorations = function createDecorations(tr, _ref2) {
|
|
28
27
|
var triggerHandler = _ref2.triggerHandler,
|
|
29
28
|
inputMethod = _ref2.inputMethod,
|
|
@@ -95,8 +94,7 @@ var factoryDecorations = function factoryDecorations(_ref) {
|
|
|
95
94
|
popupsBoundariesElement: (_popupMountRef$curren2 = popupMountRef.current) === null || _popupMountRef$curren2 === void 0 ? void 0 : _popupMountRef$curren2.popupsBoundariesElement,
|
|
96
95
|
popupsScrollableElement: (_popupMountRef$curren3 = popupMountRef.current) === null || _popupMountRef$curren3 === void 0 ? void 0 : _popupMountRef$curren3.popupsScrollableElement,
|
|
97
96
|
onUndoRedo: onUndoRedo,
|
|
98
|
-
reopenQuery: reopenQuery
|
|
99
|
-
useBetterTypeaheadNavigation: useBetterTypeaheadNavigation
|
|
97
|
+
reopenQuery: reopenQuery
|
|
100
98
|
})), typeaheadComponent);
|
|
101
99
|
shouldFocusCursorInsideQuery = false;
|
|
102
100
|
return typeaheadComponent;
|
|
@@ -31,14 +31,12 @@ function createPlugin(_ref) {
|
|
|
31
31
|
popupMountRef = _ref.popupMountRef,
|
|
32
32
|
createAnalyticsEvent = _ref.createAnalyticsEvent,
|
|
33
33
|
typeAheadHandlers = _ref.typeAheadHandlers,
|
|
34
|
-
getIntl = _ref.getIntl
|
|
35
|
-
useBetterTypeaheadNavigation = _ref.useBetterTypeaheadNavigation;
|
|
34
|
+
getIntl = _ref.getIntl;
|
|
36
35
|
var intl = getIntl();
|
|
37
36
|
var _factoryDecorations = (0, _decorations.factoryDecorations)({
|
|
38
37
|
intl: intl,
|
|
39
38
|
popupMountRef: popupMountRef,
|
|
40
|
-
createAnalyticsEvent: createAnalyticsEvent
|
|
41
|
-
useBetterTypeaheadNavigation: useBetterTypeaheadNavigation
|
|
39
|
+
createAnalyticsEvent: createAnalyticsEvent
|
|
42
40
|
}),
|
|
43
41
|
createDecorations = _factoryDecorations.createDecorations,
|
|
44
42
|
removeDecorations = _factoryDecorations.removeDecorations;
|
|
@@ -76,8 +76,7 @@ var InputQuery = /*#__PURE__*/_react.default.memo(function (_ref) {
|
|
|
76
76
|
onQueryFocus = _ref.onQueryFocus,
|
|
77
77
|
onUndoRedo = _ref.onUndoRedo,
|
|
78
78
|
editorView = _ref.editorView,
|
|
79
|
-
items = _ref.items
|
|
80
|
-
useBetterTypeaheadNavigation = _ref.useBetterTypeaheadNavigation;
|
|
79
|
+
items = _ref.items;
|
|
81
80
|
var ref = (0, _react.useRef)(document.createElement('span'));
|
|
82
81
|
var inputRef = (0, _react.useRef)(null);
|
|
83
82
|
var _useState = (0, _react.useState)(null),
|
|
@@ -150,27 +149,6 @@ var InputQuery = /*#__PURE__*/_react.default.memo(function (_ref) {
|
|
|
150
149
|
// Some suggested the other workaround maybe listen on`keypress` instead of `keydown`
|
|
151
150
|
if (!event.isComposing && event.which !== 229 && event.keyCode !== 229) {
|
|
152
151
|
if (selectedIndex === -1) {
|
|
153
|
-
if (useBetterTypeaheadNavigation) {
|
|
154
|
-
/**
|
|
155
|
-
* TODO DTR-1401: (also see ED-17200) There are two options
|
|
156
|
-
* here, either
|
|
157
|
-
* - set the index directly to 1 in WrapperTypeAhead.tsx's
|
|
158
|
-
* `insertSelectedItem` at the cost of breaking some of the a11y
|
|
159
|
-
* focus changes,
|
|
160
|
-
* - or do this jank at the cost of some small analytics noise.
|
|
161
|
-
*
|
|
162
|
-
* The focus behaviour still needs cleanup
|
|
163
|
-
*/
|
|
164
|
-
selectPreviousItem();
|
|
165
|
-
}
|
|
166
|
-
selectNextItem();
|
|
167
|
-
}
|
|
168
|
-
onItemSelect(event.shiftKey ? _typeAhead.SelectItemMode.SHIFT_ENTER : _typeAhead.SelectItemMode.ENTER);
|
|
169
|
-
}
|
|
170
|
-
break;
|
|
171
|
-
case 'Tab':
|
|
172
|
-
if (selectedIndex === -1) {
|
|
173
|
-
if (useBetterTypeaheadNavigation) {
|
|
174
152
|
/**
|
|
175
153
|
* TODO DTR-1401: (also see ED-17200) There are two options
|
|
176
154
|
* here, either
|
|
@@ -179,33 +157,36 @@ var InputQuery = /*#__PURE__*/_react.default.memo(function (_ref) {
|
|
|
179
157
|
* focus changes,
|
|
180
158
|
* - or do this jank at the cost of some small analytics noise.
|
|
181
159
|
*
|
|
160
|
+
* The focus behaviour still needs cleanup
|
|
182
161
|
*/
|
|
183
162
|
selectPreviousItem();
|
|
163
|
+
selectNextItem();
|
|
184
164
|
}
|
|
165
|
+
onItemSelect(event.shiftKey ? _typeAhead.SelectItemMode.SHIFT_ENTER : _typeAhead.SelectItemMode.ENTER);
|
|
166
|
+
}
|
|
167
|
+
break;
|
|
168
|
+
case 'Tab':
|
|
169
|
+
if (selectedIndex === -1) {
|
|
170
|
+
/**
|
|
171
|
+
* TODO DTR-1401: (also see ED-17200) There are two options
|
|
172
|
+
* here, either
|
|
173
|
+
* - set the index directly to 1 in WrapperTypeAhead.tsx's
|
|
174
|
+
* `insertSelectedItem` at the cost of breaking some of the a11y
|
|
175
|
+
* focus changes,
|
|
176
|
+
* - or do this jank at the cost of some small analytics noise.
|
|
177
|
+
*
|
|
178
|
+
*/
|
|
179
|
+
selectPreviousItem();
|
|
185
180
|
selectNextItem();
|
|
186
181
|
}
|
|
187
182
|
// TODO DTR-1401: why is this calling select item when hitting tab? fix this in DTR-1401
|
|
188
183
|
onItemSelect(_typeAhead.SelectItemMode.TAB);
|
|
189
184
|
break;
|
|
190
185
|
case 'ArrowDown':
|
|
191
|
-
|
|
192
|
-
selectNextItem();
|
|
193
|
-
} else {
|
|
194
|
-
// TODO DTR-1401: why were we preventing selection?
|
|
195
|
-
if (selectedIndex === -1) {
|
|
196
|
-
selectNextItem();
|
|
197
|
-
}
|
|
198
|
-
}
|
|
186
|
+
selectNextItem();
|
|
199
187
|
break;
|
|
200
188
|
case 'ArrowUp':
|
|
201
|
-
|
|
202
|
-
selectPreviousItem();
|
|
203
|
-
} else {
|
|
204
|
-
// TODO DTR-1401: why were we preventing selection?
|
|
205
|
-
if (selectedIndex === -1) {
|
|
206
|
-
selectPreviousItem();
|
|
207
|
-
}
|
|
208
|
-
}
|
|
189
|
+
selectPreviousItem();
|
|
209
190
|
break;
|
|
210
191
|
}
|
|
211
192
|
var undoRedoType = isUndoRedoShortcut(event);
|
|
@@ -217,7 +198,7 @@ var InputQuery = /*#__PURE__*/_react.default.memo(function (_ref) {
|
|
|
217
198
|
event.preventDefault();
|
|
218
199
|
return false;
|
|
219
200
|
}
|
|
220
|
-
}, [
|
|
201
|
+
}, [onUndoRedo, onItemSelect, selectNextItem, selectPreviousItem, cancel, cleanedInputContent, editorView.state]);
|
|
221
202
|
var onClick = (0, _react.useCallback)(function (event) {
|
|
222
203
|
var _inputRef$current;
|
|
223
204
|
event.stopPropagation();
|
|
@@ -29,8 +29,7 @@ var WrapperTypeAhead = /*#__PURE__*/_react.default.memo(function (_ref) {
|
|
|
29
29
|
inputMethod = _ref.inputMethod,
|
|
30
30
|
getDecorationPosition = _ref.getDecorationPosition,
|
|
31
31
|
reopenQuery = _ref.reopenQuery,
|
|
32
|
-
onUndoRedo = _ref.onUndoRedo
|
|
33
|
-
useBetterTypeaheadNavigation = _ref.useBetterTypeaheadNavigation;
|
|
32
|
+
onUndoRedo = _ref.onUndoRedo;
|
|
34
33
|
var _useState = (0, _react.useState)(false),
|
|
35
34
|
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
36
35
|
closed = _useState2[0],
|
|
@@ -52,17 +51,15 @@ var WrapperTypeAhead = /*#__PURE__*/_react.default.memo(function (_ref) {
|
|
|
52
51
|
var selectNextItem = (0, _react.useMemo)(function () {
|
|
53
52
|
return (0, _utils.moveSelectedIndex)({
|
|
54
53
|
editorView: editorView,
|
|
55
|
-
direction: 'next'
|
|
56
|
-
useBetterTypeaheadNavigation: useBetterTypeaheadNavigation
|
|
54
|
+
direction: 'next'
|
|
57
55
|
});
|
|
58
|
-
}, [editorView
|
|
56
|
+
}, [editorView]);
|
|
59
57
|
var selectPreviousItem = (0, _react.useMemo)(function () {
|
|
60
58
|
return (0, _utils.moveSelectedIndex)({
|
|
61
59
|
editorView: editorView,
|
|
62
|
-
direction: 'previous'
|
|
63
|
-
useBetterTypeaheadNavigation: useBetterTypeaheadNavigation
|
|
60
|
+
direction: 'previous'
|
|
64
61
|
});
|
|
65
|
-
}, [editorView
|
|
62
|
+
}, [editorView]);
|
|
66
63
|
var cancel = (0, _react.useCallback)(function (_ref2) {
|
|
67
64
|
var setSelectionAt = _ref2.setSelectionAt,
|
|
68
65
|
addPrefixTrigger = _ref2.addPrefixTrigger,
|
|
@@ -113,7 +110,6 @@ var WrapperTypeAhead = /*#__PURE__*/_react.default.memo(function (_ref) {
|
|
|
113
110
|
return null;
|
|
114
111
|
}
|
|
115
112
|
return /*#__PURE__*/_react.default.createElement(_InputQuery.InputQuery, {
|
|
116
|
-
useBetterTypeaheadNavigation: useBetterTypeaheadNavigation,
|
|
117
113
|
triggerQueryPrefix: triggerHandler.trigger,
|
|
118
114
|
onQueryChange: setQuery,
|
|
119
115
|
onItemSelect: insertSelectedItem,
|
|
@@ -67,8 +67,7 @@ var findHandlerByTrigger = function findHandlerByTrigger(_ref) {
|
|
|
67
67
|
exports.findHandlerByTrigger = findHandlerByTrigger;
|
|
68
68
|
var moveSelectedIndex = function moveSelectedIndex(_ref2) {
|
|
69
69
|
var editorView = _ref2.editorView,
|
|
70
|
-
direction = _ref2.direction
|
|
71
|
-
useBetterTypeaheadNavigation = _ref2.useBetterTypeaheadNavigation;
|
|
70
|
+
direction = _ref2.direction;
|
|
72
71
|
return function () {
|
|
73
72
|
var typeAheadState = getPluginState(editorView.state);
|
|
74
73
|
if (!typeAheadState) {
|
|
@@ -80,23 +79,20 @@ var moveSelectedIndex = function moveSelectedIndex(_ref2) {
|
|
|
80
79
|
var nextIndex;
|
|
81
80
|
if (direction === 'next') {
|
|
82
81
|
stats.increaseArrowDown();
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
} else {
|
|
98
|
-
nextIndex = selectedIndex >= items.length - 1 ? 0 : selectedIndex + 1;
|
|
99
|
-
}
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* See: https://product-fabric.atlassian.net/browse/ED-17200
|
|
85
|
+
* `selectedIndex` is forced to -1 now to not immediately focus the typeahead
|
|
86
|
+
* and only do so when there is explicit logic to focus into the typeahead
|
|
87
|
+
* options.
|
|
88
|
+
*
|
|
89
|
+
* This check for "set index to 1 when -1"
|
|
90
|
+
* - is a temporary workaround to get back the previous behaviour without
|
|
91
|
+
* entirely reverting the a11y improvements
|
|
92
|
+
*
|
|
93
|
+
*/
|
|
94
|
+
if (selectedIndex === -1 && items.length > 1) {
|
|
95
|
+
nextIndex = 1;
|
|
100
96
|
} else {
|
|
101
97
|
nextIndex = selectedIndex >= items.length - 1 ? 0 : selectedIndex + 1;
|
|
102
98
|
}
|
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.version = exports.nextMajorVersion = exports.name = void 0;
|
|
7
7
|
var name = "@atlaskit/editor-core";
|
|
8
8
|
exports.name = name;
|
|
9
|
-
var version = "187.
|
|
9
|
+
var version = "187.16.0";
|
|
10
10
|
exports.version = version;
|
|
11
11
|
var nextMajorVersion = function nextMajorVersion() {
|
|
12
12
|
return [Number(version.split('.')[0]) + 1, 0, 0].join('.');
|
package/dist/cjs/version.json
CHANGED