feat: Add a simple mode to the visual card editor (#2588)
This commit is contained in:
@@ -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(),
|
||||
});
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user