@leav/ui 1.5.3 → 1.6.0-22577b27

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.
Files changed (189) hide show
  1. package/dist/_gqlTypes/index.d.ts +640 -701
  2. package/dist/_gqlTypes/index.js +50 -167
  3. package/dist/_gqlTypes/index.js.map +1 -1
  4. package/dist/_queries/trees/treeNodeChildrenQuery.js +2 -0
  5. package/dist/_queries/trees/treeNodeChildrenQuery.js.map +1 -1
  6. package/dist/_queries/views/viewDetailsFragment.js +1 -0
  7. package/dist/_queries/views/viewDetailsFragment.js.map +1 -1
  8. package/dist/components/AttributesSelectionList/sharedComponents.d.ts +159 -153
  9. package/dist/components/Explorer/Explorer.js +5 -3
  10. package/dist/components/Explorer/Explorer.js.map +1 -1
  11. package/dist/components/Explorer/ExplorerFiltersAndSorts.js +1 -1
  12. package/dist/components/Explorer/ExplorerFiltersAndSorts.js.map +1 -1
  13. package/dist/components/Explorer/TableCell.js +6 -7
  14. package/dist/components/Explorer/TableCell.js.map +1 -1
  15. package/dist/components/Explorer/TableNameCell.js +9 -3
  16. package/dist/components/Explorer/TableNameCell.js.map +1 -1
  17. package/dist/components/Explorer/_queries/useExplorerData.d.ts +7 -7
  18. package/dist/components/Explorer/_queries/useExplorerData.js +19 -7
  19. package/dist/components/Explorer/_queries/useExplorerData.js.map +1 -1
  20. package/dist/components/Explorer/_types.d.ts +1 -0
  21. package/dist/components/Explorer/_types.js.map +1 -1
  22. package/dist/components/Explorer/actions-item/useEditStatusItemAction.js +3 -2
  23. package/dist/components/Explorer/actions-item/useEditStatusItemAction.js.map +1 -1
  24. package/dist/components/Explorer/actions-item/useReplaceItemAction.d.ts +2 -1
  25. package/dist/components/Explorer/actions-item/useReplaceItemAction.js +5 -4
  26. package/dist/components/Explorer/actions-item/useReplaceItemAction.js.map +1 -1
  27. package/dist/components/Explorer/actions-mass/export/ExportProfileSelectionModal.d.ts +10 -0
  28. package/dist/components/Explorer/actions-mass/export/ExportProfileSelectionModal.js +46 -0
  29. package/dist/components/Explorer/actions-mass/export/ExportProfileSelectionModal.js.map +1 -0
  30. package/dist/components/Explorer/actions-mass/export/content/NoProfiles.d.ts +1 -0
  31. package/dist/components/Explorer/actions-mass/export/content/NoProfiles.js +17 -0
  32. package/dist/components/Explorer/actions-mass/export/content/NoProfiles.js.map +1 -0
  33. package/dist/components/Explorer/actions-mass/export/content/ProfilesSelection.d.ts +8 -0
  34. package/dist/components/Explorer/actions-mass/export/content/ProfilesSelection.js +49 -0
  35. package/dist/components/Explorer/actions-mass/export/content/ProfilesSelection.js.map +1 -0
  36. package/dist/components/Explorer/actions-mass/export/useGetLibraryExportProfiles.d.ts +27 -0
  37. package/dist/components/Explorer/actions-mass/export/useGetLibraryExportProfiles.js +48 -0
  38. package/dist/components/Explorer/actions-mass/export/useGetLibraryExportProfiles.js.map +1 -0
  39. package/dist/components/Explorer/actions-mass/useDeactivateMassAction.js +3 -2
  40. package/dist/components/Explorer/actions-mass/useDeactivateMassAction.js.map +1 -1
  41. package/dist/components/Explorer/actions-mass/useDeleteLinkValues.js +3 -2
  42. package/dist/components/Explorer/actions-mass/useDeleteLinkValues.js.map +1 -1
  43. package/dist/components/Explorer/actions-mass/useEditAttributeMassAction.js +8 -7
  44. package/dist/components/Explorer/actions-mass/useEditAttributeMassAction.js.map +1 -1
  45. package/dist/components/Explorer/actions-mass/useExportMassAction.d.ts +7 -4
  46. package/dist/components/Explorer/actions-mass/useExportMassAction.js +81 -74
  47. package/dist/components/Explorer/actions-mass/useExportMassAction.js.map +1 -1
  48. package/dist/components/Explorer/actions-mass/useMassActions.js +3 -2
  49. package/dist/components/Explorer/actions-mass/useMassActions.js.map +1 -1
  50. package/dist/components/Explorer/actions-primary/useCreatePrimaryAction.js +3 -2
  51. package/dist/components/Explorer/actions-primary/useCreatePrimaryAction.js.map +1 -1
  52. package/dist/components/Explorer/actions-primary/useLinkPrimaryAction.d.ts +2 -1
  53. package/dist/components/Explorer/actions-primary/useLinkPrimaryAction.js +5 -4
  54. package/dist/components/Explorer/actions-primary/useLinkPrimaryAction.js.map +1 -1
  55. package/dist/components/Explorer/link-item/LinkModal.d.ts +1 -0
  56. package/dist/components/Explorer/link-item/LinkModal.js +2 -2
  57. package/dist/components/Explorer/link-item/LinkModal.js.map +1 -1
  58. package/dist/components/Explorer/list-saved-views/SavedViews.js +12 -9
  59. package/dist/components/Explorer/list-saved-views/SavedViews.js.map +1 -1
  60. package/dist/components/Explorer/manage-view-settings/_shared/ColumnItem.js +5 -8
  61. package/dist/components/Explorer/manage-view-settings/_shared/ColumnItem.js.map +1 -1
  62. package/dist/components/Explorer/manage-view-settings/configure-display/attributes/SelectVisibleAttributes.js +3 -2
  63. package/dist/components/Explorer/manage-view-settings/configure-display/attributes/SelectVisibleAttributes.js.map +1 -1
  64. package/dist/components/Explorer/manage-view-settings/filter-items/FilterItems.js +7 -6
  65. package/dist/components/Explorer/manage-view-settings/filter-items/FilterItems.js.map +1 -1
  66. package/dist/components/Explorer/manage-view-settings/filter-items/FilterListItem.js +3 -2
  67. package/dist/components/Explorer/manage-view-settings/filter-items/FilterListItem.js.map +1 -1
  68. package/dist/components/Explorer/manage-view-settings/open-view-settings/useOpenViewSettings.js +4 -3
  69. package/dist/components/Explorer/manage-view-settings/open-view-settings/useOpenViewSettings.js.map +1 -1
  70. package/dist/components/Explorer/manage-view-settings/router-menu/SettingItem.js +3 -2
  71. package/dist/components/Explorer/manage-view-settings/router-menu/SettingItem.js.map +1 -1
  72. package/dist/components/Explorer/manage-view-settings/router-menu/SettingsPanel.js +3 -2
  73. package/dist/components/Explorer/manage-view-settings/router-menu/SettingsPanel.js.map +1 -1
  74. package/dist/components/Explorer/manage-view-settings/save-view/LabelViewFormModal.js +3 -2
  75. package/dist/components/Explorer/manage-view-settings/save-view/LabelViewFormModal.js.map +1 -1
  76. package/dist/components/Explorer/manage-view-settings/save-view/prepareViewForRequest.js +3 -0
  77. package/dist/components/Explorer/manage-view-settings/save-view/prepareViewForRequest.js.map +1 -1
  78. package/dist/components/Explorer/manage-view-settings/save-view/useCreateNewView.js +3 -2
  79. package/dist/components/Explorer/manage-view-settings/save-view/useCreateNewView.js.map +1 -1
  80. package/dist/components/Explorer/manage-view-settings/save-view/useDeleteView.js +4 -3
  81. package/dist/components/Explorer/manage-view-settings/save-view/useDeleteView.js.map +1 -1
  82. package/dist/components/Explorer/manage-view-settings/save-view/useEditLabelView.js +3 -2
  83. package/dist/components/Explorer/manage-view-settings/save-view/useEditLabelView.js.map +1 -1
  84. package/dist/components/Explorer/manage-view-settings/save-view/useResetView.js +3 -2
  85. package/dist/components/Explorer/manage-view-settings/save-view/useResetView.js.map +1 -1
  86. package/dist/components/Explorer/manage-view-settings/save-view/useShareView.js +3 -2
  87. package/dist/components/Explorer/manage-view-settings/save-view/useShareView.js.map +1 -1
  88. package/dist/components/Explorer/manage-view-settings/save-view/useUpdateView.js +3 -2
  89. package/dist/components/Explorer/manage-view-settings/save-view/useUpdateView.js.map +1 -1
  90. package/dist/components/Explorer/manage-view-settings/sort-items/SortItems.js +7 -6
  91. package/dist/components/Explorer/manage-view-settings/sort-items/SortItems.js.map +1 -1
  92. package/dist/components/Explorer/manage-view-settings/sort-items/SortListItem.js +3 -2
  93. package/dist/components/Explorer/manage-view-settings/sort-items/SortListItem.js.map +1 -1
  94. package/dist/components/Explorer/manage-view-settings/store-view-settings/viewSettingsReducer.js.map +1 -1
  95. package/dist/components/Explorer/useSearchInput.js +6 -2
  96. package/dist/components/Explorer/useSearchInput.js.map +1 -1
  97. package/dist/components/Filters/_types.d.ts +2 -0
  98. package/dist/components/Filters/_types.js.map +1 -1
  99. package/dist/components/Filters/context/filtersReducer.js +3 -4
  100. package/dist/components/Filters/context/filtersReducer.js.map +1 -1
  101. package/dist/components/Filters/context/useGetTreeFilters.js +3 -1
  102. package/dist/components/Filters/context/useGetTreeFilters.js.map +1 -1
  103. package/dist/components/Filters/filter-items/CommonFilterItem.js +10 -3
  104. package/dist/components/Filters/filter-items/CommonFilterItem.js.map +1 -1
  105. package/dist/components/Filters/filter-items/EmptyValueCheckbox.d.ts +8 -0
  106. package/dist/components/Filters/filter-items/EmptyValueCheckbox.js +16 -0
  107. package/dist/components/Filters/filter-items/EmptyValueCheckbox.js.map +1 -0
  108. package/dist/components/Filters/filter-items/filter-type/BooleanAttributeDropdown.js +23 -9
  109. package/dist/components/Filters/filter-items/filter-type/BooleanAttributeDropdown.js.map +1 -1
  110. package/dist/components/Filters/filter-items/filter-type/ColorAttributeDropDown.js +9 -8
  111. package/dist/components/Filters/filter-items/filter-type/ColorAttributeDropDown.js.map +1 -1
  112. package/dist/components/Filters/filter-items/filter-type/FilterDropDown.js +3 -2
  113. package/dist/components/Filters/filter-items/filter-type/FilterDropDown.js.map +1 -1
  114. package/dist/components/Filters/filter-items/filter-type/FilterDropdownContent.js +1 -1
  115. package/dist/components/Filters/filter-items/filter-type/FilterDropdownContent.js.map +1 -1
  116. package/dist/components/Filters/filter-items/filter-type/FilterValueListDropDown.d.ts +0 -1
  117. package/dist/components/Filters/filter-items/filter-type/FilterValueListDropDown.js +17 -23
  118. package/dist/components/Filters/filter-items/filter-type/FilterValueListDropDown.js.map +1 -1
  119. package/dist/components/Filters/filter-items/filter-type/TreeAttributeDropDown.js +10 -12
  120. package/dist/components/Filters/filter-items/filter-type/TreeAttributeDropDown.js.map +1 -1
  121. package/dist/components/Filters/filter-items/filter-type/useConditionOptionsByType.js +3 -13
  122. package/dist/components/Filters/filter-items/filter-type/useConditionOptionsByType.js.map +1 -1
  123. package/dist/components/Filters/prepareFiltersForRequest.js +36 -3
  124. package/dist/components/Filters/prepareFiltersForRequest.js.map +1 -1
  125. package/dist/components/Filters/useFilters.d.ts +5 -0
  126. package/dist/components/Filters/useTransformFilters.js +4 -0
  127. package/dist/components/Filters/useTransformFilters.js.map +1 -1
  128. package/dist/components/ImportModal/ImportModalSelectFileStep/ImportModalSelectFileStep.js +8 -4
  129. package/dist/components/ImportModal/ImportModalSelectFileStep/ImportModalSelectFileStep.js.map +1 -1
  130. package/dist/components/LibraryItemsList/FiltersPanel/FiltersOptions.js +1 -8
  131. package/dist/components/LibraryItemsList/FiltersPanel/FiltersOptions.js.map +1 -1
  132. package/dist/components/LibraryItemsList/LibraryItemsListContent/LibraryItemsListContent.js +5 -3
  133. package/dist/components/LibraryItemsList/LibraryItemsListContent/LibraryItemsListContent.js.map +1 -1
  134. package/dist/components/LibraryItemsList/MenuView/MenuView.js +4 -4
  135. package/dist/components/LibraryItemsList/MenuView/MenuView.js.map +1 -1
  136. package/dist/components/LibraryItemsList/ViewPanel/View/View.js +3 -2
  137. package/dist/components/LibraryItemsList/ViewPanel/View/View.js.map +1 -1
  138. package/dist/components/Notifications/hooks/useNotificationSubscription.js +10 -8
  139. package/dist/components/Notifications/hooks/useNotificationSubscription.js.map +1 -1
  140. package/dist/components/RecordEdition/EditRecordContent/shared/ValuesVersionBtn/ValuesVersionBtn.js +5 -20
  141. package/dist/components/RecordEdition/EditRecordContent/shared/ValuesVersionBtn/ValuesVersionBtn.js.map +1 -1
  142. package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/link-record/useLinkRecords.js +4 -3
  143. package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/link-record/useLinkRecords.js.map +1 -1
  144. package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/shared/ExplorerWrapper.d.ts +53 -51
  145. package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardField.js +4 -3
  146. package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardField.js.map +1 -1
  147. package/dist/components/RecordEdition/EditRecordContent/uiElements/TreeField/TreeField.js +9 -2
  148. package/dist/components/RecordEdition/EditRecordContent/uiElements/TreeField/TreeField.js.map +1 -1
  149. package/dist/components/RecordEdition/EditRecordContent/uiElements/TreeField/display-tree-node/TreeFieldWrapper.d.ts +53 -51
  150. package/dist/components/RecordEdition/EditRecordContent/uiElements/TreeField/display-tree-node/TreeNodeItem.js +3 -2
  151. package/dist/components/RecordEdition/EditRecordContent/uiElements/TreeField/display-tree-node/TreeNodeItem.js.map +1 -1
  152. package/dist/components/RecordEdition/EditRecordContent/uiElements/TreeField/manage-tree-node-selection/SelectTreeNodeModal.d.ts +2 -1
  153. package/dist/components/RecordEdition/EditRecordContent/uiElements/TreeField/manage-tree-node-selection/SelectTreeNodeModal.js +4 -7
  154. package/dist/components/RecordEdition/EditRecordContent/uiElements/TreeField/manage-tree-node-selection/SelectTreeNodeModal.js.map +1 -1
  155. package/dist/components/RecordEdition/EditRecordContent/uiElements/TreeField/manage-tree-node-selection/useManageTreeNodeSelection.d.ts +3 -2
  156. package/dist/components/RecordEdition/EditRecordContent/uiElements/TreeField/manage-tree-node-selection/useManageTreeNodeSelection.js +2 -2
  157. package/dist/components/RecordEdition/EditRecordContent/uiElements/TreeField/manage-tree-node-selection/useManageTreeNodeSelection.js.map +1 -1
  158. package/dist/components/RecordEdition/EditRecordContent/uiElements/shared/ComputeIndicator.js +3 -2
  159. package/dist/components/RecordEdition/EditRecordContent/uiElements/shared/ComputeIndicator.js.map +1 -1
  160. package/dist/components/RecordEdition/EditRecordSidebar/RecordSummary/RecordInformations/RecordInformations.js +3 -2
  161. package/dist/components/RecordEdition/EditRecordSidebar/RecordSummary/RecordInformations/RecordInformations.js.map +1 -1
  162. package/dist/components/RecordEdition/EditRecordSidebar/ValuesSummary/ValuesSummary.js +4 -3
  163. package/dist/components/RecordEdition/EditRecordSidebar/ValuesSummary/ValuesSummary.js.map +1 -1
  164. package/dist/components/RecordEdition/EditRecordSidebar/ValuesVersions/ValuesVersions.js +3 -2
  165. package/dist/components/RecordEdition/EditRecordSidebar/ValuesVersions/ValuesVersions.js.map +1 -1
  166. package/dist/components/SelectRecordForLinkModal/SelectRecordForLinkModal.d.ts +1 -0
  167. package/dist/components/SelectRecordForLinkModal/SelectRecordForLinkModal.js +7 -7
  168. package/dist/components/SelectRecordForLinkModal/SelectRecordForLinkModal.js.map +1 -1
  169. package/dist/components/SelectTreeNode/SelectTreeNode.d.ts +2 -1
  170. package/dist/components/SelectTreeNode/SelectTreeNode.js +3 -3
  171. package/dist/components/SelectTreeNode/SelectTreeNode.js.map +1 -1
  172. package/dist/components/SelectTreeNode/SelectTreeNodeContent.d.ts +2 -1
  173. package/dist/components/SelectTreeNode/SelectTreeNodeContent.js +6 -2
  174. package/dist/components/SelectTreeNode/SelectTreeNodeContent.js.map +1 -1
  175. package/dist/components/SelectTreeNode/TreeNodeTitle.js +3 -2
  176. package/dist/components/SelectTreeNode/TreeNodeTitle.js.map +1 -1
  177. package/dist/components/TriggerPreviewsGenerationModal/TriggerPreviewsGenerationModal.js +14 -4
  178. package/dist/components/TriggerPreviewsGenerationModal/TriggerPreviewsGenerationModal.js.map +1 -1
  179. package/dist/constants.d.ts +4 -1
  180. package/dist/constants.js +4 -1
  181. package/dist/constants.js.map +1 -1
  182. package/dist/hooks/useIFrameMessenger/schema.d.ts +2 -0
  183. package/dist/hooks/useIFrameMessenger/schema.js +1 -0
  184. package/dist/hooks/useIFrameMessenger/schema.js.map +1 -1
  185. package/dist/hooks/useIFrameMessenger/useIFrameMessenger.js +1 -2
  186. package/dist/hooks/useIFrameMessenger/useIFrameMessenger.js.map +1 -1
  187. package/dist/locales/en/shared.json +15 -3
  188. package/dist/locales/fr/shared.json +15 -3
  189. package/package.json +21 -24
@@ -61,6 +61,7 @@ export declare const baseExplorerPanelSchema: z.ZodObject<{
61
61
  }, z.core.$strip>;
62
62
  export declare const attributeExplorerPanelSchema: z.ZodObject<{
63
63
  attributeSource: z.ZodString;
64
+ deactivateOnUnlink: z.ZodOptional<z.ZodBoolean>;
64
65
  libraryId: z.ZodString;
65
66
  explorerProps: z.ZodOptional<z.ZodObject<{
66
67
  showSearch: z.ZodOptional<z.ZodBoolean>;
@@ -96,6 +97,7 @@ export declare const PanelSchema: z.ZodIntersection<z.ZodObject<{
96
97
  }, z.core.$strip>>;
97
98
  }, z.core.$strip>, z.ZodUnion<readonly [z.ZodObject<{
98
99
  attributeSource: z.ZodString;
100
+ deactivateOnUnlink: z.ZodOptional<z.ZodBoolean>;
99
101
  libraryId: z.ZodString;
100
102
  explorerProps: z.ZodOptional<z.ZodObject<{
101
103
  showSearch: z.ZodOptional<z.ZodBoolean>;
@@ -68,6 +68,7 @@ export const baseExplorerPanelSchema = z.object({
68
68
  });
69
69
  export const attributeExplorerPanelSchema = z.object({
70
70
  attributeSource: z.string(),
71
+ deactivateOnUnlink: z.boolean().optional(),
71
72
  libraryId: LibraryIdSchema,
72
73
  explorerProps: ExplorerPropsSchema.optional(),
73
74
  });
@@ -1 +1 @@
1
- {"version":3,"file":"schema.js","sourceRoot":"","sources":["../../../src/hooks/useIFrameMessenger/schema.ts"],"names":[],"mappings":"AAAA,oFAAoF;AACpF,sCAAsC;AACtC,sEAAsE;AACtE,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAE5B,MAAM,CAAC,MAAM,uBAAuB,GAAG,MAAM,CAAC;AAE9C,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC;AACxC,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC;AACzC,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC;AAC1C,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,uBAAuB,CAAC,CAAC,QAAQ,EAAE,CAAC;AAE1F,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;AAErG,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,cAAc,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,CACtE,CAAC;AAEF,MAAM,CAAC,MAAM,WAAW,GAAG,eAAe,CAAC,GAAG,CAC1C,CAAC,CAAC,KAAK,CAAC,CAAC,mBAAmB,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,mBAAmB,CAAC,CAAC,CAC7F,CAAC;AAEF,MAAM,CAAC,MAAM,iBAAiB,GAAG,eAAe,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAC","sourcesContent":["// Copyright LEAV Solutions 2017 until 2023/11/05, Copyright Aristid from 2023/11/06\n// This file is released under LGPL V3\n// License text available at https://www.gnu.org/licenses/lgpl-3.0.txt\nimport * as z from 'zod/v4';\n\nexport const FONT_AWESOME_ICON_REGEX = /^fa-/;\n\nexport const PanelIdSchema = z.string();\nexport const LanguageSchema = z.string();\nexport const LibraryIdSchema = z.string();\nexport const FontAwesomeIconSchema = z.string().regex(FONT_AWESOME_ICON_REGEX).optional();\n\nexport const WhereSchema = z.union([z.literal('popup'), z.literal('slider'), z.literal('fullpage')]);\n\nexport const FlapPanelIdSchema = z.union([z.literal('info-history'), z.literal('thread')]);\n\nexport const ExplorerPropsSchema = z.object({\n showSearch: z.boolean().optional(),\n showFilters: z.boolean().optional(),\n showSorts: z.boolean().optional(),\n freezeView: z.boolean().optional(),\n showAttributeLabels: z.boolean().optional(),\n creationFormId: z.string().optional(),\n noPagination: z.literal(true).optional(),\n showActionsLabels: z.boolean().optional(),\n defaultPrimaryActions: z.array(z.union([z.literal('create')])).optional(),\n defaultMassActions: z\n .array(z.union([z.literal('deactivate'), z.literal('export'), z.literal('editAttribute')]))\n .optional(),\n defaultActionsForItem: z\n .array(z.union([z.literal('replaceLink'), z.literal('remove'), z.literal('activate')]))\n .optional(),\n});\n\nexport const ItemActionsSchema = z\n .array(\n z.object({\n where: WhereSchema,\n what: z.literal('record'),\n targetPanelId: PanelIdSchema.optional(),\n targetFlapPanelId: FlapPanelIdSchema.optional(),\n icon: FontAwesomeIconSchema,\n label: z.record(LanguageSchema, z.string()),\n onRowClick: z.boolean().optional(),\n }),\n )\n .refine(actions => actions.reduce((acc, action) => (action.onRowClick ? acc + 1 : acc), 0) <= 1, {\n message: 'At most one action must have onRowClick set to true',\n });\n\nexport const basePanelSchema = z.object({\n id: PanelIdSchema,\n icon: FontAwesomeIconSchema,\n name: z.record(LanguageSchema, z.string()).optional(),\n isStandalone: z.boolean().optional(),\n hideInSlider: z.boolean().optional(),\n});\n\nexport const iframePanelSchema = z.object({\n type: z.literal('custom'),\n iframeSource: z.string(),\n isSelfContaining: z.boolean().optional(),\n});\n\nconst editionPanelSchema = z.object({\n type: z.literal('editionForm'),\n formId: z.string(),\n});\n\nexport const creationPanelSchema = z.object({\n type: z.literal('creationForm'),\n formId: z.string(),\n attributeSource: z.string(),\n isStandalone: z.literal(true),\n});\n\nexport const baseExplorerPanelSchema = z.object({\n type: z.literal('explorer'),\n viewId: z.string().optional(),\n actions: ItemActionsSchema,\n});\n\nexport const attributeExplorerPanelSchema = z.object({\n attributeSource: z.string(),\n libraryId: LibraryIdSchema,\n explorerProps: ExplorerPropsSchema.optional(),\n});\n\nconst libraryExplorerPanelSchema = z.object({\n explorerProps: ExplorerPropsSchema.optional(),\n});\n\nconst explorerPanelSchema = baseExplorerPanelSchema.and(\n z.union([attributeExplorerPanelSchema, libraryExplorerPanelSchema]),\n);\n\nexport const PanelSchema = basePanelSchema.and(\n z.union([explorerPanelSchema, iframePanelSchema, editionPanelSchema, creationPanelSchema]),\n);\n\nexport const PanelIFrameSchema = basePanelSchema.and(iframePanelSchema);\n"]}
1
+ {"version":3,"file":"schema.js","sourceRoot":"","sources":["../../../src/hooks/useIFrameMessenger/schema.ts"],"names":[],"mappings":"AAAA,oFAAoF;AACpF,sCAAsC;AACtC,sEAAsE;AACtE,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAE5B,MAAM,CAAC,MAAM,uBAAuB,GAAG,MAAM,CAAC;AAE9C,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,CAAC,MAAM,EAA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C,CAAC,OAAO,CAAC,UAAU,CAAC;IAC3B,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC7B,OAAO,EAAE,iBAAiB;CAC7B,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,4BAA4B,GAAG,CAAC,CAAC,MAAM,CAAC;IACjD,eAAe,EAAE,CAAC,CAAC,MAAM,EAAE;IAC3B,kBAAkB,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;IAC1C,SAAS,EAAE,eAAe;IAC1B,aAAa,EAAE,mBAAmB,CAAC,QAAQ,EAAE;CAChD,CAAC,CAAC;AAEH,MAAM,0BAA0B,GAAG,CAAC,CAAC,MAAM,CAAC;IACxC,aAAa,EAAE,mBAAmB,CAAC,QAAQ,EAAE;CAChD,CAAC,CAAC;AAEH,MAAM,mBAAmB,GAAG,uBAAuB,CAAC,GAAG,CACnD,CAAC,CAAC,KAAK,CAAC,CAAC,4BAA4B,EAAE,0BAA0B,CAAC,CAAC,CACtE,CAAC;AAEF,MAAM,CAAC,MAAM,WAAW,GAAG,eAAe,CAAC,GAAG,CAC1C,CAAC,CAAC,KAAK,CAAC,CAAC,mBAAmB,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,mBAAmB,CAAC,CAAC,CAC7F,CAAC;AAEF,MAAM,CAAC,MAAM,iBAAiB,GAAG,eAAe,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAC","sourcesContent":["// Copyright LEAV Solutions 2017 until 2023/11/05, Copyright Aristid from 2023/11/06\n// This file is released under LGPL V3\n// License text available at https://www.gnu.org/licenses/lgpl-3.0.txt\nimport * as z from 'zod/v4';\n\nexport const FONT_AWESOME_ICON_REGEX = /^fa-/;\n\nexport const PanelIdSchema = z.string();\nexport const LanguageSchema = z.string();\nexport const LibraryIdSchema = z.string();\nexport const FontAwesomeIconSchema = z.string().regex(FONT_AWESOME_ICON_REGEX).optional();\n\nexport const WhereSchema = z.union([z.literal('popup'), z.literal('slider'), z.literal('fullpage')]);\n\nexport const FlapPanelIdSchema = z.union([z.literal('info-history'), z.literal('thread')]);\n\nexport const ExplorerPropsSchema = z.object({\n showSearch: z.boolean().optional(),\n showFilters: z.boolean().optional(),\n showSorts: z.boolean().optional(),\n freezeView: z.boolean().optional(),\n showAttributeLabels: z.boolean().optional(),\n creationFormId: z.string().optional(),\n noPagination: z.literal(true).optional(),\n showActionsLabels: z.boolean().optional(),\n defaultPrimaryActions: z.array(z.union([z.literal('create')])).optional(),\n defaultMassActions: z\n .array(z.union([z.literal('deactivate'), z.literal('export'), z.literal('editAttribute')]))\n .optional(),\n defaultActionsForItem: z\n .array(z.union([z.literal('replaceLink'), z.literal('remove'), z.literal('activate')]))\n .optional(),\n});\n\nexport const ItemActionsSchema = z\n .array(\n z.object({\n where: WhereSchema,\n what: z.literal('record'),\n targetPanelId: PanelIdSchema.optional(),\n targetFlapPanelId: FlapPanelIdSchema.optional(),\n icon: FontAwesomeIconSchema,\n label: z.record(LanguageSchema, z.string()),\n onRowClick: z.boolean().optional(),\n }),\n )\n .refine(actions => actions.reduce((acc, action) => (action.onRowClick ? acc + 1 : acc), 0) <= 1, {\n message: 'At most one action must have onRowClick set to true',\n });\n\nexport const basePanelSchema = z.object({\n id: PanelIdSchema,\n icon: FontAwesomeIconSchema,\n name: z.record(LanguageSchema, z.string()).optional(),\n isStandalone: z.boolean().optional(),\n hideInSlider: z.boolean().optional(),\n});\n\nexport const iframePanelSchema = z.object({\n type: z.literal('custom'),\n iframeSource: z.string(),\n isSelfContaining: z.boolean().optional(),\n});\n\nconst editionPanelSchema = z.object({\n type: z.literal('editionForm'),\n formId: z.string(),\n});\n\nexport const creationPanelSchema = z.object({\n type: z.literal('creationForm'),\n formId: z.string(),\n attributeSource: z.string(),\n isStandalone: z.literal(true),\n});\n\nexport const baseExplorerPanelSchema = z.object({\n type: z.literal('explorer'),\n viewId: z.string().optional(),\n actions: ItemActionsSchema,\n});\n\nexport const attributeExplorerPanelSchema = z.object({\n attributeSource: z.string(),\n deactivateOnUnlink: z.boolean().optional(),\n libraryId: LibraryIdSchema,\n explorerProps: ExplorerPropsSchema.optional(),\n});\n\nconst libraryExplorerPanelSchema = z.object({\n explorerProps: ExplorerPropsSchema.optional(),\n});\n\nconst explorerPanelSchema = baseExplorerPanelSchema.and(\n z.union([attributeExplorerPanelSchema, libraryExplorerPanelSchema]),\n);\n\nexport const PanelSchema = basePanelSchema.and(\n z.union([explorerPanelSchema, iframePanelSchema, editionPanelSchema, creationPanelSchema]),\n);\n\nexport const PanelIFrameSchema = basePanelSchema.and(iframePanelSchema);\n"]}
@@ -2,7 +2,6 @@
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 { useCallback, useContext, useEffect, useRef } from 'react';
5
- import { v4 as uuid } from 'uuid';
6
5
  import { LangContext } from '../../contexts';
7
6
  import { encodeMessage, decodeMessage, getExposedMethods, initClientHandlers } from './messageHandlers';
8
7
  /**
@@ -11,7 +10,7 @@ import { encodeMessage, decodeMessage, getExposedMethods, initClientHandlers } f
11
10
  */
12
11
  export const useIFrameMessenger = (options) => {
13
12
  const registry = useRef({});
14
- const selfId = useRef(options?.id ?? uuid());
13
+ const selfId = useRef(options?.id ?? window.crypto.randomUUID());
15
14
  const { setLang } = useContext(LangContext);
16
15
  const changeLangInAllFrames = (newLanguage) => {
17
16
  dispatch({
@@ -1 +1 @@
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,EAAE,MAAM,EAAC,MAAM,OAAO,CAAC;AACjE,OAAO,EAAC,EAAE,IAAI,IAAI,EAAC,MAAM,MAAM,CAAC;AAChC,OAAO,EAAC,WAAW,EAAC,MAAM,cAAc,CAAC;AASzC,OAA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AAM,CAAC,CAAC;oBAC9B,CAAC;oBACD,MAAM;gBACV;oBACI,IAAI,OAAO,CAAC,IAAI,KAAK,iBAAiB,EAAE,CAAC;wBACrC,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;oBAC9B,CAAC;yBAAM,CAAC;wBACJ,cAAc,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;oBACtC,CAAC;oBACD,MAAM;YACd,CAAC;QACL,CAAC,CAAC;QAEF,MAAM,CAAC,gBAAgB,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC;QAE9C,IAAI,MAAM,KAAK,MAAM,CAAC,GAAG,EAAE,CAAC;YACxB,qDAAqD;YACrD,QAAQ,CAAC,EAAC,IAAI,EAAE,UAAU,EAAE,EAAE,EAAE,MAAM,CAAC,OAAO,EAAC,CAAC,CAAC;QACrD,CAAC;QAED,OAAO,GAAG,EAAE;YACR,MAAM,CAAC,mBAAmB,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC;QACrD,CAAC,CAAC;IACN,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,OAAO,OAAO,CAAC,OAAO,CAAC;AAC3B,CAAC,CAAC","sourcesContent":["// Copyright LEAV Solutions 2017 until 2023/11/05, Copyright Aristid from 2023/11/06\n// This file is released under LGPL V3\n// License text available at https://www.gnu.org/licenses/lgpl-3.0.txt\nimport {useCallback, useContext, useEffect, useRef} from 'react';\nimport {v4 as uuid} from 'uuid';\nimport {LangContext} from '_ui/contexts';\nimport {\n type AddMessageToPanelMessageHandler,\n type MessageToPanelMessageHandler,\n type Callbacks,\n type CallCbFunction,\n type IUseIFrameMessengerOptions,\n type MessageDispatcher,\n} from './types';\nimport {encodeMessage, decodeMessage, getExposedMethods, initClientHandlers} from './messageHandlers';\n\nexport {IUseIFrameMessengerOptions};\n\n/**\n * This is the core of `useIFrameMessenger`. Should be used for top-level apps, such as **app-studio**.\n * For client apps (apps that need to consume the messenger), please use the `useIFrameMessengerClient`\n */\nexport const useIFrameMessenger = (options?: IUseIFrameMessengerOptions) => {\n const registry = useRef<Record<string, Window>>({});\n const selfId = useRef(options?.id ?? uuid());\n\n const {setLang} = useContext(LangContext);\n\n const changeLangInAllFrames = (newLanguage: string) => {\n dispatch(\n {\n type: 'change-language',\n language: newLanguage,\n },\n 'all',\n );\n };\n\n const panelMessageHandlerRegistry = useRef<Record<string, MessageToPanelMessageHandler>>({});\n const addPanelMessageHandler: AddMessageToPanelMessageHandler = (\n type: string,\n handler: MessageToPanelMessageHandler,\n ) => {\n panelMessageHandlerRegistry.current[type] = handler;\n };\n\n const dispatch = useCallback<MessageDispatcher>(\n (message, frameId) => {\n if (window !== window.top) {\n window.parent.postMessage(encodeMessage({...message, __frameId: selfId.current}), '*');\n } else if (frameId && registry.current[frameId]) {\n (registry.current[frameId] as Window).postMessage(\n encodeMessage({...message, __frameId: selfId.current}),\n '*',\n );\n } else if (frameId === 'all') {\n Object.entries(registry.current).forEach(([id, frame]) => {\n if (id !== message.__frameId) {\n // DO not send the message to the sender\n frame.postMessage(encodeMessage({...message, __frameId: selfId.current}), '*');\n }\n });\n }\n },\n [registry.current],\n );\n\n const callCb = useCallback<CallCbFunction>(\n (path, data, frameId) => {\n dispatch({type: 'on-call-callback', path, data}, frameId);\n },\n [dispatch],\n );\n\n const unregister = () => {\n if (window !== window.top) {\n dispatch({type: 'unregister', id: selfId.current});\n }\n };\n\n const callbacksStore = useRef<Callbacks>({});\n const methods = useRef({\n ...getExposedMethods(callbacksStore, dispatch),\n unregister,\n changeLangInAllFrames,\n addPanelMessageHandler,\n });\n\n useEffect(() => {\n const clientHandlers = initClientHandlers(callCb, {...options, id: selfId.current}, callbacksStore);\n const onMessage = (event: MessageEvent) => {\n const message = decodeMessage(event.data);\n if (message === undefined) {\n return;\n }\n switch (message.type) {\n case 'register':\n const frames = window.frames;\n // Due to weak typing on Window, we cannot iterate directly on window.frames\n // eslint-disable-next-line @typescript-eslint/prefer-for-of\n for (let i = 0; i < frames.length; i++) {\n if (event.source === frames[i]) {\n registry.current[message.id] = frames[i];\n }\n }\n break;\n case 'unregister':\n if (registry.current[message.id]) {\n delete registry.current[message.id];\n }\n break;\n case 'message-to-panel':\n panelMessageHandlerRegistry.current[message.data.type]?.(message.data.payload);\n if (window === window.top) {\n const target = message.data.target ?? 'all';\n dispatch(message, target);\n }\n break;\n default:\n if (message.type === 'change-language') {\n setLang(message.language);\n } else {\n clientHandlers(message, dispatch);\n }\n break;\n }\n };\n\n window.addEventListener('message', onMessage);\n\n if (window !== window.top) {\n // Register the message handler for the parent window\n dispatch({type: 'register', id: selfId.current});\n }\n\n return () => {\n window.removeEventListener('message', onMessage);\n };\n }, []);\n\n return methods.current;\n};\n"]}
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,EAAE,MAAM,EAAC,MAAM,OAAO,CAAC;AACjE,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,MAAM,CAAC,MAAM,CAAC,UAAU,EAAE,CAAC,CAAC;IAEjE,MAAM,EAAC,OAAO,EAAC,GAAG,UAAU,CAAC,WAAW,CAAC,CAAC;IAE1C,MAAM,qBAAqB,GAAG,CAAC,WAAmB,EAAE,EAAE;QAClD,QAAQ,CACJ;YACI,IAAI,EAAE,iBAAiB;YACvB,QAAQ,EAAE,WAAW;S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C,OAAO,EAAC,CAAC,CAAC;QACrD,CAAC;QAED,OAAO,GAAG,EAAE;YACR,MAAM,CAAC,mBAAmB,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC;QACrD,CAAC,CAAC;IACN,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,OAAO,OAAO,CAAC,OAAO,CAAC;AAC3B,CAAC,CAAC","sourcesContent":["// Copyright LEAV Solutions 2017 until 2023/11/05, Copyright Aristid from 2023/11/06\n// This file is released under LGPL V3\n// License text available at https://www.gnu.org/licenses/lgpl-3.0.txt\nimport {useCallback, useContext, useEffect, useRef} from 'react';\nimport {LangContext} from '_ui/contexts';\nimport {\n type AddMessageToPanelMessageHandler,\n type MessageToPanelMessageHandler,\n type Callbacks,\n type CallCbFunction,\n type IUseIFrameMessengerOptions,\n type MessageDispatcher,\n} from './types';\nimport {encodeMessage, decodeMessage, getExposedMethods, initClientHandlers} from './messageHandlers';\n\nexport {IUseIFrameMessengerOptions};\n\n/**\n * This is the core of `useIFrameMessenger`. Should be used for top-level apps, such as **app-studio**.\n * For client apps (apps that need to consume the messenger), please use the `useIFrameMessengerClient`\n */\nexport const useIFrameMessenger = (options?: IUseIFrameMessengerOptions) => {\n const registry = useRef<Record<string, Window>>({});\n const selfId = useRef(options?.id ?? window.crypto.randomUUID());\n\n const {setLang} = useContext(LangContext);\n\n const changeLangInAllFrames = (newLanguage: string) => {\n dispatch(\n {\n type: 'change-language',\n language: newLanguage,\n },\n 'all',\n );\n };\n\n const panelMessageHandlerRegistry = useRef<Record<string, MessageToPanelMessageHandler>>({});\n const addPanelMessageHandler: AddMessageToPanelMessageHandler = (\n type: string,\n handler: MessageToPanelMessageHandler,\n ) => {\n panelMessageHandlerRegistry.current[type] = handler;\n };\n\n const dispatch = useCallback<MessageDispatcher>(\n (message, frameId) => {\n if (window !== window.top) {\n window.parent.postMessage(encodeMessage({...message, __frameId: selfId.current}), '*');\n } else if (frameId && registry.current[frameId]) {\n (registry.current[frameId] as Window).postMessage(\n encodeMessage({...message, __frameId: selfId.current}),\n '*',\n );\n } else if (frameId === 'all') {\n Object.entries(registry.current).forEach(([id, frame]) => {\n if (id !== message.__frameId) {\n // DO not send the message to the sender\n frame.postMessage(encodeMessage({...message, __frameId: selfId.current}), '*');\n }\n });\n }\n },\n [registry.current],\n );\n\n const callCb = useCallback<CallCbFunction>(\n (path, data, frameId) => {\n dispatch({type: 'on-call-callback', path, data}, frameId);\n },\n [dispatch],\n );\n\n const unregister = () => {\n if (window !== window.top) {\n dispatch({type: 'unregister', id: selfId.current});\n }\n };\n\n const callbacksStore = useRef<Callbacks>({});\n const methods = useRef({\n ...getExposedMethods(callbacksStore, dispatch),\n unregister,\n changeLangInAllFrames,\n addPanelMessageHandler,\n });\n\n useEffect(() => {\n const clientHandlers = initClientHandlers(callCb, {...options, id: selfId.current}, callbacksStore);\n const onMessage = (event: MessageEvent) => {\n const message = decodeMessage(event.data);\n if (message === undefined) {\n return;\n }\n switch (message.type) {\n case 'register':\n const frames = window.frames;\n // Due to weak typing on Window, we cannot iterate directly on window.frames\n // eslint-disable-next-line @typescript-eslint/prefer-for-of\n for (let i = 0; i < frames.length; i++) {\n if (event.source === frames[i]) {\n registry.current[message.id] = frames[i];\n }\n }\n break;\n case 'unregister':\n if (registry.current[message.id]) {\n delete registry.current[message.id];\n }\n break;\n case 'message-to-panel':\n panelMessageHandlerRegistry.current[message.data.type]?.(message.data.payload);\n if (window === window.top) {\n const target = message.data.target ?? 'all';\n dispatch(message, target);\n }\n break;\n default:\n if (message.type === 'change-language') {\n setLang(message.language);\n } else {\n clientHandlers(message, dispatch);\n }\n break;\n }\n };\n\n window.addEventListener('message', onMessage);\n\n if (window !== window.top) {\n // Register the message handler for the parent window\n dispatch({type: 'register', id: selfId.current});\n }\n\n return () => {\n window.removeEventListener('message', onMessage);\n };\n }, []);\n\n return methods.current;\n};\n"]}
@@ -37,7 +37,8 @@
37
37
  "max_length": "Max length",
38
38
  "confirm": "Confirm",
39
39
  "loading": "Loading",
40
- "are_you_sure": "Are you sure?"
40
+ "are_you_sure": "Are you sure?",
41
+ "reset": "Reset"
41
42
  },
42
43
  "errors": {
43
44
  "default_language_required": "The default language is required",
@@ -699,7 +700,6 @@
699
700
  "inactive": "Inactive sorts"
700
701
  },
701
702
  "toolbar": "Toolbar",
702
- "reset-filter": "Reset filter",
703
703
  "reset-view": "Reset view",
704
704
  "empty-data": "No items found.",
705
705
  "available-attributes": "Other available attributes",
@@ -776,6 +776,17 @@
776
776
  "deselect_all": "Deselect all items"
777
777
  }
778
778
  },
779
+ "export_profile_modal": {
780
+ "title": "Export",
781
+ "profile_label": "Choose an export profile",
782
+ "preview_label": "Preview of exported attributes",
783
+ "search_placeholder": "Search...",
784
+ "no_profiles": "No export profiles configured for this library",
785
+ "contact_admin": "Please contact an administrator to configure export profiles.",
786
+ "empty_columns": "(empty column)",
787
+ "export_button": "Export",
788
+ "error_title": "Export profile error"
789
+ },
779
790
  "add-existing-item": "Add existing item",
780
791
  "activate_item_one": "Activate this item?",
781
792
  "activate_item_other": "Activate these items?",
@@ -792,6 +803,7 @@
792
803
  "delete_link_one": "Delete this link?",
793
804
  "delete_link_other": "Delete these links?",
794
805
  "delete_link_description_one": "You are about to delete this link.",
795
- "delete_link_description_other": "You are about to delete these links."
806
+ "delete_link_description_other": "You are about to delete these links.",
807
+ "empty_value": "Undefined"
796
808
  }
797
809
  }
@@ -37,7 +37,8 @@
37
37
  "max_length": "Longueur maximale",
38
38
  "confirm": "Confirmer",
39
39
  "loading": "Chargement",
40
- "are_you_sure": "Êtes-vous sûr ?"
40
+ "are_you_sure": "Êtes-vous sûr ?",
41
+ "reset": "Réinitialiser"
41
42
  },
42
43
  "errors": {
43
44
  "default_language_required": "La langue par défaut est requise",
@@ -697,7 +698,6 @@
697
698
  "inactive": "Tris inactifs"
698
699
  },
699
700
  "toolbar": "Barre d’outils",
700
- "reset-filter": "Réinitialiser le filtre",
701
701
  "reset-view": "Réinitialiser la vue",
702
702
  "empty-data": "Aucun élément trouvé.",
703
703
  "sort-ascending": "Ascendant",
@@ -776,6 +776,17 @@
776
776
  "deselect_all": "Tout désélectionner"
777
777
  }
778
778
  },
779
+ "export_profile_modal": {
780
+ "title": "Export",
781
+ "profile_label": "Choisir un profil d'export",
782
+ "preview_label": "Aperçu des attributs exportés",
783
+ "search_placeholder": "Rechercher...",
784
+ "no_profiles": "Aucun profil d'export configuré pour cette librairie",
785
+ "contact_admin": "Veuillez contacter un administrateur pour configurer les profils d'export.",
786
+ "empty_columns": "(colonne vide)",
787
+ "export_button": "Exporter",
788
+ "error_title": "Erreur de profil d'export"
789
+ },
779
790
  "add-existing-item": "Ajouter un élément existant",
780
791
  "activate_item_one": "Activer cet élément ?",
781
792
  "activate_item_other": "Activer ces éléments ?",
@@ -792,6 +803,7 @@
792
803
  "delete_link_one": "Supprimer cette liaison ?",
793
804
  "delete_link_other": "Supprimer ces liaisons ?",
794
805
  "delete_link_description_one": "Vous êtes sur le point de supprimer cette liaison.",
795
- "delete_link_description_other": "Vous êtes sur le point de supprimer ces liaisons."
806
+ "delete_link_description_other": "Vous êtes sur le point de supprimer ces liaisons.",
807
+ "empty_value": "Non défini"
796
808
  }
797
809
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@leav/ui",
3
- "version": "1.5.3",
3
+ "version": "1.6.0-22577b27",
4
4
  "description": "Shared React components and hooks",
5
5
  "scripts": {
6
6
  "prepublishOnly": "yarn build",
@@ -27,8 +27,8 @@
27
27
  "@apollo/client": "3.8.1",
28
28
  "@babel/preset-env": "7.28.5",
29
29
  "@babel/preset-react": "7.28.5",
30
- "@graphql-codegen/add": "5.0.0",
31
- "@graphql-codegen/cli": "5.0.0",
30
+ "@graphql-codegen/add": "5.0.3",
31
+ "@graphql-codegen/cli": "5.0.7",
32
32
  "@testing-library/jest-dom": "5.16.5",
33
33
  "@testing-library/react": "14.0.0",
34
34
  "@testing-library/react-hooks": "8.0.1",
@@ -37,64 +37,61 @@
37
37
  "@types/dompurify": "3.0.3",
38
38
  "@types/jest": "29.0.2",
39
39
  "@types/lodash.isequal": "^4",
40
- "@types/object-path": "0.11.1",
40
+ "@types/object-path": "0.11.4",
41
41
  "@types/react": "18.2.14",
42
- "@types/react-beautiful-dnd": "13.1.2",
42
+ "@types/react-beautiful-dnd": "13.1.8",
43
43
  "@types/react-dom": "18.2.6",
44
- "@types/react-table": "7.7.12",
45
- "@types/uuid": "^9",
46
- "antd": "5.22.2",
47
- "aristid-ds": "14.0.0-edb5203",
44
+ "@types/react-table": "7.7.20",
45
+ "aristid-ds": "14.0.0-fd68c13",
48
46
  "babel-jest": "29.3.1",
49
- "commander": "9.5.0",
50
47
  "graphql": "16.12.0",
51
- "i18next": "22.5.0",
48
+ "i18next": "22.5.1",
52
49
  "jest": "29.0.3",
53
50
  "jest-environment-jsdom": "29.3.1",
54
- "jest-styled-components": "7.1.1",
51
+ "jest-styled-components": "7.2.0",
55
52
  "react": "18.2.0",
56
53
  "react-dom": "18.2.0",
57
54
  "react-i18next": "12",
58
55
  "react-router-dom": "6.22.0",
59
56
  "styled-components": "6.0.8",
60
- "ts-jest": "29.0.1",
61
- "tsc-alias": "1.8.8",
57
+ "ts-jest": "29.4.6",
58
+ "tsc-alias": "1.8.16",
62
59
  "typescript": "5.5.3",
63
- "vite": "7.2.2"
60
+ "vite": "7.2.6"
64
61
  },
65
62
  "peerDependencies": {
66
63
  "@ant-design/icons": ">=5.2",
67
64
  "@apollo/client": ">=3.8.1",
68
- "antd": "5.22.2",
69
- "aristid-ds": "14.0.0-edb5203",
65
+ "aristid-ds": "14.0.0-fd68c13",
70
66
  "dayjs": "^1.11.13",
71
67
  "i18next": "22.5",
72
68
  "react": "18.2.0",
73
69
  "react-dom": "18.2.0",
74
70
  "react-i18next": "12",
75
- "react-icons": ">=4",
76
71
  "react-router-dom": "6.22.0",
77
72
  "styled-components": ">=5.3"
78
73
  },
79
74
  "dependencies": {
80
- "@ckeditor/ckeditor5-build-inline": "39.0.1",
75
+ "@ckeditor/ckeditor5-build-inline": "39.0.2",
81
76
  "@ckeditor/ckeditor5-react": "6.1.0",
82
77
  "@dnd-kit/core": "6.1.0",
83
78
  "@dnd-kit/sortable": "8.0.0",
84
- "@leav/utils": "1.5.3",
79
+ "@fortawesome/fontawesome-svg-core": "7.0.1",
80
+ "@fortawesome/free-regular-svg-icons": "7.0.1",
81
+ "@fortawesome/free-solid-svg-icons": "7.0.1",
82
+ "@fortawesome/react-fontawesome": "3.0.2",
83
+ "@leav/utils": "1.6.0",
85
84
  "@uidotdev/usehooks": "2.4.1",
86
85
  "dompurify": "3.2.4",
87
- "html-react-parser": "4.2.2",
86
+ "html-react-parser": "4.2.10",
88
87
  "i18next-resources-to-backend": "1.1.4",
89
88
  "lodash.isequal": "4.5.0",
90
89
  "object-path": "0.11.8",
91
90
  "react-beautiful-dnd": "13.1.1",
92
- "react-icons": "4.7.1",
93
91
  "react-markdown": "5.0.3",
94
92
  "react-table": "7.8.0",
95
93
  "react-table-sticky": "1.1.3",
96
- "uuid": "9.0.1",
97
94
  "xlsx": "0.18.5",
98
- "zod": "3.25.67"
95
+ "zod": "3.25.76"
99
96
  }
100
97
  }