@dsz-examaware/plugin-demo 0.1.1
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/LICENSE +674 -0
- package/README.md +27 -0
- package/dist/main/index.cjs +538 -0
- package/dist/main/index.cjs.map +1 -0
- package/dist/main/index.d.ts +2 -0
- package/dist/renderer/assets/examaware-plugin-template.css +43 -0
- package/dist/renderer/components/PluginSettingsPage.vue.d.ts +7 -0
- package/dist/renderer/index.mjs +318 -0
- package/dist/renderer/index.mjs.map +1 -0
- package/dist/renderer/main.d.ts +2 -0
- package/env.d.ts +7 -0
- package/package.json +51 -0
- package/schema.json +21 -0
- package/src/main/index.ts +54 -0
- package/src/renderer/components/PluginSettingsPage.vue +9 -0
- package/src/renderer/main.ts +34 -0
- package/tsconfig.json +15 -0
- package/tsconfig.node.json +10 -0
- package/vite.config.ts +51 -0
- package/vite.main.config.ts +37 -0
|
@@ -0,0 +1,318 @@
|
|
|
1
|
+
const B = [], D = (t) => t.charCodeAt(0) === 111 && t.charCodeAt(1) === 110 && // uppercase letter
|
|
2
|
+
(t.charCodeAt(2) > 122 || t.charCodeAt(2) < 97), E = Object.assign, f = Array.isArray, p = (t) => typeof t == "function", u = (t) => typeof t == "string", U = (t) => typeof t == "symbol", m = (t) => t !== null && typeof t == "object";
|
|
3
|
+
let R;
|
|
4
|
+
const k = () => R || (R = typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : typeof global < "u" ? global : {});
|
|
5
|
+
function A(t) {
|
|
6
|
+
if (f(t)) {
|
|
7
|
+
const e = {};
|
|
8
|
+
for (let n = 0; n < t.length; n++) {
|
|
9
|
+
const l = t[n], s = u(l) ? Y(l) : A(l);
|
|
10
|
+
if (s)
|
|
11
|
+
for (const i in s)
|
|
12
|
+
e[i] = s[i];
|
|
13
|
+
}
|
|
14
|
+
return e;
|
|
15
|
+
} else if (u(t) || m(t))
|
|
16
|
+
return t;
|
|
17
|
+
}
|
|
18
|
+
const G = /;(?![^(]*\))/g, M = /:([^]+)/, L = /\/\*[^]*?\*\//g;
|
|
19
|
+
function Y(t) {
|
|
20
|
+
const e = {};
|
|
21
|
+
return t.replace(L, "").split(G).forEach((n) => {
|
|
22
|
+
if (n) {
|
|
23
|
+
const l = n.split(M);
|
|
24
|
+
l.length > 1 && (e[l[0].trim()] = l[1].trim());
|
|
25
|
+
}
|
|
26
|
+
}), e;
|
|
27
|
+
}
|
|
28
|
+
function I(t) {
|
|
29
|
+
let e = "";
|
|
30
|
+
if (u(t))
|
|
31
|
+
e = t;
|
|
32
|
+
else if (f(t))
|
|
33
|
+
for (let n = 0; n < t.length; n++) {
|
|
34
|
+
const l = I(t[n]);
|
|
35
|
+
l && (e += l + " ");
|
|
36
|
+
}
|
|
37
|
+
else if (m(t))
|
|
38
|
+
for (const n in t)
|
|
39
|
+
t[n] && (e += n + " ");
|
|
40
|
+
return e.trim();
|
|
41
|
+
}
|
|
42
|
+
new Set(
|
|
43
|
+
/* @__PURE__ */ Object.getOwnPropertyNames(Symbol).filter((t) => t !== "arguments" && t !== "caller").map((t) => Symbol[t]).filter(U)
|
|
44
|
+
);
|
|
45
|
+
function P(t) {
|
|
46
|
+
return t ? !!t.__v_raw : !1;
|
|
47
|
+
}
|
|
48
|
+
function q(t) {
|
|
49
|
+
return t ? t.__v_isRef === !0 : !1;
|
|
50
|
+
}
|
|
51
|
+
let y = null, H = null;
|
|
52
|
+
const K = (t) => t.__isTeleport;
|
|
53
|
+
function w(t, e) {
|
|
54
|
+
t.shapeFlag & 6 && t.component ? (t.transition = e, w(t.component.subTree, e)) : t.shapeFlag & 128 ? (t.ssContent.transition = e.clone(t.ssContent), t.ssFallback.transition = e.clone(t.ssFallback)) : t.transition = e;
|
|
55
|
+
}
|
|
56
|
+
// @__NO_SIDE_EFFECTS__
|
|
57
|
+
function x(t, e) {
|
|
58
|
+
return p(t) ? (
|
|
59
|
+
// #8236: extend call and options.name access are considered side-effects
|
|
60
|
+
// by Rollup, so we have to wrap it in a pure-annotated IIFE.
|
|
61
|
+
E({ name: t.name }, e, { setup: t })
|
|
62
|
+
) : t;
|
|
63
|
+
}
|
|
64
|
+
k().requestIdleCallback;
|
|
65
|
+
k().cancelIdleCallback;
|
|
66
|
+
const J = /* @__PURE__ */ Symbol.for("v-ndc"), Q = {}, V = (t) => Object.getPrototypeOf(t) === Q, W = (t) => t.__isSuspense, O = /* @__PURE__ */ Symbol.for("v-fgt"), X = /* @__PURE__ */ Symbol.for("v-txt"), Z = /* @__PURE__ */ Symbol.for("v-cmt"), b = [];
|
|
67
|
+
let a = null;
|
|
68
|
+
function $(t = !1) {
|
|
69
|
+
b.push(a = t ? null : []);
|
|
70
|
+
}
|
|
71
|
+
function v() {
|
|
72
|
+
b.pop(), a = b[b.length - 1] || null;
|
|
73
|
+
}
|
|
74
|
+
let _ = 1;
|
|
75
|
+
function d(t, e = !1) {
|
|
76
|
+
_ += t, t < 0 && a && e && (a.hasOnce = !0);
|
|
77
|
+
}
|
|
78
|
+
function tt(t) {
|
|
79
|
+
return t.dynamicChildren = _ > 0 ? a || B : null, v(), _ > 0 && a && a.push(t), t;
|
|
80
|
+
}
|
|
81
|
+
function et(t, e, n, l, s, i) {
|
|
82
|
+
return tt(
|
|
83
|
+
z(
|
|
84
|
+
t,
|
|
85
|
+
e,
|
|
86
|
+
n,
|
|
87
|
+
l,
|
|
88
|
+
s,
|
|
89
|
+
i,
|
|
90
|
+
!0
|
|
91
|
+
)
|
|
92
|
+
);
|
|
93
|
+
}
|
|
94
|
+
function F(t) {
|
|
95
|
+
return t ? t.__v_isVNode === !0 : !1;
|
|
96
|
+
}
|
|
97
|
+
const j = ({ key: t }) => t ?? null, S = ({
|
|
98
|
+
ref: t,
|
|
99
|
+
ref_key: e,
|
|
100
|
+
ref_for: n
|
|
101
|
+
}) => (typeof t == "number" && (t = "" + t), t != null ? u(t) || q(t) || p(t) ? { i: y, r: t, k: e, f: !!n } : t : null);
|
|
102
|
+
function z(t, e = null, n = null, l = 0, s = null, i = t === O ? 0 : 1, o = !1, r = !1) {
|
|
103
|
+
const c = {
|
|
104
|
+
__v_isVNode: !0,
|
|
105
|
+
__v_skip: !0,
|
|
106
|
+
type: t,
|
|
107
|
+
props: e,
|
|
108
|
+
key: e && j(e),
|
|
109
|
+
ref: e && S(e),
|
|
110
|
+
scopeId: H,
|
|
111
|
+
slotScopeIds: null,
|
|
112
|
+
children: n,
|
|
113
|
+
component: null,
|
|
114
|
+
suspense: null,
|
|
115
|
+
ssContent: null,
|
|
116
|
+
ssFallback: null,
|
|
117
|
+
dirs: null,
|
|
118
|
+
transition: null,
|
|
119
|
+
el: null,
|
|
120
|
+
anchor: null,
|
|
121
|
+
target: null,
|
|
122
|
+
targetStart: null,
|
|
123
|
+
targetAnchor: null,
|
|
124
|
+
staticCount: 0,
|
|
125
|
+
shapeFlag: i,
|
|
126
|
+
patchFlag: l,
|
|
127
|
+
dynamicProps: s,
|
|
128
|
+
dynamicChildren: null,
|
|
129
|
+
appContext: null,
|
|
130
|
+
ctx: y
|
|
131
|
+
};
|
|
132
|
+
return r ? (N(c, n), i & 128 && t.normalize(c)) : n && (c.shapeFlag |= u(n) ? 8 : 16), _ > 0 && // avoid a block node from tracking itself
|
|
133
|
+
!o && // has current parent block
|
|
134
|
+
a && // presence of a patch flag indicates this node needs patching on updates.
|
|
135
|
+
// component nodes also should always be patched, because even if the
|
|
136
|
+
// component doesn't need to update, it needs to persist the instance on to
|
|
137
|
+
// the next vnode so that it can be properly unmounted later.
|
|
138
|
+
(c.patchFlag > 0 || i & 6) && // the EVENTS flag is only for hydration and if it is the only flag, the
|
|
139
|
+
// vnode should not be considered dynamic due to handler caching.
|
|
140
|
+
c.patchFlag !== 32 && a.push(c), c;
|
|
141
|
+
}
|
|
142
|
+
const g = nt;
|
|
143
|
+
function nt(t, e = null, n = null, l = 0, s = null, i = !1) {
|
|
144
|
+
if ((!t || t === J) && (t = Z), F(t)) {
|
|
145
|
+
const r = h(
|
|
146
|
+
t,
|
|
147
|
+
e,
|
|
148
|
+
!0
|
|
149
|
+
/* mergeRef: true */
|
|
150
|
+
);
|
|
151
|
+
return n && N(r, n), _ > 0 && !i && a && (r.shapeFlag & 6 ? a[a.indexOf(t)] = r : a.push(r)), r.patchFlag = -2, r;
|
|
152
|
+
}
|
|
153
|
+
if (ct(t) && (t = t.__vccOpts), e) {
|
|
154
|
+
e = st(e);
|
|
155
|
+
let { class: r, style: c } = e;
|
|
156
|
+
r && !u(r) && (e.class = I(r)), m(c) && (P(c) && !f(c) && (c = E({}, c)), e.style = A(c));
|
|
157
|
+
}
|
|
158
|
+
const o = u(t) ? 1 : W(t) ? 128 : K(t) ? 64 : m(t) ? 4 : p(t) ? 2 : 0;
|
|
159
|
+
return z(
|
|
160
|
+
t,
|
|
161
|
+
e,
|
|
162
|
+
n,
|
|
163
|
+
l,
|
|
164
|
+
s,
|
|
165
|
+
o,
|
|
166
|
+
i,
|
|
167
|
+
!0
|
|
168
|
+
);
|
|
169
|
+
}
|
|
170
|
+
function st(t) {
|
|
171
|
+
return t ? P(t) || V(t) ? E({}, t) : t : null;
|
|
172
|
+
}
|
|
173
|
+
function h(t, e, n = !1, l = !1) {
|
|
174
|
+
const { props: s, ref: i, patchFlag: o, children: r, transition: c } = t, C = e ? it(s || {}, e) : s, T = {
|
|
175
|
+
__v_isVNode: !0,
|
|
176
|
+
__v_skip: !0,
|
|
177
|
+
type: t.type,
|
|
178
|
+
props: C,
|
|
179
|
+
key: C && j(C),
|
|
180
|
+
ref: e && e.ref ? (
|
|
181
|
+
// #2078 in the case of <component :is="vnode" ref="extra"/>
|
|
182
|
+
// if the vnode itself already has a ref, cloneVNode will need to merge
|
|
183
|
+
// the refs so the single vnode can be set on multiple refs
|
|
184
|
+
n && i ? f(i) ? i.concat(S(e)) : [i, S(e)] : S(e)
|
|
185
|
+
) : i,
|
|
186
|
+
scopeId: t.scopeId,
|
|
187
|
+
slotScopeIds: t.slotScopeIds,
|
|
188
|
+
children: r,
|
|
189
|
+
target: t.target,
|
|
190
|
+
targetStart: t.targetStart,
|
|
191
|
+
targetAnchor: t.targetAnchor,
|
|
192
|
+
staticCount: t.staticCount,
|
|
193
|
+
shapeFlag: t.shapeFlag,
|
|
194
|
+
// if the vnode is cloned with extra props, we can no longer assume its
|
|
195
|
+
// existing patch flag to be reliable and need to add the FULL_PROPS flag.
|
|
196
|
+
// note: preserve flag for fragments since they use the flag for children
|
|
197
|
+
// fast paths only.
|
|
198
|
+
patchFlag: e && t.type !== O ? o === -1 ? 16 : o | 16 : o,
|
|
199
|
+
dynamicProps: t.dynamicProps,
|
|
200
|
+
dynamicChildren: t.dynamicChildren,
|
|
201
|
+
appContext: t.appContext,
|
|
202
|
+
dirs: t.dirs,
|
|
203
|
+
transition: c,
|
|
204
|
+
// These should technically only be non-null on mounted VNodes. However,
|
|
205
|
+
// they *should* be copied for kept-alive vnodes. So we just always copy
|
|
206
|
+
// them since them being non-null during a mount doesn't affect the logic as
|
|
207
|
+
// they will simply be overwritten.
|
|
208
|
+
component: t.component,
|
|
209
|
+
suspense: t.suspense,
|
|
210
|
+
ssContent: t.ssContent && h(t.ssContent),
|
|
211
|
+
ssFallback: t.ssFallback && h(t.ssFallback),
|
|
212
|
+
placeholder: t.placeholder,
|
|
213
|
+
el: t.el,
|
|
214
|
+
anchor: t.anchor,
|
|
215
|
+
ctx: t.ctx,
|
|
216
|
+
ce: t.ce
|
|
217
|
+
};
|
|
218
|
+
return c && l && w(
|
|
219
|
+
T,
|
|
220
|
+
c.clone(T)
|
|
221
|
+
), T;
|
|
222
|
+
}
|
|
223
|
+
function lt(t = " ", e = 0) {
|
|
224
|
+
return g(X, null, t, e);
|
|
225
|
+
}
|
|
226
|
+
function N(t, e) {
|
|
227
|
+
let n = 0;
|
|
228
|
+
const { shapeFlag: l } = t;
|
|
229
|
+
if (e == null)
|
|
230
|
+
e = null;
|
|
231
|
+
else if (f(e))
|
|
232
|
+
n = 16;
|
|
233
|
+
else if (typeof e == "object")
|
|
234
|
+
if (l & 65) {
|
|
235
|
+
const s = e.default;
|
|
236
|
+
s && (s._c && (s._d = !1), N(t, s()), s._c && (s._d = !0));
|
|
237
|
+
return;
|
|
238
|
+
} else
|
|
239
|
+
n = 32, !e._ && !V(e) && (e._ctx = y);
|
|
240
|
+
else p(e) ? (e = { default: e, _ctx: y }, n = 32) : (e = String(e), l & 64 ? (n = 16, e = [lt(e)]) : n = 8);
|
|
241
|
+
t.children = e, t.shapeFlag |= n;
|
|
242
|
+
}
|
|
243
|
+
function it(...t) {
|
|
244
|
+
const e = {};
|
|
245
|
+
for (let n = 0; n < t.length; n++) {
|
|
246
|
+
const l = t[n];
|
|
247
|
+
for (const s in l)
|
|
248
|
+
if (s === "class")
|
|
249
|
+
e.class !== l.class && (e.class = I([e.class, l.class]));
|
|
250
|
+
else if (s === "style")
|
|
251
|
+
e.style = A([e.style, l.style]);
|
|
252
|
+
else if (D(s)) {
|
|
253
|
+
const i = e[s], o = l[s];
|
|
254
|
+
o && i !== o && !(f(i) && i.includes(o)) && (e[s] = i ? [].concat(i, o) : o);
|
|
255
|
+
} else s !== "" && (e[s] = l[s]);
|
|
256
|
+
}
|
|
257
|
+
return e;
|
|
258
|
+
}
|
|
259
|
+
{
|
|
260
|
+
const t = k(), e = (n, l) => {
|
|
261
|
+
let s;
|
|
262
|
+
return (s = t[n]) || (s = t[n] = []), s.push(l), (i) => {
|
|
263
|
+
s.length > 1 ? s.forEach((o) => o(i)) : s[0](i);
|
|
264
|
+
};
|
|
265
|
+
};
|
|
266
|
+
e(
|
|
267
|
+
"__VUE_INSTANCE_SETTERS__",
|
|
268
|
+
(n) => n
|
|
269
|
+
), e(
|
|
270
|
+
"__VUE_SSR_SETTERS__",
|
|
271
|
+
(n) => n
|
|
272
|
+
);
|
|
273
|
+
}
|
|
274
|
+
function ct(t) {
|
|
275
|
+
return p(t) && "__vccOpts" in t;
|
|
276
|
+
}
|
|
277
|
+
function ot(t, e, n) {
|
|
278
|
+
try {
|
|
279
|
+
d(-1);
|
|
280
|
+
const l = arguments.length;
|
|
281
|
+
return l === 2 ? m(e) && !f(e) ? F(e) ? g(t, null, [e]) : g(t, e) : g(t, null, e) : (l > 3 ? n = Array.prototype.slice.call(arguments, 2) : l === 3 && F(n) && (n = [n]), g(t, e, n));
|
|
282
|
+
} finally {
|
|
283
|
+
d(1);
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
const rt = /* @__PURE__ */ x({
|
|
287
|
+
__name: "PluginSettingsPage",
|
|
288
|
+
props: {
|
|
289
|
+
ctx: {}
|
|
290
|
+
},
|
|
291
|
+
setup(t) {
|
|
292
|
+
return (e, n) => ($(), et("p", null, "插件设置页面"));
|
|
293
|
+
}
|
|
294
|
+
}), at = "examaware-plugin-template-settings";
|
|
295
|
+
async function ut(t) {
|
|
296
|
+
if (t.app !== "renderer") return;
|
|
297
|
+
const n = t.desktopApi?.ui?.settings;
|
|
298
|
+
if (!n) {
|
|
299
|
+
t.logger.warn("Desktop API does not expose settings UI in this build.");
|
|
300
|
+
return;
|
|
301
|
+
}
|
|
302
|
+
const l = /* @__PURE__ */ x({
|
|
303
|
+
name: "ExamAwarePluginSettingsEntry",
|
|
304
|
+
setup() {
|
|
305
|
+
return () => ot(rt, { ctx: t });
|
|
306
|
+
}
|
|
307
|
+
}), s = await n.registerPage({
|
|
308
|
+
id: at,
|
|
309
|
+
label: "Plugin Settings",
|
|
310
|
+
icon: "extension",
|
|
311
|
+
order: 50,
|
|
312
|
+
component: () => Promise.resolve(l)
|
|
313
|
+
});
|
|
314
|
+
s && t.effect(() => () => s.dispose());
|
|
315
|
+
}
|
|
316
|
+
export {
|
|
317
|
+
ut as default
|
|
318
|
+
};
|