@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
|
@@ -1,93 +1,4 @@
|
|
|
1
1
|
import memorizeOne from 'memoize-one';
|
|
2
|
-
// eslint-disable-next-line @repo/internal/deprecations/deprecation-ticket-required
|
|
3
|
-
/**
|
|
4
|
-
* @deprecated
|
|
5
|
-
* This file is deprecated and will be removed in the next major release.
|
|
6
|
-
* Please use `getBrowserInfo` function to get the browser info on demand.
|
|
7
|
-
* Static `browser` info is no longer supported.
|
|
8
|
-
*/
|
|
9
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
10
|
-
const result = {
|
|
11
|
-
mac: false,
|
|
12
|
-
windows: false,
|
|
13
|
-
ie: false,
|
|
14
|
-
ie_version: 0,
|
|
15
|
-
gecko: false,
|
|
16
|
-
gecko_version: 0,
|
|
17
|
-
chrome: false,
|
|
18
|
-
chrome_version: 0,
|
|
19
|
-
android: false,
|
|
20
|
-
ios: false,
|
|
21
|
-
webkit: false,
|
|
22
|
-
safari: false,
|
|
23
|
-
safari_version: 0,
|
|
24
|
-
supportsIntersectionObserver: false,
|
|
25
|
-
supportsResizeObserver: false
|
|
26
|
-
};
|
|
27
|
-
if (typeof navigator !== 'undefined') {
|
|
28
|
-
var _userAgentData;
|
|
29
|
-
// Ignored via go/ees005
|
|
30
|
-
// eslint-disable-next-line require-unicode-regexp
|
|
31
|
-
const ieEdge = /(?:Edge|Edg)\/(\d+)/.exec(navigator.userAgent);
|
|
32
|
-
// Ignored via go/ees005
|
|
33
|
-
// eslint-disable-next-line require-unicode-regexp
|
|
34
|
-
const ieUpTo10 = /MSIE \d/.test(navigator.userAgent);
|
|
35
|
-
// Ignored via go/ees005
|
|
36
|
-
// eslint-disable-next-line require-unicode-regexp
|
|
37
|
-
const ie11up = /Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);
|
|
38
|
-
|
|
39
|
-
// Ignored via go/ees005
|
|
40
|
-
// eslint-disable-next-line require-unicode-regexp
|
|
41
|
-
result.mac = /Mac/.test(navigator.platform);
|
|
42
|
-
result.windows =
|
|
43
|
-
// Ignored via go/ees005
|
|
44
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
45
|
-
((_userAgentData = navigator.userAgentData) === null || _userAgentData === void 0 ? void 0 : _userAgentData.platform) === 'Windows' ||
|
|
46
|
-
// Ignored via go/ees005
|
|
47
|
-
// eslint-disable-next-line require-unicode-regexp
|
|
48
|
-
/Windows|Win\d+/i.test(navigator.userAgent);
|
|
49
|
-
const ie = result.ie = !!(ieUpTo10 || ie11up || ieEdge);
|
|
50
|
-
result.ie_version = ieUpTo10 ?
|
|
51
|
-
// Ignored via go/ees005
|
|
52
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
53
|
-
document.documentMode || 6 : ie11up ? +ie11up[1] : ieEdge ? +ieEdge[1] : null;
|
|
54
|
-
// Ignored via go/ees005
|
|
55
|
-
// eslint-disable-next-line require-unicode-regexp
|
|
56
|
-
result.gecko = !ie && /gecko\/\d/i.test(navigator.userAgent);
|
|
57
|
-
// Ignored via go/ees005
|
|
58
|
-
// eslint-disable-next-line require-unicode-regexp
|
|
59
|
-
result.gecko_version = parseInt((navigator.userAgent.match(/Firefox\/(\d+)/) || [])[1], 10);
|
|
60
|
-
|
|
61
|
-
// Ignored via go/ees005
|
|
62
|
-
// eslint-disable-next-line require-unicode-regexp
|
|
63
|
-
result.chrome = !ie && /Chrome\//.test(navigator.userAgent);
|
|
64
|
-
// Ignored via go/ees005
|
|
65
|
-
// eslint-disable-next-line require-unicode-regexp
|
|
66
|
-
result.chrome_version = parseInt((navigator.userAgent.match(/Chrome\/(\d+)/) || [])[1], 10);
|
|
67
|
-
// Ignored via go/ees005
|
|
68
|
-
// eslint-disable-next-line require-unicode-regexp
|
|
69
|
-
result.android = /Android \d/.test(navigator.userAgent);
|
|
70
|
-
result.ios =
|
|
71
|
-
// Ignored via go/ees005
|
|
72
|
-
// eslint-disable-next-line require-unicode-regexp
|
|
73
|
-
// Ignored via go/ees005
|
|
74
|
-
// eslint-disable-next-line require-unicode-regexp
|
|
75
|
-
!ie && /AppleWebKit/.test(navigator.userAgent) && /Mobile\/\w+/.test(navigator.userAgent);
|
|
76
|
-
result.webkit = !ie && !!document.documentElement && 'WebkitAppearance' in document.documentElement.style;
|
|
77
|
-
result.safari = Boolean(navigator.vendor && navigator.vendor.indexOf('Apple') > -1 && navigator.userAgent && navigator.userAgent.indexOf('CriOS') === -1 && navigator.userAgent.indexOf('FxiOS') === -1);
|
|
78
|
-
result.safari_version = parseInt(
|
|
79
|
-
// Ignored via go/ees005
|
|
80
|
-
// eslint-disable-next-line require-unicode-regexp
|
|
81
|
-
(navigator.userAgent.match(/Version\/([0-9\._]+).*Safari/) || [])[1], 10);
|
|
82
|
-
result.supportsIntersectionObserver = typeof window !== 'undefined' && 'IntersectionObserver' in window && 'IntersectionObserverEntry' in window &&
|
|
83
|
-
// Ignored via go/ees005
|
|
84
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
85
|
-
'intersectionRatio' in window.IntersectionObserverEntry.prototype;
|
|
86
|
-
result.supportsResizeObserver = typeof window !== 'undefined' && 'ResizeObserver' in window && 'ResizeObserverEntry' in window;
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
// eslint-disable-next-line @repo/internal/deprecations/deprecation-ticket-required
|
|
90
|
-
export { result as browser };
|
|
91
2
|
const getFirstMatch = (regexp, ua) => {
|
|
92
3
|
const match = ua.match(regexp);
|
|
93
4
|
return match && match.length > 0 && match[1] || '';
|
|
@@ -8,14 +8,6 @@ export { shouldAutoLinkifyMatch } from './should-auto-linkify-tld';
|
|
|
8
8
|
export { getAnnotationMarksForPos, canApplyAnnotationOnRange, containsAnyAnnotations, getAnnotationIdsFromRange, getAnnotationInlineNodeTypes, hasAnnotationMark, getRangeInlineNodeNames, getRangeAncestorNodeNames, isEmptyTextSelection, isEmptyTextSelectionRenderer } from './annotation';
|
|
9
9
|
export { getExtensionLozengeData } from './macro';
|
|
10
10
|
export {
|
|
11
|
-
/**
|
|
12
|
-
* @private
|
|
13
|
-
* @deprecated
|
|
14
|
-
*
|
|
15
|
-
* Please use `@atlaskit/editor-common/browser` entry-point instead.
|
|
16
|
-
*/
|
|
17
|
-
browser } from './browser';
|
|
18
|
-
export {
|
|
19
11
|
/**
|
|
20
12
|
* @private
|
|
21
13
|
* @deprecated
|
|
@@ -43,6 +43,8 @@ export var 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 var TABLE_BREAKOUT = /*#__PURE__*/function (TABLE_BREAKOUT) {
|
|
@@ -90,6 +90,31 @@ export var 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 var 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',
|
|
@@ -10,7 +10,7 @@ import { isFedRamp } from './environment';
|
|
|
10
10
|
import { normaliseSentryBreadcrumbs, SERIALIZABLE_ATTRIBUTES } from './normalise-sentry-breadcrumbs';
|
|
11
11
|
var SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
|
|
12
12
|
var packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
|
|
13
|
-
var packageVersion = "
|
|
13
|
+
var packageVersion = "113.0.0";
|
|
14
14
|
var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
|
|
15
15
|
// Remove URL as it has UGC
|
|
16
16
|
// Ignored via go/ees007
|
|
@@ -101,7 +101,7 @@ export var getParentNodeWidth = function getParentNodeWidth(pos, state, containe
|
|
|
101
101
|
|
|
102
102
|
return parentWidth;
|
|
103
103
|
};
|
|
104
|
-
var getNestedParentNode = function getNestedParentNode(tablePos, state) {
|
|
104
|
+
export var getNestedParentNode = function getNestedParentNode(tablePos, state) {
|
|
105
105
|
if (tablePos === undefined) {
|
|
106
106
|
return null;
|
|
107
107
|
}
|
|
@@ -14,7 +14,8 @@ import { DOMSerializer } from '@atlaskit/editor-prosemirror/model';
|
|
|
14
14
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
15
15
|
import { ACTION_SUBJECT, ACTION_SUBJECT_ID } from '../analytics';
|
|
16
16
|
import { ErrorBoundary } from '../ui/ErrorBoundary';
|
|
17
|
-
import { analyticsEventKey,
|
|
17
|
+
import { analyticsEventKey, getPerformanceOptions, startMeasureReactNodeViewRendered, stopMeasureReactNodeViewRendered } from '../utils';
|
|
18
|
+
import { getBrowserInfo } from '../utils/browser';
|
|
18
19
|
import { ZERO_WIDTH_SPACE } from '../whitespace';
|
|
19
20
|
import { generateUniqueNodeKey } from './generateUniqueNodeKey';
|
|
20
21
|
import { getOrCreateOnVisibleObserver } from './onVisibleObserverFactory';
|
|
@@ -352,7 +353,7 @@ function getPortalChildren(_ref3) {
|
|
|
352
353
|
getPos: nodeViewParams.getPos,
|
|
353
354
|
node: currentNode
|
|
354
355
|
// eslint-disable-next-line react/jsx-props-no-spreading -- Spreading props to pass through dynamic component props
|
|
355
|
-
}, extraComponentProps)),
|
|
356
|
+
}, extraComponentProps)), getBrowserInfo().android ?
|
|
356
357
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
357
358
|
jsx("span", {
|
|
358
359
|
className: "zeroWidthSpaceContainer",
|
|
@@ -47,7 +47,8 @@ export var TableSharedCssClassName = {
|
|
|
47
47
|
TABLE_HEADER_CELL_WRAPPER: tableHeaderSelector,
|
|
48
48
|
TABLE_ROW_CONTROLS_WRAPPER: "".concat(tablePrefixSelector, "-row-controls-wrapper"),
|
|
49
49
|
TABLE_COLUMN_CONTROLS_DECORATIONS: "".concat(tablePrefixSelector, "-column-controls-decoration"),
|
|
50
|
-
TABLE_RESIZER_CONTAINER: "".concat(tablePrefixSelector, "-resizer-container")
|
|
50
|
+
TABLE_RESIZER_CONTAINER: "".concat(tablePrefixSelector, "-resizer-container"),
|
|
51
|
+
TABLE_VIEW_CONTENT_WRAP: 'tableView-content-wrap'
|
|
51
52
|
};
|
|
52
53
|
|
|
53
54
|
/* 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';
|
|
@@ -8,6 +8,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
8
8
|
import { Fragment, Slice } from '@atlaskit/editor-prosemirror/model';
|
|
9
9
|
import { findChildrenByType, findParentNodeOfType, findSelectedNodeOfType } from '@atlaskit/editor-prosemirror/utils';
|
|
10
10
|
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
11
|
+
import { mapSlice } from '../utils/slice';
|
|
11
12
|
import { getSupportedListTypesSet, isBulletOrOrderedList, isTaskList, convertBlockToInlineContent } from './list-utils';
|
|
12
13
|
var getContentSupportChecker = function getContentSupportChecker(targetNodeType) {
|
|
13
14
|
return function (node) {
|
|
@@ -430,4 +431,36 @@ export var getFormattedNode = function getFormattedNode(tr) {
|
|
|
430
431
|
node: nodeToFormat,
|
|
431
432
|
pos: nodePos
|
|
432
433
|
};
|
|
434
|
+
};
|
|
435
|
+
|
|
436
|
+
/**
|
|
437
|
+
* Ensures every `listItem` in a slice starts with a paragraph.
|
|
438
|
+
*
|
|
439
|
+
* @param slice - The slice to transform
|
|
440
|
+
* @param schema - The editor schema, used to create new paragraph nodes
|
|
441
|
+
* @returns A new slice with the transformation applied
|
|
442
|
+
*/
|
|
443
|
+
export var transformSliceEnsureListItemParagraphFirst = function transformSliceEnsureListItemParagraphFirst(slice, schema) {
|
|
444
|
+
var _schema$nodes3 = schema.nodes,
|
|
445
|
+
listItem = _schema$nodes3.listItem,
|
|
446
|
+
paragraph = _schema$nodes3.paragraph;
|
|
447
|
+
if (!listItem || !paragraph) {
|
|
448
|
+
return slice;
|
|
449
|
+
}
|
|
450
|
+
return mapSlice(slice, function (node) {
|
|
451
|
+
if (node.type === listItem) {
|
|
452
|
+
var firstChild = node.firstChild;
|
|
453
|
+
if (firstChild && firstChild.type !== paragraph) {
|
|
454
|
+
var emptyParagraph = paragraph.createAndFill();
|
|
455
|
+
if (emptyParagraph) {
|
|
456
|
+
var children = [emptyParagraph];
|
|
457
|
+
for (var 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
|
+
});
|
|
433
466
|
};
|
|
@@ -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 = "
|
|
24
|
+
var packageVersion = "113.0.0";
|
|
25
25
|
var halfFocusRing = 1;
|
|
26
26
|
var dropOffset = '0, 8';
|
|
27
27
|
var fadeIn = keyframes({
|
|
@@ -1,93 +1,4 @@
|
|
|
1
1
|
import memorizeOne from 'memoize-one';
|
|
2
|
-
// eslint-disable-next-line @repo/internal/deprecations/deprecation-ticket-required
|
|
3
|
-
/**
|
|
4
|
-
* @deprecated
|
|
5
|
-
* This file is deprecated and will be removed in the next major release.
|
|
6
|
-
* Please use `getBrowserInfo` function to get the browser info on demand.
|
|
7
|
-
* Static `browser` info is no longer supported.
|
|
8
|
-
*/
|
|
9
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
10
|
-
var result = {
|
|
11
|
-
mac: false,
|
|
12
|
-
windows: false,
|
|
13
|
-
ie: false,
|
|
14
|
-
ie_version: 0,
|
|
15
|
-
gecko: false,
|
|
16
|
-
gecko_version: 0,
|
|
17
|
-
chrome: false,
|
|
18
|
-
chrome_version: 0,
|
|
19
|
-
android: false,
|
|
20
|
-
ios: false,
|
|
21
|
-
webkit: false,
|
|
22
|
-
safari: false,
|
|
23
|
-
safari_version: 0,
|
|
24
|
-
supportsIntersectionObserver: false,
|
|
25
|
-
supportsResizeObserver: false
|
|
26
|
-
};
|
|
27
|
-
if (typeof navigator !== 'undefined') {
|
|
28
|
-
var _userAgentData;
|
|
29
|
-
// Ignored via go/ees005
|
|
30
|
-
// eslint-disable-next-line require-unicode-regexp
|
|
31
|
-
var ieEdge = /(?:Edge|Edg)\/(\d+)/.exec(navigator.userAgent);
|
|
32
|
-
// Ignored via go/ees005
|
|
33
|
-
// eslint-disable-next-line require-unicode-regexp
|
|
34
|
-
var ieUpTo10 = /MSIE \d/.test(navigator.userAgent);
|
|
35
|
-
// Ignored via go/ees005
|
|
36
|
-
// eslint-disable-next-line require-unicode-regexp
|
|
37
|
-
var ie11up = /Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);
|
|
38
|
-
|
|
39
|
-
// Ignored via go/ees005
|
|
40
|
-
// eslint-disable-next-line require-unicode-regexp
|
|
41
|
-
result.mac = /Mac/.test(navigator.platform);
|
|
42
|
-
result.windows =
|
|
43
|
-
// Ignored via go/ees005
|
|
44
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
45
|
-
((_userAgentData = navigator.userAgentData) === null || _userAgentData === void 0 ? void 0 : _userAgentData.platform) === 'Windows' ||
|
|
46
|
-
// Ignored via go/ees005
|
|
47
|
-
// eslint-disable-next-line require-unicode-regexp
|
|
48
|
-
/Windows|Win\d+/i.test(navigator.userAgent);
|
|
49
|
-
var ie = result.ie = !!(ieUpTo10 || ie11up || ieEdge);
|
|
50
|
-
result.ie_version = ieUpTo10 ?
|
|
51
|
-
// Ignored via go/ees005
|
|
52
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
53
|
-
document.documentMode || 6 : ie11up ? +ie11up[1] : ieEdge ? +ieEdge[1] : null;
|
|
54
|
-
// Ignored via go/ees005
|
|
55
|
-
// eslint-disable-next-line require-unicode-regexp
|
|
56
|
-
result.gecko = !ie && /gecko\/\d/i.test(navigator.userAgent);
|
|
57
|
-
// Ignored via go/ees005
|
|
58
|
-
// eslint-disable-next-line require-unicode-regexp
|
|
59
|
-
result.gecko_version = parseInt((navigator.userAgent.match(/Firefox\/(\d+)/) || [])[1], 10);
|
|
60
|
-
|
|
61
|
-
// Ignored via go/ees005
|
|
62
|
-
// eslint-disable-next-line require-unicode-regexp
|
|
63
|
-
result.chrome = !ie && /Chrome\//.test(navigator.userAgent);
|
|
64
|
-
// Ignored via go/ees005
|
|
65
|
-
// eslint-disable-next-line require-unicode-regexp
|
|
66
|
-
result.chrome_version = parseInt((navigator.userAgent.match(/Chrome\/(\d+)/) || [])[1], 10);
|
|
67
|
-
// Ignored via go/ees005
|
|
68
|
-
// eslint-disable-next-line require-unicode-regexp
|
|
69
|
-
result.android = /Android \d/.test(navigator.userAgent);
|
|
70
|
-
result.ios =
|
|
71
|
-
// Ignored via go/ees005
|
|
72
|
-
// eslint-disable-next-line require-unicode-regexp
|
|
73
|
-
// Ignored via go/ees005
|
|
74
|
-
// eslint-disable-next-line require-unicode-regexp
|
|
75
|
-
!ie && /AppleWebKit/.test(navigator.userAgent) && /Mobile\/\w+/.test(navigator.userAgent);
|
|
76
|
-
result.webkit = !ie && !!document.documentElement && 'WebkitAppearance' in document.documentElement.style;
|
|
77
|
-
result.safari = Boolean(navigator.vendor && navigator.vendor.indexOf('Apple') > -1 && navigator.userAgent && navigator.userAgent.indexOf('CriOS') === -1 && navigator.userAgent.indexOf('FxiOS') === -1);
|
|
78
|
-
result.safari_version = parseInt(
|
|
79
|
-
// Ignored via go/ees005
|
|
80
|
-
// eslint-disable-next-line require-unicode-regexp
|
|
81
|
-
(navigator.userAgent.match(/Version\/([0-9\._]+).*Safari/) || [])[1], 10);
|
|
82
|
-
result.supportsIntersectionObserver = typeof window !== 'undefined' && 'IntersectionObserver' in window && 'IntersectionObserverEntry' in window &&
|
|
83
|
-
// Ignored via go/ees005
|
|
84
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
85
|
-
'intersectionRatio' in window.IntersectionObserverEntry.prototype;
|
|
86
|
-
result.supportsResizeObserver = typeof window !== 'undefined' && 'ResizeObserver' in window && 'ResizeObserverEntry' in window;
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
// eslint-disable-next-line @repo/internal/deprecations/deprecation-ticket-required
|
|
90
|
-
export { result as browser };
|
|
91
2
|
var getFirstMatch = function getFirstMatch(regexp, ua) {
|
|
92
3
|
var match = ua.match(regexp);
|
|
93
4
|
return match && match.length > 0 && match[1] || '';
|
|
@@ -159,7 +70,7 @@ export var getBrowserInfo = memorizeOne(function () {
|
|
|
159
70
|
// inspired from https://github.com/bowser-js/bowser/blob/master/src/parser-browsers.js
|
|
160
71
|
// Ignored via go/ees005
|
|
161
72
|
// eslint-disable-next-line require-unicode-regexp
|
|
162
|
-
var
|
|
73
|
+
var ieEdge = /\sedg\//i.test(userAgent);
|
|
163
74
|
// eslint-disable-next-line require-unicode-regexp
|
|
164
75
|
var ieEdge2 = /edg([ea]|ios)/i.test(userAgent);
|
|
165
76
|
// eslint-disable-next-line require-unicode-regexp
|
|
@@ -178,10 +89,10 @@ export var getBrowserInfo = memorizeOne(function () {
|
|
|
178
89
|
/Windows|Win\d+/i.test(userAgent);
|
|
179
90
|
|
|
180
91
|
// used userAgent rather than relying on documentMode
|
|
181
|
-
var
|
|
182
|
-
result.ie =
|
|
92
|
+
var ie = ieEdge || ieEdge2 || internetExplorer;
|
|
93
|
+
result.ie = ie;
|
|
183
94
|
// inspired from https://github.com/bowser-js/bowser/blob/master/src/parser-browsers.js
|
|
184
|
-
result.ie_version =
|
|
95
|
+
result.ie_version = ieEdge ?
|
|
185
96
|
// eslint-disable-next-line require-unicode-regexp
|
|
186
97
|
parseInt(getFirstMatch(/\sedg\/(\d+(\.?_?\d+)+)/i, userAgent), 10) :
|
|
187
98
|
// eslint-disable-next-line require-unicode-regexp
|
|
@@ -193,14 +104,14 @@ export var getBrowserInfo = memorizeOne(function () {
|
|
|
193
104
|
|
|
194
105
|
// Ignored via go/ees005
|
|
195
106
|
// eslint-disable-next-line require-unicode-regexp
|
|
196
|
-
result.gecko = !
|
|
107
|
+
result.gecko = !ie && /gecko\/\d/i.test(userAgent);
|
|
197
108
|
// Ignored via go/ees005
|
|
198
109
|
// eslint-disable-next-line require-unicode-regexp
|
|
199
110
|
result.gecko_version = parseInt((userAgent.match(/Firefox\/(\d+)/) || [])[1], 10);
|
|
200
111
|
|
|
201
112
|
// Ignored via go/ees005
|
|
202
113
|
// eslint-disable-next-line require-unicode-regexp
|
|
203
|
-
result.chrome = !
|
|
114
|
+
result.chrome = !ie && /Chrome\//.test(userAgent);
|
|
204
115
|
// Ignored via go/ees005
|
|
205
116
|
// eslint-disable-next-line require-unicode-regexp
|
|
206
117
|
result.chrome_version = parseInt((userAgent.match(/Chrome\/(\d+)/) || [])[1], 10);
|
|
@@ -210,7 +121,7 @@ export var getBrowserInfo = memorizeOne(function () {
|
|
|
210
121
|
result.ios =
|
|
211
122
|
// Ignored via go/ees005
|
|
212
123
|
// eslint-disable-next-line require-unicode-regexp
|
|
213
|
-
!
|
|
124
|
+
!ie && /AppleWebKit/.test(userAgent) && /Mobile\/\w+/.test(userAgent);
|
|
214
125
|
|
|
215
126
|
// Previously relied on navigator.vendor, now used userAgent
|
|
216
127
|
result.safari = !result.chrome && !result.ie && !result.gecko && !result.android && !userAgent.includes('CriOS') && !userAgent.includes('FxiOS') &&
|
package/dist/esm/utils/index.js
CHANGED
|
@@ -8,14 +8,6 @@ export { shouldAutoLinkifyMatch } from './should-auto-linkify-tld';
|
|
|
8
8
|
export { getAnnotationMarksForPos, canApplyAnnotationOnRange, containsAnyAnnotations, getAnnotationIdsFromRange, getAnnotationInlineNodeTypes, hasAnnotationMark, getRangeInlineNodeNames, getRangeAncestorNodeNames, isEmptyTextSelection, isEmptyTextSelectionRenderer } from './annotation';
|
|
9
9
|
export { getExtensionLozengeData } from './macro';
|
|
10
10
|
export {
|
|
11
|
-
/**
|
|
12
|
-
* @private
|
|
13
|
-
* @deprecated
|
|
14
|
-
*
|
|
15
|
-
* Please use `@atlaskit/editor-common/browser` entry-point instead.
|
|
16
|
-
*/
|
|
17
|
-
browser } from './browser';
|
|
18
|
-
export {
|
|
19
11
|
/**
|
|
20
12
|
* @private
|
|
21
13
|
* @deprecated
|
|
@@ -45,7 +45,9 @@ export declare enum TABLE_ACTION {
|
|
|
45
45
|
TABLE_WIDTH_INFO = "tableWidthInformation",
|
|
46
46
|
TABLE_EDITOR_HEIGHT_INFO = "tableEditorHeightInformation",
|
|
47
47
|
TABLE_RENDERER_HEIGHT_INFO = "tableRendererHeightInformation",
|
|
48
|
-
STICKY_HEADER_METHOD_TOGGLED = "stickyHeaderMethodToggled"
|
|
48
|
+
STICKY_HEADER_METHOD_TOGGLED = "stickyHeaderMethodToggled",
|
|
49
|
+
FIT_TO_CONTENT_AUTO_CONVERTED = "fitToContentAutoConverted",
|
|
50
|
+
FIT_TO_CONTENT_ON_DEMAND = "fitToContentOnDemand"
|
|
49
51
|
}
|
|
50
52
|
export declare enum TABLE_BREAKOUT {
|
|
51
53
|
WIDE = "wide",
|
|
@@ -240,5 +242,18 @@ type TableHeightInfoAEP = TableAEP<TABLE_ACTION.TABLE_EDITOR_HEIGHT_INFO, {
|
|
|
240
242
|
type TableStickyHeaderEnabledAEP = UIAEP<TABLE_ACTION.STICKY_HEADER_METHOD_TOGGLED, ACTION_SUBJECT.TABLE, ACTION_SUBJECT_ID.TABLE_STICKY_HEADER, {
|
|
241
243
|
nativeStickyHeaderEnabled: boolean;
|
|
242
244
|
}, undefined>;
|
|
243
|
-
|
|
245
|
+
type TableFitToContentAutoConvertedAEP = TableAEP<TABLE_ACTION.FIT_TO_CONTENT_AUTO_CONVERTED, {
|
|
246
|
+
editorContainerWidth: number;
|
|
247
|
+
measurements: Array<{
|
|
248
|
+
tableWidth: number;
|
|
249
|
+
totalColumnCount: number;
|
|
250
|
+
}>;
|
|
251
|
+
totalTablesResized: number;
|
|
252
|
+
}, undefined>;
|
|
253
|
+
type TableFitToContentOnDemandAEP = TableAEP<TABLE_ACTION.FIT_TO_CONTENT_ON_DEMAND, {
|
|
254
|
+
editorContainerWidth: number;
|
|
255
|
+
tableWidth: number;
|
|
256
|
+
totalColumnCount: number;
|
|
257
|
+
}, undefined>;
|
|
258
|
+
export type TableEventPayload = TableDeleteAEP | TableClearAEP | TableMergeSplitAEP | TableColorAEP | TableToggleHeaderAEP | TableChangeBreakoutAEP | TableCopyAndCutAEP | TableAddRowOrColumnAEP | TableSortColumnAEP | TableDeleteRowOrColumnAEP | TableReplaceAEP | TableAttemptedResizeAEP | TableDistributeColumnsWidthsAEP | TableCollapsedAEP | TableDragMenuOpenedAEP | TableFixedAEP | TableOverflowChangedAEP | TableInitialOverflowCapturedAEP | TableResizedAEP | TableResizePerfSamplingAEP | TableRowOrColumnMovedAEP | TableMovedRowOrColumnAEP | TableClonedRowOrColumnAEP | TableChangedDisplayModeAEP | TableColumnResizedAEP | TableBackgroundColorFixAEP | TableChangedAlignmentAEP | TableWidthInfoAEP | TableHeightInfoAEP | TableStickyHeaderEnabledAEP | TableFitToContentAutoConvertedAEP | TableFitToContentOnDemandAEP;
|
|
244
259
|
export {};
|
|
@@ -89,6 +89,31 @@ export declare const helpDialogMessages: {
|
|
|
89
89
|
defaultMessage: string;
|
|
90
90
|
description: string;
|
|
91
91
|
};
|
|
92
|
+
selectDragHandle: {
|
|
93
|
+
id: string;
|
|
94
|
+
defaultMessage: string;
|
|
95
|
+
description: string;
|
|
96
|
+
};
|
|
97
|
+
moveSelectionUp: {
|
|
98
|
+
id: string;
|
|
99
|
+
defaultMessage: string;
|
|
100
|
+
description: string;
|
|
101
|
+
};
|
|
102
|
+
moveSelectionDown: {
|
|
103
|
+
id: string;
|
|
104
|
+
defaultMessage: string;
|
|
105
|
+
description: string;
|
|
106
|
+
};
|
|
107
|
+
moveSelectionLeft: {
|
|
108
|
+
id: string;
|
|
109
|
+
defaultMessage: string;
|
|
110
|
+
description: string;
|
|
111
|
+
};
|
|
112
|
+
moveSelectionRight: {
|
|
113
|
+
id: string;
|
|
114
|
+
defaultMessage: string;
|
|
115
|
+
description: string;
|
|
116
|
+
};
|
|
92
117
|
closeHelpDialog: {
|
|
93
118
|
id: string;
|
|
94
119
|
defaultMessage: string;
|