Socket
Socket
Sign inDemoInstall

@tinacms/core

Package Overview
Dependencies
Maintainers
12
Versions
101
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@tinacms/core - npm Package Compare versions

Comparing version 0.2.0 to 0.2.1-alpha.0

LICENSE

17

build/cms-forms/form-manager.d.ts

@@ -0,1 +1,18 @@

/**
Copyright 2019 Forestry.io Inc
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
import { Subscribable } from '../subscribable';

@@ -2,0 +19,0 @@ import { Form, FormOptions } from './form';

21

build/cms-forms/form.d.ts

@@ -0,1 +1,18 @@

/**
Copyright 2019 Forestry.io Inc
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
/// <reference types="react" />

@@ -21,3 +38,4 @@ import { FormApi, Config, Unsubscribe } from 'final-form';

initialValues: any;
constructor({ id, label, fields, actions, ...options }: FormOptions<S>);
reset?(): void;
constructor({ id, label, fields, actions, reset, ...options }: FormOptions<S>);
updateFields(fields: Field[]): void;

@@ -35,2 +53,3 @@ private discoverHiddenFields;

fields: Field[];
reset?(): void;
actions?: any[];

@@ -37,0 +56,0 @@ }

@@ -0,1 +1,18 @@

/**
Copyright 2019 Forestry.io Inc
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
export {};

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

/**
Copyright 2019 Forestry.io Inc
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
export * from './form-manager';
export * from './form';

@@ -0,1 +1,18 @@

/**
Copyright 2019 Forestry.io Inc
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
import { FormManager } from './cms-forms';

@@ -2,0 +19,0 @@ import { PluginManager } from './plugins';

@@ -0,1 +1,18 @@

/**
Copyright 2019 Forestry.io Inc
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
export * from './cms';

@@ -2,0 +19,0 @@ export * from './cms-forms/';

2

build/index.js

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

!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("final-form-arrays"),require("final-form")):"function"==typeof define&&define.amd?define(["exports","final-form-arrays","final-form"],e):e((t=t||self)["@tinacms/core"]={},t.arrayMutators,t.finalForm)}(this,function(t,a,l){"use strict";a=a&&a.hasOwnProperty("default")?a.default:a;var n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(t,e)};function e(t,e){function i(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}var c=function(){return(c=Object.assign||function(t){for(var e,i=1,n=arguments.length;i<n;i++)for(var r in e=arguments[i])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)};function f(i,n){var r,o,s,t,u={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]};return t={next:e(0),throw:e(1),return:e(2)},"function"==typeof Symbol&&(t[Symbol.iterator]=function(){return this}),t;function e(e){return function(t){return function(e){if(r)throw new TypeError("Generator is already executing.");for(;u;)try{if(r=1,o&&(s=2&e[0]?o.return:e[0]?o.throw||((s=o.return)&&s.call(o),0):o.next)&&!(s=s.call(o,e[1])).done)return s;switch(o=0,s&&(e=[2&e[0],s.value]),e[0]){case 0:case 1:s=e;break;case 4:return u.label++,{value:e[1],done:!1};case 5:u.label++,o=e[1],e=[0];continue;case 7:e=u.ops.pop(),u.trys.pop();continue;default:if(!(s=0<(s=u.trys).length&&s[s.length-1])&&(6===e[0]||2===e[0])){u=0;continue}if(3===e[0]&&(!s||e[1]>s[0]&&e[1]<s[3])){u.label=e[1];break}if(6===e[0]&&u.label<s[1]){u.label=s[1],s=e;break}if(s&&u.label<s[2]){u.label=s[2],u.ops.push(e);break}s[2]&&u.ops.pop(),u.trys.pop();continue}e=n.call(i,u)}catch(t){e=[6,t],o=0}finally{r=s=0}if(5&e[0])throw e[1];return{value:e[0]?e[1]:void 0,done:!0}}([e,t])}}}var i=(r.prototype.subscribe=function(t){var e=this;return this.__subscribers.push(t),function(){return e.unsubscribe(t)}},r.prototype.unsubscribe=function(t){var e=this.__subscribers.indexOf(t);this.__subscribers.splice(e,1)},r.prototype.notifiySubscribers=function(){this.__subscribers.forEach(function(t){return t()})},r);function r(){this.__subscribers=[]}var o=(s.prototype.updateFields=function(t){this.fields=t,this.registerFields(this.fields),this.discoverHiddenFields(this.initialValues),this.removeDeclaredFieldsFromHiddenLookup()},s.prototype.discoverHiddenFields=function(t,o){var s=this;Object.entries(t).map(function(t){var e=t[0],i=t[1],n=o?o+"."+e:e;if(Array.isArray(i))if(i.find(function(t){return"object"==typeof t})){var r=n+".INDEX";i.forEach(function(t){s.discoverHiddenFields(t,r)})}else s.hiddenFields[n]={path:n,field:{name:n,component:null},unsubscribe:s.finalForm.registerField(n,function(){},{})};else"object"==typeof i&&null!==i?s.discoverHiddenFields(i,n):s.hiddenFields[n]={path:n,field:{name:n,component:null},unsubscribe:s.finalForm.registerField(n,function(){},{})}})},s.prototype.removeDeclaredFieldsFromHiddenLookup=function(){var i=this;Object.keys(this.fieldSubscriptions).forEach(function(t){var e=i.hiddenFields[t];e&&(e.unsubscribe(),delete i.hiddenFields[t])})},s.prototype.registerFields=function(t,r){var o=this;t.forEach(function(t){var e=r?r+"."+t.name:t.name,i=["group"].includes(t.component);if(["group-list","blocks"].includes(t.component)){var n=t.fields||[];o.registerFields(n,e+".INDEX")}else i?(n=t.fields||[],o.registerFields(n,e)):o.fieldSubscriptions[e]={path:e,field:t,unsubscribe:o.finalForm.registerField(e,function(){},{})}})},Object.defineProperty(s.prototype,"values",{get:function(){return this.finalForm.getState().values},enumerable:!0,configurable:!0}),s);function s(t){var i=this,e=t.id,n=t.label,r=t.fields,o=t.actions,s=function(t,e){var i={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(i[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(n=Object.getOwnPropertySymbols(t);r<n.length;r++)e.indexOf(n[r])<0&&Object.prototype.propertyIsEnumerable.call(t,n[r])&&(i[n[r]]=t[n[r]])}return i}(t,["id","label","fields","actions"]);this.fieldSubscriptions={},this.hiddenFields={},this.subscribe=function(t,e){return i.finalForm.subscribe(t,e)},this.submit=function(){return i.finalForm.submit()};var u=s.initialValues||{};this.id=e,this.label=n,this.fields=r,this.finalForm=l.createForm(c({},s,{initialValues:u,onSubmit:function(i,n,r){return function(o,s,u,a){return new(u=u||Promise)(function(t,e){function i(t){try{r(a.next(t))}catch(t){e(t)}}function n(t){try{r(a.throw(t))}catch(t){e(t)}}function r(e){e.done?t(e.value):new u(function(t){t(e.value)}).then(i,n)}r((a=a.apply(o,s||[])).next())})}(this,void 0,void 0,function(){var e;return f(this,function(t){switch(t.label){case 0:return[4,s.onSubmit(i,n,r)];case 1:return e=t.sent(),n.initialize(i),[2,e]}})})},mutators:c({},a,s.mutators)})),this.actions=o||[],this.initialValues=u,this.updateFields(this.fields)}var u,p=(e(d,u=i),d.prototype.findForm=function(t){return this.__forms[t]},d.prototype.all=function(){var e=this;return Object.keys(this.__forms).map(function(t){return e.__forms[t]})},d);function d(){var i=null!==u&&u.apply(this,arguments)||this;return i.__forms={},i.createForm=function(t){var e=new o(t);return i.__forms[t.id]=e,i.notifiySubscribers(),e},i.removeForm=function(t){delete i.__forms[t],i.notifiySubscribers()},i}var h=(b.prototype.findOrCreateMap=function(t){return this.plugins[t]=this.plugins[t]||new m(t)},b.prototype.add=function(t){this.findOrCreateMap(t.__type).add(t)},b.prototype.remove=function(t){this.findOrCreateMap(t.__type).remove(t)},b.prototype.all=function(t){return this.findOrCreateMap(t).all()},b);function b(){this.plugins={}}var y,m=(e(_,y=i),_.prototype.add=function(t){var e=t;e.__type||(e.__type=this.__type),this.__plugins[e.name]=e,this.notifiySubscribers()},_.prototype.all=function(){var e=this;return Object.keys(this.__plugins).map(function(t){return e.__plugins[t]})},_.prototype.find=function(t){return this.__plugins[t]},_.prototype.remove=function(t){var e="string"==typeof t?t:t.name,i=this.__plugins[e];return delete this.__plugins[e],this.notifiySubscribers(),i},_);function _(t){var e=y.call(this)||this;return e.__type=t,e.__plugins={},e}var v=(g.prototype.registerApi=function(t,e){this.api[t]=e},g);function g(){this.api={},this.forms=new p,this.plugins=new h}t.CMS=v,t.Form=o,t.FormManager=p,t.PluginManager=h,t.PluginType=m,t.Subscribable=i,Object.defineProperty(t,"__esModule",{value:!0})});
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("final-form-arrays"),require("final-form")):"function"==typeof define&&define.amd?define(["exports","final-form-arrays","final-form"],e):e((t=t||self)["@tinacms/core"]={},t.arrayMutators,t.finalForm)}(this,function(t,l,c){"use strict";l=l&&l.hasOwnProperty("default")?l.default:l;var r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(t,e)};function e(t,e){function i(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}var f=function(){return(f=Object.assign||function(t){for(var e,i=1,r=arguments.length;i<r;i++)for(var n in e=arguments[i])Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t}).apply(this,arguments)};function p(i,r){var n,o,s,t,u={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]};return t={next:e(0),throw:e(1),return:e(2)},"function"==typeof Symbol&&(t[Symbol.iterator]=function(){return this}),t;function e(e){return function(t){return function(e){if(n)throw new TypeError("Generator is already executing.");for(;u;)try{if(n=1,o&&(s=2&e[0]?o.return:e[0]?o.throw||((s=o.return)&&s.call(o),0):o.next)&&!(s=s.call(o,e[1])).done)return s;switch(o=0,s&&(e=[2&e[0],s.value]),e[0]){case 0:case 1:s=e;break;case 4:return u.label++,{value:e[1],done:!1};case 5:u.label++,o=e[1],e=[0];continue;case 7:e=u.ops.pop(),u.trys.pop();continue;default:if(!(s=0<(s=u.trys).length&&s[s.length-1])&&(6===e[0]||2===e[0])){u=0;continue}if(3===e[0]&&(!s||e[1]>s[0]&&e[1]<s[3])){u.label=e[1];break}if(6===e[0]&&u.label<s[1]){u.label=s[1],s=e;break}if(s&&u.label<s[2]){u.label=s[2],u.ops.push(e);break}s[2]&&u.ops.pop(),u.trys.pop();continue}e=r.call(i,u)}catch(t){e=[6,t],o=0}finally{n=s=0}if(5&e[0])throw e[1];return{value:e[0]?e[1]:void 0,done:!0}}([e,t])}}}var i=(n.prototype.subscribe=function(t){var e=this;return this.__subscribers.push(t),function(){return e.unsubscribe(t)}},n.prototype.unsubscribe=function(t){var e=this.__subscribers.indexOf(t);this.__subscribers.splice(e,1)},n.prototype.notifiySubscribers=function(){this.__subscribers.forEach(function(t){return t()})},n);function n(){this.__subscribers=[]}var o=(s.prototype.updateFields=function(t){this.fields=t,this.registerFields(this.fields),this.discoverHiddenFields(this.initialValues),this.removeDeclaredFieldsFromHiddenLookup()},s.prototype.discoverHiddenFields=function(t,o){var s=this;Object.entries(t).map(function(t){var e=t[0],i=t[1],r=o?o+"."+e:e;if(Array.isArray(i))if(i.find(function(t){return"object"==typeof t})){var n=r+".INDEX";i.forEach(function(t){s.discoverHiddenFields(t,n)})}else s.hiddenFields[r]={path:r,field:{name:r,component:null},unsubscribe:s.finalForm.registerField(r,function(){},{})};else"object"==typeof i&&null!==i?s.discoverHiddenFields(i,r):s.hiddenFields[r]={path:r,field:{name:r,component:null},unsubscribe:s.finalForm.registerField(r,function(){},{})}})},s.prototype.removeDeclaredFieldsFromHiddenLookup=function(){var i=this;Object.keys(this.fieldSubscriptions).forEach(function(t){var e=i.hiddenFields[t];e&&(e.unsubscribe(),delete i.hiddenFields[t])})},s.prototype.registerFields=function(t,n){var o=this;t.forEach(function(t){var e=n?n+"."+t.name:t.name,i=["group"].includes(t.component);if(["group-list","blocks"].includes(t.component)){var r=t.fields||[];o.registerFields(r,e+".INDEX")}else i?(r=t.fields||[],o.registerFields(r,e)):o.fieldSubscriptions[e]={path:e,field:t,unsubscribe:o.finalForm.registerField(e,function(){},{})}})},Object.defineProperty(s.prototype,"values",{get:function(){return this.finalForm.getState().values},enumerable:!0,configurable:!0}),s);function s(t){var i=this,e=t.id,r=t.label,n=t.fields,o=t.actions,s=t.reset,u=function(t,e){var i={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(i[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(r=Object.getOwnPropertySymbols(t);n<r.length;n++)e.indexOf(r[n])<0&&Object.prototype.propertyIsEnumerable.call(t,r[n])&&(i[r[n]]=t[r[n]])}return i}(t,["id","label","fields","actions","reset"]);this.fieldSubscriptions={},this.hiddenFields={},this.subscribe=function(t,e){return i.finalForm.subscribe(t,e)},this.submit=function(){return i.finalForm.submit()};var a=u.initialValues||{};this.id=e,this.label=r,this.fields=n,this.finalForm=c.createForm(f({},u,{initialValues:a,onSubmit:function(i,r,n){return function(o,s,u,a){return new(u=u||Promise)(function(t,e){function i(t){try{n(a.next(t))}catch(t){e(t)}}function r(t){try{n(a.throw(t))}catch(t){e(t)}}function n(e){e.done?t(e.value):new u(function(t){t(e.value)}).then(i,r)}n((a=a.apply(o,s||[])).next())})}(this,void 0,void 0,function(){var e;return p(this,function(t){switch(t.label){case 0:return[4,u.onSubmit(i,r,n)];case 1:return e=t.sent(),r.initialize(i),[2,e]}})})},mutators:f({},l,u.mutators)})),this.reset=s,this.actions=o||[],this.initialValues=a,this.updateFields(this.fields)}var u,a=(e(d,u=i),d.prototype.findForm=function(t){return this.__forms[t]},d.prototype.all=function(){var e=this;return Object.keys(this.__forms).map(function(t){return e.__forms[t]})},d);function d(){var i=null!==u&&u.apply(this,arguments)||this;return i.__forms={},i.createForm=function(t){var e=new o(t);return i.__forms[t.id]=e,i.notifiySubscribers(),e},i.removeForm=function(t){delete i.__forms[t],i.notifiySubscribers()},i}var h=(b.prototype.findOrCreateMap=function(t){return this.plugins[t]=this.plugins[t]||new m(t)},b.prototype.add=function(t){this.findOrCreateMap(t.__type).add(t)},b.prototype.remove=function(t){this.findOrCreateMap(t.__type).remove(t)},b.prototype.all=function(t){return this.findOrCreateMap(t).all()},b);function b(){this.plugins={}}var y,m=(e(_,y=i),_.prototype.add=function(t){var e=t;e.__type||(e.__type=this.__type),this.__plugins[e.name]=e,this.notifiySubscribers()},_.prototype.all=function(){var e=this;return Object.keys(this.__plugins).map(function(t){return e.__plugins[t]})},_.prototype.find=function(t){return this.__plugins[t]},_.prototype.remove=function(t){var e="string"==typeof t?t:t.name,i=this.__plugins[e];return delete this.__plugins[e],this.notifiySubscribers(),i},_);function _(t){var e=y.call(this)||this;return e.__type=t,e.__plugins={},e}var v=(g.prototype.registerApi=function(t,e){this.api[t]=e},g);function g(){this.api={},this.forms=new a,this.plugins=new h}t.CMS=v,t.Form=o,t.FormManager=a,t.PluginManager=h,t.PluginType=m,t.Subscribable=i,Object.defineProperty(t,"__esModule",{value:!0})});

@@ -0,1 +1,18 @@

/**
Copyright 2019 Forestry.io Inc
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
import { Subscribable } from './subscribable';

@@ -2,0 +19,0 @@ export interface Plugin {

@@ -0,1 +1,18 @@

/**
Copyright 2019 Forestry.io Inc
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
export {};

@@ -0,1 +1,18 @@

/**
Copyright 2019 Forestry.io Inc
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
export declare type Unsubscribe = () => void;

@@ -2,0 +19,0 @@ export declare class Subscribable {

@@ -0,1 +1,18 @@

/**
Copyright 2019 Forestry.io Inc
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
export {};

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

## [0.2.1-alpha.0](https://github.com/tinacms/tinacms/compare/@tinacms/core@0.1.1...@tinacms/core@0.2.1-alpha.0) (2019-10-09)
**Note:** Version bump only for package @tinacms/core
# [0.2.0](https://github.com/tinacms/tinacms/compare/@tinacms/core@0.2.0-alpha.0...@tinacms/core@0.2.0) (2019-10-07)

@@ -8,0 +16,0 @@

{
"name": "@tinacms/core",
"version": "0.2.0",
"version": "0.2.1-alpha.0",
"main": "build/index.js",
"types": "build/index.d.ts",
"license": "MIT",
"license": "Apache-2.0",
"files": [

@@ -32,3 +32,3 @@ "build"

"@types/react": "^16.8.23",
"cms-scripts": "^0.1.2",
"cms-scripts": "^0.1.3-alpha.0",
"jest": "^24.8.0",

@@ -45,3 +45,3 @@ "react": "^16.8.6",

},
"gitHead": "8876287e5fa2323d6be35d736492f9d39e767345"
"gitHead": "762bc692cae2d49aadd1d37bc828fcfc65e0f37c"
}
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