dragon-editor 3.5.7 → 3.5.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +0 -5
- package/dist/module.json +1 -1
- package/dist/module.mjs +1 -2
- package/dist/runtime/components/DragonEditor.vue +2 -0
- package/dist/runtime/type.d.ts +3 -0
- package/dist/runtime/utils/node/block.js +1 -2
- package/dist/runtime/utils/node/element.d.ts +0 -4
- package/package.json +1 -1
- package/dist/runtime/plugin.d.ts +0 -2
- package/dist/runtime/plugin.js +0 -6
package/README.md
CHANGED
package/dist/module.json
CHANGED
package/dist/module.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineNuxtModule, createResolver, addComponent, addTypeTemplate
|
|
1
|
+
import { defineNuxtModule, createResolver, addComponent, addTypeTemplate } from '@nuxt/kit';
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
|
|
@@ -31,7 +31,6 @@ const module = defineNuxtModule({
|
|
|
31
31
|
src: resolver.resolve(__dirname, "./runtime/type.d.ts"),
|
|
32
32
|
write: true
|
|
33
33
|
});
|
|
34
|
-
addPlugin(resolver.resolve(__dirname, "./runtime/plugin"));
|
|
35
34
|
nuxt.options.build.transpile.push("highlight.js");
|
|
36
35
|
}
|
|
37
36
|
});
|
|
@@ -9,6 +9,7 @@ import { _eidtorMountEvent, _eidtorUnmountEvent, _editorMousemoveEvent, _editorM
|
|
|
9
9
|
import { _addBlock } from "../utils/node";
|
|
10
10
|
import { _setDecoration, _setTextAlign } from "../utils/style";
|
|
11
11
|
import type { VNode } from "vue";
|
|
12
|
+
import hljs from "highlight.js";
|
|
12
13
|
import "../type.d.ts";
|
|
13
14
|
|
|
14
15
|
interface DEOption {
|
|
@@ -113,6 +114,7 @@ const editorStore = ref<DragonEditorStore>({
|
|
|
113
114
|
$body: null,
|
|
114
115
|
$controlBar: null,
|
|
115
116
|
$parentWrap: null,
|
|
117
|
+
hljs: hljs,
|
|
116
118
|
emit: emit,
|
|
117
119
|
windowClickEvent: function (event: MouseEvent) {
|
|
118
120
|
_checkOthersideClick(event, editorStore);
|
package/dist/runtime/type.d.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import type { HLJSApi } from "highlight.js";
|
|
2
|
+
|
|
1
3
|
type DEContentData = DEBlockData[];
|
|
2
4
|
|
|
3
5
|
type DEBlockData = DETextBlock | DEHeadingBlock | DEListBlock | DEImageBlock | DECodeBlock | DECustomBlock;
|
|
@@ -62,6 +64,7 @@ interface DragonEditorStore {
|
|
|
62
64
|
$anchorInput: HTMLInputElement | null;
|
|
63
65
|
$currentBlock: HTMLDivElement | null;
|
|
64
66
|
};
|
|
67
|
+
hljs: HLJSApi;
|
|
65
68
|
codeBlockTheme: DECodeItem<DECodeblockTheme>[];
|
|
66
69
|
listUlType: DECodeItem<DEListStyle>[];
|
|
67
70
|
listOlType: DECodeItem<DEListStyle>[];
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { _getDefaultBlockData, _generateId, _updateModelData, _updateCursorData, _decideWhetherOpenControlBar, _updateControlBarStatus, CODEBLOCKLANG } from "../event/index.js";
|
|
2
|
-
import hljs from "highlight.js";
|
|
3
2
|
export function _addBlock(type, store, data) {
|
|
4
3
|
const blockData = data === void 0 ? _getDefaultBlockData(type) : data;
|
|
5
4
|
let $block = _createTextBlock(_getDefaultBlockData("text"));
|
|
@@ -219,7 +218,7 @@ export function _setCodeBlockLanguage(language, store) {
|
|
|
219
218
|
if ($target !== null && $code !== null) {
|
|
220
219
|
const targetValue = CODEBLOCKLANG.find((item) => item.code === language);
|
|
221
220
|
if (targetValue !== void 0) {
|
|
222
|
-
const convert = hljs.highlight($code.textContent ?? "", { language });
|
|
221
|
+
const convert = store.value.hljs.highlight($code.textContent ?? "", { language });
|
|
223
222
|
$target.textContent = targetValue.text;
|
|
224
223
|
$code.innerHTML = convert.value;
|
|
225
224
|
store.value.controlStatus.codeBlockLang = targetValue.code;
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
export declare function _findScrollingElement($target: HTMLElement): HTMLElement | Window;
|
|
2
|
-
export declare function _getParentElementIfNodeIsText($target: Node, $block: HTMLElement): Node;
|
|
3
|
-
export declare function _findContentEditableElement($target: Node): HTMLElement | null;
|
|
4
|
-
export declare function _findPoverTextNode(node: Element, idx: number): number;
|
package/package.json
CHANGED
package/dist/runtime/plugin.d.ts
DELETED