ll-plus 2.1.8 → 2.1.10

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.
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","sources":["../../../../packages/components/code-editor/index.ts"],"sourcesContent":["import { withInstall } from '@ll-plus/utils'\n\nimport CodeEditor from './src/code-editor.vue'\n\nexport const LlCodeEditor = withInstall(CodeEditor)\nexport default LlCodeEditor\nexport * from './src/config'\n\ndeclare module 'vue' {\n export interface GlobalComponents {\n LlCodeEditor: typeof CodeEditor\n }\n}\n"],"names":[],"mappings":";;;;;;;;AAIa,MAAA,YAAA,GAAe,YAAY,UAAU;;;;"}
1
+ {"version":3,"file":"index.mjs","sources":["../../../../packages/components/code-editor/index.ts"],"sourcesContent":["import { withInstall } from '@ll-plus/utils'\n\nimport CodeEditor from './src/code-editor.vue'\n\nexport const LlCodeEditor = withInstall(CodeEditor)\nexport default LlCodeEditor\nexport * from './src/config'\ndeclare module 'vue' {\n export interface GlobalComponents {\n LlCodeEditor: typeof CodeEditor\n }\n}\n"],"names":[],"mappings":";;;;;;;;AAIa,MAAA,YAAA,GAAe,YAAY,UAAU;;;;"}
@@ -2,11 +2,6 @@ import { defineComponent, ref, watch, onBeforeUnmount, onMounted, openBlock, cre
2
2
  import './config/index.mjs';
3
3
  import '../../../utils/index.mjs';
4
4
  import * as monaco from 'monaco-editor';
5
- import EditorWorker from 'monaco-editor/esm/vs/editor/editor.worker?worker';
6
- import jsonWorker from 'monaco-editor/esm/vs/language/json/json.worker?worker';
7
- import cssWorker from 'monaco-editor/esm/vs/language/css/css.worker?worker';
8
- import htmlWorker from 'monaco-editor/esm/vs/language/html/html.worker?worker';
9
- import tsWorker from 'monaco-editor/esm/vs/language/typescript/ts.worker?worker';
10
5
  import { codeEditorProps, codeEditorEmits, defaultOptions } from './config/code-editor.mjs';
11
6
  import { createNamespace } from '../../../utils/create-namespace.mjs';
12
7
  import { codeThemeList } from './config/code-theme-list.mjs';
@@ -21,38 +16,50 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
21
16
  const props = __props;
22
17
  const emits = __emit;
23
18
  const bem = createNamespace("code-editor");
24
- self.MonacoEnvironment = {
25
- getWorkerUrl: function(moduleId, label) {
26
- if (label === "json") {
27
- return "monaco-editor/esm/vs/language/json/json.worker.js";
28
- }
29
- if (label === "css") {
30
- return "monaco-editor/esm/vs/language/css/css.worker.js";
31
- }
32
- if (label === "html") {
33
- return "monaco-editor/esm/vs/language/html/html.worker.js";
34
- }
35
- if (label === "typescript" || label === "javascript") {
36
- return "monaco-editor/esm/vs/language/typescript/ts.worker.js";
37
- }
38
- return "monaco-editor/esm/vs/editor/editor.worker.js";
39
- }
40
- };
41
19
  self.MonacoEnvironment = {
42
20
  getWorker(_, label) {
43
21
  if (label === "json") {
44
- return new jsonWorker();
22
+ return new Worker(
23
+ new URL(
24
+ "monaco-editor/esm/vs/language/json/json.worker.js",
25
+ import.meta.url
26
+ ),
27
+ { type: "module" }
28
+ );
45
29
  }
46
30
  if (["css", "scss", "less"].includes(label)) {
47
- return new cssWorker();
31
+ return new Worker(
32
+ new URL(
33
+ "monaco-editor/esm/vs/language/css/css.worker.js",
34
+ import.meta.url
35
+ ),
36
+ { type: "module" }
37
+ );
48
38
  }
49
39
  if (["html", "handlebars", "razor"].includes(label)) {
50
- return new htmlWorker();
40
+ return new Worker(
41
+ new URL(
42
+ "monaco-editor/esm/vs/language/html/html.worker.js",
43
+ import.meta.url
44
+ ),
45
+ { type: "module" }
46
+ );
51
47
  }
52
48
  if (["typescript", "javascript"].includes(label)) {
53
- return new tsWorker();
49
+ return new Worker(
50
+ new URL(
51
+ "monaco-editor/esm/vs/language/typescript/ts.worker.js",
52
+ import.meta.url
53
+ ),
54
+ { type: "module" }
55
+ );
54
56
  }
55
- return new EditorWorker();
57
+ return new Worker(
58
+ new URL("monaco-editor/esm/vs/editor/editor.worker.js", import.meta.url),
59
+ {
60
+ type: "module"
61
+ }
62
+ );
56
63
  }
57
64
  };
58
65
  let editor;
@@ -1 +1 @@
1
- {"version":3,"file":"code-editor.vue2.mjs","sources":["../../../../../packages/components/code-editor/src/code-editor.vue"],"sourcesContent":["<template>\n <div\n ref=\"codeEditBox\"\n :class=\"bem.b()\"\n :style=\"{\n width: props.width,\n height: props.height\n }\"\n />\n</template>\n\n<script lang=\"ts\" setup>\nimport { onBeforeUnmount, onMounted, ref, watch } from 'vue'\nimport {\n codeEditorProps,\n codeEditorEmits,\n defaultOptions,\n codeThemeList\n} from './config'\nimport { createNamespace } from '@ll-plus/utils'\n// @ts-ignore\nimport * as monaco from 'monaco-editor'\n// @ts-ignore\nimport EditorWorker from 'monaco-editor/esm/vs/editor/editor.worker?worker'\n// @ts-ignore\nimport jsonWorker from 'monaco-editor/esm/vs/language/json/json.worker?worker'\n// @ts-ignore\nimport cssWorker from 'monaco-editor/esm/vs/language/css/css.worker?worker'\n// @ts-ignore\nimport htmlWorker from 'monaco-editor/esm/vs/language/html/html.worker?worker'\n// @ts-ignore\nimport tsWorker from 'monaco-editor/esm/vs/language/typescript/ts.worker?worker'\n\ndefineOptions({ name: 'LlCodeEditor' })\n\nconst props = defineProps(codeEditorProps)\nconst emits = defineEmits(codeEditorEmits)\nconst bem = createNamespace('code-editor')\nself.MonacoEnvironment = {\n getWorkerUrl: function (moduleId, label) {\n if (label === 'json') {\n return 'monaco-editor/esm/vs/language/json/json.worker.js'\n }\n if (label === 'css') {\n return 'monaco-editor/esm/vs/language/css/css.worker.js'\n }\n if (label === 'html') {\n return 'monaco-editor/esm/vs/language/html/html.worker.js'\n }\n if (label === 'typescript' || label === 'javascript') {\n return 'monaco-editor/esm/vs/language/typescript/ts.worker.js'\n }\n return 'monaco-editor/esm/vs/editor/editor.worker.js'\n }\n}\nself.MonacoEnvironment = {\n getWorker(_: string, label: string) {\n if (label === 'json') {\n return new jsonWorker()\n }\n if (['css', 'scss', 'less'].includes(label)) {\n return new cssWorker()\n }\n if (['html', 'handlebars', 'razor'].includes(label)) {\n return new htmlWorker()\n }\n if (['typescript', 'javascript'].includes(label)) {\n return new tsWorker()\n }\n return new EditorWorker()\n }\n}\nlet editor: monaco.editor.IStandaloneCodeEditor\n\nconst codeEditBox = ref()\nconst init = () => {\n monaco.languages.typescript.javascriptDefaults.setDiagnosticsOptions({\n noSemanticValidation: true,\n noSyntaxValidation: false\n })\n monaco.languages.typescript.javascriptDefaults.setCompilerOptions({\n target: monaco.languages.typescript.ScriptTarget.ES2020,\n allowNonTsExtensions: true\n })\n\n editor = monaco.editor.create(codeEditBox.value, {\n value: props.value,\n language: props.language,\n theme: props.theme,\n ...defaultOptions,\n ...props.options\n })\n handleChangeTheme(props.theme)\n // 监听值的变化\n editor.onDidChangeModelContent(() => {\n const value = editor.getValue() //给父组件实时返回最新文本\n emits('update:value', value)\n emits('change', value)\n })\n\n emits('editor-mounted', editor)\n}\nconst handleChangeTheme = async (theme: string) => {\n const find = codeThemeList.find(item => item.value === theme)\n if (find) {\n const themeData = {\n ...find.data\n } as monaco.editor.IStandaloneThemeData\n try {\n monaco.editor.defineTheme(theme, themeData)\n monaco.editor.setTheme(theme)\n } catch (error) {\n monaco.editor.setTheme('vs')\n }\n } else {\n monaco.editor.setTheme('vs')\n }\n}\nwatch(\n () => props.value,\n newValue => {\n if (editor) {\n const value = editor.getValue()\n if (newValue !== value) {\n editor.setValue(newValue)\n }\n }\n }\n)\n\nwatch(\n () => props.options,\n newValue => {\n editor.updateOptions(newValue)\n },\n { deep: true }\n)\n\nwatch(\n () => props.language,\n newValue => {\n monaco.editor.setModelLanguage(editor.getModel()!, newValue)\n }\n)\n\nonBeforeUnmount(() => {\n editor.dispose()\n})\n\nonMounted(() => {\n init()\n})\n</script>\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;AAmCA,IAAA,MAAM,KAAQ,GAAA,OAAA,CAAA;AACd,IAAA,MAAM,KAAQ,GAAA,MAAA,CAAA;AACd,IAAM,MAAA,GAAA,GAAM,gBAAgB,aAAa,CA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,CAAA;AAED,IAAA,SAAA,CAAU,MAAM;AACd,MAAK,IAAA,EAAA,CAAA;AAAA,KACN,CAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"code-editor.vue2.mjs","sources":["../../../../../packages/components/code-editor/src/code-editor.vue"],"sourcesContent":["<template>\n <div\n ref=\"codeEditBox\"\n :class=\"bem.b()\"\n :style=\"{\n width: props.width,\n height: props.height\n }\"\n />\n</template>\n\n<script lang=\"ts\" setup>\nimport { onBeforeUnmount, onMounted, ref, watch } from 'vue'\nimport {\n codeEditorProps,\n codeEditorEmits,\n defaultOptions,\n codeThemeList\n} from './config'\nimport { createNamespace } from '@ll-plus/utils'\n// @ts-ignore\nimport * as monaco from 'monaco-editor'\n// // @ts-ignore\n// import EditorWorker from 'monaco-editor/esm/vs/editor/editor.worker?worker'\n// // @ts-ignore\n// import jsonWorker from 'monaco-editor/esm/vs/language/json/json.worker?worker'\n// // @ts-ignore\n// import cssWorker from 'monaco-editor/esm/vs/language/css/css.worker?worker'\n// // @ts-ignore\n// import htmlWorker from 'monaco-editor/esm/vs/language/html/html.worker?worker'\n// // @ts-ignore\n// import tsWorker from 'monaco-editor/esm/vs/language/typescript/ts.worker?worker'\n\ndefineOptions({ name: 'LlCodeEditor' })\n\nconst props = defineProps(codeEditorProps)\nconst emits = defineEmits(codeEditorEmits)\nconst bem = createNamespace('code-editor')\nself.MonacoEnvironment = {\n getWorker(_: string, label: string) {\n if (label === 'json') {\n return new Worker(\n new URL(\n 'monaco-editor/esm/vs/language/json/json.worker.js',\n import.meta.url\n ),\n { type: 'module' }\n )\n }\n if (['css', 'scss', 'less'].includes(label)) {\n return new Worker(\n new URL(\n 'monaco-editor/esm/vs/language/css/css.worker.js',\n import.meta.url\n ),\n { type: 'module' }\n )\n }\n if (['html', 'handlebars', 'razor'].includes(label)) {\n return new Worker(\n new URL(\n 'monaco-editor/esm/vs/language/html/html.worker.js',\n import.meta.url\n ),\n { type: 'module' }\n )\n }\n if (['typescript', 'javascript'].includes(label)) {\n return new Worker(\n new URL(\n 'monaco-editor/esm/vs/language/typescript/ts.worker.js',\n import.meta.url\n ),\n { type: 'module' }\n )\n }\n return new Worker(\n new URL('monaco-editor/esm/vs/editor/editor.worker.js', import.meta.url),\n {\n type: 'module'\n }\n )\n }\n}\nlet editor: monaco.editor.IStandaloneCodeEditor\n\nconst codeEditBox = ref()\nconst init = () => {\n monaco.languages.typescript.javascriptDefaults.setDiagnosticsOptions({\n noSemanticValidation: true,\n noSyntaxValidation: false\n })\n monaco.languages.typescript.javascriptDefaults.setCompilerOptions({\n target: monaco.languages.typescript.ScriptTarget.ES2020,\n allowNonTsExtensions: true\n })\n\n editor = monaco.editor.create(codeEditBox.value, {\n value: props.value,\n language: props.language,\n theme: props.theme,\n ...defaultOptions,\n ...props.options\n })\n handleChangeTheme(props.theme)\n // 监听值的变化\n editor.onDidChangeModelContent(() => {\n const value = editor.getValue() //给父组件实时返回最新文本\n emits('update:value', value)\n emits('change', value)\n })\n\n emits('editor-mounted', editor)\n}\nconst handleChangeTheme = async (theme: string) => {\n const find = codeThemeList.find(item => item.value === theme)\n if (find) {\n const themeData = {\n ...find.data\n } as monaco.editor.IStandaloneThemeData\n try {\n monaco.editor.defineTheme(theme, themeData)\n monaco.editor.setTheme(theme)\n } catch (error) {\n monaco.editor.setTheme('vs')\n }\n } else {\n monaco.editor.setTheme('vs')\n }\n}\nwatch(\n () => props.value,\n newValue => {\n if (editor) {\n const value = editor.getValue()\n if (newValue !== value) {\n editor.setValue(newValue)\n }\n }\n }\n)\n\nwatch(\n () => props.options,\n newValue => {\n editor.updateOptions(newValue)\n },\n { deep: true }\n)\n\nwatch(\n () => props.language,\n newValue => {\n monaco.editor.setModelLanguage(editor.getModel()!, newValue)\n }\n)\n\nonBeforeUnmount(() => {\n editor.dispose()\n})\n\nonMounted(() => {\n init()\n})\n</script>\n"],"names":[],"mappings":";;;;;;;;;;;;;;;AAmCA,IAAA,MAAM,KAAQ,GAA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MACE,MAAM,KAAM,CAAA,QAAA;AAAA,MACZ,CAAY,QAAA,KAAA;AACV,QAAA,MAAA,CAAO,MAAO,CAAA,gBAAA,CAAiB,MAAO,CAAA,QAAA,IAAa,QAAQ,CAAA,CAAA;AAAA,OAC7D;AAAA,KACF,CAAA;AAEA,IAAA,eAAA,CAAgB,MAAM;AACpB,MAAA,MAAA,CAAO,OAAQ,EAAA,CAAA;AAAA,KAChB,CAAA,CAAA;AAED,IAAA,SAAA,CAAU,MAAM;AACd,MAAK,IAAA,EAAA,CAAA;AAAA,KACN,CAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -27,6 +27,6 @@ export declare const buildProp: <Type = never, Value = never, Validator = never,
27
27
  export type TestProps = Record<string, {
28
28
  [epPropKey]: true;
29
29
  } | NativePropType | EpPropInput<any, any, any, any, any>>;
30
- export declare const buildProps: <Props extends Record<string, NativePropType | EpPropInput<any, any, any, any, any> | {
30
+ export declare const buildProps: <Props extends Record<string, {
31
31
  __epPropKey: true;
32
- }>>(props: Props) => { [K in keyof Props]: IfEpProp<Props[K], Props[K], IfNativePropType<Props[K], Props[K], EpPropConvert<Props[K]>>>; };
32
+ } | NativePropType | EpPropInput<any, any, any, any, any>>>(props: Props) => { [K in keyof Props]: IfEpProp<Props[K], Props[K], IfNativePropType<Props[K], Props[K], EpPropConvert<Props[K]>>>; };
package/index.full.js CHANGED
@@ -1,9 +1,10 @@
1
1
  (function (global, factory) {
2
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('vue'), require('ant-design-vue'), require('monaco-editor'), require('monaco-editor/esm/vs/editor/editor.worker?worker'), require('monaco-editor/esm/vs/language/json/json.worker?worker'), require('monaco-editor/esm/vs/language/css/css.worker?worker'), require('monaco-editor/esm/vs/language/html/html.worker?worker'), require('monaco-editor/esm/vs/language/typescript/ts.worker?worker')) :
3
- typeof define === 'function' && define.amd ? define(['exports', 'vue', 'ant-design-vue', 'monaco-editor', 'monaco-editor/esm/vs/editor/editor.worker?worker', 'monaco-editor/esm/vs/language/json/json.worker?worker', 'monaco-editor/esm/vs/language/css/css.worker?worker', 'monaco-editor/esm/vs/language/html/html.worker?worker', 'monaco-editor/esm/vs/language/typescript/ts.worker?worker'], factory) :
4
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.LlPlus = {}, global.Vue, global.antDesignVue, global.monaco, global.EditorWorker, global.jsonWorker, global.cssWorker, global.htmlWorker, global.tsWorker));
5
- })(this, (function (exports, require$$0, antDesignVue, monaco, EditorWorker, jsonWorker, cssWorker, htmlWorker, tsWorker) { 'use strict';
2
+ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('vue'), require('ant-design-vue'), require('monaco-editor')) :
3
+ typeof define === 'function' && define.amd ? define(['exports', 'vue', 'ant-design-vue', 'monaco-editor'], factory) :
4
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.LlPlus = {}, global.Vue, global.antDesignVue, global.monaco));
5
+ })(this, (function (exports, require$$0, antDesignVue, monaco) { 'use strict';
6
6
 
7
+ var _documentCurrentScript = typeof document !== 'undefined' ? document.currentScript : null;
7
8
  function _interopNamespaceDefault(e) {
8
9
  var n = Object.create(null);
9
10
  if (e) {
@@ -43885,38 +43886,50 @@
43885
43886
  const props = __props;
43886
43887
  const emits = __emit;
43887
43888
  const bem = createNamespace("code-editor");
43888
- self.MonacoEnvironment = {
43889
- getWorkerUrl: function(moduleId, label) {
43890
- if (label === "json") {
43891
- return "monaco-editor/esm/vs/language/json/json.worker.js";
43892
- }
43893
- if (label === "css") {
43894
- return "monaco-editor/esm/vs/language/css/css.worker.js";
43895
- }
43896
- if (label === "html") {
43897
- return "monaco-editor/esm/vs/language/html/html.worker.js";
43898
- }
43899
- if (label === "typescript" || label === "javascript") {
43900
- return "monaco-editor/esm/vs/language/typescript/ts.worker.js";
43901
- }
43902
- return "monaco-editor/esm/vs/editor/editor.worker.js";
43903
- }
43904
- };
43905
43889
  self.MonacoEnvironment = {
43906
43890
  getWorker(_, label) {
43907
43891
  if (label === "json") {
43908
- return new jsonWorker();
43892
+ return new Worker(
43893
+ new URL(
43894
+ "monaco-editor/esm/vs/language/json/json.worker.js",
43895
+ (typeof document === 'undefined' && typeof location === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : typeof document === 'undefined' ? location.href : (_documentCurrentScript && _documentCurrentScript.src || new URL('index.full.js', document.baseURI).href))
43896
+ ),
43897
+ { type: "module" }
43898
+ );
43909
43899
  }
43910
43900
  if (["css", "scss", "less"].includes(label)) {
43911
- return new cssWorker();
43901
+ return new Worker(
43902
+ new URL(
43903
+ "monaco-editor/esm/vs/language/css/css.worker.js",
43904
+ (typeof document === 'undefined' && typeof location === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : typeof document === 'undefined' ? location.href : (_documentCurrentScript && _documentCurrentScript.src || new URL('index.full.js', document.baseURI).href))
43905
+ ),
43906
+ { type: "module" }
43907
+ );
43912
43908
  }
43913
43909
  if (["html", "handlebars", "razor"].includes(label)) {
43914
- return new htmlWorker();
43910
+ return new Worker(
43911
+ new URL(
43912
+ "monaco-editor/esm/vs/language/html/html.worker.js",
43913
+ (typeof document === 'undefined' && typeof location === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : typeof document === 'undefined' ? location.href : (_documentCurrentScript && _documentCurrentScript.src || new URL('index.full.js', document.baseURI).href))
43914
+ ),
43915
+ { type: "module" }
43916
+ );
43915
43917
  }
43916
43918
  if (["typescript", "javascript"].includes(label)) {
43917
- return new tsWorker();
43919
+ return new Worker(
43920
+ new URL(
43921
+ "monaco-editor/esm/vs/language/typescript/ts.worker.js",
43922
+ (typeof document === 'undefined' && typeof location === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : typeof document === 'undefined' ? location.href : (_documentCurrentScript && _documentCurrentScript.src || new URL('index.full.js', document.baseURI).href))
43923
+ ),
43924
+ { type: "module" }
43925
+ );
43918
43926
  }
43919
- return new EditorWorker();
43927
+ return new Worker(
43928
+ new URL("monaco-editor/esm/vs/editor/editor.worker.js", (typeof document === 'undefined' && typeof location === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : typeof document === 'undefined' ? location.href : (_documentCurrentScript && _documentCurrentScript.src || new URL('index.full.js', document.baseURI).href))),
43929
+ {
43930
+ type: "module"
43931
+ }
43932
+ );
43920
43933
  }
43921
43934
  };
43922
43935
  let editor;