@atlaskit/editor-plugin-selection-marker 2.1.1 → 2.2.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 CHANGED
@@ -1,5 +1,26 @@
1
1
  # @atlaskit/editor-plugin-selection-marker
2
2
 
3
+ ## 2.2.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#139139](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/139139)
8
+ [`7f6b665d778dd`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/7f6b665d778dd) -
9
+ [https://product-fabric.atlassian.net/browse/ED-27499](ED-27499) - the new
10
+ `@atlassian/confluence-presets` package with Confluence `full-page` preset is created
11
+
12
+ ### Patch Changes
13
+
14
+ - Updated dependencies
15
+
16
+ ## 2.1.2
17
+
18
+ ### Patch Changes
19
+
20
+ - [#137989](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/137989)
21
+ [`8a449b2a3d26a`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/8a449b2a3d26a) -
22
+ Fix hiding selection on advanced code blocks in safari.
23
+
3
24
  ## 2.1.1
4
25
 
5
26
  ### Patch Changes
@@ -5,6 +5,7 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.GlobalStylesWrapper = void 0;
7
7
  var _react = require("@emotion/react");
8
+ var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
8
9
  /**
9
10
  * @jsxRuntime classic
10
11
  * @jsx jsx
@@ -20,14 +21,35 @@ var _react = require("@emotion/react");
20
21
  * selection highlight will not show on those.
21
22
  * - We do not apply this reset when the editor is disabled
22
23
  */
23
- var globalStyles = (0, _react.css)({
24
+ var oldGlobalStyles = (0, _react.css)({
24
25
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
25
26
  '.ProseMirror:not(:focus):not([contenteditable="false"]) ::selection:not(input)': {
26
27
  background: 'unset'
27
28
  }
28
29
  });
30
+
31
+ /**
32
+ * Unset the selection background color as we are using our own
33
+ * Otherwise we might have a mix of grey + our selection marker depending on the state.
34
+ *
35
+ * Edge cases:
36
+ * - We do not apply this reset to input fields or code blocks (ie. expand case) because otherwise
37
+ * selection highlight will not show on those.
38
+ * - We do not apply this reset when the editor is disabled
39
+ */
40
+ var globalStyles = (0, _react.css)({
41
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
42
+ '.ProseMirror:not(:focus):not([contenteditable="false"]) ::selection:not(input, .cm-editor)': {
43
+ background: 'unset'
44
+ }
45
+ });
29
46
  var GlobalStylesWrapper = exports.GlobalStylesWrapper = function GlobalStylesWrapper() {
47
+ if ((0, _experiments.editorExperiment)('platform_editor_advanced_code_blocks', true)) {
48
+ return (0, _react.jsx)(_react.Global, {
49
+ styles: globalStyles
50
+ });
51
+ }
30
52
  return (0, _react.jsx)(_react.Global, {
31
- styles: globalStyles
53
+ styles: oldGlobalStyles
32
54
  });
33
55
  };
@@ -4,6 +4,7 @@
4
4
  */
5
5
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-global-styles, @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
6
6
  import { css, Global, jsx } from '@emotion/react';
7
+ import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
7
8
 
8
9
  /**
9
10
  * Unset the selection background color as we are using our own
@@ -14,14 +15,35 @@ import { css, Global, jsx } from '@emotion/react';
14
15
  * selection highlight will not show on those.
15
16
  * - We do not apply this reset when the editor is disabled
16
17
  */
17
- const globalStyles = css({
18
+ const oldGlobalStyles = css({
18
19
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
19
20
  '.ProseMirror:not(:focus):not([contenteditable="false"]) ::selection:not(input)': {
20
21
  background: 'unset'
21
22
  }
22
23
  });
24
+
25
+ /**
26
+ * Unset the selection background color as we are using our own
27
+ * Otherwise we might have a mix of grey + our selection marker depending on the state.
28
+ *
29
+ * Edge cases:
30
+ * - We do not apply this reset to input fields or code blocks (ie. expand case) because otherwise
31
+ * selection highlight will not show on those.
32
+ * - We do not apply this reset when the editor is disabled
33
+ */
34
+ const globalStyles = css({
35
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
36
+ '.ProseMirror:not(:focus):not([contenteditable="false"]) ::selection:not(input, .cm-editor)': {
37
+ background: 'unset'
38
+ }
39
+ });
23
40
  export const GlobalStylesWrapper = () => {
41
+ if (editorExperiment('platform_editor_advanced_code_blocks', true)) {
42
+ return jsx(Global, {
43
+ styles: globalStyles
44
+ });
45
+ }
24
46
  return jsx(Global, {
25
- styles: globalStyles
47
+ styles: oldGlobalStyles
26
48
  });
27
49
  };
@@ -4,6 +4,7 @@
4
4
  */
5
5
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-global-styles, @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
6
6
  import { css, Global, jsx } from '@emotion/react';
7
+ import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
7
8
 
8
9
  /**
9
10
  * Unset the selection background color as we are using our own
@@ -14,14 +15,35 @@ import { css, Global, jsx } from '@emotion/react';
14
15
  * selection highlight will not show on those.
15
16
  * - We do not apply this reset when the editor is disabled
16
17
  */
17
- var globalStyles = css({
18
+ var oldGlobalStyles = css({
18
19
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
19
20
  '.ProseMirror:not(:focus):not([contenteditable="false"]) ::selection:not(input)': {
20
21
  background: 'unset'
21
22
  }
22
23
  });
24
+
25
+ /**
26
+ * Unset the selection background color as we are using our own
27
+ * Otherwise we might have a mix of grey + our selection marker depending on the state.
28
+ *
29
+ * Edge cases:
30
+ * - We do not apply this reset to input fields or code blocks (ie. expand case) because otherwise
31
+ * selection highlight will not show on those.
32
+ * - We do not apply this reset when the editor is disabled
33
+ */
34
+ var globalStyles = css({
35
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
36
+ '.ProseMirror:not(:focus):not([contenteditable="false"]) ::selection:not(input, .cm-editor)': {
37
+ background: 'unset'
38
+ }
39
+ });
23
40
  export var GlobalStylesWrapper = function GlobalStylesWrapper() {
41
+ if (editorExperiment('platform_editor_advanced_code_blocks', true)) {
42
+ return jsx(Global, {
43
+ styles: globalStyles
44
+ });
45
+ }
24
46
  return jsx(Global, {
25
- styles: globalStyles
47
+ styles: oldGlobalStyles
26
48
  });
27
49
  };
@@ -1,2 +1,2 @@
1
1
  export { selectionMarkerPlugin } from './selectionMarkerPlugin';
2
- export type { SelectionMarkerPlugin, SelectionMarkerPluginConfiguration, ReleaseHiddenDecoration, } from './selectionMarkerPluginType';
2
+ export type { SelectionMarkerPlugin, SelectionMarkerPluginConfiguration, SelectionMarkerPluginOptions, ReleaseHiddenDecoration, } from './selectionMarkerPluginType';
@@ -5,16 +5,22 @@ import type { TypeAheadPlugin } from '@atlaskit/editor-plugin-type-ahead';
5
5
  export type ReleaseHiddenDecoration = () => boolean | undefined;
6
6
  type SetCleanup = (cb: ReleaseHiddenDecoration | undefined) => void;
7
7
  type CancelQueue = (() => void) | undefined;
8
- export type SelectionMarkerPluginConfiguration = {
8
+ export type SelectionMarkerPluginOptions = {
9
9
  hideCursorOnInit?: boolean;
10
10
  };
11
+ /**
12
+ * @private
13
+ * @deprecated Use {@link SelectionMarkerPluginOptions} instead.
14
+ * @see https://product-fabric.atlassian.net/browse/ED-27496
15
+ */
16
+ export type SelectionMarkerPluginConfiguration = SelectionMarkerPluginOptions;
11
17
  export type SelectionMarkerPlugin = NextEditorPlugin<'selectionMarker', {
12
18
  dependencies: [
13
19
  FocusPlugin,
14
20
  OptionalPlugin<TypeAheadPlugin>,
15
21
  OptionalPlugin<EditorDisabledPlugin>
16
22
  ];
17
- pluginConfiguration?: SelectionMarkerPluginConfiguration;
23
+ pluginConfiguration?: SelectionMarkerPluginOptions;
18
24
  sharedState: {
19
25
  isForcedHidden: boolean;
20
26
  isMarkerActive: boolean;
@@ -1,2 +1,2 @@
1
1
  export { selectionMarkerPlugin } from './selectionMarkerPlugin';
2
- export type { SelectionMarkerPlugin, SelectionMarkerPluginConfiguration, ReleaseHiddenDecoration, } from './selectionMarkerPluginType';
2
+ export type { SelectionMarkerPlugin, SelectionMarkerPluginConfiguration, SelectionMarkerPluginOptions, ReleaseHiddenDecoration, } from './selectionMarkerPluginType';
@@ -5,16 +5,22 @@ import type { TypeAheadPlugin } from '@atlaskit/editor-plugin-type-ahead';
5
5
  export type ReleaseHiddenDecoration = () => boolean | undefined;
6
6
  type SetCleanup = (cb: ReleaseHiddenDecoration | undefined) => void;
7
7
  type CancelQueue = (() => void) | undefined;
8
- export type SelectionMarkerPluginConfiguration = {
8
+ export type SelectionMarkerPluginOptions = {
9
9
  hideCursorOnInit?: boolean;
10
10
  };
11
+ /**
12
+ * @private
13
+ * @deprecated Use {@link SelectionMarkerPluginOptions} instead.
14
+ * @see https://product-fabric.atlassian.net/browse/ED-27496
15
+ */
16
+ export type SelectionMarkerPluginConfiguration = SelectionMarkerPluginOptions;
11
17
  export type SelectionMarkerPlugin = NextEditorPlugin<'selectionMarker', {
12
18
  dependencies: [
13
19
  FocusPlugin,
14
20
  OptionalPlugin<TypeAheadPlugin>,
15
21
  OptionalPlugin<EditorDisabledPlugin>
16
22
  ];
17
- pluginConfiguration?: SelectionMarkerPluginConfiguration;
23
+ pluginConfiguration?: SelectionMarkerPluginOptions;
18
24
  sharedState: {
19
25
  isForcedHidden: boolean;
20
26
  isMarkerActive: boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-selection-marker",
3
- "version": "2.1.1",
3
+ "version": "2.2.0",
4
4
  "description": "Selection marker plugin for @atlaskit/editor-core.",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -31,14 +31,15 @@
31
31
  ".": "./src/index.ts"
32
32
  },
33
33
  "dependencies": {
34
- "@atlaskit/editor-common": "^103.0.0",
34
+ "@atlaskit/editor-common": "^103.4.0",
35
35
  "@atlaskit/editor-plugin-editor-disabled": "^2.0.0",
36
36
  "@atlaskit/editor-plugin-focus": "^1.5.0",
37
37
  "@atlaskit/editor-plugin-type-ahead": "^2.3.0",
38
38
  "@atlaskit/editor-prosemirror": "7.0.0",
39
39
  "@atlaskit/platform-feature-flags": "^1.1.0",
40
- "@atlaskit/primitives": "^14.3.0",
40
+ "@atlaskit/primitives": "^14.4.0",
41
41
  "@atlaskit/theme": "^18.0.0",
42
+ "@atlaskit/tmp-editor-statsig": "^4.6.0",
42
43
  "@atlaskit/tokens": "^4.7.0",
43
44
  "@babel/runtime": "^7.0.0",
44
45
  "@emotion/react": "^11.7.1",