@tileflow/core 0.1.0-alpha.7 → 0.1.0-alpha.8

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 CHANGED
@@ -3,9 +3,14 @@
3
3
  Typed Tileflow config helpers and the MapLibre style compiler.
4
4
 
5
5
  ```ts
6
- import {defineTileflow, osm, roads} from '@tileflow/core';
6
+ import {defineTileflow, labels, osm, poi} from '@tileflow/core';
7
7
 
8
8
  export default defineTileflow({
9
+ icons: {
10
+ brand: {
11
+ sprite: 'https://cdn.example.com/tileflow/brand/sprite',
12
+ },
13
+ },
9
14
  themes: {
10
15
  light: {
11
16
  colors: {
@@ -16,25 +21,41 @@ export default defineTileflow({
16
21
  building: '#EEF0F2',
17
22
  road: '#FFFFFF',
18
23
  roadMajor: '#F5D58A',
24
+ roadCasing: '#DDE0E3',
19
25
  boundary: '#C9CED3',
20
26
  text: '#566371',
21
27
  textMuted: '#8A98A8',
22
28
  textHalo: '#FFFFFF',
23
29
  },
24
30
  modules: {
31
+ labels: {
32
+ road: '#7A8794',
33
+ water: '#4B8FA8',
34
+ },
35
+ poi: {
36
+ food: '#D97706',
37
+ transit: '#2563EB',
38
+ },
25
39
  roads: {
26
40
  motorway: '#F7C56F',
27
41
  },
28
42
  },
43
+ typography: {
44
+ font: 'Inter',
45
+ },
29
46
  },
30
47
  },
31
48
  maps: {
32
49
  madrid: {
33
50
  basemap: osm(),
51
+ icons: 'brand',
34
52
  theme: 'light',
35
- modules: [roads({preset: 'modern', density: 'balanced'})],
53
+ modules: [
54
+ labels({roads: 'minimal'}),
55
+ poi({categories: ['food', 'coffee', 'culture', 'transit'], icons: 'essential'}),
56
+ ],
36
57
  layers: {
37
- 'roads-major': {
58
+ 'highway-primary': {
38
59
  paint: {
39
60
  'line-opacity': 0.9,
40
61
  },
@@ -49,4 +70,36 @@ export default defineTileflow({
49
70
  });
50
71
  ```
51
72
 
73
+ ## Style contract
74
+
75
+ Tileflow keeps these levels separate:
76
+
77
+ - `basemap: osm()` chooses the source defaults, glyphs, sprites, and OSM Bright layer template.
78
+ - `theme.colors` contains human-scale base tokens such as `water`, `park`, `road`, `roadMajor`, `roadCasing`, `text`, and `textHalo`.
79
+ - `theme.modules.<name>` contains advanced, module-specific tokens. These are granular: setting `theme.modules.roads.rail` does not recolor primary roads.
80
+ - `maps.<name>.icons` can point at a reusable root icon set, a hosted MapLibre sprite URL, or a local icon folder for Vite/build output.
81
+ - `maps.<name>.modules` enables semantic modules such as `labels()` and `poi()`, plus generated modules such as `roads()`.
82
+ - `layers` is the raw MapLibre escape hatch for exact layer patches.
83
+
84
+ Missing colors preserve the basemap default. Legacy aliases such as `accent`, `canvas`, `greenspace`, `fontFamily`, and `fonts` are accepted for compatibility but are not the recommended API.
85
+
86
+ ## Public API
87
+
88
+ Use the package root only:
89
+
90
+ ```ts
91
+ import {
92
+ createStyle,
93
+ defineTileflow,
94
+ labels,
95
+ osm,
96
+ poi,
97
+ roads,
98
+ styleOverride,
99
+ validateConfig,
100
+ } from '@tileflow/core';
101
+ ```
102
+
103
+ Subpaths under `src/`, `themes/`, `templates/`, and `modules/` are internal implementation details and can change during alpha releases.
104
+
52
105
  Docs: https://tileflow.dev/docs