@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
|
@@ -25,44 +25,44 @@ import { filterUniqueItems, mapContentTypeToIcon, sha1, wordCount } from './util
|
|
|
25
25
|
* Visible only to screenreaders. Use when there is a need
|
|
26
26
|
* to provide more context to a non-sighted user.
|
|
27
27
|
*/
|
|
28
|
-
export const visuallyHiddenStyles = css
|
|
29
|
-
clip: rect(1px, 1px, 1px, 1px)
|
|
30
|
-
|
|
31
|
-
height: 1px
|
|
32
|
-
width: 1px
|
|
33
|
-
margin:
|
|
34
|
-
overflow: hidden
|
|
35
|
-
padding: 0
|
|
36
|
-
position: absolute
|
|
37
|
-
|
|
28
|
+
export const visuallyHiddenStyles = css({
|
|
29
|
+
clip: 'rect(1px, 1px, 1px, 1px)',
|
|
30
|
+
clipPath: 'inset(50%)',
|
|
31
|
+
height: '1px',
|
|
32
|
+
width: '1px',
|
|
33
|
+
margin: "var(--ds-space-negative-025, -2px)",
|
|
34
|
+
overflow: 'hidden',
|
|
35
|
+
padding: 0,
|
|
36
|
+
position: 'absolute'
|
|
37
|
+
});
|
|
38
38
|
export const RECENT_SEARCH_LIST_SIZE = 5;
|
|
39
|
-
const clearText = css
|
|
40
|
-
cursor: pointer
|
|
41
|
-
padding: 0
|
|
42
|
-
|
|
43
|
-
color:
|
|
44
|
-
background: transparent
|
|
45
|
-
border: none
|
|
46
|
-
|
|
47
|
-
const clearTextWrapper = css
|
|
48
|
-
position: absolute
|
|
49
|
-
right: 0
|
|
50
|
-
|
|
51
|
-
const containerPadding = css
|
|
52
|
-
padding:
|
|
53
|
-
|
|
54
|
-
const textLabelMargin = css
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
const inputLabel = css
|
|
58
|
-
|
|
59
|
-
color:
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
const inputWrapperPosition = css
|
|
64
|
-
position: relative
|
|
65
|
-
|
|
39
|
+
const clearText = css({
|
|
40
|
+
cursor: 'pointer',
|
|
41
|
+
padding: 0,
|
|
42
|
+
marginRight: "var(--ds-space-100, 8px)",
|
|
43
|
+
color: `var(--ds-icon-subtle, ${N90})`,
|
|
44
|
+
background: 'transparent',
|
|
45
|
+
border: 'none'
|
|
46
|
+
});
|
|
47
|
+
const clearTextWrapper = css({
|
|
48
|
+
position: 'absolute',
|
|
49
|
+
right: 0
|
|
50
|
+
});
|
|
51
|
+
const containerPadding = css({
|
|
52
|
+
padding: `${"var(--ds-space-150, 12px)"} ${"var(--ds-space-100, 8px)"}`
|
|
53
|
+
});
|
|
54
|
+
const textLabelMargin = css({
|
|
55
|
+
marginTop: "var(--ds-space-150, 12px)"
|
|
56
|
+
});
|
|
57
|
+
const inputLabel = css({
|
|
58
|
+
fontSize: `${fontSizeSmall()}px`,
|
|
59
|
+
color: `var(--ds-text-subtlest, ${N200})`,
|
|
60
|
+
fontWeight: 500,
|
|
61
|
+
paddingBottom: "var(--ds-space-050, 4px)"
|
|
62
|
+
});
|
|
63
|
+
const inputWrapperPosition = css({
|
|
64
|
+
position: 'relative'
|
|
65
|
+
});
|
|
66
66
|
export const messages = defineMessages({
|
|
67
67
|
displayText: {
|
|
68
68
|
id: 'fabric.editor.displayText',
|
|
@@ -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 = "78.
|
|
3
|
+
const packageVersion = "78.30.1";
|
|
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
|
|
@@ -6,6 +6,7 @@ import { ACTION_SUBJECT, ACTION_SUBJECT_ID } from '../analytics';
|
|
|
6
6
|
import { ErrorBoundary } from '../ui/ErrorBoundary';
|
|
7
7
|
import { browser } from '../utils';
|
|
8
8
|
import { analyticsEventKey, getPerformanceOptions, startMeasureReactNodeViewRendered, stopMeasureReactNodeViewRendered, ZERO_WIDTH_SPACE } from '../utils';
|
|
9
|
+
import { generateUniqueNodeKey } from './generateUniqueNodeKey';
|
|
9
10
|
export const inlineNodeViewClassname = 'inlineNodeView';
|
|
10
11
|
function createNodeView({
|
|
11
12
|
nodeViewParams,
|
|
@@ -17,6 +18,7 @@ function createNodeView({
|
|
|
17
18
|
// used for comparisions when doing updates, before being
|
|
18
19
|
// overwritten to the updated node.
|
|
19
20
|
let currentNode = nodeViewParams.node;
|
|
21
|
+
const key = generateUniqueNodeKey();
|
|
20
22
|
|
|
21
23
|
// First we setup the dom element which will be rendered and "tracked" by prosemirror
|
|
22
24
|
// and also used as a "editor portal" (not react portal) target by the editor
|
|
@@ -53,7 +55,7 @@ function createNodeView({
|
|
|
53
55
|
nodeViewParams,
|
|
54
56
|
Component,
|
|
55
57
|
extraComponentProps
|
|
56
|
-
}), domRef, false,
|
|
58
|
+
}), domRef, key, false,
|
|
57
59
|
// node views should be rendered with intl context
|
|
58
60
|
true);
|
|
59
61
|
}
|
|
@@ -112,7 +114,7 @@ function createNodeView({
|
|
|
112
114
|
// When prosemirror destroys the node view, we need to clean up
|
|
113
115
|
// what we have previously rendered using the editor portal
|
|
114
116
|
// provider api.
|
|
115
|
-
pmPluginFactoryParams.portalProviderAPI.remove(domRef);
|
|
117
|
+
pmPluginFactoryParams.portalProviderAPI.remove(key, domRef);
|
|
116
118
|
// @ts-expect-error Expect an error as domRef is expected to be
|
|
117
119
|
// of HTMLSpanElement type however once the node view has
|
|
118
120
|
// been destroyed no other consumers should still be using it.
|
|
@@ -6,6 +6,7 @@ import { createDispatch } from '../event-dispatcher';
|
|
|
6
6
|
import { ErrorBoundary } from '../ui/ErrorBoundary';
|
|
7
7
|
import { getPerformanceOptions, startMeasureReactNodeViewRendered, stopMeasureReactNodeViewRendered } from '../utils';
|
|
8
8
|
import { analyticsEventKey } from '../utils/analytics';
|
|
9
|
+
import { generateUniqueNodeKey } from './generateUniqueNodeKey';
|
|
9
10
|
export { getInlineNodeViewProducer, inlineNodeViewClassname } from './getInlineNodeViewProducer';
|
|
10
11
|
export default class ReactNodeView {
|
|
11
12
|
constructor(_node, view, getPos, portalProviderAPI, eventDispatcher, reactComponentProps, reactComponent, hasAnalyticsContext = false, viewShouldUpdate, hasIntlContext = false) {
|
|
@@ -29,6 +30,7 @@ export default class ReactNodeView {
|
|
|
29
30
|
this._viewShouldUpdate = viewShouldUpdate;
|
|
30
31
|
this.eventDispatcher = eventDispatcher;
|
|
31
32
|
this.hasIntlContext = hasIntlContext;
|
|
33
|
+
this.key = generateUniqueNodeKey();
|
|
32
34
|
}
|
|
33
35
|
|
|
34
36
|
/**
|
|
@@ -90,7 +92,7 @@ export default class ReactNodeView {
|
|
|
90
92
|
dispatchAnalyticsEvent: this.dispatchAnalyticsEvent
|
|
91
93
|
}, component());
|
|
92
94
|
};
|
|
93
|
-
this.portalProviderAPI.render(componentWithErrorBoundary, this.domRef, this.hasAnalyticsContext, this.hasIntlContext);
|
|
95
|
+
this.portalProviderAPI.render(componentWithErrorBoundary, this.domRef, this.key, this.hasAnalyticsContext, this.hasIntlContext);
|
|
94
96
|
}
|
|
95
97
|
createDomRef() {
|
|
96
98
|
if (!this.node.isInline) {
|
|
@@ -163,7 +165,7 @@ export default class ReactNodeView {
|
|
|
163
165
|
if (!this.domRef) {
|
|
164
166
|
return;
|
|
165
167
|
}
|
|
166
|
-
this.portalProviderAPI.remove(this.domRef);
|
|
168
|
+
this.portalProviderAPI.remove(this.key, this.domRef);
|
|
167
169
|
this.domRef = undefined;
|
|
168
170
|
this.contentDOM = undefined;
|
|
169
171
|
}
|
|
@@ -5,18 +5,18 @@ import { css, jsx } from '@emotion/react';
|
|
|
5
5
|
import { injectIntl } from 'react-intl-next';
|
|
6
6
|
import { N200, N400 } from '@atlaskit/theme/colors';
|
|
7
7
|
import { messages } from './messages';
|
|
8
|
-
const captionWrapperStyle = css
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
position: relative
|
|
12
|
-
color:
|
|
13
|
-
|
|
14
|
-
const placeholderStyle = css
|
|
15
|
-
color:
|
|
16
|
-
position: absolute
|
|
17
|
-
top: 0
|
|
18
|
-
width: 100
|
|
19
|
-
|
|
8
|
+
const captionWrapperStyle = css({
|
|
9
|
+
marginTop: "var(--ds-space-100, 8px)",
|
|
10
|
+
textAlign: 'center',
|
|
11
|
+
position: 'relative',
|
|
12
|
+
color: `var(--ds-text-subtle, ${N400})`
|
|
13
|
+
});
|
|
14
|
+
const placeholderStyle = css({
|
|
15
|
+
color: `var(--ds-text-subtlest, ${N200})`,
|
|
16
|
+
position: 'absolute',
|
|
17
|
+
top: 0,
|
|
18
|
+
width: '100%'
|
|
19
|
+
});
|
|
20
20
|
export class CaptionComponent extends React.Component {
|
|
21
21
|
render() {
|
|
22
22
|
const {
|
|
@@ -7,34 +7,36 @@ import { createAndFireEvent, withAnalyticsContext, withAnalyticsEvents } from '@
|
|
|
7
7
|
import { N0, N50A, N60A, N900 } from '@atlaskit/theme/colors';
|
|
8
8
|
import Layer from '../Layer';
|
|
9
9
|
const packageName = "@atlaskit/editor-common";
|
|
10
|
-
const packageVersion = "78.
|
|
10
|
+
const packageVersion = "78.30.1";
|
|
11
11
|
const halfFocusRing = 1;
|
|
12
12
|
const dropOffset = '0, 8';
|
|
13
13
|
class DropList extends Component {
|
|
14
14
|
constructor(...args) {
|
|
15
15
|
super(...args);
|
|
16
|
-
_defineProperty(this, "wrapperStyles", css
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
16
|
+
_defineProperty(this, "wrapperStyles", css({
|
|
17
|
+
display: this.props.shouldFitContainer ? 'block' : 'inline-flex',
|
|
18
|
+
flex: this.props.shouldFitContainer ? '1 1 auto' : undefined,
|
|
19
|
+
transitionDuration: '0.2s',
|
|
20
|
+
transition: 'box-shadow 0.15s cubic-bezier(0.47, 0.03, 0.49, 1.38)'
|
|
21
|
+
}));
|
|
22
|
+
_defineProperty(this, "triggerStyles", css({
|
|
23
|
+
transitionDuration: '0.2s',
|
|
24
|
+
transition: 'box-shadow 0.15s cubic-bezier(0.47, 0.03, 0.49, 1.38)',
|
|
25
|
+
display: this.props.shouldFitContainer ? 'block' : 'inline-flex',
|
|
26
|
+
boxSizing: this.props.shouldFitContainer ? 'border-box' : undefined
|
|
27
|
+
}));
|
|
26
28
|
/* eslint-disable @atlaskit/design-system/ensure-design-token-usage */
|
|
27
29
|
_defineProperty(this, "menuWrapper", () => {
|
|
28
|
-
return css
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
30
|
+
return css({
|
|
31
|
+
color: `var(--ds-text, ${N900})`,
|
|
32
|
+
backgroundColor: `var(--ds-surface-overlay, ${N0})`,
|
|
33
|
+
borderRadius: "var(--ds-border-radius, 3px)",
|
|
34
|
+
boxShadow: `var(--ds-shadow-overlay, ${`0 4px 8px calc(-1 * 2px) ${N50A}, 0 0 1px ${N60A}`})`,
|
|
35
|
+
boxSizing: 'border-box',
|
|
36
|
+
overflow: 'auto',
|
|
37
|
+
padding: `${"var(--ds-space-050, 4px)"} 0`,
|
|
38
|
+
maxHeight: '90vh'
|
|
39
|
+
});
|
|
38
40
|
});
|
|
39
41
|
/* eslint-enable @atlaskit/design-system/ensure-design-token-usage */
|
|
40
42
|
_defineProperty(this, "componentDidMount", () => {
|
|
@@ -44,31 +44,29 @@ export const ExpandIconWrapper = ({
|
|
|
44
44
|
css: () => expanded ? [expandIconWrapperStyle(), expandIconWrapperExpandedStyle] : expandIconWrapperStyle()
|
|
45
45
|
}, children);
|
|
46
46
|
};
|
|
47
|
-
const expandIconWrapperStyle = () => css
|
|
48
|
-
cursor: pointer
|
|
49
|
-
display: flex
|
|
50
|
-
color:
|
|
51
|
-
|
|
52
|
-
width: 24px
|
|
53
|
-
height: 24px
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
svg {
|
|
60
|
-
transition: transform 0.2s ${akEditorSwoopCubicBezier};
|
|
47
|
+
const expandIconWrapperStyle = () => css({
|
|
48
|
+
cursor: 'pointer',
|
|
49
|
+
display: 'flex',
|
|
50
|
+
color: `var(--ds-icon, ${N90})`,
|
|
51
|
+
borderRadius: "var(--ds-border-radius-100, 4px)",
|
|
52
|
+
width: '24px',
|
|
53
|
+
height: '24px',
|
|
54
|
+
'&:hover': {
|
|
55
|
+
background: `var(--ds-background-neutral-subtle-hovered, ${N30A})`
|
|
56
|
+
},
|
|
57
|
+
svg: {
|
|
58
|
+
transition: `transform 0.2s ${akEditorSwoopCubicBezier}`
|
|
61
59
|
}
|
|
62
|
-
|
|
63
|
-
const expandIconWrapperExpandedStyle = css
|
|
64
|
-
svg {
|
|
65
|
-
transform: rotate(90deg)
|
|
60
|
+
});
|
|
61
|
+
const expandIconWrapperExpandedStyle = css({
|
|
62
|
+
svg: {
|
|
63
|
+
transform: 'rotate(90deg)'
|
|
66
64
|
}
|
|
67
|
-
|
|
68
|
-
export const expandLayoutWrapperStyle = css
|
|
69
|
-
width:
|
|
70
|
-
height:
|
|
71
|
-
|
|
65
|
+
});
|
|
66
|
+
export const expandLayoutWrapperStyle = css({
|
|
67
|
+
width: "var(--ds-space-300, 24px)",
|
|
68
|
+
height: "var(--ds-space-300, 24px)"
|
|
69
|
+
});
|
|
72
70
|
export const ExpandLayoutWrapperWithRef = /*#__PURE__*/forwardRef((props, ref) => {
|
|
73
71
|
const {
|
|
74
72
|
children,
|
|
@@ -91,34 +89,31 @@ const containerStyles = styleProps => {
|
|
|
91
89
|
// and is the root level expand.
|
|
92
90
|
const marginHorizontal = styleProps['data-node-type'] === 'expand' ? `-${akLayoutGutterOffset}px` : 0;
|
|
93
91
|
const margin = `${marginTop} ${marginHorizontal} ${marginBottom}`;
|
|
94
|
-
return () => css
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
background:
|
|
101
|
-
margin:
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
padding: ${"var(--ds-space-100, 8px)"};
|
|
106
|
-
|
|
107
|
-
&:hover {
|
|
92
|
+
return () => css({
|
|
93
|
+
borderWidth: '1px',
|
|
94
|
+
borderStyle: 'solid',
|
|
95
|
+
borderColor: focused ? EXPAND_FOCUSED_BORDER_COLOR : expanded ? EXPAND_EXPANDED_BORDER_COLOR : EXPAND_COLLAPSED_BORDER_COLOR,
|
|
96
|
+
borderRadius: BORDER_RADIUS,
|
|
97
|
+
minHeight: '25px',
|
|
98
|
+
background: !expanded ? EXPAND_COLLAPSED_BACKGROUND : EXPAND_SELECTED_BACKGROUND,
|
|
99
|
+
margin: margin,
|
|
100
|
+
transition: `background 0.3s ${akEditorSwoopCubicBezier}, border-color 0.3s ${akEditorSwoopCubicBezier}`,
|
|
101
|
+
padding: "var(--ds-space-100, 8px)",
|
|
102
|
+
'&:hover': {
|
|
108
103
|
// TODO: Remove the border styles below once design tokens have been enabled and fallbacks are no longer triggered.
|
|
109
104
|
// This is because the default state already uses the same token and, as such, the hover style won't change anything.
|
|
110
105
|
// https://product-fabric.atlassian.net/browse/DSP-4152
|
|
111
|
-
border: 1px solid ${`var(--ds-border, ${N50A})`}
|
|
112
|
-
background:
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
td > style:first-child + * {
|
|
117
|
-
margin-top: 0;
|
|
106
|
+
border: `1px solid ${`var(--ds-border, ${N50A})`}`,
|
|
107
|
+
background: EXPAND_SELECTED_BACKGROUND
|
|
108
|
+
},
|
|
109
|
+
'td > :not(style):first-child, td > style:first-child + *': {
|
|
110
|
+
marginTop: 0
|
|
118
111
|
}
|
|
119
|
-
|
|
112
|
+
});
|
|
120
113
|
};
|
|
121
|
-
const contentStyles = styleProps => () =>
|
|
114
|
+
const contentStyles = styleProps => () =>
|
|
115
|
+
// eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression -- needs manual remediation
|
|
116
|
+
css`
|
|
122
117
|
padding-top: ${styleProps.expanded ? "var(--ds-space-100, 8px)" : "var(--ds-space-0, 0px)"};
|
|
123
118
|
padding-right: ${"var(--ds-space-100, 8px)"};
|
|
124
119
|
padding-left: ${"var(--ds-space-300, 24px)"};
|
|
@@ -146,40 +141,38 @@ const contentStyles = styleProps => () => css`
|
|
|
146
141
|
}
|
|
147
142
|
` : ''}
|
|
148
143
|
`;
|
|
149
|
-
const titleInputStyles = () => css
|
|
150
|
-
outline: none
|
|
151
|
-
border: none
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
color:
|
|
156
|
-
background: transparent
|
|
157
|
-
display: flex
|
|
158
|
-
flex: 1
|
|
159
|
-
padding: 0 0 0 ${"var(--ds-space-050, 4px)"}
|
|
160
|
-
width: 100
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
color: ${`var(--ds-text-subtlest, ${N200})`};
|
|
144
|
+
const titleInputStyles = () => css({
|
|
145
|
+
outline: 'none',
|
|
146
|
+
border: 'none',
|
|
147
|
+
fontSize: relativeFontSizeToBase16(fontSize()),
|
|
148
|
+
lineHeight: akEditorLineHeight,
|
|
149
|
+
fontWeight: 'normal',
|
|
150
|
+
color: `var(--ds-text-subtlest, ${N200A})`,
|
|
151
|
+
background: 'transparent',
|
|
152
|
+
display: 'flex',
|
|
153
|
+
flex: 1,
|
|
154
|
+
padding: `0 0 0 ${"var(--ds-space-050, 4px)"}`,
|
|
155
|
+
width: '100%',
|
|
156
|
+
'&::placeholder': {
|
|
157
|
+
opacity: 1,
|
|
158
|
+
color: `var(--ds-text-subtlest, ${N200})`
|
|
165
159
|
}
|
|
166
|
-
|
|
167
|
-
const titleContainerStyles = () => css
|
|
168
|
-
padding: 0
|
|
169
|
-
display: flex
|
|
170
|
-
|
|
171
|
-
background: none
|
|
172
|
-
border: none
|
|
173
|
-
|
|
174
|
-
width: 100
|
|
175
|
-
color:
|
|
176
|
-
overflow: hidden
|
|
177
|
-
cursor: pointer
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
outline: 0;
|
|
160
|
+
});
|
|
161
|
+
const titleContainerStyles = () => css({
|
|
162
|
+
padding: 0,
|
|
163
|
+
display: 'flex',
|
|
164
|
+
alignItems: 'flex-start',
|
|
165
|
+
background: 'none',
|
|
166
|
+
border: 'none',
|
|
167
|
+
fontSize: relativeFontSizeToBase16(fontSize()),
|
|
168
|
+
width: '100%',
|
|
169
|
+
color: `var(--ds-text-subtle, ${N300A})`,
|
|
170
|
+
overflow: 'hidden',
|
|
171
|
+
cursor: 'pointer',
|
|
172
|
+
'&:focus': {
|
|
173
|
+
outline: 0
|
|
181
174
|
}
|
|
182
|
-
|
|
175
|
+
});
|
|
183
176
|
export const sharedExpandStyles = {
|
|
184
177
|
titleInputStyles,
|
|
185
178
|
titleContainerStyles,
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
2
|
import { css, jsx } from '@emotion/react';
|
|
3
3
|
import { N30 } from '@atlaskit/theme/colors';
|
|
4
|
-
const separator = css
|
|
5
|
-
background:
|
|
6
|
-
width: 1px
|
|
7
|
-
height: 20px
|
|
8
|
-
margin: 0 ${"var(--ds-space-050, 4px)"}
|
|
9
|
-
|
|
10
|
-
|
|
4
|
+
const separator = css({
|
|
5
|
+
background: `var(--ds-border, ${N30})`,
|
|
6
|
+
width: '1px',
|
|
7
|
+
height: '20px',
|
|
8
|
+
margin: `0 ${"var(--ds-space-050, 4px)"}`,
|
|
9
|
+
alignSelf: 'center'
|
|
10
|
+
});
|
|
11
11
|
export default (() => jsx("div", {
|
|
12
12
|
css: separator,
|
|
13
13
|
className: "separator"
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
2
|
import { css, jsx } from '@emotion/react';
|
|
3
3
|
import EditIcon from '@atlaskit/icon/glyph/edit';
|
|
4
|
-
const editIconStyles = css
|
|
5
|
-
width: 20px
|
|
6
|
-
|
|
4
|
+
const editIconStyles = css({
|
|
5
|
+
width: '20px'
|
|
6
|
+
});
|
|
7
7
|
|
|
8
8
|
/* eslint-disable @atlaskit/design-system/consistent-css-prop-usage */
|
|
9
9
|
export const SmallerEditIcon = () => {
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { css } from '@emotion/react';
|
|
2
|
-
export const 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
|
-
|
|
2
|
+
export const 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
|
+
});
|
|
@@ -5,23 +5,23 @@ import SuccessIcon from '@atlaskit/icon/glyph/editor/success';
|
|
|
5
5
|
import ErrorIcon from '@atlaskit/icon/glyph/error';
|
|
6
6
|
import { G400, N200, R400 } from '@atlaskit/theme/colors';
|
|
7
7
|
import { h200 } from '@atlaskit/theme/typography';
|
|
8
|
-
const errorColor = css
|
|
9
|
-
color:
|
|
10
|
-
|
|
11
|
-
const validColor = css
|
|
12
|
-
color:
|
|
13
|
-
|
|
14
|
-
const messageStyle = () => css
|
|
15
|
-
|
|
16
|
-
color:
|
|
17
|
-
|
|
18
|
-
display: flex
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
const iconWrapperStyle = css
|
|
22
|
-
display: flex
|
|
23
|
-
|
|
24
|
-
|
|
8
|
+
const errorColor = css({
|
|
9
|
+
color: `var(--ds-text-danger, ${R400})`
|
|
10
|
+
});
|
|
11
|
+
const validColor = css({
|
|
12
|
+
color: `var(--ds-text-success, ${G400})`
|
|
13
|
+
});
|
|
14
|
+
const messageStyle = () => css(h200(), {
|
|
15
|
+
fontWeight: 'normal',
|
|
16
|
+
color: `var(--ds-text-subtlest, ${N200})`,
|
|
17
|
+
marginTop: "var(--ds-space-050, 4px)",
|
|
18
|
+
display: 'flex',
|
|
19
|
+
justifyContent: 'baseline'
|
|
20
|
+
});
|
|
21
|
+
const iconWrapperStyle = css({
|
|
22
|
+
display: 'flex',
|
|
23
|
+
marginRight: "var(--ds-space-050, 4px)"
|
|
24
|
+
});
|
|
25
25
|
export const HelperMessage = ({
|
|
26
26
|
children
|
|
27
27
|
}) => jsx("div", {
|
|
@@ -2,37 +2,33 @@ import { css } from '@emotion/react';
|
|
|
2
2
|
import { relativeFontSizeToBase16 } from '@atlaskit/editor-shared-styles';
|
|
3
3
|
import { B100, N100, N30, N400 } from '@atlaskit/theme/colors';
|
|
4
4
|
// Normal .className gets overridden by input[type=text] hence this hack to produce input.className
|
|
5
|
-
export const panelTextInput = css
|
|
6
|
-
input& {
|
|
7
|
-
background: transparent
|
|
8
|
-
border: 2px solid ${`var(--ds-border, ${N30})`}
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
color:
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
padding:
|
|
16
|
-
|
|
17
|
-
min-width: 145px;
|
|
18
|
-
|
|
5
|
+
export const panelTextInput = css({
|
|
6
|
+
'input&': {
|
|
7
|
+
background: 'transparent',
|
|
8
|
+
border: `2px solid ${`var(--ds-border, ${N30})`}`,
|
|
9
|
+
borderRadius: 0,
|
|
10
|
+
boxSizing: 'content-box',
|
|
11
|
+
color: `var(--ds-text-subtle, ${N400})`,
|
|
12
|
+
flexGrow: 1,
|
|
13
|
+
fontSize: relativeFontSizeToBase16(13),
|
|
14
|
+
lineHeight: '20px',
|
|
15
|
+
padding: `${"var(--ds-space-075, 6px)"} ${"var(--ds-space-400, 32px)"} ${"var(--ds-space-075, 6px)"} ${"var(--ds-space-100, 8px)"}`,
|
|
16
|
+
minWidth: '145px',
|
|
19
17
|
/* Hides IE10+ built-in [x] clear input button */
|
|
20
|
-
&::-ms-clear {
|
|
21
|
-
display: none
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
&::placeholder {
|
|
30
|
-
color: ${`var(--ds-text-subtlest, ${N100})`};
|
|
18
|
+
'&::-ms-clear': {
|
|
19
|
+
display: 'none'
|
|
20
|
+
},
|
|
21
|
+
'&:focus': {
|
|
22
|
+
outline: 'none',
|
|
23
|
+
borderColor: `var(--ds-border-focused, ${B100})`
|
|
24
|
+
},
|
|
25
|
+
'&::placeholder': {
|
|
26
|
+
color: `var(--ds-text-subtlest, ${N100})`
|
|
31
27
|
}
|
|
32
28
|
}
|
|
33
|
-
|
|
34
|
-
export const panelTextInputWithCustomWidth = width => css
|
|
35
|
-
input& {
|
|
36
|
-
width:
|
|
29
|
+
});
|
|
30
|
+
export const panelTextInputWithCustomWidth = width => css({
|
|
31
|
+
'input&': {
|
|
32
|
+
width: `${width}px`
|
|
37
33
|
}
|
|
38
|
-
|
|
34
|
+
});
|
|
@@ -19,9 +19,10 @@ export class PortalProviderAPI extends EventDispatcher {
|
|
|
19
19
|
this.onAnalyticsEvent = onAnalyticsEvent;
|
|
20
20
|
this.useAnalyticsContext = analyticsContext;
|
|
21
21
|
}
|
|
22
|
-
render(children, container, hasAnalyticsContext = false, hasIntlContext = false) {
|
|
22
|
+
render(children, container, key, hasAnalyticsContext = false, hasIntlContext = false) {
|
|
23
23
|
this.portals.set(container, {
|
|
24
|
-
|
|
24
|
+
key,
|
|
25
|
+
children,
|
|
25
26
|
hasAnalyticsContext,
|
|
26
27
|
hasIntlContext
|
|
27
28
|
});
|
|
@@ -57,7 +58,7 @@ export class PortalProviderAPI extends EventDispatcher {
|
|
|
57
58
|
unstable_renderSubtreeIntoContainer(this.context, wrappedChildren, container);
|
|
58
59
|
});
|
|
59
60
|
}
|
|
60
|
-
remove(container) {
|
|
61
|
+
remove(key, container) {
|
|
61
62
|
this.portals.delete(container);
|
|
62
63
|
|
|
63
64
|
// There is a race condition that can happen caused by Prosemirror vs React,
|