@atlaskit/editor-toolbar-model 0.5.21 → 0.5.23

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,17 @@
1
1
  # @atlaskit/editor-toolbar-model
2
2
 
3
+ ## 0.5.23
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies
8
+
9
+ ## 0.5.22
10
+
11
+ ### Patch Changes
12
+
13
+ - Updated dependencies
14
+
3
15
  ## 0.5.21
4
16
 
5
17
  ### 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
@@ -28,7 +28,7 @@
28
28
  ],
29
29
  "atlaskit:src": "src/index.ts",
30
30
  "dependencies": {
31
- "@atlaskit/tmp-editor-statsig": "^101.0.0",
31
+ "@atlaskit/tmp-editor-statsig": "^103.0.0",
32
32
  "@atlaskit/tokens": "^13.4.0",
33
33
  "@babel/runtime": "^7.0.0",
34
34
  "@compiled/react": "^0.20.0"
@@ -79,7 +79,7 @@
79
79
  }
80
80
  },
81
81
  "name": "@atlaskit/editor-toolbar-model",
82
- "version": "0.5.21",
82
+ "version": "0.5.23",
83
83
  "description": "register and render toolbar component",
84
84
  "author": "Atlassian Pty Ltd",
85
85
  "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
  }
@@ -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,3 +0,0 @@
1
- import React from 'react';
2
- import type { ToolbarProps } from './types';
3
- export declare const ToolbarModelRenderer: ({ toolbar, components, fallbacks, }: ToolbarProps) => React.JSX.Element;
@@ -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
- };