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

content-kit-compiler

Package Overview
Dependencies
Maintainers
3
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

content-kit-compiler - npm Package Compare versions

Comparing version 0.2.3 to 0.3.0

bower_components/ember-cli-test-loader/.bower.json

21

package.json
{
"name": "content-kit-compiler",
"version": "0.2.3",
"version": "0.3.0",
"description": "Parses and renders content to and from the JSON model that backs ContentKit's WYSIWYG Editor",
"repository": "https://github.com/bustlelabs/content-kit-compiler",
"main": "dist/content-kit-compiler.js",
"main": "dist/content-kit-compiler/index.js",
"scripts": {
"test": "gulp test"
"test": "testem ci",
"build": "rm -rf dist && broccoli build dist",
"prepublish": "./scripts/build-if-necessary.sh",
"serve": "brocolli serve"
},

@@ -23,3 +26,9 @@ "keywords": [

"devDependencies": {
"content-kit-utils": "0.1.2",
"broccoli": "^0.16.3",
"broccoli-babel-transpiler": "^5.2.3",
"broccoli-concat": "0.0.13",
"broccoli-funnel": "^0.2.3",
"broccoli-merge-trees": "^0.2.1",
"broccoli-multi-builder": "^0.1.0",
"content-kit-utils": "^0.2.0",
"esperanto": "^0.6.31",

@@ -30,5 +39,5 @@ "gulp": "^3.8.11",

"gulp-qunit": "^1.2.1",
"qunit": "^0.7.6",
"qunitjs": "^1.18.0"
"qunitjs": "^1.18.0",
"testem": "^0.8.4"
}
}

@@ -14,3 +14,3 @@ # ContentKit Compiler [![Build Status](https://travis-ci.org/bustlelabs/content-kit-compiler.svg?branch=master)](https://travis-ci.org/bustlelabs/content-kit-compiler)

<ul>
<li>Item A</li>
<li>Item A</li>
<li>Item B</li>

@@ -96,5 +96,6 @@ </ul>

## Building / Testing
```
npm install
gulp
```
* `bower install`
* `npm install`
* `npm run serve && open http://localhost:4200/tests` or
* `npm test` (uses testem to run tests in phantom and chrome)
import HTMLParser from './parsers/html-parser';
import HTMLRenderer from './renderers/html-renderer';
import { DefaultBlockTypeSet, DefaultMarkupTypeSet } from './types/default-types';
import { mergeWithOptions } from 'content-kit-utils/src/object-utils';
import { mergeWithOptions } from 'content-kit-utils';

@@ -6,0 +6,0 @@ /**

@@ -1,7 +0,35 @@

import ContentKit from './main';
import Type from './types/type';
import BlockModel from './models/block';
import EmbedModel from './models/embed';
import Compiler from './compiler';
import HTMLParser from './parsers/html-parser';
import HTMLRenderer from './renderers/html-renderer';
import NewHTMLParser from './parsers/new-html-parser';
import doc from './parsers/document';
if (typeof exports === 'object') {
module.exports = ContentKit;
} else {
window.ContentKit = ContentKit;
}
/**
* @namespace ContentKit
* Register public ContentKit compiler modules
*/
const ContentKitCompiler = {
Type,
BlockModel,
EmbedModel,
Compiler,
HTMLParser,
HTMLRenderer,
NewHTMLParser
};
export {
Type,
BlockModel,
EmbedModel,
Compiler,
HTMLParser,
HTMLRenderer,
NewHTMLParser,
doc
};
export default ContentKitCompiler;
import Model from './model';
import { inherit } from 'content-kit-utils/src/object-utils';
import { inherit } from 'content-kit-utils';
/**
* Ensures block markups at the same index are always in a specific order.
* For example, so all bold links are consistently marked up
* For example, so all bold links are consistently marked up
* as <a><b>text</b></a> instead of <b><a>text</a></b>

@@ -8,0 +8,0 @@ */

import Model from './model';
import { inherit } from 'content-kit-utils/src/object-utils';
import { inherit } from 'content-kit-utils';

@@ -4,0 +4,0 @@ /**

@@ -33,2 +33,2 @@ /**

export default Model;
export default Model;

@@ -7,3 +7,3 @@ /**

if (typeof exports === 'object') {
if (typeof module !== 'undefined' && module.exports) {
var jsdom = require('jsdom').jsdom;

@@ -10,0 +10,0 @@ doc = jsdom();

@@ -6,6 +6,6 @@ import parserDocument from './document';

import { DefaultBlockTypeSet, DefaultMarkupTypeSet } from '../types/default-types';
import { mergeWithOptions } from 'content-kit-utils/src/object-utils';
import { toArray } from 'content-kit-utils/src/array-utils';
import { trim, trimLeft, sanitizeWhitespace } from 'content-kit-utils/src/string-utils';
import { textOfNode, unwrapNode, attributesForNode } from 'content-kit-utils/src/node-utils';
import { mergeWithOptions } from 'content-kit-utils';
import { toArray } from 'content-kit-utils';
import { trim, trimLeft, sanitizeWhitespace } from 'content-kit-utils';
import { textOfNode, unwrapNode, attributesForNode } from 'content-kit-utils';

@@ -151,3 +151,3 @@ var ELEMENT_NODE = 1;

* @param node element node to parse
* @param startIndex
* @param startIndex
* @return {MarkupModel} markup model

@@ -154,0 +154,0 @@ * Serializes markup of a single html element node (no child elements)

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

import { injectIntoString } from 'content-kit-utils/src/string-utils';
import { sumSparseArray } from 'content-kit-utils/src/array-utils';
import { injectIntoString } from 'content-kit-utils';
import { sumSparseArray } from 'content-kit-utils';

@@ -4,0 +4,0 @@ /**

import Type from '../types/type';
import HTMLElementRenderer from './html-element-renderer';
import HTMLEmbedRenderer from './html-embed-renderer';
import CardRenderer from './card-renderer';
import { DefaultBlockTypeSet, DefaultMarkupTypeSet } from '../types/default-types';
import { mergeWithOptions } from 'content-kit-utils/src/object-utils';
import { mergeWithOptions } from 'content-kit-utils';

@@ -15,3 +16,4 @@ /**

markupTypes : DefaultMarkupTypeSet,
typeRenderers : {}
typeRenderers : {},
cards : {}
};

@@ -32,2 +34,5 @@ mergeWithOptions(this, defaults, options);

}
if (type === Type.CARD) {
return new CardRenderer(this.cards);
}
return new HTMLElementRenderer({ type: type, markupTypes: this.markupTypes });

@@ -47,4 +52,5 @@ };

for (i = 0; i < len; i++) {
// this is renderModel, not only blocks!!
blockHtml = this.renderBlock(model[i]);
if (blockHtml) {
if (blockHtml) {
html += blockHtml;

@@ -51,0 +57,0 @@ }

@@ -15,3 +15,4 @@ import TypeSet from './type-set';

new Type({ tag: 'ol', name: 'ordered list' }),
new Type({ name: 'embed', isTextType: false })
new Type({ name: 'embed', isTextType: false }),
new Type({ name: 'card' })
]);

@@ -18,0 +19,0 @@

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

import { underscore } from 'content-kit-utils/src/string-utils';
import { underscore } from 'content-kit-utils';

@@ -3,0 +3,0 @@ /**

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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