@atlaskit/editor-plugin-text-formatting 1.16.2 → 1.16.4
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/{commands → editor-commands}/clear-formatting.js +1 -1
- package/dist/cjs/{commands → editor-commands}/text-formatting.js +1 -1
- package/dist/cjs/{utils.js → editor-commands/utils.js} +1 -1
- package/dist/cjs/index.js +2 -2
- package/dist/cjs/pm-plugins/clear-formatting-keymap.js +1 -1
- package/dist/cjs/pm-plugins/clear-formatting.js +1 -1
- package/dist/cjs/pm-plugins/keymap.js +1 -1
- package/dist/cjs/pm-plugins/main.js +1 -1
- package/dist/cjs/{plugin.js → textFormattingPlugin.js} +3 -2
- package/dist/cjs/textFormattingPluginType.js +5 -0
- package/dist/cjs/ui/FloatingToolbarComponent.js +2 -1
- package/dist/cjs/ui/Toolbar/bold-button.js +5 -2
- package/dist/cjs/ui/Toolbar/constants.js +2 -0
- package/dist/cjs/ui/Toolbar/dropdown-menu.js +4 -2
- package/dist/cjs/ui/Toolbar/hooks/clear-formatting-icon.js +2 -2
- package/dist/cjs/ui/Toolbar/hooks/formatting-icons.js +2 -2
- package/dist/cjs/ui/Toolbar/index.js +3 -2
- package/dist/cjs/{input-method-utils.js → ui/Toolbar/input-method-utils.js} +1 -1
- package/dist/es2019/{commands → editor-commands}/clear-formatting.js +1 -1
- package/dist/es2019/{commands → editor-commands}/text-formatting.js +1 -1
- package/dist/es2019/{utils.js → editor-commands/utils.js} +1 -1
- package/dist/es2019/index.js +1 -1
- package/dist/es2019/pm-plugins/clear-formatting-keymap.js +1 -1
- package/dist/es2019/pm-plugins/clear-formatting.js +1 -1
- package/dist/es2019/pm-plugins/keymap.js +1 -1
- package/dist/es2019/pm-plugins/main.js +2 -2
- package/dist/es2019/{plugin.js → textFormattingPlugin.js} +4 -2
- package/dist/es2019/textFormattingPluginType.js +1 -0
- package/dist/es2019/ui/FloatingToolbarComponent.js +2 -1
- package/dist/es2019/ui/Toolbar/bold-button.js +5 -2
- package/dist/es2019/ui/Toolbar/constants.js +2 -0
- package/dist/es2019/ui/Toolbar/dropdown-menu.js +4 -2
- package/dist/es2019/ui/Toolbar/hooks/clear-formatting-icon.js +2 -2
- package/dist/es2019/ui/Toolbar/hooks/formatting-icons.js +2 -2
- package/dist/es2019/ui/Toolbar/index.js +3 -2
- package/dist/es2019/{input-method-utils.js → ui/Toolbar/input-method-utils.js} +1 -1
- package/dist/esm/{commands → editor-commands}/clear-formatting.js +1 -1
- package/dist/esm/{commands → editor-commands}/text-formatting.js +1 -1
- package/dist/esm/{utils.js → editor-commands/utils.js} +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/pm-plugins/clear-formatting-keymap.js +1 -1
- package/dist/esm/pm-plugins/clear-formatting.js +1 -1
- package/dist/esm/pm-plugins/keymap.js +1 -1
- package/dist/esm/pm-plugins/main.js +2 -2
- package/dist/esm/{plugin.js → textFormattingPlugin.js} +4 -2
- package/dist/esm/textFormattingPluginType.js +1 -0
- package/dist/esm/ui/FloatingToolbarComponent.js +2 -1
- package/dist/esm/ui/Toolbar/bold-button.js +5 -2
- package/dist/esm/ui/Toolbar/constants.js +2 -0
- package/dist/esm/ui/Toolbar/dropdown-menu.js +4 -2
- package/dist/esm/ui/Toolbar/hooks/clear-formatting-icon.js +2 -2
- package/dist/esm/ui/Toolbar/hooks/formatting-icons.js +2 -2
- package/dist/esm/ui/Toolbar/index.js +3 -2
- package/dist/esm/{input-method-utils.js → ui/Toolbar/input-method-utils.js} +1 -1
- package/dist/types/{utils.d.ts → editor-commands/utils.d.ts} +1 -1
- package/dist/types/index.d.ts +3 -3
- package/dist/types/textFormattingPlugin.d.ts +6 -0
- package/dist/types/{plugin.d.ts → textFormattingPluginType.d.ts} +1 -6
- package/dist/types/ui/FloatingToolbarComponent.d.ts +1 -1
- package/dist/types/ui/PrimaryToolbarComponent.d.ts +1 -1
- package/dist/types/ui/Toolbar/bold-button.d.ts +3 -1
- package/dist/types/ui/Toolbar/dropdown-menu.d.ts +3 -2
- package/dist/types/ui/Toolbar/index.d.ts +1 -1
- package/dist/types/{input-method-utils.d.ts → ui/Toolbar/input-method-utils.d.ts} +1 -1
- package/dist/types-ts4.5/{utils.d.ts → editor-commands/utils.d.ts} +1 -1
- package/dist/types-ts4.5/index.d.ts +3 -3
- package/dist/types-ts4.5/textFormattingPlugin.d.ts +6 -0
- package/dist/types-ts4.5/{plugin.d.ts → textFormattingPluginType.d.ts} +1 -6
- package/dist/types-ts4.5/ui/FloatingToolbarComponent.d.ts +1 -1
- package/dist/types-ts4.5/ui/PrimaryToolbarComponent.d.ts +1 -1
- package/dist/types-ts4.5/ui/Toolbar/bold-button.d.ts +3 -1
- package/dist/types-ts4.5/ui/Toolbar/dropdown-menu.d.ts +3 -2
- package/dist/types-ts4.5/ui/Toolbar/index.d.ts +1 -1
- package/dist/types-ts4.5/{input-method-utils.d.ts → ui/Toolbar/input-method-utils.d.ts} +1 -1
- package/package.json +7 -4
- /package/dist/cjs/{commands → editor-commands}/transform-to-code.js +0 -0
- /package/dist/cjs/{utils → editor-commands/utils}/cell-selection.js +0 -0
- /package/dist/cjs/{commands.js → pm-plugins/commands.js} +0 -0
- /package/dist/es2019/{commands → editor-commands}/transform-to-code.js +0 -0
- /package/dist/es2019/{utils → editor-commands/utils}/cell-selection.js +0 -0
- /package/dist/es2019/{commands.js → pm-plugins/commands.js} +0 -0
- /package/dist/esm/{commands → editor-commands}/transform-to-code.js +0 -0
- /package/dist/esm/{utils → editor-commands/utils}/cell-selection.js +0 -0
- /package/dist/esm/{commands.js → pm-plugins/commands.js} +0 -0
- /package/dist/types/{commands → editor-commands}/clear-formatting.d.ts +0 -0
- /package/dist/types/{commands → editor-commands}/text-formatting.d.ts +0 -0
- /package/dist/types/{commands → editor-commands}/transform-to-code.d.ts +0 -0
- /package/dist/types/{utils → editor-commands/utils}/cell-selection.d.ts +0 -0
- /package/dist/types/{commands.d.ts → pm-plugins/commands.d.ts} +0 -0
- /package/dist/types-ts4.5/{commands → editor-commands}/clear-formatting.d.ts +0 -0
- /package/dist/types-ts4.5/{commands → editor-commands}/text-formatting.d.ts +0 -0
- /package/dist/types-ts4.5/{commands → editor-commands}/transform-to-code.d.ts +0 -0
- /package/dist/types-ts4.5/{utils → editor-commands/utils}/cell-selection.d.ts +0 -0
- /package/dist/types-ts4.5/{commands.d.ts → pm-plugins/commands.d.ts} +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-text-formatting
|
|
2
2
|
|
|
3
|
+
## 1.16.4
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#171551](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/171551)
|
|
8
|
+
[`702c918817e78`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/702c918817e78) -
|
|
9
|
+
ED-25817: refactors plugins to meet folder standards
|
|
10
|
+
|
|
11
|
+
## 1.16.3
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- [#172933](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/172933)
|
|
16
|
+
[`8323af2381d00`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/8323af2381d00) -
|
|
17
|
+
[ux] Arranges items in the Selection toolbar under the Contextual toolbar experiment flag
|
|
18
|
+
- Updated dependencies
|
|
19
|
+
|
|
3
20
|
## 1.16.2
|
|
4
21
|
|
|
5
22
|
### Patch Changes
|
|
@@ -9,7 +9,7 @@ exports.clearFormattingWithAnalytics = clearFormattingWithAnalytics;
|
|
|
9
9
|
var _analytics = require("@atlaskit/editor-common/analytics");
|
|
10
10
|
var _transform = require("@atlaskit/editor-prosemirror/transform");
|
|
11
11
|
var _cellSelection = require("@atlaskit/editor-tables/cell-selection");
|
|
12
|
-
var _cellSelection2 = require("
|
|
12
|
+
var _cellSelection2 = require("./utils/cell-selection");
|
|
13
13
|
var FORMATTING_NODE_TYPES = exports.FORMATTING_NODE_TYPES = ['heading', 'blockquote'];
|
|
14
14
|
var FORMATTING_MARK_TYPES = exports.FORMATTING_MARK_TYPES = ['em', 'code', 'strike', 'strong', 'underline', 'textColor', 'subsup', 'backgroundColor'];
|
|
15
15
|
var formatTypes = {
|
|
@@ -8,7 +8,7 @@ var _analytics = require("@atlaskit/editor-common/analytics");
|
|
|
8
8
|
var _editorAnalytics = require("@atlaskit/editor-common/editor-analytics");
|
|
9
9
|
var _mark = require("@atlaskit/editor-common/mark");
|
|
10
10
|
var _state = require("@atlaskit/editor-prosemirror/state");
|
|
11
|
-
var _utils = require("
|
|
11
|
+
var _utils = require("./utils");
|
|
12
12
|
var moveRight = exports.moveRight = function moveRight() {
|
|
13
13
|
return function (state, dispatch) {
|
|
14
14
|
var code = state.schema.marks.code;
|
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.markActive = exports.isArrayContainsContent = exports.hasCode = exports.compareItemsArrays = exports.checkFormattingIsPresent = void 0;
|
|
7
7
|
var _mark = require("@atlaskit/editor-common/mark");
|
|
8
|
-
var _clearFormatting = require("./
|
|
8
|
+
var _clearFormatting = require("./clear-formatting");
|
|
9
9
|
var hasCode = exports.hasCode = function hasCode(state, pos) {
|
|
10
10
|
var code = state.schema.marks.code;
|
|
11
11
|
var node = pos >= 0 && state.doc.nodeAt(pos);
|
package/dist/cjs/index.js
CHANGED
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
Object.defineProperty(exports, "textFormattingPlugin", {
|
|
7
7
|
enumerable: true,
|
|
8
8
|
get: function get() {
|
|
9
|
-
return
|
|
9
|
+
return _textFormattingPlugin.textFormattingPlugin;
|
|
10
10
|
}
|
|
11
11
|
});
|
|
12
|
-
var
|
|
12
|
+
var _textFormattingPlugin = require("./textFormattingPlugin");
|
|
@@ -8,7 +8,7 @@ exports.keymapPlugin = keymapPlugin;
|
|
|
8
8
|
var _analytics = require("@atlaskit/editor-common/analytics");
|
|
9
9
|
var _keymaps = require("@atlaskit/editor-common/keymaps");
|
|
10
10
|
var _keymap = require("@atlaskit/editor-prosemirror/keymap");
|
|
11
|
-
var _clearFormatting = require("../commands/clear-formatting");
|
|
11
|
+
var _clearFormatting = require("../editor-commands/clear-formatting");
|
|
12
12
|
function keymapPlugin(editorAnalyticsAPI) {
|
|
13
13
|
var list = {};
|
|
14
14
|
(0, _keymaps.bindKeymapWithCommand)(_keymaps.clearFormatting.common, (0, _clearFormatting.clearFormattingWithAnalytics)(_analytics.INPUT_METHOD.SHORTCUT, editorAnalyticsAPI), list);
|
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.pluginKey = exports.plugin = void 0;
|
|
7
7
|
var _safePlugin = require("@atlaskit/editor-common/safe-plugin");
|
|
8
8
|
var _state = require("@atlaskit/editor-prosemirror/state");
|
|
9
|
-
var _utils = require("../utils");
|
|
9
|
+
var _utils = require("../editor-commands/utils");
|
|
10
10
|
var pluginKey = exports.pluginKey = new _state.PluginKey('clearFormattingPlugin');
|
|
11
11
|
var plugin = exports.plugin = function plugin(dispatch) {
|
|
12
12
|
return new _safePlugin.SafePlugin({
|
|
@@ -8,7 +8,7 @@ var _analytics = require("@atlaskit/editor-common/analytics");
|
|
|
8
8
|
var _keymaps = require("@atlaskit/editor-common/keymaps");
|
|
9
9
|
var _safePlugin = require("@atlaskit/editor-common/safe-plugin");
|
|
10
10
|
var _keymap = require("@atlaskit/editor-prosemirror/keymap");
|
|
11
|
-
var _commands = require("
|
|
11
|
+
var _commands = require("./commands");
|
|
12
12
|
function keymapPlugin(schema, editorAnalyticsAPI) {
|
|
13
13
|
var list = {};
|
|
14
14
|
if (schema.marks.strong) {
|
|
@@ -17,7 +17,7 @@ var _safePlugin = require("@atlaskit/editor-common/safe-plugin");
|
|
|
17
17
|
var _utils = require("@atlaskit/editor-common/utils");
|
|
18
18
|
var _commands = require("@atlaskit/editor-prosemirror/commands");
|
|
19
19
|
var _state = require("@atlaskit/editor-prosemirror/state");
|
|
20
|
-
var _textFormatting = _interopRequireWildcard(require("../commands/text-formatting"));
|
|
20
|
+
var _textFormatting = _interopRequireWildcard(require("../editor-commands/text-formatting"));
|
|
21
21
|
var commands = _textFormatting;
|
|
22
22
|
var _pluginKey = require("./plugin-key");
|
|
23
23
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
@@ -9,9 +9,9 @@ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/de
|
|
|
9
9
|
var _react = _interopRequireDefault(require("react"));
|
|
10
10
|
var _adfSchema = require("@atlaskit/adf-schema");
|
|
11
11
|
var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
|
|
12
|
-
var _commands = require("./commands");
|
|
13
12
|
var _clearFormatting = require("./pm-plugins/clear-formatting");
|
|
14
13
|
var _clearFormattingKeymap = _interopRequireDefault(require("./pm-plugins/clear-formatting-keymap"));
|
|
14
|
+
var _commands = require("./pm-plugins/commands");
|
|
15
15
|
var _cursor = _interopRequireDefault(require("./pm-plugins/cursor"));
|
|
16
16
|
var _inputRule = _interopRequireDefault(require("./pm-plugins/input-rule"));
|
|
17
17
|
var _keymap = _interopRequireDefault(require("./pm-plugins/keymap"));
|
|
@@ -152,7 +152,8 @@ var textFormattingPlugin = exports.textFormattingPlugin = function textFormattin
|
|
|
152
152
|
};
|
|
153
153
|
return {
|
|
154
154
|
isToolbarAbove: true,
|
|
155
|
-
items: [toolbarCustom]
|
|
155
|
+
items: [toolbarCustom],
|
|
156
|
+
rank: 7
|
|
156
157
|
};
|
|
157
158
|
} else {
|
|
158
159
|
return undefined;
|
|
@@ -65,7 +65,8 @@ var FloatingToolbarTextFormat = function FloatingToolbarTextFormat(_ref) {
|
|
|
65
65
|
moreButtonLabel: FloatingToolbarSettings.moreButtonLabel,
|
|
66
66
|
hasFormattingActive: FloatingToolbarSettings.hasMoreButton,
|
|
67
67
|
hasMoreButton: FloatingToolbarSettings.hasMoreButton,
|
|
68
|
-
intl: intl
|
|
68
|
+
intl: intl,
|
|
69
|
+
toolbarType: FloatingToolbarSettings.toolbarType
|
|
69
70
|
});
|
|
70
71
|
};
|
|
71
72
|
var FloatingToolbarTextFormalWithIntl = exports.FloatingToolbarTextFormalWithIntl = (0, _reactIntlNext.injectIntl)(FloatingToolbarTextFormat);
|
|
@@ -12,6 +12,7 @@ var _uiMenu = require("@atlaskit/editor-common/ui-menu");
|
|
|
12
12
|
var _textBoldEditorBold = _interopRequireDefault(require("@atlaskit/icon/core/migration/text-bold--editor-bold"));
|
|
13
13
|
var _chevronDown = _interopRequireDefault(require("@atlaskit/icon/utility/migration/chevron-down"));
|
|
14
14
|
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
15
|
+
var _types = require("./types");
|
|
15
16
|
/**
|
|
16
17
|
* @jsxRuntime classic
|
|
17
18
|
* @jsx jsx
|
|
@@ -26,10 +27,12 @@ var BoldToolbarButton = exports.BoldToolbarButton = function BoldToolbarButton(_
|
|
|
26
27
|
isSelected = _ref.isSelected,
|
|
27
28
|
ariaExpanded = _ref['aria-expanded'],
|
|
28
29
|
onClick = _ref.onClick,
|
|
29
|
-
onKeyDown = _ref.onKeyDown
|
|
30
|
+
onKeyDown = _ref.onKeyDown,
|
|
31
|
+
toolbarType = _ref.toolbarType;
|
|
32
|
+
var reducedSpacing = toolbarType === _types.ToolbarType.FLOATING ? 'compact' : 'none';
|
|
30
33
|
return (0, _react2.jsx)(_uiMenu.ToolbarButton, {
|
|
31
34
|
testId: 'ak-editor-selection-toolbar-format-text-button',
|
|
32
|
-
spacing: isReducedSpacing ?
|
|
35
|
+
spacing: isReducedSpacing ? reducedSpacing : 'default',
|
|
33
36
|
disabled: isDisabled,
|
|
34
37
|
selected: isSelected,
|
|
35
38
|
"aria-label": label,
|
|
@@ -12,12 +12,14 @@ var _ResponsiveCustomButt, _ResponsiveCustomMenu, _ResponsiveCustomButt2, _Respo
|
|
|
12
12
|
var DefaultButtonsToolbar = exports.DefaultButtonsToolbar = [_types2.IconTypes.strong, _types2.IconTypes.em];
|
|
13
13
|
var DefaultButtonsMenu = exports.DefaultButtonsMenu = [_types2.IconTypes.underline, _types2.IconTypes.strike, _types2.IconTypes.code, _types2.IconTypes.subscript, _types2.IconTypes.superscript];
|
|
14
14
|
|
|
15
|
+
// eslint-disable-next-line @repo/internal/deprecations/deprecation-ticket-required -- Ignored via go/ED-25883
|
|
15
16
|
/** @deprecated
|
|
16
17
|
* To be removed as part of ED-25129 in favour of ResponsiveCustomButtonToolbarNext along with references
|
|
17
18
|
* to platform_editor_toolbar_responsive_fixes feature gate
|
|
18
19
|
*/
|
|
19
20
|
var ResponsiveCustomButtonToolbar = exports.ResponsiveCustomButtonToolbar = (_ResponsiveCustomButt = {}, (0, _defineProperty2.default)(_ResponsiveCustomButt, _types.ToolbarSize.XXL, DefaultButtonsToolbar), (0, _defineProperty2.default)(_ResponsiveCustomButt, _types.ToolbarSize.XL, DefaultButtonsToolbar), (0, _defineProperty2.default)(_ResponsiveCustomButt, _types.ToolbarSize.L, DefaultButtonsToolbar), (0, _defineProperty2.default)(_ResponsiveCustomButt, _types.ToolbarSize.M, []), (0, _defineProperty2.default)(_ResponsiveCustomButt, _types.ToolbarSize.S, []), (0, _defineProperty2.default)(_ResponsiveCustomButt, _types.ToolbarSize.XXXS, []), _ResponsiveCustomButt);
|
|
20
21
|
|
|
22
|
+
// eslint-disable-next-line @repo/internal/deprecations/deprecation-ticket-required -- Ignored via go/ED-25883
|
|
21
23
|
/** @deprecated
|
|
22
24
|
* To be removed as part of ED-25129 in favour of ResponsiveCustomButtonToolbarNext along with references
|
|
23
25
|
* to platform_editor_toolbar_responsive_fixes feature gate
|
|
@@ -26,7 +26,8 @@ var FormattingTextDropdownMenu = exports.FormattingTextDropdownMenu = /*#__PURE_
|
|
|
26
26
|
popupsMountPoint = _ref.popupsMountPoint,
|
|
27
27
|
popupsScrollableElement = _ref.popupsScrollableElement,
|
|
28
28
|
hasMoreButton = _ref.hasMoreButton,
|
|
29
|
-
intl = _ref.intl
|
|
29
|
+
intl = _ref.intl,
|
|
30
|
+
toolbarType = _ref.toolbarType;
|
|
30
31
|
var _useMenuState = (0, _menuState.useMenuState)(),
|
|
31
32
|
_useMenuState2 = (0, _slicedToArray2.default)(_useMenuState, 3),
|
|
32
33
|
isMenuOpen = _useMenuState2[0],
|
|
@@ -104,6 +105,7 @@ var FormattingTextDropdownMenu = exports.FormattingTextDropdownMenu = /*#__PURE_
|
|
|
104
105
|
toggleMenu();
|
|
105
106
|
setIsOpenedByKeyboard(true);
|
|
106
107
|
}
|
|
107
|
-
}
|
|
108
|
+
},
|
|
109
|
+
toolbarType: toolbarType
|
|
108
110
|
}));
|
|
109
111
|
});
|
|
@@ -9,8 +9,8 @@ var _react2 = require("@emotion/react");
|
|
|
9
9
|
var _keymaps = require("@atlaskit/editor-common/keymaps");
|
|
10
10
|
var _messages = require("@atlaskit/editor-common/messages");
|
|
11
11
|
var _shortcut = require("@atlaskit/editor-shared-styles/shortcut");
|
|
12
|
-
var _clearFormatting = require("../../../commands/clear-formatting");
|
|
13
|
-
var _inputMethodUtils = require("
|
|
12
|
+
var _clearFormatting = require("../../../editor-commands/clear-formatting");
|
|
13
|
+
var _inputMethodUtils = require("../input-method-utils");
|
|
14
14
|
/**
|
|
15
15
|
* @jsxRuntime classic
|
|
16
16
|
* @jsx jsx
|
|
@@ -16,8 +16,8 @@ var _preset = require("@atlaskit/editor-common/preset");
|
|
|
16
16
|
var _shortcut = require("@atlaskit/editor-shared-styles/shortcut");
|
|
17
17
|
var _textBoldEditorBold = _interopRequireDefault(require("@atlaskit/icon/core/migration/text-bold--editor-bold"));
|
|
18
18
|
var _textItalicEditorItalic = _interopRequireDefault(require("@atlaskit/icon/core/migration/text-italic--editor-italic"));
|
|
19
|
-
var _commands = require("../../../commands");
|
|
20
|
-
var _inputMethodUtils = require("
|
|
19
|
+
var _commands = require("../../../pm-plugins/commands");
|
|
20
|
+
var _inputMethodUtils = require("../input-method-utils");
|
|
21
21
|
var _types = require("../types");
|
|
22
22
|
var _IconsMarkSchema;
|
|
23
23
|
/**
|
|
@@ -14,7 +14,7 @@ var _hooks = require("@atlaskit/editor-common/hooks");
|
|
|
14
14
|
var _messages = require("@atlaskit/editor-common/messages");
|
|
15
15
|
var _styles = require("@atlaskit/editor-common/styles");
|
|
16
16
|
var _ui = require("@atlaskit/editor-common/ui");
|
|
17
|
-
var _utils = require("../../utils");
|
|
17
|
+
var _utils = require("../../editor-commands/utils");
|
|
18
18
|
var _dropdownMenu = require("./dropdown-menu");
|
|
19
19
|
var _clearFormattingIcon = require("./hooks/clear-formatting-icon");
|
|
20
20
|
var _formattingIcons = require("./hooks/formatting-icons");
|
|
@@ -168,7 +168,8 @@ var ToolbarFormatting = function ToolbarFormatting(_ref) {
|
|
|
168
168
|
hasFormattingActive: hasFormattingActive,
|
|
169
169
|
hasMoreButton: true,
|
|
170
170
|
items: items,
|
|
171
|
-
intl: intl
|
|
171
|
+
intl: intl,
|
|
172
|
+
toolbarType: toolbarType
|
|
172
173
|
}))), !(api !== null && api !== void 0 && api.primaryToolbar) && /* eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage */
|
|
173
174
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
|
|
174
175
|
(0, _react2.jsx)("span", {
|
|
@@ -7,7 +7,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
exports.toolbarTypeToInputMethod = exports.getInputMethod = void 0;
|
|
8
8
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
9
9
|
var _analytics = require("@atlaskit/editor-common/analytics");
|
|
10
|
-
var _types = require("./
|
|
10
|
+
var _types = require("./types");
|
|
11
11
|
var _toolbarTypeToInputMe;
|
|
12
12
|
var toolbarTypeToInputMethod = exports.toolbarTypeToInputMethod = (_toolbarTypeToInputMe = {}, (0, _defineProperty2.default)(_toolbarTypeToInputMe, _types.ToolbarType.PRIMARY, _analytics.INPUT_METHOD.TOOLBAR), (0, _defineProperty2.default)(_toolbarTypeToInputMe, _types.ToolbarType.FLOATING, _analytics.INPUT_METHOD.FLOATING_TB), _toolbarTypeToInputMe);
|
|
13
13
|
var getInputMethod = exports.getInputMethod = function getInputMethod(toolbarType) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE } from '@atlaskit/editor-common/analytics';
|
|
2
2
|
import { liftTarget } from '@atlaskit/editor-prosemirror/transform';
|
|
3
3
|
import { CellSelection } from '@atlaskit/editor-tables/cell-selection';
|
|
4
|
-
import { cellSelectionNodesBetween } from '
|
|
4
|
+
import { cellSelectionNodesBetween } from './utils/cell-selection';
|
|
5
5
|
export const FORMATTING_NODE_TYPES = ['heading', 'blockquote'];
|
|
6
6
|
export const FORMATTING_MARK_TYPES = ['em', 'code', 'strike', 'strong', 'underline', 'textColor', 'subsup', 'backgroundColor'];
|
|
7
7
|
const formatTypes = {
|
|
@@ -2,7 +2,7 @@ import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE, INPUT_METHOD } f
|
|
|
2
2
|
import { withAnalytics } from '@atlaskit/editor-common/editor-analytics';
|
|
3
3
|
import { applyMarkOnRange } from '@atlaskit/editor-common/mark';
|
|
4
4
|
import { Selection } from '@atlaskit/editor-prosemirror/state';
|
|
5
|
-
import { hasCode, markActive } from '
|
|
5
|
+
import { hasCode, markActive } from './utils';
|
|
6
6
|
export const moveRight = () => {
|
|
7
7
|
return (state, dispatch) => {
|
|
8
8
|
const {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { anyMarkActive } from '@atlaskit/editor-common/mark';
|
|
2
|
-
import { FORMATTING_MARK_TYPES, FORMATTING_NODE_TYPES } from './
|
|
2
|
+
import { FORMATTING_MARK_TYPES, FORMATTING_NODE_TYPES } from './clear-formatting';
|
|
3
3
|
export const hasCode = (state, pos) => {
|
|
4
4
|
const {
|
|
5
5
|
code
|
package/dist/es2019/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { textFormattingPlugin } from './
|
|
1
|
+
export { textFormattingPlugin } from './textFormattingPlugin';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
2
2
|
import { bindKeymapWithCommand, clearFormatting } from '@atlaskit/editor-common/keymaps';
|
|
3
3
|
import { keymap } from '@atlaskit/editor-prosemirror/keymap';
|
|
4
|
-
import { clearFormattingWithAnalytics } from '../commands/clear-formatting';
|
|
4
|
+
import { clearFormattingWithAnalytics } from '../editor-commands/clear-formatting';
|
|
5
5
|
export function keymapPlugin(editorAnalyticsAPI) {
|
|
6
6
|
const list = {};
|
|
7
7
|
bindKeymapWithCommand(clearFormatting.common, clearFormattingWithAnalytics(INPUT_METHOD.SHORTCUT, editorAnalyticsAPI), list);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
2
2
|
import { PluginKey } from '@atlaskit/editor-prosemirror/state';
|
|
3
|
-
import { checkFormattingIsPresent } from '../utils';
|
|
3
|
+
import { checkFormattingIsPresent } from '../editor-commands/utils';
|
|
4
4
|
export const pluginKey = new PluginKey('clearFormattingPlugin');
|
|
5
5
|
export const plugin = dispatch => new SafePlugin({
|
|
6
6
|
state: {
|
|
@@ -2,7 +2,7 @@ import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
|
2
2
|
import { bindKeymapWithEditorCommand, isCapsLockOnAndModifyKeyboardEvent, toggleBold, toggleCode, toggleItalic, toggleStrikethrough, toggleSubscript, toggleSuperscript, toggleUnderline } from '@atlaskit/editor-common/keymaps';
|
|
3
3
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
4
4
|
import { keydownHandler } from '@atlaskit/editor-prosemirror/keymap';
|
|
5
|
-
import { toggleCodeWithAnalytics, toggleEmWithAnalytics, toggleStrikeWithAnalytics, toggleStrongWithAnalytics, toggleSubscriptWithAnalytics, toggleSuperscriptWithAnalytics, toggleUnderlineWithAnalytics } from '
|
|
5
|
+
import { toggleCodeWithAnalytics, toggleEmWithAnalytics, toggleStrikeWithAnalytics, toggleStrongWithAnalytics, toggleSubscriptWithAnalytics, toggleSuperscriptWithAnalytics, toggleUnderlineWithAnalytics } from './commands';
|
|
6
6
|
export default function keymapPlugin(schema, editorAnalyticsAPI) {
|
|
7
7
|
const list = {};
|
|
8
8
|
if (schema.marks.strong) {
|
|
@@ -7,8 +7,8 @@ import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
|
7
7
|
import { shallowEqual } from '@atlaskit/editor-common/utils';
|
|
8
8
|
import { toggleMark } from '@atlaskit/editor-prosemirror/commands';
|
|
9
9
|
import { NodeSelection } from '@atlaskit/editor-prosemirror/state';
|
|
10
|
-
import { createInlineCodeFromTextInputWithAnalytics } from '../commands/text-formatting';
|
|
11
|
-
import * as commands from '../commands/text-formatting';
|
|
10
|
+
import { createInlineCodeFromTextInputWithAnalytics } from '../editor-commands/text-formatting';
|
|
11
|
+
import * as commands from '../editor-commands/text-formatting';
|
|
12
12
|
import { pluginKey } from './plugin-key';
|
|
13
13
|
export { pluginKey };
|
|
14
14
|
const isSelectionInlineCursor = selection => {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { code, em, strike, strong, subsup, underline } from '@atlaskit/adf-schema';
|
|
3
3
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
4
|
-
import { toggleCodeWithAnalytics, toggleEmWithAnalytics, toggleStrikeWithAnalytics, toggleStrongWithAnalytics, toggleSubscriptWithAnalytics, toggleSuperscriptWithAnalytics, toggleUnderlineWithAnalytics } from './commands';
|
|
5
4
|
import { plugin as clearFormattingPlugin, pluginKey as clearFormattingPluginKey } from './pm-plugins/clear-formatting';
|
|
6
5
|
import clearFormattingKeymapPlugin from './pm-plugins/clear-formatting-keymap';
|
|
6
|
+
import { toggleCodeWithAnalytics, toggleEmWithAnalytics, toggleStrikeWithAnalytics, toggleStrongWithAnalytics, toggleSubscriptWithAnalytics, toggleSuperscriptWithAnalytics, toggleUnderlineWithAnalytics } from './pm-plugins/commands';
|
|
7
7
|
import textFormattingCursorPlugin from './pm-plugins/cursor';
|
|
8
8
|
import textFormattingInputRulePlugin from './pm-plugins/input-rule';
|
|
9
9
|
import keymapPlugin from './pm-plugins/keymap';
|
|
@@ -11,6 +11,7 @@ import { plugin as pmPlugin, pluginKey as textFormattingPluginKey } from './pm-p
|
|
|
11
11
|
import textFormattingSmartInputRulePlugin from './pm-plugins/smart-input-rule';
|
|
12
12
|
import { FloatingToolbarTextFormalWithIntl as FloatingToolbarComponent } from './ui/FloatingToolbarComponent';
|
|
13
13
|
import { PrimaryToolbarComponent } from './ui/PrimaryToolbarComponent';
|
|
14
|
+
|
|
14
15
|
/**
|
|
15
16
|
* Text formatting plugin to be added to an `EditorPresetBuilder` and used with `ComposableEditor`
|
|
16
17
|
* from `@atlaskit/editor-core`.
|
|
@@ -145,7 +146,8 @@ export const textFormattingPlugin = ({
|
|
|
145
146
|
};
|
|
146
147
|
return {
|
|
147
148
|
isToolbarAbove: true,
|
|
148
|
-
items: [toolbarCustom]
|
|
149
|
+
items: [toolbarCustom],
|
|
150
|
+
rank: 7
|
|
149
151
|
};
|
|
150
152
|
} else {
|
|
151
153
|
return undefined;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -58,7 +58,8 @@ const FloatingToolbarTextFormat = ({
|
|
|
58
58
|
moreButtonLabel: FloatingToolbarSettings.moreButtonLabel,
|
|
59
59
|
hasFormattingActive: FloatingToolbarSettings.hasMoreButton,
|
|
60
60
|
hasMoreButton: FloatingToolbarSettings.hasMoreButton,
|
|
61
|
-
intl: intl
|
|
61
|
+
intl: intl,
|
|
62
|
+
toolbarType: FloatingToolbarSettings.toolbarType
|
|
62
63
|
});
|
|
63
64
|
};
|
|
64
65
|
export const FloatingToolbarTextFormalWithIntl = injectIntl(FloatingToolbarTextFormat);
|
|
@@ -11,6 +11,7 @@ import { ToolbarButton } from '@atlaskit/editor-common/ui-menu';
|
|
|
11
11
|
import BoldIcon from '@atlaskit/icon/core/migration/text-bold--editor-bold';
|
|
12
12
|
import ChevronDownIcon from '@atlaskit/icon/utility/migration/chevron-down';
|
|
13
13
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
14
|
+
import { ToolbarType } from './types';
|
|
14
15
|
export const BoldToolbarButton = ({
|
|
15
16
|
label,
|
|
16
17
|
isReducedSpacing,
|
|
@@ -18,11 +19,13 @@ export const BoldToolbarButton = ({
|
|
|
18
19
|
isSelected,
|
|
19
20
|
'aria-expanded': ariaExpanded,
|
|
20
21
|
onClick,
|
|
21
|
-
onKeyDown
|
|
22
|
+
onKeyDown,
|
|
23
|
+
toolbarType
|
|
22
24
|
}) => {
|
|
25
|
+
const reducedSpacing = toolbarType === ToolbarType.FLOATING ? 'compact' : 'none';
|
|
23
26
|
return jsx(ToolbarButton, {
|
|
24
27
|
testId: 'ak-editor-selection-toolbar-format-text-button',
|
|
25
|
-
spacing: isReducedSpacing ?
|
|
28
|
+
spacing: isReducedSpacing ? reducedSpacing : 'default',
|
|
26
29
|
disabled: isDisabled,
|
|
27
30
|
selected: isSelected,
|
|
28
31
|
"aria-label": label,
|
|
@@ -3,6 +3,7 @@ import { IconTypes } from './types';
|
|
|
3
3
|
export const DefaultButtonsToolbar = [IconTypes.strong, IconTypes.em];
|
|
4
4
|
export const DefaultButtonsMenu = [IconTypes.underline, IconTypes.strike, IconTypes.code, IconTypes.subscript, IconTypes.superscript];
|
|
5
5
|
|
|
6
|
+
// eslint-disable-next-line @repo/internal/deprecations/deprecation-ticket-required -- Ignored via go/ED-25883
|
|
6
7
|
/** @deprecated
|
|
7
8
|
* To be removed as part of ED-25129 in favour of ResponsiveCustomButtonToolbarNext along with references
|
|
8
9
|
* to platform_editor_toolbar_responsive_fixes feature gate
|
|
@@ -16,6 +17,7 @@ export const ResponsiveCustomButtonToolbar = {
|
|
|
16
17
|
[ToolbarSize.XXXS]: []
|
|
17
18
|
};
|
|
18
19
|
|
|
20
|
+
// eslint-disable-next-line @repo/internal/deprecations/deprecation-ticket-required -- Ignored via go/ED-25883
|
|
19
21
|
/** @deprecated
|
|
20
22
|
* To be removed as part of ED-25129 in favour of ResponsiveCustomButtonToolbarNext along with references
|
|
21
23
|
* to platform_editor_toolbar_responsive_fixes feature gate
|
|
@@ -15,7 +15,8 @@ export const FormattingTextDropdownMenu = /*#__PURE__*/React.memo(({
|
|
|
15
15
|
popupsMountPoint,
|
|
16
16
|
popupsScrollableElement,
|
|
17
17
|
hasMoreButton,
|
|
18
|
-
intl
|
|
18
|
+
intl,
|
|
19
|
+
toolbarType
|
|
19
20
|
}) => {
|
|
20
21
|
const [isMenuOpen, toggleMenu, closeMenu] = useMenuState();
|
|
21
22
|
const [isOpenedByKeyboard, setIsOpenedByKeyboard] = useState(false);
|
|
@@ -85,6 +86,7 @@ export const FormattingTextDropdownMenu = /*#__PURE__*/React.memo(({
|
|
|
85
86
|
toggleMenu();
|
|
86
87
|
setIsOpenedByKeyboard(true);
|
|
87
88
|
}
|
|
88
|
-
}
|
|
89
|
+
},
|
|
90
|
+
toolbarType: toolbarType
|
|
89
91
|
}));
|
|
90
92
|
});
|
|
@@ -9,8 +9,8 @@ import { jsx } from '@emotion/react';
|
|
|
9
9
|
import { clearFormatting as clearFormattingKeymap, tooltip } from '@atlaskit/editor-common/keymaps';
|
|
10
10
|
import { toolbarMessages } from '@atlaskit/editor-common/messages';
|
|
11
11
|
import { shortcutStyle } from '@atlaskit/editor-shared-styles/shortcut';
|
|
12
|
-
import { clearFormattingWithAnalytics } from '../../../commands/clear-formatting';
|
|
13
|
-
import { getInputMethod } from '
|
|
12
|
+
import { clearFormattingWithAnalytics } from '../../../editor-commands/clear-formatting';
|
|
13
|
+
import { getInputMethod } from '../input-method-utils';
|
|
14
14
|
export const useClearIcon = ({
|
|
15
15
|
intl,
|
|
16
16
|
textFormattingState,
|
|
@@ -13,8 +13,8 @@ import { editorCommandToPMCommand } from '@atlaskit/editor-common/preset';
|
|
|
13
13
|
import { shortcutStyle } from '@atlaskit/editor-shared-styles/shortcut';
|
|
14
14
|
import BoldIcon from '@atlaskit/icon/core/migration/text-bold--editor-bold';
|
|
15
15
|
import ItalicIcon from '@atlaskit/icon/core/migration/text-italic--editor-italic';
|
|
16
|
-
import { toggleCodeWithAnalytics, toggleEmWithAnalytics, toggleStrikeWithAnalytics, toggleStrongWithAnalytics, toggleSubscriptWithAnalytics, toggleSuperscriptWithAnalytics, toggleUnderlineWithAnalytics } from '../../../commands';
|
|
17
|
-
import { getInputMethod } from '
|
|
16
|
+
import { toggleCodeWithAnalytics, toggleEmWithAnalytics, toggleStrikeWithAnalytics, toggleStrongWithAnalytics, toggleSubscriptWithAnalytics, toggleSuperscriptWithAnalytics, toggleUnderlineWithAnalytics } from '../../../pm-plugins/commands';
|
|
17
|
+
import { getInputMethod } from '../input-method-utils';
|
|
18
18
|
import { IconTypes } from '../types';
|
|
19
19
|
const withInputMethod = (toolbarType, func) => editorCommandToPMCommand(func(getInputMethod(toolbarType)));
|
|
20
20
|
const IconButtons = (editorAnalyticsAPI, toolbarType) => ({
|
|
@@ -11,7 +11,7 @@ import { usePreviousState } from '@atlaskit/editor-common/hooks';
|
|
|
11
11
|
import { toolbarMessages } from '@atlaskit/editor-common/messages';
|
|
12
12
|
import { buttonGroupStyle, separatorStyles, wrapperStyle } from '@atlaskit/editor-common/styles';
|
|
13
13
|
import { Announcer } from '@atlaskit/editor-common/ui';
|
|
14
|
-
import { compareItemsArrays, isArrayContainsContent } from '../../utils';
|
|
14
|
+
import { compareItemsArrays, isArrayContainsContent } from '../../editor-commands/utils';
|
|
15
15
|
import { FormattingTextDropdownMenu } from './dropdown-menu';
|
|
16
16
|
import { useClearIcon } from './hooks/clear-formatting-icon';
|
|
17
17
|
import { useFormattingIcons, useHasFormattingActived } from './hooks/formatting-icons';
|
|
@@ -155,7 +155,8 @@ const ToolbarFormatting = ({
|
|
|
155
155
|
hasFormattingActive: hasFormattingActive,
|
|
156
156
|
hasMoreButton: true,
|
|
157
157
|
items: items,
|
|
158
|
-
intl: intl
|
|
158
|
+
intl: intl,
|
|
159
|
+
toolbarType: toolbarType
|
|
159
160
|
}))), !(api !== null && api !== void 0 && api.primaryToolbar) && /* eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage */
|
|
160
161
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
|
|
161
162
|
jsx("span", {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
2
|
-
import { ToolbarType } from './
|
|
2
|
+
import { ToolbarType } from './types';
|
|
3
3
|
export const toolbarTypeToInputMethod = {
|
|
4
4
|
[ToolbarType.PRIMARY]: INPUT_METHOD.TOOLBAR,
|
|
5
5
|
[ToolbarType.FLOATING]: INPUT_METHOD.FLOATING_TB
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE } from '@atlaskit/editor-common/analytics';
|
|
2
2
|
import { liftTarget } from '@atlaskit/editor-prosemirror/transform';
|
|
3
3
|
import { CellSelection } from '@atlaskit/editor-tables/cell-selection';
|
|
4
|
-
import { cellSelectionNodesBetween } from '
|
|
4
|
+
import { cellSelectionNodesBetween } from './utils/cell-selection';
|
|
5
5
|
export var FORMATTING_NODE_TYPES = ['heading', 'blockquote'];
|
|
6
6
|
export var FORMATTING_MARK_TYPES = ['em', 'code', 'strike', 'strong', 'underline', 'textColor', 'subsup', 'backgroundColor'];
|
|
7
7
|
var formatTypes = {
|
|
@@ -2,7 +2,7 @@ import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE, INPUT_METHOD } f
|
|
|
2
2
|
import { withAnalytics } from '@atlaskit/editor-common/editor-analytics';
|
|
3
3
|
import { applyMarkOnRange } from '@atlaskit/editor-common/mark';
|
|
4
4
|
import { Selection } from '@atlaskit/editor-prosemirror/state';
|
|
5
|
-
import { hasCode, markActive } from '
|
|
5
|
+
import { hasCode, markActive } from './utils';
|
|
6
6
|
export var moveRight = function moveRight() {
|
|
7
7
|
return function (state, dispatch) {
|
|
8
8
|
var code = state.schema.marks.code;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { anyMarkActive } from '@atlaskit/editor-common/mark';
|
|
2
|
-
import { FORMATTING_MARK_TYPES, FORMATTING_NODE_TYPES } from './
|
|
2
|
+
import { FORMATTING_MARK_TYPES, FORMATTING_NODE_TYPES } from './clear-formatting';
|
|
3
3
|
export var hasCode = function hasCode(state, pos) {
|
|
4
4
|
var code = state.schema.marks.code;
|
|
5
5
|
var node = pos >= 0 && state.doc.nodeAt(pos);
|
package/dist/esm/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { textFormattingPlugin } from './
|
|
1
|
+
export { textFormattingPlugin } from './textFormattingPlugin';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
2
2
|
import { bindKeymapWithCommand, clearFormatting } from '@atlaskit/editor-common/keymaps';
|
|
3
3
|
import { keymap } from '@atlaskit/editor-prosemirror/keymap';
|
|
4
|
-
import { clearFormattingWithAnalytics } from '../commands/clear-formatting';
|
|
4
|
+
import { clearFormattingWithAnalytics } from '../editor-commands/clear-formatting';
|
|
5
5
|
export function keymapPlugin(editorAnalyticsAPI) {
|
|
6
6
|
var list = {};
|
|
7
7
|
bindKeymapWithCommand(clearFormatting.common, clearFormattingWithAnalytics(INPUT_METHOD.SHORTCUT, editorAnalyticsAPI), list);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
2
2
|
import { PluginKey } from '@atlaskit/editor-prosemirror/state';
|
|
3
|
-
import { checkFormattingIsPresent } from '../utils';
|
|
3
|
+
import { checkFormattingIsPresent } from '../editor-commands/utils';
|
|
4
4
|
export var pluginKey = new PluginKey('clearFormattingPlugin');
|
|
5
5
|
export var plugin = function plugin(dispatch) {
|
|
6
6
|
return new SafePlugin({
|
|
@@ -2,7 +2,7 @@ import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
|
2
2
|
import { bindKeymapWithEditorCommand, isCapsLockOnAndModifyKeyboardEvent, toggleBold, toggleCode, toggleItalic, toggleStrikethrough, toggleSubscript, toggleSuperscript, toggleUnderline } from '@atlaskit/editor-common/keymaps';
|
|
3
3
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
4
4
|
import { keydownHandler } from '@atlaskit/editor-prosemirror/keymap';
|
|
5
|
-
import { toggleCodeWithAnalytics, toggleEmWithAnalytics, toggleStrikeWithAnalytics, toggleStrongWithAnalytics, toggleSubscriptWithAnalytics, toggleSuperscriptWithAnalytics, toggleUnderlineWithAnalytics } from '
|
|
5
|
+
import { toggleCodeWithAnalytics, toggleEmWithAnalytics, toggleStrikeWithAnalytics, toggleStrongWithAnalytics, toggleSubscriptWithAnalytics, toggleSuperscriptWithAnalytics, toggleUnderlineWithAnalytics } from './commands';
|
|
6
6
|
export default function keymapPlugin(schema, editorAnalyticsAPI) {
|
|
7
7
|
var list = {};
|
|
8
8
|
if (schema.marks.strong) {
|
|
@@ -7,8 +7,8 @@ import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
|
7
7
|
import { shallowEqual } from '@atlaskit/editor-common/utils';
|
|
8
8
|
import { toggleMark } from '@atlaskit/editor-prosemirror/commands';
|
|
9
9
|
import { NodeSelection } from '@atlaskit/editor-prosemirror/state';
|
|
10
|
-
import { createInlineCodeFromTextInputWithAnalytics } from '../commands/text-formatting';
|
|
11
|
-
import * as commands from '../commands/text-formatting';
|
|
10
|
+
import { createInlineCodeFromTextInputWithAnalytics } from '../editor-commands/text-formatting';
|
|
11
|
+
import * as commands from '../editor-commands/text-formatting';
|
|
12
12
|
import { pluginKey } from './plugin-key';
|
|
13
13
|
export { pluginKey };
|
|
14
14
|
var isSelectionInlineCursor = function isSelectionInlineCursor(selection) {
|
|
@@ -4,9 +4,9 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
4
4
|
import React from 'react';
|
|
5
5
|
import { code, em, strike, strong, subsup, underline } from '@atlaskit/adf-schema';
|
|
6
6
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
7
|
-
import { toggleCodeWithAnalytics, toggleEmWithAnalytics, toggleStrikeWithAnalytics, toggleStrongWithAnalytics, toggleSubscriptWithAnalytics, toggleSuperscriptWithAnalytics, toggleUnderlineWithAnalytics } from './commands';
|
|
8
7
|
import { plugin as clearFormattingPlugin, pluginKey as clearFormattingPluginKey } from './pm-plugins/clear-formatting';
|
|
9
8
|
import clearFormattingKeymapPlugin from './pm-plugins/clear-formatting-keymap';
|
|
9
|
+
import { toggleCodeWithAnalytics, toggleEmWithAnalytics, toggleStrikeWithAnalytics, toggleStrongWithAnalytics, toggleSubscriptWithAnalytics, toggleSuperscriptWithAnalytics, toggleUnderlineWithAnalytics } from './pm-plugins/commands';
|
|
10
10
|
import textFormattingCursorPlugin from './pm-plugins/cursor';
|
|
11
11
|
import textFormattingInputRulePlugin from './pm-plugins/input-rule';
|
|
12
12
|
import keymapPlugin from './pm-plugins/keymap';
|
|
@@ -14,6 +14,7 @@ import { plugin as pmPlugin, pluginKey as textFormattingPluginKey } from './pm-p
|
|
|
14
14
|
import textFormattingSmartInputRulePlugin from './pm-plugins/smart-input-rule';
|
|
15
15
|
import { FloatingToolbarTextFormalWithIntl as FloatingToolbarComponent } from './ui/FloatingToolbarComponent';
|
|
16
16
|
import { PrimaryToolbarComponent } from './ui/PrimaryToolbarComponent';
|
|
17
|
+
|
|
17
18
|
/**
|
|
18
19
|
* Text formatting plugin to be added to an `EditorPresetBuilder` and used with `ComposableEditor`
|
|
19
20
|
* from `@atlaskit/editor-core`.
|
|
@@ -145,7 +146,8 @@ export var textFormattingPlugin = function textFormattingPlugin(_ref) {
|
|
|
145
146
|
};
|
|
146
147
|
return {
|
|
147
148
|
isToolbarAbove: true,
|
|
148
|
-
items: [toolbarCustom]
|
|
149
|
+
items: [toolbarCustom],
|
|
150
|
+
rank: 7
|
|
149
151
|
};
|
|
150
152
|
} else {
|
|
151
153
|
return undefined;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -57,7 +57,8 @@ var FloatingToolbarTextFormat = function FloatingToolbarTextFormat(_ref) {
|
|
|
57
57
|
moreButtonLabel: FloatingToolbarSettings.moreButtonLabel,
|
|
58
58
|
hasFormattingActive: FloatingToolbarSettings.hasMoreButton,
|
|
59
59
|
hasMoreButton: FloatingToolbarSettings.hasMoreButton,
|
|
60
|
-
intl: intl
|
|
60
|
+
intl: intl,
|
|
61
|
+
toolbarType: FloatingToolbarSettings.toolbarType
|
|
61
62
|
});
|
|
62
63
|
};
|
|
63
64
|
export var FloatingToolbarTextFormalWithIntl = injectIntl(FloatingToolbarTextFormat);
|
|
@@ -11,6 +11,7 @@ import { ToolbarButton } from '@atlaskit/editor-common/ui-menu';
|
|
|
11
11
|
import BoldIcon from '@atlaskit/icon/core/migration/text-bold--editor-bold';
|
|
12
12
|
import ChevronDownIcon from '@atlaskit/icon/utility/migration/chevron-down';
|
|
13
13
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
14
|
+
import { ToolbarType } from './types';
|
|
14
15
|
export var BoldToolbarButton = function BoldToolbarButton(_ref) {
|
|
15
16
|
var label = _ref.label,
|
|
16
17
|
isReducedSpacing = _ref.isReducedSpacing,
|
|
@@ -18,10 +19,12 @@ export var BoldToolbarButton = function BoldToolbarButton(_ref) {
|
|
|
18
19
|
isSelected = _ref.isSelected,
|
|
19
20
|
ariaExpanded = _ref['aria-expanded'],
|
|
20
21
|
onClick = _ref.onClick,
|
|
21
|
-
onKeyDown = _ref.onKeyDown
|
|
22
|
+
onKeyDown = _ref.onKeyDown,
|
|
23
|
+
toolbarType = _ref.toolbarType;
|
|
24
|
+
var reducedSpacing = toolbarType === ToolbarType.FLOATING ? 'compact' : 'none';
|
|
22
25
|
return jsx(ToolbarButton, {
|
|
23
26
|
testId: 'ak-editor-selection-toolbar-format-text-button',
|
|
24
|
-
spacing: isReducedSpacing ?
|
|
27
|
+
spacing: isReducedSpacing ? reducedSpacing : 'default',
|
|
25
28
|
disabled: isDisabled,
|
|
26
29
|
selected: isSelected,
|
|
27
30
|
"aria-label": label,
|
|
@@ -5,12 +5,14 @@ import { IconTypes } from './types';
|
|
|
5
5
|
export var DefaultButtonsToolbar = [IconTypes.strong, IconTypes.em];
|
|
6
6
|
export var DefaultButtonsMenu = [IconTypes.underline, IconTypes.strike, IconTypes.code, IconTypes.subscript, IconTypes.superscript];
|
|
7
7
|
|
|
8
|
+
// eslint-disable-next-line @repo/internal/deprecations/deprecation-ticket-required -- Ignored via go/ED-25883
|
|
8
9
|
/** @deprecated
|
|
9
10
|
* To be removed as part of ED-25129 in favour of ResponsiveCustomButtonToolbarNext along with references
|
|
10
11
|
* to platform_editor_toolbar_responsive_fixes feature gate
|
|
11
12
|
*/
|
|
12
13
|
export var ResponsiveCustomButtonToolbar = (_ResponsiveCustomButt = {}, _defineProperty(_ResponsiveCustomButt, ToolbarSize.XXL, DefaultButtonsToolbar), _defineProperty(_ResponsiveCustomButt, ToolbarSize.XL, DefaultButtonsToolbar), _defineProperty(_ResponsiveCustomButt, ToolbarSize.L, DefaultButtonsToolbar), _defineProperty(_ResponsiveCustomButt, ToolbarSize.M, []), _defineProperty(_ResponsiveCustomButt, ToolbarSize.S, []), _defineProperty(_ResponsiveCustomButt, ToolbarSize.XXXS, []), _ResponsiveCustomButt);
|
|
13
14
|
|
|
15
|
+
// eslint-disable-next-line @repo/internal/deprecations/deprecation-ticket-required -- Ignored via go/ED-25883
|
|
14
16
|
/** @deprecated
|
|
15
17
|
* To be removed as part of ED-25129 in favour of ResponsiveCustomButtonToolbarNext along with references
|
|
16
18
|
* to platform_editor_toolbar_responsive_fixes feature gate
|
|
@@ -16,7 +16,8 @@ export var FormattingTextDropdownMenu = /*#__PURE__*/React.memo(function (_ref)
|
|
|
16
16
|
popupsMountPoint = _ref.popupsMountPoint,
|
|
17
17
|
popupsScrollableElement = _ref.popupsScrollableElement,
|
|
18
18
|
hasMoreButton = _ref.hasMoreButton,
|
|
19
|
-
intl = _ref.intl
|
|
19
|
+
intl = _ref.intl,
|
|
20
|
+
toolbarType = _ref.toolbarType;
|
|
20
21
|
var _useMenuState = useMenuState(),
|
|
21
22
|
_useMenuState2 = _slicedToArray(_useMenuState, 3),
|
|
22
23
|
isMenuOpen = _useMenuState2[0],
|
|
@@ -94,6 +95,7 @@ export var FormattingTextDropdownMenu = /*#__PURE__*/React.memo(function (_ref)
|
|
|
94
95
|
toggleMenu();
|
|
95
96
|
setIsOpenedByKeyboard(true);
|
|
96
97
|
}
|
|
97
|
-
}
|
|
98
|
+
},
|
|
99
|
+
toolbarType: toolbarType
|
|
98
100
|
}));
|
|
99
101
|
});
|
|
@@ -9,8 +9,8 @@ import { jsx } from '@emotion/react';
|
|
|
9
9
|
import { clearFormatting as clearFormattingKeymap, tooltip } from '@atlaskit/editor-common/keymaps';
|
|
10
10
|
import { toolbarMessages } from '@atlaskit/editor-common/messages';
|
|
11
11
|
import { shortcutStyle } from '@atlaskit/editor-shared-styles/shortcut';
|
|
12
|
-
import { clearFormattingWithAnalytics } from '../../../commands/clear-formatting';
|
|
13
|
-
import { getInputMethod } from '
|
|
12
|
+
import { clearFormattingWithAnalytics } from '../../../editor-commands/clear-formatting';
|
|
13
|
+
import { getInputMethod } from '../input-method-utils';
|
|
14
14
|
export var useClearIcon = function useClearIcon(_ref) {
|
|
15
15
|
var intl = _ref.intl,
|
|
16
16
|
textFormattingState = _ref.textFormattingState,
|
|
@@ -15,8 +15,8 @@ import { editorCommandToPMCommand } from '@atlaskit/editor-common/preset';
|
|
|
15
15
|
import { shortcutStyle } from '@atlaskit/editor-shared-styles/shortcut';
|
|
16
16
|
import BoldIcon from '@atlaskit/icon/core/migration/text-bold--editor-bold';
|
|
17
17
|
import ItalicIcon from '@atlaskit/icon/core/migration/text-italic--editor-italic';
|
|
18
|
-
import { toggleCodeWithAnalytics, toggleEmWithAnalytics, toggleStrikeWithAnalytics, toggleStrongWithAnalytics, toggleSubscriptWithAnalytics, toggleSuperscriptWithAnalytics, toggleUnderlineWithAnalytics } from '../../../commands';
|
|
19
|
-
import { getInputMethod } from '
|
|
18
|
+
import { toggleCodeWithAnalytics, toggleEmWithAnalytics, toggleStrikeWithAnalytics, toggleStrongWithAnalytics, toggleSubscriptWithAnalytics, toggleSuperscriptWithAnalytics, toggleUnderlineWithAnalytics } from '../../../pm-plugins/commands';
|
|
19
|
+
import { getInputMethod } from '../input-method-utils';
|
|
20
20
|
import { IconTypes } from '../types';
|
|
21
21
|
var withInputMethod = function withInputMethod(toolbarType, func) {
|
|
22
22
|
return editorCommandToPMCommand(func(getInputMethod(toolbarType)));
|
|
@@ -13,7 +13,7 @@ import { usePreviousState } from '@atlaskit/editor-common/hooks';
|
|
|
13
13
|
import { toolbarMessages } from '@atlaskit/editor-common/messages';
|
|
14
14
|
import { buttonGroupStyle, separatorStyles, wrapperStyle } from '@atlaskit/editor-common/styles';
|
|
15
15
|
import { Announcer } from '@atlaskit/editor-common/ui';
|
|
16
|
-
import { compareItemsArrays, isArrayContainsContent } from '../../utils';
|
|
16
|
+
import { compareItemsArrays, isArrayContainsContent } from '../../editor-commands/utils';
|
|
17
17
|
import { FormattingTextDropdownMenu } from './dropdown-menu';
|
|
18
18
|
import { useClearIcon } from './hooks/clear-formatting-icon';
|
|
19
19
|
import { useFormattingIcons, useHasFormattingActived } from './hooks/formatting-icons';
|
|
@@ -160,7 +160,8 @@ var ToolbarFormatting = function ToolbarFormatting(_ref) {
|
|
|
160
160
|
hasFormattingActive: hasFormattingActive,
|
|
161
161
|
hasMoreButton: true,
|
|
162
162
|
items: items,
|
|
163
|
-
intl: intl
|
|
163
|
+
intl: intl,
|
|
164
|
+
toolbarType: toolbarType
|
|
164
165
|
}))), !(api !== null && api !== void 0 && api.primaryToolbar) && /* eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage */
|
|
165
166
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
|
|
166
167
|
jsx("span", {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
2
|
var _toolbarTypeToInputMe;
|
|
3
3
|
import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
4
|
-
import { ToolbarType } from './
|
|
4
|
+
import { ToolbarType } from './types';
|
|
5
5
|
export var toolbarTypeToInputMethod = (_toolbarTypeToInputMe = {}, _defineProperty(_toolbarTypeToInputMe, ToolbarType.PRIMARY, INPUT_METHOD.TOOLBAR), _defineProperty(_toolbarTypeToInputMe, ToolbarType.FLOATING, INPUT_METHOD.FLOATING_TB), _toolbarTypeToInputMe);
|
|
6
6
|
export var getInputMethod = function getInputMethod(toolbarType) {
|
|
7
7
|
return toolbarTypeToInputMethod[toolbarType];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Mark as PMMark } from '@atlaskit/editor-prosemirror/model';
|
|
2
2
|
import type { EditorState } from '@atlaskit/editor-prosemirror/state';
|
|
3
|
-
import type { MenuIconItem } from '
|
|
3
|
+
import type { MenuIconItem } from '../ui/Toolbar/types';
|
|
4
4
|
export declare const hasCode: (state: EditorState, pos: number) => boolean;
|
|
5
5
|
/**
|
|
6
6
|
* Determine if a mark (with specific attribute values) exists anywhere in the selection.
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { textFormattingPlugin } from './
|
|
2
|
-
export type { TextFormattingPlugin } from './
|
|
3
|
-
export type { ToggleMarkEditorCommand } from './commands';
|
|
1
|
+
export { textFormattingPlugin } from './textFormattingPlugin';
|
|
2
|
+
export type { TextFormattingPlugin } from './textFormattingPluginType';
|
|
3
|
+
export type { ToggleMarkEditorCommand } from './pm-plugins/commands';
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { TextFormattingPlugin } from './textFormattingPluginType';
|
|
2
|
+
/**
|
|
3
|
+
* Text formatting plugin to be added to an `EditorPresetBuilder` and used with `ComposableEditor`
|
|
4
|
+
* from `@atlaskit/editor-core`.
|
|
5
|
+
*/
|
|
6
|
+
export declare const textFormattingPlugin: TextFormattingPlugin;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { NextEditorPlugin, OptionalPlugin, TextFormattingOptions, TextFormattingState } from '@atlaskit/editor-common/types';
|
|
2
2
|
import type { AnalyticsPlugin } from '@atlaskit/editor-plugin-analytics';
|
|
3
3
|
import type { PrimaryToolbarPlugin } from '@atlaskit/editor-plugin-primary-toolbar';
|
|
4
|
-
import type { ToggleMarkEditorCommand } from './commands';
|
|
4
|
+
import type { ToggleMarkEditorCommand } from './pm-plugins/commands';
|
|
5
5
|
export type TextFormattingPlugin = NextEditorPlugin<'textFormatting', {
|
|
6
6
|
pluginConfiguration: TextFormattingOptions | undefined;
|
|
7
7
|
dependencies: [OptionalPlugin<AnalyticsPlugin>, OptionalPlugin<PrimaryToolbarPlugin>];
|
|
@@ -16,8 +16,3 @@ export type TextFormattingPlugin = NextEditorPlugin<'textFormatting', {
|
|
|
16
16
|
};
|
|
17
17
|
sharedState: TextFormattingState | undefined;
|
|
18
18
|
}>;
|
|
19
|
-
/**
|
|
20
|
-
* Text formatting plugin to be added to an `EditorPresetBuilder` and used with `ComposableEditor`
|
|
21
|
-
* from `@atlaskit/editor-core`.
|
|
22
|
-
*/
|
|
23
|
-
export declare const textFormattingPlugin: TextFormattingPlugin;
|
|
@@ -3,7 +3,7 @@ import type { WrappedComponentProps } from 'react-intl-next';
|
|
|
3
3
|
import { type EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
4
4
|
import { type ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
5
5
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
6
|
-
import type { TextFormattingPlugin } from '../
|
|
6
|
+
import type { TextFormattingPlugin } from '../textFormattingPluginType';
|
|
7
7
|
export declare const FloatingToolbarTextFormalWithIntl: import("react").FC<import("react-intl-next").WithIntlProps<{
|
|
8
8
|
editorView: EditorView;
|
|
9
9
|
api: ExtractInjectionAPI<TextFormattingPlugin> | undefined;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import type { ExtractInjectionAPI, ToolbarSize } from '@atlaskit/editor-common/types';
|
|
3
3
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
4
|
-
import type { TextFormattingPlugin } from '../
|
|
4
|
+
import type { TextFormattingPlugin } from '../textFormattingPluginType';
|
|
5
5
|
interface PrimaryToolbarComponentProps {
|
|
6
6
|
api: ExtractInjectionAPI<TextFormattingPlugin> | undefined;
|
|
7
7
|
editorView: EditorView;
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import React from 'react';
|
|
6
6
|
import { jsx } from '@emotion/react';
|
|
7
|
+
import { ToolbarType } from './types';
|
|
7
8
|
type BoldButtonProps = {
|
|
8
9
|
label: string;
|
|
9
10
|
isReducedSpacing: boolean;
|
|
@@ -12,6 +13,7 @@ type BoldButtonProps = {
|
|
|
12
13
|
'aria-expanded': React.AriaAttributes['aria-expanded'];
|
|
13
14
|
onClick?: (event: React.MouseEvent<HTMLElement>) => void;
|
|
14
15
|
onKeyDown?: (event: React.KeyboardEvent) => void;
|
|
16
|
+
toolbarType: ToolbarType;
|
|
15
17
|
};
|
|
16
|
-
export declare const BoldToolbarButton: ({ label, isReducedSpacing, isDisabled, isSelected, "aria-expanded": ariaExpanded, onClick, onKeyDown, }: BoldButtonProps) => jsx.JSX.Element;
|
|
18
|
+
export declare const BoldToolbarButton: ({ label, isReducedSpacing, isDisabled, isSelected, "aria-expanded": ariaExpanded, onClick, onKeyDown, toolbarType, }: BoldButtonProps) => jsx.JSX.Element;
|
|
17
19
|
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { WrappedComponentProps } from 'react-intl-next';
|
|
3
3
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
4
|
-
import type
|
|
4
|
+
import { type MenuIconItem, ToolbarType } from './types';
|
|
5
5
|
type DropdownMenuProps = {
|
|
6
6
|
editorView: EditorView;
|
|
7
7
|
isReducedSpacing: boolean;
|
|
@@ -12,6 +12,7 @@ type DropdownMenuProps = {
|
|
|
12
12
|
popupsMountPoint?: HTMLElement;
|
|
13
13
|
popupsScrollableElement?: HTMLElement;
|
|
14
14
|
hasMoreButton: boolean;
|
|
15
|
+
toolbarType: ToolbarType;
|
|
15
16
|
} & WrappedComponentProps;
|
|
16
|
-
export declare const FormattingTextDropdownMenu: React.MemoExoticComponent<({ editorView, moreButtonLabel, isReducedSpacing, items, hasFormattingActive, popupsBoundariesElement, popupsMountPoint, popupsScrollableElement, hasMoreButton, intl, }: DropdownMenuProps) => JSX.Element>;
|
|
17
|
+
export declare const FormattingTextDropdownMenu: React.MemoExoticComponent<({ editorView, moreButtonLabel, isReducedSpacing, items, hasFormattingActive, popupsBoundariesElement, popupsMountPoint, popupsScrollableElement, hasMoreButton, intl, toolbarType, }: DropdownMenuProps) => JSX.Element>;
|
|
17
18
|
export {};
|
|
@@ -3,7 +3,7 @@ import type { WrappedComponentProps } from 'react-intl-next';
|
|
|
3
3
|
import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
4
4
|
import type { ExtractInjectionAPI, TextFormattingState, ToolbarSize } from '@atlaskit/editor-common/types';
|
|
5
5
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
6
|
-
import type { TextFormattingPlugin } from '../../
|
|
6
|
+
import type { TextFormattingPlugin } from '../../textFormattingPluginType';
|
|
7
7
|
import type { ToolbarType } from './types';
|
|
8
8
|
export type ToolbarFormattingProps = {
|
|
9
9
|
editorView: EditorView;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { InputMethodToolbar } from '@atlaskit/editor-common/types';
|
|
2
|
-
import { ToolbarType } from './
|
|
2
|
+
import { ToolbarType } from './types';
|
|
3
3
|
type ToolbarTypeToInputMethodMap = Record<ToolbarType, InputMethodToolbar>;
|
|
4
4
|
export declare const toolbarTypeToInputMethod: ToolbarTypeToInputMethodMap;
|
|
5
5
|
export declare const getInputMethod: (toolbarType: ToolbarType) => InputMethodToolbar;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Mark as PMMark } from '@atlaskit/editor-prosemirror/model';
|
|
2
2
|
import type { EditorState } from '@atlaskit/editor-prosemirror/state';
|
|
3
|
-
import type { MenuIconItem } from '
|
|
3
|
+
import type { MenuIconItem } from '../ui/Toolbar/types';
|
|
4
4
|
export declare const hasCode: (state: EditorState, pos: number) => boolean;
|
|
5
5
|
/**
|
|
6
6
|
* Determine if a mark (with specific attribute values) exists anywhere in the selection.
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { textFormattingPlugin } from './
|
|
2
|
-
export type { TextFormattingPlugin } from './
|
|
3
|
-
export type { ToggleMarkEditorCommand } from './commands';
|
|
1
|
+
export { textFormattingPlugin } from './textFormattingPlugin';
|
|
2
|
+
export type { TextFormattingPlugin } from './textFormattingPluginType';
|
|
3
|
+
export type { ToggleMarkEditorCommand } from './pm-plugins/commands';
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { TextFormattingPlugin } from './textFormattingPluginType';
|
|
2
|
+
/**
|
|
3
|
+
* Text formatting plugin to be added to an `EditorPresetBuilder` and used with `ComposableEditor`
|
|
4
|
+
* from `@atlaskit/editor-core`.
|
|
5
|
+
*/
|
|
6
|
+
export declare const textFormattingPlugin: TextFormattingPlugin;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { NextEditorPlugin, OptionalPlugin, TextFormattingOptions, TextFormattingState } from '@atlaskit/editor-common/types';
|
|
2
2
|
import type { AnalyticsPlugin } from '@atlaskit/editor-plugin-analytics';
|
|
3
3
|
import type { PrimaryToolbarPlugin } from '@atlaskit/editor-plugin-primary-toolbar';
|
|
4
|
-
import type { ToggleMarkEditorCommand } from './commands';
|
|
4
|
+
import type { ToggleMarkEditorCommand } from './pm-plugins/commands';
|
|
5
5
|
export type TextFormattingPlugin = NextEditorPlugin<'textFormatting', {
|
|
6
6
|
pluginConfiguration: TextFormattingOptions | undefined;
|
|
7
7
|
dependencies: [
|
|
@@ -19,8 +19,3 @@ export type TextFormattingPlugin = NextEditorPlugin<'textFormatting', {
|
|
|
19
19
|
};
|
|
20
20
|
sharedState: TextFormattingState | undefined;
|
|
21
21
|
}>;
|
|
22
|
-
/**
|
|
23
|
-
* Text formatting plugin to be added to an `EditorPresetBuilder` and used with `ComposableEditor`
|
|
24
|
-
* from `@atlaskit/editor-core`.
|
|
25
|
-
*/
|
|
26
|
-
export declare const textFormattingPlugin: TextFormattingPlugin;
|
|
@@ -3,7 +3,7 @@ import type { WrappedComponentProps } from 'react-intl-next';
|
|
|
3
3
|
import { type EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
4
4
|
import { type ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
5
5
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
6
|
-
import type { TextFormattingPlugin } from '../
|
|
6
|
+
import type { TextFormattingPlugin } from '../textFormattingPluginType';
|
|
7
7
|
export declare const FloatingToolbarTextFormalWithIntl: import("react").FC<import("react-intl-next").WithIntlProps<{
|
|
8
8
|
editorView: EditorView;
|
|
9
9
|
api: ExtractInjectionAPI<TextFormattingPlugin> | undefined;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import type { ExtractInjectionAPI, ToolbarSize } from '@atlaskit/editor-common/types';
|
|
3
3
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
4
|
-
import type { TextFormattingPlugin } from '../
|
|
4
|
+
import type { TextFormattingPlugin } from '../textFormattingPluginType';
|
|
5
5
|
interface PrimaryToolbarComponentProps {
|
|
6
6
|
api: ExtractInjectionAPI<TextFormattingPlugin> | undefined;
|
|
7
7
|
editorView: EditorView;
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import React from 'react';
|
|
6
6
|
import { jsx } from '@emotion/react';
|
|
7
|
+
import { ToolbarType } from './types';
|
|
7
8
|
type BoldButtonProps = {
|
|
8
9
|
label: string;
|
|
9
10
|
isReducedSpacing: boolean;
|
|
@@ -12,6 +13,7 @@ type BoldButtonProps = {
|
|
|
12
13
|
'aria-expanded': React.AriaAttributes['aria-expanded'];
|
|
13
14
|
onClick?: (event: React.MouseEvent<HTMLElement>) => void;
|
|
14
15
|
onKeyDown?: (event: React.KeyboardEvent) => void;
|
|
16
|
+
toolbarType: ToolbarType;
|
|
15
17
|
};
|
|
16
|
-
export declare const BoldToolbarButton: ({ label, isReducedSpacing, isDisabled, isSelected, "aria-expanded": ariaExpanded, onClick, onKeyDown, }: BoldButtonProps) => jsx.JSX.Element;
|
|
18
|
+
export declare const BoldToolbarButton: ({ label, isReducedSpacing, isDisabled, isSelected, "aria-expanded": ariaExpanded, onClick, onKeyDown, toolbarType, }: BoldButtonProps) => jsx.JSX.Element;
|
|
17
19
|
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { WrappedComponentProps } from 'react-intl-next';
|
|
3
3
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
4
|
-
import type
|
|
4
|
+
import { type MenuIconItem, ToolbarType } from './types';
|
|
5
5
|
type DropdownMenuProps = {
|
|
6
6
|
editorView: EditorView;
|
|
7
7
|
isReducedSpacing: boolean;
|
|
@@ -12,6 +12,7 @@ type DropdownMenuProps = {
|
|
|
12
12
|
popupsMountPoint?: HTMLElement;
|
|
13
13
|
popupsScrollableElement?: HTMLElement;
|
|
14
14
|
hasMoreButton: boolean;
|
|
15
|
+
toolbarType: ToolbarType;
|
|
15
16
|
} & WrappedComponentProps;
|
|
16
|
-
export declare const FormattingTextDropdownMenu: React.MemoExoticComponent<({ editorView, moreButtonLabel, isReducedSpacing, items, hasFormattingActive, popupsBoundariesElement, popupsMountPoint, popupsScrollableElement, hasMoreButton, intl, }: DropdownMenuProps) => JSX.Element>;
|
|
17
|
+
export declare const FormattingTextDropdownMenu: React.MemoExoticComponent<({ editorView, moreButtonLabel, isReducedSpacing, items, hasFormattingActive, popupsBoundariesElement, popupsMountPoint, popupsScrollableElement, hasMoreButton, intl, toolbarType, }: DropdownMenuProps) => JSX.Element>;
|
|
17
18
|
export {};
|
|
@@ -3,7 +3,7 @@ import type { WrappedComponentProps } from 'react-intl-next';
|
|
|
3
3
|
import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
4
4
|
import type { ExtractInjectionAPI, TextFormattingState, ToolbarSize } from '@atlaskit/editor-common/types';
|
|
5
5
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
6
|
-
import type { TextFormattingPlugin } from '../../
|
|
6
|
+
import type { TextFormattingPlugin } from '../../textFormattingPluginType';
|
|
7
7
|
import type { ToolbarType } from './types';
|
|
8
8
|
export type ToolbarFormattingProps = {
|
|
9
9
|
editorView: EditorView;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { InputMethodToolbar } from '@atlaskit/editor-common/types';
|
|
2
|
-
import { ToolbarType } from './
|
|
2
|
+
import { ToolbarType } from './types';
|
|
3
3
|
type ToolbarTypeToInputMethodMap = Record<ToolbarType, InputMethodToolbar>;
|
|
4
4
|
export declare const toolbarTypeToInputMethod: ToolbarTypeToInputMethodMap;
|
|
5
5
|
export declare const getInputMethod: (toolbarType: ToolbarType) => InputMethodToolbar;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-text-formatting",
|
|
3
|
-
"version": "1.16.
|
|
3
|
+
"version": "1.16.4",
|
|
4
4
|
"description": "Text-formatting plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -32,16 +32,16 @@
|
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"@atlaskit/adf-schema": "^46.1.0",
|
|
35
|
-
"@atlaskit/editor-common": "^96.
|
|
35
|
+
"@atlaskit/editor-common": "^96.3.0",
|
|
36
36
|
"@atlaskit/editor-plugin-analytics": "^1.10.0",
|
|
37
37
|
"@atlaskit/editor-plugin-primary-toolbar": "^2.0.0",
|
|
38
38
|
"@atlaskit/editor-prosemirror": "6.2.1",
|
|
39
39
|
"@atlaskit/editor-shared-styles": "^3.2.0",
|
|
40
40
|
"@atlaskit/editor-tables": "^2.8.0",
|
|
41
|
-
"@atlaskit/icon": "^23.
|
|
41
|
+
"@atlaskit/icon": "^23.1.0",
|
|
42
42
|
"@atlaskit/platform-feature-flags": "^0.3.0",
|
|
43
43
|
"@atlaskit/prosemirror-input-rules": "^3.2.0",
|
|
44
|
-
"@atlaskit/tmp-editor-statsig": "^2.
|
|
44
|
+
"@atlaskit/tmp-editor-statsig": "^2.23.0",
|
|
45
45
|
"@atlaskit/tokens": "^2.4.0",
|
|
46
46
|
"@babel/runtime": "^7.0.0",
|
|
47
47
|
"@emotion/react": "^11.7.1",
|
|
@@ -59,6 +59,9 @@
|
|
|
59
59
|
},
|
|
60
60
|
"techstack": {
|
|
61
61
|
"@atlassian/frontend": {
|
|
62
|
+
"code-structure": [
|
|
63
|
+
"editor-plugin"
|
|
64
|
+
],
|
|
62
65
|
"import-structure": [
|
|
63
66
|
"atlassian-conventions"
|
|
64
67
|
],
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|