@atlaskit/editor-common 76.27.8 → 76.27.10
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 +15 -0
- package/dist/cjs/media-inline/constants.js +21 -2
- package/dist/cjs/media-inline/inline-image-wrapper.js +4 -2
- package/dist/cjs/media-inline/media-inline-image-card.js +3 -3
- package/dist/cjs/media-inline/styles.js +11 -3
- package/dist/cjs/media-inline/views/icon-wrapper.js +1 -1
- package/dist/cjs/monitoring/error.js +1 -1
- package/dist/cjs/react-node-view/getInlineNodeViewProducer.js +6 -1
- package/dist/cjs/styles/shared/annotation.js +5 -22
- package/dist/cjs/styles/shared/code-block.js +4 -20
- package/dist/cjs/styles/shared/code-mark.js +2 -6
- package/dist/cjs/styles/shared/panel.js +9 -62
- package/dist/cjs/styles/shared/rule.js +2 -8
- package/dist/cjs/ui/BaseTheme/index.js +8 -15
- package/dist/cjs/ui/DropList/index.js +4 -17
- package/dist/cjs/ui/Expand/index.js +13 -38
- package/dist/cjs/ui/Messages/index.js +6 -6
- package/dist/cjs/ui/PortalProvider/index.js +7 -21
- package/dist/cjs/ui-menu/ColorPickerButton/index.js +5 -13
- package/dist/cjs/ui-menu/DropdownMenu/index.js +10 -27
- package/dist/es2019/media-inline/constants.js +20 -1
- package/dist/es2019/media-inline/inline-image-wrapper.js +4 -2
- package/dist/es2019/media-inline/media-inline-image-card.js +3 -3
- package/dist/es2019/media-inline/styles.js +24 -9
- package/dist/es2019/media-inline/views/icon-wrapper.js +1 -1
- package/dist/es2019/monitoring/error.js +1 -1
- package/dist/es2019/react-node-view/getInlineNodeViewProducer.js +7 -1
- package/dist/es2019/styles/shared/annotation.js +9 -28
- package/dist/es2019/styles/shared/code-block.js +11 -27
- package/dist/es2019/styles/shared/code-mark.js +3 -7
- package/dist/es2019/styles/shared/panel.js +24 -83
- package/dist/es2019/styles/shared/rule.js +3 -9
- package/dist/es2019/ui/BaseTheme/index.js +3 -11
- package/dist/es2019/ui/DropList/index.js +7 -17
- package/dist/es2019/ui/Expand/index.js +18 -44
- package/dist/es2019/ui/Messages/index.js +6 -6
- package/dist/es2019/ui/PortalProvider/index.js +7 -21
- package/dist/es2019/ui-menu/ColorPickerButton/index.js +7 -15
- package/dist/es2019/ui-menu/DropdownMenu/index.js +34 -49
- package/dist/esm/media-inline/constants.js +20 -1
- package/dist/esm/media-inline/inline-image-wrapper.js +4 -2
- package/dist/esm/media-inline/media-inline-image-card.js +3 -3
- package/dist/esm/media-inline/styles.js +11 -3
- package/dist/esm/media-inline/views/icon-wrapper.js +1 -1
- package/dist/esm/monitoring/error.js +1 -1
- package/dist/esm/react-node-view/getInlineNodeViewProducer.js +7 -1
- package/dist/esm/styles/shared/annotation.js +5 -22
- package/dist/esm/styles/shared/code-block.js +6 -22
- package/dist/esm/styles/shared/code-mark.js +3 -7
- package/dist/esm/styles/shared/panel.js +10 -63
- package/dist/esm/styles/shared/rule.js +3 -9
- package/dist/esm/ui/BaseTheme/index.js +9 -15
- package/dist/esm/ui/DropList/index.js +5 -18
- package/dist/esm/ui/Expand/index.js +14 -39
- package/dist/esm/ui/Messages/index.js +6 -6
- package/dist/esm/ui/PortalProvider/index.js +7 -21
- package/dist/esm/ui-menu/ColorPickerButton/index.js +6 -14
- package/dist/esm/ui-menu/DropdownMenu/index.js +11 -28
- package/dist/types/media-inline/constants.d.ts +18 -0
- package/dist/types/media-inline/styles.d.ts +6 -0
- package/dist/types/styles/shared/annotation.d.ts +2 -3
- package/dist/types/styles/shared/code-block.d.ts +1 -2
- package/dist/types/styles/shared/code-mark.d.ts +1 -2
- package/dist/types/styles/shared/panel.d.ts +4 -5
- package/dist/types/styles/shared/rule.d.ts +1 -2
- package/dist/types/ui/BaseTheme/index.d.ts +1 -1
- package/dist/types/ui/Expand/index.d.ts +4 -5
- package/dist/types/ui/Messages/index.d.ts +1 -1
- package/dist/types/ui/PortalProvider/index.d.ts +4 -8
- package/dist/types/utils/getModeFromTheme.d.ts +1 -1
- package/dist/types-ts4.5/media-inline/constants.d.ts +18 -0
- package/dist/types-ts4.5/media-inline/styles.d.ts +6 -0
- package/dist/types-ts4.5/styles/shared/annotation.d.ts +2 -3
- package/dist/types-ts4.5/styles/shared/code-block.d.ts +1 -2
- package/dist/types-ts4.5/styles/shared/code-mark.d.ts +1 -2
- package/dist/types-ts4.5/styles/shared/panel.d.ts +4 -5
- package/dist/types-ts4.5/styles/shared/rule.d.ts +1 -2
- package/dist/types-ts4.5/ui/BaseTheme/index.d.ts +1 -1
- package/dist/types-ts4.5/ui/Expand/index.d.ts +4 -5
- package/dist/types-ts4.5/ui/Messages/index.d.ts +1 -1
- package/dist/types-ts4.5/ui/PortalProvider/index.d.ts +4 -8
- package/dist/types-ts4.5/utils/getModeFromTheme.d.ts +1 -1
- package/package.json +2 -2
- package/dist/cjs/ui/PortalProvider/PortalProviderThemesProvider.js +0 -43
- package/dist/es2019/ui/PortalProvider/PortalProviderThemesProvider.js +0 -37
- package/dist/esm/ui/PortalProvider/PortalProviderThemesProvider.js +0 -36
- package/dist/types/ui/PortalProvider/PortalProviderThemesProvider.d.ts +0 -6
- package/dist/types-ts4.5/ui/PortalProvider/PortalProviderThemesProvider.d.ts +0 -6
|
@@ -14,7 +14,6 @@ var _react2 = require("@emotion/react");
|
|
|
14
14
|
var _reactIntlNext = require("react-intl-next");
|
|
15
15
|
var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
|
|
16
16
|
var _colors = require("@atlaskit/theme/colors");
|
|
17
|
-
var _components = require("@atlaskit/theme/components");
|
|
18
17
|
var _constants = require("@atlaskit/theme/constants");
|
|
19
18
|
var _excluded = ["children"];
|
|
20
19
|
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7;
|
|
@@ -46,30 +45,21 @@ var messages = exports.messages = (0, _reactIntlNext.defineMessages)({
|
|
|
46
45
|
});
|
|
47
46
|
var BORDER_RADIUS = "var(--ds-border-radius-100, 4px)";
|
|
48
47
|
var EXPAND_COLLAPSED_BACKGROUND = "var(--ds-background-neutral-subtle, transparent)";
|
|
49
|
-
var EXPAND_SELECTED_BACKGROUND = (
|
|
50
|
-
light: "var(--ds-surface, rgba(255, 255, 255, 0.6))",
|
|
51
|
-
dark: "var(--ds-surface, rgba(9, 10, 11, 0.29))"
|
|
52
|
-
});
|
|
48
|
+
var EXPAND_SELECTED_BACKGROUND = "var(--ds-surface, rgba(255, 255, 255, 0.6))";
|
|
53
49
|
var EXPAND_FOCUSED_BORDER_COLOR = "var(--ds-border-focused, ".concat(_colors.B300, ")");
|
|
54
50
|
var EXPAND_COLLAPSED_BORDER_COLOR = 'transparent';
|
|
55
|
-
var EXPAND_EXPANDED_BORDER_COLOR = (
|
|
56
|
-
light: "var(--ds-border, ".concat(_colors.N40A, ")"),
|
|
57
|
-
dark: "var(--ds-border, ".concat(_colors.DN50, ")")
|
|
58
|
-
});
|
|
51
|
+
var EXPAND_EXPANDED_BORDER_COLOR = "var(--ds-border, ".concat(_colors.N40A, ")");
|
|
59
52
|
var ExpandIconWrapper = exports.ExpandIconWrapper = function ExpandIconWrapper(_ref) {
|
|
60
53
|
var children = _ref.children,
|
|
61
54
|
expanded = _ref.expanded;
|
|
62
55
|
return (0, _react2.jsx)("div", {
|
|
63
|
-
css: function css(
|
|
64
|
-
return expanded ? [expandIconWrapperStyle(
|
|
56
|
+
css: function css() {
|
|
57
|
+
return expanded ? [expandIconWrapperStyle(), expandIconWrapperExpandedStyle] : expandIconWrapperStyle();
|
|
65
58
|
}
|
|
66
59
|
}, children);
|
|
67
60
|
};
|
|
68
|
-
var expandIconWrapperStyle = function expandIconWrapperStyle(
|
|
69
|
-
return (0, _react2.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n cursor: pointer;\n display: flex;\n color: ", ";\n border-radius: ", ";\n width: 24px;\n height: 24px;\n\n &:hover {\n background: ", ";\n }\n\n svg {\n transition: transform 0.2s ", ";\n }\n"])), (
|
|
70
|
-
light: "var(--ds-icon, ".concat(_colors.N90, ")"),
|
|
71
|
-
dark: "var(--ds-icon, #d9dde3)"
|
|
72
|
-
})(props), "var(--ds-border-radius-100, 4px)", "var(--ds-background-neutral-subtle-hovered, ".concat(_colors.N30A, ")"), _editorSharedStyles.akEditorSwoopCubicBezier);
|
|
61
|
+
var expandIconWrapperStyle = function expandIconWrapperStyle() {
|
|
62
|
+
return (0, _react2.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n cursor: pointer;\n display: flex;\n color: ", ";\n border-radius: ", ";\n width: 24px;\n height: 24px;\n\n &:hover {\n background: ", ";\n }\n\n svg {\n transition: transform 0.2s ", ";\n }\n"])), "var(--ds-icon, ".concat(_colors.N90, ")"), "var(--ds-border-radius-100, 4px)", "var(--ds-background-neutral-subtle-hovered, ".concat(_colors.N30A, ")"), _editorSharedStyles.akEditorSwoopCubicBezier);
|
|
73
63
|
};
|
|
74
64
|
var expandIconWrapperExpandedStyle = (0, _react2.css)(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n svg {\n transform: rotate(90deg);\n }\n"])));
|
|
75
65
|
var expandLayoutWrapperStyle = exports.expandLayoutWrapperStyle = (0, _react2.css)(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["\n width: ", ";\n height: ", ";\n"])), "var(--ds-space-300, 24px)", "var(--ds-space-300, 24px)");
|
|
@@ -91,35 +81,20 @@ var containerStyles = function containerStyles(styleProps) {
|
|
|
91
81
|
// and is the root level expand.
|
|
92
82
|
var marginHorizontal = styleProps['data-node-type'] === 'expand' ? "-".concat(_editorSharedStyles.akLayoutGutterOffset, "px") : 0;
|
|
93
83
|
var margin = "".concat(marginTop, " ").concat(marginHorizontal, " ").concat(marginBottom);
|
|
94
|
-
return function (
|
|
95
|
-
return (0, _react2.css)(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2.default)(["\n border-width: 1px;\n border-style: solid;\n border-color: ", ";\n border-radius: ", ";\n min-height: 25px;\n background: ", ";\n margin: ", ";\n\n transition: background 0.3s ", ",\n border-color 0.3s ", ";\n padding: ", ";\n\n &:hover {\n // TODO: Remove the border styles below once design tokens have been enabled and fallbacks are no longer triggered.\n // This is because the default state already uses the same token and, as such, the hover style won't change anything.\n // https://product-fabric.atlassian.net/browse/DSP-4152\n border: 1px solid
|
|
96
|
-
light: "var(--ds-border, ".concat(_colors.N50A, ")"),
|
|
97
|
-
dark: "var(--ds-border, ".concat(_colors.DN50, ")")
|
|
98
|
-
})(themeProps), EXPAND_SELECTED_BACKGROUND(themeProps));
|
|
84
|
+
return function () {
|
|
85
|
+
return (0, _react2.css)(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2.default)(["\n border-width: 1px;\n border-style: solid;\n border-color: ", ";\n border-radius: ", ";\n min-height: 25px;\n background: ", ";\n margin: ", ";\n\n transition: background 0.3s ", ",\n border-color 0.3s ", ";\n padding: ", ";\n\n &:hover {\n // TODO: Remove the border styles below once design tokens have been enabled and fallbacks are no longer triggered.\n // This is because the default state already uses the same token and, as such, the hover style won't change anything.\n // https://product-fabric.atlassian.net/browse/DSP-4152\n border: 1px solid ", ";\n background: ", ";\n }\n\n td > :not(style):first-child,\n td > style:first-child + * {\n margin-top: 0;\n }\n "])), focused ? EXPAND_FOCUSED_BORDER_COLOR : expanded ? EXPAND_EXPANDED_BORDER_COLOR : EXPAND_COLLAPSED_BORDER_COLOR, BORDER_RADIUS, !expanded ? EXPAND_COLLAPSED_BACKGROUND : EXPAND_SELECTED_BACKGROUND, margin, _editorSharedStyles.akEditorSwoopCubicBezier, _editorSharedStyles.akEditorSwoopCubicBezier, "var(--ds-space-100, 8px)", "var(--ds-border, ".concat(_colors.N50A, ")"), EXPAND_SELECTED_BACKGROUND);
|
|
99
86
|
};
|
|
100
87
|
};
|
|
101
88
|
var contentStyles = function contentStyles(styleProps) {
|
|
102
|
-
return function (
|
|
89
|
+
return function () {
|
|
103
90
|
return (0, _react2.css)(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2.default)(["\n padding-top: ", ";\n padding-right: ", ";\n // TODO: Migrate away from gridSize\n // Recommendation: Replace gridSize with 8 if important to highlight 8*4 - 8/2, or directly replace with 28px\n padding-left: ", "px;\n display: flow-root;\n\n // The follow rules inside @supports block are added as a part of ED-8893\n // The fix is targeting mobile bridge on iOS 12 or below,\n // We should consider remove this fix when we no longer support iOS 12\n @supports not (display: flow-root) {\n width: 100%;\n box-sizing: border-box;\n }\n\n ", "\n "])), styleProps.expanded ? "var(--ds-space-100, 8px)" : "var(--ds-space-0, 0px)", "var(--ds-space-100, 8px)", (0, _constants.gridSize)() * 4 - (0, _constants.gridSize)() / 2, !styleProps.expanded ? "\n .expand-content-wrapper, .nestedExpand-content-wrapper {\n /* We visually hide the content here to preserve the content during copy+paste */\n /* Do not add text nowrap here because inline comment navigation depends on the location of the text */\n width: 100%;\n display: block;\n height: 0;\n overflow: hidden;\n clip: rect(1px, 1px, 1px, 1px);\n user-select: none;\n }\n " : '');
|
|
104
91
|
};
|
|
105
92
|
};
|
|
106
|
-
var titleInputStyles = function titleInputStyles(
|
|
107
|
-
return (0, _react2.css)(_templateObject6 || (_templateObject6 = (0, _taggedTemplateLiteral2.default)(["\n outline: none;\n border: none;\n font-size: ", ";\n line-height: ", ";\n font-weight: normal;\n color: ", ";\n background: transparent;\n display: flex;\n flex: 1;\n padding: 0 0 0 ", ";\n width: 100%;\n\n &::placeholder {\n opacity:
|
|
108
|
-
light: "var(--ds-text-subtlest, ".concat(_colors.N200A, ")"),
|
|
109
|
-
dark: "var(--ds-text-subtlest, ".concat(_colors.DN600, ")")
|
|
110
|
-
})(props), "var(--ds-space-050, 4px)", (0, _components.themed)({
|
|
111
|
-
light: 1,
|
|
112
|
-
dark: 0.6
|
|
113
|
-
})(props), (0, _components.themed)({
|
|
114
|
-
light: "var(--ds-text-subtlest, ".concat(_colors.N200, ")"),
|
|
115
|
-
dark: "var(--ds-text-subtlest, ".concat(_colors.DN600, ")")
|
|
116
|
-
})(props));
|
|
93
|
+
var titleInputStyles = function titleInputStyles() {
|
|
94
|
+
return (0, _react2.css)(_templateObject6 || (_templateObject6 = (0, _taggedTemplateLiteral2.default)(["\n outline: none;\n border: none;\n font-size: ", ";\n line-height: ", ";\n font-weight: normal;\n color: ", ";\n background: transparent;\n display: flex;\n flex: 1;\n padding: 0 0 0 ", ";\n width: 100%;\n\n &::placeholder {\n opacity: 1;\n color: ", ";\n }\n"])), (0, _editorSharedStyles.relativeFontSizeToBase16)((0, _constants.fontSize)()), _editorSharedStyles.akEditorLineHeight, "var(--ds-text-subtlest, ".concat(_colors.N200A, ")"), "var(--ds-space-050, 4px)", "var(--ds-text-subtlest, ".concat(_colors.N200, ")"));
|
|
117
95
|
};
|
|
118
|
-
var titleContainerStyles = function titleContainerStyles(
|
|
119
|
-
return (0, _react2.css)(_templateObject7 || (_templateObject7 = (0, _taggedTemplateLiteral2.default)(["\n padding: 0;\n display: flex;\n align-items: flex-start;\n background: none;\n border: none;\n font-size: ", ";\n width: 100%;\n color: ", ";\n overflow: hidden;\n cursor: pointer;\n\n &:focus {\n outline: 0;\n }\n"])), (0, _editorSharedStyles.relativeFontSizeToBase16)((0, _constants.fontSize)()), (
|
|
120
|
-
light: "var(--ds-text-subtle, ".concat(_colors.N300A, ")"),
|
|
121
|
-
dark: "var(--ds-text-subtle, ".concat(_colors.DN600, ")")
|
|
122
|
-
})(props));
|
|
96
|
+
var titleContainerStyles = function titleContainerStyles() {
|
|
97
|
+
return (0, _react2.css)(_templateObject7 || (_templateObject7 = (0, _taggedTemplateLiteral2.default)(["\n padding: 0;\n display: flex;\n align-items: flex-start;\n background: none;\n border: none;\n font-size: ", ";\n width: 100%;\n color: ", ";\n overflow: hidden;\n cursor: pointer;\n\n &:focus {\n outline: 0;\n }\n"])), (0, _editorSharedStyles.relativeFontSizeToBase16)((0, _constants.fontSize)()), "var(--ds-text-subtle, ".concat(_colors.N300A, ")"));
|
|
123
98
|
};
|
|
124
99
|
var sharedExpandStyles = exports.sharedExpandStyles = {
|
|
125
100
|
titleInputStyles: titleInputStyles,
|
|
@@ -15,8 +15,8 @@ var _templateObject, _templateObject2, _templateObject3, _templateObject4;
|
|
|
15
15
|
/** @jsx jsx */
|
|
16
16
|
var errorColor = (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n color: ", ";\n"])), "var(--ds-text-danger, ".concat(_colors.R400, ")"));
|
|
17
17
|
var validColor = (0, _react.css)(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n color: ", ";\n"])), "var(--ds-text-success, ".concat(_colors.G400, ")"));
|
|
18
|
-
var messageStyle = function messageStyle(
|
|
19
|
-
return (0, _react.css)(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["\n ", " font-weight: normal;\n color: ", ";\n margin-top: ", ";\n display: flex;\n justify-content: baseline;\n"])), (0, _typography.h200)(
|
|
18
|
+
var messageStyle = function messageStyle() {
|
|
19
|
+
return (0, _react.css)(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["\n ", " font-weight: normal;\n color: ", ";\n margin-top: ", ";\n display: flex;\n justify-content: baseline;\n"])), (0, _typography.h200)(), "var(--ds-text-subtlest, ".concat(_colors.N200, ")"), "var(--ds-space-050, 4px)");
|
|
20
20
|
};
|
|
21
21
|
var iconWrapperStyle = (0, _react.css)(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n margin-right: ", ";\n"])), "var(--ds-space-050, 4px)");
|
|
22
22
|
var HelperMessage = exports.HelperMessage = function HelperMessage(_ref) {
|
|
@@ -28,8 +28,8 @@ var HelperMessage = exports.HelperMessage = function HelperMessage(_ref) {
|
|
|
28
28
|
var ErrorMessage = exports.ErrorMessage = function ErrorMessage(_ref2) {
|
|
29
29
|
var children = _ref2.children;
|
|
30
30
|
return (0, _react.jsx)("div", {
|
|
31
|
-
css: function css(
|
|
32
|
-
return [messageStyle(
|
|
31
|
+
css: function css() {
|
|
32
|
+
return [messageStyle(), errorColor];
|
|
33
33
|
}
|
|
34
34
|
}, (0, _react.jsx)("span", {
|
|
35
35
|
css: iconWrapperStyle
|
|
@@ -42,8 +42,8 @@ var ErrorMessage = exports.ErrorMessage = function ErrorMessage(_ref2) {
|
|
|
42
42
|
var ValidMessage = exports.ValidMessage = function ValidMessage(_ref3) {
|
|
43
43
|
var children = _ref3.children;
|
|
44
44
|
return (0, _react.jsx)("div", {
|
|
45
|
-
css: function css(
|
|
46
|
-
return [messageStyle(
|
|
45
|
+
css: function css() {
|
|
46
|
+
return [messageStyle(), validColor];
|
|
47
47
|
}
|
|
48
48
|
}, (0, _react.jsx)("span", {
|
|
49
49
|
css: iconWrapperStyle
|
|
@@ -18,18 +18,16 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
|
18
18
|
var _reactDom = require("react-dom");
|
|
19
19
|
var _reactIntlNext = require("react-intl-next");
|
|
20
20
|
var _analyticsNextStableReactContext = _interopRequireDefault(require("@atlaskit/analytics-next-stable-react-context"));
|
|
21
|
-
var _components = require("@atlaskit/theme/components");
|
|
22
21
|
var _analytics = require("../../analytics");
|
|
23
22
|
var _eventDispatcher = require("../../event-dispatcher");
|
|
24
23
|
var _IntlProviderIfMissingWrapper = _interopRequireDefault(require("../IntlProviderIfMissingWrapper"));
|
|
25
|
-
var _PortalProviderThemesProvider = require("./PortalProviderThemesProvider");
|
|
26
24
|
var _class4;
|
|
27
25
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
|
|
28
26
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
29
27
|
var PortalProviderAPI = exports.PortalProviderAPI = /*#__PURE__*/function (_EventDispatcher) {
|
|
30
28
|
(0, _inherits2.default)(PortalProviderAPI, _EventDispatcher);
|
|
31
29
|
var _super = _createSuper(PortalProviderAPI);
|
|
32
|
-
function PortalProviderAPI(intl, onAnalyticsEvent, analyticsContext
|
|
30
|
+
function PortalProviderAPI(intl, onAnalyticsEvent, analyticsContext) {
|
|
33
31
|
var _this;
|
|
34
32
|
(0, _classCallCheck2.default)(this, PortalProviderAPI);
|
|
35
33
|
_this = _super.call(this);
|
|
@@ -40,7 +38,6 @@ var PortalProviderAPI = exports.PortalProviderAPI = /*#__PURE__*/function (_Even
|
|
|
40
38
|
_this.intl = intl;
|
|
41
39
|
_this.onAnalyticsEvent = onAnalyticsEvent;
|
|
42
40
|
_this.useAnalyticsContext = analyticsContext;
|
|
43
|
-
_this.themeMode = themeMode;
|
|
44
41
|
return _this;
|
|
45
42
|
}
|
|
46
43
|
(0, _createClass2.default)(PortalProviderAPI, [{
|
|
@@ -53,10 +50,7 @@ var PortalProviderAPI = exports.PortalProviderAPI = /*#__PURE__*/function (_Even
|
|
|
53
50
|
hasAnalyticsContext: hasAnalyticsContext,
|
|
54
51
|
hasIntlContext: hasIntlContext
|
|
55
52
|
});
|
|
56
|
-
var
|
|
57
|
-
mode: this.themeMode
|
|
58
|
-
}, children());
|
|
59
|
-
var wrappedChildren = this.useAnalyticsContext ? /*#__PURE__*/_react.default.createElement(AnalyticsContextWrapper, null, childrenWithThemeProviders) : childrenWithThemeProviders;
|
|
53
|
+
var wrappedChildren = this.useAnalyticsContext ? /*#__PURE__*/_react.default.createElement(AnalyticsContextWrapper, null, children()) : children();
|
|
60
54
|
if (hasIntlContext) {
|
|
61
55
|
wrappedChildren = /*#__PURE__*/_react.default.createElement(_reactIntlNext.RawIntlProvider, {
|
|
62
56
|
value: this.intl
|
|
@@ -72,25 +66,20 @@ var PortalProviderAPI = exports.PortalProviderAPI = /*#__PURE__*/function (_Even
|
|
|
72
66
|
key: "forceUpdate",
|
|
73
67
|
value: function forceUpdate(_ref) {
|
|
74
68
|
var _this2 = this;
|
|
75
|
-
var intl = _ref.intl
|
|
76
|
-
themeMode = _ref.themeMode;
|
|
69
|
+
var intl = _ref.intl;
|
|
77
70
|
this.intl = intl;
|
|
78
|
-
this.themeMode = themeMode;
|
|
79
71
|
this.portals.forEach(function (portal, container) {
|
|
80
72
|
if (!portal.hasAnalyticsContext && !_this2.useAnalyticsContext && !portal.hasIntlContext) {
|
|
81
73
|
return;
|
|
82
74
|
}
|
|
83
75
|
var wrappedChildren = portal.children();
|
|
84
|
-
var childrenWithThemeProviders = /*#__PURE__*/_react.default.createElement(_PortalProviderThemesProvider.PortalProviderThemeProviders, {
|
|
85
|
-
mode: themeMode
|
|
86
|
-
}, wrappedChildren);
|
|
87
76
|
if (portal.hasAnalyticsContext && _this2.useAnalyticsContext) {
|
|
88
|
-
wrappedChildren = /*#__PURE__*/_react.default.createElement(AnalyticsContextWrapper, null,
|
|
77
|
+
wrappedChildren = /*#__PURE__*/_react.default.createElement(AnalyticsContextWrapper, null, wrappedChildren);
|
|
89
78
|
}
|
|
90
79
|
if (portal.hasIntlContext) {
|
|
91
80
|
wrappedChildren = /*#__PURE__*/_react.default.createElement(_reactIntlNext.RawIntlProvider, {
|
|
92
81
|
value: _this2.intl
|
|
93
|
-
},
|
|
82
|
+
}, wrappedChildren);
|
|
94
83
|
}
|
|
95
84
|
(0, _reactDom.unstable_renderSubtreeIntoContainer)(_this2.context, wrappedChildren, container);
|
|
96
85
|
});
|
|
@@ -138,7 +127,7 @@ var BasePortalProvider = /*#__PURE__*/function (_React$Component) {
|
|
|
138
127
|
var _this3;
|
|
139
128
|
(0, _classCallCheck2.default)(this, BasePortalProvider);
|
|
140
129
|
_this3 = _super2.call(this, props);
|
|
141
|
-
_this3.portalProviderAPI = new PortalProviderAPI(props.intl, props.onAnalyticsEvent, props.useAnalyticsContext
|
|
130
|
+
_this3.portalProviderAPI = new PortalProviderAPI(props.intl, props.onAnalyticsEvent, props.useAnalyticsContext);
|
|
142
131
|
return _this3;
|
|
143
132
|
}
|
|
144
133
|
(0, _createClass2.default)(BasePortalProvider, [{
|
|
@@ -150,8 +139,7 @@ var BasePortalProvider = /*#__PURE__*/function (_React$Component) {
|
|
|
150
139
|
key: "componentDidUpdate",
|
|
151
140
|
value: function componentDidUpdate() {
|
|
152
141
|
this.portalProviderAPI.forceUpdate({
|
|
153
|
-
intl: this.props.intl
|
|
154
|
-
themeMode: this.props.themeMode
|
|
142
|
+
intl: this.props.intl
|
|
155
143
|
});
|
|
156
144
|
}
|
|
157
145
|
}]);
|
|
@@ -174,10 +162,8 @@ var PortalProviderWithThemeAndIntlProviders = function PortalProviderWithThemeAn
|
|
|
174
162
|
useAnalyticsContext = _ref3.useAnalyticsContext,
|
|
175
163
|
render = _ref3.render;
|
|
176
164
|
var intl = (0, _reactIntlNext.useIntl)();
|
|
177
|
-
var globalTheme = (0, _components.useGlobalTheme)();
|
|
178
165
|
return /*#__PURE__*/_react.default.createElement(BasePortalProvider, {
|
|
179
166
|
intl: intl,
|
|
180
|
-
themeMode: globalTheme.mode,
|
|
181
167
|
onAnalyticsEvent: onAnalyticsEvent,
|
|
182
168
|
useAnalyticsContext: useAnalyticsContext,
|
|
183
169
|
render: render
|
|
@@ -13,8 +13,6 @@ var _analyticsNext = require("@atlaskit/analytics-next");
|
|
|
13
13
|
var _button = _interopRequireDefault(require("@atlaskit/button"));
|
|
14
14
|
var _chevronDown = _interopRequireDefault(require("@atlaskit/icon/glyph/chevron-down"));
|
|
15
15
|
var _colors = require("@atlaskit/theme/colors");
|
|
16
|
-
var _components = require("@atlaskit/theme/components");
|
|
17
|
-
var _constants = require("@atlaskit/theme/constants");
|
|
18
16
|
var _tooltip = _interopRequireDefault(require("@atlaskit/tooltip"));
|
|
19
17
|
var _analytics = require("../../analytics");
|
|
20
18
|
var _uiColor = require("../../ui-color");
|
|
@@ -31,11 +29,8 @@ var colorPickerExpandContainer = (0, _react2.css)(_templateObject2 || (_template
|
|
|
31
29
|
// Control the size of color picker buttons and preview
|
|
32
30
|
// TODO: https://product-fabric.atlassian.net/browse/DSP-4134
|
|
33
31
|
/* eslint-disable @atlaskit/design-system/ensure-design-token-usage */
|
|
34
|
-
var colorPickerWrapper = function colorPickerWrapper(
|
|
35
|
-
return (0, _react2.css)(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["\n border-radius: ", "
|
|
36
|
-
light: "var(--ds-surface-overlay, ".concat(_colors.N0, ")"),
|
|
37
|
-
dark: "var(--ds-surface-overlay, ".concat(_colors.DN50, ")")
|
|
38
|
-
})(theme), _colors.N60A, _colors.N60A, "var(--ds-space-100, 8px)");
|
|
32
|
+
var colorPickerWrapper = function colorPickerWrapper() {
|
|
33
|
+
return (0, _react2.css)(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["\n border-radius: ", ";\n background-color: ", ";\n box-shadow: 0 4px 8px -2px ", ", 0 0 1px ", ";\n padding: ", " 0px;\n"])), "var(--ds-border-radius, 3px)", "var(--ds-surface-overlay, ".concat(_colors.N0, ")"), _colors.N60A, _colors.N60A, "var(--ds-space-100, 8px)");
|
|
39
34
|
};
|
|
40
35
|
/* eslint-enable @atlaskit/design-system/ensure-design-token-usage */
|
|
41
36
|
|
|
@@ -165,13 +160,10 @@ var ColorPickerButton = function ColorPickerButton(props) {
|
|
|
165
160
|
};
|
|
166
161
|
var title = props.title || '';
|
|
167
162
|
var currentColor = props.currentColor && props.hexToPaletteColor ? props.hexToPaletteColor(props.currentColor) : props.currentColor;
|
|
168
|
-
var buttonStyle = function buttonStyle(
|
|
163
|
+
var buttonStyle = function buttonStyle() {
|
|
169
164
|
var _props$size, _props$size2, _props$size3;
|
|
170
|
-
return (0, _react2.css)(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2.default)(["\n padding: ", " 10px;\n background-color: ", ";\n ", "\n &:before {\n display: flex;\n justify-content: center;\n align-items: center;\n align-self: center;\n content: '';\n border: 1px solid ", ";\n border-radius: ", "
|
|
171
|
-
!!((_props$size = props.size) !== null && _props$size !== void 0 && _props$size.height) && "height: inherit;", _uiColor.DEFAULT_BORDER_COLOR, (
|
|
172
|
-
light: "var(--ds-background-neutral-subtle-hovered, ".concat(_colors.N30A, ")"),
|
|
173
|
-
dark: "var(--ds-background-neutral-subtle-hovered, ".concat(_colors.N30A, ")")
|
|
174
|
-
})(theme));
|
|
165
|
+
return (0, _react2.css)(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2.default)(["\n padding: ", " 10px;\n background-color: ", ";\n ", "\n &:before {\n display: flex;\n justify-content: center;\n align-items: center;\n align-self: center;\n content: '';\n border: 1px solid ", ";\n border-radius: ", ";\n background-color: ", ";\n width: ", ";\n height: ", ";\n padding: 0;\n margin: 0px ", ";\n }\n &:hover {\n background: ", ";\n }\n "])), "var(--ds-space-075, 6px)", "var(--ds-background-neutral-subtle, transparent)", /* If custom props size height, override the button base height property */
|
|
166
|
+
!!((_props$size = props.size) !== null && _props$size !== void 0 && _props$size.height) && "height: inherit;", _uiColor.DEFAULT_BORDER_COLOR, "var(--ds-border-radius, 3px)", currentColor || 'transparent', ((_props$size2 = props.size) === null || _props$size2 === void 0 ? void 0 : _props$size2.width) || '14px', ((_props$size3 = props.size) === null || _props$size3 === void 0 ? void 0 : _props$size3.height) || '14px', "var(--ds-space-025, 2px)", "var(--ds-background-neutral-subtle-hovered, ".concat(_colors.N30A, ")"));
|
|
175
167
|
};
|
|
176
168
|
return (0, _react2.jsx)("div", {
|
|
177
169
|
css: colorPickerButtonWrapper
|
|
@@ -24,7 +24,6 @@ var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
|
|
|
24
24
|
var _menu = require("@atlaskit/menu");
|
|
25
25
|
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
26
26
|
var _colors = require("@atlaskit/theme/colors");
|
|
27
|
-
var _components = require("@atlaskit/theme/components");
|
|
28
27
|
var _tooltip = _interopRequireDefault(require("@atlaskit/tooltip"));
|
|
29
28
|
var _styles = require("../../styles");
|
|
30
29
|
var _ToolbarArrowKeyNavigationProvider = require("../../ui-menu/ToolbarArrowKeyNavigationProvider");
|
|
@@ -45,28 +44,14 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re
|
|
|
45
44
|
var wrapper = (0, _react2.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n /* tooltip in ToolbarButton is display:block */\n & > div > div {\n display: flex;\n }\n"])));
|
|
46
45
|
var focusedMenuItemStyle = (0, _react2.css)(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n box-shadow: inset 0px 0px 0px 2px ", ";\n outline: none;\n"])), "var(--ds-border-focused, ".concat(_colors.B100, ")"));
|
|
47
46
|
var buttonStyles = function buttonStyles(isActive, submenuActive) {
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
light: "var(--ds-text, ".concat(_colors.N900, ")"),
|
|
57
|
-
dark: "var(--ds-text, ".concat(_colors.DN600, ")")
|
|
58
|
-
})(theme), (0, _components.themed)({
|
|
59
|
-
light: "var(--ds-background-neutral-subtle-hovered, rgb(244, 245, 247))",
|
|
60
|
-
dark: "var(--ds-background-neutral-subtle-hovered, rgb(59, 71, 92))"
|
|
61
|
-
})(theme), !submenuActive && "\n > span:active[aria-disabled='false'] {\n background-color: ".concat((0, _components.themed)({
|
|
62
|
-
light: "var(--ds-background-neutral-subtle-pressed, rgb(179, 212, 255))",
|
|
63
|
-
dark: "var(--ds-background-neutral-subtle-pressed, rgb(179, 212, 255))"
|
|
64
|
-
})(theme), ";\n }"), (0, _components.themed)({
|
|
65
|
-
light: "var(--ds-text-disabled, ".concat(_colors.N70, ")"),
|
|
66
|
-
dark: "var(--ds-text-disabled, ".concat(_colors.DN80, ")")
|
|
67
|
-
})(theme), focusedMenuItemStyle); // The default focus-visible style is removed to ensure consistency across browsers
|
|
68
|
-
}
|
|
69
|
-
};
|
|
47
|
+
if (isActive) {
|
|
48
|
+
/**
|
|
49
|
+
* Hack for item to imitate old dropdown-menu selected styles
|
|
50
|
+
*/
|
|
51
|
+
return (0, _react2.css)(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["\n > span,\n > span:hover,\n > span:active {\n background: ", ";\n color: ", ";\n }\n :focus > span[aria-disabled='false'] {\n ", ";\n }\n :focus-visible,\n :focus-visible > span[aria-disabled='false'] {\n outline: none;\n }\n "])), "var(--ds-background-selected, #6c798f)", "var(--ds-text, #fff)", focusedMenuItemStyle);
|
|
52
|
+
} else {
|
|
53
|
+
return (0, _react2.css)(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2.default)(["\n > span:hover[aria-disabled='false'] {\n color: ", ";\n background-color: ", ";\n }\n ", "\n > span[aria-disabled='true'] {\n color: ", ";\n }\n :focus > span[aria-disabled='false'] {\n ", ";\n }\n :focus-visible,\n :focus-visible > span[aria-disabled='false'] {\n outline: none;\n }\n "])), "var(--ds-text, ".concat(_colors.N900, ")"), "var(--ds-background-neutral-subtle-hovered, rgb(244, 245, 247))", !submenuActive && "\n > span:active[aria-disabled='false'] {\n background-color: ".concat("var(--ds-background-neutral-subtle-pressed, rgb(179, 212, 255))", ";\n }"), "var(--ds-text-disabled, ".concat(_colors.N70, ")"), focusedMenuItemStyle); // The default focus-visible style is removed to ensure consistency across browsers
|
|
54
|
+
}
|
|
70
55
|
};
|
|
71
56
|
|
|
72
57
|
var DropListWithOutsideListeners = (0, _uiReact.withReactEditorViewOuterListeners)(_DropList.default);
|
|
@@ -299,10 +284,8 @@ function DropdownMenuItem(_ref) {
|
|
|
299
284
|
setSubmenuActive(!!event.target.closest(".".concat(_styles.DropdownMenuSharedCssClassName.SUBMENU)));
|
|
300
285
|
};
|
|
301
286
|
var dropListItem = (0, _react2.jsx)("div", {
|
|
302
|
-
css: function css(
|
|
303
|
-
return buttonStyles(item.isActive, submenuActive)
|
|
304
|
-
theme: theme
|
|
305
|
-
});
|
|
287
|
+
css: function css() {
|
|
288
|
+
return buttonStyles(item.isActive, submenuActive);
|
|
306
289
|
},
|
|
307
290
|
tabIndex: -1,
|
|
308
291
|
"aria-disabled": item.isDisabled ? 'true' : 'false',
|
|
@@ -1,3 +1,22 @@
|
|
|
1
|
+
import { headingSizes } from '@atlaskit/theme/typography';
|
|
1
2
|
export const DEFAULT_IMAGE_WIDTH = 250;
|
|
2
3
|
export const DEFAULT_IMAGE_HEIGHT = 200;
|
|
3
|
-
export const DEFAULT_INLINE_IMAGE_ASPECT_RATIO = DEFAULT_IMAGE_WIDTH / DEFAULT_IMAGE_HEIGHT;
|
|
4
|
+
export const DEFAULT_INLINE_IMAGE_ASPECT_RATIO = DEFAULT_IMAGE_WIDTH / DEFAULT_IMAGE_HEIGHT;
|
|
5
|
+
/**
|
|
6
|
+
* Reference Heights
|
|
7
|
+
*
|
|
8
|
+
* These heights enforce consistent sizes with media inline nodes due to
|
|
9
|
+
* inconsistencies with center aligned inline nodes and text.
|
|
10
|
+
*
|
|
11
|
+
* There is conversation about refactoring media inline nodes to conform to
|
|
12
|
+
* aligning correctly with the surrounding text.
|
|
13
|
+
*/
|
|
14
|
+
export const referenceHeights = {
|
|
15
|
+
p: headingSizes.h600.lineHeight - 2,
|
|
16
|
+
h1: headingSizes.h800.lineHeight + 4,
|
|
17
|
+
h2: headingSizes.h700.lineHeight + 3,
|
|
18
|
+
h3: headingSizes.h600.lineHeight + 1,
|
|
19
|
+
h4: headingSizes.h500.lineHeight + 3,
|
|
20
|
+
h5: headingSizes.h400.lineHeight + 4,
|
|
21
|
+
h6: headingSizes.h300.lineHeight + 2
|
|
22
|
+
};
|
|
@@ -3,8 +3,10 @@
|
|
|
3
3
|
import { css, jsx } from '@emotion/react';
|
|
4
4
|
import { B300 } from '@atlaskit/theme/colors';
|
|
5
5
|
const wrapperStyle = css({
|
|
6
|
-
display: 'inline-
|
|
7
|
-
|
|
6
|
+
display: 'inline-flex',
|
|
7
|
+
justifyContent: 'center',
|
|
8
|
+
alignItems: 'center',
|
|
9
|
+
verticalAlign: 'middle',
|
|
8
10
|
overflow: 'hidden',
|
|
9
11
|
borderRadius: `${"var(--ds-border-radius, 3px)"}`,
|
|
10
12
|
aspectRatio: `var(${INLINE_IMAGE_ASPECT_RATIO_CSS_VAR_KEY}, ${DEFAULT_INLINE_IMAGE_ASPECT_RATIO})`
|
|
@@ -4,8 +4,8 @@ import { useEffect, useMemo, useState } from 'react';
|
|
|
4
4
|
import { jsx } from '@emotion/react';
|
|
5
5
|
import { createIntl, injectIntl } from 'react-intl-next';
|
|
6
6
|
import { Card } from '@atlaskit/media-card';
|
|
7
|
-
import { headingSizes } from '@atlaskit/theme/typography';
|
|
8
7
|
import { messages } from '../messages/media-inline-card';
|
|
8
|
+
import { referenceHeights } from './constants';
|
|
9
9
|
import { InlineImageWrapper } from './inline-image-wrapper';
|
|
10
10
|
import { InlineImageCardErrorView } from './views/error-view';
|
|
11
11
|
import { InlineImageCardLoadingView } from './views/loading-view';
|
|
@@ -95,8 +95,8 @@ export const MediaInlineImageCardInternal = ({
|
|
|
95
95
|
};
|
|
96
96
|
}
|
|
97
97
|
return {
|
|
98
|
-
width: Math.round(aspectRatio *
|
|
99
|
-
height:
|
|
98
|
+
width: Math.round(aspectRatio * referenceHeights['h1']),
|
|
99
|
+
height: referenceHeights['h1']
|
|
100
100
|
};
|
|
101
101
|
}, [width, height, aspectRatio]);
|
|
102
102
|
return jsx(InlineImageWrapper, {
|
|
@@ -1,35 +1,50 @@
|
|
|
1
1
|
import { css } from '@emotion/react';
|
|
2
|
-
import {
|
|
2
|
+
import { referenceHeights } from './constants';
|
|
3
3
|
export const INLINE_IMAGE_WRAPPER_CLASS_NAME = 'media-inline-image-wrapper';
|
|
4
4
|
export const INLINE_IMAGE_ASPECT_RATIO_CSS_VAR_KEY = '--editor-media-inline-image-aspect-ratio';
|
|
5
|
-
const inlineImageHeight = height => css`
|
|
5
|
+
const inlineImageHeight = (height, margin = 0) => css`
|
|
6
6
|
> .${INLINE_IMAGE_WRAPPER_CLASS_NAME},
|
|
7
7
|
> .mediaInlineView-content-wrap
|
|
8
8
|
> .${INLINE_IMAGE_WRAPPER_CLASS_NAME} {
|
|
9
9
|
height: ${height}px;
|
|
10
|
+
transform: translateY(${margin}px);
|
|
10
11
|
}
|
|
11
12
|
`;
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Shifting the mediaInline image component (renders image) to align nicely with
|
|
16
|
+
* mediaInline (renders text) is a bit of a testing ground. This numbers represent
|
|
17
|
+
* shift in top and bottom and size adjustments to make up for lack of 1to1 size
|
|
18
|
+
* mapping
|
|
19
|
+
*/
|
|
12
20
|
export const mediaInlineImageStyles = css`
|
|
13
|
-
// default inline image height is 24px, this includes
|
|
14
21
|
// p, h3, and action items
|
|
15
22
|
.${INLINE_IMAGE_WRAPPER_CLASS_NAME} {
|
|
16
|
-
height: ${
|
|
23
|
+
height: ${referenceHeights['p']}px;
|
|
24
|
+
transform: translateY(-2px);
|
|
17
25
|
}
|
|
18
26
|
|
|
19
27
|
h1 {
|
|
20
|
-
${inlineImageHeight(
|
|
28
|
+
${inlineImageHeight(referenceHeights['h1'], -3)}
|
|
21
29
|
}
|
|
22
30
|
|
|
23
31
|
h2 {
|
|
24
|
-
${inlineImageHeight(
|
|
32
|
+
${inlineImageHeight(referenceHeights['h2'], -3)}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
h3 {
|
|
36
|
+
${inlineImageHeight(referenceHeights['h3'], -2)}
|
|
25
37
|
}
|
|
26
38
|
|
|
27
39
|
h4 {
|
|
28
|
-
${inlineImageHeight(
|
|
40
|
+
${inlineImageHeight(referenceHeights['h4'], -2)}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
h5 {
|
|
44
|
+
${inlineImageHeight(referenceHeights['h5'], -2)}
|
|
29
45
|
}
|
|
30
46
|
|
|
31
|
-
h5,
|
|
32
47
|
h6 {
|
|
33
|
-
${inlineImageHeight(
|
|
48
|
+
${inlineImageHeight(referenceHeights['h6'], -2)}
|
|
34
49
|
}
|
|
35
50
|
`;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
const SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
|
|
2
2
|
const packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
|
|
3
|
-
const packageVersion = "76.27.
|
|
3
|
+
const packageVersion = "76.27.10";
|
|
4
4
|
const sanitiseSentryEvents = (data, _hint) => {
|
|
5
5
|
// Remove URL as it has UGC
|
|
6
6
|
// TODO: Sanitise the URL instead of just removing it
|
|
@@ -4,6 +4,7 @@ import React from 'react';
|
|
|
4
4
|
import { jsx } from '@emotion/react';
|
|
5
5
|
import { ACTION_SUBJECT, ACTION_SUBJECT_ID } from '../analytics';
|
|
6
6
|
import { ErrorBoundary } from '../ui/ErrorBoundary';
|
|
7
|
+
import { browser } from '../utils';
|
|
7
8
|
import { analyticsEventKey, getPerformanceOptions, startMeasureReactNodeViewRendered, stopMeasureReactNodeViewRendered, ZERO_WIDTH_SPACE } from '../utils';
|
|
8
9
|
export const inlineNodeViewClassname = 'inlineNodeView';
|
|
9
10
|
function createNodeView({
|
|
@@ -174,7 +175,12 @@ function getPortalChildren({
|
|
|
174
175
|
,
|
|
175
176
|
getPos: nodeViewParams.getPos,
|
|
176
177
|
node: currentNode
|
|
177
|
-
}, extraComponentProps)), jsx("span", {
|
|
178
|
+
}, extraComponentProps)), browser.android ? jsx("span", {
|
|
179
|
+
className: `zeroWidthSpaceContainer`,
|
|
180
|
+
contentEditable: "false"
|
|
181
|
+
}, jsx("span", {
|
|
182
|
+
className: `${inlineNodeViewClassname}AddZeroWidthSpace`
|
|
183
|
+
}), ZERO_WIDTH_SPACE) : jsx("span", {
|
|
178
184
|
className: `${inlineNodeViewClassname}AddZeroWidthSpace`
|
|
179
185
|
}));
|
|
180
186
|
};
|
|
@@ -1,62 +1,43 @@
|
|
|
1
1
|
import { css } from '@emotion/react';
|
|
2
2
|
import { N60A, Y300, Y75 } from '@atlaskit/theme/colors';
|
|
3
|
-
import { themed } from '@atlaskit/theme/components';
|
|
4
3
|
export const annotationPrefix = 'ak-editor-annotation';
|
|
5
4
|
export const AnnotationSharedClassNames = {
|
|
6
5
|
focus: `${annotationPrefix}-focus`,
|
|
7
6
|
blur: `${annotationPrefix}-blur`,
|
|
8
7
|
draft: `${annotationPrefix}-draft`
|
|
9
8
|
};
|
|
10
|
-
const DY75 = 'rgb(111, 92, 37)';
|
|
11
|
-
const DY300 = '#ffd557';
|
|
12
9
|
const Y75a = 'rgba(255, 240, 179, 0.5)';
|
|
13
10
|
const Y200a = 'rgba(255, 196, 0, 0.82)';
|
|
14
|
-
const
|
|
15
|
-
const DY200 = '#82641c';
|
|
16
|
-
export const AnnotationSharedCSSByState = props => ({
|
|
11
|
+
export const AnnotationSharedCSSByState = () => ({
|
|
17
12
|
focus: css`
|
|
18
13
|
// Background is not coming through in confluence, suspecting to be caused by some specific combination of
|
|
19
14
|
// emotion and token look up
|
|
20
15
|
|
|
21
|
-
background: ${
|
|
22
|
-
|
|
23
|
-
dark: `var(--ds-background-accent-yellow-subtler, ${DY75})`
|
|
24
|
-
})(props)};
|
|
25
|
-
border-bottom: 2px solid
|
|
26
|
-
${themed({
|
|
27
|
-
light: `var(--ds-border-accent-yellow, ${Y300})`,
|
|
28
|
-
dark: `var(--ds-border-accent-yellow, ${DY300})`
|
|
29
|
-
})(props)};
|
|
16
|
+
background: ${`var(--ds-background-accent-yellow-subtler, ${Y75})`};
|
|
17
|
+
border-bottom: 2px solid ${`var(--ds-border-accent-yellow, ${Y300})`};
|
|
30
18
|
// TODO: https://product-fabric.atlassian.net/browse/DSP-4147
|
|
31
19
|
box-shadow: ${`var(--ds-shadow-overlay, ${`1px 2px 3px ${N60A}, -1px 2px 3px ${N60A}`})`};
|
|
32
20
|
cursor: pointer;
|
|
33
21
|
`,
|
|
34
22
|
blur: css`
|
|
35
|
-
background: ${
|
|
36
|
-
|
|
37
|
-
dark: `var(--ds-background-accent-yellow-subtlest, ${DY75a})`
|
|
38
|
-
})(props)};
|
|
39
|
-
border-bottom: 2px solid
|
|
40
|
-
${themed({
|
|
41
|
-
light: `var(--ds-border-accent-yellow, ${Y200a})`,
|
|
42
|
-
dark: `var(--ds-border-accent-yellow, ${DY200})`
|
|
43
|
-
})(props)};
|
|
23
|
+
background: ${`var(--ds-background-accent-yellow-subtlest, ${Y75a})`};
|
|
24
|
+
border-bottom: 2px solid ${`var(--ds-border-accent-yellow, ${Y200a})`};
|
|
44
25
|
cursor: pointer;
|
|
45
26
|
`
|
|
46
27
|
});
|
|
47
|
-
export const annotationSharedStyles =
|
|
28
|
+
export const annotationSharedStyles = () => css`
|
|
48
29
|
.ProseMirror {
|
|
49
30
|
.${AnnotationSharedClassNames.focus} {
|
|
50
|
-
${AnnotationSharedCSSByState(
|
|
31
|
+
${AnnotationSharedCSSByState().focus};
|
|
51
32
|
}
|
|
52
33
|
|
|
53
34
|
.${AnnotationSharedClassNames.draft} {
|
|
54
|
-
${AnnotationSharedCSSByState(
|
|
35
|
+
${AnnotationSharedCSSByState().focus};
|
|
55
36
|
cursor: initial;
|
|
56
37
|
}
|
|
57
38
|
|
|
58
39
|
.${AnnotationSharedClassNames.blur} {
|
|
59
|
-
${AnnotationSharedCSSByState(
|
|
40
|
+
${AnnotationSharedCSSByState().blur};
|
|
60
41
|
}
|
|
61
42
|
}
|
|
62
43
|
`;
|