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

mobiledoc-vdom-renderer

Package Overview
Dependencies
Maintainers
22
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mobiledoc-vdom-renderer - npm Package Compare versions

Comparing version 1.0.1 to 1.1.0

22

dist/commonjs/SectionRenderer/MarkupSectionRenderer/index.js
"use strict";
var __assign = (this && this.__assign) || function () {
__assign = Object.assign || function(t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
t[p] = s[p];
}
return t;
};
return __assign.apply(this, arguments);
};
var __spreadArrays = (this && this.__spreadArrays) || function () {

@@ -12,2 +23,9 @@ for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;

var MarkersRenderer_1 = require("../MarkersRenderer");
var attributesArrayToAttributes = function (attributesArray) {
return attributesArray.reduce(function (accumulator, value, index) {
var _a;
return index % 2 !== 0
? __assign(__assign({}, accumulator), (_a = {}, _a[attributesArray[index - 1]] = value, _a)) : accumulator;
}, {});
};
exports.default = (function (_a) {

@@ -18,6 +36,6 @@ var createElement = _a.createElement, getAtomComponent = _a.getAtomComponent, getMarkupComponent = _a.getMarkupComponent;

return function (_a) {
var tagName = _a[1], markers = _a[2];
var tagName = _a[1], markers = _a[2], attributes = _a[3];
return createElement.apply(void 0, __spreadArrays([getMarkupComponent(tagName) ||
utils_1.throwError("Unhandled element: the markup section `'" + tagName + "'` has no corresponding handler."),
{}], MarkersRenderer_1.default({ createElement: createElement, getAtomComponent: getAtomComponent, getMarkupComponent: getMarkupComponent })({
attributesArrayToAttributes(attributes || [])], MarkersRenderer_1.default({ createElement: createElement, getAtomComponent: getAtomComponent, getMarkupComponent: getMarkupComponent })({
markups: markups,

@@ -24,0 +42,0 @@ atoms: atoms

2

dist/module/SectionRenderer/MarkupSectionRenderer/index.d.ts

@@ -12,3 +12,3 @@ import { CreateElement, ElementTypeGetter } from '../../types';

}
declare const _default: ({ createElement, getAtomComponent, getMarkupComponent }: Options) => ({ markups, atoms }: Context) => ([, tagName, markers]: MarkupSection) => any;
declare const _default: ({ createElement, getAtomComponent, getMarkupComponent }: Options) => ({ markups, atoms }: Context) => ([, tagName, markers, attributes]: MarkupSection) => any;
export default _default;
"use strict";
var __assign = (this && this.__assign) || function () {
__assign = Object.assign || function(t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
t[p] = s[p];
}
return t;
};
return __assign.apply(this, arguments);
};
var __spreadArrays = (this && this.__spreadArrays) || function () {

@@ -12,2 +23,9 @@ for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;

var MarkersRenderer_1 = require("../MarkersRenderer");
var attributesArrayToAttributes = function (attributesArray) {
return attributesArray.reduce(function (accumulator, value, index) {
var _a;
return index % 2 !== 0
? __assign(__assign({}, accumulator), (_a = {}, _a[attributesArray[index - 1]] = value, _a)) : accumulator;
}, {});
};
exports.default = (function (_a) {

@@ -18,6 +36,6 @@ var createElement = _a.createElement, getAtomComponent = _a.getAtomComponent, getMarkupComponent = _a.getMarkupComponent;

return function (_a) {
var tagName = _a[1], markers = _a[2];
var tagName = _a[1], markers = _a[2], attributes = _a[3];
return createElement.apply(void 0, __spreadArrays([getMarkupComponent(tagName) ||
utils_1.throwError("Unhandled element: the markup section `'" + tagName + "'` has no corresponding handler."),
{}], MarkersRenderer_1.default({ createElement: createElement, getAtomComponent: getAtomComponent, getMarkupComponent: getMarkupComponent })({
attributesArrayToAttributes(attributes || [])], MarkersRenderer_1.default({ createElement: createElement, getAtomComponent: getAtomComponent, getMarkupComponent: getMarkupComponent })({
markups: markups,

@@ -24,0 +42,0 @@ atoms: atoms

@@ -65,3 +65,8 @@ export declare enum MarkerTypeIdentifier {

2: Marker[];
3?: Attributes;
}
export interface Attributes extends Array<any> {
0: 'data-md-text-align';
1: 'left' | 'right' | 'center';
}
export declare enum ImageSectionTagName {

@@ -68,0 +73,0 @@ img = "img"

{
"name": "mobiledoc-vdom-renderer",
"version": "1.0.1",
"version": "1.1.0",
"description": "Render Mobiledoc as VDOM, for React or React-like `createElement` calls",

@@ -5,0 +5,0 @@ "author": "Donald Tetto <donald@tetto.org>",

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