@atlaskit/editor-common 59.0.0 → 60.2.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 +76 -0
- package/dist/cjs/in-product.js +28 -4
- package/dist/cjs/index.js +6 -0
- package/dist/cjs/styles/shared/panel.js +13 -2
- package/dist/cjs/styles/shared/table.js +3 -2
- package/dist/cjs/type-ahead/index.js +25 -0
- package/dist/cjs/types/{typeAhead.js → type-ahead.js} +0 -0
- package/dist/cjs/ufo/experience-store.js +159 -0
- package/dist/cjs/ufo/index.js +25 -0
- package/dist/cjs/ui/Messages/index.js +1 -3
- package/dist/cjs/utils/browser.js +7 -1
- package/dist/cjs/utils/index.js +9 -1
- package/dist/cjs/utils/profiler/render-count.js +135 -0
- package/dist/cjs/utils/validator.js +34 -11
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/in-product.js +1 -1
- package/dist/es2019/index.js +1 -1
- package/dist/es2019/styles/shared/panel.js +20 -2
- package/dist/es2019/styles/shared/table.js +4 -3
- package/dist/es2019/type-ahead/index.js +17 -0
- package/dist/es2019/types/{typeAhead.js → type-ahead.js} +0 -0
- package/dist/es2019/ufo/experience-store.js +115 -0
- package/dist/es2019/ufo/index.js +1 -0
- package/dist/es2019/ui/Messages/index.js +1 -2
- package/dist/es2019/utils/browser.js +7 -1
- package/dist/es2019/utils/index.js +2 -1
- package/dist/es2019/utils/profiler/render-count.js +107 -0
- package/dist/es2019/utils/validator.js +25 -0
- package/dist/es2019/version.json +1 -1
- package/dist/esm/in-product.js +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/styles/shared/panel.js +11 -2
- package/dist/esm/styles/shared/table.js +4 -3
- package/dist/esm/type-ahead/index.js +17 -0
- package/dist/esm/types/{typeAhead.js → type-ahead.js} +0 -0
- package/dist/esm/ufo/experience-store.js +143 -0
- package/dist/esm/ufo/index.js +1 -0
- package/dist/esm/ui/Messages/index.js +1 -2
- package/dist/esm/utils/browser.js +7 -1
- package/dist/esm/utils/index.js +2 -1
- package/dist/esm/utils/profiler/render-count.js +123 -0
- package/dist/esm/utils/validator.js +34 -11
- package/dist/esm/version.json +1 -1
- package/dist/types/__tests_external__/cases/fundamentals/collection.d.ts +3 -0
- package/dist/types/__tests_external__/cases/fundamentals/test-cases/editor-is-present.d.ts +3 -0
- package/dist/types/__tests_external__/cases/fundamentals/test-cases/editor-typing.d.ts +3 -0
- package/dist/types/__tests_external__/cases/media/test-cases/alt-text.d.ts +3 -0
- package/dist/types/__tests_external__/cases/media/test-cases/caption.d.ts +3 -0
- package/dist/types/__tests_external__/cases/media/test-cases/index.d.ts +3 -0
- package/dist/types/__tests_external__/cases/media/test-cases/types.d.ts +4 -0
- package/dist/types/__tests_external__/cases/media/test-cases/upload.d.ts +7 -0
- package/dist/types/__tests_external__/cases/smart-links/index.d.ts +4 -0
- package/dist/types/__tests_external__/cases/smart-links/test-cases/block/delete.d.ts +3 -0
- package/dist/types/__tests_external__/cases/smart-links/test-cases/block/edit.d.ts +4 -0
- package/dist/types/__tests_external__/cases/smart-links/test-cases/block/index.d.ts +3 -0
- package/dist/types/__tests_external__/cases/smart-links/test-cases/block/insert.d.ts +3 -0
- package/dist/types/__tests_external__/cases/smart-links/test-cases/embed/delete.d.ts +3 -0
- package/dist/types/__tests_external__/cases/smart-links/test-cases/embed/edit.d.ts +4 -0
- package/dist/types/__tests_external__/cases/smart-links/test-cases/embed/index.d.ts +3 -0
- package/dist/types/__tests_external__/cases/smart-links/test-cases/embed/insert.d.ts +3 -0
- package/dist/types/__tests_external__/cases/smart-links/test-cases/inline/delete.d.ts +3 -0
- package/dist/types/__tests_external__/cases/smart-links/test-cases/inline/edit.d.ts +4 -0
- package/dist/types/__tests_external__/cases/smart-links/test-cases/inline/index.d.ts +3 -0
- package/dist/types/__tests_external__/cases/smart-links/test-cases/inline/insert.d.ts +3 -0
- package/dist/types/__tests_external__/cases/smart-links/test-cases/inline/unlink.d.ts +3 -0
- package/dist/types/__tests_external__/cases/smart-links/test-cases/types.d.ts +4 -0
- package/dist/types/__tests_external__/cases/smart-links/test-cases/url/index.d.ts +3 -0
- package/dist/types/__tests_external__/cases/smart-links/test-cases/url/insert.d.ts +3 -0
- package/dist/types/__tests_external__/cases/types.d.ts +2 -4
- package/dist/types/__tests_external__/index.d.ts +3 -2
- package/dist/types/__tests_external__/page-objects/Editor.d.ts +6 -3
- package/dist/types/__tests_external__/page-objects/EditorMedia.d.ts +20 -0
- package/dist/types/__tests_external__/page-objects/EditorSmartLink.d.ts +41 -0
- package/dist/types/__tests_external__/page-objects/Renderer.d.ts +4 -4
- package/dist/types/collab/types.d.ts +6 -0
- package/dist/types/extensions/extension-handlers.d.ts +3 -3
- package/dist/types/extensions/index.d.ts +1 -1
- package/dist/types/extensions/types/extension-handler.d.ts +3 -0
- package/dist/types/extensions/types/index.d.ts +1 -1
- package/dist/types/extensions.d.ts +1 -1
- package/dist/types/in-product.d.ts +1 -1
- package/dist/types/index.d.ts +2 -2
- package/dist/types/provider-factory/quick-insert-provider.d.ts +2 -2
- package/dist/types/provider-factory.d.ts +1 -1
- package/dist/types/styles/shared/panel.d.ts +6 -0
- package/dist/types/styles/shared/table.d.ts +1 -0
- package/dist/types/type-ahead/index.d.ts +12 -0
- package/dist/types/types/index.d.ts +1 -1
- package/dist/types/types/{typeAhead.d.ts → type-ahead.d.ts} +0 -0
- package/dist/types/ufo/experience-store.d.ts +32 -0
- package/dist/types/ufo/index.d.ts +1 -0
- package/dist/types/utils/browser.d.ts +3 -0
- package/dist/types/utils/index.d.ts +1 -0
- package/dist/types/utils/profiler/render-count.d.ts +50 -0
- package/package.json +20 -16
- package/type-ahead/package.json +7 -0
- package/ufo/package.json +7 -0
- package/dist/cjs/ui/Caption/index.test.js +0 -82
- package/dist/cjs/utils/performance/measure-tti.test.js +0 -183
- package/dist/es2019/ui/Caption/index.test.js +0 -73
- package/dist/es2019/utils/performance/measure-tti.test.js +0 -124
- package/dist/esm/ui/Caption/index.test.js +0 -73
- package/dist/esm/utils/performance/measure-tti.test.js +0 -174
- package/dist/types/__tests_external__/cases/base-test-case.d.ts +0 -19
- package/dist/types/__tests_external__/cases/base-test-collection.d.ts +0 -12
- package/dist/types/__tests_external__/cases/editor-fundamentals/editor-fundamentals-collection.d.ts +0 -3
- package/dist/types/__tests_external__/cases/editor-fundamentals/test-cases/editor-is-present.d.ts +0 -3
- package/dist/types/__tests_external__/cases/editor-fundamentals/test-cases/editor-typing.d.ts +0 -3
- package/dist/types/__tests_external__/cases/editor-upload-media.d.ts +0 -7
|
@@ -387,21 +387,44 @@ var getValidNode = function getValidNode(originalNode) {
|
|
|
387
387
|
break;
|
|
388
388
|
}
|
|
389
389
|
|
|
390
|
-
case '
|
|
390
|
+
case 'mediaInline':
|
|
391
391
|
{
|
|
392
392
|
var mediaId = '';
|
|
393
|
-
var mediaType = '';
|
|
394
393
|
var mediaCollection = [];
|
|
395
|
-
var mediaUrl = '';
|
|
396
394
|
|
|
397
395
|
if (attrs) {
|
|
398
396
|
var id = attrs.id,
|
|
399
|
-
collection = attrs.collection
|
|
397
|
+
collection = attrs.collection;
|
|
398
|
+
mediaId = id;
|
|
399
|
+
mediaCollection = collection;
|
|
400
|
+
}
|
|
401
|
+
|
|
402
|
+
if (mediaId && mediaCollection && adfStage === 'stage0') {
|
|
403
|
+
return {
|
|
404
|
+
type: type,
|
|
405
|
+
attrs: attrs,
|
|
406
|
+
marks: marks
|
|
407
|
+
};
|
|
408
|
+
}
|
|
409
|
+
|
|
410
|
+
break;
|
|
411
|
+
}
|
|
412
|
+
|
|
413
|
+
case 'media':
|
|
414
|
+
{
|
|
415
|
+
var _mediaId = '';
|
|
416
|
+
var mediaType = '';
|
|
417
|
+
var _mediaCollection = [];
|
|
418
|
+
var mediaUrl = '';
|
|
419
|
+
|
|
420
|
+
if (attrs) {
|
|
421
|
+
var _id = attrs.id,
|
|
422
|
+
_collection = attrs.collection,
|
|
400
423
|
_type = attrs.type,
|
|
401
424
|
url = attrs.url;
|
|
402
|
-
|
|
425
|
+
_mediaId = _id;
|
|
403
426
|
mediaType = _type;
|
|
404
|
-
|
|
427
|
+
_mediaCollection = _collection;
|
|
405
428
|
mediaUrl = url;
|
|
406
429
|
}
|
|
407
430
|
|
|
@@ -421,11 +444,11 @@ var getValidNode = function getValidNode(originalNode) {
|
|
|
421
444
|
type: type,
|
|
422
445
|
attrs: mediaAttrs
|
|
423
446
|
};
|
|
424
|
-
} else if (
|
|
447
|
+
} else if (_mediaId && mediaType) {
|
|
425
448
|
var _mediaAttrs = {
|
|
426
449
|
type: mediaType,
|
|
427
|
-
id:
|
|
428
|
-
collection:
|
|
450
|
+
id: _mediaId,
|
|
451
|
+
collection: _mediaCollection
|
|
429
452
|
};
|
|
430
453
|
|
|
431
454
|
if (attrs.width) {
|
|
@@ -494,10 +517,10 @@ var getValidNode = function getValidNode(originalNode) {
|
|
|
494
517
|
if (attrs) {
|
|
495
518
|
var _text = attrs.text,
|
|
496
519
|
displayName = attrs.displayName,
|
|
497
|
-
|
|
520
|
+
_id2 = attrs.id,
|
|
498
521
|
accessLevel = attrs.accessLevel;
|
|
499
522
|
mentionText = _text || displayName;
|
|
500
|
-
mentionId =
|
|
523
|
+
mentionId = _id2;
|
|
501
524
|
mentionAccess = accessLevel;
|
|
502
525
|
}
|
|
503
526
|
|
package/dist/cjs/version.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { fundamentalsTestCollection, blueLinksTestCollection, inlineSmartLinksTestCollection, blockSmartLinksTestCollection, embedSmartLinksTestCollection, mediaTestCollection, EditorPageObject } from './__tests_external__';
|
package/dist/es2019/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { ADFTraversor, ErrorReporter, ZERO_WIDTH_SPACE, absoluteBreakoutWidth, browser, calcBreakoutWidth, breakoutConsts, calcTableColumnWidths, calcWideWidth, clearMeasure, compose, convertProsemirrorTableNodeToArrayOfRows, createCompareNodes, findAndTrackUnsupportedContentNodes, getAnalyticsAppearance, analyticsEventKey, getAnalyticsEventSeverity, getUnsupportedContentLevelData, UNSUPPORTED_CONTENT_LEVEL_SEVERITY_THRESHOLD_DEFAULTS, getExtensionLozengeData, getExtensionRenderer, getMarksByOrder, getModeFromTheme, getResponseEndTime, getValidContent, getValidDocument, getValidMark, getValidNode, getValidUnknownNode, hasMergedCell, isPastDate, isPerformanceAPIAvailable, isPerformanceObserverAvailable, isSameMark, isSubSupType, markOrder, measureRender, startMeasure, stopMeasure, measureTTI, getTTISeverity, TTI_SEVERITY_THRESHOLD_DEFAULTS, TTI_FROM_INVOCATION_SEVERITY_THRESHOLD_DEFAULTS, timestampToIsoFormat, timestampToString, timestampToTaskContext, timestampToUTCDate, todayTimestampInUTC, withImageLoader, canApplyAnnotationOnRange, getAnnotationIdsFromRange, SEVERITY, UNSUPPORTED_CONTENT_LEVEL_SEVERITY, shouldForceTracking, sniffUserBrowserExtensions } from './utils';
|
|
1
|
+
export { ADFTraversor, ErrorReporter, ZERO_WIDTH_SPACE, absoluteBreakoutWidth, browser, calcBreakoutWidth, breakoutConsts, calcTableColumnWidths, calcWideWidth, clearMeasure, compose, convertProsemirrorTableNodeToArrayOfRows, createCompareNodes, findAndTrackUnsupportedContentNodes, getAnalyticsAppearance, analyticsEventKey, getAnalyticsEventSeverity, getUnsupportedContentLevelData, UNSUPPORTED_CONTENT_LEVEL_SEVERITY_THRESHOLD_DEFAULTS, getExtensionLozengeData, getExtensionRenderer, getMarksByOrder, getModeFromTheme, getResponseEndTime, getValidContent, getValidDocument, getValidMark, getValidNode, getValidUnknownNode, hasMergedCell, isPastDate, isPerformanceAPIAvailable, isPerformanceObserverAvailable, isSameMark, isSubSupType, markOrder, measureRender, startMeasure, stopMeasure, measureTTI, getTTISeverity, TTI_SEVERITY_THRESHOLD_DEFAULTS, TTI_FROM_INVOCATION_SEVERITY_THRESHOLD_DEFAULTS, timestampToIsoFormat, timestampToString, timestampToTaskContext, timestampToUTCDate, todayTimestampInUTC, withImageLoader, canApplyAnnotationOnRange, getAnnotationIdsFromRange, SEVERITY, UNSUPPORTED_CONTENT_LEVEL_SEVERITY, shouldForceTracking, sniffUserBrowserExtensions, RenderCountProfiler } from './utils';
|
|
2
2
|
export { SortOrder, AnnotationUpdateEmitter, AnnotationUpdateEvent } from './types';
|
|
3
3
|
export { DefaultExtensionProvider, combineExtensionProviders, getExtensionKeyAndNodeKey, getExtensionModuleNode, getExtensionModuleNodePrivateProps, getQuickInsertItemsFromModule, getNodeRenderer, getContextualToolbarItemsFromModule, buildMenuItem, resolveImport } from './extensions';
|
|
4
4
|
export { ProviderFactory, WithProviders } from './provider-factory';
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { css } from 'styled-components';
|
|
2
2
|
import { hexToRgba, PanelType } from '@atlaskit/adf-schema';
|
|
3
3
|
import { akEditorTableCellMinWidth, blockNodesVerticalMargin } from '@atlaskit/editor-shared-styles';
|
|
4
|
+
import { akEditorCustomIconSize } from '@atlaskit/editor-shared-styles/consts';
|
|
5
|
+
import { emojiImage, emojiSprite } from '@atlaskit/emoji';
|
|
4
6
|
import * as colors from '@atlaskit/theme/colors';
|
|
5
7
|
import { themed } from '@atlaskit/theme/components';
|
|
6
8
|
import { borderRadius, gridSize } from '@atlaskit/theme/constants';
|
|
@@ -53,6 +55,7 @@ const darkTextColor = {
|
|
|
53
55
|
warning: colors.Y75,
|
|
54
56
|
error: colors.R75
|
|
55
57
|
};
|
|
58
|
+
const verticalAlignment = -((gridSize() * 3 - akEditorCustomIconSize) / 2);
|
|
56
59
|
const prefix = 'ak-editor-panel';
|
|
57
60
|
export const PanelSharedCssClassName = {
|
|
58
61
|
prefix,
|
|
@@ -66,7 +69,13 @@ export const PanelSharedSelectors = {
|
|
|
66
69
|
errorPanel: `.${prefix}[data-panel-type=${PanelType.ERROR}]`,
|
|
67
70
|
successPanel: `.${prefix}[data-panel-type=${PanelType.SUCCESS}]`,
|
|
68
71
|
noteButton: `button[aria-label="Note"]`,
|
|
69
|
-
removeButton: `button[aria-label="Remove"]
|
|
72
|
+
removeButton: `button[aria-label="Remove"]`,
|
|
73
|
+
colorPalette: `[aria-label="Background color"]`,
|
|
74
|
+
selectedColor: `[aria-label="The smell"]`,
|
|
75
|
+
removeEmojiIcon: `[aria-label="Remove emoji"]`,
|
|
76
|
+
emojiIcon: `[aria-label="editor-add-emoji"]`,
|
|
77
|
+
selectedEmoji: `[aria-label=":grinning:"]`,
|
|
78
|
+
title: `#editor-title`
|
|
70
79
|
};
|
|
71
80
|
|
|
72
81
|
const iconDynamicStyles = panelType => props => {
|
|
@@ -117,24 +126,33 @@ export const panelSharedStyles = css`
|
|
|
117
126
|
padding: ${gridSize()}px;
|
|
118
127
|
min-width: ${akEditorTableCellMinWidth}px;
|
|
119
128
|
display: flex;
|
|
129
|
+
position: relative;
|
|
120
130
|
align-items: baseline;
|
|
121
131
|
word-break: break-word;
|
|
122
132
|
|
|
123
133
|
${mainDynamicStyles(PanelType.INFO)}
|
|
124
134
|
|
|
125
135
|
.${PanelSharedCssClassName.icon} {
|
|
126
|
-
display: block;
|
|
127
136
|
flex-shrink: 0;
|
|
128
137
|
height: ${gridSize() * 3}px;
|
|
129
138
|
width: ${gridSize() * 3}px;
|
|
130
139
|
box-sizing: content-box;
|
|
131
140
|
padding-right: ${gridSize()}px;
|
|
141
|
+
text-align: center;
|
|
142
|
+
user-select: none;
|
|
143
|
+
-moz-user-select: none;
|
|
144
|
+
-webkit-user-select: none;
|
|
145
|
+
-ms-user-select: none;
|
|
132
146
|
${iconDynamicStyles(PanelType.INFO)}
|
|
133
147
|
|
|
134
148
|
> span {
|
|
135
149
|
vertical-align: middle;
|
|
136
150
|
display: inline;
|
|
137
151
|
}
|
|
152
|
+
|
|
153
|
+
.${emojiSprite}, .${emojiImage} {
|
|
154
|
+
vertical-align: ${verticalAlignment}px;
|
|
155
|
+
}
|
|
138
156
|
}
|
|
139
157
|
|
|
140
158
|
.ak-editor-panel__content {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { css } from 'styled-components';
|
|
2
|
-
import { tableCellContentDomSelector, tablePrefixSelector } from '@atlaskit/adf-schema';
|
|
2
|
+
import { tableCellContentDomSelector, tableCellSelector, tablePrefixSelector } from '@atlaskit/adf-schema';
|
|
3
3
|
import { akEditorBreakoutPadding, akEditorFullWidthLayoutWidth, akEditorTableBorder, akEditorTableBorderDark, akEditorTableNumberColumnWidth, akEditorTableToolbar, akEditorTableToolbarDark, akEditorWideLayoutWidth, getTableCellBackgroundDarkModeColors, overflowShadow } from '@atlaskit/editor-shared-styles';
|
|
4
4
|
import { DN20 } from '@atlaskit/theme/colors';
|
|
5
5
|
import { themed } from '@atlaskit/theme/components';
|
|
@@ -22,7 +22,8 @@ export const TableSharedCssClassName = {
|
|
|
22
22
|
TABLE_STICKY_WRAPPER: `${tablePrefixSelector}-sticky-wrapper`,
|
|
23
23
|
TABLE_STICKY_SENTINEL_TOP: `${tablePrefixSelector}-sticky-sentinel-top`,
|
|
24
24
|
TABLE_STICKY_SENTINEL_BOTTOM: `${tablePrefixSelector}-sticky-sentinel-bottom`,
|
|
25
|
-
TABLE_CELL_NODEVIEW_CONTENT_DOM: tableCellContentDomSelector
|
|
25
|
+
TABLE_CELL_NODEVIEW_CONTENT_DOM: tableCellContentDomSelector,
|
|
26
|
+
TABLE_CELL_WRAPPER: tableCellSelector
|
|
26
27
|
};
|
|
27
28
|
const tableSharedStyle = css`
|
|
28
29
|
.${TableSharedCssClassName.TABLE_CONTAINER} {
|
|
@@ -87,7 +88,7 @@ const tableSharedStyle = css`
|
|
|
87
88
|
border-bottom-width: 0;
|
|
88
89
|
padding: ${tableCellPadding}px;
|
|
89
90
|
/* https://stackoverflow.com/questions/7517127/borders-not-shown-in-firefox-with-border-collapse-on-table-position-relative-o */
|
|
90
|
-
${browser.gecko || browser.ie ? 'background-clip: padding-box;' : ''}
|
|
91
|
+
${browser.gecko || browser.ie || browser.mac && browser.chrome ? 'background-clip: padding-box;' : ''}
|
|
91
92
|
|
|
92
93
|
${themed({
|
|
93
94
|
dark: getTableCellBackgroundDarkModeColors
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export let TypeAheadAvailableNodes;
|
|
2
|
+
|
|
3
|
+
(function (TypeAheadAvailableNodes) {
|
|
4
|
+
TypeAheadAvailableNodes["EMOJI"] = "emojiTypeAhead";
|
|
5
|
+
TypeAheadAvailableNodes["MENTION"] = "mentionTypeAhead";
|
|
6
|
+
TypeAheadAvailableNodes["QUICK_INSERT"] = "quickInsertTypeAhead";
|
|
7
|
+
})(TypeAheadAvailableNodes || (TypeAheadAvailableNodes = {}));
|
|
8
|
+
|
|
9
|
+
export let SelectItemMode;
|
|
10
|
+
|
|
11
|
+
(function (SelectItemMode) {
|
|
12
|
+
SelectItemMode["SHIFT_ENTER"] = "shift-enter";
|
|
13
|
+
SelectItemMode["ENTER"] = "enter";
|
|
14
|
+
SelectItemMode["SPACE"] = "space";
|
|
15
|
+
SelectItemMode["SELECTED"] = "selected";
|
|
16
|
+
SelectItemMode["TAB"] = "tab";
|
|
17
|
+
})(SelectItemMode || (SelectItemMode = {}));
|
|
File without changes
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
+
import { ExperiencePerformanceTypes, ExperienceTypes, UFOExperience } from '@atlaskit/ufo';
|
|
3
|
+
export const experienceConfig = {
|
|
4
|
+
type: ExperienceTypes.Operation,
|
|
5
|
+
performanceType: ExperiencePerformanceTypes.Custom,
|
|
6
|
+
platform: {
|
|
7
|
+
component: 'editor'
|
|
8
|
+
}
|
|
9
|
+
};
|
|
10
|
+
export let EditorExperience;
|
|
11
|
+
|
|
12
|
+
(function (EditorExperience) {
|
|
13
|
+
EditorExperience["loadEditor"] = "load";
|
|
14
|
+
EditorExperience["typing"] = "type";
|
|
15
|
+
EditorExperience["interaction"] = "interact";
|
|
16
|
+
})(EditorExperience || (EditorExperience = {}));
|
|
17
|
+
|
|
18
|
+
export const RELIABILITY_INTERVAL = 30000;
|
|
19
|
+
export class ExperienceStore {
|
|
20
|
+
constructor() {
|
|
21
|
+
this.experiences = new Map();
|
|
22
|
+
|
|
23
|
+
for (const experienceId of Object.values(EditorExperience)) {
|
|
24
|
+
const experience = new UFOExperience(experienceId, experienceConfig);
|
|
25
|
+
this.experiences.set(experienceId, experience);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
static getInstance(view, options = {}) {
|
|
30
|
+
if (!this.stores.get(view) || options !== null && options !== void 0 && options.forceNewInstance) {
|
|
31
|
+
const store = new ExperienceStore();
|
|
32
|
+
this.stores.set(view, store);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
return this.stores.get(view);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
get(experienceId) {
|
|
39
|
+
return this.experiences.get(experienceId);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
getActive(experienceId) {
|
|
43
|
+
const experience = this.experiences.get(experienceId);
|
|
44
|
+
|
|
45
|
+
if (!(experience !== null && experience !== void 0 && experience.state.final)) {
|
|
46
|
+
return experience;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
getAll() {
|
|
51
|
+
return Array.from(this.experiences.values());
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
start(experienceId, startTime) {
|
|
55
|
+
var _this$get;
|
|
56
|
+
|
|
57
|
+
(_this$get = this.get(experienceId)) === null || _this$get === void 0 ? void 0 : _this$get.start(startTime);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
addMetadata(experienceId, metadata) {
|
|
61
|
+
var _this$get2;
|
|
62
|
+
|
|
63
|
+
(_this$get2 = this.get(experienceId)) === null || _this$get2 === void 0 ? void 0 : _this$get2.addMetadata(metadata);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
mark(experienceId, mark, value) {
|
|
67
|
+
var _this$get3;
|
|
68
|
+
|
|
69
|
+
(_this$get3 = this.get(experienceId)) === null || _this$get3 === void 0 ? void 0 : _this$get3.mark(mark, value);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
success(experienceId, metadata) {
|
|
73
|
+
var _this$getActive;
|
|
74
|
+
|
|
75
|
+
(_this$getActive = this.getActive(experienceId)) === null || _this$getActive === void 0 ? void 0 : _this$getActive.success({
|
|
76
|
+
metadata
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
fail(experienceId, metadata) {
|
|
81
|
+
var _this$getActive2;
|
|
82
|
+
|
|
83
|
+
(_this$getActive2 = this.getActive(experienceId)) === null || _this$getActive2 === void 0 ? void 0 : _this$getActive2.failure({
|
|
84
|
+
metadata
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
abort(experienceId, metadata) {
|
|
89
|
+
// We add this wait in here because when React catches an error it unmounts the component
|
|
90
|
+
// before the error boundary's componentDidCatch is called
|
|
91
|
+
// In this case we want to fail the experience, but without this wait, abort is called first
|
|
92
|
+
setTimeout(() => {
|
|
93
|
+
var _this$getActive3;
|
|
94
|
+
|
|
95
|
+
(_this$getActive3 = this.getActive(experienceId)) === null || _this$getActive3 === void 0 ? void 0 : _this$getActive3.abort({
|
|
96
|
+
metadata
|
|
97
|
+
});
|
|
98
|
+
}, 0);
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
abortAll(metadata) {
|
|
102
|
+
this.experiences.forEach(experience => {
|
|
103
|
+
this.abort(experience.id, metadata);
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
failAll(metadata) {
|
|
108
|
+
this.experiences.forEach(experience => {
|
|
109
|
+
this.fail(experience.id, metadata);
|
|
110
|
+
});
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
_defineProperty(ExperienceStore, "stores", new WeakMap());
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { ExperienceStore, EditorExperience, RELIABILITY_INTERVAL } from './experience-store';
|
|
@@ -4,7 +4,6 @@ import SuccessIcon from '@atlaskit/icon/glyph/editor/success';
|
|
|
4
4
|
import ErrorIcon from '@atlaskit/icon/glyph/error';
|
|
5
5
|
import { G400, N200, R400 } from '@atlaskit/theme/colors';
|
|
6
6
|
import { gridSize } from '@atlaskit/theme/constants';
|
|
7
|
-
import { multiply } from '@atlaskit/theme/math';
|
|
8
7
|
import { h200 } from '@atlaskit/theme/typography';
|
|
9
8
|
const Message = styled.div`
|
|
10
9
|
${h200} font-weight: normal;
|
|
@@ -19,7 +18,7 @@ const Message = styled.div`
|
|
|
19
18
|
|
|
20
19
|
return N200;
|
|
21
20
|
}};
|
|
22
|
-
margin-top: ${
|
|
21
|
+
margin-top: ${gridSize() / 2}px;
|
|
23
22
|
display: flex;
|
|
24
23
|
justify-content: baseline;
|
|
25
24
|
`;
|
|
@@ -7,7 +7,10 @@ const result = {
|
|
|
7
7
|
chrome_version: 0,
|
|
8
8
|
android: false,
|
|
9
9
|
ios: false,
|
|
10
|
-
webkit: false
|
|
10
|
+
webkit: false,
|
|
11
|
+
safari: false,
|
|
12
|
+
supportsIntersectionObserver: false,
|
|
13
|
+
supportsResizeObserver: false
|
|
11
14
|
};
|
|
12
15
|
|
|
13
16
|
if (typeof navigator !== 'undefined') {
|
|
@@ -23,6 +26,9 @@ if (typeof navigator !== 'undefined') {
|
|
|
23
26
|
result.android = /Android \d/.test(navigator.userAgent);
|
|
24
27
|
result.ios = !ie && /AppleWebKit/.test(navigator.userAgent) && /Mobile\/\w+/.test(navigator.userAgent);
|
|
25
28
|
result.webkit = !ie && !!document.documentElement && 'WebkitAppearance' in document.documentElement.style;
|
|
29
|
+
result.safari = Boolean(navigator.vendor && navigator.vendor.indexOf('Apple') > -1 && navigator.userAgent && navigator.userAgent.indexOf('CriOS') === -1 && navigator.userAgent.indexOf('FxiOS') === -1);
|
|
30
|
+
result.supportsIntersectionObserver = typeof window !== 'undefined' && 'IntersectionObserver' in window && 'IntersectionObserverEntry' in window && 'intersectionRatio' in window.IntersectionObserverEntry.prototype;
|
|
31
|
+
result.supportsResizeObserver = typeof window !== 'undefined' && 'ResizeObserver' in window && 'ResizeObserverEntry' in window;
|
|
26
32
|
}
|
|
27
33
|
|
|
28
34
|
export default result;
|
|
@@ -21,4 +21,5 @@ export { compose } from './compose';
|
|
|
21
21
|
export { ZERO_WIDTH_SPACE } from './whitespace';
|
|
22
22
|
export { shouldForceTracking } from './should-force-tracking';
|
|
23
23
|
export { getModeFromTheme } from './getModeFromTheme';
|
|
24
|
-
export { sniffUserBrowserExtensions } from './browser-extensions';
|
|
24
|
+
export { sniffUserBrowserExtensions } from './browser-extensions';
|
|
25
|
+
export { RenderCountProfiler } from './profiler/render-count';
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
export const PROFILER_KEY = '__editorRenderCountProfiler';
|
|
2
|
+
export class RenderCountProfiler {
|
|
3
|
+
/**
|
|
4
|
+
* The singleton/cached instance of RenderCountProfiler that will be shared
|
|
5
|
+
* betweenRenderCountProfiler.getInstance() calls
|
|
6
|
+
*/
|
|
7
|
+
constructor({
|
|
8
|
+
store
|
|
9
|
+
}) {
|
|
10
|
+
this.store = store;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Returns the singleton/cached instance of RenderCountProfiler that
|
|
14
|
+
* currently exists. If it hasn't been instantiated yet, the singleton
|
|
15
|
+
* instance will be created using the given params. Returns the latest
|
|
16
|
+
* singleton/instance.
|
|
17
|
+
*/
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
static getInstance(params) {
|
|
21
|
+
if (!RenderCountProfiler.instance) {
|
|
22
|
+
RenderCountProfiler.instance = new RenderCountProfiler({
|
|
23
|
+
store: params.store
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
return RenderCountProfiler.instance;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
getData(profilerKey) {
|
|
31
|
+
var _this$store;
|
|
32
|
+
|
|
33
|
+
return (_this$store = this.store) === null || _this$store === void 0 ? void 0 : _this$store[profilerKey];
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
enable() {
|
|
37
|
+
this.store[PROFILER_KEY] = { ...this.store[PROFILER_KEY],
|
|
38
|
+
enabled: true
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
remove() {
|
|
43
|
+
delete this.store[PROFILER_KEY];
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
isEnabled() {
|
|
47
|
+
var _this$store2, _this$store2$PROFILER;
|
|
48
|
+
|
|
49
|
+
return Boolean((_this$store2 = this.store) === null || _this$store2 === void 0 ? void 0 : (_this$store2$PROFILER = _this$store2[PROFILER_KEY]) === null || _this$store2$PROFILER === void 0 ? void 0 : _this$store2$PROFILER.enabled);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
setRenderCount({
|
|
53
|
+
componentId,
|
|
54
|
+
renderCount,
|
|
55
|
+
instanceId
|
|
56
|
+
}) {
|
|
57
|
+
const profilerData = this.store[PROFILER_KEY];
|
|
58
|
+
const instance = {
|
|
59
|
+
count: renderCount
|
|
60
|
+
};
|
|
61
|
+
const existingComponents = profilerData === null || profilerData === void 0 ? void 0 : profilerData.components;
|
|
62
|
+
const existingInstances = existingComponents === null || existingComponents === void 0 ? void 0 : existingComponents[componentId];
|
|
63
|
+
const updatedComponent = { ...existingInstances,
|
|
64
|
+
[instanceId]: instance
|
|
65
|
+
};
|
|
66
|
+
this.store[PROFILER_KEY] = { ...profilerData,
|
|
67
|
+
components: { ...existingComponents,
|
|
68
|
+
[componentId]: updatedComponent
|
|
69
|
+
}
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
getInstanceRenderCounters({
|
|
74
|
+
componentId
|
|
75
|
+
}) {
|
|
76
|
+
var _this$store$PROFILER_, _this$store3, _this$store3$PROFILER, _this$store3$PROFILER2;
|
|
77
|
+
|
|
78
|
+
const component = (_this$store$PROFILER_ = (_this$store3 = this.store) === null || _this$store3 === void 0 ? void 0 : (_this$store3$PROFILER = _this$store3[PROFILER_KEY]) === null || _this$store3$PROFILER === void 0 ? void 0 : (_this$store3$PROFILER2 = _this$store3$PROFILER.components) === null || _this$store3$PROFILER2 === void 0 ? void 0 : _this$store3$PROFILER2[componentId]) !== null && _this$store$PROFILER_ !== void 0 ? _this$store$PROFILER_ : {};
|
|
79
|
+
const counters = [];
|
|
80
|
+
|
|
81
|
+
for (let instanceId in component) {
|
|
82
|
+
const counter = {
|
|
83
|
+
instanceId,
|
|
84
|
+
count: component[instanceId].count
|
|
85
|
+
};
|
|
86
|
+
counters.push(counter);
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
return counters;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
getRenderCount({
|
|
93
|
+
componentId
|
|
94
|
+
}) {
|
|
95
|
+
var _this$store$PROFILER_2, _this$store4, _this$store4$PROFILER, _this$store4$PROFILER2;
|
|
96
|
+
|
|
97
|
+
const component = (_this$store$PROFILER_2 = (_this$store4 = this.store) === null || _this$store4 === void 0 ? void 0 : (_this$store4$PROFILER = _this$store4[PROFILER_KEY]) === null || _this$store4$PROFILER === void 0 ? void 0 : (_this$store4$PROFILER2 = _this$store4$PROFILER.components) === null || _this$store4$PROFILER2 === void 0 ? void 0 : _this$store4$PROFILER2[componentId]) !== null && _this$store$PROFILER_2 !== void 0 ? _this$store$PROFILER_2 : {};
|
|
98
|
+
let total = 0;
|
|
99
|
+
|
|
100
|
+
for (let instanceId in component) {
|
|
101
|
+
total += component[instanceId].count;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
return total;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
}
|
|
@@ -342,6 +342,31 @@ export const getValidNode = (originalNode, schema = defaultSchema, adfStage = 'f
|
|
|
342
342
|
break;
|
|
343
343
|
}
|
|
344
344
|
|
|
345
|
+
case 'mediaInline':
|
|
346
|
+
{
|
|
347
|
+
let mediaId = '';
|
|
348
|
+
let mediaCollection = [];
|
|
349
|
+
|
|
350
|
+
if (attrs) {
|
|
351
|
+
const {
|
|
352
|
+
id,
|
|
353
|
+
collection
|
|
354
|
+
} = attrs;
|
|
355
|
+
mediaId = id;
|
|
356
|
+
mediaCollection = collection;
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
if (mediaId && mediaCollection && adfStage === 'stage0') {
|
|
360
|
+
return {
|
|
361
|
+
type,
|
|
362
|
+
attrs,
|
|
363
|
+
marks
|
|
364
|
+
};
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
break;
|
|
368
|
+
}
|
|
369
|
+
|
|
345
370
|
case 'media':
|
|
346
371
|
{
|
|
347
372
|
let mediaId = '';
|
package/dist/es2019/version.json
CHANGED
package/dist/esm/in-product.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { fundamentalsTestCollection, blueLinksTestCollection, inlineSmartLinksTestCollection, blockSmartLinksTestCollection, embedSmartLinksTestCollection, mediaTestCollection, EditorPageObject } from './__tests_external__';
|
package/dist/esm/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { ADFTraversor, ErrorReporter, ZERO_WIDTH_SPACE, absoluteBreakoutWidth, browser, calcBreakoutWidth, breakoutConsts, calcTableColumnWidths, calcWideWidth, clearMeasure, compose, convertProsemirrorTableNodeToArrayOfRows, createCompareNodes, findAndTrackUnsupportedContentNodes, getAnalyticsAppearance, analyticsEventKey, getAnalyticsEventSeverity, getUnsupportedContentLevelData, UNSUPPORTED_CONTENT_LEVEL_SEVERITY_THRESHOLD_DEFAULTS, getExtensionLozengeData, getExtensionRenderer, getMarksByOrder, getModeFromTheme, getResponseEndTime, getValidContent, getValidDocument, getValidMark, getValidNode, getValidUnknownNode, hasMergedCell, isPastDate, isPerformanceAPIAvailable, isPerformanceObserverAvailable, isSameMark, isSubSupType, markOrder, measureRender, startMeasure, stopMeasure, measureTTI, getTTISeverity, TTI_SEVERITY_THRESHOLD_DEFAULTS, TTI_FROM_INVOCATION_SEVERITY_THRESHOLD_DEFAULTS, timestampToIsoFormat, timestampToString, timestampToTaskContext, timestampToUTCDate, todayTimestampInUTC, withImageLoader, canApplyAnnotationOnRange, getAnnotationIdsFromRange, SEVERITY, UNSUPPORTED_CONTENT_LEVEL_SEVERITY, shouldForceTracking, sniffUserBrowserExtensions } from './utils';
|
|
1
|
+
export { ADFTraversor, ErrorReporter, ZERO_WIDTH_SPACE, absoluteBreakoutWidth, browser, calcBreakoutWidth, breakoutConsts, calcTableColumnWidths, calcWideWidth, clearMeasure, compose, convertProsemirrorTableNodeToArrayOfRows, createCompareNodes, findAndTrackUnsupportedContentNodes, getAnalyticsAppearance, analyticsEventKey, getAnalyticsEventSeverity, getUnsupportedContentLevelData, UNSUPPORTED_CONTENT_LEVEL_SEVERITY_THRESHOLD_DEFAULTS, getExtensionLozengeData, getExtensionRenderer, getMarksByOrder, getModeFromTheme, getResponseEndTime, getValidContent, getValidDocument, getValidMark, getValidNode, getValidUnknownNode, hasMergedCell, isPastDate, isPerformanceAPIAvailable, isPerformanceObserverAvailable, isSameMark, isSubSupType, markOrder, measureRender, startMeasure, stopMeasure, measureTTI, getTTISeverity, TTI_SEVERITY_THRESHOLD_DEFAULTS, TTI_FROM_INVOCATION_SEVERITY_THRESHOLD_DEFAULTS, timestampToIsoFormat, timestampToString, timestampToTaskContext, timestampToUTCDate, todayTimestampInUTC, withImageLoader, canApplyAnnotationOnRange, getAnnotationIdsFromRange, SEVERITY, UNSUPPORTED_CONTENT_LEVEL_SEVERITY, shouldForceTracking, sniffUserBrowserExtensions, RenderCountProfiler } from './utils';
|
|
2
2
|
export { SortOrder, AnnotationUpdateEmitter, AnnotationUpdateEvent } from './types';
|
|
3
3
|
export { DefaultExtensionProvider, combineExtensionProviders, getExtensionKeyAndNodeKey, getExtensionModuleNode, getExtensionModuleNodePrivateProps, getQuickInsertItemsFromModule, getNodeRenderer, getContextualToolbarItemsFromModule, buildMenuItem, resolveImport } from './extensions';
|
|
4
4
|
export { ProviderFactory, WithProviders } from './provider-factory';
|
|
@@ -5,6 +5,8 @@ var _templateObject;
|
|
|
5
5
|
import { css } from 'styled-components';
|
|
6
6
|
import { hexToRgba, PanelType } from '@atlaskit/adf-schema';
|
|
7
7
|
import { akEditorTableCellMinWidth, blockNodesVerticalMargin } from '@atlaskit/editor-shared-styles';
|
|
8
|
+
import { akEditorCustomIconSize } from '@atlaskit/editor-shared-styles/consts';
|
|
9
|
+
import { emojiImage, emojiSprite } from '@atlaskit/emoji';
|
|
8
10
|
import * as colors from '@atlaskit/theme/colors';
|
|
9
11
|
import { themed } from '@atlaskit/theme/components';
|
|
10
12
|
import { borderRadius, gridSize } from '@atlaskit/theme/constants';
|
|
@@ -57,6 +59,7 @@ var darkTextColor = {
|
|
|
57
59
|
warning: colors.Y75,
|
|
58
60
|
error: colors.R75
|
|
59
61
|
};
|
|
62
|
+
var verticalAlignment = -((gridSize() * 3 - akEditorCustomIconSize) / 2);
|
|
60
63
|
var prefix = 'ak-editor-panel';
|
|
61
64
|
export var PanelSharedCssClassName = {
|
|
62
65
|
prefix: prefix,
|
|
@@ -70,7 +73,13 @@ export var PanelSharedSelectors = {
|
|
|
70
73
|
errorPanel: ".".concat(prefix, "[data-panel-type=").concat(PanelType.ERROR, "]"),
|
|
71
74
|
successPanel: ".".concat(prefix, "[data-panel-type=").concat(PanelType.SUCCESS, "]"),
|
|
72
75
|
noteButton: "button[aria-label=\"Note\"]",
|
|
73
|
-
removeButton: "button[aria-label=\"Remove\"]"
|
|
76
|
+
removeButton: "button[aria-label=\"Remove\"]",
|
|
77
|
+
colorPalette: "[aria-label=\"Background color\"]",
|
|
78
|
+
selectedColor: "[aria-label=\"The smell\"]",
|
|
79
|
+
removeEmojiIcon: "[aria-label=\"Remove emoji\"]",
|
|
80
|
+
emojiIcon: "[aria-label=\"editor-add-emoji\"]",
|
|
81
|
+
selectedEmoji: "[aria-label=\":grinning:\"]",
|
|
82
|
+
title: "#editor-title"
|
|
74
83
|
};
|
|
75
84
|
|
|
76
85
|
var iconDynamicStyles = function iconDynamicStyles(panelType) {
|
|
@@ -113,4 +122,4 @@ var mainDynamicStyles = function mainDynamicStyles(panelType) {
|
|
|
113
122
|
};
|
|
114
123
|
};
|
|
115
124
|
|
|
116
|
-
export var panelSharedStyles = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n .", " {\n border-radius: ", "px;\n margin: ", " 0 0;\n padding: ", "px;\n min-width: ", "px;\n display: flex;\n align-items: baseline;\n word-break: break-word;\n\n ", "\n\n .", " {\n
|
|
125
|
+
export var panelSharedStyles = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n .", " {\n border-radius: ", "px;\n margin: ", " 0 0;\n padding: ", "px;\n min-width: ", "px;\n display: flex;\n position: relative;\n align-items: baseline;\n word-break: break-word;\n\n ", "\n\n .", " {\n flex-shrink: 0;\n height: ", "px;\n width: ", "px;\n box-sizing: content-box;\n padding-right: ", "px;\n text-align: center;\n user-select: none;\n -moz-user-select: none;\n -webkit-user-select: none;\n -ms-user-select: none;\n ", "\n\n > span {\n vertical-align: middle;\n display: inline;\n }\n\n .", ", .", " {\n vertical-align: ", "px;\n }\n }\n\n .ak-editor-panel__content {\n margin: 1px 0 1px;\n flex: 1 0 0;\n /*\n https://ishadeed.com/article/min-max-css/#setting-min-width-to-zero-with-flexbox\n The default value for min-width is auto, which is computed to zero. When an element is a flex item, the value of min-width doesn\u2019t compute to zero. The minimum size of a flex item is equal to the size of its contents.\n */\n min-width: 0;\n }\n\n &[data-panel-type='", "'] {\n ", "\n\n .", " {\n ", "\n }\n }\n\n &[data-panel-type='", "'] {\n ", "\n\n .", " {\n ", "\n }\n }\n\n &[data-panel-type='", "'] {\n ", "\n\n .", " {\n ", "\n }\n }\n\n &[data-panel-type='", "'] {\n ", "\n\n .", " {\n ", "\n }\n }\n\n &[data-panel-type='", "'] {\n ", "\n\n .", " {\n ", "\n }\n }\n }\n"])), PanelSharedCssClassName.prefix, borderRadius(), blockNodesVerticalMargin, gridSize(), akEditorTableCellMinWidth, mainDynamicStyles(PanelType.INFO), PanelSharedCssClassName.icon, gridSize() * 3, gridSize() * 3, gridSize(), iconDynamicStyles(PanelType.INFO), emojiSprite, emojiImage, verticalAlignment, PanelType.NOTE, mainDynamicStyles(PanelType.NOTE), PanelSharedCssClassName.icon, iconDynamicStyles(PanelType.NOTE), PanelType.TIP, mainDynamicStyles(PanelType.TIP), PanelSharedCssClassName.icon, iconDynamicStyles(PanelType.TIP), PanelType.WARNING, mainDynamicStyles(PanelType.WARNING), PanelSharedCssClassName.icon, iconDynamicStyles(PanelType.WARNING), PanelType.ERROR, mainDynamicStyles(PanelType.ERROR), PanelSharedCssClassName.icon, iconDynamicStyles(PanelType.ERROR), PanelType.SUCCESS, mainDynamicStyles(PanelType.SUCCESS), PanelSharedCssClassName.icon, iconDynamicStyles(PanelType.SUCCESS));
|
|
@@ -3,7 +3,7 @@ import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral
|
|
|
3
3
|
var _templateObject;
|
|
4
4
|
|
|
5
5
|
import { css } from 'styled-components';
|
|
6
|
-
import { tableCellContentDomSelector, tablePrefixSelector } from '@atlaskit/adf-schema';
|
|
6
|
+
import { tableCellContentDomSelector, tableCellSelector, tablePrefixSelector } from '@atlaskit/adf-schema';
|
|
7
7
|
import { akEditorBreakoutPadding, akEditorFullWidthLayoutWidth, akEditorTableBorder, akEditorTableBorderDark, akEditorTableNumberColumnWidth, akEditorTableToolbar, akEditorTableToolbarDark, akEditorWideLayoutWidth, getTableCellBackgroundDarkModeColors, overflowShadow } from '@atlaskit/editor-shared-styles';
|
|
8
8
|
import { DN20 } from '@atlaskit/theme/colors';
|
|
9
9
|
import { themed } from '@atlaskit/theme/components';
|
|
@@ -26,7 +26,8 @@ export var TableSharedCssClassName = {
|
|
|
26
26
|
TABLE_STICKY_WRAPPER: "".concat(tablePrefixSelector, "-sticky-wrapper"),
|
|
27
27
|
TABLE_STICKY_SENTINEL_TOP: "".concat(tablePrefixSelector, "-sticky-sentinel-top"),
|
|
28
28
|
TABLE_STICKY_SENTINEL_BOTTOM: "".concat(tablePrefixSelector, "-sticky-sentinel-bottom"),
|
|
29
|
-
TABLE_CELL_NODEVIEW_CONTENT_DOM: tableCellContentDomSelector
|
|
29
|
+
TABLE_CELL_NODEVIEW_CONTENT_DOM: tableCellContentDomSelector,
|
|
30
|
+
TABLE_CELL_WRAPPER: tableCellSelector
|
|
30
31
|
};
|
|
31
32
|
var tableSharedStyle = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n .", " {\n position: relative;\n margin: 0 auto ", "px;\n box-sizing: border-box;\n\n /**\n * Fix block top alignment inside table cells.\n */\n .decisionItemView-content-wrap:first-child > div {\n margin-top: 0;\n }\n }\n .", "[data-number-column='true'] {\n padding-left: ", "px;\n }\n /* avoid applying styles to nested tables (possible via extensions) */\n .", " > table,\n .", " > table,\n .", " > table {\n border-collapse: collapse;\n margin: ", "px ", "px 0 0;\n border: ", "px solid\n ", ";\n table-layout: fixed;\n font-size: 1em;\n width: 100%;\n\n &[data-autosize='true'] {\n table-layout: auto;\n }\n\n & {\n * {\n box-sizing: border-box;\n }\n hr {\n box-sizing: content-box;\n }\n\n tbody {\n border-bottom: none;\n }\n th td {\n background-color: white;\n }\n th,\n td {\n min-width: ", "px;\n font-weight: normal;\n vertical-align: top;\n border: 1px solid\n ", ";\n border-right-width: 0;\n border-bottom-width: 0;\n padding: ", "px;\n /* https://stackoverflow.com/questions/7517127/borders-not-shown-in-firefox-with-border-collapse-on-table-position-relative-o */\n ", "\n\n ", ";\n\n > *:first-child {\n margin-top: 0;\n }\n\n > .ProseMirror-gapcursor.-right:first-child + * {\n margin-top: 0;\n }\n\n > .ProseMirror-gapcursor:first-child + span + * {\n margin-top: 0;\n }\n\n th p:not(:first-of-type),\n td p:not(:first-of-type) {\n margin-top: 12px;\n }\n }\n th {\n background-color: ", ";\n text-align: left;\n\n /* only apply this styling to codeblocks in default background headercells */\n /* TODO this needs to be overhauled as it relies on unsafe selectors */\n &:not([style]) {\n .code-block {\n background-image: ", ";\n background-attachment: local, scroll, scroll;\n background-position: 100% 0, 100% 0, 0 0;\n background-color: ", ";\n\n .line-number-gutter {\n background-color: ", ";\n }\n\n /* this is only relevant to the element taken care of by renderer */\n > [data-ds--code--code-block] {\n background-image: ", "!important;\n\n background-color: ", "!important;\n\n // selector lives inside @atlaskit/code\n --ds--code--line-number-bg-color: ", ";\n }\n }\n }\n }\n }\n }\n"])), TableSharedCssClassName.TABLE_CONTAINER, tableMarginBottom, TableSharedCssClassName.TABLE_CONTAINER, akEditorTableNumberColumnWidth - 1, TableSharedCssClassName.TABLE_CONTAINER, TableSharedCssClassName.TABLE_NODE_WRAPPER, TableSharedCssClassName.TABLE_STICKY_WRAPPER, tableMarginTop, tableMarginSides, tableCellBorderWidth, themed({
|
|
32
33
|
light: akEditorTableBorder,
|
|
@@ -34,7 +35,7 @@ var tableSharedStyle = css(_templateObject || (_templateObject = _taggedTemplate
|
|
|
34
35
|
}), tableCellMinWidth, themed({
|
|
35
36
|
light: akEditorTableBorder,
|
|
36
37
|
dark: akEditorTableBorderDark
|
|
37
|
-
}), tableCellPadding, browser.gecko || browser.ie ? 'background-clip: padding-box;' : '', themed({
|
|
38
|
+
}), tableCellPadding, browser.gecko || browser.ie || browser.mac && browser.chrome ? 'background-clip: padding-box;' : '', themed({
|
|
38
39
|
dark: getTableCellBackgroundDarkModeColors
|
|
39
40
|
}), themed({
|
|
40
41
|
light: akEditorTableToolbar,
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export var TypeAheadAvailableNodes;
|
|
2
|
+
|
|
3
|
+
(function (TypeAheadAvailableNodes) {
|
|
4
|
+
TypeAheadAvailableNodes["EMOJI"] = "emojiTypeAhead";
|
|
5
|
+
TypeAheadAvailableNodes["MENTION"] = "mentionTypeAhead";
|
|
6
|
+
TypeAheadAvailableNodes["QUICK_INSERT"] = "quickInsertTypeAhead";
|
|
7
|
+
})(TypeAheadAvailableNodes || (TypeAheadAvailableNodes = {}));
|
|
8
|
+
|
|
9
|
+
export var SelectItemMode;
|
|
10
|
+
|
|
11
|
+
(function (SelectItemMode) {
|
|
12
|
+
SelectItemMode["SHIFT_ENTER"] = "shift-enter";
|
|
13
|
+
SelectItemMode["ENTER"] = "enter";
|
|
14
|
+
SelectItemMode["SPACE"] = "space";
|
|
15
|
+
SelectItemMode["SELECTED"] = "selected";
|
|
16
|
+
SelectItemMode["TAB"] = "tab";
|
|
17
|
+
})(SelectItemMode || (SelectItemMode = {}));
|
|
File without changes
|