@atlaskit/editor-common 130.4.1 → 130.5.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 +36 -0
- package/dist/cjs/ai-messages/ai-suggestions.js +5 -0
- package/dist/cjs/element-browser/components/ElementBrowserLoader.js +31 -8
- package/dist/cjs/extensions/extension-handlers.js +164 -33
- package/dist/cjs/floating-toolbar/DropdownMenuExtensionItems.js +25 -4
- package/dist/cjs/icons/index.js +33 -10
- package/dist/cjs/monitoring/error.js +1 -1
- package/dist/cjs/quick-insert/assets/index.js +888 -257
- package/dist/cjs/ui/DropList/index.js +1 -1
- package/dist/cjs/ui/FloatingToolbar/Button.js +2 -0
- package/dist/cjs/ui/Mention/mention-with-profilecard.js +30 -11
- package/dist/cjs/utils/is-non-production-build.js +2 -6
- package/dist/es2019/ai-messages/ai-suggestions.js +5 -0
- package/dist/es2019/element-browser/components/ElementBrowserLoader.js +16 -2
- package/dist/es2019/extensions/extension-handlers.js +88 -15
- package/dist/es2019/floating-toolbar/DropdownMenuExtensionItems.js +16 -2
- package/dist/es2019/icons/index.js +17 -3
- package/dist/es2019/monitoring/error.js +1 -1
- package/dist/es2019/quick-insert/assets/index.js +386 -66
- package/dist/es2019/ui/DropList/index.js +1 -1
- package/dist/es2019/ui/FloatingToolbar/Button.js +2 -0
- package/dist/es2019/ui/Mention/mention-with-profilecard.js +15 -4
- package/dist/es2019/utils/is-non-production-build.js +2 -6
- package/dist/esm/ai-messages/ai-suggestions.js +5 -0
- package/dist/esm/element-browser/components/ElementBrowserLoader.js +28 -6
- package/dist/esm/extensions/extension-handlers.js +165 -33
- package/dist/esm/floating-toolbar/DropdownMenuExtensionItems.js +24 -4
- package/dist/esm/icons/index.js +29 -7
- package/dist/esm/monitoring/error.js +1 -1
- package/dist/esm/quick-insert/assets/index.js +764 -194
- package/dist/esm/ui/DropList/index.js +1 -1
- package/dist/esm/ui/FloatingToolbar/Button.js +2 -0
- package/dist/esm/ui/Mention/mention-with-profilecard.js +25 -8
- package/dist/esm/utils/is-non-production-build.js +2 -6
- package/dist/types/ai-messages/ai-suggestions.d.ts +5 -0
- package/dist/types/icons/index.d.ts +5 -3
- package/dist/types/quick-insert/assets/index.d.ts +34 -32
- package/dist/types/ui/FloatingToolbar/Button.d.ts +3 -2
- package/dist/types/utils/is-non-production-build.d.ts +2 -2
- package/package.json +4 -3
|
@@ -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 = "130.4.
|
|
27
|
+
var packageVersion = "130.4.2";
|
|
28
28
|
var halfFocusRing = 1;
|
|
29
29
|
var dropOffset = '0, 8';
|
|
30
30
|
var fadeIn = (0, _react2.keyframes)({
|
|
@@ -55,6 +55,7 @@ var FloatingToolbarButton = function FloatingToolbarButton(_ref, forwardedRef) {
|
|
|
55
55
|
areaControls = _ref.areaControls,
|
|
56
56
|
ariaLabel = _ref.ariaLabel,
|
|
57
57
|
isRadioButton = _ref.isRadioButton,
|
|
58
|
+
isLoading = _ref.isLoading,
|
|
58
59
|
pulse = _ref.pulse,
|
|
59
60
|
areAnyNewToolbarFlagsEnabled = _ref.areAnyNewToolbarFlagsEnabled;
|
|
60
61
|
// Check if there's only an icon and add additional styles
|
|
@@ -134,6 +135,7 @@ var FloatingToolbarButton = function FloatingToolbarButton(_ref, forwardedRef) {
|
|
|
134
135
|
onKeyDown: onKeyDown,
|
|
135
136
|
isSelected: selected,
|
|
136
137
|
isDisabled: disabled,
|
|
138
|
+
isLoading: isLoading,
|
|
137
139
|
testId: testId,
|
|
138
140
|
interactionName: interactionName,
|
|
139
141
|
onMouseEnter: (0, _expValEquals.expValEquals)('editor_a11y__enghealth-46814_fy26', 'isEnabled', true) ? onMouseEnter : undefined,
|
|
@@ -8,6 +8,7 @@ exports.default = MentionWithProfileCard;
|
|
|
8
8
|
var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
|
|
9
9
|
var _react = _interopRequireWildcard(require("react"));
|
|
10
10
|
var _reactLoadable = _interopRequireDefault(require("react-loadable"));
|
|
11
|
+
var _reactLooselyLazy = require("react-loosely-lazy");
|
|
11
12
|
var _resourcedMention = _interopRequireDefault(require("@atlaskit/mention/resourced-mention"));
|
|
12
13
|
var _isExperimentEnabled = require("@atlaskit/platform-feature-experiments/is-experiment-enabled");
|
|
13
14
|
var _fg = require("@atlaskit/platform-feature-flags/fg");
|
|
@@ -15,24 +16,42 @@ var _anchor = require("@atlaskit/primitives/anchor");
|
|
|
15
16
|
var _profileCardTrigger = _interopRequireDefault(require("@atlaskit/profilecard/profile-card-trigger"));
|
|
16
17
|
var _navigateToTeamsApp2 = require("@atlaskit/teams-app-config/utils/teams-app-navigation/navigate-to-teams-app");
|
|
17
18
|
var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
|
|
18
|
-
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" != (0, _typeof2.default)(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); } //
|
|
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" != (0, _typeof2.default)(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); } // oxlint-disable-next-line @atlassian/no-restricted-imports
|
|
20
|
+
// eslint-disable-next-line @atlaskit/design-system/no-emotion-primitives -- TODO: migrate to @atlaskit/primitives/compiled
|
|
19
21
|
// Lazy-loaded so the agent profile card chunk (and its `@atlaskit/rovo-agent-components`
|
|
20
22
|
// dependency) stays off the critical path — it is only fetched when an agent mention
|
|
21
23
|
// (`userType === 'APP'`) actually renders, never for person mentions.
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
24
|
+
var loadAgentProfileCardTrigger = function loadAgentProfileCardTrigger() {
|
|
25
|
+
return Promise.resolve().then(function () {
|
|
26
|
+
return _interopRequireWildcard(require( /* webpackChunkName: "@atlaskit-internal_profilecard/agent-profile-card-trigger" */
|
|
27
|
+
'@atlaskit/profilecard/agent-profile-card-trigger'));
|
|
28
|
+
}).then(function (mod) {
|
|
29
|
+
return mod.AgentProfileCardTrigger;
|
|
30
|
+
});
|
|
31
|
+
};
|
|
32
|
+
var AgentProfileCardTriggerLazy = (0, _reactLooselyLazy.lazy)(function () {
|
|
33
|
+
return Promise.resolve().then(function () {
|
|
34
|
+
return _interopRequireWildcard(require( /* webpackChunkName: "@atlaskit-internal_profilecard/agent-profile-card-trigger" */
|
|
35
|
+
'@atlaskit/profilecard/agent-profile-card-trigger'));
|
|
36
|
+
}).then(function (mod) {
|
|
37
|
+
return mod.AgentProfileCardTrigger;
|
|
38
|
+
});
|
|
39
|
+
});
|
|
40
|
+
AgentProfileCardTriggerLazy.displayName = 'lazy(AgentProfileCardTrigger)';
|
|
41
|
+
var AgentProfileCardTriggerLoadable = (0, _reactLoadable.default)({
|
|
42
|
+
loader: loadAgentProfileCardTrigger,
|
|
32
43
|
loading: function loading() {
|
|
33
44
|
return null;
|
|
34
45
|
}
|
|
35
46
|
});
|
|
47
|
+
var AgentProfileCardTrigger = function AgentProfileCardTrigger(props) {
|
|
48
|
+
return (0, _isExperimentEnabled.isExperimentEnabled)('platform_editor_loosely_lazy_migration') ? /*#__PURE__*/_react.default.createElement(_reactLooselyLazy.LazySuspense, {
|
|
49
|
+
fallback: null
|
|
50
|
+
}, /*#__PURE__*/_react.default.createElement(AgentProfileCardTriggerLazy, props)) :
|
|
51
|
+
/*#__PURE__*/
|
|
52
|
+
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
53
|
+
_react.default.createElement(AgentProfileCardTriggerLoadable, props);
|
|
54
|
+
};
|
|
36
55
|
|
|
37
56
|
// Ignored via go/ees005
|
|
38
57
|
// eslint-disable-next-line require-unicode-regexp
|
|
@@ -4,16 +4,12 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.getNonProductionBuildAnalyticsAttributes = void 0;
|
|
7
|
-
var _isExperimentEnabled = require("@atlaskit/platform-feature-experiments/is-experiment-enabled");
|
|
8
7
|
/**
|
|
9
|
-
* Adds a product-owned build classification
|
|
10
|
-
* A classifier callback is
|
|
8
|
+
* Adds a product-owned build classification to analytics attributes.
|
|
9
|
+
* A classifier callback is evaluated lazily, so the caller controls when browser reads happen.
|
|
11
10
|
* An unknown classification is omitted; an explicit false is preserved.
|
|
12
11
|
*/
|
|
13
12
|
var getNonProductionBuildAnalyticsAttributes = exports.getNonProductionBuildAnalyticsAttributes = function getNonProductionBuildAnalyticsAttributes(classification) {
|
|
14
|
-
if (!(0, _isExperimentEnabled.isExperimentEnabled)('platform_editor_non_production_build_analytics')) {
|
|
15
|
-
return {};
|
|
16
|
-
}
|
|
17
13
|
var isNonProductionBuild = typeof classification === 'function' ? classification() : classification;
|
|
18
14
|
return isNonProductionBuild !== undefined ? {
|
|
19
15
|
isNonProductionBuild: isNonProductionBuild
|
|
@@ -300,6 +300,11 @@ export const aiSuggestionsMessages = defineMessages({
|
|
|
300
300
|
defaultMessage: 'Rovo is reviewing your page',
|
|
301
301
|
description: 'First loading message on the AI suggestions thinking bar, shown when the name of the reviewing agent is unknown'
|
|
302
302
|
},
|
|
303
|
+
thinkingPreparingAgent: {
|
|
304
|
+
id: 'fabric.editor.ai.suggestions.thinking.preparingAgent.non-final',
|
|
305
|
+
defaultMessage: 'Preparing agent',
|
|
306
|
+
description: 'First loading message on the AI suggestions thinking bar, shown while the reviewing agent is still being loaded and its name is not yet known. Animated dots are appended by the UI.'
|
|
307
|
+
},
|
|
303
308
|
thinkingReviewingContentWithAgent: {
|
|
304
309
|
id: 'fabric.editor.ai.suggestions.thinking.agentAnalyzing.non-final',
|
|
305
310
|
defaultMessage: '{agentName} is analyzing',
|
|
@@ -7,6 +7,11 @@ import React from 'react';
|
|
|
7
7
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
8
8
|
import { css, jsx } from '@emotion/react';
|
|
9
9
|
import Loadable from 'react-loadable';
|
|
10
|
+
// oxlint-disable-next-line @atlassian/no-restricted-imports
|
|
11
|
+
import { lazy, LazySuspense } from 'react-loosely-lazy';
|
|
12
|
+
|
|
13
|
+
// oxlint-disable-next-line @atlassian/no-restricted-imports
|
|
14
|
+
import { isExperimentEnabled } from '@atlaskit/platform-feature-experiments/is-experiment-enabled';
|
|
10
15
|
import Spinner from '@atlaskit/spinner/spinner';
|
|
11
16
|
const spinnerContainer = css({
|
|
12
17
|
display: 'flex',
|
|
@@ -15,8 +20,11 @@ const spinnerContainer = css({
|
|
|
15
20
|
height: '100%',
|
|
16
21
|
width: '100%'
|
|
17
22
|
});
|
|
18
|
-
const
|
|
19
|
-
|
|
23
|
+
const loadElementBrowser = () => import( /* webpackChunkName: "@atlaskit-internal_editor-element-browser" */'../ElementBrowser').then(module => module.default);
|
|
24
|
+
const ElementBrowserLazy = lazy(() => import( /* webpackChunkName: "@atlaskit-internal_editor-element-browser" */'../ElementBrowser').then(module => module.default));
|
|
25
|
+
ElementBrowserLazy.displayName = 'lazy(ElementBrowser)';
|
|
26
|
+
const ElementBrowserLoadable = Loadable({
|
|
27
|
+
loader: loadElementBrowser,
|
|
20
28
|
loading: () => jsx("div", {
|
|
21
29
|
css: spinnerContainer
|
|
22
30
|
}, jsx(Spinner, {
|
|
@@ -24,4 +32,10 @@ const ElementBrowserLoader = Loadable({
|
|
|
24
32
|
interactionName: "element-browser-spinner"
|
|
25
33
|
}))
|
|
26
34
|
});
|
|
35
|
+
const ElementBrowserLoader = props => isExperimentEnabled('platform_editor_loosely_lazy_migration') ? jsx(LazySuspense, {
|
|
36
|
+
fallback: null
|
|
37
|
+
}, jsx(ElementBrowserLazy, props)) :
|
|
38
|
+
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
39
|
+
jsx(ElementBrowserLoadable, props);
|
|
40
|
+
ElementBrowserLoader.preload = () => isExperimentEnabled('platform_editor_loosely_lazy_migration') ? ElementBrowserLazy.preload() : ElementBrowserLoadable.preload();
|
|
27
41
|
export default ElementBrowserLoader;
|
|
@@ -1,6 +1,11 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
1
3
|
import React from 'react';
|
|
2
4
|
import { useIntl } from 'react-intl';
|
|
3
5
|
import Loadable from 'react-loadable';
|
|
6
|
+
// oxlint-disable-next-line @atlassian/no-restricted-imports
|
|
7
|
+
import { lazy, LazySuspense } from 'react-loosely-lazy';
|
|
8
|
+
import { isExperimentEnabled } from '@atlaskit/platform-feature-experiments/is-experiment-enabled';
|
|
4
9
|
import { getExtensionKeyAndNodeKey, resolveImport } from './manifest-helpers';
|
|
5
10
|
import { messages } from './messages';
|
|
6
11
|
import { resolveImportSync } from './resolveImportSync';
|
|
@@ -59,6 +64,38 @@ function isUnknownConfluenceMacroWithBody(extensionNode) {
|
|
|
59
64
|
var _extensionNode$parame, _extensionNode$parame2, _extensionNode$parame3;
|
|
60
65
|
return extensionNode !== null && extensionNode.type === 'extension' && extensionNode.extensionType === 'com.atlassian.confluence.macro.core' && !!((_extensionNode$parame = extensionNode.parameters) !== null && _extensionNode$parame !== void 0 && (_extensionNode$parame2 = _extensionNode$parame.macroParams) !== null && _extensionNode$parame2 !== void 0 && (_extensionNode$parame3 = _extensionNode$parame2.__bodyContent) !== null && _extensionNode$parame3 !== void 0 && _extensionNode$parame3.value);
|
|
61
66
|
}
|
|
67
|
+
// eslint-disable-next-line @repo/internal/react/no-class-components -- error boundaries require a class component
|
|
68
|
+
class ExtensionRendererErrorBoundary extends React.Component {
|
|
69
|
+
constructor(...args) {
|
|
70
|
+
super(...args);
|
|
71
|
+
_defineProperty(this, "state", {});
|
|
72
|
+
}
|
|
73
|
+
static getDerivedStateFromError(error) {
|
|
74
|
+
return {
|
|
75
|
+
error
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
componentDidCatch(error) {
|
|
79
|
+
// eslint-disable-next-line no-console
|
|
80
|
+
console.error('Error rendering extension', error);
|
|
81
|
+
}
|
|
82
|
+
render() {
|
|
83
|
+
return this.state.error ? renderExtensionLoadingError(this.state.error, this.props.fallbackProps) : this.props.children;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
const noop = () => {};
|
|
87
|
+
function renderExtensionLoadingError(error, props) {
|
|
88
|
+
// Needed because the old react-loadable (older code-splitting library) error handling behaviour might be relied on by extensions.
|
|
89
|
+
// https://unpkg.com/react-loadable@5.2.2/lib/index.js
|
|
90
|
+
return /*#__PURE__*/React.createElement(ExtensionLoading, _extends({
|
|
91
|
+
isLoading: false,
|
|
92
|
+
pastDelay: true,
|
|
93
|
+
timedOut: false,
|
|
94
|
+
error: error,
|
|
95
|
+
retry: noop
|
|
96
|
+
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
97
|
+
}, props));
|
|
98
|
+
}
|
|
62
99
|
function ExtensionLoading(props) {
|
|
63
100
|
const intl = useIntl();
|
|
64
101
|
const extensionNode = props.node;
|
|
@@ -81,27 +118,63 @@ function ExtensionLoading(props) {
|
|
|
81
118
|
|
|
82
119
|
// eslint-disable-next-line @atlaskit/volt-strict-mode/no-multiple-exports
|
|
83
120
|
export function getNodeRenderer(extensionProvider, extensionType, extensionKey) {
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
121
|
+
// Async is needed to wrap the getExtensionModuleNodeMaybePreloaded call in a promise so that we can use the lazy() API
|
|
122
|
+
const loadNodeRenderer = async () => {
|
|
123
|
+
var _renderSync, _ref;
|
|
124
|
+
const maybePromise = getExtensionModuleNodeMaybePreloaded(extensionProvider, extensionType, extensionKey);
|
|
125
|
+
if (maybePromise instanceof Promise) {
|
|
126
|
+
return resolveImport((await maybePromise).render());
|
|
127
|
+
}
|
|
128
|
+
const preloaded = maybePromise === null || maybePromise === void 0 ? void 0 : (_renderSync = (_ref = maybePromise).renderSync) === null || _renderSync === void 0 ? void 0 : _renderSync.call(_ref);
|
|
129
|
+
// Only product implemented preloading will return sync result
|
|
130
|
+
// However the out-of-box won't handle this. Confluence uses a custom implementation
|
|
131
|
+
return preloaded ?
|
|
132
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
133
|
+
resolveImportSync(preloaded) : resolveImport((await maybePromise).render());
|
|
134
|
+
};
|
|
135
|
+
const LazyNodeRenderer = lazy(() => loadNodeRenderer());
|
|
136
|
+
LazyNodeRenderer.displayName = 'lazy(NodeRenderer)';
|
|
137
|
+
const loadNodeRendererNoWrappedPromise = () => {
|
|
138
|
+
var _renderSync2, _ref2;
|
|
139
|
+
const maybePromise = getExtensionModuleNodeMaybePreloaded(extensionProvider, extensionType, extensionKey);
|
|
140
|
+
if (maybePromise instanceof Promise) {
|
|
141
|
+
return maybePromise.then(node => resolveImport(node.render()));
|
|
142
|
+
}
|
|
143
|
+
const preloaded = maybePromise === null || maybePromise === void 0 ? void 0 : (_renderSync2 = (_ref2 = maybePromise).renderSync) === null || _renderSync2 === void 0 ? void 0 : _renderSync2.call(_ref2);
|
|
144
|
+
// Only product implemented preloading will return sync result
|
|
145
|
+
// However the out-of-box won't handle this. Confluence uses a custom implementation
|
|
146
|
+
return preloaded ?
|
|
147
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
148
|
+
resolveImportSync(preloaded) : resolveImport(maybePromise.render());
|
|
149
|
+
};
|
|
150
|
+
// Ignored via go/ees005
|
|
151
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
152
|
+
const getNodeRenderer = Loadable({
|
|
153
|
+
loader: loadNodeRendererNoWrappedPromise,
|
|
99
154
|
// react-loadable passes all props from <NodeRenderer> to the loading component at runtime,
|
|
100
155
|
// but its TypeScript types only expect LoadingComponentProps. We cast here because
|
|
101
156
|
// ExtensionLoading accepts additional props (node, showUnknownMacroPlaceholder) that
|
|
102
157
|
// react-loadable will pass through but doesn't know about in its type definitions.
|
|
103
158
|
loading: ExtensionLoading
|
|
104
159
|
});
|
|
160
|
+
// We have to make sure the Loadable is assigned the name "getNodeRenderer" by Babel.
|
|
161
|
+
// This loadable name is used by Babel to inject _maybeSyncLoader: true.
|
|
162
|
+
// confluence/next/tools/config/loadableBabelPluginOptions.config.js (see HOT-307098)
|
|
163
|
+
const LoadableNodeRenderer = getNodeRenderer;
|
|
164
|
+
const NodeRenderer = props => {
|
|
165
|
+
var _props$loadingFallbac;
|
|
166
|
+
if (!isExperimentEnabled('platform_editor_loosely_lazy_migration')) {
|
|
167
|
+
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
168
|
+
return /*#__PURE__*/React.createElement(LoadableNodeRenderer, props);
|
|
169
|
+
}
|
|
170
|
+
return /*#__PURE__*/React.createElement(ExtensionRendererErrorBoundary, {
|
|
171
|
+
fallbackProps: props
|
|
172
|
+
}, /*#__PURE__*/React.createElement(LazySuspense, {
|
|
173
|
+
fallback: (_props$loadingFallbac = props.loadingFallback) !== null && _props$loadingFallbac !== void 0 ? _props$loadingFallbac : null
|
|
174
|
+
}, /*#__PURE__*/React.createElement(LazyNodeRenderer, props)));
|
|
175
|
+
};
|
|
176
|
+
NodeRenderer.preload = () => isExperimentEnabled('platform_editor_loosely_lazy_migration') ? LazyNodeRenderer.preload() : LoadableNodeRenderer.preload();
|
|
177
|
+
return NodeRenderer;
|
|
105
178
|
}
|
|
106
179
|
// eslint-disable-next-line @atlaskit/editor/no-re-export
|
|
107
180
|
export { getExtensionManifest } from './getExtensionManifest';
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import React, { useEffect, useRef, useState } from 'react';
|
|
2
2
|
import Loadable from 'react-loadable';
|
|
3
|
+
// oxlint-disable-next-line @atlassian/no-restricted-imports
|
|
4
|
+
import { lazy, LazySuspense } from 'react-loosely-lazy';
|
|
5
|
+
import { isExperimentEnabled } from '@atlaskit/platform-feature-experiments/is-experiment-enabled';
|
|
3
6
|
import { getContextualToolbarItemsFromModule } from '../extensions';
|
|
4
7
|
import { nodeToJSON } from '../utils';
|
|
5
8
|
import { DropdownMenuItem } from './DropdownMenuItem';
|
|
@@ -62,10 +65,21 @@ const DropdownMenuExtensionItem = ({
|
|
|
62
65
|
// Use ref to keep icon component stable across renders
|
|
63
66
|
const iconRef = useRef(null);
|
|
64
67
|
if (!iconRef.current && item.icon) {
|
|
65
|
-
|
|
66
|
-
|
|
68
|
+
const loadIcon = () => resolveExtensionIcon(item.icon);
|
|
69
|
+
const IconLazy = lazy(() => resolveExtensionIcon(item.icon));
|
|
70
|
+
IconLazy.displayName = 'lazy(ExtensionIcon)';
|
|
71
|
+
const IconLoadable = Loadable({
|
|
72
|
+
loader: loadIcon,
|
|
67
73
|
loading: noop
|
|
68
74
|
});
|
|
75
|
+
const Icon = props => isExperimentEnabled('platform_editor_loosely_lazy_migration') ? /*#__PURE__*/React.createElement(LazySuspense, {
|
|
76
|
+
fallback: null
|
|
77
|
+
}, /*#__PURE__*/React.createElement(IconLazy, props)) :
|
|
78
|
+
/*#__PURE__*/
|
|
79
|
+
// eslint-disable-next-line react/jsx-props-no-spreading -- pass icon props to the legacy component
|
|
80
|
+
React.createElement(IconLoadable, props);
|
|
81
|
+
Icon.preload = () => isExperimentEnabled('platform_editor_loosely_lazy_migration') ? IconLazy.preload() : IconLoadable.preload();
|
|
82
|
+
iconRef.current = Icon;
|
|
69
83
|
}
|
|
70
84
|
const dropdownItem = convertExtensionToDropdownMenuItem({
|
|
71
85
|
item,
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
// Disable no-re-export rule for entry point files
|
|
2
2
|
/* eslint-disable @atlaskit/editor/no-re-export */
|
|
3
3
|
|
|
4
|
+
import React from 'react';
|
|
4
5
|
import Loadable from 'react-loadable';
|
|
6
|
+
// oxlint-disable-next-line @atlassian/no-restricted-imports
|
|
7
|
+
import { lazy, LazySuspense } from 'react-loosely-lazy';
|
|
8
|
+
import { isExperimentEnabled } from '@atlaskit/platform-feature-experiments/is-experiment-enabled';
|
|
5
9
|
export { PanelInfoIcon } from './shared/PanelInfoIcon';
|
|
6
10
|
export { PanelWarningIcon } from './shared/PanelWarningIcon';
|
|
7
11
|
export { PanelErrorIcon } from './shared/PanelErrorIcon';
|
|
@@ -10,7 +14,17 @@ export { PanelNoteIcon } from './shared/PanelNoteIcon';
|
|
|
10
14
|
export { BorderIcon } from './shared/BorderIcon';
|
|
11
15
|
export { SteppedRainbowIconDecoration, rainbow, disabledRainbow } from './shared/SteppedRainbowIconDecoration';
|
|
12
16
|
export { DynamicStrokeIconDecoration } from './shared/DynamicStrokeIconDecoration';
|
|
13
|
-
|
|
14
|
-
|
|
17
|
+
const loadIconTable = () => import( /* webpackChunkName: "@atlaskit-internal_editor-icon-table" */'../icons/shared/table').then(module => module.default);
|
|
18
|
+
const IconTableLazy = lazy(() => import( /* webpackChunkName: "@atlaskit-internal_editor-icon-table" */'../icons/shared/table').then(module => module.default));
|
|
19
|
+
IconTableLazy.displayName = 'lazy(IconTable)';
|
|
20
|
+
const IconTableLoadable = Loadable({
|
|
21
|
+
loader: loadIconTable,
|
|
15
22
|
loading: () => null
|
|
16
|
-
});
|
|
23
|
+
});
|
|
24
|
+
export const IconTable = props => isExperimentEnabled('platform_editor_loosely_lazy_migration') ? /*#__PURE__*/React.createElement(LazySuspense, {
|
|
25
|
+
fallback: null
|
|
26
|
+
}, /*#__PURE__*/React.createElement(IconTableLazy, props)) :
|
|
27
|
+
/*#__PURE__*/
|
|
28
|
+
// eslint-disable-next-line react/jsx-props-no-spreading -- pass icon props to the legacy component
|
|
29
|
+
React.createElement(IconTableLoadable, props);
|
|
30
|
+
IconTable.preload = () => isExperimentEnabled('platform_editor_loosely_lazy_migration') ? IconTableLazy.preload() : IconTableLoadable.preload();
|
|
@@ -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 = "130.4.
|
|
16
|
+
const packageVersion = "130.4.2";
|
|
17
17
|
const sanitiseSentryEvents = (data, _hint) => {
|
|
18
18
|
// Remove URL as it has UGC
|
|
19
19
|
// Ignored via go/ees007
|