@atlaskit/editor-plugin-placeholder 8.1.24 → 10.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 +47 -0
- package/dist/cjs/pm-plugins/decorations.js +5 -3
- package/dist/es2019/pm-plugins/decorations.js +3 -1
- package/dist/esm/pm-plugins/decorations.js +3 -1
- package/dist/types/pm-plugins/adf-builders.d.ts +1 -1
- package/dist/types/pm-plugins/main.d.ts +1 -1
- package/dist/types/pm-plugins/types.d.ts +1 -1
- package/dist/types-ts4.5/pm-plugins/adf-builders.d.ts +1 -1
- package/dist/types-ts4.5/pm-plugins/main.d.ts +1 -1
- package/dist/types-ts4.5/pm-plugins/types.d.ts +1 -1
- package/package.json +10 -9
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,52 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-placeholder
|
|
2
2
|
|
|
3
|
+
## 10.0.0
|
|
4
|
+
|
|
5
|
+
### Major Changes
|
|
6
|
+
|
|
7
|
+
- [`901c87a57486e`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/901c87a57486e) -
|
|
8
|
+
Removed `react-intl-next` alias and replaced all usages with `react-intl` directly.
|
|
9
|
+
|
|
10
|
+
What changed: The `react-intl-next` npm alias (which resolved to `react-intl@^5`) has been
|
|
11
|
+
removed. All imports now reference `react-intl` directly, and `peerDependencies` have been updated
|
|
12
|
+
to `"^5.25.1 || ^6.0.0 || ^7.0.0"`.
|
|
13
|
+
|
|
14
|
+
How consumer should update their code: Ensure `react-intl` is installed at a version satisfying
|
|
15
|
+
`^5.25.1 || ^6.0.0 || ^7.0.0`. If your application was using `react-intl-next` as an npm alias, it
|
|
16
|
+
can be safely removed. Replace any remaining `react-intl-next` imports with `react-intl`.
|
|
17
|
+
|
|
18
|
+
### Patch Changes
|
|
19
|
+
|
|
20
|
+
- Updated dependencies
|
|
21
|
+
|
|
22
|
+
## 9.0.0
|
|
23
|
+
|
|
24
|
+
### Patch Changes
|
|
25
|
+
|
|
26
|
+
- [`b10c935ca9497`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/b10c935ca9497) -
|
|
27
|
+
Removed deprecated `browser` singleton from editor-common. This has been replaced with a
|
|
28
|
+
`getBrowserInfo` function that returns the same information. This change was made to avoid issues
|
|
29
|
+
with module loading order and to provide a more consistent API for accessing browser information.
|
|
30
|
+
|
|
31
|
+
Please update any imports of `browser` to use `getBrowserInfo` instead. For example, the following
|
|
32
|
+
imports have been removed:
|
|
33
|
+
|
|
34
|
+
```javascript
|
|
35
|
+
import { browser } from '@atlaskit/editor-common/utils';
|
|
36
|
+
import { browser } from '@atlaskit/editor-common/browser';
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
Instead, please use:
|
|
40
|
+
|
|
41
|
+
```javascript
|
|
42
|
+
import { getBrowserInfo } from '@atlaskit/editor-common/browser';
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
If you were previously using `browser.ie_version`, you would now use
|
|
46
|
+
`getBrowserInfo().ie_version`.
|
|
47
|
+
|
|
48
|
+
- Updated dependencies
|
|
49
|
+
|
|
3
50
|
## 8.1.24
|
|
4
51
|
|
|
5
52
|
### 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 (
|
|
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 (
|
|
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 &&
|
|
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 {
|
|
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 {
|
|
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);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { IntlShape } from 'react-intl
|
|
1
|
+
import type { IntlShape } from 'react-intl';
|
|
2
2
|
import type { DocNode } from '@atlaskit/adf-schema';
|
|
3
3
|
export declare const createShortEmptyNodePlaceholderADF: ({ formatMessage }: IntlShape) => DocNode;
|
|
4
4
|
export declare const createLongEmptyNodePlaceholderADF: ({ formatMessage }: IntlShape) => DocNode;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { IntlShape } from 'react-intl
|
|
1
|
+
import type { IntlShape } from 'react-intl';
|
|
2
2
|
import type { DocNode } from '@atlaskit/adf-schema';
|
|
3
3
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
4
4
|
import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { IntlShape } from 'react-intl
|
|
1
|
+
import type { IntlShape } from 'react-intl';
|
|
2
2
|
import type { DocNode } from '@atlaskit/adf-schema';
|
|
3
3
|
export declare const createShortEmptyNodePlaceholderADF: ({ formatMessage }: IntlShape) => DocNode;
|
|
4
4
|
export declare const createLongEmptyNodePlaceholderADF: ({ formatMessage }: IntlShape) => DocNode;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { IntlShape } from 'react-intl
|
|
1
|
+
import type { IntlShape } from 'react-intl';
|
|
2
2
|
import type { DocNode } from '@atlaskit/adf-schema';
|
|
3
3
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
4
4
|
import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-placeholder",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "10.0.0",
|
|
4
4
|
"description": "Placeholder plugin for @atlaskit/editor-core.",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -29,26 +29,27 @@
|
|
|
29
29
|
"dependencies": {
|
|
30
30
|
"@atlaskit/adf-utils": "^19.27.0",
|
|
31
31
|
"@atlaskit/css": "^0.19.0",
|
|
32
|
-
"@atlaskit/editor-plugin-composition": "^
|
|
33
|
-
"@atlaskit/editor-plugin-focus": "^
|
|
34
|
-
"@atlaskit/editor-plugin-show-diff": "^
|
|
35
|
-
"@atlaskit/editor-plugin-type-ahead": "^
|
|
32
|
+
"@atlaskit/editor-plugin-composition": "^9.0.0",
|
|
33
|
+
"@atlaskit/editor-plugin-focus": "^9.0.0",
|
|
34
|
+
"@atlaskit/editor-plugin-show-diff": "^8.0.0",
|
|
35
|
+
"@atlaskit/editor-plugin-type-ahead": "^10.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": "^62.
|
|
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": "^
|
|
45
|
+
"@atlaskit/editor-common": "^114.0.0",
|
|
46
46
|
"react": "^18.2.0",
|
|
47
47
|
"react-dom": "^18.2.0",
|
|
48
|
-
"react-intl
|
|
48
|
+
"react-intl": "^5.25.1 || ^6.0.0 || ^7.0.0"
|
|
49
49
|
},
|
|
50
50
|
"devDependencies": {
|
|
51
|
-
"@testing-library/react": "^16.3.0"
|
|
51
|
+
"@testing-library/react": "^16.3.0",
|
|
52
|
+
"react-intl": "^6.6.2"
|
|
52
53
|
},
|
|
53
54
|
"techstack": {
|
|
54
55
|
"@atlassian/frontend": {
|