@atlaskit/editor-common 76.27.9 → 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 +8 -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/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/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/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
|
@@ -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
|
|
@@ -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
|
`;
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { css } from '@emotion/react';
|
|
2
2
|
import { akEditorCodeFontFamily, akEditorLineHeight, akEditorTableCellMinWidth, blockNodesVerticalMargin, overflowShadow, relativeFontSizeToBase16 } from '@atlaskit/editor-shared-styles';
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { borderRadius, fontSize } from '@atlaskit/theme/constants';
|
|
3
|
+
import { N20, N30, N400, N800 } from '@atlaskit/theme/colors';
|
|
4
|
+
import { fontSize } from '@atlaskit/theme/constants';
|
|
6
5
|
export const CodeBlockSharedCssClassName = {
|
|
7
6
|
CODEBLOCK_CONTAINER: 'code-block',
|
|
8
7
|
CODEBLOCK_START: 'code-block--start',
|
|
@@ -12,11 +11,11 @@ export const CodeBlockSharedCssClassName = {
|
|
|
12
11
|
CODEBLOCK_CONTENT: 'code-content',
|
|
13
12
|
DS_CODEBLOCK: '[data-ds--code--code-block]'
|
|
14
13
|
};
|
|
15
|
-
export const codeBlockSharedStyles =
|
|
14
|
+
export const codeBlockSharedStyles = () => css`
|
|
16
15
|
.${CodeBlockSharedCssClassName.CODEBLOCK_CONTAINER} {
|
|
17
16
|
position: relative;
|
|
18
17
|
background-color: ${"var(--ds-surface-raised, transparent)"};
|
|
19
|
-
border-radius: ${
|
|
18
|
+
border-radius: ${"var(--ds-border-radius, 3px)"};
|
|
20
19
|
margin: ${blockNodesVerticalMargin} 0 0 0;
|
|
21
20
|
font-family: ${akEditorCodeFontFamily};
|
|
22
21
|
min-width: ${akEditorTableCellMinWidth}px;
|
|
@@ -44,21 +43,15 @@ export const codeBlockSharedStyles = props => css`
|
|
|
44
43
|
}
|
|
45
44
|
|
|
46
45
|
.${CodeBlockSharedCssClassName.CODEBLOCK_CONTENT_WRAPPER} {
|
|
47
|
-
background-color: ${
|
|
48
|
-
light: `var(--ds-background-neutral, ${N20})`,
|
|
49
|
-
dark: `var(--ds-background-neutral, ${DN50})`
|
|
50
|
-
})(props)};
|
|
46
|
+
background-color: ${`var(--ds-background-neutral, ${N20})`};
|
|
51
47
|
display: flex;
|
|
52
|
-
border-radius: ${
|
|
48
|
+
border-radius: ${"var(--ds-border-radius, 3px)"};
|
|
53
49
|
width: 100%;
|
|
54
50
|
counter-reset: line;
|
|
55
51
|
overflow-x: auto;
|
|
56
52
|
|
|
57
53
|
background-image: ${overflowShadow({
|
|
58
|
-
background:
|
|
59
|
-
light: `var(--ds-background-neutral, ${N20})`,
|
|
60
|
-
dark: `var(--ds-background-neutral, ${DN50})`
|
|
61
|
-
})(props),
|
|
54
|
+
background: `var(--ds-background-neutral, ${N20})`,
|
|
62
55
|
leftCoverWidth: "var(--ds-space-300, 24px)"
|
|
63
56
|
})};
|
|
64
57
|
|
|
@@ -78,10 +71,7 @@ export const codeBlockSharedStyles = props => css`
|
|
|
78
71
|
.${CodeBlockSharedCssClassName.CODEBLOCK_LINE_NUMBER_GUTTER} {
|
|
79
72
|
flex-shrink: 0;
|
|
80
73
|
text-align: right;
|
|
81
|
-
background-color: ${
|
|
82
|
-
light: `var(--ds-background-neutral, ${N30})`,
|
|
83
|
-
dark: `var(--ds-background-neutral, ${DN20})`
|
|
84
|
-
})(props)};
|
|
74
|
+
background-color: ${`var(--ds-background-neutral, ${N30})`};
|
|
85
75
|
padding: ${"var(--ds-space-100, 8px)"};
|
|
86
76
|
position: relative;
|
|
87
77
|
|
|
@@ -94,10 +84,7 @@ export const codeBlockSharedStyles = props => css`
|
|
|
94
84
|
display: inline-block;
|
|
95
85
|
content: counter(line);
|
|
96
86
|
counter-increment: line;
|
|
97
|
-
color: ${
|
|
98
|
-
light: `var(--ds-text-subtlest, ${N400})`,
|
|
99
|
-
dark: `var(--ds-text-subtlest, ${DN400})`
|
|
100
|
-
})(props)};
|
|
87
|
+
color: ${`var(--ds-text-subtlest, ${N400})`};
|
|
101
88
|
font-size: ${relativeFontSizeToBase16(fontSize())};
|
|
102
89
|
line-height: 1.5rem;
|
|
103
90
|
}
|
|
@@ -112,11 +99,8 @@ export const codeBlockSharedStyles = props => css`
|
|
|
112
99
|
flex-grow: 1;
|
|
113
100
|
tab-size: 4;
|
|
114
101
|
cursor: text;
|
|
115
|
-
color: ${
|
|
116
|
-
|
|
117
|
-
dark: `var(--ds-text, ${DN800})`
|
|
118
|
-
})(props)};
|
|
119
|
-
border-radius: ${borderRadius()}px;
|
|
102
|
+
color: ${`var(--ds-text, ${N800})`};
|
|
103
|
+
border-radius: ${"var(--ds-border-radius, 3px)"};
|
|
120
104
|
margin: ${"var(--ds-space-100, 8px)"};
|
|
121
105
|
white-space: pre;
|
|
122
106
|
font-size: ${relativeFontSizeToBase16(fontSize())};
|
|
@@ -1,14 +1,10 @@
|
|
|
1
1
|
import { css } from '@emotion/react';
|
|
2
2
|
import { getCodeStyles } from '@atlaskit/code/inline';
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
export const codeMarkSharedStyles = props => {
|
|
3
|
+
import { N30A } from '@atlaskit/theme/colors';
|
|
4
|
+
export const codeMarkSharedStyles = () => {
|
|
6
5
|
return css`
|
|
7
6
|
.code {
|
|
8
|
-
--ds--code--bg-color: ${
|
|
9
|
-
light: `var(--ds-background-neutral, ${N30A})`,
|
|
10
|
-
dark: `var(--ds-background-neutral, ${DN70})`
|
|
11
|
-
})(props)};
|
|
7
|
+
--ds--code--bg-color: ${`var(--ds-background-neutral, ${N30A})`};
|
|
12
8
|
${getCodeStyles()}
|
|
13
9
|
}
|
|
14
10
|
`;
|