@panneau/core 3.0.14 → 3.0.16

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/lib/hooks.js CHANGED
@@ -199,6 +199,8 @@ var useForm = function useForm() {
199
199
  withoutPropagation = _opts$withoutPropagat === void 0 ? true : _opts$withoutPropagat,
200
200
  _opts$onComplete = opts.onComplete,
201
201
  onComplete = _opts$onComplete === void 0 ? null : _opts$onComplete,
202
+ _opts$onError = opts.onError,
203
+ onError = _opts$onError === void 0 ? null : _opts$onError,
202
204
  _opts$locales = opts.locales,
203
205
  locales = _opts$locales === void 0 ? [] : _opts$locales;
204
206
  var _useState = react.useState(initialValue || providedValue),
@@ -263,8 +265,6 @@ var useForm = function useForm() {
263
265
  onChange: onFieldChange
264
266
  }, locales);
265
267
  }, fieldsKey);
266
- // console.log('fk', fieldsKey);
267
-
268
268
  var csrfToken = react.useMemo(function () {
269
269
  return fetch.getCsrfToken();
270
270
  }, []);
@@ -282,6 +282,9 @@ var useForm = function useForm() {
282
282
  } else {
283
283
  setGeneralError(error.message);
284
284
  }
285
+ if (onError !== null) {
286
+ onError(error);
287
+ }
285
288
  };
286
289
  var onSubmitSuccess = function onSubmitSuccess(resp) {
287
290
  setRequestState({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@panneau/core",
3
- "version": "3.0.14",
3
+ "version": "3.0.16",
4
4
  "description": "",
5
5
  "keywords": [
6
6
  "javascript"
@@ -35,17 +35,27 @@
35
35
  "license": "ISC",
36
36
  "main": "lib/index.js",
37
37
  "module": "es/index.js",
38
+ "sideEffects": [
39
+ "./lib/hooks.js",
40
+ "./es/hooks.js"
41
+ ],
38
42
  "exports": {
39
- ".": "./lib/index.js",
40
- "./contexts": "./lib/contexts.js",
41
- "./hooks": "./lib/hooks.js",
42
- "./utils": "./lib/utils.js"
43
- },
44
- "browser": {
45
- ".": "./es/index.js",
46
- "./contexts": "./es/contexts.js",
47
- "./hooks": "./es/hooks.js",
48
- "./utils": "./es/utils.js"
43
+ ".": {
44
+ "require": "./lib/index.js",
45
+ "import": "./es/index.js"
46
+ },
47
+ "./contexts": {
48
+ "require": "./lib/contexts.js",
49
+ "import": "./es/contexts.js"
50
+ },
51
+ "./hooks": {
52
+ "require": "./lib/hooks.js",
53
+ "import": "./es/hooks.js"
54
+ },
55
+ "./utils": {
56
+ "require": "./lib/utils.js",
57
+ "import": "./es/utils.js"
58
+ }
49
59
  },
50
60
  "files": [
51
61
  "lib",
@@ -77,18 +87,6 @@
77
87
  "@fortawesome/fontawesome-svg-core": "^1.2.35",
78
88
  "@fortawesome/free-solid-svg-icons": "^5.15.3",
79
89
  "@fortawesome/react-fontawesome": "^0.1.14",
80
- "@uppy/core": "^3.2.0",
81
- "@uppy/dashboard": "^3.4.0",
82
- "@uppy/dropbox": "^3.1.1",
83
- "@uppy/facebook": "^3.1.1",
84
- "@uppy/google-drive": "^3.1.1",
85
- "@uppy/instagram": "^3.1.1",
86
- "@uppy/locales": "^3.2.0",
87
- "@uppy/react": "^3.1.2",
88
- "@uppy/transloadit": "^3.1.3",
89
- "@uppy/tus": "^3.1.0",
90
- "@uppy/webcam": "^3.3.1",
91
- "@uppy/xhr-upload": "^3.2.0",
92
90
  "bootstrap": "^5.3.0-alpha3",
93
91
  "change-case": "^4.1.2",
94
92
  "classnames": "^2.2.6",
@@ -114,5 +112,5 @@
114
112
  "publishConfig": {
115
113
  "access": "public"
116
114
  },
117
- "gitHead": "1af0f350c8f550f2e93d7f0eb1e7ec73d51afe2c"
115
+ "gitHead": "3dce3afaee50ef8d6f7fcf2dc72fda3fe9765072"
118
116
  }