@atlaskit/editor-plugin-text-color 0.1.6 → 0.1.7
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
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-text-color
|
|
2
2
|
|
|
3
|
+
## 0.1.7
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#58763](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/58763) [`0fdbd64522bf`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/0fdbd64522bf) - update ADF schema
|
|
8
|
+
|
|
3
9
|
## 0.1.6
|
|
4
10
|
|
|
5
11
|
### Patch Changes
|
|
@@ -13,7 +13,6 @@ var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime
|
|
|
13
13
|
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
14
14
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
15
15
|
var _react = _interopRequireDefault(require("react"));
|
|
16
|
-
var _react2 = require("@emotion/react");
|
|
17
16
|
var _reactIntlNext = require("react-intl-next");
|
|
18
17
|
var _analytics = require("@atlaskit/editor-common/analytics");
|
|
19
18
|
var _styles = require("@atlaskit/editor-common/styles");
|
|
@@ -28,7 +27,7 @@ var _styles2 = require("./styles");
|
|
|
28
27
|
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; }
|
|
29
28
|
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; }
|
|
30
29
|
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); }; }
|
|
31
|
-
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
30
|
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
32
31
|
var EXPERIMENT_NAME = 'editor.toolbarTextColor.moreColors';
|
|
33
32
|
var EXPERIMENT_GROUP_CONTROL = 'control';
|
|
34
33
|
var messages = exports.messages = (0, _reactIntlNext.defineMessages)({
|
|
@@ -176,10 +175,11 @@ var ToolbarTextColor = exports.ToolbarTextColor = /*#__PURE__*/function (_React$
|
|
|
176
175
|
selectedRowIndex = _getSelectedRowAndCol.selectedRowIndex,
|
|
177
176
|
selectedColumnIndex = _getSelectedRowAndCol.selectedColumnIndex;
|
|
178
177
|
return (
|
|
178
|
+
/*#__PURE__*/
|
|
179
179
|
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
|
|
180
|
-
|
|
180
|
+
_react.default.createElement("span", {
|
|
181
181
|
css: _styles.wrapperStyle
|
|
182
|
-
},
|
|
182
|
+
}, /*#__PURE__*/_react.default.createElement(_uiMenu.DropdownContainer, {
|
|
183
183
|
mountTo: popupsMountPoint,
|
|
184
184
|
boundariesElement: popupsBoundariesElement,
|
|
185
185
|
scrollableElement: popupsScrollableElement,
|
|
@@ -197,7 +197,7 @@ var ToolbarTextColor = exports.ToolbarTextColor = /*#__PURE__*/function (_React$
|
|
|
197
197
|
isOpenedByKeyboard: isOpenedByKeyboard,
|
|
198
198
|
isPopupPositioned: true
|
|
199
199
|
},
|
|
200
|
-
trigger:
|
|
200
|
+
trigger: /*#__PURE__*/_react.default.createElement(_uiMenu.ToolbarButton, {
|
|
201
201
|
buttonId: _uiMenu.TOOLBAR_BUTTON.TEXT_COLOR,
|
|
202
202
|
spacing: isReducedSpacing ? 'none' : 'default',
|
|
203
203
|
disabled: disabled || pluginState.disabled,
|
|
@@ -210,27 +210,28 @@ var ToolbarTextColor = exports.ToolbarTextColor = /*#__PURE__*/function (_React$
|
|
|
210
210
|
onKeyDown: this.onKeyDown,
|
|
211
211
|
ref: this.toolbarItemRef,
|
|
212
212
|
iconBefore:
|
|
213
|
+
/*#__PURE__*/
|
|
213
214
|
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
|
|
214
|
-
|
|
215
|
+
_react.default.createElement("div", {
|
|
215
216
|
css: _styles.triggerWrapperStyles
|
|
216
|
-
},
|
|
217
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
217
218
|
css: _styles2.textColorIconWrapper
|
|
218
|
-
},
|
|
219
|
+
}, /*#__PURE__*/_react.default.createElement(_icon.EditorTextColorIcon, null), /*#__PURE__*/_react.default.createElement("div", {
|
|
219
220
|
css: [
|
|
220
221
|
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
|
|
221
222
|
_styles2.textColorIconBar, selectedColor ? // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
|
|
222
223
|
"background: ".concat(selectedColor, ";") :
|
|
223
224
|
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
|
|
224
225
|
pluginState.disabled && _styles2.backgroundDisabled]
|
|
225
|
-
})),
|
|
226
|
+
})), /*#__PURE__*/_react.default.createElement("span", {
|
|
226
227
|
css: _styles.expandIconWrapperStyle
|
|
227
|
-
},
|
|
228
|
+
}, /*#__PURE__*/_react.default.createElement(_chevronDown.default, {
|
|
228
229
|
label: ""
|
|
229
230
|
})))
|
|
230
231
|
})
|
|
231
|
-
},
|
|
232
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
232
233
|
"data-testid": "text-color-palette"
|
|
233
|
-
},
|
|
234
|
+
}, /*#__PURE__*/_react.default.createElement(_uiColor.ColorPalette, {
|
|
234
235
|
onClick: function onClick(color) {
|
|
235
236
|
var _pluginInjectionApi$a;
|
|
236
237
|
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);
|
|
@@ -241,7 +242,7 @@ var ToolbarTextColor = exports.ToolbarTextColor = /*#__PURE__*/function (_React$
|
|
|
241
242
|
hexToPaletteColor: _editorPalette.hexToEditorTextPaletteColor,
|
|
242
243
|
paletteColorTooltipMessages: _uiColor.textPaletteTooltipMessages
|
|
243
244
|
}
|
|
244
|
-
}))),
|
|
245
|
+
}))), /*#__PURE__*/_react.default.createElement("span", {
|
|
245
246
|
css: _styles.separatorStyles
|
|
246
247
|
}))
|
|
247
248
|
);
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
-
/** @jsx jsx */
|
|
3
2
|
import React from 'react';
|
|
4
|
-
import { jsx } from '@emotion/react';
|
|
5
3
|
import { defineMessages, injectIntl } from 'react-intl-next';
|
|
6
4
|
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE } from '@atlaskit/editor-common/analytics';
|
|
7
5
|
import { expandIconWrapperStyle, separatorStyles, triggerWrapperStyles, wrapperStyle } from '@atlaskit/editor-common/styles';
|
|
@@ -157,10 +155,11 @@ export class ToolbarTextColor extends React.Component {
|
|
|
157
155
|
selectedColumnIndex
|
|
158
156
|
} = getSelectedRowAndColumnFromPalette(palette, pluginState.color);
|
|
159
157
|
return (
|
|
158
|
+
/*#__PURE__*/
|
|
160
159
|
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
|
|
161
|
-
|
|
160
|
+
React.createElement("span", {
|
|
162
161
|
css: wrapperStyle
|
|
163
|
-
},
|
|
162
|
+
}, /*#__PURE__*/React.createElement(Dropdown, {
|
|
164
163
|
mountTo: popupsMountPoint,
|
|
165
164
|
boundariesElement: popupsBoundariesElement,
|
|
166
165
|
scrollableElement: popupsScrollableElement,
|
|
@@ -178,7 +177,7 @@ export class ToolbarTextColor extends React.Component {
|
|
|
178
177
|
isOpenedByKeyboard,
|
|
179
178
|
isPopupPositioned: true
|
|
180
179
|
},
|
|
181
|
-
trigger:
|
|
180
|
+
trigger: /*#__PURE__*/React.createElement(ToolbarButton, {
|
|
182
181
|
buttonId: TOOLBAR_BUTTON.TEXT_COLOR,
|
|
183
182
|
spacing: isReducedSpacing ? 'none' : 'default',
|
|
184
183
|
disabled: disabled || pluginState.disabled,
|
|
@@ -191,12 +190,13 @@ export class ToolbarTextColor extends React.Component {
|
|
|
191
190
|
onKeyDown: this.onKeyDown,
|
|
192
191
|
ref: this.toolbarItemRef,
|
|
193
192
|
iconBefore:
|
|
193
|
+
/*#__PURE__*/
|
|
194
194
|
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
|
|
195
|
-
|
|
195
|
+
React.createElement("div", {
|
|
196
196
|
css: triggerWrapperStyles
|
|
197
|
-
},
|
|
197
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
198
198
|
css: textColorIconWrapper
|
|
199
|
-
},
|
|
199
|
+
}, /*#__PURE__*/React.createElement(EditorTextColorIcon, null), /*#__PURE__*/React.createElement("div", {
|
|
200
200
|
css: [
|
|
201
201
|
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
|
|
202
202
|
textColorIconBar, selectedColor ?
|
|
@@ -204,15 +204,15 @@ export class ToolbarTextColor extends React.Component {
|
|
|
204
204
|
`background: ${selectedColor};` :
|
|
205
205
|
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
|
|
206
206
|
pluginState.disabled && backgroundDisabled]
|
|
207
|
-
})),
|
|
207
|
+
})), /*#__PURE__*/React.createElement("span", {
|
|
208
208
|
css: expandIconWrapperStyle
|
|
209
|
-
},
|
|
209
|
+
}, /*#__PURE__*/React.createElement(ExpandIcon, {
|
|
210
210
|
label: ""
|
|
211
211
|
})))
|
|
212
212
|
})
|
|
213
|
-
},
|
|
213
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
214
214
|
"data-testid": "text-color-palette"
|
|
215
|
-
},
|
|
215
|
+
}, /*#__PURE__*/React.createElement(ColorPalette, {
|
|
216
216
|
onClick: color => {
|
|
217
217
|
var _pluginInjectionApi$a;
|
|
218
218
|
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);
|
|
@@ -223,7 +223,7 @@ export class ToolbarTextColor extends React.Component {
|
|
|
223
223
|
hexToPaletteColor: hexToEditorTextPaletteColor,
|
|
224
224
|
paletteColorTooltipMessages: textPaletteTooltipMessages
|
|
225
225
|
}
|
|
226
|
-
}))),
|
|
226
|
+
}))), /*#__PURE__*/React.createElement("span", {
|
|
227
227
|
css: separatorStyles
|
|
228
228
|
}))
|
|
229
229
|
);
|
|
@@ -9,9 +9,7 @@ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbol
|
|
|
9
9
|
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) { _defineProperty(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; }
|
|
10
10
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
11
11
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
12
|
-
/** @jsx jsx */
|
|
13
12
|
import React from 'react';
|
|
14
|
-
import { jsx } from '@emotion/react';
|
|
15
13
|
import { defineMessages, injectIntl } from 'react-intl-next';
|
|
16
14
|
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE } from '@atlaskit/editor-common/analytics';
|
|
17
15
|
import { expandIconWrapperStyle, separatorStyles, triggerWrapperStyles, wrapperStyle } from '@atlaskit/editor-common/styles';
|
|
@@ -170,10 +168,11 @@ export var ToolbarTextColor = /*#__PURE__*/function (_React$Component) {
|
|
|
170
168
|
selectedRowIndex = _getSelectedRowAndCol.selectedRowIndex,
|
|
171
169
|
selectedColumnIndex = _getSelectedRowAndCol.selectedColumnIndex;
|
|
172
170
|
return (
|
|
171
|
+
/*#__PURE__*/
|
|
173
172
|
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
|
|
174
|
-
|
|
173
|
+
React.createElement("span", {
|
|
175
174
|
css: wrapperStyle
|
|
176
|
-
},
|
|
175
|
+
}, /*#__PURE__*/React.createElement(Dropdown, {
|
|
177
176
|
mountTo: popupsMountPoint,
|
|
178
177
|
boundariesElement: popupsBoundariesElement,
|
|
179
178
|
scrollableElement: popupsScrollableElement,
|
|
@@ -191,7 +190,7 @@ export var ToolbarTextColor = /*#__PURE__*/function (_React$Component) {
|
|
|
191
190
|
isOpenedByKeyboard: isOpenedByKeyboard,
|
|
192
191
|
isPopupPositioned: true
|
|
193
192
|
},
|
|
194
|
-
trigger:
|
|
193
|
+
trigger: /*#__PURE__*/React.createElement(ToolbarButton, {
|
|
195
194
|
buttonId: TOOLBAR_BUTTON.TEXT_COLOR,
|
|
196
195
|
spacing: isReducedSpacing ? 'none' : 'default',
|
|
197
196
|
disabled: disabled || pluginState.disabled,
|
|
@@ -204,27 +203,28 @@ export var ToolbarTextColor = /*#__PURE__*/function (_React$Component) {
|
|
|
204
203
|
onKeyDown: this.onKeyDown,
|
|
205
204
|
ref: this.toolbarItemRef,
|
|
206
205
|
iconBefore:
|
|
206
|
+
/*#__PURE__*/
|
|
207
207
|
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
|
|
208
|
-
|
|
208
|
+
React.createElement("div", {
|
|
209
209
|
css: triggerWrapperStyles
|
|
210
|
-
},
|
|
210
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
211
211
|
css: textColorIconWrapper
|
|
212
|
-
},
|
|
212
|
+
}, /*#__PURE__*/React.createElement(EditorTextColorIcon, null), /*#__PURE__*/React.createElement("div", {
|
|
213
213
|
css: [
|
|
214
214
|
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
|
|
215
215
|
textColorIconBar, selectedColor ? // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
|
|
216
216
|
"background: ".concat(selectedColor, ";") :
|
|
217
217
|
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
|
|
218
218
|
pluginState.disabled && backgroundDisabled]
|
|
219
|
-
})),
|
|
219
|
+
})), /*#__PURE__*/React.createElement("span", {
|
|
220
220
|
css: expandIconWrapperStyle
|
|
221
|
-
},
|
|
221
|
+
}, /*#__PURE__*/React.createElement(ExpandIcon, {
|
|
222
222
|
label: ""
|
|
223
223
|
})))
|
|
224
224
|
})
|
|
225
|
-
},
|
|
225
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
226
226
|
"data-testid": "text-color-palette"
|
|
227
|
-
},
|
|
227
|
+
}, /*#__PURE__*/React.createElement(ColorPalette, {
|
|
228
228
|
onClick: function onClick(color) {
|
|
229
229
|
var _pluginInjectionApi$a;
|
|
230
230
|
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);
|
|
@@ -235,7 +235,7 @@ export var ToolbarTextColor = /*#__PURE__*/function (_React$Component) {
|
|
|
235
235
|
hexToPaletteColor: hexToEditorTextPaletteColor,
|
|
236
236
|
paletteColorTooltipMessages: textPaletteTooltipMessages
|
|
237
237
|
}
|
|
238
|
-
}))),
|
|
238
|
+
}))), /*#__PURE__*/React.createElement("span", {
|
|
239
239
|
css: separatorStyles
|
|
240
240
|
}))
|
|
241
241
|
);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-text-color",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.7",
|
|
4
4
|
"description": "Text color plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -31,8 +31,8 @@
|
|
|
31
31
|
".": "./src/index.ts"
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@atlaskit/adf-schema": "^
|
|
35
|
-
"@atlaskit/editor-common": "^76.
|
|
34
|
+
"@atlaskit/adf-schema": "^35.0.0",
|
|
35
|
+
"@atlaskit/editor-common": "^76.24.0",
|
|
36
36
|
"@atlaskit/editor-palette": "1.5.2",
|
|
37
37
|
"@atlaskit/editor-plugin-analytics": "^0.3.0",
|
|
38
38
|
"@atlaskit/editor-prosemirror": "1.1.0",
|