@panneau/core 2.0.56 → 2.0.69

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/es/contexts.js CHANGED
@@ -383,7 +383,9 @@ var font = PropTypes.shape({
383
383
  });
384
384
  PropTypes.arrayOf(font);
385
385
  PropTypes.shape({});
386
- var modal = PropTypes.shape({});
386
+ var modal = PropTypes.shape({
387
+ name: PropTypes.string
388
+ });
387
389
  PropTypes.arrayOf(modal);
388
390
 
389
391
  /* eslint-disable react/jsx-props-no-spreading */
package/es/hooks.js CHANGED
@@ -260,8 +260,11 @@ var useForm = function useForm() {
260
260
  }, [finalPostForm, action, value]);
261
261
  var onSubmit = useCallback(function (e) {
262
262
  e.preventDefault();
263
+ // This one is very important with multiple forms
264
+ // Nested forms (even in portals) will bubble the onSubmit event to the parent
265
+ e.stopPropagation();
263
266
  submit();
264
- }, [submit]);
267
+ }, [submit, action]);
265
268
  var status = null;
266
269
  if (requestState.loading) {
267
270
  status = 'loading';
package/es/index.js CHANGED
@@ -166,7 +166,9 @@ var font = PropTypes$1.shape({
166
166
  });
167
167
  var fonts = PropTypes$1.arrayOf(font);
168
168
  var trackingVariables = PropTypes$1.shape({});
169
- var modal = PropTypes$1.shape({});
169
+ var modal = PropTypes$1.shape({
170
+ name: PropTypes$1.string
171
+ });
170
172
  var modals = PropTypes$1.arrayOf(modal);
171
173
 
172
174
  var PropTypes = /*#__PURE__*/Object.freeze({
package/lib/contexts.js CHANGED
@@ -418,7 +418,9 @@ var font = PropTypes__default["default"].shape({
418
418
  });
419
419
  PropTypes__default["default"].arrayOf(font);
420
420
  PropTypes__default["default"].shape({});
421
- var modal = PropTypes__default["default"].shape({});
421
+ var modal = PropTypes__default["default"].shape({
422
+ name: PropTypes__default["default"].string
423
+ });
422
424
  PropTypes__default["default"].arrayOf(modal);
423
425
 
424
426
  /* eslint-disable react/jsx-props-no-spreading */
package/lib/hooks.js CHANGED
@@ -295,8 +295,11 @@ var useForm = function useForm() {
295
295
  }, [finalPostForm, action, value]);
296
296
  var onSubmit = react.useCallback(function (e) {
297
297
  e.preventDefault();
298
+ // This one is very important with multiple forms
299
+ // Nested forms (even in portals) will bubble the onSubmit event to the parent
300
+ e.stopPropagation();
298
301
  submit();
299
- }, [submit]);
302
+ }, [submit, action]);
300
303
  var status = null;
301
304
  if (requestState.loading) {
302
305
  status = 'loading';
package/lib/index.js CHANGED
@@ -188,7 +188,9 @@ var font = PropTypes__default["default"].shape({
188
188
  });
189
189
  var fonts = PropTypes__default["default"].arrayOf(font);
190
190
  var trackingVariables = PropTypes__default["default"].shape({});
191
- var modal = PropTypes__default["default"].shape({});
191
+ var modal = PropTypes__default["default"].shape({
192
+ name: PropTypes__default["default"].string
193
+ });
192
194
  var modals = PropTypes__default["default"].arrayOf(modal);
193
195
 
194
196
  var PropTypes = /*#__PURE__*/Object.freeze({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@panneau/core",
3
- "version": "2.0.56",
3
+ "version": "2.0.69",
4
4
  "description": "",
5
5
  "keywords": [
6
6
  "javascript"
@@ -114,5 +114,5 @@
114
114
  "publishConfig": {
115
115
  "access": "public"
116
116
  },
117
- "gitHead": "edb76a5622f04136db62c1dd0c4b2e362de6878a"
117
+ "gitHead": "270c1e84966861e94a390d20ee525c33f7edadb0"
118
118
  }