@atlaskit/editor-shared-styles 2.3.0 → 2.3.2
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 +13 -0
- package/dist/cjs/consts/consts.js +17 -37
- package/dist/cjs/consts/index.js +0 -1
- package/dist/cjs/index.js +0 -3
- package/dist/cjs/overflow-shadow/index.js +0 -1
- package/dist/cjs/overflow-shadow/overflow-shadow.js +5 -14
- package/dist/cjs/scrollbar-styles.js +3 -6
- package/dist/cjs/selection/index.js +0 -2
- package/dist/cjs/selection/types.js +0 -2
- package/dist/cjs/selection/utils.js +2 -13
- package/dist/cjs/shortcut/index.js +0 -1
- package/dist/cjs/shortcut/shortcut.js +1 -11
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/consts/consts.js +14 -17
- package/dist/es2019/overflow-shadow/overflow-shadow.js +10 -11
- package/dist/es2019/scrollbar-styles.js +5 -5
- package/dist/es2019/selection/types.js +0 -1
- package/dist/es2019/selection/utils.js +3 -9
- package/dist/es2019/shortcut/shortcut.js +2 -3
- package/dist/es2019/version.json +1 -1
- package/dist/esm/consts/consts.js +16 -21
- package/dist/esm/overflow-shadow/overflow-shadow.js +5 -8
- package/dist/esm/scrollbar-styles.js +3 -3
- package/dist/esm/selection/types.js +0 -1
- package/dist/esm/selection/utils.js +3 -9
- package/dist/esm/shortcut/shortcut.js +1 -4
- package/dist/esm/version.json +1 -1
- package/package.json +2 -2
- package/report.api.md +11 -0
- package/src/overflow-shadow/overflow-shadow.ts +4 -10
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
# @atlaskit/editor-shared-styles
|
|
2
2
|
|
|
3
|
+
## 2.3.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`0d93211414e`](https://bitbucket.org/atlassian/atlassian-frontend/commits/0d93211414e) - Updates usage of removed design token `utilities.UNSAFE_util.transparent` in favour of its replacement `utilities.UNSAFE.transparent`.
|
|
8
|
+
- Updated dependencies
|
|
9
|
+
|
|
10
|
+
## 2.3.1
|
|
11
|
+
|
|
12
|
+
### Patch Changes
|
|
13
|
+
|
|
14
|
+
- [`6455cf006b3`](https://bitbucket.org/atlassian/atlassian-frontend/commits/6455cf006b3) - Builds for this package now pass through a tokens babel plugin, removing runtime invocations of the tokens() function and improving performance.
|
|
15
|
+
|
|
3
16
|
## 2.3.0
|
|
4
17
|
|
|
5
18
|
### Minor Changes
|
|
@@ -1,23 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
7
|
exports.editorFontSize = exports.breakoutWideScaleRatio = exports.blockNodesVerticalMargin = exports.akRichMediaResizeZIndex = exports.akLayoutGutterOffset = exports.akEditorWideLayoutWidth = exports.akEditorUnitZIndex = exports.akEditorToolbarKeylineHeight = exports.akEditorTableToolbarSize = exports.akEditorTableToolbarSelected = exports.akEditorTableToolbarDelete = exports.akEditorTableToolbarDark = exports.akEditorTableToolbar = exports.akEditorTableNumberColumnWidth = exports.akEditorTableLegacyCellMinWidth = exports.akEditorTableFloatingControls = exports.akEditorTableCellSelected = exports.akEditorTableCellMinWidth = exports.akEditorTableCellDelete = exports.akEditorTableCellBackgroundOpacity = exports.akEditorTableBorderSelected = exports.akEditorTableBorderRadius = exports.akEditorTableBorderDelete = exports.akEditorTableBorderDark = exports.akEditorTableBorder = exports.akEditorSwoopCubicBezier = exports.akEditorSubtleAccent = exports.akEditorStickyHeaderZIndex = exports.akEditorSmallZIndex = exports.akEditorShadowZIndex = exports.akEditorSelectedNodeClassName = exports.akEditorSelectedIconColor = exports.akEditorSelectedBoxShadow = exports.akEditorSelectedBorderSize = exports.akEditorSelectedBorderColor = exports.akEditorSelectedBorderBoldSize = exports.akEditorSelectedBorder = exports.akEditorSelectedBlanketOpacity = exports.akEditorSelectedBlanketColor = exports.akEditorSelectedBgColor = exports.akEditorRuleBorderRadius = exports.akEditorRuleBackground = exports.akEditorPrimaryButton = exports.akEditorPopupText = exports.akEditorPopupBackground = exports.akEditorMobileMaxWidth = exports.akEditorMobileBreakoutPoint = exports.akEditorMenuZIndex = exports.akEditorMentionSelected = exports.akEditorMediaResizeHandlerPaddingWide = exports.akEditorMediaResizeHandlerPadding = exports.akEditorLineHeight = exports.akEditorInactiveForeground = exports.akEditorGutterPadding = exports.akEditorGridLineZIndex = exports.akEditorFullWidthLayoutWidth = exports.akEditorFullWidthLayoutLineLength = exports.akEditorFullPageMaxWidth = exports.akEditorFullPageDefaultFontSize = exports.akEditorFocus = exports.akEditorFloatingPanelZIndex = exports.akEditorFloatingOverlapPanelZIndex = exports.akEditorFloatingDialogZIndex = exports.akEditorDropdownActiveBackground = exports.akEditorDeleteIconColor = exports.akEditorDeleteBorder = exports.akEditorDeleteBackgroundWithOpacity = exports.akEditorDeleteBackgroundShaded = exports.akEditorDeleteBackground = exports.akEditorDefaultLayoutWidth = exports.akEditorCustomIconSize = exports.akEditorContextPanelWidth = exports.akEditorCodeInlinePadding = exports.akEditorCodeFontFamily = exports.akEditorCodeBlockPadding = exports.akEditorCodeBackground = exports.akEditorBreakoutPadding = exports.akEditorBlockquoteBorderColor = exports.akEditorActiveForeground = exports.akEditorActiveBackground = exports.VIEWPORT_SIZES = exports.DEFAULT_EMBED_CARD_WIDTH = exports.DEFAULT_EMBED_CARD_HEIGHT = exports.ATLASSIAN_NAVIGATION_HEIGHT = void 0;
|
|
9
8
|
exports.getTableCellBackgroundDarkModeColorCSS = getTableCellBackgroundDarkModeColorCSS;
|
|
10
9
|
exports.relativeSize = exports.relativeFontSizeToBase16 = exports.gridMediumMaxWidth = exports.getTableCellBackgroundDarkModeColors = void 0;
|
|
11
|
-
|
|
12
10
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
13
|
-
|
|
14
11
|
var _colors = require("@atlaskit/theme/colors");
|
|
15
|
-
|
|
16
12
|
var _constants = require("@atlaskit/theme/constants");
|
|
17
|
-
|
|
18
|
-
var _tokens = require("@atlaskit/tokens");
|
|
19
|
-
|
|
20
13
|
/* eslint-disable @atlaskit/design-system/ensure-design-token-usage */
|
|
14
|
+
|
|
21
15
|
var akEditorFullPageDefaultFontSize = 16;
|
|
22
16
|
exports.akEditorFullPageDefaultFontSize = akEditorFullPageDefaultFontSize;
|
|
23
17
|
var akEditorCodeFontFamily = (0, _constants.codeFontFamily)();
|
|
@@ -53,7 +47,6 @@ exports.akEditorDeleteBackground = akEditorDeleteBackground;
|
|
|
53
47
|
var akEditorDeleteBackgroundShaded = _colors.R50;
|
|
54
48
|
exports.akEditorDeleteBackgroundShaded = akEditorDeleteBackgroundShaded;
|
|
55
49
|
var akEditorDeleteBackgroundWithOpacity = 'rgba(255, 189, 173, 0.5)'; // R75 with 50% opacity
|
|
56
|
-
|
|
57
50
|
exports.akEditorDeleteBackgroundWithOpacity = akEditorDeleteBackgroundWithOpacity;
|
|
58
51
|
var akEditorDeleteBorder = _colors.R300;
|
|
59
52
|
exports.akEditorDeleteBorder = akEditorDeleteBorder;
|
|
@@ -69,9 +62,9 @@ var akEditorSelectedBlanketColor = _colors.B75;
|
|
|
69
62
|
exports.akEditorSelectedBlanketColor = akEditorSelectedBlanketColor;
|
|
70
63
|
var akEditorSelectedBorderSize = 1;
|
|
71
64
|
exports.akEditorSelectedBorderSize = akEditorSelectedBorderSize;
|
|
72
|
-
var akEditorSelectedBorder = "".concat(akEditorSelectedBorderSize, "px solid "
|
|
65
|
+
var akEditorSelectedBorder = "".concat(akEditorSelectedBorderSize, "px solid ", "var(--ds-border-selected, ".concat(akEditorSelectedBorderColor, ")"));
|
|
73
66
|
exports.akEditorSelectedBorder = akEditorSelectedBorder;
|
|
74
|
-
var akEditorSelectedBoxShadow = "0 0 0 ".concat(akEditorSelectedBorderSize, "px "
|
|
67
|
+
var akEditorSelectedBoxShadow = "0 0 0 ".concat(akEditorSelectedBorderSize, "px ", "var(--ds-border-selected, ".concat(akEditorSelectedBorderColor, ")"));
|
|
75
68
|
exports.akEditorSelectedBoxShadow = akEditorSelectedBoxShadow;
|
|
76
69
|
var akEditorSelectedIconColor = _colors.B400;
|
|
77
70
|
exports.akEditorSelectedIconColor = akEditorSelectedIconColor;
|
|
@@ -84,26 +77,21 @@ exports.akEditorUnitZIndex = akEditorUnitZIndex;
|
|
|
84
77
|
var akEditorShadowZIndex = 2;
|
|
85
78
|
exports.akEditorShadowZIndex = akEditorShadowZIndex;
|
|
86
79
|
var akEditorStickyHeaderZIndex = 11; // filmstrip uses 10 for its shadow
|
|
87
|
-
|
|
88
80
|
exports.akEditorStickyHeaderZIndex = akEditorStickyHeaderZIndex;
|
|
89
81
|
var akEditorSmallZIndex = akEditorStickyHeaderZIndex + 1;
|
|
90
82
|
exports.akEditorSmallZIndex = akEditorSmallZIndex;
|
|
91
|
-
var akEditorGridLineZIndex = 9999;
|
|
83
|
+
var akEditorGridLineZIndex = 9999;
|
|
84
|
+
// z-index for main menu bar -
|
|
92
85
|
// this is highest as it should be above anything else in editor below.
|
|
93
|
-
|
|
94
86
|
exports.akEditorGridLineZIndex = akEditorGridLineZIndex;
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
87
|
+
var akEditorMenuZIndex = _constants.layers.blanket();
|
|
88
|
+
// z-index used for floating toolbars like code block, table etc
|
|
99
89
|
exports.akEditorMenuZIndex = akEditorMenuZIndex;
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
90
|
+
var akEditorFloatingPanelZIndex = _constants.layers.layer();
|
|
91
|
+
// z-index used for pickers (date, emoji, mentions) and type-aheads, hyperlinks
|
|
104
92
|
exports.akEditorFloatingPanelZIndex = akEditorFloatingPanelZIndex;
|
|
105
|
-
var akEditorFloatingDialogZIndex = akEditorMenuZIndex + 10;
|
|
106
|
-
|
|
93
|
+
var akEditorFloatingDialogZIndex = akEditorMenuZIndex + 10;
|
|
94
|
+
// z-index used for floating toolbars table cell menu which are above block toolbars
|
|
107
95
|
exports.akEditorFloatingDialogZIndex = akEditorFloatingDialogZIndex;
|
|
108
96
|
var akEditorFloatingOverlapPanelZIndex = akEditorFloatingPanelZIndex + 5;
|
|
109
97
|
exports.akEditorFloatingOverlapPanelZIndex = akEditorFloatingOverlapPanelZIndex;
|
|
@@ -181,8 +169,9 @@ var akEditorRuleBorderRadius = '1px';
|
|
|
181
169
|
exports.akEditorRuleBorderRadius = akEditorRuleBorderRadius;
|
|
182
170
|
var akEditorToolbarKeylineHeight = 2;
|
|
183
171
|
exports.akEditorToolbarKeylineHeight = akEditorToolbarKeylineHeight;
|
|
184
|
-
var akEditorContextPanelWidth = 320;
|
|
172
|
+
var akEditorContextPanelWidth = 320;
|
|
185
173
|
|
|
174
|
+
// @see typography spreadsheet: https://docs.google.com/spreadsheets/d/1iYusRGCT4PoPfvxbJ8NrgjtfFgXLm5lpDWXzjua1W2E/edit#gid=93913128
|
|
186
175
|
exports.akEditorContextPanelWidth = akEditorContextPanelWidth;
|
|
187
176
|
var blockNodesVerticalMargin = '0.75rem';
|
|
188
177
|
exports.blockNodesVerticalMargin = blockNodesVerticalMargin;
|
|
@@ -194,14 +183,11 @@ var ATLASSIAN_NAVIGATION_HEIGHT = '56px';
|
|
|
194
183
|
exports.ATLASSIAN_NAVIGATION_HEIGHT = ATLASSIAN_NAVIGATION_HEIGHT;
|
|
195
184
|
var akEditorSelectedNodeClassName = 'ak-editor-selected-node';
|
|
196
185
|
exports.akEditorSelectedNodeClassName = akEditorSelectedNodeClassName;
|
|
197
|
-
|
|
198
186
|
var editorFontSize = function editorFontSize(_ref) {
|
|
199
187
|
var theme = _ref.theme;
|
|
200
188
|
return theme && theme.baseFontSize ? theme.baseFontSize : (0, _constants.fontSize)();
|
|
201
189
|
};
|
|
202
|
-
|
|
203
190
|
exports.editorFontSize = editorFontSize;
|
|
204
|
-
|
|
205
191
|
var relativeSize = function relativeSize(multiplier) {
|
|
206
192
|
return function (_ref2) {
|
|
207
193
|
var theme = _ref2.theme;
|
|
@@ -210,21 +196,16 @@ var relativeSize = function relativeSize(multiplier) {
|
|
|
210
196
|
}) * multiplier;
|
|
211
197
|
};
|
|
212
198
|
};
|
|
213
|
-
|
|
214
199
|
exports.relativeSize = relativeSize;
|
|
215
|
-
|
|
216
200
|
var relativeFontSizeToBase16 = function relativeFontSizeToBase16(px) {
|
|
217
201
|
if (typeof px === 'string') {
|
|
218
202
|
px = parseInt(px);
|
|
219
203
|
}
|
|
220
|
-
|
|
221
204
|
if (isNaN(px)) {
|
|
222
205
|
throw new Error("Invalid font size: '".concat(px, "'"));
|
|
223
206
|
}
|
|
224
|
-
|
|
225
207
|
return "".concat(px / 16, "rem");
|
|
226
208
|
};
|
|
227
|
-
|
|
228
209
|
exports.relativeFontSizeToBase16 = relativeFontSizeToBase16;
|
|
229
210
|
var VIEWPORT_SIZES = {
|
|
230
211
|
laptopHiDPI: {
|
|
@@ -255,20 +236,19 @@ var VIEWPORT_SIZES = {
|
|
|
255
236
|
width: 320,
|
|
256
237
|
height: 568
|
|
257
238
|
}
|
|
258
|
-
};
|
|
239
|
+
};
|
|
259
240
|
|
|
241
|
+
// to be updated in ED-10790: this should be variable threshold based on how many buttons enabled on main toolbar
|
|
260
242
|
exports.VIEWPORT_SIZES = VIEWPORT_SIZES;
|
|
261
243
|
var akEditorMobileMaxWidth = 0;
|
|
262
244
|
exports.akEditorMobileMaxWidth = akEditorMobileMaxWidth;
|
|
263
245
|
var getTableCellBackgroundDarkModeColors = [['White', '#000000'], ['Light blue', '#0C294F'], ['Light teal', '#0C343B'], ['Light green', '#052E21'], ['Light yellow', '#484123'], ['Light red', '#441C13'], ['Light purple', '#282249'], ['Light gray', '#202328'], ['Blue', '#0B3165'], ['Teal', '#044853'], ['Green', '#053927'], ['Yellow', '#6F5C25'], ['Red', '#582013'], ['Purple', '#3E327B'], ['Gray', '#475262'], ['Dark blue', '#003884'], ['Dark teal', '#055866'], ['Dark green', '#044932'], ['Dark yellow', '#82641C'], ['Dark red', '#6B2A19'], ['Dark purple', '#4D38B2']].map(function (_ref3) {
|
|
264
246
|
var _ref4 = (0, _slicedToArray2.default)(_ref3, 2),
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
247
|
+
colorName = _ref4[0],
|
|
248
|
+
colorValue = _ref4[1];
|
|
268
249
|
return getTableCellBackgroundDarkModeColorCSS(colorName, colorValue);
|
|
269
250
|
}).join('\n');
|
|
270
251
|
exports.getTableCellBackgroundDarkModeColors = getTableCellBackgroundDarkModeColors;
|
|
271
|
-
|
|
272
252
|
function getTableCellBackgroundDarkModeColorCSS(colorName, colorValue) {
|
|
273
253
|
return "\n &[colorname=\"".concat(colorName, "\"] {\n background-color: ").concat(colorValue, " !important; // !important to override default style color\n }\n ");
|
|
274
254
|
}
|
package/dist/cjs/consts/index.js
CHANGED
package/dist/cjs/index.js
CHANGED
|
@@ -1,31 +1,22 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
7
|
exports.overflowShadow = void 0;
|
|
9
|
-
|
|
10
8
|
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
11
|
-
|
|
12
9
|
var _react = require("@emotion/react");
|
|
13
|
-
|
|
14
10
|
var _constants = require("@atlaskit/theme/constants");
|
|
15
|
-
|
|
16
|
-
var _tokens = require("@atlaskit/tokens");
|
|
17
|
-
|
|
18
11
|
var _templateObject;
|
|
19
|
-
|
|
20
12
|
var overflowShadow = function overflowShadow(_ref) {
|
|
21
13
|
var background = _ref.background,
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
14
|
+
_ref$width = _ref.width,
|
|
15
|
+
width = _ref$width === void 0 ? "".concat((0, _constants.gridSize)(), "px") : _ref$width,
|
|
16
|
+
leftCoverWidth = _ref.leftCoverWidth,
|
|
17
|
+
rightCoverWidth = _ref.rightCoverWidth;
|
|
26
18
|
var leftCoverWidthResolved = leftCoverWidth || width;
|
|
27
19
|
var rightCoverWidthResolved = rightCoverWidth || width;
|
|
28
|
-
return (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n/* shadow cover left */\n linear-gradient(\n to right,\n ", " ", ",\n transparent ", "\n ),\n/* shadow cover background left */\n linear-gradient(\n to right,\n ", " ", ",\n transparent ", "\n ),\n/* shadow cover right */\n linear-gradient(\n to left,\n ", " ", ",\n transparent ", "\n ),\n/* shadow cover background right */\n linear-gradient(\n to left,\n ", " ", ",\n transparent ", "\n ),\n/* overflow shadow right spread */\n linear-gradient(\n to left,\n ", " 0,\n ", " ", "\n ),\n /* overflow shadow right perimeter */\n linear-gradient(\n to left,\n ", " 0,\n ", " ", "\n ),\n /* overflow shadow left spread */\n linear-gradient(\n to right,\n ", " 0,\n ", " ", "\n ),\n /* overflow shadow left perimeter */\n linear-gradient(\n to right,\n ", " 0,\n ", " ", "\n )\n"])), background, leftCoverWidthResolved, leftCoverWidthResolved, (
|
|
20
|
+
return (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n/* shadow cover left */\n linear-gradient(\n to right,\n ", " ", ",\n transparent ", "\n ),\n/* shadow cover background left */\n linear-gradient(\n to right,\n ", " ", ",\n transparent ", "\n ),\n/* shadow cover right */\n linear-gradient(\n to left,\n ", " ", ",\n transparent ", "\n ),\n/* shadow cover background right */\n linear-gradient(\n to left,\n ", " ", ",\n transparent ", "\n ),\n/* overflow shadow right spread */\n linear-gradient(\n to left,\n ", " 0,\n ", " ", "\n ),\n /* overflow shadow right perimeter */\n linear-gradient(\n to left,\n ", " 0,\n ", " ", "\n ),\n /* overflow shadow left spread */\n linear-gradient(\n to right,\n ", " 0,\n ", " ", "\n ),\n /* overflow shadow left perimeter */\n linear-gradient(\n to right,\n ", " 0,\n ", " ", "\n )\n"])), background, leftCoverWidthResolved, leftCoverWidthResolved, "var(--ds-surface-raised, transparent)", leftCoverWidthResolved, leftCoverWidthResolved, background, rightCoverWidthResolved, rightCoverWidthResolved, "var(--ds-surface-raised, transparent)", rightCoverWidthResolved, rightCoverWidthResolved, "var(--ds-shadow-overflow-spread, rgba(9, 30, 66, 0.13))", "var(--ds-UNSAFE-transparent, rgba(99, 114, 130, 0))", width, "var(--ds-shadow-overflow-perimeter, transparent)", "var(--ds-UNSAFE-transparent, transparent)", width, "var(--ds-shadow-overflow-spread, rgba(9, 30, 66, 0.13))", "var(--ds-UNSAFE-transparent, rgba(99, 114, 130, 0))", width, "var(--ds-shadow-overflow-perimeter, transparent)", "var(--ds-UNSAFE-transparent, transparent)", width);
|
|
29
21
|
};
|
|
30
|
-
|
|
31
22
|
exports.overflowShadow = overflowShadow;
|
|
@@ -4,12 +4,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.scrollbarStyles = void 0;
|
|
7
|
-
|
|
8
7
|
var _constants = require("@atlaskit/theme/constants");
|
|
8
|
+
var akGridSize = (0, _constants.gridSize)() + 'px';
|
|
9
9
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
var akGridSize = (0, _constants.gridSize)() + 'px'; // TODO: https://product-fabric.atlassian.net/browse/DSP-4494
|
|
13
|
-
|
|
14
|
-
var scrollbarStyles = "\n -ms-overflow-style: -ms-autohiding-scrollbar;\n\n &::-webkit-scrollbar {\n height: ".concat(akGridSize, ";\n width: ").concat(akGridSize, ";\n }\n\n &::-webkit-scrollbar-corner {\n display: none;\n }\n\n &::-webkit-scrollbar-thumb {\n background-color: ").concat((0, _tokens.token)('color.background.neutral.subtle', 'rgba(0, 0, 0, 0)'), ";\n }\n\n &:hover::-webkit-scrollbar-thumb {\n background-color: ").concat((0, _tokens.token)('color.background.neutral.bold', 'rgba(0, 0, 0, 0.2)'), ";\n border-radius: ").concat(akGridSize, ";\n }\n\n &::-webkit-scrollbar-thumb:hover {\n background-color: ").concat((0, _tokens.token)('color.background.neutral.bold.hovered', 'rgba(0, 0, 0, 0.4)'), ";\n }\n");
|
|
10
|
+
// TODO: https://product-fabric.atlassian.net/browse/DSP-4494
|
|
11
|
+
var scrollbarStyles = "\n -ms-overflow-style: -ms-autohiding-scrollbar;\n\n &::-webkit-scrollbar {\n height: ".concat(akGridSize, ";\n width: ").concat(akGridSize, ";\n }\n\n &::-webkit-scrollbar-corner {\n display: none;\n }\n\n &::-webkit-scrollbar-thumb {\n background-color: ", "var(--ds-background-neutral-subtle, rgba(0, 0, 0, 0))", ";\n }\n\n &:hover::-webkit-scrollbar-thumb {\n background-color: ", "var(--ds-background-neutral-bold, rgba(0, 0, 0, 0.2))", ";\n border-radius: ").concat(akGridSize, ";\n }\n\n &::-webkit-scrollbar-thumb:hover {\n background-color: ", "var(--ds-background-neutral-bold-hovered, rgba(0, 0, 0, 0.4))", ";\n }\n");
|
|
15
12
|
exports.scrollbarStyles = scrollbarStyles;
|
|
@@ -4,7 +4,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.SelectionStyle = void 0;
|
|
7
|
-
|
|
8
7
|
/**
|
|
9
8
|
* These are generic selection styles for all nodes
|
|
10
9
|
* If you have custom behaviour needed for a node, add that in the plugin's styles
|
|
@@ -12,7 +11,6 @@ exports.SelectionStyle = void 0;
|
|
|
12
11
|
*/
|
|
13
12
|
var SelectionStyle;
|
|
14
13
|
exports.SelectionStyle = SelectionStyle;
|
|
15
|
-
|
|
16
14
|
(function (SelectionStyle) {
|
|
17
15
|
SelectionStyle[SelectionStyle["Border"] = 0] = "Border";
|
|
18
16
|
SelectionStyle[SelectionStyle["BoxShadow"] = 1] = "BoxShadow";
|
|
@@ -4,13 +4,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.hideNativeBrowserTextSelectionStyles = exports.getSelectionStyles = void 0;
|
|
7
|
-
|
|
8
|
-
var _tokens = require("@atlaskit/tokens");
|
|
9
|
-
|
|
10
7
|
var _consts = require("../consts");
|
|
11
|
-
|
|
12
8
|
var _types = require("./types");
|
|
13
|
-
|
|
14
9
|
/**
|
|
15
10
|
* Adds correct selection styling for a node
|
|
16
11
|
* Pass in which selection style properties you want and it will return css string of necessary styles
|
|
@@ -26,25 +21,19 @@ var getSelectionStyles = function getSelectionStyles(selectionStyles) {
|
|
|
26
21
|
return getSelectionStyle(selectionStyle);
|
|
27
22
|
}).concat(hideNativeBrowserTextSelectionStyles).join('\n');
|
|
28
23
|
};
|
|
29
|
-
|
|
30
24
|
exports.getSelectionStyles = getSelectionStyles;
|
|
31
25
|
var hideNativeBrowserTextSelectionStyles = "\n ::selection,*::selection {\n background-color: transparent;\n }\n ::-moz-selection,*::-moz-selection {\n background-color: transparent;\n }\n";
|
|
32
26
|
exports.hideNativeBrowserTextSelectionStyles = hideNativeBrowserTextSelectionStyles;
|
|
33
|
-
|
|
34
27
|
var getSelectionStyle = function getSelectionStyle(style) {
|
|
35
28
|
switch (style) {
|
|
36
29
|
case _types.SelectionStyle.Border:
|
|
37
30
|
return "\n border: ".concat(_consts.akEditorSelectedBorder, ";\n\n // Fixes ED-15246: Trello card is visible through a border of a table border\n &::after {\n height: 100%;\n content: '\\00a0';\n background: ").concat(_consts.akEditorSelectedBorderColor, ";\n position: absolute;\n right: -1px;\n top: 0;\n bottom: 0;\n width: 1px;\n border: none;\n display: inline-block;\n }\n ");
|
|
38
|
-
|
|
39
31
|
case _types.SelectionStyle.BoxShadow:
|
|
40
32
|
return "\n box-shadow: ".concat(_consts.akEditorSelectedBoxShadow, ";\n border-color: transparent;\n ");
|
|
41
|
-
|
|
42
33
|
case _types.SelectionStyle.Background:
|
|
43
|
-
return "background-color: ".concat((
|
|
44
|
-
|
|
34
|
+
return "background-color: ".concat("var(--ds-background-selected, ".concat(_consts.akEditorSelectedBgColor, ")"), ";");
|
|
45
35
|
case _types.SelectionStyle.Blanket:
|
|
46
|
-
return "\n position: relative;\n\n // Fixes ED-9263, where emoji or inline card in panel makes selection go outside the panel\n // in Safari. Looks like it's caused by user-select: all in the emoji element\n -webkit-user-select: text;\n\n ::before {\n position: absolute;\n content: '';\n left: 0;\n right: 0;\n top: 0;\n bottom: 0;\n width: 100%;\n pointer-events: none;\n z-index: ".concat(_consts.akEditorSmallZIndex, ";\n background-color: "
|
|
47
|
-
|
|
36
|
+
return "\n position: relative;\n\n // Fixes ED-9263, where emoji or inline card in panel makes selection go outside the panel\n // in Safari. Looks like it's caused by user-select: all in the emoji element\n -webkit-user-select: text;\n\n ::before {\n position: absolute;\n content: '';\n left: 0;\n right: 0;\n top: 0;\n bottom: 0;\n width: 100%;\n pointer-events: none;\n z-index: ".concat(_consts.akEditorSmallZIndex, ";\n background-color: ", "var(--ds-blanket-selected, #B3D4FF4C)", "\n }");
|
|
48
37
|
default:
|
|
49
38
|
return '';
|
|
50
39
|
}
|
|
@@ -1,25 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
7
|
exports.shortcutStyle = void 0;
|
|
9
|
-
|
|
10
8
|
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
11
|
-
|
|
12
9
|
var _react = require("@emotion/react");
|
|
13
|
-
|
|
14
10
|
var _colors = require("@atlaskit/theme/colors");
|
|
15
|
-
|
|
16
11
|
var _constants = require("@atlaskit/theme/constants");
|
|
17
|
-
|
|
18
|
-
var _tokens = require("@atlaskit/tokens");
|
|
19
|
-
|
|
20
12
|
var _consts = require("../consts");
|
|
21
|
-
|
|
22
13
|
var _templateObject;
|
|
23
|
-
|
|
24
|
-
var shortcutStyle = (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n background-color: ", "; /* N60 at 50% */\n color: ", ";\n border-radius: ", "px;\n padding: 4px;\n line-height: 12px;\n font-size: ", ";\n align-self: flex-end;\n @media (max-width: ", "px) {\n display: none;\n }\n"])), (0, _tokens.token)('color.background.neutral', 'rgba(223, 225, 229, 0.5)'), (0, _tokens.token)('color.text.subtle', _colors.N100), (0, _constants.borderRadius)(), (0, _consts.relativeFontSizeToBase16)(11.67), _consts.akEditorMobileMaxWidth);
|
|
14
|
+
var shortcutStyle = (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n background-color: ", "; /* N60 at 50% */\n color: ", ";\n border-radius: ", "px;\n padding: 4px;\n line-height: 12px;\n font-size: ", ";\n align-self: flex-end;\n @media (max-width: ", "px) {\n display: none;\n }\n"])), "var(--ds-background-neutral, rgba(223, 225, 229, 0.5))", "var(--ds-text-subtle, ".concat(_colors.N100, ")"), (0, _constants.borderRadius)(), (0, _consts.relativeFontSizeToBase16)(11.67), _consts.akEditorMobileMaxWidth);
|
|
25
15
|
exports.shortcutStyle = shortcutStyle;
|
package/dist/cjs/version.json
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
/* eslint-disable @atlaskit/design-system/ensure-design-token-usage */
|
|
2
2
|
import { B100, B300, B400, B50, B75, DN50, DN70, N0, N100, N20, N30, N40, N50, N500, N700, N900, R300, R400, R50, R75 } from '@atlaskit/theme/colors';
|
|
3
3
|
import { codeFontFamily, fontSize as defaultFontSize, gridSize, layers } from '@atlaskit/theme/constants';
|
|
4
|
-
import { token } from '@atlaskit/tokens';
|
|
5
4
|
export const akEditorFullPageDefaultFontSize = 16;
|
|
6
5
|
export const akEditorCodeFontFamily = codeFontFamily();
|
|
7
6
|
export const akEditorInactiveForeground = N500;
|
|
@@ -20,7 +19,6 @@ export const akEditorCodeInlinePadding = '2px 4px';
|
|
|
20
19
|
export const akEditorDeleteBackground = R50;
|
|
21
20
|
export const akEditorDeleteBackgroundShaded = R50;
|
|
22
21
|
export const akEditorDeleteBackgroundWithOpacity = 'rgba(255, 189, 173, 0.5)'; // R75 with 50% opacity
|
|
23
|
-
|
|
24
22
|
export const akEditorDeleteBorder = R300;
|
|
25
23
|
export const akEditorDeleteIconColor = R400;
|
|
26
24
|
export const akEditorCustomIconSize = 20;
|
|
@@ -28,25 +26,24 @@ export const akEditorSelectedBorderColor = B300;
|
|
|
28
26
|
export const akEditorSelectedBgColor = B50;
|
|
29
27
|
export const akEditorSelectedBlanketColor = B75;
|
|
30
28
|
export const akEditorSelectedBorderSize = 1;
|
|
31
|
-
export const akEditorSelectedBorder = `${akEditorSelectedBorderSize}px solid ${
|
|
32
|
-
export const akEditorSelectedBoxShadow = `0 0 0 ${akEditorSelectedBorderSize}px ${
|
|
29
|
+
export const akEditorSelectedBorder = `${akEditorSelectedBorderSize}px solid ${`var(--ds-border-selected, ${akEditorSelectedBorderColor})`}`;
|
|
30
|
+
export const akEditorSelectedBoxShadow = `0 0 0 ${akEditorSelectedBorderSize}px ${`var(--ds-border-selected, ${akEditorSelectedBorderColor})`}`;
|
|
33
31
|
export const akEditorSelectedIconColor = B400;
|
|
34
32
|
export const akEditorSelectedBorderBoldSize = 2;
|
|
35
33
|
export const akEditorSelectedBlanketOpacity = 0.3;
|
|
36
34
|
export const akEditorUnitZIndex = 1;
|
|
37
35
|
export const akEditorShadowZIndex = 2;
|
|
38
36
|
export const akEditorStickyHeaderZIndex = 11; // filmstrip uses 10 for its shadow
|
|
39
|
-
|
|
40
37
|
export const akEditorSmallZIndex = akEditorStickyHeaderZIndex + 1;
|
|
41
|
-
export const akEditorGridLineZIndex = 9999;
|
|
38
|
+
export const akEditorGridLineZIndex = 9999;
|
|
39
|
+
// z-index for main menu bar -
|
|
42
40
|
// this is highest as it should be above anything else in editor below.
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
41
|
+
export const akEditorMenuZIndex = layers.blanket();
|
|
42
|
+
// z-index used for floating toolbars like code block, table etc
|
|
43
|
+
export const akEditorFloatingPanelZIndex = layers.layer();
|
|
44
|
+
// z-index used for pickers (date, emoji, mentions) and type-aheads, hyperlinks
|
|
45
|
+
export const akEditorFloatingDialogZIndex = akEditorMenuZIndex + 10;
|
|
46
|
+
// z-index used for floating toolbars table cell menu which are above block toolbars
|
|
50
47
|
export const akEditorFloatingOverlapPanelZIndex = akEditorFloatingPanelZIndex + 5;
|
|
51
48
|
export const akEditorMentionSelected = N100;
|
|
52
49
|
export const akEditorTableToolbarSize = 11;
|
|
@@ -85,8 +82,9 @@ export const akEditorLineHeight = 1.714;
|
|
|
85
82
|
export const akEditorRuleBackground = N30;
|
|
86
83
|
export const akEditorRuleBorderRadius = '1px';
|
|
87
84
|
export const akEditorToolbarKeylineHeight = 2;
|
|
88
|
-
export const akEditorContextPanelWidth = 320;
|
|
85
|
+
export const akEditorContextPanelWidth = 320;
|
|
89
86
|
|
|
87
|
+
// @see typography spreadsheet: https://docs.google.com/spreadsheets/d/1iYusRGCT4PoPfvxbJ8NrgjtfFgXLm5lpDWXzjua1W2E/edit#gid=93913128
|
|
90
88
|
export const blockNodesVerticalMargin = '0.75rem';
|
|
91
89
|
export const DEFAULT_EMBED_CARD_WIDTH = 680;
|
|
92
90
|
export const DEFAULT_EMBED_CARD_HEIGHT = 480;
|
|
@@ -104,11 +102,9 @@ export const relativeFontSizeToBase16 = px => {
|
|
|
104
102
|
if (typeof px === 'string') {
|
|
105
103
|
px = parseInt(px);
|
|
106
104
|
}
|
|
107
|
-
|
|
108
105
|
if (isNaN(px)) {
|
|
109
106
|
throw new Error(`Invalid font size: '${px}'`);
|
|
110
107
|
}
|
|
111
|
-
|
|
112
108
|
return `${px / 16}rem`;
|
|
113
109
|
};
|
|
114
110
|
export const VIEWPORT_SIZES = {
|
|
@@ -140,8 +136,9 @@ export const VIEWPORT_SIZES = {
|
|
|
140
136
|
width: 320,
|
|
141
137
|
height: 568
|
|
142
138
|
}
|
|
143
|
-
};
|
|
139
|
+
};
|
|
144
140
|
|
|
141
|
+
// to be updated in ED-10790: this should be variable threshold based on how many buttons enabled on main toolbar
|
|
145
142
|
export const akEditorMobileMaxWidth = 0;
|
|
146
143
|
export const getTableCellBackgroundDarkModeColors = [['White', '#000000'], ['Light blue', '#0C294F'], ['Light teal', '#0C343B'], ['Light green', '#052E21'], ['Light yellow', '#484123'], ['Light red', '#441C13'], ['Light purple', '#282249'], ['Light gray', '#202328'], ['Blue', '#0B3165'], ['Teal', '#044853'], ['Green', '#053927'], ['Yellow', '#6F5C25'], ['Red', '#582013'], ['Purple', '#3E327B'], ['Gray', '#475262'], ['Dark blue', '#003884'], ['Dark teal', '#055866'], ['Dark green', '#044932'], ['Dark yellow', '#82641C'], ['Dark red', '#6B2A19'], ['Dark purple', '#4D38B2']].map(([colorName, colorValue]) => getTableCellBackgroundDarkModeColorCSS(colorName, colorValue)).join('\n');
|
|
147
144
|
export function getTableCellBackgroundDarkModeColorCSS(colorName, colorValue) {
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
/* eslint-disable @atlaskit/design-system/ensure-design-token-usage */
|
|
2
2
|
import { css } from '@emotion/react';
|
|
3
3
|
import { gridSize } from '@atlaskit/theme/constants';
|
|
4
|
-
import { token } from '@atlaskit/tokens';
|
|
5
4
|
export const overflowShadow = ({
|
|
6
5
|
background,
|
|
7
6
|
width = `${gridSize()}px`,
|
|
@@ -20,7 +19,7 @@ export const overflowShadow = ({
|
|
|
20
19
|
/* shadow cover background left */
|
|
21
20
|
linear-gradient(
|
|
22
21
|
to right,
|
|
23
|
-
${
|
|
22
|
+
${"var(--ds-surface-raised, transparent)"} ${leftCoverWidthResolved},
|
|
24
23
|
transparent ${leftCoverWidthResolved}
|
|
25
24
|
),
|
|
26
25
|
/* shadow cover right */
|
|
@@ -32,32 +31,32 @@ export const overflowShadow = ({
|
|
|
32
31
|
/* shadow cover background right */
|
|
33
32
|
linear-gradient(
|
|
34
33
|
to left,
|
|
35
|
-
${
|
|
34
|
+
${"var(--ds-surface-raised, transparent)"} ${rightCoverWidthResolved},
|
|
36
35
|
transparent ${rightCoverWidthResolved}
|
|
37
36
|
),
|
|
38
37
|
/* overflow shadow right spread */
|
|
39
38
|
linear-gradient(
|
|
40
39
|
to left,
|
|
41
|
-
${
|
|
42
|
-
${
|
|
40
|
+
${"var(--ds-shadow-overflow-spread, rgba(9, 30, 66, 0.13))"} 0,
|
|
41
|
+
${"var(--ds-UNSAFE-transparent, rgba(99, 114, 130, 0))"} ${width}
|
|
43
42
|
),
|
|
44
43
|
/* overflow shadow right perimeter */
|
|
45
44
|
linear-gradient(
|
|
46
45
|
to left,
|
|
47
|
-
${
|
|
48
|
-
${
|
|
46
|
+
${"var(--ds-shadow-overflow-perimeter, transparent)"} 0,
|
|
47
|
+
${"var(--ds-UNSAFE-transparent, transparent)"} ${width}
|
|
49
48
|
),
|
|
50
49
|
/* overflow shadow left spread */
|
|
51
50
|
linear-gradient(
|
|
52
51
|
to right,
|
|
53
|
-
${
|
|
54
|
-
${
|
|
52
|
+
${"var(--ds-shadow-overflow-spread, rgba(9, 30, 66, 0.13))"} 0,
|
|
53
|
+
${"var(--ds-UNSAFE-transparent, rgba(99, 114, 130, 0))"} ${width}
|
|
55
54
|
),
|
|
56
55
|
/* overflow shadow left perimeter */
|
|
57
56
|
linear-gradient(
|
|
58
57
|
to right,
|
|
59
|
-
${
|
|
60
|
-
${
|
|
58
|
+
${"var(--ds-shadow-overflow-perimeter, transparent)"} 0,
|
|
59
|
+
${"var(--ds-UNSAFE-transparent, transparent)"} ${width}
|
|
61
60
|
)
|
|
62
61
|
`;
|
|
63
62
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { gridSize } from '@atlaskit/theme/constants';
|
|
2
|
-
|
|
3
|
-
const akGridSize = gridSize() + 'px'; // TODO: https://product-fabric.atlassian.net/browse/DSP-4494
|
|
2
|
+
const akGridSize = gridSize() + 'px';
|
|
4
3
|
|
|
4
|
+
// TODO: https://product-fabric.atlassian.net/browse/DSP-4494
|
|
5
5
|
export const scrollbarStyles = `
|
|
6
6
|
-ms-overflow-style: -ms-autohiding-scrollbar;
|
|
7
7
|
|
|
@@ -15,15 +15,15 @@ export const scrollbarStyles = `
|
|
|
15
15
|
}
|
|
16
16
|
|
|
17
17
|
&::-webkit-scrollbar-thumb {
|
|
18
|
-
background-color: ${
|
|
18
|
+
background-color: ${"var(--ds-background-neutral-subtle, rgba(0, 0, 0, 0))"};
|
|
19
19
|
}
|
|
20
20
|
|
|
21
21
|
&:hover::-webkit-scrollbar-thumb {
|
|
22
|
-
background-color: ${
|
|
22
|
+
background-color: ${"var(--ds-background-neutral-bold, rgba(0, 0, 0, 0.2))"};
|
|
23
23
|
border-radius: ${akGridSize};
|
|
24
24
|
}
|
|
25
25
|
|
|
26
26
|
&::-webkit-scrollbar-thumb:hover {
|
|
27
|
-
background-color: ${
|
|
27
|
+
background-color: ${"var(--ds-background-neutral-bold-hovered, rgba(0, 0, 0, 0.4))"};
|
|
28
28
|
}
|
|
29
29
|
`;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { token } from '@atlaskit/tokens';
|
|
2
1
|
import { akEditorSelectedBgColor, akEditorSelectedBorder, akEditorSelectedBorderColor, akEditorSelectedBoxShadow, akEditorSmallZIndex } from '../consts';
|
|
3
2
|
import { SelectionStyle } from './types';
|
|
3
|
+
|
|
4
4
|
/**
|
|
5
5
|
* Adds correct selection styling for a node
|
|
6
6
|
* Pass in which selection style properties you want and it will return css string of necessary styles
|
|
@@ -11,7 +11,6 @@ import { SelectionStyle } from './types';
|
|
|
11
11
|
* }
|
|
12
12
|
*
|
|
13
13
|
*/
|
|
14
|
-
|
|
15
14
|
export const getSelectionStyles = selectionStyles => selectionStyles.map(selectionStyle => getSelectionStyle(selectionStyle)).concat(hideNativeBrowserTextSelectionStyles).join('\n');
|
|
16
15
|
export const hideNativeBrowserTextSelectionStyles = `
|
|
17
16
|
::selection,*::selection {
|
|
@@ -21,7 +20,6 @@ export const hideNativeBrowserTextSelectionStyles = `
|
|
|
21
20
|
background-color: transparent;
|
|
22
21
|
}
|
|
23
22
|
`;
|
|
24
|
-
|
|
25
23
|
const getSelectionStyle = style => {
|
|
26
24
|
switch (style) {
|
|
27
25
|
case SelectionStyle.Border:
|
|
@@ -42,16 +40,13 @@ const getSelectionStyle = style => {
|
|
|
42
40
|
display: inline-block;
|
|
43
41
|
}
|
|
44
42
|
`;
|
|
45
|
-
|
|
46
43
|
case SelectionStyle.BoxShadow:
|
|
47
44
|
return `
|
|
48
45
|
box-shadow: ${akEditorSelectedBoxShadow};
|
|
49
46
|
border-color: transparent;
|
|
50
47
|
`;
|
|
51
|
-
|
|
52
48
|
case SelectionStyle.Background:
|
|
53
|
-
return `background-color: ${
|
|
54
|
-
|
|
49
|
+
return `background-color: ${`var(--ds-background-selected, ${akEditorSelectedBgColor})`};`;
|
|
55
50
|
case SelectionStyle.Blanket:
|
|
56
51
|
return `
|
|
57
52
|
position: relative;
|
|
@@ -70,9 +65,8 @@ const getSelectionStyle = style => {
|
|
|
70
65
|
width: 100%;
|
|
71
66
|
pointer-events: none;
|
|
72
67
|
z-index: ${akEditorSmallZIndex};
|
|
73
|
-
background-color: ${
|
|
68
|
+
background-color: ${"var(--ds-blanket-selected, #B3D4FF4C)"}
|
|
74
69
|
}`;
|
|
75
|
-
|
|
76
70
|
default:
|
|
77
71
|
return '';
|
|
78
72
|
}
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import { css } from '@emotion/react';
|
|
2
2
|
import { N100 } from '@atlaskit/theme/colors';
|
|
3
3
|
import { borderRadius } from '@atlaskit/theme/constants';
|
|
4
|
-
import { token } from '@atlaskit/tokens';
|
|
5
4
|
import { akEditorMobileMaxWidth, relativeFontSizeToBase16 } from '../consts';
|
|
6
5
|
export const shortcutStyle = css`
|
|
7
|
-
background-color: ${
|
|
8
|
-
color: ${
|
|
6
|
+
background-color: ${"var(--ds-background-neutral, rgba(223, 225, 229, 0.5))"}; /* N60 at 50% */
|
|
7
|
+
color: ${`var(--ds-text-subtle, ${N100})`};
|
|
9
8
|
border-radius: ${borderRadius()}px;
|
|
10
9
|
padding: 4px;
|
|
11
10
|
line-height: 12px;
|
package/dist/es2019/version.json
CHANGED
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
2
|
-
|
|
3
2
|
/* eslint-disable @atlaskit/design-system/ensure-design-token-usage */
|
|
4
3
|
import { B100, B300, B400, B50, B75, DN50, DN70, N0, N100, N20, N30, N40, N50, N500, N700, N900, R300, R400, R50, R75 } from '@atlaskit/theme/colors';
|
|
5
4
|
import { codeFontFamily, fontSize as defaultFontSize, gridSize, layers } from '@atlaskit/theme/constants';
|
|
6
|
-
import { token } from '@atlaskit/tokens';
|
|
7
5
|
export var akEditorFullPageDefaultFontSize = 16;
|
|
8
6
|
export var akEditorCodeFontFamily = codeFontFamily();
|
|
9
7
|
export var akEditorInactiveForeground = N500;
|
|
@@ -22,7 +20,6 @@ export var akEditorCodeInlinePadding = '2px 4px';
|
|
|
22
20
|
export var akEditorDeleteBackground = R50;
|
|
23
21
|
export var akEditorDeleteBackgroundShaded = R50;
|
|
24
22
|
export var akEditorDeleteBackgroundWithOpacity = 'rgba(255, 189, 173, 0.5)'; // R75 with 50% opacity
|
|
25
|
-
|
|
26
23
|
export var akEditorDeleteBorder = R300;
|
|
27
24
|
export var akEditorDeleteIconColor = R400;
|
|
28
25
|
export var akEditorCustomIconSize = 20;
|
|
@@ -30,25 +27,24 @@ export var akEditorSelectedBorderColor = B300;
|
|
|
30
27
|
export var akEditorSelectedBgColor = B50;
|
|
31
28
|
export var akEditorSelectedBlanketColor = B75;
|
|
32
29
|
export var akEditorSelectedBorderSize = 1;
|
|
33
|
-
export var akEditorSelectedBorder = "".concat(akEditorSelectedBorderSize, "px solid "
|
|
34
|
-
export var akEditorSelectedBoxShadow = "0 0 0 ".concat(akEditorSelectedBorderSize, "px "
|
|
30
|
+
export var akEditorSelectedBorder = "".concat(akEditorSelectedBorderSize, "px solid ", "var(--ds-border-selected, ".concat(akEditorSelectedBorderColor, ")"));
|
|
31
|
+
export var akEditorSelectedBoxShadow = "0 0 0 ".concat(akEditorSelectedBorderSize, "px ", "var(--ds-border-selected, ".concat(akEditorSelectedBorderColor, ")"));
|
|
35
32
|
export var akEditorSelectedIconColor = B400;
|
|
36
33
|
export var akEditorSelectedBorderBoldSize = 2;
|
|
37
34
|
export var akEditorSelectedBlanketOpacity = 0.3;
|
|
38
35
|
export var akEditorUnitZIndex = 1;
|
|
39
36
|
export var akEditorShadowZIndex = 2;
|
|
40
37
|
export var akEditorStickyHeaderZIndex = 11; // filmstrip uses 10 for its shadow
|
|
41
|
-
|
|
42
38
|
export var akEditorSmallZIndex = akEditorStickyHeaderZIndex + 1;
|
|
43
|
-
export var akEditorGridLineZIndex = 9999;
|
|
39
|
+
export var akEditorGridLineZIndex = 9999;
|
|
40
|
+
// z-index for main menu bar -
|
|
44
41
|
// this is highest as it should be above anything else in editor below.
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
42
|
+
export var akEditorMenuZIndex = layers.blanket();
|
|
43
|
+
// z-index used for floating toolbars like code block, table etc
|
|
44
|
+
export var akEditorFloatingPanelZIndex = layers.layer();
|
|
45
|
+
// z-index used for pickers (date, emoji, mentions) and type-aheads, hyperlinks
|
|
46
|
+
export var akEditorFloatingDialogZIndex = akEditorMenuZIndex + 10;
|
|
47
|
+
// z-index used for floating toolbars table cell menu which are above block toolbars
|
|
52
48
|
export var akEditorFloatingOverlapPanelZIndex = akEditorFloatingPanelZIndex + 5;
|
|
53
49
|
export var akEditorMentionSelected = N100;
|
|
54
50
|
export var akEditorTableToolbarSize = 11;
|
|
@@ -87,8 +83,9 @@ export var akEditorLineHeight = 1.714;
|
|
|
87
83
|
export var akEditorRuleBackground = N30;
|
|
88
84
|
export var akEditorRuleBorderRadius = '1px';
|
|
89
85
|
export var akEditorToolbarKeylineHeight = 2;
|
|
90
|
-
export var akEditorContextPanelWidth = 320;
|
|
86
|
+
export var akEditorContextPanelWidth = 320;
|
|
91
87
|
|
|
88
|
+
// @see typography spreadsheet: https://docs.google.com/spreadsheets/d/1iYusRGCT4PoPfvxbJ8NrgjtfFgXLm5lpDWXzjua1W2E/edit#gid=93913128
|
|
92
89
|
export var blockNodesVerticalMargin = '0.75rem';
|
|
93
90
|
export var DEFAULT_EMBED_CARD_WIDTH = 680;
|
|
94
91
|
export var DEFAULT_EMBED_CARD_HEIGHT = 480;
|
|
@@ -110,11 +107,9 @@ export var relativeFontSizeToBase16 = function relativeFontSizeToBase16(px) {
|
|
|
110
107
|
if (typeof px === 'string') {
|
|
111
108
|
px = parseInt(px);
|
|
112
109
|
}
|
|
113
|
-
|
|
114
110
|
if (isNaN(px)) {
|
|
115
111
|
throw new Error("Invalid font size: '".concat(px, "'"));
|
|
116
112
|
}
|
|
117
|
-
|
|
118
113
|
return "".concat(px / 16, "rem");
|
|
119
114
|
};
|
|
120
115
|
export var VIEWPORT_SIZES = {
|
|
@@ -146,14 +141,14 @@ export var VIEWPORT_SIZES = {
|
|
|
146
141
|
width: 320,
|
|
147
142
|
height: 568
|
|
148
143
|
}
|
|
149
|
-
};
|
|
144
|
+
};
|
|
150
145
|
|
|
146
|
+
// to be updated in ED-10790: this should be variable threshold based on how many buttons enabled on main toolbar
|
|
151
147
|
export var akEditorMobileMaxWidth = 0;
|
|
152
148
|
export var getTableCellBackgroundDarkModeColors = [['White', '#000000'], ['Light blue', '#0C294F'], ['Light teal', '#0C343B'], ['Light green', '#052E21'], ['Light yellow', '#484123'], ['Light red', '#441C13'], ['Light purple', '#282249'], ['Light gray', '#202328'], ['Blue', '#0B3165'], ['Teal', '#044853'], ['Green', '#053927'], ['Yellow', '#6F5C25'], ['Red', '#582013'], ['Purple', '#3E327B'], ['Gray', '#475262'], ['Dark blue', '#003884'], ['Dark teal', '#055866'], ['Dark green', '#044932'], ['Dark yellow', '#82641C'], ['Dark red', '#6B2A19'], ['Dark purple', '#4D38B2']].map(function (_ref3) {
|
|
153
149
|
var _ref4 = _slicedToArray(_ref3, 2),
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
150
|
+
colorName = _ref4[0],
|
|
151
|
+
colorValue = _ref4[1];
|
|
157
152
|
return getTableCellBackgroundDarkModeColorCSS(colorName, colorValue);
|
|
158
153
|
}).join('\n');
|
|
159
154
|
export function getTableCellBackgroundDarkModeColorCSS(colorName, colorValue) {
|
|
@@ -1,18 +1,15 @@
|
|
|
1
1
|
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
2
|
-
|
|
3
2
|
var _templateObject;
|
|
4
|
-
|
|
5
3
|
/* eslint-disable @atlaskit/design-system/ensure-design-token-usage */
|
|
6
4
|
import { css } from '@emotion/react';
|
|
7
5
|
import { gridSize } from '@atlaskit/theme/constants';
|
|
8
|
-
import { token } from '@atlaskit/tokens';
|
|
9
6
|
export var overflowShadow = function overflowShadow(_ref) {
|
|
10
7
|
var background = _ref.background,
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
8
|
+
_ref$width = _ref.width,
|
|
9
|
+
width = _ref$width === void 0 ? "".concat(gridSize(), "px") : _ref$width,
|
|
10
|
+
leftCoverWidth = _ref.leftCoverWidth,
|
|
11
|
+
rightCoverWidth = _ref.rightCoverWidth;
|
|
15
12
|
var leftCoverWidthResolved = leftCoverWidth || width;
|
|
16
13
|
var rightCoverWidthResolved = rightCoverWidth || width;
|
|
17
|
-
return css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n/* shadow cover left */\n linear-gradient(\n to right,\n ", " ", ",\n transparent ", "\n ),\n/* shadow cover background left */\n linear-gradient(\n to right,\n ", " ", ",\n transparent ", "\n ),\n/* shadow cover right */\n linear-gradient(\n to left,\n ", " ", ",\n transparent ", "\n ),\n/* shadow cover background right */\n linear-gradient(\n to left,\n ", " ", ",\n transparent ", "\n ),\n/* overflow shadow right spread */\n linear-gradient(\n to left,\n ", " 0,\n ", " ", "\n ),\n /* overflow shadow right perimeter */\n linear-gradient(\n to left,\n ", " 0,\n ", " ", "\n ),\n /* overflow shadow left spread */\n linear-gradient(\n to right,\n ", " 0,\n ", " ", "\n ),\n /* overflow shadow left perimeter */\n linear-gradient(\n to right,\n ", " 0,\n ", " ", "\n )\n"])), background, leftCoverWidthResolved, leftCoverWidthResolved,
|
|
14
|
+
return css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n/* shadow cover left */\n linear-gradient(\n to right,\n ", " ", ",\n transparent ", "\n ),\n/* shadow cover background left */\n linear-gradient(\n to right,\n ", " ", ",\n transparent ", "\n ),\n/* shadow cover right */\n linear-gradient(\n to left,\n ", " ", ",\n transparent ", "\n ),\n/* shadow cover background right */\n linear-gradient(\n to left,\n ", " ", ",\n transparent ", "\n ),\n/* overflow shadow right spread */\n linear-gradient(\n to left,\n ", " 0,\n ", " ", "\n ),\n /* overflow shadow right perimeter */\n linear-gradient(\n to left,\n ", " 0,\n ", " ", "\n ),\n /* overflow shadow left spread */\n linear-gradient(\n to right,\n ", " 0,\n ", " ", "\n ),\n /* overflow shadow left perimeter */\n linear-gradient(\n to right,\n ", " 0,\n ", " ", "\n )\n"])), background, leftCoverWidthResolved, leftCoverWidthResolved, "var(--ds-surface-raised, transparent)", leftCoverWidthResolved, leftCoverWidthResolved, background, rightCoverWidthResolved, rightCoverWidthResolved, "var(--ds-surface-raised, transparent)", rightCoverWidthResolved, rightCoverWidthResolved, "var(--ds-shadow-overflow-spread, rgba(9, 30, 66, 0.13))", "var(--ds-UNSAFE-transparent, rgba(99, 114, 130, 0))", width, "var(--ds-shadow-overflow-perimeter, transparent)", "var(--ds-UNSAFE-transparent, transparent)", width, "var(--ds-shadow-overflow-spread, rgba(9, 30, 66, 0.13))", "var(--ds-UNSAFE-transparent, rgba(99, 114, 130, 0))", width, "var(--ds-shadow-overflow-perimeter, transparent)", "var(--ds-UNSAFE-transparent, transparent)", width);
|
|
18
15
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { gridSize } from '@atlaskit/theme/constants';
|
|
2
|
-
|
|
3
|
-
var akGridSize = gridSize() + 'px'; // TODO: https://product-fabric.atlassian.net/browse/DSP-4494
|
|
2
|
+
var akGridSize = gridSize() + 'px';
|
|
4
3
|
|
|
5
|
-
|
|
4
|
+
// TODO: https://product-fabric.atlassian.net/browse/DSP-4494
|
|
5
|
+
export var scrollbarStyles = "\n -ms-overflow-style: -ms-autohiding-scrollbar;\n\n &::-webkit-scrollbar {\n height: ".concat(akGridSize, ";\n width: ").concat(akGridSize, ";\n }\n\n &::-webkit-scrollbar-corner {\n display: none;\n }\n\n &::-webkit-scrollbar-thumb {\n background-color: ", "var(--ds-background-neutral-subtle, rgba(0, 0, 0, 0))", ";\n }\n\n &:hover::-webkit-scrollbar-thumb {\n background-color: ", "var(--ds-background-neutral-bold, rgba(0, 0, 0, 0.2))", ";\n border-radius: ").concat(akGridSize, ";\n }\n\n &::-webkit-scrollbar-thumb:hover {\n background-color: ", "var(--ds-background-neutral-bold-hovered, rgba(0, 0, 0, 0.4))", ";\n }\n");
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { token } from '@atlaskit/tokens';
|
|
2
1
|
import { akEditorSelectedBgColor, akEditorSelectedBorder, akEditorSelectedBorderColor, akEditorSelectedBoxShadow, akEditorSmallZIndex } from '../consts';
|
|
3
2
|
import { SelectionStyle } from './types';
|
|
3
|
+
|
|
4
4
|
/**
|
|
5
5
|
* Adds correct selection styling for a node
|
|
6
6
|
* Pass in which selection style properties you want and it will return css string of necessary styles
|
|
@@ -11,28 +11,22 @@ import { SelectionStyle } from './types';
|
|
|
11
11
|
* }
|
|
12
12
|
*
|
|
13
13
|
*/
|
|
14
|
-
|
|
15
14
|
export var getSelectionStyles = function getSelectionStyles(selectionStyles) {
|
|
16
15
|
return selectionStyles.map(function (selectionStyle) {
|
|
17
16
|
return getSelectionStyle(selectionStyle);
|
|
18
17
|
}).concat(hideNativeBrowserTextSelectionStyles).join('\n');
|
|
19
18
|
};
|
|
20
19
|
export var hideNativeBrowserTextSelectionStyles = "\n ::selection,*::selection {\n background-color: transparent;\n }\n ::-moz-selection,*::-moz-selection {\n background-color: transparent;\n }\n";
|
|
21
|
-
|
|
22
20
|
var getSelectionStyle = function getSelectionStyle(style) {
|
|
23
21
|
switch (style) {
|
|
24
22
|
case SelectionStyle.Border:
|
|
25
23
|
return "\n border: ".concat(akEditorSelectedBorder, ";\n\n // Fixes ED-15246: Trello card is visible through a border of a table border\n &::after {\n height: 100%;\n content: '\\00a0';\n background: ").concat(akEditorSelectedBorderColor, ";\n position: absolute;\n right: -1px;\n top: 0;\n bottom: 0;\n width: 1px;\n border: none;\n display: inline-block;\n }\n ");
|
|
26
|
-
|
|
27
24
|
case SelectionStyle.BoxShadow:
|
|
28
25
|
return "\n box-shadow: ".concat(akEditorSelectedBoxShadow, ";\n border-color: transparent;\n ");
|
|
29
|
-
|
|
30
26
|
case SelectionStyle.Background:
|
|
31
|
-
return "background-color: ".concat(
|
|
32
|
-
|
|
27
|
+
return "background-color: ".concat("var(--ds-background-selected, ".concat(akEditorSelectedBgColor, ")"), ";");
|
|
33
28
|
case SelectionStyle.Blanket:
|
|
34
|
-
return "\n position: relative;\n\n // Fixes ED-9263, where emoji or inline card in panel makes selection go outside the panel\n // in Safari. Looks like it's caused by user-select: all in the emoji element\n -webkit-user-select: text;\n\n ::before {\n position: absolute;\n content: '';\n left: 0;\n right: 0;\n top: 0;\n bottom: 0;\n width: 100%;\n pointer-events: none;\n z-index: ".concat(akEditorSmallZIndex, ";\n background-color: "
|
|
35
|
-
|
|
29
|
+
return "\n position: relative;\n\n // Fixes ED-9263, where emoji or inline card in panel makes selection go outside the panel\n // in Safari. Looks like it's caused by user-select: all in the emoji element\n -webkit-user-select: text;\n\n ::before {\n position: absolute;\n content: '';\n left: 0;\n right: 0;\n top: 0;\n bottom: 0;\n width: 100%;\n pointer-events: none;\n z-index: ".concat(akEditorSmallZIndex, ";\n background-color: ", "var(--ds-blanket-selected, #B3D4FF4C)", "\n }");
|
|
36
30
|
default:
|
|
37
31
|
return '';
|
|
38
32
|
}
|
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
2
|
-
|
|
3
2
|
var _templateObject;
|
|
4
|
-
|
|
5
3
|
import { css } from '@emotion/react';
|
|
6
4
|
import { N100 } from '@atlaskit/theme/colors';
|
|
7
5
|
import { borderRadius } from '@atlaskit/theme/constants';
|
|
8
|
-
import { token } from '@atlaskit/tokens';
|
|
9
6
|
import { akEditorMobileMaxWidth, relativeFontSizeToBase16 } from '../consts';
|
|
10
|
-
export var shortcutStyle = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n background-color: ", "; /* N60 at 50% */\n color: ", ";\n border-radius: ", "px;\n padding: 4px;\n line-height: 12px;\n font-size: ", ";\n align-self: flex-end;\n @media (max-width: ", "px) {\n display: none;\n }\n"])),
|
|
7
|
+
export var shortcutStyle = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n background-color: ", "; /* N60 at 50% */\n color: ", ";\n border-radius: ", "px;\n padding: 4px;\n line-height: 12px;\n font-size: ", ";\n align-self: flex-end;\n @media (max-width: ", "px) {\n display: none;\n }\n"])), "var(--ds-background-neutral, rgba(223, 225, 229, 0.5))", "var(--ds-text-subtle, ".concat(N100, ")"), borderRadius(), relativeFontSizeToBase16(11.67), akEditorMobileMaxWidth);
|
package/dist/esm/version.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-shared-styles",
|
|
3
|
-
"version": "2.3.
|
|
3
|
+
"version": "2.3.2",
|
|
4
4
|
"description": "Style values used in the editor/renderer",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
30
|
"@atlaskit/theme": "^12.2.0",
|
|
31
|
-
"@atlaskit/tokens": "^0.
|
|
31
|
+
"@atlaskit/tokens": "^1.0.0",
|
|
32
32
|
"@babel/runtime": "^7.0.0",
|
|
33
33
|
"@emotion/react": "^11.7.1"
|
|
34
34
|
},
|
package/report.api.md
CHANGED
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
### Table of contents
|
|
9
9
|
|
|
10
10
|
- [Main Entry Types](#main-entry-types)
|
|
11
|
+
- [Peer Dependencies](#peer-dependencies)
|
|
11
12
|
|
|
12
13
|
### Main Entry Types
|
|
13
14
|
|
|
@@ -351,3 +352,13 @@ export const VIEWPORT_SIZES: {
|
|
|
351
352
|
```
|
|
352
353
|
|
|
353
354
|
<!--SECTION END: Main Entry Types-->
|
|
355
|
+
|
|
356
|
+
### Peer Dependencies
|
|
357
|
+
|
|
358
|
+
<!--SECTION START: Peer Dependencies-->
|
|
359
|
+
|
|
360
|
+
```json
|
|
361
|
+
{}
|
|
362
|
+
```
|
|
363
|
+
|
|
364
|
+
<!--SECTION END: Peer Dependencies-->
|
|
@@ -53,31 +53,25 @@ export const overflowShadow = ({
|
|
|
53
53
|
linear-gradient(
|
|
54
54
|
to left,
|
|
55
55
|
${token('elevation.shadow.overflow.spread', 'rgba(9, 30, 66, 0.13)')} 0,
|
|
56
|
-
${token(
|
|
57
|
-
'utility.UNSAFE_util.transparent',
|
|
58
|
-
'rgba(99, 114, 130, 0)',
|
|
59
|
-
)} ${width}
|
|
56
|
+
${token('utility.UNSAFE.transparent', 'rgba(99, 114, 130, 0)')} ${width}
|
|
60
57
|
),
|
|
61
58
|
/* overflow shadow right perimeter */
|
|
62
59
|
linear-gradient(
|
|
63
60
|
to left,
|
|
64
61
|
${token('elevation.shadow.overflow.perimeter', 'transparent')} 0,
|
|
65
|
-
${token('utility.
|
|
62
|
+
${token('utility.UNSAFE.transparent', 'transparent')} ${width}
|
|
66
63
|
),
|
|
67
64
|
/* overflow shadow left spread */
|
|
68
65
|
linear-gradient(
|
|
69
66
|
to right,
|
|
70
67
|
${token('elevation.shadow.overflow.spread', 'rgba(9, 30, 66, 0.13)')} 0,
|
|
71
|
-
${token(
|
|
72
|
-
'utility.UNSAFE_util.transparent',
|
|
73
|
-
'rgba(99, 114, 130, 0)',
|
|
74
|
-
)} ${width}
|
|
68
|
+
${token('utility.UNSAFE.transparent', 'rgba(99, 114, 130, 0)')} ${width}
|
|
75
69
|
),
|
|
76
70
|
/* overflow shadow left perimeter */
|
|
77
71
|
linear-gradient(
|
|
78
72
|
to right,
|
|
79
73
|
${token('elevation.shadow.overflow.perimeter', 'transparent')} 0,
|
|
80
|
-
${token('utility.
|
|
74
|
+
${token('utility.UNSAFE.transparent', 'transparent')} ${width}
|
|
81
75
|
)
|
|
82
76
|
`;
|
|
83
77
|
};
|