@atlaskit/editor-plugin-card 22.1.4 → 22.1.6
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 +15 -0
- package/dist/cjs/nodeviews/embedCard.js +2 -2
- package/dist/cjs/nodeviews/genericCard.js +2 -2
- package/dist/cjs/nodeviews/inlineCard.js +1 -9
- package/dist/cjs/nodeviews/toDOM-fixes/blockCard.js +2 -2
- package/dist/cjs/nodeviews/toDOM-fixes/embedCard.js +2 -2
- package/dist/cjs/nodeviews/toDOM-fixes/inlineCard.js +2 -2
- package/dist/cjs/pm-plugins/doc.js +2 -2
- package/dist/cjs/pm-plugins/main.js +1 -2
- package/dist/cjs/pm-plugins/shouldReplaceLink.js +4 -4
- package/dist/cjs/ui/analytics/events-from-tr.js +3 -3
- package/dist/cjs/ui/datasourceErrorBoundary.js +2 -2
- package/dist/cjs/ui/nativeEmbedNode.js +2 -2
- package/dist/cjs/ui/toolbar.js +2 -2
- package/dist/es2019/nodeviews/embedCard.js +1 -1
- package/dist/es2019/nodeviews/genericCard.js +1 -1
- package/dist/es2019/nodeviews/inlineCard.js +1 -9
- package/dist/es2019/nodeviews/toDOM-fixes/blockCard.js +1 -1
- package/dist/es2019/nodeviews/toDOM-fixes/embedCard.js +1 -1
- package/dist/es2019/nodeviews/toDOM-fixes/inlineCard.js +1 -1
- package/dist/es2019/pm-plugins/doc.js +1 -1
- package/dist/es2019/pm-plugins/main.js +1 -2
- package/dist/es2019/pm-plugins/shouldReplaceLink.js +1 -1
- package/dist/es2019/ui/analytics/events-from-tr.js +1 -1
- package/dist/es2019/ui/datasourceErrorBoundary.js +1 -1
- package/dist/es2019/ui/nativeEmbedNode.js +1 -1
- package/dist/es2019/ui/toolbar.js +1 -1
- package/dist/esm/nodeviews/embedCard.js +1 -1
- package/dist/esm/nodeviews/genericCard.js +1 -1
- package/dist/esm/nodeviews/inlineCard.js +1 -9
- package/dist/esm/nodeviews/toDOM-fixes/blockCard.js +1 -1
- package/dist/esm/nodeviews/toDOM-fixes/embedCard.js +1 -1
- package/dist/esm/nodeviews/toDOM-fixes/inlineCard.js +1 -1
- package/dist/esm/pm-plugins/doc.js +1 -1
- package/dist/esm/pm-plugins/main.js +1 -2
- package/dist/esm/pm-plugins/shouldReplaceLink.js +1 -1
- package/dist/esm/ui/analytics/events-from-tr.js +1 -1
- package/dist/esm/ui/datasourceErrorBoundary.js +1 -1
- package/dist/esm/ui/nativeEmbedNode.js +1 -1
- package/dist/esm/ui/toolbar.js +1 -1
- package/dist/types/nodeviews/embedCard.d.ts +1 -1
- package/dist/types/types/index.d.ts +1 -1
- package/dist/types/ui/ResizableEmbedCard.d.ts +1 -1
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-card
|
|
2
2
|
|
|
3
|
+
## 22.1.6
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies
|
|
8
|
+
|
|
9
|
+
## 22.1.5
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [`d1f1b273026fd`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/d1f1b273026fd) -
|
|
14
|
+
Clean up experiment `cc_dnd_smart_link_changeboard_platform_css` and preserve smart link
|
|
15
|
+
changeboarding behavior.
|
|
16
|
+
- Updated dependencies
|
|
17
|
+
|
|
3
18
|
## 22.1.4
|
|
4
19
|
|
|
5
20
|
### Patch Changes
|
|
@@ -16,7 +16,7 @@ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends")
|
|
|
16
16
|
var _react = _interopRequireDefault(require("react"));
|
|
17
17
|
var _rafSchd = _interopRequireDefault(require("raf-schd"));
|
|
18
18
|
var _v = _interopRequireDefault(require("uuid/v4"));
|
|
19
|
-
var
|
|
19
|
+
var _setAttrs = require("@atlaskit/adf-schema/steps/set-attrs");
|
|
20
20
|
var _urlCheckers = require("@atlaskit/editor-card-provider/url-checkers");
|
|
21
21
|
var _hooks = require("@atlaskit/editor-common/hooks");
|
|
22
22
|
var _reactNodeView = _interopRequireDefault(require("@atlaskit/editor-common/react-node-view"));
|
|
@@ -287,7 +287,7 @@ var EmbedCardComponent = exports.EmbedCardComponent = /*#__PURE__*/function (_Re
|
|
|
287
287
|
if (pos === undefined) {
|
|
288
288
|
return;
|
|
289
289
|
}
|
|
290
|
-
view.dispatch(view.state.tr.step(new
|
|
290
|
+
view.dispatch(view.state.tr.step(new _setAttrs.SetAttrsStep(pos, {
|
|
291
291
|
originalHeight: height,
|
|
292
292
|
originalWidth: width
|
|
293
293
|
})).setMeta('addToHistory', false));
|
|
@@ -14,7 +14,7 @@ var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/ge
|
|
|
14
14
|
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
15
15
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
16
16
|
var _react = _interopRequireWildcard(require("react"));
|
|
17
|
-
var
|
|
17
|
+
var _isSafeUrl = require("@atlaskit/adf-schema/is-safe-url");
|
|
18
18
|
var _AnalyticsContext = _interopRequireDefault(require("@atlaskit/analytics-next/AnalyticsContext"));
|
|
19
19
|
var _hooks = require("@atlaskit/editor-common/hooks");
|
|
20
20
|
var _utils = require("@atlaskit/editor-common/utils");
|
|
@@ -89,7 +89,7 @@ function Card(SmartCardComponent, UnsupportedComponent) {
|
|
|
89
89
|
onClickCallback = _this$props.onClickCallback;
|
|
90
90
|
var _titleUrlPairFromNode = (0, _utils2.titleUrlPairFromNode)(this.props.node),
|
|
91
91
|
url = _titleUrlPairFromNode.url;
|
|
92
|
-
if (url && !(0,
|
|
92
|
+
if (url && !(0, _isSafeUrl.isSafeUrl)(url)) {
|
|
93
93
|
return /*#__PURE__*/_react.default.createElement(UnsupportedComponent, null);
|
|
94
94
|
}
|
|
95
95
|
if (this.state.isError) {
|
|
@@ -13,7 +13,6 @@ var _hooks = require("@atlaskit/editor-common/hooks");
|
|
|
13
13
|
var _ui = require("@atlaskit/editor-common/ui");
|
|
14
14
|
var _editorSmartLinkDraggable = require("@atlaskit/editor-smart-link-draggable");
|
|
15
15
|
var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
|
|
16
|
-
var _expVal = require("@atlaskit/tmp-editor-statsig/expVal");
|
|
17
16
|
var _utils = require("../pm-plugins/utils");
|
|
18
17
|
var _SmartCardSSRReactContextsProvider = require("../ui/SmartCardSSRReactContextsProvider");
|
|
19
18
|
var _genericCard = require("./genericCard");
|
|
@@ -27,13 +26,6 @@ var selectorWithCard = function selectorWithCard(states) {
|
|
|
27
26
|
resolvedInlineSmartLinks: (_states$cardState = states.cardState) === null || _states$cardState === void 0 ? void 0 : _states$cardState.resolvedInlineSmartLinks
|
|
28
27
|
};
|
|
29
28
|
};
|
|
30
|
-
var selectorWithoutCard = function selectorWithoutCard(states) {
|
|
31
|
-
var _states$editorViewMod2;
|
|
32
|
-
return {
|
|
33
|
-
mode: (_states$editorViewMod2 = states.editorViewModeState) === null || _states$editorViewMod2 === void 0 ? void 0 : _states$editorViewMod2.mode,
|
|
34
|
-
resolvedInlineSmartLinks: undefined
|
|
35
|
-
};
|
|
36
|
-
};
|
|
37
29
|
|
|
38
30
|
/**
|
|
39
31
|
* Inline card node view component that renders a Smart Link inline card within the editor.
|
|
@@ -58,7 +50,7 @@ function InlineCardNodeView(props) {
|
|
|
58
50
|
CompetitorPrompt = props.CompetitorPrompt,
|
|
59
51
|
intl = props.intl,
|
|
60
52
|
smartCardContext = props.smartCardContext;
|
|
61
|
-
var _useSharedPluginState = (0, _hooks.useSharedPluginStateWithSelector)(pluginInjectionApi,
|
|
53
|
+
var _useSharedPluginState = (0, _hooks.useSharedPluginStateWithSelector)(pluginInjectionApi, ['editorViewMode', 'card'], selectorWithCard),
|
|
62
54
|
mode = _useSharedPluginState.mode,
|
|
63
55
|
resolvedInlineSmartLinks = _useSharedPluginState.resolvedInlineSmartLinks;
|
|
64
56
|
var url = node.attrs.url;
|
|
@@ -6,14 +6,14 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports.blockCardSpecWithFixedToDOM = void 0;
|
|
8
8
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
9
|
-
var
|
|
9
|
+
var _blockCard = require("@atlaskit/adf-schema/block-card");
|
|
10
10
|
var _lazyNodeView = require("@atlaskit/editor-common/lazy-node-view");
|
|
11
11
|
var _fg = require("@atlaskit/platform-feature-flags/fg");
|
|
12
12
|
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; }
|
|
13
13
|
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; }
|
|
14
14
|
// @nodeSpecException:toDOM patch
|
|
15
15
|
var blockCardSpecWithFixedToDOM = exports.blockCardSpecWithFixedToDOM = function blockCardSpecWithFixedToDOM() {
|
|
16
|
-
var blockCardNode = (0, _fg.fg)('platform_editor_adf_with_localid') ?
|
|
16
|
+
var blockCardNode = (0, _fg.fg)('platform_editor_adf_with_localid') ? _blockCard.blockCardWithLocalId : _blockCard.blockCard;
|
|
17
17
|
return _objectSpread(_objectSpread({}, blockCardNode), {}, {
|
|
18
18
|
toDOM: function toDOM(node) {
|
|
19
19
|
var _node$attrs;
|
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports.embedCardSpecWithFixedToDOM = void 0;
|
|
8
8
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
9
|
-
var
|
|
9
|
+
var _embedCard = require("@atlaskit/adf-schema/embed-card");
|
|
10
10
|
var _lazyNodeView = require("@atlaskit/editor-common/lazy-node-view");
|
|
11
11
|
var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
|
|
12
12
|
var _fg = require("@atlaskit/platform-feature-flags/fg");
|
|
@@ -61,7 +61,7 @@ var LINE_LENGTH = 760;
|
|
|
61
61
|
|
|
62
62
|
// @nodeSpecException:toDOM patch
|
|
63
63
|
var embedCardSpecWithFixedToDOM = exports.embedCardSpecWithFixedToDOM = function embedCardSpecWithFixedToDOM() {
|
|
64
|
-
var embedCardNode = (0, _fg.fg)('platform_editor_adf_with_localid') ?
|
|
64
|
+
var embedCardNode = (0, _fg.fg)('platform_editor_adf_with_localid') ? _embedCard.embedCardWithLocalId : _embedCard.embedCard;
|
|
65
65
|
return _objectSpread(_objectSpread({}, embedCardNode), {}, {
|
|
66
66
|
toDOM: function toDOM(node) {
|
|
67
67
|
var _node$attrs = node.attrs,
|
|
@@ -6,14 +6,14 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports.inlineCardSpecWithFixedToDOM = void 0;
|
|
8
8
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
9
|
-
var
|
|
9
|
+
var _inlineCard = require("@atlaskit/adf-schema/inline-card");
|
|
10
10
|
var _lazyNodeView = require("@atlaskit/editor-common/lazy-node-view");
|
|
11
11
|
var _fg = require("@atlaskit/platform-feature-flags/fg");
|
|
12
12
|
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; }
|
|
13
13
|
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; }
|
|
14
14
|
// @nodeSpecException:toDOM patch
|
|
15
15
|
var inlineCardSpecWithFixedToDOM = exports.inlineCardSpecWithFixedToDOM = function inlineCardSpecWithFixedToDOM() {
|
|
16
|
-
var inlineCardNode = (0, _fg.fg)('platform_editor_adf_with_localid') ?
|
|
16
|
+
var inlineCardNode = (0, _fg.fg)('platform_editor_adf_with_localid') ? _inlineCard.inlineCardWithLocalId : _inlineCard.inlineCard;
|
|
17
17
|
return _objectSpread(_objectSpread({}, inlineCardNode), {}, {
|
|
18
18
|
toDOM: function toDOM(node) {
|
|
19
19
|
var wrapperAttrs = {
|
|
@@ -9,7 +9,7 @@ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/de
|
|
|
9
9
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
10
10
|
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
11
11
|
var _isEqual = _interopRequireDefault(require("lodash/isEqual"));
|
|
12
|
-
var
|
|
12
|
+
var _isSafeUrl = require("@atlaskit/adf-schema/is-safe-url");
|
|
13
13
|
var _analytics = require("@atlaskit/editor-common/analytics");
|
|
14
14
|
var _card = require("@atlaskit/editor-common/card");
|
|
15
15
|
var _link = require("@atlaskit/editor-common/link");
|
|
@@ -30,7 +30,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
30
30
|
function replaceLinksToCards(tr, cardAdf, schema, request) {
|
|
31
31
|
var inlineCard = schema.nodes.inlineCard;
|
|
32
32
|
var url = request.url;
|
|
33
|
-
if (!(0,
|
|
33
|
+
if (!(0, _isSafeUrl.isSafeUrl)(url)) {
|
|
34
34
|
return;
|
|
35
35
|
}
|
|
36
36
|
|
|
@@ -15,7 +15,6 @@ var _styles = require("@atlaskit/editor-common/styles");
|
|
|
15
15
|
var _state = require("@atlaskit/editor-prosemirror/state");
|
|
16
16
|
var _utils = require("@atlaskit/editor-prosemirror/utils");
|
|
17
17
|
var _linkingCommon = require("@atlaskit/linking-common");
|
|
18
|
-
var _expVal = require("@atlaskit/tmp-editor-statsig/expVal");
|
|
19
18
|
var _inlineCard = require("../nodeviews/inlineCard");
|
|
20
19
|
var _lazyBlockCard = require("../nodeviews/lazy-block-card");
|
|
21
20
|
var _lazyEmbedCard = require("../nodeviews/lazy-embed-card");
|
|
@@ -129,7 +128,7 @@ var createPlugin = exports.createPlugin = function createPlugin(options, pluginI
|
|
|
129
128
|
var newState = (0, _reducers.default)(pluginStateWithUpdatedPos, meta);
|
|
130
129
|
|
|
131
130
|
// Track the first resolved inline smart link for PO spotlight DOM targeting
|
|
132
|
-
if (meta.type === 'RESOLVE' && pluginState !== null && pluginState !== void 0 && (_pluginState$requests = pluginState.requests) !== null && _pluginState$requests !== void 0 && _pluginState$requests.length
|
|
131
|
+
if (meta.type === 'RESOLVE' && pluginState !== null && pluginState !== void 0 && (_pluginState$requests = pluginState.requests) !== null && _pluginState$requests !== void 0 && _pluginState$requests.length) {
|
|
133
132
|
var resolvedRequest = pluginState.requests.find(function (req) {
|
|
134
133
|
return req.url === meta.url;
|
|
135
134
|
});
|
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.shouldReplaceLink = shouldReplaceLink;
|
|
7
|
-
var
|
|
7
|
+
var _normalizeUrl = require("@atlaskit/adf-schema/normalize-url");
|
|
8
8
|
var _paste = require("@atlaskit/editor-common/paste");
|
|
9
9
|
function shouldReplaceLink(node) {
|
|
10
10
|
var compareLinkText = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
|
|
@@ -20,13 +20,13 @@ function shouldReplaceLink(node) {
|
|
|
20
20
|
// ED-6041: compare normalised link text after linkfy from Markdown transformer
|
|
21
21
|
// instead, since it always decodes URL ('%20' -> ' ') on the link text
|
|
22
22
|
|
|
23
|
-
var normalisedHref = (0,
|
|
24
|
-
var normalizedLinkText = (0,
|
|
23
|
+
var normalisedHref = (0, _normalizeUrl.normalizeUrl)(_paste.md.normalizeLinkText(linkMark.attrs.href));
|
|
24
|
+
var normalizedLinkText = (0, _normalizeUrl.normalizeUrl)(_paste.md.normalizeLinkText(node.text || ''));
|
|
25
25
|
if (compareLinkText && normalisedHref !== normalizedLinkText) {
|
|
26
26
|
return false;
|
|
27
27
|
}
|
|
28
28
|
if (compareToUrl) {
|
|
29
|
-
var normalizedUrl = (0,
|
|
29
|
+
var normalizedUrl = (0, _normalizeUrl.normalizeUrl)(_paste.md.normalizeLinkText(compareToUrl));
|
|
30
30
|
if (normalizedUrl !== normalisedHref) {
|
|
31
31
|
return false;
|
|
32
32
|
}
|
|
@@ -8,7 +8,7 @@ exports.eventsFromTransaction = eventsFromTransaction;
|
|
|
8
8
|
exports.findChanged = void 0;
|
|
9
9
|
var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
|
|
10
10
|
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
11
|
-
var
|
|
11
|
+
var _linkMetaStep = require("@atlaskit/adf-schema/steps/link-meta-step");
|
|
12
12
|
var _customSteps = require("@atlaskit/custom-steps");
|
|
13
13
|
var _analytics = require("@atlaskit/editor-common/analytics");
|
|
14
14
|
var _card = require("@atlaskit/editor-common/card");
|
|
@@ -212,7 +212,7 @@ var UPDATE_ACTIONS = [_analytics.ACTION.CHANGED_TYPE, _analytics.ACTION.UPDATED]
|
|
|
212
212
|
*/
|
|
213
213
|
var isUpdateTr = function isUpdateTr(tr, isUndoOrRedo) {
|
|
214
214
|
return !!tr.steps.find(function (step) {
|
|
215
|
-
if (!(step instanceof
|
|
215
|
+
if (!(step instanceof _linkMetaStep.LinkMetaStep)) {
|
|
216
216
|
return false;
|
|
217
217
|
}
|
|
218
218
|
var _step$getMetadata = step.getMetadata(),
|
|
@@ -254,7 +254,7 @@ var isTransactionResolveReplace = function isTransactionResolveReplace(tr) {
|
|
|
254
254
|
*/
|
|
255
255
|
var isAutoConvertTr = function isAutoConvertTr(tr) {
|
|
256
256
|
return !!tr.steps.find(function (step) {
|
|
257
|
-
if (!(step instanceof
|
|
257
|
+
if (!(step instanceof _linkMetaStep.LinkMetaStep)) {
|
|
258
258
|
return false;
|
|
259
259
|
}
|
|
260
260
|
return step.getMetadata().cardAction === 'AUTO_CONVERT';
|
|
@@ -12,7 +12,7 @@ var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/ge
|
|
|
12
12
|
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
13
13
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
14
14
|
var _react = _interopRequireDefault(require("react"));
|
|
15
|
-
var
|
|
15
|
+
var _isSafeUrl = require("@atlaskit/adf-schema/is-safe-url");
|
|
16
16
|
var _linkDatasource = require("@atlaskit/link-datasource");
|
|
17
17
|
var _doc = require("../pm-plugins/doc");
|
|
18
18
|
function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2.default)(o), (0, _possibleConstructorReturn2.default)(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2.default)(t).constructor) : o.apply(t, e)); }
|
|
@@ -56,7 +56,7 @@ var DatasourceErrorBoundary = exports.DatasourceErrorBoundary = /*#__PURE__*/fun
|
|
|
56
56
|
datasourceModalType = _this$props.datasourceModalType,
|
|
57
57
|
datasourceId = _this$props.datasourceId;
|
|
58
58
|
if (this.state.isError) {
|
|
59
|
-
if (url && (0,
|
|
59
|
+
if (url && (0, _isSafeUrl.isSafeUrl)(url)) {
|
|
60
60
|
return /*#__PURE__*/_react.default.createElement(_linkDatasource.LazyLoadedDatasourceRenderFailedAnalyticsWrapper, {
|
|
61
61
|
datasourceId: datasourceId,
|
|
62
62
|
error: this.state.error
|
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports.isNativeEmbedNode = exports.isNativeEmbedAppearanceSupported = exports.getNativeEmbedUrl = exports.changeNativeEmbedAppearance = void 0;
|
|
8
8
|
var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
|
|
9
|
-
var
|
|
9
|
+
var _isSafeUrl = require("@atlaskit/adf-schema/is-safe-url");
|
|
10
10
|
var _analytics = require("@atlaskit/editor-common/analytics");
|
|
11
11
|
var _extensions = require("@atlaskit/editor-common/extensions");
|
|
12
12
|
/**
|
|
@@ -93,7 +93,7 @@ var changeNativeEmbedAppearance = exports.changeNativeEmbedAppearance = function
|
|
|
93
93
|
inlineCard = _state$schema$nodes.inlineCard,
|
|
94
94
|
blockCard = _state$schema$nodes.blockCard;
|
|
95
95
|
var link = state.schema.marks.link;
|
|
96
|
-
if (!(0,
|
|
96
|
+
if (!(0, _isSafeUrl.isSafeUrl)(url)) {
|
|
97
97
|
return false;
|
|
98
98
|
}
|
|
99
99
|
var content;
|
package/dist/cjs/ui/toolbar.js
CHANGED
|
@@ -9,7 +9,7 @@ exports.visitCardLinkAnalytics = exports.shouldRenderToolbarPulse = exports.remo
|
|
|
9
9
|
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
10
10
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
11
11
|
var _react = _interopRequireDefault(require("react"));
|
|
12
|
-
var
|
|
12
|
+
var _isSafeUrl = require("@atlaskit/adf-schema/is-safe-url");
|
|
13
13
|
var _analytics = require("@atlaskit/editor-common/analytics");
|
|
14
14
|
var _card = require("@atlaskit/editor-common/card");
|
|
15
15
|
var _link2 = require("@atlaskit/editor-common/link");
|
|
@@ -232,7 +232,7 @@ var generateToolbarItems = function generateToolbarItems(state, intl, providerFa
|
|
|
232
232
|
var _ref = (_pluginInjectionApi$a = pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : pluginInjectionApi.analytics) !== null && _pluginInjectionApi$a !== void 0 ? _pluginInjectionApi$a : {},
|
|
233
233
|
editorAnalyticsApi = _ref.actions;
|
|
234
234
|
var metadata = {};
|
|
235
|
-
if (url && !(0,
|
|
235
|
+
if (url && !(0, _isSafeUrl.isSafeUrl)(url)) {
|
|
236
236
|
return [];
|
|
237
237
|
} else {
|
|
238
238
|
var _displayInfoForCard = (0, _utils3.displayInfoForCard)(node, (0, _utils3.findCardInfo)(state)),
|
|
@@ -4,7 +4,7 @@ import React from 'react';
|
|
|
4
4
|
import rafSchedule from 'raf-schd';
|
|
5
5
|
// eslint-disable-next-line @atlaskit/platform/prefer-crypto-random-uuid -- Use crypto.randomUUID instead
|
|
6
6
|
import uuid from 'uuid/v4';
|
|
7
|
-
import { SetAttrsStep } from '@atlaskit/adf-schema/steps';
|
|
7
|
+
import { SetAttrsStep } from '@atlaskit/adf-schema/steps/set-attrs';
|
|
8
8
|
import { isConfluenceSlideUrl } from '@atlaskit/editor-card-provider/url-checkers';
|
|
9
9
|
import { useSharedPluginStateWithSelector } from '@atlaskit/editor-common/hooks';
|
|
10
10
|
import ReactNodeView from '@atlaskit/editor-common/react-node-view';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
3
3
|
import React, { useCallback } from 'react';
|
|
4
|
-
import { isSafeUrl } from '@atlaskit/adf-schema';
|
|
4
|
+
import { isSafeUrl } from '@atlaskit/adf-schema/is-safe-url';
|
|
5
5
|
import AnalyticsContext from '@atlaskit/analytics-next/AnalyticsContext';
|
|
6
6
|
import { useSharedPluginStateWithSelector } from '@atlaskit/editor-common/hooks';
|
|
7
7
|
import { getAnalyticsEditorAppearance } from '@atlaskit/editor-common/utils';
|
|
@@ -4,7 +4,6 @@ import { useSharedPluginStateWithSelector } from '@atlaskit/editor-common/hooks'
|
|
|
4
4
|
import { UnsupportedInline } from '@atlaskit/editor-common/ui';
|
|
5
5
|
import { SmartLinkDraggable, SMART_LINK_DRAG_TYPES, SMART_LINK_APPEARANCE } from '@atlaskit/editor-smart-link-draggable';
|
|
6
6
|
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
7
|
-
import { expVal } from '@atlaskit/tmp-editor-statsig/expVal';
|
|
8
7
|
import { getAwarenessProps } from '../pm-plugins/utils';
|
|
9
8
|
import { SmartCardSSRReactContextsProvider } from '../ui/SmartCardSSRReactContextsProvider';
|
|
10
9
|
import { Card } from './genericCard';
|
|
@@ -17,13 +16,6 @@ const selectorWithCard = states => {
|
|
|
17
16
|
resolvedInlineSmartLinks: (_states$cardState = states.cardState) === null || _states$cardState === void 0 ? void 0 : _states$cardState.resolvedInlineSmartLinks
|
|
18
17
|
};
|
|
19
18
|
};
|
|
20
|
-
const selectorWithoutCard = states => {
|
|
21
|
-
var _states$editorViewMod2;
|
|
22
|
-
return {
|
|
23
|
-
mode: (_states$editorViewMod2 = states.editorViewModeState) === null || _states$editorViewMod2 === void 0 ? void 0 : _states$editorViewMod2.mode,
|
|
24
|
-
resolvedInlineSmartLinks: undefined
|
|
25
|
-
};
|
|
26
|
-
};
|
|
27
19
|
|
|
28
20
|
/**
|
|
29
21
|
* Inline card node view component that renders a Smart Link inline card within the editor.
|
|
@@ -53,7 +45,7 @@ export function InlineCardNodeView(props) {
|
|
|
53
45
|
const {
|
|
54
46
|
mode,
|
|
55
47
|
resolvedInlineSmartLinks
|
|
56
|
-
} = useSharedPluginStateWithSelector(pluginInjectionApi,
|
|
48
|
+
} = useSharedPluginStateWithSelector(pluginInjectionApi, ['editorViewMode', 'card'], selectorWithCard);
|
|
57
49
|
const url = node.attrs.url;
|
|
58
50
|
const CompetitorPromptComponent = CompetitorPrompt && url ? /*#__PURE__*/React.createElement(CompetitorPrompt, {
|
|
59
51
|
sourceUrl: url,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { blockCard, blockCardWithLocalId } from '@atlaskit/adf-schema';
|
|
1
|
+
import { blockCard, blockCardWithLocalId } from '@atlaskit/adf-schema/block-card';
|
|
2
2
|
import { convertToInlineCss } from '@atlaskit/editor-common/lazy-node-view';
|
|
3
3
|
import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
4
4
|
// @nodeSpecException:toDOM patch
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* In the long term likely `toDOM` will move back out of `adf-schema` in which
|
|
9
9
|
* case we can consolidate them.
|
|
10
10
|
*/
|
|
11
|
-
import { embedCard, embedCardWithLocalId } from '@atlaskit/adf-schema';
|
|
11
|
+
import { embedCard, embedCardWithLocalId } from '@atlaskit/adf-schema/embed-card';
|
|
12
12
|
import { convertToInlineCss } from '@atlaskit/editor-common/lazy-node-view';
|
|
13
13
|
import { DEFAULT_EMBED_CARD_HEIGHT, DEFAULT_EMBED_CARD_WIDTH } from '@atlaskit/editor-shared-styles';
|
|
14
14
|
import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { inlineCard, inlineCardWithLocalId } from '@atlaskit/adf-schema';
|
|
1
|
+
import { inlineCard, inlineCardWithLocalId } from '@atlaskit/adf-schema/inline-card';
|
|
2
2
|
import { convertToInlineCss } from '@atlaskit/editor-common/lazy-node-view';
|
|
3
3
|
import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
4
4
|
// @nodeSpecException:toDOM patch
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import isEqual from 'lodash/isEqual';
|
|
2
|
-
import { isSafeUrl } from '@atlaskit/adf-schema';
|
|
2
|
+
import { isSafeUrl } from '@atlaskit/adf-schema/is-safe-url';
|
|
3
3
|
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE, INPUT_METHOD, SMART_LINK_TYPE, unlinkPayload } from '@atlaskit/editor-common/analytics';
|
|
4
4
|
import { addLinkMetadata } from '@atlaskit/editor-common/card';
|
|
5
5
|
import { getActiveLinkMark } from '@atlaskit/editor-common/link';
|
|
@@ -6,7 +6,6 @@ import { DATASOURCE_INNER_CONTAINER_CLASSNAME } from '@atlaskit/editor-common/st
|
|
|
6
6
|
import { NodeSelection } from '@atlaskit/editor-prosemirror/state';
|
|
7
7
|
import { findDomRefAtPos } from '@atlaskit/editor-prosemirror/utils';
|
|
8
8
|
import { DATASOURCE_DEFAULT_LAYOUT } from '@atlaskit/linking-common';
|
|
9
|
-
import { expVal } from '@atlaskit/tmp-editor-statsig/expVal';
|
|
10
9
|
import { InlineCardNodeView } from '../nodeviews/inlineCard';
|
|
11
10
|
import { lazyBlockCardView } from '../nodeviews/lazy-block-card';
|
|
12
11
|
import { lazyEmbedCardView } from '../nodeviews/lazy-embed-card';
|
|
@@ -120,7 +119,7 @@ export const createPlugin = (options, pluginInjectionApi) => pmPluginFactoryPara
|
|
|
120
119
|
const newState = reducer(pluginStateWithUpdatedPos, meta);
|
|
121
120
|
|
|
122
121
|
// Track the first resolved inline smart link for PO spotlight DOM targeting
|
|
123
|
-
if (meta.type === 'RESOLVE' && pluginState !== null && pluginState !== void 0 && (_pluginState$requests = pluginState.requests) !== null && _pluginState$requests !== void 0 && _pluginState$requests.length
|
|
122
|
+
if (meta.type === 'RESOLVE' && pluginState !== null && pluginState !== void 0 && (_pluginState$requests = pluginState.requests) !== null && _pluginState$requests !== void 0 && _pluginState$requests.length) {
|
|
124
123
|
const resolvedRequest = pluginState.requests.find(req => req.url === meta.url);
|
|
125
124
|
if ((resolvedRequest === null || resolvedRequest === void 0 ? void 0 : resolvedRequest.appearance) === 'inline') {
|
|
126
125
|
var _newState$resolvedInl, _newState$resolvedInl2;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { normalizeUrl } from '@atlaskit/adf-schema';
|
|
1
|
+
import { normalizeUrl } from '@atlaskit/adf-schema/normalize-url';
|
|
2
2
|
import { md } from '@atlaskit/editor-common/paste';
|
|
3
3
|
export function shouldReplaceLink(node, compareLinkText = true, compareToUrl) {
|
|
4
4
|
const linkMark = node.marks.find(mark => mark.type.name === 'link');
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { LinkMetaStep } from '@atlaskit/adf-schema/steps';
|
|
1
|
+
import { LinkMetaStep } from '@atlaskit/adf-schema/steps/link-meta-step';
|
|
2
2
|
import { TableSortStep } from '@atlaskit/custom-steps';
|
|
3
3
|
import { ACTION } from '@atlaskit/editor-common/analytics';
|
|
4
4
|
import { getLinkMetadataFromTransaction } from '@atlaskit/editor-common/card';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
2
|
/* eslint-disable @repo/internal/react/no-class-components */
|
|
3
3
|
import React from 'react';
|
|
4
|
-
import { isSafeUrl } from '@atlaskit/adf-schema';
|
|
4
|
+
import { isSafeUrl } from '@atlaskit/adf-schema/is-safe-url';
|
|
5
5
|
import { LazyLoadedDatasourceRenderFailedAnalyticsWrapper } from '@atlaskit/link-datasource';
|
|
6
6
|
import { setSelectedCardAppearance } from '../pm-plugins/doc';
|
|
7
7
|
export class DatasourceErrorBoundary extends React.Component {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { isSafeUrl } from '@atlaskit/adf-schema/url';
|
|
1
|
+
import { isSafeUrl } from '@atlaskit/adf-schema/is-safe-url';
|
|
2
2
|
import { ACTION, ACTION_SUBJECT, EVENT_TYPE } from '@atlaskit/editor-common/analytics';
|
|
3
3
|
import { NATIVE_EMBED_EXTENSION_KEY, NATIVE_EMBED_EXTENSION_TYPE } from '@atlaskit/editor-common/extensions';
|
|
4
4
|
/**
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { isSafeUrl } from '@atlaskit/adf-schema';
|
|
2
|
+
import { isSafeUrl } from '@atlaskit/adf-schema/is-safe-url';
|
|
3
3
|
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID as ACTION_SUBJECTID, EVENT_TYPE, INPUT_METHOD, buildOpenedSettingsPayload, buildVisitedNonHyperLinkPayload } from '@atlaskit/editor-common/analytics';
|
|
4
4
|
import { buildLayoutButtons, buildLayoutDropdown, commandWithMetadata } from '@atlaskit/editor-common/card';
|
|
5
5
|
import { getLinkPreferencesURLFromENV } from '@atlaskit/editor-common/link';
|
|
@@ -15,7 +15,7 @@ import React from 'react';
|
|
|
15
15
|
import rafSchedule from 'raf-schd';
|
|
16
16
|
// eslint-disable-next-line @atlaskit/platform/prefer-crypto-random-uuid -- Use crypto.randomUUID instead
|
|
17
17
|
import uuid from 'uuid/v4';
|
|
18
|
-
import { SetAttrsStep } from '@atlaskit/adf-schema/steps';
|
|
18
|
+
import { SetAttrsStep } from '@atlaskit/adf-schema/steps/set-attrs';
|
|
19
19
|
import { isConfluenceSlideUrl } from '@atlaskit/editor-card-provider/url-checkers';
|
|
20
20
|
import { useSharedPluginStateWithSelector } from '@atlaskit/editor-common/hooks';
|
|
21
21
|
import ReactNodeView from '@atlaskit/editor-common/react-node-view';
|
|
@@ -8,7 +8,7 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
|
8
8
|
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
9
9
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
10
10
|
import React, { useCallback } from 'react';
|
|
11
|
-
import { isSafeUrl } from '@atlaskit/adf-schema';
|
|
11
|
+
import { isSafeUrl } from '@atlaskit/adf-schema/is-safe-url';
|
|
12
12
|
import AnalyticsContext from '@atlaskit/analytics-next/AnalyticsContext';
|
|
13
13
|
import { useSharedPluginStateWithSelector } from '@atlaskit/editor-common/hooks';
|
|
14
14
|
import { getAnalyticsEditorAppearance } from '@atlaskit/editor-common/utils';
|
|
@@ -4,7 +4,6 @@ import { useSharedPluginStateWithSelector } from '@atlaskit/editor-common/hooks'
|
|
|
4
4
|
import { UnsupportedInline } from '@atlaskit/editor-common/ui';
|
|
5
5
|
import { SmartLinkDraggable, SMART_LINK_DRAG_TYPES, SMART_LINK_APPEARANCE } from '@atlaskit/editor-smart-link-draggable';
|
|
6
6
|
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
7
|
-
import { expVal } from '@atlaskit/tmp-editor-statsig/expVal';
|
|
8
7
|
import { getAwarenessProps } from '../pm-plugins/utils';
|
|
9
8
|
import { SmartCardSSRReactContextsProvider } from '../ui/SmartCardSSRReactContextsProvider';
|
|
10
9
|
import { Card } from './genericCard';
|
|
@@ -17,13 +16,6 @@ var selectorWithCard = function selectorWithCard(states) {
|
|
|
17
16
|
resolvedInlineSmartLinks: (_states$cardState = states.cardState) === null || _states$cardState === void 0 ? void 0 : _states$cardState.resolvedInlineSmartLinks
|
|
18
17
|
};
|
|
19
18
|
};
|
|
20
|
-
var selectorWithoutCard = function selectorWithoutCard(states) {
|
|
21
|
-
var _states$editorViewMod2;
|
|
22
|
-
return {
|
|
23
|
-
mode: (_states$editorViewMod2 = states.editorViewModeState) === null || _states$editorViewMod2 === void 0 ? void 0 : _states$editorViewMod2.mode,
|
|
24
|
-
resolvedInlineSmartLinks: undefined
|
|
25
|
-
};
|
|
26
|
-
};
|
|
27
19
|
|
|
28
20
|
/**
|
|
29
21
|
* Inline card node view component that renders a Smart Link inline card within the editor.
|
|
@@ -48,7 +40,7 @@ export function InlineCardNodeView(props) {
|
|
|
48
40
|
CompetitorPrompt = props.CompetitorPrompt,
|
|
49
41
|
intl = props.intl,
|
|
50
42
|
smartCardContext = props.smartCardContext;
|
|
51
|
-
var _useSharedPluginState = useSharedPluginStateWithSelector(pluginInjectionApi,
|
|
43
|
+
var _useSharedPluginState = useSharedPluginStateWithSelector(pluginInjectionApi, ['editorViewMode', 'card'], selectorWithCard),
|
|
52
44
|
mode = _useSharedPluginState.mode,
|
|
53
45
|
resolvedInlineSmartLinks = _useSharedPluginState.resolvedInlineSmartLinks;
|
|
54
46
|
var url = node.attrs.url;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
2
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3
3
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4
|
-
import { blockCard, blockCardWithLocalId } from '@atlaskit/adf-schema';
|
|
4
|
+
import { blockCard, blockCardWithLocalId } from '@atlaskit/adf-schema/block-card';
|
|
5
5
|
import { convertToInlineCss } from '@atlaskit/editor-common/lazy-node-view';
|
|
6
6
|
import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
7
7
|
// @nodeSpecException:toDOM patch
|
|
@@ -11,7 +11,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
11
11
|
* In the long term likely `toDOM` will move back out of `adf-schema` in which
|
|
12
12
|
* case we can consolidate them.
|
|
13
13
|
*/
|
|
14
|
-
import { embedCard, embedCardWithLocalId } from '@atlaskit/adf-schema';
|
|
14
|
+
import { embedCard, embedCardWithLocalId } from '@atlaskit/adf-schema/embed-card';
|
|
15
15
|
import { convertToInlineCss } from '@atlaskit/editor-common/lazy-node-view';
|
|
16
16
|
import { DEFAULT_EMBED_CARD_HEIGHT, DEFAULT_EMBED_CARD_WIDTH } from '@atlaskit/editor-shared-styles';
|
|
17
17
|
import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
2
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3
3
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4
|
-
import { inlineCard, inlineCardWithLocalId } from '@atlaskit/adf-schema';
|
|
4
|
+
import { inlineCard, inlineCardWithLocalId } from '@atlaskit/adf-schema/inline-card';
|
|
5
5
|
import { convertToInlineCss } from '@atlaskit/editor-common/lazy-node-view';
|
|
6
6
|
import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
7
7
|
// @nodeSpecException:toDOM patch
|
|
@@ -4,7 +4,7 @@ import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
|
4
4
|
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; }
|
|
5
5
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
6
6
|
import isEqual from 'lodash/isEqual';
|
|
7
|
-
import { isSafeUrl } from '@atlaskit/adf-schema';
|
|
7
|
+
import { isSafeUrl } from '@atlaskit/adf-schema/is-safe-url';
|
|
8
8
|
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE, INPUT_METHOD, SMART_LINK_TYPE, unlinkPayload } from '@atlaskit/editor-common/analytics';
|
|
9
9
|
import { addLinkMetadata } from '@atlaskit/editor-common/card';
|
|
10
10
|
import { getActiveLinkMark } from '@atlaskit/editor-common/link';
|
|
@@ -10,7 +10,6 @@ import { DATASOURCE_INNER_CONTAINER_CLASSNAME } from '@atlaskit/editor-common/st
|
|
|
10
10
|
import { NodeSelection } from '@atlaskit/editor-prosemirror/state';
|
|
11
11
|
import { findDomRefAtPos } from '@atlaskit/editor-prosemirror/utils';
|
|
12
12
|
import { DATASOURCE_DEFAULT_LAYOUT } from '@atlaskit/linking-common';
|
|
13
|
-
import { expVal } from '@atlaskit/tmp-editor-statsig/expVal';
|
|
14
13
|
import { InlineCardNodeView } from '../nodeviews/inlineCard';
|
|
15
14
|
import { lazyBlockCardView } from '../nodeviews/lazy-block-card';
|
|
16
15
|
import { lazyEmbedCardView } from '../nodeviews/lazy-embed-card';
|
|
@@ -122,7 +121,7 @@ export var createPlugin = function createPlugin(options, pluginInjectionApi) {
|
|
|
122
121
|
var newState = reducer(pluginStateWithUpdatedPos, meta);
|
|
123
122
|
|
|
124
123
|
// Track the first resolved inline smart link for PO spotlight DOM targeting
|
|
125
|
-
if (meta.type === 'RESOLVE' && pluginState !== null && pluginState !== void 0 && (_pluginState$requests = pluginState.requests) !== null && _pluginState$requests !== void 0 && _pluginState$requests.length
|
|
124
|
+
if (meta.type === 'RESOLVE' && pluginState !== null && pluginState !== void 0 && (_pluginState$requests = pluginState.requests) !== null && _pluginState$requests !== void 0 && _pluginState$requests.length) {
|
|
126
125
|
var resolvedRequest = pluginState.requests.find(function (req) {
|
|
127
126
|
return req.url === meta.url;
|
|
128
127
|
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { normalizeUrl } from '@atlaskit/adf-schema';
|
|
1
|
+
import { normalizeUrl } from '@atlaskit/adf-schema/normalize-url';
|
|
2
2
|
import { md } from '@atlaskit/editor-common/paste';
|
|
3
3
|
export function shouldReplaceLink(node) {
|
|
4
4
|
var compareLinkText = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _typeof from "@babel/runtime/helpers/typeof";
|
|
2
2
|
import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
3
|
-
import { LinkMetaStep } from '@atlaskit/adf-schema/steps';
|
|
3
|
+
import { LinkMetaStep } from '@atlaskit/adf-schema/steps/link-meta-step';
|
|
4
4
|
import { TableSortStep } from '@atlaskit/custom-steps';
|
|
5
5
|
import { ACTION } from '@atlaskit/editor-common/analytics';
|
|
6
6
|
import { getLinkMetadataFromTransaction } from '@atlaskit/editor-common/card';
|
|
@@ -8,7 +8,7 @@ function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstruct
|
|
|
8
8
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
9
9
|
/* eslint-disable @repo/internal/react/no-class-components */
|
|
10
10
|
import React from 'react';
|
|
11
|
-
import { isSafeUrl } from '@atlaskit/adf-schema';
|
|
11
|
+
import { isSafeUrl } from '@atlaskit/adf-schema/is-safe-url';
|
|
12
12
|
import { LazyLoadedDatasourceRenderFailedAnalyticsWrapper } from '@atlaskit/link-datasource';
|
|
13
13
|
import { setSelectedCardAppearance } from '../pm-plugins/doc';
|
|
14
14
|
export var DatasourceErrorBoundary = /*#__PURE__*/function (_React$Component) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import _typeof from "@babel/runtime/helpers/typeof";
|
|
2
|
-
import { isSafeUrl } from '@atlaskit/adf-schema/url';
|
|
2
|
+
import { isSafeUrl } from '@atlaskit/adf-schema/is-safe-url';
|
|
3
3
|
import { ACTION, ACTION_SUBJECT, EVENT_TYPE } from '@atlaskit/editor-common/analytics';
|
|
4
4
|
import { NATIVE_EMBED_EXTENSION_KEY, NATIVE_EMBED_EXTENSION_TYPE } from '@atlaskit/editor-common/extensions';
|
|
5
5
|
/**
|
package/dist/esm/ui/toolbar.js
CHANGED
|
@@ -3,7 +3,7 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
|
3
3
|
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; }
|
|
4
4
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
5
5
|
import React from 'react';
|
|
6
|
-
import { isSafeUrl } from '@atlaskit/adf-schema';
|
|
6
|
+
import { isSafeUrl } from '@atlaskit/adf-schema/is-safe-url';
|
|
7
7
|
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID as ACTION_SUBJECTID, EVENT_TYPE, INPUT_METHOD, buildOpenedSettingsPayload, buildVisitedNonHyperLinkPayload } from '@atlaskit/editor-common/analytics';
|
|
8
8
|
import { buildLayoutButtons, buildLayoutDropdown, commandWithMetadata } from '@atlaskit/editor-common/card';
|
|
9
9
|
import { getLinkPreferencesURLFromENV } from '@atlaskit/editor-common/link';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { ComponentProps } from 'react';
|
|
3
3
|
import type { IntlShape } from 'react-intl';
|
|
4
|
-
import type { RichMediaLayout } from '@atlaskit/adf-schema';
|
|
4
|
+
import type { Layout as RichMediaLayout } from '@atlaskit/adf-schema/rich-media-common';
|
|
5
5
|
import ReactNodeView from '@atlaskit/editor-common/react-node-view';
|
|
6
6
|
import type { ExtractInjectionAPI, PMPluginFactoryParams } from '@atlaskit/editor-common/types';
|
|
7
7
|
import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { RichMediaAttributes } from '@atlaskit/adf-schema';
|
|
1
|
+
import type { RichMediaAttributes } from '@atlaskit/adf-schema/rich-media-common';
|
|
2
2
|
import type UIAnalyticsEvent from '@atlaskit/analytics-next/UIAnalyticsEvent';
|
|
3
3
|
import type { ACTION } from '@atlaskit/editor-common/analytics';
|
|
4
4
|
import type { CardOptions, CardReplacementInputMethod, EmbedCardTransformers, OnClickCallback } from '@atlaskit/editor-common/card';
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import React from 'react';
|
|
6
6
|
import { jsx } from '@emotion/react';
|
|
7
|
-
import type { RichMediaLayout } from '@atlaskit/adf-schema';
|
|
7
|
+
import type { Layout as RichMediaLayout } from '@atlaskit/adf-schema/rich-media-common';
|
|
8
8
|
import type { ResizerProps } from '@atlaskit/editor-common/ui';
|
|
9
9
|
import type { ResolvedPos } from '@atlaskit/editor-prosemirror/model';
|
|
10
10
|
type State = {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-card",
|
|
3
|
-
"version": "22.1.
|
|
3
|
+
"version": "22.1.6",
|
|
4
4
|
"description": "Card plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
"@atlaskit/link": "^5.1.0",
|
|
53
53
|
"@atlaskit/link-analytics": "^12.3.0",
|
|
54
54
|
"@atlaskit/link-client-extension": "^7.3.0",
|
|
55
|
-
"@atlaskit/link-datasource": "^6.
|
|
55
|
+
"@atlaskit/link-datasource": "^6.10.0",
|
|
56
56
|
"@atlaskit/link-extractors": "^4.2.0",
|
|
57
57
|
"@atlaskit/linking-common": "^12.1.0",
|
|
58
58
|
"@atlaskit/linking-types": "^15.2.0",
|
|
@@ -63,7 +63,7 @@
|
|
|
63
63
|
"@atlaskit/primitives": "^22.5.0",
|
|
64
64
|
"@atlaskit/prosemirror-history": "^1.2.0",
|
|
65
65
|
"@atlaskit/smart-card": "^45.19.0",
|
|
66
|
-
"@atlaskit/tmp-editor-statsig": "^
|
|
66
|
+
"@atlaskit/tmp-editor-statsig": "^174.0.0",
|
|
67
67
|
"@atlaskit/tokens": "^16.11.0",
|
|
68
68
|
"@babel/runtime": "^7.0.0",
|
|
69
69
|
"@emotion/react": "^11.7.1",
|
|
@@ -73,7 +73,7 @@
|
|
|
73
73
|
"uuid": "^3.1.0"
|
|
74
74
|
},
|
|
75
75
|
"peerDependencies": {
|
|
76
|
-
"@atlaskit/editor-common": "^120.
|
|
76
|
+
"@atlaskit/editor-common": "^120.12.0",
|
|
77
77
|
"@atlaskit/link-provider": "^5.5.0",
|
|
78
78
|
"react": "^18.2.0 || ^19.2.0",
|
|
79
79
|
"react-intl": "^5.25.1 || ^6.0.0 || ^7.0.0"
|