@comet/admin 9.0.0-beta.3 → 9.0.0-beta.4

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/lib/common/__stories__/Tooltip.stories.js +404 -0
  2. package/lib/common/buttons/__stories__/Button.stories.js +445 -0
  3. package/lib/common/buttons/delete/__stories__/DeleteButton.stories.js +1 -1
  4. package/lib/error/errorHandler/ErrorHandlerProvider.d.ts +8 -0
  5. package/lib/error/errorHandler/ErrorHandlerProvider.d.ts.map +1 -0
  6. package/lib/error/errorHandler/ErrorHandlerProvider.js +16 -0
  7. package/lib/error/errorboundary/ErrorBoundary.d.ts.map +1 -1
  8. package/lib/error/errorboundary/ErrorBoundary.js +26 -18
  9. package/lib/form/FinalFormInput.d.ts.map +1 -1
  10. package/lib/form/FinalFormInput.js +3 -2
  11. package/lib/index.d.ts +1 -0
  12. package/lib/index.d.ts.map +1 -1
  13. package/lib/index.js +1 -0
  14. package/lib/section/__stories__/SectionHeadline.stories.js +71 -0
  15. package/lib/stack/Stack.d.ts.map +1 -1
  16. package/lib/stack/Stack.js +3 -0
  17. package/lib/stack/__stories__/RouterTabsNestedStack.stories.js +51 -0
  18. package/lib/stack/__stories__/Stack.stories.js +14 -0
  19. package/lib/stack/__stories__/StackBackButton.stories.js +50 -0
  20. package/lib/stack/__stories__/StackBreadcrumbs.stories.js +139 -0
  21. package/lib/stack/__stories__/StackBreadcrumbsTabs.stories.js +47 -0
  22. package/lib/stack/__stories__/StackCustomSeparator.stories.js +47 -0
  23. package/lib/stack/__stories__/StackLink.stories.js +41 -0
  24. package/lib/stack/__stories__/StackNested.stories.js +58 -0
  25. package/lib/stack/__stories__/StackNestedOnInitialPage.stories.js +78 -0
  26. package/lib/stack/__stories__/StackNestedOneStack.stories.js +90 -0
  27. package/lib/stack/__stories__/StackPageTitle.stories.js +121 -0
  28. package/lib/stack/__stories__/StackReactNodeTitle.stories.js +54 -0
  29. package/lib/stack/__stories__/StackRefApi.stories.js +56 -0
  30. package/lib/stack/__stories__/StackTableFormQueryAtStack.stories.js +155 -0
  31. package/lib/stack/__stories__/StackTableFormQueryInTable.stories.js +160 -0
  32. package/lib/stack/__stories__/StackUrl.stories.js +66 -0
  33. package/lib/translator/ContentTranslationServiceContext.d.ts +1 -0
  34. package/lib/translator/ContentTranslationServiceContext.d.ts.map +1 -1
  35. package/lib/translator/ContentTranslationServiceProvider.d.ts +1 -1
  36. package/lib/translator/ContentTranslationServiceProvider.d.ts.map +1 -1
  37. package/lib/translator/ContentTranslationServiceProvider.js +4 -2
  38. package/lib/translator/PlainTextTranslationDialog.d.ts +1 -0
  39. package/lib/translator/PlainTextTranslationDialog.d.ts.map +1 -1
  40. package/lib/translator/PlainTextTranslationDialog.js +8 -3
  41. package/lib/translator/__stories__/ContentTranslation.stories.js +104 -0
  42. package/package.json +21 -22
@@ -0,0 +1,445 @@
1
+ import { Add, ArrowRight, Favorite, Wrench } from "@comet/admin-icons";
2
+ import { Box, Chip, Stack } from "@mui/material";
3
+ import { Button } from "../Button";
4
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
5
+ var config = {
6
+ component: Button,
7
+ title: "components/common/buttons/Button"
8
+ };
9
+ export default config;
10
+ export var Default = {
11
+ parameters: {
12
+ layout: "fullscreen"
13
+ },
14
+ args: {
15
+ variant: "primary",
16
+ responsive: false,
17
+ disabled: false,
18
+ startIcon: true,
19
+ endIcon: false
20
+ },
21
+ argTypes: {
22
+ variant: {
23
+ name: "Variant",
24
+ control: "select",
25
+ options: ["primary", "secondary", "outlined", "destructive", "success", "textLight", "textDark"]
26
+ },
27
+ responsive: {
28
+ name: "Responsive",
29
+ control: "boolean"
30
+ },
31
+ disabled: {
32
+ name: "Disabled",
33
+ control: "boolean"
34
+ },
35
+ startIcon: {
36
+ name: "Start Icon",
37
+ control: "boolean"
38
+ },
39
+ endIcon: {
40
+ name: "End Icon",
41
+ control: "boolean"
42
+ }
43
+ },
44
+ render: function render(_ref) {
45
+ var startIcon = _ref.startIcon,
46
+ endIcon = _ref.endIcon,
47
+ disabled = _ref.disabled,
48
+ variant = _ref.variant,
49
+ responsive = _ref.responsive;
50
+ var showDarkBackground = variant === "textLight";
51
+ return /*#__PURE__*/_jsx(Box, {
52
+ py: 10,
53
+ px: 8,
54
+ bgcolor: showDarkBackground ? "#333" : "transparent",
55
+ children: /*#__PURE__*/_jsx(Button, {
56
+ onClick: function onClick() {
57
+ alert("Button clicked");
58
+ },
59
+ startIcon: startIcon ? /*#__PURE__*/_jsx(Wrench, {}) : undefined,
60
+ endIcon: endIcon ? /*#__PURE__*/_jsx(Favorite, {}) : undefined,
61
+ disabled: disabled,
62
+ variant: variant,
63
+ responsive: responsive,
64
+ children: "This is a button"
65
+ })
66
+ });
67
+ }
68
+ };
69
+ export var AllVariants = {
70
+ render: function render() {
71
+ return /*#__PURE__*/_jsxs(Stack, {
72
+ spacing: 10,
73
+ children: [/*#__PURE__*/_jsxs(Stack, {
74
+ direction: "row",
75
+ alignItems: "center",
76
+ spacing: 8,
77
+ children: [/*#__PURE__*/_jsx(Button, {
78
+ children: "Button"
79
+ }), /*#__PURE__*/_jsx(Button, {
80
+ startIcon: /*#__PURE__*/_jsx(ArrowRight, {}),
81
+ children: "Button"
82
+ }), /*#__PURE__*/_jsx(Button, {
83
+ endIcon: /*#__PURE__*/_jsx(ArrowRight, {}),
84
+ children: "Button"
85
+ }), /*#__PURE__*/_jsx(Button, {
86
+ endIcon: /*#__PURE__*/_jsx(Chip, {
87
+ label: "5"
88
+ }),
89
+ children: "Button"
90
+ }), /*#__PURE__*/_jsx(Button, {
91
+ startIcon: /*#__PURE__*/_jsx(ArrowRight, {}),
92
+ endIcon: /*#__PURE__*/_jsx(Chip, {
93
+ label: "5"
94
+ }),
95
+ children: "Button"
96
+ }), /*#__PURE__*/_jsx(Button, {
97
+ endIcon: /*#__PURE__*/_jsxs(_Fragment, {
98
+ children: [/*#__PURE__*/_jsx(ArrowRight, {}), /*#__PURE__*/_jsx(Chip, {
99
+ label: "5"
100
+ })]
101
+ }),
102
+ children: "Button"
103
+ }), /*#__PURE__*/_jsx(Button, {
104
+ children: /*#__PURE__*/_jsx(ArrowRight, {})
105
+ }), /*#__PURE__*/_jsx(Button, {
106
+ endIcon: /*#__PURE__*/_jsx(ArrowRight, {}),
107
+ disabled: true,
108
+ children: "Button"
109
+ })]
110
+ }), /*#__PURE__*/_jsxs(Stack, {
111
+ direction: "row",
112
+ alignItems: "center",
113
+ spacing: 8,
114
+ children: [/*#__PURE__*/_jsx(Button, {
115
+ variant: "secondary",
116
+ children: "Button"
117
+ }), /*#__PURE__*/_jsx(Button, {
118
+ variant: "secondary",
119
+ startIcon: /*#__PURE__*/_jsx(ArrowRight, {}),
120
+ children: "Button"
121
+ }), /*#__PURE__*/_jsx(Button, {
122
+ variant: "secondary",
123
+ endIcon: /*#__PURE__*/_jsx(ArrowRight, {}),
124
+ children: "Button"
125
+ }), /*#__PURE__*/_jsx(Button, {
126
+ variant: "secondary",
127
+ endIcon: /*#__PURE__*/_jsx(Chip, {
128
+ label: "5"
129
+ }),
130
+ children: "Button"
131
+ }), /*#__PURE__*/_jsx(Button, {
132
+ variant: "secondary",
133
+ startIcon: /*#__PURE__*/_jsx(ArrowRight, {}),
134
+ endIcon: /*#__PURE__*/_jsx(Chip, {
135
+ label: "5"
136
+ }),
137
+ children: "Button"
138
+ }), /*#__PURE__*/_jsx(Button, {
139
+ variant: "secondary",
140
+ endIcon: /*#__PURE__*/_jsxs(_Fragment, {
141
+ children: [/*#__PURE__*/_jsx(ArrowRight, {}), /*#__PURE__*/_jsx(Chip, {
142
+ label: "5"
143
+ })]
144
+ }),
145
+ children: "Button"
146
+ }), /*#__PURE__*/_jsx(Button, {
147
+ variant: "secondary",
148
+ children: /*#__PURE__*/_jsx(ArrowRight, {})
149
+ }), /*#__PURE__*/_jsx(Button, {
150
+ variant: "secondary",
151
+ endIcon: /*#__PURE__*/_jsx(ArrowRight, {}),
152
+ disabled: true,
153
+ children: "Button"
154
+ })]
155
+ }), /*#__PURE__*/_jsxs(Stack, {
156
+ direction: "row",
157
+ alignItems: "center",
158
+ spacing: 8,
159
+ children: [/*#__PURE__*/_jsx(Button, {
160
+ variant: "outlined",
161
+ children: "Button"
162
+ }), /*#__PURE__*/_jsx(Button, {
163
+ variant: "outlined",
164
+ startIcon: /*#__PURE__*/_jsx(ArrowRight, {}),
165
+ children: "Button"
166
+ }), /*#__PURE__*/_jsx(Button, {
167
+ variant: "outlined",
168
+ endIcon: /*#__PURE__*/_jsx(ArrowRight, {}),
169
+ children: "Button"
170
+ }), /*#__PURE__*/_jsx(Button, {
171
+ variant: "outlined",
172
+ endIcon: /*#__PURE__*/_jsx(Chip, {
173
+ label: "5"
174
+ }),
175
+ children: "Button"
176
+ }), /*#__PURE__*/_jsx(Button, {
177
+ variant: "outlined",
178
+ startIcon: /*#__PURE__*/_jsx(ArrowRight, {}),
179
+ endIcon: /*#__PURE__*/_jsx(Chip, {
180
+ label: "5"
181
+ }),
182
+ children: "Button"
183
+ }), /*#__PURE__*/_jsx(Button, {
184
+ variant: "outlined",
185
+ endIcon: /*#__PURE__*/_jsxs(_Fragment, {
186
+ children: [/*#__PURE__*/_jsx(ArrowRight, {}), /*#__PURE__*/_jsx(Chip, {
187
+ label: "5"
188
+ })]
189
+ }),
190
+ children: "Button"
191
+ }), /*#__PURE__*/_jsx(Button, {
192
+ variant: "outlined",
193
+ children: /*#__PURE__*/_jsx(ArrowRight, {})
194
+ }), /*#__PURE__*/_jsx(Button, {
195
+ variant: "outlined",
196
+ endIcon: /*#__PURE__*/_jsx(ArrowRight, {}),
197
+ disabled: true,
198
+ children: "Button"
199
+ })]
200
+ }), /*#__PURE__*/_jsxs(Stack, {
201
+ direction: "row",
202
+ alignItems: "center",
203
+ spacing: 8,
204
+ children: [/*#__PURE__*/_jsx(Button, {
205
+ variant: "destructive",
206
+ children: "Button"
207
+ }), /*#__PURE__*/_jsx(Button, {
208
+ variant: "destructive",
209
+ startIcon: /*#__PURE__*/_jsx(ArrowRight, {}),
210
+ children: "Button"
211
+ }), /*#__PURE__*/_jsx(Button, {
212
+ variant: "destructive",
213
+ endIcon: /*#__PURE__*/_jsx(ArrowRight, {}),
214
+ children: "Button"
215
+ }), /*#__PURE__*/_jsx(Button, {
216
+ variant: "destructive",
217
+ endIcon: /*#__PURE__*/_jsx(Chip, {
218
+ label: "5"
219
+ }),
220
+ children: "Button"
221
+ }), /*#__PURE__*/_jsx(Button, {
222
+ variant: "destructive",
223
+ startIcon: /*#__PURE__*/_jsx(ArrowRight, {}),
224
+ endIcon: /*#__PURE__*/_jsx(Chip, {
225
+ label: "5"
226
+ }),
227
+ children: "Button"
228
+ }), /*#__PURE__*/_jsx(Button, {
229
+ variant: "destructive",
230
+ endIcon: /*#__PURE__*/_jsxs(_Fragment, {
231
+ children: [/*#__PURE__*/_jsx(ArrowRight, {}), /*#__PURE__*/_jsx(Chip, {
232
+ label: "5"
233
+ })]
234
+ }),
235
+ children: "Button"
236
+ }), /*#__PURE__*/_jsx(Button, {
237
+ variant: "destructive",
238
+ children: /*#__PURE__*/_jsx(ArrowRight, {})
239
+ }), /*#__PURE__*/_jsx(Button, {
240
+ variant: "destructive",
241
+ endIcon: /*#__PURE__*/_jsx(ArrowRight, {}),
242
+ disabled: true,
243
+ children: "Button"
244
+ })]
245
+ }), /*#__PURE__*/_jsxs(Stack, {
246
+ direction: "row",
247
+ alignItems: "center",
248
+ spacing: 8,
249
+ children: [/*#__PURE__*/_jsx(Button, {
250
+ variant: "success",
251
+ children: "Button"
252
+ }), /*#__PURE__*/_jsx(Button, {
253
+ variant: "success",
254
+ startIcon: /*#__PURE__*/_jsx(ArrowRight, {}),
255
+ children: "Button"
256
+ }), /*#__PURE__*/_jsx(Button, {
257
+ variant: "success",
258
+ endIcon: /*#__PURE__*/_jsx(ArrowRight, {}),
259
+ children: "Button"
260
+ }), /*#__PURE__*/_jsx(Button, {
261
+ variant: "success",
262
+ endIcon: /*#__PURE__*/_jsx(Chip, {
263
+ label: "5"
264
+ }),
265
+ children: "Button"
266
+ }), /*#__PURE__*/_jsx(Button, {
267
+ variant: "success",
268
+ startIcon: /*#__PURE__*/_jsx(ArrowRight, {}),
269
+ endIcon: /*#__PURE__*/_jsx(Chip, {
270
+ label: "5"
271
+ }),
272
+ children: "Button"
273
+ }), /*#__PURE__*/_jsx(Button, {
274
+ variant: "success",
275
+ endIcon: /*#__PURE__*/_jsxs(_Fragment, {
276
+ children: [/*#__PURE__*/_jsx(ArrowRight, {}), /*#__PURE__*/_jsx(Chip, {
277
+ label: "5"
278
+ })]
279
+ }),
280
+ children: "Button"
281
+ }), /*#__PURE__*/_jsx(Button, {
282
+ variant: "success",
283
+ children: /*#__PURE__*/_jsx(ArrowRight, {})
284
+ }), /*#__PURE__*/_jsx(Button, {
285
+ variant: "success",
286
+ endIcon: /*#__PURE__*/_jsx(ArrowRight, {}),
287
+ disabled: true,
288
+ children: "Button"
289
+ })]
290
+ }), /*#__PURE__*/_jsxs(Stack, {
291
+ direction: "row",
292
+ alignItems: "center",
293
+ spacing: 8,
294
+ paddingTop: 8,
295
+ paddingBottom: 8,
296
+ sx: {
297
+ backgroundColor: function backgroundColor(theme) {
298
+ return theme.palette.grey[800];
299
+ }
300
+ },
301
+ children: [/*#__PURE__*/_jsx(Button, {
302
+ variant: "textLight",
303
+ children: "Button"
304
+ }), /*#__PURE__*/_jsx(Button, {
305
+ variant: "textLight",
306
+ startIcon: /*#__PURE__*/_jsx(ArrowRight, {}),
307
+ children: "Button"
308
+ }), /*#__PURE__*/_jsx(Button, {
309
+ variant: "textLight",
310
+ endIcon: /*#__PURE__*/_jsx(ArrowRight, {}),
311
+ children: "Button"
312
+ }), /*#__PURE__*/_jsx(Button, {
313
+ variant: "textLight",
314
+ endIcon: /*#__PURE__*/_jsx(Chip, {
315
+ label: "5"
316
+ }),
317
+ children: "Button"
318
+ }), /*#__PURE__*/_jsx(Button, {
319
+ variant: "textLight",
320
+ startIcon: /*#__PURE__*/_jsx(ArrowRight, {}),
321
+ endIcon: /*#__PURE__*/_jsx(Chip, {
322
+ label: "5"
323
+ }),
324
+ children: "Button"
325
+ }), /*#__PURE__*/_jsx(Button, {
326
+ variant: "textLight",
327
+ endIcon: /*#__PURE__*/_jsxs(_Fragment, {
328
+ children: [/*#__PURE__*/_jsx(ArrowRight, {}), /*#__PURE__*/_jsx(Chip, {
329
+ label: "5"
330
+ })]
331
+ }),
332
+ children: "Button"
333
+ }), /*#__PURE__*/_jsx(Button, {
334
+ variant: "textLight",
335
+ children: /*#__PURE__*/_jsx(ArrowRight, {})
336
+ }), /*#__PURE__*/_jsx(Button, {
337
+ variant: "textLight",
338
+ endIcon: /*#__PURE__*/_jsx(ArrowRight, {}),
339
+ disabled: true,
340
+ children: "Button"
341
+ })]
342
+ }), /*#__PURE__*/_jsxs(Stack, {
343
+ direction: "row",
344
+ alignItems: "center",
345
+ spacing: 8,
346
+ children: [/*#__PURE__*/_jsx(Button, {
347
+ variant: "textDark",
348
+ children: "Button"
349
+ }), /*#__PURE__*/_jsx(Button, {
350
+ variant: "textDark",
351
+ startIcon: /*#__PURE__*/_jsx(ArrowRight, {}),
352
+ children: "Button"
353
+ }), /*#__PURE__*/_jsx(Button, {
354
+ variant: "textDark",
355
+ endIcon: /*#__PURE__*/_jsx(ArrowRight, {}),
356
+ children: "Button"
357
+ }), /*#__PURE__*/_jsx(Button, {
358
+ variant: "textDark",
359
+ endIcon: /*#__PURE__*/_jsx(Chip, {
360
+ label: "5"
361
+ }),
362
+ children: "Button"
363
+ }), /*#__PURE__*/_jsx(Button, {
364
+ variant: "textDark",
365
+ startIcon: /*#__PURE__*/_jsx(ArrowRight, {}),
366
+ endIcon: /*#__PURE__*/_jsx(Chip, {
367
+ label: "5"
368
+ }),
369
+ children: "Button"
370
+ }), /*#__PURE__*/_jsx(Button, {
371
+ variant: "textDark",
372
+ endIcon: /*#__PURE__*/_jsxs(_Fragment, {
373
+ children: [/*#__PURE__*/_jsx(ArrowRight, {}), /*#__PURE__*/_jsx(Chip, {
374
+ label: "5"
375
+ })]
376
+ }),
377
+ children: "Button"
378
+ }), /*#__PURE__*/_jsx(Button, {
379
+ variant: "textDark",
380
+ children: /*#__PURE__*/_jsx(ArrowRight, {})
381
+ }), /*#__PURE__*/_jsx(Button, {
382
+ variant: "textDark",
383
+ endIcon: /*#__PURE__*/_jsx(ArrowRight, {}),
384
+ disabled: true,
385
+ children: "Button"
386
+ })]
387
+ })]
388
+ });
389
+ }
390
+ };
391
+ export var Responsive = {
392
+ args: {
393
+ startIcon: true,
394
+ endIcon: false,
395
+ mobileIcon: "auto",
396
+ mobileBreakpoint: "sm",
397
+ disabled: false
398
+ },
399
+ argTypes: {
400
+ startIcon: {
401
+ name: "Start Icon",
402
+ control: "boolean"
403
+ },
404
+ endIcon: {
405
+ name: "End Icon",
406
+ control: "boolean"
407
+ },
408
+ mobileIcon: {
409
+ name: "Mobile Icon",
410
+ control: "select",
411
+ options: ["auto", "startIcon", "endIcon", "custom"]
412
+ },
413
+ mobileBreakpoint: {
414
+ name: "Mobile Breakpoint",
415
+ control: "select",
416
+ options: ["xs", "sm", "md", "lg", "xl"]
417
+ },
418
+ disabled: {
419
+ name: "Disabled",
420
+ control: "boolean"
421
+ }
422
+ },
423
+ render: function render(_ref2) {
424
+ var startIcon = _ref2.startIcon,
425
+ endIcon = _ref2.endIcon,
426
+ mobileIcon = _ref2.mobileIcon,
427
+ mobileBreakpoint = _ref2.mobileBreakpoint,
428
+ disabled = _ref2.disabled;
429
+ var customMobileIcon = /*#__PURE__*/_jsx(Favorite, {});
430
+ return /*#__PURE__*/_jsx(Stack, {
431
+ direction: "row",
432
+ alignItems: "center",
433
+ spacing: 2,
434
+ children: /*#__PURE__*/_jsx(Button, {
435
+ responsive: true,
436
+ startIcon: startIcon ? /*#__PURE__*/_jsx(Wrench, {}) : undefined,
437
+ endIcon: endIcon ? /*#__PURE__*/_jsx(Add, {}) : undefined,
438
+ mobileIcon: mobileIcon === "custom" ? customMobileIcon : mobileIcon,
439
+ mobileBreakpoint: mobileBreakpoint,
440
+ disabled: disabled,
441
+ children: "This is a responsive button"
442
+ })
443
+ });
444
+ }
445
+ };
@@ -1,7 +1,7 @@
1
1
  import { DeleteButton } from "../DeleteButton";
2
2
  var config = {
3
3
  component: DeleteButton,
4
- title: "common/Buttons/DeleteButton"
4
+ title: "components/common/buttons/delete/DeleteButton"
5
5
  };
6
6
  export default config;
7
7
  export var DeleteButtonStory = {};
@@ -0,0 +1,8 @@
1
+ import { type ErrorInfo, type PropsWithChildren } from "react";
2
+ interface ErrorHandlerContextValue {
3
+ onError?: (error: Error, errorInfo: ErrorInfo) => void;
4
+ }
5
+ export declare function ErrorHandlerProvider({ children, onError }: PropsWithChildren<ErrorHandlerContextValue>): import("react/jsx-runtime").JSX.Element;
6
+ export declare const useErrorHandler: () => ErrorHandlerContextValue;
7
+ export {};
8
+ //# sourceMappingURL=ErrorHandlerProvider.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ErrorHandlerProvider.d.ts","sourceRoot":"","sources":["../../../src/error/errorHandler/ErrorHandlerProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAiB,KAAK,SAAS,EAAE,KAAK,iBAAiB,EAAc,MAAM,OAAO,CAAC;AAE1F,UAAU,wBAAwB;IAC9B,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,SAAS,KAAK,IAAI,CAAC;CAC1D;AAID,wBAAgB,oBAAoB,CAAC,EAAE,QAAQ,EAAE,OAAO,EAAE,EAAE,iBAAiB,CAAC,wBAAwB,CAAC,2CAEtG;AAED,eAAO,MAAM,eAAe,gCAE3B,CAAC"}
@@ -0,0 +1,16 @@
1
+ import { createContext, useContext } from "react";
2
+ import { jsx as _jsx } from "react/jsx-runtime";
3
+ var ErrorHandlerContext = /*#__PURE__*/createContext({});
4
+ export function ErrorHandlerProvider(_ref) {
5
+ var children = _ref.children,
6
+ onError = _ref.onError;
7
+ return /*#__PURE__*/_jsx(ErrorHandlerContext.Provider, {
8
+ value: {
9
+ onError: onError
10
+ },
11
+ children: children
12
+ });
13
+ }
14
+ export var useErrorHandler = function useErrorHandler() {
15
+ return useContext(ErrorHandlerContext);
16
+ };
@@ -1 +1 @@
1
- {"version":3,"file":"ErrorBoundary.d.ts","sourceRoot":"","sources":["../../../src/error/errorboundary/ErrorBoundary.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,IAAI,QAAQ,EAAE,KAAK,UAAU,EAAE,KAAK,mBAAmB,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AACzG,OAAO,EAAO,KAAK,KAAK,EAAiB,MAAM,sBAAsB,CAAC;AACtE,OAAO,EAA6B,KAAK,iBAAiB,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAI1F,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,wCAAwC,CAAC;AAEvF,MAAM,MAAM,qBAAqB,GAC3B,OAAO,GACP,SAAS,GACT,kBAAkB,GAClB,kBAAkB,GAClB,sBAAsB,GACtB,4BAA4B,GAC5B,4BAA4B,GAC5B,uBAAuB,GACvB,qBAAqB,CAAC;AAM5B,MAAM,MAAM,kBAAkB,GAAG,iBAAiB,CAAC;IAC/C,gBAAgB,CAAC,EAAE,SAAS,CAAC;IAC7B,OAAO,CAAC,EAAE,UAAU,CAAC,SAAS,CAAC,CAAC;IAChC,IAAI,CAAC,EAAE,UAAU,CAAC,MAAM,CAAC,CAAC;IAC1B,uBAAuB,CAAC,EAAE,SAAS,CAAC;IACpC,uBAAuB,CAAC,EAAE,SAAS,CAAC;IACpC,GAAG,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;CACzB,CAAC,GACE,wBAAwB,CAAC;IACrB,KAAK,EAAE,OAAO,QAAQ,CAAC;IACvB,OAAO,EAAE,OAAO,UAAU,CAAC;IAC3B,gBAAgB,EAAE,SAAS,CAAC;IAC5B,gBAAgB,EAAE,SAAS,CAAC;IAC5B,0BAA0B,EAAE,KAAK,CAAC;IAClC,0BAA0B,EAAE,KAAK,CAAC;IAClC,qBAAqB,EAAE,OAAO,UAAU,CAAC;IACzC,mBAAmB,EAAE,OAAO,UAAU,CAAC;CAC1C,CAAC,CAAC;AA6FP,eAAO,MAAM,aAAa,GAAI,SAAS,kBAAkB,4CAGxD,CAAC;AAsEF,OAAO,QAAQ,sBAAsB,CAAC;IAClC,UAAU,uBAAuB;QAC7B,uBAAuB,EAAE,qBAAqB,CAAC;KAClD;IAED,UAAU,mBAAmB;QACzB,uBAAuB,EAAE,kBAAkB,CAAC;KAC/C;IAED,UAAU,UAAU;QAChB,uBAAuB,CAAC,EAAE;YACtB,YAAY,CAAC,EAAE,OAAO,CAAC,mBAAmB,CAAC,yBAAyB,CAAC,CAAC,CAAC;YACvE,cAAc,CAAC,EAAE,mBAAmB,CAAC,KAAK,CAAC,CAAC,yBAAyB,CAAC,CAAC;SAC1E,CAAC;KACL;CACJ"}
1
+ {"version":3,"file":"ErrorBoundary.d.ts","sourceRoot":"","sources":["../../../src/error/errorboundary/ErrorBoundary.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,IAAI,QAAQ,EAAE,KAAK,UAAU,EAAE,KAAK,mBAAmB,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AACzG,OAAO,EAAO,KAAK,KAAK,EAAiB,MAAM,sBAAsB,CAAC;AACtE,OAAO,EAA6B,KAAK,iBAAiB,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAI1F,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,wCAAwC,CAAC;AAGvF,MAAM,MAAM,qBAAqB,GAC3B,OAAO,GACP,SAAS,GACT,kBAAkB,GAClB,kBAAkB,GAClB,sBAAsB,GACtB,4BAA4B,GAC5B,4BAA4B,GAC5B,uBAAuB,GACvB,qBAAqB,CAAC;AAM5B,MAAM,MAAM,kBAAkB,GAAG,iBAAiB,CAAC;IAC/C,gBAAgB,CAAC,EAAE,SAAS,CAAC;IAC7B,OAAO,CAAC,EAAE,UAAU,CAAC,SAAS,CAAC,CAAC;IAChC,IAAI,CAAC,EAAE,UAAU,CAAC,MAAM,CAAC,CAAC;IAC1B,uBAAuB,CAAC,EAAE,SAAS,CAAC;IACpC,uBAAuB,CAAC,EAAE,SAAS,CAAC;IACpC,GAAG,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;CACzB,CAAC,GACE,wBAAwB,CAAC;IACrB,KAAK,EAAE,OAAO,QAAQ,CAAC;IACvB,OAAO,EAAE,OAAO,UAAU,CAAC;IAC3B,gBAAgB,EAAE,SAAS,CAAC;IAC5B,gBAAgB,EAAE,SAAS,CAAC;IAC5B,0BAA0B,EAAE,KAAK,CAAC;IAClC,0BAA0B,EAAE,KAAK,CAAC;IAClC,qBAAqB,EAAE,OAAO,UAAU,CAAC;IACzC,mBAAmB,EAAE,OAAO,UAAU,CAAC;CAC1C,CAAC,CAAC;AAiGP,eAAO,MAAM,aAAa,GAAI,SAAS,kBAAkB,4CAIxD,CAAC;AAwEF,OAAO,QAAQ,sBAAsB,CAAC;IAClC,UAAU,uBAAuB;QAC7B,uBAAuB,EAAE,qBAAqB,CAAC;KAClD;IAED,UAAU,mBAAmB;QACzB,uBAAuB,EAAE,kBAAkB,CAAC;KAC/C;IAED,UAAU,UAAU;QAChB,uBAAuB,CAAC,EAAE;YACtB,YAAY,CAAC,EAAE,OAAO,CAAC,mBAAmB,CAAC,yBAAyB,CAAC,CAAC,CAAC;YACvE,cAAc,CAAC,EAAE,mBAAmB,CAAC,KAAK,CAAC,CAAC,yBAAyB,CAAC,CAAC;SAC1E,CAAC;KACL;CACJ"}
@@ -1,5 +1,5 @@
1
1
  function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
2
- var _excluded = ["variant", "icon", "toggleDetailsOpenedIcon", "toggleDetailsClosedIcon", "children", "slotProps", "userErrorMessage", "key"];
2
+ var _excluded = ["variant", "icon", "toggleDetailsOpenedIcon", "toggleDetailsClosedIcon", "children", "slotProps", "userErrorMessage", "key", "onError"];
3
3
  var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7;
4
4
  function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
5
5
  function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
@@ -26,6 +26,7 @@ import { css, useThemeProps } from "@mui/material/styles";
26
26
  import { Component } from "react";
27
27
  import { FormattedMessage } from "react-intl";
28
28
  import { createComponentSlot } from "../../helpers/createComponentSlot";
29
+ import { useErrorHandler } from "../errorHandler/ErrorHandlerProvider";
29
30
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
30
31
  var Alert = createComponentSlot(MuiAlert)({
31
32
  componentName: "ErrorBoundary",
@@ -82,7 +83,11 @@ export var ErrorBoundary = function ErrorBoundary(inProps) {
82
83
  props: inProps,
83
84
  name: "CometAdminErrorBoundary"
84
85
  });
85
- return /*#__PURE__*/_jsx(CoreErrorBoundary, _objectSpread({}, props));
86
+ var _useErrorHandler = useErrorHandler(),
87
+ onError = _useErrorHandler.onError;
88
+ return /*#__PURE__*/_jsx(CoreErrorBoundary, _objectSpread(_objectSpread({}, props), {}, {
89
+ onError: onError
90
+ }));
86
91
  };
87
92
  var CoreErrorBoundary = /*#__PURE__*/function (_Component) {
88
93
  function CoreErrorBoundary(props) {
@@ -96,35 +101,38 @@ var CoreErrorBoundary = /*#__PURE__*/function (_Component) {
96
101
  return _createClass(CoreErrorBoundary, [{
97
102
  key: "componentDidCatch",
98
103
  value: function componentDidCatch(error, errorInfo) {
104
+ var _this$props$onError, _this$props;
99
105
  this.setState(function (prev) {
100
106
  return _objectSpread(_objectSpread({}, prev), {}, {
101
107
  error: error,
102
108
  errorInfo: errorInfo
103
109
  });
104
110
  });
111
+ (_this$props$onError = (_this$props = this.props).onError) === null || _this$props$onError === void 0 || _this$props$onError.call(_this$props, error, errorInfo);
105
112
  }
106
113
  }, {
107
114
  key: "render",
108
115
  value: function render() {
109
116
  var _this2 = this;
110
- var _this$props = this.props,
111
- _this$props$variant = _this$props.variant,
112
- variant = _this$props$variant === void 0 ? "filled" : _this$props$variant,
113
- _this$props$icon = _this$props.icon,
114
- icon = _this$props$icon === void 0 ? /*#__PURE__*/_jsx(Error, {}) : _this$props$icon,
115
- _this$props$toggleDet = _this$props.toggleDetailsOpenedIcon,
116
- toggleDetailsOpenedIcon = _this$props$toggleDet === void 0 ? /*#__PURE__*/_jsx(ChevronRight, {
117
+ var _this$props2 = this.props,
118
+ _this$props2$variant = _this$props2.variant,
119
+ variant = _this$props2$variant === void 0 ? "filled" : _this$props2$variant,
120
+ _this$props2$icon = _this$props2.icon,
121
+ icon = _this$props2$icon === void 0 ? /*#__PURE__*/_jsx(Error, {}) : _this$props2$icon,
122
+ _this$props2$toggleDe = _this$props2.toggleDetailsOpenedIcon,
123
+ toggleDetailsOpenedIcon = _this$props2$toggleDe === void 0 ? /*#__PURE__*/_jsx(ChevronRight, {
117
124
  fontSize: "small"
118
- }) : _this$props$toggleDet,
119
- _this$props$toggleDet2 = _this$props.toggleDetailsClosedIcon,
120
- toggleDetailsClosedIcon = _this$props$toggleDet2 === void 0 ? /*#__PURE__*/_jsx(ChevronDown, {
125
+ }) : _this$props2$toggleDe,
126
+ _this$props2$toggleDe2 = _this$props2.toggleDetailsClosedIcon,
127
+ toggleDetailsClosedIcon = _this$props2$toggleDe2 === void 0 ? /*#__PURE__*/_jsx(ChevronDown, {
121
128
  fontSize: "small"
122
- }) : _this$props$toggleDet2,
123
- children = _this$props.children,
124
- slotProps = _this$props.slotProps,
125
- userErrorMessage = _this$props.userErrorMessage,
126
- key = _this$props.key,
127
- restProps = _objectWithoutProperties(_this$props, _excluded);
129
+ }) : _this$props2$toggleDe2,
130
+ children = _this$props2.children,
131
+ slotProps = _this$props2.slotProps,
132
+ userErrorMessage = _this$props2.userErrorMessage,
133
+ key = _this$props2.key,
134
+ onError = _this$props2.onError,
135
+ restProps = _objectWithoutProperties(_this$props2, _excluded);
128
136
  var _this$state = this.state,
129
137
  error = _this$state.error,
130
138
  errorInfo = _this$state.errorInfo,
@@ -1 +1 @@
1
- {"version":3,"file":"FinalFormInput.d.ts","sourceRoot":"","sources":["../../src/form/FinalFormInput.tsx"],"names":[],"mappings":"AACA,OAAO,EAAyB,KAAK,cAAc,EAAE,MAAM,eAAe,CAAC;AAE3E,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAQzD,MAAM,MAAM,mBAAmB,GAAG,cAAc,GAAG;IAC/C,yBAAyB,CAAC,EAAE,OAAO,CAAC;CACvC,CAAC;AAEF,KAAK,2BAA2B,GAAG,gBAAgB,CAAC,MAAM,EAAE,gBAAgB,GAAG,mBAAmB,CAAC,CAAC;AAEpG,wBAAgB,cAAc,CAAC,EAC3B,IAAI,EACJ,KAAK,EACL,QAAQ,EACR,YAAY,EACZ,yBAAyB,EACzB,QAAQ,EACR,QAAQ,EACR,QAAQ,EACR,GAAG,KAAK,EACX,EAAE,mBAAmB,GAAG,2BAA2B,2CAsDnD"}
1
+ {"version":3,"file":"FinalFormInput.d.ts","sourceRoot":"","sources":["../../src/form/FinalFormInput.tsx"],"names":[],"mappings":"AACA,OAAO,EAAyB,KAAK,cAAc,EAAE,MAAM,eAAe,CAAC;AAE3E,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAQzD,MAAM,MAAM,mBAAmB,GAAG,cAAc,GAAG;IAC/C,yBAAyB,CAAC,EAAE,OAAO,CAAC;CACvC,CAAC;AAEF,KAAK,2BAA2B,GAAG,gBAAgB,CAAC,MAAM,EAAE,gBAAgB,GAAG,mBAAmB,CAAC,CAAC;AAEpG,wBAAgB,cAAc,CAAC,EAC3B,IAAI,EACJ,KAAK,EACL,QAAQ,EACR,YAAY,EACZ,yBAAyB,EACzB,QAAQ,EACR,QAAQ,EACR,QAAQ,EACR,GAAG,KAAK,EACX,EAAE,mBAAmB,GAAG,2BAA2B,2CAuDnD"}
@@ -42,7 +42,7 @@ export function FinalFormInput(_ref) {
42
42
  translationEnabled = _useContentTranslatio.enabled,
43
43
  showApplyTranslationDialog = _useContentTranslatio.showApplyTranslationDialog,
44
44
  translate = _useContentTranslatio.translate;
45
- var isTranslatable = translationEnabled && !disableContentTranslation && type === "text" && !props.disabled;
45
+ var isTranslatable = translationEnabled && !disableContentTranslation && (type === "text" || type === "textarea") && !props.disabled;
46
46
  var _useState = useState(false),
47
47
  _useState2 = _slicedToArray(_useState, 2),
48
48
  open = _useState2[0],
@@ -108,7 +108,8 @@ export function FinalFormInput(_ref) {
108
108
  },
109
109
  originalText: input.value,
110
110
  translatedText: pendingTranslation,
111
- onApplyTranslation: input.onChange
111
+ onApplyTranslation: input.onChange,
112
+ multiline: props.multiline
112
113
  })]
113
114
  });
114
115
  }
package/lib/index.d.ts CHANGED
@@ -92,6 +92,7 @@ export { ErrorDialog, type ErrorDialogOptions, type ErrorDialogProps } from "./e
92
92
  export { ErrorDialogHandler } from "./error/errordialog/ErrorDialogHandler";
93
93
  export { ErrorScope, errorScopeForOperationContext, LocalErrorScopeApolloContext } from "./error/errordialog/ErrorScope";
94
94
  export { useErrorDialog, type UseErrorDialogReturn } from "./error/errordialog/useErrorDialog";
95
+ export { ErrorHandlerProvider, useErrorHandler } from "./error/errorHandler/ErrorHandlerProvider";
95
96
  export { createFetch, FetchContext, FetchProvider, useFetch } from "./fetchProvider/fetch";
96
97
  export { FileIcon } from "./fileIcons/FileIcon";
97
98
  export { FinalForm, FinalFormSubmitEvent, useFormApiRef } from "./FinalForm";