@atlaskit/editor-core 239.0.2 → 240.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 +34 -0
- package/dist/cjs/composable-editor/hooks/useMemoEditorProps.js +1 -3
- package/dist/cjs/ui/Appearance/FullPage/FullPageContentArea.js +3 -9
- package/dist/cjs/ui/EditorContentContainer/EditorContentContainer-compiled.compiled.css +1 -0
- package/dist/cjs/ui/EditorContentContainer/EditorContentContainer-compiled.js +2 -1
- package/dist/cjs/ui/Toolbar/Toolbar.js +2 -2
- package/dist/cjs/ui/quick-insert/ExtensionQuickInsertMenuItem.js +22 -2
- package/dist/cjs/ui/quick-insert/app-vendor/AppVendorRequestError.js +31 -0
- package/dist/cjs/ui/quick-insert/app-vendor/appVendorCache.js +14 -0
- package/dist/cjs/ui/quick-insert/app-vendor/fetchAppVendors.js +112 -0
- package/dist/cjs/ui/quick-insert/app-vendor/fetchAppVendorsInBatches.js +101 -0
- package/dist/cjs/ui/quick-insert/app-vendor/getAppVendorLookup.js +33 -0
- package/dist/cjs/ui/quick-insert/app-vendor/prefetchAppVendors.js +129 -0
- package/dist/cjs/ui/quick-insert/app-vendor/useAppVendorName.js +26 -0
- package/dist/cjs/ui/quick-insert/getExtensionQuickInsertComponents.js +13 -2
- package/dist/cjs/version-wrapper.js +1 -1
- package/dist/es2019/composable-editor/hooks/useMemoEditorProps.js +1 -3
- package/dist/es2019/ui/Appearance/FullPage/FullPageContentArea.js +3 -9
- package/dist/es2019/ui/EditorContentContainer/EditorContentContainer-compiled.compiled.css +1 -0
- package/dist/es2019/ui/EditorContentContainer/EditorContentContainer-compiled.js +2 -1
- package/dist/es2019/ui/Toolbar/Toolbar.js +1 -1
- package/dist/es2019/ui/quick-insert/ExtensionQuickInsertMenuItem.js +20 -3
- package/dist/es2019/ui/quick-insert/app-vendor/AppVendorRequestError.js +11 -0
- package/dist/es2019/ui/quick-insert/app-vendor/appVendorCache.js +8 -0
- package/dist/es2019/ui/quick-insert/app-vendor/fetchAppVendors.js +69 -0
- package/dist/es2019/ui/quick-insert/app-vendor/fetchAppVendorsInBatches.js +51 -0
- package/dist/es2019/ui/quick-insert/app-vendor/getAppVendorLookup.js +28 -0
- package/dist/es2019/ui/quick-insert/app-vendor/prefetchAppVendors.js +109 -0
- package/dist/es2019/ui/quick-insert/app-vendor/useAppVendorName.js +18 -0
- package/dist/es2019/ui/quick-insert/getExtensionQuickInsertComponents.js +17 -10
- package/dist/es2019/version-wrapper.js +1 -1
- package/dist/esm/composable-editor/hooks/useMemoEditorProps.js +1 -3
- package/dist/esm/ui/Appearance/FullPage/FullPageContentArea.js +3 -9
- package/dist/esm/ui/EditorContentContainer/EditorContentContainer-compiled.compiled.css +1 -0
- package/dist/esm/ui/EditorContentContainer/EditorContentContainer-compiled.js +2 -1
- package/dist/esm/ui/Toolbar/Toolbar.js +1 -1
- package/dist/esm/ui/quick-insert/ExtensionQuickInsertMenuItem.js +22 -3
- package/dist/esm/ui/quick-insert/app-vendor/AppVendorRequestError.js +24 -0
- package/dist/esm/ui/quick-insert/app-vendor/appVendorCache.js +8 -0
- package/dist/esm/ui/quick-insert/app-vendor/fetchAppVendors.js +105 -0
- package/dist/esm/ui/quick-insert/app-vendor/fetchAppVendorsInBatches.js +94 -0
- package/dist/esm/ui/quick-insert/app-vendor/getAppVendorLookup.js +27 -0
- package/dist/esm/ui/quick-insert/app-vendor/prefetchAppVendors.js +119 -0
- package/dist/esm/ui/quick-insert/app-vendor/useAppVendorName.js +20 -0
- package/dist/esm/ui/quick-insert/getExtensionQuickInsertComponents.js +13 -2
- package/dist/esm/version-wrapper.js +1 -1
- package/dist/types/editor-appearances/ChromelessEditor.d.ts +1 -1
- package/dist/types/editor-appearances/CommentEditor.d.ts +1 -1
- package/dist/types/editor-appearances/FullPageEditor.d.ts +1 -1
- package/dist/types/editor-appearances/FullWidthEditor.d.ts +1 -1
- package/dist/types/types/editor-props.d.ts +1 -13
- package/dist/types/ui/quick-insert/ExtensionQuickInsertMenuItem.d.ts +3 -1
- package/dist/types/ui/quick-insert/app-vendor/AppVendorRequestError.d.ts +5 -0
- package/dist/types/ui/quick-insert/app-vendor/appVendorCache.d.ts +17 -0
- package/dist/types/ui/quick-insert/app-vendor/fetchAppVendors.d.ts +8 -0
- package/dist/types/ui/quick-insert/app-vendor/fetchAppVendorsInBatches.d.ts +23 -0
- package/dist/types/ui/quick-insert/app-vendor/getAppVendorLookup.d.ts +11 -0
- package/dist/types/ui/quick-insert/app-vendor/prefetchAppVendors.d.ts +7 -0
- package/dist/types/ui/quick-insert/app-vendor/useAppVendorName.d.ts +2 -0
- package/package.json +14 -14
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { FORGE_EXTENSION_TYPE } from '@atlaskit/editor-common/extensions/manifest-helpers';
|
|
2
|
+
var FORGE_APP_ARI_PREFIX = 'ari:cloud:ecosystem::app/';
|
|
3
|
+
|
|
4
|
+
/** How to look up the Marketplace partner of the app that contributes an extension item. */
|
|
5
|
+
|
|
6
|
+
/** Returns a lookup only for ecosystem apps; Atlassian-owned items have no Marketplace partner. */
|
|
7
|
+
export var getAppVendorLookup = function getAppVendorLookup(_ref) {
|
|
8
|
+
var app = _ref.app,
|
|
9
|
+
extensionType = _ref.extensionType;
|
|
10
|
+
if ((app === null || app === void 0 ? void 0 : app.source) !== 'ecosystem' || !app.key) {
|
|
11
|
+
return undefined;
|
|
12
|
+
}
|
|
13
|
+
if (extensionType === FORGE_EXTENSION_TYPE) {
|
|
14
|
+
// Marketplace returns null for a bare Forge app UUID, so always send the full ARI.
|
|
15
|
+
var value = app.key.startsWith(FORGE_APP_ARI_PREFIX) ? app.key : "".concat(FORGE_APP_ARI_PREFIX).concat(app.key);
|
|
16
|
+
return {
|
|
17
|
+
id: "forge:".concat(value),
|
|
18
|
+
kind: 'forge',
|
|
19
|
+
value: value
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
return {
|
|
23
|
+
id: "connect:".concat(app.key),
|
|
24
|
+
kind: 'connect',
|
|
25
|
+
value: app.key
|
|
26
|
+
};
|
|
27
|
+
};
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
+
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; }
|
|
3
|
+
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; }
|
|
4
|
+
import { logException } from '@atlaskit/editor-common/monitoring/error';
|
|
5
|
+
import { appVendorCache } from './appVendorCache';
|
|
6
|
+
import { getAppVendorLookup } from './getAppVendorLookup';
|
|
7
|
+
|
|
8
|
+
/** Failed lookups are retried on later menu opens, up to this many attempts per page load. */
|
|
9
|
+
var MAX_ATTEMPTS = 3;
|
|
10
|
+
var LOG_LOCATION = 'editor-core/quick-insert/prefetchAppVendors';
|
|
11
|
+
var entries = appVendorCache.entries,
|
|
12
|
+
listeners = appVendorCache.listeners;
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Set once any batch fails with 401, 403, or 429. Those mean the session cannot read Marketplace
|
|
16
|
+
* data or the gateway is throttling, which applies to every editor on the page, so all further
|
|
17
|
+
* lookups stop until the page reloads.
|
|
18
|
+
*/
|
|
19
|
+
var isBlocked = false;
|
|
20
|
+
var shouldFetch = function shouldFetch(entry) {
|
|
21
|
+
return !entry || entry.status === 'failed' && entry.attempts < MAX_ATTEMPTS;
|
|
22
|
+
};
|
|
23
|
+
var getAttempts = function getAttempts(entry) {
|
|
24
|
+
return (entry === null || entry === void 0 ? void 0 : entry.status) === 'failed' ? entry.attempts : 0;
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
// A throwing subscriber must not stop the others or abort the batch that is being settled.
|
|
28
|
+
var notify = function notify() {
|
|
29
|
+
return listeners.forEach(function (listener) {
|
|
30
|
+
try {
|
|
31
|
+
listener();
|
|
32
|
+
} catch (error) {
|
|
33
|
+
logException(error, {
|
|
34
|
+
location: LOG_LOCATION
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
};
|
|
39
|
+
var markFailed = function markFailed(_ref) {
|
|
40
|
+
var attempts = _ref.attempts,
|
|
41
|
+
id = _ref.id;
|
|
42
|
+
return entries.set(id, {
|
|
43
|
+
attempts: attempts,
|
|
44
|
+
status: 'failed'
|
|
45
|
+
});
|
|
46
|
+
};
|
|
47
|
+
var settleBatch = function settleBatch(batch, result) {
|
|
48
|
+
if (result.status !== 'fulfilled') {
|
|
49
|
+
if (result.status === 'rejected') {
|
|
50
|
+
isBlocked || (isBlocked = result.isBlocking);
|
|
51
|
+
logException(result.error, {
|
|
52
|
+
location: LOG_LOCATION
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
batch.forEach(markFailed);
|
|
56
|
+
return;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
// Lookups missing from the result errored individually and stay retryable.
|
|
60
|
+
batch.forEach(function (lookup) {
|
|
61
|
+
var name = result.names.get(lookup.id);
|
|
62
|
+
if (name === undefined) {
|
|
63
|
+
markFailed(lookup);
|
|
64
|
+
} else {
|
|
65
|
+
entries.set(lookup.id, {
|
|
66
|
+
name: name,
|
|
67
|
+
status: 'resolved'
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
});
|
|
71
|
+
notify();
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* Starts fetching Marketplace partner names for every ecosystem app among `items`.
|
|
76
|
+
* Safe to call repeatedly: cached, in-flight, and exhausted lookups are skipped. The fetching code
|
|
77
|
+
* is loaded only once a lookup is queued.
|
|
78
|
+
*/
|
|
79
|
+
export var prefetchAppVendors = function prefetchAppVendors(items) {
|
|
80
|
+
if (isBlocked) {
|
|
81
|
+
return;
|
|
82
|
+
}
|
|
83
|
+
var lookups = [];
|
|
84
|
+
items.forEach(function (item) {
|
|
85
|
+
var lookup = getAppVendorLookup(item);
|
|
86
|
+
var entry = lookup && entries.get(lookup.id);
|
|
87
|
+
if (lookup && shouldFetch(entry)) {
|
|
88
|
+
lookups.push(_objectSpread(_objectSpread({}, lookup), {}, {
|
|
89
|
+
attempts: getAttempts(entry) + 1
|
|
90
|
+
}));
|
|
91
|
+
entries.set(lookup.id, {
|
|
92
|
+
status: 'pending'
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
});
|
|
96
|
+
if (lookups.length === 0) {
|
|
97
|
+
return;
|
|
98
|
+
}
|
|
99
|
+
void import( /* webpackChunkName: "@atlaskit-internal_editor-core-quick-insert-app-vendor" */'./fetchAppVendorsInBatches').then(function (_ref2) {
|
|
100
|
+
var fetchAppVendorsInBatches = _ref2.fetchAppVendorsInBatches;
|
|
101
|
+
return fetchAppVendorsInBatches(lookups, {
|
|
102
|
+
onBatch: settleBatch,
|
|
103
|
+
shouldContinue: function shouldContinue() {
|
|
104
|
+
return !isBlocked;
|
|
105
|
+
}
|
|
106
|
+
});
|
|
107
|
+
}, function (error) {
|
|
108
|
+
// The chunk failed to load; nothing was requested, so every queued lookup can retry.
|
|
109
|
+
lookups.forEach(markFailed);
|
|
110
|
+
logException(error, {
|
|
111
|
+
location: LOG_LOCATION
|
|
112
|
+
});
|
|
113
|
+
}).catch(function (error) {
|
|
114
|
+
// Fetch errors are reported per batch; this only catches an unexpected throw while settling.
|
|
115
|
+
logException(error, {
|
|
116
|
+
location: LOG_LOCATION
|
|
117
|
+
});
|
|
118
|
+
});
|
|
119
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { useSyncExternalStore } from 'react';
|
|
2
|
+
import { appVendorCache } from './appVendorCache';
|
|
3
|
+
var subscribe = function subscribe(listener) {
|
|
4
|
+
appVendorCache.listeners.add(listener);
|
|
5
|
+
return function () {
|
|
6
|
+
appVendorCache.listeners.delete(listener);
|
|
7
|
+
};
|
|
8
|
+
};
|
|
9
|
+
var getServerSnapshot = function getServerSnapshot() {
|
|
10
|
+
return undefined;
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
/** Returns the partner name, `null` for unlisted apps, or `undefined` while unknown. */
|
|
14
|
+
export var useAppVendorName = function useAppVendorName(id) {
|
|
15
|
+
var getSnapshot = function getSnapshot() {
|
|
16
|
+
var entry = id ? appVendorCache.entries.get(id) : undefined;
|
|
17
|
+
return (entry === null || entry === void 0 ? void 0 : entry.status) === 'resolved' ? entry.name : undefined;
|
|
18
|
+
};
|
|
19
|
+
return useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot);
|
|
20
|
+
};
|
|
@@ -6,6 +6,7 @@ import { createQuickInsertMatcher } from '@atlaskit/editor-common/quick-insert/c
|
|
|
6
6
|
import { getQuickInsertMenuItemParents } from '@atlaskit/editor-common/quick-insert/get-menu-item-parents';
|
|
7
7
|
import { BLOCK_TEMPLATES_SECTION, DATA_AND_CHARTS_SECTION, EMBED_SECTION, MEDIA_SECTION, OTHER_SECTION, STRUCTURE_SECTION, TABS_MENU_ITEM } from '@atlaskit/editor-common/quick-insert/keys';
|
|
8
8
|
import { CREATE_SECTION_RANK, EXTENSION_ITEM_RANK, MEDIA_SECTION_RANK } from '@atlaskit/editor-common/quick-insert/rank';
|
|
9
|
+
import { prefetchAppVendors } from './app-vendor/prefetchAppVendors';
|
|
9
10
|
import { ExtensionQuickInsertMenuItem } from './ExtensionQuickInsertMenuItem';
|
|
10
11
|
import { QuickInsertSkillMenuItem } from './QuickInsertSkillMenuItem';
|
|
11
12
|
var structureExtensionItemKeyRanks = _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({
|
|
@@ -82,6 +83,10 @@ export var getExtensionQuickInsertComponents = function getExtensionQuickInsertC
|
|
|
82
83
|
editorActions = _ref4.editorActions,
|
|
83
84
|
items = _ref4.items;
|
|
84
85
|
var getExtensionItemRank = createExtensionItemRanker(items);
|
|
86
|
+
// Every row prefetches all items so the first row to mount fetches vendors in one batch.
|
|
87
|
+
var prefetchVendors = function prefetchVendors() {
|
|
88
|
+
return prefetchAppVendors(items);
|
|
89
|
+
};
|
|
85
90
|
return items.map(function (item, index) {
|
|
86
91
|
var structureRank = getStructureExtensionItemRank(item);
|
|
87
92
|
var isStructureItem = structureRank !== undefined;
|
|
@@ -116,13 +121,19 @@ export var getExtensionQuickInsertComponents = function getExtensionQuickInsertC
|
|
|
116
121
|
};
|
|
117
122
|
}),
|
|
118
123
|
component: function component(props) {
|
|
119
|
-
|
|
120
|
-
return /*#__PURE__*/React.createElement(Component, {
|
|
124
|
+
return item.extensionType === 'com.atlassian.rovo.skill' ? /*#__PURE__*/React.createElement(QuickInsertSkillMenuItem, {
|
|
121
125
|
apiRef: apiRef,
|
|
122
126
|
createAnalyticsEvent: createAnalyticsEvent,
|
|
123
127
|
editorActions: editorActions,
|
|
124
128
|
item: item,
|
|
125
129
|
onInsert: props.onInsert
|
|
130
|
+
}) : /*#__PURE__*/React.createElement(ExtensionQuickInsertMenuItem, {
|
|
131
|
+
apiRef: apiRef,
|
|
132
|
+
createAnalyticsEvent: createAnalyticsEvent,
|
|
133
|
+
editorActions: editorActions,
|
|
134
|
+
item: item,
|
|
135
|
+
onInsert: props.onInsert,
|
|
136
|
+
prefetchVendors: prefetchVendors
|
|
126
137
|
});
|
|
127
138
|
}
|
|
128
139
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { EditorNextProps } from '../types/editor-props';
|
|
3
|
-
export type ChromelessEditorProps = Pick<EditorNextProps, 'preset' | 'defaultValue' | 'assistiveLabel' | 'disabled' | 'shouldFocus' | 'quickInsert' | '
|
|
3
|
+
export type ChromelessEditorProps = Pick<EditorNextProps, 'preset' | 'defaultValue' | 'assistiveLabel' | 'disabled' | 'shouldFocus' | 'quickInsert' | 'secondaryToolbarComponents' | 'featureFlags' | 'onChange' | 'onDestroy' | 'onEditorReady' | 'onSave' | 'onCancel' | 'mentionProvider' | 'contextIdentifierProvider' | 'searchProvider' | 'extensionProviders' | 'popupsMountPoint' | 'popupsBoundariesElement' | 'popupsScrollableElement'>;
|
|
4
4
|
/**
|
|
5
5
|
* Editor component based on `ComposableEditor` which sets the `appearance` to "chromeless".
|
|
6
6
|
*
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { EditorNextProps } from '../types/editor-props';
|
|
3
|
-
export type CommentEditorProps = Pick<EditorNextProps, 'preset' | 'defaultValue' | 'assistiveLabel' | 'disabled' | 'shouldFocus' | 'quickInsert' | '
|
|
3
|
+
export type CommentEditorProps = Pick<EditorNextProps, 'preset' | 'defaultValue' | 'assistiveLabel' | 'disabled' | 'shouldFocus' | 'quickInsert' | 'secondaryToolbarComponents' | 'featureFlags' | 'onChange' | 'onDestroy' | 'onEditorReady' | 'onSave' | 'onCancel' | 'mentionProvider' | 'contextIdentifierProvider' | 'searchProvider' | 'extensionProviders'>;
|
|
4
4
|
/**
|
|
5
5
|
* Editor component based on `ComposableEditor` which sets the `appearance` to "comment".
|
|
6
6
|
*
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type EditorActions from '../actions';
|
|
3
3
|
import type { EditorNextProps } from '../types/editor-props';
|
|
4
|
-
export type FullPageEditorProps = Pick<EditorNextProps, 'preset' | 'defaultValue' | 'disabled' | 'mentionProvider' | '
|
|
4
|
+
export type FullPageEditorProps = Pick<EditorNextProps, 'preset' | 'defaultValue' | 'disabled' | 'mentionProvider' | 'contextIdentifierProvider' | 'searchProvider' | 'activityProvider' | 'annotationProviders' | 'collabEditProvider' | 'collabEdit' | 'contentMode' | 'taskDecisionProvider' | 'extensionProviders' | 'shouldFocus' | 'quickInsert' | 'secondaryToolbarComponents' | 'featureFlags' | 'primaryToolbarComponents' | 'contextPanel' | 'contentComponents' | 'primaryToolbarIconBefore' | 'sanitizePrivateContent' | '__livePage'> & {
|
|
5
5
|
appearance: 'full-page' | 'full-width' | 'max';
|
|
6
6
|
onChange?: () => void;
|
|
7
7
|
onEditorReady?: (editorActions: EditorActions) => void;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { EditorNextProps } from '../types/editor-props';
|
|
3
|
-
export type FullWidthEditorProps = Pick<EditorNextProps, 'preset' | 'defaultValue' | 'disabled' | 'mentionProvider' | '
|
|
3
|
+
export type FullWidthEditorProps = Pick<EditorNextProps, 'preset' | 'defaultValue' | 'disabled' | 'mentionProvider' | 'contextIdentifierProvider' | 'searchProvider' | 'annotationProviders' | 'collabEditProvider' | 'collabEdit' | 'taskDecisionProvider' | 'extensionProviders' | 'shouldFocus' | 'quickInsert' | 'secondaryToolbarComponents' | 'featureFlags' | 'primaryToolbarComponents' | 'contextPanel' | 'contentComponents' | 'primaryToolbarIconBefore' | 'sanitizePrivateContent'> & {
|
|
4
4
|
onChange?: () => void;
|
|
5
5
|
onEditorReady?: () => void;
|
|
6
6
|
};
|
|
@@ -15,7 +15,6 @@ import type { EmptyStateHandler } from '@atlaskit/editor-common/types/empty-stat
|
|
|
15
15
|
import type { FeedbackInfo } from '@atlaskit/editor-common/types/feedback-dialog';
|
|
16
16
|
import type { LinkingOptions } from '@atlaskit/editor-common/types/hyperlink';
|
|
17
17
|
import type { Transformer } from '@atlaskit/editor-common/types/next-editor-plugin';
|
|
18
|
-
import type { PerformanceTracking } from '@atlaskit/editor-common/types/performance-tracking';
|
|
19
18
|
import type { QuickInsertOptions } from '@atlaskit/editor-common/types/quick-insert';
|
|
20
19
|
import type { MenuItem } from '@atlaskit/editor-common/ui-menu/DropdownMenu/types';
|
|
21
20
|
import type { UseStickyToolbarType } from '@atlaskit/editor-common/ui-toolbar';
|
|
@@ -83,7 +82,7 @@ interface EditorBaseProps {
|
|
|
83
82
|
contentMode?: 'standard' | 'compact' | undefined;
|
|
84
83
|
contentTransformerProvider?: (schema: Schema) => Transformer<string>;
|
|
85
84
|
contextPanel?: ReactComponents;
|
|
86
|
-
defaultValue?: Node | string |
|
|
85
|
+
defaultValue?: Node | string | object;
|
|
87
86
|
disabled?: boolean;
|
|
88
87
|
editorActions?: EditorActions;
|
|
89
88
|
errorReporterHandler?: ErrorReportingHandler;
|
|
@@ -119,12 +118,6 @@ interface EditorBaseProps {
|
|
|
119
118
|
featureFlags?: {
|
|
120
119
|
[featureFlag: string]: string | boolean;
|
|
121
120
|
};
|
|
122
|
-
/**
|
|
123
|
-
* @deprecated do not use, value is hardcoded. Can be mocked for tests. Config exists here: platform/packages/editor/editor-plugin-base/src/pm-plugins/utils/inputTrackingConfig.ts
|
|
124
|
-
* @description The nth keystroke after which an input time taken event is sent, 0 to disable it
|
|
125
|
-
* @default 100
|
|
126
|
-
*/
|
|
127
|
-
inputSamplingLimit?: number;
|
|
128
121
|
isEditorModernisationEnabled?: boolean;
|
|
129
122
|
maxHeight?: number;
|
|
130
123
|
minHeight?: number;
|
|
@@ -189,11 +182,6 @@ export interface EditorSharedPropsWithPlugins {
|
|
|
189
182
|
allowUndoRedoButtons?: boolean;
|
|
190
183
|
collabEdit?: CollabEditOptions;
|
|
191
184
|
onSave?: (editorView: EditorView) => void;
|
|
192
|
-
/**
|
|
193
|
-
* @deprecated do not use, value is hardcoded. Can be mocked for tests. Config exists here: platform/packages/editor/editor-plugin-base/src/pm-plugins/utils/inputTrackingConfig.ts
|
|
194
|
-
* @description Control performance metric measurements and tracking
|
|
195
|
-
*/
|
|
196
|
-
performanceTracking?: PerformanceTracking;
|
|
197
185
|
primaryToolbarComponents?: PrimaryToolbarComponents;
|
|
198
186
|
sanitizePrivateContent?: boolean;
|
|
199
187
|
}
|
|
@@ -4,10 +4,12 @@ import type { MenuItem } from '@atlaskit/editor-common/extensions/types/utils';
|
|
|
4
4
|
import type { PublicPluginAPI } from '@atlaskit/editor-common/types/next-editor-plugin';
|
|
5
5
|
import type { ExtensionPlugin } from '@atlaskit/editor-plugin-extension/extensionPluginType';
|
|
6
6
|
import type EditorActions from '../../actions';
|
|
7
|
-
export declare const ExtensionQuickInsertMenuItem: ({ apiRef, createAnalyticsEvent, editorActions, item, onInsert, }: {
|
|
7
|
+
export declare const ExtensionQuickInsertMenuItem: ({ apiRef, createAnalyticsEvent, editorActions, item, onInsert, prefetchVendors, }: {
|
|
8
8
|
apiRef: React.MutableRefObject<PublicPluginAPI<[ExtensionPlugin]> | undefined>;
|
|
9
9
|
createAnalyticsEvent?: CreateUIAnalyticsEvent;
|
|
10
10
|
editorActions: EditorActions;
|
|
11
11
|
item: MenuItem;
|
|
12
12
|
onInsert?: () => void;
|
|
13
|
+
/** Starts fetching vendor names for every extension item in the menu. */
|
|
14
|
+
prefetchVendors?: () => void;
|
|
13
15
|
}) => React.JSX.Element;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export type AppVendorEntry = {
|
|
2
|
+
status: 'pending';
|
|
3
|
+
} | {
|
|
4
|
+
name: string | null;
|
|
5
|
+
status: 'resolved';
|
|
6
|
+
} | {
|
|
7
|
+
attempts: number;
|
|
8
|
+
status: 'failed';
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* Vendor names keyed by lookup id, plus the subscribers to notify when they change.
|
|
12
|
+
* Module scope so names survive editor and provider rebuilds for the rest of the page load.
|
|
13
|
+
*/
|
|
14
|
+
export declare const appVendorCache: {
|
|
15
|
+
entries: Map<string, AppVendorEntry>;
|
|
16
|
+
listeners: Set<() => void>;
|
|
17
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { AppVendorLookup } from './getAppVendorLookup';
|
|
2
|
+
/**
|
|
3
|
+
* Fetches Marketplace partner names for at most one batch of lookups.
|
|
4
|
+
* Resolves `null` for apps without a listed partner and omits lookups whose field errored, so they
|
|
5
|
+
* can be retried; rejects with `AppVendorRequestError` when the request itself fails, or with an
|
|
6
|
+
* `AbortError` when it takes longer than `REQUEST_TIMEOUT_MS`.
|
|
7
|
+
*/
|
|
8
|
+
export declare const fetchAppVendors: (lookups: AppVendorLookup[]) => Promise<Map<string, string | null>>;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { AppVendorLookup } from './getAppVendorLookup';
|
|
2
|
+
export type QueuedLookup = AppVendorLookup & {
|
|
3
|
+
attempts: number;
|
|
4
|
+
};
|
|
5
|
+
export type AppVendorBatchResult = {
|
|
6
|
+
names: Map<string, string | null>;
|
|
7
|
+
status: 'fulfilled';
|
|
8
|
+
} | {
|
|
9
|
+
error: unknown;
|
|
10
|
+
isBlocking: boolean;
|
|
11
|
+
status: 'rejected';
|
|
12
|
+
} | {
|
|
13
|
+
status: 'skipped';
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* Fetches lookups in batches, at most `MAX_CONCURRENT_BATCHES` at a time, reporting each batch as it
|
|
17
|
+
* settles. Batches that have not started when `shouldContinue` returns false are reported as skipped.
|
|
18
|
+
* Loaded on demand so editors without ecosystem apps never download the fetching code.
|
|
19
|
+
*/
|
|
20
|
+
export declare const fetchAppVendorsInBatches: (lookups: QueuedLookup[], { onBatch, shouldContinue, }: {
|
|
21
|
+
onBatch: (batch: QueuedLookup[], result: AppVendorBatchResult) => void;
|
|
22
|
+
shouldContinue: () => boolean;
|
|
23
|
+
}) => Promise<void>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { MenuItem } from '@atlaskit/editor-common/extensions/types/utils';
|
|
2
|
+
/** How to look up the Marketplace partner of the app that contributes an extension item. */
|
|
3
|
+
export type AppVendorLookup = {
|
|
4
|
+
/** Stable cache key shared by every item from the same app. */
|
|
5
|
+
id: string;
|
|
6
|
+
kind: 'forge' | 'connect';
|
|
7
|
+
/** Forge app ARI or Connect app key. */
|
|
8
|
+
value: string;
|
|
9
|
+
};
|
|
10
|
+
/** Returns a lookup only for ecosystem apps; Atlassian-owned items have no Marketplace partner. */
|
|
11
|
+
export declare const getAppVendorLookup: ({ app, extensionType, }: Pick<MenuItem, 'app' | 'extensionType'>) => AppVendorLookup | undefined;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { MenuItem } from '@atlaskit/editor-common/extensions/types/utils';
|
|
2
|
+
/**
|
|
3
|
+
* Starts fetching Marketplace partner names for every ecosystem app among `items`.
|
|
4
|
+
* Safe to call repeatedly: cached, in-flight, and exhausted lookups are skipped. The fetching code
|
|
5
|
+
* is loaded only once a lookup is queued.
|
|
6
|
+
*/
|
|
7
|
+
export declare const prefetchAppVendors: (items: Pick<MenuItem, 'app' | 'extensionType'>[]) => void;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-core",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "240.0.0",
|
|
4
4
|
"description": "A package contains Atlassian editor core functionality",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -42,12 +42,12 @@
|
|
|
42
42
|
"dependencies": {
|
|
43
43
|
"@atlaskit/activity-provider": "^3.1.0",
|
|
44
44
|
"@atlaskit/adf-schema": "^57.7.0",
|
|
45
|
-
"@atlaskit/afm-i18n-platform-editor-editor-core": "2.
|
|
45
|
+
"@atlaskit/afm-i18n-platform-editor-editor-core": "2.287.0",
|
|
46
46
|
"@atlaskit/analytics-namespaced-context": "^8.2.0",
|
|
47
47
|
"@atlaskit/analytics-next": "^12.6.0",
|
|
48
48
|
"@atlaskit/analytics-next-stable-react-context": "1.0.1",
|
|
49
49
|
"@atlaskit/browser-apis": "^1.2.0",
|
|
50
|
-
"@atlaskit/button": "^25.
|
|
50
|
+
"@atlaskit/button": "^25.6.0",
|
|
51
51
|
"@atlaskit/css": "^1.1.0",
|
|
52
52
|
"@atlaskit/editor-json-transformer": "^10.0.0",
|
|
53
53
|
"@atlaskit/editor-plugin-block-menu": "^28.0.0",
|
|
@@ -57,18 +57,18 @@
|
|
|
57
57
|
"@atlaskit/editor-plugin-user-preferences": "^27.0.0",
|
|
58
58
|
"@atlaskit/editor-plugins": "^16.2.0",
|
|
59
59
|
"@atlaskit/editor-prosemirror": "^9.0.0",
|
|
60
|
-
"@atlaskit/editor-shared-styles": "^4.
|
|
60
|
+
"@atlaskit/editor-shared-styles": "^4.6.0",
|
|
61
61
|
"@atlaskit/editor-ssr-renderer": "^24.0.0",
|
|
62
62
|
"@atlaskit/editor-toolbar": "^2.8.0",
|
|
63
63
|
"@atlaskit/editor-toolbar-model": "^1.2.0",
|
|
64
|
-
"@atlaskit/emoji": "^73.
|
|
64
|
+
"@atlaskit/emoji": "^73.1.0",
|
|
65
65
|
"@atlaskit/feature-gate-js-client": "^7.0.0",
|
|
66
66
|
"@atlaskit/heading": "^8.0.0",
|
|
67
67
|
"@atlaskit/icon": "^38.0.0",
|
|
68
68
|
"@atlaskit/icon-lab": "^7.11.0",
|
|
69
69
|
"@atlaskit/link": "^5.1.0",
|
|
70
70
|
"@atlaskit/media-card": "^82.1.0",
|
|
71
|
-
"@atlaskit/mention": "^30.
|
|
71
|
+
"@atlaskit/mention": "^30.4.0",
|
|
72
72
|
"@atlaskit/platform-feature-experiments": "^0.3.0",
|
|
73
73
|
"@atlaskit/platform-feature-flags": "^2.2.0",
|
|
74
74
|
"@atlaskit/platform-feature-flags-react": "^1.2.0",
|
|
@@ -76,9 +76,9 @@
|
|
|
76
76
|
"@atlaskit/primitives": "^22.6.0",
|
|
77
77
|
"@atlaskit/react-compiler-gating": "^0.2.0",
|
|
78
78
|
"@atlaskit/react-ufo": "^8.1.0",
|
|
79
|
-
"@atlaskit/task-decision": "^21.
|
|
80
|
-
"@atlaskit/tmp-editor-statsig": "^
|
|
81
|
-
"@atlaskit/tokens": "^20.
|
|
79
|
+
"@atlaskit/task-decision": "^21.13.0",
|
|
80
|
+
"@atlaskit/tmp-editor-statsig": "^245.0.0",
|
|
81
|
+
"@atlaskit/tokens": "^20.7.0",
|
|
82
82
|
"@atlaskit/tooltip": "^24.4.0",
|
|
83
83
|
"@atlaskit/width-detector": "^7.2.0",
|
|
84
84
|
"@babel/runtime": "^7.0.0",
|
|
@@ -96,7 +96,7 @@
|
|
|
96
96
|
"uuid": "^11.1.1"
|
|
97
97
|
},
|
|
98
98
|
"peerDependencies": {
|
|
99
|
-
"@atlaskit/editor-common": "^133.
|
|
99
|
+
"@atlaskit/editor-common": "^133.5.0",
|
|
100
100
|
"@atlaskit/link-provider": "^6.0.0",
|
|
101
101
|
"@atlaskit/media-core": "^39.0.0",
|
|
102
102
|
"react": "^18.2.0 || ^19.2.0",
|
|
@@ -119,7 +119,7 @@
|
|
|
119
119
|
"@atlaskit/editor-plugin-alignment": "^30.0.0",
|
|
120
120
|
"@atlaskit/editor-plugin-annotation": "^29.0.0",
|
|
121
121
|
"@atlaskit/editor-plugin-base": "^30.0.0",
|
|
122
|
-
"@atlaskit/editor-plugin-card": "^35.
|
|
122
|
+
"@atlaskit/editor-plugin-card": "^35.1.0",
|
|
123
123
|
"@atlaskit/editor-plugin-code-block-advanced": "^29.0.0",
|
|
124
124
|
"@atlaskit/editor-plugin-collab-edit": "^30.0.0",
|
|
125
125
|
"@atlaskit/editor-plugin-content-insertion": "^29.0.0",
|
|
@@ -137,7 +137,7 @@
|
|
|
137
137
|
"@atlaskit/editor-plugin-media-insert": "^47.0.0",
|
|
138
138
|
"@atlaskit/editor-plugin-paste": "^30.0.0",
|
|
139
139
|
"@atlaskit/editor-plugin-selection-marker": "^29.0.0",
|
|
140
|
-
"@atlaskit/editor-plugin-show-diff": "^27.
|
|
140
|
+
"@atlaskit/editor-plugin-show-diff": "^27.1.0",
|
|
141
141
|
"@atlaskit/editor-plugin-synced-block": "^27.0.0",
|
|
142
142
|
"@atlaskit/editor-plugin-table": "^41.0.0",
|
|
143
143
|
"@atlaskit/editor-plugin-tasks-and-decisions": "^32.0.0",
|
|
@@ -158,14 +158,14 @@
|
|
|
158
158
|
"@atlaskit/media-integration-test-helpers": "workspace:^",
|
|
159
159
|
"@atlaskit/media-picker": "^73.2.0",
|
|
160
160
|
"@atlaskit/media-test-helpers": "^43.0.0",
|
|
161
|
-
"@atlaskit/media-ui": "^31.
|
|
161
|
+
"@atlaskit/media-ui": "^31.5.0",
|
|
162
162
|
"@atlaskit/modal-dialog": "^17.1.0",
|
|
163
163
|
"@atlaskit/navigation-system": "^11.3.0",
|
|
164
164
|
"@atlaskit/popper": "^9.4.0",
|
|
165
165
|
"@atlaskit/portal": "^7.0.0",
|
|
166
166
|
"@atlaskit/profilecard": "^27.3.0",
|
|
167
167
|
"@atlaskit/radio": "^10.2.0",
|
|
168
|
-
"@atlaskit/renderer": "^152.
|
|
168
|
+
"@atlaskit/renderer": "^152.2.0",
|
|
169
169
|
"@atlaskit/section-message": "^10.2.0",
|
|
170
170
|
"@atlaskit/spinner": "^20.4.0",
|
|
171
171
|
"@atlaskit/synchrony-test-helpers": "workspace:^",
|