@m4l/graphics 0.1.19 → 0.1.21
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/package.json +7 -49
- package/.eslintignore +0 -2
- package/.eslintrc.cjs +0 -118
- package/.gitignore +0 -24
- package/.gitlab-ci.yml +0 -15
- package/.prettierignore +0 -3
- package/.prettierrc.json +0 -26
- package/.vscode/settings.json +0 -50
- package/dist/package.json +0 -34
- package/src/components/ProgressBarStyle/index.tsx +0 -39
- package/src/components/index.ts +0 -3
- package/src/contexts/FormatterContext/index.tsx +0 -131
- package/src/contexts/FormatterContext/types.ts +0 -73
- package/src/contexts/HostThemeContext/index.tsx +0 -85
- package/src/contexts/HostThemeContext/types.ts +0 -16
- package/src/contexts/LocalesContext/helper.ts +0 -67
- package/src/contexts/LocalesContext/index.tsx +0 -152
- package/src/contexts/LocalesContext/types.ts +0 -37
- package/src/contexts/index.ts +0 -15
- package/src/hooks/index.ts +0 -8
- package/src/hooks/useFirstRender/index.ts +0 -17
- package/src/hooks/useFormatter/index.ts +0 -10
- package/src/hooks/useHostTheme/index.ts +0 -10
- package/src/hooks/useIsMountedRef/index.ts +0 -16
- package/src/hooks/useLocales/index.ts +0 -10
- package/src/hooks/useOffSetTop.ts +0 -26
- package/src/hooks/useResponsive/index.ts +0 -44
- package/src/index.ts +0 -25
- package/src/theme/breakpoints.ts +0 -13
- package/src/theme/defaultThemeOptions.ts +0 -42
- package/src/theme/overrides/Accordion.ts +0 -85
- package/src/theme/overrides/Alert.tsx +0 -74
- package/src/theme/overrides/Autocomplete.ts +0 -31
- package/src/theme/overrides/Avatar.ts +0 -29
- package/src/theme/overrides/Backdrop.ts +0 -26
- package/src/theme/overrides/Badge.ts +0 -17
- package/src/theme/overrides/Breadcrumbs.ts +0 -16
- package/src/theme/overrides/Button.ts +0 -62
- package/src/theme/overrides/ButtonGroup.ts +0 -51
- package/src/theme/overrides/Card.ts +0 -36
- package/src/theme/overrides/Checkbox.tsx +0 -54
- package/src/theme/overrides/Chip.tsx +0 -49
- package/src/theme/overrides/ControlLabel.ts +0 -29
- package/src/theme/overrides/CssBaseline.ts +0 -46
- package/src/theme/overrides/CustomIcons.tsx +0 -122
- package/src/theme/overrides/DataGrid.ts +0 -101
- package/src/theme/overrides/Dialog.ts +0 -60
- package/src/theme/overrides/Drawer.ts +0 -30
- package/src/theme/overrides/Fab.ts +0 -40
- package/src/theme/overrides/IconButton.ts +0 -35
- package/src/theme/overrides/Input.ts +0 -94
- package/src/theme/overrides/InputLabel.ts +0 -17
- package/src/theme/overrides/Link.ts +0 -20
- package/src/theme/overrides/List.ts +0 -37
- package/src/theme/overrides/LoadingButton.ts +0 -28
- package/src/theme/overrides/Menu.ts +0 -20
- package/src/theme/overrides/Pagination.ts +0 -38
- package/src/theme/overrides/Paper.ts +0 -27
- package/src/theme/overrides/Popover.ts +0 -16
- package/src/theme/overrides/Progress.ts +0 -27
- package/src/theme/overrides/Radio.ts +0 -21
- package/src/theme/overrides/Rating.tsx +0 -30
- package/src/theme/overrides/Select.tsx +0 -14
- package/src/theme/overrides/Skeleton.ts +0 -19
- package/src/theme/overrides/Slider.ts +0 -31
- package/src/theme/overrides/Stepper.ts +0 -15
- package/src/theme/overrides/SvgIcon.ts +0 -21
- package/src/theme/overrides/Switch.ts +0 -35
- package/src/theme/overrides/Table.ts +0 -95
- package/src/theme/overrides/Tabs.ts +0 -61
- package/src/theme/overrides/Timeline.ts +0 -23
- package/src/theme/overrides/ToggleButton.ts +0 -54
- package/src/theme/overrides/Tooltip.ts +0 -20
- package/src/theme/overrides/TreeView.tsx +0 -25
- package/src/theme/overrides/Typography.ts +0 -18
- package/src/theme/overrides/index.ts +0 -102
- package/src/theme/palette.ts +0 -216
- package/src/theme/shadows.ts +0 -110
- package/src/theme/stretch.ts +0 -10
- package/src/theme/typography.ts +0 -91
- package/src/types/index.ts +0 -9
- package/src/utils/anchorEl.ts +0 -146
- package/src/utils/getColorPresets.ts +0 -91
- package/src/utils/getFontValue.ts +0 -73
- package/src/utils/strings.ts +0 -1
- package/src/vite-env.d.ts +0 -1
- package/tsconfig.json +0 -29
- package/tsconfig.node.json +0 -8
- package/vite.config.ts +0 -234
- /package/{dist/components → components}/ProgressBarStyle/index.d.ts +0 -0
- /package/{dist/components → components}/ProgressBarStyle/index.fb6fd9ed.js +0 -0
- /package/{dist/components → components}/index.80514d59.js +0 -0
- /package/{dist/components → components}/index.d.ts +0 -0
- /package/{dist/contexts → contexts}/FormatterContext/index.92336f4c.js +0 -0
- /package/{dist/contexts → contexts}/FormatterContext/index.d.ts +0 -0
- /package/{dist/contexts → contexts}/FormatterContext/types.d.ts +0 -0
- /package/{dist/contexts → contexts}/HostThemeContext/index.a6a62c70.js +0 -0
- /package/{dist/contexts → contexts}/HostThemeContext/index.d.ts +0 -0
- /package/{dist/contexts → contexts}/HostThemeContext/types.d.ts +0 -0
- /package/{dist/contexts → contexts}/LocalesContext/helper.d.ts +0 -0
- /package/{dist/contexts → contexts}/LocalesContext/index.5b555637.js +0 -0
- /package/{dist/contexts → contexts}/LocalesContext/index.d.ts +0 -0
- /package/{dist/contexts → contexts}/LocalesContext/types.d.ts +0 -0
- /package/{dist/contexts → contexts}/index.2f4a4040.js +0 -0
- /package/{dist/contexts → contexts}/index.d.ts +0 -0
- /package/{dist/hooks → hooks}/index.c13bc37e.js +0 -0
- /package/{dist/hooks → hooks}/index.d.ts +0 -0
- /package/{dist/hooks → hooks}/useFirstRender/index.1e9b02fb.js +0 -0
- /package/{dist/hooks → hooks}/useFirstRender/index.d.ts +0 -0
- /package/{dist/hooks → hooks}/useFormatter/index.57ac8cca.js +0 -0
- /package/{dist/hooks → hooks}/useFormatter/index.d.ts +0 -0
- /package/{dist/hooks → hooks}/useHostTheme/index.1c8e4ad7.js +0 -0
- /package/{dist/hooks → hooks}/useHostTheme/index.d.ts +0 -0
- /package/{dist/hooks → hooks}/useIsMountedRef/index.d.ts +0 -0
- /package/{dist/hooks → hooks}/useLocales/index.d.ts +0 -0
- /package/{dist/hooks → hooks}/useLocales/index.f676279e.js +0 -0
- /package/{dist/hooks → hooks}/useOffSetTop.d.ts +0 -0
- /package/{dist/hooks → hooks}/useResponsive/index.d.ts +0 -0
- /package/{dist/hooks → hooks}/useResponsive/index.fc5e1b4f.js +0 -0
- /package/{dist/index.d.ts → index.d.ts} +0 -0
- /package/{dist/index.js → index.js} +0 -0
- /package/{dist/theme → theme}/breakpoints.d.ts +0 -0
- /package/{dist/theme → theme}/defaultThemeOptions.b2cdbe59.js +0 -0
- /package/{dist/theme → theme}/defaultThemeOptions.d.ts +0 -0
- /package/{dist/theme → theme}/overrides/Accordion.d.ts +0 -0
- /package/{dist/theme → theme}/overrides/Autocomplete.d.ts +0 -0
- /package/{dist/theme → theme}/overrides/Avatar.d.ts +0 -0
- /package/{dist/theme → theme}/overrides/Backdrop.d.ts +0 -0
- /package/{dist/theme → theme}/overrides/Badge.d.ts +0 -0
- /package/{dist/theme → theme}/overrides/Breadcrumbs.d.ts +0 -0
- /package/{dist/theme → theme}/overrides/Button.d.ts +0 -0
- /package/{dist/theme → theme}/overrides/ButtonGroup.d.ts +0 -0
- /package/{dist/theme → theme}/overrides/Card.d.ts +0 -0
- /package/{dist/theme → theme}/overrides/Checkbox.d.ts +0 -0
- /package/{dist/theme → theme}/overrides/ControlLabel.d.ts +0 -0
- /package/{dist/theme → theme}/overrides/CssBaseline.d.ts +0 -0
- /package/{dist/theme → theme}/overrides/DataGrid.d.ts +0 -0
- /package/{dist/theme → theme}/overrides/Dialog.d.ts +0 -0
- /package/{dist/theme → theme}/overrides/Drawer.d.ts +0 -0
- /package/{dist/theme → theme}/overrides/Fab.d.ts +0 -0
- /package/{dist/theme → theme}/overrides/IconButton.d.ts +0 -0
- /package/{dist/theme → theme}/overrides/Input.d.ts +0 -0
- /package/{dist/theme → theme}/overrides/InputLabel.d.ts +0 -0
- /package/{dist/theme → theme}/overrides/Link.d.ts +0 -0
- /package/{dist/theme → theme}/overrides/List.d.ts +0 -0
- /package/{dist/theme → theme}/overrides/LoadingButton.d.ts +0 -0
- /package/{dist/theme → theme}/overrides/Menu.d.ts +0 -0
- /package/{dist/theme → theme}/overrides/Pagination.d.ts +0 -0
- /package/{dist/theme → theme}/overrides/Paper.d.ts +0 -0
- /package/{dist/theme → theme}/overrides/Popover.d.ts +0 -0
- /package/{dist/theme → theme}/overrides/Progress.d.ts +0 -0
- /package/{dist/theme → theme}/overrides/Radio.d.ts +0 -0
- /package/{dist/theme → theme}/overrides/Skeleton.d.ts +0 -0
- /package/{dist/theme → theme}/overrides/Slider.d.ts +0 -0
- /package/{dist/theme → theme}/overrides/Stepper.d.ts +0 -0
- /package/{dist/theme → theme}/overrides/SvgIcon.d.ts +0 -0
- /package/{dist/theme → theme}/overrides/Switch.d.ts +0 -0
- /package/{dist/theme → theme}/overrides/Table.d.ts +0 -0
- /package/{dist/theme → theme}/overrides/Tabs.d.ts +0 -0
- /package/{dist/theme → theme}/overrides/Timeline.d.ts +0 -0
- /package/{dist/theme → theme}/overrides/ToggleButton.d.ts +0 -0
- /package/{dist/theme → theme}/overrides/Tooltip.d.ts +0 -0
- /package/{dist/theme → theme}/overrides/Typography.d.ts +0 -0
- /package/{dist/theme → theme}/overrides/index.d.ts +0 -0
- /package/{dist/theme → theme}/overrides.7958c0ab.js +0 -0
- /package/{dist/theme → theme}/palette.2baf72f5.js +0 -0
- /package/{dist/theme → theme}/palette.d.ts +0 -0
- /package/{dist/theme → theme}/shadows.bf8dc290.js +0 -0
- /package/{dist/theme → theme}/shadows.d.ts +0 -0
- /package/{dist/theme → theme}/stretch.d.ts +0 -0
- /package/{dist/theme → theme}/typography.63fff3ec.js +0 -0
- /package/{dist/theme → theme}/typography.d.ts +0 -0
- /package/{dist/types → types}/index.d.ts +0 -0
- /package/{dist/utils → utils}/anchorEl.d.ts +0 -0
- /package/{dist/utils → utils}/getColorPresets.d.ts +0 -0
- /package/{dist/utils → utils}/getFontValue.d.ts +0 -0
- /package/{dist/utils → utils}/index.7ab4fc54.js +0 -0
- /package/{dist/utils → utils}/strings.d.ts +0 -0
- /package/{dist/vendor.3b4b3674.js → vendor.3b4b3674.js} +0 -0
- /package/{dist/vite-env.d.ts → vite-env.d.ts} +0 -0
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
// @mui
|
|
2
|
-
import { useTheme } from '@mui/material/styles';
|
|
3
|
-
import type { Variant } from '@mui/material/styles/createTypography';
|
|
4
|
-
|
|
5
|
-
// hooks
|
|
6
|
-
import { useResponsive } from '../hooks/useResponsive';
|
|
7
|
-
|
|
8
|
-
// ----------------------------------------------------------------------
|
|
9
|
-
|
|
10
|
-
export function remToPx(value: string) {
|
|
11
|
-
return Math.round(parseFloat(value) * 16);
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
export function pxToRem(value: number) {
|
|
15
|
-
return `${value / 16}rem`;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
export function responsiveFontSizes({ sm, md, lg }: { sm: number; md: number; lg: number }) {
|
|
19
|
-
return {
|
|
20
|
-
'@media (min-width:600px)': {
|
|
21
|
-
fontSize: pxToRem(sm),
|
|
22
|
-
},
|
|
23
|
-
'@media (min-width:900px)': {
|
|
24
|
-
fontSize: pxToRem(md),
|
|
25
|
-
},
|
|
26
|
-
'@media (min-width:1200px)': {
|
|
27
|
-
fontSize: pxToRem(lg),
|
|
28
|
-
},
|
|
29
|
-
};
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
function useWidth() {
|
|
33
|
-
const theme = useTheme();
|
|
34
|
-
const keys = [...theme.breakpoints.keys].reverse();
|
|
35
|
-
return (
|
|
36
|
-
// @ts-ignore not sure what is this
|
|
37
|
-
keys.reduce((output, key) => {
|
|
38
|
-
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
39
|
-
const matches = useResponsive('up', key);
|
|
40
|
-
return !output && matches ? key : output;
|
|
41
|
-
}, null) || 'xs'
|
|
42
|
-
);
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
// ----------------------------------------------------------------------
|
|
46
|
-
|
|
47
|
-
export function getFontValue(variant: Variant) {
|
|
48
|
-
const theme = useTheme();
|
|
49
|
-
const breakpoints = useWidth();
|
|
50
|
-
|
|
51
|
-
const key = theme.breakpoints.up(breakpoints === 'xl' ? 'lg' : breakpoints);
|
|
52
|
-
|
|
53
|
-
const hasResponsive =
|
|
54
|
-
variant === 'h1' ||
|
|
55
|
-
variant === 'h2' ||
|
|
56
|
-
variant === 'h3' ||
|
|
57
|
-
variant === 'h4' ||
|
|
58
|
-
variant === 'h5' ||
|
|
59
|
-
variant === 'h6';
|
|
60
|
-
|
|
61
|
-
const getFont: any =
|
|
62
|
-
hasResponsive && theme.typography[variant][key]
|
|
63
|
-
? theme.typography[variant][key]
|
|
64
|
-
: theme.typography[variant];
|
|
65
|
-
|
|
66
|
-
const fontSize = remToPx(getFont.fontSize);
|
|
67
|
-
const lineHeight = Number(theme.typography[variant].lineHeight) * fontSize;
|
|
68
|
-
const { fontWeight, letterSpacing } = theme.typography[variant];
|
|
69
|
-
|
|
70
|
-
return { fontSize, lineHeight, fontWeight, letterSpacing };
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
// ----------------------------------------------------------------------
|
package/src/utils/strings.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export const Capitalize = (s: string) => (s && s[0].toUpperCase() + s.slice(1)) || '';
|
package/src/vite-env.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
/// <reference types="vite/client" />
|
package/tsconfig.json
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
"target": "esNext",
|
|
4
|
-
"useDefineForClassFields": true,
|
|
5
|
-
"lib": ["DOM", "DOM.Iterable", "ESNext"],
|
|
6
|
-
"allowJs": false,
|
|
7
|
-
"skipLibCheck": true,
|
|
8
|
-
"esModuleInterop": false,
|
|
9
|
-
"allowSyntheticDefaultImports": true,
|
|
10
|
-
"strict": true,
|
|
11
|
-
"downlevelIteration":true,
|
|
12
|
-
"importHelpers": true,
|
|
13
|
-
"experimentalDecorators": true,
|
|
14
|
-
"forceConsistentCasingInFileNames": true,
|
|
15
|
-
"module": "ESNext",
|
|
16
|
-
"moduleResolution": "Node",
|
|
17
|
-
"resolveJsonModule": true,
|
|
18
|
-
"isolatedModules": true,
|
|
19
|
-
"noEmit": true,
|
|
20
|
-
"jsx": "preserve",
|
|
21
|
-
"importsNotUsedAsValues":"remove",
|
|
22
|
-
"baseUrl": ".",
|
|
23
|
-
"paths": {
|
|
24
|
-
}
|
|
25
|
-
},
|
|
26
|
-
"include": ["src"],
|
|
27
|
-
"exclude": ["node_modules","dist"],
|
|
28
|
-
"references": [{ "path": "./tsconfig.node.json" }]
|
|
29
|
-
}
|
package/tsconfig.node.json
DELETED
package/vite.config.ts
DELETED
|
@@ -1,234 +0,0 @@
|
|
|
1
|
-
import react from '@vitejs/plugin-react';
|
|
2
|
-
import { defineConfig } from 'vite';
|
|
3
|
-
import * as path from 'path';
|
|
4
|
-
import dts from 'vite-plugin-dts';
|
|
5
|
-
|
|
6
|
-
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
|
7
|
-
|
|
8
|
-
function manualChunks(id: string, _api: any) {
|
|
9
|
-
//components
|
|
10
|
-
|
|
11
|
-
if (id.includes('Page')) {
|
|
12
|
-
return 'components/Page/index';
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
if (id.includes('ProgressBarStyle')) {
|
|
16
|
-
return 'components/ProgressBarStyle/index';
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
if (id.includes('components')) {
|
|
20
|
-
return 'components/index';
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
//miu_extended
|
|
24
|
-
|
|
25
|
-
if (id.includes('mui_extended')) {
|
|
26
|
-
return 'components/mui_extended/index';
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
//components
|
|
30
|
-
if (id.includes('components')) {
|
|
31
|
-
return 'components/index';
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
//context
|
|
35
|
-
|
|
36
|
-
if (id.includes('HostThemeContext')) {
|
|
37
|
-
return 'contexts/HostThemeContext/index';
|
|
38
|
-
}
|
|
39
|
-
if (id.includes('LocalesContext')) {
|
|
40
|
-
return 'contexts/LocalesContext/index';
|
|
41
|
-
}
|
|
42
|
-
if (id.includes('FormatterContext')) {
|
|
43
|
-
return 'contexts/FormatterContext/index';
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
if (id.includes('contexts')) {
|
|
47
|
-
return 'contexts/index';
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
//hooks
|
|
51
|
-
|
|
52
|
-
if (id.includes('useFirstRender')) {
|
|
53
|
-
return 'hooks/useFirstRender/index';
|
|
54
|
-
}
|
|
55
|
-
if (id.includes('useHostTheme')) {
|
|
56
|
-
return 'hooks/useHostTheme/index';
|
|
57
|
-
}
|
|
58
|
-
if (id.includes('useLocales')) {
|
|
59
|
-
return 'hooks/useLocales/index';
|
|
60
|
-
}
|
|
61
|
-
if (id.includes('useFormatter')) {
|
|
62
|
-
return 'hooks/useFormatter/index';
|
|
63
|
-
}
|
|
64
|
-
if (id.includes('useResponsive')) {
|
|
65
|
-
return 'hooks/useResponsive/index';
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
if (id.includes('hooks')) {
|
|
69
|
-
return 'hooks/index';
|
|
70
|
-
}
|
|
71
|
-
//theme
|
|
72
|
-
if (id.includes('ProgressBarStyle')) {
|
|
73
|
-
return 'components/ProgressBarStyle/index';
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
if (id.includes('palette')) {
|
|
77
|
-
return 'theme/palette';
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
if (id.includes('typography')) {
|
|
81
|
-
return 'theme/typography';
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
if (id.includes('shadows')) {
|
|
85
|
-
return 'theme/shadows';
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
if (id.includes('defaultThemeOptions')) {
|
|
89
|
-
return 'theme/defaultThemeOptions';
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
if (id.includes('overrides')) {
|
|
93
|
-
return 'theme/overrides';
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
//external libraries
|
|
97
|
-
// if (id.includes('react-helmet-async')) {
|
|
98
|
-
// return 'react-helmet-async';
|
|
99
|
-
// }
|
|
100
|
-
// if (id.includes('react-fast-compare')) {
|
|
101
|
-
// return 'react-helmet-async-react-fast-compare';
|
|
102
|
-
// }
|
|
103
|
-
// if (id.includes('shallowequal')) {
|
|
104
|
-
// return 'react-helmet-async-shallowequal';
|
|
105
|
-
// }
|
|
106
|
-
// if (id.includes('invariant')) {
|
|
107
|
-
// return 'react-helmet-async-invariant';
|
|
108
|
-
// }
|
|
109
|
-
|
|
110
|
-
//utils
|
|
111
|
-
|
|
112
|
-
if (id.includes('utils')) {
|
|
113
|
-
return 'utils/index';
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
//node_modules no reconocidos
|
|
117
|
-
if (id.includes('node_modules')) {
|
|
118
|
-
return 'node_modules';
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
// //prop-types no incluidos
|
|
122
|
-
// if (id.includes('prop-types')) {
|
|
123
|
-
// return 'prop-types';
|
|
124
|
-
// }
|
|
125
|
-
|
|
126
|
-
// //react no incluidos
|
|
127
|
-
// if (id.includes('react')) {
|
|
128
|
-
// return 'react';
|
|
129
|
-
// }
|
|
130
|
-
|
|
131
|
-
//commonjs no incluidos
|
|
132
|
-
if (id.includes('commonjs')) {
|
|
133
|
-
return 'commonjs';
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
return 'vendor';
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
const examined_libs = [];
|
|
140
|
-
|
|
141
|
-
const isExternal = (source: string, importer: string | undefined, isResolved: boolean): boolean => {
|
|
142
|
-
const internal_exact_libs = [];
|
|
143
|
-
const external_exact_libs = ['react', 'react/jsx-runtime', '@m4l/core', 'react-helmet-async'];
|
|
144
|
-
const external_parcial_libs = [
|
|
145
|
-
'jsx-runtime',
|
|
146
|
-
'react-dnd',
|
|
147
|
-
'react-router-dom',
|
|
148
|
-
'react-hook-form',
|
|
149
|
-
'date-fns',
|
|
150
|
-
'@mui',
|
|
151
|
-
'@emotion',
|
|
152
|
-
'prop-types',
|
|
153
|
-
];
|
|
154
|
-
|
|
155
|
-
if (internal_exact_libs.findIndex(l => source === l) > -1) {
|
|
156
|
-
return false;
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
const isExt =
|
|
160
|
-
external_exact_libs.findIndex(l => source === l) > -1 ||
|
|
161
|
-
external_parcial_libs.findIndex(pl => source.indexOf(pl) > -1) > -1;
|
|
162
|
-
if (isExt) {
|
|
163
|
-
if (examined_libs.findIndex(l => source === l) < 0) {
|
|
164
|
-
console.log(
|
|
165
|
-
'Source: ',
|
|
166
|
-
source,
|
|
167
|
-
' Importer:',
|
|
168
|
-
' isResolved:',
|
|
169
|
-
isResolved,
|
|
170
|
-
' IsExt:',
|
|
171
|
-
isExt,
|
|
172
|
-
);
|
|
173
|
-
examined_libs.push(source);
|
|
174
|
-
}
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
return isExt;
|
|
178
|
-
};
|
|
179
|
-
|
|
180
|
-
export default defineConfig({
|
|
181
|
-
server: { https: true, port: 4002 },
|
|
182
|
-
// test: {
|
|
183
|
-
// globals: true,
|
|
184
|
-
// include: ['**/*.{test,spec}.{js,mjs,cjs,ts,mts,cts,jsx,tsx}'],
|
|
185
|
-
// environment: 'jsdom',
|
|
186
|
-
// setupFiles: './src/test/setup.ts',
|
|
187
|
-
// coverage: {
|
|
188
|
-
// all: true,
|
|
189
|
-
// include: ['**/*.{js,mjs,cjs,ts,mts,cts,jsx,tsx}'],
|
|
190
|
-
// reporter: ['text', 'json', 'html'],
|
|
191
|
-
// },
|
|
192
|
-
// },
|
|
193
|
-
|
|
194
|
-
plugins: [
|
|
195
|
-
dts({
|
|
196
|
-
// insertTypesEntry: true,
|
|
197
|
-
outputDir: './dist',
|
|
198
|
-
beforeWriteFile: (filePath: string, content: string) => {
|
|
199
|
-
return { filePath: filePath.replace('m4l_graphics/src/', ''), content };
|
|
200
|
-
},
|
|
201
|
-
}),
|
|
202
|
-
react(),
|
|
203
|
-
// terser(),
|
|
204
|
-
],
|
|
205
|
-
// mode: 'production',
|
|
206
|
-
build: {
|
|
207
|
-
//manifest: true,
|
|
208
|
-
target: 'esNext', //Compila en esNext teniendo en cuenta que va a ser leida no por el navedado,sino por otros proyectos
|
|
209
|
-
lib: {
|
|
210
|
-
entry: path.resolve(__dirname, 'src/index.ts'),
|
|
211
|
-
name: 'm4l_graphics',
|
|
212
|
-
formats: ['es'],
|
|
213
|
-
fileName: () => `index.js`,
|
|
214
|
-
},
|
|
215
|
-
rollupOptions: {
|
|
216
|
-
external: isExternal,
|
|
217
|
-
|
|
218
|
-
// input: ['src/index.ts'],
|
|
219
|
-
|
|
220
|
-
output: {
|
|
221
|
-
manualChunks,
|
|
222
|
-
exports: 'auto',
|
|
223
|
-
format: 'esm',
|
|
224
|
-
generatedCode: 'es2015',
|
|
225
|
-
|
|
226
|
-
dir: 'dist', // Carpenta donde se genera el bundle
|
|
227
|
-
globals: {
|
|
228
|
-
react: 'react',
|
|
229
|
-
'react/jsx-runtime': 'react/jsx-runtime',
|
|
230
|
-
},
|
|
231
|
-
},
|
|
232
|
-
},
|
|
233
|
-
},
|
|
234
|
-
});
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|