@atlaskit/editor-plugin-card 1.14.1 → 1.14.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
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-card
|
|
2
2
|
|
|
3
|
+
## 1.14.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#99680](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/99680)
|
|
8
|
+
[`538e71f42af4`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/538e71f42af4) -
|
|
9
|
+
Add code behind an FF to control what events are sent to prose mirror based on classnames, in
|
|
10
|
+
orderto control toolbar and selection behaviour for smart links in live pages.
|
|
11
|
+
- Updated dependencies
|
|
12
|
+
|
|
3
13
|
## 1.14.1
|
|
4
14
|
|
|
5
15
|
### Patch Changes
|
|
@@ -4,13 +4,14 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
|
-
exports.createPlugin = void 0;
|
|
7
|
+
exports.createPlugin = exports.ALLOW_EVENTS_CLASSNAME = void 0;
|
|
8
8
|
Object.defineProperty(exports, "pluginKey", {
|
|
9
9
|
enumerable: true,
|
|
10
10
|
get: function get() {
|
|
11
11
|
return _pluginKey.pluginKey;
|
|
12
12
|
}
|
|
13
13
|
});
|
|
14
|
+
exports.stopEvent = void 0;
|
|
14
15
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
15
16
|
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
16
17
|
var _rafSchd = _interopRequireDefault(require("raf-schd"));
|
|
@@ -37,6 +38,19 @@ var _state2 = require("./util/state");
|
|
|
37
38
|
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; }
|
|
38
39
|
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; }
|
|
39
40
|
var LOCAL_STORAGE_DISCOVERY_KEY_SMART_LINK = 'smart-link-upgrade-pulse';
|
|
41
|
+
var ALLOW_EVENTS_CLASSNAME = exports.ALLOW_EVENTS_CLASSNAME = 'card-plugin-element-allow-events';
|
|
42
|
+
var stopEvent = exports.stopEvent = function stopEvent(event) {
|
|
43
|
+
if (!(0, _platformFeatureFlags.getBooleanFF)('platform.linking-platform.smart-links-in-live-pages')) {
|
|
44
|
+
return false;
|
|
45
|
+
}
|
|
46
|
+
var target = event.target;
|
|
47
|
+
// Stop events from propogating to prose-mirror and selecting the node and/or
|
|
48
|
+
// opening the toolbar, unless a parent of the target has a defined className
|
|
49
|
+
if (target instanceof HTMLElement && target.closest(".".concat(ALLOW_EVENTS_CLASSNAME))) {
|
|
50
|
+
return false;
|
|
51
|
+
}
|
|
52
|
+
return true;
|
|
53
|
+
};
|
|
40
54
|
var handleAwarenessOverlay = function handleAwarenessOverlay(view) {
|
|
41
55
|
var currentState = (0, _state2.getPluginState)(view.state);
|
|
42
56
|
var overlayCandidatePos = currentState === null || currentState === void 0 ? void 0 : currentState.overlayCandidatePosition;
|
|
@@ -75,6 +89,9 @@ var createPlugin = exports.createPlugin = function createPlugin(options, pluginI
|
|
|
75
89
|
allowBlockCards: allowBlockCards,
|
|
76
90
|
pluginInjectionApi: pluginInjectionApi,
|
|
77
91
|
onClickCallback: onClickCallback
|
|
92
|
+
},
|
|
93
|
+
extraNodeViewProps: {
|
|
94
|
+
stopEvent: stopEvent
|
|
78
95
|
}
|
|
79
96
|
});
|
|
80
97
|
return new _safePlugin.SafePlugin({
|
|
@@ -21,6 +21,19 @@ import { handleProvider, resolveWithProvider } from './util/resolve';
|
|
|
21
21
|
import { getNewRequests, getPluginState, getPluginStateWithUpdatedPos } from './util/state';
|
|
22
22
|
export { pluginKey } from './plugin-key';
|
|
23
23
|
const LOCAL_STORAGE_DISCOVERY_KEY_SMART_LINK = 'smart-link-upgrade-pulse';
|
|
24
|
+
export const ALLOW_EVENTS_CLASSNAME = 'card-plugin-element-allow-events';
|
|
25
|
+
export const stopEvent = event => {
|
|
26
|
+
if (!getBooleanFF('platform.linking-platform.smart-links-in-live-pages')) {
|
|
27
|
+
return false;
|
|
28
|
+
}
|
|
29
|
+
const target = event.target;
|
|
30
|
+
// Stop events from propogating to prose-mirror and selecting the node and/or
|
|
31
|
+
// opening the toolbar, unless a parent of the target has a defined className
|
|
32
|
+
if (target instanceof HTMLElement && target.closest(`.${ALLOW_EVENTS_CLASSNAME}`)) {
|
|
33
|
+
return false;
|
|
34
|
+
}
|
|
35
|
+
return true;
|
|
36
|
+
};
|
|
24
37
|
const handleAwarenessOverlay = view => {
|
|
25
38
|
const currentState = getPluginState(view.state);
|
|
26
39
|
const overlayCandidatePos = currentState === null || currentState === void 0 ? void 0 : currentState.overlayCandidatePosition;
|
|
@@ -60,6 +73,9 @@ export const createPlugin = (options, pluginInjectionApi) => pmPluginFactoryPara
|
|
|
60
73
|
allowBlockCards,
|
|
61
74
|
pluginInjectionApi,
|
|
62
75
|
onClickCallback
|
|
76
|
+
},
|
|
77
|
+
extraNodeViewProps: {
|
|
78
|
+
stopEvent
|
|
63
79
|
}
|
|
64
80
|
});
|
|
65
81
|
return new SafePlugin({
|
|
@@ -25,6 +25,19 @@ import { handleProvider, resolveWithProvider } from './util/resolve';
|
|
|
25
25
|
import { getNewRequests, getPluginState, getPluginStateWithUpdatedPos } from './util/state';
|
|
26
26
|
export { pluginKey } from './plugin-key';
|
|
27
27
|
var LOCAL_STORAGE_DISCOVERY_KEY_SMART_LINK = 'smart-link-upgrade-pulse';
|
|
28
|
+
export var ALLOW_EVENTS_CLASSNAME = 'card-plugin-element-allow-events';
|
|
29
|
+
export var stopEvent = function stopEvent(event) {
|
|
30
|
+
if (!getBooleanFF('platform.linking-platform.smart-links-in-live-pages')) {
|
|
31
|
+
return false;
|
|
32
|
+
}
|
|
33
|
+
var target = event.target;
|
|
34
|
+
// Stop events from propogating to prose-mirror and selecting the node and/or
|
|
35
|
+
// opening the toolbar, unless a parent of the target has a defined className
|
|
36
|
+
if (target instanceof HTMLElement && target.closest(".".concat(ALLOW_EVENTS_CLASSNAME))) {
|
|
37
|
+
return false;
|
|
38
|
+
}
|
|
39
|
+
return true;
|
|
40
|
+
};
|
|
28
41
|
var handleAwarenessOverlay = function handleAwarenessOverlay(view) {
|
|
29
42
|
var currentState = getPluginState(view.state);
|
|
30
43
|
var overlayCandidatePos = currentState === null || currentState === void 0 ? void 0 : currentState.overlayCandidatePosition;
|
|
@@ -63,6 +76,9 @@ export var createPlugin = function createPlugin(options, pluginInjectionApi) {
|
|
|
63
76
|
allowBlockCards: allowBlockCards,
|
|
64
77
|
pluginInjectionApi: pluginInjectionApi,
|
|
65
78
|
onClickCallback: onClickCallback
|
|
79
|
+
},
|
|
80
|
+
extraNodeViewProps: {
|
|
81
|
+
stopEvent: stopEvent
|
|
66
82
|
}
|
|
67
83
|
});
|
|
68
84
|
return new SafePlugin({
|
|
@@ -3,4 +3,6 @@ import type { ExtractInjectionAPI, PMPluginFactoryParams } from '@atlaskit/edito
|
|
|
3
3
|
import type { cardPlugin } from '../index';
|
|
4
4
|
import type { CardPluginOptions, CardPluginState } from '../types';
|
|
5
5
|
export { pluginKey } from './plugin-key';
|
|
6
|
+
export declare const ALLOW_EVENTS_CLASSNAME = "card-plugin-element-allow-events";
|
|
7
|
+
export declare const stopEvent: (event: Event) => boolean;
|
|
6
8
|
export declare const createPlugin: (options: CardPluginOptions, pluginInjectionApi: ExtractInjectionAPI<typeof cardPlugin> | undefined) => (pmPluginFactoryParams: PMPluginFactoryParams) => SafePlugin<CardPluginState>;
|
|
@@ -3,4 +3,6 @@ import type { ExtractInjectionAPI, PMPluginFactoryParams } from '@atlaskit/edito
|
|
|
3
3
|
import type { cardPlugin } from '../index';
|
|
4
4
|
import type { CardPluginOptions, CardPluginState } from '../types';
|
|
5
5
|
export { pluginKey } from './plugin-key';
|
|
6
|
+
export declare const ALLOW_EVENTS_CLASSNAME = "card-plugin-element-allow-events";
|
|
7
|
+
export declare const stopEvent: (event: Event) => boolean;
|
|
6
8
|
export declare const createPlugin: (options: CardPluginOptions, pluginInjectionApi: ExtractInjectionAPI<typeof cardPlugin> | undefined) => (pmPluginFactoryParams: PMPluginFactoryParams) => SafePlugin<CardPluginState>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-card",
|
|
3
|
-
"version": "1.14.
|
|
3
|
+
"version": "1.14.2",
|
|
4
4
|
"description": "Card plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"@atlaskit/adf-schema": "^36.8.0",
|
|
36
36
|
"@atlaskit/analytics-next": "^9.3.0",
|
|
37
37
|
"@atlaskit/custom-steps": "^0.2.0",
|
|
38
|
-
"@atlaskit/editor-common": "^80.
|
|
38
|
+
"@atlaskit/editor-common": "^80.5.0",
|
|
39
39
|
"@atlaskit/editor-plugin-analytics": "^1.2.0",
|
|
40
40
|
"@atlaskit/editor-plugin-decorations": "^1.1.0",
|
|
41
41
|
"@atlaskit/editor-plugin-editor-viewmode": "^1.1.0",
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
"@atlaskit/link-client-extension": "^1.8.0",
|
|
53
53
|
"@atlaskit/link-datasource": "^2.3.0",
|
|
54
54
|
"@atlaskit/linking-common": "^5.7.0",
|
|
55
|
-
"@atlaskit/linking-types": "^8.
|
|
55
|
+
"@atlaskit/linking-types": "^8.9.0",
|
|
56
56
|
"@atlaskit/platform-feature-flags": "^0.2.0",
|
|
57
57
|
"@atlaskit/primitives": "^6.3.0",
|
|
58
58
|
"@atlaskit/smart-card": "^26.69.0",
|