@milkdown/preset-commonmark
Advanced tools
Comparing version 4.11.1 to 4.11.2
@@ -8,3 +8,3 @@ import { AtomList } from '@milkdown/utils'; | ||
languageList?: string[] | undefined; | ||
}, import("@milkdown/core").Node>>; | ||
}, import("@milkdown/core").Node> | import("@milkdown/utils/lib/atom/types").PluginWithMetadata<string, import("./node").ImageOptions, import("@milkdown/core").Node>>; | ||
export { commonmarkPlugins }; | ||
@@ -11,0 +11,0 @@ export declare const commonmark: AtomList<import("@milkdown/core").MilkdownPlugin>; |
@@ -257,3 +257,3 @@ /* Copyright 2021, Milkdown by Mirone. */ | ||
}); | ||
languageOptions.concat((options === null || options === void 0 ? void 0 : options.languageList) || []).forEach((lang) => { | ||
((options === null || options === void 0 ? void 0 : options.languageList) || languageOptions).forEach((lang) => { | ||
const option = document.createElement('li'); | ||
@@ -260,0 +260,0 @@ option.className = 'code-fence_select-option'; |
export declare const ModifyImage: import("@milkdown/core").CmdKey<string>; | ||
export declare const InsertImage: import("@milkdown/core").CmdKey<string>; | ||
export declare const image: import("@milkdown/utils/lib/atom/types").Origin<string, import("@milkdown/utils/lib/type-utility").UnknownRecord, import("@milkdown/core").Node>; | ||
export declare type ImageOptions = { | ||
placeholder: { | ||
loading: string; | ||
empty: string; | ||
failed: string; | ||
}; | ||
}; | ||
export declare const image: import("@milkdown/utils/lib/atom/types").Origin<string, ImageOptions, import("@milkdown/core").Node>; | ||
//# sourceMappingURL=image.d.ts.map |
@@ -10,3 +10,5 @@ /* Copyright 2021, Milkdown by Mirone. */ | ||
const id = 'image'; | ||
export const image = createNode((_, utils) => { | ||
export const image = createNode((options, utils) => { | ||
var _a; | ||
const placeholder = Object.assign({ loading: 'Loading...', empty: 'Add an Image', failed: 'Image loads failed' }, ((_a = options === null || options === void 0 ? void 0 : options.placeholder) !== null && _a !== void 0 ? _a : {})); | ||
const containerStyle = utils.getStyle((themeTool) => css ` | ||
@@ -62,3 +64,3 @@ display: inline-block; | ||
&::before { | ||
content: 'Loading...'; | ||
content: '${placeholder.loading}'; | ||
} | ||
@@ -71,3 +73,3 @@ } | ||
&::before { | ||
content: 'Add an image'; | ||
content: '${placeholder.empty}'; | ||
} | ||
@@ -80,3 +82,3 @@ } | ||
&::before { | ||
content: 'Image load failed'; | ||
content: '${placeholder.failed}'; | ||
} | ||
@@ -83,0 +85,0 @@ } |
@@ -1,4 +0,4 @@ | ||
export declare const nodes: import("@milkdown/utils/lib/atom/types").PluginWithMetadata<"CodeFence", { | ||
export declare const nodes: (import("@milkdown/utils/lib/atom/types").PluginWithMetadata<"CodeFence", { | ||
languageList?: string[] | undefined; | ||
}, import("@milkdown/core").Node>[]; | ||
}, import("@milkdown/core").Node> | import("@milkdown/utils/lib/atom/types").PluginWithMetadata<string, import("./image").ImageOptions, import("@milkdown/core").Node>)[]; | ||
export * from './blockquote'; | ||
@@ -5,0 +5,0 @@ export * from './bullet-list'; |
{ | ||
"name": "@milkdown/preset-commonmark", | ||
"version": "4.11.1", | ||
"version": "4.11.2", | ||
"main": "lib/index.js", | ||
@@ -5,0 +5,0 @@ "module": "lib/index.js", |
@@ -10,9 +10,7 @@ # @milkdown/preset-commonmark | ||
import { Editor } from '@milkdown/core'; | ||
import { nord } from '@milkdown/theme-nord'; | ||
import { commonmark } from '@milkdown/preset-commonmark'; | ||
// import theme and style | ||
import '@milkdown/theme-nord/lib/theme.css'; | ||
import '@milkdown/preset-commonmark/lib/style.css'; | ||
new Editor().use(commonmark).create(); | ||
Editor.make().use(nord).use(commonmark).create(); | ||
``` | ||
@@ -31,3 +29,3 @@ | ||
new Editor().use(commonmarkPlugins).use(nodes); | ||
Editor.make().use(commonmarkPlugins).use(nodes); | ||
``` | ||
@@ -73,1 +71,14 @@ | ||
``` | ||
## Other Options | ||
### Image | ||
- placeholder | ||
- loading: _string_. The placeholder of loading status. | ||
- empty: _string_. The placeholder of empty status. | ||
- failed: _string_. The placeholder of failed status. | ||
### CodeFence | ||
- languageList: _string[]_. The selectable languages list of code fence needs to be enabled. |
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 not supported yet
Sorry, the diff of this file is not supported yet
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
117075
1513
82