@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,109 @@
|
|
|
1
|
+
import { logException } from '@atlaskit/editor-common/monitoring/error';
|
|
2
|
+
import { appVendorCache } from './appVendorCache';
|
|
3
|
+
import { getAppVendorLookup } from './getAppVendorLookup';
|
|
4
|
+
|
|
5
|
+
/** Failed lookups are retried on later menu opens, up to this many attempts per page load. */
|
|
6
|
+
const MAX_ATTEMPTS = 3;
|
|
7
|
+
const LOG_LOCATION = 'editor-core/quick-insert/prefetchAppVendors';
|
|
8
|
+
const {
|
|
9
|
+
entries,
|
|
10
|
+
listeners
|
|
11
|
+
} = appVendorCache;
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Set once any batch fails with 401, 403, or 429. Those mean the session cannot read Marketplace
|
|
15
|
+
* data or the gateway is throttling, which applies to every editor on the page, so all further
|
|
16
|
+
* lookups stop until the page reloads.
|
|
17
|
+
*/
|
|
18
|
+
let isBlocked = false;
|
|
19
|
+
const shouldFetch = entry => !entry || entry.status === 'failed' && entry.attempts < MAX_ATTEMPTS;
|
|
20
|
+
const getAttempts = entry => (entry === null || entry === void 0 ? void 0 : entry.status) === 'failed' ? entry.attempts : 0;
|
|
21
|
+
|
|
22
|
+
// A throwing subscriber must not stop the others or abort the batch that is being settled.
|
|
23
|
+
const notify = () => listeners.forEach(listener => {
|
|
24
|
+
try {
|
|
25
|
+
listener();
|
|
26
|
+
} catch (error) {
|
|
27
|
+
logException(error, {
|
|
28
|
+
location: LOG_LOCATION
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
const markFailed = ({
|
|
33
|
+
attempts,
|
|
34
|
+
id
|
|
35
|
+
}) => entries.set(id, {
|
|
36
|
+
attempts,
|
|
37
|
+
status: 'failed'
|
|
38
|
+
});
|
|
39
|
+
const settleBatch = (batch, result) => {
|
|
40
|
+
if (result.status !== 'fulfilled') {
|
|
41
|
+
if (result.status === 'rejected') {
|
|
42
|
+
isBlocked ||= result.isBlocking;
|
|
43
|
+
logException(result.error, {
|
|
44
|
+
location: LOG_LOCATION
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
batch.forEach(markFailed);
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
// Lookups missing from the result errored individually and stay retryable.
|
|
52
|
+
batch.forEach(lookup => {
|
|
53
|
+
const name = result.names.get(lookup.id);
|
|
54
|
+
if (name === undefined) {
|
|
55
|
+
markFailed(lookup);
|
|
56
|
+
} else {
|
|
57
|
+
entries.set(lookup.id, {
|
|
58
|
+
name,
|
|
59
|
+
status: 'resolved'
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
});
|
|
63
|
+
notify();
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* Starts fetching Marketplace partner names for every ecosystem app among `items`.
|
|
68
|
+
* Safe to call repeatedly: cached, in-flight, and exhausted lookups are skipped. The fetching code
|
|
69
|
+
* is loaded only once a lookup is queued.
|
|
70
|
+
*/
|
|
71
|
+
export const prefetchAppVendors = items => {
|
|
72
|
+
if (isBlocked) {
|
|
73
|
+
return;
|
|
74
|
+
}
|
|
75
|
+
const lookups = [];
|
|
76
|
+
items.forEach(item => {
|
|
77
|
+
const lookup = getAppVendorLookup(item);
|
|
78
|
+
const entry = lookup && entries.get(lookup.id);
|
|
79
|
+
if (lookup && shouldFetch(entry)) {
|
|
80
|
+
lookups.push({
|
|
81
|
+
...lookup,
|
|
82
|
+
attempts: getAttempts(entry) + 1
|
|
83
|
+
});
|
|
84
|
+
entries.set(lookup.id, {
|
|
85
|
+
status: 'pending'
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
});
|
|
89
|
+
if (lookups.length === 0) {
|
|
90
|
+
return;
|
|
91
|
+
}
|
|
92
|
+
void import( /* webpackChunkName: "@atlaskit-internal_editor-core-quick-insert-app-vendor" */'./fetchAppVendorsInBatches').then(({
|
|
93
|
+
fetchAppVendorsInBatches
|
|
94
|
+
}) => fetchAppVendorsInBatches(lookups, {
|
|
95
|
+
onBatch: settleBatch,
|
|
96
|
+
shouldContinue: () => !isBlocked
|
|
97
|
+
}), error => {
|
|
98
|
+
// The chunk failed to load; nothing was requested, so every queued lookup can retry.
|
|
99
|
+
lookups.forEach(markFailed);
|
|
100
|
+
logException(error, {
|
|
101
|
+
location: LOG_LOCATION
|
|
102
|
+
});
|
|
103
|
+
}).catch(error => {
|
|
104
|
+
// Fetch errors are reported per batch; this only catches an unexpected throw while settling.
|
|
105
|
+
logException(error, {
|
|
106
|
+
location: LOG_LOCATION
|
|
107
|
+
});
|
|
108
|
+
});
|
|
109
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { useSyncExternalStore } from 'react';
|
|
2
|
+
import { appVendorCache } from './appVendorCache';
|
|
3
|
+
const subscribe = listener => {
|
|
4
|
+
appVendorCache.listeners.add(listener);
|
|
5
|
+
return () => {
|
|
6
|
+
appVendorCache.listeners.delete(listener);
|
|
7
|
+
};
|
|
8
|
+
};
|
|
9
|
+
const getServerSnapshot = () => undefined;
|
|
10
|
+
|
|
11
|
+
/** Returns the partner name, `null` for unlisted apps, or `undefined` while unknown. */
|
|
12
|
+
export const useAppVendorName = id => {
|
|
13
|
+
const getSnapshot = () => {
|
|
14
|
+
const entry = id ? appVendorCache.entries.get(id) : undefined;
|
|
15
|
+
return (entry === null || entry === void 0 ? void 0 : entry.status) === 'resolved' ? entry.name : undefined;
|
|
16
|
+
};
|
|
17
|
+
return useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot);
|
|
18
|
+
};
|
|
@@ -3,6 +3,7 @@ import { createQuickInsertMatcher } from '@atlaskit/editor-common/quick-insert/c
|
|
|
3
3
|
import { getQuickInsertMenuItemParents } from '@atlaskit/editor-common/quick-insert/get-menu-item-parents';
|
|
4
4
|
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';
|
|
5
5
|
import { CREATE_SECTION_RANK, EXTENSION_ITEM_RANK, MEDIA_SECTION_RANK } from '@atlaskit/editor-common/quick-insert/rank';
|
|
6
|
+
import { prefetchAppVendors } from './app-vendor/prefetchAppVendors';
|
|
6
7
|
import { ExtensionQuickInsertMenuItem } from './ExtensionQuickInsertMenuItem';
|
|
7
8
|
import { QuickInsertSkillMenuItem } from './QuickInsertSkillMenuItem';
|
|
8
9
|
const structureExtensionItemKeyRanks = {
|
|
@@ -59,6 +60,8 @@ export const getExtensionQuickInsertComponents = ({
|
|
|
59
60
|
items
|
|
60
61
|
}) => {
|
|
61
62
|
const getExtensionItemRank = createExtensionItemRanker(items);
|
|
63
|
+
// Every row prefetches all items so the first row to mount fetches vendors in one batch.
|
|
64
|
+
const prefetchVendors = () => prefetchAppVendors(items);
|
|
62
65
|
return items.map((item, index) => {
|
|
63
66
|
const structureRank = getStructureExtensionItemRank(item);
|
|
64
67
|
const isStructureItem = structureRank !== undefined;
|
|
@@ -90,16 +93,20 @@ export const getExtensionQuickInsertComponents = ({
|
|
|
90
93
|
keywords: item.keywords,
|
|
91
94
|
title: item.title
|
|
92
95
|
})),
|
|
93
|
-
component: props => {
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
96
|
+
component: props => item.extensionType === 'com.atlassian.rovo.skill' ? /*#__PURE__*/React.createElement(QuickInsertSkillMenuItem, {
|
|
97
|
+
apiRef: apiRef,
|
|
98
|
+
createAnalyticsEvent: createAnalyticsEvent,
|
|
99
|
+
editorActions: editorActions,
|
|
100
|
+
item: item,
|
|
101
|
+
onInsert: props.onInsert
|
|
102
|
+
}) : /*#__PURE__*/React.createElement(ExtensionQuickInsertMenuItem, {
|
|
103
|
+
apiRef: apiRef,
|
|
104
|
+
createAnalyticsEvent: createAnalyticsEvent,
|
|
105
|
+
editorActions: editorActions,
|
|
106
|
+
item: item,
|
|
107
|
+
onInsert: props.onInsert,
|
|
108
|
+
prefetchVendors: prefetchVendors
|
|
109
|
+
})
|
|
103
110
|
};
|
|
104
111
|
});
|
|
105
112
|
};
|
|
@@ -44,8 +44,6 @@ export var useMemoEditorProps = function useMemoEditorProps(passedProps) {
|
|
|
44
44
|
media: passedProps.media,
|
|
45
45
|
collabEdit: passedProps.collabEdit,
|
|
46
46
|
primaryToolbarComponents: passedProps.primaryToolbarComponents,
|
|
47
|
-
performanceTracking: passedProps.performanceTracking,
|
|
48
|
-
inputSamplingLimit: passedProps.inputSamplingLimit,
|
|
49
47
|
allowUndoRedoButtons: passedProps.allowUndoRedoButtons,
|
|
50
48
|
linking: passedProps.linking,
|
|
51
49
|
activityProvider: passedProps.activityProvider,
|
|
@@ -114,7 +112,7 @@ export var useMemoEditorProps = function useMemoEditorProps(passedProps) {
|
|
|
114
112
|
};
|
|
115
113
|
var nextProps = _objectSpread(_objectSpread({}, defaultProps), allProps);
|
|
116
114
|
return nextProps;
|
|
117
|
-
}, [passedProps.preset, passedProps.appearance, passedProps.contentMode, passedProps.contentComponents, passedProps.primaryToolbarIconBefore, passedProps.secondaryToolbarComponents, passedProps.persistScrollGutter, passedProps.quickInsert, passedProps.shouldFocus, passedProps.disabled, passedProps.contextPanel, passedProps.errorReporterHandler, passedProps.contentTransformerProvider, passedProps.maxHeight, passedProps.minHeight, passedProps.placeholder, passedProps.placeholderBracketHint, passedProps.
|
|
115
|
+
}, [passedProps.preset, passedProps.appearance, passedProps.contentMode, passedProps.contentComponents, passedProps.primaryToolbarIconBefore, passedProps.secondaryToolbarComponents, passedProps.persistScrollGutter, passedProps.quickInsert, passedProps.shouldFocus, passedProps.disabled, passedProps.contextPanel, passedProps.errorReporterHandler, passedProps.contentTransformerProvider, passedProps.maxHeight, passedProps.minHeight, passedProps.placeholder, passedProps.placeholderBracketHint, passedProps.defaultValue, passedProps.assistiveLabel, passedProps.assistiveDescribedBy, passedProps.popupsMountPoint, passedProps.popupsBoundariesElement, passedProps.popupsScrollableElement, passedProps.editorActions, passedProps.onEditorReady, passedProps.onDestroy, passedProps.onChange, passedProps.onCancel, passedProps.onSSRMeasure, passedProps.extensionProviders, passedProps.UNSAFE_useAnalyticsContext, passedProps.useStickyToolbar, passedProps.isEditorModernisationEnabled, passedProps.featureFlags, passedProps.onSave, passedProps.sanitizePrivateContent, passedProps.media, passedProps.collabEdit, passedProps.primaryToolbarComponents, passedProps.allowUndoRedoButtons, passedProps.linking, passedProps.activityProvider, passedProps.searchProvider, passedProps.annotationProviders, passedProps.collabEditProvider, passedProps.presenceProvider, passedProps.emojiProvider, passedProps.taskDecisionProvider, passedProps.legacyImageUploadProvider, passedProps.mentionProvider, passedProps.autoformattingProvider, passedProps.macroProvider, passedProps.contextIdentifierProvider, passedProps.allowExpand, passedProps.allowNestedTasks, passedProps.allowBlockType, passedProps.allowTasksAndDecisions, passedProps.allowBreakout, passedProps.allowRule, passedProps.allowHelpDialog, passedProps.allowPanel, passedProps.allowExtension, passedProps.allowConfluenceInlineComment, passedProps.allowTemplatePlaceholders, passedProps.allowDate, passedProps.allowLayouts, passedProps.allowStatus, passedProps.allowTextAlignment, passedProps.allowIndentation, passedProps.showIndentationButtons, passedProps.allowFindReplace, passedProps.allowBorderMark, passedProps.allowFragmentMark, passedProps.autoScrollIntoView, passedProps.elementBrowser, passedProps.maxContentSize, passedProps.saveOnEnter, passedProps.feedbackInfo, passedProps.mention, passedProps.mentionInsertDisplayName, passedProps.uploadErrorHandler, passedProps.waitForMediaUpload, passedProps.extensionHandlers, passedProps.allowTextColor, passedProps.allowTables, passedProps.insertMenuItems, passedProps.UNSAFE_cards, passedProps.smartLinks, passedProps.allowAnalyticsGASV3, passedProps.codeBlock, passedProps.textFormatting, passedProps.__livePage, passedProps.AppearanceComponent, passedProps.skipValidation, passedProps.syncBlock, passedProps.syncedBlockProvider, passedProps.pasteWarningOptions, passedProps.UNSAFE_containLayout]);
|
|
118
116
|
return memodProps;
|
|
119
117
|
};
|
|
120
118
|
|
|
@@ -53,7 +53,7 @@ var compiledStyles = {
|
|
|
53
53
|
export var CONTENT_AREA_TEST_ID = 'ak-editor-fp-content-area';
|
|
54
54
|
var EDITOR_CONTAINER = 'ak-editor-container';
|
|
55
55
|
var Content = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
56
|
-
var _props$editorAPI, _props$editorAPI$bloc, _props$editorAPI2, _contentAreaRef$curre, _allowScrollGutter$gu
|
|
56
|
+
var _props$editorAPI, _props$editorAPI$bloc, _props$editorAPI2, _contentAreaRef$curre, _allowScrollGutter$gu;
|
|
57
57
|
var fullWidthMode = props.appearance === 'full-width';
|
|
58
58
|
var maxWidthMode = props.appearance === 'max';
|
|
59
59
|
var scrollContainerRef = useRef(null);
|
|
@@ -131,20 +131,14 @@ var Content = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
131
131
|
containerElement: scrollContainerRef.current,
|
|
132
132
|
dispatchAnalyticsEvent: props.dispatchAnalyticsEvent,
|
|
133
133
|
wrapperElement: props.wrapperElement
|
|
134
|
-
}), props.editorDOMElement, !!props.customContentComponents && 'after' in props.customContentComponents ? contentComponentClickWrapper(props.customContentComponents.after) : null, allowScrollGutter &&
|
|
134
|
+
}), props.editorDOMElement, !!props.customContentComponents && 'after' in props.customContentComponents ? contentComponentClickWrapper(props.customContentComponents.after) : null, allowScrollGutter && /*#__PURE__*/React.createElement("div", {
|
|
135
135
|
id: "editor-scroll-gutter",
|
|
136
136
|
style: {
|
|
137
137
|
paddingBottom: "".concat((_allowScrollGutter$gu = allowScrollGutter.gutterSize) !== null && _allowScrollGutter$gu !== void 0 ? _allowScrollGutter$gu : '120', "px")
|
|
138
138
|
},
|
|
139
139
|
"data-vc": "scroll-gutter",
|
|
140
140
|
"data-editor-scroll-gutter": "true"
|
|
141
|
-
})
|
|
142
|
-
id: "editor-scroll-gutter",
|
|
143
|
-
style: {
|
|
144
|
-
paddingBottom: "".concat((_allowScrollGutter$gu2 = allowScrollGutter.gutterSize) !== null && _allowScrollGutter$gu2 !== void 0 ? _allowScrollGutter$gu2 : '120', "px")
|
|
145
|
-
},
|
|
146
|
-
"data-vc": "scroll-gutter"
|
|
147
|
-
}))))));
|
|
141
|
+
})))));
|
|
148
142
|
return /*#__PURE__*/React.createElement("div", {
|
|
149
143
|
"data-testid": CONTENT_AREA_TEST_ID,
|
|
150
144
|
ref: containerRef,
|
|
@@ -182,6 +182,7 @@
|
|
|
182
182
|
.cc-eie91o .show-diff-deleted-inline-node[data-prosemirror-node-name=status]{position:relative}.cc-eie91o .show-diff-deleted-inline-node[data-prosemirror-node-name=status]:after{content:"";position:absolute;top:50%;inset-inline-start:0;inset-inline-end:0;border-top:var(--show-diff-deleted-inline-node-strike,var(--ds-border-width,1px) solid var(--ds-text-subtlest,#6b6e76));pointer-events:none}.cc-eie91o .show-diff-deleted-inline-node[data-prosemirror-node-name=emoji]{position:relative}.cc-eie91o .show-diff-deleted-inline-node[data-prosemirror-node-name=emoji]:after{content:"";position:absolute;top:50%;inset-inline-start:0;inset-inline-end:0;border-top:var(--show-diff-deleted-inline-node-strike,var(--ds-border-width,1px) solid var(--ds-text-subtlest,#6b6e76));pointer-events:none}
|
|
183
183
|
.cc-3nf4b .show-diff-atomic-inline-changed-date{outline-color:currentColor;outline-style:none;outline-width:medium}.cc-3nf4b .show-diff-atomic-inline-changed-date .date-lozenger-container>span{box-shadow:0 0 0 2px var(--show-diff-atomic-inline-changed-border-color,var(--ds-border-accent-purple,#af59e1))}.cc-3nf4b .show-diff-atomic-inline-changed-emoji :is(.emoji-common-emoji-sprite,.emoji-common-emoji-image,.emoji-common-emoji-unicode){outline-color:currentColor;outline-style:none;outline-width:medium;box-shadow:0 0 0 2px var(--show-diff-atomic-inline-changed-border-color,var(--ds-border-accent-purple,#af59e1))}
|
|
184
184
|
.cc-1szti83 [data-prosemirror-node-name=status] .lozenge-wrapper{padding-block-start:var(--ds-space-025,2px);padding-block-end:var(--ds-space-025,2px);padding-inline-start:var(--ds-space-050,4px);padding-inline-end:var(--ds-space-050,4px);align-items:center;border-radius:var(--ds-radius-small,4px);height:1.25rem;border:solid var(--ds-border-width,1px) transparent}.cc-1szti83 [data-prosemirror-node-name=status] .lozenge-text{text-transform:none;font:var(--ds-font-body-small,normal 400 9pt/1pc "Atlassian Sans",ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",Ubuntu,"Helvetica Neue",sans-serif)}.cc-1szti83 [data-prosemirror-node-name=status]>[data-color=neutral]>.lozenge-wrapper{background-color:var(--ds-background-neutral,#0515240f);border-color:var(--ds-border,#0b120e24)}.cc-1szti83 [data-prosemirror-node-name=status]>[data-color=neutral] .lozenge-text{color:var(--ds-text,#292a2e)}.cc-1szti83 .statusView-content-wrap:not(.search-match-block).ak-editor-selected-node .status-lozenge-span>span{box-shadow:0 0 0 2px var(--ds-border-selected,#1868db)}.cc-1szti83 .danger .statusView-content-wrap:not(.search-match-block).ak-editor-selected-node .status-lozenge-span>span{box-shadow:0 0 0 2px var(--ds-border-danger,#e2483d)}
|
|
185
|
+
.cc-1wyoddi [data-prosemirror-node-name=status] .lozenge-text{text-box:trim-both cap alphabetic;overflow-x:clip;overflow-y:visible}
|
|
185
186
|
.cc-ba6gav [data-prosemirror-node-name=status]>[data-color=purple]>.lozenge-wrapper{background-color:var(--ds-background-discovery-subtler,#eed7fc);border-color:var(--ds-border-discovery-subtle,#d8a0f7)}.cc-ba6gav [data-prosemirror-node-name=status]>[data-color=purple] .lozenge-text{color:var(--ds-text-discovery-bolder,#48245d)}.cc-ba6gav [data-prosemirror-node-name=status]>[data-color=blue]>.lozenge-wrapper{background-color:var(--ds-background-information-subtler,#cfe1fd);border-color:var(--ds-border-information-subtle,#8fb8f6)}.cc-ba6gav [data-prosemirror-node-name=status]>[data-color=blue] .lozenge-text{color:var(--ds-text-information-bolder,#123263)}.cc-ba6gav [data-prosemirror-node-name=status]>[data-color=red]>.lozenge-wrapper{background-color:var(--ds-background-danger-subtler,#ffd5d2);border-color:var(--ds-border-danger-subtle,#fd9891)}.cc-ba6gav [data-prosemirror-node-name=status]>[data-color=red] .lozenge-text{color:var(--ds-text-danger-bolder,#5d1f1a)}.cc-ba6gav [data-prosemirror-node-name=status]>[data-color=yellow]>.lozenge-wrapper{background-color:var(--ds-background-warning-subtler,#fce4a6);border-color:var(--ds-border-warning-subtle,#fbc828)}.cc-ba6gav [data-prosemirror-node-name=status]>[data-color=yellow] .lozenge-text{color:var(--ds-text-warning-bolder,#693200)}.cc-ba6gav [data-prosemirror-node-name=status]>[data-color=green]>.lozenge-wrapper{background-color:var(--ds-background-success-subtler,#d3f1a7);border-color:var(--ds-border-success-subtle,#b3df72)}.cc-ba6gav [data-prosemirror-node-name=status]>[data-color=green] .lozenge-text{color:var(--ds-text-success-bolder,#37471f)}
|
|
186
187
|
.cc-1gvo00o [data-prosemirror-node-name=status]>[data-color=blue]>.lozenge-wrapper{background-color:var(--ds-background-accent-blue-subtler,#cfe1fd);border-color:var(--ds-border-accent-blue-subtle,#8fb8f6)}.cc-1gvo00o [data-prosemirror-node-name=status]>[data-color=blue] .lozenge-text{color:var(--ds-text-accent-blue-bolder,#123263)}.cc-1gvo00o [data-prosemirror-node-name=status]>[data-color=purple]>.lozenge-wrapper{background-color:var(--ds-background-accent-purple-subtler,#eed7fc);border-color:var(--ds-border-accent-purple-subtle,#d8a0f7)}.cc-1gvo00o [data-prosemirror-node-name=status]>[data-color=purple] .lozenge-text{color:var(--ds-text-accent-purple-bolder,#48245d)}.cc-1gvo00o [data-prosemirror-node-name=status]>[data-color=red]>.lozenge-wrapper{background-color:var(--ds-background-accent-red-subtler,#ffd5d2);border-color:var(--ds-border-accent-red-subtle,#fd9891)}.cc-1gvo00o [data-prosemirror-node-name=status]>[data-color=red] .lozenge-text{color:var(--ds-text-accent-red-bolder,#5d1f1a)}.cc-1gvo00o [data-prosemirror-node-name=status]>[data-color=yellow]>.lozenge-wrapper{background-color:var(--ds-background-accent-orange-subtler,#fce4a6);border-color:var(--ds-border-accent-orange-subtle,#fbc828)}.cc-1gvo00o [data-prosemirror-node-name=status]>[data-color=yellow] .lozenge-text{color:var(--ds-text-accent-orange-bolder,#693200)}.cc-1gvo00o [data-prosemirror-node-name=status]>[data-color=green]>.lozenge-wrapper{background-color:var(--ds-background-accent-lime-subtler,#d3f1a7);border-color:var(--ds-border-accent-lime-subtle,#b3df72)}.cc-1gvo00o [data-prosemirror-node-name=status]>[data-color=green] .lozenge-text{color:var(--ds-text-accent-lime-bolder,#37471f)}
|
|
187
188
|
.cc-1ky6mbc [data-prosemirror-node-name=status]>[data-color="#B3F5FF"]>.lozenge-wrapper{background-color:var(--ds-background-accent-teal-subtler,#c6edfb);border-color:var(--ds-border-accent-teal-subtle,#9dd9ee)}.cc-1ky6mbc [data-prosemirror-node-name=status]>[data-color="#B3F5FF"] .lozenge-text{color:var(--ds-text-accent-teal-bolder,#164555)}.cc-1ky6mbc [data-prosemirror-node-name=status]>[data-color="#ABF5D1"]>.lozenge-wrapper{background-color:var(--ds-background-accent-green-subtler,#baf3db);border-color:var(--ds-border-accent-green-subtle,#7ee2b8)}.cc-1ky6mbc [data-prosemirror-node-name=status]>[data-color="#ABF5D1"] .lozenge-text{color:var(--ds-text-accent-green-bolder,#164b35)}.cc-1ky6mbc [data-prosemirror-node-name=status]>[data-color="#D3F1A7"]>.lozenge-wrapper{background-color:var(--ds-background-accent-lime-subtler,#d3f1a7);border-color:var(--ds-border-accent-lime-subtle,#b3df72)}.cc-1ky6mbc [data-prosemirror-node-name=status]>[data-color="#D3F1A7"] .lozenge-text{color:var(--ds-text-accent-lime-bolder,#37471f)}.cc-1ky6mbc [data-prosemirror-node-name=status]>[data-color="#FFF0B3"]>.lozenge-wrapper{background-color:var(--ds-background-accent-yellow-subtler,#f5e989);border-color:var(--ds-border-accent-yellow-subtle,#eed12b)}.cc-1ky6mbc [data-prosemirror-node-name=status]>[data-color="#FFF0B3"] .lozenge-text{color:var(--ds-text-accent-yellow-bolder,#533f04)}.cc-1ky6mbc [data-prosemirror-node-name=status]>[data-color="#FCE4A6"]>.lozenge-wrapper{background-color:var(--ds-background-accent-orange-subtler,#fce4a6);border-color:var(--ds-border-accent-orange-subtle,#fbc828)}.cc-1ky6mbc [data-prosemirror-node-name=status]>[data-color="#FCE4A6"] .lozenge-text{color:var(--ds-text-accent-orange-bolder,#693200)}.cc-1ky6mbc [data-prosemirror-node-name=status]>[data-color="#FDD0EC"]>.lozenge-wrapper{background-color:var(--ds-background-accent-magenta-subtler,#fdd0ec);border-color:var(--ds-border-accent-magenta-subtle,#f797d2)}.cc-1ky6mbc [data-prosemirror-node-name=status]>[data-color="#FDD0EC"] .lozenge-text{color:var(--ds-text-accent-magenta-bolder,#50253f)}
|
|
@@ -330,6 +330,7 @@ var editorContentStyles = {
|
|
|
330
330
|
deletedStatusStrikeStyles: "cc-eie91o",
|
|
331
331
|
atomicInlineChangedBoxShadowStyles: "cc-3nf4b",
|
|
332
332
|
statusStylesTeam26: "cc-1szti83",
|
|
333
|
+
statusStylesTeam26TextTrim: "cc-1wyoddi",
|
|
333
334
|
statusStylesNamedSemantic: "cc-ba6gav",
|
|
334
335
|
statusStylesNamedAccent: "cc-1gvo00o",
|
|
335
336
|
statusStylesHexAccent: "cc-1ky6mbc",
|
|
@@ -400,7 +401,7 @@ export var EditorContentContainerCompiled = /*#__PURE__*/React.forwardRef(functi
|
|
|
400
401
|
className: ax([editorContentStyles.baseStyles, editorContentStyles.maxModeReizeFixStyles, editorContentStyles.baseStylesMaxContainerWidthFixes, editorContentStyles.editorGutterPaddingBaseStyles, editorExperiment('platform_editor_preview_panel_responsiveness', true, {
|
|
401
402
|
exposure: true
|
|
402
403
|
}) && editorContentStyles.editorLargeGutterPuddingReducedBaseStyles, editorContentStyles.whitespaceStyles, editorContentStyles.indentationStyles, editorContentStyles.fontSizeStyles, editorContentStyles.shadowStyles, isExperimentEnabled('platform_editor_reduce_forced_layout_2') && editorContentStyles.extensionScrollInlineShadowStyles, editorContentStyles.InlineNodeViewSharedStyles, editorContentStyles.hideSelectionStyles, editorContentStyles.hideCursorWhenHideSelectionStyles, editorContentStyles.selectedNodeStyles, editorContentStyles.cursorStyles, editorContentStyles.firstFloatingToolbarButtonStyles, editorContentStyles.placeholderTextStyles, editorContentStyles.placeholderStyles, editorExperiment('platform_editor_controls', 'variant1') && editorContentStyles.placeholderOverflowStyles, editorContentStyles.codeBlockStyles, contentMode === 'compact' && editorContentStyles.codeBlockStylesWithEmUnits, editorContentStyles.editorUGCTokensRefreshed, editorContentStyles.editorUGCSmallText, editorContentStyles.blocktypeStyles, editorContentStyles.blocktypeStylesRtlBlockquote, isFloatingTocEnabled && editorContentStyles.headingScrollMarginStyles, editorContentStyles.blockquoteSelectedNodeStyles, isSelectionHighlightInheritanceActive ? editorContentStyles.listSelectedNodeStylesWithHighlightInheritance : editorContentStyles.listSelectedNodeStyles, isSelectionHighlightInheritanceActive ? editorContentStyles.textSelectedNodeStylesWithHighlightInheritance : editorContentStyles.textSelectedNodeStyles, editorContentStyles.blocktypeStyles_fg_platform_editor_typography_ugc, editorContentStyles.blocktypeStylesNestedDnd, editorContentStyles.codeMarkStyles, editorContentStyles.textColorStyles, editorContentStyles.backgroundColorStyles, !expValEquals('platform_editor_lovability_text_bg_color', 'isEnabled', true) && editorContentStyles.highlightLinksUnsetStyles, editorContentStyles.textHighlightPaddingStyles, editorContentStyles.listsStyles, editorContentStyles.listItemHiddenMarkerStyles, editorContentStyles.diffListStyles, contentMode === 'compact' && isDense && editorContentStyles.listsDenseStyles, isFullPage && editorContentStyles.listsStylesMarginLayoutShiftFix, editorContentStyles.ruleStyles, isExperimentEnabled('platform_editor_lovability_dividers_attributes') && editorContentStyles.ruleWithAttrsStyles, isExperimentEnabled('platform_editor_numbered_headings') && editorContentStyles.numberedHeadingsStyles, editorContentStyles.smartCardDiffStyles, editorContentStyles.showDiffDeletedNodeStyles, editorContentStyles.mediaStyles, isExperimentEnabled('platform_editor_vanilla_node_views_phase1') && editorContentStyles.vanillaCaptionStyles, contentMode === 'compact' && editorContentStyles.mediaCaptionStyles, editorContentStyles.firstWrappedMediaStyles, editorContentStyles.telepointerStyle, /* This needs to be after telepointer styles as some overlapping rules have equal specificity, and so the order is significant */
|
|
403
|
-
editorContentStyles.telepointerColorAndCommonStyle, colorMode === 'dark' && editorContentStyles.telepointerColorAndCommonStyleDarkMode, expValEqualsNoExposure('platform_editor_agent_be_streaming', 'isEnabled', true) && editorContentStyles.agentShimmerStyles, editorContentStyles.gapCursorStyles, editorContentStyles.gapCursorStylesVisibilityFix, editorContentStyles.panelStyles, editorContentStyles.nestedPanelBorderStylesMixin, editorContentStyles.panelStylesMixinNestedDnd, editorContentStyles.panelStylesMixin, editorContentStyles.mentionsStyles, editorContentStyles.tasksAndDecisionsStyles, contentMode === 'compact' && isDense && editorContentStyles.tasksAndDecisionsDenseStyles, editorContentStyles.gridStyles, editorContentStyles.blockMarksStyles, editorContentStyles.dateStyles, editorContentStyles.extensionStyles, fg('platform_editor_lovability_resize_exts_gracefully') && editorContentStyles.extensionWithBreakoutStyles, contentMode === 'compact' && editorContentStyles.extensionStylesDense, editorContentStyles.bodiedExtensionLayoutShiftFix, editorContentStyles.extensionDiffStyles, editorContentStyles.expandStylesBase, !useStandardNodeWidth && editorContentStyles.expandStyles, contentMode === 'compact' && isDense && editorContentStyles.expandDenseStyles, editorContentStyles.expandStylesMixinNestedDnd, editorContentStyles.expandStylesMixin_fg_platform_visual_refresh_icons, isChromeless && editorContentStyles.expandStylesMixin_chromeless_expand_fix, editorContentStyles.findReplaceStyles, editorContentStyles.findReplaceStylesWithCodeblockColorContrastFix, editorContentStyles.findReplaceStylesWithRefSyncBlock, editorContentStyles.textHighlightStyle, editorContentStyles.decisionStyles, editorContentStyles.taskItemStylesWithBlockTaskItem, editorContentStyles.taskItemCheckboxStyles, editorContentStyles.decisionIconWithVisualRefresh, editorContentStyles.statusStyles, isStatusStylesTeam26 ? editorContentStyles.statusStylesTeam26 : fg('platform-component-visual-refresh') ? editorContentStyles.statusStylesMixin_fg_platform_component_visual_refresh_with_search_match : editorContentStyles.statusStylesMixin_without_fg_platform_component_visual_refresh_with_search_match, isStatusStylesTeam26 && isUpdateStatusColorsEnabled && editorContentStyles.statusStylesNamedAccent, isStatusStylesTeam26 && !isUpdateStatusColorsEnabled && editorContentStyles.statusStylesNamedSemantic, editorContentStyles.statusStylesHexAccent, fg('platform_editor_ai_show_diff_patch_2') && editorContentStyles.deletedStatusStrikeStyles, editorContentStyles.annotationStyles, editorContentStyles.smartCardStylesWithSearchMatchAndBlockMenuDangerStyles, editorExperiment('platform_editor_preview_panel_responsiveness', true) && editorContentStyles.smartCardStylesWithSearchMatchAndPreviewPanelResponsiveness, editorContentStyles.editorControlsSmartCardStyles, editorContentStyles.embedCardStyles, editorContentStyles.unsupportedStyles, editorContentStyles.vanillaTooltipDefaultStyles, fg('confluence_ncs_step_diffing_version_history') && editorContentStyles.contributorTagStyles, isExperimentEnabled('platform_editor_vanilla_node_views_phase1') && editorContentStyles.vanillaUnsupportedStyles, editorContentStyles.resizerStyles, expValEqualsNoExposure('cc-maui-experiment', 'isEnabled', true) && expValEquals('databases-native-embeds-v2', 'isEnabled', true) && editorContentStyles.resizerBottomHandleStyles, editorContentStyles.layoutBaseStyles, editorContentStyles.alignMultipleWrappedImageInLayoutStyles, editorContentStyles.syncBlockStylesBase, fg('platform-dst-tokens-finesse') && editorContentStyles.syncBlockSelectedStyles, !useStandardNodeWidth && editorContentStyles.syncBlockStyles, editorContentStyles.syncBlockOverflowStyles, editorContentStyles.syncBlockFirstNodeStyles, editorContentStyles.syncBlockTextSelectionStyles, editorContentStyles.syncBlockInteractiveCursorStyles, editorExperiment('advanced_layouts', true) && editorContentStyles.layoutBaseStylesAdvanced, editorExperiment('advanced_layouts', true) ? editorContentStyles.layoutSectionStylesAdvanced : editorContentStyles.layoutSectionStylesNotAdvanced, editorExperiment('advanced_layouts', true) && !fg('platform-dst-top-layer-tooltip') && editorContentStyles.layoutDragHandleWrapperStylesLegacy, editorExperiment('advanced_layouts', true) && fg('platform-dst-top-layer-tooltip') && editorContentStyles.layoutDragHandleWrapperStylesTopLayer, editorExperiment('advanced_layouts', true) && editorContentStyles.layoutColumnDividerStyles, editorExperiment('advanced_layouts', true) && editorContentStyles.layoutColumnDividerStylesNestedDnD, editorExperiment('advanced_layouts', true) ? editorContentStyles.layoutColumnStylesAdvanced : editorContentStyles.layoutColumnStylesNotAdvanced, editorExperiment('advanced_layouts', true) && editorContentStyles.layoutColumnResizeStyles, editorExperiment('advanced_layouts', true) ? editorContentStyles.layoutSelectedStylesAdvanced : editorContentStyles.layoutSelectedStylesNotAdvanced, editorContentStyles.layoutSelectedStylesAdvancedFix, editorExperiment('advanced_layouts', true) && editorContentStyles.layoutColumnResponsiveStyles, editorExperiment('advanced_layouts', true) && editorContentStyles.layoutResponsiveBaseStyles, editorContentStyles.layoutBaseStylesNestedDndExcludingBodiedSync, editorContentStyles.layoutColumnMartinTopFixes, editorContentStyles.smartLinksInLivePagesStyles, editorContentStyles.linkingVisualRefreshV1Styles, editorContentStyles.dateVanillaStyles, contentMode === 'compact' ? editorContentStyles.paragraphStylesWithScaledMargin : editorContentStyles.paragraphStylesUGCRefreshed, editorContentStyles.linkStyles, browser.safari && editorContentStyles.listsStylesSafariFix, editorContentStyles.pragmaticResizerStylesSyncedBlock, editorContentStyles.pragmaticResizerStyles, expValEqualsNoExposure('platform_editor_lovability_resize_dividers_panels', 'isEnabled', true) && isExperimentEnabled('platform_editor_resizer_selector_jsdom_fix') && editorContentStyles.pragmaticResizerStylesPanelAndRuleJsdomFix, expValEqualsNoExposure('platform_editor_lovability_resize_dividers_panels', 'isEnabled', true) && !isExperimentEnabled('platform_editor_resizer_selector_jsdom_fix') && editorContentStyles.pragmaticResizerStylesPanelAndRule, isExperimentEnabled('platform_editor_lovability_resize_extensions') && editorContentStyles.pragmaticResizerStylesExtensions, editorContentStyles.pragmaticResizerStylesCodeBlockSyncedBlockPatch, isExperimentEnabled('platform_editor_reduce_forced_layout') && !expValEqualsNoExposure('platform_editor_lovability_resize_dividers_panels', 'isEnabled', true) && editorContentStyles.pragmaticResizerStylesHiddenForPanelAndRule, isExperimentEnabled('platform_editor_reduce_forced_layout') && !isExperimentEnabled('platform_editor_lovability_resize_extensions') && editorContentStyles.pragmaticResizerStylesHiddenForExtensions, editorExperiment('advanced_layouts', true) && editorContentStyles.pragmaticStylesLayoutFirstNodeResizeHandleFix, editorContentStyles.pragmaticResizerStylesForTooltip, editorExperiment('platform_editor_preview_panel_responsiveness', true) && editorContentStyles.pragmaticResizerStylesWithReducedEditorGutter, editorContentStyles.aiPanelBaseStyles, isFirefox && editorContentStyles.aiPanelBaseFirefoxStyles, colorMode === 'dark' && editorContentStyles.aiPanelDarkStyles, colorMode === 'dark' && isFirefox && editorContentStyles.aiPanelDarkFirefoxStyles, viewMode === 'view' && editorContentStyles.layoutStylesForView, viewMode === 'view' && editorExperiment('advanced_layouts', true) && editorContentStyles.layoutSelectedStylesForViewAdvanced, viewMode === 'view' && editorExperiment('advanced_layouts', false) && editorContentStyles.layoutSelectedStylesForViewNotAdvanced, viewMode === 'view' && editorExperiment('advanced_layouts', true) && editorContentStyles.layoutResponsiveStylesForView, isComment && editorContentStyles.commentEditorStyles, isComment && editorContentStyles.tableCommentEditorStyles, (isComment || isChromeless) && editorContentStyles.nonFullPageContainerTypeStyles, isFullPage && editorContentStyles.fullPageEditorStyles, isFullPage && editorContentStyles.scrollbarStyles, editorContentStyles.firstCodeBlockWithNoMargin, editorContentStyles.firstBlockNodeStyles, editorContentStyles.firstNodeWidgetFixStyles, editorContentStyles.mentionNodeStyles, isExperimentEnabled('platform_editor_mention_avatar_nowrap') && editorContentStyles.mentionAvatarNoWrapStyles, colorMode === 'dark' && editorContentStyles.agentMentionShimmerDarkMode, editorContentStyles.mentionsSelectionStyles, expValEquals('platform_editor_lovability_emoji_scaling', 'isEnabled', true) ? editorContentStyles.scaledEmojiStyles : editorContentStyles.emojiStyles, isFloatingTocEnabled ? editorContentStyles.directEmojiSelectionStyles : editorContentStyles.emojiSelectionStyles, contentMode === 'compact' && isDense && expValEquals('platform_editor_lovability_emoji_scaling', 'isEnabled', true) && editorContentStyles.scaledEmojiDenseStyles, contentMode === 'compact' && isDense && !expValEquals('platform_editor_lovability_emoji_scaling', 'isEnabled', true) && editorContentStyles.emojiDenseStyles, editorContentStyles.panelViewStyles, editorContentStyles.mediaGroupStyles, editorContentStyles.mediaAlignmentStyles, editorContentStyles.tableLayoutFixesWithFontSize, editorContentStyles.tableContainerStyles, editorContentStyles.tableSharedStyle, isExperimentEnabled('platform_editor_table_css_overflow_shadow') && editorContentStyles.tableScrollInlineShadowStyles, (browser.gecko || browser.ie || browser.mac && browser.chrome) && editorContentStyles.tableSharedStyleBackgroundClipFix, expValEquals('platform_editor_table_q4_loveability', 'isEnabled', true) ? editorContentStyles.tableSharedStyle_with_platform_editor_table_q4_loveability : editorContentStyles.tableSharedStyle_without_platform_editor_table_q4_loveability, expValEquals('platform_editor_table_menu_updates', 'isEnabled', true) && editorContentStyles.tableSharedStyle_with_platform_editor_table_menu_updates, fg('platform_editor_bordered_panel_nested_in_table') && editorContentStyles.tableSharedStyle_with_platform_editor_bordered_panel_nested_in_table, editorContentStyles.tableEmptyRowStyles, expValEquals('platform_editor_table_q4_loveability', 'isEnabled', true) && editorContentStyles.tableRoundedCornerStyles, editorContentStyles.tableContentModeStyles, editorContentStyles.tableContentModeExtensionContainmentStyles, editorContentStyles.tableContentModeNestedTableStyles, editorContentStyles.tableCellBackgroundColorOverrides, editorContentStyles.hyperLinkFloatingToolbarStyles, editorContentStyles.selectionToolbarAnimationStyles, editorContentStyles.blockquoteDangerStyles, editorContentStyles.textDangerStyles, editorContentStyles.listDangerStyles, editorContentStyles.dangerDateStyles, editorContentStyles.emojiDangerStyles, editorContentStyles.mentionDangerStyles, editorContentStyles.decisionDangerStyles, editorContentStyles.statusDangerStyles, fg('platform_editor_ai_show_diff_patch_2') && editorContentStyles.atomicInlineChangedBoxShadowStyles, editorContentStyles.dangerRuleStyles, editorContentStyles.mediaDangerStyles, editorContentStyles.nestedPanelDangerStyles, className || undefined]),
|
|
404
|
+
editorContentStyles.telepointerColorAndCommonStyle, colorMode === 'dark' && editorContentStyles.telepointerColorAndCommonStyleDarkMode, expValEqualsNoExposure('platform_editor_agent_be_streaming', 'isEnabled', true) && editorContentStyles.agentShimmerStyles, editorContentStyles.gapCursorStyles, editorContentStyles.gapCursorStylesVisibilityFix, editorContentStyles.panelStyles, editorContentStyles.nestedPanelBorderStylesMixin, editorContentStyles.panelStylesMixinNestedDnd, editorContentStyles.panelStylesMixin, editorContentStyles.mentionsStyles, editorContentStyles.tasksAndDecisionsStyles, contentMode === 'compact' && isDense && editorContentStyles.tasksAndDecisionsDenseStyles, editorContentStyles.gridStyles, editorContentStyles.blockMarksStyles, editorContentStyles.dateStyles, editorContentStyles.extensionStyles, fg('platform_editor_lovability_resize_exts_gracefully') && editorContentStyles.extensionWithBreakoutStyles, contentMode === 'compact' && editorContentStyles.extensionStylesDense, editorContentStyles.bodiedExtensionLayoutShiftFix, editorContentStyles.extensionDiffStyles, editorContentStyles.expandStylesBase, !useStandardNodeWidth && editorContentStyles.expandStyles, contentMode === 'compact' && isDense && editorContentStyles.expandDenseStyles, editorContentStyles.expandStylesMixinNestedDnd, editorContentStyles.expandStylesMixin_fg_platform_visual_refresh_icons, isChromeless && editorContentStyles.expandStylesMixin_chromeless_expand_fix, editorContentStyles.findReplaceStyles, editorContentStyles.findReplaceStylesWithCodeblockColorContrastFix, editorContentStyles.findReplaceStylesWithRefSyncBlock, editorContentStyles.textHighlightStyle, editorContentStyles.decisionStyles, editorContentStyles.taskItemStylesWithBlockTaskItem, editorContentStyles.taskItemCheckboxStyles, editorContentStyles.decisionIconWithVisualRefresh, editorContentStyles.statusStyles, isStatusStylesTeam26 ? editorContentStyles.statusStylesTeam26 : fg('platform-component-visual-refresh') ? editorContentStyles.statusStylesMixin_fg_platform_component_visual_refresh_with_search_match : editorContentStyles.statusStylesMixin_without_fg_platform_component_visual_refresh_with_search_match, isStatusStylesTeam26 && isExperimentEnabled('platform_status_lozenge_fractional_zoom_fix') && editorContentStyles.statusStylesTeam26TextTrim, isStatusStylesTeam26 && isUpdateStatusColorsEnabled && editorContentStyles.statusStylesNamedAccent, isStatusStylesTeam26 && !isUpdateStatusColorsEnabled && editorContentStyles.statusStylesNamedSemantic, editorContentStyles.statusStylesHexAccent, fg('platform_editor_ai_show_diff_patch_2') && editorContentStyles.deletedStatusStrikeStyles, editorContentStyles.annotationStyles, editorContentStyles.smartCardStylesWithSearchMatchAndBlockMenuDangerStyles, editorExperiment('platform_editor_preview_panel_responsiveness', true) && editorContentStyles.smartCardStylesWithSearchMatchAndPreviewPanelResponsiveness, editorContentStyles.editorControlsSmartCardStyles, editorContentStyles.embedCardStyles, editorContentStyles.unsupportedStyles, editorContentStyles.vanillaTooltipDefaultStyles, fg('confluence_ncs_step_diffing_version_history') && editorContentStyles.contributorTagStyles, isExperimentEnabled('platform_editor_vanilla_node_views_phase1') && editorContentStyles.vanillaUnsupportedStyles, editorContentStyles.resizerStyles, expValEqualsNoExposure('cc-maui-experiment', 'isEnabled', true) && expValEquals('databases-native-embeds-v2', 'isEnabled', true) && editorContentStyles.resizerBottomHandleStyles, editorContentStyles.layoutBaseStyles, editorContentStyles.alignMultipleWrappedImageInLayoutStyles, editorContentStyles.syncBlockStylesBase, fg('platform-dst-tokens-finesse') && editorContentStyles.syncBlockSelectedStyles, !useStandardNodeWidth && editorContentStyles.syncBlockStyles, editorContentStyles.syncBlockOverflowStyles, editorContentStyles.syncBlockFirstNodeStyles, editorContentStyles.syncBlockTextSelectionStyles, editorContentStyles.syncBlockInteractiveCursorStyles, editorExperiment('advanced_layouts', true) && editorContentStyles.layoutBaseStylesAdvanced, editorExperiment('advanced_layouts', true) ? editorContentStyles.layoutSectionStylesAdvanced : editorContentStyles.layoutSectionStylesNotAdvanced, editorExperiment('advanced_layouts', true) && !fg('platform-dst-top-layer-tooltip') && editorContentStyles.layoutDragHandleWrapperStylesLegacy, editorExperiment('advanced_layouts', true) && fg('platform-dst-top-layer-tooltip') && editorContentStyles.layoutDragHandleWrapperStylesTopLayer, editorExperiment('advanced_layouts', true) && editorContentStyles.layoutColumnDividerStyles, editorExperiment('advanced_layouts', true) && editorContentStyles.layoutColumnDividerStylesNestedDnD, editorExperiment('advanced_layouts', true) ? editorContentStyles.layoutColumnStylesAdvanced : editorContentStyles.layoutColumnStylesNotAdvanced, editorExperiment('advanced_layouts', true) && editorContentStyles.layoutColumnResizeStyles, editorExperiment('advanced_layouts', true) ? editorContentStyles.layoutSelectedStylesAdvanced : editorContentStyles.layoutSelectedStylesNotAdvanced, editorContentStyles.layoutSelectedStylesAdvancedFix, editorExperiment('advanced_layouts', true) && editorContentStyles.layoutColumnResponsiveStyles, editorExperiment('advanced_layouts', true) && editorContentStyles.layoutResponsiveBaseStyles, editorContentStyles.layoutBaseStylesNestedDndExcludingBodiedSync, editorContentStyles.layoutColumnMartinTopFixes, editorContentStyles.smartLinksInLivePagesStyles, editorContentStyles.linkingVisualRefreshV1Styles, editorContentStyles.dateVanillaStyles, contentMode === 'compact' ? editorContentStyles.paragraphStylesWithScaledMargin : editorContentStyles.paragraphStylesUGCRefreshed, editorContentStyles.linkStyles, browser.safari && editorContentStyles.listsStylesSafariFix, editorContentStyles.pragmaticResizerStylesSyncedBlock, editorContentStyles.pragmaticResizerStyles, expValEqualsNoExposure('platform_editor_lovability_resize_dividers_panels', 'isEnabled', true) && isExperimentEnabled('platform_editor_resizer_selector_jsdom_fix') && editorContentStyles.pragmaticResizerStylesPanelAndRuleJsdomFix, expValEqualsNoExposure('platform_editor_lovability_resize_dividers_panels', 'isEnabled', true) && !isExperimentEnabled('platform_editor_resizer_selector_jsdom_fix') && editorContentStyles.pragmaticResizerStylesPanelAndRule, isExperimentEnabled('platform_editor_lovability_resize_extensions') && editorContentStyles.pragmaticResizerStylesExtensions, editorContentStyles.pragmaticResizerStylesCodeBlockSyncedBlockPatch, isExperimentEnabled('platform_editor_reduce_forced_layout') && !expValEqualsNoExposure('platform_editor_lovability_resize_dividers_panels', 'isEnabled', true) && editorContentStyles.pragmaticResizerStylesHiddenForPanelAndRule, isExperimentEnabled('platform_editor_reduce_forced_layout') && !isExperimentEnabled('platform_editor_lovability_resize_extensions') && editorContentStyles.pragmaticResizerStylesHiddenForExtensions, editorExperiment('advanced_layouts', true) && editorContentStyles.pragmaticStylesLayoutFirstNodeResizeHandleFix, editorContentStyles.pragmaticResizerStylesForTooltip, editorExperiment('platform_editor_preview_panel_responsiveness', true) && editorContentStyles.pragmaticResizerStylesWithReducedEditorGutter, editorContentStyles.aiPanelBaseStyles, isFirefox && editorContentStyles.aiPanelBaseFirefoxStyles, colorMode === 'dark' && editorContentStyles.aiPanelDarkStyles, colorMode === 'dark' && isFirefox && editorContentStyles.aiPanelDarkFirefoxStyles, viewMode === 'view' && editorContentStyles.layoutStylesForView, viewMode === 'view' && editorExperiment('advanced_layouts', true) && editorContentStyles.layoutSelectedStylesForViewAdvanced, viewMode === 'view' && editorExperiment('advanced_layouts', false) && editorContentStyles.layoutSelectedStylesForViewNotAdvanced, viewMode === 'view' && editorExperiment('advanced_layouts', true) && editorContentStyles.layoutResponsiveStylesForView, isComment && editorContentStyles.commentEditorStyles, isComment && editorContentStyles.tableCommentEditorStyles, (isComment || isChromeless) && editorContentStyles.nonFullPageContainerTypeStyles, isFullPage && editorContentStyles.fullPageEditorStyles, isFullPage && editorContentStyles.scrollbarStyles, editorContentStyles.firstCodeBlockWithNoMargin, editorContentStyles.firstBlockNodeStyles, editorContentStyles.firstNodeWidgetFixStyles, editorContentStyles.mentionNodeStyles, isExperimentEnabled('platform_editor_mention_avatar_nowrap') && editorContentStyles.mentionAvatarNoWrapStyles, colorMode === 'dark' && editorContentStyles.agentMentionShimmerDarkMode, editorContentStyles.mentionsSelectionStyles, expValEquals('platform_editor_lovability_emoji_scaling', 'isEnabled', true) ? editorContentStyles.scaledEmojiStyles : editorContentStyles.emojiStyles, isFloatingTocEnabled ? editorContentStyles.directEmojiSelectionStyles : editorContentStyles.emojiSelectionStyles, contentMode === 'compact' && isDense && expValEquals('platform_editor_lovability_emoji_scaling', 'isEnabled', true) && editorContentStyles.scaledEmojiDenseStyles, contentMode === 'compact' && isDense && !expValEquals('platform_editor_lovability_emoji_scaling', 'isEnabled', true) && editorContentStyles.emojiDenseStyles, editorContentStyles.panelViewStyles, editorContentStyles.mediaGroupStyles, editorContentStyles.mediaAlignmentStyles, editorContentStyles.tableLayoutFixesWithFontSize, editorContentStyles.tableContainerStyles, editorContentStyles.tableSharedStyle, isExperimentEnabled('platform_editor_table_css_overflow_shadow') && editorContentStyles.tableScrollInlineShadowStyles, (browser.gecko || browser.ie || browser.mac && browser.chrome) && editorContentStyles.tableSharedStyleBackgroundClipFix, expValEquals('platform_editor_table_q4_loveability', 'isEnabled', true) ? editorContentStyles.tableSharedStyle_with_platform_editor_table_q4_loveability : editorContentStyles.tableSharedStyle_without_platform_editor_table_q4_loveability, expValEquals('platform_editor_table_menu_updates', 'isEnabled', true) && editorContentStyles.tableSharedStyle_with_platform_editor_table_menu_updates, fg('platform_editor_bordered_panel_nested_in_table') && editorContentStyles.tableSharedStyle_with_platform_editor_bordered_panel_nested_in_table, editorContentStyles.tableEmptyRowStyles, expValEquals('platform_editor_table_q4_loveability', 'isEnabled', true) && editorContentStyles.tableRoundedCornerStyles, editorContentStyles.tableContentModeStyles, editorContentStyles.tableContentModeExtensionContainmentStyles, editorContentStyles.tableContentModeNestedTableStyles, editorContentStyles.tableCellBackgroundColorOverrides, editorContentStyles.hyperLinkFloatingToolbarStyles, editorContentStyles.selectionToolbarAnimationStyles, editorContentStyles.blockquoteDangerStyles, editorContentStyles.textDangerStyles, editorContentStyles.listDangerStyles, editorContentStyles.dangerDateStyles, editorContentStyles.emojiDangerStyles, editorContentStyles.mentionDangerStyles, editorContentStyles.decisionDangerStyles, editorContentStyles.statusDangerStyles, fg('platform_editor_ai_show_diff_patch_2') && editorContentStyles.atomicInlineChangedBoxShadowStyles, editorContentStyles.dangerRuleStyles, editorContentStyles.mediaDangerStyles, editorContentStyles.nestedPanelDangerStyles, className || undefined]),
|
|
404
405
|
ref: ref,
|
|
405
406
|
"data-editor-scroll-container": isScrollable ? 'true' : undefined,
|
|
406
407
|
"data-testid": "editor-content-container"
|
|
@@ -3,7 +3,7 @@ import { EditorToolbarProvider } from '@atlaskit/editor-common/toolbar/context';
|
|
|
3
3
|
import { EditorToolbarUIProvider } from '@atlaskit/editor-common/toolbar/EditorToolbarUIProvider';
|
|
4
4
|
import { ToolbarSize } from '@atlaskit/editor-common/types';
|
|
5
5
|
import { useSharedPluginStateWithSelector } from '@atlaskit/editor-common/useSharedPluginStateWithSelector';
|
|
6
|
-
import { isOfflineMode } from '@atlaskit/editor-plugin-connectivity';
|
|
6
|
+
import { isOfflineMode } from '@atlaskit/editor-plugin-connectivity/connectivityPluginType';
|
|
7
7
|
import { ToolbarModelRenderer } from '@atlaskit/editor-toolbar-model/toolbar-model-renderer';
|
|
8
8
|
import { ToolbarButtonGroup } from '@atlaskit/editor-toolbar/toolbar-button-group';
|
|
9
9
|
import { ToolbarDropdownItemSection } from '@atlaskit/editor-toolbar/toolbar-dropdown-item-section';
|
|
@@ -1,17 +1,36 @@
|
|
|
1
|
-
import
|
|
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 React, { useCallback, useEffect, useMemo } from 'react';
|
|
2
5
|
import { QuickInsertMenuItem } from '@atlaskit/editor-common/quick-insert/menu-item';
|
|
3
6
|
import { useQuickInsertContext } from '@atlaskit/editor-common/quick-insert/use-quick-insert-context';
|
|
7
|
+
import { getAppVendorLookup } from './app-vendor/getAppVendorLookup';
|
|
8
|
+
import { useAppVendorName } from './app-vendor/useAppVendorName';
|
|
4
9
|
import { executeExtensionQuickInsertItem } from './executeExtensionQuickInsertItem';
|
|
5
10
|
import { ExtensionQuickInsertIcon } from './ExtensionQuickInsertIcon';
|
|
6
11
|
export var ExtensionQuickInsertMenuItem = function ExtensionQuickInsertMenuItem(_ref) {
|
|
12
|
+
var _getAppVendorLookup;
|
|
7
13
|
var apiRef = _ref.apiRef,
|
|
8
14
|
createAnalyticsEvent = _ref.createAnalyticsEvent,
|
|
9
15
|
editorActions = _ref.editorActions,
|
|
10
16
|
item = _ref.item,
|
|
11
|
-
onInsert = _ref.onInsert
|
|
17
|
+
onInsert = _ref.onInsert,
|
|
18
|
+
prefetchVendors = _ref.prefetchVendors;
|
|
12
19
|
var _useQuickInsertContex = useQuickInsertContext(),
|
|
13
20
|
editorView = _useQuickInsertContex.editorView,
|
|
14
21
|
isOffline = _useQuickInsertContex.isOffline;
|
|
22
|
+
var vendorName = useAppVendorName((_getAppVendorLookup = getAppVendorLookup(item)) === null || _getAppVendorLookup === void 0 ? void 0 : _getAppVendorLookup.id);
|
|
23
|
+
useEffect(function () {
|
|
24
|
+
prefetchVendors === null || prefetchVendors === void 0 || prefetchVendors();
|
|
25
|
+
}, [prefetchVendors]);
|
|
26
|
+
var preview = useMemo(function () {
|
|
27
|
+
var _item$preview;
|
|
28
|
+
return vendorName && !((_item$preview = item.preview) !== null && _item$preview !== void 0 && _item$preview.attribution) ? _objectSpread(_objectSpread({}, item.preview), {}, {
|
|
29
|
+
attribution: {
|
|
30
|
+
name: vendorName
|
|
31
|
+
}
|
|
32
|
+
}) : item.preview;
|
|
33
|
+
}, [item.preview, vendorName]);
|
|
15
34
|
var onSelect = useCallback(function (_ref2) {
|
|
16
35
|
var insert = _ref2.insert,
|
|
17
36
|
source = _ref2.source;
|
|
@@ -38,7 +57,7 @@ export var ExtensionQuickInsertMenuItem = function ExtensionQuickInsertMenuItem(
|
|
|
38
57
|
isDisabled: isOffline,
|
|
39
58
|
lozenge: item.lozenge,
|
|
40
59
|
onSelect: onSelect,
|
|
41
|
-
preview:
|
|
60
|
+
preview: preview,
|
|
42
61
|
description: item.description,
|
|
43
62
|
title: item.title
|
|
44
63
|
});
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import _createClass from "@babel/runtime/helpers/createClass";
|
|
2
|
+
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
3
|
+
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
4
|
+
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
5
|
+
import _inherits from "@babel/runtime/helpers/inherits";
|
|
6
|
+
import _wrapNativeSuper from "@babel/runtime/helpers/wrapNativeSuper";
|
|
7
|
+
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
8
|
+
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
9
|
+
/** Statuses where retrying cannot succeed, or would add load to a throttled gateway. */
|
|
10
|
+
var BLOCKING_STATUSES = new Set([401, 403, 429]);
|
|
11
|
+
export var AppVendorRequestError = /*#__PURE__*/function (_Error) {
|
|
12
|
+
/** Whether every remaining lookup should stop rather than retry. */
|
|
13
|
+
|
|
14
|
+
function AppVendorRequestError(message, status) {
|
|
15
|
+
var _this;
|
|
16
|
+
_classCallCheck(this, AppVendorRequestError);
|
|
17
|
+
_this = _callSuper(this, AppVendorRequestError, [message]);
|
|
18
|
+
_this.name = 'AppVendorRequestError';
|
|
19
|
+
_this.isBlocking = status !== undefined && BLOCKING_STATUSES.has(status);
|
|
20
|
+
return _this;
|
|
21
|
+
}
|
|
22
|
+
_inherits(AppVendorRequestError, _Error);
|
|
23
|
+
return _createClass(AppVendorRequestError);
|
|
24
|
+
}( /*#__PURE__*/_wrapNativeSuper(Error));
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Vendor names keyed by lookup id, plus the subscribers to notify when they change.
|
|
3
|
+
* Module scope so names survive editor and provider rebuilds for the rest of the page load.
|
|
4
|
+
*/
|
|
5
|
+
export var appVendorCache = {
|
|
6
|
+
entries: new Map(),
|
|
7
|
+
listeners: new Set()
|
|
8
|
+
};
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
2
|
+
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
3
|
+
import { AppVendorRequestError } from './AppVendorRequestError';
|
|
4
|
+
var AGG_PATH = '/gateway/api/graphql';
|
|
5
|
+
var OPERATION_NAME = 'QuickInsertAppVendorsQuery';
|
|
6
|
+
var getField = function getField(_ref, variable) {
|
|
7
|
+
var kind = _ref.kind;
|
|
8
|
+
return kind === 'forge' ? "marketplaceAppByCloudAppId(cloudAppId: $".concat(variable, ")") : "marketplaceAppByKey(appKey: $".concat(variable, ")");
|
|
9
|
+
};
|
|
10
|
+
var getVariableType = function getVariableType(_ref2) {
|
|
11
|
+
var kind = _ref2.kind;
|
|
12
|
+
return kind === 'forge' ? 'ID!' : 'String!';
|
|
13
|
+
};
|
|
14
|
+
var buildQuery = function buildQuery(lookups) {
|
|
15
|
+
var variables = lookups.map(function (lookup, index) {
|
|
16
|
+
return "$a".concat(index, ": ").concat(getVariableType(lookup));
|
|
17
|
+
});
|
|
18
|
+
var fields = lookups.map(function (lookup, index) {
|
|
19
|
+
return "a".concat(index, ": ").concat(getField(lookup, "a".concat(index)), " { partner { name } }");
|
|
20
|
+
});
|
|
21
|
+
return "query ".concat(OPERATION_NAME, "(").concat(variables.join(', '), ") { ").concat(fields.join(' '), " }");
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
/** A request that never settles would otherwise leave its lookups pending for the page load. */
|
|
25
|
+
var REQUEST_TIMEOUT_MS = 10000;
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Fetches Marketplace partner names for at most one batch of lookups.
|
|
29
|
+
* Resolves `null` for apps without a listed partner and omits lookups whose field errored, so they
|
|
30
|
+
* can be retried; rejects with `AppVendorRequestError` when the request itself fails, or with an
|
|
31
|
+
* `AbortError` when it takes longer than `REQUEST_TIMEOUT_MS`.
|
|
32
|
+
*/
|
|
33
|
+
export var fetchAppVendors = /*#__PURE__*/function () {
|
|
34
|
+
var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(lookups) {
|
|
35
|
+
var controller, timeout, response, _yield$response$json, data, errors, erroredAliases;
|
|
36
|
+
return _regeneratorRuntime.wrap(function (_context) {
|
|
37
|
+
while (1) switch (_context.prev = _context.next) {
|
|
38
|
+
case 0:
|
|
39
|
+
controller = new AbortController();
|
|
40
|
+
timeout = setTimeout(function () {
|
|
41
|
+
return controller.abort();
|
|
42
|
+
}, REQUEST_TIMEOUT_MS);
|
|
43
|
+
_context.prev = 1;
|
|
44
|
+
_context.next = 2;
|
|
45
|
+
return fetch(AGG_PATH, {
|
|
46
|
+
method: 'POST',
|
|
47
|
+
headers: {
|
|
48
|
+
'Content-Type': 'application/json'
|
|
49
|
+
},
|
|
50
|
+
body: JSON.stringify({
|
|
51
|
+
operationName: OPERATION_NAME,
|
|
52
|
+
query: buildQuery(lookups),
|
|
53
|
+
variables: Object.fromEntries(lookups.map(function (_ref4, index) {
|
|
54
|
+
var value = _ref4.value;
|
|
55
|
+
return ["a".concat(index), value];
|
|
56
|
+
}))
|
|
57
|
+
}),
|
|
58
|
+
// Also aborts reading the body, so a slow response cannot hang either.
|
|
59
|
+
signal: controller.signal
|
|
60
|
+
});
|
|
61
|
+
case 2:
|
|
62
|
+
response = _context.sent;
|
|
63
|
+
if (response.ok) {
|
|
64
|
+
_context.next = 3;
|
|
65
|
+
break;
|
|
66
|
+
}
|
|
67
|
+
throw new AppVendorRequestError("App vendor request failed: ".concat(response.status), response.status);
|
|
68
|
+
case 3:
|
|
69
|
+
_context.next = 4;
|
|
70
|
+
return response.json();
|
|
71
|
+
case 4:
|
|
72
|
+
_yield$response$json = _context.sent;
|
|
73
|
+
data = _yield$response$json.data;
|
|
74
|
+
errors = _yield$response$json.errors;
|
|
75
|
+
if (data) {
|
|
76
|
+
_context.next = 5;
|
|
77
|
+
break;
|
|
78
|
+
}
|
|
79
|
+
throw new AppVendorRequestError('App vendor request returned no data');
|
|
80
|
+
case 5:
|
|
81
|
+
// A field that errored or timed out also returns null, which must not be cached as unlisted.
|
|
82
|
+
erroredAliases = new Set(errors === null || errors === void 0 ? void 0 : errors.map(function (_ref5) {
|
|
83
|
+
var path = _ref5.path;
|
|
84
|
+
return path === null || path === void 0 ? void 0 : path[0];
|
|
85
|
+
}));
|
|
86
|
+
return _context.abrupt("return", new Map(lookups.flatMap(function (_ref6, index) {
|
|
87
|
+
var _data$alias;
|
|
88
|
+
var id = _ref6.id;
|
|
89
|
+
var alias = "a".concat(index);
|
|
90
|
+
return erroredAliases.has(alias) ? [] : [[id, ((_data$alias = data[alias]) === null || _data$alias === void 0 || (_data$alias = _data$alias.partner) === null || _data$alias === void 0 ? void 0 : _data$alias.name) || null]];
|
|
91
|
+
})));
|
|
92
|
+
case 6:
|
|
93
|
+
_context.prev = 6;
|
|
94
|
+
clearTimeout(timeout);
|
|
95
|
+
return _context.finish(6);
|
|
96
|
+
case 7:
|
|
97
|
+
case "end":
|
|
98
|
+
return _context.stop();
|
|
99
|
+
}
|
|
100
|
+
}, _callee, null, [[1,, 6, 7]]);
|
|
101
|
+
}));
|
|
102
|
+
return function fetchAppVendors(_x) {
|
|
103
|
+
return _ref3.apply(this, arguments);
|
|
104
|
+
};
|
|
105
|
+
}();
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
2
|
+
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
3
|
+
import { AppVendorRequestError } from './AppVendorRequestError';
|
|
4
|
+
import { fetchAppVendors } from './fetchAppVendors';
|
|
5
|
+
/** Marketplace has no bulk lookup; larger aliased requests time out. */
|
|
6
|
+
var BATCH_SIZE = 15;
|
|
7
|
+
var MAX_CONCURRENT_BATCHES = 3;
|
|
8
|
+
/**
|
|
9
|
+
* Fetches lookups in batches, at most `MAX_CONCURRENT_BATCHES` at a time, reporting each batch as it
|
|
10
|
+
* settles. Batches that have not started when `shouldContinue` returns false are reported as skipped.
|
|
11
|
+
* Loaded on demand so editors without ecosystem apps never download the fetching code.
|
|
12
|
+
*/
|
|
13
|
+
export var fetchAppVendorsInBatches = /*#__PURE__*/function () {
|
|
14
|
+
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(lookups, _ref) {
|
|
15
|
+
var onBatch, shouldContinue, batches, start, nextBatch, runWorker;
|
|
16
|
+
return _regeneratorRuntime.wrap(function (_context2) {
|
|
17
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
18
|
+
case 0:
|
|
19
|
+
onBatch = _ref.onBatch, shouldContinue = _ref.shouldContinue;
|
|
20
|
+
batches = [];
|
|
21
|
+
for (start = 0; start < lookups.length; start += BATCH_SIZE) {
|
|
22
|
+
batches.push(lookups.slice(start, start + BATCH_SIZE));
|
|
23
|
+
}
|
|
24
|
+
nextBatch = 0;
|
|
25
|
+
runWorker = /*#__PURE__*/function () {
|
|
26
|
+
var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
|
27
|
+
var batch, names, isBlocking, _t;
|
|
28
|
+
return _regeneratorRuntime.wrap(function (_context) {
|
|
29
|
+
while (1) switch (_context.prev = _context.next) {
|
|
30
|
+
case 0:
|
|
31
|
+
if (!(nextBatch < batches.length)) {
|
|
32
|
+
_context.next = 6;
|
|
33
|
+
break;
|
|
34
|
+
}
|
|
35
|
+
batch = batches[nextBatch++];
|
|
36
|
+
if (shouldContinue()) {
|
|
37
|
+
_context.next = 1;
|
|
38
|
+
break;
|
|
39
|
+
}
|
|
40
|
+
onBatch(batch, {
|
|
41
|
+
status: 'skipped'
|
|
42
|
+
});
|
|
43
|
+
return _context.abrupt("continue", 0);
|
|
44
|
+
case 1:
|
|
45
|
+
// Only the request is caught, so a batch is never reported twice.
|
|
46
|
+
names = void 0;
|
|
47
|
+
_context.prev = 2;
|
|
48
|
+
_context.next = 3;
|
|
49
|
+
return fetchAppVendors(batch);
|
|
50
|
+
case 3:
|
|
51
|
+
names = _context.sent;
|
|
52
|
+
_context.next = 5;
|
|
53
|
+
break;
|
|
54
|
+
case 4:
|
|
55
|
+
_context.prev = 4;
|
|
56
|
+
_t = _context["catch"](2);
|
|
57
|
+
isBlocking = _t instanceof AppVendorRequestError && _t.isBlocking;
|
|
58
|
+
onBatch(batch, {
|
|
59
|
+
error: _t,
|
|
60
|
+
isBlocking: isBlocking,
|
|
61
|
+
status: 'rejected'
|
|
62
|
+
});
|
|
63
|
+
return _context.abrupt("continue", 0);
|
|
64
|
+
case 5:
|
|
65
|
+
onBatch(batch, {
|
|
66
|
+
names: names,
|
|
67
|
+
status: 'fulfilled'
|
|
68
|
+
});
|
|
69
|
+
_context.next = 0;
|
|
70
|
+
break;
|
|
71
|
+
case 6:
|
|
72
|
+
case "end":
|
|
73
|
+
return _context.stop();
|
|
74
|
+
}
|
|
75
|
+
}, _callee, null, [[2, 4]]);
|
|
76
|
+
}));
|
|
77
|
+
return function runWorker() {
|
|
78
|
+
return _ref3.apply(this, arguments);
|
|
79
|
+
};
|
|
80
|
+
}();
|
|
81
|
+
_context2.next = 1;
|
|
82
|
+
return Promise.all(Array.from({
|
|
83
|
+
length: Math.min(MAX_CONCURRENT_BATCHES, batches.length)
|
|
84
|
+
}, runWorker));
|
|
85
|
+
case 1:
|
|
86
|
+
case "end":
|
|
87
|
+
return _context2.stop();
|
|
88
|
+
}
|
|
89
|
+
}, _callee2);
|
|
90
|
+
}));
|
|
91
|
+
return function fetchAppVendorsInBatches(_x, _x2) {
|
|
92
|
+
return _ref2.apply(this, arguments);
|
|
93
|
+
};
|
|
94
|
+
}();
|