@maif/react-forms 1.0.29 → 1.0.32

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 (44) hide show
  1. package/README.md +5 -4
  2. package/lib/esm/index.js +30260 -0
  3. package/lib/index.js +30281 -39
  4. package/package.json +29 -36
  5. package/rollup.config.js +53 -0
  6. package/dist/react-form.js +0 -2
  7. package/dist/react-form.js.LICENSE.txt +0 -103
  8. package/lib/Option.d.ts +0 -39
  9. package/lib/Option.js +0 -66
  10. package/lib/constraints.d.ts +0 -90
  11. package/lib/constraints.js +0 -371
  12. package/lib/form.d.ts +0 -2
  13. package/lib/form.js +0 -1361
  14. package/lib/format.d.ts +0 -12
  15. package/lib/format.js +0 -19
  16. package/lib/index.d.ts +0 -4
  17. package/lib/inputs/ArrayInput.d.ts +0 -1
  18. package/lib/inputs/ArrayInput.js +0 -141
  19. package/lib/inputs/BooleanInput.d.ts +0 -4
  20. package/lib/inputs/BooleanInput.js +0 -35
  21. package/lib/inputs/CodeInput.d.ts +0 -9
  22. package/lib/inputs/CodeInput.js +0 -89
  23. package/lib/inputs/Collapse.d.ts +0 -1
  24. package/lib/inputs/Collapse.js +0 -73
  25. package/lib/inputs/MarkdownInput.d.ts +0 -1
  26. package/lib/inputs/MarkdownInput.js +0 -433
  27. package/lib/inputs/SelectInput.d.ts +0 -1
  28. package/lib/inputs/SelectInput.js +0 -236
  29. package/lib/inputs/index.d.ts +0 -7
  30. package/lib/inputs/index.js +0 -96
  31. package/lib/inputs/objectInput.d.ts +0 -1
  32. package/lib/inputs/objectInput.js +0 -115
  33. package/lib/resolvers/index.d.ts +0 -2
  34. package/lib/resolvers/index.js +0 -19
  35. package/lib/resolvers/utils.d.ts +0 -5
  36. package/lib/resolvers/utils.js +0 -133
  37. package/lib/style.d.ts +0 -230
  38. package/lib/style.js +0 -178
  39. package/lib/styleContext.d.ts +0 -1
  40. package/lib/styleContext.js +0 -29
  41. package/lib/type.d.ts +0 -8
  42. package/lib/type.js +0 -15
  43. package/lib/utils.d.ts +0 -2
  44. package/lib/utils.js +0 -37
package/package.json CHANGED
@@ -1,8 +1,11 @@
1
1
  {
2
2
  "name": "@maif/react-forms",
3
3
  "description": "Build react safe forms as fast as possible",
4
- "version": "1.0.29",
4
+ "version": "1.0.32",
5
5
  "main": "lib/index.js",
6
+ "module": "lib/esm/index.js",
7
+ "types": "lib/index.js",
8
+ "source": "src/index.js",
6
9
  "author": "MAIF team",
7
10
  "keywords": [
8
11
  "react",
@@ -24,10 +27,8 @@
24
27
  }
25
28
  ],
26
29
  "scripts": {
27
- "build:lib": "babel src --extensions \".ts,.js\" --out-dir lib",
28
- "build:types": "tsc --declaration --emitDeclarationOnly ",
29
- "bundle": "cross-env NODE_ENV=production webpack --color --progress",
30
- "build": "yarn bundle && yarn build:lib && yarn build:types",
30
+ "build": "rollup -c",
31
+ "dev": "rollup -c -w",
31
32
  "test": "jest",
32
33
  "tdd": "jest --watch"
33
34
  },
@@ -53,29 +54,15 @@
53
54
  "react": "^17.0.2"
54
55
  },
55
56
  "devDependencies": {
56
- "@babel/cli": "^7.0.0",
57
- "@babel/core": "^7.0.1",
58
- "@babel/plugin-proposal-class-properties": "^7.0.0",
59
- "@babel/plugin-proposal-decorators": "^7.0.0",
60
- "@babel/plugin-proposal-do-expressions": "^7.0.0",
61
- "@babel/plugin-proposal-export-default-from": "^7.0.0",
62
- "@babel/plugin-proposal-export-namespace-from": "^7.0.0",
63
- "@babel/plugin-proposal-function-bind": "^7.0.0",
64
- "@babel/plugin-proposal-function-sent": "^7.0.0",
65
- "@babel/plugin-proposal-json-strings": "^7.0.0",
66
- "@babel/plugin-proposal-logical-assignment-operators": "^7.0.0",
67
- "@babel/plugin-proposal-nullish-coalescing-operator": "^7.0.0",
68
- "@babel/plugin-proposal-numeric-separator": "^7.0.0",
69
- "@babel/plugin-proposal-object-rest-spread": "^7.0.0",
70
- "@babel/plugin-proposal-optional-chaining": "^7.0.0",
71
- "@babel/plugin-proposal-pipeline-operator": "^7.0.0",
72
- "@babel/plugin-proposal-throw-expressions": "^7.0.0",
73
- "@babel/plugin-syntax-dynamic-import": "^7.0.0",
74
- "@babel/plugin-syntax-import-meta": "^7.0.0",
75
- "@babel/plugin-transform-runtime": "^7.0.0",
76
- "@babel/preset-env": "^7.0.0",
77
- "@babel/preset-react": "^7.0.0",
78
- "@babel/preset-typescript": "^7.15.0",
57
+ "@babel/cli": "^7.17.6",
58
+ "@babel/core": "^7.17.8",
59
+ "@babel/preset-env": "^7.16.11",
60
+ "@babel/preset-react": "^7.16.7",
61
+ "@rollup/plugin-babel": "^5.3.1",
62
+ "@rollup/plugin-commonjs": "^21.0.2",
63
+ "@rollup/plugin-json": "^4.1.0",
64
+ "@rollup/plugin-node-resolve": "^13.1.3",
65
+ "@rollup/plugin-typescript": "^8.3.1",
79
66
  "babel-loader": "8.2.2",
80
67
  "chai": "^4.3.4",
81
68
  "chai-as-promised": "^7.1.1",
@@ -85,16 +72,24 @@
85
72
  "jest": "^27.0.6",
86
73
  "react": "^17.0.2",
87
74
  "react-dom": "^17.0.2",
75
+ "rollup": "^2.70.1",
76
+ "rollup-plugin-commonjs": "^10.1.0",
77
+ "rollup-plugin-delete": "^2.0.0",
78
+ "rollup-plugin-peer-deps-external": "^2.2.4",
79
+ "rollup-plugin-terser": "^7.0.2",
88
80
  "sinon": "^11.1.2",
89
81
  "sinon-chai": "^3.7.0",
90
82
  "style-loader": "2.0.0",
91
- "transform-loader": "0.2.4",
92
- "ts-loader": "9.2.5",
93
- "webpack": "5.30.0",
94
- "webpack-cli": "4.6.0",
95
- "webpack-dev-server": "4.0.0-beta.1"
83
+ "transform-loader": "0.2.4"
96
84
  },
97
85
  "dependencies": {
86
+ "@codemirror/basic-setup": "^0.19.1",
87
+ "@codemirror/lang-html": "^0.19.4",
88
+ "@codemirror/lang-javascript": "^0.19.7",
89
+ "@codemirror/lang-json": "^0.19.2",
90
+ "@codemirror/lang-markdown": "^0.19.6",
91
+ "@codemirror/language-data": "^0.19.2",
92
+ "@codemirror/theme-one-dark": "^0.19.1",
98
93
  "@fortawesome/fontawesome-free": "^5.15.3",
99
94
  "@hookform/resolvers": "2.4.0",
100
95
  "@popperjs/core": "^2.11.2",
@@ -107,11 +102,9 @@
107
102
  "@types/react-dom": "^17.0.9",
108
103
  "antd": "4.15.4",
109
104
  "bootstrap": "5.0.0",
110
- "brace": "^0.11.1",
111
105
  "classnames": "2.3.0",
112
106
  "highlight.js": "11.2.0",
113
107
  "moment": "2.29.1",
114
- "react-ace": "9.5.0",
115
108
  "react-feather": "2.0.9",
116
109
  "react-hook-form": "7.17.1",
117
110
  "react-jss": "10.8.2",
@@ -121,6 +114,6 @@
121
114
  "showdown": "1.9.1",
122
115
  "typescript": "^4.3.5",
123
116
  "uuid": "8.3.2",
124
- "yup": "0.32.9"
117
+ "yup": "0.32.11"
125
118
  }
126
119
  }
@@ -0,0 +1,53 @@
1
+ import babel from '@rollup/plugin-babel'
2
+ import external from 'rollup-plugin-peer-deps-external'
3
+ import del from 'rollup-plugin-delete'
4
+ import pkg from './package.json'
5
+ import commonjs from '@rollup/plugin-commonjs'
6
+ import resolve from "@rollup/plugin-node-resolve"
7
+ import { terser } from 'rollup-plugin-terser'
8
+
9
+ const isDev = process.env.NODE_ENV !== 'production'
10
+
11
+ export default [
12
+ {
13
+ input: "./src/codemirror-editor.js",
14
+ inlineDynamicImports: true,
15
+ output: {
16
+ file: "./src/inputs/__generated/editor.js",
17
+ format: "esm",
18
+ strict: false
19
+ },
20
+ plugins: [
21
+ babel({
22
+ exclude: [
23
+ 'node_modules/**',
24
+ 'src/inputs/editor.js'
25
+ ],
26
+ babelHelpers: 'bundled'
27
+ }),
28
+ resolve(),
29
+ commonjs(),
30
+ isDev ? undefined : terser()
31
+ ].filter(f => f)
32
+ },
33
+ {
34
+ input: pkg.source,
35
+ output: [
36
+ { file: pkg.main, format: 'cjs' },
37
+ { file: pkg.module, format: 'esm' }
38
+ ],
39
+ plugins: [
40
+ external(),
41
+ babel({
42
+ exclude: [
43
+ 'node_modules/**',
44
+ 'src/inputs/__generated/editor.js'
45
+ ],
46
+ babelHelpers: 'bundled'
47
+ }),
48
+ del({ targets: ['dist/*'] }),
49
+ isDev ? undefined : terser()
50
+ ].filter(f => f),
51
+ external: Object.keys(pkg.peerDependencies || {})
52
+ }
53
+ ];