@atlaskit/editor-plugin-text-formatting 1.16.3 → 1.16.5
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 +14 -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/input-rule.js +15 -17
- package/dist/cjs/pm-plugins/keymap.js +1 -1
- package/dist/cjs/pm-plugins/main.js +1 -7
- package/dist/cjs/{plugin.js → textFormattingPlugin.js} +3 -2
- package/dist/cjs/textFormattingPluginType.js +5 -0
- package/dist/cjs/ui/Toolbar/constants.js +4 -5
- package/dist/cjs/ui/Toolbar/hooks/clear-formatting-icon.js +2 -2
- package/dist/cjs/ui/Toolbar/hooks/formatting-icons.js +7 -6
- package/dist/cjs/ui/Toolbar/index.js +1 -1
- package/dist/cjs/{input-method-utils.js → ui/Toolbar/input-method-utils.js} +2 -3
- package/dist/cjs/ui/Toolbar/more-button.js +2 -3
- 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 +4 -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 -3
- package/dist/es2019/{plugin.js → textFormattingPlugin.js} +4 -2
- package/dist/es2019/textFormattingPluginType.js +1 -0
- 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 +1 -1
- package/dist/es2019/{input-method-utils.js → ui/Toolbar/input-method-utils.js} +1 -1
- package/dist/es2019/ui/Toolbar/more-button.js +2 -3
- 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 +4 -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/input-rule.js +15 -17
- package/dist/esm/pm-plugins/keymap.js +1 -1
- package/dist/esm/pm-plugins/main.js +2 -3
- package/dist/esm/{plugin.js → textFormattingPlugin.js} +4 -2
- package/dist/esm/textFormattingPluginType.js +1 -0
- package/dist/esm/ui/Toolbar/constants.js +4 -5
- package/dist/esm/ui/Toolbar/hooks/clear-formatting-icon.js +2 -2
- package/dist/esm/ui/Toolbar/hooks/formatting-icons.js +3 -4
- package/dist/esm/ui/Toolbar/index.js +1 -1
- package/dist/esm/ui/Toolbar/input-method-utils.js +7 -0
- package/dist/esm/ui/Toolbar/more-button.js +2 -3
- package/dist/types/{utils.d.ts → editor-commands/utils.d.ts} +1 -1
- package/dist/types/index.d.ts +3 -3
- package/dist/types/pm-plugins/main.d.ts +0 -2
- 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/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/pm-plugins/main.d.ts +0 -2
- 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/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 +9 -6
- package/dist/esm/input-method-utils.js +0 -8
- /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,19 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-text-formatting
|
|
2
2
|
|
|
3
|
+
## 1.16.5
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies
|
|
8
|
+
|
|
9
|
+
## 1.16.4
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [#171551](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/171551)
|
|
14
|
+
[`702c918817e78`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/702c918817e78) -
|
|
15
|
+
ED-25817: refactors plugins to meet folder standards
|
|
16
|
+
|
|
3
17
|
## 1.16.3
|
|
4
18
|
|
|
5
19
|
### 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({
|
|
@@ -10,10 +10,10 @@ exports.strongRegex2 = exports.strongRegex1 = exports.strikeRegex = exports.ital
|
|
|
10
10
|
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
11
11
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
12
12
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
13
|
-
var _get2 = _interopRequireDefault(require("@babel/runtime/helpers/get"));
|
|
14
|
-
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
15
13
|
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
16
14
|
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
15
|
+
var _get2 = _interopRequireDefault(require("@babel/runtime/helpers/get"));
|
|
16
|
+
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
17
17
|
var _wrapNativeSuper2 = _interopRequireDefault(require("@babel/runtime/helpers/wrapNativeSuper"));
|
|
18
18
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
19
19
|
var _analytics = require("@atlaskit/editor-common/analytics");
|
|
@@ -21,9 +21,9 @@ var _mark = require("@atlaskit/editor-common/mark");
|
|
|
21
21
|
var _safePlugin = require("@atlaskit/editor-common/safe-plugin");
|
|
22
22
|
var _utils = require("@atlaskit/editor-common/utils");
|
|
23
23
|
var _prosemirrorInputRules = require("@atlaskit/prosemirror-input-rules");
|
|
24
|
-
|
|
25
|
-
function _createSuper(t) { var r = _isNativeReflectConstruct(); return function () { var e, o = (0, _getPrototypeOf2.default)(t); if (r) { var s = (0, _getPrototypeOf2.default)(this).constructor; e = Reflect.construct(o, arguments, s); } else e = o.apply(this, arguments); return (0, _possibleConstructorReturn2.default)(this, e); }; }
|
|
24
|
+
function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2.default)(o), (0, _possibleConstructorReturn2.default)(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2.default)(t).constructor) : o.apply(t, e)); }
|
|
26
25
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
26
|
+
function _superPropGet(t, o, e, r) { var p = (0, _get2.default)((0, _getPrototypeOf2.default)(1 & r ? t.prototype : t), o, e); return 2 & r && "function" == typeof p ? function (t) { return p.apply(e, t); } : p; }
|
|
27
27
|
var ValidAutoformatChars = /*#__PURE__*/function (ValidAutoformatChars) {
|
|
28
28
|
ValidAutoformatChars["STRONG"] = "__";
|
|
29
29
|
ValidAutoformatChars["STRIKE"] = "~~";
|
|
@@ -33,7 +33,7 @@ var ValidAutoformatChars = /*#__PURE__*/function (ValidAutoformatChars) {
|
|
|
33
33
|
ValidAutoformatChars["CODE"] = "`";
|
|
34
34
|
return ValidAutoformatChars;
|
|
35
35
|
}(ValidAutoformatChars || {});
|
|
36
|
-
var ValidCombinations = exports.ValidCombinations = (
|
|
36
|
+
var ValidCombinations = exports.ValidCombinations = (0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)({}, ValidAutoformatChars.STRIKE, [
|
|
37
37
|
// e.g: _~~lol~~_
|
|
38
38
|
ValidAutoformatChars.ITALIC,
|
|
39
39
|
// e.g: __~~lol~~__
|
|
@@ -41,25 +41,25 @@ ValidAutoformatChars.STRONG,
|
|
|
41
41
|
// e.g: **~~lol~~**
|
|
42
42
|
ValidAutoformatChars.STRONG_MARKDOWN,
|
|
43
43
|
// e.g: *~~lol~~*
|
|
44
|
-
ValidAutoformatChars.ITALIC_MARKDOWN]),
|
|
44
|
+
ValidAutoformatChars.ITALIC_MARKDOWN]), ValidAutoformatChars.STRONG, [
|
|
45
45
|
// e.g: ~~__lol__~~
|
|
46
46
|
ValidAutoformatChars.STRIKE,
|
|
47
47
|
// e.g: *__lol__*
|
|
48
|
-
ValidAutoformatChars.ITALIC_MARKDOWN]),
|
|
48
|
+
ValidAutoformatChars.ITALIC_MARKDOWN]), ValidAutoformatChars.STRONG_MARKDOWN, [
|
|
49
49
|
// e.g: _**lol**_
|
|
50
50
|
ValidAutoformatChars.ITALIC,
|
|
51
51
|
// e.g: ~~**lol**~~
|
|
52
|
-
ValidAutoformatChars.STRIKE]),
|
|
52
|
+
ValidAutoformatChars.STRIKE]), ValidAutoformatChars.ITALIC_MARKDOWN, [
|
|
53
53
|
// e.g: ~~*lol*~~
|
|
54
54
|
ValidAutoformatChars.STRIKE,
|
|
55
55
|
// e.g: __*lol*__
|
|
56
|
-
ValidAutoformatChars.STRONG]),
|
|
56
|
+
ValidAutoformatChars.STRONG]), ValidAutoformatChars.ITALIC, [
|
|
57
57
|
// e.g: ~~_lol_~~
|
|
58
58
|
ValidAutoformatChars.STRIKE,
|
|
59
59
|
// e.g: **_lol_**
|
|
60
|
-
ValidAutoformatChars.STRONG_MARKDOWN]),
|
|
60
|
+
ValidAutoformatChars.STRONG_MARKDOWN]), ValidAutoformatChars.CODE, [
|
|
61
61
|
// e.g: loko (`some code`
|
|
62
|
-
'( '])
|
|
62
|
+
'( ']);
|
|
63
63
|
function addMark(markType, schema, char) {
|
|
64
64
|
return function (state, match, start, end) {
|
|
65
65
|
var _schema$marks;
|
|
@@ -111,20 +111,19 @@ function addMark(markType, schema, char) {
|
|
|
111
111
|
};
|
|
112
112
|
}
|
|
113
113
|
var ReverseRegexExp = /*#__PURE__*/function (_RegExp) {
|
|
114
|
-
(0, _inherits2.default)(ReverseRegexExp, _RegExp);
|
|
115
|
-
var _super = _createSuper(ReverseRegexExp);
|
|
116
114
|
function ReverseRegexExp() {
|
|
117
115
|
(0, _classCallCheck2.default)(this, ReverseRegexExp);
|
|
118
|
-
return
|
|
116
|
+
return _callSuper(this, ReverseRegexExp, arguments);
|
|
119
117
|
}
|
|
120
|
-
(0,
|
|
118
|
+
(0, _inherits2.default)(ReverseRegexExp, _RegExp);
|
|
119
|
+
return (0, _createClass2.default)(ReverseRegexExp, [{
|
|
121
120
|
key: "exec",
|
|
122
121
|
value: function exec(str) {
|
|
123
122
|
if (!str) {
|
|
124
123
|
return null;
|
|
125
124
|
}
|
|
126
125
|
var reverseStr = (0, _toConsumableArray2.default)(str).reverse().join('');
|
|
127
|
-
var result = (
|
|
126
|
+
var result = _superPropGet(ReverseRegexExp, "exec", this, 3)([reverseStr]);
|
|
128
127
|
if (!result) {
|
|
129
128
|
return null;
|
|
130
129
|
}
|
|
@@ -142,7 +141,6 @@ var ReverseRegexExp = /*#__PURE__*/function (_RegExp) {
|
|
|
142
141
|
return result;
|
|
143
142
|
}
|
|
144
143
|
}]);
|
|
145
|
-
return ReverseRegexExp;
|
|
146
144
|
}( /*#__PURE__*/(0, _wrapNativeSuper2.default)(RegExp));
|
|
147
145
|
var buildRegex = function buildRegex(char) {
|
|
148
146
|
var escapedChar = char.replace(/(\W)/g, '\\$1');
|
|
@@ -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) {
|
|
@@ -5,19 +5,13 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
7
|
exports.plugin = void 0;
|
|
8
|
-
Object.defineProperty(exports, "pluginKey", {
|
|
9
|
-
enumerable: true,
|
|
10
|
-
get: function get() {
|
|
11
|
-
return _pluginKey.pluginKey;
|
|
12
|
-
}
|
|
13
|
-
});
|
|
14
8
|
var _keymaps = require("@atlaskit/editor-common/keymaps");
|
|
15
9
|
var _mark = require("@atlaskit/editor-common/mark");
|
|
16
10
|
var _safePlugin = require("@atlaskit/editor-common/safe-plugin");
|
|
17
11
|
var _utils = require("@atlaskit/editor-common/utils");
|
|
18
12
|
var _commands = require("@atlaskit/editor-prosemirror/commands");
|
|
19
13
|
var _state = require("@atlaskit/editor-prosemirror/state");
|
|
20
|
-
var _textFormatting = _interopRequireWildcard(require("../commands/text-formatting"));
|
|
14
|
+
var _textFormatting = _interopRequireWildcard(require("../editor-commands/text-formatting"));
|
|
21
15
|
var commands = _textFormatting;
|
|
22
16
|
var _pluginKey = require("./plugin-key");
|
|
23
17
|
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,13 +9,14 @@ 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"));
|
|
18
18
|
var _main = require("./pm-plugins/main");
|
|
19
|
+
var _pluginKey = require("./pm-plugins/plugin-key");
|
|
19
20
|
var _smartInputRule = _interopRequireDefault(require("./pm-plugins/smart-input-rule"));
|
|
20
21
|
var _FloatingToolbarComponent = require("./ui/FloatingToolbarComponent");
|
|
21
22
|
var _PrimaryToolbarComponent = require("./ui/PrimaryToolbarComponent");
|
|
@@ -126,7 +127,7 @@ var textFormattingPlugin = exports.textFormattingPlugin = function textFormattin
|
|
|
126
127
|
if (!editorState) {
|
|
127
128
|
return undefined;
|
|
128
129
|
}
|
|
129
|
-
return _objectSpread(_objectSpread({},
|
|
130
|
+
return _objectSpread(_objectSpread({}, _pluginKey.pluginKey.getState(editorState)), {}, {
|
|
130
131
|
formattingIsPresent: (_clearFormattingPlugi = _clearFormatting.pluginKey.getState(editorState)) === null || _clearFormattingPlugi === void 0 ? void 0 : _clearFormattingPlugi.formattingIsPresent
|
|
131
132
|
});
|
|
132
133
|
},
|
|
@@ -8,7 +8,6 @@ exports.ResponsiveCustomMenuNext = exports.ResponsiveCustomMenu = exports.Respon
|
|
|
8
8
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
9
9
|
var _types = require("@atlaskit/editor-common/types");
|
|
10
10
|
var _types2 = require("./types");
|
|
11
|
-
var _ResponsiveCustomButt, _ResponsiveCustomMenu, _ResponsiveCustomButt2, _ResponsiveCustomMenu2;
|
|
12
11
|
var DefaultButtonsToolbar = exports.DefaultButtonsToolbar = [_types2.IconTypes.strong, _types2.IconTypes.em];
|
|
13
12
|
var DefaultButtonsMenu = exports.DefaultButtonsMenu = [_types2.IconTypes.underline, _types2.IconTypes.strike, _types2.IconTypes.code, _types2.IconTypes.subscript, _types2.IconTypes.superscript];
|
|
14
13
|
|
|
@@ -17,13 +16,13 @@ var DefaultButtonsMenu = exports.DefaultButtonsMenu = [_types2.IconTypes.underli
|
|
|
17
16
|
* To be removed as part of ED-25129 in favour of ResponsiveCustomButtonToolbarNext along with references
|
|
18
17
|
* to platform_editor_toolbar_responsive_fixes feature gate
|
|
19
18
|
*/
|
|
20
|
-
var ResponsiveCustomButtonToolbar = exports.ResponsiveCustomButtonToolbar = (
|
|
19
|
+
var ResponsiveCustomButtonToolbar = exports.ResponsiveCustomButtonToolbar = (0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)({}, _types.ToolbarSize.XXL, DefaultButtonsToolbar), _types.ToolbarSize.XL, DefaultButtonsToolbar), _types.ToolbarSize.L, DefaultButtonsToolbar), _types.ToolbarSize.M, []), _types.ToolbarSize.S, []), _types.ToolbarSize.XXXS, []);
|
|
21
20
|
|
|
22
21
|
// eslint-disable-next-line @repo/internal/deprecations/deprecation-ticket-required -- Ignored via go/ED-25883
|
|
23
22
|
/** @deprecated
|
|
24
23
|
* To be removed as part of ED-25129 in favour of ResponsiveCustomButtonToolbarNext along with references
|
|
25
24
|
* to platform_editor_toolbar_responsive_fixes feature gate
|
|
26
25
|
*/
|
|
27
|
-
var ResponsiveCustomMenu = exports.ResponsiveCustomMenu = (
|
|
28
|
-
var ResponsiveCustomButtonToolbarNext = exports.ResponsiveCustomButtonToolbarNext = (
|
|
29
|
-
var ResponsiveCustomMenuNext = exports.ResponsiveCustomMenuNext = (
|
|
26
|
+
var ResponsiveCustomMenu = exports.ResponsiveCustomMenu = (0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)({}, _types.ToolbarSize.XXL, DefaultButtonsMenu), _types.ToolbarSize.XL, DefaultButtonsMenu), _types.ToolbarSize.L, DefaultButtonsMenu), _types.ToolbarSize.M, [_types2.IconTypes.strong, _types2.IconTypes.em].concat(DefaultButtonsMenu)), _types.ToolbarSize.S, [_types2.IconTypes.strong, _types2.IconTypes.em].concat(DefaultButtonsMenu)), _types.ToolbarSize.XXXS, [_types2.IconTypes.strong, _types2.IconTypes.em].concat(DefaultButtonsMenu));
|
|
27
|
+
var ResponsiveCustomButtonToolbarNext = exports.ResponsiveCustomButtonToolbarNext = (0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)({}, _types.ToolbarSize.XXL, DefaultButtonsToolbar), _types.ToolbarSize.XL, DefaultButtonsToolbar), _types.ToolbarSize.L, DefaultButtonsToolbar), _types.ToolbarSize.M, DefaultButtonsToolbar), _types.ToolbarSize.S, DefaultButtonsToolbar), _types.ToolbarSize.XXXS, []);
|
|
28
|
+
var ResponsiveCustomMenuNext = exports.ResponsiveCustomMenuNext = (0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)({}, _types.ToolbarSize.XXL, DefaultButtonsMenu), _types.ToolbarSize.XL, DefaultButtonsMenu), _types.ToolbarSize.L, DefaultButtonsMenu), _types.ToolbarSize.M, DefaultButtonsMenu), _types.ToolbarSize.S, DefaultButtonsMenu), _types.ToolbarSize.XXXS, [_types2.IconTypes.strong, _types2.IconTypes.em].concat(DefaultButtonsMenu));
|
|
@@ -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,17 +16,18 @@ 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
|
-
var
|
|
22
|
+
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); }
|
|
23
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
23
24
|
/**
|
|
24
25
|
* @jsxRuntime classic
|
|
25
26
|
* @jsx jsx
|
|
26
27
|
*/
|
|
28
|
+
|
|
27
29
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
28
|
-
|
|
29
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
30
|
+
|
|
30
31
|
var withInputMethod = function withInputMethod(toolbarType, func) {
|
|
31
32
|
return (0, _preset.editorCommandToPMCommand)(func((0, _inputMethodUtils.getInputMethod)(toolbarType)));
|
|
32
33
|
};
|
|
@@ -120,7 +121,7 @@ var getIcon = function getIcon(_ref) {
|
|
|
120
121
|
'aria-keyshortcuts': (0, _keymaps.getAriaKeyshortcuts)(tooltipKeymap)
|
|
121
122
|
};
|
|
122
123
|
};
|
|
123
|
-
var IconsMarkSchema = (
|
|
124
|
+
var IconsMarkSchema = (0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)({}, _types.IconTypes.strong, 'strong'), _types.IconTypes.em, 'em'), _types.IconTypes.strike, 'strike'), _types.IconTypes.code, 'code'), _types.IconTypes.underline, 'underline'), _types.IconTypes.superscript, 'subsup'), _types.IconTypes.subscript, 'subsup');
|
|
124
125
|
var buildMenuIconState = function buildMenuIconState(iconMark) {
|
|
125
126
|
return function (_ref2) {
|
|
126
127
|
var schema = _ref2.schema,
|
|
@@ -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");
|
|
@@ -7,9 +7,8 @@ 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("./
|
|
11
|
-
var
|
|
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);
|
|
10
|
+
var _types = require("./types");
|
|
11
|
+
var toolbarTypeToInputMethod = exports.toolbarTypeToInputMethod = (0, _defineProperty2.default)((0, _defineProperty2.default)({}, _types.ToolbarType.PRIMARY, _analytics.INPUT_METHOD.TOOLBAR), _types.ToolbarType.FLOATING, _analytics.INPUT_METHOD.FLOATING_TB);
|
|
13
12
|
var getInputMethod = exports.getInputMethod = function getInputMethod(toolbarType) {
|
|
14
13
|
return toolbarTypeToInputMethod[toolbarType];
|
|
15
14
|
};
|
|
@@ -21,8 +21,7 @@ var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
|
21
21
|
var MoreIconStyle = (0, _react2.css)({
|
|
22
22
|
display: 'flex',
|
|
23
23
|
alignItems: 'center',
|
|
24
|
-
height: "var(--ds-space-300, 24px)"
|
|
25
|
-
padding: "0 ".concat("var(--ds-space-025, 2px)")
|
|
24
|
+
height: "var(--ds-space-300, 24px)"
|
|
26
25
|
});
|
|
27
26
|
var MoreButton = exports.MoreButton = /*#__PURE__*/_react.default.memo(function (_ref) {
|
|
28
27
|
var label = _ref.label,
|
|
@@ -46,7 +45,7 @@ var MoreButton = exports.MoreButton = /*#__PURE__*/_react.default.memo(function
|
|
|
46
45
|
}, (0, _react2.jsx)(_showMoreHorizontalEditorMore.default, {
|
|
47
46
|
label: "",
|
|
48
47
|
color: "currentColor",
|
|
49
|
-
spacing: "
|
|
48
|
+
spacing: "spacious"
|
|
50
49
|
})),
|
|
51
50
|
"aria-expanded": ariaExpanded,
|
|
52
51
|
"aria-label": label,
|
|
@@ -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,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,10 +7,9 @@ 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
|
-
export { pluginKey };
|
|
14
13
|
const isSelectionInlineCursor = selection => {
|
|
15
14
|
if (selection instanceof NodeSelection) {
|
|
16
15
|
return true;
|
|
@@ -1,16 +1,18 @@
|
|
|
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';
|
|
10
|
-
import { plugin as pmPlugin
|
|
10
|
+
import { plugin as pmPlugin } from './pm-plugins/main';
|
|
11
|
+
import { pluginKey as textFormattingPluginKey } from './pm-plugins/plugin-key';
|
|
11
12
|
import textFormattingSmartInputRulePlugin from './pm-plugins/smart-input-rule';
|
|
12
13
|
import { FloatingToolbarTextFormalWithIntl as FloatingToolbarComponent } from './ui/FloatingToolbarComponent';
|
|
13
14
|
import { PrimaryToolbarComponent } from './ui/PrimaryToolbarComponent';
|
|
15
|
+
|
|
14
16
|
/**
|
|
15
17
|
* Text formatting plugin to be added to an `EditorPresetBuilder` and used with `ComposableEditor`
|
|
16
18
|
* from `@atlaskit/editor-core`.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -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';
|
|
@@ -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
|
|
@@ -13,8 +13,7 @@ import { fg } from '@atlaskit/platform-feature-flags';
|
|
|
13
13
|
const MoreIconStyle = css({
|
|
14
14
|
display: 'flex',
|
|
15
15
|
alignItems: 'center',
|
|
16
|
-
height: "var(--ds-space-300, 24px)"
|
|
17
|
-
padding: `0 ${"var(--ds-space-025, 2px)"}`
|
|
16
|
+
height: "var(--ds-space-300, 24px)"
|
|
18
17
|
});
|
|
19
18
|
export const MoreButton = /*#__PURE__*/React.memo(({
|
|
20
19
|
label,
|
|
@@ -39,7 +38,7 @@ export const MoreButton = /*#__PURE__*/React.memo(({
|
|
|
39
38
|
}, jsx(ShowMoreHorizontalIcon, {
|
|
40
39
|
label: "",
|
|
41
40
|
color: "currentColor",
|
|
42
|
-
spacing: "
|
|
41
|
+
spacing: "spacious"
|
|
43
42
|
})),
|
|
44
43
|
"aria-expanded": ariaExpanded,
|
|
45
44
|
"aria-label": label,
|
|
@@ -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,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({
|