@atlaskit/editor-common 87.6.0 → 87.6.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +34 -0
- package/dist/cjs/extensibility/Extension/Extension/index.js +2 -1
- package/dist/cjs/extensibility/Extension/Extension/styles.js +4 -0
- package/dist/cjs/extensibility/MultiBodiedExtension/styles.js +1 -1
- package/dist/cjs/extensibility/extensionNodeView.js +13 -0
- package/dist/cjs/keymaps/index.js +7 -4
- package/dist/cjs/lazy-node-view/index.js +10 -3
- package/dist/cjs/lazy-node-view/node-view.js +32 -20
- package/dist/cjs/lazy-node-view/replace-node-views.js +94 -25
- package/dist/cjs/monitoring/error.js +1 -1
- package/dist/cjs/styles/shared/code-block.js +3 -4
- package/dist/cjs/ui/DropList/index.js +1 -1
- package/dist/es2019/extensibility/Extension/Extension/index.js +2 -1
- package/dist/es2019/extensibility/Extension/Extension/styles.js +4 -0
- package/dist/es2019/extensibility/MultiBodiedExtension/styles.js +1 -1
- package/dist/es2019/extensibility/extensionNodeView.js +11 -0
- package/dist/es2019/keymaps/index.js +2 -1
- package/dist/es2019/lazy-node-view/index.js +10 -3
- package/dist/es2019/lazy-node-view/node-view.js +6 -1
- package/dist/es2019/lazy-node-view/replace-node-views.js +94 -28
- package/dist/es2019/monitoring/error.js +1 -1
- package/dist/es2019/styles/shared/code-block.js +15 -3
- package/dist/es2019/ui/DropList/index.js +1 -1
- package/dist/esm/extensibility/Extension/Extension/index.js +2 -1
- package/dist/esm/extensibility/Extension/Extension/styles.js +4 -0
- package/dist/esm/extensibility/MultiBodiedExtension/styles.js +1 -1
- package/dist/esm/extensibility/extensionNodeView.js +13 -0
- package/dist/esm/keymaps/index.js +2 -1
- package/dist/esm/lazy-node-view/index.js +10 -3
- package/dist/esm/lazy-node-view/node-view.js +32 -20
- package/dist/esm/lazy-node-view/replace-node-views.js +94 -25
- package/dist/esm/monitoring/error.js +1 -1
- package/dist/esm/styles/shared/code-block.js +3 -4
- package/dist/esm/ui/DropList/index.js +1 -1
- package/dist/types/extensibility/extensionNodeView.d.ts +1 -0
- package/dist/types/keymaps/index.d.ts +2 -0
- package/dist/types/lazy-node-view/index.d.ts +5 -2
- package/dist/types/lazy-node-view/node-view.d.ts +6 -1
- package/dist/types/lazy-node-view/replace-node-views.d.ts +15 -25
- package/dist/types/lazy-node-view/types.d.ts +7 -0
- package/dist/types/styles/shared/code-block.d.ts +1 -0
- package/dist/types-ts4.5/extensibility/extensionNodeView.d.ts +1 -0
- package/dist/types-ts4.5/keymaps/index.d.ts +2 -0
- package/dist/types-ts4.5/lazy-node-view/index.d.ts +5 -2
- package/dist/types-ts4.5/lazy-node-view/node-view.d.ts +6 -1
- package/dist/types-ts4.5/lazy-node-view/replace-node-views.d.ts +15 -25
- package/dist/types-ts4.5/lazy-node-view/types.d.ts +7 -0
- package/dist/types-ts4.5/styles/shared/code-block.d.ts +1 -0
- package/package.json +6 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,39 @@
|
|
|
1
1
|
# @atlaskit/editor-common
|
|
2
2
|
|
|
3
|
+
## 87.6.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#128785](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/128785)
|
|
8
|
+
[`175fd06e412c2`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/175fd06e412c2) -
|
|
9
|
+
[ux] Increase bodied macro padding to account for new editor resize controller future feature
|
|
10
|
+
- [#128413](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/128413)
|
|
11
|
+
[`2df8a92126a8d`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/2df8a92126a8d) -
|
|
12
|
+
[ux] We are testing input behavior change inside of an extension body. Now when attempting to
|
|
13
|
+
register inputs, like typing, from an element inside an extension body, it should not accidently
|
|
14
|
+
instead register in the editor body. If this fix is successful it will be available in a later
|
|
15
|
+
release.
|
|
16
|
+
|
|
17
|
+
## 87.6.1
|
|
18
|
+
|
|
19
|
+
### Patch Changes
|
|
20
|
+
|
|
21
|
+
- [#128180](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/128180)
|
|
22
|
+
[`51b4ef21250bf`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/51b4ef21250bf) -
|
|
23
|
+
[ux] [EDF-1228](https://product-fabric.atlassian.net/browse/EDF-1228) - add shortcut to the
|
|
24
|
+
`Continue in Chat` button in the Rovo Agent modal
|
|
25
|
+
- [#128458](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/128458)
|
|
26
|
+
[`26e17a7d801e4`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/26e17a7d801e4) -
|
|
27
|
+
ED-24514 Added ignoreMutationDelegate to lazyNodeView
|
|
28
|
+
- [#128180](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/128180)
|
|
29
|
+
[`d6c81622b7636`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/d6c81622b7636) -
|
|
30
|
+
[ED-24553] Fix Lazy NodeView race conditions when multiple Editors are running at the same time
|
|
31
|
+
- [#127940](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/127940)
|
|
32
|
+
[`7f340ec35b8a4`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/7f340ec35b8a4) -
|
|
33
|
+
[ux] ED-24320 Hook up decorators for toggled on and toggled off wrapping states in floating
|
|
34
|
+
toolbar
|
|
35
|
+
- Updated dependencies
|
|
36
|
+
|
|
3
37
|
## 87.6.0
|
|
4
38
|
|
|
5
39
|
### Minor Changes
|
|
@@ -83,7 +83,8 @@ function ExtensionWithPluginState(props) {
|
|
|
83
83
|
'without-frame': removeBorder
|
|
84
84
|
});
|
|
85
85
|
var newContentClassNames = (0, _classnames2.default)({
|
|
86
|
-
'with-padding-styles': showMacroInteractionDesignUpdates
|
|
86
|
+
'with-padding-styles': showMacroInteractionDesignUpdates,
|
|
87
|
+
'with-bodied-padding-styles': hasBody && showMacroInteractionDesignUpdates
|
|
87
88
|
});
|
|
88
89
|
var contentClassNames = (0, _classnames2.default)('extension-content', 'block', {
|
|
89
90
|
'remove-border': showMacroInteractionDesignUpdates
|
|
@@ -74,6 +74,10 @@ var contentWrapper = exports.contentWrapper = (0, _react.css)({
|
|
|
74
74
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
|
|
75
75
|
'&.with-padding-styles': {
|
|
76
76
|
padding: "var(--ds-space-100, 8px)"
|
|
77
|
+
},
|
|
78
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
|
|
79
|
+
'&.with-bodied-padding-styles': {
|
|
80
|
+
padding: "var(--ds-space-100, 8px)".concat(" ", "var(--ds-space-250, 20px)") // account for upcoming editor elements drag & drop feature
|
|
77
81
|
}
|
|
78
82
|
});
|
|
79
83
|
|
|
@@ -44,7 +44,7 @@ var mbeExtensionWrapperCSSStyles = exports.mbeExtensionWrapperCSSStyles = (0, _r
|
|
|
44
44
|
},
|
|
45
45
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
|
|
46
46
|
'&.with-padding-background-styles': {
|
|
47
|
-
padding: "var(--ds-space-100, 8px)",
|
|
47
|
+
padding: "var(--ds-space-100, 8px)".concat(" ", "var(--ds-space-250, 20px)"),
|
|
48
48
|
background: 'transparent'
|
|
49
49
|
}
|
|
50
50
|
});
|
|
@@ -12,6 +12,7 @@ var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits
|
|
|
12
12
|
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
13
13
|
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
14
14
|
var _react = _interopRequireDefault(require("react"));
|
|
15
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
15
16
|
var _reactNodeView = _interopRequireDefault(require("../react-node-view"));
|
|
16
17
|
var _Extension = require("./Extension");
|
|
17
18
|
var _ExtensionNodeWrapper = require("./ExtensionNodeWrapper");
|
|
@@ -38,6 +39,18 @@ var ExtensionNode = exports.ExtensionNode = /*#__PURE__*/function (_ReactNodeVie
|
|
|
38
39
|
// children a chance to recalc
|
|
39
40
|
return this.node.type.isAtom || mutation.type !== 'selection' && mutation.attributeName !== 'data-layout';
|
|
40
41
|
}
|
|
42
|
+
|
|
43
|
+
// When interacting with input elements inside an extension's body, the events
|
|
44
|
+
// bubble up to the editor and get handled by it. This almost always gets in the way
|
|
45
|
+
// of being able to actually interact with said input in the extension, i.e.
|
|
46
|
+
// typing inside a text field (in an extension body) will print the text in the editor
|
|
47
|
+
// content area instead. This change prevents the editor view from trying to handle these events,
|
|
48
|
+
// when the target of the event is an input element, so the extension can.
|
|
49
|
+
}, {
|
|
50
|
+
key: "stopEvent",
|
|
51
|
+
value: function stopEvent(event) {
|
|
52
|
+
return event.target instanceof HTMLInputElement && (0, _platformFeatureFlags.fg)('cc_page_experiences_live_search_wysiwyg');
|
|
53
|
+
}
|
|
41
54
|
}, {
|
|
42
55
|
key: "getContentDOM",
|
|
43
56
|
value: function getContentDOM() {
|
|
@@ -82,12 +82,14 @@ exports.backspace = exports.altPaste = exports.alignRight = exports.alignLeft =
|
|
|
82
82
|
exports.bindKeymapArrayWithCommand = bindKeymapArrayWithCommand;
|
|
83
83
|
exports.bindKeymapWithCommand = bindKeymapWithCommand;
|
|
84
84
|
exports.bindKeymapWithEditorCommand = bindKeymapWithEditorCommand;
|
|
85
|
-
exports.find = exports.escape = exports.enter = exports.dragToMoveUp = exports.dragToMoveDown = exports.deleteRow = exports.deleteKey = exports.deleteColumn = exports.decreaseMediaSize = exports.cut = exports.ctrlBackSpace = exports.copy = exports.clearFormatting = void 0;
|
|
85
|
+
exports.find = exports.escape = exports.enter = exports.dragToMoveUp = exports.dragToMoveDown = exports.deleteRow = exports.deleteKey = exports.deleteColumn = exports.decreaseMediaSize = exports.cut = exports.ctrlBackSpace = exports.copy = exports.continueInRovoChat = exports.clearFormatting = void 0;
|
|
86
86
|
exports.findKeyMapForBrowser = findKeyMapForBrowser;
|
|
87
87
|
exports.findKeymapByDescription = findKeymapByDescription;
|
|
88
88
|
exports.findShortcutByDescription = findShortcutByDescription;
|
|
89
89
|
exports.findShortcutByKeymap = findShortcutByKeymap;
|
|
90
|
-
exports.
|
|
90
|
+
exports.focusToContextMenuTrigger = exports.focusTableResizer = void 0;
|
|
91
|
+
exports.formatShortcut = formatShortcut;
|
|
92
|
+
exports.forwardDelete = void 0;
|
|
91
93
|
exports.getAriaKeyshortcuts = getAriaKeyshortcuts;
|
|
92
94
|
exports.insertRule = exports.insertNewLine = exports.indentList = exports.indent = exports.increaseMediaSize = void 0;
|
|
93
95
|
exports.isCapsLockOnAndModifyKeyboardEvent = isCapsLockOnAndModifyKeyboardEvent;
|
|
@@ -100,8 +102,8 @@ Object.defineProperty(exports, "keymap", {
|
|
|
100
102
|
exports.makeKeyMapArrayWithCommon = makeKeyMapArrayWithCommon;
|
|
101
103
|
exports.makeKeyMapWithCommon = makeKeyMapWithCommon;
|
|
102
104
|
exports.makeKeymap = makeKeymap;
|
|
103
|
-
exports.
|
|
104
|
-
exports.toggleUnderline = exports.toggleTaskItemCheckbox = exports.toggleTable = exports.toggleSuperscript = exports.toggleSubscript = exports.toggleStrikethrough = exports.toggleOrderedList = exports.toggleItalic = exports.toggleHighlightPalette = exports.toggleHeading6 = exports.toggleHeading5 = exports.toggleHeading4 = exports.toggleHeading3 = exports.toggleHeading2 = exports.toggleHeading1 = exports.toggleCode = exports.toggleBulletList = void 0;
|
|
105
|
+
exports.tab = exports.submit = exports.startColumnResizing = exports.splitListItem = exports.splitCodeBlock = exports.space = exports.showElementDragHandle = exports.shiftTab = exports.shiftEnter = exports.shiftBackspace = exports.shiftArrowUp = exports.setNormalText = exports.selectTable = exports.selectRow = exports.selectColumn = exports.redo = exports.previousCell = exports.pastePlainText = exports.paste = exports.outdentList = exports.outdent = exports.openHelp = exports.nextCell = exports.navToFloatingToolbar = exports.navToEditorToolbar = exports.moveUp = exports.moveRowUp = exports.moveRowDown = exports.moveRight = exports.moveLeft = exports.moveDown = exports.moveColumnRight = exports.moveColumnLeft = void 0;
|
|
106
|
+
exports.toggleUnderline = exports.toggleTaskItemCheckbox = exports.toggleTable = exports.toggleSuperscript = exports.toggleSubscript = exports.toggleStrikethrough = exports.toggleOrderedList = exports.toggleItalic = exports.toggleHighlightPalette = exports.toggleHeading6 = exports.toggleHeading5 = exports.toggleHeading4 = exports.toggleHeading3 = exports.toggleHeading2 = exports.toggleHeading1 = exports.toggleCode = exports.toggleBulletList = exports.toggleBold = exports.toggleBlockQuote = void 0;
|
|
105
107
|
exports.tooltip = tooltip;
|
|
106
108
|
exports.undo = void 0;
|
|
107
109
|
var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
|
|
@@ -214,6 +216,7 @@ var focusToContextMenuTrigger = exports.focusToContextMenuTrigger = makeKeyMapWi
|
|
|
214
216
|
var dragToMoveUp = exports.dragToMoveUp = makeKeyMapWithCommon('Move node up in the document', 'Ctrl-Shift-ArrowUp');
|
|
215
217
|
var dragToMoveDown = exports.dragToMoveDown = makeKeyMapWithCommon('Move node down in the document', 'Ctrl-Shift-ArrowDown');
|
|
216
218
|
var showElementDragHandle = exports.showElementDragHandle = makeKeyMapWithCommon('Show drag handle for editor element', 'Ctrl-Shift-h');
|
|
219
|
+
var continueInRovoChat = exports.continueInRovoChat = makeKeyMapWithCommon('Continue in Rovo chat', 'Alt-Enter');
|
|
217
220
|
var arrowKeysMap = {
|
|
218
221
|
// for reference: https://wincent.com/wiki/Unicode_representations_of_modifier_keys
|
|
219
222
|
ARROWLEFT: "\u2190",
|
|
@@ -76,7 +76,10 @@ var withLazyLoading = exports.withLazyLoading = function withLazyLoading(_ref) {
|
|
|
76
76
|
var nodeName = _ref.nodeName,
|
|
77
77
|
loader = _ref.loader,
|
|
78
78
|
getNodeViewOptions = _ref.getNodeViewOptions,
|
|
79
|
-
dispatchAnalyticsEvent = _ref.dispatchAnalyticsEvent
|
|
79
|
+
dispatchAnalyticsEvent = _ref.dispatchAnalyticsEvent,
|
|
80
|
+
_ref$lazyNodeViewOpti = _ref.lazyNodeViewOptions,
|
|
81
|
+
_ref$lazyNodeViewOpti2 = _ref$lazyNodeViewOpti === void 0 ? {} : _ref$lazyNodeViewOpti,
|
|
82
|
+
ignoreMutationDelegate = _ref$lazyNodeViewOpti2.ignoreMutationDelegate;
|
|
80
83
|
var createLazyNodeView = function createLazyNodeView(node, view, getPos, decorations) {
|
|
81
84
|
var _node$type;
|
|
82
85
|
var requestedNodes = requestedNodesPerEditorView.get(view);
|
|
@@ -85,7 +88,9 @@ var withLazyLoading = exports.withLazyLoading = function withLazyLoading(_ref) {
|
|
|
85
88
|
}
|
|
86
89
|
var wasAlreadyRequested = requestedNodes.has(nodeName);
|
|
87
90
|
if (wasAlreadyRequested) {
|
|
88
|
-
return new _nodeView.LazyNodeView(node, view, getPos
|
|
91
|
+
return new _nodeView.LazyNodeView(node, view, getPos, {
|
|
92
|
+
ignoreMutationDelegate: ignoreMutationDelegate
|
|
93
|
+
});
|
|
89
94
|
}
|
|
90
95
|
requestedNodes.add(nodeName);
|
|
91
96
|
loader().then(function (nodeViewFuncModule) {
|
|
@@ -109,7 +114,9 @@ var withLazyLoading = exports.withLazyLoading = function withLazyLoading(_ref) {
|
|
|
109
114
|
// },
|
|
110
115
|
// });
|
|
111
116
|
}
|
|
112
|
-
return new _nodeView.LazyNodeView(node, view, getPos
|
|
117
|
+
return new _nodeView.LazyNodeView(node, view, getPos, {
|
|
118
|
+
ignoreMutationDelegate: ignoreMutationDelegate
|
|
119
|
+
});
|
|
113
120
|
};
|
|
114
121
|
return createLazyNodeView;
|
|
115
122
|
};
|
|
@@ -5,31 +5,43 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
7
|
exports.LazyNodeView = void 0;
|
|
8
|
-
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
9
8
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
9
|
+
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
10
10
|
var _model = require("@atlaskit/editor-prosemirror/model");
|
|
11
11
|
/**
|
|
12
12
|
* 🧱 Internal: Editor FE Platform
|
|
13
13
|
*
|
|
14
14
|
* A NodeView that serves as a placeholder until the actual NodeView is loaded.
|
|
15
15
|
*/
|
|
16
|
-
var LazyNodeView = exports.LazyNodeView = /*#__PURE__*/
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
this.dom
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
16
|
+
var LazyNodeView = exports.LazyNodeView = /*#__PURE__*/function () {
|
|
17
|
+
function LazyNodeView(node, view, getPos) {
|
|
18
|
+
var _node$type;
|
|
19
|
+
var options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
|
|
20
|
+
(0, _classCallCheck2.default)(this, LazyNodeView);
|
|
21
|
+
this.ignoreMutationDelegate = options === null || options === void 0 ? void 0 : options.ignoreMutationDelegate;
|
|
22
|
+
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') {
|
|
23
|
+
this.dom = document.createElement('div');
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
var fallback = _model.DOMSerializer.renderSpec(document, node.type.spec.toDOM(node));
|
|
27
|
+
this.dom = fallback.dom;
|
|
28
|
+
this.contentDOM = fallback.contentDOM;
|
|
29
|
+
if (this.dom instanceof HTMLElement) {
|
|
30
|
+
// This attribute is mostly used for debugging purposed
|
|
31
|
+
// It will help us to found out when the node was replaced
|
|
32
|
+
this.dom.setAttribute('data-lazy-node-view', node.type.name);
|
|
33
|
+
// This is used on Libra tests
|
|
34
|
+
// We are using this to make sure all lazy noded were replaced
|
|
35
|
+
// before the test started
|
|
36
|
+
this.dom.setAttribute('data-lazy-node-view-fallback', 'true');
|
|
37
|
+
}
|
|
34
38
|
}
|
|
35
|
-
|
|
39
|
+
(0, _createClass2.default)(LazyNodeView, [{
|
|
40
|
+
key: "ignoreMutation",
|
|
41
|
+
value: function ignoreMutation(mutation) {
|
|
42
|
+
var _this$ignoreMutationD;
|
|
43
|
+
return !!((_this$ignoreMutationD = this.ignoreMutationDelegate) !== null && _this$ignoreMutationD !== void 0 && _this$ignoreMutationD.call(this, mutation));
|
|
44
|
+
}
|
|
45
|
+
}]);
|
|
46
|
+
return LazyNodeView;
|
|
47
|
+
}();
|
|
@@ -7,6 +7,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
exports.queueReplaceNodeViews = exports.debouncedReplaceNodeviews = void 0;
|
|
8
8
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
9
9
|
var _debounce = _interopRequireDefault(require("lodash/debounce"));
|
|
10
|
+
var _memoize = _interopRequireDefault(require("lodash/memoize"));
|
|
10
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; }
|
|
11
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; }
|
|
12
13
|
/**
|
|
@@ -17,11 +18,10 @@ var isFirefox = /gecko\/\d/i.test(navigator.userAgent);
|
|
|
17
18
|
/**
|
|
18
19
|
* 🧱 Internal: Editor FE Platform
|
|
19
20
|
*
|
|
20
|
-
*
|
|
21
|
+
* Replaces the node views in a ProseMirror editor with lazy-loaded node views.
|
|
21
22
|
*
|
|
22
23
|
* This function is used to update the `nodeViews` property of the `EditorView` after lazy-loaded
|
|
23
|
-
* node views have been loaded.
|
|
24
|
-
* not happen too frequently, which can be performance-intensive.
|
|
24
|
+
* node views have been loaded.
|
|
25
25
|
*
|
|
26
26
|
* The function checks if there are any loaded node views in the cache associated with the given
|
|
27
27
|
* `EditorView`. If there are, it replaces the current `nodeViews` in the `EditorView` with the
|
|
@@ -45,9 +45,9 @@ var isFirefox = /gecko\/\d/i.test(navigator.userAgent);
|
|
|
45
45
|
* 'tableCell': TableCellViewConstructor,
|
|
46
46
|
* });
|
|
47
47
|
*
|
|
48
|
-
*
|
|
48
|
+
* replaceNodeViews(cache, view);
|
|
49
49
|
*/
|
|
50
|
-
var
|
|
50
|
+
var replaceNodeViews = function replaceNodeViews(cache, view) {
|
|
51
51
|
var loadedNodeviews = cache.get(view);
|
|
52
52
|
if (!loadedNodeviews || Object.keys(loadedNodeviews).length === 0) {
|
|
53
53
|
return;
|
|
@@ -57,40 +57,109 @@ var debouncedReplaceNodeviews = exports.debouncedReplaceNodeviews = (0, _debounc
|
|
|
57
57
|
// Make sure the cache is cleaned
|
|
58
58
|
// From here, we will access the loaded node views by lexical scope
|
|
59
59
|
cache.set(view, {});
|
|
60
|
+
var callback = function callback() {
|
|
61
|
+
var currentNodeViews = view.props.nodeViews;
|
|
62
|
+
var nextNodeViews = _objectSpread(_objectSpread({}, currentNodeViews), nodeViewsToReplace);
|
|
63
|
+
view.setProps({
|
|
64
|
+
nodeViews: nextNodeViews
|
|
65
|
+
});
|
|
66
|
+
};
|
|
67
|
+
// eslint-disable-next-line compat/compat
|
|
68
|
+
var idle = window.requestIdleCallback;
|
|
60
69
|
|
|
61
70
|
/*
|
|
62
71
|
* For reasons that goes beyond my knowledge
|
|
63
72
|
* some Firefox versions aren't calling the requestIdleCallback.
|
|
64
73
|
*
|
|
65
|
-
* So, we need this check to make sure we
|
|
66
|
-
*
|
|
67
|
-
* setting timeout to 2s to ensure this function is called, but not before prosemirror render
|
|
68
|
-
* and other important tasks are done - adjust this timeout based on user feedback
|
|
74
|
+
* So, we need this check to make sure we are using the requestAnimationFrame for Firefox
|
|
69
75
|
*/
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
}
|
|
75
|
-
// eslint-disable-next-line compat/compat
|
|
76
|
-
window.requestIdleCallback(callback, {
|
|
76
|
+
if (isFirefox || typeof idle !== 'function') {
|
|
77
|
+
window.requestAnimationFrame(callback);
|
|
78
|
+
} else {
|
|
79
|
+
idle(callback, {
|
|
77
80
|
timeout: 2000
|
|
78
81
|
});
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
var currentNodeViews = view.props.nodeViews;
|
|
82
|
-
var nextNodeViews = _objectSpread(_objectSpread({}, currentNodeViews), nodeViewsToReplace);
|
|
83
|
-
view.setProps({
|
|
84
|
-
nodeViews: nextNodeViews
|
|
85
|
-
});
|
|
86
|
-
});
|
|
87
|
-
});
|
|
82
|
+
}
|
|
83
|
+
};
|
|
88
84
|
|
|
89
85
|
/**
|
|
90
86
|
* 🧱 Internal: Editor FE Platform
|
|
91
87
|
*/
|
|
92
88
|
var loadedPerEditorView = new WeakMap();
|
|
93
89
|
|
|
90
|
+
/**
|
|
91
|
+
* 🧱 Internal: Editor FE Platform
|
|
92
|
+
* Based on https://github.com/lodash/lodash/issues/2403#issuecomment-1706130395
|
|
93
|
+
*
|
|
94
|
+
* Creates a debounced function that delays invoking the provided function until after a specified
|
|
95
|
+
* wait time has elapsed since the last time the debounced function was invoked. Additionally, the
|
|
96
|
+
* debounced function is memoized so that the same function instance is used for each unique set
|
|
97
|
+
* of arguments based on the resolver.
|
|
98
|
+
*
|
|
99
|
+
* This is particularly useful in scenarios where you want to debounce function calls while ensuring
|
|
100
|
+
* that each unique input combination receives its own debounced function instance. It's a combination
|
|
101
|
+
* of lodash's `debounce` and `memoize`.
|
|
102
|
+
*
|
|
103
|
+
* @template T
|
|
104
|
+
* @param {T} func - The function to debounce.
|
|
105
|
+
* @param {number} [wait=0] - The number of milliseconds to delay.
|
|
106
|
+
* @param {Object} [options] - The options object to pass to `debounce`.
|
|
107
|
+
* @param {Function} [resolver] - The function to resolve the cache key for memoization.
|
|
108
|
+
* @returns {Function} A new debounced and memoized function.
|
|
109
|
+
*
|
|
110
|
+
* @example
|
|
111
|
+
* const debouncedFunction = memoizeDebounce(myFunction, 300, { leading: true }, myResolver);
|
|
112
|
+
* debouncedFunction(arg1, arg2);
|
|
113
|
+
*/
|
|
114
|
+
function memoizeDebounce(func) {
|
|
115
|
+
var wait = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
116
|
+
var options = arguments.length > 2 ? arguments[2] : undefined;
|
|
117
|
+
var resolver = arguments.length > 3 ? arguments[3] : undefined;
|
|
118
|
+
var mem = (0, _memoize.default)(function () {
|
|
119
|
+
return (0, _debounce.default)(func, wait, options);
|
|
120
|
+
}, resolver);
|
|
121
|
+
return function () {
|
|
122
|
+
return mem.apply(void 0, arguments).apply(void 0, arguments);
|
|
123
|
+
};
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
/**
|
|
127
|
+
* 🧱 Internal: Editor FE Platform
|
|
128
|
+
*
|
|
129
|
+
* Debounced and memoized version of `replaceNodeViews`.
|
|
130
|
+
*
|
|
131
|
+
* This function is designed to update the `nodeViews` property of an `EditorView` after a
|
|
132
|
+
* period of inactivity (debounce), ensuring that multiple rapid updates do not occur in quick
|
|
133
|
+
* succession. It uses lodash's `debounce` to handle the debouncing.
|
|
134
|
+
*
|
|
135
|
+
* Memoization is crucial here to ensure that each `EditorView` instance has its own opportunity
|
|
136
|
+
* to update the node views. Without memoization, if you have multiple `EditorView` instances on
|
|
137
|
+
* the same page, only one instance would potentially call `view.setProps`, which could lead to
|
|
138
|
+
* incorrect or missing updates in other `EditorView` instances. By memoizing the debounced function,
|
|
139
|
+
* we ensure that each `EditorView` maintains its own debounced update logic.
|
|
140
|
+
*
|
|
141
|
+
* @param {CacheLoadedReactNodeViews} cache - A WeakMap that stores the loaded node views for each
|
|
142
|
+
* `EditorView`. The key is the `EditorView`, and the value is a record of node type names
|
|
143
|
+
* to their corresponding `NodeViewConstructor`.
|
|
144
|
+
* @param {EditorView} view - The ProseMirror `EditorView` instance whose `nodeViews` property
|
|
145
|
+
* needs to be updated.
|
|
146
|
+
*
|
|
147
|
+
* This function is typically not called directly. Instead, it is invoked through `queueReplaceNodeViews`,
|
|
148
|
+
* which handles adding node views to the cache and triggering this debounced update.
|
|
149
|
+
*/
|
|
150
|
+
var debouncedReplaceNodeviews = exports.debouncedReplaceNodeviews = memoizeDebounce(replaceNodeViews, 0,
|
|
151
|
+
/**
|
|
152
|
+
* Use the default debounce options:
|
|
153
|
+
* {leading: false, trailing: true}
|
|
154
|
+
*/
|
|
155
|
+
undefined, function (cache, view) {
|
|
156
|
+
/**
|
|
157
|
+
* EditorView is a singleton.
|
|
158
|
+
* There is only one instance per Editor.
|
|
159
|
+
*/
|
|
160
|
+
return view;
|
|
161
|
+
});
|
|
162
|
+
|
|
94
163
|
/**
|
|
95
164
|
* 🧱 Internal: Editor FE Platform
|
|
96
165
|
*/
|
|
@@ -17,7 +17,7 @@ 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 && Object.prototype.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 = "87.6.
|
|
20
|
+
var packageVersion = "87.6.2";
|
|
21
21
|
var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
|
|
22
22
|
// Remove URL as it has UGC
|
|
23
23
|
// TODO: Sanitise the URL instead of just removing it
|
|
@@ -23,12 +23,11 @@ var CodeBlockSharedCssClassName = exports.CodeBlockSharedCssClassName = {
|
|
|
23
23
|
DS_CODEBLOCK: '[data-ds--code--code-block]',
|
|
24
24
|
CODEBLOCK_LINE_NUMBER_GUTTER_FG_WRAP: 'line-number-gutter--fg-wrap',
|
|
25
25
|
CODEBLOCK_CONTENT_WRAPPED: 'code-content--wrapped',
|
|
26
|
-
CODEBLOCK_CONTAINER_LINE_NUMBER_WRAPPED: 'code-content__line-number--wrapped'
|
|
26
|
+
CODEBLOCK_CONTAINER_LINE_NUMBER_WRAPPED: 'code-content__line-number--wrapped',
|
|
27
|
+
CODEBLOCK_WRAPPED: 'code-block--wrapped'
|
|
27
28
|
};
|
|
28
|
-
|
|
29
|
-
// TODO: ED-24222 Remove flex styling and hardcoded word
|
|
30
29
|
var codeBlockSharedStyles = exports.codeBlockSharedStyles = function codeBlockSharedStyles() {
|
|
31
|
-
return (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n\t.", " {\n\t\tposition: relative;\n\t\tbackground-color: ", ";\n\t\tborder-radius: ", ";\n\t\tmargin: ", " 0 0 0;\n\t\tfont-family: ", ";\n\t\tmin-width: ", "px;\n\t\tcursor: pointer;\n\n\t\t--ds--code--bg-color: transparent;\n\n\t\t/* This is necessary to allow for arrow key navigation in/out of code blocks in Firefox. */\n\t\twhite-space: normal;\n\n\t\t.", " {\n\t\t\tposition: absolute;\n\t\t\tvisibility: hidden;\n\t\t\theight: 1.5rem;\n\t\t\ttop: 0px;\n\t\t\tleft: 0px;\n\t\t}\n\n\t\t.", " {\n\t\t\tposition: absolute;\n\t\t\tvisibility: hidden;\n\t\t\theight: 1.5rem;\n\t\t\tbottom: 0px;\n\t\t\tright: 0px;\n\t\t}\n\n\t\t.", " {\n\t\t\tbackground-color: ", ";\n\t\t\tdisplay: flex;\n\t\t\tborder-radius: ", ";\n\t\t\twidth: 100%;\n\t\t\tcounter-reset: line;\n\t\t\toverflow-x: auto;\n\n\t\t\tbackground-image: ", ";\n\n\t\t\tbackground-repeat: no-repeat;\n\t\t\tbackground-attachment: local, local, local, local, scroll, scroll, scroll, scroll;\n\t\t\tbackground-size:\n\t\t\t\t", " 100%,\n\t\t\t\t", " 100%,\n\t\t\t\t", " 100%,\n\t\t\t\t", " 100%,\n\t\t\t\t", " 100%,\n\t\t\t\t1px 100%,\n\t\t\t\t", " 100%,\n\t\t\t\t1px 100%;\n\t\t\tbackground-position:\n\t\t\t\t0 0,\n\t\t\t\t0 0,\n\t\t\t\t100% 0,\n\t\t\t\t100% 0,\n\t\t\t\t100% 0,\n\t\t\t\t100% 0,\n\t\t\t\t0 0,\n\t\t\t\t0 0;\n\n\t\t\t/* Be careful if refactoring this; it is needed to keep arrow key navigation in Firefox consistent with other browsers. */\n\t\t\toverflow-y: hidden;\n\t\t}\n\n\t\t.", " {\n\t\t\tflex-shrink: 0;\n\t\t\ttext-align: right;\n\t\t\tbackground-color: ", ";\n\t\t\tpadding: ", ";\n\t\t\tposition: relative;\n\n\t\t\tspan {\n\t\t\t\tdisplay: block;\n\t\t\t\tline-height: 0;\n\t\t\t\tfont-size: 0;\n\n\t\t\t\t::before {\n\t\t\t\t\tdisplay: inline-block;\n\t\t\t\t\tcontent: counter(line);\n\t\t\t\t\tcounter-increment: line;\n\t\t\t\t\tcolor: ", ";\n\t\t\t\t\tfont-size: ", ";\n\t\t\t\t\tline-height: 1.5rem;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t.", " {\n\t\t\tbackground-color: ", ";\n\t\t\tpadding: ", ";\n\t\t\tposition: relative;\n\t\t\twidth: 1rem;\n\t\t}\n\n\t\t.", " {\n\t\t\tdisplay: flex;\n\t\t\tflex: 1;\n\n\t\t\tcode {\n\t\t\t\tflex-grow: 1;\n\t\t\t\ttab-size: 4;\n\t\t\t\tcursor: text;\n\t\t\t\tcolor: ", ";\n\t\t\t\tborder-radius: ", ";\n\t\t\t\tmargin: ", ";\n\t\t\t\twhite-space: pre;\n\t\t\t\tfont-size: ", ";\n\t\t\t\tline-height: 1.5rem;\n\t\t\t}\n\t\t}\n\n\t\t.", " {\n\t\t\tcode {\n\t\t\t\tcounter-reset: line var(--line-num, 0);\n\t\t\t\tword-break: break-word;\n\t\t\t\twhite-space: pre-wrap;\n\t\t\t}\n\t\t}\n\n\t\t.", " {\n\t\t\tcounter-increment: line;\n\t\t\tline-height: 1rem;\n\t\t\tpointer-events: none;\n\n\t\t\t::before {\n\t\t\t\ttext-align: right;\n\t\t\t\tmin-width: 1.5rem;\n\t\t\t\tdisplay: block;\n\t\t\t\theight: 1rem;\n\t\t\t\tposition: absolute;\n\t\t\t\tpadding-right: ", ";\n\t\t\t\tpadding-left: ", ";\n\t\t\t\tmargin-top: ", ";\n\t\t\t\tmargin-right: ", ";\n\t\t\t\tleft: -0.5rem;\n\t\t\t\tcolor: ", ";\n\t\t\t\tfont-size: ", ";\n\t\t\t\tcontent: counter(line);\n\t\t\t}\n\t\t}\n\t}\n"])), CodeBlockSharedCssClassName.CODEBLOCK_CONTAINER, "var(--ds-surface-raised, transparent)", "var(--ds-border-radius, 3px)", _editorSharedStyles.blockNodesVerticalMargin, _editorSharedStyles.akEditorCodeFontFamily, _editorSharedStyles.akEditorTableCellMinWidth, CodeBlockSharedCssClassName.CODEBLOCK_START, CodeBlockSharedCssClassName.CODEBLOCK_END, CodeBlockSharedCssClassName.CODEBLOCK_CONTENT_WRAPPER, "var(--ds-background-neutral, ".concat(_colors.N20, ")"), "var(--ds-border-radius, 3px)", (0, _editorSharedStyles.overflowShadow)({
|
|
30
|
+
return (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n\t.", "\n\t\t> .", "\n\t\t> .", "\n\t\tcode {\n\t\tword-break: break-word;\n\t\twhite-space: pre-wrap;\n\t}\n\n\t.", " {\n\t\tposition: relative;\n\t\tbackground-color: ", ";\n\t\tborder-radius: ", ";\n\t\tmargin: ", " 0 0 0;\n\t\tfont-family: ", ";\n\t\tmin-width: ", "px;\n\t\tcursor: pointer;\n\n\t\t--ds--code--bg-color: transparent;\n\n\t\t/* This is necessary to allow for arrow key navigation in/out of code blocks in Firefox. */\n\t\twhite-space: normal;\n\n\t\t.", " {\n\t\t\tposition: absolute;\n\t\t\tvisibility: hidden;\n\t\t\theight: 1.5rem;\n\t\t\ttop: 0px;\n\t\t\tleft: 0px;\n\t\t}\n\n\t\t.", " {\n\t\t\tposition: absolute;\n\t\t\tvisibility: hidden;\n\t\t\theight: 1.5rem;\n\t\t\tbottom: 0px;\n\t\t\tright: 0px;\n\t\t}\n\n\t\t.", " {\n\t\t\tword-break: break-word;\n\t\t\twhite-space: pre-wrap;\n\t\t}\n\n\t\t.", " {\n\t\t\tbackground-color: ", ";\n\t\t\tdisplay: flex;\n\t\t\tborder-radius: ", ";\n\t\t\twidth: 100%;\n\t\t\tcounter-reset: line;\n\t\t\toverflow-x: auto;\n\n\t\t\tbackground-image: ", ";\n\n\t\t\tbackground-repeat: no-repeat;\n\t\t\tbackground-attachment: local, local, local, local, scroll, scroll, scroll, scroll;\n\t\t\tbackground-size:\n\t\t\t\t", " 100%,\n\t\t\t\t", " 100%,\n\t\t\t\t", " 100%,\n\t\t\t\t", " 100%,\n\t\t\t\t", " 100%,\n\t\t\t\t1px 100%,\n\t\t\t\t", " 100%,\n\t\t\t\t1px 100%;\n\t\t\tbackground-position:\n\t\t\t\t0 0,\n\t\t\t\t0 0,\n\t\t\t\t100% 0,\n\t\t\t\t100% 0,\n\t\t\t\t100% 0,\n\t\t\t\t100% 0,\n\t\t\t\t0 0,\n\t\t\t\t0 0;\n\n\t\t\t/* Be careful if refactoring this; it is needed to keep arrow key navigation in Firefox consistent with other browsers. */\n\t\t\toverflow-y: hidden;\n\t\t}\n\n\t\t.", " {\n\t\t\tflex-shrink: 0;\n\t\t\ttext-align: right;\n\t\t\tbackground-color: ", ";\n\t\t\tpadding: ", ";\n\t\t\tposition: relative;\n\n\t\t\tspan {\n\t\t\t\tdisplay: block;\n\t\t\t\tline-height: 0;\n\t\t\t\tfont-size: 0;\n\n\t\t\t\t::before {\n\t\t\t\t\tdisplay: inline-block;\n\t\t\t\t\tcontent: counter(line);\n\t\t\t\t\tcounter-increment: line;\n\t\t\t\t\tcolor: ", ";\n\t\t\t\t\tfont-size: ", ";\n\t\t\t\t\tline-height: 1.5rem;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t.", " {\n\t\t\tbackground-color: ", ";\n\t\t\tpadding: ", ";\n\t\t\tposition: relative;\n\t\t\twidth: 1rem;\n\t\t}\n\n\t\t.", " {\n\t\t\tdisplay: flex;\n\t\t\tflex: 1;\n\n\t\t\tcode {\n\t\t\t\tflex-grow: 1;\n\t\t\t\ttab-size: 4;\n\t\t\t\tcursor: text;\n\t\t\t\tcolor: ", ";\n\t\t\t\tborder-radius: ", ";\n\t\t\t\tmargin: ", ";\n\t\t\t\twhite-space: pre;\n\t\t\t\tfont-size: ", ";\n\t\t\t\tline-height: 1.5rem;\n\t\t\t}\n\t\t}\n\n\t\t.", " {\n\t\t\tcode {\n\t\t\t\tcounter-reset: line var(--line-num, 0);\n\t\t\t\tword-break: break-word;\n\t\t\t\twhite-space: pre-wrap;\n\t\t\t}\n\t\t}\n\n\t\t.", " {\n\t\t\tcounter-increment: line;\n\t\t\tline-height: 1rem;\n\t\t\tpointer-events: none;\n\n\t\t\t::before {\n\t\t\t\ttext-align: right;\n\t\t\t\tmin-width: 1.5rem;\n\t\t\t\tdisplay: block;\n\t\t\t\theight: 1rem;\n\t\t\t\tposition: absolute;\n\t\t\t\tpadding-right: ", ";\n\t\t\t\tpadding-left: ", ";\n\t\t\t\tmargin-top: ", ";\n\t\t\t\tmargin-right: ", ";\n\t\t\t\tleft: -0.5rem;\n\t\t\t\tcolor: ", ";\n\t\t\t\tfont-size: ", ";\n\t\t\t\tcontent: counter(line);\n\t\t\t}\n\t\t}\n\t}\n"])), CodeBlockSharedCssClassName.CODEBLOCK_WRAPPED, CodeBlockSharedCssClassName.CODEBLOCK_CONTENT_WRAPPER, CodeBlockSharedCssClassName.CODEBLOCK_CONTENT, CodeBlockSharedCssClassName.CODEBLOCK_CONTAINER, "var(--ds-surface-raised, transparent)", "var(--ds-border-radius, 3px)", _editorSharedStyles.blockNodesVerticalMargin, _editorSharedStyles.akEditorCodeFontFamily, _editorSharedStyles.akEditorTableCellMinWidth, CodeBlockSharedCssClassName.CODEBLOCK_START, CodeBlockSharedCssClassName.CODEBLOCK_END, CodeBlockSharedCssClassName.CODEBLOCK_WRAPPED, CodeBlockSharedCssClassName.CODEBLOCK_CONTENT_WRAPPER, "var(--ds-background-neutral, ".concat(_colors.N20, ")"), "var(--ds-border-radius, 3px)", (0, _editorSharedStyles.overflowShadow)({
|
|
32
31
|
leftCoverWidth: "var(--ds-space-300, 24px)"
|
|
33
32
|
}), "var(--ds-space-300, 24px)", "var(--ds-space-300, 24px)", "var(--ds-space-100, 8px)", "var(--ds-space-100, 8px)", "var(--ds-space-100, 8px)", "var(--ds-space-100, 8px)", CodeBlockSharedCssClassName.CODEBLOCK_LINE_NUMBER_GUTTER, "var(--ds-background-neutral, ".concat(_colors.N30, ")"), "var(--ds-space-100, 8px)", "var(--ds-text-subtlest, ".concat(_colors.N400, ")"), (0, _editorSharedStyles.relativeFontSizeToBase16)((0, _constants.fontSize)()), CodeBlockSharedCssClassName.CODEBLOCK_LINE_NUMBER_GUTTER_FG_WRAP, "var(--ds-background-neutral, ".concat(_colors.N30, ")"), "var(--ds-space-100, 8px)", CodeBlockSharedCssClassName.CODEBLOCK_CONTENT, "var(--ds-text, ".concat(_colors.N800, ")"), "var(--ds-border-radius, 3px)", "var(--ds-space-100, 8px)", (0, _editorSharedStyles.relativeFontSizeToBase16)((0, _constants.fontSize)()), CodeBlockSharedCssClassName.CODEBLOCK_CONTENT_WRAPPED, CodeBlockSharedCssClassName.CODEBLOCK_CONTAINER_LINE_NUMBER_WRAPPED, "var(--ds-space-100, 8px)", "var(--ds-space-100, 8px)", "var(--ds-space-050, 4px)", "var(--ds-space-100, 8px)", "var(--ds-text-subtlest, ".concat(_colors.N400, ")"), (0, _editorSharedStyles.relativeFontSizeToBase16)((0, _constants.fontSize)()));
|
|
34
33
|
};
|
|
@@ -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 = "87.6.
|
|
26
|
+
var packageVersion = "87.6.2";
|
|
27
27
|
var halfFocusRing = 1;
|
|
28
28
|
var dropOffset = '0, 8';
|
|
29
29
|
var DropList = /*#__PURE__*/function (_Component) {
|
|
@@ -75,7 +75,8 @@ function ExtensionWithPluginState(props) {
|
|
|
75
75
|
'without-frame': removeBorder
|
|
76
76
|
});
|
|
77
77
|
const newContentClassNames = classnames({
|
|
78
|
-
'with-padding-styles': showMacroInteractionDesignUpdates
|
|
78
|
+
'with-padding-styles': showMacroInteractionDesignUpdates,
|
|
79
|
+
'with-bodied-padding-styles': hasBody && showMacroInteractionDesignUpdates
|
|
79
80
|
});
|
|
80
81
|
const contentClassNames = classnames('extension-content', 'block', {
|
|
81
82
|
'remove-border': showMacroInteractionDesignUpdates
|
|
@@ -67,6 +67,10 @@ export const contentWrapper = css({
|
|
|
67
67
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
|
|
68
68
|
'&.with-padding-styles': {
|
|
69
69
|
padding: "var(--ds-space-100, 8px)"
|
|
70
|
+
},
|
|
71
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
|
|
72
|
+
'&.with-bodied-padding-styles': {
|
|
73
|
+
padding: `${"var(--ds-space-100, 8px)"} ${"var(--ds-space-250, 20px)"}` // account for upcoming editor elements drag & drop feature
|
|
70
74
|
}
|
|
71
75
|
});
|
|
72
76
|
|
|
@@ -38,7 +38,7 @@ export const mbeExtensionWrapperCSSStyles = css(wrapperDefault, {
|
|
|
38
38
|
},
|
|
39
39
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
|
|
40
40
|
'&.with-padding-background-styles': {
|
|
41
|
-
padding: "var(--ds-space-100, 8px)",
|
|
41
|
+
padding: `${"var(--ds-space-100, 8px)"} ${"var(--ds-space-250, 20px)"}`,
|
|
42
42
|
background: 'transparent'
|
|
43
43
|
}
|
|
44
44
|
});
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
2
3
|
import ReactNodeView from '../react-node-view';
|
|
3
4
|
import { Extension } from './Extension';
|
|
4
5
|
import { ExtensionNodeWrapper } from './ExtensionNodeWrapper';
|
|
@@ -15,6 +16,16 @@ export class ExtensionNode extends ReactNodeView {
|
|
|
15
16
|
// children a chance to recalc
|
|
16
17
|
return this.node.type.isAtom || mutation.type !== 'selection' && mutation.attributeName !== 'data-layout';
|
|
17
18
|
}
|
|
19
|
+
|
|
20
|
+
// When interacting with input elements inside an extension's body, the events
|
|
21
|
+
// bubble up to the editor and get handled by it. This almost always gets in the way
|
|
22
|
+
// of being able to actually interact with said input in the extension, i.e.
|
|
23
|
+
// typing inside a text field (in an extension body) will print the text in the editor
|
|
24
|
+
// content area instead. This change prevents the editor view from trying to handle these events,
|
|
25
|
+
// when the target of the event is an input element, so the extension can.
|
|
26
|
+
stopEvent(event) {
|
|
27
|
+
return event.target instanceof HTMLInputElement && fg('cc_page_experiences_live_search_wysiwyg');
|
|
28
|
+
}
|
|
18
29
|
getContentDOM() {
|
|
19
30
|
if (this.node.isInline) {
|
|
20
31
|
return;
|
|
@@ -102,6 +102,7 @@ export const focusToContextMenuTrigger = makeKeyMapWithCommon('Focus table conte
|
|
|
102
102
|
export const dragToMoveUp = makeKeyMapWithCommon('Move node up in the document', 'Ctrl-Shift-ArrowUp');
|
|
103
103
|
export const dragToMoveDown = makeKeyMapWithCommon('Move node down in the document', 'Ctrl-Shift-ArrowDown');
|
|
104
104
|
export const showElementDragHandle = makeKeyMapWithCommon('Show drag handle for editor element', 'Ctrl-Shift-h');
|
|
105
|
+
export const continueInRovoChat = makeKeyMapWithCommon('Continue in Rovo chat', 'Alt-Enter');
|
|
105
106
|
const arrowKeysMap = {
|
|
106
107
|
// for reference: https://wincent.com/wiki/Unicode_representations_of_modifier_keys
|
|
107
108
|
ARROWLEFT: '\u2190',
|
|
@@ -116,7 +117,7 @@ const tooltipShortcutStyle = css({
|
|
|
116
117
|
// NOTE: This might not actually do anything: https://atlassian.slack.com/archives/CFG3PSQ9E/p1647395052443259?thread_ts=1647394572.556029&cid=CFG3PSQ9E
|
|
117
118
|
label: 'tooltip-shortcut'
|
|
118
119
|
});
|
|
119
|
-
function formatShortcut(keymap) {
|
|
120
|
+
export function formatShortcut(keymap) {
|
|
120
121
|
let shortcut;
|
|
121
122
|
if (browser.mac) {
|
|
122
123
|
// for reference: https://wincent.com/wiki/Unicode_representations_of_modifier_keys
|
|
@@ -65,7 +65,10 @@ export const withLazyLoading = ({
|
|
|
65
65
|
nodeName,
|
|
66
66
|
loader,
|
|
67
67
|
getNodeViewOptions,
|
|
68
|
-
dispatchAnalyticsEvent
|
|
68
|
+
dispatchAnalyticsEvent,
|
|
69
|
+
lazyNodeViewOptions: {
|
|
70
|
+
ignoreMutationDelegate
|
|
71
|
+
} = {}
|
|
69
72
|
}) => {
|
|
70
73
|
const createLazyNodeView = (node, view, getPos, decorations) => {
|
|
71
74
|
var _node$type, _node$type$spec;
|
|
@@ -75,7 +78,9 @@ export const withLazyLoading = ({
|
|
|
75
78
|
}
|
|
76
79
|
const wasAlreadyRequested = requestedNodes.has(nodeName);
|
|
77
80
|
if (wasAlreadyRequested) {
|
|
78
|
-
return new LazyNodeView(node, view, getPos
|
|
81
|
+
return new LazyNodeView(node, view, getPos, {
|
|
82
|
+
ignoreMutationDelegate
|
|
83
|
+
});
|
|
79
84
|
}
|
|
80
85
|
requestedNodes.add(nodeName);
|
|
81
86
|
loader().then(nodeViewFuncModule => {
|
|
@@ -99,7 +104,9 @@ export const withLazyLoading = ({
|
|
|
99
104
|
// },
|
|
100
105
|
// });
|
|
101
106
|
}
|
|
102
|
-
return new LazyNodeView(node, view, getPos
|
|
107
|
+
return new LazyNodeView(node, view, getPos, {
|
|
108
|
+
ignoreMutationDelegate
|
|
109
|
+
});
|
|
103
110
|
};
|
|
104
111
|
return createLazyNodeView;
|
|
105
112
|
};
|
|
@@ -5,8 +5,9 @@ import { DOMSerializer } from '@atlaskit/editor-prosemirror/model';
|
|
|
5
5
|
* A NodeView that serves as a placeholder until the actual NodeView is loaded.
|
|
6
6
|
*/
|
|
7
7
|
export class LazyNodeView {
|
|
8
|
-
constructor(node, view, getPos) {
|
|
8
|
+
constructor(node, view, getPos, options = {}) {
|
|
9
9
|
var _node$type, _node$type$spec;
|
|
10
|
+
this.ignoreMutationDelegate = options === null || options === void 0 ? void 0 : options.ignoreMutationDelegate;
|
|
10
11
|
if (typeof ((_node$type = node.type) === null || _node$type === void 0 ? void 0 : (_node$type$spec = _node$type.spec) === null || _node$type$spec === void 0 ? void 0 : _node$type$spec.toDOM) !== 'function') {
|
|
11
12
|
this.dom = document.createElement('div');
|
|
12
13
|
return;
|
|
@@ -24,4 +25,8 @@ export class LazyNodeView {
|
|
|
24
25
|
this.dom.setAttribute('data-lazy-node-view-fallback', 'true');
|
|
25
26
|
}
|
|
26
27
|
}
|
|
28
|
+
ignoreMutation(mutation) {
|
|
29
|
+
var _this$ignoreMutationD;
|
|
30
|
+
return !!((_this$ignoreMutationD = this.ignoreMutationDelegate) !== null && _this$ignoreMutationD !== void 0 && _this$ignoreMutationD.call(this, mutation));
|
|
31
|
+
}
|
|
27
32
|
}
|