@atlaskit/editor-common 63.0.1 → 66.0.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 +68 -0
- 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_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/{ui/IntlLegacyFallbackProvider → safe-plugin}/index.js +17 -35
- package/dist/cjs/styles/index.js +0 -8
- 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 +4 -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/types/collab.js +5 -0
- 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 +15 -8
- package/dist/cjs/ui/MediaSingle/link.js +4 -6
- package/dist/cjs/ui/MediaSingle/styled.js +23 -20
- package/dist/cjs/ui/Mention/index.js +1 -3
- package/dist/cjs/ui/Mention/mention-with-profilecard.js +33 -194
- package/dist/cjs/ui/Mention/mention-with-providers.js +1 -5
- 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_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/safe-plugin/index.js +10 -0
- package/dist/es2019/styles/index.js +0 -1
- package/dist/es2019/styles/shared/annotation.js +11 -11
- package/dist/es2019/styles/shared/block-marks.js +3 -2
- 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 +19 -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/types/collab.js +1 -0
- 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 +15 -9
- package/dist/es2019/ui/MediaSingle/link.js +3 -4
- package/dist/es2019/ui/MediaSingle/styled.js +13 -12
- package/dist/es2019/ui/Mention/index.js +1 -3
- package/dist/es2019/ui/Mention/mention-with-profilecard.js +33 -146
- package/dist/es2019/ui/Mention/mention-with-providers.js +1 -5
- 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_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/{ui/IntlLegacyFallbackProvider → safe-plugin}/index.js +13 -31
- package/dist/esm/styles/index.js +0 -1
- package/dist/esm/styles/shared/annotation.js +21 -17
- package/dist/esm/styles/shared/block-marks.js +2 -2
- 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 +3 -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/types/collab.js +1 -0
- 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 +16 -9
- package/dist/esm/ui/MediaSingle/link.js +2 -3
- package/dist/esm/ui/MediaSingle/styled.js +17 -10
- package/dist/esm/ui/Mention/index.js +1 -3
- package/dist/esm/ui/Mention/mention-with-profilecard.js +33 -189
- package/dist/esm/ui/Mention/mention-with-providers.js +1 -5
- 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 +14 -2
- package/dist/types/collab.d.ts +1 -1
- 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_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 -14
- package/dist/types/normalize-feature-flags.d.ts +6 -3
- package/dist/types/safe-plugin/index.d.ts +6 -0
- package/dist/types/styles/index.d.ts +0 -1
- 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/types/collab.d.ts +8 -0
- package/dist/types/types/index.d.ts +1 -0
- 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 -1
- package/dist/types/ui/MediaSingle/link.d.ts +1 -2
- package/dist/types/ui/MediaSingle/styled.d.ts +10 -5
- package/dist/types/ui/Mention/index.d.ts +0 -3
- package/dist/types/ui/Mention/mention-with-profilecard.d.ts +2 -25
- package/dist/types/ui/Mention/mention-with-providers.d.ts +0 -3
- 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 +5 -7
- 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 +20 -19
- package/safe-plugin/package.json +7 -0
- package/dist/cjs/styles/shared/inline-nodes.js +0 -17
- package/dist/cjs/ui/LegacyToNextIntlProvider/index.js +0 -67
- package/dist/es2019/styles/shared/inline-nodes.js +0 -7
- package/dist/es2019/ui/IntlLegacyFallbackProvider/index.js +0 -21
- package/dist/es2019/ui/LegacyToNextIntlProvider/index.js +0 -24
- package/dist/esm/styles/shared/inline-nodes.js +0 -7
- package/dist/esm/ui/LegacyToNextIntlProvider/index.js +0 -51
- package/dist/types/styles/shared/inline-nodes.d.ts +0 -2
- package/dist/types/ui/IntlLegacyFallbackProvider/index.d.ts +0 -8
- package/dist/types/ui/LegacyToNextIntlProvider/index.d.ts +0 -8
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
2
|
+
|
|
3
|
+
/** @jsx jsx */
|
|
2
4
|
import React from 'react';
|
|
5
|
+
import { jsx } from '@emotion/react';
|
|
3
6
|
import classnames from 'classnames';
|
|
4
7
|
import { akEditorMediaResizeHandlerPaddingWide, DEFAULT_EMBED_CARD_WIDTH } from '@atlaskit/editor-shared-styles';
|
|
5
8
|
import { calcPxFromPct } from './grid';
|
|
6
|
-
import {
|
|
9
|
+
import { MediaSingleDimensionHelper, MediaWrapper } from './styled';
|
|
7
10
|
export var DEFAULT_IMAGE_WIDTH = 250;
|
|
8
11
|
export var DEFAULT_IMAGE_HEIGHT = 200;
|
|
9
12
|
export var wrappedLayouts = ['wrap-left', 'wrap-right', 'align-end', 'align-start'];
|
|
@@ -26,7 +29,8 @@ export default function MediaSingle(_ref) {
|
|
|
26
29
|
fullWidthMode = _ref.fullWidthMode,
|
|
27
30
|
lineLength = _ref.lineLength,
|
|
28
31
|
_ref$hasFallbackConta = _ref.hasFallbackContainer,
|
|
29
|
-
hasFallbackContainer = _ref$hasFallbackConta === void 0 ? true : _ref$hasFallbackConta
|
|
32
|
+
hasFallbackContainer = _ref$hasFallbackConta === void 0 ? true : _ref$hasFallbackConta,
|
|
33
|
+
handleMediaSingleRef = _ref.handleMediaSingleRef;
|
|
30
34
|
var children = React.Children.toArray(propsChildren);
|
|
31
35
|
|
|
32
36
|
if (!pctWidth && shouldAddDefaultWrappedWidth(layout, width, lineLength)) {
|
|
@@ -80,12 +84,15 @@ export default function MediaSingle(_ref) {
|
|
|
80
84
|
media = _children[0],
|
|
81
85
|
caption = _children[1];
|
|
82
86
|
|
|
83
|
-
return
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
87
|
+
return jsx("div", {
|
|
88
|
+
ref: handleMediaSingleRef,
|
|
89
|
+
css: MediaSingleDimensionHelper({
|
|
90
|
+
width: width,
|
|
91
|
+
layout: layout,
|
|
92
|
+
containerWidth: containerWidth,
|
|
93
|
+
pctWidth: pctWidth,
|
|
94
|
+
fullWidthMode: fullWidthMode
|
|
95
|
+
}),
|
|
89
96
|
"data-layout": layout,
|
|
90
97
|
"data-width": pctWidth,
|
|
91
98
|
"data-node-type": nodeType,
|
|
@@ -93,7 +100,7 @@ export default function MediaSingle(_ref) {
|
|
|
93
100
|
'is-loading': isLoading,
|
|
94
101
|
'rich-media-wrapped': layout === 'wrap-left' || layout === 'wrap-right'
|
|
95
102
|
})
|
|
96
|
-
},
|
|
103
|
+
}, jsx(MediaWrapper, {
|
|
97
104
|
hasFallbackContainer: hasFallbackContainer,
|
|
98
105
|
height: mediaWrapperHeight,
|
|
99
106
|
paddingBottom: paddingBottom
|
|
@@ -2,6 +2,5 @@ import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral
|
|
|
2
2
|
|
|
3
3
|
var _templateObject;
|
|
4
4
|
|
|
5
|
-
import
|
|
6
|
-
export var
|
|
7
|
-
MediaLink.displayName = 'MediaLink';
|
|
5
|
+
import { css } from '@emotion/react';
|
|
6
|
+
export var mediaLinkStyle = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n position: absolute;\n background: transparent;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n cursor: pointer;\n width: 100%;\n height: 100%;\n"])));
|
|
@@ -1,8 +1,12 @@
|
|
|
1
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
1
2
|
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
3
|
+
var _excluded = ["children"];
|
|
2
4
|
|
|
3
|
-
var _templateObject, _templateObject2, _templateObject3
|
|
5
|
+
var _templateObject, _templateObject2, _templateObject3;
|
|
4
6
|
|
|
5
|
-
|
|
7
|
+
/** @jsx jsx */
|
|
8
|
+
import React from 'react';
|
|
9
|
+
import { css, jsx } from '@emotion/react';
|
|
6
10
|
import { akEditorFullPageMaxWidth, akEditorFullWidthLayoutWidth } from '@atlaskit/editor-shared-styles';
|
|
7
11
|
import { calcBreakoutWidth, calcWideWidth } from '../../utils/breakout';
|
|
8
12
|
|
|
@@ -140,12 +144,15 @@ var RenderFallbackContainer = function RenderFallbackContainer(_ref2) {
|
|
|
140
144
|
return css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n ", "\n"])), hasFallbackContainer ? "\n &::after {\n content: '';\n display: block;\n ".concat(height ? "height: ".concat(height, "px;") : paddingBottom ? "padding-bottom: ".concat(paddingBottom, ";") : '', "\n\n /* Fixes extra padding problem in Firefox */\n font-size: 0;\n line-height: 0;\n }\n ") : '');
|
|
141
145
|
};
|
|
142
146
|
|
|
143
|
-
export var
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
var
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
147
|
+
export var mediaWrapperStyle = function mediaWrapperStyle(props) {
|
|
148
|
+
return css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n position: relative;\n\n ", "\n\n /* Editor */\n & > figure {\n position: ", ";\n height: 100%;\n width: 100%;\n }\n\n & > div {\n position: ", ";\n height: 100%;\n width: 100%;\n }\n\n &[data-node-type='embedCard'] > div {\n width: 100%;\n }\n\n /* Renderer */\n [data-node-type='media'] {\n position: static !important;\n\n > div {\n position: absolute;\n height: 100%;\n }\n }\n"])), RenderFallbackContainer(props), props.hasFallbackContainer ? 'absolute' : 'relative', props.hasFallbackContainer ? 'absolute' : 'relative');
|
|
149
|
+
};
|
|
150
|
+
export var MediaWrapper = function MediaWrapper(_ref3) {
|
|
151
|
+
var children = _ref3.children,
|
|
152
|
+
rest = _objectWithoutProperties(_ref3, _excluded);
|
|
153
|
+
|
|
154
|
+
return jsx("div", {
|
|
155
|
+
css: mediaWrapperStyle(rest)
|
|
156
|
+
}, children);
|
|
157
|
+
};
|
|
151
158
|
MediaWrapper.displayName = 'WrapperMediaSingle';
|
|
@@ -31,7 +31,6 @@ var Mention = /*#__PURE__*/function (_PureComponent) {
|
|
|
31
31
|
accessLevel = _this$props.accessLevel,
|
|
32
32
|
eventHandlers = _this$props.eventHandlers,
|
|
33
33
|
id = _this$props.id,
|
|
34
|
-
portal = _this$props.portal,
|
|
35
34
|
text = _this$props.text;
|
|
36
35
|
var mentionProvider = providers.mentionProvider,
|
|
37
36
|
profilecardProvider = providers.profilecardProvider;
|
|
@@ -41,8 +40,7 @@ var Mention = /*#__PURE__*/function (_PureComponent) {
|
|
|
41
40
|
accessLevel: accessLevel,
|
|
42
41
|
eventHandlers: eventHandlers,
|
|
43
42
|
mentionProvider: mentionProvider,
|
|
44
|
-
profilecardProvider: profilecardProvider
|
|
45
|
-
portal: portal
|
|
43
|
+
profilecardProvider: profilecardProvider
|
|
46
44
|
});
|
|
47
45
|
});
|
|
48
46
|
|
|
@@ -1,190 +1,34 @@
|
|
|
1
|
-
import
|
|
2
|
-
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
3
|
-
import _createClass from "@babel/runtime/helpers/createClass";
|
|
4
|
-
import _assertThisInitialized from "@babel/runtime/helpers/assertThisInitialized";
|
|
5
|
-
import _inherits from "@babel/runtime/helpers/inherits";
|
|
6
|
-
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
7
|
-
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
8
|
-
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
9
|
-
|
|
10
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
11
|
-
|
|
12
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
13
|
-
|
|
14
|
-
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
15
|
-
|
|
16
|
-
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
17
|
-
|
|
18
|
-
import React, { PureComponent } from 'react';
|
|
19
|
-
import { findDOMNode } from 'react-dom';
|
|
1
|
+
import React, { useMemo } from 'react';
|
|
20
2
|
import { ResourcedMention } from '@atlaskit/mention';
|
|
21
|
-
import
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
});
|
|
54
|
-
|
|
55
|
-
_defineProperty(_assertThisInitialized(_this), "handleMentionNodeRef", function (component) {
|
|
56
|
-
if (!component) {
|
|
57
|
-
_this.domNode = null;
|
|
58
|
-
} else {
|
|
59
|
-
_this.domNode = findDOMNode(component);
|
|
60
|
-
}
|
|
61
|
-
});
|
|
62
|
-
|
|
63
|
-
_defineProperty(_assertThisInitialized(_this), "showProfilecard", function (event) {
|
|
64
|
-
if (!_this.domNode) {
|
|
65
|
-
return;
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
event.stopPropagation();
|
|
69
|
-
|
|
70
|
-
var _this$calculateLayerP = _this.calculateLayerPosition(),
|
|
71
|
-
_this$calculateLayerP2 = _slicedToArray(_this$calculateLayerP, 2),
|
|
72
|
-
popupAlignX = _this$calculateLayerP2[0],
|
|
73
|
-
popupAlignY = _this$calculateLayerP2[1];
|
|
74
|
-
|
|
75
|
-
_this.setState({
|
|
76
|
-
popupAlignX: popupAlignX,
|
|
77
|
-
popupAlignY: popupAlignY,
|
|
78
|
-
visible: true
|
|
79
|
-
});
|
|
80
|
-
});
|
|
81
|
-
|
|
82
|
-
_defineProperty(_assertThisInitialized(_this), "hideProfilecard", function () {
|
|
83
|
-
_this.setState({
|
|
84
|
-
visible: false
|
|
85
|
-
});
|
|
86
|
-
});
|
|
87
|
-
|
|
88
|
-
return _this;
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
_createClass(MentionWithProfileCard, [{
|
|
92
|
-
key: "calculateLayerPosition",
|
|
93
|
-
value: function calculateLayerPosition() {
|
|
94
|
-
var domNodeCentreCoords = this.getDomNodeCenterCoords();
|
|
95
|
-
var visibleAreaCentreCoords = this.getVisibleAreaCentreCoords();
|
|
96
|
-
var popupAlignY = domNodeCentreCoords.y > visibleAreaCentreCoords.y ? 'top' : 'bottom';
|
|
97
|
-
var popupAlignX = domNodeCentreCoords.x > visibleAreaCentreCoords.x ? 'right' : 'left';
|
|
98
|
-
return [popupAlignX, popupAlignY];
|
|
99
|
-
}
|
|
100
|
-
}, {
|
|
101
|
-
key: "getDomNodeCenterCoords",
|
|
102
|
-
value: function getDomNodeCenterCoords() {
|
|
103
|
-
var rect = this.domNode.getBoundingClientRect();
|
|
104
|
-
return {
|
|
105
|
-
x: rect.left + rect.width / 2,
|
|
106
|
-
y: rect.top + rect.height / 2
|
|
107
|
-
};
|
|
108
|
-
}
|
|
109
|
-
}, {
|
|
110
|
-
key: "getVisibleAreaCentreCoords",
|
|
111
|
-
value: function getVisibleAreaCentreCoords() {
|
|
112
|
-
return {
|
|
113
|
-
x: window.innerWidth / 2,
|
|
114
|
-
y: window.innerHeight / 2
|
|
115
|
-
};
|
|
116
|
-
}
|
|
117
|
-
}, {
|
|
118
|
-
key: "getActions",
|
|
119
|
-
value: function getActions(id, text, accessLevel) {
|
|
120
|
-
var _this2 = this;
|
|
121
|
-
|
|
122
|
-
var profilecardProvider = this.props.profilecardProvider;
|
|
123
|
-
var actions = profilecardProvider.getActions(id, text, accessLevel);
|
|
124
|
-
return actions.map(function (action) {
|
|
125
|
-
return _objectSpread(_objectSpread({}, action), {}, {
|
|
126
|
-
callback: function callback() {
|
|
127
|
-
_this2.setState({
|
|
128
|
-
visible: false
|
|
129
|
-
});
|
|
130
|
-
|
|
131
|
-
if (action && action.callback) {
|
|
132
|
-
action.callback();
|
|
133
|
-
}
|
|
134
|
-
}
|
|
135
|
-
});
|
|
136
|
-
});
|
|
137
|
-
}
|
|
138
|
-
}, {
|
|
139
|
-
key: "render",
|
|
140
|
-
value: function render() {
|
|
141
|
-
var _this$props = this.props,
|
|
142
|
-
accessLevel = _this$props.accessLevel,
|
|
143
|
-
id = _this$props.id,
|
|
144
|
-
mentionProvider = _this$props.mentionProvider,
|
|
145
|
-
profilecardProvider = _this$props.profilecardProvider,
|
|
146
|
-
text = _this$props.text,
|
|
147
|
-
onClick = _this$props.onClick,
|
|
148
|
-
onMouseEnter = _this$props.onMouseEnter,
|
|
149
|
-
onMouseLeave = _this$props.onMouseLeave,
|
|
150
|
-
portal = _this$props.portal;
|
|
151
|
-
var _this$state = this.state,
|
|
152
|
-
popupAlignX = _this$state.popupAlignX,
|
|
153
|
-
popupAlignY = _this$state.popupAlignY,
|
|
154
|
-
target = _this$state.target,
|
|
155
|
-
visible = _this$state.visible;
|
|
156
|
-
var cloudId = profilecardProvider.cloudId,
|
|
157
|
-
resourceClient = profilecardProvider.resourceClient;
|
|
158
|
-
return /*#__PURE__*/React.createElement("span", {
|
|
159
|
-
ref: this.handleRef,
|
|
160
|
-
onClick: this.showProfilecard
|
|
161
|
-
}, /*#__PURE__*/React.createElement(ResourcedMention, {
|
|
162
|
-
ref: this.handleMentionNodeRef,
|
|
163
|
-
id: id,
|
|
164
|
-
text: text,
|
|
165
|
-
accessLevel: accessLevel,
|
|
166
|
-
mentionProvider: mentionProvider,
|
|
167
|
-
onClick: onClick,
|
|
168
|
-
onMouseEnter: onMouseEnter,
|
|
169
|
-
onMouseLeave: onMouseLeave
|
|
170
|
-
}), target && portal && visible && /*#__PURE__*/React.createElement(Popup, {
|
|
171
|
-
offset: [0, 8],
|
|
172
|
-
target: target,
|
|
173
|
-
mountTo: portal,
|
|
174
|
-
alignX: popupAlignX,
|
|
175
|
-
alignY: popupAlignY
|
|
176
|
-
}, /*#__PURE__*/React.createElement(ProfilecardResourcedWithListeners, {
|
|
177
|
-
handleClickOutside: this.hideProfilecard,
|
|
178
|
-
handleEscapeKeydown: this.hideProfilecard,
|
|
179
|
-
cloudId: cloudId,
|
|
180
|
-
userId: id,
|
|
181
|
-
resourceClient: resourceClient,
|
|
182
|
-
actions: this.getActions(id, text, accessLevel)
|
|
183
|
-
})));
|
|
184
|
-
}
|
|
185
|
-
}]);
|
|
186
|
-
|
|
187
|
-
return MentionWithProfileCard;
|
|
188
|
-
}(PureComponent);
|
|
189
|
-
|
|
190
|
-
export { MentionWithProfileCard as default };
|
|
3
|
+
import { ProfileCardTrigger } from '@atlaskit/profilecard';
|
|
4
|
+
export default function MentionWithProfileCard(_ref) {
|
|
5
|
+
var id = _ref.id,
|
|
6
|
+
text = _ref.text,
|
|
7
|
+
accessLevel = _ref.accessLevel,
|
|
8
|
+
mentionProvider = _ref.mentionProvider,
|
|
9
|
+
profilecardProvider = _ref.profilecardProvider,
|
|
10
|
+
onClick = _ref.onClick,
|
|
11
|
+
onMouseEnter = _ref.onMouseEnter,
|
|
12
|
+
onMouseLeave = _ref.onMouseLeave;
|
|
13
|
+
var cloudId = profilecardProvider.cloudId,
|
|
14
|
+
resourceClient = profilecardProvider.resourceClient;
|
|
15
|
+
var actions = useMemo(function () {
|
|
16
|
+
return profilecardProvider.getActions(id, text, accessLevel);
|
|
17
|
+
}, [accessLevel, id, profilecardProvider, text]);
|
|
18
|
+
return /*#__PURE__*/React.createElement(ProfileCardTrigger, {
|
|
19
|
+
cloudId: cloudId,
|
|
20
|
+
userId: id,
|
|
21
|
+
resourceClient: resourceClient,
|
|
22
|
+
actions: actions,
|
|
23
|
+
trigger: "click",
|
|
24
|
+
position: "bottom-end"
|
|
25
|
+
}, /*#__PURE__*/React.createElement(ResourcedMention, {
|
|
26
|
+
id: id,
|
|
27
|
+
text: text,
|
|
28
|
+
accessLevel: accessLevel,
|
|
29
|
+
mentionProvider: mentionProvider,
|
|
30
|
+
onClick: onClick,
|
|
31
|
+
onMouseEnter: onMouseEnter,
|
|
32
|
+
onMouseLeave: onMouseLeave
|
|
33
|
+
}));
|
|
34
|
+
}
|
|
@@ -83,11 +83,9 @@ var MentionWithProviders = /*#__PURE__*/function (_PureComponent) {
|
|
|
83
83
|
value: function render() {
|
|
84
84
|
var _this$props = this.props,
|
|
85
85
|
accessLevel = _this$props.accessLevel,
|
|
86
|
-
userType = _this$props.userType,
|
|
87
86
|
eventHandlers = _this$props.eventHandlers,
|
|
88
87
|
id = _this$props.id,
|
|
89
88
|
mentionProvider = _this$props.mentionProvider,
|
|
90
|
-
portal = _this$props.portal,
|
|
91
89
|
text = _this$props.text;
|
|
92
90
|
var profilecardProvider = this.state.profilecardProvider;
|
|
93
91
|
var actionHandlers = {};
|
|
@@ -99,10 +97,8 @@ var MentionWithProviders = /*#__PURE__*/function (_PureComponent) {
|
|
|
99
97
|
id: id,
|
|
100
98
|
text: text,
|
|
101
99
|
accessLevel: accessLevel,
|
|
102
|
-
userType: userType,
|
|
103
100
|
mentionProvider: mentionProvider,
|
|
104
|
-
profilecardProvider: profilecardProvider
|
|
105
|
-
portal: portal
|
|
101
|
+
profilecardProvider: profilecardProvider
|
|
106
102
|
}, actionHandlers));
|
|
107
103
|
}
|
|
108
104
|
}]);
|
|
@@ -1,35 +1,37 @@
|
|
|
1
1
|
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
2
2
|
|
|
3
|
-
var _templateObject, _templateObject2;
|
|
3
|
+
var _templateObject, _templateObject2, _templateObject3, _templateObject4;
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
import
|
|
5
|
+
/** @jsx jsx */
|
|
6
|
+
import { css, jsx } from '@emotion/react';
|
|
7
7
|
import SuccessIcon from '@atlaskit/icon/glyph/editor/success';
|
|
8
8
|
import ErrorIcon from '@atlaskit/icon/glyph/error';
|
|
9
9
|
import { G400, N200, R400 } from '@atlaskit/theme/colors';
|
|
10
10
|
import { gridSize } from '@atlaskit/theme/constants';
|
|
11
11
|
import { h200 } from '@atlaskit/theme/typography';
|
|
12
|
-
var
|
|
13
|
-
|
|
14
|
-
return R400;
|
|
15
|
-
}
|
|
12
|
+
var errorColor = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n color: ", ";\n"])), R400);
|
|
13
|
+
var validColor = css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n color: ", ";\n"])), G400);
|
|
16
14
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
15
|
+
var messageStyle = function messageStyle(props) {
|
|
16
|
+
return css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n ", " font-weight: normal;\n color: ", ";\n margin-top: ", "px;\n display: flex;\n justify-content: baseline;\n"])), h200(props), N200, gridSize() / 2);
|
|
17
|
+
};
|
|
20
18
|
|
|
21
|
-
|
|
22
|
-
}, gridSize() / 2);
|
|
23
|
-
var IconWrapper = styled.span(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n display: flex;\n margin-right: 4px;\n"])));
|
|
19
|
+
var iconWrapperStyle = css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n display: flex;\n margin-right: 4px;\n"])));
|
|
24
20
|
export var HelperMessage = function HelperMessage(_ref) {
|
|
25
21
|
var children = _ref.children;
|
|
26
|
-
return
|
|
22
|
+
return jsx("div", {
|
|
23
|
+
css: messageStyle
|
|
24
|
+
}, children);
|
|
27
25
|
};
|
|
28
26
|
export var ErrorMessage = function ErrorMessage(_ref2) {
|
|
29
27
|
var children = _ref2.children;
|
|
30
|
-
return
|
|
31
|
-
|
|
32
|
-
|
|
28
|
+
return jsx("div", {
|
|
29
|
+
css: function css(theme) {
|
|
30
|
+
return [messageStyle(theme), errorColor];
|
|
31
|
+
}
|
|
32
|
+
}, jsx("span", {
|
|
33
|
+
css: iconWrapperStyle
|
|
34
|
+
}, jsx(ErrorIcon, {
|
|
33
35
|
size: "small",
|
|
34
36
|
label: "error",
|
|
35
37
|
"aria-label": "error"
|
|
@@ -37,9 +39,13 @@ export var ErrorMessage = function ErrorMessage(_ref2) {
|
|
|
37
39
|
};
|
|
38
40
|
export var ValidMessage = function ValidMessage(_ref3) {
|
|
39
41
|
var children = _ref3.children;
|
|
40
|
-
return
|
|
41
|
-
|
|
42
|
-
|
|
42
|
+
return jsx("div", {
|
|
43
|
+
css: function css(theme) {
|
|
44
|
+
return [messageStyle(theme), validColor];
|
|
45
|
+
}
|
|
46
|
+
}, jsx("span", {
|
|
47
|
+
css: iconWrapperStyle
|
|
48
|
+
}, jsx(SuccessIcon, {
|
|
43
49
|
size: "small",
|
|
44
50
|
label: "success"
|
|
45
51
|
})), children);
|
|
@@ -26,6 +26,8 @@ var Popup = /*#__PURE__*/function (_React$Component) {
|
|
|
26
26
|
var _super = _createSuper(Popup);
|
|
27
27
|
|
|
28
28
|
function Popup() {
|
|
29
|
+
var _window;
|
|
30
|
+
|
|
29
31
|
var _this;
|
|
30
32
|
|
|
31
33
|
_classCallCheck(this, Popup);
|
|
@@ -58,6 +60,10 @@ var Popup = /*#__PURE__*/function (_React$Component) {
|
|
|
58
60
|
return _this.scheduledUpdatePosition(_this.props);
|
|
59
61
|
});
|
|
60
62
|
|
|
63
|
+
_defineProperty(_assertThisInitialized(_this), "resizeObserver", (_window = window) !== null && _window !== void 0 && _window.ResizeObserver ? new ResizeObserver(function () {
|
|
64
|
+
_this.scheduledUpdatePosition(_this.props);
|
|
65
|
+
}) : undefined);
|
|
66
|
+
|
|
61
67
|
return _this;
|
|
62
68
|
}
|
|
63
69
|
|
|
@@ -184,9 +190,14 @@ var Popup = /*#__PURE__*/function (_React$Component) {
|
|
|
184
190
|
value: function componentDidMount() {
|
|
185
191
|
window.addEventListener('resize', this.onResize);
|
|
186
192
|
var stick = this.props.stick;
|
|
193
|
+
this.scrollParentElement = findOverflowScrollParent(this.props.target);
|
|
194
|
+
|
|
195
|
+
if (this.scrollParentElement && this.resizeObserver) {
|
|
196
|
+
this.resizeObserver.observe(this.scrollParentElement);
|
|
197
|
+
}
|
|
187
198
|
|
|
188
199
|
if (stick) {
|
|
189
|
-
this.scrollElement =
|
|
200
|
+
this.scrollElement = this.scrollParentElement;
|
|
190
201
|
} else {
|
|
191
202
|
this.scrollElement = this.props.scrollableElement;
|
|
192
203
|
}
|
|
@@ -204,6 +215,10 @@ var Popup = /*#__PURE__*/function (_React$Component) {
|
|
|
204
215
|
this.scrollElement.removeEventListener('scroll', this.onResize);
|
|
205
216
|
}
|
|
206
217
|
|
|
218
|
+
if (this.scrollParentElement && this.resizeObserver) {
|
|
219
|
+
this.resizeObserver.unobserve(this.scrollParentElement);
|
|
220
|
+
}
|
|
221
|
+
|
|
207
222
|
this.scheduledUpdatePosition.cancel();
|
|
208
223
|
}
|
|
209
224
|
}, {
|
|
@@ -2,9 +2,10 @@ import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral
|
|
|
2
2
|
|
|
3
3
|
var _templateObject;
|
|
4
4
|
|
|
5
|
+
/** @jsx jsx */
|
|
5
6
|
import React, { useCallback, useRef } from 'react';
|
|
7
|
+
import { css, jsx } from '@emotion/react';
|
|
6
8
|
import { injectIntl } from 'react-intl-next';
|
|
7
|
-
import styled from 'styled-components';
|
|
8
9
|
import { relativeFontSizeToBase16 } from '@atlaskit/editor-shared-styles';
|
|
9
10
|
import QuestionsIcon from '@atlaskit/icon/glyph/question-circle';
|
|
10
11
|
import { N30, N50 } from '@atlaskit/theme/colors';
|
|
@@ -14,7 +15,7 @@ import { unsupportedContentMessages } from '../../messages/unsupportedContent';
|
|
|
14
15
|
import { ACTION_SUBJECT_ID } from '../../utils/analytics';
|
|
15
16
|
import { trackUnsupportedContentTooltipDisplayedFor } from '../../utils/track-unsupported-content';
|
|
16
17
|
import { getUnsupportedContent } from '../unsupported-content-helper';
|
|
17
|
-
var
|
|
18
|
+
var blockNodeStyle = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n background: ", ";\n border: 1px dashed ", ";\n border-radius: ", "px;\n box-sizing: border-box;\n cursor: default;\n display: flex;\n font-size: ", ";\n margin: 10px 0;\n min-height: 24px;\n padding: 10px;\n text-align: center;\n vertical-align: text-bottom;\n min-width: 120px;\n align-items: center;\n justify-content: center;\n"])), N30, N50, borderRadius(), relativeFontSizeToBase16(fontSize()));
|
|
18
19
|
|
|
19
20
|
var UnsupportedBlockNode = function UnsupportedBlockNode(_ref) {
|
|
20
21
|
var node = _ref.node,
|
|
@@ -32,15 +33,18 @@ var UnsupportedBlockNode = function UnsupportedBlockNode(_ref) {
|
|
|
32
33
|
var tooltipOnShowHandler = useCallback(function () {
|
|
33
34
|
return dispatchAnalyticsEvent && trackUnsupportedContentTooltipDisplayedFor(dispatchAnalyticsEvent, ACTION_SUBJECT_ID.ON_UNSUPPORTED_BLOCK, originalNodeType);
|
|
34
35
|
}, [dispatchAnalyticsEvent, originalNodeType]);
|
|
35
|
-
return
|
|
36
|
+
return jsx("div", {
|
|
37
|
+
css: blockNodeStyle,
|
|
38
|
+
className: "unsupported"
|
|
39
|
+
}, message, jsx(Tooltip, {
|
|
36
40
|
content: tooltipContent,
|
|
37
41
|
hideTooltipOnClick: false,
|
|
38
42
|
position: "bottom",
|
|
39
43
|
onShow: tooltipOnShowHandler,
|
|
40
44
|
strategy: "absolute"
|
|
41
|
-
},
|
|
45
|
+
}, jsx("span", {
|
|
42
46
|
style: style
|
|
43
|
-
},
|
|
47
|
+
}, jsx(QuestionsIcon, {
|
|
44
48
|
label: "?",
|
|
45
49
|
size: "small"
|
|
46
50
|
}))));
|
|
@@ -2,9 +2,10 @@ import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral
|
|
|
2
2
|
|
|
3
3
|
var _templateObject;
|
|
4
4
|
|
|
5
|
+
/** @jsx jsx */
|
|
5
6
|
import React, { useCallback, useRef } from 'react';
|
|
7
|
+
import { css, jsx } from '@emotion/react';
|
|
6
8
|
import { injectIntl } from 'react-intl-next';
|
|
7
|
-
import styled from 'styled-components';
|
|
8
9
|
import { relativeFontSizeToBase16 } from '@atlaskit/editor-shared-styles';
|
|
9
10
|
import QuestionsIcon from '@atlaskit/icon/glyph/question-circle';
|
|
10
11
|
import { N30, N50 } from '@atlaskit/theme/colors';
|
|
@@ -14,7 +15,7 @@ import { unsupportedContentMessages } from '../../messages/unsupportedContent';
|
|
|
14
15
|
import { ACTION_SUBJECT_ID } from '../../utils/analytics';
|
|
15
16
|
import { trackUnsupportedContentTooltipDisplayedFor } from '../../utils/track-unsupported-content';
|
|
16
17
|
import { getUnsupportedContent } from '../unsupported-content-helper';
|
|
17
|
-
var
|
|
18
|
+
var inlineNodeStyle = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n align-items: center;\n background: ", ";\n border: 1px dashed ", ";\n border-radius: ", "px;\n box-sizing: border-box;\n cursor: default;\n display: inline-flex;\n font-size: ", ";\n margin: 0 2px;\n min-height: 24px;\n padding: 0 10px;\n vertical-align: middle;\n white-space: nowrap;\n"])), N30, N50, borderRadius(), relativeFontSizeToBase16(fontSize()));
|
|
18
19
|
|
|
19
20
|
var UnsupportedInlineNode = function UnsupportedInlineNode(_ref) {
|
|
20
21
|
var node = _ref.node,
|
|
@@ -32,15 +33,17 @@ var UnsupportedInlineNode = function UnsupportedInlineNode(_ref) {
|
|
|
32
33
|
var tooltipOnShowHandler = useCallback(function () {
|
|
33
34
|
return dispatchAnalyticsEvent && trackUnsupportedContentTooltipDisplayedFor(dispatchAnalyticsEvent, ACTION_SUBJECT_ID.ON_UNSUPPORTED_INLINE, originalNodeType);
|
|
34
35
|
}, [dispatchAnalyticsEvent, originalNodeType]);
|
|
35
|
-
return
|
|
36
|
+
return jsx("span", {
|
|
37
|
+
css: inlineNodeStyle
|
|
38
|
+
}, message, jsx(Tooltip, {
|
|
36
39
|
content: tooltipContent,
|
|
37
40
|
hideTooltipOnClick: false,
|
|
38
41
|
position: "bottom",
|
|
39
42
|
onShow: tooltipOnShowHandler,
|
|
40
43
|
strategy: "absolute"
|
|
41
|
-
},
|
|
44
|
+
}, jsx("span", {
|
|
42
45
|
style: style
|
|
43
|
-
},
|
|
46
|
+
}, jsx(QuestionsIcon, {
|
|
44
47
|
label: "?",
|
|
45
48
|
size: "small"
|
|
46
49
|
}))));
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
1
2
|
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
2
3
|
import _createClass from "@babel/runtime/helpers/createClass";
|
|
3
4
|
import _assertThisInitialized from "@babel/runtime/helpers/assertThisInitialized";
|
|
@@ -5,7 +6,6 @@ import _inherits from "@babel/runtime/helpers/inherits";
|
|
|
5
6
|
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
6
7
|
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
7
8
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
8
|
-
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
9
9
|
|
|
10
10
|
var _templateObject;
|
|
11
11
|
|
|
@@ -13,9 +13,10 @@ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflec
|
|
|
13
13
|
|
|
14
14
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
15
15
|
|
|
16
|
+
/** @jsx jsx */
|
|
16
17
|
import React from 'react';
|
|
18
|
+
import { css, jsx } from '@emotion/react';
|
|
17
19
|
import rafSchedule from 'raf-schd';
|
|
18
|
-
import styled from 'styled-components';
|
|
19
20
|
import { WidthObserver } from '@atlaskit/width-detector';
|
|
20
21
|
var SCROLLBAR_WIDTH = 30;
|
|
21
22
|
export function getBreakpoint() {
|
|
@@ -41,7 +42,6 @@ export function createWidthContext() {
|
|
|
41
42
|
export var WidthContext = /*#__PURE__*/React.createContext(createWidthContext());
|
|
42
43
|
var Provider = WidthContext.Provider,
|
|
43
44
|
Consumer = WidthContext.Consumer;
|
|
44
|
-
var RelativeContainer = /*#__PURE__*/React.memo(styled.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n position: relative;\n width: 100%;\n"]))));
|
|
45
45
|
export var WidthProvider = /*#__PURE__*/function (_React$Component) {
|
|
46
46
|
_inherits(WidthProvider, _React$Component);
|
|
47
47
|
|
|
@@ -76,12 +76,13 @@ export var WidthProvider = /*#__PURE__*/function (_React$Component) {
|
|
|
76
76
|
_createClass(WidthProvider, [{
|
|
77
77
|
key: "render",
|
|
78
78
|
value: function render() {
|
|
79
|
-
return
|
|
79
|
+
return jsx("div", {
|
|
80
|
+
css: css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n position: relative;\n width: 100%;\n "]))),
|
|
80
81
|
className: this.props.className
|
|
81
|
-
},
|
|
82
|
+
}, jsx(WidthObserver, {
|
|
82
83
|
setWidth: this.setWidth,
|
|
83
84
|
offscreen: true
|
|
84
|
-
}),
|
|
85
|
+
}), jsx(Provider, {
|
|
85
86
|
value: createWidthContext(this.state.width)
|
|
86
87
|
}, this.props.children));
|
|
87
88
|
}
|
|
@@ -2,6 +2,6 @@ import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral
|
|
|
2
2
|
|
|
3
3
|
var _templateObject;
|
|
4
4
|
|
|
5
|
-
import
|
|
5
|
+
import { css } from '@emotion/react'; // We use !important to ensure next sibling gets the margin reset no matter what
|
|
6
6
|
|
|
7
|
-
export var
|
|
7
|
+
export var clearNextSiblingMarginTopStyle = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n & + * {\n margin-top: 0 !important;\n }\n"])));
|