@classic-homes/theme-mcp 0.1.22 → 0.1.24

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/dist/cli.js CHANGED
@@ -18002,6 +18002,42 @@ var maps_catalog_default = {
18002
18002
  description: "Serialize a filter expression for comparison"
18003
18003
  }
18004
18004
  ]
18005
+ },
18006
+ basemaps: {
18007
+ description: "Basemap registry, presets, and utilities for basemap switching",
18008
+ functions: [
18009
+ {
18010
+ name: "resolveBasemapStyle",
18011
+ signature: "(basemap: BasemapDefinition, apiKeys?: BasemapApiKeys) => string | StyleSpecification | null",
18012
+ description: "Resolve a basemap's style spec, injecting API key if needed. Returns null if required key is missing."
18013
+ },
18014
+ {
18015
+ name: "getAvailableBasemaps",
18016
+ signature: "(basemaps: BasemapDefinition[], apiKeys?: BasemapApiKeys) => BasemapDefinition[]",
18017
+ description: "Filter basemaps to only those with available API keys. Free basemaps always included."
18018
+ },
18019
+ {
18020
+ name: "resolveBasemapThumbnail",
18021
+ signature: "(basemap: BasemapDefinition, apiKeys?: BasemapApiKeys) => string",
18022
+ description: "Resolve thumbnail URL, appending provider-specific API key query parameter if needed."
18023
+ }
18024
+ ],
18025
+ constants: [
18026
+ { name: "FREE_BASEMAPS", type: "BasemapDefinition[]", description: "3 free basemaps: OSM Standard, Classic Light, Classic Dark (no API key required)" },
18027
+ { name: "BUILTIN_BASEMAPS", type: "BasemapDefinition[]", description: "All 12 built-in basemaps including MapTiler (4) and Stadia Maps (5) options" },
18028
+ { name: "OSM_STANDARD", type: "BasemapDefinition", description: "OpenStreetMap raster tiles (free)" },
18029
+ { name: "CLASSIC_LIGHT", type: "BasemapDefinition", description: "Classic Theme light vector style (free)" },
18030
+ { name: "CLASSIC_DARK", type: "BasemapDefinition", description: "Classic Theme dark vector style (free)" },
18031
+ { name: "MAPTILER_STREETS", type: "BasemapDefinition", description: "MapTiler Streets (requires API key)" },
18032
+ { name: "MAPTILER_SATELLITE", type: "BasemapDefinition", description: "MapTiler Satellite (requires API key)" },
18033
+ { name: "MAPTILER_OUTDOOR", type: "BasemapDefinition", description: "MapTiler Outdoor (requires API key)" },
18034
+ { name: "MAPTILER_BASIC", type: "BasemapDefinition", description: "MapTiler Basic (requires API key)" },
18035
+ { name: "STADIA_ALIDADE_SMOOTH", type: "BasemapDefinition", description: "Stadia Alidade Smooth (requires API key)" },
18036
+ { name: "STADIA_ALIDADE_DARK", type: "BasemapDefinition", description: "Stadia Alidade Dark (requires API key)" },
18037
+ { name: "STADIA_STAMEN_TONER", type: "BasemapDefinition", description: "Stamen Toner artistic style (requires API key)" },
18038
+ { name: "STADIA_STAMEN_WATERCOLOR", type: "BasemapDefinition", description: "Stamen Watercolor artistic style (requires API key)" },
18039
+ { name: "STADIA_STAMEN_TERRAIN", type: "BasemapDefinition", description: "Stamen Terrain outdoor style (requires API key)" }
18040
+ ]
18005
18041
  }
18006
18042
  }
18007
18043
  },
@@ -18326,6 +18362,22 @@ var maps_catalog_default = {
18326
18362
  { name: "showAccuracyCircle", type: "boolean", required: false, description: "Show accuracy circle" },
18327
18363
  { name: "showUserHeading", type: "boolean", required: false, description: "Show user heading" }
18328
18364
  ]
18365
+ },
18366
+ {
18367
+ name: "BasemapSwitcherProps",
18368
+ description: "Props for the basemap switcher control",
18369
+ properties: [
18370
+ { name: "position", type: "ControlPosition", required: false, description: "Position on map (default: 'bottom-right')" },
18371
+ { name: "basemaps", type: "BasemapDefinition[]", required: false, description: "Override the default basemap list (defaults to FREE_BASEMAPS)" },
18372
+ { name: "extraBasemaps", type: "BasemapDefinition[]", required: false, description: "Additional basemaps appended to the default list" },
18373
+ { name: "apiKeys", type: "BasemapApiKeys", required: false, description: "API keys for providers (maptiler, stadia)" },
18374
+ { name: "defaultBasemapId", type: "string", required: false, description: "ID of the initially active basemap" },
18375
+ { name: "activeBasemapId", type: "string", required: false, description: "Controlled active basemap ID" },
18376
+ { name: "onBasemapChange", type: "(basemap: BasemapDefinition) => void", required: false, description: "Callback when basemap changes" },
18377
+ { name: "columns", type: "number", required: false, description: "Grid columns in flyout (default: 3)" },
18378
+ { name: "thumbnailSize", type: "number", required: false, description: "Thumbnail size in pixels (default: 64)" },
18379
+ { name: "class", type: "string", required: false, description: "Additional CSS classes" }
18380
+ ]
18329
18381
  }
18330
18382
  ]
18331
18383
  },
@@ -18672,6 +18724,45 @@ var maps_catalog_default = {
18672
18724
  ]
18673
18725
  }
18674
18726
  ]
18727
+ },
18728
+ basemaps: {
18729
+ description: "Basemap-related types for the basemap switching system",
18730
+ types: [
18731
+ {
18732
+ name: "BasemapProvider",
18733
+ description: "Supported basemap tile providers",
18734
+ type: "'osm' | 'maptiler' | 'stadia' | 'classic-theme' | 'custom'"
18735
+ },
18736
+ {
18737
+ name: "BasemapCategory",
18738
+ description: "Basemap visual categories",
18739
+ type: "'streets' | 'satellite' | 'outdoor' | 'artistic' | 'minimal' | 'dark'"
18740
+ },
18741
+ {
18742
+ name: "BasemapDefinition",
18743
+ description: "Full basemap definition including metadata and style resolution",
18744
+ properties: [
18745
+ { name: "id", type: "string", required: true, description: "Unique basemap identifier" },
18746
+ { name: "name", type: "string", required: true, description: "Display name" },
18747
+ { name: "provider", type: "BasemapProvider", required: true, description: "Tile provider" },
18748
+ { name: "category", type: "BasemapCategory", required: true, description: "Visual category" },
18749
+ { name: "thumbnail", type: "string", required: true, description: "Thumbnail URL (may contain {key} placeholder)" },
18750
+ { name: "style", type: "string | StyleSpecification", required: true, description: "MapLibre style URL or spec (may contain {key} placeholder)" },
18751
+ { name: "requiresApiKey", type: "boolean", required: true, description: "Whether an API key is needed" },
18752
+ { name: "attribution", type: "string", required: false, description: "Custom attribution text" },
18753
+ { name: "label", type: "string", required: false, description: "Short label for UI (defaults to name)" }
18754
+ ]
18755
+ },
18756
+ {
18757
+ name: "BasemapApiKeys",
18758
+ description: "API keys for basemap providers",
18759
+ properties: [
18760
+ { name: "maptiler", type: "string", required: false, description: "MapTiler API key" },
18761
+ { name: "stadia", type: "string", required: false, description: "Stadia Maps API key" },
18762
+ { name: "[provider: string]", type: "string", required: false, description: "Custom provider API key (index signature)" }
18763
+ ]
18764
+ }
18765
+ ]
18675
18766
  }
18676
18767
  },
18677
18768
  components: {
@@ -18701,6 +18792,7 @@ var maps_catalog_default = {
18701
18792
  "Legend",
18702
18793
  "LegendGroup",
18703
18794
  "CoordinateDisplay",
18795
+ "BasemapSwitcher",
18704
18796
  "DeckOverlay"
18705
18797
  ],
18706
18798
  hooks: [
@@ -18708,7 +18800,7 @@ var maps_catalog_default = {
18708
18800
  name: "useMap",
18709
18801
  signature: "() => MapContextValue",
18710
18802
  description: "Hook to access the MapLibre map instance and state from context. Must be used within a Map component.",
18711
- returns: "{ map: MapLibreMap | null, loaded: boolean, controlOffsets?: ControlOffsets, registerControl?, unregisterControl?, getCustomControlOffset? }"
18803
+ returns: "{ map: MapLibreMap | null, loaded: boolean, styleVersion: number, setMapStyle: (style: string | StyleSpecification) => void, controlOffsets?: ControlOffsets, registerControl?, unregisterControl?, getCustomControlOffset? }"
18712
18804
  },
18713
18805
  {
18714
18806
  name: "useMapInstance",
@@ -18737,6 +18829,8 @@ var maps_catalog_default = {
18737
18829
  value: {
18738
18830
  map: "MapLibreMap | null - The MapLibre map instance",
18739
18831
  loaded: "boolean - Whether the map has loaded",
18832
+ styleVersion: "number - Counter incremented on each style.load event (for basemap switching)",
18833
+ setMapStyle: "(style: string | StyleSpecification) => void - Programmatically change the map style",
18740
18834
  controlOffsets: "Record<string, number> - Pixel offsets for custom controls",
18741
18835
  registerControl: "(id, position, height) => number - Register a custom control",
18742
18836
  unregisterControl: "(id, position) => void - Unregister a custom control",
@@ -18769,13 +18863,14 @@ var maps_catalog_default = {
18769
18863
  "Legend",
18770
18864
  "LegendGroup",
18771
18865
  "CoordinateDisplay",
18866
+ "BasemapSwitcher",
18772
18867
  "DeckOverlay"
18773
18868
  ],
18774
18869
  composables: [
18775
18870
  {
18776
18871
  name: "useMapContext",
18777
- signature: "() => { map: Writable<Map | null>, loaded: Writable<boolean> }",
18778
- description: "Get the map context from the parent Map component using Svelte context API"
18872
+ signature: "() => { map: Writable<Map | null>, loaded: Writable<boolean>, styleVersion: number, setMapStyle: (style: string | StyleSpecification) => void }",
18873
+ description: "Get the map context from the parent Map component using Svelte context API. Includes styleVersion counter and setMapStyle for basemap switching."
18779
18874
  },
18780
18875
  {
18781
18876
  name: "useMapTheme",
@@ -18813,7 +18908,7 @@ var maps_catalog_default = {
18813
18908
  </Map>`,
18814
18909
  peerDependency: "maplibre-gl@^4.0.0 || ^5.0.0",
18815
18910
  optionalPeerDependencies: "@deck.gl/core, @deck.gl/layers, @deck.gl/mapbox (for DeckOverlay)",
18816
- cssImportOrder: "/* In main CSS file - order matters */\n@import '@classic-homes/theme-styles';\n@import 'maplibre-gl/dist/maplibre-gl.css';\n@import '@classic-homes/maps-core/styles/controls.css';\n@import '@classic-homes/maps-core/styles/popup.css';\n\n@tailwind base;\n@tailwind components;\n@tailwind utilities;",
18911
+ cssImportOrder: "/* In main CSS file - order matters */\n@import '@classic-homes/theme-styles';\n@import 'maplibre-gl/dist/maplibre-gl.css';\n@import '@classic-homes/maps-core/styles/controls.css';\n@import '@classic-homes/maps-core/styles/popup.css';\n@import '@classic-homes/maps-core/styles/basemap-switcher.css';\n\n@tailwind base;\n@tailwind components;\n@tailwind utilities;",
18817
18912
  tailwindConfig: "module.exports = {\n presets: [require('@classic-homes/theme-tailwind-preset')],\n content: [\n './src/**/*.{js,ts,jsx,tsx}',\n './node_modules/@classic-homes/maps-react/dist/**/*.{js,mjs}',\n ],\n};"
18818
18913
  },
18819
18914
  bestPractices: {
@@ -18858,6 +18953,17 @@ var maps_catalog_default = {
18858
18953
  "Custom layers can use theme colors via the `MapTheme` object from the hook"
18859
18954
  ]
18860
18955
  },
18956
+ basemapSwitching: {
18957
+ title: "Basemap Switching",
18958
+ guidelines: [
18959
+ "Use the BasemapSwitcher control for built-in UI, or call setMapStyle from context for custom UI",
18960
+ "FREE_BASEMAPS provides 3 basemaps that work without API keys (OSM, Classic Light/Dark)",
18961
+ "Use apiKeys prop to enable MapTiler and Stadia Maps basemaps: apiKeys={{ maptiler: 'key', stadia: 'key' }}",
18962
+ "Use extraBasemaps to add custom basemap definitions alongside built-in ones",
18963
+ "Sources and layers are automatically re-initialized after basemap switch via the styleVersion mechanism",
18964
+ "Import basemap-switcher.css: @import '@classic-homes/maps-core/styles/basemap-switcher.css';"
18965
+ ]
18966
+ },
18861
18967
  layerOrdering: {
18862
18968
  title: "Layer Ordering",
18863
18969
  guidelines: [
@@ -19271,6 +19377,7 @@ ${catalog5.quickReference.basicUsage}
19271
19377
  @import 'maplibre-gl/dist/maplibre-gl.css';
19272
19378
  @import '@classic-homes/maps-core/styles/controls.css';
19273
19379
  @import '@classic-homes/maps-core/styles/popup.css';
19380
+ @import '@classic-homes/maps-core/styles/basemap-switcher.css';
19274
19381
 
19275
19382
  @tailwind base;
19276
19383
  @tailwind components;