@atlaskit/editor-common 112.22.0 → 113.0.0
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 +39 -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/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/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/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/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/utils/browser.d.ts +0 -10
- package/dist/types-ts4.5/utils/index.d.ts +0 -8
- package/package.json +11 -11
|
@@ -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 */
|
|
@@ -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 = "112.
|
|
24
|
+
var packageVersion = "112.22.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;
|