feat: Add a simple mode to the visual card editor (#2588)

This commit is contained in:
Dermot Duffy
2026-07-21 19:13:29 -07:00
committed by GitHub
parent b6e1de5999
commit e29c0826cf
56 changed files with 1722 additions and 353 deletions
+14
View File
@@ -0,0 +1,14 @@
import { z } from 'zod';
const EDITOR_MODES = ['simple', 'full'] as const;
const editorModeSchema = z.enum(EDITOR_MODES);
export type EditorMode = z.infer<typeof editorModeSchema>;
// Options for the visual editor. The card itself renders identically whatever
// these are set to.
export const editorConfigSchema = z.object({
// Which editor experience to show. When unset, the editor chooses for itself
// based on whether the configuration only uses settings the simple editor can
// express.
mode: editorModeSchema.optional(),
});
+2
View File
@@ -6,6 +6,7 @@ import { cameraConfigDefault, cameraConfigSchema, camerasConfigSchema } from './
import { cardIDRegex } from './common/const';
import { debugConfigDefault, debugConfigSchema, type DebugConfig } from './debug';
import { dimensionsConfigSchema } from './dimensions';
import { editorConfigSchema } from './editor';
import { pictureElementsSchema } from './elements/types';
import { foldersConfigSchema } from './folders';
import { imageConfigDefault, imageConfigSchema } from './image';
@@ -51,6 +52,7 @@ export const advancedCameraCardConfigSchema = z.object({
timeline: timelineConfigSchema,
performance: performanceConfigSchema,
debug: debugConfigSchema,
editor: editorConfigSchema.optional(),
automations: automationsSchema.optional(),
profiles: profilesSchema,