@geoinsight/react-components 1.0.4 → 1.0.6
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/.pnp.cjs +2014 -3638
- package/.yarn/install-state.gz +0 -0
- package/.yarn/unplugged/{@swc-core-linux-x64-gnu-npm-1.3.106-7bb327124d → @swc-core-linux-x64-gnu-npm-1.4.0-07735121da}/node_modules/@swc/core-linux-x64-gnu/package.json +1 -1
- package/.yarn/unplugged/{@swc-core-linux-x64-gnu-npm-1.3.106-7bb327124d → @swc-core-linux-x64-gnu-npm-1.4.0-07735121da}/node_modules/@swc/core-linux-x64-gnu/swc.linux-x64-gnu.node +0 -0
- package/.yarn/unplugged/{@swc-core-virtual-22cde85fc1 → @swc-core-virtual-a4869543ec}/node_modules/@swc/core/CHANGELOG.md +70 -85
- package/.yarn/unplugged/{@swc-core-virtual-22cde85fc1 → @swc-core-virtual-a4869543ec}/node_modules/@swc/core/package.json +11 -11
- package/dist/cjs/components/button/index.stories.d.ts +12 -9
- package/dist/cjs/components/map/map-mapbox.d.ts +0 -1
- package/dist/cjs/index.css +67 -184
- package/dist/cjs/index.d.ts +0 -3
- package/dist/cjs/index.js +47 -213
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/components/button/index.stories.d.ts +12 -9
- package/dist/esm/components/map/map-mapbox.d.ts +0 -1
- package/dist/esm/index.css +67 -184
- package/dist/esm/index.d.ts +0 -3
- package/dist/esm/index.js +49 -192
- package/dist/esm/index.js.map +1 -1
- package/package.json +1 -5
- package/.yarn/unplugged/maplibre-gl-npm-2.4.0-9fa603cf50/node_modules/maplibre-gl/.ready +0 -0
- package/.yarn/unplugged/maplibre-gl-npm-2.4.0-9fa603cf50/node_modules/maplibre-gl/LICENSE.txt +0 -116
- package/.yarn/unplugged/maplibre-gl-npm-2.4.0-9fa603cf50/node_modules/maplibre-gl/README.md +0 -149
- package/.yarn/unplugged/maplibre-gl-npm-2.4.0-9fa603cf50/node_modules/maplibre-gl/build/banner.ts +0 -4
- package/.yarn/unplugged/maplibre-gl-npm-2.4.0-9fa603cf50/node_modules/maplibre-gl/build/check-bundle-size.js +0 -77
- package/.yarn/unplugged/maplibre-gl-npm-2.4.0-9fa603cf50/node_modules/maplibre-gl/build/generate-debug-index-file.ts +0 -19
- package/.yarn/unplugged/maplibre-gl-npm-2.4.0-9fa603cf50/node_modules/maplibre-gl/build/generate-query-test-fixtures.ts +0 -126
- package/.yarn/unplugged/maplibre-gl-npm-2.4.0-9fa603cf50/node_modules/maplibre-gl/build/generate-shaders.ts +0 -35
- package/.yarn/unplugged/maplibre-gl-npm-2.4.0-9fa603cf50/node_modules/maplibre-gl/build/generate-struct-arrays.ts +0 -437
- package/.yarn/unplugged/maplibre-gl-npm-2.4.0-9fa603cf50/node_modules/maplibre-gl/build/generate-style-code.ts +0 -280
- package/.yarn/unplugged/maplibre-gl-npm-2.4.0-9fa603cf50/node_modules/maplibre-gl/build/generate-style-spec.ts +0 -323
- package/.yarn/unplugged/maplibre-gl-npm-2.4.0-9fa603cf50/node_modules/maplibre-gl/build/generate-typings.ts +0 -26
- package/.yarn/unplugged/maplibre-gl-npm-2.4.0-9fa603cf50/node_modules/maplibre-gl/build/readme.md +0 -52
- package/.yarn/unplugged/maplibre-gl-npm-2.4.0-9fa603cf50/node_modules/maplibre-gl/build/release-notes.js +0 -45
- package/.yarn/unplugged/maplibre-gl-npm-2.4.0-9fa603cf50/node_modules/maplibre-gl/build/rollup_plugin_minify_style_spec.ts +0 -25
- package/.yarn/unplugged/maplibre-gl-npm-2.4.0-9fa603cf50/node_modules/maplibre-gl/build/rollup_plugins.ts +0 -52
- package/.yarn/unplugged/maplibre-gl-npm-2.4.0-9fa603cf50/node_modules/maplibre-gl/dist/maplibre-gl-csp-worker.js +0 -2
- package/.yarn/unplugged/maplibre-gl-npm-2.4.0-9fa603cf50/node_modules/maplibre-gl/dist/maplibre-gl-csp-worker.js.map +0 -1
- package/.yarn/unplugged/maplibre-gl-npm-2.4.0-9fa603cf50/node_modules/maplibre-gl/dist/maplibre-gl-csp.js +0 -2
- package/.yarn/unplugged/maplibre-gl-npm-2.4.0-9fa603cf50/node_modules/maplibre-gl/dist/maplibre-gl-csp.js.map +0 -1
- package/.yarn/unplugged/maplibre-gl-npm-2.4.0-9fa603cf50/node_modules/maplibre-gl/dist/maplibre-gl-dev.js +0 -51935
- package/.yarn/unplugged/maplibre-gl-npm-2.4.0-9fa603cf50/node_modules/maplibre-gl/dist/maplibre-gl.css +0 -1
- package/.yarn/unplugged/maplibre-gl-npm-2.4.0-9fa603cf50/node_modules/maplibre-gl/dist/maplibre-gl.d.ts +0 -11736
- package/.yarn/unplugged/maplibre-gl-npm-2.4.0-9fa603cf50/node_modules/maplibre-gl/dist/maplibre-gl.js +0 -44
- package/.yarn/unplugged/maplibre-gl-npm-2.4.0-9fa603cf50/node_modules/maplibre-gl/dist/maplibre-gl.js.map +0 -1
- package/.yarn/unplugged/maplibre-gl-npm-2.4.0-9fa603cf50/node_modules/maplibre-gl/dist/package.json +0 -1
- package/.yarn/unplugged/maplibre-gl-npm-2.4.0-9fa603cf50/node_modules/maplibre-gl/dist/style-spec/index.d.ts +0 -1768
- package/.yarn/unplugged/maplibre-gl-npm-2.4.0-9fa603cf50/node_modules/maplibre-gl/package.json +0 -182
- package/.yarn/unplugged/maplibre-gl-npm-2.4.0-9fa603cf50/node_modules/maplibre-gl/postinstall.js +0 -1
- package/.yarn/unplugged/texture-compressor-npm-1.0.2-c655a54095/node_modules/texture-compressor/.editorconfig +0 -7
- package/.yarn/unplugged/texture-compressor-npm-1.0.2-c655a54095/node_modules/texture-compressor/.ready +0 -0
- package/.yarn/unplugged/texture-compressor-npm-1.0.2-c655a54095/node_modules/texture-compressor/LICENSE +0 -21
- package/.yarn/unplugged/texture-compressor-npm-1.0.2-c655a54095/node_modules/texture-compressor/README.md +0 -108
- package/.yarn/unplugged/texture-compressor-npm-1.0.2-c655a54095/node_modules/texture-compressor/bin/darwin/LICENSE-PVRTexToolCLI.txt +0 -52
- package/.yarn/unplugged/texture-compressor-npm-1.0.2-c655a54095/node_modules/texture-compressor/bin/darwin/LICENSE-astcenc.txt +0 -137
- package/.yarn/unplugged/texture-compressor-npm-1.0.2-c655a54095/node_modules/texture-compressor/bin/darwin/LICENSE-crunch.txt +0 -25
- package/.yarn/unplugged/texture-compressor-npm-1.0.2-c655a54095/node_modules/texture-compressor/bin/darwin/PVRTexToolCLI +0 -0
- package/.yarn/unplugged/texture-compressor-npm-1.0.2-c655a54095/node_modules/texture-compressor/bin/darwin/astcenc +0 -0
- package/.yarn/unplugged/texture-compressor-npm-1.0.2-c655a54095/node_modules/texture-compressor/bin/darwin/crunch +0 -0
- package/.yarn/unplugged/texture-compressor-npm-1.0.2-c655a54095/node_modules/texture-compressor/bin/linux/LICENSE-PVRTexToolCLI.txt +0 -52
- package/.yarn/unplugged/texture-compressor-npm-1.0.2-c655a54095/node_modules/texture-compressor/bin/linux/LICENSE-astcenc.txt +0 -137
- package/.yarn/unplugged/texture-compressor-npm-1.0.2-c655a54095/node_modules/texture-compressor/bin/linux/LICENSE-crunch.txt +0 -25
- package/.yarn/unplugged/texture-compressor-npm-1.0.2-c655a54095/node_modules/texture-compressor/bin/linux/PVRTexToolCLI +0 -0
- package/.yarn/unplugged/texture-compressor-npm-1.0.2-c655a54095/node_modules/texture-compressor/bin/linux/astcenc +0 -0
- package/.yarn/unplugged/texture-compressor-npm-1.0.2-c655a54095/node_modules/texture-compressor/bin/linux/crunch +0 -0
- package/.yarn/unplugged/texture-compressor-npm-1.0.2-c655a54095/node_modules/texture-compressor/bin/texture-compressor.js +0 -3
- package/.yarn/unplugged/texture-compressor-npm-1.0.2-c655a54095/node_modules/texture-compressor/bin/win32/LICENSE-PVRTexToolCLI.txt +0 -52
- package/.yarn/unplugged/texture-compressor-npm-1.0.2-c655a54095/node_modules/texture-compressor/bin/win32/LICENSE-astcenc.txt +0 -137
- package/.yarn/unplugged/texture-compressor-npm-1.0.2-c655a54095/node_modules/texture-compressor/bin/win32/LICENSE-crunch.txt +0 -25
- package/.yarn/unplugged/texture-compressor-npm-1.0.2-c655a54095/node_modules/texture-compressor/bin/win32/PVRTexToolCLI.exe +0 -0
- package/.yarn/unplugged/texture-compressor-npm-1.0.2-c655a54095/node_modules/texture-compressor/bin/win32/astcenc.exe +0 -0
- package/.yarn/unplugged/texture-compressor-npm-1.0.2-c655a54095/node_modules/texture-compressor/bin/win32/crunch.exe +0 -0
- package/.yarn/unplugged/texture-compressor-npm-1.0.2-c655a54095/node_modules/texture-compressor/dist/cli/lib/argsHandler.js +0 -101
- package/.yarn/unplugged/texture-compressor-npm-1.0.2-c655a54095/node_modules/texture-compressor/dist/cli/lib/argsHandler.js.map +0 -1
- package/.yarn/unplugged/texture-compressor-npm-1.0.2-c655a54095/node_modules/texture-compressor/dist/cli/lib/compressors/compressWithCrunch.js +0 -48
- package/.yarn/unplugged/texture-compressor-npm-1.0.2-c655a54095/node_modules/texture-compressor/dist/cli/lib/compressors/compressWithCrunch.js.map +0 -1
- package/.yarn/unplugged/texture-compressor-npm-1.0.2-c655a54095/node_modules/texture-compressor/dist/cli/lib/compressors/compressWithPVRTexTool.js +0 -51
- package/.yarn/unplugged/texture-compressor-npm-1.0.2-c655a54095/node_modules/texture-compressor/dist/cli/lib/compressors/compressWithPVRTexTool.js.map +0 -1
- package/.yarn/unplugged/texture-compressor-npm-1.0.2-c655a54095/node_modules/texture-compressor/dist/cli/lib/compressors/spawnProcess.js +0 -45
- package/.yarn/unplugged/texture-compressor-npm-1.0.2-c655a54095/node_modules/texture-compressor/dist/cli/lib/compressors/spawnProcess.js.map +0 -1
- package/.yarn/unplugged/texture-compressor-npm-1.0.2-c655a54095/node_modules/texture-compressor/dist/cli/lib/compressors/validateArgs.js +0 -36
- package/.yarn/unplugged/texture-compressor-npm-1.0.2-c655a54095/node_modules/texture-compressor/dist/cli/lib/compressors/validateArgs.js.map +0 -1
- package/.yarn/unplugged/texture-compressor-npm-1.0.2-c655a54095/node_modules/texture-compressor/dist/cli/lib/constants.js +0 -85
- package/.yarn/unplugged/texture-compressor-npm-1.0.2-c655a54095/node_modules/texture-compressor/dist/cli/lib/constants.js.map +0 -1
- package/.yarn/unplugged/texture-compressor-npm-1.0.2-c655a54095/node_modules/texture-compressor/dist/cli/lib/index.js +0 -33
- package/.yarn/unplugged/texture-compressor-npm-1.0.2-c655a54095/node_modules/texture-compressor/dist/cli/lib/index.js.map +0 -1
- package/.yarn/unplugged/texture-compressor-npm-1.0.2-c655a54095/node_modules/texture-compressor/dist/cli/lib/utilities.js +0 -52
- package/.yarn/unplugged/texture-compressor-npm-1.0.2-c655a54095/node_modules/texture-compressor/dist/cli/lib/utilities.js.map +0 -1
- package/.yarn/unplugged/texture-compressor-npm-1.0.2-c655a54095/node_modules/texture-compressor/dist/cli/package.json +0 -37
- package/.yarn/unplugged/texture-compressor-npm-1.0.2-c655a54095/node_modules/texture-compressor/dist/types/lib/argsHandler.d.ts +0 -14
- package/.yarn/unplugged/texture-compressor-npm-1.0.2-c655a54095/node_modules/texture-compressor/dist/types/lib/compressors/compressWithCrunch.d.ts +0 -5
- package/.yarn/unplugged/texture-compressor-npm-1.0.2-c655a54095/node_modules/texture-compressor/dist/types/lib/compressors/compressWithPVRTexTool.d.ts +0 -5
- package/.yarn/unplugged/texture-compressor-npm-1.0.2-c655a54095/node_modules/texture-compressor/dist/types/lib/compressors/spawnProcess.d.ts +0 -9
- package/.yarn/unplugged/texture-compressor-npm-1.0.2-c655a54095/node_modules/texture-compressor/dist/types/lib/compressors/validateArgs.d.ts +0 -11
- package/.yarn/unplugged/texture-compressor-npm-1.0.2-c655a54095/node_modules/texture-compressor/dist/types/lib/constants.d.ts +0 -45
- package/.yarn/unplugged/texture-compressor-npm-1.0.2-c655a54095/node_modules/texture-compressor/dist/types/lib/index.d.ts +0 -5
- package/.yarn/unplugged/texture-compressor-npm-1.0.2-c655a54095/node_modules/texture-compressor/dist/types/lib/utilities.d.ts +0 -43
- package/.yarn/unplugged/texture-compressor-npm-1.0.2-c655a54095/node_modules/texture-compressor/docs/RECOMMENDED_PARAMETERS.md +0 -17
- package/.yarn/unplugged/texture-compressor-npm-1.0.2-c655a54095/node_modules/texture-compressor/docs/SUPPORTED_DEVICES_TABLE.md +0 -47
- package/.yarn/unplugged/texture-compressor-npm-1.0.2-c655a54095/node_modules/texture-compressor/docs/SUPPORTED_PARAMETERS.md +0 -154
- package/.yarn/unplugged/texture-compressor-npm-1.0.2-c655a54095/node_modules/texture-compressor/docs/data/KTXLoader.js +0 -149
- package/.yarn/unplugged/texture-compressor-npm-1.0.2-c655a54095/node_modules/texture-compressor/docs/data/flippedY-mipmaps/example-astc-4x4.ktx +0 -0
- package/.yarn/unplugged/texture-compressor-npm-1.0.2-c655a54095/node_modules/texture-compressor/docs/data/flippedY-mipmaps/example-astc-8x8.ktx +0 -0
- package/.yarn/unplugged/texture-compressor-npm-1.0.2-c655a54095/node_modules/texture-compressor/docs/data/flippedY-mipmaps/example-dxt1.ktx +0 -0
- package/.yarn/unplugged/texture-compressor-npm-1.0.2-c655a54095/node_modules/texture-compressor/docs/data/flippedY-mipmaps/example-dxt1A.ktx +0 -0
- package/.yarn/unplugged/texture-compressor-npm-1.0.2-c655a54095/node_modules/texture-compressor/docs/data/flippedY-mipmaps/example-dxt3.ktx +0 -0
- package/.yarn/unplugged/texture-compressor-npm-1.0.2-c655a54095/node_modules/texture-compressor/docs/data/flippedY-mipmaps/example-dxt5.ktx +0 -0
- package/.yarn/unplugged/texture-compressor-npm-1.0.2-c655a54095/node_modules/texture-compressor/docs/data/flippedY-mipmaps/example-etc1.ktx +0 -0
- package/.yarn/unplugged/texture-compressor-npm-1.0.2-c655a54095/node_modules/texture-compressor/docs/data/flippedY-mipmaps/example-etc2.ktx +0 -0
- package/.yarn/unplugged/texture-compressor-npm-1.0.2-c655a54095/node_modules/texture-compressor/docs/data/flippedY-mipmaps/example-etc2A.ktx +0 -0
- package/.yarn/unplugged/texture-compressor-npm-1.0.2-c655a54095/node_modules/texture-compressor/docs/data/flippedY-mipmaps/example-pvrtc2BPP.ktx +0 -0
- package/.yarn/unplugged/texture-compressor-npm-1.0.2-c655a54095/node_modules/texture-compressor/docs/data/flippedY-mipmaps/example-pvrtc2BPPA.ktx +0 -0
- package/.yarn/unplugged/texture-compressor-npm-1.0.2-c655a54095/node_modules/texture-compressor/docs/data/flippedY-mipmaps/example-pvrtc4BPP.ktx +0 -0
- package/.yarn/unplugged/texture-compressor-npm-1.0.2-c655a54095/node_modules/texture-compressor/docs/data/flippedY-mipmaps/example-pvrtc4BPPA.ktx +0 -0
- package/.yarn/unplugged/texture-compressor-npm-1.0.2-c655a54095/node_modules/texture-compressor/docs/data/main.js +0 -195
- package/.yarn/unplugged/texture-compressor-npm-1.0.2-c655a54095/node_modules/texture-compressor/docs/index.html +0 -37
- package/.yarn/unplugged/texture-compressor-npm-1.0.2-c655a54095/node_modules/texture-compressor/lib/argsHandler.ts +0 -135
- package/.yarn/unplugged/texture-compressor-npm-1.0.2-c655a54095/node_modules/texture-compressor/lib/compressors/compressWithCrunch.ts +0 -66
- package/.yarn/unplugged/texture-compressor-npm-1.0.2-c655a54095/node_modules/texture-compressor/lib/compressors/compressWithPVRTexTool.ts +0 -91
- package/.yarn/unplugged/texture-compressor-npm-1.0.2-c655a54095/node_modules/texture-compressor/lib/compressors/spawnProcess.ts +0 -57
- package/.yarn/unplugged/texture-compressor-npm-1.0.2-c655a54095/node_modules/texture-compressor/lib/compressors/validateArgs.ts +0 -53
- package/.yarn/unplugged/texture-compressor-npm-1.0.2-c655a54095/node_modules/texture-compressor/lib/constants.ts +0 -86
- package/.yarn/unplugged/texture-compressor-npm-1.0.2-c655a54095/node_modules/texture-compressor/lib/index.ts +0 -37
- package/.yarn/unplugged/texture-compressor-npm-1.0.2-c655a54095/node_modules/texture-compressor/lib/utilities.ts +0 -57
- package/.yarn/unplugged/texture-compressor-npm-1.0.2-c655a54095/node_modules/texture-compressor/package.json +0 -37
- package/.yarn/unplugged/texture-compressor-npm-1.0.2-c655a54095/node_modules/texture-compressor/tslint.json +0 -12
- /package/.yarn/unplugged/{@swc-core-linux-x64-gnu-npm-1.3.106-7bb327124d → @swc-core-linux-x64-gnu-npm-1.4.0-07735121da}/node_modules/@swc/core-linux-x64-gnu/.ready +0 -0
- /package/.yarn/unplugged/{@swc-core-linux-x64-gnu-npm-1.3.106-7bb327124d → @swc-core-linux-x64-gnu-npm-1.4.0-07735121da}/node_modules/@swc/core-linux-x64-gnu/README.md +0 -0
- /package/.yarn/unplugged/{@swc-core-virtual-22cde85fc1 → @swc-core-virtual-a4869543ec}/node_modules/@swc/core/.ready +0 -0
- /package/.yarn/unplugged/{@swc-core-virtual-22cde85fc1 → @swc-core-virtual-a4869543ec}/node_modules/@swc/core/LICENSE +0 -0
- /package/.yarn/unplugged/{@swc-core-virtual-22cde85fc1 → @swc-core-virtual-a4869543ec}/node_modules/@swc/core/README.md +0 -0
- /package/.yarn/unplugged/{@swc-core-virtual-22cde85fc1 → @swc-core-virtual-a4869543ec}/node_modules/@swc/core/Visitor.d.ts +0 -0
- /package/.yarn/unplugged/{@swc-core-virtual-22cde85fc1 → @swc-core-virtual-a4869543ec}/node_modules/@swc/core/Visitor.js +0 -0
- /package/.yarn/unplugged/{@swc-core-virtual-22cde85fc1 → @swc-core-virtual-a4869543ec}/node_modules/@swc/core/binding.d.ts +0 -0
- /package/.yarn/unplugged/{@swc-core-virtual-22cde85fc1 → @swc-core-virtual-a4869543ec}/node_modules/@swc/core/binding.js +0 -0
- /package/.yarn/unplugged/{@swc-core-virtual-22cde85fc1 → @swc-core-virtual-a4869543ec}/node_modules/@swc/core/bindings/README.md +0 -0
- /package/.yarn/unplugged/{@swc-core-virtual-22cde85fc1 → @swc-core-virtual-a4869543ec}/node_modules/@swc/core/bindings/binding_core_wasm/package.json +0 -0
- /package/.yarn/unplugged/{@swc-core-virtual-22cde85fc1 → @swc-core-virtual-a4869543ec}/node_modules/@swc/core/index.d.ts +0 -0
- /package/.yarn/unplugged/{@swc-core-virtual-22cde85fc1 → @swc-core-virtual-a4869543ec}/node_modules/@swc/core/index.js +0 -0
- /package/.yarn/unplugged/{@swc-core-virtual-22cde85fc1 → @swc-core-virtual-a4869543ec}/node_modules/@swc/core/postinstall.js +0 -0
- /package/.yarn/unplugged/{@swc-core-virtual-22cde85fc1 → @swc-core-virtual-a4869543ec}/node_modules/@swc/core/spack.d.ts +0 -0
- /package/.yarn/unplugged/{@swc-core-virtual-22cde85fc1 → @swc-core-virtual-a4869543ec}/node_modules/@swc/core/spack.js +0 -0
- /package/.yarn/unplugged/{@swc-core-virtual-22cde85fc1 → @swc-core-virtual-a4869543ec}/node_modules/@swc/core/util.d.ts +0 -0
- /package/.yarn/unplugged/{@swc-core-virtual-22cde85fc1 → @swc-core-virtual-a4869543ec}/node_modules/@swc/core/util.js +0 -0
|
@@ -1,280 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
import * as fs from 'fs';
|
|
4
|
-
|
|
5
|
-
import spec from '../src/style-spec/reference/v8.json' assert {type: 'json'};
|
|
6
|
-
|
|
7
|
-
function camelCase(str: string): string {
|
|
8
|
-
return str.replace(/-(.)/g, (_, x) => {
|
|
9
|
-
return x.toUpperCase();
|
|
10
|
-
});
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
function pascalCase(str: string): string {
|
|
14
|
-
const almostCamelized = camelCase(str);
|
|
15
|
-
return almostCamelized[0].toUpperCase() + almostCamelized.slice(1);
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
function nativeType(property) {
|
|
19
|
-
switch (property.type) {
|
|
20
|
-
case 'boolean':
|
|
21
|
-
return 'boolean';
|
|
22
|
-
case 'number':
|
|
23
|
-
return 'number';
|
|
24
|
-
case 'string':
|
|
25
|
-
return 'string';
|
|
26
|
-
case 'enum':
|
|
27
|
-
return Object.keys(property.values).map(v => JSON.stringify(v)).join(' | ');
|
|
28
|
-
case 'color':
|
|
29
|
-
return 'Color';
|
|
30
|
-
case 'padding':
|
|
31
|
-
return 'Padding';
|
|
32
|
-
case 'formatted':
|
|
33
|
-
return 'Formatted';
|
|
34
|
-
case 'resolvedImage':
|
|
35
|
-
return 'ResolvedImage';
|
|
36
|
-
case 'array':
|
|
37
|
-
if (property.length) {
|
|
38
|
-
return `[${new Array(property.length).fill(nativeType({type: property.value})).join(', ')}]`;
|
|
39
|
-
} else {
|
|
40
|
-
return `Array<${nativeType({type: property.value, values: property.values})}>`;
|
|
41
|
-
}
|
|
42
|
-
default: throw new Error(`unknown type for ${property.name}`);
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
function possiblyEvaluatedType(property) {
|
|
47
|
-
const propType = nativeType(property);
|
|
48
|
-
|
|
49
|
-
switch (property['property-type']) {
|
|
50
|
-
case 'color-ramp':
|
|
51
|
-
return 'ColorRampProperty';
|
|
52
|
-
case 'cross-faded':
|
|
53
|
-
return `CrossFaded<${propType}>`;
|
|
54
|
-
case 'cross-faded-data-driven':
|
|
55
|
-
return `PossiblyEvaluatedPropertyValue<CrossFaded<${propType}>>`;
|
|
56
|
-
case 'data-driven':
|
|
57
|
-
return `PossiblyEvaluatedPropertyValue<${propType}>`;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
return propType;
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
function propertyType(property) {
|
|
64
|
-
switch (property['property-type']) {
|
|
65
|
-
case 'data-driven':
|
|
66
|
-
return `DataDrivenProperty<${nativeType(property)}>`;
|
|
67
|
-
case 'cross-faded':
|
|
68
|
-
return `CrossFadedProperty<${nativeType(property)}>`;
|
|
69
|
-
case 'cross-faded-data-driven':
|
|
70
|
-
return `CrossFadedDataDrivenProperty<${nativeType(property)}>`;
|
|
71
|
-
case 'color-ramp':
|
|
72
|
-
return 'ColorRampProperty';
|
|
73
|
-
case 'data-constant':
|
|
74
|
-
case 'constant':
|
|
75
|
-
return `DataConstantProperty<${nativeType(property)}>`;
|
|
76
|
-
default:
|
|
77
|
-
throw new Error(`unknown property-type "${property['property-type']}" for ${property.name}`);
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
function runtimeType(property) {
|
|
82
|
-
switch (property.type) {
|
|
83
|
-
case 'boolean':
|
|
84
|
-
return 'BooleanType';
|
|
85
|
-
case 'number':
|
|
86
|
-
return 'NumberType';
|
|
87
|
-
case 'string':
|
|
88
|
-
case 'enum':
|
|
89
|
-
return 'StringType';
|
|
90
|
-
case 'color':
|
|
91
|
-
return 'ColorType';
|
|
92
|
-
case 'padding':
|
|
93
|
-
return 'PaddingType';
|
|
94
|
-
case 'formatted':
|
|
95
|
-
return 'FormattedType';
|
|
96
|
-
case 'Image':
|
|
97
|
-
return 'ImageType';
|
|
98
|
-
case 'array':
|
|
99
|
-
if (property.length) {
|
|
100
|
-
return `array(${runtimeType({type: property.value})}, ${property.length})`;
|
|
101
|
-
} else {
|
|
102
|
-
return `array(${runtimeType({type: property.value})})`;
|
|
103
|
-
}
|
|
104
|
-
default: throw new Error(`unknown type for ${property.name}`);
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
function overrides(property) {
|
|
109
|
-
return `{ runtimeType: ${runtimeType(property)}, getOverride: (o) => o.${camelCase(property.name)}, hasOverride: (o) => !!o.${camelCase(property.name)} }`;
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
function propertyValue(property, type) {
|
|
113
|
-
const propertyAsSpec = `styleSpec["${type}_${property.layerType}"]["${property.name}"] as any as StylePropertySpecification`;
|
|
114
|
-
|
|
115
|
-
switch (property['property-type']) {
|
|
116
|
-
case 'data-driven':
|
|
117
|
-
if (property.overridable) {
|
|
118
|
-
return `new DataDrivenProperty(${propertyAsSpec}, ${overrides(property)})`;
|
|
119
|
-
} else {
|
|
120
|
-
return `new DataDrivenProperty(${propertyAsSpec})`;
|
|
121
|
-
}
|
|
122
|
-
case 'cross-faded':
|
|
123
|
-
return `new CrossFadedProperty(${propertyAsSpec})`;
|
|
124
|
-
case 'cross-faded-data-driven':
|
|
125
|
-
return `new CrossFadedDataDrivenProperty(${propertyAsSpec})`;
|
|
126
|
-
case 'color-ramp':
|
|
127
|
-
return `new ColorRampProperty(${propertyAsSpec})`;
|
|
128
|
-
case 'data-constant':
|
|
129
|
-
case 'constant':
|
|
130
|
-
return `new DataConstantProperty(${propertyAsSpec})`;
|
|
131
|
-
default:
|
|
132
|
-
throw new Error(`unknown property-type "${property['property-type']}" for ${property.name}`);
|
|
133
|
-
}
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
const layers = Object.keys(spec.layer.type.values).map((type) => {
|
|
137
|
-
const layoutProperties = Object.keys(spec[`layout_${type}`]).reduce((memo, name) => {
|
|
138
|
-
if (name !== 'visibility') {
|
|
139
|
-
spec[`layout_${type}`][name].name = name;
|
|
140
|
-
spec[`layout_${type}`][name].layerType = type;
|
|
141
|
-
memo.push(spec[`layout_${type}`][name]);
|
|
142
|
-
}
|
|
143
|
-
return memo;
|
|
144
|
-
}, []);
|
|
145
|
-
|
|
146
|
-
const paintProperties = Object.keys(spec[`paint_${type}`]).reduce((memo, name) => {
|
|
147
|
-
spec[`paint_${type}`][name].name = name;
|
|
148
|
-
spec[`paint_${type}`][name].layerType = type;
|
|
149
|
-
memo.push(spec[`paint_${type}`][name]);
|
|
150
|
-
return memo;
|
|
151
|
-
}, []);
|
|
152
|
-
|
|
153
|
-
return {type, layoutProperties, paintProperties};
|
|
154
|
-
});
|
|
155
|
-
|
|
156
|
-
function emitlayerProperties(locals) {
|
|
157
|
-
const output = [];
|
|
158
|
-
const layerType = pascalCase(locals.type);
|
|
159
|
-
const {
|
|
160
|
-
layoutProperties,
|
|
161
|
-
paintProperties
|
|
162
|
-
} = locals;
|
|
163
|
-
|
|
164
|
-
output.push(
|
|
165
|
-
`// This file is generated. Edit build/generate-style-code.ts, then run 'npm run codegen'.
|
|
166
|
-
/* eslint-disable */
|
|
167
|
-
|
|
168
|
-
import styleSpec from '../../style-spec/reference/latest';
|
|
169
|
-
|
|
170
|
-
import {
|
|
171
|
-
Properties,
|
|
172
|
-
DataConstantProperty,
|
|
173
|
-
DataDrivenProperty,
|
|
174
|
-
CrossFadedDataDrivenProperty,
|
|
175
|
-
CrossFadedProperty,
|
|
176
|
-
ColorRampProperty,
|
|
177
|
-
PossiblyEvaluatedPropertyValue,
|
|
178
|
-
CrossFaded
|
|
179
|
-
} from '../properties';
|
|
180
|
-
|
|
181
|
-
import type Color from '../../style-spec/util/color';
|
|
182
|
-
import type Padding from '../../style-spec/util/padding';
|
|
183
|
-
|
|
184
|
-
import type Formatted from '../../style-spec/expression/types/formatted';
|
|
185
|
-
|
|
186
|
-
import type ResolvedImage from '../../style-spec/expression/types/resolved_image';
|
|
187
|
-
import {StylePropertySpecification} from '../../style-spec/style-spec';
|
|
188
|
-
`);
|
|
189
|
-
|
|
190
|
-
const overridables = paintProperties.filter(p => p.overridable);
|
|
191
|
-
if (overridables.length) {
|
|
192
|
-
output.push(
|
|
193
|
-
`import {
|
|
194
|
-
${overridables.reduce((imports, prop) => { imports.push(runtimeType(prop)); return imports; }, []).join(',\n ')}
|
|
195
|
-
} from '../../style-spec/expression/types';
|
|
196
|
-
`);
|
|
197
|
-
}
|
|
198
|
-
|
|
199
|
-
if (layoutProperties.length) {
|
|
200
|
-
output.push(
|
|
201
|
-
`export type ${layerType}LayoutProps = {`);
|
|
202
|
-
|
|
203
|
-
for (const property of layoutProperties) {
|
|
204
|
-
output.push(
|
|
205
|
-
` "${property.name}": ${propertyType(property)},`);
|
|
206
|
-
}
|
|
207
|
-
|
|
208
|
-
output.push(
|
|
209
|
-
`};
|
|
210
|
-
|
|
211
|
-
export type ${layerType}LayoutPropsPossiblyEvaluated = {`);
|
|
212
|
-
|
|
213
|
-
for (const property of layoutProperties) {
|
|
214
|
-
output.push(
|
|
215
|
-
` "${property.name}": ${possiblyEvaluatedType(property)},`);
|
|
216
|
-
}
|
|
217
|
-
|
|
218
|
-
output.push(
|
|
219
|
-
`};
|
|
220
|
-
|
|
221
|
-
const layout: Properties<${layerType}LayoutProps> = new Properties({`);
|
|
222
|
-
|
|
223
|
-
for (const property of layoutProperties) {
|
|
224
|
-
output.push(
|
|
225
|
-
` "${property.name}": ${propertyValue(property, 'layout')},`);
|
|
226
|
-
}
|
|
227
|
-
|
|
228
|
-
output.push(
|
|
229
|
-
'});');
|
|
230
|
-
}
|
|
231
|
-
|
|
232
|
-
if (paintProperties.length) {
|
|
233
|
-
output.push(
|
|
234
|
-
`
|
|
235
|
-
export type ${layerType}PaintProps = {`);
|
|
236
|
-
|
|
237
|
-
for (const property of paintProperties) {
|
|
238
|
-
output.push(
|
|
239
|
-
` "${property.name}": ${propertyType(property)},`);
|
|
240
|
-
}
|
|
241
|
-
|
|
242
|
-
output.push(
|
|
243
|
-
`};
|
|
244
|
-
|
|
245
|
-
export type ${layerType}PaintPropsPossiblyEvaluated = {`);
|
|
246
|
-
|
|
247
|
-
for (const property of paintProperties) {
|
|
248
|
-
output.push(
|
|
249
|
-
` "${property.name}": ${possiblyEvaluatedType(property)},`);
|
|
250
|
-
}
|
|
251
|
-
|
|
252
|
-
output.push(
|
|
253
|
-
'};');
|
|
254
|
-
} else {
|
|
255
|
-
output.push(
|
|
256
|
-
`export type ${layerType}PaintProps = {};`);
|
|
257
|
-
}
|
|
258
|
-
|
|
259
|
-
output.push(
|
|
260
|
-
`
|
|
261
|
-
const paint: Properties<${layerType}PaintProps> = new Properties({`);
|
|
262
|
-
|
|
263
|
-
for (const property of paintProperties) {
|
|
264
|
-
output.push(
|
|
265
|
-
` "${property.name}": ${propertyValue(property, 'paint')},`);
|
|
266
|
-
}
|
|
267
|
-
|
|
268
|
-
output.push(
|
|
269
|
-
`});
|
|
270
|
-
|
|
271
|
-
export default ({ paint${layoutProperties.length ? ', layout' : ''} } as {
|
|
272
|
-
paint: Properties<${layerType}PaintProps>${layoutProperties.length ? `,\n layout: Properties<${layerType}LayoutProps>` : ''}
|
|
273
|
-
});`);
|
|
274
|
-
|
|
275
|
-
return output.join('\n');
|
|
276
|
-
}
|
|
277
|
-
|
|
278
|
-
for (const layer of layers) {
|
|
279
|
-
fs.writeFileSync(`src/style/style_layer/${layer.type.replace('-', '_')}_style_layer_properties.g.ts`, emitlayerProperties(layer));
|
|
280
|
-
}
|
|
@@ -1,323 +0,0 @@
|
|
|
1
|
-
import * as fs from 'fs';
|
|
2
|
-
import * as properties from '../src/style-spec/util/properties';
|
|
3
|
-
|
|
4
|
-
import spec from '../src/style-spec/reference/v8.json' assert {type: 'json'};
|
|
5
|
-
|
|
6
|
-
function unionType(values) {
|
|
7
|
-
if (Array.isArray(values)) {
|
|
8
|
-
return values.map(v => JSON.stringify(v)).join(' | ');
|
|
9
|
-
} else {
|
|
10
|
-
return Object.keys(values).map(v => JSON.stringify(v)).join(' | ');
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
function propertyType(property) {
|
|
15
|
-
if (typeof property.type === 'function') {
|
|
16
|
-
return property.type();
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
const baseType = (() => {
|
|
20
|
-
switch (property.type) {
|
|
21
|
-
case 'string':
|
|
22
|
-
case 'number':
|
|
23
|
-
case 'boolean':
|
|
24
|
-
return property.type;
|
|
25
|
-
case 'enum':
|
|
26
|
-
return unionType(property.values);
|
|
27
|
-
case 'array': {
|
|
28
|
-
const elementType = propertyType(typeof property.value === 'string' ? {type: property.value, values: property.values} : property.value);
|
|
29
|
-
if (property.length) {
|
|
30
|
-
return `[${Array(property.length).fill(elementType).join(', ')}]`;
|
|
31
|
-
} else {
|
|
32
|
-
return `Array<${elementType}>`;
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
case 'light':
|
|
36
|
-
return 'LightSpecification';
|
|
37
|
-
case 'sources':
|
|
38
|
-
return '{[_: string]: SourceSpecification}';
|
|
39
|
-
case '*':
|
|
40
|
-
return 'unknown';
|
|
41
|
-
default:
|
|
42
|
-
return `${property.type.slice(0, 1).toUpperCase()}${property.type.slice(1)}Specification`;
|
|
43
|
-
}
|
|
44
|
-
})();
|
|
45
|
-
|
|
46
|
-
if (properties.supportsPropertyExpression(property)) {
|
|
47
|
-
return `DataDrivenPropertyValueSpecification<${baseType}>`;
|
|
48
|
-
} else if (properties.supportsZoomExpression(property)) {
|
|
49
|
-
return `PropertyValueSpecification<${baseType}>`;
|
|
50
|
-
} else if (property.expression) {
|
|
51
|
-
return 'ExpressionSpecification';
|
|
52
|
-
} else {
|
|
53
|
-
return baseType;
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
function propertyDeclaration(key, property) {
|
|
58
|
-
return `"${key}"${property.required ? '' : '?'}: ${propertyType(property)}`;
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
function objectDeclaration(key, properties) {
|
|
62
|
-
return `export type ${key} = ${objectType(properties, '')};`;
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
function objectType(properties, indent) {
|
|
66
|
-
return `{
|
|
67
|
-
${Object.keys(properties)
|
|
68
|
-
.filter(k => k !== '*')
|
|
69
|
-
.map(k => ` ${indent}${propertyDeclaration(k, properties[k])}`)
|
|
70
|
-
.join(',\n')}
|
|
71
|
-
${indent}}`;
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
function sourceTypeName(key) {
|
|
75
|
-
return key.replace(/source_(.)(.*)/, (_, _1, _2) => `${_1.toUpperCase()}${_2}SourceSpecification`)
|
|
76
|
-
.replace(/_dem/, 'DEM')
|
|
77
|
-
.replace(/Geojson/, 'GeoJSON');
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
function layerTypeName(key) {
|
|
81
|
-
return key.split('-').map(k => k.replace(/(.)(.*)/, (_, _1, _2) => `${_1.toUpperCase()}${_2}`)).concat('LayerSpecification').join('');
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
function layerType(key) {
|
|
85
|
-
const layer = spec.layer as any;
|
|
86
|
-
|
|
87
|
-
layer.type = {
|
|
88
|
-
type: 'enum',
|
|
89
|
-
values: [key],
|
|
90
|
-
required: true
|
|
91
|
-
};
|
|
92
|
-
|
|
93
|
-
delete layer.ref;
|
|
94
|
-
delete layer['paint.*'];
|
|
95
|
-
|
|
96
|
-
layer.paint.type = () => {
|
|
97
|
-
return objectType(spec[`paint_${key}`], ' ');
|
|
98
|
-
};
|
|
99
|
-
|
|
100
|
-
layer.layout.type = () => {
|
|
101
|
-
return objectType(spec[`layout_${key}`], ' ');
|
|
102
|
-
};
|
|
103
|
-
|
|
104
|
-
if (key === 'background') {
|
|
105
|
-
delete layer.source;
|
|
106
|
-
delete layer['source-layer'];
|
|
107
|
-
delete layer.filter;
|
|
108
|
-
} else {
|
|
109
|
-
layer.source.required = true;
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
return objectDeclaration(layerTypeName(key), layer);
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
const layerTypes = Object.keys(spec.layer.type.values);
|
|
116
|
-
|
|
117
|
-
fs.writeFileSync('src/style-spec/types.g.ts',
|
|
118
|
-
`// Generated code; do not edit. Edit build/generate-style-spec.ts instead.
|
|
119
|
-
/* eslint-disable */
|
|
120
|
-
|
|
121
|
-
export type ColorSpecification = string;
|
|
122
|
-
|
|
123
|
-
export type PaddingSpecification = number | number[];
|
|
124
|
-
|
|
125
|
-
export type FormattedSpecification = string;
|
|
126
|
-
|
|
127
|
-
export type ResolvedImageSpecification = string;
|
|
128
|
-
|
|
129
|
-
export type PromoteIdSpecification = {[_: string]: string} | string;
|
|
130
|
-
|
|
131
|
-
export type ExpressionInputType = string | number | boolean;
|
|
132
|
-
|
|
133
|
-
export type CollatorExpressionSpecification =
|
|
134
|
-
['collator', {
|
|
135
|
-
'case-sensitive'?: boolean | ExpressionSpecification,
|
|
136
|
-
'diacritic-sensitive'?: boolean | ExpressionSpecification,
|
|
137
|
-
locale?: string | ExpressionSpecification}
|
|
138
|
-
]; // collator
|
|
139
|
-
|
|
140
|
-
export type InterpolationSpecification =
|
|
141
|
-
| ['linear']
|
|
142
|
-
| ['exponential', number | ExpressionSpecification]
|
|
143
|
-
| ['cubic-bezier', number | ExpressionSpecification, number | ExpressionSpecification, number | ExpressionSpecification, number | ExpressionSpecification]
|
|
144
|
-
|
|
145
|
-
export type ExpressionSpecification =
|
|
146
|
-
// types
|
|
147
|
-
| ['array', unknown | ExpressionSpecification] // array
|
|
148
|
-
| ['array', ExpressionInputType | ExpressionSpecification, unknown | ExpressionSpecification] // array
|
|
149
|
-
| ['array', ExpressionInputType | ExpressionSpecification, number | ExpressionSpecification, unknown | ExpressionSpecification] // array
|
|
150
|
-
| ['boolean', ...(unknown | ExpressionSpecification)[], unknown | ExpressionSpecification] // boolean
|
|
151
|
-
| CollatorExpressionSpecification
|
|
152
|
-
| ['format', ...(string | ['image', ExpressionSpecification] | ExpressionSpecification | {'font-scale'?: number | ExpressionSpecification, 'text-font'?: string[] | ExpressionSpecification, 'text-color': ColorSpecification | ExpressionSpecification})[]] // string
|
|
153
|
-
| ['image', unknown | ExpressionSpecification] // image
|
|
154
|
-
| ['literal', unknown]
|
|
155
|
-
| ['number', unknown | ExpressionSpecification, ...(unknown | ExpressionSpecification)[]] // number
|
|
156
|
-
| ['number-format', number | ExpressionSpecification, {'locale'?: string | ExpressionSpecification, 'currency'?: string | ExpressionSpecification, 'min-fraction-digits'?: number | ExpressionSpecification, 'max-fraction-digits'?: number | ExpressionSpecification}] // string
|
|
157
|
-
| ['object', unknown | ExpressionSpecification, ...(unknown | ExpressionSpecification)[]] // object
|
|
158
|
-
| ['string', unknown | ExpressionSpecification, ...(unknown | ExpressionSpecification)[]] // string
|
|
159
|
-
| ['to-boolean', unknown | ExpressionSpecification] // boolean
|
|
160
|
-
| ['to-color', unknown | ExpressionSpecification, ...(unknown | ExpressionSpecification)[]] // color
|
|
161
|
-
| ['to-number', unknown | ExpressionSpecification, ...(unknown | ExpressionSpecification)[]] // number
|
|
162
|
-
| ['to-string', unknown | ExpressionSpecification] // string
|
|
163
|
-
// feature data
|
|
164
|
-
| ['accumulated']
|
|
165
|
-
| ['feature-state', string]
|
|
166
|
-
| ['geometry-type'] // string
|
|
167
|
-
| ['id']
|
|
168
|
-
| ['line-progress'] // number
|
|
169
|
-
| ['properties'] // object
|
|
170
|
-
// lookup
|
|
171
|
-
| ['at', number | ExpressionSpecification, ExpressionSpecification]
|
|
172
|
-
| ['get', string | ExpressionSpecification, (Record<string, unknown> | ExpressionSpecification)?]
|
|
173
|
-
| ['has', string | ExpressionSpecification, (Record<string, unknown> | ExpressionSpecification)?]
|
|
174
|
-
| ['in', ExpressionInputType | ExpressionSpecification, ExpressionInputType | ExpressionSpecification]
|
|
175
|
-
| ['index-of', ExpressionInputType | ExpressionSpecification, ExpressionInputType | ExpressionSpecification] // number
|
|
176
|
-
| ['length', string | ExpressionSpecification]
|
|
177
|
-
| ['slice', string | ExpressionSpecification, number | ExpressionSpecification]
|
|
178
|
-
// Decision
|
|
179
|
-
| ['!', boolean | ExpressionSpecification] // boolean
|
|
180
|
-
| ['!=', ExpressionInputType | ExpressionSpecification, ExpressionInputType | ExpressionSpecification, CollatorExpressionSpecification?] // boolean
|
|
181
|
-
| ['<', ExpressionInputType | ExpressionSpecification, ExpressionInputType | ExpressionSpecification, CollatorExpressionSpecification?] // boolean
|
|
182
|
-
| ['<=', ExpressionInputType | ExpressionSpecification, ExpressionInputType | ExpressionSpecification, CollatorExpressionSpecification?] // boolean
|
|
183
|
-
| ['==', ExpressionInputType | ExpressionSpecification, ExpressionInputType | ExpressionSpecification, CollatorExpressionSpecification?] // boolean
|
|
184
|
-
| ['>', ExpressionInputType | ExpressionSpecification, ExpressionInputType | ExpressionSpecification, CollatorExpressionSpecification?] // boolean
|
|
185
|
-
| ['>=', ExpressionInputType | ExpressionSpecification, ExpressionInputType | ExpressionSpecification, CollatorExpressionSpecification?] // boolean
|
|
186
|
-
| ['all', ...(boolean | ExpressionSpecification)[]] // boolean
|
|
187
|
-
| ['any', ...(boolean | ExpressionSpecification)[]] // boolean
|
|
188
|
-
| ['case', boolean | ExpressionSpecification, ExpressionInputType | ExpressionSpecification,
|
|
189
|
-
...(boolean | ExpressionInputType | ExpressionSpecification)[], ExpressionInputType | ExpressionSpecification]
|
|
190
|
-
| ['coalesce', ...(ExpressionInputType | ExpressionSpecification)[]] // at least two inputs required
|
|
191
|
-
| ['match', ExpressionInputType | ExpressionSpecification,
|
|
192
|
-
ExpressionInputType | ExpressionInputType[], ExpressionInputType | ExpressionSpecification,
|
|
193
|
-
...(ExpressionInputType | ExpressionInputType[] | ExpressionSpecification)[], // repeated as above
|
|
194
|
-
ExpressionInputType]
|
|
195
|
-
| ['within', unknown | ExpressionSpecification]
|
|
196
|
-
// Ramps, scales, curves
|
|
197
|
-
| ['interpolate', InterpolationSpecification, number | ExpressionSpecification,
|
|
198
|
-
...(number | number[] | ColorSpecification)[]] // alternating number and number | number[] | ColorSpecification
|
|
199
|
-
| ['interpolate-hcl', InterpolationSpecification, number | ExpressionSpecification,
|
|
200
|
-
...(number | ColorSpecification)[]] // alternating number and ColorSpecificaton
|
|
201
|
-
| ['interpolate-lab', InterpolationSpecification, number | ExpressionSpecification,
|
|
202
|
-
...(number | ColorSpecification)[]] // alternating number and ColorSpecification
|
|
203
|
-
| ['step', number | ExpressionSpecification, ExpressionInputType | ExpressionSpecification,
|
|
204
|
-
...(number | ExpressionInputType | ExpressionSpecification)[]] // alternating number and ExpressionInputType | ExpressionSpecification
|
|
205
|
-
// Variable binding
|
|
206
|
-
| ['let', string, ExpressionInputType | ExpressionSpecification, ...(string | ExpressionInputType | ExpressionSpecification)[]]
|
|
207
|
-
| ['var', string]
|
|
208
|
-
// String
|
|
209
|
-
| ['concat', ...(ExpressionInputType | ExpressionSpecification)[]] // at least two inputs required -> string
|
|
210
|
-
| ['downcase', string | ExpressionSpecification] // string
|
|
211
|
-
| ['is-supported-script', string | ExpressionSpecification] // boolean
|
|
212
|
-
| ['resolved-locale', CollatorExpressionSpecification] // string
|
|
213
|
-
| ['upcase', string | ExpressionSpecification] // string
|
|
214
|
-
// Color
|
|
215
|
-
| ['rgb', number | ExpressionSpecification, number | ExpressionSpecification, number | ExpressionSpecification] // color
|
|
216
|
-
| ['rgba', number | ExpressionSpecification, number | ExpressionSpecification, number | ExpressionSpecification, number | ExpressionSpecification]
|
|
217
|
-
| ['to-rgba', ColorSpecification | ExpressionSpecification]
|
|
218
|
-
// Math
|
|
219
|
-
| ['-', number | ExpressionSpecification, (number | ExpressionSpecification)?] // number
|
|
220
|
-
| ['*', number | ExpressionSpecification, number | ExpressionSpecification, ...(number | ExpressionSpecification)[]] // number
|
|
221
|
-
| ['/', number | ExpressionSpecification, number | ExpressionSpecification] // number
|
|
222
|
-
| ['%', number | ExpressionSpecification, number | ExpressionSpecification] // number
|
|
223
|
-
| ['^', number | ExpressionSpecification, number | ExpressionSpecification] // number
|
|
224
|
-
| ['+', ...(number | ExpressionSpecification)[]] // at least two inputs required -> number
|
|
225
|
-
| ['abs', number | ExpressionSpecification] // number
|
|
226
|
-
| ['acos', number | ExpressionSpecification] // number
|
|
227
|
-
| ['asin', number | ExpressionSpecification] // number
|
|
228
|
-
| ['atan', number | ExpressionSpecification] // number
|
|
229
|
-
| ['ceil', number | ExpressionSpecification] // number
|
|
230
|
-
| ['cos', number | ExpressionSpecification] // number
|
|
231
|
-
| ['distance', Record<string, unknown> | ExpressionSpecification] // number
|
|
232
|
-
| ['ExpressionSpecification'] // number
|
|
233
|
-
| ['floor', number | ExpressionSpecification] // number
|
|
234
|
-
| ['ln', number | ExpressionSpecification] // number
|
|
235
|
-
| ['ln2'] // number
|
|
236
|
-
| ['log10', number | ExpressionSpecification] // number
|
|
237
|
-
| ['log2', number | ExpressionSpecification] // number
|
|
238
|
-
| ['max', number | ExpressionSpecification, ...(number | ExpressionSpecification)[]] // number
|
|
239
|
-
| ['min', number | ExpressionSpecification, ...(number | ExpressionSpecification)[]] // number
|
|
240
|
-
| ['pi'] // number
|
|
241
|
-
| ['round', number | ExpressionSpecification] // number
|
|
242
|
-
| ['sin', number | ExpressionSpecification] // number
|
|
243
|
-
| ['sqrt', number | ExpressionSpecification] // number
|
|
244
|
-
| ['tan', number | ExpressionSpecification] // number
|
|
245
|
-
// Zoom
|
|
246
|
-
| ['zoom'] // number
|
|
247
|
-
// Heatmap
|
|
248
|
-
| ['heatmap-density'] // number
|
|
249
|
-
|
|
250
|
-
export type ExpressionFilterSpecification = boolean | ExpressionSpecification
|
|
251
|
-
|
|
252
|
-
export type LegacyFilterSpecification =
|
|
253
|
-
// Existential
|
|
254
|
-
| ['has', string]
|
|
255
|
-
| ['!has', string]
|
|
256
|
-
// Comparison
|
|
257
|
-
| ['==', string, string | number | boolean]
|
|
258
|
-
| ['!=', string, string | number | boolean]
|
|
259
|
-
| ['>', string, string | number | boolean]
|
|
260
|
-
| ['>=', string, string | number | boolean]
|
|
261
|
-
| ['<', string, string | number | boolean]
|
|
262
|
-
| ['<=', string, string | number | boolean]
|
|
263
|
-
// Set membership
|
|
264
|
-
| ['in', string, ...(string | number | boolean)[]]
|
|
265
|
-
| ['!in', string, ...(string | number | boolean)[]]
|
|
266
|
-
// Combining
|
|
267
|
-
| ['all', ...LegacyFilterSpecification[]]
|
|
268
|
-
| ['any', ...LegacyFilterSpecification[]]
|
|
269
|
-
| ['none', ...LegacyFilterSpecification[]]
|
|
270
|
-
|
|
271
|
-
export type FilterSpecification = ExpressionFilterSpecification | LegacyFilterSpecification
|
|
272
|
-
|
|
273
|
-
export type TransitionSpecification = {
|
|
274
|
-
duration?: number,
|
|
275
|
-
delay?: number
|
|
276
|
-
};
|
|
277
|
-
|
|
278
|
-
// Note: doesn't capture interpolatable vs. non-interpolatable types.
|
|
279
|
-
|
|
280
|
-
export type CameraFunctionSpecification<T> =
|
|
281
|
-
{ type: 'exponential', stops: Array<[number, T]> }
|
|
282
|
-
| { type: 'interval', stops: Array<[number, T]> };
|
|
283
|
-
|
|
284
|
-
export type SourceFunctionSpecification<T> =
|
|
285
|
-
{ type: 'exponential', stops: Array<[number, T]>, property: string, default?: T }
|
|
286
|
-
| { type: 'interval', stops: Array<[number, T]>, property: string, default?: T }
|
|
287
|
-
| { type: 'categorical', stops: Array<[string | number | boolean, T]>, property: string, default?: T }
|
|
288
|
-
| { type: 'identity', property: string, default?: T };
|
|
289
|
-
|
|
290
|
-
export type CompositeFunctionSpecification<T> =
|
|
291
|
-
{ type: 'exponential', stops: Array<[{zoom: number, value: number}, T]>, property: string, default?: T }
|
|
292
|
-
| { type: 'interval', stops: Array<[{zoom: number, value: number}, T]>, property: string, default?: T }
|
|
293
|
-
| { type: 'categorical', stops: Array<[{zoom: number, value: string | number | boolean}, T]>, property: string, default?: T };
|
|
294
|
-
|
|
295
|
-
export type PropertyValueSpecification<T> =
|
|
296
|
-
T
|
|
297
|
-
| CameraFunctionSpecification<T>
|
|
298
|
-
| ExpressionSpecification;
|
|
299
|
-
|
|
300
|
-
export type DataDrivenPropertyValueSpecification<T> =
|
|
301
|
-
T
|
|
302
|
-
| CameraFunctionSpecification<T>
|
|
303
|
-
| SourceFunctionSpecification<T>
|
|
304
|
-
| CompositeFunctionSpecification<T>
|
|
305
|
-
| ExpressionSpecification;
|
|
306
|
-
|
|
307
|
-
${objectDeclaration('StyleSpecification', spec.$root)}
|
|
308
|
-
|
|
309
|
-
${objectDeclaration('LightSpecification', spec.light)}
|
|
310
|
-
|
|
311
|
-
${objectDeclaration('TerrainSpecification', spec.terrain)}
|
|
312
|
-
|
|
313
|
-
${spec.source.map(key => objectDeclaration(sourceTypeName(key), spec[key])).join('\n\n')}
|
|
314
|
-
|
|
315
|
-
export type SourceSpecification =
|
|
316
|
-
${spec.source.map(key => ` | ${sourceTypeName(key)}`).join('\n')}
|
|
317
|
-
|
|
318
|
-
${layerTypes.map(key => layerType(key)).join('\n\n')}
|
|
319
|
-
|
|
320
|
-
export type LayerSpecification =
|
|
321
|
-
${layerTypes.map(key => ` | ${layerTypeName(key)}`).join('\n')};
|
|
322
|
-
|
|
323
|
-
`);
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
import fs from 'fs';
|
|
3
|
-
import childProcess from 'child_process';
|
|
4
|
-
|
|
5
|
-
if (!fs.existsSync('dist')) {
|
|
6
|
-
fs.mkdirSync('dist');
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
console.log('Starting bundling types');
|
|
10
|
-
let outputFile = './dist/maplibre-gl.d.ts';
|
|
11
|
-
childProcess.execSync(`dts-bundle-generator --umd-module-name=maplibregl -o ${outputFile} ./src/index.ts`);
|
|
12
|
-
let types = fs.readFileSync(outputFile, 'utf8');
|
|
13
|
-
// Classes are not exported but should be since this is exported as UMD - fixing...
|
|
14
|
-
types = types.replace(/declare class/g, 'export declare class');
|
|
15
|
-
fs.writeFileSync(outputFile, types);
|
|
16
|
-
|
|
17
|
-
console.log('Finifhed bundling types for maplibre-gl starting style-spec');
|
|
18
|
-
|
|
19
|
-
const outputPath = './dist/style-spec';
|
|
20
|
-
if (!fs.existsSync(outputPath)) {
|
|
21
|
-
fs.mkdirSync(outputPath);
|
|
22
|
-
}
|
|
23
|
-
outputFile = `${outputPath}/index.d.ts`;
|
|
24
|
-
childProcess.execSync(`dts-bundle-generator -o ${outputFile} ./src/style-spec/style-spec.ts`);
|
|
25
|
-
|
|
26
|
-
console.log('Finished bundling types');
|
package/.yarn/unplugged/maplibre-gl-npm-2.4.0-9fa603cf50/node_modules/maplibre-gl/build/readme.md
DELETED
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
# Build Scripts
|
|
2
|
-
This folder holds common build scripts accessed via the various `npm run` commands.
|
|
3
|
-
Codegen is executed when calling `npm install` in order to generate all artifacts needed for the build to pass
|
|
4
|
-
## Bundeling all the code
|
|
5
|
-
|
|
6
|
-
The bundeling process can be split into several steps:
|
|
7
|
-
|
|
8
|
-
`npm run build-css`
|
|
9
|
-
This command will compile the css code and create the css file.
|
|
10
|
-
|
|
11
|
-
`npm run build-prod` and `npm run build-dev`
|
|
12
|
-
These commands will use rollup to bundle the code. This is where the magic happens and uses some files in this folder.
|
|
13
|
-
|
|
14
|
-
`banner.ts` is used to create a banner at the beginning of the output file
|
|
15
|
-
|
|
16
|
-
`rollup_plugins.ts` is used to define common plugins for rollup configurations
|
|
17
|
-
|
|
18
|
-
`rollup_plugin_minify_style_spec.ts` is used to specify the plugin used in style spec bundeling
|
|
19
|
-
|
|
20
|
-
In the `rollup` folder there are some files that are used as linking files as they link to other files for rollup to pick when bundling.
|
|
21
|
-
|
|
22
|
-
Rollup is generating 3 files throughout the process of bundling:
|
|
23
|
-
|
|
24
|
-
`index.ts` a file containing all the code that will run in the main thread.
|
|
25
|
-
|
|
26
|
-
`shared.ts` a file containing all the code shared between the main and worker code.
|
|
27
|
-
|
|
28
|
-
`worker.ts` a file containing all the code the will run in the worker threads.
|
|
29
|
-
|
|
30
|
-
These 3 files are then referenced and used by the `bundle_prelude.js` file. It allows loading the web wroker code automatically in web workers without any extra effort from someone who would like to use the library, i.e. it simply works.
|
|
31
|
-
|
|
32
|
-
### check-bundle-size.js
|
|
33
|
-
This file is used by CI to make sure the bundle size is kept constant
|
|
34
|
-
|
|
35
|
-
<hr>
|
|
36
|
-
|
|
37
|
-
### `npm run codegen`
|
|
38
|
-
The `codegen` command runs the following three scripts, to update the corresponding code files based on the `v8.json` style source, and other data files. Contributers should run this command manually when the underlying style data is modified. The generated code files are then commited to the repo.
|
|
39
|
-
#### generate-struct-arrays.ts
|
|
40
|
-
Generates `data/array_types.ts`, which consists of:
|
|
41
|
-
- `StructArrayLayout_*` subclasses, one for each underlying memory layout
|
|
42
|
-
- Named exports mapping each conceptual array type (e.g., `CircleLayoutArray`) to its corresponding `StructArrayLayout` class
|
|
43
|
-
- Specific named `StructArray` subclasses, when type-specific struct accessors are needed (e.g., `CollisionBoxArray`)
|
|
44
|
-
#### generate-style-code.ts
|
|
45
|
-
Generates the various `style/style_layer/[layer type]_style_layer_properties.ts` code files based on the content of `v8.json`. These files provide the type signatures for the paint and layout properties for each type of style layer.
|
|
46
|
-
#### generate-style-spec.ts
|
|
47
|
-
Generates `style-spec/types.ts` based on the content of `v8.json`. This provides the type signatures for a style specification (sources, layers, etc.).
|
|
48
|
-
<hr>
|
|
49
|
-
|
|
50
|
-
### Generate Release Nodes
|
|
51
|
-
|
|
52
|
-
`release-notes.js` Used to generate release notes when releasing a new version
|