@atlaskit/editor-plugin-text-formatting 1.16.4 → 1.16.6
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 +12 -0
- package/dist/cjs/editor-commands/clear-formatting.js +5 -0
- package/dist/cjs/editor-commands/transform-to-code.js +13 -1
- package/dist/cjs/editor-commands/utils/cell-selection.js +4 -1
- package/dist/cjs/pm-plugins/clear-formatting-keymap.js +4 -1
- package/dist/cjs/pm-plugins/clear-formatting.js +2 -0
- package/dist/cjs/pm-plugins/cursor.js +6 -1
- package/dist/cjs/pm-plugins/input-rule.js +28 -18
- package/dist/cjs/pm-plugins/keymap.js +28 -7
- package/dist/cjs/pm-plugins/main.js +7 -6
- package/dist/cjs/pm-plugins/smart-input-rule.js +30 -0
- package/dist/cjs/textFormattingPlugin.js +2 -1
- package/dist/cjs/ui/FloatingToolbarComponent.js +8 -4
- package/dist/cjs/ui/Toolbar/constants.js +4 -5
- package/dist/cjs/ui/Toolbar/dropdown-menu.js +4 -6
- package/dist/cjs/ui/Toolbar/hooks/formatting-icons.js +5 -4
- package/dist/cjs/ui/Toolbar/index.js +8 -2
- package/dist/cjs/ui/Toolbar/input-method-utils.js +1 -2
- package/dist/cjs/ui/Toolbar/more-button.js +2 -3
- package/dist/es2019/editor-commands/clear-formatting.js +7 -2
- package/dist/es2019/editor-commands/transform-to-code.js +13 -1
- package/dist/es2019/editor-commands/utils/cell-selection.js +4 -1
- package/dist/es2019/editor-commands/utils.js +1 -1
- package/dist/es2019/index.js +3 -0
- package/dist/es2019/pm-plugins/clear-formatting-keymap.js +4 -1
- package/dist/es2019/pm-plugins/clear-formatting.js +2 -0
- package/dist/es2019/pm-plugins/cursor.js +6 -1
- package/dist/es2019/pm-plugins/input-rule.js +13 -1
- package/dist/es2019/pm-plugins/keymap.js +29 -8
- package/dist/es2019/pm-plugins/main.js +6 -1
- package/dist/es2019/pm-plugins/smart-input-rule.js +31 -1
- package/dist/es2019/textFormattingPlugin.js +2 -1
- package/dist/es2019/ui/FloatingToolbarComponent.js +8 -2
- package/dist/es2019/ui/Toolbar/dropdown-menu.js +5 -5
- package/dist/es2019/ui/Toolbar/index.js +8 -2
- package/dist/es2019/ui/Toolbar/more-button.js +2 -3
- package/dist/esm/editor-commands/clear-formatting.js +5 -0
- package/dist/esm/editor-commands/transform-to-code.js +13 -1
- package/dist/esm/editor-commands/utils/cell-selection.js +4 -1
- package/dist/esm/index.js +3 -0
- package/dist/esm/pm-plugins/clear-formatting-keymap.js +4 -1
- package/dist/esm/pm-plugins/clear-formatting.js +2 -0
- package/dist/esm/pm-plugins/cursor.js +6 -1
- package/dist/esm/pm-plugins/input-rule.js +28 -18
- package/dist/esm/pm-plugins/keymap.js +28 -7
- package/dist/esm/pm-plugins/main.js +6 -1
- package/dist/esm/pm-plugins/smart-input-rule.js +30 -0
- package/dist/esm/textFormattingPlugin.js +2 -1
- package/dist/esm/ui/FloatingToolbarComponent.js +8 -3
- package/dist/esm/ui/Toolbar/constants.js +4 -5
- package/dist/esm/ui/Toolbar/dropdown-menu.js +5 -7
- package/dist/esm/ui/Toolbar/hooks/formatting-icons.js +1 -2
- package/dist/esm/ui/Toolbar/index.js +8 -2
- package/dist/esm/ui/Toolbar/input-method-utils.js +1 -2
- package/dist/esm/ui/Toolbar/more-button.js +2 -3
- package/dist/types/pm-plugins/main.d.ts +0 -2
- package/dist/types/ui/Toolbar/dropdown-menu.d.ts +3 -1
- package/dist/types-ts4.5/pm-plugins/main.d.ts +0 -2
- package/dist/types-ts4.5/ui/Toolbar/dropdown-menu.d.ts +3 -1
- package/package.json +5 -5
package/CHANGELOG.md
CHANGED
|
@@ -25,6 +25,9 @@ var formatTypes = {
|
|
|
25
25
|
function clearFormattingWithAnalytics(inputMethod, editorAnalyticsAPI) {
|
|
26
26
|
return clearFormatting(inputMethod, editorAnalyticsAPI);
|
|
27
27
|
}
|
|
28
|
+
|
|
29
|
+
// Ignored via go/ees005
|
|
30
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
28
31
|
function clearNodeFormattingOnSelection(state, tr, formattedNodeType, nodeName, formattingCleared) {
|
|
29
32
|
return function (node, pos) {
|
|
30
33
|
if (node.type === formattedNodeType) {
|
|
@@ -41,6 +44,8 @@ function clearNodeFormattingOnSelection(state, tr, formattedNodeType, nodeName,
|
|
|
41
44
|
var targetLiftDepth = (0, _transform.liftTarget)(nodeRange);
|
|
42
45
|
if (targetLiftDepth || targetLiftDepth === 0) {
|
|
43
46
|
formattingCleared.push(nodeName);
|
|
47
|
+
// Ignored via go/ees005
|
|
48
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
44
49
|
tr.lift(nodeRange, targetLiftDepth);
|
|
45
50
|
}
|
|
46
51
|
}
|
|
@@ -15,8 +15,14 @@ var SMART_TO_ASCII = {
|
|
|
15
15
|
'‘': "'",
|
|
16
16
|
'’': "'"
|
|
17
17
|
};
|
|
18
|
+
|
|
19
|
+
// Ignored via go/ees005
|
|
20
|
+
// eslint-disable-next-line require-unicode-regexp
|
|
18
21
|
var FIND_SMART_CHAR = new RegExp("[".concat(Object.keys(SMART_TO_ASCII).join(''), "]"), 'g');
|
|
19
|
-
var replaceMentionOrEmojiForTextContent = function replaceMentionOrEmojiForTextContent(position, nodeSize, textContent, tr
|
|
22
|
+
var replaceMentionOrEmojiForTextContent = function replaceMentionOrEmojiForTextContent(position, nodeSize, textContent, tr
|
|
23
|
+
// Ignored via go/ees005
|
|
24
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
25
|
+
) {
|
|
20
26
|
var currentPos = tr.mapping.map(position);
|
|
21
27
|
var schema = tr.doc.type.schema;
|
|
22
28
|
tr.replaceWith(currentPos, currentPos + nodeSize, schema.text(textContent));
|
|
@@ -24,6 +30,9 @@ var replaceMentionOrEmojiForTextContent = function replaceMentionOrEmojiForTextC
|
|
|
24
30
|
var replaceSmartCharsToAscii = function replaceSmartCharsToAscii(position, textContent, tr) {
|
|
25
31
|
var schema = tr.doc.type.schema;
|
|
26
32
|
var match;
|
|
33
|
+
|
|
34
|
+
// Ignored via go/ees005
|
|
35
|
+
// eslint-disable-next-line no-cond-assign
|
|
27
36
|
while (match = FIND_SMART_CHAR.exec(textContent)) {
|
|
28
37
|
var _match = match,
|
|
29
38
|
smartChar = _match[0],
|
|
@@ -38,6 +47,9 @@ var isNodeTextBlock = function isNodeTextBlock(schema) {
|
|
|
38
47
|
mention = _schema$nodes.mention,
|
|
39
48
|
text = _schema$nodes.text,
|
|
40
49
|
emoji = _schema$nodes.emoji;
|
|
50
|
+
|
|
51
|
+
// Ignored via go/ees005
|
|
52
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
41
53
|
return function (node, _, parent) {
|
|
42
54
|
if (node.type === mention || node.type === emoji || node.type === text) {
|
|
43
55
|
return parent === null || parent === void 0 ? void 0 : parent.isTextblock;
|
|
@@ -4,7 +4,10 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.cellSelectionNodesBetween = void 0;
|
|
7
|
-
var cellSelectionNodesBetween = exports.cellSelectionNodesBetween = function cellSelectionNodesBetween(selection, doc, f, startPos
|
|
7
|
+
var cellSelectionNodesBetween = exports.cellSelectionNodesBetween = function cellSelectionNodesBetween(selection, doc, f, startPos
|
|
8
|
+
// Ignored via go/ees005
|
|
9
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
10
|
+
) {
|
|
8
11
|
selection.forEachCell(function (cell, cellPos) {
|
|
9
12
|
doc.nodesBetween(cellPos, cellPos + cell.nodeSize, f, startPos);
|
|
10
13
|
});
|
|
@@ -11,7 +11,10 @@ var _keymap = require("@atlaskit/editor-prosemirror/keymap");
|
|
|
11
11
|
var _clearFormatting = require("../editor-commands/clear-formatting");
|
|
12
12
|
function keymapPlugin(editorAnalyticsAPI) {
|
|
13
13
|
var list = {};
|
|
14
|
-
(0, _keymaps.bindKeymapWithCommand)(
|
|
14
|
+
(0, _keymaps.bindKeymapWithCommand)(
|
|
15
|
+
// Ignored via go/ees005
|
|
16
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
17
|
+
_keymaps.clearFormatting.common, (0, _clearFormatting.clearFormattingWithAnalytics)(_analytics.INPUT_METHOD.SHORTCUT, editorAnalyticsAPI), list);
|
|
15
18
|
return (0, _keymap.keymap)(list);
|
|
16
19
|
}
|
|
17
20
|
var _default = exports.default = keymapPlugin;
|
|
@@ -16,6 +16,8 @@ var plugin = exports.plugin = function plugin(dispatch) {
|
|
|
16
16
|
formattingIsPresent: (0, _utils.checkFormattingIsPresent)(state)
|
|
17
17
|
};
|
|
18
18
|
},
|
|
19
|
+
// Ignored via go/ees005
|
|
20
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
19
21
|
apply: function apply(_tr, pluginState, _oldState, newState) {
|
|
20
22
|
var formattingIsPresent = (0, _utils.checkFormattingIsPresent)(newState);
|
|
21
23
|
if (formattingIsPresent !== pluginState.formattingIsPresent) {
|
|
@@ -11,6 +11,8 @@ var _default = exports.default = new _safePlugin.SafePlugin({
|
|
|
11
11
|
props: {
|
|
12
12
|
handleClick: function handleClick(view, clickPos, event) {
|
|
13
13
|
// Don't apply in Edge as per ED-4546
|
|
14
|
+
// Ignored via go/ees005
|
|
15
|
+
// eslint-disable-next-line require-unicode-regexp
|
|
14
16
|
if (navigator && /Edge\/\d/.test(navigator.userAgent)) {
|
|
15
17
|
return false;
|
|
16
18
|
}
|
|
@@ -36,7 +38,10 @@ var _default = exports.default = new _safePlugin.SafePlugin({
|
|
|
36
38
|
// it was at a directly adjacent non-text node, so we skip this manual
|
|
37
39
|
// text selection logic to preserve that non-text node's selection
|
|
38
40
|
clickWasAtTextNode || clickWasAtEndOfAParagraphNode)) {
|
|
39
|
-
var clickWasInsideNodeDOM = event.target.parentNode === view.domAtPos(clickedDOMElementPosition).node &&
|
|
41
|
+
var clickWasInsideNodeDOM = event.target.parentNode === view.domAtPos(clickedDOMElementPosition).node &&
|
|
42
|
+
// Ignored via go/ees005
|
|
43
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
44
|
+
code.isInSet(view.state.doc.resolve(clickedDOMElementPosition).nodeAfter.marks);
|
|
40
45
|
var nodeNextToClick = $click.nodeBefore && code.isInSet($click.nodeBefore.marks) ? $click.nodeAfter : $click.nodeBefore;
|
|
41
46
|
|
|
42
47
|
// Need to set the selection here to allow clicking between [code('text'),{<>},emoji()]
|
|
@@ -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,26 +41,28 @@ 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
|
+
// Ignored via go/ees005
|
|
65
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
64
66
|
return function (state, match, start, end) {
|
|
65
67
|
var _schema$marks;
|
|
66
68
|
var doc = state.doc,
|
|
@@ -111,20 +113,19 @@ function addMark(markType, schema, char) {
|
|
|
111
113
|
};
|
|
112
114
|
}
|
|
113
115
|
var ReverseRegexExp = /*#__PURE__*/function (_RegExp) {
|
|
114
|
-
(0, _inherits2.default)(ReverseRegexExp, _RegExp);
|
|
115
|
-
var _super = _createSuper(ReverseRegexExp);
|
|
116
116
|
function ReverseRegexExp() {
|
|
117
117
|
(0, _classCallCheck2.default)(this, ReverseRegexExp);
|
|
118
|
-
return
|
|
118
|
+
return _callSuper(this, ReverseRegexExp, arguments);
|
|
119
119
|
}
|
|
120
|
-
(0,
|
|
120
|
+
(0, _inherits2.default)(ReverseRegexExp, _RegExp);
|
|
121
|
+
return (0, _createClass2.default)(ReverseRegexExp, [{
|
|
121
122
|
key: "exec",
|
|
122
123
|
value: function exec(str) {
|
|
123
124
|
if (!str) {
|
|
124
125
|
return null;
|
|
125
126
|
}
|
|
126
127
|
var reverseStr = (0, _toConsumableArray2.default)(str).reverse().join('');
|
|
127
|
-
var result = (
|
|
128
|
+
var result = _superPropGet(ReverseRegexExp, "exec", this, 3)([reverseStr]);
|
|
128
129
|
if (!result) {
|
|
129
130
|
return null;
|
|
130
131
|
}
|
|
@@ -142,10 +143,13 @@ var ReverseRegexExp = /*#__PURE__*/function (_RegExp) {
|
|
|
142
143
|
return result;
|
|
143
144
|
}
|
|
144
145
|
}]);
|
|
145
|
-
return ReverseRegexExp;
|
|
146
146
|
}( /*#__PURE__*/(0, _wrapNativeSuper2.default)(RegExp));
|
|
147
147
|
var buildRegex = function buildRegex(char) {
|
|
148
|
+
// Ignored via go/ees005
|
|
149
|
+
// eslint-disable-next-line require-unicode-regexp
|
|
148
150
|
var escapedChar = char.replace(/(\W)/g, '\\$1');
|
|
151
|
+
// Ignored via go/ees005
|
|
152
|
+
// eslint-disable-next-line require-unicode-regexp
|
|
149
153
|
var combinations = ValidCombinations[char].map(function (c) {
|
|
150
154
|
return c.replace(/(\W)/g, '\\$1');
|
|
151
155
|
}).join('|');
|
|
@@ -153,7 +157,13 @@ var buildRegex = function buildRegex(char) {
|
|
|
153
157
|
// Single X - https://regex101.com/r/McT3yq/14/
|
|
154
158
|
// Double X - https://regex101.com/r/pQUgjx/1/
|
|
155
159
|
var baseRegex = '^X(?=[^X\\s]).*?[^\\sX]X(?=[\\sOBJECT_REPLACEMENT_CHARACTER]COMBINATIONS|$)'.replace('OBJECT_REPLACEMENT_CHARACTER', _prosemirrorInputRules.leafNodeReplacementCharacter).replace('COMBINATIONS', combinations ? "|".concat(combinations) : '');
|
|
156
|
-
var replacedRegex = String.prototype.hasOwnProperty('replaceAll') ?
|
|
160
|
+
var replacedRegex = String.prototype.hasOwnProperty('replaceAll') ?
|
|
161
|
+
// Ignored via go/ees005
|
|
162
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
163
|
+
baseRegex.replaceAll('X', escapedChar) :
|
|
164
|
+
// Ignored via go/ees005
|
|
165
|
+
// eslint-disable-next-line require-unicode-regexp
|
|
166
|
+
baseRegex.replace(/X/g, escapedChar);
|
|
157
167
|
return new ReverseRegexExp(replacedRegex);
|
|
158
168
|
};
|
|
159
169
|
var strongRegex1 = exports.strongRegex1 = buildRegex(ValidAutoformatChars.STRONG);
|
|
@@ -12,25 +12,46 @@ var _commands = require("./commands");
|
|
|
12
12
|
function keymapPlugin(schema, editorAnalyticsAPI) {
|
|
13
13
|
var list = {};
|
|
14
14
|
if (schema.marks.strong) {
|
|
15
|
-
(0, _keymaps.bindKeymapWithEditorCommand)(
|
|
15
|
+
(0, _keymaps.bindKeymapWithEditorCommand)(
|
|
16
|
+
// Ignored via go/ees005
|
|
17
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
18
|
+
_keymaps.toggleBold.common, (0, _commands.toggleStrongWithAnalytics)(editorAnalyticsAPI)(_analytics.INPUT_METHOD.SHORTCUT), list);
|
|
16
19
|
}
|
|
17
20
|
if (schema.marks.em) {
|
|
18
|
-
(0, _keymaps.bindKeymapWithEditorCommand)(
|
|
21
|
+
(0, _keymaps.bindKeymapWithEditorCommand)(
|
|
22
|
+
// Ignored via go/ees005
|
|
23
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
24
|
+
_keymaps.toggleItalic.common, (0, _commands.toggleEmWithAnalytics)(editorAnalyticsAPI)(_analytics.INPUT_METHOD.SHORTCUT), list);
|
|
19
25
|
}
|
|
20
26
|
if (schema.marks.code) {
|
|
21
|
-
(0, _keymaps.bindKeymapWithEditorCommand)(
|
|
27
|
+
(0, _keymaps.bindKeymapWithEditorCommand)(
|
|
28
|
+
// Ignored via go/ees005
|
|
29
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
30
|
+
_keymaps.toggleCode.common, (0, _commands.toggleCodeWithAnalytics)(editorAnalyticsAPI)(_analytics.INPUT_METHOD.SHORTCUT), list);
|
|
22
31
|
}
|
|
23
32
|
if (schema.marks.strike) {
|
|
24
|
-
(0, _keymaps.bindKeymapWithEditorCommand)(
|
|
33
|
+
(0, _keymaps.bindKeymapWithEditorCommand)(
|
|
34
|
+
// Ignored via go/ees005
|
|
35
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
36
|
+
_keymaps.toggleStrikethrough.common, (0, _commands.toggleStrikeWithAnalytics)(editorAnalyticsAPI)(_analytics.INPUT_METHOD.SHORTCUT), list);
|
|
25
37
|
}
|
|
26
38
|
if (schema.marks.subsup) {
|
|
27
|
-
(0, _keymaps.bindKeymapWithEditorCommand)(
|
|
39
|
+
(0, _keymaps.bindKeymapWithEditorCommand)(
|
|
40
|
+
// Ignored via go/ees005
|
|
41
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
42
|
+
_keymaps.toggleSubscript.common, (0, _commands.toggleSubscriptWithAnalytics)(editorAnalyticsAPI)(_analytics.INPUT_METHOD.SHORTCUT), list);
|
|
28
43
|
}
|
|
29
44
|
if (schema.marks.subsup) {
|
|
30
|
-
(0, _keymaps.bindKeymapWithEditorCommand)(
|
|
45
|
+
(0, _keymaps.bindKeymapWithEditorCommand)(
|
|
46
|
+
// Ignored via go/ees005
|
|
47
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
48
|
+
_keymaps.toggleSuperscript.common, (0, _commands.toggleSuperscriptWithAnalytics)(editorAnalyticsAPI)(_analytics.INPUT_METHOD.SHORTCUT), list);
|
|
31
49
|
}
|
|
32
50
|
if (schema.marks.underline) {
|
|
33
|
-
(0, _keymaps.bindKeymapWithEditorCommand)(
|
|
51
|
+
(0, _keymaps.bindKeymapWithEditorCommand)(
|
|
52
|
+
// Ignored via go/ees005
|
|
53
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
54
|
+
_keymaps.toggleUnderline.common, (0, _commands.toggleUnderlineWithAnalytics)(editorAnalyticsAPI)(_analytics.INPUT_METHOD.SHORTCUT), list);
|
|
34
55
|
}
|
|
35
56
|
return new _safePlugin.SafePlugin({
|
|
36
57
|
props: {
|
|
@@ -5,12 +5,6 @@ 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");
|
|
@@ -25,6 +19,9 @@ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e;
|
|
|
25
19
|
// TODO: Ideally this should use the custom toggleMark function from @atlaskit/editor-common so we also disable the options when selecting inline nodes but it disables the marks when the selection is empty at this point in time which is undesirable
|
|
26
20
|
// import { toggleMark } from '@atlaskit/editor-common/mark';
|
|
27
21
|
|
|
22
|
+
// Ignored via go/ees005
|
|
23
|
+
// eslint-disable-next-line import/no-namespace
|
|
24
|
+
|
|
28
25
|
var isSelectionInlineCursor = function isSelectionInlineCursor(selection) {
|
|
29
26
|
if (selection instanceof _state.NodeSelection) {
|
|
30
27
|
return true;
|
|
@@ -92,6 +89,8 @@ var plugin = exports.plugin = function plugin(dispatch, editorAnalyticsAPI) {
|
|
|
92
89
|
init: function init(_config, state) {
|
|
93
90
|
return getTextFormattingState(state, editorAnalyticsAPI);
|
|
94
91
|
},
|
|
92
|
+
// Ignored via go/ees005
|
|
93
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
95
94
|
apply: function apply(_tr, pluginState, _oldState, newState) {
|
|
96
95
|
var state = getTextFormattingState(newState, editorAnalyticsAPI);
|
|
97
96
|
if (!(0, _utils.shallowEqual)(pluginState, state)) {
|
|
@@ -113,6 +112,8 @@ var plugin = exports.plugin = function plugin(dispatch, editorAnalyticsAPI) {
|
|
|
113
112
|
}
|
|
114
113
|
return false;
|
|
115
114
|
},
|
|
115
|
+
// Ignored via go/ees005
|
|
116
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
116
117
|
handleTextInput: function handleTextInput(view, from, to, text) {
|
|
117
118
|
var state = view.state,
|
|
118
119
|
dispatch = view.dispatch;
|
|
@@ -21,6 +21,8 @@ var _prosemirrorInputRules = require("@atlaskit/prosemirror-input-rules");
|
|
|
21
21
|
* @param text text to replace with
|
|
22
22
|
*/
|
|
23
23
|
function replaceTextUsingCaptureGroup(text) {
|
|
24
|
+
// Ignored via go/ees005
|
|
25
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
24
26
|
return function (state, match, start, end) {
|
|
25
27
|
var _match = (0, _slicedToArray2.default)(match, 4),
|
|
26
28
|
prefix = _match[1],
|
|
@@ -65,6 +67,8 @@ function createReplacementRules(replMap, replacementRuleWithAnalytics) {
|
|
|
65
67
|
function createSingleQuotesRules() {
|
|
66
68
|
return [
|
|
67
69
|
// wrapped text
|
|
70
|
+
// Ignored via go/ees005
|
|
71
|
+
// eslint-disable-next-line require-unicode-regexp, @typescript-eslint/max-params
|
|
68
72
|
(0, _utils.createRule)(/(\s|^)'(\S+.*\S+)'$/, function (state, match, start, end) {
|
|
69
73
|
var OPEN_SMART_QUOTE_CHAR = '‘';
|
|
70
74
|
var CLOSED_SMART_QUOTE_CHAR = '’';
|
|
@@ -81,6 +85,8 @@ function createSingleQuotesRules() {
|
|
|
81
85
|
return state.tr.insertText(CLOSED_SMART_QUOTE_CHAR, positionOfClosedQuote, end).insertText(openQuoteReplacement, start, start + openQuoteReplacement.length);
|
|
82
86
|
}),
|
|
83
87
|
// apostrophe
|
|
88
|
+
// Ignored via go/ees005
|
|
89
|
+
// eslint-disable-next-line require-unicode-regexp
|
|
84
90
|
createReplacementRule('’', /(\w+)(')(\w+)$/)];
|
|
85
91
|
}
|
|
86
92
|
|
|
@@ -103,10 +109,20 @@ function getProductRules(editorAnalyticsAPI) {
|
|
|
103
109
|
}, editorAnalyticsAPI);
|
|
104
110
|
};
|
|
105
111
|
return createReplacementRules({
|
|
112
|
+
// Ignored via go/ees005
|
|
113
|
+
// eslint-disable-next-line require-unicode-regexp
|
|
106
114
|
Atlassian: /(\s+|^)(atlassian)(\s)$/,
|
|
115
|
+
// Ignored via go/ees005
|
|
116
|
+
// eslint-disable-next-line require-unicode-regexp
|
|
107
117
|
Jira: /(\s+|^)(jira|JIRA)(\s)$/,
|
|
118
|
+
// Ignored via go/ees005
|
|
119
|
+
// eslint-disable-next-line require-unicode-regexp
|
|
108
120
|
Bitbucket: /(\s+|^)(bitbucket|BitBucket)(\s)$/,
|
|
121
|
+
// Ignored via go/ees005
|
|
122
|
+
// eslint-disable-next-line require-unicode-regexp
|
|
109
123
|
Hipchat: /(\s+|^)(hipchat|HipChat)(\s)$/,
|
|
124
|
+
// Ignored via go/ees005
|
|
125
|
+
// eslint-disable-next-line require-unicode-regexp
|
|
110
126
|
Trello: /(\s+|^)(trello)(\s)$/
|
|
111
127
|
}, productRuleWithAnalytics);
|
|
112
128
|
}
|
|
@@ -132,8 +148,14 @@ function getSymbolRules(editorAnalyticsAPI) {
|
|
|
132
148
|
}, editorAnalyticsAPI);
|
|
133
149
|
};
|
|
134
150
|
return createReplacementRules({
|
|
151
|
+
// Ignored via go/ees005
|
|
152
|
+
// eslint-disable-next-line require-unicode-regexp
|
|
135
153
|
'→': /(\s+|^)(--?>)(\s)$/,
|
|
154
|
+
// Ignored via go/ees005
|
|
155
|
+
// eslint-disable-next-line require-unicode-regexp
|
|
136
156
|
'←': /(\s+|^)(<--?)(\s)$/,
|
|
157
|
+
// Ignored via go/ees005
|
|
158
|
+
// eslint-disable-next-line require-unicode-regexp
|
|
137
159
|
'↔︎': /(\s+|^)(<->?)(\s)$/
|
|
138
160
|
}, symbolRuleWithAnalytics);
|
|
139
161
|
}
|
|
@@ -159,11 +181,19 @@ function getPunctuationRules(editorAnalyticsAPI) {
|
|
|
159
181
|
}, editorAnalyticsAPI);
|
|
160
182
|
};
|
|
161
183
|
var dashEllipsisRules = createReplacementRules({
|
|
184
|
+
// Ignored via go/ees005
|
|
185
|
+
// eslint-disable-next-line require-unicode-regexp
|
|
162
186
|
'–': /(\s+|^)(--)(\s)$/,
|
|
187
|
+
// Ignored via go/ees005
|
|
188
|
+
// eslint-disable-next-line require-unicode-regexp
|
|
163
189
|
'…': /()(\.\.\.)$/
|
|
164
190
|
}, punctuationRuleWithAnalytics);
|
|
165
191
|
var doubleQuoteRules = createReplacementRules({
|
|
192
|
+
// Ignored via go/ees005
|
|
193
|
+
// eslint-disable-next-line require-unicode-regexp
|
|
166
194
|
'“': /((?:^|[\s\{\[\(\<'"\u2018\u201C]))(")$/,
|
|
195
|
+
// Ignored via go/ees005
|
|
196
|
+
// eslint-disable-next-line require-unicode-regexp
|
|
167
197
|
'”': /"$/
|
|
168
198
|
}, punctuationRuleWithAnalytics);
|
|
169
199
|
var singleQuoteRules = createSingleQuotesRules();
|
|
@@ -16,6 +16,7 @@ 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
|
},
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
3
|
Object.defineProperty(exports, "__esModule", {
|
|
5
4
|
value: true
|
|
6
5
|
});
|
|
7
6
|
exports.FloatingToolbarTextFormalWithIntl = void 0;
|
|
8
|
-
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
9
7
|
var _react = require("react");
|
|
10
8
|
var _react2 = require("@emotion/react");
|
|
11
9
|
var _reactIntlNext = require("react-intl-next");
|
|
@@ -54,9 +52,15 @@ var FloatingToolbarTextFormat = function FloatingToolbarTextFormat(_ref) {
|
|
|
54
52
|
});
|
|
55
53
|
var items = (0, _react.useMemo)(function () {
|
|
56
54
|
if (!clearIcon) {
|
|
57
|
-
return
|
|
55
|
+
return [{
|
|
56
|
+
items: defaultIcons
|
|
57
|
+
}];
|
|
58
58
|
}
|
|
59
|
-
return [
|
|
59
|
+
return [{
|
|
60
|
+
items: defaultIcons
|
|
61
|
+
}, {
|
|
62
|
+
items: [clearIcon]
|
|
63
|
+
}];
|
|
60
64
|
}, [clearIcon, defaultIcons]);
|
|
61
65
|
return (0, _react2.jsx)(_dropdownMenu.FormattingTextDropdownMenu, {
|
|
62
66
|
editorView: editorView,
|
|
@@ -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));
|
|
@@ -37,11 +37,6 @@ var FormattingTextDropdownMenu = exports.FormattingTextDropdownMenu = /*#__PURE_
|
|
|
37
37
|
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
38
38
|
isOpenedByKeyboard = _useState2[0],
|
|
39
39
|
setIsOpenedByKeyboard = _useState2[1];
|
|
40
|
-
var group = (0, _react.useMemo)(function () {
|
|
41
|
-
return [{
|
|
42
|
-
items: items
|
|
43
|
-
}];
|
|
44
|
-
}, [items]);
|
|
45
40
|
var onItemActivated = (0, _react.useCallback)(function (_ref2) {
|
|
46
41
|
var item = _ref2.item,
|
|
47
42
|
_ref2$shouldCloseMenu = _ref2.shouldCloseMenu,
|
|
@@ -60,11 +55,14 @@ var FormattingTextDropdownMenu = exports.FormattingTextDropdownMenu = /*#__PURE_
|
|
|
60
55
|
scrollableElement: popupsScrollableElement,
|
|
61
56
|
onItemActivated: onItemActivated,
|
|
62
57
|
isOpen: isMenuOpen,
|
|
63
|
-
items:
|
|
58
|
+
items: items,
|
|
64
59
|
zIndex: _editorSharedStyles.akEditorMenuZIndex,
|
|
65
60
|
fitHeight: 188,
|
|
66
61
|
fitWidth: 136,
|
|
67
62
|
shouldUseDefaultRole: true,
|
|
63
|
+
section: {
|
|
64
|
+
hasSeparator: true
|
|
65
|
+
},
|
|
68
66
|
shouldFocusFirstItem: function shouldFocusFirstItem() {
|
|
69
67
|
if (isOpenedByKeyboard) {
|
|
70
68
|
setIsOpenedByKeyboard(false);
|
|
@@ -19,14 +19,15 @@ var _textItalicEditorItalic = _interopRequireDefault(require("@atlaskit/icon/cor
|
|
|
19
19
|
var _commands = require("../../../pm-plugins/commands");
|
|
20
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,
|
|
@@ -119,9 +119,15 @@ var ToolbarFormatting = function ToolbarFormatting(_ref) {
|
|
|
119
119
|
}
|
|
120
120
|
var items = (0, _react.useMemo)(function () {
|
|
121
121
|
if (!clearIcon) {
|
|
122
|
-
return
|
|
122
|
+
return [{
|
|
123
|
+
items: dropdownItems
|
|
124
|
+
}];
|
|
123
125
|
}
|
|
124
|
-
return [
|
|
126
|
+
return [{
|
|
127
|
+
items: dropdownItems
|
|
128
|
+
}, {
|
|
129
|
+
items: [clearIcon]
|
|
130
|
+
}];
|
|
125
131
|
}, [clearIcon, dropdownItems]);
|
|
126
132
|
var moreFormattingButtonLabel = intl.formatMessage(_messages.toolbarMessages.moreFormatting);
|
|
127
133
|
var labelTextFormat = intl.formatMessage(_messages.toolbarMessages.textFormatting);
|
|
@@ -8,8 +8,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
10
|
var _types = require("./types");
|
|
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);
|
|
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,
|