vue-dialog-view 1.0.0 → 1.2.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.
@@ -1,61 +1,56 @@
1
- (function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode(".dialog-view[data-v-1ca83b6e]{padding:20px;border-radius:5px;border:1px solid gray;outline:0!important}.dialog-view[open][data-v-1ca83b6e]{display:flex;flex-direction:column;position:fixed;margin:auto;max-width:90vw;max-height:90vh}.dialog-view[data-v-1ca83b6e]::backdrop{background:#00000080}.dialog-title-bar[data-v-1ca83b6e]{display:flex;flex-direction:row;align-items:center;margin-bottom:.5em;min-height:24px}.dialog-title[data-v-1ca83b6e]{flex:1;text-align:center;font-weight:700;font-size:1.1em}.dialog-close-button[data-v-1ca83b6e]{margin-left:.5em;text-decoration:none;color:#666;font-size:1.5em;line-height:1;width:24px;height:24px;display:flex;align-items:center;justify-content:center;cursor:pointer;border:none;background:none}.dialog-close-button[data-v-1ca83b6e]:hover{color:#333;background-color:#f0f0f0;border-radius:3px}.dialog-content[data-v-1ca83b6e]{flex:1;overflow:auto;display:flex;flex-direction:column}")),document.head.appendChild(e)}}catch(t){console.error("vite-plugin-css-injected-by-js",t)}})();
2
- import { defineComponent as g, ref as h, watch as w, nextTick as _, createElementBlock as n, openBlock as c, mergeProps as V, createCommentVNode as r, createElementVNode as u, renderSlot as p, withModifiers as B } from "vue";
3
- const k = {
1
+ (function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode("._0e414b08e017324be9d8055e33e9e57a5d618fd64445845aa3d1c9c71a1cf19f{padding:20px;border-radius:5px;border:1px solid gray;outline:0!important;max-width:calc(100% - 2em);max-height:calc(100% - 2em);box-sizing:border-box;overflow:hidden}._0e414b08e017324be9d8055e33e9e57a5d618fd64445845aa3d1c9c71a1cf19f[open]{display:flex;flex-direction:column}._0e414b08e017324be9d8055e33e9e57a5d618fd64445845aa3d1c9c71a1cf19f::backdrop{background:#00000080}._f1bcbda2e971453cc116bd5c6d4a303f38ac3e0618c26210b206271398b2f619{display:flex;flex-direction:row;align-items:center;margin-bottom:.5em;min-height:24px;white-space:pre;overflow:hidden}._f365dae0582379d563ee03ab860c73c916d68f096a41a8bd34e05e566987b1f6{flex:1;text-align:center;font-weight:700;font-size:large;overflow:hidden;text-overflow:ellipsis}._2b0f1321796c8091f668958929ed738b53afcb63d79387dc52ddc75b55ffb46c{margin-left:.5em;text-decoration:none;color:#666;font-size:1.5em;line-height:1;width:24px;height:24px;display:flex;align-items:center;justify-content:center;cursor:pointer;border:none;background:none}._2b0f1321796c8091f668958929ed738b53afcb63d79387dc52ddc75b55ffb46c:hover{color:#333;background-color:#f0f0f0;border-radius:3px}._3b2bdd19ddec80c5f0f162bc4b423dafa4f687f6f831e58742be40fb0e80838e{flex:1;overflow:auto;display:flex;flex-direction:column}")),document.head.appendChild(e)}}catch(d){console.error("vite-plugin-css-injected-by-js",d)}})();
2
+ import { defineComponent as v, ref as h, watch as w, nextTick as _, createElementBlock as l, openBlock as t, mergeProps as g, createCommentVNode as d, createElementVNode as n, renderSlot as f, withModifiers as B } from "vue";
3
+ const V = {
4
4
  key: 0,
5
- class: "dialog-title-bar"
6
- }, y = { class: "dialog-title" }, C = { class: "dialog-content" }, D = /* @__PURE__ */ g({
7
- __name: "DialogView",
5
+ class: "_f1bcbda2e971453cc116bd5c6d4a303f38ac3e0618c26210b206271398b2f619"
6
+ }, C = { class: "_f365dae0582379d563ee03ab860c73c916d68f096a41a8bd34e05e566987b1f6" }, k = { class: "_3b2bdd19ddec80c5f0f162bc4b423dafa4f687f6f831e58742be40fb0e80838e" }, i = /* @__PURE__ */ v({
7
+ __name: "DialogView.obf",
8
8
  props: {
9
9
  modelValue: { type: Boolean },
10
10
  showTitleBar: { type: Boolean, default: !0 },
11
11
  showCloseButton: { type: Boolean, default: !0 }
12
12
  },
13
13
  emits: ["update:modelValue"],
14
- setup(o, { expose: s, emit: t }) {
15
- const a = o, i = t, e = h(null), v = () => {
14
+ setup(o, { expose: u, emit: r }) {
15
+ const s = o, b = r, e = h(null), p = () => {
16
16
  e.value && !e.value.open && e.value.showModal();
17
- }, d = () => {
17
+ }, c = () => {
18
18
  e.value && e.value.open && e.value.close();
19
19
  }, m = () => {
20
- a.modelValue && i("update:modelValue", !1);
20
+ s.modelValue && b("update:modelValue", !1);
21
21
  };
22
- return w(() => a.modelValue, async (l) => {
23
- await _(), l ? e.value && !e.value.open && e.value.showModal() : e.value && e.value.open && e.value.close();
24
- }), s({
25
- open: v,
26
- close: d
27
- }), (l, M) => (c(), n("dialog", V({
22
+ return w(() => s.modelValue, async (a) => {
23
+ await _(), a ? e.value && !e.value.open && e.value.showModal() : e.value && e.value.open && e.value.close();
24
+ }), u({
25
+ open: p,
26
+ close: c
27
+ }), (a, y) => (t(), l("dialog", g({
28
28
  ref_key: "dialogRef",
29
29
  ref: e,
30
- class: "dialog-view"
31
- }, l.$attrs, { onClose: m }), [
32
- o.showTitleBar ? (c(), n("div", k, [
33
- u("span", y, [
34
- p(l.$slots, "title", {}, void 0, !0)
30
+ class: "_0e414b08e017324be9d8055e33e9e57a5d618fd64445845aa3d1c9c71a1cf19f"
31
+ }, a.$attrs, { onClose: m }), [
32
+ o.showTitleBar ? (t(), l("div", V, [
33
+ n("span", C, [
34
+ f(a.$slots, "title")
35
35
  ]),
36
- o.showCloseButton ? (c(), n("a", {
36
+ o.showCloseButton ? (t(), l("a", {
37
37
  key: 0,
38
38
  href: "javascript:void(0)",
39
39
  role: "button",
40
40
  "aria-label": "Close the dialog",
41
- class: "dialog-close-button",
42
- onClick: B(d, ["prevent"])
43
- }, "×")) : r("", !0)
44
- ])) : r("", !0),
45
- u("div", C, [
46
- p(l.$slots, "default", {}, void 0, !0)
41
+ class: "_2b0f1321796c8091f668958929ed738b53afcb63d79387dc52ddc75b55ffb46c",
42
+ onClick: B(c, ["prevent"])
43
+ }, "×")) : d("", !0)
44
+ ])) : d("", !0),
45
+ n("div", k, [
46
+ f(a.$slots, "default")
47
47
  ])
48
48
  ], 16));
49
49
  }
50
- }), b = (o, s) => {
51
- const t = o.__vccOpts || o;
52
- for (const [a, i] of s)
53
- t[a] = i;
54
- return t;
55
- }, f = /* @__PURE__ */ b(D, [["__scopeId", "data-v-1ca83b6e"]]);
56
- f.install = (o) => {
57
- o.component("DialogView", f);
50
+ });
51
+ i.install = (o) => {
52
+ o.component("DialogView", i);
58
53
  };
59
54
  export {
60
- f as default
55
+ i as default
61
56
  };
@@ -1,2 +1,2 @@
1
- (function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode(".dialog-view[data-v-1ca83b6e]{padding:20px;border-radius:5px;border:1px solid gray;outline:0!important}.dialog-view[open][data-v-1ca83b6e]{display:flex;flex-direction:column;position:fixed;margin:auto;max-width:90vw;max-height:90vh}.dialog-view[data-v-1ca83b6e]::backdrop{background:#00000080}.dialog-title-bar[data-v-1ca83b6e]{display:flex;flex-direction:row;align-items:center;margin-bottom:.5em;min-height:24px}.dialog-title[data-v-1ca83b6e]{flex:1;text-align:center;font-weight:700;font-size:1.1em}.dialog-close-button[data-v-1ca83b6e]{margin-left:.5em;text-decoration:none;color:#666;font-size:1.5em;line-height:1;width:24px;height:24px;display:flex;align-items:center;justify-content:center;cursor:pointer;border:none;background:none}.dialog-close-button[data-v-1ca83b6e]:hover{color:#333;background-color:#f0f0f0;border-radius:3px}.dialog-content[data-v-1ca83b6e]{flex:1;overflow:auto;display:flex;flex-direction:column}")),document.head.appendChild(e)}}catch(t){console.error("vite-plugin-css-injected-by-js",t)}})();
2
- (function(e,l){typeof exports=="object"&&typeof module<"u"?module.exports=l(require("vue")):typeof define=="function"&&define.amd?define(["vue"],l):(e=typeof globalThis<"u"?globalThis:e||self,e.DialogView=l(e.Vue))})(this,(function(e){"use strict";const l={key:0,class:"dialog-title-bar"},f={class:"dialog-title"},u={class:"dialog-content"},i=((t,c)=>{const n=t.__vccOpts||t;for(const[s,d]of c)n[s]=d;return n})(e.defineComponent({__name:"DialogView",props:{modelValue:{type:Boolean},showTitleBar:{type:Boolean,default:!0},showCloseButton:{type:Boolean,default:!0}},emits:["update:modelValue"],setup(t,{expose:c,emit:n}){const s=t,d=n,o=e.ref(null),p=()=>{o.value&&!o.value.open&&o.value.showModal()},r=()=>{o.value&&o.value.open&&o.value.close()},m=()=>{s.modelValue&&d("update:modelValue",!1)};return e.watch(()=>s.modelValue,async a=>{await e.nextTick(),a?o.value&&!o.value.open&&o.value.showModal():o.value&&o.value.open&&o.value.close()}),c({open:p,close:r}),(a,_)=>(e.openBlock(),e.createElementBlock("dialog",e.mergeProps({ref_key:"dialogRef",ref:o,class:"dialog-view"},a.$attrs,{onClose:m}),[t.showTitleBar?(e.openBlock(),e.createElementBlock("div",l,[e.createElementVNode("span",f,[e.renderSlot(a.$slots,"title",{},void 0,!0)]),t.showCloseButton?(e.openBlock(),e.createElementBlock("a",{key:0,href:"javascript:void(0)",role:"button","aria-label":"Close the dialog",class:"dialog-close-button",onClick:e.withModifiers(r,["prevent"])},"×")):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createElementVNode("div",u,[e.renderSlot(a.$slots,"default",{},void 0,!0)])],16))}}),[["__scopeId","data-v-1ca83b6e"]]);return i.install=t=>{t.component("DialogView",i)},i}));
1
+ (function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode("._0e414b08e017324be9d8055e33e9e57a5d618fd64445845aa3d1c9c71a1cf19f{padding:20px;border-radius:5px;border:1px solid gray;outline:0!important;max-width:calc(100% - 2em);max-height:calc(100% - 2em);box-sizing:border-box;overflow:hidden}._0e414b08e017324be9d8055e33e9e57a5d618fd64445845aa3d1c9c71a1cf19f[open]{display:flex;flex-direction:column}._0e414b08e017324be9d8055e33e9e57a5d618fd64445845aa3d1c9c71a1cf19f::backdrop{background:#00000080}._f1bcbda2e971453cc116bd5c6d4a303f38ac3e0618c26210b206271398b2f619{display:flex;flex-direction:row;align-items:center;margin-bottom:.5em;min-height:24px;white-space:pre;overflow:hidden}._f365dae0582379d563ee03ab860c73c916d68f096a41a8bd34e05e566987b1f6{flex:1;text-align:center;font-weight:700;font-size:large;overflow:hidden;text-overflow:ellipsis}._2b0f1321796c8091f668958929ed738b53afcb63d79387dc52ddc75b55ffb46c{margin-left:.5em;text-decoration:none;color:#666;font-size:1.5em;line-height:1;width:24px;height:24px;display:flex;align-items:center;justify-content:center;cursor:pointer;border:none;background:none}._2b0f1321796c8091f668958929ed738b53afcb63d79387dc52ddc75b55ffb46c:hover{color:#333;background-color:#f0f0f0;border-radius:3px}._3b2bdd19ddec80c5f0f162bc4b423dafa4f687f6f831e58742be40fb0e80838e{flex:1;overflow:auto;display:flex;flex-direction:column}")),document.head.appendChild(e)}}catch(d){console.error("vite-plugin-css-injected-by-js",d)}})();
2
+ (function(e,l){typeof exports=="object"&&typeof module<"u"?module.exports=l(require("vue")):typeof define=="function"&&define.amd?define(["vue"],l):(e=typeof globalThis<"u"?globalThis:e||self,e.DialogView=l(e.Vue))})(this,(function(e){"use strict";const l={key:0,class:"_f1bcbda2e971453cc116bd5c6d4a303f38ac3e0618c26210b206271398b2f619"},c={class:"_f365dae0582379d563ee03ab860c73c916d68f096a41a8bd34e05e566987b1f6"},i={class:"_3b2bdd19ddec80c5f0f162bc4b423dafa4f687f6f831e58742be40fb0e80838e"},n=e.defineComponent({__name:"DialogView.obf",props:{modelValue:{type:Boolean},showTitleBar:{type:Boolean,default:!0},showCloseButton:{type:Boolean,default:!0}},emits:["update:modelValue"],setup(a,{expose:f,emit:r}){const s=a,u=r,o=e.ref(null),p=()=>{o.value&&!o.value.open&&o.value.showModal()},d=()=>{o.value&&o.value.open&&o.value.close()},m=()=>{s.modelValue&&u("update:modelValue",!1)};return e.watch(()=>s.modelValue,async t=>{await e.nextTick(),t?o.value&&!o.value.open&&o.value.showModal():o.value&&o.value.open&&o.value.close()}),f({open:p,close:d}),(t,b)=>(e.openBlock(),e.createElementBlock("dialog",e.mergeProps({ref_key:"dialogRef",ref:o,class:"_0e414b08e017324be9d8055e33e9e57a5d618fd64445845aa3d1c9c71a1cf19f"},t.$attrs,{onClose:m}),[a.showTitleBar?(e.openBlock(),e.createElementBlock("div",l,[e.createElementVNode("span",c,[e.renderSlot(t.$slots,"title")]),a.showCloseButton?(e.openBlock(),e.createElementBlock("a",{key:0,href:"javascript:void(0)",role:"button","aria-label":"Close the dialog",class:"_2b0f1321796c8091f668958929ed738b53afcb63d79387dc52ddc75b55ffb46c",onClick:e.withModifiers(d,["prevent"])},"×")):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createElementVNode("div",i,[e.renderSlot(t.$slots,"default")])],16))}});return n.install=a=>{a.component("DialogView",n)},n}));
package/dist/index.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- import { default as DialogView } from './DialogView.vue';
1
+ import { default as DialogView } from './DialogView.obf.vue';
2
2
  export default DialogView;
@@ -0,0 +1,103 @@
1
+ #!/usr/bin/env node
2
+ import fs from 'fs';
3
+ import path from 'path';
4
+ import crypto from 'crypto';
5
+
6
+ const SRC_DIR = path.resolve('./src');
7
+ const OBF_SUFFIX = '.obf.vue';
8
+
9
+ // ----------------------------
10
+ // 遍历 Vue 文件(跳过 .obf.vue)
11
+ // ----------------------------
12
+ function getVueFiles(dir) {
13
+ let files = [];
14
+ for (const item of fs.readdirSync(dir, { withFileTypes: true })) {
15
+ const fullPath = path.join(dir, item.name);
16
+ if (item.isDirectory()) {
17
+ files = files.concat(getVueFiles(fullPath));
18
+ } else if (item.isFile() && item.name.endsWith('.vue') && !item.name.endsWith(OBF_SUFFIX)) {
19
+ files.push(fullPath);
20
+ }
21
+ }
22
+ return files;
23
+ }
24
+
25
+ // ----------------------------
26
+ // SHA256 混淆类名
27
+ // ----------------------------
28
+ function obfClass(name) {
29
+ return '_' + crypto.createHash('sha256').update(name).digest('hex')
30
+ }
31
+
32
+ // ----------------------------
33
+ // 提取 template 内的 class
34
+ // ----------------------------
35
+ function extractClasses(template) {
36
+ const classes = new Set();
37
+
38
+ // class="..."
39
+ const classAttrRegex = /class\s*=\s*"([^"]+)"/g;
40
+ let match;
41
+ while ((match = classAttrRegex.exec(template)) !== null) {
42
+ match[1].split(/\s+/).forEach(cls => cls && classes.add(cls));
43
+ }
44
+
45
+ return classes;
46
+ }
47
+
48
+ // ----------------------------
49
+ // 替换模板和 style 中的 class
50
+ // ----------------------------
51
+ function replaceClasses(content, classMap) {
52
+ // 替换 class="..."
53
+ content = content.replace(/class\s*=\s*"([^"]+)"/g, (match, group1) => {
54
+ const replaced = group1.split(/\s+/).map(cls => classMap[cls] || cls).join(' ');
55
+ return `class="${replaced}"`;
56
+ });
57
+
58
+ // 替换 <style> 中的类名
59
+ content = content.replace(/(\.)([\w-]+)/g, (match, dot, cls) => {
60
+ return classMap[cls] ? `.${classMap[cls]}` : match;
61
+ });
62
+
63
+ return content;
64
+ }
65
+
66
+ // ----------------------------
67
+ // 主程序
68
+ // ----------------------------
69
+ function main() {
70
+ const vueFiles = getVueFiles(SRC_DIR);
71
+ const allClasses = new Set();
72
+
73
+ // 提取所有 template class
74
+ vueFiles.forEach(file => {
75
+ const content = fs.readFileSync(file, 'utf-8');
76
+ const templateMatch = content.match(/<template[^>]*>([\s\S]*?)<\/template>/);
77
+ if (!templateMatch) return;
78
+ const templateContent = templateMatch[1];
79
+ extractClasses(templateContent).forEach(cls => allClasses.add(cls));
80
+ });
81
+
82
+ // 按长度降序避免短类名覆盖长类名
83
+ const classList = Array.from(allClasses).sort((a, b) => b.length - a.length);
84
+ const classMap = {};
85
+ classList.forEach(cls => { classMap[cls] = obfClass(cls); });
86
+
87
+ console.log('🔹 类名混淆映射:');
88
+ console.table(classMap);
89
+
90
+ // 替换并生成 .obf.vue 文件
91
+ vueFiles.forEach(file => {
92
+ const content = fs.readFileSync(file, 'utf-8');
93
+ const replacedContent = replaceClasses(content, classMap);
94
+
95
+ const obfFile = path.join(path.dirname(file), path.basename(file, '.vue') + OBF_SUFFIX);
96
+ fs.writeFileSync(obfFile, replacedContent, 'utf-8');
97
+ console.log(`✅ ${file} -> ${obfFile}`);
98
+ });
99
+
100
+ console.log('🎉 所有文件混淆完成!');
101
+ }
102
+
103
+ main();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vue-dialog-view",
3
- "version": "1.0.0",
3
+ "version": "1.2.0",
4
4
  "description": "A modern Vue 3 dialog component using native dialog element",
5
5
  "type": "module",
6
6
  "main": "./dist/dialog-view.umd.js",
@@ -19,11 +19,15 @@
19
19
  "README.md",
20
20
  "tsconfig.json",
21
21
  "vite.config.ts",
22
+ "obfuscate-classes.mjs",
22
23
  "LICENSE"
23
24
  ],
24
25
  "scripts": {
25
26
  "dev": "vite",
26
- "build": "vue-tsc --noEmit && vite build",
27
+ "clean": "rimraf dist",
28
+ "obfuscate": "node ./obfuscate-classes.mjs",
29
+ "build": "npm run clean && npm run obfuscate && npm run build-only",
30
+ "build-only": "vue-tsc --noEmit && vite build",
27
31
  "preview": "vite preview"
28
32
  },
29
33
  "peerDependencies": {
@@ -31,6 +35,7 @@
31
35
  },
32
36
  "devDependencies": {
33
37
  "@vitejs/plugin-vue": "^6.0.1",
38
+ "rimraf": "^6.0.1",
34
39
  "typescript": "^5.9.3",
35
40
  "vite": "^7.1.10",
36
41
  "vite-plugin-css-injected-by-js": "^3.5.2",
@@ -51,4 +56,4 @@
51
56
  "url": "https://github.com/shc0743/MyUtility/issues"
52
57
  },
53
58
  "homepage": "https://github.com/shc0743/MyUtility/tree/main/js/lib/vue-dialog-view#readme"
54
- }
59
+ }
@@ -0,0 +1,153 @@
1
+ <template>
2
+ <dialog
3
+ ref="dialogRef"
4
+ class="_0e414b08e017324be9d8055e33e9e57a5d618fd64445845aa3d1c9c71a1cf19f"
5
+ v-bind="$attrs"
6
+ @close="handleDialogClose"
7
+ >
8
+ <div v-if="showTitleBar" class="_f1bcbda2e971453cc116bd5c6d4a303f38ac3e0618c26210b206271398b2f619">
9
+ <span class="_f365dae0582379d563ee03ab860c73c916d68f096a41a8bd34e05e566987b1f6">
10
+ <slot name="title"></slot>
11
+ </span>
12
+ <a
13
+ v-if="showCloseButton"
14
+ href="javascript:void(0)"
15
+ role="button"
16
+ aria-label="Close the dialog"
17
+ class="_2b0f1321796c8091f668958929ed738b53afcb63d79387dc52ddc75b55ffb46c"
18
+ @click.prevent="closeDialog"
19
+ >×</a>
20
+ </div>
21
+ <div class="_3b2bdd19ddec80c5f0f162bc4b423dafa4f687f6f831e58742be40fb0e80838e">
22
+ <slot></slot>
23
+ </div>
24
+ </dialog>
25
+ </template>
26
+
27
+ <script setup lang="ts">
28
+ import { ref, watch, nextTick } from 'vue'
29
+
30
+ interface Props {
31
+ modelValue: boolean
32
+ showTitleBar?: boolean
33
+ showCloseButton?: boolean
34
+ }
35
+
36
+ const props = withDefaults(defineProps<Props>(), {
37
+ showTitleBar: true,
38
+ showCloseButton: true
39
+ })
40
+
41
+ const emit = defineEmits<{
42
+ (e: 'update:modelValue', value: boolean): void
43
+ }>()
44
+
45
+ const dialogRef = ref<HTMLDialogElement | null>(null)
46
+
47
+ const openDialog = (): void => {
48
+ if (dialogRef.value && !dialogRef.value.open) {
49
+ dialogRef.value.showModal()
50
+ }
51
+ }
52
+
53
+ const closeDialog = (): void => {
54
+ if (dialogRef.value && dialogRef.value.open) {
55
+ dialogRef.value.close()
56
+ }
57
+ }
58
+
59
+ const handleDialogClose = (): void => {
60
+ if (props.modelValue) {
61
+ emit('update:modelValue', false)
62
+ }
63
+ }
64
+
65
+ watch(() => props.modelValue, async (newValue) => {
66
+ await nextTick()
67
+
68
+ if (newValue) {
69
+ if (dialogRef.value && !dialogRef.value.open) {
70
+ dialogRef.value.showModal()
71
+ }
72
+ } else {
73
+ if (dialogRef.value && dialogRef.value.open) {
74
+ dialogRef.value.close()
75
+ }
76
+ }
77
+ })
78
+
79
+ defineExpose({
80
+ open: openDialog,
81
+ close: closeDialog,
82
+ })
83
+ </script>
84
+
85
+ <style>
86
+ ._0e414b08e017324be9d8055e33e9e57a5d618fd64445845aa3d1c9c71a1cf19f {
87
+ padding: 20px;
88
+ border-radius: 5px;
89
+ border: 1px solid gray;
90
+ outline: 0 !important;
91
+ max-width: calc(100% - 2em);
92
+ max-height: calc(100% - 2em);
93
+ box-sizing: border-box;
94
+ overflow: hidden;
95
+ }
96
+
97
+ ._0e414b08e017324be9d8055e33e9e57a5d618fd64445845aa3d1c9c71a1cf19f[open] {
98
+ display: flex;
99
+ flex-direction: column;
100
+ }
101
+
102
+ ._0e414b08e017324be9d8055e33e9e57a5d618fd64445845aa3d1c9c71a1cf19f::backdrop {
103
+ background: rgba(0, 0, 0, 0.5);
104
+ }
105
+
106
+ ._f1bcbda2e971453cc116bd5c6d4a303f38ac3e0618c26210b206271398b2f619 {
107
+ display: flex;
108
+ flex-direction: row;
109
+ align-items: center;
110
+ margin-bottom: 0.5em;
111
+ min-height: 24px;
112
+ white-space: pre;
113
+ overflow: hidden;
114
+ }
115
+
116
+ ._f365dae0582379d563ee03ab860c73c916d68f096a41a8bd34e05e566987b1f6 {
117
+ flex: 1;
118
+ text-align: center;
119
+ font-weight: bold;
120
+ font-size: large;
121
+ overflow: hidden;
122
+ text-overflow: ellipsis;
123
+ }
124
+
125
+ ._2b0f1321796c8091f668958929ed738b53afcb63d79387dc52ddc75b55ffb46c {
126
+ margin-left: 0.5em;
127
+ text-decoration: none;
128
+ color: #666;
129
+ font-size: 1.5em;
130
+ line-height: 1;
131
+ width: 24px;
132
+ height: 24px;
133
+ display: flex;
134
+ align-items: center;
135
+ justify-content: center;
136
+ cursor: pointer;
137
+ border: none;
138
+ background: none;
139
+ }
140
+
141
+ ._2b0f1321796c8091f668958929ed738b53afcb63d79387dc52ddc75b55ffb46c:hover {
142
+ color: #333;
143
+ background-color: #f0f0f0;
144
+ border-radius: 3px;
145
+ }
146
+
147
+ ._3b2bdd19ddec80c5f0f162bc4b423dafa4f687f6f831e58742be40fb0e80838e {
148
+ flex: 1;
149
+ overflow: auto;
150
+ display: flex;
151
+ flex-direction: column;
152
+ }
153
+ </style>
@@ -82,21 +82,21 @@ defineExpose({
82
82
  })
83
83
  </script>
84
84
 
85
- <style scoped>
85
+ <style>
86
86
  .dialog-view {
87
87
  padding: 20px;
88
88
  border-radius: 5px;
89
89
  border: 1px solid gray;
90
90
  outline: 0 !important;
91
+ max-width: calc(100% - 2em);
92
+ max-height: calc(100% - 2em);
93
+ box-sizing: border-box;
94
+ overflow: hidden;
91
95
  }
92
96
 
93
97
  .dialog-view[open] {
94
98
  display: flex;
95
99
  flex-direction: column;
96
- position: fixed;
97
- margin: auto;
98
- max-width: 90vw;
99
- max-height: 90vh;
100
100
  }
101
101
 
102
102
  .dialog-view::backdrop {
@@ -109,13 +109,17 @@ defineExpose({
109
109
  align-items: center;
110
110
  margin-bottom: 0.5em;
111
111
  min-height: 24px;
112
+ white-space: pre;
113
+ overflow: hidden;
112
114
  }
113
115
 
114
116
  .dialog-title {
115
117
  flex: 1;
116
118
  text-align: center;
117
119
  font-weight: bold;
118
- font-size: 1.1em;
120
+ font-size: large;
121
+ overflow: hidden;
122
+ text-overflow: ellipsis;
119
123
  }
120
124
 
121
125
  .dialog-close-button {
package/src/index.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { App } from 'vue'
2
- import DialogView from './DialogView.vue'
2
+ import DialogView from './DialogView.obf.vue'
3
3
 
4
4
  DialogView.install = (app: App) => {
5
5
  app.component('DialogView', DialogView)
package/vite.config.ts CHANGED
@@ -27,5 +27,10 @@ export default defineConfig({
27
27
  }
28
28
  },
29
29
  cssCodeSplit: false,
30
- }
30
+ },
31
+ css: {
32
+ modules: {
33
+ generateScopedName: '[hash:sha256]',
34
+ },
35
+ },
31
36
  })