@fast-crud/editor-markdown 1.28.3 → 1.28.5
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/.eslintrc.js +63 -3
- package/.prettierrc +1 -0
- package/CHANGELOG.md +4 -0
- package/dist/d/editor/exports.d.ts +1 -0
- package/dist/d/editor/index.d.ts +4 -0
- package/dist/d/editor/index.umd.d.ts +1 -0
- package/dist/d/editor/type/index.d.ts +4 -0
- package/dist/d/editor/type/types.d.ts +12 -0
- package/dist/d/index.d.ts +2 -0
- package/dist/d/index.umd.d.ts +2 -0
- package/dist/editor-markdown.mjs +6 -54
- package/dist/editor-markdown.mjs.map +1 -0
- package/dist/editor-markdown.umd.js +2 -1
- package/dist/editor-markdown.umd.js.map +1 -0
- package/dist/index-041be0e7.mjs +8 -0
- package/dist/index-041be0e7.mjs.map +1 -0
- package/dist/index-4f72a34c.mjs +64 -0
- package/dist/index-4f72a34c.mjs.map +1 -0
- package/package.json +48 -5
- package/src/editor/components/fs-editor-markdown/index.vue +49 -0
- package/src/editor/exports.ts +1 -0
- package/src/editor/index.umd.ts +1 -0
- package/src/editor/type/types.ts +7 -0
- package/src/index.umd.ts +3 -0
- package/src/style.css +1 -0
- package/stats.html +4949 -0
- package/tsconfig.json +36 -4
- package/vite.config.js +99 -18
- package/dist/index-0ae09bdb.mjs +0 -7
package/.eslintrc.js
CHANGED
|
@@ -9,11 +9,71 @@ module.exports = {
|
|
|
9
9
|
parserOptions: {
|
|
10
10
|
parser: "@typescript-eslint/parser",
|
|
11
11
|
ecmaVersion: 2020,
|
|
12
|
-
sourceType: "module"
|
|
12
|
+
sourceType: "module",
|
|
13
|
+
jsxPragma: "React",
|
|
14
|
+
ecmaFeatures: {
|
|
15
|
+
jsx: true,
|
|
16
|
+
tsx: true
|
|
17
|
+
}
|
|
13
18
|
},
|
|
14
|
-
extends: [
|
|
19
|
+
extends: [
|
|
20
|
+
"plugin:vue/vue3-recommended",
|
|
21
|
+
"plugin:@typescript-eslint/recommended",
|
|
22
|
+
"plugin:prettier/recommended",
|
|
23
|
+
"prettier"
|
|
24
|
+
],
|
|
15
25
|
rules: {
|
|
16
26
|
"@typescript-eslint/no-unused-vars": "off",
|
|
17
|
-
"@typescript-eslint/
|
|
27
|
+
"@typescript-eslint/ban-ts-ignore": "off",
|
|
28
|
+
"@typescript-eslint/explicit-function-return-type": "off",
|
|
29
|
+
"@typescript-eslint/no-explicit-any": "off",
|
|
30
|
+
"@typescript-eslint/no-implicitly-any": "off",
|
|
31
|
+
"@typescript-eslint/no-var-requires": "off",
|
|
32
|
+
"@typescript-eslint/no-empty-function": "off",
|
|
33
|
+
"@typescript-eslint/no-use-before-define": "off",
|
|
34
|
+
"@typescript-eslint/ban-ts-comment": "off",
|
|
35
|
+
"@typescript-eslint/ban-types": "off",
|
|
36
|
+
"@typescript-eslint/no-non-null-assertion": "off",
|
|
37
|
+
"@typescript-eslint/explicit-module-boundary-types": "off"
|
|
38
|
+
|
|
39
|
+
// "@typescript-eslint/no-unused-vars": [
|
|
40
|
+
// "error",
|
|
41
|
+
// {
|
|
42
|
+
// argsIgnorePattern: "^h$",
|
|
43
|
+
// varsIgnorePattern: "^h$"
|
|
44
|
+
// }
|
|
45
|
+
// ],
|
|
46
|
+
// "vue/custom-event-name-casing": "off",
|
|
47
|
+
// "no-use-before-define": "off",
|
|
48
|
+
// "no-unused-vars": [
|
|
49
|
+
// "error",
|
|
50
|
+
// {
|
|
51
|
+
// argsIgnorePattern: "^h$",
|
|
52
|
+
// varsIgnorePattern: "^h$"
|
|
53
|
+
// }
|
|
54
|
+
// ],
|
|
55
|
+
// "space-before-function-paren": "off",
|
|
56
|
+
//
|
|
57
|
+
// "vue/attributes-order": "off",
|
|
58
|
+
// "vue/one-component-per-file": "off",
|
|
59
|
+
// "vue/html-closing-bracket-newline": "off",
|
|
60
|
+
// "vue/max-attributes-per-line": "off",
|
|
61
|
+
// "vue/multiline-html-element-content-newline": "off",
|
|
62
|
+
// "vue/singleline-html-element-content-newline": "off",
|
|
63
|
+
// "vue/attribute-hyphenation": "off",
|
|
64
|
+
// // 'vue/html-self-closing': 'off',
|
|
65
|
+
// "vue/require-default-prop": "off",
|
|
66
|
+
// "vue/html-self-closing": [
|
|
67
|
+
// "error",
|
|
68
|
+
// {
|
|
69
|
+
// html: {
|
|
70
|
+
// void: "always",
|
|
71
|
+
// normal: "never",
|
|
72
|
+
// component: "always"
|
|
73
|
+
// },
|
|
74
|
+
// svg: "always",
|
|
75
|
+
// math: "always"
|
|
76
|
+
// }
|
|
77
|
+
// ]
|
|
18
78
|
}
|
|
19
79
|
};
|
package/.prettierrc
CHANGED
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,10 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [1.28.5](https://github.com/fast-crud/fast-crud/compare/v1.28.3...v1.28.5) (2026-08-01)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @fast-crud/editor-markdown
|
|
9
|
+
|
|
6
10
|
## [1.28.3](https://github.com/fast-crud/fast-crud/compare/v1.28.2...v1.28.3) (2026-08-01)
|
|
7
11
|
|
|
8
12
|
**Note:** Version bump only for package @fast-crud/editor-markdown
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as FsEditorMarkdown } from "./components/fs-editor-markdown/index.vue";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./index";
|
package/dist/editor-markdown.mjs
CHANGED
|
@@ -1,56 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
return {
|
|
6
|
-
"editor-markdown": {
|
|
7
|
-
form: { component: { name: "fs-editor-markdown" }, col: { span: 24 } }
|
|
8
|
-
}
|
|
9
|
-
};
|
|
10
|
-
}
|
|
11
|
-
const E = {
|
|
12
|
-
install() {
|
|
13
|
-
const { addTypes: e } = m();
|
|
14
|
-
e(w());
|
|
15
|
-
}
|
|
16
|
-
}, B = /* @__PURE__ */ u({
|
|
17
|
-
inheritAttrs: !1,
|
|
18
|
-
__name: "index",
|
|
19
|
-
props: {
|
|
20
|
-
modelValue: {},
|
|
21
|
-
disabled: { type: Boolean },
|
|
22
|
-
readonly: { type: Boolean }
|
|
23
|
-
},
|
|
24
|
-
emits: ["update:modelValue", "change"],
|
|
25
|
-
setup(e, { emit: t }) {
|
|
26
|
-
const n = e, a = t, l = p(), d = g.mavonEditor, i = f(() => ({
|
|
27
|
-
...l,
|
|
28
|
-
class: ["fs-editor-markdown", l.class],
|
|
29
|
-
value: n.modelValue ?? "",
|
|
30
|
-
modelValue: n.modelValue ?? "",
|
|
31
|
-
...n.disabled || n.readonly ? { editable: !1 } : {},
|
|
32
|
-
onInput: s,
|
|
33
|
-
"onUpdate:modelValue": s,
|
|
34
|
-
onChange(o, r) {
|
|
35
|
-
s(o), a("change", o, r);
|
|
36
|
-
}
|
|
37
|
-
}));
|
|
38
|
-
function s(o) {
|
|
39
|
-
a("update:modelValue", o);
|
|
40
|
-
}
|
|
41
|
-
return (o, r) => (y(), _(v(d), k(V(i.value)), null, 16));
|
|
42
|
-
}
|
|
43
|
-
});
|
|
44
|
-
const x = /* @__PURE__ */ Object.assign({ "./components/fs-editor-markdown/index.vue": () => import("./index-0ae09bdb.mjs") }), C = {
|
|
45
|
-
install(e) {
|
|
46
|
-
c.vite.installAsyncComponents(e, x, null, /^.*\/([^\/]+)\/.*.vue$/, null);
|
|
47
|
-
}
|
|
48
|
-
}, A = {
|
|
49
|
-
install(e, t) {
|
|
50
|
-
e.use(E, t), e.use(C);
|
|
51
|
-
}
|
|
52
|
-
};
|
|
1
|
+
import { F as p } from "./index-4f72a34c.mjs";
|
|
2
|
+
import "@fast-crud/fast-crud";
|
|
3
|
+
import "vue";
|
|
4
|
+
import "mavon-editor";
|
|
53
5
|
export {
|
|
54
|
-
|
|
55
|
-
B as FsEditorMarkdownComponent
|
|
6
|
+
p as FsEditorMarkdown
|
|
56
7
|
};
|
|
8
|
+
//# sourceMappingURL=editor-markdown.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"editor-markdown.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
(function(e,
|
|
1
|
+
(function(e,s){typeof exports=="object"&&typeof module<"u"?s(exports,require("@fast-crud/fast-crud"),require("vue"),require("mavon-editor")):typeof define=="function"&&define.amd?define(["exports","@fast-crud/fast-crud","vue","mavon-editor"],s):(e=typeof globalThis<"u"?globalThis:e||self,s(e.FsExtends={},e.FastCrud,e.Vue,e.MavonEditor))})(this,function(e,s,o,m){"use strict";const v="";function f(){return{"editor-markdown":{form:{component:{name:"fs-editor-markdown"},col:{span:24}}}}}const p={install(){const{addTypes:t}=s.useTypes();t(f())}},y=o.defineComponent({name:"FsEditorMarkdown",inheritAttrs:!1}),_=o.defineComponent({...y,props:{modelValue:{},disabled:{type:Boolean},readonly:{type:Boolean}},emits:["update:modelValue","change","imgAdd"],setup(t,{emit:r}){const i=t,a=r,l=o.useAttrs(),E=m.mavonEditor,c=o.ref(),M=o.computed(()=>({...l,class:["fs-editor-markdown",l.class],modelValue:i.modelValue??"",...i.disabled||i.readonly?{editable:!1}:{},"onUpdate:modelValue":u,onImgAdd(n,d){a("imgAdd",n,d,c.value)},onChange(n,d){u(n),a("change",n,d)}}));function u(n){a("update:modelValue",n)}return(n,d)=>(o.openBlock(),o.createBlock(o.unref(E),o.mergeProps({class:"fs-editor-markdown",ref_key:"editorRef",ref:c},M.value),null,16))}}),x="",k=Object.freeze(Object.defineProperty({__proto__:null,default:_},Symbol.toStringTag,{value:"Module"})),g=Object.assign({"./components/fs-editor-markdown/index.vue":()=>Promise.resolve().then(()=>k)}),h={install(t){s.utils.vite.installAsyncComponents(t,g,null,/^.*\/([^\/]+)\/.*.vue$/,null)}},w={install(t,r){t.use(p,r),t.use(h)}};e.FsEditorMarkdown=w,Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})});
|
|
2
|
+
//# sourceMappingURL=editor-markdown.umd.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"editor-markdown.umd.js","sources":["../../src/editor/type/types.ts","../../src/editor/type/index.ts","../src/editor/components/fs-editor-markdown/index.vue","../../src/editor/index.ts"],"sourcesContent":[null,null,"<script lang=\"ts\">\nimport { defineComponent as __MACROS_defineComponent } from \"vue\";\nexport default /*#__PURE__*/ __MACROS_defineComponent({\n name: \"FsEditorMarkdown\",\n inheritAttrs: false \n});\n</script>\n<template>\n <MavonEditorComponent class=\"fs-editor-markdown\" ref=\"editorRef\" v-bind=\"editorProps\" />\n</template>\n\n<script lang=\"ts\" setup>\nimport mavonEditor from \"mavon-editor\";\nimport { computed, ref, useAttrs } from \"vue\";\n\n;\n\nconst props = defineProps<{\n modelValue?: string;\n disabled?: boolean;\n readonly?: boolean;\n}>();\n\nconst emits = defineEmits([\"update:modelValue\", \"change\", \"imgAdd\"]);\nconst attrs = useAttrs();\nconst MavonEditorComponent = mavonEditor.mavonEditor;\nconst editorRef = ref<any>();\n\nconst editorProps = computed(() => ({\n ...attrs,\n class: [\"fs-editor-markdown\", attrs.class],\n modelValue: props.modelValue ?? \"\",\n ...(props.disabled || props.readonly ? { editable: false } : {}),\n \"onUpdate:modelValue\": updateValue,\n onImgAdd(position: number, file: File) {\n emits(\"imgAdd\", position, file, editorRef.value);\n },\n onChange(value: string, render: string) {\n updateValue(value);\n emits(\"change\", value, render);\n }\n}));\n\nfunction updateValue(value: string) {\n emits(\"update:modelValue\", value);\n}\n</script>\n\n<style lang=\"less\">\n.fs-editor-markdown {\n width: 100%;\n}\n</style>\n",null],"names":["types","EcologyType","addTypes","useTypes","__default__","__MACROS_defineComponent","props","__props","emits","__emit","attrs","useAttrs","MavonEditorComponent","mavonEditor","editorRef","ref","editorProps","computed","updateValue","position","file","value","render","_openBlock","_createBlock","_unref","_mergeProps","asyncModules","FsEditorMarkdownComponents","app","utils","FsEditorMarkdown","options"],"mappings":"oYAAc,SAAAA,GAAA,CACL,MAAA,CACL,kBAAmB,CACjB,KAAM,CAAE,UAAW,CAAE,KAAM,oBAAsB,EAAE,IAAK,CAAE,KAAM,GAAM,CACvE,CAAA,CAEL,CCHe,MAAAC,EAAA,CACb,SAAO,CACC,KAAA,CAAE,SAAAC,GAAaC,EAAAA,WACrBD,EAASF,GAAO,CAClB,GCL2BI,EAAAC,EAAAA,gBAAyB,CACpD,KAAM,mBACN,aAAc,EAChB,CAAC,kKAYD,MAAMC,EAAQC,EAMRC,EAAQC,EACRC,EAAQC,EAAAA,WACRC,EAAuBC,EAAY,YACnCC,EAAYC,EAAAA,MAEZC,EAAcC,EAAAA,SAAS,KAAO,CAClC,GAAGP,EACH,MAAO,CAAC,qBAAsBA,EAAM,KAAK,EACzC,WAAYJ,EAAM,YAAc,GAChC,GAAIA,EAAM,UAAYA,EAAM,SAAW,CAAE,SAAU,EAAM,EAAI,CAAC,EAC9D,sBAAuBY,EACvB,SAASC,EAAkBC,EAAY,CACrCZ,EAAM,SAAUW,EAAUC,EAAMN,EAAU,KAAK,CACjD,EACA,SAASO,EAAeC,EAAgB,CACtCJ,EAAYG,CAAK,EACXb,EAAA,SAAUa,EAAOC,CAAM,CAC/B,CACA,EAAA,EAEF,SAASJ,EAAYG,EAAe,CAClCb,EAAM,oBAAqBa,CAAK,CAClC,eArCEE,EAAAA,UAAA,EAAAC,EAAA,YAAwFC,WAAxFC,EAAAA,WAAwF,CAAlE,MAAM,6BAAyB,YAAJ,IAAIZ,CAAoB,EAAAE,EAAW,KAAA,EAAA,KAAA,EAAA,kHCJhFW,iGACAC,EAA6B,CACjC,QAAQC,EAAQ,CACdC,QAAM,KAAK,uBAAuBD,EAAKF,EAAc,KAAM,yBAA0B,IAAI,CAC3F,GAGWI,EAAmB,CAC9B,QAAQF,EAAUG,EAAY,CACxBH,EAAA,IAAI5B,EAAa+B,CAAO,EAC5BH,EAAI,IAAID,CAA0B,CACpC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index-041be0e7.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { useTypes as u, utils as p } from "@fast-crud/fast-crud";
|
|
2
|
+
import { defineComponent as i, useAttrs as f, ref as _, computed as y, openBlock as k, createBlock as g, unref as v, mergeProps as w } from "vue";
|
|
3
|
+
import E from "mavon-editor";
|
|
4
|
+
function V() {
|
|
5
|
+
return {
|
|
6
|
+
"editor-markdown": {
|
|
7
|
+
form: { component: { name: "fs-editor-markdown" }, col: { span: 24 } }
|
|
8
|
+
}
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
const A = {
|
|
12
|
+
install() {
|
|
13
|
+
const { addTypes: e } = u();
|
|
14
|
+
e(V());
|
|
15
|
+
}
|
|
16
|
+
}, h = i({
|
|
17
|
+
name: "FsEditorMarkdown",
|
|
18
|
+
inheritAttrs: !1
|
|
19
|
+
}), F = /* @__PURE__ */ i({
|
|
20
|
+
...h,
|
|
21
|
+
props: {
|
|
22
|
+
modelValue: {},
|
|
23
|
+
disabled: { type: Boolean },
|
|
24
|
+
readonly: { type: Boolean }
|
|
25
|
+
},
|
|
26
|
+
emits: ["update:modelValue", "change", "imgAdd"],
|
|
27
|
+
setup(e, { emit: n }) {
|
|
28
|
+
const s = e, a = n, d = f(), m = E.mavonEditor, r = _(), c = y(() => ({
|
|
29
|
+
...d,
|
|
30
|
+
class: ["fs-editor-markdown", d.class],
|
|
31
|
+
modelValue: s.modelValue ?? "",
|
|
32
|
+
...s.disabled || s.readonly ? { editable: !1 } : {},
|
|
33
|
+
"onUpdate:modelValue": l,
|
|
34
|
+
onImgAdd(o, t) {
|
|
35
|
+
a("imgAdd", o, t, r.value);
|
|
36
|
+
},
|
|
37
|
+
onChange(o, t) {
|
|
38
|
+
l(o), a("change", o, t);
|
|
39
|
+
}
|
|
40
|
+
}));
|
|
41
|
+
function l(o) {
|
|
42
|
+
a("update:modelValue", o);
|
|
43
|
+
}
|
|
44
|
+
return (o, t) => (k(), g(v(m), w({
|
|
45
|
+
class: "fs-editor-markdown",
|
|
46
|
+
ref_key: "editorRef",
|
|
47
|
+
ref: r
|
|
48
|
+
}, c.value), null, 16));
|
|
49
|
+
}
|
|
50
|
+
});
|
|
51
|
+
const x = /* @__PURE__ */ Object.assign({ "./components/fs-editor-markdown/index.vue": () => import("./index-041be0e7.mjs") }), C = {
|
|
52
|
+
install(e) {
|
|
53
|
+
p.vite.installAsyncComponents(e, x, null, /^.*\/([^\/]+)\/.*.vue$/, null);
|
|
54
|
+
}
|
|
55
|
+
}, T = {
|
|
56
|
+
install(e, n) {
|
|
57
|
+
e.use(A, n), e.use(C);
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
export {
|
|
61
|
+
T as F,
|
|
62
|
+
F as _
|
|
63
|
+
};
|
|
64
|
+
//# sourceMappingURL=index-4f72a34c.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index-4f72a34c.mjs","sources":["../../src/editor/type/types.ts","../../src/editor/type/index.ts","../src/editor/components/fs-editor-markdown/index.vue","../../src/editor/index.ts"],"sourcesContent":[null,null,"<script lang=\"ts\">\nimport { defineComponent as __MACROS_defineComponent } from \"vue\";\nexport default /*#__PURE__*/ __MACROS_defineComponent({\n name: \"FsEditorMarkdown\",\n inheritAttrs: false \n});\n</script>\n<template>\n <MavonEditorComponent class=\"fs-editor-markdown\" ref=\"editorRef\" v-bind=\"editorProps\" />\n</template>\n\n<script lang=\"ts\" setup>\nimport mavonEditor from \"mavon-editor\";\nimport { computed, ref, useAttrs } from \"vue\";\n\n;\n\nconst props = defineProps<{\n modelValue?: string;\n disabled?: boolean;\n readonly?: boolean;\n}>();\n\nconst emits = defineEmits([\"update:modelValue\", \"change\", \"imgAdd\"]);\nconst attrs = useAttrs();\nconst MavonEditorComponent = mavonEditor.mavonEditor;\nconst editorRef = ref<any>();\n\nconst editorProps = computed(() => ({\n ...attrs,\n class: [\"fs-editor-markdown\", attrs.class],\n modelValue: props.modelValue ?? \"\",\n ...(props.disabled || props.readonly ? { editable: false } : {}),\n \"onUpdate:modelValue\": updateValue,\n onImgAdd(position: number, file: File) {\n emits(\"imgAdd\", position, file, editorRef.value);\n },\n onChange(value: string, render: string) {\n updateValue(value);\n emits(\"change\", value, render);\n }\n}));\n\nfunction updateValue(value: string) {\n emits(\"update:modelValue\", value);\n}\n</script>\n\n<style lang=\"less\">\n.fs-editor-markdown {\n width: 100%;\n}\n</style>\n",null],"names":["types","EcologyType","addTypes","useTypes","__default__","__MACROS_defineComponent","props","__props","emits","__emit","attrs","useAttrs","MavonEditorComponent","mavonEditor","editorRef","ref","editorProps","computed","updateValue","position","file","value","render","_openBlock","_createBlock","_unref","_mergeProps","asyncModules","FsEditorMarkdownComponents","app","utils","FsEditorMarkdown","options"],"mappings":";;;AAAc,SAAAA,IAAA;AACL,SAAA;AAAA,IACL,mBAAmB;AAAA,MACjB,MAAM,EAAE,WAAW,EAAE,MAAM,qBAAsB,GAAE,KAAK,EAAE,MAAM,KAAM;AAAA,IACvE;AAAA,EAAA;AAEL;ACHA,MAAeC,IAAA;AAAA,EACb,UAAO;AACC,UAAA,EAAE,UAAAC,MAAaC;AACrB,IAAAD,EAASF,GAAO;AAAA,EAClB;GCL2BI,IAAAC,EAAyB;AAAA,EACpD,MAAM;AAAA,EACN,cAAc;AAChB,CAAC;;;;;;;;;AAYD,UAAMC,IAAQC,GAMRC,IAAQC,GACRC,IAAQC,KACRC,IAAuBC,EAAY,aACnCC,IAAYC,KAEZC,IAAcC,EAAS,OAAO;AAAA,MAClC,GAAGP;AAAA,MACH,OAAO,CAAC,sBAAsBA,EAAM,KAAK;AAAA,MACzC,YAAYJ,EAAM,cAAc;AAAA,MAChC,GAAIA,EAAM,YAAYA,EAAM,WAAW,EAAE,UAAU,GAAM,IAAI,CAAC;AAAA,MAC9D,uBAAuBY;AAAA,MACvB,SAASC,GAAkBC,GAAY;AACrC,QAAAZ,EAAM,UAAUW,GAAUC,GAAMN,EAAU,KAAK;AAAA,MACjD;AAAA,MACA,SAASO,GAAeC,GAAgB;AACtC,QAAAJ,EAAYG,CAAK,GACXb,EAAA,UAAUa,GAAOC,CAAM;AAAA,MAC/B;AAAA,IACA,EAAA;AAEF,aAASJ,EAAYG,GAAe;AAClC,MAAAb,EAAM,qBAAqBa,CAAK;AAAA,IAClC;sBArCEE,EAAA,GAAAC,EAAwFC,MAAxFC,EAAwF;AAAA,MAAlE,OAAM;AAAA,eAAyB;AAAA,MAAJ,KAAIZ;AAAA,IAAoB,GAAAE,EAAW,KAAA,GAAA,MAAA,EAAA;AAAA;;ACJtF,MAAMW,0HACAC,IAA6B;AAAA,EACjC,QAAQC,GAAQ;AACd,IAAAC,EAAM,KAAK,uBAAuBD,GAAKF,GAAc,MAAM,0BAA0B,IAAI;AAAA,EAC3F;GAGWI,IAAmB;AAAA,EAC9B,QAAQF,GAAUG,GAAY;AACxB,IAAAH,EAAA,IAAI5B,GAAa+B,CAAO,GAC5BH,EAAI,IAAID,CAA0B;AAAA,EACpC;;"}
|
package/package.json
CHANGED
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fast-crud/editor-markdown",
|
|
3
|
-
"version": "1.28.
|
|
3
|
+
"version": "1.28.5",
|
|
4
4
|
"private": false,
|
|
5
5
|
"main": "./dist/editor-markdown.umd.js",
|
|
6
6
|
"module": "./dist/editor-markdown.mjs",
|
|
7
7
|
"types": "./dist/d/index.d.ts",
|
|
8
8
|
"scripts": {
|
|
9
|
-
"build": "
|
|
9
|
+
"build": " npm run tsc && npm run build:umd && npm run build:es",
|
|
10
10
|
"tsc": "vue-tsc --noEmit --skipLibCheck",
|
|
11
|
-
"lint-fix": "eslint --fix --ext .js --ext .vue src/"
|
|
11
|
+
"lint-fix": "eslint --fix --ext .js --ext .vue src/",
|
|
12
|
+
"build:umd": "vite build --mode umd",
|
|
13
|
+
"build:es": "vite build"
|
|
12
14
|
},
|
|
13
15
|
"author": "Greper",
|
|
14
16
|
"license": "MIT",
|
|
@@ -16,13 +18,54 @@
|
|
|
16
18
|
"mavon-editor": "3.0.2"
|
|
17
19
|
},
|
|
18
20
|
"devDependencies": {
|
|
19
|
-
"@fast-crud/fast-crud": "^1.28.
|
|
21
|
+
"@fast-crud/fast-crud": "^1.28.5",
|
|
22
|
+
"@ls-lint/ls-lint": "^2.0.1",
|
|
23
|
+
"@rollup/plugin-commonjs": "^25.0.3",
|
|
24
|
+
"@rollup/plugin-strip": "^3.0.2",
|
|
25
|
+
"@rollup/plugin-typescript": "^11.1.2",
|
|
26
|
+
"@types/chai": "^4.3.5",
|
|
27
|
+
"@types/file-saver": "^2.0.5",
|
|
28
|
+
"@types/humanize-duration": "^3.27.1",
|
|
29
|
+
"@types/lodash-es": "^4.17.8",
|
|
30
|
+
"@types/mocha": "^10.0.1",
|
|
31
|
+
"@typescript-eslint/eslint-plugin": "^6.2.1",
|
|
32
|
+
"@typescript-eslint/parser": "^6.2.1",
|
|
33
|
+
"@vitejs/plugin-legacy": "^4.1.1",
|
|
20
34
|
"@vitejs/plugin-vue": "^4.2.3",
|
|
35
|
+
"@vitejs/plugin-vue-jsx": "^3.0.1",
|
|
21
36
|
"@vue/compiler-sfc": "^3.3.4",
|
|
37
|
+
"autoprefixer": "^10.4.14",
|
|
38
|
+
"chai": "^4.3.7",
|
|
39
|
+
"copyfiles": "^2.4.1",
|
|
40
|
+
"eslint": "^8.46.0",
|
|
41
|
+
"eslint-config-prettier": "^8.10.0",
|
|
42
|
+
"eslint-plugin-import": "^2.28.0",
|
|
43
|
+
"eslint-plugin-node": "^11.1.0",
|
|
44
|
+
"eslint-plugin-prettier": "^5.0.0",
|
|
45
|
+
"eslint-plugin-promise": "^6.1.1",
|
|
46
|
+
"eslint-plugin-vue": "^9.16.1",
|
|
47
|
+
"esno": "^0.17.0",
|
|
48
|
+
"less": "^4.1.3",
|
|
49
|
+
"less-loader": "^11.1.3",
|
|
50
|
+
"libphonenumber-js": "^1.10.49",
|
|
51
|
+
"lint-staged": "^13.2.3",
|
|
52
|
+
"postcss": "^8.4.27",
|
|
53
|
+
"prettier": "^3.0.1",
|
|
54
|
+
"pretty-quick": "^3.1.3",
|
|
55
|
+
"rimraf": "^5.0.1",
|
|
56
|
+
"rollup-plugin-visualizer": "^5.9.2",
|
|
57
|
+
"stylelint": "^15.10.2",
|
|
58
|
+
"stylelint-config-prettier": "^9.0.5",
|
|
59
|
+
"stylelint-order": "^6.0.3",
|
|
60
|
+
"terser": "^5.19.2",
|
|
61
|
+
"ts-node": "^10.9.1",
|
|
22
62
|
"typescript": "5.1.6",
|
|
63
|
+
"unplugin-vue-define-options": "^1.3.14",
|
|
23
64
|
"vite": "^4.4.8",
|
|
65
|
+
"vite-plugin-compression": "^0.5.1",
|
|
24
66
|
"vue": "^3.3.4",
|
|
67
|
+
"vue-eslint-parser": "^9.3.1",
|
|
25
68
|
"vue-tsc": "^1.8.8"
|
|
26
69
|
},
|
|
27
|
-
"gitHead": "
|
|
70
|
+
"gitHead": "c9752ffa1ffe89c26712951c40e78fceb66336a6"
|
|
28
71
|
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<MavonEditorComponent class="fs-editor-markdown" ref="editorRef" v-bind="editorProps" />
|
|
3
|
+
</template>
|
|
4
|
+
|
|
5
|
+
<script lang="ts" setup>
|
|
6
|
+
import mavonEditor from "mavon-editor";
|
|
7
|
+
import { computed, ref, useAttrs } from "vue";
|
|
8
|
+
|
|
9
|
+
defineOptions({
|
|
10
|
+
name: "FsEditorMarkdown",
|
|
11
|
+
inheritAttrs: false
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
const props = defineProps<{
|
|
15
|
+
modelValue?: string;
|
|
16
|
+
disabled?: boolean;
|
|
17
|
+
readonly?: boolean;
|
|
18
|
+
}>();
|
|
19
|
+
|
|
20
|
+
const emits = defineEmits(["update:modelValue", "change", "imgAdd"]);
|
|
21
|
+
const attrs = useAttrs();
|
|
22
|
+
const MavonEditorComponent = mavonEditor.mavonEditor;
|
|
23
|
+
const editorRef = ref<any>();
|
|
24
|
+
|
|
25
|
+
const editorProps = computed(() => ({
|
|
26
|
+
...attrs,
|
|
27
|
+
class: ["fs-editor-markdown", attrs.class],
|
|
28
|
+
modelValue: props.modelValue ?? "",
|
|
29
|
+
...(props.disabled || props.readonly ? { editable: false } : {}),
|
|
30
|
+
"onUpdate:modelValue": updateValue,
|
|
31
|
+
onImgAdd(position: number, file: File) {
|
|
32
|
+
emits("imgAdd", position, file, editorRef.value);
|
|
33
|
+
},
|
|
34
|
+
onChange(value: string, render: string) {
|
|
35
|
+
updateValue(value);
|
|
36
|
+
emits("change", value, render);
|
|
37
|
+
}
|
|
38
|
+
}));
|
|
39
|
+
|
|
40
|
+
function updateValue(value: string) {
|
|
41
|
+
emits("update:modelValue", value);
|
|
42
|
+
}
|
|
43
|
+
</script>
|
|
44
|
+
|
|
45
|
+
<style lang="less">
|
|
46
|
+
.fs-editor-markdown {
|
|
47
|
+
width: 100%;
|
|
48
|
+
}
|
|
49
|
+
</style>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as FsEditorMarkdown } from "./components/fs-editor-markdown/index.vue";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./index";
|
package/src/index.umd.ts
ADDED
package/src/style.css
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@import "mavon-editor/dist/css/index.css";
|