@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
|
@@ -31,7 +31,8 @@ export var LozengeComponent = function LozengeComponent(_ref) {
|
|
|
31
31
|
showLivePagesBodiedMacrosRendererView = _ref.showLivePagesBodiedMacrosRendererView,
|
|
32
32
|
showUpdatedLivePages1PBodiedExtensionUI = _ref.showUpdatedLivePages1PBodiedExtensionUI,
|
|
33
33
|
showBodiedExtensionRendererView = _ref.showBodiedExtensionRendererView,
|
|
34
|
-
setShowBodiedExtensionRendererView = _ref.setShowBodiedExtensionRendererView
|
|
34
|
+
setShowBodiedExtensionRendererView = _ref.setShowBodiedExtensionRendererView,
|
|
35
|
+
pluginInjectionApi = _ref.pluginInjectionApi;
|
|
35
36
|
var capitalizedTitle = capitalizeFirstLetter(title);
|
|
36
37
|
if (showMacroInteractionDesignUpdates) {
|
|
37
38
|
return jsx(Fragment, null, jsx(ExtensionLabel, {
|
|
@@ -44,7 +45,8 @@ export var LozengeComponent = function LozengeComponent(_ref) {
|
|
|
44
45
|
isBodiedMacro: isBodiedMacro,
|
|
45
46
|
showLivePagesBodiedMacrosRendererView: showLivePagesBodiedMacrosRendererView,
|
|
46
47
|
showUpdatedLivePages1PBodiedExtensionUI: showUpdatedLivePages1PBodiedExtensionUI,
|
|
47
|
-
showBodiedExtensionRendererView: showBodiedExtensionRendererView
|
|
48
|
+
showBodiedExtensionRendererView: showBodiedExtensionRendererView,
|
|
49
|
+
pluginInjectionApi: pluginInjectionApi
|
|
48
50
|
}), showLivePagesBodiedMacrosRendererView && isBodiedMacro && jsx(EditToggle, {
|
|
49
51
|
isNodeHovered: isNodeHovered,
|
|
50
52
|
setIsNodeHovered: setIsNodeHovered,
|
|
@@ -53,7 +53,8 @@ var ExtensionLozenge = /*#__PURE__*/function (_Component) {
|
|
|
53
53
|
showLivePagesBodiedMacrosRendererView = _this$props.showLivePagesBodiedMacrosRendererView,
|
|
54
54
|
showUpdatedLivePages1PBodiedExtensionUI = _this$props.showUpdatedLivePages1PBodiedExtensionUI,
|
|
55
55
|
showBodiedExtensionRendererView = _this$props.showBodiedExtensionRendererView,
|
|
56
|
-
setShowBodiedExtensionRendererView = _this$props.setShowBodiedExtensionRendererView
|
|
56
|
+
setShowBodiedExtensionRendererView = _this$props.setShowBodiedExtensionRendererView,
|
|
57
|
+
pluginInjectionApi = _this$props.pluginInjectionApi;
|
|
57
58
|
var _this$props$node$attr = _this.props.node.attrs,
|
|
58
59
|
parameters = _this$props$node$attr.parameters,
|
|
59
60
|
extensionKey = _this$props$node$attr.extensionKey;
|
|
@@ -76,7 +77,8 @@ var ExtensionLozenge = /*#__PURE__*/function (_Component) {
|
|
|
76
77
|
showLivePagesBodiedMacrosRendererView: showLivePagesBodiedMacrosRendererView,
|
|
77
78
|
showUpdatedLivePages1PBodiedExtensionUI: showUpdatedLivePages1PBodiedExtensionUI,
|
|
78
79
|
showBodiedExtensionRendererView: showBodiedExtensionRendererView,
|
|
79
|
-
setShowBodiedExtensionRendererView: setShowBodiedExtensionRendererView
|
|
80
|
+
setShowBodiedExtensionRendererView: setShowBodiedExtensionRendererView,
|
|
81
|
+
pluginInjectionApi: pluginInjectionApi
|
|
80
82
|
});
|
|
81
83
|
});
|
|
82
84
|
return _this;
|
|
@@ -81,7 +81,8 @@ var MultiBodiedExtensionWithWidth = function MultiBodiedExtensionWithWidth(_ref)
|
|
|
81
81
|
isNodeSelected = _ref.isNodeSelected,
|
|
82
82
|
isNodeHovered = _ref.isNodeHovered,
|
|
83
83
|
isNodeNested = _ref.isNodeNested,
|
|
84
|
-
setIsNodeHovered = _ref.setIsNodeHovered
|
|
84
|
+
setIsNodeHovered = _ref.setIsNodeHovered,
|
|
85
|
+
pluginInjectionApi = _ref.pluginInjectionApi;
|
|
85
86
|
var _ref2 = macroInteractionDesignFeatureFlags || {},
|
|
86
87
|
showMacroInteractionDesignUpdates = _ref2.showMacroInteractionDesignUpdates;
|
|
87
88
|
var _node$attrs = node.attrs,
|
|
@@ -163,7 +164,8 @@ var MultiBodiedExtensionWithWidth = function MultiBodiedExtensionWithWidth(_ref)
|
|
|
163
164
|
isNodeHovered: isNodeHovered,
|
|
164
165
|
isNodeNested: isNodeNested,
|
|
165
166
|
setIsNodeHovered: setIsNodeHovered,
|
|
166
|
-
isBodiedMacro: true
|
|
167
|
+
isBodiedMacro: true,
|
|
168
|
+
pluginInjectionApi: pluginInjectionApi
|
|
167
169
|
}), jsx("div", {
|
|
168
170
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
169
171
|
className: wrapperClassNames
|
|
@@ -73,9 +73,6 @@ export var ExtensionNode = /*#__PURE__*/function (_ReactNodeView) {
|
|
|
73
73
|
}
|
|
74
74
|
}]);
|
|
75
75
|
}(ReactNodeView);
|
|
76
|
-
|
|
77
|
-
// Ignored via go/ees005
|
|
78
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
79
76
|
export default function ExtensionNodeView(portalProviderAPI, eventDispatcher, providerFactory, extensionHandlers, extensionNodeViewOptions, pluginInjectionApi, macroInteractionDesignFeatureFlags, showLivePagesBodiedMacrosRendererView, showUpdatedLivePages1PBodiedExtensionUI, rendererExtensionHandlers) {
|
|
80
77
|
return function (node, view, getPos) {
|
|
81
78
|
return new ExtensionNode(node, view, getPos, portalProviderAPI, eventDispatcher, {
|
|
@@ -54,10 +54,7 @@ export var generateDynamicGuidelines = function generateDynamicGuidelines(state,
|
|
|
54
54
|
dynamicGuides: []
|
|
55
55
|
});
|
|
56
56
|
};
|
|
57
|
-
var getDynamicGuides = function getDynamicGuides(layout, width, offset, key, styles
|
|
58
|
-
// Ignored via go/ees005
|
|
59
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
60
|
-
) {
|
|
57
|
+
var getDynamicGuides = function getDynamicGuides(layout, width, offset, key, styles) {
|
|
61
58
|
switch (layout) {
|
|
62
59
|
case 'align-start':
|
|
63
60
|
case 'wrap-left':
|
|
@@ -2,10 +2,7 @@ import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
|
2
2
|
import { roundToNearest } from '../media-single';
|
|
3
3
|
import { getMediaSingleDimensions } from './utils';
|
|
4
4
|
var RELATIVE_GUIDES_GAP = 6;
|
|
5
|
-
var getWidthRelativeGuideline = function getWidthRelativeGuideline(key, view, nodeWithPos, editorWidth, topOffset, size
|
|
6
|
-
// Ignored via go/ees005
|
|
7
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
8
|
-
) {
|
|
5
|
+
var getWidthRelativeGuideline = function getWidthRelativeGuideline(key, view, nodeWithPos, editorWidth, topOffset, size) {
|
|
9
6
|
var node = nodeWithPos.node,
|
|
10
7
|
pos = nodeWithPos.pos;
|
|
11
8
|
var _view$dom$getBounding = view.dom.getBoundingClientRect(),
|
|
@@ -57,10 +54,7 @@ var getWidthRelativeGuideline = function getWidthRelativeGuideline(key, view, no
|
|
|
57
54
|
}
|
|
58
55
|
};
|
|
59
56
|
};
|
|
60
|
-
var getHeightRelativeGuideline = function getHeightRelativeGuideline(key, view, nodeWithPos, editorWidth, topOffset, size
|
|
61
|
-
// Ignored via go/ees005
|
|
62
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
63
|
-
) {
|
|
57
|
+
var getHeightRelativeGuideline = function getHeightRelativeGuideline(key, view, nodeWithPos, editorWidth, topOffset, size) {
|
|
64
58
|
var node = nodeWithPos.node,
|
|
65
59
|
pos = nodeWithPos.pos;
|
|
66
60
|
var _view$dom$getBounding2 = view.dom.getBoundingClientRect(),
|
|
@@ -124,10 +118,7 @@ export var getRelativeGuideSnaps = function getRelativeGuideSnaps(relativeGuides
|
|
|
124
118
|
});
|
|
125
119
|
return [].concat(_toConsumableArray(snapsWidthFromMatchingWidth), _toConsumableArray(snapsWidthFromMatchingHeight));
|
|
126
120
|
};
|
|
127
|
-
export var getRelativeGuidelines = function getRelativeGuidelines(relativeGuides, nodeWithPos, view, editorWidth, topOffset, size
|
|
128
|
-
// Ignored via go/ees005
|
|
129
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
130
|
-
) {
|
|
121
|
+
export var getRelativeGuidelines = function getRelativeGuidelines(relativeGuides, nodeWithPos, view, editorWidth, topOffset, size) {
|
|
131
122
|
var matchWidth = relativeGuides.width ? relativeGuides.width[Math.round(size.width)] : [];
|
|
132
123
|
var matchHeight = relativeGuides.height ? relativeGuides.height[Math.round(size.height)] : [];
|
|
133
124
|
var matches = matchWidth || matchHeight;
|
|
@@ -7,10 +7,7 @@ var activeGuidelineStyle = function activeGuidelineStyle(guideline) {
|
|
|
7
7
|
show: true
|
|
8
8
|
});
|
|
9
9
|
};
|
|
10
|
-
export var getGuidelinesWithHighlights = function getGuidelinesWithHighlights(gap, maxGap, activeGuidelineKeys, guidelines
|
|
11
|
-
// Ignored via go/ees005
|
|
12
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
13
|
-
) {
|
|
10
|
+
export var getGuidelinesWithHighlights = function getGuidelinesWithHighlights(gap, maxGap, activeGuidelineKeys, guidelines) {
|
|
14
11
|
if (activeGuidelineKeys.length) {
|
|
15
12
|
return guidelines.map(function (guideline) {
|
|
16
13
|
if (activeGuidelineKeys.includes(guideline.key) && gap < maxGap) {
|
|
@@ -38,13 +38,13 @@ import { usePluginStateEffect } from '../usePluginStateEffect';
|
|
|
38
38
|
* ⚠️⚠️⚠️ This is a debounced hook ⚠️⚠️⚠️
|
|
39
39
|
* If the plugins you are listening to generate multiple shared states while the user is typing,
|
|
40
40
|
* your React Component will get only the last one.
|
|
41
|
-
*
|
|
41
|
+
*
|
|
42
42
|
* Used to return the current plugin state of input dependencies.
|
|
43
43
|
* It will recursively retrieve a slice of the state using a "." to separate
|
|
44
44
|
* parts of the state.
|
|
45
|
-
*
|
|
45
|
+
*
|
|
46
46
|
* Example:
|
|
47
|
-
*
|
|
47
|
+
*
|
|
48
48
|
* ```typescript
|
|
49
49
|
* const pluginA: NextEditorPlugin<
|
|
50
50
|
'pluginA',
|
|
@@ -54,7 +54,7 @@ import { usePluginStateEffect } from '../usePluginStateEffect';
|
|
|
54
54
|
>
|
|
55
55
|
* ```
|
|
56
56
|
* You can use `const value = useSharedPluginStateSelector(api, 'pluginA.deepObj.value')` to retrieve the value
|
|
57
|
-
*
|
|
57
|
+
*
|
|
58
58
|
* Example in plugin:
|
|
59
59
|
*
|
|
60
60
|
* ```typescript
|
|
@@ -70,12 +70,12 @@ import { usePluginStateEffect } from '../usePluginStateEffect';
|
|
|
70
70
|
* }
|
|
71
71
|
* }
|
|
72
72
|
* ```
|
|
73
|
-
*
|
|
73
|
+
*
|
|
74
74
|
* NOTE: If you pass an invalid path, `undefined` will be returned
|
|
75
|
-
*
|
|
76
|
-
* @param api
|
|
77
|
-
* @param plugin
|
|
78
|
-
* @returns
|
|
75
|
+
*
|
|
76
|
+
* @param api
|
|
77
|
+
* @param plugin
|
|
78
|
+
* @returns
|
|
79
79
|
*/
|
|
80
80
|
export function useSharedPluginStateSelector(api, plugin) {
|
|
81
81
|
var transformer = useCallback(function (pluginState) {
|
|
@@ -103,8 +103,6 @@ export function useSharedPluginStateSelector(api, plugin) {
|
|
|
103
103
|
}, [plugin, api, transformer]);
|
|
104
104
|
return useSharedPluginStateSelectorInternal(api, pluginNameArray, transformer, initialState);
|
|
105
105
|
}
|
|
106
|
-
|
|
107
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
108
106
|
function useSharedPluginStateSelectorInternal(api, plugins, transformer, initialState) {
|
|
109
107
|
var _useState = useState(initialState),
|
|
110
108
|
_useState2 = _slicedToArray(_useState, 2),
|
package/dist/esm/insert/index.js
CHANGED
|
@@ -54,10 +54,7 @@ var selectionIsInNestedList = function selectionIsInNestedList(tr) {
|
|
|
54
54
|
}
|
|
55
55
|
return isListItemNode(tr.doc.resolve(parentListNode.pos).parent);
|
|
56
56
|
};
|
|
57
|
-
var insertBeforeOrAfter = function insertBeforeOrAfter(tr, lookDirection, $parentPos, $proposedPosition, content
|
|
58
|
-
// Ignored via go/ees005
|
|
59
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
60
|
-
) {
|
|
57
|
+
var insertBeforeOrAfter = function insertBeforeOrAfter(tr, lookDirection, $parentPos, $proposedPosition, content) {
|
|
61
58
|
/**
|
|
62
59
|
* This block caters for the first item in a parent with the cursor being at the very start
|
|
63
60
|
* or the last item with the cursor being at the very end
|
|
@@ -248,9 +248,6 @@ export function getAriaKeyshortcuts(keymap) {
|
|
|
248
248
|
}
|
|
249
249
|
}
|
|
250
250
|
var ALL = [toggleOrderedList, toggleBulletList, toggleBold, toggleItalic, toggleUnderline, toggleStrikethrough, toggleSubscript, toggleSuperscript, toggleCode, setNormalText, toggleHeading1, toggleHeading2, toggleHeading3, toggleHeading4, toggleHeading5, toggleHeading6, toggleBlockQuote, insertNewLine, insertRule, splitCodeBlock, splitListItem, redo, undo, find, escape, enter, shiftEnter];
|
|
251
|
-
|
|
252
|
-
// Ignored via go/ees005
|
|
253
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
254
251
|
export function makeKeymap(description, windows, mac, common) {
|
|
255
252
|
return {
|
|
256
253
|
description: description,
|
|
@@ -111,10 +111,7 @@ export var withLazyLoading = function withLazyLoading(_ref) {
|
|
|
111
111
|
var nodeName = _ref.nodeName,
|
|
112
112
|
loader = _ref.loader,
|
|
113
113
|
getNodeViewOptions = _ref.getNodeViewOptions;
|
|
114
|
-
var createLazyNodeView = function createLazyNodeView(node, view, getPos, decorations
|
|
115
|
-
// Ignored via go/ees005
|
|
116
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
117
|
-
) {
|
|
114
|
+
var createLazyNodeView = function createLazyNodeView(node, view, getPos, decorations) {
|
|
118
115
|
var _node$type;
|
|
119
116
|
var requestedNodes = requestedNodesPerEditorView.get(view);
|
|
120
117
|
if (!requestedNodes) {
|
|
@@ -135,8 +132,6 @@ export var withLazyLoading = function withLazyLoading(_ref) {
|
|
|
135
132
|
}
|
|
136
133
|
var loaderPromise = loader().then(function (nodeViewFuncModule) {
|
|
137
134
|
var _resolvedNodesPerEdit;
|
|
138
|
-
// Ignored via go/ees005
|
|
139
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
140
135
|
var nodeViewFunc = function nodeViewFunc(node, view, getPos, decorations) {
|
|
141
136
|
var nodeView = nodeViewFuncModule(node, view, getPos, decorations, getNodeViewOptions);
|
|
142
137
|
// eslint-disable-next-line @atlaskit/editor/no-as-casting
|
|
@@ -37,8 +37,6 @@ export function makeNodePlaceholderId(nodeType, pos) {
|
|
|
37
37
|
* A NodeView that serves as a placeholder until the actual NodeView is loaded.
|
|
38
38
|
*/
|
|
39
39
|
export var LazyNodeView = /*#__PURE__*/function () {
|
|
40
|
-
// Ignored via go/ees005
|
|
41
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
42
40
|
function LazyNodeView(_node, view, _getPos, _outerDeco) {
|
|
43
41
|
var _this = this,
|
|
44
42
|
_node$type;
|
|
@@ -435,8 +435,6 @@ export var HyperlinkLinkAddToolbar = /*#__PURE__*/function (_PureComponent) {
|
|
|
435
435
|
_defineProperty(_this, "handleSelected", function (href, text) {
|
|
436
436
|
_this.handleInsert(href, text, INPUT_METHOD.TYPEAHEAD, 'click');
|
|
437
437
|
});
|
|
438
|
-
// Ignored via go/ees005
|
|
439
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
440
438
|
_defineProperty(_this, "handleInsert", function (href, title, inputType, interaction) {
|
|
441
439
|
var _this$props2 = _this.props,
|
|
442
440
|
searchSessionId = _this$props2.searchSessionId,
|
|
@@ -23,8 +23,6 @@ export var countListItemsInSelection = function countListItemsInSelection(tr) {
|
|
|
23
23
|
}
|
|
24
24
|
var count = 0;
|
|
25
25
|
var listSlice = tr.doc.cut(from, to);
|
|
26
|
-
// Ignored via go/ees005
|
|
27
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
28
26
|
listSlice.content.nodesBetween(0, listSlice.content.size, function (node, pos, parent, index) {
|
|
29
27
|
if (parent && isListItemNode(parent) && !isListNode(node) && index === 0) {
|
|
30
28
|
count++;
|
|
@@ -17,9 +17,6 @@ var SMART_TO_ASCII = {
|
|
|
17
17
|
// Ignored via go/ees005
|
|
18
18
|
// eslint-disable-next-line require-unicode-regexp
|
|
19
19
|
var FIND_SMART_CHAR = new RegExp("[".concat(Object.keys(SMART_TO_ASCII).join(''), "]"), 'g');
|
|
20
|
-
|
|
21
|
-
// Ignored via go/ees005
|
|
22
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
23
20
|
export function filterChildrenBetween(doc, from, to, predicate) {
|
|
24
21
|
var results = [];
|
|
25
22
|
doc.nodesBetween(from, to, function (node, pos, parent) {
|
|
@@ -74,10 +71,7 @@ export function transformNonTextNodesToText(from, to, tr) {
|
|
|
74
71
|
}
|
|
75
72
|
});
|
|
76
73
|
}
|
|
77
|
-
export var applyMarkOnRange = function applyMarkOnRange(from, to, removeMark, mark, tr
|
|
78
|
-
// Ignored via go/ees005
|
|
79
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
80
|
-
) {
|
|
74
|
+
export var applyMarkOnRange = function applyMarkOnRange(from, to, removeMark, mark, tr) {
|
|
81
75
|
var schema = tr.doc.type.schema;
|
|
82
76
|
var code = schema.marks.code;
|
|
83
77
|
if (mark.type === code) {
|
|
@@ -112,10 +106,7 @@ export var applyMarkOnRange = function applyMarkOnRange(from, to, removeMark, ma
|
|
|
112
106
|
});
|
|
113
107
|
return tr;
|
|
114
108
|
};
|
|
115
|
-
export var entireSelectionContainsMark = function entireSelectionContainsMark(mark, doc, fromPos, toPos
|
|
116
|
-
// Ignored via go/ees005
|
|
117
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
118
|
-
) {
|
|
109
|
+
export var entireSelectionContainsMark = function entireSelectionContainsMark(mark, doc, fromPos, toPos) {
|
|
119
110
|
var onlyContainsMark = true;
|
|
120
111
|
doc.nodesBetween(fromPos, toPos, function (node) {
|
|
121
112
|
// Skip recursion once we've found text which doesn't include the mark
|
|
@@ -15,8 +15,6 @@ import { DEFAULT_IMAGE_WIDTH, DEFAULT_ROUNDING_INTERVAL, MEDIA_SINGLE_DEFAULT_MI
|
|
|
15
15
|
* @param gutterOffset - resize handle bar offset, determines whether align with resize handle bar
|
|
16
16
|
* @returns pixel number for media single node
|
|
17
17
|
*/
|
|
18
|
-
// Ignored via go/ees005
|
|
19
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
20
18
|
export function getMediaSinglePixelWidth(width, editorWidth) {
|
|
21
19
|
var widthType = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'percentage';
|
|
22
20
|
var gutterOffset = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;
|
|
@@ -112,9 +110,6 @@ export var getMediaSingleInitialWidth = function getMediaSingleInitialWidth() {
|
|
|
112
110
|
var minWidth = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : MEDIA_SINGLE_DEFAULT_MIN_PIXEL_WIDTH;
|
|
113
111
|
return Math.max(Math.min(origWidth, maxWidth), minWidth);
|
|
114
112
|
};
|
|
115
|
-
|
|
116
|
-
// Ignored via go/ees005
|
|
117
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
118
113
|
export function calculateOffsetLeft(insideInlineLike, insideLayout, pmViewDom, wrapper) {
|
|
119
114
|
var offsetLeft = 0;
|
|
120
115
|
if (wrapper && insideInlineLike && !insideLayout) {
|
|
@@ -7,7 +7,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
7
7
|
import { isFedRamp } from './environment';
|
|
8
8
|
var SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
|
|
9
9
|
var packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
|
|
10
|
-
var packageVersion = "99.5.
|
|
10
|
+
var packageVersion = "99.5.2";
|
|
11
11
|
var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
|
|
12
12
|
// Remove URL as it has UGC
|
|
13
13
|
// TODO: Sanitise the URL instead of just removing it
|
|
@@ -17,10 +17,7 @@ export var layoutToWidth = {
|
|
|
17
17
|
* Calculates width of parent node of a nested node (inside layouts, extension)
|
|
18
18
|
* If current node selection is not nested will return undefined
|
|
19
19
|
*/
|
|
20
|
-
export var getParentNodeWidth = function getParentNodeWidth(pos, state, containerWidth, isFullWidthModeEnabled
|
|
21
|
-
// Ignored via go/ees005
|
|
22
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
23
|
-
) {
|
|
20
|
+
export var getParentNodeWidth = function getParentNodeWidth(pos, state, containerWidth, isFullWidthModeEnabled) {
|
|
24
21
|
if (!pos) {
|
|
25
22
|
return;
|
|
26
23
|
}
|
|
@@ -6,8 +6,6 @@
|
|
|
6
6
|
* prosemirror-markdown cannot conform to the schema
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
// Ignored via go/ees005
|
|
10
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
11
9
|
function handleHeadingOpen(state, token, acc, index) {
|
|
12
10
|
var _state$tokens;
|
|
13
11
|
var isInListItem = ((_state$tokens = state.tokens[index - 1]) === null || _state$tokens === void 0 ? void 0 : _state$tokens.type) === 'list_item_open';
|
|
@@ -17,9 +15,6 @@ function handleHeadingOpen(state, token, acc, index) {
|
|
|
17
15
|
acc.push(token);
|
|
18
16
|
}
|
|
19
17
|
}
|
|
20
|
-
|
|
21
|
-
// Ignored via go/ees005
|
|
22
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
23
18
|
function handleHeadingClose(state, token, acc, index) {
|
|
24
19
|
var _state$tokens2;
|
|
25
20
|
var isInListItem = ((_state$tokens2 = state.tokens[index + 1]) === null || _state$tokens2 === void 0 ? void 0 : _state$tokens2.type) === 'list_item_close';
|
|
@@ -38,8 +38,7 @@ function createThrottleSchedule(callback) {
|
|
|
38
38
|
}
|
|
39
39
|
export var scheduleDocumentRequest = createThrottleSchedule(returnDocumentRequest);
|
|
40
40
|
|
|
41
|
-
//
|
|
42
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/max-params
|
|
41
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
43
42
|
function returnDocumentRequest(editorView, callback, transformer, fireAnalyticsEvent) {
|
|
44
43
|
var _editorView$state;
|
|
45
44
|
var _ref = (_editorView$state = editorView === null || editorView === void 0 ? void 0 : editorView.state) !== null && _editorView$state !== void 0 ? _editorView$state : {},
|
|
@@ -14,8 +14,6 @@ import { analyticsEventKey } from '../utils/analytics';
|
|
|
14
14
|
import { generateUniqueNodeKey } from './generateUniqueNodeKey';
|
|
15
15
|
export { getInlineNodeViewProducer, inlineNodeViewClassname } from './getInlineNodeViewProducer';
|
|
16
16
|
var ReactNodeView = /*#__PURE__*/function () {
|
|
17
|
-
// Ignored via go/ees005
|
|
18
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
19
17
|
function ReactNodeView(_node, view, getPos, portalProviderAPI, eventDispatcher, reactComponentProps,
|
|
20
18
|
// Ignored via go/ees005
|
|
21
19
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
@@ -204,9 +202,6 @@ var ReactNodeView = /*#__PURE__*/function () {
|
|
|
204
202
|
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
205
203
|
}, props)) : null;
|
|
206
204
|
}
|
|
207
|
-
|
|
208
|
-
// Ignored via go/ees005
|
|
209
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
210
205
|
}, {
|
|
211
206
|
key: "update",
|
|
212
207
|
value: function update(node, decorations, _innerDecorations) {
|
|
@@ -276,10 +271,7 @@ var ReactNodeView = /*#__PURE__*/function () {
|
|
|
276
271
|
}
|
|
277
272
|
}], [{
|
|
278
273
|
key: "fromComponent",
|
|
279
|
-
value:
|
|
280
|
-
// Ignored via go/ees005
|
|
281
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
282
|
-
function fromComponent(
|
|
274
|
+
value: function fromComponent(
|
|
283
275
|
// Ignored via go/ees005
|
|
284
276
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
285
277
|
component, portalProviderAPI, eventDispatcher, props, viewShouldUpdate) {
|
|
@@ -68,10 +68,7 @@ var ResizerNext = function ResizerNext(props, ref) {
|
|
|
68
68
|
setIsResizing(true);
|
|
69
69
|
handleResizeStart();
|
|
70
70
|
}, [handleResizeStart]);
|
|
71
|
-
var onResize = useCallback(function (_event, _direction, _elementRef, delta
|
|
72
|
-
// Ignored via go/ees005
|
|
73
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
74
|
-
) {
|
|
71
|
+
var onResize = useCallback(function (_event, _direction, _elementRef, delta) {
|
|
75
72
|
if (!handleResize) {
|
|
76
73
|
return;
|
|
77
74
|
}
|
|
@@ -87,10 +84,7 @@ var ResizerNext = function ResizerNext(props, ref) {
|
|
|
87
84
|
};
|
|
88
85
|
handleResize(originalState, delta);
|
|
89
86
|
}, [handleResize]);
|
|
90
|
-
var onResizeStop = useCallback(function (_event, _direction, _elementRef, delta
|
|
91
|
-
// Ignored via go/ees005
|
|
92
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
93
|
-
) {
|
|
87
|
+
var onResizeStop = useCallback(function (_event, _direction, _elementRef, delta) {
|
|
94
88
|
var resizableCurrent = resizable.current;
|
|
95
89
|
if (!resizableCurrent || !resizableCurrent.state.original) {
|
|
96
90
|
return;
|
|
@@ -4,10 +4,7 @@ import { isValidTargetNode } from './utils/is-valid-target-node';
|
|
|
4
4
|
|
|
5
5
|
// This function captures clicks outside of the ProseMirror contentEditable area
|
|
6
6
|
// see also description of "handleClick" in gap-cursor pm-plugin
|
|
7
|
-
var captureCursorCoords = function captureCursorCoords(event, editorRef, posAtCoords, tr
|
|
8
|
-
// Ignored via go/ees005
|
|
9
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
10
|
-
) {
|
|
7
|
+
var captureCursorCoords = function captureCursorCoords(event, editorRef, posAtCoords, tr) {
|
|
11
8
|
var rect = editorRef.getBoundingClientRect();
|
|
12
9
|
|
|
13
10
|
// capture clicks before the first block element
|
|
@@ -44,10 +41,7 @@ var captureCursorCoords = function captureCursorCoords(event, editorRef, posAtCo
|
|
|
44
41
|
}
|
|
45
42
|
return null;
|
|
46
43
|
};
|
|
47
|
-
export var setSelectionTopLevelBlocks = function setSelectionTopLevelBlocks(tr, event, editorRef, posAtCoords, editorFocused
|
|
48
|
-
// Ignored via go/ees005
|
|
49
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
50
|
-
) {
|
|
44
|
+
export var setSelectionTopLevelBlocks = function setSelectionTopLevelBlocks(tr, event, editorRef, posAtCoords, editorFocused) {
|
|
51
45
|
var cursorCoords = captureCursorCoords(event, editorRef, posAtCoords, tr);
|
|
52
46
|
if (!cursorCoords) {
|
|
53
47
|
return;
|
|
@@ -101,8 +101,6 @@ export var selectNode = function selectNode(pos) {
|
|
|
101
101
|
};
|
|
102
102
|
};
|
|
103
103
|
export function createSelectionClickHandler(nodes, isValidTarget, options) {
|
|
104
|
-
// Ignored via go/ees005
|
|
105
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
106
104
|
return function handleClickOn(view, pos, node, nodePos, event, direct) {
|
|
107
105
|
if (options.useLongPressSelection) {
|
|
108
106
|
return false;
|
|
@@ -33,8 +33,6 @@ import ReactNodeView from '../react-node-view';
|
|
|
33
33
|
*/
|
|
34
34
|
|
|
35
35
|
export var SelectionBasedNodeView = /*#__PURE__*/function (_ReactNodeView) {
|
|
36
|
-
// Ignored via go/ees005
|
|
37
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
38
36
|
function SelectionBasedNodeView(node, view, getPos, portalProviderAPI, eventDispatcher, reactComponentProps,
|
|
39
37
|
// Ignored via go/ees005
|
|
40
38
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
@@ -43,8 +41,6 @@ export var SelectionBasedNodeView = /*#__PURE__*/function (_ReactNodeView) {
|
|
|
43
41
|
_classCallCheck(this, SelectionBasedNodeView);
|
|
44
42
|
_this = _callSuper(this, SelectionBasedNodeView, [node, view, getPos, portalProviderAPI, eventDispatcher, reactComponentProps, reactComponent, viewShouldUpdate]);
|
|
45
43
|
_defineProperty(_this, "isSelectedNode", false);
|
|
46
|
-
// Ignored via go/ees005
|
|
47
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
48
44
|
_defineProperty(_this, "isNodeInsideSelection", function (from, to, pos, posEnd) {
|
|
49
45
|
var _this$getPositionsWit = _this.getPositionsWithDefault(pos, posEnd);
|
|
50
46
|
pos = _this$getPositionsWit.pos;
|
|
@@ -54,8 +50,6 @@ export var SelectionBasedNodeView = /*#__PURE__*/function (_ReactNodeView) {
|
|
|
54
50
|
}
|
|
55
51
|
return from <= pos && to >= posEnd;
|
|
56
52
|
});
|
|
57
|
-
// Ignored via go/ees005
|
|
58
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
59
53
|
_defineProperty(_this, "isSelectionInsideNode", function (from, to, pos, posEnd) {
|
|
60
54
|
var _this$getPositionsWit2 = _this.getPositionsWithDefault(pos, posEnd);
|
|
61
55
|
pos = _this$getPositionsWit2.pos;
|
|
@@ -20,7 +20,7 @@ import withAnalyticsContext from '@atlaskit/analytics-next/withAnalyticsContext'
|
|
|
20
20
|
import withAnalyticsEvents from '@atlaskit/analytics-next/withAnalyticsEvents';
|
|
21
21
|
import Layer from '../Layer';
|
|
22
22
|
var packageName = "@atlaskit/editor-common";
|
|
23
|
-
var packageVersion = "99.5.
|
|
23
|
+
var packageVersion = "99.5.2";
|
|
24
24
|
var halfFocusRing = 1;
|
|
25
25
|
var dropOffset = '0, 8';
|
|
26
26
|
// Ignored via go/ees005
|
|
@@ -104,8 +104,6 @@ var Layer = /*#__PURE__*/function (_Component) {
|
|
|
104
104
|
* the bottom of the popper not being viewable.
|
|
105
105
|
* Only works if the popper uses viewport as the boundary and has a fixed position ancestor.
|
|
106
106
|
*/
|
|
107
|
-
// Ignored via go/ees005
|
|
108
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
109
107
|
}, {
|
|
110
108
|
key: "calculateMaxHeight",
|
|
111
109
|
value: function calculateMaxHeight(originalHeight, currentHeight, positionTop, cssPosition) {
|
|
@@ -21,10 +21,7 @@ export function calcPctFromPx(width, lineLength) {
|
|
|
21
21
|
return (width + MEDIA_SINGLE_GUTTER_SIZE) / maxWidth;
|
|
22
22
|
}
|
|
23
23
|
export var wrappedLayouts = ['wrap-left', 'wrap-right', 'align-end', 'align-start'];
|
|
24
|
-
export var calcPctWidth = function calcPctWidth(containerWidth, pctWidth, origWidth, origHeight
|
|
25
|
-
// Ignored via go/ees005
|
|
26
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
27
|
-
) {
|
|
24
|
+
export var calcPctWidth = function calcPctWidth(containerWidth, pctWidth, origWidth, origHeight) {
|
|
28
25
|
return pctWidth && origWidth && origHeight && Math.ceil(calcPxFromPct(pctWidth / 100, containerWidth.lineLength || containerWidth.width));
|
|
29
26
|
};
|
|
30
27
|
export var calcMediaPxWidth = function calcMediaPxWidth(opts) {
|
|
@@ -74,10 +71,7 @@ export var calcMediaPxWidth = function calcMediaPxWidth(opts) {
|
|
|
74
71
|
}
|
|
75
72
|
return origWidth;
|
|
76
73
|
};
|
|
77
|
-
export var snapToGrid = function snapToGrid(gridWidth, width, height, lineLength, gridSize
|
|
78
|
-
// Ignored via go/ees005
|
|
79
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
80
|
-
) {
|
|
74
|
+
export var snapToGrid = function snapToGrid(gridWidth, width, height, lineLength, gridSize) {
|
|
81
75
|
var pxWidth = calcPxFromPct(gridWidth / 100, lineLength);
|
|
82
76
|
var columnSpan = Math.round(calcColumnsFromPx(pxWidth, lineLength, gridSize));
|
|
83
77
|
var alignedWidth = calcPxFromColumns(columnSpan, lineLength, gridSize);
|
|
@@ -44,8 +44,6 @@ function getWidthIfDefaultMode(originalWidth, containerWidth, isInsideOfInlineEx
|
|
|
44
44
|
* then an image in wide or full-width can not be wider than the image's
|
|
45
45
|
* original width.
|
|
46
46
|
*/
|
|
47
|
-
// Ignored via go/ees005
|
|
48
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
49
47
|
export function calcLegacyWidth(layout, width) {
|
|
50
48
|
var containerWidth = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
|
|
51
49
|
var fullWidthMode = arguments.length > 3 ? arguments[3] : undefined;
|
|
@@ -73,8 +71,6 @@ export function calcLegacyWidth(layout, width) {
|
|
|
73
71
|
* then an image in wide or full-width can not be wider than the image's
|
|
74
72
|
* original width.
|
|
75
73
|
*/
|
|
76
|
-
// Ignored via go/ees005
|
|
77
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
78
74
|
export function calcLegacyWidthForInline(layout, width) {
|
|
79
75
|
var containerWidth = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
|
|
80
76
|
var fullWidthMode = arguments.length > 3 ? arguments[3] : undefined;
|
|
@@ -12,8 +12,6 @@ export function isTextNode(elem) {
|
|
|
12
12
|
/**
|
|
13
13
|
* Decides if given fitHeight fits below or above the target taking boundaries into account.
|
|
14
14
|
*/
|
|
15
|
-
// Ignored via go/ees005
|
|
16
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
17
15
|
export function getVerticalPlacement(target, boundariesElement, fitHeight, alignY, forcePlacement, preventOverflow) {
|
|
18
16
|
if (forcePlacement && alignY) {
|
|
19
17
|
return alignY;
|
|
@@ -50,8 +48,6 @@ export function getVerticalPlacement(target, boundariesElement, fitHeight, align
|
|
|
50
48
|
/**
|
|
51
49
|
* Decides if given fitWidth fits to the left or to the right of the target taking boundaries into account.
|
|
52
50
|
*/
|
|
53
|
-
// Ignored via go/ees005
|
|
54
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
55
51
|
export function getHorizontalPlacement(target, boundariesElement, fitWidth, alignX, forcePlacement, preventOverflow) {
|
|
56
52
|
// force placement unless preventOverflow is enabled
|
|
57
53
|
if (forcePlacement && alignX && !preventOverflow) {
|
|
@@ -80,9 +76,6 @@ export function getHorizontalPlacement(target, boundariesElement, fitWidth, alig
|
|
|
80
76
|
}
|
|
81
77
|
return 'right';
|
|
82
78
|
}
|
|
83
|
-
|
|
84
|
-
// Ignored via go/ees005
|
|
85
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
86
79
|
export function calculatePlacement(target, boundariesElement, fitWidth, fitHeight, alignX, alignY, forcePlacement, preventOverflow) {
|
|
87
80
|
return [getVerticalPlacement(target, boundariesElement, fitHeight, alignY, forcePlacement, preventOverflow), getHorizontalPlacement(target, boundariesElement, fitWidth, alignX, forcePlacement, preventOverflow)];
|
|
88
81
|
}
|
|
@@ -68,8 +68,6 @@ var Resizer = /*#__PURE__*/function (_React$Component) {
|
|
|
68
68
|
displayGrid === null || displayGrid === void 0 || displayGrid(newHighlights.length > 0, gridTypeForLayout(layout), newHighlights);
|
|
69
69
|
});
|
|
70
70
|
});
|
|
71
|
-
// Ignored via go/ees005
|
|
72
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
73
71
|
_defineProperty(_this, "handleResize", function (_event, _direction, _elementRef, delta) {
|
|
74
72
|
var _this$props2 = _this.props,
|
|
75
73
|
highlights = _this$props2.highlights,
|
|
@@ -101,8 +99,6 @@ var Resizer = /*#__PURE__*/function (_React$Component) {
|
|
|
101
99
|
isResizing: true
|
|
102
100
|
});
|
|
103
101
|
});
|
|
104
|
-
// Ignored via go/ees005
|
|
105
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
106
102
|
_defineProperty(_this, "handleResizeStop", function (_event, _direction, _elementRef, delta) {
|
|
107
103
|
var _this$props3 = _this.props,
|
|
108
104
|
highlights = _this$props3.highlights,
|
|
@@ -52,8 +52,6 @@ var breakoutConsts = {
|
|
|
52
52
|
calcLineLength: function calcLineLength() {
|
|
53
53
|
return breakoutConsts.defaultLayoutWidth;
|
|
54
54
|
},
|
|
55
|
-
// Ignored via go/ees005
|
|
56
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
57
55
|
calcWideWidth: function calcWideWidth() {
|
|
58
56
|
var containerWidth = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : breakoutConsts.defaultLayoutWidth;
|
|
59
57
|
var maxWidth = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : Infinity;
|
|
@@ -241,10 +241,7 @@ export var deleteEmptyParagraphAndMoveBlockUp = function deleteEmptyParagraphAnd
|
|
|
241
241
|
return false;
|
|
242
242
|
};
|
|
243
243
|
};
|
|
244
|
-
export var insertContentDeleteRange = function insertContentDeleteRange(tr, getSelectionResolvedPos, insertions, deletions
|
|
245
|
-
// Ignored via go/ees005
|
|
246
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
247
|
-
) {
|
|
244
|
+
export var insertContentDeleteRange = function insertContentDeleteRange(tr, getSelectionResolvedPos, insertions, deletions) {
|
|
248
245
|
insertions.forEach(function (contentInsert) {
|
|
249
246
|
var _contentInsert = _slicedToArray(contentInsert, 2),
|
|
250
247
|
content = _contentInsert[0],
|