@atlaskit/editor-common 110.31.0 → 110.32.1
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 +29 -0
- package/dist/cjs/messages/breakout.js +5 -0
- package/dist/cjs/monitoring/error.js +1 -1
- package/dist/cjs/resizer/ResizerBreakoutModeLabel.js +2 -0
- package/dist/cjs/selection/index.js +6 -0
- package/dist/cjs/selection/utils.js +25 -0
- package/dist/cjs/transforms/index.js +4 -4
- package/dist/cjs/transforms/sync-block.js +41 -19
- package/dist/cjs/ui/DropList/index.js +1 -1
- package/dist/cjs/ui/MediaSingle/styled.js +14 -2
- package/dist/cjs/ui-react/with-react-editor-view-outer-listeners.js +7 -3
- package/dist/es2019/messages/breakout.js +5 -0
- package/dist/es2019/monitoring/error.js +1 -1
- package/dist/es2019/resizer/ResizerBreakoutModeLabel.js +2 -0
- package/dist/es2019/selection/index.js +1 -1
- package/dist/es2019/selection/utils.js +25 -1
- package/dist/es2019/transforms/index.js +1 -1
- package/dist/es2019/transforms/sync-block.js +41 -19
- package/dist/es2019/ui/DropList/index.js +1 -1
- package/dist/es2019/ui/MediaSingle/styled.js +14 -2
- package/dist/es2019/ui-react/with-react-editor-view-outer-listeners.js +6 -2
- package/dist/esm/messages/breakout.js +5 -0
- package/dist/esm/monitoring/error.js +1 -1
- package/dist/esm/resizer/ResizerBreakoutModeLabel.js +2 -0
- package/dist/esm/selection/index.js +1 -1
- package/dist/esm/selection/utils.js +25 -1
- package/dist/esm/transforms/index.js +1 -1
- package/dist/esm/transforms/sync-block.js +40 -18
- package/dist/esm/ui/DropList/index.js +1 -1
- package/dist/esm/ui/MediaSingle/styled.js +14 -2
- package/dist/esm/ui-react/with-react-editor-view-outer-listeners.js +7 -3
- package/dist/types/messages/breakout.d.ts +5 -0
- package/dist/types/selection/index.d.ts +1 -1
- package/dist/types/selection/utils.d.ts +7 -1
- package/dist/types/transforms/index.d.ts +1 -1
- package/dist/types/transforms/sync-block.d.ts +6 -1
- package/dist/types/types/breakout.d.ts +1 -1
- package/dist/types/ui/MediaSingle/styled.d.ts +1 -1
- package/dist/types/ui-react/with-react-editor-view-outer-listeners.d.ts +1 -0
- package/dist/types/utils/breakout.d.ts +1 -1
- package/dist/types-ts4.5/messages/breakout.d.ts +5 -0
- package/dist/types-ts4.5/selection/index.d.ts +1 -1
- package/dist/types-ts4.5/selection/utils.d.ts +7 -1
- package/dist/types-ts4.5/transforms/index.d.ts +1 -1
- package/dist/types-ts4.5/transforms/sync-block.d.ts +6 -1
- package/dist/types-ts4.5/types/breakout.d.ts +1 -1
- package/dist/types-ts4.5/ui/MediaSingle/styled.d.ts +1 -1
- package/dist/types-ts4.5/ui-react/with-react-editor-view-outer-listeners.d.ts +1 -0
- package/dist/types-ts4.5/utils/breakout.d.ts +1 -1
- package/package.json +6 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,34 @@
|
|
|
1
1
|
# @atlaskit/editor-common
|
|
2
2
|
|
|
3
|
+
## 110.32.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`a05464ea42678`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/a05464ea42678) -
|
|
8
|
+
EDITOR-2791 bump adf-schema
|
|
9
|
+
- Updated dependencies
|
|
10
|
+
|
|
11
|
+
## 110.32.0
|
|
12
|
+
|
|
13
|
+
### Minor Changes
|
|
14
|
+
|
|
15
|
+
- [`81ac927e830b5`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/81ac927e830b5) -
|
|
16
|
+
[ux] EDITOR-2866: Add max-width support and guideline wiring for node custom resizers
|
|
17
|
+
|
|
18
|
+
### Patch Changes
|
|
19
|
+
|
|
20
|
+
- [`98517a05bfada`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/98517a05bfada) -
|
|
21
|
+
fix styling for full-width and wide media single
|
|
22
|
+
- Updated dependencies
|
|
23
|
+
|
|
24
|
+
## 110.31.1
|
|
25
|
+
|
|
26
|
+
### Patch Changes
|
|
27
|
+
|
|
28
|
+
- [`b14a5fc14cf22`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/b14a5fc14cf22) -
|
|
29
|
+
[ux] EDITOR-2606 copy sync block from renderer should flatten out content instead of creating new
|
|
30
|
+
reference
|
|
31
|
+
|
|
3
32
|
## 110.31.0
|
|
4
33
|
|
|
5
34
|
### Minor Changes
|
|
@@ -6,6 +6,11 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.messages = void 0;
|
|
7
7
|
var _reactIntlNext = require("react-intl-next");
|
|
8
8
|
var messages = exports.messages = (0, _reactIntlNext.defineMessages)({
|
|
9
|
+
maxWidthLabel: {
|
|
10
|
+
id: 'fabric.editor.breakoutMaxWidthLabel',
|
|
11
|
+
defaultMessage: 'Max-width',
|
|
12
|
+
description: 'Resize current element to max-width mode'
|
|
13
|
+
},
|
|
9
14
|
fullWidthLabel: {
|
|
10
15
|
id: 'fabric.editor.breakoutFullWidthLabel',
|
|
11
16
|
defaultMessage: 'Full-width',
|
|
@@ -16,7 +16,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
16
16
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
17
17
|
var SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
|
|
18
18
|
var packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
|
|
19
|
-
var packageVersion = "110.
|
|
19
|
+
var packageVersion = "110.32.0";
|
|
20
20
|
var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
|
|
21
21
|
// Remove URL as it has UGC
|
|
22
22
|
// Ignored via go/ees007
|
|
@@ -34,6 +34,8 @@ var ResizerBreakoutModeLabel = exports.ResizerBreakoutModeLabel = function Resiz
|
|
|
34
34
|
formatMessage = _useIntl.formatMessage;
|
|
35
35
|
var message = _react.default.useMemo(function () {
|
|
36
36
|
switch (breakoutLayout) {
|
|
37
|
+
case 'max':
|
|
38
|
+
return formatMessage(_messages.breakoutMessages.maxWidthLabel);
|
|
37
39
|
case 'full-width':
|
|
38
40
|
return formatMessage(_messages.breakoutMessages.fullWidthLabel);
|
|
39
41
|
case 'wide':
|
|
@@ -58,6 +58,12 @@ Object.defineProperty(exports, "atTheEndOfDoc", {
|
|
|
58
58
|
}
|
|
59
59
|
});
|
|
60
60
|
exports.createSelectionClickHandler = createSelectionClickHandler;
|
|
61
|
+
Object.defineProperty(exports, "deleteSelectedRange", {
|
|
62
|
+
enumerable: true,
|
|
63
|
+
get: function get() {
|
|
64
|
+
return _utils2.deleteSelectedRange;
|
|
65
|
+
}
|
|
66
|
+
});
|
|
61
67
|
Object.defineProperty(exports, "endPositionOfParent", {
|
|
62
68
|
enumerable: true,
|
|
63
69
|
get: function get() {
|
|
@@ -7,10 +7,12 @@ exports.atTheBeginningOfBlock = atTheBeginningOfBlock;
|
|
|
7
7
|
exports.atTheBeginningOfDoc = atTheBeginningOfDoc;
|
|
8
8
|
exports.atTheEndOfBlock = atTheEndOfBlock;
|
|
9
9
|
exports.atTheEndOfDoc = atTheEndOfDoc;
|
|
10
|
+
exports.deleteSelectedRange = void 0;
|
|
10
11
|
exports.endPositionOfParent = endPositionOfParent;
|
|
11
12
|
exports.isSelectionAtStartOfNode = exports.isSelectionAtEndOfNode = exports.expandSelectionBounds = void 0;
|
|
12
13
|
exports.startPositionOfParent = startPositionOfParent;
|
|
13
14
|
var _state = require("@atlaskit/editor-prosemirror/state");
|
|
15
|
+
var _utils = require("@atlaskit/editor-tables/utils");
|
|
14
16
|
var _selection = require("./gap-cursor/selection");
|
|
15
17
|
var isSelectionAtStartOfNode = exports.isSelectionAtStartOfNode = function isSelectionAtStartOfNode($pos, parentNode) {
|
|
16
18
|
if (!parentNode) {
|
|
@@ -123,4 +125,27 @@ var expandSelectionBounds = exports.expandSelectionBounds = function expandSelec
|
|
|
123
125
|
$anchor: $anchor === $from ? $expandedFrom : $expandedTo,
|
|
124
126
|
$head: $head === $to ? $expandedTo : $expandedFrom
|
|
125
127
|
};
|
|
128
|
+
};
|
|
129
|
+
|
|
130
|
+
/**
|
|
131
|
+
* Delete what is selected in the given transaction.
|
|
132
|
+
* @param tr the transaction to delete the selection from
|
|
133
|
+
* @returns the updated transaction
|
|
134
|
+
*/
|
|
135
|
+
var deleteSelectedRange = exports.deleteSelectedRange = function deleteSelectedRange(tr) {
|
|
136
|
+
var selection = tr.selection;
|
|
137
|
+
var from = selection.$from.pos;
|
|
138
|
+
var to = selection.$to.pos;
|
|
139
|
+
if (selection instanceof _state.TextSelection) {
|
|
140
|
+
from = from - 1;
|
|
141
|
+
to = to + 1;
|
|
142
|
+
} else if ((0, _utils.isTableSelected)(selection)) {
|
|
143
|
+
var table = (0, _utils.findTable)(selection);
|
|
144
|
+
if (table) {
|
|
145
|
+
from = table.pos;
|
|
146
|
+
to = table.pos + table.node.nodeSize;
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
tr.deleteRange(from, to);
|
|
150
|
+
return tr;
|
|
126
151
|
};
|
|
@@ -153,16 +153,16 @@ Object.defineProperty(exports, "transformSliceToRemoveOpenNestedExpand", {
|
|
|
153
153
|
return _expand.transformSliceToRemoveOpenNestedExpand;
|
|
154
154
|
}
|
|
155
155
|
});
|
|
156
|
-
Object.defineProperty(exports, "
|
|
156
|
+
Object.defineProperty(exports, "transformSyncBlock", {
|
|
157
157
|
enumerable: true,
|
|
158
158
|
get: function get() {
|
|
159
|
-
return
|
|
159
|
+
return _syncBlock.transformSyncBlock;
|
|
160
160
|
}
|
|
161
161
|
});
|
|
162
|
-
Object.defineProperty(exports, "
|
|
162
|
+
Object.defineProperty(exports, "transformTaskListToBlockNodes", {
|
|
163
163
|
enumerable: true,
|
|
164
164
|
get: function get() {
|
|
165
|
-
return
|
|
165
|
+
return _listTransforms.transformTaskListToBlockNodes;
|
|
166
166
|
}
|
|
167
167
|
});
|
|
168
168
|
Object.defineProperty(exports, "transformToTaskList", {
|
|
@@ -4,34 +4,56 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
|
-
exports.
|
|
7
|
+
exports.transformSyncBlock = void 0;
|
|
8
8
|
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
9
9
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
10
10
|
var _adfSchema = require("@atlaskit/adf-schema");
|
|
11
11
|
var _slice = require("../utils/slice");
|
|
12
12
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
13
13
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
14
|
-
var
|
|
14
|
+
var transformSyncBlockNode = function transformSyncBlockNode(node, schema, isFromEditor) {
|
|
15
|
+
// if copying from renderer, flatten out the content and remove the sync block
|
|
16
|
+
if (!isFromEditor) {
|
|
17
|
+
return node.content;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
// sync blocks need a unique localId to function correctly
|
|
21
|
+
var newAttrs = _objectSpread(_objectSpread({}, node.attrs), {}, {
|
|
22
|
+
localId: _adfSchema.uuid.generate()
|
|
23
|
+
});
|
|
24
|
+
return schema.nodes.syncBlock.create(newAttrs, null, (0, _toConsumableArray2.default)(node.marks));
|
|
25
|
+
};
|
|
26
|
+
var transformBodiedSyncBlockNode = function transformBodiedSyncBlockNode(node, schema, isFromEditor) {
|
|
27
|
+
// if copying from renderer, flatten out the content and remove the bodied sync block
|
|
28
|
+
if (!isFromEditor) {
|
|
29
|
+
return node.content;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
// bodied sync blocks need a unique localId and convert to a reference sync block
|
|
33
|
+
// when converting we want to be specific about attributes and marks we carry over
|
|
34
|
+
var newAttrs = {
|
|
35
|
+
resourceId: node.attrs.resourceId,
|
|
36
|
+
localId: _adfSchema.uuid.generate()
|
|
37
|
+
};
|
|
38
|
+
var newMarks = schema.nodes.syncBlock.markSet ? node.marks.filter(function (mark) {
|
|
39
|
+
var _schema$nodes$syncBlo;
|
|
40
|
+
return (_schema$nodes$syncBlo = schema.nodes.syncBlock.markSet) === null || _schema$nodes$syncBlo === void 0 ? void 0 : _schema$nodes$syncBlo.includes(mark.type);
|
|
41
|
+
}) : node.marks; // schema.nodes.syncBlock.markSet is null meaning all marks are allowed
|
|
42
|
+
|
|
43
|
+
return schema.nodes.syncBlock.create(newAttrs, null, newMarks);
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* If we are copying from editor, transform the copied source or reference sync block to a new reference sync block
|
|
48
|
+
* Otherwise, (e.g. if copying from renderer), flatten out the content and remove the sync block
|
|
49
|
+
*/
|
|
50
|
+
var transformSyncBlock = exports.transformSyncBlock = function transformSyncBlock(slice, schema, pasteSource) {
|
|
51
|
+
var isFromEditor = pasteSource === 'fabric-editor';
|
|
15
52
|
slice = (0, _slice.mapSlice)(slice, function (node) {
|
|
16
|
-
// sync blocks need a unique localId to function correctly
|
|
17
53
|
if (node.type === schema.nodes.syncBlock) {
|
|
18
|
-
|
|
19
|
-
localId: _adfSchema.uuid.generate()
|
|
20
|
-
});
|
|
21
|
-
return schema.nodes.syncBlock.create(newAttrs, null, (0, _toConsumableArray2.default)(node.marks));
|
|
54
|
+
return transformSyncBlockNode(node, schema, isFromEditor);
|
|
22
55
|
} else if (node.type === schema.nodes.bodiedSyncBlock) {
|
|
23
|
-
|
|
24
|
-
// when converting we want to be specific about attributes and marks we carry over
|
|
25
|
-
var _newAttrs = {
|
|
26
|
-
resourceId: node.attrs.resourceId,
|
|
27
|
-
localId: _adfSchema.uuid.generate()
|
|
28
|
-
};
|
|
29
|
-
var newMarks = schema.nodes.syncBlock.markSet ? node.marks.filter(function (mark) {
|
|
30
|
-
var _schema$nodes$syncBlo;
|
|
31
|
-
return (_schema$nodes$syncBlo = schema.nodes.syncBlock.markSet) === null || _schema$nodes$syncBlo === void 0 ? void 0 : _schema$nodes$syncBlo.includes(mark.type);
|
|
32
|
-
}) : node.marks; // schema.nodes.syncBlock.markSet is null meaning all marks are allowed
|
|
33
|
-
|
|
34
|
-
return schema.nodes.syncBlock.create(_newAttrs, null, newMarks);
|
|
56
|
+
return transformBodiedSyncBlockNode(node, schema, isFromEditor);
|
|
35
57
|
}
|
|
36
58
|
return node;
|
|
37
59
|
});
|
|
@@ -24,7 +24,7 @@ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.
|
|
|
24
24
|
* @jsx jsx
|
|
25
25
|
*/ // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
26
26
|
var packageName = "@atlaskit/editor-common";
|
|
27
|
-
var packageVersion = "110.
|
|
27
|
+
var packageVersion = "110.32.0";
|
|
28
28
|
var halfFocusRing = 1;
|
|
29
29
|
var dropOffset = '0, 8';
|
|
30
30
|
var fadeIn = (0, _react2.keyframes)({
|
|
@@ -15,6 +15,7 @@ var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/hel
|
|
|
15
15
|
var _react = _interopRequireDefault(require("react"));
|
|
16
16
|
var _react2 = require("@emotion/react");
|
|
17
17
|
var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
|
|
18
|
+
var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
|
|
18
19
|
var _utils = require("../../utils");
|
|
19
20
|
var _breakout = require("../../utils/breakout");
|
|
20
21
|
var _excluded = ["children"];
|
|
@@ -154,6 +155,16 @@ function calcMargin(layout) {
|
|
|
154
155
|
return '24px auto';
|
|
155
156
|
}
|
|
156
157
|
}
|
|
158
|
+
function calcMaxCssForPercentageTypeMedia(layout) {
|
|
159
|
+
switch (layout) {
|
|
160
|
+
case 'wide':
|
|
161
|
+
return "min(var(--ak-editor--breakout-wide-layout-width), var(--ak-editor-max-container-width))";
|
|
162
|
+
case 'full-width':
|
|
163
|
+
return "min(var(--ak-editor--full-width-layout-width), var(--ak-editor-max-container-width))";
|
|
164
|
+
default:
|
|
165
|
+
return 'var(--ak-editor-max-container-width)';
|
|
166
|
+
}
|
|
167
|
+
}
|
|
157
168
|
function isImageAligned(layout) {
|
|
158
169
|
switch (layout) {
|
|
159
170
|
case 'align-end':
|
|
@@ -219,10 +230,11 @@ var MediaSingleDimensionHelper = exports.MediaSingleDimensionHelper = function M
|
|
|
219
230
|
isInRenderer = _ref$isInRenderer === void 0 ? false : _ref$isInRenderer;
|
|
220
231
|
var calculatedWidth = roundToClosestEvenPxValue(isExtendedResizeExperienceOn ? "".concat(mediaSingleWidth || width, "px") : mediaSingleWidth ? calcResizedWidth(layout, width || 0, containerWidth) : calcLegacyWidth(layout, width || 0, containerWidth, fullWidthMode, isResized, isInsideOfInlineExtension));
|
|
221
232
|
var calculatedMaxWidth = roundToClosestEvenPxValue(isExtendedResizeExperienceOn ? "".concat(containerWidth, "px") : calcMaxWidth(layout, containerWidth));
|
|
233
|
+
var cssMaxWidth = isExtendedResizeExperienceOn ? 'var(--ak-editor-max-container-width)' : calcMaxCssForPercentageTypeMedia(layout);
|
|
222
234
|
|
|
223
235
|
// jest warning: JSDOM version (22) doesn't support the new @container CSS rule
|
|
224
236
|
// eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression -- Needs manual remediation
|
|
225
|
-
return (0, _react2.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n\t\t/* For nested rich media items, set max-width to 100% */\n\t\ttr &,\n\t\t[data-layout-column] &,\n\t\t[data-node-type='expand'] &,\n\t\t[data-panel-type] &,\n\t\tli & {\n\t\t\tmax-width: 100%;\n\t\t}\n\n\t\twidth: ", ";\n\t\t", "\n\n\t\t", "\n\
|
|
237
|
+
return (0, _react2.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n\t\t/* For nested rich media items, set max-width to 100% */\n\t\ttr &,\n\t\t[data-layout-column] &,\n\t\t[data-node-type='expand'] &,\n\t\t[data-panel-type] &,\n\t\tli & {\n\t\t\tmax-width: 100%;\n\t\t}\n\n\t\twidth: ", ";\n\t\t", "\n\n\t\t", "\n\n\t\t", "\n\n\t\t&:not(.is-resizing) {\n\t\t\ttransition: width 100ms ease-in;\n\t\t}\n\n\t\tfloat: ", ";\n\t\tmargin: ", ";\n\n\t\t&[class*='not-resizing'] {\n\t\t\t", "\n\t\t}\n\n\t\t", ";\n\t"])), calculatedWidth, layout === 'full-width' &&
|
|
226
238
|
/* This causes issues for new experience where we don't strip layout attributes
|
|
227
239
|
when copying top-level node and pasting into a table/layout,
|
|
228
240
|
because full-width layout will remain, causing node to be edge-to-edge */
|
|
@@ -233,7 +245,7 @@ var MediaSingleDimensionHelper = exports.MediaSingleDimensionHelper = function M
|
|
|
233
245
|
'@container ak-renderer-wrapper (min-width: 1px)': {
|
|
234
246
|
maxWidth: '100cqw'
|
|
235
247
|
}
|
|
236
|
-
}) : "max-width: ".concat(calculatedMaxWidth, ";"), isExtendedResizeExperienceOn && "&[class*='is-resizing'] {\n .new-file-experience-wrapper {\n box-shadow: none !important;\n }\n\n ".concat(!isNestedNode && _utils.nonWrappedLayouts.includes(layout) && "margin-left: 50%;\n transform: translateX(-50%);", "\n }"), float(layout), calcMargin(layout), isNestedNode ? /* Make nested node appear responsive when resizing table cell */"max-width: 100%;" : _utils.nonWrappedLayouts.includes(layout) && "margin-left: 50%;\n transform: translateX(-50%);", isImageAligned(layout));
|
|
248
|
+
}) : (0, _expValEquals.expValEquals)('platform_editor_media_vc_fixes', 'isEnabled', true) ? "max-width: ".concat(cssMaxWidth, ";") : "max-width: ".concat(calculatedMaxWidth, ";"), isExtendedResizeExperienceOn && "&[class*='is-resizing'] {\n .new-file-experience-wrapper {\n box-shadow: none !important;\n }\n\n ".concat(!isNestedNode && _utils.nonWrappedLayouts.includes(layout) && "margin-left: 50%;\n transform: translateX(-50%);", "\n }"), float(layout), calcMargin(layout), isNestedNode ? /* Make nested node appear responsive when resizing table cell */"max-width: 100%;" : _utils.nonWrappedLayouts.includes(layout) && "margin-left: 50%;\n transform: translateX(-50%);", isImageAligned(layout));
|
|
237
249
|
};
|
|
238
250
|
var RenderFallbackContainer = function RenderFallbackContainer(_ref2) {
|
|
239
251
|
var hasFallbackContainer = _ref2.hasFallbackContainer,
|
|
@@ -18,7 +18,7 @@ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/de
|
|
|
18
18
|
var _react = _interopRequireWildcard(require("react"));
|
|
19
19
|
var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
|
|
20
20
|
var _ReactEditorViewContext = _interopRequireDefault(require("./ReactEditorViewContext"));
|
|
21
|
-
var _excluded = ["handleClickOutside", "handleEnterKeydown", "handleEscapeKeydown", "closeOnTab", "captureClick"];
|
|
21
|
+
var _excluded = ["handleClickOutside", "handleEnterKeydown", "handleEscapeKeydown", "handleBackspaceDeleteKeydown", "closeOnTab", "captureClick"];
|
|
22
22
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
23
23
|
function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2.default)(o), (0, _possibleConstructorReturn2.default)(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2.default)(t).constructor) : o.apply(t, e)); }
|
|
24
24
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
@@ -70,6 +70,8 @@ var WithOutsideClick = /*#__PURE__*/function (_PureComponent) {
|
|
|
70
70
|
} else if (evt.code === 'Tab' && _this.props.handleEscapeKeydown && _this.props.closeOnTab) {
|
|
71
71
|
// The menus should be closed when the tab is pressed as it takes the focus out of the menu
|
|
72
72
|
_this.props.handleEscapeKeydown(evt);
|
|
73
|
+
} else if ((evt.code === 'Delete' || evt.code === 'Backspace') && _this.props.handleBackspaceDeleteKeydown) {
|
|
74
|
+
_this.props.handleBackspaceDeleteKeydown(evt);
|
|
73
75
|
}
|
|
74
76
|
});
|
|
75
77
|
return _this;
|
|
@@ -86,7 +88,7 @@ var WithOutsideClick = /*#__PURE__*/function (_PureComponent) {
|
|
|
86
88
|
// eslint-disable-next-line @repo/internal/dom-events/no-unsafe-event-listeners
|
|
87
89
|
document.addEventListener('click', this.handleClick, options);
|
|
88
90
|
}
|
|
89
|
-
if (this.props.handleEscapeKeydown) {
|
|
91
|
+
if (this.props.handleEscapeKeydown || this.props.handleBackspaceDeleteKeydown) {
|
|
90
92
|
var _this$props$editorRef;
|
|
91
93
|
// Attached event to the menu so that 'ESC' events from the opened menu also will be handled.
|
|
92
94
|
// Ignored via go/ees005
|
|
@@ -111,7 +113,7 @@ var WithOutsideClick = /*#__PURE__*/function (_PureComponent) {
|
|
|
111
113
|
// eslint-disable-next-line @repo/internal/dom-events/no-unsafe-event-listeners
|
|
112
114
|
document.removeEventListener('click', this.handleClick, options);
|
|
113
115
|
}
|
|
114
|
-
if (this.props.handleEscapeKeydown) {
|
|
116
|
+
if (this.props.handleEscapeKeydown || this.props.handleBackspaceDeleteKeydown) {
|
|
115
117
|
var _this$props$editorRef2;
|
|
116
118
|
// Ignored via go/ees005
|
|
117
119
|
// eslint-disable-next-line @repo/internal/dom-events/no-unsafe-event-listeners
|
|
@@ -141,6 +143,7 @@ function withReactEditorViewOuterListeners(Component) {
|
|
|
141
143
|
var handleClickOutside = _ref.handleClickOutside,
|
|
142
144
|
handleEnterKeydown = _ref.handleEnterKeydown,
|
|
143
145
|
handleEscapeKeydown = _ref.handleEscapeKeydown,
|
|
146
|
+
handleBackspaceDeleteKeydown = _ref.handleBackspaceDeleteKeydown,
|
|
144
147
|
closeOnTab = _ref.closeOnTab,
|
|
145
148
|
captureClick = _ref.captureClick,
|
|
146
149
|
props = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
@@ -174,6 +177,7 @@ function withReactEditorViewOuterListeners(Component) {
|
|
|
174
177
|
handleClickOutside: handleClickOutside,
|
|
175
178
|
handleEnterKeydown: handleEnterKeydown,
|
|
176
179
|
handleEscapeKeydown: handleEscapeKeydown,
|
|
180
|
+
handleBackspaceDeleteKeydown: handleBackspaceDeleteKeydown,
|
|
177
181
|
closeOnTab: closeOnTab,
|
|
178
182
|
captureClick: captureClick
|
|
179
183
|
}, /*#__PURE__*/_react.default.createElement(Component
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
import { defineMessages } from 'react-intl-next';
|
|
2
2
|
export const messages = defineMessages({
|
|
3
|
+
maxWidthLabel: {
|
|
4
|
+
id: 'fabric.editor.breakoutMaxWidthLabel',
|
|
5
|
+
defaultMessage: 'Max-width',
|
|
6
|
+
description: 'Resize current element to max-width mode'
|
|
7
|
+
},
|
|
3
8
|
fullWidthLabel: {
|
|
4
9
|
id: 'fabric.editor.breakoutFullWidthLabel',
|
|
5
10
|
defaultMessage: 'Full-width',
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { isFedRamp } from './environment';
|
|
2
2
|
const SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
|
|
3
3
|
const packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
|
|
4
|
-
const packageVersion = "110.
|
|
4
|
+
const packageVersion = "110.32.0";
|
|
5
5
|
const sanitiseSentryEvents = (data, _hint) => {
|
|
6
6
|
// Remove URL as it has UGC
|
|
7
7
|
// Ignored via go/ees007
|
|
@@ -29,6 +29,8 @@ export const ResizerBreakoutModeLabel = ({
|
|
|
29
29
|
} = useIntl();
|
|
30
30
|
const message = React.useMemo(() => {
|
|
31
31
|
switch (breakoutLayout) {
|
|
32
|
+
case 'max':
|
|
33
|
+
return formatMessage(messages.maxWidthLabel);
|
|
32
34
|
case 'full-width':
|
|
33
35
|
return formatMessage(messages.fullWidthLabel);
|
|
34
36
|
case 'wide':
|
|
@@ -12,7 +12,7 @@ export { isIgnored } from './gap-cursor/utils/is-ignored';
|
|
|
12
12
|
export { isValidTargetNode } from './gap-cursor/utils/is-valid-target-node';
|
|
13
13
|
export { setGapCursorSelection } from './gap-cursor/utils/setGapCursorSelection';
|
|
14
14
|
export { hideCaretModifier, gapCursorStyles } from './gap-cursor/styles';
|
|
15
|
-
export { atTheBeginningOfBlock, atTheBeginningOfDoc, atTheEndOfBlock, atTheEndOfDoc, endPositionOfParent, expandSelectionBounds, isSelectionAtEndOfNode, isSelectionAtStartOfNode, startPositionOfParent } from './utils';
|
|
15
|
+
export { atTheBeginningOfBlock, atTheBeginningOfDoc, atTheEndOfBlock, atTheEndOfDoc, deleteSelectedRange, endPositionOfParent, expandSelectionBounds, isSelectionAtEndOfNode, isSelectionAtStartOfNode, startPositionOfParent } from './utils';
|
|
16
16
|
export function getNodeSelectionAnalyticsPayload(selection) {
|
|
17
17
|
if (selection instanceof NodeSelection) {
|
|
18
18
|
return {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { NodeSelection } from '@atlaskit/editor-prosemirror/state';
|
|
1
|
+
import { NodeSelection, TextSelection } from '@atlaskit/editor-prosemirror/state';
|
|
2
|
+
import { findTable, isTableSelected } from '@atlaskit/editor-tables/utils';
|
|
2
3
|
import { GapCursorSelection } from './gap-cursor/selection';
|
|
3
4
|
export const isSelectionAtStartOfNode = ($pos, parentNode) => {
|
|
4
5
|
if (!parentNode) {
|
|
@@ -123,4 +124,27 @@ export const expandSelectionBounds = ($anchor, $head) => {
|
|
|
123
124
|
$anchor: $anchor === $from ? $expandedFrom : $expandedTo,
|
|
124
125
|
$head: $head === $to ? $expandedTo : $expandedFrom
|
|
125
126
|
};
|
|
127
|
+
};
|
|
128
|
+
|
|
129
|
+
/**
|
|
130
|
+
* Delete what is selected in the given transaction.
|
|
131
|
+
* @param tr the transaction to delete the selection from
|
|
132
|
+
* @returns the updated transaction
|
|
133
|
+
*/
|
|
134
|
+
export const deleteSelectedRange = tr => {
|
|
135
|
+
const selection = tr.selection;
|
|
136
|
+
let from = selection.$from.pos;
|
|
137
|
+
let to = selection.$to.pos;
|
|
138
|
+
if (selection instanceof TextSelection) {
|
|
139
|
+
from = from - 1;
|
|
140
|
+
to = to + 1;
|
|
141
|
+
} else if (isTableSelected(selection)) {
|
|
142
|
+
const table = findTable(selection);
|
|
143
|
+
if (table) {
|
|
144
|
+
from = table.pos;
|
|
145
|
+
to = table.pos + table.node.nodeSize;
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
tr.deleteRange(from, to);
|
|
149
|
+
return tr;
|
|
126
150
|
};
|
|
@@ -8,4 +8,4 @@ export { transformSliceToJoinAdjacentCodeBlocks, transformSingleLineCodeBlockToC
|
|
|
8
8
|
export { transformSliceToDecisionList } from './decision-list';
|
|
9
9
|
export { transformListStructure, transformBetweenListTypes, transformListRecursively, transformToTaskList, transformTaskListToBlockNodes, getFormattedNode } from './list-transforms';
|
|
10
10
|
export { isBulletOrOrderedList, isTaskList, getSupportedListTypesSet, convertBlockToInlineContent } from './list-utils';
|
|
11
|
-
export {
|
|
11
|
+
export { transformSyncBlock } from './sync-block';
|
|
@@ -1,27 +1,49 @@
|
|
|
1
1
|
import { uuid } from '@atlaskit/adf-schema';
|
|
2
2
|
import { mapSlice } from '../utils/slice';
|
|
3
|
-
|
|
3
|
+
const transformSyncBlockNode = (node, schema, isFromEditor) => {
|
|
4
|
+
// if copying from renderer, flatten out the content and remove the sync block
|
|
5
|
+
if (!isFromEditor) {
|
|
6
|
+
return node.content;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
// sync blocks need a unique localId to function correctly
|
|
10
|
+
const newAttrs = {
|
|
11
|
+
...node.attrs,
|
|
12
|
+
localId: uuid.generate()
|
|
13
|
+
};
|
|
14
|
+
return schema.nodes.syncBlock.create(newAttrs, null, [...node.marks]);
|
|
15
|
+
};
|
|
16
|
+
const transformBodiedSyncBlockNode = (node, schema, isFromEditor) => {
|
|
17
|
+
// if copying from renderer, flatten out the content and remove the bodied sync block
|
|
18
|
+
if (!isFromEditor) {
|
|
19
|
+
return node.content;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
// bodied sync blocks need a unique localId and convert to a reference sync block
|
|
23
|
+
// when converting we want to be specific about attributes and marks we carry over
|
|
24
|
+
const newAttrs = {
|
|
25
|
+
resourceId: node.attrs.resourceId,
|
|
26
|
+
localId: uuid.generate()
|
|
27
|
+
};
|
|
28
|
+
const newMarks = schema.nodes.syncBlock.markSet ? node.marks.filter(mark => {
|
|
29
|
+
var _schema$nodes$syncBlo;
|
|
30
|
+
return (_schema$nodes$syncBlo = schema.nodes.syncBlock.markSet) === null || _schema$nodes$syncBlo === void 0 ? void 0 : _schema$nodes$syncBlo.includes(mark.type);
|
|
31
|
+
}) : node.marks; // schema.nodes.syncBlock.markSet is null meaning all marks are allowed
|
|
32
|
+
|
|
33
|
+
return schema.nodes.syncBlock.create(newAttrs, null, newMarks);
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* If we are copying from editor, transform the copied source or reference sync block to a new reference sync block
|
|
38
|
+
* Otherwise, (e.g. if copying from renderer), flatten out the content and remove the sync block
|
|
39
|
+
*/
|
|
40
|
+
export const transformSyncBlock = (slice, schema, pasteSource) => {
|
|
41
|
+
const isFromEditor = pasteSource === 'fabric-editor';
|
|
4
42
|
slice = mapSlice(slice, node => {
|
|
5
|
-
// sync blocks need a unique localId to function correctly
|
|
6
43
|
if (node.type === schema.nodes.syncBlock) {
|
|
7
|
-
|
|
8
|
-
...node.attrs,
|
|
9
|
-
localId: uuid.generate()
|
|
10
|
-
};
|
|
11
|
-
return schema.nodes.syncBlock.create(newAttrs, null, [...node.marks]);
|
|
44
|
+
return transformSyncBlockNode(node, schema, isFromEditor);
|
|
12
45
|
} else if (node.type === schema.nodes.bodiedSyncBlock) {
|
|
13
|
-
|
|
14
|
-
// when converting we want to be specific about attributes and marks we carry over
|
|
15
|
-
const newAttrs = {
|
|
16
|
-
resourceId: node.attrs.resourceId,
|
|
17
|
-
localId: uuid.generate()
|
|
18
|
-
};
|
|
19
|
-
const newMarks = schema.nodes.syncBlock.markSet ? node.marks.filter(mark => {
|
|
20
|
-
var _schema$nodes$syncBlo;
|
|
21
|
-
return (_schema$nodes$syncBlo = schema.nodes.syncBlock.markSet) === null || _schema$nodes$syncBlo === void 0 ? void 0 : _schema$nodes$syncBlo.includes(mark.type);
|
|
22
|
-
}) : node.marks; // schema.nodes.syncBlock.markSet is null meaning all marks are allowed
|
|
23
|
-
|
|
24
|
-
return schema.nodes.syncBlock.create(newAttrs, null, newMarks);
|
|
46
|
+
return transformBodiedSyncBlockNode(node, schema, isFromEditor);
|
|
25
47
|
}
|
|
26
48
|
return node;
|
|
27
49
|
});
|
|
@@ -14,7 +14,7 @@ import withAnalyticsEvents from '@atlaskit/analytics-next/withAnalyticsEvents';
|
|
|
14
14
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
15
15
|
import Layer from '../Layer';
|
|
16
16
|
const packageName = "@atlaskit/editor-common";
|
|
17
|
-
const packageVersion = "110.
|
|
17
|
+
const packageVersion = "110.32.0";
|
|
18
18
|
const halfFocusRing = 1;
|
|
19
19
|
const dropOffset = '0, 8';
|
|
20
20
|
const fadeIn = keyframes({
|
|
@@ -8,6 +8,7 @@ import React from 'react';
|
|
|
8
8
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
9
9
|
import { css, jsx } from '@emotion/react';
|
|
10
10
|
import { akEditorDefaultLayoutWidth, akEditorFullPageMaxWidth, akEditorFullWidthLayoutWidth } from '@atlaskit/editor-shared-styles';
|
|
11
|
+
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
11
12
|
import { nonWrappedLayouts } from '../../utils';
|
|
12
13
|
import { calcBreakoutWidth, calcWideWidth } from '../../utils/breakout';
|
|
13
14
|
function float(layout) {
|
|
@@ -132,6 +133,16 @@ function calcMargin(layout) {
|
|
|
132
133
|
return '24px auto';
|
|
133
134
|
}
|
|
134
135
|
}
|
|
136
|
+
function calcMaxCssForPercentageTypeMedia(layout) {
|
|
137
|
+
switch (layout) {
|
|
138
|
+
case 'wide':
|
|
139
|
+
return `min(var(--ak-editor--breakout-wide-layout-width), var(--ak-editor-max-container-width))`;
|
|
140
|
+
case 'full-width':
|
|
141
|
+
return `min(var(--ak-editor--full-width-layout-width), var(--ak-editor-max-container-width))`;
|
|
142
|
+
default:
|
|
143
|
+
return 'var(--ak-editor-max-container-width)';
|
|
144
|
+
}
|
|
145
|
+
}
|
|
135
146
|
function isImageAligned(layout) {
|
|
136
147
|
switch (layout) {
|
|
137
148
|
case 'align-end':
|
|
@@ -195,6 +206,7 @@ export const MediaSingleDimensionHelper = ({
|
|
|
195
206
|
}) => {
|
|
196
207
|
const calculatedWidth = roundToClosestEvenPxValue(isExtendedResizeExperienceOn ? `${mediaSingleWidth || width}px` : mediaSingleWidth ? calcResizedWidth(layout, width || 0, containerWidth) : calcLegacyWidth(layout, width || 0, containerWidth, fullWidthMode, isResized, isInsideOfInlineExtension));
|
|
197
208
|
const calculatedMaxWidth = roundToClosestEvenPxValue(isExtendedResizeExperienceOn ? `${containerWidth}px` : calcMaxWidth(layout, containerWidth));
|
|
209
|
+
const cssMaxWidth = isExtendedResizeExperienceOn ? 'var(--ak-editor-max-container-width)' : calcMaxCssForPercentageTypeMedia(layout);
|
|
198
210
|
|
|
199
211
|
// jest warning: JSDOM version (22) doesn't support the new @container CSS rule
|
|
200
212
|
// eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression -- Needs manual remediation
|
|
@@ -222,8 +234,8 @@ export const MediaSingleDimensionHelper = ({
|
|
|
222
234
|
'@container ak-renderer-wrapper (min-width: 1px)': {
|
|
223
235
|
maxWidth: '100cqw'
|
|
224
236
|
}
|
|
225
|
-
}) : `max-width: ${calculatedMaxWidth};`}
|
|
226
|
-
|
|
237
|
+
}) : expValEquals('platform_editor_media_vc_fixes', 'isEnabled', true) ? `max-width: ${cssMaxWidth};` : `max-width: ${calculatedMaxWidth};`}
|
|
238
|
+
|
|
227
239
|
${isExtendedResizeExperienceOn && `&[class*='is-resizing'] {
|
|
228
240
|
.new-file-experience-wrapper {
|
|
229
241
|
box-shadow: none !important;
|
|
@@ -44,6 +44,8 @@ class WithOutsideClick extends PureComponent {
|
|
|
44
44
|
} else if (evt.code === 'Tab' && this.props.handleEscapeKeydown && this.props.closeOnTab) {
|
|
45
45
|
// The menus should be closed when the tab is pressed as it takes the focus out of the menu
|
|
46
46
|
this.props.handleEscapeKeydown(evt);
|
|
47
|
+
} else if ((evt.code === 'Delete' || evt.code === 'Backspace') && this.props.handleBackspaceDeleteKeydown) {
|
|
48
|
+
this.props.handleBackspaceDeleteKeydown(evt);
|
|
47
49
|
}
|
|
48
50
|
});
|
|
49
51
|
}
|
|
@@ -56,7 +58,7 @@ class WithOutsideClick extends PureComponent {
|
|
|
56
58
|
// eslint-disable-next-line @repo/internal/dom-events/no-unsafe-event-listeners
|
|
57
59
|
document.addEventListener('click', this.handleClick, options);
|
|
58
60
|
}
|
|
59
|
-
if (this.props.handleEscapeKeydown) {
|
|
61
|
+
if (this.props.handleEscapeKeydown || this.props.handleBackspaceDeleteKeydown) {
|
|
60
62
|
var _this$props$editorRef;
|
|
61
63
|
// Attached event to the menu so that 'ESC' events from the opened menu also will be handled.
|
|
62
64
|
// Ignored via go/ees005
|
|
@@ -79,7 +81,7 @@ class WithOutsideClick extends PureComponent {
|
|
|
79
81
|
// eslint-disable-next-line @repo/internal/dom-events/no-unsafe-event-listeners
|
|
80
82
|
document.removeEventListener('click', this.handleClick, options);
|
|
81
83
|
}
|
|
82
|
-
if (this.props.handleEscapeKeydown) {
|
|
84
|
+
if (this.props.handleEscapeKeydown || this.props.handleBackspaceDeleteKeydown) {
|
|
83
85
|
var _this$props$editorRef2;
|
|
84
86
|
// Ignored via go/ees005
|
|
85
87
|
// eslint-disable-next-line @repo/internal/dom-events/no-unsafe-event-listeners
|
|
@@ -106,6 +108,7 @@ export default function withReactEditorViewOuterListeners(Component) {
|
|
|
106
108
|
handleClickOutside,
|
|
107
109
|
handleEnterKeydown,
|
|
108
110
|
handleEscapeKeydown,
|
|
111
|
+
handleBackspaceDeleteKeydown,
|
|
109
112
|
closeOnTab,
|
|
110
113
|
captureClick,
|
|
111
114
|
...props
|
|
@@ -137,6 +140,7 @@ export default function withReactEditorViewOuterListeners(Component) {
|
|
|
137
140
|
handleClickOutside: handleClickOutside,
|
|
138
141
|
handleEnterKeydown: handleEnterKeydown,
|
|
139
142
|
handleEscapeKeydown: handleEscapeKeydown,
|
|
143
|
+
handleBackspaceDeleteKeydown: handleBackspaceDeleteKeydown,
|
|
140
144
|
closeOnTab: closeOnTab,
|
|
141
145
|
captureClick: captureClick
|
|
142
146
|
}, /*#__PURE__*/React.createElement(Component
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
import { defineMessages } from 'react-intl-next';
|
|
2
2
|
export var messages = defineMessages({
|
|
3
|
+
maxWidthLabel: {
|
|
4
|
+
id: 'fabric.editor.breakoutMaxWidthLabel',
|
|
5
|
+
defaultMessage: 'Max-width',
|
|
6
|
+
description: 'Resize current element to max-width mode'
|
|
7
|
+
},
|
|
3
8
|
fullWidthLabel: {
|
|
4
9
|
id: 'fabric.editor.breakoutFullWidthLabel',
|
|
5
10
|
defaultMessage: 'Full-width',
|
|
@@ -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 = "110.
|
|
10
|
+
var packageVersion = "110.32.0";
|
|
11
11
|
var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
|
|
12
12
|
// Remove URL as it has UGC
|
|
13
13
|
// Ignored via go/ees007
|
|
@@ -27,6 +27,8 @@ export var ResizerBreakoutModeLabel = function ResizerBreakoutModeLabel(_ref) {
|
|
|
27
27
|
formatMessage = _useIntl.formatMessage;
|
|
28
28
|
var message = React.useMemo(function () {
|
|
29
29
|
switch (breakoutLayout) {
|
|
30
|
+
case 'max':
|
|
31
|
+
return formatMessage(messages.maxWidthLabel);
|
|
30
32
|
case 'full-width':
|
|
31
33
|
return formatMessage(messages.fullWidthLabel);
|
|
32
34
|
case 'wide':
|
|
@@ -12,7 +12,7 @@ export { isIgnored } from './gap-cursor/utils/is-ignored';
|
|
|
12
12
|
export { isValidTargetNode } from './gap-cursor/utils/is-valid-target-node';
|
|
13
13
|
export { setGapCursorSelection } from './gap-cursor/utils/setGapCursorSelection';
|
|
14
14
|
export { hideCaretModifier, gapCursorStyles } from './gap-cursor/styles';
|
|
15
|
-
export { atTheBeginningOfBlock, atTheBeginningOfDoc, atTheEndOfBlock, atTheEndOfDoc, endPositionOfParent, expandSelectionBounds, isSelectionAtEndOfNode, isSelectionAtStartOfNode, startPositionOfParent } from './utils';
|
|
15
|
+
export { atTheBeginningOfBlock, atTheBeginningOfDoc, atTheEndOfBlock, atTheEndOfDoc, deleteSelectedRange, endPositionOfParent, expandSelectionBounds, isSelectionAtEndOfNode, isSelectionAtStartOfNode, startPositionOfParent } from './utils';
|
|
16
16
|
export function getNodeSelectionAnalyticsPayload(selection) {
|
|
17
17
|
if (selection instanceof NodeSelection) {
|
|
18
18
|
return {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { NodeSelection } from '@atlaskit/editor-prosemirror/state';
|
|
1
|
+
import { NodeSelection, TextSelection } from '@atlaskit/editor-prosemirror/state';
|
|
2
|
+
import { findTable, isTableSelected } from '@atlaskit/editor-tables/utils';
|
|
2
3
|
import { GapCursorSelection } from './gap-cursor/selection';
|
|
3
4
|
export var isSelectionAtStartOfNode = function isSelectionAtStartOfNode($pos, parentNode) {
|
|
4
5
|
if (!parentNode) {
|
|
@@ -111,4 +112,27 @@ export var expandSelectionBounds = function expandSelectionBounds($anchor, $head
|
|
|
111
112
|
$anchor: $anchor === $from ? $expandedFrom : $expandedTo,
|
|
112
113
|
$head: $head === $to ? $expandedTo : $expandedFrom
|
|
113
114
|
};
|
|
115
|
+
};
|
|
116
|
+
|
|
117
|
+
/**
|
|
118
|
+
* Delete what is selected in the given transaction.
|
|
119
|
+
* @param tr the transaction to delete the selection from
|
|
120
|
+
* @returns the updated transaction
|
|
121
|
+
*/
|
|
122
|
+
export var deleteSelectedRange = function deleteSelectedRange(tr) {
|
|
123
|
+
var selection = tr.selection;
|
|
124
|
+
var from = selection.$from.pos;
|
|
125
|
+
var to = selection.$to.pos;
|
|
126
|
+
if (selection instanceof TextSelection) {
|
|
127
|
+
from = from - 1;
|
|
128
|
+
to = to + 1;
|
|
129
|
+
} else if (isTableSelected(selection)) {
|
|
130
|
+
var table = findTable(selection);
|
|
131
|
+
if (table) {
|
|
132
|
+
from = table.pos;
|
|
133
|
+
to = table.pos + table.node.nodeSize;
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
tr.deleteRange(from, to);
|
|
137
|
+
return tr;
|
|
114
138
|
};
|
|
@@ -8,4 +8,4 @@ export { transformSliceToJoinAdjacentCodeBlocks, transformSingleLineCodeBlockToC
|
|
|
8
8
|
export { transformSliceToDecisionList } from './decision-list';
|
|
9
9
|
export { transformListStructure, transformBetweenListTypes, transformListRecursively, transformToTaskList, transformTaskListToBlockNodes, getFormattedNode } from './list-transforms';
|
|
10
10
|
export { isBulletOrOrderedList, isTaskList, getSupportedListTypesSet, convertBlockToInlineContent } from './list-utils';
|
|
11
|
-
export {
|
|
11
|
+
export { transformSyncBlock } from './sync-block';
|
|
@@ -4,27 +4,49 @@ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbol
|
|
|
4
4
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
5
5
|
import { uuid } from '@atlaskit/adf-schema';
|
|
6
6
|
import { mapSlice } from '../utils/slice';
|
|
7
|
-
|
|
7
|
+
var transformSyncBlockNode = function transformSyncBlockNode(node, schema, isFromEditor) {
|
|
8
|
+
// if copying from renderer, flatten out the content and remove the sync block
|
|
9
|
+
if (!isFromEditor) {
|
|
10
|
+
return node.content;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
// sync blocks need a unique localId to function correctly
|
|
14
|
+
var newAttrs = _objectSpread(_objectSpread({}, node.attrs), {}, {
|
|
15
|
+
localId: uuid.generate()
|
|
16
|
+
});
|
|
17
|
+
return schema.nodes.syncBlock.create(newAttrs, null, _toConsumableArray(node.marks));
|
|
18
|
+
};
|
|
19
|
+
var transformBodiedSyncBlockNode = function transformBodiedSyncBlockNode(node, schema, isFromEditor) {
|
|
20
|
+
// if copying from renderer, flatten out the content and remove the bodied sync block
|
|
21
|
+
if (!isFromEditor) {
|
|
22
|
+
return node.content;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
// bodied sync blocks need a unique localId and convert to a reference sync block
|
|
26
|
+
// when converting we want to be specific about attributes and marks we carry over
|
|
27
|
+
var newAttrs = {
|
|
28
|
+
resourceId: node.attrs.resourceId,
|
|
29
|
+
localId: uuid.generate()
|
|
30
|
+
};
|
|
31
|
+
var newMarks = schema.nodes.syncBlock.markSet ? node.marks.filter(function (mark) {
|
|
32
|
+
var _schema$nodes$syncBlo;
|
|
33
|
+
return (_schema$nodes$syncBlo = schema.nodes.syncBlock.markSet) === null || _schema$nodes$syncBlo === void 0 ? void 0 : _schema$nodes$syncBlo.includes(mark.type);
|
|
34
|
+
}) : node.marks; // schema.nodes.syncBlock.markSet is null meaning all marks are allowed
|
|
35
|
+
|
|
36
|
+
return schema.nodes.syncBlock.create(newAttrs, null, newMarks);
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* If we are copying from editor, transform the copied source or reference sync block to a new reference sync block
|
|
41
|
+
* Otherwise, (e.g. if copying from renderer), flatten out the content and remove the sync block
|
|
42
|
+
*/
|
|
43
|
+
export var transformSyncBlock = function transformSyncBlock(slice, schema, pasteSource) {
|
|
44
|
+
var isFromEditor = pasteSource === 'fabric-editor';
|
|
8
45
|
slice = mapSlice(slice, function (node) {
|
|
9
|
-
// sync blocks need a unique localId to function correctly
|
|
10
46
|
if (node.type === schema.nodes.syncBlock) {
|
|
11
|
-
|
|
12
|
-
localId: uuid.generate()
|
|
13
|
-
});
|
|
14
|
-
return schema.nodes.syncBlock.create(newAttrs, null, _toConsumableArray(node.marks));
|
|
47
|
+
return transformSyncBlockNode(node, schema, isFromEditor);
|
|
15
48
|
} else if (node.type === schema.nodes.bodiedSyncBlock) {
|
|
16
|
-
|
|
17
|
-
// when converting we want to be specific about attributes and marks we carry over
|
|
18
|
-
var _newAttrs = {
|
|
19
|
-
resourceId: node.attrs.resourceId,
|
|
20
|
-
localId: uuid.generate()
|
|
21
|
-
};
|
|
22
|
-
var newMarks = schema.nodes.syncBlock.markSet ? node.marks.filter(function (mark) {
|
|
23
|
-
var _schema$nodes$syncBlo;
|
|
24
|
-
return (_schema$nodes$syncBlo = schema.nodes.syncBlock.markSet) === null || _schema$nodes$syncBlo === void 0 ? void 0 : _schema$nodes$syncBlo.includes(mark.type);
|
|
25
|
-
}) : node.marks; // schema.nodes.syncBlock.markSet is null meaning all marks are allowed
|
|
26
|
-
|
|
27
|
-
return schema.nodes.syncBlock.create(_newAttrs, null, newMarks);
|
|
49
|
+
return transformBodiedSyncBlockNode(node, schema, isFromEditor);
|
|
28
50
|
}
|
|
29
51
|
return node;
|
|
30
52
|
});
|
|
@@ -21,7 +21,7 @@ import withAnalyticsEvents from '@atlaskit/analytics-next/withAnalyticsEvents';
|
|
|
21
21
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
22
22
|
import Layer from '../Layer';
|
|
23
23
|
var packageName = "@atlaskit/editor-common";
|
|
24
|
-
var packageVersion = "110.
|
|
24
|
+
var packageVersion = "110.32.0";
|
|
25
25
|
var halfFocusRing = 1;
|
|
26
26
|
var dropOffset = '0, 8';
|
|
27
27
|
var fadeIn = keyframes({
|
|
@@ -12,6 +12,7 @@ import React from 'react';
|
|
|
12
12
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
13
13
|
import { css, jsx } from '@emotion/react';
|
|
14
14
|
import { akEditorDefaultLayoutWidth, akEditorFullPageMaxWidth, akEditorFullWidthLayoutWidth } from '@atlaskit/editor-shared-styles';
|
|
15
|
+
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
15
16
|
import { nonWrappedLayouts } from '../../utils';
|
|
16
17
|
import { calcBreakoutWidth, calcWideWidth } from '../../utils/breakout';
|
|
17
18
|
function float(layout) {
|
|
@@ -144,6 +145,16 @@ function calcMargin(layout) {
|
|
|
144
145
|
return '24px auto';
|
|
145
146
|
}
|
|
146
147
|
}
|
|
148
|
+
function calcMaxCssForPercentageTypeMedia(layout) {
|
|
149
|
+
switch (layout) {
|
|
150
|
+
case 'wide':
|
|
151
|
+
return "min(var(--ak-editor--breakout-wide-layout-width), var(--ak-editor-max-container-width))";
|
|
152
|
+
case 'full-width':
|
|
153
|
+
return "min(var(--ak-editor--full-width-layout-width), var(--ak-editor-max-container-width))";
|
|
154
|
+
default:
|
|
155
|
+
return 'var(--ak-editor-max-container-width)';
|
|
156
|
+
}
|
|
157
|
+
}
|
|
147
158
|
function isImageAligned(layout) {
|
|
148
159
|
switch (layout) {
|
|
149
160
|
case 'align-end':
|
|
@@ -209,10 +220,11 @@ export var MediaSingleDimensionHelper = function MediaSingleDimensionHelper(_ref
|
|
|
209
220
|
isInRenderer = _ref$isInRenderer === void 0 ? false : _ref$isInRenderer;
|
|
210
221
|
var calculatedWidth = roundToClosestEvenPxValue(isExtendedResizeExperienceOn ? "".concat(mediaSingleWidth || width, "px") : mediaSingleWidth ? calcResizedWidth(layout, width || 0, containerWidth) : calcLegacyWidth(layout, width || 0, containerWidth, fullWidthMode, isResized, isInsideOfInlineExtension));
|
|
211
222
|
var calculatedMaxWidth = roundToClosestEvenPxValue(isExtendedResizeExperienceOn ? "".concat(containerWidth, "px") : calcMaxWidth(layout, containerWidth));
|
|
223
|
+
var cssMaxWidth = isExtendedResizeExperienceOn ? 'var(--ak-editor-max-container-width)' : calcMaxCssForPercentageTypeMedia(layout);
|
|
212
224
|
|
|
213
225
|
// jest warning: JSDOM version (22) doesn't support the new @container CSS rule
|
|
214
226
|
// eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression -- Needs manual remediation
|
|
215
|
-
return css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n\t\t/* For nested rich media items, set max-width to 100% */\n\t\ttr &,\n\t\t[data-layout-column] &,\n\t\t[data-node-type='expand'] &,\n\t\t[data-panel-type] &,\n\t\tli & {\n\t\t\tmax-width: 100%;\n\t\t}\n\n\t\twidth: ", ";\n\t\t", "\n\n\t\t", "\n\
|
|
227
|
+
return css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n\t\t/* For nested rich media items, set max-width to 100% */\n\t\ttr &,\n\t\t[data-layout-column] &,\n\t\t[data-node-type='expand'] &,\n\t\t[data-panel-type] &,\n\t\tli & {\n\t\t\tmax-width: 100%;\n\t\t}\n\n\t\twidth: ", ";\n\t\t", "\n\n\t\t", "\n\n\t\t", "\n\n\t\t&:not(.is-resizing) {\n\t\t\ttransition: width 100ms ease-in;\n\t\t}\n\n\t\tfloat: ", ";\n\t\tmargin: ", ";\n\n\t\t&[class*='not-resizing'] {\n\t\t\t", "\n\t\t}\n\n\t\t", ";\n\t"])), calculatedWidth, layout === 'full-width' &&
|
|
216
228
|
/* This causes issues for new experience where we don't strip layout attributes
|
|
217
229
|
when copying top-level node and pasting into a table/layout,
|
|
218
230
|
because full-width layout will remain, causing node to be edge-to-edge */
|
|
@@ -223,7 +235,7 @@ export var MediaSingleDimensionHelper = function MediaSingleDimensionHelper(_ref
|
|
|
223
235
|
'@container ak-renderer-wrapper (min-width: 1px)': {
|
|
224
236
|
maxWidth: '100cqw'
|
|
225
237
|
}
|
|
226
|
-
}) : "max-width: ".concat(calculatedMaxWidth, ";"), isExtendedResizeExperienceOn && "&[class*='is-resizing'] {\n .new-file-experience-wrapper {\n box-shadow: none !important;\n }\n\n ".concat(!isNestedNode && nonWrappedLayouts.includes(layout) && "margin-left: 50%;\n transform: translateX(-50%);", "\n }"), float(layout), calcMargin(layout), isNestedNode ? /* Make nested node appear responsive when resizing table cell */"max-width: 100%;" : nonWrappedLayouts.includes(layout) && "margin-left: 50%;\n transform: translateX(-50%);", isImageAligned(layout));
|
|
238
|
+
}) : expValEquals('platform_editor_media_vc_fixes', 'isEnabled', true) ? "max-width: ".concat(cssMaxWidth, ";") : "max-width: ".concat(calculatedMaxWidth, ";"), isExtendedResizeExperienceOn && "&[class*='is-resizing'] {\n .new-file-experience-wrapper {\n box-shadow: none !important;\n }\n\n ".concat(!isNestedNode && nonWrappedLayouts.includes(layout) && "margin-left: 50%;\n transform: translateX(-50%);", "\n }"), float(layout), calcMargin(layout), isNestedNode ? /* Make nested node appear responsive when resizing table cell */"max-width: 100%;" : nonWrappedLayouts.includes(layout) && "margin-left: 50%;\n transform: translateX(-50%);", isImageAligned(layout));
|
|
227
239
|
};
|
|
228
240
|
var RenderFallbackContainer = function RenderFallbackContainer(_ref2) {
|
|
229
241
|
var hasFallbackContainer = _ref2.hasFallbackContainer,
|
|
@@ -6,7 +6,7 @@ import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstruct
|
|
|
6
6
|
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
7
7
|
import _inherits from "@babel/runtime/helpers/inherits";
|
|
8
8
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
9
|
-
var _excluded = ["handleClickOutside", "handleEnterKeydown", "handleEscapeKeydown", "closeOnTab", "captureClick"];
|
|
9
|
+
var _excluded = ["handleClickOutside", "handleEnterKeydown", "handleEscapeKeydown", "handleBackspaceDeleteKeydown", "closeOnTab", "captureClick"];
|
|
10
10
|
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
11
11
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
12
12
|
import React, { PureComponent, useCallback, useEffect, useRef, useState } from 'react';
|
|
@@ -60,6 +60,8 @@ var WithOutsideClick = /*#__PURE__*/function (_PureComponent) {
|
|
|
60
60
|
} else if (evt.code === 'Tab' && _this.props.handleEscapeKeydown && _this.props.closeOnTab) {
|
|
61
61
|
// The menus should be closed when the tab is pressed as it takes the focus out of the menu
|
|
62
62
|
_this.props.handleEscapeKeydown(evt);
|
|
63
|
+
} else if ((evt.code === 'Delete' || evt.code === 'Backspace') && _this.props.handleBackspaceDeleteKeydown) {
|
|
64
|
+
_this.props.handleBackspaceDeleteKeydown(evt);
|
|
63
65
|
}
|
|
64
66
|
});
|
|
65
67
|
return _this;
|
|
@@ -76,7 +78,7 @@ var WithOutsideClick = /*#__PURE__*/function (_PureComponent) {
|
|
|
76
78
|
// eslint-disable-next-line @repo/internal/dom-events/no-unsafe-event-listeners
|
|
77
79
|
document.addEventListener('click', this.handleClick, options);
|
|
78
80
|
}
|
|
79
|
-
if (this.props.handleEscapeKeydown) {
|
|
81
|
+
if (this.props.handleEscapeKeydown || this.props.handleBackspaceDeleteKeydown) {
|
|
80
82
|
var _this$props$editorRef;
|
|
81
83
|
// Attached event to the menu so that 'ESC' events from the opened menu also will be handled.
|
|
82
84
|
// Ignored via go/ees005
|
|
@@ -101,7 +103,7 @@ var WithOutsideClick = /*#__PURE__*/function (_PureComponent) {
|
|
|
101
103
|
// eslint-disable-next-line @repo/internal/dom-events/no-unsafe-event-listeners
|
|
102
104
|
document.removeEventListener('click', this.handleClick, options);
|
|
103
105
|
}
|
|
104
|
-
if (this.props.handleEscapeKeydown) {
|
|
106
|
+
if (this.props.handleEscapeKeydown || this.props.handleBackspaceDeleteKeydown) {
|
|
105
107
|
var _this$props$editorRef2;
|
|
106
108
|
// Ignored via go/ees005
|
|
107
109
|
// eslint-disable-next-line @repo/internal/dom-events/no-unsafe-event-listeners
|
|
@@ -131,6 +133,7 @@ export default function withReactEditorViewOuterListeners(Component) {
|
|
|
131
133
|
var handleClickOutside = _ref.handleClickOutside,
|
|
132
134
|
handleEnterKeydown = _ref.handleEnterKeydown,
|
|
133
135
|
handleEscapeKeydown = _ref.handleEscapeKeydown,
|
|
136
|
+
handleBackspaceDeleteKeydown = _ref.handleBackspaceDeleteKeydown,
|
|
134
137
|
closeOnTab = _ref.closeOnTab,
|
|
135
138
|
captureClick = _ref.captureClick,
|
|
136
139
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
@@ -164,6 +167,7 @@ export default function withReactEditorViewOuterListeners(Component) {
|
|
|
164
167
|
handleClickOutside: handleClickOutside,
|
|
165
168
|
handleEnterKeydown: handleEnterKeydown,
|
|
166
169
|
handleEscapeKeydown: handleEscapeKeydown,
|
|
170
|
+
handleBackspaceDeleteKeydown: handleBackspaceDeleteKeydown,
|
|
167
171
|
closeOnTab: closeOnTab,
|
|
168
172
|
captureClick: captureClick
|
|
169
173
|
}, /*#__PURE__*/React.createElement(Component
|
|
@@ -11,7 +11,7 @@ export { isIgnored } from './gap-cursor/utils/is-ignored';
|
|
|
11
11
|
export { isValidTargetNode } from './gap-cursor/utils/is-valid-target-node';
|
|
12
12
|
export { setGapCursorSelection } from './gap-cursor/utils/setGapCursorSelection';
|
|
13
13
|
export { hideCaretModifier, gapCursorStyles } from './gap-cursor/styles';
|
|
14
|
-
export { atTheBeginningOfBlock, atTheBeginningOfDoc, atTheEndOfBlock, atTheEndOfDoc, endPositionOfParent, expandSelectionBounds, isSelectionAtEndOfNode, isSelectionAtStartOfNode, startPositionOfParent, } from './utils';
|
|
14
|
+
export { atTheBeginningOfBlock, atTheBeginningOfDoc, atTheEndOfBlock, atTheEndOfDoc, deleteSelectedRange, endPositionOfParent, expandSelectionBounds, isSelectionAtEndOfNode, isSelectionAtStartOfNode, startPositionOfParent, } from './utils';
|
|
15
15
|
export declare function getNodeSelectionAnalyticsPayload(selection: Selection): AnalyticsEventPayload | undefined;
|
|
16
16
|
export declare function getAllSelectionAnalyticsPayload(selection: Selection): AnalyticsEventPayload | undefined;
|
|
17
17
|
export declare function getCellSelectionAnalyticsPayload(state: EditorState): AnalyticsEventPayload | undefined;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ResolvedPos, Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
2
|
-
import type { EditorState } from '@atlaskit/editor-prosemirror/state';
|
|
2
|
+
import type { EditorState, Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
3
3
|
export declare const isSelectionAtStartOfNode: ($pos: ResolvedPos, parentNode?: PMNode) => boolean;
|
|
4
4
|
export declare const isSelectionAtEndOfNode: ($pos: ResolvedPos, parentNode?: PMNode) => boolean;
|
|
5
5
|
export declare function atTheEndOfDoc(state: EditorState): boolean;
|
|
@@ -18,3 +18,9 @@ export declare const expandSelectionBounds: ($anchor: ResolvedPos, $head: Resolv
|
|
|
18
18
|
$anchor: ResolvedPos;
|
|
19
19
|
$head: ResolvedPos;
|
|
20
20
|
};
|
|
21
|
+
/**
|
|
22
|
+
* Delete what is selected in the given transaction.
|
|
23
|
+
* @param tr the transaction to delete the selection from
|
|
24
|
+
* @returns the updated transaction
|
|
25
|
+
*/
|
|
26
|
+
export declare const deleteSelectedRange: (tr: Transaction) => Transaction;
|
|
@@ -5,5 +5,5 @@ export { transformSliceToJoinAdjacentCodeBlocks, transformSingleLineCodeBlockToC
|
|
|
5
5
|
export { transformSliceToDecisionList } from './decision-list';
|
|
6
6
|
export { transformListStructure, transformBetweenListTypes, transformListRecursively, transformToTaskList, transformTaskListToBlockNodes, getFormattedNode, } from './list-transforms';
|
|
7
7
|
export { isBulletOrOrderedList, isTaskList, getSupportedListTypesSet, convertBlockToInlineContent, } from './list-utils';
|
|
8
|
-
export {
|
|
8
|
+
export { transformSyncBlock } from './sync-block';
|
|
9
9
|
export type { TransformContext, TransformFunction } from './list-types';
|
|
@@ -1,2 +1,7 @@
|
|
|
1
1
|
import type { Schema, Slice } from '@atlaskit/editor-prosemirror/model';
|
|
2
|
-
|
|
2
|
+
import type { PasteSource } from '../analytics';
|
|
3
|
+
/**
|
|
4
|
+
* If we are copying from editor, transform the copied source or reference sync block to a new reference sync block
|
|
5
|
+
* Otherwise, (e.g. if copying from renderer), flatten out the content and remove the sync block
|
|
6
|
+
*/
|
|
7
|
+
export declare const transformSyncBlock: (slice: Slice, schema: Schema, pasteSource: PasteSource) => Slice;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export type BreakoutMode = 'wide' | 'full-width' | 'center';
|
|
1
|
+
export type BreakoutMode = 'wide' | 'full-width' | 'max' | 'center';
|
|
@@ -60,6 +60,7 @@ export interface MediaSingleWrapperProps {
|
|
|
60
60
|
fullWidthMode?: boolean;
|
|
61
61
|
innerRef?: ((elem: HTMLDivElement) => void) | RefObject<HTMLDivElement>;
|
|
62
62
|
isExtendedResizeExperienceOn?: boolean;
|
|
63
|
+
isInRenderer?: boolean;
|
|
63
64
|
isInsideOfInlineExtension?: boolean;
|
|
64
65
|
isNestedNode?: boolean;
|
|
65
66
|
isResized?: boolean;
|
|
@@ -72,7 +73,6 @@ export interface MediaSingleWrapperProps {
|
|
|
72
73
|
*/
|
|
73
74
|
pctWidth?: number;
|
|
74
75
|
width?: number;
|
|
75
|
-
isInRenderer?: boolean;
|
|
76
76
|
}
|
|
77
77
|
/**
|
|
78
78
|
* Can't use `.attrs` to handle highly dynamic styles because we are still
|
|
@@ -9,6 +9,7 @@ export interface WithOutsideClickProps {
|
|
|
9
9
|
*/
|
|
10
10
|
captureClick?: boolean;
|
|
11
11
|
closeOnTab?: boolean;
|
|
12
|
+
handleBackspaceDeleteKeydown?: SimpleEventHandler<KeyboardEvent>;
|
|
12
13
|
handleClickOutside?: SimpleEventHandler<MouseEvent>;
|
|
13
14
|
handleEnterKeydown?: SimpleEventHandler<KeyboardEvent>;
|
|
14
15
|
handleEscapeKeydown?: SimpleEventHandler<KeyboardEvent>;
|
|
@@ -59,7 +59,7 @@ export declare function calculateBreakoutStyles({ mode, widthStateLineLength, wi
|
|
|
59
59
|
justifyContent?: undefined;
|
|
60
60
|
};
|
|
61
61
|
export declare function calcBreakoutWidthPx(mode: BreakoutMarkAttrs['mode'], widthStateWidth?: number, padding?: number): number;
|
|
62
|
-
export declare const getNextBreakoutMode: (currentMode?: BreakoutMode) => BreakoutMode
|
|
62
|
+
export declare const getNextBreakoutMode: (currentMode?: BreakoutMode) => Exclude<BreakoutMode, "max">;
|
|
63
63
|
export declare const getTitle: (layout?: BreakoutMode) => {
|
|
64
64
|
id: string;
|
|
65
65
|
defaultMessage: string;
|
|
@@ -11,7 +11,7 @@ export { isIgnored } from './gap-cursor/utils/is-ignored';
|
|
|
11
11
|
export { isValidTargetNode } from './gap-cursor/utils/is-valid-target-node';
|
|
12
12
|
export { setGapCursorSelection } from './gap-cursor/utils/setGapCursorSelection';
|
|
13
13
|
export { hideCaretModifier, gapCursorStyles } from './gap-cursor/styles';
|
|
14
|
-
export { atTheBeginningOfBlock, atTheBeginningOfDoc, atTheEndOfBlock, atTheEndOfDoc, endPositionOfParent, expandSelectionBounds, isSelectionAtEndOfNode, isSelectionAtStartOfNode, startPositionOfParent, } from './utils';
|
|
14
|
+
export { atTheBeginningOfBlock, atTheBeginningOfDoc, atTheEndOfBlock, atTheEndOfDoc, deleteSelectedRange, endPositionOfParent, expandSelectionBounds, isSelectionAtEndOfNode, isSelectionAtStartOfNode, startPositionOfParent, } from './utils';
|
|
15
15
|
export declare function getNodeSelectionAnalyticsPayload(selection: Selection): AnalyticsEventPayload | undefined;
|
|
16
16
|
export declare function getAllSelectionAnalyticsPayload(selection: Selection): AnalyticsEventPayload | undefined;
|
|
17
17
|
export declare function getCellSelectionAnalyticsPayload(state: EditorState): AnalyticsEventPayload | undefined;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ResolvedPos, Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
2
|
-
import type { EditorState } from '@atlaskit/editor-prosemirror/state';
|
|
2
|
+
import type { EditorState, Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
3
3
|
export declare const isSelectionAtStartOfNode: ($pos: ResolvedPos, parentNode?: PMNode) => boolean;
|
|
4
4
|
export declare const isSelectionAtEndOfNode: ($pos: ResolvedPos, parentNode?: PMNode) => boolean;
|
|
5
5
|
export declare function atTheEndOfDoc(state: EditorState): boolean;
|
|
@@ -18,3 +18,9 @@ export declare const expandSelectionBounds: ($anchor: ResolvedPos, $head: Resolv
|
|
|
18
18
|
$anchor: ResolvedPos;
|
|
19
19
|
$head: ResolvedPos;
|
|
20
20
|
};
|
|
21
|
+
/**
|
|
22
|
+
* Delete what is selected in the given transaction.
|
|
23
|
+
* @param tr the transaction to delete the selection from
|
|
24
|
+
* @returns the updated transaction
|
|
25
|
+
*/
|
|
26
|
+
export declare const deleteSelectedRange: (tr: Transaction) => Transaction;
|
|
@@ -5,5 +5,5 @@ export { transformSliceToJoinAdjacentCodeBlocks, transformSingleLineCodeBlockToC
|
|
|
5
5
|
export { transformSliceToDecisionList } from './decision-list';
|
|
6
6
|
export { transformListStructure, transformBetweenListTypes, transformListRecursively, transformToTaskList, transformTaskListToBlockNodes, getFormattedNode, } from './list-transforms';
|
|
7
7
|
export { isBulletOrOrderedList, isTaskList, getSupportedListTypesSet, convertBlockToInlineContent, } from './list-utils';
|
|
8
|
-
export {
|
|
8
|
+
export { transformSyncBlock } from './sync-block';
|
|
9
9
|
export type { TransformContext, TransformFunction } from './list-types';
|
|
@@ -1,2 +1,7 @@
|
|
|
1
1
|
import type { Schema, Slice } from '@atlaskit/editor-prosemirror/model';
|
|
2
|
-
|
|
2
|
+
import type { PasteSource } from '../analytics';
|
|
3
|
+
/**
|
|
4
|
+
* If we are copying from editor, transform the copied source or reference sync block to a new reference sync block
|
|
5
|
+
* Otherwise, (e.g. if copying from renderer), flatten out the content and remove the sync block
|
|
6
|
+
*/
|
|
7
|
+
export declare const transformSyncBlock: (slice: Slice, schema: Schema, pasteSource: PasteSource) => Slice;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export type BreakoutMode = 'wide' | 'full-width' | 'center';
|
|
1
|
+
export type BreakoutMode = 'wide' | 'full-width' | 'max' | 'center';
|
|
@@ -60,6 +60,7 @@ export interface MediaSingleWrapperProps {
|
|
|
60
60
|
fullWidthMode?: boolean;
|
|
61
61
|
innerRef?: ((elem: HTMLDivElement) => void) | RefObject<HTMLDivElement>;
|
|
62
62
|
isExtendedResizeExperienceOn?: boolean;
|
|
63
|
+
isInRenderer?: boolean;
|
|
63
64
|
isInsideOfInlineExtension?: boolean;
|
|
64
65
|
isNestedNode?: boolean;
|
|
65
66
|
isResized?: boolean;
|
|
@@ -72,7 +73,6 @@ export interface MediaSingleWrapperProps {
|
|
|
72
73
|
*/
|
|
73
74
|
pctWidth?: number;
|
|
74
75
|
width?: number;
|
|
75
|
-
isInRenderer?: boolean;
|
|
76
76
|
}
|
|
77
77
|
/**
|
|
78
78
|
* Can't use `.attrs` to handle highly dynamic styles because we are still
|
|
@@ -9,6 +9,7 @@ export interface WithOutsideClickProps {
|
|
|
9
9
|
*/
|
|
10
10
|
captureClick?: boolean;
|
|
11
11
|
closeOnTab?: boolean;
|
|
12
|
+
handleBackspaceDeleteKeydown?: SimpleEventHandler<KeyboardEvent>;
|
|
12
13
|
handleClickOutside?: SimpleEventHandler<MouseEvent>;
|
|
13
14
|
handleEnterKeydown?: SimpleEventHandler<KeyboardEvent>;
|
|
14
15
|
handleEscapeKeydown?: SimpleEventHandler<KeyboardEvent>;
|
|
@@ -59,7 +59,7 @@ export declare function calculateBreakoutStyles({ mode, widthStateLineLength, wi
|
|
|
59
59
|
justifyContent?: undefined;
|
|
60
60
|
};
|
|
61
61
|
export declare function calcBreakoutWidthPx(mode: BreakoutMarkAttrs['mode'], widthStateWidth?: number, padding?: number): number;
|
|
62
|
-
export declare const getNextBreakoutMode: (currentMode?: BreakoutMode) => BreakoutMode
|
|
62
|
+
export declare const getNextBreakoutMode: (currentMode?: BreakoutMode) => Exclude<BreakoutMode, "max">;
|
|
63
63
|
export declare const getTitle: (layout?: BreakoutMode) => {
|
|
64
64
|
id: string;
|
|
65
65
|
defaultMessage: string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-common",
|
|
3
|
-
"version": "110.
|
|
3
|
+
"version": "110.32.1",
|
|
4
4
|
"description": "A package that contains common classes and components for editor and renderer",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
32
|
"@atlaskit/activity-provider": "^2.5.0",
|
|
33
|
-
"@atlaskit/adf-schema": "^51.
|
|
33
|
+
"@atlaskit/adf-schema": "^51.4.0",
|
|
34
34
|
"@atlaskit/adf-utils": "^19.26.0",
|
|
35
35
|
"@atlaskit/afm-i18n-platform-editor-editor-common": "2.10.0",
|
|
36
36
|
"@atlaskit/analytics-listeners": "^9.1.0",
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
"@atlaskit/editor-json-transformer": "^8.31.0",
|
|
47
47
|
"@atlaskit/editor-palette": "^2.1.0",
|
|
48
48
|
"@atlaskit/editor-prosemirror": "7.0.0",
|
|
49
|
-
"@atlaskit/editor-shared-styles": "^3.
|
|
49
|
+
"@atlaskit/editor-shared-styles": "^3.10.0",
|
|
50
50
|
"@atlaskit/editor-tables": "^2.9.0",
|
|
51
51
|
"@atlaskit/editor-toolbar": "^0.17.0",
|
|
52
52
|
"@atlaskit/editor-toolbar-model": "^0.2.0",
|
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
"@atlaskit/link": "^3.2.0",
|
|
57
57
|
"@atlaskit/link-datasource": "^4.30.0",
|
|
58
58
|
"@atlaskit/link-picker": "^3.16.0",
|
|
59
|
-
"@atlaskit/media-card": "^79.
|
|
59
|
+
"@atlaskit/media-card": "^79.8.0",
|
|
60
60
|
"@atlaskit/media-client": "^35.6.0",
|
|
61
61
|
"@atlaskit/media-client-react": "^4.1.0",
|
|
62
62
|
"@atlaskit/media-common": "^12.3.0",
|
|
@@ -73,7 +73,7 @@
|
|
|
73
73
|
"@atlaskit/primitives": "^16.1.0",
|
|
74
74
|
"@atlaskit/profilecard": "^24.21.0",
|
|
75
75
|
"@atlaskit/prosemirror-history": "^0.2.0",
|
|
76
|
-
"@atlaskit/react-ufo": "^4.
|
|
76
|
+
"@atlaskit/react-ufo": "^4.15.0",
|
|
77
77
|
"@atlaskit/section-message": "^8.9.0",
|
|
78
78
|
"@atlaskit/smart-card": "^43.7.0",
|
|
79
79
|
"@atlaskit/smart-user-picker": "^8.4.0",
|
|
@@ -84,7 +84,7 @@
|
|
|
84
84
|
"@atlaskit/theme": "^21.0.0",
|
|
85
85
|
"@atlaskit/tmp-editor-statsig": "^13.38.0",
|
|
86
86
|
"@atlaskit/tokens": "^8.0.0",
|
|
87
|
-
"@atlaskit/tooltip": "^20.
|
|
87
|
+
"@atlaskit/tooltip": "^20.9.0",
|
|
88
88
|
"@atlaskit/ufo": "^0.4.0",
|
|
89
89
|
"@atlaskit/width-detector": "^5.0.0",
|
|
90
90
|
"@babel/runtime": "^7.0.0",
|