@headless-adminapp/app 1.4.49 → 1.5.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.
Files changed (170) hide show
  1. package/app/AppProvider.d.ts +1 -1
  2. package/app/AuthWrapper.d.ts +2 -2
  3. package/app/LayoutProvider.d.ts +7 -7
  4. package/app/context.d.ts +2 -2
  5. package/app/hooks/useAppContext.d.ts +1 -1
  6. package/auth/AuthProvider.d.ts +2 -2
  7. package/auth/context.d.ts +1 -1
  8. package/auth/hooks/useAuthSession.d.ts +1 -1
  9. package/auth/index.d.ts +1 -1
  10. package/auth/index.js +0 -1
  11. package/auth/types.d.ts +1 -1
  12. package/board/BoardColumnProvider.d.ts +2 -2
  13. package/board/context.d.ts +1 -1
  14. package/board/hooks/useBoardColumnConfig.d.ts +1 -1
  15. package/board/hooks/useBoardColumnData.d.ts +2 -2
  16. package/board/hooks/useBoardConfig.d.ts +2 -2
  17. package/board/hooks/useBoardSchema.d.ts +1 -1
  18. package/board/types.d.ts +7 -7
  19. package/board/utils.d.ts +2 -2
  20. package/builders/CommandBuilder/DefaultCommandBuilder.d.ts +4 -4
  21. package/builders/CommandBuilder/FormCommandBuilder.d.ts +3 -3
  22. package/builders/CommandBuilder/SubgridCommandBuilder.d.ts +3 -3
  23. package/builders/CommandBuilder/ViewCommandBuilder.d.ts +3 -3
  24. package/builders/CommandBuilder/ViewCommandBuilder.js +7 -3
  25. package/builders/CommandBuilder/utils.d.ts +1 -1
  26. package/builders/SchemaExperienceBuilder.d.ts +4 -4
  27. package/builders/utils.d.ts +6 -6
  28. package/builders/utils.js +5 -1
  29. package/calendar/CalendarProvider.d.ts +3 -3
  30. package/calendar/context.d.ts +1 -1
  31. package/calendar/hooks/useConfig.d.ts +2 -2
  32. package/calendar/hooks/useOpenDetailDialog.d.ts +1 -1
  33. package/calendar/types.d.ts +5 -5
  34. package/calendar/utils.d.ts +2 -2
  35. package/command/hooks/useBaseCommandHandlerContext.d.ts +2 -2
  36. package/command/hooks/useBaseCommandHandlerContext.js +10 -2
  37. package/command/hooks/useCommands.d.ts +2 -2
  38. package/command/index.d.ts +1 -1
  39. package/command/index.js +0 -1
  40. package/command/types.d.ts +5 -5
  41. package/command/utils/index.d.ts +2 -2
  42. package/components/ScrollView/index.d.ts +1 -1
  43. package/components/ScrollbarWithMoreDataRequest/index.d.ts +1 -1
  44. package/dataform/DataFormProvider/CalculatedField.d.ts +1 -1
  45. package/dataform/DataFormProvider/CalculatedField.js +1 -0
  46. package/dataform/DataFormProvider/DataResolver.d.ts +2 -2
  47. package/dataform/DataFormProvider/DataResolver.js +1 -0
  48. package/dataform/DataFormProvider/UnsavedChangesInfoSetter.d.ts +1 -1
  49. package/dataform/DataFormProvider/getRecord.d.ts +5 -5
  50. package/dataform/DataFormProvider/getRecord.js +1 -0
  51. package/dataform/DataFormProvider/index.d.ts +5 -5
  52. package/dataform/DataFormProvider/index.js +1 -0
  53. package/dataform/DataFormProvider/types.d.ts +4 -4
  54. package/dataform/DataFormProvider/utils.d.ts +6 -6
  55. package/dataform/FormManager.d.ts +7 -7
  56. package/dataform/context.d.ts +8 -8
  57. package/dataform/hooks/useFormNotifications.d.ts +5 -3
  58. package/dataform/hooks/useFormNotifications.js +5 -8
  59. package/dataform/hooks/useFormSave.d.ts +1 -1
  60. package/dataform/hooks/useFormSchema.d.ts +1 -1
  61. package/dataform/hooks/useLoadFormGridPage.d.ts +2 -2
  62. package/dataform/hooks/useMainFormCommands.d.ts +2 -2
  63. package/dataform/hooks/useMainFormCommands.js +2 -1
  64. package/dataform/hooks/useOnFieldValueChangeListener.js +3 -1
  65. package/dataform/hooks/useProcessFlowSteps.js +3 -1
  66. package/dataform/hooks/useSelectedForm.d.ts +2 -2
  67. package/dataform/utils/defaultParameters.d.ts +3 -3
  68. package/dataform/utils/defaultParameters.js +4 -1
  69. package/dataform/utils/index.d.ts +7 -7
  70. package/dataform/utils/index.js +31 -8
  71. package/dataform/utils/saveRecord.d.ts +6 -6
  72. package/dataform/utils/saveRecord.js +11 -2
  73. package/datagrid/DataGridProvider/DataResolver.d.ts +1 -1
  74. package/datagrid/DataGridProvider/index.d.ts +6 -6
  75. package/datagrid/DataGridProvider/transformViewColumns.d.ts +4 -4
  76. package/datagrid/DataGridProvider/useGridCellRangeResolver.d.ts +4 -4
  77. package/datagrid/DataGridProvider/utils.d.ts +5 -5
  78. package/datagrid/DataGridProvider/utils.js +3 -0
  79. package/datagrid/column-filter/constants.d.ts +1 -1
  80. package/datagrid/column-filter/utils.d.ts +1 -1
  81. package/datagrid/context.d.ts +5 -5
  82. package/datagrid/hooks/useGridColumnFilter.d.ts +1 -1
  83. package/datagrid/hooks/useGridColumns.d.ts +2 -2
  84. package/datagrid/hooks/useGridCommands.d.ts +2 -2
  85. package/datagrid/hooks/useGridOptions.js +1 -0
  86. package/datagrid/hooks/useGridPagination.js +1 -0
  87. package/datagrid/hooks/useGridSchema.d.ts +1 -1
  88. package/datagrid/hooks/useGridSorting.d.ts +2 -2
  89. package/datagrid/hooks/useGridSorting.js +1 -0
  90. package/datagrid/hooks/useLoadMainGridPage.d.ts +3 -3
  91. package/datagrid/hooks/useMainGridCommands.d.ts +2 -2
  92. package/datagrid/hooks/useMainGridCommands.js +2 -0
  93. package/datagrid/hooks/useSelectedView.d.ts +2 -2
  94. package/datagrid/hooks/useSubGridCommands.d.ts +2 -2
  95. package/dialog/DialogProvider.d.ts +1 -1
  96. package/dialog/context.d.ts +1 -1
  97. package/dialog/hooks/useOpenAlertDialog.d.ts +1 -1
  98. package/dialog/hooks/useOpenConfirmDialog.d.ts +1 -1
  99. package/dialog/hooks/useOpenDialog.d.ts +1 -1
  100. package/dialog/hooks/useOpenErrorDialog.d.ts +1 -1
  101. package/dialog/hooks/useOpenPromptDialog.d.ts +2 -2
  102. package/header/HeaderProvider.d.ts +1 -1
  103. package/header/components/MobileHeaderLeftContent.d.ts +1 -1
  104. package/header/components/MobileHeaderRightContent.d.ts +1 -1
  105. package/header/components/MobileHeaderTitle.d.ts +1 -1
  106. package/header/hooks/useHeaderValue.d.ts +1 -1
  107. package/header/hooks/useMobileHeaderSetValue.d.ts +1 -1
  108. package/historystate/provider.d.ts +1 -1
  109. package/hooks/useDebouncedValue.js +5 -2
  110. package/hooks/useElementLayout.d.ts +2 -2
  111. package/hooks/useItemsWithKey.d.ts +1 -1
  112. package/hooks/useLongPress.js +4 -2
  113. package/hooks/useStorageState.d.ts +1 -1
  114. package/insights/context.d.ts +1 -1
  115. package/insights/hooks/index.d.ts +2 -2
  116. package/insights/hooks/index.js +1 -0
  117. package/locale/LocaleProvider.d.ts +2 -2
  118. package/locale/context.d.ts +1 -1
  119. package/locale/utils.d.ts +1 -1
  120. package/metadata/MetadataProvider.d.ts +5 -5
  121. package/metadata/context.d.ts +2 -2
  122. package/metadata/hooks/useExperienceView.d.ts +1 -1
  123. package/metadata/hooks/useExperienceView.js +3 -1
  124. package/metadata/hooks/useMetadata.d.ts +1 -1
  125. package/metadata/hooks/useRecentItemStore.d.ts +1 -1
  126. package/metadata/hooks/useSchema.d.ts +1 -1
  127. package/mutable/context.d.ts +1 -1
  128. package/mutable/context.js +1 -0
  129. package/mutable/index.d.ts +1 -1
  130. package/mutable/index.js +0 -15
  131. package/mutable/state.d.ts +1 -1
  132. package/mutable/utils.d.ts +1 -1
  133. package/mutable/utils.js +1 -1
  134. package/navigation/hooks/useOpenForm.d.ts +1 -1
  135. package/navigation/unsaved-changes/useUnsavedChangesRouteGuard.js +1 -0
  136. package/package.json +3 -3
  137. package/progress-indicator/ProgressIndicatorProvider.d.ts +1 -1
  138. package/progress-indicator/ProgressIndicatorProvider.js +1 -1
  139. package/progress-indicator/context.js +3 -1
  140. package/providers/PageEntityFormProvider/index.d.ts +5 -5
  141. package/providers/PageEntityViewProvider/index.d.ts +4 -4
  142. package/quickcreate/QuickCreateProvider.d.ts +1 -1
  143. package/quickcreate/context.d.ts +2 -2
  144. package/quickcreate/hooks/useFormSave.d.ts +1 -1
  145. package/quickcreate/hooks/useOpenQuickCreate.d.ts +2 -2
  146. package/recordset/RecordSetProvider.d.ts +1 -1
  147. package/recordset/RecordSetProvider.js +1 -1
  148. package/recordset/context.d.ts +1 -1
  149. package/recordset/hooks/useRecordSetResult.d.ts +1 -1
  150. package/route/RouteProvider.d.ts +4 -4
  151. package/route/context.d.ts +3 -3
  152. package/route/context.js +8 -2
  153. package/store/ComponentStore.d.ts +1 -1
  154. package/store/EventManager.d.ts +1 -1
  155. package/store/EventManager.js +1 -0
  156. package/store/RecentItemStore.d.ts +1 -1
  157. package/store/SchemaExperienceStore.d.ts +6 -6
  158. package/store/SchemaExperienceStore.js +2 -2
  159. package/toast-notification/ToastNotificationProvider.d.ts +1 -1
  160. package/toast-notification/hooks/useOpenToastNotification.d.ts +1 -1
  161. package/transport/InMemoryDataService/index.d.ts +3 -3
  162. package/transport/InMemoryDataService/index.js +5 -0
  163. package/transport/RestDataService/index.d.ts +2 -2
  164. package/transport/context.d.ts +1 -1
  165. package/transport/hooks/useCustomActionQuery.d.ts +2 -1
  166. package/transport/hooks/useDataService.d.ts +1 -1
  167. package/transport/hooks/useRetriveRecords.d.ts +6 -16
  168. package/transport/hooks/useRetriveRecords.js +2 -1
  169. package/utils/getAttributeFormattedValue.d.ts +3 -3
  170. package/utils/getAttributeFormattedValue.js +20 -3
@@ -1,4 +1,4 @@
1
- import { BasicDialogProps, DialogOptions } from '@headless-adminapp/core/experience/dialog';
1
+ import type { BasicDialogProps, DialogOptions } from '@headless-adminapp/core/experience/dialog';
2
2
  export type DialogItemState = BasicDialogProps & DialogOptions;
3
3
  export interface DialogContextState {
4
4
  items: DialogItemState[];
@@ -1,2 +1,2 @@
1
- import { AlertDialogOptions } from '@headless-adminapp/core/experience/dialog';
1
+ import type { AlertDialogOptions } from '@headless-adminapp/core/experience/dialog';
2
2
  export declare function useOpenAlertDialog(): (options: Omit<AlertDialogOptions, "type" | "onConfirm" | "onClose">) => Promise<void>;
@@ -1,4 +1,4 @@
1
- import { ConfirmDialogOptions, ConfirmResult } from '@headless-adminapp/core/experience/dialog';
1
+ import type { ConfirmDialogOptions, ConfirmResult } from '@headless-adminapp/core/experience/dialog';
2
2
  /**
3
3
  * @zero-deps
4
4
  */
@@ -1,4 +1,4 @@
1
- import { DialogOptions } from '@headless-adminapp/core/experience/dialog';
1
+ import type { DialogOptions } from '@headless-adminapp/core/experience/dialog';
2
2
  /**
3
3
  * @zero-deps
4
4
  */
@@ -1,2 +1,2 @@
1
- import { AlertDialogOptions } from '@headless-adminapp/core/experience/dialog';
1
+ import type { AlertDialogOptions } from '@headless-adminapp/core/experience/dialog';
2
2
  export declare function useOpenErrorDialog(): (options: Omit<AlertDialogOptions, "type" | "onConfirm" | "onClose">) => void;
@@ -1,3 +1,3 @@
1
- import { PromptDialogOptions } from '@headless-adminapp/core/experience/dialog';
2
- import { InferredSchemaType, SchemaAttributes } from '@headless-adminapp/core/schema';
1
+ import type { PromptDialogOptions } from '@headless-adminapp/core/experience/dialog';
2
+ import type { InferredSchemaType, SchemaAttributes } from '@headless-adminapp/core/schema';
3
3
  export declare function useOpenPromptDialog(): <SA extends SchemaAttributes = SchemaAttributes>(options: Omit<PromptDialogOptions<SA>, "type" | "onConfirm" | "onClose" | "onCancel">) => Promise<InferredSchemaType<SA> | null>;
@@ -1,2 +1,2 @@
1
- import { FC, PropsWithChildren } from 'react';
1
+ import type { FC, PropsWithChildren } from 'react';
2
2
  export declare const HeaderProvider: FC<PropsWithChildren<{}>>;
@@ -1,4 +1,4 @@
1
- import { FC } from 'react';
1
+ import type { FC } from 'react';
2
2
  interface MobileHeaderLeftContentProps {
3
3
  type: 'menu' | 'back';
4
4
  order?: number;
@@ -1,4 +1,4 @@
1
- import { FC, PropsWithChildren } from 'react';
1
+ import type { FC, PropsWithChildren } from 'react';
2
2
  interface MobileHeaderLeftContentProps {
3
3
  order?: number;
4
4
  }
@@ -1,4 +1,4 @@
1
- import { FC } from 'react';
1
+ import type { FC } from 'react';
2
2
  interface MobileHeaderTitleProps {
3
3
  title: React.ReactNode;
4
4
  order?: number;
@@ -1,2 +1,2 @@
1
- import { HeaderStoreState } from '../context';
1
+ import { type HeaderStoreState } from '../context';
2
2
  export declare function useHeaderValue<T>(field: keyof HeaderStoreState): T | null;
@@ -1,2 +1,2 @@
1
- import { HeaderStoreState } from '../context';
1
+ import { type HeaderStoreState } from '../context';
2
2
  export declare function useMobileHeaderSetValue<T>(value: T, order: number, field: keyof HeaderStoreState): void;
@@ -1,4 +1,4 @@
1
- import { FC, PropsWithChildren } from 'react';
1
+ import type { FC, PropsWithChildren } from 'react';
2
2
  type HistoryStateKeyProviderProps = {
3
3
  historyKey: string;
4
4
  nested?: boolean;
@@ -2,12 +2,15 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.useDebouncedValue = useDebouncedValue;
4
4
  const react_1 = require("react");
5
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
5
6
  function useDebouncedValue(value, wait, options = { leading: false }) {
6
7
  const [internalValue, setInternalValue] = (0, react_1.useState)(value);
7
8
  const mountedRef = (0, react_1.useRef)(false);
8
- const timeoutRef = (0, react_1.useRef)();
9
+ const timeoutRef = (0, react_1.useRef)(null);
9
10
  const cooldownRef = (0, react_1.useRef)(false);
10
- const cancel = () => window.clearTimeout(timeoutRef.current);
11
+ const cancel = () => {
12
+ timeoutRef.current && window.clearTimeout(timeoutRef.current);
13
+ };
11
14
  (0, react_1.useEffect)(() => {
12
15
  if (mountedRef.current) {
13
16
  if (!cooldownRef.current && options.leading) {
@@ -1,4 +1,4 @@
1
- import { RefObject } from 'react';
1
+ import { type RefObject } from 'react';
2
2
  interface ElementLayout {
3
3
  width: number;
4
4
  height: number;
@@ -7,5 +7,5 @@ interface ElementLayout {
7
7
  right: number;
8
8
  bottom: number;
9
9
  }
10
- export declare function useElementSize(elementRef: RefObject<HTMLElement>, interval?: number): ElementLayout;
10
+ export declare function useElementSize(elementRef: RefObject<HTMLElement | null>, interval?: number): ElementLayout;
11
11
  export {};
@@ -1,4 +1,4 @@
1
- import { ItemWithKey } from '@headless-adminapp/core/types';
1
+ import type { ItemWithKey } from '@headless-adminapp/core/types';
2
2
  export declare function useItemsWithKey<T>(value: T[]): ItemWithKey<T>[];
3
3
  export declare function useItemsWithKey(value: null): null;
4
4
  export declare function useItemsWithKey(value: undefined): undefined;
@@ -14,8 +14,8 @@ const preventDefault = (ev) => {
14
14
  }
15
15
  };
16
16
  const useLongPress = (callback, { isPreventDefault = true, delay = 300 } = {}) => {
17
- const timeout = (0, react_1.useRef)();
18
- const target = (0, react_1.useRef)();
17
+ const timeout = (0, react_1.useRef)(null);
18
+ const target = (0, react_1.useRef)(null);
19
19
  const start = (0, react_1.useCallback)((event) => {
20
20
  // prevent ghost click on mobile devices
21
21
  if (isPreventDefault && event.target) {
@@ -38,7 +38,9 @@ const useLongPress = (callback, { isPreventDefault = true, delay = 300 } = {}) =
38
38
  };
39
39
  }, [clear]);
40
40
  return {
41
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
41
42
  onMouseDown: (e) => start(e),
43
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
42
44
  onTouchStart: (e) => start(e),
43
45
  onMouseUp: clear,
44
46
  onMouseLeave: clear,
@@ -1,2 +1,2 @@
1
- import { Dispatch, SetStateAction } from 'react';
1
+ import { type Dispatch, type SetStateAction } from 'react';
2
2
  export declare function useStorageState<S = undefined>(initialState: S, key: string, store?: Storage): [S, Dispatch<SetStateAction<S>>];
@@ -1,2 +1,2 @@
1
- import { InsightsState } from '@headless-adminapp/core/experience/insights';
1
+ import type { InsightsState } from '@headless-adminapp/core/experience/insights';
2
2
  export declare const InsightsContext: import("react").Context<import("../mutable/context").ContextValue<InsightsState<import("@headless-adminapp/core/schema").SchemaAttributes>>>;
@@ -1,5 +1,5 @@
1
- import { InsightConfig, InsightsState } from '@headless-adminapp/core/experience/insights';
2
- import { InferredSchemaType, SchemaAttributes } from '@headless-adminapp/core/schema';
1
+ import type { InsightConfig, InsightsState } from '@headless-adminapp/core/experience/insights';
2
+ import type { InferredSchemaType, SchemaAttributes } from '@headless-adminapp/core/schema';
3
3
  export declare function useInsightsState<S extends SchemaAttributes = SchemaAttributes>(): InsightsState<S>;
4
4
  export declare function useInsightConfig<S extends SchemaAttributes = SchemaAttributes>(): InsightConfig<S>;
5
5
  export declare function useInsightFilterValues<S extends SchemaAttributes = SchemaAttributes>(): InferredSchemaType<S>;
@@ -16,6 +16,7 @@ function useInsightConfig() {
16
16
  function useInsightFilterValues() {
17
17
  return (0, mutable_1.useContextSelector)(context_1.InsightsContext, (state) => state.filterValues);
18
18
  }
19
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
19
20
  function useRefreshEventListener(callback) {
20
21
  const eventManager = (0, mutable_1.useContextSelector)(context_1.InsightsContext, (state) => state.eventManager);
21
22
  const callbackRef = (0, react_1.useRef)(callback);
@@ -1,5 +1,5 @@
1
- import { Locale } from '@headless-adminapp/core/experience/locale';
2
- import { FC, PropsWithChildren } from 'react';
1
+ import { type Locale } from '@headless-adminapp/core/experience/locale';
2
+ import { type FC, type PropsWithChildren } from 'react';
3
3
  export interface LocaleProviderProps {
4
4
  locale?: string;
5
5
  timezone?: string;
@@ -1,2 +1,2 @@
1
- import { Locale } from '@headless-adminapp/core/experience/locale';
1
+ import type { Locale } from '@headless-adminapp/core/experience/locale';
2
2
  export declare const LocaleContext: import("react").Context<Locale | null>;
package/locale/utils.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { Localized } from '@headless-adminapp/core/types';
1
+ import type { Localized } from '@headless-adminapp/core/types';
2
2
  export declare function localizedLabel<T extends {
3
3
  label: string;
4
4
  localizedLabels?: Localized<string>;
@@ -1,8 +1,8 @@
1
- import { AppExperience } from '@headless-adminapp/core/experience/app';
2
- import { ISchemaExperienceStore, ISchemaStore, SchemaStore } from '@headless-adminapp/core/store';
3
- import { ICalculatedAttributeStore } from '@headless-adminapp/core/store/ICalculatedAttributeStore';
4
- import { FC, PropsWithChildren } from 'react';
5
- import { IRecentItemStore, SchemaExperienceStore } from '../store';
1
+ import { type AppExperience } from '@headless-adminapp/core/experience/app';
2
+ import { type ISchemaExperienceStore, type ISchemaStore, SchemaStore } from '@headless-adminapp/core/store';
3
+ import type { ICalculatedAttributeStore } from '@headless-adminapp/core/store/ICalculatedAttributeStore';
4
+ import { type FC, type PropsWithChildren } from 'react';
5
+ import { type IRecentItemStore, SchemaExperienceStore } from '../store';
6
6
  export interface MetadataProviderProps {
7
7
  schemaStore?: ISchemaStore;
8
8
  experienceStore?: ISchemaExperienceStore;
@@ -1,7 +1,7 @@
1
1
  import type { AppExperience } from '@headless-adminapp/core/experience/app';
2
2
  import type { ISchemaExperienceStore, ISchemaStore } from '@headless-adminapp/core/store';
3
- import { ICalculatedAttributeStore } from '@headless-adminapp/core/store/ICalculatedAttributeStore';
4
- import { IRecentItemStore } from '../store';
3
+ import type { ICalculatedAttributeStore } from '@headless-adminapp/core/store/ICalculatedAttributeStore';
4
+ import type { IRecentItemStore } from '../store';
5
5
  export interface MetadataContextState {
6
6
  schemaStore: ISchemaStore;
7
7
  experienceStore: ISchemaExperienceStore;
@@ -1,4 +1,4 @@
1
- import { View, ViewExperience } from '@headless-adminapp/core/experience/view';
1
+ import type { View, ViewExperience } from '@headless-adminapp/core/experience/view';
2
2
  export declare function useExperienceView(logicalName: string, viewId?: string, associated?: boolean, viewIds?: string[], view?: ViewExperience<any>): {
3
3
  view: View<import("@headless-adminapp/core/schema").SchemaAttributes> | undefined;
4
4
  isLoadingView: boolean;
@@ -3,7 +3,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.useExperienceView = useExperienceView;
4
4
  const react_query_1 = require("@tanstack/react-query");
5
5
  const useExperienceStore_1 = require("./useExperienceStore");
6
- function useExperienceView(logicalName, viewId, associated, viewIds, view) {
6
+ function useExperienceView(logicalName, viewId, associated, viewIds,
7
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
8
+ view) {
7
9
  const experienceStore = (0, useExperienceStore_1.useExperienceStore)();
8
10
  const { data, isPending } = (0, react_query_1.useQuery)({
9
11
  queryKey: [
@@ -1,4 +1,4 @@
1
- import { IRecentItemStore } from '@headless-adminapp/app/store';
1
+ import type { IRecentItemStore } from '@headless-adminapp/app/store';
2
2
  import type { AppExperience } from '@headless-adminapp/core/experience/app';
3
3
  import type { Schema, SchemaAttributes } from '@headless-adminapp/core/schema';
4
4
  import type { ISchemaExperienceStore, ISchemaStore } from '@headless-adminapp/core/store';
@@ -1,2 +1,2 @@
1
- import { IRecentItemStore } from '../../store/RecentItemStore';
1
+ import type { IRecentItemStore } from '../../store/RecentItemStore';
2
2
  export declare function useRecentItemStore(): IRecentItemStore;
@@ -1,2 +1,2 @@
1
- import { SchemaAttributes } from '@headless-adminapp/core/schema';
1
+ import type { SchemaAttributes } from '@headless-adminapp/core/schema';
2
2
  export declare function useSchema<S extends SchemaAttributes = SchemaAttributes>(logicalName: string): import("@headless-adminapp/core/schema").Schema<S> | null;
@@ -1,4 +1,4 @@
1
- import { MutableValue } from './type';
1
+ import type { MutableValue } from './type';
2
2
  import { useMutableValueSelector } from './utils';
3
3
  export type ContextValue<T> = MutableValue<T>;
4
4
  export declare const useContextSelectorInternal: typeof useMutableValueSelector;
@@ -12,6 +12,7 @@ const utils_1 = require("./utils");
12
12
  const createContextValue = utils_1.createMutableValue;
13
13
  exports.useContextSelectorInternal = utils_1.useMutableValueSelector;
14
14
  function createContext() {
15
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
15
16
  const context = (0, react_1.createContext)(null);
16
17
  return context;
17
18
  }
@@ -1,3 +1,3 @@
1
1
  export { createContext, useContextSelector, useContextSetValue, useCreateContextStore, useContextValueSetter, type ContextValue, } from './context';
2
2
  export { useMutableState, useMutableStateSelector, type MutableState, } from './state';
3
- export * from './type';
3
+ export type * from './type';
package/mutable/index.js CHANGED
@@ -1,18 +1,4 @@
1
1
  "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
2
  Object.defineProperty(exports, "__esModule", { value: true });
17
3
  exports.useMutableStateSelector = exports.useMutableState = exports.useContextValueSetter = exports.useCreateContextStore = exports.useContextSetValue = exports.useContextSelector = exports.createContext = void 0;
18
4
  var context_1 = require("./context");
@@ -24,4 +10,3 @@ Object.defineProperty(exports, "useContextValueSetter", { enumerable: true, get:
24
10
  var state_1 = require("./state");
25
11
  Object.defineProperty(exports, "useMutableState", { enumerable: true, get: function () { return state_1.useMutableState; } });
26
12
  Object.defineProperty(exports, "useMutableStateSelector", { enumerable: true, get: function () { return state_1.useMutableStateSelector; } });
27
- __exportStar(require("./type"), exports);
@@ -1,4 +1,4 @@
1
- import { MutableValue } from './type';
1
+ import type { MutableValue } from './type';
2
2
  import { createMutableValue, useMutableValueSelector } from './utils';
3
3
  export type MutableState<T> = MutableValue<T>;
4
4
  export declare const createMutableState: typeof createMutableValue;
@@ -1,3 +1,3 @@
1
- import { MutableValue } from './type';
1
+ import type { MutableValue } from './type';
2
2
  export declare function createMutableValue<T>(initialValue: T | (() => T), isArray?: boolean): MutableValue<T>;
3
3
  export declare function useMutableValueSelector<T, R>(mutableValue: MutableValue<T>, selector: (state: T) => R): R;
package/mutable/utils.js CHANGED
@@ -4,7 +4,7 @@ exports.createMutableValue = createMutableValue;
4
4
  exports.useMutableValueSelector = useMutableValueSelector;
5
5
  const react_1 = require("react");
6
6
  function createMutableValue(initialValue, isArray) {
7
- let storeValue = {
7
+ const storeValue = {
8
8
  current: typeof initialValue === 'function'
9
9
  ? initialValue()
10
10
  : initialValue,
@@ -1,2 +1,2 @@
1
- import { OpenFormOptions } from '@headless-adminapp/core/experience/command';
1
+ import type { OpenFormOptions } from '@headless-adminapp/core/experience/command';
2
2
  export declare function useOpenForm(): (options: OpenFormOptions) => Promise<void>;
@@ -36,6 +36,7 @@ function useUnsavedChangesRouteGuard() {
36
36
  const unsavedChangesInfo = (0, unsavedChangesInfo_1.getUnsavedChangesInfo)();
37
37
  if (unsavedChangesInfo) {
38
38
  event.preventDefault();
39
+ // eslint-disable-next-line deprecation/deprecation
39
40
  event.returnValue = unsavedChangesInfo.message;
40
41
  }
41
42
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@headless-adminapp/app",
3
- "version": "1.4.49",
3
+ "version": "1.5.0",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",
@@ -31,12 +31,12 @@
31
31
  "exceljs": "^4.4.0",
32
32
  "json-to-csv-export": "^2.1.1",
33
33
  "libphonenumber-js": "1.11.20",
34
- "lodash": "^4.17.21",
34
+ "lodash": "^4.18.0",
35
35
  "react-custom-scrollbars-2": "^4.5.0",
36
36
  "react-hook-form": "7.52.2",
37
37
  "react-use": "17.6.0",
38
38
  "uuid": "11.0.3",
39
39
  "yup": "^1.4.0"
40
40
  },
41
- "gitHead": "bb4bc9454aebb0910a9e74be20c4342bb9b06afc"
41
+ "gitHead": "fb3bf47203b51c020b363e1cc4aa3aa20a98d538"
42
42
  }
@@ -1,2 +1,2 @@
1
- import { FC, PropsWithChildren } from 'react';
1
+ import { type FC, type PropsWithChildren } from 'react';
2
2
  export declare const ProgressIndicatorProvider: FC<PropsWithChildren>;
@@ -8,7 +8,7 @@ const ProgressIndicatorProvider = ({ children, }) => {
8
8
  const [overlayVisible, setOverlayVisible] = (0, react_1.useState)(false);
9
9
  const [visible, setVisible] = (0, react_1.useState)(false);
10
10
  const [message, setMessage] = (0, react_1.useState)(undefined);
11
- const showTimeoutRef = (0, react_1.useRef)();
11
+ const showTimeoutRef = (0, react_1.useRef)(undefined);
12
12
  const showProgressIndicator = (0, react_1.useCallback)((message, delay) => {
13
13
  setOverlayVisible(true);
14
14
  setMessage(message);
@@ -2,4 +2,6 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ProgressIndicatorContext = void 0;
4
4
  const react_1 = require("react");
5
- exports.ProgressIndicatorContext = (0, react_1.createContext)(null);
5
+ exports.ProgressIndicatorContext =
6
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
7
+ (0, react_1.createContext)(null);
@@ -1,8 +1,8 @@
1
- import { EntityMainFormCommandItemExperience, Form } from '@headless-adminapp/core/experience/form';
2
- import { Schema, SchemaAttributes } from '@headless-adminapp/core/schema';
3
- import { PropsWithChildren } from 'react';
4
- import { RetriveRecordFn } from '../../dataform/DataFormProvider/types';
5
- import { SaveRecordFn } from '../../dataform/utils/saveRecord';
1
+ import type { EntityMainFormCommandItemExperience, Form } from '@headless-adminapp/core/experience/form';
2
+ import type { Schema, SchemaAttributes } from '@headless-adminapp/core/schema';
3
+ import type { PropsWithChildren } from 'react';
4
+ import type { RetriveRecordFn } from '../../dataform/DataFormProvider/types';
5
+ import type { SaveRecordFn } from '../../dataform/utils/saveRecord';
6
6
  interface PageEntityFormProviderProps<S extends SchemaAttributes> {
7
7
  schema: Schema<S>;
8
8
  form: Form<S>;
@@ -1,7 +1,7 @@
1
- import { LocalizedDataLookup } from '@headless-adminapp/core/attributes';
2
- import { EntityMainGridCommandItemExperience, View } from '@headless-adminapp/core/experience/view';
3
- import { Schema, SchemaAttributes } from '@headless-adminapp/core/schema';
4
- import { PropsWithChildren } from 'react';
1
+ import type { LocalizedDataLookup } from '@headless-adminapp/core/attributes';
2
+ import type { EntityMainGridCommandItemExperience, View } from '@headless-adminapp/core/experience/view';
3
+ import type { Schema, SchemaAttributes } from '@headless-adminapp/core/schema';
4
+ import type { PropsWithChildren } from 'react';
5
5
  interface PageEntityViewProviderProps<S extends SchemaAttributes> {
6
6
  schema: Schema<S>;
7
7
  view: View<S>;
@@ -1,4 +1,4 @@
1
- import { FC, PropsWithChildren } from 'react';
1
+ import type { FC, PropsWithChildren } from 'react';
2
2
  interface QuickCreateProviderProps {
3
3
  }
4
4
  export declare const QuickCreateProvider: FC<PropsWithChildren<QuickCreateProviderProps>>;
@@ -1,5 +1,5 @@
1
- import { Id } from '@headless-adminapp/core';
2
- import { DataLookup } from '@headless-adminapp/core/attributes';
1
+ import type { Id } from '@headless-adminapp/core';
2
+ import type { DataLookup } from '@headless-adminapp/core/attributes';
3
3
  export interface QuickCreateOptions {
4
4
  logicalName: string;
5
5
  formId?: string;
@@ -1,2 +1,2 @@
1
- import { DataLookup, Id } from '@headless-adminapp/core/attributes';
1
+ import type { DataLookup, Id } from '@headless-adminapp/core/attributes';
2
2
  export declare function useFormSave(): () => Promise<DataLookup<Id> | null>;
@@ -1,3 +1,3 @@
1
- import { DataLookup, Id } from '@headless-adminapp/core/attributes';
2
- import { QuickCreateOptions } from '../context';
1
+ import type { DataLookup, Id } from '@headless-adminapp/core/attributes';
2
+ import { type QuickCreateOptions } from '../context';
3
3
  export declare function useOpenQuickCreate(): (options: Omit<QuickCreateOptions, "onCreate" | "onCancel">) => Promise<DataLookup<Id> | null>;
@@ -1,2 +1,2 @@
1
- import { FC, PropsWithChildren } from 'react';
1
+ import { type FC, type PropsWithChildren } from 'react';
2
2
  export declare const RecordSetProvider: FC<PropsWithChildren>;
@@ -16,7 +16,7 @@ const RecordSetProvider = ({ children }) => {
16
16
  visibleNavigator: router.getState('navigator')?.visible ?? false,
17
17
  }));
18
18
  (0, react_1.useEffect)(() => {
19
- function listener(state, prevState, changes) {
19
+ function listener(state, _prevState, changes) {
20
20
  if (['ids', 'logicalName', 'visibleNavigator'].some((key) => key in changes)) {
21
21
  router.setState('navigator', {
22
22
  logicalName: state.logicalName,
@@ -1,4 +1,4 @@
1
- import { CardView } from '@headless-adminapp/core/experience/view';
1
+ import type { CardView } from '@headless-adminapp/core/experience/view';
2
2
  export interface RecordSetContextState {
3
3
  logicalName: string;
4
4
  ids: (string | number)[];
@@ -1,4 +1,4 @@
1
- import { InferredSchemaType, SchemaAttributes } from '@headless-adminapp/core/schema';
1
+ import type { InferredSchemaType, SchemaAttributes } from '@headless-adminapp/core/schema';
2
2
  export declare function useRecordSetResult(): {
3
3
  isLoading: boolean;
4
4
  data: import("@headless-adminapp/core/transport").Data<InferredSchemaType<SchemaAttributes>>[] | undefined;
@@ -1,7 +1,7 @@
1
- import { IsRouteActive, RouteResolver } from '@headless-adminapp/core/experience/route';
2
- import { RouterInstance } from '@headless-adminapp/core/navigation';
3
- import { FC, PropsWithChildren } from 'react';
4
- import { ReadonlyURLSearchParams } from './types';
1
+ import { type IsRouteActive, type RouteResolver } from '@headless-adminapp/core/experience/route';
2
+ import type { RouterInstance } from '@headless-adminapp/core/navigation';
3
+ import { type FC, type PropsWithChildren } from 'react';
4
+ import type { ReadonlyURLSearchParams } from './types';
5
5
  export interface RouteProviderProps {
6
6
  router: RouterInstance;
7
7
  pathname: string;
@@ -1,6 +1,6 @@
1
- import { NavPageItem } from '@headless-adminapp/core/experience/app';
2
- import { RouterInstance } from '@headless-adminapp/core/navigation';
3
- import { ReadonlyURLSearchParams } from './types';
1
+ import type { NavPageItem } from '@headless-adminapp/core/experience/app';
2
+ import type { RouterInstance } from '@headless-adminapp/core/navigation';
3
+ import type { ReadonlyURLSearchParams } from './types';
4
4
  export type InternalRouteResolver = (item: NavPageItem) => string;
5
5
  export type InternalIsRouteActive = (path: string, item: NavPageItem) => boolean;
6
6
  export declare const RouterContext: import("react").Context<RouterInstance>;
package/route/context.js CHANGED
@@ -2,8 +2,14 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.RouteHelperContext = exports.RouterBasePathContext = exports.RouterSearchParamsContext = exports.RouterPathnameContext = exports.RouterContext = void 0;
4
4
  const react_1 = require("react");
5
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
5
6
  exports.RouterContext = (0, react_1.createContext)(null);
7
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
6
8
  exports.RouterPathnameContext = (0, react_1.createContext)(null);
7
- exports.RouterSearchParamsContext = (0, react_1.createContext)(null);
9
+ exports.RouterSearchParamsContext = (0, react_1.createContext)(
10
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
11
+ null);
8
12
  exports.RouterBasePathContext = (0, react_1.createContext)('');
9
- exports.RouteHelperContext = (0, react_1.createContext)(null);
13
+ exports.RouteHelperContext = (0, react_1.createContext)(
14
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
15
+ null);
@@ -1,4 +1,4 @@
1
- import { IComponentStore } from '@headless-adminapp/core/store';
1
+ import type { IComponentStore } from '@headless-adminapp/core/store';
2
2
  export declare class ComponentStore implements IComponentStore {
3
3
  private components;
4
4
  registerComponent<T>(name: string, component: T): void;
@@ -1,4 +1,4 @@
1
- import { IEventManager } from '@headless-adminapp/core/store';
1
+ import type { IEventManager } from '@headless-adminapp/core/store';
2
2
  export declare class EventManager implements IEventManager {
3
3
  private handlers;
4
4
  on<T>(key: string, handler: T): void;
@@ -18,6 +18,7 @@ class EventManager {
18
18
  delete this.handlers[key];
19
19
  }
20
20
  }
21
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
21
22
  emit(key, ...args) {
22
23
  const handlers = (this.handlers[key] ?? []);
23
24
  return handlers.map((handler) => handler(...args));
@@ -1,4 +1,4 @@
1
- import { Id } from '@headless-adminapp/core';
1
+ import type { Id } from '@headless-adminapp/core';
2
2
  export interface IRecentItemStore {
3
3
  getItems: <T = unknown>(cacheKey: string, limit?: number) => RecentItem<T>[];
4
4
  addItem: <T = unknown>(cacheKey: string, id: Id, value: T, limit?: number) => void;
@@ -1,9 +1,9 @@
1
- import { LocalizedDataLookup } from '@headless-adminapp/core/attributes';
2
- import { EntityMainFormCommandItemExperience, Form, QuickCreateForm } from '@headless-adminapp/core/experience/form';
3
- import { SchemaExperience, SchemaExperienceMetadata } from '@headless-adminapp/core/experience/schema';
4
- import { CardView, EntityMainGridCommandItemExperience, SubGridCommandItemExperience, View } from '@headless-adminapp/core/experience/view';
5
- import { Schema, SchemaAttributes, SchemaMetadata } from '@headless-adminapp/core/schema';
6
- import { ISchemaExperienceStore, ISchemaStore } from '@headless-adminapp/core/store';
1
+ import type { LocalizedDataLookup } from '@headless-adminapp/core/attributes';
2
+ import type { EntityMainFormCommandItemExperience, Form, QuickCreateForm } from '@headless-adminapp/core/experience/form';
3
+ import type { SchemaExperience, SchemaExperienceMetadata } from '@headless-adminapp/core/experience/schema';
4
+ import type { CardView, EntityMainGridCommandItemExperience, SubGridCommandItemExperience, View } from '@headless-adminapp/core/experience/view';
5
+ import type { Schema, SchemaAttributes, SchemaMetadata } from '@headless-adminapp/core/schema';
6
+ import type { ISchemaExperienceStore, ISchemaStore } from '@headless-adminapp/core/store';
7
7
  export declare function getDefaultCardView<S extends SchemaAttributes = SchemaAttributes>(schema: Schema<S>): CardView<S>;
8
8
  interface SchemaExperienceStoreOptions {
9
9
  schemaStore: ISchemaStore;
@@ -76,7 +76,7 @@ class SchemaExperienceStore {
76
76
  if (!validViewIds.includes(viewId)) {
77
77
  viewId = validViewIds[0];
78
78
  }
79
- let view = experience.views.find((v) => v.id === viewId);
79
+ const view = experience.views.find((v) => v.id === viewId);
80
80
  if (!view) {
81
81
  throw new Error(`View ${viewId} not found`);
82
82
  }
@@ -106,7 +106,7 @@ class SchemaExperienceStore {
106
106
  if (!validViewIds.includes(viewId)) {
107
107
  viewId = validViewIds[0];
108
108
  }
109
- let view = experience.associatedViews.find((v) => v.id === viewId);
109
+ const view = experience.associatedViews.find((v) => v.id === viewId);
110
110
  if (!view) {
111
111
  throw new Error(`View ${viewId} not found`);
112
112
  }
@@ -1,4 +1,4 @@
1
- import { FC, PropsWithChildren } from 'react';
1
+ import type { FC, PropsWithChildren } from 'react';
2
2
  interface ToastNotificationProviderProps {
3
3
  }
4
4
  export declare const ToastNotificationProvider: FC<PropsWithChildren<ToastNotificationProviderProps>>;