@svadmin/lite 0.17.0 → 0.22.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/README.md +71 -2
- package/dist/components/LiteActivityFeed.svelte +24 -2
- package/dist/components/LiteActivityFeed.svelte.d.ts +6 -0
- package/dist/components/LiteAffix.svelte +29 -0
- package/dist/components/LiteAffix.svelte.d.ts +13 -0
- package/dist/components/LiteAnchor.svelte +38 -0
- package/dist/components/LiteAnchor.svelte.d.ts +14 -0
- package/dist/components/LiteApprovalActionCard.svelte +4 -1
- package/dist/components/LiteApprovalActionCard.svelte.d.ts +2 -0
- package/dist/components/LiteAutoComplete.svelte +41 -0
- package/dist/components/LiteAutoComplete.svelte.d.ts +13 -0
- package/dist/components/LiteBackTop.svelte +16 -0
- package/dist/components/LiteBackTop.svelte.d.ts +8 -0
- package/dist/components/LiteBreadcrumbs.svelte +4 -1
- package/dist/components/LiteBreadcrumbs.svelte.d.ts +2 -0
- package/dist/components/LiteCalendar.svelte +124 -0
- package/dist/components/LiteCalendar.svelte.d.ts +20 -0
- package/dist/components/LiteCarousel.svelte +72 -0
- package/dist/components/LiteCarousel.svelte.d.ts +14 -0
- package/dist/components/LiteCollapse.svelte +49 -0
- package/dist/components/LiteCollapse.svelte.d.ts +15 -0
- package/dist/components/LiteColumnHeaderFilter.svelte +4 -1
- package/dist/components/LiteColumnHeaderFilter.svelte.d.ts +2 -0
- package/dist/components/LiteColumnSettings.svelte +4 -1
- package/dist/components/LiteColumnSettings.svelte.d.ts +2 -0
- package/dist/components/LiteCommentThread.svelte +113 -0
- package/dist/components/LiteCommentThread.svelte.d.ts +26 -0
- package/dist/components/LiteCountdown.svelte +49 -0
- package/dist/components/LiteCountdown.svelte.d.ts +10 -0
- package/dist/components/LiteDetailDrawer.svelte +45 -0
- package/dist/components/LiteDetailDrawer.svelte.d.ts +14 -0
- package/dist/components/LiteDraggableRowTable.svelte +4 -1
- package/dist/components/LiteDraggableRowTable.svelte.d.ts +2 -0
- package/dist/components/LiteDrawerForm.svelte +4 -1
- package/dist/components/LiteDrawerForm.svelte.d.ts +2 -0
- package/dist/components/LiteEditableTable.svelte +4 -1
- package/dist/components/LiteEditableTable.svelte.d.ts +2 -0
- package/dist/components/LiteEmptyState.svelte +8 -1
- package/dist/components/LiteEmptyState.svelte.d.ts +3 -0
- package/dist/components/LiteFilterBuilder.svelte +4 -1
- package/dist/components/LiteFilterBuilder.svelte.d.ts +2 -0
- package/dist/components/LiteFloatButton.svelte +54 -0
- package/dist/components/LiteFloatButton.svelte.d.ts +15 -0
- package/dist/components/LiteGrid.svelte +34 -0
- package/dist/components/LiteGrid.svelte.d.ts +11 -0
- package/dist/components/LiteImage.svelte +54 -0
- package/dist/components/LiteImage.svelte.d.ts +14 -0
- package/dist/components/LiteImageCropper.svelte +4 -1
- package/dist/components/LiteImageCropper.svelte.d.ts +2 -0
- package/dist/components/LiteImagePreview.svelte +36 -0
- package/dist/components/LiteImagePreview.svelte.d.ts +13 -0
- package/dist/components/LiteItemList.svelte +50 -0
- package/dist/components/LiteItemList.svelte.d.ts +15 -0
- package/dist/components/LiteJsonSchemaForm.svelte +4 -1
- package/dist/components/LiteJsonSchemaForm.svelte.d.ts +2 -0
- package/dist/components/LiteLayout.svelte +16 -4
- package/dist/components/LiteLayout.svelte.d.ts +8 -0
- package/dist/components/LiteLink.svelte +32 -0
- package/dist/components/LiteLink.svelte.d.ts +11 -0
- package/dist/components/LiteLogin.svelte +9 -2
- package/dist/components/LiteLogin.svelte.d.ts +2 -0
- package/dist/components/LiteMasterDetailView.svelte +4 -1
- package/dist/components/LiteMasterDetailView.svelte.d.ts +2 -0
- package/dist/components/LiteMediaLibraryModal.svelte +4 -1
- package/dist/components/LiteMediaLibraryModal.svelte.d.ts +2 -0
- package/dist/components/LiteMenu.svelte +22 -0
- package/dist/components/LiteMenu.svelte.d.ts +12 -0
- package/dist/components/LiteMenuList.svelte +55 -0
- package/dist/components/LiteMenuList.svelte.d.ts +17 -0
- package/dist/components/LiteModalForm.svelte +4 -1
- package/dist/components/LiteModalForm.svelte.d.ts +2 -0
- package/dist/components/LiteNotificationCenter.svelte +85 -0
- package/dist/components/LiteNotificationCenter.svelte.d.ts +22 -0
- package/dist/components/LiteOtpInput.svelte +50 -0
- package/dist/components/LiteOtpInput.svelte.d.ts +15 -0
- package/dist/components/LitePageHeader.svelte +34 -0
- package/dist/components/LitePageHeader.svelte.d.ts +13 -0
- package/dist/components/LitePagination.svelte +10 -2
- package/dist/components/LitePagination.svelte.d.ts +2 -0
- package/dist/components/LitePopconfirm.svelte +49 -0
- package/dist/components/LitePopconfirm.svelte.d.ts +14 -0
- package/dist/components/LitePresenceAvatarGroup.svelte +4 -1
- package/dist/components/LitePresenceAvatarGroup.svelte.d.ts +2 -0
- package/dist/components/LitePrintableBill.svelte +4 -1
- package/dist/components/LitePrintableBill.svelte.d.ts +2 -0
- package/dist/components/LiteProgress.svelte +46 -0
- package/dist/components/LiteProgress.svelte.d.ts +12 -0
- package/dist/components/LiteQRCode.svelte +62 -0
- package/dist/components/LiteQRCode.svelte.d.ts +14 -0
- package/dist/components/LiteResizeBox.svelte +34 -0
- package/dist/components/LiteResizeBox.svelte.d.ts +12 -0
- package/dist/components/LiteResult.svelte +52 -0
- package/dist/components/LiteResult.svelte.d.ts +14 -0
- package/dist/components/LiteRowActions.svelte +36 -0
- package/dist/components/LiteRowActions.svelte.d.ts +17 -0
- package/dist/components/LiteSensitiveDataMask.svelte +4 -1
- package/dist/components/LiteSensitiveDataMask.svelte.d.ts +2 -0
- package/dist/components/LiteSkeleton.svelte +100 -0
- package/dist/components/LiteSkeleton.svelte.d.ts +19 -0
- package/dist/components/LiteSpace.svelte +31 -0
- package/dist/components/LiteSpace.svelte.d.ts +12 -0
- package/dist/components/LiteSpin.svelte +27 -0
- package/dist/components/LiteSpin.svelte.d.ts +10 -0
- package/dist/components/LiteSplitPaneLayout.svelte +16 -4
- package/dist/components/LiteSplitPaneLayout.svelte.d.ts +8 -0
- package/dist/components/LiteStatistic.svelte +63 -0
- package/dist/components/LiteStatistic.svelte.d.ts +15 -0
- package/dist/components/LiteStatsCard.svelte +5 -2
- package/dist/components/LiteStatsCard.svelte.d.ts +2 -0
- package/dist/components/LiteStatusBadge.svelte +33 -0
- package/dist/components/LiteStatusBadge.svelte.d.ts +12 -0
- package/dist/components/LiteStatusTabs.svelte +35 -0
- package/dist/components/LiteStatusTabs.svelte.d.ts +14 -0
- package/dist/components/LiteStepForm.svelte +4 -1
- package/dist/components/LiteStepForm.svelte.d.ts +2 -0
- package/dist/components/LiteSteps.svelte +64 -0
- package/dist/components/LiteSteps.svelte.d.ts +18 -0
- package/dist/components/LiteTable.svelte +4 -1
- package/dist/components/LiteTable.svelte.d.ts +2 -0
- package/dist/components/LiteTableSummary.svelte +4 -1
- package/dist/components/LiteTableSummary.svelte.d.ts +2 -0
- package/dist/components/LiteTabs.svelte +28 -18
- package/dist/components/LiteTabs.svelte.d.ts +11 -2
- package/dist/components/LiteTag.svelte +31 -0
- package/dist/components/LiteTag.svelte.d.ts +13 -0
- package/dist/components/LiteTimeline.svelte +48 -0
- package/dist/components/LiteTimeline.svelte.d.ts +17 -0
- package/dist/components/LiteTour.svelte +54 -0
- package/dist/components/LiteTour.svelte.d.ts +15 -0
- package/dist/components/LiteTransfer.svelte +4 -1
- package/dist/components/LiteTransfer.svelte.d.ts +2 -0
- package/dist/components/LiteTree.svelte +48 -0
- package/dist/components/LiteTree.svelte.d.ts +17 -0
- package/dist/components/LiteTwoFactorStepper.svelte +53 -0
- package/dist/components/LiteTwoFactorStepper.svelte.d.ts +16 -0
- package/dist/components/LiteVersionDiffViewer.svelte +4 -1
- package/dist/components/LiteVersionDiffViewer.svelte.d.ts +2 -0
- package/dist/components/LiteVideoPlayer.svelte +67 -0
- package/dist/components/LiteVideoPlayer.svelte.d.ts +22 -0
- package/dist/components/advanced/LiteAutoSaveIndicator.svelte +42 -13
- package/dist/components/advanced/LiteAutoSaveIndicator.svelte.d.ts +10 -4
- package/dist/components/advanced/LiteDrawerForm.svelte +4 -1
- package/dist/components/advanced/LiteDrawerForm.svelte.d.ts +2 -0
- package/dist/components/advanced/LiteModalForm.svelte +4 -1
- package/dist/components/advanced/LiteModalForm.svelte.d.ts +2 -0
- package/dist/components/compatibility/LiteRealtimeStatus.svelte +41 -2
- package/dist/components/compatibility/LiteRealtimeStatus.svelte.d.ts +15 -0
- package/dist/components/fields/LiteBooleanField.svelte +4 -2
- package/dist/components/fields/LiteBooleanField.svelte.d.ts +2 -0
- package/dist/components/fields/LiteCascader.svelte +5 -2
- package/dist/components/fields/LiteCascader.svelte.d.ts +2 -0
- package/dist/components/fields/LiteDateField.svelte +39 -9
- package/dist/components/fields/LiteDateField.svelte.d.ts +2 -0
- package/dist/components/fields/LiteImageField.svelte +6 -2
- package/dist/components/fields/LiteImageField.svelte.d.ts +2 -0
- package/dist/components/fields/LiteMarkdownField.svelte +49 -3
- package/dist/components/fields/LiteMarkdownField.svelte.d.ts +5 -0
- package/dist/components/fields/LiteNumberField.svelte +5 -3
- package/dist/components/fields/LiteNumberField.svelte.d.ts +2 -0
- package/dist/components/fields/LiteRichTextField.svelte +45 -8
- package/dist/components/fields/LiteRichTextField.svelte.d.ts +3 -0
- package/dist/components/fields/LiteSelectField.svelte +5 -3
- package/dist/components/fields/LiteSelectField.svelte.d.ts +2 -0
- package/dist/components/fields/LiteTagField.svelte +38 -15
- package/dist/components/fields/LiteTagField.svelte.d.ts +2 -0
- package/dist/components/fields/LiteTextField.svelte +26 -5
- package/dist/components/fields/LiteTextField.svelte.d.ts +2 -0
- package/dist/components/fields/LiteTreeSelect.svelte +5 -2
- package/dist/components/fields/LiteTreeSelect.svelte.d.ts +2 -0
- package/dist/components/fields/LiteUrlField.svelte +5 -3
- package/dist/components/fields/LiteUrlField.svelte.d.ts +2 -0
- package/dist/components/layout/LiteSidebar.svelte +4 -1
- package/dist/components/layout/LiteSidebar.svelte.d.ts +2 -0
- package/dist/components/pages/LiteCreatePage.svelte +4 -1
- package/dist/components/pages/LiteCreatePage.svelte.d.ts +2 -0
- package/dist/components/pages/LiteEditPage.svelte +4 -1
- package/dist/components/pages/LiteEditPage.svelte.d.ts +2 -0
- package/dist/components/pages/LiteListPage.svelte +4 -1
- package/dist/components/pages/LiteListPage.svelte.d.ts +2 -0
- package/dist/components/pages/LiteShowPage.svelte +4 -1
- package/dist/components/pages/LiteShowPage.svelte.d.ts +2 -0
- package/dist/components/widgets/LiteAnomalyBadge.svelte +5 -2
- package/dist/components/widgets/LiteAnomalyBadge.svelte.d.ts +2 -0
- package/dist/components/widgets/LiteAreaChart.svelte +20 -0
- package/dist/components/widgets/LiteAreaChart.svelte.d.ts +10 -0
- package/dist/components/widgets/LiteChartSvg.svelte +102 -0
- package/dist/components/widgets/LiteChartSvg.svelte.d.ts +10 -0
- package/dist/components/widgets/LiteChartTable.svelte +44 -0
- package/dist/components/widgets/LiteChartTable.svelte.d.ts +10 -0
- package/dist/components/widgets/LiteDonutChart.svelte +20 -0
- package/dist/components/widgets/LiteDonutChart.svelte.d.ts +10 -0
- package/dist/components/widgets/LiteFunnelChart.svelte +20 -0
- package/dist/components/widgets/LiteFunnelChart.svelte.d.ts +10 -0
- package/dist/components/widgets/LiteGaugeChart.svelte +20 -0
- package/dist/components/widgets/LiteGaugeChart.svelte.d.ts +10 -0
- package/dist/components/widgets/LiteHeatmapChart.svelte +20 -0
- package/dist/components/widgets/LiteHeatmapChart.svelte.d.ts +10 -0
- package/dist/components/widgets/LiteInsightCard.svelte +34 -12
- package/dist/components/widgets/LiteInsightCard.svelte.d.ts +7 -4
- package/dist/components/widgets/LiteLineChart.svelte +6 -3
- package/dist/components/widgets/LiteLineChart.svelte.d.ts +0 -5
- package/dist/components/widgets/LitePieChart.svelte +5 -3
- package/dist/components/widgets/LitePieChart.svelte.d.ts +0 -5
- package/dist/components/widgets/LiteRadarChart.svelte +20 -0
- package/dist/components/widgets/LiteRadarChart.svelte.d.ts +10 -0
- package/dist/components/widgets/LiteRoseChart.svelte +20 -0
- package/dist/components/widgets/LiteRoseChart.svelte.d.ts +10 -0
- package/dist/components/widgets/LiteScatterChart.svelte +20 -0
- package/dist/components/widgets/LiteScatterChart.svelte.d.ts +10 -0
- package/dist/components/widgets/LiteWaterfallChart.svelte +20 -0
- package/dist/components/widgets/LiteWaterfallChart.svelte.d.ts +10 -0
- package/dist/components/widgets/chart-geometry.d.ts +65 -0
- package/dist/components/widgets/chart-geometry.js +229 -0
- package/dist/components/widgets/index.d.ts +10 -0
- package/dist/components/widgets/index.js +10 -0
- package/dist/index.d.ts +40 -0
- package/dist/index.js +47 -0
- package/dist/lite-code-theme.css +139 -0
- package/dist/lite.css +108 -1
- package/dist/rich-content.d.ts +47 -0
- package/dist/rich-content.js +498 -0
- package/dist/schema-generator.js +3 -1
- package/dist/server-adapter.js +6 -11
- package/dist/value-normalization.d.ts +4 -0
- package/dist/value-normalization.js +13 -0
- package/package.json +18 -4
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
interface VideoTrack {
|
|
3
|
+
src: string;
|
|
4
|
+
kind: 'subtitles' | 'captions' | 'chapters' | 'metadata' | 'descriptions';
|
|
5
|
+
label?: string;
|
|
6
|
+
language?: string;
|
|
7
|
+
default?: boolean;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
interface Props {
|
|
11
|
+
src: string;
|
|
12
|
+
poster?: string;
|
|
13
|
+
title?: string;
|
|
14
|
+
media?: 'video' | 'audio';
|
|
15
|
+
autoplay?: boolean;
|
|
16
|
+
muted?: boolean;
|
|
17
|
+
loop?: boolean;
|
|
18
|
+
playsinline?: boolean;
|
|
19
|
+
tracks?: VideoTrack[];
|
|
20
|
+
downloadLabel?: string;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
let {
|
|
24
|
+
src,
|
|
25
|
+
poster,
|
|
26
|
+
title,
|
|
27
|
+
media = 'video',
|
|
28
|
+
autoplay = false,
|
|
29
|
+
muted = false,
|
|
30
|
+
loop = false,
|
|
31
|
+
playsinline = true,
|
|
32
|
+
tracks = [],
|
|
33
|
+
downloadLabel = 'Download media',
|
|
34
|
+
}: Props = $props();
|
|
35
|
+
</script>
|
|
36
|
+
|
|
37
|
+
<figure class="lite-video-player">
|
|
38
|
+
{#if title}<figcaption class="lite-video-player__title">{title}</figcaption>{/if}
|
|
39
|
+
{#if media === 'audio'}
|
|
40
|
+
<audio controls preload="metadata" {autoplay} {muted} {loop} aria-label={title ?? 'Audio player'}>
|
|
41
|
+
<source {src} />
|
|
42
|
+
{#each tracks as track (track.src)}
|
|
43
|
+
<track src={track.src} kind={track.kind} label={track.label} srclang={track.language} default={track.default} />
|
|
44
|
+
{/each}
|
|
45
|
+
<a href={src}>{downloadLabel}</a>
|
|
46
|
+
</audio>
|
|
47
|
+
{:else}
|
|
48
|
+
<video controls preload="metadata" {poster} {autoplay} {muted} {loop} {playsinline} aria-label={title ?? 'Video player'}>
|
|
49
|
+
<source {src} />
|
|
50
|
+
{#each tracks as track (track.src)}
|
|
51
|
+
<track src={track.src} kind={track.kind} label={track.label} srclang={track.language} default={track.default} />
|
|
52
|
+
{/each}
|
|
53
|
+
<a href={src}>{downloadLabel}</a>
|
|
54
|
+
</video>
|
|
55
|
+
{/if}
|
|
56
|
+
<a class="lite-video-player__download" href={src} download>{downloadLabel}</a>
|
|
57
|
+
</figure>
|
|
58
|
+
|
|
59
|
+
<style>
|
|
60
|
+
.lite-video-player { display: block; margin: 0; padding: 12px; border: 1px solid #E5E6EB; border-radius: 8px; background: #fff; }
|
|
61
|
+
.lite-video-player__title { color: #1D2129; font-size: 14px; font-weight: 600; }
|
|
62
|
+
.lite-video-player video { display: block; width: 100%; max-height: 70vh; background: #000; }
|
|
63
|
+
.lite-video-player audio { display: block; width: 100%; }
|
|
64
|
+
.lite-video-player__download { justify-self: start; color: #165DFF; font-size: 12px; }
|
|
65
|
+
|
|
66
|
+
.lite-video-player > * + * { margin-top: 8px; }
|
|
67
|
+
</style>
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
interface VideoTrack {
|
|
2
|
+
src: string;
|
|
3
|
+
kind: 'subtitles' | 'captions' | 'chapters' | 'metadata' | 'descriptions';
|
|
4
|
+
label?: string;
|
|
5
|
+
language?: string;
|
|
6
|
+
default?: boolean;
|
|
7
|
+
}
|
|
8
|
+
interface Props {
|
|
9
|
+
src: string;
|
|
10
|
+
poster?: string;
|
|
11
|
+
title?: string;
|
|
12
|
+
media?: 'video' | 'audio';
|
|
13
|
+
autoplay?: boolean;
|
|
14
|
+
muted?: boolean;
|
|
15
|
+
loop?: boolean;
|
|
16
|
+
playsinline?: boolean;
|
|
17
|
+
tracks?: VideoTrack[];
|
|
18
|
+
downloadLabel?: string;
|
|
19
|
+
}
|
|
20
|
+
declare const LiteVideoPlayer: import("svelte").Component<Props, {}, "">;
|
|
21
|
+
type LiteVideoPlayer = ReturnType<typeof LiteVideoPlayer>;
|
|
22
|
+
export default LiteVideoPlayer;
|
|
@@ -1,26 +1,55 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
/**
|
|
3
|
-
* SSR AutoSaveIndicator —
|
|
4
|
-
*
|
|
5
|
-
*
|
|
3
|
+
* SSR AutoSaveIndicator — renders the last known save state passed from the
|
|
4
|
+
* server. There is no auto-save loop without JS, but the state machine itself
|
|
5
|
+
* (idle / loading / success / error) is fully expressible in server HTML.
|
|
6
6
|
*/
|
|
7
|
+
type SaveStatus = 'idle' | 'loading' | 'success' | 'error';
|
|
8
|
+
|
|
7
9
|
interface Props {
|
|
8
|
-
status?:
|
|
10
|
+
status?: SaveStatus | 'saved';
|
|
11
|
+
/** Error detail, exposed as the accessible title on the error label. */
|
|
12
|
+
error?: string;
|
|
13
|
+
/** Overrides the built-in label for the current status. */
|
|
9
14
|
message?: string;
|
|
15
|
+
/** Caller class merged with the built-in class list. */
|
|
16
|
+
class?: string;
|
|
10
17
|
}
|
|
11
18
|
|
|
12
|
-
let { status = 'idle', message }: Props = $props();
|
|
19
|
+
let { status = 'idle', error, message, class: className = '' }: Props = $props();
|
|
20
|
+
|
|
21
|
+
// `saved` was the old spelling of `success`; keep it working.
|
|
22
|
+
const normalized = $derived<SaveStatus>(status === 'saved' ? 'success' : status);
|
|
13
23
|
|
|
14
|
-
const statusConfig: Record<
|
|
15
|
-
idle: { icon: '☁',
|
|
16
|
-
|
|
17
|
-
|
|
24
|
+
const statusConfig: Record<SaveStatus, { icon: string; tone: string; text: string; label: string }> = {
|
|
25
|
+
idle: { icon: '☁', tone: 'idle', text: 'All changes saved', label: 'All changes saved' },
|
|
26
|
+
loading: { icon: '◌', tone: 'loading', text: 'Saving…', label: 'Saving' },
|
|
27
|
+
success: { icon: '✓', tone: 'success', text: 'Saved', label: 'Saved' },
|
|
28
|
+
error: { icon: '✕', tone: 'error', text: 'Save failed', label: 'Save failed' },
|
|
18
29
|
};
|
|
19
30
|
|
|
20
|
-
const cfg = $derived(statusConfig[
|
|
31
|
+
const cfg = $derived(statusConfig[normalized] ?? statusConfig.idle);
|
|
21
32
|
</script>
|
|
22
33
|
|
|
23
|
-
<span
|
|
24
|
-
|
|
25
|
-
|
|
34
|
+
<span
|
|
35
|
+
class={`lite-auto-save lite-auto-save--${cfg.tone} ${className}`.trim()}
|
|
36
|
+
role="status"
|
|
37
|
+
aria-live="polite"
|
|
38
|
+
aria-label={cfg.label}
|
|
39
|
+
title={normalized === 'error' ? error : undefined}
|
|
40
|
+
>
|
|
41
|
+
<span aria-hidden="true">{cfg.icon}</span>
|
|
42
|
+
<span class="lite-auto-save__text">{message ?? cfg.text}</span>
|
|
43
|
+
{#if normalized === 'error' && error}
|
|
44
|
+
<span class="lite-auto-save__error">{error}</span>
|
|
45
|
+
{/if}
|
|
26
46
|
</span>
|
|
47
|
+
|
|
48
|
+
<style>
|
|
49
|
+
.lite-auto-save { display: inline-flex; align-items: center; font-size: 13px; color: #4E5969; }
|
|
50
|
+
.lite-auto-save > * + * { margin-left: 6px; }
|
|
51
|
+
.lite-auto-save--loading { color: #165DFF; }
|
|
52
|
+
.lite-auto-save--success { color: #00B42A; }
|
|
53
|
+
.lite-auto-save--error { color: #F53F3F; }
|
|
54
|
+
.lite-auto-save__error { color: #86909C; font-size: 12px; }
|
|
55
|
+
</style>
|
|
@@ -1,11 +1,17 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* SSR AutoSaveIndicator —
|
|
3
|
-
*
|
|
4
|
-
*
|
|
2
|
+
* SSR AutoSaveIndicator — renders the last known save state passed from the
|
|
3
|
+
* server. There is no auto-save loop without JS, but the state machine itself
|
|
4
|
+
* (idle / loading / success / error) is fully expressible in server HTML.
|
|
5
5
|
*/
|
|
6
|
+
type SaveStatus = 'idle' | 'loading' | 'success' | 'error';
|
|
6
7
|
interface Props {
|
|
7
|
-
status?:
|
|
8
|
+
status?: SaveStatus | 'saved';
|
|
9
|
+
/** Error detail, exposed as the accessible title on the error label. */
|
|
10
|
+
error?: string;
|
|
11
|
+
/** Overrides the built-in label for the current status. */
|
|
8
12
|
message?: string;
|
|
13
|
+
/** Caller class merged with the built-in class list. */
|
|
14
|
+
class?: string;
|
|
9
15
|
}
|
|
10
16
|
declare const LiteAutoSaveIndicator: import("svelte").Component<Props, {}, "">;
|
|
11
17
|
type LiteAutoSaveIndicator = ReturnType<typeof LiteAutoSaveIndicator>;
|
|
@@ -13,6 +13,8 @@
|
|
|
13
13
|
recordId?: string | number;
|
|
14
14
|
basePath?: string;
|
|
15
15
|
label?: string;
|
|
16
|
+
/** Caller class merged with the built-in class list. */
|
|
17
|
+
class?: string;
|
|
16
18
|
}
|
|
17
19
|
|
|
18
20
|
let {
|
|
@@ -21,6 +23,7 @@
|
|
|
21
23
|
recordId,
|
|
22
24
|
basePath = '/lite',
|
|
23
25
|
label,
|
|
26
|
+
class: className = '',
|
|
24
27
|
}: Props = $props();
|
|
25
28
|
|
|
26
29
|
const href = $derived(
|
|
@@ -37,6 +40,6 @@
|
|
|
37
40
|
);
|
|
38
41
|
</script>
|
|
39
42
|
|
|
40
|
-
<a href={href} class="lite-btn lite-btn-outline">
|
|
43
|
+
<a href={href} class="lite-btn lite-btn-outline {className}">
|
|
41
44
|
{buttonLabel}
|
|
42
45
|
</a>
|
|
@@ -10,6 +10,8 @@ interface Props {
|
|
|
10
10
|
recordId?: string | number;
|
|
11
11
|
basePath?: string;
|
|
12
12
|
label?: string;
|
|
13
|
+
/** Caller class merged with the built-in class list. */
|
|
14
|
+
class?: string;
|
|
13
15
|
}
|
|
14
16
|
declare const LiteDrawerForm: import("svelte").Component<Props, {}, "">;
|
|
15
17
|
type LiteDrawerForm = ReturnType<typeof LiteDrawerForm>;
|
|
@@ -14,6 +14,8 @@
|
|
|
14
14
|
recordId?: string | number;
|
|
15
15
|
basePath?: string;
|
|
16
16
|
label?: string;
|
|
17
|
+
/** Caller class merged with the built-in class list. */
|
|
18
|
+
class?: string;
|
|
17
19
|
}
|
|
18
20
|
|
|
19
21
|
let {
|
|
@@ -22,6 +24,7 @@
|
|
|
22
24
|
recordId,
|
|
23
25
|
basePath = '/lite',
|
|
24
26
|
label,
|
|
27
|
+
class: className = '',
|
|
25
28
|
}: Props = $props();
|
|
26
29
|
|
|
27
30
|
const href = $derived(
|
|
@@ -39,6 +42,6 @@
|
|
|
39
42
|
</script>
|
|
40
43
|
|
|
41
44
|
<!-- In lite mode, modals degrade to a full-page navigation -->
|
|
42
|
-
<a href={href} class="lite-btn lite-btn-primary">
|
|
45
|
+
<a href={href} class="lite-btn lite-btn-primary {className}">
|
|
43
46
|
{buttonLabel}
|
|
44
47
|
</a>
|
|
@@ -11,6 +11,8 @@ interface Props {
|
|
|
11
11
|
recordId?: string | number;
|
|
12
12
|
basePath?: string;
|
|
13
13
|
label?: string;
|
|
14
|
+
/** Caller class merged with the built-in class list. */
|
|
15
|
+
class?: string;
|
|
14
16
|
}
|
|
15
17
|
declare const LiteModalForm: import("svelte").Component<Props, {}, "">;
|
|
16
18
|
type LiteModalForm = ReturnType<typeof LiteModalForm>;
|
|
@@ -1,24 +1,55 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { toSafeHref } from '../../security';
|
|
3
3
|
|
|
4
|
+
type Connection = 'connecting' | 'connected' | 'disconnected';
|
|
5
|
+
|
|
4
6
|
interface Props {
|
|
5
7
|
title?: string;
|
|
8
|
+
/** Free-text snapshot label rendered as a badge. */
|
|
6
9
|
status?: string;
|
|
10
|
+
/** Connection state, mirroring the reference `status` prop. */
|
|
11
|
+
connection?: Connection;
|
|
12
|
+
/** Resource the stream is bound to, shown when details are enabled. */
|
|
13
|
+
resource?: string;
|
|
14
|
+
/** Last received event; only its type and timestamp are rendered. */
|
|
15
|
+
lastEvent?: { type: string; timestamp?: number } | null;
|
|
16
|
+
/** Render resource and last-event details next to the badge. */
|
|
17
|
+
showDetails?: boolean;
|
|
7
18
|
lastUpdated?: string;
|
|
8
19
|
refreshHref?: string;
|
|
9
20
|
refreshLabel?: string;
|
|
10
21
|
refreshSeconds?: number;
|
|
22
|
+
/** Caller class merged with the built-in class list. */
|
|
23
|
+
class?: string;
|
|
11
24
|
}
|
|
12
25
|
|
|
13
26
|
let {
|
|
14
27
|
title = 'Live status',
|
|
15
28
|
status = 'Snapshot',
|
|
29
|
+
connection,
|
|
30
|
+
resource,
|
|
31
|
+
lastEvent = null,
|
|
32
|
+
showDetails = false,
|
|
16
33
|
lastUpdated,
|
|
17
34
|
refreshHref = '',
|
|
18
35
|
refreshLabel = 'Refresh status',
|
|
19
36
|
refreshSeconds = 0,
|
|
37
|
+
class: className = '',
|
|
20
38
|
}: Props = $props();
|
|
21
39
|
|
|
40
|
+
const connectionLabel: Record<Connection, string> = {
|
|
41
|
+
connected: 'Live',
|
|
42
|
+
connecting: 'Connecting…',
|
|
43
|
+
disconnected: 'Offline',
|
|
44
|
+
};
|
|
45
|
+
const connectionTone: Record<Connection, string> = {
|
|
46
|
+
connected: 'lite-badge-success',
|
|
47
|
+
connecting: 'lite-badge-warning',
|
|
48
|
+
disconnected: 'lite-badge-danger',
|
|
49
|
+
};
|
|
50
|
+
const connectionClass = $derived(connection ? connectionTone[connection] : 'lite-badge-info');
|
|
51
|
+
const badgeText = $derived(connection ? connectionLabel[connection] : status);
|
|
52
|
+
|
|
22
53
|
const safeRefreshSeconds = $derived(
|
|
23
54
|
Number.isFinite(refreshSeconds) && refreshSeconds >= 5
|
|
24
55
|
? Math.floor(refreshSeconds)
|
|
@@ -33,10 +64,18 @@
|
|
|
33
64
|
{/if}
|
|
34
65
|
</svelte:head>
|
|
35
66
|
|
|
36
|
-
<section
|
|
67
|
+
<section
|
|
68
|
+
class={`lite-realtime-status ${className}`.trim()}
|
|
69
|
+
aria-live="polite"
|
|
70
|
+
data-connection={connection}
|
|
71
|
+
>
|
|
37
72
|
<div>
|
|
38
73
|
<strong>{title}</strong>
|
|
39
|
-
<span class=
|
|
74
|
+
<span class={`lite-badge ${connectionClass}`} role={connection ? 'status' : undefined}>{badgeText}</span>
|
|
75
|
+
{#if resource}<span class="lite-muted">{resource}</span>{/if}
|
|
76
|
+
{#if showDetails && lastEvent}
|
|
77
|
+
<span class="lite-muted">{lastEvent.type}{#if lastEvent.timestamp} · {new Date(lastEvent.timestamp).toISOString()}{/if}</span>
|
|
78
|
+
{/if}
|
|
40
79
|
{#if lastUpdated}<span class="lite-muted">Updated {lastUpdated}</span>{/if}
|
|
41
80
|
</div>
|
|
42
81
|
{#if safeRefreshHref}<a href={safeRefreshHref} class="lite-btn lite-btn-sm">{refreshLabel}</a>{/if}
|
|
@@ -1,10 +1,25 @@
|
|
|
1
|
+
type Connection = 'connecting' | 'connected' | 'disconnected';
|
|
1
2
|
interface Props {
|
|
2
3
|
title?: string;
|
|
4
|
+
/** Free-text snapshot label rendered as a badge. */
|
|
3
5
|
status?: string;
|
|
6
|
+
/** Connection state, mirroring the reference `status` prop. */
|
|
7
|
+
connection?: Connection;
|
|
8
|
+
/** Resource the stream is bound to, shown when details are enabled. */
|
|
9
|
+
resource?: string;
|
|
10
|
+
/** Last received event; only its type and timestamp are rendered. */
|
|
11
|
+
lastEvent?: {
|
|
12
|
+
type: string;
|
|
13
|
+
timestamp?: number;
|
|
14
|
+
} | null;
|
|
15
|
+
/** Render resource and last-event details next to the badge. */
|
|
16
|
+
showDetails?: boolean;
|
|
4
17
|
lastUpdated?: string;
|
|
5
18
|
refreshHref?: string;
|
|
6
19
|
refreshLabel?: string;
|
|
7
20
|
refreshSeconds?: number;
|
|
21
|
+
/** Caller class merged with the built-in class list. */
|
|
22
|
+
class?: string;
|
|
8
23
|
}
|
|
9
24
|
declare const LiteRealtimeStatus: import("svelte").Component<Props, {}, "">;
|
|
10
25
|
type LiteRealtimeStatus = ReturnType<typeof LiteRealtimeStatus>;
|
|
@@ -7,16 +7,18 @@
|
|
|
7
7
|
value?: unknown;
|
|
8
8
|
error?: string[];
|
|
9
9
|
mode?: 'show' | 'edit' | 'create';
|
|
10
|
+
/** Caller class merged with the built-in class list. */
|
|
11
|
+
class?: string;
|
|
10
12
|
}
|
|
11
13
|
|
|
12
|
-
let { field, value, error = [], mode = 'show' }: Props = $props();
|
|
14
|
+
let { field, value, error = [], mode = 'show', class: className = '' }: Props = $props();
|
|
13
15
|
let hasError = $derived(error.length > 0);
|
|
14
16
|
|
|
15
17
|
const checked = $derived(isExplicitBooleanTrue(value));
|
|
16
18
|
</script>
|
|
17
19
|
|
|
18
20
|
{#if mode === 'show'}
|
|
19
|
-
<div>
|
|
21
|
+
<div class="lite-field-value {className}">
|
|
20
22
|
<span class="lite-bool {checked ? 'lite-bool-true' : ''}"></span>
|
|
21
23
|
{checked ? '✓ Yes' : '✗ No'}
|
|
22
24
|
</div>
|
|
@@ -4,6 +4,8 @@ interface Props {
|
|
|
4
4
|
value?: unknown;
|
|
5
5
|
error?: string[];
|
|
6
6
|
mode?: 'show' | 'edit' | 'create';
|
|
7
|
+
/** Caller class merged with the built-in class list. */
|
|
8
|
+
class?: string;
|
|
7
9
|
}
|
|
8
10
|
declare const LiteBooleanField: import("svelte").Component<Props, {}, "">;
|
|
9
11
|
type LiteBooleanField = ReturnType<typeof LiteBooleanField>;
|
|
@@ -24,6 +24,8 @@
|
|
|
24
24
|
required?: boolean;
|
|
25
25
|
error?: string[];
|
|
26
26
|
mode?: 'show' | 'edit' | 'create';
|
|
27
|
+
/** Caller class merged with the built-in class list. */
|
|
28
|
+
class?: string;
|
|
27
29
|
}
|
|
28
30
|
|
|
29
31
|
let {
|
|
@@ -38,6 +40,7 @@
|
|
|
38
40
|
required = field?.required ?? false,
|
|
39
41
|
error = [],
|
|
40
42
|
mode = 'show',
|
|
43
|
+
class: className = ''
|
|
41
44
|
}: Props = $props();
|
|
42
45
|
|
|
43
46
|
const hasError = $derived(error.length > 0);
|
|
@@ -84,9 +87,9 @@
|
|
|
84
87
|
</script>
|
|
85
88
|
|
|
86
89
|
{#if mode === 'show'}
|
|
87
|
-
<span class="lite-badge">{formatDisplay(value)}</span>
|
|
90
|
+
<span class="lite-badge {className}">{formatDisplay(value)}</span>
|
|
88
91
|
{:else}
|
|
89
|
-
<div class="lite-form-group">
|
|
92
|
+
<div class="lite-form-group {className}">
|
|
90
93
|
{#if label}
|
|
91
94
|
<label class="lite-label" for={name}>
|
|
92
95
|
{label}
|
|
@@ -18,6 +18,8 @@ interface Props {
|
|
|
18
18
|
required?: boolean;
|
|
19
19
|
error?: string[];
|
|
20
20
|
mode?: 'show' | 'edit' | 'create';
|
|
21
|
+
/** Caller class merged with the built-in class list. */
|
|
22
|
+
class?: string;
|
|
21
23
|
}
|
|
22
24
|
declare const LiteCascader: import("svelte").Component<Props, {}, "">;
|
|
23
25
|
type LiteCascader = ReturnType<typeof LiteCascader>;
|
|
@@ -7,21 +7,50 @@
|
|
|
7
7
|
value?: unknown;
|
|
8
8
|
error?: string[];
|
|
9
9
|
mode?: 'show' | 'edit' | 'create';
|
|
10
|
+
/** Caller class merged with the built-in class list. */
|
|
11
|
+
class?: string;
|
|
10
12
|
}
|
|
11
13
|
|
|
12
|
-
let { field, value, error = [], mode = 'show' }: Props = $props();
|
|
14
|
+
let { field, value, error = [], mode = 'show', class: className = '' }: Props = $props();
|
|
13
15
|
const i18n = useTranslation();
|
|
14
16
|
let hasError = $derived(error.length > 0);
|
|
15
17
|
|
|
18
|
+
/** Native input type follows the field domain: date-only stays date-only. */
|
|
19
|
+
const inputType = $derived(field.type === 'datetime' ? 'datetime-local' : 'date');
|
|
20
|
+
|
|
21
|
+
function pad(value: number): string {
|
|
22
|
+
return String(value).padStart(2, '0');
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Normalize into the value shape the native control expects. ISO-ish strings
|
|
27
|
+
* are sliced instead of round-tripped through UTC, so a stored
|
|
28
|
+
* `2024-03-15` never shifts to the previous day.
|
|
29
|
+
*/
|
|
16
30
|
function formatDate(v: unknown): string {
|
|
17
|
-
if (
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
31
|
+
if (v == null || v === '') return '';
|
|
32
|
+
if (typeof v === 'string') {
|
|
33
|
+
if (inputType === 'datetime-local') {
|
|
34
|
+
const match = /^(\d{4}-\d{2}-\d{2})[T ](\d{2}:\d{2})/u.exec(v);
|
|
35
|
+
if (match?.[1] && match[2]) return `${match[1]}T${match[2]}`;
|
|
36
|
+
} else {
|
|
37
|
+
const match = /^(\d{4}-\d{2}-\d{2})/u.exec(v);
|
|
38
|
+
if (match?.[1]) return match[1];
|
|
39
|
+
}
|
|
22
40
|
}
|
|
41
|
+
const date = v instanceof Date ? v : new Date(String(v));
|
|
42
|
+
if (Number.isNaN(date.getTime())) return '';
|
|
43
|
+
const day = `${date.getFullYear()}-${pad(date.getMonth() + 1)}-${pad(date.getDate())}`;
|
|
44
|
+
return inputType === 'datetime-local' ? `${day}T${pad(date.getHours())}:${pad(date.getMinutes())}` : day;
|
|
23
45
|
}
|
|
24
46
|
|
|
47
|
+
const dateOptions = $derived(field.dateInput);
|
|
48
|
+
const boundAttributes = $derived({
|
|
49
|
+
...(dateOptions?.min ? { min: dateOptions.min } : {}),
|
|
50
|
+
...(dateOptions?.max ? { max: dateOptions.max } : {}),
|
|
51
|
+
...(inputType === 'date' && dateOptions?.step ? { step: String(dateOptions.step) } : {}),
|
|
52
|
+
});
|
|
53
|
+
|
|
25
54
|
function displayDate(v: unknown): string {
|
|
26
55
|
if (!v) return '—';
|
|
27
56
|
try {
|
|
@@ -33,16 +62,17 @@
|
|
|
33
62
|
</script>
|
|
34
63
|
|
|
35
64
|
{#if mode === 'show'}
|
|
36
|
-
<span>{displayDate(value)}</span>
|
|
65
|
+
<span class="lite-field-value {className}">{displayDate(value)}</span>
|
|
37
66
|
{:else}
|
|
38
|
-
<div>
|
|
67
|
+
<div class="lite-field-edit {className}">
|
|
39
68
|
<input
|
|
40
|
-
type=
|
|
69
|
+
type={inputType}
|
|
41
70
|
lang={i18n.locale}
|
|
42
71
|
name={field.key}
|
|
43
72
|
id={field.key}
|
|
44
73
|
value={formatDate(value)}
|
|
45
74
|
class="lite-input {hasError ? 'lite-input-error' : ''}"
|
|
75
|
+
{...boundAttributes}
|
|
46
76
|
{...field.required ? { required: true } : {}}
|
|
47
77
|
/>
|
|
48
78
|
{#if hasError}
|
|
@@ -4,6 +4,8 @@ interface Props {
|
|
|
4
4
|
value?: unknown;
|
|
5
5
|
error?: string[];
|
|
6
6
|
mode?: 'show' | 'edit' | 'create';
|
|
7
|
+
/** Caller class merged with the built-in class list. */
|
|
8
|
+
class?: string;
|
|
7
9
|
}
|
|
8
10
|
declare const LiteDateField: import("svelte").Component<Props, {}, "">;
|
|
9
11
|
type LiteDateField = ReturnType<typeof LiteDateField>;
|
|
@@ -7,9 +7,13 @@
|
|
|
7
7
|
value?: unknown;
|
|
8
8
|
error?: string[];
|
|
9
9
|
mode?: 'show' | 'edit' | 'create';
|
|
10
|
+
/** Caller class merged with the built-in class list. */
|
|
11
|
+
class?: string;
|
|
10
12
|
}
|
|
11
13
|
|
|
12
|
-
let { field, value, error = [], mode = 'show'
|
|
14
|
+
let { field, value, error = [], mode = 'show',
|
|
15
|
+
class: className = ''
|
|
16
|
+
}: Props = $props();
|
|
13
17
|
let hasError = $derived(error.length > 0);
|
|
14
18
|
|
|
15
19
|
function getUrls(v: unknown): string[] {
|
|
@@ -22,7 +26,7 @@
|
|
|
22
26
|
|
|
23
27
|
{#if mode === 'show'}
|
|
24
28
|
{@const urls = getUrls(value)}
|
|
25
|
-
<div class="lite-inline-md lite-flex-wrap">
|
|
29
|
+
<div class="lite-inline-md lite-flex-wrap {className}">
|
|
26
30
|
{#each urls as url, _i (_i)}
|
|
27
31
|
<LiteMediaThumbnail src={url} alt={field.label} height={100} />
|
|
28
32
|
{:else}
|
|
@@ -4,6 +4,8 @@ interface Props {
|
|
|
4
4
|
value?: unknown;
|
|
5
5
|
error?: string[];
|
|
6
6
|
mode?: 'show' | 'edit' | 'create';
|
|
7
|
+
/** Caller class merged with the built-in class list. */
|
|
8
|
+
class?: string;
|
|
7
9
|
}
|
|
8
10
|
declare const LiteImageField: import("svelte").Component<Props, {}, "">;
|
|
9
11
|
type LiteImageField = ReturnType<typeof LiteImageField>;
|
|
@@ -1,21 +1,34 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import type { FieldDefinition } from '@svadmin/core';
|
|
3
|
+
import { renderMarkdown, type MarkdownRenderOptions } from '../../rich-content.js';
|
|
3
4
|
|
|
4
5
|
interface Props {
|
|
5
6
|
field: FieldDefinition;
|
|
6
7
|
value?: unknown;
|
|
7
8
|
error?: string[];
|
|
8
9
|
mode?: 'show' | 'edit' | 'create';
|
|
10
|
+
/** Per-field renderer options; app-wide defaults come from configureMarkdownRenderer. */
|
|
11
|
+
renderOptions?: MarkdownRenderOptions;
|
|
12
|
+
/** Caller class merged with the built-in class list. */
|
|
13
|
+
class?: string;
|
|
9
14
|
}
|
|
10
15
|
|
|
11
|
-
let { field, value, error = [], mode = 'show'
|
|
16
|
+
let { field, value, error = [], mode = 'show', renderOptions,
|
|
17
|
+
class: className = ''
|
|
18
|
+
}: Props = $props();
|
|
12
19
|
let hasError = $derived(error.length > 0);
|
|
20
|
+
const preview = $derived(renderMarkdown(value, renderOptions));
|
|
13
21
|
</script>
|
|
14
22
|
|
|
15
23
|
{#if mode === 'show'}
|
|
16
|
-
|
|
24
|
+
{#if preview}
|
|
25
|
+
<!-- eslint-disable-next-line svelte/no-at-html-tags -- 内容由 renderMarkdown 转义,高亮回调仅允许可信服务端实现。 -->
|
|
26
|
+
<div class="lite-markdown-preview {className}">{@html preview}</div>
|
|
27
|
+
{:else}
|
|
28
|
+
<span>—</span>
|
|
29
|
+
{/if}
|
|
17
30
|
{:else}
|
|
18
|
-
<div>
|
|
31
|
+
<div class="lite-field-edit {className}">
|
|
19
32
|
<textarea
|
|
20
33
|
name={field.key}
|
|
21
34
|
id={field.key}
|
|
@@ -29,5 +42,38 @@
|
|
|
29
42
|
<div class="lite-error-text">{err}</div>
|
|
30
43
|
{/each}
|
|
31
44
|
{/if}
|
|
45
|
+
<div class="lite-markdown-preview-block">
|
|
46
|
+
<span class="lite-markdown-preview-block__label">Preview</span>
|
|
47
|
+
{#if preview}
|
|
48
|
+
<!-- eslint-disable-next-line svelte/no-at-html-tags -- 内容由 renderMarkdown 转义,高亮回调仅允许可信服务端实现。 -->
|
|
49
|
+
<div class="lite-markdown-preview">{@html preview}</div>
|
|
50
|
+
{:else}
|
|
51
|
+
<p class="lite-markdown-preview-block__empty">Nothing to preview yet.</p>
|
|
52
|
+
{/if}
|
|
53
|
+
</div>
|
|
32
54
|
</div>
|
|
33
55
|
{/if}
|
|
56
|
+
|
|
57
|
+
<style>
|
|
58
|
+
.lite-markdown-preview { padding: 12px; border: 1px solid #E5E6EB; border-radius: 4px; background: #F7F8FA; color: #1D2129; font-size: 13px; line-height: 1.7; overflow-wrap: anywhere; }
|
|
59
|
+
.lite-markdown-preview :global(h1),
|
|
60
|
+
.lite-markdown-preview :global(h2),
|
|
61
|
+
.lite-markdown-preview :global(h3),
|
|
62
|
+
.lite-markdown-preview :global(h4) { margin: 12px 0 6px; font-size: 15px; }
|
|
63
|
+
.lite-markdown-preview :global(p) { margin: 0 0 8px; }
|
|
64
|
+
.lite-markdown-preview :global(ul),
|
|
65
|
+
.lite-markdown-preview :global(ol) { margin: 0 0 8px; padding-left: 20px; }
|
|
66
|
+
.lite-markdown-preview :global(pre) { margin: 0 0 8px; padding: 8px; overflow-x: auto; border-radius: 4px; background: #F2F3F5; }
|
|
67
|
+
.lite-markdown-preview :global(code) { font-family: monospace; font-size: 12px; }
|
|
68
|
+
.lite-markdown-preview :global(blockquote) { margin: 0 0 8px; padding-left: 10px; border-left: 3px solid #E5E6EB; color: #4E5969; }
|
|
69
|
+
.lite-markdown-preview :global(a) { color: #165DFF; }
|
|
70
|
+
.lite-markdown-preview :global(table) { width: 100%; margin: 0 0 8px; border-collapse: collapse; }
|
|
71
|
+
.lite-markdown-preview :global(th),
|
|
72
|
+
.lite-markdown-preview :global(td) { padding: 6px 8px; border: 1px solid #E5E6EB; text-align: left; }
|
|
73
|
+
.lite-markdown-preview :global(th) { background: #F2F3F5; font-weight: 600; }
|
|
74
|
+
.lite-markdown-preview :global(ul.lite-task-list) { padding-left: 2px; list-style: none; }
|
|
75
|
+
.lite-markdown-preview :global(.lite-task-item input) { margin-right: 6px; }
|
|
76
|
+
.lite-markdown-preview-block { margin-top: 8px; }
|
|
77
|
+
.lite-markdown-preview-block__label { display: block; margin-bottom: 4px; color: #86909C; font-size: 11px; font-weight: 600; }
|
|
78
|
+
.lite-markdown-preview-block__empty { margin: 0; padding: 8px 12px; border: 1px dashed #E5E6EB; border-radius: 4px; color: #86909C; font-size: 12px; }
|
|
79
|
+
</style>
|
|
@@ -1,9 +1,14 @@
|
|
|
1
1
|
import type { FieldDefinition } from '@svadmin/core';
|
|
2
|
+
import { type MarkdownRenderOptions } from '../../rich-content.js';
|
|
2
3
|
interface Props {
|
|
3
4
|
field: FieldDefinition;
|
|
4
5
|
value?: unknown;
|
|
5
6
|
error?: string[];
|
|
6
7
|
mode?: 'show' | 'edit' | 'create';
|
|
8
|
+
/** Per-field renderer options; app-wide defaults come from configureMarkdownRenderer. */
|
|
9
|
+
renderOptions?: MarkdownRenderOptions;
|
|
10
|
+
/** Caller class merged with the built-in class list. */
|
|
11
|
+
class?: string;
|
|
7
12
|
}
|
|
8
13
|
declare const LiteMarkdownField: import("svelte").Component<Props, {}, "">;
|
|
9
14
|
type LiteMarkdownField = ReturnType<typeof LiteMarkdownField>;
|