@atlaskit/editor-common 70.1.3 → 70.2.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 +34 -0
- package/dist/cjs/react-node-view/index.js +19 -17
- package/dist/cjs/styles/index.js +12 -0
- package/dist/cjs/styles/shared/code-block.js +5 -3
- package/dist/cjs/styles/shared/lists.js +4 -2
- package/dist/cjs/styles/shared/table.js +1 -1
- package/dist/cjs/types/copy-button.js +5 -0
- package/dist/cjs/ui/DropList/index.js +1 -1
- package/dist/cjs/ui/Expand/index.js +2 -2
- package/dist/cjs/ui/IntlProviderIfMissingWrapper/index.js +33 -0
- package/dist/cjs/ui/Popup/index.js +2 -2
- package/dist/cjs/ui/PortalProvider/index.js +62 -47
- package/dist/cjs/ui/index.js +8 -0
- package/dist/cjs/utils/breakout.js +53 -2
- package/dist/cjs/utils/collab.js +22 -0
- package/dist/cjs/utils/dom.js +16 -0
- package/dist/cjs/utils/get-performance-options.js +70 -0
- package/dist/cjs/utils/index.js +57 -1
- package/dist/cjs/utils/outdated-browsers.js +41 -0
- package/dist/cjs/utils/referentiality.js +49 -0
- package/dist/cjs/utils/sendLogs.js +19 -0
- package/dist/cjs/version.json +1 -1
- package/dist/cjs/with-plugin-state/index.js +61 -54
- package/dist/es2019/react-node-view/index.js +19 -24
- package/dist/es2019/styles/index.js +2 -2
- package/dist/es2019/styles/shared/code-block.js +13 -1
- package/dist/es2019/styles/shared/lists.js +2 -1
- package/dist/es2019/styles/shared/table.js +4 -2
- package/dist/es2019/types/copy-button.js +1 -0
- package/dist/es2019/ui/DropList/index.js +1 -1
- package/dist/es2019/ui/Expand/index.js +17 -15
- package/dist/es2019/ui/IntlProviderIfMissingWrapper/index.js +18 -0
- package/dist/es2019/ui/Popup/index.js +2 -1
- package/dist/es2019/ui/PortalProvider/index.js +33 -14
- package/dist/es2019/ui/index.js +2 -1
- package/dist/es2019/utils/breakout.js +47 -1
- package/dist/es2019/utils/collab.js +13 -0
- package/dist/es2019/utils/dom.js +16 -0
- package/dist/es2019/utils/get-performance-options.js +57 -0
- package/dist/es2019/utils/index.js +6 -2
- package/dist/es2019/utils/outdated-browsers.js +32 -0
- package/dist/es2019/utils/referentiality.js +34 -0
- package/dist/es2019/utils/sendLogs.js +8 -0
- package/dist/es2019/version.json +1 -1
- package/dist/es2019/with-plugin-state/index.js +55 -52
- package/dist/esm/react-node-view/index.js +19 -22
- package/dist/esm/styles/index.js +2 -2
- package/dist/esm/styles/shared/code-block.js +4 -3
- package/dist/esm/styles/shared/lists.js +2 -1
- package/dist/esm/styles/shared/table.js +1 -1
- package/dist/esm/types/copy-button.js +1 -0
- package/dist/esm/ui/DropList/index.js +1 -1
- package/dist/esm/ui/Expand/index.js +2 -2
- package/dist/esm/ui/IntlProviderIfMissingWrapper/index.js +19 -0
- package/dist/esm/ui/Popup/index.js +2 -2
- package/dist/esm/ui/PortalProvider/index.js +59 -48
- package/dist/esm/ui/index.js +2 -1
- package/dist/esm/utils/breakout.js +46 -1
- package/dist/esm/utils/collab.js +13 -0
- package/dist/esm/utils/dom.js +16 -0
- package/dist/esm/utils/get-performance-options.js +55 -0
- package/dist/esm/utils/index.js +6 -2
- package/dist/esm/utils/outdated-browsers.js +32 -0
- package/dist/esm/utils/referentiality.js +40 -0
- package/dist/esm/utils/sendLogs.js +10 -0
- package/dist/esm/version.json +1 -1
- package/dist/esm/with-plugin-state/index.js +59 -54
- package/dist/types/analytics/types/events.d.ts +1 -0
- package/dist/types/extensions/types/extension-handler.d.ts +1 -0
- package/dist/types/styles/index.d.ts +2 -2
- package/dist/types/styles/shared/code-block.d.ts +1 -0
- package/dist/types/styles/shared/lists.d.ts +1 -0
- package/dist/types/types/copy-button.d.ts +20 -0
- package/dist/types/types/editor-actions.d.ts +1 -0
- package/dist/types/types/editor-container-width.d.ts +14 -0
- package/dist/types/types/feature-flags.d.ts +0 -6
- package/dist/types/types/floating-toolbar.d.ts +23 -2
- package/dist/types/types/index.d.ts +2 -1
- package/dist/types/ui/IntlProviderIfMissingWrapper/index.d.ts +6 -0
- package/dist/types/ui/Popup/index.d.ts +1 -0
- package/dist/types/ui/PortalProvider/index.d.ts +2 -1
- package/dist/types/ui/index.d.ts +1 -0
- package/dist/types/utils/breakout.d.ts +25 -0
- package/dist/types/utils/collab.d.ts +2 -0
- package/dist/types/utils/dom.d.ts +15 -1
- package/dist/types/utils/get-performance-options.d.ts +18 -0
- package/dist/types/utils/getModeFromTheme.d.ts +1 -1
- package/dist/types/utils/index.d.ts +5 -1
- package/dist/types/utils/outdated-browsers.d.ts +1 -0
- package/dist/types/utils/referentiality.d.ts +3 -0
- package/dist/types/utils/sendLogs.d.ts +1 -0
- package/dist/types/with-plugin-state/index.d.ts +4 -2
- package/dist/types-ts4.0/analytics/types/events.d.ts +1 -0
- package/dist/types-ts4.0/extensions/types/extension-handler.d.ts +1 -0
- package/dist/types-ts4.0/styles/index.d.ts +2 -2
- package/dist/types-ts4.0/styles/shared/code-block.d.ts +1 -0
- package/dist/types-ts4.0/styles/shared/lists.d.ts +1 -0
- package/dist/types-ts4.0/types/copy-button.d.ts +20 -0
- package/dist/types-ts4.0/types/editor-actions.d.ts +1 -0
- package/dist/types-ts4.0/types/editor-container-width.d.ts +14 -0
- package/dist/types-ts4.0/types/feature-flags.d.ts +0 -6
- package/dist/types-ts4.0/types/floating-toolbar.d.ts +23 -2
- package/dist/types-ts4.0/types/index.d.ts +2 -1
- package/dist/types-ts4.0/ui/IntlProviderIfMissingWrapper/index.d.ts +6 -0
- package/dist/types-ts4.0/ui/Popup/index.d.ts +1 -0
- package/dist/types-ts4.0/ui/PortalProvider/index.d.ts +2 -1
- package/dist/types-ts4.0/ui/index.d.ts +1 -0
- package/dist/types-ts4.0/utils/breakout.d.ts +25 -0
- package/dist/types-ts4.0/utils/collab.d.ts +2 -0
- package/dist/types-ts4.0/utils/dom.d.ts +15 -1
- package/dist/types-ts4.0/utils/get-performance-options.d.ts +18 -0
- package/dist/types-ts4.0/utils/getModeFromTheme.d.ts +1 -1
- package/dist/types-ts4.0/utils/index.d.ts +5 -1
- package/dist/types-ts4.0/utils/outdated-browsers.d.ts +1 -0
- package/dist/types-ts4.0/utils/referentiality.d.ts +3 -0
- package/dist/types-ts4.0/utils/sendLogs.d.ts +1 -0
- package/dist/types-ts4.0/with-plugin-state/index.d.ts +4 -2
- package/package.json +9 -6
- package/report.api.md +7 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,39 @@
|
|
|
1
1
|
# @atlaskit/editor-common
|
|
2
2
|
|
|
3
|
+
## 70.2.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [`30e8425f7d6`](https://bitbucket.org/atlassian/atlassian-frontend/commits/30e8425f7d6) - [ux] ED-15706 Reenable copy button on editor-plugin-table. Added property copyButton to floatingToolbarConfig.
|
|
8
|
+
- [`90c44a68da2`](https://bitbucket.org/atlassian/atlassian-frontend/commits/90c44a68da2) - Removed editor-core table plugin and replaced with new `editor-plugin-table` package. This change required adding copying new table changes from editor-core to the new table package, moving IconTable to shared package, and creating new entry-points from editor-plugin-table. `getPluginState` from `packages/editor/editor-plugin-table/src/plugins/table/pm-plugins/table-resizing` was also exported.
|
|
9
|
+
|
|
10
|
+
[ED-15674][ed15739] [ED-15633]
|
|
11
|
+
|
|
12
|
+
- [`61cd2188e62`](https://bitbucket.org/atlassian/atlassian-frontend/commits/61cd2188e62) - [ux] ED-15405 added horizontal scrolling to floating toolbar in case of overflow
|
|
13
|
+
|
|
14
|
+
### Patch Changes
|
|
15
|
+
|
|
16
|
+
- [`79a48f1c6b5`](https://bitbucket.org/atlassian/atlassian-frontend/commits/79a48f1c6b5) - Adds fragmentLocalId to ExtensionParams type.
|
|
17
|
+
- [`3f7900cbf37`](https://bitbucket.org/atlassian/atlassian-frontend/commits/3f7900cbf37) - [ux] ED-14993 added better support for codeblocks inside lists and gap cursor selection inside lists:
|
|
18
|
+
|
|
19
|
+
- made list markers visible in safari (desktop and mobile) when list contains codeblocks;
|
|
20
|
+
- fixed bug so users can now set gapcursor next to codeblock by clicking or touching (mobile) the list marker;
|
|
21
|
+
- fixed bug so when users have gapcursor next to a codeblock, they can still toggle (or untoggle) it into a list;
|
|
22
|
+
- fixed margins for codeblocks in lists;
|
|
23
|
+
|
|
24
|
+
- [`916c3b17290`](https://bitbucket.org/atlassian/atlassian-frontend/commits/916c3b17290) - ED-15573 re-enable getParticipantsCount in analytics payload
|
|
25
|
+
- [`e7836c150bb`](https://bitbucket.org/atlassian/atlassian-frontend/commits/e7836c150bb) - Re-enable Performance metric for ReactNodeView, WithPluginState
|
|
26
|
+
- [`b2b98eca8cc`](https://bitbucket.org/atlassian/atlassian-frontend/commits/b2b98eca8cc) - ED-14814 Add "outdatedBrowser" attribute into analytics error payload, add browser check and expose the function "isOutdatedBrowser()"
|
|
27
|
+
- [`51e84999643`](https://bitbucket.org/atlassian/atlassian-frontend/commits/51e84999643) - ED-15381 - Patch table / layout CSS to fix issue of ProseMirror gapcursor within the cell
|
|
28
|
+
- [`edb93baa953`](https://bitbucket.org/atlassian/atlassian-frontend/commits/edb93baa953) - Moved sendLogs to editor-common. Re-exported in editor-core and import sendLogs from editor-common in editor-plugin-table package.
|
|
29
|
+
- [`184d3cf7ce6`](https://bitbucket.org/atlassian/atlassian-frontend/commits/184d3cf7ce6) - Preventing error being logged to the console if the consumer of the Editor component does not have IntlProvider in the component hierarchy.
|
|
30
|
+
- [`8c16cb97a11`](https://bitbucket.org/atlassian/atlassian-frontend/commits/8c16cb97a11) - ED-12676 cleanup useUnpredictableInputRule feature flag
|
|
31
|
+
- [`47f1c7fff80`](https://bitbucket.org/atlassian/atlassian-frontend/commits/47f1c7fff80) - [ux] ED-14991 rework extension breakout to share logic with breakout mark views. Fixes an issue where iframes inside bodied extensions that were set to full-width or wide would be blurry.
|
|
32
|
+
- [`ab072299e05`](https://bitbucket.org/atlassian/atlassian-frontend/commits/ab072299e05) - ED-15519 - Extensions used as data sources will now display a delete confirmation dialog
|
|
33
|
+
- [`992ed2b7e2a`](https://bitbucket.org/atlassian/atlassian-frontend/commits/992ed2b7e2a) - ED-15510 Fixes animation when resizing breakout
|
|
34
|
+
- [`3cecda14f87`](https://bitbucket.org/atlassian/atlassian-frontend/commits/3cecda14f87) - [ED-15847] Changes to fix a regression caused in ED-15805 Id attribute given to identify type of floating toolbars
|
|
35
|
+
- Updated dependencies
|
|
36
|
+
|
|
3
37
|
## 70.1.3
|
|
4
38
|
|
|
5
39
|
### Patch Changes
|
|
@@ -23,6 +23,8 @@ var _eventDispatcher = require("../event-dispatcher");
|
|
|
23
23
|
|
|
24
24
|
var _ErrorBoundary = require("../ui/ErrorBoundary");
|
|
25
25
|
|
|
26
|
+
var _utils = require("../utils");
|
|
27
|
+
|
|
26
28
|
var _analytics2 = require("../utils/analytics");
|
|
27
29
|
|
|
28
30
|
var ReactNodeView = /*#__PURE__*/function () {
|
|
@@ -91,26 +93,26 @@ var ReactNodeView = /*#__PURE__*/function () {
|
|
|
91
93
|
// difference between them and it kills the nodeView
|
|
92
94
|
|
|
93
95
|
|
|
94
|
-
this.domRef.classList.add("".concat(this.node.type.name, "View-content-wrap"));
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
//trackingEnabled &&
|
|
101
|
-
// startMeasureReactNodeViewRendered({ nodeTypeName: this.node.type.name });
|
|
96
|
+
this.domRef.classList.add("".concat(this.node.type.name, "View-content-wrap"));
|
|
97
|
+
|
|
98
|
+
var _getPerformanceOption = (0, _utils.getPerformanceOptions)(this.view),
|
|
99
|
+
samplingRate = _getPerformanceOption.samplingRate,
|
|
100
|
+
slowThreshold = _getPerformanceOption.slowThreshold,
|
|
101
|
+
trackingEnabled = _getPerformanceOption.trackingEnabled;
|
|
102
102
|
|
|
103
|
+
trackingEnabled && (0, _utils.startMeasureReactNodeViewRendered)({
|
|
104
|
+
nodeTypeName: this.node.type.name
|
|
105
|
+
});
|
|
103
106
|
this.renderReactComponent(function () {
|
|
104
107
|
return _this2.render(_this2.reactComponentProps, _this2.handleRef);
|
|
105
|
-
});
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
108
|
+
});
|
|
109
|
+
trackingEnabled && (0, _utils.stopMeasureReactNodeViewRendered)({
|
|
110
|
+
nodeTypeName: this.node.type.name,
|
|
111
|
+
dispatchAnalyticsEvent: this.dispatchAnalyticsEvent,
|
|
112
|
+
editorState: this.view.state,
|
|
113
|
+
samplingRate: samplingRate,
|
|
114
|
+
slowThreshold: slowThreshold
|
|
115
|
+
});
|
|
114
116
|
return this;
|
|
115
117
|
}
|
|
116
118
|
}, {
|
package/dist/cjs/styles/index.js
CHANGED
|
@@ -99,6 +99,12 @@ Object.defineProperty(exports, "calcTableWidth", {
|
|
|
99
99
|
return _table.calcTableWidth;
|
|
100
100
|
}
|
|
101
101
|
});
|
|
102
|
+
Object.defineProperty(exports, "codeBlockInListSafariFix", {
|
|
103
|
+
enumerable: true,
|
|
104
|
+
get: function get() {
|
|
105
|
+
return _codeBlock.codeBlockInListSafariFix;
|
|
106
|
+
}
|
|
107
|
+
});
|
|
102
108
|
Object.defineProperty(exports, "codeBlockSharedStyles", {
|
|
103
109
|
enumerable: true,
|
|
104
110
|
get: function get() {
|
|
@@ -141,6 +147,12 @@ Object.defineProperty(exports, "linkSharedStyle", {
|
|
|
141
147
|
return _link.linkSharedStyle;
|
|
142
148
|
}
|
|
143
149
|
});
|
|
150
|
+
Object.defineProperty(exports, "listPaddingLeftMarkerSpace", {
|
|
151
|
+
enumerable: true,
|
|
152
|
+
get: function get() {
|
|
153
|
+
return _lists.listPaddingLeftMarkerSpace;
|
|
154
|
+
}
|
|
155
|
+
});
|
|
144
156
|
Object.defineProperty(exports, "listsSharedStyles", {
|
|
145
157
|
enumerable: true,
|
|
146
158
|
get: function get() {
|
|
@@ -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.codeBlockSharedStyles = exports.CodeBlockSharedCssClassName = void 0;
|
|
8
|
+
exports.codeBlockSharedStyles = exports.codeBlockInListSafariFix = exports.CodeBlockSharedCssClassName = void 0;
|
|
9
9
|
|
|
10
10
|
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
11
11
|
|
|
@@ -21,7 +21,7 @@ var _constants = require("@atlaskit/theme/constants");
|
|
|
21
21
|
|
|
22
22
|
var _tokens = require("@atlaskit/tokens");
|
|
23
23
|
|
|
24
|
-
var _templateObject;
|
|
24
|
+
var _templateObject, _templateObject2;
|
|
25
25
|
|
|
26
26
|
var CodeBlockSharedCssClassName = {
|
|
27
27
|
CODEBLOCK_CONTAINER: 'code-block',
|
|
@@ -57,4 +57,6 @@ var codeBlockSharedStyles = function codeBlockSharedStyles(props) {
|
|
|
57
57
|
})(props), (0, _constants.borderRadius)(), (0, _constants.gridSize)(), (0, _editorSharedStyles.relativeFontSizeToBase16)((0, _constants.fontSize)()));
|
|
58
58
|
};
|
|
59
59
|
|
|
60
|
-
exports.codeBlockSharedStyles = codeBlockSharedStyles;
|
|
60
|
+
exports.codeBlockSharedStyles = codeBlockSharedStyles;
|
|
61
|
+
var codeBlockInListSafariFix = (0, _react.css)(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n ::before {\n content: ' ';\n line-height: ", ";\n }\n\n > p:first-child,\n > .code-block:first-child,\n > .ProseMirror-gapcursor:first-child + .code-block {\n margin-top: -", "em !important;\n }\n"])), _editorSharedStyles.akEditorLineHeight, _editorSharedStyles.akEditorLineHeight);
|
|
62
|
+
exports.codeBlockInListSafariFix = codeBlockInListSafariFix;
|
|
@@ -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.listsSharedStyles = void 0;
|
|
8
|
+
exports.listsSharedStyles = exports.listPaddingLeftMarkerSpace = void 0;
|
|
9
9
|
|
|
10
10
|
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
11
11
|
|
|
@@ -17,5 +17,7 @@ var _browser = _interopRequireDefault(require("../../utils/browser"));
|
|
|
17
17
|
|
|
18
18
|
var _templateObject;
|
|
19
19
|
|
|
20
|
-
var
|
|
20
|
+
var listPaddingLeftMarkerSpace = 24;
|
|
21
|
+
exports.listPaddingLeftMarkerSpace = listPaddingLeftMarkerSpace;
|
|
22
|
+
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: ", "px;\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"])), listPaddingLeftMarkerSpace, _browser.default.gecko ? 'display: inline-block;' : '', _adfSchema.orderedListSelector, _adfSchema.bulletListSelector);
|
|
21
23
|
exports.listsSharedStyles = listsSharedStyles;
|
|
@@ -61,7 +61,7 @@ var TableSharedCssClassName = {
|
|
|
61
61
|
exports.TableSharedCssClassName = TableSharedCssClassName;
|
|
62
62
|
|
|
63
63
|
var tableSharedStyle = function tableSharedStyle(props) {
|
|
64
|
-
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-of-type > 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: ", ";\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:not(style),\n > style:first-child + * {\n margin-top: 0;\n }\n\n > .ProseMirror-gapcursor
|
|
64
|
+
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-of-type > 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: ", ";\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:not(style),\n > style:first-child + * {\n margin-top: 0;\n }\n\n > .ProseMirror-gapcursor:first-child + *,\n > style:first-child + .ProseMirror-gapcursor + * {\n margin-top: 0;\n }\n\n > .ProseMirror-gapcursor:first-child + span + *,\n > style:first-child + .ProseMirror-gapcursor + 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)({
|
|
65
65
|
light: (0, _tokens.token)('color.border', _editorSharedStyles.akEditorTableBorder),
|
|
66
66
|
dark: (0, _tokens.token)('color.border', _editorSharedStyles.akEditorTableBorderDark)
|
|
67
67
|
})(props), (0, _tokens.token)('color.background.neutral.subtle', 'white'), tableCellMinWidth, (0, _components.themed)({
|
|
@@ -46,7 +46,7 @@ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflec
|
|
|
46
46
|
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; } }
|
|
47
47
|
|
|
48
48
|
var packageName = "@atlaskit/editor-common";
|
|
49
|
-
var packageVersion = "70.
|
|
49
|
+
var packageVersion = "70.2.0";
|
|
50
50
|
var halfFocusRing = 1;
|
|
51
51
|
var dropOffset = "0, ".concat((0, _constants.gridSize)(), "px");
|
|
52
52
|
|
|
@@ -118,7 +118,7 @@ var containerStyles = function containerStyles(styleProps) {
|
|
|
118
118
|
var marginHorizontal = styleProps['data-node-type'] === 'expand' ? "-".concat(_editorSharedStyles.akLayoutGutterOffset, "px") : 0;
|
|
119
119
|
var margin = "".concat(marginTop, " ").concat(marginHorizontal, " ").concat(marginBottom);
|
|
120
120
|
return function (themeProps) {
|
|
121
|
-
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 // TODO: https://product-fabric.atlassian.net/browse/DSP-4152\n
|
|
121
|
+
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 // TODO: Remove the border styles below once design tokens have been enabled and fallbacks are no longer triggered.\n // This is because the default state already uses the same token and, as such, the hover style won't change anything.\n // https://product-fabric.atlassian.net/browse/DSP-4152\n border: 1px solid\n ", ";\n background: ", ";\n }\n\n td > :not(style):first-child,\n td > style: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)({
|
|
122
122
|
light: (0, _tokens.token)('color.border', colors.N50A),
|
|
123
123
|
dark: (0, _tokens.token)('color.border', colors.DN50)
|
|
124
124
|
})(themeProps), EXPAND_SELECTED_BACKGROUND(themeProps));
|
|
@@ -127,7 +127,7 @@ var containerStyles = function containerStyles(styleProps) {
|
|
|
127
127
|
|
|
128
128
|
var contentStyles = function contentStyles(styleProps) {
|
|
129
129
|
return function (themeProps) {
|
|
130
|
-
return (0, _react2.css)(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2.default)(["\n
|
|
130
|
+
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 " : '');
|
|
131
131
|
};
|
|
132
132
|
};
|
|
133
133
|
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.default = IntlProviderIfMissingWrapper;
|
|
9
|
+
|
|
10
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
11
|
+
|
|
12
|
+
var _reactIntlNext = require("react-intl-next");
|
|
13
|
+
|
|
14
|
+
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); }
|
|
15
|
+
|
|
16
|
+
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; }
|
|
17
|
+
|
|
18
|
+
var useCheckIntlContext = function useCheckIntlContext() {
|
|
19
|
+
return (0, _react.useContext)(_reactIntlNext.IntlContext) === null;
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
function IntlProviderIfMissingWrapper(_ref) {
|
|
23
|
+
var children = _ref.children;
|
|
24
|
+
var missingIntlContext = useCheckIntlContext();
|
|
25
|
+
|
|
26
|
+
if (missingIntlContext) {
|
|
27
|
+
return /*#__PURE__*/_react.default.createElement(_reactIntlNext.IntlProvider, {
|
|
28
|
+
locale: "en"
|
|
29
|
+
}, children);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
return children;
|
|
33
|
+
}
|
|
@@ -251,10 +251,10 @@ var Popup = /*#__PURE__*/function (_React$Component) {
|
|
|
251
251
|
|
|
252
252
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
253
253
|
ref: this.handleRef,
|
|
254
|
-
style: _objectSpread({
|
|
254
|
+
style: _objectSpread(_objectSpread({
|
|
255
255
|
position: 'absolute',
|
|
256
256
|
zIndex: this.props.zIndex || _editorSharedStyles.akEditorFloatingPanelZIndex
|
|
257
|
-
}, position),
|
|
257
|
+
}, position), this.props.style),
|
|
258
258
|
"aria-label": this.props.ariaLabel || 'Popup' // Indicates component is an editor pop. Required for focus handling in Message.tsx
|
|
259
259
|
,
|
|
260
260
|
"data-editor-popup": true
|
|
@@ -25,6 +25,8 @@ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/de
|
|
|
25
25
|
|
|
26
26
|
var _react = _interopRequireDefault(require("react"));
|
|
27
27
|
|
|
28
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
29
|
+
|
|
28
30
|
var _reactDom = require("react-dom");
|
|
29
31
|
|
|
30
32
|
var _reactIntlNext = require("react-intl-next");
|
|
@@ -37,8 +39,12 @@ var _analytics = require("../../analytics");
|
|
|
37
39
|
|
|
38
40
|
var _eventDispatcher = require("../../event-dispatcher");
|
|
39
41
|
|
|
42
|
+
var _IntlProviderIfMissingWrapper = _interopRequireDefault(require("../IntlProviderIfMissingWrapper"));
|
|
43
|
+
|
|
40
44
|
var _PortalProviderThemesProvider = require("./PortalProviderThemesProvider");
|
|
41
45
|
|
|
46
|
+
var _class;
|
|
47
|
+
|
|
42
48
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
|
|
43
49
|
|
|
44
50
|
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; } }
|
|
@@ -67,8 +73,6 @@ var PortalProviderAPI = /*#__PURE__*/function (_EventDispatcher) {
|
|
|
67
73
|
(0, _createClass2.default)(PortalProviderAPI, [{
|
|
68
74
|
key: "render",
|
|
69
75
|
value: function render(children, container) {
|
|
70
|
-
var _this2 = this;
|
|
71
|
-
|
|
72
76
|
var hasAnalyticsContext = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
73
77
|
var hasIntlContext = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
|
|
74
78
|
this.portals.set(container, {
|
|
@@ -77,13 +81,11 @@ var PortalProviderAPI = /*#__PURE__*/function (_EventDispatcher) {
|
|
|
77
81
|
hasIntlContext: hasIntlContext
|
|
78
82
|
});
|
|
79
83
|
|
|
80
|
-
var childrenWithThemeProviders =
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
}, children());
|
|
84
|
-
};
|
|
84
|
+
var childrenWithThemeProviders = /*#__PURE__*/_react.default.createElement(_PortalProviderThemesProvider.PortalProviderThemeProviders, {
|
|
85
|
+
mode: this.themeMode
|
|
86
|
+
}, children());
|
|
85
87
|
|
|
86
|
-
var wrappedChildren = this.useAnalyticsContext ? /*#__PURE__*/_react.default.createElement(AnalyticsContextWrapper, null, childrenWithThemeProviders
|
|
88
|
+
var wrappedChildren = this.useAnalyticsContext ? /*#__PURE__*/_react.default.createElement(AnalyticsContextWrapper, null, childrenWithThemeProviders) : childrenWithThemeProviders;
|
|
87
89
|
|
|
88
90
|
if (hasIntlContext) {
|
|
89
91
|
wrappedChildren = /*#__PURE__*/_react.default.createElement(_reactIntlNext.RawIntlProvider, {
|
|
@@ -99,36 +101,34 @@ var PortalProviderAPI = /*#__PURE__*/function (_EventDispatcher) {
|
|
|
99
101
|
}, {
|
|
100
102
|
key: "forceUpdate",
|
|
101
103
|
value: function forceUpdate(_ref) {
|
|
102
|
-
var
|
|
104
|
+
var _this2 = this;
|
|
103
105
|
|
|
104
106
|
var intl = _ref.intl,
|
|
105
107
|
themeMode = _ref.themeMode;
|
|
106
108
|
this.intl = intl;
|
|
107
109
|
this.themeMode = themeMode;
|
|
108
110
|
this.portals.forEach(function (portal, container) {
|
|
109
|
-
if (!portal.hasAnalyticsContext && !
|
|
111
|
+
if (!portal.hasAnalyticsContext && !_this2.useAnalyticsContext && !portal.hasIntlContext) {
|
|
110
112
|
return;
|
|
111
113
|
}
|
|
112
114
|
|
|
113
115
|
var wrappedChildren = portal.children();
|
|
114
116
|
|
|
115
|
-
var childrenWithThemeProviders =
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
}, wrappedChildren);
|
|
119
|
-
};
|
|
117
|
+
var childrenWithThemeProviders = /*#__PURE__*/_react.default.createElement(_PortalProviderThemesProvider.PortalProviderThemeProviders, {
|
|
118
|
+
mode: themeMode
|
|
119
|
+
}, wrappedChildren);
|
|
120
120
|
|
|
121
|
-
if (portal.hasAnalyticsContext &&
|
|
122
|
-
wrappedChildren = /*#__PURE__*/_react.default.createElement(AnalyticsContextWrapper, null, childrenWithThemeProviders
|
|
121
|
+
if (portal.hasAnalyticsContext && _this2.useAnalyticsContext) {
|
|
122
|
+
wrappedChildren = /*#__PURE__*/_react.default.createElement(AnalyticsContextWrapper, null, childrenWithThemeProviders);
|
|
123
123
|
}
|
|
124
124
|
|
|
125
125
|
if (portal.hasIntlContext) {
|
|
126
126
|
wrappedChildren = /*#__PURE__*/_react.default.createElement(_reactIntlNext.RawIntlProvider, {
|
|
127
|
-
value:
|
|
128
|
-
}, childrenWithThemeProviders
|
|
127
|
+
value: _this2.intl
|
|
128
|
+
}, childrenWithThemeProviders);
|
|
129
129
|
}
|
|
130
130
|
|
|
131
|
-
(0, _reactDom.unstable_renderSubtreeIntoContainer)(
|
|
131
|
+
(0, _reactDom.unstable_renderSubtreeIntoContainer)(_this2.context, wrappedChildren, container);
|
|
132
132
|
});
|
|
133
133
|
}
|
|
134
134
|
}, {
|
|
@@ -176,12 +176,12 @@ var BasePortalProvider = /*#__PURE__*/function (_React$Component) {
|
|
|
176
176
|
var _super2 = _createSuper(BasePortalProvider);
|
|
177
177
|
|
|
178
178
|
function BasePortalProvider(props) {
|
|
179
|
-
var
|
|
179
|
+
var _this3;
|
|
180
180
|
|
|
181
181
|
(0, _classCallCheck2.default)(this, BasePortalProvider);
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
return
|
|
182
|
+
_this3 = _super2.call(this, props);
|
|
183
|
+
_this3.portalProviderAPI = new PortalProviderAPI(props.intl, props.onAnalyticsEvent, props.useAnalyticsContext, props.themeMode);
|
|
184
|
+
return _this3;
|
|
185
185
|
}
|
|
186
186
|
|
|
187
187
|
(0, _createClass2.default)(BasePortalProvider, [{
|
|
@@ -205,51 +205,65 @@ var BasePortalProvider = /*#__PURE__*/function (_React$Component) {
|
|
|
205
205
|
var PortalProvider = (0, _reactIntlNext.injectIntl)(BasePortalProvider);
|
|
206
206
|
exports.PortalProvider = PortalProvider;
|
|
207
207
|
|
|
208
|
-
var PortalProviderWithThemeProviders = function PortalProviderWithThemeProviders(
|
|
208
|
+
var PortalProviderWithThemeProviders = function PortalProviderWithThemeProviders(_ref2) {
|
|
209
|
+
var onAnalyticsEvent = _ref2.onAnalyticsEvent,
|
|
210
|
+
useAnalyticsContext = _ref2.useAnalyticsContext,
|
|
211
|
+
render = _ref2.render;
|
|
212
|
+
return /*#__PURE__*/_react.default.createElement(_IntlProviderIfMissingWrapper.default, null, /*#__PURE__*/_react.default.createElement(PortalProviderWithThemeAndIntlProviders, {
|
|
213
|
+
onAnalyticsEvent: onAnalyticsEvent,
|
|
214
|
+
useAnalyticsContext: useAnalyticsContext,
|
|
215
|
+
render: render
|
|
216
|
+
}));
|
|
217
|
+
};
|
|
218
|
+
|
|
219
|
+
exports.PortalProviderWithThemeProviders = PortalProviderWithThemeProviders;
|
|
220
|
+
|
|
221
|
+
var PortalProviderWithThemeAndIntlProviders = function PortalProviderWithThemeAndIntlProviders(_ref3) {
|
|
222
|
+
var onAnalyticsEvent = _ref3.onAnalyticsEvent,
|
|
223
|
+
useAnalyticsContext = _ref3.useAnalyticsContext,
|
|
224
|
+
render = _ref3.render;
|
|
209
225
|
var intl = (0, _reactIntlNext.useIntl)();
|
|
210
226
|
var globalTheme = (0, _components.useGlobalTheme)();
|
|
211
227
|
return /*#__PURE__*/_react.default.createElement(BasePortalProvider, {
|
|
212
228
|
intl: intl,
|
|
213
229
|
themeMode: globalTheme.mode,
|
|
214
|
-
onAnalyticsEvent:
|
|
215
|
-
useAnalyticsContext:
|
|
216
|
-
render:
|
|
230
|
+
onAnalyticsEvent: onAnalyticsEvent,
|
|
231
|
+
useAnalyticsContext: useAnalyticsContext,
|
|
232
|
+
render: render
|
|
217
233
|
});
|
|
218
234
|
};
|
|
219
235
|
|
|
220
|
-
exports.PortalProviderWithThemeProviders = PortalProviderWithThemeProviders;
|
|
221
|
-
|
|
222
236
|
var PortalRenderer = /*#__PURE__*/function (_React$Component2) {
|
|
223
237
|
(0, _inherits2.default)(PortalRenderer, _React$Component2);
|
|
224
238
|
|
|
225
239
|
var _super3 = _createSuper(PortalRenderer);
|
|
226
240
|
|
|
227
241
|
function PortalRenderer(props) {
|
|
228
|
-
var
|
|
242
|
+
var _this4;
|
|
229
243
|
|
|
230
244
|
(0, _classCallCheck2.default)(this, PortalRenderer);
|
|
231
|
-
|
|
232
|
-
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(
|
|
233
|
-
return
|
|
245
|
+
_this4 = _super3.call(this, props);
|
|
246
|
+
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this4), "handleUpdate", function (portals) {
|
|
247
|
+
return _this4.setState({
|
|
234
248
|
portals: portals
|
|
235
249
|
});
|
|
236
250
|
});
|
|
237
|
-
props.portalProviderAPI.setContext((0, _assertThisInitialized2.default)(
|
|
238
|
-
props.portalProviderAPI.on('update',
|
|
239
|
-
|
|
251
|
+
props.portalProviderAPI.setContext((0, _assertThisInitialized2.default)(_this4));
|
|
252
|
+
props.portalProviderAPI.on('update', _this4.handleUpdate);
|
|
253
|
+
_this4.state = {
|
|
240
254
|
portals: new Map()
|
|
241
255
|
};
|
|
242
|
-
return
|
|
256
|
+
return _this4;
|
|
243
257
|
}
|
|
244
258
|
|
|
245
259
|
(0, _createClass2.default)(PortalRenderer, [{
|
|
246
260
|
key: "render",
|
|
247
261
|
value: function render() {
|
|
248
262
|
var portals = this.state.portals;
|
|
249
|
-
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, Array.from(portals.entries()).map(function (
|
|
250
|
-
var
|
|
251
|
-
container =
|
|
252
|
-
children =
|
|
263
|
+
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, Array.from(portals.entries()).map(function (_ref4) {
|
|
264
|
+
var _ref5 = (0, _slicedToArray2.default)(_ref4, 2),
|
|
265
|
+
container = _ref5[0],
|
|
266
|
+
children = _ref5[1];
|
|
253
267
|
|
|
254
268
|
return /*#__PURE__*/(0, _reactDom.createPortal)(children, container);
|
|
255
269
|
}));
|
|
@@ -267,8 +281,7 @@ var dummyAnalyticsContext = {
|
|
|
267
281
|
getAtlaskitAnalyticsContext: function getAtlaskitAnalyticsContext() {},
|
|
268
282
|
getAtlaskitAnalyticsEventHandlers: function getAtlaskitAnalyticsEventHandlers() {}
|
|
269
283
|
};
|
|
270
|
-
|
|
271
|
-
var AnalyticsContextWrapper = /*#__PURE__*/function (_React$Component3) {
|
|
284
|
+
var AnalyticsContextWrapper = (_class = /*#__PURE__*/function (_React$Component3) {
|
|
272
285
|
(0, _inherits2.default)(AnalyticsContextWrapper, _React$Component3);
|
|
273
286
|
|
|
274
287
|
var _super4 = _createSuper(AnalyticsContextWrapper);
|
|
@@ -281,10 +294,10 @@ var AnalyticsContextWrapper = /*#__PURE__*/function (_React$Component3) {
|
|
|
281
294
|
(0, _createClass2.default)(AnalyticsContextWrapper, [{
|
|
282
295
|
key: "render",
|
|
283
296
|
value: function render() {
|
|
284
|
-
var
|
|
297
|
+
var _ref6 = this.context.contextAdapter.analytics || {
|
|
285
298
|
value: dummyAnalyticsContext
|
|
286
299
|
},
|
|
287
|
-
value =
|
|
300
|
+
value = _ref6.value;
|
|
288
301
|
|
|
289
302
|
return /*#__PURE__*/_react.default.createElement(_analyticsNextStableReactContext.default.Provider, {
|
|
290
303
|
value: value
|
|
@@ -292,4 +305,6 @@ var AnalyticsContextWrapper = /*#__PURE__*/function (_React$Component3) {
|
|
|
292
305
|
}
|
|
293
306
|
}]);
|
|
294
307
|
return AnalyticsContextWrapper;
|
|
295
|
-
}(_react.default.Component)
|
|
308
|
+
}(_react.default.Component), (0, _defineProperty2.default)(_class, "contextTypes", {
|
|
309
|
+
contextAdapter: _propTypes.default.object
|
|
310
|
+
}), _class);
|
package/dist/cjs/ui/index.js
CHANGED
|
@@ -61,6 +61,12 @@ Object.defineProperty(exports, "IntlErrorBoundary", {
|
|
|
61
61
|
return _IntlErrorBoundary.IntlErrorBoundary;
|
|
62
62
|
}
|
|
63
63
|
});
|
|
64
|
+
Object.defineProperty(exports, "IntlProviderIfMissingWrapper", {
|
|
65
|
+
enumerable: true,
|
|
66
|
+
get: function get() {
|
|
67
|
+
return _IntlProviderIfMissingWrapper.default;
|
|
68
|
+
}
|
|
69
|
+
});
|
|
64
70
|
Object.defineProperty(exports, "MediaSingle", {
|
|
65
71
|
enumerable: true,
|
|
66
72
|
get: function get() {
|
|
@@ -290,6 +296,8 @@ var _clearNextSiblingMarginTop = require("./clear-next-sibling-margin-top");
|
|
|
290
296
|
|
|
291
297
|
var _IntlErrorBoundary = require("./IntlErrorBoundary");
|
|
292
298
|
|
|
299
|
+
var _IntlProviderIfMissingWrapper = _interopRequireDefault(require("./IntlProviderIfMissingWrapper"));
|
|
300
|
+
|
|
293
301
|
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); }
|
|
294
302
|
|
|
295
303
|
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; }
|
|
@@ -3,7 +3,10 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
6
|
+
exports.calcBreakoutWidth = exports.breakoutConsts = exports.absoluteBreakoutWidth = void 0;
|
|
7
|
+
exports.calcBreakoutWidthPx = calcBreakoutWidthPx;
|
|
8
|
+
exports.calcWideWidth = void 0;
|
|
9
|
+
exports.calculateBreakoutStyles = calculateBreakoutStyles;
|
|
7
10
|
|
|
8
11
|
var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
|
|
9
12
|
|
|
@@ -11,6 +14,8 @@ var _BaseTheme = require("../ui/BaseTheme");
|
|
|
11
14
|
|
|
12
15
|
var _WidthProvider = require("../ui/WidthProvider");
|
|
13
16
|
|
|
17
|
+
var _dom = require("./dom");
|
|
18
|
+
|
|
14
19
|
/**
|
|
15
20
|
* Variables required to construct a context for breakout ssr inline script.
|
|
16
21
|
*
|
|
@@ -24,6 +29,11 @@ var breakoutConsts = {
|
|
|
24
29
|
wideLayoutWidth: _editorSharedStyles.akEditorWideLayoutWidth,
|
|
25
30
|
mapBreakpointToLayoutMaxWidth: _BaseTheme.mapBreakpointToLayoutMaxWidth,
|
|
26
31
|
getBreakpoint: _WidthProvider.getBreakpoint,
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Consumers are opinionated that this will always return a string ending in
|
|
35
|
+
* `px` when called with `full-width` or `wide` as the layout parameter.
|
|
36
|
+
*/
|
|
27
37
|
calcBreakoutWidth: function calcBreakoutWidth(layout, containerWidth) {
|
|
28
38
|
var effectiveFullWidth = containerWidth - breakoutConsts.padding;
|
|
29
39
|
|
|
@@ -76,4 +86,45 @@ exports.absoluteBreakoutWidth = absoluteBreakoutWidth;
|
|
|
76
86
|
var calcWideWidth = breakoutConsts.calcWideWidth;
|
|
77
87
|
exports.calcWideWidth = calcWideWidth;
|
|
78
88
|
var calcBreakoutWidth = breakoutConsts.calcBreakoutWidth;
|
|
79
|
-
exports.calcBreakoutWidth = calcBreakoutWidth;
|
|
89
|
+
exports.calcBreakoutWidth = calcBreakoutWidth;
|
|
90
|
+
|
|
91
|
+
function calculateBreakoutStyles(_ref) {
|
|
92
|
+
var mode = _ref.mode,
|
|
93
|
+
widthStateLineLength = _ref.widthStateLineLength,
|
|
94
|
+
widthStateWidth = _ref.widthStateWidth;
|
|
95
|
+
var breakoutWidth = calcBreakoutWidth(mode, widthStateWidth);
|
|
96
|
+
var breakoutWidthPx = (0, _dom.parsePx)(breakoutWidth);
|
|
97
|
+
|
|
98
|
+
if (!widthStateLineLength) {
|
|
99
|
+
// lineLength is not normally undefined when this is run for,
|
|
100
|
+
// consumers but can be in SSR, initial render or test (jsdom)
|
|
101
|
+
// environments.
|
|
102
|
+
//
|
|
103
|
+
// this approach doesn't work well with position: fixed, so
|
|
104
|
+
// it breaks things like sticky headers.
|
|
105
|
+
//
|
|
106
|
+
// It can also cause bluriness for some child content (such as iframes)
|
|
107
|
+
return {
|
|
108
|
+
type: 'line-length-unknown',
|
|
109
|
+
width: breakoutWidth,
|
|
110
|
+
transform: 'translateX(-50%)',
|
|
111
|
+
marginLeft: '50%'
|
|
112
|
+
};
|
|
113
|
+
} // NOTE
|
|
114
|
+
// At time of writing -- when toggling between full-width and
|
|
115
|
+
// full-page appearance modes. There is a slight delay before
|
|
116
|
+
// the widthState is updated.
|
|
117
|
+
// During this period -- the marginLeftPx will be incorrect.
|
|
118
|
+
|
|
119
|
+
|
|
120
|
+
var marginLeftPx = -(breakoutWidthPx - widthStateLineLength) / 2;
|
|
121
|
+
return {
|
|
122
|
+
type: 'line-length-known',
|
|
123
|
+
width: breakoutWidth,
|
|
124
|
+
marginLeft: "".concat(marginLeftPx, "px")
|
|
125
|
+
};
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
function calcBreakoutWidthPx(mode, widthStateWidth) {
|
|
129
|
+
return (0, _dom.parsePx)(calcBreakoutWidth(mode, widthStateWidth));
|
|
130
|
+
}
|