@atlaskit/editor-shared-styles 3.6.2 → 3.6.3

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.
@@ -1,310 +0,0 @@
1
- import { fg } from '@atlaskit/platform-feature-flags';
2
- import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
3
- /* eslint-disable @atlaskit/design-system/ensure-design-token-usage */
4
- import { token } from '@atlaskit/tokens';
5
-
6
- import type { EditorTheme, ParticipantColor } from './types';
7
-
8
- export const akEditorFullPageDefaultFontSize = 16;
9
- export const akEditorCodeFontFamily = token('font.family.code');
10
- export const akEditorSubtleAccent = token('color.background.accent.gray.subtler');
11
- export const akEditorBlockquoteBorderColor = token('color.border');
12
- export const akEditorCodeBackground = token('color.background.accent.gray.subtlest');
13
- export const akEditorCodeBlockPadding = '12px';
14
- export const akEditorCodeInlinePadding = '2px 4px';
15
- export const akEditorDeleteBackground = token('color.background.danger');
16
- export const akEditorDeleteBackgroundWithOpacity = 'rgba(255, 189, 173, 0.5)'; // R75 with 50% opacity
17
- export const akEditorDeleteBorder = token('color.border.danger');
18
- export const akEditorDeleteIconColor = token('color.icon.danger');
19
- export const akEditorCustomIconSize = 20;
20
-
21
- export const akEditorSelectedBorderColor = token('color.border.selected');
22
- export const akEditorSelectedBorderSize = 1;
23
- export const akEditorSelectedBorderBoldSize = 2;
24
- export const akEditorSelectedBorder = `${akEditorSelectedBorderSize}px solid ${token(
25
- 'color.border.selected',
26
- )}`;
27
- export const akEditorSelectedBoxShadow = `0 0 0 ${akEditorSelectedBorderSize}px ${token(
28
- 'color.border.selected',
29
- )}`;
30
- export const akEditorSelectedBoldBoxShadow = `0 0 0 ${akEditorSelectedBorderBoldSize}px ${token('color.border.selected')}`;
31
-
32
- export const akEditorSelectedBlanketOpacity = 0.3;
33
- export const akEditorUnitZIndex = 1;
34
- export const akEditorShadowZIndex = 2;
35
- export const akEditorStickyHeaderZIndex = 11; // filmstrip uses 10 for its shadow
36
- export const akEditorSmallZIndex = akEditorStickyHeaderZIndex + 1;
37
- export const akEditorGridLineZIndex = 2;
38
-
39
- // z-index for main menu bar -
40
- // this is highest as it should be above anything else in editor below.
41
- export const akEditorMenuZIndex = 500;
42
- // z-index used for floating toolbars like code block, table etc
43
- export const akEditorFloatingPanelZIndex = 400;
44
- // z-index used for pickers (date, emoji, mentions) and type-aheads, hyperlinks
45
- export const akEditorFloatingDialogZIndex = akEditorMenuZIndex + 10;
46
- // z-index used for table cell menu options button on a sticky header
47
- export const akEditorTableCellOnStickyHeaderZIndex = akEditorFloatingDialogZIndex - 5;
48
- // z-index used for floating toolbars table cell menu which are above block toolbars
49
- export const akEditorFloatingOverlapPanelZIndex = akEditorFloatingPanelZIndex + 5;
50
- export const akEditorTableToolbarSize = 11;
51
- export const akEditorTableBorder = token('color.background.accent.gray.subtler');
52
- export const akEditorTableToolbar = token('color.background.accent.gray.subtlest');
53
- export const akEditorTableHeaderCellBackground = '#F1F2F4';
54
- export const akEditorTableHeaderCellBackgroundDark = '#2C333A';
55
- export const akEditorTableBorderSelected = token('color.border.focused');
56
- export const akEditorTableBorderRadius = '3px';
57
- export const akEditorTableCellBackgroundOpacity = 0.5;
58
- export const akEditorFullPageMaxWidth = 680;
59
- export const akEditorDefaultLayoutWidth = 760;
60
- export const akEditorWideLayoutWidth = 960; // This value is used for tables with breakouts and is used to calculate `breakoutWidthPx`
61
- export const akEditorFullWidthLayoutWidth = 1800;
62
- export const akEditorFullWidthLayoutLineLength = 1792;
63
- export const akEditorTableNumberColumnWidth = 42;
64
- export const akEditorBreakoutPadding = 96;
65
- export const akEditorGutterPadding = 32;
66
- export const akEditorGutterPaddingDynamic = () =>
67
- // eslint-disable-next-line @atlaskit/platform/no-preconditioning
68
- fg('platform_editor_controls_increase_full_page_gutter') &&
69
- editorExperiment('platform_editor_controls', 'variant1')
70
- ? 72
71
- : 52;
72
- export const akEditorGutterPaddingReduced = 24;
73
- export const akEditorFullPageNarrowBreakout = 600;
74
- export const akEditorMobileBreakoutPoint = 720;
75
- export const akEditorTableCellMinWidth = 48;
76
- export const akEditorTableLegacyCellMinWidth = 128;
77
- export const akEditorMediaResizeHandlerPaddingWide = 12;
78
- export const akEditorMediaResizeHandlerPadding = 4;
79
- export const akEditorSwoopCubicBezier = `cubic-bezier(0.15, 1, 0.3, 1)`;
80
- export const gridMediumMaxWidth = 1024;
81
- export const breakoutWideScaleRatio = 1.33;
82
- export const akEditorCalculatedWideLayoutWidthSmallViewport = 905; // from breakoutConsts.calcWideWidth, layoutMaxWidth * breakoutConsts.wideScaleRatio = 904.8 ~ 905 This is a resulting width value that is applied to nodes that currently use breakouts (except table) and are set to `wide` when the viewport's width is <= 1266px.
83
- export const akEditorCalculatedWideLayoutWidth = 1011; // = akEditorDefaultLayoutWidth * breakoutWideScaleRatio = 1010.8 ~ 1011 This is a resulting width value that is applied to nodes that currently use breakouts (except table) and are set to `wide` when the viewport's width is > 1329px.
84
- export const akRichMediaResizeZIndex = akEditorUnitZIndex * 99;
85
- export const akLayoutGutterOffset = 12;
86
- export const akEditorLineHeight = 1.714;
87
- export const akEditorRuleBorderRadius = '1px';
88
- export const akEditorToolbarKeylineHeight = 2;
89
- export const akEditorContextPanelWidth = 320;
90
- export const akEditorTableCellBlanketSelected = 'rgba(179, 212, 255, 0.3)';
91
- export const akEditorTableCellBlanketDeleted = 'rgba(255, 235, 230, 0.3)';
92
- export const akEditorWrappedNodeZIndex = akEditorUnitZIndex * 2; //prevent paragraph nodes from rendering above wrapped nodes
93
-
94
- export const layoutBreakpointWidth = {
95
- SMALL: 550,
96
- MEDIUM: 760,
97
- };
98
-
99
- // @see typography spreadsheet: https://docs.google.com/spreadsheets/d/1iYusRGCT4PoPfvxbJ8NrgjtfFgXLm5lpDWXzjua1W2E/edit#gid=93913128
100
- export const blockNodesVerticalMargin = '0.75rem';
101
-
102
- export const DEFAULT_EMBED_CARD_WIDTH = 680;
103
- export const DEFAULT_EMBED_CARD_HEIGHT = 480;
104
-
105
- export const MAX_BROWSER_SCROLLBAR_HEIGHT = 20;
106
-
107
- // eslint-disable-next-line @repo/internal/deprecations/deprecation-ticket-required -- Ignored via go/ED-25883
108
- // @deprecated
109
- export const ATLASSIAN_NAVIGATION_HEIGHT = '56px';
110
-
111
- const DEFAULT_FONT_SIZE = 14;
112
-
113
- export const FULL_PAGE_EDITOR_TOOLBAR_HEIGHT = () => {
114
- if (editorExperiment('platform_editor_controls', 'variant1', { exposure: true })) {
115
- return token('space.500', '40px');
116
- }
117
- return token('space.500', '40px');
118
- };
119
-
120
- export const akEditorFullPageToolbarHeight = 40;
121
-
122
- export const akEditorSelectedNodeClassName = 'ak-editor-selected-node';
123
-
124
- export const editorFontSize = ({ theme }: { theme: { baseFontSize?: number } | undefined }) =>
125
- theme && theme.baseFontSize ? theme.baseFontSize : DEFAULT_FONT_SIZE;
126
-
127
- export const relativeSize =
128
- (multiplier: number) =>
129
- ({ theme }: { theme: EditorTheme }) =>
130
- editorFontSize({ theme }) * multiplier;
131
-
132
- export const relativeFontSizeToBase16 = (px: number | string) => {
133
- if (typeof px === 'string') {
134
- px = parseInt(px);
135
- }
136
- if (isNaN(px)) {
137
- throw new Error(`Invalid font size: '${px}'`);
138
- }
139
- return `${px / 16}rem`;
140
- };
141
-
142
- export const VIEWPORT_SIZES = {
143
- laptopHiDPI: { width: 1440, height: 900 },
144
- laptopMDPI: { width: 1280, height: 800 },
145
- tabletL: { width: 1024, height: 1366 },
146
- tabletS: { width: 768, height: 1024 },
147
- mobileM: { width: 414, height: 736 },
148
- mobileS: { width: 375, height: 667 },
149
- mobileXS: { width: 320, height: 568 },
150
- };
151
-
152
- // to be updated in ED-10790: this should be variable threshold based on how many buttons enabled on main toolbar
153
- export const akEditorMobileMaxWidth = 0;
154
-
155
- export const getTableCellBackgroundDarkModeColors = [
156
- ['White', '#000000'],
157
- ['Light blue', '#0C294F'],
158
- ['Light teal', '#0C343B'],
159
- ['Light green', '#052E21'],
160
- ['Light yellow', '#484123'],
161
- ['Light red', '#441C13'],
162
- ['Light purple', '#282249'],
163
-
164
- ['Light gray', '#202328'],
165
- ['Blue', '#0B3165'],
166
- ['Teal', '#044853'],
167
- ['Green', '#053927'],
168
- ['Yellow', '#6F5C25'],
169
- ['Red', '#582013'],
170
- ['Purple', '#3E327B'],
171
-
172
- ['Gray', '#475262'],
173
- ['Dark blue', '#003884'],
174
- ['Dark teal', '#055866'],
175
- ['Dark green', '#044932'],
176
- ['Dark yellow', '#82641C'],
177
- ['Dark red', '#6B2A19'],
178
- ['Dark purple', '#4D38B2'],
179
- ]
180
- .map(([colorName, colorValue]) => getTableCellBackgroundDarkModeColorCSS(colorName, colorValue))
181
- .join('\n');
182
-
183
- export function getTableCellBackgroundDarkModeColorCSS(
184
- colorName: string,
185
- colorValue: string,
186
- ): string {
187
- return `
188
- &[colorname="${colorName}"] {
189
- background-color: ${colorValue} !important; // !important to override default style color
190
- }
191
- `;
192
- }
193
-
194
- export const avatarColors = [
195
- token('color.icon.accent.red'),
196
- token('color.background.accent.red.bolder.hovered'),
197
- token('color.icon.accent.magenta'),
198
- token('color.background.accent.magenta.bolder.hovered'),
199
- token('color.icon.accent.orange'),
200
- token('color.background.accent.orange.bolder.hovered'),
201
- token('color.icon.accent.green'),
202
- token('color.background.accent.green.bolder.hovered'),
203
- token('color.icon.accent.blue'),
204
- token('color.background.accent.blue.bolder.hovered'),
205
- token('color.icon.accent.teal'),
206
- token('color.background.accent.teal.bolder.hovered'),
207
- token('color.icon.accent.lime'),
208
- token('color.background.accent.lime.bolder.hovered'),
209
- token('color.icon.accent.purple'),
210
- token('color.background.accent.purple.bolder.hovered'),
211
- token('color.icon.accent.gray'),
212
- token('color.background.accent.gray.bolder.hovered'),
213
- token('color.icon.accent.yellow'),
214
- token('color.background.accent.yellow.bolder.hovered'),
215
- token('color.background.accent.yellow.bolder.pressed'),
216
- ];
217
-
218
- // MDS-569: Will update references to avatarColors to use participantColors instead, we will then deprecate avatarColors
219
- export const participantColors: Array<ParticipantColor> = [
220
- {
221
- textColor: token('color.text.inverse'),
222
- backgroundColor: token('color.background.accent.red.bolder'),
223
- svgBackgroundColor: token('color.background.accent.red.subtler'),
224
- },
225
- {
226
- textColor: token('color.text.inverse'),
227
- backgroundColor: token('color.background.accent.blue.bolder'),
228
- svgBackgroundColor: token('color.background.accent.blue.subtler'),
229
- },
230
- {
231
- textColor: token('color.text.inverse'),
232
- backgroundColor: token('color.background.accent.green.bolder'),
233
- svgBackgroundColor: token('color.background.accent.green.subtler'),
234
- },
235
- {
236
- textColor: token('color.text.inverse'),
237
- backgroundColor: token('color.background.accent.yellow.bolder'),
238
- svgBackgroundColor: token('color.background.accent.yellow.subtler'),
239
- },
240
- {
241
- textColor: token('color.text.inverse'),
242
- backgroundColor: token('color.background.accent.purple.bolder'),
243
- svgBackgroundColor: token('color.background.accent.purple.subtler'),
244
- },
245
- {
246
- textColor: token('color.text.inverse'),
247
- backgroundColor: token('color.background.accent.magenta.bolder'),
248
- svgBackgroundColor: token('color.background.accent.magenta.subtler'),
249
- },
250
- {
251
- textColor: token('color.text.inverse'),
252
- backgroundColor: token('color.background.accent.teal.bolder'),
253
- svgBackgroundColor: token('color.background.accent.teal.subtler'),
254
- },
255
- {
256
- textColor: token('color.text.inverse'),
257
- backgroundColor: token('color.background.accent.orange.bolder'),
258
- svgBackgroundColor: token('color.background.accent.orange.subtler'),
259
- },
260
- {
261
- textColor: token('color.text.inverse'),
262
- backgroundColor: token('color.background.accent.lime.bolder'),
263
- svgBackgroundColor: token('color.background.accent.lime.subtler'),
264
- },
265
- {
266
- textColor: token('color.text.inverse'),
267
- backgroundColor: token('color.background.accent.gray.bolder'),
268
- svgBackgroundColor: token('color.background.accent.gray.subtler'),
269
- },
270
- {
271
- textColor: token('color.text.accent.gray.bolder'),
272
- backgroundColor: token('color.background.accent.blue.subtle'),
273
- svgBackgroundColor: token('color.background.accent.blue.subtlest'),
274
- },
275
- {
276
- textColor: token('color.text.accent.gray.bolder'),
277
- backgroundColor: token('color.background.accent.red.subtle'),
278
- svgBackgroundColor: token('color.background.accent.red.subtlest'),
279
- },
280
- {
281
- textColor: token('color.text.accent.gray.bolder'),
282
- backgroundColor: token('color.background.accent.orange.subtle'),
283
- svgBackgroundColor: token('color.background.accent.orange.subtlest'),
284
- },
285
- {
286
- textColor: token('color.text.accent.gray.bolder'),
287
- backgroundColor: token('color.background.accent.yellow.subtle'),
288
- svgBackgroundColor: token('color.background.accent.yellow.subtlest'),
289
- },
290
- {
291
- textColor: token('color.text.accent.gray.bolder'),
292
- backgroundColor: token('color.background.accent.green.subtle'),
293
- svgBackgroundColor: token('color.background.accent.green.subtlest'),
294
- },
295
- {
296
- textColor: token('color.text.accent.gray.bolder'),
297
- backgroundColor: token('color.background.accent.teal.subtle'),
298
- svgBackgroundColor: token('color.background.accent.teal.subtlest'),
299
- },
300
- {
301
- textColor: token('color.text.accent.gray.bolder'),
302
- backgroundColor: token('color.background.accent.purple.subtle'),
303
- svgBackgroundColor: token('color.background.accent.purple.subtlest'),
304
- },
305
- {
306
- textColor: token('color.text.accent.gray.bolder'),
307
- backgroundColor: token('color.background.accent.magenta.subtle'),
308
- svgBackgroundColor: token('color.background.accent.magenta.subtlest'),
309
- },
310
- ];
@@ -1,90 +0,0 @@
1
- /* eslint-disable @atlaskit/editor/no-re-export */
2
- // Entry file in package.json
3
-
4
- export type { EditorTheme, ParticipantColor } from './types';
5
- export {
6
- akEditorBlockquoteBorderColor,
7
- akEditorBreakoutPadding,
8
- akEditorCodeBackground,
9
- akEditorCodeBlockPadding,
10
- akEditorCodeFontFamily,
11
- akEditorCodeInlinePadding,
12
- akEditorContextPanelWidth,
13
- akEditorDefaultLayoutWidth,
14
- akEditorDeleteBackground,
15
- akEditorDeleteBackgroundWithOpacity,
16
- akEditorDeleteBorder,
17
- akEditorDeleteIconColor,
18
- akEditorFloatingDialogZIndex,
19
- akEditorFloatingOverlapPanelZIndex,
20
- akEditorFloatingPanelZIndex,
21
- akEditorFullPageMaxWidth,
22
- akEditorFullPageDefaultFontSize,
23
- akEditorFullWidthLayoutWidth,
24
- akEditorFullWidthLayoutLineLength,
25
- akEditorGridLineZIndex,
26
- akEditorGutterPadding,
27
- akEditorGutterPaddingDynamic,
28
- akEditorGutterPaddingReduced,
29
- akEditorFullPageNarrowBreakout,
30
- akEditorMediaResizeHandlerPadding,
31
- akEditorMediaResizeHandlerPaddingWide,
32
- akEditorMenuZIndex,
33
- akEditorStickyHeaderZIndex,
34
- akEditorMobileBreakoutPoint,
35
- akEditorSelectedBoldBoxShadow,
36
- akEditorSelectedBorderColor,
37
- akEditorSelectedBorderBoldSize,
38
- akEditorSelectedBorderSize,
39
- akEditorSelectedBorder,
40
- akEditorSelectedBoxShadow,
41
- akEditorCustomIconSize,
42
- akEditorSelectedBlanketOpacity,
43
- akEditorSmallZIndex,
44
- akEditorShadowZIndex,
45
- akEditorSubtleAccent,
46
- akEditorSwoopCubicBezier,
47
- akEditorTableBorder,
48
- akEditorTableBorderRadius,
49
- akEditorTableBorderSelected,
50
- akEditorTableCellBackgroundOpacity,
51
- akEditorTableCellMinWidth,
52
- akEditorTableCellOnStickyHeaderZIndex,
53
- akEditorTableHeaderCellBackground,
54
- akEditorTableHeaderCellBackgroundDark,
55
- akEditorTableLegacyCellMinWidth,
56
- akEditorTableNumberColumnWidth,
57
- akEditorTableToolbar,
58
- akEditorTableToolbarSize,
59
- akEditorUnitZIndex,
60
- akEditorCalculatedWideLayoutWidth,
61
- akEditorCalculatedWideLayoutWidthSmallViewport,
62
- akEditorWideLayoutWidth,
63
- akLayoutGutterOffset,
64
- akRichMediaResizeZIndex,
65
- avatarColors,
66
- participantColors,
67
- blockNodesVerticalMargin,
68
- breakoutWideScaleRatio,
69
- editorFontSize,
70
- gridMediumMaxWidth,
71
- relativeSize,
72
- relativeFontSizeToBase16,
73
- DEFAULT_EMBED_CARD_HEIGHT,
74
- DEFAULT_EMBED_CARD_WIDTH,
75
- akEditorLineHeight,
76
- akEditorRuleBorderRadius,
77
- akEditorSelectedNodeClassName,
78
- akEditorToolbarKeylineHeight,
79
- MAX_BROWSER_SCROLLBAR_HEIGHT,
80
- VIEWPORT_SIZES,
81
- akEditorMobileMaxWidth,
82
- getTableCellBackgroundDarkModeColors,
83
- ATLASSIAN_NAVIGATION_HEIGHT,
84
- FULL_PAGE_EDITOR_TOOLBAR_HEIGHT,
85
- akEditorFullPageToolbarHeight,
86
- akEditorTableCellBlanketSelected,
87
- akEditorTableCellBlanketDeleted,
88
- akEditorWrappedNodeZIndex,
89
- layoutBreakpointWidth,
90
- } from './consts';
@@ -1,9 +0,0 @@
1
- export type EditorTheme = {
2
- baseFontSize?: number;
3
- };
4
-
5
- export type ParticipantColor = {
6
- textColor: string;
7
- backgroundColor: string;
8
- svgBackgroundColor: string;
9
- };
package/src/index.ts DELETED
@@ -1,99 +0,0 @@
1
- /* eslint-disable @atlaskit/editor/no-re-export */
2
- // Entry file in package.json
3
-
4
- export {
5
- akEditorBlockquoteBorderColor,
6
- akEditorBreakoutPadding,
7
- akEditorCodeBackground,
8
- akEditorCodeBlockPadding,
9
- akEditorCodeFontFamily,
10
- akEditorCodeInlinePadding,
11
- akEditorContextPanelWidth,
12
- akEditorDefaultLayoutWidth,
13
- akEditorDeleteBackground,
14
- akEditorDeleteBackgroundWithOpacity,
15
- akEditorDeleteBorder,
16
- akEditorDeleteIconColor,
17
- akEditorFloatingDialogZIndex,
18
- akEditorFloatingOverlapPanelZIndex,
19
- akEditorFloatingPanelZIndex,
20
- akEditorFullPageMaxWidth,
21
- akEditorFullPageDefaultFontSize,
22
- akEditorFullWidthLayoutWidth,
23
- akEditorFullWidthLayoutLineLength,
24
- akEditorGridLineZIndex,
25
- akEditorGutterPadding,
26
- akEditorGutterPaddingDynamic,
27
- akEditorGutterPaddingReduced,
28
- akEditorFullPageNarrowBreakout,
29
- akEditorMediaResizeHandlerPadding,
30
- akEditorMediaResizeHandlerPaddingWide,
31
- akEditorMenuZIndex,
32
- akEditorStickyHeaderZIndex,
33
- akEditorMobileBreakoutPoint,
34
- akEditorSelectedBoldBoxShadow,
35
- akEditorSelectedBorderColor,
36
- akEditorSelectedBorderBoldSize,
37
- akEditorSelectedBorderSize,
38
- akEditorSelectedBorder,
39
- akEditorSelectedBoxShadow,
40
- akEditorSelectedBlanketOpacity,
41
- akEditorSmallZIndex,
42
- akEditorShadowZIndex,
43
- akEditorSubtleAccent,
44
- akEditorSwoopCubicBezier,
45
- akEditorTableBorder,
46
- akEditorTableBorderRadius,
47
- akEditorTableBorderSelected,
48
- akEditorTableCellBackgroundOpacity,
49
- akEditorTableCellMinWidth,
50
- akEditorTableCellOnStickyHeaderZIndex,
51
- akEditorTableHeaderCellBackground,
52
- akEditorTableHeaderCellBackgroundDark,
53
- akEditorTableLegacyCellMinWidth,
54
- akEditorTableNumberColumnWidth,
55
- akEditorTableToolbar,
56
- akEditorTableToolbarSize,
57
- akEditorUnitZIndex,
58
- akEditorCalculatedWideLayoutWidth,
59
- akEditorCalculatedWideLayoutWidthSmallViewport,
60
- akEditorWideLayoutWidth,
61
- akLayoutGutterOffset,
62
- akRichMediaResizeZIndex,
63
- avatarColors,
64
- participantColors,
65
- blockNodesVerticalMargin,
66
- breakoutWideScaleRatio,
67
- editorFontSize,
68
- gridMediumMaxWidth,
69
- relativeSize,
70
- relativeFontSizeToBase16,
71
- DEFAULT_EMBED_CARD_HEIGHT,
72
- DEFAULT_EMBED_CARD_WIDTH,
73
- akEditorLineHeight,
74
- akEditorRuleBorderRadius,
75
- akEditorSelectedNodeClassName,
76
- akEditorToolbarKeylineHeight,
77
- MAX_BROWSER_SCROLLBAR_HEIGHT,
78
- VIEWPORT_SIZES,
79
- akEditorMobileMaxWidth,
80
- getTableCellBackgroundDarkModeColors,
81
- ATLASSIAN_NAVIGATION_HEIGHT,
82
- FULL_PAGE_EDITOR_TOOLBAR_HEIGHT,
83
- akEditorFullPageToolbarHeight,
84
- akEditorTableCellBlanketSelected,
85
- akEditorTableCellBlanketDeleted,
86
- akEditorWrappedNodeZIndex,
87
- layoutBreakpointWidth,
88
- } from './consts';
89
- export type { EditorTheme, ParticipantColor } from './consts';
90
-
91
- export {
92
- SelectionStyle,
93
- getSelectionStyles,
94
- hideNativeBrowserTextSelectionStyles,
95
- } from './selection';
96
-
97
- export { overflowShadow } from './overflow-shadow/overflow-shadow';
98
-
99
- export { getHashCode, getParticipantColor } from './utils';
@@ -1,69 +0,0 @@
1
- /* eslint-disable @atlaskit/design-system/ensure-design-token-usage */
2
- // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
3
- import { css } from '@emotion/react';
4
-
5
- import { token } from '@atlaskit/tokens';
6
-
7
- export const overflowShadow = ({
8
- leftCoverWidth,
9
- rightCoverWidth,
10
- }: {
11
- leftCoverWidth?: string;
12
- rightCoverWidth?: string;
13
- }) => {
14
- const width = token('space.100', '8px');
15
- const leftCoverWidthResolved = leftCoverWidth || width;
16
- const rightCoverWidthResolved = rightCoverWidth || width;
17
-
18
- // eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression -- needs manual remediation
19
- return css`
20
- /* shadow cover left */
21
- linear-gradient(
22
- to right,
23
- ${token('color.background.neutral')} ${leftCoverWidthResolved},
24
- transparent ${leftCoverWidthResolved}
25
- ),
26
- /* shadow cover background left */
27
- linear-gradient(
28
- to right,
29
- ${token('elevation.surface.raised')} ${leftCoverWidthResolved},
30
- transparent ${leftCoverWidthResolved}
31
- ),
32
- /* shadow cover right */
33
- linear-gradient(
34
- to left,
35
- ${token('color.background.neutral')} ${rightCoverWidthResolved},
36
- transparent ${rightCoverWidthResolved}
37
- ),
38
- /* shadow cover background right */
39
- linear-gradient(
40
- to left,
41
- ${token('elevation.surface.raised')} ${rightCoverWidthResolved},
42
- transparent ${rightCoverWidthResolved}
43
- ),
44
- /* overflow shadow right spread */
45
- linear-gradient(
46
- to left,
47
- ${token('elevation.shadow.overflow.spread')} 0,
48
- ${token('utility.UNSAFE.transparent')} ${width}
49
- ),
50
- /* overflow shadow right perimeter */
51
- linear-gradient(
52
- to left,
53
- ${token('elevation.shadow.overflow.perimeter')} 0,
54
- ${token('utility.UNSAFE.transparent')} ${width}
55
- ),
56
- /* overflow shadow left spread */
57
- linear-gradient(
58
- to right,
59
- ${token('elevation.shadow.overflow.spread')} 0,
60
- ${token('utility.UNSAFE.transparent')} ${width}
61
- ),
62
- /* overflow shadow left perimeter */
63
- linear-gradient(
64
- to right,
65
- ${token('elevation.shadow.overflow.perimeter')} 0,
66
- ${token('utility.UNSAFE.transparent')} ${width}
67
- )
68
- `;
69
- };
@@ -1,29 +0,0 @@
1
- /* eslint-disable @atlaskit/editor/no-re-export */
2
- // Entry file in package.json
3
-
4
- import { token } from '@atlaskit/tokens';
5
-
6
- export const scrollbarStyles = `
7
- -ms-overflow-style: -ms-autohiding-scrollbar;
8
-
9
- &::-webkit-scrollbar {
10
- overflow: hidden,
11
- }
12
-
13
- &::-webkit-scrollbar-corner {
14
- display: none;
15
- }
16
-
17
- &::-webkit-scrollbar-thumb {
18
- background-color: ${token('color.background.neutral.subtle')};
19
- }
20
-
21
- &:hover::-webkit-scrollbar-thumb {
22
- background-color: ${token('color.background.neutral.bold')};
23
- border-radius: 8px;
24
- }
25
-
26
- &::-webkit-scrollbar-thumb:hover {
27
- background-color: ${token('color.background.neutral.bold.hovered')};
28
- }
29
- `;
@@ -1,47 +0,0 @@
1
- import { SelectionStyle } from '../../types';
2
- import { getSelectionStyles } from '../../utils';
3
-
4
- describe('selection plugin: utils', () => {
5
- describe('getSelectionStyles', () => {
6
- const selectionStyles = [
7
- // Ignored via go/ees005
8
- // eslint-disable-next-line require-unicode-regexp
9
- { name: 'border', style: SelectionStyle.Border, regex: /border\:/ },
10
- {
11
- name: 'box-shadow',
12
- style: SelectionStyle.BoxShadow,
13
- // Ignored via go/ees005
14
- // eslint-disable-next-line require-unicode-regexp
15
- regex: /box\-shadow\:/,
16
- },
17
- {
18
- name: 'background',
19
- style: SelectionStyle.Background,
20
- // Ignored via go/ees005
21
- // eslint-disable-next-line require-unicode-regexp
22
- regex: /background\-color\:/,
23
- },
24
- // Ignored via go/ees005
25
- // eslint-disable-next-line require-unicode-regexp
26
- { name: 'blanket', style: SelectionStyle.Blanket, regex: /\:\:before/ },
27
- ];
28
-
29
- for (const selectionStyle of selectionStyles) {
30
- it(`gets styles for ${selectionStyle.name}`, () => {
31
- const css = getSelectionStyles([selectionStyle.style]);
32
- expect(css).toMatch(selectionStyle.regex);
33
- });
34
- }
35
-
36
- it('combines multiple styles', () => {
37
- const allStyles = selectionStyles.map((selectionStyle) => selectionStyle.style);
38
- const allRegex = selectionStyles.map((selectionStyle) => selectionStyle.regex);
39
-
40
- const css = getSelectionStyles(allStyles);
41
-
42
- for (const regex of allRegex) {
43
- expect(css).toMatch(regex);
44
- }
45
- });
46
- });
47
- });
@@ -1,5 +0,0 @@
1
- /* eslint-disable @atlaskit/editor/no-re-export */
2
- // Entry file in package.json
3
-
4
- export { SelectionStyle } from './types';
5
- export { getSelectionStyles, hideNativeBrowserTextSelectionStyles } from './utils';
@@ -1,11 +0,0 @@
1
- /**
2
- * These are generic selection styles for all nodes
3
- * If you have custom behaviour needed for a node, add that in the plugin's styles
4
- * file in editor-core
5
- */
6
- export enum SelectionStyle {
7
- Border,
8
- BoxShadow,
9
- Background,
10
- Blanket,
11
- }