@atlaskit/editor-common 71.0.3 → 72.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +78 -0
- package/dist/cjs/analytics/types/enums.js +20 -1
- package/dist/cjs/i18n/index.js +13 -5
- package/dist/cjs/i18n/languages.js +42 -0
- package/dist/cjs/keymaps/index.js +56 -6
- package/dist/cjs/styles/index.js +8 -2
- package/dist/cjs/styles/shared/annotation.js +9 -14
- package/dist/cjs/styles/shared/block-marks.js +1 -1
- package/dist/cjs/styles/shared/blockquote.js +1 -3
- package/dist/cjs/styles/shared/code-block.js +13 -16
- package/dist/cjs/styles/shared/code-mark.js +2 -4
- package/dist/cjs/styles/shared/lists.js +55 -4
- package/dist/cjs/styles/shared/panel.js +29 -39
- package/dist/cjs/styles/shared/rule.js +2 -4
- package/dist/cjs/styles/shared/shadow.js +1 -1
- package/dist/cjs/styles/shared/table.js +24 -26
- package/dist/cjs/types/next-editor-plugin.js +5 -0
- package/dist/cjs/ui/Caption/index.js +2 -4
- package/dist/cjs/ui/DropList/index.js +5 -7
- package/dist/cjs/ui/Emoji/index.js +11 -2
- package/dist/cjs/ui/Expand/index.js +17 -19
- package/dist/cjs/ui/Messages/index.js +3 -5
- package/dist/cjs/ui/Popup/index.js +72 -2
- package/dist/cjs/ui/Popup/utils.js +13 -6
- package/dist/cjs/ui/UnsupportedBlock/index.js +3 -5
- package/dist/cjs/ui/UnsupportedInline/index.js +3 -5
- package/dist/cjs/ui-color/ColorPalette/Palettes/paletteMessagesTokenModeNames.js +138 -0
- package/dist/cjs/ui-color/ColorPalette/index.js +20 -2
- package/dist/cjs/ui-menu/DropdownMenu/index.js +12 -12
- package/dist/cjs/ui-menu/ToolbarButton/index.js +3 -1
- package/dist/cjs/utils/analytics.js +1 -38
- package/dist/cjs/utils/builder.js +44 -0
- package/dist/cjs/utils/compareNodes.js +86 -33
- package/dist/cjs/utils/index.js +47 -1
- package/dist/cjs/utils/list.js +47 -0
- package/dist/cjs/utils/plugin-state-factory.js +9 -9
- package/dist/cjs/utils/referentiality.js +281 -2
- package/dist/cjs/utils/track-unsupported-content.js +19 -20
- package/dist/cjs/utils/validate-using-spec.js +8 -2
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/analytics/types/enums.js +20 -1
- package/dist/es2019/i18n/index.js +4 -3
- package/dist/es2019/i18n/languages.js +34 -0
- package/dist/es2019/keymaps/index.js +48 -2
- package/dist/es2019/styles/index.js +1 -1
- package/dist/es2019/styles/shared/annotation.js +9 -13
- package/dist/es2019/styles/shared/block-marks.js +8 -1
- package/dist/es2019/styles/shared/blockquote.js +1 -2
- package/dist/es2019/styles/shared/code-block.js +18 -18
- package/dist/es2019/styles/shared/code-mark.js +2 -3
- package/dist/es2019/styles/shared/lists.js +44 -2
- package/dist/es2019/styles/shared/panel.js +29 -37
- package/dist/es2019/styles/shared/rule.js +2 -3
- package/dist/es2019/styles/shared/shadow.js +20 -6
- package/dist/es2019/styles/shared/table.js +24 -26
- package/dist/es2019/types/next-editor-plugin.js +1 -0
- package/dist/es2019/ui/Caption/index.js +2 -3
- package/dist/es2019/ui/DropList/index.js +5 -6
- package/dist/es2019/ui/Emoji/index.js +11 -2
- package/dist/es2019/ui/Expand/index.js +17 -18
- package/dist/es2019/ui/Messages/index.js +3 -4
- package/dist/es2019/ui/Popup/index.js +68 -2
- package/dist/es2019/ui/Popup/utils.js +13 -6
- package/dist/es2019/ui/UnsupportedBlock/index.js +3 -4
- package/dist/es2019/ui/UnsupportedInline/index.js +3 -4
- package/dist/es2019/ui-color/ColorPalette/Palettes/paletteMessagesTokenModeNames.js +120 -0
- package/dist/es2019/ui-color/ColorPalette/index.js +29 -13
- package/dist/es2019/ui-menu/DropdownMenu/index.js +13 -12
- package/dist/es2019/ui-menu/ToolbarButton/index.js +3 -1
- package/dist/es2019/utils/analytics.js +0 -33
- package/dist/es2019/utils/builder.js +16 -0
- package/dist/es2019/utils/compareNodes.js +79 -28
- package/dist/es2019/utils/index.js +4 -2
- package/dist/es2019/utils/list.js +31 -0
- package/dist/es2019/utils/plugin-state-factory.js +9 -9
- package/dist/es2019/utils/referentiality.js +240 -0
- package/dist/es2019/utils/track-unsupported-content.js +20 -16
- package/dist/es2019/utils/validate-using-spec.js +8 -2
- package/dist/es2019/version.json +1 -1
- package/dist/esm/analytics/types/enums.js +20 -1
- package/dist/esm/i18n/index.js +4 -3
- package/dist/esm/i18n/languages.js +34 -0
- package/dist/esm/keymaps/index.js +49 -2
- package/dist/esm/styles/index.js +1 -1
- package/dist/esm/styles/shared/annotation.js +9 -13
- package/dist/esm/styles/shared/block-marks.js +1 -1
- package/dist/esm/styles/shared/blockquote.js +1 -2
- package/dist/esm/styles/shared/code-block.js +13 -15
- package/dist/esm/styles/shared/code-mark.js +2 -3
- package/dist/esm/styles/shared/lists.js +49 -2
- package/dist/esm/styles/shared/panel.js +29 -37
- package/dist/esm/styles/shared/rule.js +2 -3
- package/dist/esm/styles/shared/shadow.js +1 -2
- package/dist/esm/styles/shared/table.js +24 -26
- package/dist/esm/types/next-editor-plugin.js +1 -0
- package/dist/esm/ui/Caption/index.js +2 -3
- package/dist/esm/ui/DropList/index.js +5 -6
- package/dist/esm/ui/Emoji/index.js +11 -2
- package/dist/esm/ui/Expand/index.js +17 -18
- package/dist/esm/ui/Messages/index.js +3 -4
- package/dist/esm/ui/Popup/index.js +73 -2
- package/dist/esm/ui/Popup/utils.js +13 -6
- package/dist/esm/ui/UnsupportedBlock/index.js +2 -3
- package/dist/esm/ui/UnsupportedInline/index.js +2 -3
- package/dist/esm/ui-color/ColorPalette/Palettes/paletteMessagesTokenModeNames.js +124 -0
- package/dist/esm/ui-color/ColorPalette/index.js +19 -3
- package/dist/esm/ui-menu/DropdownMenu/index.js +12 -11
- package/dist/esm/ui-menu/ToolbarButton/index.js +3 -1
- package/dist/esm/utils/analytics.js +0 -33
- package/dist/esm/utils/builder.js +30 -0
- package/dist/esm/utils/compareNodes.js +83 -32
- package/dist/esm/utils/index.js +4 -2
- package/dist/esm/utils/list.js +31 -0
- package/dist/esm/utils/plugin-state-factory.js +9 -9
- package/dist/esm/utils/referentiality.js +269 -0
- package/dist/esm/utils/track-unsupported-content.js +19 -20
- package/dist/esm/utils/validate-using-spec.js +8 -2
- package/dist/esm/version.json +1 -1
- package/dist/types/analytics/types/enums.d.ts +23 -4
- package/dist/types/collab/types.d.ts +1 -1
- package/dist/types/i18n/index.d.ts +4 -3
- package/dist/types/i18n/languages.d.ts +35 -0
- package/dist/types/keymaps/index.d.ts +1 -0
- package/dist/types/styles/index.d.ts +1 -1
- package/dist/types/styles/shared/lists.d.ts +3 -1
- package/dist/types/types/collab.d.ts +1 -1
- package/dist/types/types/copy-button.d.ts +4 -0
- package/dist/types/types/feature-flags.d.ts +30 -25
- package/dist/types/types/floating-toolbar.d.ts +26 -1
- package/dist/types/types/index.d.ts +2 -1
- package/dist/types/types/next-editor-plugin.d.ts +61 -0
- package/dist/types/ui/Emoji/index.d.ts +2 -0
- package/dist/types/ui/Popup/index.d.ts +19 -0
- package/dist/types/ui/Popup/utils.d.ts +3 -3
- package/dist/types/ui-color/ColorPalette/Palettes/paletteMessagesTokenModeNames.d.ts +214 -0
- package/dist/types/ui-color/ColorPalette/index.d.ts +7 -0
- package/dist/types/ui-menu/DropdownMenu/types.d.ts +1 -0
- package/dist/types/ui-menu/ToolbarButton/index.d.ts +3 -1
- package/dist/types/utils/analytics.d.ts +1 -21
- package/dist/types/utils/builder.d.ts +8 -0
- package/dist/types/utils/compareNodes.d.ts +16 -0
- package/dist/types/utils/index.d.ts +3 -1
- package/dist/types/utils/list.d.ts +10 -0
- package/dist/types/utils/plugin-state-factory.d.ts +1 -1
- package/dist/types/utils/referentiality.d.ts +4 -0
- package/dist/types/utils/track-unsupported-content.d.ts +14 -2
- package/package.json +15 -12
- package/report.api.md +1 -1
|
@@ -7,7 +7,6 @@ import { akEditorCodeFontFamily, akEditorLineHeight, akEditorTableCellMinWidth,
|
|
|
7
7
|
import { DN20, DN400, DN50, DN800, N20, N30, N400, N800 } from '@atlaskit/theme/colors';
|
|
8
8
|
import { themed } from '@atlaskit/theme/components';
|
|
9
9
|
import { borderRadius, fontSize, gridSize } from '@atlaskit/theme/constants';
|
|
10
|
-
import { token } from '@atlaskit/tokens';
|
|
11
10
|
export var CodeBlockSharedCssClassName = {
|
|
12
11
|
CODEBLOCK_CONTAINER: 'code-block',
|
|
13
12
|
CODEBLOCK_START: 'code-block--start',
|
|
@@ -18,25 +17,24 @@ export var CodeBlockSharedCssClassName = {
|
|
|
18
17
|
DS_CODEBLOCK: '[data-ds--code--code-block]'
|
|
19
18
|
};
|
|
20
19
|
export var codeBlockSharedStyles = function codeBlockSharedStyles(props) {
|
|
21
|
-
return css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n .", " {\n position: relative;\n background-color: ", ";\n border-radius: ", "px;\n margin: ", " 0 0 0;\n font-family: ", ";\n min-width: ", "px;\n cursor: pointer;\n\n --ds--code--bg-color: transparent;\n\n /* This is necessary to allow for arrow key navigation in/out of code blocks in Firefox. */\n white-space: normal;\n\n .", " {\n position: absolute;\n visibility: hidden;\n height: 1.5rem;\n top: 0px;\n left: 0px;\n }\n\n .", " {\n position: absolute;\n visibility: hidden;\n height: 1.5rem;\n bottom: 0px;\n right: 0px;\n }\n\n .", " {\n background-color: ", ";\n display: flex;\n border-radius: ", "px;\n width: 100%;\n counter-reset: line;\n overflow-x: auto;\n\n background-image: ", ";\n\n background-repeat: no-repeat;\n background-attachment: local, local, local, local, scroll, scroll;\n background-size:
|
|
22
|
-
light:
|
|
23
|
-
dark:
|
|
20
|
+
return css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n .", " {\n position: relative;\n background-color: ", ";\n border-radius: ", "px;\n margin: ", " 0 0 0;\n font-family: ", ";\n min-width: ", "px;\n cursor: pointer;\n\n --ds--code--bg-color: transparent;\n\n /* This is necessary to allow for arrow key navigation in/out of code blocks in Firefox. */\n white-space: normal;\n\n .", " {\n position: absolute;\n visibility: hidden;\n height: 1.5rem;\n top: 0px;\n left: 0px;\n }\n\n .", " {\n position: absolute;\n visibility: hidden;\n height: 1.5rem;\n bottom: 0px;\n right: 0px;\n }\n\n .", " {\n background-color: ", ";\n display: flex;\n border-radius: ", "px;\n width: 100%;\n counter-reset: line;\n overflow-x: auto;\n\n background-image: ", ";\n\n background-repeat: no-repeat;\n background-attachment: local, local, local, local, scroll, scroll, scroll,\n scroll;\n background-size: ", "px 100%, ", "px 100%,\n ", "px 100%, ", "px 100%, ", "px 100%,\n 1px 100%, ", "px 100%, 1px 100%;\n background-position: 0 0, 0 0, 100% 0, 100% 0, 100% 0, 100% 0, 0 0, 0 0;\n\n /* Be careful if refactoring this; it is needed to keep arrow key navigation in Firefox consistent with other browsers. */\n overflow-y: hidden;\n }\n\n .", " {\n flex-shrink: 0;\n text-align: right;\n background-color: ", ";\n padding: ", "px;\n position: relative;\n\n span {\n display: block;\n line-height: 0;\n font-size: 0;\n\n ::before {\n display: inline-block;\n content: counter(line);\n counter-increment: line;\n color: ", ";\n font-size: ", ";\n line-height: 1.5rem;\n }\n }\n }\n\n .", " {\n display: flex;\n flex: 1;\n\n code {\n flex-grow: 1;\n tab-size: 4;\n cursor: text;\n color: ", ";\n border-radius: ", "px;\n margin: ", "px;\n white-space: pre;\n font-size: ", ";\n line-height: 1.5rem;\n }\n }\n }\n"])), CodeBlockSharedCssClassName.CODEBLOCK_CONTAINER, "var(--ds-surface-raised, transparent)", borderRadius(), blockNodesVerticalMargin, akEditorCodeFontFamily, akEditorTableCellMinWidth, CodeBlockSharedCssClassName.CODEBLOCK_START, CodeBlockSharedCssClassName.CODEBLOCK_END, CodeBlockSharedCssClassName.CODEBLOCK_CONTENT_WRAPPER, themed({
|
|
21
|
+
light: "var(--ds-background-neutral, ".concat(N20, ")"),
|
|
22
|
+
dark: "var(--ds-background-neutral, ".concat(DN50, ")")
|
|
24
23
|
})(props), borderRadius(), overflowShadow({
|
|
25
|
-
// TODO: https://product-fabric.atlassian.net/browse/DSP-4118
|
|
26
24
|
background: themed({
|
|
27
|
-
light:
|
|
28
|
-
dark:
|
|
25
|
+
light: "var(--ds-background-neutral, ".concat(N20, ")"),
|
|
26
|
+
dark: "var(--ds-background-neutral, ".concat(DN50, ")")
|
|
29
27
|
})(props),
|
|
30
|
-
|
|
31
|
-
}), CodeBlockSharedCssClassName.CODEBLOCK_LINE_NUMBER_GUTTER, themed({
|
|
32
|
-
light:
|
|
33
|
-
dark:
|
|
28
|
+
leftCoverWidth: "".concat(gridSize() * 3, "px")
|
|
29
|
+
}), gridSize() * 3, gridSize() * 3, gridSize(), gridSize(), gridSize(), gridSize(), CodeBlockSharedCssClassName.CODEBLOCK_LINE_NUMBER_GUTTER, themed({
|
|
30
|
+
light: "var(--ds-background-neutral, ".concat(N30, ")"),
|
|
31
|
+
dark: "var(--ds-background-neutral, ".concat(DN20, ")")
|
|
34
32
|
})(props), gridSize(), themed({
|
|
35
|
-
light:
|
|
36
|
-
dark:
|
|
33
|
+
light: "var(--ds-text-subtlest, ".concat(N400, ")"),
|
|
34
|
+
dark: "var(--ds-text-subtlest, ".concat(DN400, ")")
|
|
37
35
|
})(props), relativeFontSizeToBase16(fontSize()), CodeBlockSharedCssClassName.CODEBLOCK_CONTENT, themed({
|
|
38
|
-
light:
|
|
39
|
-
dark:
|
|
36
|
+
light: "var(--ds-text, ".concat(N800, ")"),
|
|
37
|
+
dark: "var(--ds-text, ".concat(DN800, ")")
|
|
40
38
|
})(props), borderRadius(), gridSize(), relativeFontSizeToBase16(fontSize()));
|
|
41
39
|
};
|
|
42
40
|
export var codeBlockInListSafariFix = css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n ::before {\n content: ' ';\n line-height: ", ";\n }\n\n > p:first-child,\n > .code-block:first-child,\n > .ProseMirror-gapcursor:first-child + .code-block {\n margin-top: -", "em !important;\n }\n"])), akEditorLineHeight, akEditorLineHeight);
|
|
@@ -6,11 +6,10 @@ import { css } from '@emotion/react';
|
|
|
6
6
|
import { getCodeStyles } from '@atlaskit/code/inline';
|
|
7
7
|
import { DN70, N30A } from '@atlaskit/theme/colors';
|
|
8
8
|
import { getTheme, themed } from '@atlaskit/theme/components';
|
|
9
|
-
import { token } from '@atlaskit/tokens';
|
|
10
9
|
export var codeMarkSharedStyles = function codeMarkSharedStyles(props) {
|
|
11
10
|
var theme = getTheme(props);
|
|
12
11
|
return css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n .code {\n --ds--code--bg-color: ", ";\n ", "\n }\n "])), themed({
|
|
13
|
-
light:
|
|
14
|
-
dark:
|
|
12
|
+
light: "var(--ds-background-neutral, ".concat(N30A, ")"),
|
|
13
|
+
dark: "var(--ds-background-neutral, ".concat(DN70, ")")
|
|
15
14
|
})(props), getCodeStyles(theme));
|
|
16
15
|
};
|
|
@@ -1,9 +1,56 @@
|
|
|
1
1
|
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
2
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
3
|
+
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
2
4
|
|
|
3
5
|
var _templateObject;
|
|
4
6
|
|
|
5
7
|
import { css } from '@emotion/react';
|
|
6
8
|
import { bulletListSelector, orderedListSelector } from '@atlaskit/adf-schema';
|
|
7
9
|
import browser from '../../utils/browser';
|
|
8
|
-
export var
|
|
9
|
-
|
|
10
|
+
export var listItemCounterPadding = 24;
|
|
11
|
+
var CSS_VAR_NAMES;
|
|
12
|
+
|
|
13
|
+
(function (CSS_VAR_NAMES) {
|
|
14
|
+
CSS_VAR_NAMES["ITEM_COUNTER_PADDING"] = "--ed--list--item-counter--padding";
|
|
15
|
+
})(CSS_VAR_NAMES || (CSS_VAR_NAMES = {}));
|
|
16
|
+
|
|
17
|
+
var getItemCounterLeftPadding = function getItemCounterLeftPadding(itemCounterDigitsSize) {
|
|
18
|
+
// Previous padding-left was approximately 24px. We approximate that
|
|
19
|
+
// same value using "ch" units (which represent the width of a "0" digit
|
|
20
|
+
// character). We use "ch" so that this computed padding can now grow if
|
|
21
|
+
// the font-size ever enlarges.
|
|
22
|
+
var paddingLeft = "2.385ch";
|
|
23
|
+
|
|
24
|
+
if (itemCounterDigitsSize >= 3) {
|
|
25
|
+
// When there are 3 or more digits, we use a combination of "ch" units and
|
|
26
|
+
// pixel values so that while the computed padding grows if font-size ever
|
|
27
|
+
// enlarges, it doesn't over-scale with each digit (because of the fixed pixel
|
|
28
|
+
// portion of the computed value). This way, very large item counters will not
|
|
29
|
+
// become overly left-padded.
|
|
30
|
+
var fixedBasePx = 2;
|
|
31
|
+
paddingLeft = "calc(".concat(itemCounterDigitsSize + 1, "ch - ").concat(fixedBasePx, "px)");
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
return paddingLeft;
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
var stringifyStyle = function stringifyStyle(style) {
|
|
38
|
+
return Object.entries(style).reduce(function (str, _ref) {
|
|
39
|
+
var _ref2 = _slicedToArray(_ref, 2),
|
|
40
|
+
key = _ref2[0],
|
|
41
|
+
value = _ref2[1];
|
|
42
|
+
|
|
43
|
+
return "".concat(str).concat(key, ":").concat(value, ";");
|
|
44
|
+
}, "");
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
export function getOrderedListInlineStyles(itemCounterDigitsSize, styleFormat) {
|
|
48
|
+
var style = _defineProperty({}, CSS_VAR_NAMES.ITEM_COUNTER_PADDING, getItemCounterLeftPadding(itemCounterDigitsSize));
|
|
49
|
+
|
|
50
|
+
if (styleFormat === 'string') {
|
|
51
|
+
return stringifyStyle(style);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
return style;
|
|
55
|
+
}
|
|
56
|
+
export var listsSharedStyles = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n /* =============== INDENTATION SPACING ========= */\n\n ul,\n ol {\n box-sizing: border-box;\n padding-left: var(\n ", ",\n ", "px\n );\n\n /*\n Firefox does not handle empty block element inside li tag.\n If there is not block element inside li tag,\n then firefox sets inherited height to li\n However, if there is any block element and if it's empty\n (or has empty inline element) then\n firefox sets li tag height to zero.\n More details at\n https://product-fabric.atlassian.net/wiki/spaces/~455502413/pages/3149365890/ED-14110+Investigation\n */\n li p:empty,\n li p > span:empty {\n ", "\n }\n }\n\n ", ", ", " {\n /*\n Ensures list item content adheres to the list's margin instead\n of filling the entire block row. This is important to allow\n clicking interactive elements which are floated next to a list.\n\n For some history and context on this block, see PRs related to tickets.:\n @see ED-6551 - original issue.\n @see ED-7015 - follow up issue.\n @see ED-7447 - flow-root change.\n\n We use 'display: table' (old clear fix / new block formatting context hack)\n for older browsers and 'flow-root' for modern browsers.\n\n @see https://css-tricks.com/display-flow-root/\n */\n // For older browsers the do not support flow-root.\n /* stylelint-disable declaration-block-no-duplicate-properties */\n display: table;\n display: flow-root;\n /* stylelint-enable declaration-block-no-duplicate-properties */\n }\n\n /* =============== INDENTATION AESTHETICS ========= */\n\n /**\n We support nested lists up to six levels deep.\n **/\n\n /* LEGACY LISTS */\n\n ul,\n ul ul ul ul {\n list-style-type: disc;\n }\n\n ul ul,\n ul ul ul ul ul {\n list-style-type: circle;\n }\n\n ul ul ul,\n ul ul ul ul ul ul {\n list-style-type: square;\n }\n\n ol,\n ol ol ol ol {\n list-style-type: decimal;\n }\n ol ol,\n ol ol ol ol ol {\n list-style-type: lower-alpha;\n }\n ol ol ol,\n ol ol ol ol ol ol {\n list-style-type: lower-roman;\n }\n\n /* PREDICTABLE LISTS */\n\n ol[data-indent-level='1'],\n ol[data-indent-level='4'] {\n list-style-type: decimal;\n }\n\n ol[data-indent-level='2'],\n ol[data-indent-level='5'] {\n list-style-type: lower-alpha;\n }\n\n ol[data-indent-level='3'],\n ol[data-indent-level='6'] {\n list-style-type: lower-roman;\n }\n\n ul[data-indent-level='1'],\n ul[data-indent-level='4'] {\n list-style-type: disc;\n }\n\n ul[data-indent-level='2'],\n ul[data-indent-level='5'] {\n list-style-type: circle;\n }\n\n ul[data-indent-level='3'],\n ul[data-indent-level='6'] {\n list-style-type: square;\n }\n"])), CSS_VAR_NAMES.ITEM_COUNTER_PADDING, listItemCounterPadding, browser.gecko ? 'display: inline-block;' : '', orderedListSelector, bulletListSelector);
|
|
@@ -3,27 +3,17 @@ import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
|
3
3
|
|
|
4
4
|
var _templateObject, _templateObject2;
|
|
5
5
|
|
|
6
|
+
/* eslint-disable @atlaskit/design-system/ensure-design-token-usage */
|
|
6
7
|
import { css } from '@emotion/react';
|
|
7
8
|
import { PanelType } from '@atlaskit/adf-schema';
|
|
9
|
+
import { hexToEditorBackgroundPaletteColor } from '@atlaskit/editor-palette';
|
|
8
10
|
import { akEditorTableCellMinWidth, blockNodesVerticalMargin } from '@atlaskit/editor-shared-styles';
|
|
9
11
|
import { akEditorCustomIconSize } from '@atlaskit/editor-shared-styles/consts';
|
|
10
12
|
import { emojiImage, emojiSprite } from '@atlaskit/emoji';
|
|
11
13
|
import * as colors from '@atlaskit/theme/colors';
|
|
12
14
|
import { themed } from '@atlaskit/theme/components';
|
|
13
15
|
import { borderRadius, gridSize } from '@atlaskit/theme/constants';
|
|
14
|
-
|
|
15
|
-
var tokenPanelColor = {
|
|
16
|
-
info: 'color.background.information',
|
|
17
|
-
note: 'color.background.discovery',
|
|
18
|
-
tip: 'color.background.success',
|
|
19
|
-
success: 'color.background.success',
|
|
20
|
-
warning: 'color.background.warning',
|
|
21
|
-
error: 'color.background.danger'
|
|
22
|
-
};
|
|
23
|
-
var lightPanelColor = {
|
|
24
|
-
// TODO: https://product-fabric.atlassian.net/browse/DSP-4066
|
|
25
|
-
|
|
26
|
-
/* eslint-disable @atlaskit/design-system/ensure-design-token-usage */
|
|
16
|
+
var lightPanelColors = {
|
|
27
17
|
info: colors.B50,
|
|
28
18
|
note: colors.P50,
|
|
29
19
|
tip: colors.G50,
|
|
@@ -93,38 +83,44 @@ export var darkPanelColors = {
|
|
|
93
83
|
LightGray: '#5A6977',
|
|
94
84
|
TextColor: '#D9DDE3'
|
|
95
85
|
};
|
|
96
|
-
/* eslint-enable @atlaskit/design-system/ensure-design-token-usage */
|
|
97
|
-
|
|
98
86
|
var lightIconColor = {
|
|
99
|
-
info:
|
|
100
|
-
note:
|
|
101
|
-
tip:
|
|
102
|
-
success:
|
|
103
|
-
warning:
|
|
104
|
-
error:
|
|
87
|
+
info: "var(--ds-icon-information, ".concat(colors.B400, ")"),
|
|
88
|
+
note: "var(--ds-icon-discovery, ".concat(colors.P400, ")"),
|
|
89
|
+
tip: "var(--ds-icon-success, ".concat(colors.G400, ")"),
|
|
90
|
+
success: "var(--ds-icon-success, ".concat(colors.G400, ")"),
|
|
91
|
+
warning: "var(--ds-icon-warning, ".concat(colors.Y400, ")"),
|
|
92
|
+
error: "var(--ds-icon-danger, ".concat(colors.R400, ")")
|
|
105
93
|
};
|
|
106
94
|
var darkIconColor = {
|
|
107
|
-
info:
|
|
108
|
-
note:
|
|
109
|
-
tip:
|
|
110
|
-
success:
|
|
111
|
-
warning:
|
|
112
|
-
error:
|
|
95
|
+
info: "var(--ds-icon-information, ".concat(colors.B100, ")"),
|
|
96
|
+
note: "var(--ds-icon-discovery, ".concat(colors.P100, ")"),
|
|
97
|
+
tip: "var(--ds-icon-success, ".concat(colors.G200, ")"),
|
|
98
|
+
success: "var(--ds-icon-success, ".concat(colors.G200, ")"),
|
|
99
|
+
warning: "var(--ds-icon-warning, ".concat(colors.Y100, ")"),
|
|
100
|
+
error: "var(--ds-icon-danger, ".concat(colors.R200, ")")
|
|
101
|
+
};
|
|
102
|
+
var tokenDarkPanelColors = {
|
|
103
|
+
info: "var(--ds-background-information, ".concat(darkPanelColors['info'], ")"),
|
|
104
|
+
note: "var(--ds-background-discovery, ".concat(darkPanelColors['note'], ")"),
|
|
105
|
+
tip: "var(--ds-background-success, ".concat(darkPanelColors['tip'], ")"),
|
|
106
|
+
success: "var(--ds-background-success, ".concat(darkPanelColors['success'], ")"),
|
|
107
|
+
warning: "var(--ds-background-warning, ".concat(darkPanelColors['warning'], ")"),
|
|
108
|
+
error: "var(--ds-background-danger, ".concat(darkPanelColors['error'], ")")
|
|
113
109
|
}; // New custom icons are a little smaller than predefined icons.
|
|
114
110
|
// To fix alignment issues with custom icons, vertical alignment is updated.
|
|
115
111
|
|
|
116
112
|
var panelEmojiSpriteVerticalAlignment = -(gridSize() * 3 - akEditorCustomIconSize) / 2;
|
|
117
113
|
var panelEmojiImageVerticalAlignment = panelEmojiSpriteVerticalAlignment - 1; // TODO: https://product-fabric.atlassian.net/browse/DSP-4066
|
|
118
114
|
|
|
119
|
-
|
|
115
|
+
var panelDarkModeColors = [[colors.B50, darkPanelColors.B1200S], [colors.B75, darkPanelColors.B900], [colors.B100, darkPanelColors.B800S], [colors.N0, darkPanelColors.LightGray], [colors.N20, darkPanelColors.Gray], [colors.N60, darkPanelColors.DarkGray], [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]]; // used for custom panels
|
|
120
116
|
|
|
121
|
-
var panelDarkModeColors = [[colors.B50, darkPanelColors.B1200S], [colors.B75, darkPanelColors.B900], [colors.B100, darkPanelColors.B800S], [colors.N0, darkPanelColors.LightGray], [colors.N20, darkPanelColors.Gray], [colors.N60, darkPanelColors.DarkGray], [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]];
|
|
122
117
|
export var getPanelDarkColor = function getPanelDarkColor(panelColor) {
|
|
123
118
|
var colorObject = panelDarkModeColors.find(function (color) {
|
|
124
119
|
return color[0] === panelColor || color[1] === panelColor;
|
|
125
120
|
});
|
|
126
121
|
return colorObject ? colorObject[1] : darkPanelColors.B1200S;
|
|
127
|
-
};
|
|
122
|
+
}; // used for custom panels
|
|
123
|
+
|
|
128
124
|
export var getPanelBackgroundDarkModeColors = panelDarkModeColors.map(function (_ref) {
|
|
129
125
|
var _ref2 = _slicedToArray(_ref, 2),
|
|
130
126
|
colorName = _ref2[0],
|
|
@@ -180,7 +176,7 @@ var iconDynamicStyles = function iconDynamicStyles(panelType) {
|
|
|
180
176
|
|
|
181
177
|
export var getPanelTypeBackgroundNoTokens = function getPanelTypeBackgroundNoTokens(panelType) {
|
|
182
178
|
var props = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
183
|
-
var light =
|
|
179
|
+
var light = lightPanelColors[panelType];
|
|
184
180
|
var dark = darkPanelColors[panelType];
|
|
185
181
|
var background = themed({
|
|
186
182
|
light: light,
|
|
@@ -190,13 +186,9 @@ export var getPanelTypeBackgroundNoTokens = function getPanelTypeBackgroundNoTok
|
|
|
190
186
|
};
|
|
191
187
|
export var getPanelTypeBackground = function getPanelTypeBackground(panelType) {
|
|
192
188
|
var props = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
193
|
-
//
|
|
194
|
-
|
|
195
|
-
/* eslint-disable @atlaskit/design-system/no-unsafe-design-token-usage */
|
|
196
|
-
var light = token(tokenPanelColor[panelType], lightPanelColor[panelType]);
|
|
197
|
-
var dark = token(tokenPanelColor[panelType], darkPanelColors[panelType]);
|
|
198
|
-
/* eslint-disable @atlaskit/design-system/no-unsafe-design-token-usage */
|
|
189
|
+
var light = hexToEditorBackgroundPaletteColor(lightPanelColors[panelType]); // hexToEditorBackgroundPaletteColor has a light mode as a fallback color - for legacy dark mode we define the tokens locally
|
|
199
190
|
|
|
191
|
+
var dark = tokenDarkPanelColors[panelType];
|
|
200
192
|
var background = themed({
|
|
201
193
|
light: light,
|
|
202
194
|
dark: dark
|
|
@@ -6,10 +6,9 @@ import { css } from '@emotion/react';
|
|
|
6
6
|
import { akEditorLineHeight } from '@atlaskit/editor-shared-styles';
|
|
7
7
|
import { DN50, N30A } from '@atlaskit/theme/colors';
|
|
8
8
|
import { themed } from '@atlaskit/theme/components';
|
|
9
|
-
import { token } from '@atlaskit/tokens';
|
|
10
9
|
var divider = themed({
|
|
11
|
-
light:
|
|
12
|
-
dark:
|
|
10
|
+
light: "var(--ds-border, ".concat(N30A, ")"),
|
|
11
|
+
dark: "var(--ds-border, ".concat(DN50, ")")
|
|
13
12
|
}); // @see typography spreadsheet: https://docs.google.com/spreadsheets/d/1iYusRGCT4PoPfvxbJ8NrgjtfFgXLm5lpDWXzjua1W2E/edit#gid=93913128
|
|
14
13
|
|
|
15
14
|
export var ruleSharedStyles = function ruleSharedStyles(props) {
|
|
@@ -3,7 +3,6 @@ import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral
|
|
|
3
3
|
var _templateObject;
|
|
4
4
|
|
|
5
5
|
/* eslint-disable @atlaskit/design-system/ensure-design-token-usage */
|
|
6
|
-
// TODO: https://product-fabric.atlassian.net/browse/DSP-4116
|
|
7
6
|
import { css } from '@emotion/react';
|
|
8
7
|
import { akEditorShadowZIndex } from '@atlaskit/editor-shared-styles';
|
|
9
8
|
import { N40A } from '@atlaskit/theme/colors';
|
|
@@ -24,5 +23,5 @@ var shadowWidth = 8;
|
|
|
24
23
|
* background-attachment: local, local, scroll, scroll;
|
|
25
24
|
*/
|
|
26
25
|
|
|
27
|
-
var shadowSharedStyle = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n &\n .", "::before,\n .", "::after,\n .", "::before,\n .", "::after {\n display: none;\n position: absolute;\n pointer-events: none;\n z-index: ", ";\n width: ", "px;\n content: '';\n /* Scrollbar is outside the content in IE, inset in other browsers. */\n height: calc(100%);\n }\n\n & .", ", .", " {\n position: relative;\n }\n\n & .", "::before {\n background: linear-gradient(to left
|
|
26
|
+
var shadowSharedStyle = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n &\n .", "::before,\n .", "::after,\n .", "::before,\n .", "::after {\n display: none;\n position: absolute;\n pointer-events: none;\n z-index: ", ";\n width: ", "px;\n content: '';\n /* Scrollbar is outside the content in IE, inset in other browsers. */\n height: calc(100%);\n }\n\n & .", ", .", " {\n position: relative;\n }\n\n & .", "::before {\n background: linear-gradient(\n to left,\n transparent 0,\n ", " 100%\n ),\n linear-gradient(\n to right,\n ", " 0px,\n transparent 1px\n );\n top: 0px;\n left: 0;\n display: block;\n }\n\n & .", "::after {\n background: linear-gradient(\n to right,\n transparent 0,\n ", " 100%\n ),\n linear-gradient(\n to left,\n ", " 0px,\n transparent 1px\n );\n left: calc(100% - ", "px);\n top: 0px;\n display: block;\n }\n\n & .", " {\n height: 100%;\n width: 0px;\n min-width: 0px;\n }\n\n & .", " {\n height: 100%;\n width: 0px;\n min-width: 0px;\n }\n"])), shadowClassNames.RIGHT_SHADOW, shadowClassNames.RIGHT_SHADOW, shadowClassNames.LEFT_SHADOW, shadowClassNames.LEFT_SHADOW, akEditorShadowZIndex, shadowWidth, shadowClassNames.RIGHT_SHADOW, shadowClassNames.LEFT_SHADOW, shadowClassNames.LEFT_SHADOW, "var(--ds-shadow-overflow-spread, ".concat(N40A, ")"), "var(--ds-shadow-overflow-perimeter, transparent)", shadowClassNames.RIGHT_SHADOW, "var(--ds-shadow-overflow-spread, ".concat(N40A, ")"), "var(--ds-shadow-overflow-perimeter, transparent)", shadowWidth, shadowObserverClassNames.SENTINEL_LEFT, shadowObserverClassNames.SENTINEL_RIGHT);
|
|
28
27
|
export { shadowSharedStyle };
|
|
@@ -3,14 +3,12 @@ import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral
|
|
|
3
3
|
var _templateObject;
|
|
4
4
|
|
|
5
5
|
/* eslint-disable @atlaskit/design-system/ensure-design-token-usage */
|
|
6
|
-
// TODO: https://product-fabric.atlassian.net/browse/DSP-4118
|
|
7
6
|
import { css } from '@emotion/react';
|
|
8
7
|
import { tableCellContentDomSelector, tableCellSelector, tableHeaderSelector, tablePrefixSelector } from '@atlaskit/adf-schema';
|
|
9
8
|
import { akEditorBreakoutPadding, akEditorFullWidthLayoutWidth, akEditorSelectedNodeClassName, akEditorTableBorder, akEditorTableBorderDark, akEditorTableNumberColumnWidth, akEditorTableToolbar, akEditorTableToolbarDark, akEditorWideLayoutWidth, getTableCellBackgroundDarkModeColors, overflowShadow } from '@atlaskit/editor-shared-styles';
|
|
10
9
|
import { DN20 } from '@atlaskit/theme/colors';
|
|
11
10
|
import { themed } from '@atlaskit/theme/components';
|
|
12
11
|
import { gridSize } from '@atlaskit/theme/constants';
|
|
13
|
-
import { token } from '@atlaskit/tokens';
|
|
14
12
|
import browser from '../../utils/browser';
|
|
15
13
|
import { CodeBlockSharedCssClassName } from './code-block';
|
|
16
14
|
export var tableMarginTop = 24;
|
|
@@ -39,43 +37,43 @@ export var TableSharedCssClassName = {
|
|
|
39
37
|
|
|
40
38
|
var tableSharedStyle = function tableSharedStyle(props) {
|
|
41
39
|
return 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-of-type > div {\n margin-top: 0;\n }\n }\n .", "[data-number-column='true'] {\n padding-left: ", "px;\n clear: both;\n }\n .", " > table {\n margin: ", "px 0 0 0;\n }\n\n .", " > table,\n .", " > table {\n margin: ", "px ", "px 0 0;\n }\n\n /* avoid applying styles to nested tables (possible via extensions) */\n .", " > table,\n .", " > table,\n .", " > table {\n border-collapse: collapse;\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: ", ";\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:not(style),\n > style:first-child + * {\n margin-top: 0;\n }\n\n > .ProseMirror-gapcursor:first-child + *,\n > style:first-child + .ProseMirror-gapcursor + * {\n margin-top: 0;\n }\n\n > .ProseMirror-gapcursor:first-child + span + *,\n > style:first-child + .ProseMirror-gapcursor + 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]):not(.danger) {\n .", ":not(.danger) {\n background-color: ", ";\n\n :not(.", ") {\n box-shadow: 0px 0px 0px 1px\n ", ";\n }\n\n .", " {\n background-image: ", ";\n\n background-color: ", ";\n }\n\n .", " {\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_NODE_WRAPPER, tableMarginTop, TableSharedCssClassName.TABLE_CONTAINER, TableSharedCssClassName.TABLE_STICKY_WRAPPER, tableMarginTop, tableMarginSides, TableSharedCssClassName.TABLE_CONTAINER, TableSharedCssClassName.TABLE_NODE_WRAPPER, TableSharedCssClassName.TABLE_STICKY_WRAPPER, tableCellBorderWidth, themed({
|
|
42
|
-
light:
|
|
43
|
-
dark:
|
|
44
|
-
})(props),
|
|
45
|
-
light:
|
|
46
|
-
dark:
|
|
40
|
+
light: "var(--ds-border, ".concat(akEditorTableBorder, ")"),
|
|
41
|
+
dark: "var(--ds-border, ".concat(akEditorTableBorderDark, ")")
|
|
42
|
+
})(props), "var(--ds-background-neutral-subtle, white)", tableCellMinWidth, themed({
|
|
43
|
+
light: "var(--ds-border, ".concat(akEditorTableBorder, ")"),
|
|
44
|
+
dark: "var(--ds-border, ".concat(akEditorTableBorderDark, ")")
|
|
47
45
|
})(props), tableCellPadding, browser.gecko || browser.ie || browser.mac && browser.chrome ? 'background-clip: padding-box;' : '', themed({
|
|
48
46
|
dark: getTableCellBackgroundDarkModeColors
|
|
49
47
|
})(props), themed({
|
|
50
|
-
light:
|
|
51
|
-
dark:
|
|
48
|
+
light: "var(--ds-background-neutral, ".concat(akEditorTableToolbar, ")"),
|
|
49
|
+
dark: "var(--ds-background-neutral, ".concat(akEditorTableToolbarDark, ")")
|
|
52
50
|
})(props), CodeBlockSharedCssClassName.CODEBLOCK_CONTAINER, themed({
|
|
53
|
-
light:
|
|
54
|
-
dark:
|
|
55
|
-
})(props), akEditorSelectedNodeClassName,
|
|
51
|
+
light: "var(--ds-surface-raised, rgb(235, 237, 240))",
|
|
52
|
+
dark: "var(--ds-surface-raised, rgb(36, 47, 66))"
|
|
53
|
+
})(props), akEditorSelectedNodeClassName, "var(--ds-border, transparent)", CodeBlockSharedCssClassName.CODEBLOCK_CONTENT_WRAPPER, overflowShadow({
|
|
56
54
|
background: themed({
|
|
57
|
-
light:
|
|
58
|
-
dark:
|
|
55
|
+
light: "var(--ds-background-neutral, rgb(235, 237, 240))",
|
|
56
|
+
dark: "var(--ds-background-neutral, rgb(36, 47, 66))"
|
|
59
57
|
})(props),
|
|
60
|
-
|
|
58
|
+
leftCoverWidth: "".concat(gridSize() * 3, "px")
|
|
61
59
|
}), themed({
|
|
62
|
-
light:
|
|
63
|
-
dark:
|
|
60
|
+
light: "var(--ds-background-neutral, rgb(235, 237, 240))",
|
|
61
|
+
dark: "var(--ds-background-neutral, rgb(36, 47, 66))"
|
|
64
62
|
})(props), CodeBlockSharedCssClassName.CODEBLOCK_LINE_NUMBER_GUTTER, themed({
|
|
65
|
-
light:
|
|
66
|
-
dark:
|
|
63
|
+
light: "var(--ds-background-neutral, rgb(226, 229, 233))",
|
|
64
|
+
dark: "var(--ds-background-neutral, ".concat(DN20, ")")
|
|
67
65
|
})(props), overflowShadow({
|
|
68
66
|
background: themed({
|
|
69
|
-
light:
|
|
70
|
-
dark:
|
|
67
|
+
light: "var(--ds-background-neutral, rgb(235, 237, 240))",
|
|
68
|
+
dark: "var(--ds-background-neutral, rgb(36, 47, 66))"
|
|
71
69
|
})(props),
|
|
72
|
-
|
|
70
|
+
leftCoverWidth: "".concat(gridSize() * 3, "px")
|
|
73
71
|
}), themed({
|
|
74
|
-
light:
|
|
75
|
-
dark:
|
|
72
|
+
light: "var(--ds-background-neutral, rgb(235, 237, 240))",
|
|
73
|
+
dark: "var(--ds-background-neutral, rgb(36, 47, 66))"
|
|
76
74
|
})(props), themed({
|
|
77
|
-
light:
|
|
78
|
-
dark:
|
|
75
|
+
light: "var(--ds-background-neutral, rgb(226, 229, 233))",
|
|
76
|
+
dark: "var(--ds-background-neutral, ".concat(DN20, ")")
|
|
79
77
|
})(props));
|
|
80
78
|
};
|
|
81
79
|
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -17,10 +17,9 @@ import React from 'react';
|
|
|
17
17
|
import { css, jsx } from '@emotion/react';
|
|
18
18
|
import { injectIntl } from 'react-intl-next';
|
|
19
19
|
import { N200, N400 } from '@atlaskit/theme/colors';
|
|
20
|
-
import { token } from '@atlaskit/tokens';
|
|
21
20
|
import { messages } from './messages';
|
|
22
|
-
var captionWrapperStyle = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n margin-top: 8px;\n text-align: center;\n position: relative;\n color: ", ";\n"])),
|
|
23
|
-
var placeholderStyle = css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n color: ", ";\n position: absolute;\n top: 0;\n width: 100%;\n"])),
|
|
21
|
+
var captionWrapperStyle = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n margin-top: 8px;\n text-align: center;\n position: relative;\n color: ", ";\n"])), "var(--ds-text-subtle, ".concat(N400, ")"));
|
|
22
|
+
var placeholderStyle = css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n color: ", ";\n position: absolute;\n top: 0;\n width: 100%;\n"])), "var(--ds-text-subtlest, ".concat(N200, ")"));
|
|
24
23
|
export var CaptionComponent = /*#__PURE__*/function (_React$Component) {
|
|
25
24
|
_inherits(CaptionComponent, _React$Component);
|
|
26
25
|
|
|
@@ -20,10 +20,9 @@ import { createAndFireEvent, withAnalyticsContext, withAnalyticsEvents } from '@
|
|
|
20
20
|
import { DN50, DN600, N0, N50A, N60A, N900 } from '@atlaskit/theme/colors';
|
|
21
21
|
import { themed } from '@atlaskit/theme/components';
|
|
22
22
|
import { borderRadius, gridSize } from '@atlaskit/theme/constants';
|
|
23
|
-
import { token } from '@atlaskit/tokens';
|
|
24
23
|
import Layer from '../Layer';
|
|
25
24
|
var packageName = "@atlaskit/editor-common";
|
|
26
|
-
var packageVersion = "
|
|
25
|
+
var packageVersion = "72.0.1";
|
|
27
26
|
var halfFocusRing = 1;
|
|
28
27
|
var dropOffset = "0, ".concat(gridSize(), "px");
|
|
29
28
|
|
|
@@ -49,11 +48,11 @@ var DropList = /*#__PURE__*/function (_Component) {
|
|
|
49
48
|
|
|
50
49
|
_defineProperty(_assertThisInitialized(_this), "menuWrapper", function (theme) {
|
|
51
50
|
return css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n color: ", ";\n background-color: ", ";\n border-radius: ", "px;\n box-shadow: 0 ", "px ", "px -", "px ", ",\n 0 0 1px ", ";\n box-sizing: border-box;\n overflow: auto;\n padding: ", "px 0;\n max-height: 90vh;\n "])), themed({
|
|
52
|
-
light:
|
|
53
|
-
dark:
|
|
51
|
+
light: "var(--ds-text, ".concat(N900, ")"),
|
|
52
|
+
dark: "var(--ds-text, ".concat(DN600, ")")
|
|
54
53
|
})(theme), themed({
|
|
55
|
-
light:
|
|
56
|
-
dark:
|
|
54
|
+
light: "var(--ds-surface-overlay, ".concat(N0, ")"),
|
|
55
|
+
dark: "var(--ds-surface-overlay, ".concat(DN50, ")")
|
|
57
56
|
})(theme), borderRadius(), gridSize() / 2, gridSize(), gridSize() / 4, N50A, N60A, gridSize() / 2);
|
|
58
57
|
});
|
|
59
58
|
|
|
@@ -27,13 +27,16 @@ var EmojiNode = /*#__PURE__*/function (_PureComponent) {
|
|
|
27
27
|
_this = _super.call(this, props);
|
|
28
28
|
|
|
29
29
|
_defineProperty(_assertThisInitialized(_this), "renderWithProvider", function (providers) {
|
|
30
|
+
var _resourceConfig$optim;
|
|
31
|
+
|
|
30
32
|
var _this$props = _this.props,
|
|
31
33
|
allowTextFallback = _this$props.allowTextFallback,
|
|
32
34
|
shortName = _this$props.shortName,
|
|
33
35
|
id = _this$props.id,
|
|
34
36
|
fallback = _this$props.fallback,
|
|
35
37
|
fitToHeight = _this$props.fitToHeight,
|
|
36
|
-
showTooltip = _this$props.showTooltip
|
|
38
|
+
showTooltip = _this$props.showTooltip,
|
|
39
|
+
resourceConfig = _this$props.resourceConfig;
|
|
37
40
|
|
|
38
41
|
if (allowTextFallback && !providers.emojiProvider) {
|
|
39
42
|
return /*#__PURE__*/React.createElement("span", {
|
|
@@ -55,7 +58,13 @@ var EmojiNode = /*#__PURE__*/function (_PureComponent) {
|
|
|
55
58
|
},
|
|
56
59
|
emojiProvider: providers.emojiProvider,
|
|
57
60
|
showTooltip: showTooltip,
|
|
58
|
-
fitToHeight: fitToHeight
|
|
61
|
+
fitToHeight: fitToHeight,
|
|
62
|
+
optimistic: true,
|
|
63
|
+
optimisticImageURL: resourceConfig === null || resourceConfig === void 0 ? void 0 : (_resourceConfig$optim = resourceConfig.optimisticImageApi) === null || _resourceConfig$optim === void 0 ? void 0 : _resourceConfig$optim.getUrl({
|
|
64
|
+
id: id,
|
|
65
|
+
fallback: fallback,
|
|
66
|
+
shortName: shortName
|
|
67
|
+
})
|
|
59
68
|
});
|
|
60
69
|
});
|
|
61
70
|
|
|
@@ -13,7 +13,6 @@ import { akEditorLineHeight, akEditorSwoopCubicBezier, akLayoutGutterOffset, rel
|
|
|
13
13
|
import * as colors from '@atlaskit/theme/colors';
|
|
14
14
|
import { themed } from '@atlaskit/theme/components';
|
|
15
15
|
import { fontSize, gridSize } from '@atlaskit/theme/constants';
|
|
16
|
-
import { token } from '@atlaskit/tokens';
|
|
17
16
|
export var messages = defineMessages({
|
|
18
17
|
collapseNode: {
|
|
19
18
|
id: 'fabric.editor.collapseNode',
|
|
@@ -37,16 +36,16 @@ export var messages = defineMessages({
|
|
|
37
36
|
}
|
|
38
37
|
});
|
|
39
38
|
var BORDER_RADIUS = gridSize() / 2;
|
|
40
|
-
var EXPAND_COLLAPSED_BACKGROUND =
|
|
39
|
+
var EXPAND_COLLAPSED_BACKGROUND = "var(--ds-background-neutral-subtle, transparent)";
|
|
41
40
|
var EXPAND_SELECTED_BACKGROUND = themed({
|
|
42
|
-
light:
|
|
43
|
-
dark:
|
|
41
|
+
light: "var(--ds-surface, rgba(255, 255, 255, 0.6))",
|
|
42
|
+
dark: "var(--ds-surface, rgba(9, 10, 11, 0.29))"
|
|
44
43
|
});
|
|
45
|
-
var EXPAND_FOCUSED_BORDER_COLOR =
|
|
44
|
+
var EXPAND_FOCUSED_BORDER_COLOR = "var(--ds-border-focused, ".concat(colors.B300, ")");
|
|
46
45
|
var EXPAND_COLLAPSED_BORDER_COLOR = 'transparent';
|
|
47
46
|
var EXPAND_EXPANDED_BORDER_COLOR = themed({
|
|
48
|
-
light:
|
|
49
|
-
dark:
|
|
47
|
+
light: "var(--ds-border, ".concat(colors.N40A, ")"),
|
|
48
|
+
dark: "var(--ds-border, ".concat(colors.DN50, ")")
|
|
50
49
|
});
|
|
51
50
|
export var ExpandIconWrapper = function ExpandIconWrapper(_ref) {
|
|
52
51
|
var children = _ref.children,
|
|
@@ -60,9 +59,9 @@ export var ExpandIconWrapper = function ExpandIconWrapper(_ref) {
|
|
|
60
59
|
|
|
61
60
|
var expandIconWrapperStyle = function expandIconWrapperStyle(props) {
|
|
62
61
|
return css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n cursor: pointer;\n display: flex;\n color: ", ";\n border-radius: ", "px;\n width: 24px;\n height: 24px;\n\n &:hover {\n background: ", ";\n }\n\n svg {\n transition: transform 0.2s ", ";\n }\n"])), themed({
|
|
63
|
-
light:
|
|
64
|
-
dark:
|
|
65
|
-
})(props), gridSize() / 2,
|
|
62
|
+
light: "var(--ds-icon, ".concat(colors.N90, ")"),
|
|
63
|
+
dark: "var(--ds-icon, #d9dde3)"
|
|
64
|
+
})(props), gridSize() / 2, "var(--ds-background-neutral-subtle-hovered, ".concat(colors.N30A, ")"), akEditorSwoopCubicBezier);
|
|
66
65
|
};
|
|
67
66
|
|
|
68
67
|
var expandIconWrapperExpandedStyle = css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n svg {\n transform: rotate(90deg);\n }\n"])));
|
|
@@ -89,8 +88,8 @@ var containerStyles = function containerStyles(styleProps) {
|
|
|
89
88
|
var margin = "".concat(marginTop, " ").concat(marginHorizontal, " ").concat(marginBottom);
|
|
90
89
|
return function (themeProps) {
|
|
91
90
|
return css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n border-width: 1px;\n border-style: solid;\n border-color: ", ";\n border-radius: ", "px;\n min-height: 25px;\n background: ", ";\n margin: ", ";\n\n transition: background 0.3s ", ",\n border-color 0.3s ", ";\n padding: ", "px;\n\n &:hover {\n // TODO: Remove the border styles below once design tokens have been enabled and fallbacks are no longer triggered.\n // This is because the default state already uses the same token and, as such, the hover style won't change anything.\n // https://product-fabric.atlassian.net/browse/DSP-4152\n border: 1px solid\n ", ";\n background: ", ";\n }\n\n td > :not(style):first-child,\n td > style:first-child + * {\n margin-top: 0;\n }\n "])), focused ? EXPAND_FOCUSED_BORDER_COLOR : expanded ? EXPAND_EXPANDED_BORDER_COLOR(themeProps) : EXPAND_COLLAPSED_BORDER_COLOR, BORDER_RADIUS, !expanded ? EXPAND_COLLAPSED_BACKGROUND : EXPAND_SELECTED_BACKGROUND(themeProps), margin, akEditorSwoopCubicBezier, akEditorSwoopCubicBezier, gridSize(), themed({
|
|
92
|
-
light:
|
|
93
|
-
dark:
|
|
91
|
+
light: "var(--ds-border, ".concat(colors.N50A, ")"),
|
|
92
|
+
dark: "var(--ds-border, ".concat(colors.DN50, ")")
|
|
94
93
|
})(themeProps), EXPAND_SELECTED_BACKGROUND(themeProps));
|
|
95
94
|
};
|
|
96
95
|
};
|
|
@@ -103,18 +102,18 @@ var contentStyles = function contentStyles(styleProps) {
|
|
|
103
102
|
|
|
104
103
|
var titleInputStyles = function titleInputStyles(props) {
|
|
105
104
|
return css(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n outline: none;\n border: none;\n font-size: ", ";\n line-height: ", ";\n font-weight: normal;\n color: ", ";\n background: transparent;\n display: flex;\n flex: 1;\n padding: 0 0 0 ", "px;\n width: 100%;\n\n &::placeholder {\n opacity: 0.6;\n color: ", ";\n }\n"])), relativeFontSizeToBase16(fontSize()), akEditorLineHeight, themed({
|
|
106
|
-
light:
|
|
107
|
-
dark:
|
|
105
|
+
light: "var(--ds-text-subtlest, ".concat(colors.N200A, ")"),
|
|
106
|
+
dark: "var(--ds-text-subtlest, ".concat(colors.DN600, ")")
|
|
108
107
|
})(props), gridSize() / 2, themed({
|
|
109
|
-
light:
|
|
110
|
-
dark:
|
|
108
|
+
light: "var(--ds-text-subtlest, ".concat(colors.N200A, ")"),
|
|
109
|
+
dark: "var(--ds-text-subtlest, ".concat(colors.DN600, ")")
|
|
111
110
|
})(props));
|
|
112
111
|
};
|
|
113
112
|
|
|
114
113
|
var titleContainerStyles = function titleContainerStyles(props) {
|
|
115
114
|
return css(_templateObject7 || (_templateObject7 = _taggedTemplateLiteral(["\n padding: 0;\n display: flex;\n align-items: flex-start;\n background: none;\n border: none;\n font-size: ", ";\n width: 100%;\n color: ", ";\n overflow: hidden;\n cursor: pointer;\n // Prevent browser selection being inside the title container\n user-select: none;\n\n &:focus {\n outline: 0;\n }\n"])), relativeFontSizeToBase16(fontSize()), themed({
|
|
116
|
-
light:
|
|
117
|
-
dark:
|
|
115
|
+
light: "var(--ds-text-subtle, ".concat(colors.N300A, ")"),
|
|
116
|
+
dark: "var(--ds-text-subtle, ".concat(colors.DN600, ")")
|
|
118
117
|
})(props));
|
|
119
118
|
};
|
|
120
119
|
|
|
@@ -9,12 +9,11 @@ import ErrorIcon from '@atlaskit/icon/glyph/error';
|
|
|
9
9
|
import { G400, N200, R400 } from '@atlaskit/theme/colors';
|
|
10
10
|
import { gridSize } from '@atlaskit/theme/constants';
|
|
11
11
|
import { h200 } from '@atlaskit/theme/typography';
|
|
12
|
-
|
|
13
|
-
var
|
|
14
|
-
var validColor = css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n color: ", ";\n"])), token('color.text.success', G400));
|
|
12
|
+
var errorColor = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n color: ", ";\n"])), "var(--ds-text-danger, ".concat(R400, ")"));
|
|
13
|
+
var validColor = css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n color: ", ";\n"])), "var(--ds-text-success, ".concat(G400, ")"));
|
|
15
14
|
|
|
16
15
|
var messageStyle = function messageStyle(props) {
|
|
17
|
-
return css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n ", " font-weight: normal;\n color: ", ";\n margin-top: ", "px;\n display: flex;\n justify-content: baseline;\n"])), h200(props),
|
|
16
|
+
return css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n ", " font-weight: normal;\n color: ", ";\n margin-top: ", "px;\n display: flex;\n justify-content: baseline;\n"])), h200(props), "var(--ds-text-subtlest, ".concat(N200, ")"), gridSize() / 2);
|
|
18
17
|
};
|
|
19
18
|
|
|
20
19
|
var iconWrapperStyle = css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n display: flex;\n margin-right: 4px;\n"])));
|