@atlaskit/editor-common 130.4.1 → 131.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 +65 -0
- package/dist/cjs/ai-messages/ai-suggestions.js +5 -0
- package/dist/cjs/element-browser/components/ElementBrowserLoader.js +31 -8
- package/dist/cjs/extensions/extension-handlers.js +164 -33
- package/dist/cjs/floating-toolbar/DropdownMenuExtensionItems.js +25 -4
- package/dist/cjs/icons/index.js +33 -10
- package/dist/cjs/monitoring/error.js +1 -1
- package/dist/cjs/quick-insert/assets/index.js +888 -257
- package/dist/cjs/quick-insert/{get-matching-quick-insert-components.js → get-quick-insert-menu-model.js} +133 -73
- package/dist/cjs/quick-insert/registered-menu-model.js +4 -11
- package/dist/cjs/ui/DropList/index.js +1 -1
- package/dist/cjs/ui/FloatingToolbar/Button.js +2 -0
- package/dist/cjs/ui/Mention/mention-with-profilecard.js +30 -11
- package/dist/cjs/utils/is-non-production-build.js +2 -6
- package/dist/es2019/ai-messages/ai-suggestions.js +5 -0
- package/dist/es2019/element-browser/components/ElementBrowserLoader.js +16 -2
- package/dist/es2019/extensions/extension-handlers.js +88 -15
- package/dist/es2019/floating-toolbar/DropdownMenuExtensionItems.js +16 -2
- package/dist/es2019/icons/index.js +17 -3
- package/dist/es2019/monitoring/error.js +1 -1
- package/dist/es2019/quick-insert/assets/index.js +386 -66
- package/dist/es2019/quick-insert/{get-matching-quick-insert-components.js → get-quick-insert-menu-model.js} +101 -54
- package/dist/es2019/quick-insert/registered-menu-model.js +2 -3
- package/dist/es2019/ui/DropList/index.js +1 -1
- package/dist/es2019/ui/FloatingToolbar/Button.js +2 -0
- package/dist/es2019/ui/Mention/mention-with-profilecard.js +15 -4
- package/dist/es2019/utils/is-non-production-build.js +2 -6
- package/dist/esm/ai-messages/ai-suggestions.js +5 -0
- package/dist/esm/element-browser/components/ElementBrowserLoader.js +28 -6
- package/dist/esm/extensions/extension-handlers.js +165 -33
- package/dist/esm/floating-toolbar/DropdownMenuExtensionItems.js +24 -4
- package/dist/esm/icons/index.js +29 -7
- package/dist/esm/monitoring/error.js +1 -1
- package/dist/esm/quick-insert/assets/index.js +764 -194
- package/dist/esm/quick-insert/{get-matching-quick-insert-components.js → get-quick-insert-menu-model.js} +132 -72
- package/dist/esm/quick-insert/registered-menu-model.js +2 -3
- package/dist/esm/ui/DropList/index.js +1 -1
- package/dist/esm/ui/FloatingToolbar/Button.js +2 -0
- package/dist/esm/ui/Mention/mention-with-profilecard.js +25 -8
- package/dist/esm/utils/is-non-production-build.js +2 -6
- package/dist/types/ai-messages/ai-suggestions.d.ts +5 -0
- package/dist/types/icons/index.d.ts +5 -3
- package/dist/types/quick-insert/assets/index.d.ts +34 -32
- package/dist/types/quick-insert/{build-quick-insert-menu-model.d.ts → get-quick-insert-menu-model.d.ts} +14 -1
- package/dist/types/quick-insert/getQuickInsertMenuRows.d.ts +1 -1
- package/dist/types/quick-insert/registered-menu-model.d.ts +2 -3
- package/dist/types/ui/FloatingToolbar/Button.d.ts +3 -2
- package/dist/types/utils/is-non-production-build.d.ts +2 -2
- package/package.json +5 -4
- package/dist/cjs/quick-insert/build-quick-insert-menu-model.js +0 -78
- package/dist/es2019/quick-insert/build-quick-insert-menu-model.js +0 -55
- package/dist/esm/quick-insert/build-quick-insert-menu-model.js +0 -71
- package/dist/types/quick-insert/get-matching-quick-insert-components.d.ts +0 -17
|
@@ -1,4 +1,7 @@
|
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
1
2
|
import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
3
|
+
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; }
|
|
4
|
+
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; }
|
|
2
5
|
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; } } }; }
|
|
3
6
|
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; } }
|
|
4
7
|
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; }
|
|
@@ -35,51 +38,74 @@ var getSearchResults = function getSearchResults(matches) {
|
|
|
35
38
|
return item;
|
|
36
39
|
});
|
|
37
40
|
};
|
|
38
|
-
|
|
39
|
-
/**
|
|
40
|
-
* Resolves registered menu items for a non-empty query. This intentionally has
|
|
41
|
-
* no empty-query path so browse behavior remains owned by buildQuickInsertMenuModel.
|
|
42
|
-
*/
|
|
43
|
-
export var getMatchingQuickInsertComponents = function getMatchingQuickInsertComponents(_ref4) {
|
|
41
|
+
var getRenderedMenuItems = function getRenderedMenuItems(section, childrenMap, surfaceContext) {
|
|
44
42
|
var _childrenMap$get;
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
if (!root || !willComponentRender(root, childrenMap, surfaceContext) || !topLevelChildren) {
|
|
57
|
-
return {
|
|
58
|
-
footer: undefined,
|
|
59
|
-
root: undefined,
|
|
60
|
-
sections: []
|
|
61
|
-
};
|
|
62
|
-
}
|
|
63
|
-
var matches = new Map();
|
|
64
|
-
var sourceIndexByComponent = new Map(rankedComponents.map(function (component, index) {
|
|
65
|
-
return [component, index];
|
|
66
|
-
}));
|
|
67
|
-
var _iterator = _createForOfIteratorHelper(topLevelChildren),
|
|
43
|
+
return ((_childrenMap$get = childrenMap.get(getComponentIdentity(section))) !== null && _childrenMap$get !== void 0 ? _childrenMap$get : []).filter(function (child) {
|
|
44
|
+
return child.type === 'menu-item' && willComponentRender(child, childrenMap, surfaceContext);
|
|
45
|
+
});
|
|
46
|
+
};
|
|
47
|
+
var buildBrowseSections = function buildBrowseSections(_ref4) {
|
|
48
|
+
var childrenMap = _ref4.childrenMap,
|
|
49
|
+
contentSections = _ref4.contentSections,
|
|
50
|
+
selectCategoryItems = _ref4.selectCategoryItems,
|
|
51
|
+
surfaceContext = _ref4.surfaceContext;
|
|
52
|
+
var sections = [];
|
|
53
|
+
var _iterator = _createForOfIteratorHelper(contentSections),
|
|
68
54
|
_step;
|
|
69
55
|
try {
|
|
70
56
|
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
71
|
-
var _childrenMap$get3;
|
|
72
57
|
var section = _step.value;
|
|
73
|
-
|
|
58
|
+
var children = getRenderedMenuItems(section, childrenMap, surfaceContext);
|
|
59
|
+
var overflowItems = children.filter(function (child) {
|
|
60
|
+
return isSectionOverflowItemKey(child.key);
|
|
61
|
+
});
|
|
62
|
+
var viewMoreItem = overflowItems[overflowItems.length - 1];
|
|
63
|
+
var items = children.filter(function (child) {
|
|
64
|
+
return !isSectionOverflowItemKey(child.key);
|
|
65
|
+
});
|
|
66
|
+
if (items.length === 0) {
|
|
74
67
|
continue;
|
|
75
68
|
}
|
|
76
|
-
var
|
|
77
|
-
|
|
69
|
+
var selectedItems = viewMoreItem !== undefined && selectCategoryItems !== undefined ? selectCategoryItems(items) : items;
|
|
70
|
+
if (selectedItems.length < items.length && viewMoreItem !== undefined) {
|
|
71
|
+
sections.push([section].concat(_toConsumableArray(selectedItems), [viewMoreItem]));
|
|
72
|
+
} else {
|
|
73
|
+
sections.push([section].concat(_toConsumableArray(selectedItems)));
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
} catch (err) {
|
|
77
|
+
_iterator.e(err);
|
|
78
|
+
} finally {
|
|
79
|
+
_iterator.f();
|
|
80
|
+
}
|
|
81
|
+
return {
|
|
82
|
+
sections: sections
|
|
83
|
+
};
|
|
84
|
+
};
|
|
85
|
+
var buildSearchSections = function buildSearchSections(_ref5) {
|
|
86
|
+
var childrenMap = _ref5.childrenMap,
|
|
87
|
+
components = _ref5.components,
|
|
88
|
+
contentSections = _ref5.contentSections,
|
|
89
|
+
formatMessage = _ref5.formatMessage,
|
|
90
|
+
query = _ref5.query,
|
|
91
|
+
root = _ref5.root,
|
|
92
|
+
surfaceContext = _ref5.surfaceContext;
|
|
93
|
+
var matches = new Map();
|
|
94
|
+
var sourceIndexByComponent = new Map(components.map(function (component, index) {
|
|
95
|
+
return [component, index];
|
|
96
|
+
}));
|
|
97
|
+
var _iterator2 = _createForOfIteratorHelper(contentSections),
|
|
98
|
+
_step2;
|
|
99
|
+
try {
|
|
100
|
+
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
101
|
+
var section = _step2.value;
|
|
102
|
+
var _iterator4 = _createForOfIteratorHelper(getRenderedMenuItems(section, childrenMap, surfaceContext)),
|
|
103
|
+
_step4;
|
|
78
104
|
try {
|
|
79
|
-
for (
|
|
105
|
+
for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {
|
|
80
106
|
var _item$match, _match$score, _sourceIndexByCompone;
|
|
81
|
-
var item =
|
|
82
|
-
if (
|
|
107
|
+
var item = _step4.value;
|
|
108
|
+
if (isSectionOverflowItemKey(item.key)) {
|
|
83
109
|
continue;
|
|
84
110
|
}
|
|
85
111
|
var match = (_item$match = item.match) === null || _item$match === void 0 ? void 0 : _item$match.call(item, {
|
|
@@ -104,24 +130,24 @@ export var getMatchingQuickInsertComponents = function getMatchingQuickInsertCom
|
|
|
104
130
|
}
|
|
105
131
|
}
|
|
106
132
|
} catch (err) {
|
|
107
|
-
|
|
133
|
+
_iterator4.e(err);
|
|
108
134
|
} finally {
|
|
109
|
-
|
|
135
|
+
_iterator4.f();
|
|
110
136
|
}
|
|
111
137
|
}
|
|
112
138
|
} catch (err) {
|
|
113
|
-
|
|
139
|
+
_iterator2.e(err);
|
|
114
140
|
} finally {
|
|
115
|
-
|
|
141
|
+
_iterator2.f();
|
|
116
142
|
}
|
|
117
143
|
var uniqueMatches = Array.from(matches.values()).sort(compareMatchedItems);
|
|
118
|
-
var searchResults =
|
|
144
|
+
var searchResults = getSearchResults(uniqueMatches);
|
|
119
145
|
var sectionsByKey = new Map();
|
|
120
|
-
var
|
|
121
|
-
|
|
146
|
+
var _iterator3 = _createForOfIteratorHelper(uniqueMatches),
|
|
147
|
+
_step3;
|
|
122
148
|
try {
|
|
123
|
-
for (
|
|
124
|
-
var _match =
|
|
149
|
+
for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
|
|
150
|
+
var _match = _step3.value;
|
|
125
151
|
var _existing = sectionsByKey.get(_match.section.key);
|
|
126
152
|
if (_existing) {
|
|
127
153
|
_existing.push(_match.item);
|
|
@@ -130,49 +156,83 @@ export var getMatchingQuickInsertComponents = function getMatchingQuickInsertCom
|
|
|
130
156
|
}
|
|
131
157
|
}
|
|
132
158
|
} catch (err) {
|
|
133
|
-
|
|
159
|
+
_iterator3.e(err);
|
|
134
160
|
} finally {
|
|
135
|
-
|
|
161
|
+
_iterator3.f();
|
|
136
162
|
}
|
|
137
163
|
var sections = Array.from(sectionsByKey.values());
|
|
138
|
-
// An empty query is browse mode: `buildQuickInsertMenuModel` supplies the footer there,
|
|
139
|
-
// so this search model must not add a second one.
|
|
140
|
-
if (query === '') {
|
|
141
|
-
return {
|
|
142
|
-
footer: undefined,
|
|
143
|
-
root: root,
|
|
144
|
-
searchResults: searchResults,
|
|
145
|
-
sections: sections
|
|
146
|
-
};
|
|
147
|
-
}
|
|
148
|
-
var footerSection = topLevelChildren.find(function (section) {
|
|
149
|
-
return section.type === 'menu-section' && isMenuFooterSectionKey(section.key) && willComponentRender(section, childrenMap, surfaceContext);
|
|
150
|
-
});
|
|
151
|
-
var footer = footerSection ? ((_childrenMap$get = childrenMap.get(getComponentIdentity(footerSection))) !== null && _childrenMap$get !== void 0 ? _childrenMap$get : []).find(function (child) {
|
|
152
|
-
return child.type === 'menu-item' && willComponentRender(child, childrenMap, surfaceContext);
|
|
153
|
-
}) : undefined;
|
|
154
164
|
if (sections.length > 0) {
|
|
155
165
|
return {
|
|
156
|
-
footer: footer,
|
|
157
|
-
root: root,
|
|
158
166
|
searchResults: searchResults,
|
|
159
167
|
sections: sections
|
|
160
168
|
};
|
|
161
169
|
}
|
|
162
|
-
var fallbackItem =
|
|
163
|
-
return section.type === 'menu-section' && !isMenuFooterSectionKey(section.key) && willComponentRender(section, childrenMap, surfaceContext);
|
|
164
|
-
}).flatMap(function (section) {
|
|
170
|
+
var fallbackItem = contentSections.flatMap(function (section) {
|
|
165
171
|
var _childrenMap$get2;
|
|
166
172
|
return (_childrenMap$get2 = childrenMap.get(getComponentIdentity(section))) !== null && _childrenMap$get2 !== void 0 ? _childrenMap$get2 : [];
|
|
167
173
|
}).find(function (component) {
|
|
168
174
|
return component.type === ASK_ROVO_MENU_ITEM.type && component.key === ASK_ROVO_MENU_ITEM.key && willComponentRender(component, childrenMap, surfaceContext);
|
|
169
175
|
});
|
|
170
|
-
var fallbackItems = fallbackItem ? [fallbackItem] : [];
|
|
171
176
|
return {
|
|
172
|
-
fallbackItems:
|
|
173
|
-
footer: footer,
|
|
174
|
-
root: root,
|
|
177
|
+
fallbackItems: fallbackItem ? [fallbackItem] : [],
|
|
175
178
|
searchResults: searchResults,
|
|
176
179
|
sections: sections
|
|
177
180
|
};
|
|
181
|
+
};
|
|
182
|
+
|
|
183
|
+
/**
|
|
184
|
+
* Builds the registered quick-insert menu model. An empty query browses every
|
|
185
|
+
* category; a non-empty query returns ranked matches. The footer is shared by both.
|
|
186
|
+
*/
|
|
187
|
+
export var getQuickInsertMenuModel = function getQuickInsertMenuModel(_ref6) {
|
|
188
|
+
var components = _ref6.components,
|
|
189
|
+
formatMessage = _ref6.formatMessage,
|
|
190
|
+
getItemRank = _ref6.getItemRank,
|
|
191
|
+
query = _ref6.query,
|
|
192
|
+
rootComponent = _ref6.rootComponent,
|
|
193
|
+
selectCategoryItems = _ref6.selectCategoryItems,
|
|
194
|
+
surfaceContext = _ref6.surfaceContext;
|
|
195
|
+
var rankedComponents = applyRegisteredItemRanks(components, getItemRank);
|
|
196
|
+
var _resolveSurface = resolveSurface(rankedComponents, rootComponent),
|
|
197
|
+
childrenMap = _resolveSurface.childrenMap,
|
|
198
|
+
root = _resolveSurface.root,
|
|
199
|
+
_resolveSurface$topLe = _resolveSurface.topLevelChildren,
|
|
200
|
+
topLevelChildren = _resolveSurface$topLe === void 0 ? [] : _resolveSurface$topLe;
|
|
201
|
+
if (!root || !willComponentRender(root, childrenMap, surfaceContext)) {
|
|
202
|
+
return {
|
|
203
|
+
footer: undefined,
|
|
204
|
+
root: undefined,
|
|
205
|
+
sections: []
|
|
206
|
+
};
|
|
207
|
+
}
|
|
208
|
+
var renderedSections = topLevelChildren.filter(function (section) {
|
|
209
|
+
return section.type === 'menu-section' && willComponentRender(section, childrenMap, surfaceContext);
|
|
210
|
+
});
|
|
211
|
+
var footerSection = renderedSections.find(function (_ref7) {
|
|
212
|
+
var key = _ref7.key;
|
|
213
|
+
return isMenuFooterSectionKey(key);
|
|
214
|
+
});
|
|
215
|
+
var contentSections = renderedSections.filter(function (_ref8) {
|
|
216
|
+
var key = _ref8.key;
|
|
217
|
+
return !isMenuFooterSectionKey(key);
|
|
218
|
+
});
|
|
219
|
+
var content = query === '' ? buildBrowseSections({
|
|
220
|
+
childrenMap: childrenMap,
|
|
221
|
+
contentSections: contentSections,
|
|
222
|
+
selectCategoryItems: selectCategoryItems,
|
|
223
|
+
surfaceContext: surfaceContext
|
|
224
|
+
}) : buildSearchSections({
|
|
225
|
+
childrenMap: childrenMap,
|
|
226
|
+
components: rankedComponents,
|
|
227
|
+
contentSections: contentSections,
|
|
228
|
+
formatMessage: formatMessage,
|
|
229
|
+
query: query,
|
|
230
|
+
root: root,
|
|
231
|
+
surfaceContext: surfaceContext
|
|
232
|
+
});
|
|
233
|
+
var footer = footerSection ? getRenderedMenuItems(footerSection, childrenMap, surfaceContext)[0] : undefined;
|
|
234
|
+
return _objectSpread(_objectSpread({}, content), {}, {
|
|
235
|
+
footer: footer,
|
|
236
|
+
root: root
|
|
237
|
+
});
|
|
178
238
|
};
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
/* eslint-disable @atlaskit/editor/no-re-export */
|
|
2
2
|
|
|
3
|
-
export {
|
|
3
|
+
export { getQuickInsertMenuModel } from './get-quick-insert-menu-model';
|
|
4
4
|
export { getQuickInsertMenuRows } from './getQuickInsertMenuRows';
|
|
5
5
|
export { quickInsertProviderMenuItemKey } from './getQuickInsertProviderMenuItemKey';
|
|
6
|
-
export { selectQuickInsertCategoryItems } from './selectQuickInsertCategoryItems';
|
|
7
|
-
export { getMatchingQuickInsertComponents } from './get-matching-quick-insert-components';
|
|
6
|
+
export { selectQuickInsertCategoryItems } from './selectQuickInsertCategoryItems';
|
|
@@ -21,7 +21,7 @@ import withAnalyticsEvents from '@atlaskit/analytics-next/withAnalyticsEvents';
|
|
|
21
21
|
import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
22
22
|
import Layer from '../Layer';
|
|
23
23
|
var packageName = "@atlaskit/editor-common";
|
|
24
|
-
var packageVersion = "
|
|
24
|
+
var packageVersion = "131.0.0";
|
|
25
25
|
var halfFocusRing = 1;
|
|
26
26
|
var dropOffset = '0, 8';
|
|
27
27
|
var fadeIn = keyframes({
|
|
@@ -46,6 +46,7 @@ var FloatingToolbarButton = function FloatingToolbarButton(_ref, forwardedRef) {
|
|
|
46
46
|
areaControls = _ref.areaControls,
|
|
47
47
|
ariaLabel = _ref.ariaLabel,
|
|
48
48
|
isRadioButton = _ref.isRadioButton,
|
|
49
|
+
isLoading = _ref.isLoading,
|
|
49
50
|
pulse = _ref.pulse,
|
|
50
51
|
areAnyNewToolbarFlagsEnabled = _ref.areAnyNewToolbarFlagsEnabled;
|
|
51
52
|
// Check if there's only an icon and add additional styles
|
|
@@ -125,6 +126,7 @@ var FloatingToolbarButton = function FloatingToolbarButton(_ref, forwardedRef) {
|
|
|
125
126
|
onKeyDown: onKeyDown,
|
|
126
127
|
isSelected: selected,
|
|
127
128
|
isDisabled: disabled,
|
|
129
|
+
isLoading: isLoading,
|
|
128
130
|
testId: testId,
|
|
129
131
|
interactionName: interactionName,
|
|
130
132
|
onMouseEnter: expValEquals('editor_a11y__enghealth-46814_fy26', 'isEnabled', true) ? onMouseEnter : undefined,
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import React, { useMemo } from 'react';
|
|
2
2
|
import Loadable from 'react-loadable';
|
|
3
|
+
// oxlint-disable-next-line @atlassian/no-restricted-imports
|
|
4
|
+
import { lazy, LazySuspense } from 'react-loosely-lazy';
|
|
3
5
|
import ResourcedMention from '@atlaskit/mention/resourced-mention';
|
|
4
6
|
import { isExperimentEnabled } from '@atlaskit/platform-feature-experiments/is-experiment-enabled';
|
|
5
7
|
import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
@@ -11,18 +13,33 @@ import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
|
11
13
|
// Lazy-loaded so the agent profile card chunk (and its `@atlaskit/rovo-agent-components`
|
|
12
14
|
// dependency) stays off the critical path — it is only fetched when an agent mention
|
|
13
15
|
// (`userType === 'APP'`) actually renders, never for person mentions.
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
return
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
16
|
+
var loadAgentProfileCardTrigger = function loadAgentProfileCardTrigger() {
|
|
17
|
+
return import( /* webpackChunkName: "@atlaskit-internal_profilecard/agent-profile-card-trigger" */
|
|
18
|
+
'@atlaskit/profilecard/agent-profile-card-trigger').then(function (mod) {
|
|
19
|
+
return mod.AgentProfileCardTrigger;
|
|
20
|
+
});
|
|
21
|
+
};
|
|
22
|
+
var AgentProfileCardTriggerLazy = lazy(function () {
|
|
23
|
+
return import( /* webpackChunkName: "@atlaskit-internal_profilecard/agent-profile-card-trigger" */
|
|
24
|
+
'@atlaskit/profilecard/agent-profile-card-trigger').then(function (mod) {
|
|
25
|
+
return mod.AgentProfileCardTrigger;
|
|
26
|
+
});
|
|
27
|
+
});
|
|
28
|
+
AgentProfileCardTriggerLazy.displayName = 'lazy(AgentProfileCardTrigger)';
|
|
29
|
+
var AgentProfileCardTriggerLoadable = Loadable({
|
|
30
|
+
loader: loadAgentProfileCardTrigger,
|
|
22
31
|
loading: function loading() {
|
|
23
32
|
return null;
|
|
24
33
|
}
|
|
25
34
|
});
|
|
35
|
+
var AgentProfileCardTrigger = function AgentProfileCardTrigger(props) {
|
|
36
|
+
return isExperimentEnabled('platform_editor_loosely_lazy_migration') ? /*#__PURE__*/React.createElement(LazySuspense, {
|
|
37
|
+
fallback: null
|
|
38
|
+
}, /*#__PURE__*/React.createElement(AgentProfileCardTriggerLazy, props)) :
|
|
39
|
+
/*#__PURE__*/
|
|
40
|
+
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
41
|
+
React.createElement(AgentProfileCardTriggerLoadable, props);
|
|
42
|
+
};
|
|
26
43
|
|
|
27
44
|
// Ignored via go/ees005
|
|
28
45
|
// eslint-disable-next-line require-unicode-regexp
|
|
@@ -1,13 +1,9 @@
|
|
|
1
|
-
import { isExperimentEnabled } from '@atlaskit/platform-feature-experiments/is-experiment-enabled';
|
|
2
1
|
/**
|
|
3
|
-
* Adds a product-owned build classification
|
|
4
|
-
* A classifier callback is
|
|
2
|
+
* Adds a product-owned build classification to analytics attributes.
|
|
3
|
+
* A classifier callback is evaluated lazily, so the caller controls when browser reads happen.
|
|
5
4
|
* An unknown classification is omitted; an explicit false is preserved.
|
|
6
5
|
*/
|
|
7
6
|
export var getNonProductionBuildAnalyticsAttributes = function getNonProductionBuildAnalyticsAttributes(classification) {
|
|
8
|
-
if (!isExperimentEnabled('platform_editor_non_production_build_analytics')) {
|
|
9
|
-
return {};
|
|
10
|
-
}
|
|
11
7
|
var isNonProductionBuild = typeof classification === 'function' ? classification() : classification;
|
|
12
8
|
return isNonProductionBuild !== undefined ? {
|
|
13
9
|
isNonProductionBuild: isNonProductionBuild
|
|
@@ -393,6 +393,11 @@ export declare const aiSuggestionsMessages: {
|
|
|
393
393
|
description: string;
|
|
394
394
|
id: string;
|
|
395
395
|
};
|
|
396
|
+
thinkingPreparingAgent: {
|
|
397
|
+
defaultMessage: string;
|
|
398
|
+
description: string;
|
|
399
|
+
id: string;
|
|
400
|
+
};
|
|
396
401
|
thinkingPreparingSuggestions: {
|
|
397
402
|
defaultMessage: string;
|
|
398
403
|
description: string;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import
|
|
2
|
-
import Loadable from 'react-loadable';
|
|
1
|
+
import React from 'react';
|
|
3
2
|
import type { IconProps } from '../types';
|
|
4
3
|
export { PanelInfoIcon } from './shared/PanelInfoIcon';
|
|
5
4
|
export { PanelWarningIcon } from './shared/PanelWarningIcon';
|
|
@@ -9,4 +8,7 @@ export { PanelNoteIcon } from './shared/PanelNoteIcon';
|
|
|
9
8
|
export { BorderIcon } from './shared/BorderIcon';
|
|
10
9
|
export { SteppedRainbowIconDecoration, rainbow, disabledRainbow, } from './shared/SteppedRainbowIconDecoration';
|
|
11
10
|
export { DynamicStrokeIconDecoration } from './shared/DynamicStrokeIconDecoration';
|
|
12
|
-
export declare const IconTable:
|
|
11
|
+
export declare const IconTable: {
|
|
12
|
+
(props: React.PropsWithChildren<IconProps>): React.ReactElement;
|
|
13
|
+
preload: () => void;
|
|
14
|
+
};
|
|
@@ -1,39 +1,41 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import Loadable from 'react-loadable';
|
|
3
2
|
import type { HeadingLevels, IconProps } from '../../types';
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
export declare const
|
|
8
|
-
export declare const
|
|
9
|
-
export declare const
|
|
10
|
-
export declare const
|
|
11
|
-
export declare const
|
|
12
|
-
export declare const
|
|
13
|
-
export declare const
|
|
14
|
-
export declare const
|
|
15
|
-
export declare const
|
|
16
|
-
export declare const
|
|
17
|
-
export declare const
|
|
18
|
-
export declare const
|
|
19
|
-
export declare const
|
|
20
|
-
export declare const
|
|
21
|
-
export declare const
|
|
22
|
-
export declare const
|
|
23
|
-
export declare const
|
|
24
|
-
export declare const
|
|
25
|
-
export declare const
|
|
26
|
-
export declare const
|
|
27
|
-
export declare const
|
|
3
|
+
type PreloadableComponent<Props extends object> = React.ComponentType<Props> & {
|
|
4
|
+
preload: () => unknown;
|
|
5
|
+
};
|
|
6
|
+
export declare const IconAction: PreloadableComponent<React.PropsWithChildren<IconProps>>;
|
|
7
|
+
export declare const IconCode: PreloadableComponent<React.PropsWithChildren<IconProps>>;
|
|
8
|
+
export declare const IconDate: PreloadableComponent<React.PropsWithChildren<IconProps>>;
|
|
9
|
+
export declare const IconDecision: PreloadableComponent<React.PropsWithChildren<IconProps>>;
|
|
10
|
+
export declare const IconDivider: PreloadableComponent<React.PropsWithChildren<IconProps>>;
|
|
11
|
+
export declare const IconEmoji: PreloadableComponent<React.PropsWithChildren<IconProps>>;
|
|
12
|
+
export declare const IconImages: PreloadableComponent<React.PropsWithChildren<IconProps>>;
|
|
13
|
+
export declare const IconLayout: PreloadableComponent<React.PropsWithChildren<IconProps>>;
|
|
14
|
+
export declare const IconLink: PreloadableComponent<React.PropsWithChildren<IconProps>>;
|
|
15
|
+
export declare const IconListNumber: PreloadableComponent<React.PropsWithChildren<IconProps>>;
|
|
16
|
+
export declare const IconList: PreloadableComponent<React.PropsWithChildren<IconProps>>;
|
|
17
|
+
export declare const IconMention: PreloadableComponent<React.PropsWithChildren<IconProps>>;
|
|
18
|
+
export declare const IconPanelError: PreloadableComponent<React.PropsWithChildren<IconProps>>;
|
|
19
|
+
export declare const IconPanelNote: PreloadableComponent<React.PropsWithChildren<IconProps>>;
|
|
20
|
+
export declare const IconPanelSuccess: PreloadableComponent<React.PropsWithChildren<IconProps>>;
|
|
21
|
+
export declare const IconPanelWarning: PreloadableComponent<React.PropsWithChildren<IconProps>>;
|
|
22
|
+
export declare const IconPanel: PreloadableComponent<React.PropsWithChildren<IconProps>>;
|
|
23
|
+
export declare const IconQuote: PreloadableComponent<React.PropsWithChildren<IconProps>>;
|
|
24
|
+
export declare const IconStatus: PreloadableComponent<React.PropsWithChildren<IconProps>>;
|
|
25
|
+
export declare const IconOneColumnLayout: PreloadableComponent<React.PropsWithChildren<IconProps>>;
|
|
26
|
+
export declare const IconTwoColumnLayout: PreloadableComponent<React.PropsWithChildren<IconProps>>;
|
|
27
|
+
export declare const IconThreeColumnLayout: PreloadableComponent<React.PropsWithChildren<IconProps>>;
|
|
28
|
+
export declare const IconFourColumnLayout: PreloadableComponent<React.PropsWithChildren<IconProps>>;
|
|
29
|
+
export declare const IconFiveColumnLayout: PreloadableComponent<React.PropsWithChildren<IconProps>>;
|
|
28
30
|
type HeadingProps = IconProps & {
|
|
29
31
|
level: HeadingLevels;
|
|
30
32
|
};
|
|
31
33
|
export declare const IconHeading: ({ level, label, }: Pick<HeadingProps, 'level' | 'label'>) => React.JSX.Element;
|
|
32
|
-
export declare const IconFeedback:
|
|
33
|
-
export declare const IconExpand:
|
|
34
|
-
export declare const IconDatasourceJiraIssue:
|
|
35
|
-
export declare const IconDatasourceAssetsObjects:
|
|
36
|
-
export declare const IconDatasourceConfluenceSearch:
|
|
37
|
-
export declare const IconLoom:
|
|
38
|
-
export declare const IconSyncBlock:
|
|
34
|
+
export declare const IconFeedback: PreloadableComponent<React.PropsWithChildren<IconProps>>;
|
|
35
|
+
export declare const IconExpand: PreloadableComponent<React.PropsWithChildren<IconProps>>;
|
|
36
|
+
export declare const IconDatasourceJiraIssue: PreloadableComponent<React.PropsWithChildren<IconProps>>;
|
|
37
|
+
export declare const IconDatasourceAssetsObjects: PreloadableComponent<React.PropsWithChildren<IconProps>>;
|
|
38
|
+
export declare const IconDatasourceConfluenceSearch: PreloadableComponent<React.PropsWithChildren<IconProps>>;
|
|
39
|
+
export declare const IconLoom: PreloadableComponent<React.PropsWithChildren<IconProps>>;
|
|
40
|
+
export declare const IconSyncBlock: PreloadableComponent<React.PropsWithChildren<IconProps>>;
|
|
39
41
|
export {};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { IntlShape } from 'react-intl';
|
|
1
2
|
import type { SurfaceIdentifier } from '@atlaskit/editor-ui-control-model/surface-renderer/types';
|
|
2
3
|
import type { RegisterComponent, RegisterMenuItem, RegisterMenuSection, SurfaceContext } from '@atlaskit/editor-ui-control-model/types';
|
|
3
4
|
import { type RegisteredItemRankResolver } from '../type-ahead/item-rank';
|
|
@@ -10,4 +11,16 @@ export type QuickInsertMenuModel = {
|
|
|
10
11
|
searchResults?: RegisterMenuItem[];
|
|
11
12
|
sections: QuickInsertMenuSection[];
|
|
12
13
|
};
|
|
13
|
-
|
|
14
|
+
/**
|
|
15
|
+
* Builds the registered quick-insert menu model. An empty query browses every
|
|
16
|
+
* category; a non-empty query returns ranked matches. The footer is shared by both.
|
|
17
|
+
*/
|
|
18
|
+
export declare const getQuickInsertMenuModel: ({ components, formatMessage, getItemRank, query, rootComponent, selectCategoryItems, surfaceContext, }: {
|
|
19
|
+
components: RegisterComponent[];
|
|
20
|
+
formatMessage: IntlShape['formatMessage'];
|
|
21
|
+
getItemRank?: RegisteredItemRankResolver;
|
|
22
|
+
query: string;
|
|
23
|
+
rootComponent: SurfaceIdentifier;
|
|
24
|
+
selectCategoryItems?: QuickInsertCategoryItemSelectionPolicy;
|
|
25
|
+
surfaceContext?: SurfaceContext;
|
|
26
|
+
}) => QuickInsertMenuModel;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { RegisterMenuItem, RegisterMenuSection } from '@atlaskit/editor-ui-control-model/types';
|
|
2
|
-
import type { QuickInsertMenuModel } from './
|
|
2
|
+
import type { QuickInsertMenuModel } from './get-quick-insert-menu-model';
|
|
3
3
|
export declare const getQuickInsertMenuRows: (model: QuickInsertMenuModel) => Array<RegisterMenuItem | RegisterMenuSection>;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { getQuickInsertMenuModel } from './get-quick-insert-menu-model';
|
|
2
2
|
export { getQuickInsertMenuRows } from './getQuickInsertMenuRows';
|
|
3
3
|
export { quickInsertProviderMenuItemKey } from './getQuickInsertProviderMenuItemKey';
|
|
4
4
|
export { selectQuickInsertCategoryItems } from './selectQuickInsertCategoryItems';
|
|
5
|
-
export {
|
|
6
|
-
export type { QuickInsertMenuModel, QuickInsertMenuSection } from './build-quick-insert-menu-model';
|
|
5
|
+
export type { QuickInsertMenuModel, QuickInsertMenuSection } from './get-quick-insert-menu-model';
|
|
7
6
|
export type { QuickInsertCategoryItemSelectionPolicy } from './selectQuickInsertCategoryItems';
|
|
@@ -10,11 +10,14 @@ export interface Props {
|
|
|
10
10
|
children?: React.ReactNode;
|
|
11
11
|
className?: string;
|
|
12
12
|
disabled?: boolean;
|
|
13
|
+
/** Keep the tooltip open when the button is pressed. Set it when a press changes the tooltip content. */
|
|
14
|
+
hasNewContentOnTriggerClick?: boolean;
|
|
13
15
|
hideTooltipOnClick?: boolean;
|
|
14
16
|
href?: string;
|
|
15
17
|
icon?: React.ReactElement<any>;
|
|
16
18
|
iconAfter?: React.ReactElement<any>;
|
|
17
19
|
interactionName?: string;
|
|
20
|
+
isLoading?: boolean;
|
|
18
21
|
isRadioButton?: boolean;
|
|
19
22
|
onBlur?: <T>(event: React.FocusEvent<T>) => void;
|
|
20
23
|
onClick?: React.MouseEventHandler;
|
|
@@ -27,8 +30,6 @@ export interface Props {
|
|
|
27
30
|
/** If true, the component will have pulse onboarding effect around it. */
|
|
28
31
|
pulse?: boolean;
|
|
29
32
|
selected?: boolean;
|
|
30
|
-
/** Keep the tooltip open when the button is pressed. Set it when a press changes the tooltip content. */
|
|
31
|
-
hasNewContentOnTriggerClick?: boolean;
|
|
32
33
|
tabIndex?: number | null | undefined;
|
|
33
34
|
target?: string;
|
|
34
35
|
testId?: string;
|
|
@@ -2,8 +2,8 @@ type NonProductionBuildAnalyticsAttributes = {
|
|
|
2
2
|
isNonProductionBuild?: boolean;
|
|
3
3
|
};
|
|
4
4
|
/**
|
|
5
|
-
* Adds a product-owned build classification
|
|
6
|
-
* A classifier callback is
|
|
5
|
+
* Adds a product-owned build classification to analytics attributes.
|
|
6
|
+
* A classifier callback is evaluated lazily, so the caller controls when browser reads happen.
|
|
7
7
|
* An unknown classification is omitted; an explicit false is preserved.
|
|
8
8
|
*/
|
|
9
9
|
export declare const getNonProductionBuildAnalyticsAttributes: (classification?: boolean | (() => boolean | undefined)) => NonProductionBuildAnalyticsAttributes;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-common",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "131.0.0",
|
|
4
4
|
"description": "A package that contains common classes and components for editor and renderer",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -62,7 +62,7 @@
|
|
|
62
62
|
"@atlaskit/media-client-react": "^7.0.0",
|
|
63
63
|
"@atlaskit/media-common": "^14.6.0",
|
|
64
64
|
"@atlaskit/media-file-preview": "^2.0.0",
|
|
65
|
-
"@atlaskit/media-picker": "^73.
|
|
65
|
+
"@atlaskit/media-picker": "^73.1.0",
|
|
66
66
|
"@atlaskit/media-ui": "^31.3.0",
|
|
67
67
|
"@atlaskit/media-viewer": "^54.11.0",
|
|
68
68
|
"@atlaskit/mention": "^30.2.0",
|
|
@@ -85,8 +85,8 @@
|
|
|
85
85
|
"@atlaskit/task-decision": "^21.12.0",
|
|
86
86
|
"@atlaskit/teams-app-config": "^3.1.0",
|
|
87
87
|
"@atlaskit/textfield": "^10.2.0",
|
|
88
|
-
"@atlaskit/tmp-editor-statsig": "^
|
|
89
|
-
"@atlaskit/tokens": "^20.
|
|
88
|
+
"@atlaskit/tmp-editor-statsig": "^235.0.0",
|
|
89
|
+
"@atlaskit/tokens": "^20.5.0",
|
|
90
90
|
"@atlaskit/tooltip": "^24.4.0",
|
|
91
91
|
"@atlaskit/width-detector": "^7.2.0",
|
|
92
92
|
"@babel/runtime": "^7.0.0",
|
|
@@ -113,6 +113,7 @@
|
|
|
113
113
|
"re-resizable": "6.0.0",
|
|
114
114
|
"react-focus-lock": "^2.9.5",
|
|
115
115
|
"react-loadable": "^5.1.0",
|
|
116
|
+
"react-loosely-lazy": "^1.0.0",
|
|
116
117
|
"react-virtualized": "^9.22.6",
|
|
117
118
|
"rusha": "^0.8.13",
|
|
118
119
|
"uuid": "^11.1.1",
|