Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

apostrophe-schema-widgets

Package Overview
Dependencies
Maintainers
13
Versions
23
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

apostrophe-schema-widgets - npm Package Compare versions

Comparing version 0.5.20 to 0.5.21

32

index.js

@@ -27,8 +27,2 @@ /* jshint node:true */

self._apos.pushGlobalData({
schemaWidgets: _.map(options.widgets, function(info) {
info.css = info.css || apos.cssName(info.name);
return info;
})
});
self._apos.pushGlobalData({
schemaWidgetsUi: {

@@ -39,10 +33,6 @@ toggleUi: self.toggleUi

// widgetEditors.html will spit out a frontend DOM template for editing
// each widget type we register
self.pushAsset('template', 'widgetEditors', { when: 'user', data: options });
self.pushAsset('script', 'editor', { when: 'user' });
self.pushAsset('stylesheet', 'editor', { when: 'user' });
_.each(options.widgets, function(options) {
self.registerWidget = function(options) {
var widget = {};

@@ -75,3 +65,3 @@ apos.defaultControls.push(options.name);

widget.renderWidget = function(data) {
widget.renderWidget = options.renderWidget || function(data) {
return self.render(widget.name, data);

@@ -116,5 +106,19 @@ };

self.widgets[widget.name] = widget;
});
var data = {
schemaWidgets: {}
};
options.css = options.css || apos.cssName(options.name);
data.schemaWidgets[widget.name] = options;
self._apos.pushGlobalData(data);
// originally designed to output templates for many widgets at once, this template
// can be repurposed to push them one at a time
self.pushAsset('template', 'widgetEditors', { when: 'user', data: { widgets: [ options ] } });
return setImmediate(function() { return callback && callback(null); });
};
_.each(options.widgets, self.registerWidget);
if (callback) {
process.nextTick(function() { return callback(null); });
}
}
{
"name": "apostrophe-schema-widgets",
"version": "0.5.20",
"version": "0.5.21",
"description": "An easy form widget builder for the Apostrophe content management system",

@@ -5,0 +5,0 @@ "main": "index.js",

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