@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
|
@@ -8,10 +8,7 @@ import { hexToEditorBackgroundPaletteColor } from '@atlaskit/editor-palette';
|
|
|
8
8
|
import { akEditorTableCellMinWidth, blockNodesVerticalMargin } from '@atlaskit/editor-shared-styles';
|
|
9
9
|
import { akEditorCustomIconSize } from '@atlaskit/editor-shared-styles/consts';
|
|
10
10
|
import { emojiImage, emojiSprite } from '@atlaskit/emoji';
|
|
11
|
-
import { B100, B400, B50, B75, G200, G400, G50, G75, N0, N20, N60, P100, P400, P50, P75, R100,
|
|
12
|
-
import { themed } from '@atlaskit/theme/components';
|
|
13
|
-
// eslint-disable-next-line @atlaskit/design-system/no-deprecated-imports
|
|
14
|
-
import { borderRadius, gridSize } from '@atlaskit/theme/constants';
|
|
11
|
+
import { B100, B400, B50, B75, G200, G400, G50, G75, N0, N20, N60, P100, P400, P50, P75, R100, R400, R50, R75, T100, T50, T75, Y200, Y400, Y50, Y75 } from '@atlaskit/theme/colors';
|
|
15
12
|
var lightPanelColors = {
|
|
16
13
|
info: B50,
|
|
17
14
|
note: P50,
|
|
@@ -90,28 +87,10 @@ var lightIconColor = {
|
|
|
90
87
|
warning: "var(--ds-icon-warning, ".concat(Y400, ")"),
|
|
91
88
|
error: "var(--ds-icon-danger, ".concat(R400, ")")
|
|
92
89
|
};
|
|
93
|
-
var darkIconColor = {
|
|
94
|
-
info: "var(--ds-icon-information, ".concat(B100, ")"),
|
|
95
|
-
note: "var(--ds-icon-discovery, ".concat(P100, ")"),
|
|
96
|
-
tip: "var(--ds-icon-success, ".concat(G200, ")"),
|
|
97
|
-
success: "var(--ds-icon-success, ".concat(G200, ")"),
|
|
98
|
-
warning: "var(--ds-icon-warning, ".concat(Y100, ")"),
|
|
99
|
-
error: "var(--ds-icon-danger, ".concat(R200, ")")
|
|
100
|
-
};
|
|
101
|
-
var tokenDarkPanelColors = {
|
|
102
|
-
info: "var(--ds-background-information, ".concat(darkPanelColors['info'], ")"),
|
|
103
|
-
note: "var(--ds-background-discovery, ".concat(darkPanelColors['note'], ")"),
|
|
104
|
-
tip: "var(--ds-background-success, ".concat(darkPanelColors['tip'], ")"),
|
|
105
|
-
success: "var(--ds-background-success, ".concat(darkPanelColors['success'], ")"),
|
|
106
|
-
warning: "var(--ds-background-warning, ".concat(darkPanelColors['warning'], ")"),
|
|
107
|
-
error: "var(--ds-background-danger, ".concat(darkPanelColors['error'], ")")
|
|
108
|
-
};
|
|
109
90
|
|
|
110
|
-
// TODO: Migrate away from gridSize
|
|
111
|
-
// Recommendation: Replace gridSize with 8
|
|
112
91
|
// New custom icons are a little smaller than predefined icons.
|
|
113
92
|
// To fix alignment issues with custom icons, vertical alignment is updated.
|
|
114
|
-
var panelEmojiSpriteVerticalAlignment = -(
|
|
93
|
+
var panelEmojiSpriteVerticalAlignment = -(8 * 3 - akEditorCustomIconSize) / 2;
|
|
115
94
|
var panelEmojiImageVerticalAlignment = panelEmojiSpriteVerticalAlignment - 1;
|
|
116
95
|
|
|
117
96
|
// TODO: https://product-fabric.atlassian.net/browse/DSP-4066
|
|
@@ -165,54 +144,22 @@ export var PanelSharedSelectors = {
|
|
|
165
144
|
copyButton: "button[aria-label=\"Copy\"]"
|
|
166
145
|
};
|
|
167
146
|
var iconDynamicStyles = function iconDynamicStyles(panelType) {
|
|
168
|
-
return
|
|
169
|
-
var light = lightIconColor[panelType];
|
|
170
|
-
var dark = darkIconColor[panelType];
|
|
171
|
-
var color = themed({
|
|
172
|
-
light: light,
|
|
173
|
-
dark: dark
|
|
174
|
-
})(props);
|
|
175
|
-
return "\n color: ".concat(color, ";\n ");
|
|
176
|
-
};
|
|
147
|
+
return "color: ".concat(lightIconColor[panelType], ";");
|
|
177
148
|
};
|
|
178
149
|
|
|
179
150
|
// Provides the color without tokens, used when converting to a custom panel
|
|
180
151
|
export var getPanelTypeBackgroundNoTokens = function getPanelTypeBackgroundNoTokens(panelType) {
|
|
181
|
-
|
|
182
|
-
var light = lightPanelColors[panelType];
|
|
183
|
-
var dark = darkPanelColors[panelType];
|
|
184
|
-
var background = themed({
|
|
185
|
-
light: light,
|
|
186
|
-
dark: dark
|
|
187
|
-
})(props);
|
|
188
|
-
return background || 'none';
|
|
152
|
+
return lightPanelColors[panelType] || 'none';
|
|
189
153
|
};
|
|
190
154
|
export var getPanelTypeBackground = function getPanelTypeBackground(panelType) {
|
|
191
|
-
|
|
192
|
-
var light = hexToEditorBackgroundPaletteColor(lightPanelColors[panelType]);
|
|
193
|
-
// hexToEditorBackgroundPaletteColor has a light mode as a fallback color - for legacy dark mode we define the tokens locally
|
|
194
|
-
var dark = tokenDarkPanelColors[panelType];
|
|
195
|
-
var background = themed({
|
|
196
|
-
light: light,
|
|
197
|
-
dark: dark
|
|
198
|
-
})(props);
|
|
199
|
-
return background || 'none';
|
|
155
|
+
return hexToEditorBackgroundPaletteColor(lightPanelColors[panelType]) || 'none';
|
|
200
156
|
};
|
|
201
157
|
var mainDynamicStyles = function mainDynamicStyles(panelType) {
|
|
202
|
-
return
|
|
203
|
-
var background = getPanelTypeBackground(panelType, props);
|
|
204
|
-
var text = themed({
|
|
205
|
-
light: 'inherit',
|
|
206
|
-
dark: darkPanelColors.TextColor
|
|
207
|
-
})(props);
|
|
208
|
-
return "\n background-color: ".concat(background, ";\n color: ").concat(text, ";\n ");
|
|
209
|
-
};
|
|
158
|
+
return "\n background-color: ".concat(getPanelTypeBackground(panelType), ";\n color: inherit;\n ");
|
|
210
159
|
};
|
|
211
|
-
export var panelSharedStylesWithoutPrefix = function panelSharedStylesWithoutPrefix(
|
|
212
|
-
return css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n border-radius: ", "
|
|
213
|
-
dark: getPanelBackgroundDarkModeColors
|
|
214
|
-
})(props));
|
|
160
|
+
export var panelSharedStylesWithoutPrefix = function panelSharedStylesWithoutPrefix() {
|
|
161
|
+
return css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\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)", blockNodesVerticalMargin, "var(--ds-space-100, 8px)", akEditorTableCellMinWidth, mainDynamicStyles(PanelType.INFO), PanelSharedCssClassName.icon, "var(--ds-space-300, 24px)", "var(--ds-space-300, 24px)", "var(--ds-space-100, 8px)", iconDynamicStyles(PanelType.INFO), emojiSprite, panelEmojiSpriteVerticalAlignment, emojiImage, panelEmojiImageVerticalAlignment, PanelType.NOTE, mainDynamicStyles(PanelType.NOTE), PanelSharedCssClassName.icon, iconDynamicStyles(PanelType.NOTE), PanelType.TIP, mainDynamicStyles(PanelType.TIP), PanelSharedCssClassName.icon, iconDynamicStyles(PanelType.TIP), PanelType.WARNING, mainDynamicStyles(PanelType.WARNING), PanelSharedCssClassName.icon, iconDynamicStyles(PanelType.WARNING), PanelType.ERROR, mainDynamicStyles(PanelType.ERROR), PanelSharedCssClassName.icon, iconDynamicStyles(PanelType.ERROR), PanelType.SUCCESS, mainDynamicStyles(PanelType.SUCCESS), PanelSharedCssClassName.icon, iconDynamicStyles(PanelType.SUCCESS));
|
|
215
162
|
};
|
|
216
|
-
export var panelSharedStyles = function panelSharedStyles(
|
|
217
|
-
return css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n .", " {\n ", "\n }\n"])), PanelSharedCssClassName.prefix, panelSharedStylesWithoutPrefix(
|
|
163
|
+
export var panelSharedStyles = function panelSharedStyles() {
|
|
164
|
+
return css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n .", " {\n ", "\n }\n"])), PanelSharedCssClassName.prefix, panelSharedStylesWithoutPrefix());
|
|
218
165
|
};
|
|
@@ -2,14 +2,8 @@ import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral
|
|
|
2
2
|
var _templateObject;
|
|
3
3
|
import { css } from '@emotion/react';
|
|
4
4
|
import { akEditorLineHeight } from '@atlaskit/editor-shared-styles';
|
|
5
|
-
import {
|
|
6
|
-
import { themed } from '@atlaskit/theme/components';
|
|
7
|
-
var divider = themed({
|
|
8
|
-
light: "var(--ds-border, ".concat(N30A, ")"),
|
|
9
|
-
dark: "var(--ds-border, ".concat(DN50, ")")
|
|
10
|
-
});
|
|
11
|
-
|
|
5
|
+
import { N30A } from '@atlaskit/theme/colors';
|
|
12
6
|
// @see typography spreadsheet: https://docs.google.com/spreadsheets/d/1iYusRGCT4PoPfvxbJ8NrgjtfFgXLm5lpDWXzjua1W2E/edit#gid=93913128
|
|
13
|
-
export var ruleSharedStyles = function ruleSharedStyles(
|
|
14
|
-
return css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n & hr {\n border: none;\n background-color: ", ";\n margin: ", "em 0;\n height: 2px;\n border-radius: 1px;\n }\n"])),
|
|
7
|
+
export var ruleSharedStyles = function ruleSharedStyles() {
|
|
8
|
+
return css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\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(N30A, ")"), akEditorLineHeight);
|
|
15
9
|
};
|
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
1
|
import React, { useMemo } from 'react';
|
|
3
2
|
import { ThemeProvider } from '@emotion/react';
|
|
4
3
|
import { akEditorDefaultLayoutWidth } from '@atlaskit/editor-shared-styles';
|
|
5
|
-
import {
|
|
6
|
-
import { CHANNEL, fontSize } from '@atlaskit/theme/constants';
|
|
4
|
+
import { fontSize } from '@atlaskit/theme/constants';
|
|
7
5
|
import { WidthConsumer } from '../WidthProvider';
|
|
8
6
|
export function mapBreakpointToLayoutMaxWidth(breakpoint) {
|
|
9
7
|
switch (breakpoint) {
|
|
@@ -17,25 +15,21 @@ export function mapBreakpointToLayoutMaxWidth(breakpoint) {
|
|
|
17
15
|
export function BaseThemeWrapper(_ref) {
|
|
18
16
|
var baseFontSize = _ref.baseFontSize,
|
|
19
17
|
children = _ref.children;
|
|
20
|
-
var _useGlobalTheme = useGlobalTheme(),
|
|
21
|
-
mode = _useGlobalTheme.mode;
|
|
22
18
|
var memoizedTheme = useMemo(function () {
|
|
23
|
-
return
|
|
19
|
+
return {
|
|
24
20
|
baseFontSize: baseFontSize || fontSize(),
|
|
25
21
|
layoutMaxWidth: akEditorDefaultLayoutWidth
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
});
|
|
29
|
-
}, [baseFontSize, mode]);
|
|
22
|
+
};
|
|
23
|
+
}, [baseFontSize]);
|
|
30
24
|
return /*#__PURE__*/React.createElement(ThemeProvider, {
|
|
31
25
|
theme: memoizedTheme
|
|
32
26
|
}, children);
|
|
33
27
|
}
|
|
34
|
-
export function BaseTheme(
|
|
35
|
-
var children =
|
|
36
|
-
baseFontSize =
|
|
37
|
-
return /*#__PURE__*/React.createElement(WidthConsumer, null, function (
|
|
38
|
-
var breakpoint =
|
|
28
|
+
export function BaseTheme(_ref2) {
|
|
29
|
+
var children = _ref2.children,
|
|
30
|
+
baseFontSize = _ref2.baseFontSize;
|
|
31
|
+
return /*#__PURE__*/React.createElement(WidthConsumer, null, function (_ref3) {
|
|
32
|
+
var breakpoint = _ref3.breakpoint;
|
|
39
33
|
return /*#__PURE__*/React.createElement(BaseThemeWrapper, {
|
|
40
34
|
breakpoint: breakpoint,
|
|
41
35
|
baseFontSize: baseFontSize
|
|
@@ -14,12 +14,10 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re
|
|
|
14
14
|
import { Component } from 'react';
|
|
15
15
|
import { css, jsx } from '@emotion/react';
|
|
16
16
|
import { createAndFireEvent, withAnalyticsContext, withAnalyticsEvents } from '@atlaskit/analytics-next';
|
|
17
|
-
import {
|
|
18
|
-
import { themed } from '@atlaskit/theme/components';
|
|
19
|
-
import { borderRadius } from '@atlaskit/theme/constants';
|
|
17
|
+
import { N0, N50A, N60A, N900 } from '@atlaskit/theme/colors';
|
|
20
18
|
import Layer from '../Layer';
|
|
21
19
|
var packageName = "@atlaskit/editor-common";
|
|
22
|
-
var packageVersion = "76.
|
|
20
|
+
var packageVersion = "76.28.0";
|
|
23
21
|
var halfFocusRing = 1;
|
|
24
22
|
var dropOffset = '0, 8';
|
|
25
23
|
var DropList = /*#__PURE__*/function (_Component) {
|
|
@@ -35,14 +33,8 @@ var DropList = /*#__PURE__*/function (_Component) {
|
|
|
35
33
|
_defineProperty(_assertThisInitialized(_this), "wrapperStyles", css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\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;'));
|
|
36
34
|
_defineProperty(_assertThisInitialized(_this), "triggerStyles", css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\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;'));
|
|
37
35
|
/* eslint-disable @atlaskit/design-system/ensure-design-token-usage */
|
|
38
|
-
_defineProperty(_assertThisInitialized(_this), "menuWrapper", function (
|
|
39
|
-
return css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n color: ", ";\n background-color: ", ";\n border-radius: ", "
|
|
40
|
-
light: "var(--ds-text, ".concat(N900, ")"),
|
|
41
|
-
dark: "var(--ds-text, ".concat(DN600, ")")
|
|
42
|
-
})(theme), themed({
|
|
43
|
-
light: "var(--ds-surface-overlay, ".concat(N0, ")"),
|
|
44
|
-
dark: "var(--ds-surface-overlay, ".concat(DN50, ")")
|
|
45
|
-
})(theme), borderRadius(), "var(--ds-shadow-overlay, ".concat("0 4px 8px calc(-1 * 2px) ".concat(N50A, ", 0 0 1px ").concat(N60A), ")"), "var(--ds-space-050, 4px)");
|
|
36
|
+
_defineProperty(_assertThisInitialized(_this), "menuWrapper", function () {
|
|
37
|
+
return css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\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(N900, ")"), "var(--ds-surface-overlay, ".concat(N0, ")"), "var(--ds-border-radius, 3px)", "var(--ds-shadow-overlay, ".concat("0 4px 8px calc(-1 * 2px) ".concat(N50A, ", 0 0 1px ").concat(N60A), ")"), "var(--ds-space-050, 4px)");
|
|
46
38
|
});
|
|
47
39
|
/* eslint-enable @atlaskit/design-system/ensure-design-token-usage */
|
|
48
40
|
_defineProperty(_assertThisInitialized(_this), "componentDidMount", function () {
|
|
@@ -118,7 +110,6 @@ var DropList = /*#__PURE__*/function (_Component) {
|
|
|
118
110
|
_createClass(DropList, [{
|
|
119
111
|
key: "render",
|
|
120
112
|
value: function render() {
|
|
121
|
-
var _this2 = this;
|
|
122
113
|
var _this$props = this.props,
|
|
123
114
|
children = _this$props.children,
|
|
124
115
|
isOpen = _this$props.isOpen,
|
|
@@ -128,11 +119,7 @@ var DropList = /*#__PURE__*/function (_Component) {
|
|
|
128
119
|
testId = _this$props.testId,
|
|
129
120
|
id = _this$props.id;
|
|
130
121
|
var layerContent = isOpen ? jsx("div", {
|
|
131
|
-
css:
|
|
132
|
-
return _this2.menuWrapper({
|
|
133
|
-
theme: theme
|
|
134
|
-
});
|
|
135
|
-
},
|
|
122
|
+
css: this.menuWrapper,
|
|
136
123
|
"data-role": "droplistContent",
|
|
137
124
|
"data-testid": testId && "".concat(testId, "--content"),
|
|
138
125
|
ref: this.handleContentRef,
|
|
@@ -9,8 +9,7 @@ import React, { forwardRef } from 'react';
|
|
|
9
9
|
import { css, jsx } from '@emotion/react';
|
|
10
10
|
import { defineMessages } from 'react-intl-next';
|
|
11
11
|
import { akEditorLineHeight, akEditorSwoopCubicBezier, akLayoutGutterOffset, relativeFontSizeToBase16 } from '@atlaskit/editor-shared-styles';
|
|
12
|
-
import { B300,
|
|
13
|
-
import { themed } from '@atlaskit/theme/components';
|
|
12
|
+
import { B300, N200, N200A, N300A, N30A, N40A, N50A, N90 } from '@atlaskit/theme/colors';
|
|
14
13
|
// eslint-disable-next-line @atlaskit/design-system/no-deprecated-imports
|
|
15
14
|
import { fontSize, gridSize } from '@atlaskit/theme/constants';
|
|
16
15
|
export var messages = defineMessages({
|
|
@@ -37,30 +36,21 @@ export var messages = defineMessages({
|
|
|
37
36
|
});
|
|
38
37
|
var BORDER_RADIUS = "var(--ds-border-radius-100, 4px)";
|
|
39
38
|
var EXPAND_COLLAPSED_BACKGROUND = "var(--ds-background-neutral-subtle, transparent)";
|
|
40
|
-
var EXPAND_SELECTED_BACKGROUND =
|
|
41
|
-
light: "var(--ds-surface, rgba(255, 255, 255, 0.6))",
|
|
42
|
-
dark: "var(--ds-surface, rgba(9, 10, 11, 0.29))"
|
|
43
|
-
});
|
|
39
|
+
var EXPAND_SELECTED_BACKGROUND = "var(--ds-surface, rgba(255, 255, 255, 0.6))";
|
|
44
40
|
var EXPAND_FOCUSED_BORDER_COLOR = "var(--ds-border-focused, ".concat(B300, ")");
|
|
45
41
|
var EXPAND_COLLAPSED_BORDER_COLOR = 'transparent';
|
|
46
|
-
var EXPAND_EXPANDED_BORDER_COLOR =
|
|
47
|
-
light: "var(--ds-border, ".concat(N40A, ")"),
|
|
48
|
-
dark: "var(--ds-border, ".concat(DN50, ")")
|
|
49
|
-
});
|
|
42
|
+
var EXPAND_EXPANDED_BORDER_COLOR = "var(--ds-border, ".concat(N40A, ")");
|
|
50
43
|
export var ExpandIconWrapper = function ExpandIconWrapper(_ref) {
|
|
51
44
|
var children = _ref.children,
|
|
52
45
|
expanded = _ref.expanded;
|
|
53
46
|
return jsx("div", {
|
|
54
|
-
css: function css(
|
|
55
|
-
return expanded ? [expandIconWrapperStyle(
|
|
47
|
+
css: function css() {
|
|
48
|
+
return expanded ? [expandIconWrapperStyle(), expandIconWrapperExpandedStyle] : expandIconWrapperStyle();
|
|
56
49
|
}
|
|
57
50
|
}, children);
|
|
58
51
|
};
|
|
59
|
-
var expandIconWrapperStyle = function expandIconWrapperStyle(
|
|
60
|
-
return css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\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"])),
|
|
61
|
-
light: "var(--ds-icon, ".concat(N90, ")"),
|
|
62
|
-
dark: "var(--ds-icon, #d9dde3)"
|
|
63
|
-
})(props), "var(--ds-border-radius-100, 4px)", "var(--ds-background-neutral-subtle-hovered, ".concat(N30A, ")"), akEditorSwoopCubicBezier);
|
|
52
|
+
var expandIconWrapperStyle = function expandIconWrapperStyle() {
|
|
53
|
+
return css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\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(N90, ")"), "var(--ds-border-radius-100, 4px)", "var(--ds-background-neutral-subtle-hovered, ".concat(N30A, ")"), akEditorSwoopCubicBezier);
|
|
64
54
|
};
|
|
65
55
|
var expandIconWrapperExpandedStyle = css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n svg {\n transform: rotate(90deg);\n }\n"])));
|
|
66
56
|
export var expandLayoutWrapperStyle = css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n width: ", ";\n height: ", ";\n"])), "var(--ds-space-300, 24px)", "var(--ds-space-300, 24px)");
|
|
@@ -82,35 +72,20 @@ var containerStyles = function containerStyles(styleProps) {
|
|
|
82
72
|
// and is the root level expand.
|
|
83
73
|
var marginHorizontal = styleProps['data-node-type'] === 'expand' ? "-".concat(akLayoutGutterOffset, "px") : 0;
|
|
84
74
|
var margin = "".concat(marginTop, " ").concat(marginHorizontal, " ").concat(marginBottom);
|
|
85
|
-
return function (
|
|
86
|
-
return css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\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
|
|
87
|
-
light: "var(--ds-border, ".concat(N50A, ")"),
|
|
88
|
-
dark: "var(--ds-border, ".concat(DN50, ")")
|
|
89
|
-
})(themeProps), EXPAND_SELECTED_BACKGROUND(themeProps));
|
|
75
|
+
return function () {
|
|
76
|
+
return css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\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, akEditorSwoopCubicBezier, akEditorSwoopCubicBezier, "var(--ds-space-100, 8px)", "var(--ds-border, ".concat(N50A, ")"), EXPAND_SELECTED_BACKGROUND);
|
|
90
77
|
};
|
|
91
78
|
};
|
|
92
79
|
var contentStyles = function contentStyles(styleProps) {
|
|
93
|
-
return function (
|
|
80
|
+
return function () {
|
|
94
81
|
return css(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\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)", gridSize() * 4 - 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 " : '');
|
|
95
82
|
};
|
|
96
83
|
};
|
|
97
|
-
var titleInputStyles = function titleInputStyles(
|
|
98
|
-
return css(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n outline: none;\n border: none;\n font-size: ", ";\n line-height: ", ";\n font-weight: normal;\n color: ", ";\n background: transparent;\n display: flex;\n flex: 1;\n padding: 0 0 0 ", ";\n width: 100%;\n\n &::placeholder {\n opacity:
|
|
99
|
-
light: "var(--ds-text-subtlest, ".concat(N200A, ")"),
|
|
100
|
-
dark: "var(--ds-text-subtlest, ".concat(DN600, ")")
|
|
101
|
-
})(props), "var(--ds-space-050, 4px)", themed({
|
|
102
|
-
light: 1,
|
|
103
|
-
dark: 0.6
|
|
104
|
-
})(props), themed({
|
|
105
|
-
light: "var(--ds-text-subtlest, ".concat(N200, ")"),
|
|
106
|
-
dark: "var(--ds-text-subtlest, ".concat(DN600, ")")
|
|
107
|
-
})(props));
|
|
84
|
+
var titleInputStyles = function titleInputStyles() {
|
|
85
|
+
return css(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n outline: none;\n border: none;\n font-size: ", ";\n line-height: ", ";\n font-weight: normal;\n color: ", ";\n background: transparent;\n display: flex;\n flex: 1;\n padding: 0 0 0 ", ";\n width: 100%;\n\n &::placeholder {\n opacity: 1;\n color: ", ";\n }\n"])), relativeFontSizeToBase16(fontSize()), akEditorLineHeight, "var(--ds-text-subtlest, ".concat(N200A, ")"), "var(--ds-space-050, 4px)", "var(--ds-text-subtlest, ".concat(N200, ")"));
|
|
108
86
|
};
|
|
109
|
-
var titleContainerStyles = function titleContainerStyles(
|
|
110
|
-
return css(_templateObject7 || (_templateObject7 = _taggedTemplateLiteral(["\n padding: 0;\n display: flex;\n align-items: flex-start;\n background: none;\n border: none;\n font-size: ", ";\n width: 100%;\n color: ", ";\n overflow: hidden;\n cursor: pointer;\n\n &:focus {\n outline: 0;\n }\n"])), relativeFontSizeToBase16(fontSize()),
|
|
111
|
-
light: "var(--ds-text-subtle, ".concat(N300A, ")"),
|
|
112
|
-
dark: "var(--ds-text-subtle, ".concat(DN600, ")")
|
|
113
|
-
})(props));
|
|
87
|
+
var titleContainerStyles = function titleContainerStyles() {
|
|
88
|
+
return css(_templateObject7 || (_templateObject7 = _taggedTemplateLiteral(["\n padding: 0;\n display: flex;\n align-items: flex-start;\n background: none;\n border: none;\n font-size: ", ";\n width: 100%;\n color: ", ";\n overflow: hidden;\n cursor: pointer;\n\n &:focus {\n outline: 0;\n }\n"])), relativeFontSizeToBase16(fontSize()), "var(--ds-text-subtle, ".concat(N300A, ")"));
|
|
114
89
|
};
|
|
115
90
|
export var sharedExpandStyles = {
|
|
116
91
|
titleInputStyles: titleInputStyles,
|
|
@@ -9,8 +9,8 @@ import { G400, N200, R400 } from '@atlaskit/theme/colors';
|
|
|
9
9
|
import { h200 } from '@atlaskit/theme/typography';
|
|
10
10
|
var errorColor = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n color: ", ";\n"])), "var(--ds-text-danger, ".concat(R400, ")"));
|
|
11
11
|
var validColor = css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n color: ", ";\n"])), "var(--ds-text-success, ".concat(G400, ")"));
|
|
12
|
-
var messageStyle = function messageStyle(
|
|
13
|
-
return css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n ", " font-weight: normal;\n color: ", ";\n margin-top: ", ";\n display: flex;\n justify-content: baseline;\n"])), h200(
|
|
12
|
+
var messageStyle = function messageStyle() {
|
|
13
|
+
return css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n ", " font-weight: normal;\n color: ", ";\n margin-top: ", ";\n display: flex;\n justify-content: baseline;\n"])), h200(), "var(--ds-text-subtlest, ".concat(N200, ")"), "var(--ds-space-050, 4px)");
|
|
14
14
|
};
|
|
15
15
|
var iconWrapperStyle = css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n display: flex;\n margin-right: ", ";\n"])), "var(--ds-space-050, 4px)");
|
|
16
16
|
export var HelperMessage = function HelperMessage(_ref) {
|
|
@@ -22,8 +22,8 @@ export var HelperMessage = function HelperMessage(_ref) {
|
|
|
22
22
|
export var ErrorMessage = function ErrorMessage(_ref2) {
|
|
23
23
|
var children = _ref2.children;
|
|
24
24
|
return jsx("div", {
|
|
25
|
-
css: function css(
|
|
26
|
-
return [messageStyle(
|
|
25
|
+
css: function css() {
|
|
26
|
+
return [messageStyle(), errorColor];
|
|
27
27
|
}
|
|
28
28
|
}, jsx("span", {
|
|
29
29
|
css: iconWrapperStyle
|
|
@@ -36,8 +36,8 @@ export var ErrorMessage = function ErrorMessage(_ref2) {
|
|
|
36
36
|
export var ValidMessage = function ValidMessage(_ref3) {
|
|
37
37
|
var children = _ref3.children;
|
|
38
38
|
return jsx("div", {
|
|
39
|
-
css: function css(
|
|
40
|
-
return [messageStyle(
|
|
39
|
+
css: function css() {
|
|
40
|
+
return [messageStyle(), validColor];
|
|
41
41
|
}
|
|
42
42
|
}, jsx("span", {
|
|
43
43
|
css: iconWrapperStyle
|
|
@@ -14,15 +14,13 @@ import PropTypes from 'prop-types';
|
|
|
14
14
|
import { createPortal, unmountComponentAtNode, unstable_renderSubtreeIntoContainer } from 'react-dom';
|
|
15
15
|
import { injectIntl, RawIntlProvider, useIntl } from 'react-intl-next';
|
|
16
16
|
import { default as AnalyticsReactContext } from '@atlaskit/analytics-next-stable-react-context';
|
|
17
|
-
import { useGlobalTheme } from '@atlaskit/theme/components';
|
|
18
17
|
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE } from '../../analytics';
|
|
19
18
|
import { EventDispatcher } from '../../event-dispatcher';
|
|
20
19
|
import IntlProviderIfMissingWrapper from '../IntlProviderIfMissingWrapper';
|
|
21
|
-
import { PortalProviderThemeProviders } from './PortalProviderThemesProvider';
|
|
22
20
|
export var PortalProviderAPI = /*#__PURE__*/function (_EventDispatcher) {
|
|
23
21
|
_inherits(PortalProviderAPI, _EventDispatcher);
|
|
24
22
|
var _super = _createSuper(PortalProviderAPI);
|
|
25
|
-
function PortalProviderAPI(intl, onAnalyticsEvent, analyticsContext
|
|
23
|
+
function PortalProviderAPI(intl, onAnalyticsEvent, analyticsContext) {
|
|
26
24
|
var _this;
|
|
27
25
|
_classCallCheck(this, PortalProviderAPI);
|
|
28
26
|
_this = _super.call(this);
|
|
@@ -33,7 +31,6 @@ export var PortalProviderAPI = /*#__PURE__*/function (_EventDispatcher) {
|
|
|
33
31
|
_this.intl = intl;
|
|
34
32
|
_this.onAnalyticsEvent = onAnalyticsEvent;
|
|
35
33
|
_this.useAnalyticsContext = analyticsContext;
|
|
36
|
-
_this.themeMode = themeMode;
|
|
37
34
|
return _this;
|
|
38
35
|
}
|
|
39
36
|
_createClass(PortalProviderAPI, [{
|
|
@@ -46,10 +43,7 @@ export var PortalProviderAPI = /*#__PURE__*/function (_EventDispatcher) {
|
|
|
46
43
|
hasAnalyticsContext: hasAnalyticsContext,
|
|
47
44
|
hasIntlContext: hasIntlContext
|
|
48
45
|
});
|
|
49
|
-
var
|
|
50
|
-
mode: this.themeMode
|
|
51
|
-
}, children());
|
|
52
|
-
var wrappedChildren = this.useAnalyticsContext ? /*#__PURE__*/React.createElement(AnalyticsContextWrapper, null, childrenWithThemeProviders) : childrenWithThemeProviders;
|
|
46
|
+
var wrappedChildren = this.useAnalyticsContext ? /*#__PURE__*/React.createElement(AnalyticsContextWrapper, null, children()) : children();
|
|
53
47
|
if (hasIntlContext) {
|
|
54
48
|
wrappedChildren = /*#__PURE__*/React.createElement(RawIntlProvider, {
|
|
55
49
|
value: this.intl
|
|
@@ -65,25 +59,20 @@ export var PortalProviderAPI = /*#__PURE__*/function (_EventDispatcher) {
|
|
|
65
59
|
key: "forceUpdate",
|
|
66
60
|
value: function forceUpdate(_ref) {
|
|
67
61
|
var _this2 = this;
|
|
68
|
-
var intl = _ref.intl
|
|
69
|
-
themeMode = _ref.themeMode;
|
|
62
|
+
var intl = _ref.intl;
|
|
70
63
|
this.intl = intl;
|
|
71
|
-
this.themeMode = themeMode;
|
|
72
64
|
this.portals.forEach(function (portal, container) {
|
|
73
65
|
if (!portal.hasAnalyticsContext && !_this2.useAnalyticsContext && !portal.hasIntlContext) {
|
|
74
66
|
return;
|
|
75
67
|
}
|
|
76
68
|
var wrappedChildren = portal.children();
|
|
77
|
-
var childrenWithThemeProviders = /*#__PURE__*/React.createElement(PortalProviderThemeProviders, {
|
|
78
|
-
mode: themeMode
|
|
79
|
-
}, wrappedChildren);
|
|
80
69
|
if (portal.hasAnalyticsContext && _this2.useAnalyticsContext) {
|
|
81
|
-
wrappedChildren = /*#__PURE__*/React.createElement(AnalyticsContextWrapper, null,
|
|
70
|
+
wrappedChildren = /*#__PURE__*/React.createElement(AnalyticsContextWrapper, null, wrappedChildren);
|
|
82
71
|
}
|
|
83
72
|
if (portal.hasIntlContext) {
|
|
84
73
|
wrappedChildren = /*#__PURE__*/React.createElement(RawIntlProvider, {
|
|
85
74
|
value: _this2.intl
|
|
86
|
-
},
|
|
75
|
+
}, wrappedChildren);
|
|
87
76
|
}
|
|
88
77
|
unstable_renderSubtreeIntoContainer(_this2.context, wrappedChildren, container);
|
|
89
78
|
});
|
|
@@ -131,7 +120,7 @@ var BasePortalProvider = /*#__PURE__*/function (_React$Component) {
|
|
|
131
120
|
var _this3;
|
|
132
121
|
_classCallCheck(this, BasePortalProvider);
|
|
133
122
|
_this3 = _super2.call(this, props);
|
|
134
|
-
_this3.portalProviderAPI = new PortalProviderAPI(props.intl, props.onAnalyticsEvent, props.useAnalyticsContext
|
|
123
|
+
_this3.portalProviderAPI = new PortalProviderAPI(props.intl, props.onAnalyticsEvent, props.useAnalyticsContext);
|
|
135
124
|
return _this3;
|
|
136
125
|
}
|
|
137
126
|
_createClass(BasePortalProvider, [{
|
|
@@ -143,8 +132,7 @@ var BasePortalProvider = /*#__PURE__*/function (_React$Component) {
|
|
|
143
132
|
key: "componentDidUpdate",
|
|
144
133
|
value: function componentDidUpdate() {
|
|
145
134
|
this.portalProviderAPI.forceUpdate({
|
|
146
|
-
intl: this.props.intl
|
|
147
|
-
themeMode: this.props.themeMode
|
|
135
|
+
intl: this.props.intl
|
|
148
136
|
});
|
|
149
137
|
}
|
|
150
138
|
}]);
|
|
@@ -167,10 +155,8 @@ var PortalProviderWithThemeAndIntlProviders = function PortalProviderWithThemeAn
|
|
|
167
155
|
useAnalyticsContext = _ref3.useAnalyticsContext,
|
|
168
156
|
render = _ref3.render;
|
|
169
157
|
var intl = useIntl();
|
|
170
|
-
var globalTheme = useGlobalTheme();
|
|
171
158
|
return /*#__PURE__*/React.createElement(BasePortalProvider, {
|
|
172
159
|
intl: intl,
|
|
173
|
-
themeMode: globalTheme.mode,
|
|
174
160
|
onAnalyticsEvent: onAnalyticsEvent,
|
|
175
161
|
useAnalyticsContext: useAnalyticsContext,
|
|
176
162
|
render: render
|
|
@@ -7,9 +7,7 @@ import { css, jsx } from '@emotion/react';
|
|
|
7
7
|
import { withAnalyticsContext, withAnalyticsEvents } from '@atlaskit/analytics-next';
|
|
8
8
|
import Button from '@atlaskit/button';
|
|
9
9
|
import ExpandIcon from '@atlaskit/icon/glyph/chevron-down';
|
|
10
|
-
import {
|
|
11
|
-
import { themed } from '@atlaskit/theme/components';
|
|
12
|
-
import { borderRadius } from '@atlaskit/theme/constants';
|
|
10
|
+
import { N0, N30A, N60A } from '@atlaskit/theme/colors';
|
|
13
11
|
import Tooltip from '@atlaskit/tooltip';
|
|
14
12
|
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, editorAnalyticsChannel, EVENT_TYPE } from '../../analytics';
|
|
15
13
|
import { ColorPalette, DEFAULT_BORDER_COLOR, getSelectedRowAndColumnFromPalette } from '../../ui-color';
|
|
@@ -25,11 +23,8 @@ var colorPickerExpandContainer = css(_templateObject2 || (_templateObject2 = _ta
|
|
|
25
23
|
// Control the size of color picker buttons and preview
|
|
26
24
|
// TODO: https://product-fabric.atlassian.net/browse/DSP-4134
|
|
27
25
|
/* eslint-disable @atlaskit/design-system/ensure-design-token-usage */
|
|
28
|
-
var colorPickerWrapper = function colorPickerWrapper(
|
|
29
|
-
return css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n border-radius: ", "
|
|
30
|
-
light: "var(--ds-surface-overlay, ".concat(N0, ")"),
|
|
31
|
-
dark: "var(--ds-surface-overlay, ".concat(DN50, ")")
|
|
32
|
-
})(theme), N60A, N60A, "var(--ds-space-100, 8px)");
|
|
26
|
+
var colorPickerWrapper = function colorPickerWrapper() {
|
|
27
|
+
return css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n border-radius: ", ";\n background-color: ", ";\n box-shadow: 0 4px 8px -2px ", ", 0 0 1px ", ";\n padding: ", " 0px;\n"])), "var(--ds-border-radius, 3px)", "var(--ds-surface-overlay, ".concat(N0, ")"), N60A, N60A, "var(--ds-space-100, 8px)");
|
|
33
28
|
};
|
|
34
29
|
/* eslint-enable @atlaskit/design-system/ensure-design-token-usage */
|
|
35
30
|
|
|
@@ -159,13 +154,10 @@ var ColorPickerButton = function ColorPickerButton(props) {
|
|
|
159
154
|
};
|
|
160
155
|
var title = props.title || '';
|
|
161
156
|
var currentColor = props.currentColor && props.hexToPaletteColor ? props.hexToPaletteColor(props.currentColor) : props.currentColor;
|
|
162
|
-
var buttonStyle = function buttonStyle(
|
|
157
|
+
var buttonStyle = function buttonStyle() {
|
|
163
158
|
var _props$size, _props$size2, _props$size3;
|
|
164
|
-
return css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n padding: ", " 10px;\n background-color: ", ";\n ", "\n &:before {\n display: flex;\n justify-content: center;\n align-items: center;\n align-self: center;\n content: '';\n border: 1px solid ", ";\n border-radius: ", "
|
|
165
|
-
!!((_props$size = props.size) !== null && _props$size !== void 0 && _props$size.height) && "height: inherit;", DEFAULT_BORDER_COLOR,
|
|
166
|
-
light: "var(--ds-background-neutral-subtle-hovered, ".concat(N30A, ")"),
|
|
167
|
-
dark: "var(--ds-background-neutral-subtle-hovered, ".concat(N30A, ")")
|
|
168
|
-
})(theme));
|
|
159
|
+
return css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n padding: ", " 10px;\n background-color: ", ";\n ", "\n &:before {\n display: flex;\n justify-content: center;\n align-items: center;\n align-self: center;\n content: '';\n border: 1px solid ", ";\n border-radius: ", ";\n background-color: ", ";\n width: ", ";\n height: ", ";\n padding: 0;\n margin: 0px ", ";\n }\n &:hover {\n background: ", ";\n }\n "])), "var(--ds-space-075, 6px)", "var(--ds-background-neutral-subtle, transparent)", /* If custom props size height, override the button base height property */
|
|
160
|
+
!!((_props$size = props.size) !== null && _props$size !== void 0 && _props$size.height) && "height: inherit;", DEFAULT_BORDER_COLOR, "var(--ds-border-radius, 3px)", currentColor || 'transparent', ((_props$size2 = props.size) === null || _props$size2 === void 0 ? void 0 : _props$size2.width) || '14px', ((_props$size3 = props.size) === null || _props$size3 === void 0 ? void 0 : _props$size3.height) || '14px', "var(--ds-space-025, 2px)", "var(--ds-background-neutral-subtle-hovered, ".concat(N30A, ")"));
|
|
169
161
|
};
|
|
170
162
|
return jsx("div", {
|
|
171
163
|
css: colorPickerButtonWrapper
|
|
@@ -23,8 +23,7 @@ import { css, jsx } from '@emotion/react';
|
|
|
23
23
|
import { akEditorFloatingPanelZIndex } from '@atlaskit/editor-shared-styles';
|
|
24
24
|
import { CustomItem, MenuGroup, Section } from '@atlaskit/menu';
|
|
25
25
|
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
26
|
-
import { B100,
|
|
27
|
-
import { themed } from '@atlaskit/theme/components';
|
|
26
|
+
import { B100, N70, N900 } from '@atlaskit/theme/colors';
|
|
28
27
|
import Tooltip from '@atlaskit/tooltip';
|
|
29
28
|
import { DropdownMenuSharedCssClassName } from '../../styles';
|
|
30
29
|
import { KeyDownHandlerContext } from '../../ui-menu/ToolbarArrowKeyNavigationProvider';
|
|
@@ -36,28 +35,14 @@ import { ArrowKeyNavigationType } from '../ArrowKeyNavigationProvider/types';
|
|
|
36
35
|
var wrapper = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n /* tooltip in ToolbarButton is display:block */\n & > div > div {\n display: flex;\n }\n"])));
|
|
37
36
|
var focusedMenuItemStyle = css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n box-shadow: inset 0px 0px 0px 2px ", ";\n outline: none;\n"])), "var(--ds-border-focused, ".concat(B100, ")"));
|
|
38
37
|
var buttonStyles = function buttonStyles(isActive, submenuActive) {
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
light: "var(--ds-text, ".concat(N900, ")"),
|
|
48
|
-
dark: "var(--ds-text, ".concat(DN600, ")")
|
|
49
|
-
})(theme), themed({
|
|
50
|
-
light: "var(--ds-background-neutral-subtle-hovered, rgb(244, 245, 247))",
|
|
51
|
-
dark: "var(--ds-background-neutral-subtle-hovered, rgb(59, 71, 92))"
|
|
52
|
-
})(theme), !submenuActive && "\n > span:active[aria-disabled='false'] {\n background-color: ".concat(themed({
|
|
53
|
-
light: "var(--ds-background-neutral-subtle-pressed, rgb(179, 212, 255))",
|
|
54
|
-
dark: "var(--ds-background-neutral-subtle-pressed, rgb(179, 212, 255))"
|
|
55
|
-
})(theme), ";\n }"), themed({
|
|
56
|
-
light: "var(--ds-text-disabled, ".concat(N70, ")"),
|
|
57
|
-
dark: "var(--ds-text-disabled, ".concat(DN80, ")")
|
|
58
|
-
})(theme), focusedMenuItemStyle); // The default focus-visible style is removed to ensure consistency across browsers
|
|
59
|
-
}
|
|
60
|
-
};
|
|
38
|
+
if (isActive) {
|
|
39
|
+
/**
|
|
40
|
+
* Hack for item to imitate old dropdown-menu selected styles
|
|
41
|
+
*/
|
|
42
|
+
return css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n > span,\n > span:hover,\n > span:active {\n background: ", ";\n color: ", ";\n }\n :focus > span[aria-disabled='false'] {\n ", ";\n }\n :focus-visible,\n :focus-visible > span[aria-disabled='false'] {\n outline: none;\n }\n "])), "var(--ds-background-selected, #6c798f)", "var(--ds-text, #fff)", focusedMenuItemStyle);
|
|
43
|
+
} else {
|
|
44
|
+
return css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n > span:hover[aria-disabled='false'] {\n color: ", ";\n background-color: ", ";\n }\n ", "\n > span[aria-disabled='true'] {\n color: ", ";\n }\n :focus > span[aria-disabled='false'] {\n ", ";\n }\n :focus-visible,\n :focus-visible > span[aria-disabled='false'] {\n outline: none;\n }\n "])), "var(--ds-text, ".concat(N900, ")"), "var(--ds-background-neutral-subtle-hovered, rgb(244, 245, 247))", !submenuActive && "\n > span:active[aria-disabled='false'] {\n background-color: ".concat("var(--ds-background-neutral-subtle-pressed, rgb(179, 212, 255))", ";\n }"), "var(--ds-text-disabled, ".concat(N70, ")"), focusedMenuItemStyle); // The default focus-visible style is removed to ensure consistency across browsers
|
|
45
|
+
}
|
|
61
46
|
};
|
|
62
47
|
|
|
63
48
|
var DropListWithOutsideListeners = withReactEditorViewOuterListeners(DropList);
|
|
@@ -291,10 +276,8 @@ function DropdownMenuItem(_ref) {
|
|
|
291
276
|
setSubmenuActive(!!event.target.closest(".".concat(DropdownMenuSharedCssClassName.SUBMENU)));
|
|
292
277
|
};
|
|
293
278
|
var dropListItem = jsx("div", {
|
|
294
|
-
css: function css(
|
|
295
|
-
return buttonStyles(item.isActive, submenuActive)
|
|
296
|
-
theme: theme
|
|
297
|
-
});
|
|
279
|
+
css: function css() {
|
|
280
|
+
return buttonStyles(item.isActive, submenuActive);
|
|
298
281
|
},
|
|
299
282
|
tabIndex: -1,
|
|
300
283
|
"aria-disabled": item.isDisabled ? 'true' : 'false',
|
|
@@ -1,3 +1,22 @@
|
|
|
1
1
|
export declare const DEFAULT_IMAGE_WIDTH = 250;
|
|
2
2
|
export declare const DEFAULT_IMAGE_HEIGHT = 200;
|
|
3
3
|
export declare const DEFAULT_INLINE_IMAGE_ASPECT_RATIO: number;
|
|
4
|
+
export declare const DEFAULT_INLINE_IMAGE_BORDER_SIZE = 0;
|
|
5
|
+
/**
|
|
6
|
+
* Reference Heights
|
|
7
|
+
*
|
|
8
|
+
* These heights enforce consistent sizes with media inline nodes due to
|
|
9
|
+
* inconsistencies with center aligned inline nodes and text.
|
|
10
|
+
*
|
|
11
|
+
* There is conversation about refactoring media inline nodes to conform to
|
|
12
|
+
* aligning correctly with the surrounding text.
|
|
13
|
+
*/
|
|
14
|
+
export declare const referenceHeights: {
|
|
15
|
+
p: number;
|
|
16
|
+
h1: number;
|
|
17
|
+
h2: number;
|
|
18
|
+
h3: number;
|
|
19
|
+
h4: number;
|
|
20
|
+
h5: number;
|
|
21
|
+
h6: number;
|
|
22
|
+
};
|
|
@@ -8,6 +8,10 @@ export interface MediaInlineImageCardProps {
|
|
|
8
8
|
mediaClient: MediaClient;
|
|
9
9
|
isSelected?: boolean;
|
|
10
10
|
isLazy?: boolean;
|
|
11
|
+
border?: {
|
|
12
|
+
borderSize?: number;
|
|
13
|
+
borderColor?: string;
|
|
14
|
+
};
|
|
11
15
|
}
|
|
12
16
|
export declare const MediaInlineImageCardInternal: FC<MediaInlineImageCardProps & WrappedComponentProps & MediaInlineAttrs>;
|
|
13
17
|
export declare const MediaInlineImageCard: FC<MediaInlineImageCardProps & MediaInlineAttrs>;
|