@deepwhale-cn/dsh-contract-check 0.1.1 → 0.1.3
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/lib/client.js +4 -19
- package/package.json +1 -1
package/lib/client.js
CHANGED
|
@@ -13,23 +13,8 @@ window.__ModuleLoader__.load({
|
|
|
13
13
|
const Ico = ({ size = 18 } = {}) => h('svg', { width: size, height: size, viewBox: '0 0 24 24', fill: 'none', stroke: 'currentColor', strokeWidth: 1.8, strokeLinecap: 'round' }, [
|
|
14
14
|
h('path', { key: 'a', d: 'M4 5h16v14H4z' }), h('path', { key: 'b', d: 'M8 9h8M8 13h8M8 17h5' }),
|
|
15
15
|
]);
|
|
16
|
-
const CSS =
|
|
17
|
-
.gn-root{
|
|
18
|
-
.gn-head{display:flex;align-items:center;gap:10px}
|
|
19
|
-
.gn-title{font-size:16px;font-weight:600}
|
|
20
|
-
.gn-sub{color:var(--dsw-alias-text-secondary,#8b98a8);font-size:12px}
|
|
21
|
-
.gn-ver{margin-left:8px;font-size:11px;opacity:.75;border:1px solid var(--dsw-alias-border-l1,rgba(255,255,255,.12));border-radius:6px;padding:0 5px}
|
|
22
|
-
.gn-card{border:1px solid var(--dsw-alias-border-l1,rgba(255,255,255,.08));border-radius:12px;background:var(--dsw-alias-bg-layer-1,rgba(255,255,255,.03));padding:14px;display:flex;flex-direction:column;gap:10px}
|
|
23
|
-
.gn-row{display:flex;gap:8px;align-items:center}
|
|
24
|
-
.gn-label{font-size:12px;color:var(--dsw-alias-text-secondary,#8b98a8);width:92px;flex:none}
|
|
25
|
-
.gn-input,.gn-select{flex:1;min-width:0;padding:7px 9px;border-radius:8px;border:1px solid var(--dsw-alias-border-l1,rgba(255,255,255,.12));background:var(--dsw-alias-bg-base,transparent);color:inherit;font-size:13px;font-family:inherit}
|
|
26
|
-
.gn-btn{padding:7px 16px;border-radius:8px;border:1px solid var(--dsw-alias-border-l1,rgba(255,255,255,.14));background:var(--dsw-alias-brand-primary,#2f6f9f);color:#fff;font-size:13px;cursor:pointer}
|
|
27
|
-
.gn-btn[disabled]{opacity:.55;cursor:default}
|
|
28
|
-
.gn-out{white-space:pre-wrap;word-break:break-word;font-family:ui-monospace,Menlo,monospace;font-size:12px;line-height:1.65;max-height:420px;overflow:auto;background:var(--dsw-alias-bg-layer-2,rgba(0,0,0,.18));border-radius:8px;padding:10px}
|
|
29
|
-
.gn-ok{color:var(--dsw-alias-state-success-primary,#46b47a)}.gn-err{color:var(--dsw-alias-state-error-primary,#e0645a)}
|
|
30
|
-
.gn-tip{font-size:12px;color:var(--dsw-alias-text-secondary,#8b98a8)}
|
|
31
|
-
.gn-badge{position:absolute;right:16px;bottom:12px;display:inline-flex;opacity:.9}
|
|
32
|
-
.gn-badge img{width:121px;height:20px;display:block}
|
|
16
|
+
const CSS = `.gn-root.ct-root{position:relative;display:flex;flex-direction:column;gap:14px;padding:18px 22px 52px;height:100%;overflow:auto}.ct-root .gn-head{display:flex;align-items:center;gap:10px}.ct-root .gn-title{font-size:16px;font-weight:600}.ct-root .gn-sub{color:var(--dsw-alias-text-secondary,#8b98a8);font-size:12px}.ct-root .gn-ver{margin-left:8px;font-size:11px;opacity:.75;border:1px solid var(--dsw-alias-border-l1,rgba(255,255,255,.12));border-radius:6px;padding:0 5px}.ct-root .gn-card{border:1px solid var(--dsw-alias-border-l1,rgba(255,255,255,.08));border-radius:12px;background:var(--dsw-alias-bg-layer-1,rgba(255,255,255,.03));padding:14px;display:flex;flex-direction:column;gap:10px}.ct-root .gn-row{display:flex;gap:8px;align-items:center}.ct-root .gn-label{font-size:12px;color:var(--dsw-alias-text-secondary,#8b98a8);width:92px;flex:none}.ct-root .gn-input,.ct-root .gn-select{flex:1;min-width:0;padding:7px 9px;border-radius:8px;border:1px solid var(--dsw-alias-border-l1,rgba(255,255,255,.12));background:var(--dsw-alias-bg-base,transparent);color:inherit;font-size:13px;font-family:inherit}.ct-root .gn-btn{padding:7px 16px;border-radius:8px;border:1px solid var(--dsw-alias-border-l1,rgba(255,255,255,.14));background:var(--dsw-alias-brand-primary,#2f6f9f);color:#fff;font-size:13px;cursor:pointer}.ct-root .gn-btn[disabled]{opacity:.55;cursor:default}.ct-root .gn-out{white-space:pre-wrap;word-break:break-word;font-family:ui-monospace,Menlo,monospace;font-size:12px;line-height:1.65;max-height:420px;overflow:auto;background:var(--dsw-alias-bg-layer-2,rgba(0,0,0,.18));border-radius:8px;padding:10px}.ct-root .gn-ok{color:var(--dsw-alias-state-success-primary,#46b47a)}.ct-root .gn-err{color:var(--dsw-alias-state-error-primary,#e0645a)}.ct-root .gn-tip{font-size:12px;color:var(--dsw-alias-text-secondary,#8b98a8)}.ct-root .gn-badge{position:absolute;right:16px;bottom:12px;display:inline-flex;opacity:.9}.ct-root .gn-badge img{width:121px;height:20px;display:block}/* ── 视觉区分(2026-10-29):每个法律插件一套主色/圆角/头部处理,避免同一张脸 ── */
|
|
17
|
+
.gn-root.ct-root{--acc:#2F80ED;--acc2:#56CCF2;--tint:rgba(47,128,237,.10);--radius:12px}.ct-root .gn-head>svg{width:30px!important;height:30px!important;padding:6px;box-sizing:border-box;border-radius:10px;background:var(--tint);color:var(--acc)}.ct-root .gn-ver{border:1px solid var(--dsw-alias-border-l1,rgba(0,0,0,.12))!important;background:var(--tint);color:var(--acc);opacity:1}.ct-root .gn-card{border-left:3px solid var(--acc);border-radius:var(--radius)}.ct-root .gn-btn{background:linear-gradient(96deg,var(--acc),var(--acc2));border-color:transparent;color:#fff}.ct-root .gn-btn:hover{filter:brightness(1.06)}.ct-root .gn-out{background:var(--tint);border-left:2px solid var(--acc);font-size:12px}
|
|
33
18
|
`;
|
|
34
19
|
function 面板() {
|
|
35
20
|
const [op, 设op] = react.useState(OPS[0] ? OPS[0].key : '');
|
|
@@ -45,7 +30,7 @@ window.__ModuleLoader__.load({
|
|
|
45
30
|
设结果(await res.json());
|
|
46
31
|
} catch (e) { 设结果({ ok: false, text: String(e) }); } finally { 设跑(false); }
|
|
47
32
|
};
|
|
48
|
-
return h('div', { className: 'gn-root' }, [
|
|
33
|
+
return h('div', { className: 'gn-root ct-root' }, [
|
|
49
34
|
h('style', { key: 'c' }, CSS),
|
|
50
35
|
h('div', { key: 'h', className: 'gn-head' }, [
|
|
51
36
|
h(Ico, { key: 'i' }),
|
|
@@ -79,7 +64,7 @@ window.__ModuleLoader__.load({
|
|
|
79
64
|
const inject = ['slots'];
|
|
80
65
|
function apply(ctx) {
|
|
81
66
|
const 试 = (n, f) => { try { f(); } catch (e) { try { console.warn('[contract-check] 插槽注册失败:' + n, e && e.message); } catch {} } };
|
|
82
|
-
试('侧栏图标', () => ctx.slots.inject(SLOT_ICON, function* () { yield ctx.slots.register({ name: SLOT_ICON, id: PANEL_ID, order:
|
|
67
|
+
试('侧栏图标', () => ctx.slots.inject(SLOT_ICON, function* () { yield ctx.slots.register({ name: SLOT_ICON, id: PANEL_ID, order: 45, label: '法律·合同体检' }, Ico); }));
|
|
83
68
|
试('主面板', () => ctx.slots.inject(SLOT_MAIN, function* () { yield ctx.slots.register({ name: SLOT_MAIN, key: PANEL_ID }, 面板); }));
|
|
84
69
|
}
|
|
85
70
|
exports.inject = inject; exports.apply = apply; return module.exports;
|