@atlaskit/editor-common 74.29.0 → 74.29.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 +12 -0
- package/dist/cjs/card/MediaAndEmbedsToolbar/index.js +8 -8
- package/dist/cjs/core-utils/inside.js +2 -2
- package/dist/cjs/guideline/defaultGuideline.js +57 -0
- package/dist/cjs/guideline/dynamicGuideline.js +4 -4
- package/dist/cjs/guideline/index.js +13 -0
- package/dist/cjs/guideline/utils.js +12 -2
- package/dist/cjs/insert/index.js +30 -30
- package/dist/cjs/monitoring/error.js +1 -1
- package/dist/cjs/node-width/index.js +3 -3
- package/dist/cjs/safe-plugin/index.js +2 -2
- package/dist/cjs/selection/gap-cursor/selection.js +7 -7
- package/dist/cjs/transforms/expand.js +5 -5
- package/dist/cjs/transforms/extension.js +2 -2
- package/dist/cjs/transforms/layout.js +5 -5
- package/dist/cjs/ui/DropList/index.js +1 -1
- package/dist/cjs/ui/UnsupportedInline/index.js +1 -1
- package/dist/cjs/utils/document.js +3 -3
- package/dist/cjs/utils/editor-core-utils.js +8 -8
- package/dist/cjs/utils/is-text-input.js +2 -2
- package/dist/cjs/utils/nodes.js +2 -2
- package/dist/cjs/utils/rich-media-utils.js +2 -2
- package/dist/cjs/utils/slice.js +6 -6
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/card/MediaAndEmbedsToolbar/index.js +2 -2
- package/dist/es2019/card/utils.js +0 -1
- package/dist/es2019/core-utils/inside.js +1 -1
- package/dist/es2019/guideline/defaultGuideline.js +45 -0
- package/dist/es2019/guideline/dynamicGuideline.js +2 -2
- package/dist/es2019/guideline/index.js +2 -1
- package/dist/es2019/guideline/utils.js +8 -1
- package/dist/es2019/insert/index.js +4 -4
- package/dist/es2019/monitoring/error.js +1 -1
- package/dist/es2019/node-width/index.js +1 -1
- package/dist/es2019/safe-plugin/index.js +1 -1
- package/dist/es2019/selection/gap-cursor/selection.js +2 -2
- package/dist/es2019/transforms/expand.js +2 -2
- package/dist/es2019/transforms/extension.js +1 -1
- package/dist/es2019/transforms/layout.js +1 -1
- package/dist/es2019/ui/DropList/index.js +1 -1
- package/dist/es2019/ui/UnsupportedInline/index.js +1 -1
- package/dist/es2019/utils/document.js +1 -1
- package/dist/es2019/utils/editor-core-utils.js +3 -3
- package/dist/es2019/utils/is-text-input.js +1 -1
- package/dist/es2019/utils/nodes.js +1 -1
- package/dist/es2019/utils/rich-media-utils.js +1 -1
- package/dist/es2019/utils/slice.js +1 -1
- package/dist/es2019/version.json +1 -1
- package/dist/esm/card/MediaAndEmbedsToolbar/index.js +2 -2
- package/dist/esm/card/utils.js +0 -1
- package/dist/esm/core-utils/inside.js +1 -1
- package/dist/esm/guideline/defaultGuideline.js +49 -0
- package/dist/esm/guideline/dynamicGuideline.js +2 -2
- package/dist/esm/guideline/index.js +2 -1
- package/dist/esm/guideline/utils.js +9 -0
- package/dist/esm/insert/index.js +4 -4
- package/dist/esm/monitoring/error.js +1 -1
- package/dist/esm/node-width/index.js +1 -1
- package/dist/esm/safe-plugin/index.js +1 -1
- package/dist/esm/selection/gap-cursor/selection.js +2 -2
- package/dist/esm/transforms/expand.js +2 -2
- package/dist/esm/transforms/extension.js +1 -1
- package/dist/esm/transforms/layout.js +1 -1
- package/dist/esm/ui/DropList/index.js +1 -1
- package/dist/esm/ui/UnsupportedInline/index.js +1 -1
- package/dist/esm/utils/document.js +1 -1
- package/dist/esm/utils/editor-core-utils.js +3 -3
- package/dist/esm/utils/is-text-input.js +1 -1
- package/dist/esm/utils/nodes.js +1 -1
- package/dist/esm/utils/rich-media-utils.js +1 -1
- package/dist/esm/utils/slice.js +1 -1
- package/dist/esm/version.json +1 -1
- package/dist/types/analytics/api.d.ts +1 -1
- package/dist/types/analytics/types/events.d.ts +1 -1
- package/dist/types/analytics/utils.d.ts +1 -1
- package/dist/types/card/MediaAndEmbedsToolbar/index.d.ts +2 -2
- package/dist/types/card/types.d.ts +2 -2
- package/dist/types/card/utils.d.ts +2 -2
- package/dist/types/collab/index.d.ts +2 -2
- package/dist/types/core-utils/inside.d.ts +1 -1
- package/dist/types/editor-analytics/withAnalytics.d.ts +1 -1
- package/dist/types/event-dispatcher/index.d.ts +1 -1
- package/dist/types/guideline/defaultGuideline.d.ts +2 -0
- package/dist/types/guideline/dynamicGuideline.d.ts +1 -1
- package/dist/types/guideline/index.d.ts +2 -1
- package/dist/types/guideline/types.d.ts +1 -1
- package/dist/types/guideline/utils.d.ts +5 -0
- package/dist/types/insert/index.d.ts +2 -2
- package/dist/types/link/LinkPicker/EditorLinkPicker/index.d.ts +1 -1
- package/dist/types/link/LinkPicker/HyperlinkAddToolbar/HyperlinkAddToolbar.d.ts +1 -1
- package/dist/types/link/LinkPicker/HyperlinkAddToolbar/index.d.ts +1 -1
- package/dist/types/link/types.d.ts +1 -1
- package/dist/types/node-width/index.d.ts +2 -2
- package/dist/types/preset/plugin-injection-api.d.ts +1 -1
- package/dist/types/provider-factory/macro-provider.d.ts +1 -1
- package/dist/types/provider-factory/quick-insert-provider.d.ts +2 -2
- package/dist/types/react-node-view/getInlineNodeViewProducer.d.ts +2 -2
- package/dist/types/react-node-view/index.d.ts +2 -2
- package/dist/types/react-node-view/types.d.ts +1 -1
- package/dist/types/safe-plugin/index.d.ts +1 -1
- package/dist/types/selection/gap-cursor/selection.d.ts +3 -3
- package/dist/types/selection/gap-cursor/utils/is-ignored.d.ts +1 -1
- package/dist/types/selection/gap-cursor/utils/is-valid-target-node.d.ts +1 -1
- package/dist/types/selection/types.d.ts +2 -2
- package/dist/types/selection/utils.d.ts +2 -2
- package/dist/types/selection-based-node-view/SelectionBasedNodeView.d.ts +2 -2
- package/dist/types/transforms/expand.d.ts +2 -2
- package/dist/types/transforms/extension.d.ts +1 -1
- package/dist/types/transforms/layout.d.ts +1 -1
- package/dist/types/types/annotation/index.d.ts +1 -1
- package/dist/types/types/command.d.ts +2 -2
- package/dist/types/types/context-panel.d.ts +1 -1
- package/dist/types/types/copy-button.d.ts +2 -2
- package/dist/types/types/editor-actions.d.ts +2 -2
- package/dist/types/types/editor-plugin.d.ts +1 -1
- package/dist/types/types/floating-toolbar.d.ts +3 -3
- package/dist/types/types/index.d.ts +1 -1
- package/dist/types/types/next-editor-plugin.d.ts +1 -1
- package/dist/types/types/plugin-factory.d.ts +1 -1
- package/dist/types/types/prosemirror-config.d.ts +2 -2
- package/dist/types/types/resizable-media-single.d.ts +1 -1
- package/dist/types/types/type-ahead.d.ts +2 -2
- package/dist/types/types/ui-components.d.ts +1 -1
- package/dist/types/ufo/experience-store.d.ts +1 -1
- package/dist/types/ui/MediaSingle/grid.d.ts +1 -1
- package/dist/types/ui/ResizerLegacy/types.d.ts +1 -1
- package/dist/types/ui/UnsupportedBlock/index.d.ts +1 -1
- package/dist/types/ui/UnsupportedInline/index.d.ts +1 -1
- package/dist/types/ui/unsupported-content-helper.d.ts +1 -1
- package/dist/types/ui-react/ReactEditorViewContext.d.ts +1 -1
- package/dist/types/utils/annotation/index.d.ts +1 -1
- package/dist/types/utils/compareNodes.d.ts +1 -1
- package/dist/types/utils/document.d.ts +2 -2
- package/dist/types/utils/editor-core-utils.d.ts +4 -4
- package/dist/types/utils/get-performance-options.d.ts +1 -1
- package/dist/types/utils/hyperlink.d.ts +2 -2
- package/dist/types/utils/is-text-input.d.ts +1 -1
- package/dist/types/utils/list.d.ts +1 -1
- package/dist/types/utils/macro.d.ts +1 -1
- package/dist/types/utils/nodes.d.ts +2 -2
- package/dist/types/utils/plugin-state-factory.d.ts +1 -1
- package/dist/types/utils/referentiality.d.ts +2 -2
- package/dist/types/utils/rich-media-utils.d.ts +1 -1
- package/dist/types/utils/slice.d.ts +1 -1
- package/dist/types/utils/table.d.ts +1 -1
- package/dist/types/utils/track-unsupported-content.d.ts +1 -1
- package/dist/types/utils/validate-using-spec.d.ts +1 -1
- package/dist/types/utils/validator.d.ts +1 -1
- package/dist/types/with-plugin-state/index.d.ts +2 -2
- package/dist/types/with-plugin-state/types.d.ts +1 -1
- package/dist/types-ts4.5/analytics/api.d.ts +1 -1
- package/dist/types-ts4.5/analytics/types/events.d.ts +1 -1
- package/dist/types-ts4.5/analytics/utils.d.ts +1 -1
- package/dist/types-ts4.5/card/MediaAndEmbedsToolbar/index.d.ts +2 -2
- package/dist/types-ts4.5/card/types.d.ts +2 -2
- package/dist/types-ts4.5/card/utils.d.ts +2 -2
- package/dist/types-ts4.5/collab/index.d.ts +2 -2
- package/dist/types-ts4.5/core-utils/inside.d.ts +1 -1
- package/dist/types-ts4.5/editor-analytics/withAnalytics.d.ts +1 -1
- package/dist/types-ts4.5/event-dispatcher/index.d.ts +1 -1
- package/dist/types-ts4.5/guideline/defaultGuideline.d.ts +2 -0
- package/dist/types-ts4.5/guideline/dynamicGuideline.d.ts +1 -1
- package/dist/types-ts4.5/guideline/index.d.ts +2 -1
- package/dist/types-ts4.5/guideline/types.d.ts +1 -1
- package/dist/types-ts4.5/guideline/utils.d.ts +5 -0
- package/dist/types-ts4.5/insert/index.d.ts +2 -2
- package/dist/types-ts4.5/link/LinkPicker/EditorLinkPicker/index.d.ts +1 -1
- package/dist/types-ts4.5/link/LinkPicker/HyperlinkAddToolbar/HyperlinkAddToolbar.d.ts +1 -1
- package/dist/types-ts4.5/link/LinkPicker/HyperlinkAddToolbar/index.d.ts +1 -1
- package/dist/types-ts4.5/link/types.d.ts +1 -1
- package/dist/types-ts4.5/node-width/index.d.ts +2 -2
- package/dist/types-ts4.5/preset/plugin-injection-api.d.ts +1 -1
- package/dist/types-ts4.5/provider-factory/macro-provider.d.ts +1 -1
- package/dist/types-ts4.5/provider-factory/quick-insert-provider.d.ts +2 -2
- package/dist/types-ts4.5/react-node-view/getInlineNodeViewProducer.d.ts +2 -2
- package/dist/types-ts4.5/react-node-view/index.d.ts +2 -2
- package/dist/types-ts4.5/react-node-view/types.d.ts +1 -1
- package/dist/types-ts4.5/safe-plugin/index.d.ts +1 -1
- package/dist/types-ts4.5/selection/gap-cursor/selection.d.ts +3 -3
- package/dist/types-ts4.5/selection/gap-cursor/utils/is-ignored.d.ts +1 -1
- package/dist/types-ts4.5/selection/gap-cursor/utils/is-valid-target-node.d.ts +1 -1
- package/dist/types-ts4.5/selection/types.d.ts +2 -2
- package/dist/types-ts4.5/selection/utils.d.ts +2 -2
- package/dist/types-ts4.5/selection-based-node-view/SelectionBasedNodeView.d.ts +2 -2
- package/dist/types-ts4.5/transforms/expand.d.ts +2 -2
- package/dist/types-ts4.5/transforms/extension.d.ts +1 -1
- package/dist/types-ts4.5/transforms/layout.d.ts +1 -1
- package/dist/types-ts4.5/types/annotation/index.d.ts +1 -1
- package/dist/types-ts4.5/types/command.d.ts +2 -2
- package/dist/types-ts4.5/types/context-panel.d.ts +1 -1
- package/dist/types-ts4.5/types/copy-button.d.ts +2 -2
- package/dist/types-ts4.5/types/editor-actions.d.ts +2 -2
- package/dist/types-ts4.5/types/editor-plugin.d.ts +1 -1
- package/dist/types-ts4.5/types/floating-toolbar.d.ts +3 -3
- package/dist/types-ts4.5/types/index.d.ts +1 -1
- package/dist/types-ts4.5/types/next-editor-plugin.d.ts +1 -1
- package/dist/types-ts4.5/types/plugin-factory.d.ts +1 -1
- package/dist/types-ts4.5/types/prosemirror-config.d.ts +2 -2
- package/dist/types-ts4.5/types/resizable-media-single.d.ts +1 -1
- package/dist/types-ts4.5/types/type-ahead.d.ts +2 -2
- package/dist/types-ts4.5/types/ui-components.d.ts +1 -1
- package/dist/types-ts4.5/ufo/experience-store.d.ts +1 -1
- package/dist/types-ts4.5/ui/MediaSingle/grid.d.ts +1 -1
- package/dist/types-ts4.5/ui/ResizerLegacy/types.d.ts +1 -1
- package/dist/types-ts4.5/ui/UnsupportedBlock/index.d.ts +1 -1
- package/dist/types-ts4.5/ui/UnsupportedInline/index.d.ts +1 -1
- package/dist/types-ts4.5/ui/unsupported-content-helper.d.ts +1 -1
- package/dist/types-ts4.5/ui-react/ReactEditorViewContext.d.ts +1 -1
- package/dist/types-ts4.5/utils/annotation/index.d.ts +1 -1
- package/dist/types-ts4.5/utils/compareNodes.d.ts +1 -1
- package/dist/types-ts4.5/utils/document.d.ts +2 -2
- package/dist/types-ts4.5/utils/editor-core-utils.d.ts +4 -4
- package/dist/types-ts4.5/utils/get-performance-options.d.ts +1 -1
- package/dist/types-ts4.5/utils/hyperlink.d.ts +2 -2
- package/dist/types-ts4.5/utils/is-text-input.d.ts +1 -1
- package/dist/types-ts4.5/utils/list.d.ts +1 -1
- package/dist/types-ts4.5/utils/macro.d.ts +1 -1
- package/dist/types-ts4.5/utils/nodes.d.ts +2 -2
- package/dist/types-ts4.5/utils/plugin-state-factory.d.ts +1 -1
- package/dist/types-ts4.5/utils/referentiality.d.ts +2 -2
- package/dist/types-ts4.5/utils/rich-media-utils.d.ts +1 -1
- package/dist/types-ts4.5/utils/slice.d.ts +1 -1
- package/dist/types-ts4.5/utils/table.d.ts +1 -1
- package/dist/types-ts4.5/utils/track-unsupported-content.d.ts +1 -1
- package/dist/types-ts4.5/utils/validate-using-spec.d.ts +1 -1
- package/dist/types-ts4.5/utils/validator.d.ts +1 -1
- package/dist/types-ts4.5/with-plugin-state/index.d.ts +2 -2
- package/dist/types-ts4.5/with-plugin-state/types.d.ts +1 -1
- package/package.json +4 -8
|
@@ -24,7 +24,7 @@ var _templateObject, _templateObject2, _templateObject3;
|
|
|
24
24
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
|
|
25
25
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } } /** @jsx jsx */
|
|
26
26
|
var packageName = "@atlaskit/editor-common";
|
|
27
|
-
var packageVersion = "74.29.
|
|
27
|
+
var packageVersion = "74.29.2";
|
|
28
28
|
var halfFocusRing = 1;
|
|
29
29
|
var dropOffset = '0, 8';
|
|
30
30
|
var DropList = /*#__PURE__*/function (_Component) {
|
|
@@ -23,7 +23,7 @@ var _templateObject;
|
|
|
23
23
|
/** @jsx jsx */
|
|
24
24
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
25
25
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
26
|
-
var inlineNodeStyle = (0, _react2.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n align-items: center;\n background: ", ";\n border: 1px dashed ", ";\n border-radius: ", "px;\n box-sizing: border-box;\n cursor: default;\n display: inline-flex;\n font-size: ", ";\n margin: 0
|
|
26
|
+
var inlineNodeStyle = (0, _react2.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n align-items: center;\n background: ", ";\n border: 1px dashed ", ";\n border-radius: ", "px;\n box-sizing: border-box;\n cursor: default;\n display: inline-flex;\n font-size: ", ";\n margin: 0 ", ";\n min-height: 24px;\n padding: 0 10px;\n vertical-align: middle;\n white-space: nowrap;\n"])), "var(--ds-background-disabled, ".concat(_colors.N30, ")"), "var(--ds-border-disabled, ".concat(_colors.N50, ")"), (0, _constants.borderRadius)(), (0, _editorSharedStyles.relativeFontSizeToBase16)((0, _constants.fontSize)()), "var(--ds-space-025, 2px)");
|
|
27
27
|
var UnsupportedInlineNode = function UnsupportedInlineNode(_ref) {
|
|
28
28
|
var node = _ref.node,
|
|
29
29
|
intl = _ref.intl,
|
|
@@ -9,8 +9,8 @@ exports.hasDocAsParent = hasDocAsParent;
|
|
|
9
9
|
exports.isEmptyDocument = isEmptyDocument;
|
|
10
10
|
exports.nodesBetweenChanged = nodesBetweenChanged;
|
|
11
11
|
exports.processRawValue = processRawValue;
|
|
12
|
-
var _prosemirrorModel = require("prosemirror-model");
|
|
13
12
|
var _transforms = require("@atlaskit/adf-utils/transforms");
|
|
13
|
+
var _model = require("@atlaskit/editor-prosemirror/model");
|
|
14
14
|
var _analytics = require("../analytics");
|
|
15
15
|
var _editorCoreUtils = require("./editor-core-utils");
|
|
16
16
|
var _privacyFilter = require("./filter/privacy-filter");
|
|
@@ -118,7 +118,7 @@ function processRawValue(schema, value, providerFactory, sanitizePrivateContent,
|
|
|
118
118
|
}
|
|
119
119
|
}
|
|
120
120
|
if (contentTransformer) {
|
|
121
|
-
return
|
|
121
|
+
return _model.Node.fromJSON(schema, node);
|
|
122
122
|
}
|
|
123
123
|
|
|
124
124
|
// link mark on mediaSingle is deprecated, need to move link mark to child media node
|
|
@@ -205,7 +205,7 @@ function processRawValue(schema, value, providerFactory, sanitizePrivateContent,
|
|
|
205
205
|
}
|
|
206
206
|
var entity = (0, _validateUsingSpec.validateADFEntity)(schema, transformedAdf || node, dispatchAnalyticsEvent);
|
|
207
207
|
var newEntity = maySanitizePrivateContent(entity, providerFactory, sanitizePrivateContent);
|
|
208
|
-
var parsedDoc =
|
|
208
|
+
var parsedDoc = _model.Node.fromJSON(schema, newEntity);
|
|
209
209
|
|
|
210
210
|
// throws an error if the document is invalid
|
|
211
211
|
try {
|
|
@@ -11,9 +11,9 @@ exports.setNodeSelection = void 0;
|
|
|
11
11
|
exports.setTextSelection = setTextSelection;
|
|
12
12
|
exports.stepAddsOneOf = stepAddsOneOf;
|
|
13
13
|
exports.stepHasSlice = void 0;
|
|
14
|
-
var
|
|
15
|
-
var
|
|
16
|
-
var
|
|
14
|
+
var _state = require("@atlaskit/editor-prosemirror/state");
|
|
15
|
+
var _transform = require("@atlaskit/editor-prosemirror/transform");
|
|
16
|
+
var _utils = require("@atlaskit/editor-prosemirror/utils");
|
|
17
17
|
var _dom = require("./dom");
|
|
18
18
|
/**
|
|
19
19
|
* Checks if node is an empty paragraph.
|
|
@@ -46,7 +46,7 @@ function stepAddsOneOf(step, nodeTypes) {
|
|
|
46
46
|
return adds;
|
|
47
47
|
}
|
|
48
48
|
var extractSliceFromStep = function extractSliceFromStep(step) {
|
|
49
|
-
if (!(step instanceof
|
|
49
|
+
if (!(step instanceof _transform.ReplaceStep) && !(step instanceof _transform.ReplaceAroundStep)) {
|
|
50
50
|
return null;
|
|
51
51
|
}
|
|
52
52
|
|
|
@@ -57,7 +57,7 @@ var extractSliceFromStep = function extractSliceFromStep(step) {
|
|
|
57
57
|
};
|
|
58
58
|
exports.extractSliceFromStep = extractSliceFromStep;
|
|
59
59
|
var isTextSelection = function isTextSelection(selection) {
|
|
60
|
-
return selection instanceof
|
|
60
|
+
return selection instanceof _state.TextSelection;
|
|
61
61
|
};
|
|
62
62
|
exports.isTextSelection = isTextSelection;
|
|
63
63
|
var isElementInTableCell = function isElementInTableCell(element) {
|
|
@@ -75,14 +75,14 @@ var setNodeSelection = function setNodeSelection(view, pos) {
|
|
|
75
75
|
if (!isFinite(pos)) {
|
|
76
76
|
return;
|
|
77
77
|
}
|
|
78
|
-
var tr = state.tr.setSelection(
|
|
78
|
+
var tr = state.tr.setSelection(_state.NodeSelection.create(state.doc, pos));
|
|
79
79
|
dispatch(tr);
|
|
80
80
|
};
|
|
81
81
|
exports.setNodeSelection = setNodeSelection;
|
|
82
82
|
function setTextSelection(view, anchor, head) {
|
|
83
83
|
var state = view.state,
|
|
84
84
|
dispatch = view.dispatch;
|
|
85
|
-
var tr = state.tr.setSelection(
|
|
85
|
+
var tr = state.tr.setSelection(_state.TextSelection.create(state.doc, anchor, head));
|
|
86
86
|
dispatch(tr);
|
|
87
87
|
}
|
|
88
88
|
function nonNullable(value) {
|
|
@@ -101,6 +101,6 @@ var isValidPosition = function isValidPosition(pos, state) {
|
|
|
101
101
|
};
|
|
102
102
|
exports.isValidPosition = isValidPosition;
|
|
103
103
|
var isInLayoutColumn = function isInLayoutColumn(state) {
|
|
104
|
-
return (0,
|
|
104
|
+
return (0, _utils.hasParentNodeOfType)(state.schema.nodes.layoutSection)(state.selection);
|
|
105
105
|
};
|
|
106
106
|
exports.isInLayoutColumn = isInLayoutColumn;
|
|
@@ -6,13 +6,13 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports.isTextInput = void 0;
|
|
8
8
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
9
|
-
var
|
|
9
|
+
var _transform = require("@atlaskit/editor-prosemirror/transform");
|
|
10
10
|
// TODO: remove from editor-core utils, re-export from editor-common
|
|
11
11
|
|
|
12
12
|
var isTextInput = function isTextInput(tr) {
|
|
13
13
|
var _tr$steps = (0, _slicedToArray2.default)(tr.steps, 1),
|
|
14
14
|
step = _tr$steps[0];
|
|
15
|
-
if (!step || !(step instanceof
|
|
15
|
+
if (!step || !(step instanceof _transform.ReplaceStep)) {
|
|
16
16
|
return false;
|
|
17
17
|
}
|
|
18
18
|
var _ref = step,
|
package/dist/cjs/utils/nodes.js
CHANGED
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.validateNodes = exports.validNode = exports.isType = exports.isText = exports.isSupportedInParent = exports.isParagraph = exports.isNodeSelectedOrInRange = exports.isNodeBeforeMediaNode = exports.isMediaNode = exports.isLinkMark = exports.findChangedNodesFromTransaction = exports.SelectedState = void 0;
|
|
7
|
-
var
|
|
7
|
+
var _utils = require("@atlaskit/editor-prosemirror/utils");
|
|
8
8
|
/**
|
|
9
9
|
* Finds all top level nodes affected by the transaction
|
|
10
10
|
* Uses from/to positions in transaction's steps to work out which nodes will
|
|
@@ -132,7 +132,7 @@ var isNodeBeforeMediaNode = function isNodeBeforeMediaNode($pos, state) {
|
|
|
132
132
|
var nodeBefore = $pos.nodeBefore;
|
|
133
133
|
if (!nodeBefore) {
|
|
134
134
|
var depthOfParent = $pos.depth - 1 || 1;
|
|
135
|
-
var parentNode = (0,
|
|
135
|
+
var parentNode = (0, _utils.findParentNodeOfType)([state.schema.nodes["".concat($pos.node(depthOfParent).type.name)]])(state.selection);
|
|
136
136
|
var resolvedPosOfParentNode = parentNode ? state.tr.doc.resolve(parentNode.pos) : undefined;
|
|
137
137
|
var nodeBeforeParent = resolvedPosOfParentNode && resolvedPosOfParentNode.pos < state.doc.nodeSize ? resolvedPosOfParentNode.nodeBefore : undefined;
|
|
138
138
|
if (nodeBeforeParent) {
|
|
@@ -8,7 +8,7 @@ exports.alignAttributes = void 0;
|
|
|
8
8
|
exports.calculateSnapPoints = calculateSnapPoints;
|
|
9
9
|
exports.nonWrappedLayouts = exports.isRichMediaInsideOfBlockNode = exports.floatingLayouts = void 0;
|
|
10
10
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
11
|
-
var
|
|
11
|
+
var _utils = require("@atlaskit/editor-prosemirror/utils");
|
|
12
12
|
var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
|
|
13
13
|
var _MediaSingle = require("../ui/MediaSingle");
|
|
14
14
|
var _grid = require("../ui/MediaSingle/grid");
|
|
@@ -27,7 +27,7 @@ var isRichMediaInsideOfBlockNode = function isRichMediaInsideOfBlockNode(view, p
|
|
|
27
27
|
expand = _view$state$schema$no.expand,
|
|
28
28
|
nestedExpand = _view$state$schema$no.nestedExpand,
|
|
29
29
|
layoutColumn = _view$state$schema$no.layoutColumn;
|
|
30
|
-
return !!(0,
|
|
30
|
+
return !!(0, _utils.findParentNodeOfTypeClosestToPos)($pos, [expand, nestedExpand, layoutColumn]);
|
|
31
31
|
};
|
|
32
32
|
exports.isRichMediaInsideOfBlockNode = isRichMediaInsideOfBlockNode;
|
|
33
33
|
var alignAttributes = function alignAttributes(layout, oldAttrs) {
|
package/dist/cjs/utils/slice.js
CHANGED
|
@@ -10,7 +10,7 @@ exports.mapChildren = mapChildren;
|
|
|
10
10
|
exports.mapFragment = mapFragment;
|
|
11
11
|
exports.mapSlice = mapSlice;
|
|
12
12
|
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
13
|
-
var
|
|
13
|
+
var _model = require("@atlaskit/editor-prosemirror/model");
|
|
14
14
|
/**
|
|
15
15
|
* A helper to get the underlying array of a fragment.
|
|
16
16
|
*/
|
|
@@ -24,7 +24,7 @@ function mapFragment(content, callback) {
|
|
|
24
24
|
var _node = content.child(i);
|
|
25
25
|
var transformed = _node.isLeaf ? callback(_node, parent, i) : callback(_node.copy(mapFragment(_node.content, callback, _node)), parent, i);
|
|
26
26
|
if (transformed) {
|
|
27
|
-
if (transformed instanceof
|
|
27
|
+
if (transformed instanceof _model.Fragment) {
|
|
28
28
|
children.push.apply(children, (0, _toConsumableArray2.default)(getFragmentBackingArray(transformed)));
|
|
29
29
|
} else if (Array.isArray(transformed)) {
|
|
30
30
|
children.push.apply(children, (0, _toConsumableArray2.default)(transformed));
|
|
@@ -33,11 +33,11 @@ function mapFragment(content, callback) {
|
|
|
33
33
|
}
|
|
34
34
|
}
|
|
35
35
|
}
|
|
36
|
-
return
|
|
36
|
+
return _model.Fragment.fromArray(children);
|
|
37
37
|
}
|
|
38
38
|
function mapSlice(slice, callback) {
|
|
39
39
|
var fragment = mapFragment(slice.content, callback);
|
|
40
|
-
return new
|
|
40
|
+
return new _model.Slice(fragment, slice.openStart, slice.openEnd);
|
|
41
41
|
}
|
|
42
42
|
function flatmap(fragment, callback) {
|
|
43
43
|
var fragmentContent = [];
|
|
@@ -49,12 +49,12 @@ function flatmap(fragment, callback) {
|
|
|
49
49
|
fragmentContent.push(child);
|
|
50
50
|
}
|
|
51
51
|
}
|
|
52
|
-
return
|
|
52
|
+
return _model.Fragment.fromArray(fragmentContent);
|
|
53
53
|
}
|
|
54
54
|
function mapChildren(node, callback) {
|
|
55
55
|
var array = [];
|
|
56
56
|
for (var i = 0; i < node.childCount; i++) {
|
|
57
|
-
array.push(callback(node.child(i), i, node instanceof
|
|
57
|
+
array.push(callback(node.child(i), i, node instanceof _model.Fragment ? node : node.content));
|
|
58
58
|
}
|
|
59
59
|
return array;
|
|
60
60
|
}
|
package/dist/cjs/version.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { NodeSelection } from 'prosemirror
|
|
2
|
-
import { hasParentNodeOfType } from 'prosemirror
|
|
1
|
+
import { NodeSelection } from '@atlaskit/editor-prosemirror/state';
|
|
2
|
+
import { hasParentNodeOfType } from '@atlaskit/editor-prosemirror/utils';
|
|
3
3
|
import { DEFAULT_EMBED_CARD_WIDTH } from '@atlaskit/editor-shared-styles';
|
|
4
4
|
import EditorAlignImageCenter from '@atlaskit/icon/glyph/editor/align-image-center';
|
|
5
5
|
import EditorAlignImageLeft from '@atlaskit/icon/glyph/editor/align-image-left';
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import memoizeOne from 'memoize-one';
|
|
2
|
+
import { breakoutWideScaleRatio } from '@atlaskit/editor-shared-styles';
|
|
3
|
+
import { getContainerWidthOrFullEditorWidth } from './utils';
|
|
4
|
+
const getDefaultGuidelines = memoizeOne(editorWidth => {
|
|
5
|
+
return [-6, -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5, 6].map((val, index) => ({
|
|
6
|
+
key: `grid_${index}`,
|
|
7
|
+
position: {
|
|
8
|
+
x: val / 12 * editorWidth
|
|
9
|
+
}
|
|
10
|
+
}));
|
|
11
|
+
});
|
|
12
|
+
const getWideGuidelines = memoizeOne(editorWidth => {
|
|
13
|
+
const wideSpacing = editorWidth * breakoutWideScaleRatio / 2;
|
|
14
|
+
return [{
|
|
15
|
+
key: `wide_left`,
|
|
16
|
+
position: {
|
|
17
|
+
x: -wideSpacing
|
|
18
|
+
}
|
|
19
|
+
}, {
|
|
20
|
+
key: `wide_right`,
|
|
21
|
+
position: {
|
|
22
|
+
x: wideSpacing
|
|
23
|
+
}
|
|
24
|
+
}];
|
|
25
|
+
});
|
|
26
|
+
const getFullWidthGuidelines = memoizeOne(containerWidth => {
|
|
27
|
+
const fullWidth = getContainerWidthOrFullEditorWidth(containerWidth);
|
|
28
|
+
return [{
|
|
29
|
+
key: `full_width_left`,
|
|
30
|
+
position: {
|
|
31
|
+
x: -fullWidth
|
|
32
|
+
}
|
|
33
|
+
}, {
|
|
34
|
+
key: `full_width_right`,
|
|
35
|
+
position: {
|
|
36
|
+
x: fullWidth
|
|
37
|
+
}
|
|
38
|
+
}];
|
|
39
|
+
});
|
|
40
|
+
export const generateDefaultGuidelines = (editorWidth, containerWidth, isFullWidthMode = false) => {
|
|
41
|
+
const innerGrids = getDefaultGuidelines(editorWidth);
|
|
42
|
+
const wideGuidelines = !isFullWidthMode ? getWideGuidelines(editorWidth) : [];
|
|
43
|
+
const fullWidthGuidelines = !isFullWidthMode ? getFullWidthGuidelines(containerWidth) : [];
|
|
44
|
+
return [...innerGrids, ...wideGuidelines, ...fullWidthGuidelines];
|
|
45
|
+
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { NodeSelection } from 'prosemirror
|
|
2
|
-
import { findChildren } from 'prosemirror
|
|
1
|
+
import { NodeSelection } from '@atlaskit/editor-prosemirror/state';
|
|
2
|
+
import { findChildren } from '@atlaskit/editor-prosemirror/utils';
|
|
3
3
|
import { getMediaSinglePixelWidth } from '../media-single';
|
|
4
4
|
import { MEDIA_DYNAMIC_GUIDELINE_PREFIX } from './constants';
|
|
5
5
|
export const generateDynamicGuidelines = (state, editorWidth) => {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export { generateDynamicGuidelines } from './dynamicGuideline';
|
|
2
2
|
export { createFixedGuidelinesFromLengths, createGuidesFromLengths } from './fixedGuideline';
|
|
3
|
+
export { generateDefaultGuidelines } from './defaultGuideline';
|
|
3
4
|
export { getGuidelinesWithHighlights } from './updateGuideline';
|
|
4
5
|
export { MEDIA_DYNAMIC_GUIDELINE_PREFIX } from './constants';
|
|
5
|
-
export { isVerticalPosition } from './utils';
|
|
6
|
+
export { isVerticalPosition, getContainerWidthOrFullEditorWidth } from './utils';
|
|
@@ -1,4 +1,11 @@
|
|
|
1
|
+
import { akEditorFullWidthLayoutWidth, akEditorGutterPadding } from '@atlaskit/editor-shared-styles';
|
|
1
2
|
export const isNumber = x => typeof x === 'number' && !isNaN(x) && isFinite(x);
|
|
2
3
|
export const isVerticalPosition = pos => {
|
|
3
4
|
return isNumber(pos.x);
|
|
4
|
-
};
|
|
5
|
+
};
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Calculates container or full editor width taking in account editor full width layout
|
|
9
|
+
* width and editor gutter padding.
|
|
10
|
+
*/
|
|
11
|
+
export const getContainerWidthOrFullEditorWidth = containerWidth => Math.min(containerWidth - akEditorGutterPadding * 2, akEditorFullWidthLayoutWidth) / 2;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { Fragment, Node, Slice } from 'prosemirror
|
|
2
|
-
import { NodeSelection, Selection, TextSelection } from 'prosemirror
|
|
3
|
-
import { ReplaceAroundStep, ReplaceStep } from 'prosemirror
|
|
4
|
-
import { canInsert, findParentNodeOfType, hasParentNodeOfType, isNodeSelection, safeInsert as pmSafeInsert } from 'prosemirror
|
|
1
|
+
import { Fragment, Node, Slice } from '@atlaskit/editor-prosemirror/model';
|
|
2
|
+
import { NodeSelection, Selection, TextSelection } from '@atlaskit/editor-prosemirror/state';
|
|
3
|
+
import { ReplaceAroundStep, ReplaceStep } from '@atlaskit/editor-prosemirror/transform';
|
|
4
|
+
import { canInsert, findParentNodeOfType, hasParentNodeOfType, isNodeSelection, safeInsert as pmSafeInsert } from '@atlaskit/editor-prosemirror/utils';
|
|
5
5
|
import { GapCursorSelection, Side } from '../selection';
|
|
6
6
|
import { isEmptyParagraph, isListItemNode } from '../utils';
|
|
7
7
|
export let LookDirection = /*#__PURE__*/function (LookDirection) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
const SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
|
|
2
2
|
const packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
|
|
3
|
-
const packageVersion = "74.29.
|
|
3
|
+
const packageVersion = "74.29.2";
|
|
4
4
|
const sanitiseSentryEvents = (data, _hint) => {
|
|
5
5
|
// Remove URL as it has UGC
|
|
6
6
|
// TODO: Sanitise the URL instead of just removing it
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { findParentNodeOfTypeClosestToPos } from 'prosemirror
|
|
1
|
+
import { findParentNodeOfTypeClosestToPos } from '@atlaskit/editor-prosemirror/utils';
|
|
2
2
|
import { akEditorDefaultLayoutWidth, akEditorFullWidthLayoutWidth, akEditorWideLayoutWidth, akLayoutGutterOffset, gridMediumMaxWidth } from '@atlaskit/editor-shared-styles';
|
|
3
3
|
// eslint-disable-next-line @atlaskit/design-system/no-deprecated-imports
|
|
4
4
|
import { gridSize } from '@atlaskit/theme/constants';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Plugin } from 'prosemirror
|
|
1
|
+
import { Plugin } from '@atlaskit/editor-prosemirror/state';
|
|
2
2
|
export class SafePlugin extends Plugin {
|
|
3
3
|
// This variable isn't (and shouldn't) be used anywhere. Its purpose is
|
|
4
4
|
// to distinguish Plugin from SafePlugin, thus ensuring that an 'unsafe'
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
-
import { Slice } from 'prosemirror
|
|
3
|
-
import { Selection } from 'prosemirror
|
|
2
|
+
import { Slice } from '@atlaskit/editor-prosemirror/model';
|
|
3
|
+
import { Selection } from '@atlaskit/editor-prosemirror/state';
|
|
4
4
|
import { isValidTargetNode } from './utils/is-valid-target-node';
|
|
5
5
|
export let Side = /*#__PURE__*/function (Side) {
|
|
6
6
|
Side["LEFT"] = "left";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Fragment, Slice } from 'prosemirror
|
|
2
|
-
import { findParentNodeOfType, findSelectedNodeOfType } from 'prosemirror
|
|
1
|
+
import { Fragment, Slice } from '@atlaskit/editor-prosemirror/model';
|
|
2
|
+
import { findParentNodeOfType, findSelectedNodeOfType } from '@atlaskit/editor-prosemirror/utils';
|
|
3
3
|
import { mapChildren } from '../utils/slice';
|
|
4
4
|
export const findExpand = (state, selection) => {
|
|
5
5
|
const {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Fragment, Slice } from 'prosemirror
|
|
1
|
+
import { Fragment, Slice } from '@atlaskit/editor-prosemirror/model';
|
|
2
2
|
import { flatmap, mapFragment } from '../utils/slice';
|
|
3
3
|
const isLayoutNode = node => node.type === node.type.schema.nodes.layoutSection || node.type === node.type.schema.nodes.layoutColumn;
|
|
4
4
|
export function unwrapContentFromLayout(maybeLayoutSection) {
|
|
@@ -8,7 +8,7 @@ import { themed } from '@atlaskit/theme/components';
|
|
|
8
8
|
import { borderRadius } from '@atlaskit/theme/constants';
|
|
9
9
|
import Layer from '../Layer';
|
|
10
10
|
const packageName = "@atlaskit/editor-common";
|
|
11
|
-
const packageVersion = "74.29.
|
|
11
|
+
const packageVersion = "74.29.2";
|
|
12
12
|
const halfFocusRing = 1;
|
|
13
13
|
const dropOffset = '0, 8';
|
|
14
14
|
class DropList extends Component {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Node } from 'prosemirror-model';
|
|
2
1
|
import { transformDedupeMarks, transformIndentationMarks, transformInvalidMediaContent, transformMediaLinkMarks, transformNodesMissingContent, transformTextLinkCodeMarks } from '@atlaskit/adf-utils/transforms';
|
|
2
|
+
import { Node } from '@atlaskit/editor-prosemirror/model';
|
|
3
3
|
import { ACTION, ACTION_SUBJECT, EVENT_TYPE } from '../analytics';
|
|
4
4
|
import { isEmptyParagraph } from './editor-core-utils';
|
|
5
5
|
import { sanitizeNodeForPrivacy } from './filter/privacy-filter';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { NodeSelection, TextSelection } from 'prosemirror
|
|
2
|
-
import { ReplaceAroundStep, ReplaceStep } from 'prosemirror
|
|
3
|
-
import { hasParentNodeOfType } from 'prosemirror
|
|
1
|
+
import { NodeSelection, TextSelection } from '@atlaskit/editor-prosemirror/state';
|
|
2
|
+
import { ReplaceAroundStep, ReplaceStep } from '@atlaskit/editor-prosemirror/transform';
|
|
3
|
+
import { hasParentNodeOfType } from '@atlaskit/editor-prosemirror/utils';
|
|
4
4
|
import { closest } from './dom';
|
|
5
5
|
|
|
6
6
|
/**
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// TODO: remove from editor-core utils, re-export from editor-common
|
|
2
2
|
|
|
3
|
-
import { ReplaceStep } from 'prosemirror
|
|
3
|
+
import { ReplaceStep } from '@atlaskit/editor-prosemirror/transform';
|
|
4
4
|
export const isTextInput = tr => {
|
|
5
5
|
const [step] = tr.steps;
|
|
6
6
|
if (!step || !(step instanceof ReplaceStep)) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { findParentNodeOfType } from 'prosemirror
|
|
1
|
+
import { findParentNodeOfType } from '@atlaskit/editor-prosemirror/utils';
|
|
2
2
|
/**
|
|
3
3
|
* Finds all top level nodes affected by the transaction
|
|
4
4
|
* Uses from/to positions in transaction's steps to work out which nodes will
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { findParentNodeOfTypeClosestToPos } from 'prosemirror
|
|
1
|
+
import { findParentNodeOfTypeClosestToPos } from '@atlaskit/editor-prosemirror/utils';
|
|
2
2
|
import { akEditorBreakoutPadding } from '@atlaskit/editor-shared-styles';
|
|
3
3
|
import { shouldAddDefaultWrappedWidth } from '../ui/MediaSingle';
|
|
4
4
|
import { calcPxFromColumns, wrappedLayouts } from '../ui/MediaSingle/grid';
|
package/dist/es2019/version.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
2
|
-
import { NodeSelection } from 'prosemirror
|
|
3
|
-
import { hasParentNodeOfType } from 'prosemirror
|
|
2
|
+
import { NodeSelection } from '@atlaskit/editor-prosemirror/state';
|
|
3
|
+
import { hasParentNodeOfType } from '@atlaskit/editor-prosemirror/utils';
|
|
4
4
|
import { DEFAULT_EMBED_CARD_WIDTH } from '@atlaskit/editor-shared-styles';
|
|
5
5
|
import EditorAlignImageCenter from '@atlaskit/icon/glyph/editor/align-image-center';
|
|
6
6
|
import EditorAlignImageLeft from '@atlaskit/icon/glyph/editor/align-image-left';
|
package/dist/esm/card/utils.js
CHANGED
|
@@ -2,7 +2,6 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
|
2
2
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
3
3
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
4
4
|
import { LinkMetaStep } from '@atlaskit/adf-schema/steps';
|
|
5
|
-
|
|
6
5
|
/**
|
|
7
6
|
* Records metadata about the user action and input method relating to a transaction
|
|
8
7
|
* as a custom LinkStepMetadata prosemirror step so that it is preserved in
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { hasParentNodeOfType } from 'prosemirror
|
|
1
|
+
import { hasParentNodeOfType } from '@atlaskit/editor-prosemirror/utils';
|
|
2
2
|
export var insideTable = function insideTable(state) {
|
|
3
3
|
var _state$schema$nodes = state.schema.nodes,
|
|
4
4
|
table = _state$schema$nodes.table,
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
2
|
+
import memoizeOne from 'memoize-one';
|
|
3
|
+
import { breakoutWideScaleRatio } from '@atlaskit/editor-shared-styles';
|
|
4
|
+
import { getContainerWidthOrFullEditorWidth } from './utils';
|
|
5
|
+
var getDefaultGuidelines = memoizeOne(function (editorWidth) {
|
|
6
|
+
return [-6, -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5, 6].map(function (val, index) {
|
|
7
|
+
return {
|
|
8
|
+
key: "grid_".concat(index),
|
|
9
|
+
position: {
|
|
10
|
+
x: val / 12 * editorWidth
|
|
11
|
+
}
|
|
12
|
+
};
|
|
13
|
+
});
|
|
14
|
+
});
|
|
15
|
+
var getWideGuidelines = memoizeOne(function (editorWidth) {
|
|
16
|
+
var wideSpacing = editorWidth * breakoutWideScaleRatio / 2;
|
|
17
|
+
return [{
|
|
18
|
+
key: "wide_left",
|
|
19
|
+
position: {
|
|
20
|
+
x: -wideSpacing
|
|
21
|
+
}
|
|
22
|
+
}, {
|
|
23
|
+
key: "wide_right",
|
|
24
|
+
position: {
|
|
25
|
+
x: wideSpacing
|
|
26
|
+
}
|
|
27
|
+
}];
|
|
28
|
+
});
|
|
29
|
+
var getFullWidthGuidelines = memoizeOne(function (containerWidth) {
|
|
30
|
+
var fullWidth = getContainerWidthOrFullEditorWidth(containerWidth);
|
|
31
|
+
return [{
|
|
32
|
+
key: "full_width_left",
|
|
33
|
+
position: {
|
|
34
|
+
x: -fullWidth
|
|
35
|
+
}
|
|
36
|
+
}, {
|
|
37
|
+
key: "full_width_right",
|
|
38
|
+
position: {
|
|
39
|
+
x: fullWidth
|
|
40
|
+
}
|
|
41
|
+
}];
|
|
42
|
+
});
|
|
43
|
+
export var generateDefaultGuidelines = function generateDefaultGuidelines(editorWidth, containerWidth) {
|
|
44
|
+
var isFullWidthMode = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
45
|
+
var innerGrids = getDefaultGuidelines(editorWidth);
|
|
46
|
+
var wideGuidelines = !isFullWidthMode ? getWideGuidelines(editorWidth) : [];
|
|
47
|
+
var fullWidthGuidelines = !isFullWidthMode ? getFullWidthGuidelines(containerWidth) : [];
|
|
48
|
+
return [].concat(_toConsumableArray(innerGrids), _toConsumableArray(wideGuidelines), _toConsumableArray(fullWidthGuidelines));
|
|
49
|
+
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
2
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
3
3
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
4
|
-
import { NodeSelection } from 'prosemirror
|
|
5
|
-
import { findChildren } from 'prosemirror
|
|
4
|
+
import { NodeSelection } from '@atlaskit/editor-prosemirror/state';
|
|
5
|
+
import { findChildren } from '@atlaskit/editor-prosemirror/utils';
|
|
6
6
|
import { getMediaSinglePixelWidth } from '../media-single';
|
|
7
7
|
import { MEDIA_DYNAMIC_GUIDELINE_PREFIX } from './constants';
|
|
8
8
|
export var generateDynamicGuidelines = function generateDynamicGuidelines(state, editorWidth) {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export { generateDynamicGuidelines } from './dynamicGuideline';
|
|
2
2
|
export { createFixedGuidelinesFromLengths, createGuidesFromLengths } from './fixedGuideline';
|
|
3
|
+
export { generateDefaultGuidelines } from './defaultGuideline';
|
|
3
4
|
export { getGuidelinesWithHighlights } from './updateGuideline';
|
|
4
5
|
export { MEDIA_DYNAMIC_GUIDELINE_PREFIX } from './constants';
|
|
5
|
-
export { isVerticalPosition } from './utils';
|
|
6
|
+
export { isVerticalPosition, getContainerWidthOrFullEditorWidth } from './utils';
|
|
@@ -1,6 +1,15 @@
|
|
|
1
|
+
import { akEditorFullWidthLayoutWidth, akEditorGutterPadding } from '@atlaskit/editor-shared-styles';
|
|
1
2
|
export var isNumber = function isNumber(x) {
|
|
2
3
|
return typeof x === 'number' && !isNaN(x) && isFinite(x);
|
|
3
4
|
};
|
|
4
5
|
export var isVerticalPosition = function isVerticalPosition(pos) {
|
|
5
6
|
return isNumber(pos.x);
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Calculates container or full editor width taking in account editor full width layout
|
|
11
|
+
* width and editor gutter padding.
|
|
12
|
+
*/
|
|
13
|
+
export var getContainerWidthOrFullEditorWidth = function getContainerWidthOrFullEditorWidth(containerWidth) {
|
|
14
|
+
return Math.min(containerWidth - akEditorGutterPadding * 2, akEditorFullWidthLayoutWidth) / 2;
|
|
6
15
|
};
|
package/dist/esm/insert/index.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
2
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
3
3
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
4
|
-
import { Fragment, Node, Slice } from 'prosemirror
|
|
5
|
-
import { NodeSelection, Selection, TextSelection } from 'prosemirror
|
|
6
|
-
import { ReplaceAroundStep, ReplaceStep } from 'prosemirror
|
|
7
|
-
import { canInsert, findParentNodeOfType, hasParentNodeOfType, isNodeSelection, safeInsert as pmSafeInsert } from 'prosemirror
|
|
4
|
+
import { Fragment, Node, Slice } from '@atlaskit/editor-prosemirror/model';
|
|
5
|
+
import { NodeSelection, Selection, TextSelection } from '@atlaskit/editor-prosemirror/state';
|
|
6
|
+
import { ReplaceAroundStep, ReplaceStep } from '@atlaskit/editor-prosemirror/transform';
|
|
7
|
+
import { canInsert, findParentNodeOfType, hasParentNodeOfType, isNodeSelection, safeInsert as pmSafeInsert } from '@atlaskit/editor-prosemirror/utils';
|
|
8
8
|
import { GapCursorSelection, Side } from '../selection';
|
|
9
9
|
import { isEmptyParagraph, isListItemNode } from '../utils';
|
|
10
10
|
export var LookDirection = /*#__PURE__*/function (LookDirection) {
|
|
@@ -6,7 +6,7 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
|
|
|
6
6
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
7
7
|
var SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
|
|
8
8
|
var packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
|
|
9
|
-
var packageVersion = "74.29.
|
|
9
|
+
var packageVersion = "74.29.2";
|
|
10
10
|
var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
|
|
11
11
|
// Remove URL as it has UGC
|
|
12
12
|
// TODO: Sanitise the URL instead of just removing it
|