@atlaskit/editor-core 207.2.1 → 207.4.0
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 +33 -0
- package/dist/cjs/presets/default.js +8 -0
- package/dist/cjs/ui/Appearance/Chromeless.js +27 -11
- package/dist/cjs/ui/Appearance/Comment/Comment.js +25 -5
- package/dist/cjs/ui/Appearance/FullPage/FullPage.js +26 -4
- package/dist/cjs/ui/Appearance/FullPage/StyledComponents.js +2 -2
- package/dist/cjs/ui/ContentStyles/layout.js +2 -2
- package/dist/cjs/ui/ContextPanel/index.js +10 -4
- package/dist/cjs/ui/EditorContentContainer/EditorContentContainer.js +5 -3
- package/dist/cjs/ui/EditorContentContainer/styles/annotationStyles.js +45 -0
- package/dist/cjs/ui/EditorContentContainer/styles/embedCardStyles.js +34 -0
- package/dist/cjs/ui/EditorContentContainer/styles/mediaStyles.js +230 -0
- package/dist/cjs/version-wrapper.js +1 -1
- package/dist/es2019/presets/default.js +8 -0
- package/dist/es2019/ui/Appearance/Chromeless.js +28 -10
- package/dist/es2019/ui/Appearance/Comment/Comment.js +24 -3
- package/dist/es2019/ui/Appearance/FullPage/FullPage.js +24 -2
- package/dist/es2019/ui/Appearance/FullPage/StyledComponents.js +2 -2
- package/dist/es2019/ui/ContentStyles/layout.js +3 -2
- package/dist/es2019/ui/ContextPanel/index.js +11 -5
- package/dist/es2019/ui/EditorContentContainer/EditorContentContainer.js +8 -7
- package/dist/es2019/ui/EditorContentContainer/styles/annotationStyles.js +47 -0
- package/dist/es2019/ui/EditorContentContainer/styles/embedCardStyles.js +27 -0
- package/dist/es2019/ui/EditorContentContainer/styles/mediaStyles.js +357 -0
- package/dist/es2019/version-wrapper.js +1 -1
- package/dist/esm/presets/default.js +8 -0
- package/dist/esm/ui/Appearance/Chromeless.js +28 -12
- package/dist/esm/ui/Appearance/Comment/Comment.js +26 -6
- package/dist/esm/ui/Appearance/FullPage/FullPage.js +27 -5
- package/dist/esm/ui/Appearance/FullPage/StyledComponents.js +2 -2
- package/dist/esm/ui/ContentStyles/layout.js +2 -2
- package/dist/esm/ui/ContextPanel/index.js +11 -5
- package/dist/esm/ui/EditorContentContainer/EditorContentContainer.js +6 -4
- package/dist/esm/ui/EditorContentContainer/styles/annotationStyles.js +37 -0
- package/dist/esm/ui/EditorContentContainer/styles/embedCardStyles.js +27 -0
- package/dist/esm/ui/EditorContentContainer/styles/mediaStyles.js +224 -0
- package/dist/esm/version-wrapper.js +1 -1
- package/dist/types/presets/default.d.ts +14 -4
- package/dist/types/types/editor-props.d.ts +11 -10
- package/dist/types/ui/Appearance/Chromeless.d.ts +0 -4
- package/dist/types/ui/Appearance/FullPage/FullPage.d.ts +1 -1
- package/dist/types/ui/Appearance/FullPage/getEditorViewModeSync.d.ts +1 -1
- package/dist/types/ui/EditorContentContainer/styles/annotationStyles.d.ts +1 -0
- package/dist/types/ui/EditorContentContainer/styles/embedCardStyles.d.ts +1 -0
- package/dist/types/ui/EditorContentContainer/styles/mediaStyles.d.ts +1 -0
- package/dist/types-ts4.5/presets/default.d.ts +14 -4
- package/dist/types-ts4.5/types/editor-props.d.ts +11 -10
- package/dist/types-ts4.5/ui/Appearance/Chromeless.d.ts +0 -4
- package/dist/types-ts4.5/ui/Appearance/FullPage/FullPage.d.ts +1 -1
- package/dist/types-ts4.5/ui/Appearance/FullPage/getEditorViewModeSync.d.ts +1 -1
- package/dist/types-ts4.5/ui/EditorContentContainer/styles/annotationStyles.d.ts +1 -0
- package/dist/types-ts4.5/ui/EditorContentContainer/styles/embedCardStyles.d.ts +1 -0
- package/dist/types-ts4.5/ui/EditorContentContainer/styles/mediaStyles.d.ts +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { css } from '@emotion/react'; // eslint-disable-line @atlaskit/ui-styling-standard/use-compiled
|
|
2
|
+
|
|
3
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
|
|
4
|
+
export const embedCardStyles = css({
|
|
5
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
|
|
6
|
+
'.ProseMirror': {
|
|
7
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
|
|
8
|
+
".embedCardView-content-wrap[layout^='wrap-']": {
|
|
9
|
+
maxWidth: '100%',
|
|
10
|
+
position: 'relative',
|
|
11
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values, @atlaskit/ui-styling-standard/no-imported-style-values
|
|
12
|
+
zIndex: 2
|
|
13
|
+
},
|
|
14
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
|
|
15
|
+
".embedCardView-content-wrap[layout='wrap-left']": {
|
|
16
|
+
float: 'left'
|
|
17
|
+
},
|
|
18
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
|
|
19
|
+
".embedCardView-content-wrap[layout='wrap-right']": {
|
|
20
|
+
float: 'right'
|
|
21
|
+
},
|
|
22
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
|
|
23
|
+
".embedCardView-content-wrap[layout='wrap-right'] + .embedCardView-content-wrap[layout='wrap-left']": {
|
|
24
|
+
clear: 'both'
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
});
|
|
@@ -0,0 +1,357 @@
|
|
|
1
|
+
import { css } from '@emotion/react'; // eslint-disable-line @atlaskit/ui-styling-standard/use-compiled
|
|
2
|
+
|
|
3
|
+
import { INLINE_IMAGE_WRAPPER_CLASS_NAME } from '@atlaskit/editor-common/media-inline';
|
|
4
|
+
import { MediaSharedClassNames, richMediaClassName } from '@atlaskit/editor-common/styles';
|
|
5
|
+
import { akEditorMediaResizeHandlerPadding, akEditorMediaResizeHandlerPaddingWide, akEditorSelectedBorderBoldSize, akEditorSelectedBoxShadow, akEditorSelectedNodeClassName, akEditorWrappedNodeZIndex } from '@atlaskit/editor-shared-styles';
|
|
6
|
+
import { fileCardImageViewSelector, inlinePlayerClassName, newFileExperienceClassName } from '@atlaskit/media-card';
|
|
7
|
+
const wrappedMediaBreakoutPoint = 410;
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Reference Heights
|
|
11
|
+
*
|
|
12
|
+
* These heights enforce consistent sizes with media inline nodes due to
|
|
13
|
+
* inconsistencies with center aligned inline nodes and text.
|
|
14
|
+
*
|
|
15
|
+
* There is conversation about refactoring media inline nodes to conform to
|
|
16
|
+
* aligning correctly with the surrounding text.
|
|
17
|
+
*
|
|
18
|
+
* These constants originally came from `headingSizes` from the `theme` package
|
|
19
|
+
* and have been copied here to remove this package.
|
|
20
|
+
*/
|
|
21
|
+
const referenceHeights = {
|
|
22
|
+
p: 24 - 2,
|
|
23
|
+
h1: 32 + 4,
|
|
24
|
+
h2: 28 + 3,
|
|
25
|
+
h3: 24 + 1,
|
|
26
|
+
h4: 20 + 3,
|
|
27
|
+
h5: 16 + 4,
|
|
28
|
+
h6: 16 + 2
|
|
29
|
+
};
|
|
30
|
+
const inlineImageSelector = `> .mediaInlineView-content-wrap > .${INLINE_IMAGE_WRAPPER_CLASS_NAME}, > :is(a, span[data-mark-type='border']) .mediaInlineView-content-wrap > .${INLINE_IMAGE_WRAPPER_CLASS_NAME}, > .${INLINE_IMAGE_WRAPPER_CLASS_NAME}, > :is(a, span[data-mark-type='border']) .${INLINE_IMAGE_WRAPPER_CLASS_NAME}`;
|
|
31
|
+
|
|
32
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles,@atlaskit/ui-styling-standard/no-imported-style-values,@atlaskit/ui-styling-standard/no-unsafe-values
|
|
33
|
+
export const mediaStyles = css({
|
|
34
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
|
|
35
|
+
'.ProseMirror': {
|
|
36
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-values,@atlaskit/ui-styling-standard/no-imported-style-values
|
|
37
|
+
[`li .${richMediaClassName}`]: {
|
|
38
|
+
margin: 0
|
|
39
|
+
},
|
|
40
|
+
// Hack for chrome to fix media single position inside a list when media is the first child
|
|
41
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
|
|
42
|
+
'&.ua-chrome li > .mediaSingleView-content-wrap::before': {
|
|
43
|
+
content: "''",
|
|
44
|
+
display: 'block',
|
|
45
|
+
height: 0
|
|
46
|
+
},
|
|
47
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
|
|
48
|
+
'&.ua-firefox': {
|
|
49
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
|
|
50
|
+
'.mediaSingleView-content-wrap': {
|
|
51
|
+
userSelect: 'none'
|
|
52
|
+
},
|
|
53
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
|
|
54
|
+
'.captionView-content-wrap': {
|
|
55
|
+
userSelect: 'text'
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
|
|
59
|
+
".mediaSingleView-content-wrap[layout^='wrap-']": {
|
|
60
|
+
position: 'relative',
|
|
61
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values,@atlaskit/ui-styling-standard/no-imported-style-values
|
|
62
|
+
zIndex: akEditorWrappedNodeZIndex,
|
|
63
|
+
maxWidth: '100%',
|
|
64
|
+
/* overwrite default Prosemirror setting making it clear: both */
|
|
65
|
+
clear: 'inherit'
|
|
66
|
+
},
|
|
67
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
|
|
68
|
+
".mediaSingleView-content-wrap[layout='center']": {
|
|
69
|
+
clear: 'both'
|
|
70
|
+
},
|
|
71
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors,@atlaskit/ui-styling-standard/no-unsafe-values,@atlaskit/ui-styling-standard/no-imported-style-values
|
|
72
|
+
[`table .${richMediaClassName}`]: {
|
|
73
|
+
marginTop: "var(--ds-space-150, 12px)",
|
|
74
|
+
marginBottom: "var(--ds-space-150, 12px)",
|
|
75
|
+
clear: 'both',
|
|
76
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
|
|
77
|
+
'&.image-wrap-left[data-layout], &.image-wrap-right[data-layout]': {
|
|
78
|
+
clear: 'none',
|
|
79
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-selectors
|
|
80
|
+
'&:first-child': {
|
|
81
|
+
marginTop: "var(--ds-space-150, 12px)"
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
},
|
|
85
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors,@atlaskit/ui-styling-standard/no-unsafe-values,@atlaskit/ui-styling-standard/no-imported-style-values
|
|
86
|
+
[`.${richMediaClassName}.image-wrap-right + .${richMediaClassName}.image-wrap-left`]: {
|
|
87
|
+
clear: 'both'
|
|
88
|
+
},
|
|
89
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors,@atlaskit/ui-styling-standard/no-unsafe-values,@atlaskit/ui-styling-standard/no-imported-style-values
|
|
90
|
+
[`.${richMediaClassName}.image-wrap-left + .${richMediaClassName}.image-wrap-right, .${richMediaClassName}.image-wrap-right + .${richMediaClassName}.image-wrap-left, .${richMediaClassName}.image-wrap-left + .${richMediaClassName}.image-wrap-left, .${richMediaClassName}.image-wrap-right + .${richMediaClassName}.image-wrap-right`]: {
|
|
91
|
+
marginRight: 0,
|
|
92
|
+
marginLeft: 0
|
|
93
|
+
},
|
|
94
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values
|
|
95
|
+
[`@media all and (max-width: ${wrappedMediaBreakoutPoint}px)`]: {
|
|
96
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
|
|
97
|
+
"div.mediaSingleView-content-wrap[layout='wrap-left'], div.mediaSingleView-content-wrap[data-layout='wrap-left'], div.mediaSingleView-content-wrap[layout='wrap-right'], div.mediaSingleView-content-wrap[data-layout='wrap-right']": {
|
|
98
|
+
float: 'none',
|
|
99
|
+
overflow: 'auto',
|
|
100
|
+
margin: `${"var(--ds-space-150, 12px)"} 0`
|
|
101
|
+
}
|
|
102
|
+
},
|
|
103
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values,@atlaskit/ui-styling-standard/no-nested-selectors,@atlaskit/ui-styling-standard/no-unsafe-values
|
|
104
|
+
[`& [layout='full-width'] .${richMediaClassName}, & [layout='wide'] .${richMediaClassName}`]: {
|
|
105
|
+
// eslint-disable-next-line @atlaskit/design-system/use-tokens-space
|
|
106
|
+
marginLeft: '50%',
|
|
107
|
+
transform: 'translateX(-50%)'
|
|
108
|
+
},
|
|
109
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
|
|
110
|
+
".media-extended-resize-experience[layout^='wrap-']": {
|
|
111
|
+
// override 'overflow: auto' when viewport <= 410 set by mediaSingleSharedStyle
|
|
112
|
+
// to prevent scroll bar
|
|
113
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-important-styles
|
|
114
|
+
overflow: 'visible !important'
|
|
115
|
+
},
|
|
116
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
|
|
117
|
+
"& [layout^='wrap-'] + [layout^='wrap-']": {
|
|
118
|
+
clear: 'none',
|
|
119
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
|
|
120
|
+
"& + p, & + div[class^='fabric-editor-align'], & + ul, & + ol, & + h1, & + h2, & + h3, & + h4, & + h5, & + h6": {
|
|
121
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-important-styles,@atlaskit/ui-styling-standard/no-unsafe-values
|
|
122
|
+
clear: 'both !important'
|
|
123
|
+
},
|
|
124
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values,@atlaskit/ui-styling-standard/no-nested-selectors,@atlaskit/ui-styling-standard/no-unsafe-values
|
|
125
|
+
[`& .${richMediaClassName}`]: {
|
|
126
|
+
marginLeft: 0,
|
|
127
|
+
marginRight: 0
|
|
128
|
+
}
|
|
129
|
+
},
|
|
130
|
+
// Shifting the mediaInline image component (renders image) to align nicely with
|
|
131
|
+
// mediaInline (renders text) is a bit of a testing ground. This numbers represent
|
|
132
|
+
// shift in top and bottom and size adjustments to make up for lack of 1to1 size
|
|
133
|
+
// mapping
|
|
134
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values,@atlaskit/ui-styling-standard/no-nested-selectors,@atlaskit/ui-styling-standard/no-unsafe-values
|
|
135
|
+
[`.${INLINE_IMAGE_WRAPPER_CLASS_NAME}`]: {
|
|
136
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values
|
|
137
|
+
height: referenceHeights['p'],
|
|
138
|
+
transform: 'translateY(-2px)'
|
|
139
|
+
},
|
|
140
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
|
|
141
|
+
h1: {
|
|
142
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors,@atlaskit/ui-styling-standard/no-unsafe-values
|
|
143
|
+
[inlineImageSelector]: {
|
|
144
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values
|
|
145
|
+
height: referenceHeights.h1,
|
|
146
|
+
transform: `translateY(-3px)`
|
|
147
|
+
}
|
|
148
|
+
},
|
|
149
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
|
|
150
|
+
h2: {
|
|
151
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors,@atlaskit/ui-styling-standard/no-unsafe-values
|
|
152
|
+
[inlineImageSelector]: {
|
|
153
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values
|
|
154
|
+
height: referenceHeights.h2,
|
|
155
|
+
transform: `translateY(-3px)`
|
|
156
|
+
}
|
|
157
|
+
},
|
|
158
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
|
|
159
|
+
h3: {
|
|
160
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors,@atlaskit/ui-styling-standard/no-unsafe-values
|
|
161
|
+
[inlineImageSelector]: {
|
|
162
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values
|
|
163
|
+
height: referenceHeights.h3,
|
|
164
|
+
transform: `translateY(-2px)`
|
|
165
|
+
}
|
|
166
|
+
},
|
|
167
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
|
|
168
|
+
h4: {
|
|
169
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors,@atlaskit/ui-styling-standard/no-unsafe-values
|
|
170
|
+
[inlineImageSelector]: {
|
|
171
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values
|
|
172
|
+
height: referenceHeights.h4,
|
|
173
|
+
transform: `translateY(-2px)`
|
|
174
|
+
}
|
|
175
|
+
},
|
|
176
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
|
|
177
|
+
h5: {
|
|
178
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors,@atlaskit/ui-styling-standard/no-unsafe-values
|
|
179
|
+
[inlineImageSelector]: {
|
|
180
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values
|
|
181
|
+
height: referenceHeights.h5,
|
|
182
|
+
transform: `translateY(-2px)`
|
|
183
|
+
}
|
|
184
|
+
},
|
|
185
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
|
|
186
|
+
h6: {
|
|
187
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors,@atlaskit/ui-styling-standard/no-unsafe-values
|
|
188
|
+
[inlineImageSelector]: {
|
|
189
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values
|
|
190
|
+
height: referenceHeights.h6,
|
|
191
|
+
transform: `translateY(-2px)`
|
|
192
|
+
}
|
|
193
|
+
},
|
|
194
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
|
|
195
|
+
".mediaSingleView-content-wrap[layout='wrap-left']": {
|
|
196
|
+
float: 'left'
|
|
197
|
+
},
|
|
198
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
|
|
199
|
+
".mediaSingleView-content-wrap[layout='wrap-right']": {
|
|
200
|
+
float: 'right'
|
|
201
|
+
},
|
|
202
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
|
|
203
|
+
".mediaSingleView-content-wrap[layout='wrap-right'] + .mediaSingleView-content-wrap[layout='wrap-left']": {
|
|
204
|
+
clear: 'both'
|
|
205
|
+
},
|
|
206
|
+
// Larger margins for resize handlers when at depth 0 of the document
|
|
207
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
|
|
208
|
+
'& > .mediaSingleView-content-wrap': {
|
|
209
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
|
|
210
|
+
'.richMedia-resize-handle-right': {
|
|
211
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values,@atlaskit/ui-styling-standard/no-unsafe-values
|
|
212
|
+
marginRight: `-${akEditorMediaResizeHandlerPaddingWide}px`
|
|
213
|
+
},
|
|
214
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
|
|
215
|
+
'.richMedia-resize-handle-left': {
|
|
216
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values,@atlaskit/ui-styling-standard/no-unsafe-values
|
|
217
|
+
marginLeft: `-${akEditorMediaResizeHandlerPaddingWide}px`
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
},
|
|
221
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors,@atlaskit/ui-styling-standard/no-unsafe-values,@atlaskit/ui-styling-standard/no-imported-style-values
|
|
222
|
+
[`.${MediaSharedClassNames.FLOATING_TOOLBAR_COMPONENT}`]: {
|
|
223
|
+
padding: 0
|
|
224
|
+
},
|
|
225
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
|
|
226
|
+
'.richMedia-resize-handle-right, .richMedia-resize-handle-left': {
|
|
227
|
+
display: 'flex',
|
|
228
|
+
flexDirection: 'column',
|
|
229
|
+
/* vertical align */
|
|
230
|
+
justifyContent: 'center'
|
|
231
|
+
},
|
|
232
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
|
|
233
|
+
'.richMedia-resize-handle-right': {
|
|
234
|
+
alignItems: 'flex-end',
|
|
235
|
+
paddingRight: "var(--ds-space-150, 12px)",
|
|
236
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values,@atlaskit/ui-styling-standard/no-unsafe-values
|
|
237
|
+
marginRight: `-${akEditorMediaResizeHandlerPadding}px`
|
|
238
|
+
},
|
|
239
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
|
|
240
|
+
'.richMedia-resize-handle-left': {
|
|
241
|
+
alignItems: 'flex-start',
|
|
242
|
+
paddingLeft: "var(--ds-space-150, 12px)",
|
|
243
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values,@atlaskit/ui-styling-standard/no-unsafe-values
|
|
244
|
+
marginLeft: `-${akEditorMediaResizeHandlerPadding}px`
|
|
245
|
+
},
|
|
246
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
|
|
247
|
+
'.richMedia-resize-handle-right::after, .richMedia-resize-handle-left::after': {
|
|
248
|
+
content: "' '",
|
|
249
|
+
display: 'flex',
|
|
250
|
+
width: 3,
|
|
251
|
+
height: 64,
|
|
252
|
+
borderRadius: 6
|
|
253
|
+
},
|
|
254
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values,@atlaskit/ui-styling-standard/no-nested-selectors,@atlaskit/ui-styling-standard/no-unsafe-values
|
|
255
|
+
[`.${richMediaClassName}:hover .richMedia-resize-handle-left::after, .${richMediaClassName}:hover .richMedia-resize-handle-right::after`]: {
|
|
256
|
+
background: "var(--ds-border, #091E4224)"
|
|
257
|
+
},
|
|
258
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values,@atlaskit/ui-styling-standard/no-nested-selectors,@atlaskit/ui-styling-standard/no-unsafe-values
|
|
259
|
+
[`.${akEditorSelectedNodeClassName} .richMedia-resize-handle-right::after, .${akEditorSelectedNodeClassName} .richMedia-resize-handle-left::after, .${richMediaClassName} .richMedia-resize-handle-right:hover::after, .${richMediaClassName} .richMedia-resize-handle-left:hover::after, .${richMediaClassName}.is-resizing .richMedia-resize-handle-right::after, .${richMediaClassName}.is-resizing .richMedia-resize-handle-left::after`]: {
|
|
260
|
+
background: "var(--ds-border-focused, #388BFF)"
|
|
261
|
+
},
|
|
262
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
|
|
263
|
+
'.__resizable_base__': {
|
|
264
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-important-styles
|
|
265
|
+
left: 'unset !important',
|
|
266
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-important-styles
|
|
267
|
+
width: 'auto !important',
|
|
268
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-important-styles
|
|
269
|
+
height: 'auto !important'
|
|
270
|
+
},
|
|
271
|
+
// Danger when top level node for smart cards / inline links
|
|
272
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
|
|
273
|
+
'.danger > div > div > .media-card-frame, .danger > span > a': {
|
|
274
|
+
backgroundColor: "var(--ds-background-danger, #FFECEB)",
|
|
275
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values,@atlaskit/ui-styling-standard/no-unsafe-values
|
|
276
|
+
boxShadow: `0px 0px 0px ${akEditorSelectedBorderBoldSize}px, ${"var(--ds-border-danger, #E2483D)"}`,
|
|
277
|
+
transition: 'background-color 0s, box-shadow 0s'
|
|
278
|
+
},
|
|
279
|
+
// Danger when nested node or common
|
|
280
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
|
|
281
|
+
'.danger': {
|
|
282
|
+
// Media single
|
|
283
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values,@atlaskit/ui-styling-standard/no-nested-selectors,@atlaskit/ui-styling-standard/no-unsafe-values
|
|
284
|
+
[`.${richMediaClassName} .${fileCardImageViewSelector}::after`]: {
|
|
285
|
+
border: `1px solid ${"var(--ds-border-danger, #E2483D)"}`
|
|
286
|
+
},
|
|
287
|
+
// Media single video player
|
|
288
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values,@atlaskit/ui-styling-standard/no-nested-selectors,@atlaskit/ui-styling-standard/no-unsafe-values
|
|
289
|
+
[`.${richMediaClassName} .${inlinePlayerClassName}::after`]: {
|
|
290
|
+
border: `1px solid ${"var(--ds-border-danger, #E2483D)"}`
|
|
291
|
+
},
|
|
292
|
+
// New file experience
|
|
293
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values,@atlaskit/ui-styling-standard/no-nested-selectors,@atlaskit/ui-styling-standard/no-unsafe-values
|
|
294
|
+
[`.${richMediaClassName} .${newFileExperienceClassName}`]: {
|
|
295
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-important-styles
|
|
296
|
+
boxShadow: `0 0 0 1px ${"var(--ds-border-danger, #E2483D)"} !important`
|
|
297
|
+
},
|
|
298
|
+
// Media resize legacy handlers
|
|
299
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
|
|
300
|
+
'.richMedia-resize-handle-right::after, .richMedia-resize-handle-left::after': {
|
|
301
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-important-styles
|
|
302
|
+
background: `${"var(--ds-icon-danger, #C9372C)"} !important`
|
|
303
|
+
},
|
|
304
|
+
// Media resize new handlers
|
|
305
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
|
|
306
|
+
'.resizer-handle-thumb': {
|
|
307
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-important-styles
|
|
308
|
+
background: `${"var(--ds-icon-danger, #C9372C)"} !important`
|
|
309
|
+
},
|
|
310
|
+
// Smart cards
|
|
311
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
|
|
312
|
+
'div div .media-card-frame, .inlineCardView-content-wrap > span > a': {
|
|
313
|
+
backgroundColor: `${"var(--ds-blanket-danger, #EF5C4814)"}`,
|
|
314
|
+
transition: `background-color 0s`
|
|
315
|
+
},
|
|
316
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
|
|
317
|
+
'div div .media-card-frame::after': {
|
|
318
|
+
boxShadow: 'none'
|
|
319
|
+
}
|
|
320
|
+
},
|
|
321
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
|
|
322
|
+
'.warning': {
|
|
323
|
+
// Media single
|
|
324
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values,@atlaskit/ui-styling-standard/no-nested-selectors,@atlaskit/ui-styling-standard/no-unsafe-values
|
|
325
|
+
[`.${richMediaClassName} .${fileCardImageViewSelector}::after`]: {
|
|
326
|
+
border: `1px solid ${"var(--ds-border-warning, #E56910)"}`
|
|
327
|
+
},
|
|
328
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values,@atlaskit/ui-styling-standard/no-nested-selectors,@atlaskit/ui-styling-standard/no-unsafe-values
|
|
329
|
+
[`.${richMediaClassName} .${inlinePlayerClassName}::after`]: {
|
|
330
|
+
border: `1px solid ${"var(--ds-border-warning, #E56910)"}`
|
|
331
|
+
},
|
|
332
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values,@atlaskit/ui-styling-standard/no-nested-selectors,@atlaskit/ui-styling-standard/no-unsafe-values
|
|
333
|
+
[`.${richMediaClassName} .${newFileExperienceClassName}`]: {
|
|
334
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-important-styles
|
|
335
|
+
boxShadow: `0 0 0 1px ${"var(--ds-border-warning, #E56910)"} !important`
|
|
336
|
+
},
|
|
337
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
|
|
338
|
+
'.resizer-handle-thumb': {
|
|
339
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-important-styles
|
|
340
|
+
background: `${"var(--ds-icon-warning, #E56910)"} !important`
|
|
341
|
+
}
|
|
342
|
+
},
|
|
343
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
|
|
344
|
+
'.media-filmstrip-list-item': {
|
|
345
|
+
cursor: 'pointer'
|
|
346
|
+
},
|
|
347
|
+
// When clicking drag handle, mediaGroup node will be selected. Hence we need to apply selected style to each media node
|
|
348
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values,@atlaskit/ui-styling-standard/no-nested-selectors,@atlaskit/ui-styling-standard/no-unsafe-values
|
|
349
|
+
[`.mediaGroupView-content-wrap.${akEditorSelectedNodeClassName} #newFileExperienceWrapper`]: {
|
|
350
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values,@atlaskit/ui-styling-standard/no-unsafe-values
|
|
351
|
+
boxShadow: akEditorSelectedBoxShadow
|
|
352
|
+
},
|
|
353
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
|
|
354
|
+
'.ak-editor-no-interaction #newFileExperienceWrapper': {
|
|
355
|
+
boxShadow: 'none'
|
|
356
|
+
}
|
|
357
|
+
});
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export const name = "@atlaskit/editor-core";
|
|
2
|
-
export const version = "207.
|
|
2
|
+
export const version = "207.4.0";
|
|
@@ -42,6 +42,8 @@ import { isFullPage as fullPageCheck } from '../utils/is-full-page';
|
|
|
42
42
|
/**
|
|
43
43
|
* Note: The order that presets are added determines
|
|
44
44
|
* their placement in the editor toolbar
|
|
45
|
+
* @param options
|
|
46
|
+
* @example
|
|
45
47
|
*/
|
|
46
48
|
export function createDefaultPreset(options) {
|
|
47
49
|
var _options$featureFlags, _options$featureFlags2;
|
|
@@ -68,6 +70,12 @@ export function createDefaultPreset(options) {
|
|
|
68
70
|
})]).add([codeBlockPlugin, options.codeBlock]);
|
|
69
71
|
return preset;
|
|
70
72
|
}
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
*
|
|
76
|
+
* @param props
|
|
77
|
+
* @example
|
|
78
|
+
*/
|
|
71
79
|
export function useDefaultPreset(props) {
|
|
72
80
|
var preset = createDefaultPreset(props);
|
|
73
81
|
return [preset];
|
|
@@ -14,7 +14,8 @@ import React, { Fragment } from 'react';
|
|
|
14
14
|
|
|
15
15
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
16
16
|
import { css, jsx } from '@emotion/react';
|
|
17
|
-
import { useSharedPluginState } from '@atlaskit/editor-common/hooks';
|
|
17
|
+
import { sharedPluginStateHookMigratorFactory, useSharedPluginState } from '@atlaskit/editor-common/hooks';
|
|
18
|
+
import { useSharedPluginStateSelector } from '@atlaskit/editor-common/use-shared-plugin-state-selector';
|
|
18
19
|
import { scrollbarStyles } from '@atlaskit/editor-shared-styles/scrollbar';
|
|
19
20
|
import { componentWithCondition } from '@atlaskit/platform-feature-flags-react';
|
|
20
21
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
@@ -53,6 +54,13 @@ var EditorContainer = componentWithCondition(function () {
|
|
|
53
54
|
exposure: true
|
|
54
55
|
});
|
|
55
56
|
}, EditorContentContainer, ContentArea);
|
|
57
|
+
var useEditorViewModePluginState = sharedPluginStateHookMigratorFactory(function (pluginInjectionApi) {
|
|
58
|
+
var _useSharedPluginState = useSharedPluginState(pluginInjectionApi, ['editorViewMode']),
|
|
59
|
+
editorViewModeState = _useSharedPluginState.editorViewModeState;
|
|
60
|
+
return editorViewModeState === null || editorViewModeState === void 0 ? void 0 : editorViewModeState.mode;
|
|
61
|
+
}, function (pluginInjectionApi) {
|
|
62
|
+
return useSharedPluginStateSelector(pluginInjectionApi, 'editorViewMode.mode');
|
|
63
|
+
});
|
|
56
64
|
|
|
57
65
|
/**
|
|
58
66
|
* Render the editor in a chromeless appearance.
|
|
@@ -91,8 +99,7 @@ var Editor = /*#__PURE__*/function (_React$Component) {
|
|
|
91
99
|
pluginHooks = _this$props.pluginHooks,
|
|
92
100
|
featureFlags = _this$props.featureFlags;
|
|
93
101
|
var maxContentSizeReached = Boolean(maxContentSize === null || maxContentSize === void 0 ? void 0 : maxContentSize.maxContentSizeReached);
|
|
94
|
-
var
|
|
95
|
-
editorViewModeState = _useSharedPluginState.editorViewModeState;
|
|
102
|
+
var editorViewMode = useEditorViewModePluginState(_this.props.editorAPI);
|
|
96
103
|
return jsx(WithFlash, {
|
|
97
104
|
animate: maxContentSizeReached
|
|
98
105
|
}, jsx("div", {
|
|
@@ -116,7 +123,7 @@ var Editor = /*#__PURE__*/function (_React$Component) {
|
|
|
116
123
|
, {
|
|
117
124
|
className: "ak-editor-content-area",
|
|
118
125
|
featureFlags: featureFlags,
|
|
119
|
-
viewMode:
|
|
126
|
+
viewMode: editorViewMode,
|
|
120
127
|
appearance: _this.appearance
|
|
121
128
|
}, customContentComponents && 'before' in customContentComponents ? customContentComponents.before : customContentComponents, jsx(PluginSlot, {
|
|
122
129
|
editorView: editorView,
|
|
@@ -140,12 +147,7 @@ var Editor = /*#__PURE__*/function (_React$Component) {
|
|
|
140
147
|
_inherits(Editor, _React$Component);
|
|
141
148
|
return _createClass(Editor, [{
|
|
142
149
|
key: "render",
|
|
143
|
-
value:
|
|
144
|
-
/**
|
|
145
|
-
*
|
|
146
|
-
* @example
|
|
147
|
-
*/
|
|
148
|
-
function render() {
|
|
150
|
+
value: function render() {
|
|
149
151
|
return jsx(RenderWithPluginState, {
|
|
150
152
|
editorAPI: this.props.editorAPI,
|
|
151
153
|
renderChrome: this.renderChrome
|
|
@@ -155,11 +157,25 @@ var Editor = /*#__PURE__*/function (_React$Component) {
|
|
|
155
157
|
}(React.Component);
|
|
156
158
|
_defineProperty(Editor, "displayName", 'ChromelessEditorAppearance');
|
|
157
159
|
export { Editor as default };
|
|
160
|
+
var useMaxContentSizePluginState = sharedPluginStateHookMigratorFactory(function (pluginInjectionApi) {
|
|
161
|
+
var _useSharedPluginState2 = useSharedPluginState(pluginInjectionApi, ['maxContentSize']),
|
|
162
|
+
maxContentSizeState = _useSharedPluginState2.maxContentSizeState;
|
|
163
|
+
return {
|
|
164
|
+
maxContentSizeState: maxContentSizeState
|
|
165
|
+
};
|
|
166
|
+
}, function (pluginInjectionApi) {
|
|
167
|
+
var maxContentSizeReached = useSharedPluginStateSelector(pluginInjectionApi, 'maxContentSize.maxContentSizeReached');
|
|
168
|
+
return {
|
|
169
|
+
maxContentSizeState: maxContentSizeReached === undefined ? undefined : {
|
|
170
|
+
maxContentSizeReached: maxContentSizeReached
|
|
171
|
+
}
|
|
172
|
+
};
|
|
173
|
+
});
|
|
158
174
|
function RenderWithPluginState(_ref3) {
|
|
159
175
|
var renderChrome = _ref3.renderChrome,
|
|
160
176
|
editorAPI = _ref3.editorAPI;
|
|
161
|
-
var
|
|
162
|
-
maxContentSizeState =
|
|
177
|
+
var _useMaxContentSizePlu = useMaxContentSizePluginState(editorAPI),
|
|
178
|
+
maxContentSizeState = _useMaxContentSizePlu.maxContentSizeState;
|
|
163
179
|
return jsx(Fragment, null, renderChrome({
|
|
164
180
|
maxContentSize: maxContentSizeState
|
|
165
181
|
}));
|
|
@@ -11,11 +11,12 @@ import classnames from 'classnames';
|
|
|
11
11
|
import { useIntl } from 'react-intl-next';
|
|
12
12
|
import ButtonGroup from '@atlaskit/button/button-group';
|
|
13
13
|
import Button from '@atlaskit/button/new';
|
|
14
|
-
import { useSharedPluginState } from '@atlaskit/editor-common/hooks';
|
|
14
|
+
import { sharedPluginStateHookMigratorFactory, useSharedPluginState } from '@atlaskit/editor-common/hooks';
|
|
15
15
|
import messages from '@atlaskit/editor-common/messages';
|
|
16
16
|
import { GRID_GUTTER } from '@atlaskit/editor-common/styles';
|
|
17
17
|
import { WidthConsumer, WidthProvider } from '@atlaskit/editor-common/ui';
|
|
18
18
|
import { ToolbarArrowKeyNavigationProvider } from '@atlaskit/editor-common/ui-menu';
|
|
19
|
+
import { useSharedPluginStateSelector } from '@atlaskit/editor-common/use-shared-plugin-state-selector';
|
|
19
20
|
import { tableCommentEditorStyles } from '@atlaskit/editor-plugins/table/ui/common-styles';
|
|
20
21
|
import { akEditorMobileBreakoutPoint } from '@atlaskit/editor-shared-styles';
|
|
21
22
|
import { componentWithCondition } from '@atlaskit/platform-feature-flags-react';
|
|
@@ -82,13 +83,32 @@ var EditorContainer = componentWithCondition(function () {
|
|
|
82
83
|
exposure: true
|
|
83
84
|
});
|
|
84
85
|
}, EditorContentContainer, ContentArea);
|
|
86
|
+
var useCommentEditorPluginsStates = sharedPluginStateHookMigratorFactory(function (pluginInjectionApi) {
|
|
87
|
+
return useSharedPluginState(pluginInjectionApi, ['maxContentSize', 'primaryToolbar', 'editorViewMode']);
|
|
88
|
+
}, function (pluginInjectionApi) {
|
|
89
|
+
var maxContentSizeReached = useSharedPluginStateSelector(pluginInjectionApi, 'maxContentSize.maxContentSizeReached');
|
|
90
|
+
var primaryToolbarComponents = useSharedPluginStateSelector(pluginInjectionApi, 'primaryToolbar.components');
|
|
91
|
+
var editorViewMode = useSharedPluginStateSelector(pluginInjectionApi, 'editorViewMode.mode');
|
|
92
|
+
return {
|
|
93
|
+
maxContentSizeState: maxContentSizeReached === undefined ? undefined : {
|
|
94
|
+
maxContentSizeReached: maxContentSizeReached
|
|
95
|
+
},
|
|
96
|
+
primaryToolbarState: !primaryToolbarComponents ? undefined : {
|
|
97
|
+
components: primaryToolbarComponents
|
|
98
|
+
},
|
|
99
|
+
editorViewModeState: !editorViewMode ? undefined : {
|
|
100
|
+
mode: editorViewMode
|
|
101
|
+
}
|
|
102
|
+
};
|
|
103
|
+
});
|
|
85
104
|
export var CommentEditorWithIntl = function CommentEditorWithIntl(props) {
|
|
86
105
|
var editorAPI = props.editorAPI;
|
|
87
|
-
var
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
106
|
+
var _useCommentEditorPlug = useCommentEditorPluginsStates(editorAPI),
|
|
107
|
+
maxContentSizeState = _useCommentEditorPlug.maxContentSizeState,
|
|
108
|
+
primaryToolbarState = _useCommentEditorPlug.primaryToolbarState,
|
|
109
|
+
editorViewModeState = _useCommentEditorPlug.editorViewModeState;
|
|
110
|
+
var _useSharedPluginState = useSharedPluginState(editorAPI, ['media']),
|
|
111
|
+
mediaState = _useSharedPluginState.mediaState;
|
|
92
112
|
var intl = useIntl();
|
|
93
113
|
var editorDOMElement = props.editorDOMElement,
|
|
94
114
|
editorView = props.editorView,
|
|
@@ -8,7 +8,7 @@ import React, { useEffect, useMemo, useRef, useState } from 'react';
|
|
|
8
8
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
9
9
|
import { css, jsx } from '@emotion/react';
|
|
10
10
|
import { browser } from '@atlaskit/editor-common/browser';
|
|
11
|
-
import { useSharedPluginState } from '@atlaskit/editor-common/hooks';
|
|
11
|
+
import { sharedPluginStateHookMigratorFactory, useSharedPluginState } from '@atlaskit/editor-common/hooks';
|
|
12
12
|
import { ContextPanelWidthProvider } from '@atlaskit/editor-common/ui';
|
|
13
13
|
import { useSharedPluginStateSelector } from '@atlaskit/editor-common/use-shared-plugin-state-selector';
|
|
14
14
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
@@ -55,6 +55,28 @@ var hasCustomComponents = function hasCustomComponents(components) {
|
|
|
55
55
|
}
|
|
56
56
|
return true;
|
|
57
57
|
};
|
|
58
|
+
var useFullPageEditorPluginsStates = sharedPluginStateHookMigratorFactory(function (pluginInjectionApi) {
|
|
59
|
+
return useSharedPluginState(pluginInjectionApi, ['editorViewMode', 'primaryToolbar', 'interaction']);
|
|
60
|
+
}, function (pluginInjectionApi) {
|
|
61
|
+
var primaryToolbarComponents = useSharedPluginStateSelector(pluginInjectionApi, 'primaryToolbar.components');
|
|
62
|
+
var editorViewMode = useSharedPluginStateSelector(pluginInjectionApi, 'editorViewMode.mode');
|
|
63
|
+
var showTopToolbar = useSharedPluginStateSelector(pluginInjectionApi, 'editorViewMode._showTopToolbar');
|
|
64
|
+
var hasHadInteraction = useSharedPluginStateSelector(pluginInjectionApi, 'interaction.hasHadInteraction');
|
|
65
|
+
var interactionState = useSharedPluginStateSelector(pluginInjectionApi, 'interaction.interactionState');
|
|
66
|
+
return {
|
|
67
|
+
primaryToolbarState: !primaryToolbarComponents ? undefined : {
|
|
68
|
+
components: primaryToolbarComponents
|
|
69
|
+
},
|
|
70
|
+
editorViewModeState: !editorViewMode ? undefined : {
|
|
71
|
+
mode: editorViewMode,
|
|
72
|
+
_showTopToolbar: showTopToolbar
|
|
73
|
+
},
|
|
74
|
+
interactionState: hasHadInteraction === undefined || interactionState === undefined ? undefined : {
|
|
75
|
+
hasHadInteraction: hasHadInteraction,
|
|
76
|
+
interactionState: interactionState
|
|
77
|
+
}
|
|
78
|
+
};
|
|
79
|
+
});
|
|
58
80
|
export var FullPageEditor = function FullPageEditor(props) {
|
|
59
81
|
var _scrollContentContain, _scrollContentContain2, _scrollContentContain3, _scrollContentContain4, _scrollContentContain5, _wrapperElementRef$cu;
|
|
60
82
|
var wrapperElementRef = useMemo(function () {
|
|
@@ -63,10 +85,10 @@ export var FullPageEditor = function FullPageEditor(props) {
|
|
|
63
85
|
var scrollContentContainerRef = useRef(null);
|
|
64
86
|
var showKeyline = useShowKeyline(scrollContentContainerRef);
|
|
65
87
|
var editorAPI = props.editorAPI;
|
|
66
|
-
var
|
|
67
|
-
editorViewModeState =
|
|
68
|
-
primaryToolbarState =
|
|
69
|
-
interactionState =
|
|
88
|
+
var _useFullPageEditorPlu = useFullPageEditorPluginsStates(editorAPI),
|
|
89
|
+
editorViewModeState = _useFullPageEditorPlu.editorViewModeState,
|
|
90
|
+
primaryToolbarState = _useFullPageEditorPlu.primaryToolbarState,
|
|
91
|
+
interactionState = _useFullPageEditorPlu.interactionState;
|
|
70
92
|
var viewMode = getEditorViewMode(editorViewModeState, props.preset);
|
|
71
93
|
var hasHadInteraction = fg('platform_editor_interaction_api_refactor') ? (interactionState === null || interactionState === void 0 ? void 0 : interactionState.interactionState) !== 'hasNotHadInteraction' : Boolean(interactionState === null || interactionState === void 0 ? void 0 : interactionState.hasHadInteraction);
|
|
72
94
|
var toolbarDocking = useSharedPluginStateSelector(editorAPI, 'selectionToolbar.toolbarDocking');
|
|
@@ -13,7 +13,7 @@ var SWOOP_ANIMATION = "0.5s ".concat(akEditorSwoopCubicBezier);
|
|
|
13
13
|
var getTotalPadding = function getTotalPadding() {
|
|
14
14
|
return akEditorGutterPaddingDynamic() * 2;
|
|
15
15
|
};
|
|
16
|
-
var
|
|
16
|
+
var AK_NESTED_DND_GUTTER_OFFSET = 8;
|
|
17
17
|
|
|
18
18
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
|
|
19
19
|
export var fullPageEditorWrapper = css({
|
|
@@ -119,7 +119,7 @@ var editorContentAreaContainerStyle = function editorContentAreaContainerStyle()
|
|
|
119
119
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
|
|
120
120
|
'[data-layout-section]': {
|
|
121
121
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
122
|
-
maxWidth: "calc(100% + ".concat((akLayoutGutterOffset + (fg('platform_editor_nested_dnd_styles_changes') ?
|
|
122
|
+
maxWidth: "calc(100% + ".concat((akLayoutGutterOffset + (fg('platform_editor_nested_dnd_styles_changes') ? AK_NESTED_DND_GUTTER_OFFSET : 0)) * 2, "px)")
|
|
123
123
|
}
|
|
124
124
|
}
|
|
125
125
|
});
|