@atlaskit/editor-common 66.0.5 → 68.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +44 -0
- package/dist/cjs/styles/shared/annotation.js +12 -7
- package/dist/cjs/styles/shared/block-marks.js +1 -1
- package/dist/cjs/styles/shared/blockquote.js +3 -1
- package/dist/cjs/styles/shared/code-mark.js +4 -2
- package/dist/cjs/styles/shared/column-layout.js +1 -1
- package/dist/cjs/styles/shared/rule.js +4 -2
- package/dist/cjs/styles/shared/shadow.js +3 -1
- package/dist/cjs/styles/shared/table.js +18 -16
- package/dist/cjs/styles/shared/task-decision.js +1 -1
- package/dist/cjs/ui/BaseTheme/index.js +4 -21
- package/dist/cjs/ui/Caption/index.js +4 -2
- package/dist/cjs/ui/Expand/index.js +20 -18
- package/dist/cjs/ui/Messages/index.js +5 -3
- package/dist/cjs/ui/OverflowShadow/index.js +49 -11
- package/dist/cjs/ui/OverflowShadow/shadowObserver.js +107 -0
- package/dist/cjs/ui/UnsupportedBlock/index.js +3 -1
- package/dist/cjs/ui/UnsupportedInline/index.js +3 -1
- package/dist/cjs/ui/index.js +14 -0
- package/dist/cjs/utils/breakout.js +2 -2
- package/dist/cjs/utils/unsupportedContent/get-unsupported-content-level-data.js +3 -3
- package/dist/cjs/utils/validate-using-spec.js +2 -2
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/styles/shared/annotation.js +17 -7
- package/dist/es2019/styles/shared/block-marks.js +1 -1
- package/dist/es2019/styles/shared/blockquote.js +3 -1
- package/dist/es2019/styles/shared/code-mark.js +3 -2
- package/dist/es2019/styles/shared/column-layout.js +1 -0
- package/dist/es2019/styles/shared/panel.js +2 -0
- package/dist/es2019/styles/shared/rule.js +3 -2
- package/dist/es2019/styles/shared/shadow.js +14 -0
- package/dist/es2019/styles/shared/table.js +22 -18
- package/dist/es2019/styles/shared/task-decision.js +1 -0
- package/dist/es2019/ui/BaseTheme/index.js +3 -21
- package/dist/es2019/ui/Caption/index.js +3 -2
- package/dist/es2019/ui/Expand/index.js +19 -17
- package/dist/es2019/ui/Messages/index.js +4 -3
- package/dist/es2019/ui/OverflowShadow/index.js +48 -12
- package/dist/es2019/ui/OverflowShadow/shadowObserver.js +82 -0
- package/dist/es2019/ui/UnsupportedBlock/index.js +3 -2
- package/dist/es2019/ui/UnsupportedInline/index.js +3 -2
- package/dist/es2019/ui/index.js +1 -0
- package/dist/es2019/utils/breakout.js +1 -1
- package/dist/es2019/utils/unsupportedContent/get-unsupported-content-level-data.js +1 -1
- package/dist/es2019/utils/validate-using-spec.js +1 -1
- package/dist/es2019/version.json +1 -1
- package/dist/esm/styles/shared/annotation.js +11 -7
- package/dist/esm/styles/shared/block-marks.js +1 -1
- package/dist/esm/styles/shared/blockquote.js +2 -1
- package/dist/esm/styles/shared/code-mark.js +3 -2
- package/dist/esm/styles/shared/column-layout.js +1 -1
- package/dist/esm/styles/shared/panel.js +2 -0
- package/dist/esm/styles/shared/rule.js +3 -2
- package/dist/esm/styles/shared/shadow.js +4 -1
- package/dist/esm/styles/shared/table.js +20 -16
- package/dist/esm/styles/shared/task-decision.js +1 -1
- package/dist/esm/ui/BaseTheme/index.js +4 -22
- package/dist/esm/ui/Caption/index.js +3 -2
- package/dist/esm/ui/Expand/index.js +19 -18
- package/dist/esm/ui/Messages/index.js +4 -3
- package/dist/esm/ui/OverflowShadow/index.js +50 -11
- package/dist/esm/ui/OverflowShadow/shadowObserver.js +98 -0
- package/dist/esm/ui/UnsupportedBlock/index.js +2 -1
- package/dist/esm/ui/UnsupportedInline/index.js +2 -1
- package/dist/esm/ui/index.js +1 -0
- package/dist/esm/utils/breakout.js +2 -2
- package/dist/esm/utils/unsupportedContent/get-unsupported-content-level-data.js +1 -1
- package/dist/esm/utils/validate-using-spec.js +1 -1
- package/dist/esm/version.json +1 -1
- package/dist/types/extensions/manifest-helpers.d.ts +1 -1
- package/dist/types/extensions/module-helpers.d.ts +1 -1
- package/dist/types/extensions/types/extension-handler.d.ts +1 -1
- package/dist/types/extensions/types/extension-manifest-toolbar-item.d.ts +1 -1
- package/dist/types/extensions/types/extension-manifest.d.ts +1 -1
- package/dist/types/extensions/types/utils.d.ts +1 -1
- package/dist/types/provider-factory/autoformatting-provider.d.ts +1 -1
- package/dist/types/ui/BaseTheme/index.d.ts +2 -4
- package/dist/types/ui/OverflowShadow/index.d.ts +10 -3
- package/dist/types/ui/OverflowShadow/shadowObserver.d.ts +27 -0
- package/dist/types/ui/index.d.ts +1 -0
- package/dist/types/utils/unsupportedContent/get-unsupported-content-level-data.d.ts +1 -1
- package/dist/types/utils/validate-using-spec.d.ts +2 -1
- package/package.json +15 -13
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,49 @@
|
|
|
1
1
|
# @atlaskit/editor-common
|
|
2
2
|
|
|
3
|
+
## 68.0.0
|
|
4
|
+
|
|
5
|
+
### Major Changes
|
|
6
|
+
|
|
7
|
+
- [`b7b72b61dca`](https://bitbucket.org/atlassian/atlassian-frontend/commits/b7b72b61dca) - ED-10337 Refactor overflow shadows using intersection observer to improve renderer performance on initial load and when scrolling contents of the tables and extensions horizontally.
|
|
8
|
+
This is affecting vertical shadows inside tables and extensions in renderer.
|
|
9
|
+
On the OverflowShadowOptions interface of the shadows component exported from editor-common we are also removing scrollableSelector option which is no longer used.
|
|
10
|
+
|
|
11
|
+
### Minor Changes
|
|
12
|
+
|
|
13
|
+
- [`8949731bc6a`](https://bitbucket.org/atlassian/atlassian-frontend/commits/8949731bc6a) - ED-14608: Migrate adf-utils imports in atlassian-frontend to new child entry points to improve treeshaking
|
|
14
|
+
|
|
15
|
+
### Patch Changes
|
|
16
|
+
|
|
17
|
+
- [`789b211a5e5`](https://bitbucket.org/atlassian/atlassian-frontend/commits/789b211a5e5) - Removed the use of :first-child and nth-child selectors in CSS
|
|
18
|
+
- [`1e5c33f7598`](https://bitbucket.org/atlassian/atlassian-frontend/commits/1e5c33f7598) - [ux] ED-14198 fix safari selection for layout
|
|
19
|
+
- [`d8b3bc73330`](https://bitbucket.org/atlassian/atlassian-frontend/commits/d8b3bc73330) - [ED-14507] Deprecate the allowDynamicTextSizing editor prop and remove all code related to it. This feature has been unused since 2020.
|
|
20
|
+
- Updated dependencies
|
|
21
|
+
|
|
22
|
+
## 67.0.1
|
|
23
|
+
|
|
24
|
+
### Patch Changes
|
|
25
|
+
|
|
26
|
+
- Updated dependencies
|
|
27
|
+
|
|
28
|
+
## 67.0.0
|
|
29
|
+
|
|
30
|
+
### Minor Changes
|
|
31
|
+
|
|
32
|
+
- [`025ee31e9bc`](https://bitbucket.org/atlassian/atlassian-frontend/commits/025ee31e9bc) - [ux] Instrumented `@atlaskit/editor-common` with the new theming package, `@atlaskit/tokens`.
|
|
33
|
+
|
|
34
|
+
New tokens will be visible only in applications configured to use the new Tokens API (currently in alpha).
|
|
35
|
+
These changes are intended to be interoperable with the legacy theme implementation. Legacy dark mode users should expect no visual or breaking change.
|
|
36
|
+
|
|
37
|
+
- [`bd24b9d71d2`](https://bitbucket.org/atlassian/atlassian-frontend/commits/bd24b9d71d2) - [ux] Instrumented `@atlaskit/renderer` with the new theming package, `@atlaskit/tokens`.
|
|
38
|
+
|
|
39
|
+
New tokens will be visible only in applications configured to use the new Tokens API (currently in alpha).
|
|
40
|
+
These changes are intended to be interoperable with the legacy theme implementation. Legacy dark mode users should expect no visual or breaking changes.
|
|
41
|
+
|
|
42
|
+
### Patch Changes
|
|
43
|
+
|
|
44
|
+
- [`facd9f48e88`](https://bitbucket.org/atlassian/atlassian-frontend/commits/facd9f48e88) - Fixed confluence inline comment missing background colour.
|
|
45
|
+
- Updated dependencies
|
|
46
|
+
|
|
3
47
|
## 66.0.5
|
|
4
48
|
|
|
5
49
|
### Patch Changes
|
|
@@ -15,6 +15,8 @@ var _colors = require("@atlaskit/theme/colors");
|
|
|
15
15
|
|
|
16
16
|
var _components = require("@atlaskit/theme/components");
|
|
17
17
|
|
|
18
|
+
var _tokens = require("@atlaskit/tokens");
|
|
19
|
+
|
|
18
20
|
var _templateObject, _templateObject2, _templateObject3;
|
|
19
21
|
|
|
20
22
|
var annotationPrefix = 'ak-editor-annotation';
|
|
@@ -34,20 +36,23 @@ var DY200 = '#82641c';
|
|
|
34
36
|
|
|
35
37
|
var AnnotationSharedCSSByState = function AnnotationSharedCSSByState(props) {
|
|
36
38
|
return {
|
|
37
|
-
|
|
39
|
+
/* eslint-disable */
|
|
40
|
+
focus: (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n // Background is not coming through in confluence, suspecting to be caused by some specific combination of\n // emotion and token look up\n\n background: ", ";\n border-bottom: 2px solid\n ", ";\n // TODO: https://product-fabric.atlassian.net/browse/DSP-4147\n box-shadow: ", ";\n cursor: pointer;\n "])), (0, _components.themed)({
|
|
38
41
|
light: _colors.Y75,
|
|
39
42
|
dark: DY75
|
|
40
43
|
})(props), (0, _components.themed)({
|
|
41
|
-
light: _colors.Y300,
|
|
42
|
-
dark: DY300
|
|
43
|
-
})(props), _colors.N60A, _colors.N60A),
|
|
44
|
-
blur: (0, _react.css)(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n background: ", ";\n border-bottom: 2px solid
|
|
44
|
+
light: (0, _tokens.token)('color.border.accent.yellow', _colors.Y300),
|
|
45
|
+
dark: (0, _tokens.token)('color.border.accent.yellow', DY300)
|
|
46
|
+
})(props), (0, _tokens.token)('elevation.shadow.overlay', "1px 2px 3px ".concat(_colors.N60A, ", -1px 2px 3px ").concat(_colors.N60A))),
|
|
47
|
+
blur: (0, _react.css)(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n background: ", ";\n border-bottom: 2px solid\n ", ";\n cursor: pointer;\n "])), (0, _components.themed)({
|
|
45
48
|
light: Y75a,
|
|
46
49
|
dark: DY75a
|
|
47
50
|
})(props), (0, _components.themed)({
|
|
48
|
-
light: Y200a,
|
|
49
|
-
dark: DY200
|
|
51
|
+
light: (0, _tokens.token)('color.border.accent.yellow', Y200a),
|
|
52
|
+
dark: (0, _tokens.token)('color.border.accent.yellow', DY200)
|
|
50
53
|
})(props))
|
|
54
|
+
/* eslint-enable */
|
|
55
|
+
|
|
51
56
|
};
|
|
52
57
|
};
|
|
53
58
|
|
|
@@ -13,5 +13,5 @@ var _react = require("@emotion/react");
|
|
|
13
13
|
|
|
14
14
|
var _templateObject;
|
|
15
15
|
|
|
16
|
-
var blockMarksSharedStyles = (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n /**\n * We need to remove margin-top from first item\n * inside doc, tableCell, tableHeader, blockquote, etc.\n */\n *:not(.fabric-editor-block-mark) >,\n /* For nested block marks */\n *:not(.fabric-editor-block-mark) > div.fabric-editor-block-mark:first-
|
|
16
|
+
var blockMarksSharedStyles = (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n /**\n * We need to remove margin-top from first item\n * inside doc, tableCell, tableHeader, blockquote, etc.\n */\n *:not(.fabric-editor-block-mark) >,\n /* For nested block marks */\n *:not(.fabric-editor-block-mark) > div.fabric-editor-block-mark:first-of-type {\n p,\n h1,\n h2,\n h3,\n h4,\n h5,\n h6,\n .heading-wrapper {\n &:first-child {\n margin-top: 0;\n }\n }\n }\n"])));
|
|
17
17
|
exports.blockMarksSharedStyles = blockMarksSharedStyles;
|
|
@@ -15,7 +15,9 @@ var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
|
|
|
15
15
|
|
|
16
16
|
var _constants = require("@atlaskit/theme/constants");
|
|
17
17
|
|
|
18
|
+
var _tokens = require("@atlaskit/tokens");
|
|
19
|
+
|
|
18
20
|
var _templateObject;
|
|
19
21
|
|
|
20
|
-
var blockquoteSharedStyles = (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n & blockquote {\n box-sizing: border-box;\n padding-left: ", "px;\n border-left: 2px solid
|
|
22
|
+
var blockquoteSharedStyles = (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n & blockquote {\n box-sizing: border-box;\n padding-left: ", "px;\n border-left: 2px solid\n ", ";\n margin: ", " 0 0 0;\n margin-right: 0;\n\n [dir='rtl'] & {\n padding-left: 0;\n padding-right: ", "px;\n }\n\n &:first-child {\n margin-top: 0;\n }\n\n &::before {\n content: '';\n }\n\n &::after {\n content: none;\n }\n\n & p {\n display: block;\n }\n\n & table,\n & table:last-child {\n display: inline-table;\n }\n }\n"])), (0, _constants.gridSize)() * 2, (0, _tokens.token)('color.border', _editorSharedStyles.akEditorBlockquoteBorderColor), _editorSharedStyles.blockNodesVerticalMargin, (0, _constants.gridSize)() * 2);
|
|
21
23
|
exports.blockquoteSharedStyles = blockquoteSharedStyles;
|
|
@@ -17,13 +17,15 @@ var _colors = require("@atlaskit/theme/colors");
|
|
|
17
17
|
|
|
18
18
|
var _components = require("@atlaskit/theme/components");
|
|
19
19
|
|
|
20
|
+
var _tokens = require("@atlaskit/tokens");
|
|
21
|
+
|
|
20
22
|
var _templateObject;
|
|
21
23
|
|
|
22
24
|
var codeMarkSharedStyles = function codeMarkSharedStyles(props) {
|
|
23
25
|
var theme = (0, _components.getTheme)(props);
|
|
24
26
|
return (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n .code {\n --ds--code--bg-color: ", ";\n ", "\n }\n "])), (0, _components.themed)({
|
|
25
|
-
light: _colors.N30A,
|
|
26
|
-
dark: _colors.DN70
|
|
27
|
+
light: (0, _tokens.token)('color.background.neutral', _colors.N30A),
|
|
28
|
+
dark: (0, _tokens.token)('color.background.neutral', _colors.DN70)
|
|
27
29
|
})(props), (0, _inline.getCodeStyles)(theme));
|
|
28
30
|
};
|
|
29
31
|
|
|
@@ -15,5 +15,5 @@ var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
|
|
|
15
15
|
|
|
16
16
|
var _templateObject;
|
|
17
17
|
|
|
18
|
-
var columnLayoutSharedStyle = (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n [data-layout-section] {\n display: flex;\n flex-direction: row;\n & > * {\n flex: 1;\n min-width: 0;\n }\n\n & > .unsupportedBlockView-content-wrap {\n min-width: initial;\n }\n\n @media screen and (max-width: ", "px) {\n flex-direction: column;\n }\n }\n"])), _editorSharedStyles.gridMediumMaxWidth);
|
|
18
|
+
var columnLayoutSharedStyle = (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n [data-layout-section] {\n position: relative;\n display: flex;\n flex-direction: row;\n & > * {\n flex: 1;\n min-width: 0;\n }\n\n & > .unsupportedBlockView-content-wrap {\n min-width: initial;\n }\n\n @media screen and (max-width: ", "px) {\n flex-direction: column;\n }\n }\n"])), _editorSharedStyles.gridMediumMaxWidth);
|
|
19
19
|
exports.columnLayoutSharedStyle = columnLayoutSharedStyle;
|
|
@@ -17,11 +17,13 @@ var _colors = require("@atlaskit/theme/colors");
|
|
|
17
17
|
|
|
18
18
|
var _components = require("@atlaskit/theme/components");
|
|
19
19
|
|
|
20
|
+
var _tokens = require("@atlaskit/tokens");
|
|
21
|
+
|
|
20
22
|
var _templateObject;
|
|
21
23
|
|
|
22
24
|
var divider = (0, _components.themed)({
|
|
23
|
-
light: _colors.N30A,
|
|
24
|
-
dark: _colors.DN50
|
|
25
|
+
light: (0, _tokens.token)('color.border', _colors.N30A),
|
|
26
|
+
dark: (0, _tokens.token)('color.border', _colors.DN50)
|
|
25
27
|
}); // @see typography spreadsheet: https://docs.google.com/spreadsheets/d/1iYusRGCT4PoPfvxbJ8NrgjtfFgXLm5lpDWXzjua1W2E/edit#gid=93913128
|
|
26
28
|
|
|
27
29
|
var ruleSharedStyles = function ruleSharedStyles(props) {
|
|
@@ -17,6 +17,8 @@ var _colors = require("@atlaskit/theme/colors");
|
|
|
17
17
|
|
|
18
18
|
var _OverflowShadow = require("../../ui/OverflowShadow");
|
|
19
19
|
|
|
20
|
+
var _shadowObserver = require("../../ui/OverflowShadow/shadowObserver");
|
|
21
|
+
|
|
20
22
|
var _templateObject;
|
|
21
23
|
|
|
22
24
|
var shadowWidth = 8;
|
|
@@ -34,5 +36,5 @@ var shadowWidth = 8;
|
|
|
34
36
|
* background-attachment: local, local, scroll, scroll;
|
|
35
37
|
*/
|
|
36
38
|
|
|
37
|
-
var shadowSharedStyle = (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\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, rgba(99, 114, 130, 0) 0, ", " 100%);\n top: 0px;\n left: 0;\n display: block;\n }\n\n & .", "::after {\n background: linear-gradient(\n to right,\n rgba(99, 114, 130, 0) 0,\n ", " 100%\n );\n left: calc(100% - ", "px);\n top: 0px;\n display: block;\n }\n"])), _OverflowShadow.shadowClassNames.RIGHT_SHADOW, _OverflowShadow.shadowClassNames.RIGHT_SHADOW, _OverflowShadow.shadowClassNames.LEFT_SHADOW, _OverflowShadow.shadowClassNames.LEFT_SHADOW, _editorSharedStyles.akEditorShadowZIndex, shadowWidth, _OverflowShadow.shadowClassNames.RIGHT_SHADOW, _OverflowShadow.shadowClassNames.LEFT_SHADOW, _OverflowShadow.shadowClassNames.LEFT_SHADOW, _colors.N40A, _OverflowShadow.shadowClassNames.RIGHT_SHADOW, _colors.N40A, shadowWidth);
|
|
39
|
+
var shadowSharedStyle = (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\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, rgba(99, 114, 130, 0) 0, ", " 100%);\n top: 0px;\n left: 0;\n display: block;\n }\n\n & .", "::after {\n background: linear-gradient(\n to right,\n rgba(99, 114, 130, 0) 0,\n ", " 100%\n );\n left: calc(100% - ", "px);\n top: 0px;\n display: block;\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"])), _OverflowShadow.shadowClassNames.RIGHT_SHADOW, _OverflowShadow.shadowClassNames.RIGHT_SHADOW, _OverflowShadow.shadowClassNames.LEFT_SHADOW, _OverflowShadow.shadowClassNames.LEFT_SHADOW, _editorSharedStyles.akEditorShadowZIndex, shadowWidth, _OverflowShadow.shadowClassNames.RIGHT_SHADOW, _OverflowShadow.shadowClassNames.LEFT_SHADOW, _OverflowShadow.shadowClassNames.LEFT_SHADOW, _colors.N40A, _OverflowShadow.shadowClassNames.RIGHT_SHADOW, _colors.N40A, shadowWidth, _shadowObserver.shadowObserverClassNames.SENTINEL_LEFT, _shadowObserver.shadowObserverClassNames.SENTINEL_RIGHT);
|
|
38
40
|
exports.shadowSharedStyle = shadowSharedStyle;
|
|
@@ -21,6 +21,8 @@ var _components = require("@atlaskit/theme/components");
|
|
|
21
21
|
|
|
22
22
|
var _constants = require("@atlaskit/theme/constants");
|
|
23
23
|
|
|
24
|
+
var _tokens = require("@atlaskit/tokens");
|
|
25
|
+
|
|
24
26
|
var _browser = _interopRequireDefault(require("../../utils/browser"));
|
|
25
27
|
|
|
26
28
|
var _templateObject;
|
|
@@ -57,17 +59,17 @@ var TableSharedCssClassName = {
|
|
|
57
59
|
exports.TableSharedCssClassName = TableSharedCssClassName;
|
|
58
60
|
|
|
59
61
|
var tableSharedStyle = function tableSharedStyle(props) {
|
|
60
|
-
return (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\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-
|
|
61
|
-
light: _editorSharedStyles.akEditorTableBorder,
|
|
62
|
-
dark: _editorSharedStyles.akEditorTableBorderDark
|
|
63
|
-
})(props), tableCellMinWidth, (0, _components.themed)({
|
|
64
|
-
light: _editorSharedStyles.akEditorTableBorder,
|
|
65
|
-
dark: _editorSharedStyles.akEditorTableBorderDark
|
|
62
|
+
return (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\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 {\n margin-top: 0;\n }\n\n > .ProseMirror-gapcursor.-right:first-of-type + * {\n margin-top: 0;\n }\n\n > .ProseMirror-gapcursor:first-of-type + 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, _editorSharedStyles.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, (0, _components.themed)({
|
|
63
|
+
light: (0, _tokens.token)('color.border', _editorSharedStyles.akEditorTableBorder),
|
|
64
|
+
dark: (0, _tokens.token)('color.border', _editorSharedStyles.akEditorTableBorderDark)
|
|
65
|
+
})(props), (0, _tokens.token)('color.background.neutral.subtle', 'white'), tableCellMinWidth, (0, _components.themed)({
|
|
66
|
+
light: (0, _tokens.token)('color.border', _editorSharedStyles.akEditorTableBorder),
|
|
67
|
+
dark: (0, _tokens.token)('color.border', _editorSharedStyles.akEditorTableBorderDark)
|
|
66
68
|
})(props), tableCellPadding, _browser.default.gecko || _browser.default.ie || _browser.default.mac && _browser.default.chrome ? 'background-clip: padding-box;' : '', (0, _components.themed)({
|
|
67
69
|
dark: _editorSharedStyles.getTableCellBackgroundDarkModeColors
|
|
68
70
|
})(props), (0, _components.themed)({
|
|
69
|
-
light: _editorSharedStyles.akEditorTableToolbar,
|
|
70
|
-
dark: _editorSharedStyles.akEditorTableToolbarDark
|
|
71
|
+
light: (0, _tokens.token)('color.background.neutral', _editorSharedStyles.akEditorTableToolbar),
|
|
72
|
+
dark: (0, _tokens.token)('color.background.neutral', _editorSharedStyles.akEditorTableToolbarDark)
|
|
71
73
|
})(props), (0, _editorSharedStyles.overflowShadow)({
|
|
72
74
|
background: (0, _components.themed)({
|
|
73
75
|
light: 'rgb(235, 237, 240)',
|
|
@@ -75,11 +77,11 @@ var tableSharedStyle = function tableSharedStyle(props) {
|
|
|
75
77
|
})(props),
|
|
76
78
|
width: "".concat((0, _constants.gridSize)(), "px")
|
|
77
79
|
}), (0, _components.themed)({
|
|
78
|
-
light: 'rgb(235, 237, 240)',
|
|
79
|
-
dark: 'rgb(36, 47, 66)'
|
|
80
|
+
light: (0, _tokens.token)('color.background.neutral', 'rgb(235, 237, 240)'),
|
|
81
|
+
dark: (0, _tokens.token)('color.background.neutral', 'rgb(36, 47, 66)')
|
|
80
82
|
})(props), (0, _components.themed)({
|
|
81
|
-
light: 'rgb(226, 229, 233)',
|
|
82
|
-
dark: _colors.DN20
|
|
83
|
+
light: (0, _tokens.token)('color.background.neutral', 'rgb(226, 229, 233)'),
|
|
84
|
+
dark: (0, _tokens.token)('color.background.neutral', _colors.DN20)
|
|
83
85
|
})(props), (0, _editorSharedStyles.overflowShadow)({
|
|
84
86
|
background: (0, _components.themed)({
|
|
85
87
|
light: 'rgb(235, 237, 240)',
|
|
@@ -87,11 +89,11 @@ var tableSharedStyle = function tableSharedStyle(props) {
|
|
|
87
89
|
})(props),
|
|
88
90
|
width: "".concat((0, _constants.gridSize)(), "px")
|
|
89
91
|
}), (0, _components.themed)({
|
|
90
|
-
light: 'rgb(235, 237, 240)',
|
|
91
|
-
dark: 'rgb(36, 47, 66)'
|
|
92
|
+
light: (0, _tokens.token)('color.background.neutral', 'rgb(235, 237, 240)'),
|
|
93
|
+
dark: (0, _tokens.token)('color.background.neutral', 'rgb(36, 47, 66)')
|
|
92
94
|
})(props), (0, _components.themed)({
|
|
93
|
-
light: 'rgb(226, 229, 233)',
|
|
94
|
-
dark: _colors.DN20
|
|
95
|
+
light: (0, _tokens.token)('color.background.neutral', 'rgb(226, 229, 233)'),
|
|
96
|
+
dark: (0, _tokens.token)('color.background.neutral', _colors.DN20)
|
|
95
97
|
})(props));
|
|
96
98
|
};
|
|
97
99
|
|
|
@@ -19,5 +19,5 @@ var TaskDecisionSharedCssClassName = {
|
|
|
19
19
|
DECISION_CONTAINER: 'decisionItemView-content-wrap'
|
|
20
20
|
};
|
|
21
21
|
exports.TaskDecisionSharedCssClassName = TaskDecisionSharedCssClassName;
|
|
22
|
-
var tasksAndDecisionsStyles = (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n .ProseMirror {\n .taskItemView-content-wrap,\n .", " {\n position: relative;\n min-width: ", "px;\n }\n\n .", " {\n margin-top: 0;\n }\n }\n\n div[data-task-list-local-id] {\n margin: 12px 0 0 0;\n }\n\n div[data-task-list-local-id]:first-child {\n margin-top: 0;\n }\n\n div[data-task-list-local-id] div[data-task-list-local-id] {\n margin-top: 0px;\n margin-left: 24px;\n }\n"])), TaskDecisionSharedCssClassName.DECISION_CONTAINER, _editorSharedStyles.akEditorTableCellMinWidth, TaskDecisionSharedCssClassName.DECISION_CONTAINER);
|
|
22
|
+
var tasksAndDecisionsStyles = (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n .ProseMirror {\n .taskItemView-content-wrap,\n .", " {\n position: relative;\n min-width: ", "px;\n }\n\n .", " {\n margin-top: 0;\n }\n }\n\n div[data-task-list-local-id] {\n margin: 12px 0 0 0;\n }\n\n // If task list is first in the document then set margin top to zero.\n div[data-task-list-local-id]:first-child {\n margin-top: 0;\n }\n\n div[data-task-list-local-id] div[data-task-list-local-id] {\n margin-top: 0px;\n margin-left: 24px;\n }\n"])), TaskDecisionSharedCssClassName.DECISION_CONTAINER, _editorSharedStyles.akEditorTableCellMinWidth, TaskDecisionSharedCssClassName.DECISION_CONTAINER);
|
|
23
23
|
exports.tasksAndDecisionsStyles = tasksAndDecisionsStyles;
|
|
@@ -29,19 +29,6 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
|
|
|
29
29
|
|
|
30
30
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
31
31
|
|
|
32
|
-
function mapBreakpointToFontSize(breakpoint) {
|
|
33
|
-
switch (breakpoint) {
|
|
34
|
-
case 'M':
|
|
35
|
-
return (0, _constants.fontSize)() + 2;
|
|
36
|
-
|
|
37
|
-
case 'L':
|
|
38
|
-
return (0, _constants.fontSize)() + 4;
|
|
39
|
-
|
|
40
|
-
default:
|
|
41
|
-
return (0, _constants.fontSize)();
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
|
|
45
32
|
function mapBreakpointToLayoutMaxWidth(breakpoint) {
|
|
46
33
|
switch (breakpoint) {
|
|
47
34
|
case 'M':
|
|
@@ -56,9 +43,7 @@ function mapBreakpointToLayoutMaxWidth(breakpoint) {
|
|
|
56
43
|
}
|
|
57
44
|
|
|
58
45
|
function BaseThemeWrapper(_ref) {
|
|
59
|
-
var
|
|
60
|
-
dynamicTextSizing = _ref.dynamicTextSizing,
|
|
61
|
-
baseFontSize = _ref.baseFontSize,
|
|
46
|
+
var baseFontSize = _ref.baseFontSize,
|
|
62
47
|
children = _ref.children;
|
|
63
48
|
|
|
64
49
|
var _useGlobalTheme = (0, _components.useGlobalTheme)(),
|
|
@@ -66,12 +51,12 @@ function BaseThemeWrapper(_ref) {
|
|
|
66
51
|
|
|
67
52
|
var memoizedTheme = (0, _react.useMemo)(function () {
|
|
68
53
|
return (0, _defineProperty2.default)({
|
|
69
|
-
baseFontSize:
|
|
70
|
-
layoutMaxWidth:
|
|
54
|
+
baseFontSize: baseFontSize || (0, _constants.fontSize)(),
|
|
55
|
+
layoutMaxWidth: _editorSharedStyles.akEditorDefaultLayoutWidth
|
|
71
56
|
}, _constants.CHANNEL, {
|
|
72
57
|
mode: mode
|
|
73
58
|
});
|
|
74
|
-
}, [
|
|
59
|
+
}, [baseFontSize, mode]);
|
|
75
60
|
return /*#__PURE__*/_react.default.createElement(_react2.ThemeProvider, {
|
|
76
61
|
theme: memoizedTheme
|
|
77
62
|
}, children);
|
|
@@ -79,12 +64,10 @@ function BaseThemeWrapper(_ref) {
|
|
|
79
64
|
|
|
80
65
|
function BaseTheme(_ref3) {
|
|
81
66
|
var children = _ref3.children,
|
|
82
|
-
dynamicTextSizing = _ref3.dynamicTextSizing,
|
|
83
67
|
baseFontSize = _ref3.baseFontSize;
|
|
84
68
|
return /*#__PURE__*/_react.default.createElement(_WidthProvider.WidthConsumer, null, function (_ref4) {
|
|
85
69
|
var breakpoint = _ref4.breakpoint;
|
|
86
70
|
return /*#__PURE__*/_react.default.createElement(BaseThemeWrapper, {
|
|
87
|
-
dynamicTextSizing: dynamicTextSizing,
|
|
88
71
|
breakpoint: breakpoint,
|
|
89
72
|
baseFontSize: baseFontSize
|
|
90
73
|
}, /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, children));
|
|
@@ -29,6 +29,8 @@ var _reactIntlNext = require("react-intl-next");
|
|
|
29
29
|
|
|
30
30
|
var _colors = require("@atlaskit/theme/colors");
|
|
31
31
|
|
|
32
|
+
var _tokens = require("@atlaskit/tokens");
|
|
33
|
+
|
|
32
34
|
var _messages = require("./messages");
|
|
33
35
|
|
|
34
36
|
var _templateObject, _templateObject2;
|
|
@@ -37,8 +39,8 @@ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflec
|
|
|
37
39
|
|
|
38
40
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
39
41
|
|
|
40
|
-
var captionWrapperStyle = (0, _react2.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n margin-top: 8px;\n text-align: center;\n position: relative;\n color: ", ";\n"])), _colors.N400);
|
|
41
|
-
var placeholderStyle = (0, _react2.css)(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n color: ", ";\n position: absolute;\n top: 0;\n width: 100%;\n"])), _colors.N200);
|
|
42
|
+
var captionWrapperStyle = (0, _react2.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n margin-top: 8px;\n text-align: center;\n position: relative;\n color: ", ";\n"])), (0, _tokens.token)('color.text.subtle', _colors.N400));
|
|
43
|
+
var placeholderStyle = (0, _react2.css)(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n color: ", ";\n position: absolute;\n top: 0;\n width: 100%;\n"])), (0, _tokens.token)('color.text.subtlest', _colors.N200));
|
|
42
44
|
|
|
43
45
|
var CaptionComponent = /*#__PURE__*/function (_React$Component) {
|
|
44
46
|
(0, _inherits2.default)(CaptionComponent, _React$Component);
|
|
@@ -29,6 +29,8 @@ var _components = require("@atlaskit/theme/components");
|
|
|
29
29
|
|
|
30
30
|
var _constants = require("@atlaskit/theme/constants");
|
|
31
31
|
|
|
32
|
+
var _tokens = require("@atlaskit/tokens");
|
|
33
|
+
|
|
32
34
|
var _excluded = ["children"];
|
|
33
35
|
|
|
34
36
|
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7;
|
|
@@ -61,16 +63,16 @@ var messages = (0, _reactIntlNext.defineMessages)({
|
|
|
61
63
|
});
|
|
62
64
|
exports.messages = messages;
|
|
63
65
|
var BORDER_RADIUS = (0, _constants.gridSize)() / 2;
|
|
64
|
-
var EXPAND_COLLAPSED_BACKGROUND = 'transparent';
|
|
66
|
+
var EXPAND_COLLAPSED_BACKGROUND = (0, _tokens.token)('color.background.neutral.subtle', 'transparent');
|
|
65
67
|
var EXPAND_SELECTED_BACKGROUND = (0, _components.themed)({
|
|
66
|
-
light: 'rgba(255, 255, 255, 0.6)',
|
|
67
|
-
dark: 'rgba(9, 10, 11, 0.29)'
|
|
68
|
+
light: (0, _tokens.token)('elevation.surface', 'rgba(255, 255, 255, 0.6)'),
|
|
69
|
+
dark: (0, _tokens.token)('elevation.surface', 'rgba(9, 10, 11, 0.29)')
|
|
68
70
|
});
|
|
69
|
-
var EXPAND_FOCUSED_BORDER_COLOR = colors.B300;
|
|
71
|
+
var EXPAND_FOCUSED_BORDER_COLOR = (0, _tokens.token)('color.border.focused', colors.B300);
|
|
70
72
|
var EXPAND_COLLAPSED_BORDER_COLOR = 'transparent';
|
|
71
73
|
var EXPAND_EXPANDED_BORDER_COLOR = (0, _components.themed)({
|
|
72
|
-
light: colors.N40A,
|
|
73
|
-
dark: colors.DN50
|
|
74
|
+
light: (0, _tokens.token)('color.border', colors.N40A),
|
|
75
|
+
dark: (0, _tokens.token)('color.border', colors.DN50)
|
|
74
76
|
});
|
|
75
77
|
|
|
76
78
|
var ExpandIconWrapper = function ExpandIconWrapper(_ref) {
|
|
@@ -87,9 +89,9 @@ exports.ExpandIconWrapper = ExpandIconWrapper;
|
|
|
87
89
|
|
|
88
90
|
var expandIconWrapperStyle = function expandIconWrapperStyle(props) {
|
|
89
91
|
return (0, _react2.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\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"])), (0, _components.themed)({
|
|
90
|
-
light: colors.N90,
|
|
91
|
-
dark: '#d9dde3'
|
|
92
|
-
})(props), (0, _constants.gridSize)() / 2, colors.N30A, _editorSharedStyles.akEditorSwoopCubicBezier);
|
|
92
|
+
light: (0, _tokens.token)('color.icon', colors.N90),
|
|
93
|
+
dark: (0, _tokens.token)('color.icon', '#d9dde3')
|
|
94
|
+
})(props), (0, _constants.gridSize)() / 2, (0, _tokens.token)('color.background.neutral.subtle.hovered', colors.N30A), _editorSharedStyles.akEditorSwoopCubicBezier);
|
|
93
95
|
};
|
|
94
96
|
|
|
95
97
|
var expandIconWrapperExpandedStyle = (0, _react2.css)(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n svg {\n transform: rotate(90deg);\n }\n"])));
|
|
@@ -116,9 +118,9 @@ var containerStyles = function containerStyles(styleProps) {
|
|
|
116
118
|
var marginHorizontal = styleProps['data-node-type'] === 'expand' ? "-".concat(_editorSharedStyles.akLayoutGutterOffset, "px") : 0;
|
|
117
119
|
var margin = "".concat(marginTop, " ").concat(marginHorizontal, " ").concat(marginBottom);
|
|
118
120
|
return function (themeProps) {
|
|
119
|
-
return (0, _react2.css)(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2.default)(["\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 border: 1px solid\n ", ";\n background: ", ";\n }\n\n td > &: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, _editorSharedStyles.akEditorSwoopCubicBezier, _editorSharedStyles.akEditorSwoopCubicBezier, (0, _constants.gridSize)(), (0, _components.themed)({
|
|
120
|
-
light: colors.N50A,
|
|
121
|
-
dark: colors.DN50
|
|
121
|
+
return (0, _react2.css)(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2.default)(["\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 // TODO: https://product-fabric.atlassian.net/browse/DSP-4152\n &:hover {\n border: 1px solid\n ", ";\n background: ", ";\n }\n\n td > &: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, _editorSharedStyles.akEditorSwoopCubicBezier, _editorSharedStyles.akEditorSwoopCubicBezier, (0, _constants.gridSize)(), (0, _components.themed)({
|
|
122
|
+
light: (0, _tokens.token)('color.border', colors.N50A),
|
|
123
|
+
dark: (0, _tokens.token)('color.border', colors.DN50)
|
|
122
124
|
})(themeProps), EXPAND_SELECTED_BACKGROUND(themeProps));
|
|
123
125
|
};
|
|
124
126
|
};
|
|
@@ -131,18 +133,18 @@ var contentStyles = function contentStyles(styleProps) {
|
|
|
131
133
|
|
|
132
134
|
var titleInputStyles = function titleInputStyles(props) {
|
|
133
135
|
return (0, _react2.css)(_templateObject6 || (_templateObject6 = (0, _taggedTemplateLiteral2.default)(["\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"])), (0, _editorSharedStyles.relativeFontSizeToBase16)((0, _constants.fontSize)()), _editorSharedStyles.akEditorLineHeight, (0, _components.themed)({
|
|
134
|
-
light: colors.N200A,
|
|
135
|
-
dark: colors.DN600
|
|
136
|
+
light: (0, _tokens.token)('color.text.subtlest', colors.N200A),
|
|
137
|
+
dark: (0, _tokens.token)('color.text.subtlest', colors.DN600)
|
|
136
138
|
})(props), (0, _constants.gridSize)() / 2, (0, _components.themed)({
|
|
137
|
-
light: colors.N200A,
|
|
138
|
-
dark: colors.DN600
|
|
139
|
+
light: (0, _tokens.token)('color.text.subtlest', colors.N200A),
|
|
140
|
+
dark: (0, _tokens.token)('color.text.subtlest', colors.DN600)
|
|
139
141
|
})(props));
|
|
140
142
|
};
|
|
141
143
|
|
|
142
144
|
var titleContainerStyles = function titleContainerStyles(props) {
|
|
143
145
|
return (0, _react2.css)(_templateObject7 || (_templateObject7 = (0, _taggedTemplateLiteral2.default)(["\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"])), (0, _editorSharedStyles.relativeFontSizeToBase16)((0, _constants.fontSize)()), (0, _components.themed)({
|
|
144
|
-
light: colors.N300A,
|
|
145
|
-
dark: colors.DN600
|
|
146
|
+
light: (0, _tokens.token)('color.text.subtle', colors.N300A),
|
|
147
|
+
dark: (0, _tokens.token)('color.text.subtle', colors.DN600)
|
|
146
148
|
})(props));
|
|
147
149
|
};
|
|
148
150
|
|
|
@@ -21,13 +21,15 @@ var _constants = require("@atlaskit/theme/constants");
|
|
|
21
21
|
|
|
22
22
|
var _typography = require("@atlaskit/theme/typography");
|
|
23
23
|
|
|
24
|
+
var _tokens = require("@atlaskit/tokens");
|
|
25
|
+
|
|
24
26
|
var _templateObject, _templateObject2, _templateObject3, _templateObject4;
|
|
25
27
|
|
|
26
|
-
var errorColor = (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n color: ", ";\n"])), _colors.R400);
|
|
27
|
-
var validColor = (0, _react.css)(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n color: ", ";\n"])), _colors.G400);
|
|
28
|
+
var errorColor = (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n color: ", ";\n"])), (0, _tokens.token)('color.text.danger', _colors.R400));
|
|
29
|
+
var validColor = (0, _react.css)(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n color: ", ";\n"])), (0, _tokens.token)('color.text.success', _colors.G400));
|
|
28
30
|
|
|
29
31
|
var messageStyle = function messageStyle(props) {
|
|
30
|
-
return (0, _react.css)(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["\n ", " font-weight: normal;\n color: ", ";\n margin-top: ", "px;\n display: flex;\n justify-content: baseline;\n"])), (0, _typography.h200)(props), _colors.N200, (0, _constants.gridSize)() / 2);
|
|
32
|
+
return (0, _react.css)(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["\n ", " font-weight: normal;\n color: ", ";\n margin-top: ", "px;\n display: flex;\n justify-content: baseline;\n"])), (0, _typography.h200)(props), (0, _tokens.token)('color.text.subtlest', _colors.N200), (0, _constants.gridSize)() / 2);
|
|
31
33
|
};
|
|
32
34
|
|
|
33
35
|
var iconWrapperStyle = (0, _react.css)(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n margin-right: 4px;\n"])));
|
|
@@ -26,7 +26,7 @@ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/de
|
|
|
26
26
|
|
|
27
27
|
var _react = _interopRequireDefault(require("react"));
|
|
28
28
|
|
|
29
|
-
var
|
|
29
|
+
var _shadowObserver = require("./shadowObserver");
|
|
30
30
|
|
|
31
31
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
|
|
32
32
|
|
|
@@ -37,7 +37,6 @@ var shadowClassNames = {
|
|
|
37
37
|
LEFT_SHADOW: 'left-shadow'
|
|
38
38
|
};
|
|
39
39
|
exports.shadowClassNames = shadowClassNames;
|
|
40
|
-
var isIE11 = _browser.default.ie_version === 11;
|
|
41
40
|
|
|
42
41
|
function overflowShadow(Component, options) {
|
|
43
42
|
return /*#__PURE__*/function (_React$Component) {
|
|
@@ -55,18 +54,23 @@ function overflowShadow(Component, options) {
|
|
|
55
54
|
}
|
|
56
55
|
|
|
57
56
|
_this = _super.call.apply(_super, [this].concat(args));
|
|
57
|
+
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "overflowContainerWidth", 0);
|
|
58
58
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "state", {
|
|
59
59
|
showLeftShadow: false,
|
|
60
60
|
showRightShadow: false
|
|
61
61
|
});
|
|
62
62
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "handleScroll", function (event) {
|
|
63
|
-
if (!_this.overflowContainer || event.target !== _this.overflowContainer) {
|
|
63
|
+
if (!_this.overflowContainer || event.target !== _this.overflowContainer || options.useShadowObserver) {
|
|
64
64
|
return;
|
|
65
65
|
}
|
|
66
66
|
|
|
67
67
|
_this.updateShadows();
|
|
68
68
|
});
|
|
69
69
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "updateShadows", function () {
|
|
70
|
+
if (options.useShadowObserver) {
|
|
71
|
+
return;
|
|
72
|
+
}
|
|
73
|
+
|
|
70
74
|
_this.setState(function (prevState) {
|
|
71
75
|
if (!_this.overflowContainer) {
|
|
72
76
|
return;
|
|
@@ -129,15 +133,15 @@ function overflowShadow(Component, options) {
|
|
|
129
133
|
_this.overflowContainer = container;
|
|
130
134
|
}
|
|
131
135
|
|
|
132
|
-
if (options.
|
|
133
|
-
_this.
|
|
136
|
+
if (options.useShadowObserver) {
|
|
137
|
+
_this.initShadowObserver();
|
|
138
|
+
|
|
139
|
+
return;
|
|
134
140
|
}
|
|
135
141
|
|
|
136
142
|
_this.updateShadows();
|
|
137
143
|
|
|
138
|
-
|
|
139
|
-
_this.overflowContainer.addEventListener('scroll', _this.handleScroll);
|
|
140
|
-
}
|
|
144
|
+
_this.overflowContainer.addEventListener('scroll', _this.handleScroll);
|
|
141
145
|
});
|
|
142
146
|
return _this;
|
|
143
147
|
}
|
|
@@ -145,7 +149,11 @@ function overflowShadow(Component, options) {
|
|
|
145
149
|
(0, _createClass2.default)(OverflowShadow, [{
|
|
146
150
|
key: "componentWillUnmount",
|
|
147
151
|
value: function componentWillUnmount() {
|
|
148
|
-
if (
|
|
152
|
+
if (options.useShadowObserver) {
|
|
153
|
+
return this.shadowObserver && this.shadowObserver.dispose();
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
if (this.overflowContainer) {
|
|
149
157
|
this.overflowContainer.removeEventListener('scroll', this.handleScroll);
|
|
150
158
|
}
|
|
151
159
|
|
|
@@ -154,7 +162,37 @@ function overflowShadow(Component, options) {
|
|
|
154
162
|
}, {
|
|
155
163
|
key: "componentDidUpdate",
|
|
156
164
|
value: function componentDidUpdate() {
|
|
157
|
-
|
|
165
|
+
if (!options.useShadowObserver) {
|
|
166
|
+
this.updateShadows();
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
}, {
|
|
170
|
+
key: "initShadowObserver",
|
|
171
|
+
value: function initShadowObserver() {
|
|
172
|
+
var _this2 = this;
|
|
173
|
+
|
|
174
|
+
if (this.shadowObserver || !this.overflowContainer) {
|
|
175
|
+
return;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
this.shadowObserver = new _shadowObserver.ShadowObserver({
|
|
179
|
+
scrollContainer: this.overflowContainer,
|
|
180
|
+
onUpdateShadows: function onUpdateShadows(shadowStates) {
|
|
181
|
+
_this2.setState(function (prevState) {
|
|
182
|
+
var showLeftShadow = shadowStates.showLeftShadow,
|
|
183
|
+
showRightShadow = shadowStates.showRightShadow;
|
|
184
|
+
|
|
185
|
+
if (showLeftShadow !== prevState.showLeftShadow || showRightShadow !== prevState.showRightShadow) {
|
|
186
|
+
return {
|
|
187
|
+
showLeftShadow: showLeftShadow,
|
|
188
|
+
showRightShadow: showRightShadow
|
|
189
|
+
};
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
return null;
|
|
193
|
+
});
|
|
194
|
+
}
|
|
195
|
+
});
|
|
158
196
|
}
|
|
159
197
|
}, {
|
|
160
198
|
key: "render",
|
|
@@ -162,7 +200,7 @@ function overflowShadow(Component, options) {
|
|
|
162
200
|
var _this$state = this.state,
|
|
163
201
|
showLeftShadow = _this$state.showLeftShadow,
|
|
164
202
|
showRightShadow = _this$state.showRightShadow;
|
|
165
|
-
var classNames = [showRightShadow && shadowClassNames.RIGHT_SHADOW, showLeftShadow && shadowClassNames.LEFT_SHADOW].filter(Boolean).join(' ');
|
|
203
|
+
var classNames = [showRightShadow && shadowClassNames.RIGHT_SHADOW, showLeftShadow && shadowClassNames.LEFT_SHADOW, options.useShadowObserver && _shadowObserver.shadowObserverClassNames.SHADOW_CONTAINER].filter(Boolean).join(' ');
|
|
166
204
|
return /*#__PURE__*/_react.default.createElement(Component, (0, _extends2.default)({
|
|
167
205
|
handleRef: this.handleContainer,
|
|
168
206
|
shadowClassNames: classNames
|