@atlaskit/editor-common 122.11.1 → 123.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 +55 -0
- package/dist/cjs/ai-messages/ai-suggestions.js +13 -8
- package/dist/cjs/extensibility/GeneratedContentReveal.compiled.css +4 -3
- package/dist/cjs/extensibility/GeneratedContentReveal.js +7 -22
- package/dist/cjs/extensions/buildMenuItem.js +1 -1
- package/dist/cjs/lists/flatten-list.js +1 -73
- package/dist/cjs/lists/index.js +0 -26
- package/dist/cjs/lists/node.js +1 -78
- package/dist/cjs/lists/replace-content.js +1 -9
- package/dist/cjs/lists/selection.js +2 -29
- package/dist/cjs/monitoring/error.js +1 -1
- package/dist/cjs/node-anchor/node-anchor-provider.js +1 -3
- package/dist/cjs/quick-insert/build-quick-insert-menu-model.js +6 -5
- package/dist/cjs/quick-insert/getQuickInsertProviderMenuItemKey.js +16 -3
- package/dist/cjs/quick-insert/registered-menu-model.js +14 -0
- package/dist/cjs/quick-insert/selectQuickInsertCategoryItems.js +27 -0
- package/dist/cjs/ui/DropList/index.js +1 -1
- package/dist/es2019/ai-messages/ai-suggestions.js +13 -8
- package/dist/es2019/extensibility/GeneratedContentReveal.compiled.css +4 -3
- package/dist/es2019/extensibility/GeneratedContentReveal.js +6 -18
- package/dist/es2019/extensions/buildMenuItem.js +1 -1
- package/dist/es2019/lists/flatten-list.js +1 -76
- package/dist/es2019/lists/index.js +2 -4
- package/dist/es2019/lists/node.js +0 -77
- package/dist/es2019/lists/replace-content.js +1 -3
- package/dist/es2019/lists/selection.js +1 -31
- package/dist/es2019/monitoring/error.js +1 -1
- package/dist/es2019/node-anchor/node-anchor-provider.js +1 -3
- package/dist/es2019/quick-insert/build-quick-insert-menu-model.js +6 -5
- package/dist/es2019/quick-insert/getQuickInsertProviderMenuItemKey.js +10 -1
- package/dist/es2019/quick-insert/registered-menu-model.js +2 -0
- package/dist/es2019/quick-insert/selectQuickInsertCategoryItems.js +19 -0
- package/dist/es2019/ui/DropList/index.js +1 -1
- package/dist/esm/ai-messages/ai-suggestions.js +13 -8
- package/dist/esm/extensibility/GeneratedContentReveal.compiled.css +4 -3
- package/dist/esm/extensibility/GeneratedContentReveal.js +7 -22
- package/dist/esm/extensions/buildMenuItem.js +1 -1
- package/dist/esm/lists/flatten-list.js +1 -71
- package/dist/esm/lists/index.js +2 -4
- package/dist/esm/lists/node.js +0 -77
- package/dist/esm/lists/replace-content.js +1 -3
- package/dist/esm/lists/selection.js +1 -28
- package/dist/esm/monitoring/error.js +1 -1
- package/dist/esm/node-anchor/node-anchor-provider.js +1 -3
- package/dist/esm/quick-insert/build-quick-insert-menu-model.js +6 -5
- package/dist/esm/quick-insert/getQuickInsertProviderMenuItemKey.js +15 -2
- package/dist/esm/quick-insert/registered-menu-model.js +2 -0
- package/dist/esm/quick-insert/selectQuickInsertCategoryItems.js +21 -0
- package/dist/esm/ui/DropList/index.js +1 -1
- package/dist/types/ai-messages/ai-suggestions.d.ts +5 -0
- package/dist/types/collab/agent-edit-chrome.d.ts +1 -0
- package/dist/types/lists/flatten-list.d.ts +0 -28
- package/dist/types/lists/index.d.ts +2 -4
- package/dist/types/lists/node.d.ts +0 -1
- package/dist/types/lists/replace-content.d.ts +1 -1
- package/dist/types/lists/selection.d.ts +1 -7
- package/dist/types/quick-insert/build-quick-insert-menu-model.d.ts +2 -1
- package/dist/types/quick-insert/getQuickInsertProviderMenuItemKey.d.ts +10 -1
- package/dist/types/quick-insert/registered-menu-model.d.ts +3 -0
- package/dist/types/quick-insert/selectQuickInsertCategoryItems.d.ts +7 -0
- package/package.json +5 -5
- package/dist/cjs/lists/indentation.js +0 -23
- package/dist/cjs/lists/wrapTaskListIntoListAbove.js +0 -30
- package/dist/es2019/lists/indentation.js +0 -18
- package/dist/es2019/lists/wrapTaskListIntoListAbove.js +0 -24
- package/dist/esm/lists/indentation.js +0 -17
- package/dist/esm/lists/wrapTaskListIntoListAbove.js +0 -24
- package/dist/types/lists/indentation.d.ts +0 -5
- package/dist/types/lists/wrapTaskListIntoListAbove.d.ts +0 -2
- package/lists/indentation/package.json +0 -10
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,60 @@
|
|
|
1
1
|
# @atlaskit/editor-common
|
|
2
2
|
|
|
3
|
+
## 123.0.0
|
|
4
|
+
|
|
5
|
+
### Major Changes
|
|
6
|
+
|
|
7
|
+
- [`3b3e57040d2d0`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/3b3e57040d2d0) -
|
|
8
|
+
Remove retired flexible-list feature controls and schema styles while preserving shipped list
|
|
9
|
+
normalization, hidden-marker rendering for wrapper list items, task paste and task-list tab
|
|
10
|
+
behavior, and toolbar indentation behavior.
|
|
11
|
+
|
|
12
|
+
Remove unused legacy list utilities after the flexible-list rollout: `flattenList`,
|
|
13
|
+
`normalizeListItemsSelection`, `hasValidListIndentationLevel`,
|
|
14
|
+
`processNestedTaskListsInSameLevel`, and `wrapTaskListIntoListAbove`. The
|
|
15
|
+
`@atlaskit/editor-common/lists/indentation` entrypoint is also removed.
|
|
16
|
+
|
|
17
|
+
Consumers of the removed runtime helpers should use the editor list plugin's indent/outdent
|
|
18
|
+
commands. The shared `FlattenedItem`, `FlattenListOptions`, and `FlattenListResult` types remain
|
|
19
|
+
available for the active list implementations.
|
|
20
|
+
|
|
21
|
+
### Patch Changes
|
|
22
|
+
|
|
23
|
+
- Updated dependencies
|
|
24
|
+
|
|
25
|
+
## 122.12.0
|
|
26
|
+
|
|
27
|
+
### Minor Changes
|
|
28
|
+
|
|
29
|
+
- [`b2a2413928cac`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/b2a2413928cac) -
|
|
30
|
+
Match agent highlights, cursors and review diffs to shared Studio and third-party brand colours
|
|
31
|
+
under the existing telepointer redesign. Use the existing purple attribution treatment for Rovo
|
|
32
|
+
review diffs and preserve square Rovo telepointer avatars.
|
|
33
|
+
|
|
34
|
+
### Patch Changes
|
|
35
|
+
|
|
36
|
+
- [`749f1c3c8359c`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/749f1c3c8359c) -
|
|
37
|
+
Retain the first 30 category results and include the first 10 ecosystem quick-insert registrations
|
|
38
|
+
when they fall beyond that cutoff.
|
|
39
|
+
|
|
40
|
+
Limit slash-command insert-menu category browsing while preserving uncapped search results.
|
|
41
|
+
|
|
42
|
+
Classify ecosystem quick-insert provider registrations without changing compatibility keys.
|
|
43
|
+
|
|
44
|
+
Preserve app provenance for Quick Insert items while the `platform_editor_slash_command`
|
|
45
|
+
experiment is enabled.
|
|
46
|
+
|
|
47
|
+
Enable Quick Insert category analytics while the `platform_editor_slash_command` experiment is
|
|
48
|
+
enabled.
|
|
49
|
+
|
|
50
|
+
- [`ef1c909630275`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/ef1c909630275) -
|
|
51
|
+
Fix Suggested Edits labels, loading-copy IDs, source tooltips, and source product icons under the
|
|
52
|
+
existing Suggested Edits rollout.
|
|
53
|
+
- [`fb2456e25ba6f`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/fb2456e25ba6f) -
|
|
54
|
+
The generated content reveal animates `height` to `auto` instead of to a measured value, so the
|
|
55
|
+
node no longer reads its own height before opening.
|
|
56
|
+
- Updated dependencies
|
|
57
|
+
|
|
3
58
|
## 122.11.1
|
|
4
59
|
|
|
5
60
|
### Patch Changes
|
|
@@ -122,13 +122,13 @@ var aiSuggestionsMessages = exports.aiSuggestionsMessages = (0, _reactIntl.defin
|
|
|
122
122
|
description: 'Label for the suggestions section in the AI suggestions staging area'
|
|
123
123
|
},
|
|
124
124
|
cardCloseButtonLabel: {
|
|
125
|
-
id: 'fabric.editor.ai.suggestions.card.
|
|
125
|
+
id: 'fabric.editor.ai.suggestions.card.closeSuggestionButtonLabel.non-final',
|
|
126
126
|
defaultMessage: 'Close suggestion',
|
|
127
127
|
description: 'Label and tooltip for the close button on the AI suggestions card'
|
|
128
128
|
},
|
|
129
129
|
cardShowSidebarButtonLabel: {
|
|
130
|
-
id: 'fabric.editor.ai.suggestions.card.
|
|
131
|
-
defaultMessage: 'Show
|
|
130
|
+
id: 'fabric.editor.ai.suggestions.card.showSuggestionsButtonLabel.non-final',
|
|
131
|
+
defaultMessage: 'Show suggestions',
|
|
132
132
|
description: 'Label and tooltip for the button on the AI suggestions card that opens the suggestions sidebar'
|
|
133
133
|
},
|
|
134
134
|
cardPreviousSuggestionButtonLabel: {
|
|
@@ -196,18 +196,23 @@ var aiSuggestionsMessages = exports.aiSuggestionsMessages = (0, _reactIntl.defin
|
|
|
196
196
|
defaultMessage: 'Source apps',
|
|
197
197
|
description: 'Accessible name for the stack of app logos showing which apps an AI suggestion drew on'
|
|
198
198
|
},
|
|
199
|
+
cardSourceAppsTooltip: {
|
|
200
|
+
id: 'fabric.editor.ai.suggestions.card.sourceAppsTooltip.non-final',
|
|
201
|
+
defaultMessage: 'Sources from {apps}',
|
|
202
|
+
description: 'Tooltip and accessible name for the stack of product logos showing which apps an AI suggestion drew on. {apps} is a localized list of product names, such as “Confluence and Jira”.'
|
|
203
|
+
},
|
|
199
204
|
cardSourcesButtonLabel: {
|
|
200
205
|
id: 'fabric.editor.ai.suggestions.card.sourcesButtonLabel.non-final',
|
|
201
206
|
defaultMessage: 'Sources',
|
|
202
207
|
description: 'Label for the sources toggle button on the AI suggestions card'
|
|
203
208
|
},
|
|
204
209
|
cardSourcesHideButtonLabel: {
|
|
205
|
-
id: 'fabric.editor.ai.suggestions.card.
|
|
210
|
+
id: 'fabric.editor.ai.suggestions.card.hideReasoningButtonLabel.non-final',
|
|
206
211
|
defaultMessage: 'Hide reasoning',
|
|
207
212
|
description: 'Label for the sources toggle button when sources are expanded'
|
|
208
213
|
},
|
|
209
214
|
cardSourcesShowButtonLabel: {
|
|
210
|
-
id: 'fabric.editor.ai.suggestions.card.
|
|
215
|
+
id: 'fabric.editor.ai.suggestions.card.showReasoningButtonLabel.non-final',
|
|
211
216
|
defaultMessage: 'Show reasoning',
|
|
212
217
|
description: 'Label for the sources toggle button when sources are collapsed'
|
|
213
218
|
},
|
|
@@ -247,7 +252,7 @@ var aiSuggestionsMessages = exports.aiSuggestionsMessages = (0, _reactIntl.defin
|
|
|
247
252
|
description: 'Label for the dismiss button on the AI suggestions card'
|
|
248
253
|
},
|
|
249
254
|
cardMoreOptionsButtonLabel: {
|
|
250
|
-
id: 'fabric.editor.ai.suggestions.card.
|
|
255
|
+
id: 'fabric.editor.ai.suggestions.card.moreActionsButtonLabel.non-final',
|
|
251
256
|
defaultMessage: 'More actions',
|
|
252
257
|
description: 'Label and tooltip for the overflow actions button on the AI suggestions card'
|
|
253
258
|
},
|
|
@@ -297,12 +302,12 @@ var aiSuggestionsMessages = exports.aiSuggestionsMessages = (0, _reactIntl.defin
|
|
|
297
302
|
description: 'Accessible label for the stop button displayed while the AI is thinking. When clicked, it cancels the ongoing action.'
|
|
298
303
|
},
|
|
299
304
|
thinkingReviewingContent: {
|
|
300
|
-
id: 'fabric.editor.ai.suggestions.thinking.
|
|
305
|
+
id: 'fabric.editor.ai.suggestions.thinking.rovoReviewingPage.non-final',
|
|
301
306
|
defaultMessage: 'Rovo is reviewing your page',
|
|
302
307
|
description: 'First loading message on the AI suggestions thinking bar, shown when the name of the reviewing agent is unknown'
|
|
303
308
|
},
|
|
304
309
|
thinkingReviewingContentWithAgent: {
|
|
305
|
-
id: 'fabric.editor.ai.suggestions.thinking.
|
|
310
|
+
id: 'fabric.editor.ai.suggestions.thinking.agentAnalyzing.non-final',
|
|
306
311
|
defaultMessage: '{agentName} is analyzing',
|
|
307
312
|
description: 'First loading message on the AI suggestions thinking bar. The {agentName} placeholder is replaced with the reviewing agent name (for example "Content Reviewer"). Shown for a few seconds before the remaining rotating statuses.'
|
|
308
313
|
},
|
|
@@ -24,15 +24,15 @@
|
|
|
24
24
|
._1vs61nu9:has(.extension-label:hover) .extension-icon{display:inline}
|
|
25
25
|
._26lx1tsb .extension-label:hover.with-bodied-macro-live-page-styles{box-shadow:0 0 0 1px var(--ds-border,#0b120e24)}
|
|
26
26
|
._2z44kb7n:has(.extension-edit-toggle-container:hover) .extension-label{opacity:1}
|
|
27
|
+
._4t3iidpf{height:0}
|
|
27
28
|
._54r11nu9:has(.extension-edit-toggle-container:hover) .extension-icon{display:inline}
|
|
28
29
|
._5sag15uc{animation-duration:var(--ds-duration-xlong,.4s)}
|
|
29
30
|
._9sz11bym iframe:not([data-native-embed-card-wrapper=true] iframe){animation-name:var(--ds-keyframe-fade-in,FadeIn0to100)}
|
|
30
31
|
._bcikkb7n:has(.extension-container:hover) .extension-label{opacity:1}
|
|
31
|
-
._c71lidpf{max-height:0}
|
|
32
32
|
._d1oeglyw:has(.extension-container:hover) .extension-label{box-shadow:none}
|
|
33
33
|
._decvtlke:has(.extension-edit-toggle-container:hover) .extension-label{cursor:pointer}
|
|
34
34
|
._gp9p1hrf iframe:not([data-native-embed-card-wrapper=true] iframe){animation-fill-mode:both}
|
|
35
|
-
.
|
|
35
|
+
._j7hq180b{animation-name:k1gqx0zb}
|
|
36
36
|
._jl0d1tsb:has(.extension-edit-toggle-container:hover) .extension-label.with-bodied-macro-live-page-styles{box-shadow:0 0 0 1px var(--ds-border,#0b120e24)}
|
|
37
37
|
._kqswh2mm{position:relative}
|
|
38
38
|
._ks721tsb:has(.extension-container:hover) .extension-label.with-bodied-macro-live-page-styles{box-shadow:0 0 0 1px var(--ds-border,#0b120e24)}
|
|
@@ -41,6 +41,7 @@
|
|
|
41
41
|
._mi5m1wug .extension-label:hover.always-hide-label{cursor:auto}
|
|
42
42
|
._okd3ysee:has(.extension-edit-toggle-container:hover) .extension-label{background-color:var(--ds-background-accent-gray-subtlest,#f0f1f2)}
|
|
43
43
|
._pjh31hrf [data-native-embed-card-wrapper=true]{animation-fill-mode:both}
|
|
44
|
+
._tw1z1t97{interpolate-size:allow-keywords}
|
|
44
45
|
._x3ro1j9a .extension-label:hover.with-bodied-macro-live-page-styles{background-color:var(--ds-background-input,#fff)}
|
|
45
46
|
._xajsynbm:has(.extension-label:hover) .extension-container{box-shadow:0 0 0 1px var(--ds-border-input,#8c8f97)}
|
|
46
47
|
._y7o7idpf:has(.extension-edit-toggle-container:hover) .extension-label.always-hide-label{opacity:0}
|
|
@@ -49,5 +50,5 @@
|
|
|
49
50
|
._1ql7tlke .extension-label:hover{cursor:pointer}
|
|
50
51
|
._1tmrkb7n .extension-label:hover{opacity:1}
|
|
51
52
|
._dmn9ysee .extension-label:hover{background-color:var(--ds-background-accent-gray-subtlest,#f0f1f2)}
|
|
52
|
-
@keyframes
|
|
53
|
+
@keyframes k1gqx0zb{0%{height:0}to{height:auto}}
|
|
53
54
|
@media (prefers-reduced-motion:reduce){._2hwzru3m{animation-duration:0s}._dxfxru3m [data-native-embed-card-wrapper=true]{animation-duration:0s}._log5ru3m iframe:not([data-native-embed-card-wrapper=true] iframe){animation-duration:0s}._1pz3ru3m [data-native-embed-card-wrapper=true]{animation-delay:0s}._9hrrru3m iframe:not([data-native-embed-card-wrapper=true] iframe){animation-delay:0s}}
|
|
@@ -20,8 +20,7 @@ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r
|
|
|
20
20
|
* 1. `collapsed` — clipped to zero height and `inert`. The embed loads behind it, full size but
|
|
21
21
|
* unseen, with its own loading overlay hidden.
|
|
22
22
|
* 2. `useNativeEmbedSettled` calls back once the embed has finished loading.
|
|
23
|
-
* 3. `revealing` — the
|
|
24
|
-
* open (400ms).
|
|
23
|
+
* 3. `revealing` — the node animates open to its content height (400ms).
|
|
25
24
|
* 4. The embed fades in (200ms), delayed so it follows the opening instead of overlapping it.
|
|
26
25
|
* 5. `open` — on `animationend`, when the content first becomes visible, `inert` is dropped.
|
|
27
26
|
*
|
|
@@ -39,22 +38,13 @@ var READY_TIMEOUT_MS = 30000;
|
|
|
39
38
|
|
|
40
39
|
/** For when no `animationend` arrives. Must exceed the reveal. */
|
|
41
40
|
var REVEAL_TIMEOUT_MS = 1000;
|
|
42
|
-
|
|
43
|
-
/** Set inline from the measured content height just before the animation runs. */
|
|
44
|
-
var REVEAL_HEIGHT_VARIABLE = '--extension-reveal-height';
|
|
45
41
|
var relativeStyles = null;
|
|
46
42
|
|
|
47
43
|
// Mirrors the default span's hover chrome in `ExtensionNodeWrapper`; keep the two in step.
|
|
48
44
|
var hoverStyles = null;
|
|
49
|
-
|
|
50
|
-
/**
|
|
51
|
-
* Animates `max-height`, so the rendered height is `min(content, max-height)` and overshooting is
|
|
52
|
-
* harmless — the measurement is taken before the embed has settled on its size. A measurement is
|
|
53
|
-
* needed because the embed writes a definite inline `height` onto `.extension-container`.
|
|
54
|
-
*/
|
|
55
45
|
var openHeight = null;
|
|
56
46
|
|
|
57
|
-
// `display: block` because `overflow` and `
|
|
47
|
+
// `display: block` because `overflow` and `height` do not apply to an inline span.
|
|
58
48
|
var clippedStyles = null;
|
|
59
49
|
|
|
60
50
|
/**
|
|
@@ -87,19 +77,17 @@ var GeneratedContentReveal = exports.GeneratedContentReveal = function Generated
|
|
|
87
77
|
setState = _useState4[1];
|
|
88
78
|
|
|
89
79
|
// Only a collapsed node opens, so whichever of the readiness signal and the fail-safe timer
|
|
90
|
-
// comes second changes nothing.
|
|
80
|
+
// comes second changes nothing.
|
|
91
81
|
var startRevealing = (0, _react.useCallback)(function () {
|
|
92
|
-
// The clipped wrapper's `scrollHeight` is the height its content wants.
|
|
93
|
-
wrapperElement === null || wrapperElement === void 0 || wrapperElement.style.setProperty(REVEAL_HEIGHT_VARIABLE, "".concat(wrapperElement.scrollHeight, "px"));
|
|
94
82
|
setState(function (current) {
|
|
95
83
|
return current === 'collapsed' ? 'revealing' : current;
|
|
96
84
|
});
|
|
97
|
-
}, [
|
|
85
|
+
}, []);
|
|
98
86
|
|
|
99
87
|
// Step 2 → 3.
|
|
100
88
|
(0, _useNativeEmbedSettled.useNativeEmbedSettled)(wrapperElement, startRevealing);
|
|
101
89
|
|
|
102
|
-
//
|
|
90
|
+
// One timer, set on mount, so the deadline never moves.
|
|
103
91
|
(0, _react.useEffect)(function () {
|
|
104
92
|
var timer = setTimeout(startRevealing, READY_TIMEOUT_MS);
|
|
105
93
|
return function () {
|
|
@@ -137,10 +125,7 @@ var GeneratedContentReveal = exports.GeneratedContentReveal = function Generated
|
|
|
137
125
|
ref: setWrapperElement
|
|
138
126
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- the block controls and the SSR cleanup find the wrapper by `span.relative`
|
|
139
127
|
,
|
|
140
|
-
className: (0, _runtime.ax)(["_1tr2ynbm _xajsynbm _1tmrkb7n _bcikkb7n _2z44kb7n _dmn9ysee _1ghxysee _okd3ysee _1er3glyw _d1oeglyw _15k3glyw _1ql7tlke _1nuetlke _decvtlke _1fdfidpf _1pfgidpf _y7o7idpf _mi5m1wug _1si41wug _17sh1wug _x3ro1j9a _1i8c1j9a _1a2e1j9a _26lx1tsb _ks721tsb _jl0d1tsb _1qac1nu9 _54r11nu9 _1vs61nu9 _10pdkb7n _1kr5kb7n _10t9kb7n", showMacroInteractionDesignUpdates && "_kqswh2mm", state !== 'open' && "_1reo15vq _18m915vq _1e0c1ule", state === 'collapsed' && "
|
|
141
|
-
onAnimationEnd: onAnimationEnd
|
|
142
|
-
style: {
|
|
143
|
-
"--_1wl3sa9": (0, _runtime.ix)("var(".concat(REVEAL_HEIGHT_VARIABLE, ")"))
|
|
144
|
-
}
|
|
128
|
+
className: (0, _runtime.ax)(["_1tr2ynbm _xajsynbm _1tmrkb7n _bcikkb7n _2z44kb7n _dmn9ysee _1ghxysee _okd3ysee _1er3glyw _d1oeglyw _15k3glyw _1ql7tlke _1nuetlke _decvtlke _1fdfidpf _1pfgidpf _y7o7idpf _mi5m1wug _1si41wug _17sh1wug _x3ro1j9a _1i8c1j9a _1a2e1j9a _26lx1tsb _ks721tsb _jl0d1tsb _1qac1nu9 _54r11nu9 _1vs61nu9 _10pdkb7n _1kr5kb7n _10t9kb7n", showMacroInteractionDesignUpdates && "_kqswh2mm", state !== 'open' && "_1reo15vq _18m915vq _1e0c1ule", state === 'collapsed' && "_4t3iidpf _114yglyw", state === 'revealing' && "", state === 'revealing' && "_tw1z1t97 _j7hq180b _5sag15uc _1pglindk _2hwzru3m", state !== 'collapsed' && "_10i01bym _9sz11bym _147ai9qs _lwlpi9qs _lbjpindk _17w9indk _1p7l15uc _1jbo15uc _pjh31hrf _gp9p1hrf _dxfxru3m _log5ru3m _1pz3ru3m _9hrrru3m", showMacroInteractionDesignUpdates ? 'relative' : undefined]),
|
|
129
|
+
onAnimationEnd: onAnimationEnd
|
|
145
130
|
}, children));
|
|
146
131
|
};
|
|
@@ -19,7 +19,7 @@ function buildMenuItem(manifest, extensionModule) {
|
|
|
19
19
|
if (!node) {
|
|
20
20
|
throw new Error("Couldn't find any action for ".concat(title, " (").concat(key, ")"));
|
|
21
21
|
}
|
|
22
|
-
return _objectSpread(_objectSpread(_objectSpread(_objectSpread({}, (0, _isExperimentEnabled.isExperimentEnabled)('platform_editor_slash_app_category_analytics') ? {
|
|
22
|
+
return _objectSpread(_objectSpread(_objectSpread(_objectSpread({}, (0, _isExperimentEnabled.isExperimentEnabled)('platform_editor_slash_app_category_analytics') || (0, _isExperimentEnabled.isExperimentEnabled)('platform_editor_slash_command') ? {
|
|
23
23
|
app: (_ref = (_extensionModule$app = extensionModule.app) !== null && _extensionModule$app !== void 0 ? _extensionModule$app : manifest.app) !== null && _ref !== void 0 ? _ref : {
|
|
24
24
|
key: manifest.key
|
|
25
25
|
}
|
|
@@ -2,76 +2,4 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.flattenList = flattenList;
|
|
7
|
-
/**
|
|
8
|
-
* Type-specific predicates that vary between regular lists and task lists.
|
|
9
|
-
*/
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* Flattens a list-like PM structure (regular list or task list) into an
|
|
13
|
-
* array of content-bearing items with computed depths.
|
|
14
|
-
*
|
|
15
|
-
* Uses `doc.nodesBetween` to walk the tree and delegates type-specific
|
|
16
|
-
* decisions to the provided predicates. The core algorithm — selection
|
|
17
|
-
* intersection, depth adjustment, index tracking — is shared.
|
|
18
|
-
*
|
|
19
|
-
* @private
|
|
20
|
-
* @deprecated Cannot represent content placed between an item's sub-lists
|
|
21
|
-
* (e.g. `li(p, ul, p, ul)`). Callers provide their own flatten that handles this.
|
|
22
|
-
*/
|
|
23
|
-
function flattenList(options, predicates) {
|
|
24
|
-
var doc = options.doc,
|
|
25
|
-
rootListStart = options.rootListStart,
|
|
26
|
-
rootListEnd = options.rootListEnd,
|
|
27
|
-
selectionFrom = options.selectionFrom,
|
|
28
|
-
selectionTo = options.selectionTo,
|
|
29
|
-
indentDelta = options.indentDelta,
|
|
30
|
-
maxDepth = options.maxDepth;
|
|
31
|
-
var isContentNode = predicates.isContentNode,
|
|
32
|
-
getSelectionBounds = predicates.getSelectionBounds,
|
|
33
|
-
getDepth = predicates.getDepth;
|
|
34
|
-
var items = [];
|
|
35
|
-
var startIndex = -1;
|
|
36
|
-
var endIndex = -1;
|
|
37
|
-
var exceedsMaxDepth = false;
|
|
38
|
-
var rootDepth = doc.resolve(rootListStart).depth;
|
|
39
|
-
doc.nodesBetween(rootListStart, rootListEnd, function (node, pos, parent) {
|
|
40
|
-
if (!isContentNode(node, parent) || parent == null) {
|
|
41
|
-
return true;
|
|
42
|
-
}
|
|
43
|
-
var _getSelectionBounds = getSelectionBounds(node, pos),
|
|
44
|
-
start = _getSelectionBounds.start,
|
|
45
|
-
end = _getSelectionBounds.end;
|
|
46
|
-
var isSelected = selectionFrom === selectionTo ? selectionFrom >= start && selectionFrom <= end : start < selectionTo && end > selectionFrom;
|
|
47
|
-
var resolvedDepth = doc.resolve(pos).depth;
|
|
48
|
-
var depth = getDepth(resolvedDepth, rootDepth) + (isSelected ? indentDelta : 0);
|
|
49
|
-
items.push({
|
|
50
|
-
node: node,
|
|
51
|
-
pos: pos,
|
|
52
|
-
depth: depth,
|
|
53
|
-
isSelected: isSelected,
|
|
54
|
-
listType: parent.type.name,
|
|
55
|
-
parentListAttrs: parent.attrs
|
|
56
|
-
});
|
|
57
|
-
if (isSelected) {
|
|
58
|
-
var index = items.length - 1;
|
|
59
|
-
if (startIndex === -1) {
|
|
60
|
-
startIndex = index;
|
|
61
|
-
}
|
|
62
|
-
endIndex = index;
|
|
63
|
-
if (maxDepth != null && depth >= maxDepth) {
|
|
64
|
-
exceedsMaxDepth = true;
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
return true;
|
|
68
|
-
});
|
|
69
|
-
if (items.length === 0 || startIndex === -1 || exceedsMaxDepth) {
|
|
70
|
-
return null;
|
|
71
|
-
}
|
|
72
|
-
return {
|
|
73
|
-
items: items,
|
|
74
|
-
startIndex: startIndex,
|
|
75
|
-
endIndex: endIndex
|
|
76
|
-
};
|
|
77
|
-
}
|
|
5
|
+
});
|
package/dist/cjs/lists/index.js
CHANGED
|
@@ -27,12 +27,6 @@ Object.defineProperty(exports, "countListItemsInSelection", {
|
|
|
27
27
|
return _countListItemsInSelection.countListItemsInSelection;
|
|
28
28
|
}
|
|
29
29
|
});
|
|
30
|
-
Object.defineProperty(exports, "flattenList", {
|
|
31
|
-
enumerable: true,
|
|
32
|
-
get: function get() {
|
|
33
|
-
return _flattenList.flattenList;
|
|
34
|
-
}
|
|
35
|
-
});
|
|
36
30
|
Object.defineProperty(exports, "getBlockMarkAttrs", {
|
|
37
31
|
enumerable: true,
|
|
38
32
|
get: function get() {
|
|
@@ -57,12 +51,6 @@ Object.defineProperty(exports, "getListItemAttributes", {
|
|
|
57
51
|
return _selection.getListItemAttributes;
|
|
58
52
|
}
|
|
59
53
|
});
|
|
60
|
-
Object.defineProperty(exports, "hasValidListIndentationLevel", {
|
|
61
|
-
enumerable: true,
|
|
62
|
-
get: function get() {
|
|
63
|
-
return _indentation.hasValidListIndentationLevel;
|
|
64
|
-
}
|
|
65
|
-
});
|
|
66
54
|
Object.defineProperty(exports, "isBulletList", {
|
|
67
55
|
enumerable: true,
|
|
68
56
|
get: function get() {
|
|
@@ -117,18 +105,6 @@ Object.defineProperty(exports, "narrowReplacementRange", {
|
|
|
117
105
|
return _narrowReplacementRange.narrowReplacementRange;
|
|
118
106
|
}
|
|
119
107
|
});
|
|
120
|
-
Object.defineProperty(exports, "normalizeListItemsSelection", {
|
|
121
|
-
enumerable: true,
|
|
122
|
-
get: function get() {
|
|
123
|
-
return _selection.normalizeListItemsSelection;
|
|
124
|
-
}
|
|
125
|
-
});
|
|
126
|
-
Object.defineProperty(exports, "processNestedTaskListsInSameLevel", {
|
|
127
|
-
enumerable: true,
|
|
128
|
-
get: function get() {
|
|
129
|
-
return _node.processNestedTaskListsInSameLevel;
|
|
130
|
-
}
|
|
131
|
-
});
|
|
132
108
|
Object.defineProperty(exports, "reconcileBlockMarkForContainerAtPos", {
|
|
133
109
|
enumerable: true,
|
|
134
110
|
get: function get() {
|
|
@@ -160,11 +136,9 @@ var _isListNodeValidContent = require("./isListNodeValidContent");
|
|
|
160
136
|
var _node = require("./node");
|
|
161
137
|
var _analytics = require("./analytics");
|
|
162
138
|
var _countListItemsInSelection = require("./countListItemsInSelection");
|
|
163
|
-
var _indentation = require("./indentation");
|
|
164
139
|
var _restoreSelection = require("./restore-selection");
|
|
165
140
|
var _buildReplacementFragment = require("./build-replacement-fragment");
|
|
166
141
|
var _narrowReplacementRange = require("./narrow-replacement-range");
|
|
167
|
-
var _flattenList = require("./flatten-list");
|
|
168
142
|
var _blockMark = require("./block-mark");
|
|
169
143
|
var _utils = require("../utils");
|
|
170
144
|
var _messages = require("./messages");
|
package/dist/cjs/lists/node.js
CHANGED
|
@@ -15,11 +15,10 @@ Object.defineProperty(exports, "isListNodeValidContent", {
|
|
|
15
15
|
return _isListNodeValidContent.isListNodeValidContent;
|
|
16
16
|
}
|
|
17
17
|
});
|
|
18
|
-
exports.
|
|
18
|
+
exports.joinSiblingLists = void 0;
|
|
19
19
|
var _utils = require("../utils");
|
|
20
20
|
var _isListNodeValidContent = require("./isListNodeValidContent");
|
|
21
21
|
var _JoinDirection = require("./JoinDirection");
|
|
22
|
-
var _wrapTaskListIntoListAbove = require("./wrapTaskListIntoListAbove");
|
|
23
22
|
var joinSiblingLists = exports.joinSiblingLists = function joinSiblingLists(_ref) {
|
|
24
23
|
var tr = _ref.tr,
|
|
25
24
|
direction = _ref.direction,
|
|
@@ -93,82 +92,6 @@ var joinSiblingLists = exports.joinSiblingLists = function joinSiblingLists(_ref
|
|
|
93
92
|
return result;
|
|
94
93
|
};
|
|
95
94
|
|
|
96
|
-
/**
|
|
97
|
-
* Returns the prosemirror position for the child at give index inside the parent node.
|
|
98
|
-
* Example: Considering doc structure as below using the function
|
|
99
|
-
* passing parent resolved position for li and index 2
|
|
100
|
-
* would return starting position of taskList
|
|
101
|
-
* DOC STRUCTURE:
|
|
102
|
-
* ol()
|
|
103
|
-
* ( li(
|
|
104
|
-
* p('text'),
|
|
105
|
-
* ul(content),
|
|
106
|
-
* taskList(),
|
|
107
|
-
* )
|
|
108
|
-
* )
|
|
109
|
-
* @param $from Starting resolved position for the parent node of the child we are looking for.
|
|
110
|
-
* @param index Index of the child node we want the position for.
|
|
111
|
-
* @returns
|
|
112
|
-
*/
|
|
113
|
-
var findStartPositionOfChildWithIndex = function findStartPositionOfChildWithIndex($from, index) {
|
|
114
|
-
var parent = $from.node();
|
|
115
|
-
var currentPos = $from.pos + 1;
|
|
116
|
-
for (var i = 0; i < index; i++) {
|
|
117
|
-
currentPos += parent.child(i).nodeSize;
|
|
118
|
-
}
|
|
119
|
-
return currentPos;
|
|
120
|
-
};
|
|
121
|
-
var findGrandParentResolvedPos = function findGrandParentResolvedPos(tr, $from) {
|
|
122
|
-
return $from.depth > 2 ? tr.doc.resolve($from.start($from.depth - 2)) : null;
|
|
123
|
-
};
|
|
124
|
-
var findNestedTaskListsIndexAtSameLevel = function findNestedTaskListsIndexAtSameLevel(tr, $from) {
|
|
125
|
-
/*
|
|
126
|
-
Currently our cursor would be inside a pargraph of a list of type numbered/bullet list,
|
|
127
|
-
we need to find the grandparent of the cursor which is the list at same level of taskList.
|
|
128
|
-
We can get the root list item(inside which various lists are being resolved before outdenting) by going one depth above that list.
|
|
129
|
-
*/
|
|
130
|
-
var nestedListResolvedPos = findGrandParentResolvedPos(tr, $from);
|
|
131
|
-
var rootListItem = nestedListResolvedPos === null || nestedListResolvedPos === void 0 ? void 0 : nestedListResolvedPos.node(nestedListResolvedPos.depth - 1);
|
|
132
|
-
var nestedTaskListsIndexes = [];
|
|
133
|
-
var rootListItemChildCount = (rootListItem === null || rootListItem === void 0 ? void 0 : rootListItem.childCount) || 0;
|
|
134
|
-
// first child of list item is always paragraph (i = 0) so we start from 1
|
|
135
|
-
for (var i = 1; i < rootListItemChildCount; i++) {
|
|
136
|
-
if ((rootListItem === null || rootListItem === void 0 ? void 0 : rootListItem.child(i).type.name) === 'taskList') {
|
|
137
|
-
nestedTaskListsIndexes.push(i);
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
return nestedTaskListsIndexes;
|
|
141
|
-
};
|
|
142
|
-
|
|
143
|
-
// eslint-disable-next-line @atlaskit/volt-strict-mode/no-multiple-exports
|
|
144
|
-
var processNestedTaskListsInSameLevel = exports.processNestedTaskListsInSameLevel = function processNestedTaskListsInSameLevel(tr) {
|
|
145
|
-
var $from = tr.selection.$from;
|
|
146
|
-
var nestedTaskListIndexes = findNestedTaskListsIndexAtSameLevel(tr, $from);
|
|
147
|
-
if (nestedTaskListIndexes.length === 0) {
|
|
148
|
-
return;
|
|
149
|
-
}
|
|
150
|
-
var nestedListResolvedPos = findGrandParentResolvedPos(tr, $from);
|
|
151
|
-
var rootListItemStart = nestedListResolvedPos === null || nestedListResolvedPos === void 0 ? void 0 : nestedListResolvedPos.start(nestedListResolvedPos.depth - 1);
|
|
152
|
-
|
|
153
|
-
/* We need not wrap the taskList present above other lists since it doesn't affect the flow. */
|
|
154
|
-
var nestedTaskListIndexesToWrap = nestedTaskListIndexes.filter(function (index) {
|
|
155
|
-
return index > 1;
|
|
156
|
-
});
|
|
157
|
-
|
|
158
|
-
/*
|
|
159
|
-
Wraps the taskLists present at each index mentioned in the nestedTaskListIndexesToWrap to the list above it.
|
|
160
|
-
After each wrap the indexes changes since two lists are being merged into one,
|
|
161
|
-
so we keep track of it and use it to access actual calculated taskList indexes.
|
|
162
|
-
*/
|
|
163
|
-
if (rootListItemStart) {
|
|
164
|
-
var taskListsFixedNested = 0;
|
|
165
|
-
nestedTaskListIndexesToWrap.forEach(function (index) {
|
|
166
|
-
(0, _wrapTaskListIntoListAbove.wrapTaskListIntoListAbove)(tr, findStartPositionOfChildWithIndex(tr.doc.resolve(rootListItemStart), index - taskListsFixedNested), findStartPositionOfChildWithIndex(tr.doc.resolve(rootListItemStart), index - 1 - taskListsFixedNested));
|
|
167
|
-
taskListsFixedNested++;
|
|
168
|
-
});
|
|
169
|
-
}
|
|
170
|
-
return;
|
|
171
|
-
};
|
|
172
95
|
// eslint-disable-next-line @atlaskit/editor/no-re-export
|
|
173
96
|
|
|
174
97
|
// eslint-disable-next-line @atlaskit/editor/no-re-export
|
|
@@ -4,14 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.moveTargetIntoList = void 0;
|
|
7
|
-
Object.defineProperty(exports, "wrapTaskListIntoListAbove", {
|
|
8
|
-
enumerable: true,
|
|
9
|
-
get: function get() {
|
|
10
|
-
return _wrapTaskListIntoListAbove.wrapTaskListIntoListAbove;
|
|
11
|
-
}
|
|
12
|
-
});
|
|
13
7
|
var _transform = require("@atlaskit/editor-prosemirror/transform");
|
|
14
|
-
var _wrapTaskListIntoListAbove = require("./wrapTaskListIntoListAbove");
|
|
15
8
|
var moveTargetIntoList = exports.moveTargetIntoList = function moveTargetIntoList(_ref) {
|
|
16
9
|
var _$target$nodeAfter;
|
|
17
10
|
var insertPosition = _ref.insertPosition,
|
|
@@ -27,5 +20,4 @@ var moveTargetIntoList = exports.moveTargetIntoList = function moveTargetIntoLis
|
|
|
27
20
|
}
|
|
28
21
|
var step = new _transform.ReplaceAroundStep(from, to, gapFrom, gapTo, $target.doc.slice(insertPosition, $target.pos), 0, true);
|
|
29
22
|
return step;
|
|
30
|
-
};
|
|
31
|
-
// eslint-disable-next-line @atlaskit/editor/no-re-export
|
|
23
|
+
};
|
|
@@ -3,14 +3,13 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
6
|
+
exports.getListItemAttributes = void 0;
|
|
7
7
|
Object.defineProperty(exports, "numberNestedLists", {
|
|
8
8
|
enumerable: true,
|
|
9
9
|
get: function get() {
|
|
10
10
|
return _numberNestedLists.numberNestedLists;
|
|
11
11
|
}
|
|
12
12
|
});
|
|
13
|
-
var _state = require("@atlaskit/editor-prosemirror/state");
|
|
14
13
|
var _utils = require("@atlaskit/editor-prosemirror/utils");
|
|
15
14
|
var _utils2 = require("../utils");
|
|
16
15
|
var _numberNestedLists = require("./numberNestedLists");
|
|
@@ -26,31 +25,5 @@ var getListItemAttributes = exports.getListItemAttributes = function getListItem
|
|
|
26
25
|
itemIndex: itemIndex
|
|
27
26
|
};
|
|
28
27
|
};
|
|
29
|
-
|
|
30
|
-
var normalizeListItemsSelection = exports.normalizeListItemsSelection = function normalizeListItemsSelection(_ref) {
|
|
31
|
-
var selection = _ref.selection,
|
|
32
|
-
doc = _ref.doc;
|
|
33
|
-
if (selection.empty) {
|
|
34
|
-
return selection;
|
|
35
|
-
}
|
|
36
|
-
var $from = selection.$from,
|
|
37
|
-
$to = selection.$to;
|
|
38
|
-
if (selection instanceof _state.NodeSelection) {
|
|
39
|
-
var _head = resolvePositionToStartOfListItem($from);
|
|
40
|
-
return new _state.TextSelection(_head, _head);
|
|
41
|
-
}
|
|
42
|
-
var head = resolvePositionToStartOfListItem($from);
|
|
43
|
-
var anchor = resolvePositionToEndOfListItem($to);
|
|
44
|
-
return new _state.TextSelection(anchor, head);
|
|
45
|
-
};
|
|
46
|
-
var resolvePositionToStartOfListItem = function resolvePositionToStartOfListItem($pos) {
|
|
47
|
-
var fromRange = $pos.blockRange($pos, _utils2.isListItemNode);
|
|
48
|
-
var fromPosition = fromRange && $pos.textOffset === 0 && fromRange.end - 1 === $pos.pos ? _state.Selection.near($pos.doc.resolve(fromRange.end + 1), 1).$from : $pos;
|
|
49
|
-
return fromPosition;
|
|
50
|
-
};
|
|
51
|
-
var resolvePositionToEndOfListItem = function resolvePositionToEndOfListItem($pos) {
|
|
52
|
-
var toRange = $pos.blockRange($pos, _utils2.isListItemNode);
|
|
53
|
-
var toPosition = toRange && $pos.textOffset === 0 && toRange.start + 1 === $pos.pos ? _state.Selection.near($pos.doc.resolve(toRange.start - 1), -1).$to : $pos;
|
|
54
|
-
return toPosition;
|
|
55
|
-
};
|
|
28
|
+
|
|
56
29
|
// eslint-disable-next-line @atlaskit/editor/no-re-export
|
|
@@ -27,7 +27,7 @@ var NETWORK_FAILURE_REGEX = /^network failure/i;
|
|
|
27
27
|
var RESIZE_OBSERVER_LOOP_REGEX = /ResizeObserver loop completed with undelivered notifications/;
|
|
28
28
|
var SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
|
|
29
29
|
var packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
|
|
30
|
-
var packageVersion = "122.
|
|
30
|
+
var packageVersion = "122.12.0";
|
|
31
31
|
var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
|
|
32
32
|
// Remove URL as it has UGC
|
|
33
33
|
// Ignored via go/ees007
|
|
@@ -8,10 +8,8 @@ exports.getNodeIdProvider = exports.NodeAnchorProvider = void 0;
|
|
|
8
8
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
9
9
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
10
10
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
11
|
-
var _fg = require("@atlaskit/platform-feature-flags/fg");
|
|
12
11
|
var _utils = require("../utils");
|
|
13
12
|
var _dynamicBitArray = require("./dynamic-bit-array");
|
|
14
|
-
var _shouldEnableLimitedMode = require("./should-enable-limited-mode");
|
|
15
13
|
// The slice of `@atlaskit/editor-plugin-limited-mode`'s state read below. Declared
|
|
16
14
|
// structurally because `editor-common` must not depend on a plugin package.
|
|
17
15
|
|
|
@@ -123,7 +121,7 @@ var nodeIdProviderMap = new WeakMap();
|
|
|
123
121
|
*/
|
|
124
122
|
var isLimitedModeEnabled = function isLimitedModeEnabled(editorView) {
|
|
125
123
|
var _limitedModePluginKey, _limitedModePluginKey2;
|
|
126
|
-
return (
|
|
124
|
+
return (_limitedModePluginKey = (_limitedModePluginKey2 = limitedModePluginKey.getState(editorView.state)) === null || _limitedModePluginKey2 === void 0 ? void 0 : _limitedModePluginKey2.documentSizeBreachesThreshold) !== null && _limitedModePluginKey !== void 0 ? _limitedModePluginKey : false;
|
|
127
125
|
};
|
|
128
126
|
|
|
129
127
|
// Get the NodeIdProvider for a specific EditorView instance.
|
|
@@ -12,7 +12,7 @@ var _surfaceRenderer = require("@atlaskit/editor-ui-control-model/surface-render
|
|
|
12
12
|
function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t.return || t.return(); } finally { if (u) throw o; } } }; }
|
|
13
13
|
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
14
14
|
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
15
|
-
var buildQuickInsertMenuModel = exports.buildQuickInsertMenuModel = function buildQuickInsertMenuModel(components, rootComponent,
|
|
15
|
+
var buildQuickInsertMenuModel = exports.buildQuickInsertMenuModel = function buildQuickInsertMenuModel(components, rootComponent, selectCategoryItems, surfaceContext) {
|
|
16
16
|
var _resolveSurface = (0, _surfaceRenderer.resolveSurface)(components, rootComponent),
|
|
17
17
|
root = _resolveSurface.root,
|
|
18
18
|
childrenMap = _resolveSurface.childrenMap,
|
|
@@ -56,11 +56,12 @@ var buildQuickInsertMenuModel = exports.buildQuickInsertMenuModel = function bui
|
|
|
56
56
|
if (items.length === 0) {
|
|
57
57
|
continue;
|
|
58
58
|
}
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
59
|
+
var selectedItems = viewMoreItem !== undefined && selectCategoryItems !== undefined ? selectCategoryItems(items) : items;
|
|
60
|
+
if (selectedItems.length < items.length && viewMoreItem !== undefined) {
|
|
61
|
+
sections.push([section].concat((0, _toConsumableArray2.default)(selectedItems), [viewMoreItem]));
|
|
62
|
+
} else {
|
|
63
|
+
sections.push([section].concat((0, _toConsumableArray2.default)(selectedItems)));
|
|
62
64
|
}
|
|
63
|
-
sections.push([section].concat((0, _toConsumableArray2.default)(items)));
|
|
64
65
|
}
|
|
65
66
|
} catch (err) {
|
|
66
67
|
_iterator.e(err);
|
|
@@ -3,7 +3,20 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.getQuickInsertProviderMenuItemKey = void 0;
|
|
7
|
-
var
|
|
8
|
-
|
|
6
|
+
exports.quickInsertProviderMenuItemKey = exports.getQuickInsertProviderMenuItemKey = void 0;
|
|
7
|
+
var QUICK_INSERT_PROVIDER_MENU_ITEM_KEY_PREFIX = 'quick-insert-provider-';
|
|
8
|
+
var ECOSYSTEM_QUICK_INSERT_PROVIDER_MENU_ITEM_KEY_PREFIX = 'quick-insert-ecosystem';
|
|
9
|
+
var getQuickInsertProviderMenuItemKey = exports.getQuickInsertProviderMenuItemKey = function getQuickInsertProviderMenuItemKey(key, app) {
|
|
10
|
+
return (app === null || app === void 0 ? void 0 : app.source) === 'ecosystem' ? "".concat(ECOSYSTEM_QUICK_INSERT_PROVIDER_MENU_ITEM_KEY_PREFIX, "-").concat(key) : "".concat(QUICK_INSERT_PROVIDER_MENU_ITEM_KEY_PREFIX).concat(key);
|
|
11
|
+
};
|
|
12
|
+
var isEcosystemQuickInsertProviderMenuItemKey = function isEcosystemQuickInsertProviderMenuItemKey(key) {
|
|
13
|
+
return key.startsWith(ECOSYSTEM_QUICK_INSERT_PROVIDER_MENU_ITEM_KEY_PREFIX);
|
|
14
|
+
};
|
|
15
|
+
var normalizeQuickInsertProviderMenuItemKey = function normalizeQuickInsertProviderMenuItemKey(key) {
|
|
16
|
+
return isEcosystemQuickInsertProviderMenuItemKey(key) ? "".concat(QUICK_INSERT_PROVIDER_MENU_ITEM_KEY_PREFIX).concat(key.slice("".concat(ECOSYSTEM_QUICK_INSERT_PROVIDER_MENU_ITEM_KEY_PREFIX, "-").length)) : key;
|
|
17
|
+
};
|
|
18
|
+
var quickInsertProviderMenuItemKey = exports.quickInsertProviderMenuItemKey = {
|
|
19
|
+
get: getQuickInsertProviderMenuItemKey,
|
|
20
|
+
isEcosystem: isEcosystemQuickInsertProviderMenuItemKey,
|
|
21
|
+
normalize: normalizeQuickInsertProviderMenuItemKey
|
|
9
22
|
};
|
|
@@ -15,5 +15,19 @@ Object.defineProperty(exports, "getMatchingQuickInsertComponents", {
|
|
|
15
15
|
return _getMatchingQuickInsertComponents.getMatchingQuickInsertComponents;
|
|
16
16
|
}
|
|
17
17
|
});
|
|
18
|
+
Object.defineProperty(exports, "quickInsertProviderMenuItemKey", {
|
|
19
|
+
enumerable: true,
|
|
20
|
+
get: function get() {
|
|
21
|
+
return _getQuickInsertProviderMenuItemKey.quickInsertProviderMenuItemKey;
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
Object.defineProperty(exports, "selectQuickInsertCategoryItems", {
|
|
25
|
+
enumerable: true,
|
|
26
|
+
get: function get() {
|
|
27
|
+
return _selectQuickInsertCategoryItems.selectQuickInsertCategoryItems;
|
|
28
|
+
}
|
|
29
|
+
});
|
|
18
30
|
var _buildQuickInsertMenuModel = require("./build-quick-insert-menu-model");
|
|
31
|
+
var _getQuickInsertProviderMenuItemKey = require("./getQuickInsertProviderMenuItemKey");
|
|
32
|
+
var _selectQuickInsertCategoryItems = require("./selectQuickInsertCategoryItems");
|
|
19
33
|
var _getMatchingQuickInsertComponents = require("./get-matching-quick-insert-components");
|