@toast-ui/editor
Advanced tools
Comparing version 2.1.0-alpha.3 to 2.1.0
/*! | ||
* TOAST UI Editor : i18n | ||
* @version 2.1.0-alpha.3 | ||
* @version 2.1.0 | ||
* @author NHN FE Development Lab <dl_javascript@nhn.com> | ||
@@ -5,0 +5,0 @@ * @license MIT |
/*! | ||
* TOAST UI Editor : i18n | ||
* @version 2.1.0-alpha.3 | ||
* @version 2.1.0 | ||
* @author NHN FE Development Lab <dl_javascript@nhn.com> | ||
@@ -5,0 +5,0 @@ * @license MIT |
/*! | ||
* TOAST UI Editor : i18n | ||
* @version 2.1.0-alpha.3 | ||
* @version 2.1.0 | ||
* @author NHN FE Development Lab <dl_javascript@nhn.com> | ||
@@ -5,0 +5,0 @@ * @license MIT |
/*! | ||
* TOAST UI Editor : i18n | ||
* @version 2.1.0-alpha.3 | ||
* @version 2.1.0 | ||
* @author NHN FE Development Lab <dl_javascript@nhn.com> | ||
@@ -5,0 +5,0 @@ * @license MIT |
/*! | ||
* TOAST UI Editor : i18n | ||
* @version 2.1.0-alpha.3 | ||
* @version 2.1.0 | ||
* @author NHN FE Development Lab <dl_javascript@nhn.com> | ||
@@ -5,0 +5,0 @@ * @license MIT |
/*! | ||
* TOAST UI Editor : i18n | ||
* @version 2.1.0-alpha.3 | ||
* @version 2.1.0 | ||
* @author NHN FE Development Lab <dl_javascript@nhn.com> | ||
@@ -5,0 +5,0 @@ * @license MIT |
/*! | ||
* TOAST UI Editor : i18n | ||
* @version 2.1.0-alpha.3 | ||
* @version 2.1.0 | ||
* @author NHN FE Development Lab <dl_javascript@nhn.com> | ||
@@ -5,0 +5,0 @@ * @license MIT |
/*! | ||
* TOAST UI Editor : i18n | ||
* @version 2.1.0-alpha.3 | ||
* @version 2.1.0 | ||
* @author NHN FE Development Lab <dl_javascript@nhn.com> | ||
@@ -5,0 +5,0 @@ * @license MIT |
/*! | ||
* TOAST UI Editor : i18n | ||
* @version 2.1.0-alpha.3 | ||
* @version 2.1.0 | ||
* @author NHN FE Development Lab <dl_javascript@nhn.com> | ||
@@ -5,0 +5,0 @@ * @license MIT |
/*! | ||
* TOAST UI Editor : i18n | ||
* @version 2.1.0-alpha.3 | ||
* @version 2.1.0 | ||
* @author NHN FE Development Lab <dl_javascript@nhn.com> | ||
@@ -5,0 +5,0 @@ * @license MIT |
/*! | ||
* TOAST UI Editor : i18n | ||
* @version 2.1.0-alpha.3 | ||
* @version 2.1.0 | ||
* @author NHN FE Development Lab <dl_javascript@nhn.com> | ||
@@ -5,0 +5,0 @@ * @license MIT |
/*! | ||
* TOAST UI Editor : i18n | ||
* @version 2.1.0-alpha.3 | ||
* @version 2.1.0 | ||
* @author NHN FE Development Lab <dl_javascript@nhn.com> | ||
@@ -5,0 +5,0 @@ * @license MIT |
/*! | ||
* TOAST UI Editor : i18n | ||
* @version 2.1.0-alpha.3 | ||
* @version 2.1.0 | ||
* @author NHN FE Development Lab <dl_javascript@nhn.com> | ||
@@ -5,0 +5,0 @@ * @license MIT |
/*! | ||
* TOAST UI Editor : i18n | ||
* @version 2.1.0-alpha.3 | ||
* @version 2.1.0 | ||
* @author NHN FE Development Lab <dl_javascript@nhn.com> | ||
@@ -5,0 +5,0 @@ * @license MIT |
/*! | ||
* TOAST UI Editor : i18n | ||
* @version 2.1.0-alpha.3 | ||
* @version 2.1.0 | ||
* @author NHN FE Development Lab <dl_javascript@nhn.com> | ||
@@ -5,0 +5,0 @@ * @license MIT |
/*! | ||
* TOAST UI Editor : i18n | ||
* @version 2.1.0-alpha.3 | ||
* @version 2.1.0 | ||
* @author NHN FE Development Lab <dl_javascript@nhn.com> | ||
@@ -5,0 +5,0 @@ * @license MIT |
/*! | ||
* TOAST UI Editor : i18n | ||
* @version 2.1.0-alpha.3 | ||
* @version 2.1.0 | ||
* @author NHN FE Development Lab <dl_javascript@nhn.com> | ||
@@ -5,0 +5,0 @@ * @license MIT |
/*! | ||
* TOAST UI Editor : i18n | ||
* @version 2.1.0-alpha.3 | ||
* @version 2.1.0 | ||
* @author NHN FE Development Lab <dl_javascript@nhn.com> | ||
@@ -5,0 +5,0 @@ * @license MIT |
/*! | ||
* TOAST UI Editor : i18n | ||
* @version 2.1.0-alpha.3 | ||
* @version 2.1.0 | ||
* @author NHN FE Development Lab <dl_javascript@nhn.com> | ||
@@ -5,0 +5,0 @@ * @license MIT |
242
index.d.ts
@@ -1,2 +0,2 @@ | ||
// Type definitions for TOAST UI Editor v2.0.1 | ||
// Type definitions for TOAST UI Editor v2.1.0 | ||
// TypeScript Version: 3.2.2 | ||
@@ -16,3 +16,137 @@ | ||
type PreviewStyle = 'tab' | 'vertical'; | ||
type CustomHTMLSanitizer = (content: string) => string | DocumentFragment; | ||
type LinkAttribute = Partial<{ | ||
rel: string; | ||
target: string; | ||
contenteditable: boolean | 'true' | 'false'; | ||
hreflang: string; | ||
type: string; | ||
}>; | ||
type AutolinkParser = ( | ||
content: string | ||
) => { | ||
url: string; | ||
text: string; | ||
range: [number, number]; | ||
}[]; | ||
type ExtendedAutolinks = boolean | AutolinkParser; | ||
type Sanitizer = (content: string) => string | DocumentFragment; | ||
// @TODO: change toastMark type definition to @toast-ui/toastmark type file through importing | ||
// Toastmark custom renderer type | ||
type BlockNodeType = | ||
| 'document' | ||
| 'list' | ||
| 'blockQuote' | ||
| 'item' | ||
| 'heading' | ||
| 'thematicBreak' | ||
| 'paragraph' | ||
| 'codeBlock' | ||
| 'htmlBlock' | ||
| 'table' | ||
| 'tableHead' | ||
| 'tableBody' | ||
| 'tableRow' | ||
| 'tableCell' | ||
| 'tableDelimRow' | ||
| 'tableDelimCell' | ||
| 'refDef'; | ||
type InlineNodeType = | ||
| 'code' | ||
| 'text' | ||
| 'emph' | ||
| 'strong' | ||
| 'strike' | ||
| 'link' | ||
| 'image' | ||
| 'htmlInline' | ||
| 'linebreak' | ||
| 'softbreak'; | ||
type NodeType = BlockNodeType | InlineNodeType; | ||
type SourcePos = [[number, number], [number, number]]; | ||
interface NodeWalker { | ||
current: MdNode | null; | ||
root: MdNode; | ||
entering: boolean; | ||
next(): { entering: boolean; node: MdNode } | null; | ||
resumeAt(node: MdNode, entering: boolean): void; | ||
} | ||
interface MdNode { | ||
type: NodeType; | ||
id: number; | ||
parent: MdNode | null; | ||
prev: MdNode | null; | ||
next: MdNode | null; | ||
sourcepos?: SourcePos; | ||
firstChild: MdNode | null; | ||
lastChild: MdNode | null; | ||
literal: string | null; | ||
isContainer(): boolean; | ||
unlink(): void; | ||
replaceWith(node: MdNode): void; | ||
insertAfter(node: MdNode): void; | ||
insertBefore(node: MdNode): void; | ||
appendChild(child: MdNode): void; | ||
prependChild(child: MdNode): void; | ||
walker(): NodeWalker; | ||
} | ||
interface TagToken { | ||
tagName: string; | ||
outerNewLine?: boolean; | ||
innerNewLine?: boolean; | ||
} | ||
interface OpenTagToken extends TagToken { | ||
type: 'openTag'; | ||
classNames?: string[]; | ||
attributes?: Record<string, string>; | ||
selfClose?: boolean; | ||
} | ||
interface CloseTagToken extends TagToken { | ||
type: 'closeTag'; | ||
} | ||
interface TextToken { | ||
type: 'text'; | ||
content: string; | ||
} | ||
interface RawHTMLToken { | ||
type: 'html'; | ||
content: string; | ||
outerNewLine?: boolean; | ||
} | ||
type HTMLToken = OpenTagToken | CloseTagToken | TextToken | RawHTMLToken; | ||
interface ContextOptions { | ||
gfm: boolean; | ||
softbreak: string; | ||
nodeId: boolean; | ||
tagFilter: boolean; | ||
convertors?: CustomHTMLRendererMap; | ||
} | ||
interface Context { | ||
entering: boolean; | ||
leaf: boolean; | ||
options: Omit<ContextOptions, 'gfm' | 'convertors'>; | ||
getChildrenText: (node: MdNode) => string; | ||
skipChildren: () => void; | ||
origin?: () => ReturnType<CustomHTMLRenderer>; | ||
} | ||
export type CustomHTMLRenderer = (node: MdNode, context: Context) => HTMLToken | HTMLToken[] | null; | ||
type CustomHTMLRendererMap = Partial<Record<NodeType, CustomHTMLRenderer>>; | ||
// Toastmark custom renderer type end | ||
interface SelectionRange { | ||
@@ -29,6 +163,46 @@ from: { | ||
interface ToolbarState { | ||
strong: boolean; | ||
emph: boolean; | ||
strike: boolean; | ||
code: boolean; | ||
codeBlock: boolean; | ||
blockQuote: boolean; | ||
table: boolean; | ||
heading: boolean; | ||
list: boolean; | ||
orderedList: boolean; | ||
taskList: boolean; | ||
} | ||
type WysiwygToolbarState = ToolbarState & { | ||
source: 'wysiwyg'; | ||
}; | ||
type MarkdownToolbarState = ToolbarState & { | ||
thematicBreak: boolean; | ||
source: 'markdown'; | ||
}; | ||
type SourceType = 'wysiwyg' | 'markdown'; | ||
interface EventMap { | ||
[propName: string]: HandlerFunc; | ||
load?: (param: Editor) => void; | ||
change?: (param: { source: SourceType | 'viewer'; data: MouseEvent }) => void; | ||
stateChange?: (param: MarkdownToolbarState | WysiwygToolbarState) => void; | ||
focus?: (param: { source: SourceType }) => void; | ||
blur?: (param: { source: SourceType }) => void; | ||
} | ||
interface ViewerHookMap { | ||
previewBeforeHook?: (html: string) => void | string; | ||
} | ||
type EditorHookMap = ViewerHookMap & { | ||
addImageBlobHook?: ( | ||
blob: Blob | File, | ||
callback: (url: string, altText: string) => void | ||
) => void; | ||
}; | ||
interface ToMarkOptions { | ||
@@ -39,9 +213,20 @@ gfm?: boolean; | ||
interface Convertor { | ||
initHtmlSanitizer(): void; | ||
export interface Convertor { | ||
initHtmlSanitizer(sanitizer: Sanitizer): void; | ||
toHTML(makrdown: string): string; | ||
toHTMLWithCodeHightlight(markdown: string): string; | ||
toHTMLWithCodeHighlight(markdown: string): string; | ||
toMarkdown(html: string, toMarkdownOptions: ToMarkOptions): string; | ||
} | ||
export interface ConvertorClass { | ||
new (em: EventManager, options: ConvertorOptions): Convertor; | ||
} | ||
export interface ConvertorOptions { | ||
linkAttribute: LinkAttribute; | ||
customHTMLRenderer: CustomHTMLRenderer; | ||
extendedAutolinks: boolean | AutolinkParser; | ||
referenceDefinition: boolean; | ||
} | ||
export interface EditorOptions { | ||
@@ -55,3 +240,3 @@ el: HTMLElement; | ||
events?: EventMap; | ||
hooks?: EventMap | { addImageBlobHook: AddImageBlobHook }; | ||
hooks?: EditorHookMap; | ||
language?: string; | ||
@@ -64,7 +249,10 @@ useCommandShortcut?: boolean; | ||
plugins?: Plugin[]; | ||
customConvertor?: Convertor; | ||
extendedAutolinks?: ExtendedAutolinks; | ||
customConvertor?: ConvertorClass; | ||
placeholder?: string; | ||
linkAttribute?: object; | ||
extendedAutolinks?: boolean; | ||
useReferenceDefinition?: boolean; | ||
linkAttribute?: LinkAttribute; | ||
customHTMLRenderer?: CustomHTMLRenderer; | ||
referenceDefinition?: boolean; | ||
customHTMLSanitizer?: CustomHTMLSanitizer; | ||
previewHighlight?: boolean; | ||
} | ||
@@ -74,11 +262,13 @@ | ||
el: HTMLElement; | ||
height?: string; | ||
minHeight?: string; | ||
previewStyle?: PreviewStyle; | ||
initialValue?: string; | ||
events?: EventMap; | ||
hooks?: EventMap | { previewBeforeHook: Function }; | ||
hooks?: ViewerHookMap; | ||
plugins?: Plugin[]; | ||
extendedAutolinks?: boolean; | ||
useReferenceDefinition?: boolean; | ||
useDefaultHTMLSanitizer?: boolean; | ||
extendedAutolinks?: ExtendedAutolinks; | ||
customConvertor?: ConvertorClass; | ||
linkAttribute?: LinkAttribute; | ||
customHTMLRenderer?: CustomHTMLRenderer; | ||
referenceDefinition?: boolean; | ||
customHTMLSanitizer?: CustomHTMLSanitizer; | ||
} | ||
@@ -92,3 +282,3 @@ | ||
useDefaultHTMLSanitizer?: boolean; | ||
linkAttribute?: object; | ||
linkAttribute?: LinkAttribute; | ||
} | ||
@@ -348,3 +538,5 @@ | ||
public prepareToTableCellStuffing(trs: HTMLElement): object; | ||
public prepareToTableCellStuffing( | ||
trs: HTMLElement | ||
): { maximumCellLength: number; needTableCellStuffingAid: boolean }; | ||
@@ -491,3 +683,3 @@ public resetLastCellNode(): void; | ||
public getLinkAttribute(): object; | ||
public getLinkAttribute(): LinkAttribute; | ||
@@ -663,2 +855,8 @@ public setSelectionByContainerAndOffset( | ||
export type EditorOptions = toastui.EditorOptions; | ||
export type CustomConvertor = toastui.ConvertorClass; | ||
export type EventMap = toastui.EventMap; | ||
export type EditorHookMap = toastui.EditorHookMap; | ||
export type CustomHTMLRenderer = toastui.CustomHTMLRenderer; | ||
export type ExtendedAutolinks = toastui.ExtendedAutolinks; | ||
export type LinkAttribute = toastui.LinkAttribute; | ||
export default toastui.Editor; | ||
@@ -669,3 +867,9 @@ } | ||
export type ViewerOptions = toastui.ViewerOptions; | ||
export type CustomConvertor = toastui.ConvertorClass; | ||
export type EventMap = toastui.EventMap; | ||
export type ViewerHookMap = toastui.ViewerHookMap; | ||
export type CustomHTMLRenderer = toastui.CustomHTMLRenderer; | ||
export type ExtendedAutolinks = toastui.ExtendedAutolinks; | ||
export type LinkAttribute = toastui.LinkAttribute; | ||
export default toastui.Viewer; | ||
} |
{ | ||
"name": "@toast-ui/editor", | ||
"version": "2.1.0-alpha.3", | ||
"version": "2.1.0", | ||
"description": "GFM Markdown Wysiwyg Editor - Productive and Extensible", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -81,5 +81,7 @@ # ![TOAST UI Editor](https://uicdn.toast.com/toastui/img/tui-editor-bi.png) | ||
│ │ ├─ toastui-editor.css | ||
│ │ └─ toastui-editor.min.css | ||
│ │ ├─ toastui-editor.min.css | ||
│ │ ├─ toastui-editor-viewer.css | ||
│ │ └─ toastui-editor-viewer.min.css | ||
│ │ ├─ toastui-editor-viewer.min.css | ||
│ │ ├─ toastui-editor-only.css | ||
│ │ └─ toastui-editor-only.min.css | ||
│ ├─ 2.0.0/ | ||
@@ -86,0 +88,0 @@ │ │ └─ ... |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
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
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
1685734
39093
0
182