@luminix/mui-cms 0.0.1-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (112) hide show
  1. package/.eslintrc.cjs +18 -0
  2. package/README.md +30 -0
  3. package/bundle/mui-cms.bundle.iife.js +196 -0
  4. package/bundle/style.css +1 -0
  5. package/bundle/vite.svg +1 -0
  6. package/dist/mui-cms.js +3163 -0
  7. package/dist/vite.svg +1 -0
  8. package/package.json +46 -0
  9. package/tsconfig.json +25 -0
  10. package/tsconfig.node.json +11 -0
  11. package/types/components/Breadcrumbs.d.ts +3 -0
  12. package/types/components/DesktopPageTitle.d.ts +2 -0
  13. package/types/components/Layout/AppBar/MenuButton.d.ts +3 -0
  14. package/types/components/Layout/AppBar.d.ts +4 -0
  15. package/types/components/Layout/BackButton.d.ts +4 -0
  16. package/types/components/Layout/Drawer.d.ts +4 -0
  17. package/types/components/Layout/SearchBar.d.ts +4 -0
  18. package/types/components/Link.d.ts +7 -0
  19. package/types/components/LuminixCms.d.ts +4 -0
  20. package/types/components/ModelIndex/Filter/Content.d.ts +3 -0
  21. package/types/components/ModelIndex/Filter/Row.d.ts +4 -0
  22. package/types/components/ModelIndex/Filter/ValueInput/AsyncAutocomplete.d.ts +3 -0
  23. package/types/components/ModelIndex/Filter/ValueInput/DatePicker.d.ts +4 -0
  24. package/types/components/ModelIndex/Filter/ValueInput/Switch.d.ts +3 -0
  25. package/types/components/ModelIndex/Filter/ValueInput/TextField.d.ts +4 -0
  26. package/types/components/ModelIndex/Filter/ValueInput.d.ts +3 -0
  27. package/types/components/ModelIndex/Filter/useRow.d.ts +19 -0
  28. package/types/components/ModelIndex/Filter.d.ts +3 -0
  29. package/types/components/ModelIndex/InstanceActions.d.ts +5 -0
  30. package/types/components/ModelIndex/MassActions.d.ts +4 -0
  31. package/types/components/ModelIndex/Pagination.d.ts +4 -0
  32. package/types/components/ModelIndex/PaginationDetails.d.ts +3 -0
  33. package/types/components/ModelIndex/PerPageSwitch.d.ts +3 -0
  34. package/types/components/ModelIndex/Sort.d.ts +3 -0
  35. package/types/components/ModelIndex/StaticActions.d.ts +4 -0
  36. package/types/components/ModelIndex/Table/ShrinkedCell.d.ts +4 -0
  37. package/types/components/ModelIndex/Table/TableBody/Skeleton.d.ts +3 -0
  38. package/types/components/ModelIndex/Table/TableBody/TableRow.d.ts +4 -0
  39. package/types/components/ModelIndex/Table/TableBody.d.ts +4 -0
  40. package/types/components/ModelIndex/Table/TableFooter.d.ts +4 -0
  41. package/types/components/ModelIndex/Table/TableHead.d.ts +4 -0
  42. package/types/components/ModelIndex/Table/TableToolbar.d.ts +3 -0
  43. package/types/components/ModelIndex/Table.d.ts +4 -0
  44. package/types/components/ModelIndex/Tabs.d.ts +3 -0
  45. package/types/components/RecursiveList.d.ts +4 -0
  46. package/types/components/RecursiveMenu.d.ts +4 -0
  47. package/types/contexts/DialogContext.d.ts +4 -0
  48. package/types/contexts/LayoutContext.d.ts +4 -0
  49. package/types/contexts/ModelContext.d.ts +4 -0
  50. package/types/contexts/ModelFilterContext.d.ts +4 -0
  51. package/types/contexts/ModelFilterRowContext.d.ts +4 -0
  52. package/types/contexts/NotificationContext.d.ts +4 -0
  53. package/types/contexts/TableContext.d.ts +4 -0
  54. package/types/dist.d.ts +3 -0
  55. package/types/facades/Cms.d.ts +31 -0
  56. package/types/facades/Filter.d.ts +24 -0
  57. package/types/hooks/useActionEvent.d.ts +2 -0
  58. package/types/hooks/useBackButton.d.ts +6 -0
  59. package/types/hooks/useCurrentModel.d.ts +1 -0
  60. package/types/hooks/useDialog.d.ts +1 -0
  61. package/types/hooks/useDisplaceNotifications.d.ts +1 -0
  62. package/types/hooks/useHandleError.d.ts +1 -0
  63. package/types/hooks/useHasBackButton.d.ts +6 -0
  64. package/types/hooks/useHasSearch.d.ts +7 -0
  65. package/types/hooks/useIsDesktopMode.d.ts +7 -0
  66. package/types/hooks/useKeyChord.d.ts +1 -0
  67. package/types/hooks/useKeyPress.d.ts +1 -0
  68. package/types/hooks/useLayoutConfig.d.ts +8 -0
  69. package/types/hooks/useMenu.d.ts +12 -0
  70. package/types/hooks/useNotifications.d.ts +1 -0
  71. package/types/hooks/useNotify.d.ts +1 -0
  72. package/types/hooks/useOptimistic.d.ts +32 -0
  73. package/types/hooks/usePageTitle.d.ts +7 -0
  74. package/types/hooks/useSearch.d.ts +6 -0
  75. package/types/hooks/useSelection.d.ts +10 -0
  76. package/types/hooks/useSetPageTitle.d.ts +8 -0
  77. package/types/hooks/useTable.d.ts +1 -0
  78. package/types/index.d.ts +2 -0
  79. package/types/main.d.ts +0 -0
  80. package/types/plugins/CmsPlugin.d.ts +18 -0
  81. package/types/plugins/i18NextPlugin.d.ts +19 -0
  82. package/types/providers/DialogProvider.d.ts +4 -0
  83. package/types/providers/LayoutProvider.d.ts +5 -0
  84. package/types/providers/ModelProvider.d.ts +3 -0
  85. package/types/providers/NotificationProvider.d.ts +4 -0
  86. package/types/providers/TableProvider.d.ts +4 -0
  87. package/types/routes.d.ts +3 -0
  88. package/types/support/ModelIndex/Filter/inputs.d.ts +4 -0
  89. package/types/support/ModelIndex/Filter/searchParams.d.ts +18 -0
  90. package/types/support/ModelIndex/relation.d.ts +4 -0
  91. package/types/support/array.d.ts +9 -0
  92. package/types/support/date.d.ts +1 -0
  93. package/types/support/error.d.ts +2 -0
  94. package/types/support/handlers.d.ts +9 -0
  95. package/types/support/misc.d.ts +16 -0
  96. package/types/support/searchParams.d.ts +1 -0
  97. package/types/types/Config.d.ts +13 -0
  98. package/types/types/Contexts.d.ts +72 -0
  99. package/types/types/Dialog.d.ts +9 -0
  100. package/types/types/Filter.d.ts +20 -0
  101. package/types/types/Menu.d.ts +11 -0
  102. package/types/types/Notifications.d.ts +13 -0
  103. package/types/types/Plugin.d.ts +8 -0
  104. package/types/types/PropTypes.d.ts +100 -0
  105. package/types/types/Reducers.d.ts +4 -0
  106. package/types/types/Table.d.ts +41 -0
  107. package/types/types/Tabs.d.ts +4 -0
  108. package/types/views/Dashboard.d.ts +3 -0
  109. package/types/views/Error.d.ts +4 -0
  110. package/types/views/Layout/Layout.d.ts +4 -0
  111. package/types/views/ModelIndex.d.ts +3 -0
  112. package/types/views/ModelItem.d.ts +4 -0
package/dist/vite.svg ADDED
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="31.88" height="32" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 257"><defs><linearGradient id="IconifyId1813088fe1fbc01fb466" x1="-.828%" x2="57.636%" y1="7.652%" y2="78.411%"><stop offset="0%" stop-color="#41D1FF"></stop><stop offset="100%" stop-color="#BD34FE"></stop></linearGradient><linearGradient id="IconifyId1813088fe1fbc01fb467" x1="43.376%" x2="50.316%" y1="2.242%" y2="89.03%"><stop offset="0%" stop-color="#FFEA83"></stop><stop offset="8.333%" stop-color="#FFDD35"></stop><stop offset="100%" stop-color="#FFA800"></stop></linearGradient></defs><path fill="url(#IconifyId1813088fe1fbc01fb466)" d="M255.153 37.938L134.897 252.976c-2.483 4.44-8.862 4.466-11.382.048L.875 37.958c-2.746-4.814 1.371-10.646 6.827-9.67l120.385 21.517a6.537 6.537 0 0 0 2.322-.004l117.867-21.483c5.438-.991 9.574 4.796 6.877 9.62Z"></path><path fill="url(#IconifyId1813088fe1fbc01fb467)" d="M185.432.063L96.44 17.501a3.268 3.268 0 0 0-2.634 3.014l-5.474 92.456a3.268 3.268 0 0 0 3.997 3.378l24.777-5.718c2.318-.535 4.413 1.507 3.936 3.838l-7.361 36.047c-.495 2.426 1.782 4.5 4.151 3.78l15.304-4.649c2.372-.72 4.652 1.36 4.15 3.788l-11.698 56.621c-.732 3.542 3.979 5.473 5.943 2.437l1.313-2.028l72.516-144.72c1.215-2.423-.88-5.186-3.54-4.672l-25.505 4.922c-2.396.462-4.435-1.77-3.759-4.114l16.646-57.705c.677-2.35-1.37-4.583-3.769-4.113Z"></path></svg>
package/package.json ADDED
@@ -0,0 +1,46 @@
1
+ {
2
+ "name": "@luminix/mui-cms",
3
+ "version": "0.0.1-beta.0",
4
+ "type": "module",
5
+ "main": "dist/mui-cms.js",
6
+ "types": "types/index.d.ts",
7
+ "scripts": {
8
+ "dev": "vite --port=3333 --config=vite.config.dev.ts",
9
+ "build": "npm run build:bundle && npm run build:dist",
10
+ "build:bundle": "tsc && vite build --config vite.config.bundle.ts",
11
+ "build:dist": "tsc && vite build",
12
+ "lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
13
+ "preview": "vite preview"
14
+ },
15
+ "peerDependencies": {
16
+ "@emotion/react": "^11.13.0",
17
+ "@emotion/styled": "^11.13.0",
18
+ "@fontsource/roboto": "^5.0.12",
19
+ "@luminix/core": "^0.0.1-beta.15",
20
+ "@luminix/react": "^0.0.1-beta.20",
21
+ "@mui/icons-material": "^5.16.5",
22
+ "@mui/material": "^5.16.5",
23
+ "axios": "^1.6.4",
24
+ "i18next": "^23.12.2",
25
+ "lodash": "^4.17.21",
26
+ "react": "^18.3.1",
27
+ "react-dom": "^18.3.1",
28
+ "react-i18next": "^15.0.1",
29
+ "react-router-dom": "6.25.1"
30
+ },
31
+ "devDependencies": {
32
+ "@types/lodash": "^4.17.0",
33
+ "@types/react": "^18.3.3",
34
+ "@types/react-dom": "^18.3.0",
35
+ "@typescript-eslint/eslint-plugin": "^7.2.0",
36
+ "@typescript-eslint/parser": "^7.2.0",
37
+ "@vitejs/plugin-react": "^4.2.1",
38
+ "eslint": "^8.57.0",
39
+ "eslint-plugin-react-hooks": "^4.6.0",
40
+ "eslint-plugin-react-refresh": "^0.4.6",
41
+ "terser": "^5.31.6",
42
+ "typescript": "^5.2.2",
43
+ "vite": "^5.2.0",
44
+ "vite-plugin-dts": "^4.0.3"
45
+ }
46
+ }
package/tsconfig.json ADDED
@@ -0,0 +1,25 @@
1
+ {
2
+ "compilerOptions": {
3
+ "target": "ES2020",
4
+ "useDefineForClassFields": true,
5
+ "lib": ["ES2020", "DOM", "DOM.Iterable", "ES2021.String"],
6
+ "module": "ESNext",
7
+ "skipLibCheck": true,
8
+
9
+ /* Bundler mode */
10
+ "moduleResolution": "bundler",
11
+ "allowImportingTsExtensions": true,
12
+ "resolveJsonModule": true,
13
+ "isolatedModules": true,
14
+ "noEmit": true,
15
+ "jsx": "react-jsx",
16
+
17
+ /* Linting */
18
+ "strict": true,
19
+ "noUnusedLocals": true,
20
+ "noUnusedParameters": true,
21
+ "noFallthroughCasesInSwitch": true
22
+ },
23
+ "include": ["src"],
24
+ "references": [{ "path": "./tsconfig.node.json" }]
25
+ }
@@ -0,0 +1,11 @@
1
+ {
2
+ "compilerOptions": {
3
+ "composite": true,
4
+ "skipLibCheck": true,
5
+ "module": "ESNext",
6
+ "moduleResolution": "bundler",
7
+ "allowSyntheticDefaultImports": true,
8
+ "strict": true
9
+ },
10
+ "include": ["vite.config.ts"]
11
+ }
@@ -0,0 +1,3 @@
1
+ import { default as React } from 'react';
2
+ import { BreadcrumbsProps } from '../types/PropTypes';
3
+ export default function Breadcrumbs(props: BreadcrumbsProps): React.ReactNode;
@@ -0,0 +1,2 @@
1
+ declare const DesktopPageTitle: React.FunctionComponent;
2
+ export default DesktopPageTitle;
@@ -0,0 +1,3 @@
1
+ import { default as React } from 'react';
2
+ declare const MenuButton: React.FunctionComponent;
3
+ export default MenuButton;
@@ -0,0 +1,4 @@
1
+ import { default as React } from 'react';
2
+ import { AppBarProps } from '../../types/PropTypes';
3
+ declare const AppBar: React.FunctionComponent<AppBarProps>;
4
+ export default AppBar;
@@ -0,0 +1,4 @@
1
+ import { default as React } from 'react';
2
+ import { IconButtonProps } from '@mui/material/IconButton';
3
+ declare function BackButton(props: IconButtonProps): React.ReactNode;
4
+ export default BackButton;
@@ -0,0 +1,4 @@
1
+ import { default as React } from 'react';
2
+ import { DrawerProps } from '@mui/material/Drawer';
3
+ declare const Drawer: React.FunctionComponent<DrawerProps>;
4
+ export default Drawer;
@@ -0,0 +1,4 @@
1
+ import { default as React } from 'react';
2
+ import { SearchBarProps } from '../../types/PropTypes';
3
+ declare const SearchBar: React.FunctionComponent<SearchBarProps>;
4
+ export default SearchBar;
@@ -0,0 +1,7 @@
1
+ import { default as React } from 'react';
2
+ import { LinkProps as RouterLinkProps } from 'react-router-dom';
3
+ import { LinkTypeMap } from '@mui/material/Link';
4
+ import { DefaultComponentProps } from '@mui/material/OverridableComponent';
5
+ export type LinkProps = DefaultComponentProps<LinkTypeMap> & RouterLinkProps;
6
+ declare const Link: React.ForwardRefExoticComponent<Omit<LinkProps, "ref"> & React.RefAttributes<HTMLAnchorElement>>;
7
+ export default Link;
@@ -0,0 +1,4 @@
1
+ import { default as React } from 'react';
2
+ import { LuminixCmsProps } from '../types/PropTypes';
3
+ declare const LuminixCms: React.FunctionComponent<LuminixCmsProps>;
4
+ export default LuminixCms;
@@ -0,0 +1,3 @@
1
+ import { default as React } from 'react';
2
+ declare const Content: React.FunctionComponent;
3
+ export default Content;
@@ -0,0 +1,4 @@
1
+ import { default as React } from 'react';
2
+ import { FilterRow } from '../../../types/Filter';
3
+ declare const Row: React.FunctionComponent<FilterRow>;
4
+ export default Row;
@@ -0,0 +1,3 @@
1
+ import { default as React } from 'react';
2
+ declare const AsyncAutocomplete: React.FunctionComponent;
3
+ export default AsyncAutocomplete;
@@ -0,0 +1,4 @@
1
+ import { default as React } from 'react';
2
+ import { FilterValueInput } from '../../../../types/Filter';
3
+ declare const DatePicker: React.FunctionComponent<FilterValueInput>;
4
+ export default DatePicker;
@@ -0,0 +1,3 @@
1
+ import { default as React } from 'react';
2
+ declare const Switch: React.FunctionComponent;
3
+ export default Switch;
@@ -0,0 +1,4 @@
1
+ import { default as React } from 'react';
2
+ import { FilterValueInput } from '../../../../types/Filter';
3
+ declare const TextField: React.FunctionComponent<FilterValueInput>;
4
+ export default TextField;
@@ -0,0 +1,3 @@
1
+ import { default as React } from 'react';
2
+ declare const ValueInput: React.FunctionComponent;
3
+ export default ValueInput;
@@ -0,0 +1,19 @@
1
+ import { default as React } from 'react';
2
+ import { SelectChangeEvent } from '@mui/material';
3
+ import { FilterColumn, FilteredColumn } from '../../../types/Filter';
4
+ export default function useRow(index: number, column: FilteredColumn): {
5
+ columns: FilterColumn[];
6
+ key: string;
7
+ setKey: React.Dispatch<React.SetStateAction<string>>;
8
+ operator: string;
9
+ setOperator: React.Dispatch<React.SetStateAction<string>>;
10
+ type: string;
11
+ setType: React.Dispatch<React.SetStateAction<string>>;
12
+ value: any;
13
+ setValue: React.Dispatch<any>;
14
+ isRelation: boolean;
15
+ setIsRelation: React.Dispatch<React.SetStateAction<boolean>>;
16
+ handleKey: (event: SelectChangeEvent<string>) => Promise<void>;
17
+ handleOperator: (event: SelectChangeEvent<string>) => Promise<void>;
18
+ handleRemoveColumn: (index: number) => () => void;
19
+ };
@@ -0,0 +1,3 @@
1
+ import { default as React } from 'react';
2
+ declare const Filter: React.FunctionComponent;
3
+ export default Filter;
@@ -0,0 +1,5 @@
1
+ import { Model } from '@luminix/core';
2
+ declare const InstanceActions: ({ item }: {
3
+ item: Model;
4
+ }) => import("react/jsx-runtime").JSX.Element;
5
+ export default InstanceActions;
@@ -0,0 +1,4 @@
1
+ import { default as React } from 'react';
2
+ import { StackProps } from '@mui/material/Stack';
3
+ declare function MassActions(props: StackProps): React.ReactNode;
4
+ export default MassActions;
@@ -0,0 +1,4 @@
1
+ import { default as React } from 'react';
2
+ import { PaginationProps } from '../../types/PropTypes';
3
+ declare const Pagination: React.FunctionComponent<PaginationProps>;
4
+ export default Pagination;
@@ -0,0 +1,3 @@
1
+ import { default as React } from 'react';
2
+ declare const PaginationDetails: React.FunctionComponent;
3
+ export default PaginationDetails;
@@ -0,0 +1,3 @@
1
+ import { default as React } from 'react';
2
+ declare const PerPageSwitch: React.FunctionComponent;
3
+ export default PerPageSwitch;
@@ -0,0 +1,3 @@
1
+ import { default as React } from 'react';
2
+ declare const Sort: React.FunctionComponent;
3
+ export default Sort;
@@ -0,0 +1,4 @@
1
+ import { default as React } from 'react';
2
+ import { ActionsProps } from '../../types/PropTypes';
3
+ declare const StaticActions: React.FunctionComponent<ActionsProps>;
4
+ export default StaticActions;
@@ -0,0 +1,4 @@
1
+ import { default as React } from 'react';
2
+ import { TableCellProps } from '@mui/material/TableCell';
3
+ declare const ShrinkedCell: React.FunctionComponent<TableCellProps>;
4
+ export default ShrinkedCell;
@@ -0,0 +1,3 @@
1
+ import { default as React } from 'react';
2
+ declare const Skeleton: React.FunctionComponent;
3
+ export default Skeleton;
@@ -0,0 +1,4 @@
1
+ import { default as React } from 'react';
2
+ import { TableRowProps } from '../../../../types/PropTypes';
3
+ declare const TableRow: React.FunctionComponent<TableRowProps>;
4
+ export default TableRow;
@@ -0,0 +1,4 @@
1
+ import { default as React } from 'react';
2
+ import { TableBodyProps } from '../../../types/PropTypes';
3
+ declare const TableBody: React.FunctionComponent<TableBodyProps>;
4
+ export default TableBody;
@@ -0,0 +1,4 @@
1
+ import { default as React } from 'react';
2
+ import { TableFooterProps } from '@mui/material/TableFooter';
3
+ declare const TableFooter: React.FunctionComponent<TableFooterProps>;
4
+ export default TableFooter;
@@ -0,0 +1,4 @@
1
+ import { default as React } from 'react';
2
+ import { TableHeadProps } from '../../../types/PropTypes';
3
+ declare const TableHead: React.FunctionComponent<TableHeadProps>;
4
+ export default TableHead;
@@ -0,0 +1,3 @@
1
+ import { default as React } from 'react';
2
+ declare const TableToolbar: React.FunctionComponent;
3
+ export default TableToolbar;
@@ -0,0 +1,4 @@
1
+ import { default as React } from 'react';
2
+ import { TableProps } from '../../types/PropTypes';
3
+ declare const Table: React.FunctionComponent<TableProps>;
4
+ export default Table;
@@ -0,0 +1,3 @@
1
+ import { default as React } from 'react';
2
+ declare function Tabs(): React.ReactNode;
3
+ export default Tabs;
@@ -0,0 +1,4 @@
1
+ import { default as React } from 'react';
2
+ import { RecursiveListProps } from '../types/PropTypes';
3
+ declare const RecursiveList: React.FunctionComponent<RecursiveListProps>;
4
+ export default RecursiveList;
@@ -0,0 +1,4 @@
1
+ import { default as React } from 'react';
2
+ import { RecursiveMenuProps } from '../types/PropTypes';
3
+ declare const RecursiveMenu: React.FunctionComponent<RecursiveMenuProps>;
4
+ export default RecursiveMenu;
@@ -0,0 +1,4 @@
1
+ import { default as React } from 'react';
2
+ import { DialogContextValue } from '../types/Contexts';
3
+ declare const DialogContext: React.Context<DialogContextValue>;
4
+ export default DialogContext;
@@ -0,0 +1,4 @@
1
+ import { default as React } from 'react';
2
+ import { LayoutContextValue } from '../types/Contexts';
3
+ declare const LayoutContext: React.Context<LayoutContextValue>;
4
+ export default LayoutContext;
@@ -0,0 +1,4 @@
1
+ import { default as React } from 'react';
2
+ import { ModelContextValue } from '../types/Contexts';
3
+ declare const ModelContext: React.Context<ModelContextValue>;
4
+ export default ModelContext;
@@ -0,0 +1,4 @@
1
+ import { default as React } from 'react';
2
+ import { ModelFilterContextValue } from '../types/Contexts';
3
+ declare const ModelFilterContext: React.Context<ModelFilterContextValue>;
4
+ export default ModelFilterContext;
@@ -0,0 +1,4 @@
1
+ import { default as React } from 'react';
2
+ import { ModelFilterRowContextValue } from '../types/Contexts';
3
+ declare const ModelFilterRowContext: React.Context<ModelFilterRowContextValue>;
4
+ export default ModelFilterRowContext;
@@ -0,0 +1,4 @@
1
+ import { default as React } from 'react';
2
+ import { NotificationContextValue } from '../types/Contexts';
3
+ declare const NotificationContext: React.Context<NotificationContextValue>;
4
+ export default NotificationContext;
@@ -0,0 +1,4 @@
1
+ import { default as React } from 'react';
2
+ import { TableContextValue } from '../types/Contexts';
3
+ declare const TableContext: React.Context<TableContextValue>;
4
+ export default TableContext;
@@ -0,0 +1,3 @@
1
+ import { default as CmsPlugin } from './plugins/CmsPlugin';
2
+ import { default as LuminixCms } from './components/LuminixCms';
3
+ export { CmsPlugin, LuminixCms, };
@@ -0,0 +1,31 @@
1
+ import { default as React } from 'react';
2
+ import { Model } from '@luminix/core';
3
+ import { RouteObject } from 'react-router-dom';
4
+ import { MenuItem } from '../types/Menu';
5
+ import { ModelFormProps } from '@luminix/react/dist/types/Form';
6
+ import { StaticAction, MassAction } from '../types/Table';
7
+ import { ReducerCallback } from '@luminix/core/dist/types/Reducer';
8
+ declare class CmsFacade {
9
+ [key: string]: ReducerCallback;
10
+ constructor();
11
+ getComponents(): Record<string, React.ComponentType>;
12
+ getComponent(name: string): React.ComponentType;
13
+ getRoutes(): RouteObject[];
14
+ getMenuItems(): MenuItem[];
15
+ getModelFormProps(item: Model): ModelFormProps;
16
+ getMassActions(ModelClass: typeof Model, currentTab: string): MassAction[];
17
+ getInstanceActions(ModelClass: typeof Model, currentTab: string): StaticAction[];
18
+ getStaticActions(ModelClass: typeof Model, currentTab: string): StaticAction[];
19
+ }
20
+ declare const _default: (new (...args: any[]) => {
21
+ reducers: {
22
+ [name: string]: import('@luminix/core/dist/types/Collection').Collection<import('@luminix/core/dist/types/Reducer').Reducer>;
23
+ };
24
+ reducer(name: string, callback: ReducerCallback, priority?: number): () => void;
25
+ removeReducer(name: string, callback: ReducerCallback): void;
26
+ getReducer(name: string): import('@luminix/core/dist/types/Collection').Collection<import('@luminix/core/dist/types/Reducer').Reducer>;
27
+ hasReducer(name: string): boolean;
28
+ clearReducer(name: string): void;
29
+ flushReducers(): void;
30
+ }) & typeof CmsFacade;
31
+ export default _default;
@@ -0,0 +1,24 @@
1
+ import { Model } from '@luminix/core';
2
+ import { ReducerCallback } from '@luminix/core/dist/types/Reducer';
3
+ import { InputOption } from '../types/PropTypes';
4
+ import { FilterColumn, FilteredColumn } from '../types/Filter';
5
+ declare class FilterFacade {
6
+ [key: string]: ReducerCallback;
7
+ getInputType(type: string): string;
8
+ getOperators(): string[];
9
+ getMatchingOperators(column: FilterColumn): InputOption[];
10
+ getFilterableColumns(ModelClass: typeof Model): FilterColumn[];
11
+ checkIfCanApplyFilters(columnsFilter: FilteredColumn[]): boolean;
12
+ }
13
+ declare const _default: (new (...args: any[]) => {
14
+ reducers: {
15
+ [name: string]: import('@luminix/core/dist/types/Collection').Collection<import('@luminix/core/dist/types/Reducer').Reducer>;
16
+ };
17
+ reducer(name: string, callback: ReducerCallback, priority?: number): () => void;
18
+ removeReducer(name: string, callback: ReducerCallback): void;
19
+ getReducer(name: string): import('@luminix/core/dist/types/Collection').Collection<import('@luminix/core/dist/types/Reducer').Reducer>;
20
+ hasReducer(name: string): boolean;
21
+ clearReducer(name: string): void;
22
+ flushReducers(): void;
23
+ }) & typeof FilterFacade;
24
+ export default _default;
@@ -0,0 +1,2 @@
1
+ import { ActionCallbackEvent } from '../types/Table';
2
+ export default function useActionEvent(): ActionCallbackEvent;
@@ -0,0 +1,6 @@
1
+ /**
2
+ *
3
+ * Sets the back button to be visible.
4
+ *
5
+ */
6
+ export default function useBackButton(): void;
@@ -0,0 +1 @@
1
+ export default function useCurrentModel(): typeof import('@luminix/core').Model;
@@ -0,0 +1 @@
1
+ export default function useDialog(): import('../types/Dialog').DialogFunction;
@@ -0,0 +1 @@
1
+ export default function useDisplaceNotifications(value: string | number | false): void;
@@ -0,0 +1 @@
1
+ export default function useHandleError(): (error: unknown) => void;
@@ -0,0 +1,6 @@
1
+ /**
2
+ *
3
+ * Returns true if the back button should be visible.
4
+ *
5
+ */
6
+ export default function useHasBackButton(): boolean;
@@ -0,0 +1,7 @@
1
+ /**
2
+ *
3
+ * Gets whether the search bar is visible.
4
+ *
5
+ * @returns {boolean} Whether the search bar is visible.
6
+ */
7
+ export default function useHasSearch(): boolean;
@@ -0,0 +1,7 @@
1
+ /**
2
+ *
3
+ * Gets whether the current layout is desktop mode.
4
+ *
5
+ * @returns {boolean} Whether the current layout is desktop mode.
6
+ */
7
+ export default function useIsDesktopMode(): boolean;
@@ -0,0 +1 @@
1
+ export default function useKeyChord(keys: string[], onPress?: () => void): boolean;
@@ -0,0 +1 @@
1
+ export default function useKeyPress(key: string, onPress?: () => void): boolean;
@@ -0,0 +1,8 @@
1
+ /**
2
+ *
3
+ * Gets the value of a layout configuration.
4
+ *
5
+ * @param {string} path The path to the configuration.
6
+ * @param {unknown} defaultValue The default value to return if the configuration is not found.
7
+ */
8
+ export default function useLayoutConfig(path: string, defaultValue?: unknown): unknown;
@@ -0,0 +1,12 @@
1
+ /**
2
+ *
3
+ * Hook to control the menu state.
4
+ *
5
+ * @returns {object} An object containing the open state and functions to open, close, and toggle the menu.
6
+ */
7
+ export default function useMenu(): {
8
+ open: boolean;
9
+ handleDrawerOpen: () => void;
10
+ handleDrawerClose: () => void;
11
+ toggle: () => void;
12
+ };
@@ -0,0 +1 @@
1
+ export default function useNotifications(): import('../types/Contexts').NotificationContextValue;
@@ -0,0 +1 @@
1
+ export default function useNotify(): import('../types/Notifications').NotifyFunction;
@@ -0,0 +1,32 @@
1
+ /**
2
+ *
3
+ * Hook to create an optimistic state. It will update the result when the state changes, if the state is not falsy.
4
+ *
5
+ * @example
6
+ * ```tsx
7
+ * const [state, setState] = React.useState<string>();
8
+ * const optimistic = useOptimistic(state);
9
+ *
10
+ * const handleClick = () => {
11
+ * if (Math.random() > 0.5) {
12
+ * setState('new value');
13
+ * } else {
14
+ * setState(null);
15
+ * }
16
+ * };
17
+ *
18
+ * // After the first time state is set to 'new value'
19
+ * // the optimistic state will always be 'new value'
20
+ *
21
+ * return (
22
+ * <>
23
+ * <p>{optimistic}</p>
24
+ * <button onClick={handleClick}>
25
+ * Change Value
26
+ * </button>
27
+ * </>
28
+ * );
29
+ * ```
30
+ *
31
+ */
32
+ export default function useOptimistic<T>(state: T): T;
@@ -0,0 +1,7 @@
1
+ /**
2
+ *
3
+ * Gets the current page title from the LayoutContext.
4
+ *
5
+ * @returns {string} The current page title.
6
+ */
7
+ export default function usePageTitle(): string;
@@ -0,0 +1,6 @@
1
+ /**
2
+ *
3
+ * Sets the search bar to be visible.
4
+ *
5
+ */
6
+ export default function useSearch(): void;
@@ -0,0 +1,10 @@
1
+ import { Model } from '@luminix/core';
2
+ export default function useSelection(): {
3
+ selected: import('@luminix/core/dist/types/Collection').Collection<Model>;
4
+ indeterminate: boolean;
5
+ allSelected: boolean;
6
+ isSelected: (item: Model) => boolean;
7
+ handleClearSelected: () => void;
8
+ handleSelectToggle: (item: Model) => void;
9
+ handleSelectToggleAll: () => void;
10
+ };
@@ -0,0 +1,8 @@
1
+ /**
2
+ *
3
+ * Sets a title for the current page.
4
+ *
5
+ * @param title
6
+ *
7
+ */
8
+ export default function useSetPageTitle(title: string): void;
@@ -0,0 +1 @@
1
+ export default function useTable(): import('../types/Contexts').TableContextValue;
@@ -0,0 +1,2 @@
1
+ export * from './dist'
2
+ export {}
File without changes
@@ -0,0 +1,18 @@
1
+ import { AppFacade, Plugin } from '@luminix/core';
2
+ import { CmsPluginOptions } from '../types/Plugin';
3
+ declare class CmsPlugin extends Plugin {
4
+ options: CmsPluginOptions;
5
+ name: string;
6
+ constructor(options?: CmsPluginOptions);
7
+ register(appFacade: AppFacade): void;
8
+ boot(): void;
9
+ private bootModels;
10
+ private bootRoutes;
11
+ private bootComponents;
12
+ private bootMenu;
13
+ private bootDefaultUserModifiers;
14
+ private bootMassActions;
15
+ private bootInstanceActions;
16
+ private bootStaticActions;
17
+ }
18
+ export default CmsPlugin;