@atlaskit/editor-plugin-media 1.20.3 → 1.20.5
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/.eslintrc.js +13 -13
- package/CHANGELOG.md +593 -582
- package/LICENSE.md +6 -8
- package/dist/cjs/nodeviews/mediaSingle.js +3 -1
- package/dist/cjs/nodeviews/styles.js +4 -1
- package/dist/cjs/toolbar/linking-toolbar-appearance.js +3 -1
- package/dist/cjs/ui/CaptionPlaceholder/index.js +1 -1
- package/dist/cjs/ui/ImageBorder/index.js +12 -4
- package/dist/cjs/ui/ImageBorder/styles.js +7 -7
- package/dist/cjs/ui/MediaLinkingToolbar.js +56 -53
- package/dist/cjs/ui/PixelEntry/styles.js +1 -1
- package/dist/cjs/ui/ResizableMediaSingle/ResizableMediaSingleNext.js +3 -1
- package/dist/cjs/ui/ResizableMediaSingle/styled.js +1 -1
- package/dist/es2019/nodeviews/mediaSingle.js +3 -1
- package/dist/es2019/nodeviews/styles.js +4 -1
- package/dist/es2019/toolbar/linking-toolbar-appearance.js +3 -1
- package/dist/es2019/ui/CaptionPlaceholder/index.js +5 -5
- package/dist/es2019/ui/ImageBorder/index.js +12 -4
- package/dist/es2019/ui/ImageBorder/styles.js +82 -82
- package/dist/es2019/ui/MediaLinkingToolbar.js +55 -52
- package/dist/es2019/ui/PixelEntry/styles.js +11 -11
- package/dist/es2019/ui/ResizableMediaSingle/ResizableMediaSingleNext.js +3 -1
- package/dist/es2019/ui/ResizableMediaSingle/styled.js +5 -5
- package/dist/esm/nodeviews/mediaSingle.js +3 -1
- package/dist/esm/nodeviews/styles.js +4 -1
- package/dist/esm/toolbar/linking-toolbar-appearance.js +3 -1
- package/dist/esm/ui/CaptionPlaceholder/index.js +1 -1
- package/dist/esm/ui/ImageBorder/index.js +12 -4
- package/dist/esm/ui/ImageBorder/styles.js +7 -7
- package/dist/esm/ui/MediaLinkingToolbar.js +56 -53
- package/dist/esm/ui/PixelEntry/styles.js +1 -1
- package/dist/esm/ui/ResizableMediaSingle/ResizableMediaSingleNext.js +3 -1
- package/dist/esm/ui/ResizableMediaSingle/styled.js +1 -1
- package/dist/types/nodeviews/mediaNodeView/index.d.ts +1 -1
- package/dist/types/pm-plugins/alt-text/index.d.ts +1 -1
- package/dist/types/toolbar/filePreviewItem.d.ts +1 -1
- package/dist/types/toolbar/layout-group.d.ts +1 -1
- package/dist/types/ui/MediaPicker/BrowserWrapper.d.ts +1 -1
- package/dist/types/ui/MediaPicker/ClipboardWrapper.d.ts +1 -1
- package/dist/types/ui/PixelEntry/index.d.ts +1 -1
- package/dist/types-ts4.5/nodeviews/mediaNodeView/index.d.ts +1 -1
- package/dist/types-ts4.5/pm-plugins/alt-text/index.d.ts +1 -1
- package/dist/types-ts4.5/toolbar/filePreviewItem.d.ts +1 -1
- package/dist/types-ts4.5/toolbar/layout-group.d.ts +1 -1
- package/dist/types-ts4.5/ui/MediaPicker/BrowserWrapper.d.ts +1 -1
- package/dist/types-ts4.5/ui/MediaPicker/ClipboardWrapper.d.ts +1 -1
- package/dist/types-ts4.5/ui/PixelEntry/index.d.ts +1 -1
- package/package.json +11 -13
- package/report.api.md +302 -316
package/LICENSE.md
CHANGED
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
Copyright 2023 Atlassian Pty Ltd
|
|
2
2
|
|
|
3
|
-
Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
-
|
|
5
|
-
You may obtain a copy of the License at
|
|
3
|
+
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in
|
|
4
|
+
compliance with the License. You may obtain a copy of the License at
|
|
6
5
|
|
|
7
6
|
http://www.apache.org/licenses/LICENSE-2.0
|
|
8
7
|
|
|
9
|
-
Unless required by applicable law or agreed to in writing, software
|
|
10
|
-
distributed
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
limitations under the License.
|
|
8
|
+
Unless required by applicable law or agreed to in writing, software distributed under the License is
|
|
9
|
+
distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
10
|
+
implied. See the License for the specific language governing permissions and limitations under the
|
|
11
|
+
License.
|
|
@@ -445,7 +445,9 @@ var MediaSingleNode = exports.default = /*#__PURE__*/function (_Component) {
|
|
|
445
445
|
var isCurrentNodeDrafting = (annotationPluginState === null || annotationPluginState === void 0 ? void 0 : annotationPluginState.isDrafting) && (annotationPluginState === null || annotationPluginState === void 0 ? void 0 : annotationPluginState.targetNodeId) === (node === null || node === void 0 || (_node$firstChild = node.firstChild) === null || _node$firstChild === void 0 ? void 0 : _node$firstChild.attrs.id);
|
|
446
446
|
var MediaChildren = (0, _react2.jsx)("figure", {
|
|
447
447
|
ref: this.mediaSingleWrapperRef,
|
|
448
|
-
css: figureWrapperStyles
|
|
448
|
+
css: figureWrapperStyles
|
|
449
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
450
|
+
,
|
|
449
451
|
className: _styles.MediaSingleNodeSelector,
|
|
450
452
|
onClick: this.onMediaSingleClicked
|
|
451
453
|
}, commentsOnMedia && (0, _react2.jsx)(_CommentBadge.CommentBadge, {
|
|
@@ -29,11 +29,14 @@ var MediaCardWrapper = exports.MediaCardWrapper = function MediaCardWrapper(_ref
|
|
|
29
29
|
onContextMenu = _ref.onContextMenu;
|
|
30
30
|
var calculatedBorderWidth = selected && borderWidth > 0 ? borderWidth + 1 : borderWidth;
|
|
31
31
|
return (0, _react2.jsx)("div", {
|
|
32
|
-
"data-testid": "media-card-wrapper"
|
|
32
|
+
"data-testid": "media-card-wrapper"
|
|
33
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
34
|
+
,
|
|
33
35
|
className: "media-card-wrapper",
|
|
34
36
|
style: {
|
|
35
37
|
borderColor: "var(--custom-palette-color)",
|
|
36
38
|
borderWidth: "".concat(calculatedBorderWidth, "px"),
|
|
39
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
37
40
|
borderStyle: 'solid',
|
|
38
41
|
borderRadius: "".concat(calculatedBorderWidth * 2, "px")
|
|
39
42
|
}
|
|
@@ -80,7 +80,9 @@ var LinkToolbarAppearance = exports.LinkToolbarAppearance = function LinkToolbar
|
|
|
80
80
|
title: linkTitle,
|
|
81
81
|
icon: (0, _react2.jsx)(_shortcut.default, {
|
|
82
82
|
label: linkTitle
|
|
83
|
-
})
|
|
83
|
+
})
|
|
84
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
85
|
+
,
|
|
84
86
|
className: "hyperlink-open-link"
|
|
85
87
|
}), (0, _react2.jsx)(_ui.FloatingToolbarSeparator, null));
|
|
86
88
|
} else {
|
|
@@ -15,7 +15,7 @@ var _colors = require("@atlaskit/theme/colors");
|
|
|
15
15
|
var _templateObject;
|
|
16
16
|
/** @jsx jsx */
|
|
17
17
|
// eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression -- needs manual remediation
|
|
18
|
-
var placeholder = (0, _react2.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n
|
|
18
|
+
var placeholder = (0, _react2.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n\tcolor: ", ";\n\twidth: 100%;\n\ttext-align: center;\n\tmargin-top: ", " !important;\n\tdisplay: block;\n"])), "var(--ds-text-subtlest, ".concat(_colors.N200, ")"), "var(--ds-space-100, 8px)");
|
|
19
19
|
var _default = exports.default = /*#__PURE__*/_react.default.forwardRef(function (_ref, ref) {
|
|
20
20
|
var onClick = _ref.onClick;
|
|
21
21
|
return (0, _react2.jsx)("span", {
|
|
@@ -65,7 +65,9 @@ var ImageBorder = function ImageBorder(_ref) {
|
|
|
65
65
|
value: {
|
|
66
66
|
name: 'color'
|
|
67
67
|
},
|
|
68
|
-
elemAfter:
|
|
68
|
+
elemAfter:
|
|
69
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
70
|
+
(0, _react2.jsx)("div", {
|
|
69
71
|
className: _styles.DropdownMenuSharedCssClassName.SUBMENU
|
|
70
72
|
}, (0, _react2.jsx)("div", {
|
|
71
73
|
css: (0, _styles2.contextualMenuColorIcon)(color && (0, _editorPalette.hexToEditorBorderPaletteColor)(color))
|
|
@@ -91,7 +93,9 @@ var ImageBorder = function ImageBorder(_ref) {
|
|
|
91
93
|
value: {
|
|
92
94
|
name: 'size'
|
|
93
95
|
},
|
|
94
|
-
elemAfter:
|
|
96
|
+
elemAfter:
|
|
97
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
98
|
+
(0, _react2.jsx)("div", {
|
|
95
99
|
className: _styles.DropdownMenuSharedCssClassName.SUBMENU
|
|
96
100
|
}, (0, _react2.jsx)("div", {
|
|
97
101
|
css: _styles2.contextualMenuArrow
|
|
@@ -140,7 +144,9 @@ var ImageBorder = function ImageBorder(_ref) {
|
|
|
140
144
|
enabled: enabled,
|
|
141
145
|
isOpen: isOpen
|
|
142
146
|
})
|
|
143
|
-
}, (0, _react2.jsx)(_uiMenu.ToolbarButton
|
|
147
|
+
}, (0, _react2.jsx)(_uiMenu.ToolbarButton
|
|
148
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
149
|
+
, {
|
|
144
150
|
className: "image-border-toolbar-btn",
|
|
145
151
|
selected: enabled,
|
|
146
152
|
onClick: toggleBorder,
|
|
@@ -152,7 +158,9 @@ var ImageBorder = function ImageBorder(_ref) {
|
|
|
152
158
|
title: enabled ? formatMessage(_media.imageBorderMessages.removeBorder) : formatMessage(_media.imageBorderMessages.addBorder)
|
|
153
159
|
}), (0, _react2.jsx)("div", {
|
|
154
160
|
ref: popupTarget
|
|
155
|
-
}, (0, _react2.jsx)(_uiMenu.ToolbarButton
|
|
161
|
+
}, (0, _react2.jsx)(_uiMenu.ToolbarButton
|
|
162
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
163
|
+
, {
|
|
156
164
|
className: "image-border-toolbar-dropdown",
|
|
157
165
|
selected: enabled || isOpen,
|
|
158
166
|
"aria-label": formatMessage(_media.imageBorderMessages.borderOptions),
|
|
@@ -28,21 +28,21 @@ var menuItemDimensions = exports.menuItemDimensions = {
|
|
|
28
28
|
// TODO: Migrate away from gridSize
|
|
29
29
|
// Recommendation: Replace directly with 4 due to itemSpacing being used in calculations
|
|
30
30
|
var itemSpacing = exports.itemSpacing = (0, _constants.gridSize)() / 2;
|
|
31
|
-
var contextualMenuArrow = exports.contextualMenuArrow = (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n
|
|
31
|
+
var contextualMenuArrow = exports.contextualMenuArrow = (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n\tdisplay: flex;\n\t&::after {\n\t\tcontent: '\u203A';\n\t\tmargin-left: ", ";\n\t\tline-height: 20px;\n\t\tcolor: ", ";\n\t}\n"])), "var(--ds-space-050, 4px)", "var(--ds-icon, ".concat(_colors.N90, ")"));
|
|
32
32
|
var contextualMenuColorIcon = exports.contextualMenuColorIcon = function contextualMenuColorIcon(color) {
|
|
33
|
-
return (0, _react.css)(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n
|
|
33
|
+
return (0, _react.css)(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n\t", "\n\t&::before {\n\t\tcontent: '';\n\t\tdisplay: block;\n\t\tborder: 1px solid ", ";\n\t\tborder-radius: ", ";\n\t\twidth: 20px;\n\t\theight: 20px;\n\t\t", "\n\t}\n"])), contextualMenuArrow, _uiColor.DEFAULT_BORDER_COLOR, "var(--ds-border-radius-100, 3px)", color && "background: ".concat(color));
|
|
34
34
|
};
|
|
35
35
|
var contextualSubMenu = exports.contextualSubMenu = function contextualSubMenu(index) {
|
|
36
|
-
return (0, _react.css)(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["\n
|
|
36
|
+
return (0, _react.css)(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["\n\tborder-radius: ", ";\n\tbackground: ", ";\n\tbox-shadow: ", ";\n\tdisplay: flex;\n\tposition: absolute;\n\ttop: ", "px;\n\tleft: ", "px;\n\tpadding: ", ";\n\n\t> div {\n\t\tpadding: 0;\n\t}\n"])), "var(--ds-border-radius-100, 3px)", "var(--ds-surface-overlay, white)", "var(--ds-shadow-overlay, ".concat("0 4px 8px -2px ".concat(_colors.N60A, ", 0 0 1px ").concat(_colors.N60A), ")"), index * (menuItemDimensions.height + itemSpacing * 2), menuItemDimensions.width, "var(--ds-space-100, 8px)");
|
|
37
37
|
};
|
|
38
38
|
var buttonStyle = exports.buttonStyle = function buttonStyle(selected) {
|
|
39
|
-
return (0, _react.css)(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2.default)(["\n
|
|
39
|
+
return (0, _react.css)(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2.default)(["\n\theight: 26px;\n\twidth: 26px;\n\tpadding: 0;\n\tborder-radius: 4px;\n\tbackground-color: ", ";\n\tborder: 1px solid ", ";\n\tcursor: pointer;\n\tdisplay: block;\n"])), selected ? "var(--ds-text, ".concat(_colors.N800, ")") : "var(--ds-background-neutral, ".concat(_colors.N20A, ")"), _uiColor.DEFAULT_BORDER_COLOR);
|
|
40
40
|
};
|
|
41
41
|
|
|
42
42
|
/* eslint-disable @atlaskit/design-system/ensure-design-token-usage */
|
|
43
|
-
var buttonWrapperStyle = exports.buttonWrapperStyle = (0, _react.css)(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2.default)(["\n
|
|
43
|
+
var buttonWrapperStyle = exports.buttonWrapperStyle = (0, _react.css)(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2.default)(["\n\tborder: 1px solid transparent;\n\tmargin: ", ";\n\tfont-size: 0;\n\tdisplay: flex;\n\talign-items: center;\n\tpadding: ", ";\n\tborder-radius: 6px;\n\t&:focus-within,\n\t&:focus,\n\t&:hover {\n\t\tborder-color: ", " !important;\n\t}\n"])), "var(--ds-space-025, 2px)", "var(--ds-space-025, 2px)", _colors.N50);
|
|
44
44
|
var line = exports.line = function line(size, selected) {
|
|
45
|
-
return (0, _react.css)(_templateObject6 || (_templateObject6 = (0, _taggedTemplateLiteral2.default)(["\n
|
|
45
|
+
return (0, _react.css)(_templateObject6 || (_templateObject6 = (0, _taggedTemplateLiteral2.default)(["\n\tposition: relative;\n\t&:before {\n\t\tcontent: '';\n\t\tdisplay: block;\n\t\tposition: absolute;\n\t\ttop: 50%;\n\t\tleft: 50%;\n\t\twidth: 12px;\n\t\theight: ", "px;\n\t\tbackground-color: ", ";\n\t\tborder-radius: 90px;\n\t\ttransform: translate(-50%, -50%) rotate(135deg);\n\t}\n"])), size, selected ? "var(--ds-icon-inverse, ".concat(_colors.N0, ")") : "var(--ds-icon, #44546F)");
|
|
46
46
|
};
|
|
47
47
|
var getHoverStyles = function getHoverStyles(selector) {
|
|
48
48
|
return "&:hover ".concat(selector, " {\n background: ", "var(--ds-background-neutral-subtle-hovered, ".concat(colors.N20A, ")"), ";\n\n &:hover {\n background: ", "var(--ds-background-neutral-hovered, ".concat(colors.N30A, ")"), ";\n }\n }");
|
|
@@ -50,5 +50,5 @@ var getHoverStyles = function getHoverStyles(selector) {
|
|
|
50
50
|
var toolbarButtonWrapper = exports.toolbarButtonWrapper = function toolbarButtonWrapper(_ref) {
|
|
51
51
|
var enabled = _ref.enabled,
|
|
52
52
|
isOpen = _ref.isOpen;
|
|
53
|
-
return (0, _react.css)(_templateObject7 || (_templateObject7 = (0, _taggedTemplateLiteral2.default)(["\n
|
|
53
|
+
return (0, _react.css)(_templateObject7 || (_templateObject7 = (0, _taggedTemplateLiteral2.default)(["\n\tdisplay: flex;\n\t.image-border-toolbar-btn {\n\t\tborder-top-right-radius: 0;\n\t\tborder-bottom-right-radius: 0;\n\t\tpadding: 0;\n\t\t& > span {\n\t\t\tmargin: 0;\n\t\t}\n\t}\n\t.image-border-toolbar-dropdown {\n\t\tpadding: 0;\n\t\t& > span {\n\t\t\tmargin: 0;\n\t\t}\n\t\twidth: 16px !important;\n\t\tborder-top-left-radius: 0 !important;\n\t\tborder-bottom-left-radius: 0 !important;\n\t\tmargin-left: ", ";\n\t}\n\n\t", "\n\t", "\n"])), "var(--ds-space-025, 2px)", !enabled && getHoverStyles('.image-border-toolbar-btn'), !isOpen && !enabled && getHoverStyles('.image-border-toolbar-dropdown'));
|
|
54
54
|
};
|
|
@@ -109,60 +109,63 @@ var LinkAddToolbar = exports.LinkAddToolbar = /*#__PURE__*/function (_React$Pure
|
|
|
109
109
|
key: index
|
|
110
110
|
}, error);
|
|
111
111
|
});
|
|
112
|
-
return (
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
inputId: "media-link-search-input",
|
|
133
|
-
testId: "media-link-input",
|
|
134
|
-
placeholder: getPlaceholder(!!activityProvider),
|
|
135
|
-
autoFocus: true,
|
|
136
|
-
onCancel: _this.handleCancel,
|
|
137
|
-
defaultValue: value,
|
|
138
|
-
onSubmit: function onSubmit(inputValue) {
|
|
139
|
-
var validationErrors = _this.getValidationErrors(inputValue, currentInputMethod);
|
|
140
|
-
_this.setState({
|
|
141
|
-
validationErrors: validationErrors
|
|
142
|
-
});
|
|
143
|
-
if (!validationErrors.length) {
|
|
144
|
-
_onSubmit();
|
|
112
|
+
return (
|
|
113
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
114
|
+
(0, _react2.jsx)("div", {
|
|
115
|
+
className: "recent-list"
|
|
116
|
+
}, (0, _react2.jsx)("div", {
|
|
117
|
+
css: [_link.container, !!activityProvider && _link.containerWithProvider]
|
|
118
|
+
}, (0, _react2.jsx)("div", {
|
|
119
|
+
css: _link.inputWrapper
|
|
120
|
+
}, (0, _react2.jsx)("span", {
|
|
121
|
+
css: buttonWrapper
|
|
122
|
+
}, (0, _react2.jsx)(_ui.FloatingToolbarButton, {
|
|
123
|
+
title: formatLinkAddressText,
|
|
124
|
+
icon: (0, _react2.jsx)(_chevronLeftLarge.default, {
|
|
125
|
+
label: formatLinkAddressText
|
|
126
|
+
}),
|
|
127
|
+
onClick: function onClick() {
|
|
128
|
+
return _this.handleOnBack({
|
|
129
|
+
url: value,
|
|
130
|
+
inputMethod: currentInputMethod
|
|
131
|
+
});
|
|
145
132
|
}
|
|
146
|
-
},
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
133
|
+
})), (0, _react2.jsx)(_ui.PanelTextInput, {
|
|
134
|
+
inputId: "media-link-search-input",
|
|
135
|
+
testId: "media-link-input",
|
|
136
|
+
placeholder: getPlaceholder(!!activityProvider),
|
|
137
|
+
autoFocus: true,
|
|
138
|
+
onCancel: _this.handleCancel,
|
|
139
|
+
defaultValue: value,
|
|
140
|
+
onSubmit: function onSubmit(inputValue) {
|
|
141
|
+
var validationErrors = _this.getValidationErrors(inputValue, currentInputMethod);
|
|
142
|
+
_this.setState({
|
|
143
|
+
validationErrors: validationErrors
|
|
144
|
+
});
|
|
145
|
+
if (!validationErrors.length) {
|
|
146
|
+
_onSubmit();
|
|
147
|
+
}
|
|
148
|
+
},
|
|
149
|
+
onChange: function onChange(value) {
|
|
150
|
+
_this.setState({
|
|
151
|
+
validationErrors: []
|
|
152
|
+
});
|
|
153
|
+
_onChange(value);
|
|
154
|
+
},
|
|
155
|
+
onKeyDown: onKeyDown
|
|
156
|
+
}), (0, _react2.jsx)("label", {
|
|
157
|
+
className: "assistive",
|
|
158
|
+
htmlFor: "media-link-search-input"
|
|
159
|
+
}, formatMessage(_messages.linkToolbarMessages.searchInput)), (0, _utils.normalizeUrl)(displayUrl) && (0, _react2.jsx)(_react.Fragment, null, (0, _react2.jsx)(_ui.FloatingToolbarSeparator, null), (0, _react2.jsx)(_ui.FloatingToolbarButton, {
|
|
160
|
+
title: formatUnlinkText,
|
|
161
|
+
icon: (0, _react2.jsx)(_unlink.default, {
|
|
162
|
+
label: formatUnlinkText
|
|
163
|
+
}),
|
|
164
|
+
onClick: _this.handleUnlink
|
|
165
|
+
}))), !!errorsList.length && (0, _react2.jsx)("section", {
|
|
166
|
+
css: validationWrapper
|
|
167
|
+
}, errorsList), renderRecentList()))
|
|
168
|
+
);
|
|
166
169
|
});
|
|
167
170
|
return _this;
|
|
168
171
|
}
|
|
@@ -11,7 +11,7 @@ var _templateObject;
|
|
|
11
11
|
var PIXEL_SIZING_WRAPPER_MINIMUM_WIDTH = 120;
|
|
12
12
|
|
|
13
13
|
// eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression -- needs manual remediation
|
|
14
|
-
var pixelSizingWrapper = exports.pixelSizingWrapper = (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n
|
|
14
|
+
var pixelSizingWrapper = exports.pixelSizingWrapper = (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n\tdisplay: grid;\n\tgrid-template-columns: 1fr 1em 1fr 0;\n\tgrid-template-rows: auto;\n\tgrid-template-areas: 'widthinput label heightinput submit';\n\twidth: ", "px;\n\ttext-align: center;\n\theight: ", ";\n\n\t// Atlaskit fieldset does not allow style override\n\t& > * {\n\t\tmargin-top: 0 !important;\n\t}\n"])), PIXEL_SIZING_WRAPPER_MINIMUM_WIDTH, "var(--ds-space-300, 24px)");
|
|
15
15
|
var pixelEntryForm = exports.pixelEntryForm = (0, _react.css)({
|
|
16
16
|
form: {
|
|
17
17
|
width: '100%'
|
|
@@ -519,7 +519,9 @@ var ResizableMediaSingleNext = /*#__PURE__*/function (_React$Component) {
|
|
|
519
519
|
})
|
|
520
520
|
}, (0, _react2.jsx)(_resizer.ResizerNext, {
|
|
521
521
|
minWidth: minViewWidth,
|
|
522
|
-
maxWidth: maxWidth
|
|
522
|
+
maxWidth: maxWidth
|
|
523
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
524
|
+
,
|
|
523
525
|
className: resizerNextClassName,
|
|
524
526
|
snapGap: _mediaSingle.MEDIA_SINGLE_SNAP_GAP,
|
|
525
527
|
enable: enable,
|
|
@@ -11,5 +11,5 @@ var _ui = require("@atlaskit/editor-common/ui");
|
|
|
11
11
|
var _templateObject;
|
|
12
12
|
// eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression -- Needs manual remediation
|
|
13
13
|
var wrapperStyle = exports.wrapperStyle = function wrapperStyle(props) {
|
|
14
|
-
return (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n
|
|
14
|
+
return (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n\t& > div {\n\t\t", ";\n\t\tposition: relative;\n\t\tclear: both;\n\t}\n"])), (0, _ui.MediaSingleDimensionHelper)(props));
|
|
15
15
|
};
|
|
@@ -360,7 +360,9 @@ export default class MediaSingleNode extends Component {
|
|
|
360
360
|
const isCurrentNodeDrafting = (annotationPluginState === null || annotationPluginState === void 0 ? void 0 : annotationPluginState.isDrafting) && (annotationPluginState === null || annotationPluginState === void 0 ? void 0 : annotationPluginState.targetNodeId) === (node === null || node === void 0 ? void 0 : (_node$firstChild = node.firstChild) === null || _node$firstChild === void 0 ? void 0 : _node$firstChild.attrs.id);
|
|
361
361
|
const MediaChildren = jsx("figure", {
|
|
362
362
|
ref: this.mediaSingleWrapperRef,
|
|
363
|
-
css: figureWrapperStyles
|
|
363
|
+
css: figureWrapperStyles
|
|
364
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
365
|
+
,
|
|
364
366
|
className: MediaSingleNodeSelector,
|
|
365
367
|
onClick: this.onMediaSingleClicked
|
|
366
368
|
}, commentsOnMedia && jsx(CommentBadge, {
|
|
@@ -21,11 +21,14 @@ export const MediaCardWrapper = ({
|
|
|
21
21
|
}) => {
|
|
22
22
|
const calculatedBorderWidth = selected && borderWidth > 0 ? borderWidth + 1 : borderWidth;
|
|
23
23
|
return jsx("div", {
|
|
24
|
-
"data-testid": "media-card-wrapper"
|
|
24
|
+
"data-testid": "media-card-wrapper"
|
|
25
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
26
|
+
,
|
|
25
27
|
className: "media-card-wrapper",
|
|
26
28
|
style: {
|
|
27
29
|
borderColor: `var(--custom-palette-color)`,
|
|
28
30
|
borderWidth: `${calculatedBorderWidth}px`,
|
|
31
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
29
32
|
borderStyle: 'solid',
|
|
30
33
|
borderRadius: `${calculatedBorderWidth * 2}px`
|
|
31
34
|
}
|
|
@@ -66,7 +66,9 @@ export const LinkToolbarAppearance = ({
|
|
|
66
66
|
title: linkTitle,
|
|
67
67
|
icon: jsx(OpenIcon, {
|
|
68
68
|
label: linkTitle
|
|
69
|
-
})
|
|
69
|
+
})
|
|
70
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
71
|
+
,
|
|
70
72
|
className: "hyperlink-open-link"
|
|
71
73
|
}), jsx(Separator, null));
|
|
72
74
|
} else {
|
|
@@ -7,11 +7,11 @@ import { CAPTION_PLACEHOLDER_ID } from '@atlaskit/editor-common/media-single';
|
|
|
7
7
|
import { N200 } from '@atlaskit/theme/colors';
|
|
8
8
|
// eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression -- needs manual remediation
|
|
9
9
|
const placeholder = css`
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
10
|
+
color: ${`var(--ds-text-subtlest, ${N200})`};
|
|
11
|
+
width: 100%;
|
|
12
|
+
text-align: center;
|
|
13
|
+
margin-top: ${"var(--ds-space-100, 8px)"} !important;
|
|
14
|
+
display: block;
|
|
15
15
|
`;
|
|
16
16
|
export default /*#__PURE__*/React.forwardRef(({
|
|
17
17
|
onClick
|
|
@@ -50,7 +50,9 @@ const ImageBorder = ({
|
|
|
50
50
|
value: {
|
|
51
51
|
name: 'color'
|
|
52
52
|
},
|
|
53
|
-
elemAfter:
|
|
53
|
+
elemAfter:
|
|
54
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
55
|
+
jsx("div", {
|
|
54
56
|
className: DropdownMenuSharedCssClassName.SUBMENU
|
|
55
57
|
}, jsx("div", {
|
|
56
58
|
css: contextualMenuColorIcon(color && hexToEditorBorderPaletteColor(color))
|
|
@@ -76,7 +78,9 @@ const ImageBorder = ({
|
|
|
76
78
|
value: {
|
|
77
79
|
name: 'size'
|
|
78
80
|
},
|
|
79
|
-
elemAfter:
|
|
81
|
+
elemAfter:
|
|
82
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
83
|
+
jsx("div", {
|
|
80
84
|
className: DropdownMenuSharedCssClassName.SUBMENU
|
|
81
85
|
}, jsx("div", {
|
|
82
86
|
css: contextualMenuArrow
|
|
@@ -124,7 +128,9 @@ const ImageBorder = ({
|
|
|
124
128
|
enabled,
|
|
125
129
|
isOpen
|
|
126
130
|
})
|
|
127
|
-
}, jsx(ToolbarButton
|
|
131
|
+
}, jsx(ToolbarButton
|
|
132
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
133
|
+
, {
|
|
128
134
|
className: "image-border-toolbar-btn",
|
|
129
135
|
selected: enabled,
|
|
130
136
|
onClick: toggleBorder,
|
|
@@ -136,7 +142,9 @@ const ImageBorder = ({
|
|
|
136
142
|
title: enabled ? formatMessage(messages.removeBorder) : formatMessage(messages.addBorder)
|
|
137
143
|
}), jsx("div", {
|
|
138
144
|
ref: popupTarget
|
|
139
|
-
}, jsx(ToolbarButton
|
|
145
|
+
}, jsx(ToolbarButton
|
|
146
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
147
|
+
, {
|
|
140
148
|
className: "image-border-toolbar-dropdown",
|
|
141
149
|
selected: enabled || isOpen,
|
|
142
150
|
"aria-label": formatMessage(messages.borderOptions),
|
|
@@ -17,80 +17,80 @@ export const menuItemDimensions = {
|
|
|
17
17
|
// Recommendation: Replace directly with 4 due to itemSpacing being used in calculations
|
|
18
18
|
export const itemSpacing = gridSize() / 2;
|
|
19
19
|
export const contextualMenuArrow = css`
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
20
|
+
display: flex;
|
|
21
|
+
&::after {
|
|
22
|
+
content: '›';
|
|
23
|
+
margin-left: ${"var(--ds-space-050, 4px)"};
|
|
24
|
+
line-height: 20px;
|
|
25
|
+
color: ${`var(--ds-icon, ${N90})`};
|
|
26
|
+
}
|
|
27
27
|
`;
|
|
28
28
|
export const contextualMenuColorIcon = color => css`
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
29
|
+
${contextualMenuArrow}
|
|
30
|
+
&::before {
|
|
31
|
+
content: '';
|
|
32
|
+
display: block;
|
|
33
|
+
border: 1px solid ${DEFAULT_BORDER_COLOR};
|
|
34
|
+
border-radius: ${"var(--ds-border-radius-100, 3px)"};
|
|
35
|
+
width: 20px;
|
|
36
|
+
height: 20px;
|
|
37
|
+
${color && `background: ${color}`}
|
|
38
|
+
}
|
|
39
39
|
`;
|
|
40
40
|
export const contextualSubMenu = index => css`
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
41
|
+
border-radius: ${"var(--ds-border-radius-100, 3px)"};
|
|
42
|
+
background: ${"var(--ds-surface-overlay, white)"};
|
|
43
|
+
box-shadow: ${`var(--ds-shadow-overlay, ${`0 4px 8px -2px ${N60A}, 0 0 1px ${N60A}`})`};
|
|
44
|
+
display: flex;
|
|
45
|
+
position: absolute;
|
|
46
|
+
top: ${index * (menuItemDimensions.height + itemSpacing * 2)}px;
|
|
47
|
+
left: ${menuItemDimensions.width}px;
|
|
48
|
+
padding: ${"var(--ds-space-100, 8px)"};
|
|
49
49
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
50
|
+
> div {
|
|
51
|
+
padding: 0;
|
|
52
|
+
}
|
|
53
53
|
`;
|
|
54
54
|
export const buttonStyle = selected => css`
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
55
|
+
height: 26px;
|
|
56
|
+
width: 26px;
|
|
57
|
+
padding: 0;
|
|
58
|
+
border-radius: 4px;
|
|
59
|
+
background-color: ${selected ? `var(--ds-text, ${N800})` : `var(--ds-background-neutral, ${N20A})`};
|
|
60
|
+
border: 1px solid ${DEFAULT_BORDER_COLOR};
|
|
61
|
+
cursor: pointer;
|
|
62
|
+
display: block;
|
|
63
63
|
`;
|
|
64
64
|
|
|
65
65
|
/* eslint-disable @atlaskit/design-system/ensure-design-token-usage */
|
|
66
66
|
export const buttonWrapperStyle = css`
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
67
|
+
border: 1px solid transparent;
|
|
68
|
+
margin: ${"var(--ds-space-025, 2px)"};
|
|
69
|
+
font-size: 0;
|
|
70
|
+
display: flex;
|
|
71
|
+
align-items: center;
|
|
72
|
+
padding: ${"var(--ds-space-025, 2px)"};
|
|
73
|
+
border-radius: 6px;
|
|
74
|
+
&:focus-within,
|
|
75
|
+
&:focus,
|
|
76
|
+
&:hover {
|
|
77
|
+
border-color: ${N50} !important;
|
|
78
|
+
}
|
|
79
79
|
`;
|
|
80
80
|
export const line = (size, selected) => css`
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
81
|
+
position: relative;
|
|
82
|
+
&:before {
|
|
83
|
+
content: '';
|
|
84
|
+
display: block;
|
|
85
|
+
position: absolute;
|
|
86
|
+
top: 50%;
|
|
87
|
+
left: 50%;
|
|
88
|
+
width: 12px;
|
|
89
|
+
height: ${size}px;
|
|
90
|
+
background-color: ${selected ? `var(--ds-icon-inverse, ${N0})` : "var(--ds-icon, #44546F)"};
|
|
91
|
+
border-radius: 90px;
|
|
92
|
+
transform: translate(-50%, -50%) rotate(135deg);
|
|
93
|
+
}
|
|
94
94
|
`;
|
|
95
95
|
const getHoverStyles = selector => `&:hover ${selector} {
|
|
96
96
|
background: ${`var(--ds-background-neutral-subtle-hovered, ${colors.N20A})`};
|
|
@@ -103,26 +103,26 @@ export const toolbarButtonWrapper = ({
|
|
|
103
103
|
enabled,
|
|
104
104
|
isOpen
|
|
105
105
|
}) => css`
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
106
|
+
display: flex;
|
|
107
|
+
.image-border-toolbar-btn {
|
|
108
|
+
border-top-right-radius: 0;
|
|
109
|
+
border-bottom-right-radius: 0;
|
|
110
|
+
padding: 0;
|
|
111
|
+
& > span {
|
|
112
|
+
margin: 0;
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
.image-border-toolbar-dropdown {
|
|
116
|
+
padding: 0;
|
|
117
|
+
& > span {
|
|
118
|
+
margin: 0;
|
|
119
|
+
}
|
|
120
|
+
width: 16px !important;
|
|
121
|
+
border-top-left-radius: 0 !important;
|
|
122
|
+
border-bottom-left-radius: 0 !important;
|
|
123
|
+
margin-left: ${"var(--ds-space-025, 2px)"};
|
|
124
|
+
}
|
|
125
125
|
|
|
126
|
-
|
|
127
|
-
|
|
126
|
+
${!enabled && getHoverStyles('.image-border-toolbar-btn')}
|
|
127
|
+
${!isOpen && !enabled && getHoverStyles('.image-border-toolbar-dropdown')}
|
|
128
128
|
`;
|