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

@contentful/rich-text-types

Package Overview
Dependencies
Maintainers
105
Versions
82
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@contentful/rich-text-types - npm Package Compare versions

Comparing version 15.3.3 to 15.3.5

11

CHANGELOG.md

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

## [15.3.5](https://github.com/contentful/rich-text/compare/v15.3.4...v15.3.5) (2021-09-13)
### Bug Fixes
* **rich-text-types:** forbid Tables inside ListItem ([#266](https://github.com/contentful/rich-text/issues/266)) ([fc338bf](https://github.com/contentful/rich-text/commit/fc338bf040b8718057717d2681f800d5e26ba59d))
## [15.3.3](https://github.com/contentful/rich-text/compare/v15.3.2...v15.3.3) (2021-09-07)

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

31

dist/lib/schemaConstraints.js
"use strict";
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
if (ar || !(i in from)) {
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
ar[i] = from[i];
}
}
return to.concat(ar || Array.prototype.slice.call(from));
};
var __importDefault = (this && this.__importDefault) || function (mod) {

@@ -16,3 +7,3 @@ return (mod && mod.__esModule) ? mod : { "default": mod };

Object.defineProperty(exports, "__esModule", { value: true });
exports.CONTAINERS = exports.VOID_BLOCKS = exports.TOP_LEVEL_BLOCKS = void 0;
exports.CONTAINERS = exports.VOID_BLOCKS = exports.LIST_ITEM_BLOCKS = exports.TOP_LEVEL_BLOCKS = void 0;
var blocks_1 = __importDefault(require("./blocks"));

@@ -40,2 +31,20 @@ /**

/**
* Array of all allowed block types inside list items
*/
exports.LIST_ITEM_BLOCKS = [
blocks_1.default.PARAGRAPH,
blocks_1.default.HEADING_1,
blocks_1.default.HEADING_2,
blocks_1.default.HEADING_3,
blocks_1.default.HEADING_4,
blocks_1.default.HEADING_5,
blocks_1.default.HEADING_6,
blocks_1.default.OL_LIST,
blocks_1.default.UL_LIST,
blocks_1.default.HR,
blocks_1.default.QUOTE,
blocks_1.default.EMBEDDED_ENTRY,
blocks_1.default.EMBEDDED_ASSET,
];
/**
* Array of all void block types

@@ -50,3 +59,3 @@ */

_a[blocks_1.default.UL_LIST] = [blocks_1.default.LIST_ITEM],
_a[blocks_1.default.LIST_ITEM] = __spreadArray([], exports.TOP_LEVEL_BLOCKS, true),
_a[blocks_1.default.LIST_ITEM] = exports.LIST_ITEM_BLOCKS,
_a[blocks_1.default.QUOTE] = [blocks_1.default.PARAGRAPH],

@@ -53,0 +62,0 @@ _a[blocks_1.default.TABLE] = [blocks_1.default.TABLE_ROW],

@@ -20,3 +20,3 @@ {

"items": {
"$ref": "#/definitions/TopLevelBlock"
"$ref": "#/definitions/ListItemBlock"
}

@@ -32,7 +32,7 @@ }

},
"TopLevelBlock": {
"ListItemBlock": {
"type": "object",
"properties": {
"nodeType": {
"$ref": "#/definitions/TopLevelBlockEnum"
"$ref": "#/definitions/ListItemBlockEnum"
},

@@ -66,3 +66,3 @@ "content": {

},
"TopLevelBlockEnum": {
"ListItemBlockEnum": {
"enum": [

@@ -81,3 +81,2 @@ "blockquote",

"paragraph",
"table",
"unordered-list"

@@ -84,0 +83,0 @@ ],

@@ -47,3 +47,3 @@ {

"items": {
"$ref": "#/definitions/TopLevelBlock"
"$ref": "#/definitions/ListItemBlock"
}

@@ -59,7 +59,7 @@ }

},
"TopLevelBlock": {
"ListItemBlock": {
"type": "object",
"properties": {
"nodeType": {
"$ref": "#/definitions/TopLevelBlockEnum"
"$ref": "#/definitions/ListItemBlockEnum"
},

@@ -93,3 +93,3 @@ "content": {

},
"TopLevelBlockEnum": {
"ListItemBlockEnum": {
"enum": [

@@ -108,3 +108,2 @@ "blockquote",

"paragraph",
"table",
"unordered-list"

@@ -111,0 +110,0 @@ ],

@@ -47,3 +47,3 @@ {

"items": {
"$ref": "#/definitions/TopLevelBlock"
"$ref": "#/definitions/ListItemBlock"
}

@@ -59,7 +59,7 @@ }

},
"TopLevelBlock": {
"ListItemBlock": {
"type": "object",
"properties": {
"nodeType": {
"$ref": "#/definitions/TopLevelBlockEnum"
"$ref": "#/definitions/ListItemBlockEnum"
},

@@ -93,3 +93,3 @@ "content": {

},
"TopLevelBlockEnum": {
"ListItemBlockEnum": {
"enum": [

@@ -108,3 +108,2 @@ "blockquote",

"paragraph",
"table",
"unordered-list"

@@ -111,0 +110,0 @@ ],

@@ -188,3 +188,3 @@ 'use strict';

})('versions', []).push({
version: '3.17.2',
version: '3.17.3',
mode: 'global',

@@ -902,23 +902,2 @@ copyright: '© 2021 Denis Pushkarev (zloirock.ru)'

/*! *****************************************************************************
Copyright (c) Microsoft Corporation.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */
function __spreadArray(to, from) {
for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
to[j] = from[i];
return to;
}
var _a;

@@ -946,2 +925,20 @@ /**

/**
* Array of all allowed block types inside list items
*/
var LIST_ITEM_BLOCKS = [
BLOCKS$1.PARAGRAPH,
BLOCKS$1.HEADING_1,
BLOCKS$1.HEADING_2,
BLOCKS$1.HEADING_3,
BLOCKS$1.HEADING_4,
BLOCKS$1.HEADING_5,
BLOCKS$1.HEADING_6,
BLOCKS$1.OL_LIST,
BLOCKS$1.UL_LIST,
BLOCKS$1.HR,
BLOCKS$1.QUOTE,
BLOCKS$1.EMBEDDED_ENTRY,
BLOCKS$1.EMBEDDED_ASSET,
];
/**
* Array of all void block types

@@ -956,3 +953,3 @@ */

_a[BLOCKS$1.UL_LIST] = [BLOCKS$1.LIST_ITEM],
_a[BLOCKS$1.LIST_ITEM] = __spreadArray([], TOP_LEVEL_BLOCKS),
_a[BLOCKS$1.LIST_ITEM] = LIST_ITEM_BLOCKS,
_a[BLOCKS$1.QUOTE] = [BLOCKS$1.PARAGRAPH],

@@ -1018,2 +1015,3 @@ _a[BLOCKS$1.TABLE] = [BLOCKS$1.TABLE_ROW],

exports.INLINES = INLINES$1;
exports.LIST_ITEM_BLOCKS = LIST_ITEM_BLOCKS;
exports.MARKS = MARKS$1;

@@ -1020,0 +1018,0 @@ exports.TOP_LEVEL_BLOCKS = TOP_LEVEL_BLOCKS;

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

import { Block, Inline, Text, TopLevelBlock } from './types';
import BLOCKS from './blocks';
import INLINES from './inlines';
import { Block, Inline, Text, ListItemBlock } from './types';
declare type EmptyNodeData = {};

@@ -67,3 +67,3 @@ export interface Heading1 extends Block {

data: EmptyNodeData;
content: TopLevelBlock[];
content: ListItemBlock[];
}

@@ -70,0 +70,0 @@ export interface Link<T extends string = string> {

@@ -8,3 +8,8 @@ import BLOCKS from './blocks';

export declare const TOP_LEVEL_BLOCKS: TopLevelBlockEnum[];
export declare type ListItemBlockEnum = BLOCKS.PARAGRAPH | BLOCKS.HEADING_1 | BLOCKS.HEADING_2 | BLOCKS.HEADING_3 | BLOCKS.HEADING_4 | BLOCKS.HEADING_5 | BLOCKS.HEADING_6 | BLOCKS.OL_LIST | BLOCKS.UL_LIST | BLOCKS.HR | BLOCKS.QUOTE | BLOCKS.EMBEDDED_ENTRY | BLOCKS.EMBEDDED_ASSET;
/**
* Array of all allowed block types inside list items
*/
export declare const LIST_ITEM_BLOCKS: TopLevelBlockEnum[];
/**
* Array of all void block types

@@ -11,0 +16,0 @@ */

import BLOCKS from './blocks';
import INLINES from './inlines';
import { TopLevelBlockEnum } from './schemaConstraints';
import { TopLevelBlockEnum, ListItemBlockEnum } from './schemaConstraints';
/**

@@ -35,1 +35,4 @@ * @additionalProperties true

}
export interface ListItemBlock extends Block {
nodeType: ListItemBlockEnum;
}
{
"name": "@contentful/rich-text-types",
"version": "15.3.3",
"version": "15.3.5",
"main": "dist/rich-text-types.es5.js",

@@ -48,3 +48,3 @@ "typings": "dist/types/index.d.ts",

},
"gitHead": "c9c7d7b8a23e4680b7caf33814eff71bc661c636"
"gitHead": "3800ad52efd72a20b03c133c6f35c6343adb6565"
}

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