@atlaskit/editor-plugin-selection-marker 18.0.11 → 19.0.1
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 +14 -0
- package/dist/cjs/selectionMarkerPlugin.js +3 -5
- package/dist/cjs/ui/global-styles.js +1 -2
- package/dist/es2019/selectionMarkerPlugin.js +3 -5
- package/dist/es2019/ui/global-styles.js +1 -2
- package/dist/esm/selectionMarkerPlugin.js +3 -5
- package/dist/esm/ui/global-styles.js +1 -2
- package/package.json +11 -11
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-selection-marker
|
|
2
2
|
|
|
3
|
+
## 19.0.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`8d37dc7e55d62`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/8d37dc7e55d62) -
|
|
8
|
+
Clean up shipped experiment `platform_editor_block_menu`
|
|
9
|
+
- Updated dependencies
|
|
10
|
+
|
|
11
|
+
## 19.0.0
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- Updated dependencies
|
|
16
|
+
|
|
3
17
|
## 18.0.11
|
|
4
18
|
|
|
5
19
|
### Patch Changes
|
|
@@ -8,8 +8,6 @@ exports.selectionMarkerPlugin = void 0;
|
|
|
8
8
|
var _react = _interopRequireWildcard(require("react"));
|
|
9
9
|
var _hooks = require("@atlaskit/editor-common/hooks");
|
|
10
10
|
var _useSharedPluginStateSelector = require("@atlaskit/editor-common/use-shared-plugin-state-selector");
|
|
11
|
-
var _expValEqualsNoExposure = require("@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure");
|
|
12
|
-
var _editorExperiment = require("@atlaskit/tmp-editor-statsig/editor-experiment");
|
|
13
11
|
var _main = require("./pm-plugins/main");
|
|
14
12
|
var _globalStyles = require("./ui/global-styles");
|
|
15
13
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
@@ -87,7 +85,7 @@ var selectionMarkerPlugin = exports.selectionMarkerPlugin = function selectionMa
|
|
|
87
85
|
isOpen: (_states$typeAheadStat = states.typeAheadState) === null || _states$typeAheadStat === void 0 ? void 0 : _states$typeAheadStat.isOpen,
|
|
88
86
|
editorDisabled: (_states$editorDisable = states.editorDisabledState) === null || _states$editorDisable === void 0 ? void 0 : _states$editorDisable.editorDisabled,
|
|
89
87
|
showToolbar: (_states$toolbarState = states.toolbarState) === null || _states$toolbarState === void 0 ? void 0 : _states$toolbarState.shouldShowToolbar,
|
|
90
|
-
hasDangerDecorations: (
|
|
88
|
+
hasDangerDecorations: (_states$decorationsSt = states.decorationsState) === null || _states$decorationsSt === void 0 ? void 0 : _states$decorationsSt.hasDangerDecorations,
|
|
91
89
|
currentUserIntent: (_states$userIntentSta = states.userIntentState) === null || _states$userIntentSta === void 0 ? void 0 : _states$userIntentSta.currentUserIntent
|
|
92
90
|
};
|
|
93
91
|
}),
|
|
@@ -106,7 +104,7 @@ var selectionMarkerPlugin = exports.selectionMarkerPlugin = function selectionMa
|
|
|
106
104
|
if (hasFocus === true) {
|
|
107
105
|
editorHasNotBeenFocused.current = false;
|
|
108
106
|
}
|
|
109
|
-
var isBlockMenuOpen = currentUserIntent === 'blockMenuOpen'
|
|
107
|
+
var isBlockMenuOpen = currentUserIntent === 'blockMenuOpen';
|
|
110
108
|
|
|
111
109
|
/**
|
|
112
110
|
* There are a number of conditions we should not show the marker,
|
|
@@ -117,7 +115,7 @@ var selectionMarkerPlugin = exports.selectionMarkerPlugin = function selectionMa
|
|
|
117
115
|
* - Via the API: If another plugin has requested it to be hidden (force hidden).
|
|
118
116
|
* - If danger styles is shown in decorationsPlugin, then we don't need to show the selection marker
|
|
119
117
|
*/
|
|
120
|
-
var shouldHide = (config === null || config === void 0 ? void 0 : config.hideCursorOnInit) && editorHasNotBeenFocused.current || hasFocus || (isOpen !== null && isOpen !== void 0 ? isOpen : false) || isForcedHidden || (editorDisabled !== null && editorDisabled !== void 0 ? editorDisabled : false) || (showToolbar !== null && showToolbar !== void 0 ? showToolbar : false) || !!hasDangerDecorations
|
|
118
|
+
var shouldHide = (config === null || config === void 0 ? void 0 : config.hideCursorOnInit) && editorHasNotBeenFocused.current || hasFocus || (isOpen !== null && isOpen !== void 0 ? isOpen : false) || isForcedHidden || (editorDisabled !== null && editorDisabled !== void 0 ? editorDisabled : false) || (showToolbar !== null && showToolbar !== void 0 ? showToolbar : false) || !!hasDangerDecorations || isBlockMenuOpen;
|
|
121
119
|
requestAnimationFrame(function () {
|
|
122
120
|
return (0, _main.dispatchShouldHideDecorations)(editorView, shouldHide);
|
|
123
121
|
});
|
|
@@ -5,7 +5,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.GlobalStylesWrapper = void 0;
|
|
7
7
|
var _react = require("@emotion/react");
|
|
8
|
-
var _editorExperiment = require("@atlaskit/tmp-editor-statsig/editor-experiment");
|
|
9
8
|
/**
|
|
10
9
|
* @jsxRuntime classic
|
|
11
10
|
* @jsx jsx
|
|
@@ -37,6 +36,6 @@ var GlobalStylesWrapper = exports.GlobalStylesWrapper = function GlobalStylesWra
|
|
|
37
36
|
return (0, _react.jsx)(_react.Global
|
|
38
37
|
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
39
38
|
, {
|
|
40
|
-
styles: [globalStyles,
|
|
39
|
+
styles: [globalStyles, hideSelectionStyles]
|
|
41
40
|
});
|
|
42
41
|
};
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import React, { useEffect, useRef } from 'react';
|
|
2
2
|
import { useSharedPluginStateWithSelector } from '@atlaskit/editor-common/hooks';
|
|
3
3
|
import { useSharedPluginStateSelector } from '@atlaskit/editor-common/use-shared-plugin-state-selector';
|
|
4
|
-
import { expValEqualsNoExposure } from '@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure';
|
|
5
|
-
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/editor-experiment';
|
|
6
4
|
import { createPlugin, dispatchShouldHideDecorations, key } from './pm-plugins/main';
|
|
7
5
|
import { GlobalStylesWrapper } from './ui/global-styles';
|
|
8
6
|
export const selectionMarkerPlugin = ({
|
|
@@ -86,7 +84,7 @@ export const selectionMarkerPlugin = ({
|
|
|
86
84
|
isOpen: (_states$typeAheadStat = states.typeAheadState) === null || _states$typeAheadStat === void 0 ? void 0 : _states$typeAheadStat.isOpen,
|
|
87
85
|
editorDisabled: (_states$editorDisable = states.editorDisabledState) === null || _states$editorDisable === void 0 ? void 0 : _states$editorDisable.editorDisabled,
|
|
88
86
|
showToolbar: (_states$toolbarState = states.toolbarState) === null || _states$toolbarState === void 0 ? void 0 : _states$toolbarState.shouldShowToolbar,
|
|
89
|
-
hasDangerDecorations:
|
|
87
|
+
hasDangerDecorations: (_states$decorationsSt = states.decorationsState) === null || _states$decorationsSt === void 0 ? void 0 : _states$decorationsSt.hasDangerDecorations,
|
|
90
88
|
currentUserIntent: (_states$userIntentSta = states.userIntentState) === null || _states$userIntentSta === void 0 ? void 0 : _states$userIntentSta.currentUserIntent
|
|
91
89
|
};
|
|
92
90
|
});
|
|
@@ -99,7 +97,7 @@ export const selectionMarkerPlugin = ({
|
|
|
99
97
|
if (hasFocus === true) {
|
|
100
98
|
editorHasNotBeenFocused.current = false;
|
|
101
99
|
}
|
|
102
|
-
const isBlockMenuOpen = currentUserIntent === 'blockMenuOpen'
|
|
100
|
+
const isBlockMenuOpen = currentUserIntent === 'blockMenuOpen';
|
|
103
101
|
|
|
104
102
|
/**
|
|
105
103
|
* There are a number of conditions we should not show the marker,
|
|
@@ -110,7 +108,7 @@ export const selectionMarkerPlugin = ({
|
|
|
110
108
|
* - Via the API: If another plugin has requested it to be hidden (force hidden).
|
|
111
109
|
* - If danger styles is shown in decorationsPlugin, then we don't need to show the selection marker
|
|
112
110
|
*/
|
|
113
|
-
const shouldHide = (config === null || config === void 0 ? void 0 : config.hideCursorOnInit) && editorHasNotBeenFocused.current || hasFocus || (isOpen !== null && isOpen !== void 0 ? isOpen : false) || isForcedHidden || (editorDisabled !== null && editorDisabled !== void 0 ? editorDisabled : false) || (showToolbar !== null && showToolbar !== void 0 ? showToolbar : false) || !!hasDangerDecorations
|
|
111
|
+
const shouldHide = (config === null || config === void 0 ? void 0 : config.hideCursorOnInit) && editorHasNotBeenFocused.current || hasFocus || (isOpen !== null && isOpen !== void 0 ? isOpen : false) || isForcedHidden || (editorDisabled !== null && editorDisabled !== void 0 ? editorDisabled : false) || (showToolbar !== null && showToolbar !== void 0 ? showToolbar : false) || !!hasDangerDecorations || isBlockMenuOpen;
|
|
114
112
|
requestAnimationFrame(() => dispatchShouldHideDecorations(editorView, shouldHide));
|
|
115
113
|
}, [editorView, hasFocus, isOpen, isForcedHidden, editorDisabled, showToolbar, hasDangerDecorations, currentUserIntent]);
|
|
116
114
|
},
|
|
@@ -4,7 +4,6 @@
|
|
|
4
4
|
*/
|
|
5
5
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-global-styles, @atlaskit/ui-styling-standard/use-compiled, @typescript-eslint/consistent-type-imports
|
|
6
6
|
import { css, Global, jsx } from '@emotion/react';
|
|
7
|
-
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/editor-experiment';
|
|
8
7
|
|
|
9
8
|
/**
|
|
10
9
|
* Unset the selection background color as we are using our own
|
|
@@ -31,6 +30,6 @@ export const GlobalStylesWrapper = () => {
|
|
|
31
30
|
return jsx(Global
|
|
32
31
|
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
33
32
|
, {
|
|
34
|
-
styles: [globalStyles,
|
|
33
|
+
styles: [globalStyles, hideSelectionStyles]
|
|
35
34
|
});
|
|
36
35
|
};
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import React, { useEffect, useRef } from 'react';
|
|
2
2
|
import { useSharedPluginStateWithSelector } from '@atlaskit/editor-common/hooks';
|
|
3
3
|
import { useSharedPluginStateSelector } from '@atlaskit/editor-common/use-shared-plugin-state-selector';
|
|
4
|
-
import { expValEqualsNoExposure } from '@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure';
|
|
5
|
-
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/editor-experiment';
|
|
6
4
|
import { createPlugin, dispatchShouldHideDecorations, key } from './pm-plugins/main';
|
|
7
5
|
import { GlobalStylesWrapper } from './ui/global-styles';
|
|
8
6
|
export var selectionMarkerPlugin = function selectionMarkerPlugin(_ref) {
|
|
@@ -79,7 +77,7 @@ export var selectionMarkerPlugin = function selectionMarkerPlugin(_ref) {
|
|
|
79
77
|
isOpen: (_states$typeAheadStat = states.typeAheadState) === null || _states$typeAheadStat === void 0 ? void 0 : _states$typeAheadStat.isOpen,
|
|
80
78
|
editorDisabled: (_states$editorDisable = states.editorDisabledState) === null || _states$editorDisable === void 0 ? void 0 : _states$editorDisable.editorDisabled,
|
|
81
79
|
showToolbar: (_states$toolbarState = states.toolbarState) === null || _states$toolbarState === void 0 ? void 0 : _states$toolbarState.shouldShowToolbar,
|
|
82
|
-
hasDangerDecorations:
|
|
80
|
+
hasDangerDecorations: (_states$decorationsSt = states.decorationsState) === null || _states$decorationsSt === void 0 ? void 0 : _states$decorationsSt.hasDangerDecorations,
|
|
83
81
|
currentUserIntent: (_states$userIntentSta = states.userIntentState) === null || _states$userIntentSta === void 0 ? void 0 : _states$userIntentSta.currentUserIntent
|
|
84
82
|
};
|
|
85
83
|
}),
|
|
@@ -98,7 +96,7 @@ export var selectionMarkerPlugin = function selectionMarkerPlugin(_ref) {
|
|
|
98
96
|
if (hasFocus === true) {
|
|
99
97
|
editorHasNotBeenFocused.current = false;
|
|
100
98
|
}
|
|
101
|
-
var isBlockMenuOpen = currentUserIntent === 'blockMenuOpen'
|
|
99
|
+
var isBlockMenuOpen = currentUserIntent === 'blockMenuOpen';
|
|
102
100
|
|
|
103
101
|
/**
|
|
104
102
|
* There are a number of conditions we should not show the marker,
|
|
@@ -109,7 +107,7 @@ export var selectionMarkerPlugin = function selectionMarkerPlugin(_ref) {
|
|
|
109
107
|
* - Via the API: If another plugin has requested it to be hidden (force hidden).
|
|
110
108
|
* - If danger styles is shown in decorationsPlugin, then we don't need to show the selection marker
|
|
111
109
|
*/
|
|
112
|
-
var shouldHide = (config === null || config === void 0 ? void 0 : config.hideCursorOnInit) && editorHasNotBeenFocused.current || hasFocus || (isOpen !== null && isOpen !== void 0 ? isOpen : false) || isForcedHidden || (editorDisabled !== null && editorDisabled !== void 0 ? editorDisabled : false) || (showToolbar !== null && showToolbar !== void 0 ? showToolbar : false) || !!hasDangerDecorations
|
|
110
|
+
var shouldHide = (config === null || config === void 0 ? void 0 : config.hideCursorOnInit) && editorHasNotBeenFocused.current || hasFocus || (isOpen !== null && isOpen !== void 0 ? isOpen : false) || isForcedHidden || (editorDisabled !== null && editorDisabled !== void 0 ? editorDisabled : false) || (showToolbar !== null && showToolbar !== void 0 ? showToolbar : false) || !!hasDangerDecorations || isBlockMenuOpen;
|
|
113
111
|
requestAnimationFrame(function () {
|
|
114
112
|
return dispatchShouldHideDecorations(editorView, shouldHide);
|
|
115
113
|
});
|
|
@@ -4,7 +4,6 @@
|
|
|
4
4
|
*/
|
|
5
5
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-global-styles, @atlaskit/ui-styling-standard/use-compiled, @typescript-eslint/consistent-type-imports
|
|
6
6
|
import { css, Global, jsx } from '@emotion/react';
|
|
7
|
-
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/editor-experiment';
|
|
8
7
|
|
|
9
8
|
/**
|
|
10
9
|
* Unset the selection background color as we are using our own
|
|
@@ -31,6 +30,6 @@ export var GlobalStylesWrapper = function GlobalStylesWrapper() {
|
|
|
31
30
|
return jsx(Global
|
|
32
31
|
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
33
32
|
, {
|
|
34
|
-
styles: [globalStyles,
|
|
33
|
+
styles: [globalStyles, hideSelectionStyles]
|
|
35
34
|
});
|
|
36
35
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-selection-marker",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "19.0.1",
|
|
4
4
|
"description": "Selection marker plugin for @atlaskit/editor-core.",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -26,25 +26,25 @@
|
|
|
26
26
|
"atlaskit:src": "src/index.ts",
|
|
27
27
|
"dependencies": {
|
|
28
28
|
"@atlaskit/docs": "^12.2.0",
|
|
29
|
-
"@atlaskit/editor-plugin-decorations": "^
|
|
30
|
-
"@atlaskit/editor-plugin-editor-disabled": "^
|
|
31
|
-
"@atlaskit/editor-plugin-focus": "^
|
|
32
|
-
"@atlaskit/editor-plugin-toolbar": "^
|
|
33
|
-
"@atlaskit/editor-plugin-type-ahead": "^
|
|
34
|
-
"@atlaskit/editor-plugin-user-intent": "^
|
|
35
|
-
"@atlaskit/editor-prosemirror": "^
|
|
29
|
+
"@atlaskit/editor-plugin-decorations": "^19.0.0",
|
|
30
|
+
"@atlaskit/editor-plugin-editor-disabled": "^19.0.0",
|
|
31
|
+
"@atlaskit/editor-plugin-focus": "^18.0.0",
|
|
32
|
+
"@atlaskit/editor-plugin-toolbar": "^16.0.0",
|
|
33
|
+
"@atlaskit/editor-plugin-type-ahead": "^20.0.0",
|
|
34
|
+
"@atlaskit/editor-plugin-user-intent": "^17.0.0",
|
|
35
|
+
"@atlaskit/editor-prosemirror": "^9.0.0",
|
|
36
36
|
"@atlaskit/link": "^5.1.0",
|
|
37
37
|
"@atlaskit/platform-feature-flags": "^2.2.0",
|
|
38
38
|
"@atlaskit/section-message": "^10.2.0",
|
|
39
39
|
"@atlaskit/theme": "^28.2.0",
|
|
40
|
-
"@atlaskit/tmp-editor-statsig": "^
|
|
41
|
-
"@atlaskit/tokens": "^18.
|
|
40
|
+
"@atlaskit/tmp-editor-statsig": "^200.0.0",
|
|
41
|
+
"@atlaskit/tokens": "^18.2.0",
|
|
42
42
|
"@babel/runtime": "^7.0.0",
|
|
43
43
|
"@emotion/react": "^11.7.1",
|
|
44
44
|
"lodash": "^4.17.21"
|
|
45
45
|
},
|
|
46
46
|
"peerDependencies": {
|
|
47
|
-
"@atlaskit/editor-common": "^
|
|
47
|
+
"@atlaskit/editor-common": "^123.0.0",
|
|
48
48
|
"react": "^18.2.0 || ^19.2.0",
|
|
49
49
|
"react-dom": "^18.2.0 || ^19.2.0"
|
|
50
50
|
},
|