@atlaskit/editor-common 98.0.2 → 98.0.3
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 +8 -0
- package/dist/cjs/code-block/index.js +1 -6
- package/dist/cjs/element-browser/components/ElementSearch.js +4 -5
- package/dist/cjs/hooks/useSharedPluginStateSelector/useSharedPluginStateSelector.js +13 -3
- package/dist/cjs/monitoring/error.js +1 -1
- package/dist/cjs/ui/DropList/index.js +1 -1
- package/dist/cjs/ui/FloatingToolbar/styles.js +38 -2
- package/dist/es2019/code-block/index.js +1 -6
- package/dist/es2019/element-browser/components/ElementSearch.js +4 -5
- package/dist/es2019/hooks/useSharedPluginStateSelector/useSharedPluginStateSelector.js +12 -3
- package/dist/es2019/monitoring/error.js +1 -1
- package/dist/es2019/ui/DropList/index.js +1 -1
- package/dist/es2019/ui/FloatingToolbar/styles.js +38 -2
- package/dist/esm/code-block/index.js +1 -6
- package/dist/esm/element-browser/components/ElementSearch.js +4 -5
- package/dist/esm/hooks/useSharedPluginStateSelector/useSharedPluginStateSelector.js +13 -3
- package/dist/esm/monitoring/error.js +1 -1
- package/dist/esm/ui/DropList/index.js +1 -1
- package/dist/esm/ui/FloatingToolbar/styles.js +38 -2
- package/dist/types/code-block/index.d.ts +0 -1
- package/dist/types/hooks/usePluginStateEffect.d.ts +1 -2
- package/dist/types-ts4.5/code-block/index.d.ts +0 -1
- package/dist/types-ts4.5/hooks/usePluginStateEffect.d.ts +1 -2
- package/package.json +1 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# @atlaskit/editor-common
|
|
2
2
|
|
|
3
|
+
## 98.0.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#98963](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/98963)
|
|
8
|
+
[`3638dcf79b6c7`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/3638dcf79b6c7) -
|
|
9
|
+
ED-26126 Cleanup code wrapping language bug fg
|
|
10
|
+
|
|
3
11
|
## 98.0.2
|
|
4
12
|
|
|
5
13
|
### Patch Changes
|
|
@@ -4,7 +4,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.updateCodeBlockWrappedStateNodeKeys = exports.transferCodeBlockWrappedValue = exports.isCodeBlockWordWrapEnabled = exports.defaultWordWrapState = exports.codeBlockWrappedStates = void 0;
|
|
7
|
-
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
8
7
|
/* eslint-disable @atlaskit/platform/ensure-feature-flag-prefix */
|
|
9
8
|
|
|
10
9
|
var defaultWordWrapState = exports.defaultWordWrapState = false;
|
|
@@ -16,7 +15,6 @@ var isCodeBlockWordWrapEnabled = exports.isCodeBlockWordWrapEnabled = function i
|
|
|
16
15
|
|
|
17
16
|
/**
|
|
18
17
|
* Swap the old node key with the new node key in the wrapped states WeakMap.
|
|
19
|
-
* Replaced with updateCodeBlockWrappedStateNodeKeys() under 'editor_code_block_wrapping_language_change_bug' feature gate.
|
|
20
18
|
*/
|
|
21
19
|
var transferCodeBlockWrappedValue = exports.transferCodeBlockWrappedValue = function transferCodeBlockWrappedValue(oldCodeBlockNode, newCodeBlockNode) {
|
|
22
20
|
// Don't overwrite the value for the new node if it already exists.
|
|
@@ -35,9 +33,6 @@ var transferCodeBlockWrappedValue = exports.transferCodeBlockWrappedValue = func
|
|
|
35
33
|
* This function takes all the given nodes, finds their old nodes from the old state and updates these old node keys.
|
|
36
34
|
*/
|
|
37
35
|
var updateCodeBlockWrappedStateNodeKeys = exports.updateCodeBlockWrappedStateNodeKeys = function updateCodeBlockWrappedStateNodeKeys(newCodeBlockNodes, oldState) {
|
|
38
|
-
if (!(0, _platformFeatureFlags.fg)('editor_code_block_wrapping_language_change_bug')) {
|
|
39
|
-
return;
|
|
40
|
-
}
|
|
41
36
|
newCodeBlockNodes.forEach(function (newCodeBlockNode) {
|
|
42
37
|
// Don't overwrite the value for the new node if it already exists.
|
|
43
38
|
// This can happen when a drag&drop is swapping nodes.
|
|
@@ -46,7 +41,7 @@ var updateCodeBlockWrappedStateNodeKeys = exports.updateCodeBlockWrappedStateNod
|
|
|
46
41
|
}
|
|
47
42
|
|
|
48
43
|
// Do not go out of range on the oldState doc. Happens on initial load.
|
|
49
|
-
if (oldState.doc.
|
|
44
|
+
if (oldState.doc.content.size <= newCodeBlockNode.pos) {
|
|
50
45
|
return;
|
|
51
46
|
}
|
|
52
47
|
var oldCodeBlockNode = oldState.doc.nodeAt(newCodeBlockNode.pos);
|
|
@@ -13,7 +13,7 @@ var _reactIntlNext = require("react-intl-next");
|
|
|
13
13
|
var _withAnalyticsContext = _interopRequireDefault(require("@atlaskit/analytics-next/withAnalyticsContext"));
|
|
14
14
|
var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
|
|
15
15
|
var _shortcut = require("@atlaskit/editor-shared-styles/shortcut");
|
|
16
|
-
var _search = _interopRequireDefault(require("@atlaskit/icon/
|
|
16
|
+
var _search = _interopRequireDefault(require("@atlaskit/icon/core/migration/search"));
|
|
17
17
|
var _textfield = _interopRequireDefault(require("@atlaskit/textfield"));
|
|
18
18
|
var _constants = require("../constants");
|
|
19
19
|
var _useFocus = _interopRequireDefault(require("../hooks/use-focus"));
|
|
@@ -103,9 +103,9 @@ function ElementSearch(_ref) {
|
|
|
103
103
|
"data-testid": "element_search__element_before_input",
|
|
104
104
|
"aria-hidden": "true"
|
|
105
105
|
}, (0, _react2.jsx)(_search.default, {
|
|
106
|
-
|
|
106
|
+
spacing: "spacious",
|
|
107
107
|
label: "Advanced search",
|
|
108
|
-
|
|
108
|
+
color: "var(--ds-icon-subtle, #626F86)"
|
|
109
109
|
})),
|
|
110
110
|
elemAfterInput: (0, _react2.jsx)("div", {
|
|
111
111
|
css: elementAfterInput,
|
|
@@ -166,8 +166,7 @@ var wrapperInline = (0, _react2.css)({
|
|
|
166
166
|
}
|
|
167
167
|
});
|
|
168
168
|
var elementBeforeInput = (0, _react2.css)({
|
|
169
|
-
margin: "
|
|
170
|
-
color: "var(--ds-icon, #44546F)",
|
|
169
|
+
margin: "var(--ds-space-025, 2px)".concat(" ", "var(--ds-space-075, 6px)", " 0 ", "var(--ds-space-100, 8px)"),
|
|
171
170
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
|
|
172
171
|
'span, svg': {
|
|
173
172
|
height: '20px',
|
|
@@ -5,6 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
7
|
exports.useSharedPluginStateSelector = useSharedPluginStateSelector;
|
|
8
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
8
9
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
9
10
|
var _toArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toArray"));
|
|
10
11
|
var _react = require("react");
|
|
@@ -99,10 +100,19 @@ function useSharedPluginStateSelector(api, plugin) {
|
|
|
99
100
|
pluginName = _plugin$split4[0];
|
|
100
101
|
return [pluginName];
|
|
101
102
|
}, [plugin]);
|
|
102
|
-
|
|
103
|
+
var initialState = (0, _react.useMemo)(function () {
|
|
104
|
+
var _api$pluginName;
|
|
105
|
+
var _plugin$split5 = plugin.split('.'),
|
|
106
|
+
_plugin$split6 = (0, _slicedToArray2.default)(_plugin$split5, 1),
|
|
107
|
+
pluginName = _plugin$split6[0];
|
|
108
|
+
return transformer((0, _defineProperty2.default)({}, "".concat(pluginName, "State"), api === null || api === void 0 || (_api$pluginName = api[pluginName]) === null || _api$pluginName === void 0 ? void 0 : _api$pluginName.sharedState.currentState()));
|
|
109
|
+
}, [plugin, api, transformer]);
|
|
110
|
+
return useSharedPluginStateSelectorInternal(api, pluginNameArray, transformer, initialState);
|
|
103
111
|
}
|
|
104
|
-
|
|
105
|
-
|
|
112
|
+
|
|
113
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
114
|
+
function useSharedPluginStateSelectorInternal(api, plugins, transformer, initialState) {
|
|
115
|
+
var _useState = (0, _react.useState)(initialState),
|
|
106
116
|
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
107
117
|
selectedPluginState = _useState2[0],
|
|
108
118
|
setSelectedPluginState = _useState2[1];
|
|
@@ -17,7 +17,7 @@ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return
|
|
|
17
17
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
18
18
|
var SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
|
|
19
19
|
var packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
|
|
20
|
-
var packageVersion = "98.0.
|
|
20
|
+
var packageVersion = "98.0.3";
|
|
21
21
|
var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
|
|
22
22
|
// Remove URL as it has UGC
|
|
23
23
|
// TODO: Sanitise the URL instead of just removing it
|
|
@@ -23,7 +23,7 @@ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.
|
|
|
23
23
|
* @jsx jsx
|
|
24
24
|
*/ // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
25
25
|
var packageName = "@atlaskit/editor-common";
|
|
26
|
-
var packageVersion = "98.0.
|
|
26
|
+
var packageVersion = "98.0.3";
|
|
27
27
|
var halfFocusRing = 1;
|
|
28
28
|
var dropOffset = '0, 8';
|
|
29
29
|
// Ignored via go/ees005
|
|
@@ -4,6 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.iconOnlySpacing = exports.getButtonStyles = void 0;
|
|
7
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
7
8
|
var iconOnlySpacing = exports.iconOnlySpacing = {
|
|
8
9
|
'&&': {
|
|
9
10
|
padding: '0px'
|
|
@@ -40,6 +41,22 @@ var background = {
|
|
|
40
41
|
}
|
|
41
42
|
}
|
|
42
43
|
};
|
|
44
|
+
var backgroundVisualRefresh = {
|
|
45
|
+
danger: {
|
|
46
|
+
default: {
|
|
47
|
+
light: 'inherit',
|
|
48
|
+
dark: 'inherit'
|
|
49
|
+
},
|
|
50
|
+
hover: {
|
|
51
|
+
light: "var(--ds-background-danger-hovered, #FFD5D2)",
|
|
52
|
+
dark: "var(--ds-background-danger-hovered, #FFD5D2)"
|
|
53
|
+
},
|
|
54
|
+
active: {
|
|
55
|
+
light: "var(--ds-background-danger-pressed, #FD9891)",
|
|
56
|
+
dark: "var(--ds-background-danger-pressed, #FD9891)"
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
};
|
|
43
60
|
var color = {
|
|
44
61
|
danger: {
|
|
45
62
|
default: {
|
|
@@ -56,12 +73,31 @@ var color = {
|
|
|
56
73
|
}
|
|
57
74
|
}
|
|
58
75
|
};
|
|
76
|
+
var colorVisualRefresh = {
|
|
77
|
+
danger: {
|
|
78
|
+
default: {
|
|
79
|
+
light: "var(--ds-icon-subtle, #626F86)",
|
|
80
|
+
dark: "var(--ds-icon-subtle, #626F86)"
|
|
81
|
+
},
|
|
82
|
+
hover: {
|
|
83
|
+
light: "var(--ds-icon-danger, #C9372C)",
|
|
84
|
+
dark: "var(--ds-icon-danger, #C9372C)"
|
|
85
|
+
},
|
|
86
|
+
active: {
|
|
87
|
+
light: "var(--ds-icon-danger, #C9372C)",
|
|
88
|
+
dark: "var(--ds-icon-danger, #C9372C)"
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
};
|
|
59
92
|
|
|
60
93
|
// Ignored via go/ees005
|
|
61
94
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
62
95
|
var getButtonStyles = exports.getButtonStyles = function getButtonStyles(props) {
|
|
63
96
|
return {
|
|
64
|
-
background: getStyles(
|
|
65
|
-
|
|
97
|
+
background: getStyles(
|
|
98
|
+
// eslint-disable-next-line @atlaskit/platform/ensure-feature-flag-prefix
|
|
99
|
+
(0, _platformFeatureFlags.fg)('platform-visual-refresh-icons') ? backgroundVisualRefresh : background, props),
|
|
100
|
+
// eslint-disable-next-line @atlaskit/platform/ensure-feature-flag-prefix
|
|
101
|
+
color: getStyles((0, _platformFeatureFlags.fg)('platform-visual-refresh-icons') ? colorVisualRefresh : color, props)
|
|
66
102
|
};
|
|
67
103
|
};
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
/* eslint-disable @atlaskit/platform/ensure-feature-flag-prefix */
|
|
2
2
|
|
|
3
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
4
3
|
export const defaultWordWrapState = false;
|
|
5
4
|
export const codeBlockWrappedStates = new WeakMap();
|
|
6
5
|
export const isCodeBlockWordWrapEnabled = codeBlockNode => {
|
|
@@ -10,7 +9,6 @@ export const isCodeBlockWordWrapEnabled = codeBlockNode => {
|
|
|
10
9
|
|
|
11
10
|
/**
|
|
12
11
|
* Swap the old node key with the new node key in the wrapped states WeakMap.
|
|
13
|
-
* Replaced with updateCodeBlockWrappedStateNodeKeys() under 'editor_code_block_wrapping_language_change_bug' feature gate.
|
|
14
12
|
*/
|
|
15
13
|
export const transferCodeBlockWrappedValue = (oldCodeBlockNode, newCodeBlockNode) => {
|
|
16
14
|
// Don't overwrite the value for the new node if it already exists.
|
|
@@ -29,9 +27,6 @@ export const transferCodeBlockWrappedValue = (oldCodeBlockNode, newCodeBlockNode
|
|
|
29
27
|
* This function takes all the given nodes, finds their old nodes from the old state and updates these old node keys.
|
|
30
28
|
*/
|
|
31
29
|
export const updateCodeBlockWrappedStateNodeKeys = (newCodeBlockNodes, oldState) => {
|
|
32
|
-
if (!fg('editor_code_block_wrapping_language_change_bug')) {
|
|
33
|
-
return;
|
|
34
|
-
}
|
|
35
30
|
newCodeBlockNodes.forEach(newCodeBlockNode => {
|
|
36
31
|
// Don't overwrite the value for the new node if it already exists.
|
|
37
32
|
// This can happen when a drag&drop is swapping nodes.
|
|
@@ -40,7 +35,7 @@ export const updateCodeBlockWrappedStateNodeKeys = (newCodeBlockNodes, oldState)
|
|
|
40
35
|
}
|
|
41
36
|
|
|
42
37
|
// Do not go out of range on the oldState doc. Happens on initial load.
|
|
43
|
-
if (oldState.doc.
|
|
38
|
+
if (oldState.doc.content.size <= newCodeBlockNode.pos) {
|
|
44
39
|
return;
|
|
45
40
|
}
|
|
46
41
|
const oldCodeBlockNode = oldState.doc.nodeAt(newCodeBlockNode.pos);
|
|
@@ -10,7 +10,7 @@ import { injectIntl } from 'react-intl-next';
|
|
|
10
10
|
import withAnalyticsContext from '@atlaskit/analytics-next/withAnalyticsContext';
|
|
11
11
|
import { relativeFontSizeToBase16 } from '@atlaskit/editor-shared-styles';
|
|
12
12
|
import { shortcutStyle } from '@atlaskit/editor-shared-styles/shortcut';
|
|
13
|
-
import SearchIcon from '@atlaskit/icon/
|
|
13
|
+
import SearchIcon from '@atlaskit/icon/core/migration/search';
|
|
14
14
|
import Textfield from '@atlaskit/textfield';
|
|
15
15
|
import { GRID_SIZE, SEARCH_ITEM_HEIGHT_WIDTH } from '../constants';
|
|
16
16
|
import useFocus from '../hooks/use-focus';
|
|
@@ -94,9 +94,9 @@ function ElementSearch({
|
|
|
94
94
|
"data-testid": "element_search__element_before_input",
|
|
95
95
|
"aria-hidden": "true"
|
|
96
96
|
}, jsx(SearchIcon, {
|
|
97
|
-
|
|
97
|
+
spacing: "spacious",
|
|
98
98
|
label: "Advanced search",
|
|
99
|
-
|
|
99
|
+
color: "var(--ds-icon-subtle, #626F86)"
|
|
100
100
|
})),
|
|
101
101
|
elemAfterInput: jsx("div", {
|
|
102
102
|
css: elementAfterInput,
|
|
@@ -157,8 +157,7 @@ const wrapperInline = css({
|
|
|
157
157
|
}
|
|
158
158
|
});
|
|
159
159
|
const elementBeforeInput = css({
|
|
160
|
-
margin:
|
|
161
|
-
color: "var(--ds-icon, #44546F)",
|
|
160
|
+
margin: `${"var(--ds-space-025, 2px)"} ${"var(--ds-space-075, 6px)"} 0 ${"var(--ds-space-100, 8px)"}`,
|
|
162
161
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
|
|
163
162
|
'span, svg': {
|
|
164
163
|
height: '20px',
|
|
@@ -86,10 +86,19 @@ export function useSharedPluginStateSelector(api, plugin) {
|
|
|
86
86
|
const [pluginName] = plugin.split('.');
|
|
87
87
|
return [pluginName];
|
|
88
88
|
}, [plugin]);
|
|
89
|
-
|
|
89
|
+
const initialState = useMemo(() => {
|
|
90
|
+
var _api$pluginName;
|
|
91
|
+
const [pluginName] = plugin.split('.');
|
|
92
|
+
return transformer({
|
|
93
|
+
[`${pluginName}State`]: api === null || api === void 0 ? void 0 : (_api$pluginName = api[pluginName]) === null || _api$pluginName === void 0 ? void 0 : _api$pluginName.sharedState.currentState()
|
|
94
|
+
});
|
|
95
|
+
}, [plugin, api, transformer]);
|
|
96
|
+
return useSharedPluginStateSelectorInternal(api, pluginNameArray, transformer, initialState);
|
|
90
97
|
}
|
|
91
|
-
|
|
92
|
-
|
|
98
|
+
|
|
99
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
100
|
+
function useSharedPluginStateSelectorInternal(api, plugins, transformer, initialState) {
|
|
101
|
+
const [selectedPluginState, setSelectedPluginState] = useState(initialState);
|
|
93
102
|
usePluginStateEffect(api, plugins, pluginStates => {
|
|
94
103
|
// `pluginStates`: This is the same type through inference - but typescript doesn't recognise them as they are computed slightly differently
|
|
95
104
|
const transformedValue = transformer(pluginStates);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { isFedRamp } from './environment';
|
|
2
2
|
const SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
|
|
3
3
|
const packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
|
|
4
|
-
const packageVersion = "98.0.
|
|
4
|
+
const packageVersion = "98.0.3";
|
|
5
5
|
const sanitiseSentryEvents = (data, _hint) => {
|
|
6
6
|
// Remove URL as it has UGC
|
|
7
7
|
// TODO: Sanitise the URL instead of just removing it
|
|
@@ -13,7 +13,7 @@ import withAnalyticsContext from '@atlaskit/analytics-next/withAnalyticsContext'
|
|
|
13
13
|
import withAnalyticsEvents from '@atlaskit/analytics-next/withAnalyticsEvents';
|
|
14
14
|
import Layer from '../Layer';
|
|
15
15
|
const packageName = "@atlaskit/editor-common";
|
|
16
|
-
const packageVersion = "98.0.
|
|
16
|
+
const packageVersion = "98.0.3";
|
|
17
17
|
const halfFocusRing = 1;
|
|
18
18
|
const dropOffset = '0, 8';
|
|
19
19
|
// Ignored via go/ees005
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
1
2
|
export const iconOnlySpacing = {
|
|
2
3
|
'&&': {
|
|
3
4
|
padding: '0px'
|
|
@@ -32,6 +33,22 @@ const background = {
|
|
|
32
33
|
}
|
|
33
34
|
}
|
|
34
35
|
};
|
|
36
|
+
const backgroundVisualRefresh = {
|
|
37
|
+
danger: {
|
|
38
|
+
default: {
|
|
39
|
+
light: 'inherit',
|
|
40
|
+
dark: 'inherit'
|
|
41
|
+
},
|
|
42
|
+
hover: {
|
|
43
|
+
light: "var(--ds-background-danger-hovered, #FFD5D2)",
|
|
44
|
+
dark: "var(--ds-background-danger-hovered, #FFD5D2)"
|
|
45
|
+
},
|
|
46
|
+
active: {
|
|
47
|
+
light: "var(--ds-background-danger-pressed, #FD9891)",
|
|
48
|
+
dark: "var(--ds-background-danger-pressed, #FD9891)"
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
};
|
|
35
52
|
const color = {
|
|
36
53
|
danger: {
|
|
37
54
|
default: {
|
|
@@ -48,10 +65,29 @@ const color = {
|
|
|
48
65
|
}
|
|
49
66
|
}
|
|
50
67
|
};
|
|
68
|
+
const colorVisualRefresh = {
|
|
69
|
+
danger: {
|
|
70
|
+
default: {
|
|
71
|
+
light: "var(--ds-icon-subtle, #626F86)",
|
|
72
|
+
dark: "var(--ds-icon-subtle, #626F86)"
|
|
73
|
+
},
|
|
74
|
+
hover: {
|
|
75
|
+
light: "var(--ds-icon-danger, #C9372C)",
|
|
76
|
+
dark: "var(--ds-icon-danger, #C9372C)"
|
|
77
|
+
},
|
|
78
|
+
active: {
|
|
79
|
+
light: "var(--ds-icon-danger, #C9372C)",
|
|
80
|
+
dark: "var(--ds-icon-danger, #C9372C)"
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
};
|
|
51
84
|
|
|
52
85
|
// Ignored via go/ees005
|
|
53
86
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
54
87
|
export const getButtonStyles = props => ({
|
|
55
|
-
background: getStyles(
|
|
56
|
-
|
|
88
|
+
background: getStyles(
|
|
89
|
+
// eslint-disable-next-line @atlaskit/platform/ensure-feature-flag-prefix
|
|
90
|
+
fg('platform-visual-refresh-icons') ? backgroundVisualRefresh : background, props),
|
|
91
|
+
// eslint-disable-next-line @atlaskit/platform/ensure-feature-flag-prefix
|
|
92
|
+
color: getStyles(fg('platform-visual-refresh-icons') ? colorVisualRefresh : color, props)
|
|
57
93
|
});
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
/* eslint-disable @atlaskit/platform/ensure-feature-flag-prefix */
|
|
2
2
|
|
|
3
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
4
3
|
export var defaultWordWrapState = false;
|
|
5
4
|
export var codeBlockWrappedStates = new WeakMap();
|
|
6
5
|
export var isCodeBlockWordWrapEnabled = function isCodeBlockWordWrapEnabled(codeBlockNode) {
|
|
@@ -10,7 +9,6 @@ export var isCodeBlockWordWrapEnabled = function isCodeBlockWordWrapEnabled(code
|
|
|
10
9
|
|
|
11
10
|
/**
|
|
12
11
|
* Swap the old node key with the new node key in the wrapped states WeakMap.
|
|
13
|
-
* Replaced with updateCodeBlockWrappedStateNodeKeys() under 'editor_code_block_wrapping_language_change_bug' feature gate.
|
|
14
12
|
*/
|
|
15
13
|
export var transferCodeBlockWrappedValue = function transferCodeBlockWrappedValue(oldCodeBlockNode, newCodeBlockNode) {
|
|
16
14
|
// Don't overwrite the value for the new node if it already exists.
|
|
@@ -29,9 +27,6 @@ export var transferCodeBlockWrappedValue = function transferCodeBlockWrappedValu
|
|
|
29
27
|
* This function takes all the given nodes, finds their old nodes from the old state and updates these old node keys.
|
|
30
28
|
*/
|
|
31
29
|
export var updateCodeBlockWrappedStateNodeKeys = function updateCodeBlockWrappedStateNodeKeys(newCodeBlockNodes, oldState) {
|
|
32
|
-
if (!fg('editor_code_block_wrapping_language_change_bug')) {
|
|
33
|
-
return;
|
|
34
|
-
}
|
|
35
30
|
newCodeBlockNodes.forEach(function (newCodeBlockNode) {
|
|
36
31
|
// Don't overwrite the value for the new node if it already exists.
|
|
37
32
|
// This can happen when a drag&drop is swapping nodes.
|
|
@@ -40,7 +35,7 @@ export var updateCodeBlockWrappedStateNodeKeys = function updateCodeBlockWrapped
|
|
|
40
35
|
}
|
|
41
36
|
|
|
42
37
|
// Do not go out of range on the oldState doc. Happens on initial load.
|
|
43
|
-
if (oldState.doc.
|
|
38
|
+
if (oldState.doc.content.size <= newCodeBlockNode.pos) {
|
|
44
39
|
return;
|
|
45
40
|
}
|
|
46
41
|
var oldCodeBlockNode = oldState.doc.nodeAt(newCodeBlockNode.pos);
|
|
@@ -11,7 +11,7 @@ import { injectIntl } from 'react-intl-next';
|
|
|
11
11
|
import withAnalyticsContext from '@atlaskit/analytics-next/withAnalyticsContext';
|
|
12
12
|
import { relativeFontSizeToBase16 } from '@atlaskit/editor-shared-styles';
|
|
13
13
|
import { shortcutStyle } from '@atlaskit/editor-shared-styles/shortcut';
|
|
14
|
-
import SearchIcon from '@atlaskit/icon/
|
|
14
|
+
import SearchIcon from '@atlaskit/icon/core/migration/search';
|
|
15
15
|
import Textfield from '@atlaskit/textfield';
|
|
16
16
|
import { GRID_SIZE, SEARCH_ITEM_HEIGHT_WIDTH } from '../constants';
|
|
17
17
|
import useFocus from '../hooks/use-focus';
|
|
@@ -92,9 +92,9 @@ function ElementSearch(_ref) {
|
|
|
92
92
|
"data-testid": "element_search__element_before_input",
|
|
93
93
|
"aria-hidden": "true"
|
|
94
94
|
}, jsx(SearchIcon, {
|
|
95
|
-
|
|
95
|
+
spacing: "spacious",
|
|
96
96
|
label: "Advanced search",
|
|
97
|
-
|
|
97
|
+
color: "var(--ds-icon-subtle, #626F86)"
|
|
98
98
|
})),
|
|
99
99
|
elemAfterInput: jsx("div", {
|
|
100
100
|
css: elementAfterInput,
|
|
@@ -155,8 +155,7 @@ var wrapperInline = css({
|
|
|
155
155
|
}
|
|
156
156
|
});
|
|
157
157
|
var elementBeforeInput = css({
|
|
158
|
-
margin: "
|
|
159
|
-
color: "var(--ds-icon, #44546F)",
|
|
158
|
+
margin: "var(--ds-space-025, 2px)".concat(" ", "var(--ds-space-075, 6px)", " 0 ", "var(--ds-space-100, 8px)"),
|
|
160
159
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
|
|
161
160
|
'span, svg': {
|
|
162
161
|
height: '20px',
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
1
2
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
2
3
|
import _toArray from "@babel/runtime/helpers/toArray";
|
|
3
4
|
import { useState, useCallback, useMemo } from 'react';
|
|
@@ -93,10 +94,19 @@ export function useSharedPluginStateSelector(api, plugin) {
|
|
|
93
94
|
pluginName = _plugin$split4[0];
|
|
94
95
|
return [pluginName];
|
|
95
96
|
}, [plugin]);
|
|
96
|
-
|
|
97
|
+
var initialState = useMemo(function () {
|
|
98
|
+
var _api$pluginName;
|
|
99
|
+
var _plugin$split5 = plugin.split('.'),
|
|
100
|
+
_plugin$split6 = _slicedToArray(_plugin$split5, 1),
|
|
101
|
+
pluginName = _plugin$split6[0];
|
|
102
|
+
return transformer(_defineProperty({}, "".concat(pluginName, "State"), api === null || api === void 0 || (_api$pluginName = api[pluginName]) === null || _api$pluginName === void 0 ? void 0 : _api$pluginName.sharedState.currentState()));
|
|
103
|
+
}, [plugin, api, transformer]);
|
|
104
|
+
return useSharedPluginStateSelectorInternal(api, pluginNameArray, transformer, initialState);
|
|
97
105
|
}
|
|
98
|
-
|
|
99
|
-
|
|
106
|
+
|
|
107
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
108
|
+
function useSharedPluginStateSelectorInternal(api, plugins, transformer, initialState) {
|
|
109
|
+
var _useState = useState(initialState),
|
|
100
110
|
_useState2 = _slicedToArray(_useState, 2),
|
|
101
111
|
selectedPluginState = _useState2[0],
|
|
102
112
|
setSelectedPluginState = _useState2[1];
|
|
@@ -7,7 +7,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
7
7
|
import { isFedRamp } from './environment';
|
|
8
8
|
var SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
|
|
9
9
|
var packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
|
|
10
|
-
var packageVersion = "98.0.
|
|
10
|
+
var packageVersion = "98.0.3";
|
|
11
11
|
var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
|
|
12
12
|
// Remove URL as it has UGC
|
|
13
13
|
// TODO: Sanitise the URL instead of just removing it
|
|
@@ -20,7 +20,7 @@ import withAnalyticsContext from '@atlaskit/analytics-next/withAnalyticsContext'
|
|
|
20
20
|
import withAnalyticsEvents from '@atlaskit/analytics-next/withAnalyticsEvents';
|
|
21
21
|
import Layer from '../Layer';
|
|
22
22
|
var packageName = "@atlaskit/editor-common";
|
|
23
|
-
var packageVersion = "98.0.
|
|
23
|
+
var packageVersion = "98.0.3";
|
|
24
24
|
var halfFocusRing = 1;
|
|
25
25
|
var dropOffset = '0, 8';
|
|
26
26
|
// Ignored via go/ees005
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
1
2
|
export var iconOnlySpacing = {
|
|
2
3
|
'&&': {
|
|
3
4
|
padding: '0px'
|
|
@@ -34,6 +35,22 @@ var background = {
|
|
|
34
35
|
}
|
|
35
36
|
}
|
|
36
37
|
};
|
|
38
|
+
var backgroundVisualRefresh = {
|
|
39
|
+
danger: {
|
|
40
|
+
default: {
|
|
41
|
+
light: 'inherit',
|
|
42
|
+
dark: 'inherit'
|
|
43
|
+
},
|
|
44
|
+
hover: {
|
|
45
|
+
light: "var(--ds-background-danger-hovered, #FFD5D2)",
|
|
46
|
+
dark: "var(--ds-background-danger-hovered, #FFD5D2)"
|
|
47
|
+
},
|
|
48
|
+
active: {
|
|
49
|
+
light: "var(--ds-background-danger-pressed, #FD9891)",
|
|
50
|
+
dark: "var(--ds-background-danger-pressed, #FD9891)"
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
};
|
|
37
54
|
var color = {
|
|
38
55
|
danger: {
|
|
39
56
|
default: {
|
|
@@ -50,12 +67,31 @@ var color = {
|
|
|
50
67
|
}
|
|
51
68
|
}
|
|
52
69
|
};
|
|
70
|
+
var colorVisualRefresh = {
|
|
71
|
+
danger: {
|
|
72
|
+
default: {
|
|
73
|
+
light: "var(--ds-icon-subtle, #626F86)",
|
|
74
|
+
dark: "var(--ds-icon-subtle, #626F86)"
|
|
75
|
+
},
|
|
76
|
+
hover: {
|
|
77
|
+
light: "var(--ds-icon-danger, #C9372C)",
|
|
78
|
+
dark: "var(--ds-icon-danger, #C9372C)"
|
|
79
|
+
},
|
|
80
|
+
active: {
|
|
81
|
+
light: "var(--ds-icon-danger, #C9372C)",
|
|
82
|
+
dark: "var(--ds-icon-danger, #C9372C)"
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
};
|
|
53
86
|
|
|
54
87
|
// Ignored via go/ees005
|
|
55
88
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
56
89
|
export var getButtonStyles = function getButtonStyles(props) {
|
|
57
90
|
return {
|
|
58
|
-
background: getStyles(
|
|
59
|
-
|
|
91
|
+
background: getStyles(
|
|
92
|
+
// eslint-disable-next-line @atlaskit/platform/ensure-feature-flag-prefix
|
|
93
|
+
fg('platform-visual-refresh-icons') ? backgroundVisualRefresh : background, props),
|
|
94
|
+
// eslint-disable-next-line @atlaskit/platform/ensure-feature-flag-prefix
|
|
95
|
+
color: getStyles(fg('platform-visual-refresh-icons') ? colorVisualRefresh : color, props)
|
|
60
96
|
};
|
|
61
97
|
};
|
|
@@ -6,7 +6,6 @@ export declare const codeBlockWrappedStates: WeakMap<PmNode, boolean | undefined
|
|
|
6
6
|
export declare const isCodeBlockWordWrapEnabled: (codeBlockNode: PmNode) => boolean;
|
|
7
7
|
/**
|
|
8
8
|
* Swap the old node key with the new node key in the wrapped states WeakMap.
|
|
9
|
-
* Replaced with updateCodeBlockWrappedStateNodeKeys() under 'editor_code_block_wrapping_language_change_bug' feature gate.
|
|
10
9
|
*/
|
|
11
10
|
export declare const transferCodeBlockWrappedValue: (oldCodeBlockNode: PmNode, newCodeBlockNode: PmNode) => void;
|
|
12
11
|
/**
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import type { BasePluginDependenciesAPI, EditorInjectionAPI, ExtractInjectionAPI, NextEditorPlugin } from '../types/next-editor-plugin';
|
|
2
2
|
type NamedPluginStatesFromInjectionAPI<API extends ExtractInjectionAPI<NextEditorPlugin<any, any>>, PluginNames extends string | number | symbol> = Readonly<{
|
|
3
|
-
[K in PluginNames as `${K extends string ? K : never}State`]: API[K] extends
|
|
4
|
-
BasePluginDependenciesAPI<any> | undefined ? ReturnType<API[K]['sharedState']['currentState']> : never;
|
|
3
|
+
[K in PluginNames as `${K extends string ? K : never}State`]: API[K] extends BasePluginDependenciesAPI<any> | undefined ? ReturnType<API[K]['sharedState']['currentState']> : never;
|
|
5
4
|
}>;
|
|
6
5
|
type ExtractPluginNames<API extends EditorInjectionAPI<any, any>> = keyof API;
|
|
7
6
|
type Cleanup = () => void;
|
|
@@ -6,7 +6,6 @@ export declare const codeBlockWrappedStates: WeakMap<PmNode, boolean | undefined
|
|
|
6
6
|
export declare const isCodeBlockWordWrapEnabled: (codeBlockNode: PmNode) => boolean;
|
|
7
7
|
/**
|
|
8
8
|
* Swap the old node key with the new node key in the wrapped states WeakMap.
|
|
9
|
-
* Replaced with updateCodeBlockWrappedStateNodeKeys() under 'editor_code_block_wrapping_language_change_bug' feature gate.
|
|
10
9
|
*/
|
|
11
10
|
export declare const transferCodeBlockWrappedValue: (oldCodeBlockNode: PmNode, newCodeBlockNode: PmNode) => void;
|
|
12
11
|
/**
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import type { BasePluginDependenciesAPI, EditorInjectionAPI, ExtractInjectionAPI, NextEditorPlugin } from '../types/next-editor-plugin';
|
|
2
2
|
type NamedPluginStatesFromInjectionAPI<API extends ExtractInjectionAPI<NextEditorPlugin<any, any>>, PluginNames extends string | number | symbol> = Readonly<{
|
|
3
|
-
[K in PluginNames as `${K extends string ? K : never}State`]: API[K] extends
|
|
4
|
-
BasePluginDependenciesAPI<any> | undefined ? ReturnType<API[K]['sharedState']['currentState']> : never;
|
|
3
|
+
[K in PluginNames as `${K extends string ? K : never}State`]: API[K] extends BasePluginDependenciesAPI<any> | undefined ? ReturnType<API[K]['sharedState']['currentState']> : never;
|
|
5
4
|
}>;
|
|
6
5
|
type ExtractPluginNames<API extends EditorInjectionAPI<any, any>> = keyof API;
|
|
7
6
|
type Cleanup = () => void;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-common",
|
|
3
|
-
"version": "98.0.
|
|
3
|
+
"version": "98.0.3",
|
|
4
4
|
"description": "A package that contains common classes and components for editor and renderer",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -248,9 +248,6 @@
|
|
|
248
248
|
"editor_inline_comments_paste_insert_nodes": {
|
|
249
249
|
"type": "boolean"
|
|
250
250
|
},
|
|
251
|
-
"editor_code_block_wrapping_language_change_bug": {
|
|
252
|
-
"type": "boolean"
|
|
253
|
-
},
|
|
254
251
|
"platform_editor_react18_mention_with_provider_fix": {
|
|
255
252
|
"type": "boolean"
|
|
256
253
|
},
|