@atlaskit/editor-common 136.0.0 → 137.1.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 +43 -0
- package/dist/cjs/card/LinkToolbarButtonGroup.js +2 -4
- package/dist/cjs/card/link-toolbar-button-group-options.js +2 -3
- package/dist/cjs/credit-guard/CreditCheckedFloatingToolbarButton.js +3 -5
- package/dist/cjs/credit-guard/checkAICreditStatus.js +6 -1
- package/dist/cjs/credit-guard/getCreditCheckedFloatingToolbarItem.js +1 -3
- package/dist/cjs/credit-guard/useAICreditGuard.js +2 -2
- package/dist/cjs/floating-toolbar/DropdownMenuExtensionItems.js +2 -3
- package/dist/cjs/monitoring/error.js +1 -1
- package/dist/cjs/ui/DropList/index.js +1 -1
- package/dist/cjs/ui/FloatingToolbar/Button.js +3 -4
- package/dist/cjs/ui/FloatingToolbar/Separator.js +2 -10
- package/dist/cjs/ui-menu/ToolbarArrowKeyNavigationProvider/index.js +1 -1
- package/dist/es2019/card/LinkToolbarButtonGroup.js +2 -4
- package/dist/es2019/card/link-toolbar-button-group-options.js +2 -3
- package/dist/es2019/credit-guard/CreditCheckedFloatingToolbarButton.js +2 -4
- package/dist/es2019/credit-guard/checkAICreditStatus.js +6 -1
- package/dist/es2019/credit-guard/getCreditCheckedFloatingToolbarItem.js +0 -2
- package/dist/es2019/credit-guard/useAICreditGuard.js +2 -2
- package/dist/es2019/floating-toolbar/DropdownMenuExtensionItems.js +2 -3
- package/dist/es2019/monitoring/error.js +1 -1
- package/dist/es2019/ui/DropList/index.js +1 -1
- package/dist/es2019/ui/FloatingToolbar/Button.js +3 -4
- package/dist/es2019/ui/FloatingToolbar/Separator.js +2 -10
- package/dist/es2019/ui-menu/ToolbarArrowKeyNavigationProvider/index.js +1 -1
- package/dist/esm/card/LinkToolbarButtonGroup.js +2 -4
- package/dist/esm/card/link-toolbar-button-group-options.js +2 -3
- package/dist/esm/credit-guard/CreditCheckedFloatingToolbarButton.js +3 -5
- package/dist/esm/credit-guard/checkAICreditStatus.js +6 -1
- package/dist/esm/credit-guard/getCreditCheckedFloatingToolbarItem.js +1 -3
- package/dist/esm/credit-guard/useAICreditGuard.js +2 -2
- package/dist/esm/floating-toolbar/DropdownMenuExtensionItems.js +2 -3
- package/dist/esm/monitoring/error.js +1 -1
- package/dist/esm/ui/DropList/index.js +1 -1
- package/dist/esm/ui/FloatingToolbar/Button.js +3 -4
- package/dist/esm/ui/FloatingToolbar/Separator.js +2 -10
- package/dist/esm/ui-menu/ToolbarArrowKeyNavigationProvider/index.js +1 -1
- package/dist/types/card/LinkToolbarButtonGroup.d.ts +0 -1
- package/dist/types/card/index.d.ts +1 -1
- package/dist/types/card/link-toolbar-button-group-options.d.ts +1 -1
- package/dist/types/card/types.d.ts +6 -0
- package/dist/types/credit-guard/CreditCheckedFloatingToolbarButton.d.ts +1 -2
- package/dist/types/credit-guard/checkAICreditStatus.d.ts +2 -1
- package/dist/types/credit-guard/getCreditCheckedFloatingToolbarItem.d.ts +1 -1
- package/dist/types/credit-guard/types.d.ts +1 -1
- package/dist/types/credit-guard/useAICreditGuard.d.ts +3 -2
- package/dist/types/floating-toolbar/DropdownMenuExtensionItems.d.ts +0 -1
- package/dist/types/ui/FloatingToolbar/Button.d.ts +0 -1
- package/dist/types/ui/FloatingToolbar/Separator.d.ts +1 -2
- package/package.json +4 -4
- package/dist/cjs/toolbar-flag-check.js +0 -9
- package/dist/es2019/toolbar-flag-check.js +0 -1
- package/dist/esm/toolbar-flag-check.js +0 -3
- package/dist/types/toolbar-flag-check.d.ts +0 -1
- package/toolbar-flag-check/package.json +0 -10
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,48 @@
|
|
|
1
1
|
# @atlaskit/editor-common
|
|
2
2
|
|
|
3
|
+
## 137.1.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [`9a4b8cfc2a3c5`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/9a4b8cfc2a3c5) -
|
|
8
|
+
Expose the optional product credit check through the AI plugin API. Check skill eligibility before
|
|
9
|
+
query removal in the registered menus using `quickInsert-skill` and `elementBrowser-skill`, with
|
|
10
|
+
product-owned recovery content. Respect the existing `confluence_ubp_quick_insert_menu` and
|
|
11
|
+
`jira_ai_ubp_enforcement_messaging` rollouts under `platform_editor_slash_command`.
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- Updated dependencies
|
|
16
|
+
|
|
17
|
+
## 137.0.1
|
|
18
|
+
|
|
19
|
+
### Patch Changes
|
|
20
|
+
|
|
21
|
+
- Updated dependencies
|
|
22
|
+
|
|
23
|
+
## 137.0.0
|
|
24
|
+
|
|
25
|
+
### Major Changes
|
|
26
|
+
|
|
27
|
+
- [`cabf3c7e59b8d`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/cabf3c7e59b8d) -
|
|
28
|
+
Remove the `@atlaskit/editor-common/toolbar-flag-check` entry point and the
|
|
29
|
+
`areAnyNewToolbarFlagsEnabled` prop from `LinkToolbarButtonGroup`, `getButtonGroupOption`,
|
|
30
|
+
`CreditCheckedFloatingToolbarButton`, `getCreditCheckedFloatingToolbarItem`,
|
|
31
|
+
`DropdownMenuExtensionItems`, and the floating toolbar `Button` and `Separator` components.
|
|
32
|
+
`areToolbarFlagsEnabled` always returned `true` after the `platform_editor_controls` cleanup, so
|
|
33
|
+
these components now always render the new toolbar styles. Remove any import of
|
|
34
|
+
`toolbar-flag-check` and stop passing `areAnyNewToolbarFlagsEnabled`.
|
|
35
|
+
|
|
36
|
+
### Minor Changes
|
|
37
|
+
|
|
38
|
+
- [`895e65e4d77e5`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/895e65e4d77e5) -
|
|
39
|
+
Add optional getEmbedCardTransformNode to EmbedCardTransformers so the card toolbar can check
|
|
40
|
+
where a transformed embed would be inserted
|
|
41
|
+
|
|
42
|
+
### Patch Changes
|
|
43
|
+
|
|
44
|
+
- Updated dependencies
|
|
45
|
+
|
|
3
46
|
## 136.0.0
|
|
4
47
|
|
|
5
48
|
### Major Changes
|
|
@@ -52,8 +52,7 @@ var LinkToolbarButtonGroup = exports.LinkToolbarButtonGroup = function LinkToolb
|
|
|
52
52
|
testId = _ref3.testId,
|
|
53
53
|
tooltipContent = _ref3.tooltipContent,
|
|
54
54
|
title = _ref3.title,
|
|
55
|
-
icon = _ref3.icon
|
|
56
|
-
areAnyNewToolbarFlagsEnabled = _ref3.areAnyNewToolbarFlagsEnabled;
|
|
55
|
+
icon = _ref3.icon;
|
|
57
56
|
var ButtonIcon = icon;
|
|
58
57
|
return (0, _react2.jsx)(DisallowedWrapper, {
|
|
59
58
|
key: testId,
|
|
@@ -69,8 +68,7 @@ var LinkToolbarButtonGroup = exports.LinkToolbarButtonGroup = function LinkToolb
|
|
|
69
68
|
onClick: onClick,
|
|
70
69
|
testId: testId,
|
|
71
70
|
disabled: disabled,
|
|
72
|
-
tooltipContent: tooltipContent
|
|
73
|
-
areAnyNewToolbarFlagsEnabled: areAnyNewToolbarFlagsEnabled
|
|
71
|
+
tooltipContent: tooltipContent
|
|
74
72
|
}));
|
|
75
73
|
}));
|
|
76
74
|
};
|
|
@@ -11,7 +11,7 @@ Object.defineProperty(exports, "appearancePropsMap", {
|
|
|
11
11
|
});
|
|
12
12
|
exports.getButtonGroupOption = void 0;
|
|
13
13
|
var _appearancePropsMap2 = require("./appearancePropsMap");
|
|
14
|
-
var getButtonGroupOption = exports.getButtonGroupOption = function getButtonGroupOption(intl,
|
|
14
|
+
var getButtonGroupOption = exports.getButtonGroupOption = function getButtonGroupOption(intl, dispatchCommand, _ref) {
|
|
15
15
|
var disabled = _ref.disabled,
|
|
16
16
|
_onClick = _ref.onClick,
|
|
17
17
|
selected = _ref.selected,
|
|
@@ -30,8 +30,7 @@ var getButtonGroupOption = exports.getButtonGroupOption = function getButtonGrou
|
|
|
30
30
|
disabled: Boolean(disabled),
|
|
31
31
|
tooltipContent: tooltip || null,
|
|
32
32
|
testId: testId,
|
|
33
|
-
selected: selected
|
|
34
|
-
areAnyNewToolbarFlagsEnabled: areAnyNewToolbarFlagsEnabled
|
|
33
|
+
selected: selected
|
|
35
34
|
};
|
|
36
35
|
};
|
|
37
36
|
// eslint-disable-next-line @atlaskit/editor/no-re-export
|
|
@@ -20,8 +20,7 @@ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r
|
|
|
20
20
|
* product's credits popup to itself when credits are blocked. Matches the floating toolbar's own buttons.
|
|
21
21
|
*/
|
|
22
22
|
var CreditCheckedFloatingToolbarButton = exports.CreditCheckedFloatingToolbarButton = function CreditCheckedFloatingToolbarButton(_ref) {
|
|
23
|
-
var
|
|
24
|
-
button = _ref.button,
|
|
23
|
+
var button = _ref.button,
|
|
25
24
|
creditCheck = _ref.creditCheck,
|
|
26
25
|
getAICreditStatus = _ref.getAICreditStatus,
|
|
27
26
|
view = _ref.view;
|
|
@@ -100,10 +99,9 @@ var CreditCheckedFloatingToolbarButton = exports.CreditCheckedFloatingToolbarBut
|
|
|
100
99
|
isRadioButton: button.isRadioButton,
|
|
101
100
|
pulse: button.pulse,
|
|
102
101
|
testId: button.testId,
|
|
103
|
-
interactionName: button.interactionName
|
|
104
|
-
areAnyNewToolbarFlagsEnabled: areAnyNewToolbarFlagsEnabled
|
|
102
|
+
interactionName: button.interactionName
|
|
105
103
|
}, showTitle && title);
|
|
106
|
-
}, [
|
|
104
|
+
}, [button, runCommand]);
|
|
107
105
|
return /*#__PURE__*/_react.default.createElement(_CreditCheckedPopup.CreditCheckedPopup, {
|
|
108
106
|
creditCheck: creditCheck,
|
|
109
107
|
getAICreditStatus: getAICreditStatus,
|
|
@@ -7,7 +7,12 @@ exports.checkAICreditStatus = void 0;
|
|
|
7
7
|
/** Editor consumes cached decisions synchronously; legacy async providers fail open. */
|
|
8
8
|
var checkAICreditStatus = exports.checkAICreditStatus = function checkAICreditStatus(getAICreditStatus, creditCheck) {
|
|
9
9
|
try {
|
|
10
|
-
var result = getAICreditStatus(creditCheck);
|
|
10
|
+
var result = getAICreditStatus === null || getAICreditStatus === void 0 ? void 0 : getAICreditStatus(creditCheck);
|
|
11
|
+
if (!result) {
|
|
12
|
+
return {
|
|
13
|
+
isBlocked: false
|
|
14
|
+
};
|
|
15
|
+
}
|
|
11
16
|
if ('then' in result) {
|
|
12
17
|
// Temporary compatibility: never defer an Editor action or apply a late decision.
|
|
13
18
|
void result.catch(function () {});
|
|
@@ -9,8 +9,7 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
9
9
|
var _CreditCheckedFloatingToolbarButton = require("./CreditCheckedFloatingToolbarButton");
|
|
10
10
|
/** Wraps a floating toolbar button so it is credit checked, keeping its own appearance and handlers. */
|
|
11
11
|
var getCreditCheckedFloatingToolbarItem = exports.getCreditCheckedFloatingToolbarItem = function getCreditCheckedFloatingToolbarItem(_ref) {
|
|
12
|
-
var
|
|
13
|
-
button = _ref.button,
|
|
12
|
+
var button = _ref.button,
|
|
14
13
|
creditCheck = _ref.creditCheck,
|
|
15
14
|
getAICreditStatus = _ref.getAICreditStatus;
|
|
16
15
|
return {
|
|
@@ -19,7 +18,6 @@ var getCreditCheckedFloatingToolbarItem = exports.getCreditCheckedFloatingToolba
|
|
|
19
18
|
render: function render(view, idx) {
|
|
20
19
|
return /*#__PURE__*/_react.default.createElement(_CreditCheckedFloatingToolbarButton.CreditCheckedFloatingToolbarButton, {
|
|
21
20
|
key: idx,
|
|
22
|
-
areAnyNewToolbarFlagsEnabled: areAnyNewToolbarFlagsEnabled,
|
|
23
21
|
button: button,
|
|
24
22
|
creditCheck: creditCheck,
|
|
25
23
|
getAICreditStatus: getAICreditStatus,
|
|
@@ -23,11 +23,11 @@ var useAICreditGuard = exports.useAICreditGuard = function useAICreditGuard(getA
|
|
|
23
23
|
return setFeedback(null);
|
|
24
24
|
}, []);
|
|
25
25
|
(0, _react.useLayoutEffect)(function () {
|
|
26
|
-
if (!isActive) {
|
|
26
|
+
if (!isActive || getAICreditStatus === undefined) {
|
|
27
27
|
close();
|
|
28
28
|
setIsBlocked(false);
|
|
29
29
|
}
|
|
30
|
-
}, [isActive, close]);
|
|
30
|
+
}, [getAICreditStatus, isActive, close]);
|
|
31
31
|
var check = (0, _react.useCallback)(function (creditCheck) {
|
|
32
32
|
var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
|
|
33
33
|
_ref$showFeedback = _ref.showFeedback,
|
|
@@ -147,8 +147,7 @@ var DropdownMenuExtensionItems = exports.DropdownMenuExtensionItems = function D
|
|
|
147
147
|
editorView = props.editorView,
|
|
148
148
|
extension = props.extension,
|
|
149
149
|
disabled = props.disabled,
|
|
150
|
-
dropdownOptions = props.dropdownOptions
|
|
151
|
-
areAnyNewToolbarFlagsEnabled = props.areAnyNewToolbarFlagsEnabled;
|
|
150
|
+
dropdownOptions = props.dropdownOptions;
|
|
152
151
|
|
|
153
152
|
// Ignored via go/ees005
|
|
154
153
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
@@ -214,5 +213,5 @@ var DropdownMenuExtensionItems = exports.DropdownMenuExtensionItems = function D
|
|
|
214
213
|
extension: extension,
|
|
215
214
|
dropdownOptions: dropdownOptions
|
|
216
215
|
});
|
|
217
|
-
}),
|
|
216
|
+
}), /*#__PURE__*/_react.default.createElement(_DropdownSeparator.DropdownSeparator, null));
|
|
218
217
|
};
|
|
@@ -27,7 +27,7 @@ var NETWORK_FAILURE_REGEX = /^network failure/i;
|
|
|
27
27
|
var RESIZE_OBSERVER_LOOP_REGEX = /ResizeObserver loop completed with undelivered notifications/;
|
|
28
28
|
var SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
|
|
29
29
|
var packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
|
|
30
|
-
var packageVersion = "
|
|
30
|
+
var packageVersion = "137.0.1";
|
|
31
31
|
var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
|
|
32
32
|
// Remove URL as it has UGC
|
|
33
33
|
// Ignored via go/ees007
|
|
@@ -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 = "
|
|
26
|
+
var packageVersion = "137.0.1";
|
|
27
27
|
var halfFocusRing = 1;
|
|
28
28
|
var dropOffset = '0, 8';
|
|
29
29
|
// Ignored via go/ees005
|
|
@@ -57,8 +57,7 @@ var FloatingToolbarButton = function FloatingToolbarButton(_ref, forwardedRef) {
|
|
|
57
57
|
ariaLabel = _ref.ariaLabel,
|
|
58
58
|
isRadioButton = _ref.isRadioButton,
|
|
59
59
|
isLoading = _ref.isLoading,
|
|
60
|
-
pulse = _ref.pulse
|
|
61
|
-
areAnyNewToolbarFlagsEnabled = _ref.areAnyNewToolbarFlagsEnabled;
|
|
60
|
+
pulse = _ref.pulse;
|
|
62
61
|
// Check if there's only an icon and add additional styles
|
|
63
62
|
var iconOnly = (icon || iconAfter) && !children;
|
|
64
63
|
var customSpacing = iconOnly ? _iconOnlySpacing.iconOnlySpacing : {};
|
|
@@ -116,7 +115,7 @@ var FloatingToolbarButton = function FloatingToolbarButton(_ref, forwardedRef) {
|
|
|
116
115
|
appearance: appearance,
|
|
117
116
|
state: themeProps.state,
|
|
118
117
|
mode: themeProps.mode
|
|
119
|
-
})),
|
|
118
|
+
})), customSizeAndPadding)
|
|
120
119
|
}, rest);
|
|
121
120
|
},
|
|
122
121
|
id: id,
|
|
@@ -126,7 +125,7 @@ var FloatingToolbarButton = function FloatingToolbarButton(_ref, forwardedRef) {
|
|
|
126
125
|
role: isRadioButton ? 'radio' : undefined,
|
|
127
126
|
"aria-expanded": ariaHasPopup ? selected : undefined,
|
|
128
127
|
"aria-controls": ariaHasPopup ? areaControls : undefined,
|
|
129
|
-
spacing:
|
|
128
|
+
spacing: "default",
|
|
130
129
|
href: href,
|
|
131
130
|
target: target,
|
|
132
131
|
appearance: appearance,
|
|
@@ -12,13 +12,6 @@ var _react = require("@emotion/react");
|
|
|
12
12
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled, @typescript-eslint/consistent-type-imports -- Ignored via go/DSP-18766; jsx required at runtime for @jsxRuntime classic
|
|
13
13
|
|
|
14
14
|
var separator = (0, _react.css)({
|
|
15
|
-
background: "var(--ds-border, #0B120E24)",
|
|
16
|
-
width: '1px',
|
|
17
|
-
height: '20px',
|
|
18
|
-
margin: "0 ".concat("var(--ds-space-050, 4px)"),
|
|
19
|
-
alignSelf: 'center'
|
|
20
|
-
});
|
|
21
|
-
var separatorNew = (0, _react.css)({
|
|
22
15
|
background: "var(--ds-border, #0B120E24)",
|
|
23
16
|
width: '1px',
|
|
24
17
|
height: '20px',
|
|
@@ -28,10 +21,9 @@ var separatorFullHeight = (0, _react.css)({
|
|
|
28
21
|
height: '40px'
|
|
29
22
|
});
|
|
30
23
|
var _default = exports.default = function _default(_ref) {
|
|
31
|
-
var fullHeight = _ref.fullHeight
|
|
32
|
-
areAnyNewToolbarFlagsEnabled = _ref.areAnyNewToolbarFlagsEnabled;
|
|
24
|
+
var fullHeight = _ref.fullHeight;
|
|
33
25
|
return (0, _react.jsx)("div", {
|
|
34
|
-
css: [
|
|
26
|
+
css: [separator, fullHeight && separatorFullHeight]
|
|
35
27
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
36
28
|
,
|
|
37
29
|
className: "separator"
|
|
@@ -289,6 +289,6 @@ function getFilteredFocusableElements(rootNode) {
|
|
|
289
289
|
return getFocusableElements(rootNode).filter(function (elm) {
|
|
290
290
|
// Check if element or any ancestor is hidden or disabled
|
|
291
291
|
var isHiddenOrDisabled = isElementOrAncestorHiddenOrDisabled(elm, rootNode);
|
|
292
|
-
return !elm.closest('[data-role="droplistContent"]') && !elm.closest('[data-emoji-picker-container="true"]') && !elm.closest('[data-test-id="color-picker-menu"]') && !elm.closest('[data-keyboard-navigation-independent]') && !
|
|
292
|
+
return !elm.closest('[data-role="droplistContent"]') && !elm.closest('[data-emoji-picker-container="true"]') && !elm.closest('[data-test-id="color-picker-menu"]') && !elm.closest('[data-keyboard-navigation-independent]') && !isHiddenOrDisabled;
|
|
293
293
|
});
|
|
294
294
|
}
|
|
@@ -47,8 +47,7 @@ export const LinkToolbarButtonGroup = ({
|
|
|
47
47
|
testId,
|
|
48
48
|
tooltipContent,
|
|
49
49
|
title,
|
|
50
|
-
icon
|
|
51
|
-
areAnyNewToolbarFlagsEnabled
|
|
50
|
+
icon
|
|
52
51
|
}) => {
|
|
53
52
|
const ButtonIcon = icon;
|
|
54
53
|
return jsx(DisallowedWrapper, {
|
|
@@ -65,8 +64,7 @@ export const LinkToolbarButtonGroup = ({
|
|
|
65
64
|
onClick: onClick,
|
|
66
65
|
testId: testId,
|
|
67
66
|
disabled: disabled,
|
|
68
|
-
tooltipContent: tooltipContent
|
|
69
|
-
areAnyNewToolbarFlagsEnabled: areAnyNewToolbarFlagsEnabled
|
|
67
|
+
tooltipContent: tooltipContent
|
|
70
68
|
}));
|
|
71
69
|
}));
|
|
72
70
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { appearancePropsMap } from './appearancePropsMap';
|
|
2
|
-
export const getButtonGroupOption = (intl,
|
|
2
|
+
export const getButtonGroupOption = (intl, dispatchCommand, {
|
|
3
3
|
disabled,
|
|
4
4
|
onClick,
|
|
5
5
|
selected,
|
|
@@ -18,8 +18,7 @@ export const getButtonGroupOption = (intl, areAnyNewToolbarFlagsEnabled, dispatc
|
|
|
18
18
|
disabled: Boolean(disabled),
|
|
19
19
|
tooltipContent: tooltip || null,
|
|
20
20
|
testId,
|
|
21
|
-
selected
|
|
22
|
-
areAnyNewToolbarFlagsEnabled: areAnyNewToolbarFlagsEnabled
|
|
21
|
+
selected
|
|
23
22
|
};
|
|
24
23
|
};
|
|
25
24
|
// eslint-disable-next-line @atlaskit/editor/no-re-export
|
|
@@ -12,7 +12,6 @@ import { CreditCheckedPopup } from './CreditCheckedPopup';
|
|
|
12
12
|
* product's credits popup to itself when credits are blocked. Matches the floating toolbar's own buttons.
|
|
13
13
|
*/
|
|
14
14
|
export const CreditCheckedFloatingToolbarButton = ({
|
|
15
|
-
areAnyNewToolbarFlagsEnabled,
|
|
16
15
|
button,
|
|
17
16
|
creditCheck,
|
|
18
17
|
getAICreditStatus,
|
|
@@ -88,10 +87,9 @@ export const CreditCheckedFloatingToolbarButton = ({
|
|
|
88
87
|
isRadioButton: button.isRadioButton,
|
|
89
88
|
pulse: button.pulse,
|
|
90
89
|
testId: button.testId,
|
|
91
|
-
interactionName: button.interactionName
|
|
92
|
-
areAnyNewToolbarFlagsEnabled: areAnyNewToolbarFlagsEnabled
|
|
90
|
+
interactionName: button.interactionName
|
|
93
91
|
}, showTitle && title);
|
|
94
|
-
}, [
|
|
92
|
+
}, [button, runCommand]);
|
|
95
93
|
return /*#__PURE__*/React.createElement(CreditCheckedPopup, {
|
|
96
94
|
creditCheck: creditCheck,
|
|
97
95
|
getAICreditStatus: getAICreditStatus,
|
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
/** Editor consumes cached decisions synchronously; legacy async providers fail open. */
|
|
2
2
|
export const checkAICreditStatus = (getAICreditStatus, creditCheck) => {
|
|
3
3
|
try {
|
|
4
|
-
const result = getAICreditStatus(creditCheck);
|
|
4
|
+
const result = getAICreditStatus === null || getAICreditStatus === void 0 ? void 0 : getAICreditStatus(creditCheck);
|
|
5
|
+
if (!result) {
|
|
6
|
+
return {
|
|
7
|
+
isBlocked: false
|
|
8
|
+
};
|
|
9
|
+
}
|
|
5
10
|
if ('then' in result) {
|
|
6
11
|
// Temporary compatibility: never defer an Editor action or apply a late decision.
|
|
7
12
|
void result.catch(() => {});
|
|
@@ -3,7 +3,6 @@ import { CreditCheckedFloatingToolbarButton } from './CreditCheckedFloatingToolb
|
|
|
3
3
|
|
|
4
4
|
/** Wraps a floating toolbar button so it is credit checked, keeping its own appearance and handlers. */
|
|
5
5
|
export const getCreditCheckedFloatingToolbarItem = ({
|
|
6
|
-
areAnyNewToolbarFlagsEnabled,
|
|
7
6
|
button,
|
|
8
7
|
creditCheck,
|
|
9
8
|
getAICreditStatus
|
|
@@ -12,7 +11,6 @@ export const getCreditCheckedFloatingToolbarItem = ({
|
|
|
12
11
|
fallback: [],
|
|
13
12
|
render: (view, idx) => /*#__PURE__*/React.createElement(CreditCheckedFloatingToolbarButton, {
|
|
14
13
|
key: idx,
|
|
15
|
-
areAnyNewToolbarFlagsEnabled: areAnyNewToolbarFlagsEnabled,
|
|
16
14
|
button: button,
|
|
17
15
|
creditCheck: creditCheck,
|
|
18
16
|
getAICreditStatus: getAICreditStatus,
|
|
@@ -6,11 +6,11 @@ export const useAICreditGuard = (getAICreditStatus, isActive = true) => {
|
|
|
6
6
|
const [isBlocked, setIsBlocked] = useState(false);
|
|
7
7
|
const close = useCallback(() => setFeedback(null), []);
|
|
8
8
|
useLayoutEffect(() => {
|
|
9
|
-
if (!isActive) {
|
|
9
|
+
if (!isActive || getAICreditStatus === undefined) {
|
|
10
10
|
close();
|
|
11
11
|
setIsBlocked(false);
|
|
12
12
|
}
|
|
13
|
-
}, [isActive, close]);
|
|
13
|
+
}, [getAICreditStatus, isActive, close]);
|
|
14
14
|
const check = useCallback((creditCheck, {
|
|
15
15
|
showFeedback = true
|
|
16
16
|
} = {}) => {
|
|
@@ -107,8 +107,7 @@ export const DropdownMenuExtensionItems = props => {
|
|
|
107
107
|
editorView,
|
|
108
108
|
extension,
|
|
109
109
|
disabled,
|
|
110
|
-
dropdownOptions
|
|
111
|
-
areAnyNewToolbarFlagsEnabled
|
|
110
|
+
dropdownOptions
|
|
112
111
|
} = props;
|
|
113
112
|
|
|
114
113
|
// Ignored via go/ees005
|
|
@@ -146,5 +145,5 @@ export const DropdownMenuExtensionItems = props => {
|
|
|
146
145
|
extension: extension,
|
|
147
146
|
dropdownOptions: dropdownOptions
|
|
148
147
|
});
|
|
149
|
-
}),
|
|
148
|
+
}), /*#__PURE__*/React.createElement(DropdownSeparator, null));
|
|
150
149
|
};
|
|
@@ -13,7 +13,7 @@ const NETWORK_FAILURE_REGEX = /^network failure/i;
|
|
|
13
13
|
const RESIZE_OBSERVER_LOOP_REGEX = /ResizeObserver loop completed with undelivered notifications/;
|
|
14
14
|
const SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
|
|
15
15
|
const packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
|
|
16
|
-
const packageVersion = "
|
|
16
|
+
const packageVersion = "137.0.1";
|
|
17
17
|
const sanitiseSentryEvents = (data, _hint) => {
|
|
18
18
|
// Remove URL as it has UGC
|
|
19
19
|
// Ignored via go/ees007
|
|
@@ -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 = "
|
|
16
|
+
const packageVersion = "137.0.1";
|
|
17
17
|
const halfFocusRing = 1;
|
|
18
18
|
const dropOffset = '0, 8';
|
|
19
19
|
// Ignored via go/ees005
|
|
@@ -40,8 +40,7 @@ const FloatingToolbarButton = ({
|
|
|
40
40
|
ariaLabel,
|
|
41
41
|
isRadioButton,
|
|
42
42
|
isLoading,
|
|
43
|
-
pulse
|
|
44
|
-
areAnyNewToolbarFlagsEnabled
|
|
43
|
+
pulse
|
|
45
44
|
}, forwardedRef) => {
|
|
46
45
|
// Check if there's only an icon and add additional styles
|
|
47
46
|
const iconOnly = (icon || iconAfter) && !children;
|
|
@@ -103,7 +102,7 @@ const FloatingToolbarButton = ({
|
|
|
103
102
|
state: themeProps.state,
|
|
104
103
|
mode: themeProps.mode
|
|
105
104
|
})),
|
|
106
|
-
...
|
|
105
|
+
...customSizeAndPadding
|
|
107
106
|
},
|
|
108
107
|
...rest
|
|
109
108
|
};
|
|
@@ -115,7 +114,7 @@ const FloatingToolbarButton = ({
|
|
|
115
114
|
role: isRadioButton ? 'radio' : undefined,
|
|
116
115
|
"aria-expanded": ariaHasPopup ? selected : undefined,
|
|
117
116
|
"aria-controls": ariaHasPopup ? areaControls : undefined,
|
|
118
|
-
spacing:
|
|
117
|
+
spacing: "default",
|
|
119
118
|
href: href,
|
|
120
119
|
target: target,
|
|
121
120
|
appearance: appearance,
|
|
@@ -5,13 +5,6 @@
|
|
|
5
5
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled, @typescript-eslint/consistent-type-imports -- Ignored via go/DSP-18766; jsx required at runtime for @jsxRuntime classic
|
|
6
6
|
import { css, jsx } from '@emotion/react';
|
|
7
7
|
const separator = css({
|
|
8
|
-
background: "var(--ds-border, #0B120E24)",
|
|
9
|
-
width: '1px',
|
|
10
|
-
height: '20px',
|
|
11
|
-
margin: `0 ${"var(--ds-space-050, 4px)"}`,
|
|
12
|
-
alignSelf: 'center'
|
|
13
|
-
});
|
|
14
|
-
const separatorNew = css({
|
|
15
8
|
background: "var(--ds-border, #0B120E24)",
|
|
16
9
|
width: '1px',
|
|
17
10
|
height: '20px',
|
|
@@ -21,10 +14,9 @@ const separatorFullHeight = css({
|
|
|
21
14
|
height: '40px'
|
|
22
15
|
});
|
|
23
16
|
export default (({
|
|
24
|
-
fullHeight
|
|
25
|
-
areAnyNewToolbarFlagsEnabled
|
|
17
|
+
fullHeight
|
|
26
18
|
}) => jsx("div", {
|
|
27
|
-
css: [
|
|
19
|
+
css: [separator, fullHeight && separatorFullHeight]
|
|
28
20
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
29
21
|
,
|
|
30
22
|
className: "separator"
|
|
@@ -282,6 +282,6 @@ function getFilteredFocusableElements(rootNode) {
|
|
|
282
282
|
return getFocusableElements(rootNode).filter(elm => {
|
|
283
283
|
// Check if element or any ancestor is hidden or disabled
|
|
284
284
|
const isHiddenOrDisabled = isElementOrAncestorHiddenOrDisabled(elm, rootNode);
|
|
285
|
-
return !elm.closest('[data-role="droplistContent"]') && !elm.closest('[data-emoji-picker-container="true"]') && !elm.closest('[data-test-id="color-picker-menu"]') && !elm.closest('[data-keyboard-navigation-independent]') && !
|
|
285
|
+
return !elm.closest('[data-role="droplistContent"]') && !elm.closest('[data-emoji-picker-container="true"]') && !elm.closest('[data-test-id="color-picker-menu"]') && !elm.closest('[data-keyboard-navigation-independent]') && !isHiddenOrDisabled;
|
|
286
286
|
});
|
|
287
287
|
}
|
|
@@ -45,8 +45,7 @@ export var LinkToolbarButtonGroup = function LinkToolbarButtonGroup(_ref2) {
|
|
|
45
45
|
testId = _ref3.testId,
|
|
46
46
|
tooltipContent = _ref3.tooltipContent,
|
|
47
47
|
title = _ref3.title,
|
|
48
|
-
icon = _ref3.icon
|
|
49
|
-
areAnyNewToolbarFlagsEnabled = _ref3.areAnyNewToolbarFlagsEnabled;
|
|
48
|
+
icon = _ref3.icon;
|
|
50
49
|
var ButtonIcon = icon;
|
|
51
50
|
return jsx(DisallowedWrapper, {
|
|
52
51
|
key: testId,
|
|
@@ -62,8 +61,7 @@ export var LinkToolbarButtonGroup = function LinkToolbarButtonGroup(_ref2) {
|
|
|
62
61
|
onClick: onClick,
|
|
63
62
|
testId: testId,
|
|
64
63
|
disabled: disabled,
|
|
65
|
-
tooltipContent: tooltipContent
|
|
66
|
-
areAnyNewToolbarFlagsEnabled: areAnyNewToolbarFlagsEnabled
|
|
64
|
+
tooltipContent: tooltipContent
|
|
67
65
|
}));
|
|
68
66
|
}));
|
|
69
67
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { appearancePropsMap } from './appearancePropsMap';
|
|
2
|
-
export var getButtonGroupOption = function getButtonGroupOption(intl,
|
|
2
|
+
export var getButtonGroupOption = function getButtonGroupOption(intl, dispatchCommand, _ref) {
|
|
3
3
|
var disabled = _ref.disabled,
|
|
4
4
|
_onClick = _ref.onClick,
|
|
5
5
|
selected = _ref.selected,
|
|
@@ -18,8 +18,7 @@ export var getButtonGroupOption = function getButtonGroupOption(intl, areAnyNewT
|
|
|
18
18
|
disabled: Boolean(disabled),
|
|
19
19
|
tooltipContent: tooltip || null,
|
|
20
20
|
testId: testId,
|
|
21
|
-
selected: selected
|
|
22
|
-
areAnyNewToolbarFlagsEnabled: areAnyNewToolbarFlagsEnabled
|
|
21
|
+
selected: selected
|
|
23
22
|
};
|
|
24
23
|
};
|
|
25
24
|
// eslint-disable-next-line @atlaskit/editor/no-re-export
|
|
@@ -12,8 +12,7 @@ import { CreditCheckedPopup } from './CreditCheckedPopup';
|
|
|
12
12
|
* product's credits popup to itself when credits are blocked. Matches the floating toolbar's own buttons.
|
|
13
13
|
*/
|
|
14
14
|
export var CreditCheckedFloatingToolbarButton = function CreditCheckedFloatingToolbarButton(_ref) {
|
|
15
|
-
var
|
|
16
|
-
button = _ref.button,
|
|
15
|
+
var button = _ref.button,
|
|
17
16
|
creditCheck = _ref.creditCheck,
|
|
18
17
|
getAICreditStatus = _ref.getAICreditStatus,
|
|
19
18
|
view = _ref.view;
|
|
@@ -92,10 +91,9 @@ export var CreditCheckedFloatingToolbarButton = function CreditCheckedFloatingTo
|
|
|
92
91
|
isRadioButton: button.isRadioButton,
|
|
93
92
|
pulse: button.pulse,
|
|
94
93
|
testId: button.testId,
|
|
95
|
-
interactionName: button.interactionName
|
|
96
|
-
areAnyNewToolbarFlagsEnabled: areAnyNewToolbarFlagsEnabled
|
|
94
|
+
interactionName: button.interactionName
|
|
97
95
|
}, showTitle && title);
|
|
98
|
-
}, [
|
|
96
|
+
}, [button, runCommand]);
|
|
99
97
|
return /*#__PURE__*/React.createElement(CreditCheckedPopup, {
|
|
100
98
|
creditCheck: creditCheck,
|
|
101
99
|
getAICreditStatus: getAICreditStatus,
|
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
/** Editor consumes cached decisions synchronously; legacy async providers fail open. */
|
|
2
2
|
export var checkAICreditStatus = function checkAICreditStatus(getAICreditStatus, creditCheck) {
|
|
3
3
|
try {
|
|
4
|
-
var result = getAICreditStatus(creditCheck);
|
|
4
|
+
var result = getAICreditStatus === null || getAICreditStatus === void 0 ? void 0 : getAICreditStatus(creditCheck);
|
|
5
|
+
if (!result) {
|
|
6
|
+
return {
|
|
7
|
+
isBlocked: false
|
|
8
|
+
};
|
|
9
|
+
}
|
|
5
10
|
if ('then' in result) {
|
|
6
11
|
// Temporary compatibility: never defer an Editor action or apply a late decision.
|
|
7
12
|
void result.catch(function () {});
|
|
@@ -3,8 +3,7 @@ import { CreditCheckedFloatingToolbarButton } from './CreditCheckedFloatingToolb
|
|
|
3
3
|
|
|
4
4
|
/** Wraps a floating toolbar button so it is credit checked, keeping its own appearance and handlers. */
|
|
5
5
|
export var getCreditCheckedFloatingToolbarItem = function getCreditCheckedFloatingToolbarItem(_ref) {
|
|
6
|
-
var
|
|
7
|
-
button = _ref.button,
|
|
6
|
+
var button = _ref.button,
|
|
8
7
|
creditCheck = _ref.creditCheck,
|
|
9
8
|
getAICreditStatus = _ref.getAICreditStatus;
|
|
10
9
|
return {
|
|
@@ -13,7 +12,6 @@ export var getCreditCheckedFloatingToolbarItem = function getCreditCheckedFloati
|
|
|
13
12
|
render: function render(view, idx) {
|
|
14
13
|
return /*#__PURE__*/React.createElement(CreditCheckedFloatingToolbarButton, {
|
|
15
14
|
key: idx,
|
|
16
|
-
areAnyNewToolbarFlagsEnabled: areAnyNewToolbarFlagsEnabled,
|
|
17
15
|
button: button,
|
|
18
16
|
creditCheck: creditCheck,
|
|
19
17
|
getAICreditStatus: getAICreditStatus,
|
|
@@ -16,11 +16,11 @@ export var useAICreditGuard = function useAICreditGuard(getAICreditStatus) {
|
|
|
16
16
|
return setFeedback(null);
|
|
17
17
|
}, []);
|
|
18
18
|
useLayoutEffect(function () {
|
|
19
|
-
if (!isActive) {
|
|
19
|
+
if (!isActive || getAICreditStatus === undefined) {
|
|
20
20
|
close();
|
|
21
21
|
setIsBlocked(false);
|
|
22
22
|
}
|
|
23
|
-
}, [isActive, close]);
|
|
23
|
+
}, [getAICreditStatus, isActive, close]);
|
|
24
24
|
var check = useCallback(function (creditCheck) {
|
|
25
25
|
var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
|
|
26
26
|
_ref$showFeedback = _ref.showFeedback,
|
|
@@ -137,8 +137,7 @@ export var DropdownMenuExtensionItems = function DropdownMenuExtensionItems(prop
|
|
|
137
137
|
editorView = props.editorView,
|
|
138
138
|
extension = props.extension,
|
|
139
139
|
disabled = props.disabled,
|
|
140
|
-
dropdownOptions = props.dropdownOptions
|
|
141
|
-
areAnyNewToolbarFlagsEnabled = props.areAnyNewToolbarFlagsEnabled;
|
|
140
|
+
dropdownOptions = props.dropdownOptions;
|
|
142
141
|
|
|
143
142
|
// Ignored via go/ees005
|
|
144
143
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
@@ -204,5 +203,5 @@ export var DropdownMenuExtensionItems = function DropdownMenuExtensionItems(prop
|
|
|
204
203
|
extension: extension,
|
|
205
204
|
dropdownOptions: dropdownOptions
|
|
206
205
|
});
|
|
207
|
-
}),
|
|
206
|
+
}), /*#__PURE__*/React.createElement(DropdownSeparator, null));
|
|
208
207
|
};
|
|
@@ -19,7 +19,7 @@ var NETWORK_FAILURE_REGEX = /^network failure/i;
|
|
|
19
19
|
var RESIZE_OBSERVER_LOOP_REGEX = /ResizeObserver loop completed with undelivered notifications/;
|
|
20
20
|
var SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
|
|
21
21
|
var packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
|
|
22
|
-
var packageVersion = "
|
|
22
|
+
var packageVersion = "137.0.1";
|
|
23
23
|
var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
|
|
24
24
|
// Remove URL as it has UGC
|
|
25
25
|
// Ignored via go/ees007
|
|
@@ -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 = "
|
|
23
|
+
var packageVersion = "137.0.1";
|
|
24
24
|
var halfFocusRing = 1;
|
|
25
25
|
var dropOffset = '0, 8';
|
|
26
26
|
// Ignored via go/ees005
|
|
@@ -48,8 +48,7 @@ var FloatingToolbarButton = function FloatingToolbarButton(_ref, forwardedRef) {
|
|
|
48
48
|
ariaLabel = _ref.ariaLabel,
|
|
49
49
|
isRadioButton = _ref.isRadioButton,
|
|
50
50
|
isLoading = _ref.isLoading,
|
|
51
|
-
pulse = _ref.pulse
|
|
52
|
-
areAnyNewToolbarFlagsEnabled = _ref.areAnyNewToolbarFlagsEnabled;
|
|
51
|
+
pulse = _ref.pulse;
|
|
53
52
|
// Check if there's only an icon and add additional styles
|
|
54
53
|
var iconOnly = (icon || iconAfter) && !children;
|
|
55
54
|
var customSpacing = iconOnly ? iconOnlySpacing : {};
|
|
@@ -107,7 +106,7 @@ var FloatingToolbarButton = function FloatingToolbarButton(_ref, forwardedRef) {
|
|
|
107
106
|
appearance: appearance,
|
|
108
107
|
state: themeProps.state,
|
|
109
108
|
mode: themeProps.mode
|
|
110
|
-
})),
|
|
109
|
+
})), customSizeAndPadding)
|
|
111
110
|
}, rest);
|
|
112
111
|
},
|
|
113
112
|
id: id,
|
|
@@ -117,7 +116,7 @@ var FloatingToolbarButton = function FloatingToolbarButton(_ref, forwardedRef) {
|
|
|
117
116
|
role: isRadioButton ? 'radio' : undefined,
|
|
118
117
|
"aria-expanded": ariaHasPopup ? selected : undefined,
|
|
119
118
|
"aria-controls": ariaHasPopup ? areaControls : undefined,
|
|
120
|
-
spacing:
|
|
119
|
+
spacing: "default",
|
|
121
120
|
href: href,
|
|
122
121
|
target: target,
|
|
123
122
|
appearance: appearance,
|
|
@@ -5,13 +5,6 @@
|
|
|
5
5
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled, @typescript-eslint/consistent-type-imports -- Ignored via go/DSP-18766; jsx required at runtime for @jsxRuntime classic
|
|
6
6
|
import { css, jsx } from '@emotion/react';
|
|
7
7
|
var separator = css({
|
|
8
|
-
background: "var(--ds-border, #0B120E24)",
|
|
9
|
-
width: '1px',
|
|
10
|
-
height: '20px',
|
|
11
|
-
margin: "0 ".concat("var(--ds-space-050, 4px)"),
|
|
12
|
-
alignSelf: 'center'
|
|
13
|
-
});
|
|
14
|
-
var separatorNew = css({
|
|
15
8
|
background: "var(--ds-border, #0B120E24)",
|
|
16
9
|
width: '1px',
|
|
17
10
|
height: '20px',
|
|
@@ -21,10 +14,9 @@ var separatorFullHeight = css({
|
|
|
21
14
|
height: '40px'
|
|
22
15
|
});
|
|
23
16
|
export default (function (_ref) {
|
|
24
|
-
var fullHeight = _ref.fullHeight
|
|
25
|
-
areAnyNewToolbarFlagsEnabled = _ref.areAnyNewToolbarFlagsEnabled;
|
|
17
|
+
var fullHeight = _ref.fullHeight;
|
|
26
18
|
return jsx("div", {
|
|
27
|
-
css: [
|
|
19
|
+
css: [separator, fullHeight && separatorFullHeight]
|
|
28
20
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
29
21
|
,
|
|
30
22
|
className: "separator"
|
|
@@ -282,6 +282,6 @@ function getFilteredFocusableElements(rootNode) {
|
|
|
282
282
|
return getFocusableElements(rootNode).filter(function (elm) {
|
|
283
283
|
// Check if element or any ancestor is hidden or disabled
|
|
284
284
|
var isHiddenOrDisabled = isElementOrAncestorHiddenOrDisabled(elm, rootNode);
|
|
285
|
-
return !elm.closest('[data-role="droplistContent"]') && !elm.closest('[data-emoji-picker-container="true"]') && !elm.closest('[data-test-id="color-picker-menu"]') && !elm.closest('[data-keyboard-navigation-independent]') && !
|
|
285
|
+
return !elm.closest('[data-role="droplistContent"]') && !elm.closest('[data-emoji-picker-container="true"]') && !elm.closest('[data-test-id="color-picker-menu"]') && !elm.closest('[data-keyboard-navigation-independent]') && !isHiddenOrDisabled;
|
|
286
286
|
});
|
|
287
287
|
}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { jsx } from '@emotion/react';
|
|
2
2
|
import type { NewCoreIconProps } from '@atlaskit/icon/types';
|
|
3
3
|
export interface ButtonOptionProps {
|
|
4
|
-
areAnyNewToolbarFlagsEnabled: boolean;
|
|
5
4
|
disabled: boolean;
|
|
6
5
|
icon: (props: NewCoreIconProps) => JSX.Element;
|
|
7
6
|
onClick: () => void;
|
|
@@ -4,7 +4,7 @@ export { getLinkMetadataFromTransaction } from './getLinkMetadataFromTransaction
|
|
|
4
4
|
export { commandWithMetadata } from './utils';
|
|
5
5
|
export { default as buildLayoutButtons, alignmentIcons, wrappingIcons, layoutToMessages, buildLayoutDropdown, } from './MediaAndEmbedsToolbar';
|
|
6
6
|
export type { IconMap, LayoutIcon } from './MediaAndEmbedsToolbar';
|
|
7
|
-
export type { OptionConfig, CardPluginActions, QueueCardsFromTransactionAction, QueueCardsFromRangeAction, HideLinkToolbarAction, ChangeSelectedCardToLink, SetSelectedCardAppearance, CardReplacementInputMethod, EmbedCardTransformAttrs, EmbedCardNodeTransformer, EmbedCardTransformCommandOptions, CreateEmbedCardTransformCommand, EmbedCardTransformers, } from './types';
|
|
7
|
+
export type { OptionConfig, CardPluginActions, QueueCardsFromTransactionAction, QueueCardsFromRangeAction, HideLinkToolbarAction, ChangeSelectedCardToLink, SetSelectedCardAppearance, CardReplacementInputMethod, EmbedCardTransformAttrs, EmbedCardNodeTransformer, EmbedCardTransformCommandOptions, CreateEmbedCardTransformCommand, EmbedCardTransformers, GetEmbedCardTransformNode, } from './types';
|
|
8
8
|
export { LinkToolbarButtonGroup } from './LinkToolbarButtonGroup';
|
|
9
9
|
export { appearancePropsMap } from './appearancePropsMap';
|
|
10
10
|
export { getButtonGroupOption } from './link-toolbar-button-group-options';
|
|
@@ -2,5 +2,5 @@ import type { IntlShape } from 'react-intl';
|
|
|
2
2
|
import type { Command } from '../types';
|
|
3
3
|
import type { ButtonOptionProps } from './LinkToolbarButtonGroup';
|
|
4
4
|
import type { OptionConfig } from './types';
|
|
5
|
-
export declare const getButtonGroupOption: (intl: IntlShape,
|
|
5
|
+
export declare const getButtonGroupOption: (intl: IntlShape, dispatchCommand: (command: Command) => void, { disabled, onClick, selected, appearance, testId, tooltip }: OptionConfig) => ButtonOptionProps;
|
|
6
6
|
export { appearancePropsMap } from './appearancePropsMap';
|
|
@@ -75,9 +75,15 @@ export type EmbedCardTransformCommandOptions = {
|
|
|
75
75
|
* The returned command should return false if transformation is not possible.
|
|
76
76
|
*/
|
|
77
77
|
export type CreateEmbedCardTransformCommand = (options?: EmbedCardTransformCommandOptions) => Command;
|
|
78
|
+
/**
|
|
79
|
+
* Returns the node that `createEmbedCardTransformCommand` would insert for the current selection,
|
|
80
|
+
* or undefined when the transform does not apply. Must not change the document.
|
|
81
|
+
*/
|
|
82
|
+
export type GetEmbedCardTransformNode = (state: EditorState) => Node | undefined;
|
|
78
83
|
export interface EmbedCardTransformers {
|
|
79
84
|
createEmbedCardTransformCommand: CreateEmbedCardTransformCommand;
|
|
80
85
|
embedCardNodeTransformer: EmbedCardNodeTransformer;
|
|
86
|
+
getEmbedCardTransformNode?: GetEmbedCardTransformNode;
|
|
81
87
|
}
|
|
82
88
|
/** Resolved card metadata and its live node-view position getter. */
|
|
83
89
|
export type CardRegistration = {
|
|
@@ -12,7 +12,6 @@ export type CreditCheckableFloatingToolbarButton = Omit<FloatingToolbarButton<Co
|
|
|
12
12
|
[Prop in UnsupportedButtonProps]?: never;
|
|
13
13
|
};
|
|
14
14
|
export type CreditCheckedFloatingToolbarButtonProps = {
|
|
15
|
-
areAnyNewToolbarFlagsEnabled: boolean;
|
|
16
15
|
button: CreditCheckableFloatingToolbarButton;
|
|
17
16
|
creditCheck: AICreditCheck;
|
|
18
17
|
getAICreditStatus: GetAICreditStatus;
|
|
@@ -22,5 +21,5 @@ export type CreditCheckedFloatingToolbarButtonProps = {
|
|
|
22
21
|
* A floating toolbar button that checks AI credits before running its action, and anchors the
|
|
23
22
|
* product's credits popup to itself when credits are blocked. Matches the floating toolbar's own buttons.
|
|
24
23
|
*/
|
|
25
|
-
export declare const CreditCheckedFloatingToolbarButton: ({
|
|
24
|
+
export declare const CreditCheckedFloatingToolbarButton: ({ button, creditCheck, getAICreditStatus, view, }: CreditCheckedFloatingToolbarButtonProps) => React.JSX.Element;
|
|
26
25
|
export {};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
import type { AICreditCheck, AICreditStatus, GetAICreditStatus } from './types';
|
|
2
|
+
export type AICreditStatusReader = (context: AICreditCheck) => ReturnType<GetAICreditStatus> | undefined;
|
|
2
3
|
/** Editor consumes cached decisions synchronously; legacy async providers fail open. */
|
|
3
|
-
export declare const checkAICreditStatus: (getAICreditStatus:
|
|
4
|
+
export declare const checkAICreditStatus: (getAICreditStatus: AICreditStatusReader | undefined, creditCheck: AICreditCheck) => AICreditStatus;
|
|
@@ -2,4 +2,4 @@ import type { Command } from '../types/command';
|
|
|
2
2
|
import type { FloatingToolbarCustom } from '../types/floating-toolbar';
|
|
3
3
|
import { type CreditCheckedFloatingToolbarButtonProps } from './CreditCheckedFloatingToolbarButton';
|
|
4
4
|
/** Wraps a floating toolbar button so it is credit checked, keeping its own appearance and handlers. */
|
|
5
|
-
export declare const getCreditCheckedFloatingToolbarItem: ({
|
|
5
|
+
export declare const getCreditCheckedFloatingToolbarItem: ({ button, creditCheck, getAICreditStatus, }: Omit<CreditCheckedFloatingToolbarButtonProps, 'view'>) => FloatingToolbarCustom<Command>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ReactNode } from 'react';
|
|
2
|
-
export type EditorAICreditFeatureName = 'blockMenu-askRovo' | 'blockMenu-remix' | 'selectionToolbar-askRovo' | 'selectionToolbar-remix' | 'commentEditor-askRovo' | 'quickInsert-askRovo' | 'elementBrowser-askRovo' | 'panelFloatingToolbar-remix' | 'primaryToolbar-write' | 'mediaFloatingToolbar-editImage' | 'tableFloatingToolbar-remix' | 'smartLinkFloatingToolbar-askRovo' | 'codeBlockFloatingToolbar-remix' | 'expandFloatingToolbar-remix' | 'layoutFloatingToolbar-remix' | 'nativeTabsFloatingToolbar-remix' | 'nativeEmbedFloatingToolbar-remix' | 'nativeEmbedFloatingToolbar-askRovo' | 'imageGenerationMediaInsert' | 'blockControls-remix';
|
|
2
|
+
export type EditorAICreditFeatureName = 'blockMenu-askRovo' | 'blockMenu-remix' | 'selectionToolbar-askRovo' | 'selectionToolbar-remix' | 'commentEditor-askRovo' | 'quickInsert-askRovo' | 'quickInsert-skill' | 'elementBrowser-askRovo' | 'elementBrowser-skill' | 'panelFloatingToolbar-remix' | 'primaryToolbar-write' | 'mediaFloatingToolbar-editImage' | 'tableFloatingToolbar-remix' | 'smartLinkFloatingToolbar-askRovo' | 'codeBlockFloatingToolbar-remix' | 'expandFloatingToolbar-remix' | 'layoutFloatingToolbar-remix' | 'nativeTabsFloatingToolbar-remix' | 'nativeEmbedFloatingToolbar-remix' | 'nativeEmbedFloatingToolbar-askRovo' | 'imageGenerationMediaInsert' | 'blockControls-remix';
|
|
3
3
|
export type AICreditCheck = {
|
|
4
4
|
featureName: EditorAICreditFeatureName;
|
|
5
5
|
};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { AICreditStatusReader } from './checkAICreditStatus';
|
|
2
|
+
import type { AICreditCheck, AICreditStatus } from './types';
|
|
2
3
|
type CreditStatus = AICreditStatus;
|
|
3
4
|
export type BlockedCreditStatus = Extract<CreditStatus, {
|
|
4
5
|
isBlocked: true;
|
|
@@ -12,5 +13,5 @@ export type AICreditGuard = {
|
|
|
12
13
|
isBlocked: boolean;
|
|
13
14
|
};
|
|
14
15
|
/** Shares advisory checks and feedback state without owning action execution or selection. */
|
|
15
|
-
export declare const useAICreditGuard: (getAICreditStatus
|
|
16
|
+
export declare const useAICreditGuard: (getAICreditStatus?: AICreditStatusReader, isActive?: boolean) => AICreditGuard;
|
|
16
17
|
export {};
|
|
@@ -10,7 +10,6 @@ export interface DropdownMenuOptions {
|
|
|
10
10
|
showSelected: boolean;
|
|
11
11
|
}
|
|
12
12
|
type OverflowExtensionPlaceholderProps = {
|
|
13
|
-
areAnyNewToolbarFlagsEnabled: boolean;
|
|
14
13
|
disabled?: (key: string) => boolean;
|
|
15
14
|
dropdownOptions?: DropdownMenuOptions;
|
|
16
15
|
editorView: EditorView;
|
|
@@ -4,7 +4,6 @@ import type { ButtonAppearance } from '../../types';
|
|
|
4
4
|
export interface Props {
|
|
5
5
|
appearance?: ButtonAppearance;
|
|
6
6
|
areaControls?: string;
|
|
7
|
-
areAnyNewToolbarFlagsEnabled: boolean;
|
|
8
7
|
ariaHasPopup?: boolean | 'dialog' | 'menu' | 'listbox' | 'tree' | 'grid' | undefined;
|
|
9
8
|
ariaLabel?: string;
|
|
10
9
|
children?: React.ReactNode;
|
|
@@ -4,7 +4,6 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import { jsx } from '@emotion/react';
|
|
6
6
|
type SeparatorProps = {
|
|
7
|
-
areAnyNewToolbarFlagsEnabled: boolean;
|
|
8
7
|
/**
|
|
9
8
|
* @private
|
|
10
9
|
* @deprecated
|
|
@@ -14,4 +13,4 @@ type SeparatorProps = {
|
|
|
14
13
|
fullHeight?: boolean;
|
|
15
14
|
};
|
|
16
15
|
export default _default;
|
|
17
|
-
declare function _default({ fullHeight
|
|
16
|
+
declare function _default({ fullHeight }: SeparatorProps): jsx.JSX.Element;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-common",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "137.1.0",
|
|
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/"
|
|
@@ -86,9 +86,9 @@
|
|
|
86
86
|
"@atlaskit/spinner": "^20.4.0",
|
|
87
87
|
"@atlaskit/task-decision": "^21.16.0",
|
|
88
88
|
"@atlaskit/teams-app-config": "^3.1.0",
|
|
89
|
-
"@atlaskit/textfield": "^
|
|
89
|
+
"@atlaskit/textfield": "^11.0.0",
|
|
90
90
|
"@atlaskit/tmp-editor-statsig": "^264.0.0",
|
|
91
|
-
"@atlaskit/tokens": "^20.
|
|
91
|
+
"@atlaskit/tokens": "^20.13.0",
|
|
92
92
|
"@atlaskit/tooltip": "^24.4.0",
|
|
93
93
|
"@atlaskit/width-detector": "^7.2.0",
|
|
94
94
|
"@babel/runtime": "^7.0.0",
|
|
@@ -130,7 +130,7 @@
|
|
|
130
130
|
"@atlaskit/media-core": "^39.0.0",
|
|
131
131
|
"@atlassian/a11y-jest-testing": "^0.17.0",
|
|
132
132
|
"@atlassian/experiment-test-utils": "^0.2.0",
|
|
133
|
-
"@atlassian/feature-flags-test-utils": "^
|
|
133
|
+
"@atlassian/feature-flags-test-utils": "^2.0.0",
|
|
134
134
|
"@atlassian/testing-library": "^0.12.0",
|
|
135
135
|
"@react-loosely-lazy/manifest": "^1.0.0",
|
|
136
136
|
"@testing-library/dom": "^10.1.0",
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.areToolbarFlagsEnabled = void 0;
|
|
7
|
-
var areToolbarFlagsEnabled = exports.areToolbarFlagsEnabled = function areToolbarFlagsEnabled(_isNewToolbarEnabled) {
|
|
8
|
-
return true;
|
|
9
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export const areToolbarFlagsEnabled = _isNewToolbarEnabled => true;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const areToolbarFlagsEnabled: (_isNewToolbarEnabled?: boolean) => boolean;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@atlaskit/editor-common/toolbar-flag-check",
|
|
3
|
-
"main": "../dist/cjs/toolbar-flag-check.js",
|
|
4
|
-
"module": "../dist/esm/toolbar-flag-check.js",
|
|
5
|
-
"module:es2019": "../dist/es2019/toolbar-flag-check.js",
|
|
6
|
-
"sideEffects": [
|
|
7
|
-
"**/*.compiled.css"
|
|
8
|
-
],
|
|
9
|
-
"types": "../dist/types/toolbar-flag-check.d.ts"
|
|
10
|
-
}
|