@atlaskit/editor-core 177.0.1 → 178.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +83 -0
- package/codemods/__tests__/next-remove-allow-more-text-colors-prop.ts +147 -0
- package/codemods/migrates/next-remove-allow-more-text-colors-prop.ts +58 -0
- package/dist/cjs/create-editor/ErrorBoundary.js +3 -1
- package/dist/cjs/create-editor/ReactEditorView.js +3 -2
- package/dist/cjs/create-editor/create-editor.js +3 -1
- package/dist/cjs/editor.js +7 -0
- package/dist/cjs/plugins/block-type/commands/delete-and-move-cursor.js +67 -0
- package/dist/cjs/plugins/block-type/commands/index.js +9 -1
- package/dist/cjs/plugins/block-type/pm-plugins/keymap.js +8 -3
- package/dist/cjs/plugins/feature-flags-context/feature-flags-from-props.js +12 -12
- package/dist/cjs/plugins/floating-toolbar/ui/DropdownMenu.js +39 -11
- package/dist/cjs/plugins/floating-toolbar/ui/Toolbar.js +8 -15
- package/dist/cjs/plugins/hyperlink/ui/HyperlinkAddToolbar/HyperlinkAddToolbar.js +2 -0
- package/dist/cjs/plugins/text-color/commands/change-color.js +1 -2
- package/dist/cjs/plugins/text-color/pm-plugins/main.js +1 -1
- package/dist/cjs/plugins/text-color/ui/ToolbarTextColor/index.js +2 -10
- package/dist/cjs/ui/Appearance/FullPage/FullPageToolbar.js +19 -1
- package/dist/cjs/ui/ColorPalette/Palettes/textColorPalette.js +0 -6
- package/dist/cjs/ui/ColorPickerButton/index.js +3 -8
- package/dist/cjs/ui/ToolbarArrowKeyNavigationProvider/index.js +27 -2
- package/dist/cjs/utils/performance/instrumented-plugin.js +6 -3
- package/dist/cjs/utils/performance/safer-transactions.js +8 -2
- package/dist/cjs/version-wrapper.js +1 -1
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/create-editor/ErrorBoundary.js +3 -1
- package/dist/es2019/create-editor/ReactEditorView.js +3 -2
- package/dist/es2019/create-editor/create-editor.js +3 -1
- package/dist/es2019/editor.js +7 -0
- package/dist/es2019/plugins/block-type/commands/delete-and-move-cursor.js +63 -0
- package/dist/es2019/plugins/block-type/commands/index.js +2 -1
- package/dist/es2019/plugins/block-type/pm-plugins/keymap.js +7 -4
- package/dist/es2019/plugins/feature-flags-context/feature-flags-from-props.js +12 -12
- package/dist/es2019/plugins/floating-toolbar/ui/DropdownMenu.js +42 -11
- package/dist/es2019/plugins/floating-toolbar/ui/Toolbar.js +9 -17
- package/dist/es2019/plugins/hyperlink/ui/HyperlinkAddToolbar/HyperlinkAddToolbar.js +2 -0
- package/dist/es2019/plugins/text-color/commands/change-color.js +1 -2
- package/dist/es2019/plugins/text-color/pm-plugins/main.js +2 -2
- package/dist/es2019/plugins/text-color/ui/ToolbarTextColor/index.js +2 -6
- package/dist/es2019/ui/Appearance/FullPage/FullPageToolbar.js +19 -1
- package/dist/es2019/ui/ColorPalette/Palettes/textColorPalette.js +1 -1
- package/dist/es2019/ui/ColorPickerButton/index.js +20 -9
- package/dist/es2019/ui/ToolbarArrowKeyNavigationProvider/index.js +27 -2
- package/dist/es2019/utils/performance/instrumented-plugin.js +5 -3
- package/dist/es2019/utils/performance/safer-transactions.js +8 -2
- package/dist/es2019/version-wrapper.js +1 -1
- package/dist/es2019/version.json +1 -1
- package/dist/esm/create-editor/ErrorBoundary.js +3 -1
- package/dist/esm/create-editor/ReactEditorView.js +3 -2
- package/dist/esm/create-editor/create-editor.js +3 -1
- package/dist/esm/editor.js +7 -0
- package/dist/esm/plugins/block-type/commands/delete-and-move-cursor.js +58 -0
- package/dist/esm/plugins/block-type/commands/index.js +2 -1
- package/dist/esm/plugins/block-type/pm-plugins/keymap.js +7 -4
- package/dist/esm/plugins/feature-flags-context/feature-flags-from-props.js +12 -12
- package/dist/esm/plugins/floating-toolbar/ui/DropdownMenu.js +40 -12
- package/dist/esm/plugins/floating-toolbar/ui/Toolbar.js +9 -17
- package/dist/esm/plugins/hyperlink/ui/HyperlinkAddToolbar/HyperlinkAddToolbar.js +2 -0
- package/dist/esm/plugins/text-color/commands/change-color.js +1 -2
- package/dist/esm/plugins/text-color/pm-plugins/main.js +2 -2
- package/dist/esm/plugins/text-color/ui/ToolbarTextColor/index.js +2 -9
- package/dist/esm/ui/Appearance/FullPage/FullPageToolbar.js +19 -1
- package/dist/esm/ui/ColorPalette/Palettes/textColorPalette.js +1 -1
- package/dist/esm/ui/ColorPickerButton/index.js +5 -10
- package/dist/esm/ui/ToolbarArrowKeyNavigationProvider/index.js +27 -2
- package/dist/esm/utils/performance/instrumented-plugin.js +6 -3
- package/dist/esm/utils/performance/safer-transactions.js +8 -2
- package/dist/esm/version-wrapper.js +1 -1
- package/dist/esm/version.json +1 -1
- package/dist/types/plugins/block-type/commands/delete-and-move-cursor.d.ts +12 -0
- package/dist/types/plugins/block-type/commands/index.d.ts +1 -0
- package/dist/types/plugins/floating-toolbar/ui/DropdownMenu.d.ts +1 -0
- package/dist/types/plugins/text-color/pm-plugins/main.d.ts +1 -1
- package/dist/types/ui/ColorPalette/Palettes/textColorPalette.d.ts +1 -1
- package/dist/types/ui/ToolbarArrowKeyNavigationProvider/index.d.ts +2 -1
- package/dist/types/utils/performance/instrumented-plugin.d.ts +1 -0
- package/dist/types/utils/performance/safer-transactions.d.ts +2 -1
- package/package.json +9 -10
- package/report.api.md +18 -2
|
@@ -33,7 +33,7 @@ function getSpellCheck(featureFlags) {
|
|
|
33
33
|
|
|
34
34
|
|
|
35
35
|
export function createFeatureFlagsFromProps(props) {
|
|
36
|
-
var _props$featureFlags, _props$
|
|
36
|
+
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, _props$featureFlags43, _props$featureFlags44;
|
|
37
37
|
|
|
38
38
|
var normalizedFeatureFlags = normalizeFeatureFlags(props.featureFlags);
|
|
39
39
|
var tableCellOptionsInFloatingToolbar = normalizedFeatureFlags.tableCellOptionsInFloatingToolbar || ((_props$featureFlags = props.featureFlags) === null || _props$featureFlags === void 0 ? void 0 : _props$featureFlags.tableCellOptionsInFloatingToolbar) || undefined;
|
|
@@ -41,7 +41,6 @@ export function createFeatureFlagsFromProps(props) {
|
|
|
41
41
|
newInsertionBehaviour: props.allowNewInsertionBehaviour,
|
|
42
42
|
interactiveExpand: typeof props.allowExpand === 'boolean' ? props.allowExpand : Boolean(props.allowExpand && props.allowExpand.allowInteractiveExpand !== false),
|
|
43
43
|
placeholderBracketHint: !!props.placeholderBracketHint,
|
|
44
|
-
moreTextColors: typeof props.allowTextColor === 'boolean' ? false : Boolean(((_props$allowTextColor = props.allowTextColor) === null || _props$allowTextColor === void 0 ? void 0 : _props$allowTextColor.allowMoreTextColors) === true),
|
|
45
44
|
findReplace: !!props.allowFindReplace,
|
|
46
45
|
findReplaceMatchCase: _typeof(props.allowFindReplace) === 'object' && Boolean(props.allowFindReplace.allowMatchCase),
|
|
47
46
|
addColumnWithCustomStep: !props.allowTables || typeof props.allowTables === 'boolean' ? false : Boolean(props.allowTables.allowAddColumnWithCustomStep),
|
|
@@ -62,21 +61,22 @@ export function createFeatureFlagsFromProps(props) {
|
|
|
62
61
|
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),
|
|
63
62
|
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),
|
|
64
63
|
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)),
|
|
64
|
+
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)),
|
|
65
65
|
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),
|
|
66
|
-
chromeCursorHandlerFixedVersion: typeof ((_props$
|
|
66
|
+
chromeCursorHandlerFixedVersion: typeof ((_props$featureFlags30 = props.featureFlags) === null || _props$featureFlags30 === void 0 ? void 0 : _props$featureFlags30.chromeCursorHandlerFixedVersion) === 'string' ? Number(props.featureFlags.chromeCursorHandlerFixedVersion) || undefined : undefined,
|
|
67
67
|
tableCellOptionsInFloatingToolbar: typeof tableCellOptionsInFloatingToolbar === 'boolean' ? tableCellOptionsInFloatingToolbar : false,
|
|
68
|
-
showHoverPreview: Boolean(typeof ((_props$
|
|
69
|
-
indentationButtonsInTheToolbar: Boolean(typeof normalizedFeatureFlags.indentationButtonsInTheToolbar === 'boolean' && !!normalizedFeatureFlags.indentationButtonsInTheToolbar || (typeof ((_props$
|
|
70
|
-
floatingToolbarCopyButton: Boolean(typeof normalizedFeatureFlags.floatingToolbarCopyButton === 'boolean' && !!normalizedFeatureFlags.floatingToolbarCopyButton || (typeof ((_props$
|
|
71
|
-
floatingToolbarLinkSettingsButton: typeof ((_props$
|
|
68
|
+
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),
|
|
69
|
+
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)),
|
|
70
|
+
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)),
|
|
71
|
+
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,
|
|
72
72
|
disableSpellcheckByBrowser: getSpellCheck(props.featureFlags),
|
|
73
73
|
// Including fallback to props.featureFlags so that mobile feature flags
|
|
74
74
|
// are included (they are not kebab cased)
|
|
75
|
-
restartNumberedLists: normalizedFeatureFlags.restartNumberedLists === true || ((_props$
|
|
76
|
-
listNumberContinuity: normalizedFeatureFlags.listNumberContinuity === true || ((_props$
|
|
77
|
-
restartNumberedListsToolbar: normalizedFeatureFlags.restartNumberedListsToolbar === true || ((_props$
|
|
78
|
-
useSomewhatSemanticTextColorNames: Boolean(typeof normalizedFeatureFlags.useSomewhatSemanticTextColorNames === 'boolean' && !!normalizedFeatureFlags.useSomewhatSemanticTextColorNames || (typeof ((_props$
|
|
75
|
+
restartNumberedLists: normalizedFeatureFlags.restartNumberedLists === true || ((_props$featureFlags38 = props.featureFlags) === null || _props$featureFlags38 === void 0 ? void 0 : _props$featureFlags38.restartNumberedLists) === true,
|
|
76
|
+
listNumberContinuity: normalizedFeatureFlags.listNumberContinuity === true || ((_props$featureFlags39 = props.featureFlags) === null || _props$featureFlags39 === void 0 ? void 0 : _props$featureFlags39.listNumberContinuity) === true,
|
|
77
|
+
restartNumberedListsToolbar: normalizedFeatureFlags.restartNumberedListsToolbar === true || ((_props$featureFlags40 = props.featureFlags) === null || _props$featureFlags40 === void 0 ? void 0 : _props$featureFlags40.restartNumberedListsToolbar) === true,
|
|
78
|
+
useSomewhatSemanticTextColorNames: Boolean(typeof normalizedFeatureFlags.useSomewhatSemanticTextColorNames === 'boolean' && !!normalizedFeatureFlags.useSomewhatSemanticTextColorNames || (typeof ((_props$featureFlags41 = props.featureFlags) === null || _props$featureFlags41 === void 0 ? void 0 : _props$featureFlags41.useSomewhatSemanticTextColorNames) === 'boolean' ? !!((_props$featureFlags42 = props.featureFlags) !== null && _props$featureFlags42 !== void 0 && _props$featureFlags42.useSomewhatSemanticTextColorNames) : false)),
|
|
79
79
|
lpLinkPickerFocusTrap: Boolean(normalizedFeatureFlags.lpLinkPickerFocusTrap),
|
|
80
|
-
preventPopupOverflow: Boolean(typeof ((_props$
|
|
80
|
+
preventPopupOverflow: Boolean(typeof ((_props$featureFlags43 = props.featureFlags) === null || _props$featureFlags43 === void 0 ? void 0 : _props$featureFlags43['prevent-popup-overflow']) === 'boolean' ? !!((_props$featureFlags44 = props.featureFlags) !== null && _props$featureFlags44 !== void 0 && _props$featureFlags44['prevent-popup-overflow']) : false)
|
|
81
81
|
});
|
|
82
82
|
}
|
|
@@ -6,14 +6,14 @@ import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
|
6
6
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
7
7
|
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
8
8
|
|
|
9
|
-
var _templateObject, _templateObject2;
|
|
9
|
+
var _templateObject, _templateObject2, _templateObject3;
|
|
10
10
|
|
|
11
11
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
12
12
|
|
|
13
13
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
14
14
|
|
|
15
15
|
/** @jsx jsx */
|
|
16
|
-
import { useState, useCallback } from 'react';
|
|
16
|
+
import { useState, useCallback, useEffect, createRef } from 'react';
|
|
17
17
|
import { css, jsx } from '@emotion/react';
|
|
18
18
|
import { Component } from 'react';
|
|
19
19
|
import { gridSize } from '@atlaskit/theme/constants';
|
|
@@ -29,6 +29,7 @@ export var menuItemDimensions = {
|
|
|
29
29
|
};
|
|
30
30
|
var spacer = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: flex;\n flex: 1;\n padding: 8px;\n"])));
|
|
31
31
|
var menuContainer = css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n min-width: ", "px;\n\n // temporary solution to retain spacing defined by @atlaskit/Item\n & button {\n min-height: ", "px;\n padding: 8px 8px 7px;\n\n & > [data-item-elem-before] {\n margin-right: ", "px;\n }\n }\n"])), menuItemDimensions.width, gridSize() * 4, gridSize() / 2);
|
|
32
|
+
var label = css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n display: inline-block;\n width: 100%;\n"])));
|
|
32
33
|
export var itemSpacing = gridSize() / 2;
|
|
33
34
|
var DropdownButtonItem = ButtonItem;
|
|
34
35
|
|
|
@@ -44,17 +45,24 @@ var DropdownMenuItem = function DropdownMenuItem(_ref) {
|
|
|
44
45
|
tooltipContent = _useState2[0],
|
|
45
46
|
setTooltipContent = _useState2[1];
|
|
46
47
|
|
|
47
|
-
var
|
|
48
|
+
var handleItemMouseOut = useCallback(function () {
|
|
48
49
|
setTooltipContent('');
|
|
49
|
-
|
|
50
|
+
|
|
51
|
+
if (item.onMouseOut) {
|
|
52
|
+
dispatchCommand(item.onMouseOut);
|
|
53
|
+
}
|
|
54
|
+
}, [item.onMouseOut, dispatchCommand]);
|
|
50
55
|
var handleItemMouseDown = useCallback(function (e) {
|
|
51
|
-
e.preventDefault();
|
|
52
|
-
|
|
53
|
-
|
|
56
|
+
e.preventDefault(); // ED-16204 - This is needed for safari to get handleItemClick() to work
|
|
57
|
+
|
|
58
|
+
if (item.onMouseDown) {
|
|
59
|
+
dispatchCommand(item.onMouseDown);
|
|
60
|
+
}
|
|
61
|
+
}, [item.onMouseDown, dispatchCommand]);
|
|
62
|
+
var handleItemMouseOver = useCallback(function () {
|
|
54
63
|
setTooltipContent(item.tooltip || '');
|
|
55
64
|
|
|
56
65
|
if (item.onMouseOver) {
|
|
57
|
-
e.preventDefault();
|
|
58
66
|
dispatchCommand(item.onMouseOver);
|
|
59
67
|
}
|
|
60
68
|
}, [item.tooltip, item.onMouseOver, dispatchCommand]);
|
|
@@ -96,6 +104,24 @@ var DropdownMenuItem = function DropdownMenuItem(_ref) {
|
|
|
96
104
|
editorView === null || editorView === void 0 ? void 0 : editorView.focus();
|
|
97
105
|
}
|
|
98
106
|
}, [dispatchCommand, item.onClick, hide, editorView]);
|
|
107
|
+
/* ED-16704 - Native mouse event handler to overcome firefox issue on disabled <button> - https://github.com/whatwg/html/issues/5886 */
|
|
108
|
+
|
|
109
|
+
var labelRef = /*#__PURE__*/createRef();
|
|
110
|
+
var handleTitleWrapperMouseEvent = useCallback(function (e) {
|
|
111
|
+
if (item.disabled) {
|
|
112
|
+
e.stopPropagation();
|
|
113
|
+
e.preventDefault();
|
|
114
|
+
}
|
|
115
|
+
}, [item.disabled]);
|
|
116
|
+
useEffect(function () {
|
|
117
|
+
var labelRefCurrent = labelRef.current;
|
|
118
|
+
labelRefCurrent === null || labelRefCurrent === void 0 ? void 0 : labelRefCurrent.addEventListener('click', handleTitleWrapperMouseEvent);
|
|
119
|
+
labelRefCurrent === null || labelRefCurrent === void 0 ? void 0 : labelRefCurrent.addEventListener('mousedown', handleTitleWrapperMouseEvent);
|
|
120
|
+
return function () {
|
|
121
|
+
labelRefCurrent === null || labelRefCurrent === void 0 ? void 0 : labelRefCurrent.removeEventListener('click', handleTitleWrapperMouseEvent);
|
|
122
|
+
labelRefCurrent === null || labelRefCurrent === void 0 ? void 0 : labelRefCurrent.removeEventListener('mousedown', handleTitleWrapperMouseEvent);
|
|
123
|
+
};
|
|
124
|
+
});
|
|
99
125
|
var itemContent = jsx(DropdownButtonItem, {
|
|
100
126
|
iconBefore: iconBefore,
|
|
101
127
|
iconAfter: item.elemAfter,
|
|
@@ -106,16 +132,18 @@ var DropdownMenuItem = function DropdownMenuItem(_ref) {
|
|
|
106
132
|
onMouseOver: handleItemMouseOver,
|
|
107
133
|
onMouseEnter: handleItemMouseEnter,
|
|
108
134
|
onMouseLeave: handleItemMouseLeave,
|
|
135
|
+
onMouseOut: handleItemMouseOut,
|
|
109
136
|
onFocus: handleItemOnFocus,
|
|
110
137
|
onBlur: handleItemOnBlur
|
|
111
|
-
},
|
|
138
|
+
}, jsx("span", {
|
|
139
|
+
ref: labelRef,
|
|
140
|
+
css: label
|
|
141
|
+
}, item.title));
|
|
112
142
|
|
|
113
143
|
if (tooltipContent) {
|
|
114
144
|
return jsx(Tooltip, {
|
|
115
145
|
content: tooltipContent
|
|
116
|
-
},
|
|
117
|
-
onMouseOut: handleTooltipMouseOut
|
|
118
|
-
}, itemContent));
|
|
146
|
+
}, itemContent);
|
|
119
147
|
}
|
|
120
148
|
|
|
121
149
|
return itemContent;
|
|
@@ -23,7 +23,7 @@ import { themed } from '@atlaskit/theme/components';
|
|
|
23
23
|
import { borderRadius, gridSize } from '@atlaskit/theme/constants';
|
|
24
24
|
import { DN70 } from '@atlaskit/theme/colors';
|
|
25
25
|
import { getFeatureFlags } from '../../feature-flags-context';
|
|
26
|
-
import { compareArrays,
|
|
26
|
+
import { compareArrays, shallowEqual } from '../utils';
|
|
27
27
|
import { showConfirmDialog } from '../pm-plugins/toolbar-data/commands';
|
|
28
28
|
import Button from './Button';
|
|
29
29
|
import Dropdown from './Dropdown';
|
|
@@ -336,14 +336,6 @@ var Toolbar = /*#__PURE__*/function (_Component) {
|
|
|
336
336
|
|
|
337
337
|
_this = _super.call(this, props);
|
|
338
338
|
|
|
339
|
-
_defineProperty(_assertThisInitialized(_this), "focusToolbar", function (event) {
|
|
340
|
-
if (event.altKey && event.keyCode === 121) {
|
|
341
|
-
var _getFirstFocusableEle, _this$toolbarContaine;
|
|
342
|
-
|
|
343
|
-
(_getFirstFocusableEle = getFirstFocusableElement((_this$toolbarContaine = _this.toolbarContainerRef) === null || _this$toolbarContaine === void 0 ? void 0 : _this$toolbarContaine.current)) === null || _getFirstFocusableEle === void 0 ? void 0 : _getFirstFocusableEle.focus();
|
|
344
|
-
}
|
|
345
|
-
});
|
|
346
|
-
|
|
347
339
|
_defineProperty(_assertThisInitialized(_this), "shouldHandleArrowKeys", function () {
|
|
348
340
|
var _this$props$items;
|
|
349
341
|
|
|
@@ -422,7 +414,6 @@ var Toolbar = /*#__PURE__*/function (_Component) {
|
|
|
422
414
|
this.setState({
|
|
423
415
|
mounted: true
|
|
424
416
|
});
|
|
425
|
-
document.addEventListener('keydown', this.focusToolbar);
|
|
426
417
|
}
|
|
427
418
|
}, {
|
|
428
419
|
key: "componentDidUpdate",
|
|
@@ -439,13 +430,7 @@ var Toolbar = /*#__PURE__*/function (_Component) {
|
|
|
439
430
|
this.resetStyling({
|
|
440
431
|
table: this.props.node.type.name === 'table'
|
|
441
432
|
});
|
|
442
|
-
document.removeEventListener('keydown', this.focusToolbar);
|
|
443
433
|
}
|
|
444
|
-
/**
|
|
445
|
-
* To listen to keyboard shortcut Alt+F10 and focus floating toolbar's first focusable element.
|
|
446
|
-
* @param event
|
|
447
|
-
*/
|
|
448
|
-
|
|
449
434
|
}, {
|
|
450
435
|
key: "render",
|
|
451
436
|
value: function render() {
|
|
@@ -465,11 +450,18 @@ var Toolbar = /*#__PURE__*/function (_Component) {
|
|
|
465
450
|
var hasSelect = items.find(function (item) {
|
|
466
451
|
return item.type === 'select' && item.selectType === 'list';
|
|
467
452
|
});
|
|
453
|
+
|
|
454
|
+
var isShortcutToFocusToolbar = function isShortcutToFocusToolbar(event) {
|
|
455
|
+
//Alt + F10 to reach first element in this floating toolbar
|
|
456
|
+
return event.altKey && (event.key === 'F10' || event.keyCode === 121);
|
|
457
|
+
};
|
|
458
|
+
|
|
468
459
|
return jsx(React.Fragment, null, jsx(ToolbarArrowKeyNavigationProvider, {
|
|
469
460
|
editorView: this.props.editorView,
|
|
470
461
|
handleEscape: this.handleEscape,
|
|
471
462
|
disableArrowKeyNavigation: !this.shouldHandleArrowKeys(),
|
|
472
|
-
childComponentSelector: "[data-testid='editor-floating-toolbar']"
|
|
463
|
+
childComponentSelector: "[data-testid='editor-floating-toolbar']",
|
|
464
|
+
isShortcutToFocusToolbar: isShortcutToFocusToolbar
|
|
473
465
|
}, jsx("div", {
|
|
474
466
|
ref: this.toolbarContainerRef,
|
|
475
467
|
css: function css(theme) {
|
|
@@ -979,6 +979,7 @@ export var HyperlinkLinkAddToolbar = /*#__PURE__*/function (_PureComponent) {
|
|
|
979
979
|
}), displayUrl && jsx(Tooltip, {
|
|
980
980
|
content: formatClearLinkText
|
|
981
981
|
}, jsx("button", {
|
|
982
|
+
type: "button",
|
|
982
983
|
css: clearText,
|
|
983
984
|
onClick: this.handleClearText
|
|
984
985
|
}, jsx(CrossCircleIcon, {
|
|
@@ -1006,6 +1007,7 @@ export var HyperlinkLinkAddToolbar = /*#__PURE__*/function (_PureComponent) {
|
|
|
1006
1007
|
}), displayText && jsx(Tooltip, {
|
|
1007
1008
|
content: formatMessage(messages.clearText)
|
|
1008
1009
|
}, jsx("button", {
|
|
1010
|
+
type: "button",
|
|
1009
1011
|
css: clearText,
|
|
1010
1012
|
onClick: this.handleClearDisplayText,
|
|
1011
1013
|
onKeyDown: this.handleClearTextKeyDown
|
|
@@ -41,8 +41,7 @@ export var changeColor = function changeColor(color) {
|
|
|
41
41
|
if (textColor) {
|
|
42
42
|
var pluginState = pluginKey.getState(state);
|
|
43
43
|
var activeColor = getActiveColor(state);
|
|
44
|
-
var withColorAnalytics = createWithColorAnalytics(color, activeColor,
|
|
45
|
-
pluginState.paletteExpanded || pluginState.palette);
|
|
44
|
+
var withColorAnalytics = createWithColorAnalytics(color, activeColor, pluginState.palette);
|
|
46
45
|
|
|
47
46
|
if (pluginState.disabled) {
|
|
48
47
|
return false;
|
|
@@ -7,7 +7,7 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
|
7
7
|
|
|
8
8
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
9
9
|
import { PluginKey } from 'prosemirror-state';
|
|
10
|
-
import {
|
|
10
|
+
import { textColorPalette } from '../../../ui/ColorPalette/Palettes/textColorPalette';
|
|
11
11
|
import { DEFAULT_BORDER_COLOR } from '../../../ui/ColorPalette/Palettes/common';
|
|
12
12
|
import { DEFAULT_COLOR, getActiveColor } from '../utils/color';
|
|
13
13
|
import { getDisabledState } from '../utils/disabled';
|
|
@@ -18,7 +18,7 @@ export function createInitialPluginState(editorState, pluginConfig) {
|
|
|
18
18
|
value: defaultColor.color,
|
|
19
19
|
label: defaultColor.label,
|
|
20
20
|
border: DEFAULT_BORDER_COLOR
|
|
21
|
-
}].concat(_toConsumableArray(
|
|
21
|
+
}].concat(_toConsumableArray(textColorPalette));
|
|
22
22
|
var state = {
|
|
23
23
|
color: getActiveColor(editorState),
|
|
24
24
|
disabled: getDisabledState(editorState),
|
|
@@ -21,7 +21,6 @@ import { defineMessages, injectIntl } from 'react-intl-next';
|
|
|
21
21
|
import { akEditorMenuZIndex } from '@atlaskit/editor-shared-styles';
|
|
22
22
|
import ExpandIcon from '@atlaskit/icon/glyph/chevron-down';
|
|
23
23
|
import ColorPalette from '../../../../ui/ColorPalette';
|
|
24
|
-
import { textColorPalette as originalTextColors } from '../../../../ui/ColorPalette/Palettes/textColorPalette';
|
|
25
24
|
import Dropdown from '../../../../ui/Dropdown';
|
|
26
25
|
import { expandIconWrapperStyle, wrapperStyle, separatorStyles, triggerWrapperStyles } from '../../../../ui/styles';
|
|
27
26
|
import ToolbarButton, { TOOLBAR_BUTTON } from '../../../../ui/ToolbarButton';
|
|
@@ -77,20 +76,14 @@ export var ToolbarTextColor = /*#__PURE__*/function (_React$Component) {
|
|
|
77
76
|
if (!disabled) {
|
|
78
77
|
var _this$props$editorVie;
|
|
79
78
|
|
|
80
|
-
var
|
|
81
|
-
palette = _this$props$pluginSta.palette,
|
|
82
|
-
defaultColor = _this$props$pluginSta.defaultColor; // we store color names in analytics
|
|
79
|
+
var palette = _this.props.pluginState.palette; // we store color names in analytics
|
|
83
80
|
|
|
84
81
|
var swatch = palette.find(function (sw) {
|
|
85
82
|
return sw.value === color;
|
|
86
83
|
});
|
|
87
|
-
var isNewColor = color !== defaultColor && !originalTextColors.some(function (col) {
|
|
88
|
-
return col.value === color;
|
|
89
|
-
});
|
|
90
84
|
|
|
91
85
|
_this.dispatchAnalyticsEvent(_this.buildAnalyticsSelectColor({
|
|
92
|
-
color: (swatch ? swatch.label : color).toLowerCase()
|
|
93
|
-
isNewColor: isNewColor
|
|
86
|
+
color: (swatch ? swatch.label : color).toLowerCase()
|
|
94
87
|
}));
|
|
95
88
|
|
|
96
89
|
_this.handleOpenChange({
|
|
@@ -73,13 +73,31 @@ export var EditorToolbar = /*#__PURE__*/React.memo(function (props) {
|
|
|
73
73
|
};
|
|
74
74
|
}
|
|
75
75
|
});
|
|
76
|
+
|
|
77
|
+
var isShortcutToFocusToolbar = function isShortcutToFocusToolbar(event) {
|
|
78
|
+
//Alt + F9 to reach first element in this main toolbar
|
|
79
|
+
return event.altKey && (event.key === 'F9' || event.keyCode === 120);
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
var handleEscape = function handleEscape(event) {
|
|
83
|
+
var _props$editorView;
|
|
84
|
+
|
|
85
|
+
if (!((_props$editorView = props.editorView) !== null && _props$editorView !== void 0 && _props$editorView.hasFocus())) {
|
|
86
|
+
var _props$editorView2;
|
|
87
|
+
|
|
88
|
+
(_props$editorView2 = props.editorView) === null || _props$editorView2 === void 0 ? void 0 : _props$editorView2.focus();
|
|
89
|
+
}
|
|
90
|
+
};
|
|
91
|
+
|
|
76
92
|
return jsx(ContextPanelConsumer, null, function (_ref) {
|
|
77
93
|
var _props$featureFlags8, _props$featureFlags9, _props$featureFlags10;
|
|
78
94
|
|
|
79
95
|
var contextPanelWidth = _ref.width;
|
|
80
96
|
return jsx(ToolbarArrowKeyNavigationProvider, {
|
|
81
97
|
editorView: props.editorView,
|
|
82
|
-
childComponentSelector: "[data-testid='ak-editor-main-toolbar']"
|
|
98
|
+
childComponentSelector: "[data-testid='ak-editor-main-toolbar']",
|
|
99
|
+
isShortcutToFocusToolbar: isShortcutToFocusToolbar,
|
|
100
|
+
handleEscape: handleEscape
|
|
83
101
|
}, jsx("div", {
|
|
84
102
|
css: mainToolbarStyle(props.showKeyline || contextPanelWidth > 0, !!((_props$featureFlags8 = props.featureFlags) !== null && _props$featureFlags8 !== void 0 && _props$featureFlags8.twoLineEditorToolbar)),
|
|
85
103
|
"data-testid": "ak-editor-main-toolbar"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { textColorPalette
|
|
1
|
+
export { textColorPalette } from '@atlaskit/editor-common/ui-color';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
2
2
|
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
3
3
|
|
|
4
|
-
var _templateObject, _templateObject2;
|
|
4
|
+
var _templateObject, _templateObject2, _templateObject3;
|
|
5
5
|
|
|
6
6
|
/** @jsx jsx */
|
|
7
7
|
import React from 'react';
|
|
@@ -15,8 +15,8 @@ import ColorPalette from '../ColorPalette';
|
|
|
15
15
|
import { DEFAULT_BORDER_COLOR } from '../ColorPalette/Palettes/common';
|
|
16
16
|
import { withAnalyticsContext, withAnalyticsEvents } from '@atlaskit/analytics-next';
|
|
17
17
|
import { editorAnalyticsChannel } from '../../plugins/analytics/consts';
|
|
18
|
-
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE } from '../../plugins/analytics/types';
|
|
19
|
-
|
|
18
|
+
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE } from '../../plugins/analytics/types';
|
|
19
|
+
// helps adjusts position of popup
|
|
20
20
|
var colorPickerButtonWrapper = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n position: relative;\n"]))); // Control the size of color picker buttons and preview
|
|
21
21
|
// TODO: https://product-fabric.atlassian.net/browse/DSP-4134
|
|
22
22
|
|
|
@@ -104,6 +104,7 @@ var ColorPickerButton = function ColorPickerButton(props) {
|
|
|
104
104
|
};
|
|
105
105
|
|
|
106
106
|
var title = props.title || '';
|
|
107
|
+
var buttonStyle = css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n padding: 6px;\n background-color: ", ";\n &:before {\n display: flex;\n justify-content: center;\n align-items: center;\n align-self: center;\n content: '';\n border: 1px solid ", ";\n border-radius: ", "px;\n background-color: ", ";\n width: ", "px;\n height: ", "px;\n padding: 0;\n }\n "])), "var(--ds-background-neutral, transparent)", DEFAULT_BORDER_COLOR, borderRadius(), props.currentColor || 'transparent', ((_props$size = props.size) === null || _props$size === void 0 ? void 0 : _props$size.width) || 14, ((_props$size2 = props.size) === null || _props$size2 === void 0 ? void 0 : _props$size2.height) || 14);
|
|
107
108
|
return jsx("div", {
|
|
108
109
|
css: colorPickerButtonWrapper
|
|
109
110
|
}, jsx(Tooltip, {
|
|
@@ -114,13 +115,7 @@ var ColorPickerButton = function ColorPickerButton(props) {
|
|
|
114
115
|
"aria-label": title,
|
|
115
116
|
spacing: "compact",
|
|
116
117
|
onClick: togglePopup,
|
|
117
|
-
|
|
118
|
-
backgroundColor: props.currentColor || 'transparent',
|
|
119
|
-
border: "1px solid ".concat(DEFAULT_BORDER_COLOR),
|
|
120
|
-
width: "".concat(((_props$size = props.size) === null || _props$size === void 0 ? void 0 : _props$size.width) || 20, "px"),
|
|
121
|
-
height: "".concat(((_props$size2 = props.size) === null || _props$size2 === void 0 ? void 0 : _props$size2.height) || 20, "px"),
|
|
122
|
-
padding: 0
|
|
123
|
-
}
|
|
118
|
+
css: buttonStyle
|
|
124
119
|
})), renderPopup());
|
|
125
120
|
};
|
|
126
121
|
|
|
@@ -23,7 +23,8 @@ export var ToolbarArrowKeyNavigationProvider = function ToolbarArrowKeyNavigatio
|
|
|
23
23
|
editorView = _ref.editorView,
|
|
24
24
|
childComponentSelector = _ref.childComponentSelector,
|
|
25
25
|
handleEscape = _ref.handleEscape,
|
|
26
|
-
disableArrowKeyNavigation = _ref.disableArrowKeyNavigation
|
|
26
|
+
disableArrowKeyNavigation = _ref.disableArrowKeyNavigation,
|
|
27
|
+
isShortcutToFocusToolbar = _ref.isShortcutToFocusToolbar;
|
|
27
28
|
var wrapperRef = useRef(null);
|
|
28
29
|
var selectedItemIndex = useRef(0);
|
|
29
30
|
var incrementIndex = useCallback(function (list) {
|
|
@@ -139,11 +140,35 @@ export var ToolbarArrowKeyNavigationProvider = function ToolbarArrowKeyNavigatio
|
|
|
139
140
|
}
|
|
140
141
|
};
|
|
141
142
|
|
|
143
|
+
var globalKeyDownHandler = function globalKeyDownHandler(event) {
|
|
144
|
+
//To focus the first element in the toolbar
|
|
145
|
+
if (isShortcutToFocusToolbar(event)) {
|
|
146
|
+
var _filteredFocusableEle4, _filteredFocusableEle5;
|
|
147
|
+
|
|
148
|
+
var filteredFocusableElements = getFilteredFocusableElements(wrapperRef === null || wrapperRef === void 0 ? void 0 : wrapperRef.current);
|
|
149
|
+
(_filteredFocusableEle4 = filteredFocusableElements[0]) === null || _filteredFocusableEle4 === void 0 ? void 0 : _filteredFocusableEle4.focus();
|
|
150
|
+
(_filteredFocusableEle5 = filteredFocusableElements[0]) === null || _filteredFocusableEle5 === void 0 ? void 0 : _filteredFocusableEle5.scrollIntoView({
|
|
151
|
+
behavior: 'smooth',
|
|
152
|
+
block: 'center',
|
|
153
|
+
inline: 'nearest'
|
|
154
|
+
});
|
|
155
|
+
}
|
|
156
|
+
};
|
|
157
|
+
|
|
142
158
|
element === null || element === void 0 ? void 0 : element.addEventListener('keydown', handleKeyDown);
|
|
159
|
+
|
|
160
|
+
if (isShortcutToFocusToolbar) {
|
|
161
|
+
document.addEventListener('keydown', globalKeyDownHandler);
|
|
162
|
+
}
|
|
163
|
+
|
|
143
164
|
return function () {
|
|
144
165
|
element === null || element === void 0 ? void 0 : element.removeEventListener('keydown', handleKeyDown);
|
|
166
|
+
|
|
167
|
+
if (isShortcutToFocusToolbar) {
|
|
168
|
+
document.removeEventListener('keydown', globalKeyDownHandler);
|
|
169
|
+
}
|
|
145
170
|
};
|
|
146
|
-
}, [selectedItemIndex, wrapperRef, editorView, disableArrowKeyNavigation, handleEscape, childComponentSelector, incrementIndex, decrementIndex]);
|
|
171
|
+
}, [selectedItemIndex, wrapperRef, editorView, disableArrowKeyNavigation, handleEscape, childComponentSelector, incrementIndex, decrementIndex, isShortcutToFocusToolbar]);
|
|
147
172
|
return /*#__PURE__*/React.createElement("div", {
|
|
148
173
|
className: "custom-key-handler-wrapper",
|
|
149
174
|
ref: wrapperRef
|
|
@@ -35,8 +35,10 @@ export var InstrumentedPlugin = /*#__PURE__*/function (_SafePlugin) {
|
|
|
35
35
|
} : _options$uiTracking,
|
|
36
36
|
_options$saferDispatc = options.saferDispatchedTransactions,
|
|
37
37
|
saferDispatchedTransactions = _options$saferDispatc === void 0 ? false : _options$saferDispatc,
|
|
38
|
+
_options$saferDispatc2 = options.saferDispatchedTransactionsAnalyticsOnly,
|
|
39
|
+
saferDispatchedTransactionsAnalyticsOnly = _options$saferDispatc2 === void 0 ? false : _options$saferDispatc2,
|
|
38
40
|
dispatchAnalyticsEvent = options.dispatchAnalyticsEvent;
|
|
39
|
-
var shouldOverrideApply = transactionTracking.enabled && transactionTracker || saferDispatchedTransactions;
|
|
41
|
+
var shouldOverrideApply = transactionTracking.enabled && transactionTracker || saferDispatchedTransactions || saferDispatchedTransactionsAnalyticsOnly;
|
|
40
42
|
|
|
41
43
|
if (shouldOverrideApply && spec.state) {
|
|
42
44
|
var originalApply = spec.state.apply.bind(spec.state);
|
|
@@ -44,9 +46,10 @@ export var InstrumentedPlugin = /*#__PURE__*/function (_SafePlugin) {
|
|
|
44
46
|
spec.state.apply = function (aTr, value, oldState, newState) {
|
|
45
47
|
var self = _assertThisInitialized(_this);
|
|
46
48
|
|
|
47
|
-
var tr = saferDispatchedTransactions ? new Proxy(aTr, freezeUnsafeTransactionProperties({
|
|
49
|
+
var tr = saferDispatchedTransactions || saferDispatchedTransactionsAnalyticsOnly ? new Proxy(aTr, freezeUnsafeTransactionProperties({
|
|
48
50
|
dispatchAnalyticsEvent: dispatchAnalyticsEvent,
|
|
49
|
-
pluginKey: self.key
|
|
51
|
+
pluginKey: self.key,
|
|
52
|
+
analyticsOnly: saferDispatchedTransactionsAnalyticsOnly
|
|
50
53
|
})) : aTr;
|
|
51
54
|
var shouldTrackTransactions = transactionTracker === null || transactionTracker === void 0 ? void 0 : transactionTracker.shouldTrackTransaction(transactionTracking);
|
|
52
55
|
|
|
@@ -11,7 +11,8 @@ var isReadOnlyProperty = function isReadOnlyProperty(prop) {
|
|
|
11
11
|
|
|
12
12
|
export var freezeUnsafeTransactionProperties = function freezeUnsafeTransactionProperties(_ref) {
|
|
13
13
|
var dispatchAnalyticsEvent = _ref.dispatchAnalyticsEvent,
|
|
14
|
-
pluginKey = _ref.pluginKey
|
|
14
|
+
pluginKey = _ref.pluginKey,
|
|
15
|
+
analyticsOnly = _ref.analyticsOnly;
|
|
15
16
|
|
|
16
17
|
var isUnsafe = function isUnsafe() {
|
|
17
18
|
if (dispatchAnalyticsEvent) {
|
|
@@ -21,11 +22,16 @@ export var freezeUnsafeTransactionProperties = function freezeUnsafeTransactionP
|
|
|
21
22
|
eventType: EVENT_TYPE.OPERATIONAL,
|
|
22
23
|
attributes: {
|
|
23
24
|
pluginKey: pluginKey || 'unknown'
|
|
25
|
+
},
|
|
26
|
+
nonPrivacySafeAttributes: {
|
|
27
|
+
stack: new Error().stack
|
|
24
28
|
}
|
|
25
29
|
});
|
|
26
30
|
}
|
|
27
31
|
|
|
28
|
-
|
|
32
|
+
if (!analyticsOnly) {
|
|
33
|
+
throw new Error(UNSAFE_PROPERTY_SET_ERROR);
|
|
34
|
+
}
|
|
29
35
|
};
|
|
30
36
|
|
|
31
37
|
return {
|
package/dist/esm/version.json
CHANGED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Command } from '../../../types';
|
|
2
|
+
/**
|
|
3
|
+
* Fixes cursor position after delete for list/task in panel and table
|
|
4
|
+
*
|
|
5
|
+
* ED-13873 fixes a bug where after deleting a list the cursor would move
|
|
6
|
+
* to the cell to the right. Uses setSelection to position the cursor as expected after deleting.
|
|
7
|
+
*
|
|
8
|
+
* @param state EditorState<any>
|
|
9
|
+
* @param dispatch CommandDispatch
|
|
10
|
+
* @returns boolean
|
|
11
|
+
*/
|
|
12
|
+
export declare const deleteAndMoveCursor: Command;
|
|
@@ -2,3 +2,4 @@ export { cleanUpAtTheStartOfDocument, insertBlockType, insertBlockTypesWithAnaly
|
|
|
2
2
|
export type { InputMethod } from './block-type';
|
|
3
3
|
export { insertBlock } from './insert-block';
|
|
4
4
|
export { isConvertableToCodeBlock, transformToCodeBlockAction, } from './transform-to-code-block';
|
|
5
|
+
export { deleteAndMoveCursor } from './delete-and-move-cursor';
|
|
@@ -19,6 +19,7 @@ export interface DropdownButtonItemProps extends ButtonItemProps {
|
|
|
19
19
|
onMouseEnter?: (event: React.MouseEvent | React.KeyboardEvent) => void;
|
|
20
20
|
onMouseOver?: (event: React.MouseEvent | React.KeyboardEvent) => void;
|
|
21
21
|
onMouseLeave?: (event: React.MouseEvent | React.KeyboardEvent) => void;
|
|
22
|
+
onMouseOut?: (event: React.MouseEvent | React.KeyboardEvent) => void;
|
|
22
23
|
onFocus?: (event: React.MouseEvent | React.KeyboardEvent) => void;
|
|
23
24
|
onBlur?: (event: React.MouseEvent | React.KeyboardEvent) => void;
|
|
24
25
|
}
|
|
@@ -5,7 +5,6 @@ import { PaletteColor } from '../../../ui/ColorPalette/Palettes/type';
|
|
|
5
5
|
export { DEFAULT_COLOR } from '../utils/color';
|
|
6
6
|
export declare type TextColorPluginState = {
|
|
7
7
|
palette: Array<PaletteColor>;
|
|
8
|
-
paletteExpanded?: Array<PaletteColor>;
|
|
9
8
|
defaultColor: string;
|
|
10
9
|
disabled?: boolean;
|
|
11
10
|
color: string | null;
|
|
@@ -25,6 +24,7 @@ export declare type TextColorDefaultColor = {
|
|
|
25
24
|
};
|
|
26
25
|
export interface TextColorPluginConfig {
|
|
27
26
|
defaultColor?: TextColorDefaultColor;
|
|
27
|
+
/** @deprecated [ED-15849] Color selection palette now shows more colors by default. */
|
|
28
28
|
allowMoreTextColors?: boolean;
|
|
29
29
|
}
|
|
30
30
|
export declare function createInitialPluginState(editorState: EditorState, pluginConfig?: TextColorPluginConfig): TextColorPluginState;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { textColorPalette
|
|
1
|
+
export { textColorPalette } from '@atlaskit/editor-common/ui-color';
|
|
@@ -12,10 +12,11 @@ export declare const KeyDownHandlerContext: React.Context<KeyDownHandlerContext>
|
|
|
12
12
|
* @param
|
|
13
13
|
* @returns
|
|
14
14
|
*/
|
|
15
|
-
export declare const ToolbarArrowKeyNavigationProvider: ({ children, editorView, childComponentSelector, handleEscape, disableArrowKeyNavigation, }: {
|
|
15
|
+
export declare const ToolbarArrowKeyNavigationProvider: ({ children, editorView, childComponentSelector, handleEscape, disableArrowKeyNavigation, isShortcutToFocusToolbar, }: {
|
|
16
16
|
children: ReactNode;
|
|
17
17
|
editorView?: EditorView<any> | undefined;
|
|
18
18
|
childComponentSelector: string;
|
|
19
19
|
handleEscape?: ((event: KeyboardEvent) => void) | undefined;
|
|
20
20
|
disableArrowKeyNavigation?: boolean | undefined;
|
|
21
|
+
isShortcutToFocusToolbar?: ((event: KeyboardEvent) => boolean) | undefined;
|
|
21
22
|
}) => JSX.Element;
|
|
@@ -7,6 +7,7 @@ import { FeatureFlags } from '../../types/feature-flags';
|
|
|
7
7
|
import { DispatchAnalyticsEvent } from '../../plugins/analytics/types';
|
|
8
8
|
declare type InstrumentedPluginOptions = EditorProps['performanceTracking'] & {
|
|
9
9
|
saferDispatchedTransactions?: FeatureFlags['saferDispatchedTransactions'];
|
|
10
|
+
saferDispatchedTransactionsAnalyticsOnly?: FeatureFlags['saferDispatchedTransactionsAnalyticsOnly'];
|
|
10
11
|
dispatchAnalyticsEvent?: DispatchAnalyticsEvent;
|
|
11
12
|
};
|
|
12
13
|
export declare class InstrumentedPlugin<PluginState, NodeSchema extends Schema<any, any>> extends SafePlugin<PluginState, NodeSchema> {
|
|
@@ -3,6 +3,7 @@ export declare const UNSAFE_PROPERTY_SET_ERROR = "Setting an unsafe property on
|
|
|
3
3
|
interface FreezeUnsafeTransactionOptions {
|
|
4
4
|
dispatchAnalyticsEvent?: DispatchAnalyticsEvent;
|
|
5
5
|
pluginKey?: string;
|
|
6
|
+
analyticsOnly?: boolean;
|
|
6
7
|
}
|
|
7
|
-
export declare const freezeUnsafeTransactionProperties: <TrType extends object>({ dispatchAnalyticsEvent, pluginKey, }: FreezeUnsafeTransactionOptions) => ProxyHandler<TrType>;
|
|
8
|
+
export declare const freezeUnsafeTransactionProperties: <TrType extends object>({ dispatchAnalyticsEvent, pluginKey, analyticsOnly, }: FreezeUnsafeTransactionOptions) => ProxyHandler<TrType>;
|
|
8
9
|
export {};
|