@pdfme/ui 5.3.8-dev.41 → 5.3.8-dev.42
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.
@@ -0,0 +1,41 @@
|
|
1
|
+
import { fileURLToPath } from 'url';
|
2
|
+
import { dirname, resolve } from 'path';
|
3
|
+
import reactPlugin from 'eslint-plugin-react';
|
4
|
+
import reactHooksPlugin from 'eslint-plugin-react-hooks';
|
5
|
+
|
6
|
+
const __filename = fileURLToPath(import.meta.url);
|
7
|
+
const __dirname = dirname(__filename);
|
8
|
+
|
9
|
+
// Import the root config
|
10
|
+
const rootConfigPath = resolve(__dirname, '../../eslint.config.mjs');
|
11
|
+
const rootConfig = await import(rootConfigPath);
|
12
|
+
|
13
|
+
export default [
|
14
|
+
...rootConfig.default,
|
15
|
+
{
|
16
|
+
files: ['src/**/*.ts', 'src/**/*.tsx'],
|
17
|
+
languageOptions: {
|
18
|
+
parserOptions: {
|
19
|
+
project: ['./tsconfig.json'],
|
20
|
+
tsconfigRootDir: __dirname,
|
21
|
+
ecmaFeatures: {
|
22
|
+
jsx: true,
|
23
|
+
},
|
24
|
+
},
|
25
|
+
},
|
26
|
+
plugins: {
|
27
|
+
react: reactPlugin,
|
28
|
+
'react-hooks': reactHooksPlugin,
|
29
|
+
},
|
30
|
+
settings: {
|
31
|
+
react: {
|
32
|
+
version: 'detect',
|
33
|
+
},
|
34
|
+
},
|
35
|
+
rules: {
|
36
|
+
...reactPlugin.configs.recommended.rules,
|
37
|
+
'react-hooks/rules-of-hooks': 'error',
|
38
|
+
'react-hooks/exhaustive-deps': 'warn',
|
39
|
+
},
|
40
|
+
},
|
41
|
+
];
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@pdfme/ui",
|
3
|
-
"version": "5.3.8-dev.
|
3
|
+
"version": "5.3.8-dev.42",
|
4
4
|
"sideEffects": false,
|
5
5
|
"author": "hand-dot",
|
6
6
|
"license": "MIT",
|
@@ -30,7 +30,7 @@
|
|
30
30
|
"devBuildType:watch": "tsc --emitDeclarationOnly --watch",
|
31
31
|
"build": "vite build && tsc --emitDeclarationOnly",
|
32
32
|
"clean": "rimraf dist",
|
33
|
-
"lint": "eslint --ext .ts,.tsx src",
|
33
|
+
"lint": "eslint --ext .ts,.tsx src --config eslint.config.mjs --no-error-on-unmatched-pattern",
|
34
34
|
"test": "jest",
|
35
35
|
"prune": "ts-prune src",
|
36
36
|
"prettier": "prettier --write 'src/**/*.{ts,tsx}'"
|
@@ -56,11 +56,13 @@
|
|
56
56
|
"@testing-library/react": "^12.1.2",
|
57
57
|
"@types/react": "^17.0.52",
|
58
58
|
"@types/react-dom": "^17.0.18",
|
59
|
+
"@ungap/structured-clone": "^1.3.0",
|
59
60
|
"@vitejs/plugin-react": "^4.2.0",
|
60
61
|
"csstype": "^3.1.2",
|
61
62
|
"esbuild": "^0.25.0",
|
62
|
-
"eslint-plugin-react": "^7.
|
63
|
-
"eslint-plugin-react-hooks": "^
|
63
|
+
"eslint-plugin-react": "^7.37.4",
|
64
|
+
"eslint-plugin-react-hooks": "^5.2.0",
|
65
|
+
"is-path-inside": "^3.0.3",
|
64
66
|
"jest-canvas-mock": "^2.3.1",
|
65
67
|
"jest-environment-jsdom": "^29.7.0",
|
66
68
|
"process": "^0.11.10",
|
package/src/components/Root.tsx
CHANGED
@@ -17,13 +17,11 @@ const Root = ({ size, scale, children }: Props, ref: Ref<HTMLDivElement>) => {
|
|
17
17
|
display: 'swap',
|
18
18
|
})
|
19
19
|
);
|
20
|
-
// @ts-ignore
|
21
20
|
const newFontFaces = fontFaces.filter((fontFace) => !document.fonts.has(fontFace));
|
22
21
|
|
23
22
|
Promise.allSettled(newFontFaces.map((f) => f.load())).then((loadedFontFaces) => {
|
24
23
|
loadedFontFaces.forEach((loadedFontFace) => {
|
25
24
|
if (loadedFontFace.status === 'fulfilled') {
|
26
|
-
// @ts-ignore
|
27
25
|
document.fonts.add(loadedFontFace.value);
|
28
26
|
}
|
29
27
|
});
|
package/tsconfig.json
CHANGED
package/.eslintrc.cjs
DELETED
@@ -1,16 +0,0 @@
|
|
1
|
-
module.exports = {
|
2
|
-
extends: ['../../eslint.base.js', "plugin:react/recommended", 'plugin:react-hooks/recommended'],
|
3
|
-
overrides: [
|
4
|
-
{
|
5
|
-
files: ['*.ts', '*.tsx'],
|
6
|
-
parserOptions: {
|
7
|
-
project: ['./tsconfig.json'],
|
8
|
-
},
|
9
|
-
},
|
10
|
-
],
|
11
|
-
settings: {
|
12
|
-
react: {
|
13
|
-
version: 'detect',
|
14
|
-
},
|
15
|
-
},
|
16
|
-
};
|