-
Notifications
You must be signed in to change notification settings - Fork 95
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
25 changed files
with
474 additions
and
166 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import { IOpAttributes } from "./OpAttributeSanitizer"; | ||
import { InsertData } from './InsertData'; | ||
declare class DeltaInsertOp { | ||
readonly insert: InsertData; | ||
readonly attributes: IOpAttributes; | ||
constructor(insertVal: InsertData | string, attributes?: IOpAttributes); | ||
static createNewLineOp(): DeltaInsertOp; | ||
isContainerBlock(): boolean; | ||
isBlockquote(): boolean; | ||
isHeader(): boolean; | ||
isSameHeaderAs(op: DeltaInsertOp): boolean; | ||
hasSameAdiAs(op: DeltaInsertOp): boolean; | ||
hasSameIndentationAs(op: DeltaInsertOp): boolean; | ||
hasHigherIndentThan(op: DeltaInsertOp): boolean; | ||
isInline(): boolean; | ||
isCodeBlock(): boolean; | ||
isJustNewline(): boolean; | ||
isList(): boolean; | ||
isOrderedList(): boolean; | ||
isBulletList(): boolean; | ||
isSameListAs(op: DeltaInsertOp): boolean; | ||
isText(): boolean; | ||
isImage(): boolean; | ||
isFormula(): boolean; | ||
isVideo(): boolean; | ||
isLink(): boolean; | ||
isCustom(): boolean; | ||
isMentions(): boolean; | ||
} | ||
export { DeltaInsertOp }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import { DataType } from './value-types'; | ||
declare class InsertDataQuill { | ||
readonly type: DataType; | ||
readonly value: string; | ||
constructor(type: DataType, value: string); | ||
} | ||
declare class InsertDataCustom { | ||
readonly type: string; | ||
readonly value: any; | ||
constructor(type: string, value: any); | ||
} | ||
declare type InsertData = InsertDataCustom | InsertDataQuill; | ||
export { InsertData, InsertDataCustom, InsertDataQuill }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import './extensions/String'; | ||
import './extensions/Object'; | ||
declare class InsertOpDenormalizer { | ||
static denormalize(op: any): any[]; | ||
} | ||
export { InsertOpDenormalizer }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import { DeltaInsertOp } from './DeltaInsertOp'; | ||
import { InsertData } from './InsertData'; | ||
declare class InsertOpsConverter { | ||
static convert(deltaOps: any[]): DeltaInsertOp[]; | ||
static convertInsertVal(insertPropVal: any): InsertData | null; | ||
} | ||
export { InsertOpsConverter }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import { ListType, AlignType, DirectionType, ScriptType } from './value-types'; | ||
import './extensions/String'; | ||
import { IMention } from "./mentions/MentionSanitizer"; | ||
interface IOpAttributes { | ||
background?: string; | ||
color?: string; | ||
font?: string; | ||
size?: string; | ||
width?: string; | ||
link?: string; | ||
bold?: boolean; | ||
italic?: boolean; | ||
underline?: boolean; | ||
strike?: boolean; | ||
script?: ScriptType; | ||
code?: boolean; | ||
list?: ListType; | ||
blockquote?: boolean; | ||
'code-block'?: boolean; | ||
header?: number; | ||
align?: AlignType; | ||
direction?: DirectionType; | ||
indent?: number; | ||
mentions?: boolean; | ||
mention?: IMention; | ||
target?: string; | ||
} | ||
declare class OpAttributeSanitizer { | ||
static sanitize(dirtyAttrs: IOpAttributes): IOpAttributes; | ||
static IsValidHexColor(colorStr: string): boolean; | ||
static IsValidColorLiteral(colorStr: string): boolean; | ||
static IsValidFontName(fontName: string): boolean; | ||
static IsValidSize(size: string): boolean; | ||
static IsValidWidth(width: string): boolean; | ||
static isValidTarget(target: string): boolean; | ||
} | ||
export { OpAttributeSanitizer, IOpAttributes }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import { ITagKeyValue } from './funcs-html'; | ||
import { DeltaInsertOp } from './DeltaInsertOp'; | ||
import './extensions/String'; | ||
import './extensions/Object'; | ||
import './extensions/Array'; | ||
interface IOpToHtmlConverterOptions { | ||
classPrefix?: string; | ||
encodeHtml?: boolean; | ||
listItemTag?: string; | ||
paragraphTag?: string; | ||
linkRel?: string; | ||
linkTarget?: string; | ||
allowBackgroundClasses?: boolean; | ||
} | ||
interface IHtmlParts { | ||
openingTag: string; | ||
content: string; | ||
closingTag: string; | ||
} | ||
declare class OpToHtmlConverter { | ||
private options; | ||
private op; | ||
constructor(op: DeltaInsertOp, options?: IOpToHtmlConverterOptions); | ||
prefixClass(className: string): string; | ||
getHtml(): string; | ||
getHtmlParts(): IHtmlParts; | ||
getContent(): string; | ||
getCssClasses(): string[]; | ||
getCssStyles(): string[]; | ||
getTagAttributes(): Array<ITagKeyValue>; | ||
getTags(): string[]; | ||
static IsValidRel(relStr: string): boolean; | ||
} | ||
export { OpToHtmlConverter, IOpToHtmlConverterOptions, IHtmlParts }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import { DeltaInsertOp } from './DeltaInsertOp'; | ||
import { ListGroup, ListItem, TDataGroup } from './grouper/group-types'; | ||
import './extensions/Object'; | ||
import { GroupType } from './value-types'; | ||
interface IQuillDeltaToHtmlConverterOptions { | ||
orderedListTag?: string; | ||
bulletListTag?: string; | ||
listItemTag?: string; | ||
paragraphTag?: string; | ||
classPrefix?: string; | ||
encodeHtml?: boolean; | ||
multiLineBlockquote?: boolean; | ||
multiLineHeader?: boolean; | ||
multiLineCodeblock?: boolean; | ||
linkRel?: string; | ||
linkTarget?: string; | ||
allowBackgroundClasses?: boolean; | ||
} | ||
declare class QuillDeltaToHtmlConverter { | ||
private options; | ||
private rawDeltaOps; | ||
private converterOptions; | ||
private callbacks; | ||
constructor(deltaOps: any[], options?: IQuillDeltaToHtmlConverterOptions); | ||
_getListTag(op: DeltaInsertOp): string; | ||
getGroupedOps(): TDataGroup[]; | ||
convert(): string; | ||
_renderWithCallbacks(groupType: GroupType, group: TDataGroup, myRenderFn: () => string): string; | ||
_renderList(list: ListGroup, isOuterMost?: boolean): string; | ||
_renderListItem(li: ListItem, isOuterMost: boolean): string; | ||
_renderBlock(bop: DeltaInsertOp, ops: DeltaInsertOp[]): string; | ||
_renderInlines(ops: DeltaInsertOp[], wrapInParagraphTag?: boolean): string; | ||
_renderInline(op: DeltaInsertOp, contextOp: DeltaInsertOp): any; | ||
_renderCustom(op: DeltaInsertOp, contextOp: DeltaInsertOp): any; | ||
beforeRender(cb: (group: GroupType, data: TDataGroup) => string): void; | ||
afterRender(cb: (group: GroupType, html: string) => string): void; | ||
renderCustomWith(cb: (op: DeltaInsertOp, contextOp: DeltaInsertOp) => string): void; | ||
} | ||
export { QuillDeltaToHtmlConverter }; |
Oops, something went wrong.