@atlaskit/editor-common 102.0.0 → 102.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +16 -0
- package/dist/cjs/ai-messages/ai.js +5 -0
- package/dist/cjs/analytics/types/general-events.js +1 -1
- package/dist/cjs/collab/index.js +2 -0
- package/dist/cjs/element-browser/hooks/use-select-and-focus-on-arrow-navigation.js +26 -52
- package/dist/cjs/extensibility/MultiBodiedExtension/action-api.js +2 -0
- package/dist/cjs/insert/index.js +2 -0
- package/dist/cjs/keymaps/keymap.js +4 -2
- package/dist/cjs/lazy-node-view/index.js +1 -1
- package/dist/cjs/media-inline/inline-image-card.js +2 -0
- package/dist/cjs/messages/annotation.js +2 -0
- package/dist/cjs/messages/help-dialog.js +2 -0
- package/dist/cjs/monitoring/environment.js +2 -0
- package/dist/cjs/monitoring/error.js +3 -1
- package/dist/cjs/node-width/index.js +0 -1
- package/dist/cjs/quick-insert/assets/datasource-assets-objects.js +1 -1
- package/dist/cjs/quick-insert/assets/datasource-jira-issue.js +1 -1
- package/dist/cjs/quick-insert/assets/feedback.js +1 -1
- package/dist/cjs/quick-insert/assets/quote.js +1 -1
- package/dist/cjs/react-node-view/getInlineNodeViewProducer.js +1 -1
- package/dist/cjs/react-node-view/index.js +1 -1
- package/dist/cjs/selection/gap-cursor/selection.js +1 -1
- package/dist/cjs/styles/shared/annotation.js +1 -1
- package/dist/cjs/ui/DropList/index.js +1 -1
- package/dist/cjs/ui/Layer/index.js +0 -1
- package/dist/cjs/ui-menu/ColorPickerButton/index.js +1 -1
- package/dist/cjs/ui-menu/ToolbarButton/styles.js +2 -0
- package/dist/cjs/ui-react/with-react-editor-view-outer-listeners.js +13 -4
- package/dist/cjs/utils/calculate-toolbar-position.js +4 -0
- package/dist/cjs/utils/compareNodes.js +0 -1
- package/dist/cjs/utils/get-performance-options.js +0 -1
- package/dist/cjs/utils/is-text-input.js +0 -2
- package/dist/cjs/utils/table.js +2 -0
- package/dist/cjs/utils/validate-using-spec.js +2 -0
- package/dist/cjs/with-plugin-state/index.js +0 -1
- package/dist/es2019/ai-messages/ai.js +5 -0
- package/dist/es2019/analytics/types/general-events.js +1 -3
- package/dist/es2019/collab/index.js +2 -0
- package/dist/es2019/element-browser/hooks/use-select-and-focus-on-arrow-navigation.js +28 -54
- package/dist/es2019/extensibility/MultiBodiedExtension/action-api.js +2 -0
- package/dist/es2019/insert/index.js +2 -0
- package/dist/es2019/keymaps/keymap.js +4 -2
- package/dist/es2019/lazy-node-view/index.js +1 -1
- package/dist/es2019/media-inline/inline-image-card.js +2 -0
- package/dist/es2019/messages/annotation.js +2 -0
- package/dist/es2019/messages/help-dialog.js +2 -0
- package/dist/es2019/monitoring/environment.js +2 -0
- package/dist/es2019/monitoring/error.js +3 -1
- package/dist/es2019/node-width/index.js +0 -1
- package/dist/es2019/quick-insert/assets/datasource-assets-objects.js +1 -1
- package/dist/es2019/quick-insert/assets/datasource-jira-issue.js +1 -1
- package/dist/es2019/quick-insert/assets/feedback.js +1 -1
- package/dist/es2019/quick-insert/assets/quote.js +1 -1
- package/dist/es2019/react-node-view/getInlineNodeViewProducer.js +1 -1
- package/dist/es2019/react-node-view/index.js +1 -1
- package/dist/es2019/selection/gap-cursor/selection.js +1 -1
- package/dist/es2019/styles/shared/annotation.js +1 -1
- package/dist/es2019/ui/DropList/index.js +1 -1
- package/dist/es2019/ui/Layer/index.js +0 -1
- package/dist/es2019/ui-menu/ColorPickerButton/index.js +1 -1
- package/dist/es2019/ui-menu/ToolbarButton/styles.js +2 -0
- package/dist/es2019/ui-react/with-react-editor-view-outer-listeners.js +12 -3
- package/dist/es2019/utils/calculate-toolbar-position.js +4 -0
- package/dist/es2019/utils/compareNodes.js +0 -1
- package/dist/es2019/utils/get-performance-options.js +0 -1
- package/dist/es2019/utils/is-text-input.js +0 -2
- package/dist/es2019/utils/table.js +2 -0
- package/dist/es2019/utils/validate-using-spec.js +2 -0
- package/dist/es2019/with-plugin-state/index.js +0 -1
- package/dist/esm/ai-messages/ai.js +5 -0
- package/dist/esm/analytics/types/general-events.js +1 -3
- package/dist/esm/collab/index.js +2 -0
- package/dist/esm/element-browser/hooks/use-select-and-focus-on-arrow-navigation.js +27 -52
- package/dist/esm/extensibility/MultiBodiedExtension/action-api.js +2 -0
- package/dist/esm/insert/index.js +2 -0
- package/dist/esm/keymaps/keymap.js +4 -2
- package/dist/esm/lazy-node-view/index.js +1 -1
- package/dist/esm/media-inline/inline-image-card.js +2 -0
- package/dist/esm/messages/annotation.js +2 -0
- package/dist/esm/messages/help-dialog.js +2 -0
- package/dist/esm/monitoring/environment.js +2 -0
- package/dist/esm/monitoring/error.js +3 -1
- package/dist/esm/node-width/index.js +0 -1
- package/dist/esm/quick-insert/assets/datasource-assets-objects.js +1 -1
- package/dist/esm/quick-insert/assets/datasource-jira-issue.js +1 -1
- package/dist/esm/quick-insert/assets/feedback.js +1 -1
- package/dist/esm/quick-insert/assets/quote.js +1 -1
- package/dist/esm/react-node-view/getInlineNodeViewProducer.js +1 -1
- package/dist/esm/react-node-view/index.js +1 -1
- package/dist/esm/selection/gap-cursor/selection.js +1 -1
- package/dist/esm/styles/shared/annotation.js +1 -1
- package/dist/esm/ui/DropList/index.js +1 -1
- package/dist/esm/ui/Layer/index.js +0 -1
- package/dist/esm/ui-menu/ColorPickerButton/index.js +1 -1
- package/dist/esm/ui-menu/ToolbarButton/styles.js +2 -0
- package/dist/esm/ui-react/with-react-editor-view-outer-listeners.js +13 -4
- package/dist/esm/utils/calculate-toolbar-position.js +4 -0
- package/dist/esm/utils/compareNodes.js +0 -1
- package/dist/esm/utils/get-performance-options.js +0 -1
- package/dist/esm/utils/is-text-input.js +0 -2
- package/dist/esm/utils/table.js +2 -0
- package/dist/esm/utils/validate-using-spec.js +2 -0
- package/dist/esm/with-plugin-state/index.js +0 -1
- package/dist/types/ai-messages/ai.d.ts +5 -0
- package/dist/types/types/annotation/index.d.ts +0 -3
- package/dist/types/ui-react/with-react-editor-view-outer-listeners.d.ts +6 -0
- package/dist/types-ts4.5/ai-messages/ai.d.ts +5 -0
- package/dist/types-ts4.5/types/annotation/index.d.ts +0 -3
- package/dist/types-ts4.5/ui-react/with-react-editor-view-outer-listeners.d.ts +6 -0
- package/package.json +1 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# @atlaskit/editor-common
|
|
2
2
|
|
|
3
|
+
## 102.1.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#122920](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/122920)
|
|
8
|
+
[`18c265545150a`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/18c265545150a) -
|
|
9
|
+
[ux] [ED-26914] Emoji quick insert will now open the emoji picker rather than the typeahead when
|
|
10
|
+
platform_editor_controls is enabled
|
|
11
|
+
|
|
12
|
+
### Patch Changes
|
|
13
|
+
|
|
14
|
+
- [#123583](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/123583)
|
|
15
|
+
[`81ea741d7ca80`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/81ea741d7ca80) -
|
|
16
|
+
Cleanup refactor for element browser state
|
|
17
|
+
- Updated dependencies
|
|
18
|
+
|
|
3
19
|
## 102.0.0
|
|
4
20
|
|
|
5
21
|
### Major Changes
|
|
@@ -12,6 +12,11 @@ var aiMessages = exports.aiMessages = (0, _reactIntlNext.defineMessages)({
|
|
|
12
12
|
defaultMessage: 'Page title',
|
|
13
13
|
description: 'A fallback suggested title for the suggest title prompt'
|
|
14
14
|
},
|
|
15
|
+
eventHubfallbackSuggestedTitlePrefix: {
|
|
16
|
+
id: 'fabric.editor.ai.eventHub.fallbackSuggestedTitlePrefix',
|
|
17
|
+
defaultMessage: 'Page',
|
|
18
|
+
description: 'A fallback suggested title prefix for the suggest title prompt'
|
|
19
|
+
},
|
|
15
20
|
// Toolbar messages
|
|
16
21
|
aiToolbarTitle: {
|
|
17
22
|
id: 'fabric.editor.ai.toolbar.titleText',
|
|
@@ -26,4 +26,4 @@ var BROWSER_FREEZE_INTERACTION_TYPE = exports.BROWSER_FREEZE_INTERACTION_TYPE =
|
|
|
26
26
|
BROWSER_FREEZE_INTERACTION_TYPE["CLICKING"] = "clicking";
|
|
27
27
|
BROWSER_FREEZE_INTERACTION_TYPE["PASTING"] = "pasting";
|
|
28
28
|
return BROWSER_FREEZE_INTERACTION_TYPE;
|
|
29
|
-
}({});
|
|
29
|
+
}({});
|
package/dist/cjs/collab/index.js
CHANGED
|
@@ -110,6 +110,8 @@ var PROVIDER_ERROR_CODE = exports.PROVIDER_ERROR_CODE = /*#__PURE__*/function (P
|
|
|
110
110
|
* A union of all possible provider errors that can be emitted back to the editor.
|
|
111
111
|
*/
|
|
112
112
|
// Collab Provider interface
|
|
113
|
+
// Ignored via go/ees007
|
|
114
|
+
// eslint-disable-next-line @atlaskit/editor/enforce-todo-comment-format
|
|
113
115
|
// TODO: Deprecate redundant payload types
|
|
114
116
|
var DisconnectReason = exports.DisconnectReason = /*#__PURE__*/function (DisconnectReason) {
|
|
115
117
|
DisconnectReason["CLIENT_DISCONNECT"] = "CLIENT_DISCONNECT";
|
|
@@ -8,7 +8,6 @@ exports.ensureSafeIndex = exports.default = exports.ACTIONS = void 0;
|
|
|
8
8
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
9
9
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
10
10
|
var _react = require("react");
|
|
11
|
-
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
12
11
|
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; }
|
|
13
12
|
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) { (0, _defineProperty2.default)(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; }
|
|
14
13
|
/**
|
|
@@ -84,27 +83,18 @@ var moveReducer = function moveReducer(state, action) {
|
|
|
84
83
|
selectedItemIndex: canFocusViewMore ? undefined : listSize
|
|
85
84
|
});
|
|
86
85
|
} else {
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
});
|
|
100
|
-
} else {
|
|
101
|
-
return _objectSpread(_objectSpread({}, state), {}, {
|
|
102
|
-
focusOnSearch: false,
|
|
103
|
-
focusOnViewMore: false,
|
|
104
|
-
focusedItemIndex: 0,
|
|
105
|
-
selectedItemIndex: 0
|
|
106
|
-
});
|
|
107
|
-
}
|
|
86
|
+
var _action$payload$step;
|
|
87
|
+
var _newIndex = action.payload.positions ? action.payload.positions - ((_action$payload$step = action.payload.step) !== null && _action$payload$step !== void 0 ? _action$payload$step : 1) : 0;
|
|
88
|
+
var _safeIndex = ensureSafeIndex(_newIndex, state.listSize);
|
|
89
|
+
var isLastItemFocused = _newIndex > listSize;
|
|
90
|
+
var focusOnSearch = isLastItemFocused && !canFocusViewMore;
|
|
91
|
+
var focusOnViewMore = isLastItemFocused && !!canFocusViewMore;
|
|
92
|
+
return _objectSpread(_objectSpread({}, state), {}, {
|
|
93
|
+
focusOnSearch: focusOnSearch,
|
|
94
|
+
focusOnViewMore: focusOnViewMore,
|
|
95
|
+
focusedItemIndex: _safeIndex,
|
|
96
|
+
selectedItemIndex: _safeIndex
|
|
97
|
+
});
|
|
108
98
|
}
|
|
109
99
|
}
|
|
110
100
|
if (state.focusOnViewMore) {
|
|
@@ -327,45 +317,29 @@ function useSelectAndFocusOnArrowNavigation(listSize, step, canFocusViewMore, it
|
|
|
327
317
|
return setFocusOnSearch();
|
|
328
318
|
case 'ArrowRight':
|
|
329
319
|
{
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
return move(e, nextItem);
|
|
335
|
-
} else {
|
|
336
|
-
return move(e, +1);
|
|
337
|
-
}
|
|
320
|
+
var _skipForwardOffsetToS;
|
|
321
|
+
var itemIndex = focusOnSearch ? -1 : selectedItemIndex;
|
|
322
|
+
var nextItem = (_skipForwardOffsetToS = skipForwardOffsetToSafeItem(itemIndex, listSize, 1, itemIsDisabled)) !== null && _skipForwardOffsetToS !== void 0 ? _skipForwardOffsetToS : 1;
|
|
323
|
+
return move(e, nextItem);
|
|
338
324
|
}
|
|
339
325
|
case 'ArrowLeft':
|
|
340
326
|
{
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
return move(e, -_nextItem);
|
|
345
|
-
} else {
|
|
346
|
-
return move(e, -1);
|
|
347
|
-
}
|
|
327
|
+
var _skipBackwardOffsetTo;
|
|
328
|
+
var _nextItem = (_skipBackwardOffsetTo = skipBackwardOffsetToSafeItem(selectedItemIndex, 1, itemIsDisabled)) !== null && _skipBackwardOffsetTo !== void 0 ? _skipBackwardOffsetTo : 1;
|
|
329
|
+
return move(e, -_nextItem);
|
|
348
330
|
}
|
|
349
331
|
case 'ArrowDown':
|
|
350
332
|
{
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
return move(e, +_nextItem2, step);
|
|
356
|
-
} else {
|
|
357
|
-
return move(e, +step);
|
|
358
|
-
}
|
|
333
|
+
var _skipForwardOffsetToS2;
|
|
334
|
+
var _itemIndex = focusOnSearch ? -step : selectedItemIndex;
|
|
335
|
+
var _nextItem2 = (_skipForwardOffsetToS2 = skipForwardOffsetToSafeItem(_itemIndex, listSize, step, itemIsDisabled)) !== null && _skipForwardOffsetToS2 !== void 0 ? _skipForwardOffsetToS2 : step;
|
|
336
|
+
return move(e, +_nextItem2, step);
|
|
359
337
|
}
|
|
360
338
|
case 'ArrowUp':
|
|
361
339
|
{
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
return move(e, Math.min(-_nextItem3, -step), step);
|
|
366
|
-
} else {
|
|
367
|
-
return move(e, -step, step);
|
|
368
|
-
}
|
|
340
|
+
var _skipBackwardOffsetTo2;
|
|
341
|
+
var _nextItem3 = (_skipBackwardOffsetTo2 = skipBackwardOffsetToSafeItem(selectedItemIndex, step, itemIsDisabled)) !== null && _skipBackwardOffsetTo2 !== void 0 ? _skipBackwardOffsetTo2 : step;
|
|
342
|
+
return move(e, Math.min(-_nextItem3, -step), step);
|
|
369
343
|
}
|
|
370
344
|
}
|
|
371
345
|
}, [focusOnSearch, setFocusOnSearch, move, selectedItemIndex, itemIsDisabled, listSize, step]);
|
|
@@ -78,6 +78,8 @@ var useMultiBodiedExtensionActions = exports.useMultiBodiedExtensionActions = fu
|
|
|
78
78
|
},
|
|
79
79
|
removeChild: function removeChild(index) {
|
|
80
80
|
var pos = getPos();
|
|
81
|
+
// Ignored via go/ees007
|
|
82
|
+
// eslint-disable-next-line @atlaskit/editor/enforce-todo-comment-format
|
|
81
83
|
// TODO: Add child index validation here, don't trust this data
|
|
82
84
|
if (typeof pos !== 'number' || typeof index !== 'number') {
|
|
83
85
|
throw new Error('Position or index not valid');
|
package/dist/cjs/insert/index.js
CHANGED
|
@@ -82,6 +82,8 @@ var insertBeforeOrAfter = function insertBeforeOrAfter(tr, lookDirection, $paren
|
|
|
82
82
|
return tr.insert($proposedPosition[lookDirection](), content);
|
|
83
83
|
};
|
|
84
84
|
|
|
85
|
+
// Ignored via go/ees007
|
|
86
|
+
// eslint-disable-next-line @atlaskit/editor/enforce-todo-comment-format
|
|
85
87
|
// FIXME: A more sustainable and configurable way to choose when to split
|
|
86
88
|
// Ignored via go/ees005
|
|
87
89
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
@@ -39,9 +39,11 @@ function keymap(bindings) {
|
|
|
39
39
|
var isDeadKey = name === 'Dead';
|
|
40
40
|
if (isModKeyPressed && (isNonLatinKey || isDeadKey)) {
|
|
41
41
|
keyboardEvent = new KeyboardEvent(event.type, {
|
|
42
|
+
// Ignored via go/ees007
|
|
43
|
+
// eslint-disable-next-line @atlaskit/editor/enforce-todo-comment-format
|
|
42
44
|
// FIXME: The event.keyCode is deprecated (see https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/keyCode),
|
|
43
|
-
//
|
|
44
|
-
//
|
|
45
|
+
// and could be removed in any time, but the w3c-keyname library doesn't provide a way to get
|
|
46
|
+
// a key by event.code.
|
|
45
47
|
key: _w3cKeyname.base[event.keyCode],
|
|
46
48
|
code: event.code,
|
|
47
49
|
ctrlKey: event.ctrlKey,
|
|
@@ -196,7 +196,7 @@ var withLazyLoading = exports.withLazyLoading = function withLazyLoading(_ref) {
|
|
|
196
196
|
});
|
|
197
197
|
requestedNodes.set(nodeName, loaderPromise);
|
|
198
198
|
if (typeof ((_node$type = node.type) === null || _node$type === void 0 || (_node$type = _node$type.spec) === null || _node$type === void 0 ? void 0 : _node$type.toDOM) !== 'function') {
|
|
199
|
-
// TODO:
|
|
199
|
+
// TODO: ED-23982 - Analytics
|
|
200
200
|
// dispatchAnalyticsEvent({
|
|
201
201
|
// action: ACTION.LAZY_NODE_VIEW_ERROR,
|
|
202
202
|
// actionSubject: ACTION_SUBJECT.LAZY_NODE_VIEW,
|
|
@@ -33,6 +33,8 @@ var InlineImageCard = exports.InlineImageCard = function InlineImageCard(_ref) {
|
|
|
33
33
|
};
|
|
34
34
|
}, []);
|
|
35
35
|
|
|
36
|
+
// Ignored via go/ees007
|
|
37
|
+
// eslint-disable-next-line @atlaskit/editor/enforce-todo-comment-format
|
|
36
38
|
// TODO do we need to handle nonCriticalError
|
|
37
39
|
var _useFilePreview = (0, _mediaFilePreview.useFilePreview)({
|
|
38
40
|
identifier: identifier,
|
|
@@ -11,6 +11,8 @@ var annotationMessages = exports.annotationMessages = (0, _reactIntlNext.defineM
|
|
|
11
11
|
defaultMessage: 'Comment',
|
|
12
12
|
description: 'Create/add an inline comment based on the users selection'
|
|
13
13
|
},
|
|
14
|
+
// Ignored via go/ees007
|
|
15
|
+
// eslint-disable-next-line @atlaskit/editor/enforce-todo-comment-format
|
|
14
16
|
// TODO: Remove this message when the editor_inline_comments_on_inline_nodes FF is removed
|
|
15
17
|
createCommentInvalid: {
|
|
16
18
|
id: 'fabric.editor.createCommentInvalid',
|
|
@@ -91,6 +91,8 @@ var helpDialogMessages = exports.helpDialogMessages = (0, _reactIntlNext.defineM
|
|
|
91
91
|
defaultMessage: 'Close help dialog',
|
|
92
92
|
description: ''
|
|
93
93
|
},
|
|
94
|
+
// Ignored via go/ees007
|
|
95
|
+
// eslint-disable-next-line @atlaskit/editor/enforce-todo-comment-format
|
|
94
96
|
// TODO: Move it inside quick insert plugin
|
|
95
97
|
quickInsert: {
|
|
96
98
|
id: 'fabric.editor.quickInsert',
|
|
@@ -9,6 +9,8 @@ var FEDRAMP_MODERATE = 'fedramp-moderate';
|
|
|
9
9
|
// To determine whether an instance is a FedRAMP instance
|
|
10
10
|
// Copied from platform/packages/uip/atl-context/src/services/is-fedramp/index.tsx
|
|
11
11
|
// We cannot import the same-named function from @atlassian/atl-context due to editor-common being a public package (and atl-context being private)
|
|
12
|
+
// Ignored via go/ees007
|
|
13
|
+
// eslint-disable-next-line @atlaskit/editor/enforce-todo-comment-format
|
|
12
14
|
// TODO: Seek alternatives
|
|
13
15
|
function isFedRamp() {
|
|
14
16
|
var _global$location;
|
|
@@ -17,9 +17,11 @@ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return
|
|
|
17
17
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
18
18
|
var SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
|
|
19
19
|
var packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
|
|
20
|
-
var packageVersion = "102.
|
|
20
|
+
var packageVersion = "102.1.0";
|
|
21
21
|
var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
|
|
22
22
|
// Remove URL as it has UGC
|
|
23
|
+
// Ignored via go/ees007
|
|
24
|
+
// eslint-disable-next-line @atlaskit/editor/enforce-todo-comment-format
|
|
23
25
|
// TODO: Sanitise the URL instead of just removing it
|
|
24
26
|
if (data.request) {
|
|
25
27
|
delete data.request.url;
|
|
@@ -41,7 +41,6 @@ var getParentNodeWidth = exports.getParentNodeWidth = function getParentNodeWidt
|
|
|
41
41
|
}
|
|
42
42
|
var parentWidth = calcBreakoutNodeWidth(layout, containerWidth, isFullWidthModeEnabled);
|
|
43
43
|
|
|
44
|
-
// TODO: ED-15663
|
|
45
44
|
// Please, do not copy or use this kind of code below
|
|
46
45
|
// @ts-ignore
|
|
47
46
|
var contextPanelPluginKey = {
|
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports.default = IconDatasourceAssetsObjects;
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
|
-
// TODO:
|
|
9
|
+
// TODO: DSP-4138 - migrate to @atlaskit/design-system
|
|
10
10
|
/* eslint-disable @atlaskit/design-system/ensure-design-token-usage */
|
|
11
11
|
|
|
12
12
|
function IconDatasourceAssetsObjects() {
|
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports.default = IconDatasourceJiraIssue;
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
|
-
// TODO:
|
|
9
|
+
// TODO: DSP-4138 - Migrate to @atlaskit/design-system
|
|
10
10
|
/* eslint-disable @atlaskit/design-system/ensure-design-token-usage */
|
|
11
11
|
|
|
12
12
|
function IconDatasourceJiraIssue() {
|
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports.default = IconFeedback;
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
|
-
// TODO:
|
|
9
|
+
// TODO: DSP-4138 - Migrate to @atlaskit/design-system
|
|
10
10
|
/* eslint-disable @atlaskit/design-system/ensure-design-token-usage */
|
|
11
11
|
|
|
12
12
|
function IconFeedback() {
|
|
@@ -7,7 +7,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
exports.default = IconQuote;
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
9
|
var _useIconThemed2 = require("../use-icon-themed");
|
|
10
|
-
// TODO:
|
|
10
|
+
// TODO: DSP-4138 - Migrate to @atlaskit/design-system
|
|
11
11
|
/* eslint-disable @atlaskit/design-system/ensure-design-token-usage */
|
|
12
12
|
|
|
13
13
|
function IconQuote() {
|
|
@@ -272,7 +272,7 @@ function getPortalChildren(_ref2) {
|
|
|
272
272
|
className: "".concat(inlineNodeViewClassname, "AddZeroWidthSpace")
|
|
273
273
|
}), _whitespace.ZERO_WIDTH_SPACE), (0, _react2.jsx)(Component, (0, _extends2.default)({
|
|
274
274
|
view: nodeViewParams.view
|
|
275
|
-
// TODO:
|
|
275
|
+
// TODO: ED-13910 - Remove the boolean to fix the prosemirror view type
|
|
276
276
|
// Ignored via go/ees005
|
|
277
277
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
278
278
|
,
|
|
@@ -239,7 +239,7 @@ var ReactNodeView = exports.default = /*#__PURE__*/function () {
|
|
|
239
239
|
|
|
240
240
|
// View should not process a re-render if this is false.
|
|
241
241
|
// We dont want to destroy the view, so we return true.
|
|
242
|
-
// TODO: ED-13910 Fix viewShouldUpdate readonly decoration array
|
|
242
|
+
// TODO: ED-13910 - Fix viewShouldUpdate readonly decoration array
|
|
243
243
|
if (!this.viewShouldUpdate(node, decorations)) {
|
|
244
244
|
this.node = node;
|
|
245
245
|
return true;
|
|
@@ -94,7 +94,7 @@ var GapCursorSelection = exports.GapCursorSelection = /*#__PURE__*/function (_Se
|
|
|
94
94
|
}
|
|
95
95
|
var pos = $pos.pos;
|
|
96
96
|
|
|
97
|
-
// TODO: Fix any, potential issue.
|
|
97
|
+
// TODO: ED-5048 - Fix any, potential issue.
|
|
98
98
|
// Ignored via go/ees005
|
|
99
99
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
100
100
|
var next = null;
|
|
@@ -67,7 +67,7 @@ var AnnotationSharedCSSByState = exports.AnnotationSharedCSSByState = function A
|
|
|
67
67
|
// emotion and token look up
|
|
68
68
|
background: "var(--ds-background-accent-yellow-subtler, #F8E6A0)",
|
|
69
69
|
borderBottom: "2px solid ".concat("var(--ds-border-accent-yellow, #B38600)"),
|
|
70
|
-
// TODO:
|
|
70
|
+
// TODO: DSP-4147 - Annotation shadow
|
|
71
71
|
boxShadow: "var(--ds-shadow-overlay, 0px 8px 12px #091E4226, 0px 0px 1px #091E424f)",
|
|
72
72
|
cursor: 'pointer'
|
|
73
73
|
}),
|
|
@@ -23,7 +23,7 @@ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.
|
|
|
23
23
|
* @jsx jsx
|
|
24
24
|
*/ // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
25
25
|
var packageName = "@atlaskit/editor-common";
|
|
26
|
-
var packageVersion = "102.
|
|
26
|
+
var packageVersion = "102.1.0";
|
|
27
27
|
var halfFocusRing = 1;
|
|
28
28
|
var dropOffset = '0, 8';
|
|
29
29
|
// Ignored via go/ees005
|
|
@@ -58,7 +58,7 @@ var colorPickerButtonStyle = (0, _react2.css)({
|
|
|
58
58
|
});
|
|
59
59
|
|
|
60
60
|
// Control the size of color picker buttons and preview
|
|
61
|
-
// TODO:
|
|
61
|
+
// TODO: DSP-4134 - Color picking UI
|
|
62
62
|
/* eslint-disable @atlaskit/design-system/ensure-design-token-usage */
|
|
63
63
|
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
|
|
64
64
|
var colorPickerWrapper = function colorPickerWrapper() {
|
|
@@ -16,6 +16,8 @@ var _default = exports.default = /*#__PURE__*/_react.default.forwardRef(function
|
|
|
16
16
|
// Ignored via go/ees005
|
|
17
17
|
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
18
18
|
}, props, {
|
|
19
|
+
// Ignored via go/ees007
|
|
20
|
+
// eslint-disable-next-line @atlaskit/editor/enforce-todo-comment-format
|
|
19
21
|
// TODO: (from codemod) Buttons with "component", "css" or "style" prop can't be automatically migrated with codemods. Please migrate it manually.
|
|
20
22
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
21
23
|
style: {
|
|
@@ -16,8 +16,9 @@ var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/ge
|
|
|
16
16
|
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
17
17
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
18
18
|
var _react = _interopRequireWildcard(require("react"));
|
|
19
|
+
var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
|
|
19
20
|
var _ReactEditorViewContext = _interopRequireDefault(require("./ReactEditorViewContext"));
|
|
20
|
-
var _excluded = ["handleClickOutside", "handleEnterKeydown", "handleEscapeKeydown", "closeOnTab"];
|
|
21
|
+
var _excluded = ["handleClickOutside", "handleEnterKeydown", "handleEscapeKeydown", "closeOnTab", "captureClick"];
|
|
21
22
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
22
23
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
23
24
|
function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2.default)(o), (0, _possibleConstructorReturn2.default)(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2.default)(t).constructor) : o.apply(t, e)); }
|
|
@@ -79,9 +80,12 @@ var WithOutsideClick = /*#__PURE__*/function (_PureComponent) {
|
|
|
79
80
|
key: "componentDidMount",
|
|
80
81
|
value: function componentDidMount() {
|
|
81
82
|
if (this.props.handleClickOutside) {
|
|
83
|
+
var options = this.props.captureClick && (0, _experiments.editorExperiment)('platform_editor_controls', 'variant1') ? {
|
|
84
|
+
capture: true
|
|
85
|
+
} : false;
|
|
82
86
|
// Ignored via go/ees005
|
|
83
87
|
// eslint-disable-next-line @repo/internal/dom-events/no-unsafe-event-listeners
|
|
84
|
-
document.addEventListener('click', this.handleClick,
|
|
88
|
+
document.addEventListener('click', this.handleClick, options);
|
|
85
89
|
}
|
|
86
90
|
if (this.props.handleEscapeKeydown) {
|
|
87
91
|
var _this$props$editorRef;
|
|
@@ -99,9 +103,12 @@ var WithOutsideClick = /*#__PURE__*/function (_PureComponent) {
|
|
|
99
103
|
key: "componentWillUnmount",
|
|
100
104
|
value: function componentWillUnmount() {
|
|
101
105
|
if (this.props.handleClickOutside) {
|
|
106
|
+
var options = this.props.captureClick && (0, _experiments.editorExperiment)('platform_editor_controls', 'variant1') ? {
|
|
107
|
+
capture: true
|
|
108
|
+
} : false;
|
|
102
109
|
// Ignored via go/ees005
|
|
103
110
|
// eslint-disable-next-line @repo/internal/dom-events/no-unsafe-event-listeners
|
|
104
|
-
document.removeEventListener('click', this.handleClick,
|
|
111
|
+
document.removeEventListener('click', this.handleClick, options);
|
|
105
112
|
}
|
|
106
113
|
if (this.props.handleEscapeKeydown) {
|
|
107
114
|
var _this$props$editorRef2;
|
|
@@ -132,6 +139,7 @@ function withReactEditorViewOuterListeners(Component) {
|
|
|
132
139
|
handleEnterKeydown = _ref.handleEnterKeydown,
|
|
133
140
|
handleEscapeKeydown = _ref.handleEscapeKeydown,
|
|
134
141
|
closeOnTab = _ref.closeOnTab,
|
|
142
|
+
captureClick = _ref.captureClick,
|
|
135
143
|
props = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
136
144
|
var isActiveProp = hasIsOpen(props) ? props.isOpen : true;
|
|
137
145
|
var _useState = (0, _react.useState)(false),
|
|
@@ -163,7 +171,8 @@ function withReactEditorViewOuterListeners(Component) {
|
|
|
163
171
|
handleClickOutside: handleClickOutside,
|
|
164
172
|
handleEnterKeydown: handleEnterKeydown,
|
|
165
173
|
handleEscapeKeydown: handleEscapeKeydown,
|
|
166
|
-
closeOnTab: closeOnTab
|
|
174
|
+
closeOnTab: closeOnTab,
|
|
175
|
+
captureClick: captureClick
|
|
167
176
|
}, /*#__PURE__*/_react.default.createElement(Component
|
|
168
177
|
// Ignored via go/ees005
|
|
169
178
|
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
@@ -24,6 +24,8 @@ var calculateToolbarPositionAboveSelection = exports.calculateToolbarPositionAbo
|
|
|
24
24
|
return nextPos;
|
|
25
25
|
}
|
|
26
26
|
// scroll wrapper for full page, fall back to document body
|
|
27
|
+
// Ignored via go/ees007
|
|
28
|
+
// eslint-disable-next-line @atlaskit/editor/enforce-todo-comment-format
|
|
27
29
|
// TODO: look into using getScrollGutterOptions()
|
|
28
30
|
var scrollWrapper = editorView.dom.closest('.fabric-editor-popup-scroll-parent') || document.body;
|
|
29
31
|
var wrapperBounds = scrollWrapper.getBoundingClientRect();
|
|
@@ -98,6 +100,8 @@ var calculateToolbarPositionTrackHead = exports.calculateToolbarPositionTrackHea
|
|
|
98
100
|
return nextPos;
|
|
99
101
|
}
|
|
100
102
|
// scroll wrapper for full page, fall back to document body
|
|
103
|
+
// Ignored via go/ees007
|
|
104
|
+
// eslint-disable-next-line @atlaskit/editor/enforce-todo-comment-format
|
|
101
105
|
// TODO: look into using getScrollGutterOptions()
|
|
102
106
|
var scrollWrapper = editorView.dom.closest('.fabric-editor-popup-scroll-parent') || document.body;
|
|
103
107
|
var wrapperBounds = scrollWrapper.getBoundingClientRect();
|
|
@@ -166,7 +166,6 @@ function getMetaFromNode(node, options, normalizeTextParser) {
|
|
|
166
166
|
}
|
|
167
167
|
case 'mention':
|
|
168
168
|
{
|
|
169
|
-
// TODO: Check what should be the fallback when mention does not have a text
|
|
170
169
|
var _text2 = firstChild.attrs.text || '';
|
|
171
170
|
return {
|
|
172
171
|
type: ContentType.MENTION,
|
|
@@ -15,7 +15,6 @@ var DEFAULT_SAMPLING_RATE = 100;
|
|
|
15
15
|
var DEFAULT_SLOW_THRESHOLD = 7;
|
|
16
16
|
function getPerformanceOptions(view) {
|
|
17
17
|
var _nodeViewTracking$sam, _nodeViewTracking$slo;
|
|
18
|
-
// TODO: ED-15663
|
|
19
18
|
// Please, do not copy or use this kind of code below
|
|
20
19
|
// @ts-ignore
|
|
21
20
|
var fakePluginKey = {
|
|
@@ -7,8 +7,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
exports.isTextInput = void 0;
|
|
8
8
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
9
9
|
var _transform = require("@atlaskit/editor-prosemirror/transform");
|
|
10
|
-
// TODO: remove from editor-core utils, re-export from editor-common
|
|
11
|
-
|
|
12
10
|
var isTextInput = exports.isTextInput = function isTextInput(tr) {
|
|
13
11
|
var _tr$steps = (0, _slicedToArray2.default)(tr.steps, 1),
|
|
14
12
|
step = _tr$steps[0];
|
package/dist/cjs/utils/table.js
CHANGED
|
@@ -43,6 +43,8 @@ function getColumnWidths(node) {
|
|
|
43
43
|
return tableColumnWidths;
|
|
44
44
|
}
|
|
45
45
|
function calcTableColumnWidths(node) {
|
|
46
|
+
// Ignored via go/ees007
|
|
47
|
+
// eslint-disable-next-line @atlaskit/editor/enforce-todo-comment-format
|
|
46
48
|
// TODO: replaced with getColumnWidths, which correctly scans entire table for column widths
|
|
47
49
|
if ((0, _platformFeatureFlags.fg)('platform_editor_table_row_span_fix')) {
|
|
48
50
|
var _firstRow = node.firstChild;
|
|
@@ -49,6 +49,8 @@ var validationErrorHandler = exports.validationErrorHandler = function validatio
|
|
|
49
49
|
};
|
|
50
50
|
}
|
|
51
51
|
|
|
52
|
+
// Ignored via go/ees007
|
|
53
|
+
// eslint-disable-next-line @atlaskit/editor/enforce-todo-comment-format
|
|
52
54
|
// TODO: We can repair missing content like `panel` without a `paragraph`.
|
|
53
55
|
if (error.code === 'INVALID_CONTENT_LENGTH') {
|
|
54
56
|
if (error.meta && options.allowUnsupportedBlock && entity.content) {
|
|
@@ -6,6 +6,11 @@ export const aiMessages = defineMessages({
|
|
|
6
6
|
defaultMessage: 'Page title',
|
|
7
7
|
description: 'A fallback suggested title for the suggest title prompt'
|
|
8
8
|
},
|
|
9
|
+
eventHubfallbackSuggestedTitlePrefix: {
|
|
10
|
+
id: 'fabric.editor.ai.eventHub.fallbackSuggestedTitlePrefix',
|
|
11
|
+
defaultMessage: 'Page',
|
|
12
|
+
description: 'A fallback suggested title prefix for the suggest title prompt'
|
|
13
|
+
},
|
|
9
14
|
// Toolbar messages
|
|
10
15
|
aiToolbarTitle: {
|
|
11
16
|
id: 'fabric.editor.ai.toolbar.titleText',
|
|
@@ -20,6 +20,4 @@ export let BROWSER_FREEZE_INTERACTION_TYPE = /*#__PURE__*/function (BROWSER_FREE
|
|
|
20
20
|
BROWSER_FREEZE_INTERACTION_TYPE["CLICKING"] = "clicking";
|
|
21
21
|
BROWSER_FREEZE_INTERACTION_TYPE["PASTING"] = "pasting";
|
|
22
22
|
return BROWSER_FREEZE_INTERACTION_TYPE;
|
|
23
|
-
}({});
|
|
24
|
-
|
|
25
|
-
// TODO: https://product-fabric.atlassian.net/browse/AFP-1418
|
|
23
|
+
}({});
|
|
@@ -117,6 +117,8 @@ export let PROVIDER_ERROR_CODE = /*#__PURE__*/function (PROVIDER_ERROR_CODE) {
|
|
|
117
117
|
|
|
118
118
|
// Collab Provider interface
|
|
119
119
|
|
|
120
|
+
// Ignored via go/ees007
|
|
121
|
+
// eslint-disable-next-line @atlaskit/editor/enforce-todo-comment-format
|
|
120
122
|
// TODO: Deprecate redundant payload types
|
|
121
123
|
|
|
122
124
|
export let DisconnectReason = /*#__PURE__*/function (DisconnectReason) {
|