@versatiles/svg-renderer 1.0.0 → 1.1.0
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/index.cjs +31 -14
- package/dist/index.js +31 -14
- package/dist/maplibre-svg-export.js +31 -14
- package/dist/maplibre-svg-export.umd.js +31 -14
- package/package.json +18 -17
package/dist/index.cjs
CHANGED
|
@@ -449,19 +449,28 @@ var v8_default = {
|
|
|
449
449
|
},
|
|
450
450
|
"property-type": "data-constant"
|
|
451
451
|
} },
|
|
452
|
-
"layout_fill-extrusion": {
|
|
453
|
-
"
|
|
454
|
-
|
|
455
|
-
"
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
"
|
|
461
|
-
|
|
452
|
+
"layout_fill-extrusion": {
|
|
453
|
+
"visibility": {
|
|
454
|
+
"type": "enum",
|
|
455
|
+
"values": {
|
|
456
|
+
"visible": {},
|
|
457
|
+
"none": {}
|
|
458
|
+
},
|
|
459
|
+
"default": "visible",
|
|
460
|
+
"expression": {
|
|
461
|
+
"interpolated": false,
|
|
462
|
+
"parameters": ["global-state"]
|
|
463
|
+
},
|
|
464
|
+
"property-type": "data-constant"
|
|
462
465
|
},
|
|
463
|
-
"
|
|
464
|
-
|
|
466
|
+
"fill-extrusion-rounded-corner-distance": {
|
|
467
|
+
"type": "number",
|
|
468
|
+
"default": 0,
|
|
469
|
+
"minimum": 0,
|
|
470
|
+
"units": "meters",
|
|
471
|
+
"property-type": "constant"
|
|
472
|
+
}
|
|
473
|
+
},
|
|
465
474
|
layout_line: {
|
|
466
475
|
"line-cap": {
|
|
467
476
|
"type": "enum",
|
|
@@ -4499,7 +4508,11 @@ var Coercion = class Coercion {
|
|
|
4499
4508
|
}
|
|
4500
4509
|
case "formatted": return Formatted.fromString(valueToString(this.args[0].evaluate(ctx)));
|
|
4501
4510
|
case "resolvedImage": return ResolvedImage.fromString(valueToString(this.args[0].evaluate(ctx)));
|
|
4502
|
-
case "projectionDefinition":
|
|
4511
|
+
case "projectionDefinition": {
|
|
4512
|
+
const input = this.args[0].evaluate(ctx);
|
|
4513
|
+
if (ProjectionDefinition.parse(input)) return input;
|
|
4514
|
+
throw new RuntimeError(`Could not parse projectionDefinition from value '${typeof input === "string" ? input : JSON.stringify(input)}'`, this.key);
|
|
4515
|
+
}
|
|
4503
4516
|
default: return valueToString(this.args[0].evaluate(ctx));
|
|
4504
4517
|
}
|
|
4505
4518
|
}
|
|
@@ -4602,7 +4615,11 @@ var ParsingContext = class ParsingContext {
|
|
|
4602
4615
|
const expected = this.expectedType;
|
|
4603
4616
|
const actual = parsed.type;
|
|
4604
4617
|
if ((expected.kind === "string" || expected.kind === "number" || expected.kind === "boolean" || expected.kind === "object" || expected.kind === "array") && actual.kind === "value") parsed = annotate(parsed, expected, options.typeAnnotation || "assert");
|
|
4605
|
-
else if ("projectionDefinition" === expected.kind && [
|
|
4618
|
+
else if ("projectionDefinition" === expected.kind && [
|
|
4619
|
+
"string",
|
|
4620
|
+
"array",
|
|
4621
|
+
"value"
|
|
4622
|
+
].includes(actual.kind) || [
|
|
4606
4623
|
"color",
|
|
4607
4624
|
"formatted",
|
|
4608
4625
|
"resolvedImage"
|
package/dist/index.js
CHANGED
|
@@ -447,19 +447,28 @@ var v8_default = {
|
|
|
447
447
|
},
|
|
448
448
|
"property-type": "data-constant"
|
|
449
449
|
} },
|
|
450
|
-
"layout_fill-extrusion": {
|
|
451
|
-
"
|
|
452
|
-
|
|
453
|
-
"
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
"
|
|
459
|
-
|
|
450
|
+
"layout_fill-extrusion": {
|
|
451
|
+
"visibility": {
|
|
452
|
+
"type": "enum",
|
|
453
|
+
"values": {
|
|
454
|
+
"visible": {},
|
|
455
|
+
"none": {}
|
|
456
|
+
},
|
|
457
|
+
"default": "visible",
|
|
458
|
+
"expression": {
|
|
459
|
+
"interpolated": false,
|
|
460
|
+
"parameters": ["global-state"]
|
|
461
|
+
},
|
|
462
|
+
"property-type": "data-constant"
|
|
460
463
|
},
|
|
461
|
-
"
|
|
462
|
-
|
|
464
|
+
"fill-extrusion-rounded-corner-distance": {
|
|
465
|
+
"type": "number",
|
|
466
|
+
"default": 0,
|
|
467
|
+
"minimum": 0,
|
|
468
|
+
"units": "meters",
|
|
469
|
+
"property-type": "constant"
|
|
470
|
+
}
|
|
471
|
+
},
|
|
463
472
|
layout_line: {
|
|
464
473
|
"line-cap": {
|
|
465
474
|
"type": "enum",
|
|
@@ -4497,7 +4506,11 @@ var Coercion = class Coercion {
|
|
|
4497
4506
|
}
|
|
4498
4507
|
case "formatted": return Formatted.fromString(valueToString(this.args[0].evaluate(ctx)));
|
|
4499
4508
|
case "resolvedImage": return ResolvedImage.fromString(valueToString(this.args[0].evaluate(ctx)));
|
|
4500
|
-
case "projectionDefinition":
|
|
4509
|
+
case "projectionDefinition": {
|
|
4510
|
+
const input = this.args[0].evaluate(ctx);
|
|
4511
|
+
if (ProjectionDefinition.parse(input)) return input;
|
|
4512
|
+
throw new RuntimeError(`Could not parse projectionDefinition from value '${typeof input === "string" ? input : JSON.stringify(input)}'`, this.key);
|
|
4513
|
+
}
|
|
4501
4514
|
default: return valueToString(this.args[0].evaluate(ctx));
|
|
4502
4515
|
}
|
|
4503
4516
|
}
|
|
@@ -4600,7 +4613,11 @@ var ParsingContext = class ParsingContext {
|
|
|
4600
4613
|
const expected = this.expectedType;
|
|
4601
4614
|
const actual = parsed.type;
|
|
4602
4615
|
if ((expected.kind === "string" || expected.kind === "number" || expected.kind === "boolean" || expected.kind === "object" || expected.kind === "array") && actual.kind === "value") parsed = annotate(parsed, expected, options.typeAnnotation || "assert");
|
|
4603
|
-
else if ("projectionDefinition" === expected.kind && [
|
|
4616
|
+
else if ("projectionDefinition" === expected.kind && [
|
|
4617
|
+
"string",
|
|
4618
|
+
"array",
|
|
4619
|
+
"value"
|
|
4620
|
+
].includes(actual.kind) || [
|
|
4604
4621
|
"color",
|
|
4605
4622
|
"formatted",
|
|
4606
4623
|
"resolvedImage"
|
|
@@ -628,19 +628,28 @@ var v8_default = {
|
|
|
628
628
|
},
|
|
629
629
|
"property-type": "data-constant"
|
|
630
630
|
} },
|
|
631
|
-
"layout_fill-extrusion": {
|
|
632
|
-
"
|
|
633
|
-
|
|
634
|
-
"
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
"
|
|
640
|
-
|
|
631
|
+
"layout_fill-extrusion": {
|
|
632
|
+
"visibility": {
|
|
633
|
+
"type": "enum",
|
|
634
|
+
"values": {
|
|
635
|
+
"visible": {},
|
|
636
|
+
"none": {}
|
|
637
|
+
},
|
|
638
|
+
"default": "visible",
|
|
639
|
+
"expression": {
|
|
640
|
+
"interpolated": false,
|
|
641
|
+
"parameters": ["global-state"]
|
|
642
|
+
},
|
|
643
|
+
"property-type": "data-constant"
|
|
641
644
|
},
|
|
642
|
-
"
|
|
643
|
-
|
|
645
|
+
"fill-extrusion-rounded-corner-distance": {
|
|
646
|
+
"type": "number",
|
|
647
|
+
"default": 0,
|
|
648
|
+
"minimum": 0,
|
|
649
|
+
"units": "meters",
|
|
650
|
+
"property-type": "constant"
|
|
651
|
+
}
|
|
652
|
+
},
|
|
644
653
|
layout_line: {
|
|
645
654
|
"line-cap": {
|
|
646
655
|
"type": "enum",
|
|
@@ -4678,7 +4687,11 @@ var Coercion = class Coercion {
|
|
|
4678
4687
|
}
|
|
4679
4688
|
case "formatted": return Formatted.fromString(valueToString(this.args[0].evaluate(ctx)));
|
|
4680
4689
|
case "resolvedImage": return ResolvedImage.fromString(valueToString(this.args[0].evaluate(ctx)));
|
|
4681
|
-
case "projectionDefinition":
|
|
4690
|
+
case "projectionDefinition": {
|
|
4691
|
+
const input = this.args[0].evaluate(ctx);
|
|
4692
|
+
if (ProjectionDefinition.parse(input)) return input;
|
|
4693
|
+
throw new RuntimeError(`Could not parse projectionDefinition from value '${typeof input === "string" ? input : JSON.stringify(input)}'`, this.key);
|
|
4694
|
+
}
|
|
4682
4695
|
default: return valueToString(this.args[0].evaluate(ctx));
|
|
4683
4696
|
}
|
|
4684
4697
|
}
|
|
@@ -4781,7 +4794,11 @@ var ParsingContext = class ParsingContext {
|
|
|
4781
4794
|
const expected = this.expectedType;
|
|
4782
4795
|
const actual = parsed.type;
|
|
4783
4796
|
if ((expected.kind === "string" || expected.kind === "number" || expected.kind === "boolean" || expected.kind === "object" || expected.kind === "array") && actual.kind === "value") parsed = annotate(parsed, expected, options.typeAnnotation || "assert");
|
|
4784
|
-
else if ("projectionDefinition" === expected.kind && [
|
|
4797
|
+
else if ("projectionDefinition" === expected.kind && [
|
|
4798
|
+
"string",
|
|
4799
|
+
"array",
|
|
4800
|
+
"value"
|
|
4801
|
+
].includes(actual.kind) || [
|
|
4785
4802
|
"color",
|
|
4786
4803
|
"formatted",
|
|
4787
4804
|
"resolvedImage"
|
|
@@ -634,19 +634,28 @@
|
|
|
634
634
|
},
|
|
635
635
|
"property-type": "data-constant"
|
|
636
636
|
} },
|
|
637
|
-
"layout_fill-extrusion": {
|
|
638
|
-
"
|
|
639
|
-
|
|
640
|
-
"
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
"
|
|
646
|
-
|
|
637
|
+
"layout_fill-extrusion": {
|
|
638
|
+
"visibility": {
|
|
639
|
+
"type": "enum",
|
|
640
|
+
"values": {
|
|
641
|
+
"visible": {},
|
|
642
|
+
"none": {}
|
|
643
|
+
},
|
|
644
|
+
"default": "visible",
|
|
645
|
+
"expression": {
|
|
646
|
+
"interpolated": false,
|
|
647
|
+
"parameters": ["global-state"]
|
|
648
|
+
},
|
|
649
|
+
"property-type": "data-constant"
|
|
647
650
|
},
|
|
648
|
-
"
|
|
649
|
-
|
|
651
|
+
"fill-extrusion-rounded-corner-distance": {
|
|
652
|
+
"type": "number",
|
|
653
|
+
"default": 0,
|
|
654
|
+
"minimum": 0,
|
|
655
|
+
"units": "meters",
|
|
656
|
+
"property-type": "constant"
|
|
657
|
+
}
|
|
658
|
+
},
|
|
650
659
|
layout_line: {
|
|
651
660
|
"line-cap": {
|
|
652
661
|
"type": "enum",
|
|
@@ -4684,7 +4693,11 @@
|
|
|
4684
4693
|
}
|
|
4685
4694
|
case "formatted": return Formatted.fromString(valueToString(this.args[0].evaluate(ctx)));
|
|
4686
4695
|
case "resolvedImage": return ResolvedImage.fromString(valueToString(this.args[0].evaluate(ctx)));
|
|
4687
|
-
case "projectionDefinition":
|
|
4696
|
+
case "projectionDefinition": {
|
|
4697
|
+
const input = this.args[0].evaluate(ctx);
|
|
4698
|
+
if (ProjectionDefinition.parse(input)) return input;
|
|
4699
|
+
throw new RuntimeError(`Could not parse projectionDefinition from value '${typeof input === "string" ? input : JSON.stringify(input)}'`, this.key);
|
|
4700
|
+
}
|
|
4688
4701
|
default: return valueToString(this.args[0].evaluate(ctx));
|
|
4689
4702
|
}
|
|
4690
4703
|
}
|
|
@@ -4787,7 +4800,11 @@
|
|
|
4787
4800
|
const expected = this.expectedType;
|
|
4788
4801
|
const actual = parsed.type;
|
|
4789
4802
|
if ((expected.kind === "string" || expected.kind === "number" || expected.kind === "boolean" || expected.kind === "object" || expected.kind === "array") && actual.kind === "value") parsed = annotate(parsed, expected, options.typeAnnotation || "assert");
|
|
4790
|
-
else if ("projectionDefinition" === expected.kind && [
|
|
4803
|
+
else if ("projectionDefinition" === expected.kind && [
|
|
4804
|
+
"string",
|
|
4805
|
+
"array",
|
|
4806
|
+
"value"
|
|
4807
|
+
].includes(actual.kind) || [
|
|
4791
4808
|
"color",
|
|
4792
4809
|
"formatted",
|
|
4793
4810
|
"resolvedImage"
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@versatiles/svg-renderer",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.1.0",
|
|
4
4
|
"description": "Renders vector maps as SVG.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"svg",
|
|
@@ -83,31 +83,32 @@
|
|
|
83
83
|
"devDependencies": {
|
|
84
84
|
"@eslint/js": "^10.0.1",
|
|
85
85
|
"@mapbox/vector-tile": "^3.0.0",
|
|
86
|
-
"@maplibre/maplibre-gl-style-spec": "^26.1
|
|
86
|
+
"@maplibre/maplibre-gl-style-spec": "^26.2.1",
|
|
87
87
|
"@rollup/plugin-node-resolve": "^16.0.3",
|
|
88
88
|
"@rollup/plugin-typescript": "^12.3.0",
|
|
89
|
-
"@types/node": "^26.
|
|
89
|
+
"@types/node": "^26.2.0",
|
|
90
90
|
"@types/pbf": "^3.0.5",
|
|
91
91
|
"@types/pngjs": "^6.0.5",
|
|
92
|
-
"@versatiles/release-tool": "^2.
|
|
93
|
-
"@versatiles/style": "^5.13.
|
|
92
|
+
"@versatiles/release-tool": "^2.9.0",
|
|
93
|
+
"@versatiles/style": "^5.13.1",
|
|
94
94
|
"@vitest/coverage-v8": "^4.1.10",
|
|
95
|
-
"eslint": "^10.
|
|
95
|
+
"eslint": "^10.8.1",
|
|
96
96
|
"geojson": "^0.5.0",
|
|
97
|
-
"jsdom": "^
|
|
98
|
-
"maplibre-gl": "^
|
|
99
|
-
"npm-check-updates": "^
|
|
97
|
+
"jsdom": "^30.0.1",
|
|
98
|
+
"maplibre-gl": "^6.3.0",
|
|
99
|
+
"npm-check-updates": "^23.0.2",
|
|
100
100
|
"pbf": "^5.1.2",
|
|
101
101
|
"pixelmatch": "^7.2.0",
|
|
102
|
-
"playwright": "^1.
|
|
102
|
+
"playwright": "^1.62.1",
|
|
103
103
|
"pngjs": "^7.0.0",
|
|
104
|
-
"prettier": "^3.9.
|
|
105
|
-
"rollup": "^4.62.
|
|
106
|
-
"rollup-plugin-dts": "^6.
|
|
107
|
-
"rollup-plugin-visualizer": "^7.
|
|
108
|
-
"
|
|
109
|
-
"
|
|
110
|
-
"typescript
|
|
104
|
+
"prettier": "^3.9.6",
|
|
105
|
+
"rollup": "^4.62.4",
|
|
106
|
+
"rollup-plugin-dts": "^6.5.1",
|
|
107
|
+
"rollup-plugin-visualizer": "^7.1.1",
|
|
108
|
+
"tslib": "^2.8.1",
|
|
109
|
+
"tsx": "^4.23.12",
|
|
110
|
+
"typescript": "^6.0.3",
|
|
111
|
+
"typescript-eslint": "^8.67.0",
|
|
111
112
|
"vitest": "^4.1.10"
|
|
112
113
|
},
|
|
113
114
|
"allowScripts": {
|