@atlaskit/editor-plugin-text-color 1.3.3 → 1.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +15 -0
- package/dist/cjs/plugin.js +29 -21
- package/dist/cjs/ui/ToolbarTextColor/index.js +2 -3
- package/dist/es2019/plugin.js +28 -20
- package/dist/es2019/ui/ToolbarTextColor/index.js +2 -3
- package/dist/esm/plugin.js +29 -21
- package/dist/esm/ui/ToolbarTextColor/index.js +2 -3
- package/dist/types/types.d.ts +2 -2
- package/dist/types-ts4.5/types.d.ts +2 -2
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-text-color
|
|
2
2
|
|
|
3
|
+
## 1.4.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#101406](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/101406)
|
|
8
|
+
[`6daffd65aec4`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/6daffd65aec4) -
|
|
9
|
+
[ED-23298] Extract primary toolbar components to editor plugin to allow for custom ordering
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [#102478](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/102478)
|
|
14
|
+
[`3378951608b0`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/3378951608b0) -
|
|
15
|
+
[ED-23332] Update adf-schema package to 36.10.1
|
|
16
|
+
- Updated dependencies
|
|
17
|
+
|
|
3
18
|
## 1.3.3
|
|
4
19
|
|
|
5
20
|
### Patch Changes
|
package/dist/cjs/plugin.js
CHANGED
|
@@ -25,6 +25,25 @@ var pluginConfig = function pluginConfig(textColorConfig) {
|
|
|
25
25
|
var textColorPlugin = exports.textColorPlugin = function textColorPlugin(_ref) {
|
|
26
26
|
var textColorConfig = _ref.config,
|
|
27
27
|
api = _ref.api;
|
|
28
|
+
var primaryToolbarComponent = function primaryToolbarComponent(_ref2) {
|
|
29
|
+
var editorView = _ref2.editorView,
|
|
30
|
+
popupsMountPoint = _ref2.popupsMountPoint,
|
|
31
|
+
popupsBoundariesElement = _ref2.popupsBoundariesElement,
|
|
32
|
+
popupsScrollableElement = _ref2.popupsScrollableElement,
|
|
33
|
+
isToolbarReducedSpacing = _ref2.isToolbarReducedSpacing,
|
|
34
|
+
dispatchAnalyticsEvent = _ref2.dispatchAnalyticsEvent,
|
|
35
|
+
disabled = _ref2.disabled;
|
|
36
|
+
return /*#__PURE__*/_react.default.createElement(_PrimaryToolbarComponent.PrimaryToolbarComponent, {
|
|
37
|
+
isReducedSpacing: isToolbarReducedSpacing,
|
|
38
|
+
editorView: editorView,
|
|
39
|
+
popupsMountPoint: popupsMountPoint,
|
|
40
|
+
popupsBoundariesElement: popupsBoundariesElement,
|
|
41
|
+
popupsScrollableElement: popupsScrollableElement,
|
|
42
|
+
dispatchAnalyticsEvent: dispatchAnalyticsEvent,
|
|
43
|
+
disabled: disabled,
|
|
44
|
+
api: api
|
|
45
|
+
});
|
|
46
|
+
};
|
|
28
47
|
return {
|
|
29
48
|
name: 'textColor',
|
|
30
49
|
marks: function marks() {
|
|
@@ -36,8 +55,8 @@ var textColorPlugin = exports.textColorPlugin = function textColorPlugin(_ref) {
|
|
|
36
55
|
pmPlugins: function pmPlugins() {
|
|
37
56
|
return [{
|
|
38
57
|
name: 'textColor',
|
|
39
|
-
plugin: function plugin(
|
|
40
|
-
var dispatch =
|
|
58
|
+
plugin: function plugin(_ref3) {
|
|
59
|
+
var dispatch = _ref3.dispatch;
|
|
41
60
|
return (0, _main.createPlugin)(dispatch, pluginConfig(textColorConfig));
|
|
42
61
|
}
|
|
43
62
|
}];
|
|
@@ -54,24 +73,13 @@ var textColorPlugin = exports.textColorPlugin = function textColorPlugin(_ref) {
|
|
|
54
73
|
return (0, _changeColor2.changeColor)(color, api === null || api === void 0 || (_api$analytics = api.analytics) === null || _api$analytics === void 0 ? void 0 : _api$analytics.actions);
|
|
55
74
|
}
|
|
56
75
|
},
|
|
57
|
-
|
|
58
|
-
var
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
return /*#__PURE__*/_react.default.createElement(_PrimaryToolbarComponent.PrimaryToolbarComponent, {
|
|
66
|
-
isReducedSpacing: isToolbarReducedSpacing,
|
|
67
|
-
editorView: editorView,
|
|
68
|
-
popupsMountPoint: popupsMountPoint,
|
|
69
|
-
popupsBoundariesElement: popupsBoundariesElement,
|
|
70
|
-
popupsScrollableElement: popupsScrollableElement,
|
|
71
|
-
dispatchAnalyticsEvent: dispatchAnalyticsEvent,
|
|
72
|
-
disabled: disabled,
|
|
73
|
-
api: api
|
|
74
|
-
});
|
|
75
|
-
}
|
|
76
|
+
usePluginHook: function usePluginHook() {
|
|
77
|
+
var _api$core, _api$primaryToolbar;
|
|
78
|
+
api === null || api === void 0 || (_api$core = api.core) === null || _api$core === void 0 || _api$core.actions.execute(api === null || api === void 0 || (_api$primaryToolbar = api.primaryToolbar) === null || _api$primaryToolbar === void 0 ? void 0 : _api$primaryToolbar.commands.registerComponent({
|
|
79
|
+
name: 'textColor',
|
|
80
|
+
component: primaryToolbarComponent
|
|
81
|
+
}));
|
|
82
|
+
},
|
|
83
|
+
primaryToolbarComponent: !(api !== null && api !== void 0 && api.primaryToolbar) ? primaryToolbarComponent : undefined
|
|
76
84
|
};
|
|
77
85
|
};
|
|
@@ -226,9 +226,8 @@ var ToolbarTextColor = exports.ToolbarTextColor = /*#__PURE__*/function (_React$
|
|
|
226
226
|
hexToPaletteColor: _editorPalette.hexToEditorTextPaletteColor,
|
|
227
227
|
paletteColorTooltipMessages: _uiColor.textPaletteTooltipMessages
|
|
228
228
|
}
|
|
229
|
-
}))),
|
|
230
|
-
|
|
231
|
-
!(pluginInjectionApi !== null && pluginInjectionApi !== void 0 && pluginInjectionApi.highlight) && (0, _react2.jsx)("span", {
|
|
229
|
+
}))), !(pluginInjectionApi !== null && pluginInjectionApi !== void 0 && pluginInjectionApi.primaryToolbar) && /* eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage */
|
|
230
|
+
(0, _react2.jsx)("span", {
|
|
232
231
|
css: _styles.separatorStyles
|
|
233
232
|
}))
|
|
234
233
|
);
|
package/dist/es2019/plugin.js
CHANGED
|
@@ -13,6 +13,26 @@ export const textColorPlugin = ({
|
|
|
13
13
|
config: textColorConfig,
|
|
14
14
|
api
|
|
15
15
|
}) => {
|
|
16
|
+
const primaryToolbarComponent = ({
|
|
17
|
+
editorView,
|
|
18
|
+
popupsMountPoint,
|
|
19
|
+
popupsBoundariesElement,
|
|
20
|
+
popupsScrollableElement,
|
|
21
|
+
isToolbarReducedSpacing,
|
|
22
|
+
dispatchAnalyticsEvent,
|
|
23
|
+
disabled
|
|
24
|
+
}) => {
|
|
25
|
+
return /*#__PURE__*/React.createElement(PrimaryToolbarComponent, {
|
|
26
|
+
isReducedSpacing: isToolbarReducedSpacing,
|
|
27
|
+
editorView: editorView,
|
|
28
|
+
popupsMountPoint: popupsMountPoint,
|
|
29
|
+
popupsBoundariesElement: popupsBoundariesElement,
|
|
30
|
+
popupsScrollableElement: popupsScrollableElement,
|
|
31
|
+
dispatchAnalyticsEvent: dispatchAnalyticsEvent,
|
|
32
|
+
disabled: disabled,
|
|
33
|
+
api: api
|
|
34
|
+
});
|
|
35
|
+
};
|
|
16
36
|
return {
|
|
17
37
|
name: 'textColor',
|
|
18
38
|
marks() {
|
|
@@ -41,26 +61,14 @@ export const textColorPlugin = ({
|
|
|
41
61
|
return changeColor(color, api === null || api === void 0 ? void 0 : (_api$analytics = api.analytics) === null || _api$analytics === void 0 ? void 0 : _api$analytics.actions);
|
|
42
62
|
}
|
|
43
63
|
},
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
}) {
|
|
53
|
-
return /*#__PURE__*/React.createElement(PrimaryToolbarComponent, {
|
|
54
|
-
isReducedSpacing: isToolbarReducedSpacing,
|
|
55
|
-
editorView: editorView,
|
|
56
|
-
popupsMountPoint: popupsMountPoint,
|
|
57
|
-
popupsBoundariesElement: popupsBoundariesElement,
|
|
58
|
-
popupsScrollableElement: popupsScrollableElement,
|
|
59
|
-
dispatchAnalyticsEvent: dispatchAnalyticsEvent,
|
|
60
|
-
disabled: disabled,
|
|
61
|
-
api: api
|
|
62
|
-
});
|
|
63
|
-
}
|
|
64
|
+
usePluginHook: () => {
|
|
65
|
+
var _api$core, _api$primaryToolbar;
|
|
66
|
+
api === null || api === void 0 ? void 0 : (_api$core = api.core) === null || _api$core === void 0 ? void 0 : _api$core.actions.execute(api === null || api === void 0 ? void 0 : (_api$primaryToolbar = api.primaryToolbar) === null || _api$primaryToolbar === void 0 ? void 0 : _api$primaryToolbar.commands.registerComponent({
|
|
67
|
+
name: 'textColor',
|
|
68
|
+
component: primaryToolbarComponent
|
|
69
|
+
}));
|
|
70
|
+
},
|
|
71
|
+
primaryToolbarComponent: !(api !== null && api !== void 0 && api.primaryToolbar) ? primaryToolbarComponent : undefined
|
|
64
72
|
};
|
|
65
73
|
};
|
|
66
74
|
export { textColorPluginKey };
|
|
@@ -205,9 +205,8 @@ export class ToolbarTextColor extends React.Component {
|
|
|
205
205
|
hexToPaletteColor: hexToEditorTextPaletteColor,
|
|
206
206
|
paletteColorTooltipMessages: textPaletteTooltipMessages
|
|
207
207
|
}
|
|
208
|
-
}))),
|
|
209
|
-
|
|
210
|
-
!(pluginInjectionApi !== null && pluginInjectionApi !== void 0 && pluginInjectionApi.highlight) && jsx("span", {
|
|
208
|
+
}))), !(pluginInjectionApi !== null && pluginInjectionApi !== void 0 && pluginInjectionApi.primaryToolbar) && /* eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage */
|
|
209
|
+
jsx("span", {
|
|
211
210
|
css: separatorStyles
|
|
212
211
|
}))
|
|
213
212
|
);
|
package/dist/esm/plugin.js
CHANGED
|
@@ -12,6 +12,25 @@ var pluginConfig = function pluginConfig(textColorConfig) {
|
|
|
12
12
|
export var textColorPlugin = function textColorPlugin(_ref) {
|
|
13
13
|
var textColorConfig = _ref.config,
|
|
14
14
|
api = _ref.api;
|
|
15
|
+
var primaryToolbarComponent = function primaryToolbarComponent(_ref2) {
|
|
16
|
+
var editorView = _ref2.editorView,
|
|
17
|
+
popupsMountPoint = _ref2.popupsMountPoint,
|
|
18
|
+
popupsBoundariesElement = _ref2.popupsBoundariesElement,
|
|
19
|
+
popupsScrollableElement = _ref2.popupsScrollableElement,
|
|
20
|
+
isToolbarReducedSpacing = _ref2.isToolbarReducedSpacing,
|
|
21
|
+
dispatchAnalyticsEvent = _ref2.dispatchAnalyticsEvent,
|
|
22
|
+
disabled = _ref2.disabled;
|
|
23
|
+
return /*#__PURE__*/React.createElement(PrimaryToolbarComponent, {
|
|
24
|
+
isReducedSpacing: isToolbarReducedSpacing,
|
|
25
|
+
editorView: editorView,
|
|
26
|
+
popupsMountPoint: popupsMountPoint,
|
|
27
|
+
popupsBoundariesElement: popupsBoundariesElement,
|
|
28
|
+
popupsScrollableElement: popupsScrollableElement,
|
|
29
|
+
dispatchAnalyticsEvent: dispatchAnalyticsEvent,
|
|
30
|
+
disabled: disabled,
|
|
31
|
+
api: api
|
|
32
|
+
});
|
|
33
|
+
};
|
|
15
34
|
return {
|
|
16
35
|
name: 'textColor',
|
|
17
36
|
marks: function marks() {
|
|
@@ -23,8 +42,8 @@ export var textColorPlugin = function textColorPlugin(_ref) {
|
|
|
23
42
|
pmPlugins: function pmPlugins() {
|
|
24
43
|
return [{
|
|
25
44
|
name: 'textColor',
|
|
26
|
-
plugin: function plugin(
|
|
27
|
-
var dispatch =
|
|
45
|
+
plugin: function plugin(_ref3) {
|
|
46
|
+
var dispatch = _ref3.dispatch;
|
|
28
47
|
return createPlugin(dispatch, pluginConfig(textColorConfig));
|
|
29
48
|
}
|
|
30
49
|
}];
|
|
@@ -41,25 +60,14 @@ export var textColorPlugin = function textColorPlugin(_ref) {
|
|
|
41
60
|
return _changeColor(color, api === null || api === void 0 || (_api$analytics = api.analytics) === null || _api$analytics === void 0 ? void 0 : _api$analytics.actions);
|
|
42
61
|
}
|
|
43
62
|
},
|
|
44
|
-
|
|
45
|
-
var
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
return /*#__PURE__*/React.createElement(PrimaryToolbarComponent, {
|
|
53
|
-
isReducedSpacing: isToolbarReducedSpacing,
|
|
54
|
-
editorView: editorView,
|
|
55
|
-
popupsMountPoint: popupsMountPoint,
|
|
56
|
-
popupsBoundariesElement: popupsBoundariesElement,
|
|
57
|
-
popupsScrollableElement: popupsScrollableElement,
|
|
58
|
-
dispatchAnalyticsEvent: dispatchAnalyticsEvent,
|
|
59
|
-
disabled: disabled,
|
|
60
|
-
api: api
|
|
61
|
-
});
|
|
62
|
-
}
|
|
63
|
+
usePluginHook: function usePluginHook() {
|
|
64
|
+
var _api$core, _api$primaryToolbar;
|
|
65
|
+
api === null || api === void 0 || (_api$core = api.core) === null || _api$core === void 0 || _api$core.actions.execute(api === null || api === void 0 || (_api$primaryToolbar = api.primaryToolbar) === null || _api$primaryToolbar === void 0 ? void 0 : _api$primaryToolbar.commands.registerComponent({
|
|
66
|
+
name: 'textColor',
|
|
67
|
+
component: primaryToolbarComponent
|
|
68
|
+
}));
|
|
69
|
+
},
|
|
70
|
+
primaryToolbarComponent: !(api !== null && api !== void 0 && api.primaryToolbar) ? primaryToolbarComponent : undefined
|
|
63
71
|
};
|
|
64
72
|
};
|
|
65
73
|
export { textColorPluginKey };
|
|
@@ -220,9 +220,8 @@ export var ToolbarTextColor = /*#__PURE__*/function (_React$Component) {
|
|
|
220
220
|
hexToPaletteColor: hexToEditorTextPaletteColor,
|
|
221
221
|
paletteColorTooltipMessages: textPaletteTooltipMessages
|
|
222
222
|
}
|
|
223
|
-
}))),
|
|
224
|
-
|
|
225
|
-
!(pluginInjectionApi !== null && pluginInjectionApi !== void 0 && pluginInjectionApi.highlight) && jsx("span", {
|
|
223
|
+
}))), !(pluginInjectionApi !== null && pluginInjectionApi !== void 0 && pluginInjectionApi.primaryToolbar) && /* eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage */
|
|
224
|
+
jsx("span", {
|
|
226
225
|
css: separatorStyles
|
|
227
226
|
}))
|
|
228
227
|
);
|
package/dist/types/types.d.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import type { Command, NextEditorPlugin, OptionalPlugin } from '@atlaskit/editor-common/types';
|
|
2
2
|
import type { AnalyticsPlugin } from '@atlaskit/editor-plugin-analytics';
|
|
3
|
-
import type {
|
|
3
|
+
import type { PrimaryToolbarPlugin } from '@atlaskit/editor-plugin-primary-toolbar';
|
|
4
4
|
import type { TextColorPluginConfig, TextColorPluginState } from './pm-plugins/main';
|
|
5
5
|
type Config = TextColorPluginConfig | boolean;
|
|
6
6
|
export type TextColorPlugin = NextEditorPlugin<'textColor', {
|
|
7
7
|
pluginConfiguration: Config | undefined;
|
|
8
8
|
dependencies: [
|
|
9
9
|
OptionalPlugin<AnalyticsPlugin>,
|
|
10
|
-
OptionalPlugin<
|
|
10
|
+
OptionalPlugin<PrimaryToolbarPlugin>
|
|
11
11
|
];
|
|
12
12
|
actions: {
|
|
13
13
|
changeColor: (color: string) => Command;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import type { Command, NextEditorPlugin, OptionalPlugin } from '@atlaskit/editor-common/types';
|
|
2
2
|
import type { AnalyticsPlugin } from '@atlaskit/editor-plugin-analytics';
|
|
3
|
-
import type {
|
|
3
|
+
import type { PrimaryToolbarPlugin } from '@atlaskit/editor-plugin-primary-toolbar';
|
|
4
4
|
import type { TextColorPluginConfig, TextColorPluginState } from './pm-plugins/main';
|
|
5
5
|
type Config = TextColorPluginConfig | boolean;
|
|
6
6
|
export type TextColorPlugin = NextEditorPlugin<'textColor', {
|
|
7
7
|
pluginConfiguration: Config | undefined;
|
|
8
8
|
dependencies: [
|
|
9
9
|
OptionalPlugin<AnalyticsPlugin>,
|
|
10
|
-
OptionalPlugin<
|
|
10
|
+
OptionalPlugin<PrimaryToolbarPlugin>
|
|
11
11
|
];
|
|
12
12
|
actions: {
|
|
13
13
|
changeColor: (color: string) => Command;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-text-color",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.4.0",
|
|
4
4
|
"description": "Text color plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -33,11 +33,11 @@
|
|
|
33
33
|
".": "./src/index.ts"
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@atlaskit/adf-schema": "^36.
|
|
37
|
-
"@atlaskit/editor-common": "^
|
|
36
|
+
"@atlaskit/adf-schema": "^36.10.7",
|
|
37
|
+
"@atlaskit/editor-common": "^81.0.0",
|
|
38
38
|
"@atlaskit/editor-palette": "1.6.0",
|
|
39
39
|
"@atlaskit/editor-plugin-analytics": "^1.2.0",
|
|
40
|
-
"@atlaskit/editor-plugin-
|
|
40
|
+
"@atlaskit/editor-plugin-primary-toolbar": "^1.1.0",
|
|
41
41
|
"@atlaskit/editor-prosemirror": "4.0.1",
|
|
42
42
|
"@atlaskit/editor-shared-styles": "^2.11.0",
|
|
43
43
|
"@atlaskit/editor-tables": "^2.7.0",
|