@atlaskit/editor-plugin-placeholder 8.1.23 → 9.0.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,39 @@
1
1
  # @atlaskit/editor-plugin-placeholder
2
2
 
3
+ ## 9.0.0
4
+
5
+ ### Patch Changes
6
+
7
+ - [`b10c935ca9497`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/b10c935ca9497) -
8
+ Removed deprecated `browser` singleton from editor-common. This has been replaced with a
9
+ `getBrowserInfo` function that returns the same information. This change was made to avoid issues
10
+ with module loading order and to provide a more consistent API for accessing browser information.
11
+
12
+ Please update any imports of `browser` to use `getBrowserInfo` instead. For example, the following
13
+ imports have been removed:
14
+
15
+ ```javascript
16
+ import { browser } from '@atlaskit/editor-common/utils';
17
+ import { browser } from '@atlaskit/editor-common/browser';
18
+ ```
19
+
20
+ Instead, please use:
21
+
22
+ ```javascript
23
+ import { getBrowserInfo } from '@atlaskit/editor-common/browser';
24
+ ```
25
+
26
+ If you were previously using `browser.ie_version`, you would now use
27
+ `getBrowserInfo().ie_version`.
28
+
29
+ - Updated dependencies
30
+
31
+ ## 8.1.24
32
+
33
+ ### Patch Changes
34
+
35
+ - Updated dependencies
36
+
3
37
  ## 8.1.23
4
38
 
5
39
  ### Patch Changes
@@ -4,6 +4,7 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.createPlaceholderDecoration = createPlaceholderDecoration;
7
+ var _browser = require("@atlaskit/editor-common/browser");
7
8
  var _processRawValue = require("@atlaskit/editor-common/process-raw-value");
8
9
  var _utils = require("@atlaskit/editor-common/utils");
9
10
  var _model = require("@atlaskit/editor-prosemirror/model");
@@ -16,6 +17,7 @@ function createPlaceholderDecoration(editorState, placeholderText, placeholderPr
16
17
  var initialDelayWhenUserTypedAndDeleted = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : 0;
17
18
  var placeholderADF = arguments.length > 6 ? arguments[6] : undefined;
18
19
  var showOnEmptyParagraph = arguments.length > 7 ? arguments[7] : undefined;
20
+ var browser = (0, _browser.getBrowserInfo)();
19
21
  var placeholderDecoration = document.createElement('span');
20
22
  var placeholderNodeWithText = placeholderDecoration;
21
23
  placeholderDecoration.setAttribute('data-testid', _constants.placeholderTestId);
@@ -25,7 +27,7 @@ function createPlaceholderDecoration(editorState, placeholderText, placeholderPr
25
27
 
26
28
  // PM sets contenteditable to false on Decorations so Firefox doesn't display the flashing cursor
27
29
  // So adding an extra span which will contain the placeholder text
28
- if (_utils.browser.gecko) {
30
+ if (browser.gecko) {
29
31
  var placeholderNode = document.createElement('span');
30
32
  placeholderNode.setAttribute('contenteditable', 'true'); // explicitly overriding the default Decoration behaviour
31
33
  placeholderDecoration.appendChild(placeholderNode);
@@ -77,7 +79,7 @@ function createPlaceholderDecoration(editorState, placeholderText, placeholderPr
77
79
  // ME-2289 Tapping on backspace in empty editor hides and displays the keyboard
78
80
  // Add a editable buff node as the cursor moving forward is inevitable
79
81
  // when backspace in GBoard composition
80
- if (_utils.browser.android && _utils.browser.chrome) {
82
+ if (browser.android && browser.chrome) {
81
83
  var buffNode = document.createElement('span');
82
84
  buffNode.setAttribute('class', 'placeholder-android');
83
85
  buffNode.setAttribute('contenteditable', 'true');
@@ -91,7 +93,7 @@ function createPlaceholderDecoration(editorState, placeholderText, placeholderPr
91
93
  if (isTargetNested && (0, _experiments.editorExperiment)('platform_editor_controls', 'variant1')) {
92
94
  placeholderDecoration.classList.add('placeholder-decoration-hide-overflow');
93
95
  }
94
- if (placeholderADF && _utils.browser.chrome) {
96
+ if (placeholderADF && browser.chrome) {
95
97
  var fragment = document.createDocumentFragment();
96
98
  // An issue occurs with the caret where it gets bigger when it's next to a non-editable element like a decoration.
97
99
  // See: https://discuss.prosemirror.net/t/chrome-caret-cursor-larger-than-the-text-with-inlined-items/5946/2
@@ -1,11 +1,13 @@
1
+ import { getBrowserInfo } from '@atlaskit/editor-common/browser';
1
2
  import { processRawValue } from '@atlaskit/editor-common/process-raw-value';
2
- import { browser, ZERO_WIDTH_SPACE } from '@atlaskit/editor-common/utils';
3
+ import { ZERO_WIDTH_SPACE } from '@atlaskit/editor-common/utils';
3
4
  import { DOMSerializer } from '@atlaskit/editor-prosemirror/model';
4
5
  import { Decoration, DecorationSet } from '@atlaskit/editor-prosemirror/view';
5
6
  import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
6
7
  import { cycleThroughPlaceholderPrompts } from './animation';
7
8
  import { placeholderTestId } from './constants';
8
9
  export function createPlaceholderDecoration(editorState, placeholderText, placeholderPrompts, activeTypewriterTimeouts, pos = 1, initialDelayWhenUserTypedAndDeleted = 0, placeholderADF, showOnEmptyParagraph) {
10
+ const browser = getBrowserInfo();
9
11
  const placeholderDecoration = document.createElement('span');
10
12
  let placeholderNodeWithText = placeholderDecoration;
11
13
  placeholderDecoration.setAttribute('data-testid', placeholderTestId);
@@ -1,5 +1,6 @@
1
+ import { getBrowserInfo } from '@atlaskit/editor-common/browser';
1
2
  import { processRawValue } from '@atlaskit/editor-common/process-raw-value';
2
- import { browser, ZERO_WIDTH_SPACE } from '@atlaskit/editor-common/utils';
3
+ import { ZERO_WIDTH_SPACE } from '@atlaskit/editor-common/utils';
3
4
  import { DOMSerializer } from '@atlaskit/editor-prosemirror/model';
4
5
  import { Decoration, DecorationSet } from '@atlaskit/editor-prosemirror/view';
5
6
  import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
@@ -10,6 +11,7 @@ export function createPlaceholderDecoration(editorState, placeholderText, placeh
10
11
  var initialDelayWhenUserTypedAndDeleted = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : 0;
11
12
  var placeholderADF = arguments.length > 6 ? arguments[6] : undefined;
12
13
  var showOnEmptyParagraph = arguments.length > 7 ? arguments[7] : undefined;
14
+ var browser = getBrowserInfo();
13
15
  var placeholderDecoration = document.createElement('span');
14
16
  var placeholderNodeWithText = placeholderDecoration;
15
17
  placeholderDecoration.setAttribute('data-testid', placeholderTestId);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-placeholder",
3
- "version": "8.1.23",
3
+ "version": "9.0.0",
4
4
  "description": "Placeholder plugin for @atlaskit/editor-core.",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -29,20 +29,20 @@
29
29
  "dependencies": {
30
30
  "@atlaskit/adf-utils": "^19.27.0",
31
31
  "@atlaskit/css": "^0.19.0",
32
- "@atlaskit/editor-plugin-composition": "^7.0.0",
33
- "@atlaskit/editor-plugin-focus": "^7.0.0",
34
- "@atlaskit/editor-plugin-show-diff": "^6.3.0",
35
- "@atlaskit/editor-plugin-type-ahead": "^8.2.0",
32
+ "@atlaskit/editor-plugin-composition": "^8.0.0",
33
+ "@atlaskit/editor-plugin-focus": "^8.0.0",
34
+ "@atlaskit/editor-plugin-show-diff": "^7.0.0",
35
+ "@atlaskit/editor-plugin-type-ahead": "^9.0.0",
36
36
  "@atlaskit/editor-prosemirror": "^7.3.0",
37
37
  "@atlaskit/platform-feature-flags": "^1.1.0",
38
38
  "@atlaskit/primitives": "^19.0.0",
39
39
  "@atlaskit/spinner": "^19.1.0",
40
- "@atlaskit/tmp-editor-statsig": "^61.0.0",
40
+ "@atlaskit/tmp-editor-statsig": "^62.4.0",
41
41
  "@atlaskit/tokens": "^13.0.0",
42
42
  "@babel/runtime": "^7.0.0"
43
43
  },
44
44
  "peerDependencies": {
45
- "@atlaskit/editor-common": "^112.20.0",
45
+ "@atlaskit/editor-common": "^113.0.0",
46
46
  "react": "^18.2.0",
47
47
  "react-dom": "^18.2.0",
48
48
  "react-intl-next": "npm:react-intl@^5.18.1"