@webiny/app-admin 5.40.6 → 5.41.0-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 (42) hide show
  1. package/base/ui/Brand.d.ts +30 -6
  2. package/base/ui/CenteredView.d.ts +15 -3
  3. package/base/ui/Dashboard.d.ts +30 -6
  4. package/base/ui/FileManager.d.ts +21 -9
  5. package/base/ui/Layout.d.ts +30 -6
  6. package/base/ui/LocaleSelector.d.ts +30 -6
  7. package/base/ui/LoginScreen.d.ts +15 -3
  8. package/base/ui/Logo.d.ts +30 -6
  9. package/base/ui/Menu.d.ts +15 -3
  10. package/base/ui/Navigation.d.ts +60 -12
  11. package/base/ui/NotFound.d.ts +30 -6
  12. package/base/ui/Search.d.ts +31 -7
  13. package/base/ui/Tags.d.ts +1 -1
  14. package/base/ui/UserMenu.d.ts +106 -22
  15. package/components/BulkActions/useDialogWithReport/DialogMessage.d.ts +1 -1
  16. package/components/BulkActions/useDialogWithReport/useDialogWithReport.styled.d.ts +1 -1
  17. package/components/Buttons/Buttons.d.ts +1 -1
  18. package/components/Buttons/Buttons.js +5 -3
  19. package/components/Buttons/Buttons.js.map +1 -1
  20. package/components/Filters/Filters.d.ts +4 -4
  21. package/components/Filters/Filters.js.map +1 -1
  22. package/components/RichTextEditor/tools/utils.d.ts +1 -1
  23. package/components/SimpleUI/InputField.d.ts +1 -1
  24. package/hooks/index.d.ts +0 -1
  25. package/hooks/index.js +0 -11
  26. package/hooks/index.js.map +1 -1
  27. package/hooks/useConfirmationDialog.d.ts +1 -1
  28. package/hooks/useKeyHandler.d.ts +2 -2
  29. package/hooks/useStateWithCallback.d.ts +3 -3
  30. package/package.json +19 -19
  31. package/plugins/globalSearch/SearchBar.d.ts +15 -3
  32. package/styles/material-theme-assignments.scss +6 -0
  33. package/types.d.ts +8 -8
  34. package/ui/elements/ButtonElement.d.ts +3 -3
  35. package/ui/elements/ButtonElement.js.map +1 -1
  36. package/ui/elements/SmallButtonElement.d.ts +2 -1
  37. package/ui/elements/SmallButtonElement.js.map +1 -1
  38. package/ui/elements/TypographyElement.d.ts +1 -1
  39. package/ui/elements/form/InputElement.d.ts +1 -1
  40. package/hooks/createGenericContext.d.ts +0 -13
  41. package/hooks/createGenericContext.js +0 -34
  42. package/hooks/createGenericContext.js.map +0 -1
@@ -17,62 +17,146 @@ interface UserMenuProviderProps {
17
17
  [key: string]: any;
18
18
  }
19
19
  export declare const UserMenuProvider: (Component: ComponentWithChildren) => ({ children, ...props }: UserMenuProviderProps) => React.JSX.Element;
20
- export declare const UserMenu: import("@webiny/app").GenericComponent<any> & {
21
- original: import("@webiny/app").GenericComponent<any>;
20
+ export declare const UserMenu: (() => React.JSX.Element) & {
21
+ original: () => React.JSX.Element;
22
22
  originalName: string;
23
23
  displayName: string;
24
24
  } & {
25
- createDecorator: (decorator: import("@webiny/app").Decorator<(props: any) => JSX.Element | null>) => (props: unknown) => React.JSX.Element;
25
+ original: (() => React.JSX.Element) & {
26
+ original: () => React.JSX.Element;
27
+ originalName: string;
28
+ displayName: string;
29
+ };
30
+ originalName: string;
31
+ displayName: string;
32
+ } & {
33
+ createDecorator: (decorator: import("@webiny/app").ComponentDecorator<(() => React.JSX.Element) & {
34
+ original: () => React.JSX.Element;
35
+ originalName: string;
36
+ displayName: string;
37
+ }>) => (props: unknown) => React.JSX.Element;
26
38
  };
27
- export declare const UserMenuRenderer: import("@webiny/app").GenericComponent<any> & {
28
- original: import("@webiny/app").GenericComponent<any>;
39
+ export declare const UserMenuRenderer: ((props: unknown) => JSX.Element | null) & {
40
+ original: (props: unknown) => JSX.Element | null;
41
+ originalName: string;
42
+ displayName: string;
43
+ } & {
44
+ original: ((props: unknown) => JSX.Element | null) & {
45
+ original: (props: unknown) => JSX.Element | null;
46
+ originalName: string;
47
+ displayName: string;
48
+ };
29
49
  originalName: string;
30
50
  displayName: string;
31
51
  } & {
32
- createDecorator: (decorator: import("@webiny/app").Decorator<(props: any) => JSX.Element | null>) => (props: unknown) => React.JSX.Element;
52
+ createDecorator: (decorator: import("@webiny/app").ComponentDecorator<((props: unknown) => JSX.Element | null) & {
53
+ original: (props: unknown) => JSX.Element | null;
54
+ originalName: string;
55
+ displayName: string;
56
+ }>) => (props: unknown) => React.JSX.Element;
33
57
  };
34
- export declare const UserMenuHandle: import("@webiny/app").GenericComponent<any> & {
35
- original: import("@webiny/app").GenericComponent<any>;
58
+ export declare const UserMenuHandle: (() => React.JSX.Element) & {
59
+ original: () => React.JSX.Element;
36
60
  originalName: string;
37
61
  displayName: string;
38
62
  } & {
39
- createDecorator: (decorator: import("@webiny/app").Decorator<(props: any) => JSX.Element | null>) => (props: unknown) => React.JSX.Element;
63
+ original: (() => React.JSX.Element) & {
64
+ original: () => React.JSX.Element;
65
+ originalName: string;
66
+ displayName: string;
67
+ };
68
+ originalName: string;
69
+ displayName: string;
70
+ } & {
71
+ createDecorator: (decorator: import("@webiny/app").ComponentDecorator<(() => React.JSX.Element) & {
72
+ original: () => React.JSX.Element;
73
+ originalName: string;
74
+ displayName: string;
75
+ }>) => (props: unknown) => React.JSX.Element;
40
76
  };
41
- export declare const UserMenuHandleRenderer: import("@webiny/app").GenericComponent<any> & {
42
- original: import("@webiny/app").GenericComponent<any>;
77
+ export declare const UserMenuHandleRenderer: ((props: unknown) => JSX.Element | null) & {
78
+ original: (props: unknown) => JSX.Element | null;
43
79
  originalName: string;
44
80
  displayName: string;
45
81
  } & {
46
- createDecorator: (decorator: import("@webiny/app").Decorator<(props: any) => JSX.Element | null>) => (props: unknown) => React.JSX.Element;
82
+ original: ((props: unknown) => JSX.Element | null) & {
83
+ original: (props: unknown) => JSX.Element | null;
84
+ originalName: string;
85
+ displayName: string;
86
+ };
87
+ originalName: string;
88
+ displayName: string;
89
+ } & {
90
+ createDecorator: (decorator: import("@webiny/app").ComponentDecorator<((props: unknown) => JSX.Element | null) & {
91
+ original: (props: unknown) => JSX.Element | null;
92
+ originalName: string;
93
+ displayName: string;
94
+ }>) => (props: unknown) => React.JSX.Element;
47
95
  };
48
96
  export interface UserMenuItemProps {
49
97
  menuItem: UserMenuItemData;
50
98
  }
51
- export declare const UserMenuItem: import("@webiny/app").GenericComponent<UserMenuItemProps> & {
52
- original: import("@webiny/app").GenericComponent<UserMenuItemProps>;
99
+ export declare const UserMenuItem: (({ menuItem }: UserMenuItemProps) => React.JSX.Element) & {
100
+ original: ({ menuItem }: UserMenuItemProps) => React.JSX.Element;
53
101
  originalName: string;
54
102
  displayName: string;
55
103
  } & {
56
- createDecorator: (decorator: import("@webiny/app").Decorator<(props: UserMenuItemProps) => JSX.Element | null>) => (props: unknown) => React.JSX.Element;
104
+ original: (({ menuItem }: UserMenuItemProps) => React.JSX.Element) & {
105
+ original: ({ menuItem }: UserMenuItemProps) => React.JSX.Element;
106
+ originalName: string;
107
+ displayName: string;
108
+ };
109
+ originalName: string;
110
+ displayName: string;
111
+ } & {
112
+ createDecorator: (decorator: import("@webiny/app").ComponentDecorator<(({ menuItem }: UserMenuItemProps) => React.JSX.Element) & {
113
+ original: ({ menuItem }: UserMenuItemProps) => React.JSX.Element;
114
+ originalName: string;
115
+ displayName: string;
116
+ }>) => (props: unknown) => React.JSX.Element;
57
117
  };
58
- export declare const UserMenuItemRenderer: import("@webiny/app").GenericComponent<any> & {
59
- original: import("@webiny/app").GenericComponent<any>;
118
+ export declare const UserMenuItemRenderer: ((props: unknown) => JSX.Element | null) & {
119
+ original: (props: unknown) => JSX.Element | null;
120
+ originalName: string;
121
+ displayName: string;
122
+ } & {
123
+ original: ((props: unknown) => JSX.Element | null) & {
124
+ original: (props: unknown) => JSX.Element | null;
125
+ originalName: string;
126
+ displayName: string;
127
+ };
60
128
  originalName: string;
61
129
  displayName: string;
62
130
  } & {
63
- createDecorator: (decorator: import("@webiny/app").Decorator<(props: any) => JSX.Element | null>) => (props: unknown) => React.JSX.Element;
131
+ createDecorator: (decorator: import("@webiny/app").ComponentDecorator<((props: unknown) => JSX.Element | null) & {
132
+ original: (props: unknown) => JSX.Element | null;
133
+ originalName: string;
134
+ displayName: string;
135
+ }>) => (props: unknown) => React.JSX.Element;
64
136
  };
65
137
  export declare const AddUserMenuItem: (props: UserMenuItemProps["menuItem"]) => null;
66
- export declare type UserMenuItemContext = UserMenuItemData;
138
+ export type UserMenuItemContext = UserMenuItemData;
67
139
  export declare function useUserMenuItem(): UserMenuItemData;
68
140
  export interface UserMenuItemsProps {
69
141
  menuItems: UserMenuItemData[];
70
142
  }
71
- export declare const UserMenuItems: import("@webiny/app").GenericComponent<UserMenuItemsProps> & {
72
- original: import("@webiny/app").GenericComponent<UserMenuItemsProps>;
143
+ export declare const UserMenuItems: (({ menuItems }: UserMenuItemsProps) => React.JSX.Element) & {
144
+ original: ({ menuItems }: UserMenuItemsProps) => React.JSX.Element;
145
+ originalName: string;
146
+ displayName: string;
147
+ } & {
148
+ original: (({ menuItems }: UserMenuItemsProps) => React.JSX.Element) & {
149
+ original: ({ menuItems }: UserMenuItemsProps) => React.JSX.Element;
150
+ originalName: string;
151
+ displayName: string;
152
+ };
73
153
  originalName: string;
74
154
  displayName: string;
75
155
  } & {
76
- createDecorator: (decorator: import("@webiny/app").Decorator<(props: UserMenuItemsProps) => JSX.Element | null>) => (props: unknown) => React.JSX.Element;
156
+ createDecorator: (decorator: import("@webiny/app").ComponentDecorator<(({ menuItems }: UserMenuItemsProps) => React.JSX.Element) & {
157
+ original: ({ menuItems }: UserMenuItemsProps) => React.JSX.Element;
158
+ originalName: string;
159
+ displayName: string;
160
+ }>) => (props: unknown) => React.JSX.Element;
77
161
  };
78
162
  export {};
@@ -1,5 +1,5 @@
1
1
  import React from "react";
2
2
  import { ShowResultsDialogParams } from "./index";
3
- declare type ResultDialogMessageProps = Pick<ShowResultsDialogParams, "results" | "message">;
3
+ type ResultDialogMessageProps = Pick<ShowResultsDialogParams, "results" | "message">;
4
4
  export declare const ResultDialogMessage: ({ results, message }: ResultDialogMessageProps) => React.JSX.Element;
5
5
  export {};
@@ -11,7 +11,7 @@ export declare const ListItem: import("@emotion/styled").StyledComponent<import(
11
11
  } & {
12
12
  theme?: import("@emotion/react").Theme | undefined;
13
13
  }, {}, {}>;
14
- declare type ListItemGraphicProps = {
14
+ type ListItemGraphicProps = {
15
15
  status: "success" | "failure";
16
16
  };
17
17
  export declare const ListItemGraphic: import("@emotion/styled").StyledComponent<import("@webiny/ui/List").ListItemGraphicProps & {
@@ -20,4 +20,4 @@ export { ButtonContainer };
20
20
  export declare const ButtonDefault: ({ onAction, ...other }: ButtonProps) => React.JSX.Element;
21
21
  export declare const ButtonPrimary: ({ onAction, ...other }: ButtonProps) => React.JSX.Element;
22
22
  export declare const ButtonSecondary: ({ onAction, ...other }: ButtonProps) => React.JSX.Element;
23
- export declare const IconButton: ({ label, onAction, tooltipPlacement, ...other }: IconButtonProps) => React.JSX.Element;
23
+ export declare const IconButton: ({ label, onAction, tooltipPlacement, disabled, ...other }: IconButtonProps) => React.JSX.Element;
@@ -20,7 +20,7 @@ var _Buttons = require("./Buttons.styles");
20
20
  var _excluded = ["onAction"],
21
21
  _excluded2 = ["onAction"],
22
22
  _excluded3 = ["onAction"],
23
- _excluded4 = ["label", "onAction", "tooltipPlacement"];
23
+ _excluded4 = ["label", "onAction", "tooltipPlacement", "disabled"];
24
24
  var Buttons = exports.Buttons = function Buttons(props) {
25
25
  if (!props.actions.length) {
26
26
  return null;
@@ -56,8 +56,9 @@ var IconButton = exports.IconButton = function IconButton(_ref4) {
56
56
  var label = _ref4.label,
57
57
  onAction = _ref4.onAction,
58
58
  tooltipPlacement = _ref4.tooltipPlacement,
59
+ disabled = _ref4.disabled,
59
60
  other = (0, _objectWithoutProperties2.default)(_ref4, _excluded4);
60
- if (label) {
61
+ if (label && !disabled) {
61
62
  return /*#__PURE__*/_react.default.createElement(_Tooltip.Tooltip, {
62
63
  content: label,
63
64
  placement: tooltipPlacement
@@ -66,7 +67,8 @@ var IconButton = exports.IconButton = function IconButton(_ref4) {
66
67
  })));
67
68
  }
68
69
  return /*#__PURE__*/_react.default.createElement(_Button.IconButton, Object.assign({}, other, {
69
- onClick: onAction
70
+ onClick: onAction,
71
+ disabled: disabled
70
72
  }));
71
73
  };
72
74
 
@@ -1 +1 @@
1
- {"version":3,"names":["_react","_interopRequireDefault","require","_Button","_Tooltip","_useButtons","_Buttons","_excluded","_excluded2","_excluded3","_excluded4","Buttons","exports","props","actions","length","default","createElement","Fragment","map","action","ButtonContainer","key","name","ButtonsProvider","element","ButtonDefault","_ref","onAction","other","_objectWithoutProperties2","Object","assign","onClick","ButtonPrimary","_ref2","ButtonSecondary","_ref3","IconButton","_ref4","label","tooltipPlacement","Tooltip","content","placement"],"sources":["Buttons.tsx"],"sourcesContent":["import React from \"react\";\nimport {\n ButtonDefault as BaseButtonDefault,\n ButtonPrimary as BaseButtonPrimary,\n ButtonSecondary as BaseButtonSecondary,\n IconButton as BaseIconButton,\n ButtonProps as BaseButtonProps,\n IconButtonProps as BaseIconButtonProps\n} from \"@webiny/ui/Button\";\nimport { Tooltip, TooltipProps } from \"@webiny/ui/Tooltip\";\n\nimport { ButtonsProvider } from \"./useButtons\";\nimport { ButtonContainer } from \"./Buttons.styles\";\n\ninterface ButtonProps extends Omit<BaseButtonProps, \"onClick\"> {\n onAction: (ev?: any) => void;\n}\n\ninterface IconButtonProps extends Omit<BaseIconButtonProps, \"onClick\"> {\n onAction: (ev?: any) => void;\n tooltipPlacement?: TooltipProps[\"placement\"];\n}\n\nexport interface ButtonsProps {\n actions: {\n name: string;\n element: React.ReactElement;\n }[];\n}\n\nexport const Buttons = (props: ButtonsProps) => {\n if (!props.actions.length) {\n return null;\n }\n\n return (\n <>\n {props.actions.map(action => (\n <ButtonContainer key={action.name}>\n <ButtonsProvider>{action.element}</ButtonsProvider>\n </ButtonContainer>\n ))}\n </>\n );\n};\n\nexport { ButtonContainer };\n\nexport const ButtonDefault = ({ onAction, ...other }: ButtonProps) => {\n return <BaseButtonDefault {...other} onClick={onAction} />;\n};\n\nexport const ButtonPrimary = ({ onAction, ...other }: ButtonProps) => {\n return <BaseButtonPrimary {...other} onClick={onAction} />;\n};\n\nexport const ButtonSecondary = ({ onAction, ...other }: ButtonProps) => {\n return <BaseButtonSecondary {...other} onClick={onAction} />;\n};\n\nexport const IconButton = ({ label, onAction, tooltipPlacement, ...other }: IconButtonProps) => {\n if (label) {\n return (\n <Tooltip content={label} placement={tooltipPlacement}>\n <BaseIconButton {...other} onClick={onAction} />\n </Tooltip>\n );\n }\n\n return <BaseIconButton {...other} onClick={onAction} />;\n};\n"],"mappings":";;;;;;;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AAQA,IAAAE,QAAA,GAAAF,OAAA;AAEA,IAAAG,WAAA,GAAAH,OAAA;AACA,IAAAI,QAAA,GAAAJ,OAAA;AAAmD,IAAAK,SAAA;EAAAC,UAAA;EAAAC,UAAA;EAAAC,UAAA;AAkB5C,IAAMC,OAAO,GAAAC,OAAA,CAAAD,OAAA,GAAG,SAAVA,OAAOA,CAAIE,KAAmB,EAAK;EAC5C,IAAI,CAACA,KAAK,CAACC,OAAO,CAACC,MAAM,EAAE;IACvB,OAAO,IAAI;EACf;EAEA,oBACIf,MAAA,CAAAgB,OAAA,CAAAC,aAAA,CAAAjB,MAAA,CAAAgB,OAAA,CAAAE,QAAA,QACKL,KAAK,CAACC,OAAO,CAACK,GAAG,CAAC,UAAAC,MAAM;IAAA,oBACrBpB,MAAA,CAAAgB,OAAA,CAAAC,aAAA,CAACX,QAAA,CAAAe,eAAe;MAACC,GAAG,EAAEF,MAAM,CAACG;IAAK,gBAC9BvB,MAAA,CAAAgB,OAAA,CAAAC,aAAA,CAACZ,WAAA,CAAAmB,eAAe,QAAEJ,MAAM,CAACK,OAAyB,CACrC,CAAC;EAAA,CACrB,CACH,CAAC;AAEX,CAAC;AAIM,IAAMC,aAAa,GAAAd,OAAA,CAAAc,aAAA,GAAG,SAAhBA,aAAaA,CAAAC,IAAA,EAA4C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AF,KAAA,CAAhBE,gBAAgB;IAAKZ,KAAK,OAAAC,yBAAA,CAAAd,OAAA,EAAAuB,KAAA,EAAA7B,UAAA;EACpE,IAAI8B,KAAK,EAAE;IACP,oBACIxC,MAAA,CAAAgB,OAAA,CAAAC,aAAA,CAACb,QAAA,CAAAsC,OAAO;MAACC,OAAO,EAAEH,KAAM;MAACI,SAAS,EAAEH;IAAiB,gBACjDzC,MAAA,CAAAgB,OAAA,CAAAC,aAAA,CAACd,OAAA,CAAAmC,UAAc,EAAAP,MAAA,CAAAC,MAAA,KAAKH,KAAK;MAAEI,OAAO,EAAEL;IAAS,EAAE,CAC1C,CAAC;EAElB;EAEA,oBAAO5B,MAAA,CAAAgB,OAAA,CAAAC,aAAA,CAACd,OAAA,CAAAmC,UAAc,EAAAP,MAAA,CAAAC,MAAA,KAAKH,KAAK;IAAEI,OAAO,EAAEL;EAAS,EAAE,CAAC;AAC3D,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["_react","_interopRequireDefault","require","_Button","_Tooltip","_useButtons","_Buttons","_excluded","_excluded2","_excluded3","_excluded4","Buttons","exports","props","actions","length","default","createElement","Fragment","map","action","ButtonContainer","key","name","ButtonsProvider","element","ButtonDefault","_ref","onAction","other","_objectWithoutProperties2","Object","assign","onClick","ButtonPrimary","_ref2","ButtonSecondary","_ref3","IconButton","_ref4","label","tooltipPlacement","disabled","Tooltip","content","placement"],"sources":["Buttons.tsx"],"sourcesContent":["import React from \"react\";\nimport {\n ButtonDefault as BaseButtonDefault,\n ButtonPrimary as BaseButtonPrimary,\n ButtonSecondary as BaseButtonSecondary,\n IconButton as BaseIconButton,\n ButtonProps as BaseButtonProps,\n IconButtonProps as BaseIconButtonProps\n} from \"@webiny/ui/Button\";\nimport { Tooltip, TooltipProps } from \"@webiny/ui/Tooltip\";\n\nimport { ButtonsProvider } from \"./useButtons\";\nimport { ButtonContainer } from \"./Buttons.styles\";\n\ninterface ButtonProps extends Omit<BaseButtonProps, \"onClick\"> {\n onAction: (ev?: any) => void;\n}\n\ninterface IconButtonProps extends Omit<BaseIconButtonProps, \"onClick\"> {\n onAction: (ev?: any) => void;\n tooltipPlacement?: TooltipProps[\"placement\"];\n}\n\nexport interface ButtonsProps {\n actions: {\n name: string;\n element: React.ReactElement;\n }[];\n}\n\nexport const Buttons = (props: ButtonsProps) => {\n if (!props.actions.length) {\n return null;\n }\n\n return (\n <>\n {props.actions.map(action => (\n <ButtonContainer key={action.name}>\n <ButtonsProvider>{action.element}</ButtonsProvider>\n </ButtonContainer>\n ))}\n </>\n );\n};\n\nexport { ButtonContainer };\n\nexport const ButtonDefault = ({ onAction, ...other }: ButtonProps) => {\n return <BaseButtonDefault {...other} onClick={onAction} />;\n};\n\nexport const ButtonPrimary = ({ onAction, ...other }: ButtonProps) => {\n return <BaseButtonPrimary {...other} onClick={onAction} />;\n};\n\nexport const ButtonSecondary = ({ onAction, ...other }: ButtonProps) => {\n return <BaseButtonSecondary {...other} onClick={onAction} />;\n};\n\nexport const IconButton = ({\n label,\n onAction,\n tooltipPlacement,\n disabled,\n ...other\n}: IconButtonProps) => {\n if (label && !disabled) {\n return (\n <Tooltip content={label} placement={tooltipPlacement}>\n <BaseIconButton {...other} onClick={onAction} />\n </Tooltip>\n );\n }\n\n return <BaseIconButton {...other} onClick={onAction} disabled={disabled} />;\n};\n"],"mappings":";;;;;;;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AAQA,IAAAE,QAAA,GAAAF,OAAA;AAEA,IAAAG,WAAA,GAAAH,OAAA;AACA,IAAAI,QAAA,GAAAJ,OAAA;AAAmD,IAAAK,SAAA;EAAAC,UAAA;EAAAC,UAAA;EAAAC,UAAA;AAkB5C,IAAMC,OAAO,GAAAC,OAAA,CAAAD,OAAA,GAAG,SAAVA,OAAOA,CAAIE,KAAmB,EAAK;EAC5C,IAAI,CAACA,KAAK,CAACC,OAAO,CAACC,MAAM,EAAE;IACvB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FormProps, GenericFormData } from "@webiny/form";
3
- declare type Filter = {
3
+ type Filter = {
4
4
  name: string;
5
5
  element: React.ReactElement;
6
6
  };
7
- export declare type GenericFiltersData = GenericFormData;
8
- export declare type FiltersOnSubmit<T extends GenericFiltersData = GenericFiltersData> = FormOnSubmit<T>;
9
- export interface FiltersProps<T> extends Pick<FormProps<T>, "data" | "onChange"> {
7
+ export type GenericFiltersData = GenericFormData;
8
+ export type FiltersOnSubmit<T extends GenericFiltersData = GenericFiltersData> = FormOnSubmit<T>;
9
+ export interface FiltersProps<T extends GenericFormData = GenericFormData> extends Pick<FormProps<T>, "data" | "onChange"> {
10
10
  filters: Filter[];
11
11
  show: boolean;
12
12
  children?: React.ReactNode;
@@ -1 +1 @@
1
- {"version":3,"names":["_react","_interopRequireDefault","require","_form","_Filters","Filters","exports","props","show","filters","length","default","createElement","FiltersContainer","Form","data","onChange","FormContainer","map","filter","FilterContainer","key","name","element","children"],"sources":["Filters.tsx"],"sourcesContent":["import React from \"react\";\nimport { Form, FormOnSubmit, FormProps, GenericFormData } from \"@webiny/form\";\n\nimport { FilterContainer, FiltersContainer, FormContainer } from \"./Filters.styled\";\n\ntype Filter = {\n name: string;\n element: React.ReactElement;\n};\n\nexport type GenericFiltersData = GenericFormData;\n\nexport type FiltersOnSubmit<T extends GenericFiltersData = GenericFiltersData> = FormOnSubmit<T>;\n\nexport interface FiltersProps<T> extends Pick<FormProps<T>, \"data\" | \"onChange\"> {\n filters: Filter[];\n show: boolean;\n children?: React.ReactNode;\n [\"data-testid\"]?: string;\n}\n\nexport const Filters = <T extends GenericFiltersData = GenericFiltersData>(\n props: FiltersProps<T>\n) => {\n if (!props.show || !props.filters.length) {\n return null;\n }\n\n return (\n <FiltersContainer data-testid={props[\"data-testid\"] || \"filters-container\"}>\n <Form data={props.data} onChange={props.onChange}>\n {() => (\n <FormContainer>\n {props.filters.map(filter => (\n <FilterContainer key={filter.name}>{filter.element}</FilterContainer>\n ))}\n {props.children}\n </FormContainer>\n )}\n </Form>\n </FiltersContainer>\n );\n};\n"],"mappings":";;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AAEA,IAAAE,QAAA,GAAAF,OAAA;AAkBO,IAAMG,OAAO,GAAAC,OAAA,CAAAD,OAAA,GAAG,SAAVA,OAAOA,CAChBE,KAAsB,EACrB;EACD,IAAI,CAACA,KAAK,CAACC,IAAI,IAAI,CAACD,KAAK,CAACE,OAAO,CAACC,MAAM,EAAE;IACtC,OAAO,IAAI;EACf;EAEA,oBACIV,MAAA,CAAAW,OAAA,CAAAC,aAAA,CAACR,QAAA,CAAAS,gBAAgB;IAAC,eAAaN,KAAK,CAAC,aAAa,CAAC,IAAI;EAAoB,gBACvEP,MAAA,CAAAW,OAAA,CAAAC,aAAA,CAACT,KAAA,CAAAW,IAAI;IAACC,IAAI,EAAER,KAAK,CAACQ,IAAK;IAACC,QAAQ,EAAET,KAAK,CAACS;EAAS,GAC5C;IAAA,oBACGhB,MAAA,CAAAW,OAAA,CAAAC,aAAA,CAACR,QAAA,CAAAa,aAAa,QACTV,KAAK,CAACE,OAAO,CAACS,GAAG,CAAC,UAAAC,MAAM;MAAA,oBACrBnB,MAAA,CAAAW,OAAA,CAAAC,aAAA,CAACR,QAAA,CAAAgB,eAAe;QAACC,GAAG,EAAEF,MAAM,CAACG;MAAK,GAAEH,MAAM,CAACI,OAAyB,CAAC;IAAA,CACxE,CAAC,EACDhB,KAAK,CAACiB,QACI,CAAC;EAAA,CAElB,CACQ,CAAC;AAE3B,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["_react","_interopRequireDefault","require","_form","_Filters","Filters","exports","props","show","filters","length","default","createElement","FiltersContainer","Form","data","onChange","FormContainer","map","filter","FilterContainer","key","name","element","children"],"sources":["Filters.tsx"],"sourcesContent":["import React from \"react\";\nimport { Form, FormOnSubmit, FormProps, GenericFormData } from \"@webiny/form\";\n\nimport { FilterContainer, FiltersContainer, FormContainer } from \"./Filters.styled\";\n\ntype Filter = {\n name: string;\n element: React.ReactElement;\n};\n\nexport type GenericFiltersData = GenericFormData;\n\nexport type FiltersOnSubmit<T extends GenericFiltersData = GenericFiltersData> = FormOnSubmit<T>;\n\nexport interface FiltersProps<T extends GenericFormData = GenericFormData>\n extends Pick<FormProps<T>, \"data\" | \"onChange\"> {\n filters: Filter[];\n show: boolean;\n children?: React.ReactNode;\n [\"data-testid\"]?: string;\n}\n\nexport const Filters = <T extends GenericFiltersData = GenericFiltersData>(\n props: FiltersProps<T>\n) => {\n if (!props.show || !props.filters.length) {\n return null;\n }\n\n return (\n <FiltersContainer data-testid={props[\"data-testid\"] || \"filters-container\"}>\n <Form data={props.data} onChange={props.onChange}>\n {() => (\n <FormContainer>\n {props.filters.map(filter => (\n <FilterContainer key={filter.name}>{filter.element}</FilterContainer>\n ))}\n {props.children}\n </FormContainer>\n )}\n </Form>\n </FiltersContainer>\n );\n};\n"],"mappings":";;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AAEA,IAAAE,QAAA,GAAAF,OAAA;AAmBO,IAAMG,OAAO,GAAAC,OAAA,CAAAD,OAAA,GAAG,SAAVA,OAAOA,CAChBE,KAAsB,EACrB;EACD,IAAI,CAACA,KAAK,CAACC,IAAI,IAAI,CAACD,KAAK,CAACE,OAAO,CAACC,MAAM,EAAE;IACtC,OAAO,IAAI;EACf;EAEA,oBACIV,MAAA,CAAAW,OAAA,CAAAC,aAAA,CAACR,QAAA,CAAAS,gBAAgB;IAAC,eAAaN,KAAK,CAAC,aAAa,CAAC,IAAI;EAAoB,gBACvEP,MAAA,CAAAW,OAAA,CAAAC,aAAA,CAACT,KAAA,CAAAW,IAAI;IAACC,IAAI,EAAER,KAAK,CAACQ,IAAK;IAACC,QAAQ,EAAET,KAAK,CAACS;EAAS,GAC5C;IAAA,oBACGhB,MAAA,CAAAW,OAAA,CAAAC,aAAA,CAACR,QAAA,CAAAa,aAAa,QACTV,KAAK,CAACE,OAAO,CAACS,GAAG,CAAC,UAAAC,MAAM;MAAA,oBACrBnB,MAAA,CAAAW,OAAA,CAAAC,aAAA,CAACR,QAAA,CAAAgB,eAAe;QAACC,GAAG,EAAEF,MAAM,CAACG;MAAK,GAAEH,MAAM,CAACI,OAAyB,CAAC;IAAA,CACxE,CAAC,EACDhB,KAAK,CAACiB,QACI,CAAC;EAAA,CAElB,CACQ,CAAC;AAE3B,CAAC","ignoreList":[]}
@@ -3,7 +3,7 @@ export declare enum TextAlign {
3
3
  END = "end",
4
4
  CENTER = "center"
5
5
  }
6
- export declare type Alignment = {
6
+ export type Alignment = {
7
7
  name: TextAlign;
8
8
  svg: string;
9
9
  };
@@ -1,5 +1,5 @@
1
1
  import React from "react";
2
- export declare type OnKeyDownProps = React.SyntheticEvent<HTMLInputElement, Event> & React.KeyboardEvent<HTMLInputElement>;
2
+ export type OnKeyDownProps = React.SyntheticEvent<HTMLInputElement, Event> & React.KeyboardEvent<HTMLInputElement>;
3
3
  interface InputBoxProps {
4
4
  value?: string | number;
5
5
  onChange?: (value: any) => void;
package/hooks/index.d.ts CHANGED
@@ -8,4 +8,3 @@ export * from "./useStateWithCallback";
8
8
  export * from "./useModKey";
9
9
  export * from "./useIsMounted";
10
10
  export * from "./useStateIfMounted";
11
- export * from "./createGenericContext";
package/hooks/index.js CHANGED
@@ -113,16 +113,5 @@ Object.keys(_useStateIfMounted).forEach(function (key) {
113
113
  }
114
114
  });
115
115
  });
116
- var _createGenericContext = require("./createGenericContext");
117
- Object.keys(_createGenericContext).forEach(function (key) {
118
- if (key === "default" || key === "__esModule") return;
119
- if (key in exports && exports[key] === _createGenericContext[key]) return;
120
- Object.defineProperty(exports, key, {
121
- enumerable: true,
122
- get: function get() {
123
- return _createGenericContext[key];
124
- }
125
- });
126
- });
127
116
 
128
117
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_useConfirmationDialog","require","Object","keys","forEach","key","exports","defineProperty","enumerable","get","_useDialog","_useDialogs","_useSnackbar","_useKeyHandler","_useShiftKey","_useStateWithCallback","_useModKey","_useIsMounted","_useStateIfMounted","_createGenericContext"],"sources":["index.ts"],"sourcesContent":["export * from \"./useConfirmationDialog\";\nexport * from \"./useDialog\";\nexport * from \"../components/Dialogs/useDialogs\";\nexport * from \"./useSnackbar\";\nexport * from \"./useKeyHandler\";\nexport * from \"./useShiftKey\";\nexport * from \"./useStateWithCallback\";\nexport * from \"./useModKey\";\nexport * from \"./useIsMounted\";\nexport * from \"./useStateIfMounted\";\nexport * from \"./createGenericContext\";\n"],"mappings":";;;;;AAAA,IAAAA,sBAAA,GAAAC,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAH,sBAAA,EAAAI,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAL,sBAAA,CAAAK,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,IAAA;MAAA,OAAAT,sBAAA,CAAAK,GAAA;IAAA;EAAA;AAAA;AACA,IAAAK,UAAA,GAAAT,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAO,UAAA,EAAAN,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAK,UAAA,CAAAL,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,IAAA;MAAA,OAAAC,UAAA,CAAAL,GAAA;IAAA;EAAA;AAAA;AACA,IAAAM,WAAA,GAAAV,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAQ,WAAA,EAAAP,OAAA,WAAAC,GAAA;E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AA;AAAAC,MAAA,CAAAC,IAAA,CAAAe,kBAAA,EAAAd,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAa,kBAAA,CAAAb,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,IAAA;MAAA,OAAAS,kBAAA,CAAAb,GAAA;IAAA;EAAA;AAAA;AACA,IAAAc,qBAAA,GAAAlB,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAgB,qBAAA,EAAAf,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAc,qBAAA,CAAAd,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,IAAA;MAAA,OAAAU,qBAAA,CAAAd,GAAA;IAAA;EAAA;AAAA","ignoreList":[]}
1
+ {"version":3,"names":["_useConfirmationDialog","require","Object","keys","forEach","key","exports","defineProperty","enumerable","get","_useDialog","_useDialogs","_useSnackbar","_useKeyHandler","_useShiftKey","_useStateWithCallback","_useModKey","_useIsMounted","_useStateIfMounted"],"sources":["index.ts"],"sourcesContent":["export * from \"./useConfirmationDialog\";\nexport * from \"./useDialog\";\nexport * from \"../components/Dialogs/useDialogs\";\nexport * from \"./useSnackbar\";\nexport * from \"./useKeyHandler\";\nexport * from \"./useShiftKey\";\nexport * from \"./useStateWithCallback\";\nexport * from \"./useModKey\";\nexport * from \"./useIsMounted\";\nexport * from \"./useStateIfMounted\";\n"],"mappings":";;;;;AAAA,IAAAA,sBAAA,GAAAC,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAH,sBAAA,EAAAI,OAAA,WAAAC,GAAA;EAAA,I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MAAA,CAAAC,IAAA,CAAAa,UAAA,EAAAZ,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAW,UAAA,CAAAX,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,IAAA;MAAA,OAAAO,UAAA,CAAAX,GAAA;IAAA;EAAA;AAAA;AACA,IAAAY,aAAA,GAAAhB,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAc,aAAA,EAAAb,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAY,aAAA,CAAAZ,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,IAAA;MAAA,OAAAQ,aAAA,CAAAZ,GAAA;IAAA;EAAA;AAAA;AACA,IAAAa,kBAAA,GAAAjB,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAe,kBAAA,EAAAd,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAa,kBAAA,CAAAb,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,IAAA;MAAA,OAAAS,kBAAA,CAAAb,GAAA;IAAA;EAAA;AAAA","ignoreList":[]}
@@ -7,7 +7,7 @@ interface Params {
7
7
  loading?: React.ReactNode;
8
8
  [key: string]: any;
9
9
  }
10
- export declare type ShowConfirmationOnAccept = (() => void) | (() => Promise<void>);
10
+ export type ShowConfirmationOnAccept = (() => void) | (() => Promise<void>);
11
11
  export interface UseConfirmationDialogResponse {
12
12
  showConfirmation: (onAccept: ShowConfirmationOnAccept, onCancel?: () => void) => void;
13
13
  }
@@ -1,6 +1,6 @@
1
1
  import { SyntheticEvent } from "react";
2
- declare type AddKeyHandlerType = (key: string, handler: (e: SyntheticEvent<HTMLElement>) => void) => void;
3
- declare type RemoveKeyHandlerType = (key: string) => void;
2
+ type AddKeyHandlerType = (key: string, handler: (e: SyntheticEvent<HTMLElement>) => void) => void;
3
+ type RemoveKeyHandlerType = (key: string) => void;
4
4
  export declare function useKeyHandler(): {
5
5
  addKeyHandler: AddKeyHandlerType;
6
6
  removeKeyHandler: RemoveKeyHandlerType;
@@ -1,5 +1,5 @@
1
- declare type CallBackType<T> = (updatedValue: T) => void;
2
- declare type SetStateType<T> = T | ((prev: T) => T);
3
- declare type RetType = <T>(initialValue: T | (() => T)) => [T, (newValue: SetStateType<T>, callback?: CallBackType<T>) => void];
1
+ type CallBackType<T> = (updatedValue: T) => void;
2
+ type SetStateType<T> = T | ((prev: T) => T);
3
+ type RetType = <T>(initialValue: T | (() => T)) => [T, (newValue: SetStateType<T>, callback?: CallBackType<T>) => void];
4
4
  export declare const useStateWithCallback: RetType;
5
5
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webiny/app-admin",
3
- "version": "5.40.6",
3
+ "version": "5.41.0-beta.0",
4
4
  "main": "index.js",
5
5
  "description": "A collection of plugins that together form a complete admin interface, customizable and extensible with Webiny apps and plugins.",
6
6
  "repository": {
@@ -20,20 +20,20 @@
20
20
  "@svgr/webpack": "6.5.1",
21
21
  "@types/mime": "2.0.3",
22
22
  "@types/react": "18.2.79",
23
- "@webiny/app": "5.40.6",
24
- "@webiny/app-security": "5.40.6",
25
- "@webiny/app-theme": "5.40.6",
26
- "@webiny/app-wcp": "5.40.6",
27
- "@webiny/form": "5.40.6",
28
- "@webiny/lexical-editor": "5.40.6",
29
- "@webiny/plugins": "5.40.6",
30
- "@webiny/react-composition": "5.40.6",
31
- "@webiny/react-router": "5.40.6",
32
- "@webiny/telemetry": "5.40.6",
33
- "@webiny/ui": "5.40.6",
34
- "@webiny/ui-composer": "5.40.6",
35
- "@webiny/utils": "5.40.6",
36
- "@webiny/validation": "5.40.6",
23
+ "@webiny/app": "5.41.0-beta.0",
24
+ "@webiny/app-security": "5.41.0-beta.0",
25
+ "@webiny/app-theme": "5.41.0-beta.0",
26
+ "@webiny/app-wcp": "5.41.0-beta.0",
27
+ "@webiny/form": "5.41.0-beta.0",
28
+ "@webiny/lexical-editor": "5.41.0-beta.0",
29
+ "@webiny/plugins": "5.41.0-beta.0",
30
+ "@webiny/react-composition": "5.41.0-beta.0",
31
+ "@webiny/react-router": "5.41.0-beta.0",
32
+ "@webiny/telemetry": "5.41.0-beta.0",
33
+ "@webiny/ui": "5.41.0-beta.0",
34
+ "@webiny/ui-composer": "5.41.0-beta.0",
35
+ "@webiny/utils": "5.41.0-beta.0",
36
+ "@webiny/validation": "5.41.0-beta.0",
37
37
  "apollo-cache": "1.3.5",
38
38
  "apollo-client": "2.6.10",
39
39
  "apollo-link": "1.2.14",
@@ -68,11 +68,11 @@
68
68
  "@types/graphlib": "2.1.8",
69
69
  "@types/is-hotkey": "0.1.7",
70
70
  "@types/store": "2.0.2",
71
- "@webiny/cli": "5.40.6",
72
- "@webiny/project-utils": "5.40.6",
71
+ "@webiny/cli": "5.41.0-beta.0",
72
+ "@webiny/project-utils": "5.41.0-beta.0",
73
73
  "rimraf": "5.0.5",
74
74
  "ttypescript": "1.5.15",
75
- "typescript": "4.7.4"
75
+ "typescript": "4.9.5"
76
76
  },
77
77
  "publishConfig": {
78
78
  "access": "public",
@@ -95,5 +95,5 @@
95
95
  ]
96
96
  }
97
97
  },
98
- "gitHead": "f9da84b373e62f9f269599c4301e5e4418a98d51"
98
+ "gitHead": "9ce5e75fc577aa4de2cf08d5ca734b3c98fe65b6"
99
99
  }
@@ -12,11 +12,23 @@ export interface SearchBarState {
12
12
  current?: AdminGlobalSearchPlugin;
13
13
  };
14
14
  }
15
- declare const _default: import("../../index").GenericComponent<any> & {
16
- original: import("../../index").GenericComponent<any>;
15
+ declare const _default: (() => React.JSX.Element) & {
16
+ original: () => React.JSX.Element;
17
17
  originalName: string;
18
18
  displayName: string;
19
19
  } & {
20
- createDecorator: (decorator: import("../../index").Decorator<(props: any) => JSX.Element | null>) => (props: unknown) => React.JSX.Element;
20
+ original: (() => React.JSX.Element) & {
21
+ original: () => React.JSX.Element;
22
+ originalName: string;
23
+ displayName: string;
24
+ };
25
+ originalName: string;
26
+ displayName: string;
27
+ } & {
28
+ createDecorator: (decorator: import("../../index").ComponentDecorator<(() => React.JSX.Element) & {
29
+ original: () => React.JSX.Element;
30
+ originalName: string;
31
+ displayName: string;
32
+ }>) => (props: unknown) => React.JSX.Element;
21
33
  };
22
34
  export default _default;
@@ -357,6 +357,12 @@ Fix the width of input components when inside grids
357
357
  }
358
358
  }
359
359
 
360
+ .mdc-snackbar__actions {
361
+ .mdc-icon-button {
362
+ color: var(--mdc-theme-text-primary-on-dark);
363
+ }
364
+ }
365
+
360
366
  // when grid is inside another grid cell, child grid should not have any padding
361
367
  .mdc-layout-grid {
362
368
  > .mdc-layout-grid__inner {
package/types.d.ts CHANGED
@@ -2,7 +2,7 @@ import React, { ReactElement } from "react";
2
2
  import { Plugin } from "@webiny/plugins/types";
3
3
  import { ApolloClient } from "apollo-client";
4
4
  import { ItemProps, MenuProps, SectionProps } from "./plugins/MenuPlugin";
5
- export declare type AdminGlobalSearchPlugin = Plugin & {
5
+ export type AdminGlobalSearchPlugin = Plugin & {
6
6
  type: "admin-global-search";
7
7
  label: string;
8
8
  route: string;
@@ -11,14 +11,14 @@ export declare type AdminGlobalSearchPlugin = Plugin & {
11
11
  fields?: Array<string>;
12
12
  };
13
13
  };
14
- export declare type AdminGlobalSearchPreventHotkeyPlugin = Plugin & {
14
+ export type AdminGlobalSearchPreventHotkeyPlugin = Plugin & {
15
15
  type: "admin-global-search-prevent-hotkey";
16
16
  preventOpen(e: React.KeyboardEvent): boolean | void;
17
17
  };
18
18
  /**
19
19
  * LEGACY TYPE. Only for backwards compatibility.
20
20
  */
21
- export declare type AdminMenuLogoPlugin = Plugin & {
21
+ export type AdminMenuLogoPlugin = Plugin & {
22
22
  name: "admin-menu-logo";
23
23
  type: "admin-menu-logo";
24
24
  render(): React.ReactElement;
@@ -27,7 +27,7 @@ export declare type AdminMenuLogoPlugin = Plugin & {
27
27
  * Enables adding custom menu sections and items in the main menu, located on the left side of the screen.
28
28
  * @see https://docs.webiny.com/docs/webiny-apps/admin/development/plugins-reference/app#admin-menu
29
29
  */
30
- export declare type AdminMenuPlugin = Plugin & {
30
+ export type AdminMenuPlugin = Plugin & {
31
31
  type: "admin-menu";
32
32
  render(props: {
33
33
  Menu: React.ComponentType<MenuProps>;
@@ -39,7 +39,7 @@ export declare type AdminMenuPlugin = Plugin & {
39
39
  export interface AdminFileManagerFileTypePluginRenderParams {
40
40
  file: FileItem;
41
41
  }
42
- export declare type AdminFileManagerFileTypePlugin = Plugin & {
42
+ export type AdminFileManagerFileTypePlugin = Plugin & {
43
43
  type: "admin-file-manager-file-type";
44
44
  types: string[];
45
45
  render(params: AdminFileManagerFileTypePluginRenderParams): React.ReactNode;
@@ -50,7 +50,7 @@ export declare type AdminFileManagerFileTypePlugin = Plugin & {
50
50
  export interface AdminInstallationPluginRenderParams {
51
51
  onInstalled: () => Promise<void>;
52
52
  }
53
- export declare type AdminInstallationPlugin = Plugin & {
53
+ export type AdminInstallationPlugin = Plugin & {
54
54
  type: "admin-installation";
55
55
  getInstalledVersion(params: {
56
56
  client: ApolloClient<object>;
@@ -60,7 +60,7 @@ export declare type AdminInstallationPlugin = Plugin & {
60
60
  secure: boolean;
61
61
  render(params: AdminInstallationPluginRenderParams): React.ReactNode;
62
62
  };
63
- export declare type AdminAppPermissionRendererPlugin = Plugin & {
63
+ export type AdminAppPermissionRendererPlugin = Plugin & {
64
64
  type: "admin-app-permissions-renderer";
65
65
  system?: boolean;
66
66
  render(params: any): ReactElement;
@@ -110,6 +110,6 @@ export interface FileManagerSecurityPermission extends SecurityPermission {
110
110
  rwd?: string;
111
111
  own?: boolean;
112
112
  }
113
- export declare type ComponentWithChildren = React.ComponentType<{
113
+ export type ComponentWithChildren = React.ComponentType<{
114
114
  children?: React.ReactNode;
115
115
  }>;
@@ -1,6 +1,6 @@
1
1
  import React from "react";
2
- import { UIElement, UIElementConfig } from "../UIElement";
3
- export declare type ButtonElementType = "default" | "primary" | "secondary";
2
+ import { UIElement, UIElementConfig, UiElementRenderProps } from "../UIElement";
3
+ export type ButtonElementType = "default" | "primary" | "secondary";
4
4
  export interface ButtonOnClick<TRenderProps = any> {
5
5
  (props: TRenderProps): void;
6
6
  }
@@ -12,7 +12,7 @@ export interface ButtonElementConfig<TRenderProps> extends UIElementConfig {
12
12
  label: string | GetterWithProps<TRenderProps, string>;
13
13
  onClick: ButtonOnClick<TRenderProps>;
14
14
  }
15
- export declare class ButtonElement<TRenderProps = any> extends UIElement<ButtonElementConfig<TRenderProps>> {
15
+ export declare class ButtonElement<TRenderProps extends UiElementRenderProps = UiElementRenderProps> extends UIElement<ButtonElementConfig<TRenderProps>> {
16
16
  setLabel<TProps extends TRenderProps = TRenderProps>(label: string | GetterWithProps<TProps, string>): void;
17
17
  getLabel(props?: TRenderProps): string;
18
18
  setType(type: ButtonElementType): void;
@@ -1 +1 @@
1
- {"version":3,"names":["_react","_interopRequireDefault","require","_Button","_UIElement2","_kebabCase","BUTTONS","default","ButtonDefault","primary","ButtonPrimary","secondary","ButtonSecondary","ButtonElement","exports","_UIElement","_classCallCheck2","_callSuper2","arguments","_inherits2","_createClass2","key","value","setLabel","label","config","getLabel","props","setType","type","getType","setOnClick","onClick","getOnClick","render","Component","createElement","concat","kebabCase","UIElement"],"sources":["ButtonElement.tsx"],"sourcesContent":["import React from \"react\";\nimport { ButtonDefault, ButtonPrimary, ButtonSecondary } from \"@webiny/ui/Button\";\nimport { UIElement, UIElementConfig } from \"../UIElement\";\nimport kebabCase from \"lodash/kebabCase\";\n\nexport type ButtonElementType = \"default\" | \"primary\" | \"secondary\";\n\nexport interface ButtonOnClick<TRenderProps = any> {\n (props: TRenderProps): void;\n}\n\ninterface GetterWithProps<TProps, TReturn> {\n (props: TProps): TReturn;\n}\n\nexport interface ButtonElementConfig<TRenderProps> extends UIElementConfig {\n type: ButtonElementType | GetterWithProps<TRenderProps, ButtonElementType>;\n label: string | GetterWithProps<TRenderProps, string>;\n onClick: ButtonOnClick<TRenderProps>;\n}\n\nconst BUTTONS = {\n default: ButtonDefault,\n primary: ButtonPrimary,\n secondary: ButtonSecondary\n};\n\nexport class ButtonElement<TRenderProps = any> extends UIElement<\n ButtonElementConfig<TRenderProps>\n> {\n public setLabel<TProps extends TRenderProps = TRenderProps>(\n label: string | GetterWithProps<TProps, string>\n ): void {\n /**\n * TODO @ts-refactor\n * 'TProps' could be instantiated with an arbitrary type which could be unrelated to 'TRenderProps'\n */\n // @ts-expect-error\n this.config.label = label;\n }\n\n public getLabel(props?: TRenderProps): string {\n if (typeof this.config.label === \"function\") {\n // TODO @ts-refactor find out correct types to pass\n return this.config.label(props as TRenderProps);\n }\n return this.config.label;\n }\n\n public setType(type: ButtonElementType): void {\n this.config.type = type;\n }\n\n public getType(props?: TRenderProps): ButtonElementType {\n if (typeof this.config.type === \"function\") {\n // TODO @ts-refactor find out correct types to pass\n return this.config.type(props as TRenderProps);\n }\n return this.config.type;\n }\n\n public setOnClick(onClick: ButtonOnClick<TRenderProps>): void {\n this.config.onClick = onClick;\n }\n\n public getOnClick() {\n return this.config.onClick;\n }\n\n public override render(props: TRenderProps): React.ReactElement {\n const Component = BUTTONS[this.getType(props)];\n const onClick = this.getOnClick();\n\n return (\n <Component\n onClick={() => onClick(props)}\n data-testid={`button-element-${kebabCase(this.getLabel(props))}`}\n >\n {this.getLabel(props)}\n </Component>\n );\n }\n}\n"],"mappings":";;;;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,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AAI,CAACF,KAAqB,CAAC;MAClD;MACA,OAAO,IAAI,CAACF,MAAM,CAACI,IAAI;IAC3B;EAAC;IAAAR,GAAA;IAAAC,KAAA,EAED,SAAAS,WAAkBC,OAAoC,EAAQ;MAC1D,IAAI,CAACP,MAAM,CAACO,OAAO,GAAGA,OAAO;IACjC;EAAC;IAAAX,GAAA;IAAAC,KAAA,EAED,SAAAW,WAAA,EAAoB;MAChB,OAAO,IAAI,CAACR,MAAM,CAACO,OAAO;IAC9B;EAAC;IAAAX,GAAA;IAAAC,KAAA,EAED,SAAAY,OAAuBP,KAAmB,EAAsB;MAC5D,IAAMQ,SAAS,GAAG7B,OAAO,CAAC,IAAI,CAACwB,OAAO,CAACH,KAAK,CAAC,CAAC;MAC9C,IAAMK,QAAO,GAAG,IAAI,CAACC,UAAU,CAAC,CAAC;MAEjC,oBACIjC,MAAA,CAAAO,OAAA,CAAA6B,aAAA,CAACD,SAAS;QACNH,OAAO,EAAE,SAAAA,QAAA;UAAA,OAAMA,QAAO,CAACL,KAAK,CAAC;QAAA,CAAC;QAC9B,iCAAAU,MAAA,CAA+B,IAAAC,kBAAS,EAAC,IAAI,CAACZ,QAAQ,CAACC,KAAK,CAAC,CAAC;MAAG,GAEhE,IAAI,CAACD,QAAQ,CAACC,KAAK,CACb,CAAC;IAEpB;EAAC;AAAA,EAtDkDY,qBAAS","ignoreList":[]}
1
+ {"version":3,"names":["_react","_interopRequireDefault","require","_Button","_UIElement2","_kebabCase","BUTTONS","default","ButtonDefault","primary","ButtonPrimary","secondary","ButtonSecondary","ButtonElement","exports","_UIElement","_classCallCheck2","_callSuper2","arguments","_inherits2","_createClass2","key","value","setLabel","label","config","getLabel","props","setType","type","getType","setOnClick","onClick","getOnClick","render","Component","createElement","concat","kebabCase","UIElement"],"sources":["ButtonElement.tsx"],"sourcesContent":["import React from \"react\";\nimport { ButtonDefault, ButtonPrimary, ButtonSecondary } from \"@webiny/ui/Button\";\nimport { UIElement, UIElementConfig, UiElementRenderProps } from \"../UIElement\";\nimport kebabCase from \"lodash/kebabCase\";\n\nexport type ButtonElementType = \"default\" | \"primary\" | \"secondary\";\n\nexport interface ButtonOnClick<TRenderProps = any> {\n (props: TRenderProps): void;\n}\n\ninterface GetterWithProps<TProps, TReturn> {\n (props: TProps): TReturn;\n}\n\nexport interface ButtonElementConfig<TRenderProps> extends UIElementConfig {\n type: ButtonElementType | GetterWithProps<TRenderProps, ButtonElementType>;\n label: string | GetterWithProps<TRenderProps, string>;\n onClick: ButtonOnClick<TRenderProps>;\n}\n\nconst BUTTONS = {\n default: ButtonDefault,\n primary: ButtonPrimary,\n secondary: ButtonSecondary\n};\n\nexport class ButtonElement<\n TRenderProps extends UiElementRenderProps = UiElementRenderProps\n> extends UIElement<ButtonElementConfig<TRenderProps>> {\n public setLabel<TProps extends TRenderProps = TRenderProps>(\n label: string | GetterWithProps<TProps, string>\n ): void {\n /**\n * TODO @ts-refactor\n * 'TProps' could be instantiated with an arbitrary type which could be unrelated to 'TRenderProps'\n */\n // @ts-expect-error\n this.config.label = label;\n }\n\n public getLabel(props?: TRenderProps): string {\n if (typeof this.config.label === \"function\") {\n // TODO @ts-refactor find out correct types to pass\n return this.config.label(props as TRenderProps);\n }\n return this.config.label;\n }\n\n public setType(type: ButtonElementType): void {\n this.config.type = type;\n }\n\n public getType(props?: TRenderProps): ButtonElementType {\n if (typeof this.config.type === \"function\") {\n // TODO @ts-refactor find out correct types to pass\n return this.config.type(props as TRenderProps);\n }\n return this.config.type;\n }\n\n public setOnClick(onClick: ButtonOnClick<TRenderProps>): void {\n this.config.onClick = onClick;\n }\n\n public getOnClick() {\n return this.config.onClick;\n }\n\n public override render(props: TRenderProps): React.ReactElement {\n const Component = BUTTONS[this.getType(props)];\n const onClick = this.getOnClick();\n\n return (\n <Component\n onClick={() => onClick(props)}\n data-testid={`button-element-${kebabCase(this.getLabel(props))}`}\n >\n {this.getLabel(props)}\n </Component>\n );\n }\n}\n"],"mappings":";;;;;;;;;;;AAAA,IA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AAI,CAACJ,MAAM,CAACI,IAAI,CAACF,KAAqB,CAAC;MAClD;MACA,OAAO,IAAI,CAACF,MAAM,CAACI,IAAI;IAC3B;EAAC;IAAAR,GAAA;IAAAC,KAAA,EAED,SAAAS,WAAkBC,OAAoC,EAAQ;MAC1D,IAAI,CAACP,MAAM,CAACO,OAAO,GAAGA,OAAO;IACjC;EAAC;IAAAX,GAAA;IAAAC,KAAA,EAED,SAAAW,WAAA,EAAoB;MAChB,OAAO,IAAI,CAACR,MAAM,CAACO,OAAO;IAC9B;EAAC;IAAAX,GAAA;IAAAC,KAAA,EAED,SAAAY,OAAuBP,KAAmB,EAAsB;MAC5D,IAAMQ,SAAS,GAAG7B,OAAO,CAAC,IAAI,CAACwB,OAAO,CAACH,KAAK,CAAC,CAAC;MAC9C,IAAMK,QAAO,GAAG,IAAI,CAACC,UAAU,CAAC,CAAC;MAEjC,oBACIjC,MAAA,CAAAO,OAAA,CAAA6B,aAAA,CAACD,SAAS;QACNH,OAAO,EAAE,SAAAA,QAAA;UAAA,OAAMA,QAAO,CAACL,KAAK,CAAC;QAAA,CAAC;QAC9B,iCAAAU,MAAA,CAA+B,IAAAC,kBAAS,EAAC,IAAI,CAACZ,QAAQ,CAACC,KAAK,CAAC,CAAC;MAAG,GAEhE,IAAI,CAACD,QAAQ,CAACC,KAAK,CACb,CAAC;IAEpB;EAAC;AAAA,EApDKY,qBAAS","ignoreList":[]}
@@ -1,6 +1,7 @@
1
1
  import React from "react";
2
2
  import { ButtonElement, ButtonElementConfig } from "./ButtonElement";
3
- export declare class SmallButtonElement<TRenderProps = any> extends ButtonElement<TRenderProps> {
3
+ import { UiElementRenderProps } from "@webiny/ui-composer/UIElement";
4
+ export declare class SmallButtonElement<TRenderProps extends UiElementRenderProps = UiElementRenderProps> extends ButtonElement<TRenderProps> {
4
5
  constructor(id: string, config: ButtonElementConfig<TRenderProps>);
5
6
  render(props: TRenderProps): React.ReactElement;
6
7
  }