@atlaskit/editor-plugin-find-replace 1.3.10 → 1.4.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 +18 -0
- package/dist/cjs/plugin.js +42 -34
- package/dist/es2019/plugin.js +33 -25
- package/dist/esm/plugin.js +42 -34
- package/dist/types/types.d.ts +2 -1
- package/dist/types-ts4.5/types.d.ts +3 -1
- package/package.json +4 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-find-replace
|
|
2
2
|
|
|
3
|
+
## 1.4.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies
|
|
8
|
+
|
|
9
|
+
## 1.4.0
|
|
10
|
+
|
|
11
|
+
### Minor Changes
|
|
12
|
+
|
|
13
|
+
- [#120426](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/120426)
|
|
14
|
+
[`1cb3869ab1a96`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/1cb3869ab1a96) -
|
|
15
|
+
[ED-23436] Use editor primary toolbar plugin to structure the primary toolbar
|
|
16
|
+
|
|
17
|
+
### Patch Changes
|
|
18
|
+
|
|
19
|
+
- Updated dependencies
|
|
20
|
+
|
|
3
21
|
## 1.3.10
|
|
4
22
|
|
|
5
23
|
### Patch Changes
|
package/dist/cjs/plugin.js
CHANGED
|
@@ -13,13 +13,37 @@ var _pluginKey = require("./pm-plugins/plugin-key");
|
|
|
13
13
|
var findReplacePlugin = exports.findReplacePlugin = function findReplacePlugin(_ref) {
|
|
14
14
|
var props = _ref.config,
|
|
15
15
|
api = _ref.api;
|
|
16
|
+
var primaryToolbarComponent = function primaryToolbarComponent(_ref2) {
|
|
17
|
+
var popupsBoundariesElement = _ref2.popupsBoundariesElement,
|
|
18
|
+
popupsMountPoint = _ref2.popupsMountPoint,
|
|
19
|
+
popupsScrollableElement = _ref2.popupsScrollableElement,
|
|
20
|
+
isToolbarReducedSpacing = _ref2.isToolbarReducedSpacing,
|
|
21
|
+
editorView = _ref2.editorView,
|
|
22
|
+
containerElement = _ref2.containerElement,
|
|
23
|
+
dispatchAnalyticsEvent = _ref2.dispatchAnalyticsEvent;
|
|
24
|
+
if (props !== null && props !== void 0 && props.twoLineEditorToolbar) {
|
|
25
|
+
return null;
|
|
26
|
+
} else {
|
|
27
|
+
return /*#__PURE__*/_react.default.createElement(_FindReplaceToolbarButtonWithState.default, {
|
|
28
|
+
popupsBoundariesElement: popupsBoundariesElement,
|
|
29
|
+
popupsMountPoint: popupsMountPoint,
|
|
30
|
+
popupsScrollableElement: popupsScrollableElement,
|
|
31
|
+
isToolbarReducedSpacing: isToolbarReducedSpacing,
|
|
32
|
+
editorView: editorView,
|
|
33
|
+
containerElement: containerElement,
|
|
34
|
+
dispatchAnalyticsEvent: dispatchAnalyticsEvent,
|
|
35
|
+
takeFullWidth: props === null || props === void 0 ? void 0 : props.takeFullWidth,
|
|
36
|
+
api: api
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
};
|
|
16
40
|
return {
|
|
17
41
|
name: 'findReplace',
|
|
18
42
|
pmPlugins: function pmPlugins() {
|
|
19
43
|
return [{
|
|
20
44
|
name: 'findReplace',
|
|
21
|
-
plugin: function plugin(
|
|
22
|
-
var dispatch =
|
|
45
|
+
plugin: function plugin(_ref3) {
|
|
46
|
+
var dispatch = _ref3.dispatch;
|
|
23
47
|
return (0, _main.createPlugin)(dispatch);
|
|
24
48
|
}
|
|
25
49
|
}, {
|
|
@@ -37,14 +61,14 @@ var findReplacePlugin = exports.findReplacePlugin = function findReplacePlugin(_
|
|
|
37
61
|
return _pluginKey.findReplacePluginKey.getState(editorState) || undefined;
|
|
38
62
|
},
|
|
39
63
|
actions: {
|
|
40
|
-
getToolbarButton: function getToolbarButton(
|
|
41
|
-
var popupsBoundariesElement =
|
|
42
|
-
popupsMountPoint =
|
|
43
|
-
popupsScrollableElement =
|
|
44
|
-
editorView =
|
|
45
|
-
containerElement =
|
|
46
|
-
dispatchAnalyticsEvent =
|
|
47
|
-
isToolbarReducedSpacing =
|
|
64
|
+
getToolbarButton: function getToolbarButton(_ref4) {
|
|
65
|
+
var popupsBoundariesElement = _ref4.popupsBoundariesElement,
|
|
66
|
+
popupsMountPoint = _ref4.popupsMountPoint,
|
|
67
|
+
popupsScrollableElement = _ref4.popupsScrollableElement,
|
|
68
|
+
editorView = _ref4.editorView,
|
|
69
|
+
containerElement = _ref4.containerElement,
|
|
70
|
+
dispatchAnalyticsEvent = _ref4.dispatchAnalyticsEvent,
|
|
71
|
+
isToolbarReducedSpacing = _ref4.isToolbarReducedSpacing;
|
|
48
72
|
return /*#__PURE__*/_react.default.createElement(_FindReplaceToolbarButtonWithState.default, {
|
|
49
73
|
popupsBoundariesElement: popupsBoundariesElement,
|
|
50
74
|
popupsMountPoint: popupsMountPoint,
|
|
@@ -57,29 +81,13 @@ var findReplacePlugin = exports.findReplacePlugin = function findReplacePlugin(_
|
|
|
57
81
|
});
|
|
58
82
|
}
|
|
59
83
|
},
|
|
60
|
-
|
|
61
|
-
var
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
if (props !== null && props !== void 0 && props.twoLineEditorToolbar) {
|
|
69
|
-
return null;
|
|
70
|
-
} else {
|
|
71
|
-
return /*#__PURE__*/_react.default.createElement(_FindReplaceToolbarButtonWithState.default, {
|
|
72
|
-
popupsBoundariesElement: popupsBoundariesElement,
|
|
73
|
-
popupsMountPoint: popupsMountPoint,
|
|
74
|
-
popupsScrollableElement: popupsScrollableElement,
|
|
75
|
-
isToolbarReducedSpacing: isToolbarReducedSpacing,
|
|
76
|
-
editorView: editorView,
|
|
77
|
-
containerElement: containerElement,
|
|
78
|
-
dispatchAnalyticsEvent: dispatchAnalyticsEvent,
|
|
79
|
-
takeFullWidth: props === null || props === void 0 ? void 0 : props.takeFullWidth,
|
|
80
|
-
api: api
|
|
81
|
-
});
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
+
usePluginHook: function usePluginHook() {
|
|
85
|
+
var _api$core, _api$primaryToolbar;
|
|
86
|
+
api === null || api === void 0 || (_api$core = api.core) === null || _api$core === void 0 || _api$core.actions.execute(api === null || api === void 0 || (_api$primaryToolbar = api.primaryToolbar) === null || _api$primaryToolbar === void 0 ? void 0 : _api$primaryToolbar.commands.registerComponent({
|
|
87
|
+
name: 'findReplace',
|
|
88
|
+
component: primaryToolbarComponent
|
|
89
|
+
}));
|
|
90
|
+
},
|
|
91
|
+
primaryToolbarComponent: !(api !== null && api !== void 0 && api.primaryToolbar) ? primaryToolbarComponent : undefined
|
|
84
92
|
};
|
|
85
93
|
};
|
package/dist/es2019/plugin.js
CHANGED
|
@@ -7,6 +7,31 @@ export const findReplacePlugin = ({
|
|
|
7
7
|
config: props,
|
|
8
8
|
api
|
|
9
9
|
}) => {
|
|
10
|
+
const primaryToolbarComponent = ({
|
|
11
|
+
popupsBoundariesElement,
|
|
12
|
+
popupsMountPoint,
|
|
13
|
+
popupsScrollableElement,
|
|
14
|
+
isToolbarReducedSpacing,
|
|
15
|
+
editorView,
|
|
16
|
+
containerElement,
|
|
17
|
+
dispatchAnalyticsEvent
|
|
18
|
+
}) => {
|
|
19
|
+
if (props !== null && props !== void 0 && props.twoLineEditorToolbar) {
|
|
20
|
+
return null;
|
|
21
|
+
} else {
|
|
22
|
+
return /*#__PURE__*/React.createElement(FindReplaceToolbarButtonWithState, {
|
|
23
|
+
popupsBoundariesElement: popupsBoundariesElement,
|
|
24
|
+
popupsMountPoint: popupsMountPoint,
|
|
25
|
+
popupsScrollableElement: popupsScrollableElement,
|
|
26
|
+
isToolbarReducedSpacing: isToolbarReducedSpacing,
|
|
27
|
+
editorView: editorView,
|
|
28
|
+
containerElement: containerElement,
|
|
29
|
+
dispatchAnalyticsEvent: dispatchAnalyticsEvent,
|
|
30
|
+
takeFullWidth: props === null || props === void 0 ? void 0 : props.takeFullWidth,
|
|
31
|
+
api: api
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
};
|
|
10
35
|
return {
|
|
11
36
|
name: 'findReplace',
|
|
12
37
|
pmPlugins() {
|
|
@@ -51,30 +76,13 @@ export const findReplacePlugin = ({
|
|
|
51
76
|
});
|
|
52
77
|
}
|
|
53
78
|
},
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
}) {
|
|
63
|
-
if (props !== null && props !== void 0 && props.twoLineEditorToolbar) {
|
|
64
|
-
return null;
|
|
65
|
-
} else {
|
|
66
|
-
return /*#__PURE__*/React.createElement(FindReplaceToolbarButtonWithState, {
|
|
67
|
-
popupsBoundariesElement: popupsBoundariesElement,
|
|
68
|
-
popupsMountPoint: popupsMountPoint,
|
|
69
|
-
popupsScrollableElement: popupsScrollableElement,
|
|
70
|
-
isToolbarReducedSpacing: isToolbarReducedSpacing,
|
|
71
|
-
editorView: editorView,
|
|
72
|
-
containerElement: containerElement,
|
|
73
|
-
dispatchAnalyticsEvent: dispatchAnalyticsEvent,
|
|
74
|
-
takeFullWidth: props === null || props === void 0 ? void 0 : props.takeFullWidth,
|
|
75
|
-
api: api
|
|
76
|
-
});
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
+
usePluginHook: () => {
|
|
80
|
+
var _api$core, _api$primaryToolbar;
|
|
81
|
+
api === null || api === void 0 ? void 0 : (_api$core = api.core) === null || _api$core === void 0 ? void 0 : _api$core.actions.execute(api === null || api === void 0 ? void 0 : (_api$primaryToolbar = api.primaryToolbar) === null || _api$primaryToolbar === void 0 ? void 0 : _api$primaryToolbar.commands.registerComponent({
|
|
82
|
+
name: 'findReplace',
|
|
83
|
+
component: primaryToolbarComponent
|
|
84
|
+
}));
|
|
85
|
+
},
|
|
86
|
+
primaryToolbarComponent: !(api !== null && api !== void 0 && api.primaryToolbar) ? primaryToolbarComponent : undefined
|
|
79
87
|
};
|
|
80
88
|
};
|
package/dist/esm/plugin.js
CHANGED
|
@@ -6,13 +6,37 @@ import { findReplacePluginKey } from './pm-plugins/plugin-key';
|
|
|
6
6
|
export var findReplacePlugin = function findReplacePlugin(_ref) {
|
|
7
7
|
var props = _ref.config,
|
|
8
8
|
api = _ref.api;
|
|
9
|
+
var primaryToolbarComponent = function primaryToolbarComponent(_ref2) {
|
|
10
|
+
var popupsBoundariesElement = _ref2.popupsBoundariesElement,
|
|
11
|
+
popupsMountPoint = _ref2.popupsMountPoint,
|
|
12
|
+
popupsScrollableElement = _ref2.popupsScrollableElement,
|
|
13
|
+
isToolbarReducedSpacing = _ref2.isToolbarReducedSpacing,
|
|
14
|
+
editorView = _ref2.editorView,
|
|
15
|
+
containerElement = _ref2.containerElement,
|
|
16
|
+
dispatchAnalyticsEvent = _ref2.dispatchAnalyticsEvent;
|
|
17
|
+
if (props !== null && props !== void 0 && props.twoLineEditorToolbar) {
|
|
18
|
+
return null;
|
|
19
|
+
} else {
|
|
20
|
+
return /*#__PURE__*/React.createElement(FindReplaceToolbarButtonWithState, {
|
|
21
|
+
popupsBoundariesElement: popupsBoundariesElement,
|
|
22
|
+
popupsMountPoint: popupsMountPoint,
|
|
23
|
+
popupsScrollableElement: popupsScrollableElement,
|
|
24
|
+
isToolbarReducedSpacing: isToolbarReducedSpacing,
|
|
25
|
+
editorView: editorView,
|
|
26
|
+
containerElement: containerElement,
|
|
27
|
+
dispatchAnalyticsEvent: dispatchAnalyticsEvent,
|
|
28
|
+
takeFullWidth: props === null || props === void 0 ? void 0 : props.takeFullWidth,
|
|
29
|
+
api: api
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
};
|
|
9
33
|
return {
|
|
10
34
|
name: 'findReplace',
|
|
11
35
|
pmPlugins: function pmPlugins() {
|
|
12
36
|
return [{
|
|
13
37
|
name: 'findReplace',
|
|
14
|
-
plugin: function plugin(
|
|
15
|
-
var dispatch =
|
|
38
|
+
plugin: function plugin(_ref3) {
|
|
39
|
+
var dispatch = _ref3.dispatch;
|
|
16
40
|
return createPlugin(dispatch);
|
|
17
41
|
}
|
|
18
42
|
}, {
|
|
@@ -30,14 +54,14 @@ export var findReplacePlugin = function findReplacePlugin(_ref) {
|
|
|
30
54
|
return findReplacePluginKey.getState(editorState) || undefined;
|
|
31
55
|
},
|
|
32
56
|
actions: {
|
|
33
|
-
getToolbarButton: function getToolbarButton(
|
|
34
|
-
var popupsBoundariesElement =
|
|
35
|
-
popupsMountPoint =
|
|
36
|
-
popupsScrollableElement =
|
|
37
|
-
editorView =
|
|
38
|
-
containerElement =
|
|
39
|
-
dispatchAnalyticsEvent =
|
|
40
|
-
isToolbarReducedSpacing =
|
|
57
|
+
getToolbarButton: function getToolbarButton(_ref4) {
|
|
58
|
+
var popupsBoundariesElement = _ref4.popupsBoundariesElement,
|
|
59
|
+
popupsMountPoint = _ref4.popupsMountPoint,
|
|
60
|
+
popupsScrollableElement = _ref4.popupsScrollableElement,
|
|
61
|
+
editorView = _ref4.editorView,
|
|
62
|
+
containerElement = _ref4.containerElement,
|
|
63
|
+
dispatchAnalyticsEvent = _ref4.dispatchAnalyticsEvent,
|
|
64
|
+
isToolbarReducedSpacing = _ref4.isToolbarReducedSpacing;
|
|
41
65
|
return /*#__PURE__*/React.createElement(FindReplaceToolbarButtonWithState, {
|
|
42
66
|
popupsBoundariesElement: popupsBoundariesElement,
|
|
43
67
|
popupsMountPoint: popupsMountPoint,
|
|
@@ -50,29 +74,13 @@ export var findReplacePlugin = function findReplacePlugin(_ref) {
|
|
|
50
74
|
});
|
|
51
75
|
}
|
|
52
76
|
},
|
|
53
|
-
|
|
54
|
-
var
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
if (props !== null && props !== void 0 && props.twoLineEditorToolbar) {
|
|
62
|
-
return null;
|
|
63
|
-
} else {
|
|
64
|
-
return /*#__PURE__*/React.createElement(FindReplaceToolbarButtonWithState, {
|
|
65
|
-
popupsBoundariesElement: popupsBoundariesElement,
|
|
66
|
-
popupsMountPoint: popupsMountPoint,
|
|
67
|
-
popupsScrollableElement: popupsScrollableElement,
|
|
68
|
-
isToolbarReducedSpacing: isToolbarReducedSpacing,
|
|
69
|
-
editorView: editorView,
|
|
70
|
-
containerElement: containerElement,
|
|
71
|
-
dispatchAnalyticsEvent: dispatchAnalyticsEvent,
|
|
72
|
-
takeFullWidth: props === null || props === void 0 ? void 0 : props.takeFullWidth,
|
|
73
|
-
api: api
|
|
74
|
-
});
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
+
usePluginHook: function usePluginHook() {
|
|
78
|
+
var _api$core, _api$primaryToolbar;
|
|
79
|
+
api === null || api === void 0 || (_api$core = api.core) === null || _api$core === void 0 || _api$core.actions.execute(api === null || api === void 0 || (_api$primaryToolbar = api.primaryToolbar) === null || _api$primaryToolbar === void 0 ? void 0 : _api$primaryToolbar.commands.registerComponent({
|
|
80
|
+
name: 'findReplace',
|
|
81
|
+
component: primaryToolbarComponent
|
|
82
|
+
}));
|
|
83
|
+
},
|
|
84
|
+
primaryToolbarComponent: !(api !== null && api !== void 0 && api.primaryToolbar) ? primaryToolbarComponent : undefined
|
|
77
85
|
};
|
|
78
86
|
};
|
package/dist/types/types.d.ts
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import type { DispatchAnalyticsEvent } from '@atlaskit/editor-common/analytics';
|
|
3
3
|
import type { ExtractInjectionAPI, NextEditorPlugin, OptionalPlugin } from '@atlaskit/editor-common/types';
|
|
4
4
|
import type { AnalyticsPlugin } from '@atlaskit/editor-plugin-analytics';
|
|
5
|
+
import type { PrimaryToolbarPlugin } from '@atlaskit/editor-plugin-primary-toolbar';
|
|
5
6
|
import type { DecorationSet, EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
6
7
|
export interface FindReplacePluginState {
|
|
7
8
|
/** Whether find/replace is active, i.e. displayed */
|
|
@@ -43,7 +44,7 @@ type Config = {
|
|
|
43
44
|
export type FindReplacePlugin = NextEditorPlugin<'findReplace', {
|
|
44
45
|
pluginConfiguration: Config;
|
|
45
46
|
sharedState: FindReplacePluginState | undefined;
|
|
46
|
-
dependencies: [OptionalPlugin<AnalyticsPlugin>];
|
|
47
|
+
dependencies: [OptionalPlugin<AnalyticsPlugin>, OptionalPlugin<PrimaryToolbarPlugin>];
|
|
47
48
|
actions: {
|
|
48
49
|
getToolbarButton: (params: FindReplaceToolbarButtonActionProps) => React.ReactNode;
|
|
49
50
|
};
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import type { DispatchAnalyticsEvent } from '@atlaskit/editor-common/analytics';
|
|
3
3
|
import type { ExtractInjectionAPI, NextEditorPlugin, OptionalPlugin } from '@atlaskit/editor-common/types';
|
|
4
4
|
import type { AnalyticsPlugin } from '@atlaskit/editor-plugin-analytics';
|
|
5
|
+
import type { PrimaryToolbarPlugin } from '@atlaskit/editor-plugin-primary-toolbar';
|
|
5
6
|
import type { DecorationSet, EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
6
7
|
export interface FindReplacePluginState {
|
|
7
8
|
/** Whether find/replace is active, i.e. displayed */
|
|
@@ -44,7 +45,8 @@ export type FindReplacePlugin = NextEditorPlugin<'findReplace', {
|
|
|
44
45
|
pluginConfiguration: Config;
|
|
45
46
|
sharedState: FindReplacePluginState | undefined;
|
|
46
47
|
dependencies: [
|
|
47
|
-
OptionalPlugin<AnalyticsPlugin
|
|
48
|
+
OptionalPlugin<AnalyticsPlugin>,
|
|
49
|
+
OptionalPlugin<PrimaryToolbarPlugin>
|
|
48
50
|
];
|
|
49
51
|
actions: {
|
|
50
52
|
getToolbarButton: (params: FindReplaceToolbarButtonActionProps) => React.ReactNode;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-find-replace",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.4.1",
|
|
4
4
|
"description": "find replace plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -35,8 +35,9 @@
|
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
37
|
"@atlaskit/button": "^18.4.0",
|
|
38
|
-
"@atlaskit/editor-common": "^
|
|
38
|
+
"@atlaskit/editor-common": "^86.0.0",
|
|
39
39
|
"@atlaskit/editor-plugin-analytics": "^1.4.0",
|
|
40
|
+
"@atlaskit/editor-plugin-primary-toolbar": "^1.2.0",
|
|
40
41
|
"@atlaskit/editor-prosemirror": "4.0.1",
|
|
41
42
|
"@atlaskit/editor-shared-styles": "^2.13.0",
|
|
42
43
|
"@atlaskit/form": "^10.4.0",
|
|
@@ -44,7 +45,7 @@
|
|
|
44
45
|
"@atlaskit/primitives": "^11.0.0",
|
|
45
46
|
"@atlaskit/textfield": "^6.4.0",
|
|
46
47
|
"@atlaskit/theme": "^12.11.0",
|
|
47
|
-
"@atlaskit/tokens": "^1.
|
|
48
|
+
"@atlaskit/tokens": "^1.55.0",
|
|
48
49
|
"@atlaskit/tooltip": "^18.5.0",
|
|
49
50
|
"@babel/runtime": "^7.0.0",
|
|
50
51
|
"@emotion/react": "^11.7.1",
|