@atlaskit/editor-core 229.0.0 → 229.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +25 -0
- package/dist/cjs/ui/Appearance/FullPage/FullPageContentArea-compiled.js +2 -0
- package/dist/cjs/ui/ContextPanel/index-compiled.js +1 -1
- package/dist/cjs/ui/EditorContentContainer/EditorContentContainer-compiled.js +2 -11
- package/dist/cjs/ui/EditorContentContainer/EditorContentContainer-emotion.js +6 -16
- package/dist/cjs/ui/quick-insert/getExtensionQuickInsertPreviewImageUrls.js +115 -4
- package/dist/cjs/utils/extensions.js +30 -7
- package/dist/cjs/version-wrapper.js +1 -1
- package/dist/es2019/ui/Appearance/FullPage/FullPageContentArea-compiled.js +3 -1
- package/dist/es2019/ui/ContextPanel/index-compiled.js +1 -1
- package/dist/es2019/ui/EditorContentContainer/EditorContentContainer-compiled.js +4 -12
- package/dist/es2019/ui/EditorContentContainer/EditorContentContainer-emotion.js +7 -17
- package/dist/es2019/ui/quick-insert/getExtensionQuickInsertPreviewImageUrls.js +110 -2
- package/dist/es2019/utils/extensions.js +32 -7
- package/dist/es2019/version-wrapper.js +1 -1
- package/dist/esm/ui/Appearance/FullPage/FullPageContentArea-compiled.js +3 -1
- package/dist/esm/ui/ContextPanel/index-compiled.js +1 -1
- package/dist/esm/ui/EditorContentContainer/EditorContentContainer-compiled.js +4 -12
- package/dist/esm/ui/EditorContentContainer/EditorContentContainer-emotion.js +7 -17
- package/dist/esm/ui/quick-insert/getExtensionQuickInsertPreviewImageUrls.js +114 -4
- package/dist/esm/utils/extensions.js +30 -6
- package/dist/esm/version-wrapper.js +1 -1
- package/dist/types/ui/quick-insert/getExtensionQuickInsertPreviewImageUrls.d.ts +1 -1
- package/package.json +11 -10
|
@@ -9,6 +9,8 @@ import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE, fireAnalyticsEve
|
|
|
9
9
|
import { getQuickInsertItemsFromModule, resolveImport } from '@atlaskit/editor-common/extensions';
|
|
10
10
|
import { findInsertLocation } from '@atlaskit/editor-common/utils/analytics';
|
|
11
11
|
import { isExperimentEnabled } from '@atlaskit/platform-feature-experiments/is-experiment-enabled';
|
|
12
|
+
// oxlint-disable-next-line @atlassian/no-restricted-imports
|
|
13
|
+
import { lazyForPaint, LazySuspense } from 'react-loosely-lazy';
|
|
12
14
|
import { getExtensionQuickInsertComponents } from '../ui/quick-insert/getExtensionQuickInsertComponents';
|
|
13
15
|
|
|
14
16
|
// Structural shape of the markdown-mode plugin's slice of the injection API.
|
|
@@ -71,6 +73,23 @@ var dummyExtensionAPI = {
|
|
|
71
73
|
}
|
|
72
74
|
}
|
|
73
75
|
};
|
|
76
|
+
// Keep lazy icon component identities stable across menu unmounts and remounts.
|
|
77
|
+
var lazyExtensionIconCache = new WeakMap();
|
|
78
|
+
var LazyExtensionIcon = function LazyExtensionIcon(_ref) {
|
|
79
|
+
var iconLoader = _ref.iconLoader;
|
|
80
|
+
var Icon = lazyExtensionIconCache.get(iconLoader);
|
|
81
|
+
if (!Icon) {
|
|
82
|
+
Icon = lazyForPaint(function () {
|
|
83
|
+
return iconLoader();
|
|
84
|
+
});
|
|
85
|
+
lazyExtensionIconCache.set(iconLoader, Icon);
|
|
86
|
+
}
|
|
87
|
+
return /*#__PURE__*/React.createElement(LazySuspense, {
|
|
88
|
+
fallback: null
|
|
89
|
+
}, /*#__PURE__*/React.createElement(Icon, {
|
|
90
|
+
label: ""
|
|
91
|
+
}));
|
|
92
|
+
};
|
|
74
93
|
|
|
75
94
|
/** Creates legacy and registered Quick Insert representations for extensions. */
|
|
76
95
|
export function extensionProviderToQuickInsertProvider(_x, _x2, _x3, _x4) {
|
|
@@ -116,12 +135,6 @@ function _extensionProviderToQuickInsertProvider() {
|
|
|
116
135
|
return Promise.resolve([]);
|
|
117
136
|
}
|
|
118
137
|
var quickInsertItems = getQuickInsertItemsFromModule(extensions, function (item) {
|
|
119
|
-
var Icon = Loadable({
|
|
120
|
-
loader: item.icon,
|
|
121
|
-
loading: function loading() {
|
|
122
|
-
return null;
|
|
123
|
-
}
|
|
124
|
-
});
|
|
125
138
|
return _objectSpread(_objectSpread(_objectSpread(_objectSpread({}, (isExperimentEnabled('platform_editor_slash_app_category_analytics') || isExperimentEnabled('platform_editor_slash_command')) && item.app ? {
|
|
126
139
|
app: item.app
|
|
127
140
|
} : {}), {}, {
|
|
@@ -132,6 +145,17 @@ function _extensionProviderToQuickInsertProvider() {
|
|
|
132
145
|
title: item.title,
|
|
133
146
|
description: item.description,
|
|
134
147
|
icon: function icon() {
|
|
148
|
+
if (isExperimentEnabled('platform_editor_loosely_lazy_migration')) {
|
|
149
|
+
return /*#__PURE__*/React.createElement(LazyExtensionIcon, {
|
|
150
|
+
iconLoader: item.icon
|
|
151
|
+
});
|
|
152
|
+
}
|
|
153
|
+
var Icon = Loadable({
|
|
154
|
+
loader: item.icon,
|
|
155
|
+
loading: function loading() {
|
|
156
|
+
return null;
|
|
157
|
+
}
|
|
158
|
+
});
|
|
135
159
|
return /*#__PURE__*/React.createElement(Icon, {
|
|
136
160
|
label: ""
|
|
137
161
|
});
|
|
@@ -3,5 +3,5 @@ type PreviewImageUrls = {
|
|
|
3
3
|
dark: string;
|
|
4
4
|
light: string;
|
|
5
5
|
};
|
|
6
|
-
export declare const getExtensionQuickInsertPreviewImageUrls: (item: Pick<MenuItem, 'title'> & Partial<Pick<MenuItem, 'key'>>) => PreviewImageUrls | undefined;
|
|
6
|
+
export declare const getExtensionQuickInsertPreviewImageUrls: (item: Pick<MenuItem, 'title'> & Partial<Pick<MenuItem, 'extensionKey' | 'key'>>) => PreviewImageUrls | undefined;
|
|
7
7
|
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-core",
|
|
3
|
-
"version": "229.
|
|
3
|
+
"version": "229.1.0",
|
|
4
4
|
"description": "A package contains Atlassian editor core functionality",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
"@atlaskit/editor-prosemirror": "^9.0.0",
|
|
60
60
|
"@atlaskit/editor-shared-styles": "^4.3.0",
|
|
61
61
|
"@atlaskit/editor-ssr-renderer": "^14.0.0",
|
|
62
|
-
"@atlaskit/editor-toolbar": "^2.
|
|
62
|
+
"@atlaskit/editor-toolbar": "^2.7.0",
|
|
63
63
|
"@atlaskit/editor-toolbar-model": "^1.2.0",
|
|
64
64
|
"@atlaskit/emoji": "^72.4.0",
|
|
65
65
|
"@atlaskit/feature-gate-js-client": "^6.0.0",
|
|
@@ -75,9 +75,9 @@
|
|
|
75
75
|
"@atlaskit/popup": "^6.3.0",
|
|
76
76
|
"@atlaskit/primitives": "^22.5.0",
|
|
77
77
|
"@atlaskit/react-compiler-gating": "^0.2.0",
|
|
78
|
-
"@atlaskit/react-ufo": "^7.
|
|
78
|
+
"@atlaskit/react-ufo": "^7.13.0",
|
|
79
79
|
"@atlaskit/task-decision": "^21.10.0",
|
|
80
|
-
"@atlaskit/tmp-editor-statsig": "^
|
|
80
|
+
"@atlaskit/tmp-editor-statsig": "^200.0.0",
|
|
81
81
|
"@atlaskit/tokens": "^18.2.0",
|
|
82
82
|
"@atlaskit/tooltip": "^24.3.0",
|
|
83
83
|
"@atlaskit/width-detector": "^7.2.0",
|
|
@@ -91,11 +91,12 @@
|
|
|
91
91
|
"memoize-one": "^6.0.0",
|
|
92
92
|
"prop-types": "^15.5.10",
|
|
93
93
|
"react-loadable": "^5.1.0",
|
|
94
|
+
"react-loosely-lazy": "^1.0.0",
|
|
94
95
|
"react-transition-group": "^4.4.1",
|
|
95
96
|
"uuid": "^11.1.1"
|
|
96
97
|
},
|
|
97
98
|
"peerDependencies": {
|
|
98
|
-
"@atlaskit/editor-common": "^123.
|
|
99
|
+
"@atlaskit/editor-common": "^123.1.0",
|
|
99
100
|
"@atlaskit/link-provider": "^5.7.0",
|
|
100
101
|
"@atlaskit/media-core": "^38.2.0",
|
|
101
102
|
"react": "^18.2.0 || ^19.2.0",
|
|
@@ -109,9 +110,9 @@
|
|
|
109
110
|
"@af/visual-regression": "workspace:^",
|
|
110
111
|
"@atlaskit/adf-utils": "^20.9.0",
|
|
111
112
|
"@atlaskit/analytics-gas-types": "^6.2.0",
|
|
112
|
-
"@atlaskit/analytics-listeners": "^11.
|
|
113
|
+
"@atlaskit/analytics-listeners": "^11.4.0",
|
|
113
114
|
"@atlaskit/code": "^19.2.0",
|
|
114
|
-
"@atlaskit/collab-provider": "^28.
|
|
115
|
+
"@atlaskit/collab-provider": "^28.2.0",
|
|
115
116
|
"@atlaskit/docs": "^12.2.0",
|
|
116
117
|
"@atlaskit/drawer": "^14.3.0",
|
|
117
118
|
"@atlaskit/editor-plugin-alignment": "^20.0.0",
|
|
@@ -146,7 +147,7 @@
|
|
|
146
147
|
"@atlaskit/form": "^17.2.0",
|
|
147
148
|
"@atlaskit/link-provider": "^5.7.0",
|
|
148
149
|
"@atlaskit/linking-common": "^12.3.0",
|
|
149
|
-
"@atlaskit/logo": "^23.
|
|
150
|
+
"@atlaskit/logo": "^23.1.0",
|
|
150
151
|
"@atlaskit/media-core": "^38.2.0",
|
|
151
152
|
"@atlaskit/media-integration-test-helpers": "workspace:^",
|
|
152
153
|
"@atlaskit/media-picker": "^72.4.0",
|
|
@@ -169,10 +170,10 @@
|
|
|
169
170
|
"@atlassian/a11y-jest-testing": "^0.17.0",
|
|
170
171
|
"@atlassian/a11y-playwright-testing": "^0.12.0",
|
|
171
172
|
"@atlassian/adf-schema-json": "^1.35.0",
|
|
172
|
-
"@atlassian/editor-rovo-bridge": "^18.
|
|
173
|
+
"@atlassian/editor-rovo-bridge": "^18.1.0",
|
|
173
174
|
"@atlassian/experiment-test-utils": "^0.2.0",
|
|
174
175
|
"@atlassian/feature-flags-test-utils": "^1.3.0",
|
|
175
|
-
"@atlassian/search-client": "^3.
|
|
176
|
+
"@atlassian/search-client": "^3.2.0",
|
|
176
177
|
"@atlassian/search-provider": "^20.0.0",
|
|
177
178
|
"@atlassian/structured-docs-types": "workspace:^",
|
|
178
179
|
"@atlassian/testing-library": "^0.11.0",
|