@tinacms/react-core
Advanced tools
Comparing version 0.31.0 to 0.32.0-alpha.1
@@ -23,2 +23,3 @@ /** | ||
export * from './use-watch-form-values'; | ||
export * from './use-cms-event'; | ||
export * from './with-plugin'; |
@@ -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 t="useCMS could not find an instance of CMS",r=a.createContext(null);function i(){var e=a.useContext(r);if(!e)throw new Error(t);var n=a.useState(e.enabled)[1];return a.useEffect(function(){return e.events.subscribe("cms",function(){n(e.enabled)})},[e]),e}var o=function(){return(o=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 f=c;function c(e){var n,t=i();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 s(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 l(u,function(e){r(e.values)})}),o=i[0],f=i[1];return a.useEffect(function(){o.id!==u.id&&f(l(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 l(e,n){var t=new u.Form(e);return t.subscribe(n,{values:!0}),t}function n(n,t){return function(e){return f(t),a.createElement(n,o({},e))}}var v=n;e.CMSContext=r,e.ERROR_MISSING_CMS=t,e.useCMS=i,e.useForm=s,e.useLocalForm=function(e,n){void 0===n&&(n={});var t=s(e,n),u=t[0],r=t[1];return c(r),[u,r]},e.usePlugin=f,e.usePlugins=c,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=n,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,a,u){"use strict";var t="useCMS could not find an instance of CMS",r=a.createContext(null);function i(){var e=a.useContext(r);if(!e)throw new Error(t);var n=a.useState(e.enabled)[1];return a.useEffect(function(){return e.events.subscribe("cms",function(){n(e.enabled)})},[e]),e}var o=function(){return(o=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 f=c;function c(e){var n,t=i();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 s(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 l(u,function(e){r(e.values)})}),o=i[0],f=i[1];return a.useEffect(function(){o.id!==u.id&&f(l(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 l(e,n){var t=new u.Form(e);return t.subscribe(n,{values:!0}),t}function n(n,t){return function(e){return f(t),a.createElement(n,o({},e))}}var v=n;e.CMSContext=r,e.ERROR_MISSING_CMS=t,e.useCMS=i,e.useCMSEvent=function(e,n,t){var u=i();a.useEffect(function(){return u.events.subscribe(e,n)},t)},e.useForm=s,e.useLocalForm=function(e,n){void 0===n&&(n={});var t=s(e,n),u=t[0],r=t[1];return c(r),[u,r]},e.usePlugin=f,e.usePlugins=c,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=n,Object.defineProperty(e,"__esModule",{value:!0})}); |
{ | ||
"name": "@tinacms/react-core", | ||
"version": "0.31.0", | ||
"version": "0.32.0-alpha.1", | ||
"license": "Apache-2.0", | ||
@@ -23,4 +23,4 @@ "main": "build/index.js", | ||
"dependencies": { | ||
"@tinacms/core": "^0.31.0", | ||
"@tinacms/forms": "^0.31.0" | ||
"@tinacms/core": "^0.32.0-alpha.1", | ||
"@tinacms/forms": "^0.32.0-alpha.1" | ||
}, | ||
@@ -33,3 +33,3 @@ "peerDependencies": { | ||
}, | ||
"gitHead": "2558ba5738062fbe74edae68b8d585310862210b" | ||
"gitHead": "122600a3019205fa3c0dd16ed5f92eb19f867347" | ||
} |
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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
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
31134
13
183
1
+ Added@tinacms/core@0.32.0(transitive)
+ Added@tinacms/forms@0.32.0(transitive)
+ Addedfinal-form@4.19.1(transitive)
- Removed@tinacms/core@0.31.0(transitive)
- Removed@tinacms/forms@0.31.0(transitive)