@atlaskit/editor-toolbar-model 0.5.22 → 1.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 +32 -0
- package/create-registry/package.json +1 -8
- package/package.json +4 -12
- package/toolbar-model-renderer/package.json +1 -8
- package/types/package.json +1 -8
- package/dist/types-ts4.5/create-registry.d.ts +0 -37
- package/dist/types-ts4.5/entry-points/create-registry.d.ts +0 -1
- package/dist/types-ts4.5/entry-points/toolbar-model-renderer.d.ts +0 -1
- package/dist/types-ts4.5/entry-points/types.d.ts +0 -1
- package/dist/types-ts4.5/index.d.ts +0 -3
- package/dist/types-ts4.5/types/index.d.ts +0 -99
- package/dist/types-ts4.5/ui/toolbar-model-renderer/common.d.ts +0 -9
- package/dist/types-ts4.5/ui/toolbar-model-renderer/index.d.ts +0 -3
- package/dist/types-ts4.5/ui/toolbar-model-renderer/types.d.ts +0 -19
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,37 @@
|
|
|
1
1
|
# @atlaskit/editor-toolbar-model
|
|
2
2
|
|
|
3
|
+
## 1.0.0
|
|
4
|
+
|
|
5
|
+
### Major Changes
|
|
6
|
+
|
|
7
|
+
- [`f2dc9097319f0`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/f2dc9097319f0) - ###
|
|
8
|
+
Dropped support for _legacy_ Typescript 4 types. **Typescript 5 is now the new minimum**.
|
|
9
|
+
|
|
10
|
+
Removes the `typesVersions` property and `dist/types-ts4.5` directory from the dist.
|
|
11
|
+
|
|
12
|
+
Types are now exclusively via the `"types": "dist/types/index.d.ts"` property.
|
|
13
|
+
|
|
14
|
+
```diff
|
|
15
|
+
- "typesVersions": {
|
|
16
|
+
- ">=4.5 <4.9": {
|
|
17
|
+
- "*": [
|
|
18
|
+
- "dist/types-ts4.5/*",
|
|
19
|
+
- "dist/types-ts4.5/index.d.ts"
|
|
20
|
+
- ]
|
|
21
|
+
- }
|
|
22
|
+
- },
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
### Patch Changes
|
|
26
|
+
|
|
27
|
+
- Updated dependencies
|
|
28
|
+
|
|
29
|
+
## 0.5.23
|
|
30
|
+
|
|
31
|
+
### Patch Changes
|
|
32
|
+
|
|
33
|
+
- Updated dependencies
|
|
34
|
+
|
|
3
35
|
## 0.5.22
|
|
4
36
|
|
|
5
37
|
### Patch Changes
|
|
@@ -6,12 +6,5 @@
|
|
|
6
6
|
"sideEffects": [
|
|
7
7
|
"*.compiled.css"
|
|
8
8
|
],
|
|
9
|
-
"types": "../dist/types/entry-points/create-registry.d.ts"
|
|
10
|
-
"typesVersions": {
|
|
11
|
-
">=4.5 <5.9": {
|
|
12
|
-
"*": [
|
|
13
|
-
"../dist/types-ts4.5/entry-points/create-registry.d.ts"
|
|
14
|
-
]
|
|
15
|
-
}
|
|
16
|
-
}
|
|
9
|
+
"types": "../dist/types/entry-points/create-registry.d.ts"
|
|
17
10
|
}
|
package/package.json
CHANGED
|
@@ -15,21 +15,13 @@
|
|
|
15
15
|
"module": "dist/esm/index.js",
|
|
16
16
|
"module:es2019": "dist/es2019/index.js",
|
|
17
17
|
"types": "dist/types/index.d.ts",
|
|
18
|
-
"typesVersions": {
|
|
19
|
-
">=4.5 <5.4": {
|
|
20
|
-
"*": [
|
|
21
|
-
"dist/types-ts4.5/*",
|
|
22
|
-
"dist/types-ts4.5/index.d.ts"
|
|
23
|
-
]
|
|
24
|
-
}
|
|
25
|
-
},
|
|
26
18
|
"sideEffects": [
|
|
27
19
|
"*.compiled.css"
|
|
28
20
|
],
|
|
29
21
|
"atlaskit:src": "src/index.ts",
|
|
30
22
|
"dependencies": {
|
|
31
|
-
"@atlaskit/tmp-editor-statsig": "^
|
|
32
|
-
"@atlaskit/tokens": "^
|
|
23
|
+
"@atlaskit/tmp-editor-statsig": "^104.0.0",
|
|
24
|
+
"@atlaskit/tokens": "^14.0.0",
|
|
33
25
|
"@babel/runtime": "^7.0.0",
|
|
34
26
|
"@compiled/react": "^0.20.0"
|
|
35
27
|
},
|
|
@@ -37,7 +29,7 @@
|
|
|
37
29
|
"react": "^18.2.0"
|
|
38
30
|
},
|
|
39
31
|
"devDependencies": {
|
|
40
|
-
"@atlaskit/editor-toolbar": "^
|
|
32
|
+
"@atlaskit/editor-toolbar": "^2.0.0",
|
|
41
33
|
"@atlassian/react-compiler-gating": "workspace:^",
|
|
42
34
|
"@testing-library/react": "^16.3.0",
|
|
43
35
|
"react": "^18.2.0",
|
|
@@ -79,7 +71,7 @@
|
|
|
79
71
|
}
|
|
80
72
|
},
|
|
81
73
|
"name": "@atlaskit/editor-toolbar-model",
|
|
82
|
-
"version": "0.
|
|
74
|
+
"version": "1.0.0",
|
|
83
75
|
"description": "register and render toolbar component",
|
|
84
76
|
"author": "Atlassian Pty Ltd",
|
|
85
77
|
"license": "Apache-2.0",
|
|
@@ -6,12 +6,5 @@
|
|
|
6
6
|
"sideEffects": [
|
|
7
7
|
"*.compiled.css"
|
|
8
8
|
],
|
|
9
|
-
"types": "../dist/types/entry-points/toolbar-model-renderer.d.ts"
|
|
10
|
-
"typesVersions": {
|
|
11
|
-
">=4.5 <5.9": {
|
|
12
|
-
"*": [
|
|
13
|
-
"../dist/types-ts4.5/entry-points/toolbar-model-renderer.d.ts"
|
|
14
|
-
]
|
|
15
|
-
}
|
|
16
|
-
}
|
|
9
|
+
"types": "../dist/types/entry-points/toolbar-model-renderer.d.ts"
|
|
17
10
|
}
|
package/types/package.json
CHANGED
|
@@ -6,12 +6,5 @@
|
|
|
6
6
|
"sideEffects": [
|
|
7
7
|
"*.compiled.css"
|
|
8
8
|
],
|
|
9
|
-
"types": "../dist/types/entry-points/types.d.ts"
|
|
10
|
-
"typesVersions": {
|
|
11
|
-
">=4.5 <5.9": {
|
|
12
|
-
"*": [
|
|
13
|
-
"../dist/types-ts4.5/entry-points/types.d.ts"
|
|
14
|
-
]
|
|
15
|
-
}
|
|
16
|
-
}
|
|
9
|
+
"types": "../dist/types/entry-points/types.d.ts"
|
|
17
10
|
}
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import type { RegisterComponent } from './types';
|
|
2
|
-
/**
|
|
3
|
-
* Create a simple registry for toolbar components.
|
|
4
|
-
*
|
|
5
|
-
* @returns A registry object with a `register` method and a `components` array.
|
|
6
|
-
*
|
|
7
|
-
* @example
|
|
8
|
-
* ```ts
|
|
9
|
-
* const registry = createToolbarRegistry();
|
|
10
|
-
*
|
|
11
|
-
* registry.register([
|
|
12
|
-
* {
|
|
13
|
-
* type: 'toolbar',
|
|
14
|
-
* key: 'primary-toolbar',
|
|
15
|
-
* component: ({ children }) => <div>{children}</div>,
|
|
16
|
-
* },
|
|
17
|
-
* {
|
|
18
|
-
* type: 'section',
|
|
19
|
-
* key: 'section-1',
|
|
20
|
-
* rank: 1,
|
|
21
|
-
* parents: [{ type: 'toolbar', key: 'primary-toolbar' }],
|
|
22
|
-
* component: ({ children }) => <div>{children}</div>,
|
|
23
|
-
* },
|
|
24
|
-
* {
|
|
25
|
-
* type: 'group',
|
|
26
|
-
* key: 'group-1',
|
|
27
|
-
* rank: 1,
|
|
28
|
-
* parents: [{ type: 'section', key: 'section-1' }],
|
|
29
|
-
* component: ({ children }) => <div>{children}</div>,
|
|
30
|
-
* },
|
|
31
|
-
* ]);
|
|
32
|
-
*/
|
|
33
|
-
export declare const createComponentRegistry: () => {
|
|
34
|
-
register: (newComponents: RegisterComponent[]) => void;
|
|
35
|
-
safeRegister: (newComponents: RegisterComponent[]) => void;
|
|
36
|
-
components: RegisterComponent[];
|
|
37
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { createComponentRegistry } from '../create-registry';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { ToolbarModelRenderer } from '../ui/toolbar-model-renderer/index';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export type { ToolbarComponentType, ToolbarComponentTypes, CommonComponentProps, ToolbarType, ToolbarMenuComponent, ToolbarButtonComponent, ToolbarMenuItemComponent, ToolbarGroupComponent, RegisterToolbar, RegisterToolbarSection, RegisterToolbarGroup, RegisterToolbarButton, RegisterToolbarMenu, RegisterToolbarNestedMenu, RegisterToolbarMenuSection, RegisterToolbarMenuItem, RegisterComponent, } from '../types/index';
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
export { ToolbarModelRenderer } from './ui/toolbar-model-renderer';
|
|
2
|
-
export type { ToolbarComponentType, ToolbarComponentTypes, CommonComponentProps, ToolbarType, ToolbarMenuComponent, ToolbarButtonComponent, ToolbarMenuItemComponent, ToolbarGroupComponent, RegisterToolbar, RegisterToolbarSection, RegisterToolbarGroup, RegisterToolbarButton, RegisterToolbarMenu, RegisterToolbarNestedMenu, RegisterToolbarMenuSection, RegisterToolbarMenuItem, RegisterComponent, } from './types';
|
|
3
|
-
export { createComponentRegistry } from './create-registry';
|
|
@@ -1,99 +0,0 @@
|
|
|
1
|
-
type WithRank<T> = T & {
|
|
2
|
-
rank: number;
|
|
3
|
-
};
|
|
4
|
-
type Parents<T> = Array<WithRank<T>>;
|
|
5
|
-
export type ToolbarComponentType = ToolbarType | ToolbarSectionType | ToolbarGroupType | ToolbarButtonType | ToolbarMenuType | ToolbarNestedMenuType | ToolbarMenuSectionType | ToolbarMenuItemType;
|
|
6
|
-
export type ToolbarComponentTypes = Array<ToolbarComponentType>;
|
|
7
|
-
export type CommonComponentProps = {
|
|
8
|
-
/**
|
|
9
|
-
* Array of parent information including both keys and types
|
|
10
|
-
* Ordered from immediate parent to root parent
|
|
11
|
-
*/
|
|
12
|
-
parents: ToolbarComponentTypes;
|
|
13
|
-
};
|
|
14
|
-
export type ToolbarComponent = (props: {
|
|
15
|
-
children: React.ReactNode;
|
|
16
|
-
}) => React.ReactNode;
|
|
17
|
-
export type ToolbarSectionComponent = (props: {
|
|
18
|
-
children: React.ReactNode;
|
|
19
|
-
} & CommonComponentProps) => React.ReactNode;
|
|
20
|
-
export type ToolbarGroupComponent = (props: {
|
|
21
|
-
children: React.ReactNode;
|
|
22
|
-
} & CommonComponentProps) => React.ReactNode;
|
|
23
|
-
export type ToolbarMenuComponent = (props: {
|
|
24
|
-
children: React.ReactNode;
|
|
25
|
-
} & CommonComponentProps) => React.ReactNode;
|
|
26
|
-
export type ToolbarNestedMenuComponent = (props: {
|
|
27
|
-
children: React.ReactNode;
|
|
28
|
-
} & CommonComponentProps) => React.ReactNode;
|
|
29
|
-
export type ToolbarButtonComponent = (props: {} & CommonComponentProps) => React.ReactNode;
|
|
30
|
-
export type ToolbarMenuSectionComponent = (props: {
|
|
31
|
-
children: React.ReactNode;
|
|
32
|
-
} & CommonComponentProps) => React.ReactNode;
|
|
33
|
-
export type ToolbarMenuItemComponent = (props: {} & CommonComponentProps) => React.ReactNode;
|
|
34
|
-
export type ToolbarType = {
|
|
35
|
-
key: string;
|
|
36
|
-
type: 'toolbar';
|
|
37
|
-
};
|
|
38
|
-
type ToolbarSectionType = {
|
|
39
|
-
key: string;
|
|
40
|
-
type: 'section';
|
|
41
|
-
};
|
|
42
|
-
type ToolbarGroupType = {
|
|
43
|
-
key: string;
|
|
44
|
-
type: 'group';
|
|
45
|
-
};
|
|
46
|
-
type ToolbarButtonType = {
|
|
47
|
-
key: string;
|
|
48
|
-
type: 'button';
|
|
49
|
-
};
|
|
50
|
-
type ToolbarMenuItemType = {
|
|
51
|
-
key: string;
|
|
52
|
-
type: 'menu-item';
|
|
53
|
-
};
|
|
54
|
-
type ToolbarMenuSectionType = {
|
|
55
|
-
key: string;
|
|
56
|
-
type: 'menu-section';
|
|
57
|
-
};
|
|
58
|
-
type ToolbarMenuType = {
|
|
59
|
-
key: string;
|
|
60
|
-
type: 'menu';
|
|
61
|
-
};
|
|
62
|
-
type ToolbarNestedMenuType = {
|
|
63
|
-
key: string;
|
|
64
|
-
type: 'nested-menu';
|
|
65
|
-
};
|
|
66
|
-
export type RegisterToolbar = ToolbarType & {
|
|
67
|
-
component?: ToolbarComponent;
|
|
68
|
-
};
|
|
69
|
-
export type RegisterToolbarSection = ToolbarSectionType & {
|
|
70
|
-
component?: ToolbarSectionComponent;
|
|
71
|
-
parents: Parents<ToolbarType>;
|
|
72
|
-
};
|
|
73
|
-
export type RegisterToolbarGroup = ToolbarGroupType & {
|
|
74
|
-
component?: ToolbarGroupComponent;
|
|
75
|
-
parents: Parents<ToolbarSectionType>;
|
|
76
|
-
};
|
|
77
|
-
export type RegisterToolbarButton = ToolbarButtonType & {
|
|
78
|
-
component?: ToolbarButtonComponent;
|
|
79
|
-
parents: Parents<ToolbarGroupType>;
|
|
80
|
-
};
|
|
81
|
-
export type RegisterToolbarMenu = ToolbarMenuType & {
|
|
82
|
-
component?: ToolbarMenuComponent;
|
|
83
|
-
parents: Parents<ToolbarGroupType>;
|
|
84
|
-
};
|
|
85
|
-
export type RegisterToolbarNestedMenu = ToolbarNestedMenuType & {
|
|
86
|
-
component: ToolbarNestedMenuComponent;
|
|
87
|
-
parents: Parents<ToolbarMenuSectionType>;
|
|
88
|
-
};
|
|
89
|
-
export type RegisterToolbarMenuSection = ToolbarMenuSectionType & {
|
|
90
|
-
component?: ToolbarMenuSectionComponent;
|
|
91
|
-
parents: Parents<ToolbarMenuType | ToolbarNestedMenuType>;
|
|
92
|
-
};
|
|
93
|
-
export type RegisterToolbarMenuItem = ToolbarMenuItemType & {
|
|
94
|
-
component?: ToolbarMenuItemComponent;
|
|
95
|
-
isHidden?: () => boolean;
|
|
96
|
-
parents: Parents<ToolbarMenuSectionType>;
|
|
97
|
-
};
|
|
98
|
-
export type RegisterComponent = RegisterToolbar | RegisterToolbarSection | RegisterToolbarGroup | RegisterToolbarButton | RegisterToolbarMenu | RegisterToolbarNestedMenu | RegisterToolbarMenuSection | RegisterToolbarMenuItem;
|
|
99
|
-
export {};
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { RegisterComponent, RegisterToolbarSection } from '../../types';
|
|
2
|
-
export declare const getSortedChildren: <T extends {
|
|
3
|
-
parents: Array<{
|
|
4
|
-
key: string;
|
|
5
|
-
rank: number;
|
|
6
|
-
}>;
|
|
7
|
-
}>(components: T[], parentKey: string) => T[];
|
|
8
|
-
export declare const NoOp: <T extends Record<string, unknown> = Record<string, unknown>>(props: T) => React.ReactNode;
|
|
9
|
-
export declare const isSection: (component: RegisterComponent) => component is RegisterToolbarSection;
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import type { RegisterComponent, RegisterToolbar, ToolbarGroupComponent, ToolbarMenuSectionComponent, ToolbarSectionComponent } from '../../types';
|
|
2
|
-
export type ToolbarProps = {
|
|
3
|
-
/**
|
|
4
|
-
* Every registered toolbar component
|
|
5
|
-
*/
|
|
6
|
-
components: RegisterComponent[];
|
|
7
|
-
/**
|
|
8
|
-
* Fallback components used in rendering
|
|
9
|
-
*/
|
|
10
|
-
fallbacks: {
|
|
11
|
-
group: ToolbarGroupComponent;
|
|
12
|
-
menuSection: ToolbarMenuSectionComponent;
|
|
13
|
-
section: ToolbarSectionComponent;
|
|
14
|
-
};
|
|
15
|
-
/**
|
|
16
|
-
* Toolbar component
|
|
17
|
-
*/
|
|
18
|
-
toolbar: RegisterToolbar;
|
|
19
|
-
};
|