@headless-adminapp/app 0.0.12-alpha.0 → 0.0.15-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +8 -16
- package/src/app/context.ts +0 -11
- package/src/app/hooks/index.ts +0 -1
- package/src/app/hooks/useAppContext.ts +0 -13
- package/src/app/index.ts +0 -2
- package/src/appearance/context.ts +0 -13
- package/src/appearance/hooks/index.ts +0 -1
- package/src/appearance/hooks/useAppearanceContext.ts +0 -13
- package/src/appearance/index.ts +0 -6
- package/src/auth/AuthProvider.tsx +0 -118
- package/src/auth/context.ts +0 -41
- package/src/auth/hooks/index.ts +0 -2
- package/src/auth/hooks/useAuthSession.ts +0 -17
- package/src/auth/hooks/useLogout.ts +0 -23
- package/src/auth/index.ts +0 -4
- package/src/auth/types.ts +0 -17
- package/src/builders/CommandBuilder.ts +0 -777
- package/src/builders/SchemaExperienceBuilder.ts +0 -488
- package/src/builders/index.ts +0 -5
- package/src/command/hooks/index.ts +0 -2
- package/src/command/hooks/useBaseCommandHandlerContext.ts +0 -51
- package/src/command/hooks/useCommands.ts +0 -26
- package/src/command/index.ts +0 -2
- package/src/command/types.ts +0 -116
- package/src/command/utils/index.ts +0 -142
- package/src/components/ScrollView/index.tsx +0 -26
- package/src/dataform/DataFormProvider/DataResolver.tsx +0 -186
- package/src/dataform/DataFormProvider/InitialValueResolver.tsx +0 -55
- package/src/dataform/DataFormProvider/ReadonlyInfoResolver.tsx +0 -35
- package/src/dataform/DataFormProvider/index.tsx +0 -102
- package/src/dataform/context.ts +0 -53
- package/src/dataform/hooks/index.ts +0 -12
- package/src/dataform/hooks/useFormInstance.ts +0 -6
- package/src/dataform/hooks/useFormIsDirty.ts +0 -7
- package/src/dataform/hooks/useFormIsReadonly.ts +0 -11
- package/src/dataform/hooks/useFormNotifications.ts +0 -46
- package/src/dataform/hooks/useFormRecord.ts +0 -7
- package/src/dataform/hooks/useFormSave.ts +0 -147
- package/src/dataform/hooks/useFormSchema.ts +0 -13
- package/src/dataform/hooks/useLoadFormGridPage.ts +0 -97
- package/src/dataform/hooks/useMainFormCommands.ts +0 -65
- package/src/dataform/hooks/useRecordId.ts +0 -6
- package/src/dataform/hooks/useRecordTitle.ts +0 -22
- package/src/dataform/hooks/useSelectedForm.ts +0 -14
- package/src/dataform/index.ts +0 -4
- package/src/dataform/utils/index.ts +0 -594
- package/src/datagrid/DataGridProvider/DataResolver.tsx +0 -281
- package/src/datagrid/DataGridProvider/index.tsx +0 -134
- package/src/datagrid/DataGridProvider/transformViewColumns.ts +0 -54
- package/src/datagrid/DataGridProvider/utils.ts +0 -89
- package/src/datagrid/column-filter/constants.ts +0 -493
- package/src/datagrid/column-filter/index.ts +0 -3
- package/src/datagrid/column-filter/types.ts +0 -68
- package/src/datagrid/column-filter/utils.ts +0 -19
- package/src/datagrid/context.ts +0 -66
- package/src/datagrid/hooks/index.ts +0 -20
- package/src/datagrid/hooks/useChangeView.ts +0 -18
- package/src/datagrid/hooks/useGridColumnFilter.ts +0 -28
- package/src/datagrid/hooks/useGridColumns.ts +0 -13
- package/src/datagrid/hooks/useGridCommands.ts +0 -21
- package/src/datagrid/hooks/useGridData.ts +0 -8
- package/src/datagrid/hooks/useGridDataState.ts +0 -8
- package/src/datagrid/hooks/useGridExtraFilter.ts +0 -6
- package/src/datagrid/hooks/useGridOptions.ts +0 -3
- package/src/datagrid/hooks/useGridPagination.ts +0 -3
- package/src/datagrid/hooks/useGridRefresh.ts +0 -19
- package/src/datagrid/hooks/useGridSchema.ts +0 -13
- package/src/datagrid/hooks/useGridSelection.ts +0 -28
- package/src/datagrid/hooks/useGridSorting.ts +0 -23
- package/src/datagrid/hooks/useGridViewLookupData.ts +0 -10
- package/src/datagrid/hooks/useLoadMainGridPage.ts +0 -90
- package/src/datagrid/hooks/useMainGridCommands.ts +0 -255
- package/src/datagrid/hooks/useMaxRecords.ts +0 -6
- package/src/datagrid/hooks/useSearchText.ts +0 -22
- package/src/datagrid/hooks/useSelectedView.ts +0 -14
- package/src/datagrid/hooks/useSubGridCommands.ts +0 -104
- package/src/datagrid/index.ts +0 -14
- package/src/dialog/DialogProvider.tsx +0 -20
- package/src/dialog/context.ts +0 -14
- package/src/dialog/hooks/index.ts +0 -8
- package/src/dialog/hooks/useCloseDialog.ts +0 -36
- package/src/dialog/hooks/useDialogItem.ts +0 -8
- package/src/dialog/hooks/useDialogItems.ts +0 -6
- package/src/dialog/hooks/useOpenAlertDialog.ts +0 -30
- package/src/dialog/hooks/useOpenConfirmDialog.ts +0 -45
- package/src/dialog/hooks/useOpenDialog.ts +0 -39
- package/src/dialog/hooks/useOpenErrorDialog.ts +0 -26
- package/src/dialog/hooks/useOpenPromptDialog.ts +0 -46
- package/src/dialog/index.ts +0 -7
- package/src/form/FormValidationStringContext.ts +0 -30
- package/src/form/index.ts +0 -6
- package/src/hooks/index.ts +0 -5
- package/src/hooks/useDebouncedValue.ts +0 -38
- package/src/hooks/useElementLayout.ts +0 -49
- package/src/hooks/useIsMobile.ts +0 -21
- package/src/hooks/useStorageState.ts +0 -36
- package/src/hooks/useSystemColorScheme.ts +0 -38
- package/src/index.css +0 -4
- package/src/insights/context.ts +0 -5
- package/src/insights/hooks/index.ts +0 -14
- package/src/insights/index.ts +0 -2
- package/src/locale/context.ts +0 -7
- package/src/locale/index.ts +0 -3
- package/src/locale/types.ts +0 -3
- package/src/locale/useLocale.ts +0 -13
- package/src/metadata/MetadataProvider.tsx +0 -51
- package/src/metadata/context.ts +0 -15
- package/src/metadata/hooks/index.ts +0 -8
- package/src/metadata/hooks/useAppStore.ts +0 -6
- package/src/metadata/hooks/useExperienceStore.ts +0 -6
- package/src/metadata/hooks/useExperienceView.ts +0 -36
- package/src/metadata/hooks/useExperienceViewCommands.ts +0 -20
- package/src/metadata/hooks/useExperienceViewLookup.ts +0 -33
- package/src/metadata/hooks/useExperienceViewSubgridCommands.ts +0 -20
- package/src/metadata/hooks/useMetadata.ts +0 -44
- package/src/metadata/hooks/useSchema.ts +0 -11
- package/src/metadata/index.ts +0 -3
- package/src/mutable/context.ts +0 -71
- package/src/mutable/index.ts +0 -14
- package/src/mutable/state.ts +0 -13
- package/src/mutable/type.ts +0 -9
- package/src/mutable/utils.ts +0 -80
- package/src/navigation/hooks/useOpenForm.ts +0 -34
- package/src/progress-indicator/ProgressIndicatorProvider.tsx +0 -77
- package/src/progress-indicator/context.ts +0 -12
- package/src/progress-indicator/hooks/index.ts +0 -1
- package/src/progress-indicator/hooks/useProgressIndicator.ts +0 -15
- package/src/progress-indicator/index.ts +0 -6
- package/src/providers/PageEntityFormProvider/index.tsx +0 -34
- package/src/providers/PageEntityViewProvider/index.tsx +0 -39
- package/src/recordset/RecordSetProvider.tsx +0 -55
- package/src/recordset/context.ts +0 -12
- package/src/recordset/hooks/index.ts +0 -3
- package/src/recordset/hooks/useRecordSetResult.ts +0 -94
- package/src/recordset/hooks/useRecordSetSetter.ts +0 -21
- package/src/recordset/hooks/useRecordSetVisibility.ts +0 -24
- package/src/recordset/index.ts +0 -3
- package/src/route/RouteProvider.tsx +0 -76
- package/src/route/context.ts +0 -39
- package/src/route/hooks/index.ts +0 -5
- package/src/route/hooks/useBasePath.ts +0 -7
- package/src/route/hooks/usePathname.ts +0 -7
- package/src/route/hooks/useRouteResolver.ts +0 -7
- package/src/route/hooks/useRouter.ts +0 -7
- package/src/route/hooks/useSearchParams.ts +0 -7
- package/src/route/index.ts +0 -2
- package/src/route/types.ts +0 -1
- package/src/store/ClientAppStore.ts +0 -20
- package/src/store/ComponentStore.tsx +0 -22
- package/src/store/EventManager.ts +0 -33
- package/src/store/SchemaExperienceStore.ts +0 -374
- package/src/store/index.ts +0 -4
- package/src/toast-notification/ToastNotificationProvider.tsx +0 -23
- package/src/toast-notification/context.ts +0 -17
- package/src/toast-notification/hooks/index.ts +0 -3
- package/src/toast-notification/hooks/useCloseToastNotification.ts +0 -36
- package/src/toast-notification/hooks/useOpenToastNotification.ts +0 -38
- package/src/toast-notification/hooks/useToastNotificationItems.ts +0 -6
- package/src/toast-notification/index.ts +0 -7
- package/src/transport/InMemoryDataService/index.ts +0 -157
- package/src/transport/RestDataService/index.ts +0 -151
- package/src/transport/context.ts +0 -6
- package/src/transport/hooks/index.ts +0 -1
- package/src/transport/hooks/useDataService.ts +0 -13
- package/src/transport/index.ts +0 -2
- package/src/utils/calculateColumnWidths.ts +0 -72
- package/src/utils/index.ts +0 -1
- package/src/widget/context.ts +0 -5
- package/src/widget/hooks/index.ts +0 -11
- package/src/widget/index.ts +0 -1
- package/tsconfig.json +0 -9
- package/tsconfig.tsbuildinfo +0 -1
- /package/{dist/app → app}/context.d.ts +0 -0
- /package/{dist/app → app}/context.js +0 -0
- /package/{dist/app → app}/hooks/index.d.ts +0 -0
- /package/{dist/app → app}/hooks/index.js +0 -0
- /package/{dist/app → app}/hooks/useAppContext.d.ts +0 -0
- /package/{dist/app → app}/hooks/useAppContext.js +0 -0
- /package/{dist/app → app}/index.d.ts +0 -0
- /package/{dist/app → app}/index.js +0 -0
- /package/{dist/appearance → appearance}/context.d.ts +0 -0
- /package/{dist/appearance → appearance}/context.js +0 -0
- /package/{dist/appearance → appearance}/hooks/index.d.ts +0 -0
- /package/{dist/appearance → appearance}/hooks/index.js +0 -0
- /package/{dist/appearance → appearance}/hooks/useAppearanceContext.d.ts +0 -0
- /package/{dist/appearance → appearance}/hooks/useAppearanceContext.js +0 -0
- /package/{dist/appearance → appearance}/index.d.ts +0 -0
- /package/{dist/appearance → appearance}/index.js +0 -0
- /package/{dist/auth → auth}/AuthProvider.d.ts +0 -0
- /package/{dist/auth → auth}/AuthProvider.js +0 -0
- /package/{dist/auth → auth}/context.d.ts +0 -0
- /package/{dist/auth → auth}/context.js +0 -0
- /package/{dist/auth → auth}/hooks/index.d.ts +0 -0
- /package/{dist/auth → auth}/hooks/index.js +0 -0
- /package/{dist/auth → auth}/hooks/useAuthSession.d.ts +0 -0
- /package/{dist/auth → auth}/hooks/useAuthSession.js +0 -0
- /package/{dist/auth → auth}/hooks/useLogout.d.ts +0 -0
- /package/{dist/auth → auth}/hooks/useLogout.js +0 -0
- /package/{dist/auth → auth}/index.d.ts +0 -0
- /package/{dist/auth → auth}/index.js +0 -0
- /package/{dist/auth → auth}/types.d.ts +0 -0
- /package/{dist/auth → auth}/types.js +0 -0
- /package/{dist/builders → builders}/CommandBuilder.d.ts +0 -0
- /package/{dist/builders → builders}/CommandBuilder.js +0 -0
- /package/{dist/builders → builders}/SchemaExperienceBuilder.d.ts +0 -0
- /package/{dist/builders → builders}/SchemaExperienceBuilder.js +0 -0
- /package/{dist/builders → builders}/index.d.ts +0 -0
- /package/{dist/builders → builders}/index.js +0 -0
- /package/{dist/command → command}/hooks/index.d.ts +0 -0
- /package/{dist/command → command}/hooks/index.js +0 -0
- /package/{dist/command → command}/hooks/useBaseCommandHandlerContext.d.ts +0 -0
- /package/{dist/command → command}/hooks/useBaseCommandHandlerContext.js +0 -0
- /package/{dist/command → command}/hooks/useCommands.d.ts +0 -0
- /package/{dist/command → command}/hooks/useCommands.js +0 -0
- /package/{dist/command → command}/index.d.ts +0 -0
- /package/{dist/command → command}/index.js +0 -0
- /package/{dist/command → command}/types.d.ts +0 -0
- /package/{dist/command → command}/types.js +0 -0
- /package/{dist/command → command}/utils/index.d.ts +0 -0
- /package/{dist/command → command}/utils/index.js +0 -0
- /package/{dist/components → components}/ScrollView/index.d.ts +0 -0
- /package/{dist/components → components}/ScrollView/index.js +0 -0
- /package/{dist/dataform → dataform}/DataFormProvider/DataResolver.d.ts +0 -0
- /package/{dist/dataform → dataform}/DataFormProvider/DataResolver.js +0 -0
- /package/{dist/dataform → dataform}/DataFormProvider/InitialValueResolver.d.ts +0 -0
- /package/{dist/dataform → dataform}/DataFormProvider/InitialValueResolver.js +0 -0
- /package/{dist/dataform → dataform}/DataFormProvider/ReadonlyInfoResolver.d.ts +0 -0
- /package/{dist/dataform → dataform}/DataFormProvider/ReadonlyInfoResolver.js +0 -0
- /package/{dist/dataform → dataform}/DataFormProvider/index.d.ts +0 -0
- /package/{dist/dataform → dataform}/DataFormProvider/index.js +0 -0
- /package/{dist/dataform → dataform}/context.d.ts +0 -0
- /package/{dist/dataform → dataform}/context.js +0 -0
- /package/{dist/dataform → dataform}/hooks/index.d.ts +0 -0
- /package/{dist/dataform → dataform}/hooks/index.js +0 -0
- /package/{dist/dataform → dataform}/hooks/useFormInstance.d.ts +0 -0
- /package/{dist/dataform → dataform}/hooks/useFormInstance.js +0 -0
- /package/{dist/dataform → dataform}/hooks/useFormIsDirty.d.ts +0 -0
- /package/{dist/dataform → dataform}/hooks/useFormIsDirty.js +0 -0
- /package/{dist/dataform → dataform}/hooks/useFormIsReadonly.d.ts +0 -0
- /package/{dist/dataform → dataform}/hooks/useFormIsReadonly.js +0 -0
- /package/{dist/dataform → dataform}/hooks/useFormNotifications.d.ts +0 -0
- /package/{dist/dataform → dataform}/hooks/useFormNotifications.js +0 -0
- /package/{dist/dataform → dataform}/hooks/useFormRecord.d.ts +0 -0
- /package/{dist/dataform → dataform}/hooks/useFormRecord.js +0 -0
- /package/{dist/dataform → dataform}/hooks/useFormSave.d.ts +0 -0
- /package/{dist/dataform → dataform}/hooks/useFormSave.js +0 -0
- /package/{dist/dataform → dataform}/hooks/useFormSchema.d.ts +0 -0
- /package/{dist/dataform → dataform}/hooks/useFormSchema.js +0 -0
- /package/{dist/dataform → dataform}/hooks/useLoadFormGridPage.d.ts +0 -0
- /package/{dist/dataform → dataform}/hooks/useLoadFormGridPage.js +0 -0
- /package/{dist/dataform → dataform}/hooks/useMainFormCommands.d.ts +0 -0
- /package/{dist/dataform → dataform}/hooks/useMainFormCommands.js +0 -0
- /package/{dist/dataform → dataform}/hooks/useRecordId.d.ts +0 -0
- /package/{dist/dataform → dataform}/hooks/useRecordId.js +0 -0
- /package/{dist/dataform → dataform}/hooks/useRecordTitle.d.ts +0 -0
- /package/{dist/dataform → dataform}/hooks/useRecordTitle.js +0 -0
- /package/{dist/dataform → dataform}/hooks/useSelectedForm.d.ts +0 -0
- /package/{dist/dataform → dataform}/hooks/useSelectedForm.js +0 -0
- /package/{dist/dataform → dataform}/index.d.ts +0 -0
- /package/{dist/dataform → dataform}/index.js +0 -0
- /package/{dist/dataform → dataform}/utils/index.d.ts +0 -0
- /package/{dist/dataform → dataform}/utils/index.js +0 -0
- /package/{dist/datagrid → datagrid}/DataGridProvider/DataResolver.d.ts +0 -0
- /package/{dist/datagrid → datagrid}/DataGridProvider/DataResolver.js +0 -0
- /package/{dist/datagrid → datagrid}/DataGridProvider/index.d.ts +0 -0
- /package/{dist/datagrid → datagrid}/DataGridProvider/index.js +0 -0
- /package/{dist/datagrid → datagrid}/DataGridProvider/transformViewColumns.d.ts +0 -0
- /package/{dist/datagrid → datagrid}/DataGridProvider/transformViewColumns.js +0 -0
- /package/{dist/datagrid → datagrid}/DataGridProvider/utils.d.ts +0 -0
- /package/{dist/datagrid → datagrid}/DataGridProvider/utils.js +0 -0
- /package/{dist/datagrid → datagrid}/column-filter/constants.d.ts +0 -0
- /package/{dist/datagrid → datagrid}/column-filter/constants.js +0 -0
- /package/{dist/datagrid → datagrid}/column-filter/index.d.ts +0 -0
- /package/{dist/datagrid → datagrid}/column-filter/index.js +0 -0
- /package/{dist/datagrid → datagrid}/column-filter/types.d.ts +0 -0
- /package/{dist/datagrid → datagrid}/column-filter/types.js +0 -0
- /package/{dist/datagrid → datagrid}/column-filter/utils.d.ts +0 -0
- /package/{dist/datagrid → datagrid}/column-filter/utils.js +0 -0
- /package/{dist/datagrid → datagrid}/context.d.ts +0 -0
- /package/{dist/datagrid → datagrid}/context.js +0 -0
- /package/{dist/datagrid → datagrid}/hooks/index.d.ts +0 -0
- /package/{dist/datagrid → datagrid}/hooks/index.js +0 -0
- /package/{dist/datagrid → datagrid}/hooks/useChangeView.d.ts +0 -0
- /package/{dist/datagrid → datagrid}/hooks/useChangeView.js +0 -0
- /package/{dist/datagrid → datagrid}/hooks/useGridColumnFilter.d.ts +0 -0
- /package/{dist/datagrid → datagrid}/hooks/useGridColumnFilter.js +0 -0
- /package/{dist/datagrid → datagrid}/hooks/useGridColumns.d.ts +0 -0
- /package/{dist/datagrid → datagrid}/hooks/useGridColumns.js +0 -0
- /package/{dist/datagrid → datagrid}/hooks/useGridCommands.d.ts +0 -0
- /package/{dist/datagrid → datagrid}/hooks/useGridCommands.js +0 -0
- /package/{dist/datagrid → datagrid}/hooks/useGridData.d.ts +0 -0
- /package/{dist/datagrid → datagrid}/hooks/useGridData.js +0 -0
- /package/{dist/datagrid → datagrid}/hooks/useGridDataState.d.ts +0 -0
- /package/{dist/datagrid → datagrid}/hooks/useGridDataState.js +0 -0
- /package/{dist/datagrid → datagrid}/hooks/useGridExtraFilter.d.ts +0 -0
- /package/{dist/datagrid → datagrid}/hooks/useGridExtraFilter.js +0 -0
- /package/{dist/datagrid → datagrid}/hooks/useGridOptions.d.ts +0 -0
- /package/{dist/datagrid → datagrid}/hooks/useGridOptions.js +0 -0
- /package/{dist/datagrid → datagrid}/hooks/useGridPagination.d.ts +0 -0
- /package/{dist/datagrid → datagrid}/hooks/useGridPagination.js +0 -0
- /package/{dist/datagrid → datagrid}/hooks/useGridRefresh.d.ts +0 -0
- /package/{dist/datagrid → datagrid}/hooks/useGridRefresh.js +0 -0
- /package/{dist/datagrid → datagrid}/hooks/useGridSchema.d.ts +0 -0
- /package/{dist/datagrid → datagrid}/hooks/useGridSchema.js +0 -0
- /package/{dist/datagrid → datagrid}/hooks/useGridSelection.d.ts +0 -0
- /package/{dist/datagrid → datagrid}/hooks/useGridSelection.js +0 -0
- /package/{dist/datagrid → datagrid}/hooks/useGridSorting.d.ts +0 -0
- /package/{dist/datagrid → datagrid}/hooks/useGridSorting.js +0 -0
- /package/{dist/datagrid → datagrid}/hooks/useGridViewLookupData.d.ts +0 -0
- /package/{dist/datagrid → datagrid}/hooks/useGridViewLookupData.js +0 -0
- /package/{dist/datagrid → datagrid}/hooks/useLoadMainGridPage.d.ts +0 -0
- /package/{dist/datagrid → datagrid}/hooks/useLoadMainGridPage.js +0 -0
- /package/{dist/datagrid → datagrid}/hooks/useMainGridCommands.d.ts +0 -0
- /package/{dist/datagrid → datagrid}/hooks/useMainGridCommands.js +0 -0
- /package/{dist/datagrid → datagrid}/hooks/useMaxRecords.d.ts +0 -0
- /package/{dist/datagrid → datagrid}/hooks/useMaxRecords.js +0 -0
- /package/{dist/datagrid → datagrid}/hooks/useSearchText.d.ts +0 -0
- /package/{dist/datagrid → datagrid}/hooks/useSearchText.js +0 -0
- /package/{dist/datagrid → datagrid}/hooks/useSelectedView.d.ts +0 -0
- /package/{dist/datagrid → datagrid}/hooks/useSelectedView.js +0 -0
- /package/{dist/datagrid → datagrid}/hooks/useSubGridCommands.d.ts +0 -0
- /package/{dist/datagrid → datagrid}/hooks/useSubGridCommands.js +0 -0
- /package/{dist/datagrid → datagrid}/index.d.ts +0 -0
- /package/{dist/datagrid → datagrid}/index.js +0 -0
- /package/{dist/dialog → dialog}/DialogProvider.d.ts +0 -0
- /package/{dist/dialog → dialog}/DialogProvider.js +0 -0
- /package/{dist/dialog → dialog}/context.d.ts +0 -0
- /package/{dist/dialog → dialog}/context.js +0 -0
- /package/{dist/dialog → dialog}/hooks/index.d.ts +0 -0
- /package/{dist/dialog → dialog}/hooks/index.js +0 -0
- /package/{dist/dialog → dialog}/hooks/useCloseDialog.d.ts +0 -0
- /package/{dist/dialog → dialog}/hooks/useCloseDialog.js +0 -0
- /package/{dist/dialog → dialog}/hooks/useDialogItem.d.ts +0 -0
- /package/{dist/dialog → dialog}/hooks/useDialogItem.js +0 -0
- /package/{dist/dialog → dialog}/hooks/useDialogItems.d.ts +0 -0
- /package/{dist/dialog → dialog}/hooks/useDialogItems.js +0 -0
- /package/{dist/dialog → dialog}/hooks/useOpenAlertDialog.d.ts +0 -0
- /package/{dist/dialog → dialog}/hooks/useOpenAlertDialog.js +0 -0
- /package/{dist/dialog → dialog}/hooks/useOpenConfirmDialog.d.ts +0 -0
- /package/{dist/dialog → dialog}/hooks/useOpenConfirmDialog.js +0 -0
- /package/{dist/dialog → dialog}/hooks/useOpenDialog.d.ts +0 -0
- /package/{dist/dialog → dialog}/hooks/useOpenDialog.js +0 -0
- /package/{dist/dialog → dialog}/hooks/useOpenErrorDialog.d.ts +0 -0
- /package/{dist/dialog → dialog}/hooks/useOpenErrorDialog.js +0 -0
- /package/{dist/dialog → dialog}/hooks/useOpenPromptDialog.d.ts +0 -0
- /package/{dist/dialog → dialog}/hooks/useOpenPromptDialog.js +0 -0
- /package/{dist/dialog → dialog}/index.d.ts +0 -0
- /package/{dist/dialog → dialog}/index.js +0 -0
- /package/{dist/form → form}/FormValidationStringContext.d.ts +0 -0
- /package/{dist/form → form}/FormValidationStringContext.js +0 -0
- /package/{dist/form → form}/index.d.ts +0 -0
- /package/{dist/form → form}/index.js +0 -0
- /package/{dist/hooks → hooks}/index.d.ts +0 -0
- /package/{dist/hooks → hooks}/index.js +0 -0
- /package/{dist/hooks → hooks}/useDebouncedValue.d.ts +0 -0
- /package/{dist/hooks → hooks}/useDebouncedValue.js +0 -0
- /package/{dist/hooks → hooks}/useElementLayout.d.ts +0 -0
- /package/{dist/hooks → hooks}/useElementLayout.js +0 -0
- /package/{dist/hooks → hooks}/useIsMobile.d.ts +0 -0
- /package/{dist/hooks → hooks}/useIsMobile.js +0 -0
- /package/{dist/hooks → hooks}/useStorageState.d.ts +0 -0
- /package/{dist/hooks → hooks}/useStorageState.js +0 -0
- /package/{dist/hooks → hooks}/useSystemColorScheme.d.ts +0 -0
- /package/{dist/hooks → hooks}/useSystemColorScheme.js +0 -0
- /package/{dist/insights → insights}/context.d.ts +0 -0
- /package/{dist/insights → insights}/context.js +0 -0
- /package/{dist/insights → insights}/hooks/index.d.ts +0 -0
- /package/{dist/insights → insights}/hooks/index.js +0 -0
- /package/{dist/insights → insights}/index.d.ts +0 -0
- /package/{dist/insights → insights}/index.js +0 -0
- /package/{dist/locale → locale}/context.d.ts +0 -0
- /package/{dist/locale → locale}/context.js +0 -0
- /package/{dist/locale → locale}/index.d.ts +0 -0
- /package/{dist/locale → locale}/index.js +0 -0
- /package/{dist/locale → locale}/types.d.ts +0 -0
- /package/{dist/locale → locale}/types.js +0 -0
- /package/{dist/locale → locale}/useLocale.d.ts +0 -0
- /package/{dist/locale → locale}/useLocale.js +0 -0
- /package/{dist/metadata → metadata}/MetadataProvider.d.ts +0 -0
- /package/{dist/metadata → metadata}/MetadataProvider.js +0 -0
- /package/{dist/metadata → metadata}/context.d.ts +0 -0
- /package/{dist/metadata → metadata}/context.js +0 -0
- /package/{dist/metadata → metadata}/hooks/index.d.ts +0 -0
- /package/{dist/metadata → metadata}/hooks/index.js +0 -0
- /package/{dist/metadata → metadata}/hooks/useAppStore.d.ts +0 -0
- /package/{dist/metadata → metadata}/hooks/useAppStore.js +0 -0
- /package/{dist/metadata → metadata}/hooks/useExperienceStore.d.ts +0 -0
- /package/{dist/metadata → metadata}/hooks/useExperienceStore.js +0 -0
- /package/{dist/metadata → metadata}/hooks/useExperienceView.d.ts +0 -0
- /package/{dist/metadata → metadata}/hooks/useExperienceView.js +0 -0
- /package/{dist/metadata → metadata}/hooks/useExperienceViewCommands.d.ts +0 -0
- /package/{dist/metadata → metadata}/hooks/useExperienceViewCommands.js +0 -0
- /package/{dist/metadata → metadata}/hooks/useExperienceViewLookup.d.ts +0 -0
- /package/{dist/metadata → metadata}/hooks/useExperienceViewLookup.js +0 -0
- /package/{dist/metadata → metadata}/hooks/useExperienceViewSubgridCommands.d.ts +0 -0
- /package/{dist/metadata → metadata}/hooks/useExperienceViewSubgridCommands.js +0 -0
- /package/{dist/metadata → metadata}/hooks/useMetadata.d.ts +0 -0
- /package/{dist/metadata → metadata}/hooks/useMetadata.js +0 -0
- /package/{dist/metadata → metadata}/hooks/useSchema.d.ts +0 -0
- /package/{dist/metadata → metadata}/hooks/useSchema.js +0 -0
- /package/{dist/metadata → metadata}/index.d.ts +0 -0
- /package/{dist/metadata → metadata}/index.js +0 -0
- /package/{dist/mutable → mutable}/context.d.ts +0 -0
- /package/{dist/mutable → mutable}/context.js +0 -0
- /package/{dist/mutable → mutable}/index.d.ts +0 -0
- /package/{dist/mutable → mutable}/index.js +0 -0
- /package/{dist/mutable → mutable}/state.d.ts +0 -0
- /package/{dist/mutable → mutable}/state.js +0 -0
- /package/{dist/mutable → mutable}/type.d.ts +0 -0
- /package/{dist/mutable → mutable}/type.js +0 -0
- /package/{dist/mutable → mutable}/utils.d.ts +0 -0
- /package/{dist/mutable → mutable}/utils.js +0 -0
- /package/{dist/navigation → navigation}/hooks/useOpenForm.d.ts +0 -0
- /package/{dist/navigation → navigation}/hooks/useOpenForm.js +0 -0
- /package/{dist/progress-indicator → progress-indicator}/ProgressIndicatorProvider.d.ts +0 -0
- /package/{dist/progress-indicator → progress-indicator}/ProgressIndicatorProvider.js +0 -0
- /package/{dist/progress-indicator → progress-indicator}/context.d.ts +0 -0
- /package/{dist/progress-indicator → progress-indicator}/context.js +0 -0
- /package/{dist/progress-indicator → progress-indicator}/hooks/index.d.ts +0 -0
- /package/{dist/progress-indicator → progress-indicator}/hooks/index.js +0 -0
- /package/{dist/progress-indicator → progress-indicator}/hooks/useProgressIndicator.d.ts +0 -0
- /package/{dist/progress-indicator → progress-indicator}/hooks/useProgressIndicator.js +0 -0
- /package/{dist/progress-indicator → progress-indicator}/index.d.ts +0 -0
- /package/{dist/progress-indicator → progress-indicator}/index.js +0 -0
- /package/{dist/providers → providers}/PageEntityFormProvider/index.d.ts +0 -0
- /package/{dist/providers → providers}/PageEntityFormProvider/index.js +0 -0
- /package/{dist/providers → providers}/PageEntityViewProvider/index.d.ts +0 -0
- /package/{dist/providers → providers}/PageEntityViewProvider/index.js +0 -0
- /package/{dist/recordset → recordset}/RecordSetProvider.d.ts +0 -0
- /package/{dist/recordset → recordset}/RecordSetProvider.js +0 -0
- /package/{dist/recordset → recordset}/context.d.ts +0 -0
- /package/{dist/recordset → recordset}/context.js +0 -0
- /package/{dist/recordset → recordset}/hooks/index.d.ts +0 -0
- /package/{dist/recordset → recordset}/hooks/index.js +0 -0
- /package/{dist/recordset → recordset}/hooks/useRecordSetResult.d.ts +0 -0
- /package/{dist/recordset → recordset}/hooks/useRecordSetResult.js +0 -0
- /package/{dist/recordset → recordset}/hooks/useRecordSetSetter.d.ts +0 -0
- /package/{dist/recordset → recordset}/hooks/useRecordSetSetter.js +0 -0
- /package/{dist/recordset → recordset}/hooks/useRecordSetVisibility.d.ts +0 -0
- /package/{dist/recordset → recordset}/hooks/useRecordSetVisibility.js +0 -0
- /package/{dist/recordset → recordset}/index.d.ts +0 -0
- /package/{dist/recordset → recordset}/index.js +0 -0
- /package/{dist/route → route}/RouteProvider.d.ts +0 -0
- /package/{dist/route → route}/RouteProvider.js +0 -0
- /package/{dist/route → route}/context.d.ts +0 -0
- /package/{dist/route → route}/context.js +0 -0
- /package/{dist/route → route}/hooks/index.d.ts +0 -0
- /package/{dist/route → route}/hooks/index.js +0 -0
- /package/{dist/route → route}/hooks/useBasePath.d.ts +0 -0
- /package/{dist/route → route}/hooks/useBasePath.js +0 -0
- /package/{dist/route → route}/hooks/usePathname.d.ts +0 -0
- /package/{dist/route → route}/hooks/usePathname.js +0 -0
- /package/{dist/route → route}/hooks/useRouteResolver.d.ts +0 -0
- /package/{dist/route → route}/hooks/useRouteResolver.js +0 -0
- /package/{dist/route → route}/hooks/useRouter.d.ts +0 -0
- /package/{dist/route → route}/hooks/useRouter.js +0 -0
- /package/{dist/route → route}/hooks/useSearchParams.d.ts +0 -0
- /package/{dist/route → route}/hooks/useSearchParams.js +0 -0
- /package/{dist/route → route}/index.d.ts +0 -0
- /package/{dist/route → route}/index.js +0 -0
- /package/{dist/route → route}/types.d.ts +0 -0
- /package/{dist/route → route}/types.js +0 -0
- /package/{dist/store → store}/ClientAppStore.d.ts +0 -0
- /package/{dist/store → store}/ClientAppStore.js +0 -0
- /package/{dist/store → store}/ComponentStore.d.ts +0 -0
- /package/{dist/store → store}/ComponentStore.js +0 -0
- /package/{dist/store → store}/EventManager.d.ts +0 -0
- /package/{dist/store → store}/EventManager.js +0 -0
- /package/{dist/store → store}/SchemaExperienceStore.d.ts +0 -0
- /package/{dist/store → store}/SchemaExperienceStore.js +0 -0
- /package/{dist/store → store}/index.d.ts +0 -0
- /package/{dist/store → store}/index.js +0 -0
- /package/{dist/toast-notification → toast-notification}/ToastNotificationProvider.d.ts +0 -0
- /package/{dist/toast-notification → toast-notification}/ToastNotificationProvider.js +0 -0
- /package/{dist/toast-notification → toast-notification}/context.d.ts +0 -0
- /package/{dist/toast-notification → toast-notification}/context.js +0 -0
- /package/{dist/toast-notification → toast-notification}/hooks/index.d.ts +0 -0
- /package/{dist/toast-notification → toast-notification}/hooks/index.js +0 -0
- /package/{dist/toast-notification → toast-notification}/hooks/useCloseToastNotification.d.ts +0 -0
- /package/{dist/toast-notification → toast-notification}/hooks/useCloseToastNotification.js +0 -0
- /package/{dist/toast-notification → toast-notification}/hooks/useOpenToastNotification.d.ts +0 -0
- /package/{dist/toast-notification → toast-notification}/hooks/useOpenToastNotification.js +0 -0
- /package/{dist/toast-notification → toast-notification}/hooks/useToastNotificationItems.d.ts +0 -0
- /package/{dist/toast-notification → toast-notification}/hooks/useToastNotificationItems.js +0 -0
- /package/{dist/toast-notification → toast-notification}/index.d.ts +0 -0
- /package/{dist/toast-notification → toast-notification}/index.js +0 -0
- /package/{dist/transport → transport}/InMemoryDataService/index.d.ts +0 -0
- /package/{dist/transport → transport}/InMemoryDataService/index.js +0 -0
- /package/{dist/transport → transport}/RestDataService/index.d.ts +0 -0
- /package/{dist/transport → transport}/RestDataService/index.js +0 -0
- /package/{dist/transport → transport}/context.d.ts +0 -0
- /package/{dist/transport → transport}/context.js +0 -0
- /package/{dist/transport → transport}/hooks/index.d.ts +0 -0
- /package/{dist/transport → transport}/hooks/index.js +0 -0
- /package/{dist/transport → transport}/hooks/useDataService.d.ts +0 -0
- /package/{dist/transport → transport}/hooks/useDataService.js +0 -0
- /package/{dist/transport → transport}/index.d.ts +0 -0
- /package/{dist/transport → transport}/index.js +0 -0
- /package/{dist/utils → utils}/calculateColumnWidths.d.ts +0 -0
- /package/{dist/utils → utils}/calculateColumnWidths.js +0 -0
- /package/{dist/utils → utils}/index.d.ts +0 -0
- /package/{dist/utils → utils}/index.js +0 -0
- /package/{dist/widget → widget}/context.d.ts +0 -0
- /package/{dist/widget → widget}/context.js +0 -0
- /package/{dist/widget → widget}/hooks/index.d.ts +0 -0
- /package/{dist/widget → widget}/hooks/index.js +0 -0
- /package/{dist/widget → widget}/index.d.ts +0 -0
- /package/{dist/widget → widget}/index.js +0 -0
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { keepPreviousData, useQuery } from '@tanstack/react-query';
|
|
2
|
-
|
|
3
|
-
import { useExperienceStore } from './useExperienceStore';
|
|
4
|
-
|
|
5
|
-
export function useExperienceView(
|
|
6
|
-
logicalName: string,
|
|
7
|
-
viewId?: string,
|
|
8
|
-
associated?: boolean,
|
|
9
|
-
viewIds?: string[]
|
|
10
|
-
) {
|
|
11
|
-
const experienceStore = useExperienceStore();
|
|
12
|
-
|
|
13
|
-
const { data, isPending } = useQuery({
|
|
14
|
-
queryKey: [
|
|
15
|
-
'experience-schema-view',
|
|
16
|
-
logicalName,
|
|
17
|
-
viewId,
|
|
18
|
-
associated,
|
|
19
|
-
viewIds,
|
|
20
|
-
],
|
|
21
|
-
queryFn: async () => {
|
|
22
|
-
if (associated) {
|
|
23
|
-
return experienceStore.getAssociatedView(logicalName, viewId, viewIds);
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
return experienceStore.getPublicView(logicalName, viewId, viewIds);
|
|
27
|
-
},
|
|
28
|
-
|
|
29
|
-
placeholderData: keepPreviousData,
|
|
30
|
-
});
|
|
31
|
-
|
|
32
|
-
return {
|
|
33
|
-
view: data,
|
|
34
|
-
isLoadingView: isPending,
|
|
35
|
-
};
|
|
36
|
-
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { useQuery } from '@tanstack/react-query';
|
|
2
|
-
|
|
3
|
-
import { useExperienceStore } from './useExperienceStore';
|
|
4
|
-
|
|
5
|
-
/** @todo move in different dir */
|
|
6
|
-
export function useExperienceViewCommands(logicalName: string) {
|
|
7
|
-
const experienceStore = useExperienceStore();
|
|
8
|
-
|
|
9
|
-
const { data: commands } = useQuery({
|
|
10
|
-
queryKey: ['experience-schema-view-commands', logicalName],
|
|
11
|
-
queryFn: async () => {
|
|
12
|
-
return experienceStore.getViewCommands(logicalName);
|
|
13
|
-
},
|
|
14
|
-
initialData: [],
|
|
15
|
-
});
|
|
16
|
-
|
|
17
|
-
return {
|
|
18
|
-
commands,
|
|
19
|
-
};
|
|
20
|
-
}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { useQuery } from '@tanstack/react-query';
|
|
2
|
-
|
|
3
|
-
import { useExperienceStore } from './useExperienceStore';
|
|
4
|
-
|
|
5
|
-
/** @todo move in different dir */
|
|
6
|
-
export function useExperienceViewLookup(
|
|
7
|
-
logicalName: string,
|
|
8
|
-
associated?: boolean,
|
|
9
|
-
viewIds?: string[]
|
|
10
|
-
) {
|
|
11
|
-
const experienceStore = useExperienceStore();
|
|
12
|
-
|
|
13
|
-
const { data: viewLookup } = useQuery({
|
|
14
|
-
queryKey: [
|
|
15
|
-
'experience-schema-view-lookup',
|
|
16
|
-
logicalName,
|
|
17
|
-
associated,
|
|
18
|
-
viewIds,
|
|
19
|
-
],
|
|
20
|
-
queryFn: async () => {
|
|
21
|
-
if (associated) {
|
|
22
|
-
return experienceStore.getAssociatedViewLookup(logicalName, viewIds);
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
return experienceStore.getPublicViewLookup(logicalName, viewIds);
|
|
26
|
-
},
|
|
27
|
-
initialData: [],
|
|
28
|
-
});
|
|
29
|
-
|
|
30
|
-
return {
|
|
31
|
-
viewLookup,
|
|
32
|
-
};
|
|
33
|
-
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { useQuery } from '@tanstack/react-query';
|
|
2
|
-
|
|
3
|
-
import { useExperienceStore } from './useExperienceStore';
|
|
4
|
-
|
|
5
|
-
/** @todo move in different dir */
|
|
6
|
-
export function useExperienceViewSubgridCommands(logicalName: string) {
|
|
7
|
-
const experienceStore = useExperienceStore();
|
|
8
|
-
|
|
9
|
-
const { data: commands } = useQuery({
|
|
10
|
-
queryKey: ['experience-schema-view-subgrid-commands', logicalName],
|
|
11
|
-
queryFn: async () => {
|
|
12
|
-
return experienceStore.getSubgridCommands(logicalName);
|
|
13
|
-
},
|
|
14
|
-
initialData: [],
|
|
15
|
-
});
|
|
16
|
-
|
|
17
|
-
return {
|
|
18
|
-
commands,
|
|
19
|
-
};
|
|
20
|
-
}
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import { SchemaAttributes } from '@headless-adminapp/core/schema';
|
|
2
|
-
import { useCallback } from 'react';
|
|
3
|
-
|
|
4
|
-
import { useContextSelector } from '../../mutable/context';
|
|
5
|
-
import { MetadataContext } from '../context';
|
|
6
|
-
|
|
7
|
-
export function useMetadata() {
|
|
8
|
-
const schemaStore = useContextSelector(
|
|
9
|
-
MetadataContext,
|
|
10
|
-
(state) => state.schemaStore
|
|
11
|
-
);
|
|
12
|
-
const appStore = useContextSelector(
|
|
13
|
-
MetadataContext,
|
|
14
|
-
(state) => state.appStore
|
|
15
|
-
);
|
|
16
|
-
const experienceStore = useContextSelector(
|
|
17
|
-
MetadataContext,
|
|
18
|
-
(state) => state.experienceStore
|
|
19
|
-
);
|
|
20
|
-
// const schemaLoading = useContextSelector(
|
|
21
|
-
// MetadataContext,
|
|
22
|
-
// (state) => state.schemaLoading
|
|
23
|
-
// );
|
|
24
|
-
|
|
25
|
-
const schemaLoading = false;
|
|
26
|
-
|
|
27
|
-
const schemas = schemaStore.getAllSchema();
|
|
28
|
-
|
|
29
|
-
const getSchema = useCallback(
|
|
30
|
-
<S extends SchemaAttributes = SchemaAttributes>(logicalName: string) => {
|
|
31
|
-
return schemaStore.getSchema<S>(logicalName);
|
|
32
|
-
},
|
|
33
|
-
[schemaStore]
|
|
34
|
-
);
|
|
35
|
-
|
|
36
|
-
return {
|
|
37
|
-
schemas,
|
|
38
|
-
schemaLoading,
|
|
39
|
-
getSchema,
|
|
40
|
-
schemaStore,
|
|
41
|
-
appStore,
|
|
42
|
-
experienceStore,
|
|
43
|
-
};
|
|
44
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { SchemaAttributes } from '@headless-adminapp/core/schema';
|
|
2
|
-
|
|
3
|
-
import { useMetadata } from './useMetadata';
|
|
4
|
-
|
|
5
|
-
export function useSchema<S extends SchemaAttributes = SchemaAttributes>(
|
|
6
|
-
logicalName: string
|
|
7
|
-
) {
|
|
8
|
-
const { getSchema } = useMetadata();
|
|
9
|
-
|
|
10
|
-
return getSchema<S>(logicalName);
|
|
11
|
-
}
|
package/src/metadata/index.ts
DELETED
package/src/mutable/context.ts
DELETED
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
createContext as createReactContext,
|
|
3
|
-
useCallback,
|
|
4
|
-
useContext,
|
|
5
|
-
useRef,
|
|
6
|
-
useState,
|
|
7
|
-
} from 'react';
|
|
8
|
-
|
|
9
|
-
import { MutableValue } from './type';
|
|
10
|
-
import { createMutableValue, useMutableValueSelector } from './utils';
|
|
11
|
-
|
|
12
|
-
export type ContextValue<T> = MutableValue<T>;
|
|
13
|
-
const createContextValue = createMutableValue;
|
|
14
|
-
export const useContextSelectorInternal = useMutableValueSelector;
|
|
15
|
-
|
|
16
|
-
export function createContext<T>() {
|
|
17
|
-
const context = createReactContext<ContextValue<T>>(null as any);
|
|
18
|
-
return context;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
export function useCreateContextStore<T>(initialValue: T) {
|
|
22
|
-
const [state] = useState(() => createContextValue(initialValue));
|
|
23
|
-
return state;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
export function useContextSelector<T, R>(
|
|
27
|
-
context: React.Context<ContextValue<T>>,
|
|
28
|
-
selector: (state: T) => R
|
|
29
|
-
) {
|
|
30
|
-
const contextValue = useContext(context);
|
|
31
|
-
|
|
32
|
-
if (!contextValue) {
|
|
33
|
-
throw new Error('useContextSelector must be used within a Provider');
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
return useContextSelectorInternal(contextValue, selector);
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
export function useContextSetValue<T>(context: React.Context<ContextValue<T>>) {
|
|
40
|
-
const contextValue = useContext(context);
|
|
41
|
-
|
|
42
|
-
if (!contextValue) {
|
|
43
|
-
throw new Error('useContextSetValue must be used within a Provider');
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
return contextValue.setValue;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
type Setter<T, U extends unknown[]> = (
|
|
50
|
-
setValue: ContextValue<T>['setValue']
|
|
51
|
-
) => (...args: U) => void;
|
|
52
|
-
|
|
53
|
-
export function useContextValueSetter<T, U extends unknown[]>(
|
|
54
|
-
context: React.Context<ContextValue<T>>,
|
|
55
|
-
setter: Setter<T, U>
|
|
56
|
-
) {
|
|
57
|
-
const contextValue = useContext(context);
|
|
58
|
-
|
|
59
|
-
if (!contextValue) {
|
|
60
|
-
throw new Error('useContextValueSetter must be used within a Provider');
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
const setterRef = useRef(setter);
|
|
64
|
-
setterRef.current = setter;
|
|
65
|
-
|
|
66
|
-
const setterWrapper = useCallback((...args: U) => {
|
|
67
|
-
return setterRef.current(contextValue.setValue)(...args);
|
|
68
|
-
}, []);
|
|
69
|
-
|
|
70
|
-
return setterWrapper;
|
|
71
|
-
}
|
package/src/mutable/index.ts
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
export {
|
|
2
|
-
createContext,
|
|
3
|
-
useContextSelector,
|
|
4
|
-
useContextSetValue,
|
|
5
|
-
useCreateContextStore,
|
|
6
|
-
useContextValueSetter,
|
|
7
|
-
type ContextValue,
|
|
8
|
-
} from './context';
|
|
9
|
-
export {
|
|
10
|
-
useMutableState,
|
|
11
|
-
useMutableStateSelector,
|
|
12
|
-
type MutableState,
|
|
13
|
-
} from './state';
|
|
14
|
-
export * from './type';
|
package/src/mutable/state.ts
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { useState } from 'react';
|
|
2
|
-
|
|
3
|
-
import { MutableValue } from './type';
|
|
4
|
-
import { createMutableValue, useMutableValueSelector } from './utils';
|
|
5
|
-
|
|
6
|
-
export type MutableState<T> = MutableValue<T>;
|
|
7
|
-
export const createMutableState = createMutableValue;
|
|
8
|
-
export const useMutableStateSelector = useMutableValueSelector;
|
|
9
|
-
|
|
10
|
-
export function useMutableState<T>(initialValue: T, isArray?: boolean) {
|
|
11
|
-
const [state] = useState(() => createMutableState(initialValue, isArray));
|
|
12
|
-
return state;
|
|
13
|
-
}
|
package/src/mutable/type.ts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
type Listener<T> = (state: T) => void;
|
|
2
|
-
|
|
3
|
-
export interface MutableValue<T> {
|
|
4
|
-
value: { current: T };
|
|
5
|
-
setValue: (value: Partial<T> | ((state: T) => Partial<T>)) => void;
|
|
6
|
-
listeners: Set<Listener<T>>;
|
|
7
|
-
addListener: (listener: Listener<T>) => void;
|
|
8
|
-
removeListener: (listener: Listener<T>) => void;
|
|
9
|
-
}
|
package/src/mutable/utils.ts
DELETED
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
import { useEffect, useRef, useState } from 'react';
|
|
2
|
-
|
|
3
|
-
import { MutableValue } from './type';
|
|
4
|
-
|
|
5
|
-
export function createMutableValue<T>(
|
|
6
|
-
initialValue: T,
|
|
7
|
-
isArray?: boolean
|
|
8
|
-
): MutableValue<T> {
|
|
9
|
-
let storeValue = {
|
|
10
|
-
current: initialValue,
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
type StoreListener = (state: T) => void;
|
|
14
|
-
|
|
15
|
-
const listeners = new Set<StoreListener>();
|
|
16
|
-
|
|
17
|
-
return {
|
|
18
|
-
value: storeValue,
|
|
19
|
-
setValue: (value) => {
|
|
20
|
-
if (typeof value === 'function') {
|
|
21
|
-
if (isArray) {
|
|
22
|
-
storeValue.current = value(storeValue.current) as T;
|
|
23
|
-
} else {
|
|
24
|
-
storeValue.current = {
|
|
25
|
-
...storeValue.current,
|
|
26
|
-
...value(storeValue.current),
|
|
27
|
-
};
|
|
28
|
-
}
|
|
29
|
-
} else {
|
|
30
|
-
if (isArray) {
|
|
31
|
-
storeValue.current = value as T;
|
|
32
|
-
} else {
|
|
33
|
-
storeValue.current = { ...storeValue.current, ...value };
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
listeners.forEach((listener) => listener(storeValue.current));
|
|
38
|
-
},
|
|
39
|
-
listeners,
|
|
40
|
-
addListener: (listener) => listeners.add(listener),
|
|
41
|
-
removeListener: (listener) => listeners.delete(listener),
|
|
42
|
-
};
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
export function useMutableValueSelector<T, R>(
|
|
46
|
-
mutableValue: MutableValue<T>,
|
|
47
|
-
selector: (state: T) => R
|
|
48
|
-
) {
|
|
49
|
-
const selectorRef = useRef(selector);
|
|
50
|
-
selectorRef.current = selector;
|
|
51
|
-
|
|
52
|
-
const [value, setValue] = useState({
|
|
53
|
-
innerValue: selectorRef.current(mutableValue.value.current),
|
|
54
|
-
});
|
|
55
|
-
|
|
56
|
-
const valueRef = useRef(value);
|
|
57
|
-
valueRef.current = value;
|
|
58
|
-
|
|
59
|
-
useEffect(() => {
|
|
60
|
-
const listener = (state: T) => {
|
|
61
|
-
const newValue = selectorRef.current(state);
|
|
62
|
-
if (newValue !== valueRef.current.innerValue) {
|
|
63
|
-
setValue({
|
|
64
|
-
innerValue: newValue,
|
|
65
|
-
});
|
|
66
|
-
}
|
|
67
|
-
};
|
|
68
|
-
|
|
69
|
-
mutableValue.addListener(listener);
|
|
70
|
-
|
|
71
|
-
// Trigger value which update while adding listener
|
|
72
|
-
listener(mutableValue.value.current);
|
|
73
|
-
|
|
74
|
-
return () => {
|
|
75
|
-
mutableValue.removeListener(listener);
|
|
76
|
-
};
|
|
77
|
-
}, [mutableValue]);
|
|
78
|
-
|
|
79
|
-
return value.innerValue;
|
|
80
|
-
}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
PageEntiyForm,
|
|
3
|
-
PageType,
|
|
4
|
-
} from '@headless-adminapp/core/experience/app';
|
|
5
|
-
import { useCallback } from 'react';
|
|
6
|
-
|
|
7
|
-
import { useRouter } from '../../route/hooks/';
|
|
8
|
-
import { useRouteResolver } from '../../route/hooks/useRouteResolver';
|
|
9
|
-
|
|
10
|
-
export function useOpenForm() {
|
|
11
|
-
const routeResolver = useRouteResolver();
|
|
12
|
-
const router = useRouter();
|
|
13
|
-
|
|
14
|
-
return useCallback(
|
|
15
|
-
(
|
|
16
|
-
formOptions: Omit<PageEntiyForm, 'type'>,
|
|
17
|
-
navigationOptions: {
|
|
18
|
-
replace?: boolean;
|
|
19
|
-
}
|
|
20
|
-
) => {
|
|
21
|
-
const path = routeResolver({
|
|
22
|
-
type: PageType.EntityForm,
|
|
23
|
-
...formOptions,
|
|
24
|
-
});
|
|
25
|
-
|
|
26
|
-
if (navigationOptions.replace) {
|
|
27
|
-
router.replace(path);
|
|
28
|
-
} else {
|
|
29
|
-
router.push(path);
|
|
30
|
-
}
|
|
31
|
-
},
|
|
32
|
-
[routeResolver, router]
|
|
33
|
-
);
|
|
34
|
-
}
|
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
FC,
|
|
3
|
-
PropsWithChildren,
|
|
4
|
-
useCallback,
|
|
5
|
-
useMemo,
|
|
6
|
-
useRef,
|
|
7
|
-
useState,
|
|
8
|
-
} from 'react';
|
|
9
|
-
|
|
10
|
-
import { ProgressIndicatorContext } from './context';
|
|
11
|
-
|
|
12
|
-
export const ProgressIndicatorProvider: FC<PropsWithChildren> = ({
|
|
13
|
-
children,
|
|
14
|
-
}) => {
|
|
15
|
-
const [overlayVisible, setOverlayVisible] = useState(false);
|
|
16
|
-
const [visible, setVisible] = useState(false);
|
|
17
|
-
const [message, setMessage] = useState<string | undefined>(undefined);
|
|
18
|
-
|
|
19
|
-
const showTimeoutRef = useRef<NodeJS.Timeout>();
|
|
20
|
-
|
|
21
|
-
const showProgressIndicator = useCallback(
|
|
22
|
-
(message?: string, delay?: number) => {
|
|
23
|
-
setOverlayVisible(true);
|
|
24
|
-
setMessage(message);
|
|
25
|
-
|
|
26
|
-
if (delay) {
|
|
27
|
-
if (!showTimeoutRef.current) {
|
|
28
|
-
showTimeoutRef.current = setTimeout(() => {
|
|
29
|
-
setVisible(true);
|
|
30
|
-
showTimeoutRef.current = undefined;
|
|
31
|
-
}, delay);
|
|
32
|
-
}
|
|
33
|
-
} else {
|
|
34
|
-
if (showTimeoutRef.current) {
|
|
35
|
-
clearTimeout(showTimeoutRef.current);
|
|
36
|
-
showTimeoutRef.current = undefined;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
setVisible(true);
|
|
40
|
-
}
|
|
41
|
-
},
|
|
42
|
-
[]
|
|
43
|
-
);
|
|
44
|
-
|
|
45
|
-
const hideProgressIndicator = useCallback(() => {
|
|
46
|
-
setVisible(false);
|
|
47
|
-
setOverlayVisible(false);
|
|
48
|
-
|
|
49
|
-
if (showTimeoutRef.current) {
|
|
50
|
-
clearTimeout(showTimeoutRef.current);
|
|
51
|
-
showTimeoutRef.current = undefined;
|
|
52
|
-
}
|
|
53
|
-
}, []);
|
|
54
|
-
|
|
55
|
-
const contextValue = useMemo(
|
|
56
|
-
() => ({
|
|
57
|
-
overlayVisible,
|
|
58
|
-
visible,
|
|
59
|
-
message,
|
|
60
|
-
showProgressIndicator,
|
|
61
|
-
hideProgressIndicator,
|
|
62
|
-
}),
|
|
63
|
-
[
|
|
64
|
-
visible,
|
|
65
|
-
overlayVisible,
|
|
66
|
-
message,
|
|
67
|
-
showProgressIndicator,
|
|
68
|
-
hideProgressIndicator,
|
|
69
|
-
]
|
|
70
|
-
);
|
|
71
|
-
|
|
72
|
-
return (
|
|
73
|
-
<ProgressIndicatorContext.Provider value={contextValue}>
|
|
74
|
-
{children}
|
|
75
|
-
</ProgressIndicatorContext.Provider>
|
|
76
|
-
);
|
|
77
|
-
};
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { createContext } from 'react';
|
|
2
|
-
|
|
3
|
-
export interface ProgressIndicatorContextState {
|
|
4
|
-
overlayVisible: boolean;
|
|
5
|
-
visible: boolean;
|
|
6
|
-
message?: string;
|
|
7
|
-
showProgressIndicator: (message?: string, delay?: number) => void;
|
|
8
|
-
hideProgressIndicator: () => void;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
export const ProgressIndicatorContext =
|
|
12
|
-
createContext<ProgressIndicatorContextState>(null as any);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './useProgressIndicator';
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { useContext } from 'react';
|
|
2
|
-
|
|
3
|
-
import { ProgressIndicatorContext } from '../context';
|
|
4
|
-
|
|
5
|
-
export function useProgressIndicator() {
|
|
6
|
-
const context = useContext(ProgressIndicatorContext);
|
|
7
|
-
|
|
8
|
-
if (!context) {
|
|
9
|
-
throw new Error(
|
|
10
|
-
'useProgressIndicator must be used within a ProgressIndicatorProvider'
|
|
11
|
-
);
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
return context;
|
|
15
|
-
}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
EntityMainFormCommandItemExperience,
|
|
3
|
-
Form,
|
|
4
|
-
} from '@headless-adminapp/core/experience/form';
|
|
5
|
-
import { Schema, SchemaAttributes } from '@headless-adminapp/core/schema';
|
|
6
|
-
import { PropsWithChildren } from 'react';
|
|
7
|
-
|
|
8
|
-
import { DataFormProvider } from '../../dataform/DataFormProvider';
|
|
9
|
-
|
|
10
|
-
interface PageEntityFormProviderProps<S extends SchemaAttributes> {
|
|
11
|
-
schema: Schema<S>;
|
|
12
|
-
form: Form<S>;
|
|
13
|
-
recordId?: string;
|
|
14
|
-
commands: EntityMainFormCommandItemExperience[][];
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
export function PageEntityFormProvider<S extends SchemaAttributes>({
|
|
18
|
-
schema,
|
|
19
|
-
form,
|
|
20
|
-
recordId,
|
|
21
|
-
children,
|
|
22
|
-
commands,
|
|
23
|
-
}: PropsWithChildren<PageEntityFormProviderProps<S>>) {
|
|
24
|
-
return (
|
|
25
|
-
<DataFormProvider
|
|
26
|
-
schema={schema}
|
|
27
|
-
form={form}
|
|
28
|
-
recordId={recordId}
|
|
29
|
-
commands={commands}
|
|
30
|
-
>
|
|
31
|
-
{children}
|
|
32
|
-
</DataFormProvider>
|
|
33
|
-
);
|
|
34
|
-
}
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import { LocalizedDataLookup } from '@headless-adminapp/core/attributes';
|
|
2
|
-
import {
|
|
3
|
-
EntityMainGridCommandItemExperience,
|
|
4
|
-
View,
|
|
5
|
-
} from '@headless-adminapp/core/experience/view';
|
|
6
|
-
import { Schema, SchemaAttributes } from '@headless-adminapp/core/schema';
|
|
7
|
-
import { PropsWithChildren } from 'react';
|
|
8
|
-
|
|
9
|
-
import { DataGridProvider } from '../../datagrid/DataGridProvider';
|
|
10
|
-
|
|
11
|
-
interface PageEntityViewProviderProps<S extends SchemaAttributes> {
|
|
12
|
-
schema: Schema<S>;
|
|
13
|
-
view: View<S>;
|
|
14
|
-
commands: EntityMainGridCommandItemExperience[][];
|
|
15
|
-
availableViews: LocalizedDataLookup[];
|
|
16
|
-
onChangeView: (viewId: string) => void;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
export function PageEntityViewProvider<S extends SchemaAttributes>({
|
|
20
|
-
availableViews,
|
|
21
|
-
commands,
|
|
22
|
-
schema,
|
|
23
|
-
view,
|
|
24
|
-
children,
|
|
25
|
-
onChangeView,
|
|
26
|
-
}: PropsWithChildren<PageEntityViewProviderProps<S>>) {
|
|
27
|
-
return (
|
|
28
|
-
<DataGridProvider
|
|
29
|
-
schema={schema}
|
|
30
|
-
view={view}
|
|
31
|
-
views={availableViews}
|
|
32
|
-
onChangeView={onChangeView}
|
|
33
|
-
commands={commands}
|
|
34
|
-
allowViewSelection
|
|
35
|
-
>
|
|
36
|
-
{children}
|
|
37
|
-
</DataGridProvider>
|
|
38
|
-
);
|
|
39
|
-
}
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import { FC, PropsWithChildren, useEffect } from 'react';
|
|
2
|
-
|
|
3
|
-
import { useMetadata } from '../metadata/hooks/useMetadata';
|
|
4
|
-
import {
|
|
5
|
-
useContextSelector,
|
|
6
|
-
useContextSetValue,
|
|
7
|
-
useCreateContextStore,
|
|
8
|
-
} from '../mutable/context';
|
|
9
|
-
import { RecordSetContext, RecordSetContextState } from './context';
|
|
10
|
-
|
|
11
|
-
export const RecordSetProvider: FC<PropsWithChildren> = ({ children }) => {
|
|
12
|
-
const contextValue = useCreateContextStore<RecordSetContextState>({
|
|
13
|
-
logicalName: '',
|
|
14
|
-
ids: [],
|
|
15
|
-
cardView: null,
|
|
16
|
-
visibleNavigator: false,
|
|
17
|
-
});
|
|
18
|
-
|
|
19
|
-
return (
|
|
20
|
-
<RecordSetContext.Provider value={contextValue}>
|
|
21
|
-
<CardViewSetter />
|
|
22
|
-
{children}
|
|
23
|
-
</RecordSetContext.Provider>
|
|
24
|
-
);
|
|
25
|
-
};
|
|
26
|
-
|
|
27
|
-
const CardViewSetter: FC = () => {
|
|
28
|
-
const { experienceStore } = useMetadata();
|
|
29
|
-
const setValue = useContextSetValue(RecordSetContext);
|
|
30
|
-
const logicalName = useContextSelector(
|
|
31
|
-
RecordSetContext,
|
|
32
|
-
(state) => state.logicalName
|
|
33
|
-
);
|
|
34
|
-
|
|
35
|
-
useEffect(() => {
|
|
36
|
-
setValue({
|
|
37
|
-
cardView: null,
|
|
38
|
-
});
|
|
39
|
-
|
|
40
|
-
if (!logicalName) {
|
|
41
|
-
return;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
experienceStore
|
|
45
|
-
.getViewLookupV2(logicalName)
|
|
46
|
-
.then((view) => {
|
|
47
|
-
setValue({
|
|
48
|
-
cardView: view.experience.card,
|
|
49
|
-
});
|
|
50
|
-
})
|
|
51
|
-
.catch(console.error);
|
|
52
|
-
}, [experienceStore, logicalName]);
|
|
53
|
-
|
|
54
|
-
return null;
|
|
55
|
-
};
|
package/src/recordset/context.ts
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { CardView } from '@headless-adminapp/core/experience/view';
|
|
2
|
-
|
|
3
|
-
import { createContext } from '../mutable/context';
|
|
4
|
-
|
|
5
|
-
export interface RecordSetContextState {
|
|
6
|
-
logicalName: string;
|
|
7
|
-
ids: (string | number)[];
|
|
8
|
-
cardView: CardView | null;
|
|
9
|
-
visibleNavigator: boolean;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
export const RecordSetContext = createContext<RecordSetContextState>();
|