@fast-crud/editor-markdown 1.28.2 → 1.28.4

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 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: ["plugin:vue/vue3-recommended", "plugin:@typescript-eslint/recommended", "plugin:prettier/recommended", "prettier"],
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/no-explicit-any": "off"
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
@@ -1,4 +1,5 @@
1
1
  {
2
+
2
3
  "trailingComma": "none",
3
4
  "printWidth": 120
4
5
  }
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.3](https://github.com/fast-crud/fast-crud/compare/v1.28.2...v1.28.3) (2026-08-01)
7
+
8
+ **Note:** Version bump only for package @fast-crud/editor-markdown
9
+
6
10
  ## [1.28.2](https://github.com/fast-crud/fast-crud/compare/v1.28.1...v1.28.2) (2026-08-01)
7
11
 
8
12
  ### Performance Improvements
@@ -0,0 +1 @@
1
+ export { default as FsEditorMarkdown } from "./components/fs-editor-markdown/index.vue";
@@ -0,0 +1,4 @@
1
+ export * from "./exports";
2
+ export declare const FsEditorMarkdown: {
3
+ install(app: any, options: any): void;
4
+ };
@@ -0,0 +1 @@
1
+ export * from "./index";
@@ -0,0 +1,4 @@
1
+ declare const _default: {
2
+ install(): void;
3
+ };
4
+ export default _default;
@@ -0,0 +1,12 @@
1
+ export default function (): {
2
+ "editor-markdown": {
3
+ form: {
4
+ component: {
5
+ name: string;
6
+ };
7
+ col: {
8
+ span: number;
9
+ };
10
+ };
11
+ };
12
+ };
@@ -0,0 +1,2 @@
1
+ import "./style.css";
2
+ export * from "./editor";
@@ -0,0 +1,2 @@
1
+ import "./style.css";
2
+ export * from "./editor/index.umd";
@@ -1,56 +1,8 @@
1
- import { useTypes as m, utils as c } from "@fast-crud/fast-crud";
2
- import { defineComponent as u, useAttrs as p, computed as f, openBlock as y, createBlock as _, unref as v, normalizeProps as k, guardReactiveProps as V } from "vue";
3
- import g from "mavon-editor";
4
- function w() {
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
- A as FsEditorMarkdown,
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,t){typeof exports=="object"&&typeof module<"u"?t(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"],t):(e=typeof globalThis<"u"?globalThis:e||self,t(e.FsEditorMarkdown={},e.FastCrud,e.Vue,e.MavonEditor))})(this,function(e,t,o,p){"use strict";const w="";function m(){return{"editor-markdown":{form:{component:{name:"fs-editor-markdown"},col:{span:24}}}}}const f={install(){const{addTypes:n}=t.useTypes();n(m())}},i=o.defineComponent({inheritAttrs:!1,__name:"index",props:{modelValue:{},disabled:{type:Boolean},readonly:{type:Boolean}},emits:["update:modelValue","change"],setup(n,{emit:r}){const d=n,l=r,u=o.useAttrs(),M=p.mavonEditor,h=o.computed(()=>({...u,class:["fs-editor-markdown",u.class],value:d.modelValue??"",modelValue:d.modelValue??"",...d.disabled||d.readonly?{editable:!1}:{},onInput:a,"onUpdate:modelValue":a,onChange(s,c){a(s),l("change",s,c)}}));function a(s){l("update:modelValue",s)}return(s,c)=>(o.openBlock(),o.createBlock(o.unref(M),o.normalizeProps(o.guardReactiveProps(h.value)),null,16))}}),E="",y=Object.freeze(Object.defineProperty({__proto__:null,default:i},Symbol.toStringTag,{value:"Module"})),_=Object.assign({"./components/fs-editor-markdown/index.vue":()=>Promise.resolve().then(()=>y)}),k={install(n){t.utils.vite.installAsyncComponents(n,_,null,/^.*\/([^\/]+)\/.*.vue$/,null)}},v={install(n,r){n.use(f,r),n.use(k)}};e.FsEditorMarkdown=v,e.FsEditorMarkdownComponent=i,Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})});
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,8 @@
1
+ import { _ as o } from "./index-4f72a34c.mjs";
2
+ import "@fast-crud/fast-crud";
3
+ import "vue";
4
+ import "mavon-editor";
5
+ export {
6
+ o as default
7
+ };
8
+ //# sourceMappingURL=index-041be0e7.mjs.map
@@ -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.2",
3
+ "version": "1.28.4",
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": "vite build --mode umd && vite 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.2",
21
+ "@fast-crud/fast-crud": "^1.28.3",
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": "f696f7577208687e3561023c445349303400bca2"
70
+ "gitHead": "d969ff4c31f80a6944f1efe831a8f79392ffaad1"
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";
@@ -0,0 +1,7 @@
1
+ export default function () {
2
+ return {
3
+ "editor-markdown": {
4
+ form: { component: { name: "fs-editor-markdown" }, col: { span: 24 } }
5
+ }
6
+ };
7
+ }
@@ -0,0 +1,3 @@
1
+ import "./style.css";
2
+
3
+ export * from "./editor/index.umd";
package/src/style.css ADDED
@@ -0,0 +1 @@
1
+ @import "mavon-editor/dist/css/index.css";
package/tsconfig.json CHANGED
@@ -1,17 +1,49 @@
1
1
  {
2
2
  "compilerOptions": {
3
+ "allowJs": true,
3
4
  "noImplicitAny": false,
4
5
  "target": "esnext",
5
6
  "module": "esnext",
6
7
  "strict": true,
8
+ "jsx": "preserve",
9
+ "jsxImportSource": "vue",
10
+ "verbatimModuleSyntax":false ,
11
+ "importHelpers": true,
7
12
  "moduleResolution": "node",
13
+ "experimentalDecorators": true,
8
14
  "skipLibCheck": true,
9
15
  "esModuleInterop": true,
10
16
  "allowSyntheticDefaultImports": true,
17
+ "strictNullChecks" :false,
11
18
  "sourceMap": true,
12
- "types": ["vite/client"],
13
- "lib": ["esnext", "dom", "dom.iterable"]
19
+ "baseUrl": ".",
20
+ "outDir": "./dist/ts",
21
+ "types": [
22
+ "vite/client",
23
+ "mocha",
24
+ "chai",
25
+ "unplugin-vue-define-options/macros-global"
26
+ ],
27
+ "paths": {
28
+ "@/*": [
29
+ "src/*"
30
+ ]
31
+ },
32
+ "lib": [
33
+ "esnext",
34
+ "dom",
35
+ "dom.iterable",
36
+ "scripthost"
37
+ ]
14
38
  },
15
- "include": ["src/**/*.ts", "src/**/*.vue"],
16
- "exclude": ["node_modules"]
39
+ "include": [
40
+ "src/**/*.ts",
41
+ "src/**/*.tsx",
42
+ "src/**/*.vue",
43
+ "tests/**/*.ts",
44
+ "tests/**/*.tsx"
45
+ ],
46
+ "exclude": [
47
+ "node_modules"
48
+ ]
17
49
  }
package/vite.config.js CHANGED
@@ -1,26 +1,107 @@
1
1
  import vue from "@vitejs/plugin-vue";
2
+ import vueJsx from "@vitejs/plugin-vue-jsx";
2
3
  import path from "path";
3
-
4
+ import { visualizer } from "rollup-plugin-visualizer";
5
+ import strip from "@rollup/plugin-strip";
6
+ import DefineOptions from "unplugin-vue-define-options/vite";
7
+ import typescript from "@rollup/plugin-typescript";
8
+ import _ from "lodash";
4
9
  const { resolve } = path;
10
+ // https://vitejs.dev/config/
11
+ export default ({ command, mode }) => {
12
+ let build = {};
13
+ if (mode === "umd") {
14
+ build = {
15
+ build: {
16
+ emptyOutDir: true,
17
+ lib: {
18
+ entry: resolve(__dirname, "src/index.umd.ts"),
19
+ formats: ["umd"]
20
+ },
21
+ rollupOptions: {
22
+ output: {
23
+ manualChunks: null
24
+ }
25
+ }
26
+ }
27
+ };
28
+ }
5
29
 
6
- export default ({ mode }) => ({
7
- plugins: [vue()],
8
- build: {
9
- emptyOutDir: mode === "umd",
10
- lib: {
11
- entry: resolve(__dirname, mode === "umd" ? "src/index.umd.ts" : "src/index.ts"),
12
- name: "FsEditorMarkdown",
13
- formats: [mode === "umd" ? "umd" : "es"]
30
+ const options = {
31
+ base: "./",
32
+ plugins: [DefineOptions(), vueJsx(), vue()],
33
+ esbuild: {
34
+ drop: command === "build" ? ["debugger"] : [],
35
+ jsxFactory: "h",
36
+ jsxFragment: "Fragment",
37
+ pure: ["console.log", "debugger"]
14
38
  },
15
- rollupOptions: {
16
- external: ["vue", "@fast-crud/fast-crud", "mavon-editor"],
17
- output: {
18
- globals: {
19
- vue: "Vue",
20
- "@fast-crud/fast-crud": "FastCrud",
21
- "mavon-editor": "MavonEditor"
39
+ build: {
40
+ emptyOutDir: false,
41
+ lib: {
42
+ entry: resolve(__dirname, "src/index.ts"),
43
+ name: "FsExtends",
44
+ formats: ["es"]
45
+ },
46
+ // cssCodeSplit: true,
47
+ sourcemap: true,
48
+ // minify: false,
49
+ rollupOptions: {
50
+ plugins: [
51
+ strip(),
52
+ visualizer(),
53
+ typescript({
54
+ target: "es2020",
55
+ rootDir: "src",
56
+ declaration: true,
57
+ declarationDir: "dist/d",
58
+ exclude: "./node_modules/**",
59
+ allowSyntheticDefaultImports: true
60
+ })
61
+ ],
62
+ // make sure to externalize deps that shouldn't be bundled
63
+ // into your library
64
+ external: [
65
+ "vue",
66
+ "lodash-es",
67
+ "dayjs",
68
+ "vue-i18n",
69
+ "vuedraggable",
70
+ "axios",
71
+ "qiniu-js",
72
+ "@fast-crud/fast-crud",
73
+ "@fast-crud/ui-interface",
74
+ "mavon-editor"
75
+ ],
76
+ output: {
77
+ manualChunks(id) {
78
+ if (id.includes("src/components") && id.lastIndexOf(".vue") > 0) {
79
+ let name = id.substring(id.lastIndexOf("/") + 1);
80
+ name = name.substring(0, name.indexOf("."));
81
+ return "components/" + name;
82
+ }
83
+ },
84
+ // Provide global variables to use in the UMD build
85
+ // for externalized deps
86
+ globals: {
87
+ vue: "Vue",
88
+ "lodash-es": "_",
89
+ dayjs: "dayjs",
90
+ "vue-i18n": "VueI18n",
91
+ axios: "axios",
92
+ vuedraggable: "vuedraggable",
93
+ "@fast-crud/fast-crud": "FastCrud",
94
+ "ali-oss": "OSS",
95
+ "cos-js-sdk-v5": "COS",
96
+ "qiniu-js": "qiniu",
97
+ "@fast-crud/ui-interface": "FsUiInterface",
98
+ "mavon-editor": "MavonEditor"
99
+ }
22
100
  }
23
101
  }
24
102
  }
25
- }
26
- });
103
+ };
104
+
105
+ _.merge(options, build);
106
+ return options;
107
+ };
@@ -1,7 +0,0 @@
1
- import { FsEditorMarkdownComponent as r } from "./editor-markdown.mjs";
2
- import "@fast-crud/fast-crud";
3
- import "vue";
4
- import "mavon-editor";
5
- export {
6
- r as default
7
- };