@classic-homes/theme-mcp 0.4.0 → 0.5.0
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 +3 -0
- package/dist/{chunk-27MBCE7P.js → chunk-754LGBEJ.js} +1081 -48
- package/dist/chunk-754LGBEJ.js.map +1 -0
- package/dist/cli.js +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-27MBCE7P.js.map +0 -1
|
@@ -6,7 +6,7 @@ import { ResourceTemplate } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
|
6
6
|
|
|
7
7
|
// src/data/component-catalog.json
|
|
8
8
|
var component_catalog_default = {
|
|
9
|
-
version: "0.
|
|
9
|
+
version: "0.5.0",
|
|
10
10
|
components: [
|
|
11
11
|
{
|
|
12
12
|
name: "ActionHeader",
|
|
@@ -467,6 +467,12 @@ var component_catalog_default = {
|
|
|
467
467
|
required: false,
|
|
468
468
|
description: "Cancel callback"
|
|
469
469
|
},
|
|
470
|
+
{
|
|
471
|
+
name: "onCloseAutoFocus",
|
|
472
|
+
type: "(event: Event) => void",
|
|
473
|
+
required: false,
|
|
474
|
+
description: "Before focus returns on close; `preventDefault()` keeps focus where you put it (e.g. when the confirmed action removed the focused element)"
|
|
475
|
+
},
|
|
470
476
|
{
|
|
471
477
|
name: "class",
|
|
472
478
|
type: "string",
|
|
@@ -2921,6 +2927,113 @@ var component_catalog_default = {
|
|
|
2921
2927
|
"Dialog"
|
|
2922
2928
|
]
|
|
2923
2929
|
},
|
|
2930
|
+
{
|
|
2931
|
+
name: "CadViewer",
|
|
2932
|
+
description: "DXF drawings rendered with WebGL, with layers, pan and zoom, cursor coordinates and light or dark backgrounds",
|
|
2933
|
+
category: "viewer",
|
|
2934
|
+
importPath: "@classic-homes/viewer-svelte/cad",
|
|
2935
|
+
props: [
|
|
2936
|
+
{
|
|
2937
|
+
name: "source",
|
|
2938
|
+
type: "LoadedSource",
|
|
2939
|
+
required: true,
|
|
2940
|
+
description: "Loaded bytes plus name and MIME hints"
|
|
2941
|
+
},
|
|
2942
|
+
{
|
|
2943
|
+
name: "kind",
|
|
2944
|
+
type: "RenderableKind",
|
|
2945
|
+
required: true,
|
|
2946
|
+
description: "`'dxf'`"
|
|
2947
|
+
},
|
|
2948
|
+
{
|
|
2949
|
+
name: "background",
|
|
2950
|
+
type: "'theme' | 'dark' | 'light'",
|
|
2951
|
+
default: "'theme'",
|
|
2952
|
+
required: false,
|
|
2953
|
+
description: "Canvas background; `theme` follows the app's background and dark mode"
|
|
2954
|
+
},
|
|
2955
|
+
{
|
|
2956
|
+
name: "showLayers",
|
|
2957
|
+
type: "boolean",
|
|
2958
|
+
default: "false",
|
|
2959
|
+
required: false,
|
|
2960
|
+
description: "Open the layer panel on load"
|
|
2961
|
+
},
|
|
2962
|
+
{
|
|
2963
|
+
name: "fonts",
|
|
2964
|
+
type: "string[]",
|
|
2965
|
+
required: false,
|
|
2966
|
+
description: "Font URLs for this viewer, instead of the ones from `configureCad`"
|
|
2967
|
+
},
|
|
2968
|
+
{
|
|
2969
|
+
name: "downloadSource",
|
|
2970
|
+
type: "{ bytes: Uint8Array; name?: string; mime?: string }",
|
|
2971
|
+
required: false,
|
|
2972
|
+
description: "What Download saves, when `source` was derived from another file"
|
|
2973
|
+
},
|
|
2974
|
+
{
|
|
2975
|
+
name: "notice",
|
|
2976
|
+
type: "string",
|
|
2977
|
+
required: false,
|
|
2978
|
+
description: "Note under the toolbar, e.g. what a conversion could not show"
|
|
2979
|
+
},
|
|
2980
|
+
{
|
|
2981
|
+
name: "hideToolbar",
|
|
2982
|
+
type: "boolean",
|
|
2983
|
+
default: "false",
|
|
2984
|
+
required: false,
|
|
2985
|
+
description: "Hide the toolbar"
|
|
2986
|
+
},
|
|
2987
|
+
{
|
|
2988
|
+
name: "onready",
|
|
2989
|
+
type: "() => void",
|
|
2990
|
+
required: false,
|
|
2991
|
+
description: "The drawing is on screen"
|
|
2992
|
+
},
|
|
2993
|
+
{
|
|
2994
|
+
name: "onerror",
|
|
2995
|
+
type: "(error: ViewerError) => void",
|
|
2996
|
+
required: false,
|
|
2997
|
+
description: "The drawing could not be read, or WebGL is unavailable"
|
|
2998
|
+
},
|
|
2999
|
+
{
|
|
3000
|
+
name: "class",
|
|
3001
|
+
type: "string",
|
|
3002
|
+
required: false,
|
|
3003
|
+
description: "Classes for the outer element"
|
|
3004
|
+
}
|
|
3005
|
+
],
|
|
3006
|
+
variants: [
|
|
3007
|
+
{
|
|
3008
|
+
name: "background",
|
|
3009
|
+
values: [
|
|
3010
|
+
"theme",
|
|
3011
|
+
"dark",
|
|
3012
|
+
"light"
|
|
3013
|
+
],
|
|
3014
|
+
default: "theme"
|
|
3015
|
+
}
|
|
3016
|
+
],
|
|
3017
|
+
slots: [],
|
|
3018
|
+
events: [],
|
|
3019
|
+
examples: [
|
|
3020
|
+
{
|
|
3021
|
+
title: "Basic Usage",
|
|
3022
|
+
code: `<script lang="ts">
|
|
3023
|
+
import { loadSource } from '@classic-homes/viewer-svelte';
|
|
3024
|
+
import { CadViewer } from '@classic-homes/viewer-svelte/cad';
|
|
3025
|
+
</script>
|
|
3026
|
+
|
|
3027
|
+
{#await loadSource('/plans/lot-14-site-plan.dxf') then source}
|
|
3028
|
+
<CadViewer {source} kind="dxf" background="dark" showLayers class="h-[80vh]" />
|
|
3029
|
+
{/await}`
|
|
3030
|
+
}
|
|
3031
|
+
],
|
|
3032
|
+
relatedComponents: [
|
|
3033
|
+
"DwgViewer",
|
|
3034
|
+
"DocumentViewer"
|
|
3035
|
+
]
|
|
3036
|
+
},
|
|
2924
3037
|
{
|
|
2925
3038
|
name: "CandlestickChart",
|
|
2926
3039
|
description: "Financial OHLC data with volume bars",
|
|
@@ -4510,6 +4623,12 @@ var component_catalog_default = {
|
|
|
4510
4623
|
required: false,
|
|
4511
4624
|
description: "Message when no options match"
|
|
4512
4625
|
},
|
|
4626
|
+
{
|
|
4627
|
+
name: "maxResults",
|
|
4628
|
+
type: "number",
|
|
4629
|
+
required: false,
|
|
4630
|
+
description: "Render at most this many matches, with a note to type to narrow the rest. Filtering still searches every option"
|
|
4631
|
+
},
|
|
4513
4632
|
{
|
|
4514
4633
|
name: "disabled",
|
|
4515
4634
|
type: "boolean",
|
|
@@ -4992,6 +5111,91 @@ var component_catalog_default = {
|
|
|
4992
5111
|
"AreaChart"
|
|
4993
5112
|
]
|
|
4994
5113
|
},
|
|
5114
|
+
{
|
|
5115
|
+
name: "ContextMenu",
|
|
5116
|
+
description: "Right-click (or long-press) menu for an area, with the same items as DropdownMenu",
|
|
5117
|
+
category: "core",
|
|
5118
|
+
importPath: "@classic-homes/theme-svelte",
|
|
5119
|
+
props: [
|
|
5120
|
+
{
|
|
5121
|
+
name: "items",
|
|
5122
|
+
type: "(DropdownMenuItem | DropdownMenuGroup)[]",
|
|
5123
|
+
required: true,
|
|
5124
|
+
description: "Menu items, the same shape as DropdownMenu's"
|
|
5125
|
+
},
|
|
5126
|
+
{
|
|
5127
|
+
name: "children",
|
|
5128
|
+
type: "Snippet",
|
|
5129
|
+
required: true,
|
|
5130
|
+
description: "The area that opens the menu on right-click (or long-press)"
|
|
5131
|
+
},
|
|
5132
|
+
{
|
|
5133
|
+
name: "open",
|
|
5134
|
+
type: "boolean",
|
|
5135
|
+
default: "false",
|
|
5136
|
+
required: false,
|
|
5137
|
+
description: "Whether the menu is open (bindable)"
|
|
5138
|
+
},
|
|
5139
|
+
{
|
|
5140
|
+
name: "onOpenChange",
|
|
5141
|
+
type: "(open: boolean) => void",
|
|
5142
|
+
required: false,
|
|
5143
|
+
description: "Called when the menu opens or closes"
|
|
5144
|
+
},
|
|
5145
|
+
{
|
|
5146
|
+
name: "disabled",
|
|
5147
|
+
type: "boolean",
|
|
5148
|
+
default: "false",
|
|
5149
|
+
required: false,
|
|
5150
|
+
description: "Leave the browser's own menu in place"
|
|
5151
|
+
},
|
|
5152
|
+
{
|
|
5153
|
+
name: "triggerClass",
|
|
5154
|
+
type: "string",
|
|
5155
|
+
required: false,
|
|
5156
|
+
description: "Classes for the trigger area"
|
|
5157
|
+
},
|
|
5158
|
+
{
|
|
5159
|
+
name: "class",
|
|
5160
|
+
type: "string",
|
|
5161
|
+
required: false,
|
|
5162
|
+
description: "Classes for the menu"
|
|
5163
|
+
},
|
|
5164
|
+
{
|
|
5165
|
+
name: "onCloseAutoFocus",
|
|
5166
|
+
type: "(event: Event) => void",
|
|
5167
|
+
required: false,
|
|
5168
|
+
description: "As the menu closes; `preventDefault()` keeps focus where a chosen item put it (e.g. in a dialog it opened)"
|
|
5169
|
+
}
|
|
5170
|
+
],
|
|
5171
|
+
variants: [],
|
|
5172
|
+
slots: [
|
|
5173
|
+
{
|
|
5174
|
+
name: "children",
|
|
5175
|
+
description: "Main content",
|
|
5176
|
+
required: false
|
|
5177
|
+
}
|
|
5178
|
+
],
|
|
5179
|
+
events: [],
|
|
5180
|
+
examples: [
|
|
5181
|
+
{
|
|
5182
|
+
title: "Basic Usage",
|
|
5183
|
+
code: `<script>
|
|
5184
|
+
const items = [
|
|
5185
|
+
{ label: 'Rename', icon: 'edit', shortcut: 'F2', onSelect: rename },
|
|
5186
|
+
{ label: 'Duplicate', onSelect: duplicate },
|
|
5187
|
+
{ type: 'separator' },
|
|
5188
|
+
{ label: 'Delete', icon: 'trash', destructive: true, onSelect: remove },
|
|
5189
|
+
];
|
|
5190
|
+
</script>
|
|
5191
|
+
|
|
5192
|
+
<ContextMenu {items} triggerClass="block rounded-md border border-dashed p-8">
|
|
5193
|
+
Right-click here
|
|
5194
|
+
</ContextMenu>`
|
|
5195
|
+
}
|
|
5196
|
+
],
|
|
5197
|
+
relatedComponents: []
|
|
5198
|
+
},
|
|
4995
5199
|
{
|
|
4996
5200
|
name: "DashboardLayout",
|
|
4997
5201
|
description: "Complete dashboard layout with responsive sidebar and header",
|
|
@@ -7295,6 +7499,12 @@ var component_catalog_default = {
|
|
|
7295
7499
|
required: false,
|
|
7296
7500
|
description: "Called before focus returns to the trigger on close; `preventDefault()` keeps focus where the caller put it (e.g. a field it just revealed)."
|
|
7297
7501
|
},
|
|
7502
|
+
{
|
|
7503
|
+
name: "onOpenAutoFocus",
|
|
7504
|
+
type: "(event: Event) => void",
|
|
7505
|
+
required: false,
|
|
7506
|
+
description: "Called as the dialog opens, before focus moves to its first focusable element (often the close button); `preventDefault()` and focus a field yourself to start there."
|
|
7507
|
+
},
|
|
7298
7508
|
{
|
|
7299
7509
|
name: "dirty",
|
|
7300
7510
|
type: "boolean",
|
|
@@ -7352,6 +7562,187 @@ var component_catalog_default = {
|
|
|
7352
7562
|
"DropdownMenu"
|
|
7353
7563
|
]
|
|
7354
7564
|
},
|
|
7565
|
+
{
|
|
7566
|
+
name: "DocumentViewer",
|
|
7567
|
+
description: "Show PDF, Word, Excel, CSV and CAD files in the browser, with format detection and lazy-loaded viewers",
|
|
7568
|
+
category: "viewer",
|
|
7569
|
+
importPath: "@classic-homes/viewer-svelte",
|
|
7570
|
+
props: [
|
|
7571
|
+
{
|
|
7572
|
+
name: "source",
|
|
7573
|
+
type: "ViewerSource",
|
|
7574
|
+
required: false,
|
|
7575
|
+
description: "File, Blob, URL, bytes or offline-core stored file. Changing it loads the new one"
|
|
7576
|
+
},
|
|
7577
|
+
{
|
|
7578
|
+
name: "viewers",
|
|
7579
|
+
type: "ViewerRegistry",
|
|
7580
|
+
required: true,
|
|
7581
|
+
description: "Viewers to use, as lazy imports keyed by format"
|
|
7582
|
+
},
|
|
7583
|
+
{
|
|
7584
|
+
name: "name",
|
|
7585
|
+
type: "string",
|
|
7586
|
+
required: false,
|
|
7587
|
+
description: "File name hint (extension fallback, download name) when the source has none"
|
|
7588
|
+
},
|
|
7589
|
+
{
|
|
7590
|
+
name: "mime",
|
|
7591
|
+
type: "string",
|
|
7592
|
+
required: false,
|
|
7593
|
+
description: "MIME type hint when the source has none"
|
|
7594
|
+
},
|
|
7595
|
+
{
|
|
7596
|
+
name: "maxBytes",
|
|
7597
|
+
type: "number",
|
|
7598
|
+
default: "104857600",
|
|
7599
|
+
required: false,
|
|
7600
|
+
description: 'Size cap in bytes (100 MB); larger files get a "too large" state'
|
|
7601
|
+
},
|
|
7602
|
+
{
|
|
7603
|
+
name: "fetchInit",
|
|
7604
|
+
type: "RequestInit",
|
|
7605
|
+
required: false,
|
|
7606
|
+
description: "`fetch` options for URL sources (credentials, auth headers)"
|
|
7607
|
+
},
|
|
7608
|
+
{
|
|
7609
|
+
name: "allowDownload",
|
|
7610
|
+
type: "boolean",
|
|
7611
|
+
default: "true",
|
|
7612
|
+
required: false,
|
|
7613
|
+
description: 'Offer "Download file" when a file cannot be shown'
|
|
7614
|
+
},
|
|
7615
|
+
{
|
|
7616
|
+
name: "hideToolbar",
|
|
7617
|
+
type: "boolean",
|
|
7618
|
+
default: "false",
|
|
7619
|
+
required: false,
|
|
7620
|
+
description: "Hide the viewer toolbar"
|
|
7621
|
+
},
|
|
7622
|
+
{
|
|
7623
|
+
name: "onload",
|
|
7624
|
+
type: "(info: DocumentLoadInfo) => void",
|
|
7625
|
+
required: false,
|
|
7626
|
+
description: "The document is on screen: `{ kind, name, size }`"
|
|
7627
|
+
},
|
|
7628
|
+
{
|
|
7629
|
+
name: "onerror",
|
|
7630
|
+
type: "(error: ViewerError) => void",
|
|
7631
|
+
required: false,
|
|
7632
|
+
description: "Loading or rendering failed"
|
|
7633
|
+
},
|
|
7634
|
+
{
|
|
7635
|
+
name: "class",
|
|
7636
|
+
type: "string",
|
|
7637
|
+
required: false,
|
|
7638
|
+
description: "Classes for the outer element; give it a height"
|
|
7639
|
+
}
|
|
7640
|
+
],
|
|
7641
|
+
variants: [],
|
|
7642
|
+
slots: [],
|
|
7643
|
+
events: [],
|
|
7644
|
+
examples: [
|
|
7645
|
+
{
|
|
7646
|
+
title: "Basic Usage",
|
|
7647
|
+
code: `<script lang="ts">
|
|
7648
|
+
import { DocumentViewer, acceptFor, type ViewerRegistry } from '@classic-homes/viewer-svelte';
|
|
7649
|
+
|
|
7650
|
+
// Each entry is a lazy import: formats you leave out are never bundled
|
|
7651
|
+
const viewers: ViewerRegistry = {
|
|
7652
|
+
pdf: () => import('@classic-homes/viewer-svelte/pdf'),
|
|
7653
|
+
docx: () => import('@classic-homes/viewer-svelte/docx'),
|
|
7654
|
+
xlsx: () => import('@classic-homes/viewer-svelte/xlsx'),
|
|
7655
|
+
csv: () => import('@classic-homes/viewer-svelte/xlsx'),
|
|
7656
|
+
dxf: () => import('@classic-homes/viewer-svelte/cad'),
|
|
7657
|
+
};
|
|
7658
|
+
|
|
7659
|
+
let file = $state<File>();
|
|
7660
|
+
</script>
|
|
7661
|
+
|
|
7662
|
+
<input type="file" accept={acceptFor()} onchange={(e) => (file = e.currentTarget.files?.[0])} />
|
|
7663
|
+
<DocumentViewer source={file} {viewers} class="h-[80vh]" />`
|
|
7664
|
+
}
|
|
7665
|
+
],
|
|
7666
|
+
relatedComponents: [
|
|
7667
|
+
"PdfViewer",
|
|
7668
|
+
"SpreadsheetViewer",
|
|
7669
|
+
"DocxViewer",
|
|
7670
|
+
"CadViewer",
|
|
7671
|
+
"DwgViewer"
|
|
7672
|
+
]
|
|
7673
|
+
},
|
|
7674
|
+
{
|
|
7675
|
+
name: "DocxViewer",
|
|
7676
|
+
description: "Word documents laid out as pages with docx-preview, isolated in a shadow root and sanitised",
|
|
7677
|
+
category: "viewer",
|
|
7678
|
+
importPath: "@classic-homes/viewer-svelte/docx",
|
|
7679
|
+
props: [
|
|
7680
|
+
{
|
|
7681
|
+
name: "source",
|
|
7682
|
+
type: "LoadedSource",
|
|
7683
|
+
required: true,
|
|
7684
|
+
description: "Loaded bytes plus name and MIME hints"
|
|
7685
|
+
},
|
|
7686
|
+
{
|
|
7687
|
+
name: "kind",
|
|
7688
|
+
type: "RenderableKind",
|
|
7689
|
+
required: true,
|
|
7690
|
+
description: "`'docx'`"
|
|
7691
|
+
},
|
|
7692
|
+
{
|
|
7693
|
+
name: "initialZoom",
|
|
7694
|
+
type: "ZoomMode",
|
|
7695
|
+
default: "'fit-width'",
|
|
7696
|
+
required: false,
|
|
7697
|
+
description: "`'fit-width'` (never above 100%), `'fit-page'` or a scale"
|
|
7698
|
+
},
|
|
7699
|
+
{
|
|
7700
|
+
name: "hideToolbar",
|
|
7701
|
+
type: "boolean",
|
|
7702
|
+
default: "false",
|
|
7703
|
+
required: false,
|
|
7704
|
+
description: "Hide the toolbar"
|
|
7705
|
+
},
|
|
7706
|
+
{
|
|
7707
|
+
name: "onready",
|
|
7708
|
+
type: "() => void",
|
|
7709
|
+
required: false,
|
|
7710
|
+
description: "The document is on screen"
|
|
7711
|
+
},
|
|
7712
|
+
{
|
|
7713
|
+
name: "onerror",
|
|
7714
|
+
type: "(error: ViewerError) => void",
|
|
7715
|
+
required: false,
|
|
7716
|
+
description: "The document could not be read"
|
|
7717
|
+
},
|
|
7718
|
+
{
|
|
7719
|
+
name: "class",
|
|
7720
|
+
type: "string",
|
|
7721
|
+
required: false,
|
|
7722
|
+
description: "Classes for the outer element"
|
|
7723
|
+
}
|
|
7724
|
+
],
|
|
7725
|
+
variants: [],
|
|
7726
|
+
slots: [],
|
|
7727
|
+
events: [],
|
|
7728
|
+
examples: [
|
|
7729
|
+
{
|
|
7730
|
+
title: "Basic Usage",
|
|
7731
|
+
code: `<script lang="ts">
|
|
7732
|
+
import { loadSource } from '@classic-homes/viewer-svelte';
|
|
7733
|
+
import { DocxViewer } from '@classic-homes/viewer-svelte/docx';
|
|
7734
|
+
</script>
|
|
7735
|
+
|
|
7736
|
+
{#await loadSource('/specs/lot-12.docx') then source}
|
|
7737
|
+
<DocxViewer {source} kind="docx" class="h-[80vh]" />
|
|
7738
|
+
{/await}`
|
|
7739
|
+
}
|
|
7740
|
+
],
|
|
7741
|
+
relatedComponents: [
|
|
7742
|
+
"DocumentViewer",
|
|
7743
|
+
"PdfViewer"
|
|
7744
|
+
]
|
|
7745
|
+
},
|
|
7355
7746
|
{
|
|
7356
7747
|
name: "DonutChart",
|
|
7357
7748
|
description: "Pie chart variant with center labels for key metrics",
|
|
@@ -8193,6 +8584,89 @@ var component_catalog_default = {
|
|
|
8193
8584
|
"Tooltip"
|
|
8194
8585
|
]
|
|
8195
8586
|
},
|
|
8587
|
+
{
|
|
8588
|
+
name: "DwgViewer",
|
|
8589
|
+
description: "AutoCAD DWG drawings converted to DXF in the browser with LibreDWG (WebAssembly), then shown in the CAD viewer",
|
|
8590
|
+
category: "viewer",
|
|
8591
|
+
importPath: "@classic-homes/viewer-dwg/svelte",
|
|
8592
|
+
props: [
|
|
8593
|
+
{
|
|
8594
|
+
name: "source",
|
|
8595
|
+
type: "LoadedSource",
|
|
8596
|
+
required: true,
|
|
8597
|
+
description: "Loaded DWG bytes plus name and MIME hints"
|
|
8598
|
+
},
|
|
8599
|
+
{
|
|
8600
|
+
name: "kind",
|
|
8601
|
+
type: "RenderableKind",
|
|
8602
|
+
required: true,
|
|
8603
|
+
description: "`'dwg'`"
|
|
8604
|
+
},
|
|
8605
|
+
{
|
|
8606
|
+
name: "background",
|
|
8607
|
+
type: "'theme' | 'dark' | 'light'",
|
|
8608
|
+
default: "'theme'",
|
|
8609
|
+
required: false,
|
|
8610
|
+
description: "Canvas background"
|
|
8611
|
+
},
|
|
8612
|
+
{
|
|
8613
|
+
name: "showLayers",
|
|
8614
|
+
type: "boolean",
|
|
8615
|
+
default: "false",
|
|
8616
|
+
required: false,
|
|
8617
|
+
description: "Open the layer panel on load"
|
|
8618
|
+
},
|
|
8619
|
+
{
|
|
8620
|
+
name: "fonts",
|
|
8621
|
+
type: "string[]",
|
|
8622
|
+
required: false,
|
|
8623
|
+
description: "Font URLs, instead of the ones from `configureCad`"
|
|
8624
|
+
},
|
|
8625
|
+
{
|
|
8626
|
+
name: "hideToolbar",
|
|
8627
|
+
type: "boolean",
|
|
8628
|
+
default: "false",
|
|
8629
|
+
required: false,
|
|
8630
|
+
description: "Hide the toolbar"
|
|
8631
|
+
},
|
|
8632
|
+
{
|
|
8633
|
+
name: "onready",
|
|
8634
|
+
type: "() => void",
|
|
8635
|
+
required: false,
|
|
8636
|
+
description: "The converted drawing is on screen"
|
|
8637
|
+
},
|
|
8638
|
+
{
|
|
8639
|
+
name: "onerror",
|
|
8640
|
+
type: "(error: ViewerError) => void",
|
|
8641
|
+
required: false,
|
|
8642
|
+
description: "Conversion or rendering failed"
|
|
8643
|
+
},
|
|
8644
|
+
{
|
|
8645
|
+
name: "class",
|
|
8646
|
+
type: "string",
|
|
8647
|
+
required: false,
|
|
8648
|
+
description: "Classes for the outer element"
|
|
8649
|
+
}
|
|
8650
|
+
],
|
|
8651
|
+
variants: [
|
|
8652
|
+
{
|
|
8653
|
+
name: "background",
|
|
8654
|
+
values: [
|
|
8655
|
+
"theme",
|
|
8656
|
+
"dark",
|
|
8657
|
+
"light"
|
|
8658
|
+
],
|
|
8659
|
+
default: "theme"
|
|
8660
|
+
}
|
|
8661
|
+
],
|
|
8662
|
+
slots: [],
|
|
8663
|
+
events: [],
|
|
8664
|
+
examples: [],
|
|
8665
|
+
relatedComponents: [
|
|
8666
|
+
"CadViewer",
|
|
8667
|
+
"DocumentViewer"
|
|
8668
|
+
]
|
|
8669
|
+
},
|
|
8196
8670
|
{
|
|
8197
8671
|
name: "ErrorLayout",
|
|
8198
8672
|
description: "Layout for error pages with status codes and messaging",
|
|
@@ -9680,6 +10154,20 @@ var component_catalog_default = {
|
|
|
9680
10154
|
required: false,
|
|
9681
10155
|
description: "Task list width in px (bindable; users can drag the divider)"
|
|
9682
10156
|
},
|
|
10157
|
+
{
|
|
10158
|
+
name: "columnWidths",
|
|
10159
|
+
type: "Record<string, number>",
|
|
10160
|
+
default: "{}",
|
|
10161
|
+
required: false,
|
|
10162
|
+
description: "Column width overrides by column id (bindable). Dragging a column edge records it here"
|
|
10163
|
+
},
|
|
10164
|
+
{
|
|
10165
|
+
name: "resizableColumns",
|
|
10166
|
+
type: "boolean",
|
|
10167
|
+
default: "true",
|
|
10168
|
+
required: false,
|
|
10169
|
+
description: "Drag handles on column headers; each is also a focusable separator (Left/Right, Shift for bigger steps)"
|
|
10170
|
+
},
|
|
9683
10171
|
{
|
|
9684
10172
|
name: "rowHeight",
|
|
9685
10173
|
type: "number",
|
|
@@ -9705,7 +10193,7 @@ var component_catalog_default = {
|
|
|
9705
10193
|
type: "boolean",
|
|
9706
10194
|
default: "true",
|
|
9707
10195
|
required: false,
|
|
9708
|
-
description: "Zoom, today, expand/collapse, critical path, baseline and
|
|
10196
|
+
description: "Zoom, today, expand/collapse, critical path, baseline and export controls"
|
|
9709
10197
|
},
|
|
9710
10198
|
{
|
|
9711
10199
|
name: "showCritical",
|
|
@@ -9754,7 +10242,7 @@ var component_catalog_default = {
|
|
|
9754
10242
|
type: "boolean",
|
|
9755
10243
|
default: "true",
|
|
9756
10244
|
required: false,
|
|
9757
|
-
description: "CSV
|
|
10245
|
+
description: "Export menu: CSV table, JSON project, PNG image of the current view"
|
|
9758
10246
|
},
|
|
9759
10247
|
{
|
|
9760
10248
|
name: "loading",
|
|
@@ -9805,7 +10293,7 @@ var component_catalog_default = {
|
|
|
9805
10293
|
name: "ontaskdblclick",
|
|
9806
10294
|
type: "(task: GanttTask, scheduled: ScheduledTask, event: MouseEvent) => void",
|
|
9807
10295
|
required: false,
|
|
9808
|
-
description: "Bar double-click"
|
|
10296
|
+
description: "Bar or row double-click. When `editable` the task dialog opens too, unless you call `event.preventDefault()`"
|
|
9809
10297
|
},
|
|
9810
10298
|
{
|
|
9811
10299
|
name: "onselectionchange",
|
|
@@ -9818,7 +10306,7 @@ var component_catalog_default = {
|
|
|
9818
10306
|
type: "boolean",
|
|
9819
10307
|
default: "false",
|
|
9820
10308
|
required: false,
|
|
9821
|
-
description: "Drag
|
|
10309
|
+
description: "Drag, link and nudge bars; task dialog; in-place cell edits; add, indent and outdent tasks; undo/redo"
|
|
9822
10310
|
},
|
|
9823
10311
|
{
|
|
9824
10312
|
name: "onchange",
|
|
@@ -14812,6 +15300,85 @@ var component_catalog_default = {
|
|
|
14812
15300
|
"Separator"
|
|
14813
15301
|
]
|
|
14814
15302
|
},
|
|
15303
|
+
{
|
|
15304
|
+
name: "PdfViewer",
|
|
15305
|
+
description: "PDF pages rendered with pdf.js, with selectable text, find, links, zoom and page navigation",
|
|
15306
|
+
category: "viewer",
|
|
15307
|
+
importPath: "@classic-homes/viewer-svelte/pdf",
|
|
15308
|
+
props: [
|
|
15309
|
+
{
|
|
15310
|
+
name: "source",
|
|
15311
|
+
type: "LoadedSource",
|
|
15312
|
+
required: true,
|
|
15313
|
+
description: "Loaded bytes plus name and MIME hints (`loadSource`)"
|
|
15314
|
+
},
|
|
15315
|
+
{
|
|
15316
|
+
name: "kind",
|
|
15317
|
+
type: "RenderableKind",
|
|
15318
|
+
required: true,
|
|
15319
|
+
description: "`'pdf'`"
|
|
15320
|
+
},
|
|
15321
|
+
{
|
|
15322
|
+
name: "initialZoom",
|
|
15323
|
+
type: "ZoomMode",
|
|
15324
|
+
default: "'fit-width'",
|
|
15325
|
+
required: false,
|
|
15326
|
+
description: "`'fit-width'`, `'fit-page'` or a scale such as `1.5`"
|
|
15327
|
+
},
|
|
15328
|
+
{
|
|
15329
|
+
name: "initialPage",
|
|
15330
|
+
type: "number",
|
|
15331
|
+
default: "1",
|
|
15332
|
+
required: false,
|
|
15333
|
+
description: "1-based page to open at"
|
|
15334
|
+
},
|
|
15335
|
+
{
|
|
15336
|
+
name: "hideToolbar",
|
|
15337
|
+
type: "boolean",
|
|
15338
|
+
default: "false",
|
|
15339
|
+
required: false,
|
|
15340
|
+
description: "Hide the toolbar"
|
|
15341
|
+
},
|
|
15342
|
+
{
|
|
15343
|
+
name: "onready",
|
|
15344
|
+
type: "() => void",
|
|
15345
|
+
required: false,
|
|
15346
|
+
description: "The first page is on screen"
|
|
15347
|
+
},
|
|
15348
|
+
{
|
|
15349
|
+
name: "onerror",
|
|
15350
|
+
type: "(error: ViewerError) => void",
|
|
15351
|
+
required: false,
|
|
15352
|
+
description: "Parsing or rendering failed"
|
|
15353
|
+
},
|
|
15354
|
+
{
|
|
15355
|
+
name: "class",
|
|
15356
|
+
type: "string",
|
|
15357
|
+
required: false,
|
|
15358
|
+
description: "Classes for the outer element"
|
|
15359
|
+
}
|
|
15360
|
+
],
|
|
15361
|
+
variants: [],
|
|
15362
|
+
slots: [],
|
|
15363
|
+
events: [],
|
|
15364
|
+
examples: [
|
|
15365
|
+
{
|
|
15366
|
+
title: "Basic Usage",
|
|
15367
|
+
code: `<script lang="ts">
|
|
15368
|
+
import { loadSource } from '@classic-homes/viewer-svelte';
|
|
15369
|
+
import { PdfViewer } from '@classic-homes/viewer-svelte/pdf';
|
|
15370
|
+
</script>
|
|
15371
|
+
|
|
15372
|
+
{#await loadSource('/plans/lot-12.pdf') then source}
|
|
15373
|
+
<PdfViewer {source} kind="pdf" initialZoom="fit-page" class="h-[80vh]" />
|
|
15374
|
+
{/await}`
|
|
15375
|
+
}
|
|
15376
|
+
],
|
|
15377
|
+
relatedComponents: [
|
|
15378
|
+
"DocumentViewer",
|
|
15379
|
+
"DocxViewer"
|
|
15380
|
+
]
|
|
15381
|
+
},
|
|
14815
15382
|
{
|
|
14816
15383
|
name: "PieChart",
|
|
14817
15384
|
description: "Show proportional data with interactive labels",
|
|
@@ -16893,6 +17460,12 @@ var component_catalog_default = {
|
|
|
16893
17460
|
default: "false",
|
|
16894
17461
|
required: false,
|
|
16895
17462
|
description: "Type to narrow: `true` always, a number once there are that many options"
|
|
17463
|
+
},
|
|
17464
|
+
{
|
|
17465
|
+
name: "maxResults",
|
|
17466
|
+
type: "number",
|
|
17467
|
+
required: false,
|
|
17468
|
+
description: "With `searchable`: render at most this many matches (see Combobox)"
|
|
16896
17469
|
}
|
|
16897
17470
|
],
|
|
16898
17471
|
variants: [],
|
|
@@ -18890,6 +19463,76 @@ var component_catalog_default = {
|
|
|
18890
19463
|
"Button"
|
|
18891
19464
|
]
|
|
18892
19465
|
},
|
|
19466
|
+
{
|
|
19467
|
+
name: "SpreadsheetViewer",
|
|
19468
|
+
description: "Excel and CSV files as a read-only grid with number formats, styles, merged cells, frozen panes and sheet tabs",
|
|
19469
|
+
category: "viewer",
|
|
19470
|
+
importPath: "@classic-homes/viewer-svelte/xlsx",
|
|
19471
|
+
props: [
|
|
19472
|
+
{
|
|
19473
|
+
name: "source",
|
|
19474
|
+
type: "LoadedSource",
|
|
19475
|
+
required: true,
|
|
19476
|
+
description: "Loaded bytes plus name and MIME hints"
|
|
19477
|
+
},
|
|
19478
|
+
{
|
|
19479
|
+
name: "kind",
|
|
19480
|
+
type: "RenderableKind",
|
|
19481
|
+
required: true,
|
|
19482
|
+
description: "`'xlsx'` or `'csv'`"
|
|
19483
|
+
},
|
|
19484
|
+
{
|
|
19485
|
+
name: "initialSheet",
|
|
19486
|
+
type: "string | number",
|
|
19487
|
+
required: false,
|
|
19488
|
+
description: "Name or 0-based index of the sheet to open; default first visible"
|
|
19489
|
+
},
|
|
19490
|
+
{
|
|
19491
|
+
name: "hideToolbar",
|
|
19492
|
+
type: "boolean",
|
|
19493
|
+
default: "false",
|
|
19494
|
+
required: false,
|
|
19495
|
+
description: "Hide the toolbar"
|
|
19496
|
+
},
|
|
19497
|
+
{
|
|
19498
|
+
name: "onready",
|
|
19499
|
+
type: "() => void",
|
|
19500
|
+
required: false,
|
|
19501
|
+
description: "The first sheet is on screen"
|
|
19502
|
+
},
|
|
19503
|
+
{
|
|
19504
|
+
name: "onerror",
|
|
19505
|
+
type: "(error: ViewerError) => void",
|
|
19506
|
+
required: false,
|
|
19507
|
+
description: "Parsing failed"
|
|
19508
|
+
},
|
|
19509
|
+
{
|
|
19510
|
+
name: "class",
|
|
19511
|
+
type: "string",
|
|
19512
|
+
required: false,
|
|
19513
|
+
description: "Classes for the outer element"
|
|
19514
|
+
}
|
|
19515
|
+
],
|
|
19516
|
+
variants: [],
|
|
19517
|
+
slots: [],
|
|
19518
|
+
events: [],
|
|
19519
|
+
examples: [
|
|
19520
|
+
{
|
|
19521
|
+
title: "Basic Usage",
|
|
19522
|
+
code: `<script lang="ts">
|
|
19523
|
+
import { loadSource } from '@classic-homes/viewer-svelte';
|
|
19524
|
+
import { SpreadsheetViewer } from '@classic-homes/viewer-svelte/xlsx';
|
|
19525
|
+
</script>
|
|
19526
|
+
|
|
19527
|
+
{#await loadSource('/budgets/lot-12.xlsx') then source}
|
|
19528
|
+
<SpreadsheetViewer {source} kind="xlsx" initialSheet="Summary" class="h-[70vh]" />
|
|
19529
|
+
{/await}`
|
|
19530
|
+
}
|
|
19531
|
+
],
|
|
19532
|
+
relatedComponents: [
|
|
19533
|
+
"DocumentViewer"
|
|
19534
|
+
]
|
|
19535
|
+
},
|
|
18893
19536
|
{
|
|
18894
19537
|
name: "StatCard",
|
|
18895
19538
|
description: "A headline metric with its change against a previous value and an optional trend",
|
|
@@ -21117,7 +21760,7 @@ function registerComponentResources(server) {
|
|
|
21117
21760
|
|
|
21118
21761
|
// src/data/token-definitions.json
|
|
21119
21762
|
var token_definitions_default = {
|
|
21120
|
-
version: "0.
|
|
21763
|
+
version: "0.5.0",
|
|
21121
21764
|
colors: {
|
|
21122
21765
|
brand: [
|
|
21123
21766
|
{
|
|
@@ -22100,7 +22743,7 @@ function registerTokenResources(server) {
|
|
|
22100
22743
|
|
|
22101
22744
|
// src/data/styles-catalog.json
|
|
22102
22745
|
var styles_catalog_default = {
|
|
22103
|
-
version: "0.
|
|
22746
|
+
version: "0.5.0",
|
|
22104
22747
|
package: "@classic-homes/theme-styles",
|
|
22105
22748
|
description: "Base CSS styles, accessibility features, and utility classes for the Classic Theme design system",
|
|
22106
22749
|
integration: {
|
|
@@ -22483,7 +23126,7 @@ import { ResourceTemplate as ResourceTemplate2 } from "@modelcontextprotocol/sdk
|
|
|
22483
23126
|
|
|
22484
23127
|
// src/data/pattern-library.json
|
|
22485
23128
|
var pattern_library_default = {
|
|
22486
|
-
version: "0.
|
|
23129
|
+
version: "0.5.0",
|
|
22487
23130
|
layouts: [
|
|
22488
23131
|
{
|
|
22489
23132
|
id: "dashboard-page",
|
|
@@ -23577,7 +24220,7 @@ function registerLayoutResources(server) {
|
|
|
23577
24220
|
|
|
23578
24221
|
// src/data/schema-catalog.json
|
|
23579
24222
|
var schema_catalog_default = {
|
|
23580
|
-
version: "0.
|
|
24223
|
+
version: "0.5.0",
|
|
23581
24224
|
packageName: "@classic-homes/theme-svelte",
|
|
23582
24225
|
importPath: "@classic-homes/theme-svelte",
|
|
23583
24226
|
generatedFrom: "packages/svelte/src/lib/schemas/index.ts",
|
|
@@ -24385,7 +25028,7 @@ import { ResourceTemplate as ResourceTemplate3 } from "@modelcontextprotocol/sdk
|
|
|
24385
25028
|
|
|
24386
25029
|
// src/data/auth-catalog.json
|
|
24387
25030
|
var auth_catalog_default = {
|
|
24388
|
-
version: "0.
|
|
25031
|
+
version: "0.5.0",
|
|
24389
25032
|
packageName: "@classic-homes/auth",
|
|
24390
25033
|
description: "Authentication services and Svelte bindings for Classic Theme apps",
|
|
24391
25034
|
subpackages: {
|
|
@@ -27422,7 +28065,7 @@ import { ResourceTemplate as ResourceTemplate4 } from "@modelcontextprotocol/sdk
|
|
|
27422
28065
|
|
|
27423
28066
|
// src/data/notifications-catalog.json
|
|
27424
28067
|
var notifications_catalog_default = {
|
|
27425
|
-
version: "0.
|
|
28068
|
+
version: "0.5.0",
|
|
27426
28069
|
packageName: "@classic-homes/notifications",
|
|
27427
28070
|
description: "Notification services and Svelte bindings for Classic Theme apps",
|
|
27428
28071
|
subpackages: {
|
|
@@ -28334,7 +28977,7 @@ function registerNotificationsResources(server) {
|
|
|
28334
28977
|
|
|
28335
28978
|
// src/data/docs-catalog.json
|
|
28336
28979
|
var docs_catalog_default = {
|
|
28337
|
-
version: "0.
|
|
28980
|
+
version: "0.5.0",
|
|
28338
28981
|
packageName: "@classic-homes/theme-docs",
|
|
28339
28982
|
description: "Markdown documentation components for the Classic theme system",
|
|
28340
28983
|
exports: {
|
|
@@ -30006,7 +30649,7 @@ function registerDocsResources(server) {
|
|
|
30006
30649
|
|
|
30007
30650
|
// src/data/charts-catalog.json
|
|
30008
30651
|
var charts_catalog_default = {
|
|
30009
|
-
version: "0.
|
|
30652
|
+
version: "0.5.0",
|
|
30010
30653
|
packageName: "@classic-homes/charts-core",
|
|
30011
30654
|
description: "Core utilities, types, and themes for Classic Theme chart components",
|
|
30012
30655
|
subpackages: {
|
|
@@ -34144,7 +34787,7 @@ interface SankeyData {
|
|
|
34144
34787
|
|
|
34145
34788
|
// src/data/gantt-catalog.json
|
|
34146
34789
|
var gantt_catalog_default = {
|
|
34147
|
-
version: "0.
|
|
34790
|
+
version: "0.5.0",
|
|
34148
34791
|
packageName: "@classic-homes/gantt-core",
|
|
34149
34792
|
description: "Framework-agnostic Gantt engine: working calendars, a critical-path scheduler, an editable project model with undo/redo, timeline geometry, drag math, accessible descriptions and import/export. No DOM, no framework, no runtime dependencies. @classic-homes/gantt-svelte renders it; a React package (@classic-homes/gantt-react) is planned.",
|
|
34150
34793
|
packages: {
|
|
@@ -34319,7 +34962,7 @@ var gantt_catalog_default = {
|
|
|
34319
34962
|
name: "readonly",
|
|
34320
34963
|
type: "boolean",
|
|
34321
34964
|
required: false,
|
|
34322
|
-
description: "Blocks
|
|
34965
|
+
description: "Blocks edits to this task and its descendants, including touching dependencies"
|
|
34323
34966
|
},
|
|
34324
34967
|
{
|
|
34325
34968
|
name: "meta",
|
|
@@ -34606,7 +35249,7 @@ var gantt_catalog_default = {
|
|
|
34606
35249
|
"{ type: 'update-task'; id: string; patch: Partial<Omit<GanttTask, 'id'>> }",
|
|
34607
35250
|
"{ type: 'add-task'; task: GanttTask; index?: number }",
|
|
34608
35251
|
"{ type: 'remove-task'; id: string }",
|
|
34609
|
-
"{ type: 'add-dependency'; dependency: GanttDependency }",
|
|
35252
|
+
"{ type: 'add-dependency'; dependency: GanttDependency; index?: number }",
|
|
34610
35253
|
"{ type: 'update-dependency'; id: string; patch: Partial<Omit<GanttDependency, 'id'>> }",
|
|
34611
35254
|
"{ type: 'remove-dependency'; id: string }"
|
|
34612
35255
|
]
|
|
@@ -34630,7 +35273,7 @@ var gantt_catalog_default = {
|
|
|
34630
35273
|
name: "operations",
|
|
34631
35274
|
type: "GanttOperation[]",
|
|
34632
35275
|
required: true,
|
|
34633
|
-
description: "
|
|
35276
|
+
description: "Edit descriptions in order; persist task/dependency snapshots for exact undo restoration"
|
|
34634
35277
|
},
|
|
34635
35278
|
{
|
|
34636
35279
|
name: "dates",
|
|
@@ -34781,7 +35424,7 @@ var gantt_catalog_default = {
|
|
|
34781
35424
|
name: "historyLimit",
|
|
34782
35425
|
type: "number",
|
|
34783
35426
|
required: false,
|
|
34784
|
-
description: "Maximum undo steps (default 100)"
|
|
35427
|
+
description: "Maximum undo steps (default 100); 0 disables history"
|
|
34785
35428
|
}
|
|
34786
35429
|
],
|
|
34787
35430
|
state: "GanttModelState: { tasks, dependencies, calendars, schedule: ScheduleResult, rows: GanttRow[], wbs: Map<string, string> (every task, visible or not), selection: ReadonlySet<string>, focusedId: string | null, canUndo, canRedo, version (bumps on every state change) }",
|
|
@@ -34950,7 +35593,7 @@ var gantt_catalog_default = {
|
|
|
34950
35593
|
{
|
|
34951
35594
|
name: "shiftTask / editOperation",
|
|
34952
35595
|
signature: "shiftTask(ctx, mode, units) => EditPreview; editOperation(ctx, mode, preview) => GanttOperation | null",
|
|
34953
|
-
description: "Keyboard nudges and the resulting update-task operation, keeping the data's shape (start+end stays start+end, date-only stays date-only)"
|
|
35596
|
+
description: "Keyboard nudges and the resulting update-task operation, keeping the data's shape (start+end stays start+end, date-only stays date-only with day or coarser snapping; hourly edits use datetime strings)"
|
|
34954
35597
|
},
|
|
34955
35598
|
{
|
|
34956
35599
|
name: "unitsForDelta / progressAt",
|
|
@@ -34961,6 +35604,21 @@ var gantt_catalog_default = {
|
|
|
34961
35604
|
name: "linkOperation / dependencyTypeFor / createId",
|
|
34962
35605
|
signature: "linkOperation(from, to, type?, extra?) => GanttOperation; dependencyTypeFor(fromSide, toSide) => DependencyType",
|
|
34963
35606
|
description: "Building add-dependency operations from bar-end drags"
|
|
35607
|
+
},
|
|
35608
|
+
{
|
|
35609
|
+
name: "rescheduleDates / rescheduleOperation",
|
|
35610
|
+
signature: "(ctx: EditContext, edit: { start?, finish?, duration? }) => EditPreview / UpdateTaskOperation | null",
|
|
35611
|
+
description: "Typed dates or durations (days at day snap, times at hour snap) to snapped dates and a shape-preserving update-task op; moving the start keeps the length"
|
|
35612
|
+
},
|
|
35613
|
+
{
|
|
35614
|
+
name: "predecessorOperations / parseDuration",
|
|
35615
|
+
signature: "predecessorOperations(taskId, dependencies, drafts: PredecessorDraft[]) => GanttOperation[]; parseDuration(text, minutesPerDay?) => number | undefined",
|
|
35616
|
+
description: "Diff a task's incoming links into remove/update/add ops; read '3', '3d', '4h', '2w' as working days"
|
|
35617
|
+
},
|
|
35618
|
+
{
|
|
35619
|
+
name: "indentOperation / outdentOperations / insertTaskOperation",
|
|
35620
|
+
signature: "indentOperation(tasks, id) => UpdateTaskOperation | null; outdentOperations(tasks, id) => UpdateTaskOperation[]; insertTaskOperation(tasks, afterId, task) => GanttOperation",
|
|
35621
|
+
description: "Outline edits: indent under the sibling above; outdent after the old parent, adopting later siblings; insert after a task's subtree"
|
|
34964
35622
|
}
|
|
34965
35623
|
],
|
|
34966
35624
|
a11y: [
|
|
@@ -34989,7 +35647,7 @@ var gantt_catalog_default = {
|
|
|
34989
35647
|
{
|
|
34990
35648
|
name: "exportProject",
|
|
34991
35649
|
signature: "(tasks, dependencies, calendars?, schedule?) => GanttProjectData",
|
|
34992
|
-
description: "Serialisable { version: 1, tasks, dependencies, calendars? },
|
|
35650
|
+
description: "Serialisable { version: 1, tasks, dependencies, calendars? }; Date values, including nested constraint/baseline fields, become wall-clock strings. Resolved dates are written back when a schedule is given"
|
|
34993
35651
|
},
|
|
34994
35652
|
{
|
|
34995
35653
|
name: "importProject",
|
|
@@ -35010,11 +35668,11 @@ var gantt_catalog_default = {
|
|
|
35010
35668
|
description: "Accessible task tree grid on the left, timeline on the right (bars, milestones, summary brackets, dependency arrows, today line, baselines, critical path). Props are listed by get_component_props('Gantt').",
|
|
35011
35669
|
keyProps: {
|
|
35012
35670
|
data: "tasks (required), dependencies, calendars, scheduleOptions",
|
|
35013
|
-
view: "zoom (bindable), zoomLevels, columns, gridWidth (bindable), rowHeight, height, collapsed",
|
|
35014
|
-
toggles: "showToolbar, showCritical (bindable), showBaseline (bindable), showDependencies, showToday, showLabels, showProgress, exportable",
|
|
35671
|
+
view: "zoom (bindable), zoomLevels, columns, gridWidth (bindable), columnWidths (bindable Record<id, px>), resizableColumns (default true), rowHeight, height, collapsed",
|
|
35672
|
+
toggles: "showToolbar, showCritical (bindable), showBaseline (bindable), showDependencies, showToday, showLabels, showProgress, exportable (Export menu: CSV, JSON, PNG of the current view)",
|
|
35015
35673
|
states: "loading, error, onRetry, emptyMessage",
|
|
35016
35674
|
locale: "locale, weekStartsOn",
|
|
35017
|
-
events: "ontaskclick(task, scheduled, event), ontaskdblclick(task, scheduled, event), onselectionchange(ids)",
|
|
35675
|
+
events: "ontaskclick(task, scheduled, event), ontaskdblclick(task, scheduled, event) (bar or row; opens the task dialog when editable unless event.preventDefault()), onselectionchange(ids)",
|
|
35018
35676
|
other: "toolbarActions (Snippet), class",
|
|
35019
35677
|
editing: "editable (default false), onchange(change: GanttChange) \u2014 every edit, undo and redo with operations, moved dates and the full data afterwards. Feed change.tasks back as tasks to keep undo history; any other array replaces the data and clears it."
|
|
35020
35678
|
},
|
|
@@ -35023,9 +35681,14 @@ var gantt_catalog_default = {
|
|
|
35023
35681
|
scrollToTask: "(id: string) => Promise<void>: expands ancestors, selects and focuses the row, scrolls its bar into view",
|
|
35024
35682
|
scrollToDate: "(date, align?: 'start' | 'center') => Promise<void>",
|
|
35025
35683
|
getModel: "() => GanttModel (undo/redo, previews, direct edits)",
|
|
35026
|
-
getSchedule: "() => ScheduleResult"
|
|
35027
|
-
|
|
35028
|
-
|
|
35684
|
+
getSchedule: "() => ScheduleResult",
|
|
35685
|
+
editTask: "(id: string) => boolean: opens the task dialog when editable; false for read-only tasks",
|
|
35686
|
+
addTask: "(afterId?: string | null) => Promise<string | null>: adds a task below afterId (default the focused row; an expanded summary gets it as first subtask) and starts editing its name",
|
|
35687
|
+
"indentTask / outdentTask": "(id: string) => boolean: Tab / Shift+Tab; outdent adopts the siblings below as subtasks",
|
|
35688
|
+
download: "(format: 'csv' | 'json' | 'png') => Promise<void>: same as the Export menu; JSON is exportProject of your own data (re-importable), PNG is the current view at 2x",
|
|
35689
|
+
deleteTask: "(id: string) => boolean: confirmation (AlertDialog), then removes the subtree and its links as one undo step; false for read-only tasks"
|
|
35690
|
+
},
|
|
35691
|
+
accessibility: "The task list is a treegrid with one tab stop: arrows, Home/End, Page Up/Down, Right/Left expand/collapse/parent, Enter activates (ontaskclick), Space selects, Shift extends, Ctrl/Cmd+A selects all, Escape clears. Rows are virtualised with aria-rowcount/aria-rowindex. The timeline is aria-hidden; a visually hidden summary describes the schedule. When editable, Right Arrow from a row enters its cells (Left/Right between cells, Up/Down keep the column, Escape or Left from the first cell returns), Enter/F2 on a cell edits it, F2 on a row opens the task dialog.",
|
|
35029
35692
|
example: `<script>
|
|
35030
35693
|
import { Gantt } from '@classic-homes/gantt-svelte';
|
|
35031
35694
|
|
|
@@ -35041,12 +35704,15 @@ var gantt_catalog_default = {
|
|
|
35041
35704
|
</script>
|
|
35042
35705
|
|
|
35043
35706
|
<Gantt {tasks} {dependencies} title="Launch plan" showCritical />`,
|
|
35044
|
-
status: "Svelte only. Editing covers drag move/resize/progress, drag-to-link, keyboard nudges
|
|
35707
|
+
status: "Svelte only. Editing covers drag move/resize/progress, drag-to-link, keyboard nudges, the task dialog (GanttTaskDialog), in-place grid cell edits, add/indent/outdent and undo/redo. Next: PM polish (phase 4) and @classic-homes/gantt-react.",
|
|
35045
35708
|
editing: {
|
|
35046
35709
|
pointer: "Drag a bar to move it, its left/right edge to resize, the marker under it to set progress (5% steps); successors reschedule live while dragging (model.preview) and one undoable operation commits on release; Escape cancels. Drag from the dot at either end of a bar onto another bar to link them: the start/finish ends chosen give FS/SS/FF/SF; circular links are refused with a message.",
|
|
35047
|
-
keyboard: "On a focused row: Alt+Left/Right moves the task one snap unit, Alt+Shift+Left/Right changes its finish, Ctrl/Cmd+Z undoes, Ctrl/Cmd+Shift+Z or Ctrl+Y redoes. Every edit is announced in a polite live region.",
|
|
35048
|
-
rules: "Edits snap to the zoom preset's unit and skip non-working time.
|
|
35049
|
-
toolbar: "Undo and Redo
|
|
35710
|
+
keyboard: "On a focused row: Alt+Left/Right moves the task one snap unit, Alt+Shift+Left/Right changes its finish, Ctrl/Cmd+Z undoes, Ctrl/Cmd+Shift+Z or Ctrl+Y redoes, F2 opens the task dialog, Insert adds a task below, Delete removes one (after confirmation), Tab/Shift+Tab indent/outdent (only when possible, so Tab can still leave the grid). Every edit is announced in a polite live region.",
|
|
35711
|
+
rules: "Edits snap to the zoom preset's unit and skip non-working time. Summary dates are derived from children. Readonly tasks protect their descendants and touching links. Operations keep the data's shape (start+end stays start+end, date-only stays date-only with day or coarser snapping; hourly edits use datetime strings); start constraints (SNET/MSO) move with the task. Form and cell edits use gantt-core rescheduleOperation, so they keep the same shape rules.",
|
|
35712
|
+
toolbar: "Add task, Outdent, Indent, Undo and Redo appear when editable.",
|
|
35713
|
+
dialog: "GanttTaskDialog (double-click a bar or row, F2, or editTask(id)) edits name, start, finish or duration (linked), progress, manual, constraint + date, deadline, calendar, assignees and predecessors (task, FS/SS/FF/SF, lag). Save validates with model.validate and applies ONE model.apply([...ops]) so one undo reverts it; errors (empty name, bad duration, cycles) show inline. Summaries show derived dates read-only. Delete confirms (AlertDialog) and removes the subtree and its links. Focus returns to the row (nearest row after delete).",
|
|
35714
|
+
cells: "Right Arrow from a row enters its cells; Enter/F2 edits name, start, finish, duration or progress in place (Enter saves, Escape cancels, Tab saves and moves to the next editable cell). Durations accept 3, 3d, 4h, 2w; dates 2026-03-02 (with time at hour zoom). Invalid input keeps the editor open with an error.",
|
|
35715
|
+
contextMenu: "Right-click a row or bar (editable only): Edit task (F2), Add task below (Insert), Indent (Tab), Outdent (Shift+Tab), Delete task (Delete); disabled for read-only tasks. Built on theme-svelte ContextMenu."
|
|
35050
35716
|
}
|
|
35051
35717
|
}
|
|
35052
35718
|
};
|
|
@@ -35104,7 +35770,7 @@ function registerGanttResources(server) {
|
|
|
35104
35770
|
|
|
35105
35771
|
// src/data/maps-catalog.json
|
|
35106
35772
|
var maps_catalog_default = {
|
|
35107
|
-
version: "0.
|
|
35773
|
+
version: "0.5.0",
|
|
35108
35774
|
packageName: "@classic-homes/maps-core",
|
|
35109
35775
|
description: "Core utilities, types, and themes for Classic Theme MapLibre GL components",
|
|
35110
35776
|
subpackages: {
|
|
@@ -40730,7 +41396,7 @@ ${catalog6.quickReference.tailwindConfig}
|
|
|
40730
41396
|
|
|
40731
41397
|
// src/data/native-catalog.json
|
|
40732
41398
|
var native_catalog_default = {
|
|
40733
|
-
version: "0.
|
|
41399
|
+
version: "0.5.0",
|
|
40734
41400
|
packageName: "@classic-homes/native",
|
|
40735
41401
|
description: "Native device APIs for iOS and Android mobile apps. Uses Capacitor for native functionality with web fallbacks.",
|
|
40736
41402
|
subpackages: {
|
|
@@ -42432,6 +43098,372 @@ import { NativeGuard, usePlatformCheck } from '@classic-homes/native/react';
|
|
|
42432
43098
|
}));
|
|
42433
43099
|
}
|
|
42434
43100
|
|
|
43101
|
+
// src/data/viewer-catalog.json
|
|
43102
|
+
var viewer_catalog_default = {
|
|
43103
|
+
version: "0.5.0",
|
|
43104
|
+
packageName: "@classic-homes/viewer-svelte",
|
|
43105
|
+
description: "Client-side, view-only document viewers: PDF, Word (.docx), Excel (.xlsx), CSV/TSV and CAD (DXF; DWG through the separate GPL package). Files are parsed and rendered in the browser; nothing is uploaded or converted on a server. Each format is a lazy-loaded subpath with an optional peer dependency, so apps only bundle what they register. Svelte 5 only; a React package (viewer-react) is planned.",
|
|
43106
|
+
packages: {
|
|
43107
|
+
core: {
|
|
43108
|
+
name: "@classic-homes/viewer-core",
|
|
43109
|
+
license: "MIT",
|
|
43110
|
+
description: "Framework-agnostic utilities. Runtime deps: fflate, numfmt (used by /sheet).",
|
|
43111
|
+
subpaths: {
|
|
43112
|
+
"@classic-homes/viewer-core": "types, detect, source, zoom, search, sanitize and layout together",
|
|
43113
|
+
"@classic-homes/viewer-core/types": "DocumentKind, RenderableKind, ViewerSource, LoadedSource, ViewerError, ZoomMode, KIND_INFO, acceptFor",
|
|
43114
|
+
"@classic-homes/viewer-core/detect": "detectKind(bytes, name?, mime?): magic bytes first, then extension, then MIME; flags encrypted PDF/OOXML",
|
|
43115
|
+
"@classic-homes/viewer-core/source": "loadSource(source, { maxBytes, signal, fetchInit, name, mime }) \u2192 LoadedSource; streaming size cap (default 100 MB)",
|
|
43116
|
+
"@classic-homes/viewer-core/zoom": "zoom ladder, clamp, fitWidth/fitPage, resolveZoom, formatZoom, anchoredScroll",
|
|
43117
|
+
"@classic-homes/viewer-core/search": "findInText, findAll, nextMatch, prevMatch",
|
|
43118
|
+
"@classic-homes/viewer-core/sanitize": "safeHref (http(s)/mailto allow-list) and EXTERNAL_LINK_ATTRS",
|
|
43119
|
+
"@classic-homes/viewer-core/layout": "paged-stack layout and visible-page virtualisation",
|
|
43120
|
+
"@classic-homes/viewer-core/sheet": "read-only XLSX/CSV reader \u2192 plain cloneable Sheet model (openSheetReader, XlsxWorkbook, parseCsv)",
|
|
43121
|
+
"@classic-homes/viewer-core/sheet/worker": "Web Worker entry for the sheet reader",
|
|
43122
|
+
"@classic-homes/viewer-core/zip": "SafeZip: size-checked ZIP reading, repack() for libraries without inflate limits",
|
|
43123
|
+
"@classic-homes/viewer-core/cad": "readDxfHeader (version, code page \u2192 encoding, units, binary flag), dwgVersion, cadRelease, 2-D view math"
|
|
43124
|
+
}
|
|
43125
|
+
},
|
|
43126
|
+
svelte: {
|
|
43127
|
+
name: "@classic-homes/viewer-svelte",
|
|
43128
|
+
license: "MIT",
|
|
43129
|
+
peerDependencies: {
|
|
43130
|
+
svelte: "^5.20.0",
|
|
43131
|
+
"pdfjs-dist": "^6.0.0 (optional, for /pdf)",
|
|
43132
|
+
"docx-preview": ">=0.4.0 <1 (optional, for /docx)",
|
|
43133
|
+
"dxf-viewer": "^1.0.50 (optional, for /cad; brings three.js)"
|
|
43134
|
+
},
|
|
43135
|
+
subpaths: {
|
|
43136
|
+
"@classic-homes/viewer-svelte": "DocumentViewer, ViewerFrame, ViewerToolbar, ViewerState, useFullscreen, createViewerShortcuts, downloadBytes, plus core re-exports (loadSource, detectKind, acceptFor, ViewerError, types)",
|
|
43137
|
+
"@classic-homes/viewer-svelte/pdf": "PdfViewer (default export), configurePdf",
|
|
43138
|
+
"@classic-homes/viewer-svelte/xlsx": "SpreadsheetViewer (default export, xlsx + csv), SheetGrid, configureSpreadsheet",
|
|
43139
|
+
"@classic-homes/viewer-svelte/docx": "DocxViewer (default export)",
|
|
43140
|
+
"@classic-homes/viewer-svelte/cad": "CadViewer (default export), configureCad",
|
|
43141
|
+
"@classic-homes/viewer-svelte/cad/worker": "Web Worker entry for DXF parsing"
|
|
43142
|
+
}
|
|
43143
|
+
},
|
|
43144
|
+
dwg: {
|
|
43145
|
+
name: "@classic-homes/viewer-dwg",
|
|
43146
|
+
license: "GPL-3.0-or-later",
|
|
43147
|
+
licenseNote: "Bundles LibreDWG (GPL). Separate and opt-in: the MIT viewer packages never depend on it. An app that bundles it ships GPL code to users' browsers and must comply with the GPL; get licensing sign-off per app before suggesting it.",
|
|
43148
|
+
dependencies: {
|
|
43149
|
+
"@mlightcad/libredwg-web": "0.8.3 (exact: JS glue and .wasm must match)"
|
|
43150
|
+
},
|
|
43151
|
+
subpaths: {
|
|
43152
|
+
"@classic-homes/viewer-dwg": "configureDwg, dwgToDxf(bytes, { signal }), writeDxf, describeSkipped",
|
|
43153
|
+
"@classic-homes/viewer-dwg/svelte": "DwgViewer (default export)",
|
|
43154
|
+
"@classic-homes/viewer-dwg/worker": "Web Worker entry for conversion",
|
|
43155
|
+
"@classic-homes/viewer-dwg/libredwg-web.wasm": "LibreDWG WebAssembly binary (~11 MB, 2.5 MB gzipped), import with ?url"
|
|
43156
|
+
}
|
|
43157
|
+
}
|
|
43158
|
+
},
|
|
43159
|
+
formats: [
|
|
43160
|
+
{
|
|
43161
|
+
kind: "pdf",
|
|
43162
|
+
label: "PDF",
|
|
43163
|
+
component: "PdfViewer",
|
|
43164
|
+
import: "@classic-homes/viewer-svelte/pdf",
|
|
43165
|
+
peer: "pdfjs-dist@^6",
|
|
43166
|
+
configure: "configurePdf({ workerSrc }) (required); optional cMapUrl, standardFontDataUrl, wasmUrl",
|
|
43167
|
+
features: [
|
|
43168
|
+
"canvas pages with selectable text layer",
|
|
43169
|
+
"find",
|
|
43170
|
+
"internal and web links",
|
|
43171
|
+
"page navigation",
|
|
43172
|
+
"virtualised pages",
|
|
43173
|
+
"Ctrl+wheel/pinch zoom around the pointer",
|
|
43174
|
+
"print",
|
|
43175
|
+
"download"
|
|
43176
|
+
],
|
|
43177
|
+
limits: [
|
|
43178
|
+
"password-protected PDFs get an 'encrypted' state (owner-password-only PDFs open)",
|
|
43179
|
+
"non-embedded CJK/standard fonts need cMapUrl/standardFontDataUrl"
|
|
43180
|
+
]
|
|
43181
|
+
},
|
|
43182
|
+
{
|
|
43183
|
+
kind: "xlsx",
|
|
43184
|
+
label: "Excel workbook",
|
|
43185
|
+
component: "SpreadsheetViewer",
|
|
43186
|
+
import: "@classic-homes/viewer-svelte/xlsx",
|
|
43187
|
+
peer: null,
|
|
43188
|
+
configure: "configureSpreadsheet({ worker?, maxCells? }) (optional)",
|
|
43189
|
+
features: [
|
|
43190
|
+
"number formats",
|
|
43191
|
+
"fonts, fills, borders, alignment, wrapping",
|
|
43192
|
+
"merged cells",
|
|
43193
|
+
"column widths and row heights",
|
|
43194
|
+
"hidden rows/columns",
|
|
43195
|
+
"frozen panes",
|
|
43196
|
+
"hyperlinks incl. to other sheets",
|
|
43197
|
+
"cached formula results; formula in status bar",
|
|
43198
|
+
"sheet tabs",
|
|
43199
|
+
"find",
|
|
43200
|
+
"keyboard cell navigation and copy"
|
|
43201
|
+
],
|
|
43202
|
+
limits: [
|
|
43203
|
+
"no charts, images, conditional formatting, table styles or pivot tables (a note says when present)",
|
|
43204
|
+
"hidden sheets not listed",
|
|
43205
|
+
"sheets cut at maxCells (default 2,000,000)",
|
|
43206
|
+
"no recalculation"
|
|
43207
|
+
]
|
|
43208
|
+
},
|
|
43209
|
+
{
|
|
43210
|
+
kind: "csv",
|
|
43211
|
+
label: "CSV / TSV",
|
|
43212
|
+
component: "SpreadsheetViewer",
|
|
43213
|
+
import: "@classic-homes/viewer-svelte/xlsx",
|
|
43214
|
+
peer: null,
|
|
43215
|
+
configure: "same as xlsx",
|
|
43216
|
+
features: [
|
|
43217
|
+
"delimiter detected from the first lines"
|
|
43218
|
+
],
|
|
43219
|
+
limits: []
|
|
43220
|
+
},
|
|
43221
|
+
{
|
|
43222
|
+
kind: "docx",
|
|
43223
|
+
label: "Word document",
|
|
43224
|
+
component: "DocxViewer",
|
|
43225
|
+
import: "@classic-homes/viewer-svelte/docx",
|
|
43226
|
+
peer: "docx-preview",
|
|
43227
|
+
configure: null,
|
|
43228
|
+
features: [
|
|
43229
|
+
"paged layout",
|
|
43230
|
+
"headers, footers, footnotes, endnotes",
|
|
43231
|
+
"tables, images, lists, embedded fonts",
|
|
43232
|
+
"find",
|
|
43233
|
+
"zoom",
|
|
43234
|
+
"page navigation",
|
|
43235
|
+
"bookmark links scroll in the viewer",
|
|
43236
|
+
"print",
|
|
43237
|
+
"rendered in a shadow root (style isolation)"
|
|
43238
|
+
],
|
|
43239
|
+
limits: [
|
|
43240
|
+
"no tracked changes, comments or embedded HTML (altChunk)",
|
|
43241
|
+
"pages break only at explicit and saved breaks",
|
|
43242
|
+
"fields show last-saved values"
|
|
43243
|
+
]
|
|
43244
|
+
},
|
|
43245
|
+
{
|
|
43246
|
+
kind: "dxf",
|
|
43247
|
+
label: "DXF drawing",
|
|
43248
|
+
component: "CadViewer",
|
|
43249
|
+
import: "@classic-homes/viewer-svelte/cad",
|
|
43250
|
+
peer: "dxf-viewer (brings three.js; needs WebGL)",
|
|
43251
|
+
configure: "configureCad({ worker?, fonts }) (fonts needed for any text: TTF/OTF/WOFF)",
|
|
43252
|
+
features: [
|
|
43253
|
+
"lines, polylines, arcs, circles, ellipses, splines, hatches, solids, text, mtext, dimensions, blocks",
|
|
43254
|
+
"layer panel with filter",
|
|
43255
|
+
"theme/dark/light background with colour correction",
|
|
43256
|
+
"cursor readout in drawing units",
|
|
43257
|
+
"keyboard pan/zoom/fit",
|
|
43258
|
+
"print current view",
|
|
43259
|
+
"pre-2007 code pages"
|
|
43260
|
+
],
|
|
43261
|
+
limits: [
|
|
43262
|
+
"ASCII DXF only (binary DXF unsupported)",
|
|
43263
|
+
"needs WebGL",
|
|
43264
|
+
"model space only"
|
|
43265
|
+
]
|
|
43266
|
+
},
|
|
43267
|
+
{
|
|
43268
|
+
kind: "dwg",
|
|
43269
|
+
label: "DWG drawing",
|
|
43270
|
+
component: "DwgViewer",
|
|
43271
|
+
import: "@classic-homes/viewer-dwg/svelte",
|
|
43272
|
+
peer: "@classic-homes/viewer-dwg (GPL-3.0-or-later) + dxf-viewer",
|
|
43273
|
+
configure: "configureDwg({ worker, wasmUrl }) plus configureCad",
|
|
43274
|
+
features: [
|
|
43275
|
+
"AutoCAD R14 to 2018 converted to DXF in a worker",
|
|
43276
|
+
"everything CadViewer draws",
|
|
43277
|
+
"note naming the release and what is not shown",
|
|
43278
|
+
"download saves the original DWG"
|
|
43279
|
+
],
|
|
43280
|
+
limits: [
|
|
43281
|
+
"no tables, multileaders, multilines, 3D solids/faces, wipeouts, construction lines, images, OLE or proxy objects",
|
|
43282
|
+
"paper space not shown",
|
|
43283
|
+
"very large drawings can exhaust WASM memory ('too-large')",
|
|
43284
|
+
"~2.5 MB gzipped wasm on first use"
|
|
43285
|
+
]
|
|
43286
|
+
}
|
|
43287
|
+
],
|
|
43288
|
+
legacyFormats: {
|
|
43289
|
+
doc: "Detected, not rendered: message suggests saving as .docx",
|
|
43290
|
+
xls: "Detected, not rendered: message suggests saving as .xlsx",
|
|
43291
|
+
dwg: "Without @classic-homes/viewer-dwg registered: message names the AutoCAD release and suggests saving as DXF"
|
|
43292
|
+
},
|
|
43293
|
+
setup: {
|
|
43294
|
+
install: "npm install @classic-homes/viewer-svelte pdfjs-dist docx-preview dxf-viewer (only the peers for formats you show)",
|
|
43295
|
+
hooksClient: "// src/hooks.client.ts\nimport { configurePdf } from '@classic-homes/viewer-svelte/pdf';\nimport pdfWorkerSrc from 'pdfjs-dist/build/pdf.worker.min.mjs?url';\nimport { configureSpreadsheet } from '@classic-homes/viewer-svelte/xlsx';\nimport SheetWorker from '@classic-homes/viewer-core/sheet/worker?worker';\nimport { configureCad } from '@classic-homes/viewer-svelte/cad';\nimport CadWorker from '@classic-homes/viewer-svelte/cad/worker?worker';\n\nconfigurePdf({ workerSrc: pdfWorkerSrc });\nconfigureSpreadsheet({ worker: () => new SheetWorker() });\nconfigureCad({ worker: () => new CadWorker(), fonts: ['/fonts/NotoSans-Regular.ttf'] });",
|
|
43296
|
+
dwgOptIn: "// GPL: only with licensing sign-off\nimport { configureDwg } from '@classic-homes/viewer-dwg';\nimport DwgWorker from '@classic-homes/viewer-dwg/worker?worker';\nimport wasmUrl from '@classic-homes/viewer-dwg/libredwg-web.wasm?url';\nconfigureDwg({ worker: () => new DwgWorker(), wasmUrl });",
|
|
43297
|
+
tailwindContent: "'./node_modules/@classic-homes/viewer-svelte/dist/**/*.{js,svelte}'",
|
|
43298
|
+
example: `<script lang="ts">
|
|
43299
|
+
import { DocumentViewer, acceptFor, type ViewerRegistry } from '@classic-homes/viewer-svelte';
|
|
43300
|
+
|
|
43301
|
+
const viewers: ViewerRegistry = {
|
|
43302
|
+
pdf: () => import('@classic-homes/viewer-svelte/pdf'),
|
|
43303
|
+
docx: () => import('@classic-homes/viewer-svelte/docx'),
|
|
43304
|
+
xlsx: () => import('@classic-homes/viewer-svelte/xlsx'),
|
|
43305
|
+
csv: () => import('@classic-homes/viewer-svelte/xlsx'),
|
|
43306
|
+
dxf: () => import('@classic-homes/viewer-svelte/cad'),
|
|
43307
|
+
};
|
|
43308
|
+
let file = $state<File>();
|
|
43309
|
+
</script>
|
|
43310
|
+
|
|
43311
|
+
<input type="file" accept={acceptFor()} onchange={(e) => (file = e.currentTarget.files?.[0])} />
|
|
43312
|
+
<DocumentViewer source={file} {viewers} class="h-[80vh]" />`,
|
|
43313
|
+
rules: [
|
|
43314
|
+
"Register formats as lazy imports in the viewers registry; never import a format subpath statically into shared code, or every app bundles every peer.",
|
|
43315
|
+
'Give the viewer a height (class="h-[80vh]" or a sized parent).',
|
|
43316
|
+
"Set configure* once at app start on the client (hooks.client.ts), not per component.",
|
|
43317
|
+
"Use acceptFor(Object.keys(viewers)) so the file picker offers exactly what you can show; acceptFor() without arguments leaves out DWG."
|
|
43318
|
+
]
|
|
43319
|
+
},
|
|
43320
|
+
components: {
|
|
43321
|
+
DocumentViewer: {
|
|
43322
|
+
import: "@classic-homes/viewer-svelte",
|
|
43323
|
+
description: "Loads any source, detects the format, lazy-loads the registered viewer, and shows loading/error/unsupported states with a download fallback.",
|
|
43324
|
+
props: {
|
|
43325
|
+
source: "ViewerSource: File | Blob | URL | string (fetched) | ArrayBuffer | ArrayBufferView | { blob, filename?, contentType? } (offline-core file)",
|
|
43326
|
+
viewers: "ViewerRegistry (required): Partial<Record<RenderableKind, () => Promise<{ default: Component }>>>",
|
|
43327
|
+
name: "string: file-name hint",
|
|
43328
|
+
mime: "string: MIME hint",
|
|
43329
|
+
maxBytes: "number, default 104857600 (100 MB)",
|
|
43330
|
+
fetchInit: "RequestInit for URL sources",
|
|
43331
|
+
allowDownload: "boolean, default true",
|
|
43332
|
+
hideToolbar: "boolean, default false",
|
|
43333
|
+
onload: "(info: { kind, name?, size }) => void",
|
|
43334
|
+
onerror: "(error: ViewerError) => void",
|
|
43335
|
+
class: "string"
|
|
43336
|
+
}
|
|
43337
|
+
},
|
|
43338
|
+
PdfViewer: {
|
|
43339
|
+
import: "@classic-homes/viewer-svelte/pdf",
|
|
43340
|
+
props: {
|
|
43341
|
+
source: "LoadedSource (required): { bytes: Uint8Array; name?: string; mime?: string } from loadSource()",
|
|
43342
|
+
kind: "RenderableKind (required)",
|
|
43343
|
+
onready: "() => void: first view on screen",
|
|
43344
|
+
onerror: "(error: ViewerError) => void",
|
|
43345
|
+
hideToolbar: "boolean, default false",
|
|
43346
|
+
class: "string",
|
|
43347
|
+
initialZoom: "ZoomMode = number | 'fit-width' | 'fit-page', default 'fit-width'",
|
|
43348
|
+
initialPage: "number, 1-based, default 1"
|
|
43349
|
+
}
|
|
43350
|
+
},
|
|
43351
|
+
SpreadsheetViewer: {
|
|
43352
|
+
import: "@classic-homes/viewer-svelte/xlsx",
|
|
43353
|
+
props: {
|
|
43354
|
+
source: "LoadedSource (required): { bytes: Uint8Array; name?: string; mime?: string } from loadSource()",
|
|
43355
|
+
kind: "RenderableKind (required)",
|
|
43356
|
+
onready: "() => void: first view on screen",
|
|
43357
|
+
onerror: "(error: ViewerError) => void",
|
|
43358
|
+
hideToolbar: "boolean, default false",
|
|
43359
|
+
class: "string",
|
|
43360
|
+
initialSheet: "string | number: sheet name or 0-based index"
|
|
43361
|
+
}
|
|
43362
|
+
},
|
|
43363
|
+
DocxViewer: {
|
|
43364
|
+
import: "@classic-homes/viewer-svelte/docx",
|
|
43365
|
+
props: {
|
|
43366
|
+
source: "LoadedSource (required): { bytes: Uint8Array; name?: string; mime?: string } from loadSource()",
|
|
43367
|
+
kind: "RenderableKind (required)",
|
|
43368
|
+
onready: "() => void: first view on screen",
|
|
43369
|
+
onerror: "(error: ViewerError) => void",
|
|
43370
|
+
hideToolbar: "boolean, default false",
|
|
43371
|
+
class: "string",
|
|
43372
|
+
initialZoom: "ZoomMode, default 'fit-width' (never above 100%)"
|
|
43373
|
+
}
|
|
43374
|
+
},
|
|
43375
|
+
CadViewer: {
|
|
43376
|
+
import: "@classic-homes/viewer-svelte/cad",
|
|
43377
|
+
props: {
|
|
43378
|
+
source: "LoadedSource (required): { bytes: Uint8Array; name?: string; mime?: string } from loadSource()",
|
|
43379
|
+
kind: "RenderableKind (required)",
|
|
43380
|
+
onready: "() => void: first view on screen",
|
|
43381
|
+
onerror: "(error: ViewerError) => void",
|
|
43382
|
+
hideToolbar: "boolean, default false",
|
|
43383
|
+
class: "string",
|
|
43384
|
+
background: "'theme' | 'dark' | 'light', default 'theme'",
|
|
43385
|
+
showLayers: "boolean, default false",
|
|
43386
|
+
fonts: "string[]: overrides configureCad fonts",
|
|
43387
|
+
downloadSource: "{ bytes, name?, mime? }: what Download saves when source was derived (e.g. converted DWG)",
|
|
43388
|
+
notice: "string: note under the toolbar"
|
|
43389
|
+
}
|
|
43390
|
+
},
|
|
43391
|
+
DwgViewer: {
|
|
43392
|
+
import: "@classic-homes/viewer-dwg/svelte",
|
|
43393
|
+
license: "GPL-3.0-or-later",
|
|
43394
|
+
props: {
|
|
43395
|
+
source: "LoadedSource (required): { bytes: Uint8Array; name?: string; mime?: string } from loadSource()",
|
|
43396
|
+
kind: "RenderableKind (required)",
|
|
43397
|
+
onready: "() => void: first view on screen",
|
|
43398
|
+
onerror: "(error: ViewerError) => void",
|
|
43399
|
+
hideToolbar: "boolean, default false",
|
|
43400
|
+
class: "string",
|
|
43401
|
+
background: "'theme' | 'dark' | 'light', default 'theme'",
|
|
43402
|
+
showLayers: "boolean, default false",
|
|
43403
|
+
fonts: "string[]"
|
|
43404
|
+
}
|
|
43405
|
+
}
|
|
43406
|
+
},
|
|
43407
|
+
errors: {
|
|
43408
|
+
class: "ViewerError (code, message, kind?) from @classic-homes/viewer-core; isViewerError(e) to narrow",
|
|
43409
|
+
codes: {
|
|
43410
|
+
unsupported: "no viewer registered, legacy .doc/.xls, binary DXF, no WebGL, DWG without viewer-dwg",
|
|
43411
|
+
"too-large": "over maxBytes, or a DWG too big for WASM memory",
|
|
43412
|
+
encrypted: "password-protected PDF or Office file",
|
|
43413
|
+
corrupt: "the parser rejected the file",
|
|
43414
|
+
"load-failed": "network/read failure, or a worker or WASM that failed to start",
|
|
43415
|
+
"missing-dependency": "the format's optional peer is not installed",
|
|
43416
|
+
aborted: "loading was cancelled"
|
|
43417
|
+
}
|
|
43418
|
+
},
|
|
43419
|
+
keyboard: {
|
|
43420
|
+
"Ctrl/Cmd + = / -": "zoom in / out",
|
|
43421
|
+
"Ctrl/Cmd + 0": "reset zoom (PDF/Word toggle fit width/page; Excel 100%; CAD fit)",
|
|
43422
|
+
"Ctrl/Cmd + F": "find (PDF, Word, Excel)",
|
|
43423
|
+
"Enter / Shift+Enter": "next / previous match",
|
|
43424
|
+
"PageDown / PageUp, Home / End": "pages (PDF, Word)",
|
|
43425
|
+
"Arrows, + / -, 0": "CAD: pan, zoom, fit while the drawing has focus"
|
|
43426
|
+
},
|
|
43427
|
+
security: [
|
|
43428
|
+
"Office ZIP entries are size-checked before inflation (SafeZip), so small files cannot expand into gigabytes.",
|
|
43429
|
+
"Links from documents pass safeHref: only http(s) and mailto, opened in a new tab with rel=noopener noreferrer nofollow.",
|
|
43430
|
+
"pdf.js runs with isEvalSupported: false.",
|
|
43431
|
+
"docx-preview: altChunk (embedded HTML) disabled, archive repacked through SafeZip, output sanitised in a shadow root.",
|
|
43432
|
+
"DWG conversion runs in a worker inside the WASM heap; a crashed instance is discarded."
|
|
43433
|
+
]
|
|
43434
|
+
};
|
|
43435
|
+
|
|
43436
|
+
// src/resources/viewers.ts
|
|
43437
|
+
var catalog8 = viewer_catalog_default;
|
|
43438
|
+
var json = (uri, value) => ({
|
|
43439
|
+
contents: [{ uri: uri.href, mimeType: "application/json", text: JSON.stringify(value, null, 2) }]
|
|
43440
|
+
});
|
|
43441
|
+
function registerViewerResources(server) {
|
|
43442
|
+
server.resource("Document Viewers", "viewers://all", async (uri) => json(uri, catalog8));
|
|
43443
|
+
server.resource(
|
|
43444
|
+
"Viewer Formats",
|
|
43445
|
+
"viewers://formats",
|
|
43446
|
+
async (uri) => json(uri, {
|
|
43447
|
+
description: "Formats the document viewers show, with the component, import, peer dependency, configuration, features and limits of each",
|
|
43448
|
+
formats: catalog8.formats,
|
|
43449
|
+
legacyFormats: catalog8.legacyFormats
|
|
43450
|
+
})
|
|
43451
|
+
);
|
|
43452
|
+
server.resource(
|
|
43453
|
+
"Viewer Setup",
|
|
43454
|
+
"viewers://setup",
|
|
43455
|
+
async (uri) => json(uri, {
|
|
43456
|
+
description: "How to install and configure the viewers, the DocumentViewer registry, component props, error codes and security notes",
|
|
43457
|
+
packages: catalog8.packages,
|
|
43458
|
+
setup: catalog8.setup,
|
|
43459
|
+
components: catalog8.components,
|
|
43460
|
+
errors: catalog8.errors,
|
|
43461
|
+
keyboard: catalog8.keyboard,
|
|
43462
|
+
security: catalog8.security
|
|
43463
|
+
})
|
|
43464
|
+
);
|
|
43465
|
+
}
|
|
43466
|
+
|
|
42435
43467
|
// src/resources/index.ts
|
|
42436
43468
|
function registerResources(server) {
|
|
42437
43469
|
registerComponentResources(server);
|
|
@@ -42446,12 +43478,13 @@ function registerResources(server) {
|
|
|
42446
43478
|
registerGanttResources(server);
|
|
42447
43479
|
registerMapsResources(server);
|
|
42448
43480
|
registerNativeResources(server);
|
|
43481
|
+
registerViewerResources(server);
|
|
42449
43482
|
}
|
|
42450
43483
|
|
|
42451
43484
|
// src/tools/searchComponents.ts
|
|
42452
43485
|
import { z } from "zod";
|
|
42453
|
-
var
|
|
42454
|
-
var categories = [...new Set(
|
|
43486
|
+
var catalog9 = component_catalog_default;
|
|
43487
|
+
var categories = [...new Set(catalog9.components.map((c) => c.category))].sort();
|
|
42455
43488
|
var SearchComponentsSchema = z.object({
|
|
42456
43489
|
query: z.string().describe("Search query (component name, description, or functionality)"),
|
|
42457
43490
|
category: z.enum(categories).optional().describe("Filter by component category"),
|
|
@@ -42467,7 +43500,7 @@ function registerSearchComponentsTool(server) {
|
|
|
42467
43500
|
const queryLower = query.toLowerCase().trim();
|
|
42468
43501
|
const isListAll = queryLower === "*" || queryLower === "all" || queryLower === "" || queryLower === "list" || queryLower === "list all";
|
|
42469
43502
|
const queryWords = queryLower.split(/\s+/).filter((word) => word.length > 0);
|
|
42470
|
-
const results =
|
|
43503
|
+
const results = catalog9.components.filter((component) => {
|
|
42471
43504
|
if (category && component.category !== category) {
|
|
42472
43505
|
return false;
|
|
42473
43506
|
}
|
|
@@ -42541,7 +43574,7 @@ var mapsComponents = new Set(
|
|
|
42541
43574
|
(name) => name.toLowerCase()
|
|
42542
43575
|
)
|
|
42543
43576
|
);
|
|
42544
|
-
function componentNotFound(
|
|
43577
|
+
function componentNotFound(catalog13, componentName) {
|
|
42545
43578
|
const query = componentName.trim().toLowerCase();
|
|
42546
43579
|
if (mapsComponents.has(query)) {
|
|
42547
43580
|
return {
|
|
@@ -42551,7 +43584,7 @@ function componentNotFound(catalog12, componentName) {
|
|
|
42551
43584
|
};
|
|
42552
43585
|
}
|
|
42553
43586
|
const prefix = query.slice(0, 3);
|
|
42554
|
-
const suggestions = prefix ?
|
|
43587
|
+
const suggestions = prefix ? catalog13.components.filter((c) => c.name.toLowerCase().includes(prefix)).slice(0, 5).map((c) => c.name) : [];
|
|
42555
43588
|
return {
|
|
42556
43589
|
maps: false,
|
|
42557
43590
|
message: `Component "${componentName}" not found`,
|
|
@@ -42561,7 +43594,7 @@ function componentNotFound(catalog12, componentName) {
|
|
|
42561
43594
|
}
|
|
42562
43595
|
|
|
42563
43596
|
// src/tools/getComponentProps.ts
|
|
42564
|
-
var
|
|
43597
|
+
var catalog10 = component_catalog_default;
|
|
42565
43598
|
var GetComponentPropsSchema = z2.object({
|
|
42566
43599
|
componentName: z2.string().trim().min(1).describe('Name of the component (e.g., "Button", "DashboardLayout")'),
|
|
42567
43600
|
includeExamples: z2.boolean().default(true).describe("Whether to include usage examples")
|
|
@@ -42573,11 +43606,11 @@ function registerGetComponentPropsTool(server) {
|
|
|
42573
43606
|
GetComponentPropsSchema.shape,
|
|
42574
43607
|
async (params) => {
|
|
42575
43608
|
const { componentName, includeExamples } = GetComponentPropsSchema.parse(params);
|
|
42576
|
-
const component =
|
|
43609
|
+
const component = catalog10.components.find(
|
|
42577
43610
|
(c) => c.name.toLowerCase() === componentName.toLowerCase()
|
|
42578
43611
|
);
|
|
42579
43612
|
if (!component) {
|
|
42580
|
-
const { message, suggestions, hint } = componentNotFound(
|
|
43613
|
+
const { message, suggestions, hint } = componentNotFound(catalog10, componentName);
|
|
42581
43614
|
return {
|
|
42582
43615
|
content: [
|
|
42583
43616
|
{
|
|
@@ -42698,7 +43731,7 @@ function registerSuggestPatternTool(server) {
|
|
|
42698
43731
|
|
|
42699
43732
|
// src/tools/validateUsage.ts
|
|
42700
43733
|
import { z as z4 } from "zod";
|
|
42701
|
-
var
|
|
43734
|
+
var catalog11 = component_catalog_default;
|
|
42702
43735
|
var ValidateUsageSchema = z4.object({
|
|
42703
43736
|
componentName: z4.string().trim().min(1).describe("Name of the component being used"),
|
|
42704
43737
|
props: z4.record(z4.unknown()).describe("Props being passed to the component"),
|
|
@@ -42723,11 +43756,11 @@ function registerValidateUsageTool(server) {
|
|
|
42723
43756
|
ValidateUsageSchema.shape,
|
|
42724
43757
|
async (params) => {
|
|
42725
43758
|
const { componentName, props, context } = ValidateUsageSchema.parse(params);
|
|
42726
|
-
const component =
|
|
43759
|
+
const component = catalog11.components.find(
|
|
42727
43760
|
(c) => c.name.toLowerCase() === componentName.toLowerCase()
|
|
42728
43761
|
);
|
|
42729
43762
|
if (!component) {
|
|
42730
|
-
const { maps, message, suggestions: suggestions2, hint } = componentNotFound(
|
|
43763
|
+
const { maps, message, suggestions: suggestions2, hint } = componentNotFound(catalog11, componentName);
|
|
42731
43764
|
return {
|
|
42732
43765
|
content: [
|
|
42733
43766
|
{
|
|
@@ -43045,7 +44078,7 @@ Example for ${pageType}Layout:
|
|
|
43045
44078
|
|
|
43046
44079
|
// src/prompts/componentUsage.ts
|
|
43047
44080
|
import { z as z7 } from "zod";
|
|
43048
|
-
var
|
|
44081
|
+
var catalog12 = component_catalog_default;
|
|
43049
44082
|
var ComponentUsageSchema = z7.object({
|
|
43050
44083
|
componentName: z7.string().describe("Name of the component (e.g., Button, Card, Select)"),
|
|
43051
44084
|
variant: z7.string().optional().describe("Desired variant (optional)"),
|
|
@@ -43061,7 +44094,7 @@ function registerComponentUsagePrompt(server) {
|
|
|
43061
44094
|
const componentName = parsed.componentName || "Button";
|
|
43062
44095
|
const variant = parsed.variant || "";
|
|
43063
44096
|
const useCase = parsed.useCase || "";
|
|
43064
|
-
const component =
|
|
44097
|
+
const component = catalog12.components.find(
|
|
43065
44098
|
(c) => c.name.toLowerCase() === componentName.toLowerCase()
|
|
43066
44099
|
);
|
|
43067
44100
|
let componentInfo = "";
|
|
@@ -43083,7 +44116,7 @@ ${component.examples.map((e) => `### ${e.title}
|
|
|
43083
44116
|
${e.code}
|
|
43084
44117
|
\`\`\``).join("\n\n")}`;
|
|
43085
44118
|
} else {
|
|
43086
|
-
componentInfo = `Component "${componentName}" not found in catalog. Available components: ${
|
|
44119
|
+
componentInfo = `Component "${componentName}" not found in catalog. Available components: ${catalog12.components.map((c) => c.name).join(", ")}`;
|
|
43087
44120
|
}
|
|
43088
44121
|
return {
|
|
43089
44122
|
messages: [
|
|
@@ -43121,7 +44154,7 @@ function registerPrompts(server) {
|
|
|
43121
44154
|
// package.json
|
|
43122
44155
|
var package_default = {
|
|
43123
44156
|
name: "@classic-homes/theme-mcp",
|
|
43124
|
-
version: "0.
|
|
44157
|
+
version: "0.5.0",
|
|
43125
44158
|
description: "MCP server for Classic Theme design system - enables AI assistants to understand and correctly use components, tokens, and patterns",
|
|
43126
44159
|
type: "module",
|
|
43127
44160
|
main: "dist/index.js",
|
|
@@ -43220,4 +44253,4 @@ function createServer() {
|
|
|
43220
44253
|
export {
|
|
43221
44254
|
createServer
|
|
43222
44255
|
};
|
|
43223
|
-
//# sourceMappingURL=chunk-
|
|
44256
|
+
//# sourceMappingURL=chunk-754LGBEJ.js.map
|