@tinacms/react-core
Advanced tools
Comparing version 0.2.2-canary.5 to 0.2.2-canary.20
'use strict'; | ||
var React = require('react'); | ||
var core = require('@tinacms/core'); | ||
var forms = require('@tinacms/forms'); | ||
@@ -144,3 +144,3 @@ /** | ||
if (!options.initialValues) return; | ||
var form = new core.Form(options); | ||
var form = new forms.Form(options); | ||
setForm(form); | ||
@@ -147,0 +147,0 @@ var unsubscribe = form.subscribe(function (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 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; | ||
"use strict";var e=require("react"),n=require("@tinacms/forms"),t=e.createContext(null);function u(){var n=e.useContext(t);if(!n)throw new Error("useCMS could not find an instance of CMS");return n}var r=i;function i(n){var t,r=u();t=Array.isArray(n)?n:[n],e.useEffect((function(){return t.forEach((function(e){e&&r.plugins.add(e)})),function(){t.forEach((function(e){e&&r.plugins.remove(e)}))}}),[r.plugins].concat(t))}function s(e,n){void 0===n&&(n={});var t=c(e,n),u=t[0],r=t[1];return i(r),[u,r]}var o=s;function c(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 a(n,t){return function(u){return r(t),e.createElement(n,Object.assign({},u))}}var f=a;exports.CMSContext=t,exports.ERROR_MISSING_CMS="useCMS could not find an instance of CMS",exports.useCMS=u,exports.useCMSForm=o,exports.useForm=c,exports.useLocalForm=s,exports.usePlugin=r,exports.usePlugins=i,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; | ||
//# sourceMappingURL=react-core.cjs.production.min.js.map |
import { createContext, useContext, useEffect, useState, createElement } from 'react'; | ||
import { Form } from '@tinacms/core'; | ||
import { Form } from '@tinacms/forms'; | ||
@@ -4,0 +4,0 @@ /** |
@@ -18,3 +18,3 @@ /** | ||
*/ | ||
import { FormOptions, Form } from '@tinacms/core'; | ||
import { FormOptions, Form } from '@tinacms/forms'; | ||
export interface WatchableFormValue { | ||
@@ -21,0 +21,0 @@ values: any; |
@@ -18,3 +18,3 @@ /** | ||
*/ | ||
import { Form } from '@tinacms/core'; | ||
import { Form } from '@tinacms/forms'; | ||
import { FormSubscriber } from 'final-form'; | ||
@@ -21,0 +21,0 @@ /** |
{ | ||
"name": "@tinacms/react-core", | ||
"version": "0.2.2-canary.5+4e735b59", | ||
"version": "0.2.2-canary.20+afa41fe4", | ||
"license": "Apache-2.0", | ||
@@ -19,3 +19,4 @@ "main": "dist/index.js", | ||
"dependencies": { | ||
"@tinacms/core": "^0.5.2-canary.5+4e735b59", | ||
"@tinacms/core": "^0.5.2-canary.20+afa41fe4", | ||
"@tinacms/forms": "^0.0.1-canary.2232+afa41fe4", | ||
"lodash.get": "^4.4.2", | ||
@@ -33,3 +34,3 @@ "lodash.set": "^4.3.2" | ||
}, | ||
"gitHead": "4e735b5992149c27b4972992634f0d09b3cca829" | ||
"gitHead": "afa41fe4592e95ad2f525eced009c50f9cda3b38" | ||
} |
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
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
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the 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
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
77438
5
+ Added@babel/runtime@7.26.0(transitive)
+ Added@tinacms/forms@0.0.1-canary.2232(transitive)
+ Addedfinal-form@4.20.10(transitive)
+ Addedfinal-form-arrays@3.1.0(transitive)
+ Addedregenerator-runtime@0.14.1(transitive)