@atlaskit/forge-react-types 0.40.0 → 0.41.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 +14 -0
- package/dist/cjs/components/__generated__/ChromelessEditorProps.codegen.js +5 -0
- package/dist/cjs/components/__generated__/CommentEditorProps.codegen.js +5 -0
- package/dist/cjs/components/__generated__/types.codegen.js +5 -1
- package/dist/es2019/components/__generated__/ChromelessEditorProps.codegen.js +1 -0
- package/dist/es2019/components/__generated__/CommentEditorProps.codegen.js +1 -0
- package/dist/es2019/components/__generated__/types.codegen.js +1 -0
- package/dist/esm/components/__generated__/ChromelessEditorProps.codegen.js +1 -0
- package/dist/esm/components/__generated__/CommentEditorProps.codegen.js +1 -0
- package/dist/esm/components/__generated__/types.codegen.js +1 -0
- package/dist/types/components/__generated__/types.codegen.d.ts +57 -3
- package/dist/types-ts4.5/components/__generated__/types.codegen.d.ts +57 -3
- package/package.json +33 -32
- package/scripts/codegen/componentPropTypes.ts +2 -1
- package/src/components/__generated__/ChromelessEditorProps.codegen.tsx +21 -0
- package/src/components/__generated__/CommentEditorProps.codegen.tsx +31 -0
- package/src/components/__generated__/types.codegen.ts +64 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# @atlaskit/forge-react-types
|
|
2
2
|
|
|
3
|
+
## 0.41.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#129564](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/129564)
|
|
8
|
+
[`803baa6281f4d`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/803baa6281f4d) -
|
|
9
|
+
Add Editor component
|
|
10
|
+
|
|
11
|
+
## 0.40.1
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- Updated dependencies
|
|
16
|
+
|
|
3
17
|
## 0.40.0
|
|
4
18
|
|
|
5
19
|
### Minor Changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* THIS FILE WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
|
|
3
3
|
*
|
|
4
|
-
* Shared types file
|
|
4
|
+
* Shared types file for UI Kit components. Add shared types to `packages/forge/forge-ui/src/components/UIKit/types.ts` for it to be code generated here and imported correctly into prop type files
|
|
5
5
|
*
|
|
6
|
-
* @codegen <<SignedSource::
|
|
6
|
+
* @codegen <<SignedSource::7534fd56d0755471bbb511d02af85755>>
|
|
7
7
|
* @codegenCommand yarn workspace @atlaskit/forge-react-types codegen
|
|
8
|
-
* @codegenDependency ../../../../forge-ui/src/components/UIKit/types.ts <<SignedSource::
|
|
8
|
+
* @codegenDependency ../../../../forge-ui/src/components/UIKit/types.ts <<SignedSource::8e94b178979d70c4e88516b6704efa32>>
|
|
9
9
|
*/
|
|
10
|
+
import type { JSONDocNode } from '@atlaskit/editor-json-transformer';
|
|
10
11
|
export type SerialisableEvent = {
|
|
11
12
|
bubbles: boolean;
|
|
12
13
|
cancelable: boolean;
|
|
@@ -32,3 +33,56 @@ export type EventHandlerProps = {
|
|
|
32
33
|
onBlur?: (event: InputEvent) => void;
|
|
33
34
|
onFocus?: (event: InputEvent) => void;
|
|
34
35
|
};
|
|
36
|
+
export type Appearance = 'comment' | 'chromeless';
|
|
37
|
+
export type Features = {
|
|
38
|
+
/**
|
|
39
|
+
* Enables text to be different heading levels or in quote blocks.
|
|
40
|
+
*/
|
|
41
|
+
blockType?: boolean;
|
|
42
|
+
/**
|
|
43
|
+
* Enables stylistic formatting on text. This allows text to be set to bold, italic, underline, strikethrough code, subscript and superscript.
|
|
44
|
+
*/
|
|
45
|
+
textFormatting?: boolean;
|
|
46
|
+
/**
|
|
47
|
+
* Enables ordered and unordered lists.
|
|
48
|
+
*/
|
|
49
|
+
list?: boolean;
|
|
50
|
+
/**
|
|
51
|
+
* Enables toolbar items for link, codeblock and quote block.
|
|
52
|
+
*/
|
|
53
|
+
insertBlock?: boolean;
|
|
54
|
+
/**
|
|
55
|
+
* Enables color on text.
|
|
56
|
+
*/
|
|
57
|
+
textColor?: boolean;
|
|
58
|
+
/**
|
|
59
|
+
* Enables links to become hyperlink.
|
|
60
|
+
*/
|
|
61
|
+
hyperLink?: boolean;
|
|
62
|
+
/**
|
|
63
|
+
* Enables the quick insert menu. Type '/' to open the menu in the editor.
|
|
64
|
+
*/
|
|
65
|
+
quickInsert?: boolean;
|
|
66
|
+
/**
|
|
67
|
+
* Enables text to be placed in a code block.
|
|
68
|
+
*/
|
|
69
|
+
codeBlock?: boolean;
|
|
70
|
+
};
|
|
71
|
+
export type EditorProps = {
|
|
72
|
+
/**
|
|
73
|
+
* Handler called when the inputs value changes.
|
|
74
|
+
*/
|
|
75
|
+
onChange?: (value?: JSONDocNode) => void;
|
|
76
|
+
/**
|
|
77
|
+
* Set the default editor content.
|
|
78
|
+
*/
|
|
79
|
+
defaultValue?: JSONDocNode;
|
|
80
|
+
/**
|
|
81
|
+
* Set allowed features in the editor.
|
|
82
|
+
*/
|
|
83
|
+
features?: Features;
|
|
84
|
+
/**
|
|
85
|
+
* Set if the editor should be disabled
|
|
86
|
+
*/
|
|
87
|
+
isDisabled?: boolean;
|
|
88
|
+
};
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* THIS FILE WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
|
|
3
3
|
*
|
|
4
|
-
* Shared types file
|
|
4
|
+
* Shared types file for UI Kit components. Add shared types to `packages/forge/forge-ui/src/components/UIKit/types.ts` for it to be code generated here and imported correctly into prop type files
|
|
5
5
|
*
|
|
6
|
-
* @codegen <<SignedSource::
|
|
6
|
+
* @codegen <<SignedSource::7534fd56d0755471bbb511d02af85755>>
|
|
7
7
|
* @codegenCommand yarn workspace @atlaskit/forge-react-types codegen
|
|
8
|
-
* @codegenDependency ../../../../forge-ui/src/components/UIKit/types.ts <<SignedSource::
|
|
8
|
+
* @codegenDependency ../../../../forge-ui/src/components/UIKit/types.ts <<SignedSource::8e94b178979d70c4e88516b6704efa32>>
|
|
9
9
|
*/
|
|
10
|
+
import type { JSONDocNode } from '@atlaskit/editor-json-transformer';
|
|
10
11
|
export type SerialisableEvent = {
|
|
11
12
|
bubbles: boolean;
|
|
12
13
|
cancelable: boolean;
|
|
@@ -32,3 +33,56 @@ export type EventHandlerProps = {
|
|
|
32
33
|
onBlur?: (event: InputEvent) => void;
|
|
33
34
|
onFocus?: (event: InputEvent) => void;
|
|
34
35
|
};
|
|
36
|
+
export type Appearance = 'comment' | 'chromeless';
|
|
37
|
+
export type Features = {
|
|
38
|
+
/**
|
|
39
|
+
* Enables text to be different heading levels or in quote blocks.
|
|
40
|
+
*/
|
|
41
|
+
blockType?: boolean;
|
|
42
|
+
/**
|
|
43
|
+
* Enables stylistic formatting on text. This allows text to be set to bold, italic, underline, strikethrough code, subscript and superscript.
|
|
44
|
+
*/
|
|
45
|
+
textFormatting?: boolean;
|
|
46
|
+
/**
|
|
47
|
+
* Enables ordered and unordered lists.
|
|
48
|
+
*/
|
|
49
|
+
list?: boolean;
|
|
50
|
+
/**
|
|
51
|
+
* Enables toolbar items for link, codeblock and quote block.
|
|
52
|
+
*/
|
|
53
|
+
insertBlock?: boolean;
|
|
54
|
+
/**
|
|
55
|
+
* Enables color on text.
|
|
56
|
+
*/
|
|
57
|
+
textColor?: boolean;
|
|
58
|
+
/**
|
|
59
|
+
* Enables links to become hyperlink.
|
|
60
|
+
*/
|
|
61
|
+
hyperLink?: boolean;
|
|
62
|
+
/**
|
|
63
|
+
* Enables the quick insert menu. Type '/' to open the menu in the editor.
|
|
64
|
+
*/
|
|
65
|
+
quickInsert?: boolean;
|
|
66
|
+
/**
|
|
67
|
+
* Enables text to be placed in a code block.
|
|
68
|
+
*/
|
|
69
|
+
codeBlock?: boolean;
|
|
70
|
+
};
|
|
71
|
+
export type EditorProps = {
|
|
72
|
+
/**
|
|
73
|
+
* Handler called when the inputs value changes.
|
|
74
|
+
*/
|
|
75
|
+
onChange?: (value?: JSONDocNode) => void;
|
|
76
|
+
/**
|
|
77
|
+
* Set the default editor content.
|
|
78
|
+
*/
|
|
79
|
+
defaultValue?: JSONDocNode;
|
|
80
|
+
/**
|
|
81
|
+
* Set allowed features in the editor.
|
|
82
|
+
*/
|
|
83
|
+
features?: Features;
|
|
84
|
+
/**
|
|
85
|
+
* Set if the editor should be disabled
|
|
86
|
+
*/
|
|
87
|
+
isDisabled?: boolean;
|
|
88
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/forge-react-types",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.41.0",
|
|
4
4
|
"description": "Component types for Forge UI Kit React components",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -24,38 +24,39 @@
|
|
|
24
24
|
"team": "Forge UI"
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@atlaskit/badge": "
|
|
28
|
-
"@atlaskit/button": "
|
|
29
|
-
"@atlaskit/calendar": "
|
|
30
|
-
"@atlaskit/checkbox": "
|
|
31
|
-
"@atlaskit/code": "
|
|
27
|
+
"@atlaskit/badge": "18.1.1",
|
|
28
|
+
"@atlaskit/button": "23.0.0",
|
|
29
|
+
"@atlaskit/calendar": "17.1.5",
|
|
30
|
+
"@atlaskit/checkbox": "17.0.4",
|
|
31
|
+
"@atlaskit/code": "16.1.0",
|
|
32
32
|
"@atlaskit/comment": "^13.0.0",
|
|
33
|
-
"@atlaskit/datetime-picker": "
|
|
34
|
-
"@atlaskit/dynamic-table": "
|
|
35
|
-
"@atlaskit/
|
|
36
|
-
"@atlaskit/
|
|
37
|
-
"@atlaskit/
|
|
38
|
-
"@atlaskit/
|
|
39
|
-
"@atlaskit/
|
|
40
|
-
"@atlaskit/
|
|
41
|
-
"@atlaskit/
|
|
42
|
-
"@atlaskit/
|
|
43
|
-
"@atlaskit/
|
|
44
|
-
"@atlaskit/progress-
|
|
45
|
-
"@atlaskit/
|
|
46
|
-
"@atlaskit/
|
|
47
|
-
"@atlaskit/
|
|
48
|
-
"@atlaskit/
|
|
49
|
-
"@atlaskit/
|
|
50
|
-
"@atlaskit/
|
|
51
|
-
"@atlaskit/
|
|
52
|
-
"@atlaskit/
|
|
53
|
-
"@atlaskit/tag
|
|
54
|
-
"@atlaskit/
|
|
55
|
-
"@atlaskit/
|
|
56
|
-
"@atlaskit/
|
|
57
|
-
"@atlaskit/
|
|
58
|
-
"@atlaskit/
|
|
33
|
+
"@atlaskit/datetime-picker": "16.2.3",
|
|
34
|
+
"@atlaskit/dynamic-table": "18.0.4",
|
|
35
|
+
"@atlaskit/editor-json-transformer": "8.24.0",
|
|
36
|
+
"@atlaskit/empty-state": "9.0.5",
|
|
37
|
+
"@atlaskit/form": "12.0.3",
|
|
38
|
+
"@atlaskit/heading": "5.1.1",
|
|
39
|
+
"@atlaskit/inline-edit": "15.1.4",
|
|
40
|
+
"@atlaskit/lozenge": "12.2.2",
|
|
41
|
+
"@atlaskit/modal-dialog": "14.1.0",
|
|
42
|
+
"@atlaskit/popup": "3.0.1",
|
|
43
|
+
"@atlaskit/primitives": "14.2.3",
|
|
44
|
+
"@atlaskit/progress-bar": "4.0.4",
|
|
45
|
+
"@atlaskit/progress-tracker": "10.0.3",
|
|
46
|
+
"@atlaskit/radio": "8.0.3",
|
|
47
|
+
"@atlaskit/range": "9.0.3",
|
|
48
|
+
"@atlaskit/renderer": "114.7.1",
|
|
49
|
+
"@atlaskit/section-message": "8.2.2",
|
|
50
|
+
"@atlaskit/select": "20.0.8",
|
|
51
|
+
"@atlaskit/spinner": "18.0.3",
|
|
52
|
+
"@atlaskit/tabs": "18.0.3",
|
|
53
|
+
"@atlaskit/tag": "14.0.7",
|
|
54
|
+
"@atlaskit/tag-group": "12.0.2",
|
|
55
|
+
"@atlaskit/textarea": "8.0.3",
|
|
56
|
+
"@atlaskit/textfield": "8.0.4",
|
|
57
|
+
"@atlaskit/toggle": "15.0.4",
|
|
58
|
+
"@atlaskit/tokens": "4.5.2",
|
|
59
|
+
"@atlaskit/tooltip": "20.0.5",
|
|
59
60
|
"@babel/runtime": "^7.0.0"
|
|
60
61
|
},
|
|
61
62
|
"peerDependencies": {
|
|
@@ -178,7 +178,8 @@ const generateSharedTypesFile = (componentOutputDir: string) => {
|
|
|
178
178
|
fs.readFileSync(uiKit2TypesFile, 'utf8'),
|
|
179
179
|
'yarn workspace @atlaskit/forge-react-types codegen',
|
|
180
180
|
{
|
|
181
|
-
description:
|
|
181
|
+
description:
|
|
182
|
+
'Shared types file for UI Kit components. Add shared types to `packages/forge/forge-ui/src/components/UIKit/types.ts` for it to be code generated here and imported correctly into prop type files',
|
|
182
183
|
dependencies: [uiKit2TypesFile],
|
|
183
184
|
outputFolder: componentOutputDir,
|
|
184
185
|
},
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* THIS FILE WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
|
|
3
|
+
*
|
|
4
|
+
* Extract component prop types from UIKit 2 components - ChromelessEditorProps
|
|
5
|
+
*
|
|
6
|
+
* @codegen <<SignedSource::04d9931dadacdce6d3bc5506646d3402>>
|
|
7
|
+
* @codegenCommand yarn workspace @atlaskit/forge-react-types codegen
|
|
8
|
+
* @codegenDependency ../../../../forge-ui/src/components/UIKit/editor/chromeless-editor/index.tsx <<SignedSource::acc04099c3230f374e4e22e03d443e0e>>
|
|
9
|
+
*/
|
|
10
|
+
/* eslint @repo/internal/codegen/signed-source-integrity: "warn" */
|
|
11
|
+
|
|
12
|
+
import type { EditorProps } from './types.codegen';
|
|
13
|
+
|
|
14
|
+
export type ChromelessEditorProps = EditorProps;
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* The chromeless editor provides the Editor without any of the standard UI features. It's ideal for cases where the integrator wants complete control and responsibility over the editor UI.
|
|
18
|
+
*
|
|
19
|
+
* @see [ChromelessEditor](https://developer.atlassian.com/platform/forge/ui-kit/components/chromeless-editor/) in UI Kit documentation for more information
|
|
20
|
+
*/
|
|
21
|
+
export type TChromelessEditor<T> = (props: ChromelessEditorProps) => T;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* THIS FILE WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
|
|
3
|
+
*
|
|
4
|
+
* Extract component prop types from UIKit 2 components - CommentEditorProps
|
|
5
|
+
*
|
|
6
|
+
* @codegen <<SignedSource::7feb6d6879f66c9163e6e50b187fad98>>
|
|
7
|
+
* @codegenCommand yarn workspace @atlaskit/forge-react-types codegen
|
|
8
|
+
* @codegenDependency ../../../../forge-ui/src/components/UIKit/editor/comment-editor/index.tsx <<SignedSource::64840977063c8586939cff78dea5b19a>>
|
|
9
|
+
*/
|
|
10
|
+
/* eslint @repo/internal/codegen/signed-source-integrity: "warn" */
|
|
11
|
+
|
|
12
|
+
import type { JSONDocNode } from '@atlaskit/editor-json-transformer';
|
|
13
|
+
import type { EditorProps } from './types.codegen';
|
|
14
|
+
|
|
15
|
+
export type CommentEditorProps = EditorProps & {
|
|
16
|
+
/**
|
|
17
|
+
* Renders a Save button at the bottom of the editor. Handler is called when this button is clicked.
|
|
18
|
+
*/
|
|
19
|
+
onSave?: (value?: JSONDocNode) => void;
|
|
20
|
+
/**
|
|
21
|
+
* Renders a Cancel button at the bottom of the editor. Handler is called when this button is clicked.
|
|
22
|
+
*/
|
|
23
|
+
onCancel?: () => void;
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* The comment editor provides a contained editor UI with a simple toolbar.
|
|
28
|
+
*
|
|
29
|
+
* @see [CommentEditor](https://developer.atlassian.com/platform/forge/ui-kit/components/comment-editor/) in UI Kit documentation for more information
|
|
30
|
+
*/
|
|
31
|
+
export type TCommentEditor<T> = (props: CommentEditorProps) => T;
|
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* THIS FILE WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
|
|
3
3
|
*
|
|
4
|
-
* Shared types file
|
|
4
|
+
* Shared types file for UI Kit components. Add shared types to `packages/forge/forge-ui/src/components/UIKit/types.ts` for it to be code generated here and imported correctly into prop type files
|
|
5
5
|
*
|
|
6
|
-
* @codegen <<SignedSource::
|
|
6
|
+
* @codegen <<SignedSource::7534fd56d0755471bbb511d02af85755>>
|
|
7
7
|
* @codegenCommand yarn workspace @atlaskit/forge-react-types codegen
|
|
8
|
-
* @codegenDependency ../../../../forge-ui/src/components/UIKit/types.ts <<SignedSource::
|
|
8
|
+
* @codegenDependency ../../../../forge-ui/src/components/UIKit/types.ts <<SignedSource::8e94b178979d70c4e88516b6704efa32>>
|
|
9
9
|
*/
|
|
10
|
+
import type { JSONDocNode } from '@atlaskit/editor-json-transformer';
|
|
11
|
+
|
|
12
|
+
// ---- Types for Form components
|
|
10
13
|
export type SerialisableEvent = {
|
|
11
14
|
bubbles: boolean;
|
|
12
15
|
cancelable: boolean;
|
|
@@ -34,3 +37,61 @@ export type EventHandlerProps = {
|
|
|
34
37
|
onBlur?: (event: InputEvent) => void;
|
|
35
38
|
onFocus?: (event: InputEvent) => void;
|
|
36
39
|
};
|
|
40
|
+
|
|
41
|
+
// ----- Types for Editor component
|
|
42
|
+
export type Appearance = 'comment' | 'chromeless';
|
|
43
|
+
|
|
44
|
+
export type Features = {
|
|
45
|
+
/**
|
|
46
|
+
* Enables text to be different heading levels or in quote blocks.
|
|
47
|
+
*/
|
|
48
|
+
blockType?: boolean;
|
|
49
|
+
/**
|
|
50
|
+
* Enables stylistic formatting on text. This allows text to be set to bold, italic, underline, strikethrough code, subscript and superscript.
|
|
51
|
+
*/
|
|
52
|
+
textFormatting?: boolean;
|
|
53
|
+
/**
|
|
54
|
+
* Enables ordered and unordered lists.
|
|
55
|
+
*/
|
|
56
|
+
list?: boolean;
|
|
57
|
+
/**
|
|
58
|
+
* Enables toolbar items for link, codeblock and quote block.
|
|
59
|
+
*/
|
|
60
|
+
insertBlock?: boolean;
|
|
61
|
+
/**
|
|
62
|
+
* Enables color on text.
|
|
63
|
+
*/
|
|
64
|
+
textColor?: boolean;
|
|
65
|
+
/**
|
|
66
|
+
* Enables links to become hyperlink.
|
|
67
|
+
*/
|
|
68
|
+
hyperLink?: boolean;
|
|
69
|
+
/**
|
|
70
|
+
* Enables the quick insert menu. Type '/' to open the menu in the editor.
|
|
71
|
+
*/
|
|
72
|
+
quickInsert?: boolean;
|
|
73
|
+
/**
|
|
74
|
+
* Enables text to be placed in a code block.
|
|
75
|
+
*/
|
|
76
|
+
codeBlock?: boolean;
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
export type EditorProps = {
|
|
80
|
+
/**
|
|
81
|
+
* Handler called when the inputs value changes.
|
|
82
|
+
*/
|
|
83
|
+
onChange?: (value?: JSONDocNode) => void;
|
|
84
|
+
/**
|
|
85
|
+
* Set the default editor content.
|
|
86
|
+
*/
|
|
87
|
+
defaultValue?: JSONDocNode;
|
|
88
|
+
/**
|
|
89
|
+
* Set allowed features in the editor.
|
|
90
|
+
*/
|
|
91
|
+
features?: Features;
|
|
92
|
+
/**
|
|
93
|
+
* Set if the editor should be disabled
|
|
94
|
+
*/
|
|
95
|
+
isDisabled?: boolean;
|
|
96
|
+
};
|
|
97
|
+
// ------
|