@atlaskit/editor-common 60.3.0 → 62.1.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 +105 -0
- package/card/package.json +7 -0
- package/dist/cjs/card/cardOptions.js +5 -0
- package/dist/cjs/emoji.js +23 -0
- package/dist/cjs/extensions/extension-fields-helpers.js +1 -1
- package/dist/cjs/extensions/index.js +46 -40
- package/dist/cjs/extensions/manifest-helpers.js +3 -1
- package/dist/cjs/extensions/module-helpers.js +3 -1
- package/dist/cjs/extensions/types/field-definitions.js +7 -1
- package/dist/cjs/extensions/types/index.js +14 -8
- package/dist/cjs/extensions.js +38 -32
- package/dist/cjs/i18n/index.js +26 -26
- package/dist/cjs/in-product.js +14 -14
- package/dist/cjs/index.js +330 -300
- package/dist/cjs/mention.js +23 -0
- package/dist/cjs/messages/codeBidiWarning.js +2 -2
- package/dist/cjs/messages/link.js +2 -2
- package/dist/cjs/messages/unsupportedContent.js +2 -2
- package/dist/cjs/provider-factory/context.js +1 -1
- package/dist/cjs/provider-factory.js +6 -6
- package/dist/cjs/provider-helpers/promise-helpers.js +1 -1
- package/dist/cjs/styles/index.js +90 -76
- package/dist/cjs/styles/shared/annotation.js +1 -1
- package/dist/cjs/styles/shared/media-single.js +1 -1
- package/dist/cjs/styles/shared/panel.js +90 -37
- package/dist/cjs/styles/shared/table.js +2 -2
- package/dist/cjs/styles/shared/text-color.js +17 -0
- package/dist/cjs/type-ahead/index.js +1 -1
- package/dist/cjs/types/annotation/emitter.js +1 -1
- package/dist/cjs/ufo/experience-store.js +3 -2
- package/dist/cjs/ufo/index.js +4 -4
- package/dist/cjs/ui/BaseTheme/index.js +2 -2
- package/dist/cjs/ui/Caption/index.js +2 -2
- package/dist/cjs/ui/Caption/messages.js +2 -2
- package/dist/cjs/ui/Expand/index.js +3 -3
- package/dist/cjs/ui/IntlLegacyFallbackProvider/index.js +60 -0
- package/dist/cjs/ui/IntlNextErrorBoundary/index.js +90 -0
- package/dist/cjs/ui/LegacyToNextIntlProvider/index.js +67 -0
- package/dist/cjs/ui/MediaSingle/grid.js +2 -2
- package/dist/cjs/ui/MediaSingle/index.js +2 -1
- package/dist/cjs/ui/MediaSingle/styled.js +1 -1
- package/dist/cjs/ui/Messages/index.js +1 -1
- package/dist/cjs/ui/Popup/index.js +1 -1
- package/dist/cjs/ui/Popup/utils.js +5 -5
- package/dist/cjs/ui/UnsupportedBlock/index.js +2 -2
- package/dist/cjs/ui/UnsupportedInline/index.js +2 -2
- package/dist/cjs/ui/WidthProvider/index.js +2 -2
- package/dist/cjs/ui/index.js +92 -62
- package/dist/cjs/utils/analytics.js +6 -5
- package/dist/cjs/utils/breakout.js +1 -1
- package/dist/cjs/utils/compareNodes.js +6 -0
- package/dist/cjs/utils/date.js +3 -4
- package/dist/cjs/utils/index.js +123 -109
- package/dist/cjs/utils/performance/measure-tti.js +2 -2
- package/dist/cjs/utils/performance/measure.js +1 -1
- package/dist/cjs/utils/table.js +1 -1
- package/dist/cjs/utils/validate-using-spec.js +1 -1
- package/dist/cjs/utils/validator.js +13 -16
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/card/cardOptions.js +1 -0
- package/dist/es2019/emoji.js +2 -0
- package/dist/es2019/extensions/index.js +1 -1
- package/dist/es2019/extensions/types/field-definitions.js +3 -0
- package/dist/es2019/extensions/types/index.js +1 -1
- package/dist/es2019/extensions.js +1 -1
- package/dist/es2019/index.js +26 -8
- package/dist/es2019/mention.js +2 -0
- package/dist/es2019/messages/codeBidiWarning.js +1 -1
- package/dist/es2019/messages/link.js +1 -1
- package/dist/es2019/messages/unsupportedContent.js +1 -1
- package/dist/es2019/styles/index.js +5 -2
- package/dist/es2019/styles/shared/media-single.js +10 -0
- package/dist/es2019/styles/shared/panel.js +97 -38
- package/dist/es2019/styles/shared/table.js +1 -0
- package/dist/es2019/styles/shared/text-color.js +10 -0
- package/dist/es2019/ufo/experience-store.js +2 -1
- package/dist/es2019/ui/Caption/index.js +1 -1
- package/dist/es2019/ui/Caption/messages.js +1 -1
- package/dist/es2019/ui/Expand/index.js +1 -1
- package/dist/es2019/ui/IntlLegacyFallbackProvider/index.js +21 -0
- package/dist/es2019/ui/IntlNextErrorBoundary/index.js +43 -0
- package/dist/es2019/ui/LegacyToNextIntlProvider/index.js +24 -0
- package/dist/es2019/ui/UnsupportedBlock/index.js +1 -1
- package/dist/es2019/ui/UnsupportedInline/index.js +1 -1
- package/dist/es2019/ui/index.js +12 -4
- package/dist/es2019/utils/compareNodes.js +6 -0
- package/dist/es2019/utils/date.js +2 -3
- package/dist/es2019/utils/index.js +2 -1
- package/dist/es2019/utils/validator.js +11 -13
- package/dist/es2019/version.json +1 -1
- package/dist/esm/card/cardOptions.js +1 -0
- package/dist/esm/emoji.js +2 -0
- package/dist/esm/extensions/index.js +1 -1
- package/dist/esm/extensions/types/field-definitions.js +3 -0
- package/dist/esm/extensions/types/index.js +1 -1
- package/dist/esm/extensions.js +1 -1
- package/dist/esm/index.js +26 -8
- package/dist/esm/mention.js +2 -0
- package/dist/esm/messages/codeBidiWarning.js +1 -1
- package/dist/esm/messages/link.js +1 -1
- package/dist/esm/messages/unsupportedContent.js +1 -1
- package/dist/esm/styles/index.js +5 -2
- package/dist/esm/styles/shared/media-single.js +1 -1
- package/dist/esm/styles/shared/panel.js +84 -37
- package/dist/esm/styles/shared/table.js +1 -1
- package/dist/esm/styles/shared/text-color.js +6 -0
- package/dist/esm/ufo/experience-store.js +2 -1
- package/dist/esm/ui/Caption/index.js +1 -1
- package/dist/esm/ui/Caption/messages.js +1 -1
- package/dist/esm/ui/Expand/index.js +1 -1
- package/dist/esm/ui/IntlLegacyFallbackProvider/index.js +45 -0
- package/dist/esm/ui/IntlNextErrorBoundary/index.js +73 -0
- package/dist/esm/ui/LegacyToNextIntlProvider/index.js +51 -0
- package/dist/esm/ui/UnsupportedBlock/index.js +1 -1
- package/dist/esm/ui/UnsupportedInline/index.js +1 -1
- package/dist/esm/ui/index.js +12 -4
- package/dist/esm/utils/compareNodes.js +6 -0
- package/dist/esm/utils/date.js +2 -3
- package/dist/esm/utils/index.js +2 -1
- package/dist/esm/utils/validator.js +12 -15
- package/dist/esm/version.json +1 -1
- package/dist/types/card/cardOptions.d.ts +9 -0
- package/dist/types/card/index.d.ts +1 -9
- package/dist/types/collab.d.ts +1 -1
- package/dist/types/emoji.d.ts +3 -0
- package/dist/types/extensions/index.d.ts +1 -1
- package/dist/types/extensions/types/extension-handler.d.ts +7 -2
- package/dist/types/extensions/types/extension-parameters.d.ts +1 -0
- package/dist/types/extensions/types/field-definitions.d.ts +2 -0
- package/dist/types/extensions/types/index.d.ts +1 -1
- package/dist/types/extensions.d.ts +1 -1
- package/dist/types/index.d.ts +6 -2
- package/dist/types/mention.d.ts +2 -0
- package/dist/types/provider-factory.d.ts +1 -0
- package/dist/types/styles/index.d.ts +2 -1
- package/dist/types/styles/shared/panel.d.ts +2 -0
- package/dist/types/styles/shared/text-color.d.ts +1 -0
- package/dist/types/ufo/experience-store.d.ts +3 -2
- package/dist/types/ui/Caption/index.d.ts +4 -4
- package/dist/types/ui/IntlLegacyFallbackProvider/index.d.ts +8 -0
- package/dist/types/ui/IntlNextErrorBoundary/index.d.ts +15 -0
- package/dist/types/ui/LegacyToNextIntlProvider/index.d.ts +8 -0
- package/dist/types/ui/UnsupportedBlock/index.d.ts +3 -3
- package/dist/types/ui/UnsupportedInline/index.d.ts +3 -3
- package/dist/types/ui/index.d.ts +3 -0
- package/dist/types/ui/unsupported-content-helper.d.ts +2 -2
- package/dist/types/utils/date.d.ts +3 -3
- package/dist/types/utils/index.d.ts +1 -0
- package/emoji/package.json +7 -0
- package/mention/package.json +7 -0
- package/package.json +30 -19
- package/provider-helpers/package.json +7 -0
- package/types/package.json +7 -0
- package/ui/package.json +7 -0
- package/utils/package.json +7 -0
package/dist/es2019/index.js
CHANGED
|
@@ -1,9 +1,27 @@
|
|
|
1
|
-
|
|
2
|
-
export {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
export {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
export {
|
|
1
|
+
// new child entry point ./utils/index.ts
|
|
2
|
+
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'; // new child entry point ./utils/index.ts
|
|
3
|
+
|
|
4
|
+
// new child entry point ./types/index.ts
|
|
5
|
+
export { SortOrder, AnnotationUpdateEmitter, AnnotationUpdateEvent } from './types'; // new child entry point ./types/index.ts
|
|
6
|
+
|
|
7
|
+
// already exported by ./extensions.ts
|
|
8
|
+
export { DefaultExtensionProvider, combineExtensionProviders, getExtensionKeyAndNodeKey, getExtensionModuleNode, getExtensionModuleNodePrivateProps, getQuickInsertItemsFromModule, getNodeRenderer, getContextualToolbarItemsFromModule, buildMenuItem, resolveImport } from './extensions'; // already exported by ./extensions.ts
|
|
9
|
+
|
|
10
|
+
// already exported by ./provider-factory.ts
|
|
11
|
+
export { ProviderFactory, WithProviders } from './provider-factory'; // already exported by ./provider-factory.ts
|
|
12
|
+
|
|
13
|
+
// new child entry point ./provider-helpers/index.ts
|
|
14
|
+
export { combineProviders } from './provider-helpers'; // already exported by ./styles/index.ts
|
|
15
|
+
|
|
16
|
+
export { TableSharedCssClassName, blockMarksSharedStyles, blockquoteSharedStyles, calcTableWidth, codeMarkSharedStyles, columnLayoutSharedStyle, dateSharedStyle, DateSharedCssClassName, annotationSharedStyles, AnnotationSharedCSSByState, AnnotationSharedClassNames, headingsSharedStyles, indentationSharedStyles, inlineNodeSharedStyle, linkSharedStyle, listsSharedStyles, richMediaClassName, mediaSingleSharedStyle, getPanelTypeBackground, getPanelBackgroundDarkModeColors, panelSharedStyles, PanelSharedCssClassName, PanelSharedSelectors, paragraphSharedStyles, ruleSharedStyles, shadowSharedStyle, tableCellBorderWidth, tableCellMinWidth, tableCellPadding, tableMarginBottom, tableMarginSides, tableMarginTop, tableNewColumnMinWidth, tableResizeHandleWidth, tableSharedStyle, tasksAndDecisionsStyles, TaskDecisionSharedCssClassName, whitespaceSharedStyles, MentionSharedCssClassName, //exported from ./src/mention.ts
|
|
17
|
+
EmojiSharedCssClassName, //exported from ./src/emoji.ts
|
|
18
|
+
StatusSharedCssClassName, smartCardSharedStyles, SmartCardSharedCssClassName } from './styles'; // new child entry point ./ui/index.tsx
|
|
19
|
+
|
|
20
|
+
export { BaseTheme, Caption, ClearNextSiblingMarginTop, DEFAULT_IMAGE_HEIGHT, DEFAULT_IMAGE_WIDTH, Emoji, //exported from ./src/emoji.ts
|
|
21
|
+
ErrorMessage, ExpandIconWrapper, ExpandLayoutWrapper, HelperMessage, MediaSingle, MediaSingleDimensionHelper, Mention, //exported from ./src/mention.ts
|
|
22
|
+
Popup, UnsupportedBlock, UnsupportedInline, ValidMessage, WidthConsumer, WidthProvider, WithCreateAnalyticsEvent, calcColumnsFromPx, calcPctFromPx, calcPxFromColumns, calcPxFromPct, expandMessages, findOverflowScrollParent, getBreakpoint, layoutSupportsWidth, mapBreakpointToLayoutMaxWidth, overflowShadow, shadowClassNames, sharedExpandStyles, snapToGrid, withOuterListeners, MediaLink, wrappedLayouts, shouldAddDefaultWrappedWidth, IntlNextErrorBoundary, REACT_INTL_ERROR_MESSAGE, IntlLegacyFallbackProvider, LegacyToNextIntlProvider } from './ui'; // new child entry point ./ui/index.tsx
|
|
23
|
+
|
|
24
|
+
// already exported by ./messages/index.ts
|
|
25
|
+
export { linkMessages } from './messages/link'; // new child entry point in ./utils/index.ts
|
|
26
|
+
|
|
9
27
|
export { validateADFEntity, validationErrorHandler } from './utils/validate-using-spec';
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
+
export { textColorStyles } from './shared/text-color';
|
|
1
2
|
export { tableSharedStyle, tableMarginTop, tableMarginBottom, tableMarginSides, tableCellMinWidth, tableNewColumnMinWidth, tableCellBorderWidth, calcTableWidth, TableSharedCssClassName, tableResizeHandleWidth, tableCellPadding } from './shared/table';
|
|
2
3
|
export { AnnotationSharedClassNames, AnnotationSharedCSSByState, annotationSharedStyles } from './shared/annotation';
|
|
3
4
|
export { columnLayoutSharedStyle } from './shared/column-layout';
|
|
4
5
|
export { mediaSingleSharedStyle, richMediaClassName } from './shared/media-single';
|
|
5
6
|
export { blockquoteSharedStyles } from './shared/blockquote';
|
|
6
7
|
export { headingsSharedStyles } from './shared/headings';
|
|
7
|
-
export { getPanelTypeBackground, panelSharedStyles, PanelSharedCssClassName, PanelSharedSelectors } from './shared/panel';
|
|
8
|
+
export { getPanelTypeBackground, panelSharedStyles, PanelSharedCssClassName, PanelSharedSelectors, getPanelBackgroundDarkModeColors } from './shared/panel';
|
|
8
9
|
export { ruleSharedStyles } from './shared/rule';
|
|
9
10
|
export { whitespaceSharedStyles } from './shared/whitespace';
|
|
10
11
|
export { paragraphSharedStyles } from './shared/paragraph';
|
|
@@ -16,7 +17,9 @@ export { blockMarksSharedStyles } from './shared/block-marks';
|
|
|
16
17
|
export { codeMarkSharedStyles } from './shared/code-mark';
|
|
17
18
|
export { shadowSharedStyle } from './shared/shadow';
|
|
18
19
|
export { dateSharedStyle, DateSharedCssClassName } from './shared/date';
|
|
19
|
-
export { tasksAndDecisionsStyles, TaskDecisionSharedCssClassName } from './shared/task-decision';
|
|
20
|
+
export { tasksAndDecisionsStyles, TaskDecisionSharedCssClassName } from './shared/task-decision'; // TODO: ED-13875 Remove MentionSharedCssClassName and EmojiSharedCssClassName
|
|
21
|
+
// exports once root entry point for editor-common has been removed
|
|
22
|
+
|
|
20
23
|
export { MentionSharedCssClassName } from './shared/mention';
|
|
21
24
|
export { EmojiSharedCssClassName } from './shared/emoji';
|
|
22
25
|
export { StatusSharedCssClassName } from './shared/status';
|
|
@@ -14,6 +14,16 @@ const mediaSingleSharedStyle = css`
|
|
|
14
14
|
height: 0;
|
|
15
15
|
}
|
|
16
16
|
|
|
17
|
+
&.ua-firefox {
|
|
18
|
+
.mediaSingleView-content-wrap {
|
|
19
|
+
user-select: none;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.captionView-content-wrap {
|
|
23
|
+
user-select: text;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
|
|
17
27
|
.mediaSingleView-content-wrap[layout='center'] {
|
|
18
28
|
clear: both;
|
|
19
29
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { css } from 'styled-components';
|
|
2
|
-
import {
|
|
2
|
+
import { PanelType } from '@atlaskit/adf-schema';
|
|
3
3
|
import { akEditorTableCellMinWidth, blockNodesVerticalMargin } from '@atlaskit/editor-shared-styles';
|
|
4
4
|
import { akEditorCustomIconSize } from '@atlaskit/editor-shared-styles/consts';
|
|
5
5
|
import { emojiImage, emojiSprite } from '@atlaskit/emoji';
|
|
@@ -14,22 +14,67 @@ const lightPanelColor = {
|
|
|
14
14
|
warning: colors.Y50,
|
|
15
15
|
error: colors.R50
|
|
16
16
|
};
|
|
17
|
-
const
|
|
18
|
-
|
|
19
|
-
info:
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
17
|
+
const darkPanelColors = {
|
|
18
|
+
// standard panels
|
|
19
|
+
info: '#0C294F',
|
|
20
|
+
error: `#441C13`,
|
|
21
|
+
warning: `#413001`,
|
|
22
|
+
tip: `#052E21`,
|
|
23
|
+
success: `#052E21`,
|
|
24
|
+
note: `#282249`,
|
|
25
|
+
// Reds
|
|
26
|
+
R900: '#601D16',
|
|
27
|
+
// Red Saturated
|
|
28
|
+
R100S: `#FFEFEB`,
|
|
29
|
+
R300S: `#FFB5A3`,
|
|
30
|
+
R500S: `#FF6B47`,
|
|
31
|
+
R800S: `#C4320E`,
|
|
32
|
+
R1200S: `#441C13`,
|
|
33
|
+
// Yellows
|
|
34
|
+
Y900: '#533F04',
|
|
35
|
+
// Yellow Saturated
|
|
36
|
+
Y100S: `#FFF3D1`,
|
|
37
|
+
Y300S: `#FFDC7A`,
|
|
38
|
+
Y500S: `#FFC933`,
|
|
39
|
+
Y800S: `#D8A003`,
|
|
40
|
+
Y1200S: `#413001`,
|
|
41
|
+
// Greens
|
|
42
|
+
G900: '#164B35',
|
|
43
|
+
// Green Saturated
|
|
44
|
+
G100S: `#E3FCF0`,
|
|
45
|
+
G300S: `#95EEC5`,
|
|
46
|
+
G400S: `#60DCA8`,
|
|
47
|
+
G900S: `#086848`,
|
|
48
|
+
G1200S: `#052E21`,
|
|
49
|
+
// Blues
|
|
50
|
+
B900: '#09326C',
|
|
51
|
+
// Saturated Blues
|
|
52
|
+
B100S: '#E5F0FF',
|
|
53
|
+
B300S: '#A3C9FF',
|
|
54
|
+
B500S: '#4794FF',
|
|
55
|
+
B800S: '#0055CC',
|
|
56
|
+
B1200S: '#0C294F',
|
|
57
|
+
// Purples
|
|
58
|
+
P900: `#352C63`,
|
|
59
|
+
// Purple Saturated
|
|
60
|
+
P100S: `#EEEBFF`,
|
|
61
|
+
P300S: `#CCC3FE`,
|
|
62
|
+
P500S: `#A292F7`,
|
|
63
|
+
P800S: `#5E49CA`,
|
|
64
|
+
P1200S: `#282249`,
|
|
65
|
+
// Teals
|
|
66
|
+
T900: '#1D474C',
|
|
67
|
+
// Teal Saturated
|
|
68
|
+
T100S: `#DBFAFF`,
|
|
69
|
+
T300S: `#78EBFC`,
|
|
70
|
+
T400S: `#3AD6EE`,
|
|
71
|
+
T900S: `#056270`,
|
|
72
|
+
T1200S: `#0B3037`,
|
|
73
|
+
// Dark Mode Alpha
|
|
74
|
+
DNA20A: 'rgba(150, 176, 210, 0.53)',
|
|
75
|
+
DNA40A: 'rgba(134, 156, 180, 0.29)',
|
|
76
|
+
DNA80A: '#161A1D',
|
|
77
|
+
TextColor: '#D9DDE3'
|
|
33
78
|
};
|
|
34
79
|
const lightIconColor = {
|
|
35
80
|
info: colors.B400,
|
|
@@ -46,16 +91,20 @@ const darkIconColor = {
|
|
|
46
91
|
success: colors.G200,
|
|
47
92
|
warning: colors.Y100,
|
|
48
93
|
error: colors.R200
|
|
49
|
-
};
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
}
|
|
58
|
-
|
|
94
|
+
}; // New custom icons are a little smaller than predefined icons.
|
|
95
|
+
// To fix alignment issues with custom icons, vertical alignment is updated.
|
|
96
|
+
|
|
97
|
+
const panelEmojiSpriteVerticalAlignment = -(gridSize() * 3 - akEditorCustomIconSize) / 2;
|
|
98
|
+
const panelEmojiImageVerticalAlignment = panelEmojiSpriteVerticalAlignment - 1;
|
|
99
|
+
export const getPanelBackgroundDarkModeColors = [[colors.B50, darkPanelColors.B1200S], [colors.B75, darkPanelColors.B900], [colors.B100, darkPanelColors.B800S], [colors.N0, darkPanelColors.DNA80A], [colors.N20, darkPanelColors.DNA40A], [colors.N60, darkPanelColors.DNA20A], [colors.T50, darkPanelColors.T1200S], [colors.T75, darkPanelColors.T900], [colors.T100, darkPanelColors.T900S], [colors.G50, darkPanelColors.G1200S], [colors.G75, darkPanelColors.G900], [colors.G200, darkPanelColors.G900S], [colors.Y50, darkPanelColors.Y1200S], [colors.Y75, darkPanelColors.Y900], [colors.Y200, darkPanelColors.Y800S], [colors.R50, darkPanelColors.R1200S], [colors.R75, darkPanelColors.R900], [colors.R100, darkPanelColors.R800S], [colors.P50, darkPanelColors.P1200S], [colors.P75, darkPanelColors.P900], [colors.P100, darkPanelColors.P800S]].map(([colorName, colorValue]) => getPanelDarkModeCSS(colorName, colorValue)).join('\n');
|
|
100
|
+
export function getPanelDarkModeCSS(colorName, colorValue) {
|
|
101
|
+
return `
|
|
102
|
+
&[data-panel-color="${colorName}"] {
|
|
103
|
+
background-color: ${colorValue} !important; // !important to override default style color
|
|
104
|
+
color: ${darkPanelColors.TextColor};
|
|
105
|
+
}
|
|
106
|
+
`;
|
|
107
|
+
}
|
|
59
108
|
const prefix = 'ak-editor-panel';
|
|
60
109
|
export const PanelSharedCssClassName = {
|
|
61
110
|
prefix,
|
|
@@ -92,7 +141,7 @@ const iconDynamicStyles = panelType => props => {
|
|
|
92
141
|
|
|
93
142
|
export const getPanelTypeBackground = (panelType, props = {}) => {
|
|
94
143
|
const light = lightPanelColor[panelType];
|
|
95
|
-
const dark =
|
|
144
|
+
const dark = darkPanelColors[panelType];
|
|
96
145
|
const background = themed({
|
|
97
146
|
light,
|
|
98
147
|
dark
|
|
@@ -102,19 +151,12 @@ export const getPanelTypeBackground = (panelType, props = {}) => {
|
|
|
102
151
|
|
|
103
152
|
const mainDynamicStyles = panelType => props => {
|
|
104
153
|
const background = getPanelTypeBackground(panelType, props);
|
|
105
|
-
const darkText = darkTextColor[panelType];
|
|
106
|
-
const darkBorder = '1px solid ' + darkPanelBorderColor[panelType];
|
|
107
|
-
const border = themed({
|
|
108
|
-
light: 'none',
|
|
109
|
-
dark: darkBorder
|
|
110
|
-
})(props);
|
|
111
154
|
const text = themed({
|
|
112
155
|
light: 'inherit',
|
|
113
|
-
dark:
|
|
156
|
+
dark: darkPanelColors.TextColor
|
|
114
157
|
})(props);
|
|
115
158
|
return `
|
|
116
159
|
background-color: ${background};
|
|
117
|
-
border: ${border};
|
|
118
160
|
color: ${text};
|
|
119
161
|
`;
|
|
120
162
|
};
|
|
@@ -150,8 +192,19 @@ export const panelSharedStyles = css`
|
|
|
150
192
|
display: inline;
|
|
151
193
|
}
|
|
152
194
|
|
|
153
|
-
.${emojiSprite}
|
|
154
|
-
vertical-align: ${
|
|
195
|
+
.${emojiSprite} {
|
|
196
|
+
vertical-align: ${panelEmojiSpriteVerticalAlignment}px;
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
.${emojiImage} {
|
|
200
|
+
vertical-align: ${panelEmojiImageVerticalAlignment}px;
|
|
201
|
+
|
|
202
|
+
// Vertical align only works for inline-block elements in Firefox
|
|
203
|
+
@-moz-document url-prefix() {
|
|
204
|
+
img {
|
|
205
|
+
display: inline-block;
|
|
206
|
+
}
|
|
207
|
+
}
|
|
155
208
|
}
|
|
156
209
|
}
|
|
157
210
|
|
|
@@ -204,5 +257,11 @@ export const panelSharedStyles = css`
|
|
|
204
257
|
${iconDynamicStyles(PanelType.SUCCESS)}
|
|
205
258
|
}
|
|
206
259
|
}
|
|
260
|
+
|
|
261
|
+
&[data-panel-type='${PanelType.CUSTOM}'] {
|
|
262
|
+
${themed({
|
|
263
|
+
dark: getPanelBackgroundDarkModeColors
|
|
264
|
+
})};
|
|
265
|
+
}
|
|
207
266
|
}
|
|
208
267
|
`;
|
|
@@ -40,6 +40,7 @@ const tableSharedStyle = css`
|
|
|
40
40
|
}
|
|
41
41
|
.${TableSharedCssClassName.TABLE_CONTAINER}[data-number-column='true'] {
|
|
42
42
|
padding-left: ${akEditorTableNumberColumnWidth - 1}px;
|
|
43
|
+
clear: both;
|
|
43
44
|
}
|
|
44
45
|
/* avoid applying styles to nested tables (possible via extensions) */
|
|
45
46
|
.${TableSharedCssClassName.TABLE_CONTAINER} > table,
|
|
@@ -13,6 +13,7 @@ export let EditorExperience;
|
|
|
13
13
|
EditorExperience["loadEditor"] = "load";
|
|
14
14
|
EditorExperience["typing"] = "type";
|
|
15
15
|
EditorExperience["interaction"] = "interact";
|
|
16
|
+
EditorExperience["editSession"] = "editSession";
|
|
16
17
|
})(EditorExperience || (EditorExperience = {}));
|
|
17
18
|
|
|
18
19
|
export const RELIABILITY_INTERVAL = 30000;
|
|
@@ -72,7 +73,7 @@ export class ExperienceStore {
|
|
|
72
73
|
success(experienceId, metadata) {
|
|
73
74
|
var _this$getActive;
|
|
74
75
|
|
|
75
|
-
(_this$getActive = this.getActive(experienceId)) === null || _this$getActive === void 0 ? void 0 : _this$getActive.success({
|
|
76
|
+
return (_this$getActive = this.getActive(experienceId)) === null || _this$getActive === void 0 ? void 0 : _this$getActive.success({
|
|
76
77
|
metadata
|
|
77
78
|
});
|
|
78
79
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import React from 'react';
|
|
3
|
-
import { injectIntl } from 'react-intl';
|
|
3
|
+
import { injectIntl } from 'react-intl-next';
|
|
4
4
|
import styled from 'styled-components';
|
|
5
5
|
import { N200, N400 } from '@atlaskit/theme/colors';
|
|
6
6
|
import { messages } from './messages';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineMessages } from 'react-intl';
|
|
1
|
+
import { defineMessages } from 'react-intl-next';
|
|
2
2
|
import styled, { css } from 'styled-components';
|
|
3
3
|
import { akEditorLineHeight, akEditorSwoopCubicBezier, akLayoutGutterOffset, relativeFontSizeToBase16 } from '@atlaskit/editor-shared-styles';
|
|
4
4
|
import * as colors from '@atlaskit/theme/colors';
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { IntlProvider, intlShape } from 'react-intl';
|
|
4
|
+
export class IntlLegacyFallbackProvider extends React.Component {
|
|
5
|
+
render() {
|
|
6
|
+
const oldIntl = this.context.intl;
|
|
7
|
+
|
|
8
|
+
if (!oldIntl) {
|
|
9
|
+
return /*#__PURE__*/React.createElement(IntlProvider, {
|
|
10
|
+
locale: "en"
|
|
11
|
+
}, this.props.children);
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
return this.props.children;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
_defineProperty(IntlLegacyFallbackProvider, "contextTypes", {
|
|
20
|
+
intl: intlShape
|
|
21
|
+
});
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { IntlProvider } from 'react-intl-next';
|
|
4
|
+
export const REACT_INTL_ERROR_MESSAGE = '<IntlProvider> needs to exist in the component ancestry';
|
|
5
|
+
|
|
6
|
+
const isMissingIntlProviderInAncestryError = err => {
|
|
7
|
+
var _err$toString;
|
|
8
|
+
|
|
9
|
+
return err === null || err === void 0 ? void 0 : (_err$toString = err.toString()) === null || _err$toString === void 0 ? void 0 : _err$toString.includes('<IntlProvider> needs to exist in the component ancestry');
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export class IntlNextErrorBoundary extends React.Component {
|
|
13
|
+
constructor(...args) {
|
|
14
|
+
super(...args);
|
|
15
|
+
|
|
16
|
+
_defineProperty(this, "state", {
|
|
17
|
+
missingIntlProviderInAncestry: false
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
componentDidCatch(error, errorInfo) {
|
|
22
|
+
// if missing IntlProvider in ancestry, we setup a fallback IntlProvider ourselves
|
|
23
|
+
if (isMissingIntlProviderInAncestryError(error)) {
|
|
24
|
+
this.setState({
|
|
25
|
+
missingIntlProviderInAncestry: true
|
|
26
|
+
});
|
|
27
|
+
} else {
|
|
28
|
+
// else we re-propagate the non-react-intl-next error
|
|
29
|
+
throw error;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
render() {
|
|
34
|
+
if (this.state.missingIntlProviderInAncestry) {
|
|
35
|
+
return /*#__PURE__*/React.createElement(IntlProvider, {
|
|
36
|
+
locale: "en"
|
|
37
|
+
}, this.props.children);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
return this.props.children;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { intlShape } from 'react-intl';
|
|
4
|
+
import { createIntl, RawIntlProvider } from 'react-intl-next';
|
|
5
|
+
export class LegacyToNextIntlProvider extends React.Component {
|
|
6
|
+
render() {
|
|
7
|
+
const oldIntl = this.context.intl;
|
|
8
|
+
|
|
9
|
+
if (oldIntl) {
|
|
10
|
+
const nextIntl = createIntl({ ...oldIntl
|
|
11
|
+
});
|
|
12
|
+
return /*#__PURE__*/React.createElement(RawIntlProvider, {
|
|
13
|
+
value: nextIntl
|
|
14
|
+
}, this.props.children);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
return this.props.children;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
_defineProperty(LegacyToNextIntlProvider, "contextTypes", {
|
|
23
|
+
intl: intlShape
|
|
24
|
+
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { useCallback, useRef } from 'react';
|
|
2
|
-
import { injectIntl } from 'react-intl';
|
|
2
|
+
import { injectIntl } from 'react-intl-next';
|
|
3
3
|
import styled from 'styled-components';
|
|
4
4
|
import { relativeFontSizeToBase16 } from '@atlaskit/editor-shared-styles';
|
|
5
5
|
import QuestionsIcon from '@atlaskit/icon/glyph/question-circle';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { useCallback, useRef } from 'react';
|
|
2
|
-
import { injectIntl } from 'react-intl';
|
|
2
|
+
import { injectIntl } from 'react-intl-next';
|
|
3
3
|
import styled from 'styled-components';
|
|
4
4
|
import { relativeFontSizeToBase16 } from '@atlaskit/editor-shared-styles';
|
|
5
5
|
import QuestionsIcon from '@atlaskit/icon/glyph/question-circle';
|
package/dist/es2019/ui/index.js
CHANGED
|
@@ -1,10 +1,15 @@
|
|
|
1
|
-
|
|
1
|
+
// TODO: ED-13875 Remove Emoji & EmojiProps exports once root entry point for editor-common has been removed
|
|
2
|
+
export { default as Emoji } from './Emoji'; //exported from ./src/emoji.ts
|
|
3
|
+
|
|
4
|
+
//exported from ./src/emoji.ts
|
|
2
5
|
export { default as Caption } from './Caption';
|
|
3
6
|
export { default as MediaSingle, DEFAULT_IMAGE_WIDTH, DEFAULT_IMAGE_HEIGHT, wrappedLayouts, shouldAddDefaultWrappedWidth } from './MediaSingle';
|
|
4
7
|
export { MediaSingleDimensionHelper } from './MediaSingle/styled';
|
|
5
8
|
export { layoutSupportsWidth, calcPxFromColumns, calcPctFromPx, calcPxFromPct, calcColumnsFromPx, snapToGrid } from './MediaSingle/grid';
|
|
6
|
-
export { MediaLink } from './MediaSingle/link';
|
|
7
|
-
|
|
9
|
+
export { MediaLink } from './MediaSingle/link'; // TODO: ED-13875 Remove Mention export once root entry point for editor-common has been removed
|
|
10
|
+
|
|
11
|
+
export { default as Mention } from './Mention'; //exported from ./src/mention.ts
|
|
12
|
+
|
|
8
13
|
export { default as Popup, findOverflowScrollParent } from './Popup';
|
|
9
14
|
export { default as UnsupportedBlock } from './UnsupportedBlock';
|
|
10
15
|
export { default as UnsupportedInline } from './UnsupportedInline';
|
|
@@ -15,4 +20,7 @@ export { default as overflowShadow, shadowClassNames } from './OverflowShadow';
|
|
|
15
20
|
export { WithCreateAnalyticsEvent } from './WithCreateAnalyticsEvent';
|
|
16
21
|
export { messages as expandMessages, sharedExpandStyles, ExpandIconWrapper, ExpandLayoutWrapper } from './Expand';
|
|
17
22
|
export { ErrorMessage, HelperMessage, ValidMessage } from './Messages';
|
|
18
|
-
export { ClearNextSiblingMarginTop } from './clear-next-sibling-margin-top';
|
|
23
|
+
export { ClearNextSiblingMarginTop } from './clear-next-sibling-margin-top';
|
|
24
|
+
export { IntlNextErrorBoundary, REACT_INTL_ERROR_MESSAGE } from './IntlNextErrorBoundary';
|
|
25
|
+
export { IntlLegacyFallbackProvider } from './IntlLegacyFallbackProvider';
|
|
26
|
+
export { LegacyToNextIntlProvider } from './LegacyToNextIntlProvider';
|
|
@@ -128,6 +128,12 @@ function compareValue(valueA, valueB) {
|
|
|
128
128
|
return 0;
|
|
129
129
|
}
|
|
130
130
|
|
|
131
|
+
if (typeof valueA === 'string' && typeof valueB === 'string') {
|
|
132
|
+
return valueA.localeCompare(valueB, window.navigator.language, {
|
|
133
|
+
caseFirst: 'upper'
|
|
134
|
+
});
|
|
135
|
+
}
|
|
136
|
+
|
|
131
137
|
return valueA > valueB ? 1 : -1;
|
|
132
138
|
}
|
|
133
139
|
/**
|
|
@@ -70,9 +70,8 @@ export const timestampToTaskContext = (timestamp, intl) => {
|
|
|
70
70
|
const sameYear = givenDate.getUTCFullYear() === curDate.getUTCFullYear();
|
|
71
71
|
|
|
72
72
|
if (intl && [-1, 0, 1].indexOf(distance) > -1) {
|
|
73
|
-
return capitalizeFirstLetter(intl.
|
|
74
|
-
|
|
75
|
-
now: Number(todayTimestampInUTC())
|
|
73
|
+
return capitalizeFirstLetter(intl.formatRelativeTime(distance, 'day', {
|
|
74
|
+
numeric: 'auto'
|
|
76
75
|
}));
|
|
77
76
|
}
|
|
78
77
|
|
|
@@ -22,4 +22,5 @@ export { ZERO_WIDTH_SPACE } from './whitespace';
|
|
|
22
22
|
export { shouldForceTracking } from './should-force-tracking';
|
|
23
23
|
export { getModeFromTheme } from './getModeFromTheme';
|
|
24
24
|
export { sniffUserBrowserExtensions } from './browser-extensions';
|
|
25
|
-
export { RenderCountProfiler } from './profiler/render-count';
|
|
25
|
+
export { RenderCountProfiler } from './profiler/render-count';
|
|
26
|
+
export { validateADFEntity, validationErrorHandler } from './validate-using-spec';
|
|
@@ -8,7 +8,7 @@ export const ADFStages = {
|
|
|
8
8
|
* It's important that this order follows the marks rank defined here:
|
|
9
9
|
* https://product-fabric.atlassian.net/wiki/spaces/E/pages/11174043/Document+structure#Documentstructure-Rank
|
|
10
10
|
*/
|
|
11
|
-
export const markOrder = ['link', 'em', 'strong', 'textColor', 'strike', 'subsup', 'underline', 'code', 'confluenceInlineComment', 'annotation', 'dataConsumer'];
|
|
11
|
+
export const markOrder = ['fragment', 'link', 'em', 'strong', 'textColor', 'strike', 'subsup', 'underline', 'code', 'confluenceInlineComment', 'annotation', 'dataConsumer'];
|
|
12
12
|
export const isSubSupType = type => {
|
|
13
13
|
return type === 'sub' || type === 'sup';
|
|
14
14
|
};
|
|
@@ -332,7 +332,7 @@ export const getValidNode = (originalNode, schema = defaultSchema, adfStage = 'f
|
|
|
332
332
|
|
|
333
333
|
case 'caption':
|
|
334
334
|
{
|
|
335
|
-
if (content
|
|
335
|
+
if (content) {
|
|
336
336
|
return {
|
|
337
337
|
type,
|
|
338
338
|
content
|
|
@@ -631,20 +631,10 @@ export const getValidNode = (originalNode, schema = defaultSchema, adfStage = 'f
|
|
|
631
631
|
{
|
|
632
632
|
if (attrs && content) {
|
|
633
633
|
const {
|
|
634
|
-
panelType
|
|
635
|
-
panelIcon,
|
|
636
|
-
panelColor
|
|
634
|
+
panelType
|
|
637
635
|
} = attrs;
|
|
638
636
|
|
|
639
637
|
if (Object.values(PanelType).includes(panelType)) {
|
|
640
|
-
// TODO: ED-10445 remove stage0 check
|
|
641
|
-
let attrs = adfStage === 'stage0' ? {
|
|
642
|
-
panelType,
|
|
643
|
-
panelIcon,
|
|
644
|
-
panelColor
|
|
645
|
-
} : {
|
|
646
|
-
panelType
|
|
647
|
-
};
|
|
648
638
|
return {
|
|
649
639
|
type,
|
|
650
640
|
attrs,
|
|
@@ -981,6 +971,14 @@ export const getValidMark = (mark, adfStage = 'final') => {
|
|
|
981
971
|
attrs
|
|
982
972
|
};
|
|
983
973
|
}
|
|
974
|
+
|
|
975
|
+
case 'fragment':
|
|
976
|
+
{
|
|
977
|
+
return {
|
|
978
|
+
type,
|
|
979
|
+
attrs
|
|
980
|
+
};
|
|
981
|
+
}
|
|
984
982
|
}
|
|
985
983
|
}
|
|
986
984
|
|
package/dist/es2019/version.json
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { isFieldset, isTabGroup, isExpand, isDateRange } from './types';
|
|
1
|
+
export { isFieldset, isTabGroup, isTabField, isExpand, isDateRange } from './types';
|
|
2
2
|
export { getExtensionKeyAndNodeKey, resolveImport } from './manifest-helpers';
|
|
3
3
|
export { default as DefaultExtensionProvider } from './default-extension-provider';
|
|
4
4
|
export { createAutoConverterRunner, getExtensionAutoConvertersFromProvider, getQuickInsertItemsFromModule, getContextualToolbarItemsFromModule, buildMenuItem } from './module-helpers';
|
|
@@ -8,6 +8,9 @@ export var isFieldset = function isFieldset(field) {
|
|
|
8
8
|
export var isTabGroup = function isTabGroup(field) {
|
|
9
9
|
return field.type === 'tab-group';
|
|
10
10
|
};
|
|
11
|
+
export var isTabField = function isTabField(field) {
|
|
12
|
+
return 'type' in field && field.type === 'tab';
|
|
13
|
+
};
|
|
11
14
|
export var isExpand = function isExpand(field) {
|
|
12
15
|
return field.type === 'expand';
|
|
13
16
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { isFieldset, isTabGroup, isExpand, isDateRange } from './field-definitions';
|
|
1
|
+
export { isFieldset, isTabGroup, isTabField, isExpand, isDateRange } from './field-definitions';
|
package/dist/esm/extensions.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { DefaultExtensionProvider, combineExtensionProviders, createAutoConverterRunner, getExtensionAutoConvertersFromProvider, getExtensionKeyAndNodeKey, getExtensionModuleNode, getQuickInsertItemsFromModule, getNodeRenderer, getExtensionModuleNodePrivateProps, getContextualToolbarItemsFromModule, resolveImport, getCustomFieldResolver, getFieldSerializer, getFieldDeserializer, isFieldset, isTabGroup, isExpand, isDateRange, getUserFieldContextProvider, buildMenuItem } from './extensions/index';
|
|
1
|
+
export { DefaultExtensionProvider, combineExtensionProviders, createAutoConverterRunner, getExtensionAutoConvertersFromProvider, getExtensionKeyAndNodeKey, getExtensionModuleNode, getQuickInsertItemsFromModule, getNodeRenderer, getExtensionModuleNodePrivateProps, getContextualToolbarItemsFromModule, resolveImport, getCustomFieldResolver, getFieldSerializer, getFieldDeserializer, isFieldset, isTabGroup, isTabField, isExpand, isDateRange, getUserFieldContextProvider, buildMenuItem } from './extensions/index';
|