@maplibre-yaml/core 0.1.0-alpha.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1214 -0
- package/dist/components/index.d.ts +4 -83
- package/dist/components/index.js +4318 -3919
- package/dist/components/index.js.map +1 -1
- package/dist/index.d.ts +6 -315
- package/dist/index.js +115 -18
- package/dist/index.js.map +1 -1
- package/dist/map-renderer-DOLO9y-3.d.ts +522 -0
- package/dist/{map.schema-EnZRrtIh.d.ts → page.schema-CzdCyPFI.d.ts} +775 -368
- package/dist/register.browser.js +16004 -0
- package/dist/register.browser.js.map +1 -0
- package/dist/register.d.ts +205 -0
- package/dist/register.js +4704 -0
- package/dist/register.js.map +1 -0
- package/dist/schemas/index.d.ts +12 -419
- package/dist/schemas/index.js +4 -2
- package/dist/schemas/index.js.map +1 -1
- package/package.json +18 -13
- package/LICENSE.md +0 -21
- package/dist/map-renderer-RQc5_bdo.d.ts +0 -149
package/dist/schemas/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
export {
|
|
2
|
+
export { j as BackgroundLayerSchema, B as BaseLayerPropertiesSchema, p as BlockSchema, e as CircleLayerSchema, m as ControlPositionSchema, C as ControlsConfigSchema, h as FillExtrusionLayerSchema, F as FillLayerSchema, G as GlobalConfigSchema, H as HeatmapLayerSchema, i as HillshadeLayerSchema, I as InteractiveConfigSchema, l as LayerOrReferenceSchema, k as LayerReferenceSchema, L as LayerSchema, a as LegendConfigSchema, d as LegendItemSchema, f as LineLayerSchema, M as MapBlockSchema, b as MapConfigSchema, n as MapFullPageBlockSchema, o as MixedBlockSchema, q as PageSchema, c as PopupContentItemSchema, P as PopupContentSchema, g as RasterLayerSchema, R as RootSchema, S as SymbolLayerSchema } from '../page.schema-CzdCyPFI.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* @file Base schemas for maplibre-yaml
|
|
@@ -515,7 +515,7 @@ declare const GeoJSONSourceSchema: z.ZodEffects<z.ZodObject<{
|
|
|
515
515
|
ttl?: number | undefined;
|
|
516
516
|
}>>;
|
|
517
517
|
cluster: z.ZodOptional<z.ZodBoolean>;
|
|
518
|
-
clusterRadius: z.
|
|
518
|
+
clusterRadius: z.ZodOptional<z.ZodNumber>;
|
|
519
519
|
clusterMaxZoom: z.ZodOptional<z.ZodNumber>;
|
|
520
520
|
clusterMinPoints: z.ZodOptional<z.ZodNumber>;
|
|
521
521
|
clusterProperties: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
@@ -622,7 +622,7 @@ declare const GeoJSONSourceSchema: z.ZodEffects<z.ZodObject<{
|
|
|
622
622
|
ttl?: number | undefined;
|
|
623
623
|
}>>;
|
|
624
624
|
cluster: z.ZodOptional<z.ZodBoolean>;
|
|
625
|
-
clusterRadius: z.
|
|
625
|
+
clusterRadius: z.ZodOptional<z.ZodNumber>;
|
|
626
626
|
clusterMaxZoom: z.ZodOptional<z.ZodNumber>;
|
|
627
627
|
clusterMinPoints: z.ZodOptional<z.ZodNumber>;
|
|
628
628
|
clusterProperties: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
@@ -729,7 +729,7 @@ declare const GeoJSONSourceSchema: z.ZodEffects<z.ZodObject<{
|
|
|
729
729
|
ttl?: number | undefined;
|
|
730
730
|
}>>;
|
|
731
731
|
cluster: z.ZodOptional<z.ZodBoolean>;
|
|
732
|
-
clusterRadius: z.
|
|
732
|
+
clusterRadius: z.ZodOptional<z.ZodNumber>;
|
|
733
733
|
clusterMaxZoom: z.ZodOptional<z.ZodNumber>;
|
|
734
734
|
clusterMinPoints: z.ZodOptional<z.ZodNumber>;
|
|
735
735
|
clusterProperties: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
@@ -836,7 +836,7 @@ declare const GeoJSONSourceSchema: z.ZodEffects<z.ZodObject<{
|
|
|
836
836
|
ttl?: number | undefined;
|
|
837
837
|
}>>;
|
|
838
838
|
cluster: z.ZodOptional<z.ZodBoolean>;
|
|
839
|
-
clusterRadius: z.
|
|
839
|
+
clusterRadius: z.ZodOptional<z.ZodNumber>;
|
|
840
840
|
clusterMaxZoom: z.ZodOptional<z.ZodNumber>;
|
|
841
841
|
clusterMinPoints: z.ZodOptional<z.ZodNumber>;
|
|
842
842
|
clusterProperties: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
@@ -943,7 +943,7 @@ declare const GeoJSONSourceSchema: z.ZodEffects<z.ZodObject<{
|
|
|
943
943
|
ttl?: number | undefined;
|
|
944
944
|
}>>;
|
|
945
945
|
cluster: z.ZodOptional<z.ZodBoolean>;
|
|
946
|
-
clusterRadius: z.
|
|
946
|
+
clusterRadius: z.ZodOptional<z.ZodNumber>;
|
|
947
947
|
clusterMaxZoom: z.ZodOptional<z.ZodNumber>;
|
|
948
948
|
clusterMinPoints: z.ZodOptional<z.ZodNumber>;
|
|
949
949
|
clusterProperties: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
@@ -1304,7 +1304,7 @@ declare const LayerSourceSchema: z.ZodUnion<[z.ZodEffects<z.ZodObject<{
|
|
|
1304
1304
|
ttl?: number | undefined;
|
|
1305
1305
|
}>>;
|
|
1306
1306
|
cluster: z.ZodOptional<z.ZodBoolean>;
|
|
1307
|
-
clusterRadius: z.
|
|
1307
|
+
clusterRadius: z.ZodOptional<z.ZodNumber>;
|
|
1308
1308
|
clusterMaxZoom: z.ZodOptional<z.ZodNumber>;
|
|
1309
1309
|
clusterMinPoints: z.ZodOptional<z.ZodNumber>;
|
|
1310
1310
|
clusterProperties: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
@@ -1411,7 +1411,7 @@ declare const LayerSourceSchema: z.ZodUnion<[z.ZodEffects<z.ZodObject<{
|
|
|
1411
1411
|
ttl?: number | undefined;
|
|
1412
1412
|
}>>;
|
|
1413
1413
|
cluster: z.ZodOptional<z.ZodBoolean>;
|
|
1414
|
-
clusterRadius: z.
|
|
1414
|
+
clusterRadius: z.ZodOptional<z.ZodNumber>;
|
|
1415
1415
|
clusterMaxZoom: z.ZodOptional<z.ZodNumber>;
|
|
1416
1416
|
clusterMinPoints: z.ZodOptional<z.ZodNumber>;
|
|
1417
1417
|
clusterProperties: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
@@ -1518,7 +1518,7 @@ declare const LayerSourceSchema: z.ZodUnion<[z.ZodEffects<z.ZodObject<{
|
|
|
1518
1518
|
ttl?: number | undefined;
|
|
1519
1519
|
}>>;
|
|
1520
1520
|
cluster: z.ZodOptional<z.ZodBoolean>;
|
|
1521
|
-
clusterRadius: z.
|
|
1521
|
+
clusterRadius: z.ZodOptional<z.ZodNumber>;
|
|
1522
1522
|
clusterMaxZoom: z.ZodOptional<z.ZodNumber>;
|
|
1523
1523
|
clusterMinPoints: z.ZodOptional<z.ZodNumber>;
|
|
1524
1524
|
clusterProperties: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
@@ -1625,7 +1625,7 @@ declare const LayerSourceSchema: z.ZodUnion<[z.ZodEffects<z.ZodObject<{
|
|
|
1625
1625
|
ttl?: number | undefined;
|
|
1626
1626
|
}>>;
|
|
1627
1627
|
cluster: z.ZodOptional<z.ZodBoolean>;
|
|
1628
|
-
clusterRadius: z.
|
|
1628
|
+
clusterRadius: z.ZodOptional<z.ZodNumber>;
|
|
1629
1629
|
clusterMaxZoom: z.ZodOptional<z.ZodNumber>;
|
|
1630
1630
|
clusterMinPoints: z.ZodOptional<z.ZodNumber>;
|
|
1631
1631
|
clusterProperties: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
@@ -1732,7 +1732,7 @@ declare const LayerSourceSchema: z.ZodUnion<[z.ZodEffects<z.ZodObject<{
|
|
|
1732
1732
|
ttl?: number | undefined;
|
|
1733
1733
|
}>>;
|
|
1734
1734
|
cluster: z.ZodOptional<z.ZodBoolean>;
|
|
1735
|
-
clusterRadius: z.
|
|
1735
|
+
clusterRadius: z.ZodOptional<z.ZodNumber>;
|
|
1736
1736
|
clusterMaxZoom: z.ZodOptional<z.ZodNumber>;
|
|
1737
1737
|
clusterMinPoints: z.ZodOptional<z.ZodNumber>;
|
|
1738
1738
|
clusterProperties: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
@@ -2741,411 +2741,4 @@ declare const ChapterSchema: z.ZodObject<{
|
|
|
2741
2741
|
*/
|
|
2742
2742
|
declare const ScrollytellingBlockSchema: z.ZodObject<any>;
|
|
2743
2743
|
|
|
2744
|
-
|
|
2745
|
-
* @file Page and root configuration schemas for maplibre-yaml
|
|
2746
|
-
* @module @maplibre-yaml/core/schemas/page
|
|
2747
|
-
*
|
|
2748
|
-
* @description
|
|
2749
|
-
* Zod schemas for pages, global configuration, and the root schema.
|
|
2750
|
-
* Includes recursive MixedBlock for complex layouts.
|
|
2751
|
-
*
|
|
2752
|
-
* @example
|
|
2753
|
-
* ```typescript
|
|
2754
|
-
* import { RootSchema, PageSchema } from '@maplibre-yaml/core/schemas';
|
|
2755
|
-
* ```
|
|
2756
|
-
*/
|
|
2757
|
-
|
|
2758
|
-
/**
|
|
2759
|
-
* Mixed block for combining multiple block types.
|
|
2760
|
-
*
|
|
2761
|
-
* @remarks
|
|
2762
|
-
* MixedBlock allows you to create complex layouts by combining
|
|
2763
|
-
* content, map, and scrollytelling blocks. Uses z.lazy() for recursion.
|
|
2764
|
-
*
|
|
2765
|
-
* **Layout Options:**
|
|
2766
|
-
* - `row` - Horizontal layout (default)
|
|
2767
|
-
* - `column` - Vertical layout
|
|
2768
|
-
* - `grid` - CSS Grid layout
|
|
2769
|
-
*
|
|
2770
|
-
* @example Row Layout
|
|
2771
|
-
* ```yaml
|
|
2772
|
-
* - type: mixed
|
|
2773
|
-
* layout: row
|
|
2774
|
-
* blocks:
|
|
2775
|
-
* - type: content
|
|
2776
|
-
* content:
|
|
2777
|
-
* - h2: [{ str: "Left Column" }]
|
|
2778
|
-
* - type: map
|
|
2779
|
-
* id: side-map
|
|
2780
|
-
* config:
|
|
2781
|
-
* center: [0, 0]
|
|
2782
|
-
* zoom: 2
|
|
2783
|
-
* mapStyle: "..."
|
|
2784
|
-
* ```
|
|
2785
|
-
*
|
|
2786
|
-
* @example Grid Layout
|
|
2787
|
-
* ```yaml
|
|
2788
|
-
* - type: mixed
|
|
2789
|
-
* layout: grid
|
|
2790
|
-
* style: "grid-template-columns: repeat(2, 1fr); gap: 20px;"
|
|
2791
|
-
* blocks:
|
|
2792
|
-
* - type: content
|
|
2793
|
-
* content: [...]
|
|
2794
|
-
* - type: content
|
|
2795
|
-
* content: [...]
|
|
2796
|
-
* - type: map
|
|
2797
|
-
* id: map1
|
|
2798
|
-
* config: {...}
|
|
2799
|
-
* - type: map
|
|
2800
|
-
* id: map2
|
|
2801
|
-
* config: {...}
|
|
2802
|
-
* ```
|
|
2803
|
-
*
|
|
2804
|
-
* @example Nested Mixed Blocks
|
|
2805
|
-
* ```yaml
|
|
2806
|
-
* - type: mixed
|
|
2807
|
-
* layout: column
|
|
2808
|
-
* blocks:
|
|
2809
|
-
* - type: content
|
|
2810
|
-
* content: [...]
|
|
2811
|
-
* - type: mixed
|
|
2812
|
-
* layout: row
|
|
2813
|
-
* blocks:
|
|
2814
|
-
* - type: map
|
|
2815
|
-
* id: left-map
|
|
2816
|
-
* config: {...}
|
|
2817
|
-
* - type: map
|
|
2818
|
-
* id: right-map
|
|
2819
|
-
* config: {...}
|
|
2820
|
-
* ```
|
|
2821
|
-
*/
|
|
2822
|
-
declare const MixedBlockSchema: z.ZodType<any>;
|
|
2823
|
-
/**
|
|
2824
|
-
* Union of all block types.
|
|
2825
|
-
*
|
|
2826
|
-
* @remarks
|
|
2827
|
-
* Blocks are the building blocks of pages. Each page contains an
|
|
2828
|
-
* array of blocks that are rendered in order.
|
|
2829
|
-
*
|
|
2830
|
-
* **Block Types:**
|
|
2831
|
-
* - `content` - Rich text and media
|
|
2832
|
-
* - `map` - Standard map
|
|
2833
|
-
* - `map-fullpage` - Full viewport map
|
|
2834
|
-
* - `scrollytelling` - Narrative map story
|
|
2835
|
-
* - `mixed` - Layout container for other blocks
|
|
2836
|
-
*/
|
|
2837
|
-
declare const BlockSchema: z.ZodType<any>;
|
|
2838
|
-
/**
|
|
2839
|
-
* Page configuration.
|
|
2840
|
-
*
|
|
2841
|
-
* @remarks
|
|
2842
|
-
* A page represents a single route/URL in your application.
|
|
2843
|
-
* Pages contain blocks that define the content and maps.
|
|
2844
|
-
*
|
|
2845
|
-
* **Required:**
|
|
2846
|
-
* - `path` - URL path (e.g., "/", "/about", "/map")
|
|
2847
|
-
* - `title` - Page title (used for browser tab and SEO)
|
|
2848
|
-
* - `blocks` - Array of content/map blocks
|
|
2849
|
-
*
|
|
2850
|
-
* **Optional:**
|
|
2851
|
-
* - `description` - Meta description for SEO
|
|
2852
|
-
*
|
|
2853
|
-
* @example Home Page
|
|
2854
|
-
* ```yaml
|
|
2855
|
-
* - path: "/"
|
|
2856
|
-
* title: "Home"
|
|
2857
|
-
* description: "Welcome to our mapping application"
|
|
2858
|
-
* blocks:
|
|
2859
|
-
* - type: content
|
|
2860
|
-
* content:
|
|
2861
|
-
* - h1: [{ str: "Welcome" }]
|
|
2862
|
-
* - type: map
|
|
2863
|
-
* id: home-map
|
|
2864
|
-
* config:
|
|
2865
|
-
* center: [0, 0]
|
|
2866
|
-
* zoom: 2
|
|
2867
|
-
* mapStyle: "..."
|
|
2868
|
-
* ```
|
|
2869
|
-
*
|
|
2870
|
-
* @example Story Page
|
|
2871
|
-
* ```yaml
|
|
2872
|
-
* - path: "/story"
|
|
2873
|
-
* title: "Our Story"
|
|
2874
|
-
* description: "An interactive map story"
|
|
2875
|
-
* blocks:
|
|
2876
|
-
* - type: scrollytelling
|
|
2877
|
-
* id: main-story
|
|
2878
|
-
* config: {...}
|
|
2879
|
-
* chapters: [...]
|
|
2880
|
-
* ```
|
|
2881
|
-
*
|
|
2882
|
-
* @example Complex Layout
|
|
2883
|
-
* ```yaml
|
|
2884
|
-
* - path: "/dashboard"
|
|
2885
|
-
* title: "Dashboard"
|
|
2886
|
-
* blocks:
|
|
2887
|
-
* - type: content
|
|
2888
|
-
* content:
|
|
2889
|
-
* - h1: [{ str: "Dashboard" }]
|
|
2890
|
-
* - type: mixed
|
|
2891
|
-
* layout: row
|
|
2892
|
-
* blocks:
|
|
2893
|
-
* - type: map
|
|
2894
|
-
* id: map1
|
|
2895
|
-
* config: {...}
|
|
2896
|
-
* - type: map
|
|
2897
|
-
* id: map2
|
|
2898
|
-
* config: {...}
|
|
2899
|
-
* ```
|
|
2900
|
-
*/
|
|
2901
|
-
declare const PageSchema: z.ZodObject<{
|
|
2902
|
-
path: z.ZodString;
|
|
2903
|
-
title: z.ZodString;
|
|
2904
|
-
description: z.ZodOptional<z.ZodString>;
|
|
2905
|
-
blocks: z.ZodArray<z.ZodType<any, z.ZodTypeDef, any>, "many">;
|
|
2906
|
-
}, "strip", z.ZodTypeAny, {
|
|
2907
|
-
path: string;
|
|
2908
|
-
title: string;
|
|
2909
|
-
blocks: any[];
|
|
2910
|
-
description?: string | undefined;
|
|
2911
|
-
}, {
|
|
2912
|
-
path: string;
|
|
2913
|
-
title: string;
|
|
2914
|
-
blocks: any[];
|
|
2915
|
-
description?: string | undefined;
|
|
2916
|
-
}>;
|
|
2917
|
-
/**
|
|
2918
|
-
* Global configuration.
|
|
2919
|
-
*
|
|
2920
|
-
* @remarks
|
|
2921
|
-
* Global settings that apply across all pages.
|
|
2922
|
-
*
|
|
2923
|
-
* **General:**
|
|
2924
|
-
* - `title` - Application title
|
|
2925
|
-
* - `description` - Application description
|
|
2926
|
-
* - `defaultMapStyle` - Default map style for all maps
|
|
2927
|
-
* - `theme` - Default theme (light/dark)
|
|
2928
|
-
*
|
|
2929
|
-
* **Data Fetching:**
|
|
2930
|
-
* - `defaultStrategy` - Default fetch strategy (runtime, build, hybrid)
|
|
2931
|
-
* - `timeout` - Default fetch timeout
|
|
2932
|
-
* - `retryAttempts` - Default retry attempts
|
|
2933
|
-
*
|
|
2934
|
-
* @example Basic Config
|
|
2935
|
-
* ```yaml
|
|
2936
|
-
* config:
|
|
2937
|
-
* title: "My Map App"
|
|
2938
|
-
* description: "Interactive maps and stories"
|
|
2939
|
-
* defaultMapStyle: "https://demotiles.maplibre.org/style.json"
|
|
2940
|
-
* ```
|
|
2941
|
-
*
|
|
2942
|
-
* @example With Data Fetching
|
|
2943
|
-
* ```yaml
|
|
2944
|
-
* config:
|
|
2945
|
-
* title: "My Map App"
|
|
2946
|
-
* defaultMapStyle: "https://demotiles.maplibre.org/style.json"
|
|
2947
|
-
* theme: dark
|
|
2948
|
-
* dataFetching:
|
|
2949
|
-
* defaultStrategy: build
|
|
2950
|
-
* timeout: 15000
|
|
2951
|
-
* retryAttempts: 5
|
|
2952
|
-
* ```
|
|
2953
|
-
*/
|
|
2954
|
-
declare const GlobalConfigSchema: z.ZodObject<{
|
|
2955
|
-
title: z.ZodOptional<z.ZodString>;
|
|
2956
|
-
description: z.ZodOptional<z.ZodString>;
|
|
2957
|
-
defaultMapStyle: z.ZodOptional<z.ZodString>;
|
|
2958
|
-
theme: z.ZodDefault<z.ZodEnum<["light", "dark"]>>;
|
|
2959
|
-
dataFetching: z.ZodOptional<z.ZodObject<{
|
|
2960
|
-
defaultStrategy: z.ZodDefault<z.ZodEnum<["runtime", "build", "hybrid"]>>;
|
|
2961
|
-
timeout: z.ZodDefault<z.ZodNumber>;
|
|
2962
|
-
retryAttempts: z.ZodDefault<z.ZodNumber>;
|
|
2963
|
-
}, "strip", z.ZodTypeAny, {
|
|
2964
|
-
defaultStrategy: "runtime" | "build" | "hybrid";
|
|
2965
|
-
timeout: number;
|
|
2966
|
-
retryAttempts: number;
|
|
2967
|
-
}, {
|
|
2968
|
-
defaultStrategy?: "runtime" | "build" | "hybrid" | undefined;
|
|
2969
|
-
timeout?: number | undefined;
|
|
2970
|
-
retryAttempts?: number | undefined;
|
|
2971
|
-
}>>;
|
|
2972
|
-
}, "strip", z.ZodTypeAny, {
|
|
2973
|
-
theme: "light" | "dark";
|
|
2974
|
-
title?: string | undefined;
|
|
2975
|
-
description?: string | undefined;
|
|
2976
|
-
defaultMapStyle?: string | undefined;
|
|
2977
|
-
dataFetching?: {
|
|
2978
|
-
defaultStrategy: "runtime" | "build" | "hybrid";
|
|
2979
|
-
timeout: number;
|
|
2980
|
-
retryAttempts: number;
|
|
2981
|
-
} | undefined;
|
|
2982
|
-
}, {
|
|
2983
|
-
title?: string | undefined;
|
|
2984
|
-
description?: string | undefined;
|
|
2985
|
-
theme?: "light" | "dark" | undefined;
|
|
2986
|
-
defaultMapStyle?: string | undefined;
|
|
2987
|
-
dataFetching?: {
|
|
2988
|
-
defaultStrategy?: "runtime" | "build" | "hybrid" | undefined;
|
|
2989
|
-
timeout?: number | undefined;
|
|
2990
|
-
retryAttempts?: number | undefined;
|
|
2991
|
-
} | undefined;
|
|
2992
|
-
}>;
|
|
2993
|
-
/**
|
|
2994
|
-
* Root configuration schema.
|
|
2995
|
-
*
|
|
2996
|
-
* @remarks
|
|
2997
|
-
* The root schema represents the entire maplibre-yaml configuration.
|
|
2998
|
-
* This is the top-level structure for YAML files.
|
|
2999
|
-
*
|
|
3000
|
-
* **Structure:**
|
|
3001
|
-
* 1. `config` - Global settings (optional)
|
|
3002
|
-
* 2. `layers` - Named layer definitions for reuse (optional)
|
|
3003
|
-
* 3. `sources` - Named source definitions for reuse (optional)
|
|
3004
|
-
* 4. `pages` - Page definitions (required, minimum 1)
|
|
3005
|
-
*
|
|
3006
|
-
* **Global Layers and Sources:**
|
|
3007
|
-
* Define layers and sources once, reference them anywhere using `$ref`.
|
|
3008
|
-
*
|
|
3009
|
-
* @example Minimal Configuration
|
|
3010
|
-
* ```yaml
|
|
3011
|
-
* pages:
|
|
3012
|
-
* - path: "/"
|
|
3013
|
-
* title: "Home"
|
|
3014
|
-
* blocks:
|
|
3015
|
-
* - type: map
|
|
3016
|
-
* id: main-map
|
|
3017
|
-
* config:
|
|
3018
|
-
* center: [0, 0]
|
|
3019
|
-
* zoom: 2
|
|
3020
|
-
* mapStyle: "https://demotiles.maplibre.org/style.json"
|
|
3021
|
-
* ```
|
|
3022
|
-
*
|
|
3023
|
-
* @example With Global Config
|
|
3024
|
-
* ```yaml
|
|
3025
|
-
* config:
|
|
3026
|
-
* title: "My App"
|
|
3027
|
-
* defaultMapStyle: "https://demotiles.maplibre.org/style.json"
|
|
3028
|
-
*
|
|
3029
|
-
* pages:
|
|
3030
|
-
* - path: "/"
|
|
3031
|
-
* title: "Home"
|
|
3032
|
-
* blocks:
|
|
3033
|
-
* - type: map
|
|
3034
|
-
* id: main-map
|
|
3035
|
-
* config:
|
|
3036
|
-
* center: [0, 0]
|
|
3037
|
-
* zoom: 2
|
|
3038
|
-
* ```
|
|
3039
|
-
*
|
|
3040
|
-
* @example With Global Layers
|
|
3041
|
-
* ```yaml
|
|
3042
|
-
* config:
|
|
3043
|
-
* defaultMapStyle: "https://demotiles.maplibre.org/style.json"
|
|
3044
|
-
*
|
|
3045
|
-
* layers:
|
|
3046
|
-
* bikeLayer:
|
|
3047
|
-
* id: bikes
|
|
3048
|
-
* type: line
|
|
3049
|
-
* source:
|
|
3050
|
-
* type: geojson
|
|
3051
|
-
* url: "https://example.com/bikes.geojson"
|
|
3052
|
-
* paint:
|
|
3053
|
-
* line-color: "#00ff00"
|
|
3054
|
-
* line-width: 2
|
|
3055
|
-
*
|
|
3056
|
-
* parkLayer:
|
|
3057
|
-
* id: parks
|
|
3058
|
-
* type: fill
|
|
3059
|
-
* source:
|
|
3060
|
-
* type: geojson
|
|
3061
|
-
* url: "https://example.com/parks.geojson"
|
|
3062
|
-
* paint:
|
|
3063
|
-
* fill-color: "#228B22"
|
|
3064
|
-
* fill-opacity: 0.5
|
|
3065
|
-
*
|
|
3066
|
-
* pages:
|
|
3067
|
-
* - path: "/"
|
|
3068
|
-
* title: "Home"
|
|
3069
|
-
* blocks:
|
|
3070
|
-
* - type: map
|
|
3071
|
-
* id: main-map
|
|
3072
|
-
* config:
|
|
3073
|
-
* center: [-74.006, 40.7128]
|
|
3074
|
-
* zoom: 12
|
|
3075
|
-
* layers:
|
|
3076
|
-
* - $ref: "#/layers/bikeLayer"
|
|
3077
|
-
* - $ref: "#/layers/parkLayer"
|
|
3078
|
-
* ```
|
|
3079
|
-
*
|
|
3080
|
-
* @example With Global Sources
|
|
3081
|
-
* ```yaml
|
|
3082
|
-
* sources:
|
|
3083
|
-
* earthquakeSource:
|
|
3084
|
-
* type: geojson
|
|
3085
|
-
* url: "https://earthquake.usgs.gov/earthquakes/feed/v1.0/summary/all_day.geojson"
|
|
3086
|
-
* refreshInterval: 60000
|
|
3087
|
-
*
|
|
3088
|
-
* layers:
|
|
3089
|
-
* earthquakes:
|
|
3090
|
-
* id: earthquakes
|
|
3091
|
-
* type: circle
|
|
3092
|
-
* source: earthquakeSource
|
|
3093
|
-
* paint:
|
|
3094
|
-
* circle-radius: 8
|
|
3095
|
-
* circle-color: "#ff0000"
|
|
3096
|
-
*
|
|
3097
|
-
* pages:
|
|
3098
|
-
* - path: "/"
|
|
3099
|
-
* title: "Earthquakes"
|
|
3100
|
-
* blocks:
|
|
3101
|
-
* - type: map
|
|
3102
|
-
* id: quake-map
|
|
3103
|
-
* config:
|
|
3104
|
-
* center: [0, 0]
|
|
3105
|
-
* zoom: 2
|
|
3106
|
-
* mapStyle: "..."
|
|
3107
|
-
* layers:
|
|
3108
|
-
* - $ref: "#/layers/earthquakes"
|
|
3109
|
-
* ```
|
|
3110
|
-
*
|
|
3111
|
-
* @example Multi-Page Application
|
|
3112
|
-
* ```yaml
|
|
3113
|
-
* config:
|
|
3114
|
-
* title: "Multi-Page Map App"
|
|
3115
|
-
* defaultMapStyle: "https://demotiles.maplibre.org/style.json"
|
|
3116
|
-
*
|
|
3117
|
-
* pages:
|
|
3118
|
-
* - path: "/"
|
|
3119
|
-
* title: "Home"
|
|
3120
|
-
* blocks:
|
|
3121
|
-
* - type: content
|
|
3122
|
-
* content:
|
|
3123
|
-
* - h1: [{ str: "Welcome" }]
|
|
3124
|
-
*
|
|
3125
|
-
* - path: "/map"
|
|
3126
|
-
* title: "Interactive Map"
|
|
3127
|
-
* blocks:
|
|
3128
|
-
* - type: map
|
|
3129
|
-
* id: main-map
|
|
3130
|
-
* config:
|
|
3131
|
-
* center: [0, 0]
|
|
3132
|
-
* zoom: 2
|
|
3133
|
-
*
|
|
3134
|
-
* - path: "/story"
|
|
3135
|
-
* title: "Our Story"
|
|
3136
|
-
* blocks:
|
|
3137
|
-
* - type: scrollytelling
|
|
3138
|
-
* id: story
|
|
3139
|
-
* config:
|
|
3140
|
-
* center: [0, 0]
|
|
3141
|
-
* zoom: 2
|
|
3142
|
-
* chapters:
|
|
3143
|
-
* - id: intro
|
|
3144
|
-
* title: "Introduction"
|
|
3145
|
-
* center: [0, 0]
|
|
3146
|
-
* zoom: 3
|
|
3147
|
-
* ```
|
|
3148
|
-
*/
|
|
3149
|
-
declare const RootSchema: z.ZodType<any>;
|
|
3150
|
-
|
|
3151
|
-
export { BlockSchema, ChapterActionSchema, ChapterLayersSchema, ChapterSchema, ColorOrExpressionSchema, ColorSchema, ContentBlockSchema, ContentElementSchema, ContentItemSchema, ExpressionSchema, GeoJSONSourceSchema, GlobalConfigSchema, ImageSourceSchema, LatitudeSchema, LayerSourceSchema, LngLatBoundsSchema, LngLatSchema, LoadingConfigSchema, LongitudeSchema, MixedBlockSchema, NumberOrExpressionSchema, PageSchema, RasterSourceSchema, RootSchema, ScrollytellingBlockSchema, StreamConfigSchema, ValidTagNames, VectorSourceSchema, VideoSourceSchema, ZoomLevelSchema };
|
|
2744
|
+
export { ChapterActionSchema, ChapterLayersSchema, ChapterSchema, ColorOrExpressionSchema, ColorSchema, ContentBlockSchema, ContentElementSchema, ContentItemSchema, ExpressionSchema, GeoJSONSourceSchema, ImageSourceSchema, LatitudeSchema, LayerSourceSchema, LngLatBoundsSchema, LngLatSchema, LoadingConfigSchema, LongitudeSchema, NumberOrExpressionSchema, RasterSourceSchema, ScrollytellingBlockSchema, StreamConfigSchema, ValidTagNames, VectorSourceSchema, VideoSourceSchema, ZoomLevelSchema };
|
package/dist/schemas/index.js
CHANGED
|
@@ -80,7 +80,9 @@ var GeoJSONSourceSchema = z.object({
|
|
|
80
80
|
"Polling refresh configuration"
|
|
81
81
|
),
|
|
82
82
|
// Legacy support for direct refresh properties
|
|
83
|
-
refreshInterval: z.number().min(1e3).optional().describe(
|
|
83
|
+
refreshInterval: z.number().min(1e3).optional().describe(
|
|
84
|
+
"Polling interval in milliseconds (legacy, use refresh.refreshInterval)"
|
|
85
|
+
),
|
|
84
86
|
updateStrategy: z.enum(["replace", "merge", "append-window"]).optional().describe("Update strategy (legacy, use refresh.updateStrategy)"),
|
|
85
87
|
updateKey: z.string().optional().describe("Update key (legacy, use refresh.updateKey)"),
|
|
86
88
|
loading: LoadingConfigSchema.optional().describe(
|
|
@@ -89,7 +91,7 @@ var GeoJSONSourceSchema = z.object({
|
|
|
89
91
|
cache: CacheConfigSchema.optional().describe("Cache configuration"),
|
|
90
92
|
// MapLibre clustering options
|
|
91
93
|
cluster: z.boolean().optional().describe("Enable point clustering"),
|
|
92
|
-
clusterRadius: z.number().int().min(0).
|
|
94
|
+
clusterRadius: z.number().int().min(0).optional().describe("Cluster radius in pixels (default: 50)"),
|
|
93
95
|
clusterMaxZoom: z.number().min(0).max(24).optional().describe("Maximum zoom level to cluster points"),
|
|
94
96
|
clusterMinPoints: z.number().int().min(2).optional().describe("Minimum points to form a cluster"),
|
|
95
97
|
clusterProperties: z.record(z.any()).optional().describe("Aggregate cluster properties"),
|