@atlaskit/editor-common 65.0.0 → 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 +22 -0
- package/dist/cjs/normalize-feature-flags.js +40 -4
- package/dist/cjs/styles/shared/link.js +2 -2
- package/dist/cjs/styles/shared/lists.js +1 -1
- package/dist/cjs/styles/shared/panel.js +7 -4
- package/dist/cjs/styles/shared/rule.js +5 -2
- package/dist/cjs/styles/shared/table.js +1 -1
- 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/styled.js +23 -20
- package/dist/cjs/ui/Popup/index.js +15 -1
- package/dist/cjs/ui/UnsupportedBlock/index.js +1 -1
- package/dist/cjs/ui/index.js +12 -22
- 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/normalize-feature-flags.js +40 -4
- package/dist/es2019/styles/shared/link.js +1 -1
- package/dist/es2019/styles/shared/lists.js +2 -0
- package/dist/es2019/styles/shared/panel.js +15 -15
- package/dist/es2019/styles/shared/rule.js +3 -3
- package/dist/es2019/styles/shared/table.js +9 -1
- 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/styled.js +13 -12
- package/dist/es2019/ui/Popup/index.js +16 -1
- package/dist/es2019/ui/UnsupportedBlock/index.js +0 -1
- package/dist/es2019/ui/index.js +2 -4
- 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/normalize-feature-flags.js +39 -4
- package/dist/esm/styles/shared/link.js +1 -1
- package/dist/esm/styles/shared/lists.js +1 -1
- package/dist/esm/styles/shared/panel.js +6 -4
- package/dist/esm/styles/shared/rule.js +4 -2
- package/dist/esm/styles/shared/table.js +1 -1
- 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/styled.js +17 -10
- package/dist/esm/ui/Popup/index.js +16 -1
- package/dist/esm/ui/UnsupportedBlock/index.js +1 -1
- package/dist/esm/ui/index.js +2 -4
- 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/extensions/types/field-definitions.d.ts +1 -1
- package/dist/types/normalize-feature-flags.d.ts +6 -3
- package/dist/types/styles/shared/link.d.ts +1 -1
- package/dist/types/styles/shared/panel.d.ts +1 -1
- package/dist/types/styles/shared/rule.d.ts +2 -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/styled.d.ts +10 -5
- package/dist/types/ui/Popup/index.d.ts +3 -0
- package/dist/types/ui/index.d.ts +2 -4
- package/dist/types/utils/compare-props.d.ts +32 -0
- 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 +13 -14
- 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
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,27 @@
|
|
|
1
1
|
# @atlaskit/editor-common
|
|
2
2
|
|
|
3
|
+
## 66.0.0
|
|
4
|
+
|
|
5
|
+
### Major Changes
|
|
6
|
+
|
|
7
|
+
- [`2ec99bf6f9f`](https://bitbucket.org/atlassian/atlassian-frontend/commits/2ec99bf6f9f) - [ux] ED-14651: removed react-intl v2 fallback helpers IntlLegacyFallbackProvider and IntlNextCompat
|
|
8
|
+
- [`2ec99bf6f9f`](https://bitbucket.org/atlassian/atlassian-frontend/commits/2ec99bf6f9f) - [ux] ED-14651: removed react-intl v2.
|
|
9
|
+
|
|
10
|
+
### Minor Changes
|
|
11
|
+
|
|
12
|
+
- [`bceab5fa97d`](https://bitbucket.org/atlassian/atlassian-frontend/commits/bceab5fa97d) - ED-14632: Add render count tracking reRendered event in Renderer
|
|
13
|
+
|
|
14
|
+
### Patch Changes
|
|
15
|
+
|
|
16
|
+
- [`ced96eebe47`](https://bitbucket.org/atlassian/atlassian-frontend/commits/ced96eebe47) - Minor changes in MarkWrapper and Expand styles.
|
|
17
|
+
- [`44c6c36d8d9`](https://bitbucket.org/atlassian/atlassian-frontend/commits/44c6c36d8d9) - ED-14263 replaced styled usages
|
|
18
|
+
- [`de79d0babc9`](https://bitbucket.org/atlassian/atlassian-frontend/commits/de79d0babc9) - ED-14663 Fixed horizontal scrollbar appearing in table in chrome version 99 issue.
|
|
19
|
+
- [`fd5028f6751`](https://bitbucket.org/atlassian/atlassian-frontend/commits/fd5028f6751) - EDM-2873: Promote MediaInline to full schema
|
|
20
|
+
- [`1e2086467f1`](https://bitbucket.org/atlassian/atlassian-frontend/commits/1e2086467f1) - [ED-13775] Added resize observer on scroll parent element to realign popup components when template context panel is opened/closed.
|
|
21
|
+
- [`78aec52dea0`](https://bitbucket.org/atlassian/atlassian-frontend/commits/78aec52dea0) - use latest SmartUserPicker in Editor packages
|
|
22
|
+
- [`5c6607ee0e7`](https://bitbucket.org/atlassian/atlassian-frontend/commits/5c6607ee0e7) - Migrated link, rule, panel and expand styles in editor-common to emotion.
|
|
23
|
+
- Updated dependencies
|
|
24
|
+
|
|
3
25
|
## 65.0.0
|
|
4
26
|
|
|
5
27
|
### Major Changes
|
|
@@ -9,11 +9,31 @@ exports.normalizeFeatureFlags = normalizeFeatureFlags;
|
|
|
9
9
|
|
|
10
10
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
11
11
|
|
|
12
|
+
var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
|
|
13
|
+
|
|
12
14
|
var _camelCase = _interopRequireDefault(require("lodash/camelCase"));
|
|
13
15
|
|
|
14
16
|
var _kebabCase = _interopRequireDefault(require("lodash/kebabCase"));
|
|
15
17
|
|
|
16
18
|
var EMPTY = {};
|
|
19
|
+
|
|
20
|
+
function isObjectFlagKey(key, value, objectFlagKeys) {
|
|
21
|
+
return Boolean(typeof value === 'string' && (objectFlagKeys === null || objectFlagKeys === void 0 ? void 0 : objectFlagKeys.includes(key)));
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
function isValidJSONObject(value) {
|
|
25
|
+
try {
|
|
26
|
+
var result = JSON.parse(value);
|
|
27
|
+
|
|
28
|
+
if ((0, _typeof2.default)(result) === 'object' && result !== null) {
|
|
29
|
+
return true;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
return false;
|
|
33
|
+
} catch (err) {
|
|
34
|
+
return false;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
17
37
|
/**
|
|
18
38
|
* Normalise and filter a free Record<string, unknown> to match
|
|
19
39
|
* the rules for feature flags in editor and renderer
|
|
@@ -24,18 +44,27 @@ var EMPTY = {};
|
|
|
24
44
|
*
|
|
25
45
|
* Output matches
|
|
26
46
|
* 1. cased in camelCase (match [a-zA-Z])
|
|
27
|
-
* 2. has boolean value
|
|
47
|
+
* 2. has boolean value or object {} value
|
|
28
48
|
*
|
|
29
49
|
* @param rawFeatureFlags
|
|
30
50
|
*/
|
|
31
51
|
|
|
32
|
-
|
|
52
|
+
|
|
53
|
+
function normalizeFeatureFlags(rawFeatureFlags, options) {
|
|
33
54
|
if (!rawFeatureFlags) {
|
|
34
55
|
return EMPTY;
|
|
35
56
|
}
|
|
36
57
|
|
|
37
58
|
return Object.entries(rawFeatureFlags).filter(function (e) {
|
|
38
|
-
|
|
59
|
+
if (typeof e[1] === 'boolean') {
|
|
60
|
+
return true;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
if (isObjectFlagKey((0, _camelCase.default)(e[0]), e[1], options === null || options === void 0 ? void 0 : options.objectFlagKeys) && isValidJSONObject(e[1])) {
|
|
64
|
+
return true;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
return false;
|
|
39
68
|
}).filter(function (_ref) {
|
|
40
69
|
var _ref2 = (0, _slicedToArray2.default)(_ref, 1),
|
|
41
70
|
key = _ref2[0];
|
|
@@ -52,7 +81,14 @@ function normalizeFeatureFlags(rawFeatureFlags) {
|
|
|
52
81
|
key = _ref6[0],
|
|
53
82
|
value = _ref6[1];
|
|
54
83
|
|
|
55
|
-
|
|
84
|
+
if (isObjectFlagKey(key, value, options === null || options === void 0 ? void 0 : options.objectFlagKeys)) {
|
|
85
|
+
flags[key] = JSON.parse(value);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
if (typeof value === 'boolean') {
|
|
89
|
+
flags[key] = value;
|
|
90
|
+
}
|
|
91
|
+
|
|
56
92
|
return flags;
|
|
57
93
|
}, {});
|
|
58
94
|
}
|
|
@@ -9,9 +9,9 @@ exports.linkSharedStyle = void 0;
|
|
|
9
9
|
|
|
10
10
|
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
11
11
|
|
|
12
|
-
var
|
|
12
|
+
var _react = require("@emotion/react");
|
|
13
13
|
|
|
14
14
|
var _templateObject;
|
|
15
15
|
|
|
16
|
-
var linkSharedStyle = (0,
|
|
16
|
+
var linkSharedStyle = (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n a.blockLink {\n display: block;\n }\n"])));
|
|
17
17
|
exports.linkSharedStyle = linkSharedStyle;
|
|
@@ -17,5 +17,5 @@ var _browser = _interopRequireDefault(require("../../utils/browser"));
|
|
|
17
17
|
|
|
18
18
|
var _templateObject;
|
|
19
19
|
|
|
20
|
-
var listsSharedStyles = (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n /* =============== INDENTATION SPACING ========= */\n\n ul,\n ol {\n box-sizing: border-box;\n padding-left: 24px;\n\n /*\n Firefox does not handle empty block element inside li tag.\n If there is not block element inside li tag,\n then firefox sets inherited height to li\n However, if there is any block element and if it's empty\n (or has empty inline element) then\n firefox sets li tag height to zero.\n More details at\n https://product-fabric.atlassian.net/wiki/spaces/~455502413/pages/3149365890/ED-14110+Investigation\n */\n li p:empty,\n li p > span:empty {\n ", "\n }\n }\n\n ", ", ", " {\n /*\n Ensures list item content adheres to the list's margin instead\n of filling the entire block row. This is important to allow\n clicking interactive elements which are floated next to a list.\n\n For some history and context on this block, see PRs related to tickets.:\n @see ED-6551 - original issue.\n @see ED-7015 - follow up issue.\n @see ED-7447 - flow-root change.\n\n We use 'display: table' (old clear fix / new block formatting context hack)\n for older browsers and 'flow-root' for modern browsers.\n\n @see https://css-tricks.com/display-flow-root/\n */\n // For older browsers the do not support flow-root.\n display: table;\n display: flow-root;\n }\n\n /* =============== INDENTATION AESTHETICS ========= */\n\n /**\n We support nested lists up to six levels deep.\n **/\n\n /* LEGACY LISTS */\n\n ul,\n ul ul ul ul {\n list-style-type: disc;\n }\n\n ul ul,\n ul ul ul ul ul {\n list-style-type: circle;\n }\n\n ul ul ul,\n ul ul ul ul ul ul {\n list-style-type: square;\n }\n\n ol,\n ol ol ol ol {\n list-style-type: decimal;\n }\n ol ol,\n ol ol ol ol ol {\n list-style-type: lower-alpha;\n }\n ol ol ol,\n ol ol ol ol ol ol {\n list-style-type: lower-roman;\n }\n\n /* PREDICTABLE LISTS */\n\n ol[data-indent-level='1'],\n ol[data-indent-level='4'] {\n list-style-type: decimal;\n }\n\n ol[data-indent-level='2'],\n ol[data-indent-level='5'] {\n list-style-type: lower-alpha;\n }\n\n ol[data-indent-level='3'],\n ol[data-indent-level='6'] {\n list-style-type: lower-roman;\n }\n\n ul[data-indent-level='1'],\n ul[data-indent-level='4'] {\n list-style-type: disc;\n }\n\n ul[data-indent-level='2'],\n ul[data-indent-level='5'] {\n list-style-type: circle;\n }\n\n ul[data-indent-level='3'],\n ul[data-indent-level='6'] {\n list-style-type: square;\n }\n"])), _browser.default.gecko ? 'display: inline-block;' : '', _adfSchema.orderedListSelector, _adfSchema.bulletListSelector);
|
|
20
|
+
var listsSharedStyles = (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n /* =============== INDENTATION SPACING ========= */\n\n ul,\n ol {\n box-sizing: border-box;\n padding-left: 24px;\n\n /*\n Firefox does not handle empty block element inside li tag.\n If there is not block element inside li tag,\n then firefox sets inherited height to li\n However, if there is any block element and if it's empty\n (or has empty inline element) then\n firefox sets li tag height to zero.\n More details at\n https://product-fabric.atlassian.net/wiki/spaces/~455502413/pages/3149365890/ED-14110+Investigation\n */\n li p:empty,\n li p > span:empty {\n ", "\n }\n }\n\n ", ", ", " {\n /*\n Ensures list item content adheres to the list's margin instead\n of filling the entire block row. This is important to allow\n clicking interactive elements which are floated next to a list.\n\n For some history and context on this block, see PRs related to tickets.:\n @see ED-6551 - original issue.\n @see ED-7015 - follow up issue.\n @see ED-7447 - flow-root change.\n\n We use 'display: table' (old clear fix / new block formatting context hack)\n for older browsers and 'flow-root' for modern browsers.\n\n @see https://css-tricks.com/display-flow-root/\n */\n // For older browsers the do not support flow-root.\n /* stylelint-disable declaration-block-no-duplicate-properties */\n display: table;\n display: flow-root;\n /* stylelint-enable declaration-block-no-duplicate-properties */\n }\n\n /* =============== INDENTATION AESTHETICS ========= */\n\n /**\n We support nested lists up to six levels deep.\n **/\n\n /* LEGACY LISTS */\n\n ul,\n ul ul ul ul {\n list-style-type: disc;\n }\n\n ul ul,\n ul ul ul ul ul {\n list-style-type: circle;\n }\n\n ul ul ul,\n ul ul ul ul ul ul {\n list-style-type: square;\n }\n\n ol,\n ol ol ol ol {\n list-style-type: decimal;\n }\n ol ol,\n ol ol ol ol ol {\n list-style-type: lower-alpha;\n }\n ol ol ol,\n ol ol ol ol ol ol {\n list-style-type: lower-roman;\n }\n\n /* PREDICTABLE LISTS */\n\n ol[data-indent-level='1'],\n ol[data-indent-level='4'] {\n list-style-type: decimal;\n }\n\n ol[data-indent-level='2'],\n ol[data-indent-level='5'] {\n list-style-type: lower-alpha;\n }\n\n ol[data-indent-level='3'],\n ol[data-indent-level='6'] {\n list-style-type: lower-roman;\n }\n\n ul[data-indent-level='1'],\n ul[data-indent-level='4'] {\n list-style-type: disc;\n }\n\n ul[data-indent-level='2'],\n ul[data-indent-level='5'] {\n list-style-type: circle;\n }\n\n ul[data-indent-level='3'],\n ul[data-indent-level='6'] {\n list-style-type: square;\n }\n"])), _browser.default.gecko ? 'display: inline-block;' : '', _adfSchema.orderedListSelector, _adfSchema.bulletListSelector);
|
|
21
21
|
exports.listsSharedStyles = listsSharedStyles;
|
|
@@ -15,7 +15,7 @@ var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/hel
|
|
|
15
15
|
|
|
16
16
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
17
17
|
|
|
18
|
-
var
|
|
18
|
+
var _react = require("@emotion/react");
|
|
19
19
|
|
|
20
20
|
var _adfSchema = require("@atlaskit/adf-schema");
|
|
21
21
|
|
|
@@ -218,7 +218,10 @@ var mainDynamicStyles = function mainDynamicStyles(panelType) {
|
|
|
218
218
|
};
|
|
219
219
|
};
|
|
220
220
|
|
|
221
|
-
var panelSharedStyles =
|
|
222
|
-
|
|
223
|
-
|
|
221
|
+
var panelSharedStyles = function panelSharedStyles(props) {
|
|
222
|
+
return (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n .", " {\n border-radius: ", "px;\n margin: ", " 0 0;\n padding: ", "px;\n min-width: ", "px;\n display: flex;\n position: relative;\n align-items: baseline;\n word-break: break-word;\n\n ", "\n\n .", " {\n flex-shrink: 0;\n height: ", "px;\n width: ", "px;\n box-sizing: content-box;\n padding-right: ", "px;\n text-align: center;\n user-select: none;\n -moz-user-select: none;\n -webkit-user-select: none;\n -ms-user-select: none;\n ", "\n\n > span {\n vertical-align: middle;\n display: inline-flex;\n }\n\n .", " {\n vertical-align: ", "px;\n }\n\n .", " {\n vertical-align: ", "px;\n\n // Vertical align only works for inline-block elements in Firefox\n @-moz-document url-prefix() {\n img {\n display: inline-block;\n }\n }\n }\n }\n\n .ak-editor-panel__content {\n margin: 1px 0 1px;\n flex: 1 0 0;\n /*\n https://ishadeed.com/article/min-max-css/#setting-min-width-to-zero-with-flexbox\n The default value for min-width is auto, which is computed to zero. When an element is a flex item, the value of min-width doesn\u2019t compute to zero. The minimum size of a flex item is equal to the size of its contents.\n */\n min-width: 0;\n }\n\n &[data-panel-type='", "'] {\n ", "\n\n .", " {\n ", "\n }\n }\n\n &[data-panel-type='", "'] {\n ", "\n\n .", " {\n ", "\n }\n }\n\n &[data-panel-type='", "'] {\n ", "\n\n .", " {\n ", "\n }\n }\n\n &[data-panel-type='", "'] {\n ", "\n\n .", " {\n ", "\n }\n }\n\n &[data-panel-type='", "'] {\n ", "\n\n .", " {\n ", "\n }\n }\n\n &[data-panel-type='", "'] {\n ", ";\n }\n }\n"])), PanelSharedCssClassName.prefix, (0, _constants.borderRadius)(), _editorSharedStyles.blockNodesVerticalMargin, (0, _constants.gridSize)(), _editorSharedStyles.akEditorTableCellMinWidth, mainDynamicStyles(_adfSchema.PanelType.INFO)(props), PanelSharedCssClassName.icon, (0, _constants.gridSize)() * 3, (0, _constants.gridSize)() * 3, (0, _constants.gridSize)(), iconDynamicStyles(_adfSchema.PanelType.INFO)(props), _emoji.emojiSprite, panelEmojiSpriteVerticalAlignment, _emoji.emojiImage, panelEmojiImageVerticalAlignment, _adfSchema.PanelType.NOTE, mainDynamicStyles(_adfSchema.PanelType.NOTE)(props), PanelSharedCssClassName.icon, iconDynamicStyles(_adfSchema.PanelType.NOTE)(props), _adfSchema.PanelType.TIP, mainDynamicStyles(_adfSchema.PanelType.TIP)(props), PanelSharedCssClassName.icon, iconDynamicStyles(_adfSchema.PanelType.TIP)(props), _adfSchema.PanelType.WARNING, mainDynamicStyles(_adfSchema.PanelType.WARNING)(props), PanelSharedCssClassName.icon, iconDynamicStyles(_adfSchema.PanelType.WARNING)(props), _adfSchema.PanelType.ERROR, mainDynamicStyles(_adfSchema.PanelType.ERROR)(props), PanelSharedCssClassName.icon, iconDynamicStyles(_adfSchema.PanelType.ERROR)(props), _adfSchema.PanelType.SUCCESS, mainDynamicStyles(_adfSchema.PanelType.SUCCESS)(props), PanelSharedCssClassName.icon, iconDynamicStyles(_adfSchema.PanelType.SUCCESS)(props), _adfSchema.PanelType.CUSTOM, (0, _components.themed)({
|
|
223
|
+
dark: getPanelBackgroundDarkModeColors
|
|
224
|
+
})(props));
|
|
225
|
+
};
|
|
226
|
+
|
|
224
227
|
exports.panelSharedStyles = panelSharedStyles;
|
|
@@ -9,7 +9,7 @@ exports.ruleSharedStyles = void 0;
|
|
|
9
9
|
|
|
10
10
|
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
11
11
|
|
|
12
|
-
var
|
|
12
|
+
var _react = require("@emotion/react");
|
|
13
13
|
|
|
14
14
|
var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
|
|
15
15
|
|
|
@@ -24,5 +24,8 @@ var divider = (0, _components.themed)({
|
|
|
24
24
|
dark: _colors.DN50
|
|
25
25
|
}); // @see typography spreadsheet: https://docs.google.com/spreadsheets/d/1iYusRGCT4PoPfvxbJ8NrgjtfFgXLm5lpDWXzjua1W2E/edit#gid=93913128
|
|
26
26
|
|
|
27
|
-
var ruleSharedStyles =
|
|
27
|
+
var ruleSharedStyles = function ruleSharedStyles(props) {
|
|
28
|
+
return (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n & hr {\n border: none;\n background-color: ", ";\n margin: ", "em 0;\n height: 2px;\n border-radius: 1px;\n }\n"])), divider(props), _editorSharedStyles.akEditorLineHeight);
|
|
29
|
+
};
|
|
30
|
+
|
|
28
31
|
exports.ruleSharedStyles = ruleSharedStyles;
|
|
@@ -57,7 +57,7 @@ var TableSharedCssClassName = {
|
|
|
57
57
|
exports.TableSharedCssClassName = TableSharedCssClassName;
|
|
58
58
|
|
|
59
59
|
var tableSharedStyle = function tableSharedStyle(props) {
|
|
60
|
-
return (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n .", " {\n position: relative;\n margin: 0 auto ", "px;\n box-sizing: border-box;\n\n /**\n * Fix block top alignment inside table cells.\n */\n .decisionItemView-content-wrap:first-child > div {\n margin-top: 0;\n }\n }\n .", "[data-number-column='true'] {\n padding-left: ", "px;\n clear: both;\n }\n /* avoid applying styles to nested tables (possible via extensions) */\n .", " > table,\n .", " > table,\n .", " > table {\n border-collapse: collapse;\n
|
|
60
|
+
return (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n .", " {\n position: relative;\n margin: 0 auto ", "px;\n box-sizing: border-box;\n\n /**\n * Fix block top alignment inside table cells.\n */\n .decisionItemView-content-wrap:first-child > div {\n margin-top: 0;\n }\n }\n .", "[data-number-column='true'] {\n padding-left: ", "px;\n clear: both;\n }\n .", " > table {\n margin: ", "px 0 0 0;\n }\n\n .", " > table,\n .", " > table {\n margin: ", "px ", "px 0 0;\n }\n\n /* avoid applying styles to nested tables (possible via extensions) */\n .", " > table,\n .", " > table,\n .", " > table {\n border-collapse: collapse;\n border: ", "px solid\n ", ";\n table-layout: fixed;\n font-size: 1em;\n width: 100%;\n\n &[data-autosize='true'] {\n table-layout: auto;\n }\n\n & {\n * {\n box-sizing: border-box;\n }\n hr {\n box-sizing: content-box;\n }\n\n tbody {\n border-bottom: none;\n }\n th td {\n background-color: white;\n }\n th,\n td {\n min-width: ", "px;\n font-weight: normal;\n vertical-align: top;\n border: 1px solid\n ", ";\n border-right-width: 0;\n border-bottom-width: 0;\n padding: ", "px;\n /* https://stackoverflow.com/questions/7517127/borders-not-shown-in-firefox-with-border-collapse-on-table-position-relative-o */\n ", "\n\n ", ";\n\n > *:first-child {\n margin-top: 0;\n }\n\n > .ProseMirror-gapcursor.-right:first-child + * {\n margin-top: 0;\n }\n\n > .ProseMirror-gapcursor:first-child + span + * {\n margin-top: 0;\n }\n\n th p:not(:first-of-type),\n td p:not(:first-of-type) {\n margin-top: 12px;\n }\n }\n th {\n background-color: ", ";\n text-align: left;\n\n /* only apply this styling to codeblocks in default background headercells */\n /* TODO this needs to be overhauled as it relies on unsafe selectors */\n &:not([style]) {\n .code-block {\n background-image: ", ";\n background-attachment: local, scroll, scroll;\n background-position: 100% 0, 100% 0, 0 0;\n background-color: ", ";\n\n .line-number-gutter {\n background-color: ", ";\n }\n\n /* this is only relevant to the element taken care of by renderer */\n > [data-ds--code--code-block] {\n background-image: ", "!important;\n\n background-color: ", "!important;\n\n // selector lives inside @atlaskit/code\n --ds--code--line-number-bg-color: ", ";\n }\n }\n }\n }\n }\n }\n"])), TableSharedCssClassName.TABLE_CONTAINER, tableMarginBottom, TableSharedCssClassName.TABLE_CONTAINER, _editorSharedStyles.akEditorTableNumberColumnWidth - 1, TableSharedCssClassName.TABLE_NODE_WRAPPER, tableMarginTop, TableSharedCssClassName.TABLE_CONTAINER, TableSharedCssClassName.TABLE_STICKY_WRAPPER, tableMarginTop, tableMarginSides, TableSharedCssClassName.TABLE_CONTAINER, TableSharedCssClassName.TABLE_NODE_WRAPPER, TableSharedCssClassName.TABLE_STICKY_WRAPPER, tableCellBorderWidth, (0, _components.themed)({
|
|
61
61
|
light: _editorSharedStyles.akEditorTableBorder,
|
|
62
62
|
dark: _editorSharedStyles.akEditorTableBorderDark
|
|
63
63
|
})(props), tableCellMinWidth, (0, _components.themed)({
|
|
@@ -7,13 +7,19 @@ var _typeof = require("@babel/runtime/helpers/typeof");
|
|
|
7
7
|
Object.defineProperty(exports, "__esModule", {
|
|
8
8
|
value: true
|
|
9
9
|
});
|
|
10
|
-
exports.sharedExpandStyles = exports.messages = exports.
|
|
10
|
+
exports.sharedExpandStyles = exports.messages = exports.expandLayoutWrapperStyle = exports.ExpandLayoutWrapperWithRef = exports.ExpandIconWrapper = void 0;
|
|
11
|
+
|
|
12
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
13
|
+
|
|
14
|
+
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
11
15
|
|
|
12
16
|
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
13
17
|
|
|
14
|
-
var
|
|
18
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
15
19
|
|
|
16
|
-
var
|
|
20
|
+
var _react2 = require("@emotion/react");
|
|
21
|
+
|
|
22
|
+
var _reactIntlNext = require("react-intl-next");
|
|
17
23
|
|
|
18
24
|
var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
|
|
19
25
|
|
|
@@ -23,6 +29,8 @@ var _components = require("@atlaskit/theme/components");
|
|
|
23
29
|
|
|
24
30
|
var _constants = require("@atlaskit/theme/constants");
|
|
25
31
|
|
|
32
|
+
var _excluded = ["children"];
|
|
33
|
+
|
|
26
34
|
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7;
|
|
27
35
|
|
|
28
36
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
@@ -65,53 +73,83 @@ var EXPAND_EXPANDED_BORDER_COLOR = (0, _components.themed)({
|
|
|
65
73
|
dark: colors.DN50
|
|
66
74
|
});
|
|
67
75
|
|
|
68
|
-
var ExpandIconWrapper =
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
76
|
+
var ExpandIconWrapper = function ExpandIconWrapper(_ref) {
|
|
77
|
+
var children = _ref.children,
|
|
78
|
+
expanded = _ref.expanded;
|
|
79
|
+
return (0, _react2.jsx)("div", {
|
|
80
|
+
css: function css(props) {
|
|
81
|
+
return expanded ? [expandIconWrapperStyle(props), expandIconWrapperExpandedStyle] : expandIconWrapperStyle(props);
|
|
82
|
+
}
|
|
83
|
+
}, children);
|
|
84
|
+
};
|
|
74
85
|
|
|
75
86
|
exports.ExpandIconWrapper = ExpandIconWrapper;
|
|
76
87
|
|
|
77
|
-
var
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
},
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
}), EXPAND_SELECTED_BACKGROUND);
|
|
96
|
-
var ContentStyles = (0, _styledComponents.css)(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2.default)(["\n ", ";\n"])), function (_ref3) {
|
|
97
|
-
var expanded = _ref3.expanded;
|
|
98
|
-
return (0, _styledComponents.css)(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2.default)(["\n padding-top: ", "px;\n padding-right: ", "px;\n padding-left: ", "px;\n display: table;\n display: flow-root;\n\n // The follow rules inside @supports block are added as a part of ED-8893\n // The fix is targeting mobile bridge on iOS 12 or below,\n // We should consider remove this fix when we no longer support iOS 12\n @supports not (display: flow-root) {\n width: 100%;\n box-sizing: border-box;\n }\n\n ", "\n "])), expanded ? (0, _constants.gridSize)() : 0, (0, _constants.gridSize)(), (0, _constants.gridSize)() * 4 - (0, _constants.gridSize)() / 2, !expanded ? "\n .expand-content-wrapper, .nestedExpand-content-wrapper {\n /* We visually hide the content here to preserve the content during copy+paste */\n width: 100%;\n display: block;\n height: 0;\n overflow: hidden;\n clip: rect(1px, 1px, 1px, 1px);\n white-space: nowrap;\n user-select: none;\n }\n " : '');
|
|
88
|
+
var expandIconWrapperStyle = function expandIconWrapperStyle(props) {
|
|
89
|
+
return (0, _react2.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n cursor: pointer;\n display: flex;\n color: ", ";\n border-radius: ", "px;\n width: 24px;\n height: 24px;\n\n &:hover {\n background: ", ";\n }\n\n svg {\n transition: transform 0.2s ", ";\n }\n"])), (0, _components.themed)({
|
|
90
|
+
light: colors.N90,
|
|
91
|
+
dark: '#d9dde3'
|
|
92
|
+
})(props), (0, _constants.gridSize)() / 2, colors.N30A, _editorSharedStyles.akEditorSwoopCubicBezier);
|
|
93
|
+
};
|
|
94
|
+
|
|
95
|
+
var expandIconWrapperExpandedStyle = (0, _react2.css)(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n svg {\n transform: rotate(90deg);\n }\n"])));
|
|
96
|
+
var expandLayoutWrapperStyle = (0, _react2.css)(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["\n width: ", "px;\n height: ", "px;\n"])), (0, _constants.gridSize)() * 3, (0, _constants.gridSize)() * 3);
|
|
97
|
+
exports.expandLayoutWrapperStyle = expandLayoutWrapperStyle;
|
|
98
|
+
var ExpandLayoutWrapperWithRef = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
99
|
+
var children = props.children,
|
|
100
|
+
rest = (0, _objectWithoutProperties2.default)(props, _excluded);
|
|
101
|
+
return (0, _react2.jsx)("div", (0, _extends2.default)({
|
|
102
|
+
css: expandLayoutWrapperStyle
|
|
103
|
+
}, rest, {
|
|
104
|
+
ref: ref
|
|
105
|
+
}), children);
|
|
99
106
|
});
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
107
|
+
exports.ExpandLayoutWrapperWithRef = ExpandLayoutWrapperWithRef;
|
|
108
|
+
|
|
109
|
+
var containerStyles = function containerStyles(styleProps) {
|
|
110
|
+
var expanded = styleProps.expanded,
|
|
111
|
+
focused = styleProps.focused;
|
|
112
|
+
var marginTop = "".concat((0, _constants.gridSize)() / 2 / (0, _constants.fontSize)(), "rem");
|
|
113
|
+
var marginBottom = 0; // Only only these margins if the expand isn't editable
|
|
114
|
+
// and is the root level expand.
|
|
115
|
+
|
|
116
|
+
var marginHorizontal = styleProps['data-node-type'] === 'expand' ? "-".concat(_editorSharedStyles.akLayoutGutterOffset, "px") : 0;
|
|
117
|
+
var margin = "".concat(marginTop, " ").concat(marginHorizontal, " ").concat(marginBottom);
|
|
118
|
+
return function (themeProps) {
|
|
119
|
+
return (0, _react2.css)(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2.default)(["\n border-width: 1px;\n border-style: solid;\n border-color: ", ";\n border-radius: ", "px;\n min-height: 25px;\n background: ", ";\n margin: ", ";\n\n transition: background 0.3s ", ",\n border-color 0.3s ", ";\n padding: ", "px;\n\n &:hover {\n border: 1px solid\n ", ";\n background: ", ";\n }\n\n td > &:first-child {\n margin-top: 0;\n }\n "])), focused ? EXPAND_FOCUSED_BORDER_COLOR : expanded ? EXPAND_EXPANDED_BORDER_COLOR(themeProps) : EXPAND_COLLAPSED_BORDER_COLOR, BORDER_RADIUS, !expanded ? EXPAND_COLLAPSED_BACKGROUND : EXPAND_SELECTED_BACKGROUND(themeProps), margin, _editorSharedStyles.akEditorSwoopCubicBezier, _editorSharedStyles.akEditorSwoopCubicBezier, (0, _constants.gridSize)(), (0, _components.themed)({
|
|
120
|
+
light: colors.N50A,
|
|
121
|
+
dark: colors.DN50
|
|
122
|
+
})(themeProps), EXPAND_SELECTED_BACKGROUND(themeProps));
|
|
123
|
+
};
|
|
124
|
+
};
|
|
125
|
+
|
|
126
|
+
var contentStyles = function contentStyles(styleProps) {
|
|
127
|
+
return function (themeProps) {
|
|
128
|
+
return (0, _react2.css)(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2.default)(["\n padding-top: ", "px;\n padding-right: ", "px;\n padding-left: ", "px;\n display: flow-root;\n\n // The follow rules inside @supports block are added as a part of ED-8893\n // The fix is targeting mobile bridge on iOS 12 or below,\n // We should consider remove this fix when we no longer support iOS 12\n @supports not (display: flow-root) {\n width: 100%;\n box-sizing: border-box;\n }\n\n ", "\n"])), styleProps.expanded ? (0, _constants.gridSize)() : 0, (0, _constants.gridSize)(), (0, _constants.gridSize)() * 4 - (0, _constants.gridSize)() / 2, !styleProps.expanded ? "\n .expand-content-wrapper, .nestedExpand-content-wrapper {\n /* We visually hide the content here to preserve the content during copy+paste */\n width: 100%;\n display: block;\n height: 0;\n overflow: hidden;\n clip: rect(1px, 1px, 1px, 1px);\n white-space: nowrap;\n user-select: none;\n }\n " : '');
|
|
129
|
+
};
|
|
130
|
+
};
|
|
131
|
+
|
|
132
|
+
var titleInputStyles = function titleInputStyles(props) {
|
|
133
|
+
return (0, _react2.css)(_templateObject6 || (_templateObject6 = (0, _taggedTemplateLiteral2.default)(["\n outline: none;\n border: none;\n font-size: ", ";\n line-height: ", ";\n font-weight: normal;\n color: ", ";\n background: transparent;\n display: flex;\n flex: 1;\n padding: 0 0 0 ", "px;\n width: 100%;\n\n &::placeholder {\n opacity: 0.6;\n color: ", ";\n }\n"])), (0, _editorSharedStyles.relativeFontSizeToBase16)((0, _constants.fontSize)()), _editorSharedStyles.akEditorLineHeight, (0, _components.themed)({
|
|
134
|
+
light: colors.N200A,
|
|
135
|
+
dark: colors.DN600
|
|
136
|
+
})(props), (0, _constants.gridSize)() / 2, (0, _components.themed)({
|
|
137
|
+
light: colors.N200A,
|
|
138
|
+
dark: colors.DN600
|
|
139
|
+
})(props));
|
|
140
|
+
};
|
|
141
|
+
|
|
142
|
+
var titleContainerStyles = function titleContainerStyles(props) {
|
|
143
|
+
return (0, _react2.css)(_templateObject7 || (_templateObject7 = (0, _taggedTemplateLiteral2.default)(["\n padding: 0;\n display: flex;\n align-items: flex-start;\n background: none;\n border: none;\n font-size: ", ";\n width: 100%;\n color: ", ";\n overflow: hidden;\n cursor: pointer;\n // Prevent browser selection being inside the title container\n user-select: none;\n\n &:focus {\n outline: 0;\n }\n"])), (0, _editorSharedStyles.relativeFontSizeToBase16)((0, _constants.fontSize)()), (0, _components.themed)({
|
|
144
|
+
light: colors.N300A,
|
|
145
|
+
dark: colors.DN600
|
|
146
|
+
})(props));
|
|
147
|
+
};
|
|
148
|
+
|
|
111
149
|
var sharedExpandStyles = {
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
150
|
+
titleInputStyles: titleInputStyles,
|
|
151
|
+
titleContainerStyles: titleContainerStyles,
|
|
152
|
+
containerStyles: containerStyles,
|
|
153
|
+
contentStyles: contentStyles
|
|
116
154
|
};
|
|
117
155
|
exports.sharedExpandStyles = sharedExpandStyles;
|
|
@@ -5,7 +5,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
|
-
exports.REACT_INTL_ERROR_MESSAGE = exports.
|
|
8
|
+
exports.REACT_INTL_ERROR_MESSAGE = exports.IntlErrorBoundary = void 0;
|
|
9
9
|
|
|
10
10
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
11
11
|
|
|
@@ -38,15 +38,15 @@ var isMissingIntlProviderInAncestryError = function isMissingIntlProviderInAnces
|
|
|
38
38
|
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');
|
|
39
39
|
};
|
|
40
40
|
|
|
41
|
-
var
|
|
42
|
-
(0, _inherits2.default)(
|
|
41
|
+
var IntlErrorBoundary = /*#__PURE__*/function (_React$Component) {
|
|
42
|
+
(0, _inherits2.default)(IntlErrorBoundary, _React$Component);
|
|
43
43
|
|
|
44
|
-
var _super = _createSuper(
|
|
44
|
+
var _super = _createSuper(IntlErrorBoundary);
|
|
45
45
|
|
|
46
|
-
function
|
|
46
|
+
function IntlErrorBoundary() {
|
|
47
47
|
var _this;
|
|
48
48
|
|
|
49
|
-
(0, _classCallCheck2.default)(this,
|
|
49
|
+
(0, _classCallCheck2.default)(this, IntlErrorBoundary);
|
|
50
50
|
|
|
51
51
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
52
52
|
args[_key] = arguments[_key];
|
|
@@ -59,7 +59,7 @@ var IntlNextErrorBoundary = /*#__PURE__*/function (_React$Component) {
|
|
|
59
59
|
return _this;
|
|
60
60
|
}
|
|
61
61
|
|
|
62
|
-
(0, _createClass2.default)(
|
|
62
|
+
(0, _createClass2.default)(IntlErrorBoundary, [{
|
|
63
63
|
key: "componentDidCatch",
|
|
64
64
|
value: function componentDidCatch(error, errorInfo) {
|
|
65
65
|
// if missing IntlProvider in ancestry, we setup a fallback IntlProvider ourselves
|
|
@@ -84,7 +84,7 @@ var IntlNextErrorBoundary = /*#__PURE__*/function (_React$Component) {
|
|
|
84
84
|
return this.props.children;
|
|
85
85
|
}
|
|
86
86
|
}]);
|
|
87
|
-
return
|
|
87
|
+
return IntlErrorBoundary;
|
|
88
88
|
}(_react.default.Component);
|
|
89
89
|
|
|
90
|
-
exports.
|
|
90
|
+
exports.IntlErrorBoundary = IntlErrorBoundary;
|
|
@@ -13,6 +13,8 @@ var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/sli
|
|
|
13
13
|
|
|
14
14
|
var _react = _interopRequireDefault(require("react"));
|
|
15
15
|
|
|
16
|
+
var _react2 = require("@emotion/react");
|
|
17
|
+
|
|
16
18
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
17
19
|
|
|
18
20
|
var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
|
|
@@ -21,6 +23,7 @@ var _grid = require("./grid");
|
|
|
21
23
|
|
|
22
24
|
var _styled = require("./styled");
|
|
23
25
|
|
|
26
|
+
/** @jsx jsx */
|
|
24
27
|
var DEFAULT_IMAGE_WIDTH = 250;
|
|
25
28
|
exports.DEFAULT_IMAGE_WIDTH = DEFAULT_IMAGE_WIDTH;
|
|
26
29
|
var DEFAULT_IMAGE_HEIGHT = 200;
|
|
@@ -106,13 +109,15 @@ function MediaSingle(_ref) {
|
|
|
106
109
|
media = _children[0],
|
|
107
110
|
caption = _children[1];
|
|
108
111
|
|
|
109
|
-
return
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
112
|
+
return (0, _react2.jsx)("div", {
|
|
113
|
+
ref: handleMediaSingleRef,
|
|
114
|
+
css: (0, _styled.MediaSingleDimensionHelper)({
|
|
115
|
+
width: width,
|
|
116
|
+
layout: layout,
|
|
117
|
+
containerWidth: containerWidth,
|
|
118
|
+
pctWidth: pctWidth,
|
|
119
|
+
fullWidthMode: fullWidthMode
|
|
120
|
+
}),
|
|
116
121
|
"data-layout": layout,
|
|
117
122
|
"data-width": pctWidth,
|
|
118
123
|
"data-node-type": nodeType,
|
|
@@ -120,7 +125,7 @@ function MediaSingle(_ref) {
|
|
|
120
125
|
'is-loading': isLoading,
|
|
121
126
|
'rich-media-wrapped': layout === 'wrap-left' || layout === 'wrap-right'
|
|
122
127
|
})
|
|
123
|
-
},
|
|
128
|
+
}, (0, _react2.jsx)(_styled.MediaWrapper, {
|
|
124
129
|
hasFallbackContainer: hasFallbackContainer,
|
|
125
130
|
height: mediaWrapperHeight,
|
|
126
131
|
paddingBottom: paddingBottom
|
|
@@ -2,28 +2,29 @@
|
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
4
|
|
|
5
|
-
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
6
|
-
|
|
7
5
|
Object.defineProperty(exports, "__esModule", {
|
|
8
6
|
value: true
|
|
9
7
|
});
|
|
10
|
-
exports.MediaWrapper = exports.
|
|
8
|
+
exports.MediaWrapper = exports.MediaSingleDimensionHelper = void 0;
|
|
11
9
|
exports.calcLegacyWidth = calcLegacyWidth;
|
|
12
10
|
exports.calcResizedWidth = calcResizedWidth;
|
|
11
|
+
exports.mediaWrapperStyle = void 0;
|
|
12
|
+
|
|
13
|
+
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
13
14
|
|
|
14
15
|
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
15
16
|
|
|
16
|
-
var
|
|
17
|
+
var _react = _interopRequireDefault(require("react"));
|
|
18
|
+
|
|
19
|
+
var _react2 = require("@emotion/react");
|
|
17
20
|
|
|
18
21
|
var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
|
|
19
22
|
|
|
20
23
|
var _breakout = require("../../utils/breakout");
|
|
21
24
|
|
|
22
|
-
var
|
|
25
|
+
var _excluded = ["children"];
|
|
23
26
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
27
|
+
var _templateObject, _templateObject2, _templateObject3;
|
|
27
28
|
|
|
28
29
|
function float(layout) {
|
|
29
30
|
switch (layout) {
|
|
@@ -150,7 +151,7 @@ var MediaSingleDimensionHelper = function MediaSingleDimensionHelper(_ref) {
|
|
|
150
151
|
layout = _ref.layout,
|
|
151
152
|
pctWidth = _ref.pctWidth,
|
|
152
153
|
width = _ref.width;
|
|
153
|
-
return (0,
|
|
154
|
+
return (0, _react2.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n /* For nested rich media items, set max-width to 100% */\n tr &,\n [data-layout-column] &,\n [data-node-type='expand'] & {\n max-width: 100%;\n }\n\n width: ", ";\n max-width: ", ";\n float: ", ";\n margin: ", ";\n ", ";\n\n &:not(.is-resizing) {\n transition: width 100ms ease-in;\n }\n"])), pctWidth ? calcResizedWidth(layout, width || 0, containerWidth) : calcLegacyWidth(layout, width || 0, containerWidth, fullWidthMode, isResized), calcMaxWidth(layout, containerWidth), float(layout), calcMargin(layout), isImageAligned(layout));
|
|
154
155
|
};
|
|
155
156
|
|
|
156
157
|
exports.MediaSingleDimensionHelper = MediaSingleDimensionHelper;
|
|
@@ -159,20 +160,22 @@ var RenderFallbackContainer = function RenderFallbackContainer(_ref2) {
|
|
|
159
160
|
var hasFallbackContainer = _ref2.hasFallbackContainer,
|
|
160
161
|
paddingBottom = _ref2.paddingBottom,
|
|
161
162
|
height = _ref2.height;
|
|
162
|
-
return (0,
|
|
163
|
+
return (0, _react2.css)(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\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 ") : '');
|
|
163
164
|
};
|
|
164
165
|
|
|
165
|
-
var
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
}, function (_ref4) {
|
|
169
|
-
var hasFallbackContainer = _ref4.hasFallbackContainer;
|
|
170
|
-
return hasFallbackContainer ? 'absolute' : 'relative';
|
|
171
|
-
});
|
|
166
|
+
var mediaWrapperStyle = function mediaWrapperStyle(props) {
|
|
167
|
+
return (0, _react2.css)(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["\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');
|
|
168
|
+
};
|
|
172
169
|
|
|
173
|
-
exports.
|
|
170
|
+
exports.mediaWrapperStyle = mediaWrapperStyle;
|
|
174
171
|
|
|
175
|
-
var
|
|
172
|
+
var MediaWrapper = function MediaWrapper(_ref3) {
|
|
173
|
+
var children = _ref3.children,
|
|
174
|
+
rest = (0, _objectWithoutProperties2.default)(_ref3, _excluded);
|
|
175
|
+
return (0, _react2.jsx)("div", {
|
|
176
|
+
css: mediaWrapperStyle(rest)
|
|
177
|
+
}, children);
|
|
178
|
+
};
|
|
176
179
|
|
|
177
|
-
exports.
|
|
180
|
+
exports.MediaWrapper = MediaWrapper;
|
|
178
181
|
MediaWrapper.displayName = 'WrapperMediaSingle';
|
|
@@ -51,6 +51,8 @@ var Popup = /*#__PURE__*/function (_React$Component) {
|
|
|
51
51
|
var _super = _createSuper(Popup);
|
|
52
52
|
|
|
53
53
|
function Popup() {
|
|
54
|
+
var _window;
|
|
55
|
+
|
|
54
56
|
var _this;
|
|
55
57
|
|
|
56
58
|
(0, _classCallCheck2.default)(this, Popup);
|
|
@@ -77,6 +79,9 @@ var Popup = /*#__PURE__*/function (_React$Component) {
|
|
|
77
79
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "onResize", function () {
|
|
78
80
|
return _this.scheduledUpdatePosition(_this.props);
|
|
79
81
|
});
|
|
82
|
+
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "resizeObserver", (_window = window) !== null && _window !== void 0 && _window.ResizeObserver ? new ResizeObserver(function () {
|
|
83
|
+
_this.scheduledUpdatePosition(_this.props);
|
|
84
|
+
}) : undefined);
|
|
80
85
|
return _this;
|
|
81
86
|
}
|
|
82
87
|
|
|
@@ -202,9 +207,14 @@ var Popup = /*#__PURE__*/function (_React$Component) {
|
|
|
202
207
|
value: function componentDidMount() {
|
|
203
208
|
window.addEventListener('resize', this.onResize);
|
|
204
209
|
var stick = this.props.stick;
|
|
210
|
+
this.scrollParentElement = (0, _utils.findOverflowScrollParent)(this.props.target);
|
|
211
|
+
|
|
212
|
+
if (this.scrollParentElement && this.resizeObserver) {
|
|
213
|
+
this.resizeObserver.observe(this.scrollParentElement);
|
|
214
|
+
}
|
|
205
215
|
|
|
206
216
|
if (stick) {
|
|
207
|
-
this.scrollElement =
|
|
217
|
+
this.scrollElement = this.scrollParentElement;
|
|
208
218
|
} else {
|
|
209
219
|
this.scrollElement = this.props.scrollableElement;
|
|
210
220
|
}
|
|
@@ -222,6 +232,10 @@ var Popup = /*#__PURE__*/function (_React$Component) {
|
|
|
222
232
|
this.scrollElement.removeEventListener('scroll', this.onResize);
|
|
223
233
|
}
|
|
224
234
|
|
|
235
|
+
if (this.scrollParentElement && this.resizeObserver) {
|
|
236
|
+
this.resizeObserver.unobserve(this.scrollParentElement);
|
|
237
|
+
}
|
|
238
|
+
|
|
225
239
|
this.scheduledUpdatePosition.cancel();
|
|
226
240
|
}
|
|
227
241
|
}, {
|