@goodandready/dsh-subscriptions 0.2.7 → 0.2.8
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 +66 -20
- package/package.json +1 -1
package/lib/client.js
CHANGED
|
@@ -6,27 +6,39 @@ window.__ModuleLoader__.load({
|
|
|
6
6
|
const React = require('react')
|
|
7
7
|
|
|
8
8
|
const CSS =
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
9
|
+
// card — same structure as core PluginCard (bash, agent-loop, web-search)
|
|
10
|
+
'.dsub-card{list-style:none;border:1px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-bg-layer-3);border-radius:12px;transition:border-color .16s,background .16s}' +
|
|
11
|
+
'.dsub-card:hover{border-color:var(--dsw-alias-label-dimmed)}' +
|
|
12
|
+
'.dsub-cardOpen{background:var(--dsw-alias-bg-layer-2);border-color:var(--dsw-alias-label-dimmed)}' +
|
|
13
|
+
'.dsub-header{appearance:none;width:100%;font:inherit;color:inherit;text-align:left;cursor:pointer;background:0 0;border:0;border-radius:12px;align-items:center;gap:12px;padding:14px 16px;display:flex}' +
|
|
14
|
+
'.dsub-header:focus-visible{outline:2px solid var(--dsw-alias-brand-primary);outline-offset:-2px}' +
|
|
15
|
+
'.dsub-headText{flex-direction:column;flex:1;gap:4px;min-width:0;display:flex}' +
|
|
16
|
+
'.dsub-name{color:var(--dsw-alias-label-primary);font-size:15px;font-weight:600;line-height:1.4}' +
|
|
17
|
+
'.dsub-description{color:var(--dsw-alias-label-tertiary);font-size:13px;line-height:1.5}' +
|
|
18
|
+
'.dsub-chevron{color:var(--dsw-alias-label-tertiary);flex:none;transition:transform .16s}' +
|
|
19
|
+
'.dsub-chevronOpen{transform:rotate(180deg)}' +
|
|
20
|
+
'.dsub-body{border-top:1px solid var(--dsw-alias-border-l2);margin:0 16px;padding:16px 0 8px}' +
|
|
21
|
+
// existing dsub classes kept for SubsSection internals
|
|
22
|
+
'.dsub-wrap{display:flex;flex-direction:column;gap:22px;padding:4px 0;max-width:760px}' +
|
|
23
|
+
'.dsub-block{display:flex;flex-direction:column;gap:10px}' +
|
|
24
|
+
'.dsub-h{font-size:14px;font-weight:600;color:var(--dsw-alias-label-primary)}' +
|
|
25
|
+
'.dsub-sub{font-size:12px;color:var(--dsw-alias-label-secondary)}' +
|
|
26
|
+
'.dsub-row{display:flex;gap:8px;align-items:center;flex-wrap:wrap}' +
|
|
27
|
+
'.dsub-row input,.dsub-field input,.dsub-row select{background:var(--dsw-alias-bg-layer-1);border:1px solid var(--dsw-alias-border-l1);color:var(--dsw-alias-label-primary);border-radius:6px;padding:6px 8px;font-size:13px}' +
|
|
28
|
+
'.dsub-grow{flex:1;min-width:180px}' +
|
|
29
|
+
'.dsub-field{display:flex;flex-direction:column;gap:4px;font-size:12px;color:var(--dsw-alias-label-secondary)}' +
|
|
30
|
+
'.dsub-mini{border:1px solid var(--dsw-alias-border-l2);background:transparent;color:var(--dsw-alias-label-primary);border-radius:6px;height:28px;padding:0 8px;cursor:pointer}' +
|
|
31
|
+
'.dsub-save{background:var(--dsw-alias-brand-primary);color:#fff;border:none;border-radius:6px;padding:7px 14px;font-size:13px;cursor:pointer}' +
|
|
32
|
+
'.dsub-ok{font-size:12px;color:var(--dsw-alias-state-success-primary)}' +
|
|
33
|
+
'.dsub-bad{font-size:12px;color:var(--dsw-alias-state-error-primary)}' +
|
|
34
|
+
'.dsub-badge{font-size:11px;padding:2px 8px;border-radius:999px;border:1px solid var(--dsw-alias-border-l2);color:var(--dsw-alias-label-secondary);white-space:nowrap}' +
|
|
35
|
+
'.dsub-badge-on{color:var(--dsw-alias-state-success-primary);border-color:currentColor}' +
|
|
36
|
+
'.dsub-badge-warn{color:var(--dsw-alias-state-warning-primary);border-color:currentColor}' +
|
|
37
|
+
'.dsub-link{background:none;border:none;color:var(--dsw-alias-label-secondary);cursor:pointer;font-size:12px;padding:0}' +
|
|
38
|
+
'.dsub-verify{font-size:12px;color:var(--dsw-alias-state-warning-primary)}' +
|
|
39
|
+
'.dsub-verify a{color:var(--dsw-alias-brand-primary)}'
|
|
28
40
|
|
|
29
|
-
|
|
41
|
+
const cssId = 'dsh-subscriptions/settings.module.css'
|
|
30
42
|
if (typeof document !== 'undefined' && !document.querySelector('style[data-plugin-css="' + cssId + '"]')) {
|
|
31
43
|
const tag = document.createElement('style')
|
|
32
44
|
tag.textContent = CSS
|
|
@@ -371,6 +383,40 @@ window.__ModuleLoader__.load({
|
|
|
371
383
|
)
|
|
372
384
|
}
|
|
373
385
|
|
|
386
|
+
// Карточка во вкладке «Плагины» — как карточки bash/agent-loop/web-search:
|
|
387
|
+
// заголовок с именем, описанием и шевроном, сворачивание, каёмка.
|
|
388
|
+
function PluginCard(props) {
|
|
389
|
+
const t = (props && props.t) || ((key) => key)
|
|
390
|
+
const [open, setOpen] = React.useState(false)
|
|
391
|
+
return React.createElement('li', {
|
|
392
|
+
className: 'dsub-card' + (open ? ' dsub-cardOpen' : ''),
|
|
393
|
+
},
|
|
394
|
+
React.createElement('button', {
|
|
395
|
+
type: 'button',
|
|
396
|
+
className: 'dsub-header',
|
|
397
|
+
onClick: () => setOpen(!open),
|
|
398
|
+
'aria-expanded': open,
|
|
399
|
+
},
|
|
400
|
+
React.createElement('div', { className: 'dsub-headText' },
|
|
401
|
+
React.createElement('div', { className: 'dsub-name' }, t('title')),
|
|
402
|
+
React.createElement('div', { className: 'dsub-description' }, t('cardIntro')),
|
|
403
|
+
),
|
|
404
|
+
React.createElement('svg', {
|
|
405
|
+
className: 'dsub-chevron' + (open ? ' dsub-chevronOpen' : ''),
|
|
406
|
+
width: 16, height: 16, viewBox: '0 0 16 16', fill: 'none',
|
|
407
|
+
},
|
|
408
|
+
React.createElement('path', {
|
|
409
|
+
d: 'M4 6l4 4 4-4', stroke: 'currentColor', 'stroke-width': 1.5,
|
|
410
|
+
'stroke-linecap': 'round', 'stroke-linejoin': 'round',
|
|
411
|
+
}),
|
|
412
|
+
),
|
|
413
|
+
),
|
|
414
|
+
open ? React.createElement('div', { className: 'dsub-body' },
|
|
415
|
+
React.createElement(SubsSection, props),
|
|
416
|
+
) : null,
|
|
417
|
+
)
|
|
418
|
+
}
|
|
419
|
+
|
|
374
420
|
function registerSettings(ctx) {
|
|
375
421
|
ctx.effect(() => ctx.locale.register(NS, { en, ru }), 'dsh-subscriptions: словари')
|
|
376
422
|
// Подписи вне компонента берут переводчик, привязанный к namespace.
|
package/package.json
CHANGED