@classic-homes/theme-mcp 0.4.0 → 0.5.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.
@@ -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.4.0",
9
+ version: "0.5.1",
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",
@@ -4477,6 +4590,90 @@ var component_catalog_default = {
4477
4590
  ],
4478
4591
  relatedComponents: []
4479
4592
  },
4593
+ {
4594
+ name: "Collapsible",
4595
+ description: "Show and hide a region from a trigger button",
4596
+ category: "layout",
4597
+ importPath: "@classic-homes/theme-svelte",
4598
+ props: [
4599
+ {
4600
+ name: "open",
4601
+ type: "boolean",
4602
+ default: "false",
4603
+ required: false,
4604
+ description: "Whether the content is shown (bindable)"
4605
+ },
4606
+ {
4607
+ name: "onOpenChange",
4608
+ type: "(open: boolean) => void",
4609
+ required: false,
4610
+ description: "Called when the state changes"
4611
+ },
4612
+ {
4613
+ name: "disabled",
4614
+ type: "boolean",
4615
+ default: "false",
4616
+ required: false,
4617
+ description: "Disables the trigger"
4618
+ },
4619
+ {
4620
+ name: "label",
4621
+ type: "string",
4622
+ required: false,
4623
+ description: "Trigger text (ignored with `trigger`)"
4624
+ },
4625
+ {
4626
+ name: "trigger",
4627
+ type: "Snippet<[{ open }]>",
4628
+ required: false,
4629
+ description: "Custom trigger content"
4630
+ },
4631
+ {
4632
+ name: "chevron",
4633
+ type: "boolean",
4634
+ default: "true",
4635
+ required: false,
4636
+ description: "Show the rotating chevron"
4637
+ },
4638
+ {
4639
+ name: "class",
4640
+ type: "string",
4641
+ required: false,
4642
+ description: "Classes for the root"
4643
+ },
4644
+ {
4645
+ name: "triggerClass",
4646
+ type: "string",
4647
+ required: false,
4648
+ description: "Classes for the trigger button"
4649
+ },
4650
+ {
4651
+ name: "contentClass",
4652
+ type: "string",
4653
+ required: false,
4654
+ description: "Classes for the content region"
4655
+ }
4656
+ ],
4657
+ variants: [],
4658
+ slots: [
4659
+ {
4660
+ name: "children",
4661
+ description: "Main content",
4662
+ required: false
4663
+ }
4664
+ ],
4665
+ events: [],
4666
+ examples: [
4667
+ {
4668
+ title: "Basic Usage",
4669
+ code: '<Collapsible label="Show details">\n <p class="pt-2 text-sm text-muted-foreground">Details go here.</p>\n</Collapsible>'
4670
+ }
4671
+ ],
4672
+ relatedComponents: [
4673
+ "Tabs",
4674
+ "Sheet"
4675
+ ]
4676
+ },
4480
4677
  {
4481
4678
  name: "Combobox",
4482
4679
  description: "Searchable select with async loading support",
@@ -4510,6 +4707,12 @@ var component_catalog_default = {
4510
4707
  required: false,
4511
4708
  description: "Message when no options match"
4512
4709
  },
4710
+ {
4711
+ name: "maxResults",
4712
+ type: "number",
4713
+ required: false,
4714
+ description: "Render at most this many matches, with a note to type to narrow the rest. Filtering still searches every option"
4715
+ },
4513
4716
  {
4514
4717
  name: "disabled",
4515
4718
  type: "boolean",
@@ -4992,6 +5195,191 @@ var component_catalog_default = {
4992
5195
  "AreaChart"
4993
5196
  ]
4994
5197
  },
5198
+ {
5199
+ name: "ContextMenu",
5200
+ description: "Right-click (or long-press) menu for an area, with the same items as DropdownMenu",
5201
+ category: "core",
5202
+ importPath: "@classic-homes/theme-svelte",
5203
+ props: [
5204
+ {
5205
+ name: "items",
5206
+ type: "(DropdownMenuItem | DropdownMenuGroup)[]",
5207
+ required: true,
5208
+ description: "Menu items, the same shape as DropdownMenu's"
5209
+ },
5210
+ {
5211
+ name: "children",
5212
+ type: "Snippet",
5213
+ required: true,
5214
+ description: "The area that opens the menu on right-click (or long-press)"
5215
+ },
5216
+ {
5217
+ name: "open",
5218
+ type: "boolean",
5219
+ default: "false",
5220
+ required: false,
5221
+ description: "Whether the menu is open (bindable)"
5222
+ },
5223
+ {
5224
+ name: "onOpenChange",
5225
+ type: "(open: boolean) => void",
5226
+ required: false,
5227
+ description: "Called when the menu opens or closes"
5228
+ },
5229
+ {
5230
+ name: "disabled",
5231
+ type: "boolean",
5232
+ default: "false",
5233
+ required: false,
5234
+ description: "Leave the browser's own menu in place"
5235
+ },
5236
+ {
5237
+ name: "triggerClass",
5238
+ type: "string",
5239
+ required: false,
5240
+ description: "Classes for the trigger area"
5241
+ },
5242
+ {
5243
+ name: "class",
5244
+ type: "string",
5245
+ required: false,
5246
+ description: "Classes for the menu"
5247
+ },
5248
+ {
5249
+ name: "onCloseAutoFocus",
5250
+ type: "(event: Event) => void",
5251
+ required: false,
5252
+ description: "As the menu closes; `preventDefault()` keeps focus where a chosen item put it (e.g. in a dialog it opened)"
5253
+ }
5254
+ ],
5255
+ variants: [],
5256
+ slots: [
5257
+ {
5258
+ name: "children",
5259
+ description: "Main content",
5260
+ required: false
5261
+ }
5262
+ ],
5263
+ events: [],
5264
+ examples: [
5265
+ {
5266
+ title: "Basic Usage",
5267
+ code: `<script>
5268
+ const items = [
5269
+ { label: 'Rename', icon: 'edit', shortcut: 'F2', onSelect: rename },
5270
+ { label: 'Duplicate', onSelect: duplicate },
5271
+ { type: 'separator' },
5272
+ { label: 'Delete', icon: 'trash', destructive: true, onSelect: remove },
5273
+ ];
5274
+ </script>
5275
+
5276
+ <ContextMenu {items} triggerClass="block rounded-md border border-dashed p-8">
5277
+ Right-click here
5278
+ </ContextMenu>`
5279
+ }
5280
+ ],
5281
+ relatedComponents: []
5282
+ },
5283
+ {
5284
+ name: "CopyButton",
5285
+ description: "Copy text to the clipboard with confirmation",
5286
+ category: "core",
5287
+ importPath: "@classic-homes/theme-svelte",
5288
+ props: [
5289
+ {
5290
+ name: "value",
5291
+ type: "string | () => string | Promise<string>",
5292
+ required: true,
5293
+ description: "Text to copy, or a function read on click"
5294
+ },
5295
+ {
5296
+ name: "label",
5297
+ type: "string",
5298
+ default: "'Copy'",
5299
+ required: false,
5300
+ description: "Accessible name and tooltip before copying"
5301
+ },
5302
+ {
5303
+ name: "copiedLabel",
5304
+ type: "string",
5305
+ default: "'Copied'",
5306
+ required: false,
5307
+ description: "Name, tooltip and announcement after copying"
5308
+ },
5309
+ {
5310
+ name: "timeout",
5311
+ type: "number",
5312
+ default: "2000",
5313
+ required: false,
5314
+ description: "How long the copied state lasts (ms)"
5315
+ },
5316
+ {
5317
+ name: "variant",
5318
+ type: "Button variant",
5319
+ default: "'ghost'",
5320
+ required: false,
5321
+ description: "Button variant"
5322
+ },
5323
+ {
5324
+ name: "size",
5325
+ type: "Button size",
5326
+ default: "'icon'",
5327
+ required: false,
5328
+ description: "Button size (`'sm'` when children are given)"
5329
+ },
5330
+ {
5331
+ name: "tooltip",
5332
+ type: "boolean",
5333
+ default: "true",
5334
+ required: false,
5335
+ description: "Tooltip on the icon-only button"
5336
+ },
5337
+ {
5338
+ name: "disabled",
5339
+ type: "boolean",
5340
+ default: "false",
5341
+ required: false,
5342
+ description: "Disables the button"
5343
+ },
5344
+ {
5345
+ name: "oncopy",
5346
+ type: "(text: string) => void",
5347
+ required: false,
5348
+ description: "Called after a successful write"
5349
+ },
5350
+ {
5351
+ name: "onerror",
5352
+ type: "(error: unknown) => void",
5353
+ required: false,
5354
+ description: "Called when the clipboard is unavailable"
5355
+ },
5356
+ {
5357
+ name: "class",
5358
+ type: "string",
5359
+ required: false,
5360
+ description: "Additional classes"
5361
+ }
5362
+ ],
5363
+ variants: [],
5364
+ slots: [
5365
+ {
5366
+ name: "children",
5367
+ description: "Main content",
5368
+ required: false
5369
+ }
5370
+ ],
5371
+ events: [],
5372
+ examples: [
5373
+ {
5374
+ title: "Basic Usage",
5375
+ code: '<CopyButton value="npm install @classic-homes/theme-svelte" />'
5376
+ }
5377
+ ],
5378
+ relatedComponents: [
5379
+ "Button",
5380
+ "Tooltip"
5381
+ ]
5382
+ },
4995
5383
  {
4996
5384
  name: "DashboardLayout",
4997
5385
  description: "Complete dashboard layout with responsive sidebar and header",
@@ -7295,6 +7683,12 @@ var component_catalog_default = {
7295
7683
  required: false,
7296
7684
  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
7685
  },
7686
+ {
7687
+ name: "onOpenAutoFocus",
7688
+ type: "(event: Event) => void",
7689
+ required: false,
7690
+ 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."
7691
+ },
7298
7692
  {
7299
7693
  name: "dirty",
7300
7694
  type: "boolean",
@@ -7352,6 +7746,187 @@ var component_catalog_default = {
7352
7746
  "DropdownMenu"
7353
7747
  ]
7354
7748
  },
7749
+ {
7750
+ name: "DocumentViewer",
7751
+ description: "Show PDF, Word, Excel, CSV and CAD files in the browser, with format detection and lazy-loaded viewers",
7752
+ category: "viewer",
7753
+ importPath: "@classic-homes/viewer-svelte",
7754
+ props: [
7755
+ {
7756
+ name: "source",
7757
+ type: "ViewerSource",
7758
+ required: false,
7759
+ description: "File, Blob, URL, bytes or offline-core stored file. Changing it loads the new one"
7760
+ },
7761
+ {
7762
+ name: "viewers",
7763
+ type: "ViewerRegistry",
7764
+ required: true,
7765
+ description: "Viewers to use, as lazy imports keyed by format"
7766
+ },
7767
+ {
7768
+ name: "name",
7769
+ type: "string",
7770
+ required: false,
7771
+ description: "File name hint (extension fallback, download name) when the source has none"
7772
+ },
7773
+ {
7774
+ name: "mime",
7775
+ type: "string",
7776
+ required: false,
7777
+ description: "MIME type hint when the source has none"
7778
+ },
7779
+ {
7780
+ name: "maxBytes",
7781
+ type: "number",
7782
+ default: "104857600",
7783
+ required: false,
7784
+ description: 'Size cap in bytes (100 MB); larger files get a "too large" state'
7785
+ },
7786
+ {
7787
+ name: "fetchInit",
7788
+ type: "RequestInit",
7789
+ required: false,
7790
+ description: "`fetch` options for URL sources (credentials, auth headers)"
7791
+ },
7792
+ {
7793
+ name: "allowDownload",
7794
+ type: "boolean",
7795
+ default: "true",
7796
+ required: false,
7797
+ description: 'Offer "Download file" when a file cannot be shown'
7798
+ },
7799
+ {
7800
+ name: "hideToolbar",
7801
+ type: "boolean",
7802
+ default: "false",
7803
+ required: false,
7804
+ description: "Hide the viewer toolbar"
7805
+ },
7806
+ {
7807
+ name: "onload",
7808
+ type: "(info: DocumentLoadInfo) => void",
7809
+ required: false,
7810
+ description: "The document is on screen: `{ kind, name, size }`"
7811
+ },
7812
+ {
7813
+ name: "onerror",
7814
+ type: "(error: ViewerError) => void",
7815
+ required: false,
7816
+ description: "Loading or rendering failed"
7817
+ },
7818
+ {
7819
+ name: "class",
7820
+ type: "string",
7821
+ required: false,
7822
+ description: "Classes for the outer element; give it a height"
7823
+ }
7824
+ ],
7825
+ variants: [],
7826
+ slots: [],
7827
+ events: [],
7828
+ examples: [
7829
+ {
7830
+ title: "Basic Usage",
7831
+ code: `<script lang="ts">
7832
+ import { DocumentViewer, acceptFor, type ViewerRegistry } from '@classic-homes/viewer-svelte';
7833
+
7834
+ // Each entry is a lazy import: formats you leave out are never bundled
7835
+ const viewers: ViewerRegistry = {
7836
+ pdf: () => import('@classic-homes/viewer-svelte/pdf'),
7837
+ docx: () => import('@classic-homes/viewer-svelte/docx'),
7838
+ xlsx: () => import('@classic-homes/viewer-svelte/xlsx'),
7839
+ csv: () => import('@classic-homes/viewer-svelte/xlsx'),
7840
+ dxf: () => import('@classic-homes/viewer-svelte/cad'),
7841
+ };
7842
+
7843
+ let file = $state<File>();
7844
+ </script>
7845
+
7846
+ <input type="file" accept={acceptFor()} onchange={(e) => (file = e.currentTarget.files?.[0])} />
7847
+ <DocumentViewer source={file} {viewers} class="h-[80vh]" />`
7848
+ }
7849
+ ],
7850
+ relatedComponents: [
7851
+ "PdfViewer",
7852
+ "SpreadsheetViewer",
7853
+ "DocxViewer",
7854
+ "CadViewer",
7855
+ "DwgViewer"
7856
+ ]
7857
+ },
7858
+ {
7859
+ name: "DocxViewer",
7860
+ description: "Word documents laid out as pages with docx-preview, isolated in a shadow root and sanitised",
7861
+ category: "viewer",
7862
+ importPath: "@classic-homes/viewer-svelte/docx",
7863
+ props: [
7864
+ {
7865
+ name: "source",
7866
+ type: "LoadedSource",
7867
+ required: true,
7868
+ description: "Loaded bytes plus name and MIME hints"
7869
+ },
7870
+ {
7871
+ name: "kind",
7872
+ type: "RenderableKind",
7873
+ required: true,
7874
+ description: "`'docx'`"
7875
+ },
7876
+ {
7877
+ name: "initialZoom",
7878
+ type: "ZoomMode",
7879
+ default: "'fit-width'",
7880
+ required: false,
7881
+ description: "`'fit-width'` (never above 100%), `'fit-page'` or a scale"
7882
+ },
7883
+ {
7884
+ name: "hideToolbar",
7885
+ type: "boolean",
7886
+ default: "false",
7887
+ required: false,
7888
+ description: "Hide the toolbar"
7889
+ },
7890
+ {
7891
+ name: "onready",
7892
+ type: "() => void",
7893
+ required: false,
7894
+ description: "The document is on screen"
7895
+ },
7896
+ {
7897
+ name: "onerror",
7898
+ type: "(error: ViewerError) => void",
7899
+ required: false,
7900
+ description: "The document could not be read"
7901
+ },
7902
+ {
7903
+ name: "class",
7904
+ type: "string",
7905
+ required: false,
7906
+ description: "Classes for the outer element"
7907
+ }
7908
+ ],
7909
+ variants: [],
7910
+ slots: [],
7911
+ events: [],
7912
+ examples: [
7913
+ {
7914
+ title: "Basic Usage",
7915
+ code: `<script lang="ts">
7916
+ import { loadSource } from '@classic-homes/viewer-svelte';
7917
+ import { DocxViewer } from '@classic-homes/viewer-svelte/docx';
7918
+ </script>
7919
+
7920
+ {#await loadSource('/specs/lot-12.docx') then source}
7921
+ <DocxViewer {source} kind="docx" class="h-[80vh]" />
7922
+ {/await}`
7923
+ }
7924
+ ],
7925
+ relatedComponents: [
7926
+ "DocumentViewer",
7927
+ "PdfViewer"
7928
+ ]
7929
+ },
7355
7930
  {
7356
7931
  name: "DonutChart",
7357
7932
  description: "Pie chart variant with center labels for key metrics",
@@ -8193,6 +8768,185 @@ var component_catalog_default = {
8193
8768
  "Tooltip"
8194
8769
  ]
8195
8770
  },
8771
+ {
8772
+ name: "DwgViewer",
8773
+ description: "AutoCAD DWG drawings converted to DXF in the browser with LibreDWG (WebAssembly), then shown in the CAD viewer",
8774
+ category: "viewer",
8775
+ importPath: "@classic-homes/viewer-dwg/svelte",
8776
+ props: [
8777
+ {
8778
+ name: "source",
8779
+ type: "LoadedSource",
8780
+ required: true,
8781
+ description: "Loaded DWG bytes plus name and MIME hints"
8782
+ },
8783
+ {
8784
+ name: "kind",
8785
+ type: "RenderableKind",
8786
+ required: true,
8787
+ description: "`'dwg'`"
8788
+ },
8789
+ {
8790
+ name: "background",
8791
+ type: "'theme' | 'dark' | 'light'",
8792
+ default: "'theme'",
8793
+ required: false,
8794
+ description: "Canvas background"
8795
+ },
8796
+ {
8797
+ name: "showLayers",
8798
+ type: "boolean",
8799
+ default: "false",
8800
+ required: false,
8801
+ description: "Open the layer panel on load"
8802
+ },
8803
+ {
8804
+ name: "fonts",
8805
+ type: "string[]",
8806
+ required: false,
8807
+ description: "Font URLs, instead of the ones from `configureCad`"
8808
+ },
8809
+ {
8810
+ name: "hideToolbar",
8811
+ type: "boolean",
8812
+ default: "false",
8813
+ required: false,
8814
+ description: "Hide the toolbar"
8815
+ },
8816
+ {
8817
+ name: "onready",
8818
+ type: "() => void",
8819
+ required: false,
8820
+ description: "The converted drawing is on screen"
8821
+ },
8822
+ {
8823
+ name: "onerror",
8824
+ type: "(error: ViewerError) => void",
8825
+ required: false,
8826
+ description: "Conversion or rendering failed"
8827
+ },
8828
+ {
8829
+ name: "class",
8830
+ type: "string",
8831
+ required: false,
8832
+ description: "Classes for the outer element"
8833
+ }
8834
+ ],
8835
+ variants: [
8836
+ {
8837
+ name: "background",
8838
+ values: [
8839
+ "theme",
8840
+ "dark",
8841
+ "light"
8842
+ ],
8843
+ default: "theme"
8844
+ }
8845
+ ],
8846
+ slots: [],
8847
+ events: [],
8848
+ examples: [],
8849
+ relatedComponents: [
8850
+ "CadViewer",
8851
+ "DocumentViewer"
8852
+ ]
8853
+ },
8854
+ {
8855
+ name: "EmptyState",
8856
+ description: "Placeholder for a view with nothing to show yet",
8857
+ category: "feedback",
8858
+ importPath: "@classic-homes/theme-svelte",
8859
+ props: [
8860
+ {
8861
+ name: "title",
8862
+ type: "string",
8863
+ required: true,
8864
+ description: "Title"
8865
+ },
8866
+ {
8867
+ name: "description",
8868
+ type: "string",
8869
+ required: false,
8870
+ description: "Supporting text"
8871
+ },
8872
+ {
8873
+ name: "icon",
8874
+ type: "IconName",
8875
+ required: false,
8876
+ description: "Icon in a muted circle"
8877
+ },
8878
+ {
8879
+ name: "size",
8880
+ type: "'sm' | 'md'",
8881
+ default: "'md'",
8882
+ required: false,
8883
+ description: "`sm` for panels and lists, `md` for pages"
8884
+ },
8885
+ {
8886
+ name: "headingLevel",
8887
+ type: "'h2' | 'h3' | 'h4' | 'p'",
8888
+ default: "'h3'",
8889
+ required: false,
8890
+ description: "Element used for the title"
8891
+ },
8892
+ {
8893
+ name: "actions",
8894
+ type: "Snippet",
8895
+ required: false,
8896
+ description: "Buttons or links under the text"
8897
+ },
8898
+ {
8899
+ name: "children",
8900
+ type: "Snippet",
8901
+ required: false,
8902
+ description: "Extra content before the actions"
8903
+ },
8904
+ {
8905
+ name: "class",
8906
+ type: "string",
8907
+ required: false,
8908
+ description: "Additional classes"
8909
+ }
8910
+ ],
8911
+ variants: [
8912
+ {
8913
+ name: "size",
8914
+ values: [
8915
+ "sm",
8916
+ "md"
8917
+ ],
8918
+ default: "md"
8919
+ },
8920
+ {
8921
+ name: "headingLevel",
8922
+ values: [
8923
+ "h2",
8924
+ "h3",
8925
+ "h4",
8926
+ "p"
8927
+ ],
8928
+ default: "h3"
8929
+ }
8930
+ ],
8931
+ slots: [
8932
+ {
8933
+ name: "children",
8934
+ description: "Main content",
8935
+ required: false
8936
+ }
8937
+ ],
8938
+ events: [],
8939
+ examples: [
8940
+ {
8941
+ title: "Basic Usage",
8942
+ code: '<EmptyState\n icon="inbox"\n title="No messages yet"\n description="Messages you receive will appear here."\n/>'
8943
+ }
8944
+ ],
8945
+ relatedComponents: [
8946
+ "LoadingSection",
8947
+ "Alert"
8948
+ ]
8949
+ },
8196
8950
  {
8197
8951
  name: "ErrorLayout",
8198
8952
  description: "Layout for error pages with status codes and messaging",
@@ -9680,6 +10434,20 @@ var component_catalog_default = {
9680
10434
  required: false,
9681
10435
  description: "Task list width in px (bindable; users can drag the divider)"
9682
10436
  },
10437
+ {
10438
+ name: "columnWidths",
10439
+ type: "Record<string, number>",
10440
+ default: "{}",
10441
+ required: false,
10442
+ description: "Column width overrides by column id (bindable). Dragging a column edge records it here"
10443
+ },
10444
+ {
10445
+ name: "resizableColumns",
10446
+ type: "boolean",
10447
+ default: "true",
10448
+ required: false,
10449
+ description: "Drag handles on column headers; each is also a focusable separator (Left/Right, Shift for bigger steps)"
10450
+ },
9683
10451
  {
9684
10452
  name: "rowHeight",
9685
10453
  type: "number",
@@ -9705,7 +10473,7 @@ var component_catalog_default = {
9705
10473
  type: "boolean",
9706
10474
  default: "true",
9707
10475
  required: false,
9708
- description: "Zoom, today, expand/collapse, critical path, baseline and CSV controls"
10476
+ description: "Zoom, today, expand/collapse, critical path, baseline and export controls"
9709
10477
  },
9710
10478
  {
9711
10479
  name: "showCritical",
@@ -9754,7 +10522,7 @@ var component_catalog_default = {
9754
10522
  type: "boolean",
9755
10523
  default: "true",
9756
10524
  required: false,
9757
- description: "CSV export button"
10525
+ description: "Export menu: CSV table, JSON project, PNG image of the current view"
9758
10526
  },
9759
10527
  {
9760
10528
  name: "loading",
@@ -9805,7 +10573,7 @@ var component_catalog_default = {
9805
10573
  name: "ontaskdblclick",
9806
10574
  type: "(task: GanttTask, scheduled: ScheduledTask, event: MouseEvent) => void",
9807
10575
  required: false,
9808
- description: "Bar double-click"
10576
+ description: "Bar or row double-click. When `editable` the task dialog opens too, unless you call `event.preventDefault()`"
9809
10577
  },
9810
10578
  {
9811
10579
  name: "onselectionchange",
@@ -9818,7 +10586,7 @@ var component_catalog_default = {
9818
10586
  type: "boolean",
9819
10587
  default: "false",
9820
10588
  required: false,
9821
- description: "Drag to move, resize, set progress and link; Alt+Arrow keys; undo/redo"
10589
+ description: "Drag, link and nudge bars; task dialog; in-place cell edits; add, indent and outdent tasks; undo/redo"
9822
10590
  },
9823
10591
  {
9824
10592
  name: "onchange",
@@ -11762,6 +12530,66 @@ var component_catalog_default = {
11762
12530
  "SortableList"
11763
12531
  ]
11764
12532
  },
12533
+ {
12534
+ name: "Kbd",
12535
+ description: "Keyboard key or shortcut",
12536
+ category: "core",
12537
+ importPath: "@classic-homes/theme-svelte",
12538
+ props: [
12539
+ {
12540
+ name: "keys",
12541
+ type: "string[]",
12542
+ required: false,
12543
+ description: "Keys of a combination"
12544
+ },
12545
+ {
12546
+ name: "size",
12547
+ type: "'sm' | 'md'",
12548
+ default: "'sm'",
12549
+ required: false,
12550
+ description: "Key size"
12551
+ },
12552
+ {
12553
+ name: "children",
12554
+ type: "Snippet",
12555
+ required: false,
12556
+ description: "A single key (when `keys` is unset)"
12557
+ },
12558
+ {
12559
+ name: "class",
12560
+ type: "string",
12561
+ required: false,
12562
+ description: "Additional classes"
12563
+ }
12564
+ ],
12565
+ variants: [
12566
+ {
12567
+ name: "size",
12568
+ values: [
12569
+ "sm",
12570
+ "md"
12571
+ ],
12572
+ default: "sm"
12573
+ }
12574
+ ],
12575
+ slots: [
12576
+ {
12577
+ name: "children",
12578
+ description: "Main content",
12579
+ required: false
12580
+ }
12581
+ ],
12582
+ events: [],
12583
+ examples: [
12584
+ {
12585
+ title: "Basic Usage",
12586
+ code: "<Kbd keys={['Mod', 'K']} />\n<Kbd>Esc</Kbd>"
12587
+ }
12588
+ ],
12589
+ relatedComponents: [
12590
+ "DropdownMenu"
12591
+ ]
12592
+ },
11765
12593
  {
11766
12594
  name: "Label",
11767
12595
  description: "Accessible label component for form inputs",
@@ -14812,6 +15640,85 @@ var component_catalog_default = {
14812
15640
  "Separator"
14813
15641
  ]
14814
15642
  },
15643
+ {
15644
+ name: "PdfViewer",
15645
+ description: "PDF pages rendered with pdf.js, with selectable text, find, links, zoom and page navigation",
15646
+ category: "viewer",
15647
+ importPath: "@classic-homes/viewer-svelte/pdf",
15648
+ props: [
15649
+ {
15650
+ name: "source",
15651
+ type: "LoadedSource",
15652
+ required: true,
15653
+ description: "Loaded bytes plus name and MIME hints (`loadSource`)"
15654
+ },
15655
+ {
15656
+ name: "kind",
15657
+ type: "RenderableKind",
15658
+ required: true,
15659
+ description: "`'pdf'`"
15660
+ },
15661
+ {
15662
+ name: "initialZoom",
15663
+ type: "ZoomMode",
15664
+ default: "'fit-width'",
15665
+ required: false,
15666
+ description: "`'fit-width'`, `'fit-page'` or a scale such as `1.5`"
15667
+ },
15668
+ {
15669
+ name: "initialPage",
15670
+ type: "number",
15671
+ default: "1",
15672
+ required: false,
15673
+ description: "1-based page to open at"
15674
+ },
15675
+ {
15676
+ name: "hideToolbar",
15677
+ type: "boolean",
15678
+ default: "false",
15679
+ required: false,
15680
+ description: "Hide the toolbar"
15681
+ },
15682
+ {
15683
+ name: "onready",
15684
+ type: "() => void",
15685
+ required: false,
15686
+ description: "The first page is on screen"
15687
+ },
15688
+ {
15689
+ name: "onerror",
15690
+ type: "(error: ViewerError) => void",
15691
+ required: false,
15692
+ description: "Parsing or rendering failed"
15693
+ },
15694
+ {
15695
+ name: "class",
15696
+ type: "string",
15697
+ required: false,
15698
+ description: "Classes for the outer element"
15699
+ }
15700
+ ],
15701
+ variants: [],
15702
+ slots: [],
15703
+ events: [],
15704
+ examples: [
15705
+ {
15706
+ title: "Basic Usage",
15707
+ code: `<script lang="ts">
15708
+ import { loadSource } from '@classic-homes/viewer-svelte';
15709
+ import { PdfViewer } from '@classic-homes/viewer-svelte/pdf';
15710
+ </script>
15711
+
15712
+ {#await loadSource('/plans/lot-12.pdf') then source}
15713
+ <PdfViewer {source} kind="pdf" initialZoom="fit-page" class="h-[80vh]" />
15714
+ {/await}`
15715
+ }
15716
+ ],
15717
+ relatedComponents: [
15718
+ "DocumentViewer",
15719
+ "DocxViewer"
15720
+ ]
15721
+ },
14815
15722
  {
14816
15723
  name: "PieChart",
14817
15724
  description: "Show proportional data with interactive labels",
@@ -15120,6 +16027,125 @@ var component_catalog_default = {
15120
16027
  "FunnelChart"
15121
16028
  ]
15122
16029
  },
16030
+ {
16031
+ name: "Popover",
16032
+ description: "Floating content anchored to a trigger or element",
16033
+ category: "core",
16034
+ importPath: "@classic-homes/theme-svelte",
16035
+ props: [
16036
+ {
16037
+ name: "open",
16038
+ type: "boolean",
16039
+ default: "false",
16040
+ required: false,
16041
+ description: "Whether it is shown (bindable)"
16042
+ },
16043
+ {
16044
+ name: "onOpenChange",
16045
+ type: "(open: boolean) => void",
16046
+ required: false,
16047
+ description: "Called when the state changes"
16048
+ },
16049
+ {
16050
+ name: "side",
16051
+ type: "'top' | 'right' | 'bottom' | 'left'",
16052
+ default: "'bottom'",
16053
+ required: false,
16054
+ description: "Preferred side"
16055
+ },
16056
+ {
16057
+ name: "align",
16058
+ type: "'start' | 'center' | 'end'",
16059
+ default: "'center'",
16060
+ required: false,
16061
+ description: "Alignment against the anchor"
16062
+ },
16063
+ {
16064
+ name: "sideOffset",
16065
+ type: "number",
16066
+ default: "6",
16067
+ required: false,
16068
+ description: "Gap to the anchor (px)"
16069
+ },
16070
+ {
16071
+ name: "anchor",
16072
+ type: "HTMLElement | string | null",
16073
+ required: false,
16074
+ description: "Position against this instead of the trigger"
16075
+ },
16076
+ {
16077
+ name: "autoFocus",
16078
+ type: "boolean",
16079
+ default: "true",
16080
+ required: false,
16081
+ description: "Move focus into the content on open"
16082
+ },
16083
+ {
16084
+ name: "trapFocus",
16085
+ type: "boolean",
16086
+ default: "false",
16087
+ required: false,
16088
+ description: "Keep Tab inside the content"
16089
+ },
16090
+ {
16091
+ name: "aria-label",
16092
+ type: "string",
16093
+ required: false,
16094
+ description: "Name for content without a visible heading"
16095
+ },
16096
+ {
16097
+ name: "trigger",
16098
+ type: "Snippet<[{ props }]>",
16099
+ required: false,
16100
+ description: "Trigger; spread `props` on your element"
16101
+ },
16102
+ {
16103
+ name: "class",
16104
+ type: "string",
16105
+ required: false,
16106
+ description: "Classes for the content"
16107
+ }
16108
+ ],
16109
+ variants: [
16110
+ {
16111
+ name: "side",
16112
+ values: [
16113
+ "top",
16114
+ "right",
16115
+ "bottom",
16116
+ "left"
16117
+ ],
16118
+ default: "bottom"
16119
+ },
16120
+ {
16121
+ name: "align",
16122
+ values: [
16123
+ "start",
16124
+ "center",
16125
+ "end"
16126
+ ],
16127
+ default: "center"
16128
+ }
16129
+ ],
16130
+ slots: [
16131
+ {
16132
+ name: "children",
16133
+ description: "Main content",
16134
+ required: false
16135
+ }
16136
+ ],
16137
+ events: [],
16138
+ examples: [
16139
+ {
16140
+ title: "Basic Usage",
16141
+ code: '<Popover>\n {#snippet trigger({ props })}\n <Button {...props} variant="outline">Filters</Button>\n {/snippet}\n <p>Popover content</p>\n</Popover>'
16142
+ }
16143
+ ],
16144
+ relatedComponents: [
16145
+ "Tooltip",
16146
+ "DropdownMenu"
16147
+ ]
16148
+ },
15123
16149
  {
15124
16150
  name: "ProgressBar",
15125
16151
  description: "Determinate and indeterminate progress indicator bar",
@@ -16036,6 +17062,126 @@ var component_catalog_default = {
16036
17062
  "Switch"
16037
17063
  ]
16038
17064
  },
17065
+ {
17066
+ name: "ResizablePanes",
17067
+ description: "Two panes split by a draggable, keyboard-accessible handle",
17068
+ category: "layout",
17069
+ importPath: "@classic-homes/theme-svelte",
17070
+ props: [
17071
+ {
17072
+ name: "size",
17073
+ type: "number",
17074
+ default: "50",
17075
+ required: false,
17076
+ description: "Start pane share in % (bindable)"
17077
+ },
17078
+ {
17079
+ name: "min",
17080
+ type: "number",
17081
+ default: "20",
17082
+ required: false,
17083
+ description: "Smallest start share in %"
17084
+ },
17085
+ {
17086
+ name: "max",
17087
+ type: "number",
17088
+ default: "80",
17089
+ required: false,
17090
+ description: "Largest start share in %"
17091
+ },
17092
+ {
17093
+ name: "step",
17094
+ type: "number",
17095
+ default: "5",
17096
+ required: false,
17097
+ description: "Keyboard step in %"
17098
+ },
17099
+ {
17100
+ name: "orientation",
17101
+ type: "'horizontal' | 'vertical'",
17102
+ default: "'horizontal'",
17103
+ required: false,
17104
+ description: "Side by side or stacked"
17105
+ },
17106
+ {
17107
+ name: "persistKey",
17108
+ type: "string",
17109
+ required: false,
17110
+ description: "Remember the size in localStorage"
17111
+ },
17112
+ {
17113
+ name: "handleLabel",
17114
+ type: "string",
17115
+ default: "'Resize panes'",
17116
+ required: false,
17117
+ description: "Accessible name for the handle"
17118
+ },
17119
+ {
17120
+ name: "onResize",
17121
+ type: "(size: number) => void",
17122
+ required: false,
17123
+ description: "Called as the size changes"
17124
+ },
17125
+ {
17126
+ name: "start",
17127
+ type: "Snippet",
17128
+ required: true,
17129
+ description: "First pane"
17130
+ },
17131
+ {
17132
+ name: "end",
17133
+ type: "Snippet",
17134
+ required: true,
17135
+ description: "Second pane"
17136
+ },
17137
+ {
17138
+ name: "class",
17139
+ type: "string",
17140
+ required: false,
17141
+ description: "Classes for the container"
17142
+ },
17143
+ {
17144
+ name: "startClass",
17145
+ type: "string",
17146
+ required: false,
17147
+ description: "Classes for the start pane"
17148
+ },
17149
+ {
17150
+ name: "endClass",
17151
+ type: "string",
17152
+ required: false,
17153
+ description: "Classes for the end pane"
17154
+ }
17155
+ ],
17156
+ variants: [
17157
+ {
17158
+ name: "orientation",
17159
+ values: [
17160
+ "horizontal",
17161
+ "vertical"
17162
+ ],
17163
+ default: "horizontal"
17164
+ }
17165
+ ],
17166
+ slots: [
17167
+ {
17168
+ name: "children",
17169
+ description: "Main content",
17170
+ required: false
17171
+ }
17172
+ ],
17173
+ events: [],
17174
+ examples: [
17175
+ {
17176
+ title: "Basic Usage",
17177
+ code: '<div class="h-96">\n <ResizablePanes size={60} min={30} max={80} persistKey="chat-artifacts">\n {#snippet start()}<Chat />{/snippet}\n {#snippet end()}<ArtifactPanel />{/snippet}\n </ResizablePanes>\n</div>'
17178
+ }
17179
+ ],
17180
+ relatedComponents: [
17181
+ "DataPanel",
17182
+ "Sheet"
17183
+ ]
17184
+ },
16039
17185
  {
16040
17186
  name: "SankeyChart",
16041
17187
  description: "Flow relationships between entities",
@@ -16893,6 +18039,12 @@ var component_catalog_default = {
16893
18039
  default: "false",
16894
18040
  required: false,
16895
18041
  description: "Type to narrow: `true` always, a number once there are that many options"
18042
+ },
18043
+ {
18044
+ name: "maxResults",
18045
+ type: "number",
18046
+ required: false,
18047
+ description: "With `searchable`: render at most this many matches (see Combobox)"
16896
18048
  }
16897
18049
  ],
16898
18050
  variants: [],
@@ -18890,6 +20042,76 @@ var component_catalog_default = {
18890
20042
  "Button"
18891
20043
  ]
18892
20044
  },
20045
+ {
20046
+ name: "SpreadsheetViewer",
20047
+ description: "Excel and CSV files as a read-only grid with number formats, styles, merged cells, frozen panes and sheet tabs",
20048
+ category: "viewer",
20049
+ importPath: "@classic-homes/viewer-svelte/xlsx",
20050
+ props: [
20051
+ {
20052
+ name: "source",
20053
+ type: "LoadedSource",
20054
+ required: true,
20055
+ description: "Loaded bytes plus name and MIME hints"
20056
+ },
20057
+ {
20058
+ name: "kind",
20059
+ type: "RenderableKind",
20060
+ required: true,
20061
+ description: "`'xlsx'` or `'csv'`"
20062
+ },
20063
+ {
20064
+ name: "initialSheet",
20065
+ type: "string | number",
20066
+ required: false,
20067
+ description: "Name or 0-based index of the sheet to open; default first visible"
20068
+ },
20069
+ {
20070
+ name: "hideToolbar",
20071
+ type: "boolean",
20072
+ default: "false",
20073
+ required: false,
20074
+ description: "Hide the toolbar"
20075
+ },
20076
+ {
20077
+ name: "onready",
20078
+ type: "() => void",
20079
+ required: false,
20080
+ description: "The first sheet is on screen"
20081
+ },
20082
+ {
20083
+ name: "onerror",
20084
+ type: "(error: ViewerError) => void",
20085
+ required: false,
20086
+ description: "Parsing failed"
20087
+ },
20088
+ {
20089
+ name: "class",
20090
+ type: "string",
20091
+ required: false,
20092
+ description: "Classes for the outer element"
20093
+ }
20094
+ ],
20095
+ variants: [],
20096
+ slots: [],
20097
+ events: [],
20098
+ examples: [
20099
+ {
20100
+ title: "Basic Usage",
20101
+ code: `<script lang="ts">
20102
+ import { loadSource } from '@classic-homes/viewer-svelte';
20103
+ import { SpreadsheetViewer } from '@classic-homes/viewer-svelte/xlsx';
20104
+ </script>
20105
+
20106
+ {#await loadSource('/budgets/lot-12.xlsx') then source}
20107
+ <SpreadsheetViewer {source} kind="xlsx" initialSheet="Summary" class="h-[70vh]" />
20108
+ {/await}`
20109
+ }
20110
+ ],
20111
+ relatedComponents: [
20112
+ "DocumentViewer"
20113
+ ]
20114
+ },
18893
20115
  {
18894
20116
  name: "StatCard",
18895
20117
  description: "A headline metric with its change against a previous value and an optional trend",
@@ -19749,6 +20971,26 @@ var component_catalog_default = {
19749
20971
  type: "(value: string) => void",
19750
20972
  required: false,
19751
20973
  description: "Callback when value changes"
20974
+ },
20975
+ {
20976
+ name: "autosize",
20977
+ type: "boolean",
20978
+ default: "false",
20979
+ required: false,
20980
+ description: "Grow with the content (no handle)"
20981
+ },
20982
+ {
20983
+ name: "maxRows",
20984
+ type: "number",
20985
+ default: "8",
20986
+ required: false,
20987
+ description: "Rows before `autosize` scrolls"
20988
+ },
20989
+ {
20990
+ name: "ref",
20991
+ type: "HTMLTextAreaElement",
20992
+ required: false,
20993
+ description: "The element (bindable)"
19752
20994
  }
19753
20995
  ],
19754
20996
  variants: [],
@@ -21117,7 +22359,7 @@ function registerComponentResources(server) {
21117
22359
 
21118
22360
  // src/data/token-definitions.json
21119
22361
  var token_definitions_default = {
21120
- version: "0.4.0",
22362
+ version: "0.5.1",
21121
22363
  colors: {
21122
22364
  brand: [
21123
22365
  {
@@ -22100,7 +23342,7 @@ function registerTokenResources(server) {
22100
23342
 
22101
23343
  // src/data/styles-catalog.json
22102
23344
  var styles_catalog_default = {
22103
- version: "0.4.0",
23345
+ version: "0.5.1",
22104
23346
  package: "@classic-homes/theme-styles",
22105
23347
  description: "Base CSS styles, accessibility features, and utility classes for the Classic Theme design system",
22106
23348
  integration: {
@@ -22483,7 +23725,7 @@ import { ResourceTemplate as ResourceTemplate2 } from "@modelcontextprotocol/sdk
22483
23725
 
22484
23726
  // src/data/pattern-library.json
22485
23727
  var pattern_library_default = {
22486
- version: "0.4.0",
23728
+ version: "0.5.1",
22487
23729
  layouts: [
22488
23730
  {
22489
23731
  id: "dashboard-page",
@@ -23577,7 +24819,7 @@ function registerLayoutResources(server) {
23577
24819
 
23578
24820
  // src/data/schema-catalog.json
23579
24821
  var schema_catalog_default = {
23580
- version: "0.4.0",
24822
+ version: "0.5.1",
23581
24823
  packageName: "@classic-homes/theme-svelte",
23582
24824
  importPath: "@classic-homes/theme-svelte",
23583
24825
  generatedFrom: "packages/svelte/src/lib/schemas/index.ts",
@@ -24385,7 +25627,7 @@ import { ResourceTemplate as ResourceTemplate3 } from "@modelcontextprotocol/sdk
24385
25627
 
24386
25628
  // src/data/auth-catalog.json
24387
25629
  var auth_catalog_default = {
24388
- version: "0.4.0",
25630
+ version: "0.5.1",
24389
25631
  packageName: "@classic-homes/auth",
24390
25632
  description: "Authentication services and Svelte bindings for Classic Theme apps",
24391
25633
  subpackages: {
@@ -27422,7 +28664,7 @@ import { ResourceTemplate as ResourceTemplate4 } from "@modelcontextprotocol/sdk
27422
28664
 
27423
28665
  // src/data/notifications-catalog.json
27424
28666
  var notifications_catalog_default = {
27425
- version: "0.4.0",
28667
+ version: "0.5.1",
27426
28668
  packageName: "@classic-homes/notifications",
27427
28669
  description: "Notification services and Svelte bindings for Classic Theme apps",
27428
28670
  subpackages: {
@@ -28334,7 +29576,7 @@ function registerNotificationsResources(server) {
28334
29576
 
28335
29577
  // src/data/docs-catalog.json
28336
29578
  var docs_catalog_default = {
28337
- version: "0.4.0",
29579
+ version: "0.5.1",
28338
29580
  packageName: "@classic-homes/theme-docs",
28339
29581
  description: "Markdown documentation components for the Classic theme system",
28340
29582
  exports: {
@@ -30006,7 +31248,7 @@ function registerDocsResources(server) {
30006
31248
 
30007
31249
  // src/data/charts-catalog.json
30008
31250
  var charts_catalog_default = {
30009
- version: "0.4.0",
31251
+ version: "0.5.1",
30010
31252
  packageName: "@classic-homes/charts-core",
30011
31253
  description: "Core utilities, types, and themes for Classic Theme chart components",
30012
31254
  subpackages: {
@@ -34144,7 +35386,7 @@ interface SankeyData {
34144
35386
 
34145
35387
  // src/data/gantt-catalog.json
34146
35388
  var gantt_catalog_default = {
34147
- version: "0.4.0",
35389
+ version: "0.5.1",
34148
35390
  packageName: "@classic-homes/gantt-core",
34149
35391
  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
35392
  packages: {
@@ -34319,7 +35561,7 @@ var gantt_catalog_default = {
34319
35561
  name: "readonly",
34320
35562
  type: "boolean",
34321
35563
  required: false,
34322
- description: "Blocks every edit of this task in the UI"
35564
+ description: "Blocks edits to this task and its descendants, including touching dependencies"
34323
35565
  },
34324
35566
  {
34325
35567
  name: "meta",
@@ -34606,7 +35848,7 @@ var gantt_catalog_default = {
34606
35848
  "{ type: 'update-task'; id: string; patch: Partial<Omit<GanttTask, 'id'>> }",
34607
35849
  "{ type: 'add-task'; task: GanttTask; index?: number }",
34608
35850
  "{ type: 'remove-task'; id: string }",
34609
- "{ type: 'add-dependency'; dependency: GanttDependency }",
35851
+ "{ type: 'add-dependency'; dependency: GanttDependency; index?: number }",
34610
35852
  "{ type: 'update-dependency'; id: string; patch: Partial<Omit<GanttDependency, 'id'>> }",
34611
35853
  "{ type: 'remove-dependency'; id: string }"
34612
35854
  ]
@@ -34630,7 +35872,7 @@ var gantt_catalog_default = {
34630
35872
  name: "operations",
34631
35873
  type: "GanttOperation[]",
34632
35874
  required: true,
34633
- description: "Operations applied to the input data, in order"
35875
+ description: "Edit descriptions in order; persist task/dependency snapshots for exact undo restoration"
34634
35876
  },
34635
35877
  {
34636
35878
  name: "dates",
@@ -34781,7 +36023,7 @@ var gantt_catalog_default = {
34781
36023
  name: "historyLimit",
34782
36024
  type: "number",
34783
36025
  required: false,
34784
- description: "Maximum undo steps (default 100)"
36026
+ description: "Maximum undo steps (default 100); 0 disables history"
34785
36027
  }
34786
36028
  ],
34787
36029
  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 +36192,7 @@ var gantt_catalog_default = {
34950
36192
  {
34951
36193
  name: "shiftTask / editOperation",
34952
36194
  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)"
36195
+ 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
36196
  },
34955
36197
  {
34956
36198
  name: "unitsForDelta / progressAt",
@@ -34961,6 +36203,21 @@ var gantt_catalog_default = {
34961
36203
  name: "linkOperation / dependencyTypeFor / createId",
34962
36204
  signature: "linkOperation(from, to, type?, extra?) => GanttOperation; dependencyTypeFor(fromSide, toSide) => DependencyType",
34963
36205
  description: "Building add-dependency operations from bar-end drags"
36206
+ },
36207
+ {
36208
+ name: "rescheduleDates / rescheduleOperation",
36209
+ signature: "(ctx: EditContext, edit: { start?, finish?, duration? }) => EditPreview / UpdateTaskOperation | null",
36210
+ 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"
36211
+ },
36212
+ {
36213
+ name: "predecessorOperations / parseDuration",
36214
+ signature: "predecessorOperations(taskId, dependencies, drafts: PredecessorDraft[]) => GanttOperation[]; parseDuration(text, minutesPerDay?) => number | undefined",
36215
+ description: "Diff a task's incoming links into remove/update/add ops; read '3', '3d', '4h', '2w' as working days"
36216
+ },
36217
+ {
36218
+ name: "indentOperation / outdentOperations / insertTaskOperation",
36219
+ signature: "indentOperation(tasks, id) => UpdateTaskOperation | null; outdentOperations(tasks, id) => UpdateTaskOperation[]; insertTaskOperation(tasks, afterId, task) => GanttOperation",
36220
+ description: "Outline edits: indent under the sibling above; outdent after the old parent, adopting later siblings; insert after a task's subtree"
34964
36221
  }
34965
36222
  ],
34966
36223
  a11y: [
@@ -34989,7 +36246,7 @@ var gantt_catalog_default = {
34989
36246
  {
34990
36247
  name: "exportProject",
34991
36248
  signature: "(tasks, dependencies, calendars?, schedule?) => GanttProjectData",
34992
- description: "Serialisable { version: 1, tasks, dependencies, calendars? }, with resolved dates written back when a schedule is given"
36249
+ 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
36250
  },
34994
36251
  {
34995
36252
  name: "importProject",
@@ -35010,11 +36267,11 @@ var gantt_catalog_default = {
35010
36267
  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
36268
  keyProps: {
35012
36269
  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",
36270
+ view: "zoom (bindable), zoomLevels, columns, gridWidth (bindable), columnWidths (bindable Record<id, px>), resizableColumns (default true), rowHeight, height, collapsed",
36271
+ toggles: "showToolbar, showCritical (bindable), showBaseline (bindable), showDependencies, showToday, showLabels, showProgress, exportable (Export menu: CSV, JSON, PNG of the current view)",
35015
36272
  states: "loading, error, onRetry, emptyMessage",
35016
36273
  locale: "locale, weekStartsOn",
35017
- events: "ontaskclick(task, scheduled, event), ontaskdblclick(task, scheduled, event), onselectionchange(ids)",
36274
+ events: "ontaskclick(task, scheduled, event), ontaskdblclick(task, scheduled, event) (bar or row; opens the task dialog when editable unless event.preventDefault()), onselectionchange(ids)",
35018
36275
  other: "toolbarActions (Snippet), class",
35019
36276
  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
36277
  },
@@ -35023,9 +36280,14 @@ var gantt_catalog_default = {
35023
36280
  scrollToTask: "(id: string) => Promise<void>: expands ancestors, selects and focuses the row, scrolls its bar into view",
35024
36281
  scrollToDate: "(date, align?: 'start' | 'center') => Promise<void>",
35025
36282
  getModel: "() => GanttModel (undo/redo, previews, direct edits)",
35026
- getSchedule: "() => ScheduleResult"
35027
- },
35028
- 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.",
36283
+ getSchedule: "() => ScheduleResult",
36284
+ editTask: "(id: string) => boolean: opens the task dialog when editable; false for read-only tasks",
36285
+ 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",
36286
+ "indentTask / outdentTask": "(id: string) => boolean: Tab / Shift+Tab; outdent adopts the siblings below as subtasks",
36287
+ 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",
36288
+ deleteTask: "(id: string) => boolean: confirmation (AlertDialog), then removes the subtree and its links as one undo step; false for read-only tasks"
36289
+ },
36290
+ 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
36291
  example: `<script>
35030
36292
  import { Gantt } from '@classic-homes/gantt-svelte';
35031
36293
 
@@ -35041,12 +36303,15 @@ var gantt_catalog_default = {
35041
36303
  </script>
35042
36304
 
35043
36305
  <Gantt {tasks} {dependencies} title="Launch plan" showCritical />`,
35044
- status: "Svelte only. Editing covers drag move/resize/progress, drag-to-link, keyboard nudges and undo/redo; a task edit dialog and inline grid editing are planned, as is @classic-homes/gantt-react.",
36306
+ 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
36307
  editing: {
35046
36308
  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. Summaries (derived from children) and tasks with readonly: true are not editable. Operations keep the data's shape (start+end stays start+end, date-only stays date-only); start constraints (SNET/MSO) move with the task.",
35049
- toolbar: "Undo and Redo buttons appear when editable."
36309
+ 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.",
36310
+ 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.",
36311
+ toolbar: "Add task, Outdent, Indent, Undo and Redo appear when editable.",
36312
+ 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).",
36313
+ 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.",
36314
+ 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
36315
  }
35051
36316
  }
35052
36317
  };
@@ -35104,7 +36369,7 @@ function registerGanttResources(server) {
35104
36369
 
35105
36370
  // src/data/maps-catalog.json
35106
36371
  var maps_catalog_default = {
35107
- version: "0.4.0",
36372
+ version: "0.5.1",
35108
36373
  packageName: "@classic-homes/maps-core",
35109
36374
  description: "Core utilities, types, and themes for Classic Theme MapLibre GL components",
35110
36375
  subpackages: {
@@ -40730,7 +41995,7 @@ ${catalog6.quickReference.tailwindConfig}
40730
41995
 
40731
41996
  // src/data/native-catalog.json
40732
41997
  var native_catalog_default = {
40733
- version: "0.4.0",
41998
+ version: "0.5.1",
40734
41999
  packageName: "@classic-homes/native",
40735
42000
  description: "Native device APIs for iOS and Android mobile apps. Uses Capacitor for native functionality with web fallbacks.",
40736
42001
  subpackages: {
@@ -42432,6 +43697,372 @@ import { NativeGuard, usePlatformCheck } from '@classic-homes/native/react';
42432
43697
  }));
42433
43698
  }
42434
43699
 
43700
+ // src/data/viewer-catalog.json
43701
+ var viewer_catalog_default = {
43702
+ version: "0.5.1",
43703
+ packageName: "@classic-homes/viewer-svelte",
43704
+ 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.",
43705
+ packages: {
43706
+ core: {
43707
+ name: "@classic-homes/viewer-core",
43708
+ license: "MIT",
43709
+ description: "Framework-agnostic utilities. Runtime deps: fflate, numfmt (used by /sheet).",
43710
+ subpaths: {
43711
+ "@classic-homes/viewer-core": "types, detect, source, zoom, search, sanitize and layout together",
43712
+ "@classic-homes/viewer-core/types": "DocumentKind, RenderableKind, ViewerSource, LoadedSource, ViewerError, ZoomMode, KIND_INFO, acceptFor",
43713
+ "@classic-homes/viewer-core/detect": "detectKind(bytes, name?, mime?): magic bytes first, then extension, then MIME; flags encrypted PDF/OOXML",
43714
+ "@classic-homes/viewer-core/source": "loadSource(source, { maxBytes, signal, fetchInit, name, mime }) \u2192 LoadedSource; streaming size cap (default 100 MB)",
43715
+ "@classic-homes/viewer-core/zoom": "zoom ladder, clamp, fitWidth/fitPage, resolveZoom, formatZoom, anchoredScroll",
43716
+ "@classic-homes/viewer-core/search": "findInText, findAll, nextMatch, prevMatch",
43717
+ "@classic-homes/viewer-core/sanitize": "safeHref (http(s)/mailto allow-list) and EXTERNAL_LINK_ATTRS",
43718
+ "@classic-homes/viewer-core/layout": "paged-stack layout and visible-page virtualisation",
43719
+ "@classic-homes/viewer-core/sheet": "read-only XLSX/CSV reader \u2192 plain cloneable Sheet model (openSheetReader, XlsxWorkbook, parseCsv)",
43720
+ "@classic-homes/viewer-core/sheet/worker": "Web Worker entry for the sheet reader",
43721
+ "@classic-homes/viewer-core/zip": "SafeZip: size-checked ZIP reading, repack() for libraries without inflate limits",
43722
+ "@classic-homes/viewer-core/cad": "readDxfHeader (version, code page \u2192 encoding, units, binary flag), dwgVersion, cadRelease, 2-D view math"
43723
+ }
43724
+ },
43725
+ svelte: {
43726
+ name: "@classic-homes/viewer-svelte",
43727
+ license: "MIT",
43728
+ peerDependencies: {
43729
+ svelte: "^5.20.0",
43730
+ "pdfjs-dist": "^6.0.0 (optional, for /pdf)",
43731
+ "docx-preview": ">=0.4.0 <1 (optional, for /docx)",
43732
+ "dxf-viewer": "^1.0.50 (optional, for /cad; brings three.js)"
43733
+ },
43734
+ subpaths: {
43735
+ "@classic-homes/viewer-svelte": "DocumentViewer, ViewerFrame, ViewerToolbar, ViewerState, useFullscreen, createViewerShortcuts, downloadBytes, plus core re-exports (loadSource, detectKind, acceptFor, ViewerError, types)",
43736
+ "@classic-homes/viewer-svelte/pdf": "PdfViewer (default export), configurePdf",
43737
+ "@classic-homes/viewer-svelte/xlsx": "SpreadsheetViewer (default export, xlsx + csv), SheetGrid, configureSpreadsheet",
43738
+ "@classic-homes/viewer-svelte/docx": "DocxViewer (default export)",
43739
+ "@classic-homes/viewer-svelte/cad": "CadViewer (default export), configureCad",
43740
+ "@classic-homes/viewer-svelte/cad/worker": "Web Worker entry for DXF parsing"
43741
+ }
43742
+ },
43743
+ dwg: {
43744
+ name: "@classic-homes/viewer-dwg",
43745
+ license: "GPL-3.0-or-later",
43746
+ 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.",
43747
+ dependencies: {
43748
+ "@mlightcad/libredwg-web": "0.8.3 (exact: JS glue and .wasm must match)"
43749
+ },
43750
+ subpaths: {
43751
+ "@classic-homes/viewer-dwg": "configureDwg, dwgToDxf(bytes, { signal }), writeDxf, describeSkipped",
43752
+ "@classic-homes/viewer-dwg/svelte": "DwgViewer (default export)",
43753
+ "@classic-homes/viewer-dwg/worker": "Web Worker entry for conversion",
43754
+ "@classic-homes/viewer-dwg/libredwg-web.wasm": "LibreDWG WebAssembly binary (~11 MB, 2.5 MB gzipped), import with ?url"
43755
+ }
43756
+ }
43757
+ },
43758
+ formats: [
43759
+ {
43760
+ kind: "pdf",
43761
+ label: "PDF",
43762
+ component: "PdfViewer",
43763
+ import: "@classic-homes/viewer-svelte/pdf",
43764
+ peer: "pdfjs-dist@^6",
43765
+ configure: "configurePdf({ workerSrc }) (required); optional cMapUrl, standardFontDataUrl, wasmUrl",
43766
+ features: [
43767
+ "canvas pages with selectable text layer",
43768
+ "find",
43769
+ "internal and web links",
43770
+ "page navigation",
43771
+ "virtualised pages",
43772
+ "Ctrl+wheel/pinch zoom around the pointer",
43773
+ "print",
43774
+ "download"
43775
+ ],
43776
+ limits: [
43777
+ "password-protected PDFs get an 'encrypted' state (owner-password-only PDFs open)",
43778
+ "non-embedded CJK/standard fonts need cMapUrl/standardFontDataUrl"
43779
+ ]
43780
+ },
43781
+ {
43782
+ kind: "xlsx",
43783
+ label: "Excel workbook",
43784
+ component: "SpreadsheetViewer",
43785
+ import: "@classic-homes/viewer-svelte/xlsx",
43786
+ peer: null,
43787
+ configure: "configureSpreadsheet({ worker?, maxCells? }) (optional)",
43788
+ features: [
43789
+ "number formats",
43790
+ "fonts, fills, borders, alignment, wrapping",
43791
+ "merged cells",
43792
+ "column widths and row heights",
43793
+ "hidden rows/columns",
43794
+ "frozen panes",
43795
+ "hyperlinks incl. to other sheets",
43796
+ "cached formula results; formula in status bar",
43797
+ "sheet tabs",
43798
+ "find",
43799
+ "keyboard cell navigation and copy"
43800
+ ],
43801
+ limits: [
43802
+ "no charts, images, conditional formatting, table styles or pivot tables (a note says when present)",
43803
+ "hidden sheets not listed",
43804
+ "sheets cut at maxCells (default 2,000,000)",
43805
+ "no recalculation"
43806
+ ]
43807
+ },
43808
+ {
43809
+ kind: "csv",
43810
+ label: "CSV / TSV",
43811
+ component: "SpreadsheetViewer",
43812
+ import: "@classic-homes/viewer-svelte/xlsx",
43813
+ peer: null,
43814
+ configure: "same as xlsx",
43815
+ features: [
43816
+ "delimiter detected from the first lines"
43817
+ ],
43818
+ limits: []
43819
+ },
43820
+ {
43821
+ kind: "docx",
43822
+ label: "Word document",
43823
+ component: "DocxViewer",
43824
+ import: "@classic-homes/viewer-svelte/docx",
43825
+ peer: "docx-preview",
43826
+ configure: null,
43827
+ features: [
43828
+ "paged layout",
43829
+ "headers, footers, footnotes, endnotes",
43830
+ "tables, images, lists, embedded fonts",
43831
+ "find",
43832
+ "zoom",
43833
+ "page navigation",
43834
+ "bookmark links scroll in the viewer",
43835
+ "print",
43836
+ "rendered in a shadow root (style isolation)"
43837
+ ],
43838
+ limits: [
43839
+ "no tracked changes, comments or embedded HTML (altChunk)",
43840
+ "pages break only at explicit and saved breaks",
43841
+ "fields show last-saved values"
43842
+ ]
43843
+ },
43844
+ {
43845
+ kind: "dxf",
43846
+ label: "DXF drawing",
43847
+ component: "CadViewer",
43848
+ import: "@classic-homes/viewer-svelte/cad",
43849
+ peer: "dxf-viewer (brings three.js; needs WebGL)",
43850
+ configure: "configureCad({ worker?, fonts }) (fonts needed for any text: TTF/OTF/WOFF)",
43851
+ features: [
43852
+ "lines, polylines, arcs, circles, ellipses, splines, hatches, solids, text, mtext, dimensions, blocks",
43853
+ "layer panel with filter",
43854
+ "theme/dark/light background with colour correction",
43855
+ "cursor readout in drawing units",
43856
+ "keyboard pan/zoom/fit",
43857
+ "print current view",
43858
+ "pre-2007 code pages"
43859
+ ],
43860
+ limits: [
43861
+ "ASCII DXF only (binary DXF unsupported)",
43862
+ "needs WebGL",
43863
+ "model space only"
43864
+ ]
43865
+ },
43866
+ {
43867
+ kind: "dwg",
43868
+ label: "DWG drawing",
43869
+ component: "DwgViewer",
43870
+ import: "@classic-homes/viewer-dwg/svelte",
43871
+ peer: "@classic-homes/viewer-dwg (GPL-3.0-or-later) + dxf-viewer",
43872
+ configure: "configureDwg({ worker, wasmUrl }) plus configureCad",
43873
+ features: [
43874
+ "AutoCAD R14 to 2018 converted to DXF in a worker",
43875
+ "everything CadViewer draws",
43876
+ "note naming the release and what is not shown",
43877
+ "download saves the original DWG"
43878
+ ],
43879
+ limits: [
43880
+ "no tables, multileaders, multilines, 3D solids/faces, wipeouts, construction lines, images, OLE or proxy objects",
43881
+ "paper space not shown",
43882
+ "very large drawings can exhaust WASM memory ('too-large')",
43883
+ "~2.5 MB gzipped wasm on first use"
43884
+ ]
43885
+ }
43886
+ ],
43887
+ legacyFormats: {
43888
+ doc: "Detected, not rendered: message suggests saving as .docx",
43889
+ xls: "Detected, not rendered: message suggests saving as .xlsx",
43890
+ dwg: "Without @classic-homes/viewer-dwg registered: message names the AutoCAD release and suggests saving as DXF"
43891
+ },
43892
+ setup: {
43893
+ install: "npm install @classic-homes/viewer-svelte pdfjs-dist docx-preview dxf-viewer (only the peers for formats you show)",
43894
+ 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'] });",
43895
+ 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 });",
43896
+ tailwindContent: "'./node_modules/@classic-homes/viewer-svelte/dist/**/*.{js,svelte}'",
43897
+ example: `<script lang="ts">
43898
+ import { DocumentViewer, acceptFor, type ViewerRegistry } from '@classic-homes/viewer-svelte';
43899
+
43900
+ const viewers: ViewerRegistry = {
43901
+ pdf: () => import('@classic-homes/viewer-svelte/pdf'),
43902
+ docx: () => import('@classic-homes/viewer-svelte/docx'),
43903
+ xlsx: () => import('@classic-homes/viewer-svelte/xlsx'),
43904
+ csv: () => import('@classic-homes/viewer-svelte/xlsx'),
43905
+ dxf: () => import('@classic-homes/viewer-svelte/cad'),
43906
+ };
43907
+ let file = $state<File>();
43908
+ </script>
43909
+
43910
+ <input type="file" accept={acceptFor()} onchange={(e) => (file = e.currentTarget.files?.[0])} />
43911
+ <DocumentViewer source={file} {viewers} class="h-[80vh]" />`,
43912
+ rules: [
43913
+ "Register formats as lazy imports in the viewers registry; never import a format subpath statically into shared code, or every app bundles every peer.",
43914
+ 'Give the viewer a height (class="h-[80vh]" or a sized parent).',
43915
+ "Set configure* once at app start on the client (hooks.client.ts), not per component.",
43916
+ "Use acceptFor(Object.keys(viewers)) so the file picker offers exactly what you can show; acceptFor() without arguments leaves out DWG."
43917
+ ]
43918
+ },
43919
+ components: {
43920
+ DocumentViewer: {
43921
+ import: "@classic-homes/viewer-svelte",
43922
+ description: "Loads any source, detects the format, lazy-loads the registered viewer, and shows loading/error/unsupported states with a download fallback.",
43923
+ props: {
43924
+ source: "ViewerSource: File | Blob | URL | string (fetched) | ArrayBuffer | ArrayBufferView | { blob, filename?, contentType? } (offline-core file)",
43925
+ viewers: "ViewerRegistry (required): Partial<Record<RenderableKind, () => Promise<{ default: Component }>>>",
43926
+ name: "string: file-name hint",
43927
+ mime: "string: MIME hint",
43928
+ maxBytes: "number, default 104857600 (100 MB)",
43929
+ fetchInit: "RequestInit for URL sources",
43930
+ allowDownload: "boolean, default true",
43931
+ hideToolbar: "boolean, default false",
43932
+ onload: "(info: { kind, name?, size }) => void",
43933
+ onerror: "(error: ViewerError) => void",
43934
+ class: "string"
43935
+ }
43936
+ },
43937
+ PdfViewer: {
43938
+ import: "@classic-homes/viewer-svelte/pdf",
43939
+ props: {
43940
+ source: "LoadedSource (required): { bytes: Uint8Array; name?: string; mime?: string } from loadSource()",
43941
+ kind: "RenderableKind (required)",
43942
+ onready: "() => void: first view on screen",
43943
+ onerror: "(error: ViewerError) => void",
43944
+ hideToolbar: "boolean, default false",
43945
+ class: "string",
43946
+ initialZoom: "ZoomMode = number | 'fit-width' | 'fit-page', default 'fit-width'",
43947
+ initialPage: "number, 1-based, default 1"
43948
+ }
43949
+ },
43950
+ SpreadsheetViewer: {
43951
+ import: "@classic-homes/viewer-svelte/xlsx",
43952
+ props: {
43953
+ source: "LoadedSource (required): { bytes: Uint8Array; name?: string; mime?: string } from loadSource()",
43954
+ kind: "RenderableKind (required)",
43955
+ onready: "() => void: first view on screen",
43956
+ onerror: "(error: ViewerError) => void",
43957
+ hideToolbar: "boolean, default false",
43958
+ class: "string",
43959
+ initialSheet: "string | number: sheet name or 0-based index"
43960
+ }
43961
+ },
43962
+ DocxViewer: {
43963
+ import: "@classic-homes/viewer-svelte/docx",
43964
+ props: {
43965
+ source: "LoadedSource (required): { bytes: Uint8Array; name?: string; mime?: string } from loadSource()",
43966
+ kind: "RenderableKind (required)",
43967
+ onready: "() => void: first view on screen",
43968
+ onerror: "(error: ViewerError) => void",
43969
+ hideToolbar: "boolean, default false",
43970
+ class: "string",
43971
+ initialZoom: "ZoomMode, default 'fit-width' (never above 100%)"
43972
+ }
43973
+ },
43974
+ CadViewer: {
43975
+ import: "@classic-homes/viewer-svelte/cad",
43976
+ props: {
43977
+ source: "LoadedSource (required): { bytes: Uint8Array; name?: string; mime?: string } from loadSource()",
43978
+ kind: "RenderableKind (required)",
43979
+ onready: "() => void: first view on screen",
43980
+ onerror: "(error: ViewerError) => void",
43981
+ hideToolbar: "boolean, default false",
43982
+ class: "string",
43983
+ background: "'theme' | 'dark' | 'light', default 'theme'",
43984
+ showLayers: "boolean, default false",
43985
+ fonts: "string[]: overrides configureCad fonts",
43986
+ downloadSource: "{ bytes, name?, mime? }: what Download saves when source was derived (e.g. converted DWG)",
43987
+ notice: "string: note under the toolbar"
43988
+ }
43989
+ },
43990
+ DwgViewer: {
43991
+ import: "@classic-homes/viewer-dwg/svelte",
43992
+ license: "GPL-3.0-or-later",
43993
+ props: {
43994
+ source: "LoadedSource (required): { bytes: Uint8Array; name?: string; mime?: string } from loadSource()",
43995
+ kind: "RenderableKind (required)",
43996
+ onready: "() => void: first view on screen",
43997
+ onerror: "(error: ViewerError) => void",
43998
+ hideToolbar: "boolean, default false",
43999
+ class: "string",
44000
+ background: "'theme' | 'dark' | 'light', default 'theme'",
44001
+ showLayers: "boolean, default false",
44002
+ fonts: "string[]"
44003
+ }
44004
+ }
44005
+ },
44006
+ errors: {
44007
+ class: "ViewerError (code, message, kind?) from @classic-homes/viewer-core; isViewerError(e) to narrow",
44008
+ codes: {
44009
+ unsupported: "no viewer registered, legacy .doc/.xls, binary DXF, no WebGL, DWG without viewer-dwg",
44010
+ "too-large": "over maxBytes, or a DWG too big for WASM memory",
44011
+ encrypted: "password-protected PDF or Office file",
44012
+ corrupt: "the parser rejected the file",
44013
+ "load-failed": "network/read failure, or a worker or WASM that failed to start",
44014
+ "missing-dependency": "the format's optional peer is not installed",
44015
+ aborted: "loading was cancelled"
44016
+ }
44017
+ },
44018
+ keyboard: {
44019
+ "Ctrl/Cmd + = / -": "zoom in / out",
44020
+ "Ctrl/Cmd + 0": "reset zoom (PDF/Word toggle fit width/page; Excel 100%; CAD fit)",
44021
+ "Ctrl/Cmd + F": "find (PDF, Word, Excel)",
44022
+ "Enter / Shift+Enter": "next / previous match",
44023
+ "PageDown / PageUp, Home / End": "pages (PDF, Word)",
44024
+ "Arrows, + / -, 0": "CAD: pan, zoom, fit while the drawing has focus"
44025
+ },
44026
+ security: [
44027
+ "Office ZIP entries are size-checked before inflation (SafeZip), so small files cannot expand into gigabytes.",
44028
+ "Links from documents pass safeHref: only http(s) and mailto, opened in a new tab with rel=noopener noreferrer nofollow.",
44029
+ "pdf.js runs with isEvalSupported: false.",
44030
+ "docx-preview: altChunk (embedded HTML) disabled, archive repacked through SafeZip, output sanitised in a shadow root.",
44031
+ "DWG conversion runs in a worker inside the WASM heap; a crashed instance is discarded."
44032
+ ]
44033
+ };
44034
+
44035
+ // src/resources/viewers.ts
44036
+ var catalog8 = viewer_catalog_default;
44037
+ var json = (uri, value) => ({
44038
+ contents: [{ uri: uri.href, mimeType: "application/json", text: JSON.stringify(value, null, 2) }]
44039
+ });
44040
+ function registerViewerResources(server) {
44041
+ server.resource("Document Viewers", "viewers://all", async (uri) => json(uri, catalog8));
44042
+ server.resource(
44043
+ "Viewer Formats",
44044
+ "viewers://formats",
44045
+ async (uri) => json(uri, {
44046
+ description: "Formats the document viewers show, with the component, import, peer dependency, configuration, features and limits of each",
44047
+ formats: catalog8.formats,
44048
+ legacyFormats: catalog8.legacyFormats
44049
+ })
44050
+ );
44051
+ server.resource(
44052
+ "Viewer Setup",
44053
+ "viewers://setup",
44054
+ async (uri) => json(uri, {
44055
+ description: "How to install and configure the viewers, the DocumentViewer registry, component props, error codes and security notes",
44056
+ packages: catalog8.packages,
44057
+ setup: catalog8.setup,
44058
+ components: catalog8.components,
44059
+ errors: catalog8.errors,
44060
+ keyboard: catalog8.keyboard,
44061
+ security: catalog8.security
44062
+ })
44063
+ );
44064
+ }
44065
+
42435
44066
  // src/resources/index.ts
42436
44067
  function registerResources(server) {
42437
44068
  registerComponentResources(server);
@@ -42446,12 +44077,13 @@ function registerResources(server) {
42446
44077
  registerGanttResources(server);
42447
44078
  registerMapsResources(server);
42448
44079
  registerNativeResources(server);
44080
+ registerViewerResources(server);
42449
44081
  }
42450
44082
 
42451
44083
  // src/tools/searchComponents.ts
42452
44084
  import { z } from "zod";
42453
- var catalog8 = component_catalog_default;
42454
- var categories = [...new Set(catalog8.components.map((c) => c.category))].sort();
44085
+ var catalog9 = component_catalog_default;
44086
+ var categories = [...new Set(catalog9.components.map((c) => c.category))].sort();
42455
44087
  var SearchComponentsSchema = z.object({
42456
44088
  query: z.string().describe("Search query (component name, description, or functionality)"),
42457
44089
  category: z.enum(categories).optional().describe("Filter by component category"),
@@ -42467,7 +44099,7 @@ function registerSearchComponentsTool(server) {
42467
44099
  const queryLower = query.toLowerCase().trim();
42468
44100
  const isListAll = queryLower === "*" || queryLower === "all" || queryLower === "" || queryLower === "list" || queryLower === "list all";
42469
44101
  const queryWords = queryLower.split(/\s+/).filter((word) => word.length > 0);
42470
- const results = catalog8.components.filter((component) => {
44102
+ const results = catalog9.components.filter((component) => {
42471
44103
  if (category && component.category !== category) {
42472
44104
  return false;
42473
44105
  }
@@ -42541,7 +44173,7 @@ var mapsComponents = new Set(
42541
44173
  (name) => name.toLowerCase()
42542
44174
  )
42543
44175
  );
42544
- function componentNotFound(catalog12, componentName) {
44176
+ function componentNotFound(catalog13, componentName) {
42545
44177
  const query = componentName.trim().toLowerCase();
42546
44178
  if (mapsComponents.has(query)) {
42547
44179
  return {
@@ -42551,7 +44183,7 @@ function componentNotFound(catalog12, componentName) {
42551
44183
  };
42552
44184
  }
42553
44185
  const prefix = query.slice(0, 3);
42554
- const suggestions = prefix ? catalog12.components.filter((c) => c.name.toLowerCase().includes(prefix)).slice(0, 5).map((c) => c.name) : [];
44186
+ const suggestions = prefix ? catalog13.components.filter((c) => c.name.toLowerCase().includes(prefix)).slice(0, 5).map((c) => c.name) : [];
42555
44187
  return {
42556
44188
  maps: false,
42557
44189
  message: `Component "${componentName}" not found`,
@@ -42561,7 +44193,7 @@ function componentNotFound(catalog12, componentName) {
42561
44193
  }
42562
44194
 
42563
44195
  // src/tools/getComponentProps.ts
42564
- var catalog9 = component_catalog_default;
44196
+ var catalog10 = component_catalog_default;
42565
44197
  var GetComponentPropsSchema = z2.object({
42566
44198
  componentName: z2.string().trim().min(1).describe('Name of the component (e.g., "Button", "DashboardLayout")'),
42567
44199
  includeExamples: z2.boolean().default(true).describe("Whether to include usage examples")
@@ -42573,11 +44205,11 @@ function registerGetComponentPropsTool(server) {
42573
44205
  GetComponentPropsSchema.shape,
42574
44206
  async (params) => {
42575
44207
  const { componentName, includeExamples } = GetComponentPropsSchema.parse(params);
42576
- const component = catalog9.components.find(
44208
+ const component = catalog10.components.find(
42577
44209
  (c) => c.name.toLowerCase() === componentName.toLowerCase()
42578
44210
  );
42579
44211
  if (!component) {
42580
- const { message, suggestions, hint } = componentNotFound(catalog9, componentName);
44212
+ const { message, suggestions, hint } = componentNotFound(catalog10, componentName);
42581
44213
  return {
42582
44214
  content: [
42583
44215
  {
@@ -42698,7 +44330,7 @@ function registerSuggestPatternTool(server) {
42698
44330
 
42699
44331
  // src/tools/validateUsage.ts
42700
44332
  import { z as z4 } from "zod";
42701
- var catalog10 = component_catalog_default;
44333
+ var catalog11 = component_catalog_default;
42702
44334
  var ValidateUsageSchema = z4.object({
42703
44335
  componentName: z4.string().trim().min(1).describe("Name of the component being used"),
42704
44336
  props: z4.record(z4.unknown()).describe("Props being passed to the component"),
@@ -42723,11 +44355,11 @@ function registerValidateUsageTool(server) {
42723
44355
  ValidateUsageSchema.shape,
42724
44356
  async (params) => {
42725
44357
  const { componentName, props, context } = ValidateUsageSchema.parse(params);
42726
- const component = catalog10.components.find(
44358
+ const component = catalog11.components.find(
42727
44359
  (c) => c.name.toLowerCase() === componentName.toLowerCase()
42728
44360
  );
42729
44361
  if (!component) {
42730
- const { maps, message, suggestions: suggestions2, hint } = componentNotFound(catalog10, componentName);
44362
+ const { maps, message, suggestions: suggestions2, hint } = componentNotFound(catalog11, componentName);
42731
44363
  return {
42732
44364
  content: [
42733
44365
  {
@@ -43045,7 +44677,7 @@ Example for ${pageType}Layout:
43045
44677
 
43046
44678
  // src/prompts/componentUsage.ts
43047
44679
  import { z as z7 } from "zod";
43048
- var catalog11 = component_catalog_default;
44680
+ var catalog12 = component_catalog_default;
43049
44681
  var ComponentUsageSchema = z7.object({
43050
44682
  componentName: z7.string().describe("Name of the component (e.g., Button, Card, Select)"),
43051
44683
  variant: z7.string().optional().describe("Desired variant (optional)"),
@@ -43061,7 +44693,7 @@ function registerComponentUsagePrompt(server) {
43061
44693
  const componentName = parsed.componentName || "Button";
43062
44694
  const variant = parsed.variant || "";
43063
44695
  const useCase = parsed.useCase || "";
43064
- const component = catalog11.components.find(
44696
+ const component = catalog12.components.find(
43065
44697
  (c) => c.name.toLowerCase() === componentName.toLowerCase()
43066
44698
  );
43067
44699
  let componentInfo = "";
@@ -43083,7 +44715,7 @@ ${component.examples.map((e) => `### ${e.title}
43083
44715
  ${e.code}
43084
44716
  \`\`\``).join("\n\n")}`;
43085
44717
  } else {
43086
- componentInfo = `Component "${componentName}" not found in catalog. Available components: ${catalog11.components.map((c) => c.name).join(", ")}`;
44718
+ componentInfo = `Component "${componentName}" not found in catalog. Available components: ${catalog12.components.map((c) => c.name).join(", ")}`;
43087
44719
  }
43088
44720
  return {
43089
44721
  messages: [
@@ -43121,7 +44753,7 @@ function registerPrompts(server) {
43121
44753
  // package.json
43122
44754
  var package_default = {
43123
44755
  name: "@classic-homes/theme-mcp",
43124
- version: "0.4.0",
44756
+ version: "0.5.1",
43125
44757
  description: "MCP server for Classic Theme design system - enables AI assistants to understand and correctly use components, tokens, and patterns",
43126
44758
  type: "module",
43127
44759
  main: "dist/index.js",
@@ -43220,4 +44852,4 @@ function createServer() {
43220
44852
  export {
43221
44853
  createServer
43222
44854
  };
43223
- //# sourceMappingURL=chunk-27MBCE7P.js.map
44855
+ //# sourceMappingURL=chunk-W2EKMD3D.js.map