@ethisyscore/plugin-ui 1.75.0 → 1.77.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/components/connectors/index.cjs +1087 -13
- package/dist/components/connectors/index.cjs.map +1 -1
- package/dist/components/connectors/index.d.cts +198 -1
- package/dist/components/connectors/index.d.ts +198 -1
- package/dist/components/connectors/index.js +1088 -15
- package/dist/components/connectors/index.js.map +1 -1
- package/dist/components/ui/index.cjs +4 -0
- package/dist/components/ui/index.d.cts +66 -1
- package/dist/components/ui/index.d.ts +66 -1
- package/dist/components/ui/index.js +1 -1
- package/dist/platform-react/index.cjs +28 -9
- package/dist/platform-react/index.cjs.map +1 -1
- package/dist/platform-react/index.d.cts +2 -0
- package/dist/platform-react/index.d.ts +2 -0
- package/dist/platform-react/index.js +28 -9
- package/dist/platform-react/index.js.map +1 -1
- package/package.json +1 -1
- package/styles/plugin-base.css +11 -0
|
@@ -233,6 +233,10 @@ Object.defineProperty(exports, "CircularProgress", {
|
|
|
233
233
|
enumerable: true,
|
|
234
234
|
get: function () { return material.CircularProgress; }
|
|
235
235
|
});
|
|
236
|
+
Object.defineProperty(exports, "Collapse", {
|
|
237
|
+
enumerable: true,
|
|
238
|
+
get: function () { return material.Collapse; }
|
|
239
|
+
});
|
|
236
240
|
Object.defineProperty(exports, "Container", {
|
|
237
241
|
enumerable: true,
|
|
238
242
|
get: function () { return material.Container; }
|
|
@@ -1,7 +1,72 @@
|
|
|
1
1
|
import { DialogProps } from '@mui/material';
|
|
2
|
-
export { Alert, AlertTitle, Box, Breadcrumbs, Button, Card, CardActions, CardContent, CardHeader, Chip, CircularProgress, Container, DialogActions, DialogContent, DialogContentText, DialogTitle, Divider, FilledInput, FormControl, FormControlLabel, FormGroup, FormHelperText, FormLabel, Grid, IconButton, Input, InputAdornment, InputLabel, LinearProgress, Link, ListItemIcon, ListItemText, Menu, MenuItem, OutlinedInput, Paper, Popover, Select, SelectChangeEvent, Skeleton, Stack, Switch, Tab, Table, TableBody, TableCell, TableContainer, TableFooter, TableHead, TableHead as TableHeader, TableRow, Tabs, TextField, TextareaAutosize, Tooltip, Typography } from '@mui/material';
|
|
2
|
+
export { Alert, AlertTitle, Box, Breadcrumbs, Button, Card, CardActions, CardContent, CardHeader, Chip, CircularProgress, Collapse, Container, DialogActions, DialogContent, DialogContentText, DialogTitle, Divider, FilledInput, FormControl, FormControlLabel, FormGroup, FormHelperText, FormLabel, Grid, IconButton, Input, InputAdornment, InputLabel, LinearProgress, Link, ListItemIcon, ListItemText, Menu, MenuItem, OutlinedInput, Paper, Popover, Select, SelectChangeEvent, Skeleton, Stack, Switch, Tab, Table, TableBody, TableCell, TableContainer, TableFooter, TableHead, TableHead as TableHeader, TableRow, Tabs, TextField, TextareaAutosize, Tooltip, Typography } from '@mui/material';
|
|
3
3
|
import * as react from 'react';
|
|
4
4
|
|
|
5
|
+
/**
|
|
6
|
+
* The host theme's extra MUI colour slots, declared for TypeScript.
|
|
7
|
+
*
|
|
8
|
+
* ## Why this file exists
|
|
9
|
+
*
|
|
10
|
+
* The host realm's theme (gogo-ui) adds colour slots MUI does not ship, and styles them in CSS
|
|
11
|
+
* against the class names MUI derives from the `color` prop. `grey` is the neutral one - the colour
|
|
12
|
+
* every "not the primary action" control in the estate uses: Cancel, Add row, Show details.
|
|
13
|
+
*
|
|
14
|
+
* `palette.grey` is a 20..900 ramp with no `.main`, so it is filtered out by MUI's own
|
|
15
|
+
* `createSimplePaletteValueFilter` and MUI emits NO styles for `color="grey"`. What it does emit is
|
|
16
|
+
* the class name - `MuiButton-outlinedGrey`, `MuiButton-textGrey` - and gogo-ui's stylesheet styles
|
|
17
|
+
* exactly those:
|
|
18
|
+
*
|
|
19
|
+
* // coreconnect-web/packages/gogo-ui/src/style/inputs/button.css:724
|
|
20
|
+
* .MuiButton-outlinedGrey {
|
|
21
|
+
* @apply border-grey-200 text-text-primary;
|
|
22
|
+
* &:hover { @apply bg-grey-200/10 text-text-primary-dark; }
|
|
23
|
+
*
|
|
24
|
+
* So the colour is real, it just lives in the host's CSS rather than in MUI's emitted styles. The
|
|
25
|
+
* consequence for types is that MUI's `ButtonPropsColorOverrides` has no `grey` member, and
|
|
26
|
+
* `color="grey"` is a type error until someone widens the union - which every consuming plugin had
|
|
27
|
+
* already done locally (`src/types/mui-theme.d.ts` in `timesheets`/`tech`,
|
|
28
|
+
* `packages/gogo-ui/src/theme/mui-extend.ts` in the host).
|
|
29
|
+
*
|
|
30
|
+
* The SDK had not, which is why PR #255 shipped `color="inherit"` as a stopgap when it promoted
|
|
31
|
+
* `ConnectorMappingTranslationEditorView` out of those plugins. `inherit` is not a synonym: MUI DOES
|
|
32
|
+
* emit styles for it (`color: inherit; borderColor: currentColor`), so the promoted component lost
|
|
33
|
+
* the `grey-200` border and the `text-text-primary-dark` hover the four copies had. Declaring the
|
|
34
|
+
* slot here is what lets the component say `grey` again and render as it did.
|
|
35
|
+
*
|
|
36
|
+
* ## Why a declaration rather than a cast
|
|
37
|
+
*
|
|
38
|
+
* `color={"grey" as ButtonProps["color"]}` at each call site would also compile, and would leave the
|
|
39
|
+
* next author to rediscover why. This says the true thing once: the host theme HAS this colour.
|
|
40
|
+
*
|
|
41
|
+
* ## Merging with a consumer's own declaration
|
|
42
|
+
*
|
|
43
|
+
* Interface declaration merging is additive and idempotent for identical members, so a plugin that
|
|
44
|
+
* already declares `grey: true` keeps compiling with this present - the two declarations merge into
|
|
45
|
+
* the same one-member union. `src/components/ui/__tests__/muiColorAugmentation.test.ts` compiles that
|
|
46
|
+
* exact situation rather than asserting it in prose.
|
|
47
|
+
*
|
|
48
|
+
* ## Why it lives in this barrel
|
|
49
|
+
*
|
|
50
|
+
* `components/ui` is the MUI seam: it is where a plugin gets `Button` and `IconButton` from, so it
|
|
51
|
+
* is the barrel whose consumers can write `color="grey"`. `index.ts` imports this module so the
|
|
52
|
+
* declaration reaches `dist/components/ui/index.d.ts` and ships to them - an augmentation only
|
|
53
|
+
* applies to a program that loads it.
|
|
54
|
+
*
|
|
55
|
+
* ## Why Button and not IconButton
|
|
56
|
+
*
|
|
57
|
+
* `IconButton` deliberately gets no slot. gogo-ui has no `MuiIconButton-*Grey` rule anywhere - the
|
|
58
|
+
* only `.MuiIconButton-root` block in `button.css` sets sizes - and MUI emits nothing for a
|
|
59
|
+
* `main`-less palette entry, so `color="grey"` on an IconButton resolves to the root's
|
|
60
|
+
* `palette.action.active`, which that theme defines as `hsl(var(--text-primary))`: the same value
|
|
61
|
+
* `color="inherit"` inherits from the enclosing `MuiPaper-root`. Identical pixels, so there is
|
|
62
|
+
* nothing to restore and no reason to widen a second interface.
|
|
63
|
+
*/
|
|
64
|
+
declare module "@mui/material/Button" {
|
|
65
|
+
interface ButtonPropsColorOverrides {
|
|
66
|
+
grey: true;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
|
|
5
70
|
/**
|
|
6
71
|
* MUI `Dialog` with the scroll-lock + focus-restore overrides plugin surfaces
|
|
7
72
|
* need (AB#4808): MUI's defaults reset the page to top when a dialog opened from
|
|
@@ -1,7 +1,72 @@
|
|
|
1
1
|
import { DialogProps } from '@mui/material';
|
|
2
|
-
export { Alert, AlertTitle, Box, Breadcrumbs, Button, Card, CardActions, CardContent, CardHeader, Chip, CircularProgress, Container, DialogActions, DialogContent, DialogContentText, DialogTitle, Divider, FilledInput, FormControl, FormControlLabel, FormGroup, FormHelperText, FormLabel, Grid, IconButton, Input, InputAdornment, InputLabel, LinearProgress, Link, ListItemIcon, ListItemText, Menu, MenuItem, OutlinedInput, Paper, Popover, Select, SelectChangeEvent, Skeleton, Stack, Switch, Tab, Table, TableBody, TableCell, TableContainer, TableFooter, TableHead, TableHead as TableHeader, TableRow, Tabs, TextField, TextareaAutosize, Tooltip, Typography } from '@mui/material';
|
|
2
|
+
export { Alert, AlertTitle, Box, Breadcrumbs, Button, Card, CardActions, CardContent, CardHeader, Chip, CircularProgress, Collapse, Container, DialogActions, DialogContent, DialogContentText, DialogTitle, Divider, FilledInput, FormControl, FormControlLabel, FormGroup, FormHelperText, FormLabel, Grid, IconButton, Input, InputAdornment, InputLabel, LinearProgress, Link, ListItemIcon, ListItemText, Menu, MenuItem, OutlinedInput, Paper, Popover, Select, SelectChangeEvent, Skeleton, Stack, Switch, Tab, Table, TableBody, TableCell, TableContainer, TableFooter, TableHead, TableHead as TableHeader, TableRow, Tabs, TextField, TextareaAutosize, Tooltip, Typography } from '@mui/material';
|
|
3
3
|
import * as react from 'react';
|
|
4
4
|
|
|
5
|
+
/**
|
|
6
|
+
* The host theme's extra MUI colour slots, declared for TypeScript.
|
|
7
|
+
*
|
|
8
|
+
* ## Why this file exists
|
|
9
|
+
*
|
|
10
|
+
* The host realm's theme (gogo-ui) adds colour slots MUI does not ship, and styles them in CSS
|
|
11
|
+
* against the class names MUI derives from the `color` prop. `grey` is the neutral one - the colour
|
|
12
|
+
* every "not the primary action" control in the estate uses: Cancel, Add row, Show details.
|
|
13
|
+
*
|
|
14
|
+
* `palette.grey` is a 20..900 ramp with no `.main`, so it is filtered out by MUI's own
|
|
15
|
+
* `createSimplePaletteValueFilter` and MUI emits NO styles for `color="grey"`. What it does emit is
|
|
16
|
+
* the class name - `MuiButton-outlinedGrey`, `MuiButton-textGrey` - and gogo-ui's stylesheet styles
|
|
17
|
+
* exactly those:
|
|
18
|
+
*
|
|
19
|
+
* // coreconnect-web/packages/gogo-ui/src/style/inputs/button.css:724
|
|
20
|
+
* .MuiButton-outlinedGrey {
|
|
21
|
+
* @apply border-grey-200 text-text-primary;
|
|
22
|
+
* &:hover { @apply bg-grey-200/10 text-text-primary-dark; }
|
|
23
|
+
*
|
|
24
|
+
* So the colour is real, it just lives in the host's CSS rather than in MUI's emitted styles. The
|
|
25
|
+
* consequence for types is that MUI's `ButtonPropsColorOverrides` has no `grey` member, and
|
|
26
|
+
* `color="grey"` is a type error until someone widens the union - which every consuming plugin had
|
|
27
|
+
* already done locally (`src/types/mui-theme.d.ts` in `timesheets`/`tech`,
|
|
28
|
+
* `packages/gogo-ui/src/theme/mui-extend.ts` in the host).
|
|
29
|
+
*
|
|
30
|
+
* The SDK had not, which is why PR #255 shipped `color="inherit"` as a stopgap when it promoted
|
|
31
|
+
* `ConnectorMappingTranslationEditorView` out of those plugins. `inherit` is not a synonym: MUI DOES
|
|
32
|
+
* emit styles for it (`color: inherit; borderColor: currentColor`), so the promoted component lost
|
|
33
|
+
* the `grey-200` border and the `text-text-primary-dark` hover the four copies had. Declaring the
|
|
34
|
+
* slot here is what lets the component say `grey` again and render as it did.
|
|
35
|
+
*
|
|
36
|
+
* ## Why a declaration rather than a cast
|
|
37
|
+
*
|
|
38
|
+
* `color={"grey" as ButtonProps["color"]}` at each call site would also compile, and would leave the
|
|
39
|
+
* next author to rediscover why. This says the true thing once: the host theme HAS this colour.
|
|
40
|
+
*
|
|
41
|
+
* ## Merging with a consumer's own declaration
|
|
42
|
+
*
|
|
43
|
+
* Interface declaration merging is additive and idempotent for identical members, so a plugin that
|
|
44
|
+
* already declares `grey: true` keeps compiling with this present - the two declarations merge into
|
|
45
|
+
* the same one-member union. `src/components/ui/__tests__/muiColorAugmentation.test.ts` compiles that
|
|
46
|
+
* exact situation rather than asserting it in prose.
|
|
47
|
+
*
|
|
48
|
+
* ## Why it lives in this barrel
|
|
49
|
+
*
|
|
50
|
+
* `components/ui` is the MUI seam: it is where a plugin gets `Button` and `IconButton` from, so it
|
|
51
|
+
* is the barrel whose consumers can write `color="grey"`. `index.ts` imports this module so the
|
|
52
|
+
* declaration reaches `dist/components/ui/index.d.ts` and ships to them - an augmentation only
|
|
53
|
+
* applies to a program that loads it.
|
|
54
|
+
*
|
|
55
|
+
* ## Why Button and not IconButton
|
|
56
|
+
*
|
|
57
|
+
* `IconButton` deliberately gets no slot. gogo-ui has no `MuiIconButton-*Grey` rule anywhere - the
|
|
58
|
+
* only `.MuiIconButton-root` block in `button.css` sets sizes - and MUI emits nothing for a
|
|
59
|
+
* `main`-less palette entry, so `color="grey"` on an IconButton resolves to the root's
|
|
60
|
+
* `palette.action.active`, which that theme defines as `hsl(var(--text-primary))`: the same value
|
|
61
|
+
* `color="inherit"` inherits from the enclosing `MuiPaper-root`. Identical pixels, so there is
|
|
62
|
+
* nothing to restore and no reason to widen a second interface.
|
|
63
|
+
*/
|
|
64
|
+
declare module "@mui/material/Button" {
|
|
65
|
+
interface ButtonPropsColorOverrides {
|
|
66
|
+
grey: true;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
|
|
5
70
|
/**
|
|
6
71
|
* MUI `Dialog` with the scroll-lock + focus-restore overrides plugin surfaces
|
|
7
72
|
* need (AB#4808): MUI's defaults reset the page to top when a dialog opened from
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { FormControl, InputLabel, FilledInput, InputAdornment, IconButton, Dialog as Dialog$1 } from '@mui/material';
|
|
2
|
-
export { Alert, AlertTitle, Box, Breadcrumbs, Button, Card, CardActions, CardContent, CardHeader, Chip, CircularProgress, Container, DialogActions, DialogContent, DialogContentText, DialogTitle, Divider, FilledInput, FormControl, FormControlLabel, FormGroup, FormHelperText, FormLabel, Grid, IconButton, Input, InputAdornment, InputLabel, LinearProgress, Link, ListItemIcon, ListItemText, Menu, MenuItem, OutlinedInput, Paper, Popover, Select, Skeleton, Stack, Switch, Tab, Table, TableBody, TableCell, TableContainer, TableFooter, TableHead, TableHead as TableHeader, TableRow, Tabs, TextField, TextareaAutosize, Tooltip, Typography } from '@mui/material';
|
|
2
|
+
export { Alert, AlertTitle, Box, Breadcrumbs, Button, Card, CardActions, CardContent, CardHeader, Chip, CircularProgress, Collapse, Container, DialogActions, DialogContent, DialogContentText, DialogTitle, Divider, FilledInput, FormControl, FormControlLabel, FormGroup, FormHelperText, FormLabel, Grid, IconButton, Input, InputAdornment, InputLabel, LinearProgress, Link, ListItemIcon, ListItemText, Menu, MenuItem, OutlinedInput, Paper, Popover, Select, Skeleton, Stack, Switch, Tab, Table, TableBody, TableCell, TableContainer, TableFooter, TableHead, TableHead as TableHeader, TableRow, Tabs, TextField, TextareaAutosize, Tooltip, Typography } from '@mui/material';
|
|
3
3
|
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
4
4
|
import { memo, useState, useId, useRef, useEffect, useCallback } from 'react';
|
|
5
5
|
|
|
@@ -567,22 +567,41 @@ function useOverlayHost() {
|
|
|
567
567
|
}
|
|
568
568
|
return api;
|
|
569
569
|
}
|
|
570
|
+
function makeDefaultQueryClient2() {
|
|
571
|
+
return new reactQuery.QueryClient({
|
|
572
|
+
defaultOptions: {
|
|
573
|
+
queries: {
|
|
574
|
+
retry: 1,
|
|
575
|
+
refetchOnWindowFocus: false,
|
|
576
|
+
staleTime: 3e4
|
|
577
|
+
}
|
|
578
|
+
}
|
|
579
|
+
});
|
|
580
|
+
}
|
|
581
|
+
var defaultQueryClient2 = makeDefaultQueryClient2();
|
|
570
582
|
function definePlatformReactPluginOverlay(Overlay, options) {
|
|
571
|
-
const { rootClassName, styleId, css, manifest = {}, wrapOverlay } = options;
|
|
583
|
+
const { rootClassName, styleId, css, manifest = {}, queryClient = defaultQueryClient2, wrapOverlay } = options;
|
|
572
584
|
return function MountedOverlay(props) {
|
|
573
585
|
const tree = react.createElement(
|
|
574
586
|
OverlayHostContext.Provider,
|
|
575
587
|
{ value: props.overlayHost },
|
|
588
|
+
// react-query provider — an overlay bundle has its own react-query module
|
|
589
|
+
// instance, so the host's app-wide client is invisible across the bundle
|
|
590
|
+
// boundary; it needs its own provider exactly as each page gets one.
|
|
576
591
|
react.createElement(
|
|
577
|
-
|
|
578
|
-
{
|
|
579
|
-
react.createElement(PluginStyleScope, { id: styleId, css }),
|
|
592
|
+
reactQuery.QueryClientProvider,
|
|
593
|
+
{ client: queryClient },
|
|
580
594
|
react.createElement(
|
|
581
|
-
|
|
582
|
-
{
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
595
|
+
TemplateContext.Provider,
|
|
596
|
+
{ value: manifest },
|
|
597
|
+
react.createElement(PluginStyleScope, { id: styleId, css }),
|
|
598
|
+
react.createElement(
|
|
599
|
+
"div",
|
|
600
|
+
{ className: `${EHX_PLUGIN_ROOT_CLASS} ${rootClassName}` },
|
|
601
|
+
// Overlay surfaces open their own dialogs and menus, so they need the same
|
|
602
|
+
// portal containment as pages (see definePlatformReactPluginPage).
|
|
603
|
+
react.createElement(PluginPortalScope, null, react.createElement(Overlay, props))
|
|
604
|
+
)
|
|
586
605
|
)
|
|
587
606
|
)
|
|
588
607
|
);
|