Socket
Socket
Sign inDemoInstall

@tinacms/react-core

Package Overview
Dependencies
Maintainers
10
Versions
88
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@tinacms/react-core - npm Package Compare versions

Comparing version 0.2.1-alpha.0 to 0.2.1-alpha.1

11

CHANGELOG.md

@@ -6,2 +6,13 @@ # Change Log

## [0.2.1-alpha.1](https://github.com/tinacms/tinacms/compare/@tinacms/react-core@0.2.1-alpha.0...@tinacms/react-core@0.2.1-alpha.1) (2019-12-17)
### Bug Fixes
* **useForm:** allow forms in production ([c4bfebd](https://github.com/tinacms/tinacms/commit/c4bfebd))
## [0.2.1-alpha.0](https://github.com/tinacms/tinacms/compare/@tinacms/react-core@0.2.0...@tinacms/react-core@0.2.1-alpha.0) (2019-12-06)

@@ -8,0 +19,0 @@

4

dist/react-core.cjs.development.js

@@ -113,11 +113,7 @@ 'use strict';

}
/* eslint-disable-next-line react-hooks/rules-of-hooks */
var _useForm = useForm(options, watch),
values = _useForm[0],
form = _useForm[1];
/* eslint-disable-next-line react-hooks/rules-of-hooks */
usePlugins(form);

@@ -124,0 +120,0 @@ return [values, form];

@@ -1,2 +0,2 @@

"use strict";var e=require("react"),n=require("@tinacms/core"),t="useCMS could not find an instance of CMS",u=e.createContext(null);function i(){var n=e.useContext(u);if(!n)throw new Error(t);return n}var r=s;function s(n){var t,u=i();t=Array.isArray(n)?n:[n],e.useEffect((function(){return t.forEach((function(e){e&&u.plugins.add(e)})),function(){t.forEach((function(e){e&&u.plugins.remove(e)}))}}),[u.plugins].concat(t))}function o(e,n){return void 0===n&&(n={}),[e.initialValues,void 0]}var c=o;function a(n,t){return function(u){return r(t),e.createElement(n,Object.assign({},u))}}var f=a;exports.CMSContext=u,exports.ERROR_MISSING_CMS=t,exports.useCMS=i,exports.useCMSForm=c,exports.useForm=function(t,u){void 0===u&&(u={});var i=e.useState(),r=i[0],s=i[1],o=e.useState(t.initialValues)[1];return e.useEffect((function(){if(t.initialValues){var e=new n.Form(t);s(e);var u=e.subscribe((function(e){o(e.values)}),{values:!0});return function(){u()}}}),[t.id,!!t.initialValues]),function(n,t){e.useEffect((function(){t&&void 0!==n&&t.updateFields(n)}),[t,n])}(u.fields,r),function(n,t){e.useEffect((function(){t&&void 0!==n&&(t.label=n)}),[t,n])}(u.label,r),function(n,t){e.useEffect((function(){t&&void 0!==n&&t.updateValues(n)}),[t,n])}(u.values,r),[r?r.values:t.initialValues,r]},exports.useLocalForm=o,exports.usePlugin=r,exports.usePlugins=s,exports.useSubscribable=function(n,t){var u=e.useState(0)[1];e.useEffect((function(){return n.subscribe((function(){u((function(e){return e+1})),t&&t()}))}))},exports.useWatchFormValues=function(n,t){e.useEffect((function(){if(n){var e=!0;return n.subscribe((function(n){e?e=!1:t(n)}),{values:!0})}}),[t,n])},exports.withPlugin=f,exports.withPlugins=a;
"use strict";var e=require("react"),n=require("@tinacms/core"),t="useCMS could not find an instance of CMS",u=e.createContext(null);function r(){var n=e.useContext(u);if(!n)throw new Error(t);return n}var i=s;function s(n){var t,u=r();t=Array.isArray(n)?n:[n],e.useEffect((function(){return t.forEach((function(e){e&&u.plugins.add(e)})),function(){t.forEach((function(e){e&&u.plugins.remove(e)}))}}),[u.plugins].concat(t))}function o(e,n){void 0===n&&(n={});var t=a(e,n),u=t[0],r=t[1];return s(r),[u,r]}var c=o;function a(t,u){void 0===u&&(u={});var r=e.useState(),i=r[0],s=r[1],o=e.useState(t.initialValues)[1];return e.useEffect((function(){if(t.initialValues){var e=new n.Form(t);s(e);var u=e.subscribe((function(e){o(e.values)}),{values:!0});return function(){u()}}}),[t.id,!!t.initialValues]),function(n,t){e.useEffect((function(){t&&void 0!==n&&t.updateFields(n)}),[t,n])}(u.fields,i),function(n,t){e.useEffect((function(){t&&void 0!==n&&(t.label=n)}),[t,n])}(u.label,i),function(n,t){e.useEffect((function(){t&&void 0!==n&&t.updateValues(n)}),[t,n])}(u.values,i),[i?i.values:t.initialValues,i]}function f(n,t){return function(u){return i(t),e.createElement(n,Object.assign({},u))}}var l=f;exports.CMSContext=u,exports.ERROR_MISSING_CMS=t,exports.useCMS=r,exports.useCMSForm=c,exports.useForm=a,exports.useLocalForm=o,exports.usePlugin=i,exports.usePlugins=s,exports.useSubscribable=function(n,t){var u=e.useState(0)[1];e.useEffect((function(){return n.subscribe((function(){u((function(e){return e+1})),t&&t()}))}))},exports.useWatchFormValues=function(n,t){e.useEffect((function(){if(n){var e=!0;return n.subscribe((function(n){e?e=!1:t(n)}),{values:!0})}}),[t,n])},exports.withPlugin=l,exports.withPlugins=f;
//# sourceMappingURL=react-core.cjs.production.min.js.map

@@ -112,20 +112,6 @@ import { createContext, useContext, useEffect, useState, createElement } from 'react';

/**
* We're returning early here which means all the hooks called by this hook
* violate the rules of hooks. In the case of the check for
* `NODE_ENV === 'production'` this should be a non-issue because NODE_ENV
* will never change at runtime.
*/
if (process.env.NODE_ENV === 'production') {
return [options.initialValues, undefined];
}
/* eslint-disable-next-line react-hooks/rules-of-hooks */
var _useForm = useForm(options, watch),
values = _useForm[0],
form = _useForm[1];
/* eslint-disable-next-line react-hooks/rules-of-hooks */
usePlugins(form);

@@ -132,0 +118,0 @@ return [values, form];

{
"name": "@tinacms/react-core",
"version": "0.2.1-alpha.0",
"version": "0.2.1-alpha.1",
"license": "Apache-2.0",

@@ -19,3 +19,3 @@ "main": "dist/index.js",

"dependencies": {
"@tinacms/core": "^0.5.0",
"@tinacms/core": "^0.5.1-alpha.0",
"lodash.get": "^4.4.2",

@@ -33,3 +33,3 @@ "lodash.set": "^4.3.2"

},
"gitHead": "560379e2b51ee388de083d30a93f153475cb0e9a"
"gitHead": "60682282231033b9871b6182eb1e08bef95e6ebb"
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc