Socket
Socket
Sign inDemoInstall

@tinacms/core

Package Overview
Dependencies
Maintainers
11
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.42.1 to 0.43.0-alpha.1

2

build/index.js

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

!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e=e||self)["@tinacms/core"]={})}(this,function(e){"use strict";var t=(n.prototype.getType=function(e){return this.plugins[e]=this.plugins[e]||new i(e,this.events)},n.prototype.findOrCreateMap=function(e){return this.getType(e)},n.prototype.add=function(e){this.findOrCreateMap(e.__type).add(e)},n.prototype.remove=function(e){this.findOrCreateMap(e.__type).remove(e)},n.prototype.all=function(e){return this.findOrCreateMap(e).all()},n);function n(e){this.events=e,this.plugins={}}var i=(r.prototype.add=function(e){var t=e;t.__type||(t.__type=this.__type),this.__plugins[t.name]=t,this.events.dispatch({type:"plugin:add:"+this.__type})},r.prototype.all=function(){var t=this;return Object.keys(this.__plugins).map(function(e){return t.__plugins[e]})},r.prototype.find=function(e){return this.__plugins[e]},r.prototype.remove=function(e){var t="string"==typeof e?e:e.name,n=this.__plugins[t];return delete this.__plugins[t],this.events.dispatch({type:"plugin:remove:"+this.__type}),n},r.prototype.subscribe=function(e){return this.events.subscribe("plugin:*:"+this.__type,e)},r);function r(e,t){this.__type=e,this.events=t,this.__plugins={}}var s=function(){var i=this;this.listeners=new Set,this.subscribe=function(e,t){var n=("string"==typeof e?[e]:e).map(function(e){return new o(e,t)});return n.forEach(function(e){return i.listeners.add(e)}),function(){n.forEach(function(e){return i.listeners.delete(e)})}},this.dispatch=function(t){Array.from(i.listeners.values()).forEach(function(e){return e.handleEvent(t)})}},o=(u.prototype.handleEvent=function(e){return!!this.watchesEvent(e)&&(this.callback(e),!0)},u.prototype.watchesEvent=function(e){if("*"===this.eventPattern)return!0;for(var t=e.type.split(":"),n=this.eventPattern.split(":"),i=0,r=!1;!r&&i<n.length;){var s="*"===n[i],o=n[i]===t[i];r=!(s||o),i++}return!r},u);function u(e,t){this.eventPattern=e,this.callback=t}var a=function(){return(a=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}).apply(this,arguments)};function c(s,o,u,a){return new(u=u||Promise)(function(e,t){function n(e){try{r(a.next(e))}catch(e){t(e)}}function i(e){try{r(a.throw(e))}catch(e){t(e)}}function r(t){t.done?e(t.value):new u(function(e){e(t.value)}).then(n,i)}r((a=a.apply(s,o||[])).next())})}function p(n,i){var r,s,o,e,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return e={next:t(0),throw:t(1),return:t(2)},"function"==typeof Symbol&&(e[Symbol.iterator]=function(){return this}),e;function t(t){return function(e){return function(t){if(r)throw new TypeError("Generator is already executing.");for(;u;)try{if(r=1,s&&(o=2&t[0]?s.return:t[0]?s.throw||((o=s.return)&&o.call(s),0):s.next)&&!(o=o.call(s,t[1])).done)return o;switch(s=0,o&&(t=[2&t[0],o.value]),t[0]){case 0:case 1:o=t;break;case 4:return u.label++,{value:t[1],done:!1};case 5:u.label++,s=t[1],t=[0];continue;case 7:t=u.ops.pop(),u.trys.pop();continue;default:if(!(o=0<(o=u.trys).length&&o[o.length-1])&&(6===t[0]||2===t[0])){u=0;continue}if(3===t[0]&&(!o||t[1]>o[0]&&t[1]<o[3])){u.label=t[1];break}if(6===t[0]&&u.label<o[1]){u.label=o[1],o=t;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(t);break}o[2]&&u.ops.pop(),u.trys.pop();continue}t=i.call(n,u)}catch(e){t=[6,e],s=0}finally{r=o=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}([t,e])}}}var h=(f.prototype.persist=function(t){return c(this,void 0,void 0,function(){return p(this,function(e){return[2,t.map(function(e){var t=e.directory,n=e.file;return{id:n.name,type:"file",directory:t,filename:n.name}})]})})},f.prototype.previewSrc=function(t){return c(this,void 0,void 0,function(){return p(this,function(e){return[2,t]})})},f.prototype.list=function(){return c(this,void 0,void 0,function(){return p(this,function(e){return[2,{items:[],nextOffset:0}]})})},f.prototype.delete=function(){return c(this,void 0,void 0,function(){return p(this,function(e){return[2]})})},f);function f(){this.accept="*"}var l=(Object.defineProperty(d.prototype,"isConfigured",{get:function(){return!(this.store instanceof h)},enumerable:!0,configurable:!0}),Object.defineProperty(d.prototype,"pageSize",{get:function(){return this._pageSize},set:function(e){this._pageSize=e,this.events.dispatch({type:"media:pageSize",pageSize:e})},enumerable:!0,configurable:!0}),d.prototype.open=function(e){void 0===e&&(e={}),this.events.dispatch(a({type:"media:open"},e))},Object.defineProperty(d.prototype,"accept",{get:function(){return this.store.accept},enumerable:!0,configurable:!0}),d.prototype.persist=function(i){return c(this,void 0,void 0,function(){var t,n;return p(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),this.events.dispatch({type:"media:upload:start",uploaded:i}),[4,this.store.persist(i)];case 1:return t=e.sent(),this.events.dispatch({type:"media:upload:success",uploaded:i,media:t}),[2,t];case 2:throw n=e.sent(),this.events.dispatch({type:"media:upload:failure",uploaded:i,error:n}),n;case 3:return[2]}})})},d.prototype.delete=function(n){return c(this,void 0,void 0,function(){var t;return p(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),this.events.dispatch({type:"media:delete:start",media:n}),[4,this.store.delete(n)];case 1:return e.sent(),this.events.dispatch({type:"media:delete:success",media:n}),[3,3];case 2:throw t=e.sent(),this.events.dispatch({type:"media:delete:failure",media:n,error:t}),t;case 3:return[2]}})})},d.prototype.list=function(i){return c(this,void 0,void 0,function(){var t,n;return p(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),this.events.dispatch(a({type:"media:list:start"},i)),[4,this.store.list(i)];case 1:return t=e.sent(),this.events.dispatch(a(a({type:"media:list:success"},i),{media:t})),[2,t];case 2:throw n=e.sent(),this.events.dispatch(a(a({type:"media:list:failure"},i),{error:n})),n;case 3:return[2]}})})},d);function d(e,t){var n=this;this.store=e,this.events=t,this._pageSize=20,this.previewSrc=function(i,r,s){return void 0===r&&(r=""),void 0===s&&(s={}),c(n,void 0,void 0,function(){var t,n;return p(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),this.events.dispatch({type:"media:preview:start",src:i,fieldName:r,formValues:s}),[4,this.store.previewSrc(i,r,s)];case 1:return t=e.sent(),this.events.dispatch({type:"media:preview:success",src:i,url:t,fieldName:r,formValues:s}),[2,t];case 2:throw n=e.sent(),this.events.dispatch({type:"media:preview:failure",src:i,error:n,fieldName:r,formValues:s}),n;case 3:return[2]}})})}}var v=(y.prototype.registerApi=function(e,t){this.unsubscribeHooks[e]&&this.unsubscribeHooks[e](),t.events instanceof s&&(this.unsubscribeHooks[e]=t.events.subscribe("*",this.events.dispatch)),this.api[e]=t},Object.defineProperty(y.prototype,"enabled",{get:function(){return this._enabled},enumerable:!0,configurable:!0}),Object.defineProperty(y.prototype,"disabled",{get:function(){return!this._enabled},enumerable:!0,configurable:!0}),y.ENABLED={type:"cms:enable"},y.DISABLED={type:"cms:disable"},y);function y(e){var i=this;void 0===e&&(e={}),this._enabled=!1,this.api={},this.unsubscribeHooks={},this.events=new s,this.media=new l(new h,this.events),this.enable=function(){i._enabled=!0,i.events.dispatch(y.ENABLED)},this.disable=function(){i._enabled=!1,i.events.dispatch(y.DISABLED)},this.toggle=function(){i.enabled?i.disable():i.enable()},this.plugins=new t(this.events),e.media&&(this.media.store=e.media),e.mediaOptions&&e.mediaOptions.pageSize&&(this.media.pageSize=e.mediaOptions.pageSize),e.plugins&&e.plugins.forEach(function(e){return i.plugins.add(e)}),e.apis&&Object.entries(e.apis).forEach(function(e){var t=e[0],n=e[1];return i.registerApi(t,n)}),e.enabled&&this.enable()}var b=(m.prototype.subscribe=function(e){var t=this;return this.__subscribers.push(e),function(){return t.unsubscribe(e)}},m.prototype.unsubscribe=function(e){var t=this.__subscribers.indexOf(e);this.__subscribers.splice(t,1)},m.prototype.notifiySubscribers=function(){this.__subscribers.forEach(function(e){return e()})},m);function m(){this.__subscribers=[]}e.CMS=v,e.EventBus=s,e.Listener=o,e.MediaManager=l,e.PluginType=i,e.PluginTypeManager=t,e.Subscribable=b,Object.defineProperty(e,"__esModule",{value:!0})});
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e=e||self)["@tinacms/core"]={})}(this,function(e){"use strict";var t=(n.prototype.getType=function(e){return this.plugins[e]=this.plugins[e]||new i(e,this.events)},n.prototype.findOrCreateMap=function(e){return this.getType(e)},n.prototype.add=function(e){this.findOrCreateMap(e.__type).add(e)},n.prototype.remove=function(e){this.findOrCreateMap(e.__type).remove(e)},n.prototype.all=function(e){return this.findOrCreateMap(e).all()},n);function n(e){this.events=e,this.plugins={}}var i=(r.prototype.add=function(e){var t=e;t.__type||(t.__type=this.__type),this.__plugins[t.name]=t,this.events.dispatch({type:"plugin:add:"+this.__type})},r.prototype.all=function(){var t=this;return Object.keys(this.__plugins).map(function(e){return t.__plugins[e]})},r.prototype.find=function(e){return this.__plugins[e]},r.prototype.remove=function(e){var t="string"==typeof e?e:e.name,n=this.__plugins[t];return delete this.__plugins[t],this.events.dispatch({type:"plugin:remove:"+this.__type}),n},r.prototype.subscribe=function(e){return this.events.subscribe("plugin:*:"+this.__type,e)},r);function r(e,t){this.__type=e,this.events=t,this.__plugins={}}var s=function(){var i=this;this.listeners=new Set,this.subscribe=function(e,t){var n=("string"==typeof e?[e]:e).map(function(e){return new o(e,t)});return n.forEach(function(e){return i.listeners.add(e)}),function(){n.forEach(function(e){return i.listeners.delete(e)})}},this.dispatch=function(t){Array.from(i.listeners.values()).forEach(function(e){return e.handleEvent(t)})}},o=(u.prototype.handleEvent=function(e){return!!this.watchesEvent(e)&&(this.callback(e),!0)},u.prototype.watchesEvent=function(e){if("*"===this.eventPattern)return!0;for(var t=e.type.split(":"),n=this.eventPattern.split(":"),i=0,r=!1;!r&&i<n.length;){var s="*"===n[i],o=n[i]===t[i];r=!(s||o),i++}return!r},u);function u(e,t){this.eventPattern=e,this.callback=t}var a=function(e,t){return(a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)};var c=function(){return(c=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}).apply(this,arguments)};function p(s,o,u,a){return new(u=u||Promise)(function(e,t){function n(e){try{r(a.next(e))}catch(e){t(e)}}function i(e){try{r(a.throw(e))}catch(e){t(e)}}function r(t){t.done?e(t.value):new u(function(e){e(t.value)}).then(n,i)}r((a=a.apply(s,o||[])).next())})}function h(n,i){var r,s,o,e,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return e={next:t(0),throw:t(1),return:t(2)},"function"==typeof Symbol&&(e[Symbol.iterator]=function(){return this}),e;function t(t){return function(e){return function(t){if(r)throw new TypeError("Generator is already executing.");for(;u;)try{if(r=1,s&&(o=2&t[0]?s.return:t[0]?s.throw||((o=s.return)&&o.call(s),0):s.next)&&!(o=o.call(s,t[1])).done)return o;switch(s=0,o&&(t=[2&t[0],o.value]),t[0]){case 0:case 1:o=t;break;case 4:return u.label++,{value:t[1],done:!1};case 5:u.label++,s=t[1],t=[0];continue;case 7:t=u.ops.pop(),u.trys.pop();continue;default:if(!(o=0<(o=u.trys).length&&o[o.length-1])&&(6===t[0]||2===t[0])){u=0;continue}if(3===t[0]&&(!o||t[1]>o[0]&&t[1]<o[3])){u.label=t[1];break}if(6===t[0]&&u.label<o[1]){u.label=o[1],o=t;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(t);break}o[2]&&u.ops.pop(),u.trys.pop();continue}t=i.call(n,u)}catch(e){t=[6,e],s=0}finally{r=o=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}([t,e])}}}var f=(l.prototype.persist=function(t){return p(this,void 0,void 0,function(){return h(this,function(e){return[2,t.map(function(e){var t=e.directory,n=e.file;return{id:n.name,type:"file",directory:t,filename:n.name}})]})})},l.prototype.previewSrc=function(t){return p(this,void 0,void 0,function(){return h(this,function(e){return[2,t]})})},l.prototype.list=function(){return p(this,void 0,void 0,function(){return h(this,function(e){return[2,{items:[],nextOffset:0}]})})},l.prototype.delete=function(){return p(this,void 0,void 0,function(){return h(this,function(e){return[2]})})},l);function l(){this.accept="*"}var d=(Object.defineProperty(v.prototype,"isConfigured",{get:function(){return!(this.store instanceof f)},enumerable:!0,configurable:!0}),Object.defineProperty(v.prototype,"pageSize",{get:function(){return this._pageSize},set:function(e){this._pageSize=e,this.events.dispatch({type:"media:pageSize",pageSize:e})},enumerable:!0,configurable:!0}),v.prototype.open=function(e){void 0===e&&(e={}),this.events.dispatch(c({type:"media:open"},e))},Object.defineProperty(v.prototype,"accept",{get:function(){return this.store.accept},enumerable:!0,configurable:!0}),v.prototype.persist=function(i){return p(this,void 0,void 0,function(){var t,n;return h(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),this.events.dispatch({type:"media:upload:start",uploaded:i}),[4,this.store.persist(i)];case 1:return t=e.sent(),this.events.dispatch({type:"media:upload:success",uploaded:i,media:t}),[2,t];case 2:throw n=e.sent(),this.events.dispatch({type:"media:upload:failure",uploaded:i,error:n}),n;case 3:return[2]}})})},v.prototype.delete=function(n){return p(this,void 0,void 0,function(){var t;return h(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),this.events.dispatch({type:"media:delete:start",media:n}),[4,this.store.delete(n)];case 1:return e.sent(),this.events.dispatch({type:"media:delete:success",media:n}),[3,3];case 2:throw t=e.sent(),this.events.dispatch({type:"media:delete:failure",media:n,error:t}),t;case 3:return[2]}})})},v.prototype.list=function(i){return p(this,void 0,void 0,function(){var t,n;return h(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),this.events.dispatch(c({type:"media:list:start"},i)),[4,this.store.list(i)];case 1:return t=e.sent(),this.events.dispatch(c(c({type:"media:list:success"},i),{media:t})),[2,t];case 2:throw n=e.sent(),this.events.dispatch(c(c({type:"media:list:failure"},i),{error:n})),n;case 3:return[2]}})})},v);function v(e,t){var n=this;this.store=e,this.events=t,this._pageSize=20,this.previewSrc=function(i,r,s){return void 0===r&&(r=""),void 0===s&&(s={}),p(n,void 0,void 0,function(){var t,n;return h(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),this.events.dispatch({type:"media:preview:start",src:i,fieldName:r,formValues:s}),[4,this.store.previewSrc(i,r,s)];case 1:return t=e.sent(),this.events.dispatch({type:"media:preview:success",src:i,url:t,fieldName:r,formValues:s}),[2,t];case 2:throw n=e.sent(),this.events.dispatch({type:"media:preview:failure",src:i,error:n,fieldName:r,formValues:s}),n;case 3:return[2]}})})}}var y,b,m,_=(m=Error,a(y=w,b=m),void(y.prototype=null===b?Object.create(b):(g.prototype=b.prototype,new g)),w);function g(){this.constructor=y}function w(e){var t=m.call(this,e.message)||this;return t.ERR_TYPE="MediaListError",t.title=e.title,t.docsLink=e.docsLink,t}var O=(E.prototype.registerApi=function(e,t){this.unsubscribeHooks[e]&&this.unsubscribeHooks[e](),t.events instanceof s&&(this.unsubscribeHooks[e]=t.events.subscribe("*",this.events.dispatch)),this.api[e]=t},Object.defineProperty(E.prototype,"enabled",{get:function(){return this._enabled},enumerable:!0,configurable:!0}),Object.defineProperty(E.prototype,"disabled",{get:function(){return!this._enabled},enumerable:!0,configurable:!0}),E.ENABLED={type:"cms:enable"},E.DISABLED={type:"cms:disable"},E);function E(e){var i=this;void 0===e&&(e={}),this._enabled=!1,this.api={},this.unsubscribeHooks={},this.events=new s,this.media=new d(new f,this.events),this.enable=function(){i._enabled=!0,i.events.dispatch(E.ENABLED)},this.disable=function(){i._enabled=!1,i.events.dispatch(E.DISABLED)},this.toggle=function(){i.enabled?i.disable():i.enable()},this.plugins=new t(this.events),e.media&&(this.media.store=e.media),e.mediaOptions&&e.mediaOptions.pageSize&&(this.media.pageSize=e.mediaOptions.pageSize),e.plugins&&e.plugins.forEach(function(e){return i.plugins.add(e)}),e.apis&&Object.entries(e.apis).forEach(function(e){var t=e[0],n=e[1];return i.registerApi(t,n)}),e.enabled&&this.enable()}var S=(P.prototype.subscribe=function(e){var t=this;return this.__subscribers.push(e),function(){return t.unsubscribe(e)}},P.prototype.unsubscribe=function(e){var t=this.__subscribers.indexOf(e);this.__subscribers.splice(t,1)},P.prototype.notifiySubscribers=function(){this.__subscribers.forEach(function(e){return e()})},P);function P(){this.__subscribers=[]}e.CMS=O,e.EventBus=s,e.Listener=o,e.MediaListError=_,e.MediaManager=d,e.PluginType=i,e.PluginTypeManager=t,e.Subscribable=S,Object.defineProperty(e,"__esModule",{value:!0})});

@@ -131,1 +131,13 @@ /**

}
interface MediaListErrorConfig {
title: string;
message: string;
docsLink: string;
}
export declare class MediaListError extends Error {
ERR_TYPE: string;
title: string;
docsLink: string;
constructor(config: MediaListErrorConfig);
}
export {};
{
"name": "@tinacms/core",
"version": "0.42.1",
"version": "0.43.0-alpha.1",
"main": "build/index.js",

@@ -32,3 +32,3 @@ "types": "build/index.d.ts",

},
"gitHead": "6414c3937ff4e47df10943d7e6abbe27565bd69d"
"gitHead": "08ec315760ce8886b612614e6391cefb9b1f2065"
}
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