@commercetools-frontend-extensions/export-resources-modal 0.0.0-canary-20240903101116 → 0.0.0-canary-20240904084742
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/README.md +4 -8
- package/dist/commercetools-frontend-extensions-export-resources-modal.cjs.dev.js +253 -138
- package/dist/commercetools-frontend-extensions-export-resources-modal.cjs.prod.js +247 -132
- package/dist/commercetools-frontend-extensions-export-resources-modal.esm.js +250 -136
- package/dist/declarations/src/@hooks/index.d.ts +4 -0
- package/dist/declarations/src/@hooks/use-convert-custom-type-definitions-for-export.d.ts +8 -0
- package/dist/declarations/src/@hooks/use-export-resources-modal-context.d.ts +2 -0
- package/dist/declarations/src/@hooks/use-initial-values.d.ts +2 -0
- package/dist/declarations/src/@hooks/use-start-export-operation.d.ts +4 -0
- package/dist/declarations/src/@types/custom-type-definition.d.ts +38 -0
- package/dist/declarations/src/@types/export-resources-modal-types.d.ts +1 -2
- package/dist/declarations/src/@types/form.d.ts +0 -3
- package/dist/declarations/src/@types/index.d.ts +1 -0
- package/dist/declarations/src/index.d.ts +1 -0
- package/package.json +3 -1
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { Field, CustomTypeDefinition } from "../@types/index.js";
|
|
2
|
+
export declare const useConvertCustomTypeDefinitionsForExport: () => {
|
|
3
|
+
convertCustomTypeDefinitionsForExport: ({ customTypeDefinitions, customFieldPrefix, expandAll, }: {
|
|
4
|
+
customTypeDefinitions?: CustomTypeDefinition[] | undefined;
|
|
5
|
+
customFieldPrefix?: string | undefined;
|
|
6
|
+
expandAll?: boolean | undefined;
|
|
7
|
+
}) => Field[];
|
|
8
|
+
};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
type LocalizedString = {
|
|
2
|
+
value: string;
|
|
3
|
+
locale: string;
|
|
4
|
+
};
|
|
5
|
+
type FieldType = {
|
|
6
|
+
name: string;
|
|
7
|
+
};
|
|
8
|
+
export type FieldDefinition = {
|
|
9
|
+
type: FieldType;
|
|
10
|
+
name: string;
|
|
11
|
+
labelAllLocales: LocalizedString[];
|
|
12
|
+
};
|
|
13
|
+
export type CustomTypeDefinition = {
|
|
14
|
+
key: string;
|
|
15
|
+
nameAllLocales: LocalizedString[];
|
|
16
|
+
fieldDefinitions: FieldDefinition[];
|
|
17
|
+
};
|
|
18
|
+
type TransformedFieldDefinition = {
|
|
19
|
+
type: {
|
|
20
|
+
name: string;
|
|
21
|
+
};
|
|
22
|
+
name: string;
|
|
23
|
+
label: {
|
|
24
|
+
value: string;
|
|
25
|
+
locale: string;
|
|
26
|
+
}[];
|
|
27
|
+
};
|
|
28
|
+
export type TransformedCustomTypeDefinition = {
|
|
29
|
+
type: {
|
|
30
|
+
key: string;
|
|
31
|
+
name: {
|
|
32
|
+
value: string;
|
|
33
|
+
locale: string;
|
|
34
|
+
}[];
|
|
35
|
+
};
|
|
36
|
+
fields: TransformedFieldDefinition[];
|
|
37
|
+
};
|
|
38
|
+
export {};
|
|
@@ -5,10 +5,10 @@ export interface Field {
|
|
|
5
5
|
label: string;
|
|
6
6
|
isSelectedByDefault?: boolean;
|
|
7
7
|
isRequired?: boolean;
|
|
8
|
-
isReadOnly?: boolean;
|
|
9
8
|
fields?: Field[];
|
|
10
9
|
additionalFieldExtensions?: string[];
|
|
11
10
|
dependentGroupNames?: string[];
|
|
11
|
+
dependentFieldNames?: string[];
|
|
12
12
|
isExpanded?: boolean;
|
|
13
13
|
isExpandable?: boolean;
|
|
14
14
|
}
|
|
@@ -16,7 +16,6 @@ export interface FieldGroup {
|
|
|
16
16
|
groupLabel: string;
|
|
17
17
|
groupName: string;
|
|
18
18
|
isExpanded?: boolean;
|
|
19
|
-
additionalFieldExtensions?: string[];
|
|
20
19
|
fields: Field[];
|
|
21
20
|
}
|
|
22
21
|
export interface ExportResourcesModalProps {
|
|
@@ -9,15 +9,12 @@ export interface FormGroup extends FieldGroup {
|
|
|
9
9
|
isChecked?: boolean;
|
|
10
10
|
isExpanded?: boolean;
|
|
11
11
|
fields: FormField[];
|
|
12
|
-
additionalFieldExtensions?: string[];
|
|
13
|
-
dependentGroupNames?: string[];
|
|
14
12
|
}
|
|
15
13
|
export interface FilteredField extends FormField {
|
|
16
14
|
isHidden?: boolean;
|
|
17
15
|
}
|
|
18
16
|
export interface FilteredGroup extends FieldGroup {
|
|
19
17
|
isHidden?: boolean;
|
|
20
|
-
dependentGroupNames?: string[];
|
|
21
18
|
fields: FilteredField[];
|
|
22
19
|
}
|
|
23
20
|
export interface FormValues {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import ExportResourcesModal from "./export-resources-modal.js";
|
|
2
2
|
export { EXPORT_TYPES, EXPORTABLE_RESOURCES } from "./@constants/index.js";
|
|
3
3
|
export * from "./@types/index.js";
|
|
4
|
+
export { useConvertCustomTypeDefinitionsForExport } from "./@hooks/index.js";
|
|
4
5
|
export default ExportResourcesModal;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@commercetools-frontend-extensions/export-resources-modal",
|
|
3
3
|
"description": "Shared export modal for exporting resources",
|
|
4
|
-
"version": "0.0.0-canary-
|
|
4
|
+
"version": "0.0.0-canary-20240904084742",
|
|
5
5
|
"license": "BSD-3-Clause",
|
|
6
6
|
"publishConfig": {
|
|
7
7
|
"access": "public"
|
|
@@ -38,6 +38,7 @@
|
|
|
38
38
|
"@commercetools-frontend/constants": "22.31.0",
|
|
39
39
|
"@commercetools-frontend/i18n": "22.31.0",
|
|
40
40
|
"@commercetools-frontend/jest-preset-mc-app": "22.31.0",
|
|
41
|
+
"@commercetools-frontend/l10n": "22.31.0",
|
|
41
42
|
"@commercetools-frontend/sdk": "22.31.0",
|
|
42
43
|
"@commercetools-frontend/sentry": "22.31.0",
|
|
43
44
|
"@commercetools-frontend/ui-kit": "19.11.0",
|
|
@@ -59,6 +60,7 @@
|
|
|
59
60
|
"@commercetools-frontend/constants": "22.x",
|
|
60
61
|
"@commercetools-frontend/i18n": "22.x",
|
|
61
62
|
"@commercetools-frontend/jest-preset-mc-app": "22.x",
|
|
63
|
+
"@commercetools-frontend/l10n": "22.x",
|
|
62
64
|
"@commercetools-frontend/sdk": "22.x",
|
|
63
65
|
"@commercetools-frontend/sentry": "22.x",
|
|
64
66
|
"@commercetools-frontend/ui-kit": "19.x",
|