mirror of
https://github.com/zadam/trilium.git
synced 2025-10-20 15:19:01 +02:00
feat(book_properties): group dark map styles
This commit is contained in:
parent
d17f5b8447
commit
0dffa0f333
@ -1969,7 +1969,8 @@
|
|||||||
"map-style": "Map style:",
|
"map-style": "Map style:",
|
||||||
"max-nesting-depth": "Max nesting depth:",
|
"max-nesting-depth": "Max nesting depth:",
|
||||||
"raster": "Raster",
|
"raster": "Raster",
|
||||||
"vector": "Vector"
|
"vector_light": "Vector (Light)",
|
||||||
|
"vector_dark": "Vector (Dark)"
|
||||||
},
|
},
|
||||||
"table_context_menu": {
|
"table_context_menu": {
|
||||||
"delete_row": "Delete row"
|
"delete_row": "Delete row"
|
||||||
|
@ -3,7 +3,7 @@ import FNote from "../../entities/fnote";
|
|||||||
import attributes from "../../services/attributes";
|
import attributes from "../../services/attributes";
|
||||||
import { ViewTypeOptions } from "../../services/note_list_renderer"
|
import { ViewTypeOptions } from "../../services/note_list_renderer"
|
||||||
import NoteContextAwareWidget from "../note_context_aware_widget";
|
import NoteContextAwareWidget from "../note_context_aware_widget";
|
||||||
import { DEFAULT_MAP_LAYER_NAME, MAP_LAYERS } from "../view_widgets/geo_view/map_layer";
|
import { DEFAULT_MAP_LAYER_NAME, MAP_LAYERS, type MapLayer } from "../view_widgets/geo_view/map_layer";
|
||||||
|
|
||||||
interface BookConfig {
|
interface BookConfig {
|
||||||
properties: BookProperty[];
|
properties: BookProperty[];
|
||||||
@ -123,19 +123,19 @@ export const bookPropertiesConfig: Record<ViewTypeOptions, BookConfig> = {
|
|||||||
name: t("book_properties_config.raster"),
|
name: t("book_properties_config.raster"),
|
||||||
items: Object.entries(MAP_LAYERS)
|
items: Object.entries(MAP_LAYERS)
|
||||||
.filter(([_, layer]) => layer.type === "raster")
|
.filter(([_, layer]) => layer.type === "raster")
|
||||||
.map(([id, layer]) => ({
|
.map(buildMapLayer)
|
||||||
value: id,
|
|
||||||
label: layer.name
|
|
||||||
}))
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: t("book_properties_config.vector"),
|
name: t("book_properties_config.vector_light"),
|
||||||
items: Object.entries(MAP_LAYERS)
|
items: Object.entries(MAP_LAYERS)
|
||||||
.filter(([_, layer]) => layer.type === "vector")
|
.filter(([_, layer]) => layer.type === "vector" && !layer.isDarkTheme)
|
||||||
.map(([id, layer]) => ({
|
.map(buildMapLayer)
|
||||||
value: id,
|
},
|
||||||
label: layer.name
|
{
|
||||||
}))
|
name: t("book_properties_config.vector_dark"),
|
||||||
|
items: Object.entries(MAP_LAYERS)
|
||||||
|
.filter(([_, layer]) => layer.type === "vector" && layer.isDarkTheme)
|
||||||
|
.map(buildMapLayer)
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
@ -155,3 +155,10 @@ export const bookPropertiesConfig: Record<ViewTypeOptions, BookConfig> = {
|
|||||||
properties: []
|
properties: []
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
function buildMapLayer([ id, layer ]: [ string, MapLayer ]): ComboBoxItem {
|
||||||
|
return {
|
||||||
|
value: id,
|
||||||
|
label: layer.name
|
||||||
|
};
|
||||||
|
}
|
||||||
|
@ -1,14 +1,14 @@
|
|||||||
interface Layer {
|
export interface MapLayer {
|
||||||
name: string;
|
name: string;
|
||||||
isDarkTheme?: boolean;
|
isDarkTheme?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
interface VectorLayer extends Layer {
|
interface VectorLayer extends MapLayer {
|
||||||
type: "vector";
|
type: "vector";
|
||||||
style: string | (() => Promise<{}>)
|
style: string | (() => Promise<{}>)
|
||||||
}
|
}
|
||||||
|
|
||||||
interface RasterLayer extends Layer {
|
interface RasterLayer extends MapLayer {
|
||||||
type: "raster";
|
type: "raster";
|
||||||
url: string;
|
url: string;
|
||||||
attribution: string;
|
attribution: string;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user