@atlaskit/editor-common 112.22.0 → 113.0.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 +51 -0
- package/dist/cjs/analytics/types/table-events.js +2 -0
- package/dist/cjs/messages/help-dialog.js +25 -0
- package/dist/cjs/messages/table.js +5 -0
- package/dist/cjs/monitoring/error.js +1 -1
- package/dist/cjs/node-width/index.js +2 -2
- package/dist/cjs/react-node-view/getInlineNodeViewProducer.js +2 -1
- package/dist/cjs/styles/shared/table.js +2 -1
- package/dist/cjs/transforms/index.js +6 -0
- package/dist/cjs/transforms/list-transforms.js +34 -1
- package/dist/cjs/ui/DropList/index.js +1 -1
- package/dist/cjs/utils/browser.js +8 -97
- package/dist/cjs/utils/index.js +0 -7
- package/dist/es2019/analytics/types/table-events.js +2 -0
- package/dist/es2019/messages/help-dialog.js +25 -0
- package/dist/es2019/messages/table.js +5 -0
- package/dist/es2019/monitoring/error.js +1 -1
- package/dist/es2019/node-width/index.js +1 -1
- package/dist/es2019/react-node-view/getInlineNodeViewProducer.js +3 -2
- package/dist/es2019/styles/shared/table.js +2 -1
- package/dist/es2019/transforms/index.js +1 -1
- package/dist/es2019/transforms/list-transforms.js +34 -0
- package/dist/es2019/ui/DropList/index.js +1 -1
- package/dist/es2019/utils/browser.js +0 -89
- package/dist/es2019/utils/index.js +0 -8
- package/dist/esm/analytics/types/table-events.js +2 -0
- package/dist/esm/messages/help-dialog.js +25 -0
- package/dist/esm/messages/table.js +5 -0
- package/dist/esm/monitoring/error.js +1 -1
- package/dist/esm/node-width/index.js +1 -1
- package/dist/esm/react-node-view/getInlineNodeViewProducer.js +3 -2
- package/dist/esm/styles/shared/table.js +2 -1
- package/dist/esm/transforms/index.js +1 -1
- package/dist/esm/transforms/list-transforms.js +33 -0
- package/dist/esm/ui/DropList/index.js +1 -1
- package/dist/esm/utils/browser.js +7 -96
- package/dist/esm/utils/index.js +0 -8
- package/dist/types/analytics/types/table-events.d.ts +17 -2
- package/dist/types/messages/help-dialog.d.ts +25 -0
- package/dist/types/messages/table.d.ts +152 -147
- package/dist/types/node-width/index.d.ts +1 -0
- package/dist/types/styles/shared/table.d.ts +1 -0
- package/dist/types/transforms/index.d.ts +1 -1
- package/dist/types/transforms/list-transforms.d.ts +9 -1
- package/dist/types/utils/browser.d.ts +0 -10
- package/dist/types/utils/index.d.ts +0 -8
- package/dist/types-ts4.5/analytics/types/table-events.d.ts +17 -2
- package/dist/types-ts4.5/messages/help-dialog.d.ts +25 -0
- package/dist/types-ts4.5/messages/table.d.ts +152 -147
- package/dist/types-ts4.5/node-width/index.d.ts +1 -0
- package/dist/types-ts4.5/styles/shared/table.d.ts +1 -0
- package/dist/types-ts4.5/transforms/index.d.ts +1 -1
- package/dist/types-ts4.5/transforms/list-transforms.d.ts +9 -1
- package/dist/types-ts4.5/utils/browser.d.ts +0 -10
- package/dist/types-ts4.5/utils/index.d.ts +0 -8
- package/package.json +11 -11
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,56 @@
|
|
|
1
1
|
# @atlaskit/editor-common
|
|
2
2
|
|
|
3
|
+
## 113.0.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`bae5d569f660c`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/bae5d569f660c) -
|
|
8
|
+
Prevent flexible list creation when platform_editor_flexible_list_schema is on but
|
|
9
|
+
platform_editor_flexible_list_indentation is off. Slice normalisation in paste pipeline.
|
|
10
|
+
appendTransaction normaliser in list plugin.
|
|
11
|
+
|
|
12
|
+
Paste plugin detects list-into-list paste and sets a transaction meta to skip closeHistory,
|
|
13
|
+
keeping the paste and normalisation appendTransaction as a single undo step.
|
|
14
|
+
|
|
15
|
+
## 113.0.0
|
|
16
|
+
|
|
17
|
+
### Major Changes
|
|
18
|
+
|
|
19
|
+
- [`b10c935ca9497`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/b10c935ca9497) -
|
|
20
|
+
Removed deprecated `browser` singleton from editor-common. This has been replaced with a
|
|
21
|
+
`getBrowserInfo` function that returns the same information. This change was made to avoid issues
|
|
22
|
+
with module loading order and to provide a more consistent API for accessing browser information.
|
|
23
|
+
|
|
24
|
+
Please update any imports of `browser` to use `getBrowserInfo` instead. For example, the following
|
|
25
|
+
imports have been removed:
|
|
26
|
+
|
|
27
|
+
```javascript
|
|
28
|
+
import { browser } from '@atlaskit/editor-common/utils';
|
|
29
|
+
import { browser } from '@atlaskit/editor-common/browser';
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
Instead, please use:
|
|
33
|
+
|
|
34
|
+
```javascript
|
|
35
|
+
import { getBrowserInfo } from '@atlaskit/editor-common/browser';
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
If you were previously using `browser.ie_version`, you would now use
|
|
39
|
+
`getBrowserInfo().ie_version`.
|
|
40
|
+
|
|
41
|
+
### Minor Changes
|
|
42
|
+
|
|
43
|
+
- [`307fd7ae4cf53`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/307fd7ae4cf53) -
|
|
44
|
+
Export getNestedParentNode from editor-common/node-width and sync data-native-embed-nested
|
|
45
|
+
attribute on embed DOM elements after drag-and-drop to ensure correct nested styling
|
|
46
|
+
|
|
47
|
+
### Patch Changes
|
|
48
|
+
|
|
49
|
+
- [`d15da1c489b34`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/d15da1c489b34) -
|
|
50
|
+
Add drag handle and move selection keyboard shortcuts to the editor help dialog, gated behind the
|
|
51
|
+
platform_editor_drag_handle_keyboard_a11y experiment
|
|
52
|
+
- Updated dependencies
|
|
53
|
+
|
|
3
54
|
## 112.22.0
|
|
4
55
|
|
|
5
56
|
### Minor Changes
|
|
@@ -49,6 +49,8 @@ var TABLE_ACTION = exports.TABLE_ACTION = /*#__PURE__*/function (TABLE_ACTION) {
|
|
|
49
49
|
TABLE_ACTION["TABLE_EDITOR_HEIGHT_INFO"] = "tableEditorHeightInformation";
|
|
50
50
|
TABLE_ACTION["TABLE_RENDERER_HEIGHT_INFO"] = "tableRendererHeightInformation";
|
|
51
51
|
TABLE_ACTION["STICKY_HEADER_METHOD_TOGGLED"] = "stickyHeaderMethodToggled";
|
|
52
|
+
TABLE_ACTION["FIT_TO_CONTENT_AUTO_CONVERTED"] = "fitToContentAutoConverted";
|
|
53
|
+
TABLE_ACTION["FIT_TO_CONTENT_ON_DEMAND"] = "fitToContentOnDemand";
|
|
52
54
|
return TABLE_ACTION;
|
|
53
55
|
}({});
|
|
54
56
|
var TABLE_BREAKOUT = exports.TABLE_BREAKOUT = /*#__PURE__*/function (TABLE_BREAKOUT) {
|
|
@@ -96,6 +96,31 @@ var helpDialogMessages = exports.helpDialogMessages = (0, _reactIntlNext.defineM
|
|
|
96
96
|
defaultMessage: 'Focus table resize handle',
|
|
97
97
|
description: 'The text is shown as a label for a keyboard shortcut in the editor help dialog that describes how to move focus to the table resize handle for resizing columns.'
|
|
98
98
|
},
|
|
99
|
+
selectDragHandle: {
|
|
100
|
+
id: 'fabric.editor.selectDragHandle',
|
|
101
|
+
defaultMessage: 'Select drag handle',
|
|
102
|
+
description: 'The text is shown as a label for a keyboard shortcut in the editor help dialog that describes how to select and focus the drag handle on the current block.'
|
|
103
|
+
},
|
|
104
|
+
moveSelectionUp: {
|
|
105
|
+
id: 'fabric.editor.moveSelectionUp',
|
|
106
|
+
defaultMessage: 'Move selection up',
|
|
107
|
+
description: 'The text is shown as a label for a keyboard shortcut in the editor help dialog that describes how to move the selected block up in the document.'
|
|
108
|
+
},
|
|
109
|
+
moveSelectionDown: {
|
|
110
|
+
id: 'fabric.editor.moveSelectionDown',
|
|
111
|
+
defaultMessage: 'Move selection down',
|
|
112
|
+
description: 'The text is shown as a label for a keyboard shortcut in the editor help dialog that describes how to move the selected block down in the document.'
|
|
113
|
+
},
|
|
114
|
+
moveSelectionLeft: {
|
|
115
|
+
id: 'fabric.editor.moveSelectionLeft',
|
|
116
|
+
defaultMessage: 'Move selection left',
|
|
117
|
+
description: 'The text is shown as a label for a keyboard shortcut in the editor help dialog that describes how to move the selected block to the left layout column.'
|
|
118
|
+
},
|
|
119
|
+
moveSelectionRight: {
|
|
120
|
+
id: 'fabric.editor.moveSelectionRight',
|
|
121
|
+
defaultMessage: 'Move selection right',
|
|
122
|
+
description: 'The text is shown as a label for a keyboard shortcut in the editor help dialog that describes how to move the selected block to the right layout column.'
|
|
123
|
+
},
|
|
99
124
|
closeHelpDialog: {
|
|
100
125
|
id: 'fabric.editor.closeHelpDialog',
|
|
101
126
|
defaultMessage: 'Close help dialog',
|
|
@@ -301,6 +301,11 @@ var messages = exports.messages = (0, _reactIntlNext.defineMessages)({
|
|
|
301
301
|
defaultMessage: "Distribute columns",
|
|
302
302
|
description: "Distribute widths between selected columns"
|
|
303
303
|
},
|
|
304
|
+
fitToContent: {
|
|
305
|
+
id: 'fabric.editor.fitToContent',
|
|
306
|
+
defaultMessage: "Fit to content",
|
|
307
|
+
description: "Resize table columns to fit their content"
|
|
308
|
+
},
|
|
304
309
|
lockColumnWidths: {
|
|
305
310
|
id: 'fabric.editor.lockColumns',
|
|
306
311
|
defaultMessage: 'Fixed column widths',
|
|
@@ -19,7 +19,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
19
19
|
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); }
|
|
20
20
|
var SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
|
|
21
21
|
var packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
|
|
22
|
-
var packageVersion = "
|
|
22
|
+
var packageVersion = "113.0.0";
|
|
23
23
|
var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
|
|
24
24
|
// Remove URL as it has UGC
|
|
25
25
|
// Ignored via go/ees007
|
|
@@ -4,7 +4,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
|
-
exports.layoutToWidth = exports.getTableWidthWithNumberColumn = exports.getTableContainerWidth = exports.getParentNodeWidth = void 0;
|
|
7
|
+
exports.layoutToWidth = exports.getTableWidthWithNumberColumn = exports.getTableContainerWidth = exports.getParentNodeWidth = exports.getNestedParentNode = void 0;
|
|
8
8
|
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
9
9
|
var _utils = require("@atlaskit/editor-prosemirror/utils");
|
|
10
10
|
var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
|
|
@@ -108,7 +108,7 @@ var getParentNodeWidth = exports.getParentNodeWidth = function getParentNodeWidt
|
|
|
108
108
|
|
|
109
109
|
return parentWidth;
|
|
110
110
|
};
|
|
111
|
-
var getNestedParentNode = function getNestedParentNode(tablePos, state) {
|
|
111
|
+
var getNestedParentNode = exports.getNestedParentNode = function getNestedParentNode(tablePos, state) {
|
|
112
112
|
if (tablePos === undefined) {
|
|
113
113
|
return null;
|
|
114
114
|
}
|
|
@@ -15,6 +15,7 @@ var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
|
15
15
|
var _analytics = require("../analytics");
|
|
16
16
|
var _ErrorBoundary = require("../ui/ErrorBoundary");
|
|
17
17
|
var _utils = require("../utils");
|
|
18
|
+
var _browser = require("../utils/browser");
|
|
18
19
|
var _whitespace = require("../whitespace");
|
|
19
20
|
var _generateUniqueNodeKey = require("./generateUniqueNodeKey");
|
|
20
21
|
var _onVisibleObserverFactory = require("./onVisibleObserverFactory");
|
|
@@ -357,7 +358,7 @@ function getPortalChildren(_ref3) {
|
|
|
357
358
|
getPos: nodeViewParams.getPos,
|
|
358
359
|
node: currentNode
|
|
359
360
|
// eslint-disable-next-line react/jsx-props-no-spreading -- Spreading props to pass through dynamic component props
|
|
360
|
-
}, extraComponentProps)),
|
|
361
|
+
}, extraComponentProps)), (0, _browser.getBrowserInfo)().android ?
|
|
361
362
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
362
363
|
(0, _react2.jsx)("span", {
|
|
363
364
|
className: "zeroWidthSpaceContainer",
|
|
@@ -54,7 +54,8 @@ var TableSharedCssClassName = exports.TableSharedCssClassName = {
|
|
|
54
54
|
TABLE_HEADER_CELL_WRAPPER: _adfSchema.tableHeaderSelector,
|
|
55
55
|
TABLE_ROW_CONTROLS_WRAPPER: "".concat(_adfSchema.tablePrefixSelector, "-row-controls-wrapper"),
|
|
56
56
|
TABLE_COLUMN_CONTROLS_DECORATIONS: "".concat(_adfSchema.tablePrefixSelector, "-column-controls-decoration"),
|
|
57
|
-
TABLE_RESIZER_CONTAINER: "".concat(_adfSchema.tablePrefixSelector, "-resizer-container")
|
|
57
|
+
TABLE_RESIZER_CONTAINER: "".concat(_adfSchema.tablePrefixSelector, "-resizer-container"),
|
|
58
|
+
TABLE_VIEW_CONTENT_WRAP: 'tableView-content-wrap'
|
|
58
59
|
};
|
|
59
60
|
|
|
60
61
|
/* first block node has 0 top margin */
|
|
@@ -99,6 +99,12 @@ Object.defineProperty(exports, "transformSingleLineCodeBlockToCodeMark", {
|
|
|
99
99
|
return _codeBlock.transformSingleLineCodeBlockToCodeMark;
|
|
100
100
|
}
|
|
101
101
|
});
|
|
102
|
+
Object.defineProperty(exports, "transformSliceEnsureListItemParagraphFirst", {
|
|
103
|
+
enumerable: true,
|
|
104
|
+
get: function get() {
|
|
105
|
+
return _listTransforms.transformSliceEnsureListItemParagraphFirst;
|
|
106
|
+
}
|
|
107
|
+
});
|
|
102
108
|
Object.defineProperty(exports, "transformSliceExpandToNestedExpand", {
|
|
103
109
|
enumerable: true,
|
|
104
110
|
get: function get() {
|
|
@@ -4,12 +4,13 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
|
-
exports.transformToTaskList = exports.transformTaskListToBlockNodes = exports.transformListStructure = exports.transformListRecursively = exports.transformBetweenListTypes = exports.getFormattedNode = exports.createBlockTaskItem = void 0;
|
|
7
|
+
exports.transformToTaskList = exports.transformTaskListToBlockNodes = exports.transformSliceEnsureListItemParagraphFirst = exports.transformListStructure = exports.transformListRecursively = exports.transformBetweenListTypes = exports.getFormattedNode = exports.createBlockTaskItem = 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 _model = require("@atlaskit/editor-prosemirror/model");
|
|
11
11
|
var _utils = require("@atlaskit/editor-prosemirror/utils");
|
|
12
12
|
var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
|
|
13
|
+
var _slice2 = require("../utils/slice");
|
|
13
14
|
var _listUtils = require("./list-utils");
|
|
14
15
|
function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t.return || t.return(); } finally { if (u) throw o; } } }; }
|
|
15
16
|
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
@@ -436,4 +437,36 @@ var getFormattedNode = exports.getFormattedNode = function getFormattedNode(tr)
|
|
|
436
437
|
node: nodeToFormat,
|
|
437
438
|
pos: nodePos
|
|
438
439
|
};
|
|
440
|
+
};
|
|
441
|
+
|
|
442
|
+
/**
|
|
443
|
+
* Ensures every `listItem` in a slice starts with a paragraph.
|
|
444
|
+
*
|
|
445
|
+
* @param slice - The slice to transform
|
|
446
|
+
* @param schema - The editor schema, used to create new paragraph nodes
|
|
447
|
+
* @returns A new slice with the transformation applied
|
|
448
|
+
*/
|
|
449
|
+
var transformSliceEnsureListItemParagraphFirst = exports.transformSliceEnsureListItemParagraphFirst = function transformSliceEnsureListItemParagraphFirst(slice, schema) {
|
|
450
|
+
var _schema$nodes3 = schema.nodes,
|
|
451
|
+
listItem = _schema$nodes3.listItem,
|
|
452
|
+
paragraph = _schema$nodes3.paragraph;
|
|
453
|
+
if (!listItem || !paragraph) {
|
|
454
|
+
return slice;
|
|
455
|
+
}
|
|
456
|
+
return (0, _slice2.mapSlice)(slice, function (node) {
|
|
457
|
+
if (node.type === listItem) {
|
|
458
|
+
var firstChild = node.firstChild;
|
|
459
|
+
if (firstChild && firstChild.type !== paragraph) {
|
|
460
|
+
var emptyParagraph = paragraph.createAndFill();
|
|
461
|
+
if (emptyParagraph) {
|
|
462
|
+
var children = [emptyParagraph];
|
|
463
|
+
for (var i = 0; i < node.childCount; i++) {
|
|
464
|
+
children.push(node.child(i));
|
|
465
|
+
}
|
|
466
|
+
return node.copy(_model.Fragment.from(children));
|
|
467
|
+
}
|
|
468
|
+
}
|
|
469
|
+
}
|
|
470
|
+
return node;
|
|
471
|
+
});
|
|
439
472
|
};
|
|
@@ -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 = "
|
|
27
|
+
var packageVersion = "113.0.0";
|
|
28
28
|
var halfFocusRing = 1;
|
|
29
29
|
var dropOffset = '0, 8';
|
|
30
30
|
var fadeIn = (0, _react2.keyframes)({
|
|
@@ -4,97 +4,8 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
|
-
exports.getBrowserInfo =
|
|
7
|
+
exports.getBrowserInfo = void 0;
|
|
8
8
|
var _memoizeOne = _interopRequireDefault(require("memoize-one"));
|
|
9
|
-
// eslint-disable-next-line @repo/internal/deprecations/deprecation-ticket-required
|
|
10
|
-
/**
|
|
11
|
-
* @deprecated
|
|
12
|
-
* This file is deprecated and will be removed in the next major release.
|
|
13
|
-
* Please use `getBrowserInfo` function to get the browser info on demand.
|
|
14
|
-
* Static `browser` info is no longer supported.
|
|
15
|
-
*/
|
|
16
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
17
|
-
var result = exports.browser = {
|
|
18
|
-
mac: false,
|
|
19
|
-
windows: false,
|
|
20
|
-
ie: false,
|
|
21
|
-
ie_version: 0,
|
|
22
|
-
gecko: false,
|
|
23
|
-
gecko_version: 0,
|
|
24
|
-
chrome: false,
|
|
25
|
-
chrome_version: 0,
|
|
26
|
-
android: false,
|
|
27
|
-
ios: false,
|
|
28
|
-
webkit: false,
|
|
29
|
-
safari: false,
|
|
30
|
-
safari_version: 0,
|
|
31
|
-
supportsIntersectionObserver: false,
|
|
32
|
-
supportsResizeObserver: false
|
|
33
|
-
};
|
|
34
|
-
if (typeof navigator !== 'undefined') {
|
|
35
|
-
var _userAgentData;
|
|
36
|
-
// Ignored via go/ees005
|
|
37
|
-
// eslint-disable-next-line require-unicode-regexp
|
|
38
|
-
var ieEdge = /(?:Edge|Edg)\/(\d+)/.exec(navigator.userAgent);
|
|
39
|
-
// Ignored via go/ees005
|
|
40
|
-
// eslint-disable-next-line require-unicode-regexp
|
|
41
|
-
var ieUpTo10 = /MSIE \d/.test(navigator.userAgent);
|
|
42
|
-
// Ignored via go/ees005
|
|
43
|
-
// eslint-disable-next-line require-unicode-regexp
|
|
44
|
-
var ie11up = /Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);
|
|
45
|
-
|
|
46
|
-
// Ignored via go/ees005
|
|
47
|
-
// eslint-disable-next-line require-unicode-regexp
|
|
48
|
-
result.mac = /Mac/.test(navigator.platform);
|
|
49
|
-
result.windows =
|
|
50
|
-
// Ignored via go/ees005
|
|
51
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
52
|
-
((_userAgentData = navigator.userAgentData) === null || _userAgentData === void 0 ? void 0 : _userAgentData.platform) === 'Windows' ||
|
|
53
|
-
// Ignored via go/ees005
|
|
54
|
-
// eslint-disable-next-line require-unicode-regexp
|
|
55
|
-
/Windows|Win\d+/i.test(navigator.userAgent);
|
|
56
|
-
var ie = result.ie = !!(ieUpTo10 || ie11up || ieEdge);
|
|
57
|
-
result.ie_version = ieUpTo10 ?
|
|
58
|
-
// Ignored via go/ees005
|
|
59
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
60
|
-
document.documentMode || 6 : ie11up ? +ie11up[1] : ieEdge ? +ieEdge[1] : null;
|
|
61
|
-
// Ignored via go/ees005
|
|
62
|
-
// eslint-disable-next-line require-unicode-regexp
|
|
63
|
-
result.gecko = !ie && /gecko\/\d/i.test(navigator.userAgent);
|
|
64
|
-
// Ignored via go/ees005
|
|
65
|
-
// eslint-disable-next-line require-unicode-regexp
|
|
66
|
-
result.gecko_version = parseInt((navigator.userAgent.match(/Firefox\/(\d+)/) || [])[1], 10);
|
|
67
|
-
|
|
68
|
-
// Ignored via go/ees005
|
|
69
|
-
// eslint-disable-next-line require-unicode-regexp
|
|
70
|
-
result.chrome = !ie && /Chrome\//.test(navigator.userAgent);
|
|
71
|
-
// Ignored via go/ees005
|
|
72
|
-
// eslint-disable-next-line require-unicode-regexp
|
|
73
|
-
result.chrome_version = parseInt((navigator.userAgent.match(/Chrome\/(\d+)/) || [])[1], 10);
|
|
74
|
-
// Ignored via go/ees005
|
|
75
|
-
// eslint-disable-next-line require-unicode-regexp
|
|
76
|
-
result.android = /Android \d/.test(navigator.userAgent);
|
|
77
|
-
result.ios =
|
|
78
|
-
// Ignored via go/ees005
|
|
79
|
-
// eslint-disable-next-line require-unicode-regexp
|
|
80
|
-
// Ignored via go/ees005
|
|
81
|
-
// eslint-disable-next-line require-unicode-regexp
|
|
82
|
-
!ie && /AppleWebKit/.test(navigator.userAgent) && /Mobile\/\w+/.test(navigator.userAgent);
|
|
83
|
-
result.webkit = !ie && !!document.documentElement && 'WebkitAppearance' in document.documentElement.style;
|
|
84
|
-
result.safari = Boolean(navigator.vendor && navigator.vendor.indexOf('Apple') > -1 && navigator.userAgent && navigator.userAgent.indexOf('CriOS') === -1 && navigator.userAgent.indexOf('FxiOS') === -1);
|
|
85
|
-
result.safari_version = parseInt(
|
|
86
|
-
// Ignored via go/ees005
|
|
87
|
-
// eslint-disable-next-line require-unicode-regexp
|
|
88
|
-
(navigator.userAgent.match(/Version\/([0-9\._]+).*Safari/) || [])[1], 10);
|
|
89
|
-
result.supportsIntersectionObserver = typeof window !== 'undefined' && 'IntersectionObserver' in window && 'IntersectionObserverEntry' in window &&
|
|
90
|
-
// Ignored via go/ees005
|
|
91
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
92
|
-
'intersectionRatio' in window.IntersectionObserverEntry.prototype;
|
|
93
|
-
result.supportsResizeObserver = typeof window !== 'undefined' && 'ResizeObserver' in window && 'ResizeObserverEntry' in window;
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
// eslint-disable-next-line @repo/internal/deprecations/deprecation-ticket-required
|
|
97
|
-
|
|
98
9
|
var getFirstMatch = function getFirstMatch(regexp, ua) {
|
|
99
10
|
var match = ua.match(regexp);
|
|
100
11
|
return match && match.length > 0 && match[1] || '';
|
|
@@ -166,7 +77,7 @@ var getBrowserInfo = exports.getBrowserInfo = (0, _memoizeOne.default)(function
|
|
|
166
77
|
// inspired from https://github.com/bowser-js/bowser/blob/master/src/parser-browsers.js
|
|
167
78
|
// Ignored via go/ees005
|
|
168
79
|
// eslint-disable-next-line require-unicode-regexp
|
|
169
|
-
var
|
|
80
|
+
var ieEdge = /\sedg\//i.test(userAgent);
|
|
170
81
|
// eslint-disable-next-line require-unicode-regexp
|
|
171
82
|
var ieEdge2 = /edg([ea]|ios)/i.test(userAgent);
|
|
172
83
|
// eslint-disable-next-line require-unicode-regexp
|
|
@@ -185,10 +96,10 @@ var getBrowserInfo = exports.getBrowserInfo = (0, _memoizeOne.default)(function
|
|
|
185
96
|
/Windows|Win\d+/i.test(userAgent);
|
|
186
97
|
|
|
187
98
|
// used userAgent rather than relying on documentMode
|
|
188
|
-
var
|
|
189
|
-
result.ie =
|
|
99
|
+
var ie = ieEdge || ieEdge2 || internetExplorer;
|
|
100
|
+
result.ie = ie;
|
|
190
101
|
// inspired from https://github.com/bowser-js/bowser/blob/master/src/parser-browsers.js
|
|
191
|
-
result.ie_version =
|
|
102
|
+
result.ie_version = ieEdge ?
|
|
192
103
|
// eslint-disable-next-line require-unicode-regexp
|
|
193
104
|
parseInt(getFirstMatch(/\sedg\/(\d+(\.?_?\d+)+)/i, userAgent), 10) :
|
|
194
105
|
// eslint-disable-next-line require-unicode-regexp
|
|
@@ -200,14 +111,14 @@ var getBrowserInfo = exports.getBrowserInfo = (0, _memoizeOne.default)(function
|
|
|
200
111
|
|
|
201
112
|
// Ignored via go/ees005
|
|
202
113
|
// eslint-disable-next-line require-unicode-regexp
|
|
203
|
-
result.gecko = !
|
|
114
|
+
result.gecko = !ie && /gecko\/\d/i.test(userAgent);
|
|
204
115
|
// Ignored via go/ees005
|
|
205
116
|
// eslint-disable-next-line require-unicode-regexp
|
|
206
117
|
result.gecko_version = parseInt((userAgent.match(/Firefox\/(\d+)/) || [])[1], 10);
|
|
207
118
|
|
|
208
119
|
// Ignored via go/ees005
|
|
209
120
|
// eslint-disable-next-line require-unicode-regexp
|
|
210
|
-
result.chrome = !
|
|
121
|
+
result.chrome = !ie && /Chrome\//.test(userAgent);
|
|
211
122
|
// Ignored via go/ees005
|
|
212
123
|
// eslint-disable-next-line require-unicode-regexp
|
|
213
124
|
result.chrome_version = parseInt((userAgent.match(/Chrome\/(\d+)/) || [])[1], 10);
|
|
@@ -217,7 +128,7 @@ var getBrowserInfo = exports.getBrowserInfo = (0, _memoizeOne.default)(function
|
|
|
217
128
|
result.ios =
|
|
218
129
|
// Ignored via go/ees005
|
|
219
130
|
// eslint-disable-next-line require-unicode-regexp
|
|
220
|
-
!
|
|
131
|
+
!ie && /AppleWebKit/.test(userAgent) && /Mobile\/\w+/.test(userAgent);
|
|
221
132
|
|
|
222
133
|
// Previously relied on navigator.vendor, now used userAgent
|
|
223
134
|
result.safari = !result.chrome && !result.ie && !result.gecko && !result.android && !userAgent.includes('CriOS') && !userAgent.includes('FxiOS') &&
|
package/dist/cjs/utils/index.js
CHANGED
|
@@ -154,12 +154,6 @@ Object.defineProperty(exports, "breakoutResizableNodes", {
|
|
|
154
154
|
return _breakout.breakoutResizableNodes;
|
|
155
155
|
}
|
|
156
156
|
});
|
|
157
|
-
Object.defineProperty(exports, "browser", {
|
|
158
|
-
enumerable: true,
|
|
159
|
-
get: function get() {
|
|
160
|
-
return _browser.browser;
|
|
161
|
-
}
|
|
162
|
-
});
|
|
163
157
|
Object.defineProperty(exports, "calcBreakoutWidth", {
|
|
164
158
|
enumerable: true,
|
|
165
159
|
get: function get() {
|
|
@@ -1196,7 +1190,6 @@ var _editorCoreUtils = require("./editor-core-utils");
|
|
|
1196
1190
|
var _shouldAutoLinkifyTld = require("./should-auto-linkify-tld");
|
|
1197
1191
|
var _annotation = require("./annotation");
|
|
1198
1192
|
var _macro = require("./macro");
|
|
1199
|
-
var _browser = require("./browser");
|
|
1200
1193
|
var _errorReporter = require("./error-reporter");
|
|
1201
1194
|
var _date = require("./date");
|
|
1202
1195
|
var _imageLoader = require("./imageLoader");
|
|
@@ -43,6 +43,8 @@ export let TABLE_ACTION = /*#__PURE__*/function (TABLE_ACTION) {
|
|
|
43
43
|
TABLE_ACTION["TABLE_EDITOR_HEIGHT_INFO"] = "tableEditorHeightInformation";
|
|
44
44
|
TABLE_ACTION["TABLE_RENDERER_HEIGHT_INFO"] = "tableRendererHeightInformation";
|
|
45
45
|
TABLE_ACTION["STICKY_HEADER_METHOD_TOGGLED"] = "stickyHeaderMethodToggled";
|
|
46
|
+
TABLE_ACTION["FIT_TO_CONTENT_AUTO_CONVERTED"] = "fitToContentAutoConverted";
|
|
47
|
+
TABLE_ACTION["FIT_TO_CONTENT_ON_DEMAND"] = "fitToContentOnDemand";
|
|
46
48
|
return TABLE_ACTION;
|
|
47
49
|
}({});
|
|
48
50
|
export let TABLE_BREAKOUT = /*#__PURE__*/function (TABLE_BREAKOUT) {
|
|
@@ -90,6 +90,31 @@ export const helpDialogMessages = defineMessages({
|
|
|
90
90
|
defaultMessage: 'Focus table resize handle',
|
|
91
91
|
description: 'The text is shown as a label for a keyboard shortcut in the editor help dialog that describes how to move focus to the table resize handle for resizing columns.'
|
|
92
92
|
},
|
|
93
|
+
selectDragHandle: {
|
|
94
|
+
id: 'fabric.editor.selectDragHandle',
|
|
95
|
+
defaultMessage: 'Select drag handle',
|
|
96
|
+
description: 'The text is shown as a label for a keyboard shortcut in the editor help dialog that describes how to select and focus the drag handle on the current block.'
|
|
97
|
+
},
|
|
98
|
+
moveSelectionUp: {
|
|
99
|
+
id: 'fabric.editor.moveSelectionUp',
|
|
100
|
+
defaultMessage: 'Move selection up',
|
|
101
|
+
description: 'The text is shown as a label for a keyboard shortcut in the editor help dialog that describes how to move the selected block up in the document.'
|
|
102
|
+
},
|
|
103
|
+
moveSelectionDown: {
|
|
104
|
+
id: 'fabric.editor.moveSelectionDown',
|
|
105
|
+
defaultMessage: 'Move selection down',
|
|
106
|
+
description: 'The text is shown as a label for a keyboard shortcut in the editor help dialog that describes how to move the selected block down in the document.'
|
|
107
|
+
},
|
|
108
|
+
moveSelectionLeft: {
|
|
109
|
+
id: 'fabric.editor.moveSelectionLeft',
|
|
110
|
+
defaultMessage: 'Move selection left',
|
|
111
|
+
description: 'The text is shown as a label for a keyboard shortcut in the editor help dialog that describes how to move the selected block to the left layout column.'
|
|
112
|
+
},
|
|
113
|
+
moveSelectionRight: {
|
|
114
|
+
id: 'fabric.editor.moveSelectionRight',
|
|
115
|
+
defaultMessage: 'Move selection right',
|
|
116
|
+
description: 'The text is shown as a label for a keyboard shortcut in the editor help dialog that describes how to move the selected block to the right layout column.'
|
|
117
|
+
},
|
|
93
118
|
closeHelpDialog: {
|
|
94
119
|
id: 'fabric.editor.closeHelpDialog',
|
|
95
120
|
defaultMessage: 'Close help dialog',
|
|
@@ -295,6 +295,11 @@ export const messages = defineMessages({
|
|
|
295
295
|
defaultMessage: `Distribute columns`,
|
|
296
296
|
description: `Distribute widths between selected columns`
|
|
297
297
|
},
|
|
298
|
+
fitToContent: {
|
|
299
|
+
id: 'fabric.editor.fitToContent',
|
|
300
|
+
defaultMessage: `Fit to content`,
|
|
301
|
+
description: `Resize table columns to fit their content`
|
|
302
|
+
},
|
|
298
303
|
lockColumnWidths: {
|
|
299
304
|
id: 'fabric.editor.lockColumns',
|
|
300
305
|
defaultMessage: 'Fixed column widths',
|
|
@@ -4,7 +4,7 @@ import { isFedRamp } from './environment';
|
|
|
4
4
|
import { normaliseSentryBreadcrumbs, SERIALIZABLE_ATTRIBUTES } from './normalise-sentry-breadcrumbs';
|
|
5
5
|
const SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
|
|
6
6
|
const packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
|
|
7
|
-
const packageVersion = "
|
|
7
|
+
const packageVersion = "113.0.0";
|
|
8
8
|
const sanitiseSentryEvents = (data, _hint) => {
|
|
9
9
|
// Remove URL as it has UGC
|
|
10
10
|
// Ignored via go/ees007
|
|
@@ -100,7 +100,7 @@ export const getParentNodeWidth = (pos, state, containerWidth, isFullWidthModeEn
|
|
|
100
100
|
|
|
101
101
|
return parentWidth;
|
|
102
102
|
};
|
|
103
|
-
const getNestedParentNode = (tablePos, state) => {
|
|
103
|
+
export const getNestedParentNode = (tablePos, state) => {
|
|
104
104
|
if (tablePos === undefined) {
|
|
105
105
|
return null;
|
|
106
106
|
}
|
|
@@ -11,7 +11,8 @@ import { DOMSerializer } from '@atlaskit/editor-prosemirror/model';
|
|
|
11
11
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
12
12
|
import { ACTION_SUBJECT, ACTION_SUBJECT_ID } from '../analytics';
|
|
13
13
|
import { ErrorBoundary } from '../ui/ErrorBoundary';
|
|
14
|
-
import { analyticsEventKey,
|
|
14
|
+
import { analyticsEventKey, getPerformanceOptions, startMeasureReactNodeViewRendered, stopMeasureReactNodeViewRendered } from '../utils';
|
|
15
|
+
import { getBrowserInfo } from '../utils/browser';
|
|
15
16
|
import { ZERO_WIDTH_SPACE } from '../whitespace';
|
|
16
17
|
import { generateUniqueNodeKey } from './generateUniqueNodeKey';
|
|
17
18
|
import { getOrCreateOnVisibleObserver } from './onVisibleObserverFactory';
|
|
@@ -358,7 +359,7 @@ function getPortalChildren({
|
|
|
358
359
|
getPos: nodeViewParams.getPos,
|
|
359
360
|
node: currentNode
|
|
360
361
|
// eslint-disable-next-line react/jsx-props-no-spreading -- Spreading props to pass through dynamic component props
|
|
361
|
-
}, extraComponentProps)),
|
|
362
|
+
}, extraComponentProps)), getBrowserInfo().android ?
|
|
362
363
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
363
364
|
jsx("span", {
|
|
364
365
|
className: `zeroWidthSpaceContainer`,
|
|
@@ -45,7 +45,8 @@ export const TableSharedCssClassName = {
|
|
|
45
45
|
TABLE_HEADER_CELL_WRAPPER: tableHeaderSelector,
|
|
46
46
|
TABLE_ROW_CONTROLS_WRAPPER: `${tablePrefixSelector}-row-controls-wrapper`,
|
|
47
47
|
TABLE_COLUMN_CONTROLS_DECORATIONS: `${tablePrefixSelector}-column-controls-decoration`,
|
|
48
|
-
TABLE_RESIZER_CONTAINER: `${tablePrefixSelector}-resizer-container
|
|
48
|
+
TABLE_RESIZER_CONTAINER: `${tablePrefixSelector}-resizer-container`,
|
|
49
|
+
TABLE_VIEW_CONTENT_WRAP: 'tableView-content-wrap'
|
|
49
50
|
};
|
|
50
51
|
|
|
51
52
|
/* first block node has 0 top margin */
|
|
@@ -6,6 +6,6 @@ export { findExpand, transformSliceToRemoveOpenExpand, transformSliceToRemoveOpe
|
|
|
6
6
|
export { transformSliceToRemoveOpenBodiedExtension, transformSliceToRemoveOpenMultiBodiedExtension, transformSliceToRemoveLegacyContentMacro, transformSliceToRemoveMacroId } from './extension';
|
|
7
7
|
export { transformSliceToJoinAdjacentCodeBlocks, transformSingleLineCodeBlockToCodeMark, findCodeBlock } from './code-block';
|
|
8
8
|
export { transformSliceToDecisionList } from './decision-list';
|
|
9
|
-
export { createBlockTaskItem, transformListStructure, transformBetweenListTypes, transformListRecursively, transformToTaskList, transformTaskListToBlockNodes, getFormattedNode } from './list-transforms';
|
|
9
|
+
export { createBlockTaskItem, transformListStructure, transformBetweenListTypes, transformListRecursively, transformToTaskList, transformTaskListToBlockNodes, getFormattedNode, transformSliceEnsureListItemParagraphFirst } from './list-transforms';
|
|
10
10
|
export { isBulletOrOrderedList, isTaskList, getSupportedListTypesSet, convertBlockToInlineContent } from './list-utils';
|
|
11
11
|
export { removeBreakoutFromRendererSyncBlockHTML } from './sync-block';
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Fragment, Slice } from '@atlaskit/editor-prosemirror/model';
|
|
2
2
|
import { findChildrenByType, findParentNodeOfType, findSelectedNodeOfType } from '@atlaskit/editor-prosemirror/utils';
|
|
3
3
|
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
4
|
+
import { mapSlice } from '../utils/slice';
|
|
4
5
|
import { getSupportedListTypesSet, isBulletOrOrderedList, isTaskList, convertBlockToInlineContent } from './list-utils';
|
|
5
6
|
const getContentSupportChecker = targetNodeType => {
|
|
6
7
|
return node => {
|
|
@@ -429,4 +430,37 @@ export const getFormattedNode = tr => {
|
|
|
429
430
|
node: nodeToFormat,
|
|
430
431
|
pos: nodePos
|
|
431
432
|
};
|
|
433
|
+
};
|
|
434
|
+
|
|
435
|
+
/**
|
|
436
|
+
* Ensures every `listItem` in a slice starts with a paragraph.
|
|
437
|
+
*
|
|
438
|
+
* @param slice - The slice to transform
|
|
439
|
+
* @param schema - The editor schema, used to create new paragraph nodes
|
|
440
|
+
* @returns A new slice with the transformation applied
|
|
441
|
+
*/
|
|
442
|
+
export const transformSliceEnsureListItemParagraphFirst = (slice, schema) => {
|
|
443
|
+
const {
|
|
444
|
+
listItem,
|
|
445
|
+
paragraph
|
|
446
|
+
} = schema.nodes;
|
|
447
|
+
if (!listItem || !paragraph) {
|
|
448
|
+
return slice;
|
|
449
|
+
}
|
|
450
|
+
return mapSlice(slice, node => {
|
|
451
|
+
if (node.type === listItem) {
|
|
452
|
+
const firstChild = node.firstChild;
|
|
453
|
+
if (firstChild && firstChild.type !== paragraph) {
|
|
454
|
+
const emptyParagraph = paragraph.createAndFill();
|
|
455
|
+
if (emptyParagraph) {
|
|
456
|
+
const children = [emptyParagraph];
|
|
457
|
+
for (let i = 0; i < node.childCount; i++) {
|
|
458
|
+
children.push(node.child(i));
|
|
459
|
+
}
|
|
460
|
+
return node.copy(Fragment.from(children));
|
|
461
|
+
}
|
|
462
|
+
}
|
|
463
|
+
}
|
|
464
|
+
return node;
|
|
465
|
+
});
|
|
432
466
|
};
|
|
@@ -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 = "
|
|
17
|
+
const packageVersion = "113.0.0";
|
|
18
18
|
const halfFocusRing = 1;
|
|
19
19
|
const dropOffset = '0, 8';
|
|
20
20
|
const fadeIn = keyframes({
|