feat: optional timeline registration

This commit is contained in:
ccmdi 2025-11-15 11:44:08 -05:00
parent eee17ec0d1
commit abe91b400d
No known key found for this signature in database
6 changed files with 38 additions and 14 deletions

View file

@ -1,7 +1,7 @@
{
"id": "mapplus",
"name": "Map+",
"version": "1.0.2",
"version": "1.0.5",
"minAppVersion": "1.10.0",
"description": "A performant and customizable map inside Bases",
"author": "ccmdi",

4
package-lock.json generated
View file

@ -1,12 +1,12 @@
{
"name": "mapplus",
"version": "1.0.2",
"version": "1.0.5",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "mapplus",
"version": "1.0.2",
"version": "1.0.5",
"license": "MIT",
"dependencies": {
"@deck.gl/core": "^9.1.15",

View file

@ -1,6 +1,6 @@
{
"name": "mapplus",
"version": "1.0.2",
"version": "1.0.5",
"description": "A performant and customizable map inside Bases",
"main": "main.js",
"scripts": {

View file

@ -33,12 +33,9 @@ export default class MapPlugin extends Plugin {
options: () => MapBasesView.getViewOptions(),
});
this.registerBasesView('map-timeline', {
name: 'Map Timeline',
icon: 'lucide-calendar',
factory: (controller, containerEl) => new MapTimelineBasesView(controller, containerEl, this),
options: () => MapTimelineBasesView.getViewOptions(),
});
if (this.settings.enableTimelineView) {
this.registerTimelineView();
}
this.addSettingTab(new MapSettingTab(this.app, this));
}
@ -60,4 +57,13 @@ export default class MapPlugin extends Plugin {
refreshAllMapViews() {
this.app.workspace.trigger('map:refresh-all-views');
}
registerTimelineView() {
this.registerBasesView('map-timeline', {
name: 'Map timeline',
icon: 'lucide-calendar',
factory: (controller, containerEl) => new MapTimelineBasesView(controller, containerEl, this),
options: () => MapTimelineBasesView.getViewOptions(),
});
}
}

View file

@ -12,6 +12,7 @@ export interface MapPluginSettings {
enableThumbnailCache: boolean;
thumbnailTargetSize: number;
tagSettings: MapTagSettings;
enableTimelineView: boolean;
}
export const DEFAULT_SETTINGS: MapPluginSettings = {
@ -23,7 +24,8 @@ export const DEFAULT_SETTINGS: MapPluginSettings = {
transitionDuration: 1000,
enableThumbnailCache: false,
thumbnailTargetSize: 25,
tagSettings: DEFAULT_MAP_TAG_SETTINGS
tagSettings: DEFAULT_MAP_TAG_SETTINGS,
enableTimelineView: false
};
export class MapSettingTab extends PluginSettingTab {
@ -223,5 +225,23 @@ export class MapSettingTab extends PluginSettingTab {
}
renderTagCustomizations(containerEl, this.app, this.plugin);
new Setting(containerEl)
.setName('Views')
.setHeading();
new Setting(containerEl)
.setName('Enable map timeline view')
.setDesc('Enable the map timeline view for filtering by date range (disable requires restart)')
.addToggle(toggle => toggle
.setValue(this.plugin.settings.enableTimelineView)
.onChange(async (value) => {
this.plugin.settings.enableTimelineView = value;
await this.plugin.saveSettings();
if (value) {
this.plugin.registerTimelineView();
}
}));
}
}

View file

@ -1,5 +1,3 @@
{
"1.0.0": "1.10.0",
"1.0.1": "1.10.0",
"1.0.2": "1.10.0"
"1.0.0": "1.10.0"
}