@atlaskit/editor-plugin-card 0.14.8 → 0.14.9
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 +7 -0
- package/dist/cjs/nodeviews/datasource.js +7 -8
- package/dist/cjs/nodeviews/inlineCardWithAwareness.js +6 -8
- package/dist/cjs/ui/EditDatasourceButton.js +5 -7
- package/dist/cjs/ui/InlineCardOverlay/index.js +7 -7
- package/dist/cjs/ui/LayoutButton/index.js +6 -6
- package/dist/cjs/ui/ResizableEmbedCard.js +5 -6
- package/dist/cjs/ui/useFetchDatasourceInfo.js +0 -2
- package/dist/es2019/nodeviews/datasource.js +6 -8
- package/dist/es2019/nodeviews/inlineCardWithAwareness.js +7 -8
- package/dist/es2019/ui/EditDatasourceButton.js +6 -7
- package/dist/es2019/ui/InlineCardOverlay/index.js +7 -9
- package/dist/es2019/ui/LayoutButton/index.js +6 -7
- package/dist/es2019/ui/ResizableEmbedCard.js +4 -6
- package/dist/es2019/ui/useFetchDatasourceInfo.js +0 -1
- package/dist/esm/nodeviews/datasource.js +6 -8
- package/dist/esm/nodeviews/inlineCardWithAwareness.js +7 -8
- package/dist/esm/ui/EditDatasourceButton.js +6 -7
- package/dist/esm/ui/InlineCardOverlay/index.js +7 -9
- package/dist/esm/ui/LayoutButton/index.js +6 -7
- package/dist/esm/ui/ResizableEmbedCard.js +4 -6
- package/dist/esm/ui/useFetchDatasourceInfo.js +0 -1
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-card
|
|
2
2
|
|
|
3
|
+
## 0.14.9
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#58763](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/58763) [`0fdbd64522bf`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/0fdbd64522bf) - update ADF schema
|
|
8
|
+
- Updated dependencies
|
|
9
|
+
|
|
3
10
|
## 0.14.8
|
|
4
11
|
|
|
5
12
|
### Patch Changes
|
|
@@ -13,7 +13,6 @@ var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime
|
|
|
13
13
|
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
14
14
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
15
15
|
var _react = _interopRequireDefault(require("react"));
|
|
16
|
-
var _react2 = require("@emotion/react");
|
|
17
16
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
18
17
|
var _reactNodeView = _interopRequireDefault(require("@atlaskit/editor-common/react-node-view"));
|
|
19
18
|
var _styles = require("@atlaskit/editor-common/styles");
|
|
@@ -25,7 +24,7 @@ var _EditorAnalyticsContext = require("../ui/EditorAnalyticsContext");
|
|
|
25
24
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
26
25
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
27
26
|
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); }; }
|
|
28
|
-
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; } }
|
|
27
|
+
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; } }
|
|
29
28
|
var getPosSafely = function getPosSafely(pos) {
|
|
30
29
|
if (!pos || typeof pos === 'boolean') {
|
|
31
30
|
return;
|
|
@@ -150,11 +149,11 @@ var DatasourceComponent = exports.DatasourceComponent = /*#__PURE__*/function (_
|
|
|
150
149
|
|
|
151
150
|
// [WS-2307]: we only render card wrapped into a Provider when the value is ready
|
|
152
151
|
if (cardContext && cardContext.value) {
|
|
153
|
-
return
|
|
152
|
+
return /*#__PURE__*/_react.default.createElement(_EditorAnalyticsContext.EditorAnalyticsContext, {
|
|
154
153
|
editorView: this.props.view
|
|
155
|
-
},
|
|
154
|
+
}, /*#__PURE__*/_react.default.createElement(cardContext.Provider, {
|
|
156
155
|
value: cardContext.value
|
|
157
|
-
},
|
|
156
|
+
}, /*#__PURE__*/_react.default.createElement(_linkDatasource.DatasourceTableView, {
|
|
158
157
|
datasourceId: datasource.id,
|
|
159
158
|
parameters: datasource.parameters,
|
|
160
159
|
visibleColumnKeys: visibleColumnKeys,
|
|
@@ -204,16 +203,16 @@ var Datasource = exports.Datasource = /*#__PURE__*/function (_ReactNodeView) {
|
|
|
204
203
|
key: "render",
|
|
205
204
|
value: function render() {
|
|
206
205
|
var attrs = this.node.attrs;
|
|
207
|
-
return
|
|
206
|
+
return /*#__PURE__*/_react.default.createElement(_datasourceErrorBoundary.DatasourceErrorBoundary, {
|
|
208
207
|
unsupportedComponent: _ui.UnsupportedInline,
|
|
209
208
|
view: this.view,
|
|
210
209
|
url: attrs.url
|
|
211
|
-
},
|
|
210
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
212
211
|
className: _styles.DATASOURCE_INNER_CONTAINER_CLASSNAME,
|
|
213
212
|
style: {
|
|
214
213
|
minWidth: (0, _utils.calcBreakoutWidth)(attrs.layout, this.tableWidth)
|
|
215
214
|
}
|
|
216
|
-
},
|
|
215
|
+
}, /*#__PURE__*/_react.default.createElement(DatasourceComponent, {
|
|
217
216
|
node: this.node,
|
|
218
217
|
view: this.view,
|
|
219
218
|
getPos: this.getPos
|
|
@@ -18,8 +18,6 @@ var _pulse = require("../common/pulse");
|
|
|
18
18
|
var _actions = require("../pm-plugins/actions");
|
|
19
19
|
var _InlineCardOverlay = _interopRequireDefault(require("../ui/InlineCardOverlay"));
|
|
20
20
|
var _utils = require("../utils");
|
|
21
|
-
/** @jsx jsx */
|
|
22
|
-
|
|
23
21
|
// editor adds a standard line-height that is bigger than an inline smart link
|
|
24
22
|
// due to that the link has a bit of white space around it, which doesn't look right when there is pulse around it
|
|
25
23
|
var loaderWrapperStyles = (0, _react2.css)({
|
|
@@ -122,7 +120,7 @@ var InlineCard = function InlineCard(_ref) {
|
|
|
122
120
|
});
|
|
123
121
|
}, [onResolve]);
|
|
124
122
|
var innerCard = (0, _react.useMemo)(function () {
|
|
125
|
-
return
|
|
123
|
+
return /*#__PURE__*/React.createElement(_smartCard.Card, {
|
|
126
124
|
key: url,
|
|
127
125
|
url: url,
|
|
128
126
|
data: data,
|
|
@@ -138,7 +136,7 @@ var InlineCard = function InlineCard(_ref) {
|
|
|
138
136
|
|
|
139
137
|
// BEGIN: Awareness (To be revisited in EDM-8508)
|
|
140
138
|
var cardWithOverlay = (0, _react.useMemo)(function () {
|
|
141
|
-
return shouldShowLinkOverlay ?
|
|
139
|
+
return shouldShowLinkOverlay ? /*#__PURE__*/React.createElement(_InlineCardOverlay.default, {
|
|
142
140
|
isSelected: isSelected,
|
|
143
141
|
isVisible: isInserted || isHovered || isSelected,
|
|
144
142
|
onMouseEnter: function onMouseEnter() {
|
|
@@ -152,14 +150,14 @@ var InlineCard = function InlineCard(_ref) {
|
|
|
152
150
|
}, [innerCard, isHovered, isSelected, isInserted, shouldShowLinkOverlay, url]);
|
|
153
151
|
var card = (0, _react.useMemo)(function () {
|
|
154
152
|
var _cardContext$value;
|
|
155
|
-
return
|
|
153
|
+
return /*#__PURE__*/React.createElement("span", {
|
|
156
154
|
css: shouldShowLinkPulse && loaderWrapperStyles,
|
|
157
155
|
className: "card"
|
|
158
|
-
}, shouldShowLinkPulse ?
|
|
156
|
+
}, shouldShowLinkPulse ? /*#__PURE__*/React.createElement(_analyticsNext.AnalyticsContext, {
|
|
159
157
|
data: {
|
|
160
158
|
attributes: (0, _utils.getResolvedAttributesFromStore)(url, 'inline', cardContext === null || cardContext === void 0 || (_cardContext$value = cardContext.value) === null || _cardContext$value === void 0 ? void 0 : _cardContext$value.store)
|
|
161
159
|
}
|
|
162
|
-
},
|
|
160
|
+
}, /*#__PURE__*/React.createElement(_pulse.DiscoveryPulse, {
|
|
163
161
|
localStorageKey: _localStorage.LOCAL_STORAGE_DISCOVERY_KEY_SMART_LINK,
|
|
164
162
|
localStorageKeyExpirationInMs: _localStorage.ONE_DAY_IN_MILLISECONDS,
|
|
165
163
|
discoveryMode: "start"
|
|
@@ -169,7 +167,7 @@ var InlineCard = function InlineCard(_ref) {
|
|
|
169
167
|
|
|
170
168
|
// [WS-2307]: we only render card wrapped into a Provider when the value is ready,
|
|
171
169
|
// otherwise if we got data, we can render the card directly since it doesn't need the Provider
|
|
172
|
-
return cardContext && cardContext.value ?
|
|
170
|
+
return cardContext && cardContext.value ? /*#__PURE__*/React.createElement(cardContext.Provider, {
|
|
173
171
|
value: cardContext.value
|
|
174
172
|
}, card) : data ? card : null;
|
|
175
173
|
};
|
|
@@ -12,8 +12,6 @@ var _primitives = require("@atlaskit/primitives");
|
|
|
12
12
|
var _actions = require("../pm-plugins/actions");
|
|
13
13
|
var _CardContextProvider = require("./CardContextProvider");
|
|
14
14
|
var _useFetchDatasourceInfo = require("./useFetchDatasourceInfo");
|
|
15
|
-
/** @jsx jsx */
|
|
16
|
-
|
|
17
15
|
var buttonStyles = (0, _react.css)({
|
|
18
16
|
pointerEvents: 'auto'
|
|
19
17
|
});
|
|
@@ -49,16 +47,16 @@ var EditDatasourceButtonWithCardContext = function EditDatasourceButtonWithCardC
|
|
|
49
47
|
editorView.focus();
|
|
50
48
|
}
|
|
51
49
|
};
|
|
52
|
-
return
|
|
50
|
+
return /*#__PURE__*/React.createElement(_primitives.Flex, null, /*#__PURE__*/React.createElement(_ui.FloatingToolbarButton, {
|
|
53
51
|
css: buttonStyles,
|
|
54
52
|
title: intl.formatMessage(_messages.cardMessages.datasourceTitle),
|
|
55
|
-
icon:
|
|
53
|
+
icon: /*#__PURE__*/React.createElement(_ui.SmallerEditIcon, null),
|
|
56
54
|
selected: false,
|
|
57
55
|
onClick: function onClick() {
|
|
58
56
|
return dispatchCommand(editDatasource(datasourceId, editorAnalyticsApi));
|
|
59
57
|
},
|
|
60
58
|
testId: 'card-edit-datasource-button'
|
|
61
|
-
}),
|
|
59
|
+
}), /*#__PURE__*/React.createElement(_ui.FloatingToolbarSeparator, null));
|
|
62
60
|
};
|
|
63
61
|
var EditDatasourceButton = exports.EditDatasourceButton = function EditDatasourceButton(_ref2) {
|
|
64
62
|
var intl = _ref2.intl,
|
|
@@ -66,9 +64,9 @@ var EditDatasourceButton = exports.EditDatasourceButton = function EditDatasourc
|
|
|
66
64
|
url = _ref2.url,
|
|
67
65
|
editorView = _ref2.editorView,
|
|
68
66
|
editorState = _ref2.editorState;
|
|
69
|
-
return
|
|
67
|
+
return /*#__PURE__*/React.createElement(_CardContextProvider.CardContextProvider, null, function (_ref3) {
|
|
70
68
|
var cardContext = _ref3.cardContext;
|
|
71
|
-
return
|
|
69
|
+
return /*#__PURE__*/React.createElement(EditDatasourceButtonWithCardContext, {
|
|
72
70
|
url: url,
|
|
73
71
|
intl: intl,
|
|
74
72
|
editorAnalyticsApi: editorAnalyticsApi,
|
|
@@ -24,7 +24,7 @@ var _excluded = ["children", "isSelected", "isVisible", "testId", "url"];
|
|
|
24
24
|
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); }
|
|
25
25
|
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; }
|
|
26
26
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
27
|
-
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
27
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
28
28
|
var DEBOUNCE_IN_MS = 5;
|
|
29
29
|
var ESTIMATED_MIN_WIDTH_IN_PX = 16;
|
|
30
30
|
var PADDING_IN_PX = 2;
|
|
@@ -231,20 +231,20 @@ var InlineCardOverlay = function InlineCardOverlay(_ref) {
|
|
|
231
231
|
var label = intl.formatMessage(_messages.messages.inlineOverlay);
|
|
232
232
|
var icon = (0, _react.useMemo)(function () {
|
|
233
233
|
var IconComponent = isSelected ? _chevronUp.default : _chevronDown.default;
|
|
234
|
-
return
|
|
234
|
+
return /*#__PURE__*/_react.default.createElement(IconComponent, {
|
|
235
235
|
label: label,
|
|
236
236
|
size: "small",
|
|
237
237
|
testId: "".concat(testId, "-").concat(isSelected ? 'open' : 'close')
|
|
238
238
|
});
|
|
239
239
|
}, [isSelected, label, testId]);
|
|
240
|
-
return
|
|
240
|
+
return /*#__PURE__*/_react.default.createElement("span", (0, _extends2.default)({}, props, {
|
|
241
241
|
css: containerStyles,
|
|
242
242
|
ref: containerRef
|
|
243
|
-
}), children, isVisible && showOverlay &&
|
|
243
|
+
}), children, isVisible && showOverlay && /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("span", {
|
|
244
244
|
"aria-hidden": "true",
|
|
245
245
|
className: OVERLAY_MARKER_CLASSNAME,
|
|
246
246
|
css: markerStyles
|
|
247
|
-
}, _utils.ZERO_WIDTH_JOINER),
|
|
247
|
+
}, _utils.ZERO_WIDTH_JOINER), /*#__PURE__*/_react.default.createElement("a", {
|
|
248
248
|
className: OVERLAY_CLASSNAME,
|
|
249
249
|
css: [overlayStyles, _utils.browser.safari && safariOverlayStyles],
|
|
250
250
|
style: {
|
|
@@ -256,11 +256,11 @@ var InlineCardOverlay = function InlineCardOverlay(_ref) {
|
|
|
256
256
|
return e.preventDefault();
|
|
257
257
|
},
|
|
258
258
|
tabIndex: -1
|
|
259
|
-
}, showLabel &&
|
|
259
|
+
}, showLabel && /*#__PURE__*/_react.default.createElement("span", {
|
|
260
260
|
className: OVERLAY_LABEL_CLASSNAME,
|
|
261
261
|
css: textStyles,
|
|
262
262
|
"data-testid": "".concat(testId, "-label")
|
|
263
|
-
}, label),
|
|
263
|
+
}, label), /*#__PURE__*/_react.default.createElement("span", {
|
|
264
264
|
css: iconStyles
|
|
265
265
|
}, icon))));
|
|
266
266
|
};
|
|
@@ -19,7 +19,7 @@ var _colors = require("@atlaskit/theme/colors");
|
|
|
19
19
|
var _actions = require("../../pm-plugins/actions");
|
|
20
20
|
var _utils2 = require("./utils");
|
|
21
21
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
22
|
-
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
22
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
23
23
|
var toolbarButtonWrapperStyles = (0, _react2.css)({
|
|
24
24
|
background: "".concat("var(--ds-background-neutral, ".concat(_colors.N20A, ")")),
|
|
25
25
|
color: "".concat("var(--ds-icon, ".concat(_colors.N300, ")")),
|
|
@@ -48,7 +48,7 @@ var LayoutButton = exports.LayoutButton = function LayoutButton(_ref) {
|
|
|
48
48
|
if (!targetElement) {
|
|
49
49
|
return null;
|
|
50
50
|
}
|
|
51
|
-
return
|
|
51
|
+
return /*#__PURE__*/React.createElement(_ui.Popup, {
|
|
52
52
|
mountTo: mountPoint,
|
|
53
53
|
boundariesElement: boundariesElement,
|
|
54
54
|
scrollableElement: scrollableElement,
|
|
@@ -58,14 +58,14 @@ var LayoutButton = exports.LayoutButton = function LayoutButton(_ref) {
|
|
|
58
58
|
forcePlacement: true,
|
|
59
59
|
stick: true,
|
|
60
60
|
ariaLabel: title
|
|
61
|
-
},
|
|
61
|
+
}, /*#__PURE__*/React.createElement(_uiMenu.ToolbarButton, {
|
|
62
62
|
testId: testId,
|
|
63
63
|
css: toolbarButtonWrapperStyles,
|
|
64
64
|
title: title,
|
|
65
65
|
onClick: handleClick,
|
|
66
|
-
iconBefore: layout === 'full-width' ?
|
|
66
|
+
iconBefore: layout === 'full-width' ? /*#__PURE__*/React.createElement(_collapse.default, {
|
|
67
67
|
label: title
|
|
68
|
-
}) :
|
|
68
|
+
}) : /*#__PURE__*/React.createElement(_expand.default, {
|
|
69
69
|
label: title
|
|
70
70
|
})
|
|
71
71
|
}));
|
|
@@ -103,7 +103,7 @@ var LayoutButtonWrapper = function LayoutButtonWrapper(_ref2) {
|
|
|
103
103
|
if (!isDatasource) {
|
|
104
104
|
return null;
|
|
105
105
|
}
|
|
106
|
-
return
|
|
106
|
+
return /*#__PURE__*/React.createElement(LayoutButton, {
|
|
107
107
|
mountPoint: mountPoint,
|
|
108
108
|
scrollableElement: scrollableElement,
|
|
109
109
|
boundariesElement: boundariesElement,
|
|
@@ -14,7 +14,6 @@ var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime
|
|
|
14
14
|
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
15
15
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
16
16
|
var _react = _interopRequireDefault(require("react"));
|
|
17
|
-
var _react2 = require("@emotion/react");
|
|
18
17
|
var _styles = require("@atlaskit/editor-common/styles");
|
|
19
18
|
var _ui = require("@atlaskit/editor-common/ui");
|
|
20
19
|
var _utils = require("@atlaskit/editor-prosemirror/utils");
|
|
@@ -23,7 +22,7 @@ var _smartCard = require("@atlaskit/smart-card");
|
|
|
23
22
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
24
23
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
25
24
|
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); }; }
|
|
26
|
-
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; } }
|
|
25
|
+
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; } }
|
|
27
26
|
// eslint-disable-next-line @repo/internal/react/no-class-components
|
|
28
27
|
var ResizableEmbedCard = exports.default = /*#__PURE__*/function (_React$Component) {
|
|
29
28
|
(0, _inherits2.default)(ResizableEmbedCard, _React$Component);
|
|
@@ -312,7 +311,7 @@ var ResizableEmbedCard = exports.default = /*#__PURE__*/function (_React$Compone
|
|
|
312
311
|
paddingBottom: "calc(".concat((1 / aspectRatio * 100).toFixed(3), "% + ").concat(_smartCard.embedHeaderHeight, "px)")
|
|
313
312
|
};
|
|
314
313
|
}
|
|
315
|
-
return
|
|
314
|
+
return /*#__PURE__*/_react.default.createElement("span", {
|
|
316
315
|
"data-testid": 'resizable-embed-card-height-definer',
|
|
317
316
|
style: _objectSpread({
|
|
318
317
|
display: 'block',
|
|
@@ -358,17 +357,17 @@ var ResizableEmbedCard = exports.default = /*#__PURE__*/function (_React$Compone
|
|
|
358
357
|
};
|
|
359
358
|
|
|
360
359
|
/* eslint-disable @atlaskit/design-system/consistent-css-prop-usage */
|
|
361
|
-
return
|
|
360
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
362
361
|
css: _styles.embedSpacingStyles,
|
|
363
362
|
"data-testid": "resizable-embed-card-spacing"
|
|
364
|
-
},
|
|
363
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
365
364
|
css: (0, _ui.wrapperStyle)({
|
|
366
365
|
layout: layout,
|
|
367
366
|
isResized: !!pctWidth,
|
|
368
367
|
containerWidth: containerWidth || _editorSharedStyles.DEFAULT_EMBED_CARD_WIDTH,
|
|
369
368
|
fullWidthMode: fullWidthMode
|
|
370
369
|
})
|
|
371
|
-
},
|
|
370
|
+
}, /*#__PURE__*/_react.default.createElement(_ui.Resizer, (0, _extends2.default)({}, this.props, {
|
|
372
371
|
width: initialWidth // Starting or initial width of embed <iframe> itself.
|
|
373
372
|
,
|
|
374
373
|
enable: enable,
|
|
@@ -9,8 +9,6 @@ var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"))
|
|
|
9
9
|
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
10
10
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
11
11
|
var _react = require("react");
|
|
12
|
-
/** @jsx jsx */
|
|
13
|
-
|
|
14
12
|
var useFetchDatasourceInfo = exports.useFetchDatasourceInfo = function useFetchDatasourceInfo(_ref) {
|
|
15
13
|
var isRegularCardNode = _ref.isRegularCardNode,
|
|
16
14
|
url = _ref.url,
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
-
/** @jsx jsx */
|
|
3
2
|
import React from 'react';
|
|
4
|
-
import { jsx } from '@emotion/react';
|
|
5
3
|
import PropTypes from 'prop-types';
|
|
6
4
|
import ReactNodeView from '@atlaskit/editor-common/react-node-view';
|
|
7
5
|
import { DATASOURCE_INNER_CONTAINER_CLASSNAME, SmartCardSharedCssClassName } from '@atlaskit/editor-common/styles';
|
|
@@ -123,11 +121,11 @@ export class DatasourceComponent extends React.PureComponent {
|
|
|
123
121
|
|
|
124
122
|
// [WS-2307]: we only render card wrapped into a Provider when the value is ready
|
|
125
123
|
if (cardContext && cardContext.value) {
|
|
126
|
-
return
|
|
124
|
+
return /*#__PURE__*/React.createElement(EditorAnalyticsContext, {
|
|
127
125
|
editorView: this.props.view
|
|
128
|
-
},
|
|
126
|
+
}, /*#__PURE__*/React.createElement(cardContext.Provider, {
|
|
129
127
|
value: cardContext.value
|
|
130
|
-
},
|
|
128
|
+
}, /*#__PURE__*/React.createElement(DatasourceTableView, {
|
|
131
129
|
datasourceId: datasource.id,
|
|
132
130
|
parameters: datasource.parameters,
|
|
133
131
|
visibleColumnKeys: visibleColumnKeys,
|
|
@@ -170,16 +168,16 @@ export class Datasource extends ReactNodeView {
|
|
|
170
168
|
const {
|
|
171
169
|
attrs
|
|
172
170
|
} = this.node;
|
|
173
|
-
return
|
|
171
|
+
return /*#__PURE__*/React.createElement(DatasourceErrorBoundary, {
|
|
174
172
|
unsupportedComponent: UnsupportedInline,
|
|
175
173
|
view: this.view,
|
|
176
174
|
url: attrs.url
|
|
177
|
-
},
|
|
175
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
178
176
|
className: DATASOURCE_INNER_CONTAINER_CLASSNAME,
|
|
179
177
|
style: {
|
|
180
178
|
minWidth: calcBreakoutWidth(attrs.layout, this.tableWidth)
|
|
181
179
|
}
|
|
182
|
-
},
|
|
180
|
+
}, /*#__PURE__*/React.createElement(DatasourceComponent, {
|
|
183
181
|
node: this.node,
|
|
184
182
|
view: this.view,
|
|
185
183
|
getPos: this.getPos
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
/** @jsx jsx */
|
|
2
1
|
import { memo, useCallback, useMemo, useState } from 'react';
|
|
3
|
-
import { css
|
|
2
|
+
import { css } from '@emotion/react';
|
|
4
3
|
import rafSchedule from 'raf-schd';
|
|
5
4
|
import { AnalyticsContext } from '@atlaskit/analytics-next';
|
|
6
5
|
import { findOverflowScrollParent } from '@atlaskit/editor-common/ui';
|
|
@@ -108,7 +107,7 @@ const InlineCard = ({
|
|
|
108
107
|
url
|
|
109
108
|
});
|
|
110
109
|
}, [onResolve]);
|
|
111
|
-
const innerCard = useMemo(() =>
|
|
110
|
+
const innerCard = useMemo(() => /*#__PURE__*/React.createElement(SmartCard, {
|
|
112
111
|
key: url,
|
|
113
112
|
url: url,
|
|
114
113
|
data: data,
|
|
@@ -122,7 +121,7 @@ const InlineCard = ({
|
|
|
122
121
|
}), [data, onError, onResolve, scrollContainer, showServerActions, url, useAlternativePreloader]);
|
|
123
122
|
|
|
124
123
|
// BEGIN: Awareness (To be revisited in EDM-8508)
|
|
125
|
-
const cardWithOverlay = useMemo(() => shouldShowLinkOverlay ?
|
|
124
|
+
const cardWithOverlay = useMemo(() => shouldShowLinkOverlay ? /*#__PURE__*/React.createElement(InlineCardOverlay, {
|
|
126
125
|
isSelected: isSelected,
|
|
127
126
|
isVisible: isInserted || isHovered || isSelected,
|
|
128
127
|
onMouseEnter: () => setIsHovered(true),
|
|
@@ -131,14 +130,14 @@ const InlineCard = ({
|
|
|
131
130
|
}, innerCard) : innerCard, [innerCard, isHovered, isSelected, isInserted, shouldShowLinkOverlay, url]);
|
|
132
131
|
const card = useMemo(() => {
|
|
133
132
|
var _cardContext$value;
|
|
134
|
-
return
|
|
133
|
+
return /*#__PURE__*/React.createElement("span", {
|
|
135
134
|
css: shouldShowLinkPulse && loaderWrapperStyles,
|
|
136
135
|
className: "card"
|
|
137
|
-
}, shouldShowLinkPulse ?
|
|
136
|
+
}, shouldShowLinkPulse ? /*#__PURE__*/React.createElement(AnalyticsContext, {
|
|
138
137
|
data: {
|
|
139
138
|
attributes: getResolvedAttributesFromStore(url, 'inline', cardContext === null || cardContext === void 0 ? void 0 : (_cardContext$value = cardContext.value) === null || _cardContext$value === void 0 ? void 0 : _cardContext$value.store)
|
|
140
139
|
}
|
|
141
|
-
},
|
|
140
|
+
}, /*#__PURE__*/React.createElement(DiscoveryPulse, {
|
|
142
141
|
localStorageKey: LOCAL_STORAGE_DISCOVERY_KEY_SMART_LINK,
|
|
143
142
|
localStorageKeyExpirationInMs: ONE_DAY_IN_MILLISECONDS,
|
|
144
143
|
discoveryMode: "start"
|
|
@@ -148,7 +147,7 @@ const InlineCard = ({
|
|
|
148
147
|
|
|
149
148
|
// [WS-2307]: we only render card wrapped into a Provider when the value is ready,
|
|
150
149
|
// otherwise if we got data, we can render the card directly since it doesn't need the Provider
|
|
151
|
-
return cardContext && cardContext.value ?
|
|
150
|
+
return cardContext && cardContext.value ? /*#__PURE__*/React.createElement(cardContext.Provider, {
|
|
152
151
|
value: cardContext.value
|
|
153
152
|
}, card) : data ? card : null;
|
|
154
153
|
};
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
import { css, jsx } from '@emotion/react';
|
|
1
|
+
import { css } from '@emotion/react';
|
|
3
2
|
import { cardMessages as messages } from '@atlaskit/editor-common/messages';
|
|
4
3
|
import { FloatingToolbarButton as Button, FloatingToolbarSeparator as Separator, SmallerEditIcon } from '@atlaskit/editor-common/ui';
|
|
5
4
|
import { canRenderDatasource, getDatasourceType } from '@atlaskit/editor-common/utils';
|
|
@@ -44,14 +43,14 @@ const EditDatasourceButtonWithCardContext = ({
|
|
|
44
43
|
editorView.focus();
|
|
45
44
|
}
|
|
46
45
|
};
|
|
47
|
-
return
|
|
46
|
+
return /*#__PURE__*/React.createElement(Flex, null, /*#__PURE__*/React.createElement(Button, {
|
|
48
47
|
css: buttonStyles,
|
|
49
48
|
title: intl.formatMessage(messages.datasourceTitle),
|
|
50
|
-
icon:
|
|
49
|
+
icon: /*#__PURE__*/React.createElement(SmallerEditIcon, null),
|
|
51
50
|
selected: false,
|
|
52
51
|
onClick: () => dispatchCommand(editDatasource(datasourceId, editorAnalyticsApi)),
|
|
53
52
|
testId: 'card-edit-datasource-button'
|
|
54
|
-
}),
|
|
53
|
+
}), /*#__PURE__*/React.createElement(Separator, null));
|
|
55
54
|
};
|
|
56
55
|
export const EditDatasourceButton = ({
|
|
57
56
|
intl,
|
|
@@ -60,9 +59,9 @@ export const EditDatasourceButton = ({
|
|
|
60
59
|
editorView,
|
|
61
60
|
editorState
|
|
62
61
|
}) => {
|
|
63
|
-
return
|
|
62
|
+
return /*#__PURE__*/React.createElement(CardContextProvider, null, ({
|
|
64
63
|
cardContext
|
|
65
|
-
}) =>
|
|
64
|
+
}) => /*#__PURE__*/React.createElement(EditDatasourceButtonWithCardContext, {
|
|
66
65
|
url: url,
|
|
67
66
|
intl: intl,
|
|
68
67
|
editorAnalyticsApi: editorAnalyticsApi,
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
-
/** @jsx jsx */
|
|
3
|
-
|
|
4
2
|
import React, { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react';
|
|
5
|
-
import { css
|
|
3
|
+
import { css } from '@emotion/react';
|
|
6
4
|
import debounce from 'lodash/debounce';
|
|
7
5
|
import { useIntl } from 'react-intl-next';
|
|
8
6
|
import { browser, ZERO_WIDTH_JOINER } from '@atlaskit/editor-common/utils';
|
|
@@ -217,20 +215,20 @@ const InlineCardOverlay = ({
|
|
|
217
215
|
const label = intl.formatMessage(messages.inlineOverlay);
|
|
218
216
|
const icon = useMemo(() => {
|
|
219
217
|
const IconComponent = isSelected ? HipchatChevronUpIcon : HipchatChevronDownIcon;
|
|
220
|
-
return
|
|
218
|
+
return /*#__PURE__*/React.createElement(IconComponent, {
|
|
221
219
|
label: label,
|
|
222
220
|
size: "small",
|
|
223
221
|
testId: `${testId}-${isSelected ? 'open' : 'close'}`
|
|
224
222
|
});
|
|
225
223
|
}, [isSelected, label, testId]);
|
|
226
|
-
return
|
|
224
|
+
return /*#__PURE__*/React.createElement("span", _extends({}, props, {
|
|
227
225
|
css: containerStyles,
|
|
228
226
|
ref: containerRef
|
|
229
|
-
}), children, isVisible && showOverlay &&
|
|
227
|
+
}), children, isVisible && showOverlay && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("span", {
|
|
230
228
|
"aria-hidden": "true",
|
|
231
229
|
className: OVERLAY_MARKER_CLASSNAME,
|
|
232
230
|
css: markerStyles
|
|
233
|
-
}, ZERO_WIDTH_JOINER),
|
|
231
|
+
}, ZERO_WIDTH_JOINER), /*#__PURE__*/React.createElement("a", {
|
|
234
232
|
className: OVERLAY_CLASSNAME,
|
|
235
233
|
css: [overlayStyles, browser.safari && safariOverlayStyles],
|
|
236
234
|
style: {
|
|
@@ -240,11 +238,11 @@ const InlineCardOverlay = ({
|
|
|
240
238
|
href: url,
|
|
241
239
|
onClick: e => e.preventDefault(),
|
|
242
240
|
tabIndex: -1
|
|
243
|
-
}, showLabel &&
|
|
241
|
+
}, showLabel && /*#__PURE__*/React.createElement("span", {
|
|
244
242
|
className: OVERLAY_LABEL_CLASSNAME,
|
|
245
243
|
css: textStyles,
|
|
246
244
|
"data-testid": `${testId}-label`
|
|
247
|
-
}, label),
|
|
245
|
+
}, label), /*#__PURE__*/React.createElement("span", {
|
|
248
246
|
css: iconStyles
|
|
249
247
|
}, icon))));
|
|
250
248
|
};
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
/** @jsx jsx */
|
|
2
1
|
import { useCallback, useMemo } from 'react';
|
|
3
|
-
import { css
|
|
2
|
+
import { css } from '@emotion/react';
|
|
4
3
|
import { injectIntl } from 'react-intl-next';
|
|
5
4
|
import { useSharedPluginState } from '@atlaskit/editor-common/hooks';
|
|
6
5
|
import { Popup } from '@atlaskit/editor-common/ui';
|
|
@@ -40,7 +39,7 @@ export const LayoutButton = ({
|
|
|
40
39
|
if (!targetElement) {
|
|
41
40
|
return null;
|
|
42
41
|
}
|
|
43
|
-
return
|
|
42
|
+
return /*#__PURE__*/React.createElement(Popup, {
|
|
44
43
|
mountTo: mountPoint,
|
|
45
44
|
boundariesElement: boundariesElement,
|
|
46
45
|
scrollableElement: scrollableElement,
|
|
@@ -50,14 +49,14 @@ export const LayoutButton = ({
|
|
|
50
49
|
forcePlacement: true,
|
|
51
50
|
stick: true,
|
|
52
51
|
ariaLabel: title
|
|
53
|
-
},
|
|
52
|
+
}, /*#__PURE__*/React.createElement(ToolbarButton, {
|
|
54
53
|
testId: testId,
|
|
55
54
|
css: toolbarButtonWrapperStyles,
|
|
56
55
|
title: title,
|
|
57
56
|
onClick: handleClick,
|
|
58
|
-
iconBefore: layout === 'full-width' ?
|
|
57
|
+
iconBefore: layout === 'full-width' ? /*#__PURE__*/React.createElement(CollapseIcon, {
|
|
59
58
|
label: title
|
|
60
|
-
}) :
|
|
59
|
+
}) : /*#__PURE__*/React.createElement(ExpandIcon, {
|
|
61
60
|
label: title
|
|
62
61
|
})
|
|
63
62
|
}));
|
|
@@ -101,7 +100,7 @@ const LayoutButtonWrapper = ({
|
|
|
101
100
|
if (!isDatasource) {
|
|
102
101
|
return null;
|
|
103
102
|
}
|
|
104
|
-
return
|
|
103
|
+
return /*#__PURE__*/React.createElement(LayoutButton, {
|
|
105
104
|
mountPoint: mountPoint,
|
|
106
105
|
scrollableElement: scrollableElement,
|
|
107
106
|
boundariesElement: boundariesElement,
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
3
|
-
/** @jsx jsx */
|
|
4
3
|
import React from 'react';
|
|
5
|
-
import { jsx } from '@emotion/react';
|
|
6
4
|
import { embedSpacingStyles } from '@atlaskit/editor-common/styles';
|
|
7
5
|
import { calcColumnsFromPx, calcMediaPxWidth, calcPctFromPx, calcPxFromColumns, handleSides, imageAlignmentMap, Resizer, snapTo, wrappedLayouts, wrapperStyle } from '@atlaskit/editor-common/ui';
|
|
8
6
|
import { findParentNodeOfTypeClosestToPos, hasParentNodeOfType } from '@atlaskit/editor-prosemirror/utils';
|
|
@@ -287,7 +285,7 @@ export default class ResizableEmbedCard extends React.Component {
|
|
|
287
285
|
paddingBottom: `calc(${(1 / aspectRatio * 100).toFixed(3)}% + ${embedHeaderHeight}px)`
|
|
288
286
|
};
|
|
289
287
|
}
|
|
290
|
-
return
|
|
288
|
+
return /*#__PURE__*/React.createElement("span", {
|
|
291
289
|
"data-testid": 'resizable-embed-card-height-definer',
|
|
292
290
|
style: {
|
|
293
291
|
display: 'block',
|
|
@@ -332,17 +330,17 @@ export default class ResizableEmbedCard extends React.Component {
|
|
|
332
330
|
};
|
|
333
331
|
|
|
334
332
|
/* eslint-disable @atlaskit/design-system/consistent-css-prop-usage */
|
|
335
|
-
return
|
|
333
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
336
334
|
css: embedSpacingStyles,
|
|
337
335
|
"data-testid": "resizable-embed-card-spacing"
|
|
338
|
-
},
|
|
336
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
339
337
|
css: wrapperStyle({
|
|
340
338
|
layout,
|
|
341
339
|
isResized: !!pctWidth,
|
|
342
340
|
containerWidth: containerWidth || DEFAULT_EMBED_CARD_WIDTH,
|
|
343
341
|
fullWidthMode
|
|
344
342
|
})
|
|
345
|
-
},
|
|
343
|
+
}, /*#__PURE__*/React.createElement(Resizer, _extends({}, this.props, {
|
|
346
344
|
width: initialWidth // Starting or initial width of embed <iframe> itself.
|
|
347
345
|
,
|
|
348
346
|
enable: enable,
|
|
@@ -9,9 +9,7 @@ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbol
|
|
|
9
9
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
10
10
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
11
11
|
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; } }
|
|
12
|
-
/** @jsx jsx */
|
|
13
12
|
import React from 'react';
|
|
14
|
-
import { jsx } from '@emotion/react';
|
|
15
13
|
import PropTypes from 'prop-types';
|
|
16
14
|
import ReactNodeView from '@atlaskit/editor-common/react-node-view';
|
|
17
15
|
import { DATASOURCE_INNER_CONTAINER_CLASSNAME, SmartCardSharedCssClassName } from '@atlaskit/editor-common/styles';
|
|
@@ -144,11 +142,11 @@ export var DatasourceComponent = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
144
142
|
|
|
145
143
|
// [WS-2307]: we only render card wrapped into a Provider when the value is ready
|
|
146
144
|
if (cardContext && cardContext.value) {
|
|
147
|
-
return
|
|
145
|
+
return /*#__PURE__*/React.createElement(EditorAnalyticsContext, {
|
|
148
146
|
editorView: this.props.view
|
|
149
|
-
},
|
|
147
|
+
}, /*#__PURE__*/React.createElement(cardContext.Provider, {
|
|
150
148
|
value: cardContext.value
|
|
151
|
-
},
|
|
149
|
+
}, /*#__PURE__*/React.createElement(DatasourceTableView, {
|
|
152
150
|
datasourceId: datasource.id,
|
|
153
151
|
parameters: datasource.parameters,
|
|
154
152
|
visibleColumnKeys: visibleColumnKeys,
|
|
@@ -198,16 +196,16 @@ export var Datasource = /*#__PURE__*/function (_ReactNodeView) {
|
|
|
198
196
|
key: "render",
|
|
199
197
|
value: function render() {
|
|
200
198
|
var attrs = this.node.attrs;
|
|
201
|
-
return
|
|
199
|
+
return /*#__PURE__*/React.createElement(DatasourceErrorBoundary, {
|
|
202
200
|
unsupportedComponent: UnsupportedInline,
|
|
203
201
|
view: this.view,
|
|
204
202
|
url: attrs.url
|
|
205
|
-
},
|
|
203
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
206
204
|
className: DATASOURCE_INNER_CONTAINER_CLASSNAME,
|
|
207
205
|
style: {
|
|
208
206
|
minWidth: calcBreakoutWidth(attrs.layout, this.tableWidth)
|
|
209
207
|
}
|
|
210
|
-
},
|
|
208
|
+
}, /*#__PURE__*/React.createElement(DatasourceComponent, {
|
|
211
209
|
node: this.node,
|
|
212
210
|
view: this.view,
|
|
213
211
|
getPos: this.getPos
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
2
|
-
/** @jsx jsx */
|
|
3
2
|
import { memo, useCallback, useMemo, useState } from 'react';
|
|
4
|
-
import { css
|
|
3
|
+
import { css } from '@emotion/react';
|
|
5
4
|
import rafSchedule from 'raf-schd';
|
|
6
5
|
import { AnalyticsContext } from '@atlaskit/analytics-next';
|
|
7
6
|
import { findOverflowScrollParent } from '@atlaskit/editor-common/ui';
|
|
@@ -114,7 +113,7 @@ var InlineCard = function InlineCard(_ref) {
|
|
|
114
113
|
});
|
|
115
114
|
}, [onResolve]);
|
|
116
115
|
var innerCard = useMemo(function () {
|
|
117
|
-
return
|
|
116
|
+
return /*#__PURE__*/React.createElement(SmartCard, {
|
|
118
117
|
key: url,
|
|
119
118
|
url: url,
|
|
120
119
|
data: data,
|
|
@@ -130,7 +129,7 @@ var InlineCard = function InlineCard(_ref) {
|
|
|
130
129
|
|
|
131
130
|
// BEGIN: Awareness (To be revisited in EDM-8508)
|
|
132
131
|
var cardWithOverlay = useMemo(function () {
|
|
133
|
-
return shouldShowLinkOverlay ?
|
|
132
|
+
return shouldShowLinkOverlay ? /*#__PURE__*/React.createElement(InlineCardOverlay, {
|
|
134
133
|
isSelected: isSelected,
|
|
135
134
|
isVisible: isInserted || isHovered || isSelected,
|
|
136
135
|
onMouseEnter: function onMouseEnter() {
|
|
@@ -144,14 +143,14 @@ var InlineCard = function InlineCard(_ref) {
|
|
|
144
143
|
}, [innerCard, isHovered, isSelected, isInserted, shouldShowLinkOverlay, url]);
|
|
145
144
|
var card = useMemo(function () {
|
|
146
145
|
var _cardContext$value;
|
|
147
|
-
return
|
|
146
|
+
return /*#__PURE__*/React.createElement("span", {
|
|
148
147
|
css: shouldShowLinkPulse && loaderWrapperStyles,
|
|
149
148
|
className: "card"
|
|
150
|
-
}, shouldShowLinkPulse ?
|
|
149
|
+
}, shouldShowLinkPulse ? /*#__PURE__*/React.createElement(AnalyticsContext, {
|
|
151
150
|
data: {
|
|
152
151
|
attributes: getResolvedAttributesFromStore(url, 'inline', cardContext === null || cardContext === void 0 || (_cardContext$value = cardContext.value) === null || _cardContext$value === void 0 ? void 0 : _cardContext$value.store)
|
|
153
152
|
}
|
|
154
|
-
},
|
|
153
|
+
}, /*#__PURE__*/React.createElement(DiscoveryPulse, {
|
|
155
154
|
localStorageKey: LOCAL_STORAGE_DISCOVERY_KEY_SMART_LINK,
|
|
156
155
|
localStorageKeyExpirationInMs: ONE_DAY_IN_MILLISECONDS,
|
|
157
156
|
discoveryMode: "start"
|
|
@@ -161,7 +160,7 @@ var InlineCard = function InlineCard(_ref) {
|
|
|
161
160
|
|
|
162
161
|
// [WS-2307]: we only render card wrapped into a Provider when the value is ready,
|
|
163
162
|
// otherwise if we got data, we can render the card directly since it doesn't need the Provider
|
|
164
|
-
return cardContext && cardContext.value ?
|
|
163
|
+
return cardContext && cardContext.value ? /*#__PURE__*/React.createElement(cardContext.Provider, {
|
|
165
164
|
value: cardContext.value
|
|
166
165
|
}, card) : data ? card : null;
|
|
167
166
|
};
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
import { css, jsx } from '@emotion/react';
|
|
1
|
+
import { css } from '@emotion/react';
|
|
3
2
|
import { cardMessages as messages } from '@atlaskit/editor-common/messages';
|
|
4
3
|
import { FloatingToolbarButton as Button, FloatingToolbarSeparator as Separator, SmallerEditIcon } from '@atlaskit/editor-common/ui';
|
|
5
4
|
import { canRenderDatasource, getDatasourceType } from '@atlaskit/editor-common/utils';
|
|
@@ -42,16 +41,16 @@ var EditDatasourceButtonWithCardContext = function EditDatasourceButtonWithCardC
|
|
|
42
41
|
editorView.focus();
|
|
43
42
|
}
|
|
44
43
|
};
|
|
45
|
-
return
|
|
44
|
+
return /*#__PURE__*/React.createElement(Flex, null, /*#__PURE__*/React.createElement(Button, {
|
|
46
45
|
css: buttonStyles,
|
|
47
46
|
title: intl.formatMessage(messages.datasourceTitle),
|
|
48
|
-
icon:
|
|
47
|
+
icon: /*#__PURE__*/React.createElement(SmallerEditIcon, null),
|
|
49
48
|
selected: false,
|
|
50
49
|
onClick: function onClick() {
|
|
51
50
|
return dispatchCommand(editDatasource(datasourceId, editorAnalyticsApi));
|
|
52
51
|
},
|
|
53
52
|
testId: 'card-edit-datasource-button'
|
|
54
|
-
}),
|
|
53
|
+
}), /*#__PURE__*/React.createElement(Separator, null));
|
|
55
54
|
};
|
|
56
55
|
export var EditDatasourceButton = function EditDatasourceButton(_ref2) {
|
|
57
56
|
var intl = _ref2.intl,
|
|
@@ -59,9 +58,9 @@ export var EditDatasourceButton = function EditDatasourceButton(_ref2) {
|
|
|
59
58
|
url = _ref2.url,
|
|
60
59
|
editorView = _ref2.editorView,
|
|
61
60
|
editorState = _ref2.editorState;
|
|
62
|
-
return
|
|
61
|
+
return /*#__PURE__*/React.createElement(CardContextProvider, null, function (_ref3) {
|
|
63
62
|
var cardContext = _ref3.cardContext;
|
|
64
|
-
return
|
|
63
|
+
return /*#__PURE__*/React.createElement(EditDatasourceButtonWithCardContext, {
|
|
65
64
|
url: url,
|
|
66
65
|
intl: intl,
|
|
67
66
|
editorAnalyticsApi: editorAnalyticsApi,
|
|
@@ -5,10 +5,8 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
|
5
5
|
var _excluded = ["children", "isSelected", "isVisible", "testId", "url"];
|
|
6
6
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
7
7
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
8
|
-
/** @jsx jsx */
|
|
9
|
-
|
|
10
8
|
import React, { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react';
|
|
11
|
-
import { css
|
|
9
|
+
import { css } from '@emotion/react';
|
|
12
10
|
import debounce from 'lodash/debounce';
|
|
13
11
|
import { useIntl } from 'react-intl-next';
|
|
14
12
|
import { browser, ZERO_WIDTH_JOINER } from '@atlaskit/editor-common/utils';
|
|
@@ -223,20 +221,20 @@ var InlineCardOverlay = function InlineCardOverlay(_ref) {
|
|
|
223
221
|
var label = intl.formatMessage(messages.inlineOverlay);
|
|
224
222
|
var icon = useMemo(function () {
|
|
225
223
|
var IconComponent = isSelected ? HipchatChevronUpIcon : HipchatChevronDownIcon;
|
|
226
|
-
return
|
|
224
|
+
return /*#__PURE__*/React.createElement(IconComponent, {
|
|
227
225
|
label: label,
|
|
228
226
|
size: "small",
|
|
229
227
|
testId: "".concat(testId, "-").concat(isSelected ? 'open' : 'close')
|
|
230
228
|
});
|
|
231
229
|
}, [isSelected, label, testId]);
|
|
232
|
-
return
|
|
230
|
+
return /*#__PURE__*/React.createElement("span", _extends({}, props, {
|
|
233
231
|
css: containerStyles,
|
|
234
232
|
ref: containerRef
|
|
235
|
-
}), children, isVisible && showOverlay &&
|
|
233
|
+
}), children, isVisible && showOverlay && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("span", {
|
|
236
234
|
"aria-hidden": "true",
|
|
237
235
|
className: OVERLAY_MARKER_CLASSNAME,
|
|
238
236
|
css: markerStyles
|
|
239
|
-
}, ZERO_WIDTH_JOINER),
|
|
237
|
+
}, ZERO_WIDTH_JOINER), /*#__PURE__*/React.createElement("a", {
|
|
240
238
|
className: OVERLAY_CLASSNAME,
|
|
241
239
|
css: [overlayStyles, browser.safari && safariOverlayStyles],
|
|
242
240
|
style: {
|
|
@@ -248,11 +246,11 @@ var InlineCardOverlay = function InlineCardOverlay(_ref) {
|
|
|
248
246
|
return e.preventDefault();
|
|
249
247
|
},
|
|
250
248
|
tabIndex: -1
|
|
251
|
-
}, showLabel &&
|
|
249
|
+
}, showLabel && /*#__PURE__*/React.createElement("span", {
|
|
252
250
|
className: OVERLAY_LABEL_CLASSNAME,
|
|
253
251
|
css: textStyles,
|
|
254
252
|
"data-testid": "".concat(testId, "-label")
|
|
255
|
-
}, label),
|
|
253
|
+
}, label), /*#__PURE__*/React.createElement("span", {
|
|
256
254
|
css: iconStyles
|
|
257
255
|
}, icon))));
|
|
258
256
|
};
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
2
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3
3
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4
|
-
/** @jsx jsx */
|
|
5
4
|
import { useCallback, useMemo } from 'react';
|
|
6
|
-
import { css
|
|
5
|
+
import { css } from '@emotion/react';
|
|
7
6
|
import { injectIntl } from 'react-intl-next';
|
|
8
7
|
import { useSharedPluginState } from '@atlaskit/editor-common/hooks';
|
|
9
8
|
import { Popup } from '@atlaskit/editor-common/ui';
|
|
@@ -42,7 +41,7 @@ export var LayoutButton = function LayoutButton(_ref) {
|
|
|
42
41
|
if (!targetElement) {
|
|
43
42
|
return null;
|
|
44
43
|
}
|
|
45
|
-
return
|
|
44
|
+
return /*#__PURE__*/React.createElement(Popup, {
|
|
46
45
|
mountTo: mountPoint,
|
|
47
46
|
boundariesElement: boundariesElement,
|
|
48
47
|
scrollableElement: scrollableElement,
|
|
@@ -52,14 +51,14 @@ export var LayoutButton = function LayoutButton(_ref) {
|
|
|
52
51
|
forcePlacement: true,
|
|
53
52
|
stick: true,
|
|
54
53
|
ariaLabel: title
|
|
55
|
-
},
|
|
54
|
+
}, /*#__PURE__*/React.createElement(ToolbarButton, {
|
|
56
55
|
testId: testId,
|
|
57
56
|
css: toolbarButtonWrapperStyles,
|
|
58
57
|
title: title,
|
|
59
58
|
onClick: handleClick,
|
|
60
|
-
iconBefore: layout === 'full-width' ?
|
|
59
|
+
iconBefore: layout === 'full-width' ? /*#__PURE__*/React.createElement(CollapseIcon, {
|
|
61
60
|
label: title
|
|
62
|
-
}) :
|
|
61
|
+
}) : /*#__PURE__*/React.createElement(ExpandIcon, {
|
|
63
62
|
label: title
|
|
64
63
|
})
|
|
65
64
|
}));
|
|
@@ -97,7 +96,7 @@ var LayoutButtonWrapper = function LayoutButtonWrapper(_ref2) {
|
|
|
97
96
|
if (!isDatasource) {
|
|
98
97
|
return null;
|
|
99
98
|
}
|
|
100
|
-
return
|
|
99
|
+
return /*#__PURE__*/React.createElement(LayoutButton, {
|
|
101
100
|
mountPoint: mountPoint,
|
|
102
101
|
scrollableElement: scrollableElement,
|
|
103
102
|
boundariesElement: boundariesElement,
|
|
@@ -10,9 +10,7 @@ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbol
|
|
|
10
10
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
11
11
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
12
12
|
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; } }
|
|
13
|
-
/** @jsx jsx */
|
|
14
13
|
import React from 'react';
|
|
15
|
-
import { jsx } from '@emotion/react';
|
|
16
14
|
import { embedSpacingStyles } from '@atlaskit/editor-common/styles';
|
|
17
15
|
import { calcColumnsFromPx, calcMediaPxWidth, calcPctFromPx, calcPxFromColumns, handleSides, imageAlignmentMap, Resizer, snapTo, wrappedLayouts, wrapperStyle } from '@atlaskit/editor-common/ui';
|
|
18
16
|
import { findParentNodeOfTypeClosestToPos, hasParentNodeOfType } from '@atlaskit/editor-prosemirror/utils';
|
|
@@ -306,7 +304,7 @@ var ResizableEmbedCard = /*#__PURE__*/function (_React$Component) {
|
|
|
306
304
|
paddingBottom: "calc(".concat((1 / aspectRatio * 100).toFixed(3), "% + ").concat(embedHeaderHeight, "px)")
|
|
307
305
|
};
|
|
308
306
|
}
|
|
309
|
-
return
|
|
307
|
+
return /*#__PURE__*/React.createElement("span", {
|
|
310
308
|
"data-testid": 'resizable-embed-card-height-definer',
|
|
311
309
|
style: _objectSpread({
|
|
312
310
|
display: 'block',
|
|
@@ -352,17 +350,17 @@ var ResizableEmbedCard = /*#__PURE__*/function (_React$Component) {
|
|
|
352
350
|
};
|
|
353
351
|
|
|
354
352
|
/* eslint-disable @atlaskit/design-system/consistent-css-prop-usage */
|
|
355
|
-
return
|
|
353
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
356
354
|
css: embedSpacingStyles,
|
|
357
355
|
"data-testid": "resizable-embed-card-spacing"
|
|
358
|
-
},
|
|
356
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
359
357
|
css: wrapperStyle({
|
|
360
358
|
layout: layout,
|
|
361
359
|
isResized: !!pctWidth,
|
|
362
360
|
containerWidth: containerWidth || DEFAULT_EMBED_CARD_WIDTH,
|
|
363
361
|
fullWidthMode: fullWidthMode
|
|
364
362
|
})
|
|
365
|
-
},
|
|
363
|
+
}, /*#__PURE__*/React.createElement(Resizer, _extends({}, this.props, {
|
|
366
364
|
width: initialWidth // Starting or initial width of embed <iframe> itself.
|
|
367
365
|
,
|
|
368
366
|
enable: enable,
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
2
2
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
3
3
|
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
4
|
-
/** @jsx jsx */
|
|
5
4
|
import { useEffect, useState } from 'react';
|
|
6
5
|
export var useFetchDatasourceInfo = function useFetchDatasourceInfo(_ref) {
|
|
7
6
|
var isRegularCardNode = _ref.isRegularCardNode,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-card",
|
|
3
|
-
"version": "0.14.
|
|
3
|
+
"version": "0.14.9",
|
|
4
4
|
"description": "Card plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -31,9 +31,9 @@
|
|
|
31
31
|
".": "./src/index.ts"
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@atlaskit/adf-schema": "^
|
|
34
|
+
"@atlaskit/adf-schema": "^35.0.0",
|
|
35
35
|
"@atlaskit/analytics-next": "^9.1.0",
|
|
36
|
-
"@atlaskit/custom-steps": "^0.0.
|
|
36
|
+
"@atlaskit/custom-steps": "^0.0.6",
|
|
37
37
|
"@atlaskit/editor-common": "^76.24.0",
|
|
38
38
|
"@atlaskit/editor-plugin-analytics": "^0.3.0",
|
|
39
39
|
"@atlaskit/editor-plugin-decorations": "^0.2.0",
|