@atlaskit/forge-react-types 0.60.0 → 0.61.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 +7 -0
- package/dist/cjs/components/global/__generated__/GlobalMainProps.codegen.js +5 -0
- package/dist/cjs/components/global/__generated__/GlobalProps.codegen.js +5 -0
- package/dist/cjs/components/global/__generated__/GlobalSidebarProps.codegen.js +5 -1
- package/dist/es2019/components/global/__generated__/GlobalMainProps.codegen.js +1 -0
- package/dist/es2019/components/global/__generated__/GlobalProps.codegen.js +1 -0
- package/dist/es2019/components/global/__generated__/GlobalSidebarProps.codegen.js +1 -0
- package/dist/esm/components/global/__generated__/GlobalMainProps.codegen.js +1 -0
- package/dist/esm/components/global/__generated__/GlobalProps.codegen.js +1 -0
- package/dist/esm/components/global/__generated__/GlobalSidebarProps.codegen.js +1 -0
- package/dist/types/components/global/__generated__/GlobalExpandableMenuItemProps.codegen.d.ts +2 -2
- package/dist/types/components/global/__generated__/GlobalLinkMenuItemProps.codegen.d.ts +2 -2
- package/dist/types/components/global/__generated__/GlobalMainProps.codegen.d.ts +15 -0
- package/dist/types/components/global/__generated__/GlobalProps.codegen.d.ts +18 -0
- package/dist/types/components/global/__generated__/GlobalSidebarProps.codegen.d.ts +9 -4
- package/dist/types/components/global/__generated__/index.d.ts +4 -2
- package/dist/types/index.d.ts +1 -1
- package/dist/types-ts4.5/components/global/__generated__/GlobalExpandableMenuItemProps.codegen.d.ts +2 -2
- package/dist/types-ts4.5/components/global/__generated__/GlobalLinkMenuItemProps.codegen.d.ts +2 -2
- package/dist/types-ts4.5/components/global/__generated__/GlobalMainProps.codegen.d.ts +15 -0
- package/dist/types-ts4.5/components/global/__generated__/GlobalProps.codegen.d.ts +18 -0
- package/dist/types-ts4.5/components/global/__generated__/GlobalSidebarProps.codegen.d.ts +9 -4
- package/dist/types-ts4.5/components/global/__generated__/index.d.ts +4 -2
- package/dist/types-ts4.5/index.d.ts +1 -1
- package/package.json +2 -2
- package/scripts/codegen/globalComponentPropTypes.ts +55 -5
- package/scripts/typechecker.ts +1 -1
- package/src/components/global/__generated__/GlobalExpandableMenuItemProps.codegen.tsx +2 -2
- package/src/components/global/__generated__/GlobalLinkMenuItemProps.codegen.tsx +2 -2
- package/src/components/global/__generated__/GlobalMainProps.codegen.tsx +19 -0
- package/src/components/global/__generated__/GlobalProps.codegen.tsx +22 -0
- package/src/components/global/__generated__/GlobalSidebarProps.codegen.tsx +10 -4
- package/src/components/global/__generated__/index.ts +4 -2
- package/src/index.ts +4 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# @atlaskit/forge-react-types
|
|
2
2
|
|
|
3
|
+
## 0.61.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [`50d654b213b1b`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/50d654b213b1b) -
|
|
8
|
+
Export types for Global, GlobalMain, GlobalSidebar
|
|
9
|
+
|
|
3
10
|
## 0.60.0
|
|
4
11
|
|
|
5
12
|
### 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 {};
|
package/dist/types/components/global/__generated__/GlobalExpandableMenuItemProps.codegen.d.ts
CHANGED
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Generated prop types for Global component - GlobalExpandableMenuItem
|
|
5
5
|
*
|
|
6
|
-
* @codegen <<SignedSource::
|
|
6
|
+
* @codegen <<SignedSource::8f9bf63fd0127b4faa2986b9c9257182>>
|
|
7
7
|
* @codegenCommand yarn workspace @atlaskit/forge-react-types codegen-global
|
|
8
|
-
* @codegenDependency ../../../../../../../services/forge-common-app-gateway/src/types/global-component-props.ts <<SignedSource::
|
|
8
|
+
* @codegenDependency ../../../../../../../services/forge-common-app-gateway/src/types/global-component-props.ts <<SignedSource::ad330a446ee260180d5b510c18b5e1c8>>
|
|
9
9
|
* @codegenDependency ../../../../../../../services/forge-common-app-gateway/src/components/global/Global-ExpandableMenuItem.tsx <<SignedSource::79df02babb605094ae73bdd0c00c7156>>
|
|
10
10
|
*/
|
|
11
11
|
export type GlobalExpandableMenuItemProps = {
|
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Generated prop types for Global component - GlobalLinkMenuItem
|
|
5
5
|
*
|
|
6
|
-
* @codegen <<SignedSource::
|
|
6
|
+
* @codegen <<SignedSource::13f71ea4b4d387e48fef444bd10847f9>>
|
|
7
7
|
* @codegenCommand yarn workspace @atlaskit/forge-react-types codegen-global
|
|
8
|
-
* @codegenDependency ../../../../../../../services/forge-common-app-gateway/src/types/global-component-props.ts <<SignedSource::
|
|
8
|
+
* @codegenDependency ../../../../../../../services/forge-common-app-gateway/src/types/global-component-props.ts <<SignedSource::ad330a446ee260180d5b510c18b5e1c8>>
|
|
9
9
|
* @codegenDependency ../../../../../../../services/forge-common-app-gateway/src/components/global/Global-LinkMenuItem.tsx <<SignedSource::e70effe0d4e0620246252b35abddb112>>
|
|
10
10
|
*/
|
|
11
11
|
export type GlobalLinkMenuItemProps = {
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* THIS FILE WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
|
|
3
|
+
*
|
|
4
|
+
* Generated prop types for Global component - GlobalMain
|
|
5
|
+
*
|
|
6
|
+
* @codegen <<SignedSource::11ea5d4235fb0042c3ba744599576b5a>>
|
|
7
|
+
* @codegenCommand yarn workspace @atlaskit/forge-react-types codegen-global
|
|
8
|
+
* @codegenDependency ../../../../../../../services/forge-common-app-gateway/src/types/global-component-props.ts <<SignedSource::ad330a446ee260180d5b510c18b5e1c8>>
|
|
9
|
+
* @codegenDependency ../../../../../../../services/forge-common-app-gateway/src/components/global/Global-Main.tsx <<SignedSource::425e3fbc0683323fde14fb4bb6bb3abf>>
|
|
10
|
+
*/
|
|
11
|
+
import type React from 'react';
|
|
12
|
+
export type GlobalMainProps = {
|
|
13
|
+
children?: React.ReactElement | React.ReactElement[];
|
|
14
|
+
};
|
|
15
|
+
export type TGlobalMain<T> = (props: GlobalMainProps) => T;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* THIS FILE WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
|
|
3
|
+
*
|
|
4
|
+
* Generated prop types for Global component - Global
|
|
5
|
+
*
|
|
6
|
+
* @codegen <<SignedSource::01c434a8e1088249f55e97bba99aa916>>
|
|
7
|
+
* @codegenCommand yarn workspace @atlaskit/forge-react-types codegen-global
|
|
8
|
+
* @codegenDependency ../../../../../../../services/forge-common-app-gateway/src/types/global-component-props.ts <<SignedSource::ad330a446ee260180d5b510c18b5e1c8>>
|
|
9
|
+
* @codegenDependency ../../../../../../../services/forge-common-app-gateway/src/components/global/Global.tsx <<SignedSource::54502ae221b976e3c4f4849cff6be726>>
|
|
10
|
+
*/
|
|
11
|
+
import type React from 'react';
|
|
12
|
+
export type GlobalProps = {
|
|
13
|
+
/**
|
|
14
|
+
* Accepts Global.Sidebar and Global.Main components as children.
|
|
15
|
+
*/
|
|
16
|
+
children?: React.ReactElement | React.ReactElement[];
|
|
17
|
+
};
|
|
18
|
+
export type TGlobal<T> = (props: GlobalProps) => T;
|
|
@@ -3,16 +3,21 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Generated prop types for Global component - GlobalSidebar
|
|
5
5
|
*
|
|
6
|
-
* @codegen <<SignedSource::
|
|
6
|
+
* @codegen <<SignedSource::79b07a090ede53f7e378c159fed3ac3b>>
|
|
7
7
|
* @codegenCommand yarn workspace @atlaskit/forge-react-types codegen-global
|
|
8
|
-
* @codegenDependency ../../../../../../../services/forge-common-app-gateway/src/types/global-component-props.ts <<SignedSource::
|
|
9
|
-
* @codegenDependency ../../../../../../../services/forge-common-app-gateway/src/components/global/Global-Sidebar.tsx <<SignedSource::
|
|
8
|
+
* @codegenDependency ../../../../../../../services/forge-common-app-gateway/src/types/global-component-props.ts <<SignedSource::ad330a446ee260180d5b510c18b5e1c8>>
|
|
9
|
+
* @codegenDependency ../../../../../../../services/forge-common-app-gateway/src/components/global/Global-Sidebar.tsx <<SignedSource::216e7ba54d02c3e167f084fb05e4018f>>
|
|
10
10
|
*/
|
|
11
|
+
import type React from 'react';
|
|
11
12
|
export type GlobalSidebarProps = {
|
|
12
13
|
/**
|
|
13
14
|
* URL path for the "For You" section in the sidebar.
|
|
14
15
|
* When provided, enables the "For You" navigation item.
|
|
15
16
|
*/
|
|
16
|
-
forYouUrl?: string
|
|
17
|
+
forYouUrl?: string;
|
|
18
|
+
/**
|
|
19
|
+
* Accepts Global.LinkMenuItem and Global.ExpandMenuItem components.
|
|
20
|
+
*/
|
|
21
|
+
children?: React.ReactElement | React.ReactElement[];
|
|
17
22
|
};
|
|
18
23
|
export type TGlobalSidebar<T> = (props: GlobalSidebarProps) => T;
|
|
@@ -3,10 +3,12 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Index file for generated Global component prop types
|
|
5
5
|
*
|
|
6
|
-
* @codegen <<SignedSource::
|
|
6
|
+
* @codegen <<SignedSource::275df2eb411df5669a05d8e4573e519b>>
|
|
7
7
|
* @codegenCommand yarn workspace @atlaskit/forge-react-types codegen-global
|
|
8
|
-
* @codegenDependency ../../../../../../../services/forge-common-app-gateway/src/types/global-component-props.ts <<SignedSource::
|
|
8
|
+
* @codegenDependency ../../../../../../../services/forge-common-app-gateway/src/types/global-component-props.ts <<SignedSource::ad330a446ee260180d5b510c18b5e1c8>>
|
|
9
9
|
*/
|
|
10
|
+
export type { GlobalProps, TGlobal } from './GlobalProps.codegen';
|
|
11
|
+
export type { GlobalMainProps, TGlobalMain } from './GlobalMainProps.codegen';
|
|
10
12
|
export type { GlobalSidebarProps, TGlobalSidebar } from './GlobalSidebarProps.codegen';
|
|
11
13
|
export type { GlobalLinkMenuItemProps, TGlobalLinkMenuItem } from './GlobalLinkMenuItemProps.codegen';
|
|
12
14
|
export type { GlobalExpandableMenuItemProps, TGlobalExpandableMenuItem } from './GlobalExpandableMenuItemProps.codegen';
|
package/dist/types/index.d.ts
CHANGED
|
@@ -3,4 +3,4 @@ export type { BarChartProps, StackBarChartProps, HorizontalStackBarChartProps, H
|
|
|
3
3
|
export type { ChromelessEditorProps, CommentEditorProps, TChromelessEditor, TCommentEditor, } from './components/editor';
|
|
4
4
|
export type { ChartColorTokens } from './types';
|
|
5
5
|
export type { FrameProps } from './components/frame';
|
|
6
|
-
export type { GlobalSidebarProps, TGlobalSidebar, GlobalLinkMenuItemProps, TGlobalLinkMenuItem, GlobalExpandableMenuItemProps, TGlobalExpandableMenuItem, } from './components/global/__generated__';
|
|
6
|
+
export type { GlobalSidebarProps, TGlobalSidebar, GlobalLinkMenuItemProps, TGlobalLinkMenuItem, GlobalExpandableMenuItemProps, TGlobalExpandableMenuItem, GlobalProps, TGlobal, GlobalMainProps, TGlobalMain, } from './components/global/__generated__';
|
package/dist/types-ts4.5/components/global/__generated__/GlobalExpandableMenuItemProps.codegen.d.ts
CHANGED
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Generated prop types for Global component - GlobalExpandableMenuItem
|
|
5
5
|
*
|
|
6
|
-
* @codegen <<SignedSource::
|
|
6
|
+
* @codegen <<SignedSource::8f9bf63fd0127b4faa2986b9c9257182>>
|
|
7
7
|
* @codegenCommand yarn workspace @atlaskit/forge-react-types codegen-global
|
|
8
|
-
* @codegenDependency ../../../../../../../services/forge-common-app-gateway/src/types/global-component-props.ts <<SignedSource::
|
|
8
|
+
* @codegenDependency ../../../../../../../services/forge-common-app-gateway/src/types/global-component-props.ts <<SignedSource::ad330a446ee260180d5b510c18b5e1c8>>
|
|
9
9
|
* @codegenDependency ../../../../../../../services/forge-common-app-gateway/src/components/global/Global-ExpandableMenuItem.tsx <<SignedSource::79df02babb605094ae73bdd0c00c7156>>
|
|
10
10
|
*/
|
|
11
11
|
export type GlobalExpandableMenuItemProps = {
|
package/dist/types-ts4.5/components/global/__generated__/GlobalLinkMenuItemProps.codegen.d.ts
CHANGED
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Generated prop types for Global component - GlobalLinkMenuItem
|
|
5
5
|
*
|
|
6
|
-
* @codegen <<SignedSource::
|
|
6
|
+
* @codegen <<SignedSource::13f71ea4b4d387e48fef444bd10847f9>>
|
|
7
7
|
* @codegenCommand yarn workspace @atlaskit/forge-react-types codegen-global
|
|
8
|
-
* @codegenDependency ../../../../../../../services/forge-common-app-gateway/src/types/global-component-props.ts <<SignedSource::
|
|
8
|
+
* @codegenDependency ../../../../../../../services/forge-common-app-gateway/src/types/global-component-props.ts <<SignedSource::ad330a446ee260180d5b510c18b5e1c8>>
|
|
9
9
|
* @codegenDependency ../../../../../../../services/forge-common-app-gateway/src/components/global/Global-LinkMenuItem.tsx <<SignedSource::e70effe0d4e0620246252b35abddb112>>
|
|
10
10
|
*/
|
|
11
11
|
export type GlobalLinkMenuItemProps = {
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* THIS FILE WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
|
|
3
|
+
*
|
|
4
|
+
* Generated prop types for Global component - GlobalMain
|
|
5
|
+
*
|
|
6
|
+
* @codegen <<SignedSource::11ea5d4235fb0042c3ba744599576b5a>>
|
|
7
|
+
* @codegenCommand yarn workspace @atlaskit/forge-react-types codegen-global
|
|
8
|
+
* @codegenDependency ../../../../../../../services/forge-common-app-gateway/src/types/global-component-props.ts <<SignedSource::ad330a446ee260180d5b510c18b5e1c8>>
|
|
9
|
+
* @codegenDependency ../../../../../../../services/forge-common-app-gateway/src/components/global/Global-Main.tsx <<SignedSource::425e3fbc0683323fde14fb4bb6bb3abf>>
|
|
10
|
+
*/
|
|
11
|
+
import type React from 'react';
|
|
12
|
+
export type GlobalMainProps = {
|
|
13
|
+
children?: React.ReactElement | React.ReactElement[];
|
|
14
|
+
};
|
|
15
|
+
export type TGlobalMain<T> = (props: GlobalMainProps) => T;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* THIS FILE WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
|
|
3
|
+
*
|
|
4
|
+
* Generated prop types for Global component - Global
|
|
5
|
+
*
|
|
6
|
+
* @codegen <<SignedSource::01c434a8e1088249f55e97bba99aa916>>
|
|
7
|
+
* @codegenCommand yarn workspace @atlaskit/forge-react-types codegen-global
|
|
8
|
+
* @codegenDependency ../../../../../../../services/forge-common-app-gateway/src/types/global-component-props.ts <<SignedSource::ad330a446ee260180d5b510c18b5e1c8>>
|
|
9
|
+
* @codegenDependency ../../../../../../../services/forge-common-app-gateway/src/components/global/Global.tsx <<SignedSource::54502ae221b976e3c4f4849cff6be726>>
|
|
10
|
+
*/
|
|
11
|
+
import type React from 'react';
|
|
12
|
+
export type GlobalProps = {
|
|
13
|
+
/**
|
|
14
|
+
* Accepts Global.Sidebar and Global.Main components as children.
|
|
15
|
+
*/
|
|
16
|
+
children?: React.ReactElement | React.ReactElement[];
|
|
17
|
+
};
|
|
18
|
+
export type TGlobal<T> = (props: GlobalProps) => T;
|
|
@@ -3,16 +3,21 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Generated prop types for Global component - GlobalSidebar
|
|
5
5
|
*
|
|
6
|
-
* @codegen <<SignedSource::
|
|
6
|
+
* @codegen <<SignedSource::79b07a090ede53f7e378c159fed3ac3b>>
|
|
7
7
|
* @codegenCommand yarn workspace @atlaskit/forge-react-types codegen-global
|
|
8
|
-
* @codegenDependency ../../../../../../../services/forge-common-app-gateway/src/types/global-component-props.ts <<SignedSource::
|
|
9
|
-
* @codegenDependency ../../../../../../../services/forge-common-app-gateway/src/components/global/Global-Sidebar.tsx <<SignedSource::
|
|
8
|
+
* @codegenDependency ../../../../../../../services/forge-common-app-gateway/src/types/global-component-props.ts <<SignedSource::ad330a446ee260180d5b510c18b5e1c8>>
|
|
9
|
+
* @codegenDependency ../../../../../../../services/forge-common-app-gateway/src/components/global/Global-Sidebar.tsx <<SignedSource::216e7ba54d02c3e167f084fb05e4018f>>
|
|
10
10
|
*/
|
|
11
|
+
import type React from 'react';
|
|
11
12
|
export type GlobalSidebarProps = {
|
|
12
13
|
/**
|
|
13
14
|
* URL path for the "For You" section in the sidebar.
|
|
14
15
|
* When provided, enables the "For You" navigation item.
|
|
15
16
|
*/
|
|
16
|
-
forYouUrl?: string
|
|
17
|
+
forYouUrl?: string;
|
|
18
|
+
/**
|
|
19
|
+
* Accepts Global.LinkMenuItem and Global.ExpandMenuItem components.
|
|
20
|
+
*/
|
|
21
|
+
children?: React.ReactElement | React.ReactElement[];
|
|
17
22
|
};
|
|
18
23
|
export type TGlobalSidebar<T> = (props: GlobalSidebarProps) => T;
|
|
@@ -3,10 +3,12 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Index file for generated Global component prop types
|
|
5
5
|
*
|
|
6
|
-
* @codegen <<SignedSource::
|
|
6
|
+
* @codegen <<SignedSource::275df2eb411df5669a05d8e4573e519b>>
|
|
7
7
|
* @codegenCommand yarn workspace @atlaskit/forge-react-types codegen-global
|
|
8
|
-
* @codegenDependency ../../../../../../../services/forge-common-app-gateway/src/types/global-component-props.ts <<SignedSource::
|
|
8
|
+
* @codegenDependency ../../../../../../../services/forge-common-app-gateway/src/types/global-component-props.ts <<SignedSource::ad330a446ee260180d5b510c18b5e1c8>>
|
|
9
9
|
*/
|
|
10
|
+
export type { GlobalProps, TGlobal } from './GlobalProps.codegen';
|
|
11
|
+
export type { GlobalMainProps, TGlobalMain } from './GlobalMainProps.codegen';
|
|
10
12
|
export type { GlobalSidebarProps, TGlobalSidebar } from './GlobalSidebarProps.codegen';
|
|
11
13
|
export type { GlobalLinkMenuItemProps, TGlobalLinkMenuItem } from './GlobalLinkMenuItemProps.codegen';
|
|
12
14
|
export type { GlobalExpandableMenuItemProps, TGlobalExpandableMenuItem } from './GlobalExpandableMenuItemProps.codegen';
|
|
@@ -3,4 +3,4 @@ export type { BarChartProps, StackBarChartProps, HorizontalStackBarChartProps, H
|
|
|
3
3
|
export type { ChromelessEditorProps, CommentEditorProps, TChromelessEditor, TCommentEditor, } from './components/editor';
|
|
4
4
|
export type { ChartColorTokens } from './types';
|
|
5
5
|
export type { FrameProps } from './components/frame';
|
|
6
|
-
export type { GlobalSidebarProps, TGlobalSidebar, GlobalLinkMenuItemProps, TGlobalLinkMenuItem, GlobalExpandableMenuItemProps, TGlobalExpandableMenuItem, } from './components/global/__generated__';
|
|
6
|
+
export type { GlobalSidebarProps, TGlobalSidebar, GlobalLinkMenuItemProps, TGlobalLinkMenuItem, GlobalExpandableMenuItemProps, TGlobalExpandableMenuItem, GlobalProps, TGlobal, GlobalMainProps, TGlobalMain, } from './components/global/__generated__';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/forge-react-types",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.61.0",
|
|
4
4
|
"description": "Component types for Forge UI Kit React components",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"@atlaskit/popup": "^4.13.0",
|
|
34
34
|
"@atlaskit/primitives": "^18.0.0",
|
|
35
35
|
"@atlaskit/progress-bar": "^4.1.0",
|
|
36
|
-
"@atlaskit/progress-tracker": "^10.
|
|
36
|
+
"@atlaskit/progress-tracker": "^10.5.0",
|
|
37
37
|
"@atlaskit/radio": "^8.4.0",
|
|
38
38
|
"@atlaskit/section-message": "^8.12.0",
|
|
39
39
|
"@atlaskit/select": "^21.7.0",
|
|
@@ -73,9 +73,12 @@ const resolveToPrimitive = (typeText: string): string => {
|
|
|
73
73
|
return typeText;
|
|
74
74
|
}
|
|
75
75
|
|
|
76
|
-
// Handle
|
|
76
|
+
// Handle union types (e.g., "string | undefined")
|
|
77
77
|
if (typeText.includes('|')) {
|
|
78
|
-
const parts = typeText
|
|
78
|
+
const parts = typeText
|
|
79
|
+
.split('|')
|
|
80
|
+
.map((p) => p.trim())
|
|
81
|
+
.filter((p) => p.length > 0);
|
|
79
82
|
const resolvedParts = parts.map((part) => resolveToPrimitive(part));
|
|
80
83
|
return resolvedParts.join(' | ');
|
|
81
84
|
}
|
|
@@ -147,7 +150,10 @@ const resolveToInterfaceDeclaration = (
|
|
|
147
150
|
/**
|
|
148
151
|
* Generates the source code for a single component's prop types.
|
|
149
152
|
*/
|
|
150
|
-
const generateComponentPropTypeCode = (
|
|
153
|
+
const generateComponentPropTypeCode = (
|
|
154
|
+
interfaceDecl: InterfaceDeclaration,
|
|
155
|
+
allPropsNames: string[],
|
|
156
|
+
): string => {
|
|
151
157
|
const interfaceName = interfaceDecl.getName();
|
|
152
158
|
const componentName = interfaceName.replace('Props', '');
|
|
153
159
|
|
|
@@ -174,7 +180,31 @@ const generateComponentPropTypeCode = (interfaceDecl: InterfaceDeclaration): str
|
|
|
174
180
|
|
|
175
181
|
properties.forEach((prop: PropertySignature) => {
|
|
176
182
|
const propName = prop.getName();
|
|
177
|
-
|
|
183
|
+
// Prefer the source-level type annotation (getTypeNode) over the resolved type (getType).
|
|
184
|
+
// getType().getText() can produce degenerate types (any/never/undefined) when the
|
|
185
|
+
// ts-morph Project lacks type definitions, or overly verbose types that expand
|
|
186
|
+
// generic defaults (e.g., ReactElement<X> → ReactElement<X, string | JSXElementConstructor<any>>).
|
|
187
|
+
// The source annotation preserves the developer's intended type expression.
|
|
188
|
+
const resolvedTypeText = prop.getType().getText();
|
|
189
|
+
const sourceTypeText = prop.getTypeNode()?.getText();
|
|
190
|
+
let propType = sourceTypeText ?? resolvedTypeText;
|
|
191
|
+
|
|
192
|
+
// Normalize bare React type references (e.g., ReactElement → React.ReactElement)
|
|
193
|
+
// so the generated file only needs a single React namespace import.
|
|
194
|
+
const reactTypeNames = [
|
|
195
|
+
'ReactElement',
|
|
196
|
+
'ReactNode',
|
|
197
|
+
'ReactFragment',
|
|
198
|
+
'ReactPortal',
|
|
199
|
+
'JSXElementConstructor',
|
|
200
|
+
];
|
|
201
|
+
for (const typeName of reactTypeNames) {
|
|
202
|
+
propType = propType.replace(
|
|
203
|
+
new RegExp(`(?<![\\w.])${typeName}\\b`, 'g'),
|
|
204
|
+
`React.${typeName}`,
|
|
205
|
+
);
|
|
206
|
+
}
|
|
207
|
+
|
|
178
208
|
const isOptional = prop.hasQuestionToken();
|
|
179
209
|
const resolvedType = resolveToPrimitive(propType);
|
|
180
210
|
|
|
@@ -204,6 +234,25 @@ const generateComponentPropTypeCode = (interfaceDecl: InterfaceDeclaration): str
|
|
|
204
234
|
}
|
|
205
235
|
lines.push(`export type T${componentName}<T> = (props: ${interfaceName}) => T;`);
|
|
206
236
|
|
|
237
|
+
// Detect needed imports based on type references in the generated code
|
|
238
|
+
const generatedCode = lines.slice(2).join('\n'); // skip eslint directive and blank line
|
|
239
|
+
const importLines: string[] = [];
|
|
240
|
+
|
|
241
|
+
if (/\bReact\./.test(generatedCode)) {
|
|
242
|
+
importLines.push("import type React from 'react';");
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
for (const propsName of allPropsNames) {
|
|
246
|
+
if (propsName !== interfaceName && generatedCode.includes(propsName)) {
|
|
247
|
+
importLines.push(`import type { ${propsName} } from './${propsName}.codegen';`);
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
if (importLines.length > 0) {
|
|
252
|
+
// Insert imports after the eslint directive and blank line (index 2)
|
|
253
|
+
lines.splice(2, 0, ...importLines, '');
|
|
254
|
+
}
|
|
255
|
+
|
|
207
256
|
return lines.join('\n');
|
|
208
257
|
};
|
|
209
258
|
|
|
@@ -236,6 +285,7 @@ const generateGlobalComponentPropTypes = () => {
|
|
|
236
285
|
const exportedSymbols = sourceFile.getExportSymbols();
|
|
237
286
|
const propsSymbols = exportedSymbols.filter((symbol) => symbol.getName().endsWith('Props'));
|
|
238
287
|
|
|
288
|
+
const allPropsNames = propsSymbols.map((s) => s.getName());
|
|
239
289
|
const generatedFiles: string[] = [];
|
|
240
290
|
|
|
241
291
|
propsSymbols.forEach((symbol) => {
|
|
@@ -251,7 +301,7 @@ const generateGlobalComponentPropTypes = () => {
|
|
|
251
301
|
}
|
|
252
302
|
|
|
253
303
|
const { interfaceDecl, sourceFilePath } = resolved;
|
|
254
|
-
const sourceCode = generateComponentPropTypeCode(interfaceDecl);
|
|
304
|
+
const sourceCode = generateComponentPropTypeCode(interfaceDecl, allPropsNames);
|
|
255
305
|
const outputPath = resolve(GLOBAL_OUTPUT_DIR, `${symbolName}.codegen.tsx`);
|
|
256
306
|
|
|
257
307
|
const signedSourceCode = createSignedArtifact(
|
package/scripts/typechecker.ts
CHANGED
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
type LozengeProps,
|
|
12
12
|
type RangeProps,
|
|
13
13
|
type IconProps,
|
|
14
|
-
} from '@atlassian/forge-ui/
|
|
14
|
+
} from '@atlassian/forge-ui/UIKit';
|
|
15
15
|
import { type BadgeProps as GeneratedBadgeProps } from '../src/components/__generated__/BadgeProps.codegen';
|
|
16
16
|
import { type CalendarProps as GeneratedCalendarProps } from '../src/components/__generated__/CalendarProps.codegen';
|
|
17
17
|
import { type CheckboxProps as GeneratedCheckboxProps } from '../src/components/__generated__/CheckboxProps.codegen';
|
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Generated prop types for Global component - GlobalExpandableMenuItem
|
|
5
5
|
*
|
|
6
|
-
* @codegen <<SignedSource::
|
|
6
|
+
* @codegen <<SignedSource::8f9bf63fd0127b4faa2986b9c9257182>>
|
|
7
7
|
* @codegenCommand yarn workspace @atlaskit/forge-react-types codegen-global
|
|
8
|
-
* @codegenDependency ../../../../../../../services/forge-common-app-gateway/src/types/global-component-props.ts <<SignedSource::
|
|
8
|
+
* @codegenDependency ../../../../../../../services/forge-common-app-gateway/src/types/global-component-props.ts <<SignedSource::ad330a446ee260180d5b510c18b5e1c8>>
|
|
9
9
|
* @codegenDependency ../../../../../../../services/forge-common-app-gateway/src/components/global/Global-ExpandableMenuItem.tsx <<SignedSource::79df02babb605094ae73bdd0c00c7156>>
|
|
10
10
|
*/
|
|
11
11
|
/* eslint @repo/internal/codegen/signed-source-integrity: "warn" */
|
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Generated prop types for Global component - GlobalLinkMenuItem
|
|
5
5
|
*
|
|
6
|
-
* @codegen <<SignedSource::
|
|
6
|
+
* @codegen <<SignedSource::13f71ea4b4d387e48fef444bd10847f9>>
|
|
7
7
|
* @codegenCommand yarn workspace @atlaskit/forge-react-types codegen-global
|
|
8
|
-
* @codegenDependency ../../../../../../../services/forge-common-app-gateway/src/types/global-component-props.ts <<SignedSource::
|
|
8
|
+
* @codegenDependency ../../../../../../../services/forge-common-app-gateway/src/types/global-component-props.ts <<SignedSource::ad330a446ee260180d5b510c18b5e1c8>>
|
|
9
9
|
* @codegenDependency ../../../../../../../services/forge-common-app-gateway/src/components/global/Global-LinkMenuItem.tsx <<SignedSource::e70effe0d4e0620246252b35abddb112>>
|
|
10
10
|
*/
|
|
11
11
|
/* eslint @repo/internal/codegen/signed-source-integrity: "warn" */
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* THIS FILE WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
|
|
3
|
+
*
|
|
4
|
+
* Generated prop types for Global component - GlobalMain
|
|
5
|
+
*
|
|
6
|
+
* @codegen <<SignedSource::11ea5d4235fb0042c3ba744599576b5a>>
|
|
7
|
+
* @codegenCommand yarn workspace @atlaskit/forge-react-types codegen-global
|
|
8
|
+
* @codegenDependency ../../../../../../../services/forge-common-app-gateway/src/types/global-component-props.ts <<SignedSource::ad330a446ee260180d5b510c18b5e1c8>>
|
|
9
|
+
* @codegenDependency ../../../../../../../services/forge-common-app-gateway/src/components/global/Global-Main.tsx <<SignedSource::425e3fbc0683323fde14fb4bb6bb3abf>>
|
|
10
|
+
*/
|
|
11
|
+
/* eslint @repo/internal/codegen/signed-source-integrity: "warn" */
|
|
12
|
+
|
|
13
|
+
import type React from 'react';
|
|
14
|
+
|
|
15
|
+
export type GlobalMainProps = {
|
|
16
|
+
children?: React.ReactElement | React.ReactElement[];
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
export type TGlobalMain<T> = (props: GlobalMainProps) => T;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* THIS FILE WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
|
|
3
|
+
*
|
|
4
|
+
* Generated prop types for Global component - Global
|
|
5
|
+
*
|
|
6
|
+
* @codegen <<SignedSource::01c434a8e1088249f55e97bba99aa916>>
|
|
7
|
+
* @codegenCommand yarn workspace @atlaskit/forge-react-types codegen-global
|
|
8
|
+
* @codegenDependency ../../../../../../../services/forge-common-app-gateway/src/types/global-component-props.ts <<SignedSource::ad330a446ee260180d5b510c18b5e1c8>>
|
|
9
|
+
* @codegenDependency ../../../../../../../services/forge-common-app-gateway/src/components/global/Global.tsx <<SignedSource::54502ae221b976e3c4f4849cff6be726>>
|
|
10
|
+
*/
|
|
11
|
+
/* eslint @repo/internal/codegen/signed-source-integrity: "warn" */
|
|
12
|
+
|
|
13
|
+
import type React from 'react';
|
|
14
|
+
|
|
15
|
+
export type GlobalProps = {
|
|
16
|
+
/**
|
|
17
|
+
* Accepts Global.Sidebar and Global.Main components as children.
|
|
18
|
+
*/
|
|
19
|
+
children?: React.ReactElement | React.ReactElement[];
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export type TGlobal<T> = (props: GlobalProps) => T;
|
|
@@ -3,19 +3,25 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Generated prop types for Global component - GlobalSidebar
|
|
5
5
|
*
|
|
6
|
-
* @codegen <<SignedSource::
|
|
6
|
+
* @codegen <<SignedSource::79b07a090ede53f7e378c159fed3ac3b>>
|
|
7
7
|
* @codegenCommand yarn workspace @atlaskit/forge-react-types codegen-global
|
|
8
|
-
* @codegenDependency ../../../../../../../services/forge-common-app-gateway/src/types/global-component-props.ts <<SignedSource::
|
|
9
|
-
* @codegenDependency ../../../../../../../services/forge-common-app-gateway/src/components/global/Global-Sidebar.tsx <<SignedSource::
|
|
8
|
+
* @codegenDependency ../../../../../../../services/forge-common-app-gateway/src/types/global-component-props.ts <<SignedSource::ad330a446ee260180d5b510c18b5e1c8>>
|
|
9
|
+
* @codegenDependency ../../../../../../../services/forge-common-app-gateway/src/components/global/Global-Sidebar.tsx <<SignedSource::216e7ba54d02c3e167f084fb05e4018f>>
|
|
10
10
|
*/
|
|
11
11
|
/* eslint @repo/internal/codegen/signed-source-integrity: "warn" */
|
|
12
12
|
|
|
13
|
+
import type React from 'react';
|
|
14
|
+
|
|
13
15
|
export type GlobalSidebarProps = {
|
|
14
16
|
/**
|
|
15
17
|
* URL path for the "For You" section in the sidebar.
|
|
16
18
|
* When provided, enables the "For You" navigation item.
|
|
17
19
|
*/
|
|
18
|
-
forYouUrl?: string
|
|
20
|
+
forYouUrl?: string;
|
|
21
|
+
/**
|
|
22
|
+
* Accepts Global.LinkMenuItem and Global.ExpandMenuItem components.
|
|
23
|
+
*/
|
|
24
|
+
children?: React.ReactElement | React.ReactElement[];
|
|
19
25
|
};
|
|
20
26
|
|
|
21
27
|
export type TGlobalSidebar<T> = (props: GlobalSidebarProps) => T;
|
|
@@ -3,12 +3,14 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Index file for generated Global component prop types
|
|
5
5
|
*
|
|
6
|
-
* @codegen <<SignedSource::
|
|
6
|
+
* @codegen <<SignedSource::275df2eb411df5669a05d8e4573e519b>>
|
|
7
7
|
* @codegenCommand yarn workspace @atlaskit/forge-react-types codegen-global
|
|
8
|
-
* @codegenDependency ../../../../../../../services/forge-common-app-gateway/src/types/global-component-props.ts <<SignedSource::
|
|
8
|
+
* @codegenDependency ../../../../../../../services/forge-common-app-gateway/src/types/global-component-props.ts <<SignedSource::ad330a446ee260180d5b510c18b5e1c8>>
|
|
9
9
|
*/
|
|
10
10
|
/* eslint @repo/internal/codegen/signed-source-integrity: "warn" */
|
|
11
11
|
|
|
12
|
+
export type { GlobalProps, TGlobal } from './GlobalProps.codegen';
|
|
13
|
+
export type { GlobalMainProps, TGlobalMain } from './GlobalMainProps.codegen';
|
|
12
14
|
export type { GlobalSidebarProps, TGlobalSidebar } from './GlobalSidebarProps.codegen';
|
|
13
15
|
export type { GlobalLinkMenuItemProps, TGlobalLinkMenuItem } from './GlobalLinkMenuItemProps.codegen';
|
|
14
16
|
export type { GlobalExpandableMenuItemProps, TGlobalExpandableMenuItem } from './GlobalExpandableMenuItemProps.codegen';
|