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.10.0 to 0.10.1-alpha.0

21

build/cms.d.ts

@@ -137,7 +137,22 @@ /**

registerApi(name: string, api: any): void;
/**
* When `true` the CMS is enabled and content can be edited.
*/
get enabled(): boolean;
/**
* When `true` the CMS is disabled and content cannot be edited.
*/
get disabled(): boolean;
enable(): void;
disable(): void;
toggle(): void;
/**
* Enable the CMS so content can be edited.
*/
enable: () => void;
/**
* Disable the CMS so content can no longer be edited.
*/
disable: () => void;
/**
* Toggles the enabled/disabled state of the CMS .
*/
toggle: () => void;
}

2

build/index.js

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

!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=(s.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})},s.prototype.all=function(){var e=this;return Object.keys(this.__plugins).map(function(t){return e.__plugins[t]})},s.prototype.find=function(t){return this.__plugins[t]},s.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},s.prototype.subscribe=function(t){return this.events.subscribe("plugin:*:"+this.__type,t)},s);function s(t,e){this.__type=t,this.events=e,this.__plugins={}}var r=function(){var i=this;this.listeners=new Set,this.subscribe=function(t,e){var n=new o(t,e);return i.listeners.add(n),function(){i.listeners.delete(n)}},this.dispatch=function(e){Array.from(i.listeners.values()).forEach(function(t){return t.handleEvent(e)})}},o=(p.prototype.handleEvent=function(t){return!!this.watchesEvent(t)&&(this.callback(t),!0)},p.prototype.watchesEvent=function(t){if("*"===this.eventPattern)return!0;for(var e=t.type.split(":"),n=this.eventPattern.split(":"),i=0,s=!1;!s&&i<n.length;){var r="*"===n[i],o=n[i]===e[i];s=!(r||o),i++}return!s},p);function p(t,e){this.eventPattern=t,this.callback=e}var u=(a.prototype.registerApi=function(t,e){this.api[t]=e},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.prototype.enable=function(){this._enabled=!0,this.events.dispatch(a.ENABLED)},a.prototype.disable=function(){this._enabled=!1,this.events.dispatch(a.DISABLED)},a.prototype.toggle=function(){this.enabled?this.disable():this.enable()},a.ENABLED={type:"cms:enable"},a.DISABLED={type:"cms:disable"},a);function a(t){var i=this;void 0===t&&(t={}),this._enabled=!0,this.api={},this.events=new r,this.plugins=new e(this.events),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||void 0===t.enabled?this.enable():this.disable()}var c=(h.prototype.subscribe=function(t){var e=this;return this.__subscribers.push(t),function(){return e.unsubscribe(t)}},h.prototype.unsubscribe=function(t){var e=this.__subscribers.indexOf(t);this.__subscribers.splice(e,1)},h.prototype.notifiySubscribers=function(){this.__subscribers.forEach(function(t){return t()})},h);function h(){this.__subscribers=[]}t.CMS=u,t.EventBus=r,t.Listener=o,t.PluginType=i,t.PluginTypeManager=e,t.Subscribable=c,Object.defineProperty(t,"__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=(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 o(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)})}},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,s=!1;!s&&i<n.length;){var r="*"===n[i],o=n[i]===t[i];s=!(r||o),i++}return!s},u);function u(e,t){this.eventPattern=e,this.callback=t}var p=(a.prototype.registerApi=function(e,t){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=!0,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||void 0===e.enabled?this.enable():this.disable()}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=o,e.PluginType=i,e.PluginTypeManager=t,e.Subscribable=c,Object.defineProperty(e,"__esModule",{value:!0})});

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

## [0.10.1-alpha.0](https://github.com/tinacms/tinacms/compare/@tinacms/core@0.10.0...@tinacms/core@0.10.1-alpha.0) (2020-07-04)
### Bug Fixes
* the enable and disable are now lamdas ([e3185b0](https://github.com/tinacms/tinacms/commit/e3185b0))
# [0.10.0](https://github.com/tinacms/tinacms/compare/@tinacms/core@0.10.0-alpha.0...@tinacms/core@0.10.0) (2020-06-23)

@@ -8,0 +19,0 @@

{
"name": "@tinacms/core",
"version": "0.10.0",
"version": "0.10.1-alpha.0",
"main": "build/index.js",

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

},
"gitHead": "b36e6c8e7e4e8670e4c5de02709a80f7f05194df"
"gitHead": "3a08d4b402c6f2835be0102c72d7e8ae9108ca19"
}
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