@fangzhongya/vue-archive 0.0.73 → 0.0.75

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.
@@ -0,0 +1,65 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+
30
+ // packages/node/init.ts
31
+ var init_exports = {};
32
+ __export(init_exports, {
33
+ init: () => init
34
+ });
35
+ module.exports = __toCommonJS(init_exports);
36
+ var import_editor = require("monaco-editor/esm/vs/editor/editor.main");
37
+ var import_editor2 = __toESM(require("monaco-editor/esm/vs/editor/editor.worker?worker"), 1);
38
+ var import_json = __toESM(require("monaco-editor/esm/vs/language/json/json.worker?worker"), 1);
39
+ var import_css = __toESM(require("monaco-editor/esm/vs/language/css/css.worker?worker"), 1);
40
+ var import_html = __toESM(require("monaco-editor/esm/vs/language/html/html.worker?worker"), 1);
41
+ var import_ts = __toESM(require("monaco-editor/esm/vs/language/typescript/ts.worker?worker"), 1);
42
+ function init() {
43
+ self.MonacoEnvironment = {
44
+ getWorker(_, label) {
45
+ if (label === "json") {
46
+ return new import_json.default();
47
+ }
48
+ if (label === "css" || label === "scss" || label === "less") {
49
+ return new import_css.default();
50
+ }
51
+ if (label === "html" || label === "handlebars" || label === "razor") {
52
+ return new import_html.default();
53
+ }
54
+ if (label === "typescript" || label === "javascript") {
55
+ return new import_ts.default();
56
+ }
57
+ return new import_editor2.default();
58
+ }
59
+ };
60
+ import_editor.languages.typescript.typescriptDefaults.setEagerModelSync(true);
61
+ }
62
+ // Annotate the CommonJS export names for ESM import in node:
63
+ 0 && (module.exports = {
64
+ init
65
+ });
@@ -0,0 +1,3 @@
1
+ declare function init(): void;
2
+
3
+ export { init };
@@ -0,0 +1,3 @@
1
+ declare function init(): void;
2
+
3
+ export { init };
@@ -0,0 +1,30 @@
1
+ // packages/node/init.ts
2
+ import { languages } from "monaco-editor/esm/vs/editor/editor.main";
3
+ import editorWorker from "monaco-editor/esm/vs/editor/editor.worker?worker";
4
+ import jsonWorker from "monaco-editor/esm/vs/language/json/json.worker?worker";
5
+ import cssWorker from "monaco-editor/esm/vs/language/css/css.worker?worker";
6
+ import htmlWorker from "monaco-editor/esm/vs/language/html/html.worker?worker";
7
+ import tsWorker from "monaco-editor/esm/vs/language/typescript/ts.worker?worker";
8
+ function init() {
9
+ self.MonacoEnvironment = {
10
+ getWorker(_, label) {
11
+ if (label === "json") {
12
+ return new jsonWorker();
13
+ }
14
+ if (label === "css" || label === "scss" || label === "less") {
15
+ return new cssWorker();
16
+ }
17
+ if (label === "html" || label === "handlebars" || label === "razor") {
18
+ return new htmlWorker();
19
+ }
20
+ if (label === "typescript" || label === "javascript") {
21
+ return new tsWorker();
22
+ }
23
+ return new editorWorker();
24
+ }
25
+ };
26
+ languages.typescript.typescriptDefaults.setEagerModelSync(true);
27
+ }
28
+ export {
29
+ init
30
+ };
@@ -16,3 +16,44 @@ export declare function getHtml(parent: Element, obj: CreateStateOptions): Edito
16
16
  export declare function getJson(parent: Element, obj: CreateStateOptions): EditorView;
17
17
  export declare function getCss(parent: Element, obj: CreateStateOptions): EditorView;
18
18
  export {};
19
+ >): Promise<T[]>;
20
+ fromAsync<T, U>(iterableOrArrayLike: AsyncIterable<T> | Iterable<T> | ArrayLike<T>, mapFn: (value: Awaited<T>, index: number) => U, thisArg?: any): Promise<Awaited<U>[]>;
21
+ readonly [Symbol.species]: ArrayConstructor;
22
+ };
23
+ };
24
+ }>, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
25
+ "update:modelValue": (...args: any[]) => void;
26
+ }, string, PublicProps, Readonly< ExtractPropTypes<{
27
+ modelValue: {
28
+ type: StringConstructor;
29
+ default: string;
30
+ };
31
+ format: {
32
+ type: StringConstructor;
33
+ };
34
+ options: {
35
+ type: {
36
+ (arrayLength: number): string[];
37
+ (...items: string[]): string[];
38
+ new (arrayLength: number): string[];
39
+ new (...items: string[]): string[];
40
+ isArray(arg: any): arg is any[];
41
+ readonly prototype: any[];
42
+ from<T>(arrayLike: ArrayLike<T>): T[];
43
+ from<T, U>(arrayLike: ArrayLike<T>, mapfn: (v: T, k: number) => U, thisArg?: any): U[];
44
+ from<T>(iterable: Iterable<T> | ArrayLike<T>): T[];
45
+ from<T, U>(iterable: Iterable<T> | ArrayLike<T>, mapfn: (v: T, k: number) => U, thisArg?: any): U[];
46
+ of<T>(...items: T[]): T[];
47
+ fromAsync<T>(iterableOrArrayLike: AsyncIterable<T> | Iterable<T | PromiseLike<T>> | ArrayLike<T | PromiseLike<T>>): Promise<T[]>;
48
+ fromAsync<T, U>(iterableOrArrayLike: AsyncIterable<T> | Iterable<T> | ArrayLike<T>, mapFn: (value: Awaited<T>, index: number) => U, thisArg?: any): Promise<Awaited<U>[]>;
49
+ readonly [Symbol.species]: ArrayConstructor;
50
+ };
51
+ };
52
+ }>> & Readonly<{
53
+ "onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
54
+ }>, {
55
+ modelValue: string;
56
+ }, {}, {}, {}, string, ComponentProvideOptions, true, {
57
+ refText: HTMLDivElement;
58
+ }, HTMLDivElement>;
59
+ export default _default;
@@ -1,5 +1,5 @@
1
- "use strict";const t=require("vue"),m=require("../../../../../directives/adjust/index.cjs"),l=require("./editor.cjs"),d=require("./init.cjs"),v={class:"editor-div"},p=t.defineComponent({__name:"editor",props:{modelValue:{type:String,default:`
1
+ "use strict";const t=require("vue"),m=require("../../../../../directives/adjust/index.cjs"),r=require("./editor.cjs"),d={class:"editor-div"},v=t.defineComponent({__name:"editor",props:{modelValue:{type:String,default:`
2
2
 
3
3
 
4
4
 
5
- `},format:{type:String},options:{type:Array}},emits:["update:modelValue"],setup(n,{emit:u}){const e=n,i=u,s=t.ref(),r=t.shallowRef();function c(){d.init();const o=e.modelValue;e.format==="js"||e.format==="ts"?r.value=l.getJs(s.value,o):e.format==="css"||e.format==="scss"?r.value=l.getCss(s.value,o):e.format==="html"||e.format==="vue"?r.value=l.getHtml(s.value,o):e.format==="json"&&(r.value=l.getJson(s.value,o))}function f(o){o&&i("update:modelValue",o)}return t.watch(()=>e.modelValue,()=>{r.value?.setValue(e.modelValue)}),t.onMounted(()=>{c(),r.value?.onDidBlurEditorText(o=>{if(r.value){const a=r.value.getValue();f(a)}})}),(o,a)=>t.withDirectives((t.openBlock(),t.createElementBlock("div",v,[t.createElementVNode("div",{class:"editor-code",ref_key:"refText",ref:s},null,512)])),[[t.unref(m),{bottom:{}}]])}});module.exports=p;
5
+ `},format:{type:String},options:{type:Array}},emits:["update:modelValue"],setup(u,{emit:n}){const e=u,i=n,s=t.ref(),l=t.shallowRef();function c(){const o=e.modelValue;e.format==="js"||e.format==="ts"?l.value=r.getJs(s.value,o):e.format==="css"||e.format==="scss"?l.value=r.getCss(s.value,o):e.format==="html"||e.format==="vue"?l.value=r.getHtml(s.value,o):e.format==="json"&&(l.value=r.getJson(s.value,o))}function f(o){o&&i("update:modelValue",o)}return t.watch(()=>e.modelValue,()=>{l.value?.setValue(e.modelValue)}),t.onMounted(()=>{c(),l.value?.onDidBlurEditorText(o=>{if(l.value){const a=l.value.getValue();f(a)}})}),(o,a)=>t.withDirectives((t.openBlock(),t.createElementBlock("div",d,[t.createElementVNode("div",{class:"editor-code",ref_key:"refText",ref:s},null,512)])),[[t.unref(m),{bottom:{}}]])}});module.exports=v;
@@ -1,8 +1,7 @@
1
1
  import { defineComponent as m, ref as f, shallowRef as c, watch as d, onMounted as v, withDirectives as p, createElementBlock as V, openBlock as _, createElementVNode as g, unref as h } from "vue";
2
2
  import x from "../../../../../directives/adjust/index.js";
3
3
  import { getJs as y, getCss as B, getHtml as j, getJson as k } from "./editor.js";
4
- import { init as w } from "./init.js";
5
- const E = { class: "editor-div" }, J = /* @__PURE__ */ m({
4
+ const w = { class: "editor-div" }, C = /* @__PURE__ */ m({
6
5
  __name: "editor",
7
6
  props: {
8
7
  modelValue: {
@@ -23,12 +22,11 @@ const E = { class: "editor-div" }, J = /* @__PURE__ */ m({
23
22
  emits: ["update:modelValue"],
24
23
  setup(r, { emit: s }) {
25
24
  const e = r, u = s, l = f(), o = c();
26
- function i() {
27
- w();
25
+ function n() {
28
26
  const t = e.modelValue;
29
27
  e.format === "js" || e.format === "ts" ? o.value = y(l.value, t) : e.format === "css" || e.format === "scss" ? o.value = B(l.value, t) : e.format === "html" || e.format === "vue" ? o.value = j(l.value, t) : e.format === "json" && (o.value = k(l.value, t));
30
28
  }
31
- function n(t) {
29
+ function i(t) {
32
30
  t && u("update:modelValue", t);
33
31
  }
34
32
  return d(
@@ -37,13 +35,13 @@ const E = { class: "editor-div" }, J = /* @__PURE__ */ m({
37
35
  o.value?.setValue(e.modelValue);
38
36
  }
39
37
  ), v(() => {
40
- i(), o.value?.onDidBlurEditorText((t) => {
38
+ n(), o.value?.onDidBlurEditorText((t) => {
41
39
  if (o.value) {
42
40
  const a = o.value.getValue();
43
- n(a);
41
+ i(a);
44
42
  }
45
43
  });
46
- }), (t, a) => p((_(), V("div", E, [
44
+ }), (t, a) => p((_(), V("div", w, [
47
45
  g("div", {
48
46
  class: "editor-code",
49
47
  ref_key: "refText",
@@ -57,5 +55,5 @@ const E = { class: "editor-div" }, J = /* @__PURE__ */ m({
57
55
  }
58
56
  });
59
57
  export {
60
- J as default
58
+ C as default
61
59
  };
@@ -1 +1,4 @@
1
+ /**
2
+ * 初始化
3
+ */
1
4
  export declare function init(): void;
@@ -0,0 +1 @@
1
+ export declare function init(): void;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@fangzhongya/vue-archive",
3
3
  "private": false,
4
- "version": "0.0.73",
4
+ "version": "0.0.75",
5
5
  "type": "module",
6
6
  "description ": "vue 组件注释生成文档",
7
7
  "author": "fangzhongya ",
@@ -65,6 +65,11 @@
65
65
  "require": "./dist/node/index.cjs",
66
66
  "import": "./dist/node/index.js"
67
67
  },
68
+ "./init": {
69
+ "types": "./dist/node/init.d.ts",
70
+ "require": "./dist/node/init.cjs",
71
+ "import": "./dist/node/init.js"
72
+ },
68
73
  ".": {
69
74
  "require": {
70
75
  "types": "./dist/packages/index.d.cts",
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("monaco-editor/esm/vs/editor/editor.main"),t=require("monaco-editor/esm/vs/editor/editor.worker?worker"),n=require("monaco-editor/esm/vs/language/json/json.worker?worker"),s=require("monaco-editor/esm/vs/language/css/css.worker?worker"),i=require("monaco-editor/esm/vs/language/html/html.worker?worker"),o=require("monaco-editor/esm/vs/language/typescript/ts.worker?worker");function c(){self.MonacoEnvironment={getWorker(u,r){return r==="json"?new n:r==="css"||r==="scss"||r==="less"?new s:r==="html"||r==="handlebars"||r==="razor"?new i:r==="typescript"||r==="javascript"?new o:new t}},e.languages.typescript.typescriptDefaults.setEagerModelSync(!0)}exports.init=c;
@@ -1,16 +0,0 @@
1
- import { languages as t } from "monaco-editor/esm/vs/editor/editor.main";
2
- import o from "monaco-editor/esm/vs/editor/editor.worker?worker";
3
- import e from "monaco-editor/esm/vs/language/json/json.worker?worker";
4
- import n from "monaco-editor/esm/vs/language/css/css.worker?worker";
5
- import s from "monaco-editor/esm/vs/language/html/html.worker?worker";
6
- import i from "monaco-editor/esm/vs/language/typescript/ts.worker?worker";
7
- function w() {
8
- self.MonacoEnvironment = {
9
- getWorker(m, r) {
10
- return r === "json" ? new e() : r === "css" || r === "scss" || r === "less" ? new n() : r === "html" || r === "handlebars" || r === "razor" ? new s() : r === "typescript" || r === "javascript" ? new i() : new o();
11
- }
12
- }, t.typescript.typescriptDefaults.setEagerModelSync(!0);
13
- }
14
- export {
15
- w as init
16
- };