@atlaskit/editor-common 76.27.9 → 76.28.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 +14 -0
- package/dist/cjs/media-inline/constants.js +23 -2
- package/dist/cjs/media-inline/inline-image-wrapper.js +11 -21
- package/dist/cjs/media-inline/media-inline-image-card.js +8 -5
- package/dist/cjs/media-inline/styles.js +36 -4
- 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 +22 -1
- package/dist/es2019/media-inline/inline-image-wrapper.js +16 -21
- package/dist/es2019/media-inline/media-inline-image-card.js +8 -5
- package/dist/es2019/media-inline/styles.js +55 -11
- 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 +22 -1
- package/dist/esm/media-inline/inline-image-wrapper.js +13 -21
- package/dist/esm/media-inline/media-inline-image-card.js +8 -5
- package/dist/esm/media-inline/styles.js +35 -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 +19 -0
- package/dist/types/media-inline/inline-image-wrapper.d.ts +2 -0
- package/dist/types/media-inline/media-inline-image-card.d.ts +4 -0
- package/dist/types/media-inline/styles.d.ts +11 -0
- package/dist/types/media-inline/types.d.ts +2 -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 +19 -0
- package/dist/types-ts4.5/media-inline/inline-image-wrapper.d.ts +2 -0
- package/dist/types-ts4.5/media-inline/media-inline-image-card.d.ts +4 -0
- package/dist/types-ts4.5/media-inline/styles.d.ts +11 -0
- package/dist/types-ts4.5/media-inline/types.d.ts +2 -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
|
@@ -5,13 +5,11 @@ import PropTypes from 'prop-types';
|
|
|
5
5
|
import { createPortal, unmountComponentAtNode, unstable_renderSubtreeIntoContainer } from 'react-dom';
|
|
6
6
|
import { injectIntl, RawIntlProvider, useIntl } from 'react-intl-next';
|
|
7
7
|
import { default as AnalyticsReactContext } from '@atlaskit/analytics-next-stable-react-context';
|
|
8
|
-
import { useGlobalTheme } from '@atlaskit/theme/components';
|
|
9
8
|
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE } from '../../analytics';
|
|
10
9
|
import { EventDispatcher } from '../../event-dispatcher';
|
|
11
10
|
import IntlProviderIfMissingWrapper from '../IntlProviderIfMissingWrapper';
|
|
12
|
-
import { PortalProviderThemeProviders } from './PortalProviderThemesProvider';
|
|
13
11
|
export class PortalProviderAPI extends EventDispatcher {
|
|
14
|
-
constructor(intl, onAnalyticsEvent, analyticsContext
|
|
12
|
+
constructor(intl, onAnalyticsEvent, analyticsContext) {
|
|
15
13
|
super();
|
|
16
14
|
_defineProperty(this, "portals", new Map());
|
|
17
15
|
_defineProperty(this, "setContext", context => {
|
|
@@ -20,7 +18,6 @@ export class PortalProviderAPI extends EventDispatcher {
|
|
|
20
18
|
this.intl = intl;
|
|
21
19
|
this.onAnalyticsEvent = onAnalyticsEvent;
|
|
22
20
|
this.useAnalyticsContext = analyticsContext;
|
|
23
|
-
this.themeMode = themeMode;
|
|
24
21
|
}
|
|
25
22
|
render(children, container, hasAnalyticsContext = false, hasIntlContext = false) {
|
|
26
23
|
this.portals.set(container, {
|
|
@@ -28,10 +25,7 @@ export class PortalProviderAPI extends EventDispatcher {
|
|
|
28
25
|
hasAnalyticsContext,
|
|
29
26
|
hasIntlContext
|
|
30
27
|
});
|
|
31
|
-
|
|
32
|
-
mode: this.themeMode
|
|
33
|
-
}, children());
|
|
34
|
-
let wrappedChildren = this.useAnalyticsContext ? /*#__PURE__*/React.createElement(AnalyticsContextWrapper, null, childrenWithThemeProviders) : childrenWithThemeProviders;
|
|
28
|
+
let wrappedChildren = this.useAnalyticsContext ? /*#__PURE__*/React.createElement(AnalyticsContextWrapper, null, children()) : children();
|
|
35
29
|
if (hasIntlContext) {
|
|
36
30
|
wrappedChildren = /*#__PURE__*/React.createElement(RawIntlProvider, {
|
|
37
31
|
value: this.intl
|
|
@@ -44,26 +38,21 @@ export class PortalProviderAPI extends EventDispatcher {
|
|
|
44
38
|
// we (unfortunately) need to re-render to pass down any updated context.
|
|
45
39
|
// selectively do this for nodeviews that opt-in via `hasAnalyticsContext`
|
|
46
40
|
forceUpdate({
|
|
47
|
-
intl
|
|
48
|
-
themeMode
|
|
41
|
+
intl
|
|
49
42
|
}) {
|
|
50
43
|
this.intl = intl;
|
|
51
|
-
this.themeMode = themeMode;
|
|
52
44
|
this.portals.forEach((portal, container) => {
|
|
53
45
|
if (!portal.hasAnalyticsContext && !this.useAnalyticsContext && !portal.hasIntlContext) {
|
|
54
46
|
return;
|
|
55
47
|
}
|
|
56
48
|
let wrappedChildren = portal.children();
|
|
57
|
-
const childrenWithThemeProviders = /*#__PURE__*/React.createElement(PortalProviderThemeProviders, {
|
|
58
|
-
mode: themeMode
|
|
59
|
-
}, wrappedChildren);
|
|
60
49
|
if (portal.hasAnalyticsContext && this.useAnalyticsContext) {
|
|
61
|
-
wrappedChildren = /*#__PURE__*/React.createElement(AnalyticsContextWrapper, null,
|
|
50
|
+
wrappedChildren = /*#__PURE__*/React.createElement(AnalyticsContextWrapper, null, wrappedChildren);
|
|
62
51
|
}
|
|
63
52
|
if (portal.hasIntlContext) {
|
|
64
53
|
wrappedChildren = /*#__PURE__*/React.createElement(RawIntlProvider, {
|
|
65
54
|
value: this.intl
|
|
66
|
-
},
|
|
55
|
+
}, wrappedChildren);
|
|
67
56
|
}
|
|
68
57
|
unstable_renderSubtreeIntoContainer(this.context, wrappedChildren, container);
|
|
69
58
|
});
|
|
@@ -103,15 +92,14 @@ export class PortalProviderAPI extends EventDispatcher {
|
|
|
103
92
|
class BasePortalProvider extends React.Component {
|
|
104
93
|
constructor(props) {
|
|
105
94
|
super(props);
|
|
106
|
-
this.portalProviderAPI = new PortalProviderAPI(props.intl, props.onAnalyticsEvent, props.useAnalyticsContext
|
|
95
|
+
this.portalProviderAPI = new PortalProviderAPI(props.intl, props.onAnalyticsEvent, props.useAnalyticsContext);
|
|
107
96
|
}
|
|
108
97
|
render() {
|
|
109
98
|
return this.props.render(this.portalProviderAPI);
|
|
110
99
|
}
|
|
111
100
|
componentDidUpdate() {
|
|
112
101
|
this.portalProviderAPI.forceUpdate({
|
|
113
|
-
intl: this.props.intl
|
|
114
|
-
themeMode: this.props.themeMode
|
|
102
|
+
intl: this.props.intl
|
|
115
103
|
});
|
|
116
104
|
}
|
|
117
105
|
}
|
|
@@ -132,10 +120,8 @@ const PortalProviderWithThemeAndIntlProviders = ({
|
|
|
132
120
|
render
|
|
133
121
|
}) => {
|
|
134
122
|
const intl = useIntl();
|
|
135
|
-
const globalTheme = useGlobalTheme();
|
|
136
123
|
return /*#__PURE__*/React.createElement(BasePortalProvider, {
|
|
137
124
|
intl: intl,
|
|
138
|
-
themeMode: globalTheme.mode,
|
|
139
125
|
onAnalyticsEvent: onAnalyticsEvent,
|
|
140
126
|
useAnalyticsContext: useAnalyticsContext,
|
|
141
127
|
render: render
|
|
@@ -4,9 +4,7 @@ import { css, jsx } from '@emotion/react';
|
|
|
4
4
|
import { withAnalyticsContext, withAnalyticsEvents } from '@atlaskit/analytics-next';
|
|
5
5
|
import Button from '@atlaskit/button';
|
|
6
6
|
import ExpandIcon from '@atlaskit/icon/glyph/chevron-down';
|
|
7
|
-
import {
|
|
8
|
-
import { themed } from '@atlaskit/theme/components';
|
|
9
|
-
import { borderRadius } from '@atlaskit/theme/constants';
|
|
7
|
+
import { N0, N30A, N60A } from '@atlaskit/theme/colors';
|
|
10
8
|
import Tooltip from '@atlaskit/tooltip';
|
|
11
9
|
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, editorAnalyticsChannel, EVENT_TYPE } from '../../analytics';
|
|
12
10
|
import { ColorPalette, DEFAULT_BORDER_COLOR, getSelectedRowAndColumnFromPalette } from '../../ui-color';
|
|
@@ -26,12 +24,9 @@ const colorPickerExpandContainer = css`
|
|
|
26
24
|
// Control the size of color picker buttons and preview
|
|
27
25
|
// TODO: https://product-fabric.atlassian.net/browse/DSP-4134
|
|
28
26
|
/* eslint-disable @atlaskit/design-system/ensure-design-token-usage */
|
|
29
|
-
const colorPickerWrapper =
|
|
30
|
-
border-radius: ${
|
|
31
|
-
background-color: ${
|
|
32
|
-
light: `var(--ds-surface-overlay, ${N0})`,
|
|
33
|
-
dark: `var(--ds-surface-overlay, ${DN50})`
|
|
34
|
-
})(theme)};
|
|
27
|
+
const colorPickerWrapper = () => css`
|
|
28
|
+
border-radius: ${"var(--ds-border-radius, 3px)"};
|
|
29
|
+
background-color: ${`var(--ds-surface-overlay, ${N0})`};
|
|
35
30
|
box-shadow: 0 4px 8px -2px ${N60A}, 0 0 1px ${N60A};
|
|
36
31
|
padding: ${"var(--ds-space-100, 8px)"} 0px;
|
|
37
32
|
`;
|
|
@@ -153,7 +148,7 @@ const ColorPickerButton = props => {
|
|
|
153
148
|
};
|
|
154
149
|
const title = props.title || '';
|
|
155
150
|
const currentColor = props.currentColor && props.hexToPaletteColor ? props.hexToPaletteColor(props.currentColor) : props.currentColor;
|
|
156
|
-
const buttonStyle =
|
|
151
|
+
const buttonStyle = () => {
|
|
157
152
|
var _props$size, _props$size2, _props$size3;
|
|
158
153
|
return css`
|
|
159
154
|
padding: ${"var(--ds-space-075, 6px)"} 10px;
|
|
@@ -167,7 +162,7 @@ const ColorPickerButton = props => {
|
|
|
167
162
|
align-self: center;
|
|
168
163
|
content: '';
|
|
169
164
|
border: 1px solid ${DEFAULT_BORDER_COLOR};
|
|
170
|
-
border-radius: ${
|
|
165
|
+
border-radius: ${"var(--ds-border-radius, 3px)"};
|
|
171
166
|
background-color: ${currentColor || 'transparent'};
|
|
172
167
|
width: ${((_props$size2 = props.size) === null || _props$size2 === void 0 ? void 0 : _props$size2.width) || '14px'};
|
|
173
168
|
height: ${((_props$size3 = props.size) === null || _props$size3 === void 0 ? void 0 : _props$size3.height) || '14px'};
|
|
@@ -175,10 +170,7 @@ const ColorPickerButton = props => {
|
|
|
175
170
|
margin: 0px ${"var(--ds-space-025, 2px)"};
|
|
176
171
|
}
|
|
177
172
|
&:hover {
|
|
178
|
-
background: ${
|
|
179
|
-
light: `var(--ds-background-neutral-subtle-hovered, ${N30A})`,
|
|
180
|
-
dark: `var(--ds-background-neutral-subtle-hovered, ${N30A})`
|
|
181
|
-
})(theme)};
|
|
173
|
+
background: ${`var(--ds-background-neutral-subtle-hovered, ${N30A})`};
|
|
182
174
|
}
|
|
183
175
|
`;
|
|
184
176
|
};
|
|
@@ -7,8 +7,7 @@ import { css, jsx } from '@emotion/react';
|
|
|
7
7
|
import { akEditorFloatingPanelZIndex } from '@atlaskit/editor-shared-styles';
|
|
8
8
|
import { CustomItem, MenuGroup, Section } from '@atlaskit/menu';
|
|
9
9
|
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
10
|
-
import { B100,
|
|
11
|
-
import { themed } from '@atlaskit/theme/components';
|
|
10
|
+
import { B100, N70, N900 } from '@atlaskit/theme/colors';
|
|
12
11
|
import Tooltip from '@atlaskit/tooltip';
|
|
13
12
|
import { DropdownMenuSharedCssClassName } from '../../styles';
|
|
14
13
|
import { KeyDownHandlerContext } from '../../ui-menu/ToolbarArrowKeyNavigationProvider';
|
|
@@ -27,59 +26,47 @@ const focusedMenuItemStyle = css`
|
|
|
27
26
|
box-shadow: inset 0px 0px 0px 2px ${`var(--ds-border-focused, ${B100})`};
|
|
28
27
|
outline: none;
|
|
29
28
|
`;
|
|
30
|
-
const buttonStyles = (isActive, submenuActive) =>
|
|
29
|
+
const buttonStyles = (isActive, submenuActive) => {
|
|
31
30
|
if (isActive) {
|
|
32
31
|
/**
|
|
33
32
|
* Hack for item to imitate old dropdown-menu selected styles
|
|
34
33
|
*/
|
|
35
34
|
return css`
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
35
|
+
> span,
|
|
36
|
+
> span:hover,
|
|
37
|
+
> span:active {
|
|
38
|
+
background: ${"var(--ds-background-selected, #6c798f)"};
|
|
39
|
+
color: ${"var(--ds-text, #fff)"};
|
|
40
|
+
}
|
|
41
|
+
:focus > span[aria-disabled='false'] {
|
|
42
|
+
${focusedMenuItemStyle};
|
|
43
|
+
}
|
|
44
|
+
:focus-visible,
|
|
45
|
+
:focus-visible > span[aria-disabled='false'] {
|
|
46
|
+
outline: none;
|
|
47
|
+
}
|
|
48
|
+
`;
|
|
50
49
|
} else {
|
|
51
50
|
return css`
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
background-color: ${themed({
|
|
58
|
-
light: "var(--ds-background-neutral-subtle-hovered, rgb(244, 245, 247))",
|
|
59
|
-
dark: "var(--ds-background-neutral-subtle-hovered, rgb(59, 71, 92))"
|
|
60
|
-
})(theme)};
|
|
61
|
-
}
|
|
62
|
-
${!submenuActive && `
|
|
51
|
+
> span:hover[aria-disabled='false'] {
|
|
52
|
+
color: ${`var(--ds-text, ${N900})`};
|
|
53
|
+
background-color: ${"var(--ds-background-neutral-subtle-hovered, rgb(244, 245, 247))"};
|
|
54
|
+
}
|
|
55
|
+
${!submenuActive && `
|
|
63
56
|
> span:active[aria-disabled='false'] {
|
|
64
|
-
background-color: ${
|
|
65
|
-
light: "var(--ds-background-neutral-subtle-pressed, rgb(179, 212, 255))",
|
|
66
|
-
dark: "var(--ds-background-neutral-subtle-pressed, rgb(179, 212, 255))"
|
|
67
|
-
})(theme)};
|
|
57
|
+
background-color: ${"var(--ds-background-neutral-subtle-pressed, rgb(179, 212, 255))"};
|
|
68
58
|
}`}
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
outline: none;
|
|
81
|
-
}
|
|
82
|
-
`; // The default focus-visible style is removed to ensure consistency across browsers
|
|
59
|
+
> span[aria-disabled='true'] {
|
|
60
|
+
color: ${`var(--ds-text-disabled, ${N70})`};
|
|
61
|
+
}
|
|
62
|
+
:focus > span[aria-disabled='false'] {
|
|
63
|
+
${focusedMenuItemStyle};
|
|
64
|
+
}
|
|
65
|
+
:focus-visible,
|
|
66
|
+
:focus-visible > span[aria-disabled='false'] {
|
|
67
|
+
outline: none;
|
|
68
|
+
}
|
|
69
|
+
`; // The default focus-visible style is removed to ensure consistency across browsers
|
|
83
70
|
}
|
|
84
71
|
};
|
|
85
72
|
|
|
@@ -298,9 +285,7 @@ function DropdownMenuItem({
|
|
|
298
285
|
setSubmenuActive(!!event.target.closest(`.${DropdownMenuSharedCssClassName.SUBMENU}`));
|
|
299
286
|
};
|
|
300
287
|
const dropListItem = jsx("div", {
|
|
301
|
-
css:
|
|
302
|
-
theme
|
|
303
|
-
}),
|
|
288
|
+
css: () => buttonStyles(item.isActive, submenuActive),
|
|
304
289
|
tabIndex: -1,
|
|
305
290
|
"aria-disabled": item.isDisabled ? 'true' : 'false',
|
|
306
291
|
onMouseDown: _handleSubmenuActive
|
|
@@ -1,3 +1,24 @@
|
|
|
1
|
+
import { headingSizes } from '@atlaskit/theme/typography';
|
|
1
2
|
export var DEFAULT_IMAGE_WIDTH = 250;
|
|
2
3
|
export var DEFAULT_IMAGE_HEIGHT = 200;
|
|
3
|
-
export var DEFAULT_INLINE_IMAGE_ASPECT_RATIO = DEFAULT_IMAGE_WIDTH / DEFAULT_IMAGE_HEIGHT;
|
|
4
|
+
export var DEFAULT_INLINE_IMAGE_ASPECT_RATIO = DEFAULT_IMAGE_WIDTH / DEFAULT_IMAGE_HEIGHT;
|
|
5
|
+
export var DEFAULT_INLINE_IMAGE_BORDER_SIZE = 0;
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Reference Heights
|
|
9
|
+
*
|
|
10
|
+
* These heights enforce consistent sizes with media inline nodes due to
|
|
11
|
+
* inconsistencies with center aligned inline nodes and text.
|
|
12
|
+
*
|
|
13
|
+
* There is conversation about refactoring media inline nodes to conform to
|
|
14
|
+
* aligning correctly with the surrounding text.
|
|
15
|
+
*/
|
|
16
|
+
export var referenceHeights = {
|
|
17
|
+
p: headingSizes.h600.lineHeight - 2,
|
|
18
|
+
h1: headingSizes.h800.lineHeight + 4,
|
|
19
|
+
h2: headingSizes.h700.lineHeight + 3,
|
|
20
|
+
h3: headingSizes.h600.lineHeight + 1,
|
|
21
|
+
h4: headingSizes.h500.lineHeight + 3,
|
|
22
|
+
h5: headingSizes.h400.lineHeight + 4,
|
|
23
|
+
h6: headingSizes.h300.lineHeight + 2
|
|
24
|
+
};
|
|
@@ -1,34 +1,26 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
2
4
|
/** @jsx jsx */
|
|
3
5
|
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
display: 'inline-block',
|
|
8
|
-
verticalAlign: 'text-bottom',
|
|
9
|
-
overflow: 'hidden',
|
|
10
|
-
borderRadius: "var(--ds-border-radius, 3px)",
|
|
11
|
-
aspectRatio: "var(".concat(INLINE_IMAGE_ASPECT_RATIO_CSS_VAR_KEY, ", ").concat(DEFAULT_INLINE_IMAGE_ASPECT_RATIO, ")")
|
|
12
|
-
});
|
|
13
|
-
import { DEFAULT_INLINE_IMAGE_ASPECT_RATIO } from './constants';
|
|
14
|
-
import { INLINE_IMAGE_ASPECT_RATIO_CSS_VAR_KEY, INLINE_IMAGE_WRAPPER_CLASS_NAME } from './styles';
|
|
15
|
-
var selectedStyle = css({
|
|
16
|
-
cursor: 'pointer',
|
|
17
|
-
boxShadow: "0 0 0 1px ".concat("var(--ds-border-selected, ".concat(B300, ")")),
|
|
18
|
-
outline: 'none',
|
|
19
|
-
borderColor: 'transparent'
|
|
20
|
-
});
|
|
6
|
+
import { jsx } from '@emotion/react';
|
|
7
|
+
import { hexToEditorBorderPaletteColor } from '@atlaskit/editor-palette';
|
|
8
|
+
import { borderStyle, INLINE_IMAGE_ASPECT_RATIO_CSS_VAR_KEY, INLINE_IMAGE_BORDER_COLOR_CSS_VAR_KEY, INLINE_IMAGE_BORDER_SIZE_CSS_VAR_KEY, INLINE_IMAGE_WRAPPER_CLASS_NAME, selectedStyle, wrapperStyle } from './styles';
|
|
21
9
|
export var InlineImageWrapper = function InlineImageWrapper(_ref) {
|
|
10
|
+
var _ref2;
|
|
22
11
|
var children = _ref.children,
|
|
23
12
|
isSelected = _ref.isSelected,
|
|
24
|
-
aspectRatio = _ref.aspectRatio
|
|
25
|
-
|
|
13
|
+
aspectRatio = _ref.aspectRatio,
|
|
14
|
+
borderSize = _ref.borderSize,
|
|
15
|
+
borderColor = _ref.borderColor;
|
|
16
|
+
var borderStyleVars = borderSize && borderColor ? (_ref2 = {}, _defineProperty(_ref2, INLINE_IMAGE_BORDER_SIZE_CSS_VAR_KEY, borderSize), _defineProperty(_ref2, INLINE_IMAGE_BORDER_COLOR_CSS_VAR_KEY, hexToEditorBorderPaletteColor(borderColor) || borderColor), _ref2) : {};
|
|
17
|
+
var aspectStyleVars = aspectRatio ? _defineProperty({}, INLINE_IMAGE_ASPECT_RATIO_CSS_VAR_KEY, aspectRatio) : {};
|
|
26
18
|
return (
|
|
27
19
|
// eslint-disable-next-line @atlaskit/design-system/prefer-primitives
|
|
28
20
|
jsx("span", {
|
|
29
|
-
style:
|
|
21
|
+
style: _objectSpread(_objectSpread({}, borderStyleVars), aspectStyleVars),
|
|
30
22
|
className: INLINE_IMAGE_WRAPPER_CLASS_NAME,
|
|
31
|
-
css: [wrapperStyle, isSelected && selectedStyle],
|
|
23
|
+
css: [wrapperStyle, borderSize && borderColor && borderStyle, isSelected && selectedStyle],
|
|
32
24
|
"data-testid": "inline-image-wrapper"
|
|
33
25
|
}, children)
|
|
34
26
|
);
|
|
@@ -5,8 +5,8 @@ import { useEffect, useMemo, useState } from 'react';
|
|
|
5
5
|
import { jsx } from '@emotion/react';
|
|
6
6
|
import { createIntl, injectIntl } from 'react-intl-next';
|
|
7
7
|
import { Card } from '@atlaskit/media-card';
|
|
8
|
-
import { headingSizes } from '@atlaskit/theme/typography';
|
|
9
8
|
import { messages } from '../messages/media-inline-card';
|
|
9
|
+
import { referenceHeights } from './constants';
|
|
10
10
|
import { InlineImageWrapper } from './inline-image-wrapper';
|
|
11
11
|
import { InlineImageCardErrorView } from './views/error-view';
|
|
12
12
|
import { InlineImageCardLoadingView } from './views/loading-view';
|
|
@@ -18,7 +18,8 @@ export var MediaInlineImageCardInternal = function MediaInlineImageCardInternal(
|
|
|
18
18
|
alt = _ref.alt,
|
|
19
19
|
isLazy = _ref.isLazy,
|
|
20
20
|
width = _ref.width,
|
|
21
|
-
height = _ref.height
|
|
21
|
+
height = _ref.height,
|
|
22
|
+
border = _ref.border;
|
|
22
23
|
var _useState = useState(),
|
|
23
24
|
_useState2 = _slicedToArray(_useState, 2),
|
|
24
25
|
fileState = _useState2[0],
|
|
@@ -102,13 +103,15 @@ export var MediaInlineImageCardInternal = function MediaInlineImageCardInternal(
|
|
|
102
103
|
};
|
|
103
104
|
}
|
|
104
105
|
return {
|
|
105
|
-
width: Math.round(aspectRatio *
|
|
106
|
-
height:
|
|
106
|
+
width: Math.round(aspectRatio * referenceHeights['h1']),
|
|
107
|
+
height: referenceHeights['h1']
|
|
107
108
|
};
|
|
108
109
|
}, [width, height, aspectRatio]);
|
|
109
110
|
return jsx(InlineImageWrapper, {
|
|
110
111
|
isSelected: isSelected,
|
|
111
|
-
aspectRatio: aspectRatio
|
|
112
|
+
aspectRatio: aspectRatio,
|
|
113
|
+
borderColor: border === null || border === void 0 ? void 0 : border.borderColor,
|
|
114
|
+
borderSize: border === null || border === void 0 ? void 0 : border.borderSize
|
|
112
115
|
}, content(scaledDimension));
|
|
113
116
|
};
|
|
114
117
|
export var MediaInlineImageCard = injectIntl(MediaInlineImageCardInternal, {
|
|
@@ -1,10 +1,42 @@
|
|
|
1
1
|
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
2
2
|
var _templateObject, _templateObject2;
|
|
3
3
|
import { css } from '@emotion/react';
|
|
4
|
-
import {
|
|
4
|
+
import { B300 } from '@atlaskit/theme/colors';
|
|
5
|
+
import { DEFAULT_INLINE_IMAGE_ASPECT_RATIO, DEFAULT_INLINE_IMAGE_BORDER_SIZE, referenceHeights } from './constants';
|
|
5
6
|
export var INLINE_IMAGE_WRAPPER_CLASS_NAME = 'media-inline-image-wrapper';
|
|
6
7
|
export var INLINE_IMAGE_ASPECT_RATIO_CSS_VAR_KEY = '--editor-media-inline-image-aspect-ratio';
|
|
8
|
+
export var INLINE_IMAGE_BORDER_SIZE_CSS_VAR_KEY = '--editor-media-inline-image-border-size';
|
|
9
|
+
export var INLINE_IMAGE_BORDER_COLOR_CSS_VAR_KEY = '--editor-media-inline-image-border-color';
|
|
7
10
|
var inlineImageHeight = function inlineImageHeight(height) {
|
|
8
|
-
|
|
11
|
+
var margin = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
12
|
+
return css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n > span[data-mark-type='border']\n > .mediaInlineView-content-wrap\n > .", ",\n > span[data-mark-type='border']\n > .", ",\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, INLINE_IMAGE_WRAPPER_CLASS_NAME, INLINE_IMAGE_WRAPPER_CLASS_NAME, height, margin);
|
|
9
13
|
};
|
|
10
|
-
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Shifting the mediaInline image component (renders image) to align nicely with
|
|
17
|
+
* mediaInline (renders text) is a bit of a testing ground. This numbers represent
|
|
18
|
+
* shift in top and bottom and size adjustments to make up for lack of 1to1 size
|
|
19
|
+
* mapping
|
|
20
|
+
*/
|
|
21
|
+
export var mediaInlineImageStyles = css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\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, referenceHeights['p'], inlineImageHeight(referenceHeights['h1'], -3), inlineImageHeight(referenceHeights['h2'], -3), inlineImageHeight(referenceHeights['h3'], -2), inlineImageHeight(referenceHeights['h4'], -2), inlineImageHeight(referenceHeights['h5'], -2), inlineImageHeight(referenceHeights['h6'], -2));
|
|
22
|
+
export var wrapperStyle = css({
|
|
23
|
+
display: 'inline-flex',
|
|
24
|
+
justifyContent: 'center',
|
|
25
|
+
alignItems: 'center',
|
|
26
|
+
verticalAlign: 'middle',
|
|
27
|
+
overflow: 'hidden',
|
|
28
|
+
borderRadius: "var(--ds-border-radius, 3px)",
|
|
29
|
+
aspectRatio: "var(".concat(INLINE_IMAGE_ASPECT_RATIO_CSS_VAR_KEY, ", ").concat(DEFAULT_INLINE_IMAGE_ASPECT_RATIO, ")")
|
|
30
|
+
});
|
|
31
|
+
export var selectedStyle = css({
|
|
32
|
+
cursor: 'pointer',
|
|
33
|
+
boxShadow: "0 0 0 1px ".concat("var(--ds-border-selected, ".concat(B300, ")")),
|
|
34
|
+
outline: 'none'
|
|
35
|
+
});
|
|
36
|
+
export var borderStyle = css({
|
|
37
|
+
borderColor: "var(".concat(INLINE_IMAGE_BORDER_COLOR_CSS_VAR_KEY, ")"),
|
|
38
|
+
borderStyle: 'solid',
|
|
39
|
+
borderRadius: "calc(var(".concat(INLINE_IMAGE_BORDER_SIZE_CSS_VAR_KEY, ", ").concat(DEFAULT_INLINE_IMAGE_BORDER_SIZE, ") * 2px)"),
|
|
40
|
+
borderWidth: "calc(var(".concat(INLINE_IMAGE_BORDER_SIZE_CSS_VAR_KEY, ", ").concat(DEFAULT_INLINE_IMAGE_BORDER_SIZE, ") * 1px)"),
|
|
41
|
+
boxSizing: "border-box"
|
|
42
|
+
});
|
|
@@ -6,7 +6,7 @@ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbol
|
|
|
6
6
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
7
7
|
var SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
|
|
8
8
|
var packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
|
|
9
|
-
var packageVersion = "76.
|
|
9
|
+
var packageVersion = "76.28.0";
|
|
10
10
|
var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
|
|
11
11
|
// Remove URL as it has UGC
|
|
12
12
|
// TODO: Sanitise the URL instead of just removing it
|
|
@@ -2,37 +2,20 @@ import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral
|
|
|
2
2
|
var _templateObject, _templateObject2, _templateObject3;
|
|
3
3
|
import { css } from '@emotion/react';
|
|
4
4
|
import { N60A, Y300, Y75 } from '@atlaskit/theme/colors';
|
|
5
|
-
import { themed } from '@atlaskit/theme/components';
|
|
6
5
|
export var annotationPrefix = 'ak-editor-annotation';
|
|
7
6
|
export var AnnotationSharedClassNames = {
|
|
8
7
|
focus: "".concat(annotationPrefix, "-focus"),
|
|
9
8
|
blur: "".concat(annotationPrefix, "-blur"),
|
|
10
9
|
draft: "".concat(annotationPrefix, "-draft")
|
|
11
10
|
};
|
|
12
|
-
var DY75 = 'rgb(111, 92, 37)';
|
|
13
|
-
var DY300 = '#ffd557';
|
|
14
11
|
var Y75a = 'rgba(255, 240, 179, 0.5)';
|
|
15
12
|
var Y200a = 'rgba(255, 196, 0, 0.82)';
|
|
16
|
-
var
|
|
17
|
-
var DY200 = '#82641c';
|
|
18
|
-
export var AnnotationSharedCSSByState = function AnnotationSharedCSSByState(props) {
|
|
13
|
+
export var AnnotationSharedCSSByState = function AnnotationSharedCSSByState() {
|
|
19
14
|
return {
|
|
20
|
-
focus: css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\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
|
|
21
|
-
|
|
22
|
-
dark: "var(--ds-background-accent-yellow-subtler, ".concat(DY75, ")")
|
|
23
|
-
})(props), themed({
|
|
24
|
-
light: "var(--ds-border-accent-yellow, ".concat(Y300, ")"),
|
|
25
|
-
dark: "var(--ds-border-accent-yellow, ".concat(DY300, ")")
|
|
26
|
-
})(props), "var(--ds-shadow-overlay, ".concat("1px 2px 3px ".concat(N60A, ", -1px 2px 3px ").concat(N60A), ")")),
|
|
27
|
-
blur: css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n background: ", ";\n border-bottom: 2px solid\n ", ";\n cursor: pointer;\n "])), themed({
|
|
28
|
-
light: "var(--ds-background-accent-yellow-subtlest, ".concat(Y75a, ")"),
|
|
29
|
-
dark: "var(--ds-background-accent-yellow-subtlest, ".concat(DY75a, ")")
|
|
30
|
-
})(props), themed({
|
|
31
|
-
light: "var(--ds-border-accent-yellow, ".concat(Y200a, ")"),
|
|
32
|
-
dark: "var(--ds-border-accent-yellow, ".concat(DY200, ")")
|
|
33
|
-
})(props))
|
|
15
|
+
focus: css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\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(Y75, ")"), "var(--ds-border-accent-yellow, ".concat(Y300, ")"), "var(--ds-shadow-overlay, ".concat("1px 2px 3px ".concat(N60A, ", -1px 2px 3px ").concat(N60A), ")")),
|
|
16
|
+
blur: css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\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, ")"))
|
|
34
17
|
};
|
|
35
18
|
};
|
|
36
|
-
export var annotationSharedStyles = function annotationSharedStyles(
|
|
37
|
-
return css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n .ProseMirror {\n .", " {\n ", ";\n }\n\n .", " {\n ", ";\n cursor: initial;\n }\n\n .", " {\n ", ";\n }\n }\n"])), AnnotationSharedClassNames.focus, AnnotationSharedCSSByState(
|
|
19
|
+
export var annotationSharedStyles = function annotationSharedStyles() {
|
|
20
|
+
return css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\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);
|
|
38
21
|
};
|
|
@@ -2,9 +2,8 @@ import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral
|
|
|
2
2
|
var _templateObject, _templateObject2;
|
|
3
3
|
import { css } from '@emotion/react';
|
|
4
4
|
import { akEditorCodeFontFamily, akEditorLineHeight, akEditorTableCellMinWidth, blockNodesVerticalMargin, overflowShadow, relativeFontSizeToBase16 } from '@atlaskit/editor-shared-styles';
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import { borderRadius, fontSize } from '@atlaskit/theme/constants';
|
|
5
|
+
import { N20, N30, N400, N800 } from '@atlaskit/theme/colors';
|
|
6
|
+
import { fontSize } from '@atlaskit/theme/constants';
|
|
8
7
|
export var CodeBlockSharedCssClassName = {
|
|
9
8
|
CODEBLOCK_CONTAINER: 'code-block',
|
|
10
9
|
CODEBLOCK_START: 'code-block--start',
|
|
@@ -14,25 +13,10 @@ export var CodeBlockSharedCssClassName = {
|
|
|
14
13
|
CODEBLOCK_CONTENT: 'code-content',
|
|
15
14
|
DS_CODEBLOCK: '[data-ds--code--code-block]'
|
|
16
15
|
};
|
|
17
|
-
export var codeBlockSharedStyles = function codeBlockSharedStyles(
|
|
18
|
-
return css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n .", " {\n position: relative;\n background-color: ", ";\n border-radius: ", "
|
|
19
|
-
|
|
20
|
-
dark: "var(--ds-background-neutral, ".concat(DN50, ")")
|
|
21
|
-
})(props), borderRadius(), overflowShadow({
|
|
22
|
-
background: themed({
|
|
23
|
-
light: "var(--ds-background-neutral, ".concat(N20, ")"),
|
|
24
|
-
dark: "var(--ds-background-neutral, ".concat(DN50, ")")
|
|
25
|
-
})(props),
|
|
16
|
+
export var codeBlockSharedStyles = function codeBlockSharedStyles() {
|
|
17
|
+
return css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\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)", blockNodesVerticalMargin, akEditorCodeFontFamily, akEditorTableCellMinWidth, CodeBlockSharedCssClassName.CODEBLOCK_START, CodeBlockSharedCssClassName.CODEBLOCK_END, CodeBlockSharedCssClassName.CODEBLOCK_CONTENT_WRAPPER, "var(--ds-background-neutral, ".concat(N20, ")"), "var(--ds-border-radius, 3px)", overflowShadow({
|
|
18
|
+
background: "var(--ds-background-neutral, ".concat(N20, ")"),
|
|
26
19
|
leftCoverWidth: "var(--ds-space-300, 24px)"
|
|
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,
|
|
28
|
-
light: "var(--ds-background-neutral, ".concat(N30, ")"),
|
|
29
|
-
dark: "var(--ds-background-neutral, ".concat(DN20, ")")
|
|
30
|
-
})(props), "var(--ds-space-100, 8px)", themed({
|
|
31
|
-
light: "var(--ds-text-subtlest, ".concat(N400, ")"),
|
|
32
|
-
dark: "var(--ds-text-subtlest, ".concat(DN400, ")")
|
|
33
|
-
})(props), relativeFontSizeToBase16(fontSize()), CodeBlockSharedCssClassName.CODEBLOCK_CONTENT, themed({
|
|
34
|
-
light: "var(--ds-text, ".concat(N800, ")"),
|
|
35
|
-
dark: "var(--ds-text, ".concat(DN800, ")")
|
|
36
|
-
})(props), borderRadius(), "var(--ds-space-100, 8px)", relativeFontSizeToBase16(fontSize()));
|
|
20
|
+
}), "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(N30, ")"), "var(--ds-space-100, 8px)", "var(--ds-text-subtlest, ".concat(N400, ")"), relativeFontSizeToBase16(fontSize()), CodeBlockSharedCssClassName.CODEBLOCK_CONTENT, "var(--ds-text, ".concat(N800, ")"), "var(--ds-border-radius, 3px)", "var(--ds-space-100, 8px)", relativeFontSizeToBase16(fontSize()));
|
|
37
21
|
};
|
|
38
22
|
export var codeBlockInListSafariFix = css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n ::before {\n content: ' ';\n line-height: ", ";\n }\n\n > p:first-child,\n > .code-block:first-child,\n > .ProseMirror-gapcursor:first-child + .code-block {\n margin-top: -", "em !important;\n }\n"])), akEditorLineHeight, akEditorLineHeight);
|
|
@@ -2,11 +2,7 @@ import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral
|
|
|
2
2
|
var _templateObject;
|
|
3
3
|
import { css } from '@emotion/react';
|
|
4
4
|
import { getCodeStyles } from '@atlaskit/code/inline';
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
return css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n .code {\n --ds--code--bg-color: ", ";\n ", "\n }\n "])), themed({
|
|
9
|
-
light: "var(--ds-background-neutral, ".concat(N30A, ")"),
|
|
10
|
-
dark: "var(--ds-background-neutral, ".concat(DN70, ")")
|
|
11
|
-
})(props), getCodeStyles());
|
|
5
|
+
import { N30A } from '@atlaskit/theme/colors';
|
|
6
|
+
export var codeMarkSharedStyles = function codeMarkSharedStyles() {
|
|
7
|
+
return css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n .code {\n --ds--code--bg-color: ", ";\n ", "\n }\n "])), "var(--ds-background-neutral, ".concat(N30A, ")"), getCodeStyles());
|
|
12
8
|
};
|