Update style-spec package to 26.1 (#2005)

## Launch Checklist

Update style-spec package to version 26.1
This should solve a problem related to expression validation.

 - [x] Briefly describe the changes in this PR.
 - [x] Link to related issues.
This commit is contained in:
Harel M
2026-07-14 14:14:28 +03:00
committed by GitHub
parent e5e09e846a
commit cf54b6fdeb
6 changed files with 16 additions and 13 deletions
+4 -1
View File
@@ -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) => {
+4 -4
View File
@@ -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;
+1 -1
View File
@@ -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
View File
@@ -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"]];
}
});