@atlaskit/editor-plugin-card 0.13.0 → 0.13.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/pm-plugins/mountHyperlink.js +12 -16
- package/dist/cjs/toolbar.js +16 -18
- package/dist/es2019/pm-plugins/mountHyperlink.js +10 -14
- package/dist/es2019/toolbar.js +14 -16
- package/dist/esm/pm-plugins/mountHyperlink.js +12 -16
- package/dist/esm/toolbar.js +16 -18
- package/package.json +2 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-card
|
|
2
2
|
|
|
3
|
+
## 0.13.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#42933](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/42933) [`6a7848b6400`](https://bitbucket.org/atlassian/atlassian-frontend/commits/6a7848b6400) - Cleansup feature flag. Floating toolbar now always fires a viewed event when activated for links when the card plugin is enabled.
|
|
8
|
+
- Updated dependencies
|
|
9
|
+
|
|
10
|
+
## 0.13.1
|
|
11
|
+
|
|
12
|
+
### Patch Changes
|
|
13
|
+
|
|
14
|
+
- [#43078](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/43078) [`088d6edebd4`](https://bitbucket.org/atlassian/atlassian-frontend/commits/088d6edebd4) - [ux] Passing the value of showUpgradeDiscoverability prop to toolbar component
|
|
15
|
+
|
|
3
16
|
## 0.13.0
|
|
4
17
|
|
|
5
18
|
### Minor Changes
|
|
@@ -8,25 +8,21 @@ exports.mountHyperlinkPlugin = void 0;
|
|
|
8
8
|
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
9
9
|
var _react = _interopRequireDefault(require("react"));
|
|
10
10
|
var _safePlugin = require("@atlaskit/editor-common/safe-plugin");
|
|
11
|
-
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
12
11
|
var _HyperlinkToolbarAppearance = require("../ui/HyperlinkToolbarAppearance");
|
|
13
12
|
var _ToolbarViewedEvent = require("../ui/ToolbarViewedEvent");
|
|
14
13
|
var getToolbarViewedItem = function getToolbarViewedItem(link) {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
}];
|
|
28
|
-
}
|
|
29
|
-
return [];
|
|
14
|
+
return [{
|
|
15
|
+
type: 'custom',
|
|
16
|
+
fallback: [],
|
|
17
|
+
render: function render(editorView) {
|
|
18
|
+
return /*#__PURE__*/_react.default.createElement(_ToolbarViewedEvent.ToolbarViewedEvent, {
|
|
19
|
+
key: "edit.link.menu.viewed",
|
|
20
|
+
url: link,
|
|
21
|
+
display: "url",
|
|
22
|
+
editorView: editorView
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
}];
|
|
30
26
|
};
|
|
31
27
|
var mountHyperlinkPlugin = exports.mountHyperlinkPlugin = function mountHyperlinkPlugin(pluginInjectionApi, options) {
|
|
32
28
|
return new _safePlugin.SafePlugin({
|
package/dist/cjs/toolbar.js
CHANGED
|
@@ -168,21 +168,18 @@ var getToolbarViewedItem = function getToolbarViewedItem(url, display) {
|
|
|
168
168
|
if (!url) {
|
|
169
169
|
return [];
|
|
170
170
|
}
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
}];
|
|
184
|
-
}
|
|
185
|
-
return [];
|
|
171
|
+
return [{
|
|
172
|
+
type: 'custom',
|
|
173
|
+
fallback: [],
|
|
174
|
+
render: function render(editorView) {
|
|
175
|
+
return /*#__PURE__*/_react.default.createElement(_ToolbarViewedEvent.ToolbarViewedEvent, {
|
|
176
|
+
key: "edit.link.menu.viewed",
|
|
177
|
+
url: url,
|
|
178
|
+
display: display,
|
|
179
|
+
editorView: editorView
|
|
180
|
+
});
|
|
181
|
+
}
|
|
182
|
+
}];
|
|
186
183
|
};
|
|
187
184
|
var generateToolbarItems = function generateToolbarItems(state, featureFlags, intl, providerFactory, cardOptions, platform, linkPicker, pluginInjectionApi) {
|
|
188
185
|
return function (node) {
|
|
@@ -279,8 +276,8 @@ var generateToolbarItems = function generateToolbarItems(state, featureFlags, in
|
|
|
279
276
|
}
|
|
280
277
|
var allowBlockCards = cardOptions.allowBlockCards,
|
|
281
278
|
allowEmbeds = cardOptions.allowEmbeds,
|
|
282
|
-
allowDatasource = cardOptions.allowDatasource
|
|
283
|
-
|
|
279
|
+
allowDatasource = cardOptions.allowDatasource,
|
|
280
|
+
showUpgradeDiscoverability = cardOptions.showUpgradeDiscoverability;
|
|
284
281
|
// This code will be executed only for appearances such as "inline", "block" & "embed"
|
|
285
282
|
// For url appearance, please see HyperlinkToolbarAppearanceProps
|
|
286
283
|
if (currentAppearance) {
|
|
@@ -299,7 +296,8 @@ var generateToolbarItems = function generateToolbarItems(state, featureFlags, in
|
|
|
299
296
|
allowBlockCards: allowBlockCards,
|
|
300
297
|
platform: platform,
|
|
301
298
|
editorAnalyticsApi: editorAnalyticsApi,
|
|
302
|
-
cardActions: pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : pluginInjectionApi.card.actions
|
|
299
|
+
cardActions: pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : pluginInjectionApi.card.actions,
|
|
300
|
+
showUpgradeDiscoverability: showUpgradeDiscoverability
|
|
303
301
|
});
|
|
304
302
|
}
|
|
305
303
|
}, {
|
|
@@ -1,22 +1,18 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
3
|
-
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
4
3
|
import { HyperlinkToolbarAppearance } from '../ui/HyperlinkToolbarAppearance';
|
|
5
4
|
import { ToolbarViewedEvent } from '../ui/ToolbarViewedEvent';
|
|
6
5
|
const getToolbarViewedItem = link => {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
}];
|
|
18
|
-
}
|
|
19
|
-
return [];
|
|
6
|
+
return [{
|
|
7
|
+
type: 'custom',
|
|
8
|
+
fallback: [],
|
|
9
|
+
render: editorView => /*#__PURE__*/React.createElement(ToolbarViewedEvent, {
|
|
10
|
+
key: "edit.link.menu.viewed",
|
|
11
|
+
url: link,
|
|
12
|
+
display: "url",
|
|
13
|
+
editorView: editorView
|
|
14
|
+
})
|
|
15
|
+
}];
|
|
20
16
|
};
|
|
21
17
|
export const mountHyperlinkPlugin = (pluginInjectionApi, options) => {
|
|
22
18
|
return new SafePlugin({
|
package/dist/es2019/toolbar.js
CHANGED
|
@@ -161,19 +161,16 @@ const getToolbarViewedItem = (url, display) => {
|
|
|
161
161
|
if (!url) {
|
|
162
162
|
return [];
|
|
163
163
|
}
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
}];
|
|
175
|
-
}
|
|
176
|
-
return [];
|
|
164
|
+
return [{
|
|
165
|
+
type: 'custom',
|
|
166
|
+
fallback: [],
|
|
167
|
+
render: editorView => /*#__PURE__*/React.createElement(ToolbarViewedEvent, {
|
|
168
|
+
key: "edit.link.menu.viewed",
|
|
169
|
+
url: url,
|
|
170
|
+
display: display,
|
|
171
|
+
editorView: editorView
|
|
172
|
+
})
|
|
173
|
+
}];
|
|
177
174
|
};
|
|
178
175
|
const generateToolbarItems = (state, featureFlags, intl, providerFactory, cardOptions, platform, linkPicker, pluginInjectionApi) => node => {
|
|
179
176
|
var _pluginInjectionApi$a, _pluginInjectionApi$d, _pluginInjectionApi$d2, _node$attrs, _node$attrs2, _node$attrs2$datasour;
|
|
@@ -276,9 +273,9 @@ const generateToolbarItems = (state, featureFlags, intl, providerFactory, cardOp
|
|
|
276
273
|
const {
|
|
277
274
|
allowBlockCards,
|
|
278
275
|
allowEmbeds,
|
|
279
|
-
allowDatasource
|
|
276
|
+
allowDatasource,
|
|
277
|
+
showUpgradeDiscoverability
|
|
280
278
|
} = cardOptions;
|
|
281
|
-
|
|
282
279
|
// This code will be executed only for appearances such as "inline", "block" & "embed"
|
|
283
280
|
// For url appearance, please see HyperlinkToolbarAppearanceProps
|
|
284
281
|
if (currentAppearance) {
|
|
@@ -296,7 +293,8 @@ const generateToolbarItems = (state, featureFlags, intl, providerFactory, cardOp
|
|
|
296
293
|
allowBlockCards: allowBlockCards,
|
|
297
294
|
platform: platform,
|
|
298
295
|
editorAnalyticsApi: editorAnalyticsApi,
|
|
299
|
-
cardActions: pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : pluginInjectionApi.card.actions
|
|
296
|
+
cardActions: pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : pluginInjectionApi.card.actions,
|
|
297
|
+
showUpgradeDiscoverability: showUpgradeDiscoverability
|
|
300
298
|
})
|
|
301
299
|
}, {
|
|
302
300
|
type: 'separator'
|
|
@@ -1,25 +1,21 @@
|
|
|
1
1
|
import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
4
|
-
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
5
4
|
import { HyperlinkToolbarAppearance } from '../ui/HyperlinkToolbarAppearance';
|
|
6
5
|
import { ToolbarViewedEvent } from '../ui/ToolbarViewedEvent';
|
|
7
6
|
var getToolbarViewedItem = function getToolbarViewedItem(link) {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
}];
|
|
21
|
-
}
|
|
22
|
-
return [];
|
|
7
|
+
return [{
|
|
8
|
+
type: 'custom',
|
|
9
|
+
fallback: [],
|
|
10
|
+
render: function render(editorView) {
|
|
11
|
+
return /*#__PURE__*/React.createElement(ToolbarViewedEvent, {
|
|
12
|
+
key: "edit.link.menu.viewed",
|
|
13
|
+
url: link,
|
|
14
|
+
display: "url",
|
|
15
|
+
editorView: editorView
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
}];
|
|
23
19
|
};
|
|
24
20
|
export var mountHyperlinkPlugin = function mountHyperlinkPlugin(pluginInjectionApi, options) {
|
|
25
21
|
return new SafePlugin({
|
package/dist/esm/toolbar.js
CHANGED
|
@@ -158,21 +158,18 @@ var getToolbarViewedItem = function getToolbarViewedItem(url, display) {
|
|
|
158
158
|
if (!url) {
|
|
159
159
|
return [];
|
|
160
160
|
}
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
}];
|
|
174
|
-
}
|
|
175
|
-
return [];
|
|
161
|
+
return [{
|
|
162
|
+
type: 'custom',
|
|
163
|
+
fallback: [],
|
|
164
|
+
render: function render(editorView) {
|
|
165
|
+
return /*#__PURE__*/React.createElement(ToolbarViewedEvent, {
|
|
166
|
+
key: "edit.link.menu.viewed",
|
|
167
|
+
url: url,
|
|
168
|
+
display: display,
|
|
169
|
+
editorView: editorView
|
|
170
|
+
});
|
|
171
|
+
}
|
|
172
|
+
}];
|
|
176
173
|
};
|
|
177
174
|
var generateToolbarItems = function generateToolbarItems(state, featureFlags, intl, providerFactory, cardOptions, platform, linkPicker, pluginInjectionApi) {
|
|
178
175
|
return function (node) {
|
|
@@ -269,8 +266,8 @@ var generateToolbarItems = function generateToolbarItems(state, featureFlags, in
|
|
|
269
266
|
}
|
|
270
267
|
var allowBlockCards = cardOptions.allowBlockCards,
|
|
271
268
|
allowEmbeds = cardOptions.allowEmbeds,
|
|
272
|
-
allowDatasource = cardOptions.allowDatasource
|
|
273
|
-
|
|
269
|
+
allowDatasource = cardOptions.allowDatasource,
|
|
270
|
+
showUpgradeDiscoverability = cardOptions.showUpgradeDiscoverability;
|
|
274
271
|
// This code will be executed only for appearances such as "inline", "block" & "embed"
|
|
275
272
|
// For url appearance, please see HyperlinkToolbarAppearanceProps
|
|
276
273
|
if (currentAppearance) {
|
|
@@ -289,7 +286,8 @@ var generateToolbarItems = function generateToolbarItems(state, featureFlags, in
|
|
|
289
286
|
allowBlockCards: allowBlockCards,
|
|
290
287
|
platform: platform,
|
|
291
288
|
editorAnalyticsApi: editorAnalyticsApi,
|
|
292
|
-
cardActions: pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : pluginInjectionApi.card.actions
|
|
289
|
+
cardActions: pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : pluginInjectionApi.card.actions,
|
|
290
|
+
showUpgradeDiscoverability: showUpgradeDiscoverability
|
|
293
291
|
});
|
|
294
292
|
}
|
|
295
293
|
}, {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-card",
|
|
3
|
-
"version": "0.13.
|
|
3
|
+
"version": "0.13.2",
|
|
4
4
|
"description": "Card plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"@atlaskit/adf-schema": "^32.0.0",
|
|
35
35
|
"@atlaskit/analytics-next": "^9.1.0",
|
|
36
36
|
"@atlaskit/custom-steps": "^0.0.2",
|
|
37
|
-
"@atlaskit/editor-common": "^76.
|
|
37
|
+
"@atlaskit/editor-common": "^76.20.0",
|
|
38
38
|
"@atlaskit/editor-plugin-analytics": "^0.3.0",
|
|
39
39
|
"@atlaskit/editor-plugin-decorations": "^0.2.0",
|
|
40
40
|
"@atlaskit/editor-plugin-feature-flags": "^1.0.0",
|
|
@@ -123,9 +123,6 @@
|
|
|
123
123
|
"platform.linking-platform.datasource-jira_issues": {
|
|
124
124
|
"type": "boolean"
|
|
125
125
|
},
|
|
126
|
-
"platform.linking-platform.editor.toolbar-viewed-event": {
|
|
127
|
-
"type": "boolean"
|
|
128
|
-
},
|
|
129
126
|
"platform.linking-platform.datasource.show-jlol-basic-filters": {
|
|
130
127
|
"type": "boolean",
|
|
131
128
|
"referenceOnly": "true"
|