Join our webinar on Wednesday, June 26, at 1pm EDTHow Chia Mitigates Risk in the Crypto Industry.Register
Socket
Socket
Sign inDemoInstall

@tinacms/core

Package Overview
Dependencies
0
Maintainers
14
Versions
101
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.29.0 to 0.31.0-alpha.0

build/media-store.default.d.ts

3

build/cms.d.ts

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

import { EventBus } from './event';
import { MediaManager, MediaStore } from './media';
/**

@@ -75,2 +76,3 @@ * A [[CMS]] is the core object of any content management system.

};
media?: MediaStore;
}

@@ -119,2 +121,3 @@ export declare class CMS {

events: EventBus;
media: MediaManager;
/**

@@ -121,0 +124,0 @@ * @hidden

2

build/event.d.ts

@@ -25,3 +25,3 @@ /**

private listeners;
subscribe: (event: string, callback: Callback) => () => void;
subscribe: (event: string | string[], callback: Callback) => () => void;
dispatch: (event: CMSEvent) => void;

@@ -28,0 +28,0 @@ }

@@ -22,1 +22,2 @@ /**

export * from './plugins';
export * from './media';

@@ -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=(s.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})},s.prototype.all=function(){var t=this;return Object.keys(this.__plugins).map(function(e){return t.__plugins[e]})},s.prototype.find=function(e){return this.__plugins[e]},s.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},s.prototype.subscribe=function(e){return this.events.subscribe("plugin:*:"+this.__type,e)},s);function s(e,t){this.__type=e,this.events=t,this.__plugins={}}var r=function(){var i=this;this.listeners=new Set,this.subscribe=function(e,t){var n=new u(e,t);return i.listeners.add(n),function(){i.listeners.delete(n)}},this.dispatch=function(t){Array.from(i.listeners.values()).forEach(function(e){return e.handleEvent(t)})}},u=(o.prototype.handleEvent=function(e){return!!this.watchesEvent(e)&&(this.callback(e),!0)},o.prototype.watchesEvent=function(e){if("*"===this.eventPattern)return!0;for(var t=e.type.split(":"),n=this.eventPattern.split(":"),i=0,s=!1;!s&&i<n.length;){var r="*"===n[i],u=n[i]===t[i];s=!(r||u),i++}return!s},o);function o(e,t){this.eventPattern=e,this.callback=t}var p=(a.prototype.registerApi=function(e,t){t.events instanceof r&&t.events.subscribe("*",this.events.dispatch),this.api[e]=t},Object.defineProperty(a.prototype,"enabled",{get:function(){return this._enabled},enumerable:!0,configurable:!0}),Object.defineProperty(a.prototype,"disabled",{get:function(){return!this._enabled},enumerable:!0,configurable:!0}),a.ENABLED={type:"cms:enable"},a.DISABLED={type:"cms:disable"},a);function a(e){var i=this;void 0===e&&(e={}),this._enabled=!1,this.api={},this.events=new r,this.enable=function(){i._enabled=!0,i.events.dispatch(a.ENABLED)},this.disable=function(){i._enabled=!1,i.events.dispatch(a.DISABLED)},this.toggle=function(){i.enabled?i.disable():i.enable()},this.plugins=new t(this.events),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 c=(h.prototype.subscribe=function(e){var t=this;return this.__subscribers.push(e),function(){return t.unsubscribe(e)}},h.prototype.unsubscribe=function(e){var t=this.__subscribers.indexOf(e);this.__subscribers.splice(t,1)},h.prototype.notifiySubscribers=function(){this.__subscribers.forEach(function(e){return e()})},h);function h(){this.__subscribers=[]}e.CMS=p,e.EventBus=r,e.Listener=u,e.PluginType=i,e.PluginTypeManager=t,e.Subscribable=c,Object.defineProperty(e,"__esModule",{value:!0})});
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t=t||self)["@tinacms/core"]={})}(this,function(t){"use strict";var e=(n.prototype.getType=function(t){return this.plugins[t]=this.plugins[t]||new i(t,this.events)},n.prototype.findOrCreateMap=function(t){return this.getType(t)},n.prototype.add=function(t){this.findOrCreateMap(t.__type).add(t)},n.prototype.remove=function(t){this.findOrCreateMap(t.__type).remove(t)},n.prototype.all=function(t){return this.findOrCreateMap(t).all()},n);function n(t){this.events=t,this.plugins={}}var i=(r.prototype.add=function(t){var e=t;e.__type||(e.__type=this.__type),this.__plugins[e.name]=e,this.events.dispatch({type:"plugin:add:"+this.__type})},r.prototype.all=function(){var e=this;return Object.keys(this.__plugins).map(function(t){return e.__plugins[t]})},r.prototype.find=function(t){return this.__plugins[t]},r.prototype.remove=function(t){var e="string"==typeof t?t:t.name,n=this.__plugins[e];return delete this.__plugins[e],this.events.dispatch({type:"plugin:remove:"+this.__type}),n},r.prototype.subscribe=function(t){return this.events.subscribe("plugin:*:"+this.__type,t)},r);function r(t,e){this.__type=t,this.events=e,this.__plugins={}}var s=function(){var i=this;this.listeners=new Set,this.subscribe=function(t,e){var n=("string"==typeof t?[t]:t).map(function(t){return new o(t,e)});return n.forEach(function(t){return i.listeners.add(t)}),function(){n.forEach(function(t){return i.listeners.delete(t)})}},this.dispatch=function(e){Array.from(i.listeners.values()).forEach(function(t){return t.handleEvent(e)})}},o=(u.prototype.handleEvent=function(t){return!!this.watchesEvent(t)&&(this.callback(t),!0)},u.prototype.watchesEvent=function(t){if("*"===this.eventPattern)return!0;for(var e=t.type.split(":"),n=this.eventPattern.split(":"),i=0,r=!1;!r&&i<n.length;){var s="*"===n[i],o=n[i]===e[i];r=!(s||o),i++}return!r},u);function u(t,e){this.eventPattern=t,this.callback=e}var a=function(){return(a=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)};function c(s,o,u,a){return new(u=u||Promise)(function(t,e){function n(t){try{r(a.next(t))}catch(t){e(t)}}function i(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(n,i)}r((a=a.apply(s,o||[])).next())})}function p(n,i){var r,s,o,t,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[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,s&&(o=2&e[0]?s.return:e[0]?s.throw||((o=s.return)&&o.call(s),0):s.next)&&!(o=o.call(s,e[1])).done)return o;switch(s=0,o&&(e=[2&e[0],o.value]),e[0]){case 0:case 1:o=e;break;case 4:return u.label++,{value:e[1],done:!1};case 5:u.label++,s=e[1],e=[0];continue;case 7:e=u.ops.pop(),u.trys.pop();continue;default:if(!(o=0<(o=u.trys).length&&o[o.length-1])&&(6===e[0]||2===e[0])){u=0;continue}if(3===e[0]&&(!o||e[1]>o[0]&&e[1]<o[3])){u.label=e[1];break}if(6===e[0]&&u.label<o[1]){u.label=o[1],o=e;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(e);break}o[2]&&u.ops.pop(),u.trys.pop();continue}e=i.call(n,u)}catch(t){e=[6,t],s=0}finally{r=o=0}if(5&e[0])throw e[1];return{value:e[0]?e[1]:void 0,done:!0}}([e,t])}}}var h=(l.prototype.open=function(t){void 0===t&&(t={}),this.events.dispatch(a({type:"media:open"},t))},Object.defineProperty(l.prototype,"accept",{get:function(){return this.store.accept},enumerable:!0,configurable:!0}),l.prototype.persist=function(i){return c(this,void 0,void 0,function(){var e,n;return p(this,function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),this.events.dispatch({type:"media:upload:start",uploaded:i}),[4,this.store.persist(i)];case 1:return e=t.sent(),this.events.dispatch({type:"media:upload:success",uploaded:i,media:e}),[2,e];case 2:throw n=t.sent(),this.events.dispatch({type:"media:upload:failure",uploaded:i,error:n}),n;case 3:return[2]}})})},l.prototype.delete=function(n){return c(this,void 0,void 0,function(){var e;return p(this,function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),this.events.dispatch({type:"media:delete:start",media:n}),[4,this.store.delete(n)];case 1:return t.sent(),this.events.dispatch({type:"media:delete:success",media:n}),[3,3];case 2:throw e=t.sent(),this.events.dispatch({type:"media:delete:failure",media:n,error:e}),e;case 3:return[2]}})})},l.prototype.list=function(i){return c(this,void 0,void 0,function(){var e,n;return p(this,function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),this.events.dispatch(a({type:"media:list:start"},i)),[4,this.store.list(i)];case 1:return e=t.sent(),this.events.dispatch(a(a({type:"media:list:success"},i),{media:e})),[2,e];case 2:throw n=t.sent(),this.events.dispatch(a(a({type:"media:list:failure"},i),{error:n})),n;case 3:return[2]}})})},l);function l(t,e){var n=this;this.store=t,this.events=e,this.previewSrc=function(i,r,s){return c(n,void 0,void 0,function(){var e,n;return p(this,function(t){switch(t.label){case 0:return t.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 e=t.sent(),this.events.dispatch({type:"media:preview:success",src:i,url:e,fieldName:r,formValues:s}),[2,e];case 2:throw n=t.sent(),this.events.dispatch({type:"media:preview:failure",src:i,error:n,fieldName:r,formValues:s}),n;case 3:return[2]}})})}}var f=(d.prototype.persist=function(e){return c(this,void 0,void 0,function(){return p(this,function(t){return alert("UPLOADING FILES"),console.log(e),[2,e.map(function(t){var e=t.directory,n=t.file;return{id:n.name,type:"file",directory:e,filename:n.name}})]})})},d.prototype.previewSrc=function(e){return c(this,void 0,void 0,function(){return p(this,function(t){return[2,e]})})},d.prototype.list=function(){return c(this,void 0,void 0,function(){var e;return p(this,function(t){return e=[],alert("Add a media store to the CMS."),[2,{items:e,offset:0,limit:10,totalCount:0}]})})},d.prototype.delete=function(){return c(this,void 0,void 0,function(){return p(this,function(t){return[2]})})},d);function d(){this.accept="*"}var v=(y.prototype.registerApi=function(t,e){e.events instanceof s&&e.events.subscribe("*",this.events.dispatch),this.api[t]=e},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(t){var i=this;void 0===t&&(t={}),this._enabled=!1,this.api={},this.events=new s,this.media=new h(new f,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 e(this.events),t.media&&(this.media.store=t.media),t.plugins&&t.plugins.forEach(function(t){return i.plugins.add(t)}),t.apis&&Object.entries(t.apis).forEach(function(t){var e=t[0],n=t[1];return i.registerApi(e,n)}),t.enabled&&this.enable()}var b=(m.prototype.subscribe=function(t){var e=this;return this.__subscribers.push(t),function(){return e.unsubscribe(t)}},m.prototype.unsubscribe=function(t){var e=this.__subscribers.indexOf(t);this.__subscribers.splice(e,1)},m.prototype.notifiySubscribers=function(){this.__subscribers.forEach(function(t){return t()})},m);function m(){this.__subscribers=[]}t.CMS=v,t.EventBus=s,t.Listener=o,t.MediaManager=h,t.PluginType=i,t.PluginTypeManager=e,t.Subscribable=b,Object.defineProperty(t,"__esModule",{value:!0})});
{
"name": "@tinacms/core",
"version": "0.29.0",
"version": "0.31.0-alpha.0",
"main": "build/index.js",

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

},
"gitHead": "a558761cf14d91acf63a01b52fd4ccf73097dee5"
"gitHead": "c0f5bfb152e5d7a5b4497800fd097d5fb836015c"
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc