@@ -754,8 +756,8 @@ class CardEditor extends connect(store)(LitElement) {
` :
html`
-
-
+
+
`}
diff --git a/src/reducers/editor.ts b/src/reducers/editor.ts
index 0fb4e330..e4ac3898 100644
--- a/src/reducers/editor.ts
+++ b/src/reducers/editor.ts
@@ -41,10 +41,6 @@ import {
SomeAction,
} from '../actions.js';
-import {
- TAB_CONFIG
-} from '../type_constants.js';
-
import {
SET_PENDING_SLUG
} from '../actions.js';
@@ -83,10 +79,11 @@ import {
import {
EditorContentTab,
EditorState,
+ EditorTab,
ImageInfoStringProperty
} from '../types.js';
-const DEFAULT_TAB = TAB_CONFIG;
+const DEFAULT_TAB : EditorTab = 'config';
const DEFAULT_EDITOR_TAB : EditorContentTab = 'content';
const INITIAL_STATE : EditorState = {
diff --git a/src/type_constants.ts b/src/type_constants.ts
index 96695ec8..f58826be 100644
--- a/src/type_constants.ts
+++ b/src/type_constants.ts
@@ -97,15 +97,6 @@ export const REFERENCE_TYPE_TYPES = {
[REFERENCE_TYPE_CITATION_PERSON]: true
};
-export const TAB_CONTENT = 'content';
-export const TAB_CONFIG = 'config';
-
-//Drives EditorTab type
-export const EDITOR_TAB_TYPES = {
- [TAB_CONTENT]: true,
- [TAB_CONFIG]: true
-};
-
export const CARDS_COLLECTION = 'cards';
export const CARD_UPDATES_COLLECTION = 'updates';
export const SECTION_UPDATES_COLLECTION = 'updates';
diff --git a/src/types.ts b/src/types.ts
index b48161b1..eac41e00 100644
--- a/src/types.ts
+++ b/src/types.ts
@@ -11,7 +11,6 @@ import {
TEXT_FIELD_TYPES,
REFERENCE_TYPE_TYPES,
TEXT_FIELD_TYPES_EDITABLE,
- EDITOR_TAB_TYPES,
FIND_CARD_TO_LINK,
FIND_CARD_TO_PERMISSION,
FIND_CARD_TO_REFERENCE,
@@ -395,7 +394,13 @@ export type ConfigurableFilterConfigurationMap = {
};
//TODO: this name is confusing, in the state this is just called tab
-export type EditorTab = keyof(typeof EDITOR_TAB_TYPES);
+
+const editorTabSchema = z.enum([
+ 'content',
+ 'config'
+]);
+
+export type EditorTab = z.infer
;
const editorContentTabSchema = z.enum([
'content',
@@ -1330,4 +1335,5 @@ export type State = {
//will be used in a generic string context and want type-checking to verify it
//is part of the enum.
export const setName = (input : SetName) => input;
+export const editorTab = (input : EditorTab) => input;
export const editorContentTab = (input : EditorContentTab) => input;
\ No newline at end of file