@tinacms/react-core
Advanced tools
Comparing version 0.2.13 to 0.3.0
@@ -1,1 +0,1 @@ | ||
!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports,require("react"),require("@tinacms/forms")):"function"==typeof define&&define.amd?define(["exports","react","@tinacms/forms"],n):n((e=e||self)["@tinacms/react-core"]={},e.React,e.forms)}(this,function(e,a,u){"use strict";var n="useCMS could not find an instance of CMS",t=a.createContext(null);function r(){var e=a.useContext(t);if(!e)throw new Error(n);return e}var i=function(){return(i=Object.assign||function(e){for(var n,t=1,u=arguments.length;t<u;t++)for(var r in n=arguments[t])Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r]);return e}).apply(this,arguments)};var o=f;function f(e){var n,t=r();n=Array.isArray(e)?e:[e],a.useEffect(function(){return n.forEach(function(e){e&&t.plugins.add(e)}),function(){n.forEach(function(e){e&&t.plugins.remove(e)})}},function(){for(var e=0,n=0,t=arguments.length;n<t;n++)e+=arguments[n].length;var u=Array(e),r=0;for(n=0;n<t;n++)for(var i=arguments[n],o=0,f=i.length;o<f;o++,r++)u[r]=i[o];return u}([t.plugins],n))}function c(e,n){void 0===n&&(n={});var t=e.loadInitialValues,u=function(e,n){var t={};for(var u in e)Object.prototype.hasOwnProperty.call(e,u)&&n.indexOf(u)<0&&(t[u]=e[u]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(u=Object.getOwnPropertySymbols(e);r<u.length;r++)n.indexOf(u[r])<0&&Object.prototype.propertyIsEnumerable.call(e,u[r])&&(t[u[r]]=e[u[r]])}return t}(e,["loadInitialValues"]);u.initialValues=u.initialValues||n.values;var r=a.useState(u.initialValues)[1],i=a.useState(function(){return s(u,function(e){r(e.values)})}),o=i[0],f=i[1];return a.useEffect(function(){o.id!==u.id&&f(s(u,function(e){r(e.values)}))},[u.id]),a.useEffect(function(){t&&t().then(function(e){o.updateInitialValues(e)})},[o]),function(e,n){a.useEffect(function(){void 0!==n&&e.updateFields(n)},[e,n])}(o,n.fields),function(e,n){a.useEffect(function(){void 0!==n&&(e.label=n)},[e,n])}(o,n.label),function(e,n){a.useEffect(function(){void 0!==n&&e.updateValues(n)},[e,n])}(o,n.values),[o?o.values:u.initialValues,o]}function s(e,n){var t=new u.Form(e);return t.subscribe(n,{values:!0}),t}function l(n,t){return function(e){return o(t),a.createElement(n,i({},e))}}var v=l;e.CMSContext=t,e.ERROR_MISSING_CMS=n,e.useCMS=r,e.useForm=c,e.useLocalForm=function(e,n){void 0===n&&(n={});var t=c(e,n),u=t[0],r=t[1];return f(r),[u,r]},e.usePlugin=o,e.usePlugins=f,e.useSubscribable=function(e,n){var t=a.useState(0)[1];a.useEffect(function(){return e.subscribe(function(){t(function(e){return e+1}),n&&n()})})},e.useWatchFormValues=function(e,t){a.useEffect(function(){if(e){var n=!0;return e.subscribe(function(e){n?n=!1:t(e)},{values:!0})}},[t,e])},e.withPlugin=v,e.withPlugins=l,Object.defineProperty(e,"__esModule",{value:!0})}); | ||
!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports,require("react"),require("@tinacms/forms")):"function"==typeof define&&define.amd?define(["exports","react","@tinacms/forms"],n):n((e=e||self)["@tinacms/react-core"]={},e.React,e.forms)}(this,function(e,c,u){"use strict";var n="useCMS could not find an instance of CMS",t=c.createContext(null);function s(){var e=c.useContext(t);if(!e)throw new Error(n);return e}var r=function(){return(r=Object.assign||function(e){for(var n,t=1,u=arguments.length;t<u;t++)for(var r in n=arguments[t])Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r]);return e}).apply(this,arguments)};var i=o;function o(e){var n,t=s();n=Array.isArray(e)?e:[e],c.useEffect(function(){return n.forEach(function(e){e&&t.plugins.add(e)}),function(){n.forEach(function(e){e&&t.plugins.remove(e)})}},function(){for(var e=0,n=0,t=arguments.length;n<t;n++)e+=arguments[n].length;var u=Array(e),r=0;for(n=0;n<t;n++)for(var i=arguments[n],o=0,a=i.length;o<a;o++,r++)u[r]=i[o];return u}([t.plugins],n))}function a(e,n){void 0===n&&(n={});var t=e.loadInitialValues,u=function(e,n){var t={};for(var u in e)Object.prototype.hasOwnProperty.call(e,u)&&n.indexOf(u)<0&&(t[u]=e[u]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(u=Object.getOwnPropertySymbols(e);r<u.length;r++)n.indexOf(u[r])<0&&Object.prototype.propertyIsEnumerable.call(e,u[r])&&(t[u[r]]=e[u[r]])}return t}(e,["loadInitialValues"]),r=s();u.initialValues=u.initialValues||n.values;var i=c.useState(u.initialValues)[1],o=c.useState(function(){return l(u,function(e){i(e.values)})}),a=o[0],f=o[1];return c.useEffect(function(){a.id!==u.id&&f(l(u,function(e){i(e.values)}))},[u.id]),c.useEffect(function(){r.enabled&&t&&t().then(function(e){a.updateInitialValues(e)})},[a]),function(e,n){c.useEffect(function(){void 0!==n&&e.updateFields(n)},[e,n])}(a,n.fields),function(e,n){c.useEffect(function(){void 0!==n&&(e.label=n)},[e,n])}(a,n.label),function(e,n){c.useEffect(function(){void 0!==n&&e.updateValues(n)},[e,n])}(a,n.values),[a?a.values:u.initialValues,a]}function l(e,n){var t=new u.Form(e);return t.subscribe(n,{values:!0}),t}function f(n,t){return function(e){return i(t),c.createElement(n,r({},e))}}var v=f;e.CMSContext=t,e.ERROR_MISSING_CMS=n,e.useCMS=s,e.useForm=a,e.useLocalForm=function(e,n){void 0===n&&(n={});var t=a(e,n),u=t[0],r=t[1];return o(r),[u,r]},e.usePlugin=i,e.usePlugins=o,e.useSubscribable=function(e,n){var t=c.useState(0)[1];c.useEffect(function(){return e.subscribe(function(){t(function(e){return e+1}),n&&n()})})},e.useWatchFormValues=function(e,t){c.useEffect(function(){if(e){var n=!0;return e.subscribe(function(e){n?n=!1:t(e)},{values:!0})}},[t,e])},e.withPlugin=v,e.withPlugins=f,Object.defineProperty(e,"__esModule",{value:!0})}); |
@@ -6,2 +6,13 @@ # Change Log | ||
# [0.3.0](https://github.com/tinacms/tinacms/compare/@tinacms/react-core@0.2.13...@tinacms/react-core@0.3.0) (2020-06-08) | ||
### Features | ||
* **useForm:** only call loadInitialValues if cms.enabled ([e95f842](https://github.com/tinacms/tinacms/commit/e95f842)) | ||
## [0.2.13](https://github.com/tinacms/tinacms/compare/@tinacms/react-core@0.2.13-alpha.2...@tinacms/react-core@0.2.13) (2020-06-01) | ||
@@ -8,0 +19,0 @@ |
{ | ||
"name": "@tinacms/react-core", | ||
"version": "0.2.13", | ||
"version": "0.3.0", | ||
"license": "Apache-2.0", | ||
@@ -24,3 +24,3 @@ "main": "build/index.js", | ||
"@tinacms/core": "^0.9.0", | ||
"@tinacms/forms": "^0.5.0" | ||
"@tinacms/forms": "^0.6.0" | ||
}, | ||
@@ -33,3 +33,3 @@ "peerDependencies": { | ||
}, | ||
"gitHead": "7964eefc0f095f6b3b7b2277aebd9fe2fcdf0c8c" | ||
"gitHead": "e9a2ea1be257729fd7fb1babace966bc97d9ef25" | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
28119
+ Added@tinacms/forms@0.6.3(transitive)
- Removed@tinacms/forms@0.5.0(transitive)
Updated@tinacms/forms@^0.6.0