Comparing version 2.0.1 to 3.0.0-alpha.0
{ | ||
"name": "parchment", | ||
"version": "2.0.1", | ||
"version": "3.0.0-alpha.0", | ||
"description": "A document model for rich text editors", | ||
@@ -8,3 +8,3 @@ "author": "Jason Chen <jhchen7@gmail.com>", | ||
"main": "./dist/parchment.js", | ||
"types": "./dist/typings/parchment.d.ts", | ||
"types": "./dist/parchment.d.ts", | ||
"files": [ | ||
@@ -16,6 +16,6 @@ "tsconfig.json", | ||
"devDependencies": { | ||
"@babel/core": "^7.17.5", | ||
"@microsoft/api-extractor": "^7.34.6", | ||
"@types/node": "^18.15.11", | ||
"@typescript-eslint/eslint-plugin": "^5.14.0", | ||
"@typescript-eslint/parser": "^5.14.0", | ||
"babel-loader": "^8.2.3", | ||
"del-cli": "^4.0.1", | ||
@@ -25,14 +25,13 @@ "eslint": "^8.10.0", | ||
"eslint-plugin-prettier": "^4.0.0", | ||
"jasmine-core": "^4.0.1", | ||
"karma": "^6.3.17", | ||
"jasmine-core": "^4.6.0", | ||
"karma": "^6.4.2", | ||
"karma-babel-preprocessor": "^8.0.2", | ||
"karma-chrome-launcher": "^3.1.1", | ||
"karma-jasmine": "^4.0.1", | ||
"karma-chrome-launcher": "^3.2.0", | ||
"karma-jasmine": "^5.1.0", | ||
"karma-sauce-launcher": "^4.3.6", | ||
"karma-webpack": "^5.0.0", | ||
"karma-vite": "^1.0.4", | ||
"prettier": "^2.5.1", | ||
"ts-loader": "^9.2.8", | ||
"typescript": "^4.6.2", | ||
"webpack": "^5.70.0", | ||
"webpack-cli": "^4.9.2" | ||
"tsd": "^0.28.1", | ||
"typescript": "^4.9.5", | ||
"vite": "^4.2.1" | ||
}, | ||
@@ -71,7 +70,8 @@ "eslintConfig": { | ||
"scripts": { | ||
"build": "webpack --config webpack.conf.js", | ||
"prebuild": "del-cli dist", | ||
"build": "vite build", | ||
"build:types": "tsc --emitDeclarationOnly && api-extractor run && rm -rf dist/typings", | ||
"lint": "eslint 'src/**/*.ts'", | ||
"prepare": "npm run build", | ||
"prepare": "npm run build && npm run build:types", | ||
"test": "karma start", | ||
"test:types": "npm run build && npm run build:types && tsd", | ||
"test:server": "karma start --no-single-run", | ||
@@ -78,0 +78,0 @@ "test:ci": "karma start --browsers saucelabs-chrome --reporters dots,saucelabs" |
@@ -21,3 +21,3 @@ # Parchment [![Build Status](https://github.com/quilljs/parchment/actions/workflows/main.yml/badge.svg?branch=2.0)](https://github.com/quilljs/parchment/actions?query=branch%3A2.0) | ||
static className: string; | ||
static tagName: string; | ||
static tagName: string | string[]; | ||
static scope: Scope; | ||
@@ -24,0 +24,0 @@ |
@@ -13,3 +13,3 @@ import Attributor from './attributor'; | ||
class StyleAttributor extends Attributor { | ||
public static keys(node: Element): string[] { | ||
public static keys(node: HTMLElement): string[] { | ||
return (node.getAttribute('style') || '').split(';').map((value) => { | ||
@@ -16,0 +16,0 @@ const arr = value.split(':'); |
@@ -9,3 +9,3 @@ import Attributor from '../../attributor/attributor'; | ||
className?: string; | ||
tagName: string; | ||
tagName: string | string[]; | ||
new (scroll: Root, node: Node, value?: any): Blot; | ||
@@ -29,3 +29,3 @@ create(value?: any): Node; | ||
scope: Scope; | ||
tagName: string; | ||
tagName: string | string[]; | ||
}; | ||
@@ -32,0 +32,0 @@ |
@@ -8,3 +8,3 @@ import Scope from '../../scope'; | ||
public static scope = Scope.BLOCK_BLOT; | ||
public static tagName: string; | ||
public static tagName: string | string[]; | ||
@@ -11,0 +11,0 @@ public prev!: BlockBlot | ContainerBlot | null; |
@@ -93,6 +93,6 @@ import LinkedList from '../../collection/linked-list'; | ||
public descendant( | ||
criteria: new () => Blot, | ||
public descendant<T extends Blot>( | ||
criteria: new (...args: any[]) => T, | ||
index: number, | ||
): [Blot | null, number]; | ||
): [T | null, number]; | ||
public descendant( | ||
@@ -116,11 +116,11 @@ criteria: (blot: Blot) => boolean, | ||
public descendants<T extends Blot>( | ||
criteria: new (...args: any[]) => T, | ||
index?: number, | ||
length?: number, | ||
): T[]; | ||
public descendants( | ||
criteria: new () => Blot, | ||
index: number, | ||
length: number, | ||
): Blot[]; | ||
public descendants( | ||
criteria: (blot: Blot) => boolean, | ||
index: number, | ||
length: number, | ||
index?: number, | ||
length?: number, | ||
): Blot[]; | ||
@@ -366,3 +366,3 @@ public descendants( | ||
.filter((node) => { | ||
return node.parentNode === this.domNode || node === this.uiNode; | ||
return node.parentNode === this.domNode && node !== this.uiNode; | ||
}) | ||
@@ -369,0 +369,0 @@ .sort((a, b) => { |
@@ -11,3 +11,3 @@ import ParchmentError from '../../error'; | ||
public static scope: Scope; | ||
public static tagName: string; | ||
public static tagName: string | string[]; | ||
@@ -14,0 +14,0 @@ public static create(value: any): Node { |
@@ -12,3 +12,3 @@ import Attributor from '../attributor/attributor'; | ||
public static scope = Scope.BLOCK_BLOT; | ||
public static tagName = 'P'; | ||
public static tagName: string | string[] = 'P'; | ||
public static allowedChildren: BlotConstructor[] = [ | ||
@@ -15,0 +15,0 @@ InlineBlot, |
@@ -32,3 +32,3 @@ import Attributor from '../attributor/attributor'; | ||
public static scope = Scope.INLINE_BLOT; | ||
public static tagName = 'SPAN'; | ||
public static tagName: string | string[] = 'SPAN'; | ||
@@ -35,0 +35,0 @@ public static formats(domNode: HTMLElement, scroll: Root): any { |
@@ -35,1 +35,15 @@ import ContainerBlot from './blot/abstract/container'; | ||
}; | ||
export type { RegistryInterface } from './registry'; | ||
export type { default as ShadowBlot } from './blot/abstract/shadow'; | ||
export type { default as LinkedList } from './collection/linked-list'; | ||
export type { default as LinkedNode } from './collection/linked-node'; | ||
export type { AttributorOptions } from './attributor/attributor'; | ||
export type { | ||
Blot, | ||
BlotConstructor, | ||
Formattable, | ||
Leaf, | ||
Parent, | ||
Root, | ||
} from './blot/abstract/blot'; |
@@ -10,7 +10,7 @@ { | ||
"strict": true, | ||
"sourceMap": true, | ||
"moduleResolution": "node", | ||
"noUnusedLocals": true, | ||
"noUnusedParameters": true | ||
}, | ||
"exclude": ["node_modules", "test"] | ||
"include": ["src"], | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
295182
19
3113
29
2