@atlaskit/editor-plugin-toolbar 1.0.1 → 1.1.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 +12 -0
- package/dist/cjs/toolbarPlugin.js +6 -1
- package/dist/cjs/types/index.js +5 -1
- package/dist/es2019/toolbarPlugin.js +6 -2
- package/dist/es2019/types/index.js +1 -0
- package/dist/esm/toolbarPlugin.js +6 -1
- package/dist/esm/types/index.js +1 -0
- package/dist/types/toolbarPluginType.d.ts +2 -2
- package/dist/types/types/index.d.ts +2 -0
- package/dist/types-ts4.5/toolbarPluginType.d.ts +2 -2
- package/dist/types-ts4.5/types/index.d.ts +2 -0
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-toolbar
|
|
2
2
|
|
|
3
|
+
## 1.1.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [`50976babce55d`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/50976babce55d) -
|
|
8
|
+
Add new 'onClick' to dropdown menu, hook up new toolbar api to regsiter components on selection
|
|
9
|
+
change, add new safeRegistry method to replace existing objects
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- Updated dependencies
|
|
14
|
+
|
|
3
15
|
## 1.0.1
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
|
@@ -32,7 +32,12 @@ var toolbarPlugin = exports.toolbarPlugin = function toolbarPlugin(_ref) {
|
|
|
32
32
|
name: 'toolbar',
|
|
33
33
|
actions: {
|
|
34
34
|
registerComponents: function registerComponents(toolbarComponents) {
|
|
35
|
-
|
|
35
|
+
var replaceItems = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
36
|
+
if (replaceItems) {
|
|
37
|
+
registry.safeRegister(toolbarComponents);
|
|
38
|
+
} else {
|
|
39
|
+
registry.register(toolbarComponents);
|
|
40
|
+
}
|
|
36
41
|
},
|
|
37
42
|
getComponents: function getComponents() {
|
|
38
43
|
return registry.components;
|
package/dist/cjs/types/index.js
CHANGED
|
@@ -23,8 +23,12 @@ export const toolbarPlugin = ({
|
|
|
23
23
|
return {
|
|
24
24
|
name: 'toolbar',
|
|
25
25
|
actions: {
|
|
26
|
-
registerComponents: toolbarComponents => {
|
|
27
|
-
|
|
26
|
+
registerComponents: (toolbarComponents, replaceItems = false) => {
|
|
27
|
+
if (replaceItems) {
|
|
28
|
+
registry.safeRegister(toolbarComponents);
|
|
29
|
+
} else {
|
|
30
|
+
registry.register(toolbarComponents);
|
|
31
|
+
}
|
|
28
32
|
},
|
|
29
33
|
getComponents: () => {
|
|
30
34
|
return registry.components;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -25,7 +25,12 @@ export var toolbarPlugin = function toolbarPlugin(_ref) {
|
|
|
25
25
|
name: 'toolbar',
|
|
26
26
|
actions: {
|
|
27
27
|
registerComponents: function registerComponents(toolbarComponents) {
|
|
28
|
-
|
|
28
|
+
var replaceItems = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
29
|
+
if (replaceItems) {
|
|
30
|
+
registry.safeRegister(toolbarComponents);
|
|
31
|
+
} else {
|
|
32
|
+
registry.register(toolbarComponents);
|
|
33
|
+
}
|
|
29
34
|
},
|
|
30
35
|
getComponents: function getComponents() {
|
|
31
36
|
return registry.components;
|
package/dist/esm/types/index.js
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -5,11 +5,11 @@ import type { SelectionPlugin } from '@atlaskit/editor-plugin-selection';
|
|
|
5
5
|
import type { UserIntentPlugin } from '@atlaskit/editor-plugin-user-intent';
|
|
6
6
|
import type { UserPreferencesPlugin } from '@atlaskit/editor-plugin-user-preferences';
|
|
7
7
|
import type { RegisterComponent } from '@atlaskit/editor-toolbar-model';
|
|
8
|
-
import type { ToolbarPluginOptions } from './types';
|
|
8
|
+
import type { RegisterComponentsAction, ToolbarPluginOptions } from './types';
|
|
9
9
|
export type ToolbarPlugin = NextEditorPlugin<'toolbar', {
|
|
10
10
|
actions: {
|
|
11
11
|
getComponents: () => Array<RegisterComponent>;
|
|
12
|
-
registerComponents:
|
|
12
|
+
registerComponents: RegisterComponentsAction;
|
|
13
13
|
};
|
|
14
14
|
dependencies: [
|
|
15
15
|
OptionalPlugin<UserIntentPlugin>,
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
+
import type { RegisterComponent } from '@atlaskit/editor-toolbar-model';
|
|
1
2
|
export type ToolbarPluginOptions = {
|
|
2
3
|
disableSelectionToolbar?: boolean;
|
|
3
4
|
disableSelectionToolbarWhenPinned?: boolean;
|
|
4
5
|
};
|
|
6
|
+
export type RegisterComponentsAction = (toolbarComponents: Array<RegisterComponent>, replaceItems?: boolean) => void;
|
|
@@ -5,11 +5,11 @@ import type { SelectionPlugin } from '@atlaskit/editor-plugin-selection';
|
|
|
5
5
|
import type { UserIntentPlugin } from '@atlaskit/editor-plugin-user-intent';
|
|
6
6
|
import type { UserPreferencesPlugin } from '@atlaskit/editor-plugin-user-preferences';
|
|
7
7
|
import type { RegisterComponent } from '@atlaskit/editor-toolbar-model';
|
|
8
|
-
import type { ToolbarPluginOptions } from './types';
|
|
8
|
+
import type { RegisterComponentsAction, ToolbarPluginOptions } from './types';
|
|
9
9
|
export type ToolbarPlugin = NextEditorPlugin<'toolbar', {
|
|
10
10
|
actions: {
|
|
11
11
|
getComponents: () => Array<RegisterComponent>;
|
|
12
|
-
registerComponents:
|
|
12
|
+
registerComponents: RegisterComponentsAction;
|
|
13
13
|
};
|
|
14
14
|
dependencies: [
|
|
15
15
|
OptionalPlugin<UserIntentPlugin>,
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
+
import type { RegisterComponent } from '@atlaskit/editor-toolbar-model';
|
|
1
2
|
export type ToolbarPluginOptions = {
|
|
2
3
|
disableSelectionToolbar?: boolean;
|
|
3
4
|
disableSelectionToolbarWhenPinned?: boolean;
|
|
4
5
|
};
|
|
6
|
+
export type RegisterComponentsAction = (toolbarComponents: Array<RegisterComponent>, replaceItems?: boolean) => void;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-toolbar",
|
|
3
|
-
"version": "1.0
|
|
3
|
+
"version": "1.1.0",
|
|
4
4
|
"description": "Toolbar plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -34,15 +34,15 @@
|
|
|
34
34
|
"@atlaskit/editor-plugin-user-intent": "^2.0.0",
|
|
35
35
|
"@atlaskit/editor-plugin-user-preferences": "^2.0.0",
|
|
36
36
|
"@atlaskit/editor-prosemirror": "7.0.0",
|
|
37
|
-
"@atlaskit/editor-toolbar": "^0.
|
|
37
|
+
"@atlaskit/editor-toolbar": "^0.7.0",
|
|
38
38
|
"@atlaskit/editor-toolbar-model": "^0.2.0",
|
|
39
|
-
"@atlaskit/tmp-editor-statsig": "^12.
|
|
39
|
+
"@atlaskit/tmp-editor-statsig": "^12.2.0",
|
|
40
40
|
"@babel/runtime": "^7.0.0",
|
|
41
41
|
"bind-event-listener": "^3.0.0",
|
|
42
42
|
"react-intl-next": "npm:react-intl@^5.18.1"
|
|
43
43
|
},
|
|
44
44
|
"peerDependencies": {
|
|
45
|
-
"@atlaskit/editor-common": "^108.
|
|
45
|
+
"@atlaskit/editor-common": "^108.1.0",
|
|
46
46
|
"react": "^18.2.0"
|
|
47
47
|
},
|
|
48
48
|
"techstack": {
|