vue-devui 1.6.4-alpha.0 → 1.6.4-markdown.0

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vue-devui",
3
- "version": "1.6.4-alpha.0",
3
+ "version": "1.6.4-markdown.0",
4
4
  "license": "MIT",
5
5
  "description": "DevUI components based on Vite and Vue3",
6
6
  "keywords": [
@@ -5,6 +5,7 @@ export declare function useEditorMd(props: EditorMdProps, ctx: SetupContext): {
5
5
  overlayRef: Ref<any>;
6
6
  cursorRef: Ref<any>;
7
7
  renderRef: Ref<any>;
8
+ containerRef: Ref<any>;
8
9
  toolbars: Record<string, import("../toolbar-config").IToolbarItemConfig>;
9
10
  previewHtmlList: Ref<any[]>;
10
11
  isHintShow: Ref<any>;
package/vue-devui.es.js CHANGED
@@ -35941,6 +35941,7 @@ function useEditorMd(props, ctx2) {
35941
35941
  const renderRef = ref();
35942
35942
  const overlayRef = ref();
35943
35943
  const cursorRef = ref();
35944
+ const containerRef = ref();
35944
35945
  const isHintShow = ref();
35945
35946
  const previewHtmlList = ref([]);
35946
35947
  let editorIns;
@@ -36168,12 +36169,22 @@ function useEditorMd(props, ctx2) {
36168
36169
  }
36169
36170
  }
36170
36171
  };
36172
+ const onDocumentClick = (e) => {
36173
+ var _a2;
36174
+ if (isHintShow.value && e.target !== containerRef.value && !((_a2 = containerRef.value) == null ? void 0 : _a2.contains(e.target))) {
36175
+ hideHint();
36176
+ }
36177
+ };
36171
36178
  onMounted(async () => {
36172
36179
  await import("codemirror/addon/display/placeholder.js");
36173
36180
  await import("codemirror/mode/markdown/markdown.js");
36174
36181
  const module2 = await import("codemirror");
36175
36182
  CodeMirror = module2.default;
36176
36183
  initEditor();
36184
+ document.addEventListener("click", onDocumentClick);
36185
+ });
36186
+ onBeforeUnmount(() => {
36187
+ document.removeEventListener("click", onDocumentClick);
36177
36188
  });
36178
36189
  watch(modelValue, (val) => {
36179
36190
  if (editorIns) {
@@ -36214,6 +36225,7 @@ function useEditorMd(props, ctx2) {
36214
36225
  overlayRef,
36215
36226
  cursorRef,
36216
36227
  renderRef,
36228
+ containerRef,
36217
36229
  toolbars,
36218
36230
  previewHtmlList,
36219
36231
  isHintShow,
@@ -37201,6 +37213,7 @@ var EditorMd = defineComponent({
37201
37213
  overlayRef,
37202
37214
  cursorRef,
37203
37215
  renderRef,
37216
+ containerRef,
37204
37217
  isHintShow,
37205
37218
  toolbars,
37206
37219
  previewHtmlList,
@@ -37231,6 +37244,7 @@ var EditorMd = defineComponent({
37231
37244
  "z-index": fullscreenZIndex.value
37232
37245
  }, {
37233
37246
  default: () => [createVNode("div", {
37247
+ "ref": containerRef,
37234
37248
  "class": ["dp-md-container", {
37235
37249
  "dp-md-readonly": mode.value === "readonly",
37236
37250
  "dp-md-editonly": mode.value === "editonly",
@@ -37257,7 +37271,9 @@ var EditorMd = defineComponent({
37257
37271
  "onUpdate:modelValue": ($event) => isHintShow.value = $event,
37258
37272
  "origin": cursorRef.value || void 0,
37259
37273
  "align": "start",
37260
- "position": ["bottom-start"]
37274
+ "position": ["bottom-start"],
37275
+ "onClick": withModifiers(() => {
37276
+ }, ["stop"])
37261
37277
  }, {
37262
37278
  default: () => {
37263
37279
  var _a2, _b;
@@ -54171,7 +54187,7 @@ const installs = [
54171
54187
  VirtualListInstall
54172
54188
  ];
54173
54189
  var vueDevui = {
54174
- version: "1.6.4-alpha.0",
54190
+ version: "1.6.4-markdown.0",
54175
54191
  install(app) {
54176
54192
  installs.forEach((p) => app.use(p));
54177
54193
  }