@mercurjs/dashboard-shared 2.3.6-canary.8 → 2.3.6
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/index.d.ts +85 -8
- package/dist/index.js +1607 -1422
- package/package.json +9 -9
package/dist/index.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ import { HttpTypes, AdminOrder } from '@medusajs/types';
|
|
|
4
4
|
import { z, ZodObject } from 'zod';
|
|
5
5
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
6
6
|
import * as _mercurjs_dashboard_sdk from '@mercurjs/dashboard-sdk';
|
|
7
|
-
import { Permission, PermissionsContextValue, PermissionMap, PermissionKey, PermissionRight, CustomFieldsConfig, NavItemOverride, ActivityEntry, CustomFormField, CustomDisplayField, SectionAction, CustomListExtension } from '@mercurjs/dashboard-sdk';
|
|
7
|
+
import { Permission, PermissionsContextValue, PermissionMap, PermissionKey, PermissionRight, CustomFieldsConfig, NavGroupConfig, NavItemOverride, ActivityEntry, CustomFormField, CustomDisplayField, SectionAction, CustomListExtension, CustomListFilter } from '@mercurjs/dashboard-sdk';
|
|
8
8
|
import * as React$1 from 'react';
|
|
9
9
|
import React__default, { ReactNode, PropsWithChildren, ComponentPropsWithoutRef, CSSProperties, ComponentType, ComponentProps, ForwardRefExoticComponent, Ref, RefAttributes, RefCallback, ReactElement, Dispatch, SetStateAction } from 'react';
|
|
10
10
|
import { Tooltip, Heading, Text, DataTableColumnDef, DataTableFilter, DataTableCommand, DataTableEmptyStateProps, DataTableRowSelectionState, DataTableRow, Select, Input, Table, Drawer, FocusModal, ProgressStatus } from '@medusajs/ui';
|
|
@@ -1790,12 +1790,14 @@ type Widget = {
|
|
|
1790
1790
|
zone: string[];
|
|
1791
1791
|
widgetId: string;
|
|
1792
1792
|
permission?: Permission[];
|
|
1793
|
+
label?: string;
|
|
1793
1794
|
};
|
|
1794
1795
|
type WidgetModule = {
|
|
1795
1796
|
widgets?: Widget[];
|
|
1796
1797
|
};
|
|
1797
1798
|
type NavigationModule = {
|
|
1798
|
-
|
|
1799
|
+
groups?: NavGroupConfig[];
|
|
1800
|
+
items?: NavItemOverride<string>[];
|
|
1799
1801
|
};
|
|
1800
1802
|
type CustomFieldsModule = {
|
|
1801
1803
|
configs?: CustomFieldsConfig[];
|
|
@@ -1812,6 +1814,7 @@ type ResolvedWidget = {
|
|
|
1812
1814
|
Component: Widget["Component"];
|
|
1813
1815
|
widgetId: string;
|
|
1814
1816
|
permission?: Permission[];
|
|
1817
|
+
label?: string;
|
|
1815
1818
|
};
|
|
1816
1819
|
type ZoneWidgets = {
|
|
1817
1820
|
before: ResolvedWidget[];
|
|
@@ -1825,6 +1828,7 @@ type ZoneWidgets = {
|
|
|
1825
1828
|
declare class ExtensionRegistry {
|
|
1826
1829
|
private widgets;
|
|
1827
1830
|
private navOverrides;
|
|
1831
|
+
private navGroups;
|
|
1828
1832
|
private customFields;
|
|
1829
1833
|
constructor(input?: {
|
|
1830
1834
|
widgets?: WidgetModule;
|
|
@@ -1834,7 +1838,8 @@ declare class ExtensionRegistry {
|
|
|
1834
1838
|
private ensureSlot;
|
|
1835
1839
|
private populateWidgets;
|
|
1836
1840
|
getWidgets(slot: string): ZoneWidgets;
|
|
1837
|
-
getNavOverrides(): NavItemOverride[];
|
|
1841
|
+
getNavOverrides(): NavItemOverride<string>[];
|
|
1842
|
+
getNavGroups(): NavGroupConfig[];
|
|
1838
1843
|
private configsFor;
|
|
1839
1844
|
/** Distinct module links declared across a model's configs. */
|
|
1840
1845
|
getLinks(model: string): string[];
|
|
@@ -1885,6 +1890,22 @@ type WidgetZoneProps = {
|
|
|
1885
1890
|
*/
|
|
1886
1891
|
declare const WidgetZone: ({ id, data, children }: WidgetZoneProps) => react_jsx_runtime.JSX.Element;
|
|
1887
1892
|
|
|
1893
|
+
type WidgetTab = {
|
|
1894
|
+
id: string;
|
|
1895
|
+
label: string;
|
|
1896
|
+
Component: Widget["Component"];
|
|
1897
|
+
};
|
|
1898
|
+
type WidgetTabs = {
|
|
1899
|
+
before: WidgetTab[];
|
|
1900
|
+
after: WidgetTab[];
|
|
1901
|
+
};
|
|
1902
|
+
/**
|
|
1903
|
+
* Tab-bar host. Returns the widgets targeting a `*.tabs` slot as tabs to place
|
|
1904
|
+
* `before` and `after` the built-in ones. A widget without a `label` cannot be
|
|
1905
|
+
* shown as a tab and is left out.
|
|
1906
|
+
*/
|
|
1907
|
+
declare const useWidgetTabs: (id: string) => WidgetTabs;
|
|
1908
|
+
|
|
1888
1909
|
type CoreNavItem = {
|
|
1889
1910
|
id: string;
|
|
1890
1911
|
label: string;
|
|
@@ -1899,6 +1920,51 @@ type CoreNavItem = {
|
|
|
1899
1920
|
* items without a matching override are preserved in their original order.
|
|
1900
1921
|
*/
|
|
1901
1922
|
declare function applyNavOverrides(coreRoutes: CoreNavItem[], overrides?: NavItemOverride[]): CoreNavItem[];
|
|
1923
|
+
type NavGroupItem = {
|
|
1924
|
+
id: string;
|
|
1925
|
+
label: string;
|
|
1926
|
+
to: string;
|
|
1927
|
+
translationNs?: string;
|
|
1928
|
+
};
|
|
1929
|
+
type NavGroup = {
|
|
1930
|
+
id: string;
|
|
1931
|
+
label: string;
|
|
1932
|
+
translationNs?: string;
|
|
1933
|
+
items: NavGroupItem[];
|
|
1934
|
+
};
|
|
1935
|
+
type ExtensionNavGroupItem = NavGroupItem & {
|
|
1936
|
+
group?: string;
|
|
1937
|
+
rank?: number;
|
|
1938
|
+
};
|
|
1939
|
+
/**
|
|
1940
|
+
* Resolves the grouped settings sidebar: the panel's built-in groups, plus the
|
|
1941
|
+
* groups and per-item overrides (`group`/`rank`/`hidden`/`label`) from the
|
|
1942
|
+
* host's `_navigation.ts`, plus extension routes placed by their route
|
|
1943
|
+
* config's `group`. An unknown group id falls back to the first built-in
|
|
1944
|
+
* group, extension routes list after a group's built-in items, and groups
|
|
1945
|
+
* left without items are dropped.
|
|
1946
|
+
*/
|
|
1947
|
+
declare function applyNavGroups(coreGroups: NavGroup[], extensionItems?: ExtensionNavGroupItem[], config?: {
|
|
1948
|
+
groups?: NavGroupConfig[];
|
|
1949
|
+
items?: NavItemOverride<string>[];
|
|
1950
|
+
}): NavGroup[];
|
|
1951
|
+
type NavItemGroup<T> = {
|
|
1952
|
+
id: string;
|
|
1953
|
+
label: string;
|
|
1954
|
+
translationNs?: string;
|
|
1955
|
+
items: T[];
|
|
1956
|
+
};
|
|
1957
|
+
/**
|
|
1958
|
+
* Splits main sidebar items into the ungrouped list and the groups declared in
|
|
1959
|
+
* the host's `_navigation.ts`. The main sidebar has no built-in groups, so an
|
|
1960
|
+
* item whose group isn't declared stays ungrouped. Item order is preserved.
|
|
1961
|
+
*/
|
|
1962
|
+
declare function groupNavItems<T extends {
|
|
1963
|
+
group?: string;
|
|
1964
|
+
}>(items: T[], groups?: NavGroupConfig[]): {
|
|
1965
|
+
ungrouped: T[];
|
|
1966
|
+
groups: NavItemGroup<T>[];
|
|
1967
|
+
};
|
|
1902
1968
|
|
|
1903
1969
|
type FormExtensionZoneProps = {
|
|
1904
1970
|
model: string;
|
|
@@ -1988,8 +2054,8 @@ type UseExtendableTableProps<TData> = {
|
|
|
1988
2054
|
type ExtendableTable<TData> = {
|
|
1989
2055
|
/** Base columns with custom override/add/hide/order applied. */
|
|
1990
2056
|
columns: ColumnDef<TData, unknown>[];
|
|
1991
|
-
/**
|
|
1992
|
-
filters:
|
|
2057
|
+
/** List filters contributed by custom-fields configs; apply with `mergeListFilters`. */
|
|
2058
|
+
filters: CustomListFilter[];
|
|
1993
2059
|
/** Extra multi-select bulk actions (rank-sorted). */
|
|
1994
2060
|
bulkActions: SectionAction[];
|
|
1995
2061
|
};
|
|
@@ -1998,11 +2064,22 @@ type ExtendableTable<TData> = {
|
|
|
1998
2064
|
* mirrors `useExtendableForm` for tables. A `columns[]` entry whose `id` matches
|
|
1999
2065
|
* a base column **overrides** it (custom header/cell), an unknown `id` **adds** a
|
|
2000
2066
|
* column, `viewDefaults.columnVisibility[id] === false` **hides** it, and
|
|
2001
|
-
* `viewDefaults.columnOrder` reorders. Also surfaces the config's `filters`
|
|
2002
|
-
*
|
|
2067
|
+
* `viewDefaults.columnOrder` reorders. Also surfaces the config's `filters`
|
|
2068
|
+
* (merge them into the base filters with `mergeListFilters`) and `bulkActions`
|
|
2069
|
+
* for the caller to render.
|
|
2003
2070
|
*/
|
|
2004
2071
|
declare function useExtendableTable<TData>({ model, columns: baseColumns, }: UseExtendableTableProps<TData>): ExtendableTable<TData>;
|
|
2005
2072
|
|
|
2073
|
+
type Keyed = {
|
|
2074
|
+
key: string;
|
|
2075
|
+
};
|
|
2076
|
+
/**
|
|
2077
|
+
* Applies a custom-fields `list.filters` block to a table's built-in filters.
|
|
2078
|
+
* An entry whose `key` matches a built-in filter replaces it in place, an
|
|
2079
|
+
* entry with `remove: true` drops it, and any other key is appended.
|
|
2080
|
+
*/
|
|
2081
|
+
declare function mergeListFilters<TFilter extends Keyed>(base: TFilter[], extensions: readonly CustomListFilter[]): TFilter[];
|
|
2082
|
+
|
|
2006
2083
|
/** Turn a model's `link` relations into `+link.*` merge tokens. */
|
|
2007
2084
|
declare const linkFields: (links: string[]) => string;
|
|
2008
2085
|
/**
|
|
@@ -2183,4 +2260,4 @@ declare const RICH_TEXT_ALLOWED_ATTRIBUTES: string[];
|
|
|
2183
2260
|
declare const isHtml: (value?: string | null) => boolean;
|
|
2184
2261
|
declare const plainTextToHtml: (value?: string | null) => string;
|
|
2185
2262
|
|
|
2186
|
-
export { type Action, type ActionGroup, ActionMenu, AddressForm, AddressSchema, type AttributeChange, type AttributeChangeKind, AttributeValueInput, BadgeListSummary, ChipGroup, ChipInput, CodeCell, CodeHeader, Combobox, type Command, ConditionalTooltip, ConfirmPrompt, type ConfirmPromptProps, type CoreNavItem, CountrySelect, CreatedAtCell, CreatedAtHeader, type CurrencyInfo, type CustomFieldsModule, CustomerInfo, DataGrid, DataTable, DateCell, DateHeader, DateRangeDisplay, DeprecatedPercentageInput, DisplayExtensionZone, type DisplayExtensionZoneProps, DisplayField, type DisplayFieldProps, DisplaySection, type DisplaySectionField, type DisplaySectionProps, type EditAttributeAttribute, EditAttributeForm, type EditAttributeFormProps, EmailCell, EmailForm, EmailHeader, EmailSchema, ErrorBoundary, type ExtendableTable, ExtensionProvider, type ExtensionProviderProps, ExtensionRegistry, type ExtractableOffer, type ExtractableOffers, type FieldDiff, FilePreview, type FileType, FileUpload, type FileUploadProps, type Filter, FilterGroup, Form, FormExtensionZone, type FormExtensionZoneProps, GeneralSectionSkeleton, HandleInput, HeadingSkeleton, IconAvatar, IconButtonSkeleton, ImageAvatar, type ImageRef, IncludesTaxTooltip, InfiniteList, JsonViewSection, JsonViewSectionSkeleton, KeyboundForm, LinkButton, ListBadge, ListSummary, Listicle, type ListicleProps, LocalizedTablePagination, type MediaDiff, MetadataForm, MetadataSection, MoneyAmountCell, NameCell, NameHeader, type NavigationModule, NoRecords, type NoRecordsProps, NoResults, type NoResultsProps, OrderBy, PercentageInput, PermissionAction, type PermissionActionProps, PermissionGuard, type PermissionGuardProps, type PermissionedCommand, PermissionsContext, PermissionsProvider, type PermissionsProviderProps, PlaceholderCell, PriceListDateStatus, type PriceListGridGroupRow, type PriceListGridOfferRow, type PriceListGridRow, PriceListStatus, PriceListType, type ProductAttributeBatchPayload, ProductAttributeSection, type ProductAttributeSectionProps, type ProductChangeAttribute, ProductChangePanel, type ProductChangePanelProps, type ProductChangeProduct, type ProductChangeResolvers, type ProductChangeVariant, type ProductChangeView, ProgressBar, ProvinceSelect, Query, REFERENCE_FIELDS, RICH_TEXT_ALLOWED_ATTRIBUTES, RICH_TEXT_ALLOWED_TAGS, type ReferenceField, type ResolvedAttribute, type ResolvedDisplays, type ResolvedFormField, RichText, RichTextEditor, type RichTextEditorProps, RouteDrawer, RouteFocusModal, RoutePermissionGuard, SIDEBAR_MENU_CONTENT, SIDEBAR_RAIL_FADE, SectionNoAccess, SectionRow, type SectionRowProps, SegmentedControl, type SegmentedControlOption, SidebarContext, type SidebarContextValue, SidebarLink, type SidebarLinkProps, SidebarProvider, type SidebarState, SingleColumnPage, SingleColumnPageSkeleton, Skeleton, SortableList, SortableTree, StackedDrawer, StackedFocusModal, type StaticCountry, StatusCell, SwitchBox, type TQueryKey, type TabDefinition, TabbedForm, TableFooterSkeleton, TableSectionSkeleton, TableSkeleton, TextCell, TextHeader, TextSkeleton, Thumbnail, TransferOwnershipSchema, TwoColumnPage, TwoColumnPageSkeleton, type UseExtendableFormProps, type UseExtendableTableProps, type UseQueryOptionsWrapper, type VariantGroup, VisuallyHidden, type Widget, type WidgetModule, type WidgetPlacement, WidgetZone, type WidgetZoneProps, type ZoneWidgets, _DataTable, applyActionPermissions, applyNavOverrides, buildAdditionalDataDefaults, buildAdditionalDataSchema, buildOfferGridData, buildProductChangeView, countries, createDataGridHelper, createDataGridPriceColumns, createFormHelper, createWithPermission, currencies, extractPricesFromOffers, extractReferenceIds, filterCommandsByPermission, formatFieldValue, genericForwardRef, getCountryByIso2, getCurrencySymbol, getDecimalDigits, getExtensionRegistry, getFormattedAddress, getFormattedCountry, getLinkQuery, getLocaleAmount, getNativeSymbol, getPriceListStatus, getStylizedAmount, humanizeFieldName, isAmountLessThenRoundingError, isForbidden, isHtml, isImageList, isOrderActionable, isOrderAwaitingAction, isPermitted, isPriceListGroupRow, isProductRow, isReferenceField, isSameAddress, linkFields, permissionMapAllows, plainTextToHtml, productChangeViewHasContent, queryClient, queryKeysFactory, richTextContentClasses, sanitizeRichText, toPermissionList, useActionLocks, useCan, useCollapsedSidebar, useCombinedRefs, useCommandHistory, useDataTable, useDate, useDisplayFieldOverride, useDocumentDirection, useExpandedSidebar, useExtendableForm, useExtendableTable, useExtension, useExtensionActivity, useLinkQuery, usePermissionGate, usePermissions, usePermittedCommands, useQueryParams, useResourcePermissions, useRouteModal, useSidebar, useSidebarMenuPlacement, useStackedModal, useTabManagement, useTabbedForm, withLinkFields };
|
|
2263
|
+
export { type Action, type ActionGroup, ActionMenu, AddressForm, AddressSchema, type AttributeChange, type AttributeChangeKind, AttributeValueInput, BadgeListSummary, ChipGroup, ChipInput, CodeCell, CodeHeader, Combobox, type Command, ConditionalTooltip, ConfirmPrompt, type ConfirmPromptProps, type CoreNavItem, CountrySelect, CreatedAtCell, CreatedAtHeader, type CurrencyInfo, type CustomFieldsModule, CustomerInfo, DataGrid, DataTable, DateCell, DateHeader, DateRangeDisplay, DeprecatedPercentageInput, DisplayExtensionZone, type DisplayExtensionZoneProps, DisplayField, type DisplayFieldProps, DisplaySection, type DisplaySectionField, type DisplaySectionProps, type EditAttributeAttribute, EditAttributeForm, type EditAttributeFormProps, EmailCell, EmailForm, EmailHeader, EmailSchema, ErrorBoundary, type ExtendableTable, ExtensionProvider, type ExtensionProviderProps, ExtensionRegistry, type ExtractableOffer, type ExtractableOffers, type FieldDiff, FilePreview, type FileType, FileUpload, type FileUploadProps, type Filter, FilterGroup, Form, FormExtensionZone, type FormExtensionZoneProps, GeneralSectionSkeleton, HandleInput, HeadingSkeleton, IconAvatar, IconButtonSkeleton, ImageAvatar, type ImageRef, IncludesTaxTooltip, InfiniteList, JsonViewSection, JsonViewSectionSkeleton, KeyboundForm, LinkButton, ListBadge, ListSummary, Listicle, type ListicleProps, LocalizedTablePagination, type MediaDiff, MetadataForm, MetadataSection, MoneyAmountCell, NameCell, NameHeader, type NavGroup, type NavGroupItem, type NavItemGroup, type NavigationModule, NoRecords, type NoRecordsProps, NoResults, type NoResultsProps, OrderBy, PercentageInput, PermissionAction, type PermissionActionProps, PermissionGuard, type PermissionGuardProps, type PermissionedCommand, PermissionsContext, PermissionsProvider, type PermissionsProviderProps, PlaceholderCell, PriceListDateStatus, type PriceListGridGroupRow, type PriceListGridOfferRow, type PriceListGridRow, PriceListStatus, PriceListType, type ProductAttributeBatchPayload, ProductAttributeSection, type ProductAttributeSectionProps, type ProductChangeAttribute, ProductChangePanel, type ProductChangePanelProps, type ProductChangeProduct, type ProductChangeResolvers, type ProductChangeVariant, type ProductChangeView, ProgressBar, ProvinceSelect, Query, REFERENCE_FIELDS, RICH_TEXT_ALLOWED_ATTRIBUTES, RICH_TEXT_ALLOWED_TAGS, type ReferenceField, type ResolvedAttribute, type ResolvedDisplays, type ResolvedFormField, RichText, RichTextEditor, type RichTextEditorProps, RouteDrawer, RouteFocusModal, RoutePermissionGuard, SIDEBAR_MENU_CONTENT, SIDEBAR_RAIL_FADE, SectionNoAccess, SectionRow, type SectionRowProps, SegmentedControl, type SegmentedControlOption, SidebarContext, type SidebarContextValue, SidebarLink, type SidebarLinkProps, SidebarProvider, type SidebarState, SingleColumnPage, SingleColumnPageSkeleton, Skeleton, SortableList, SortableTree, StackedDrawer, StackedFocusModal, type StaticCountry, StatusCell, SwitchBox, type TQueryKey, type TabDefinition, TabbedForm, TableFooterSkeleton, TableSectionSkeleton, TableSkeleton, TextCell, TextHeader, TextSkeleton, Thumbnail, TransferOwnershipSchema, TwoColumnPage, TwoColumnPageSkeleton, type UseExtendableFormProps, type UseExtendableTableProps, type UseQueryOptionsWrapper, type VariantGroup, VisuallyHidden, type Widget, type WidgetModule, type WidgetPlacement, type WidgetTab, type WidgetTabs, WidgetZone, type WidgetZoneProps, type ZoneWidgets, _DataTable, applyActionPermissions, applyNavGroups, applyNavOverrides, buildAdditionalDataDefaults, buildAdditionalDataSchema, buildOfferGridData, buildProductChangeView, countries, createDataGridHelper, createDataGridPriceColumns, createFormHelper, createWithPermission, currencies, extractPricesFromOffers, extractReferenceIds, filterCommandsByPermission, formatFieldValue, genericForwardRef, getCountryByIso2, getCurrencySymbol, getDecimalDigits, getExtensionRegistry, getFormattedAddress, getFormattedCountry, getLinkQuery, getLocaleAmount, getNativeSymbol, getPriceListStatus, getStylizedAmount, groupNavItems, humanizeFieldName, isAmountLessThenRoundingError, isForbidden, isHtml, isImageList, isOrderActionable, isOrderAwaitingAction, isPermitted, isPriceListGroupRow, isProductRow, isReferenceField, isSameAddress, linkFields, mergeListFilters, permissionMapAllows, plainTextToHtml, productChangeViewHasContent, queryClient, queryKeysFactory, richTextContentClasses, sanitizeRichText, toPermissionList, useActionLocks, useCan, useCollapsedSidebar, useCombinedRefs, useCommandHistory, useDataTable, useDate, useDisplayFieldOverride, useDocumentDirection, useExpandedSidebar, useExtendableForm, useExtendableTable, useExtension, useExtensionActivity, useLinkQuery, usePermissionGate, usePermissions, usePermittedCommands, useQueryParams, useResourcePermissions, useRouteModal, useSidebar, useSidebarMenuPlacement, useStackedModal, useTabManagement, useTabbedForm, useWidgetTabs, withLinkFields };
|