mirror of
https://github.com/maputnik/editor.git
synced 2026-07-26 07:47:25 +00:00
Compare commits
2 Commits
e5e09e846a
...
0b076e3896
| Author | SHA1 | Date | |
|---|---|---|---|
| 0b076e3896 | |||
| cf54b6fdeb |
Generated
+8
-8
@@ -20,7 +20,7 @@
|
||||
"@mapbox/mapbox-gl-rtl-text": "^0.4.0",
|
||||
"@maplibre/maplibre-gl-geocoder": "^1.9.4",
|
||||
"@maplibre/maplibre-gl-inspect": "^1.8.2",
|
||||
"@maplibre/maplibre-gl-style-spec": "^25.0.2",
|
||||
"@maplibre/maplibre-gl-style-spec": "^26.1.0",
|
||||
"array-move": "^4.0.0",
|
||||
"buffer": "^6.0.3",
|
||||
"classnames": "^2.5.1",
|
||||
@@ -92,7 +92,7 @@
|
||||
"@vitejs/plugin-react": "5.2",
|
||||
"@vitest/coverage-v8": "^4.1.10",
|
||||
"cors": "^2.8.6",
|
||||
"eslint": "^10.6.0",
|
||||
"eslint": "^10.7.0",
|
||||
"eslint-plugin-react": "^7.37.5",
|
||||
"eslint-plugin-react-hooks": "^7.1.1",
|
||||
"eslint-plugin-react-refresh": "^0.5.3",
|
||||
@@ -2179,9 +2179,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@maplibre/maplibre-gl-style-spec": {
|
||||
"version": "25.0.2",
|
||||
"resolved": "https://registry.npmjs.org/@maplibre/maplibre-gl-style-spec/-/maplibre-gl-style-spec-25.0.2.tgz",
|
||||
"integrity": "sha512-hTNlIVG1gaLKz6UvOV23PYcT8wVS69LLMK9jbGT2hDWzs6hlTbMejeMyQsAF0rebj9czVp77Vhp4KRaUHHUp9g==",
|
||||
"version": "26.1.0",
|
||||
"resolved": "https://registry.npmjs.org/@maplibre/maplibre-gl-style-spec/-/maplibre-gl-style-spec-26.1.0.tgz",
|
||||
"integrity": "sha512-JaVj0XqDWFb2xfaRFCvF2Gi7qSpCYXXJlVghDDfRUV2dks61YsQKDjlZKT3H+oVwFBxX7CjErz9zjdGTEP/Lug==",
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"@mapbox/jsonlint-lines-primitives": "^2.0.3",
|
||||
@@ -5857,9 +5857,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/eslint": {
|
||||
"version": "10.6.0",
|
||||
"resolved": "https://registry.npmjs.org/eslint/-/eslint-10.6.0.tgz",
|
||||
"integrity": "sha512-6lVbcqSodALYo+4ELD0heG6lFiFxnLMuLkiMi2qV8LMp54N8tE8FT1GMH+ev4Ti00nFjNze2+Su6DsV5OQW3Dg==",
|
||||
"version": "10.7.0",
|
||||
"resolved": "https://registry.npmjs.org/eslint/-/eslint-10.7.0.tgz",
|
||||
"integrity": "sha512-GVTD7s1vdIl6UYvAfriOPeY1Df8LIZjfofLvHwde+erDHGGuHyuM6xoxRxmHiebhYuD2p1vN4wWh0XzPARSGDQ==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"workspaces": [
|
||||
|
||||
+2
-2
@@ -37,7 +37,7 @@
|
||||
"@mapbox/mapbox-gl-rtl-text": "^0.4.0",
|
||||
"@maplibre/maplibre-gl-geocoder": "^1.9.4",
|
||||
"@maplibre/maplibre-gl-inspect": "^1.8.2",
|
||||
"@maplibre/maplibre-gl-style-spec": "^25.0.2",
|
||||
"@maplibre/maplibre-gl-style-spec": "^26.1.0",
|
||||
"array-move": "^4.0.0",
|
||||
"buffer": "^6.0.3",
|
||||
"classnames": "^2.5.1",
|
||||
@@ -126,7 +126,7 @@
|
||||
"@vitejs/plugin-react": "5.2",
|
||||
"@vitest/coverage-v8": "^4.1.10",
|
||||
"cors": "^2.8.6",
|
||||
"eslint": "^10.6.0",
|
||||
"eslint": "^10.7.0",
|
||||
"eslint-plugin-react": "^7.37.5",
|
||||
"eslint-plugin-react-hooks": "^7.1.1",
|
||||
"eslint-plugin-react-refresh": "^0.5.3",
|
||||
|
||||
@@ -2,7 +2,10 @@ import { InputDynamicArray, type InputDynamicArrayProps } from "./InputDynamicAr
|
||||
import { Fieldset } from "./Fieldset";
|
||||
|
||||
type FieldDynamicArrayProps = InputDynamicArrayProps & {
|
||||
name?: string
|
||||
name?: string;
|
||||
fieldSpec?: {
|
||||
value?: string;
|
||||
}
|
||||
};
|
||||
|
||||
export const FieldDynamicArray: React.FC<FieldDynamicArrayProps> = (props) => {
|
||||
|
||||
@@ -74,20 +74,20 @@ function getLayoutForType(type: LayerSpecification["type"], t: TFunction): Maput
|
||||
return getLayoutForSymbolType(t);
|
||||
}
|
||||
const groups: MaputnikLayoutGroup[] = [];
|
||||
if (Object.keys(v8["paint_" + type]).length > 0) {
|
||||
if (Object.keys(v8["paint_" + type as keyof typeof v8]).length > 0) {
|
||||
groups.push({
|
||||
title: t("Paint properties"),
|
||||
id: "Paint_properties",
|
||||
type: "properties",
|
||||
fields: Object.keys(v8["paint_" + type]),
|
||||
fields: Object.keys(v8["paint_" + type as keyof typeof v8]),
|
||||
});
|
||||
}
|
||||
if (Object.keys(v8["layout_" + type]).length > 0) {
|
||||
if (Object.keys(v8["layout_" + type as keyof typeof v8]).length > 0) {
|
||||
groups.push({
|
||||
title: t("Layout properties"),
|
||||
id: "Layout_properties",
|
||||
type: "properties",
|
||||
fields: Object.keys(v8["layout_" + type])
|
||||
fields: Object.keys(v8["layout_" + type as keyof typeof v8])
|
||||
});
|
||||
}
|
||||
return groups;
|
||||
|
||||
@@ -119,7 +119,7 @@ function createMaplibreExpressionLinter(spec?: StylePropertySpecification) {
|
||||
const text = view.state.doc.toString();
|
||||
const parsedJson = JSON.parse(text);
|
||||
const ast = jsonToAst(text);
|
||||
const out = expression.createExpression(parsedJson, spec);
|
||||
const out = expression.createExpression(parsedJson, "expression", spec);
|
||||
if (out?.result !== "error") {
|
||||
return [];
|
||||
}
|
||||
|
||||
+2
-2
@@ -5,14 +5,14 @@ import { type LayerSpecification } from "maplibre-gl";
|
||||
export function changeType(layer: LayerSpecification, newType: string): LayerSpecification {
|
||||
const changedPaintProps: LayerSpecification["paint"] = { ...layer.paint };
|
||||
Object.keys(changedPaintProps).forEach(propertyName => {
|
||||
if(!(propertyName in latest["paint_" + newType])) {
|
||||
if(!(propertyName in ((latest["paint_" + newType as keyof typeof latest]) as string[]))) {
|
||||
delete changedPaintProps[propertyName as keyof LayerSpecification["paint"]];
|
||||
}
|
||||
});
|
||||
|
||||
const changedLayoutProps: LayerSpecification["layout"] = { ...layer.layout };
|
||||
Object.keys(changedLayoutProps).forEach(propertyName => {
|
||||
if(!(propertyName in latest["layout_" + newType])) {
|
||||
if(!(propertyName in ((latest["layout_" + newType as keyof typeof latest]) as string[]))) {
|
||||
delete changedLayoutProps[propertyName as keyof LayerSpecification["layout"]];
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user