@atlaskit/editor-plugin-placeholder-text 2.4.1 → 3.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
CHANGED
|
@@ -1,5 +1,54 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-placeholder-text
|
|
2
2
|
|
|
3
|
+
## 3.0.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#183158](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/183158)
|
|
8
|
+
[`d6096ec5c8ad9`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/d6096ec5c8ad9) -
|
|
9
|
+
Migrate to useSharedPluginStateWithSelector
|
|
10
|
+
- Updated dependencies
|
|
11
|
+
|
|
12
|
+
## 3.0.0
|
|
13
|
+
|
|
14
|
+
### Major Changes
|
|
15
|
+
|
|
16
|
+
- [#181024](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/181024)
|
|
17
|
+
[`8e80c487ca307`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/8e80c487ca307) - ##
|
|
18
|
+
Make `@atlaskit/editor-common` a peer dependency
|
|
19
|
+
|
|
20
|
+
**WHAT:** `@atlaskit/editor-common` has been moved from `dependencies` to `peerDependencies` in
|
|
21
|
+
all editor plugin packages.
|
|
22
|
+
|
|
23
|
+
**WHY:** This change ensures that only a single version of `@atlaskit/editor-common` is used in
|
|
24
|
+
consuming applications, preventing issues caused by multiple versions of singleton libraries (such
|
|
25
|
+
as context mismatches or duplicated state). This is especially important for packages that rely on
|
|
26
|
+
shared context or singletons.
|
|
27
|
+
|
|
28
|
+
**HOW TO ADJUST:**
|
|
29
|
+
|
|
30
|
+
- Consumers must now explicitly install `@atlaskit/editor-common` in their own project if they use
|
|
31
|
+
any of these editor plugins.
|
|
32
|
+
- Ensure the version you install matches the version required by the plugins.
|
|
33
|
+
- You can use the
|
|
34
|
+
[`check-peer-dependencies`](https://www.npmjs.com/package/check-peer-dependencies) package to
|
|
35
|
+
verify that all required peer dependencies are installed and compatible.
|
|
36
|
+
- Example install command:
|
|
37
|
+
```
|
|
38
|
+
npm install @atlaskit/editor-common
|
|
39
|
+
```
|
|
40
|
+
or
|
|
41
|
+
```
|
|
42
|
+
yarn add @atlaskit/editor-common
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
**Note:** This is a breaking change. If `@atlaskit/editor-common` is not installed at the
|
|
46
|
+
application level, you may see errors or unexpected behavior.
|
|
47
|
+
|
|
48
|
+
### Patch Changes
|
|
49
|
+
|
|
50
|
+
- Updated dependencies
|
|
51
|
+
|
|
3
52
|
## 2.4.1
|
|
4
53
|
|
|
5
54
|
### Patch Changes
|
|
@@ -12,7 +12,6 @@ var _analytics = require("@atlaskit/editor-common/analytics");
|
|
|
12
12
|
var _hooks = require("@atlaskit/editor-common/hooks");
|
|
13
13
|
var _messages = require("@atlaskit/editor-common/messages");
|
|
14
14
|
var _safePlugin = require("@atlaskit/editor-common/safe-plugin");
|
|
15
|
-
var _useSharedPluginStateSelector = require("@atlaskit/editor-common/use-shared-plugin-state-selector");
|
|
16
15
|
var _utils = require("@atlaskit/editor-common/utils");
|
|
17
16
|
var _state = require("@atlaskit/editor-prosemirror/state");
|
|
18
17
|
var _text = _interopRequireDefault(require("@atlaskit/icon/core/text"));
|
|
@@ -135,13 +134,19 @@ function createPlugin(dispatch, options, api) {
|
|
|
135
134
|
});
|
|
136
135
|
}
|
|
137
136
|
var useSharedPlaceholderTextState = (0, _hooks.sharedPluginStateHookMigratorFactory)(function (api) {
|
|
138
|
-
var
|
|
137
|
+
var _useSharedPluginState = (0, _hooks.useSharedPluginStateWithSelector)(api, ['placeholderText'], function (states) {
|
|
138
|
+
var _states$placeholderTe;
|
|
139
|
+
return {
|
|
140
|
+
showInsertPanelAt: (_states$placeholderTe = states.placeholderTextState) === null || _states$placeholderTe === void 0 ? void 0 : _states$placeholderTe.showInsertPanelAt
|
|
141
|
+
};
|
|
142
|
+
}),
|
|
143
|
+
showInsertPanelAt = _useSharedPluginState.showInsertPanelAt;
|
|
139
144
|
return {
|
|
140
145
|
showInsertPanelAt: showInsertPanelAt
|
|
141
146
|
};
|
|
142
147
|
}, function (api) {
|
|
143
|
-
var
|
|
144
|
-
placeholderTextState =
|
|
148
|
+
var _useSharedPluginState2 = (0, _hooks.useSharedPluginState)(api, ['placeholderText']),
|
|
149
|
+
placeholderTextState = _useSharedPluginState2.placeholderTextState;
|
|
145
150
|
return {
|
|
146
151
|
showInsertPanelAt: placeholderTextState === null || placeholderTextState === void 0 ? void 0 : placeholderTextState.showInsertPanelAt
|
|
147
152
|
};
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { placeholder } from '@atlaskit/adf-schema';
|
|
3
3
|
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE, INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
4
|
-
import { useSharedPluginState, sharedPluginStateHookMigratorFactory } from '@atlaskit/editor-common/hooks';
|
|
4
|
+
import { useSharedPluginState, sharedPluginStateHookMigratorFactory, useSharedPluginStateWithSelector } from '@atlaskit/editor-common/hooks';
|
|
5
5
|
import { toolbarInsertBlockMessages as messages } from '@atlaskit/editor-common/messages';
|
|
6
6
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
7
|
-
import { useSharedPluginStateSelector } from '@atlaskit/editor-common/use-shared-plugin-state-selector';
|
|
8
7
|
import { isNodeEmpty } from '@atlaskit/editor-common/utils';
|
|
9
8
|
import { NodeSelection, TextSelection } from '@atlaskit/editor-prosemirror/state';
|
|
10
9
|
import TextIcon from '@atlaskit/icon/core/text';
|
|
@@ -128,7 +127,14 @@ export function createPlugin(dispatch, options, api) {
|
|
|
128
127
|
});
|
|
129
128
|
}
|
|
130
129
|
const useSharedPlaceholderTextState = sharedPluginStateHookMigratorFactory(api => {
|
|
131
|
-
const
|
|
130
|
+
const {
|
|
131
|
+
showInsertPanelAt
|
|
132
|
+
} = useSharedPluginStateWithSelector(api, ['placeholderText'], states => {
|
|
133
|
+
var _states$placeholderTe;
|
|
134
|
+
return {
|
|
135
|
+
showInsertPanelAt: (_states$placeholderTe = states.placeholderTextState) === null || _states$placeholderTe === void 0 ? void 0 : _states$placeholderTe.showInsertPanelAt
|
|
136
|
+
};
|
|
137
|
+
});
|
|
132
138
|
return {
|
|
133
139
|
showInsertPanelAt
|
|
134
140
|
};
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { placeholder } from '@atlaskit/adf-schema';
|
|
3
3
|
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE, INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
4
|
-
import { useSharedPluginState, sharedPluginStateHookMigratorFactory } from '@atlaskit/editor-common/hooks';
|
|
4
|
+
import { useSharedPluginState, sharedPluginStateHookMigratorFactory, useSharedPluginStateWithSelector } from '@atlaskit/editor-common/hooks';
|
|
5
5
|
import { toolbarInsertBlockMessages as messages } from '@atlaskit/editor-common/messages';
|
|
6
6
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
7
|
-
import { useSharedPluginStateSelector } from '@atlaskit/editor-common/use-shared-plugin-state-selector';
|
|
8
7
|
import { isNodeEmpty } from '@atlaskit/editor-common/utils';
|
|
9
8
|
import { NodeSelection, TextSelection } from '@atlaskit/editor-prosemirror/state';
|
|
10
9
|
import TextIcon from '@atlaskit/icon/core/text';
|
|
@@ -127,13 +126,19 @@ export function createPlugin(dispatch, options, api) {
|
|
|
127
126
|
});
|
|
128
127
|
}
|
|
129
128
|
var useSharedPlaceholderTextState = sharedPluginStateHookMigratorFactory(function (api) {
|
|
130
|
-
var
|
|
129
|
+
var _useSharedPluginState = useSharedPluginStateWithSelector(api, ['placeholderText'], function (states) {
|
|
130
|
+
var _states$placeholderTe;
|
|
131
|
+
return {
|
|
132
|
+
showInsertPanelAt: (_states$placeholderTe = states.placeholderTextState) === null || _states$placeholderTe === void 0 ? void 0 : _states$placeholderTe.showInsertPanelAt
|
|
133
|
+
};
|
|
134
|
+
}),
|
|
135
|
+
showInsertPanelAt = _useSharedPluginState.showInsertPanelAt;
|
|
131
136
|
return {
|
|
132
137
|
showInsertPanelAt: showInsertPanelAt
|
|
133
138
|
};
|
|
134
139
|
}, function (api) {
|
|
135
|
-
var
|
|
136
|
-
placeholderTextState =
|
|
140
|
+
var _useSharedPluginState2 = useSharedPluginState(api, ['placeholderText']),
|
|
141
|
+
placeholderTextState = _useSharedPluginState2.placeholderTextState;
|
|
137
142
|
return {
|
|
138
143
|
showInsertPanelAt: placeholderTextState === null || placeholderTextState === void 0 ? void 0 : placeholderTextState.showInsertPanelAt
|
|
139
144
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-placeholder-text",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.1",
|
|
4
4
|
"description": "placeholder text plugin for @atlaskit/editor-core",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -19,7 +19,6 @@
|
|
|
19
19
|
"atlassian": {
|
|
20
20
|
"team": "Editor: Core Experiences",
|
|
21
21
|
"singleton": true,
|
|
22
|
-
"runReact18": true,
|
|
23
22
|
"integrationTests": {
|
|
24
23
|
"additionalBrowsers": [
|
|
25
24
|
"desktop-firefox",
|
|
@@ -29,18 +28,18 @@
|
|
|
29
28
|
},
|
|
30
29
|
"dependencies": {
|
|
31
30
|
"@atlaskit/adf-schema": "^47.6.0",
|
|
32
|
-
"@atlaskit/editor-
|
|
33
|
-
"@atlaskit/editor-plugin-
|
|
34
|
-
"@atlaskit/editor-plugin-type-ahead": "^2.7.0",
|
|
31
|
+
"@atlaskit/editor-plugin-analytics": "^3.0.0",
|
|
32
|
+
"@atlaskit/editor-plugin-type-ahead": "^3.0.0",
|
|
35
33
|
"@atlaskit/editor-prosemirror": "7.0.0",
|
|
36
34
|
"@atlaskit/editor-shared-styles": "^3.4.0",
|
|
37
|
-
"@atlaskit/icon": "^27.
|
|
38
|
-
"@atlaskit/theme": "^
|
|
39
|
-
"@atlaskit/tokens": "^5.
|
|
35
|
+
"@atlaskit/icon": "^27.3.0",
|
|
36
|
+
"@atlaskit/theme": "^19.0.0",
|
|
37
|
+
"@atlaskit/tokens": "^5.4.0",
|
|
40
38
|
"@babel/runtime": "^7.0.0",
|
|
41
39
|
"@emotion/react": "^11.7.1"
|
|
42
40
|
},
|
|
43
41
|
"peerDependencies": {
|
|
42
|
+
"@atlaskit/editor-common": "^107.7.0",
|
|
44
43
|
"react": "^18.2.0",
|
|
45
44
|
"react-dom": "^18.2.0",
|
|
46
45
|
"react-intl-next": "npm:react-intl@^5.18.1"
|
|
@@ -48,7 +47,7 @@
|
|
|
48
47
|
"devDependencies": {
|
|
49
48
|
"@af/visual-regression": "workspace:^",
|
|
50
49
|
"@atlaskit/analytics-next": "^11.1.0",
|
|
51
|
-
"@atlaskit/editor-plugin-floating-toolbar": "^
|
|
50
|
+
"@atlaskit/editor-plugin-floating-toolbar": "^5.0.0",
|
|
52
51
|
"@atlaskit/ssr": "workspace:^",
|
|
53
52
|
"@atlaskit/visual-regression": "workspace:^",
|
|
54
53
|
"@testing-library/react": "^13.4.0",
|