@atlaskit/forge-react-types 0.62.0 → 0.63.1

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,22 @@
1
1
  # @atlaskit/forge-react-types
2
2
 
3
+ ## 0.63.1
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies
8
+
9
+ ## 0.63.0
10
+
11
+ ### Minor Changes
12
+
13
+ - [`a11e55ab6e41c`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/a11e55ab6e41c) -
14
+ Clean up unused files
15
+
16
+ ### Patch Changes
17
+
18
+ - Updated dependencies
19
+
3
20
  ## 0.62.0
4
21
 
5
22
  ### Minor Changes
@@ -8,7 +8,7 @@
8
8
  * @codegenDependency ../../../../forge-ui/src/components/UIKit/inline/__generated__/index.partial.tsx <<SignedSource::8123157b2afe19d52b47110fb754d43b>>
9
9
  */
10
10
  import React from 'react';
11
- import { Inline as PlatformInline } from '@atlaskit/primitives';
11
+ import { Inline as PlatformInline } from "@atlaskit/primitives/compiled";
12
12
  type PlatformInlineProps = React.ComponentProps<typeof PlatformInline>;
13
13
  export type InlineProps = Pick<PlatformInlineProps, 'children' | 'alignBlock' | 'alignInline' | 'spread' | 'grow' | 'space' | 'shouldWrap' | 'separator' | 'rowSpace' | 'testId'>;
14
14
  /**
@@ -8,7 +8,7 @@
8
8
  * @codegenDependency ../../../../forge-ui/src/components/UIKit/inline/__generated__/index.partial.tsx <<SignedSource::8123157b2afe19d52b47110fb754d43b>>
9
9
  */
10
10
  import React from 'react';
11
- import { Inline as PlatformInline } from '@atlaskit/primitives';
11
+ import { Inline as PlatformInline } from "@atlaskit/primitives/compiled";
12
12
  type PlatformInlineProps = React.ComponentProps<typeof PlatformInline>;
13
13
  export type InlineProps = Pick<PlatformInlineProps, 'children' | 'alignBlock' | 'alignInline' | 'spread' | 'grow' | 'space' | 'shouldWrap' | 'separator' | 'rowSpace' | 'testId'>;
14
14
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/forge-react-types",
3
- "version": "0.62.0",
3
+ "version": "0.63.1",
4
4
  "description": "Component types for Forge UI Kit React components",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -27,8 +27,8 @@
27
27
  "@atlaskit/dynamic-table": "^18.3.0",
28
28
  "@atlaskit/form": "^15.3.0",
29
29
  "@atlaskit/inline-edit": "^15.6.0",
30
- "@atlaskit/modal-dialog": "^14.10.0",
31
- "@atlaskit/navigation-system": "^5.34.0",
30
+ "@atlaskit/modal-dialog": "^14.11.0",
31
+ "@atlaskit/navigation-system": "^6.0.0",
32
32
  "@atlaskit/object": "^1.0.0",
33
33
  "@atlaskit/popup": "^4.13.0",
34
34
  "@atlaskit/primitives": "^18.0.0",
@@ -56,7 +56,7 @@
56
56
  },
57
57
  "devDependencies": {
58
58
  "@atlassian/codegen": "^0.1.0",
59
- "@atlassian/forge-ui": "^32.82.0",
59
+ "@atlassian/forge-ui": "^32.88.0",
60
60
  "@types/node": "^24.0.0",
61
61
  "lodash": "^4.17.21",
62
62
  "react": "^18.2.0",
@@ -185,26 +185,31 @@ class ImportDeclarationProxy implements IImportDeclaration {
185
185
 
186
186
  public getText() {
187
187
  const code = this.base.getText();
188
-
189
- const match = code.match(/^(import(?:\s+type)?)\s+(?:(\w+)\s*,?\s*)?(?:\{([^}]*)\})?\s*from\s*['"](.+)['"];?$/);
188
+
189
+ const match = code.match(
190
+ /^(import(?:\s+type)?)\s+(?:(\w+)\s*,?\s*)?(?:\{([^}]*)\})?\s*from\s*['"](.+)['"];?$/,
191
+ );
190
192
  if (!match) {
191
193
  return this.base.getText();
192
194
  }
193
-
195
+
194
196
  let [_, importKeyword, defaultImport, namedImportsStr, packageName] = match;
195
-
197
+
196
198
  let namedImportsList = namedImportsStr
197
- ? namedImportsStr.trim().split(',').map((text) => text.trim()).filter(Boolean)
199
+ ? namedImportsStr
200
+ .trim()
201
+ .split(',')
202
+ .map((text) => text.trim())
203
+ .filter(Boolean)
198
204
  : [];
199
205
 
200
-
201
206
  if (this.removedNamedImports.size > 0) {
202
207
  namedImportsList = namedImportsList.filter((text) => !this.removedNamedImports.has(text));
203
208
  }
204
209
  if (this.addedNamedImports) {
205
210
  namedImportsList = Array.from(new Set([...namedImportsList, ...this.addedNamedImports]));
206
211
  }
207
-
212
+
208
213
  // Build the import statement
209
214
  const parts: string[] = [];
210
215
  if (defaultImport) {
@@ -213,12 +218,12 @@ class ImportDeclarationProxy implements IImportDeclaration {
213
218
  if (namedImportsList.length > 0) {
214
219
  parts.push(`{ ${namedImportsList.sort().join(', ')} }`);
215
220
  }
216
-
221
+
217
222
  // If no imports left, don't output anything
218
223
  if (parts.length === 0) {
219
224
  return '';
220
225
  }
221
-
226
+
222
227
  return `${importKeyword} ${parts.join(', ')} from '${packageName}';`;
223
228
  }
224
229
  }
@@ -342,7 +347,10 @@ const mergeImportsFromSameModule = (code: string): string => {
342
347
  }
343
348
 
344
349
  // Add merged imports back
345
- for (const [module, { typeOnly, regular, defaultImport, namespaceImport, isTypeOnly }] of importsByModule) {
350
+ for (const [
351
+ module,
352
+ { typeOnly, regular, defaultImport, namespaceImport, isTypeOnly },
353
+ ] of importsByModule) {
346
354
  // Handle namespace imports separately (can't be combined with named imports)
347
355
  if (namespaceImport) {
348
356
  tempFile.addImportDeclaration({
@@ -384,7 +392,6 @@ const mergeImportsFromSameModule = (code: string): string => {
384
392
  return tempFile.getFullText();
385
393
  };
386
394
 
387
-
388
395
  // handles imports from platform/packages/forge/forge-ui/src/components/UIKit/tokens.partial.tsx
389
396
  // (can be type-only imports OR mixed value/type imports)
390
397
  const isSharedUIKit2TokensImport = (importDeclaration: ImportDeclaration) => {
@@ -1005,11 +1012,11 @@ const extractImportsForVariables = (
1005
1012
 
1006
1013
  for (const importDecl of imports) {
1007
1014
  const moduleSpecifier = importDecl.getModuleSpecifierValue();
1008
-
1015
+
1009
1016
  // Handle imports from @atlaskit packages or tokens.partial file
1010
1017
  const isAtlaskitImport = moduleSpecifier.startsWith('@atlaskit/');
1011
1018
  const isTokensImport = isTokensPartialImport(moduleSpecifier);
1012
-
1019
+
1013
1020
  if (isAtlaskitImport || isTokensImport) {
1014
1021
  const namedImports = importDecl.getNamedImports();
1015
1022
  const isTypeOnlyImport = importDecl.isTypeOnly();
@@ -1039,7 +1046,7 @@ const extractImportsForVariables = (
1039
1046
  if (usedNamedImports.length > 0 || usedTypeImports.length > 0) {
1040
1047
  // Rewrite tokens.partial imports to tokens.codegen
1041
1048
  const targetModule = isTokensImport ? './tokens.codegen' : moduleSpecifier;
1042
-
1049
+
1043
1050
  // Combine type and value imports into a single { } block
1044
1051
  const allImports: string[] = [
1045
1052
  ...usedTypeImports.map((name) => `type ${name}`),
@@ -1090,7 +1097,7 @@ const handleXCSSProp: CodeConsolidator = ({
1090
1097
  const xcssValidatorDeclarationCode = utilsFile.getEmitOutput({
1091
1098
  emitOnlyDtsFiles: true,
1092
1099
  }).compilerObject.outputFiles[0].text;
1093
-
1100
+
1094
1101
  const xcssValidatorVariableDeclarationCode = [
1095
1102
  xcssValidatorDeclarationCode,
1096
1103
  variableImportsCode,
@@ -1112,7 +1119,7 @@ const handleXCSSProp: CodeConsolidator = ({
1112
1119
  ]
1113
1120
  .filter((code) => !!code)
1114
1121
  .join('\n\n');
1115
-
1122
+
1116
1123
  // Merge duplicate imports from the same module (e.g., multiple tokens.codegen imports)
1117
1124
  return mergeImportsFromSameModule(allCode);
1118
1125
  } finally {
@@ -147,7 +147,9 @@ const flattenPickType = (
147
147
  // Currently we only support union type with same property signatures or a superset signature
148
148
  // as we assume this setup is to support gradual type changes behind feature flags.
149
149
  // other use cases are not supported currently.
150
- throw new Error(`Unsupported union prop type with multiple different property signatures, ${prop.getName()}`);
150
+ throw new Error(
151
+ `Unsupported union prop type with multiple different property signatures, ${prop.getName()}`,
152
+ );
151
153
  }
152
154
 
153
155
  const propertySignature = propertySignatures[0];
@@ -178,7 +180,9 @@ const extractPropertySignatures = (prop: TSSymbol): PropertySignature[] => {
178
180
  if (!declarations) {
179
181
  return [];
180
182
  }
181
- const signatures = declarations.filter((decl) => decl.getKind() === SyntaxKind.PropertySignature) as PropertySignature[];
183
+ const signatures = declarations.filter(
184
+ (decl) => decl.getKind() === SyntaxKind.PropertySignature,
185
+ ) as PropertySignature[];
182
186
  if (signatures.length <= 1) {
183
187
  return signatures;
184
188
  }
@@ -229,9 +233,11 @@ const isTypeAssignableTo = (prop: TSSymbol, sourceType: TSType, targetType: TSTy
229
233
 
230
234
  // ts typecker has an intneral method `isTypeAssignableTo` we can leverage here:
231
235
  // https://github.com/microsoft/TypeScript/pull/56448
232
- return (typeChecker as unknown as {
233
- isTypeAssignableTo: (source: unknown, target: unknown) => boolean;
234
- }).isTypeAssignableTo(sourceType.compilerType, targetType.compilerType);
236
+ return (
237
+ typeChecker as unknown as {
238
+ isTypeAssignableTo: (source: unknown, target: unknown) => boolean;
239
+ }
240
+ ).isTypeAssignableTo(sourceType.compilerType, targetType.compilerType);
235
241
  };
236
242
 
237
243
  const getUnresolvableTypes = (tsType: TSType) => {
@@ -10,7 +10,7 @@
10
10
  /* eslint @repo/internal/codegen/signed-source-integrity: "warn" */
11
11
 
12
12
  import React from 'react';
13
- import { Inline as PlatformInline } from '@atlaskit/primitives';
13
+ import { Inline as PlatformInline } from "@atlaskit/primitives/compiled";
14
14
 
15
15
  type PlatformInlineProps = React.ComponentProps<typeof PlatformInline>;
16
16
 
@@ -12,7 +12,7 @@ export type DonutChartProps = PieChartProps & {
12
12
  /**
13
13
  * Adds a border onto the chart. Defaults to true.
14
14
  */
15
- showBorder?: boolean;
15
+ showBorder?: boolean;
16
16
  };
17
17
 
18
18
  /**
@@ -1,5 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
@@ -1,116 +0,0 @@
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 - LinkMenuItemProps
5
- *
6
- * @codegen <<SignedSource::4a1f543c49be8d37af271ad72f46c373>>
7
- * @codegenCommand yarn workspace @atlaskit/forge-react-types codegen
8
- * @codegenDependency ../../../../forge-ui/src/components/UIKit/link-menu-item/__generated__/index.partial.tsx <<SignedSource::8943197e8ce5439de1d6f88dda81d55b>>
9
- */
10
- /* eslint @repo/internal/codegen/signed-source-integrity: "warn" */
11
-
12
- import React from 'react';
13
- import { LinkMenuItem as PlatformLinkMenuItem } from '@atlaskit/navigation-system/side-nav-items/link-menu-item';
14
-
15
- type PlatformLinkMenuItemProps = React.ComponentProps<typeof PlatformLinkMenuItem>;
16
- type Element = string | number | boolean | React.ReactNode;
17
-
18
- export type LinkMenuItemProps = Pick<
19
- PlatformLinkMenuItemProps,
20
- | 'children'
21
- | 'testId'
22
- | 'isContentTooltipDisabled'
23
- | 'isDragging'
24
- | 'hasDragIndicator'
25
- | 'description'
26
- | 'target'
27
- | 'isSelected'
28
- | 'href'
29
- | 'elemBefore'
30
- | 'elemAfter'
31
- | 'actions'
32
- | 'actionsOnHover'
33
- | 'dropIndicator'
34
- > & {
35
- /**
36
- * Called when the user has clicked on the trigger content.
37
- */
38
- onClick?: () => void;
39
- /**
40
- * `ReactNode` to be placed visually before the `children`.
41
- *
42
- * This `ReactNode` will be rendered visually on top of the main
43
- * interactive element for the menu item. If this element does not
44
- * contain an interactive element (`button` or `a`) then `pointer-events`
45
- * will be set to `none` on this slot so that users can click through
46
- * this element onto the main interactive element of the menu item.
47
- *
48
- * If you want to collapse the `elemBefore` so it takes up no space,
49
- * then pass in the `COLLAPSE_ELEM_BEFORE` symbol. Keep in mind that
50
- * collapsing the `elemBefore` can break visual alignment and
51
- * will make it difficult for users to visually distinguish levels
52
- * in the side navigation.
53
- *
54
- * @example
55
- *
56
- * ```tsx
57
- * <MenuItemButton elemBefore={<HomeIcon label="home" />}>Home</MenuItemButton>
58
- *
59
- * // collapse the elemBefore
60
- * <MenuItemButton elemBefore={COLLAPSE_ELEM_BEFORE}>Home</MenuItemButton>
61
- * ```
62
- */
63
- elemBefore?: Element;
64
- /**
65
- * `ReactNode` to be placed visually after the `children`.
66
- *
67
- * It is intended for static content (e.g. a `Lozenge`).
68
- *
69
- * If both `elemAfter` and `actionsOnHover` are provided, `elemAfter` will
70
- * not be displayed when the item is hovered over or expanded. This is
71
- * because the `actionsOnHover` will be displayed instead.
72
- *
73
- * This `ReactNode` will be rendered visually on top of the main
74
- * interactive element for the menu item. If this element does not
75
- * contain an interactive element (`button` or `a`) then `pointer-events`
76
- * will be set to `none` on this slot so that users can click through
77
- * this element onto the main interactive element of the menu item.
78
- */
79
- elemAfter?: Element;
80
- /**
81
- * `ReactNode` to be placed visually after the `children`.
82
- *
83
- * It is intended for additional actions (e.g. IconButtons).
84
- *
85
- * They will not be rendered when the menu item is disabled.
86
- */
87
- actions?: Element;
88
- /**
89
- * `ReactNode` to be placed visually after the `children` and will
90
- * only be displayed on hover or focus.
91
- *
92
- * It is intended for additional actions (e.g. IconButtons).
93
- *
94
- * This `ReactNode` will replace `elemAfter` on hover or focus.
95
- *
96
- * They will not be rendered when the menu item is disabled.
97
- *
98
- * This `ReactNode` will be rendered visually on top of the main
99
- * interactive element for the menu item. If this element does not
100
- * contain an interactive element (`button` or `a`) then `pointer-events`
101
- * will be set to `none` on this slot so that users can click through
102
- * this element onto the main interactive element of the menu item.
103
- */
104
- actionsOnHover?: Element;
105
- /**
106
- * A slot to render drop indicators for drag and drop operations on the menu item.
107
- */
108
- dropIndicator?: Element;
109
- };
110
-
111
- /**
112
- * A menu item that is wrapped in an anchor tag <a>. This is the most common type of menu item, as most menu items are used to send people to another location.
113
- *
114
- * @see [LinkMenuItem](https://developer.atlassian.com/platform/forge/ui-kit/components/link-menu-item/) in UI Kit documentation for more information
115
- */
116
- export type TLinkMenuItem<T> = (props: LinkMenuItemProps) => T;