@wix/auto-patterns 1.29.0 → 1.31.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/dist/cjs/hooks/index.js +0 -7
- package/dist/cjs/hooks/index.js.map +1 -1
- package/dist/cjs/hooks/useActionsSDK.js +7 -2
- package/dist/cjs/hooks/useActionsSDK.js.map +1 -1
- package/dist/cjs/hooks/useAppContextSync.js +24 -0
- package/dist/cjs/hooks/useAppContextSync.js.map +1 -0
- package/dist/cjs/hooks/useGridFeatures.js +10 -2
- package/dist/cjs/hooks/useGridFeatures.js.map +1 -1
- package/dist/cjs/hooks/useTableFeatures.js +10 -2
- package/dist/cjs/hooks/useTableFeatures.js.map +1 -1
- package/dist/cjs/hooks/useTableGridSwitchFeatures.js +10 -2
- package/dist/cjs/hooks/useTableGridSwitchFeatures.js.map +1 -1
- package/dist/cjs/providers/AppContext.js +10 -8
- package/dist/cjs/providers/AppContext.js.map +1 -1
- package/dist/cjs/providers/AppContextData.js +40 -0
- package/dist/cjs/providers/AppContextData.js.map +1 -0
- package/dist/cjs/providers/ItemsContext.js +14 -11
- package/dist/cjs/providers/ItemsContext.js.map +1 -1
- package/dist/cjs/providers/index.js +7 -0
- package/dist/cjs/providers/index.js.map +1 -1
- package/dist/cjs/types/CollectionPageConfig.js.map +1 -1
- package/dist/cjs/types/EntityPageConfig.js.map +1 -1
- package/dist/cjs/types/actions/actionCell.js.map +1 -1
- package/dist/cjs/types/actions/base.js.map +1 -1
- package/dist/cjs/types/actions/bulkActions.js.map +1 -1
- package/dist/cjs/types/actions/collectionPageActions.js.map +1 -1
- package/dist/cjs/types/actions/entityPageActions.js.map +1 -1
- package/dist/cjs/types/fetchData.js.map +1 -1
- package/dist/cjs/types/types.js.map +1 -1
- package/dist/cjs/utils/actions/types.js.map +1 -1
- package/dist/docs/app_context.md +64 -0
- package/dist/docs/auto-patterns-guide.md +69 -0
- package/dist/docs/sdk_utilities.md +5 -0
- package/dist/esm/hooks/index.js +0 -1
- package/dist/esm/hooks/index.js.map +1 -1
- package/dist/esm/hooks/useActionsSDK.js +7 -2
- package/dist/esm/hooks/useActionsSDK.js.map +1 -1
- package/dist/esm/hooks/useAppContextSync.js +19 -0
- package/dist/esm/hooks/useAppContextSync.js.map +1 -0
- package/dist/esm/hooks/useGridFeatures.js +10 -2
- package/dist/esm/hooks/useGridFeatures.js.map +1 -1
- package/dist/esm/hooks/useTableFeatures.js +10 -2
- package/dist/esm/hooks/useTableFeatures.js.map +1 -1
- package/dist/esm/hooks/useTableGridSwitchFeatures.js +10 -2
- package/dist/esm/hooks/useTableGridSwitchFeatures.js.map +1 -1
- package/dist/esm/providers/AppContext.js +7 -5
- package/dist/esm/providers/AppContext.js.map +1 -1
- package/dist/esm/providers/AppContextData.js +26 -0
- package/dist/esm/providers/AppContextData.js.map +1 -0
- package/dist/esm/providers/ItemsContext.js +10 -7
- package/dist/esm/providers/ItemsContext.js.map +1 -1
- package/dist/esm/providers/index.js +1 -0
- package/dist/esm/providers/index.js.map +1 -1
- package/dist/esm/types/CollectionPageConfig.js.map +1 -1
- package/dist/esm/types/EntityPageConfig.js.map +1 -1
- package/dist/esm/types/actions/actionCell.js.map +1 -1
- package/dist/esm/types/actions/base.js.map +1 -1
- package/dist/esm/types/actions/bulkActions.js.map +1 -1
- package/dist/esm/types/actions/collectionPageActions.js.map +1 -1
- package/dist/esm/types/actions/entityPageActions.js.map +1 -1
- package/dist/esm/types/fetchData.js.map +1 -1
- package/dist/esm/types/types.js.map +1 -1
- package/dist/esm/utils/actions/types.js.map +1 -1
- package/dist/types/hooks/index.d.ts +0 -1
- package/dist/types/hooks/index.d.ts.map +1 -1
- package/dist/types/hooks/useActionsSDK.d.ts.map +1 -1
- package/dist/types/hooks/useAppContextSync.d.ts +2 -0
- package/dist/types/hooks/useAppContextSync.d.ts.map +1 -0
- package/dist/types/hooks/useEntityPageHeaderTexts.d.ts.map +1 -1
- package/dist/types/hooks/useGridFeatures.d.ts.map +1 -1
- package/dist/types/hooks/useTableFeatures.d.ts.map +1 -1
- package/dist/types/hooks/useTableGridSwitchFeatures.d.ts.map +1 -1
- package/dist/types/providers/AppContext.d.ts +2 -2
- package/dist/types/providers/AppContext.d.ts.map +1 -1
- package/dist/types/providers/AppContextData.d.ts +13 -0
- package/dist/types/providers/AppContextData.d.ts.map +1 -0
- package/dist/types/providers/ItemsContext.d.ts +6 -4
- package/dist/types/providers/ItemsContext.d.ts.map +1 -1
- package/dist/types/providers/index.d.ts +1 -0
- package/dist/types/providers/index.d.ts.map +1 -1
- package/dist/types/types/CollectionPageConfig.d.ts +315 -0
- package/dist/types/types/CollectionPageConfig.d.ts.map +1 -1
- package/dist/types/types/EntityPageConfig.d.ts +111 -0
- package/dist/types/types/EntityPageConfig.d.ts.map +1 -1
- package/dist/types/types/actions/actionCell.d.ts +41 -0
- package/dist/types/types/actions/actionCell.d.ts.map +1 -1
- package/dist/types/types/actions/base.d.ts +84 -0
- package/dist/types/types/actions/base.d.ts.map +1 -1
- package/dist/types/types/actions/bulkActions.d.ts +40 -0
- package/dist/types/types/actions/bulkActions.d.ts.map +1 -1
- package/dist/types/types/actions/collectionPageActions.d.ts +30 -0
- package/dist/types/types/actions/collectionPageActions.d.ts.map +1 -1
- package/dist/types/types/actions/entityPageActions.d.ts +25 -0
- package/dist/types/types/actions/entityPageActions.d.ts.map +1 -1
- package/dist/types/types/fetchData.d.ts +35 -0
- package/dist/types/types/fetchData.d.ts.map +1 -1
- package/dist/types/types/types.d.ts +107 -0
- package/dist/types/types/types.d.ts.map +1 -1
- package/dist/types/utils/actions/types.d.ts +1 -0
- package/dist/types/utils/actions/types.d.ts.map +1 -1
- package/package.json +12 -12
- package/dist/cjs/hooks/useUpdateAppContextItems.js +0 -18
- package/dist/cjs/hooks/useUpdateAppContextItems.js.map +0 -1
- package/dist/esm/hooks/useUpdateAppContextItems.js +0 -13
- package/dist/esm/hooks/useUpdateAppContextItems.js.map +0 -1
- package/dist/types/hooks/useUpdateAppContextItems.d.ts +0 -2
- package/dist/types/hooks/useUpdateAppContextItems.d.ts.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["../../../../src/types/actions/base.ts"],"sourcesContent":["export type DividerActionConfig = { type: 'divider' };\n\nexport type BaseActionItemConfig = {\n id: string;\n label?: string;\n skin?: string;\n biName?: string;\n};\n\nexport interface Feedback {\n successToast?: { text: string };\n errorToast?: { text: string };\n}\n\nexport interface BaseActionModal {\n title?: { text: string };\n actions?: {\n submit?: { text: string };\n cancel?: { text: string };\n };\n feedback?: Feedback;\n}\n\nexport interface ActionModalField {\n id: string;\n label?: string;\n}\n\nexport interface DeleteActionModal extends BaseActionModal {\n description?: { text: string };\n}\n\nexport interface BulkDeleteActionModal extends DeleteActionModal {}\n\nexport type BulkDeleteAction =\n | {\n mode: 'modal';\n modal: BulkDeleteActionModal;\n }\n | {\n mode: 'custom';\n modal?: never;\n };\n\nexport type DeleteAction = {\n mode: 'modal';\n modal: DeleteActionModal;\n};\n\nexport interface BaseActionPage {\n id: string;\n}\n\nexport interface ActionModalWithFields extends BaseActionModal {\n fields: ActionModalField[];\n}\n\nexport interface UpdateActionModal extends ActionModalWithFields {}\n\nexport interface CreateActionModal extends ActionModalWithFields {}\n\nexport interface UpdateActionPage extends BaseActionPage {}\n\nexport interface CreateActionPage extends BaseActionPage {}\n\nexport type UpdateAction = {\n mode: 'page';\n page: UpdateActionPage;\n};\n\nexport type CreateAction = {\n mode: 'page';\n page: CreateActionPage;\n};\n\nexport type CreateActionConfig = BaseActionItemConfig & {\n type: 'create';\n create: CreateAction;\n};\n\nexport type UpdateActionConfig = BaseActionItemConfig & {\n type: 'update';\n update: UpdateAction;\n};\n\nexport type DeleteActionConfig = BaseActionItemConfig & {\n type: 'delete';\n delete: DeleteAction;\n};\n\nexport type BulkDeleteActionConfig = BaseActionItemConfig & {\n type: 'bulkDelete';\n bulkDelete: BulkDeleteAction;\n};\n\nexport type CustomActionConfig = BaseActionItemConfig & {\n type: 'custom';\n};\n"],"mappings":"","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":[],"sources":["../../../../src/types/actions/base.ts"],"sourcesContent":["export type DividerActionConfig = { type: 'divider' };\n\nexport type BaseActionItemConfig = {\n /**\n * Unique identifier for the action.\n */\n id: string;\n /**\n * Display text for the action button/menu item.\n */\n label?: string;\n /**\n * Visual appearance of the action button (e.g., 'standard', 'destructive', 'primary').\n */\n skin?: string;\n /**\n * BI tracking name.\n */\n biName?: string;\n};\n\nexport interface Feedback {\n /**\n * Success message displayed in a toast notification.\n */\n successToast?: { text: string };\n /**\n * Error message displayed in a toast notification.\n */\n errorToast?: { text: string };\n}\n\nexport interface BaseActionModal {\n /**\n * Modal header title.\n */\n title?: { text: string };\n /**\n * Modal action buttons configuration.\n */\n actions?: {\n /**\n * Submit/confirm button text.\n */\n submit?: { text: string };\n /**\n * Cancel button text.\n */\n cancel?: { text: string };\n };\n /**\n * Toast notifications for action completion.\n */\n feedback?: Feedback;\n}\n\nexport interface ActionModalField {\n /**\n * Field identifier.\n */\n id: string;\n /**\n * Field display label.\n */\n label?: string;\n}\n\nexport interface DeleteActionModal extends BaseActionModal {\n /**\n * Optional description text explaining the delete operation.\n */\n description?: { text: string };\n}\n\nexport interface BulkDeleteActionModal extends DeleteActionModal {}\n\nexport type BulkDeleteAction =\n | {\n mode: 'modal';\n modal: BulkDeleteActionModal;\n }\n | {\n mode: 'custom';\n modal?: never;\n };\n\nexport type DeleteAction = {\n /**\n * Show a confirmation modal.\n */\n mode: 'modal';\n modal: DeleteActionModal;\n};\n\nexport interface BaseActionPage {\n /**\n * Unique identifier.\n */\n id: string;\n}\n\nexport interface ActionModalWithFields extends BaseActionModal {\n /**\n * Form fields to display in the modal.\n */\n fields: ActionModalField[];\n}\n\nexport interface UpdateActionModal extends ActionModalWithFields {}\n\nexport interface CreateActionModal extends ActionModalWithFields {}\n\nexport interface UpdateActionPage extends BaseActionPage {}\n\nexport interface CreateActionPage extends BaseActionPage {}\n\nexport type UpdateAction = {\n /**\n * Navigate to a page for the update operation.\n */\n mode: 'page';\n page: UpdateActionPage;\n};\n\nexport type CreateAction = {\n /**\n * Navigate to a page for the create operation.\n */\n mode: 'page';\n page: CreateActionPage;\n};\n\nexport type CreateActionConfig = BaseActionItemConfig & {\n /**\n * Action type discriminator.\n */\n type: 'create';\n /**\n * Create action implementation configuration.\n */\n create: CreateAction;\n};\n\nexport type UpdateActionConfig = BaseActionItemConfig & {\n /**\n * Action type discriminator.\n */\n type: 'update';\n /**\n * Update action implementation configuration.\n */\n update: UpdateAction;\n};\n\nexport type DeleteActionConfig = BaseActionItemConfig & {\n /**\n * Action type discriminator.\n */\n type: 'delete';\n /**\n * Delete action implementation configuration.\n */\n delete: DeleteAction;\n};\n\nexport type BulkDeleteActionConfig = BaseActionItemConfig & {\n /**\n * Action type discriminator.\n */\n type: 'bulkDelete';\n /**\n * Bulk delete action implementation configuration.\n */\n bulkDelete: BulkDeleteAction;\n};\n\nexport type CustomActionConfig = BaseActionItemConfig & {\n /**\n * Action type discriminator.\n */\n type: 'custom';\n};\n"],"mappings":"","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["../../../../src/types/actions/bulkActions.ts"],"sourcesContent":["import {\n BaseActionParams,\n CustomActionModalProps,\n ResolvedAction,\n} from '../../exports/types';\nimport {\n BulkDeleteActionConfig,\n CustomActionConfig,\n DividerActionConfig,\n} from './base';\n\nexport type BulkActionItemConfig = BulkDeleteActionConfig | CustomActionConfig;\n\ntype BulkActionItem = {\n type: 'action';\n action: {\n item: BulkActionItemConfig;\n };\n menu?: never;\n};\n\ntype BulkActionMenu = {\n type: 'menu';\n menu: {\n label: string;\n items: (BulkActionItemConfig | DividerActionConfig)[];\n };\n action?: never;\n};\n\nexport interface BulkActionsConfig {\n primaryActions?: (BulkActionItem | BulkActionMenu)[];\n secondaryActions?: (BulkActionItemConfig | DividerActionConfig)[];\n}\n\nexport interface BulkActionsActionParams {\n selectedValues: any[];\n total: number;\n}\n\nexport interface CustomBulkActionsActionParams extends BaseActionParams {\n actionParams: BulkActionsActionParams;\n}\nexport type CustomBulkActionsActionResolver = (\n params: CustomBulkActionsActionParams,\n) => ResolvedAction;\n\nexport interface CustomBulkActionsActionModalProps\n extends CustomActionModalProps {\n actionParams: BulkActionsActionParams;\n}\n"],"mappings":"","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":[],"sources":["../../../../src/types/actions/bulkActions.ts"],"sourcesContent":["import {\n BaseActionParams,\n CustomActionModalProps,\n ResolvedAction,\n} from '../../exports/types';\nimport {\n BulkDeleteActionConfig,\n CustomActionConfig,\n DividerActionConfig,\n} from './base';\n\nexport type BulkActionItemConfig = BulkDeleteActionConfig | CustomActionConfig;\n\ntype BulkActionItem = {\n /**\n * Layout type discriminator.\n */\n type: 'action';\n /**\n * Single bulk action configuration.\n */\n action: {\n item: BulkActionItemConfig;\n };\n menu?: never;\n};\n\ntype BulkActionMenu = {\n /**\n * Layout type discriminator.\n */\n type: 'menu';\n /**\n * Menu configuration with multiple bulk actions.\n */\n menu: {\n /**\n * Menu group label displayed in the bulk actions toolbar.\n */\n label: string;\n /**\n * List of bulk actions and dividers in the menu.\n */\n items: (BulkActionItemConfig | DividerActionConfig)[];\n };\n action?: never;\n};\n\nexport interface BulkActionsConfig {\n /**\n * Primary bulk actions configuration.\n * Array of actions or menus shown prominently in the bulk actions toolbar.\n * Can include both single actions and grouped menu actions.\n */\n primaryActions?: (BulkActionItem | BulkActionMenu)[];\n /**\n * Secondary bulk actions configuration.\n * Array of individual actions and dividers shown in secondary position.\n * Typically displayed as individual buttons or in an overflow menu.\n */\n secondaryActions?: (BulkActionItemConfig | DividerActionConfig)[];\n}\n\nexport interface BulkActionsActionParams {\n /**\n * Array of selected item values to perform the bulk action on.\n */\n selectedValues: any[];\n /**\n * Total number of selected items.\n */\n total: number;\n}\n\nexport interface CustomBulkActionsActionParams extends BaseActionParams {\n /**\n * Bulk action parameters.\n */\n actionParams: BulkActionsActionParams;\n}\n\nexport type CustomBulkActionsActionResolver = (\n params: CustomBulkActionsActionParams,\n) => ResolvedAction;\n\nexport interface CustomBulkActionsActionModalProps\n extends CustomActionModalProps {\n /**\n * Bulk action parameters.\n */\n actionParams: BulkActionsActionParams;\n}\n"],"mappings":"","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["../../../../src/types/actions/collectionPageActions.ts"],"sourcesContent":["import {\n CustomActionModalProps,\n CustomActionParams,\n ResolvedAction,\n} from '../../exports/types';\nimport {\n CreateActionConfig,\n CustomActionConfig,\n DividerActionConfig,\n} from './base';\n\nexport type CollectionPageActionConfig = (\n | CreateActionConfig\n | CustomActionConfig\n) & {\n collection:\n | {\n collectionId: string;\n entityTypeSource: 'cms';\n custom?: never;\n }\n | {\n collectionId: string;\n entityTypeSource: 'custom';\n custom: {\n id: string;\n };\n };\n};\n\ntype CollectionPageAction = {\n type: 'action';\n action: {\n item: CollectionPageActionConfig;\n };\n menu?: never;\n};\n\ntype CollectionPageMenu = {\n type: 'menu';\n menu: {\n label: string;\n items: (CollectionPageActionConfig | DividerActionConfig)[];\n };\n action?: never;\n};\n\nexport type CollectionPagePrimaryActions =\n | CollectionPageAction\n | CollectionPageMenu;\n\nexport type CollectionPageSecondaryActions =\n | CollectionPageAction\n | CollectionPageMenu;\n\nexport interface CollectionPageActionParams {\n collectionId: string;\n}\n\nexport type CustomActionCollectionPageActionParams =\n CustomActionParams<CollectionPageActionParams>;\n\nexport type CustomActionCollectionPageActionResolver = (\n params: CustomActionCollectionPageActionParams,\n) => ResolvedAction;\n\nexport interface CustomActionCollectionPageActionModalProps\n extends CustomActionModalProps {\n actionParams: CollectionPageActionParams;\n}\n\nexport type CollectionPageOnRowClickActionConfig = CustomActionConfig & {\n item: any;\n};\n\nexport interface CollectionPageActionOnRowClickParams {\n item: any;\n}\n\nexport type CustomActionCollectionPageActionOnRowClickParams =\n CustomActionParams<CollectionPageActionOnRowClickParams>;\n\nexport type CustomActionCollectionPageActionOnRowClickResolver = (\n params: CustomActionCollectionPageActionOnRowClickParams,\n) => ResolvedAction;\n"],"mappings":"","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":[],"sources":["../../../../src/types/actions/collectionPageActions.ts"],"sourcesContent":["import {\n CustomActionModalProps,\n CustomActionParams,\n ResolvedAction,\n} from '../../exports/types';\nimport {\n CreateActionConfig,\n CustomActionConfig,\n DividerActionConfig,\n} from './base';\n\nexport type CollectionPageActionConfig = (\n | CreateActionConfig\n | CustomActionConfig\n) & {\n collection:\n | {\n collectionId: string;\n entityTypeSource: 'cms';\n custom?: never;\n }\n | {\n collectionId: string;\n entityTypeSource: 'custom';\n custom: {\n id: string;\n };\n };\n};\n\ntype CollectionPageAction = {\n /**\n * Layout type discriminator.\n */\n type: 'action';\n /**\n * Single action configuration.\n */\n action: {\n item: CollectionPageActionConfig;\n };\n menu?: never;\n};\n\ntype CollectionPageMenu = {\n /**\n * Layout type discriminator.\n */\n type: 'menu';\n /**\n * Menu configuration with multiple actions.\n */\n menu: {\n /**\n * Menu group label displayed in the UI.\n */\n label: string;\n /**\n * List of actions and dividers in the menu.\n */\n items: (CollectionPageActionConfig | DividerActionConfig)[];\n };\n action?: never;\n};\n\nexport type CollectionPagePrimaryActions =\n | CollectionPageAction\n | CollectionPageMenu;\n\nexport type CollectionPageSecondaryActions =\n | CollectionPageAction\n | CollectionPageMenu;\n\nexport interface CollectionPageActionParams {\n /**\n * The collection ID that the action is operating on.\n */\n collectionId: string;\n}\n\nexport type CustomActionCollectionPageActionParams =\n CustomActionParams<CollectionPageActionParams>;\n\nexport type CustomActionCollectionPageActionResolver = (\n params: CustomActionCollectionPageActionParams,\n) => ResolvedAction;\n\nexport interface CustomActionCollectionPageActionModalProps\n extends CustomActionModalProps {\n /**\n * Collection-specific action parameters.\n */\n actionParams: CollectionPageActionParams;\n}\n\nexport type CollectionPageOnRowClickActionConfig = CustomActionConfig & {\n /**\n * The data item that was clicked (row/card data).\n */\n item: any;\n};\n\nexport interface CollectionPageActionOnRowClickParams {\n /**\n * The data item that was clicked (row/card data).\n */\n item: any;\n}\n\nexport type CustomActionCollectionPageActionOnRowClickParams =\n CustomActionParams<CollectionPageActionOnRowClickParams>;\n\nexport type CustomActionCollectionPageActionOnRowClickResolver = (\n params: CustomActionCollectionPageActionOnRowClickParams,\n) => ResolvedAction;\n"],"mappings":"","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["../../../../src/types/actions/entityPageActions.ts"],"sourcesContent":["import { FieldValues, UseFormReturn } from '@wix/patterns/form';\nimport { CustomActionParams, ResolvedAction } from '../..';\nimport {\n CreateActionConfig,\n CustomActionConfig,\n DividerActionConfig,\n} from './base';\n\nexport type EntityPageMoreActions = (\n | CustomActionConfig\n | DividerActionConfig\n)[];\n\nexport type EntityPageActionConfig = CreateActionConfig | CustomActionConfig;\n\ntype EntityPageAction = {\n type: 'action';\n action: {\n item: EntityPageActionConfig;\n };\n menu?: never;\n};\n\ntype EntityPageMenu = {\n type: 'menu';\n menu: {\n label: string;\n items: (EntityPageActionConfig | DividerActionConfig)[];\n };\n action?: never;\n};\n\nexport type EntityPagePrimaryActions = EntityPageAction | EntityPageMenu;\nexport type EntityPageSecondaryActions = EntityPageAction | EntityPageMenu;\n\nexport interface EntityPageActionParams {\n entity: any;\n form?: UseFormReturn<FieldValues, any, undefined>;\n}\n\nexport type CustomEntityPageActionParams =\n CustomActionParams<EntityPageActionParams>;\n\nexport type CustomEntityPageActionResolver = (\n params: CustomEntityPageActionParams,\n) => ResolvedAction;\n"],"mappings":"","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":[],"sources":["../../../../src/types/actions/entityPageActions.ts"],"sourcesContent":["import { FieldValues, UseFormReturn } from '@wix/patterns/form';\nimport { CustomActionParams, ResolvedAction } from '../..';\nimport {\n CreateActionConfig,\n CustomActionConfig,\n DividerActionConfig,\n} from './base';\n\nexport type EntityPageMoreActions = (\n | CustomActionConfig\n | DividerActionConfig\n)[];\n\nexport type EntityPageActionConfig = CreateActionConfig | CustomActionConfig;\n\ntype EntityPageAction = {\n /**\n * Layout type discriminator.\n */\n type: 'action';\n /**\n * Single action configuration.\n */\n action: {\n item: EntityPageActionConfig;\n };\n menu?: never;\n};\n\ntype EntityPageMenu = {\n /**\n * Layout type discriminator.\n */\n type: 'menu';\n /**\n * Menu configuration with multiple actions.\n */\n menu: {\n /**\n * Menu group label displayed in the UI.\n */\n label: string;\n /**\n * List of actions and dividers in the menu.\n */\n items: (EntityPageActionConfig | DividerActionConfig)[];\n };\n action?: never;\n};\n\nexport type EntityPagePrimaryActions = EntityPageAction | EntityPageMenu;\n\nexport type EntityPageSecondaryActions = EntityPageAction | EntityPageMenu;\n\nexport interface EntityPageActionParams {\n /**\n * The current entity data being viewed/edited.\n */\n entity: any;\n /**\n * Form APIs available when in edit mode.\n * Undefined in view mode.\n */\n form?: UseFormReturn<FieldValues, any, undefined>;\n}\n\nexport type CustomEntityPageActionParams =\n CustomActionParams<EntityPageActionParams>;\n\nexport type CustomEntityPageActionResolver = (\n params: CustomEntityPageActionParams,\n) => ResolvedAction;\n"],"mappings":"","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["../../../src/types/fetchData.ts"],"sourcesContent":["import { CursorQuery, OffsetQuery } from '@wix/patterns';\n\nexport type Mode = 'cursor' | 'offset';\n\nexport type UseFetchDataProps<M extends Mode> = {\n searchableFieldIds?: string[];\n filterFieldMapping?: Record<string, { fieldId: string }>;\n paginationMode?: M;\n};\n\nexport interface CursorQueryResult {\n items: any[];\n cursor?: string | undefined | null;\n total?: number | null;\n}\n\nexport interface OffsetQueryResult {\n items: any[];\n total?: number | null;\n hasNext?: boolean;\n}\n\nexport type FetchDataFn<M extends Mode> = M extends 'cursor'\n ? (q: CursorQuery<any>) => Promise<CursorQueryResult>\n : (q: OffsetQuery<any>) => Promise<OffsetQueryResult>;\n"],"mappings":"","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":[],"sources":["../../../src/types/fetchData.ts"],"sourcesContent":["import { CursorQuery, OffsetQuery } from '@wix/patterns';\n\nexport type Mode = 'cursor' | 'offset';\n\nexport type UseFetchDataProps<M extends Mode> = {\n /**\n * Array of field IDs that support search functionality.\n * These fields will be included in search operations.\n */\n searchableFieldIds?: string[];\n /**\n * Mapping between filter IDs and actual field IDs.\n * Used to translate filter configurations to actual field queries.\n */\n filterFieldMapping?: Record<string, { fieldId: string }>;\n /**\n * Pagination mode to use for data fetching.\n * Affects the query structure and result format.\n * @default 'offset'\n */\n paginationMode?: M;\n};\n\nexport interface CursorQueryResult {\n /**\n * Array of data items returned by the query.\n */\n items: any[];\n /**\n * Cursor for fetching the next page of results.\n * Undefined or null indicates no more pages available.\n */\n cursor?: string | undefined | null;\n /**\n * Total number of items available (optional).\n * Used for displaying total counts and progress indicators.\n */\n total?: number | null;\n}\n\nexport interface OffsetQueryResult {\n /**\n * Array of data items returned by the query.\n */\n items: any[];\n /**\n * Total number of items available (optional).\n * Used for displaying total counts and calculating page numbers.\n */\n total?: number | null;\n /**\n * Whether there are more pages available.\n * Used to enable/disable next page navigation.\n */\n hasNext?: boolean;\n}\n\nexport type FetchDataFn<M extends Mode> = M extends 'cursor'\n ? (q: CursorQuery<any>) => Promise<CursorQueryResult>\n : (q: OffsetQuery<any>) => Promise<OffsetQueryResult>;\n"],"mappings":"","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["../../../src/types/types.ts"],"sourcesContent":["import { EntityPageConfig } from './EntityPageConfig';\nimport { CollectionPageConfig } from './CollectionPageConfig';\nimport { useOptimisticActions } from '@wix/patterns';\nimport { CursorQueryResult, OffsetQueryResult } from './fetchData';\n\ninterface BaseCollectionConfigCommon {\n collectionId: string;\n}\n\nexport interface CMSCollectionConfig extends BaseCollectionConfigCommon {\n entityTypeSource: 'cms';\n cms?: {\n schema?: { id: string };\n };\n custom?: never;\n}\n\ninterface CustomCollectionConfig extends BaseCollectionConfigCommon {\n entityTypeSource: 'custom';\n cms?: never;\n custom: {\n id: string;\n };\n}\n\nexport type BaseCollectionConfig = CMSCollectionConfig | CustomCollectionConfig;\n\nexport type PatternsFieldType =\n | 'SHORT_TEXT'\n | 'LONG_TEXT'\n | 'NUMBER'\n | 'BOOLEAN'\n | 'DATE'\n | 'DATETIME'\n | 'URL'\n | 'ARRAY'\n | 'REFERENCE'\n | 'IMAGE';\n\nexport interface AppConfig {\n pages: PageConfig[];\n}\n\nexport interface BasePageConfig {\n id: string;\n appMainPage?: boolean;\n}\n\nexport interface CollectionPageConfigType extends BasePageConfig {\n type: 'collectionPage';\n collectionPage: CollectionPageConfig;\n entityPage?: never;\n}\n\nexport interface EntityPageConfigType extends BasePageConfig {\n type: 'entityPage';\n entityPage: EntityPageConfig;\n collectionPage?: never;\n}\n\nexport type PageConfig = CollectionPageConfigType | EntityPageConfigType;\n\nexport type EntityProps = { [key: string]: any };\n\nexport interface IMenuItem<T extends EntityProps = any> {\n item: T;\n}\nexport interface IColumnValue<T> {\n value: T;\n row: Record<string, any>;\n}\n\nexport type QueryOperator =\n | 'CONTAINS'\n | 'ENDS_WITH'\n | 'EQ'\n | 'EXISTS'\n | 'GT'\n | 'GTE'\n | 'HAS_ALL'\n | 'HAS_SOME'\n | 'LT'\n | 'LTE'\n | 'NE'\n | 'STARTS_WITH'\n | 'URLIZED';\n\ninterface BaseField {\n id: string;\n displayName: string;\n validation?: {\n numberRange?: NumberRange;\n stringLengthRange?: StringLengthRange;\n required: boolean;\n };\n capabilities: {\n supportedQueryOperators: QueryOperator[];\n sortable: boolean;\n };\n}\n\nexport interface ReferenceField extends BaseField {\n type: 'REFERENCE';\n referenceMetadata: {\n referencedCollectionId: string;\n };\n}\n\nexport interface NonReferenceField extends BaseField {\n type: Exclude<PatternsFieldType, 'REFERENCE'>;\n}\n\nexport type Field = ReferenceField | NonReferenceField;\n\nexport interface NumberRange {\n min?: number;\n max?: number;\n}\nexport interface StringLengthRange {\n minLength?: number;\n maxLength?: number;\n}\n\nexport interface Query {\n limit: number;\n offset?: number;\n page: number;\n search?: string;\n cursor?: string | null;\n filters: Record<string, any>;\n sort?: {\n fieldName: string;\n order: 'asc' | 'desc';\n }[];\n}\nexport interface SchemaConfig {\n id: string;\n fields: Record<string, Field | undefined>;\n displayField: string;\n idField: string;\n actions: {\n get: (entityId: string) => Promise<any>;\n create: (newEntity: Partial<any>) => Promise<any>;\n update: (updatedEntity: any) => Promise<any>;\n delete: (entityId: string) => Promise<any>;\n bulkDelete: (entityIds: string[]) => Promise<any>;\n find: (\n query: Query,\n options?: {\n searchableFieldIds?: string[];\n filterFieldMapping?: Record<string, { fieldId: string }>;\n },\n ) => Promise<CursorQueryResult | OffsetQueryResult>;\n };\n}\n\nexport type OptimisticActionsParams = Parameters<\n typeof useOptimisticActions\n>[1];\n"],"mappings":"","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":[],"sources":["../../../src/types/types.ts"],"sourcesContent":["import { EntityPageConfig } from './EntityPageConfig';\nimport { CollectionPageConfig } from './CollectionPageConfig';\nimport { useOptimisticActions } from '@wix/patterns';\nimport { CursorQueryResult, OffsetQueryResult } from './fetchData';\n\ninterface BaseCollectionConfigCommon {\n /**\n * Collection identifier.\n * - For CMS: the Wix Data collection ID.\n * - For custom sources: the logical collection/entity type ID your data provider recognizes.\n */\n collectionId: string;\n}\n\nexport interface CMSCollectionConfig extends BaseCollectionConfigCommon {\n /**\n * Declares this collection pulls schema/data from Wix CMS.\n */\n entityTypeSource: 'cms';\n /**\n * Optional override for CMS schema metadata.\n * Use this if you already have the schema and want to provide it directly.\n */\n cms?: {\n schema?: { id: string };\n };\n custom?: never;\n}\n\ninterface CustomCollectionConfig extends BaseCollectionConfigCommon {\n /**\n * Declares this collection is backed by a custom data source.\n */\n entityTypeSource: 'custom';\n cms?: never;\n /**\n * Required metadata for custom sources.\n * `id` must match the identifier your custom data source registers under.\n */\n custom: {\n id: string;\n };\n}\n\nexport type BaseCollectionConfig = CMSCollectionConfig | CustomCollectionConfig;\n\nexport type PatternsFieldType =\n | 'SHORT_TEXT'\n | 'LONG_TEXT'\n | 'NUMBER'\n | 'BOOLEAN'\n | 'DATE'\n | 'DATETIME'\n | 'URL'\n | 'ARRAY'\n | 'REFERENCE'\n | 'IMAGE';\n\nexport interface AppConfig {\n /** List of pages to render and route between. */\n pages: PageConfig[];\n}\n\nexport interface BasePageConfig {\n /**\n * Page unique identifier.\n * - Used for routing, navigation, and cross references (e.g. `entityPageId`, `parentPageId`).\n */\n id: string;\n /**\n * Marks this page as the main landing page of the app.\n * - Exactly one page should have `true`.\n * - Used to determine the default route.\n */\n appMainPage?: boolean;\n}\n\nexport interface CollectionPageConfigType extends BasePageConfig {\n /**\n * Page type discriminator.\n */\n type: 'collectionPage';\n /**\n * Collection page configuration.\n */\n collectionPage: CollectionPageConfig;\n entityPage?: never;\n}\n\nexport interface EntityPageConfigType extends BasePageConfig {\n /**\n * Page type discriminator.\n */\n type: 'entityPage';\n /**\n * Entity page configuration.\n */\n entityPage: EntityPageConfig;\n collectionPage?: never;\n}\n\nexport type PageConfig = CollectionPageConfigType | EntityPageConfigType;\n\nexport type EntityProps = { [key: string]: any };\n\nexport interface IMenuItem<T extends EntityProps = any> {\n item: T;\n}\n\nexport interface IColumnValue<T> {\n value: T;\n row: Record<string, any>;\n}\n\nexport type QueryOperator =\n | 'CONTAINS'\n | 'ENDS_WITH'\n | 'EQ'\n | 'EXISTS'\n | 'GT'\n | 'GTE'\n | 'HAS_ALL'\n | 'HAS_SOME'\n | 'LT'\n | 'LTE'\n | 'NE'\n | 'STARTS_WITH'\n | 'URLIZED';\n\ninterface BaseField {\n /**\n * Field unique identifier (dot-path supported, e.g. 'primaryInfo.email').\n */\n id: string;\n /**\n * Human-readable field display name.\n */\n displayName: string;\n /**\n * Optional validation rules for UI inputs/editing.\n */\n validation?: {\n numberRange?: NumberRange;\n stringLengthRange?: StringLengthRange;\n /**\n * Whether the field is required when creating/updating an entity.\n */\n required: boolean;\n };\n /**\n * Capabilities informing UI and query layer behavior.\n */\n capabilities: {\n /**\n * Operators allowed for querying/filtering this field.\n */\n supportedQueryOperators: QueryOperator[];\n /**\n * Whether the field supports sorting.\n */\n sortable: boolean;\n };\n}\n\nexport interface ReferenceField extends BaseField {\n type: 'REFERENCE';\n referenceMetadata: {\n /**\n * Target collection ID referenced by this field.\n */\n referencedCollectionId: string;\n };\n}\n\nexport interface NonReferenceField extends BaseField {\n type: Exclude<PatternsFieldType, 'REFERENCE'>;\n}\n\nexport type Field = ReferenceField | NonReferenceField;\n\nexport interface NumberRange {\n min?: number;\n max?: number;\n}\n\nexport interface StringLengthRange {\n minLength?: number;\n maxLength?: number;\n}\n\nexport interface Query {\n limit: number;\n offset?: number;\n page: number;\n search?: string;\n cursor?: string | null;\n filters: Record<string, any>;\n sort?: {\n fieldName: string;\n order: 'asc' | 'desc';\n }[];\n}\n\nexport interface SchemaConfig {\n /**\n * Schema unique identifier (usually same as collectionId).\n */\n id: string;\n /**\n * Field registry by fieldId. Undefined value allows reserving keys conditionally.\n */\n fields: Record<string, Field | undefined>;\n /**\n * The fieldId that best represents the entity for titles/selections.\n */\n displayField: string;\n /**\n * The underlying identifier field used by your data source (e.g. '_id').\n */\n idField: string;\n /**\n * Data access layer for entities of this schema.\n */\n actions: {\n /**\n * Fetch a single entity by ID.\n */\n get: (entityId: string) => Promise<any>;\n /**\n * Create a new entity with the provided partial.\n */\n create: (newEntity: Partial<any>) => Promise<any>;\n /**\n * Update an existing entity.\n */\n update: (updatedEntity: any) => Promise<any>;\n /**\n * Delete an entity by ID.\n */\n delete: (entityId: string) => Promise<any>;\n /**\n * Bulk deletion by IDs.\n */\n bulkDelete: (entityIds: string[]) => Promise<any>;\n /**\n * Query for entities with pagination/sort/filter.\n * Return shape depends on pagination mode (see CollectionConfig.paginationMode):\n * - Cursor mode: { items, cursor, total? }\n * - Offset mode (default): { items, hasNext, total? }\n */\n find: (\n query: Query,\n options?: {\n /**\n * Overrides the set of fieldIds used for search term matching.\n */\n searchableFieldIds?: string[];\n /**\n * Maps UI filter ids to underlying fieldIds when they differ.\n */\n filterFieldMapping?: Record<string, { fieldId: string }>;\n },\n ) => Promise<CursorQueryResult | OffsetQueryResult>;\n };\n}\n\nexport type OptimisticActionsParams = Parameters<\n typeof useOptimisticActions\n>[1];\n"],"mappings":"","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["../../../../src/utils/actions/types.ts"],"sourcesContent":["import { ActionCellAPI, CollectionOptimisticActions } from '@wix/patterns';\nimport {\n UpdateActionConfig,\n CustomActionConfig,\n SchemaConfig,\n BulkDeleteActionConfig,\n DeleteActionConfig,\n CreateActionConfig,\n BaseSDK,\n} from '../../types';\nimport { IconElement } from '@wix/design-system';\n\nexport interface ResolvedAction {\n label: string;\n icon: IconElement;\n onClick: () => void;\n disabled?: boolean;\n hidden?: boolean;\n tooltip?: string;\n skin?: string;\n biName?: string;\n}\n\nexport interface BaseContextParams {\n schema: SchemaConfig;\n}\n\nexport interface ActionsSDK extends BaseSDK {\n getSchema: (collectionId: string) => SchemaConfig | undefined;\n collectionId: string; // TODO: Why collectionId is needed here? getSchema with internal collectionId is enough\n getOptimisticActions: (\n collectionId: string,\n ) => CollectionOptimisticActions<any, any>;\n}\n\nexport interface BaseActionParams<T = Record<string, any>> {\n sdk: ActionsSDK;\n actionParams: T;\n}\n\nexport interface ActionCellBaseParams extends BaseActionParams {\n actionParams: {\n item: any;\n index: number;\n api: ActionCellAPI<any, any>;\n };\n}\n\nexport interface BulkDeleteActionParams extends BaseActionParams {\n action: BulkDeleteActionConfig;\n actionParams: {\n selectedValues: any[];\n total: number;\n };\n}\n\nexport interface DeleteActionParams extends ActionCellBaseParams {\n action: DeleteActionConfig;\n}\n\nexport interface UpdateActionParams extends BaseActionParams {\n action: UpdateActionConfig;\n}\n\nexport interface CreateActionParams extends BaseActionParams {\n action: CreateActionConfig;\n}\n\nexport interface CustomActionParams<T> extends BaseActionParams<T> {\n action: CustomActionConfig;\n}\n\nexport interface ActionModalProps {\n modalParams: Record<string, any>;\n actionParams: Record<string, any>;\n sdk: ActionsSDK;\n}\n\nexport interface CustomActionModalProps extends ActionModalProps {\n modalParams: { id: string };\n}\n"],"mappings":"","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":[],"sources":["../../../../src/utils/actions/types.ts"],"sourcesContent":["import { ActionCellAPI, CollectionOptimisticActions } from '@wix/patterns';\nimport {\n UpdateActionConfig,\n CustomActionConfig,\n SchemaConfig,\n BulkDeleteActionConfig,\n DeleteActionConfig,\n CreateActionConfig,\n BaseSDK,\n} from '../../types';\nimport { IconElement } from '@wix/design-system';\n\nexport interface ResolvedAction {\n label: string;\n icon: IconElement;\n onClick: () => void;\n disabled?: boolean;\n hidden?: boolean;\n tooltip?: string;\n skin?: string;\n biName?: string;\n}\n\nexport interface BaseContextParams {\n schema: SchemaConfig;\n}\n\nexport interface ActionsSDK extends BaseSDK {\n getSchema: (collectionId: string) => SchemaConfig | undefined;\n collectionId: string; // TODO: Why collectionId is needed here? getSchema with internal collectionId is enough\n getOptimisticActions: (\n collectionId: string,\n ) => CollectionOptimisticActions<any, any>;\n refreshCollection: () => void;\n}\n\nexport interface BaseActionParams<T = Record<string, any>> {\n sdk: ActionsSDK;\n actionParams: T;\n}\n\nexport interface ActionCellBaseParams extends BaseActionParams {\n actionParams: {\n item: any;\n index: number;\n api: ActionCellAPI<any, any>;\n };\n}\n\nexport interface BulkDeleteActionParams extends BaseActionParams {\n action: BulkDeleteActionConfig;\n actionParams: {\n selectedValues: any[];\n total: number;\n };\n}\n\nexport interface DeleteActionParams extends ActionCellBaseParams {\n action: DeleteActionConfig;\n}\n\nexport interface UpdateActionParams extends BaseActionParams {\n action: UpdateActionConfig;\n}\n\nexport interface CreateActionParams extends BaseActionParams {\n action: CreateActionConfig;\n}\n\nexport interface CustomActionParams<T> extends BaseActionParams<T> {\n action: CustomActionConfig;\n}\n\nexport interface ActionModalProps {\n modalParams: Record<string, any>;\n actionParams: Record<string, any>;\n sdk: ActionsSDK;\n}\n\nexport interface CustomActionModalProps extends ActionModalProps {\n modalParams: { id: string };\n}\n"],"mappings":"","ignoreList":[]}
|
package/dist/docs/app_context.md
CHANGED
|
@@ -43,3 +43,67 @@ export const MyModal: React.FC = () => {
|
|
|
43
43
|
```
|
|
44
44
|
|
|
45
45
|
The `items` array contains the current filtered and paginated collection data that matches what's displayed in the table/grid.
|
|
46
|
+
|
|
47
|
+
## 3. Refreshing Collection Data
|
|
48
|
+
|
|
49
|
+
The `useAppContext` hook also provides a `refreshCollection` function that allows you to refresh the collection data from within your child components:
|
|
50
|
+
|
|
51
|
+
```tsx
|
|
52
|
+
import React from 'react';
|
|
53
|
+
import { useAppContext } from '@wix/auto-patterns';
|
|
54
|
+
|
|
55
|
+
export const RefreshButton: React.FC = () => {
|
|
56
|
+
const { refreshCollection } = useAppContext();
|
|
57
|
+
|
|
58
|
+
return (
|
|
59
|
+
<button onClick={refreshCollection}>
|
|
60
|
+
Refresh Collection
|
|
61
|
+
</button>
|
|
62
|
+
);
|
|
63
|
+
};
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
### Use Cases for refreshCollection
|
|
67
|
+
|
|
68
|
+
- **Manual Refresh**: Provide users with a button to manually refresh data
|
|
69
|
+
- **Post-Operation Refresh**: Refresh data after completing custom operations in modals
|
|
70
|
+
- **Data Synchronization**: Ensure child components have the latest data after external changes
|
|
71
|
+
- **Real-time Updates**: Refresh data when receiving updates from external sources
|
|
72
|
+
|
|
73
|
+
### Example: Modal with Refresh Capability
|
|
74
|
+
|
|
75
|
+
```tsx
|
|
76
|
+
import React from 'react';
|
|
77
|
+
import { useAppContext } from '@wix/auto-patterns';
|
|
78
|
+
import { Button, Modal } from '@wix/design-system';
|
|
79
|
+
|
|
80
|
+
export const DataUpdateModal: React.FC = () => {
|
|
81
|
+
const { items, refreshCollection } = useAppContext();
|
|
82
|
+
|
|
83
|
+
const handleUpdate = async () => {
|
|
84
|
+
// Perform your custom update operation
|
|
85
|
+
await updateExternalData();
|
|
86
|
+
|
|
87
|
+
// Refresh the collection to show updated data
|
|
88
|
+
refreshCollection();
|
|
89
|
+
};
|
|
90
|
+
|
|
91
|
+
return (
|
|
92
|
+
<Modal>
|
|
93
|
+
<Modal.Content>
|
|
94
|
+
<p>Current items: {items.length}</p>
|
|
95
|
+
<Button onClick={handleUpdate}>
|
|
96
|
+
Update and Refresh
|
|
97
|
+
</Button>
|
|
98
|
+
</Modal.Content>
|
|
99
|
+
</Modal>
|
|
100
|
+
);
|
|
101
|
+
};
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
### Important Notes
|
|
105
|
+
|
|
106
|
+
- **Automatic Refresh**: The `refreshCollection` function will refresh the current collection with the same filters, sorting, and pagination settings
|
|
107
|
+
- **Performance**: Use this function judiciously to avoid unnecessary API calls
|
|
108
|
+
- **User Experience**: Consider showing loading states during refresh operations
|
|
109
|
+
- **Error Handling**: The refresh operation will automatically handle errors and display appropriate messages to users
|
|
@@ -1174,6 +1174,11 @@ The only functions exist in sdk are:
|
|
|
1174
1174
|
- Useful for dynamic operations based on collection structure
|
|
1175
1175
|
- Example: `const schema = sdk.getSchema(sdk.collectionId)`
|
|
1176
1176
|
|
|
1177
|
+
• **refreshCollection** - `refreshCollection(): void`
|
|
1178
|
+
- Refreshes the collection data by clearing the current result and fetching fresh data
|
|
1179
|
+
- Useful for manual refresh operations or after completing custom actions
|
|
1180
|
+
- Example: `sdk.refreshCollection()` to refresh the current collection
|
|
1181
|
+
|
|
1177
1182
|
• **collectionId** - `string`
|
|
1178
1183
|
- Current collection context identifier
|
|
1179
1184
|
- Available in all action contexts for referencing the active collection
|
|
@@ -2950,6 +2955,70 @@ export const MyModal: React.FC = () => {
|
|
|
2950
2955
|
|
|
2951
2956
|
The `items` array contains the current filtered and paginated collection data that matches what's displayed in the table/grid.
|
|
2952
2957
|
|
|
2958
|
+
## 3. Refreshing Collection Data
|
|
2959
|
+
|
|
2960
|
+
The `useAppContext` hook also provides a `refreshCollection` function that allows you to refresh the collection data from within your child components:
|
|
2961
|
+
|
|
2962
|
+
```tsx
|
|
2963
|
+
import React from 'react';
|
|
2964
|
+
import { useAppContext } from '@wix/auto-patterns';
|
|
2965
|
+
|
|
2966
|
+
export const RefreshButton: React.FC = () => {
|
|
2967
|
+
const { refreshCollection } = useAppContext();
|
|
2968
|
+
|
|
2969
|
+
return (
|
|
2970
|
+
<button onClick={refreshCollection}>
|
|
2971
|
+
Refresh Collection
|
|
2972
|
+
</button>
|
|
2973
|
+
);
|
|
2974
|
+
};
|
|
2975
|
+
```
|
|
2976
|
+
|
|
2977
|
+
### Use Cases for refreshCollection
|
|
2978
|
+
|
|
2979
|
+
- **Manual Refresh**: Provide users with a button to manually refresh data
|
|
2980
|
+
- **Post-Operation Refresh**: Refresh data after completing custom operations in modals
|
|
2981
|
+
- **Data Synchronization**: Ensure child components have the latest data after external changes
|
|
2982
|
+
- **Real-time Updates**: Refresh data when receiving updates from external sources
|
|
2983
|
+
|
|
2984
|
+
### Example: Modal with Refresh Capability
|
|
2985
|
+
|
|
2986
|
+
```tsx
|
|
2987
|
+
import React from 'react';
|
|
2988
|
+
import { useAppContext } from '@wix/auto-patterns';
|
|
2989
|
+
import { Button, Modal } from '@wix/design-system';
|
|
2990
|
+
|
|
2991
|
+
export const DataUpdateModal: React.FC = () => {
|
|
2992
|
+
const { items, refreshCollection } = useAppContext();
|
|
2993
|
+
|
|
2994
|
+
const handleUpdate = async () => {
|
|
2995
|
+
// Perform your custom update operation
|
|
2996
|
+
await updateExternalData();
|
|
2997
|
+
|
|
2998
|
+
// Refresh the collection to show updated data
|
|
2999
|
+
refreshCollection();
|
|
3000
|
+
};
|
|
3001
|
+
|
|
3002
|
+
return (
|
|
3003
|
+
<Modal>
|
|
3004
|
+
<Modal.Content>
|
|
3005
|
+
<p>Current items: {items.length}</p>
|
|
3006
|
+
<Button onClick={handleUpdate}>
|
|
3007
|
+
Update and Refresh
|
|
3008
|
+
</Button>
|
|
3009
|
+
</Modal.Content>
|
|
3010
|
+
</Modal>
|
|
3011
|
+
);
|
|
3012
|
+
};
|
|
3013
|
+
```
|
|
3014
|
+
|
|
3015
|
+
### Important Notes
|
|
3016
|
+
|
|
3017
|
+
- **Automatic Refresh**: The `refreshCollection` function will refresh the current collection with the same filters, sorting, and pagination settings
|
|
3018
|
+
- **Performance**: Use this function judiciously to avoid unnecessary API calls
|
|
3019
|
+
- **User Experience**: Consider showing loading states during refresh operations
|
|
3020
|
+
- **Error Handling**: The refresh operation will automatically handle errors and display appropriate messages to users
|
|
3021
|
+
|
|
2953
3022
|
---
|
|
2954
3023
|
|
|
2955
3024
|
# Custom Overrides
|
|
@@ -19,6 +19,11 @@ The only functions exist in sdk are:
|
|
|
19
19
|
- Useful for dynamic operations based on collection structure
|
|
20
20
|
- Example: `const schema = sdk.getSchema(sdk.collectionId)`
|
|
21
21
|
|
|
22
|
+
• **refreshCollection** - `refreshCollection(): void`
|
|
23
|
+
- Refreshes the collection data by clearing the current result and fetching fresh data
|
|
24
|
+
- Useful for manual refresh operations or after completing custom actions
|
|
25
|
+
- Example: `sdk.refreshCollection()` to refresh the current collection
|
|
26
|
+
|
|
22
27
|
• **collectionId** - `string`
|
|
23
28
|
- Current collection context identifier
|
|
24
29
|
- Available in all action contexts for referencing the active collection
|
package/dist/esm/hooks/index.js
CHANGED
|
@@ -4,6 +4,5 @@ export * from './useGridFeatures';
|
|
|
4
4
|
export * from './useNavigationUtils';
|
|
5
5
|
export * from './usePagePath';
|
|
6
6
|
export * from './useEntityPageHeaderTexts';
|
|
7
|
-
export * from './useUpdateAppContextItems';
|
|
8
7
|
export { useAppContext } from '../providers/AppContext';
|
|
9
8
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useAppContext"],"sources":["../../../src/hooks/index.ts"],"sourcesContent":["export * from './useTableFeatures';\nexport * from './useFilters';\nexport * from './useGridFeatures';\nexport * from './useNavigationUtils';\nexport * from './usePagePath';\nexport * from './useEntityPageHeaderTexts';\nexport
|
|
1
|
+
{"version":3,"names":["useAppContext"],"sources":["../../../src/hooks/index.ts"],"sourcesContent":["export * from './useTableFeatures';\nexport * from './useFilters';\nexport * from './useGridFeatures';\nexport * from './useNavigationUtils';\nexport * from './usePagePath';\nexport * from './useEntityPageHeaderTexts';\nexport { useAppContext } from '../providers/AppContext';\n"],"mappings":"AAAA,cAAc,oBAAoB;AAClC,cAAc,cAAc;AAC5B,cAAc,mBAAmB;AACjC,cAAc,sBAAsB;AACpC,cAAc,eAAe;AAC7B,cAAc,4BAA4B;AAC1C,SAASA,aAAa,QAAQ,yBAAyB","ignoreList":[]}
|
|
@@ -2,6 +2,7 @@ import { useMemo } from 'react';
|
|
|
2
2
|
import { useSchemaRegistry } from '../providers';
|
|
3
3
|
import { useBaseSDK } from './useBaseSDK';
|
|
4
4
|
import { useOptimisticActionsContext } from '../providers/OptimisticActionsContext';
|
|
5
|
+
import { useAppContext } from '../providers/AppContext';
|
|
5
6
|
export const useActionsSDK = _ref => {
|
|
6
7
|
let {
|
|
7
8
|
collectionId
|
|
@@ -12,6 +13,9 @@ export const useActionsSDK = _ref => {
|
|
|
12
13
|
const {
|
|
13
14
|
getOptimisticActions
|
|
14
15
|
} = useOptimisticActionsContext();
|
|
16
|
+
const {
|
|
17
|
+
refreshCollection
|
|
18
|
+
} = useAppContext();
|
|
15
19
|
const baseSDK = useBaseSDK();
|
|
16
20
|
/* eslint-disable react-hooks/exhaustive-deps */
|
|
17
21
|
// disabled because bug in Patterns that navigateToEntityPage isn't wrapped with useCallback,
|
|
@@ -20,8 +24,9 @@ export const useActionsSDK = _ref => {
|
|
|
20
24
|
// TODO: Why spread and not sdk.app/base.openModal ... instead
|
|
21
25
|
getSchema,
|
|
22
26
|
collectionId,
|
|
23
|
-
getOptimisticActions
|
|
24
|
-
|
|
27
|
+
getOptimisticActions,
|
|
28
|
+
refreshCollection
|
|
29
|
+
}), [getSchema, collectionId, getOptimisticActions, baseSDK, refreshCollection]);
|
|
25
30
|
|
|
26
31
|
/* eslint-enable react-hooks/exhaustive-deps */
|
|
27
32
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useMemo","useSchemaRegistry","useBaseSDK","useOptimisticActionsContext","useActionsSDK","_ref","collectionId","getSchema","getOptimisticActions","baseSDK","sdk"],"sources":["../../../src/hooks/useActionsSDK.ts"],"sourcesContent":["import { useMemo } from 'react';\nimport { useSchemaRegistry } from '../providers';\nimport { ActionsSDK } from '../utils/actions/types';\nimport { useBaseSDK } from './useBaseSDK';\nimport { useOptimisticActionsContext } from '../providers/OptimisticActionsContext';\n\nexport interface ActionsSDKParams {\n collectionId: string;\n}\n\nexport const useActionsSDK = ({ collectionId }: ActionsSDKParams) => {\n const { getSchema } = useSchemaRegistry();\n\n const { getOptimisticActions } = useOptimisticActionsContext();\n\n const baseSDK = useBaseSDK();\n /* eslint-disable react-hooks/exhaustive-deps */\n // disabled because bug in Patterns that navigateToEntityPage isn't wrapped with useCallback,\n const sdk = useMemo<ActionsSDK>(\n () => ({\n ...baseSDK, // TODO: Why spread and not sdk.app/base.openModal ... instead\n getSchema,\n collectionId,\n getOptimisticActions,\n }),\n [getSchema, collectionId, getOptimisticActions, baseSDK],\n );\n\n /* eslint-enable react-hooks/exhaustive-deps */\n\n return sdk;\n};\n"],"mappings":"AAAA,SAASA,OAAO,QAAQ,OAAO;AAC/B,SAASC,iBAAiB,QAAQ,cAAc;AAEhD,SAASC,UAAU,QAAQ,cAAc;AACzC,SAASC,2BAA2B,QAAQ,uCAAuC;
|
|
1
|
+
{"version":3,"names":["useMemo","useSchemaRegistry","useBaseSDK","useOptimisticActionsContext","useAppContext","useActionsSDK","_ref","collectionId","getSchema","getOptimisticActions","refreshCollection","baseSDK","sdk"],"sources":["../../../src/hooks/useActionsSDK.ts"],"sourcesContent":["import { useMemo } from 'react';\nimport { useSchemaRegistry } from '../providers';\nimport { ActionsSDK } from '../utils/actions/types';\nimport { useBaseSDK } from './useBaseSDK';\nimport { useOptimisticActionsContext } from '../providers/OptimisticActionsContext';\nimport { useAppContext } from '../providers/AppContext';\n\nexport interface ActionsSDKParams {\n collectionId: string;\n}\n\nexport const useActionsSDK = ({ collectionId }: ActionsSDKParams) => {\n const { getSchema } = useSchemaRegistry();\n\n const { getOptimisticActions } = useOptimisticActionsContext();\n\n const { refreshCollection } = useAppContext();\n\n const baseSDK = useBaseSDK();\n /* eslint-disable react-hooks/exhaustive-deps */\n // disabled because bug in Patterns that navigateToEntityPage isn't wrapped with useCallback,\n const sdk = useMemo<ActionsSDK>(\n () => ({\n ...baseSDK, // TODO: Why spread and not sdk.app/base.openModal ... instead\n getSchema,\n collectionId,\n getOptimisticActions,\n refreshCollection,\n }),\n [getSchema, collectionId, getOptimisticActions, baseSDK, refreshCollection],\n );\n\n /* eslint-enable react-hooks/exhaustive-deps */\n\n return sdk;\n};\n"],"mappings":"AAAA,SAASA,OAAO,QAAQ,OAAO;AAC/B,SAASC,iBAAiB,QAAQ,cAAc;AAEhD,SAASC,UAAU,QAAQ,cAAc;AACzC,SAASC,2BAA2B,QAAQ,uCAAuC;AACnF,SAASC,aAAa,QAAQ,yBAAyB;AAMvD,OAAO,MAAMC,aAAa,GAAGC,IAAA,IAAwC;EAAA,IAAvC;IAAEC;EAA+B,CAAC,GAAAD,IAAA;EAC9D,MAAM;IAAEE;EAAU,CAAC,GAAGP,iBAAiB,CAAC,CAAC;EAEzC,MAAM;IAAEQ;EAAqB,CAAC,GAAGN,2BAA2B,CAAC,CAAC;EAE9D,MAAM;IAAEO;EAAkB,CAAC,GAAGN,aAAa,CAAC,CAAC;EAE7C,MAAMO,OAAO,GAAGT,UAAU,CAAC,CAAC;EAC5B;EACA;EACA,MAAMU,GAAG,GAAGZ,OAAO,CACjB,OAAO;IACL,GAAGW,OAAO;IAAE;IACZH,SAAS;IACTD,YAAY;IACZE,oBAAoB;IACpBC;EACF,CAAC,CAAC,EACF,CAACF,SAAS,EAAED,YAAY,EAAEE,oBAAoB,EAAEE,OAAO,EAAED,iBAAiB,CAC5E,CAAC;;EAED;;EAEA,OAAOE,GAAG;AACZ,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { useEffect } from 'react';
|
|
2
|
+
import { useAppContextData } from '../providers/AppContextData';
|
|
3
|
+
export const useAppContextSync = (items, refreshCollection) => {
|
|
4
|
+
const {
|
|
5
|
+
setItems,
|
|
6
|
+
setRefreshCollection
|
|
7
|
+
} = useAppContextData();
|
|
8
|
+
useEffect(() => {
|
|
9
|
+
if (items) {
|
|
10
|
+
setItems(items);
|
|
11
|
+
}
|
|
12
|
+
}, [items, setItems]);
|
|
13
|
+
useEffect(() => {
|
|
14
|
+
if (refreshCollection) {
|
|
15
|
+
setRefreshCollection(refreshCollection);
|
|
16
|
+
}
|
|
17
|
+
}, [refreshCollection, setRefreshCollection]);
|
|
18
|
+
};
|
|
19
|
+
//# sourceMappingURL=useAppContextSync.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["useEffect","useAppContextData","useAppContextSync","items","refreshCollection","setItems","setRefreshCollection"],"sources":["../../../src/hooks/useAppContextSync.ts"],"sourcesContent":["import { useEffect } from 'react';\nimport { useAppContextData } from '../providers/AppContextData';\n\nexport const useAppContextSync = (\n items: any[],\n refreshCollection: () => void,\n) => {\n const { setItems, setRefreshCollection } = useAppContextData();\n\n useEffect(() => {\n if (items) {\n setItems(items);\n }\n }, [items, setItems]);\n\n useEffect(() => {\n if (refreshCollection) {\n setRefreshCollection(refreshCollection);\n }\n }, [refreshCollection, setRefreshCollection]);\n};\n"],"mappings":"AAAA,SAASA,SAAS,QAAQ,OAAO;AACjC,SAASC,iBAAiB,QAAQ,6BAA6B;AAE/D,OAAO,MAAMC,iBAAiB,GAAGA,CAC/BC,KAAY,EACZC,iBAA6B,KAC1B;EACH,MAAM;IAAEC,QAAQ;IAAEC;EAAqB,CAAC,GAAGL,iBAAiB,CAAC,CAAC;EAE9DD,SAAS,CAAC,MAAM;IACd,IAAIG,KAAK,EAAE;MACTE,QAAQ,CAACF,KAAK,CAAC;IACjB;EACF,CAAC,EAAE,CAACA,KAAK,EAAEE,QAAQ,CAAC,CAAC;EAErBL,SAAS,CAAC,MAAM;IACd,IAAII,iBAAiB,EAAE;MACrBE,oBAAoB,CAACF,iBAAiB,CAAC;IACzC;EACF,CAAC,EAAE,CAACA,iBAAiB,EAAEE,oBAAoB,CAAC,CAAC;AAC/C,CAAC","ignoreList":[]}
|
|
@@ -4,7 +4,8 @@ import { useCommonCollectionFeatures } from './useCommonCollectionFeatures';
|
|
|
4
4
|
import { useFilters } from './useFilters';
|
|
5
5
|
import { useBaseGridFeatures } from './useBaseGridFeatures';
|
|
6
6
|
import { useBaseCollectionParams } from './useBaseCollectionParams';
|
|
7
|
-
import {
|
|
7
|
+
import { useAppContextSync } from './useAppContextSync';
|
|
8
|
+
import { useCallback } from 'react';
|
|
8
9
|
export const useGridFeatures = configuration => {
|
|
9
10
|
const {
|
|
10
11
|
renderItem,
|
|
@@ -30,7 +31,14 @@ export const useGridFeatures = configuration => {
|
|
|
30
31
|
});
|
|
31
32
|
const state = useGridCollection(params);
|
|
32
33
|
const items = useSelector(() => state.collection.result.items);
|
|
33
|
-
|
|
34
|
+
const refreshCollection = useCallback(() => {
|
|
35
|
+
return () => {
|
|
36
|
+
return state.collection.clearResultAndMoveToStart({
|
|
37
|
+
force: true
|
|
38
|
+
});
|
|
39
|
+
};
|
|
40
|
+
}, [state.collection]);
|
|
41
|
+
useAppContextSync(items, refreshCollection);
|
|
34
42
|
const commonFeatures = useCommonCollectionFeatures({
|
|
35
43
|
...configuration,
|
|
36
44
|
collectionState: state.collection
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useFetchData","useGridCollection","useSelector","useCommonCollectionFeatures","useFilters","useBaseGridFeatures","useBaseCollectionParams","
|
|
1
|
+
{"version":3,"names":["useFetchData","useGridCollection","useSelector","useCommonCollectionFeatures","useFilters","useBaseGridFeatures","useBaseCollectionParams","useAppContextSync","useCallback","useGridFeatures","configuration","renderItem","imagePlacement","preset","visibleFieldIds","filterComponent","filtersObject","filterFieldMapping","filters","fetchData","searchableFieldIds","params","config","collection","state","items","result","refreshCollection","clearResultAndMoveToStart","force","commonFeatures","collectionState"],"sources":["../../../src/hooks/useGridFeatures.tsx"],"sourcesContent":["import { GridConfig } from '../types';\nimport { useFetchData } from './useFetchData';\nimport { useGridCollection, useSelector } from '@wix/patterns';\nimport { useCommonCollectionFeatures } from './useCommonCollectionFeatures';\nimport { useFilters } from './useFilters';\nimport { useBaseGridFeatures } from './useBaseGridFeatures';\nimport { useBaseCollectionParams } from './useBaseCollectionParams';\nimport { useAppContextSync } from './useAppContextSync';\nimport { useCallback } from 'react';\n\nexport const useGridFeatures = (configuration: GridConfig) => {\n const { renderItem, imagePlacement, preset, visibleFieldIds } =\n useBaseGridFeatures(configuration);\n\n const { filterComponent, filtersObject, filterFieldMapping } = useFilters(\n configuration.filters,\n );\n\n const { fetchData } = useFetchData({\n searchableFieldIds: visibleFieldIds,\n filterFieldMapping,\n });\n\n const params = useBaseCollectionParams({\n config: configuration.collection,\n fetchData,\n filters: filtersObject,\n });\n\n const state = useGridCollection<any>(params);\n const items = useSelector(() => state.collection.result.items);\n\n const refreshCollection = useCallback(() => {\n return () => {\n return state.collection.clearResultAndMoveToStart({ force: true });\n };\n }, [state.collection]);\n\n useAppContextSync(items, refreshCollection);\n\n const commonFeatures = useCommonCollectionFeatures({\n ...configuration,\n collectionState: state.collection,\n });\n\n return {\n ...commonFeatures,\n state,\n imagePlacement,\n preset,\n renderItem,\n filters: filterComponent,\n };\n};\n"],"mappings":"AACA,SAASA,YAAY,QAAQ,gBAAgB;AAC7C,SAASC,iBAAiB,EAAEC,WAAW,QAAQ,eAAe;AAC9D,SAASC,2BAA2B,QAAQ,+BAA+B;AAC3E,SAASC,UAAU,QAAQ,cAAc;AACzC,SAASC,mBAAmB,QAAQ,uBAAuB;AAC3D,SAASC,uBAAuB,QAAQ,2BAA2B;AACnE,SAASC,iBAAiB,QAAQ,qBAAqB;AACvD,SAASC,WAAW,QAAQ,OAAO;AAEnC,OAAO,MAAMC,eAAe,GAAIC,aAAyB,IAAK;EAC5D,MAAM;IAAEC,UAAU;IAAEC,cAAc;IAAEC,MAAM;IAAEC;EAAgB,CAAC,GAC3DT,mBAAmB,CAACK,aAAa,CAAC;EAEpC,MAAM;IAAEK,eAAe;IAAEC,aAAa;IAAEC;EAAmB,CAAC,GAAGb,UAAU,CACvEM,aAAa,CAACQ,OAChB,CAAC;EAED,MAAM;IAAEC;EAAU,CAAC,GAAGnB,YAAY,CAAC;IACjCoB,kBAAkB,EAAEN,eAAe;IACnCG;EACF,CAAC,CAAC;EAEF,MAAMI,MAAM,GAAGf,uBAAuB,CAAC;IACrCgB,MAAM,EAAEZ,aAAa,CAACa,UAAU;IAChCJ,SAAS;IACTD,OAAO,EAAEF;EACX,CAAC,CAAC;EAEF,MAAMQ,KAAK,GAAGvB,iBAAiB,CAAMoB,MAAM,CAAC;EAC5C,MAAMI,KAAK,GAAGvB,WAAW,CAAC,MAAMsB,KAAK,CAACD,UAAU,CAACG,MAAM,CAACD,KAAK,CAAC;EAE9D,MAAME,iBAAiB,GAAGnB,WAAW,CAAC,MAAM;IAC1C,OAAO,MAAM;MACX,OAAOgB,KAAK,CAACD,UAAU,CAACK,yBAAyB,CAAC;QAAEC,KAAK,EAAE;MAAK,CAAC,CAAC;IACpE,CAAC;EACH,CAAC,EAAE,CAACL,KAAK,CAACD,UAAU,CAAC,CAAC;EAEtBhB,iBAAiB,CAACkB,KAAK,EAAEE,iBAAiB,CAAC;EAE3C,MAAMG,cAAc,GAAG3B,2BAA2B,CAAC;IACjD,GAAGO,aAAa;IAChBqB,eAAe,EAAEP,KAAK,CAACD;EACzB,CAAC,CAAC;EAEF,OAAO;IACL,GAAGO,cAAc;IACjBN,KAAK;IACLZ,cAAc;IACdC,MAAM;IACNF,UAAU;IACVO,OAAO,EAAEH;EACX,CAAC;AACH,CAAC","ignoreList":[]}
|
|
@@ -5,7 +5,8 @@ import { useFilters } from './useFilters';
|
|
|
5
5
|
import { useBaseTableFeatures } from './useBaseTableFeatures';
|
|
6
6
|
import { useAutoPatternsOverridesContext } from '../providers/AutoPatternsOverridesContext';
|
|
7
7
|
import { useBaseCollectionParams } from './useBaseCollectionParams';
|
|
8
|
-
import {
|
|
8
|
+
import { useAppContextSync } from './useAppContextSync';
|
|
9
|
+
import { useCallback } from 'react';
|
|
9
10
|
export const useTableFeatures = configuration => {
|
|
10
11
|
var _configuration$sectio, _overrides$sections;
|
|
11
12
|
const {
|
|
@@ -36,7 +37,14 @@ export const useTableFeatures = configuration => {
|
|
|
36
37
|
});
|
|
37
38
|
const state = useTableCollection(params);
|
|
38
39
|
const items = useSelector(() => state.collection.result.items);
|
|
39
|
-
|
|
40
|
+
const refreshCollection = useCallback(() => {
|
|
41
|
+
return () => {
|
|
42
|
+
return state.collection.clearResultAndMoveToStart({
|
|
43
|
+
force: true
|
|
44
|
+
});
|
|
45
|
+
};
|
|
46
|
+
}, [state.collection]);
|
|
47
|
+
useAppContextSync(items, refreshCollection);
|
|
40
48
|
const commonFeatures = useCommonCollectionFeatures({
|
|
41
49
|
...configuration,
|
|
42
50
|
collectionState: state.collection
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useFetchData","TableSections","useSelector","useTableCollection","useCommonCollectionFeatures","useFilters","useBaseTableFeatures","useAutoPatternsOverridesContext","useBaseCollectionParams","
|
|
1
|
+
{"version":3,"names":["useFetchData","TableSections","useSelector","useTableCollection","useCommonCollectionFeatures","useFilters","useBaseTableFeatures","useAutoPatternsOverridesContext","useBaseCollectionParams","useAppContextSync","useCallback","useTableFeatures","configuration","_configuration$sectio","_overrides$sections","filterComponent","filtersObject","filterFieldMapping","filters","customColumns","visibleFieldIds","columns","onRowClick","stickyColumns","stickySelectionColumn","showTitleBar","fetchData","searchableFieldIds","overrides","params","config","collection","state","items","result","refreshCollection","clearResultAndMoveToStart","force","commonFeatures","collectionState","sections","id","renderSection","undefined"],"sources":["../../../src/hooks/useTableFeatures.tsx"],"sourcesContent":["import { TableConfig } from '../types';\nimport { useFetchData } from './useFetchData';\nimport { TableSections, useSelector, useTableCollection } from '@wix/patterns';\nimport { useCommonCollectionFeatures } from './useCommonCollectionFeatures';\nimport { useFilters } from './useFilters';\nimport { useBaseTableFeatures } from './useBaseTableFeatures';\nimport { useAutoPatternsOverridesContext } from '../providers/AutoPatternsOverridesContext';\nimport { useBaseCollectionParams } from './useBaseCollectionParams';\nimport { useAppContextSync } from './useAppContextSync';\nimport { useCallback } from 'react';\n\nexport const useTableFeatures = (configuration: TableConfig) => {\n const { filterComponent, filtersObject, filterFieldMapping } = useFilters(\n configuration.filters,\n );\n const {\n customColumns,\n visibleFieldIds,\n columns,\n onRowClick,\n stickyColumns,\n stickySelectionColumn,\n showTitleBar,\n } = useBaseTableFeatures(configuration);\n\n const { fetchData } = useFetchData({\n searchableFieldIds: visibleFieldIds,\n filterFieldMapping,\n });\n\n const overrides = useAutoPatternsOverridesContext();\n\n const params = useBaseCollectionParams({\n config: configuration.collection,\n fetchData,\n filters: filtersObject,\n });\n\n const state = useTableCollection<any>(params);\n const items = useSelector(() => state.collection.result.items);\n\n const refreshCollection = useCallback(() => {\n return () => {\n return state.collection.clearResultAndMoveToStart({ force: true });\n };\n }, [state.collection]);\n\n useAppContextSync(items, refreshCollection);\n\n const commonFeatures = useCommonCollectionFeatures({\n ...configuration,\n collectionState: state.collection,\n });\n\n const sections =\n configuration.sections?.id &&\n overrides?.sections?.[configuration.sections.id]\n ? {\n renderSection: overrides.sections[configuration.sections.id],\n TableSections,\n }\n : undefined;\n\n return {\n ...commonFeatures,\n state,\n columns,\n filters: filterComponent,\n customColumns,\n onRowClick,\n stickyColumns,\n stickySelectionColumn,\n showTitleBar,\n sections,\n };\n};\n"],"mappings":"AACA,SAASA,YAAY,QAAQ,gBAAgB;AAC7C,SAASC,aAAa,EAAEC,WAAW,EAAEC,kBAAkB,QAAQ,eAAe;AAC9E,SAASC,2BAA2B,QAAQ,+BAA+B;AAC3E,SAASC,UAAU,QAAQ,cAAc;AACzC,SAASC,oBAAoB,QAAQ,wBAAwB;AAC7D,SAASC,+BAA+B,QAAQ,2CAA2C;AAC3F,SAASC,uBAAuB,QAAQ,2BAA2B;AACnE,SAASC,iBAAiB,QAAQ,qBAAqB;AACvD,SAASC,WAAW,QAAQ,OAAO;AAEnC,OAAO,MAAMC,gBAAgB,GAAIC,aAA0B,IAAK;EAAA,IAAAC,qBAAA,EAAAC,mBAAA;EAC9D,MAAM;IAAEC,eAAe;IAAEC,aAAa;IAAEC;EAAmB,CAAC,GAAGZ,UAAU,CACvEO,aAAa,CAACM,OAChB,CAAC;EACD,MAAM;IACJC,aAAa;IACbC,eAAe;IACfC,OAAO;IACPC,UAAU;IACVC,aAAa;IACbC,qBAAqB;IACrBC;EACF,CAAC,GAAGnB,oBAAoB,CAACM,aAAa,CAAC;EAEvC,MAAM;IAAEc;EAAU,CAAC,GAAG1B,YAAY,CAAC;IACjC2B,kBAAkB,EAAEP,eAAe;IACnCH;EACF,CAAC,CAAC;EAEF,MAAMW,SAAS,GAAGrB,+BAA+B,CAAC,CAAC;EAEnD,MAAMsB,MAAM,GAAGrB,uBAAuB,CAAC;IACrCsB,MAAM,EAAElB,aAAa,CAACmB,UAAU;IAChCL,SAAS;IACTR,OAAO,EAAEF;EACX,CAAC,CAAC;EAEF,MAAMgB,KAAK,GAAG7B,kBAAkB,CAAM0B,MAAM,CAAC;EAC7C,MAAMI,KAAK,GAAG/B,WAAW,CAAC,MAAM8B,KAAK,CAACD,UAAU,CAACG,MAAM,CAACD,KAAK,CAAC;EAE9D,MAAME,iBAAiB,GAAGzB,WAAW,CAAC,MAAM;IAC1C,OAAO,MAAM;MACX,OAAOsB,KAAK,CAACD,UAAU,CAACK,yBAAyB,CAAC;QAAEC,KAAK,EAAE;MAAK,CAAC,CAAC;IACpE,CAAC;EACH,CAAC,EAAE,CAACL,KAAK,CAACD,UAAU,CAAC,CAAC;EAEtBtB,iBAAiB,CAACwB,KAAK,EAAEE,iBAAiB,CAAC;EAE3C,MAAMG,cAAc,GAAGlC,2BAA2B,CAAC;IACjD,GAAGQ,aAAa;IAChB2B,eAAe,EAAEP,KAAK,CAACD;EACzB,CAAC,CAAC;EAEF,MAAMS,QAAQ,GACZ,CAAA3B,qBAAA,GAAAD,aAAa,CAAC4B,QAAQ,aAAtB3B,qBAAA,CAAwB4B,EAAE,IAC1Bb,SAAS,aAAAd,mBAAA,GAATc,SAAS,CAAEY,QAAQ,aAAnB1B,mBAAA,CAAsBF,aAAa,CAAC4B,QAAQ,CAACC,EAAE,CAAC,GAC5C;IACEC,aAAa,EAAEd,SAAS,CAACY,QAAQ,CAAC5B,aAAa,CAAC4B,QAAQ,CAACC,EAAE,CAAC;IAC5DxC;EACF,CAAC,GACD0C,SAAS;EAEf,OAAO;IACL,GAAGL,cAAc;IACjBN,KAAK;IACLX,OAAO;IACPH,OAAO,EAAEH,eAAe;IACxBI,aAAa;IACbG,UAAU;IACVC,aAAa;IACbC,qBAAqB;IACrBC,YAAY;IACZe;EACF,CAAC;AACH,CAAC","ignoreList":[]}
|
|
@@ -5,7 +5,8 @@ import { useFilters } from './useFilters';
|
|
|
5
5
|
import { useBaseGridFeatures } from './useBaseGridFeatures';
|
|
6
6
|
import { useBaseTableFeatures } from './useBaseTableFeatures';
|
|
7
7
|
import { useBaseCollectionParams } from './useBaseCollectionParams';
|
|
8
|
-
import {
|
|
8
|
+
import { useAppContextSync } from './useAppContextSync';
|
|
9
|
+
import { useCallback } from 'react';
|
|
9
10
|
export const useTableGridSwitchFeatures = config => {
|
|
10
11
|
const {
|
|
11
12
|
filterComponent,
|
|
@@ -40,7 +41,14 @@ export const useTableGridSwitchFeatures = config => {
|
|
|
40
41
|
});
|
|
41
42
|
const state = useTableGridSwitchCollection(params);
|
|
42
43
|
const items = useSelector(() => state.collection.result.items);
|
|
43
|
-
|
|
44
|
+
const refreshCollection = useCallback(() => {
|
|
45
|
+
return () => {
|
|
46
|
+
return state.collection.clearResultAndMoveToStart({
|
|
47
|
+
force: true
|
|
48
|
+
});
|
|
49
|
+
};
|
|
50
|
+
}, [state.collection]);
|
|
51
|
+
useAppContextSync(items, refreshCollection);
|
|
44
52
|
const commonFeatures = useCommonCollectionFeatures({
|
|
45
53
|
...config,
|
|
46
54
|
collectionState: state.collection
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useFetchData","useSelector","useTableGridSwitchCollection","useCommonCollectionFeatures","useFilters","useBaseGridFeatures","useBaseTableFeatures","useBaseCollectionParams","
|
|
1
|
+
{"version":3,"names":["useFetchData","useSelector","useTableGridSwitchCollection","useCommonCollectionFeatures","useFilters","useBaseGridFeatures","useBaseTableFeatures","useBaseCollectionParams","useAppContextSync","useCallback","useTableGridSwitchFeatures","config","filterComponent","filtersObject","filterFieldMapping","filters","preset","imagePlacement","visibleFieldIds","gridVisibleFieldIds","renderItem","customColumns","tableVisibleFieldIds","columns","tableColumns","onRowClick","stickyColumns","stickySelectionColumn","showTitleBar","fetchData","searchableFieldIds","Array","from","Set","params","collection","state","items","result","refreshCollection","clearResultAndMoveToStart","force","commonFeatures","collectionState","horizontalScroll"],"sources":["../../../src/hooks/useTableGridSwitchFeatures.tsx"],"sourcesContent":["import { TableGridSwitchConfig } from '../types';\nimport { useFetchData } from './useFetchData';\nimport { useSelector, useTableGridSwitchCollection } from '@wix/patterns';\nimport { useCommonCollectionFeatures } from './useCommonCollectionFeatures';\nimport { useFilters } from './useFilters';\nimport { useBaseGridFeatures } from './useBaseGridFeatures';\nimport { useBaseTableFeatures } from './useBaseTableFeatures';\nimport { useBaseCollectionParams } from './useBaseCollectionParams';\nimport { useAppContextSync } from './useAppContextSync';\nimport { useCallback } from 'react';\n\nexport const useTableGridSwitchFeatures = (config: TableGridSwitchConfig) => {\n const { filterComponent, filtersObject, filterFieldMapping } = useFilters(\n config.filters,\n );\n\n const {\n preset,\n imagePlacement,\n visibleFieldIds: gridVisibleFieldIds,\n renderItem,\n } = useBaseGridFeatures(config);\n\n const {\n customColumns,\n visibleFieldIds: tableVisibleFieldIds,\n columns: tableColumns,\n onRowClick,\n stickyColumns,\n stickySelectionColumn,\n showTitleBar,\n } = useBaseTableFeatures(config);\n\n const { fetchData } = useFetchData({\n searchableFieldIds: Array.from(\n new Set([...tableVisibleFieldIds, ...gridVisibleFieldIds]),\n ),\n filterFieldMapping,\n });\n\n const params = useBaseCollectionParams({\n config: config.collection,\n fetchData,\n filters: filtersObject,\n });\n\n const state = useTableGridSwitchCollection<any>(params);\n const items = useSelector(() => state.collection.result.items);\n\n const refreshCollection = useCallback(() => {\n return () => {\n return state.collection.clearResultAndMoveToStart({ force: true });\n };\n }, [state.collection]);\n\n useAppContextSync(items, refreshCollection);\n\n const commonFeatures = useCommonCollectionFeatures({\n ...config,\n collectionState: state.collection,\n });\n\n return {\n ...commonFeatures,\n state,\n columns: tableColumns,\n filters: filterComponent,\n customColumns,\n onRowClick,\n stickyColumns,\n stickySelectionColumn,\n horizontalScroll: true,\n // Grid specific features\n imagePlacement,\n preset,\n renderItem,\n showTitleBar,\n };\n};\n"],"mappings":"AACA,SAASA,YAAY,QAAQ,gBAAgB;AAC7C,SAASC,WAAW,EAAEC,4BAA4B,QAAQ,eAAe;AACzE,SAASC,2BAA2B,QAAQ,+BAA+B;AAC3E,SAASC,UAAU,QAAQ,cAAc;AACzC,SAASC,mBAAmB,QAAQ,uBAAuB;AAC3D,SAASC,oBAAoB,QAAQ,wBAAwB;AAC7D,SAASC,uBAAuB,QAAQ,2BAA2B;AACnE,SAASC,iBAAiB,QAAQ,qBAAqB;AACvD,SAASC,WAAW,QAAQ,OAAO;AAEnC,OAAO,MAAMC,0BAA0B,GAAIC,MAA6B,IAAK;EAC3E,MAAM;IAAEC,eAAe;IAAEC,aAAa;IAAEC;EAAmB,CAAC,GAAGV,UAAU,CACvEO,MAAM,CAACI,OACT,CAAC;EAED,MAAM;IACJC,MAAM;IACNC,cAAc;IACdC,eAAe,EAAEC,mBAAmB;IACpCC;EACF,CAAC,GAAGf,mBAAmB,CAACM,MAAM,CAAC;EAE/B,MAAM;IACJU,aAAa;IACbH,eAAe,EAAEI,oBAAoB;IACrCC,OAAO,EAAEC,YAAY;IACrBC,UAAU;IACVC,aAAa;IACbC,qBAAqB;IACrBC;EACF,CAAC,GAAGtB,oBAAoB,CAACK,MAAM,CAAC;EAEhC,MAAM;IAAEkB;EAAU,CAAC,GAAG7B,YAAY,CAAC;IACjC8B,kBAAkB,EAAEC,KAAK,CAACC,IAAI,CAC5B,IAAIC,GAAG,CAAC,CAAC,GAAGX,oBAAoB,EAAE,GAAGH,mBAAmB,CAAC,CAC3D,CAAC;IACDL;EACF,CAAC,CAAC;EAEF,MAAMoB,MAAM,GAAG3B,uBAAuB,CAAC;IACrCI,MAAM,EAAEA,MAAM,CAACwB,UAAU;IACzBN,SAAS;IACTd,OAAO,EAAEF;EACX,CAAC,CAAC;EAEF,MAAMuB,KAAK,GAAGlC,4BAA4B,CAAMgC,MAAM,CAAC;EACvD,MAAMG,KAAK,GAAGpC,WAAW,CAAC,MAAMmC,KAAK,CAACD,UAAU,CAACG,MAAM,CAACD,KAAK,CAAC;EAE9D,MAAME,iBAAiB,GAAG9B,WAAW,CAAC,MAAM;IAC1C,OAAO,MAAM;MACX,OAAO2B,KAAK,CAACD,UAAU,CAACK,yBAAyB,CAAC;QAAEC,KAAK,EAAE;MAAK,CAAC,CAAC;IACpE,CAAC;EACH,CAAC,EAAE,CAACL,KAAK,CAACD,UAAU,CAAC,CAAC;EAEtB3B,iBAAiB,CAAC6B,KAAK,EAAEE,iBAAiB,CAAC;EAE3C,MAAMG,cAAc,GAAGvC,2BAA2B,CAAC;IACjD,GAAGQ,MAAM;IACTgC,eAAe,EAAEP,KAAK,CAACD;EACzB,CAAC,CAAC;EAEF,OAAO;IACL,GAAGO,cAAc;IACjBN,KAAK;IACLb,OAAO,EAAEC,YAAY;IACrBT,OAAO,EAAEH,eAAe;IACxBS,aAAa;IACbI,UAAU;IACVC,aAAa;IACbC,qBAAqB;IACrBiB,gBAAgB,EAAE,IAAI;IACtB;IACA3B,cAAc;IACdD,MAAM;IACNI,UAAU;IACVQ;EACF,CAAC;AACH,CAAC","ignoreList":[]}
|
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
import React, { createContext, useContext } from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { AppContextDataProvider, useAppContextData } from './AppContextData';
|
|
3
3
|
const AppContext = /*#__PURE__*/createContext(undefined);
|
|
4
4
|
const AppContextInner = _ref => {
|
|
5
5
|
let {
|
|
6
6
|
children
|
|
7
7
|
} = _ref;
|
|
8
8
|
const {
|
|
9
|
-
items
|
|
10
|
-
|
|
9
|
+
items,
|
|
10
|
+
refreshCollection
|
|
11
|
+
} = useAppContextData();
|
|
11
12
|
const contextValue = {
|
|
12
|
-
items
|
|
13
|
+
items,
|
|
14
|
+
refreshCollection
|
|
13
15
|
};
|
|
14
16
|
return /*#__PURE__*/React.createElement(AppContext.Provider, {
|
|
15
17
|
value: contextValue
|
|
@@ -19,7 +21,7 @@ export const AppContextProvider = _ref2 => {
|
|
|
19
21
|
let {
|
|
20
22
|
children
|
|
21
23
|
} = _ref2;
|
|
22
|
-
return /*#__PURE__*/React.createElement(
|
|
24
|
+
return /*#__PURE__*/React.createElement(AppContextDataProvider, null, /*#__PURE__*/React.createElement(AppContextInner, null, children));
|
|
23
25
|
};
|
|
24
26
|
export const useAppContext = () => {
|
|
25
27
|
const context = useContext(AppContext);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","createContext","useContext","
|
|
1
|
+
{"version":3,"names":["React","createContext","useContext","AppContextDataProvider","useAppContextData","AppContext","undefined","AppContextInner","_ref","children","items","refreshCollection","contextValue","createElement","Provider","value","AppContextProvider","_ref2","useAppContext","context","Error"],"sources":["../../../src/providers/AppContext.tsx"],"sourcesContent":["import React, { ReactNode, createContext, useContext } from 'react';\nimport {\n AppContextDataProvider,\n AppContextDataValue,\n useAppContextData,\n} from './AppContextData';\n\ninterface AppContextValue\n extends Pick<AppContextDataValue, 'items' | 'refreshCollection'> {}\n\nconst AppContext = createContext<AppContextValue | undefined>(undefined);\n\nexport interface AppContextProviderProps {\n children: ReactNode;\n}\n\nconst AppContextInner: React.FC<AppContextProviderProps> = ({ children }) => {\n const { items, refreshCollection } = useAppContextData();\n\n const contextValue: AppContextValue = {\n items,\n refreshCollection,\n };\n\n return (\n <AppContext.Provider value={contextValue}>{children}</AppContext.Provider>\n );\n};\n\nexport const AppContextProvider: React.FC<AppContextProviderProps> = ({\n children,\n}) => {\n return (\n <AppContextDataProvider>\n <AppContextInner>{children}</AppContextInner>\n </AppContextDataProvider>\n );\n};\n\nexport const useAppContext = (): AppContextValue => {\n const context = useContext(AppContext);\n\n if (context === undefined) {\n throw new Error('useAppContext must be used within an AppContextProvider');\n }\n\n return context;\n};\n"],"mappings":"AAAA,OAAOA,KAAK,IAAeC,aAAa,EAAEC,UAAU,QAAQ,OAAO;AACnE,SACEC,sBAAsB,EAEtBC,iBAAiB,QACZ,kBAAkB;AAKzB,MAAMC,UAAU,gBAAGJ,aAAa,CAA8BK,SAAS,CAAC;AAMxE,MAAMC,eAAkD,GAAGC,IAAA,IAAkB;EAAA,IAAjB;IAAEC;EAAS,CAAC,GAAAD,IAAA;EACtE,MAAM;IAAEE,KAAK;IAAEC;EAAkB,CAAC,GAAGP,iBAAiB,CAAC,CAAC;EAExD,MAAMQ,YAA6B,GAAG;IACpCF,KAAK;IACLC;EACF,CAAC;EAED,oBACEX,KAAA,CAAAa,aAAA,CAACR,UAAU,CAACS,QAAQ;IAACC,KAAK,EAAEH;EAAa,GAAEH,QAA8B,CAAC;AAE9E,CAAC;AAED,OAAO,MAAMO,kBAAqD,GAAGC,KAAA,IAE/D;EAAA,IAFgE;IACpER;EACF,CAAC,GAAAQ,KAAA;EACC,oBACEjB,KAAA,CAAAa,aAAA,CAACV,sBAAsB,qBACrBH,KAAA,CAAAa,aAAA,CAACN,eAAe,QAAEE,QAA0B,CACtB,CAAC;AAE7B,CAAC;AAED,OAAO,MAAMS,aAAa,GAAGA,CAAA,KAAuB;EAClD,MAAMC,OAAO,GAAGjB,UAAU,CAACG,UAAU,CAAC;EAEtC,IAAIc,OAAO,KAAKb,SAAS,EAAE;IACzB,MAAM,IAAIc,KAAK,CAAC,yDAAyD,CAAC;EAC5E;EAEA,OAAOD,OAAO;AAChB,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import React, { createContext, useContext, useState } from 'react';
|
|
2
|
+
const AppContextDataContext = /*#__PURE__*/createContext(undefined);
|
|
3
|
+
export const AppContextDataProvider = _ref => {
|
|
4
|
+
let {
|
|
5
|
+
children
|
|
6
|
+
} = _ref;
|
|
7
|
+
const [items, setItems] = useState([]);
|
|
8
|
+
const [refreshCollection, setRefreshCollection] = useState(() => {});
|
|
9
|
+
const contextValue = {
|
|
10
|
+
items,
|
|
11
|
+
setItems,
|
|
12
|
+
refreshCollection,
|
|
13
|
+
setRefreshCollection
|
|
14
|
+
};
|
|
15
|
+
return /*#__PURE__*/React.createElement(AppContextDataContext.Provider, {
|
|
16
|
+
value: contextValue
|
|
17
|
+
}, children);
|
|
18
|
+
};
|
|
19
|
+
export const useAppContextData = () => {
|
|
20
|
+
const context = useContext(AppContextDataContext);
|
|
21
|
+
if (context === undefined) {
|
|
22
|
+
throw new Error('useAppContextData must be used within an AppContextDataProvider');
|
|
23
|
+
}
|
|
24
|
+
return context;
|
|
25
|
+
};
|
|
26
|
+
//# sourceMappingURL=AppContextData.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","createContext","useContext","useState","AppContextDataContext","undefined","AppContextDataProvider","_ref","children","items","setItems","refreshCollection","setRefreshCollection","contextValue","createElement","Provider","value","useAppContextData","context","Error"],"sources":["../../../src/providers/AppContextData.tsx"],"sourcesContent":["import React, { ReactNode, createContext, useContext, useState } from 'react';\n\nexport interface AppContextDataValue {\n items: any[];\n setItems: (items: any[]) => void;\n refreshCollection: () => void;\n setRefreshCollection: (refreshFn: () => void) => void;\n}\n\nconst AppContextDataContext = createContext<AppContextDataValue | undefined>(\n undefined,\n);\n\nexport interface AppContextDataProviderProps {\n children: ReactNode;\n}\n\nexport const AppContextDataProvider: React.FC<AppContextDataProviderProps> = ({\n children,\n}) => {\n const [items, setItems] = useState<any[]>([]);\n const [refreshCollection, setRefreshCollection] = useState<() => void>(\n () => {},\n );\n\n const contextValue: AppContextDataValue = {\n items,\n setItems,\n refreshCollection,\n setRefreshCollection,\n };\n\n return (\n <AppContextDataContext.Provider value={contextValue}>\n {children}\n </AppContextDataContext.Provider>\n );\n};\n\nexport const useAppContextData = (): AppContextDataValue => {\n const context = useContext(AppContextDataContext);\n\n if (context === undefined) {\n throw new Error(\n 'useAppContextData must be used within an AppContextDataProvider',\n );\n }\n\n return context;\n};\n"],"mappings":"AAAA,OAAOA,KAAK,IAAeC,aAAa,EAAEC,UAAU,EAAEC,QAAQ,QAAQ,OAAO;AAS7E,MAAMC,qBAAqB,gBAAGH,aAAa,CACzCI,SACF,CAAC;AAMD,OAAO,MAAMC,sBAA6D,GAAGC,IAAA,IAEvE;EAAA,IAFwE;IAC5EC;EACF,CAAC,GAAAD,IAAA;EACC,MAAM,CAACE,KAAK,EAAEC,QAAQ,CAAC,GAAGP,QAAQ,CAAQ,EAAE,CAAC;EAC7C,MAAM,CAACQ,iBAAiB,EAAEC,oBAAoB,CAAC,GAAGT,QAAQ,CACxD,MAAM,CAAC,CACT,CAAC;EAED,MAAMU,YAAiC,GAAG;IACxCJ,KAAK;IACLC,QAAQ;IACRC,iBAAiB;IACjBC;EACF,CAAC;EAED,oBACEZ,KAAA,CAAAc,aAAA,CAACV,qBAAqB,CAACW,QAAQ;IAACC,KAAK,EAAEH;EAAa,GACjDL,QAC6B,CAAC;AAErC,CAAC;AAED,OAAO,MAAMS,iBAAiB,GAAGA,CAAA,KAA2B;EAC1D,MAAMC,OAAO,GAAGhB,UAAU,CAACE,qBAAqB,CAAC;EAEjD,IAAIc,OAAO,KAAKb,SAAS,EAAE;IACzB,MAAM,IAAIc,KAAK,CACb,iEACF,CAAC;EACH;EAEA,OAAOD,OAAO;AAChB,CAAC","ignoreList":[]}
|