@atlaskit/editor-core 188.2.4 → 188.2.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 +7 -0
- package/dist/cjs/plugins/insert-block/ui/ToolbarInsertBlock/dropdown-button.js +1 -1
- package/dist/cjs/plugins/text-color/commands/change-color.js +6 -5
- package/dist/cjs/plugins/text-color/commands/toggle-color.js +1 -1
- package/dist/cjs/plugins/text-color/index.js +6 -4
- package/dist/cjs/plugins/text-color/types.js +5 -0
- package/dist/cjs/plugins/text-color/ui/ToolbarTextColor/index.js +21 -25
- package/dist/cjs/plugins/text-color/utils/disabled.js +1 -1
- package/dist/cjs/plugins/toolbar-lists-indentation/ui/ToolbarDropdown.js +1 -1
- package/dist/cjs/ui/styles.js +1 -7
- package/dist/cjs/version-wrapper.js +1 -1
- package/dist/es2019/plugins/insert-block/ui/ToolbarInsertBlock/dropdown-button.js +1 -1
- package/dist/es2019/plugins/text-color/commands/change-color.js +6 -5
- package/dist/es2019/plugins/text-color/commands/toggle-color.js +1 -1
- package/dist/es2019/plugins/text-color/index.js +5 -3
- package/dist/es2019/plugins/text-color/types.js +1 -0
- package/dist/es2019/plugins/text-color/ui/ToolbarTextColor/index.js +15 -12
- package/dist/es2019/plugins/text-color/utils/disabled.js +1 -1
- package/dist/es2019/plugins/toolbar-lists-indentation/ui/ToolbarDropdown.js +2 -1
- package/dist/es2019/ui/styles.js +1 -5
- package/dist/es2019/version-wrapper.js +1 -1
- package/dist/esm/plugins/insert-block/ui/ToolbarInsertBlock/dropdown-button.js +1 -1
- package/dist/esm/plugins/text-color/commands/change-color.js +6 -5
- package/dist/esm/plugins/text-color/commands/toggle-color.js +1 -1
- package/dist/esm/plugins/text-color/index.js +5 -3
- package/dist/esm/plugins/text-color/types.js +1 -0
- package/dist/esm/plugins/text-color/ui/ToolbarTextColor/index.js +14 -13
- package/dist/esm/plugins/text-color/utils/disabled.js +1 -1
- package/dist/esm/plugins/toolbar-lists-indentation/ui/ToolbarDropdown.js +2 -1
- package/dist/esm/ui/styles.js +1 -5
- package/dist/esm/version-wrapper.js +1 -1
- package/dist/types/plugins/insert-block/ui/ToolbarInsertBlock/dropdown-button.d.ts +1 -1
- package/dist/types/plugins/text-color/commands/change-color.d.ts +3 -2
- package/dist/types/plugins/text-color/commands/remove-color.d.ts +1 -1
- package/dist/types/plugins/text-color/commands/toggle-color.d.ts +1 -1
- package/dist/types/plugins/text-color/index.d.ts +3 -7
- package/dist/types/plugins/text-color/pm-plugins/main.d.ts +1 -1
- package/dist/types/plugins/text-color/types.d.ts +10 -0
- package/dist/types/plugins/text-color/ui/ToolbarTextColor/index.d.ts +5 -2
- package/dist/types/ui/styles.d.ts +0 -1
- package/dist/types-ts4.5/plugins/insert-block/ui/ToolbarInsertBlock/dropdown-button.d.ts +1 -1
- package/dist/types-ts4.5/plugins/text-color/commands/change-color.d.ts +3 -2
- package/dist/types-ts4.5/plugins/text-color/commands/remove-color.d.ts +1 -1
- package/dist/types-ts4.5/plugins/text-color/commands/toggle-color.d.ts +1 -1
- package/dist/types-ts4.5/plugins/text-color/index.d.ts +3 -8
- package/dist/types-ts4.5/plugins/text-color/pm-plugins/main.d.ts +1 -1
- package/dist/types-ts4.5/plugins/text-color/types.d.ts +12 -0
- package/dist/types-ts4.5/plugins/text-color/ui/ToolbarTextColor/index.d.ts +5 -2
- package/dist/types-ts4.5/ui/styles.d.ts +0 -1
- package/package.json +2 -2
- package/dist/cjs/utils/mark.js +0 -40
- package/dist/es2019/utils/mark.js +0 -26
- package/dist/esm/utils/mark.js +0 -34
- package/dist/types/utils/mark.d.ts +0 -4
- package/dist/types-ts4.5/utils/mark.d.ts +0 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# @atlaskit/editor-core
|
|
2
2
|
|
|
3
|
+
## 188.2.5
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#41103](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/41103) [`e268e178096`](https://bitbucket.org/atlassian/atlassian-frontend/commits/e268e178096) - ED-20195 Decouple Text color plugin from editor core
|
|
8
|
+
- Updated dependencies
|
|
9
|
+
|
|
3
10
|
## 188.2.4
|
|
4
11
|
|
|
5
12
|
### Patch Changes
|
|
@@ -11,7 +11,7 @@ var _add = _interopRequireDefault(require("@atlaskit/icon/glyph/editor/add"));
|
|
|
11
11
|
var _chevronDown = _interopRequireDefault(require("@atlaskit/icon/glyph/chevron-down"));
|
|
12
12
|
var _keymaps = require("../../../../keymaps");
|
|
13
13
|
var _ToolbarButton = _interopRequireDefault(require("../../../../ui/ToolbarButton"));
|
|
14
|
-
var _styles = require("
|
|
14
|
+
var _styles = require("@atlaskit/editor-common/styles");
|
|
15
15
|
var _styles2 = require("./styles");
|
|
16
16
|
/** @jsx jsx */
|
|
17
17
|
|
|
@@ -4,7 +4,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.changeColor = void 0;
|
|
7
|
-
var _analytics = require("
|
|
7
|
+
var _analytics = require("@atlaskit/editor-common/analytics");
|
|
8
|
+
var _editorAnalytics = require("@atlaskit/editor-common/editor-analytics");
|
|
8
9
|
var _main = require("../pm-plugins/main");
|
|
9
10
|
var _color = require("../utils/color");
|
|
10
11
|
var _removeColor = require("./remove-color");
|
|
@@ -16,7 +17,7 @@ var _toggleColor = require("./toggle-color");
|
|
|
16
17
|
* @param palette - Current palette of colors
|
|
17
18
|
* @return Higher order command with analytics logic inside.
|
|
18
19
|
*/
|
|
19
|
-
function createWithColorAnalytics(newColor, previousColor, palette) {
|
|
20
|
+
function createWithColorAnalytics(newColor, previousColor, palette, editorAnalyticsApi) {
|
|
20
21
|
var newColorFromPalette = palette.find(function (_ref) {
|
|
21
22
|
var value = _ref.value;
|
|
22
23
|
return value === newColor;
|
|
@@ -27,7 +28,7 @@ function createWithColorAnalytics(newColor, previousColor, palette) {
|
|
|
27
28
|
});
|
|
28
29
|
var newColorLabel = newColorFromPalette ? newColorFromPalette.label : newColor;
|
|
29
30
|
var previousColorLabel = previousColorFromPalette ? previousColorFromPalette.label : previousColor || '';
|
|
30
|
-
return (0,
|
|
31
|
+
return (0, _editorAnalytics.withAnalytics)(editorAnalyticsApi, {
|
|
31
32
|
action: _analytics.ACTION.FORMATTED,
|
|
32
33
|
actionSubject: _analytics.ACTION_SUBJECT.TEXT,
|
|
33
34
|
actionSubjectId: _analytics.ACTION_SUBJECT_ID.FORMAT_COLOR,
|
|
@@ -38,13 +39,13 @@ function createWithColorAnalytics(newColor, previousColor, palette) {
|
|
|
38
39
|
}
|
|
39
40
|
});
|
|
40
41
|
}
|
|
41
|
-
var changeColor = exports.changeColor = function changeColor(color) {
|
|
42
|
+
var changeColor = exports.changeColor = function changeColor(color, editorAnalyticsApi) {
|
|
42
43
|
return function (state, dispatch) {
|
|
43
44
|
var textColor = state.schema.marks.textColor;
|
|
44
45
|
if (textColor) {
|
|
45
46
|
var pluginState = _main.pluginKey.getState(state);
|
|
46
47
|
var activeColor = (0, _color.getActiveColor)(state);
|
|
47
|
-
var withColorAnalytics = createWithColorAnalytics(color, activeColor, (pluginState === null || pluginState === void 0 ? void 0 : pluginState.palette) || []);
|
|
48
|
+
var withColorAnalytics = createWithColorAnalytics(color, activeColor, (pluginState === null || pluginState === void 0 ? void 0 : pluginState.palette) || [], editorAnalyticsApi);
|
|
48
49
|
if (pluginState !== null && pluginState !== void 0 && pluginState.disabled) {
|
|
49
50
|
return false;
|
|
50
51
|
}
|
|
@@ -5,9 +5,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.toggleColor = void 0;
|
|
7
7
|
var _mark = require("@atlaskit/editor-common/mark");
|
|
8
|
+
var _preset = require("@atlaskit/editor-common/preset");
|
|
8
9
|
var _main = require("../pm-plugins/main");
|
|
9
10
|
var _disabled = require("../utils/disabled");
|
|
10
|
-
var _preset = require("@atlaskit/editor-common/preset");
|
|
11
11
|
var toggleColor = exports.toggleColor = function toggleColor(color) {
|
|
12
12
|
return function (state, dispatch) {
|
|
13
13
|
var textColor = state.schema.marks.textColor;
|
|
@@ -13,7 +13,7 @@ Object.defineProperty(exports, "textColorPluginKey", {
|
|
|
13
13
|
});
|
|
14
14
|
var _react = _interopRequireDefault(require("react"));
|
|
15
15
|
var _adfSchema = require("@atlaskit/adf-schema");
|
|
16
|
-
var
|
|
16
|
+
var _withPluginState = require("@atlaskit/editor-common/with-plugin-state");
|
|
17
17
|
var _main = require("./pm-plugins/main");
|
|
18
18
|
var _ToolbarTextColor = _interopRequireDefault(require("./ui/ToolbarTextColor"));
|
|
19
19
|
var pluginConfig = function pluginConfig(textColorConfig) {
|
|
@@ -23,7 +23,8 @@ var pluginConfig = function pluginConfig(textColorConfig) {
|
|
|
23
23
|
return textColorConfig;
|
|
24
24
|
};
|
|
25
25
|
var textColorPlugin = function textColorPlugin(_ref) {
|
|
26
|
-
var textColorConfig = _ref.config
|
|
26
|
+
var textColorConfig = _ref.config,
|
|
27
|
+
api = _ref.api;
|
|
27
28
|
return {
|
|
28
29
|
name: 'textColor',
|
|
29
30
|
marks: function marks() {
|
|
@@ -49,7 +50,7 @@ var textColorPlugin = function textColorPlugin(_ref) {
|
|
|
49
50
|
isToolbarReducedSpacing = _ref3.isToolbarReducedSpacing,
|
|
50
51
|
dispatchAnalyticsEvent = _ref3.dispatchAnalyticsEvent,
|
|
51
52
|
disabled = _ref3.disabled;
|
|
52
|
-
return /*#__PURE__*/_react.default.createElement(
|
|
53
|
+
return /*#__PURE__*/_react.default.createElement(_withPluginState.WithPluginState, {
|
|
53
54
|
plugins: {
|
|
54
55
|
textColor: _main.pluginKey
|
|
55
56
|
},
|
|
@@ -63,7 +64,8 @@ var textColorPlugin = function textColorPlugin(_ref) {
|
|
|
63
64
|
popupsBoundariesElement: popupsBoundariesElement,
|
|
64
65
|
popupsScrollableElement: popupsScrollableElement,
|
|
65
66
|
dispatchAnalyticsEvent: dispatchAnalyticsEvent,
|
|
66
|
-
disabled: disabled
|
|
67
|
+
disabled: disabled,
|
|
68
|
+
pluginInjectionApi: api
|
|
67
69
|
});
|
|
68
70
|
}
|
|
69
71
|
});
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
@@ -18,19 +17,14 @@ var _react2 = require("@emotion/react");
|
|
|
18
17
|
var _reactIntlNext = require("react-intl-next");
|
|
19
18
|
var _uiColor = require("@atlaskit/editor-common/ui-color");
|
|
20
19
|
var _uiMenu = require("@atlaskit/editor-common/ui-menu");
|
|
20
|
+
var _styles = require("@atlaskit/editor-common/styles");
|
|
21
|
+
var _analytics = require("@atlaskit/editor-common/analytics");
|
|
21
22
|
var _editorPalette = require("@atlaskit/editor-palette");
|
|
22
23
|
var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
|
|
23
24
|
var _chevronDown = _interopRequireDefault(require("@atlaskit/icon/glyph/chevron-down"));
|
|
24
|
-
var
|
|
25
|
-
var _styles = require("../../../../ui/styles");
|
|
26
|
-
var _styles2 = require("@atlaskit/editor-common/styles");
|
|
27
|
-
var _ToolbarButton = _interopRequireWildcard(require("../../../../ui/ToolbarButton"));
|
|
28
|
-
var _analytics = require("../../../analytics");
|
|
29
|
-
var commands = _interopRequireWildcard(require("../../commands/change-color"));
|
|
25
|
+
var _changeColor = require("../../commands/change-color");
|
|
30
26
|
var _icon = require("./icon");
|
|
31
|
-
var
|
|
32
|
-
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
33
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
27
|
+
var _styles2 = require("./styles");
|
|
34
28
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
35
29
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
36
30
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
|
|
@@ -59,8 +53,8 @@ var ToolbarTextColor = exports.ToolbarTextColor = /*#__PURE__*/function (_React$
|
|
|
59
53
|
isOpenedByKeyboard: false
|
|
60
54
|
});
|
|
61
55
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "toolbarItemRef", /*#__PURE__*/_react.default.createRef());
|
|
62
|
-
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "changeColor", function (color) {
|
|
63
|
-
return
|
|
56
|
+
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "changeColor", function (color, editorAnalyticsApi) {
|
|
57
|
+
return (0, _changeColor.changeColor)(color, editorAnalyticsApi)(_this.props.editorView.state, _this.props.editorView.dispatch);
|
|
64
58
|
});
|
|
65
59
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "onOpenChange", function (attrs) {
|
|
66
60
|
_this.handleOpenChange({
|
|
@@ -69,7 +63,7 @@ var ToolbarTextColor = exports.ToolbarTextColor = /*#__PURE__*/function (_React$
|
|
|
69
63
|
event: attrs.event
|
|
70
64
|
});
|
|
71
65
|
});
|
|
72
|
-
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "changeTextColor", function (color, disabled) {
|
|
66
|
+
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "changeTextColor", function (color, editorAnalyticsApi, disabled) {
|
|
73
67
|
var _this$toolbarItemRef;
|
|
74
68
|
if (!disabled) {
|
|
75
69
|
var _this$props$editorVie;
|
|
@@ -86,7 +80,7 @@ var ToolbarTextColor = exports.ToolbarTextColor = /*#__PURE__*/function (_React$
|
|
|
86
80
|
isOpen: false,
|
|
87
81
|
logCloseEvent: false
|
|
88
82
|
});
|
|
89
|
-
_this.changeColor(color);
|
|
83
|
+
_this.changeColor(color, editorAnalyticsApi);
|
|
90
84
|
//To set the focus on the textcolor button when the menu is closed by 'Esc' only to meet aria guidelines
|
|
91
85
|
(_this$props$editorVie = _this.props.editorView) === null || _this$props$editorVie === void 0 || _this$props$editorVie.focus();
|
|
92
86
|
}
|
|
@@ -166,7 +160,8 @@ var ToolbarTextColor = exports.ToolbarTextColor = /*#__PURE__*/function (_React$
|
|
|
166
160
|
isReducedSpacing = _this$props.isReducedSpacing,
|
|
167
161
|
pluginState = _this$props.pluginState,
|
|
168
162
|
formatMessage = _this$props.intl.formatMessage,
|
|
169
|
-
disabled = _this$props.disabled
|
|
163
|
+
disabled = _this$props.disabled,
|
|
164
|
+
pluginInjectionApi = _this$props.pluginInjectionApi;
|
|
170
165
|
var labelTextColor = formatMessage(messages.textColor);
|
|
171
166
|
var palette = pluginState.palette;
|
|
172
167
|
var fitWidth;
|
|
@@ -182,7 +177,7 @@ var ToolbarTextColor = exports.ToolbarTextColor = /*#__PURE__*/function (_React$
|
|
|
182
177
|
selectedRowIndex = _getSelectedRowAndCol.selectedRowIndex,
|
|
183
178
|
selectedColumnIndex = _getSelectedRowAndCol.selectedColumnIndex;
|
|
184
179
|
return (0, _react2.jsx)("span", {
|
|
185
|
-
css:
|
|
180
|
+
css: _styles.wrapperStyle
|
|
186
181
|
}, (0, _react2.jsx)(_uiMenu.DropdownContainer, {
|
|
187
182
|
mountTo: popupsMountPoint,
|
|
188
183
|
boundariesElement: popupsBoundariesElement,
|
|
@@ -201,8 +196,8 @@ var ToolbarTextColor = exports.ToolbarTextColor = /*#__PURE__*/function (_React$
|
|
|
201
196
|
isOpenedByKeyboard: isOpenedByKeyboard,
|
|
202
197
|
isPopupPositioned: true
|
|
203
198
|
},
|
|
204
|
-
trigger: (0, _react2.jsx)(
|
|
205
|
-
buttonId:
|
|
199
|
+
trigger: (0, _react2.jsx)(_uiMenu.ToolbarButton, {
|
|
200
|
+
buttonId: _uiMenu.TOOLBAR_BUTTON.TEXT_COLOR,
|
|
206
201
|
spacing: isReducedSpacing ? 'none' : 'default',
|
|
207
202
|
disabled: disabled || pluginState.disabled,
|
|
208
203
|
selected: isOpen,
|
|
@@ -214,11 +209,11 @@ var ToolbarTextColor = exports.ToolbarTextColor = /*#__PURE__*/function (_React$
|
|
|
214
209
|
onKeyDown: this.onKeyDown,
|
|
215
210
|
ref: this.toolbarItemRef,
|
|
216
211
|
iconBefore: (0, _react2.jsx)("div", {
|
|
217
|
-
css:
|
|
212
|
+
css: _styles.triggerWrapperStyles
|
|
218
213
|
}, (0, _react2.jsx)("div", {
|
|
219
|
-
css:
|
|
214
|
+
css: _styles2.textColorIconWrapper
|
|
220
215
|
}, (0, _react2.jsx)(_icon.EditorTextColorIcon, null), (0, _react2.jsx)("div", {
|
|
221
|
-
css: [
|
|
216
|
+
css: [_styles2.textColorIconBar, selectedColor ? "background: ".concat(selectedColor, ";") : pluginState.disabled && _styles2.backgroundDisabled]
|
|
222
217
|
})), (0, _react2.jsx)("span", {
|
|
223
218
|
css: _styles.expandIconWrapperStyle
|
|
224
219
|
}, (0, _react2.jsx)(_chevronDown.default, {
|
|
@@ -227,18 +222,19 @@ var ToolbarTextColor = exports.ToolbarTextColor = /*#__PURE__*/function (_React$
|
|
|
227
222
|
})
|
|
228
223
|
}, (0, _react2.jsx)("div", {
|
|
229
224
|
"data-testid": "text-color-palette"
|
|
230
|
-
}, (0, _react2.jsx)(
|
|
225
|
+
}, (0, _react2.jsx)(_uiColor.ColorPalette, {
|
|
231
226
|
onClick: function onClick(color) {
|
|
232
|
-
|
|
227
|
+
var _pluginInjectionApi$a;
|
|
228
|
+
return _this2.changeTextColor(color, pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$a = pluginInjectionApi.analytics) === null || _pluginInjectionApi$a === void 0 ? void 0 : _pluginInjectionApi$a.actions, pluginState.disabled);
|
|
233
229
|
},
|
|
234
230
|
selectedColor: pluginState.color,
|
|
235
231
|
paletteOptions: {
|
|
236
232
|
palette: palette,
|
|
237
233
|
hexToPaletteColor: _editorPalette.hexToEditorTextPaletteColor,
|
|
238
|
-
paletteColorTooltipMessages:
|
|
234
|
+
paletteColorTooltipMessages: _uiColor.textPaletteTooltipMessages
|
|
239
235
|
}
|
|
240
236
|
}))), (0, _react2.jsx)("span", {
|
|
241
|
-
css:
|
|
237
|
+
css: _styles.separatorStyles
|
|
242
238
|
}));
|
|
243
239
|
}
|
|
244
240
|
}, {
|
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.getDisabledState = void 0;
|
|
7
|
-
var _mark = require("
|
|
7
|
+
var _mark = require("@atlaskit/editor-common/mark");
|
|
8
8
|
var hasLinkMark = function hasLinkMark($pos) {
|
|
9
9
|
var linkMarkType = $pos.doc.type.schema.marks.link,
|
|
10
10
|
pos = $pos.pos;
|
|
@@ -100,7 +100,7 @@ function ToolbarDropdown(props) {
|
|
|
100
100
|
}, (0, _react.jsx)(_bulletList.default, {
|
|
101
101
|
label: labelLists
|
|
102
102
|
}), (0, _react.jsx)("span", {
|
|
103
|
-
css:
|
|
103
|
+
css: _styles2.expandIconWrapperStyle
|
|
104
104
|
}, (0, _react.jsx)(_chevronDown.default, {
|
|
105
105
|
label: ""
|
|
106
106
|
})))
|
package/dist/cjs/ui/styles.js
CHANGED
|
@@ -1,10 +1,8 @@
|
|
|
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
|
-
exports.expandIconWrapperStyle = void 0;
|
|
8
6
|
Object.defineProperty(exports, "scrollbarStyles", {
|
|
9
7
|
enumerable: true,
|
|
10
8
|
get: function get() {
|
|
@@ -17,9 +15,5 @@ Object.defineProperty(exports, "shortcutStyle", {
|
|
|
17
15
|
return _shortcut.shortcutStyle;
|
|
18
16
|
}
|
|
19
17
|
});
|
|
20
|
-
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
21
|
-
var _react = require("@emotion/react");
|
|
22
18
|
var _shortcut = require("@atlaskit/editor-shared-styles/shortcut");
|
|
23
|
-
var _scrollbar = require("@atlaskit/editor-shared-styles/scrollbar");
|
|
24
|
-
var _templateObject;
|
|
25
|
-
var expandIconWrapperStyle = exports.expandIconWrapperStyle = (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n margin-left: -8px;\n"])));
|
|
19
|
+
var _scrollbar = require("@atlaskit/editor-shared-styles/scrollbar");
|
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.version = exports.nextMajorVersion = exports.name = void 0;
|
|
7
7
|
var name = exports.name = "@atlaskit/editor-core";
|
|
8
|
-
var version = exports.version = "188.2.
|
|
8
|
+
var version = exports.version = "188.2.5";
|
|
9
9
|
var nextMajorVersion = exports.nextMajorVersion = function nextMajorVersion() {
|
|
10
10
|
return [Number(version.split('.')[0]) + 1, 0, 0].join('.');
|
|
11
11
|
};
|
|
@@ -5,7 +5,7 @@ import AddIcon from '@atlaskit/icon/glyph/editor/add';
|
|
|
5
5
|
import ExpandIcon from '@atlaskit/icon/glyph/chevron-down';
|
|
6
6
|
import { ToolTipContent } from '../../../../keymaps';
|
|
7
7
|
import ToolbarButton from '../../../../ui/ToolbarButton';
|
|
8
|
-
import { expandIconWrapperStyle } from '
|
|
8
|
+
import { expandIconWrapperStyle } from '@atlaskit/editor-common/styles';
|
|
9
9
|
import { triggerWrapper } from './styles';
|
|
10
10
|
const DropDownButtonIcon = /*#__PURE__*/React.memo(props => jsx("span", {
|
|
11
11
|
css: triggerWrapper
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE
|
|
1
|
+
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE } from '@atlaskit/editor-common/analytics';
|
|
2
|
+
import { withAnalytics } from '@atlaskit/editor-common/editor-analytics';
|
|
2
3
|
import { pluginKey } from '../pm-plugins/main';
|
|
3
4
|
import { getActiveColor } from '../utils/color';
|
|
4
5
|
import { removeColor } from './remove-color';
|
|
@@ -11,7 +12,7 @@ import { toggleColor } from './toggle-color';
|
|
|
11
12
|
* @param palette - Current palette of colors
|
|
12
13
|
* @return Higher order command with analytics logic inside.
|
|
13
14
|
*/
|
|
14
|
-
function createWithColorAnalytics(newColor, previousColor, palette) {
|
|
15
|
+
function createWithColorAnalytics(newColor, previousColor, palette, editorAnalyticsApi) {
|
|
15
16
|
const newColorFromPalette = palette.find(({
|
|
16
17
|
value
|
|
17
18
|
}) => value === newColor);
|
|
@@ -20,7 +21,7 @@ function createWithColorAnalytics(newColor, previousColor, palette) {
|
|
|
20
21
|
}) => value === previousColor);
|
|
21
22
|
const newColorLabel = newColorFromPalette ? newColorFromPalette.label : newColor;
|
|
22
23
|
const previousColorLabel = previousColorFromPalette ? previousColorFromPalette.label : previousColor || '';
|
|
23
|
-
return withAnalytics({
|
|
24
|
+
return withAnalytics(editorAnalyticsApi, {
|
|
24
25
|
action: ACTION.FORMATTED,
|
|
25
26
|
actionSubject: ACTION_SUBJECT.TEXT,
|
|
26
27
|
actionSubjectId: ACTION_SUBJECT_ID.FORMAT_COLOR,
|
|
@@ -31,14 +32,14 @@ function createWithColorAnalytics(newColor, previousColor, palette) {
|
|
|
31
32
|
}
|
|
32
33
|
});
|
|
33
34
|
}
|
|
34
|
-
export const changeColor = color => (state, dispatch) => {
|
|
35
|
+
export const changeColor = (color, editorAnalyticsApi) => (state, dispatch) => {
|
|
35
36
|
const {
|
|
36
37
|
textColor
|
|
37
38
|
} = state.schema.marks;
|
|
38
39
|
if (textColor) {
|
|
39
40
|
const pluginState = pluginKey.getState(state);
|
|
40
41
|
const activeColor = getActiveColor(state);
|
|
41
|
-
const withColorAnalytics = createWithColorAnalytics(color, activeColor, (pluginState === null || pluginState === void 0 ? void 0 : pluginState.palette) || []);
|
|
42
|
+
const withColorAnalytics = createWithColorAnalytics(color, activeColor, (pluginState === null || pluginState === void 0 ? void 0 : pluginState.palette) || [], editorAnalyticsApi);
|
|
42
43
|
if (pluginState !== null && pluginState !== void 0 && pluginState.disabled) {
|
|
43
44
|
return false;
|
|
44
45
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { toggleMark } from '@atlaskit/editor-common/mark';
|
|
2
|
+
import { editorCommandToPMCommand } from '@atlaskit/editor-common/preset';
|
|
2
3
|
import { ACTIONS, pluginKey } from '../pm-plugins/main';
|
|
3
4
|
import { getDisabledState } from '../utils/disabled';
|
|
4
|
-
import { editorCommandToPMCommand } from '@atlaskit/editor-common/preset';
|
|
5
5
|
export const toggleColor = color => (state, dispatch) => {
|
|
6
6
|
const {
|
|
7
7
|
textColor
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { textColor } from '@atlaskit/adf-schema';
|
|
3
|
-
import WithPluginState from '
|
|
3
|
+
import { WithPluginState } from '@atlaskit/editor-common/with-plugin-state';
|
|
4
4
|
import { createPlugin, pluginKey as textColorPluginKey } from './pm-plugins/main';
|
|
5
5
|
import ToolbarTextColor from './ui/ToolbarTextColor';
|
|
6
6
|
const pluginConfig = textColorConfig => {
|
|
@@ -10,7 +10,8 @@ const pluginConfig = textColorConfig => {
|
|
|
10
10
|
return textColorConfig;
|
|
11
11
|
};
|
|
12
12
|
const textColorPlugin = ({
|
|
13
|
-
config: textColorConfig
|
|
13
|
+
config: textColorConfig,
|
|
14
|
+
api
|
|
14
15
|
}) => {
|
|
15
16
|
return {
|
|
16
17
|
name: 'textColor',
|
|
@@ -51,7 +52,8 @@ const textColorPlugin = ({
|
|
|
51
52
|
popupsBoundariesElement: popupsBoundariesElement,
|
|
52
53
|
popupsScrollableElement: popupsScrollableElement,
|
|
53
54
|
dispatchAnalyticsEvent: dispatchAnalyticsEvent,
|
|
54
|
-
disabled: disabled
|
|
55
|
+
disabled: disabled,
|
|
56
|
+
pluginInjectionApi: api
|
|
55
57
|
})
|
|
56
58
|
});
|
|
57
59
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -5,16 +5,15 @@ import { jsx } from '@emotion/react';
|
|
|
5
5
|
import { defineMessages, injectIntl } from 'react-intl-next';
|
|
6
6
|
import { getSelectedRowAndColumnFromPalette } from '@atlaskit/editor-common/ui-color';
|
|
7
7
|
import { ArrowKeyNavigationType } from '@atlaskit/editor-common/ui-menu';
|
|
8
|
+
import { ColorPalette, textPaletteTooltipMessages } from '@atlaskit/editor-common/ui-color';
|
|
9
|
+
import { wrapperStyle, separatorStyles, triggerWrapperStyles } from '@atlaskit/editor-common/styles';
|
|
10
|
+
import { DropdownContainer as Dropdown, ToolbarButton, TOOLBAR_BUTTON } from '@atlaskit/editor-common/ui-menu';
|
|
11
|
+
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE } from '@atlaskit/editor-common/analytics';
|
|
8
12
|
import { hexToEditorTextPaletteColor } from '@atlaskit/editor-palette';
|
|
9
13
|
import { akEditorMenuZIndex } from '@atlaskit/editor-shared-styles';
|
|
10
14
|
import ExpandIcon from '@atlaskit/icon/glyph/chevron-down';
|
|
11
|
-
import
|
|
12
|
-
import {
|
|
13
|
-
import { expandIconWrapperStyle } from '../../../../ui/styles';
|
|
14
|
-
import { wrapperStyle, separatorStyles, triggerWrapperStyles } from '@atlaskit/editor-common/styles';
|
|
15
|
-
import ToolbarButton, { TOOLBAR_BUTTON } from '../../../../ui/ToolbarButton';
|
|
16
|
-
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE } from '../../../analytics';
|
|
17
|
-
import * as commands from '../../commands/change-color';
|
|
15
|
+
import { expandIconWrapperStyle } from '@atlaskit/editor-common/styles';
|
|
16
|
+
import { changeColor as changeColorWithAnalytics } from '../../commands/change-color';
|
|
18
17
|
import { EditorTextColorIcon } from './icon';
|
|
19
18
|
import { backgroundDisabled, textColorIconBar, textColorIconWrapper } from './styles';
|
|
20
19
|
const EXPERIMENT_NAME = 'editor.toolbarTextColor.moreColors';
|
|
@@ -34,7 +33,7 @@ export class ToolbarTextColor extends React.Component {
|
|
|
34
33
|
isOpenedByKeyboard: false
|
|
35
34
|
});
|
|
36
35
|
_defineProperty(this, "toolbarItemRef", /*#__PURE__*/React.createRef());
|
|
37
|
-
_defineProperty(this, "changeColor", color =>
|
|
36
|
+
_defineProperty(this, "changeColor", (color, editorAnalyticsApi) => changeColorWithAnalytics(color, editorAnalyticsApi)(this.props.editorView.state, this.props.editorView.dispatch));
|
|
38
37
|
_defineProperty(this, "onOpenChange", attrs => {
|
|
39
38
|
this.handleOpenChange({
|
|
40
39
|
isOpen: attrs.isOpen,
|
|
@@ -42,7 +41,7 @@ export class ToolbarTextColor extends React.Component {
|
|
|
42
41
|
event: attrs.event
|
|
43
42
|
});
|
|
44
43
|
});
|
|
45
|
-
_defineProperty(this, "changeTextColor", (color, disabled) => {
|
|
44
|
+
_defineProperty(this, "changeTextColor", (color, editorAnalyticsApi, disabled) => {
|
|
46
45
|
var _this$toolbarItemRef, _this$toolbarItemRef$;
|
|
47
46
|
if (!disabled) {
|
|
48
47
|
var _this$props$editorVie;
|
|
@@ -61,7 +60,7 @@ export class ToolbarTextColor extends React.Component {
|
|
|
61
60
|
isOpen: false,
|
|
62
61
|
logCloseEvent: false
|
|
63
62
|
});
|
|
64
|
-
this.changeColor(color);
|
|
63
|
+
this.changeColor(color, editorAnalyticsApi);
|
|
65
64
|
//To set the focus on the textcolor button when the menu is closed by 'Esc' only to meet aria guidelines
|
|
66
65
|
(_this$props$editorVie = this.props.editorView) === null || _this$props$editorVie === void 0 ? void 0 : _this$props$editorVie.focus();
|
|
67
66
|
}
|
|
@@ -143,7 +142,8 @@ export class ToolbarTextColor extends React.Component {
|
|
|
143
142
|
intl: {
|
|
144
143
|
formatMessage
|
|
145
144
|
},
|
|
146
|
-
disabled
|
|
145
|
+
disabled,
|
|
146
|
+
pluginInjectionApi
|
|
147
147
|
} = this.props;
|
|
148
148
|
const labelTextColor = formatMessage(messages.textColor);
|
|
149
149
|
const palette = pluginState.palette;
|
|
@@ -207,7 +207,10 @@ export class ToolbarTextColor extends React.Component {
|
|
|
207
207
|
}, jsx("div", {
|
|
208
208
|
"data-testid": "text-color-palette"
|
|
209
209
|
}, jsx(ColorPalette, {
|
|
210
|
-
onClick: color =>
|
|
210
|
+
onClick: color => {
|
|
211
|
+
var _pluginInjectionApi$a;
|
|
212
|
+
return this.changeTextColor(color, pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$a = pluginInjectionApi.analytics) === null || _pluginInjectionApi$a === void 0 ? void 0 : _pluginInjectionApi$a.actions, pluginState.disabled);
|
|
213
|
+
},
|
|
211
214
|
selectedColor: pluginState.color,
|
|
212
215
|
paletteOptions: {
|
|
213
216
|
palette,
|
|
@@ -7,7 +7,8 @@ import BulletListIcon from '@atlaskit/icon/glyph/editor/bullet-list';
|
|
|
7
7
|
import { toggleBulletList as toggleBulletListKeymap, toggleOrderedList as toggleOrderedListKeymap, indent as toggleIndentKeymap, outdent as toggleOutdentKeymap, tooltip } from '../../../keymaps';
|
|
8
8
|
import { DropdownMenuWithKeyboardNavigation as DropdownMenu } from '@atlaskit/editor-common/ui-menu';
|
|
9
9
|
import ToolbarButton from '../../../ui/ToolbarButton';
|
|
10
|
-
import {
|
|
10
|
+
import { shortcutStyle } from '../../../ui/styles';
|
|
11
|
+
import { expandIconWrapperStyle } from '@atlaskit/editor-common/styles';
|
|
11
12
|
import { wrapperStyle, separatorStyles } from '@atlaskit/editor-common/styles';
|
|
12
13
|
import { listMessages } from '@atlaskit/editor-common/messages';
|
|
13
14
|
import { messages as indentationMessages } from '../../indentation/messages';
|
package/dist/es2019/ui/styles.js
CHANGED
|
@@ -1,6 +1,2 @@
|
|
|
1
|
-
import { css } from '@emotion/react';
|
|
2
1
|
export { shortcutStyle } from '@atlaskit/editor-shared-styles/shortcut';
|
|
3
|
-
export { scrollbarStyles } from '@atlaskit/editor-shared-styles/scrollbar';
|
|
4
|
-
export const expandIconWrapperStyle = css`
|
|
5
|
-
margin-left: -8px;
|
|
6
|
-
`;
|
|
2
|
+
export { scrollbarStyles } from '@atlaskit/editor-shared-styles/scrollbar';
|
|
@@ -5,7 +5,7 @@ import AddIcon from '@atlaskit/icon/glyph/editor/add';
|
|
|
5
5
|
import ExpandIcon from '@atlaskit/icon/glyph/chevron-down';
|
|
6
6
|
import { ToolTipContent } from '../../../../keymaps';
|
|
7
7
|
import ToolbarButton from '../../../../ui/ToolbarButton';
|
|
8
|
-
import { expandIconWrapperStyle } from '
|
|
8
|
+
import { expandIconWrapperStyle } from '@atlaskit/editor-common/styles';
|
|
9
9
|
import { triggerWrapper } from './styles';
|
|
10
10
|
var DropDownButtonIcon = /*#__PURE__*/React.memo(function (props) {
|
|
11
11
|
return jsx("span", {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE
|
|
1
|
+
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE } from '@atlaskit/editor-common/analytics';
|
|
2
|
+
import { withAnalytics } from '@atlaskit/editor-common/editor-analytics';
|
|
2
3
|
import { pluginKey } from '../pm-plugins/main';
|
|
3
4
|
import { getActiveColor } from '../utils/color';
|
|
4
5
|
import { removeColor } from './remove-color';
|
|
@@ -11,7 +12,7 @@ import { toggleColor } from './toggle-color';
|
|
|
11
12
|
* @param palette - Current palette of colors
|
|
12
13
|
* @return Higher order command with analytics logic inside.
|
|
13
14
|
*/
|
|
14
|
-
function createWithColorAnalytics(newColor, previousColor, palette) {
|
|
15
|
+
function createWithColorAnalytics(newColor, previousColor, palette, editorAnalyticsApi) {
|
|
15
16
|
var newColorFromPalette = palette.find(function (_ref) {
|
|
16
17
|
var value = _ref.value;
|
|
17
18
|
return value === newColor;
|
|
@@ -22,7 +23,7 @@ function createWithColorAnalytics(newColor, previousColor, palette) {
|
|
|
22
23
|
});
|
|
23
24
|
var newColorLabel = newColorFromPalette ? newColorFromPalette.label : newColor;
|
|
24
25
|
var previousColorLabel = previousColorFromPalette ? previousColorFromPalette.label : previousColor || '';
|
|
25
|
-
return withAnalytics({
|
|
26
|
+
return withAnalytics(editorAnalyticsApi, {
|
|
26
27
|
action: ACTION.FORMATTED,
|
|
27
28
|
actionSubject: ACTION_SUBJECT.TEXT,
|
|
28
29
|
actionSubjectId: ACTION_SUBJECT_ID.FORMAT_COLOR,
|
|
@@ -33,13 +34,13 @@ function createWithColorAnalytics(newColor, previousColor, palette) {
|
|
|
33
34
|
}
|
|
34
35
|
});
|
|
35
36
|
}
|
|
36
|
-
export var changeColor = function changeColor(color) {
|
|
37
|
+
export var changeColor = function changeColor(color, editorAnalyticsApi) {
|
|
37
38
|
return function (state, dispatch) {
|
|
38
39
|
var textColor = state.schema.marks.textColor;
|
|
39
40
|
if (textColor) {
|
|
40
41
|
var pluginState = pluginKey.getState(state);
|
|
41
42
|
var activeColor = getActiveColor(state);
|
|
42
|
-
var withColorAnalytics = createWithColorAnalytics(color, activeColor, (pluginState === null || pluginState === void 0 ? void 0 : pluginState.palette) || []);
|
|
43
|
+
var withColorAnalytics = createWithColorAnalytics(color, activeColor, (pluginState === null || pluginState === void 0 ? void 0 : pluginState.palette) || [], editorAnalyticsApi);
|
|
43
44
|
if (pluginState !== null && pluginState !== void 0 && pluginState.disabled) {
|
|
44
45
|
return false;
|
|
45
46
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { toggleMark } from '@atlaskit/editor-common/mark';
|
|
2
|
+
import { editorCommandToPMCommand } from '@atlaskit/editor-common/preset';
|
|
2
3
|
import { ACTIONS, pluginKey } from '../pm-plugins/main';
|
|
3
4
|
import { getDisabledState } from '../utils/disabled';
|
|
4
|
-
import { editorCommandToPMCommand } from '@atlaskit/editor-common/preset';
|
|
5
5
|
export var toggleColor = function toggleColor(color) {
|
|
6
6
|
return function (state, dispatch) {
|
|
7
7
|
var textColor = state.schema.marks.textColor;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { textColor } from '@atlaskit/adf-schema';
|
|
3
|
-
import WithPluginState from '
|
|
3
|
+
import { WithPluginState } from '@atlaskit/editor-common/with-plugin-state';
|
|
4
4
|
import { createPlugin, pluginKey as textColorPluginKey } from './pm-plugins/main';
|
|
5
5
|
import ToolbarTextColor from './ui/ToolbarTextColor';
|
|
6
6
|
var pluginConfig = function pluginConfig(textColorConfig) {
|
|
@@ -10,7 +10,8 @@ var pluginConfig = function pluginConfig(textColorConfig) {
|
|
|
10
10
|
return textColorConfig;
|
|
11
11
|
};
|
|
12
12
|
var textColorPlugin = function textColorPlugin(_ref) {
|
|
13
|
-
var textColorConfig = _ref.config
|
|
13
|
+
var textColorConfig = _ref.config,
|
|
14
|
+
api = _ref.api;
|
|
14
15
|
return {
|
|
15
16
|
name: 'textColor',
|
|
16
17
|
marks: function marks() {
|
|
@@ -50,7 +51,8 @@ var textColorPlugin = function textColorPlugin(_ref) {
|
|
|
50
51
|
popupsBoundariesElement: popupsBoundariesElement,
|
|
51
52
|
popupsScrollableElement: popupsScrollableElement,
|
|
52
53
|
dispatchAnalyticsEvent: dispatchAnalyticsEvent,
|
|
53
|
-
disabled: disabled
|
|
54
|
+
disabled: disabled,
|
|
55
|
+
pluginInjectionApi: api
|
|
54
56
|
});
|
|
55
57
|
}
|
|
56
58
|
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -15,16 +15,15 @@ import { jsx } from '@emotion/react';
|
|
|
15
15
|
import { defineMessages, injectIntl } from 'react-intl-next';
|
|
16
16
|
import { getSelectedRowAndColumnFromPalette } from '@atlaskit/editor-common/ui-color';
|
|
17
17
|
import { ArrowKeyNavigationType } from '@atlaskit/editor-common/ui-menu';
|
|
18
|
+
import { ColorPalette, textPaletteTooltipMessages } from '@atlaskit/editor-common/ui-color';
|
|
19
|
+
import { wrapperStyle, separatorStyles, triggerWrapperStyles } from '@atlaskit/editor-common/styles';
|
|
20
|
+
import { DropdownContainer as Dropdown, ToolbarButton, TOOLBAR_BUTTON } from '@atlaskit/editor-common/ui-menu';
|
|
21
|
+
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE } from '@atlaskit/editor-common/analytics';
|
|
18
22
|
import { hexToEditorTextPaletteColor } from '@atlaskit/editor-palette';
|
|
19
23
|
import { akEditorMenuZIndex } from '@atlaskit/editor-shared-styles';
|
|
20
24
|
import ExpandIcon from '@atlaskit/icon/glyph/chevron-down';
|
|
21
|
-
import
|
|
22
|
-
import {
|
|
23
|
-
import { expandIconWrapperStyle } from '../../../../ui/styles';
|
|
24
|
-
import { wrapperStyle, separatorStyles, triggerWrapperStyles } from '@atlaskit/editor-common/styles';
|
|
25
|
-
import ToolbarButton, { TOOLBAR_BUTTON } from '../../../../ui/ToolbarButton';
|
|
26
|
-
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE } from '../../../analytics';
|
|
27
|
-
import * as commands from '../../commands/change-color';
|
|
25
|
+
import { expandIconWrapperStyle } from '@atlaskit/editor-common/styles';
|
|
26
|
+
import { changeColor as changeColorWithAnalytics } from '../../commands/change-color';
|
|
28
27
|
import { EditorTextColorIcon } from './icon';
|
|
29
28
|
import { backgroundDisabled, textColorIconBar, textColorIconWrapper } from './styles';
|
|
30
29
|
var EXPERIMENT_NAME = 'editor.toolbarTextColor.moreColors';
|
|
@@ -51,8 +50,8 @@ export var ToolbarTextColor = /*#__PURE__*/function (_React$Component) {
|
|
|
51
50
|
isOpenedByKeyboard: false
|
|
52
51
|
});
|
|
53
52
|
_defineProperty(_assertThisInitialized(_this), "toolbarItemRef", /*#__PURE__*/React.createRef());
|
|
54
|
-
_defineProperty(_assertThisInitialized(_this), "changeColor", function (color) {
|
|
55
|
-
return
|
|
53
|
+
_defineProperty(_assertThisInitialized(_this), "changeColor", function (color, editorAnalyticsApi) {
|
|
54
|
+
return changeColorWithAnalytics(color, editorAnalyticsApi)(_this.props.editorView.state, _this.props.editorView.dispatch);
|
|
56
55
|
});
|
|
57
56
|
_defineProperty(_assertThisInitialized(_this), "onOpenChange", function (attrs) {
|
|
58
57
|
_this.handleOpenChange({
|
|
@@ -61,7 +60,7 @@ export var ToolbarTextColor = /*#__PURE__*/function (_React$Component) {
|
|
|
61
60
|
event: attrs.event
|
|
62
61
|
});
|
|
63
62
|
});
|
|
64
|
-
_defineProperty(_assertThisInitialized(_this), "changeTextColor", function (color, disabled) {
|
|
63
|
+
_defineProperty(_assertThisInitialized(_this), "changeTextColor", function (color, editorAnalyticsApi, disabled) {
|
|
65
64
|
var _this$toolbarItemRef;
|
|
66
65
|
if (!disabled) {
|
|
67
66
|
var _this$props$editorVie;
|
|
@@ -78,7 +77,7 @@ export var ToolbarTextColor = /*#__PURE__*/function (_React$Component) {
|
|
|
78
77
|
isOpen: false,
|
|
79
78
|
logCloseEvent: false
|
|
80
79
|
});
|
|
81
|
-
_this.changeColor(color);
|
|
80
|
+
_this.changeColor(color, editorAnalyticsApi);
|
|
82
81
|
//To set the focus on the textcolor button when the menu is closed by 'Esc' only to meet aria guidelines
|
|
83
82
|
(_this$props$editorVie = _this.props.editorView) === null || _this$props$editorVie === void 0 || _this$props$editorVie.focus();
|
|
84
83
|
}
|
|
@@ -158,7 +157,8 @@ export var ToolbarTextColor = /*#__PURE__*/function (_React$Component) {
|
|
|
158
157
|
isReducedSpacing = _this$props.isReducedSpacing,
|
|
159
158
|
pluginState = _this$props.pluginState,
|
|
160
159
|
formatMessage = _this$props.intl.formatMessage,
|
|
161
|
-
disabled = _this$props.disabled
|
|
160
|
+
disabled = _this$props.disabled,
|
|
161
|
+
pluginInjectionApi = _this$props.pluginInjectionApi;
|
|
162
162
|
var labelTextColor = formatMessage(messages.textColor);
|
|
163
163
|
var palette = pluginState.palette;
|
|
164
164
|
var fitWidth;
|
|
@@ -221,7 +221,8 @@ export var ToolbarTextColor = /*#__PURE__*/function (_React$Component) {
|
|
|
221
221
|
"data-testid": "text-color-palette"
|
|
222
222
|
}, jsx(ColorPalette, {
|
|
223
223
|
onClick: function onClick(color) {
|
|
224
|
-
|
|
224
|
+
var _pluginInjectionApi$a;
|
|
225
|
+
return _this2.changeTextColor(color, pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$a = pluginInjectionApi.analytics) === null || _pluginInjectionApi$a === void 0 ? void 0 : _pluginInjectionApi$a.actions, pluginState.disabled);
|
|
225
226
|
},
|
|
226
227
|
selectedColor: pluginState.color,
|
|
227
228
|
paletteOptions: {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { isMarkAllowedInRange, isMarkExcluded } from '
|
|
1
|
+
import { isMarkAllowedInRange, isMarkExcluded } from '@atlaskit/editor-common/mark';
|
|
2
2
|
var hasLinkMark = function hasLinkMark($pos) {
|
|
3
3
|
var linkMarkType = $pos.doc.type.schema.marks.link,
|
|
4
4
|
pos = $pos.pos;
|
|
@@ -8,7 +8,8 @@ import BulletListIcon from '@atlaskit/icon/glyph/editor/bullet-list';
|
|
|
8
8
|
import { toggleBulletList as toggleBulletListKeymap, toggleOrderedList as toggleOrderedListKeymap, indent as toggleIndentKeymap, outdent as toggleOutdentKeymap, tooltip } from '../../../keymaps';
|
|
9
9
|
import { DropdownMenuWithKeyboardNavigation as DropdownMenu } from '@atlaskit/editor-common/ui-menu';
|
|
10
10
|
import ToolbarButton from '../../../ui/ToolbarButton';
|
|
11
|
-
import {
|
|
11
|
+
import { shortcutStyle } from '../../../ui/styles';
|
|
12
|
+
import { expandIconWrapperStyle } from '@atlaskit/editor-common/styles';
|
|
12
13
|
import { wrapperStyle, separatorStyles } from '@atlaskit/editor-common/styles';
|
|
13
14
|
import { listMessages } from '@atlaskit/editor-common/messages';
|
|
14
15
|
import { messages as indentationMessages } from '../../indentation/messages';
|
package/dist/esm/ui/styles.js
CHANGED
|
@@ -1,6 +1,2 @@
|
|
|
1
|
-
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
2
|
-
var _templateObject;
|
|
3
|
-
import { css } from '@emotion/react';
|
|
4
1
|
export { shortcutStyle } from '@atlaskit/editor-shared-styles/shortcut';
|
|
5
|
-
export { scrollbarStyles } from '@atlaskit/editor-shared-styles/scrollbar';
|
|
6
|
-
export var expandIconWrapperStyle = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n margin-left: -8px;\n"])));
|
|
2
|
+
export { scrollbarStyles } from '@atlaskit/editor-shared-styles/scrollbar';
|
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
2
|
+
import type { Command } from '@atlaskit/editor-common/types';
|
|
3
|
+
export declare const changeColor: (color: string, editorAnalyticsApi: EditorAnalyticsAPI | undefined) => Command;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { Command } from '
|
|
1
|
+
import type { Command } from '@atlaskit/editor-common/types';
|
|
2
2
|
export declare const removeColor: () => Command;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { Command } from '
|
|
1
|
+
import type { Command } from '@atlaskit/editor-common/types';
|
|
2
2
|
export declare const toggleColor: (color: string) => Command;
|
|
@@ -1,11 +1,7 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type { TextColorPluginConfig, TextColorPluginState } from './pm-plugins/main';
|
|
1
|
+
import type { TextColorPluginState } from './pm-plugins/main';
|
|
3
2
|
import { pluginKey as textColorPluginKey } from './pm-plugins/main';
|
|
4
|
-
type
|
|
5
|
-
declare const textColorPlugin:
|
|
6
|
-
pluginConfiguration: Config | undefined;
|
|
7
|
-
dependencies: [];
|
|
8
|
-
}>;
|
|
3
|
+
import type { TextColorPlugin } from './types';
|
|
4
|
+
declare const textColorPlugin: TextColorPlugin;
|
|
9
5
|
export { textColorPluginKey };
|
|
10
6
|
export type { TextColorPluginState };
|
|
11
7
|
export default textColorPlugin;
|
|
@@ -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 type { Dispatch } from '
|
|
3
|
+
import type { Dispatch } from '@atlaskit/editor-common/event-dispatcher';
|
|
4
4
|
import type { PaletteColor } from '@atlaskit/editor-common/ui-color';
|
|
5
5
|
export { DEFAULT_COLOR } from '../utils/color';
|
|
6
6
|
export type TextColorPluginState = {
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { NextEditorPlugin, OptionalPlugin } from '@atlaskit/editor-common/types';
|
|
2
|
+
import type { AnalyticsPlugin } from '@atlaskit/editor-plugin-analytics';
|
|
3
|
+
import type { TextColorPluginConfig } from './pm-plugins/main';
|
|
4
|
+
type Config = TextColorPluginConfig | boolean;
|
|
5
|
+
export type TextColorPluginDependencies = [OptionalPlugin<AnalyticsPlugin>];
|
|
6
|
+
export type TextColorPlugin = NextEditorPlugin<'textColor', {
|
|
7
|
+
pluginConfiguration: Config | undefined;
|
|
8
|
+
dependencies: TextColorPluginDependencies;
|
|
9
|
+
}>;
|
|
10
|
+
export {};
|
|
@@ -3,8 +3,10 @@ import React from 'react';
|
|
|
3
3
|
import { jsx } from '@emotion/react';
|
|
4
4
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
5
5
|
import type { WrappedComponentProps } from 'react-intl-next';
|
|
6
|
-
import type { DispatchAnalyticsEvent } from '
|
|
6
|
+
import type { DispatchAnalyticsEvent, EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
7
|
+
import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
7
8
|
import type { TextColorPluginState } from '../../pm-plugins/main';
|
|
9
|
+
import type { TextColorPlugin } from '../../types';
|
|
8
10
|
export declare const messages: {
|
|
9
11
|
textColor: {
|
|
10
12
|
id: string;
|
|
@@ -25,11 +27,12 @@ export interface Props {
|
|
|
25
27
|
isReducedSpacing?: boolean;
|
|
26
28
|
dispatchAnalyticsEvent?: DispatchAnalyticsEvent;
|
|
27
29
|
disabled?: boolean;
|
|
30
|
+
pluginInjectionApi: ExtractInjectionAPI<TextColorPlugin> | undefined;
|
|
28
31
|
}
|
|
29
32
|
export declare class ToolbarTextColor extends React.Component<Props & WrappedComponentProps, State> {
|
|
30
33
|
state: State;
|
|
31
34
|
private toolbarItemRef;
|
|
32
|
-
changeColor: (color: string) => boolean;
|
|
35
|
+
changeColor: (color: string, editorAnalyticsApi: EditorAnalyticsAPI | undefined) => boolean;
|
|
33
36
|
render(): jsx.JSX.Element;
|
|
34
37
|
private onOpenChange;
|
|
35
38
|
private changeTextColor;
|
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
2
|
+
import type { Command } from '@atlaskit/editor-common/types';
|
|
3
|
+
export declare const changeColor: (color: string, editorAnalyticsApi: EditorAnalyticsAPI | undefined) => Command;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { Command } from '
|
|
1
|
+
import type { Command } from '@atlaskit/editor-common/types';
|
|
2
2
|
export declare const removeColor: () => Command;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { Command } from '
|
|
1
|
+
import type { Command } from '@atlaskit/editor-common/types';
|
|
2
2
|
export declare const toggleColor: (color: string) => Command;
|
|
@@ -1,12 +1,7 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type { TextColorPluginConfig, TextColorPluginState } from './pm-plugins/main';
|
|
1
|
+
import type { TextColorPluginState } from './pm-plugins/main';
|
|
3
2
|
import { pluginKey as textColorPluginKey } from './pm-plugins/main';
|
|
4
|
-
type
|
|
5
|
-
declare const textColorPlugin:
|
|
6
|
-
pluginConfiguration: Config | undefined;
|
|
7
|
-
dependencies: [
|
|
8
|
-
];
|
|
9
|
-
}>;
|
|
3
|
+
import type { TextColorPlugin } from './types';
|
|
4
|
+
declare const textColorPlugin: TextColorPlugin;
|
|
10
5
|
export { textColorPluginKey };
|
|
11
6
|
export type { TextColorPluginState };
|
|
12
7
|
export default textColorPlugin;
|
|
@@ -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 type { Dispatch } from '
|
|
3
|
+
import type { Dispatch } from '@atlaskit/editor-common/event-dispatcher';
|
|
4
4
|
import type { PaletteColor } from '@atlaskit/editor-common/ui-color';
|
|
5
5
|
export { DEFAULT_COLOR } from '../utils/color';
|
|
6
6
|
export type TextColorPluginState = {
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { NextEditorPlugin, OptionalPlugin } from '@atlaskit/editor-common/types';
|
|
2
|
+
import type { AnalyticsPlugin } from '@atlaskit/editor-plugin-analytics';
|
|
3
|
+
import type { TextColorPluginConfig } from './pm-plugins/main';
|
|
4
|
+
type Config = TextColorPluginConfig | boolean;
|
|
5
|
+
export type TextColorPluginDependencies = [
|
|
6
|
+
OptionalPlugin<AnalyticsPlugin>
|
|
7
|
+
];
|
|
8
|
+
export type TextColorPlugin = NextEditorPlugin<'textColor', {
|
|
9
|
+
pluginConfiguration: Config | undefined;
|
|
10
|
+
dependencies: TextColorPluginDependencies;
|
|
11
|
+
}>;
|
|
12
|
+
export {};
|
|
@@ -3,8 +3,10 @@ import React from 'react';
|
|
|
3
3
|
import { jsx } from '@emotion/react';
|
|
4
4
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
5
5
|
import type { WrappedComponentProps } from 'react-intl-next';
|
|
6
|
-
import type { DispatchAnalyticsEvent } from '
|
|
6
|
+
import type { DispatchAnalyticsEvent, EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
7
|
+
import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
7
8
|
import type { TextColorPluginState } from '../../pm-plugins/main';
|
|
9
|
+
import type { TextColorPlugin } from '../../types';
|
|
8
10
|
export declare const messages: {
|
|
9
11
|
textColor: {
|
|
10
12
|
id: string;
|
|
@@ -25,11 +27,12 @@ export interface Props {
|
|
|
25
27
|
isReducedSpacing?: boolean;
|
|
26
28
|
dispatchAnalyticsEvent?: DispatchAnalyticsEvent;
|
|
27
29
|
disabled?: boolean;
|
|
30
|
+
pluginInjectionApi: ExtractInjectionAPI<TextColorPlugin> | undefined;
|
|
28
31
|
}
|
|
29
32
|
export declare class ToolbarTextColor extends React.Component<Props & WrappedComponentProps, State> {
|
|
30
33
|
state: State;
|
|
31
34
|
private toolbarItemRef;
|
|
32
|
-
changeColor: (color: string) => boolean;
|
|
35
|
+
changeColor: (color: string, editorAnalyticsApi: EditorAnalyticsAPI | undefined) => boolean;
|
|
33
36
|
render(): jsx.JSX.Element;
|
|
34
37
|
private onOpenChange;
|
|
35
38
|
private changeTextColor;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-core",
|
|
3
|
-
"version": "188.2.
|
|
3
|
+
"version": "188.2.5",
|
|
4
4
|
"description": "A package contains Atlassian editor core functionality",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
"@atlaskit/code": "^14.6.0",
|
|
56
56
|
"@atlaskit/date": "^0.10.0",
|
|
57
57
|
"@atlaskit/datetime-picker": "^12.10.0",
|
|
58
|
-
"@atlaskit/editor-common": "^76.
|
|
58
|
+
"@atlaskit/editor-common": "^76.4.0",
|
|
59
59
|
"@atlaskit/editor-json-transformer": "^8.10.0",
|
|
60
60
|
"@atlaskit/editor-markdown-transformer": "^5.2.5",
|
|
61
61
|
"@atlaskit/editor-palette": "1.5.1",
|
package/dist/cjs/utils/mark.js
DELETED
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.isMarkExcluded = exports.isMarkAllowedInRange = void 0;
|
|
7
|
-
var isMarkAllowedInRange = exports.isMarkAllowedInRange = function isMarkAllowedInRange(doc, ranges, type) {
|
|
8
|
-
var _loop = function _loop() {
|
|
9
|
-
var _ranges$i = ranges[i],
|
|
10
|
-
$from = _ranges$i.$from,
|
|
11
|
-
$to = _ranges$i.$to;
|
|
12
|
-
var can = $from.depth === 0 ? doc.type.allowsMarkType(type) : false;
|
|
13
|
-
doc.nodesBetween($from.pos, $to.pos, function (node) {
|
|
14
|
-
if (can) {
|
|
15
|
-
return false;
|
|
16
|
-
}
|
|
17
|
-
can = node.inlineContent && node.type.allowsMarkType(type);
|
|
18
|
-
return;
|
|
19
|
-
});
|
|
20
|
-
if (can) {
|
|
21
|
-
return {
|
|
22
|
-
v: can
|
|
23
|
-
};
|
|
24
|
-
}
|
|
25
|
-
},
|
|
26
|
-
_ret;
|
|
27
|
-
for (var i = 0; i < ranges.length; i++) {
|
|
28
|
-
_ret = _loop();
|
|
29
|
-
if (_ret) return _ret.v;
|
|
30
|
-
}
|
|
31
|
-
return false;
|
|
32
|
-
};
|
|
33
|
-
var isMarkExcluded = exports.isMarkExcluded = function isMarkExcluded(type, marks) {
|
|
34
|
-
if (marks) {
|
|
35
|
-
return marks.some(function (mark) {
|
|
36
|
-
return mark.type !== type && mark.type.excludes(type);
|
|
37
|
-
});
|
|
38
|
-
}
|
|
39
|
-
return false;
|
|
40
|
-
};
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
export const isMarkAllowedInRange = (doc, ranges, type) => {
|
|
2
|
-
for (let i = 0; i < ranges.length; i++) {
|
|
3
|
-
const {
|
|
4
|
-
$from,
|
|
5
|
-
$to
|
|
6
|
-
} = ranges[i];
|
|
7
|
-
let can = $from.depth === 0 ? doc.type.allowsMarkType(type) : false;
|
|
8
|
-
doc.nodesBetween($from.pos, $to.pos, node => {
|
|
9
|
-
if (can) {
|
|
10
|
-
return false;
|
|
11
|
-
}
|
|
12
|
-
can = node.inlineContent && node.type.allowsMarkType(type);
|
|
13
|
-
return;
|
|
14
|
-
});
|
|
15
|
-
if (can) {
|
|
16
|
-
return can;
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
return false;
|
|
20
|
-
};
|
|
21
|
-
export const isMarkExcluded = (type, marks) => {
|
|
22
|
-
if (marks) {
|
|
23
|
-
return marks.some(mark => mark.type !== type && mark.type.excludes(type));
|
|
24
|
-
}
|
|
25
|
-
return false;
|
|
26
|
-
};
|
package/dist/esm/utils/mark.js
DELETED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
export var isMarkAllowedInRange = function isMarkAllowedInRange(doc, ranges, type) {
|
|
2
|
-
var _loop = function _loop() {
|
|
3
|
-
var _ranges$i = ranges[i],
|
|
4
|
-
$from = _ranges$i.$from,
|
|
5
|
-
$to = _ranges$i.$to;
|
|
6
|
-
var can = $from.depth === 0 ? doc.type.allowsMarkType(type) : false;
|
|
7
|
-
doc.nodesBetween($from.pos, $to.pos, function (node) {
|
|
8
|
-
if (can) {
|
|
9
|
-
return false;
|
|
10
|
-
}
|
|
11
|
-
can = node.inlineContent && node.type.allowsMarkType(type);
|
|
12
|
-
return;
|
|
13
|
-
});
|
|
14
|
-
if (can) {
|
|
15
|
-
return {
|
|
16
|
-
v: can
|
|
17
|
-
};
|
|
18
|
-
}
|
|
19
|
-
},
|
|
20
|
-
_ret;
|
|
21
|
-
for (var i = 0; i < ranges.length; i++) {
|
|
22
|
-
_ret = _loop();
|
|
23
|
-
if (_ret) return _ret.v;
|
|
24
|
-
}
|
|
25
|
-
return false;
|
|
26
|
-
};
|
|
27
|
-
export var isMarkExcluded = function isMarkExcluded(type, marks) {
|
|
28
|
-
if (marks) {
|
|
29
|
-
return marks.some(function (mark) {
|
|
30
|
-
return mark.type !== type && mark.type.excludes(type);
|
|
31
|
-
});
|
|
32
|
-
}
|
|
33
|
-
return false;
|
|
34
|
-
};
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import type { Node, Mark, MarkType } from '@atlaskit/editor-prosemirror/model';
|
|
2
|
-
import type { SelectionRange } from '@atlaskit/editor-prosemirror/state';
|
|
3
|
-
export declare const isMarkAllowedInRange: (doc: Node, ranges: readonly SelectionRange[], type: MarkType) => boolean;
|
|
4
|
-
export declare const isMarkExcluded: (type: MarkType, marks?: readonly Mark[] | null) => boolean;
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import type { Node, Mark, MarkType } from '@atlaskit/editor-prosemirror/model';
|
|
2
|
-
import type { SelectionRange } from '@atlaskit/editor-prosemirror/state';
|
|
3
|
-
export declare const isMarkAllowedInRange: (doc: Node, ranges: readonly SelectionRange[], type: MarkType) => boolean;
|
|
4
|
-
export declare const isMarkExcluded: (type: MarkType, marks?: readonly Mark[] | null) => boolean;
|