@atlaskit/editor-plugin-highlight 3.0.4 → 3.0.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
CHANGED
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-highlight
|
|
2
2
|
|
|
3
|
+
## 3.0.6
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#187144](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/187144)
|
|
8
|
+
[`a16147d8fbdfe`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/a16147d8fbdfe) -
|
|
9
|
+
Bump @atlaskit/adf-schema to v49.0.5
|
|
10
|
+
- Updated dependencies
|
|
11
|
+
|
|
12
|
+
## 3.0.5
|
|
13
|
+
|
|
14
|
+
### Patch Changes
|
|
15
|
+
|
|
16
|
+
- [#185655](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/185655)
|
|
17
|
+
[`3d2b715fc1fac`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/3d2b715fc1fac) -
|
|
18
|
+
[ED-28416] clean up feature gate platform_editor_controls_patch_14
|
|
19
|
+
|
|
3
20
|
## 3.0.4
|
|
4
21
|
|
|
5
22
|
### Patch Changes
|
|
@@ -5,7 +5,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
7
|
exports.FloatingToolbarHighlightColorWithIntl = void 0;
|
|
8
|
-
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
9
8
|
var _react = require("react");
|
|
10
9
|
var _react2 = require("@emotion/react");
|
|
11
10
|
var _reactIntlNext = require("react-intl-next");
|
|
@@ -62,27 +61,19 @@ var FloatingToolbarHighlightColor = function FloatingToolbarHighlightColor(_ref)
|
|
|
62
61
|
formatMessage = _ref.intl.formatMessage,
|
|
63
62
|
editorView = _ref.editorView;
|
|
64
63
|
var toolbarItemRef = (0, _react.useRef)(null);
|
|
65
|
-
var _useState = (0, _react.useState)(false),
|
|
66
|
-
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
67
|
-
isDropdownOpenLocal = _useState2[0],
|
|
68
|
-
setIsDropdownOpenLocal = _useState2[1];
|
|
69
64
|
var _useSharedState = useSharedState(pluginInjectionApi),
|
|
70
65
|
activeColor = _useSharedState.activeColor,
|
|
71
66
|
disabled = _useSharedState.disabled,
|
|
72
67
|
isPaletteOpen = _useSharedState.isPaletteOpen;
|
|
73
68
|
var setDropdownOpen = function setDropdownOpen(isOpen) {
|
|
74
69
|
var _pluginInjectionApi$a;
|
|
75
|
-
if (
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
})(state, dispatch);
|
|
83
|
-
}
|
|
84
|
-
} else {
|
|
85
|
-
setIsDropdownOpenLocal(isOpen);
|
|
70
|
+
if (!disabled && editorView && pluginInjectionApi) {
|
|
71
|
+
var state = editorView.state,
|
|
72
|
+
dispatch = editorView.dispatch;
|
|
73
|
+
(0, _palette.setPalette)(pluginInjectionApi)({
|
|
74
|
+
isPaletteOpen: isOpen,
|
|
75
|
+
inputMethod: _analytics.INPUT_METHOD.FLOATING_TB
|
|
76
|
+
})(state, dispatch);
|
|
86
77
|
}
|
|
87
78
|
pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$a = pluginInjectionApi.analytics) === null || _pluginInjectionApi$a === void 0 || _pluginInjectionApi$a.actions.fireAnalyticsEvent({
|
|
88
79
|
action: isOpen ? _analytics.ACTION.OPENED : _analytics.ACTION.CLOSED,
|
|
@@ -94,8 +85,7 @@ var FloatingToolbarHighlightColor = function FloatingToolbarHighlightColor(_ref)
|
|
|
94
85
|
}
|
|
95
86
|
});
|
|
96
87
|
};
|
|
97
|
-
var
|
|
98
|
-
var isDropdownOpen = (0, _platformFeatureFlags.fg)('platform_editor_controls_patch_14') ? isDropdownOpenShared : isDropdownOpenLocal;
|
|
88
|
+
var isDropdownOpen = !!isPaletteOpen;
|
|
99
89
|
var _useDropdownEvents = (0, _useDropdownEvents2.useDropdownEvents)({
|
|
100
90
|
toolbarItemRef: toolbarItemRef,
|
|
101
91
|
setIsDropdownOpen: setDropdownOpen,
|
|
@@ -131,7 +121,7 @@ var FloatingToolbarHighlightColor = function FloatingToolbarHighlightColor(_ref)
|
|
|
131
121
|
disabled: disabled,
|
|
132
122
|
selected: isDropdownOpen,
|
|
133
123
|
"aria-label": title,
|
|
134
|
-
"aria-keyshortcuts": (0,
|
|
124
|
+
"aria-keyshortcuts": (0, _keymaps.getAriaKeyshortcuts)(_keymaps.toggleHighlightPalette),
|
|
135
125
|
"aria-expanded": isDropdownOpen,
|
|
136
126
|
"aria-haspopup": true,
|
|
137
127
|
title: title,
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* @jsxRuntime classic
|
|
3
3
|
* @jsx jsx
|
|
4
4
|
*/
|
|
5
|
-
import { useRef
|
|
5
|
+
import { useRef } from 'react';
|
|
6
6
|
|
|
7
7
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
8
8
|
import { css, jsx } from '@emotion/react';
|
|
@@ -57,7 +57,6 @@ const FloatingToolbarHighlightColor = ({
|
|
|
57
57
|
editorView
|
|
58
58
|
}) => {
|
|
59
59
|
const toolbarItemRef = useRef(null);
|
|
60
|
-
const [isDropdownOpenLocal, setIsDropdownOpenLocal] = useState(false);
|
|
61
60
|
const {
|
|
62
61
|
activeColor,
|
|
63
62
|
disabled,
|
|
@@ -65,19 +64,15 @@ const FloatingToolbarHighlightColor = ({
|
|
|
65
64
|
} = useSharedState(pluginInjectionApi);
|
|
66
65
|
const setDropdownOpen = isOpen => {
|
|
67
66
|
var _pluginInjectionApi$a;
|
|
68
|
-
if (
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
})(state, dispatch);
|
|
78
|
-
}
|
|
79
|
-
} else {
|
|
80
|
-
setIsDropdownOpenLocal(isOpen);
|
|
67
|
+
if (!disabled && editorView && pluginInjectionApi) {
|
|
68
|
+
const {
|
|
69
|
+
state,
|
|
70
|
+
dispatch
|
|
71
|
+
} = editorView;
|
|
72
|
+
setPalette(pluginInjectionApi)({
|
|
73
|
+
isPaletteOpen: isOpen,
|
|
74
|
+
inputMethod: INPUT_METHOD.FLOATING_TB
|
|
75
|
+
})(state, dispatch);
|
|
81
76
|
}
|
|
82
77
|
pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$a = pluginInjectionApi.analytics) === null || _pluginInjectionApi$a === void 0 ? void 0 : _pluginInjectionApi$a.actions.fireAnalyticsEvent({
|
|
83
78
|
action: isOpen ? ACTION.OPENED : ACTION.CLOSED,
|
|
@@ -89,8 +84,7 @@ const FloatingToolbarHighlightColor = ({
|
|
|
89
84
|
}
|
|
90
85
|
});
|
|
91
86
|
};
|
|
92
|
-
const
|
|
93
|
-
const isDropdownOpen = fg('platform_editor_controls_patch_14') ? isDropdownOpenShared : isDropdownOpenLocal;
|
|
87
|
+
const isDropdownOpen = !!isPaletteOpen;
|
|
94
88
|
const {
|
|
95
89
|
handleClick,
|
|
96
90
|
handleKeyDown,
|
|
@@ -127,7 +121,7 @@ const FloatingToolbarHighlightColor = ({
|
|
|
127
121
|
disabled: disabled,
|
|
128
122
|
selected: isDropdownOpen,
|
|
129
123
|
"aria-label": title,
|
|
130
|
-
"aria-keyshortcuts":
|
|
124
|
+
"aria-keyshortcuts": getAriaKeyshortcuts(toggleHighlightPalette),
|
|
131
125
|
"aria-expanded": isDropdownOpen,
|
|
132
126
|
"aria-haspopup": true,
|
|
133
127
|
title: title,
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
2
1
|
/**
|
|
3
2
|
* @jsxRuntime classic
|
|
4
3
|
* @jsx jsx
|
|
5
4
|
*/
|
|
6
|
-
import { useRef
|
|
5
|
+
import { useRef } from 'react';
|
|
7
6
|
|
|
8
7
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
9
8
|
import { css, jsx } from '@emotion/react';
|
|
@@ -54,27 +53,19 @@ var FloatingToolbarHighlightColor = function FloatingToolbarHighlightColor(_ref)
|
|
|
54
53
|
formatMessage = _ref.intl.formatMessage,
|
|
55
54
|
editorView = _ref.editorView;
|
|
56
55
|
var toolbarItemRef = useRef(null);
|
|
57
|
-
var _useState = useState(false),
|
|
58
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
59
|
-
isDropdownOpenLocal = _useState2[0],
|
|
60
|
-
setIsDropdownOpenLocal = _useState2[1];
|
|
61
56
|
var _useSharedState = useSharedState(pluginInjectionApi),
|
|
62
57
|
activeColor = _useSharedState.activeColor,
|
|
63
58
|
disabled = _useSharedState.disabled,
|
|
64
59
|
isPaletteOpen = _useSharedState.isPaletteOpen;
|
|
65
60
|
var setDropdownOpen = function setDropdownOpen(isOpen) {
|
|
66
61
|
var _pluginInjectionApi$a;
|
|
67
|
-
if (
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
})(state, dispatch);
|
|
75
|
-
}
|
|
76
|
-
} else {
|
|
77
|
-
setIsDropdownOpenLocal(isOpen);
|
|
62
|
+
if (!disabled && editorView && pluginInjectionApi) {
|
|
63
|
+
var state = editorView.state,
|
|
64
|
+
dispatch = editorView.dispatch;
|
|
65
|
+
setPalette(pluginInjectionApi)({
|
|
66
|
+
isPaletteOpen: isOpen,
|
|
67
|
+
inputMethod: INPUT_METHOD.FLOATING_TB
|
|
68
|
+
})(state, dispatch);
|
|
78
69
|
}
|
|
79
70
|
pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$a = pluginInjectionApi.analytics) === null || _pluginInjectionApi$a === void 0 || _pluginInjectionApi$a.actions.fireAnalyticsEvent({
|
|
80
71
|
action: isOpen ? ACTION.OPENED : ACTION.CLOSED,
|
|
@@ -86,8 +77,7 @@ var FloatingToolbarHighlightColor = function FloatingToolbarHighlightColor(_ref)
|
|
|
86
77
|
}
|
|
87
78
|
});
|
|
88
79
|
};
|
|
89
|
-
var
|
|
90
|
-
var isDropdownOpen = fg('platform_editor_controls_patch_14') ? isDropdownOpenShared : isDropdownOpenLocal;
|
|
80
|
+
var isDropdownOpen = !!isPaletteOpen;
|
|
91
81
|
var _useDropdownEvents = useDropdownEvents({
|
|
92
82
|
toolbarItemRef: toolbarItemRef,
|
|
93
83
|
setIsDropdownOpen: setDropdownOpen,
|
|
@@ -123,7 +113,7 @@ var FloatingToolbarHighlightColor = function FloatingToolbarHighlightColor(_ref)
|
|
|
123
113
|
disabled: disabled,
|
|
124
114
|
selected: isDropdownOpen,
|
|
125
115
|
"aria-label": title,
|
|
126
|
-
"aria-keyshortcuts":
|
|
116
|
+
"aria-keyshortcuts": getAriaKeyshortcuts(toggleHighlightPalette),
|
|
127
117
|
"aria-expanded": isDropdownOpen,
|
|
128
118
|
"aria-haspopup": true,
|
|
129
119
|
title: title,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-highlight",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.6",
|
|
4
4
|
"description": "Highlight plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -38,8 +38,8 @@
|
|
|
38
38
|
"@atlaskit/adf-schema": "^49.0.6",
|
|
39
39
|
"@atlaskit/editor-palette": "^2.1.0",
|
|
40
40
|
"@atlaskit/editor-plugin-analytics": "^3.0.0",
|
|
41
|
-
"@atlaskit/editor-plugin-primary-toolbar": "^4.
|
|
42
|
-
"@atlaskit/editor-plugin-selection-toolbar": "^4.
|
|
41
|
+
"@atlaskit/editor-plugin-primary-toolbar": "^4.1.0",
|
|
42
|
+
"@atlaskit/editor-plugin-selection-toolbar": "^4.1.0",
|
|
43
43
|
"@atlaskit/editor-plugin-text-formatting": "^3.0.0",
|
|
44
44
|
"@atlaskit/editor-prosemirror": "7.0.0",
|
|
45
45
|
"@atlaskit/editor-shared-styles": "^3.4.0",
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
"@atlaskit/icon": "^27.3.0",
|
|
48
48
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
49
49
|
"@atlaskit/primitives": "^14.10.0",
|
|
50
|
-
"@atlaskit/tmp-editor-statsig": "^9.
|
|
50
|
+
"@atlaskit/tmp-editor-statsig": "^9.7.0",
|
|
51
51
|
"@atlaskit/tokens": "^5.5.0",
|
|
52
52
|
"@babel/runtime": "^7.0.0",
|
|
53
53
|
"@emotion/react": "^11.7.1"
|
|
@@ -114,9 +114,6 @@
|
|
|
114
114
|
},
|
|
115
115
|
"platform-visual-refresh-icons": {
|
|
116
116
|
"type": "boolean"
|
|
117
|
-
},
|
|
118
|
-
"platform_editor_controls_patch_14": {
|
|
119
|
-
"type": "boolean"
|
|
120
117
|
}
|
|
121
118
|
}
|
|
122
119
|
}
|