@atlaskit/editor-plugin-card 0.4.7 → 0.4.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 +36 -0
- package/dist/cjs/nodeviews/datasource.js +2 -2
- package/dist/cjs/nodeviews/embedCard.js +2 -2
- package/dist/cjs/nodeviews/genericCard.js +2 -2
- package/dist/cjs/plugin.js +14 -12
- package/dist/cjs/pm-plugins/main.js +2 -2
- package/dist/cjs/pm-plugins/mountHyperlink.js +7 -7
- package/dist/cjs/toolbar.js +6 -6
- package/dist/cjs/ui/EditLinkToolbar.js +6 -6
- package/dist/es2019/nodeviews/datasource.js +2 -2
- package/dist/es2019/nodeviews/embedCard.js +2 -2
- package/dist/es2019/nodeviews/genericCard.js +2 -2
- package/dist/es2019/plugin.js +6 -3
- package/dist/es2019/pm-plugins/main.js +2 -2
- package/dist/es2019/pm-plugins/mountHyperlink.js +7 -7
- package/dist/es2019/toolbar.js +6 -6
- package/dist/es2019/ui/EditLinkToolbar.js +6 -6
- package/dist/esm/nodeviews/datasource.js +2 -2
- package/dist/esm/nodeviews/embedCard.js +2 -2
- package/dist/esm/nodeviews/genericCard.js +2 -2
- package/dist/esm/plugin.js +14 -12
- package/dist/esm/pm-plugins/main.js +2 -2
- package/dist/esm/pm-plugins/mountHyperlink.js +7 -7
- package/dist/esm/toolbar.js +6 -6
- package/dist/esm/ui/EditLinkToolbar.js +6 -6
- package/dist/types/index.d.ts +1 -0
- package/dist/types/nodeviews/datasource.d.ts +6 -5
- package/dist/types/nodeviews/embedCard.d.ts +3 -3
- package/dist/types/nodeviews/genericCard.d.ts +7 -7
- package/dist/types/plugin.d.ts +14 -13
- package/dist/types/pm-plugins/main.d.ts +1 -1
- package/dist/types/pm-plugins/mountHyperlink.d.ts +1 -1
- package/dist/types/toolbar.d.ts +1 -1
- package/dist/types-ts4.5/index.d.ts +1 -0
- package/dist/types-ts4.5/nodeviews/datasource.d.ts +6 -5
- package/dist/types-ts4.5/nodeviews/embedCard.d.ts +3 -3
- package/dist/types-ts4.5/nodeviews/genericCard.d.ts +7 -7
- package/dist/types-ts4.5/plugin.d.ts +14 -13
- package/dist/types-ts4.5/pm-plugins/main.d.ts +1 -1
- package/dist/types-ts4.5/pm-plugins/mountHyperlink.d.ts +1 -1
- package/dist/types-ts4.5/toolbar.d.ts +1 -1
- package/package.json +4 -5
- package/report.api.md +16 -13
- package/tmp/api-report-tmp.d.ts +16 -13
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,41 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-card
|
|
2
2
|
|
|
3
|
+
## 0.4.9
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`8467bdcdf4f`](https://bitbucket.org/atlassian/atlassian-frontend/commits/8467bdcdf4f) - Removing `dependencies` prop from PluginInjectionAPI and changing
|
|
8
|
+
signature of `NextEditorPlugin`.
|
|
9
|
+
|
|
10
|
+
Previously a `NextEditorPlugin` would be consumed as so:
|
|
11
|
+
|
|
12
|
+
```ts
|
|
13
|
+
const plugin: NextEditorPlugin< ... > = (config, api) => {
|
|
14
|
+
// Can use api like so:
|
|
15
|
+
api.dependencies.core.actions.execute( ... )
|
|
16
|
+
return { ... }
|
|
17
|
+
}
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
Now these have become named parameters like so and the `pluginInjectionAPI` is used
|
|
21
|
+
without the `dependencies` prop:
|
|
22
|
+
|
|
23
|
+
```ts
|
|
24
|
+
const plugin: NextEditorPlugin< ... > = ({ config, api }) => {
|
|
25
|
+
// Can use api like so:
|
|
26
|
+
api.core.actions.execute( ... )
|
|
27
|
+
return { ... }
|
|
28
|
+
}
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
- Updated dependencies
|
|
32
|
+
|
|
33
|
+
## 0.4.8
|
|
34
|
+
|
|
35
|
+
### Patch Changes
|
|
36
|
+
|
|
37
|
+
- [`24e27147cbd`](https://bitbucket.org/atlassian/atlassian-frontend/commits/24e27147cbd) - Added atlaskit docs to all existing plugins.
|
|
38
|
+
|
|
3
39
|
## 0.4.7
|
|
4
40
|
|
|
5
41
|
### Patch Changes
|
|
@@ -126,7 +126,7 @@ var Datasource = /*#__PURE__*/function (_ReactNodeView) {
|
|
|
126
126
|
(0, _inherits2.default)(Datasource, _ReactNodeView);
|
|
127
127
|
var _super2 = _createSuper(Datasource);
|
|
128
128
|
function Datasource(props) {
|
|
129
|
-
var _props$pluginInjectio, _props$pluginInjectio2,
|
|
129
|
+
var _props$pluginInjectio, _props$pluginInjectio2, _sharedState$currentS;
|
|
130
130
|
var _this2;
|
|
131
131
|
(0, _classCallCheck2.default)(this, Datasource);
|
|
132
132
|
_this2 = _super2.call(this, props.node, props.view, props.getPos, props.portalProviderAPI, props.eventDispatcher, props, undefined, true, undefined, props.hasIntlContext);
|
|
@@ -147,7 +147,7 @@ var Datasource = /*#__PURE__*/function (_ReactNodeView) {
|
|
|
147
147
|
tr.setMeta('scrollIntoView', false);
|
|
148
148
|
return dispatch(tr);
|
|
149
149
|
});
|
|
150
|
-
var sharedState = props === null || props === void 0 ? void 0 : (_props$pluginInjectio = props.pluginInjectionApi) === null || _props$pluginInjectio === void 0 ? void 0 : (_props$pluginInjectio2 = _props$pluginInjectio.
|
|
150
|
+
var sharedState = props === null || props === void 0 ? void 0 : (_props$pluginInjectio = props.pluginInjectionApi) === null || _props$pluginInjectio === void 0 ? void 0 : (_props$pluginInjectio2 = _props$pluginInjectio.width) === null || _props$pluginInjectio2 === void 0 ? void 0 : _props$pluginInjectio2.sharedState;
|
|
151
151
|
_this2.tableWidth = sharedState === null || sharedState === void 0 ? void 0 : (_sharedState$currentS = sharedState.currentState()) === null || _sharedState$currentS === void 0 ? void 0 : _sharedState$currentS.width;
|
|
152
152
|
sharedState === null || sharedState === void 0 ? void 0 : sharedState.onChange(function (_ref3) {
|
|
153
153
|
var nextSharedState = _ref3.nextSharedState;
|
|
@@ -78,8 +78,8 @@ var CardInner = function CardInner(_ref) {
|
|
|
78
78
|
}), smartCard);
|
|
79
79
|
}
|
|
80
80
|
var displayGrid = function displayGrid(visible, gridType, highlight) {
|
|
81
|
-
var _pluginInjectionApi$
|
|
82
|
-
return pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$
|
|
81
|
+
var _pluginInjectionApi$g;
|
|
82
|
+
return pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$g = pluginInjectionApi.grid.actions) === null || _pluginInjectionApi$g === void 0 ? void 0 : _pluginInjectionApi$g.displayGrid(view)({
|
|
83
83
|
visible: visible,
|
|
84
84
|
gridType: gridType,
|
|
85
85
|
highlight: highlight
|
|
@@ -87,7 +87,7 @@ function Card(SmartCardComponent, UnsupportedComponent) {
|
|
|
87
87
|
// (2) Render a blue link whilst downgrading to `link` in the ADF (fatal errs).
|
|
88
88
|
|
|
89
89
|
if (maybeAPIError.kind && maybeAPIError.kind === 'fatal') {
|
|
90
|
-
var _pluginInjectionApi$
|
|
90
|
+
var _pluginInjectionApi$a;
|
|
91
91
|
this.setState({
|
|
92
92
|
isError: true
|
|
93
93
|
});
|
|
@@ -101,7 +101,7 @@ function Card(SmartCardComponent, UnsupportedComponent) {
|
|
|
101
101
|
if (!getPos || typeof getPos === 'boolean') {
|
|
102
102
|
return;
|
|
103
103
|
}
|
|
104
|
-
(0, _doc.changeSelectedCardToLinkFallback)(undefined, url, true, node, getPos(), pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$
|
|
104
|
+
(0, _doc.changeSelectedCardToLinkFallback)(undefined, url, true, node, getPos(), pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$a = pluginInjectionApi.analytics) === null || _pluginInjectionApi$a === void 0 ? void 0 : _pluginInjectionApi$a.actions)(view.state, view.dispatch);
|
|
105
105
|
return null;
|
|
106
106
|
} else {
|
|
107
107
|
// Otherwise, render a blue link as fallback (above in render()).
|
package/dist/cjs/plugin.js
CHANGED
|
@@ -26,9 +26,11 @@ var _EditorSmartCardEvents = require("./ui/EditorSmartCardEvents");
|
|
|
26
26
|
var _LayoutButton = _interopRequireDefault(require("./ui/LayoutButton"));
|
|
27
27
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
28
28
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
29
|
-
var cardPlugin = function cardPlugin(
|
|
30
|
-
var _api$
|
|
31
|
-
var
|
|
29
|
+
var cardPlugin = function cardPlugin(_ref) {
|
|
30
|
+
var _api$featureFlags;
|
|
31
|
+
var options = _ref.config,
|
|
32
|
+
api = _ref.api;
|
|
33
|
+
var featureFlags = (api === null || api === void 0 ? void 0 : (_api$featureFlags = api.featureFlags) === null || _api$featureFlags === void 0 ? void 0 : _api$featureFlags.sharedState.currentState()) || {};
|
|
32
34
|
var cardPluginEvents = featureFlags !== null && featureFlags !== void 0 && featureFlags.lpAnalyticsEventsNext ? (0, _createEventsQueue.createEventsQueue)() : undefined;
|
|
33
35
|
return {
|
|
34
36
|
name: 'card',
|
|
@@ -81,18 +83,18 @@ var cardPlugin = function cardPlugin(options, api) {
|
|
|
81
83
|
}];
|
|
82
84
|
plugins.push({
|
|
83
85
|
name: 'cardKeymap',
|
|
84
|
-
plugin: function plugin(
|
|
85
|
-
var featureFlags =
|
|
86
|
+
plugin: function plugin(_ref2) {
|
|
87
|
+
var featureFlags = _ref2.featureFlags;
|
|
86
88
|
return (0, _keymap.cardKeymap)(featureFlags);
|
|
87
89
|
}
|
|
88
90
|
});
|
|
89
91
|
return plugins;
|
|
90
92
|
},
|
|
91
|
-
contentComponent: function contentComponent(
|
|
92
|
-
var editorView =
|
|
93
|
-
popupsMountPoint =
|
|
94
|
-
popupsScrollableElement =
|
|
95
|
-
popupsBoundariesElement =
|
|
93
|
+
contentComponent: function contentComponent(_ref3) {
|
|
94
|
+
var editorView = _ref3.editorView,
|
|
95
|
+
popupsMountPoint = _ref3.popupsMountPoint,
|
|
96
|
+
popupsScrollableElement = _ref3.popupsScrollableElement,
|
|
97
|
+
popupsBoundariesElement = _ref3.popupsBoundariesElement;
|
|
96
98
|
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_EditorSmartCardEvents.EditorSmartCardEvents, {
|
|
97
99
|
editorView: editorView
|
|
98
100
|
}), cardPluginEvents && /*#__PURE__*/_react.default.createElement(_EditorLinkingPlatformAnalytics.EditorLinkingPlatformAnalytics, {
|
|
@@ -117,8 +119,8 @@ var cardPlugin = function cardPlugin(options, api) {
|
|
|
117
119
|
},
|
|
118
120
|
pluginsOptions: {
|
|
119
121
|
floatingToolbar: (0, _toolbar.floatingToolbar)(options, featureFlags, options.platform, options.linkPicker, api),
|
|
120
|
-
quickInsert: function quickInsert(
|
|
121
|
-
var formatMessage =
|
|
122
|
+
quickInsert: function quickInsert(_ref4) {
|
|
123
|
+
var formatMessage = _ref4.formatMessage;
|
|
122
124
|
var quickInsertArray = [];
|
|
123
125
|
if (!options.allowDatasource) {
|
|
124
126
|
return quickInsertArray;
|
|
@@ -135,8 +135,8 @@ var createPlugin = function createPlugin(options, pluginInjectionApi) {
|
|
|
135
135
|
* other tasks as per common implementations of the JavaScript event loop in browsers.
|
|
136
136
|
*/
|
|
137
137
|
var invoke = (0, _rafSchd.default)(function () {
|
|
138
|
-
var _pluginInjectionApi$
|
|
139
|
-
return (0, _resolve.resolveWithProvider)(view, provider, request, options, pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$
|
|
138
|
+
var _pluginInjectionApi$a, _pluginInjectionApi$a2, _pluginInjectionApi$a3, _pluginInjectionApi$a4;
|
|
139
|
+
return (0, _resolve.resolveWithProvider)(view, provider, request, options, pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$a = pluginInjectionApi.analytics) === null || _pluginInjectionApi$a === void 0 ? void 0 : _pluginInjectionApi$a.actions, (_pluginInjectionApi$a2 = pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$a3 = pluginInjectionApi.analytics) === null || _pluginInjectionApi$a3 === void 0 ? void 0 : (_pluginInjectionApi$a4 = _pluginInjectionApi$a3.sharedState.currentState()) === null || _pluginInjectionApi$a4 === void 0 ? void 0 : _pluginInjectionApi$a4.createAnalyticsEvent) !== null && _pluginInjectionApi$a2 !== void 0 ? _pluginInjectionApi$a2 : undefined);
|
|
140
140
|
});
|
|
141
141
|
rafCancellationCallbacks.push(invoke.cancel);
|
|
142
142
|
invoke();
|
|
@@ -32,14 +32,14 @@ var mountHyperlinkPlugin = function mountHyperlinkPlugin(pluginInjectionApi, opt
|
|
|
32
32
|
return new _safePlugin.SafePlugin({
|
|
33
33
|
view: function view(editorView) {
|
|
34
34
|
requestAnimationFrame(function () {
|
|
35
|
-
var _pluginInjectionApi$
|
|
36
|
-
pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$
|
|
35
|
+
var _pluginInjectionApi$h, _pluginInjectionApi$h2;
|
|
36
|
+
pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$h = pluginInjectionApi.hyperlink) === null || _pluginInjectionApi$h === void 0 ? void 0 : (_pluginInjectionApi$h2 = _pluginInjectionApi$h.actions) === null || _pluginInjectionApi$h2 === void 0 ? void 0 : _pluginInjectionApi$h2.prependToolbarButtons({
|
|
37
37
|
items: function items(state, intl, providerFactory, link) {
|
|
38
38
|
return [].concat((0, _toConsumableArray2.default)(getToolbarViewedItem(link)), [{
|
|
39
39
|
type: 'custom',
|
|
40
40
|
fallback: [],
|
|
41
41
|
render: function render(editorView) {
|
|
42
|
-
var _pluginInjectionApi$
|
|
42
|
+
var _pluginInjectionApi$a, _pluginInjectionApi$c;
|
|
43
43
|
return /*#__PURE__*/_react.default.createElement(_HyperlinkToolbarAppearance.HyperlinkToolbarAppearance, {
|
|
44
44
|
key: "link-appearance",
|
|
45
45
|
url: link,
|
|
@@ -49,14 +49,14 @@ var mountHyperlinkPlugin = function mountHyperlinkPlugin(pluginInjectionApi, opt
|
|
|
49
49
|
cardOptions: options,
|
|
50
50
|
providerFactory: providerFactory,
|
|
51
51
|
platform: options === null || options === void 0 ? void 0 : options.platform,
|
|
52
|
-
editorAnalyticsApi: pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$
|
|
53
|
-
cardActions: pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$
|
|
52
|
+
editorAnalyticsApi: pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$a = pluginInjectionApi.analytics) === null || _pluginInjectionApi$a === void 0 ? void 0 : _pluginInjectionApi$a.actions,
|
|
53
|
+
cardActions: pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$c = pluginInjectionApi.card) === null || _pluginInjectionApi$c === void 0 ? void 0 : _pluginInjectionApi$c.actions
|
|
54
54
|
});
|
|
55
55
|
}
|
|
56
56
|
}]);
|
|
57
57
|
},
|
|
58
|
-
onEscapeCallback: pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : pluginInjectionApi.
|
|
59
|
-
onInsertLinkCallback: pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : pluginInjectionApi.
|
|
58
|
+
onEscapeCallback: pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : pluginInjectionApi.card.actions.hideLinkToolbar,
|
|
59
|
+
onInsertLinkCallback: pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : pluginInjectionApi.card.actions.queueCardsFromChangedTr,
|
|
60
60
|
view: editorView
|
|
61
61
|
});
|
|
62
62
|
});
|
package/dist/cjs/toolbar.js
CHANGED
|
@@ -196,10 +196,10 @@ var getToolbarViewedItem = function getToolbarViewedItem(url, display) {
|
|
|
196
196
|
};
|
|
197
197
|
var generateToolbarItems = function generateToolbarItems(state, featureFlags, intl, providerFactory, cardOptions, platform, linkPicker, pluginInjectionApi) {
|
|
198
198
|
return function (node) {
|
|
199
|
-
var _pluginInjectionApi$
|
|
199
|
+
var _pluginInjectionApi$a, _pluginInjectionApi$d, _pluginInjectionApi$d2, _node$attrs, _node$attrs2, _node$attrs2$datasour;
|
|
200
200
|
var _titleUrlPairFromNode2 = (0, _utils3.titleUrlPairFromNode)(node),
|
|
201
201
|
url = _titleUrlPairFromNode2.url;
|
|
202
|
-
var _ref = (_pluginInjectionApi$
|
|
202
|
+
var _ref = (_pluginInjectionApi$a = pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : pluginInjectionApi.analytics) !== null && _pluginInjectionApi$a !== void 0 ? _pluginInjectionApi$a : {},
|
|
203
203
|
editorAnalyticsApi = _ref.actions;
|
|
204
204
|
var metadata = {};
|
|
205
205
|
if (url && !(0, _adfSchema.isSafeUrl)(url)) {
|
|
@@ -214,7 +214,7 @@ var generateToolbarItems = function generateToolbarItems(state, featureFlags, in
|
|
|
214
214
|
}
|
|
215
215
|
var pluginState = _main.pluginKey.getState(state);
|
|
216
216
|
var currentAppearance = (0, _utils3.appearanceForNodeType)(node.type);
|
|
217
|
-
var _ref2 = (_pluginInjectionApi$
|
|
217
|
+
var _ref2 = (_pluginInjectionApi$d = pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$d2 = pluginInjectionApi.decorations) === null || _pluginInjectionApi$d2 === void 0 ? void 0 : _pluginInjectionApi$d2.actions) !== null && _pluginInjectionApi$d !== void 0 ? _pluginInjectionApi$d : {},
|
|
218
218
|
hoverDecoration = _ref2.hoverDecoration;
|
|
219
219
|
var isDatasource = currentAppearance === 'block' && (node === null || node === void 0 ? void 0 : (_node$attrs = node.attrs) === null || _node$attrs === void 0 ? void 0 : _node$attrs.datasource);
|
|
220
220
|
var shouldRenderDatasourceToolbar = isDatasource &&
|
|
@@ -278,8 +278,8 @@ var generateToolbarItems = function generateToolbarItems(state, featureFlags, in
|
|
|
278
278
|
onClick: withToolbarMetadata(removeCard(editorAnalyticsApi))
|
|
279
279
|
}]);
|
|
280
280
|
if (currentAppearance === 'embed') {
|
|
281
|
-
var _pluginInjectionApi$
|
|
282
|
-
var alignmentOptions = buildAlignmentOptions(state, intl, pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 :
|
|
281
|
+
var _pluginInjectionApi$a2;
|
|
282
|
+
var alignmentOptions = buildAlignmentOptions(state, intl, pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : pluginInjectionApi.width, pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$a2 = pluginInjectionApi.analytics) === null || _pluginInjectionApi$a2 === void 0 ? void 0 : _pluginInjectionApi$a2.actions, cardOptions);
|
|
283
283
|
if (alignmentOptions.length) {
|
|
284
284
|
alignmentOptions.push({
|
|
285
285
|
type: 'separator'
|
|
@@ -308,7 +308,7 @@ var generateToolbarItems = function generateToolbarItems(state, featureFlags, in
|
|
|
308
308
|
allowBlockCards: allowBlockCards,
|
|
309
309
|
platform: platform,
|
|
310
310
|
editorAnalyticsApi: editorAnalyticsApi,
|
|
311
|
-
cardActions: pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : pluginInjectionApi.
|
|
311
|
+
cardActions: pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : pluginInjectionApi.card.actions
|
|
312
312
|
});
|
|
313
313
|
}
|
|
314
314
|
}, {
|
|
@@ -120,7 +120,7 @@ var EditLinkToolbar = /*#__PURE__*/function (_React$Component) {
|
|
|
120
120
|
},
|
|
121
121
|
onEscapeCallback: function onEscapeCallback(state, dispatch) {
|
|
122
122
|
var tr = state.tr;
|
|
123
|
-
pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : pluginInjectionApi.
|
|
123
|
+
pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : pluginInjectionApi.hyperlink.actions.hideLinkToolbar(tr);
|
|
124
124
|
(0, _actions.hideLinkToolbar)(tr);
|
|
125
125
|
forceFocusSelector === null || forceFocusSelector === void 0 ? void 0 : forceFocusSelector("[aria-label=\"".concat(_messages.linkToolbarMessages.editLink.defaultMessage, "\"]"))(tr);
|
|
126
126
|
if (dispatch) {
|
|
@@ -131,7 +131,7 @@ var EditLinkToolbar = /*#__PURE__*/function (_React$Component) {
|
|
|
131
131
|
},
|
|
132
132
|
onClickAwayCallback: function onClickAwayCallback(state, dispatch) {
|
|
133
133
|
var tr = state.tr;
|
|
134
|
-
pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : pluginInjectionApi.
|
|
134
|
+
pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : pluginInjectionApi.hyperlink.actions.hideLinkToolbar(tr);
|
|
135
135
|
if (dispatch) {
|
|
136
136
|
dispatch(tr);
|
|
137
137
|
return true;
|
|
@@ -172,7 +172,7 @@ var buildEditLinkToolbar = function buildEditLinkToolbar(_ref2) {
|
|
|
172
172
|
disableArrowNavigation: true,
|
|
173
173
|
fallback: [],
|
|
174
174
|
render: function render(view, idx) {
|
|
175
|
-
var _pluginInjectionApi$
|
|
175
|
+
var _pluginInjectionApi$f;
|
|
176
176
|
if (!view || !providerFactory) {
|
|
177
177
|
return null;
|
|
178
178
|
}
|
|
@@ -187,7 +187,7 @@ var buildEditLinkToolbar = function buildEditLinkToolbar(_ref2) {
|
|
|
187
187
|
text: displayInfo.title || '',
|
|
188
188
|
node: node,
|
|
189
189
|
featureFlags: featureFlags,
|
|
190
|
-
forceFocusSelector: pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$
|
|
190
|
+
forceFocusSelector: pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$f = pluginInjectionApi.floatingToolbar.actions) === null || _pluginInjectionApi$f === void 0 ? void 0 : _pluginInjectionApi$f.forceFocusSelector,
|
|
191
191
|
onSubmit: function onSubmit(newHref, newText, inputMethod, analytic) {
|
|
192
192
|
var urlChanged = newHref !== displayInfo.url;
|
|
193
193
|
var titleChanged = newText !== displayInfo.title;
|
|
@@ -195,8 +195,8 @@ var buildEditLinkToolbar = function buildEditLinkToolbar(_ref2) {
|
|
|
195
195
|
// If the title is changed in a smartlink, convert to standard blue hyperlink
|
|
196
196
|
// (even if the url was also changed) - we don't want to lose the custom title.
|
|
197
197
|
if (titleChanged) {
|
|
198
|
-
var _pluginInjectionApi$
|
|
199
|
-
return (0, _card.commandWithMetadata)((0, _doc.changeSelectedCardToLink)(newText, newHref, undefined, undefined, undefined, pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$
|
|
198
|
+
var _pluginInjectionApi$a;
|
|
199
|
+
return (0, _card.commandWithMetadata)((0, _doc.changeSelectedCardToLink)(newText, newHref, undefined, undefined, undefined, pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$a = pluginInjectionApi.analytics) === null || _pluginInjectionApi$a === void 0 ? void 0 : _pluginInjectionApi$a.actions), {
|
|
200
200
|
action: _analytics.ACTION.UPDATED,
|
|
201
201
|
inputMethod: inputMethod,
|
|
202
202
|
sourceEvent: analytic
|
|
@@ -95,7 +95,7 @@ _defineProperty(DatasourceComponent, "contextTypes", {
|
|
|
95
95
|
});
|
|
96
96
|
export class Datasource extends ReactNodeView {
|
|
97
97
|
constructor(props) {
|
|
98
|
-
var _props$pluginInjectio, _props$pluginInjectio2,
|
|
98
|
+
var _props$pluginInjectio, _props$pluginInjectio2, _sharedState$currentS;
|
|
99
99
|
super(props.node, props.view, props.getPos, props.portalProviderAPI, props.eventDispatcher, props, undefined, true, undefined, props.hasIntlContext);
|
|
100
100
|
// this is necessary so that the datasource toolbar won't be rendered on error
|
|
101
101
|
_defineProperty(this, "updateNodeRemoveAttrs", () => {
|
|
@@ -117,7 +117,7 @@ export class Datasource extends ReactNodeView {
|
|
|
117
117
|
tr.setMeta('scrollIntoView', false);
|
|
118
118
|
return dispatch(tr);
|
|
119
119
|
});
|
|
120
|
-
const sharedState = props === null || props === void 0 ? void 0 : (_props$pluginInjectio = props.pluginInjectionApi) === null || _props$pluginInjectio === void 0 ? void 0 : (_props$pluginInjectio2 = _props$pluginInjectio.
|
|
120
|
+
const sharedState = props === null || props === void 0 ? void 0 : (_props$pluginInjectio = props.pluginInjectionApi) === null || _props$pluginInjectio === void 0 ? void 0 : (_props$pluginInjectio2 = _props$pluginInjectio.width) === null || _props$pluginInjectio2 === void 0 ? void 0 : _props$pluginInjectio2.sharedState;
|
|
121
121
|
this.tableWidth = sharedState === null || sharedState === void 0 ? void 0 : (_sharedState$currentS = sharedState.currentState()) === null || _sharedState$currentS === void 0 ? void 0 : _sharedState$currentS.width;
|
|
122
122
|
sharedState === null || sharedState === void 0 ? void 0 : sharedState.onChange(({
|
|
123
123
|
nextSharedState
|
|
@@ -62,8 +62,8 @@ const CardInner = ({
|
|
|
62
62
|
}), smartCard);
|
|
63
63
|
}
|
|
64
64
|
const displayGrid = (visible, gridType, highlight) => {
|
|
65
|
-
var _pluginInjectionApi$
|
|
66
|
-
return pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$
|
|
65
|
+
var _pluginInjectionApi$g;
|
|
66
|
+
return pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$g = pluginInjectionApi.grid.actions) === null || _pluginInjectionApi$g === void 0 ? void 0 : _pluginInjectionApi$g.displayGrid(view)({
|
|
67
67
|
visible,
|
|
68
68
|
gridType,
|
|
69
69
|
highlight: highlight
|
|
@@ -61,7 +61,7 @@ export function Card(SmartCardComponent, UnsupportedComponent) {
|
|
|
61
61
|
// (2) Render a blue link whilst downgrading to `link` in the ADF (fatal errs).
|
|
62
62
|
|
|
63
63
|
if (maybeAPIError.kind && maybeAPIError.kind === 'fatal') {
|
|
64
|
-
var _pluginInjectionApi$
|
|
64
|
+
var _pluginInjectionApi$a;
|
|
65
65
|
this.setState({
|
|
66
66
|
isError: true
|
|
67
67
|
});
|
|
@@ -77,7 +77,7 @@ export function Card(SmartCardComponent, UnsupportedComponent) {
|
|
|
77
77
|
if (!getPos || typeof getPos === 'boolean') {
|
|
78
78
|
return;
|
|
79
79
|
}
|
|
80
|
-
changeSelectedCardToLinkFallback(undefined, url, true, node, getPos(), pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$
|
|
80
|
+
changeSelectedCardToLinkFallback(undefined, url, true, node, getPos(), pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$a = pluginInjectionApi.analytics) === null || _pluginInjectionApi$a === void 0 ? void 0 : _pluginInjectionApi$a.actions)(view.state, view.dispatch);
|
|
81
81
|
return null;
|
|
82
82
|
} else {
|
|
83
83
|
// Otherwise, render a blue link as fallback (above in render()).
|
package/dist/es2019/plugin.js
CHANGED
|
@@ -16,9 +16,12 @@ import DatasourceModalWithState from './ui/DatasourceModal/ModalWithState';
|
|
|
16
16
|
import { EditorLinkingPlatformAnalytics } from './ui/EditorLinkingPlatformAnalytics';
|
|
17
17
|
import { EditorSmartCardEvents } from './ui/EditorSmartCardEvents';
|
|
18
18
|
import LayoutButton from './ui/LayoutButton';
|
|
19
|
-
export const cardPlugin = (
|
|
20
|
-
|
|
21
|
-
|
|
19
|
+
export const cardPlugin = ({
|
|
20
|
+
config: options,
|
|
21
|
+
api
|
|
22
|
+
}) => {
|
|
23
|
+
var _api$featureFlags;
|
|
24
|
+
const featureFlags = (api === null || api === void 0 ? void 0 : (_api$featureFlags = api.featureFlags) === null || _api$featureFlags === void 0 ? void 0 : _api$featureFlags.sharedState.currentState()) || {};
|
|
22
25
|
const cardPluginEvents = featureFlags !== null && featureFlags !== void 0 && featureFlags.lpAnalyticsEventsNext ? createEventsQueue() : undefined;
|
|
23
26
|
return {
|
|
24
27
|
name: 'card',
|
|
@@ -129,8 +129,8 @@ export const createPlugin = (options, pluginInjectionApi) => pmPluginFactoryPara
|
|
|
129
129
|
* other tasks as per common implementations of the JavaScript event loop in browsers.
|
|
130
130
|
*/
|
|
131
131
|
const invoke = rafSchedule(() => {
|
|
132
|
-
var _pluginInjectionApi$
|
|
133
|
-
return resolveWithProvider(view, provider, request, options, pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$
|
|
132
|
+
var _pluginInjectionApi$a, _pluginInjectionApi$a2, _pluginInjectionApi$a3, _pluginInjectionApi$a4;
|
|
133
|
+
return resolveWithProvider(view, provider, request, options, pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$a = pluginInjectionApi.analytics) === null || _pluginInjectionApi$a === void 0 ? void 0 : _pluginInjectionApi$a.actions, (_pluginInjectionApi$a2 = pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$a3 = pluginInjectionApi.analytics) === null || _pluginInjectionApi$a3 === void 0 ? void 0 : (_pluginInjectionApi$a4 = _pluginInjectionApi$a3.sharedState.currentState()) === null || _pluginInjectionApi$a4 === void 0 ? void 0 : _pluginInjectionApi$a4.createAnalyticsEvent) !== null && _pluginInjectionApi$a2 !== void 0 ? _pluginInjectionApi$a2 : undefined);
|
|
134
134
|
});
|
|
135
135
|
rafCancellationCallbacks.push(invoke.cancel);
|
|
136
136
|
invoke();
|
|
@@ -22,13 +22,13 @@ export const mountHyperlinkPlugin = (pluginInjectionApi, options) => {
|
|
|
22
22
|
return new SafePlugin({
|
|
23
23
|
view(editorView) {
|
|
24
24
|
requestAnimationFrame(() => {
|
|
25
|
-
var _pluginInjectionApi$
|
|
26
|
-
pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$
|
|
25
|
+
var _pluginInjectionApi$h, _pluginInjectionApi$h2;
|
|
26
|
+
pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$h = pluginInjectionApi.hyperlink) === null || _pluginInjectionApi$h === void 0 ? void 0 : (_pluginInjectionApi$h2 = _pluginInjectionApi$h.actions) === null || _pluginInjectionApi$h2 === void 0 ? void 0 : _pluginInjectionApi$h2.prependToolbarButtons({
|
|
27
27
|
items: (state, intl, providerFactory, link) => [...getToolbarViewedItem(link), {
|
|
28
28
|
type: 'custom',
|
|
29
29
|
fallback: [],
|
|
30
30
|
render: editorView => {
|
|
31
|
-
var _pluginInjectionApi$
|
|
31
|
+
var _pluginInjectionApi$a, _pluginInjectionApi$c;
|
|
32
32
|
return /*#__PURE__*/React.createElement(HyperlinkToolbarAppearance, {
|
|
33
33
|
key: "link-appearance",
|
|
34
34
|
url: link,
|
|
@@ -38,13 +38,13 @@ export const mountHyperlinkPlugin = (pluginInjectionApi, options) => {
|
|
|
38
38
|
cardOptions: options,
|
|
39
39
|
providerFactory: providerFactory,
|
|
40
40
|
platform: options === null || options === void 0 ? void 0 : options.platform,
|
|
41
|
-
editorAnalyticsApi: pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$
|
|
42
|
-
cardActions: pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$
|
|
41
|
+
editorAnalyticsApi: pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$a = pluginInjectionApi.analytics) === null || _pluginInjectionApi$a === void 0 ? void 0 : _pluginInjectionApi$a.actions,
|
|
42
|
+
cardActions: pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$c = pluginInjectionApi.card) === null || _pluginInjectionApi$c === void 0 ? void 0 : _pluginInjectionApi$c.actions
|
|
43
43
|
});
|
|
44
44
|
}
|
|
45
45
|
}],
|
|
46
|
-
onEscapeCallback: pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : pluginInjectionApi.
|
|
47
|
-
onInsertLinkCallback: pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : pluginInjectionApi.
|
|
46
|
+
onEscapeCallback: pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : pluginInjectionApi.card.actions.hideLinkToolbar,
|
|
47
|
+
onInsertLinkCallback: pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : pluginInjectionApi.card.actions.queueCardsFromChangedTr,
|
|
48
48
|
view: editorView
|
|
49
49
|
});
|
|
50
50
|
});
|
package/dist/es2019/toolbar.js
CHANGED
|
@@ -182,13 +182,13 @@ const getToolbarViewedItem = (url, display) => {
|
|
|
182
182
|
return [];
|
|
183
183
|
};
|
|
184
184
|
const generateToolbarItems = (state, featureFlags, intl, providerFactory, cardOptions, platform, linkPicker, pluginInjectionApi) => node => {
|
|
185
|
-
var _pluginInjectionApi$
|
|
185
|
+
var _pluginInjectionApi$a, _pluginInjectionApi$d, _pluginInjectionApi$d2, _node$attrs, _node$attrs2, _node$attrs2$datasour;
|
|
186
186
|
const {
|
|
187
187
|
url
|
|
188
188
|
} = titleUrlPairFromNode(node);
|
|
189
189
|
const {
|
|
190
190
|
actions: editorAnalyticsApi
|
|
191
|
-
} = (_pluginInjectionApi$
|
|
191
|
+
} = (_pluginInjectionApi$a = pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : pluginInjectionApi.analytics) !== null && _pluginInjectionApi$a !== void 0 ? _pluginInjectionApi$a : {};
|
|
192
192
|
let metadata = {};
|
|
193
193
|
if (url && !isSafeUrl(url)) {
|
|
194
194
|
return [];
|
|
@@ -205,7 +205,7 @@ const generateToolbarItems = (state, featureFlags, intl, providerFactory, cardOp
|
|
|
205
205
|
const currentAppearance = appearanceForNodeType(node.type);
|
|
206
206
|
const {
|
|
207
207
|
hoverDecoration
|
|
208
|
-
} = (_pluginInjectionApi$
|
|
208
|
+
} = (_pluginInjectionApi$d = pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$d2 = pluginInjectionApi.decorations) === null || _pluginInjectionApi$d2 === void 0 ? void 0 : _pluginInjectionApi$d2.actions) !== null && _pluginInjectionApi$d !== void 0 ? _pluginInjectionApi$d : {};
|
|
209
209
|
const isDatasource = currentAppearance === 'block' && (node === null || node === void 0 ? void 0 : (_node$attrs = node.attrs) === null || _node$attrs === void 0 ? void 0 : _node$attrs.datasource);
|
|
210
210
|
const shouldRenderDatasourceToolbar = isDatasource &&
|
|
211
211
|
// not showing toolbar in mobile for now since not sure what our plans are for it
|
|
@@ -270,8 +270,8 @@ const generateToolbarItems = (state, featureFlags, intl, providerFactory, cardOp
|
|
|
270
270
|
onClick: withToolbarMetadata(removeCard(editorAnalyticsApi))
|
|
271
271
|
}];
|
|
272
272
|
if (currentAppearance === 'embed') {
|
|
273
|
-
var _pluginInjectionApi$
|
|
274
|
-
const alignmentOptions = buildAlignmentOptions(state, intl, pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 :
|
|
273
|
+
var _pluginInjectionApi$a2;
|
|
274
|
+
const alignmentOptions = buildAlignmentOptions(state, intl, pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : pluginInjectionApi.width, pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$a2 = pluginInjectionApi.analytics) === null || _pluginInjectionApi$a2 === void 0 ? void 0 : _pluginInjectionApi$a2.actions, cardOptions);
|
|
275
275
|
if (alignmentOptions.length) {
|
|
276
276
|
alignmentOptions.push({
|
|
277
277
|
type: 'separator'
|
|
@@ -301,7 +301,7 @@ const generateToolbarItems = (state, featureFlags, intl, providerFactory, cardOp
|
|
|
301
301
|
allowBlockCards: allowBlockCards,
|
|
302
302
|
platform: platform,
|
|
303
303
|
editorAnalyticsApi: editorAnalyticsApi,
|
|
304
|
-
cardActions: pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : pluginInjectionApi.
|
|
304
|
+
cardActions: pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : pluginInjectionApi.card.actions
|
|
305
305
|
})
|
|
306
306
|
}, {
|
|
307
307
|
type: 'separator'
|
|
@@ -95,7 +95,7 @@ export class EditLinkToolbar extends React.Component {
|
|
|
95
95
|
const {
|
|
96
96
|
tr
|
|
97
97
|
} = state;
|
|
98
|
-
pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : pluginInjectionApi.
|
|
98
|
+
pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : pluginInjectionApi.hyperlink.actions.hideLinkToolbar(tr);
|
|
99
99
|
hideLinkToolbar(tr);
|
|
100
100
|
forceFocusSelector === null || forceFocusSelector === void 0 ? void 0 : forceFocusSelector(`[aria-label="${linkToolbarMessages.editLink.defaultMessage}"]`)(tr);
|
|
101
101
|
if (dispatch) {
|
|
@@ -108,7 +108,7 @@ export class EditLinkToolbar extends React.Component {
|
|
|
108
108
|
const {
|
|
109
109
|
tr
|
|
110
110
|
} = state;
|
|
111
|
-
pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : pluginInjectionApi.
|
|
111
|
+
pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : pluginInjectionApi.hyperlink.actions.hideLinkToolbar(tr);
|
|
112
112
|
if (dispatch) {
|
|
113
113
|
dispatch(tr);
|
|
114
114
|
return true;
|
|
@@ -146,7 +146,7 @@ export const buildEditLinkToolbar = ({
|
|
|
146
146
|
disableArrowNavigation: true,
|
|
147
147
|
fallback: [],
|
|
148
148
|
render: (view, idx) => {
|
|
149
|
-
var _pluginInjectionApi$
|
|
149
|
+
var _pluginInjectionApi$f;
|
|
150
150
|
if (!view || !providerFactory) {
|
|
151
151
|
return null;
|
|
152
152
|
}
|
|
@@ -161,7 +161,7 @@ export const buildEditLinkToolbar = ({
|
|
|
161
161
|
text: displayInfo.title || '',
|
|
162
162
|
node: node,
|
|
163
163
|
featureFlags: featureFlags,
|
|
164
|
-
forceFocusSelector: pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$
|
|
164
|
+
forceFocusSelector: pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$f = pluginInjectionApi.floatingToolbar.actions) === null || _pluginInjectionApi$f === void 0 ? void 0 : _pluginInjectionApi$f.forceFocusSelector,
|
|
165
165
|
onSubmit: (newHref, newText, inputMethod, analytic) => {
|
|
166
166
|
const urlChanged = newHref !== displayInfo.url;
|
|
167
167
|
const titleChanged = newText !== displayInfo.title;
|
|
@@ -169,8 +169,8 @@ export const buildEditLinkToolbar = ({
|
|
|
169
169
|
// If the title is changed in a smartlink, convert to standard blue hyperlink
|
|
170
170
|
// (even if the url was also changed) - we don't want to lose the custom title.
|
|
171
171
|
if (titleChanged) {
|
|
172
|
-
var _pluginInjectionApi$
|
|
173
|
-
return commandWithMetadata(changeSelectedCardToLink(newText, newHref, undefined, undefined, undefined, pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$
|
|
172
|
+
var _pluginInjectionApi$a;
|
|
173
|
+
return commandWithMetadata(changeSelectedCardToLink(newText, newHref, undefined, undefined, undefined, pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$a = pluginInjectionApi.analytics) === null || _pluginInjectionApi$a === void 0 ? void 0 : _pluginInjectionApi$a.actions), {
|
|
174
174
|
action: ACTION.UPDATED,
|
|
175
175
|
inputMethod,
|
|
176
176
|
sourceEvent: analytic
|
|
@@ -119,7 +119,7 @@ export var Datasource = /*#__PURE__*/function (_ReactNodeView) {
|
|
|
119
119
|
_inherits(Datasource, _ReactNodeView);
|
|
120
120
|
var _super2 = _createSuper(Datasource);
|
|
121
121
|
function Datasource(props) {
|
|
122
|
-
var _props$pluginInjectio, _props$pluginInjectio2,
|
|
122
|
+
var _props$pluginInjectio, _props$pluginInjectio2, _sharedState$currentS;
|
|
123
123
|
var _this2;
|
|
124
124
|
_classCallCheck(this, Datasource);
|
|
125
125
|
_this2 = _super2.call(this, props.node, props.view, props.getPos, props.portalProviderAPI, props.eventDispatcher, props, undefined, true, undefined, props.hasIntlContext);
|
|
@@ -140,7 +140,7 @@ export var Datasource = /*#__PURE__*/function (_ReactNodeView) {
|
|
|
140
140
|
tr.setMeta('scrollIntoView', false);
|
|
141
141
|
return dispatch(tr);
|
|
142
142
|
});
|
|
143
|
-
var sharedState = props === null || props === void 0 ? void 0 : (_props$pluginInjectio = props.pluginInjectionApi) === null || _props$pluginInjectio === void 0 ? void 0 : (_props$pluginInjectio2 = _props$pluginInjectio.
|
|
143
|
+
var sharedState = props === null || props === void 0 ? void 0 : (_props$pluginInjectio = props.pluginInjectionApi) === null || _props$pluginInjectio === void 0 ? void 0 : (_props$pluginInjectio2 = _props$pluginInjectio.width) === null || _props$pluginInjectio2 === void 0 ? void 0 : _props$pluginInjectio2.sharedState;
|
|
144
144
|
_this2.tableWidth = sharedState === null || sharedState === void 0 ? void 0 : (_sharedState$currentS = sharedState.currentState()) === null || _sharedState$currentS === void 0 ? void 0 : _sharedState$currentS.width;
|
|
145
145
|
sharedState === null || sharedState === void 0 ? void 0 : sharedState.onChange(function (_ref3) {
|
|
146
146
|
var nextSharedState = _ref3.nextSharedState;
|
|
@@ -71,8 +71,8 @@ var CardInner = function CardInner(_ref) {
|
|
|
71
71
|
}), smartCard);
|
|
72
72
|
}
|
|
73
73
|
var displayGrid = function displayGrid(visible, gridType, highlight) {
|
|
74
|
-
var _pluginInjectionApi$
|
|
75
|
-
return pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$
|
|
74
|
+
var _pluginInjectionApi$g;
|
|
75
|
+
return pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$g = pluginInjectionApi.grid.actions) === null || _pluginInjectionApi$g === void 0 ? void 0 : _pluginInjectionApi$g.displayGrid(view)({
|
|
76
76
|
visible: visible,
|
|
77
77
|
gridType: gridType,
|
|
78
78
|
highlight: highlight
|
|
@@ -80,7 +80,7 @@ export function Card(SmartCardComponent, UnsupportedComponent) {
|
|
|
80
80
|
// (2) Render a blue link whilst downgrading to `link` in the ADF (fatal errs).
|
|
81
81
|
|
|
82
82
|
if (maybeAPIError.kind && maybeAPIError.kind === 'fatal') {
|
|
83
|
-
var _pluginInjectionApi$
|
|
83
|
+
var _pluginInjectionApi$a;
|
|
84
84
|
this.setState({
|
|
85
85
|
isError: true
|
|
86
86
|
});
|
|
@@ -94,7 +94,7 @@ export function Card(SmartCardComponent, UnsupportedComponent) {
|
|
|
94
94
|
if (!getPos || typeof getPos === 'boolean') {
|
|
95
95
|
return;
|
|
96
96
|
}
|
|
97
|
-
changeSelectedCardToLinkFallback(undefined, url, true, node, getPos(), pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$
|
|
97
|
+
changeSelectedCardToLinkFallback(undefined, url, true, node, getPos(), pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$a = pluginInjectionApi.analytics) === null || _pluginInjectionApi$a === void 0 ? void 0 : _pluginInjectionApi$a.actions)(view.state, view.dispatch);
|
|
98
98
|
return null;
|
|
99
99
|
} else {
|
|
100
100
|
// Otherwise, render a blue link as fallback (above in render()).
|