@atlaskit/editor-common 78.29.3 → 78.30.1
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 +13 -0
- package/dist/cjs/analytics/fire-analytics-event.js +5 -16
- package/dist/cjs/card/LinkToolbarButtonGroup.js +12 -6
- package/dist/cjs/element-browser/ViewMore.js +13 -5
- package/dist/cjs/element-browser/components/ElementBrowserLoader.js +9 -6
- package/dist/cjs/element-browser/components/ElementList/NotFoundIllustration.js +6 -4
- package/dist/cjs/element-browser/hooks/use-container-width.js +5 -4
- package/dist/cjs/link/LinkPicker/HyperlinkAddToolbar/HyperlinkAddToolbar.js +38 -11
- package/dist/cjs/monitoring/error.js +1 -1
- package/dist/cjs/react-node-view/generateUniqueNodeKey.js +11 -0
- package/dist/cjs/react-node-view/getInlineNodeViewProducer.js +4 -2
- package/dist/cjs/react-node-view/index.js +4 -2
- package/dist/cjs/ui/Caption/index.js +13 -6
- package/dist/cjs/ui/DropList/index.js +23 -6
- package/dist/cjs/ui/Expand/index.js +81 -9
- package/dist/cjs/ui/FloatingToolbar/Separator.js +8 -4
- package/dist/cjs/ui/FloatingToolbar/SmallerEditIcon.js +4 -3
- package/dist/cjs/ui/MediaSingle/link.js +11 -4
- package/dist/cjs/ui/Messages/index.js +18 -6
- package/dist/cjs/ui/PanelTextInput/styles.js +30 -5
- package/dist/cjs/ui/PortalProvider/index.js +5 -4
- package/dist/cjs/ui/UnsupportedBlock/index.js +19 -4
- package/dist/cjs/ui/WidthProvider/index.js +7 -4
- package/dist/cjs/ui-color/ColorPalette/styles.js +5 -4
- package/dist/cjs/ui-menu/DropdownMenu/index.js +15 -5
- package/dist/cjs/ui-menu/ToolbarArrowKeyNavigationProvider/index.js +8 -6
- package/dist/cjs/ui-menu/ToolbarButton/index.js +8 -7
- package/dist/es2019/analytics/fire-analytics-event.js +5 -16
- package/dist/es2019/card/LinkToolbarButtonGroup.js +12 -12
- package/dist/es2019/element-browser/ViewMore.js +12 -12
- package/dist/es2019/element-browser/components/ElementBrowserLoader.js +7 -7
- package/dist/es2019/element-browser/components/ElementList/NotFoundIllustration.js +5 -5
- package/dist/es2019/element-browser/hooks/use-container-width.js +3 -3
- package/dist/es2019/link/LinkPicker/HyperlinkAddToolbar/HyperlinkAddToolbar.js +37 -37
- package/dist/es2019/monitoring/error.js +1 -1
- package/dist/es2019/react-node-view/generateUniqueNodeKey.js +4 -0
- package/dist/es2019/react-node-view/getInlineNodeViewProducer.js +4 -2
- package/dist/es2019/react-node-view/index.js +4 -2
- package/dist/es2019/ui/Caption/index.js +12 -12
- package/dist/es2019/ui/DropList/index.js +23 -21
- package/dist/es2019/ui/Expand/index.js +71 -78
- package/dist/es2019/ui/FloatingToolbar/Separator.js +7 -7
- package/dist/es2019/ui/FloatingToolbar/SmallerEditIcon.js +3 -3
- package/dist/es2019/ui/MediaSingle/link.js +11 -11
- package/dist/es2019/ui/Messages/index.js +17 -17
- package/dist/es2019/ui/PanelTextInput/styles.js +26 -30
- package/dist/es2019/ui/PortalProvider/index.js +4 -3
- package/dist/es2019/ui/UnsupportedBlock/index.js +17 -17
- package/dist/es2019/ui/WidthProvider/index.js +5 -4
- package/dist/es2019/ui-color/ColorPalette/styles.js +4 -4
- package/dist/es2019/ui-menu/DropdownMenu/index.js +10 -8
- package/dist/es2019/ui-menu/ToolbarArrowKeyNavigationProvider/index.js +5 -5
- package/dist/es2019/ui-menu/ToolbarButton/index.js +4 -4
- package/dist/esm/analytics/fire-analytics-event.js +5 -16
- package/dist/esm/card/LinkToolbarButtonGroup.js +12 -6
- package/dist/esm/element-browser/ViewMore.js +12 -4
- package/dist/esm/element-browser/components/ElementBrowserLoader.js +7 -3
- package/dist/esm/element-browser/components/ElementList/NotFoundIllustration.js +5 -3
- package/dist/esm/element-browser/hooks/use-container-width.js +3 -3
- package/dist/esm/link/LinkPicker/HyperlinkAddToolbar/HyperlinkAddToolbar.js +37 -9
- package/dist/esm/monitoring/error.js +1 -1
- package/dist/esm/react-node-view/generateUniqueNodeKey.js +4 -0
- package/dist/esm/react-node-view/getInlineNodeViewProducer.js +4 -2
- package/dist/esm/react-node-view/index.js +4 -2
- package/dist/esm/ui/Caption/index.js +12 -4
- package/dist/esm/ui/DropList/index.js +23 -6
- package/dist/esm/ui/Expand/index.js +81 -9
- package/dist/esm/ui/FloatingToolbar/Separator.js +7 -3
- package/dist/esm/ui/FloatingToolbar/SmallerEditIcon.js +3 -3
- package/dist/esm/ui/MediaSingle/link.js +11 -3
- package/dist/esm/ui/Messages/index.js +17 -6
- package/dist/esm/ui/PanelTextInput/styles.js +30 -4
- package/dist/esm/ui/PortalProvider/index.js +5 -4
- package/dist/esm/ui/UnsupportedBlock/index.js +17 -3
- package/dist/esm/ui/WidthProvider/index.js +5 -3
- package/dist/esm/ui-color/ColorPalette/styles.js +5 -3
- package/dist/esm/ui-menu/DropdownMenu/index.js +15 -5
- package/dist/esm/ui-menu/ToolbarArrowKeyNavigationProvider/index.js +5 -3
- package/dist/esm/ui-menu/ToolbarButton/index.js +4 -3
- package/dist/types/react-node-view/generateUniqueNodeKey.d.ts +1 -0
- package/dist/types/react-node-view/index.d.ts +1 -0
- package/dist/types/types/feature-flags.d.ts +2 -0
- package/dist/types/ui/Caption/index.d.ts +1 -1
- package/dist/types/ui/PortalProvider/index.d.ts +3 -2
- package/dist/types/ui/UnsupportedBlock/index.d.ts +3 -3
- package/dist/types-ts4.5/react-node-view/generateUniqueNodeKey.d.ts +1 -0
- package/dist/types-ts4.5/react-node-view/index.d.ts +1 -0
- package/dist/types-ts4.5/types/feature-flags.d.ts +2 -0
- package/dist/types-ts4.5/ui/Caption/index.d.ts +1 -1
- package/dist/types-ts4.5/ui/PortalProvider/index.d.ts +3 -2
- package/dist/types-ts4.5/ui/UnsupportedBlock/index.d.ts +3 -3
- package/package.json +3 -2
|
@@ -1,8 +1,8 @@
|
|
|
1
|
+
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
1
2
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
3
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
|
-
|
|
4
|
+
var _templateObject;
|
|
4
5
|
var _excluded = ["children"];
|
|
5
|
-
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7;
|
|
6
6
|
/** @jsx jsx */
|
|
7
7
|
|
|
8
8
|
import React, { forwardRef } from 'react';
|
|
@@ -50,10 +50,30 @@ export var ExpandIconWrapper = function ExpandIconWrapper(_ref) {
|
|
|
50
50
|
}, children);
|
|
51
51
|
};
|
|
52
52
|
var expandIconWrapperStyle = function expandIconWrapperStyle() {
|
|
53
|
-
return css(
|
|
53
|
+
return css({
|
|
54
|
+
cursor: 'pointer',
|
|
55
|
+
display: 'flex',
|
|
56
|
+
color: "var(--ds-icon, ".concat(N90, ")"),
|
|
57
|
+
borderRadius: "var(--ds-border-radius-100, 4px)",
|
|
58
|
+
width: '24px',
|
|
59
|
+
height: '24px',
|
|
60
|
+
'&:hover': {
|
|
61
|
+
background: "var(--ds-background-neutral-subtle-hovered, ".concat(N30A, ")")
|
|
62
|
+
},
|
|
63
|
+
svg: {
|
|
64
|
+
transition: "transform 0.2s ".concat(akEditorSwoopCubicBezier)
|
|
65
|
+
}
|
|
66
|
+
});
|
|
54
67
|
};
|
|
55
|
-
var expandIconWrapperExpandedStyle = css(
|
|
56
|
-
|
|
68
|
+
var expandIconWrapperExpandedStyle = css({
|
|
69
|
+
svg: {
|
|
70
|
+
transform: 'rotate(90deg)'
|
|
71
|
+
}
|
|
72
|
+
});
|
|
73
|
+
export var expandLayoutWrapperStyle = css({
|
|
74
|
+
width: "var(--ds-space-300, 24px)",
|
|
75
|
+
height: "var(--ds-space-300, 24px)"
|
|
76
|
+
});
|
|
57
77
|
export var ExpandLayoutWrapperWithRef = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
58
78
|
var children = props.children,
|
|
59
79
|
rest = _objectWithoutProperties(props, _excluded);
|
|
@@ -73,19 +93,71 @@ var containerStyles = function containerStyles(styleProps) {
|
|
|
73
93
|
var marginHorizontal = styleProps['data-node-type'] === 'expand' ? "-".concat(akLayoutGutterOffset, "px") : 0;
|
|
74
94
|
var margin = "".concat(marginTop, " ").concat(marginHorizontal, " ").concat(marginBottom);
|
|
75
95
|
return function () {
|
|
76
|
-
return css(
|
|
96
|
+
return css({
|
|
97
|
+
borderWidth: '1px',
|
|
98
|
+
borderStyle: 'solid',
|
|
99
|
+
borderColor: focused ? EXPAND_FOCUSED_BORDER_COLOR : expanded ? EXPAND_EXPANDED_BORDER_COLOR : EXPAND_COLLAPSED_BORDER_COLOR,
|
|
100
|
+
borderRadius: BORDER_RADIUS,
|
|
101
|
+
minHeight: '25px',
|
|
102
|
+
background: !expanded ? EXPAND_COLLAPSED_BACKGROUND : EXPAND_SELECTED_BACKGROUND,
|
|
103
|
+
margin: margin,
|
|
104
|
+
transition: "background 0.3s ".concat(akEditorSwoopCubicBezier, ", border-color 0.3s ").concat(akEditorSwoopCubicBezier),
|
|
105
|
+
padding: "var(--ds-space-100, 8px)",
|
|
106
|
+
'&:hover': {
|
|
107
|
+
// TODO: Remove the border styles below once design tokens have been enabled and fallbacks are no longer triggered.
|
|
108
|
+
// This is because the default state already uses the same token and, as such, the hover style won't change anything.
|
|
109
|
+
// https://product-fabric.atlassian.net/browse/DSP-4152
|
|
110
|
+
border: "1px solid ".concat("var(--ds-border, ".concat(N50A, ")")),
|
|
111
|
+
background: EXPAND_SELECTED_BACKGROUND
|
|
112
|
+
},
|
|
113
|
+
'td > :not(style):first-child, td > style:first-child + *': {
|
|
114
|
+
marginTop: 0
|
|
115
|
+
}
|
|
116
|
+
});
|
|
77
117
|
};
|
|
78
118
|
};
|
|
79
119
|
var contentStyles = function contentStyles(styleProps) {
|
|
80
120
|
return function () {
|
|
81
|
-
return
|
|
121
|
+
return (// eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression -- needs manual remediation
|
|
122
|
+
css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n padding-top: ", ";\n padding-right: ", ";\n padding-left: ", ";\n margin-left: ", ";\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)", "var(--ds-space-300, 24px)", "var(--ds-space-050, 4px)", !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 " : '')
|
|
123
|
+
);
|
|
82
124
|
};
|
|
83
125
|
};
|
|
84
126
|
var titleInputStyles = function titleInputStyles() {
|
|
85
|
-
return css(
|
|
127
|
+
return css({
|
|
128
|
+
outline: 'none',
|
|
129
|
+
border: 'none',
|
|
130
|
+
fontSize: relativeFontSizeToBase16(fontSize()),
|
|
131
|
+
lineHeight: akEditorLineHeight,
|
|
132
|
+
fontWeight: 'normal',
|
|
133
|
+
color: "var(--ds-text-subtlest, ".concat(N200A, ")"),
|
|
134
|
+
background: 'transparent',
|
|
135
|
+
display: 'flex',
|
|
136
|
+
flex: 1,
|
|
137
|
+
padding: "0 0 0 ".concat("var(--ds-space-050, 4px)"),
|
|
138
|
+
width: '100%',
|
|
139
|
+
'&::placeholder': {
|
|
140
|
+
opacity: 1,
|
|
141
|
+
color: "var(--ds-text-subtlest, ".concat(N200, ")")
|
|
142
|
+
}
|
|
143
|
+
});
|
|
86
144
|
};
|
|
87
145
|
var titleContainerStyles = function titleContainerStyles() {
|
|
88
|
-
return css(
|
|
146
|
+
return css({
|
|
147
|
+
padding: 0,
|
|
148
|
+
display: 'flex',
|
|
149
|
+
alignItems: 'flex-start',
|
|
150
|
+
background: 'none',
|
|
151
|
+
border: 'none',
|
|
152
|
+
fontSize: relativeFontSizeToBase16(fontSize()),
|
|
153
|
+
width: '100%',
|
|
154
|
+
color: "var(--ds-text-subtle, ".concat(N300A, ")"),
|
|
155
|
+
overflow: 'hidden',
|
|
156
|
+
cursor: 'pointer',
|
|
157
|
+
'&:focus': {
|
|
158
|
+
outline: 0
|
|
159
|
+
}
|
|
160
|
+
});
|
|
89
161
|
};
|
|
90
162
|
export var sharedExpandStyles = {
|
|
91
163
|
titleInputStyles: titleInputStyles,
|
|
@@ -1,9 +1,13 @@
|
|
|
1
|
-
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
2
|
-
var _templateObject;
|
|
3
1
|
/** @jsx jsx */
|
|
4
2
|
import { css, jsx } from '@emotion/react';
|
|
5
3
|
import { N30 } from '@atlaskit/theme/colors';
|
|
6
|
-
var separator = css(
|
|
4
|
+
var separator = css({
|
|
5
|
+
background: "var(--ds-border, ".concat(N30, ")"),
|
|
6
|
+
width: '1px',
|
|
7
|
+
height: '20px',
|
|
8
|
+
margin: "0 ".concat("var(--ds-space-050, 4px)"),
|
|
9
|
+
alignSelf: 'center'
|
|
10
|
+
});
|
|
7
11
|
export default (function () {
|
|
8
12
|
return jsx("div", {
|
|
9
13
|
css: separator,
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
2
|
-
var _templateObject;
|
|
3
1
|
/** @jsx jsx */
|
|
4
2
|
import { css, jsx } from '@emotion/react';
|
|
5
3
|
import EditIcon from '@atlaskit/icon/glyph/edit';
|
|
6
|
-
var editIconStyles = css(
|
|
4
|
+
var editIconStyles = css({
|
|
5
|
+
width: '20px'
|
|
6
|
+
});
|
|
7
7
|
|
|
8
8
|
/* eslint-disable @atlaskit/design-system/consistent-css-prop-usage */
|
|
9
9
|
export var SmallerEditIcon = function SmallerEditIcon() {
|
|
@@ -1,4 +1,12 @@
|
|
|
1
|
-
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
2
|
-
var _templateObject;
|
|
3
1
|
import { css } from '@emotion/react';
|
|
4
|
-
export var mediaLinkStyle = css(
|
|
2
|
+
export var mediaLinkStyle = css({
|
|
3
|
+
position: 'absolute',
|
|
4
|
+
background: 'transparent',
|
|
5
|
+
top: 0,
|
|
6
|
+
right: 0,
|
|
7
|
+
bottom: 0,
|
|
8
|
+
left: 0,
|
|
9
|
+
cursor: 'pointer',
|
|
10
|
+
width: '100%',
|
|
11
|
+
height: '100%'
|
|
12
|
+
});
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
2
|
-
var _templateObject, _templateObject2, _templateObject3, _templateObject4;
|
|
3
1
|
/** @jsx jsx */
|
|
4
2
|
|
|
5
3
|
import { css, jsx } from '@emotion/react';
|
|
@@ -7,12 +5,25 @@ import SuccessIcon from '@atlaskit/icon/glyph/editor/success';
|
|
|
7
5
|
import ErrorIcon from '@atlaskit/icon/glyph/error';
|
|
8
6
|
import { G400, N200, R400 } from '@atlaskit/theme/colors';
|
|
9
7
|
import { h200 } from '@atlaskit/theme/typography';
|
|
10
|
-
var errorColor = css(
|
|
11
|
-
|
|
8
|
+
var errorColor = css({
|
|
9
|
+
color: "var(--ds-text-danger, ".concat(R400, ")")
|
|
10
|
+
});
|
|
11
|
+
var validColor = css({
|
|
12
|
+
color: "var(--ds-text-success, ".concat(G400, ")")
|
|
13
|
+
});
|
|
12
14
|
var messageStyle = function messageStyle() {
|
|
13
|
-
return css(
|
|
15
|
+
return css(h200(), {
|
|
16
|
+
fontWeight: 'normal',
|
|
17
|
+
color: "var(--ds-text-subtlest, ".concat(N200, ")"),
|
|
18
|
+
marginTop: "var(--ds-space-050, 4px)",
|
|
19
|
+
display: 'flex',
|
|
20
|
+
justifyContent: 'baseline'
|
|
21
|
+
});
|
|
14
22
|
};
|
|
15
|
-
var iconWrapperStyle = css(
|
|
23
|
+
var iconWrapperStyle = css({
|
|
24
|
+
display: 'flex',
|
|
25
|
+
marginRight: "var(--ds-space-050, 4px)"
|
|
26
|
+
});
|
|
16
27
|
export var HelperMessage = function HelperMessage(_ref) {
|
|
17
28
|
var children = _ref.children;
|
|
18
29
|
return jsx("div", {
|
|
@@ -1,10 +1,36 @@
|
|
|
1
|
-
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
2
|
-
var _templateObject, _templateObject2;
|
|
3
1
|
import { css } from '@emotion/react';
|
|
4
2
|
import { relativeFontSizeToBase16 } from '@atlaskit/editor-shared-styles';
|
|
5
3
|
import { B100, N100, N30, N400 } from '@atlaskit/theme/colors';
|
|
6
4
|
// Normal .className gets overridden by input[type=text] hence this hack to produce input.className
|
|
7
|
-
export var panelTextInput = css(
|
|
5
|
+
export var panelTextInput = css({
|
|
6
|
+
'input&': {
|
|
7
|
+
background: 'transparent',
|
|
8
|
+
border: "2px solid ".concat("var(--ds-border, ".concat(N30, ")")),
|
|
9
|
+
borderRadius: 0,
|
|
10
|
+
boxSizing: 'content-box',
|
|
11
|
+
color: "var(--ds-text-subtle, ".concat(N400, ")"),
|
|
12
|
+
flexGrow: 1,
|
|
13
|
+
fontSize: relativeFontSizeToBase16(13),
|
|
14
|
+
lineHeight: '20px',
|
|
15
|
+
padding: "var(--ds-space-075, 6px)".concat(" ", "var(--ds-space-400, 32px)", " ", "var(--ds-space-075, 6px)", " ", "var(--ds-space-100, 8px)"),
|
|
16
|
+
minWidth: '145px',
|
|
17
|
+
/* Hides IE10+ built-in [x] clear input button */
|
|
18
|
+
'&::-ms-clear': {
|
|
19
|
+
display: 'none'
|
|
20
|
+
},
|
|
21
|
+
'&:focus': {
|
|
22
|
+
outline: 'none',
|
|
23
|
+
borderColor: "var(--ds-border-focused, ".concat(B100, ")")
|
|
24
|
+
},
|
|
25
|
+
'&::placeholder': {
|
|
26
|
+
color: "var(--ds-text-subtlest, ".concat(N100, ")")
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
});
|
|
8
30
|
export var panelTextInputWithCustomWidth = function panelTextInputWithCustomWidth(width) {
|
|
9
|
-
return css(
|
|
31
|
+
return css({
|
|
32
|
+
'input&': {
|
|
33
|
+
width: "".concat(width, "px")
|
|
34
|
+
}
|
|
35
|
+
});
|
|
10
36
|
};
|
|
@@ -35,10 +35,11 @@ export var PortalProviderAPI = /*#__PURE__*/function (_EventDispatcher) {
|
|
|
35
35
|
}
|
|
36
36
|
_createClass(PortalProviderAPI, [{
|
|
37
37
|
key: "render",
|
|
38
|
-
value: function render(children, container) {
|
|
39
|
-
var hasAnalyticsContext = arguments.length >
|
|
40
|
-
var hasIntlContext = arguments.length >
|
|
38
|
+
value: function render(children, container, key) {
|
|
39
|
+
var hasAnalyticsContext = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
|
|
40
|
+
var hasIntlContext = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
|
|
41
41
|
this.portals.set(container, {
|
|
42
|
+
key: key,
|
|
42
43
|
children: children,
|
|
43
44
|
hasAnalyticsContext: hasAnalyticsContext,
|
|
44
45
|
hasIntlContext: hasIntlContext
|
|
@@ -79,7 +80,7 @@ export var PortalProviderAPI = /*#__PURE__*/function (_EventDispatcher) {
|
|
|
79
80
|
}
|
|
80
81
|
}, {
|
|
81
82
|
key: "remove",
|
|
82
|
-
value: function remove(container) {
|
|
83
|
+
value: function remove(key, container) {
|
|
83
84
|
this.portals.delete(container);
|
|
84
85
|
|
|
85
86
|
// There is a race condition that can happen caused by Prosemirror vs React,
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
2
|
-
var _templateObject;
|
|
3
1
|
/** @jsx jsx */
|
|
4
2
|
import React, { useCallback, useRef } from 'react';
|
|
5
3
|
import { css, jsx } from '@emotion/react';
|
|
@@ -13,7 +11,23 @@ import { ACTION_SUBJECT_ID } from '../../analytics';
|
|
|
13
11
|
import { unsupportedContentMessages } from '../../messages/unsupportedContent';
|
|
14
12
|
import { trackUnsupportedContentTooltipDisplayedFor } from '../../utils/track-unsupported-content';
|
|
15
13
|
import { getUnsupportedContent } from '../unsupported-content-helper';
|
|
16
|
-
var blockNodeStyle = css(
|
|
14
|
+
var blockNodeStyle = css({
|
|
15
|
+
background: "var(--ds-background-disabled, ".concat(N30, ")"),
|
|
16
|
+
border: "1px dashed ".concat("var(--ds-border-disabled, ".concat(N50, ")")),
|
|
17
|
+
borderRadius: "".concat(borderRadius(), "px"),
|
|
18
|
+
boxSizing: 'border-box',
|
|
19
|
+
cursor: 'default',
|
|
20
|
+
display: 'flex',
|
|
21
|
+
fontSize: relativeFontSizeToBase16(fontSize()),
|
|
22
|
+
margin: "var(--ds-space-100, 8px)".concat(" 0"),
|
|
23
|
+
minHeight: '24px',
|
|
24
|
+
padding: "var(--ds-space-150, 12px)",
|
|
25
|
+
textAlign: 'center',
|
|
26
|
+
verticalAlign: 'text-bottom',
|
|
27
|
+
minWidth: '120px',
|
|
28
|
+
alignItems: 'center',
|
|
29
|
+
justifyContent: 'center'
|
|
30
|
+
});
|
|
17
31
|
var UnsupportedBlockNode = function UnsupportedBlockNode(_ref) {
|
|
18
32
|
var node = _ref.node,
|
|
19
33
|
intl = _ref.intl,
|
|
@@ -1,11 +1,13 @@
|
|
|
1
|
-
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
2
1
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
3
|
-
var _templateObject;
|
|
4
2
|
/** @jsx jsx */
|
|
5
3
|
import React, { Fragment } from 'react';
|
|
6
4
|
import { css, jsx } from '@emotion/react';
|
|
7
5
|
import rafSchedule from 'raf-schd';
|
|
8
6
|
import { WidthObserver } from '@atlaskit/width-detector';
|
|
7
|
+
var styles = css({
|
|
8
|
+
position: 'relative',
|
|
9
|
+
width: '100%'
|
|
10
|
+
});
|
|
9
11
|
var SCROLLBAR_WIDTH = 30;
|
|
10
12
|
export function getBreakpoint() {
|
|
11
13
|
var width = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
|
@@ -49,7 +51,7 @@ export var WidthProvider = function WidthProvider(_ref) {
|
|
|
49
51
|
});
|
|
50
52
|
var skipWidthDetection = shouldCheckExistingValue && existingContextValue.width > 0;
|
|
51
53
|
return jsx("div", {
|
|
52
|
-
css:
|
|
54
|
+
css: styles,
|
|
53
55
|
className: className
|
|
54
56
|
}, !skipWidthDetection && jsx(Fragment, null, jsx(WidthObserver, {
|
|
55
57
|
setWidth: updateWidth,
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
2
|
-
var _templateObject;
|
|
3
1
|
import { css } from '@emotion/react';
|
|
4
|
-
export var colorPaletteWrapper = css(
|
|
2
|
+
export var colorPaletteWrapper = css({
|
|
3
|
+
padding: "0 ".concat("var(--ds-space-100, 8px)"),
|
|
4
|
+
/* Firefox bug fix: https://product-fabric.atlassian.net/browse/ED-1789 */
|
|
5
|
+
display: 'flex'
|
|
6
|
+
});
|
|
@@ -11,7 +11,7 @@ import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
|
11
11
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
12
12
|
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
13
13
|
var _excluded = ["children"];
|
|
14
|
-
var _templateObject, _templateObject2
|
|
14
|
+
var _templateObject, _templateObject2;
|
|
15
15
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
16
16
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
17
17
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
@@ -32,16 +32,26 @@ import DropList from '../../ui/DropList';
|
|
|
32
32
|
import Popup from '../../ui/Popup';
|
|
33
33
|
import { ArrowKeyNavigationProvider } from '../ArrowKeyNavigationProvider';
|
|
34
34
|
import { ArrowKeyNavigationType } from '../ArrowKeyNavigationProvider/types';
|
|
35
|
-
var wrapper = css(
|
|
36
|
-
|
|
35
|
+
var wrapper = css({
|
|
36
|
+
/* tooltip in ToolbarButton is display:block */
|
|
37
|
+
'& > div > div': {
|
|
38
|
+
display: 'flex'
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
var focusedMenuItemStyle = css({
|
|
42
|
+
boxShadow: "inset 0px 0px 0px 2px ".concat("var(--ds-border-focused, ".concat(B100, ")")),
|
|
43
|
+
outline: 'none'
|
|
44
|
+
});
|
|
37
45
|
var buttonStyles = function buttonStyles(isActive, submenuActive) {
|
|
38
46
|
if (isActive) {
|
|
39
47
|
/**
|
|
40
48
|
* Hack for item to imitate old dropdown-menu selected styles
|
|
41
49
|
*/
|
|
42
|
-
|
|
50
|
+
// eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression -- needs manual remediation
|
|
51
|
+
return css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\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);
|
|
43
52
|
} else {
|
|
44
|
-
|
|
53
|
+
// eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression -- needs manual remediation
|
|
54
|
+
return css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\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(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(N70, ")"), focusedMenuItemStyle); // The default focus-visible style is removed to ensure consistency across browsers
|
|
45
55
|
}
|
|
46
56
|
};
|
|
47
57
|
var DropListWithOutsideListeners = withReactEditorViewOuterListeners(DropList);
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
2
|
-
var _templateObject;
|
|
3
1
|
/** @jsx jsx */
|
|
4
2
|
/* eslint-disable no-console */
|
|
5
3
|
|
|
@@ -17,7 +15,11 @@ export var KeyDownHandlerContext = /*#__PURE__*/React.createContext({
|
|
|
17
15
|
handleArrowRight: function handleArrowRight() {},
|
|
18
16
|
handleTab: function handleTab() {}
|
|
19
17
|
});
|
|
20
|
-
var centeredToolbarContainer = css(
|
|
18
|
+
var centeredToolbarContainer = css({
|
|
19
|
+
display: 'flex',
|
|
20
|
+
width: '100%',
|
|
21
|
+
alignItems: 'center'
|
|
22
|
+
});
|
|
21
23
|
|
|
22
24
|
/**
|
|
23
25
|
* This component is a wrapper of main toolbar which listens to keydown events of children
|
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
-
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
3
|
-
var _templateObject;
|
|
4
2
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
5
3
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
6
4
|
// This file is copied to `packages/editor/editor-plugin-ai/src/ui/components/AtlassianIntelligenceToolbarButton/ToolbarButton/index.tsx`
|
|
@@ -14,7 +12,10 @@ import Tooltip from '@atlaskit/tooltip';
|
|
|
14
12
|
import { ACTION, ACTION_SUBJECT, EVENT_TYPE, TOOLBAR_ACTION_SUBJECT_ID } from '../../analytics';
|
|
15
13
|
import Button from './styles';
|
|
16
14
|
export var TOOLBAR_BUTTON = TOOLBAR_ACTION_SUBJECT_ID;
|
|
17
|
-
var buttonWrapper = css(
|
|
15
|
+
var buttonWrapper = css({
|
|
16
|
+
display: 'flex',
|
|
17
|
+
height: '100%'
|
|
18
|
+
});
|
|
18
19
|
var ToolbarButton = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
19
20
|
var buttonId = props.buttonId,
|
|
20
21
|
testId = props.testId,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const generateUniqueNodeKey: () => string;
|
|
@@ -22,6 +22,7 @@ export default class ReactNodeView<P = ReactComponentProps> implements NodeView
|
|
|
22
22
|
getPos: getPosHandler;
|
|
23
23
|
contentDOM: HTMLElement | null | undefined;
|
|
24
24
|
node: PMNode;
|
|
25
|
+
key: string;
|
|
25
26
|
constructor(node: PMNode, view: EditorView, getPos: getPosHandler, portalProviderAPI: PortalProviderAPI, eventDispatcher: EventDispatcher, reactComponentProps?: P, reactComponent?: React.ComponentType<React.PropsWithChildren<any>>, hasAnalyticsContext?: boolean, viewShouldUpdate?: shouldUpdate, hasIntlContext?: boolean);
|
|
26
27
|
/**
|
|
27
28
|
* This method exists to move initialization logic out of the constructor,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { jsx } from '@emotion/react';
|
|
4
|
-
import { WrappedComponentProps } from 'react-intl-next';
|
|
4
|
+
import type { WrappedComponentProps } from 'react-intl-next';
|
|
5
5
|
type Props = {
|
|
6
6
|
selected?: boolean;
|
|
7
7
|
hasContent?: boolean;
|
|
@@ -12,6 +12,7 @@ export type PortalRendererState = {
|
|
|
12
12
|
portals: Portals;
|
|
13
13
|
};
|
|
14
14
|
type MountedPortal = {
|
|
15
|
+
key: string;
|
|
15
16
|
children: () => React.ReactChild | null;
|
|
16
17
|
hasAnalyticsContext: boolean;
|
|
17
18
|
hasIntlContext: boolean;
|
|
@@ -24,11 +25,11 @@ export declare class PortalProviderAPI extends EventDispatcher {
|
|
|
24
25
|
useAnalyticsContext?: boolean;
|
|
25
26
|
constructor(intl: IntlShape, onAnalyticsEvent?: FireAnalyticsCallback, analyticsContext?: boolean);
|
|
26
27
|
setContext: (context: any) => void;
|
|
27
|
-
render(children: () => React.ReactChild | JSX.Element | null, container: HTMLElement, hasAnalyticsContext?: boolean, hasIntlContext?: boolean): void;
|
|
28
|
+
render(children: () => React.ReactChild | JSX.Element | null, container: HTMLElement, key: string, hasAnalyticsContext?: boolean, hasIntlContext?: boolean): void;
|
|
28
29
|
forceUpdate({ intl }: {
|
|
29
30
|
intl: IntlShape;
|
|
30
31
|
}): void;
|
|
31
|
-
remove(container: HTMLElement): void;
|
|
32
|
+
remove(key: string, container: HTMLElement): void;
|
|
32
33
|
}
|
|
33
34
|
export declare const PortalProvider: React.FC<import("react-intl-next").WithIntlProps<BasePortalProviderProps>> & {
|
|
34
35
|
WrappedComponent: React.ComponentType<BasePortalProviderProps>;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
2
|
import React from 'react';
|
|
3
|
-
import { WrappedComponentProps } from 'react-intl-next';
|
|
4
|
-
import { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
5
|
-
import { UnsupportedContentTooltipPayload } from '../../utils';
|
|
3
|
+
import type { WrappedComponentProps } from 'react-intl-next';
|
|
4
|
+
import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
5
|
+
import type { UnsupportedContentTooltipPayload } from '../../utils';
|
|
6
6
|
export interface Props {
|
|
7
7
|
node?: PMNode;
|
|
8
8
|
children?: React.ReactNode;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const generateUniqueNodeKey: () => string;
|
|
@@ -22,6 +22,7 @@ export default class ReactNodeView<P = ReactComponentProps> implements NodeView
|
|
|
22
22
|
getPos: getPosHandler;
|
|
23
23
|
contentDOM: HTMLElement | null | undefined;
|
|
24
24
|
node: PMNode;
|
|
25
|
+
key: string;
|
|
25
26
|
constructor(node: PMNode, view: EditorView, getPos: getPosHandler, portalProviderAPI: PortalProviderAPI, eventDispatcher: EventDispatcher, reactComponentProps?: P, reactComponent?: React.ComponentType<React.PropsWithChildren<any>>, hasAnalyticsContext?: boolean, viewShouldUpdate?: shouldUpdate, hasIntlContext?: boolean);
|
|
26
27
|
/**
|
|
27
28
|
* This method exists to move initialization logic out of the constructor,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { jsx } from '@emotion/react';
|
|
4
|
-
import { WrappedComponentProps } from 'react-intl-next';
|
|
4
|
+
import type { WrappedComponentProps } from 'react-intl-next';
|
|
5
5
|
type Props = {
|
|
6
6
|
selected?: boolean;
|
|
7
7
|
hasContent?: boolean;
|
|
@@ -12,6 +12,7 @@ export type PortalRendererState = {
|
|
|
12
12
|
portals: Portals;
|
|
13
13
|
};
|
|
14
14
|
type MountedPortal = {
|
|
15
|
+
key: string;
|
|
15
16
|
children: () => React.ReactChild | null;
|
|
16
17
|
hasAnalyticsContext: boolean;
|
|
17
18
|
hasIntlContext: boolean;
|
|
@@ -24,11 +25,11 @@ export declare class PortalProviderAPI extends EventDispatcher {
|
|
|
24
25
|
useAnalyticsContext?: boolean;
|
|
25
26
|
constructor(intl: IntlShape, onAnalyticsEvent?: FireAnalyticsCallback, analyticsContext?: boolean);
|
|
26
27
|
setContext: (context: any) => void;
|
|
27
|
-
render(children: () => React.ReactChild | JSX.Element | null, container: HTMLElement, hasAnalyticsContext?: boolean, hasIntlContext?: boolean): void;
|
|
28
|
+
render(children: () => React.ReactChild | JSX.Element | null, container: HTMLElement, key: string, hasAnalyticsContext?: boolean, hasIntlContext?: boolean): void;
|
|
28
29
|
forceUpdate({ intl }: {
|
|
29
30
|
intl: IntlShape;
|
|
30
31
|
}): void;
|
|
31
|
-
remove(container: HTMLElement): void;
|
|
32
|
+
remove(key: string, container: HTMLElement): void;
|
|
32
33
|
}
|
|
33
34
|
export declare const PortalProvider: React.FC<import("react-intl-next").WithIntlProps<BasePortalProviderProps>> & {
|
|
34
35
|
WrappedComponent: React.ComponentType<BasePortalProviderProps>;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
2
|
import React from 'react';
|
|
3
|
-
import { WrappedComponentProps } from 'react-intl-next';
|
|
4
|
-
import { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
5
|
-
import { UnsupportedContentTooltipPayload } from '../../utils';
|
|
3
|
+
import type { WrappedComponentProps } from 'react-intl-next';
|
|
4
|
+
import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
5
|
+
import type { UnsupportedContentTooltipPayload } from '../../utils';
|
|
6
6
|
export interface Props {
|
|
7
7
|
node?: PMNode;
|
|
8
8
|
children?: React.ReactNode;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-common",
|
|
3
|
-
"version": "78.
|
|
3
|
+
"version": "78.30.1",
|
|
4
4
|
"description": "A package that contains common classes and components for editor and renderer",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -130,7 +130,7 @@
|
|
|
130
130
|
"@atlaskit/primitives": "^5.5.0",
|
|
131
131
|
"@atlaskit/profilecard": "^19.11.0",
|
|
132
132
|
"@atlaskit/section-message": "^6.4.0",
|
|
133
|
-
"@atlaskit/smart-card": "^26.
|
|
133
|
+
"@atlaskit/smart-card": "^26.57.0",
|
|
134
134
|
"@atlaskit/smart-user-picker": "^6.9.0",
|
|
135
135
|
"@atlaskit/spinner": "^16.0.0",
|
|
136
136
|
"@atlaskit/task-decision": "^17.9.0",
|
|
@@ -162,6 +162,7 @@
|
|
|
162
162
|
"react-loadable": "^5.1.0",
|
|
163
163
|
"react-virtualized": "^9.8.0",
|
|
164
164
|
"rusha": "^0.8.13",
|
|
165
|
+
"uuid": "^3.1.0",
|
|
165
166
|
"w3c-keyname": "^2.1.8"
|
|
166
167
|
},
|
|
167
168
|
"peerDependencies": {
|