@atlaskit/editor-common 76.27.9 → 76.27.10
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 +8 -0
- package/dist/cjs/media-inline/constants.js +21 -2
- package/dist/cjs/media-inline/inline-image-wrapper.js +4 -2
- package/dist/cjs/media-inline/media-inline-image-card.js +3 -3
- package/dist/cjs/media-inline/styles.js +11 -3
- package/dist/cjs/media-inline/views/icon-wrapper.js +1 -1
- package/dist/cjs/monitoring/error.js +1 -1
- package/dist/cjs/styles/shared/annotation.js +5 -22
- package/dist/cjs/styles/shared/code-block.js +4 -20
- package/dist/cjs/styles/shared/code-mark.js +2 -6
- package/dist/cjs/styles/shared/panel.js +9 -62
- package/dist/cjs/styles/shared/rule.js +2 -8
- package/dist/cjs/ui/BaseTheme/index.js +8 -15
- package/dist/cjs/ui/DropList/index.js +4 -17
- package/dist/cjs/ui/Expand/index.js +13 -38
- package/dist/cjs/ui/Messages/index.js +6 -6
- package/dist/cjs/ui/PortalProvider/index.js +7 -21
- package/dist/cjs/ui-menu/ColorPickerButton/index.js +5 -13
- package/dist/cjs/ui-menu/DropdownMenu/index.js +10 -27
- package/dist/es2019/media-inline/constants.js +20 -1
- package/dist/es2019/media-inline/inline-image-wrapper.js +4 -2
- package/dist/es2019/media-inline/media-inline-image-card.js +3 -3
- package/dist/es2019/media-inline/styles.js +24 -9
- package/dist/es2019/media-inline/views/icon-wrapper.js +1 -1
- package/dist/es2019/monitoring/error.js +1 -1
- package/dist/es2019/styles/shared/annotation.js +9 -28
- package/dist/es2019/styles/shared/code-block.js +11 -27
- package/dist/es2019/styles/shared/code-mark.js +3 -7
- package/dist/es2019/styles/shared/panel.js +24 -83
- package/dist/es2019/styles/shared/rule.js +3 -9
- package/dist/es2019/ui/BaseTheme/index.js +3 -11
- package/dist/es2019/ui/DropList/index.js +7 -17
- package/dist/es2019/ui/Expand/index.js +18 -44
- package/dist/es2019/ui/Messages/index.js +6 -6
- package/dist/es2019/ui/PortalProvider/index.js +7 -21
- package/dist/es2019/ui-menu/ColorPickerButton/index.js +7 -15
- package/dist/es2019/ui-menu/DropdownMenu/index.js +34 -49
- package/dist/esm/media-inline/constants.js +20 -1
- package/dist/esm/media-inline/inline-image-wrapper.js +4 -2
- package/dist/esm/media-inline/media-inline-image-card.js +3 -3
- package/dist/esm/media-inline/styles.js +11 -3
- package/dist/esm/media-inline/views/icon-wrapper.js +1 -1
- package/dist/esm/monitoring/error.js +1 -1
- package/dist/esm/styles/shared/annotation.js +5 -22
- package/dist/esm/styles/shared/code-block.js +6 -22
- package/dist/esm/styles/shared/code-mark.js +3 -7
- package/dist/esm/styles/shared/panel.js +10 -63
- package/dist/esm/styles/shared/rule.js +3 -9
- package/dist/esm/ui/BaseTheme/index.js +9 -15
- package/dist/esm/ui/DropList/index.js +5 -18
- package/dist/esm/ui/Expand/index.js +14 -39
- package/dist/esm/ui/Messages/index.js +6 -6
- package/dist/esm/ui/PortalProvider/index.js +7 -21
- package/dist/esm/ui-menu/ColorPickerButton/index.js +6 -14
- package/dist/esm/ui-menu/DropdownMenu/index.js +11 -28
- package/dist/types/media-inline/constants.d.ts +18 -0
- package/dist/types/media-inline/styles.d.ts +6 -0
- package/dist/types/styles/shared/annotation.d.ts +2 -3
- package/dist/types/styles/shared/code-block.d.ts +1 -2
- package/dist/types/styles/shared/code-mark.d.ts +1 -2
- package/dist/types/styles/shared/panel.d.ts +4 -5
- package/dist/types/styles/shared/rule.d.ts +1 -2
- package/dist/types/ui/BaseTheme/index.d.ts +1 -1
- package/dist/types/ui/Expand/index.d.ts +4 -5
- package/dist/types/ui/Messages/index.d.ts +1 -1
- package/dist/types/ui/PortalProvider/index.d.ts +4 -8
- package/dist/types/utils/getModeFromTheme.d.ts +1 -1
- package/dist/types-ts4.5/media-inline/constants.d.ts +18 -0
- package/dist/types-ts4.5/media-inline/styles.d.ts +6 -0
- package/dist/types-ts4.5/styles/shared/annotation.d.ts +2 -3
- package/dist/types-ts4.5/styles/shared/code-block.d.ts +1 -2
- package/dist/types-ts4.5/styles/shared/code-mark.d.ts +1 -2
- package/dist/types-ts4.5/styles/shared/panel.d.ts +4 -5
- package/dist/types-ts4.5/styles/shared/rule.d.ts +1 -2
- package/dist/types-ts4.5/ui/BaseTheme/index.d.ts +1 -1
- package/dist/types-ts4.5/ui/Expand/index.d.ts +4 -5
- package/dist/types-ts4.5/ui/Messages/index.d.ts +1 -1
- package/dist/types-ts4.5/ui/PortalProvider/index.d.ts +4 -8
- package/dist/types-ts4.5/utils/getModeFromTheme.d.ts +1 -1
- package/package.json +2 -2
- package/dist/cjs/ui/PortalProvider/PortalProviderThemesProvider.js +0 -43
- package/dist/es2019/ui/PortalProvider/PortalProviderThemesProvider.js +0 -37
- package/dist/esm/ui/PortalProvider/PortalProviderThemesProvider.js +0 -36
- package/dist/types/ui/PortalProvider/PortalProviderThemesProvider.d.ts +0 -6
- package/dist/types-ts4.5/ui/PortalProvider/PortalProviderThemesProvider.d.ts +0 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# @atlaskit/editor-common
|
|
2
2
|
|
|
3
|
+
## 76.27.10
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#61676](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/61676) [`765a60628f08`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/765a60628f08) - [ux] Change vertical alignment of media inline image to top
|
|
8
|
+
- [#62545](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/62545) [`85392e5f9be9`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/85392e5f9be9) - Remove legacy theming logic from the @atlaskit/editor-common package. Theming is still available via @atlaskit/tokens.
|
|
9
|
+
- Updated dependencies
|
|
10
|
+
|
|
3
11
|
## 76.27.9
|
|
4
12
|
|
|
5
13
|
### Patch Changes
|
|
@@ -3,7 +3,26 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.DEFAULT_INLINE_IMAGE_ASPECT_RATIO = exports.DEFAULT_IMAGE_WIDTH = exports.DEFAULT_IMAGE_HEIGHT = void 0;
|
|
6
|
+
exports.referenceHeights = exports.DEFAULT_INLINE_IMAGE_ASPECT_RATIO = exports.DEFAULT_IMAGE_WIDTH = exports.DEFAULT_IMAGE_HEIGHT = void 0;
|
|
7
|
+
var _typography = require("@atlaskit/theme/typography");
|
|
7
8
|
var DEFAULT_IMAGE_WIDTH = exports.DEFAULT_IMAGE_WIDTH = 250;
|
|
8
9
|
var DEFAULT_IMAGE_HEIGHT = exports.DEFAULT_IMAGE_HEIGHT = 200;
|
|
9
|
-
var DEFAULT_INLINE_IMAGE_ASPECT_RATIO = exports.DEFAULT_INLINE_IMAGE_ASPECT_RATIO = DEFAULT_IMAGE_WIDTH / DEFAULT_IMAGE_HEIGHT;
|
|
10
|
+
var DEFAULT_INLINE_IMAGE_ASPECT_RATIO = exports.DEFAULT_INLINE_IMAGE_ASPECT_RATIO = DEFAULT_IMAGE_WIDTH / DEFAULT_IMAGE_HEIGHT;
|
|
11
|
+
/**
|
|
12
|
+
* Reference Heights
|
|
13
|
+
*
|
|
14
|
+
* These heights enforce consistent sizes with media inline nodes due to
|
|
15
|
+
* inconsistencies with center aligned inline nodes and text.
|
|
16
|
+
*
|
|
17
|
+
* There is conversation about refactoring media inline nodes to conform to
|
|
18
|
+
* aligning correctly with the surrounding text.
|
|
19
|
+
*/
|
|
20
|
+
var referenceHeights = exports.referenceHeights = {
|
|
21
|
+
p: _typography.headingSizes.h600.lineHeight - 2,
|
|
22
|
+
h1: _typography.headingSizes.h800.lineHeight + 4,
|
|
23
|
+
h2: _typography.headingSizes.h700.lineHeight + 3,
|
|
24
|
+
h3: _typography.headingSizes.h600.lineHeight + 1,
|
|
25
|
+
h4: _typography.headingSizes.h500.lineHeight + 3,
|
|
26
|
+
h5: _typography.headingSizes.h400.lineHeight + 4,
|
|
27
|
+
h6: _typography.headingSizes.h300.lineHeight + 2
|
|
28
|
+
};
|
|
@@ -13,8 +13,10 @@ var _styles = require("./styles");
|
|
|
13
13
|
/** @jsx jsx */
|
|
14
14
|
|
|
15
15
|
var wrapperStyle = (0, _react.css)({
|
|
16
|
-
display: 'inline-
|
|
17
|
-
|
|
16
|
+
display: 'inline-flex',
|
|
17
|
+
justifyContent: 'center',
|
|
18
|
+
alignItems: 'center',
|
|
19
|
+
verticalAlign: 'middle',
|
|
18
20
|
overflow: 'hidden',
|
|
19
21
|
borderRadius: "var(--ds-border-radius, 3px)",
|
|
20
22
|
aspectRatio: "var(".concat(_styles.INLINE_IMAGE_ASPECT_RATIO_CSS_VAR_KEY, ", ").concat(_constants.DEFAULT_INLINE_IMAGE_ASPECT_RATIO, ")")
|
|
@@ -10,8 +10,8 @@ var _react = require("react");
|
|
|
10
10
|
var _react2 = require("@emotion/react");
|
|
11
11
|
var _reactIntlNext = require("react-intl-next");
|
|
12
12
|
var _mediaCard = require("@atlaskit/media-card");
|
|
13
|
-
var _typography = require("@atlaskit/theme/typography");
|
|
14
13
|
var _mediaInlineCard = require("../messages/media-inline-card");
|
|
14
|
+
var _constants = require("./constants");
|
|
15
15
|
var _inlineImageWrapper = require("./inline-image-wrapper");
|
|
16
16
|
var _errorView = require("./views/error-view");
|
|
17
17
|
var _loadingView = require("./views/loading-view");
|
|
@@ -109,8 +109,8 @@ var MediaInlineImageCardInternal = exports.MediaInlineImageCardInternal = functi
|
|
|
109
109
|
};
|
|
110
110
|
}
|
|
111
111
|
return {
|
|
112
|
-
width: Math.round(aspectRatio *
|
|
113
|
-
height:
|
|
112
|
+
width: Math.round(aspectRatio * _constants.referenceHeights['h1']),
|
|
113
|
+
height: _constants.referenceHeights['h1']
|
|
114
114
|
};
|
|
115
115
|
}, [width, height, aspectRatio]);
|
|
116
116
|
return (0, _react2.jsx)(_inlineImageWrapper.InlineImageWrapper, {
|
|
@@ -7,11 +7,19 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
exports.mediaInlineImageStyles = exports.INLINE_IMAGE_WRAPPER_CLASS_NAME = exports.INLINE_IMAGE_ASPECT_RATIO_CSS_VAR_KEY = void 0;
|
|
8
8
|
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
9
9
|
var _react = require("@emotion/react");
|
|
10
|
-
var
|
|
10
|
+
var _constants = require("./constants");
|
|
11
11
|
var _templateObject, _templateObject2;
|
|
12
12
|
var INLINE_IMAGE_WRAPPER_CLASS_NAME = exports.INLINE_IMAGE_WRAPPER_CLASS_NAME = 'media-inline-image-wrapper';
|
|
13
13
|
var INLINE_IMAGE_ASPECT_RATIO_CSS_VAR_KEY = exports.INLINE_IMAGE_ASPECT_RATIO_CSS_VAR_KEY = '--editor-media-inline-image-aspect-ratio';
|
|
14
14
|
var inlineImageHeight = function inlineImageHeight(height) {
|
|
15
|
-
|
|
15
|
+
var margin = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
16
|
+
return (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n > .", ",\n > .mediaInlineView-content-wrap\n > .", " {\n height: ", "px;\n transform: translateY(", "px);\n }\n"])), INLINE_IMAGE_WRAPPER_CLASS_NAME, INLINE_IMAGE_WRAPPER_CLASS_NAME, height, margin);
|
|
16
17
|
};
|
|
17
|
-
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Shifting the mediaInline image component (renders image) to align nicely with
|
|
21
|
+
* mediaInline (renders text) is a bit of a testing ground. This numbers represent
|
|
22
|
+
* shift in top and bottom and size adjustments to make up for lack of 1to1 size
|
|
23
|
+
* mapping
|
|
24
|
+
*/
|
|
25
|
+
var mediaInlineImageStyles = exports.mediaInlineImageStyles = (0, _react.css)(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n // p, h3, and action items\n .", " {\n height: ", "px;\n transform: translateY(-2px);\n }\n\n h1 {\n ", "\n }\n\n h2 {\n ", "\n }\n\n h3 {\n ", "\n }\n\n h4 {\n ", "\n }\n\n h5 {\n ", "\n }\n\n h6 {\n ", "\n }\n"])), INLINE_IMAGE_WRAPPER_CLASS_NAME, _constants.referenceHeights['p'], inlineImageHeight(_constants.referenceHeights['h1'], -3), inlineImageHeight(_constants.referenceHeights['h2'], -3), inlineImageHeight(_constants.referenceHeights['h3'], -2), inlineImageHeight(_constants.referenceHeights['h4'], -2), inlineImageHeight(_constants.referenceHeights['h5'], -2), inlineImageHeight(_constants.referenceHeights['h6'], -2));
|
|
@@ -16,7 +16,7 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
|
|
|
16
16
|
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; }
|
|
17
17
|
var SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
|
|
18
18
|
var packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
|
|
19
|
-
var packageVersion = "76.27.
|
|
19
|
+
var packageVersion = "76.27.10";
|
|
20
20
|
var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
|
|
21
21
|
// Remove URL as it has UGC
|
|
22
22
|
// TODO: Sanitise the URL instead of just removing it
|
|
@@ -8,7 +8,6 @@ exports.annotationSharedStyles = exports.annotationPrefix = exports.AnnotationSh
|
|
|
8
8
|
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
9
9
|
var _react = require("@emotion/react");
|
|
10
10
|
var _colors = require("@atlaskit/theme/colors");
|
|
11
|
-
var _components = require("@atlaskit/theme/components");
|
|
12
11
|
var _templateObject, _templateObject2, _templateObject3;
|
|
13
12
|
var annotationPrefix = exports.annotationPrefix = 'ak-editor-annotation';
|
|
14
13
|
var AnnotationSharedClassNames = exports.AnnotationSharedClassNames = {
|
|
@@ -16,30 +15,14 @@ var AnnotationSharedClassNames = exports.AnnotationSharedClassNames = {
|
|
|
16
15
|
blur: "".concat(annotationPrefix, "-blur"),
|
|
17
16
|
draft: "".concat(annotationPrefix, "-draft")
|
|
18
17
|
};
|
|
19
|
-
var DY75 = 'rgb(111, 92, 37)';
|
|
20
|
-
var DY300 = '#ffd557';
|
|
21
18
|
var Y75a = 'rgba(255, 240, 179, 0.5)';
|
|
22
19
|
var Y200a = 'rgba(255, 196, 0, 0.82)';
|
|
23
|
-
var
|
|
24
|
-
var DY200 = '#82641c';
|
|
25
|
-
var AnnotationSharedCSSByState = exports.AnnotationSharedCSSByState = function AnnotationSharedCSSByState(props) {
|
|
20
|
+
var AnnotationSharedCSSByState = exports.AnnotationSharedCSSByState = function AnnotationSharedCSSByState() {
|
|
26
21
|
return {
|
|
27
|
-
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
|
|
28
|
-
|
|
29
|
-
dark: "var(--ds-background-accent-yellow-subtler, ".concat(DY75, ")")
|
|
30
|
-
})(props), (0, _components.themed)({
|
|
31
|
-
light: "var(--ds-border-accent-yellow, ".concat(_colors.Y300, ")"),
|
|
32
|
-
dark: "var(--ds-border-accent-yellow, ".concat(DY300, ")")
|
|
33
|
-
})(props), "var(--ds-shadow-overlay, ".concat("1px 2px 3px ".concat(_colors.N60A, ", -1px 2px 3px ").concat(_colors.N60A), ")")),
|
|
34
|
-
blur: (0, _react.css)(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n background: ", ";\n border-bottom: 2px solid\n ", ";\n cursor: pointer;\n "])), (0, _components.themed)({
|
|
35
|
-
light: "var(--ds-background-accent-yellow-subtlest, ".concat(Y75a, ")"),
|
|
36
|
-
dark: "var(--ds-background-accent-yellow-subtlest, ".concat(DY75a, ")")
|
|
37
|
-
})(props), (0, _components.themed)({
|
|
38
|
-
light: "var(--ds-border-accent-yellow, ".concat(Y200a, ")"),
|
|
39
|
-
dark: "var(--ds-border-accent-yellow, ".concat(DY200, ")")
|
|
40
|
-
})(props))
|
|
22
|
+
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 // TODO: https://product-fabric.atlassian.net/browse/DSP-4147\n box-shadow: ", ";\n cursor: pointer;\n "])), "var(--ds-background-accent-yellow-subtler, ".concat(_colors.Y75, ")"), "var(--ds-border-accent-yellow, ".concat(_colors.Y300, ")"), "var(--ds-shadow-overlay, ".concat("1px 2px 3px ".concat(_colors.N60A, ", -1px 2px 3px ").concat(_colors.N60A), ")")),
|
|
23
|
+
blur: (0, _react.css)(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n background: ", ";\n border-bottom: 2px solid ", ";\n cursor: pointer;\n "])), "var(--ds-background-accent-yellow-subtlest, ".concat(Y75a, ")"), "var(--ds-border-accent-yellow, ".concat(Y200a, ")"))
|
|
41
24
|
};
|
|
42
25
|
};
|
|
43
|
-
var annotationSharedStyles = exports.annotationSharedStyles = function annotationSharedStyles(
|
|
44
|
-
return (0, _react.css)(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["\n .ProseMirror {\n .", " {\n ", ";\n }\n\n .", " {\n ", ";\n cursor: initial;\n }\n\n .", " {\n ", ";\n }\n }\n"])), AnnotationSharedClassNames.focus, AnnotationSharedCSSByState(
|
|
26
|
+
var annotationSharedStyles = exports.annotationSharedStyles = function annotationSharedStyles() {
|
|
27
|
+
return (0, _react.css)(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["\n .ProseMirror {\n .", " {\n ", ";\n }\n\n .", " {\n ", ";\n cursor: initial;\n }\n\n .", " {\n ", ";\n }\n }\n"])), AnnotationSharedClassNames.focus, AnnotationSharedCSSByState().focus, AnnotationSharedClassNames.draft, AnnotationSharedCSSByState().focus, AnnotationSharedClassNames.blur, AnnotationSharedCSSByState().blur);
|
|
45
28
|
};
|
|
@@ -9,7 +9,6 @@ var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/hel
|
|
|
9
9
|
var _react = require("@emotion/react");
|
|
10
10
|
var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
|
|
11
11
|
var _colors = require("@atlaskit/theme/colors");
|
|
12
|
-
var _components = require("@atlaskit/theme/components");
|
|
13
12
|
var _constants = require("@atlaskit/theme/constants");
|
|
14
13
|
var _templateObject, _templateObject2;
|
|
15
14
|
var CodeBlockSharedCssClassName = exports.CodeBlockSharedCssClassName = {
|
|
@@ -21,25 +20,10 @@ var CodeBlockSharedCssClassName = exports.CodeBlockSharedCssClassName = {
|
|
|
21
20
|
CODEBLOCK_CONTENT: 'code-content',
|
|
22
21
|
DS_CODEBLOCK: '[data-ds--code--code-block]'
|
|
23
22
|
};
|
|
24
|
-
var codeBlockSharedStyles = exports.codeBlockSharedStyles = function codeBlockSharedStyles(
|
|
25
|
-
return (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n .", " {\n position: relative;\n background-color: ", ";\n border-radius: ", "
|
|
26
|
-
|
|
27
|
-
dark: "var(--ds-background-neutral, ".concat(_colors.DN50, ")")
|
|
28
|
-
})(props), (0, _constants.borderRadius)(), (0, _editorSharedStyles.overflowShadow)({
|
|
29
|
-
background: (0, _components.themed)({
|
|
30
|
-
light: "var(--ds-background-neutral, ".concat(_colors.N20, ")"),
|
|
31
|
-
dark: "var(--ds-background-neutral, ".concat(_colors.DN50, ")")
|
|
32
|
-
})(props),
|
|
23
|
+
var codeBlockSharedStyles = exports.codeBlockSharedStyles = function codeBlockSharedStyles() {
|
|
24
|
+
return (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n .", " {\n position: relative;\n background-color: ", ";\n border-radius: ", ";\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: ", ";\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: ", " 100%,\n ", " 100%, ", " 100%,\n ", " 100%, ", " 100%,\n 1px 100%, ", " 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: ", ";\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: ", ";\n margin: ", ";\n white-space: pre;\n font-size: ", ";\n line-height: 1.5rem;\n }\n }\n }\n"])), CodeBlockSharedCssClassName.CODEBLOCK_CONTAINER, "var(--ds-surface-raised, transparent)", "var(--ds-border-radius, 3px)", _editorSharedStyles.blockNodesVerticalMargin, _editorSharedStyles.akEditorCodeFontFamily, _editorSharedStyles.akEditorTableCellMinWidth, CodeBlockSharedCssClassName.CODEBLOCK_START, CodeBlockSharedCssClassName.CODEBLOCK_END, CodeBlockSharedCssClassName.CODEBLOCK_CONTENT_WRAPPER, "var(--ds-background-neutral, ".concat(_colors.N20, ")"), "var(--ds-border-radius, 3px)", (0, _editorSharedStyles.overflowShadow)({
|
|
25
|
+
background: "var(--ds-background-neutral, ".concat(_colors.N20, ")"),
|
|
33
26
|
leftCoverWidth: "var(--ds-space-300, 24px)"
|
|
34
|
-
}), "var(--ds-space-300, 24px)", "var(--ds-space-300, 24px)", "var(--ds-space-100, 8px)", "var(--ds-space-100, 8px)", "var(--ds-space-100, 8px)", "var(--ds-space-100, 8px)", CodeBlockSharedCssClassName.CODEBLOCK_LINE_NUMBER_GUTTER, (0,
|
|
35
|
-
light: "var(--ds-background-neutral, ".concat(_colors.N30, ")"),
|
|
36
|
-
dark: "var(--ds-background-neutral, ".concat(_colors.DN20, ")")
|
|
37
|
-
})(props), "var(--ds-space-100, 8px)", (0, _components.themed)({
|
|
38
|
-
light: "var(--ds-text-subtlest, ".concat(_colors.N400, ")"),
|
|
39
|
-
dark: "var(--ds-text-subtlest, ".concat(_colors.DN400, ")")
|
|
40
|
-
})(props), (0, _editorSharedStyles.relativeFontSizeToBase16)((0, _constants.fontSize)()), CodeBlockSharedCssClassName.CODEBLOCK_CONTENT, (0, _components.themed)({
|
|
41
|
-
light: "var(--ds-text, ".concat(_colors.N800, ")"),
|
|
42
|
-
dark: "var(--ds-text, ".concat(_colors.DN800, ")")
|
|
43
|
-
})(props), (0, _constants.borderRadius)(), "var(--ds-space-100, 8px)", (0, _editorSharedStyles.relativeFontSizeToBase16)((0, _constants.fontSize)()));
|
|
27
|
+
}), "var(--ds-space-300, 24px)", "var(--ds-space-300, 24px)", "var(--ds-space-100, 8px)", "var(--ds-space-100, 8px)", "var(--ds-space-100, 8px)", "var(--ds-space-100, 8px)", CodeBlockSharedCssClassName.CODEBLOCK_LINE_NUMBER_GUTTER, "var(--ds-background-neutral, ".concat(_colors.N30, ")"), "var(--ds-space-100, 8px)", "var(--ds-text-subtlest, ".concat(_colors.N400, ")"), (0, _editorSharedStyles.relativeFontSizeToBase16)((0, _constants.fontSize)()), CodeBlockSharedCssClassName.CODEBLOCK_CONTENT, "var(--ds-text, ".concat(_colors.N800, ")"), "var(--ds-border-radius, 3px)", "var(--ds-space-100, 8px)", (0, _editorSharedStyles.relativeFontSizeToBase16)((0, _constants.fontSize)()));
|
|
44
28
|
};
|
|
45
29
|
var codeBlockInListSafariFix = exports.codeBlockInListSafariFix = (0, _react.css)(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\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"])), _editorSharedStyles.akEditorLineHeight, _editorSharedStyles.akEditorLineHeight);
|
|
@@ -9,11 +9,7 @@ var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/hel
|
|
|
9
9
|
var _react = require("@emotion/react");
|
|
10
10
|
var _inline = require("@atlaskit/code/inline");
|
|
11
11
|
var _colors = require("@atlaskit/theme/colors");
|
|
12
|
-
var _components = require("@atlaskit/theme/components");
|
|
13
12
|
var _templateObject;
|
|
14
|
-
var codeMarkSharedStyles = exports.codeMarkSharedStyles = function codeMarkSharedStyles(
|
|
15
|
-
return (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n .code {\n --ds--code--bg-color: ", ";\n ", "\n }\n "])), (0,
|
|
16
|
-
light: "var(--ds-background-neutral, ".concat(_colors.N30A, ")"),
|
|
17
|
-
dark: "var(--ds-background-neutral, ".concat(_colors.DN70, ")")
|
|
18
|
-
})(props), (0, _inline.getCodeStyles)());
|
|
13
|
+
var codeMarkSharedStyles = exports.codeMarkSharedStyles = function codeMarkSharedStyles() {
|
|
14
|
+
return (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n .code {\n --ds--code--bg-color: ", ";\n ", "\n }\n "])), "var(--ds-background-neutral, ".concat(_colors.N30A, ")"), (0, _inline.getCodeStyles)());
|
|
19
15
|
};
|
|
@@ -16,11 +16,8 @@ var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
|
|
|
16
16
|
var _consts = require("@atlaskit/editor-shared-styles/consts");
|
|
17
17
|
var _emoji = require("@atlaskit/emoji");
|
|
18
18
|
var _colors = require("@atlaskit/theme/colors");
|
|
19
|
-
var _components = require("@atlaskit/theme/components");
|
|
20
|
-
var _constants = require("@atlaskit/theme/constants");
|
|
21
19
|
var _templateObject, _templateObject2;
|
|
22
20
|
/* eslint-disable @atlaskit/design-system/ensure-design-token-usage */
|
|
23
|
-
// eslint-disable-next-line @atlaskit/design-system/no-deprecated-imports
|
|
24
21
|
var lightPanelColors = {
|
|
25
22
|
info: _colors.B50,
|
|
26
23
|
note: _colors.P50,
|
|
@@ -99,28 +96,10 @@ var lightIconColor = {
|
|
|
99
96
|
warning: "var(--ds-icon-warning, ".concat(_colors.Y400, ")"),
|
|
100
97
|
error: "var(--ds-icon-danger, ".concat(_colors.R400, ")")
|
|
101
98
|
};
|
|
102
|
-
var darkIconColor = {
|
|
103
|
-
info: "var(--ds-icon-information, ".concat(_colors.B100, ")"),
|
|
104
|
-
note: "var(--ds-icon-discovery, ".concat(_colors.P100, ")"),
|
|
105
|
-
tip: "var(--ds-icon-success, ".concat(_colors.G200, ")"),
|
|
106
|
-
success: "var(--ds-icon-success, ".concat(_colors.G200, ")"),
|
|
107
|
-
warning: "var(--ds-icon-warning, ".concat(_colors.Y100, ")"),
|
|
108
|
-
error: "var(--ds-icon-danger, ".concat(_colors.R200, ")")
|
|
109
|
-
};
|
|
110
|
-
var tokenDarkPanelColors = {
|
|
111
|
-
info: "var(--ds-background-information, ".concat(darkPanelColors['info'], ")"),
|
|
112
|
-
note: "var(--ds-background-discovery, ".concat(darkPanelColors['note'], ")"),
|
|
113
|
-
tip: "var(--ds-background-success, ".concat(darkPanelColors['tip'], ")"),
|
|
114
|
-
success: "var(--ds-background-success, ".concat(darkPanelColors['success'], ")"),
|
|
115
|
-
warning: "var(--ds-background-warning, ".concat(darkPanelColors['warning'], ")"),
|
|
116
|
-
error: "var(--ds-background-danger, ".concat(darkPanelColors['error'], ")")
|
|
117
|
-
};
|
|
118
99
|
|
|
119
|
-
// TODO: Migrate away from gridSize
|
|
120
|
-
// Recommendation: Replace gridSize with 8
|
|
121
100
|
// New custom icons are a little smaller than predefined icons.
|
|
122
101
|
// To fix alignment issues with custom icons, vertical alignment is updated.
|
|
123
|
-
var panelEmojiSpriteVerticalAlignment = -(
|
|
102
|
+
var panelEmojiSpriteVerticalAlignment = -(8 * 3 - _consts.akEditorCustomIconSize) / 2;
|
|
124
103
|
var panelEmojiImageVerticalAlignment = panelEmojiSpriteVerticalAlignment - 1;
|
|
125
104
|
|
|
126
105
|
// TODO: https://product-fabric.atlassian.net/browse/DSP-4066
|
|
@@ -174,54 +153,22 @@ var PanelSharedSelectors = exports.PanelSharedSelectors = {
|
|
|
174
153
|
copyButton: "button[aria-label=\"Copy\"]"
|
|
175
154
|
};
|
|
176
155
|
var iconDynamicStyles = function iconDynamicStyles(panelType) {
|
|
177
|
-
return
|
|
178
|
-
var light = lightIconColor[panelType];
|
|
179
|
-
var dark = darkIconColor[panelType];
|
|
180
|
-
var color = (0, _components.themed)({
|
|
181
|
-
light: light,
|
|
182
|
-
dark: dark
|
|
183
|
-
})(props);
|
|
184
|
-
return "\n color: ".concat(color, ";\n ");
|
|
185
|
-
};
|
|
156
|
+
return "color: ".concat(lightIconColor[panelType], ";");
|
|
186
157
|
};
|
|
187
158
|
|
|
188
159
|
// Provides the color without tokens, used when converting to a custom panel
|
|
189
160
|
var getPanelTypeBackgroundNoTokens = exports.getPanelTypeBackgroundNoTokens = function getPanelTypeBackgroundNoTokens(panelType) {
|
|
190
|
-
|
|
191
|
-
var light = lightPanelColors[panelType];
|
|
192
|
-
var dark = darkPanelColors[panelType];
|
|
193
|
-
var background = (0, _components.themed)({
|
|
194
|
-
light: light,
|
|
195
|
-
dark: dark
|
|
196
|
-
})(props);
|
|
197
|
-
return background || 'none';
|
|
161
|
+
return lightPanelColors[panelType] || 'none';
|
|
198
162
|
};
|
|
199
163
|
var getPanelTypeBackground = exports.getPanelTypeBackground = function getPanelTypeBackground(panelType) {
|
|
200
|
-
|
|
201
|
-
var light = (0, _editorPalette.hexToEditorBackgroundPaletteColor)(lightPanelColors[panelType]);
|
|
202
|
-
// hexToEditorBackgroundPaletteColor has a light mode as a fallback color - for legacy dark mode we define the tokens locally
|
|
203
|
-
var dark = tokenDarkPanelColors[panelType];
|
|
204
|
-
var background = (0, _components.themed)({
|
|
205
|
-
light: light,
|
|
206
|
-
dark: dark
|
|
207
|
-
})(props);
|
|
208
|
-
return background || 'none';
|
|
164
|
+
return (0, _editorPalette.hexToEditorBackgroundPaletteColor)(lightPanelColors[panelType]) || 'none';
|
|
209
165
|
};
|
|
210
166
|
var mainDynamicStyles = function mainDynamicStyles(panelType) {
|
|
211
|
-
return
|
|
212
|
-
var background = getPanelTypeBackground(panelType, props);
|
|
213
|
-
var text = (0, _components.themed)({
|
|
214
|
-
light: 'inherit',
|
|
215
|
-
dark: darkPanelColors.TextColor
|
|
216
|
-
})(props);
|
|
217
|
-
return "\n background-color: ".concat(background, ";\n color: ").concat(text, ";\n ");
|
|
218
|
-
};
|
|
167
|
+
return "\n background-color: ".concat(getPanelTypeBackground(panelType), ";\n color: inherit;\n ");
|
|
219
168
|
};
|
|
220
|
-
var panelSharedStylesWithoutPrefix = exports.panelSharedStylesWithoutPrefix = function panelSharedStylesWithoutPrefix(
|
|
221
|
-
return (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n border-radius: ", "
|
|
222
|
-
dark: getPanelBackgroundDarkModeColors
|
|
223
|
-
})(props));
|
|
169
|
+
var panelSharedStylesWithoutPrefix = exports.panelSharedStylesWithoutPrefix = function panelSharedStylesWithoutPrefix() {
|
|
170
|
+
return (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n border-radius: ", ";\n margin: ", " 0 0;\n padding: ", ";\n min-width: ", "px;\n display: flex;\n position: relative;\n align-items: baseline;\n word-break: break-word;\n\n ", "\n\n .", " {\n flex-shrink: 0;\n height: ", ";\n width: ", ";\n box-sizing: content-box;\n padding-right: ", ";\n text-align: center;\n user-select: none;\n -moz-user-select: none;\n -webkit-user-select: none;\n -ms-user-select: none;\n ", "\n\n > span {\n vertical-align: middle;\n display: inline-flex;\n }\n\n .", " {\n vertical-align: ", "px;\n }\n\n .", " {\n vertical-align: ", "px;\n\n // Vertical align only works for inline-block elements in Firefox\n @-moz-document url-prefix() {\n img {\n display: inline-block;\n }\n }\n }\n }\n\n .ak-editor-panel__content {\n margin: 1px 0 1px;\n flex: 1 0 0;\n /*\n https://ishadeed.com/article/min-max-css/#setting-min-width-to-zero-with-flexbox\n The default value for min-width is auto, which is computed to zero. When an element is a flex item, the value of min-width doesn\u2019t compute to zero. The minimum size of a flex item is equal to the size of its contents.\n */\n min-width: 0;\n }\n\n &[data-panel-type='", "'] {\n ", "\n\n .", " {\n ", "\n }\n }\n\n &[data-panel-type='", "'] {\n ", "\n\n .", " {\n ", "\n }\n }\n\n &[data-panel-type='", "'] {\n ", "\n\n .", " {\n ", "\n }\n }\n\n &[data-panel-type='", "'] {\n ", "\n\n .", " {\n ", "\n }\n }\n\n &[data-panel-type='", "'] {\n ", "\n\n .", " {\n ", "\n }\n }\n"])), "var(--ds-border-radius, 3px)", _editorSharedStyles.blockNodesVerticalMargin, "var(--ds-space-100, 8px)", _editorSharedStyles.akEditorTableCellMinWidth, mainDynamicStyles(_adfSchema.PanelType.INFO), PanelSharedCssClassName.icon, "var(--ds-space-300, 24px)", "var(--ds-space-300, 24px)", "var(--ds-space-100, 8px)", iconDynamicStyles(_adfSchema.PanelType.INFO), _emoji.emojiSprite, panelEmojiSpriteVerticalAlignment, _emoji.emojiImage, panelEmojiImageVerticalAlignment, _adfSchema.PanelType.NOTE, mainDynamicStyles(_adfSchema.PanelType.NOTE), PanelSharedCssClassName.icon, iconDynamicStyles(_adfSchema.PanelType.NOTE), _adfSchema.PanelType.TIP, mainDynamicStyles(_adfSchema.PanelType.TIP), PanelSharedCssClassName.icon, iconDynamicStyles(_adfSchema.PanelType.TIP), _adfSchema.PanelType.WARNING, mainDynamicStyles(_adfSchema.PanelType.WARNING), PanelSharedCssClassName.icon, iconDynamicStyles(_adfSchema.PanelType.WARNING), _adfSchema.PanelType.ERROR, mainDynamicStyles(_adfSchema.PanelType.ERROR), PanelSharedCssClassName.icon, iconDynamicStyles(_adfSchema.PanelType.ERROR), _adfSchema.PanelType.SUCCESS, mainDynamicStyles(_adfSchema.PanelType.SUCCESS), PanelSharedCssClassName.icon, iconDynamicStyles(_adfSchema.PanelType.SUCCESS));
|
|
224
171
|
};
|
|
225
|
-
var panelSharedStyles = exports.panelSharedStyles = function panelSharedStyles(
|
|
226
|
-
return (0, _react.css)(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n .", " {\n ", "\n }\n"])), PanelSharedCssClassName.prefix, panelSharedStylesWithoutPrefix(
|
|
172
|
+
var panelSharedStyles = exports.panelSharedStyles = function panelSharedStyles() {
|
|
173
|
+
return (0, _react.css)(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n .", " {\n ", "\n }\n"])), PanelSharedCssClassName.prefix, panelSharedStylesWithoutPrefix());
|
|
227
174
|
};
|
|
@@ -9,14 +9,8 @@ var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/hel
|
|
|
9
9
|
var _react = require("@emotion/react");
|
|
10
10
|
var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
|
|
11
11
|
var _colors = require("@atlaskit/theme/colors");
|
|
12
|
-
var _components = require("@atlaskit/theme/components");
|
|
13
12
|
var _templateObject;
|
|
14
|
-
var divider = (0, _components.themed)({
|
|
15
|
-
light: "var(--ds-border, ".concat(_colors.N30A, ")"),
|
|
16
|
-
dark: "var(--ds-border, ".concat(_colors.DN50, ")")
|
|
17
|
-
});
|
|
18
|
-
|
|
19
13
|
// @see typography spreadsheet: https://docs.google.com/spreadsheets/d/1iYusRGCT4PoPfvxbJ8NrgjtfFgXLm5lpDWXzjua1W2E/edit#gid=93913128
|
|
20
|
-
var ruleSharedStyles = exports.ruleSharedStyles = function ruleSharedStyles(
|
|
21
|
-
return (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n & hr {\n border: none;\n background-color: ", ";\n margin: ", "em 0;\n height: 2px;\n border-radius: 1px;\n }\n"])),
|
|
14
|
+
var ruleSharedStyles = exports.ruleSharedStyles = function ruleSharedStyles() {
|
|
15
|
+
return (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n & hr {\n border: none;\n background-color: ", ";\n margin: ", "em 0;\n height: 2px;\n border-radius: 1px;\n }\n"])), "var(--ds-border, ".concat(_colors.N30A, ")"), _editorSharedStyles.akEditorLineHeight);
|
|
22
16
|
};
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
3
|
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
@@ -8,11 +7,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
8
7
|
exports.BaseTheme = BaseTheme;
|
|
9
8
|
exports.BaseThemeWrapper = BaseThemeWrapper;
|
|
10
9
|
exports.mapBreakpointToLayoutMaxWidth = mapBreakpointToLayoutMaxWidth;
|
|
11
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
12
10
|
var _react = _interopRequireWildcard(require("react"));
|
|
13
11
|
var _react2 = require("@emotion/react");
|
|
14
12
|
var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
|
|
15
|
-
var _components = require("@atlaskit/theme/components");
|
|
16
13
|
var _constants = require("@atlaskit/theme/constants");
|
|
17
14
|
var _WidthProvider = require("../WidthProvider");
|
|
18
15
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
@@ -29,25 +26,21 @@ function mapBreakpointToLayoutMaxWidth(breakpoint) {
|
|
|
29
26
|
function BaseThemeWrapper(_ref) {
|
|
30
27
|
var baseFontSize = _ref.baseFontSize,
|
|
31
28
|
children = _ref.children;
|
|
32
|
-
var _useGlobalTheme = (0, _components.useGlobalTheme)(),
|
|
33
|
-
mode = _useGlobalTheme.mode;
|
|
34
29
|
var memoizedTheme = (0, _react.useMemo)(function () {
|
|
35
|
-
return
|
|
30
|
+
return {
|
|
36
31
|
baseFontSize: baseFontSize || (0, _constants.fontSize)(),
|
|
37
32
|
layoutMaxWidth: _editorSharedStyles.akEditorDefaultLayoutWidth
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
});
|
|
41
|
-
}, [baseFontSize, mode]);
|
|
33
|
+
};
|
|
34
|
+
}, [baseFontSize]);
|
|
42
35
|
return /*#__PURE__*/_react.default.createElement(_react2.ThemeProvider, {
|
|
43
36
|
theme: memoizedTheme
|
|
44
37
|
}, children);
|
|
45
38
|
}
|
|
46
|
-
function BaseTheme(
|
|
47
|
-
var children =
|
|
48
|
-
baseFontSize =
|
|
49
|
-
return /*#__PURE__*/_react.default.createElement(_WidthProvider.WidthConsumer, null, function (
|
|
50
|
-
var breakpoint =
|
|
39
|
+
function BaseTheme(_ref2) {
|
|
40
|
+
var children = _ref2.children,
|
|
41
|
+
baseFontSize = _ref2.baseFontSize;
|
|
42
|
+
return /*#__PURE__*/_react.default.createElement(_WidthProvider.WidthConsumer, null, function (_ref3) {
|
|
43
|
+
var breakpoint = _ref3.breakpoint;
|
|
51
44
|
return /*#__PURE__*/_react.default.createElement(BaseThemeWrapper, {
|
|
52
45
|
breakpoint: breakpoint,
|
|
53
46
|
baseFontSize: baseFontSize
|
|
@@ -17,14 +17,12 @@ var _react = require("react");
|
|
|
17
17
|
var _react2 = require("@emotion/react");
|
|
18
18
|
var _analyticsNext = require("@atlaskit/analytics-next");
|
|
19
19
|
var _colors = require("@atlaskit/theme/colors");
|
|
20
|
-
var _components = require("@atlaskit/theme/components");
|
|
21
|
-
var _constants = require("@atlaskit/theme/constants");
|
|
22
20
|
var _Layer = _interopRequireDefault(require("../Layer"));
|
|
23
21
|
var _templateObject, _templateObject2, _templateObject3;
|
|
24
22
|
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); }; }
|
|
25
23
|
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; } } /** @jsx jsx */
|
|
26
24
|
var packageName = "@atlaskit/editor-common";
|
|
27
|
-
var packageVersion = "76.27.
|
|
25
|
+
var packageVersion = "76.27.10";
|
|
28
26
|
var halfFocusRing = 1;
|
|
29
27
|
var dropOffset = '0, 8';
|
|
30
28
|
var DropList = /*#__PURE__*/function (_Component) {
|
|
@@ -40,14 +38,8 @@ var DropList = /*#__PURE__*/function (_Component) {
|
|
|
40
38
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "wrapperStyles", (0, _react2.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n ", "\n transition-duration: 0.2s;\n transition: box-shadow 0.15s cubic-bezier(0.47, 0.03, 0.49, 1.38);\n "])), _this.props.shouldFitContainer ? 'display: block; flex: 1 1 auto;' : 'display: inline-flex;'));
|
|
41
39
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "triggerStyles", (0, _react2.css)(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n transition-duration: 0.2s;\n transition: box-shadow 0.15s cubic-bezier(0.47, 0.03, 0.49, 1.38);\n ", "\n "])), _this.props.shouldFitContainer ? 'display: block; box-sizing: border-box;' : 'display: inline-flex;'));
|
|
42
40
|
/* eslint-disable @atlaskit/design-system/ensure-design-token-usage */
|
|
43
|
-
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "menuWrapper", function (
|
|
44
|
-
return (0, _react2.css)(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["\n color: ", ";\n background-color: ", ";\n border-radius: ", "
|
|
45
|
-
light: "var(--ds-text, ".concat(_colors.N900, ")"),
|
|
46
|
-
dark: "var(--ds-text, ".concat(_colors.DN600, ")")
|
|
47
|
-
})(theme), (0, _components.themed)({
|
|
48
|
-
light: "var(--ds-surface-overlay, ".concat(_colors.N0, ")"),
|
|
49
|
-
dark: "var(--ds-surface-overlay, ".concat(_colors.DN50, ")")
|
|
50
|
-
})(theme), (0, _constants.borderRadius)(), "var(--ds-shadow-overlay, ".concat("0 4px 8px calc(-1 * 2px) ".concat(_colors.N50A, ", 0 0 1px ").concat(_colors.N60A), ")"), "var(--ds-space-050, 4px)");
|
|
41
|
+
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "menuWrapper", function () {
|
|
42
|
+
return (0, _react2.css)(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["\n color: ", ";\n background-color: ", ";\n border-radius: ", ";\n box-shadow: ", ";\n box-sizing: border-box;\n overflow: auto;\n padding: ", " 0;\n max-height: 90vh;\n "])), "var(--ds-text, ".concat(_colors.N900, ")"), "var(--ds-surface-overlay, ".concat(_colors.N0, ")"), "var(--ds-border-radius, 3px)", "var(--ds-shadow-overlay, ".concat("0 4px 8px calc(-1 * 2px) ".concat(_colors.N50A, ", 0 0 1px ").concat(_colors.N60A), ")"), "var(--ds-space-050, 4px)");
|
|
51
43
|
});
|
|
52
44
|
/* eslint-enable @atlaskit/design-system/ensure-design-token-usage */
|
|
53
45
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "componentDidMount", function () {
|
|
@@ -123,7 +115,6 @@ var DropList = /*#__PURE__*/function (_Component) {
|
|
|
123
115
|
(0, _createClass2.default)(DropList, [{
|
|
124
116
|
key: "render",
|
|
125
117
|
value: function render() {
|
|
126
|
-
var _this2 = this;
|
|
127
118
|
var _this$props = this.props,
|
|
128
119
|
children = _this$props.children,
|
|
129
120
|
isOpen = _this$props.isOpen,
|
|
@@ -133,11 +124,7 @@ var DropList = /*#__PURE__*/function (_Component) {
|
|
|
133
124
|
testId = _this$props.testId,
|
|
134
125
|
id = _this$props.id;
|
|
135
126
|
var layerContent = isOpen ? (0, _react2.jsx)("div", {
|
|
136
|
-
css:
|
|
137
|
-
return _this2.menuWrapper({
|
|
138
|
-
theme: theme
|
|
139
|
-
});
|
|
140
|
-
},
|
|
127
|
+
css: this.menuWrapper,
|
|
141
128
|
"data-role": "droplistContent",
|
|
142
129
|
"data-testid": testId && "".concat(testId, "--content"),
|
|
143
130
|
ref: this.handleContentRef,
|
|
@@ -14,7 +14,6 @@ var _react2 = require("@emotion/react");
|
|
|
14
14
|
var _reactIntlNext = require("react-intl-next");
|
|
15
15
|
var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
|
|
16
16
|
var _colors = require("@atlaskit/theme/colors");
|
|
17
|
-
var _components = require("@atlaskit/theme/components");
|
|
18
17
|
var _constants = require("@atlaskit/theme/constants");
|
|
19
18
|
var _excluded = ["children"];
|
|
20
19
|
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7;
|
|
@@ -46,30 +45,21 @@ var messages = exports.messages = (0, _reactIntlNext.defineMessages)({
|
|
|
46
45
|
});
|
|
47
46
|
var BORDER_RADIUS = "var(--ds-border-radius-100, 4px)";
|
|
48
47
|
var EXPAND_COLLAPSED_BACKGROUND = "var(--ds-background-neutral-subtle, transparent)";
|
|
49
|
-
var EXPAND_SELECTED_BACKGROUND = (
|
|
50
|
-
light: "var(--ds-surface, rgba(255, 255, 255, 0.6))",
|
|
51
|
-
dark: "var(--ds-surface, rgba(9, 10, 11, 0.29))"
|
|
52
|
-
});
|
|
48
|
+
var EXPAND_SELECTED_BACKGROUND = "var(--ds-surface, rgba(255, 255, 255, 0.6))";
|
|
53
49
|
var EXPAND_FOCUSED_BORDER_COLOR = "var(--ds-border-focused, ".concat(_colors.B300, ")");
|
|
54
50
|
var EXPAND_COLLAPSED_BORDER_COLOR = 'transparent';
|
|
55
|
-
var EXPAND_EXPANDED_BORDER_COLOR = (
|
|
56
|
-
light: "var(--ds-border, ".concat(_colors.N40A, ")"),
|
|
57
|
-
dark: "var(--ds-border, ".concat(_colors.DN50, ")")
|
|
58
|
-
});
|
|
51
|
+
var EXPAND_EXPANDED_BORDER_COLOR = "var(--ds-border, ".concat(_colors.N40A, ")");
|
|
59
52
|
var ExpandIconWrapper = exports.ExpandIconWrapper = function ExpandIconWrapper(_ref) {
|
|
60
53
|
var children = _ref.children,
|
|
61
54
|
expanded = _ref.expanded;
|
|
62
55
|
return (0, _react2.jsx)("div", {
|
|
63
|
-
css: function css(
|
|
64
|
-
return expanded ? [expandIconWrapperStyle(
|
|
56
|
+
css: function css() {
|
|
57
|
+
return expanded ? [expandIconWrapperStyle(), expandIconWrapperExpandedStyle] : expandIconWrapperStyle();
|
|
65
58
|
}
|
|
66
59
|
}, children);
|
|
67
60
|
};
|
|
68
|
-
var expandIconWrapperStyle = function expandIconWrapperStyle(
|
|
69
|
-
return (0, _react2.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n cursor: pointer;\n display: flex;\n color: ", ";\n border-radius: ", ";\n width: 24px;\n height: 24px;\n\n &:hover {\n background: ", ";\n }\n\n svg {\n transition: transform 0.2s ", ";\n }\n"])), (
|
|
70
|
-
light: "var(--ds-icon, ".concat(_colors.N90, ")"),
|
|
71
|
-
dark: "var(--ds-icon, #d9dde3)"
|
|
72
|
-
})(props), "var(--ds-border-radius-100, 4px)", "var(--ds-background-neutral-subtle-hovered, ".concat(_colors.N30A, ")"), _editorSharedStyles.akEditorSwoopCubicBezier);
|
|
61
|
+
var expandIconWrapperStyle = function expandIconWrapperStyle() {
|
|
62
|
+
return (0, _react2.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n cursor: pointer;\n display: flex;\n color: ", ";\n border-radius: ", ";\n width: 24px;\n height: 24px;\n\n &:hover {\n background: ", ";\n }\n\n svg {\n transition: transform 0.2s ", ";\n }\n"])), "var(--ds-icon, ".concat(_colors.N90, ")"), "var(--ds-border-radius-100, 4px)", "var(--ds-background-neutral-subtle-hovered, ".concat(_colors.N30A, ")"), _editorSharedStyles.akEditorSwoopCubicBezier);
|
|
73
63
|
};
|
|
74
64
|
var expandIconWrapperExpandedStyle = (0, _react2.css)(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n svg {\n transform: rotate(90deg);\n }\n"])));
|
|
75
65
|
var expandLayoutWrapperStyle = exports.expandLayoutWrapperStyle = (0, _react2.css)(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["\n width: ", ";\n height: ", ";\n"])), "var(--ds-space-300, 24px)", "var(--ds-space-300, 24px)");
|
|
@@ -91,35 +81,20 @@ var containerStyles = function containerStyles(styleProps) {
|
|
|
91
81
|
// and is the root level expand.
|
|
92
82
|
var marginHorizontal = styleProps['data-node-type'] === 'expand' ? "-".concat(_editorSharedStyles.akLayoutGutterOffset, "px") : 0;
|
|
93
83
|
var margin = "".concat(marginTop, " ").concat(marginHorizontal, " ").concat(marginBottom);
|
|
94
|
-
return function (
|
|
95
|
-
return (0, _react2.css)(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2.default)(["\n border-width: 1px;\n border-style: solid;\n border-color: ", ";\n border-radius: ", ";\n min-height: 25px;\n background: ", ";\n margin: ", ";\n\n transition: background 0.3s ", ",\n border-color 0.3s ", ";\n padding: ", ";\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
|
|
96
|
-
light: "var(--ds-border, ".concat(_colors.N50A, ")"),
|
|
97
|
-
dark: "var(--ds-border, ".concat(_colors.DN50, ")")
|
|
98
|
-
})(themeProps), EXPAND_SELECTED_BACKGROUND(themeProps));
|
|
84
|
+
return function () {
|
|
85
|
+
return (0, _react2.css)(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2.default)(["\n border-width: 1px;\n border-style: solid;\n border-color: ", ";\n border-radius: ", ";\n min-height: 25px;\n background: ", ";\n margin: ", ";\n\n transition: background 0.3s ", ",\n border-color 0.3s ", ";\n padding: ", ";\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 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 : EXPAND_COLLAPSED_BORDER_COLOR, BORDER_RADIUS, !expanded ? EXPAND_COLLAPSED_BACKGROUND : EXPAND_SELECTED_BACKGROUND, margin, _editorSharedStyles.akEditorSwoopCubicBezier, _editorSharedStyles.akEditorSwoopCubicBezier, "var(--ds-space-100, 8px)", "var(--ds-border, ".concat(_colors.N50A, ")"), EXPAND_SELECTED_BACKGROUND);
|
|
99
86
|
};
|
|
100
87
|
};
|
|
101
88
|
var contentStyles = function contentStyles(styleProps) {
|
|
102
|
-
return function (
|
|
89
|
+
return function () {
|
|
103
90
|
return (0, _react2.css)(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2.default)(["\n padding-top: ", ";\n padding-right: ", ";\n // TODO: Migrate away from gridSize\n // Recommendation: Replace gridSize with 8 if important to highlight 8*4 - 8/2, or directly replace with 28px\n padding-left: ", "px;\n display: flow-root;\n\n // The follow rules inside @supports block are added as a part of ED-8893\n // The fix is targeting mobile bridge on iOS 12 or below,\n // We should consider remove this fix when we no longer support iOS 12\n @supports not (display: flow-root) {\n width: 100%;\n box-sizing: border-box;\n }\n\n ", "\n "])), styleProps.expanded ? "var(--ds-space-100, 8px)" : "var(--ds-space-0, 0px)", "var(--ds-space-100, 8px)", (0, _constants.gridSize)() * 4 - (0, _constants.gridSize)() / 2, !styleProps.expanded ? "\n .expand-content-wrapper, .nestedExpand-content-wrapper {\n /* We visually hide the content here to preserve the content during copy+paste */\n /* Do not add text nowrap here because inline comment navigation depends on the location of the text */\n width: 100%;\n display: block;\n height: 0;\n overflow: hidden;\n clip: rect(1px, 1px, 1px, 1px);\n user-select: none;\n }\n " : '');
|
|
104
91
|
};
|
|
105
92
|
};
|
|
106
|
-
var titleInputStyles = function titleInputStyles(
|
|
107
|
-
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 ", ";\n width: 100%;\n\n &::placeholder {\n opacity:
|
|
108
|
-
light: "var(--ds-text-subtlest, ".concat(_colors.N200A, ")"),
|
|
109
|
-
dark: "var(--ds-text-subtlest, ".concat(_colors.DN600, ")")
|
|
110
|
-
})(props), "var(--ds-space-050, 4px)", (0, _components.themed)({
|
|
111
|
-
light: 1,
|
|
112
|
-
dark: 0.6
|
|
113
|
-
})(props), (0, _components.themed)({
|
|
114
|
-
light: "var(--ds-text-subtlest, ".concat(_colors.N200, ")"),
|
|
115
|
-
dark: "var(--ds-text-subtlest, ".concat(_colors.DN600, ")")
|
|
116
|
-
})(props));
|
|
93
|
+
var titleInputStyles = function titleInputStyles() {
|
|
94
|
+
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 ", ";\n width: 100%;\n\n &::placeholder {\n opacity: 1;\n color: ", ";\n }\n"])), (0, _editorSharedStyles.relativeFontSizeToBase16)((0, _constants.fontSize)()), _editorSharedStyles.akEditorLineHeight, "var(--ds-text-subtlest, ".concat(_colors.N200A, ")"), "var(--ds-space-050, 4px)", "var(--ds-text-subtlest, ".concat(_colors.N200, ")"));
|
|
117
95
|
};
|
|
118
|
-
var titleContainerStyles = function titleContainerStyles(
|
|
119
|
-
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\n &:focus {\n outline: 0;\n }\n"])), (0, _editorSharedStyles.relativeFontSizeToBase16)((0, _constants.fontSize)()), (
|
|
120
|
-
light: "var(--ds-text-subtle, ".concat(_colors.N300A, ")"),
|
|
121
|
-
dark: "var(--ds-text-subtle, ".concat(_colors.DN600, ")")
|
|
122
|
-
})(props));
|
|
96
|
+
var titleContainerStyles = function titleContainerStyles() {
|
|
97
|
+
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\n &:focus {\n outline: 0;\n }\n"])), (0, _editorSharedStyles.relativeFontSizeToBase16)((0, _constants.fontSize)()), "var(--ds-text-subtle, ".concat(_colors.N300A, ")"));
|
|
123
98
|
};
|
|
124
99
|
var sharedExpandStyles = exports.sharedExpandStyles = {
|
|
125
100
|
titleInputStyles: titleInputStyles,
|