@versatiles/style 5.2.2 → 5.2.4

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.
Files changed (56) hide show
  1. package/README.MD +13 -89
  2. package/dist/color/abstract.d.ts +6 -5
  3. package/dist/color/abstract.js +4 -0
  4. package/dist/color/hsl.d.ts +8 -8
  5. package/dist/color/hsl.js +17 -22
  6. package/dist/color/hsv.d.ts +8 -7
  7. package/dist/color/hsv.js +10 -11
  8. package/dist/color/index.d.ts +5 -5
  9. package/dist/color/index.js +16 -13
  10. package/dist/color/random.d.ts +1 -1
  11. package/dist/color/random.js +3 -2
  12. package/dist/color/rgb.d.ts +8 -8
  13. package/dist/color/rgb.js +25 -50
  14. package/dist/color/utils.js +1 -0
  15. package/dist/guess_style/guess_style.d.ts +1 -1
  16. package/dist/guess_style/guess_style.js +6 -5
  17. package/dist/guess_style/index.d.ts +2 -2
  18. package/dist/guess_style/index.js +2 -1
  19. package/dist/index.d.ts +15 -11
  20. package/dist/index.js +11 -3
  21. package/dist/lib/utils.js +2 -1
  22. package/dist/shortbread/index.d.ts +2 -2
  23. package/dist/shortbread/index.js +3 -2
  24. package/dist/shortbread/layers.d.ts +2 -2
  25. package/dist/shortbread/layers.js +1 -0
  26. package/dist/shortbread/properties.js +1 -0
  27. package/dist/shortbread/template.js +1 -0
  28. package/dist/style_builder/decorator.d.ts +3 -3
  29. package/dist/style_builder/decorator.js +4 -3
  30. package/dist/style_builder/recolor.d.ts +1 -1
  31. package/dist/style_builder/recolor.js +2 -1
  32. package/dist/style_builder/style_builder.d.ts +11 -11
  33. package/dist/style_builder/style_builder.js +14 -11
  34. package/dist/style_builder/types.d.ts +100 -19
  35. package/dist/style_builder/types.js +2 -0
  36. package/dist/styles/colorful.d.ts +5 -88
  37. package/dist/styles/colorful.js +2 -1
  38. package/dist/styles/eclipse.d.ts +1 -1
  39. package/dist/styles/eclipse.js +2 -1
  40. package/dist/styles/empty.d.ts +4 -9
  41. package/dist/styles/empty.js +4 -9
  42. package/dist/styles/graybeard.d.ts +1 -1
  43. package/dist/styles/graybeard.js +2 -1
  44. package/dist/styles/index.d.ts +10 -27
  45. package/dist/styles/index.js +6 -5
  46. package/dist/styles/neutrino.d.ts +5 -30
  47. package/dist/styles/neutrino.js +35 -4
  48. package/dist/types/index.d.ts +5 -5
  49. package/dist/types/index.js +3 -2
  50. package/dist/types/maplibre.js +1 -0
  51. package/dist/types/tilejson.d.ts +1 -1
  52. package/dist/types/tilejson.js +1 -0
  53. package/dist/types/vector_layer.js +1 -0
  54. package/package.json +11 -8
  55. package/dist/style_builder/index.d.ts +0 -1
  56. package/dist/style_builder/index.js +0 -1
@@ -1,5 +1,5 @@
1
- import { StyleBuilder } from '../style_builder/style_builder.js';
2
- export default class Neutrino extends StyleBuilder {
1
+ import Colorful from './colorful';
2
+ export default class Neutrino extends Colorful {
3
3
  name = 'Neutrino';
4
4
  defaultFonts = {
5
5
  regular: 'noto_sans_regular',
@@ -17,7 +17,7 @@ export default class Neutrino extends StyleBuilder {
17
17
  /** Color used for agricultural land. */
18
18
  agriculture: '#f8eeee',
19
19
  /** Color for site areas such as parks or recreational facilities. */
20
- site: '#ebe8e6',
20
+ commercial: '#ebe8e6',
21
21
  /** Primary color for buildings. */
22
22
  building: '#e0d1d9',
23
23
  /** Color for streets and roads. */
@@ -30,6 +30,36 @@ export default class Neutrino extends StyleBuilder {
30
30
  rail: '#e8d5e0',
31
31
  /** Primary color used for text labels. */
32
32
  label: '#cbb7b7',
33
+ // Don't need these colors:
34
+ buildingbg: '#000',
35
+ burial: '#000',
36
+ construction: '#000',
37
+ cycle: '#000',
38
+ danger: '#000',
39
+ disputed: '#000',
40
+ education: '#000',
41
+ glacier: '#000',
42
+ hospital: '#000',
43
+ industrial: '#000',
44
+ labelHalo: '#000',
45
+ leisure: '#000',
46
+ motorway: '#000',
47
+ motorwaybg: '#000',
48
+ park: '#000',
49
+ parking: '#000',
50
+ poi: '#000',
51
+ prison: '#000',
52
+ residential: '#000',
53
+ rock: '#000',
54
+ sand: '#000',
55
+ shield: '#000',
56
+ streetbg: '#000',
57
+ subway: '#000',
58
+ symbol: '#000',
59
+ trunk: '#000',
60
+ trunkbg: '#000',
61
+ waste: '#000',
62
+ wetland: '#000',
33
63
  };
34
64
  getStyleRules(options) {
35
65
  const { colors, fonts } = options;
@@ -103,7 +133,7 @@ export default class Neutrino extends StyleBuilder {
103
133
  opacity: { 10: 0, 11: 1 },
104
134
  },
105
135
  'site-{bicycleparking,parking}': {
106
- color: colors.site,
136
+ color: colors.commercial,
107
137
  },
108
138
  'building': {
109
139
  color: colors.building,
@@ -368,3 +398,4 @@ export default class Neutrino extends StyleBuilder {
368
398
  };
369
399
  }
370
400
  }
401
+ //# sourceMappingURL=neutrino.js.map
@@ -1,5 +1,5 @@
1
- export type { MaplibreLayerDefinition, MaplibreLayer } from './maplibre.js';
2
- export type { VectorLayer } from './vector_layer.js';
3
- export { isTileJSONSpecification } from './tilejson.js';
4
- export type { TileJSONSpecification, TileJSONSpecificationRaster, TileJSONSpecificationVector } from './tilejson.js';
5
- export { isVectorLayers } from './vector_layer.js';
1
+ export type { MaplibreLayerDefinition, MaplibreLayer } from './maplibre';
2
+ export type { VectorLayer } from './vector_layer';
3
+ export { isTileJSONSpecification } from './tilejson';
4
+ export type { TileJSONSpecification, TileJSONSpecificationRaster, TileJSONSpecificationVector } from './tilejson';
5
+ export { isVectorLayers } from './vector_layer';
@@ -1,2 +1,3 @@
1
- export { isTileJSONSpecification } from './tilejson.js';
2
- export { isVectorLayers } from './vector_layer.js';
1
+ export { isTileJSONSpecification } from './tilejson';
2
+ export { isVectorLayers } from './vector_layer';
3
+ //# sourceMappingURL=index.js.map
@@ -1 +1,2 @@
1
1
  export {};
2
+ //# sourceMappingURL=maplibre.js.map
@@ -1,4 +1,4 @@
1
- import type { VectorLayer } from './vector_layer.js';
1
+ import type { VectorLayer } from './vector_layer';
2
2
  /** Basic structure for TileJSON specification, applicable to both raster and vector types. */
3
3
  export interface TileJSONSpecificationRaster {
4
4
  tilejson?: '3.0.0';
@@ -84,3 +84,4 @@ export function isRasterTileJSONSpecification(spec) {
84
84
  return false;
85
85
  return true;
86
86
  }
87
+ //# sourceMappingURL=tilejson.js.map
@@ -48,3 +48,4 @@ export function isVectorLayers(layers) {
48
48
  });
49
49
  return true;
50
50
  }
51
+ //# sourceMappingURL=vector_layer.js.map
package/package.json CHANGED
@@ -1,18 +1,18 @@
1
1
  {
2
2
  "name": "@versatiles/style",
3
- "version": "5.2.2",
3
+ "version": "5.2.4",
4
4
  "description": "Generate StyleJSON for MapLibre",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
7
7
  "scripts": {
8
8
  "check": "npm run lint && npm run test && npm run build",
9
- "build": "rm -rf release; npm run build-browser && npm run build-node && npm run build-styles && npm run build-sprites",
9
+ "build": "rm -rf release; npm run build-browser && npm run build-node && npm run build-styles && npm run build-sprites && npm run doc",
10
10
  "build-browser": "rollup -c=rollup.config.js && $(cd release/versatiles-style; tar -cf - versatiles-style.* | gzip -9 > ../versatiles-style.tar.gz)",
11
11
  "build-node": "rm -rf dist && tsc -p tsconfig.node.json && chmod +x dist/index.js",
12
12
  "build-styles": "tsx scripts/build-styles.ts",
13
13
  "build-sprites": "tsx scripts/build-sprites.ts",
14
14
  "dev": "tsx scripts/dev.ts",
15
- "// doc": "vrt ts2md src/index.ts tsconfig.node.json | vrt insertmd README.md '# API'",
15
+ "doc": "tsx scripts/screenshots.ts && typedoc --options typedoc.json",
16
16
  "lint": "eslint --color .",
17
17
  "prepack": "npm run build",
18
18
  "release": "npx vrt release-npm",
@@ -36,6 +36,7 @@
36
36
  "dist/**/*.d.ts"
37
37
  ],
38
38
  "devDependencies": {
39
+ "@maplibre/maplibre-gl-native": "^6.0.0",
39
40
  "@maplibre/maplibre-gl-style-spec": "^23.1.0",
40
41
  "@rollup/plugin-commonjs": "^28.0.2",
41
42
  "@rollup/plugin-node-resolve": "^16.0.0",
@@ -45,10 +46,10 @@
45
46
  "@types/brace-expansion": "^1.1.2",
46
47
  "@types/inquirer": "^9.0.7",
47
48
  "@types/jest": "^29.5.14",
48
- "@types/node": "^22.10.7",
49
+ "@types/node": "^22.10.10",
49
50
  "@types/tar-stream": "^3.1.3",
50
- "@typescript-eslint/eslint-plugin": "^8.20.0",
51
- "@typescript-eslint/parser": "^8.20.0",
51
+ "@typescript-eslint/eslint-plugin": "^8.21.0",
52
+ "@typescript-eslint/parser": "^8.21.0",
52
53
  "@versatiles/release-tool": "^1.2.6",
53
54
  "bin-pack": "^1.0.2",
54
55
  "eslint": "^9.18.0",
@@ -57,14 +58,16 @@
57
58
  "jest-environment-jsdom": "^29.7.0",
58
59
  "jest-ts-webcompat-resolver": "^1.0.0",
59
60
  "npm-check-updates": "^17.1.14",
60
- "rollup": "^4.30.1",
61
+ "rollup": "^4.32.0",
61
62
  "rollup-plugin-dts": "^6.1.1",
62
63
  "sharp": "^0.33.5",
63
64
  "tar-stream": "^3.1.7",
64
65
  "ts-jest": "^29.2.5",
65
66
  "ts-node": "^10.9.2",
66
67
  "tsx": "^4.19.2",
68
+ "typedoc": "^0.27.6",
69
+ "typedoc-plugin-markdown": "^4.4.1",
67
70
  "typescript": "^5.7.3",
68
- "typescript-eslint": "^8.20.0"
71
+ "typescript-eslint": "^8.21.0"
69
72
  }
70
73
  }
@@ -1 +0,0 @@
1
- export type { Language } from './types.js';
@@ -1 +0,0 @@
1
- export {};