@atlaskit/editor-common 64.0.0 → 66.0.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 +48 -0
- package/build/tsconfig.json +1 -2
- package/dist/cjs/i18n/cs.js +3 -3
- package/dist/cjs/i18n/da.js +3 -3
- package/dist/cjs/i18n/de.js +3 -3
- package/dist/cjs/i18n/en.js +27 -0
- package/dist/cjs/i18n/en_GB.js +27 -0
- package/dist/cjs/i18n/en_ZZ.js +27 -0
- package/dist/cjs/i18n/es.js +3 -3
- package/dist/cjs/i18n/fi.js +3 -3
- package/dist/cjs/i18n/fr.js +3 -3
- package/dist/cjs/i18n/hu.js +3 -3
- package/dist/cjs/i18n/it.js +3 -3
- package/dist/cjs/i18n/ja.js +3 -3
- package/dist/cjs/i18n/ko.js +3 -3
- package/dist/cjs/i18n/nb.js +3 -3
- package/dist/cjs/i18n/nl.js +3 -3
- package/dist/cjs/i18n/pl.js +3 -3
- package/dist/cjs/i18n/pt_BR.js +3 -3
- package/dist/cjs/i18n/ru.js +3 -3
- package/dist/cjs/i18n/sv.js +3 -3
- package/dist/cjs/i18n/th.js +3 -3
- package/dist/cjs/i18n/tr.js +3 -3
- package/dist/cjs/i18n/uk.js +3 -3
- package/dist/cjs/i18n/vi.js +3 -3
- package/dist/cjs/i18n/zh.js +3 -2
- package/dist/cjs/i18n/zh_TW.js +3 -3
- package/dist/cjs/index.js +1 -29
- package/dist/cjs/normalize-feature-flags.js +40 -4
- package/dist/cjs/styles/shared/annotation.js +25 -17
- package/dist/cjs/styles/shared/block-marks.js +2 -2
- package/dist/cjs/styles/shared/blockquote.js +2 -2
- package/dist/cjs/styles/shared/code-mark.js +9 -5
- package/dist/cjs/styles/shared/column-layout.js +2 -2
- package/dist/cjs/styles/shared/date.js +2 -2
- package/dist/cjs/styles/shared/headings.js +5 -2
- package/dist/cjs/styles/shared/indentation.js +2 -2
- package/dist/cjs/styles/shared/link.js +2 -2
- package/dist/cjs/styles/shared/lists.js +2 -2
- package/dist/cjs/styles/shared/media-single.js +2 -2
- package/dist/cjs/styles/shared/panel.js +7 -4
- package/dist/cjs/styles/shared/paragraph.js +2 -2
- package/dist/cjs/styles/shared/rule.js +5 -2
- package/dist/cjs/styles/shared/shadow.js +2 -2
- package/dist/cjs/styles/shared/table.js +37 -33
- package/dist/cjs/styles/shared/task-decision.js +2 -2
- package/dist/cjs/styles/shared/text-color.js +2 -2
- package/dist/cjs/styles/shared/whitespace.js +2 -2
- package/dist/cjs/ui/BaseTheme/index.js +27 -11
- package/dist/cjs/ui/Caption/index.js +10 -7
- package/dist/cjs/ui/Expand/index.js +84 -46
- package/dist/cjs/ui/{IntlNextErrorBoundary → IntlErrorBoundary}/index.js +9 -9
- package/dist/cjs/ui/MediaSingle/index.js +13 -8
- package/dist/cjs/ui/MediaSingle/link.js +4 -6
- package/dist/cjs/ui/MediaSingle/styled.js +23 -20
- package/dist/cjs/ui/Messages/index.js +25 -22
- package/dist/cjs/ui/Popup/index.js +15 -1
- package/dist/cjs/ui/UnsupportedBlock/index.js +9 -6
- package/dist/cjs/ui/UnsupportedInline/index.js +8 -6
- package/dist/cjs/ui/WidthProvider/index.js +8 -9
- package/dist/cjs/ui/clear-next-sibling-margin-top.js +4 -5
- package/dist/cjs/ui/index.js +24 -34
- package/dist/cjs/utils/compare-props.js +136 -0
- package/dist/cjs/utils/index.js +23 -1
- package/dist/cjs/utils/performance/hooks/use-component-render-tracking/index.js +47 -0
- package/dist/cjs/utils/validator.js +1 -1
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/i18n/cs.js +3 -3
- package/dist/es2019/i18n/da.js +3 -3
- package/dist/es2019/i18n/de.js +3 -3
- package/dist/es2019/i18n/en.js +19 -0
- package/dist/es2019/i18n/en_GB.js +19 -0
- package/dist/es2019/i18n/en_ZZ.js +19 -0
- package/dist/es2019/i18n/es.js +3 -3
- package/dist/es2019/i18n/fi.js +3 -3
- package/dist/es2019/i18n/fr.js +3 -3
- package/dist/es2019/i18n/hu.js +3 -3
- package/dist/es2019/i18n/it.js +3 -3
- package/dist/es2019/i18n/ja.js +3 -3
- package/dist/es2019/i18n/ko.js +3 -3
- package/dist/es2019/i18n/nb.js +3 -3
- package/dist/es2019/i18n/nl.js +3 -3
- package/dist/es2019/i18n/pl.js +3 -3
- package/dist/es2019/i18n/pt_BR.js +3 -3
- package/dist/es2019/i18n/ru.js +3 -3
- package/dist/es2019/i18n/sv.js +3 -3
- package/dist/es2019/i18n/th.js +3 -3
- package/dist/es2019/i18n/tr.js +3 -3
- package/dist/es2019/i18n/uk.js +3 -3
- package/dist/es2019/i18n/vi.js +3 -3
- package/dist/es2019/i18n/zh.js +3 -2
- package/dist/es2019/i18n/zh_TW.js +3 -3
- package/dist/es2019/index.js +2 -7
- package/dist/es2019/normalize-feature-flags.js +40 -4
- package/dist/es2019/styles/shared/annotation.js +11 -11
- package/dist/es2019/styles/shared/block-marks.js +1 -1
- package/dist/es2019/styles/shared/blockquote.js +1 -1
- package/dist/es2019/styles/shared/code-mark.js +14 -11
- package/dist/es2019/styles/shared/column-layout.js +1 -1
- package/dist/es2019/styles/shared/date.js +1 -1
- package/dist/es2019/styles/shared/headings.js +8 -8
- package/dist/es2019/styles/shared/indentation.js +1 -1
- package/dist/es2019/styles/shared/link.js +1 -1
- package/dist/es2019/styles/shared/lists.js +3 -1
- package/dist/es2019/styles/shared/media-single.js +1 -1
- package/dist/es2019/styles/shared/panel.js +15 -15
- package/dist/es2019/styles/shared/paragraph.js +1 -1
- package/dist/es2019/styles/shared/rule.js +3 -3
- package/dist/es2019/styles/shared/shadow.js +1 -1
- package/dist/es2019/styles/shared/table.js +23 -13
- package/dist/es2019/styles/shared/task-decision.js +1 -1
- package/dist/es2019/styles/shared/text-color.js +1 -1
- package/dist/es2019/styles/shared/whitespace.js +1 -1
- package/dist/es2019/ui/BaseTheme/index.js +16 -5
- package/dist/es2019/ui/Caption/index.js +11 -5
- package/dist/es2019/ui/Expand/index.js +97 -67
- package/dist/es2019/ui/{IntlNextErrorBoundary → IntlErrorBoundary}/index.js +1 -1
- package/dist/es2019/ui/MediaSingle/index.js +13 -9
- package/dist/es2019/ui/MediaSingle/link.js +3 -4
- package/dist/es2019/ui/MediaSingle/styled.js +13 -12
- package/dist/es2019/ui/Messages/index.js +30 -22
- package/dist/es2019/ui/Popup/index.js +16 -1
- package/dist/es2019/ui/UnsupportedBlock/index.js +9 -6
- package/dist/es2019/ui/UnsupportedInline/index.js +8 -5
- package/dist/es2019/ui/WidthProvider/index.js +10 -8
- package/dist/es2019/ui/clear-next-sibling-margin-top.js +2 -2
- package/dist/es2019/ui/index.js +4 -6
- package/dist/es2019/utils/compare-props.js +99 -0
- package/dist/es2019/utils/index.js +3 -1
- package/dist/es2019/utils/performance/hooks/use-component-render-tracking/index.js +36 -0
- package/dist/es2019/utils/validator.js +1 -1
- package/dist/es2019/version.json +1 -1
- package/dist/esm/i18n/cs.js +3 -3
- package/dist/esm/i18n/da.js +3 -3
- package/dist/esm/i18n/de.js +3 -3
- package/dist/esm/i18n/en.js +19 -0
- package/dist/esm/i18n/en_GB.js +19 -0
- package/dist/esm/i18n/en_ZZ.js +19 -0
- package/dist/esm/i18n/es.js +3 -3
- package/dist/esm/i18n/fi.js +3 -3
- package/dist/esm/i18n/fr.js +3 -3
- package/dist/esm/i18n/hu.js +3 -3
- package/dist/esm/i18n/it.js +3 -3
- package/dist/esm/i18n/ja.js +3 -3
- package/dist/esm/i18n/ko.js +3 -3
- package/dist/esm/i18n/nb.js +3 -3
- package/dist/esm/i18n/nl.js +3 -3
- package/dist/esm/i18n/pl.js +3 -3
- package/dist/esm/i18n/pt_BR.js +3 -3
- package/dist/esm/i18n/ru.js +3 -3
- package/dist/esm/i18n/sv.js +3 -3
- package/dist/esm/i18n/th.js +3 -3
- package/dist/esm/i18n/tr.js +3 -3
- package/dist/esm/i18n/uk.js +3 -3
- package/dist/esm/i18n/vi.js +3 -3
- package/dist/esm/i18n/zh.js +3 -2
- package/dist/esm/i18n/zh_TW.js +3 -3
- package/dist/esm/index.js +2 -7
- package/dist/esm/normalize-feature-flags.js +39 -4
- package/dist/esm/styles/shared/annotation.js +21 -17
- package/dist/esm/styles/shared/block-marks.js +1 -1
- package/dist/esm/styles/shared/blockquote.js +1 -1
- package/dist/esm/styles/shared/code-mark.js +9 -6
- package/dist/esm/styles/shared/column-layout.js +1 -1
- package/dist/esm/styles/shared/date.js +1 -1
- package/dist/esm/styles/shared/headings.js +4 -2
- package/dist/esm/styles/shared/indentation.js +1 -1
- package/dist/esm/styles/shared/link.js +1 -1
- package/dist/esm/styles/shared/lists.js +2 -2
- package/dist/esm/styles/shared/media-single.js +1 -1
- package/dist/esm/styles/shared/panel.js +6 -4
- package/dist/esm/styles/shared/paragraph.js +1 -1
- package/dist/esm/styles/shared/rule.js +4 -2
- package/dist/esm/styles/shared/shadow.js +1 -1
- package/dist/esm/styles/shared/table.js +37 -33
- package/dist/esm/styles/shared/task-decision.js +1 -1
- package/dist/esm/styles/shared/text-color.js +1 -1
- package/dist/esm/styles/shared/whitespace.js +1 -1
- package/dist/esm/ui/BaseTheme/index.js +23 -12
- package/dist/esm/ui/Caption/index.js +10 -5
- package/dist/esm/ui/Expand/index.js +79 -42
- package/dist/esm/ui/{IntlNextErrorBoundary → IntlErrorBoundary}/index.js +7 -7
- package/dist/esm/ui/MediaSingle/index.js +14 -9
- package/dist/esm/ui/MediaSingle/link.js +2 -3
- package/dist/esm/ui/MediaSingle/styled.js +17 -10
- package/dist/esm/ui/Messages/index.js +26 -20
- package/dist/esm/ui/Popup/index.js +16 -1
- package/dist/esm/ui/UnsupportedBlock/index.js +9 -5
- package/dist/esm/ui/UnsupportedInline/index.js +8 -5
- package/dist/esm/ui/WidthProvider/index.js +7 -6
- package/dist/esm/ui/clear-next-sibling-margin-top.js +2 -2
- package/dist/esm/ui/index.js +4 -6
- package/dist/esm/utils/compare-props.js +115 -0
- package/dist/esm/utils/index.js +3 -1
- package/dist/esm/utils/performance/hooks/use-component-render-tracking/index.js +37 -0
- package/dist/esm/utils/validator.js +1 -1
- package/dist/esm/version.json +1 -1
- package/dist/types/__tests_external__/page-objects/Editor.d.ts +0 -1
- package/dist/types/__tests_external__/page-objects/EditorMedia.d.ts +0 -1
- package/dist/types/__tests_external__/page-objects/EditorSmartLink.d.ts +0 -1
- package/dist/types/__tests_external__/page-objects/Renderer.d.ts +0 -1
- package/dist/types/collab/types.d.ts +2 -2
- package/dist/types/extensions/types/field-definitions.d.ts +1 -1
- package/dist/types/i18n/cs.d.ts +2 -2
- package/dist/types/i18n/da.d.ts +2 -2
- package/dist/types/i18n/de.d.ts +2 -2
- package/dist/types/i18n/en.d.ts +19 -0
- package/dist/types/i18n/en_GB.d.ts +19 -0
- package/dist/types/i18n/en_ZZ.d.ts +19 -0
- package/dist/types/i18n/es.d.ts +2 -2
- package/dist/types/i18n/fi.d.ts +2 -2
- package/dist/types/i18n/fr.d.ts +2 -2
- package/dist/types/i18n/hu.d.ts +2 -2
- package/dist/types/i18n/it.d.ts +2 -2
- package/dist/types/i18n/ja.d.ts +2 -2
- package/dist/types/i18n/ko.d.ts +2 -2
- package/dist/types/i18n/nb.d.ts +2 -2
- package/dist/types/i18n/nl.d.ts +2 -2
- package/dist/types/i18n/pl.d.ts +2 -2
- package/dist/types/i18n/pt_BR.d.ts +2 -2
- package/dist/types/i18n/ru.d.ts +2 -2
- package/dist/types/i18n/sv.d.ts +2 -2
- package/dist/types/i18n/th.d.ts +2 -2
- package/dist/types/i18n/tr.d.ts +2 -2
- package/dist/types/i18n/uk.d.ts +2 -2
- package/dist/types/i18n/vi.d.ts +2 -2
- package/dist/types/i18n/zh.d.ts +2 -2
- package/dist/types/i18n/zh_TW.d.ts +2 -2
- package/dist/types/index.d.ts +1 -15
- package/dist/types/normalize-feature-flags.d.ts +6 -3
- package/dist/types/styles/shared/annotation.d.ts +5 -4
- package/dist/types/styles/shared/block-marks.d.ts +1 -1
- package/dist/types/styles/shared/blockquote.d.ts +1 -1
- package/dist/types/styles/shared/code-mark.d.ts +2 -1
- package/dist/types/styles/shared/column-layout.d.ts +1 -1
- package/dist/types/styles/shared/date.d.ts +1 -1
- package/dist/types/styles/shared/headings.d.ts +2 -1
- package/dist/types/styles/shared/indentation.d.ts +1 -1
- package/dist/types/styles/shared/link.d.ts +1 -1
- package/dist/types/styles/shared/lists.d.ts +1 -1
- package/dist/types/styles/shared/media-single.d.ts +1 -1
- package/dist/types/styles/shared/panel.d.ts +1 -1
- package/dist/types/styles/shared/paragraph.d.ts +1 -1
- package/dist/types/styles/shared/rule.d.ts +2 -1
- package/dist/types/styles/shared/shadow.d.ts +1 -1
- package/dist/types/styles/shared/table.d.ts +2 -1
- package/dist/types/styles/shared/task-decision.d.ts +1 -1
- package/dist/types/styles/shared/text-color.d.ts +1 -1
- package/dist/types/styles/shared/whitespace.d.ts +1 -1
- package/dist/types/ui/Caption/index.d.ts +3 -1
- package/dist/types/ui/Expand/index.d.ts +12 -10
- package/dist/types/ui/{IntlNextErrorBoundary → IntlErrorBoundary}/index.d.ts +1 -1
- package/dist/types/ui/MediaSingle/index.d.ts +4 -2
- package/dist/types/ui/MediaSingle/link.d.ts +1 -2
- package/dist/types/ui/MediaSingle/styled.d.ts +10 -5
- package/dist/types/ui/Messages/index.d.ts +5 -3
- package/dist/types/ui/Popup/index.d.ts +3 -0
- package/dist/types/ui/UnsupportedBlock/index.d.ts +1 -0
- package/dist/types/ui/UnsupportedInline/index.d.ts +1 -0
- package/dist/types/ui/WidthProvider/index.d.ts +3 -1
- package/dist/types/ui/clear-next-sibling-margin-top.d.ts +1 -2
- package/dist/types/ui/index.d.ts +4 -6
- package/dist/types/utils/compare-props.d.ts +32 -0
- package/dist/types/utils/getModeFromTheme.d.ts +1 -1
- package/dist/types/utils/index.d.ts +4 -0
- package/dist/types/utils/performance/hooks/use-component-render-tracking/index.d.ts +19 -0
- package/package.json +17 -17
- package/dist/cjs/ui/IntlLegacyFallbackProvider/index.js +0 -60
- package/dist/cjs/ui/LegacyToNextIntlProvider/index.js +0 -67
- package/dist/es2019/ui/IntlLegacyFallbackProvider/index.js +0 -21
- package/dist/es2019/ui/LegacyToNextIntlProvider/index.js +0 -24
- package/dist/esm/ui/IntlLegacyFallbackProvider/index.js +0 -45
- package/dist/esm/ui/LegacyToNextIntlProvider/index.js +0 -51
- package/dist/types/ui/IntlLegacyFallbackProvider/index.d.ts +0 -8
- package/dist/types/ui/LegacyToNextIntlProvider/index.d.ts +0 -8
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { css } from '
|
|
1
|
+
import { css } from '@emotion/react';
|
|
2
2
|
import { PanelType } from '@atlaskit/adf-schema';
|
|
3
3
|
import { akEditorTableCellMinWidth, blockNodesVerticalMargin } from '@atlaskit/editor-shared-styles';
|
|
4
4
|
import { akEditorCustomIconSize } from '@atlaskit/editor-shared-styles/consts';
|
|
@@ -173,7 +173,7 @@ const mainDynamicStyles = panelType => props => {
|
|
|
173
173
|
`;
|
|
174
174
|
};
|
|
175
175
|
|
|
176
|
-
export const panelSharedStyles = css`
|
|
176
|
+
export const panelSharedStyles = props => css`
|
|
177
177
|
.${PanelSharedCssClassName.prefix} {
|
|
178
178
|
border-radius: ${borderRadius()}px;
|
|
179
179
|
margin: ${blockNodesVerticalMargin} 0 0;
|
|
@@ -184,7 +184,7 @@ export const panelSharedStyles = css`
|
|
|
184
184
|
align-items: baseline;
|
|
185
185
|
word-break: break-word;
|
|
186
186
|
|
|
187
|
-
${mainDynamicStyles(PanelType.INFO)}
|
|
187
|
+
${mainDynamicStyles(PanelType.INFO)(props)}
|
|
188
188
|
|
|
189
189
|
.${PanelSharedCssClassName.icon} {
|
|
190
190
|
flex-shrink: 0;
|
|
@@ -197,7 +197,7 @@ export const panelSharedStyles = css`
|
|
|
197
197
|
-moz-user-select: none;
|
|
198
198
|
-webkit-user-select: none;
|
|
199
199
|
-ms-user-select: none;
|
|
200
|
-
${iconDynamicStyles(PanelType.INFO)}
|
|
200
|
+
${iconDynamicStyles(PanelType.INFO)(props)}
|
|
201
201
|
|
|
202
202
|
> span {
|
|
203
203
|
vertical-align: middle;
|
|
@@ -231,49 +231,49 @@ export const panelSharedStyles = css`
|
|
|
231
231
|
}
|
|
232
232
|
|
|
233
233
|
&[data-panel-type='${PanelType.NOTE}'] {
|
|
234
|
-
${mainDynamicStyles(PanelType.NOTE)}
|
|
234
|
+
${mainDynamicStyles(PanelType.NOTE)(props)}
|
|
235
235
|
|
|
236
236
|
.${PanelSharedCssClassName.icon} {
|
|
237
|
-
${iconDynamicStyles(PanelType.NOTE)}
|
|
237
|
+
${iconDynamicStyles(PanelType.NOTE)(props)}
|
|
238
238
|
}
|
|
239
239
|
}
|
|
240
240
|
|
|
241
241
|
&[data-panel-type='${PanelType.TIP}'] {
|
|
242
|
-
${mainDynamicStyles(PanelType.TIP)}
|
|
242
|
+
${mainDynamicStyles(PanelType.TIP)(props)}
|
|
243
243
|
|
|
244
244
|
.${PanelSharedCssClassName.icon} {
|
|
245
|
-
${iconDynamicStyles(PanelType.TIP)}
|
|
245
|
+
${iconDynamicStyles(PanelType.TIP)(props)}
|
|
246
246
|
}
|
|
247
247
|
}
|
|
248
248
|
|
|
249
249
|
&[data-panel-type='${PanelType.WARNING}'] {
|
|
250
|
-
${mainDynamicStyles(PanelType.WARNING)}
|
|
250
|
+
${mainDynamicStyles(PanelType.WARNING)(props)}
|
|
251
251
|
|
|
252
252
|
.${PanelSharedCssClassName.icon} {
|
|
253
|
-
${iconDynamicStyles(PanelType.WARNING)}
|
|
253
|
+
${iconDynamicStyles(PanelType.WARNING)(props)}
|
|
254
254
|
}
|
|
255
255
|
}
|
|
256
256
|
|
|
257
257
|
&[data-panel-type='${PanelType.ERROR}'] {
|
|
258
|
-
${mainDynamicStyles(PanelType.ERROR)}
|
|
258
|
+
${mainDynamicStyles(PanelType.ERROR)(props)}
|
|
259
259
|
|
|
260
260
|
.${PanelSharedCssClassName.icon} {
|
|
261
|
-
${iconDynamicStyles(PanelType.ERROR)}
|
|
261
|
+
${iconDynamicStyles(PanelType.ERROR)(props)}
|
|
262
262
|
}
|
|
263
263
|
}
|
|
264
264
|
|
|
265
265
|
&[data-panel-type='${PanelType.SUCCESS}'] {
|
|
266
|
-
${mainDynamicStyles(PanelType.SUCCESS)}
|
|
266
|
+
${mainDynamicStyles(PanelType.SUCCESS)(props)}
|
|
267
267
|
|
|
268
268
|
.${PanelSharedCssClassName.icon} {
|
|
269
|
-
${iconDynamicStyles(PanelType.SUCCESS)}
|
|
269
|
+
${iconDynamicStyles(PanelType.SUCCESS)(props)}
|
|
270
270
|
}
|
|
271
271
|
}
|
|
272
272
|
|
|
273
273
|
&[data-panel-type='${PanelType.CUSTOM}'] {
|
|
274
274
|
${themed({
|
|
275
275
|
dark: getPanelBackgroundDarkModeColors
|
|
276
|
-
})};
|
|
276
|
+
})(props)};
|
|
277
277
|
}
|
|
278
278
|
}
|
|
279
279
|
`;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { css } from '
|
|
1
|
+
import { css } from '@emotion/react';
|
|
2
2
|
import { akEditorLineHeight, blockNodesVerticalMargin } from '@atlaskit/editor-shared-styles'; // @see typography spreadsheet: https://docs.google.com/spreadsheets/d/1iYusRGCT4PoPfvxbJ8NrgjtfFgXLm5lpDWXzjua1W2E/edit#gid=93913128
|
|
3
3
|
|
|
4
4
|
export const paragraphSharedStyles = css`
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { css } from '
|
|
1
|
+
import { css } from '@emotion/react';
|
|
2
2
|
import { akEditorLineHeight } from '@atlaskit/editor-shared-styles';
|
|
3
3
|
import { DN50, N30A } from '@atlaskit/theme/colors';
|
|
4
4
|
import { themed } from '@atlaskit/theme/components';
|
|
@@ -7,10 +7,10 @@ const divider = themed({
|
|
|
7
7
|
dark: DN50
|
|
8
8
|
}); // @see typography spreadsheet: https://docs.google.com/spreadsheets/d/1iYusRGCT4PoPfvxbJ8NrgjtfFgXLm5lpDWXzjua1W2E/edit#gid=93913128
|
|
9
9
|
|
|
10
|
-
export const ruleSharedStyles = css`
|
|
10
|
+
export const ruleSharedStyles = props => css`
|
|
11
11
|
& hr {
|
|
12
12
|
border: none;
|
|
13
|
-
background-color: ${divider};
|
|
13
|
+
background-color: ${divider(props)};
|
|
14
14
|
margin: ${akEditorLineHeight}em 0;
|
|
15
15
|
height: 2px;
|
|
16
16
|
border-radius: 1px;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { css } from '
|
|
1
|
+
import { css } from '@emotion/react';
|
|
2
2
|
import { tableCellContentDomSelector, tableCellSelector, tableHeaderSelector, tablePrefixSelector } from '@atlaskit/adf-schema';
|
|
3
3
|
import { akEditorBreakoutPadding, akEditorFullWidthLayoutWidth, akEditorTableBorder, akEditorTableBorderDark, akEditorTableNumberColumnWidth, akEditorTableToolbar, akEditorTableToolbarDark, akEditorWideLayoutWidth, getTableCellBackgroundDarkModeColors, overflowShadow } from '@atlaskit/editor-shared-styles';
|
|
4
4
|
import { DN20 } from '@atlaskit/theme/colors';
|
|
@@ -26,7 +26,8 @@ export const TableSharedCssClassName = {
|
|
|
26
26
|
TABLE_CELL_WRAPPER: tableCellSelector,
|
|
27
27
|
TABLE_HEADER_CELL_WRAPPER: tableHeaderSelector
|
|
28
28
|
};
|
|
29
|
-
|
|
29
|
+
|
|
30
|
+
const tableSharedStyle = props => css`
|
|
30
31
|
.${TableSharedCssClassName.TABLE_CONTAINER} {
|
|
31
32
|
position: relative;
|
|
32
33
|
margin: 0 auto ${tableMarginBottom}px;
|
|
@@ -43,17 +44,25 @@ const tableSharedStyle = css`
|
|
|
43
44
|
padding-left: ${akEditorTableNumberColumnWidth - 1}px;
|
|
44
45
|
clear: both;
|
|
45
46
|
}
|
|
47
|
+
.${TableSharedCssClassName.TABLE_NODE_WRAPPER} > table {
|
|
48
|
+
margin: ${tableMarginTop}px 0 0 0;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.${TableSharedCssClassName.TABLE_CONTAINER} > table,
|
|
52
|
+
.${TableSharedCssClassName.TABLE_STICKY_WRAPPER} > table {
|
|
53
|
+
margin: ${tableMarginTop}px ${tableMarginSides}px 0 0;
|
|
54
|
+
}
|
|
55
|
+
|
|
46
56
|
/* avoid applying styles to nested tables (possible via extensions) */
|
|
47
57
|
.${TableSharedCssClassName.TABLE_CONTAINER} > table,
|
|
48
58
|
.${TableSharedCssClassName.TABLE_NODE_WRAPPER} > table,
|
|
49
59
|
.${TableSharedCssClassName.TABLE_STICKY_WRAPPER} > table {
|
|
50
60
|
border-collapse: collapse;
|
|
51
|
-
margin: ${tableMarginTop}px ${tableMarginSides}px 0 0;
|
|
52
61
|
border: ${tableCellBorderWidth}px solid
|
|
53
62
|
${themed({
|
|
54
63
|
light: akEditorTableBorder,
|
|
55
64
|
dark: akEditorTableBorderDark
|
|
56
|
-
})};
|
|
65
|
+
})(props)};
|
|
57
66
|
table-layout: fixed;
|
|
58
67
|
font-size: 1em;
|
|
59
68
|
width: 100%;
|
|
@@ -85,7 +94,7 @@ const tableSharedStyle = css`
|
|
|
85
94
|
${themed({
|
|
86
95
|
light: akEditorTableBorder,
|
|
87
96
|
dark: akEditorTableBorderDark
|
|
88
|
-
})};
|
|
97
|
+
})(props)};
|
|
89
98
|
border-right-width: 0;
|
|
90
99
|
border-bottom-width: 0;
|
|
91
100
|
padding: ${tableCellPadding}px;
|
|
@@ -94,7 +103,7 @@ const tableSharedStyle = css`
|
|
|
94
103
|
|
|
95
104
|
${themed({
|
|
96
105
|
dark: getTableCellBackgroundDarkModeColors
|
|
97
|
-
})};
|
|
106
|
+
})(props)};
|
|
98
107
|
|
|
99
108
|
> *:first-child {
|
|
100
109
|
margin-top: 0;
|
|
@@ -117,7 +126,7 @@ const tableSharedStyle = css`
|
|
|
117
126
|
background-color: ${themed({
|
|
118
127
|
light: akEditorTableToolbar,
|
|
119
128
|
dark: akEditorTableToolbarDark
|
|
120
|
-
})};
|
|
129
|
+
})(props)};
|
|
121
130
|
text-align: left;
|
|
122
131
|
|
|
123
132
|
/* only apply this styling to codeblocks in default background headercells */
|
|
@@ -128,7 +137,7 @@ const tableSharedStyle = css`
|
|
|
128
137
|
background: themed({
|
|
129
138
|
light: 'rgb(235, 237, 240)',
|
|
130
139
|
dark: 'rgb(36, 47, 66)'
|
|
131
|
-
}),
|
|
140
|
+
})(props),
|
|
132
141
|
width: `${gridSize()}px`
|
|
133
142
|
})};
|
|
134
143
|
background-attachment: local, scroll, scroll;
|
|
@@ -136,13 +145,13 @@ const tableSharedStyle = css`
|
|
|
136
145
|
background-color: ${themed({
|
|
137
146
|
light: 'rgb(235, 237, 240)',
|
|
138
147
|
dark: 'rgb(36, 47, 66)'
|
|
139
|
-
})};
|
|
148
|
+
})(props)};
|
|
140
149
|
|
|
141
150
|
.line-number-gutter {
|
|
142
151
|
background-color: ${themed({
|
|
143
152
|
light: 'rgb(226, 229, 233)',
|
|
144
153
|
dark: DN20
|
|
145
|
-
})};
|
|
154
|
+
})(props)};
|
|
146
155
|
}
|
|
147
156
|
|
|
148
157
|
/* this is only relevant to the element taken care of by renderer */
|
|
@@ -151,20 +160,20 @@ const tableSharedStyle = css`
|
|
|
151
160
|
background: themed({
|
|
152
161
|
light: 'rgb(235, 237, 240)',
|
|
153
162
|
dark: 'rgb(36, 47, 66)'
|
|
154
|
-
}),
|
|
163
|
+
})(props),
|
|
155
164
|
width: `${gridSize()}px`
|
|
156
165
|
})}!important;
|
|
157
166
|
|
|
158
167
|
background-color: ${themed({
|
|
159
168
|
light: 'rgb(235, 237, 240)',
|
|
160
169
|
dark: 'rgb(36, 47, 66)'
|
|
161
|
-
})}!important;
|
|
170
|
+
})(props)}!important;
|
|
162
171
|
|
|
163
172
|
// selector lives inside @atlaskit/code
|
|
164
173
|
--ds--code--line-number-bg-color: ${themed({
|
|
165
174
|
light: 'rgb(226, 229, 233)',
|
|
166
175
|
dark: DN20
|
|
167
|
-
})};
|
|
176
|
+
})(props)};
|
|
168
177
|
}
|
|
169
178
|
}
|
|
170
179
|
}
|
|
@@ -172,6 +181,7 @@ const tableSharedStyle = css`
|
|
|
172
181
|
}
|
|
173
182
|
}
|
|
174
183
|
`;
|
|
184
|
+
|
|
175
185
|
export const calcTableWidth = (layout, containerWidth, addControllerPadding = true) => {
|
|
176
186
|
switch (layout) {
|
|
177
187
|
case 'full-width':
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import React, { useMemo } from 'react';
|
|
2
|
-
import { ThemeProvider } from '
|
|
2
|
+
import { ThemeProvider } from '@emotion/react';
|
|
3
|
+
import { ThemeProvider as DeprecatedThemeProvider } from 'styled-components';
|
|
3
4
|
import { akEditorDefaultLayoutWidth } from '@atlaskit/editor-shared-styles';
|
|
4
|
-
import {
|
|
5
|
+
import { useGlobalTheme } from '@atlaskit/theme/components';
|
|
6
|
+
import { CHANNEL, fontSize } from '@atlaskit/theme/constants';
|
|
5
7
|
import { WidthConsumer } from '../WidthProvider';
|
|
6
8
|
|
|
7
9
|
function mapBreakpointToFontSize(breakpoint) {
|
|
@@ -35,13 +37,22 @@ export function BaseThemeWrapper({
|
|
|
35
37
|
baseFontSize,
|
|
36
38
|
children
|
|
37
39
|
}) {
|
|
40
|
+
const {
|
|
41
|
+
mode
|
|
42
|
+
} = useGlobalTheme();
|
|
38
43
|
const memoizedTheme = useMemo(() => ({
|
|
39
44
|
baseFontSize: dynamicTextSizing ? mapBreakpointToFontSize(breakpoint) : baseFontSize || mapBreakpointToFontSize('S'),
|
|
40
|
-
layoutMaxWidth: dynamicTextSizing ? mapBreakpointToLayoutMaxWidth(breakpoint) : akEditorDefaultLayoutWidth
|
|
41
|
-
|
|
45
|
+
layoutMaxWidth: dynamicTextSizing ? mapBreakpointToLayoutMaxWidth(breakpoint) : akEditorDefaultLayoutWidth,
|
|
46
|
+
// Below is used for editor dark mode.
|
|
47
|
+
[CHANNEL]: {
|
|
48
|
+
mode
|
|
49
|
+
}
|
|
50
|
+
}), [breakpoint, dynamicTextSizing, baseFontSize, mode]);
|
|
42
51
|
return /*#__PURE__*/React.createElement(ThemeProvider, {
|
|
43
52
|
theme: memoizedTheme
|
|
44
|
-
},
|
|
53
|
+
}, /*#__PURE__*/React.createElement(DeprecatedThemeProvider, {
|
|
54
|
+
theme: memoizedTheme
|
|
55
|
+
}, children));
|
|
45
56
|
}
|
|
46
57
|
export function BaseTheme({
|
|
47
58
|
children,
|
|
@@ -1,16 +1,18 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
+
|
|
3
|
+
/** @jsx jsx */
|
|
2
4
|
import React from 'react';
|
|
5
|
+
import { css, jsx } from '@emotion/react';
|
|
3
6
|
import { injectIntl } from 'react-intl-next';
|
|
4
|
-
import styled from 'styled-components';
|
|
5
7
|
import { N200, N400 } from '@atlaskit/theme/colors';
|
|
6
8
|
import { messages } from './messages';
|
|
7
|
-
const
|
|
9
|
+
const captionWrapperStyle = css`
|
|
8
10
|
margin-top: 8px;
|
|
9
11
|
text-align: center;
|
|
10
12
|
position: relative;
|
|
11
13
|
color: ${N400};
|
|
12
14
|
`;
|
|
13
|
-
const
|
|
15
|
+
const placeholderStyle = css`
|
|
14
16
|
color: ${N200};
|
|
15
17
|
position: absolute;
|
|
16
18
|
top: 0;
|
|
@@ -28,10 +30,14 @@ export class CaptionComponent extends React.Component {
|
|
|
28
30
|
}
|
|
29
31
|
} = this.props;
|
|
30
32
|
const showPlaceholder = !selected && !hasContent;
|
|
31
|
-
return
|
|
33
|
+
return jsx("div", _extends({
|
|
32
34
|
"data-media-caption": true,
|
|
33
35
|
"data-testid": "media-caption"
|
|
34
|
-
}, dataAttributes
|
|
36
|
+
}, dataAttributes, {
|
|
37
|
+
css: captionWrapperStyle
|
|
38
|
+
}), showPlaceholder ? jsx("p", {
|
|
39
|
+
css: placeholderStyle
|
|
40
|
+
}, formatMessage(messages.placeholder)) : null, children);
|
|
35
41
|
}
|
|
36
42
|
|
|
37
43
|
}
|
|
@@ -1,5 +1,9 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
+
|
|
3
|
+
/** @jsx jsx */
|
|
4
|
+
import React, { forwardRef } from 'react';
|
|
5
|
+
import { css, jsx } from '@emotion/react';
|
|
1
6
|
import { defineMessages } from 'react-intl-next';
|
|
2
|
-
import styled, { css } from 'styled-components';
|
|
3
7
|
import { akEditorLineHeight, akEditorSwoopCubicBezier, akLayoutGutterOffset, relativeFontSizeToBase16 } from '@atlaskit/editor-shared-styles';
|
|
4
8
|
import * as colors from '@atlaskit/theme/colors';
|
|
5
9
|
import { themed } from '@atlaskit/theme/components';
|
|
@@ -38,13 +42,22 @@ const EXPAND_EXPANDED_BORDER_COLOR = themed({
|
|
|
38
42
|
light: colors.N40A,
|
|
39
43
|
dark: colors.DN50
|
|
40
44
|
});
|
|
41
|
-
export const ExpandIconWrapper =
|
|
45
|
+
export const ExpandIconWrapper = ({
|
|
46
|
+
children,
|
|
47
|
+
expanded
|
|
48
|
+
}) => {
|
|
49
|
+
return jsx("div", {
|
|
50
|
+
css: props => expanded ? [expandIconWrapperStyle(props), expandIconWrapperExpandedStyle] : expandIconWrapperStyle(props)
|
|
51
|
+
}, children);
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
const expandIconWrapperStyle = props => css`
|
|
42
55
|
cursor: pointer;
|
|
43
56
|
display: flex;
|
|
44
57
|
color: ${themed({
|
|
45
58
|
light: colors.N90,
|
|
46
59
|
dark: '#d9dde3'
|
|
47
|
-
})};
|
|
60
|
+
})(props)};
|
|
48
61
|
border-radius: ${gridSize() / 2}px;
|
|
49
62
|
width: 24px;
|
|
50
63
|
height: 24px;
|
|
@@ -54,69 +67,85 @@ export const ExpandIconWrapper = styled.div`
|
|
|
54
67
|
}
|
|
55
68
|
|
|
56
69
|
svg {
|
|
57
|
-
${props => props.expanded ? 'transform: rotate(90deg);' : ''}
|
|
58
70
|
transition: transform 0.2s ${akEditorSwoopCubicBezier};
|
|
59
71
|
}
|
|
60
72
|
`;
|
|
61
|
-
|
|
73
|
+
|
|
74
|
+
const expandIconWrapperExpandedStyle = css`
|
|
75
|
+
svg {
|
|
76
|
+
transform: rotate(90deg);
|
|
77
|
+
}
|
|
78
|
+
`;
|
|
79
|
+
export const expandLayoutWrapperStyle = css`
|
|
62
80
|
width: ${gridSize() * 3}px;
|
|
63
81
|
height: ${gridSize() * 3}px;
|
|
64
82
|
`;
|
|
65
|
-
const
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
min-height: 25px;
|
|
77
|
-
background: ${({
|
|
78
|
-
expanded
|
|
79
|
-
}) => !expanded ? EXPAND_COLLAPSED_BACKGROUND : EXPAND_SELECTED_BACKGROUND};
|
|
80
|
-
margin: ${props => `${gridSize() / 2 / fontSize()}rem ${// Only only these margins if the expand isn't editable
|
|
81
|
-
// and is the root level expand.
|
|
82
|
-
props['data-node-type'] === 'expand' ? `-${akLayoutGutterOffset}px` : `0`} 0`};
|
|
83
|
+
export const ExpandLayoutWrapperWithRef = /*#__PURE__*/forwardRef((props, ref) => {
|
|
84
|
+
const {
|
|
85
|
+
children,
|
|
86
|
+
...rest
|
|
87
|
+
} = props;
|
|
88
|
+
return jsx("div", _extends({
|
|
89
|
+
css: expandLayoutWrapperStyle
|
|
90
|
+
}, rest, {
|
|
91
|
+
ref: ref
|
|
92
|
+
}), children);
|
|
93
|
+
});
|
|
83
94
|
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
95
|
+
const containerStyles = styleProps => {
|
|
96
|
+
const {
|
|
97
|
+
expanded,
|
|
98
|
+
focused
|
|
99
|
+
} = styleProps;
|
|
100
|
+
const marginTop = `${gridSize() / 2 / fontSize()}rem`;
|
|
101
|
+
const marginBottom = 0; // Only only these margins if the expand isn't editable
|
|
102
|
+
// and is the root level expand.
|
|
87
103
|
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
104
|
+
const marginHorizontal = styleProps['data-node-type'] === 'expand' ? `-${akLayoutGutterOffset}px` : 0;
|
|
105
|
+
const margin = `${marginTop} ${marginHorizontal} ${marginBottom}`;
|
|
106
|
+
return themeProps => css`
|
|
107
|
+
border-width: 1px;
|
|
108
|
+
border-style: solid;
|
|
109
|
+
border-color: ${focused ? EXPAND_FOCUSED_BORDER_COLOR : expanded ? EXPAND_EXPANDED_BORDER_COLOR(themeProps) : EXPAND_COLLAPSED_BORDER_COLOR};
|
|
110
|
+
border-radius: ${BORDER_RADIUS}px;
|
|
111
|
+
min-height: 25px;
|
|
112
|
+
background: ${!expanded ? EXPAND_COLLAPSED_BACKGROUND : EXPAND_SELECTED_BACKGROUND(themeProps)};
|
|
113
|
+
margin: ${margin};
|
|
114
|
+
|
|
115
|
+
transition: background 0.3s ${akEditorSwoopCubicBezier},
|
|
116
|
+
border-color 0.3s ${akEditorSwoopCubicBezier};
|
|
117
|
+
padding: ${gridSize()}px;
|
|
118
|
+
|
|
119
|
+
&:hover {
|
|
120
|
+
border: 1px solid
|
|
121
|
+
${themed({
|
|
122
|
+
light: colors.N50A,
|
|
123
|
+
dark: colors.DN50
|
|
124
|
+
})(themeProps)};
|
|
125
|
+
background: ${EXPAND_SELECTED_BACKGROUND(themeProps)};
|
|
126
|
+
}
|
|
95
127
|
|
|
96
|
-
|
|
97
|
-
|
|
128
|
+
td > &:first-child {
|
|
129
|
+
margin-top: 0;
|
|
130
|
+
}
|
|
131
|
+
`;
|
|
132
|
+
};
|
|
133
|
+
|
|
134
|
+
const contentStyles = styleProps => themeProps => css`
|
|
135
|
+
padding-top: ${styleProps.expanded ? gridSize() : 0}px;
|
|
136
|
+
padding-right: ${gridSize()}px;
|
|
137
|
+
padding-left: ${gridSize() * 4 - gridSize() / 2}px;
|
|
138
|
+
display: flow-root;
|
|
139
|
+
|
|
140
|
+
// The follow rules inside @supports block are added as a part of ED-8893
|
|
141
|
+
// The fix is targeting mobile bridge on iOS 12 or below,
|
|
142
|
+
// We should consider remove this fix when we no longer support iOS 12
|
|
143
|
+
@supports not (display: flow-root) {
|
|
144
|
+
width: 100%;
|
|
145
|
+
box-sizing: border-box;
|
|
98
146
|
}
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
${({
|
|
102
|
-
expanded
|
|
103
|
-
}) => {
|
|
104
|
-
return css`
|
|
105
|
-
padding-top: ${expanded ? gridSize() : 0}px;
|
|
106
|
-
padding-right: ${gridSize()}px;
|
|
107
|
-
padding-left: ${gridSize() * 4 - gridSize() / 2}px;
|
|
108
|
-
display: table;
|
|
109
|
-
display: flow-root;
|
|
110
|
-
|
|
111
|
-
// The follow rules inside @supports block are added as a part of ED-8893
|
|
112
|
-
// The fix is targeting mobile bridge on iOS 12 or below,
|
|
113
|
-
// We should consider remove this fix when we no longer support iOS 12
|
|
114
|
-
@supports not (display: flow-root) {
|
|
115
|
-
width: 100%;
|
|
116
|
-
box-sizing: border-box;
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
${!expanded ? `
|
|
147
|
+
|
|
148
|
+
${!styleProps.expanded ? `
|
|
120
149
|
.expand-content-wrapper, .nestedExpand-content-wrapper {
|
|
121
150
|
/* We visually hide the content here to preserve the content during copy+paste */
|
|
122
151
|
width: 100%;
|
|
@@ -128,10 +157,9 @@ const ContentStyles = css`
|
|
|
128
157
|
user-select: none;
|
|
129
158
|
}
|
|
130
159
|
` : ''}
|
|
131
|
-
`;
|
|
132
|
-
}};
|
|
133
160
|
`;
|
|
134
|
-
|
|
161
|
+
|
|
162
|
+
const titleInputStyles = props => css`
|
|
135
163
|
outline: none;
|
|
136
164
|
border: none;
|
|
137
165
|
font-size: ${relativeFontSizeToBase16(fontSize())};
|
|
@@ -140,7 +168,7 @@ const TitleInputStyles = css`
|
|
|
140
168
|
color: ${themed({
|
|
141
169
|
light: colors.N200A,
|
|
142
170
|
dark: colors.DN600
|
|
143
|
-
})};
|
|
171
|
+
})(props)};
|
|
144
172
|
background: transparent;
|
|
145
173
|
display: flex;
|
|
146
174
|
flex: 1;
|
|
@@ -152,10 +180,11 @@ const TitleInputStyles = css`
|
|
|
152
180
|
color: ${themed({
|
|
153
181
|
light: colors.N200A,
|
|
154
182
|
dark: colors.DN600
|
|
155
|
-
})};
|
|
183
|
+
})(props)};
|
|
156
184
|
}
|
|
157
185
|
`;
|
|
158
|
-
|
|
186
|
+
|
|
187
|
+
const titleContainerStyles = props => css`
|
|
159
188
|
padding: 0;
|
|
160
189
|
display: flex;
|
|
161
190
|
align-items: flex-start;
|
|
@@ -166,7 +195,7 @@ const TitleContainerStyles = css`
|
|
|
166
195
|
color: ${themed({
|
|
167
196
|
light: colors.N300A,
|
|
168
197
|
dark: colors.DN600
|
|
169
|
-
})};
|
|
198
|
+
})(props)};
|
|
170
199
|
overflow: hidden;
|
|
171
200
|
cursor: pointer;
|
|
172
201
|
// Prevent browser selection being inside the title container
|
|
@@ -176,9 +205,10 @@ const TitleContainerStyles = css`
|
|
|
176
205
|
outline: 0;
|
|
177
206
|
}
|
|
178
207
|
`;
|
|
208
|
+
|
|
179
209
|
export const sharedExpandStyles = {
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
210
|
+
titleInputStyles,
|
|
211
|
+
titleContainerStyles,
|
|
212
|
+
containerStyles,
|
|
213
|
+
contentStyles
|
|
184
214
|
};
|
|
@@ -9,7 +9,7 @@ const isMissingIntlProviderInAncestryError = err => {
|
|
|
9
9
|
return err === null || err === void 0 ? void 0 : (_err$toString = err.toString()) === null || _err$toString === void 0 ? void 0 : _err$toString.includes('<IntlProvider> needs to exist in the component ancestry');
|
|
10
10
|
};
|
|
11
11
|
|
|
12
|
-
export class
|
|
12
|
+
export class IntlErrorBoundary extends React.Component {
|
|
13
13
|
constructor(...args) {
|
|
14
14
|
super(...args);
|
|
15
15
|
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
+
/** @jsx jsx */
|
|
1
2
|
import React from 'react';
|
|
3
|
+
import { jsx } from '@emotion/react';
|
|
2
4
|
import classnames from 'classnames';
|
|
3
5
|
import { akEditorMediaResizeHandlerPaddingWide, DEFAULT_EMBED_CARD_WIDTH } from '@atlaskit/editor-shared-styles';
|
|
4
6
|
import { calcPxFromPct } from './grid';
|
|
5
|
-
import {
|
|
7
|
+
import { MediaSingleDimensionHelper, MediaWrapper } from './styled';
|
|
6
8
|
export const DEFAULT_IMAGE_WIDTH = 250;
|
|
7
9
|
export const DEFAULT_IMAGE_HEIGHT = 200;
|
|
8
10
|
export const wrappedLayouts = ['wrap-left', 'wrap-right', 'align-end', 'align-start'];
|
|
@@ -74,13 +76,15 @@ export default function MediaSingle({
|
|
|
74
76
|
}
|
|
75
77
|
|
|
76
78
|
const [media, caption] = children;
|
|
77
|
-
return
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
79
|
+
return jsx("div", {
|
|
80
|
+
ref: handleMediaSingleRef,
|
|
81
|
+
css: MediaSingleDimensionHelper({
|
|
82
|
+
width,
|
|
83
|
+
layout,
|
|
84
|
+
containerWidth,
|
|
85
|
+
pctWidth,
|
|
86
|
+
fullWidthMode
|
|
87
|
+
}),
|
|
84
88
|
"data-layout": layout,
|
|
85
89
|
"data-width": pctWidth,
|
|
86
90
|
"data-node-type": nodeType,
|
|
@@ -88,7 +92,7 @@ export default function MediaSingle({
|
|
|
88
92
|
'is-loading': isLoading,
|
|
89
93
|
'rich-media-wrapped': layout === 'wrap-left' || layout === 'wrap-right'
|
|
90
94
|
})
|
|
91
|
-
},
|
|
95
|
+
}, jsx(MediaWrapper, {
|
|
92
96
|
hasFallbackContainer: hasFallbackContainer,
|
|
93
97
|
height: mediaWrapperHeight,
|
|
94
98
|
paddingBottom: paddingBottom
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
export const
|
|
1
|
+
import { css } from '@emotion/react';
|
|
2
|
+
export const mediaLinkStyle = css`
|
|
3
3
|
position: absolute;
|
|
4
4
|
background: transparent;
|
|
5
5
|
top: 0;
|
|
@@ -9,5 +9,4 @@ export const MediaLink = styled.a`
|
|
|
9
9
|
cursor: pointer;
|
|
10
10
|
width: 100%;
|
|
11
11
|
height: 100%;
|
|
12
|
-
`;
|
|
13
|
-
MediaLink.displayName = 'MediaLink';
|
|
12
|
+
`;
|