@atlaskit/editor-common 135.3.0 → 137.0.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 +64 -0
- package/dist/cjs/ai-messages/ai-suggestions.js +5 -0
- package/dist/cjs/analytics/types/ai-suggestions-events.js +2 -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/getCreditCheckedFloatingToolbarItem.js +1 -3
- package/dist/cjs/floating-toolbar/DropdownMenuExtensionItems.js +2 -3
- package/dist/cjs/messages/layout.js +0 -5
- package/dist/cjs/monitoring/error.js +1 -1
- package/dist/cjs/portal/PortalBucket.js +7 -35
- package/dist/cjs/portal/PortalManager.js +1 -2
- 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/cjs/utils/document.js +3 -24
- package/dist/cjs/utils/index.js +0 -6
- package/dist/es2019/ai-messages/ai-suggestions.js +5 -0
- package/dist/es2019/analytics/types/ai-suggestions-events.js +2 -0
- 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/getCreditCheckedFloatingToolbarItem.js +0 -2
- package/dist/es2019/floating-toolbar/DropdownMenuExtensionItems.js +2 -3
- package/dist/es2019/messages/layout.js +0 -5
- package/dist/es2019/monitoring/error.js +1 -1
- package/dist/es2019/portal/PortalBucket.js +2 -26
- package/dist/es2019/portal/PortalManager.js +1 -2
- 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/es2019/utils/document.js +0 -24
- package/dist/es2019/utils/index.js +1 -1
- package/dist/esm/ai-messages/ai-suggestions.js +5 -0
- package/dist/esm/analytics/types/ai-suggestions-events.js +2 -0
- 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/getCreditCheckedFloatingToolbarItem.js +1 -3
- package/dist/esm/floating-toolbar/DropdownMenuExtensionItems.js +2 -3
- package/dist/esm/messages/layout.js +0 -5
- package/dist/esm/monitoring/error.js +1 -1
- package/dist/esm/portal/PortalBucket.js +8 -36
- package/dist/esm/portal/PortalManager.js +1 -2
- 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/esm/utils/document.js +3 -24
- package/dist/esm/utils/index.js +1 -1
- package/dist/types/ai-messages/ai-suggestions.d.ts +5 -0
- package/dist/types/analytics/types/ai-suggestions-events.d.ts +2 -0
- 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/getCreditCheckedFloatingToolbarItem.d.ts +1 -1
- package/dist/types/credit-guard/types.d.ts +1 -1
- package/dist/types/floating-toolbar/DropdownMenuExtensionItems.d.ts +0 -1
- package/dist/types/messages/layout.d.ts +0 -5
- package/dist/types/ui/FloatingToolbar/Button.d.ts +0 -1
- package/dist/types/ui/FloatingToolbar/Separator.d.ts +1 -2
- package/dist/types/utils/document.d.ts +0 -1
- package/dist/types/utils/index.d.ts +1 -1
- package/package.json +7 -7
- 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
|
@@ -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 = "136.0.0";
|
|
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
|
}
|
|
@@ -1,29 +1,5 @@
|
|
|
1
1
|
import { ReplaceStep } from '@atlaskit/editor-prosemirror/transform';
|
|
2
2
|
import { getStepRange } from './getStepRange';
|
|
3
|
-
import { hasDocAsParent } from './hasDocAsParent';
|
|
4
|
-
export function bracketTyped(state) {
|
|
5
|
-
const {
|
|
6
|
-
selection
|
|
7
|
-
} = state;
|
|
8
|
-
const {
|
|
9
|
-
$cursor,
|
|
10
|
-
$anchor
|
|
11
|
-
} = selection;
|
|
12
|
-
if (!$cursor) {
|
|
13
|
-
return false;
|
|
14
|
-
}
|
|
15
|
-
const node = $cursor.nodeBefore;
|
|
16
|
-
if (!node) {
|
|
17
|
-
return false;
|
|
18
|
-
}
|
|
19
|
-
if (node.type.name === 'text' && node.text === '{') {
|
|
20
|
-
const paragraphNode = $anchor.node();
|
|
21
|
-
return paragraphNode.marks.length === 0 && hasDocAsParent($anchor);
|
|
22
|
-
}
|
|
23
|
-
return false;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
// eslint-disable-next-line @atlaskit/volt-strict-mode/no-multiple-exports
|
|
27
3
|
export function nodesBetweenChanged(tr, f, startPos) {
|
|
28
4
|
const stepRange = getStepRange(tr);
|
|
29
5
|
if (!stepRange) {
|
|
@@ -162,7 +162,7 @@ export { gridTypeForLayout } from './grid';
|
|
|
162
162
|
*
|
|
163
163
|
* Use `@atlaskit/editor-common/utils/document` entry-point instead.
|
|
164
164
|
*/
|
|
165
|
-
export { nodesBetweenChanged,
|
|
165
|
+
export { nodesBetweenChanged, getChangedNodes } from './document';
|
|
166
166
|
export { getStepRange } from './getStepRange';
|
|
167
167
|
export { hasDocAsParent } from './hasDocAsParent';
|
|
168
168
|
export { hasVisibleContent } from './hasVisibleContent';
|
|
@@ -325,6 +325,11 @@ export var aiSuggestionsMessages = defineMessages({
|
|
|
325
325
|
defaultMessage: 'This may take a few minutes',
|
|
326
326
|
description: 'Loading message setting expectations that the AI review may take a few minutes'
|
|
327
327
|
},
|
|
328
|
+
thinkingKeepEditing: {
|
|
329
|
+
id: 'fabric.editor.ai.suggestions.thinking.keepEditing.non-final',
|
|
330
|
+
defaultMessage: 'Feel free to keep editing, suggestions are on the way',
|
|
331
|
+
description: 'Loading message on the AI suggestions thinking bar telling the user the review is running and they can keep editing while suggestions are generated'
|
|
332
|
+
},
|
|
328
333
|
thinkingReviewingConsistency: {
|
|
329
334
|
id: 'fabric.editor.ai.suggestions.thinking.reviewingConsistency.non-final',
|
|
330
335
|
defaultMessage: 'Reviewing consistency',
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
export var AiSuggestionsEntryPointValue = /*#__PURE__*/function (AiSuggestionsEntryPointValue) {
|
|
2
2
|
AiSuggestionsEntryPointValue["PRIMARY_TOOLBAR"] = "primaryToolbar";
|
|
3
|
+
/** Content Reviewer quick action in the Rovo Chat editor empty state. */
|
|
4
|
+
AiSuggestionsEntryPointValue["ROVO_CHAT"] = "rovoChat";
|
|
3
5
|
/**
|
|
4
6
|
* @private
|
|
5
7
|
* @deprecated Legacy entry point retained for backwards compatibility.
|
|
@@ -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,
|
|
@@ -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,
|
|
@@ -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
|
};
|
|
@@ -70,11 +70,6 @@ export var toolbarMessages = defineMessages({
|
|
|
70
70
|
defaultMessage: 'Layout options',
|
|
71
71
|
description: "a floating toolbar radiogroup's aria label"
|
|
72
72
|
},
|
|
73
|
-
layoutPlaceholder: {
|
|
74
|
-
id: 'fabric.editor.layout.placeholder',
|
|
75
|
-
defaultMessage: 'Add content',
|
|
76
|
-
description: 'Placeholder text shown inside an empty layout column, prompting the user to add content.'
|
|
77
|
-
},
|
|
78
73
|
controlslayoutPlaceholder: {
|
|
79
74
|
id: 'fabric.editor.layout.controls.placeholder',
|
|
80
75
|
defaultMessage: '/ to insert',
|
|
@@ -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 = "136.0.0";
|
|
23
23
|
var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
|
|
24
24
|
// Remove URL as it has UGC
|
|
25
25
|
// Ignored via go/ees007
|
|
@@ -1,39 +1,14 @@
|
|
|
1
1
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
2
|
-
import React, { useCallback, useLayoutEffect,
|
|
3
|
-
import { isExperimentEnabled } from '@atlaskit/platform-feature-experiments/is-experiment-enabled';
|
|
4
|
-
function LegacyPortalBucket(_ref) {
|
|
5
|
-
var id = _ref.id,
|
|
6
|
-
portalManager = _ref.portalManager;
|
|
7
|
-
// State to hold the current portals for this bucket
|
|
8
|
-
var _useState = useState({}),
|
|
9
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
10
|
-
portals = _useState2[0],
|
|
11
|
-
setPortals = _useState2[1];
|
|
12
|
-
// Effect to register/unregister this bucket with the portal manager on mount/unmount
|
|
13
|
-
useLayoutEffect(function () {
|
|
14
|
-
portalManager.registerBucket(id, setPortals);
|
|
15
|
-
return function () {
|
|
16
|
-
portalManager.unregisterBucket(id);
|
|
17
|
-
};
|
|
18
|
-
}, [id, portalManager]);
|
|
19
|
-
// Memoize the portal elements to avoid unnecessary re-renders
|
|
20
|
-
var portalElements = useMemo(function () {
|
|
21
|
-
return Object.values(portals);
|
|
22
|
-
}, [portals]);
|
|
23
|
-
// Render the current portal elements
|
|
24
|
-
// @ts-ignore - TS2322 TypeScript 5.9.2 upgrade
|
|
25
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null, portalElements);
|
|
26
|
-
}
|
|
27
|
-
|
|
2
|
+
import React, { useCallback, useLayoutEffect, useReducer } from 'react';
|
|
28
3
|
/**
|
|
29
4
|
* Portals stay in the manager; state is only a render tick. React keeps
|
|
30
5
|
* hook state on both the current and alternate fiber, so storing portals
|
|
31
6
|
* in state would retain removed portals until the next render.
|
|
32
7
|
*/
|
|
33
|
-
function TickPortalBucket(
|
|
8
|
+
function TickPortalBucket(_ref) {
|
|
34
9
|
var _portalManager$getBuc, _portalManager$getBuc2;
|
|
35
|
-
var id =
|
|
36
|
-
portalManager =
|
|
10
|
+
var id = _ref.id,
|
|
11
|
+
portalManager = _ref.portalManager;
|
|
37
12
|
var _useReducer = useReducer(function (tick) {
|
|
38
13
|
return tick + 1;
|
|
39
14
|
}, 0),
|
|
@@ -62,13 +37,10 @@ function TickPortalBucket(_ref2) {
|
|
|
62
37
|
* @param {PortalManager} props.portalManager An instance of `PortalManager` which manages the registration and unregistration of portal buckets and their content.
|
|
63
38
|
* @returns {React.ReactElement} The React element(s) that are currently registered to this portal bucket.
|
|
64
39
|
*/
|
|
65
|
-
export function PortalBucket(
|
|
66
|
-
var id =
|
|
67
|
-
portalManager =
|
|
68
|
-
return
|
|
69
|
-
id: id,
|
|
70
|
-
portalManager: portalManager
|
|
71
|
-
}) : /*#__PURE__*/React.createElement(LegacyPortalBucket, {
|
|
40
|
+
export function PortalBucket(_ref2) {
|
|
41
|
+
var id = _ref2.id,
|
|
42
|
+
portalManager = _ref2.portalManager;
|
|
43
|
+
return /*#__PURE__*/React.createElement(TickPortalBucket, {
|
|
72
44
|
id: id,
|
|
73
45
|
portalManager: portalManager
|
|
74
46
|
});
|
|
@@ -5,7 +5,6 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
|
5
5
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
6
6
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
7
7
|
import throttle from 'lodash/throttle';
|
|
8
|
-
import { isExperimentEnabled } from '@atlaskit/platform-feature-experiments/is-experiment-enabled';
|
|
9
8
|
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
10
9
|
var DEFAULT_INITIAL_BUCKETS = 50;
|
|
11
10
|
var DEFAULT_MAX_BUCKET_CAPACITY = 50;
|
|
@@ -200,7 +199,7 @@ export var PortalManager = /*#__PURE__*/function () {
|
|
|
200
199
|
var _this$portalToBucketM,
|
|
201
200
|
_this4 = this;
|
|
202
201
|
var immediate = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
203
|
-
if (!
|
|
202
|
+
if (!this.portalToBucketMap.has(key)) {
|
|
204
203
|
this.createBucket();
|
|
205
204
|
// @ts-ignore - TS2538 TypeScript 5.9.2 upgrade
|
|
206
205
|
this.buckets[this.getCurrentBucket()].capacity -= 1;
|
|
@@ -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 = "136.0.0";
|
|
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
|
}
|
|
@@ -6,27 +6,6 @@ function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r)
|
|
|
6
6
|
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
7
7
|
import { ReplaceStep } from '@atlaskit/editor-prosemirror/transform';
|
|
8
8
|
import { getStepRange } from './getStepRange';
|
|
9
|
-
import { hasDocAsParent } from './hasDocAsParent';
|
|
10
|
-
export function bracketTyped(state) {
|
|
11
|
-
var selection = state.selection;
|
|
12
|
-
var _ref = selection,
|
|
13
|
-
$cursor = _ref.$cursor,
|
|
14
|
-
$anchor = _ref.$anchor;
|
|
15
|
-
if (!$cursor) {
|
|
16
|
-
return false;
|
|
17
|
-
}
|
|
18
|
-
var node = $cursor.nodeBefore;
|
|
19
|
-
if (!node) {
|
|
20
|
-
return false;
|
|
21
|
-
}
|
|
22
|
-
if (node.type.name === 'text' && node.text === '{') {
|
|
23
|
-
var paragraphNode = $anchor.node();
|
|
24
|
-
return paragraphNode.marks.length === 0 && hasDocAsParent($anchor);
|
|
25
|
-
}
|
|
26
|
-
return false;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
// eslint-disable-next-line @atlaskit/volt-strict-mode/no-multiple-exports
|
|
30
9
|
export function nodesBetweenChanged(tr, f, startPos) {
|
|
31
10
|
var stepRange = getStepRange(tr);
|
|
32
11
|
if (!stepRange) {
|
|
@@ -34,9 +13,9 @@ export function nodesBetweenChanged(tr, f, startPos) {
|
|
|
34
13
|
}
|
|
35
14
|
tr.doc.nodesBetween(stepRange.from, stepRange.to, f, startPos);
|
|
36
15
|
}
|
|
37
|
-
function getChangedNodesIn(
|
|
38
|
-
var tr =
|
|
39
|
-
doc =
|
|
16
|
+
function getChangedNodesIn(_ref) {
|
|
17
|
+
var tr = _ref.tr,
|
|
18
|
+
doc = _ref.doc;
|
|
40
19
|
var nodes = [];
|
|
41
20
|
var stepRange = getStepRange(tr);
|
|
42
21
|
if (!stepRange) {
|
package/dist/esm/utils/index.js
CHANGED
|
@@ -162,7 +162,7 @@ export { gridTypeForLayout } from './grid';
|
|
|
162
162
|
*
|
|
163
163
|
* Use `@atlaskit/editor-common/utils/document` entry-point instead.
|
|
164
164
|
*/
|
|
165
|
-
export { nodesBetweenChanged,
|
|
165
|
+
export { nodesBetweenChanged, getChangedNodes } from './document';
|
|
166
166
|
export { getStepRange } from './getStepRange';
|
|
167
167
|
export { hasDocAsParent } from './hasDocAsParent';
|
|
168
168
|
export { hasVisibleContent } from './hasVisibleContent';
|
|
@@ -398,6 +398,11 @@ export declare const aiSuggestionsMessages: {
|
|
|
398
398
|
description: string;
|
|
399
399
|
id: string;
|
|
400
400
|
};
|
|
401
|
+
thinkingKeepEditing: {
|
|
402
|
+
defaultMessage: string;
|
|
403
|
+
description: string;
|
|
404
|
+
id: string;
|
|
405
|
+
};
|
|
401
406
|
thinkingMayTakeAFewMinutes: {
|
|
402
407
|
defaultMessage: string;
|
|
403
408
|
description: string;
|
|
@@ -2,6 +2,8 @@ import type { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID } from './enums';
|
|
|
2
2
|
import type { OperationalAEP, TrackAEP } from './utils';
|
|
3
3
|
export declare enum AiSuggestionsEntryPointValue {
|
|
4
4
|
PRIMARY_TOOLBAR = "primaryToolbar",
|
|
5
|
+
/** Content Reviewer quick action in the Rovo Chat editor empty state. */
|
|
6
|
+
ROVO_CHAT = "rovoChat",
|
|
5
7
|
/**
|
|
6
8
|
* @private
|
|
7
9
|
* @deprecated Legacy entry point retained for backwards compatibility.
|
|
@@ -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 {};
|
|
@@ -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' | 'imageGenerationMediaInsert' | 'blockControls-remix';
|
|
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';
|
|
3
3
|
export type AICreditCheck = {
|
|
4
4
|
featureName: EditorAICreditFeatureName;
|
|
5
5
|
};
|
|
@@ -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;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import type { Node } from '@atlaskit/editor-prosemirror/model';
|
|
2
2
|
import type { EditorState, ReadonlyTransaction, Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
3
3
|
type ChangedFn = (node: Node, pos: number, parent: Node | null, index: number) => boolean | void;
|
|
4
|
-
export declare function bracketTyped(state: EditorState): boolean;
|
|
5
4
|
export declare function nodesBetweenChanged(tr: Transaction | ReadonlyTransaction, f: ChangedFn, startPos?: number): void;
|
|
6
5
|
export declare function getChangedNodes(tr: ReadonlyTransaction | Transaction): {
|
|
7
6
|
node: Node;
|