@atlaskit/editor-common 99.5.1 → 99.5.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 +8 -0
- package/dist/cjs/card/MediaAndEmbedsToolbar/index.js +3 -12
- package/dist/cjs/commands/index.js +42 -50
- package/dist/cjs/commands/insert-block.js +1 -4
- package/dist/cjs/element-browser/hooks/use-select-and-focus-on-arrow-navigation.js +1 -6
- package/dist/cjs/extensibility/Extension/Extension/index.js +6 -3
- package/dist/cjs/extensibility/Extension/InlineExtension/index.js +4 -2
- package/dist/cjs/extensibility/Extension/Lozenge/ExtensionLabel.js +16 -6
- package/dist/cjs/extensibility/Extension/Lozenge/LozengeComponent.js +4 -2
- package/dist/cjs/extensibility/Extension/Lozenge/index.js +4 -2
- package/dist/cjs/extensibility/MultiBodiedExtension/index.js +4 -2
- package/dist/cjs/extensibility/extensionNodeView.js +1 -2
- package/dist/cjs/guideline/dynamicGuideline.js +1 -4
- package/dist/cjs/guideline/relativeGuideline.js +3 -12
- package/dist/cjs/guideline/updateGuideline.js +1 -4
- package/dist/cjs/hooks/useSharedPluginStateSelector/useSharedPluginStateSelector.js +9 -11
- package/dist/cjs/insert/index.js +1 -4
- package/dist/cjs/keymaps/index.js +0 -3
- package/dist/cjs/lazy-node-view/index.js +1 -6
- package/dist/cjs/lazy-node-view/node-view.js +0 -2
- package/dist/cjs/link/LinkPicker/HyperlinkAddToolbar/HyperlinkAddToolbar.js +0 -2
- package/dist/cjs/lists/analytics.js +0 -2
- package/dist/cjs/mark/commands.js +2 -11
- package/dist/cjs/media-single/utils.js +0 -5
- package/dist/cjs/monitoring/error.js +1 -1
- package/dist/cjs/node-width/index.js +1 -4
- package/dist/cjs/paste/md-plugins/ignore-list-heading-md-plugin.js +0 -5
- package/dist/cjs/preset/core-plugin/requestDocument.js +1 -2
- package/dist/cjs/react-node-view/index.js +1 -9
- package/dist/cjs/resizer/Resizer.js +2 -8
- package/dist/cjs/selection/gap-cursor/actions.js +2 -8
- package/dist/cjs/selection/index.js +0 -2
- package/dist/cjs/selection-based-node-view/SelectionBasedNodeView.js +0 -6
- package/dist/cjs/ui/DropList/index.js +1 -1
- package/dist/cjs/ui/Layer/index.js +0 -2
- package/dist/cjs/ui/MediaSingle/grid.js +2 -8
- package/dist/cjs/ui/MediaSingle/styled.js +0 -4
- package/dist/cjs/ui/Popup/utils.js +0 -7
- package/dist/cjs/ui/ResizerLegacy/index.js +0 -4
- package/dist/cjs/ui/unsupported-content-helper.js +0 -2
- package/dist/cjs/utils/breakout.js +0 -2
- package/dist/cjs/utils/commands.js +1 -4
- package/dist/cjs/utils/editor-core-utils.js +0 -3
- package/dist/cjs/utils/input-rules.js +1 -4
- package/dist/cjs/utils/nodes.js +1 -6
- package/dist/cjs/utils/page-element-counts.js +10 -3
- package/dist/cjs/utils/performance/measure-tti.js +0 -5
- package/dist/cjs/utils/plugin-state-factory.js +0 -2
- package/dist/cjs/utils/processRawValue.js +0 -6
- package/dist/cjs/utils/prosemirror/autojoin.js +0 -2
- package/dist/cjs/utils/rich-media-utils.js +1 -4
- package/dist/cjs/utils/track-unsupported-content.js +2 -8
- package/dist/cjs/utils/validate-using-spec.js +1 -7
- package/dist/cjs/with-plugin-state/index.js +0 -4
- package/dist/es2019/card/MediaAndEmbedsToolbar/index.js +3 -12
- package/dist/es2019/commands/index.js +2 -8
- package/dist/es2019/commands/insert-block.js +1 -4
- package/dist/es2019/element-browser/hooks/use-select-and-focus-on-arrow-navigation.js +1 -6
- package/dist/es2019/extensibility/Extension/Extension/index.js +6 -3
- package/dist/es2019/extensibility/Extension/InlineExtension/index.js +4 -2
- package/dist/es2019/extensibility/Extension/Lozenge/ExtensionLabel.js +16 -6
- package/dist/es2019/extensibility/Extension/Lozenge/LozengeComponent.js +4 -2
- package/dist/es2019/extensibility/Extension/Lozenge/index.js +4 -2
- package/dist/es2019/extensibility/MultiBodiedExtension/index.js +4 -2
- package/dist/es2019/extensibility/extensionNodeView.js +0 -3
- package/dist/es2019/guideline/dynamicGuideline.js +1 -4
- package/dist/es2019/guideline/relativeGuideline.js +3 -12
- package/dist/es2019/guideline/snapping.js +1 -4
- package/dist/es2019/guideline/updateGuideline.js +1 -4
- package/dist/es2019/hooks/useSharedPluginStateSelector/useSharedPluginStateSelector.js +9 -11
- package/dist/es2019/insert/index.js +1 -4
- package/dist/es2019/keymaps/index.js +0 -3
- package/dist/es2019/lazy-node-view/index.js +1 -6
- package/dist/es2019/lazy-node-view/node-view.js +0 -2
- package/dist/es2019/link/LinkPicker/HyperlinkAddToolbar/HyperlinkAddToolbar.js +0 -2
- package/dist/es2019/lists/analytics.js +0 -2
- package/dist/es2019/mark/commands.js +2 -11
- package/dist/es2019/media-single/utils.js +0 -5
- package/dist/es2019/monitoring/error.js +1 -1
- package/dist/es2019/node-width/index.js +1 -4
- package/dist/es2019/paste/md-plugins/ignore-list-heading-md-plugin.js +0 -5
- package/dist/es2019/preset/core-plugin/requestDocument.js +1 -2
- package/dist/es2019/react-node-view/index.js +0 -7
- package/dist/es2019/resizer/Resizer.js +2 -8
- package/dist/es2019/selection/gap-cursor/actions.js +2 -8
- package/dist/es2019/selection/index.js +0 -2
- package/dist/es2019/selection-based-node-view/SelectionBasedNodeView.js +0 -6
- package/dist/es2019/ui/DropList/index.js +1 -1
- package/dist/es2019/ui/Layer/index.js +0 -2
- package/dist/es2019/ui/MediaSingle/grid.js +2 -8
- package/dist/es2019/ui/MediaSingle/styled.js +0 -4
- package/dist/es2019/ui/Popup/utils.js +0 -7
- package/dist/es2019/ui/ResizerLegacy/index.js +0 -4
- package/dist/es2019/ui/unsupported-content-helper.js +0 -2
- package/dist/es2019/utils/breakout.js +0 -2
- package/dist/es2019/utils/commands.js +1 -4
- package/dist/es2019/utils/compare-props.js +1 -4
- package/dist/es2019/utils/editor-core-utils.js +0 -3
- package/dist/es2019/utils/input-rules.js +1 -4
- package/dist/es2019/utils/nodes.js +1 -6
- package/dist/es2019/utils/page-element-counts.js +10 -3
- package/dist/es2019/utils/performance/measure-tti.js +0 -6
- package/dist/es2019/utils/plugin-state-factory.js +0 -2
- package/dist/es2019/utils/processRawValue.js +0 -6
- package/dist/es2019/utils/prosemirror/autojoin.js +0 -2
- package/dist/es2019/utils/rich-media-utils.js +1 -4
- package/dist/es2019/utils/track-unsupported-content.js +3 -12
- package/dist/es2019/utils/validate-using-spec.js +1 -7
- package/dist/es2019/with-plugin-state/index.js +0 -4
- package/dist/esm/card/MediaAndEmbedsToolbar/index.js +3 -12
- package/dist/esm/commands/index.js +42 -50
- package/dist/esm/commands/insert-block.js +1 -4
- package/dist/esm/element-browser/hooks/use-select-and-focus-on-arrow-navigation.js +1 -6
- package/dist/esm/extensibility/Extension/Extension/index.js +6 -3
- package/dist/esm/extensibility/Extension/InlineExtension/index.js +4 -2
- package/dist/esm/extensibility/Extension/Lozenge/ExtensionLabel.js +16 -6
- package/dist/esm/extensibility/Extension/Lozenge/LozengeComponent.js +4 -2
- package/dist/esm/extensibility/Extension/Lozenge/index.js +4 -2
- package/dist/esm/extensibility/MultiBodiedExtension/index.js +4 -2
- package/dist/esm/extensibility/extensionNodeView.js +0 -3
- package/dist/esm/guideline/dynamicGuideline.js +1 -4
- package/dist/esm/guideline/relativeGuideline.js +3 -12
- package/dist/esm/guideline/updateGuideline.js +1 -4
- package/dist/esm/hooks/useSharedPluginStateSelector/useSharedPluginStateSelector.js +9 -11
- package/dist/esm/insert/index.js +1 -4
- package/dist/esm/keymaps/index.js +0 -3
- package/dist/esm/lazy-node-view/index.js +1 -6
- package/dist/esm/lazy-node-view/node-view.js +0 -2
- package/dist/esm/link/LinkPicker/HyperlinkAddToolbar/HyperlinkAddToolbar.js +0 -2
- package/dist/esm/lists/analytics.js +0 -2
- package/dist/esm/mark/commands.js +2 -11
- package/dist/esm/media-single/utils.js +0 -5
- package/dist/esm/monitoring/error.js +1 -1
- package/dist/esm/node-width/index.js +1 -4
- package/dist/esm/paste/md-plugins/ignore-list-heading-md-plugin.js +0 -5
- package/dist/esm/preset/core-plugin/requestDocument.js +1 -2
- package/dist/esm/react-node-view/index.js +1 -9
- package/dist/esm/resizer/Resizer.js +2 -8
- package/dist/esm/selection/gap-cursor/actions.js +2 -8
- package/dist/esm/selection/index.js +0 -2
- package/dist/esm/selection-based-node-view/SelectionBasedNodeView.js +0 -6
- package/dist/esm/ui/DropList/index.js +1 -1
- package/dist/esm/ui/Layer/index.js +0 -2
- package/dist/esm/ui/MediaSingle/grid.js +2 -8
- package/dist/esm/ui/MediaSingle/styled.js +0 -4
- package/dist/esm/ui/Popup/utils.js +0 -7
- package/dist/esm/ui/ResizerLegacy/index.js +0 -4
- package/dist/esm/ui/unsupported-content-helper.js +0 -2
- package/dist/esm/utils/breakout.js +0 -2
- package/dist/esm/utils/commands.js +1 -4
- package/dist/esm/utils/editor-core-utils.js +0 -3
- package/dist/esm/utils/input-rules.js +1 -4
- package/dist/esm/utils/nodes.js +1 -6
- package/dist/esm/utils/page-element-counts.js +10 -3
- package/dist/esm/utils/performance/measure-tti.js +0 -6
- package/dist/esm/utils/plugin-state-factory.js +0 -2
- package/dist/esm/utils/processRawValue.js +0 -6
- package/dist/esm/utils/prosemirror/autojoin.js +0 -2
- package/dist/esm/utils/rich-media-utils.js +1 -4
- package/dist/esm/utils/track-unsupported-content.js +2 -8
- package/dist/esm/utils/validate-using-spec.js +1 -7
- package/dist/esm/with-plugin-state/index.js +0 -4
- package/dist/types/extensibility/Extension/Lozenge/ExtensionLabel.d.ts +3 -1
- package/dist/types/extensibility/Extension/Lozenge/LozengeComponent.d.ts +3 -1
- package/dist/types/extensibility/Extension/Lozenge/index.d.ts +2 -0
- package/dist/types-ts4.5/extensibility/Extension/Lozenge/ExtensionLabel.d.ts +3 -1
- package/dist/types-ts4.5/extensibility/Extension/Lozenge/LozengeComponent.d.ts +3 -1
- package/dist/types-ts4.5/extensibility/Extension/Lozenge/index.d.ts +2 -0
- package/package.json +1 -1
|
@@ -23,10 +23,7 @@ var layoutToWidth = exports.layoutToWidth = {
|
|
|
23
23
|
* Calculates width of parent node of a nested node (inside layouts, extension)
|
|
24
24
|
* If current node selection is not nested will return undefined
|
|
25
25
|
*/
|
|
26
|
-
var getParentNodeWidth = exports.getParentNodeWidth = function getParentNodeWidth(pos, state, containerWidth, isFullWidthModeEnabled
|
|
27
|
-
// Ignored via go/ees005
|
|
28
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
29
|
-
) {
|
|
26
|
+
var getParentNodeWidth = exports.getParentNodeWidth = function getParentNodeWidth(pos, state, containerWidth, isFullWidthModeEnabled) {
|
|
30
27
|
if (!pos) {
|
|
31
28
|
return;
|
|
32
29
|
}
|
|
@@ -12,8 +12,6 @@ exports.default = _default;
|
|
|
12
12
|
* prosemirror-markdown cannot conform to the schema
|
|
13
13
|
*/
|
|
14
14
|
|
|
15
|
-
// Ignored via go/ees005
|
|
16
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
17
15
|
function handleHeadingOpen(state, token, acc, index) {
|
|
18
16
|
var _state$tokens;
|
|
19
17
|
var isInListItem = ((_state$tokens = state.tokens[index - 1]) === null || _state$tokens === void 0 ? void 0 : _state$tokens.type) === 'list_item_open';
|
|
@@ -23,9 +21,6 @@ function handleHeadingOpen(state, token, acc, index) {
|
|
|
23
21
|
acc.push(token);
|
|
24
22
|
}
|
|
25
23
|
}
|
|
26
|
-
|
|
27
|
-
// Ignored via go/ees005
|
|
28
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
29
24
|
function handleHeadingClose(state, token, acc, index) {
|
|
30
25
|
var _state$tokens2;
|
|
31
26
|
var isInListItem = ((_state$tokens2 = state.tokens[index + 1]) === null || _state$tokens2 === void 0 ? void 0 : _state$tokens2.type) === 'list_item_close';
|
|
@@ -46,8 +46,7 @@ function createThrottleSchedule(callback) {
|
|
|
46
46
|
}
|
|
47
47
|
var scheduleDocumentRequest = exports.scheduleDocumentRequest = createThrottleSchedule(returnDocumentRequest);
|
|
48
48
|
|
|
49
|
-
//
|
|
50
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/max-params
|
|
49
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
51
50
|
function returnDocumentRequest(editorView, callback, transformer, fireAnalyticsEvent) {
|
|
52
51
|
var _editorView$state;
|
|
53
52
|
var _ref = (_editorView$state = editorView === null || editorView === void 0 ? void 0 : editorView.state) !== null && _editorView$state !== void 0 ? _editorView$state : {},
|
|
@@ -32,8 +32,6 @@ var _getInlineNodeViewProducer = require("./getInlineNodeViewProducer");
|
|
|
32
32
|
// Disable no-re-export rule for entry point files
|
|
33
33
|
/* eslint-disable @atlaskit/editor/no-re-export */
|
|
34
34
|
var ReactNodeView = exports.default = /*#__PURE__*/function () {
|
|
35
|
-
// Ignored via go/ees005
|
|
36
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
37
35
|
function ReactNodeView(_node, view, getPos, portalProviderAPI, eventDispatcher, reactComponentProps,
|
|
38
36
|
// Ignored via go/ees005
|
|
39
37
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
@@ -222,9 +220,6 @@ var ReactNodeView = exports.default = /*#__PURE__*/function () {
|
|
|
222
220
|
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
223
221
|
}, props)) : null;
|
|
224
222
|
}
|
|
225
|
-
|
|
226
|
-
// Ignored via go/ees005
|
|
227
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
228
223
|
}, {
|
|
229
224
|
key: "update",
|
|
230
225
|
value: function update(node, decorations, _innerDecorations) {
|
|
@@ -294,10 +289,7 @@ var ReactNodeView = exports.default = /*#__PURE__*/function () {
|
|
|
294
289
|
}
|
|
295
290
|
}], [{
|
|
296
291
|
key: "fromComponent",
|
|
297
|
-
value:
|
|
298
|
-
// Ignored via go/ees005
|
|
299
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
300
|
-
function fromComponent(
|
|
292
|
+
value: function fromComponent(
|
|
301
293
|
// Ignored via go/ees005
|
|
302
294
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
303
295
|
component, portalProviderAPI, eventDispatcher, props, viewShouldUpdate) {
|
|
@@ -78,10 +78,7 @@ var ResizerNext = function ResizerNext(props, ref) {
|
|
|
78
78
|
setIsResizing(true);
|
|
79
79
|
handleResizeStart();
|
|
80
80
|
}, [handleResizeStart]);
|
|
81
|
-
var onResize = (0, _react.useCallback)(function (_event, _direction, _elementRef, delta
|
|
82
|
-
// Ignored via go/ees005
|
|
83
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
84
|
-
) {
|
|
81
|
+
var onResize = (0, _react.useCallback)(function (_event, _direction, _elementRef, delta) {
|
|
85
82
|
if (!handleResize) {
|
|
86
83
|
return;
|
|
87
84
|
}
|
|
@@ -97,10 +94,7 @@ var ResizerNext = function ResizerNext(props, ref) {
|
|
|
97
94
|
};
|
|
98
95
|
handleResize(originalState, delta);
|
|
99
96
|
}, [handleResize]);
|
|
100
|
-
var onResizeStop = (0, _react.useCallback)(function (_event, _direction, _elementRef, delta
|
|
101
|
-
// Ignored via go/ees005
|
|
102
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
103
|
-
) {
|
|
97
|
+
var onResizeStop = (0, _react.useCallback)(function (_event, _direction, _elementRef, delta) {
|
|
104
98
|
var resizableCurrent = resizable.current;
|
|
105
99
|
if (!resizableCurrent || !resizableCurrent.state.original) {
|
|
106
100
|
return;
|
|
@@ -9,10 +9,7 @@ var _selection = require("./selection");
|
|
|
9
9
|
var _isValidTargetNode = require("./utils/is-valid-target-node");
|
|
10
10
|
// This function captures clicks outside of the ProseMirror contentEditable area
|
|
11
11
|
// see also description of "handleClick" in gap-cursor pm-plugin
|
|
12
|
-
var captureCursorCoords = function captureCursorCoords(event, editorRef, posAtCoords, tr
|
|
13
|
-
// Ignored via go/ees005
|
|
14
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
15
|
-
) {
|
|
12
|
+
var captureCursorCoords = function captureCursorCoords(event, editorRef, posAtCoords, tr) {
|
|
16
13
|
var rect = editorRef.getBoundingClientRect();
|
|
17
14
|
|
|
18
15
|
// capture clicks before the first block element
|
|
@@ -49,10 +46,7 @@ var captureCursorCoords = function captureCursorCoords(event, editorRef, posAtCo
|
|
|
49
46
|
}
|
|
50
47
|
return null;
|
|
51
48
|
};
|
|
52
|
-
var setSelectionTopLevelBlocks = exports.setSelectionTopLevelBlocks = function setSelectionTopLevelBlocks(tr, event, editorRef, posAtCoords, editorFocused
|
|
53
|
-
// Ignored via go/ees005
|
|
54
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
55
|
-
) {
|
|
49
|
+
var setSelectionTopLevelBlocks = exports.setSelectionTopLevelBlocks = function setSelectionTopLevelBlocks(tr, event, editorRef, posAtCoords, editorFocused) {
|
|
56
50
|
var cursorCoords = captureCursorCoords(event, editorRef, posAtCoords, tr);
|
|
57
51
|
if (!cursorCoords) {
|
|
58
52
|
return;
|
|
@@ -232,8 +232,6 @@ var selectNode = exports.selectNode = function selectNode(pos) {
|
|
|
232
232
|
};
|
|
233
233
|
};
|
|
234
234
|
function createSelectionClickHandler(nodes, isValidTarget, options) {
|
|
235
|
-
// Ignored via go/ees005
|
|
236
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
237
235
|
return function handleClickOn(view, pos, node, nodePos, event, direct) {
|
|
238
236
|
if (options.useLongPressSelection) {
|
|
239
237
|
return false;
|
|
@@ -38,8 +38,6 @@ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.
|
|
|
38
38
|
* }```
|
|
39
39
|
*/
|
|
40
40
|
var SelectionBasedNodeView = exports.SelectionBasedNodeView = /*#__PURE__*/function (_ReactNodeView) {
|
|
41
|
-
// Ignored via go/ees005
|
|
42
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
43
41
|
function SelectionBasedNodeView(node, view, getPos, portalProviderAPI, eventDispatcher, reactComponentProps,
|
|
44
42
|
// Ignored via go/ees005
|
|
45
43
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
@@ -48,8 +46,6 @@ var SelectionBasedNodeView = exports.SelectionBasedNodeView = /*#__PURE__*/funct
|
|
|
48
46
|
(0, _classCallCheck2.default)(this, SelectionBasedNodeView);
|
|
49
47
|
_this = _callSuper(this, SelectionBasedNodeView, [node, view, getPos, portalProviderAPI, eventDispatcher, reactComponentProps, reactComponent, viewShouldUpdate]);
|
|
50
48
|
(0, _defineProperty2.default)(_this, "isSelectedNode", false);
|
|
51
|
-
// Ignored via go/ees005
|
|
52
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
53
49
|
(0, _defineProperty2.default)(_this, "isNodeInsideSelection", function (from, to, pos, posEnd) {
|
|
54
50
|
var _this$getPositionsWit = _this.getPositionsWithDefault(pos, posEnd);
|
|
55
51
|
pos = _this$getPositionsWit.pos;
|
|
@@ -59,8 +55,6 @@ var SelectionBasedNodeView = exports.SelectionBasedNodeView = /*#__PURE__*/funct
|
|
|
59
55
|
}
|
|
60
56
|
return from <= pos && to >= posEnd;
|
|
61
57
|
});
|
|
62
|
-
// Ignored via go/ees005
|
|
63
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
64
58
|
(0, _defineProperty2.default)(_this, "isSelectionInsideNode", function (from, to, pos, posEnd) {
|
|
65
59
|
var _this$getPositionsWit2 = _this.getPositionsWithDefault(pos, posEnd);
|
|
66
60
|
pos = _this$getPositionsWit2.pos;
|
|
@@ -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 = "99.5.
|
|
26
|
+
var packageVersion = "99.5.2";
|
|
27
27
|
var halfFocusRing = 1;
|
|
28
28
|
var dropOffset = '0, 8';
|
|
29
29
|
// Ignored via go/ees005
|
|
@@ -114,8 +114,6 @@ var Layer = exports.default = /*#__PURE__*/function (_Component) {
|
|
|
114
114
|
* the bottom of the popper not being viewable.
|
|
115
115
|
* Only works if the popper uses viewport as the boundary and has a fixed position ancestor.
|
|
116
116
|
*/
|
|
117
|
-
// Ignored via go/ees005
|
|
118
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
119
117
|
}, {
|
|
120
118
|
key: "calculateMaxHeight",
|
|
121
119
|
value: function calculateMaxHeight(originalHeight, currentHeight, positionTop, cssPosition) {
|
|
@@ -33,10 +33,7 @@ function calcPctFromPx(width, lineLength) {
|
|
|
33
33
|
return (width + _constants.MEDIA_SINGLE_GUTTER_SIZE) / maxWidth;
|
|
34
34
|
}
|
|
35
35
|
var wrappedLayouts = exports.wrappedLayouts = ['wrap-left', 'wrap-right', 'align-end', 'align-start'];
|
|
36
|
-
var calcPctWidth = exports.calcPctWidth = function calcPctWidth(containerWidth, pctWidth, origWidth, origHeight
|
|
37
|
-
// Ignored via go/ees005
|
|
38
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
39
|
-
) {
|
|
36
|
+
var calcPctWidth = exports.calcPctWidth = function calcPctWidth(containerWidth, pctWidth, origWidth, origHeight) {
|
|
40
37
|
return pctWidth && origWidth && origHeight && Math.ceil(calcPxFromPct(pctWidth / 100, containerWidth.lineLength || containerWidth.width));
|
|
41
38
|
};
|
|
42
39
|
var calcMediaPxWidth = exports.calcMediaPxWidth = function calcMediaPxWidth(opts) {
|
|
@@ -86,10 +83,7 @@ var calcMediaPxWidth = exports.calcMediaPxWidth = function calcMediaPxWidth(opts
|
|
|
86
83
|
}
|
|
87
84
|
return origWidth;
|
|
88
85
|
};
|
|
89
|
-
var snapToGrid = exports.snapToGrid = function snapToGrid(gridWidth, width, height, lineLength, gridSize
|
|
90
|
-
// Ignored via go/ees005
|
|
91
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
92
|
-
) {
|
|
86
|
+
var snapToGrid = exports.snapToGrid = function snapToGrid(gridWidth, width, height, lineLength, gridSize) {
|
|
93
87
|
var pxWidth = calcPxFromPct(gridWidth / 100, lineLength);
|
|
94
88
|
var columnSpan = Math.round(calcColumnsFromPx(pxWidth, lineLength, gridSize));
|
|
95
89
|
var alignedWidth = calcPxFromColumns(columnSpan, lineLength, gridSize);
|
|
@@ -54,8 +54,6 @@ function getWidthIfDefaultMode(originalWidth, containerWidth, isInsideOfInlineEx
|
|
|
54
54
|
* then an image in wide or full-width can not be wider than the image's
|
|
55
55
|
* original width.
|
|
56
56
|
*/
|
|
57
|
-
// Ignored via go/ees005
|
|
58
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
59
57
|
function calcLegacyWidth(layout, width) {
|
|
60
58
|
var containerWidth = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
|
|
61
59
|
var fullWidthMode = arguments.length > 3 ? arguments[3] : undefined;
|
|
@@ -83,8 +81,6 @@ function calcLegacyWidth(layout, width) {
|
|
|
83
81
|
* then an image in wide or full-width can not be wider than the image's
|
|
84
82
|
* original width.
|
|
85
83
|
*/
|
|
86
|
-
// Ignored via go/ees005
|
|
87
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
88
84
|
function calcLegacyWidthForInline(layout, width) {
|
|
89
85
|
var containerWidth = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
|
|
90
86
|
var fullWidthMode = arguments.length > 3 ? arguments[3] : undefined;
|
|
@@ -26,8 +26,6 @@ function isTextNode(elem) {
|
|
|
26
26
|
/**
|
|
27
27
|
* Decides if given fitHeight fits below or above the target taking boundaries into account.
|
|
28
28
|
*/
|
|
29
|
-
// Ignored via go/ees005
|
|
30
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
31
29
|
function getVerticalPlacement(target, boundariesElement, fitHeight, alignY, forcePlacement, preventOverflow) {
|
|
32
30
|
if (forcePlacement && alignY) {
|
|
33
31
|
return alignY;
|
|
@@ -64,8 +62,6 @@ function getVerticalPlacement(target, boundariesElement, fitHeight, alignY, forc
|
|
|
64
62
|
/**
|
|
65
63
|
* Decides if given fitWidth fits to the left or to the right of the target taking boundaries into account.
|
|
66
64
|
*/
|
|
67
|
-
// Ignored via go/ees005
|
|
68
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
69
65
|
function getHorizontalPlacement(target, boundariesElement, fitWidth, alignX, forcePlacement, preventOverflow) {
|
|
70
66
|
// force placement unless preventOverflow is enabled
|
|
71
67
|
if (forcePlacement && alignX && !preventOverflow) {
|
|
@@ -94,9 +90,6 @@ function getHorizontalPlacement(target, boundariesElement, fitWidth, alignX, for
|
|
|
94
90
|
}
|
|
95
91
|
return 'right';
|
|
96
92
|
}
|
|
97
|
-
|
|
98
|
-
// Ignored via go/ees005
|
|
99
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
100
93
|
function calculatePlacement(target, boundariesElement, fitWidth, fitHeight, alignX, alignY, forcePlacement, preventOverflow) {
|
|
101
94
|
return [getVerticalPlacement(target, boundariesElement, fitHeight, alignY, forcePlacement, preventOverflow), getHorizontalPlacement(target, boundariesElement, fitWidth, alignX, forcePlacement, preventOverflow)];
|
|
102
95
|
}
|
|
@@ -75,8 +75,6 @@ var Resizer = exports.default = /*#__PURE__*/function (_React$Component) {
|
|
|
75
75
|
displayGrid === null || displayGrid === void 0 || displayGrid(newHighlights.length > 0, (0, _utils.gridTypeForLayout)(layout), newHighlights);
|
|
76
76
|
});
|
|
77
77
|
});
|
|
78
|
-
// Ignored via go/ees005
|
|
79
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
80
78
|
(0, _defineProperty2.default)(_this, "handleResize", function (_event, _direction, _elementRef, delta) {
|
|
81
79
|
var _this$props2 = _this.props,
|
|
82
80
|
highlights = _this$props2.highlights,
|
|
@@ -108,8 +106,6 @@ var Resizer = exports.default = /*#__PURE__*/function (_React$Component) {
|
|
|
108
106
|
isResizing: true
|
|
109
107
|
});
|
|
110
108
|
});
|
|
111
|
-
// Ignored via go/ees005
|
|
112
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
113
109
|
(0, _defineProperty2.default)(_this, "handleResizeStop", function (_event, _direction, _elementRef, delta) {
|
|
114
110
|
var _this$props3 = _this.props,
|
|
115
111
|
highlights = _this$props3.highlights,
|
|
@@ -4,8 +4,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.getUnsupportedContent = getUnsupportedContent;
|
|
7
|
-
// Ignored via go/ees005
|
|
8
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
9
7
|
function getUnsupportedContent(
|
|
10
8
|
// Ignored via go/ees005
|
|
11
9
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
@@ -62,8 +62,6 @@ var breakoutConsts = exports.breakoutConsts = {
|
|
|
62
62
|
calcLineLength: function calcLineLength() {
|
|
63
63
|
return breakoutConsts.defaultLayoutWidth;
|
|
64
64
|
},
|
|
65
|
-
// Ignored via go/ees005
|
|
66
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
67
65
|
calcWideWidth: function calcWideWidth() {
|
|
68
66
|
var containerWidth = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : breakoutConsts.defaultLayoutWidth;
|
|
69
67
|
var maxWidth = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : Infinity;
|
|
@@ -254,10 +254,7 @@ var deleteEmptyParagraphAndMoveBlockUp = exports.deleteEmptyParagraphAndMoveBloc
|
|
|
254
254
|
return false;
|
|
255
255
|
};
|
|
256
256
|
};
|
|
257
|
-
var insertContentDeleteRange = exports.insertContentDeleteRange = function insertContentDeleteRange(tr, getSelectionResolvedPos, insertions, deletions
|
|
258
|
-
// Ignored via go/ees005
|
|
259
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
260
|
-
) {
|
|
257
|
+
var insertContentDeleteRange = exports.insertContentDeleteRange = function insertContentDeleteRange(tr, getSelectionResolvedPos, insertions, deletions) {
|
|
261
258
|
insertions.forEach(function (contentInsert) {
|
|
262
259
|
var _contentInsert = (0, _slicedToArray2.default)(contentInsert, 2),
|
|
263
260
|
content = _contentInsert[0],
|
|
@@ -115,9 +115,6 @@ var isValidPosition = exports.isValidPosition = function isValidPosition(pos, st
|
|
|
115
115
|
var isInLayoutColumn = exports.isInLayoutColumn = function isInLayoutColumn(state) {
|
|
116
116
|
return (0, _utils.hasParentNodeOfType)(state.schema.nodes.layoutSection)(state.selection);
|
|
117
117
|
};
|
|
118
|
-
|
|
119
|
-
// Ignored via go/ees005
|
|
120
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
121
118
|
function filterChildrenBetween(doc, from, to, predicate) {
|
|
122
119
|
var results = [];
|
|
123
120
|
doc.nodesBetween(from, to, function (node, pos, parent) {
|
|
@@ -34,10 +34,7 @@ var createWrappingJoinRule = exports.createWrappingJoinRule = function createWra
|
|
|
34
34
|
nodeType = _ref.nodeType,
|
|
35
35
|
getAttrs = _ref.getAttrs,
|
|
36
36
|
joinPredicate = _ref.joinPredicate;
|
|
37
|
-
var handler = function handler(state, match, start, end
|
|
38
|
-
// Ignored via go/ees005
|
|
39
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
40
|
-
) {
|
|
37
|
+
var handler = function handler(state, match, start, end) {
|
|
41
38
|
var attrs = (getAttrs instanceof Function ? getAttrs(match) : getAttrs) || {};
|
|
42
39
|
var tr = state.tr;
|
|
43
40
|
var fixedStart = Math.max(start, 1);
|
package/dist/cjs/utils/nodes.js
CHANGED
|
@@ -18,8 +18,6 @@ var findChangedNodesFromTransaction = exports.findChangedNodesFromTransaction =
|
|
|
18
18
|
var nodes = [];
|
|
19
19
|
var steps = tr.steps || [];
|
|
20
20
|
steps.forEach(function (step) {
|
|
21
|
-
// Ignored via go/ees005
|
|
22
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
23
21
|
step.getMap().forEach(function (oldStart, oldEnd, newStart, newEnd) {
|
|
24
22
|
tr.doc.nodesBetween(newStart, Math.min(newEnd, tr.doc.content.size), function (node) {
|
|
25
23
|
if (!nodes.find(function (n) {
|
|
@@ -69,10 +67,7 @@ var SelectedState = exports.SelectedState = /*#__PURE__*/function (SelectedState
|
|
|
69
67
|
* If the node is selected then an enum is returned that describes weather the node
|
|
70
68
|
* is fully selected by a range or if the "inside" of the node has been selected or clicked.
|
|
71
69
|
*/
|
|
72
|
-
var isNodeSelectedOrInRange = exports.isNodeSelectedOrInRange = function isNodeSelectedOrInRange(anchorPosition, headPosition, nodePosition, nodeSize
|
|
73
|
-
// Ignored via go/ees005
|
|
74
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
75
|
-
) {
|
|
70
|
+
var isNodeSelectedOrInRange = exports.isNodeSelectedOrInRange = function isNodeSelectedOrInRange(anchorPosition, headPosition, nodePosition, nodeSize) {
|
|
76
71
|
if (typeof nodePosition !== 'number') {
|
|
77
72
|
return null;
|
|
78
73
|
}
|
|
@@ -75,11 +75,18 @@ var getHasNestedTable = function getHasNestedTable(node) {
|
|
|
75
75
|
return hasNestedTable;
|
|
76
76
|
}
|
|
77
77
|
if (node.type === 'table') {
|
|
78
|
-
|
|
79
|
-
|
|
78
|
+
// The first node that we pass into the reduce function is a table node, and we need to ignore it
|
|
79
|
+
var foundFirstTable = false;
|
|
80
|
+
return (0, _traverse.reduce)(node, function (hasNestedTable, node) {
|
|
81
|
+
if (hasNestedTable) {
|
|
82
|
+
return hasNestedTable;
|
|
83
|
+
}
|
|
84
|
+
if (node.type === 'table' && foundFirstTable) {
|
|
80
85
|
return true;
|
|
86
|
+
} else if (node.type === 'table') {
|
|
87
|
+
foundFirstTable = true;
|
|
81
88
|
}
|
|
82
|
-
return
|
|
89
|
+
return hasNestedTable;
|
|
83
90
|
}, false);
|
|
84
91
|
}
|
|
85
92
|
return hasNestedTable;
|
|
@@ -9,8 +9,6 @@ exports.measureTTI = measureTTI;
|
|
|
9
9
|
var _analytics = require("../analytics");
|
|
10
10
|
var _isPerformanceApiAvailable = require("./is-performance-api-available");
|
|
11
11
|
var _measureRender = require("./measure-render");
|
|
12
|
-
// Ignored via go/ees005
|
|
13
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
14
12
|
function measureTTI(onMeasureComplete) {
|
|
15
13
|
var idleThreshold = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1000;
|
|
16
14
|
var cancelAfter = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 60;
|
|
@@ -76,9 +74,6 @@ var TTI_FROM_INVOCATION_SEVERITY_THRESHOLD_DEFAULTS = exports.TTI_FROM_INVOCATIO
|
|
|
76
74
|
NORMAL: 5000,
|
|
77
75
|
DEGRADED: 8000
|
|
78
76
|
};
|
|
79
|
-
|
|
80
|
-
// Ignored via go/ees005
|
|
81
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
82
77
|
function getTTISeverity(tti, ttiFromInvocation, ttiSeverityNormalThreshold, ttiSeverityDegradedThreshold, ttiFromInvocationSeverityNormalThreshold, ttiFromInvocationSeverityDegradedThreshold) {
|
|
83
78
|
var ttiNormalThreshold = ttiSeverityNormalThreshold || TTI_SEVERITY_THRESHOLD_DEFAULTS.NORMAL;
|
|
84
79
|
var ttiDegradedThreshold = ttiSeverityDegradedThreshold || TTI_SEVERITY_THRESHOLD_DEFAULTS.DEGRADED;
|
|
@@ -67,8 +67,6 @@ function pluginFactory(pluginKey, reducer) {
|
|
|
67
67
|
init: function init(_, state) {
|
|
68
68
|
return isFunction(initialState) ? initialState(state) : initialState;
|
|
69
69
|
},
|
|
70
|
-
// Ignored via go/ees005
|
|
71
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
72
70
|
apply: function apply(tr, _pluginState, _oldEditorState, newEditorState) {
|
|
73
71
|
var oldPluginState = mapping ? mapping(tr, _pluginState, newEditorState) : _pluginState;
|
|
74
72
|
var newPluginState = oldPluginState;
|
|
@@ -73,9 +73,6 @@ function processRawValueWithoutValidation(schema, value, dispatchAnalyticsEvent)
|
|
|
73
73
|
return _model.Node.fromJSON(schema, node);
|
|
74
74
|
}
|
|
75
75
|
}
|
|
76
|
-
|
|
77
|
-
// Ignored via go/ees005
|
|
78
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
79
76
|
function processRawValue(schema, value, providerFactory, sanitizePrivateContent, contentTransformer, dispatchAnalyticsEvent) {
|
|
80
77
|
if (!value) {
|
|
81
78
|
return;
|
|
@@ -259,9 +256,6 @@ function processRawValue(schema, value, providerFactory, sanitizePrivateContent,
|
|
|
259
256
|
return;
|
|
260
257
|
}
|
|
261
258
|
}
|
|
262
|
-
|
|
263
|
-
// Ignored via go/ees005
|
|
264
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
265
259
|
function processRawFragmentValue(schema, value, providerFactory, sanitizePrivateContent, contentTransformer, dispatchAnalyticsEvent) {
|
|
266
260
|
if (!value) {
|
|
267
261
|
return;
|
|
@@ -28,8 +28,6 @@ function autoJoinTr(tr, isJoinable) {
|
|
|
28
28
|
for (var j = 0; j < ranges.length; j++) {
|
|
29
29
|
ranges[j] = map.map(ranges[j]);
|
|
30
30
|
}
|
|
31
|
-
// Ignored via go/ees005
|
|
32
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
33
31
|
map.forEach(function (_s, _e, from, to) {
|
|
34
32
|
return ranges.push(from, to);
|
|
35
33
|
});
|
|
@@ -32,10 +32,7 @@ var isRichMediaInsideOfBlockNode = exports.isRichMediaInsideOfBlockNode = functi
|
|
|
32
32
|
var alignAttributes = exports.alignAttributes = function alignAttributes(layout, oldAttrs) {
|
|
33
33
|
var gridSize = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 12;
|
|
34
34
|
var originalWidth = arguments.length > 3 ? arguments[3] : undefined;
|
|
35
|
-
var lineLength
|
|
36
|
-
// Ignored via go/ees005
|
|
37
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
38
|
-
= arguments.length > 4 ? arguments[4] : undefined;
|
|
35
|
+
var lineLength = arguments.length > 4 ? arguments[4] : undefined;
|
|
39
36
|
var width = oldAttrs.width;
|
|
40
37
|
var oldLayout = oldAttrs.layout;
|
|
41
38
|
var oldLayoutIsNonWrapped = nonWrappedLayouts.indexOf(oldLayout) > -1;
|
|
@@ -47,10 +47,7 @@ var sanitizeAttributes = function sanitizeAttributes() {
|
|
|
47
47
|
});
|
|
48
48
|
return sanitizedAttrs;
|
|
49
49
|
};
|
|
50
|
-
var trackUnsupportedContentTooltipActionFor = function trackUnsupportedContentTooltipActionFor(action, dispatchAnalyticsEvent, unsupportedContentType, originalNodeType
|
|
51
|
-
// Ignored via go/ees005
|
|
52
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
53
|
-
) {
|
|
50
|
+
var trackUnsupportedContentTooltipActionFor = function trackUnsupportedContentTooltipActionFor(action, dispatchAnalyticsEvent, unsupportedContentType, originalNodeType) {
|
|
54
51
|
dispatchAnalyticsEvent({
|
|
55
52
|
action: action,
|
|
56
53
|
actionSubjectId: unsupportedContentType,
|
|
@@ -126,10 +123,7 @@ var findAndTrackUnsupportedContentNodes = exports.findAndTrackUnsupportedContent
|
|
|
126
123
|
});
|
|
127
124
|
}
|
|
128
125
|
};
|
|
129
|
-
var fireUnsupportedEvent = exports.fireUnsupportedEvent = function fireUnsupportedEvent(dispatchAnalyticsEvent, actionSubjectId, unsupportedNode, errorCode
|
|
130
|
-
// Ignored via go/ees005
|
|
131
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
132
|
-
) {
|
|
126
|
+
var fireUnsupportedEvent = exports.fireUnsupportedEvent = function fireUnsupportedEvent(dispatchAnalyticsEvent, actionSubjectId, unsupportedNode, errorCode) {
|
|
133
127
|
var sanitizedAttrs = sanitizeAttributes(unsupportedNode.attrs);
|
|
134
128
|
var sanitizedMarks = sanitizeMarks(unsupportedNode.marks);
|
|
135
129
|
var sanitizedUnsupportedNode = {
|
|
@@ -14,10 +14,7 @@ var errorCallbackFor = function errorCallbackFor(marks, validate, dispatchAnalyt
|
|
|
14
14
|
return validationErrorHandler(entity, error, options, marks, validate, dispatchAnalyticsEvent);
|
|
15
15
|
};
|
|
16
16
|
};
|
|
17
|
-
var validationErrorHandler = exports.validationErrorHandler = function validationErrorHandler(entity, error, options, marks, validate, dispatchAnalyticsEvent
|
|
18
|
-
// Ignored via go/ees005
|
|
19
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
20
|
-
) {
|
|
17
|
+
var validationErrorHandler = exports.validationErrorHandler = function validationErrorHandler(entity, error, options, marks, validate, dispatchAnalyticsEvent) {
|
|
21
18
|
if (entity && entity.type === UNSUPPORTED_NODE_ATTRIBUTE) {
|
|
22
19
|
return entity;
|
|
23
20
|
}
|
|
@@ -74,9 +71,6 @@ var validationErrorHandler = exports.validationErrorHandler = function validatio
|
|
|
74
71
|
}
|
|
75
72
|
return entity;
|
|
76
73
|
};
|
|
77
|
-
|
|
78
|
-
// Ignored via go/ees005
|
|
79
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
80
74
|
function getEntityForInvalidContentLength(error, entity, validate, marks, dispatchAnalyticsEvent) {
|
|
81
75
|
var meta = error.meta;
|
|
82
76
|
if (meta.type === 'maximum') {
|
|
@@ -110,8 +110,6 @@ var WithPluginStateInner = exports.WithPluginStateInner = /*#__PURE__*/function
|
|
|
110
110
|
(0, _defineProperty2.default)(_this, "notAppliedState", {});
|
|
111
111
|
(0, _defineProperty2.default)(_this, "isSubscribed", false);
|
|
112
112
|
(0, _defineProperty2.default)(_this, "callsCount", 0);
|
|
113
|
-
// Ignored via go/ees005
|
|
114
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
115
113
|
(0, _defineProperty2.default)(_this, "handlePluginStateChange", function (propName, pluginName, performanceOptions, skipEqualityCheck) {
|
|
116
114
|
return (
|
|
117
115
|
// Ignored via go/ees005
|
|
@@ -368,8 +366,6 @@ var WithPluginStateOld = exports.WithPluginStateOld = /*#__PURE__*/function (_Re
|
|
|
368
366
|
(0, _defineProperty2.default)(_this6, "notAppliedState", {});
|
|
369
367
|
(0, _defineProperty2.default)(_this6, "isSubscribed", false);
|
|
370
368
|
(0, _defineProperty2.default)(_this6, "callsCount", 0);
|
|
371
|
-
// Ignored via go/ees005
|
|
372
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
373
369
|
(0, _defineProperty2.default)(_this6, "handlePluginStateChange", function (propName, pluginName, performanceOptions, skipEqualityCheck) {
|
|
374
370
|
return (
|
|
375
371
|
// Ignored via go/ees005
|
|
@@ -98,10 +98,7 @@ const getNodeWidth = (node, schema) => {
|
|
|
98
98
|
}
|
|
99
99
|
return node.firstChild && node.firstChild.attrs.width || node.attrs.width;
|
|
100
100
|
};
|
|
101
|
-
const makeAlign = (layout, nodeType, widthPluginDependencyApi, analyticsApi
|
|
102
|
-
// Ignored via go/ees005
|
|
103
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
104
|
-
) => {
|
|
101
|
+
const makeAlign = (layout, nodeType, widthPluginDependencyApi, analyticsApi) => {
|
|
105
102
|
return (state, dispatch) => {
|
|
106
103
|
const {
|
|
107
104
|
node
|
|
@@ -170,10 +167,7 @@ const getToolbarLayout = layout => {
|
|
|
170
167
|
}
|
|
171
168
|
return layout;
|
|
172
169
|
};
|
|
173
|
-
const mapIconsToToolbarItem = (icons, layout, intl, nodeType, widthPluginDependencyApi, analyticsApi, isChangingLayoutDisabled
|
|
174
|
-
// Ignored via go/ees005
|
|
175
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
176
|
-
) => icons.map(toolbarItem => {
|
|
170
|
+
const mapIconsToToolbarItem = (icons, layout, intl, nodeType, widthPluginDependencyApi, analyticsApi, isChangingLayoutDisabled) => icons.map(toolbarItem => {
|
|
177
171
|
const {
|
|
178
172
|
id,
|
|
179
173
|
value
|
|
@@ -195,10 +189,7 @@ const shouldHideLayoutToolbar = (selection, {
|
|
|
195
189
|
}, allowResizingInTables) => {
|
|
196
190
|
return hasParentNodeOfType([nodes.bodiedExtension, nodes.extensionFrame, nodes.listItem, nodes.expand, nodes.nestedExpand, ...(allowResizingInTables ? [] : [nodes.table])].filter(Boolean))(selection);
|
|
197
191
|
};
|
|
198
|
-
const buildLayoutButtons = (state, intl, nodeType, widthPluginDependencyApi, analyticsApi, allowResizing, allowResizingInTables, allowWrapping = true, allowAlignment = true, isChangingLayoutDisabled
|
|
199
|
-
// Ignored via go/ees005
|
|
200
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
201
|
-
) => {
|
|
192
|
+
const buildLayoutButtons = (state, intl, nodeType, widthPluginDependencyApi, analyticsApi, allowResizing, allowResizingInTables, allowWrapping = true, allowAlignment = true, isChangingLayoutDisabled) => {
|
|
202
193
|
const {
|
|
203
194
|
selection
|
|
204
195
|
} = state;
|
|
@@ -53,10 +53,7 @@ export const changeImageAlignment = align => (state, dispatch) => {
|
|
|
53
53
|
}
|
|
54
54
|
return false;
|
|
55
55
|
};
|
|
56
|
-
export const createToggleBlockMarkOnRange = (markType, getAttrs, allowedBlocks) =>
|
|
57
|
-
// Ignored via go/ees005
|
|
58
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
59
|
-
(from, to, tr, state) => {
|
|
56
|
+
export const createToggleBlockMarkOnRange = (markType, getAttrs, allowedBlocks) => (from, to, tr, state) => {
|
|
60
57
|
let markApplied = false;
|
|
61
58
|
state.doc.nodesBetween(from, to, (node, pos, parent) => {
|
|
62
59
|
if (!node.type.isBlock) {
|
|
@@ -75,10 +72,7 @@ export const createToggleBlockMarkOnRange = (markType, getAttrs, allowedBlocks)
|
|
|
75
72
|
});
|
|
76
73
|
return markApplied;
|
|
77
74
|
};
|
|
78
|
-
export const createToggleInlineMarkOnRange = (markType, getAttrs) =>
|
|
79
|
-
// Ignored via go/ees005
|
|
80
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
81
|
-
(from, to, tr, state) => {
|
|
75
|
+
export const createToggleInlineMarkOnRange = (markType, getAttrs) => (from, to, tr, state) => {
|
|
82
76
|
let markApplied = false;
|
|
83
77
|
state.doc.nodesBetween(from, to, (node, pos, parent) => {
|
|
84
78
|
if (parent !== null && parent !== void 0 && parent.type.allowsMarkType(markType)) {
|
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
import { NodeSelection, TextSelection } from '@atlaskit/editor-prosemirror/state';
|
|
2
2
|
import { hasParentNodeOfType } from '@atlaskit/editor-prosemirror/utils';
|
|
3
|
-
export const insertBlock = (state, nodeType, start, end, attrs
|
|
4
|
-
// Ignored via go/ees005
|
|
5
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
6
|
-
) => {
|
|
3
|
+
export const insertBlock = (state, nodeType, start, end, attrs) => {
|
|
7
4
|
// To ensure that match is done after HardBreak.
|
|
8
5
|
const {
|
|
9
6
|
hardBreak,
|
|
@@ -196,10 +196,7 @@ const getInitialState = (listSize, canFocusViewMore) => initialState => ({
|
|
|
196
196
|
});
|
|
197
197
|
|
|
198
198
|
// Get the offset forwards - skip items that are disabled
|
|
199
|
-
const skipForwardOffsetToSafeItem = (currentIndex, listSize, stepSize, itemIsDisabled
|
|
200
|
-
// Ignored via go/ees005
|
|
201
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
202
|
-
) => {
|
|
199
|
+
const skipForwardOffsetToSafeItem = (currentIndex, listSize, stepSize, itemIsDisabled) => {
|
|
203
200
|
if (currentIndex === undefined) {
|
|
204
201
|
return undefined;
|
|
205
202
|
}
|
|
@@ -230,8 +227,6 @@ const skipBackwardOffsetToSafeItem = (currentIndex, stepSize, itemIsDisabled) =>
|
|
|
230
227
|
// Move to search if no available index
|
|
231
228
|
return currentIndex + 1;
|
|
232
229
|
};
|
|
233
|
-
// Ignored via go/ees005
|
|
234
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
235
230
|
function useSelectAndFocusOnArrowNavigation(listSize, step, canFocusViewMore, itemIsDisabled, isFocusSearch) {
|
|
236
231
|
const [state, dispatch] = useReducer(reducer, initialState, getInitialState(listSize, canFocusViewMore));
|
|
237
232
|
useEffect(() => {
|