@atlaskit/editor-plugin-placeholder-text 3.1.9 → 4.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,19 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-placeholder-text
|
|
2
2
|
|
|
3
|
+
## 4.0.0
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies
|
|
8
|
+
|
|
9
|
+
## 3.1.10
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [`c67efe1808d4e`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/c67efe1808d4e) -
|
|
14
|
+
ED-29111: clean up sharedPluginStateHookMigratorFactory in placeholder-text, panel, quick-insert
|
|
15
|
+
- Updated dependencies
|
|
16
|
+
|
|
3
17
|
## 3.1.9
|
|
4
18
|
|
|
5
19
|
### Patch Changes
|
|
@@ -133,31 +133,18 @@ function createPlugin(dispatch, options, api) {
|
|
|
133
133
|
}
|
|
134
134
|
});
|
|
135
135
|
}
|
|
136
|
-
|
|
137
|
-
var
|
|
136
|
+
function ContentComponent(_ref) {
|
|
137
|
+
var editorView = _ref.editorView,
|
|
138
|
+
dependencyApi = _ref.dependencyApi,
|
|
139
|
+
popupsMountPoint = _ref.popupsMountPoint,
|
|
140
|
+
popupsBoundariesElement = _ref.popupsBoundariesElement;
|
|
141
|
+
var _useSharedPluginState = (0, _hooks.useSharedPluginStateWithSelector)(dependencyApi, ['placeholderText'], function (states) {
|
|
138
142
|
var _states$placeholderTe;
|
|
139
143
|
return {
|
|
140
144
|
showInsertPanelAt: (_states$placeholderTe = states.placeholderTextState) === null || _states$placeholderTe === void 0 ? void 0 : _states$placeholderTe.showInsertPanelAt
|
|
141
145
|
};
|
|
142
146
|
}),
|
|
143
147
|
showInsertPanelAt = _useSharedPluginState.showInsertPanelAt;
|
|
144
|
-
return {
|
|
145
|
-
showInsertPanelAt: showInsertPanelAt
|
|
146
|
-
};
|
|
147
|
-
}, function (api) {
|
|
148
|
-
var _useSharedPluginState2 = (0, _hooks.useSharedPluginState)(api, ['placeholderText']),
|
|
149
|
-
placeholderTextState = _useSharedPluginState2.placeholderTextState;
|
|
150
|
-
return {
|
|
151
|
-
showInsertPanelAt: placeholderTextState === null || placeholderTextState === void 0 ? void 0 : placeholderTextState.showInsertPanelAt
|
|
152
|
-
};
|
|
153
|
-
});
|
|
154
|
-
function ContentComponent(_ref) {
|
|
155
|
-
var editorView = _ref.editorView,
|
|
156
|
-
dependencyApi = _ref.dependencyApi,
|
|
157
|
-
popupsMountPoint = _ref.popupsMountPoint,
|
|
158
|
-
popupsBoundariesElement = _ref.popupsBoundariesElement;
|
|
159
|
-
var _useSharedPlaceholder = useSharedPlaceholderTextState(dependencyApi),
|
|
160
|
-
showInsertPanelAt = _useSharedPlaceholder.showInsertPanelAt;
|
|
161
148
|
var insertPlaceholderText = function insertPlaceholderText(value) {
|
|
162
149
|
return (0, _actions.insertPlaceholderTextAtSelection)(value)(editorView.state, editorView.dispatch);
|
|
163
150
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
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 {
|
|
4
|
+
import { 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
7
|
import { isNodeEmpty } from '@atlaskit/editor-common/utils';
|
|
@@ -126,26 +126,6 @@ export function createPlugin(dispatch, options, api) {
|
|
|
126
126
|
}
|
|
127
127
|
});
|
|
128
128
|
}
|
|
129
|
-
const useSharedPlaceholderTextState = sharedPluginStateHookMigratorFactory(api => {
|
|
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
|
-
});
|
|
138
|
-
return {
|
|
139
|
-
showInsertPanelAt
|
|
140
|
-
};
|
|
141
|
-
}, api => {
|
|
142
|
-
const {
|
|
143
|
-
placeholderTextState
|
|
144
|
-
} = useSharedPluginState(api, ['placeholderText']);
|
|
145
|
-
return {
|
|
146
|
-
showInsertPanelAt: placeholderTextState === null || placeholderTextState === void 0 ? void 0 : placeholderTextState.showInsertPanelAt
|
|
147
|
-
};
|
|
148
|
-
});
|
|
149
129
|
function ContentComponent({
|
|
150
130
|
editorView,
|
|
151
131
|
dependencyApi,
|
|
@@ -154,7 +134,12 @@ function ContentComponent({
|
|
|
154
134
|
}) {
|
|
155
135
|
const {
|
|
156
136
|
showInsertPanelAt
|
|
157
|
-
} =
|
|
137
|
+
} = useSharedPluginStateWithSelector(dependencyApi, ['placeholderText'], 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
|
+
});
|
|
158
143
|
const insertPlaceholderText = value => insertPlaceholderTextAtSelection(value)(editorView.state, editorView.dispatch);
|
|
159
144
|
const hidePlaceholderToolbar = () => hidePlaceholderFloatingToolbar(editorView.state, editorView.dispatch);
|
|
160
145
|
const getNodeFromPos = pos => editorView.domAtPos(pos).node;
|
|
@@ -1,7 +1,7 @@
|
|
|
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 {
|
|
4
|
+
import { 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
7
|
import { isNodeEmpty } from '@atlaskit/editor-common/utils';
|
|
@@ -125,31 +125,18 @@ export function createPlugin(dispatch, options, api) {
|
|
|
125
125
|
}
|
|
126
126
|
});
|
|
127
127
|
}
|
|
128
|
-
|
|
129
|
-
var
|
|
128
|
+
function ContentComponent(_ref) {
|
|
129
|
+
var editorView = _ref.editorView,
|
|
130
|
+
dependencyApi = _ref.dependencyApi,
|
|
131
|
+
popupsMountPoint = _ref.popupsMountPoint,
|
|
132
|
+
popupsBoundariesElement = _ref.popupsBoundariesElement;
|
|
133
|
+
var _useSharedPluginState = useSharedPluginStateWithSelector(dependencyApi, ['placeholderText'], function (states) {
|
|
130
134
|
var _states$placeholderTe;
|
|
131
135
|
return {
|
|
132
136
|
showInsertPanelAt: (_states$placeholderTe = states.placeholderTextState) === null || _states$placeholderTe === void 0 ? void 0 : _states$placeholderTe.showInsertPanelAt
|
|
133
137
|
};
|
|
134
138
|
}),
|
|
135
139
|
showInsertPanelAt = _useSharedPluginState.showInsertPanelAt;
|
|
136
|
-
return {
|
|
137
|
-
showInsertPanelAt: showInsertPanelAt
|
|
138
|
-
};
|
|
139
|
-
}, function (api) {
|
|
140
|
-
var _useSharedPluginState2 = useSharedPluginState(api, ['placeholderText']),
|
|
141
|
-
placeholderTextState = _useSharedPluginState2.placeholderTextState;
|
|
142
|
-
return {
|
|
143
|
-
showInsertPanelAt: placeholderTextState === null || placeholderTextState === void 0 ? void 0 : placeholderTextState.showInsertPanelAt
|
|
144
|
-
};
|
|
145
|
-
});
|
|
146
|
-
function ContentComponent(_ref) {
|
|
147
|
-
var editorView = _ref.editorView,
|
|
148
|
-
dependencyApi = _ref.dependencyApi,
|
|
149
|
-
popupsMountPoint = _ref.popupsMountPoint,
|
|
150
|
-
popupsBoundariesElement = _ref.popupsBoundariesElement;
|
|
151
|
-
var _useSharedPlaceholder = useSharedPlaceholderTextState(dependencyApi),
|
|
152
|
-
showInsertPanelAt = _useSharedPlaceholder.showInsertPanelAt;
|
|
153
140
|
var insertPlaceholderText = function insertPlaceholderText(value) {
|
|
154
141
|
return insertPlaceholderTextAtSelection(value)(editorView.state, editorView.dispatch);
|
|
155
142
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-placeholder-text",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "4.0.0",
|
|
4
4
|
"description": "placeholder text plugin for @atlaskit/editor-core",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -28,8 +28,8 @@
|
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
30
|
"@atlaskit/adf-schema": "^50.2.3",
|
|
31
|
-
"@atlaskit/editor-plugin-analytics": "^
|
|
32
|
-
"@atlaskit/editor-plugin-type-ahead": "^
|
|
31
|
+
"@atlaskit/editor-plugin-analytics": "^4.0.0",
|
|
32
|
+
"@atlaskit/editor-plugin-type-ahead": "^4.0.0",
|
|
33
33
|
"@atlaskit/editor-prosemirror": "7.0.0",
|
|
34
34
|
"@atlaskit/editor-shared-styles": "^3.6.0",
|
|
35
35
|
"@atlaskit/icon": "^28.1.0",
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
"@emotion/react": "^11.7.1"
|
|
40
40
|
},
|
|
41
41
|
"peerDependencies": {
|
|
42
|
-
"@atlaskit/editor-common": "^
|
|
42
|
+
"@atlaskit/editor-common": "^108.0.0",
|
|
43
43
|
"react": "^18.2.0",
|
|
44
44
|
"react-dom": "^18.2.0",
|
|
45
45
|
"react-intl-next": "npm:react-intl@^5.18.1"
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
"devDependencies": {
|
|
48
48
|
"@af/visual-regression": "workspace:^",
|
|
49
49
|
"@atlaskit/analytics-next": "^11.1.0",
|
|
50
|
-
"@atlaskit/editor-plugin-floating-toolbar": "^
|
|
50
|
+
"@atlaskit/editor-plugin-floating-toolbar": "^6.0.0",
|
|
51
51
|
"@atlaskit/ssr": "workspace:^",
|
|
52
52
|
"@testing-library/react": "^13.4.0",
|
|
53
53
|
"wait-for-expect": "^1.2.0"
|