@atlaskit/editor-plugin-card 3.2.3 → 3.3.0
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 +8 -0
- package/dist/cjs/nodeviews/inlineCard.js +1 -1
- package/dist/cjs/utils.js +2 -1
- package/dist/es2019/nodeviews/inlineCard.js +1 -1
- package/dist/es2019/utils.js +2 -2
- package/dist/esm/nodeviews/inlineCard.js +1 -1
- package/dist/esm/utils.js +2 -1
- package/dist/types/utils.d.ts +1 -1
- package/dist/types-ts4.5/utils.d.ts +1 -1
- package/package.json +6 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-card
|
|
2
2
|
|
|
3
|
+
## 3.3.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#146630](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/146630)
|
|
8
|
+
[`eaf8a37e7f139`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/eaf8a37e7f139) -
|
|
9
|
+
[ux] Fix configure overlay appearing in live view editor contexts
|
|
10
|
+
|
|
3
11
|
## 3.2.3
|
|
4
12
|
|
|
5
13
|
### Patch Changes
|
|
@@ -161,5 +161,5 @@ function InlineCardNodeView(props) {
|
|
|
161
161
|
useAlternativePreloader: useAlternativePreloader,
|
|
162
162
|
pluginInjectionApi: pluginInjectionApi,
|
|
163
163
|
onClickCallback: onClickCallback
|
|
164
|
-
}, enableInlineUpgradeFeatures && (0, _utils.getAwarenessProps)(view.state, getPos, allowEmbeds, allowBlockCards)));
|
|
164
|
+
}, enableInlineUpgradeFeatures && (0, _utils.getAwarenessProps)(view.state, getPos, allowEmbeds, allowBlockCards, (0, _platformFeatureFlags.fg)('linking_platform_disable_live_view_inline_overlay') && (editorViewModeState === null || editorViewModeState === void 0 ? void 0 : editorViewModeState.mode) === 'view')));
|
|
165
165
|
}
|
package/dist/cjs/utils.js
CHANGED
|
@@ -131,6 +131,7 @@ var focusEditorView = exports.focusEditorView = function focusEditorView(editorV
|
|
|
131
131
|
};
|
|
132
132
|
var getAwarenessProps = exports.getAwarenessProps = function getAwarenessProps(editorState, getPos, allowEmbeds, allowBlockCards) {
|
|
133
133
|
var _editorState$selectio, _editorState$selectio2;
|
|
134
|
+
var disableOverlay = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
|
|
134
135
|
var getPosFunction = typeof getPos !== 'boolean' ? getPos : undefined;
|
|
135
136
|
var linkPosition = getPosFunction === null || getPosFunction === void 0 ? void 0 : getPosFunction();
|
|
136
137
|
var canBeUpgradedToEmbed = !!linkPosition && allowEmbeds ? isEmbedSupportedAtPosition(linkPosition, editorState, 'inline') : false;
|
|
@@ -138,7 +139,7 @@ var getAwarenessProps = exports.getAwarenessProps = function getAwarenessProps(e
|
|
|
138
139
|
var isSelected = editorState.selection instanceof _state.NodeSelection && ((_editorState$selectio = editorState.selection) === null || _editorState$selectio === void 0 || (_editorState$selectio = _editorState$selectio.node) === null || _editorState$selectio === void 0 ? void 0 : _editorState$selectio.type) === editorState.schema.nodes.inlineCard && ((_editorState$selectio2 = editorState.selection) === null || _editorState$selectio2 === void 0 ? void 0 : _editorState$selectio2.from) === (getPosFunction === null || getPosFunction === void 0 ? void 0 : getPosFunction());
|
|
139
140
|
return {
|
|
140
141
|
isPulseEnabled: canBeUpgradedToEmbed,
|
|
141
|
-
isOverlayEnabled: canBeUpgradedToEmbed || canBeUpgradedToBlock,
|
|
142
|
+
isOverlayEnabled: !disableOverlay && (canBeUpgradedToEmbed || canBeUpgradedToBlock),
|
|
142
143
|
isSelected: isSelected
|
|
143
144
|
};
|
|
144
145
|
};
|
|
@@ -151,5 +151,5 @@ export function InlineCardNodeView(props) {
|
|
|
151
151
|
useAlternativePreloader: useAlternativePreloader,
|
|
152
152
|
pluginInjectionApi: pluginInjectionApi,
|
|
153
153
|
onClickCallback: onClickCallback
|
|
154
|
-
}, enableInlineUpgradeFeatures && getAwarenessProps(view.state, getPos, allowEmbeds, allowBlockCards)));
|
|
154
|
+
}, enableInlineUpgradeFeatures && getAwarenessProps(view.state, getPos, allowEmbeds, allowBlockCards, fg('linking_platform_disable_live_view_inline_overlay') && (editorViewModeState === null || editorViewModeState === void 0 ? void 0 : editorViewModeState.mode) === 'view')));
|
|
155
155
|
}
|
package/dist/es2019/utils.js
CHANGED
|
@@ -115,7 +115,7 @@ export const focusEditorView = editorView => {
|
|
|
115
115
|
editorView.focus();
|
|
116
116
|
}
|
|
117
117
|
};
|
|
118
|
-
export const getAwarenessProps = (editorState, getPos, allowEmbeds, allowBlockCards) => {
|
|
118
|
+
export const getAwarenessProps = (editorState, getPos, allowEmbeds, allowBlockCards, disableOverlay = false) => {
|
|
119
119
|
var _editorState$selectio, _editorState$selectio2, _editorState$selectio3;
|
|
120
120
|
const getPosFunction = typeof getPos !== 'boolean' ? getPos : undefined;
|
|
121
121
|
const linkPosition = getPosFunction === null || getPosFunction === void 0 ? void 0 : getPosFunction();
|
|
@@ -124,7 +124,7 @@ export const getAwarenessProps = (editorState, getPos, allowEmbeds, allowBlockCa
|
|
|
124
124
|
const isSelected = editorState.selection instanceof NodeSelection && ((_editorState$selectio = editorState.selection) === null || _editorState$selectio === void 0 ? void 0 : (_editorState$selectio2 = _editorState$selectio.node) === null || _editorState$selectio2 === void 0 ? void 0 : _editorState$selectio2.type) === editorState.schema.nodes.inlineCard && ((_editorState$selectio3 = editorState.selection) === null || _editorState$selectio3 === void 0 ? void 0 : _editorState$selectio3.from) === (getPosFunction === null || getPosFunction === void 0 ? void 0 : getPosFunction());
|
|
125
125
|
return {
|
|
126
126
|
isPulseEnabled: canBeUpgradedToEmbed,
|
|
127
|
-
isOverlayEnabled: canBeUpgradedToEmbed || canBeUpgradedToBlock,
|
|
127
|
+
isOverlayEnabled: !disableOverlay && (canBeUpgradedToEmbed || canBeUpgradedToBlock),
|
|
128
128
|
isSelected
|
|
129
129
|
};
|
|
130
130
|
};
|
|
@@ -150,5 +150,5 @@ export function InlineCardNodeView(props) {
|
|
|
150
150
|
useAlternativePreloader: useAlternativePreloader,
|
|
151
151
|
pluginInjectionApi: pluginInjectionApi,
|
|
152
152
|
onClickCallback: onClickCallback
|
|
153
|
-
}, enableInlineUpgradeFeatures && getAwarenessProps(view.state, getPos, allowEmbeds, allowBlockCards)));
|
|
153
|
+
}, enableInlineUpgradeFeatures && getAwarenessProps(view.state, getPos, allowEmbeds, allowBlockCards, fg('linking_platform_disable_live_view_inline_overlay') && (editorViewModeState === null || editorViewModeState === void 0 ? void 0 : editorViewModeState.mode) === 'view')));
|
|
154
154
|
}
|
package/dist/esm/utils.js
CHANGED
|
@@ -124,6 +124,7 @@ export var focusEditorView = function focusEditorView(editorView) {
|
|
|
124
124
|
};
|
|
125
125
|
export var getAwarenessProps = function getAwarenessProps(editorState, getPos, allowEmbeds, allowBlockCards) {
|
|
126
126
|
var _editorState$selectio, _editorState$selectio2;
|
|
127
|
+
var disableOverlay = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
|
|
127
128
|
var getPosFunction = typeof getPos !== 'boolean' ? getPos : undefined;
|
|
128
129
|
var linkPosition = getPosFunction === null || getPosFunction === void 0 ? void 0 : getPosFunction();
|
|
129
130
|
var canBeUpgradedToEmbed = !!linkPosition && allowEmbeds ? isEmbedSupportedAtPosition(linkPosition, editorState, 'inline') : false;
|
|
@@ -131,7 +132,7 @@ export var getAwarenessProps = function getAwarenessProps(editorState, getPos, a
|
|
|
131
132
|
var isSelected = editorState.selection instanceof NodeSelection && ((_editorState$selectio = editorState.selection) === null || _editorState$selectio === void 0 || (_editorState$selectio = _editorState$selectio.node) === null || _editorState$selectio === void 0 ? void 0 : _editorState$selectio.type) === editorState.schema.nodes.inlineCard && ((_editorState$selectio2 = editorState.selection) === null || _editorState$selectio2 === void 0 ? void 0 : _editorState$selectio2.from) === (getPosFunction === null || getPosFunction === void 0 ? void 0 : getPosFunction());
|
|
132
133
|
return {
|
|
133
134
|
isPulseEnabled: canBeUpgradedToEmbed,
|
|
134
|
-
isOverlayEnabled: canBeUpgradedToEmbed || canBeUpgradedToBlock,
|
|
135
|
+
isOverlayEnabled: !disableOverlay && (canBeUpgradedToEmbed || canBeUpgradedToBlock),
|
|
135
136
|
isSelected: isSelected
|
|
136
137
|
};
|
|
137
138
|
};
|
package/dist/types/utils.d.ts
CHANGED
|
@@ -44,7 +44,7 @@ export declare const isDatasourceNode: (node?: Node) => node is DatasourceNode;
|
|
|
44
44
|
* @param editorView The editor view to focus.
|
|
45
45
|
*/
|
|
46
46
|
export declare const focusEditorView: (editorView: EditorView) => void;
|
|
47
|
-
export declare const getAwarenessProps: (editorState: EditorState, getPos: getPosHandler, allowEmbeds?: boolean, allowBlockCards?: boolean) => {
|
|
47
|
+
export declare const getAwarenessProps: (editorState: EditorState, getPos: getPosHandler, allowEmbeds?: boolean, allowBlockCards?: boolean, disableOverlay?: boolean) => {
|
|
48
48
|
isPulseEnabled: boolean;
|
|
49
49
|
isOverlayEnabled: boolean;
|
|
50
50
|
isSelected: boolean;
|
|
@@ -44,7 +44,7 @@ export declare const isDatasourceNode: (node?: Node) => node is DatasourceNode;
|
|
|
44
44
|
* @param editorView The editor view to focus.
|
|
45
45
|
*/
|
|
46
46
|
export declare const focusEditorView: (editorView: EditorView) => void;
|
|
47
|
-
export declare const getAwarenessProps: (editorState: EditorState, getPos: getPosHandler, allowEmbeds?: boolean, allowBlockCards?: boolean) => {
|
|
47
|
+
export declare const getAwarenessProps: (editorState: EditorState, getPos: getPosHandler, allowEmbeds?: boolean, allowBlockCards?: boolean, disableOverlay?: boolean) => {
|
|
48
48
|
isPulseEnabled: boolean;
|
|
49
49
|
isOverlayEnabled: boolean;
|
|
50
50
|
isSelected: boolean;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-card",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.3.0",
|
|
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": "^40.9.0",
|
|
35
35
|
"@atlaskit/analytics-next": "^10.1.0",
|
|
36
36
|
"@atlaskit/custom-steps": "^0.7.0",
|
|
37
|
-
"@atlaskit/editor-common": "^91.
|
|
37
|
+
"@atlaskit/editor-common": "^91.2.0",
|
|
38
38
|
"@atlaskit/editor-plugin-analytics": "^1.8.0",
|
|
39
39
|
"@atlaskit/editor-plugin-decorations": "^1.3.0",
|
|
40
40
|
"@atlaskit/editor-plugin-editor-disabled": "^1.3.0",
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
"@atlaskit/editor-prosemirror": "6.0.0",
|
|
47
47
|
"@atlaskit/editor-shared-styles": "^3.0.0",
|
|
48
48
|
"@atlaskit/frontend-utilities": "^2.7.0",
|
|
49
|
-
"@atlaskit/icon": "^22.
|
|
49
|
+
"@atlaskit/icon": "^22.19.0",
|
|
50
50
|
"@atlaskit/link-analytics": "^8.5.0",
|
|
51
51
|
"@atlaskit/link-client-extension": "^2.4.0",
|
|
52
52
|
"@atlaskit/link-datasource": "^3.1.0",
|
|
@@ -140,6 +140,9 @@
|
|
|
140
140
|
},
|
|
141
141
|
"platform_linking_enable_transaction_filtering": {
|
|
142
142
|
"type": "boolean"
|
|
143
|
+
},
|
|
144
|
+
"linking_platform_disable_live_view_inline_overlay": {
|
|
145
|
+
"type": "boolean"
|
|
143
146
|
}
|
|
144
147
|
},
|
|
145
148
|
"stricter": {
|