@leav/ui 0.4.0-ab52676 → 0.4.0-abaf374e
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 +1 -0
- package/dist/__mocks__/common/form.d.ts +632 -0
- package/dist/__mocks__/common/form.js +27 -22
- package/dist/__mocks__/common/form.js.map +1 -1
- package/dist/_gqlTypes/index.d.ts +3205 -2217
- package/dist/_gqlTypes/index.js +414 -132
- package/dist/_gqlTypes/index.js.map +1 -1
- package/dist/_queries/records/getRecordFormQuery.js +10 -5
- package/dist/_queries/records/getRecordFormQuery.js.map +1 -1
- package/dist/_queries/trees/treeNodeChildrenQuery.js +12 -2
- package/dist/_queries/trees/treeNodeChildrenQuery.js.map +1 -1
- package/dist/components/Explorer/DataView.js +4 -4
- package/dist/components/Explorer/DataView.js.map +1 -1
- package/dist/components/Explorer/Explorer.d.ts +4 -2
- package/dist/components/Explorer/Explorer.js +3 -2
- package/dist/components/Explorer/Explorer.js.map +1 -1
- package/dist/components/Explorer/ExplorerToolbar.d.ts +2 -1
- package/dist/components/Explorer/ExplorerToolbar.js +5 -4
- package/dist/components/Explorer/ExplorerToolbar.js.map +1 -1
- package/dist/components/Explorer/_queries/useExplorerData.js +2 -2
- package/dist/components/Explorer/_queries/useExplorerData.js.map +1 -1
- package/dist/components/Explorer/_types.d.ts +4 -1
- package/dist/components/Explorer/_types.js.map +1 -1
- package/dist/components/Explorer/actions-primary/useCreatePrimaryAction.d.ts +3 -1
- package/dist/components/Explorer/actions-primary/useCreatePrimaryAction.js +13 -6
- package/dist/components/Explorer/actions-primary/useCreatePrimaryAction.js.map +1 -1
- package/dist/components/Explorer/manage-view-settings/_shared/useTransformFilters.js +4 -0
- package/dist/components/Explorer/manage-view-settings/_shared/useTransformFilters.js.map +1 -1
- package/dist/components/Explorer/manage-view-settings/filter-items/filter-type/FilterDropDown.js +2 -2
- package/dist/components/Explorer/manage-view-settings/filter-items/filter-type/FilterDropDown.js.map +1 -1
- package/dist/components/Explorer/manage-view-settings/store-view-settings/viewSettingsInitialState.js +2 -1
- package/dist/components/Explorer/manage-view-settings/store-view-settings/viewSettingsInitialState.js.map +1 -1
- package/dist/components/Explorer/manage-view-settings/store-view-settings/viewSettingsReducer.d.ts +1 -0
- package/dist/components/Explorer/manage-view-settings/store-view-settings/viewSettingsReducer.js.map +1 -1
- package/dist/components/LibraryItemsList/FiltersPanel/Filter/Filter.js +2 -2
- package/dist/components/LibraryItemsList/FiltersPanel/Filter/Filter.js.map +1 -1
- package/dist/components/RecordEdition/EditRecord/EditRecord.d.ts +2 -1
- package/dist/components/RecordEdition/EditRecord/EditRecord.js +72 -224
- package/dist/components/RecordEdition/EditRecord/EditRecord.js.map +1 -1
- package/dist/components/RecordEdition/EditRecordContent/EditRecordContent.d.ts +2 -2
- package/dist/components/RecordEdition/EditRecordContent/EditRecordContent.js +57 -33
- package/dist/components/RecordEdition/EditRecordContent/EditRecordContent.js.map +1 -1
- package/dist/components/RecordEdition/EditRecordContent/_types.d.ts +15 -12
- package/dist/components/RecordEdition/EditRecordContent/_types.js.map +1 -1
- package/dist/components/RecordEdition/EditRecordContent/antdUtils.d.ts +6 -0
- package/dist/components/RecordEdition/EditRecordContent/antdUtils.js +7 -1
- package/dist/components/RecordEdition/EditRecordContent/antdUtils.js.map +1 -1
- package/dist/components/RecordEdition/EditRecordContent/helpers/extractFormElements/extractFormElements.d.ts +15 -2
- package/dist/components/RecordEdition/EditRecordContent/helpers/extractFormElements/extractFormElements.js +47 -24
- package/dist/components/RecordEdition/EditRecordContent/helpers/extractFormElements/extractFormElements.js.map +1 -1
- package/dist/components/RecordEdition/EditRecordContent/hooks/useCreateEmptyRecordMutation.d.ts +5 -0
- package/dist/components/RecordEdition/EditRecordContent/hooks/useCreateEmptyRecordMutation.js +28 -0
- package/dist/components/RecordEdition/EditRecordContent/hooks/useCreateEmptyRecordMutation.js.map +1 -0
- package/dist/components/RecordEdition/EditRecordContent/hooks/useFetchVisibleFormValue.d.ts +13 -0
- package/dist/components/RecordEdition/EditRecordContent/hooks/useFetchVisibleFormValue.js +113 -0
- package/dist/components/RecordEdition/EditRecordContent/hooks/useFetchVisibleFormValue.js.map +1 -0
- package/dist/components/RecordEdition/EditRecordContent/hooks/useTabManagement.d.ts +12 -0
- package/dist/components/RecordEdition/EditRecordContent/hooks/useTabManagement.js +39 -0
- package/dist/components/RecordEdition/EditRecordContent/hooks/useTabManagement.js.map +1 -0
- package/dist/components/RecordEdition/EditRecordContent/uiElements/Container/Container.d.ts +3 -2
- package/dist/components/RecordEdition/EditRecordContent/uiElements/Container/Container.js +3 -5
- package/dist/components/RecordEdition/EditRecordContent/uiElements/Container/Container.js.map +1 -1
- package/dist/components/RecordEdition/EditRecordContent/uiElements/FormDivider/FormDivider.js.map +1 -1
- package/dist/components/RecordEdition/EditRecordContent/uiElements/FormTabs/FormTabs.js +25 -5
- package/dist/components/RecordEdition/EditRecordContent/uiElements/FormTabs/FormTabs.js.map +1 -1
- package/dist/components/RecordEdition/EditRecordContent/uiElements/Frame/Frame.d.ts +1 -1
- package/dist/components/RecordEdition/EditRecordContent/uiElements/Frame/Frame.js +1 -3
- package/dist/components/RecordEdition/EditRecordContent/uiElements/Frame/Frame.js.map +1 -1
- package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/LinkField.js +11 -20
- package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/LinkField.js.map +1 -1
- package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/link-record-in-creation/useLinkRecordsInCreation.d.ts +1 -1
- package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/link-record-in-edition/useLinkRecordsInEdition.d.ts +4 -3
- package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/link-record-in-edition/useLinkRecordsInEdition.js +117 -22
- package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/link-record-in-edition/useLinkRecordsInEdition.js.map +1 -1
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardField.d.ts +0 -2
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardField.js +61 -78
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardField.js.map +1 -1
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/DSInputWrapper.js +2 -1
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/DSInputWrapper.js.map +1 -1
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/StandardFieldValue.d.ts +2 -1
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/StandardFieldValue.js +2 -1
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/StandardFieldValue.js.map +1 -1
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/_types.d.ts +1 -0
- package/dist/components/RecordEdition/EditRecordContent/uiElements/TextBlock/TextBlock.js.map +1 -1
- package/dist/components/RecordEdition/EditRecordContent/uiElements/TreeField/TreeField.d.ts +1 -1
- package/dist/components/RecordEdition/EditRecordContent/uiElements/TreeField/TreeField.js +23 -26
- package/dist/components/RecordEdition/EditRecordContent/uiElements/TreeField/TreeField.js.map +1 -1
- package/dist/components/RecordEdition/EditRecordContent/uiElements/TreeField/display-tree-node/{useDisplayTreeNode.d.ts → TreeNodeList.d.ts} +3 -4
- package/dist/components/RecordEdition/EditRecordContent/uiElements/TreeField/display-tree-node/TreeNodeList.js +5 -0
- package/dist/components/RecordEdition/EditRecordContent/uiElements/TreeField/display-tree-node/TreeNodeList.js.map +1 -0
- package/dist/components/RecordEdition/EditRecordContent/uiElements/TreeField/manage-tree-node-selection/SelectTreeNodeModal.d.ts +16 -4
- package/dist/components/RecordEdition/EditRecordContent/uiElements/TreeField/manage-tree-node-selection/SelectTreeNodeModal.js +12 -13
- package/dist/components/RecordEdition/EditRecordContent/uiElements/TreeField/manage-tree-node-selection/SelectTreeNodeModal.js.map +1 -1
- package/dist/components/RecordEdition/EditRecordContent/uiElements/TreeField/manage-tree-node-selection/useManageTreeNodeSelection.d.ts +4 -2
- package/dist/components/RecordEdition/EditRecordContent/uiElements/TreeField/manage-tree-node-selection/useManageTreeNodeSelection.js +56 -58
- package/dist/components/RecordEdition/EditRecordContent/uiElements/TreeField/manage-tree-node-selection/useManageTreeNodeSelection.js.map +1 -1
- package/dist/components/RecordEdition/EditRecordContent/uiElements/shared/calculatedInheritedFlags.js +4 -4
- package/dist/components/RecordEdition/EditRecordContent/uiElements/shared/calculatedInheritedFlags.js.map +1 -1
- package/dist/components/RecordEdition/EditRecordContent/uiElements/shared/useOutsideInteractionDetector.d.ts +2 -4
- package/dist/components/RecordEdition/EditRecordContent/uiElements/shared/useOutsideInteractionDetector.js +6 -10
- package/dist/components/RecordEdition/EditRecordContent/uiElements/shared/useOutsideInteractionDetector.js.map +1 -1
- package/dist/components/RecordEdition/EditRecordModal/EditRecordModal.js +22 -4
- package/dist/components/RecordEdition/EditRecordModal/EditRecordModal.js.map +1 -1
- package/dist/components/RecordEdition/EditRecordPage/EditRecordPage.js +23 -5
- package/dist/components/RecordEdition/EditRecordPage/EditRecordPage.js.map +1 -1
- package/dist/components/RecordEdition/editRecordReducer/editRecordReducer.d.ts +6 -1
- package/dist/components/RecordEdition/editRecordReducer/editRecordReducer.js +5 -1
- package/dist/components/RecordEdition/editRecordReducer/editRecordReducer.js.map +1 -1
- package/dist/components/RecordEdition/index.d.ts +2 -1
- package/dist/components/RecordEdition/index.js +2 -1
- package/dist/components/RecordEdition/index.js.map +1 -1
- package/dist/components/SelectRecordForLinkModal/SelectRecordForLinkModal.d.ts +2 -1
- package/dist/components/SelectRecordForLinkModal/SelectRecordForLinkModal.js +2 -2
- package/dist/components/SelectRecordForLinkModal/SelectRecordForLinkModal.js.map +1 -1
- package/dist/components/SelectTreeNode/SelectTreeNode.d.ts +5 -3
- package/dist/components/SelectTreeNode/SelectTreeNode.js +2 -3
- package/dist/components/SelectTreeNode/SelectTreeNode.js.map +1 -1
- package/dist/components/SelectTreeNode/SelectTreeNodeContent.d.ts +3 -1
- package/dist/components/SelectTreeNode/SelectTreeNodeContent.js +18 -23
- package/dist/components/SelectTreeNode/SelectTreeNodeContent.js.map +1 -1
- package/dist/components/SelectTreeNode/_types.d.ts +17 -0
- package/dist/components/SelectTreeNode/_types.js +2 -0
- package/dist/components/SelectTreeNode/_types.js.map +1 -0
- package/dist/components/{SelectTreeNodeModal/SelectTreeNodeModal.d.ts → SelectTreeNodeModalOld/SelectTreeNodeModalOld.d.ts} +1 -1
- package/dist/components/{SelectTreeNodeModal/SelectTreeNodeModal.js → SelectTreeNodeModalOld/SelectTreeNodeModalOld.js} +4 -2
- package/dist/components/SelectTreeNodeModalOld/SelectTreeNodeModalOld.js.map +1 -0
- package/dist/components/SelectTreeNodeModalOld/index.d.ts +1 -0
- package/dist/components/{SelectTreeNodeModal → SelectTreeNodeModalOld}/index.js +1 -1
- package/dist/components/SelectTreeNodeModalOld/index.js.map +1 -0
- package/dist/components/ValuesVersionConfigurator/VersionTree/VersionTree.js +2 -2
- package/dist/components/ValuesVersionConfigurator/VersionTree/VersionTree.js.map +1 -1
- package/dist/components/index.d.ts +1 -1
- package/dist/components/index.js +1 -1
- package/dist/components/index.js.map +1 -1
- package/dist/hooks/index.d.ts +2 -0
- package/dist/hooks/index.js +2 -0
- package/dist/hooks/index.js.map +1 -1
- package/dist/hooks/useGetRecordForm/useGetRecordForm.d.ts +2 -1
- package/dist/hooks/useGetRecordForm/useGetRecordForm.js +2 -13
- package/dist/hooks/useGetRecordForm/useGetRecordForm.js.map +1 -1
- package/dist/hooks/useIFrameMessenger/messageHandlers.d.ts +2 -1
- package/dist/hooks/useIFrameMessenger/messageHandlers.js +3 -0
- package/dist/hooks/useIFrameMessenger/messageHandlers.js.map +1 -1
- package/dist/hooks/useIFrameMessenger/schema.d.ts +21 -0
- package/dist/hooks/useIFrameMessenger/schema.js +76 -0
- package/dist/hooks/useIFrameMessenger/schema.js.map +1 -0
- package/dist/hooks/useIFrameMessenger/types.d.ts +29 -56
- package/dist/hooks/useIFrameMessenger/types.js.map +1 -1
- package/dist/hooks/useIFrameMessenger/useIFrameMessenger.d.ts +9 -1
- package/dist/hooks/useIFrameMessenger/useIFrameMessenger.js +55 -20
- package/dist/hooks/useIFrameMessenger/useIFrameMessenger.js.map +1 -1
- package/dist/hooks/useIFrameMessengerClient/IFrameMessengerClient.d.ts +7 -0
- package/dist/hooks/useIFrameMessengerClient/IFrameMessengerClient.js +13 -0
- package/dist/hooks/useIFrameMessengerClient/IFrameMessengerClient.js.map +1 -0
- package/dist/hooks/useIFrameMessengerClient/iFrameMessengerClientContext.d.ts +13 -0
- package/dist/{components/RecordEdition/EditRecord/creationErrorContext.js → hooks/useIFrameMessengerClient/iFrameMessengerClientContext.js} +2 -3
- package/dist/hooks/useIFrameMessengerClient/iFrameMessengerClientContext.js.map +1 -0
- package/dist/hooks/useIFrameMessengerClient/useIFrameMessengerClient.d.ts +13 -0
- package/dist/hooks/useIFrameMessengerClient/useIFrameMessengerClient.js +13 -0
- package/dist/hooks/useIFrameMessengerClient/useIFrameMessengerClient.js.map +1 -0
- package/package.json +22 -6
- package/dist/components/RecordEdition/EditRecord/creationErrorContext.d.ts +0 -6
- package/dist/components/RecordEdition/EditRecord/creationErrorContext.js.map +0 -1
- package/dist/components/RecordEdition/EditRecordContent/hooks/useCreateRecordMutation.d.ts +0 -5
- package/dist/components/RecordEdition/EditRecordContent/hooks/useCreateRecordMutation.js +0 -28
- package/dist/components/RecordEdition/EditRecordContent/hooks/useCreateRecordMutation.js.map +0 -1
- package/dist/components/RecordEdition/EditRecordContent/hooks/useRecordEditionContext.d.ts +0 -3
- package/dist/components/RecordEdition/EditRecordContent/hooks/useRecordEditionContext.js +0 -7
- package/dist/components/RecordEdition/EditRecordContent/hooks/useRecordEditionContext.js.map +0 -1
- package/dist/components/RecordEdition/EditRecordContent/hooks/useRunActionsListAndFormatOnValue.d.ts +0 -121
- package/dist/components/RecordEdition/EditRecordContent/hooks/useRunActionsListAndFormatOnValue.js +0 -31
- package/dist/components/RecordEdition/EditRecordContent/hooks/useRunActionsListAndFormatOnValue.js.map +0 -1
- package/dist/components/RecordEdition/EditRecordContent/uiElements/TreeField/display-tree-node/useDisplayTreeNode.js +0 -8
- package/dist/components/RecordEdition/EditRecordContent/uiElements/TreeField/display-tree-node/useDisplayTreeNode.js.map +0 -1
- package/dist/components/SelectTreeNodeModal/SelectTreeNodeModal.js.map +0 -1
- package/dist/components/SelectTreeNodeModal/index.d.ts +0 -1
- package/dist/components/SelectTreeNodeModal/index.js.map +0 -1
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import * as z from 'zod/v4';
|
|
2
|
+
export declare const PanelIdSchema: z.ZodString;
|
|
3
|
+
export declare const LanguageSchema: z.ZodString;
|
|
4
|
+
export declare const LibraryExplorerPropsSchema: z.ZodObject<{
|
|
5
|
+
showSearch: z.ZodOptional<z.ZodBoolean>;
|
|
6
|
+
defaultActionsForItem: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodLiteral<"edit">, z.ZodLiteral<"replaceLink">, z.ZodLiteral<"remove">, z.ZodLiteral<"activate">]>>>;
|
|
7
|
+
defaultPrimaryActions: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodLiteral<"create">]>>>;
|
|
8
|
+
defaultMassActions: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodLiteral<"deactivate">]>>>;
|
|
9
|
+
showFilters: z.ZodOptional<z.ZodBoolean>;
|
|
10
|
+
showSorts: z.ZodOptional<z.ZodBoolean>;
|
|
11
|
+
freezeView: z.ZodOptional<z.ZodBoolean>;
|
|
12
|
+
showAttributeLabels: z.ZodOptional<z.ZodBoolean>;
|
|
13
|
+
creationFormId: z.ZodOptional<z.ZodString>;
|
|
14
|
+
editionFormId: z.ZodOptional<z.ZodString>;
|
|
15
|
+
noPagination: z.ZodOptional<z.ZodLiteral<true>>;
|
|
16
|
+
}, z.core.$strip>;
|
|
17
|
+
export declare const ItemActionsSchema: z.ZodArray<z.ZodObject<{
|
|
18
|
+
where: z.ZodUnion<readonly [z.ZodLiteral<"popup">, z.ZodLiteral<"slider">, z.ZodLiteral<"fullpage">]>;
|
|
19
|
+
what: z.ZodLazy<any>;
|
|
20
|
+
}, z.core.$strip>>;
|
|
21
|
+
export declare const PanelSchema: any;
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
// Copyright LEAV Solutions 2017 until 2023/11/05, Copyright Aristid from 2023/11/06
|
|
2
|
+
// This file is released under LGPL V3
|
|
3
|
+
// License text available at https://www.gnu.org/licenses/lgpl-3.0.txt
|
|
4
|
+
import * as z from 'zod/v4';
|
|
5
|
+
export const PanelIdSchema = z.string();
|
|
6
|
+
export const LanguageSchema = z.string();
|
|
7
|
+
const CommonExplorerPropsSchema = z.object({
|
|
8
|
+
showSearch: z.boolean().optional(),
|
|
9
|
+
defaultActionsForItem: z
|
|
10
|
+
.array(z.union([z.literal('edit'), z.literal('replaceLink'), z.literal('remove'), z.literal('activate')]))
|
|
11
|
+
.optional(),
|
|
12
|
+
defaultPrimaryActions: z.array(z.union([z.literal('create')])).optional(),
|
|
13
|
+
defaultMassActions: z.array(z.union([z.literal('deactivate')])).optional(),
|
|
14
|
+
showFilters: z.boolean().optional(),
|
|
15
|
+
showSorts: z.boolean().optional(),
|
|
16
|
+
freezeView: z.boolean().optional(),
|
|
17
|
+
showAttributeLabels: z.boolean().optional(),
|
|
18
|
+
creationFormId: z.string().optional(),
|
|
19
|
+
editionFormId: z.string().optional()
|
|
20
|
+
});
|
|
21
|
+
const LinkExplorerPropsSchema = CommonExplorerPropsSchema;
|
|
22
|
+
export const LibraryExplorerPropsSchema = CommonExplorerPropsSchema.extend({
|
|
23
|
+
noPagination: z.literal(true).optional()
|
|
24
|
+
});
|
|
25
|
+
export const ItemActionsSchema = z.array(z.object({
|
|
26
|
+
where: z.union([z.literal('popup'), z.literal('slider'), z.literal('fullpage')]),
|
|
27
|
+
what: z.lazy(() => PanelSchema)
|
|
28
|
+
}));
|
|
29
|
+
export const PanelSchema = z.lazy(() => z
|
|
30
|
+
.object({
|
|
31
|
+
id: PanelIdSchema,
|
|
32
|
+
name: z.record(LanguageSchema, z.string()).optional()
|
|
33
|
+
})
|
|
34
|
+
.and(z.union([
|
|
35
|
+
z.object({
|
|
36
|
+
content: z.union([
|
|
37
|
+
z
|
|
38
|
+
.object({
|
|
39
|
+
type: z.literal('explorer'), // TODO: you can split types into link-explorer and library-explorer
|
|
40
|
+
viewId: z.string().optional(),
|
|
41
|
+
actions: ItemActionsSchema
|
|
42
|
+
})
|
|
43
|
+
.and(z.union([
|
|
44
|
+
z.object({
|
|
45
|
+
// TODO: later add behavior on click on explorer item
|
|
46
|
+
libraryId: z.string(),
|
|
47
|
+
attributeSource: z.string(),
|
|
48
|
+
explorerProps: LinkExplorerPropsSchema.optional()
|
|
49
|
+
}),
|
|
50
|
+
z.object({
|
|
51
|
+
libraryId: z.union([z.literal('<props>'), z.string()]),
|
|
52
|
+
explorerProps: LibraryExplorerPropsSchema.optional()
|
|
53
|
+
})
|
|
54
|
+
])),
|
|
55
|
+
z.object({
|
|
56
|
+
type: z.literal('custom'),
|
|
57
|
+
iframeSource: z.string()
|
|
58
|
+
}),
|
|
59
|
+
z.object({
|
|
60
|
+
type: z.literal('editionForm'),
|
|
61
|
+
formId: z.string(),
|
|
62
|
+
libraryId: z.string()
|
|
63
|
+
}),
|
|
64
|
+
z.object({
|
|
65
|
+
type: z.literal('creationForm'),
|
|
66
|
+
formId: z.string(),
|
|
67
|
+
libraryId: z.string()
|
|
68
|
+
})
|
|
69
|
+
])
|
|
70
|
+
}),
|
|
71
|
+
z.object({
|
|
72
|
+
children: z.array(z.lazy(() => PanelSchema)),
|
|
73
|
+
libraryId: z.string().optional()
|
|
74
|
+
})
|
|
75
|
+
])));
|
|
76
|
+
//# sourceMappingURL=schema.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+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,CAAC,CACL,CACR,CAAC"}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
+
import { type RefObject, type ComponentProps, type Key, type JSXElementConstructor } from 'react';
|
|
2
|
+
import * as z from 'zod/v4';
|
|
1
3
|
import { type KitNotification } from 'aristid-ds';
|
|
2
4
|
import { type IKitConfirmDialog } from 'aristid-ds/dist/Kit/Feedback/Modal/types';
|
|
3
|
-
import { type
|
|
4
|
-
import { EditRecordModal
|
|
5
|
-
import {
|
|
5
|
+
import { type ToastedAlertProps } from 'aristid-ds/dist/Kit/Feedback/Alert/types';
|
|
6
|
+
import { type EditRecordModal } from '../../components';
|
|
7
|
+
import { ItemActionsSchema, type PanelIdSchema, PanelSchema } from '../../hooks/useIFrameMessenger/schema';
|
|
6
8
|
export declare const packetId = "__fromIframeMessenger";
|
|
7
9
|
export interface IEncodedMessage {
|
|
8
10
|
payload: string;
|
|
@@ -59,10 +61,20 @@ export type RegisterMessage = IMessageBase & {
|
|
|
59
61
|
type: 'register';
|
|
60
62
|
id: string;
|
|
61
63
|
};
|
|
62
|
-
type
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
64
|
+
export type UnregisterMessage = IMessageBase & {
|
|
65
|
+
type: 'unregister';
|
|
66
|
+
id: string;
|
|
67
|
+
};
|
|
68
|
+
export type Panel = z.infer<typeof PanelSchema>;
|
|
69
|
+
type PanelId = z.infer<typeof PanelIdSchema>;
|
|
70
|
+
type ItemActions = z.infer<typeof ItemActionsSchema>;
|
|
71
|
+
export interface INestedPanel {
|
|
72
|
+
panelTargetId?: PanelId;
|
|
73
|
+
recordId?: string;
|
|
74
|
+
where: ItemActions[number]['where'];
|
|
75
|
+
what: Panel & {
|
|
76
|
+
recordId?: string;
|
|
77
|
+
};
|
|
66
78
|
}
|
|
67
79
|
export type NavigateToPanelMessage = IMessageBase & {
|
|
68
80
|
type: 'navigate-to-panel';
|
|
@@ -70,56 +82,15 @@ export type NavigateToPanelMessage = IMessageBase & {
|
|
|
70
82
|
panelId: PanelId;
|
|
71
83
|
} | INestedPanel;
|
|
72
84
|
};
|
|
73
|
-
export
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
freezeView?: boolean;
|
|
80
|
-
showAttributeLabels?: boolean;
|
|
81
|
-
creationFormId?: string;
|
|
82
|
-
editionFormId?: string;
|
|
83
|
-
}
|
|
84
|
-
export type LinkExplorerProps = ICommonExplorerProps;
|
|
85
|
-
export type LibraryExplorerProps = {
|
|
86
|
-
noPagination?: true;
|
|
87
|
-
} & ICommonExplorerProps;
|
|
88
|
-
export type ItemActions = Array<{
|
|
89
|
-
what: Panel;
|
|
90
|
-
where: 'popup' | 'slider' | 'fullpage';
|
|
91
|
-
}>;
|
|
92
|
-
export type Panel = {
|
|
93
|
-
id: PanelId;
|
|
94
|
-
name: Record<string, string>;
|
|
95
|
-
} & ({
|
|
96
|
-
content: {
|
|
97
|
-
type: 'explorer';
|
|
98
|
-
attributeSource: string;
|
|
99
|
-
explorerProps?: LinkExplorerProps;
|
|
100
|
-
viewId?: string | null;
|
|
101
|
-
actions: ItemActions;
|
|
102
|
-
} | {
|
|
103
|
-
type: 'explorer';
|
|
104
|
-
libraryId: '<props>' | string;
|
|
105
|
-
explorerProps?: LibraryExplorerProps;
|
|
106
|
-
viewId?: string | null;
|
|
107
|
-
actions: ItemActions;
|
|
108
|
-
} | {
|
|
109
|
-
type: 'custom';
|
|
110
|
-
iframeSource: string;
|
|
111
|
-
child?: Panel;
|
|
112
|
-
} | {
|
|
113
|
-
type: 'editionForm';
|
|
114
|
-
formId: string;
|
|
115
|
-
} | {
|
|
116
|
-
type: 'creationForm';
|
|
117
|
-
formId: string;
|
|
85
|
+
export type MessageToPanelMessage = IMessageBase & {
|
|
86
|
+
type: 'message-to-panel';
|
|
87
|
+
data: {
|
|
88
|
+
type: string;
|
|
89
|
+
target?: string;
|
|
90
|
+
payload: unknown;
|
|
118
91
|
};
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
});
|
|
122
|
-
export type MessageToParent = SidePanelFormMessage | ModalConfirmMessage | ModalFormMessage | AlertMessage | NotificationMessage | SimpleMessage | RegisterMessage | NavigateToPanelMessage;
|
|
92
|
+
};
|
|
93
|
+
export type MessageToParent = SidePanelFormMessage | ModalConfirmMessage | ModalFormMessage | AlertMessage | NotificationMessage | SimpleMessage | RegisterMessage | UnregisterMessage | NavigateToPanelMessage | MessageToPanelMessage;
|
|
123
94
|
export type MessageFromParent = (IMessageBase & {
|
|
124
95
|
type: 'on-call-callback';
|
|
125
96
|
path: string;
|
|
@@ -131,6 +102,8 @@ export type MessageDispatcher<T = Message> = (message: T, frameId?: string) => v
|
|
|
131
102
|
export type CallCbFunction = (path: string, data: unknown, frameId: string) => void;
|
|
132
103
|
export type CallbackFunction = (...args: never[]) => void;
|
|
133
104
|
export type Callbacks = Record<string, Record<string, CallbackFunction>>;
|
|
105
|
+
export type MessageToPanelMessageHandler = (data: MessageToPanelMessage['data']['payload']) => void;
|
|
106
|
+
export type AddMessageToPanelMessageHandler = (type: string, handler: MessageToPanelMessageHandler) => void;
|
|
134
107
|
export interface IUseIFrameMessengerOptions {
|
|
135
108
|
ref?: RefObject<HTMLIFrameElement>;
|
|
136
109
|
id?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/hooks/useIFrameMessenger/types.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/hooks/useIFrameMessenger/types.ts"],"names":[],"mappings":"AAWA,MAAM,CAAC,MAAM,QAAQ,GAAG,uBAAuB,CAAC"}
|
|
@@ -1,6 +1,13 @@
|
|
|
1
|
-
import { type IUseIFrameMessengerOptions } from './types';
|
|
1
|
+
import { AddMessageToPanelMessageHandler, type IUseIFrameMessengerOptions } from './types';
|
|
2
|
+
export { IUseIFrameMessengerOptions };
|
|
3
|
+
/**
|
|
4
|
+
* This is the core of `useIFrameMessenger`. Should be used for top-level apps, such as **app-studio**.
|
|
5
|
+
* For client apps (apps that need to consume the messenger), please use the `useIFrameMessengerClient`
|
|
6
|
+
*/
|
|
2
7
|
export declare const useIFrameMessenger: (options?: IUseIFrameMessengerOptions) => {
|
|
8
|
+
unregister: () => void;
|
|
3
9
|
changeLangInAllFrames: (newLanguage: string) => void;
|
|
10
|
+
addPanelMessageHandler: AddMessageToPanelMessageHandler;
|
|
4
11
|
showSidePanelForm: (data: import("./types").SidePanelFormMessage["data"]) => void;
|
|
5
12
|
showModalConfirm: (data: import("./types").ModalConfirmMessage["data"]) => void;
|
|
6
13
|
showModalForm: (data: import("./types").ModalFormMessage["data"]) => void;
|
|
@@ -8,4 +15,5 @@ export declare const useIFrameMessenger: (options?: IUseIFrameMessengerOptions)
|
|
|
8
15
|
showNotification: (data: import("./types").NotificationMessage["data"]) => void;
|
|
9
16
|
messageToParent: (data: import("./types").SimpleMessage["data"]) => void;
|
|
10
17
|
navigateToPanel: (data: import("./types").NavigateToPanelMessage["data"]) => void;
|
|
18
|
+
messageToPanel: (data: import("./types").MessageToPanelMessage["data"]) => void;
|
|
11
19
|
};
|
|
@@ -5,6 +5,10 @@ import { useCallback, useContext, useEffect, useRef } from 'react';
|
|
|
5
5
|
import { v4 as uuid } from 'uuid';
|
|
6
6
|
import { LangContext } from '../../contexts';
|
|
7
7
|
import { encodeMessage, decodeMessage, getExposedMethods, initClientHandlers } from './messageHandlers';
|
|
8
|
+
/**
|
|
9
|
+
* This is the core of `useIFrameMessenger`. Should be used for top-level apps, such as **app-studio**.
|
|
10
|
+
* For client apps (apps that need to consume the messenger), please use the `useIFrameMessengerClient`
|
|
11
|
+
*/
|
|
8
12
|
export const useIFrameMessenger = (options) => {
|
|
9
13
|
const registry = useRef({});
|
|
10
14
|
const selfId = useRef(options?.id ?? uuid());
|
|
@@ -15,6 +19,10 @@ export const useIFrameMessenger = (options) => {
|
|
|
15
19
|
language: newLanguage
|
|
16
20
|
}, 'all');
|
|
17
21
|
};
|
|
22
|
+
const panelMessageHandlerRegistry = useRef({});
|
|
23
|
+
const addPanelMessageHandler = (type, handler) => {
|
|
24
|
+
panelMessageHandlerRegistry.current[type] = handler;
|
|
25
|
+
};
|
|
18
26
|
const dispatch = useCallback((message, frameId) => {
|
|
19
27
|
if (window !== window.top) {
|
|
20
28
|
window.parent.postMessage(encodeMessage({ ...message, __frameId: selfId.current }), '*');
|
|
@@ -23,16 +31,29 @@ export const useIFrameMessenger = (options) => {
|
|
|
23
31
|
registry.current[frameId].postMessage(encodeMessage({ ...message, __frameId: selfId.current }), '*');
|
|
24
32
|
}
|
|
25
33
|
else if (frameId === 'all') {
|
|
26
|
-
Object.
|
|
27
|
-
|
|
34
|
+
Object.entries(registry.current).forEach(([id, frame]) => {
|
|
35
|
+
if (id !== message.__frameId) {
|
|
36
|
+
// DO not send the message to the sender
|
|
37
|
+
frame.postMessage(encodeMessage({ ...message, __frameId: selfId.current }), '*');
|
|
38
|
+
}
|
|
28
39
|
});
|
|
29
40
|
}
|
|
30
41
|
}, [registry.current]);
|
|
31
42
|
const callCb = useCallback((path, data, frameId) => {
|
|
32
43
|
dispatch({ type: 'on-call-callback', path, data }, frameId);
|
|
33
44
|
}, [dispatch]);
|
|
45
|
+
const unregister = () => {
|
|
46
|
+
if (window !== window.top) {
|
|
47
|
+
dispatch({ type: 'unregister', id: selfId.current });
|
|
48
|
+
}
|
|
49
|
+
};
|
|
34
50
|
const callbacksStore = useRef({});
|
|
35
|
-
const methods = useRef(
|
|
51
|
+
const methods = useRef({
|
|
52
|
+
...getExposedMethods(callbacksStore, dispatch),
|
|
53
|
+
unregister,
|
|
54
|
+
changeLangInAllFrames,
|
|
55
|
+
addPanelMessageHandler
|
|
56
|
+
});
|
|
36
57
|
useEffect(() => {
|
|
37
58
|
const clientHandlers = initClientHandlers(callCb, { ...options, id: selfId.current }, callbacksStore);
|
|
38
59
|
const onMessage = (event) => {
|
|
@@ -40,23 +61,37 @@ export const useIFrameMessenger = (options) => {
|
|
|
40
61
|
if (message === undefined) {
|
|
41
62
|
return;
|
|
42
63
|
}
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
64
|
+
switch (message.type) {
|
|
65
|
+
case 'register':
|
|
66
|
+
const frames = window.frames;
|
|
67
|
+
// Due to weak typing on Window, we cannot iterate directly on window.frames
|
|
68
|
+
// eslint-disable-next-line @typescript-eslint/prefer-for-of
|
|
69
|
+
for (let i = 0; i < frames.length; i++) {
|
|
70
|
+
if (event.source === frames[i]) {
|
|
71
|
+
registry.current[message.id] = frames[i];
|
|
72
|
+
}
|
|
50
73
|
}
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
74
|
+
break;
|
|
75
|
+
case 'unregister':
|
|
76
|
+
if (registry.current[message.id]) {
|
|
77
|
+
delete registry.current[message.id];
|
|
78
|
+
}
|
|
79
|
+
break;
|
|
80
|
+
case 'message-to-panel':
|
|
81
|
+
panelMessageHandlerRegistry.current[message.data.type]?.(message.data.payload);
|
|
82
|
+
if (window === window.top) {
|
|
83
|
+
const target = message.data.target ?? 'all';
|
|
84
|
+
dispatch(message, target);
|
|
85
|
+
}
|
|
86
|
+
break;
|
|
87
|
+
default:
|
|
88
|
+
if (message.type === 'change-language') {
|
|
89
|
+
setLang(message.language);
|
|
90
|
+
}
|
|
91
|
+
else {
|
|
92
|
+
clientHandlers(message, dispatch);
|
|
93
|
+
}
|
|
94
|
+
break;
|
|
60
95
|
}
|
|
61
96
|
};
|
|
62
97
|
window.addEventListener('message', onMessage);
|
|
@@ -68,6 +103,6 @@ export const useIFrameMessenger = (options) => {
|
|
|
68
103
|
window.removeEventListener('message', onMessage);
|
|
69
104
|
};
|
|
70
105
|
}, []);
|
|
71
|
-
return
|
|
106
|
+
return methods.current;
|
|
72
107
|
};
|
|
73
108
|
//# sourceMappingURL=useIFrameMessenger.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useIFrameMessenger.js","sourceRoot":"","sources":["../../../src/hooks/useIFrameMessenger/useIFrameMessenger.
|
|
1
|
+
{"version":3,"file":"useIFrameMessenger.js","sourceRoot":"","sources":["../../../src/hooks/useIFrameMessenger/useIFrameMessenger.ts"],"names":[],"mappings":"AAAA,oFAAoF;AACpF,sCAAsC;AACtC,sEAAsE;AACtE,OAAO,EAAC,WAAW,EAAE,UAAU,EAAE,SAAS,EAAW,MAAM,EAAC,MAAM,OAAO,CAAC;AAC1E,OAAO,EAAC,EAAE,IAAI,IAAI,EAAC,MAAM,MAAM,CAAC;AAChC,OAAO,EAAC,WAAW,EAAC,MAAM,cAAc,CAAC;AASzC,OAAO,EAAC,aAAa,EAAE,aAAa,EAAE,iBAAiB,EAAE,kBAAkB,EAAC,MAAM,mBAAmB,CAAC;AAItG;;;GAGG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,OAAoC,EAAE,EAAE;IACvE,MAAM,QAAQ,GAAG,MAAM,CAAyB,EAAE,CAAC,CAAC;IACpD,MAAM,MAAM,GAAG,MAAM,CAAC,OAAO,EAAE,EAAE,IAAI,IAAI,EAAE,CAAC,CAAC;IAE7C,MAAM,EAAC,OAAO,EAAC,GAAG,UAAU,CAAC,WAAW,CAAC,CAAC;IAC1C,MAAM,qBAAqB,GAAG,CAAC,WAAmB,EAAE,EAAE;QAClD,QAAQ,CACJ;YACI,IAAI,EAAE,iBAAiB;YACvB,QAAQ,EAAE,WAAW;SACxB,EACD,KAAK,CACR,CAAC;IACN,CAAC,CAAC;IAEF,MAAM,2BAA2B,GAAG,MAAM,CAA+C,EAAE,CAAC,CAAC;IAC7F,MAAM,sBAAsB,GAAoC,CAC5D,IAAY,EACZ,OAAqC,EACvC,EAAE;QACA,2BAA2B,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,OAAO,CAAC;IACxD,CA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@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
// Copyright LEAV Solutions 2017 until 2023/11/05, Copyright Aristid from 2023/11/06
|
|
3
|
+
// This file is released under LGPL V3
|
|
4
|
+
// License text available at https://www.gnu.org/licenses/lgpl-3.0.txt
|
|
5
|
+
import { useEffect } from 'react';
|
|
6
|
+
import { useIFrameMessenger } from '../useIFrameMessenger/useIFrameMessenger';
|
|
7
|
+
import { IframeMessengerClientContext } from './iFrameMessengerClientContext';
|
|
8
|
+
export const IFrameMessengerClient = ({ children, id }) => {
|
|
9
|
+
const iFrameMessenger = useIFrameMessenger({ id });
|
|
10
|
+
useEffect(() => () => iFrameMessenger.unregister(), []);
|
|
11
|
+
return (_jsx(IframeMessengerClientContext.Provider, { value: iFrameMessenger, children: children }));
|
|
12
|
+
};
|
|
13
|
+
//# sourceMappingURL=IFrameMessengerClient.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IFrameMessengerClient.js","sourceRoot":"","sources":["../../../src/hooks/useIFrameMessengerClient/IFrameMessengerClient.tsx"],"names":[],"mappings":";AAAA,oFAAoF;AACpF,sCAAsC;AACtC,sEAAsE;AACtE,OAAO,EAA+B,SAAS,EAAC,MAAM,OAAO,CAAC;AAC9D,OAAO,EAAC,kBAAkB,EAAC,MAAM,0CAA0C,CAAC;AAC5E,OAAO,EAAC,4BAA4B,EAAC,MAAM,gCAAgC,CAAC;AAO5E,MAAM,CAAC,MAAM,qBAAqB,GAAkD,CAAC,EAAC,QAAQ,EAAE,EAAE,EAAC,EAAE,EAAE;IACnG,MAAM,eAAe,GAAG,kBAAkB,CAAC,EAAC,EAAE,EAAC,CAAC,CAAC;IAEjD,SAAS,CAAC,GAAG,EAAE,CAAC,GAAG,EAAE,CAAC,eAAe,CAAC,UAAU,EAAE,EAAE,EAAE,CAAC,CAAC;IAExD,OAAO,CACH,KAAC,4BAA4B,CAAC,QAAQ,IAAC,KAAK,EAAE,eAAe,YACxD,QAAQ,GAC2B,CAC3C,CAAC;AACN,CAAC,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export declare const IframeMessengerClientContext: import("react").Context<{
|
|
2
|
+
unregister: () => void;
|
|
3
|
+
changeLangInAllFrames: (newLanguage: string) => void;
|
|
4
|
+
addPanelMessageHandler: import("../useIFrameMessenger/types").AddMessageToPanelMessageHandler;
|
|
5
|
+
showSidePanelForm: (data: import("../useIFrameMessenger/types").SidePanelFormMessage["data"]) => void;
|
|
6
|
+
showModalConfirm: (data: import("../useIFrameMessenger/types").ModalConfirmMessage["data"]) => void;
|
|
7
|
+
showModalForm: (data: import("../useIFrameMessenger/types").ModalFormMessage["data"]) => void;
|
|
8
|
+
showAlert: (data: import("../useIFrameMessenger/types").AlertMessage["data"]) => void;
|
|
9
|
+
showNotification: (data: import("../useIFrameMessenger/types").NotificationMessage["data"]) => void;
|
|
10
|
+
messageToParent: (data: import("../useIFrameMessenger/types").SimpleMessage["data"]) => void;
|
|
11
|
+
navigateToPanel: (data: import("../useIFrameMessenger/types").NavigateToPanelMessage["data"]) => void;
|
|
12
|
+
messageToPanel: (data: import("../useIFrameMessenger/types").MessageToPanelMessage["data"]) => void;
|
|
13
|
+
}>;
|
|
@@ -2,6 +2,5 @@
|
|
|
2
2
|
// This file is released under LGPL V3
|
|
3
3
|
// License text available at https://www.gnu.org/licenses/lgpl-3.0.txt
|
|
4
4
|
import { createContext } from 'react';
|
|
5
|
-
const
|
|
6
|
-
|
|
7
|
-
//# sourceMappingURL=creationErrorContext.js.map
|
|
5
|
+
export const IframeMessengerClientContext = createContext(null);
|
|
6
|
+
//# sourceMappingURL=iFrameMessengerClientContext.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"iFrameMessengerClientContext.js","sourceRoot":"","sources":["../../../src/hooks/useIFrameMessengerClient/iFrameMessengerClientContext.tsx"],"names":[],"mappings":"AAAA,oFAAoF;AACpF,sCAAsC;AACtC,sEAAsE;AACtE,OAAO,EAAC,aAAa,EAAC,MAAM,OAAO,CAAC;AAKpC,MAAM,CAAC,MAAM,4BAA4B,GAAG,aAAa,CAAoC,IAAI,CAAC,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export declare const useIFrameMessengerClient: () => {
|
|
2
|
+
unregister: () => void;
|
|
3
|
+
changeLangInAllFrames: (newLanguage: string) => void;
|
|
4
|
+
addPanelMessageHandler: import("../useIFrameMessenger/types").AddMessageToPanelMessageHandler;
|
|
5
|
+
showSidePanelForm: (data: import("../useIFrameMessenger/types").SidePanelFormMessage["data"]) => void;
|
|
6
|
+
showModalConfirm: (data: import("../useIFrameMessenger/types").ModalConfirmMessage["data"]) => void;
|
|
7
|
+
showModalForm: (data: import("../useIFrameMessenger/types").ModalFormMessage["data"]) => void;
|
|
8
|
+
showAlert: (data: import("../useIFrameMessenger/types").AlertMessage["data"]) => void;
|
|
9
|
+
showNotification: (data: import("../useIFrameMessenger/types").NotificationMessage["data"]) => void;
|
|
10
|
+
messageToParent: (data: import("../useIFrameMessenger/types").SimpleMessage["data"]) => void;
|
|
11
|
+
navigateToPanel: (data: import("../useIFrameMessenger/types").NavigateToPanelMessage["data"]) => void;
|
|
12
|
+
messageToPanel: (data: import("../useIFrameMessenger/types").MessageToPanelMessage["data"]) => void;
|
|
13
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
// Copyright LEAV Solutions 2017 until 2023/11/05, Copyright Aristid from 2023/11/06
|
|
2
|
+
// This file is released under LGPL V3
|
|
3
|
+
// License text available at https://www.gnu.org/licenses/lgpl-3.0.txt
|
|
4
|
+
import { useContext } from 'react';
|
|
5
|
+
import { IframeMessengerClientContext } from './iFrameMessengerClientContext';
|
|
6
|
+
export const useIFrameMessengerClient = () => {
|
|
7
|
+
const context = useContext(IframeMessengerClientContext);
|
|
8
|
+
if (!context) {
|
|
9
|
+
throw new Error('IframeMessengerClientContext must be used within an IframeMessengerClient');
|
|
10
|
+
}
|
|
11
|
+
return context;
|
|
12
|
+
};
|
|
13
|
+
//# sourceMappingURL=useIFrameMessengerClient.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useIFrameMessengerClient.js","sourceRoot":"","sources":["../../../src/hooks/useIFrameMessengerClient/useIFrameMessengerClient.tsx"],"names":[],"mappings":"AAAA,oFAAoF;AACpF,sCAAsC;AACtC,sEAAsE;AACtE,OAAO,EAAC,UAAU,EAAC,MAAM,OAAO,CAAC;AACjC,OAAO,EAAC,4BAA4B,EAAC,MAAM,gCAAgC,CAAC;AAE5E,MAAM,CAAC,MAAM,wBAAwB,GAAG,GAAG,EAAE;IACzC,MAAM,OAAO,GAAG,UAAU,CAAC,4BAA4B,CAAC,CAAC;IACzD,IAAI,CAAC,OAAO,EAAE,CAAC;QACX,MAAM,IAAI,KAAK,CAAC,2EAA2E,CAAC,CAAC;IACjG,CAAC;IACD,OAAO,OAAO,CAAC;AACnB,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@leav/ui",
|
|
3
|
-
"version": "0.4.0-
|
|
3
|
+
"version": "0.4.0-abaf374e",
|
|
4
4
|
"description": "Shared React components and hooks",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"prepublishOnly": "yarn build",
|
|
@@ -13,7 +13,9 @@
|
|
|
13
13
|
"test:ci": "jest --maxWorkers=2",
|
|
14
14
|
"test:commit": "jest --maxWorkers=50% --onlyChanged",
|
|
15
15
|
"create_comp": "scripts/createComponent.js",
|
|
16
|
-
"publish-ui": "npm publish --access public"
|
|
16
|
+
"publish-ui": "npm publish --access public",
|
|
17
|
+
"get-version": "jq -r '.version' package.json",
|
|
18
|
+
"set-version": "jq --arg v $1 '.version = $v' package.json > package.tmp.json && mv package.tmp.json package.json"
|
|
17
19
|
},
|
|
18
20
|
"main": "dist/index",
|
|
19
21
|
"files": [
|
|
@@ -23,6 +25,7 @@
|
|
|
23
25
|
"license": "LGPL3",
|
|
24
26
|
"repository": "https://github.com/leav-solutions/leav-engine",
|
|
25
27
|
"devDependencies": {
|
|
28
|
+
"@apollo/client": "3.8.1",
|
|
26
29
|
"@babel/preset-env": "7.20.2",
|
|
27
30
|
"@babel/preset-react": "7.18.6",
|
|
28
31
|
"@graphql-codegen/add": "5.0.0",
|
|
@@ -36,23 +39,35 @@
|
|
|
36
39
|
"@types/jest": "29.0.2",
|
|
37
40
|
"@types/lodash.isequal": "^4",
|
|
38
41
|
"@types/object-path": "0.11.1",
|
|
42
|
+
"@types/react": "18.2.14",
|
|
39
43
|
"@types/react-beautiful-dnd": "13.1.2",
|
|
44
|
+
"@types/react-dom": "18.2.6",
|
|
40
45
|
"@types/react-table": "7.7.12",
|
|
41
46
|
"@types/uuid": "^9",
|
|
47
|
+
"antd": "5.22.2",
|
|
48
|
+
"aristid-ds": "14.0.0-7e64d60",
|
|
42
49
|
"babel-jest": "29.3.1",
|
|
43
50
|
"commander": "9.5.0",
|
|
51
|
+
"graphql": "16.6.0",
|
|
52
|
+
"i18next": "22.5.0",
|
|
44
53
|
"jest": "29.0.3",
|
|
45
54
|
"jest-environment-jsdom": "29.3.1",
|
|
46
55
|
"jest-styled-components": "7.1.1",
|
|
56
|
+
"react": "18.2.0",
|
|
57
|
+
"react-dom": "18.2.0",
|
|
58
|
+
"react-i18next": "12",
|
|
59
|
+
"react-router-dom": "6.22.0",
|
|
60
|
+
"styled-components": "6.0.8",
|
|
47
61
|
"ts-jest": "29.0.1",
|
|
48
62
|
"tsc-alias": "1.8.8",
|
|
49
|
-
"typescript": "5.5.3"
|
|
63
|
+
"typescript": "5.5.3",
|
|
64
|
+
"vite": "4.5.14"
|
|
50
65
|
},
|
|
51
66
|
"peerDependencies": {
|
|
52
67
|
"@ant-design/icons": ">=5.2",
|
|
53
68
|
"@apollo/client": ">=3.8.1",
|
|
54
69
|
"antd": "5.22.2",
|
|
55
|
-
"aristid-ds": "
|
|
70
|
+
"aristid-ds": "14.0.0-7e64d60",
|
|
56
71
|
"dayjs": "^1.11.13",
|
|
57
72
|
"i18next": "22.5",
|
|
58
73
|
"react": "18.2.0",
|
|
@@ -80,6 +95,7 @@
|
|
|
80
95
|
"react-table": "7.8.0",
|
|
81
96
|
"react-table-sticky": "1.1.3",
|
|
82
97
|
"uuid": "9.0.1",
|
|
83
|
-
"xlsx": "0.18.5"
|
|
98
|
+
"xlsx": "0.18.5",
|
|
99
|
+
"zod": "3.25.67"
|
|
84
100
|
}
|
|
85
|
-
}
|
|
101
|
+
}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { CreateRecordMutation } from '../../../_gqlTypes';
|
|
2
|
-
export interface ICreationErrorByField {
|
|
3
|
-
[attributeId: string]: CreateRecordMutation['createRecord']['valuesErrors'];
|
|
4
|
-
}
|
|
5
|
-
declare const CreationErrorContext: import("react").Context<ICreationErrorByField>;
|
|
6
|
-
export default CreationErrorContext;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"creationErrorContext.js","sourceRoot":"","sources":["../../../../src/components/RecordEdition/EditRecord/creationErrorContext.ts"],"names":[],"mappings":"AAAA,oFAAoF;AACpF,sCAAsC;AACtC,sEAAsE;AACtE,OAAO,EAAC,aAAa,EAAC,MAAM,OAAO,CAAC;AAMpC,MAAM,oBAAoB,GAAG,aAAa,CAAwB,EAAE,CAAC,CAAC;AAEtE,eAAe,oBAAoB,CAAC"}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
// Copyright LEAV Solutions 2017 until 2023/11/05, Copyright Aristid from 2023/11/06
|
|
2
|
-
// This file is released under LGPL V3
|
|
3
|
-
// License text available at https://www.gnu.org/licenses/lgpl-3.0.txt
|
|
4
|
-
import { useCreateRecordMutation } from '../../../../_gqlTypes';
|
|
5
|
-
import { APICallStatus } from '../_types';
|
|
6
|
-
export default function useExecuteCreateRecordMutation() {
|
|
7
|
-
const [executeCreateRecord] = useCreateRecordMutation();
|
|
8
|
-
return {
|
|
9
|
-
createRecord: async (libraryId, values) => {
|
|
10
|
-
const creationResult = await executeCreateRecord({
|
|
11
|
-
variables: { library: libraryId, data: { values } }
|
|
12
|
-
});
|
|
13
|
-
if (creationResult.data.createRecord.valuesErrors?.length > 0) {
|
|
14
|
-
return {
|
|
15
|
-
status: APICallStatus.ERROR,
|
|
16
|
-
errors: creationResult.data.createRecord.valuesErrors
|
|
17
|
-
};
|
|
18
|
-
}
|
|
19
|
-
else {
|
|
20
|
-
return {
|
|
21
|
-
status: APICallStatus.SUCCESS,
|
|
22
|
-
record: creationResult.data.createRecord.record.whoAmI
|
|
23
|
-
};
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
};
|
|
27
|
-
}
|
|
28
|
-
//# sourceMappingURL=useCreateRecordMutation.js.map
|
package/dist/components/RecordEdition/EditRecordContent/hooks/useCreateRecordMutation.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useCreateRecordMutation.js","sourceRoot":"","sources":["../../../../../src/components/RecordEdition/EditRecordContent/hooks/useCreateRecordMutation.ts"],"names":[],"mappings":"AAAA,oFAAoF;AACpF,sCAAsC;AACtC,sEAAsE;AACtE,OAAO,EAAC,uBAAuB,EAAC,MAAM,eAAe,CAAC;AACtD,OAAO,EAAC,aAAa,EAAmB,MAAM,WAAW,CAAC;AAM1D,MAAM,CAAC,OAAO,UAAU,8BAA8B;IAClD,MAAM,CAAC,mBAAmB,CAAC,GAAG,uBAAuB,EAAE,CAAC;IAExD,OAAO;QACH,YAAY,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE;YACtC,MAAM,cAAc,GAAG,MAAM,mBAAmB,CAAC;gBAC7C,SAAS,EAAE,EAAC,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,EAAC,MAAM,EAAC,EAAC;aAClD,CAAC,CAAC;YACH,IAAI,cAAc,CAAC,IAAI,CAAC,YAAY,CAAC,YAAY,EAAE,MAAM,GAAG,CAAC,EAAE,CAAC;gBAC5D,OAAO;oBACH,MAAM,EAAE,aAAa,CAAC,KAAK;oBAC3B,MAAM,EAAE,cAAc,CAAC,IAAI,CAAC,YAAY,CAAC,YAAY;iBACxD,CAAC;YACN,CAAC;iBAAM,CAAC;gBACJ,OAAO;oBACH,MAAM,EAAE,aAAa,CAAC,OAAO;oBAC7B,MAAM,EAAE,cAAc,CAAC,IAAI,CAAC,YAAY,CAAC,MAAM,CAAC,MAAM;iBACzD,CAAC;YACN,CAAC;QACL,CAAC;KACJ,CAAC;AACN,CAAC"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
// Copyright LEAV Solutions 2017 until 2023/11/05, Copyright Aristid from 2023/11/06
|
|
2
|
-
// This file is released under LGPL V3
|
|
3
|
-
// License text available at https://www.gnu.org/licenses/lgpl-3.0.txt
|
|
4
|
-
import { createContext, useContext } from 'react';
|
|
5
|
-
export const RecordEditionContext = createContext({ elements: {}, readOnly: false, record: null });
|
|
6
|
-
export const useRecordEditionContext = () => useContext(RecordEditionContext);
|
|
7
|
-
//# sourceMappingURL=useRecordEditionContext.js.map
|
package/dist/components/RecordEdition/EditRecordContent/hooks/useRecordEditionContext.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useRecordEditionContext.js","sourceRoot":"","sources":["../../../../../src/components/RecordEdition/EditRecordContent/hooks/useRecordEditionContext.ts"],"names":[],"mappings":"AAAA,oFAAoF;AACpF,sCAAsC;AACtC,sEAAsE;AACtE,OAAO,EAAC,aAAa,EAAE,UAAU,EAAC,MAAM,OAAO,CAAC;AAGhD,MAAM,CAAC,MAAM,oBAAoB,GAAG,aAAa,CAAwB,EAAC,QAAQ,EAAE,EAAE,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAC,CAAC,CAAC;AAExH,MAAM,CAAC,MAAM,uBAAuB,GAAG,GAAG,EAAE,CAAC,UAAU,CAAC,oBAAoB,CAAC,CAAC"}
|