Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@tinacms/react-core

Package Overview
Dependencies
Maintainers
13
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.31.0 to 0.32.0-alpha.1

build/use-cms-event.d.ts

1

build/index.d.ts

@@ -23,2 +23,3 @@ /**

export * from './use-watch-form-values';
export * from './use-cms-event';
export * from './with-plugin';

2

build/index.js

@@ -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"
}
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