@atlaskit/editor-shared-styles 1.6.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.
Files changed (59) hide show
  1. package/CHANGELOG.md +114 -0
  2. package/build/tsconfig.json +17 -0
  3. package/consts/package.json +7 -0
  4. package/dist/cjs/consts/consts.js +277 -0
  5. package/dist/cjs/consts/consts.test.js +25 -0
  6. package/dist/cjs/consts/index.js +541 -0
  7. package/dist/cjs/consts/types.js +5 -0
  8. package/dist/cjs/index.js +563 -0
  9. package/dist/cjs/overflow-shadow/index.js +13 -0
  10. package/dist/cjs/overflow-shadow/overflow-shadow.js +22 -0
  11. package/dist/cjs/selection/index.js +27 -0
  12. package/dist/cjs/selection/types.js +21 -0
  13. package/dist/cjs/selection/utils.js +49 -0
  14. package/dist/cjs/version.json +5 -0
  15. package/dist/es2019/consts/consts.js +152 -0
  16. package/dist/es2019/consts/consts.test.js +20 -0
  17. package/dist/es2019/consts/index.js +1 -0
  18. package/dist/es2019/consts/types.js +1 -0
  19. package/dist/es2019/index.js +3 -0
  20. package/dist/es2019/overflow-shadow/index.js +1 -0
  21. package/dist/es2019/overflow-shadow/overflow-shadow.js +23 -0
  22. package/dist/es2019/selection/index.js +2 -0
  23. package/dist/es2019/selection/types.js +13 -0
  24. package/dist/es2019/selection/utils.js +61 -0
  25. package/dist/es2019/version.json +5 -0
  26. package/dist/esm/consts/consts.js +162 -0
  27. package/dist/esm/consts/consts.test.js +22 -0
  28. package/dist/esm/consts/index.js +1 -0
  29. package/dist/esm/consts/types.js +1 -0
  30. package/dist/esm/index.js +3 -0
  31. package/dist/esm/overflow-shadow/index.js +1 -0
  32. package/dist/esm/overflow-shadow/overflow-shadow.js +10 -0
  33. package/dist/esm/selection/index.js +2 -0
  34. package/dist/esm/selection/types.js +13 -0
  35. package/dist/esm/selection/utils.js +38 -0
  36. package/dist/esm/version.json +5 -0
  37. package/dist/types/consts/consts.d.ts +124 -0
  38. package/dist/types/consts/index.d.ts +2 -0
  39. package/dist/types/consts/types.d.ts +3 -0
  40. package/dist/types/index.d.ts +4 -0
  41. package/dist/types/overflow-shadow/index.d.ts +1 -0
  42. package/dist/types/overflow-shadow/overflow-shadow.d.ts +5 -0
  43. package/dist/types/selection/index.d.ts +2 -0
  44. package/dist/types/selection/types.d.ts +11 -0
  45. package/dist/types/selection/utils.d.ts +13 -0
  46. package/package.json +46 -0
  47. package/selection/package.json +7 -0
  48. package/src/consts/consts.test.ts +21 -0
  49. package/src/consts/consts.ts +204 -0
  50. package/src/consts/index.ts +92 -0
  51. package/src/consts/types.ts +3 -0
  52. package/src/index.ts +99 -0
  53. package/src/overflow-shadow/index.ts +1 -0
  54. package/src/overflow-shadow/overflow-shadow.ts +29 -0
  55. package/src/selection/__tests__/unit/utils.ts +43 -0
  56. package/src/selection/index.ts +5 -0
  57. package/src/selection/types.ts +11 -0
  58. package/src/selection/utils.ts +71 -0
  59. package/tsconfig.json +11 -0
@@ -0,0 +1,162 @@
1
+ import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
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
+ import { codeFontFamily, fontSize as defaultFontSize, gridSize, layers } from '@atlaskit/theme/constants';
4
+ export var akEditorFullPageDefaultFontSize = 16;
5
+ export var akEditorCodeFontFamily = codeFontFamily();
6
+ export var akEditorInactiveForeground = N500;
7
+ export var akEditorFocus = B100;
8
+ export var akEditorSubtleAccent = N40;
9
+ export var akEditorActiveBackground = N500;
10
+ export var akEditorActiveForeground = N0;
11
+ export var akEditorBlockquoteBorderColor = N40;
12
+ export var akEditorDropdownActiveBackground = N900;
13
+ export var akEditorPopupBackground = N700;
14
+ export var akEditorPopupText = B50;
15
+ export var akEditorPrimaryButton = B400;
16
+ export var akEditorCodeBackground = N20;
17
+ export var akEditorCodeBlockPadding = '12px';
18
+ export var akEditorCodeInlinePadding = '2px 4px';
19
+ export var akEditorDeleteBackground = R50;
20
+ export var akEditorDeleteBackgroundShaded = R50;
21
+ export var akEditorDeleteBackgroundWithOpacity = 'rgba(255, 189, 173, 0.5)'; // R75 with 50% opacity
22
+
23
+ export var akEditorDeleteBorder = R300;
24
+ export var akEditorDeleteIconColor = R400;
25
+ export var akEditorCustomIconSize = 20;
26
+ export var akEditorSelectedBorderColor = B300;
27
+ export var akEditorSelectedBgColor = B50;
28
+ export var akEditorSelectedBlanketColor = B75;
29
+ export var akEditorSelectedBorderSize = 1;
30
+ export var akEditorSelectedBorder = "".concat(akEditorSelectedBorderSize, "px solid ").concat(akEditorSelectedBorderColor);
31
+ export var akEditorSelectedBoxShadow = "0 0 0 ".concat(akEditorSelectedBorderSize, "px ").concat(akEditorSelectedBorderColor);
32
+ export var akEditorSelectedIconColor = B400;
33
+ export var akEditorSelectedBorderBoldSize = 2;
34
+ export var akEditorSelectedBlanketOpacity = 0.3;
35
+ export var akEditorUnitZIndex = 1;
36
+ export var akEditorShadowZIndex = 2;
37
+ export var akEditorStickyHeaderZIndex = 11; // filmstrip uses 10 for its shadow
38
+
39
+ export var akEditorSmallZIndex = akEditorStickyHeaderZIndex + 1;
40
+ export var akEditorGridLineZIndex = 9999; // z-index for main menu bar -
41
+ // this is highest as it should be above anything else in editor below.
42
+
43
+ export var akEditorMenuZIndex = layers.blanket(); // z-index used for floating toolbars like code block, table etc
44
+
45
+ export var akEditorFloatingPanelZIndex = layers.layer(); // z-index used for pickers (date, emoji, mentions) and type-aheads, hyperlinks
46
+
47
+ export var akEditorFloatingDialogZIndex = akEditorFloatingPanelZIndex + 10; // z-index used for floating toolbars table cell menu which are above block toolbars
48
+
49
+ export var akEditorFloatingOverlapPanelZIndex = akEditorFloatingPanelZIndex + 5;
50
+ export var akEditorMentionSelected = N100;
51
+ export var akEditorTableToolbarSize = 11;
52
+ export var akEditorTableBorder = N50;
53
+ export var akEditorTableBorderDark = DN70;
54
+ export var akEditorTableToolbar = N20;
55
+ export var akEditorTableToolbarDark = DN50;
56
+ export var akEditorTableFloatingControls = N20;
57
+ export var akEditorTableCellSelected = B75;
58
+ export var akEditorTableToolbarSelected = B100;
59
+ export var akEditorTableBorderSelected = B300;
60
+ export var akEditorTableCellDelete = R50;
61
+ export var akEditorTableBorderDelete = R300;
62
+ export var akEditorTableToolbarDelete = R75;
63
+ export var akEditorTableBorderRadius = '3px';
64
+ export var akEditorTableCellBackgroundOpacity = 0.5;
65
+ export var akEditorFullPageMaxWidth = 680;
66
+ export var akEditorDefaultLayoutWidth = 760;
67
+ export var akEditorWideLayoutWidth = 960;
68
+ export var akEditorFullWidthLayoutWidth = 1800;
69
+ export var akEditorFullWidthLayoutLineLength = 1792;
70
+ export var akEditorTableNumberColumnWidth = 42;
71
+ export var akEditorBreakoutPadding = 96;
72
+ export var akEditorGutterPadding = 32;
73
+ export var akEditorMobileBreakoutPoint = 720;
74
+ export var akEditorTableCellMinWidth = 48;
75
+ export var akEditorTableLegacyCellMinWidth = 128;
76
+ export var akEditorMediaResizeHandlerPaddingWide = 12;
77
+ export var akEditorMediaResizeHandlerPadding = 4;
78
+ export var akEditorSwoopCubicBezier = "cubic-bezier(0.15, 1, 0.3, 1)";
79
+ export var gridMediumMaxWidth = 1024;
80
+ export var breakoutWideScaleRatio = 1.33;
81
+ export var akRichMediaResizeZIndex = akEditorUnitZIndex * 99;
82
+ export var akLayoutGutterOffset = gridSize() * 1.5;
83
+ export var akEditorLineHeight = 1.714;
84
+ export var akEditorRuleBackground = N30;
85
+ export var akEditorRuleBorderRadius = '1px';
86
+ export var akEditorToolbarKeylineHeight = 2;
87
+ export var akEditorContextPanelWidth = 320; // @see typography spreadsheet: https://docs.google.com/spreadsheets/d/1iYusRGCT4PoPfvxbJ8NrgjtfFgXLm5lpDWXzjua1W2E/edit#gid=93913128
88
+
89
+ export var blockNodesVerticalMargin = '0.75rem';
90
+ export var DEFAULT_EMBED_CARD_WIDTH = 680;
91
+ export var DEFAULT_EMBED_CARD_HEIGHT = 480;
92
+ export var ATLASSIAN_NAVIGATION_HEIGHT = '56px';
93
+ export var akEditorSelectedNodeClassName = 'ak-editor-selected-node';
94
+ export var editorFontSize = function editorFontSize(_ref) {
95
+ var theme = _ref.theme;
96
+ return theme && theme.baseFontSize ? theme.baseFontSize : defaultFontSize();
97
+ };
98
+ export var relativeSize = function relativeSize(multiplier) {
99
+ return function (_ref2) {
100
+ var theme = _ref2.theme;
101
+ return editorFontSize({
102
+ theme: theme
103
+ }) * multiplier;
104
+ };
105
+ };
106
+ export var relativeFontSizeToBase16 = function relativeFontSizeToBase16(px) {
107
+ if (typeof px === 'string') {
108
+ px = parseInt(px);
109
+ }
110
+
111
+ if (isNaN(px)) {
112
+ throw new Error("Invalid font size: '".concat(px, "'"));
113
+ }
114
+
115
+ return "".concat(px / 16, "rem");
116
+ };
117
+ export var getAkEditorFullPageMaxWidth = function getAkEditorFullPageMaxWidth() {
118
+ var allowDynamicTextSizing = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
119
+ return allowDynamicTextSizing ? akEditorFullPageMaxWidth : akEditorDefaultLayoutWidth;
120
+ };
121
+ export var VIEWPORT_SIZES = {
122
+ laptopHiDPI: {
123
+ width: 1440,
124
+ height: 900
125
+ },
126
+ laptopMDPI: {
127
+ width: 1280,
128
+ height: 800
129
+ },
130
+ tabletL: {
131
+ width: 1024,
132
+ height: 1366
133
+ },
134
+ tabletS: {
135
+ width: 768,
136
+ height: 1024
137
+ },
138
+ mobileM: {
139
+ width: 414,
140
+ height: 736
141
+ },
142
+ mobileS: {
143
+ width: 375,
144
+ height: 667
145
+ },
146
+ mobileXS: {
147
+ width: 320,
148
+ height: 568
149
+ }
150
+ }; // to be updated in ED-10790: this should be variable threshold based on how many buttons enabled on main toolbar
151
+
152
+ export var akEditorMobileMaxWidth = 0;
153
+ 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) {
154
+ var _ref4 = _slicedToArray(_ref3, 2),
155
+ colorName = _ref4[0],
156
+ colorValue = _ref4[1];
157
+
158
+ return getTableCellBackgroundDarkModeColorCSS(colorName, colorValue);
159
+ }).join('\n');
160
+ export function getTableCellBackgroundDarkModeColorCSS(colorName, colorValue) {
161
+ return "\n &[colorname=\"".concat(colorName, "\"] {\n background-color: ").concat(colorValue, " !important; // !important to override default style color\n }\n ");
162
+ }
@@ -0,0 +1,22 @@
1
+ import { relativeFontSizeToBase16 } from './consts';
2
+ describe('consts', function () {
3
+ describe('relativeFontSizeToBase16', function () {
4
+ it('relativeFontSizeToBase16 should return 1rem with a base font size of 16px', function () {
5
+ expect(relativeFontSizeToBase16(16)).toBe('1rem');
6
+ });
7
+ it('relativeFontSizeToBase16 should return 0.875rem with a base font size of 14px', function () {
8
+ expect(relativeFontSizeToBase16(14)).toBe('0.875rem');
9
+ });
10
+ it('relativeFontSizeToBase16 should return 0.875rem with a base font size (string) of 14px', function () {
11
+ expect(relativeFontSizeToBase16('14')).toBe('0.875rem');
12
+ });
13
+ it('relativeFontSizeToBase16 should return 0.875rem with a base font size (string) of 14px', function () {
14
+ expect(relativeFontSizeToBase16('14px')).toBe('0.875rem');
15
+ });
16
+ it('relativeFontSizeToBase16 should throw an error for invalid string', function () {
17
+ expect(function () {
18
+ return relativeFontSizeToBase16('px');
19
+ }).toThrowError();
20
+ });
21
+ });
22
+ });
@@ -0,0 +1 @@
1
+ export { akEditorActiveBackground, akEditorActiveForeground, akEditorBlockquoteBorderColor, akEditorBreakoutPadding, akEditorCodeBackground, akEditorCodeBlockPadding, akEditorCodeFontFamily, akEditorCodeInlinePadding, akEditorContextPanelWidth, akEditorDefaultLayoutWidth, akEditorDeleteBackground, akEditorDeleteBackgroundShaded, akEditorDeleteBackgroundWithOpacity, akEditorDeleteBorder, akEditorDeleteIconColor, akEditorDropdownActiveBackground, akEditorFloatingDialogZIndex, akEditorFloatingOverlapPanelZIndex, akEditorFloatingPanelZIndex, akEditorFocus, akEditorFullPageMaxWidth, akEditorFullPageDefaultFontSize, akEditorFullWidthLayoutWidth, akEditorFullWidthLayoutLineLength, akEditorGridLineZIndex, akEditorGutterPadding, akEditorInactiveForeground, akEditorMediaResizeHandlerPadding, akEditorMediaResizeHandlerPaddingWide, akEditorMentionSelected, akEditorMenuZIndex, akEditorStickyHeaderZIndex, akEditorMobileBreakoutPoint, akEditorPopupBackground, akEditorPopupText, akEditorPrimaryButton, akEditorSelectedBorderColor, akEditorSelectedBorderBoldSize, akEditorSelectedBorderSize, akEditorSelectedBorder, akEditorSelectedBoxShadow, akEditorSelectedIconColor, akEditorCustomIconSize, akEditorSelectedBlanketColor, akEditorSelectedBgColor, akEditorSelectedBlanketOpacity, akEditorSmallZIndex, akEditorShadowZIndex, akEditorSubtleAccent, akEditorSwoopCubicBezier, akEditorTableBorder, akEditorTableBorderDark, akEditorTableBorderDelete, akEditorTableBorderRadius, akEditorTableBorderSelected, akEditorTableCellBackgroundOpacity, akEditorTableCellDelete, akEditorTableCellMinWidth, akEditorTableCellSelected, akEditorTableFloatingControls, akEditorTableLegacyCellMinWidth, akEditorTableNumberColumnWidth, akEditorTableToolbar, akEditorTableToolbarDark, akEditorTableToolbarDelete, akEditorTableToolbarSelected, akEditorTableToolbarSize, akEditorUnitZIndex, akEditorWideLayoutWidth, akLayoutGutterOffset, akRichMediaResizeZIndex, blockNodesVerticalMargin, breakoutWideScaleRatio, editorFontSize, gridMediumMaxWidth, getAkEditorFullPageMaxWidth, relativeSize, relativeFontSizeToBase16, DEFAULT_EMBED_CARD_HEIGHT, DEFAULT_EMBED_CARD_WIDTH, akEditorLineHeight, akEditorRuleBackground, akEditorRuleBorderRadius, akEditorSelectedNodeClassName, akEditorToolbarKeylineHeight, VIEWPORT_SIZES, akEditorMobileMaxWidth, getTableCellBackgroundDarkModeColors, ATLASSIAN_NAVIGATION_HEIGHT } from './consts';
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,3 @@
1
+ export { akEditorActiveBackground, akEditorActiveForeground, akEditorBlockquoteBorderColor, akEditorBreakoutPadding, akEditorCodeBackground, akEditorCodeBlockPadding, akEditorCodeFontFamily, akEditorCodeInlinePadding, akEditorContextPanelWidth, akEditorDefaultLayoutWidth, akEditorDeleteBackground, akEditorDeleteBackgroundShaded, akEditorDeleteBackgroundWithOpacity, akEditorDeleteBorder, akEditorDeleteIconColor, akEditorDropdownActiveBackground, akEditorFloatingDialogZIndex, akEditorFloatingOverlapPanelZIndex, akEditorFloatingPanelZIndex, akEditorFocus, akEditorFullPageMaxWidth, akEditorFullPageDefaultFontSize, akEditorFullWidthLayoutWidth, akEditorFullWidthLayoutLineLength, akEditorGridLineZIndex, akEditorGutterPadding, akEditorInactiveForeground, akEditorMediaResizeHandlerPadding, akEditorMediaResizeHandlerPaddingWide, akEditorMentionSelected, akEditorMenuZIndex, akEditorStickyHeaderZIndex, akEditorMobileBreakoutPoint, akEditorPopupBackground, akEditorPopupText, akEditorPrimaryButton, akEditorSelectedBorderColor, akEditorSelectedBorderBoldSize, akEditorSelectedBorderSize, akEditorSelectedBorder, akEditorSelectedBoxShadow, akEditorSelectedIconColor, akEditorSelectedBlanketColor, akEditorSelectedBgColor, akEditorSelectedBlanketOpacity, akEditorSmallZIndex, akEditorShadowZIndex, akEditorSubtleAccent, akEditorSwoopCubicBezier, akEditorTableBorder, akEditorTableBorderDark, akEditorTableBorderDelete, akEditorTableBorderRadius, akEditorTableBorderSelected, akEditorTableCellBackgroundOpacity, akEditorTableCellDelete, akEditorTableCellMinWidth, akEditorTableCellSelected, akEditorTableFloatingControls, akEditorTableLegacyCellMinWidth, akEditorTableNumberColumnWidth, akEditorTableToolbar, akEditorTableToolbarDark, akEditorTableToolbarDelete, akEditorTableToolbarSelected, akEditorTableToolbarSize, akEditorUnitZIndex, akEditorWideLayoutWidth, akLayoutGutterOffset, akRichMediaResizeZIndex, blockNodesVerticalMargin, breakoutWideScaleRatio, editorFontSize, gridMediumMaxWidth, getAkEditorFullPageMaxWidth, relativeSize, relativeFontSizeToBase16, DEFAULT_EMBED_CARD_HEIGHT, DEFAULT_EMBED_CARD_WIDTH, akEditorLineHeight, akEditorRuleBackground, akEditorRuleBorderRadius, akEditorSelectedNodeClassName, akEditorToolbarKeylineHeight, VIEWPORT_SIZES, akEditorMobileMaxWidth, getTableCellBackgroundDarkModeColors, ATLASSIAN_NAVIGATION_HEIGHT } from './consts';
2
+ export { SelectionStyle, getSelectionStyles, hideNativeBrowserTextSelectionStyles } from './selection';
3
+ export { overflowShadow } from './overflow-shadow';
@@ -0,0 +1 @@
1
+ export { overflowShadow } from './overflow-shadow';
@@ -0,0 +1,10 @@
1
+ import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
2
+
3
+ var _templateObject;
4
+
5
+ import { css } from 'styled-components';
6
+ export var overflowShadow = function overflowShadow(_ref) {
7
+ var background = _ref.background,
8
+ width = _ref.width;
9
+ return css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n/* shadow cover right */ linear-gradient(\n to left,\n ", " ", ",\n transparent ", "\n),\n/* overflow shadow right */\n linear-gradient(\n to left,\n rgba(9, 30, 66, 0.13) 0,\n rgba(99, 114, 130, 0) ", "\n ),\n/* overflow shadow left */\n linear-gradient(\n to right,\n rgba(9, 30, 66, 0.13) 0,\n rgba(99, 114, 130, 0) ", "\n )\n"])), background, width, width, width, width);
10
+ };
@@ -0,0 +1,2 @@
1
+ export { SelectionStyle } from './types';
2
+ export { getSelectionStyles, hideNativeBrowserTextSelectionStyles } from './utils';
@@ -0,0 +1,13 @@
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 var SelectionStyle;
7
+
8
+ (function (SelectionStyle) {
9
+ SelectionStyle[SelectionStyle["Border"] = 0] = "Border";
10
+ SelectionStyle[SelectionStyle["BoxShadow"] = 1] = "BoxShadow";
11
+ SelectionStyle[SelectionStyle["Background"] = 2] = "Background";
12
+ SelectionStyle[SelectionStyle["Blanket"] = 3] = "Blanket";
13
+ })(SelectionStyle || (SelectionStyle = {}));
@@ -0,0 +1,38 @@
1
+ import { akEditorSelectedBgColor, akEditorSelectedBlanketColor, akEditorSelectedBlanketOpacity, akEditorSelectedBorder, akEditorSelectedBoxShadow } from '../consts';
2
+ import { SelectionStyle } from './types';
3
+ /**
4
+ * Adds correct selection styling for a node
5
+ * Pass in which selection style properties you want and it will return css string of necessary styles
6
+ *
7
+ * eg.
8
+ * .expand.ak-editor-selected-node {
9
+ * ${getSelectionStyles([SelectionStyle.BoxShadow, SelectionStyle.Blanket])}
10
+ * }
11
+ *
12
+ */
13
+
14
+ export var getSelectionStyles = function getSelectionStyles(selectionStyles) {
15
+ return selectionStyles.map(function (selectionStyle) {
16
+ return getSelectionStyle(selectionStyle);
17
+ }).concat(hideNativeBrowserTextSelectionStyles).join('\n');
18
+ };
19
+ export var hideNativeBrowserTextSelectionStyles = "\n ::selection,*::selection {\n background-color: transparent;\n }\n ::-moz-selection,*::-moz-selection {\n background-color: transparent;\n }\n";
20
+
21
+ var getSelectionStyle = function getSelectionStyle(style) {
22
+ switch (style) {
23
+ case SelectionStyle.Border:
24
+ return "border: ".concat(akEditorSelectedBorder, ";");
25
+
26
+ case SelectionStyle.BoxShadow:
27
+ return "\n box-shadow: ".concat(akEditorSelectedBoxShadow, ";\n border-color: transparent;\n ");
28
+
29
+ case SelectionStyle.Background:
30
+ return "background-color: ".concat(akEditorSelectedBgColor, ";");
31
+
32
+ case SelectionStyle.Blanket:
33
+ 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 ::after {\n position: absolute;\n content: '';\n left: 0;\n right: 0;\n top: 0;\n bottom: 0;\n opacity: ".concat(akEditorSelectedBlanketOpacity, ";\n pointer-events: none;\n background-color: ").concat(akEditorSelectedBlanketColor, "\n }");
34
+
35
+ default:
36
+ return '';
37
+ }
38
+ };
@@ -0,0 +1,5 @@
1
+ {
2
+ "name": "@atlaskit/editor-shared-styles",
3
+ "version": "1.6.0",
4
+ "sideEffects": false
5
+ }
@@ -0,0 +1,124 @@
1
+ import { EditorTheme } from './types';
2
+ export declare const akEditorFullPageDefaultFontSize = 16;
3
+ export declare const akEditorCodeFontFamily: string;
4
+ export declare const akEditorInactiveForeground = "#42526E";
5
+ export declare const akEditorFocus = "#4C9AFF";
6
+ export declare const akEditorSubtleAccent = "#DFE1E6";
7
+ export declare const akEditorActiveBackground = "#42526E";
8
+ export declare const akEditorActiveForeground = "#FFFFFF";
9
+ export declare const akEditorBlockquoteBorderColor = "#DFE1E6";
10
+ export declare const akEditorDropdownActiveBackground = "#091E42";
11
+ export declare const akEditorPopupBackground = "#253858";
12
+ export declare const akEditorPopupText = "#DEEBFF";
13
+ export declare const akEditorPrimaryButton = "#0052CC";
14
+ export declare const akEditorCodeBackground = "#F4F5F7";
15
+ export declare const akEditorCodeBlockPadding = "12px";
16
+ export declare const akEditorCodeInlinePadding = "2px 4px";
17
+ export declare const akEditorDeleteBackground = "#FFEBE6";
18
+ export declare const akEditorDeleteBackgroundShaded = "#FFEBE6";
19
+ export declare const akEditorDeleteBackgroundWithOpacity = "rgba(255, 189, 173, 0.5)";
20
+ export declare const akEditorDeleteBorder = "#FF5630";
21
+ export declare const akEditorDeleteIconColor = "#DE350B";
22
+ export declare const akEditorCustomIconSize = 20;
23
+ export declare const akEditorSelectedBorderColor = "#0065FF";
24
+ export declare const akEditorSelectedBgColor = "#DEEBFF";
25
+ export declare const akEditorSelectedBlanketColor = "#B3D4FF";
26
+ export declare const akEditorSelectedBorderSize = 1;
27
+ export declare const akEditorSelectedBorder: string;
28
+ export declare const akEditorSelectedBoxShadow: string;
29
+ export declare const akEditorSelectedIconColor = "#0052CC";
30
+ export declare const akEditorSelectedBorderBoldSize = 2;
31
+ export declare const akEditorSelectedBlanketOpacity = 0.3;
32
+ export declare const akEditorUnitZIndex = 1;
33
+ export declare const akEditorShadowZIndex = 2;
34
+ export declare const akEditorStickyHeaderZIndex = 11;
35
+ export declare const akEditorSmallZIndex: number;
36
+ export declare const akEditorGridLineZIndex = 9999;
37
+ export declare const akEditorMenuZIndex: 500;
38
+ export declare const akEditorFloatingPanelZIndex: 400;
39
+ export declare const akEditorFloatingDialogZIndex: number;
40
+ export declare const akEditorFloatingOverlapPanelZIndex: number;
41
+ export declare const akEditorMentionSelected = "#7A869A";
42
+ export declare const akEditorTableToolbarSize = 11;
43
+ export declare const akEditorTableBorder = "#C1C7D0";
44
+ export declare const akEditorTableBorderDark = "#3B475C";
45
+ export declare const akEditorTableToolbar = "#F4F5F7";
46
+ export declare const akEditorTableToolbarDark = "#283447";
47
+ export declare const akEditorTableFloatingControls = "#F4F5F7";
48
+ export declare const akEditorTableCellSelected = "#B3D4FF";
49
+ export declare const akEditorTableToolbarSelected = "#4C9AFF";
50
+ export declare const akEditorTableBorderSelected = "#0065FF";
51
+ export declare const akEditorTableCellDelete = "#FFEBE6";
52
+ export declare const akEditorTableBorderDelete = "#FF5630";
53
+ export declare const akEditorTableToolbarDelete = "#FFBDAD";
54
+ export declare const akEditorTableBorderRadius = "3px";
55
+ export declare const akEditorTableCellBackgroundOpacity = 0.5;
56
+ export declare const akEditorFullPageMaxWidth = 680;
57
+ export declare const akEditorDefaultLayoutWidth = 760;
58
+ export declare const akEditorWideLayoutWidth = 960;
59
+ export declare const akEditorFullWidthLayoutWidth = 1800;
60
+ export declare const akEditorFullWidthLayoutLineLength = 1792;
61
+ export declare const akEditorTableNumberColumnWidth = 42;
62
+ export declare const akEditorBreakoutPadding = 96;
63
+ export declare const akEditorGutterPadding = 32;
64
+ export declare const akEditorMobileBreakoutPoint = 720;
65
+ export declare const akEditorTableCellMinWidth = 48;
66
+ export declare const akEditorTableLegacyCellMinWidth = 128;
67
+ export declare const akEditorMediaResizeHandlerPaddingWide = 12;
68
+ export declare const akEditorMediaResizeHandlerPadding = 4;
69
+ export declare const akEditorSwoopCubicBezier = "cubic-bezier(0.15, 1, 0.3, 1)";
70
+ export declare const gridMediumMaxWidth = 1024;
71
+ export declare const breakoutWideScaleRatio = 1.33;
72
+ export declare const akRichMediaResizeZIndex: number;
73
+ export declare const akLayoutGutterOffset: number;
74
+ export declare const akEditorLineHeight = 1.714;
75
+ export declare const akEditorRuleBackground = "#EBECF0";
76
+ export declare const akEditorRuleBorderRadius = "1px";
77
+ export declare const akEditorToolbarKeylineHeight = 2;
78
+ export declare const akEditorContextPanelWidth = 320;
79
+ export declare const blockNodesVerticalMargin = "0.75rem";
80
+ export declare const DEFAULT_EMBED_CARD_WIDTH = 680;
81
+ export declare const DEFAULT_EMBED_CARD_HEIGHT = 480;
82
+ export declare const ATLASSIAN_NAVIGATION_HEIGHT = "56px";
83
+ export declare const akEditorSelectedNodeClassName = "ak-editor-selected-node";
84
+ export declare const editorFontSize: ({ theme }: {
85
+ theme: EditorTheme;
86
+ }) => number;
87
+ export declare const relativeSize: (multiplier: number) => ({ theme, }: {
88
+ theme: EditorTheme;
89
+ }) => number;
90
+ export declare const relativeFontSizeToBase16: (px: number | string) => string;
91
+ export declare const getAkEditorFullPageMaxWidth: (allowDynamicTextSizing?: boolean) => 680 | 760;
92
+ export declare const VIEWPORT_SIZES: {
93
+ laptopHiDPI: {
94
+ width: number;
95
+ height: number;
96
+ };
97
+ laptopMDPI: {
98
+ width: number;
99
+ height: number;
100
+ };
101
+ tabletL: {
102
+ width: number;
103
+ height: number;
104
+ };
105
+ tabletS: {
106
+ width: number;
107
+ height: number;
108
+ };
109
+ mobileM: {
110
+ width: number;
111
+ height: number;
112
+ };
113
+ mobileS: {
114
+ width: number;
115
+ height: number;
116
+ };
117
+ mobileXS: {
118
+ width: number;
119
+ height: number;
120
+ };
121
+ };
122
+ export declare const akEditorMobileMaxWidth = 0;
123
+ export declare const getTableCellBackgroundDarkModeColors: string;
124
+ export declare function getTableCellBackgroundDarkModeColorCSS(colorName: string, colorValue: string): string;
@@ -0,0 +1,2 @@
1
+ export type { EditorTheme } from './types';
2
+ export { akEditorActiveBackground, akEditorActiveForeground, akEditorBlockquoteBorderColor, akEditorBreakoutPadding, akEditorCodeBackground, akEditorCodeBlockPadding, akEditorCodeFontFamily, akEditorCodeInlinePadding, akEditorContextPanelWidth, akEditorDefaultLayoutWidth, akEditorDeleteBackground, akEditorDeleteBackgroundShaded, akEditorDeleteBackgroundWithOpacity, akEditorDeleteBorder, akEditorDeleteIconColor, akEditorDropdownActiveBackground, akEditorFloatingDialogZIndex, akEditorFloatingOverlapPanelZIndex, akEditorFloatingPanelZIndex, akEditorFocus, akEditorFullPageMaxWidth, akEditorFullPageDefaultFontSize, akEditorFullWidthLayoutWidth, akEditorFullWidthLayoutLineLength, akEditorGridLineZIndex, akEditorGutterPadding, akEditorInactiveForeground, akEditorMediaResizeHandlerPadding, akEditorMediaResizeHandlerPaddingWide, akEditorMentionSelected, akEditorMenuZIndex, akEditorStickyHeaderZIndex, akEditorMobileBreakoutPoint, akEditorPopupBackground, akEditorPopupText, akEditorPrimaryButton, akEditorSelectedBorderColor, akEditorSelectedBorderBoldSize, akEditorSelectedBorderSize, akEditorSelectedBorder, akEditorSelectedBoxShadow, akEditorSelectedIconColor, akEditorCustomIconSize, akEditorSelectedBlanketColor, akEditorSelectedBgColor, akEditorSelectedBlanketOpacity, akEditorSmallZIndex, akEditorShadowZIndex, akEditorSubtleAccent, akEditorSwoopCubicBezier, akEditorTableBorder, akEditorTableBorderDark, akEditorTableBorderDelete, akEditorTableBorderRadius, akEditorTableBorderSelected, akEditorTableCellBackgroundOpacity, akEditorTableCellDelete, akEditorTableCellMinWidth, akEditorTableCellSelected, akEditorTableFloatingControls, akEditorTableLegacyCellMinWidth, akEditorTableNumberColumnWidth, akEditorTableToolbar, akEditorTableToolbarDark, akEditorTableToolbarDelete, akEditorTableToolbarSelected, akEditorTableToolbarSize, akEditorUnitZIndex, akEditorWideLayoutWidth, akLayoutGutterOffset, akRichMediaResizeZIndex, blockNodesVerticalMargin, breakoutWideScaleRatio, editorFontSize, gridMediumMaxWidth, getAkEditorFullPageMaxWidth, relativeSize, relativeFontSizeToBase16, DEFAULT_EMBED_CARD_HEIGHT, DEFAULT_EMBED_CARD_WIDTH, akEditorLineHeight, akEditorRuleBackground, akEditorRuleBorderRadius, akEditorSelectedNodeClassName, akEditorToolbarKeylineHeight, VIEWPORT_SIZES, akEditorMobileMaxWidth, getTableCellBackgroundDarkModeColors, ATLASSIAN_NAVIGATION_HEIGHT, } from './consts';
@@ -0,0 +1,3 @@
1
+ export declare type EditorTheme = {
2
+ baseFontSize?: number;
3
+ };
@@ -0,0 +1,4 @@
1
+ export { akEditorActiveBackground, akEditorActiveForeground, akEditorBlockquoteBorderColor, akEditorBreakoutPadding, akEditorCodeBackground, akEditorCodeBlockPadding, akEditorCodeFontFamily, akEditorCodeInlinePadding, akEditorContextPanelWidth, akEditorDefaultLayoutWidth, akEditorDeleteBackground, akEditorDeleteBackgroundShaded, akEditorDeleteBackgroundWithOpacity, akEditorDeleteBorder, akEditorDeleteIconColor, akEditorDropdownActiveBackground, akEditorFloatingDialogZIndex, akEditorFloatingOverlapPanelZIndex, akEditorFloatingPanelZIndex, akEditorFocus, akEditorFullPageMaxWidth, akEditorFullPageDefaultFontSize, akEditorFullWidthLayoutWidth, akEditorFullWidthLayoutLineLength, akEditorGridLineZIndex, akEditorGutterPadding, akEditorInactiveForeground, akEditorMediaResizeHandlerPadding, akEditorMediaResizeHandlerPaddingWide, akEditorMentionSelected, akEditorMenuZIndex, akEditorStickyHeaderZIndex, akEditorMobileBreakoutPoint, akEditorPopupBackground, akEditorPopupText, akEditorPrimaryButton, akEditorSelectedBorderColor, akEditorSelectedBorderBoldSize, akEditorSelectedBorderSize, akEditorSelectedBorder, akEditorSelectedBoxShadow, akEditorSelectedIconColor, akEditorSelectedBlanketColor, akEditorSelectedBgColor, akEditorSelectedBlanketOpacity, akEditorSmallZIndex, akEditorShadowZIndex, akEditorSubtleAccent, akEditorSwoopCubicBezier, akEditorTableBorder, akEditorTableBorderDark, akEditorTableBorderDelete, akEditorTableBorderRadius, akEditorTableBorderSelected, akEditorTableCellBackgroundOpacity, akEditorTableCellDelete, akEditorTableCellMinWidth, akEditorTableCellSelected, akEditorTableFloatingControls, akEditorTableLegacyCellMinWidth, akEditorTableNumberColumnWidth, akEditorTableToolbar, akEditorTableToolbarDark, akEditorTableToolbarDelete, akEditorTableToolbarSelected, akEditorTableToolbarSize, akEditorUnitZIndex, akEditorWideLayoutWidth, akLayoutGutterOffset, akRichMediaResizeZIndex, blockNodesVerticalMargin, breakoutWideScaleRatio, editorFontSize, gridMediumMaxWidth, getAkEditorFullPageMaxWidth, relativeSize, relativeFontSizeToBase16, DEFAULT_EMBED_CARD_HEIGHT, DEFAULT_EMBED_CARD_WIDTH, akEditorLineHeight, akEditorRuleBackground, akEditorRuleBorderRadius, akEditorSelectedNodeClassName, akEditorToolbarKeylineHeight, VIEWPORT_SIZES, akEditorMobileMaxWidth, getTableCellBackgroundDarkModeColors, ATLASSIAN_NAVIGATION_HEIGHT, } from './consts';
2
+ export type { EditorTheme } from './consts';
3
+ export { SelectionStyle, getSelectionStyles, hideNativeBrowserTextSelectionStyles, } from './selection';
4
+ export { overflowShadow } from './overflow-shadow';
@@ -0,0 +1 @@
1
+ export { overflowShadow } from './overflow-shadow';
@@ -0,0 +1,5 @@
1
+ import { ThemedValue } from '@atlaskit/theme/types';
2
+ export declare const overflowShadow: ({ background, width, }: {
3
+ background: ThemedValue<string> | string;
4
+ width: string;
5
+ }) => import("styled-components").FlattenInterpolation<import("styled-components").ThemedStyledProps<import("@atlaskit/theme/types").AtlaskitThemeProps | import("@atlaskit/theme/types").CustomThemeProps | import("@atlaskit/theme/types").NoThemeProps | undefined, any>>[];
@@ -0,0 +1,2 @@
1
+ export { SelectionStyle } from './types';
2
+ export { getSelectionStyles, hideNativeBrowserTextSelectionStyles, } from './utils';
@@ -0,0 +1,11 @@
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 declare enum SelectionStyle {
7
+ Border = 0,
8
+ BoxShadow = 1,
9
+ Background = 2,
10
+ Blanket = 3
11
+ }