@atlaskit/editor-plugin-card 0.9.0 → 0.9.2
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 +13 -0
- package/dist/cjs/analytics/create-events-queue.js +2 -3
- package/dist/cjs/analytics/events-from-tr.js +1 -2
- package/dist/cjs/analytics/types.js +3 -5
- package/dist/cjs/analytics/utils.js +8 -13
- package/dist/cjs/datasourceErrorBoundary.js +8 -6
- package/dist/cjs/messages.js +2 -3
- package/dist/cjs/nodeviews/blockCard.js +3 -5
- package/dist/cjs/nodeviews/datasource.js +7 -28
- package/dist/cjs/nodeviews/embedCard.js +4 -6
- package/dist/cjs/nodeviews/genericCard.js +1 -1
- package/dist/cjs/nodeviews/inlineCard.js +1 -2
- package/dist/cjs/plugin.js +3 -4
- package/dist/cjs/pm-plugins/actions.js +14 -27
- package/dist/cjs/pm-plugins/doc.js +23 -36
- package/dist/cjs/pm-plugins/main.js +8 -9
- package/dist/cjs/pm-plugins/mountHyperlink.js +6 -7
- package/dist/cjs/pm-plugins/plugin-key.js +1 -2
- package/dist/cjs/pm-plugins/reducers.js +2 -3
- package/dist/cjs/pm-plugins/util/resolve.js +3 -5
- package/dist/cjs/pm-plugins/util/state.js +3 -6
- package/dist/cjs/toolbar.js +12 -16
- package/dist/cjs/ui/CardContextProvider.js +1 -2
- package/dist/cjs/ui/DatasourceModal/ModalWithState.js +13 -6
- package/dist/cjs/ui/DatasourceModal/index.js +26 -11
- package/dist/cjs/ui/EditDatasourceButton.js +30 -70
- package/dist/cjs/ui/EditLinkToolbar.js +11 -15
- package/dist/cjs/ui/EditorAnalyticsContext.js +2 -3
- package/dist/cjs/ui/EditorLinkingPlatformAnalytics/DatasourceEvents.js +7 -8
- package/dist/cjs/ui/EditorLinkingPlatformAnalytics/LinkEvents.js +2 -3
- package/dist/cjs/ui/EditorLinkingPlatformAnalytics/common.js +5 -9
- package/dist/cjs/ui/EditorLinkingPlatformAnalytics/index.js +1 -2
- package/dist/cjs/ui/EditorSmartCardEvents.js +2 -3
- package/dist/cjs/ui/HyperlinkToolbarAppearance.js +2 -3
- package/dist/cjs/ui/LayoutButton/index.js +3 -5
- package/dist/cjs/ui/LayoutButton/utils.js +2 -3
- package/dist/cjs/ui/LinkToolbarAppearance.js +3 -4
- package/dist/cjs/ui/ResizableEmbedCard.js +1 -2
- package/dist/cjs/ui/ToolbarViewedEvent.js +2 -3
- package/dist/cjs/ui/useFetchDatasourceInfo.js +86 -0
- package/dist/cjs/utils.js +7 -13
- package/dist/es2019/datasourceErrorBoundary.js +7 -4
- package/dist/es2019/nodeviews/datasource.js +0 -22
- package/dist/es2019/ui/DatasourceModal/ModalWithState.js +10 -3
- package/dist/es2019/ui/DatasourceModal/index.js +23 -6
- package/dist/es2019/ui/EditDatasourceButton.js +11 -15
- package/dist/es2019/ui/useFetchDatasourceInfo.js +45 -0
- package/dist/esm/analytics/utils.js +2 -2
- package/dist/esm/datasourceErrorBoundary.js +7 -4
- package/dist/esm/nodeviews/datasource.js +4 -23
- package/dist/esm/nodeviews/embedCard.js +1 -1
- package/dist/esm/nodeviews/genericCard.js +1 -1
- package/dist/esm/plugin.js +1 -1
- package/dist/esm/pm-plugins/doc.js +9 -9
- package/dist/esm/pm-plugins/main.js +6 -6
- package/dist/esm/pm-plugins/mountHyperlink.js +4 -4
- package/dist/esm/toolbar.js +8 -8
- package/dist/esm/ui/DatasourceModal/ModalWithState.js +12 -4
- package/dist/esm/ui/DatasourceModal/index.js +24 -8
- package/dist/esm/ui/EditDatasourceButton.js +20 -57
- package/dist/esm/ui/EditLinkToolbar.js +6 -6
- package/dist/esm/ui/EditorLinkingPlatformAnalytics/DatasourceEvents.js +5 -5
- package/dist/esm/ui/LayoutButton/index.js +1 -1
- package/dist/esm/ui/LinkToolbarAppearance.js +2 -2
- package/dist/esm/ui/useFetchDatasourceInfo.js +78 -0
- package/dist/types/datasourceErrorBoundary.d.ts +2 -2
- package/dist/types/nodeviews/datasource.d.ts +0 -1
- package/dist/types/ui/DatasourceModal/ModalWithState.d.ts +2 -2
- package/dist/types/ui/DatasourceModal/index.d.ts +3 -1
- package/dist/types/ui/EditDatasourceButton.d.ts +1 -0
- package/dist/types/ui/useFetchDatasourceInfo.d.ts +14 -0
- package/dist/types-ts4.5/datasourceErrorBoundary.d.ts +2 -2
- package/dist/types-ts4.5/nodeviews/datasource.d.ts +0 -1
- package/dist/types-ts4.5/ui/DatasourceModal/ModalWithState.d.ts +2 -2
- package/dist/types-ts4.5/ui/DatasourceModal/index.d.ts +3 -1
- package/dist/types-ts4.5/ui/EditDatasourceButton.d.ts +1 -0
- package/dist/types-ts4.5/ui/useFetchDatasourceInfo.d.ts +14 -0
- package/package.json +6 -5
|
@@ -13,17 +13,29 @@ var _state = require("@atlaskit/editor-prosemirror/state");
|
|
|
13
13
|
var _linkDatasource = require("@atlaskit/link-datasource");
|
|
14
14
|
var _actions = require("../../pm-plugins/actions");
|
|
15
15
|
var _doc = require("../../pm-plugins/doc");
|
|
16
|
+
var _useFetchDatasourceInfo = require("../useFetchDatasourceInfo");
|
|
16
17
|
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); }
|
|
17
18
|
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; }
|
|
18
19
|
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; }
|
|
19
20
|
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; }
|
|
20
|
-
var DatasourceModal = function DatasourceModal(_ref) {
|
|
21
|
+
var DatasourceModal = exports.DatasourceModal = function DatasourceModal(_ref) {
|
|
22
|
+
var _existingNode$attrs, _existingNode$attrs2;
|
|
21
23
|
var view = _ref.view,
|
|
22
|
-
modalType = _ref.modalType
|
|
24
|
+
modalType = _ref.modalType,
|
|
25
|
+
cardContext = _ref.cardContext;
|
|
23
26
|
var dispatch = view.dispatch,
|
|
24
27
|
state = view.state;
|
|
25
28
|
var selection = state.selection;
|
|
26
29
|
var existingNode = selection instanceof _state.NodeSelection ? selection.node : undefined;
|
|
30
|
+
var isRegularCardNode = !!(existingNode && !(existingNode !== null && existingNode !== void 0 && (_existingNode$attrs = existingNode.attrs) !== null && _existingNode$attrs !== void 0 && _existingNode$attrs.datasource));
|
|
31
|
+
var _useFetchDatasourceIn = (0, _useFetchDatasourceInfo.useFetchDatasourceInfo)({
|
|
32
|
+
isRegularCardNode: isRegularCardNode,
|
|
33
|
+
url: existingNode === null || existingNode === void 0 ? void 0 : existingNode.attrs.url,
|
|
34
|
+
cardContext: cardContext,
|
|
35
|
+
nodeParameters: existingNode === null || existingNode === void 0 || (_existingNode$attrs2 = existingNode.attrs) === null || _existingNode$attrs2 === void 0 || (_existingNode$attrs2 = _existingNode$attrs2.datasource) === null || _existingNode$attrs2 === void 0 ? void 0 : _existingNode$attrs2.parameters
|
|
36
|
+
}),
|
|
37
|
+
parameters = _useFetchDatasourceIn.parameters,
|
|
38
|
+
ready = _useFetchDatasourceIn.ready;
|
|
27
39
|
var onClose = (0, _react.useCallback)(function () {
|
|
28
40
|
dispatch((0, _actions.hideDatasourceModal)(state.tr));
|
|
29
41
|
}, [dispatch, state.tr]);
|
|
@@ -44,23 +56,27 @@ var DatasourceModal = function DatasourceModal(_ref) {
|
|
|
44
56
|
}
|
|
45
57
|
}, [existingNode, state, view]);
|
|
46
58
|
if (modalType === 'jira') {
|
|
47
|
-
var _existingNode$
|
|
48
|
-
|
|
59
|
+
var _existingNode$attrs3, _tableView$properties;
|
|
60
|
+
if (!ready) {
|
|
61
|
+
return null;
|
|
62
|
+
}
|
|
63
|
+
var _ref2 = (existingNode === null || existingNode === void 0 || (_existingNode$attrs3 = existingNode.attrs) === null || _existingNode$attrs3 === void 0 ? void 0 : _existingNode$attrs3.datasource) || {},
|
|
49
64
|
_ref2$id = _ref2.id,
|
|
50
65
|
datasourceId = _ref2$id === void 0 ? _linkDatasource.JIRA_LIST_OF_LINKS_DATASOURCE_ID : _ref2$id,
|
|
51
|
-
parameters = _ref2.parameters,
|
|
52
66
|
_ref2$views = _ref2.views,
|
|
53
67
|
views = _ref2$views === void 0 ? [] : _ref2$views;
|
|
54
68
|
var _ref3 = views,
|
|
55
69
|
_ref4 = (0, _slicedToArray2.default)(_ref3, 1),
|
|
56
70
|
tableView = _ref4[0];
|
|
57
|
-
var visibleColumnKeys = tableView === null || tableView === void 0
|
|
71
|
+
var visibleColumnKeys = tableView === null || tableView === void 0 || (_tableView$properties = tableView.properties) === null || _tableView$properties === void 0 ? void 0 : _tableView$properties.columns.map(function (column) {
|
|
58
72
|
return column.key;
|
|
59
73
|
});
|
|
60
74
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
61
75
|
"data-testid": "jira-config-modal"
|
|
62
76
|
}, /*#__PURE__*/_react.default.createElement(_linkDatasource.JiraIssuesConfigModal, {
|
|
63
77
|
datasourceId: datasourceId,
|
|
78
|
+
viewMode: isRegularCardNode ? 'count' : 'issue' // Want non-datasource cards to open in count view since they are in issue count view
|
|
79
|
+
,
|
|
64
80
|
visibleColumnKeys: visibleColumnKeys,
|
|
65
81
|
parameters: parameters,
|
|
66
82
|
onCancel: onClose,
|
|
@@ -68,8 +84,8 @@ var DatasourceModal = function DatasourceModal(_ref) {
|
|
|
68
84
|
}));
|
|
69
85
|
}
|
|
70
86
|
if (modalType === 'assets') {
|
|
71
|
-
var _existingNode$
|
|
72
|
-
var _ref5 = (existingNode === null || existingNode === void 0
|
|
87
|
+
var _existingNode$attrs4, _tableView$properties2;
|
|
88
|
+
var _ref5 = (existingNode === null || existingNode === void 0 || (_existingNode$attrs4 = existingNode.attrs) === null || _existingNode$attrs4 === void 0 ? void 0 : _existingNode$attrs4.datasource) || {},
|
|
73
89
|
_ref5$id = _ref5.id,
|
|
74
90
|
_datasourceId = _ref5$id === void 0 ? _linkDatasource.ASSETS_LIST_OF_LINKS_DATASOURCE_ID : _ref5$id,
|
|
75
91
|
_parameters = _ref5.parameters,
|
|
@@ -78,7 +94,7 @@ var DatasourceModal = function DatasourceModal(_ref) {
|
|
|
78
94
|
var _ref6 = _views,
|
|
79
95
|
_ref7 = (0, _slicedToArray2.default)(_ref6, 1),
|
|
80
96
|
_tableView = _ref7[0];
|
|
81
|
-
var _visibleColumnKeys = _tableView === null || _tableView === void 0
|
|
97
|
+
var _visibleColumnKeys = _tableView === null || _tableView === void 0 || (_tableView$properties2 = _tableView.properties) === null || _tableView$properties2 === void 0 ? void 0 : _tableView$properties2.columns.map(function (column) {
|
|
82
98
|
return column.key;
|
|
83
99
|
});
|
|
84
100
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
@@ -92,5 +108,4 @@ var DatasourceModal = function DatasourceModal(_ref) {
|
|
|
92
108
|
}));
|
|
93
109
|
}
|
|
94
110
|
return null; // null for now until we have modal component that handles other datasources
|
|
95
|
-
};
|
|
96
|
-
exports.DatasourceModal = DatasourceModal;
|
|
111
|
+
};
|
|
@@ -1,28 +1,27 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
3
|
Object.defineProperty(exports, "__esModule", {
|
|
5
4
|
value: true
|
|
6
5
|
});
|
|
7
6
|
exports.editDatasource = exports.EditDatasourceButton = void 0;
|
|
8
|
-
var
|
|
9
|
-
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
10
|
-
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
11
|
-
var _react = require("react");
|
|
12
|
-
var _react2 = require("@emotion/react");
|
|
7
|
+
var _react = require("@emotion/react");
|
|
13
8
|
var _messages = require("@atlaskit/editor-common/messages");
|
|
14
9
|
var _ui = require("@atlaskit/editor-common/ui");
|
|
15
10
|
var _utils = require("@atlaskit/editor-common/utils");
|
|
16
11
|
var _actions = require("../pm-plugins/actions");
|
|
17
12
|
var _CardContextProvider = require("./CardContextProvider");
|
|
13
|
+
var _useFetchDatasourceInfo = require("./useFetchDatasourceInfo");
|
|
18
14
|
/** @jsx jsx */
|
|
19
15
|
|
|
20
|
-
var buttonStyles = (0,
|
|
16
|
+
var buttonStyles = (0, _react.css)({
|
|
21
17
|
pointerEvents: 'auto'
|
|
22
18
|
});
|
|
23
|
-
var buttonWrapperStyles = (0,
|
|
19
|
+
var buttonWrapperStyles = (0, _react.css)({
|
|
24
20
|
display: 'flex'
|
|
25
21
|
});
|
|
22
|
+
|
|
23
|
+
// Edit button in toolbar to open datasource modal. This button is shown for inline, block, and embed cards
|
|
24
|
+
// if they can resolve into a datasource.
|
|
26
25
|
var EditDatasourceButtonWithCardContext = function EditDatasourceButtonWithCardContext(_ref) {
|
|
27
26
|
var cardContext = _ref.cardContext,
|
|
28
27
|
intl = _ref.intl,
|
|
@@ -30,56 +29,19 @@ var EditDatasourceButtonWithCardContext = function EditDatasourceButtonWithCardC
|
|
|
30
29
|
url = _ref.url,
|
|
31
30
|
editorView = _ref.editorView,
|
|
32
31
|
editorState = _ref.editorState;
|
|
33
|
-
var
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
var _ref2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
|
|
40
|
-
var _cardContext$connecti, _cardContext$connecti2, _datasources$, response, datasources;
|
|
41
|
-
return _regenerator.default.wrap(function _callee$(_context) {
|
|
42
|
-
while (1) switch (_context.prev = _context.next) {
|
|
43
|
-
case 0:
|
|
44
|
-
_context.prev = 0;
|
|
45
|
-
_context.t0 = url && cardContext;
|
|
46
|
-
if (!_context.t0) {
|
|
47
|
-
_context.next = 6;
|
|
48
|
-
break;
|
|
49
|
-
}
|
|
50
|
-
_context.next = 5;
|
|
51
|
-
return cardContext === null || cardContext === void 0 ? void 0 : (_cardContext$connecti = cardContext.connections) === null || _cardContext$connecti === void 0 ? void 0 : (_cardContext$connecti2 = _cardContext$connecti.client) === null || _cardContext$connecti2 === void 0 ? void 0 : _cardContext$connecti2.fetchData(url);
|
|
52
|
-
case 5:
|
|
53
|
-
_context.t0 = _context.sent;
|
|
54
|
-
case 6:
|
|
55
|
-
response = _context.t0;
|
|
56
|
-
datasources = response && response.datasources || [];
|
|
57
|
-
setDatasourceId(((_datasources$ = datasources[0]) === null || _datasources$ === void 0 ? void 0 : _datasources$.id) || null);
|
|
58
|
-
_context.next = 14;
|
|
59
|
-
break;
|
|
60
|
-
case 11:
|
|
61
|
-
_context.prev = 11;
|
|
62
|
-
_context.t1 = _context["catch"](0);
|
|
63
|
-
setDatasourceId(null);
|
|
64
|
-
case 14:
|
|
65
|
-
case "end":
|
|
66
|
-
return _context.stop();
|
|
67
|
-
}
|
|
68
|
-
}, _callee, null, [[0, 11]]);
|
|
69
|
-
}));
|
|
70
|
-
return function fetchDatasource() {
|
|
71
|
-
return _ref2.apply(this, arguments);
|
|
72
|
-
};
|
|
73
|
-
}();
|
|
74
|
-
void fetchDatasource();
|
|
75
|
-
}, [cardContext, url]);
|
|
32
|
+
var _useFetchDatasourceIn = (0, _useFetchDatasourceInfo.useFetchDatasourceInfo)({
|
|
33
|
+
isRegularCardNode: true,
|
|
34
|
+
url: url,
|
|
35
|
+
cardContext: cardContext
|
|
36
|
+
}),
|
|
37
|
+
datasourceId = _useFetchDatasourceIn.datasourceId;
|
|
76
38
|
if (!datasourceId || !(0, _utils.canRenderDatasource)(datasourceId, false)) {
|
|
77
39
|
return null;
|
|
78
40
|
}
|
|
79
41
|
if (url) {
|
|
80
42
|
var _cardContext$store, _urlState$error;
|
|
81
|
-
var urlState = cardContext === null || cardContext === void 0
|
|
82
|
-
if ((urlState === null || urlState === void 0
|
|
43
|
+
var urlState = cardContext === null || cardContext === void 0 || (_cardContext$store = cardContext.store) === null || _cardContext$store === void 0 ? void 0 : _cardContext$store.getState()[url];
|
|
44
|
+
if ((urlState === null || urlState === void 0 || (_urlState$error = urlState.error) === null || _urlState$error === void 0 ? void 0 : _urlState$error.kind) === 'fatal') {
|
|
83
45
|
return null;
|
|
84
46
|
}
|
|
85
47
|
}
|
|
@@ -89,28 +51,28 @@ var EditDatasourceButtonWithCardContext = function EditDatasourceButtonWithCardC
|
|
|
89
51
|
editorView.focus();
|
|
90
52
|
}
|
|
91
53
|
};
|
|
92
|
-
return (0,
|
|
54
|
+
return (0, _react.jsx)("div", {
|
|
93
55
|
css: buttonWrapperStyles
|
|
94
|
-
}, (0,
|
|
56
|
+
}, (0, _react.jsx)(_ui.FloatingToolbarButton, {
|
|
95
57
|
css: buttonStyles,
|
|
96
58
|
title: intl.formatMessage(_messages.cardMessages.datasourceTitle),
|
|
97
|
-
icon: (0,
|
|
59
|
+
icon: (0, _react.jsx)(_ui.SmallerEditIcon, null),
|
|
98
60
|
selected: false,
|
|
99
61
|
onClick: function onClick() {
|
|
100
62
|
return dispatchCommand(editDatasource(datasourceId, editorAnalyticsApi));
|
|
101
63
|
},
|
|
102
64
|
testId: 'card-edit-datasource-button'
|
|
103
|
-
}), (0,
|
|
65
|
+
}), (0, _react.jsx)(_ui.FloatingToolbarSeparator, null));
|
|
104
66
|
};
|
|
105
|
-
var EditDatasourceButton = function EditDatasourceButton(
|
|
106
|
-
var intl =
|
|
107
|
-
editorAnalyticsApi =
|
|
108
|
-
url =
|
|
109
|
-
editorView =
|
|
110
|
-
editorState =
|
|
111
|
-
return (0,
|
|
112
|
-
var cardContext =
|
|
113
|
-
return (0,
|
|
67
|
+
var EditDatasourceButton = exports.EditDatasourceButton = function EditDatasourceButton(_ref2) {
|
|
68
|
+
var intl = _ref2.intl,
|
|
69
|
+
editorAnalyticsApi = _ref2.editorAnalyticsApi,
|
|
70
|
+
url = _ref2.url,
|
|
71
|
+
editorView = _ref2.editorView,
|
|
72
|
+
editorState = _ref2.editorState;
|
|
73
|
+
return (0, _react.jsx)(_CardContextProvider.CardContextProvider, null, function (_ref3) {
|
|
74
|
+
var cardContext = _ref3.cardContext;
|
|
75
|
+
return (0, _react.jsx)(EditDatasourceButtonWithCardContext, {
|
|
114
76
|
url: url,
|
|
115
77
|
intl: intl,
|
|
116
78
|
editorAnalyticsApi: editorAnalyticsApi,
|
|
@@ -120,8 +82,7 @@ var EditDatasourceButton = function EditDatasourceButton(_ref3) {
|
|
|
120
82
|
});
|
|
121
83
|
});
|
|
122
84
|
};
|
|
123
|
-
exports.
|
|
124
|
-
var editDatasource = function editDatasource(datasourceId, editorAnalyticsApi) {
|
|
85
|
+
var editDatasource = exports.editDatasource = function editDatasource(datasourceId, editorAnalyticsApi) {
|
|
125
86
|
return function (state, dispatch) {
|
|
126
87
|
var datasourceType = (0, _utils.getDatasourceType)(datasourceId);
|
|
127
88
|
if (dispatch && datasourceType) {
|
|
@@ -140,5 +101,4 @@ var editDatasource = function editDatasource(datasourceId, editorAnalyticsApi) {
|
|
|
140
101
|
}
|
|
141
102
|
return false;
|
|
142
103
|
};
|
|
143
|
-
};
|
|
144
|
-
exports.editDatasource = editDatasource;
|
|
104
|
+
};
|
|
@@ -60,7 +60,7 @@ function HyperlinkAddToolbarWithState(_ref) {
|
|
|
60
60
|
}
|
|
61
61
|
|
|
62
62
|
// eslint-disable-next-line @repo/internal/react/no-class-components
|
|
63
|
-
var EditLinkToolbar = /*#__PURE__*/function (_React$Component) {
|
|
63
|
+
var EditLinkToolbar = exports.EditLinkToolbar = /*#__PURE__*/function (_React$Component) {
|
|
64
64
|
(0, _inherits2.default)(EditLinkToolbar, _React$Component);
|
|
65
65
|
var _super = _createSuper(EditLinkToolbar);
|
|
66
66
|
function EditLinkToolbar() {
|
|
@@ -119,9 +119,9 @@ var EditLinkToolbar = /*#__PURE__*/function (_React$Component) {
|
|
|
119
119
|
},
|
|
120
120
|
onEscapeCallback: function onEscapeCallback(state, dispatch) {
|
|
121
121
|
var tr = state.tr;
|
|
122
|
-
pluginInjectionApi === null || pluginInjectionApi === void 0
|
|
122
|
+
pluginInjectionApi === null || pluginInjectionApi === void 0 || pluginInjectionApi.hyperlink.actions.hideLinkToolbar(tr);
|
|
123
123
|
(0, _actions.hideLinkToolbar)(tr);
|
|
124
|
-
forceFocusSelector === null || forceFocusSelector === void 0
|
|
124
|
+
forceFocusSelector === null || forceFocusSelector === void 0 || forceFocusSelector("[aria-label=\"".concat(_messages.linkToolbarMessages.editLink.defaultMessage, "\"]"))(tr);
|
|
125
125
|
if (dispatch) {
|
|
126
126
|
dispatch(tr);
|
|
127
127
|
return true;
|
|
@@ -130,7 +130,7 @@ var EditLinkToolbar = /*#__PURE__*/function (_React$Component) {
|
|
|
130
130
|
},
|
|
131
131
|
onClickAwayCallback: function onClickAwayCallback(state, dispatch) {
|
|
132
132
|
var tr = state.tr;
|
|
133
|
-
pluginInjectionApi === null || pluginInjectionApi === void 0
|
|
133
|
+
pluginInjectionApi === null || pluginInjectionApi === void 0 || pluginInjectionApi.hyperlink.actions.hideLinkToolbar(tr);
|
|
134
134
|
if (dispatch) {
|
|
135
135
|
dispatch(tr);
|
|
136
136
|
return true;
|
|
@@ -142,8 +142,7 @@ var EditLinkToolbar = /*#__PURE__*/function (_React$Component) {
|
|
|
142
142
|
}]);
|
|
143
143
|
return EditLinkToolbar;
|
|
144
144
|
}(_react.default.Component);
|
|
145
|
-
exports.
|
|
146
|
-
var editLink = function editLink(editorAnalyticsApi) {
|
|
145
|
+
var editLink = exports.editLink = function editLink(editorAnalyticsApi) {
|
|
147
146
|
return function (state, dispatch) {
|
|
148
147
|
var type = 'hyperlink';
|
|
149
148
|
if (state.selection instanceof _state.NodeSelection) {
|
|
@@ -152,15 +151,14 @@ var editLink = function editLink(editorAnalyticsApi) {
|
|
|
152
151
|
if (dispatch) {
|
|
153
152
|
var tr = state.tr;
|
|
154
153
|
(0, _actions.showLinkToolbar)(tr);
|
|
155
|
-
editorAnalyticsApi === null || editorAnalyticsApi === void 0
|
|
154
|
+
editorAnalyticsApi === null || editorAnalyticsApi === void 0 || editorAnalyticsApi.attachAnalyticsEvent((0, _analytics.buildEditLinkPayload)(type))(tr);
|
|
156
155
|
dispatch(tr);
|
|
157
156
|
return true;
|
|
158
157
|
}
|
|
159
158
|
return false;
|
|
160
159
|
};
|
|
161
160
|
};
|
|
162
|
-
exports.
|
|
163
|
-
var buildEditLinkToolbar = function buildEditLinkToolbar(_ref2) {
|
|
161
|
+
var buildEditLinkToolbar = exports.buildEditLinkToolbar = function buildEditLinkToolbar(_ref2) {
|
|
164
162
|
var providerFactory = _ref2.providerFactory,
|
|
165
163
|
node = _ref2.node,
|
|
166
164
|
linkPicker = _ref2.linkPicker,
|
|
@@ -186,7 +184,7 @@ var buildEditLinkToolbar = function buildEditLinkToolbar(_ref2) {
|
|
|
186
184
|
text: displayInfo.title || '',
|
|
187
185
|
node: node,
|
|
188
186
|
featureFlags: featureFlags,
|
|
189
|
-
forceFocusSelector: pluginInjectionApi === null || pluginInjectionApi === void 0
|
|
187
|
+
forceFocusSelector: pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$f = pluginInjectionApi.floatingToolbar.actions) === null || _pluginInjectionApi$f === void 0 ? void 0 : _pluginInjectionApi$f.forceFocusSelector,
|
|
190
188
|
onSubmit: function onSubmit(newHref, newText, inputMethod, analytic) {
|
|
191
189
|
var urlChanged = newHref !== displayInfo.url;
|
|
192
190
|
var titleChanged = newText !== displayInfo.title;
|
|
@@ -195,7 +193,7 @@ var buildEditLinkToolbar = function buildEditLinkToolbar(_ref2) {
|
|
|
195
193
|
// (even if the url was also changed) - we don't want to lose the custom title.
|
|
196
194
|
if (titleChanged) {
|
|
197
195
|
var _pluginInjectionApi$a;
|
|
198
|
-
return (0, _card.commandWithMetadata)((0, _doc.changeSelectedCardToLink)(newText, newHref, undefined, undefined, undefined, pluginInjectionApi === null || pluginInjectionApi === void 0
|
|
196
|
+
return (0, _card.commandWithMetadata)((0, _doc.changeSelectedCardToLink)(newText, newHref, undefined, undefined, undefined, pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$a = pluginInjectionApi.analytics) === null || _pluginInjectionApi$a === void 0 ? void 0 : _pluginInjectionApi$a.actions), {
|
|
199
197
|
action: _analytics.ACTION.UPDATED,
|
|
200
198
|
inputMethod: inputMethod,
|
|
201
199
|
sourceEvent: analytic
|
|
@@ -210,12 +208,10 @@ var buildEditLinkToolbar = function buildEditLinkToolbar(_ref2) {
|
|
|
210
208
|
}
|
|
211
209
|
};
|
|
212
210
|
};
|
|
213
|
-
exports.
|
|
214
|
-
var editLinkToolbarConfig = function editLinkToolbarConfig(showLinkingToolbar, lpLinkPicker) {
|
|
211
|
+
var editLinkToolbarConfig = exports.editLinkToolbarConfig = function editLinkToolbarConfig(showLinkingToolbar, lpLinkPicker) {
|
|
215
212
|
return showLinkingToolbar ? {
|
|
216
213
|
height: lpLinkPicker ? _ui.LINKPICKER_HEIGHT_IN_PX : _ui.RECENT_SEARCH_HEIGHT_IN_PX,
|
|
217
214
|
width: _ui.RECENT_SEARCH_WIDTH_IN_PX,
|
|
218
215
|
forcePlacement: true
|
|
219
216
|
} : {};
|
|
220
|
-
};
|
|
221
|
-
exports.editLinkToolbarConfig = editLinkToolbarConfig;
|
|
217
|
+
};
|
|
@@ -12,7 +12,7 @@ var _state = require("../pm-plugins/util/state");
|
|
|
12
12
|
/**
|
|
13
13
|
* Provides location attribute to child events
|
|
14
14
|
*/
|
|
15
|
-
var EditorAnalyticsContext = function EditorAnalyticsContext(_ref) {
|
|
15
|
+
var EditorAnalyticsContext = exports.EditorAnalyticsContext = function EditorAnalyticsContext(_ref) {
|
|
16
16
|
var _getPluginState;
|
|
17
17
|
var editorView = _ref.editorView,
|
|
18
18
|
children = _ref.children;
|
|
@@ -28,5 +28,4 @@ var EditorAnalyticsContext = function EditorAnalyticsContext(_ref) {
|
|
|
28
28
|
return /*#__PURE__*/_react.default.createElement(_analyticsNext.AnalyticsContext, {
|
|
29
29
|
data: analyticsData
|
|
30
30
|
}, children);
|
|
31
|
-
};
|
|
32
|
-
exports.EditorAnalyticsContext = EditorAnalyticsContext;
|
|
31
|
+
};
|
|
@@ -20,8 +20,8 @@ function getDatasourceDisplay(datasourceAttrs) {
|
|
|
20
20
|
return (_datasourceAttrs$data = datasourceAttrs.datasource.views[0]) === null || _datasourceAttrs$data === void 0 ? void 0 : _datasourceAttrs$data.type;
|
|
21
21
|
}
|
|
22
22
|
function getDisplayedColumnCount(datasourceAttrs) {
|
|
23
|
-
var _datasourceAttrs$data2, _datasourceAttrs$data3
|
|
24
|
-
return (_datasourceAttrs$data2 = (_datasourceAttrs$data3 = datasourceAttrs.datasource.views[0]) === null || _datasourceAttrs$data3 === void 0
|
|
23
|
+
var _datasourceAttrs$data2, _datasourceAttrs$data3;
|
|
24
|
+
return (_datasourceAttrs$data2 = (_datasourceAttrs$data3 = datasourceAttrs.datasource.views[0]) === null || _datasourceAttrs$data3 === void 0 || (_datasourceAttrs$data3 = _datasourceAttrs$data3.properties) === null || _datasourceAttrs$data3 === void 0 || (_datasourceAttrs$data3 = _datasourceAttrs$data3.columns) === null || _datasourceAttrs$data3 === void 0 ? void 0 : _datasourceAttrs$data3.length) !== null && _datasourceAttrs$data2 !== void 0 ? _datasourceAttrs$data2 : 0;
|
|
25
25
|
}
|
|
26
26
|
function getSearchMethod(creationMethod, metadata) {
|
|
27
27
|
if (creationMethod === 'editor_paste' || creationMethod === 'editor_type') {
|
|
@@ -37,9 +37,9 @@ function getSearchMethod(creationMethod, metadata) {
|
|
|
37
37
|
}
|
|
38
38
|
function getAnalyticAttributesFromNode(datasourceAttrs, metadata) {
|
|
39
39
|
var url = datasourceAttrs.url,
|
|
40
|
-
_datasourceAttrs$
|
|
41
|
-
datasourceId = _datasourceAttrs$
|
|
42
|
-
parameters = _datasourceAttrs$
|
|
40
|
+
_datasourceAttrs$data4 = datasourceAttrs.datasource,
|
|
41
|
+
datasourceId = _datasourceAttrs$data4.id,
|
|
42
|
+
parameters = _datasourceAttrs$data4.parameters;
|
|
43
43
|
var display = getDatasourceDisplay(datasourceAttrs);
|
|
44
44
|
var inputMethod = '';
|
|
45
45
|
var actions = [];
|
|
@@ -69,7 +69,7 @@ function getAnalyticAttributesFromNode(datasourceAttrs, metadata) {
|
|
|
69
69
|
* Subscribes to the events occuring in the card
|
|
70
70
|
* plugin and fires analytics events accordingly
|
|
71
71
|
*/
|
|
72
|
-
var DatasourceEventsBinding = function DatasourceEventsBinding(_ref) {
|
|
72
|
+
var DatasourceEventsBinding = exports.DatasourceEventsBinding = function DatasourceEventsBinding(_ref) {
|
|
73
73
|
var cardPluginEvents = _ref.cardPluginEvents;
|
|
74
74
|
var _useDatasourceLifecyc = (0, _linkAnalytics.useDatasourceLifecycleAnalytics)(),
|
|
75
75
|
datasourceCreated = _useDatasourceLifecyc.datasourceCreated,
|
|
@@ -170,5 +170,4 @@ var DatasourceEventsBinding = function DatasourceEventsBinding(_ref) {
|
|
|
170
170
|
};
|
|
171
171
|
}, [eventHandlers, cardPluginEvents]);
|
|
172
172
|
return null;
|
|
173
|
-
};
|
|
174
|
-
exports.DatasourceEventsBinding = DatasourceEventsBinding;
|
|
173
|
+
};
|
|
@@ -27,7 +27,7 @@ var displayCategoryFromDisplay = function displayCategoryFromDisplay(display) {
|
|
|
27
27
|
* Subscribes to the events occuring in the card
|
|
28
28
|
* plugin and fires analytics events accordingly
|
|
29
29
|
*/
|
|
30
|
-
var LinkEventsBinding = function LinkEventsBinding(_ref) {
|
|
30
|
+
var LinkEventsBinding = exports.LinkEventsBinding = function LinkEventsBinding(_ref) {
|
|
31
31
|
var cardPluginEvents = _ref.cardPluginEvents;
|
|
32
32
|
/**
|
|
33
33
|
* These callbacks internally use window.requestIdleCallback/requestAnimationFrame
|
|
@@ -128,5 +128,4 @@ var LinkEventsBinding = function LinkEventsBinding(_ref) {
|
|
|
128
128
|
};
|
|
129
129
|
}, [linkEvents, cardPluginEvents]);
|
|
130
130
|
return null;
|
|
131
|
-
};
|
|
132
|
-
exports.LinkEventsBinding = LinkEventsBinding;
|
|
131
|
+
};
|
|
@@ -24,7 +24,7 @@ var withHistoryMethod = function withHistoryMethod(fn) {
|
|
|
24
24
|
return fn(metadata);
|
|
25
25
|
};
|
|
26
26
|
};
|
|
27
|
-
var getMethod = withHistoryMethod(function (_ref) {
|
|
27
|
+
var getMethod = exports.getMethod = withHistoryMethod(function (_ref) {
|
|
28
28
|
var inputMethod = _ref.inputMethod;
|
|
29
29
|
switch (inputMethod) {
|
|
30
30
|
case _analytics.INPUT_METHOD.CLIPBOARD:
|
|
@@ -42,8 +42,7 @@ var getMethod = withHistoryMethod(function (_ref) {
|
|
|
42
42
|
return 'unknown';
|
|
43
43
|
}
|
|
44
44
|
});
|
|
45
|
-
exports.
|
|
46
|
-
var getUpdateType = withHistoryMethod(function (_ref2) {
|
|
45
|
+
var getUpdateType = exports.getUpdateType = withHistoryMethod(function (_ref2) {
|
|
47
46
|
var action = _ref2.action;
|
|
48
47
|
switch (action) {
|
|
49
48
|
case _analytics.ACTION.CHANGED_TYPE:
|
|
@@ -54,16 +53,13 @@ var getUpdateType = withHistoryMethod(function (_ref2) {
|
|
|
54
53
|
return 'unknown';
|
|
55
54
|
}
|
|
56
55
|
});
|
|
57
|
-
exports.
|
|
58
|
-
var getDeleteType = withHistoryMethod(function (_ref3) {
|
|
56
|
+
var getDeleteType = exports.getDeleteType = withHistoryMethod(function (_ref3) {
|
|
59
57
|
var action = _ref3.action;
|
|
60
58
|
if (action === _analytics.ACTION.UNLINK) {
|
|
61
59
|
return 'unlink';
|
|
62
60
|
}
|
|
63
61
|
return 'delete';
|
|
64
62
|
});
|
|
65
|
-
exports.
|
|
66
|
-
var getSourceEventFromMetadata = function getSourceEventFromMetadata(metadata) {
|
|
63
|
+
var getSourceEventFromMetadata = exports.getSourceEventFromMetadata = function getSourceEventFromMetadata(metadata) {
|
|
67
64
|
return metadata.sourceEvent instanceof _analyticsNext.UIAnalyticsEvent ? metadata.sourceEvent : null;
|
|
68
|
-
};
|
|
69
|
-
exports.getSourceEventFromMetadata = getSourceEventFromMetadata;
|
|
65
|
+
};
|
|
@@ -19,7 +19,7 @@ var _LinkEvents = require("./LinkEvents");
|
|
|
19
19
|
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); }; }
|
|
20
20
|
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; } }
|
|
21
21
|
// eslint-disable-next-line @repo/internal/react/no-class-components
|
|
22
|
-
var EditorLinkingPlatformAnalytics = /*#__PURE__*/function (_React$PureComponent) {
|
|
22
|
+
var EditorLinkingPlatformAnalytics = exports.EditorLinkingPlatformAnalytics = /*#__PURE__*/function (_React$PureComponent) {
|
|
23
23
|
(0, _inherits2.default)(EditorLinkingPlatformAnalytics, _React$PureComponent);
|
|
24
24
|
var _super = _createSuper(EditorLinkingPlatformAnalytics);
|
|
25
25
|
function EditorLinkingPlatformAnalytics() {
|
|
@@ -48,7 +48,6 @@ var EditorLinkingPlatformAnalytics = /*#__PURE__*/function (_React$PureComponent
|
|
|
48
48
|
}]);
|
|
49
49
|
return EditorLinkingPlatformAnalytics;
|
|
50
50
|
}(_react.default.PureComponent);
|
|
51
|
-
exports.EditorLinkingPlatformAnalytics = EditorLinkingPlatformAnalytics;
|
|
52
51
|
(0, _defineProperty2.default)(EditorLinkingPlatformAnalytics, "contextTypes", {
|
|
53
52
|
contextAdapter: _propTypes.default.object
|
|
54
53
|
});
|
|
@@ -7,7 +7,7 @@ exports.EditorSmartCardEvents = void 0;
|
|
|
7
7
|
var _react = require("react");
|
|
8
8
|
var _smartCard = require("@atlaskit/smart-card");
|
|
9
9
|
var _actions = require("../pm-plugins/actions");
|
|
10
|
-
var EditorSmartCardEvents = function EditorSmartCardEvents(_ref) {
|
|
10
|
+
var EditorSmartCardEvents = exports.EditorSmartCardEvents = function EditorSmartCardEvents(_ref) {
|
|
11
11
|
var editorView = _ref.editorView;
|
|
12
12
|
var events = (0, _smartCard.useSmartLinkEvents)();
|
|
13
13
|
(0, _react.useEffect)(function () {
|
|
@@ -17,5 +17,4 @@ var EditorSmartCardEvents = function EditorSmartCardEvents(_ref) {
|
|
|
17
17
|
editorView.dispatch((0, _actions.registerSmartCardEvents)(events)(editorView.state.tr));
|
|
18
18
|
}, [events, editorView]);
|
|
19
19
|
return null;
|
|
20
|
-
};
|
|
21
|
-
exports.EditorSmartCardEvents = EditorSmartCardEvents;
|
|
20
|
+
};
|
|
@@ -22,7 +22,7 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
|
|
|
22
22
|
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); }; }
|
|
23
23
|
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; } }
|
|
24
24
|
// eslint-disable-next-line @repo/internal/react/no-class-components
|
|
25
|
-
var HyperlinkToolbarAppearance = /*#__PURE__*/function (_Component) {
|
|
25
|
+
var HyperlinkToolbarAppearance = exports.HyperlinkToolbarAppearance = /*#__PURE__*/function (_Component) {
|
|
26
26
|
(0, _inherits2.default)(HyperlinkToolbarAppearance, _Component);
|
|
27
27
|
var _super = _createSuper(HyperlinkToolbarAppearance);
|
|
28
28
|
function HyperlinkToolbarAppearance() {
|
|
@@ -170,5 +170,4 @@ var HyperlinkToolbarAppearance = /*#__PURE__*/function (_Component) {
|
|
|
170
170
|
}
|
|
171
171
|
}]);
|
|
172
172
|
return HyperlinkToolbarAppearance;
|
|
173
|
-
}(_react.Component);
|
|
174
|
-
exports.HyperlinkToolbarAppearance = HyperlinkToolbarAppearance;
|
|
173
|
+
}(_react.Component);
|
|
@@ -28,7 +28,7 @@ var toolbarButtonWrapperStyles = (0, _react2.css)({
|
|
|
28
28
|
color: "var(--ds-icon, white)".concat(" !important")
|
|
29
29
|
}
|
|
30
30
|
});
|
|
31
|
-
var LayoutButton = function LayoutButton(_ref) {
|
|
31
|
+
var LayoutButton = exports.LayoutButton = function LayoutButton(_ref) {
|
|
32
32
|
var onLayoutChange = _ref.onLayoutChange,
|
|
33
33
|
_ref$layout = _ref.layout,
|
|
34
34
|
layout = _ref$layout === void 0 ? 'center' : _ref$layout,
|
|
@@ -70,7 +70,6 @@ var LayoutButton = function LayoutButton(_ref) {
|
|
|
70
70
|
})
|
|
71
71
|
}));
|
|
72
72
|
};
|
|
73
|
-
exports.LayoutButton = LayoutButton;
|
|
74
73
|
var LayoutButtonWrapper = function LayoutButtonWrapper(_ref2) {
|
|
75
74
|
var _node$attrs, _node$attrs2;
|
|
76
75
|
var editorView = _ref2.editorView,
|
|
@@ -87,7 +86,7 @@ var LayoutButtonWrapper = function LayoutButtonWrapper(_ref2) {
|
|
|
87
86
|
var _ref3 = cardState !== null && cardState !== void 0 ? cardState : {},
|
|
88
87
|
datasourceTableRef = _ref3.datasourceTableRef,
|
|
89
88
|
_ref3$layout = _ref3.layout,
|
|
90
|
-
layout = _ref3$layout === void 0 ? (node === null || node === void 0
|
|
89
|
+
layout = _ref3$layout === void 0 ? (node === null || node === void 0 || (_node$attrs = node.attrs) === null || _node$attrs === void 0 ? void 0 : _node$attrs.layout) || 'center' : _ref3$layout;
|
|
91
90
|
var isDatasource = !!(node !== null && node !== void 0 && (_node$attrs2 = node.attrs) !== null && _node$attrs2 !== void 0 && _node$attrs2.datasource);
|
|
92
91
|
var onLayoutChange = function onLayoutChange(layout) {
|
|
93
92
|
if (pos === undefined) {
|
|
@@ -114,5 +113,4 @@ var LayoutButtonWrapper = function LayoutButtonWrapper(_ref2) {
|
|
|
114
113
|
intl: intl
|
|
115
114
|
});
|
|
116
115
|
};
|
|
117
|
-
var _default = (0, _reactIntlNext.injectIntl)(LayoutButtonWrapper);
|
|
118
|
-
exports.default = _default;
|
|
116
|
+
var _default = exports.default = (0, _reactIntlNext.injectIntl)(LayoutButtonWrapper);
|
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.getDatasource = void 0;
|
|
7
7
|
var _utils = require("@atlaskit/editor-prosemirror/utils");
|
|
8
|
-
var getDatasource = function getDatasource(editorView) {
|
|
8
|
+
var getDatasource = exports.getDatasource = function getDatasource(editorView) {
|
|
9
9
|
var _findSelectedNodeOfTy;
|
|
10
10
|
var _editorView$state = editorView.state,
|
|
11
11
|
selection = _editorView$state.selection,
|
|
@@ -15,5 +15,4 @@ var getDatasource = function getDatasource(editorView) {
|
|
|
15
15
|
node: undefined,
|
|
16
16
|
pos: undefined
|
|
17
17
|
};
|
|
18
|
-
};
|
|
19
|
-
exports.getDatasource = getDatasource;
|
|
18
|
+
};
|
|
@@ -27,7 +27,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
27
27
|
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
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; } }
|
|
29
29
|
// eslint-disable-next-line @repo/internal/react/no-class-components
|
|
30
|
-
var LinkToolbarAppearance = /*#__PURE__*/function (_React$Component) {
|
|
30
|
+
var LinkToolbarAppearance = exports.LinkToolbarAppearance = /*#__PURE__*/function (_React$Component) {
|
|
31
31
|
(0, _inherits2.default)(LinkToolbarAppearance, _React$Component);
|
|
32
32
|
var _super = _createSuper(LinkToolbarAppearance);
|
|
33
33
|
function LinkToolbarAppearance() {
|
|
@@ -56,8 +56,8 @@ var LinkToolbarAppearance = /*#__PURE__*/function (_React$Component) {
|
|
|
56
56
|
};
|
|
57
57
|
if (url) {
|
|
58
58
|
var _cardContext$store, _urlState$error;
|
|
59
|
-
var urlState = cardContext === null || cardContext === void 0
|
|
60
|
-
if ((urlState === null || urlState === void 0
|
|
59
|
+
var urlState = cardContext === null || cardContext === void 0 || (_cardContext$store = cardContext.store) === null || _cardContext$store === void 0 ? void 0 : _cardContext$store.getState()[url];
|
|
60
|
+
if ((urlState === null || urlState === void 0 || (_urlState$error = urlState.error) === null || _urlState$error === void 0 ? void 0 : _urlState$error.kind) === 'fatal') {
|
|
61
61
|
return null;
|
|
62
62
|
}
|
|
63
63
|
}
|
|
@@ -132,7 +132,6 @@ var LinkToolbarAppearance = /*#__PURE__*/function (_React$Component) {
|
|
|
132
132
|
}]);
|
|
133
133
|
return LinkToolbarAppearance;
|
|
134
134
|
}(_react.default.Component);
|
|
135
|
-
exports.LinkToolbarAppearance = LinkToolbarAppearance;
|
|
136
135
|
(0, _defineProperty2.default)(LinkToolbarAppearance, "contextTypes", {
|
|
137
136
|
contextAdapter: _propTypes.default.object
|
|
138
137
|
});
|
|
@@ -25,7 +25,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
25
25
|
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
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; } } /** @jsx jsx */
|
|
27
27
|
// eslint-disable-next-line @repo/internal/react/no-class-components
|
|
28
|
-
var ResizableEmbedCard = /*#__PURE__*/function (_React$Component) {
|
|
28
|
+
var ResizableEmbedCard = exports.default = /*#__PURE__*/function (_React$Component) {
|
|
29
29
|
(0, _inherits2.default)(ResizableEmbedCard, _React$Component);
|
|
30
30
|
var _super = _createSuper(ResizableEmbedCard);
|
|
31
31
|
function ResizableEmbedCard() {
|
|
@@ -385,7 +385,6 @@ var ResizableEmbedCard = /*#__PURE__*/function (_React$Component) {
|
|
|
385
385
|
}]);
|
|
386
386
|
return ResizableEmbedCard;
|
|
387
387
|
}(_react.default.Component);
|
|
388
|
-
exports.default = ResizableEmbedCard;
|
|
389
388
|
(0, _defineProperty2.default)(ResizableEmbedCard, "defaultProps", {
|
|
390
389
|
aspectRatio: _editorSharedStyles.DEFAULT_EMBED_CARD_WIDTH / _editorSharedStyles.DEFAULT_EMBED_CARD_HEIGHT
|
|
391
390
|
});
|
|
@@ -55,7 +55,7 @@ var ToolbarViewedEventBase = function ToolbarViewedEventBase(_ref) {
|
|
|
55
55
|
/**
|
|
56
56
|
* Provides analytics context and card context
|
|
57
57
|
*/
|
|
58
|
-
var ToolbarViewedEvent = function ToolbarViewedEvent(_ref2) {
|
|
58
|
+
var ToolbarViewedEvent = exports.ToolbarViewedEvent = function ToolbarViewedEvent(_ref2) {
|
|
59
59
|
var url = _ref2.url,
|
|
60
60
|
display = _ref2.display,
|
|
61
61
|
editorView = _ref2.editorView;
|
|
@@ -69,5 +69,4 @@ var ToolbarViewedEvent = function ToolbarViewedEvent(_ref2) {
|
|
|
69
69
|
cardContext: cardContext
|
|
70
70
|
}) : null;
|
|
71
71
|
}));
|
|
72
|
-
};
|
|
73
|
-
exports.ToolbarViewedEvent = ToolbarViewedEvent;
|
|
72
|
+
};
|