@svadmin/lite 0.30.1 → 0.31.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.
@@ -88,7 +88,7 @@
88
88
  background: #165dff;
89
89
  margin-top: 4px;
90
90
  margin-right: 8px;
91
- shrink: 0;
91
+ flex-shrink: 0;
92
92
  }
93
93
  .lite-dot-warn { background: #ff7d00; }
94
94
  .lite-dot-danger { background: #f53f3f; }
@@ -1,4 +1,6 @@
1
1
  <script lang="ts">
2
+ import { untrack } from 'svelte';
3
+
2
4
  interface CronPreset {
3
5
  label: string;
4
6
  value: string;
@@ -31,7 +33,8 @@
31
33
  class: className = '',
32
34
  }: Props = $props();
33
35
 
34
- let expression = $state(value);
36
+ // Seeded once from the initial prop; the field owns edits afterwards.
37
+ let expression = $state(untrack(() => value));
35
38
  </script>
36
39
 
37
40
  <section class="lite-cron-builder lite-card {className}" aria-label={label}>
@@ -19,16 +19,16 @@
19
19
 
20
20
  <style>
21
21
  .lite-grid { display: flex; flex-wrap: wrap; margin: -6px; }
22
- .lite-grid > * { box-sizing: border-box; width: calc(33.333% - 12px); margin: 6px; }
23
- .lite-grid[data-columns='2'] > * { width: calc(50% - 12px); }
24
- .lite-grid[data-columns='4'] > * { width: calc(25% - 12px); }
22
+ :global(.lite-grid > *) { box-sizing: border-box; width: calc(33.333% - 12px); margin: 6px; }
23
+ :global(.lite-grid[data-columns='2'] > *) { width: calc(50% - 12px); }
24
+ :global(.lite-grid[data-columns='4'] > *) { width: calc(25% - 12px); }
25
25
  .lite-grid[data-gap='sm'] { margin: -2px; }
26
- .lite-grid[data-gap='sm'] > * { width: calc(33.333% - 4px); margin: 2px; }
27
- .lite-grid[data-gap='sm'][data-columns='2'] > * { width: calc(50% - 4px); }
28
- .lite-grid[data-gap='sm'][data-columns='4'] > * { width: calc(25% - 4px); }
26
+ :global(.lite-grid[data-gap='sm'] > *) { width: calc(33.333% - 4px); margin: 2px; }
27
+ :global(.lite-grid[data-gap='sm'][data-columns='2'] > *) { width: calc(50% - 4px); }
28
+ :global(.lite-grid[data-gap='sm'][data-columns='4'] > *) { width: calc(25% - 4px); }
29
29
  .lite-grid[data-gap='lg'] { margin: -10px; }
30
- .lite-grid[data-gap='lg'] > * { width: calc(33.333% - 20px); margin: 10px; }
31
- .lite-grid[data-gap='lg'][data-columns='2'] > * { width: calc(50% - 20px); }
32
- .lite-grid[data-gap='lg'][data-columns='4'] > * { width: calc(25% - 20px); }
33
- @media (max-width: 720px) { .lite-grid > * { width: calc(100% - 12px) !important; } }
30
+ :global(.lite-grid[data-gap='lg'] > *) { width: calc(33.333% - 20px); margin: 10px; }
31
+ :global(.lite-grid[data-gap='lg'][data-columns='2'] > *) { width: calc(50% - 20px); }
32
+ :global(.lite-grid[data-gap='lg'][data-columns='4'] > *) { width: calc(25% - 20px); }
33
+ @media (max-width: 720px) { :global(.lite-grid > *) { width: calc(100% - 12px) !important; } }
34
34
  </style>
@@ -0,0 +1,72 @@
1
+ <script lang="ts">
2
+ interface Props {
3
+ title?: string;
4
+ subAppRoute?: string;
5
+ hostUrl?: string;
6
+ class?: string;
7
+ }
8
+
9
+ let {
10
+ title = '微前端路由双向同步协调器 (SSR 静态映射)',
11
+ subAppRoute = '/reports/quarterly-gmv/details',
12
+ hostUrl = 'https://admin.example.com/portal/bi-workspace?subAppRoute=%2Freports%2Fquarterly-gmv',
13
+ class: className = '',
14
+ }: Props = $props();
15
+ </script>
16
+
17
+ <div
18
+ class="lite-routesync-box {className}"
19
+ data-svadmin-component="LiteMicroAppRouteSync"
20
+ role="region"
21
+ aria-label="MicroApp Route Sync"
22
+ >
23
+ <header class="lite-sync-header">
24
+ <div class="lite-sync-title-row">
25
+ <span class="lite-sync-icon">🧭</span>
26
+ <h4 class="lite-sync-title">{title}</h4>
27
+ </div>
28
+ </header>
29
+
30
+ <div class="lite-sync-body">
31
+ <div class="lite-sync-row">
32
+ <span class="lite-sync-label">子应用内部路径:</span>
33
+ <span class="lite-sync-val font-mono">{subAppRoute}</span>
34
+ </div>
35
+ <div class="lite-sync-row">
36
+ <span class="lite-sync-label">宿主映射地址:</span>
37
+ <span class="lite-sync-val font-mono text-muted">{hostUrl}</span>
38
+ </div>
39
+ </div>
40
+ </div>
41
+
42
+ <style>
43
+ .lite-routesync-box {
44
+ border: 1px solid #e5e6eb;
45
+ border-radius: 6px;
46
+ background: #ffffff;
47
+ font-size: 12px;
48
+ overflow: hidden;
49
+ }
50
+ .lite-sync-header {
51
+ display: flex;
52
+ align-items: center;
53
+ padding: 10px 14px;
54
+ background: #f7f8fa;
55
+ border-bottom: 1px solid #e5e6eb;
56
+ }
57
+ .lite-sync-title-row { display: flex; align-items: center; }
58
+ .lite-sync-icon { font-size: 14px; margin-right: 6px; }
59
+ .lite-sync-title { margin: 0; font-size: 13px; font-weight: 600; color: #1d2129; }
60
+ .lite-sync-body { padding: 12px 14px; }
61
+ .lite-sync-row {
62
+ display: flex;
63
+ justify-content: space-between;
64
+ padding: 6px 0;
65
+ border-bottom: 1px dashed #f2f3f5;
66
+ }
67
+ .lite-sync-row:last-child { border-bottom: none; }
68
+ .lite-sync-label { color: #86909c; }
69
+ .lite-sync-val { font-weight: 500; color: #1d2129; }
70
+ .font-mono { font-family: monospace; font-size: 11px; }
71
+ .text-muted { color: #86909c; }
72
+ </style>
@@ -0,0 +1,9 @@
1
+ interface Props {
2
+ title?: string;
3
+ subAppRoute?: string;
4
+ hostUrl?: string;
5
+ class?: string;
6
+ }
7
+ declare const LiteMicroAppRouteSync: import("svelte").Component<Props, {}, "">;
8
+ type LiteMicroAppRouteSync = ReturnType<typeof LiteMicroAppRouteSync>;
9
+ export default LiteMicroAppRouteSync;
@@ -0,0 +1,74 @@
1
+ <script lang="ts">
2
+ interface Props {
3
+ src?: string;
4
+ appName?: string;
5
+ appId?: string;
6
+ class?: string;
7
+ }
8
+
9
+ let {
10
+ src = 'https://sub-bi.example.internal/embed',
11
+ appName = '企业商业智能 (BI) 报表子应用',
12
+ appId = 'app-bi-micro-01',
13
+ class: className = '',
14
+ }: Props = $props();
15
+ </script>
16
+
17
+ <div
18
+ class="lite-microapp-sandbox {className}"
19
+ data-svadmin-component="LiteMicroAppSandbox"
20
+ role="region"
21
+ aria-label="MicroApp Isolated Sandbox"
22
+ >
23
+ <header class="lite-sandbox-header">
24
+ <div class="lite-sandbox-title-row">
25
+ <span class="lite-sandbox-icon">📦</span>
26
+ <h4 class="lite-sandbox-title">{appName}</h4>
27
+ <span class="lite-sandbox-id font-mono">({appId})</span>
28
+ </div>
29
+ <span class="lite-sandbox-status">[SSR 静态沙箱预览]</span>
30
+ </header>
31
+
32
+ <div class="lite-sandbox-body">
33
+ <div class="lite-sandbox-placeholder">
34
+ <p class="lite-placeholder-text">子应用受限环境沙箱已就绪。在无 JavaScript 环境中展示静态预留位,客户端加载后通过 Shadow DOM / iframe 挂载真实子应用。</p>
35
+ <div class="lite-sandbox-meta">
36
+ <span>安全沙箱源: <span class="font-mono">{src}</span></span>
37
+ </div>
38
+ </div>
39
+ </div>
40
+ </div>
41
+
42
+ <style>
43
+ .lite-microapp-sandbox {
44
+ border: 1px solid #e5e6eb;
45
+ border-radius: 6px;
46
+ background: #ffffff;
47
+ font-size: 12px;
48
+ overflow: hidden;
49
+ }
50
+ .lite-sandbox-header {
51
+ display: flex;
52
+ justify-content: space-between;
53
+ align-items: center;
54
+ padding: 10px 14px;
55
+ background: #f7f8fa;
56
+ border-bottom: 1px solid #e5e6eb;
57
+ }
58
+ .lite-sandbox-title-row { display: flex; align-items: center; }
59
+ .lite-sandbox-icon { font-size: 14px; margin-right: 6px; }
60
+ .lite-sandbox-title { margin: 0; font-size: 13px; font-weight: 600; color: #1d2129; margin-right: 6px; }
61
+ .lite-sandbox-id { font-size: 10px; color: #86909c; }
62
+ .font-mono { font-family: monospace; font-size: 11px; }
63
+ .lite-sandbox-status { font-size: 11px; color: #165dff; font-weight: 500; }
64
+ .lite-sandbox-body { padding: 16px 14px; }
65
+ .lite-sandbox-placeholder {
66
+ border: 1px dashed #c9cdd4;
67
+ background: #fafafa;
68
+ border-radius: 4px;
69
+ padding: 16px;
70
+ text-align: center;
71
+ }
72
+ .lite-placeholder-text { margin: 0 0 10px 0; color: #4e5969; font-size: 12px; line-height: 1.5; }
73
+ .lite-sandbox-meta { font-size: 11px; color: #86909c; }
74
+ </style>
@@ -0,0 +1,9 @@
1
+ interface Props {
2
+ src?: string;
3
+ appName?: string;
4
+ appId?: string;
5
+ class?: string;
6
+ }
7
+ declare const LiteMicroAppSandbox: import("svelte").Component<Props, {}, "">;
8
+ type LiteMicroAppSandbox = ReturnType<typeof LiteMicroAppSandbox>;
9
+ export default LiteMicroAppSandbox;
@@ -0,0 +1,70 @@
1
+ <script lang="ts">
2
+ interface Props {
3
+ channel?: string;
4
+ class?: string;
5
+ }
6
+
7
+ let {
8
+ channel = 'svadmin_microapp_global_bus',
9
+ class: className = '',
10
+ }: Props = $props();
11
+ </script>
12
+
13
+ <div
14
+ class="lite-statebus-box {className}"
15
+ data-svadmin-component="LiteMicroAppStateBusIndicator"
16
+ role="region"
17
+ aria-label="MicroApp State Bus"
18
+ >
19
+ <header class="lite-bus-header">
20
+ <div class="lite-bus-title-row">
21
+ <span class="lite-bus-icon">📡</span>
22
+ <h4 class="lite-bus-title">跨应用响应式状态总线 (SSR 静态说明)</h4>
23
+ </div>
24
+ <span class="lite-bus-channel font-mono">[{channel}]</span>
25
+ </header>
26
+
27
+ <div class="lite-bus-body">
28
+ <div class="lite-bus-row">
29
+ <span class="lite-bus-label">总线状态:</span>
30
+ <span class="lite-bus-val">SSR 就绪 (客户端通过 BroadcastChannel 双向流转)</span>
31
+ </div>
32
+ <div class="lite-bus-row">
33
+ <span class="lite-bus-label">广播策略:</span>
34
+ <span class="lite-bus-val">租户切换、Token 刷新与全局主题联动广播</span>
35
+ </div>
36
+ </div>
37
+ </div>
38
+
39
+ <style>
40
+ .lite-statebus-box {
41
+ border: 1px solid #e5e6eb;
42
+ border-radius: 6px;
43
+ background: #ffffff;
44
+ font-size: 12px;
45
+ overflow: hidden;
46
+ }
47
+ .lite-bus-header {
48
+ display: flex;
49
+ justify-content: space-between;
50
+ align-items: center;
51
+ padding: 10px 14px;
52
+ background: #f7f8fa;
53
+ border-bottom: 1px solid #e5e6eb;
54
+ }
55
+ .lite-bus-title-row { display: flex; align-items: center; }
56
+ .lite-bus-icon { font-size: 14px; margin-right: 6px; }
57
+ .lite-bus-title { margin: 0; font-size: 13px; font-weight: 600; color: #1d2129; }
58
+ .lite-bus-channel { font-size: 10px; color: #165dff; }
59
+ .font-mono { font-family: monospace; font-size: 11px; }
60
+ .lite-bus-body { padding: 12px 14px; }
61
+ .lite-bus-row {
62
+ display: flex;
63
+ justify-content: space-between;
64
+ padding: 6px 0;
65
+ border-bottom: 1px dashed #f2f3f5;
66
+ }
67
+ .lite-bus-row:last-child { border-bottom: none; }
68
+ .lite-bus-label { color: #86909c; }
69
+ .lite-bus-val { font-weight: 500; color: #1d2129; }
70
+ </style>
@@ -0,0 +1,7 @@
1
+ interface Props {
2
+ channel?: string;
3
+ class?: string;
4
+ }
5
+ declare const LiteMicroAppStateBusIndicator: import("svelte").Component<Props, {}, "">;
6
+ type LiteMicroAppStateBusIndicator = ReturnType<typeof LiteMicroAppStateBusIndicator>;
7
+ export default LiteMicroAppStateBusIndicator;
@@ -36,6 +36,8 @@
36
36
  {:else if href}
37
37
  <a class="lite-btn lite-btn-primary lite-btn-sm" href={href}>{confirmLabel}</a>
38
38
  {/if}
39
+ <!-- The empty fragment clears :target so the CSS-only panel closes without client state. -->
40
+ <!-- svelte-ignore a11y_invalid_attribute -->
39
41
  <a class="lite-btn lite-btn-sm" href="#">{cancelLabel}</a>
40
42
  </div>
41
43
  </div>
@@ -22,10 +22,10 @@
22
22
  .lite-space[data-direction='horizontal'] { flex-direction: row; }
23
23
  .lite-space[data-direction='vertical'] { flex-direction: column; }
24
24
  .lite-space[data-wrap] { flex-wrap: wrap; }
25
- .lite-space[data-direction='horizontal'] > * + * { margin-left: 8px; }
26
- .lite-space[data-direction='vertical'] > * + * { margin-top: 8px; }
27
- .lite-space[data-size='sm'][data-direction='horizontal'] > * + * { margin-left: 4px; }
28
- .lite-space[data-size='sm'][data-direction='vertical'] > * + * { margin-top: 4px; }
29
- .lite-space[data-size='lg'][data-direction='horizontal'] > * + * { margin-left: 16px; }
30
- .lite-space[data-size='lg'][data-direction='vertical'] > * + * { margin-top: 16px; }
25
+ :global(.lite-space[data-direction='horizontal'] > * + *) { margin-left: 8px; }
26
+ :global(.lite-space[data-direction='vertical'] > * + *) { margin-top: 8px; }
27
+ :global(.lite-space[data-size='sm'][data-direction='horizontal'] > * + *) { margin-left: 4px; }
28
+ :global(.lite-space[data-size='sm'][data-direction='vertical'] > * + *) { margin-top: 4px; }
29
+ :global(.lite-space[data-size='lg'][data-direction='horizontal'] > * + *) { margin-left: 16px; }
30
+ :global(.lite-space[data-size='lg'][data-direction='vertical'] > * + *) { margin-top: 16px; }
31
31
  </style>
@@ -5,14 +5,16 @@
5
5
  spinning?: boolean;
6
6
  size?: 'sm' | 'md' | 'lg';
7
7
  label?: string;
8
+ /** Caller class merged with the built-in class list. */
9
+ class?: string;
8
10
  children?: Snippet;
9
11
  }
10
12
 
11
- let { spinning = true, size = 'md', label = 'Loading', children }: Props = $props();
13
+ let { spinning = true, size = 'md', label = 'Loading', class: className = '', children }: Props = $props();
12
14
  const px = $derived(size === 'sm' ? 16 : size === 'lg' ? 36 : 24);
13
15
  </script>
14
16
 
15
- <div class="lite-spin" aria-busy={spinning || undefined}>
17
+ <div class="lite-spin {className}" aria-busy={spinning || undefined}>
16
18
  {#if spinning}
17
19
  <span class="lite-spin__indicator" style={`width:${px}px;height:${px}px`} role="status" aria-label={label}></span>
18
20
  {/if}
@@ -3,6 +3,8 @@ interface Props {
3
3
  spinning?: boolean;
4
4
  size?: 'sm' | 'md' | 'lg';
5
5
  label?: string;
6
+ /** Caller class merged with the built-in class list. */
7
+ class?: string;
6
8
  children?: Snippet;
7
9
  }
8
10
  declare const LiteSpin: import("svelte").Component<Props, {}, "">;
@@ -31,5 +31,5 @@
31
31
  .lite-status-tabs a.active { border-bottom-color: #165DFF; color: #165DFF; font-weight: 600; }
32
32
 
33
33
  .lite-status-tabs a + a { margin-left: 4px; }
34
- .lite-status-tabs a > * + * { margin-left: 6px; }
34
+ :global(.lite-status-tabs a > * + *) { margin-left: 6px; }
35
35
  </style>
@@ -49,5 +49,5 @@
49
49
  .lite-two-factor__form { display: block; justify-items: start; }
50
50
 
51
51
  .lite-two-factor > * + * { margin-top: 16px; }
52
- .lite-two-factor__form > * + * { margin-top: 12px; }
52
+ :global(.lite-two-factor__form > * + *) { margin-top: 12px; }
53
53
  </style>
@@ -1,4 +1,6 @@
1
1
  <script lang="ts">
2
+ import { untrack } from 'svelte';
3
+
2
4
  export interface LiteVirtualTreeNode {
3
5
  value: string | number;
4
6
  label: string;
@@ -44,7 +46,8 @@
44
46
  }
45
47
 
46
48
  const options = $derived(flatten(nodes));
47
- let current = $state(value);
49
+ // Seeded once from the initial prop; the select owns edits afterwards.
50
+ let current = $state(untrack(() => value));
48
51
  </script>
49
52
 
50
53
  {#snippet treeOptions()}
@@ -81,11 +81,11 @@
81
81
  border-bottom: 1px solid #e5e6eb;
82
82
  }
83
83
  .lite-webhook-title { font-weight: 600; color: #1d2129; }
84
- .lite-webhook-badge { font-size: 10px; background: #e8f3ff; color: #165dff; padding: 1px 6px; border-radius: 3px; font-mono: true; }
85
- .lite-webhook-body { padding: 12px; space-y: 8px; }
84
+ .lite-webhook-badge { font-size: 10px; background: #e8f3ff; color: #165dff; padding: 1px 6px; border-radius: 3px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
85
+ .lite-webhook-body { padding: 12px; }
86
86
  .lite-webhook-field { display: flex; align-items: baseline; margin-bottom: 6px; font-family: monospace; }
87
87
  .lite-webhook-field > * + * { margin-left: 8px; }
88
- .lite-field-label { color: #86909c; min-width: 70px; font-sans: true; }
88
+ .lite-field-label { color: #86909c; min-width: 70px; }
89
89
  .lite-field-val { color: #1d2129; word-break: break-all; }
90
90
  .lite-webhook-payload { margin-top: 8px; }
91
91
  .lite-payload-code {
package/dist/index.d.ts CHANGED
@@ -182,6 +182,9 @@ export { default as LiteChartAnnotationOverlay } from './components/LiteChartAnn
182
182
  export { default as LiteAbacPolicyMatrix } from './components/LiteAbacPolicyMatrix.svelte';
183
183
  export { default as LitePermissionSimulator } from './components/LitePermissionSimulator.svelte';
184
184
  export { default as LiteWorkflowNodeInspector } from './components/LiteWorkflowNodeInspector.svelte';
185
+ export { default as LiteMicroAppSandbox } from './components/LiteMicroAppSandbox.svelte';
186
+ export { default as LiteMicroAppStateBusIndicator } from './components/LiteMicroAppStateBusIndicator.svelte';
187
+ export { default as LiteMicroAppRouteSync } from './components/LiteMicroAppRouteSync.svelte';
185
188
  export { configureMarkdownRenderer, escapeHtml, renderInlineMarkdown, renderMarkdown, renderRichContent, sanitizeRichTextHtml, } from './rich-content';
186
189
  export type { MarkdownRenderOptions } from './rich-content';
187
190
  export * from './components/compatibility/index';
package/dist/index.js CHANGED
@@ -186,6 +186,10 @@ export { default as LiteChartAnnotationOverlay } from './components/LiteChartAnn
186
186
  export { default as LiteAbacPolicyMatrix } from './components/LiteAbacPolicyMatrix.svelte';
187
187
  export { default as LitePermissionSimulator } from './components/LitePermissionSimulator.svelte';
188
188
  export { default as LiteWorkflowNodeInspector } from './components/LiteWorkflowNodeInspector.svelte';
189
+ // Enterprise wave 14 parity fallbacks (MicroApp Sandbox, State Bus & Route Sync)
190
+ export { default as LiteMicroAppSandbox } from './components/LiteMicroAppSandbox.svelte';
191
+ export { default as LiteMicroAppStateBusIndicator } from './components/LiteMicroAppStateBusIndicator.svelte';
192
+ export { default as LiteMicroAppRouteSync } from './components/LiteMicroAppRouteSync.svelte';
189
193
  // Rich content rendering (SSR-safe Markdown + rich HTML allowlist)
190
194
  export { configureMarkdownRenderer, escapeHtml, renderInlineMarkdown, renderMarkdown, renderRichContent, sanitizeRichTextHtml, } from './rich-content';
191
195
  // Compatibility fallbacks for browser-only and third-party UI capabilities.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@svadmin/lite",
3
- "version": "0.30.1",
3
+ "version": "0.31.1",
4
4
  "description": "SSR-first lightweight admin UI for @svadmin with optional progressive enhancement",
5
5
  "type": "module",
6
6
  "sideEffects": [