@atlaskit/editor-common 114.10.1 → 114.12.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 +77 -0
- package/dist/cjs/link/ConfigureLinkOverlay/Dropdown.js +30 -8
- package/dist/cjs/link/LinkPicker/EditorLinkPicker/index.js +16 -6
- package/dist/cjs/link/LinkPicker/HyperlinkAddToolbar/index.js +57 -11
- package/dist/cjs/link/LinkSearch/withActivityProvider.js +1 -0
- package/dist/cjs/messages/index.js +7 -0
- package/dist/cjs/messages/markdown-mode.js +43 -0
- package/dist/cjs/messages/native-embed-toolbar.js +5 -0
- package/dist/cjs/monitoring/error.js +1 -1
- package/dist/cjs/provider-helpers/combine-providers.js +1 -8
- package/dist/cjs/toolbar/index.js +6 -0
- package/dist/cjs/toolbar/keys.js +18 -1
- package/dist/cjs/toolbar/rank.js +1 -1
- package/dist/cjs/ui/DropList/index.js +1 -1
- package/dist/es2019/link/ConfigureLinkOverlay/Dropdown.js +23 -3
- package/dist/es2019/link/LinkPicker/EditorLinkPicker/index.js +15 -6
- package/dist/es2019/link/LinkPicker/HyperlinkAddToolbar/index.js +52 -9
- package/dist/es2019/link/LinkSearch/withActivityProvider.js +1 -0
- package/dist/es2019/messages/index.js +1 -0
- package/dist/es2019/messages/markdown-mode.js +38 -0
- package/dist/es2019/messages/native-embed-toolbar.js +5 -0
- package/dist/es2019/monitoring/error.js +1 -1
- package/dist/es2019/provider-helpers/combine-providers.js +1 -4
- package/dist/es2019/toolbar/index.js +1 -1
- package/dist/es2019/toolbar/keys.js +17 -0
- package/dist/es2019/toolbar/rank.js +5 -1
- package/dist/es2019/ui/DropList/index.js +1 -1
- package/dist/esm/link/ConfigureLinkOverlay/Dropdown.js +30 -8
- package/dist/esm/link/LinkPicker/EditorLinkPicker/index.js +15 -6
- package/dist/esm/link/LinkPicker/HyperlinkAddToolbar/index.js +55 -11
- package/dist/esm/link/LinkSearch/withActivityProvider.js +1 -0
- package/dist/esm/messages/index.js +1 -0
- package/dist/esm/messages/markdown-mode.js +38 -0
- package/dist/esm/messages/native-embed-toolbar.js +5 -0
- package/dist/esm/monitoring/error.js +1 -1
- package/dist/esm/provider-helpers/combine-providers.js +1 -8
- package/dist/esm/toolbar/index.js +1 -1
- package/dist/esm/toolbar/keys.js +17 -0
- package/dist/esm/toolbar/rank.js +2 -2
- package/dist/esm/ui/DropList/index.js +1 -1
- package/dist/types/messages/index.d.ts +1 -0
- package/dist/types/messages/markdown-mode.d.ts +36 -0
- package/dist/types/messages/native-embed-toolbar.d.ts +10 -5
- package/dist/types/toolbar/index.d.ts +1 -1
- package/dist/types/toolbar/keys.d.ts +16 -0
- package/dist/types/toolbar/rank.d.ts +1 -0
- package/dist/types/types/quick-insert.d.ts +18 -0
- package/dist/types-ts4.5/messages/index.d.ts +1 -0
- package/dist/types-ts4.5/messages/markdown-mode.d.ts +36 -0
- package/dist/types-ts4.5/messages/native-embed-toolbar.d.ts +10 -5
- package/dist/types-ts4.5/toolbar/index.d.ts +1 -1
- package/dist/types-ts4.5/toolbar/keys.d.ts +16 -0
- package/dist/types-ts4.5/toolbar/rank.d.ts +1 -0
- package/dist/types-ts4.5/types/quick-insert.d.ts +18 -0
- package/package.json +2 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,82 @@
|
|
|
1
1
|
# @atlaskit/editor-common
|
|
2
2
|
|
|
3
|
+
## 114.12.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [`7fe1914f87802`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/7fe1914f87802) -
|
|
8
|
+
MAUI-463: Add expand (fullscreen preview) button to native embed editor floating toolbar. Removes
|
|
9
|
+
expand button from embed header for MAUI embeds (Infographic, Chart, Visualization) since it is
|
|
10
|
+
now in the editor toolbar.
|
|
11
|
+
|
|
12
|
+
## 114.11.1
|
|
13
|
+
|
|
14
|
+
### Patch Changes
|
|
15
|
+
|
|
16
|
+
- [`8233fa7c20ca7`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/8233fa7c20ca7) -
|
|
17
|
+
Remove feature flag platform_editor_fix_getautoconverter_null_error - always filter out
|
|
18
|
+
null/undefined providers in combine-providers
|
|
19
|
+
|
|
20
|
+
## 114.11.0
|
|
21
|
+
|
|
22
|
+
### Minor Changes
|
|
23
|
+
|
|
24
|
+
- [`dbd5382b86e3e`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/dbd5382b86e3e) -
|
|
25
|
+
Perf-linting cleanup: fix performance linting violations in editor-common, gated behind
|
|
26
|
+
platform_editor_perf_lint_cleanup experiment
|
|
27
|
+
|
|
28
|
+
## 114.10.2
|
|
29
|
+
|
|
30
|
+
### Patch Changes
|
|
31
|
+
|
|
32
|
+
- [`ef22af532ebfd`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/ef22af532ebfd) -
|
|
33
|
+
EDITOR-6558: Introduce a reusable Markdown Mode editor plugin and two consumer-supplied
|
|
34
|
+
insert-filter hooks.
|
|
35
|
+
|
|
36
|
+
### `@atlassian/editor-plugin-markdown-mode` (new package — major)
|
|
37
|
+
|
|
38
|
+
A reusable editor plugin that owns the full Markdown Mode lifecycle: ProseMirror plugin state for
|
|
39
|
+
the active view, a 3-button view toggle (`MarkdownModeViewToggleBase`), a CodeMirror 6 source view
|
|
40
|
+
(`MarkdownSourceView`), ADF↔markdown conversion (`adfToMarkdown` / `markdownToAdf`), and the
|
|
41
|
+
snapshot/writeback orchestration (`MarkdownModeContentComponent`). The plugin is product-agnostic
|
|
42
|
+
— Confluence wraps it for the `cc-markdown-mode` experiment, but any consumer can adopt it.
|
|
43
|
+
|
|
44
|
+
The package also exports two allowlists used by the new insert-filter hooks below:
|
|
45
|
+
- `MARKDOWN_COMPATIBLE_QUICK_INSERT_ITEM_IDS` + `isMarkdownCompatibleQuickInsertItem` — items
|
|
46
|
+
whose underlying node has a clean GFM round-trip via `@atlassian/mdast-util-from-pm`.
|
|
47
|
+
- `MARKDOWN_COMPATIBLE_TOOLBAR_ITEM_NAMES` + `isMarkdownCompatibleToolbarItem` — same idea for the
|
|
48
|
+
main toolbar's `+` insert block.
|
|
49
|
+
|
|
50
|
+
### `@atlaskit/editor-plugin-quick-insert` (minor)
|
|
51
|
+
|
|
52
|
+
Added an optional `itemFilter?: (item: QuickInsertItem) => boolean` to `QuickInsertOptions`. When
|
|
53
|
+
set, the filter is applied in both `getQuickInsertSuggestions` (the typeahead path) and the
|
|
54
|
+
`getSuggestions` action path before items are categorised or returned. Composes additively with
|
|
55
|
+
any caller-supplied filter via `&&`. No behavioural change for callers that don't set it.
|
|
56
|
+
|
|
57
|
+
### `@atlaskit/editor-plugin-insert-block` (minor)
|
|
58
|
+
|
|
59
|
+
Added an optional `itemFilter?: (item: { value: { name: string } }) => boolean` to
|
|
60
|
+
`InsertBlockPluginOptions`. The filter is applied to the items list inside `createItems` before
|
|
61
|
+
it's split into toolbar buttons / overflow dropdown entries, so item counts stay correct
|
|
62
|
+
downstream. Wired through both legacy (`ToolbarInsertBlock`) and new (`useInsertButtonState`)
|
|
63
|
+
toolbar code paths. No behavioural change for callers that don't set it.
|
|
64
|
+
|
|
65
|
+
### `@atlaskit/editor-common` (patch)
|
|
66
|
+
|
|
67
|
+
`UseSharedPluginStateWithSelector`-friendly types are unchanged; the only public change is a new
|
|
68
|
+
optional field on `QuickInsertOptions` and a corresponding plumbing field on the internal
|
|
69
|
+
`QuickInsertSearchOptions`.
|
|
70
|
+
|
|
71
|
+
### `@atlassian/mdast-util-from-pm` (patch)
|
|
72
|
+
|
|
73
|
+
Added `undoEdgeWhitespaceEncoding()` post-processor that replaces the leading/trailing-edge entity
|
|
74
|
+
escapes ` ` and `	` produced by the upstream encoder with literal space and tab
|
|
75
|
+
characters. This is a readability + round-trip identity fix that benefits all consumers, not just
|
|
76
|
+
Markdown Mode.
|
|
77
|
+
|
|
78
|
+
- Updated dependencies
|
|
79
|
+
|
|
3
80
|
## 114.10.1
|
|
4
81
|
|
|
5
82
|
### Patch Changes
|
|
@@ -16,10 +16,12 @@ var _dropdownMenu = _interopRequireWildcard(require("@atlaskit/dropdown-menu"));
|
|
|
16
16
|
var _chevronDown = _interopRequireDefault(require("@atlaskit/icon/core/chevron-down"));
|
|
17
17
|
var _customize = _interopRequireDefault(require("@atlaskit/icon/core/customize"));
|
|
18
18
|
var _linkExternal = _interopRequireDefault(require("@atlaskit/icon/core/link-external"));
|
|
19
|
+
var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
|
|
19
20
|
var _messages = require("../../messages");
|
|
20
21
|
var _StyledButton = require("./StyledButton");
|
|
21
22
|
var _useLinkOverlayAnalyticsEvents = require("./useLinkOverlayAnalyticsEvents");
|
|
22
|
-
var _excluded = ["onClick", "triggerRef"]
|
|
23
|
+
var _excluded = ["onClick", "triggerRef"],
|
|
24
|
+
_excluded2 = ["onClick", "triggerRef"];
|
|
23
25
|
/**
|
|
24
26
|
* @jsxRuntime classic
|
|
25
27
|
* @jsx jsx
|
|
@@ -70,12 +72,32 @@ var Dropdown = function Dropdown(_ref) {
|
|
|
70
72
|
onConfigureClickCallback === null || onConfigureClickCallback === void 0 || onConfigureClickCallback();
|
|
71
73
|
focusEditor();
|
|
72
74
|
}, [fireActionClickEvent, focusEditor, onConfigureClickCallback]);
|
|
75
|
+
var memoizedTrigger = (0, _react.useCallback)(function (_ref3) {
|
|
76
|
+
var _onClick = _ref3.onClick,
|
|
77
|
+
triggerRef = _ref3.triggerRef,
|
|
78
|
+
props = (0, _objectWithoutProperties2.default)(_ref3, _excluded);
|
|
79
|
+
return (0, _react2.jsx)(_StyledButton.StyledButton, (0, _extends2.default)({
|
|
80
|
+
innerRef: triggerRef
|
|
81
|
+
// Ignored via go/ees005
|
|
82
|
+
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
83
|
+
}, props, {
|
|
84
|
+
iconBefore: (0, _react2.jsx)(_chevronDown.default, {
|
|
85
|
+
label: configureLinkLabel,
|
|
86
|
+
size: "small"
|
|
87
|
+
})
|
|
88
|
+
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- intentional: onClick closes over per-render trigger prop
|
|
89
|
+
,
|
|
90
|
+
onClick: function onClick(e) {
|
|
91
|
+
_onClick === null || _onClick === void 0 || _onClick(e);
|
|
92
|
+
fireLinkClickEvent();
|
|
93
|
+
}
|
|
94
|
+
}));
|
|
95
|
+
}, [configureLinkLabel, fireLinkClickEvent]);
|
|
73
96
|
return (0, _react2.jsx)(_dropdownMenu.default, {
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
props = (0, _objectWithoutProperties2.default)(_ref3, _excluded);
|
|
97
|
+
trigger: (0, _expValEquals.expValEquals)('platform_editor_perf_lint_cleanup', 'isEnabled', true) ? memoizedTrigger : function (_ref4) {
|
|
98
|
+
var _onClick2 = _ref4.onClick,
|
|
99
|
+
triggerRef = _ref4.triggerRef,
|
|
100
|
+
props = (0, _objectWithoutProperties2.default)(_ref4, _excluded2);
|
|
79
101
|
return (0, _react2.jsx)(_StyledButton.StyledButton, (0, _extends2.default)({
|
|
80
102
|
innerRef: triggerRef
|
|
81
103
|
// Ignored via go/ees005
|
|
@@ -85,10 +107,10 @@ var Dropdown = function Dropdown(_ref) {
|
|
|
85
107
|
label: configureLinkLabel,
|
|
86
108
|
size: "small"
|
|
87
109
|
})
|
|
88
|
-
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props --
|
|
110
|
+
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- intentional fallback for experiment off path
|
|
89
111
|
,
|
|
90
112
|
onClick: function onClick(e) {
|
|
91
|
-
|
|
113
|
+
_onClick2 === null || _onClick2 === void 0 || _onClick2(e);
|
|
92
114
|
fireLinkClickEvent();
|
|
93
115
|
}
|
|
94
116
|
}));
|
|
@@ -17,6 +17,10 @@ var _utils = require("../../../utils");
|
|
|
17
17
|
var _useEscapeClickaway = require("./useEscapeClickaway");
|
|
18
18
|
var _excluded = ["view", "onCancel", "invokeMethod", "editorAppearance", "onClose", "onEscapeCallback", "onClickAwayCallback"];
|
|
19
19
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
20
|
+
var PREVENT_SCROLL = {
|
|
21
|
+
preventScroll: true
|
|
22
|
+
};
|
|
23
|
+
|
|
20
24
|
/**
|
|
21
25
|
* Returns a type that matches T but where keys (K) are now optional
|
|
22
26
|
*/
|
|
@@ -76,18 +80,24 @@ var EditorLinkPicker = exports.EditorLinkPicker = function EditorLinkPicker(_ref
|
|
|
76
80
|
location: analyticsEditorAppearance
|
|
77
81
|
};
|
|
78
82
|
}, [invokeMethod, analyticsEditorAppearance]);
|
|
83
|
+
var returnFocus = (0, _expValEquals.expValEquals)('platform_editor_perf_lint_cleanup', 'isEnabled', true) ? PREVENT_SCROLL :
|
|
84
|
+
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- intentional fallback for experiment off path
|
|
85
|
+
{
|
|
86
|
+
preventScroll: true
|
|
87
|
+
};
|
|
88
|
+
var focusOptions = (0, _expValEquals.expValEquals)('platform_editor_perf_lint_cleanup', 'isEnabled', true) ? PREVENT_SCROLL :
|
|
89
|
+
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- intentional fallback for experiment off path
|
|
90
|
+
{
|
|
91
|
+
preventScroll: true
|
|
92
|
+
};
|
|
79
93
|
if ((0, _expValEquals.expValEquals)('platform_editor_a11y_escape_link_dialog', 'isEnabled', true)) {
|
|
80
94
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
81
95
|
ref: ref
|
|
82
96
|
}, /*#__PURE__*/_react.default.createElement(_AnalyticsContext.default, {
|
|
83
97
|
data: analyticsData
|
|
84
98
|
}, /*#__PURE__*/_react.default.createElement(_reactFocusLock.default, {
|
|
85
|
-
returnFocus:
|
|
86
|
-
|
|
87
|
-
},
|
|
88
|
-
focusOptions: {
|
|
89
|
-
preventScroll: true
|
|
90
|
-
}
|
|
99
|
+
returnFocus: returnFocus,
|
|
100
|
+
focusOptions: focusOptions
|
|
91
101
|
}, /*#__PURE__*/_react.default.createElement(_lazy.LazyLinkPicker
|
|
92
102
|
// Ignored via go/ees005
|
|
93
103
|
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
@@ -1,16 +1,20 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
4
5
|
Object.defineProperty(exports, "__esModule", {
|
|
5
6
|
value: true
|
|
6
7
|
});
|
|
7
8
|
exports.HyperlinkAddToolbar = HyperlinkAddToolbar;
|
|
8
9
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
9
|
-
var _react =
|
|
10
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
11
|
+
var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
|
|
10
12
|
var _analytics = require("../../../analytics");
|
|
11
13
|
var _providerFactory = require("../../../provider-factory");
|
|
12
14
|
var _EditorLinkPicker = require("../EditorLinkPicker");
|
|
13
15
|
var _HyperlinkAddToolbar = _interopRequireDefault(require("./HyperlinkAddToolbar"));
|
|
16
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
17
|
+
var HYPERLINK_PROVIDERS = ['activityProvider', 'searchProvider'];
|
|
14
18
|
/**
|
|
15
19
|
* Wraps around the editor's onSubmit handler so that the plugin can interface with the link picker
|
|
16
20
|
*/
|
|
@@ -43,16 +47,58 @@ function HyperlinkAddToolbar(_ref2) {
|
|
|
43
47
|
searchSessionId = _ref2.searchSessionId,
|
|
44
48
|
timesViewed = _ref2.timesViewed,
|
|
45
49
|
isOffline = _ref2.isOffline;
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
,
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
50
|
+
var memoizedOnSubmitWithInterface = (0, _react.useMemo)(function () {
|
|
51
|
+
return onSubmitInterface(onSubmit);
|
|
52
|
+
}, [onSubmit]);
|
|
53
|
+
var memoizedRenderNode = (0, _react.useCallback)(function (_ref3) {
|
|
54
|
+
var activityProvider = _ref3.activityProvider,
|
|
55
|
+
searchProvider = _ref3.searchProvider;
|
|
56
|
+
// If we're offline fallback to HyperlinkAddToolbarComp as we may not have loaded
|
|
57
|
+
// EditorLinkPicker into the bundle
|
|
58
|
+
if (lpLinkPicker && !Boolean(isOffline)) {
|
|
59
|
+
return /*#__PURE__*/_react.default.createElement(_EditorLinkPicker.EditorLinkPicker, (0, _extends2.default)({
|
|
60
|
+
view: view,
|
|
61
|
+
invokeMethod: // Provide `invokeMethod` prop as preferred value (card plugin passes as prop) otherwise assume this
|
|
62
|
+
// is being used from inside the hyperlink plugin and use inputMethod from plugin state
|
|
63
|
+
invokeMethod !== null && invokeMethod !== void 0 ? invokeMethod : inputMethod,
|
|
64
|
+
editorAppearance: editorAppearance
|
|
65
|
+
// Ignored via go/ees005
|
|
66
|
+
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
67
|
+
}, linkPickerOptions, {
|
|
68
|
+
url: displayUrl,
|
|
69
|
+
displayText: displayText,
|
|
70
|
+
onSubmit: memoizedOnSubmitWithInterface,
|
|
71
|
+
onCancel: onCancel,
|
|
72
|
+
onClose: onClose,
|
|
73
|
+
onEscapeCallback: onEscapeCallback,
|
|
74
|
+
onClickAwayCallback: onClickAwayCallback
|
|
75
|
+
}));
|
|
76
|
+
}
|
|
77
|
+
return /*#__PURE__*/_react.default.createElement(_HyperlinkAddToolbar.default, {
|
|
78
|
+
activityProvider: activityProvider,
|
|
79
|
+
searchProvider: searchProvider,
|
|
80
|
+
onSubmit: onSubmit,
|
|
81
|
+
displayText: displayText,
|
|
82
|
+
displayUrl: displayUrl,
|
|
83
|
+
view: view,
|
|
84
|
+
onEscapeCallback: onEscapeCallback,
|
|
85
|
+
onClickAwayCallback: onClickAwayCallback,
|
|
86
|
+
inputMethod: inputMethod,
|
|
87
|
+
searchSessionId: searchSessionId,
|
|
88
|
+
timesViewed: timesViewed
|
|
89
|
+
});
|
|
90
|
+
}, [lpLinkPicker, isOffline, view, invokeMethod, inputMethod, editorAppearance, linkPickerOptions, displayUrl, displayText, onSubmit, memoizedOnSubmitWithInterface, onCancel, onClose, onEscapeCallback, onClickAwayCallback, searchSessionId, timesViewed]);
|
|
91
|
+
var providers = (0, _expValEquals.expValEquals)('platform_editor_perf_lint_cleanup', 'isEnabled', true) ? HYPERLINK_PROVIDERS :
|
|
92
|
+
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- intentional fallback for experiment off path
|
|
93
|
+
['activityProvider', 'searchProvider'];
|
|
94
|
+
return /*#__PURE__*/_react.default.createElement(_providerFactory.WithProviders, {
|
|
95
|
+
providers: providers,
|
|
96
|
+
providerFactory: providerFactory,
|
|
97
|
+
renderNode: (0, _expValEquals.expValEquals)('platform_editor_perf_lint_cleanup', 'isEnabled', true) ? memoizedRenderNode :
|
|
98
|
+
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- intentional fallback for experiment off path
|
|
99
|
+
function (_ref4) {
|
|
100
|
+
var activityProvider = _ref4.activityProvider,
|
|
101
|
+
searchProvider = _ref4.searchProvider;
|
|
56
102
|
// If we're offline fallback to HyperlinkAddToolbarComp as we may not have loaded
|
|
57
103
|
// EditorLinkPicker into the bundle
|
|
58
104
|
if (lpLinkPicker && !Boolean(isOffline)) {
|
|
@@ -49,6 +49,7 @@ function withActivityProvider(WrappedComponent) {
|
|
|
49
49
|
value: function render() {
|
|
50
50
|
var providerFactory = this.props.providerFactory;
|
|
51
51
|
return /*#__PURE__*/_react.default.createElement(_providerFactory2.WithProviders
|
|
52
|
+
// Memoising this array causes the component fail tests in platform/packages/editor/editor-plugin-media-tests/src/__tests__/playwright/media-link.spec.ts because the WithProviders component doesn't update when the parent rerenders - this is a bug with the underlying WithProviders component
|
|
52
53
|
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
53
54
|
, {
|
|
54
55
|
providers: ['activityProvider'],
|
|
@@ -160,6 +160,12 @@ Object.defineProperty(exports, "listMessages", {
|
|
|
160
160
|
return _list.messages;
|
|
161
161
|
}
|
|
162
162
|
});
|
|
163
|
+
Object.defineProperty(exports, "markdownModeMessages", {
|
|
164
|
+
enumerable: true,
|
|
165
|
+
get: function get() {
|
|
166
|
+
return _markdownMode.markdownModeMessages;
|
|
167
|
+
}
|
|
168
|
+
});
|
|
163
169
|
Object.defineProperty(exports, "mediaAndEmbedToolbarMessages", {
|
|
164
170
|
enumerable: true,
|
|
165
171
|
get: function get() {
|
|
@@ -334,6 +340,7 @@ var _syncBlock = require("./syncBlock");
|
|
|
334
340
|
var _limitedMode = require("./limited-mode");
|
|
335
341
|
var _companyHubTextColor = require("./company-hub-text-color");
|
|
336
342
|
var _nativeEmbedToolbar = require("./native-embed-toolbar");
|
|
343
|
+
var _markdownMode = require("./markdown-mode");
|
|
337
344
|
// Disable no-re-export rule for entry point files
|
|
338
345
|
/* eslint-disable @atlaskit/editor/no-re-export */
|
|
339
346
|
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.markdownModeMessages = void 0;
|
|
7
|
+
var _reactIntl = require("react-intl");
|
|
8
|
+
/**
|
|
9
|
+
* i18n strings for the Markdown-Mode editor plugin.
|
|
10
|
+
*
|
|
11
|
+
* Defined here in `editor-common` (rather than alongside the components in
|
|
12
|
+
* `editor-plugin-markdown-mode`) because the `no-restricted-imports` rule
|
|
13
|
+
* forbids plugin packages from calling `defineMessages` directly — this
|
|
14
|
+
* keeps every translatable string discoverable from a single location for
|
|
15
|
+
* the i18n tooling. See `@atlaskit/editor/no-defineMessages-in-plugin`.
|
|
16
|
+
*/
|
|
17
|
+
var markdownModeMessages = exports.markdownModeMessages = (0, _reactIntl.defineMessages)({
|
|
18
|
+
groupLabel: {
|
|
19
|
+
id: 'fabric.editor.markdownMode.viewToggle.groupLabel',
|
|
20
|
+
defaultMessage: 'View mode',
|
|
21
|
+
description: 'Accessible label announced for the group of three view-mode toggle buttons (markdown source, WYSIWYG, preview) shown on Markdown-Mode Live Docs.'
|
|
22
|
+
},
|
|
23
|
+
source: {
|
|
24
|
+
id: 'fabric.editor.markdownMode.viewToggle.source',
|
|
25
|
+
defaultMessage: 'Markdown source',
|
|
26
|
+
description: 'Tooltip and accessible label for the toggle button that switches the editor into raw markdown source view.'
|
|
27
|
+
},
|
|
28
|
+
wysiwyg: {
|
|
29
|
+
id: 'fabric.editor.markdownMode.viewToggle.wysiwyg',
|
|
30
|
+
defaultMessage: 'WYSIWYG',
|
|
31
|
+
description: 'Tooltip and accessible label for the toggle button that switches the editor into the WYSIWYG markdown editing view (the default).'
|
|
32
|
+
},
|
|
33
|
+
preview: {
|
|
34
|
+
id: 'fabric.editor.markdownMode.viewToggle.preview',
|
|
35
|
+
defaultMessage: 'Preview',
|
|
36
|
+
description: 'Tooltip and accessible label for the toggle button that switches the editor into a read-only rendered markdown preview.'
|
|
37
|
+
},
|
|
38
|
+
sourceAriaLabel: {
|
|
39
|
+
id: 'fabric.editor.markdownMode.sourceView.ariaLabel',
|
|
40
|
+
defaultMessage: 'Markdown source',
|
|
41
|
+
description: 'Accessible label for the markdown source editor.'
|
|
42
|
+
}
|
|
43
|
+
});
|
|
@@ -25,5 +25,10 @@ var nativeEmbedToolbarMessages = exports.nativeEmbedToolbarMessages = (0, _react
|
|
|
25
25
|
id: 'fabric.editor.setEmbedType.non-final',
|
|
26
26
|
defaultMessage: 'Set embed type',
|
|
27
27
|
description: 'Label for the button to set the type of embed.'
|
|
28
|
+
},
|
|
29
|
+
expandPreview: {
|
|
30
|
+
id: 'fabric.editor.nativeEmbeds.expandPreview',
|
|
31
|
+
defaultMessage: 'Expand preview',
|
|
32
|
+
description: 'Label for the button to open the embed in a fullscreen preview.'
|
|
28
33
|
}
|
|
29
34
|
});
|
|
@@ -19,7 +19,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
19
19
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
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 = "0.0.0-development";
|
|
23
23
|
var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
|
|
24
24
|
// Remove URL as it has UGC
|
|
25
25
|
// Ignored via go/ees007
|
|
@@ -8,7 +8,6 @@ exports.default = void 0;
|
|
|
8
8
|
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
9
9
|
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
10
10
|
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
11
|
-
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
12
11
|
var _promiseHelpers = require("./promise-helpers");
|
|
13
12
|
var flatten = function flatten(arr) {
|
|
14
13
|
var _ref;
|
|
@@ -35,16 +34,10 @@ var _default = exports.default = function _default(providers) {
|
|
|
35
34
|
}));
|
|
36
35
|
case 2:
|
|
37
36
|
results = _context.sent;
|
|
38
|
-
if ((0, _platformFeatureFlags.fg)('platform_editor_fix_getautoconverter_null_error')) {
|
|
39
|
-
_context.next = 5;
|
|
40
|
-
break;
|
|
41
|
-
}
|
|
42
|
-
return _context.abrupt("return", (0, _promiseHelpers.getOnlyFulfilled)(results));
|
|
43
|
-
case 5:
|
|
44
37
|
return _context.abrupt("return", (0, _promiseHelpers.getOnlyFulfilled)(results).filter(function (provider) {
|
|
45
38
|
return provider != null;
|
|
46
39
|
}));
|
|
47
|
-
case
|
|
40
|
+
case 4:
|
|
48
41
|
case "end":
|
|
49
42
|
return _context.stop();
|
|
50
43
|
}
|
|
@@ -1383,6 +1383,12 @@ Object.defineProperty(exports, "UNDO_CHANGES_GROUP_RANK", {
|
|
|
1383
1383
|
return _rank.UNDO_CHANGES_GROUP_RANK;
|
|
1384
1384
|
}
|
|
1385
1385
|
});
|
|
1386
|
+
Object.defineProperty(exports, "VIEW_MODE_TOGGLE_SECTION", {
|
|
1387
|
+
enumerable: true,
|
|
1388
|
+
get: function get() {
|
|
1389
|
+
return _keys.VIEW_MODE_TOGGLE_SECTION;
|
|
1390
|
+
}
|
|
1391
|
+
});
|
|
1386
1392
|
Object.defineProperty(exports, "getInputMethodFromParentKeys", {
|
|
1387
1393
|
enumerable: true,
|
|
1388
1394
|
get: function get() {
|
package/dist/cjs/toolbar/keys.js
CHANGED
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.PIN_MENU_ITEM = exports.PIN_GROUP = exports.PIN_BUTTON = exports.PASTE_RICH_TEXT_MENU_ITEM = exports.PASTE_PLAIN_TEXT_MENU_ITEM = exports.PASTE_NESTED_MENU = exports.PASTE_MENU_SECTION = exports.PASTE_MENU_NESTED_SECTION = exports.PASTE_MENU = exports.PASTE_MARKDOWN_MENU_ITEM = exports.OVERFLOW_SECTION_PRIMARY_TOOLBAR = exports.OVERFLOW_SECTION = exports.OVERFLOW_MENU_PRIMARY_TOOLBAR = exports.OVERFLOW_MENU = exports.OVERFLOW_GROUP_PRIMARY_TOOLBAR = exports.OVERFLOW_GROUP = exports.OVERFLOW_EXTENSIONS_MENU_SECTION = exports.OUTDENT_MENU_ITEM = exports.NUMBERED_LIST_MENU_ITEM = exports.NORMAL_TEXT_MENU_ITEM = exports.MORE_PROFESSIONAL_MENU_ITEM = exports.MORE_EMPATHETIC_MENU_ITEM = exports.MORE_CASUAL_MENU_ITEM = exports.MENTION_GROUP = exports.MENTION_BUTTON = exports.MEDIA_GROUP = exports.MEDIA_BUTTON = exports.MAKE_SHORTER_MENU_ITEM = exports.MAKE_LONGER_MENU_ITEM = exports.LOOM_MENU_SECTION = exports.LOOM_MENU_ITEM = exports.LISTS_INDENTATION_MENU_SECTION = exports.LISTS_INDENTATION_MENU = exports.LISTS_INDENTATION_HERO_BUTTON_COLLAPSED = exports.LISTS_INDENTATION_HERO_BUTTON = exports.LISTS_INDENTATION_GROUP_INLINE = exports.LISTS_INDENTATION_GROUP_COLLAPSED = exports.LISTS_INDENTATION_GROUP = exports.LINKING_SECTION = exports.LINKING_GROUP = exports.LINKING_BUTTON = exports.LAYOUT_GROUP = exports.LAYOUT_BUTTON = exports.ITALIC_MENU_ITEM = exports.INSERT_GROUP = exports.INSERT_BUTTON = exports.INSERT_BLOCK_SECTION = exports.INDENT_MENU_ITEM = exports.IMPROVE_WRITING_MENU_ITEM = exports.IMPROVE_WRITING_GROUP = exports.IMPROVE_WRITING_BUTTON = exports.HIGHLIGHT_MENU_ITEM = exports.HERO_PROMPT_MENU_ITEM = exports.HERO_PROMPT_BUTTON_GROUP = exports.HERO_PROMPT_BUTTON = exports.HEADING_6_MENU_ITEM = exports.HEADING_5_MENU_ITEM = exports.HEADING_4_MENU_ITEM = exports.HEADING_3_MENU_ITEM = exports.HEADING_2_MENU_ITEM = exports.HEADING_1_MENU_ITEM = exports.FIRST_PARTY_EXTENSIONS_MENU_ITEM = exports.EXTERNAL_EXTENSIONS_MENU_ITEM = exports.EMOJI_GROUP = exports.EMOJI_BUTTON = exports.DEFINE_MENU_ITEM = exports.DEFINE_GROUP = exports.DEFINE_BUTTON = exports.COMMENT_HERO_BUTTON = exports.COMMENT_GROUP = exports.COLLAB_SECTION = exports.CODE_MENU_ITEM = exports.CODE_BLOCK_GROUP = exports.CODE_BLOCK_BUTTON = exports.CLEAR_FORMATTING_MENU_ITEM = exports.CLEAR_FORMARTTING_MENU_SECTION = exports.CLEAR_COLOR_MENU_ITEM = exports.CHANGE_TONE_NESTED_MENU = exports.CHANGE_TONE_MENU_SECTION = exports.BULLETED_LIST_MENU_ITEM = exports.BULLETED_LIST_BUTTON_GROUP = exports.BULLETED_LIST_BUTTON = exports.BOLD_MENU_ITEM = exports.BOLD_BUTTON_GROUP = exports.BOLD_BUTTON = exports.BLOCK_QUOTE_MENU_ITEM = exports.APPS_SECTION = exports.ALIGN_RIGHT_MENU_ITEM = exports.ALIGN_LEFT_MENU_ITEM = exports.ALIGN_CENTER_MENU_ITEM = exports.ALIGNMENT_MENU_SECTION = exports.ALIGNMENT_MENU = exports.ALIGNMENT_GROUP = exports.AI_VIEW_SECTION = exports.AI_SECTION_PRIMARY_TOOLBAR = exports.AI_SECTION_FULL_PAGE_PRIMARY_TOOLBAR = exports.AI_SECTION_COMMENT_PRIMARY_TOOLBAR = exports.AI_SECTION = exports.AI_PASTE_MENU_SECTION = exports.ADD_POLISH_MENU_ITEM = void 0;
|
|
7
|
-
exports.UNDO_CHANGES_GROUP = exports.UNDO_BUTTON = exports.UNDERLINE_MENU_ITEM = exports.UNDERLINE_BUTTON_GROUP = exports.UNDERLINE_BUTTON = exports.TRANSLATE_NESTED_MENU = exports.TRANSLATE_MENU_SECTION = exports.TRACK_CHANGES_SECTION = exports.TRACK_CHANGES_GROUP = exports.TRACK_CHANGES_BUTTON = exports.TOOLBAR_BUTTON_TEST_ID = exports.TOOLBARS = exports.TEXT_STYLES_MENU_SECTION = exports.TEXT_STYLES_MENU = exports.TEXT_STYLES_GROUP = exports.TEXT_SECTION_PRIMARY_TOOLBAR = exports.TEXT_SECTION_COLLAPSED = exports.TEXT_SECTION = exports.TEXT_FORMATTING_MENU_SECTION = exports.TEXT_FORMATTING_MENU = exports.TEXT_FORMATTING_HERO_BUTTON_COLLAPSED = exports.TEXT_FORMATTING_HERO_BUTTON = exports.TEXT_FORMATTING_GROUP_INLINE = exports.TEXT_FORMATTING_GROUP_COLLAPSED = exports.TEXT_FORMATTING_GROUP = exports.TEXT_COLOR_MENU_ITEM = exports.TEXT_COLOR_HIGHLIGHT_MENU_SECTION = exports.TEXT_COLOR_HIGHLIGHT_MENU = exports.TEXT_COLOR_HIGHLIGHT_GROUP = exports.TEXT_COLLAPSED_MENU = exports.TEXT_COLLAPSED_GROUP = exports.TASK_LIST_MENU_ITEM = exports.TASK_LIST_GROUP = exports.TASK_LIST_BUTTON = exports.TABLE_SIZE_PICKER = exports.TABLE_GROUP = exports.TABLE_BUTTON = exports.SYNCED_BLOCK_SECTION = exports.SYNCED_BLOCK_GROUP = exports.SYNCED_BLOCK_BUTTON = exports.SUPERSCRIPT_MENU_ITEM = exports.SUBSCRIPT_MENU_ITEM = exports.STRIKE_MENU_ITEM = exports.SPELLING_AND_GRAMMAR_MENU_ITEM = exports.SMALL_TEXT_MENU_ITEM = exports.SELECTION_EXTENSION_MENU_SECTION = exports.ROVO_WRITE_BUTTON_PRIMARY_TOOLBAR = exports.ROVO_PROMPT_MENU_SECTION_DISPLAY_SMALL = exports.ROVO_PROMPT_MENU_SECTION = exports.ROVO_MENU_DISPLAY_SMALL = exports.ROVO_MENU = exports.ROVO_HERO_BUTTON = exports.ROVO_GROUP_VIEW = exports.ROVO_GROUP_PRIMARY_TOOLBAR = exports.ROVO_GROUP_DISPLAY_SMALL = exports.ROVO_GROUP = exports.REDO_CHANGES_GROUP = exports.REDO_BUTTON = exports.PIN_SECTION = exports.PIN_MENU_SECTION = void 0;
|
|
7
|
+
exports.VIEW_MODE_TOGGLE_SECTION = exports.UNDO_CHANGES_GROUP = exports.UNDO_BUTTON = exports.UNDERLINE_MENU_ITEM = exports.UNDERLINE_BUTTON_GROUP = exports.UNDERLINE_BUTTON = exports.TRANSLATE_NESTED_MENU = exports.TRANSLATE_MENU_SECTION = exports.TRACK_CHANGES_SECTION = exports.TRACK_CHANGES_GROUP = exports.TRACK_CHANGES_BUTTON = exports.TOOLBAR_BUTTON_TEST_ID = exports.TOOLBARS = exports.TEXT_STYLES_MENU_SECTION = exports.TEXT_STYLES_MENU = exports.TEXT_STYLES_GROUP = exports.TEXT_SECTION_PRIMARY_TOOLBAR = exports.TEXT_SECTION_COLLAPSED = exports.TEXT_SECTION = exports.TEXT_FORMATTING_MENU_SECTION = exports.TEXT_FORMATTING_MENU = exports.TEXT_FORMATTING_HERO_BUTTON_COLLAPSED = exports.TEXT_FORMATTING_HERO_BUTTON = exports.TEXT_FORMATTING_GROUP_INLINE = exports.TEXT_FORMATTING_GROUP_COLLAPSED = exports.TEXT_FORMATTING_GROUP = exports.TEXT_COLOR_MENU_ITEM = exports.TEXT_COLOR_HIGHLIGHT_MENU_SECTION = exports.TEXT_COLOR_HIGHLIGHT_MENU = exports.TEXT_COLOR_HIGHLIGHT_GROUP = exports.TEXT_COLLAPSED_MENU = exports.TEXT_COLLAPSED_GROUP = exports.TASK_LIST_MENU_ITEM = exports.TASK_LIST_GROUP = exports.TASK_LIST_BUTTON = exports.TABLE_SIZE_PICKER = exports.TABLE_GROUP = exports.TABLE_BUTTON = exports.SYNCED_BLOCK_SECTION = exports.SYNCED_BLOCK_GROUP = exports.SYNCED_BLOCK_BUTTON = exports.SUPERSCRIPT_MENU_ITEM = exports.SUBSCRIPT_MENU_ITEM = exports.STRIKE_MENU_ITEM = exports.SPELLING_AND_GRAMMAR_MENU_ITEM = exports.SMALL_TEXT_MENU_ITEM = exports.SELECTION_EXTENSION_MENU_SECTION = exports.ROVO_WRITE_BUTTON_PRIMARY_TOOLBAR = exports.ROVO_PROMPT_MENU_SECTION_DISPLAY_SMALL = exports.ROVO_PROMPT_MENU_SECTION = exports.ROVO_MENU_DISPLAY_SMALL = exports.ROVO_MENU = exports.ROVO_HERO_BUTTON = exports.ROVO_GROUP_VIEW = exports.ROVO_GROUP_PRIMARY_TOOLBAR = exports.ROVO_GROUP_DISPLAY_SMALL = exports.ROVO_GROUP = exports.REDO_CHANGES_GROUP = exports.REDO_BUTTON = exports.PIN_SECTION = exports.PIN_MENU_SECTION = void 0;
|
|
8
8
|
var TOOLBARS = exports.TOOLBARS = {
|
|
9
9
|
INLINE_TEXT_TOOLBAR: 'inline-text-toolbar',
|
|
10
10
|
PRIMARY_TOOLBAR: 'primary-toolbar'
|
|
@@ -661,6 +661,23 @@ var PIN_BUTTON = exports.PIN_BUTTON = {
|
|
|
661
661
|
type: 'button'
|
|
662
662
|
};
|
|
663
663
|
|
|
664
|
+
/**
|
|
665
|
+
* View-mode toggle section
|
|
666
|
+
* - Holds the Markdown view-mode toggle (source / wysiwyg / preview) on the
|
|
667
|
+
* right edge of the primary toolbar, just before the overflow `…` menu.
|
|
668
|
+
* - Currently only registered by `@atlassian/editor-plugin-markdown-mode`
|
|
669
|
+
* from Confluence's live-doc Markdown Mode editor preset.
|
|
670
|
+
*
|
|
671
|
+
* The plugin renders the entire toggle UI inside the section's `component`
|
|
672
|
+
* itself rather than registering child groups/buttons through the toolbar
|
|
673
|
+
* model, because the toggle is a self-contained 3-button segmented control
|
|
674
|
+
* with shared internal state.
|
|
675
|
+
*/
|
|
676
|
+
var VIEW_MODE_TOGGLE_SECTION = exports.VIEW_MODE_TOGGLE_SECTION = {
|
|
677
|
+
key: 'view-mode-toggle-section',
|
|
678
|
+
type: 'section'
|
|
679
|
+
};
|
|
680
|
+
|
|
664
681
|
/**
|
|
665
682
|
* Loom section
|
|
666
683
|
* - Only rendered in dropdown menu in primary toolbar
|
package/dist/cjs/toolbar/rank.js
CHANGED
|
@@ -8,7 +8,7 @@ exports.UNDO_CHANGES_GROUP_RANK = exports.TRANSLATE_MENU_RANK = exports.TRACK_CH
|
|
|
8
8
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
9
9
|
var _keys = require("./keys");
|
|
10
10
|
var _TOOLBAR_RANK;
|
|
11
|
-
var TOOLBAR_RANK = exports.TOOLBAR_RANK = (_TOOLBAR_RANK = {}, (0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)(_TOOLBAR_RANK, _keys.AI_SECTION.key, 100), _keys.AI_VIEW_SECTION.key, 100), _keys.TEXT_SECTION.key, 200), _keys.TEXT_SECTION_COLLAPSED.key, 200), _keys.INSERT_BLOCK_SECTION.key, 300), _keys.LINKING_SECTION.key, 400), _keys.COLLAB_SECTION.key, 500), _keys.APPS_SECTION.key, 600), _keys.TRACK_CHANGES_SECTION.key, 700), _keys.OVERFLOW_SECTION.key, 800), (0, _defineProperty2.default)((0, _defineProperty2.default)(_TOOLBAR_RANK, _keys.PIN_SECTION.key, 900), _keys.OVERFLOW_SECTION_PRIMARY_TOOLBAR.key, 1000));
|
|
11
|
+
var TOOLBAR_RANK = exports.TOOLBAR_RANK = (_TOOLBAR_RANK = {}, (0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)(_TOOLBAR_RANK, _keys.AI_SECTION.key, 100), _keys.AI_VIEW_SECTION.key, 100), _keys.TEXT_SECTION.key, 200), _keys.TEXT_SECTION_COLLAPSED.key, 200), _keys.INSERT_BLOCK_SECTION.key, 300), _keys.LINKING_SECTION.key, 400), _keys.COLLAB_SECTION.key, 500), _keys.APPS_SECTION.key, 600), _keys.TRACK_CHANGES_SECTION.key, 700), _keys.OVERFLOW_SECTION.key, 800), (0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)(_TOOLBAR_RANK, _keys.PIN_SECTION.key, 900), _keys.VIEW_MODE_TOGGLE_SECTION.key, 950), _keys.OVERFLOW_SECTION_PRIMARY_TOOLBAR.key, 1000));
|
|
12
12
|
|
|
13
13
|
/**
|
|
14
14
|
* AI section
|
|
@@ -24,7 +24,7 @@ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.
|
|
|
24
24
|
* @jsx jsx
|
|
25
25
|
*/ // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
26
26
|
var packageName = "@atlaskit/editor-common";
|
|
27
|
-
var packageVersion = "
|
|
27
|
+
var packageVersion = "0.0.0-development";
|
|
28
28
|
var halfFocusRing = 1;
|
|
29
29
|
var dropOffset = '0, 8';
|
|
30
30
|
var fadeIn = (0, _react2.keyframes)({
|
|
@@ -12,6 +12,7 @@ import DropdownMenu, { DropdownItem, DropdownItemGroup } from '@atlaskit/dropdow
|
|
|
12
12
|
import ChevronDownIcon from '@atlaskit/icon/core/chevron-down';
|
|
13
13
|
import PreferencesIcon from '@atlaskit/icon/core/customize';
|
|
14
14
|
import LinkExternalIcon from '@atlaskit/icon/core/link-external';
|
|
15
|
+
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
15
16
|
import { cardMessages as messages } from '../../messages';
|
|
16
17
|
import { StyledButton } from './StyledButton';
|
|
17
18
|
import { useLinkOverlayAnalyticsEvents } from './useLinkOverlayAnalyticsEvents';
|
|
@@ -61,9 +62,28 @@ const Dropdown = ({
|
|
|
61
62
|
onConfigureClickCallback === null || onConfigureClickCallback === void 0 ? void 0 : onConfigureClickCallback();
|
|
62
63
|
focusEditor();
|
|
63
64
|
}, [fireActionClickEvent, focusEditor, onConfigureClickCallback]);
|
|
65
|
+
const memoizedTrigger = useCallback(({
|
|
66
|
+
onClick,
|
|
67
|
+
triggerRef,
|
|
68
|
+
...props
|
|
69
|
+
}) => jsx(StyledButton, _extends({
|
|
70
|
+
innerRef: triggerRef
|
|
71
|
+
// Ignored via go/ees005
|
|
72
|
+
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
73
|
+
}, props, {
|
|
74
|
+
iconBefore: jsx(ChevronDownIcon, {
|
|
75
|
+
label: configureLinkLabel,
|
|
76
|
+
size: "small"
|
|
77
|
+
})
|
|
78
|
+
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- intentional: onClick closes over per-render trigger prop
|
|
79
|
+
,
|
|
80
|
+
onClick: e => {
|
|
81
|
+
onClick === null || onClick === void 0 ? void 0 : onClick(e);
|
|
82
|
+
fireLinkClickEvent();
|
|
83
|
+
}
|
|
84
|
+
})), [configureLinkLabel, fireLinkClickEvent]);
|
|
64
85
|
return jsx(DropdownMenu, {
|
|
65
|
-
|
|
66
|
-
trigger: ({
|
|
86
|
+
trigger: expValEquals('platform_editor_perf_lint_cleanup', 'isEnabled', true) ? memoizedTrigger : ({
|
|
67
87
|
onClick,
|
|
68
88
|
triggerRef,
|
|
69
89
|
...props
|
|
@@ -76,7 +96,7 @@ const Dropdown = ({
|
|
|
76
96
|
label: configureLinkLabel,
|
|
77
97
|
size: "small"
|
|
78
98
|
})
|
|
79
|
-
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props --
|
|
99
|
+
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- intentional fallback for experiment off path
|
|
80
100
|
,
|
|
81
101
|
onClick: e => {
|
|
82
102
|
onClick === null || onClick === void 0 ? void 0 : onClick(e);
|
|
@@ -6,6 +6,9 @@ import { LazyLinkPicker } from '@atlaskit/link-picker/lazy';
|
|
|
6
6
|
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
7
7
|
import { getAnalyticsEditorAppearance } from '../../../utils';
|
|
8
8
|
import { useEscapeClickaway } from './useEscapeClickaway';
|
|
9
|
+
const PREVENT_SCROLL = {
|
|
10
|
+
preventScroll: true
|
|
11
|
+
};
|
|
9
12
|
|
|
10
13
|
/**
|
|
11
14
|
* Returns a type that matches T but where keys (K) are now optional
|
|
@@ -66,18 +69,24 @@ export const EditorLinkPicker = ({
|
|
|
66
69
|
// Below is added for the future implementation of Linking Platform namespaced analytic context
|
|
67
70
|
location: analyticsEditorAppearance
|
|
68
71
|
}), [invokeMethod, analyticsEditorAppearance]);
|
|
72
|
+
const returnFocus = expValEquals('platform_editor_perf_lint_cleanup', 'isEnabled', true) ? PREVENT_SCROLL :
|
|
73
|
+
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- intentional fallback for experiment off path
|
|
74
|
+
{
|
|
75
|
+
preventScroll: true
|
|
76
|
+
};
|
|
77
|
+
const focusOptions = expValEquals('platform_editor_perf_lint_cleanup', 'isEnabled', true) ? PREVENT_SCROLL :
|
|
78
|
+
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- intentional fallback for experiment off path
|
|
79
|
+
{
|
|
80
|
+
preventScroll: true
|
|
81
|
+
};
|
|
69
82
|
if (expValEquals('platform_editor_a11y_escape_link_dialog', 'isEnabled', true)) {
|
|
70
83
|
return /*#__PURE__*/React.createElement("div", {
|
|
71
84
|
ref: ref
|
|
72
85
|
}, /*#__PURE__*/React.createElement(AnalyticsContext, {
|
|
73
86
|
data: analyticsData
|
|
74
87
|
}, /*#__PURE__*/React.createElement(FocusLock, {
|
|
75
|
-
returnFocus:
|
|
76
|
-
|
|
77
|
-
},
|
|
78
|
-
focusOptions: {
|
|
79
|
-
preventScroll: true
|
|
80
|
-
}
|
|
88
|
+
returnFocus: returnFocus,
|
|
89
|
+
focusOptions: focusOptions
|
|
81
90
|
}, /*#__PURE__*/React.createElement(LazyLinkPicker
|
|
82
91
|
// Ignored via go/ees005
|
|
83
92
|
// eslint-disable-next-line react/jsx-props-no-spreading
|