geekplus-digital-ui 0.1.26 → 0.1.28

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/README.md CHANGED
@@ -1 +1,3 @@
1
1
  # Geekplus Digital UI
2
+
3
+ 极智嘉数字化组件库,仅供内部使用。
@@ -1 +1 @@
1
- .d-copy[data-v-5ec3986a] .el-link__inner{gap:4px}
1
+ .d-copy[data-v-5cfb3191] .el-link__inner{gap:4px}
@@ -1,6 +1,6 @@
1
1
  import { ref as m, computed as p, onMounted as k, onBeforeUnmount as C, openBlock as a, createBlock as d, unref as f, withModifiers as L, normalizeStyle as S, withCtx as y, createElementBlock as x, normalizeClass as M, createVNode as N, renderSlot as _, createCommentVNode as B } from "vue";
2
- import { useClipboard as w } from "@vueuse/core";
3
- import { ElMessage as $, ElLink as b } from "element-plus";
2
+ import { useClipboard as b } from "@vueuse/core";
3
+ import { ElMessage as w, ElLink as $ } from "element-plus";
4
4
  import "../../index.js";
5
5
  import "../../../hooks/index.js";
6
6
  import z from "../../icons/copy-light.vue.js";
@@ -29,7 +29,7 @@ const V = /* @__PURE__ */ Object.assign({
29
29
  // 触发元素显示的dom,不设置就一直显示
30
30
  },
31
31
  setup(r, { expose: v }) {
32
- const n = r, l = m(null), s = m(!1), { copy: g } = w({
32
+ const n = r, l = m(null), s = m(!1), { copy: g } = b({
33
33
  source: n.text
34
34
  }), { t: E } = I(), e = p(() => {
35
35
  const o = l.value?.$el ?? l.value;
@@ -46,7 +46,7 @@ const V = /* @__PURE__ */ Object.assign({
46
46
  display: n.triggerElement && !s.value ? "none" : ""
47
47
  })), i = () => {
48
48
  g().then(() => {
49
- $.success(E("d.copy.success"));
49
+ w.success(E("d.copy.success"));
50
50
  });
51
51
  }, u = () => {
52
52
  s.value = !0;
@@ -60,7 +60,7 @@ const V = /* @__PURE__ */ Object.assign({
60
60
  }), v({
61
61
  rootRef: l,
62
62
  handleCopy: i
63
- }), (o, t) => (a(), d(f(b), {
63
+ }), (o, t) => (a(), d(f($), {
64
64
  ref_key: "rootRef",
65
65
  ref: l,
66
66
  class: "d-copy",
@@ -84,7 +84,7 @@ const V = /* @__PURE__ */ Object.assign({
84
84
  _: 3
85
85
  }, 8, ["type", "style"]));
86
86
  }
87
- }), P = /* @__PURE__ */ D(V, [["__scopeId", "data-v-5ec3986a"]]);
87
+ }), P = /* @__PURE__ */ D(V, [["__scopeId", "data-v-5cfb3191"]]);
88
88
  export {
89
89
  P as default
90
90
  };
@@ -0,0 +1,26 @@
1
+ export const DEditor: import('vue').DefineComponent<{}, {
2
+ $emit: (event: "add-image" | "update:model-value", ...args: any[]) => void;
3
+ disabled: boolean;
4
+ modelValue: string;
5
+ mode: string;
6
+ showToolbar: boolean;
7
+ minHeight: number;
8
+ border: boolean;
9
+ toolbarConfig: Record<string, any>;
10
+ editorConfig: Record<string, any>;
11
+ placeholder?: string;
12
+ $props: {
13
+ readonly disabled?: boolean;
14
+ readonly modelValue?: string;
15
+ readonly mode?: string;
16
+ readonly showToolbar?: boolean;
17
+ readonly minHeight?: number;
18
+ readonly border?: boolean;
19
+ readonly toolbarConfig?: Record<string, any>;
20
+ readonly editorConfig?: Record<string, any>;
21
+ readonly placeholder?: string;
22
+ };
23
+ }, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {
24
+ rootRef: HTMLDivElement;
25
+ }, HTMLDivElement>;
26
+ export default DEditor;
@@ -0,0 +1,6 @@
1
+ import o from "./src/editor.vue.js";
2
+ const r = o;
3
+ export {
4
+ r as DEditor,
5
+ r as default
6
+ };
@@ -0,0 +1 @@
1
+ .code-collapse[data-v-04f9af29]{border:1px solid var(--el-border-color);border-radius:4px;background:var(--el-bg-color-overlay);overflow:hidden}.code-collapse summary[data-v-04f9af29]{list-style:none;cursor:pointer;-webkit-user-select:none;user-select:none;padding:8px 12px;color:var(--el-text-color-primary);line-height:normal;display:flex;justify-content:flex-end;align-items:center;gap:4px}.code-collapse[data-v-04f9af29] .code-collapse-content pre code{margin:0;border:none;border-radius:0}
@@ -0,0 +1,10 @@
1
+ declare const _default: import('vue').DefineComponent<{}, {
2
+ contentRef: import('vue').Ref<any, any>;
3
+ initialOpen: boolean;
4
+ $props: {
5
+ readonly initialOpen?: boolean;
6
+ };
7
+ }, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {
8
+ contentRef: HTMLDivElement;
9
+ }, HTMLDetailsElement>;
10
+ export default _default;
@@ -0,0 +1,48 @@
1
+ import { ref as r, computed as u, openBlock as o, createElementBlock as f, createElementVNode as t, toDisplayString as _, createVNode as g, unref as x, withCtx as y, createBlock as c } from "vue";
2
+ import "../../index.js";
3
+ import "../../../hooks/index.js";
4
+ import h from "../../icons/angle-down-light.vue.js";
5
+ import k from "../../icons/angle-up-light.vue.js";
6
+ import './code-collapse.css';/* empty css */
7
+ import v from "../../../_virtual/_plugin-vue_export-helper.js";
8
+ import { useLocale as B } from "../../../hooks/use-locale/index.js";
9
+ import { DIcon as O } from "../../icon/index.js";
10
+ const C = ["open"], D = {
11
+ __name: "code-collapse",
12
+ props: {
13
+ initialOpen: {
14
+ type: Boolean,
15
+ default: !1
16
+ }
17
+ },
18
+ setup(n, { expose: p }) {
19
+ const s = n, l = r(null), e = r(s.initialOpen), { t: i } = B(), m = u(() => i(e.value ? "d.editor.collapse" : "d.editor.expand")), d = (a) => {
20
+ e.value = a.target.open;
21
+ };
22
+ return p({
23
+ contentRef: l
24
+ }), (a, L) => (o(), f("details", {
25
+ class: "code-collapse",
26
+ open: n.initialOpen,
27
+ onToggle: d
28
+ }, [
29
+ t("summary", null, [
30
+ t("span", null, _(m.value), 1),
31
+ g(x(O), null, {
32
+ default: y(() => [
33
+ e.value ? (o(), c(k, { key: 0 })) : (o(), c(h, { key: 1 }))
34
+ ]),
35
+ _: 1
36
+ })
37
+ ]),
38
+ t("div", {
39
+ ref_key: "contentRef",
40
+ ref: l,
41
+ class: "code-collapse-content"
42
+ }, null, 512)
43
+ ], 40, C));
44
+ }
45
+ }, U = /* @__PURE__ */ v(D, [["__scopeId", "data-v-04f9af29"]]);
46
+ export {
47
+ U as default
48
+ };
@@ -0,0 +1 @@
1
+ :host,:root{--w-e-textarea-bg-color:#fff;--w-e-textarea-color:#333;--w-e-textarea-border-color:#ccc;--w-e-textarea-slight-border-color:#e8e8e8;--w-e-textarea-slight-color:#d4d4d4;--w-e-textarea-slight-bg-color:#f5f2f0;--w-e-textarea-selected-border-color:#b4d5ff;--w-e-textarea-handler-bg-color:#4290f7;--w-e-toolbar-color:#595959;--w-e-toolbar-bg-color:#fff;--w-e-toolbar-active-color:#333;--w-e-toolbar-active-bg-color:#f1f1f1;--w-e-toolbar-disabled-color:#999;--w-e-toolbar-border-color:#e8e8e8;--w-e-modal-button-bg-color:#fafafa;--w-e-modal-button-border-color:#d9d9d9}.w-e-text-container *,.w-e-toolbar *{box-sizing:border-box;margin:0;outline:none;padding:0}.w-e-text-container blockquote,.w-e-text-container li,.w-e-text-container p,.w-e-text-container td,.w-e-text-container th,.w-e-toolbar *{line-height:1.5}.w-e-text-container{background-color:var(--w-e-textarea-bg-color);color:var(--w-e-textarea-color);height:100%;position:relative}.no-scroll{width:100%}.w-e-text-container .w-e-scroll{height:100%;-webkit-overflow-scrolling:touch}.w-e-text-container [data-slate-editor]{outline:0;white-space:pre-wrap;word-wrap:break-word;border-top:1px solid transparent;min-height:100%;padding:0 10px}.w-e-text-container [data-slate-editor] p{margin:15px 0}.w-e-text-container [data-slate-editor] h1,.w-e-text-container [data-slate-editor] h2,.w-e-text-container [data-slate-editor] h3,.w-e-text-container [data-slate-editor] h4,.w-e-text-container [data-slate-editor] h5{margin:20px 0}.w-e-text-container [data-slate-editor] img{cursor:default;display:inline!important;max-width:100%;min-height:20px;min-width:20px}.w-e-text-container [data-slate-editor] span{text-indent:0}.w-e-text-container [data-slate-editor] [data-selected=true]{box-shadow:0 0 0 2px var(--w-e-textarea-selected-border-color)}.w-e-text-placeholder{font-style:italic;left:10px;top:17px;width:90%}.w-e-max-length-info,.w-e-text-placeholder{color:var(--w-e-textarea-slight-color);pointer-events:none;position:absolute;-webkit-user-select:none;-moz-user-select:none;user-select:none}.w-e-max-length-info{bottom:.5em;right:1em}.w-e-bar{background-color:var(--w-e-toolbar-bg-color);color:var(--w-e-toolbar-color);font-size:14px;padding:0 5px}.w-e-bar svg{fill:var(--w-e-toolbar-color);height:14px;width:14px}.w-e-bar-show{display:flex}.w-e-bar-hidden{display:none}.w-e-hover-bar{border:1px solid var(--w-e-toolbar-border-color);border-radius:3px;box-shadow:0 2px 5px #0000001f;position:absolute}.w-e-toolbar{flex-wrap:wrap;position:relative}.w-e-bar-divider{background-color:var(--w-e-toolbar-border-color);display:inline-flex;height:40px;margin:0 5px;width:1px}.w-e-bar-item{display:flex;height:40px;padding:4px;position:relative;text-align:center}.w-e-bar-item,.w-e-bar-item button{align-items:center;justify-content:center}.w-e-bar-item button{background:transparent;border:none;color:var(--w-e-toolbar-color);cursor:pointer;display:inline-flex;height:32px;overflow:hidden;padding:0 8px;white-space:nowrap}.w-e-bar-item button:hover{background-color:var(--w-e-toolbar-active-bg-color);color:var(--w-e-toolbar-active-color)}.w-e-bar-item button .title{margin-left:5px}.w-e-bar-item .active{background-color:var(--w-e-toolbar-active-bg-color);color:var(--w-e-toolbar-active-color)}.w-e-bar-item .disabled{color:var(--w-e-toolbar-disabled-color);cursor:not-allowed}.w-e-bar-item .disabled svg{fill:var(--w-e-toolbar-disabled-color)}.w-e-bar-item .disabled:hover{background-color:var(--w-e-toolbar-bg-color);color:var(--w-e-toolbar-disabled-color)}.w-e-bar-item .disabled:hover svg{fill:var(--w-e-toolbar-disabled-color)}.w-e-menu-tooltip-v5:before{background-color:var(--w-e-toolbar-active-color);border-radius:5px;color:var(--w-e-toolbar-bg-color);content:attr(data-tooltip);font-size:.75em;padding:5px 10px;text-align:center;top:40px;white-space:pre;z-index:1}.w-e-menu-tooltip-v5:after,.w-e-menu-tooltip-v5:before{opacity:0;position:absolute;transition:opacity .6s;visibility:hidden}.w-e-menu-tooltip-v5:after{border-color:transparent transparent var(--w-e-toolbar-active-color) transparent;border-style:solid;border-width:5px;content:"";top:30px}.w-e-menu-tooltip-v5:hover:after,.w-e-menu-tooltip-v5:hover:before{opacity:1;visibility:visible}.w-e-menu-tooltip-v5.tooltip-right:before{left:100%;top:10px}.w-e-menu-tooltip-v5.tooltip-right:after{border-color:transparent var(--w-e-toolbar-active-color) transparent transparent;left:100%;margin-left:-10px;top:16px}.w-e-bar-item-group .w-e-bar-item-menus-container{background-color:var(--w-e-toolbar-bg-color);border:1px solid var(--w-e-toolbar-border-color);border-radius:3px;box-shadow:0 2px 10px #0000001f;display:none;left:0;margin-top:40px;position:absolute;top:0;z-index:1}.w-e-bar-item-group:hover .w-e-bar-item-menus-container{display:block}.w-e-select-list{background-color:var(--w-e-toolbar-bg-color);border:1px solid var(--w-e-toolbar-border-color);border-radius:3px;box-shadow:0 2px 10px #0000001f;left:0;margin-top:40px;max-height:350px;min-width:100px;overflow-y:auto;position:absolute;top:0;z-index:1}.w-e-select-list ul{line-height:1;list-style:none}.w-e-select-list ul .selected{background-color:var(--w-e-toolbar-active-bg-color)}.w-e-select-list ul li{cursor:pointer;padding:7px 0 7px 25px;position:relative;text-align:left;white-space:nowrap}.w-e-select-list ul li:hover{background-color:var(--w-e-toolbar-active-bg-color)}.w-e-select-list ul li svg{left:0;margin-left:5px;margin-top:-7px;position:absolute;top:50%}.w-e-bar-bottom .w-e-select-list{bottom:0;margin-bottom:40px;margin-top:0;top:inherit}.w-e-drop-panel{background-color:var(--w-e-toolbar-bg-color);border:1px solid var(--w-e-toolbar-border-color);border-radius:3px;box-shadow:0 2px 10px #0000001f;margin-top:40px;min-width:200px;padding:10px;position:absolute;top:0;z-index:1}.w-e-bar-bottom .w-e-drop-panel{bottom:0;margin-bottom:40px;margin-top:0;top:inherit}.w-e-modal{background-color:var(--w-e-toolbar-bg-color);border:1px solid var(--w-e-toolbar-border-color);border-radius:3px;box-shadow:0 2px 10px #0000001f;color:var(--w-e-toolbar-color);font-size:14px;min-height:40px;min-width:100px;padding:20px 15px 0;position:absolute;text-align:left;z-index:1}.w-e-modal .btn-close{cursor:pointer;line-height:1;padding:5px;position:absolute;right:8px;top:7px}.w-e-modal .btn-close svg{fill:var(--w-e-toolbar-color);height:10px;width:10px}.w-e-modal .babel-container{display:block;margin-bottom:15px}.w-e-modal .babel-container span{display:block;margin-bottom:10px}.w-e-modal .button-container{margin-bottom:15px}.w-e-modal button{background-color:var(--w-e-modal-button-bg-color);cursor:pointer;font-weight:400;height:32px;padding:4.5px 15px;text-align:center;touch-action:manipulation;transition:all .3s cubic-bezier(.645,.045,.355,1);-webkit-user-select:none;-moz-user-select:none;user-select:none;white-space:nowrap}.w-e-modal button,.w-e-modal input[type=number],.w-e-modal input[type=text],.w-e-modal textarea{border:1px solid var(--w-e-modal-button-border-color);border-radius:4px;color:var(--w-e-toolbar-color)}.w-e-modal input[type=number],.w-e-modal input[type=text],.w-e-modal textarea{background-color:var(--w-e-toolbar-bg-color);font-feature-settings:"tnum";font-variant:tabular-nums;padding:4.5px 11px;transition:all .3s;width:100%}.w-e-modal textarea{min-height:60px}body .w-e-modal,body .w-e-modal *{box-sizing:border-box}.w-e-progress-bar{background-color:var(--w-e-textarea-handler-bg-color);height:1px;position:absolute;transition:width .3s;width:0}.w-e-full-screen-container{display:flex!important;flex-direction:column!important;height:100%!important;inset:0!important;margin:0!important;padding:0!important;position:fixed;width:100%!important}.w-e-full-screen-container [data-w-e-textarea=true]{flex:1!important}.w-e-text-container [data-slate-editor] code{background-color:var(--w-e-textarea-slight-bg-color);border-radius:3px;font-family:monospace;padding:3px}.w-e-panel-content-color{list-style:none;text-align:left;width:230px}.w-e-panel-content-color li{border:1px solid var(--w-e-toolbar-bg-color);border-radius:3px;cursor:pointer;display:inline-block;padding:2px}.w-e-panel-content-color li:hover{border-color:var(--w-e-toolbar-color)}.w-e-panel-content-color li .color-block{border:1px solid var(--w-e-toolbar-border-color);border-radius:3px;height:17px;width:17px}.w-e-panel-content-color .active{border-color:var(--w-e-toolbar-color)}.w-e-panel-content-color .clear{line-height:1.5;margin-bottom:5px;width:100%}.w-e-panel-content-color .clear svg{height:16px;margin-bottom:-4px;width:16px}.w-e-text-container [data-slate-editor] blockquote{background-color:var(--w-e-textarea-slight-bg-color);border-left:8px solid var(--w-e-textarea-selected-border-color);display:block;font-size:100%;line-height:1.5;margin:10px 0;padding:10px}.w-e-panel-content-emotion{font-size:20px;list-style:none;text-align:left;width:300px}.w-e-panel-content-emotion li{border-radius:3px;cursor:pointer;display:inline-block;padding:0 5px}.w-e-panel-content-emotion li:hover{background-color:var(--w-e-textarea-slight-bg-color)}.w-e-textarea-divider{border-radius:3px;margin:20px auto;padding:20px}.w-e-textarea-divider hr{background-color:var(--w-e-textarea-border-color);border:0;display:block;height:1px}.w-e-text-container [data-slate-editor] .w-e-image-container{display:inline-block;margin:0 3px}.w-e-text-container [data-slate-editor] .w-e-image-container:hover{box-shadow:0 0 0 2px var(--w-e-textarea-selected-border-color)}.w-e-text-container [data-slate-editor] .w-e-selected-image-container{overflow:hidden;position:relative}.w-e-text-container [data-slate-editor] .w-e-selected-image-container .w-e-image-dragger{background-color:var(--w-e-textarea-handler-bg-color);height:7px;position:absolute;width:7px}.w-e-text-container [data-slate-editor] .w-e-selected-image-container .left-top{cursor:nwse-resize;left:0;top:0}.w-e-text-container [data-slate-editor] .w-e-selected-image-container .right-top{cursor:nesw-resize;right:0;top:0}.w-e-text-container [data-slate-editor] .w-e-selected-image-container .left-bottom{bottom:0;cursor:nesw-resize;left:0}.w-e-text-container [data-slate-editor] .w-e-selected-image-container .right-bottom{bottom:0;cursor:nwse-resize;right:0}.w-e-text-container [contenteditable=false] .w-e-image-container:hover,.w-e-text-container [data-slate-editor] .w-e-selected-image-container:hover{box-shadow:none}.w-e-text-container [data-slate-editor] .table-container{border-radius:0;margin-top:10px;overflow-x:auto;padding:0;position:relative;width:100%}.w-e-text-container [data-slate-editor] table{border-collapse:collapse;table-layout:fixed}.w-e-text-container [data-slate-editor] table td,.w-e-text-container [data-slate-editor] table th{border:1px solid var(--w-e-textarea-border-color);line-height:1.5;min-width:30px;overflow:hidden;overflow-wrap:break-word;padding:3px 5px;white-space:pre-wrap;word-break:break-all}.w-e-text-container [data-slate-editor] table th{background-color:var(--w-e-textarea-slight-bg-color);font-weight:700;text-align:center}.w-e-text-container [data-slate-editor] table td.w-e-selected,.w-e-text-container [data-slate-editor] table th.w-e-selected{background-color:#1456f02e}.w-e-text-container [data-slate-editor] table.table-selection-none ::-moz-selection{background:none}.w-e-text-container [data-slate-editor] table.table-selection-none ::selection{background:none}.w-e-text-container [data-slate-editor] .column-resizer{display:flex;height:0;left:0;position:absolute;top:0;width:0;z-index:1}.w-e-text-container [data-slate-editor] .column-resizer .column-resizer-item{position:relative}.w-e-text-container [data-slate-editor] .resizer-line-hotzone{cursor:col-resize;opacity:0;position:absolute;right:0;transition:opacity .2s ease,visibility .2s ease;visibility:hidden;width:6px}.w-e-text-container [data-slate-editor] .resizer-line-hotzone .resizer-line{background:#1456f0cc;height:100%;margin-left:5px;-webkit-user-select:none;-moz-user-select:none;user-select:none;width:2px}.w-e-text-container [data-slate-editor] .resizer-line-hotzone.visible{visibility:visible}.w-e-text-container [data-slate-editor] .resizer-line-hotzone.highlight{opacity:1}.w-e-text-container [data-slate-editor] .row-resizer{display:flex;flex-direction:column;height:0;left:0;position:absolute;top:0;width:0;z-index:1}.w-e-text-container [data-slate-editor] .row-resizer .row-resizer-item{position:relative}.w-e-text-container [data-slate-editor] .resizer-line-hotzone-horizontal{bottom:0;cursor:row-resize;height:6px;opacity:0;position:absolute;transition:opacity .2s ease,visibility .2s ease;visibility:hidden}.w-e-text-container [data-slate-editor] .resizer-line-hotzone-horizontal .resizer-line-horizontal{background:#1456f0cc;height:2px;margin-top:5px;-webkit-user-select:none;-moz-user-select:none;user-select:none;width:100%}.w-e-text-container [data-slate-editor] .resizer-line-hotzone-horizontal.visible{visibility:visible}.w-e-text-container [data-slate-editor] .resizer-line-hotzone-horizontal.highlight{opacity:1}.w-e-panel-content-table{background-color:var(--w-e-toolbar-bg-color)}.w-e-panel-content-table table{border-collapse:collapse;table-layout:fixed}.w-e-panel-content-table td,.w-e-panel-content-table th{overflow:hidden;overflow-wrap:break-word;white-space:pre-wrap;word-break:break-all}.w-e-panel-content-table td{border:1px solid var(--w-e-toolbar-border-color);cursor:pointer;height:15px;padding:3px 5px;width:20px}.w-e-panel-content-table td.active{background-color:var(--w-e-toolbar-active-bg-color)}.w-e-modal .babel-container span.babel-container-border{display:flex}.w-e-modal .babel-container span.babel-container-border>*{border:1px solid var(--w-e-modal-button-border-color);border-radius:2px;height:28px}.w-e-modal .babel-container span.babel-container-border select{width:114px}.w-e-modal .babel-container span.babel-container-border>:nth-child(n+2){margin-left:8px}.w-e-modal .babel-container span.babel-container-border input:nth-child(3){width:100px}.w-e-modal .babel-container span.babel-container-background input{width:60px}.w-e-modal .babel-container .color-group,.w-e-modal .babel-container span.babel-container-algin select,.w-e-modal .babel-container span.babel-container-background input{border:1px solid var(--w-e-modal-button-border-color);border-radius:2px;height:28px}.w-e-modal .babel-container .color-group{cursor:pointer;position:relative;width:28px}.w-e-modal .babel-container .color-group .w-e-drop-panel{margin-top:28px}.w-e-modal .babel-container .color-group-block{display:block;height:80%;margin:10%;width:80%}.w-e-modal .babel-container .color-group-block svg{height:20px;margin:1px 0;width:20px}.w-e-textarea-video-container{background-image:linear-gradient(45deg,#eee 25%,transparent 0,transparent 75%,#eee 0,#eee),linear-gradient(45deg,#eee 25%,#fff 0 75%,#eee 0,#eee);background-position:0 0,10px 10px;background-size:20px 20px;border:1px dashed var(--w-e-textarea-border-color);border-radius:5px;margin:10px auto 0;overflow:auto;padding:10px 0;text-align:center}.w-e-text-container [data-slate-editor] pre>code{background-color:var(--w-e-textarea-slight-bg-color);border:1px solid var(--w-e-textarea-slight-border-color);border-radius:4px;display:block;font-family:Consolas,Monaco,Andale Mono,Ubuntu Mono,monospace;font-size:14px;text-align:left;text-indent:0;text-shadow:0 1px #fff;white-space:pre;word-break:normal;word-spacing:normal;word-wrap:normal;-webkit-hyphens:none;hyphens:none;line-height:1.5;margin:.5em 0;overflow:auto;padding:1em;-moz-tab-size:4;-o-tab-size:4;tab-size:4}.w-e-text-container [data-slate-editor] pre>code .token.cdata,.w-e-text-container [data-slate-editor] pre>code .token.comment,.w-e-text-container [data-slate-editor] pre>code .token.doctype,.w-e-text-container [data-slate-editor] pre>code .token.prolog{color:#708090}.w-e-text-container [data-slate-editor] pre>code .token.punctuation{color:#999}.w-e-text-container [data-slate-editor] pre>code .token.namespace{opacity:.7}.w-e-text-container [data-slate-editor] pre>code .token.boolean,.w-e-text-container [data-slate-editor] pre>code .token.constant,.w-e-text-container [data-slate-editor] pre>code .token.deleted,.w-e-text-container [data-slate-editor] pre>code .token.number,.w-e-text-container [data-slate-editor] pre>code .token.property,.w-e-text-container [data-slate-editor] pre>code .token.symbol,.w-e-text-container [data-slate-editor] pre>code .token.tag{color:#905}.w-e-text-container [data-slate-editor] pre>code .token.attr-name,.w-e-text-container [data-slate-editor] pre>code .token.builtin,.w-e-text-container [data-slate-editor] pre>code .token.char,.w-e-text-container [data-slate-editor] pre>code .token.inserted,.w-e-text-container [data-slate-editor] pre>code .token.selector,.w-e-text-container [data-slate-editor] pre>code .token.string{color:#690}.w-e-text-container [data-slate-editor] pre>code .language-css .token.string,.w-e-text-container [data-slate-editor] pre>code .style .token.string,.w-e-text-container [data-slate-editor] pre>code .token.entity,.w-e-text-container [data-slate-editor] pre>code .token.operator,.w-e-text-container [data-slate-editor] pre>code .token.url{color:#9a6e3a}.w-e-text-container [data-slate-editor] pre>code .token.atrule,.w-e-text-container [data-slate-editor] pre>code .token.attr-value,.w-e-text-container [data-slate-editor] pre>code .token.keyword{color:#07a}.w-e-text-container [data-slate-editor] pre>code .token.class-name,.w-e-text-container [data-slate-editor] pre>code .token.function{color:#dd4a68}.w-e-text-container [data-slate-editor] pre>code .token.important,.w-e-text-container [data-slate-editor] pre>code .token.regex,.w-e-text-container [data-slate-editor] pre>code .token.variable{color:#e90}.w-e-text-container [data-slate-editor] pre>code .token.bold,.w-e-text-container [data-slate-editor] pre>code .token.important{font-weight:700}.w-e-text-container [data-slate-editor] pre>code .token.italic{font-style:italic}.w-e-text-container [data-slate-editor] pre>code .token.entity{cursor:help}:root{--w-e-textarea-bg-color: transparent;--w-e-textarea-color: var(--el-text-color-primary);--w-e-textarea-border-color: var(--el-border-color);--w-e-textarea-slight-border-color: var(--el-border-color);--w-e-textarea-slight-color: var(--el-text-color-placeholder);--w-e-textarea-slight-bg-color: var(--el-fill-color-light);--w-e-textarea-selected-border-color: var(--el-color-primary-light-5);--w-e-textarea-handler-bg-color: var(--el-color-primary);--w-e-toolbar-color: var(--el-text-color-regular);--w-e-toolbar-bg-color: var(--el-bg-color-overlay);--w-e-toolbar-active-color: var(--el-text-color-primary);--w-e-toolbar-active-bg-color: var(--el-fill-color);--w-e-toolbar-disabled-color: var(--el-text-color-placeholder);--w-e-toolbar-border-color: var(--el-border-color);--w-e-modal-button-bg-color: var(--el-bg-color);--w-e-modal-button-border-color: var(--el-border-color)}
@@ -0,0 +1,26 @@
1
+ declare const _default: import('vue').DefineComponent<{}, {
2
+ $emit: (event: "add-image" | "update:model-value", ...args: any[]) => void;
3
+ disabled: boolean;
4
+ modelValue: string;
5
+ mode: string;
6
+ showToolbar: boolean;
7
+ minHeight: number;
8
+ border: boolean;
9
+ toolbarConfig: Record<string, any>;
10
+ editorConfig: Record<string, any>;
11
+ placeholder?: string;
12
+ $props: {
13
+ readonly disabled?: boolean;
14
+ readonly modelValue?: string;
15
+ readonly mode?: string;
16
+ readonly showToolbar?: boolean;
17
+ readonly minHeight?: number;
18
+ readonly border?: boolean;
19
+ readonly toolbarConfig?: Record<string, any>;
20
+ readonly editorConfig?: Record<string, any>;
21
+ readonly placeholder?: string;
22
+ };
23
+ }, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {
24
+ rootRef: HTMLDivElement;
25
+ }, HTMLDivElement>;
26
+ export default _default;
@@ -0,0 +1,153 @@
1
+ import { ref as n, computed as s, createApp as $, watch as b, nextTick as F, onBeforeUnmount as M, openBlock as w, createElementBlock as G, normalizeClass as J, withDirectives as K, createVNode as x, unref as C, vShow as Q, normalizeStyle as W, createBlock as X, createCommentVNode as Y } from "vue";
2
+ import { i18nChangeLanguage as Z } from "@wangeditor-next/editor";
3
+ import { Toolbar as _, Editor as ee } from "@wangeditor-next/editor-for-vue";
4
+ import './editor2.css';import './editor.css';/* empty css */
5
+ import "../../../hooks/index.js";
6
+ import { useFormItem as te, ElImageViewer as oe } from "element-plus";
7
+ import le from "./code-collapse.vue.js";
8
+ /* empty css */
9
+ import ae from "../../../_virtual/_plugin-vue_export-helper.js";
10
+ import { useLocale as ne } from "../../../hooks/use-locale/index.js";
11
+ const re = /* @__PURE__ */ Object.assign({
12
+ name: "DEditor"
13
+ }, {
14
+ __name: "editor",
15
+ props: {
16
+ modelValue: {
17
+ type: String,
18
+ default: ""
19
+ },
20
+ mode: {
21
+ type: String,
22
+ default: "simple"
23
+ },
24
+ disabled: {
25
+ type: Boolean,
26
+ default: !1
27
+ },
28
+ showToolbar: {
29
+ type: Boolean,
30
+ default: !0
31
+ },
32
+ minHeight: {
33
+ type: Number,
34
+ default: 200
35
+ },
36
+ border: {
37
+ type: Boolean,
38
+ default: !1
39
+ },
40
+ toolbarConfig: {
41
+ type: Object,
42
+ default: () => ({})
43
+ },
44
+ editorConfig: {
45
+ type: Object,
46
+ default: () => ({})
47
+ },
48
+ placeholder: String
49
+ },
50
+ emits: ["add-image", "update:model-value"],
51
+ setup(l, { emit: I }) {
52
+ const o = l, V = I, B = n(null), r = n(null), h = n(""), y = n(0), u = n(!1), m = n([]), f = n(0), p = /* @__PURE__ */ new Map(), { t: S, getLocale: N } = ne(), { formItem: E } = te(), A = s(() => N()), R = (e) => {
53
+ r.value = Object.seal(e);
54
+ }, L = (e) => {
55
+ let t = e;
56
+ t === "<p><br></p>" && (t = ""), t !== h.value && (h.value = t, V("update:model-value", t), E?.validate("change"), E?.validate("blur"));
57
+ }, O = (e) => {
58
+ if (!o.disabled)
59
+ return;
60
+ const t = e?.target?.closest?.("img");
61
+ if (!t)
62
+ return;
63
+ const a = r.value?.getEditableContainer?.(), i = Array.from(a?.querySelectorAll?.("img") || []);
64
+ if (i.length === 0)
65
+ return;
66
+ const g = (d) => d?.currentSrc || d?.src || d?.getAttribute?.("data-src") || "", v = i.map(g).filter(Boolean);
67
+ if (v.length === 0)
68
+ return;
69
+ const P = g(t), k = v.findIndex((d) => d === P);
70
+ m.value = v, f.value = k >= 0 ? k : 0, u.value = !0, e?.stopPropagation?.();
71
+ }, T = (e) => {
72
+ if (o.disabled) {
73
+ O(e);
74
+ return;
75
+ }
76
+ r.value?.focus?.();
77
+ }, j = () => {
78
+ u.value = !1, m.value = [], f.value = 0;
79
+ }, c = () => {
80
+ p.forEach(({ app: e, host: t, pre: a }) => {
81
+ t?.isConnected && a?.isConnected && t.parentNode && t.parentNode.insertBefore(a, t), e.unmount(), t?.remove();
82
+ }), p.clear();
83
+ }, z = (e) => {
84
+ const t = document.createElement("div");
85
+ e.parentNode?.insertBefore(t, e);
86
+ const a = $(le), i = a.mount(t);
87
+ (i.contentRef?.value || i.contentRef)?.appendChild(e), p.set(e, {
88
+ app: a,
89
+ host: t,
90
+ pre: e
91
+ });
92
+ }, U = () => {
93
+ const e = r.value?.getEditableContainer?.()?.querySelectorAll("pre");
94
+ e && e.forEach((t) => {
95
+ t.parentElement?.tagName !== "DETAILS" && z(t);
96
+ });
97
+ }, D = s(() => ({
98
+ ...o.toolbarConfig
99
+ })), H = s(() => ({
100
+ placeholder: o.disabled ? "" : o.placeholder || S("d.editor.placeholder"),
101
+ readOnly: o.disabled,
102
+ ...o.editorConfig
103
+ })), q = s(() => ({
104
+ "--minHeight": o.border ? `${o.minHeight}px` : ""
105
+ }));
106
+ return b(A, (e) => {
107
+ Z(e === "zh-cn" ? "zh-CN" : "en");
108
+ }, { immediate: !0 }), b(() => o.disabled, () => {
109
+ c(), y.value++;
110
+ }), b(() => o.modelValue, () => {
111
+ o.disabled ? F(() => {
112
+ c(), U();
113
+ }) : c();
114
+ }, { immediate: !0 }), M(() => {
115
+ c(), r.value?.destroy?.();
116
+ }), (e, t) => (w(), G("div", {
117
+ ref_key: "rootRef",
118
+ ref: B,
119
+ key: y.value,
120
+ class: J(["d-editor", { "editor-border": l.border, "editor-disabled": l.disabled }])
121
+ }, [
122
+ K(x(C(_), {
123
+ class: "toolbar-container",
124
+ editor: r.value,
125
+ "default-config": D.value,
126
+ mode: l.mode
127
+ }, null, 8, ["editor", "default-config", "mode"]), [
128
+ [Q, l.showToolbar && !l.disabled]
129
+ ]),
130
+ x(C(ee), {
131
+ class: "editor-container",
132
+ style: W(q.value),
133
+ "model-value": l.modelValue,
134
+ "default-config": H.value,
135
+ mode: l.mode,
136
+ onOnCreated: R,
137
+ "onUpdate:modelValue": L,
138
+ onClick: T
139
+ }, null, 8, ["style", "model-value", "default-config", "mode"]),
140
+ u.value ? (w(), X(C(oe), {
141
+ key: 0,
142
+ "url-list": m.value,
143
+ "initial-index": f.value,
144
+ "hide-on-click-modal": "",
145
+ teleported: "",
146
+ onClose: j
147
+ }, null, 8, ["url-list", "initial-index"])) : Y("", !0)
148
+ ], 2));
149
+ }
150
+ }), be = /* @__PURE__ */ ae(re, [["__scopeId", "data-v-fa74014a"]]);
151
+ export {
152
+ be as default
153
+ };
@@ -0,0 +1 @@
1
+ .d-editor[data-v-fa74014a]{width:100%}.d-editor.w-e-full-screen-container[data-v-fa74014a]{z-index:1000}.d-editor .toolbar-container[data-v-fa74014a]{border-bottom:1px solid var(--el-border-color)}.d-editor .toolbar-container[data-v-fa74014a] .w-e-toolbar{border-radius:4px}.d-editor .toolbar-container[data-v-fa74014a] .w-e-drop-panel{z-index:100}.d-editor .editor-container[data-v-fa74014a]{min-height:var(--minHeight);background:var(--el-fill-color-blank);border-radius:4px}.d-editor .editor-container[data-v-fa74014a] p[id^=w-e-element-paragraph-]{margin:10px 0}.d-editor .editor-container[data-v-fa74014a] .w-e-text-placeholder{font-style:normal;font-size:14px;line-height:normal;top:11px}.d-editor .editor-container[data-v-fa74014a] .w-e-image-container{width:500px}.d-editor .editor-container[data-v-fa74014a] pre :deep(code){text-shadow:none}.d-editor.editor-disabled[data-v-fa74014a]:not(.editor-border) div[id^=w-e-textarea-]{padding:0}.d-editor.editor-disabled[data-v-fa74014a]:not(.editor-border) p[id^=w-e-element-paragraph-]:first-child{margin-top:0}.d-editor.editor-disabled[data-v-fa74014a]:not(.editor-border) p[id^=w-e-element-paragraph-]:last-child{margin-bottom:0}.editor-border[data-v-fa74014a]{border:1px solid var(--el-border-color);border-radius:4px;background:var(--el-bg-color);transition:border-color .2s cubic-bezier(.645,.045,.355,1)}.editor-border[data-v-fa74014a]:hover{border-color:var(--el-text-color-disabled)}.editor-disabled .editor-container[data-v-fa74014a] img{cursor:zoom-in}.el-form-item.is-error .editor-border[data-v-fa74014a]{border:1px solid var(--el-color-danger)}
@@ -1,6 +1,7 @@
1
1
  export * from './copy';
2
+ export * from './editor';
2
3
  export * from './fold-text';
4
+ export * from './icon';
3
5
  export * from './icon-tip';
4
6
  export * from './inline-edit';
5
7
  export * from './upload';
6
- export * from './icon';
@@ -1,14 +1,16 @@
1
1
  import { DCopy as p } from "./copy/index.js";
2
- import { DFoldText as t } from "./fold-text/index.js";
3
- import { DIconTip as f } from "./icon-tip/index.js";
4
- import { DInlineEdit as D } from "./inline-edit/index.js";
5
- import { DUpload as d } from "./upload/index.js";
6
- import { DIcon as l } from "./icon/index.js";
2
+ import { DEditor as e } from "./editor/index.js";
3
+ import { DFoldText as f } from "./fold-text/index.js";
4
+ import { DIcon as D } from "./icon/index.js";
5
+ import { DIconTip as i } from "./icon-tip/index.js";
6
+ import { DInlineEdit as l } from "./inline-edit/index.js";
7
+ import { DUpload as c } from "./upload/index.js";
7
8
  export {
8
9
  p as DCopy,
9
- t as DFoldText,
10
- l as DIcon,
11
- f as DIconTip,
12
- D as DInlineEdit,
13
- d as DUpload
10
+ e as DEditor,
11
+ f as DFoldText,
12
+ D as DIcon,
13
+ i as DIconTip,
14
+ l as DInlineEdit,
15
+ c as DUpload
14
16
  };
package/index.js CHANGED
@@ -3,25 +3,27 @@ import "./components/index.js";
3
3
  import "./hooks/index.js";
4
4
  import { setComponentRegistry as x, setGlobalConfig as i } from "./config/index.js";
5
5
  import { DCopy as l } from "./components/copy/index.js";
6
- import { DFoldText as a } from "./components/fold-text/index.js";
7
- import { DIcon as D } from "./components/icon/index.js";
8
- import { DIconTip as u } from "./components/icon-tip/index.js";
9
- import { DInlineEdit as I } from "./components/inline-edit/index.js";
10
- import { DUpload as y } from "./components/upload/index.js";
11
- import { useActivated as b } from "./hooks/use-activated/index.js";
12
- import { useLocale as A } from "./hooks/use-locale/index.js";
6
+ import { DEditor as a } from "./components/editor/index.js";
7
+ import { DFoldText as D } from "./components/fold-text/index.js";
8
+ import { DIcon as u } from "./components/icon/index.js";
9
+ import { DIconTip as I } from "./components/icon-tip/index.js";
10
+ import { DInlineEdit as y } from "./components/inline-edit/index.js";
11
+ import { DUpload as T } from "./components/upload/index.js";
12
+ import { useActivated as v } from "./hooks/use-activated/index.js";
13
+ import { useLocale as F } from "./hooks/use-locale/index.js";
13
14
  const p = { install: o };
14
15
  export {
15
16
  l as DCopy,
16
- a as DFoldText,
17
- D as DIcon,
18
- u as DIconTip,
19
- I as DInlineEdit,
20
- y as DUpload,
17
+ a as DEditor,
18
+ D as DFoldText,
19
+ u as DIcon,
20
+ I as DIconTip,
21
+ y as DInlineEdit,
22
+ T as DUpload,
21
23
  p as default,
22
24
  o as install,
23
25
  x as setComponentRegistry,
24
26
  i as setGlobalConfig,
25
- b as useActivated,
26
- A as useLocale
27
+ v as useActivated,
28
+ F as useLocale
27
29
  };
@@ -4,9 +4,16 @@ declare namespace _default {
4
4
  namespace copy {
5
5
  let success: string;
6
6
  }
7
- namespace foldText {
7
+ namespace editor {
8
8
  let expand: string;
9
9
  let collapse: string;
10
+ let placeholder: string;
11
+ }
12
+ namespace foldText {
13
+ let expand_1: string;
14
+ export { expand_1 as expand };
15
+ let collapse_1: string;
16
+ export { collapse_1 as collapse };
10
17
  }
11
18
  namespace upload {
12
19
  export let lessThan: string;
@@ -20,10 +27,10 @@ declare namespace _default {
20
27
  export let comma: string;
21
28
  export let preview: string;
22
29
  export let close: string;
23
- let expand_1: string;
24
- export { expand_1 as expand };
25
- let collapse_1: string;
26
- export { collapse_1 as collapse };
30
+ let expand_2: string;
31
+ export { expand_2 as expand };
32
+ let collapse_2: string;
33
+ export { collapse_2 as collapse };
27
34
  let upload_1: string;
28
35
  export { upload_1 as upload };
29
36
  export let downloadAll: string;
package/locale/lang/en.js CHANGED
@@ -4,6 +4,11 @@ const e = {
4
4
  copy: {
5
5
  success: "Copy successful"
6
6
  },
7
+ editor: {
8
+ expand: "Expand",
9
+ collapse: "Collapse",
10
+ placeholder: "Please input"
11
+ },
7
12
  foldText: {
8
13
  expand: "Expand",
9
14
  collapse: "Collapse"
@@ -4,9 +4,16 @@ declare namespace _default {
4
4
  namespace copy {
5
5
  let success: string;
6
6
  }
7
- namespace foldText {
7
+ namespace editor {
8
8
  let expand: string;
9
9
  let collapse: string;
10
+ let placeholder: string;
11
+ }
12
+ namespace foldText {
13
+ let expand_1: string;
14
+ export { expand_1 as expand };
15
+ let collapse_1: string;
16
+ export { collapse_1 as collapse };
10
17
  }
11
18
  namespace upload {
12
19
  export let lessThan: string;
@@ -20,10 +27,10 @@ declare namespace _default {
20
27
  export let comma: string;
21
28
  export let preview: string;
22
29
  export let close: string;
23
- let expand_1: string;
24
- export { expand_1 as expand };
25
- let collapse_1: string;
26
- export { collapse_1 as collapse };
30
+ let expand_2: string;
31
+ export { expand_2 as expand };
32
+ let collapse_2: string;
33
+ export { collapse_2 as collapse };
27
34
  let upload_1: string;
28
35
  export { upload_1 as upload };
29
36
  export let downloadAll: string;
@@ -4,6 +4,11 @@ const e = {
4
4
  copy: {
5
5
  success: "复制成功"
6
6
  },
7
+ editor: {
8
+ expand: "展开",
9
+ collapse: "收起",
10
+ placeholder: "请输入"
11
+ },
7
12
  foldText: {
8
13
  expand: "展开",
9
14
  collapse: "收起"
package/package.json CHANGED
@@ -1,31 +1,33 @@
1
- {
2
- "name": "geekplus-digital-ui",
3
- "version": "0.1.26",
4
- "type": "module",
5
- "main": "index.js",
6
- "module": "index.js",
7
- "types": "index.d.ts",
8
- "exports": {
9
- ".": {
10
- "types": "./index.d.ts",
11
- "import": "./index.js"
12
- },
13
- "./*": {
14
- "types": "./*.d.ts",
15
- "import": "./*.js"
16
- }
17
- },
18
- "sideEffects": [
19
- "**/*.css"
20
- ],
21
- "dependencies": {
22
- "@vueuse/core": "^14.2.1",
23
- "file-saver": "^2.0.5",
24
- "lodash-es": "^4.17.23",
25
- "vue-i18n": "^11.2.8"
26
- },
27
- "peerDependencies": {
28
- "element-plus": "^2.13.2",
29
- "vue": "^3.5.29"
30
- }
31
- }
1
+ {
2
+ "name": "geekplus-digital-ui",
3
+ "version": "0.1.28",
4
+ "type": "module",
5
+ "main": "index.js",
6
+ "module": "index.js",
7
+ "types": "index.d.ts",
8
+ "exports": {
9
+ ".": {
10
+ "types": "./index.d.ts",
11
+ "import": "./index.js"
12
+ },
13
+ "./*": {
14
+ "types": "./*.d.ts",
15
+ "import": "./*.js"
16
+ }
17
+ },
18
+ "sideEffects": [
19
+ "**/*.css"
20
+ ],
21
+ "dependencies": {
22
+ "@vueuse/core": "^14.2.1",
23
+ "@wangeditor-next/editor": "^5.6.49",
24
+ "@wangeditor-next/editor-for-vue": "^5.1.14",
25
+ "file-saver": "^2.0.5",
26
+ "lodash-es": "^4.17.23",
27
+ "vue-i18n": "^11.2.8"
28
+ },
29
+ "peerDependencies": {
30
+ "element-plus": "^2.13.2",
31
+ "vue": "^3.5.29"
32
+ }
33
+ }