diff --git a/spyglass.json b/spyglass.json new file mode 100644 index 00000000..1c40d694 --- /dev/null +++ b/spyglass.json @@ -0,0 +1,12 @@ +{ + "env": { + "dependencies": [ + "@vanilla-mcdoc" + ], + "exclude": [ + ".*/**", + "**/node_modules/**", + "**/dist/**" + ] + } +} diff --git a/src/app/components/previews/DialogPreview.tsx b/src/app/components/previews/DialogPreview.tsx index 23c3a1ee..85edbb08 100644 --- a/src/app/components/previews/DialogPreview.tsx +++ b/src/app/components/previews/DialogPreview.tsx @@ -12,7 +12,7 @@ export const DialogPreview = ({ docAndNode }: PreviewProps) => { const text = docAndNode.doc.getText() const dialog = safeJsonParse(text) ?? {} const type = dialog.type?.replace(/^minecraft:/, '') - const footerHeight = type === 'multi_action_input_form' ? 5 : 33 + const footerHeight = (type === 'dialog_list' || type == 'multi_action' || type == 'server_links') && dialog.exit_action == undefined ? 5 : 33 useEffect(() => { function resizeHandler() { @@ -30,9 +30,10 @@ export const DialogPreview = ({ docAndNode }: PreviewProps) => {
-
+
- + +
@@ -43,7 +44,6 @@ export const DialogPreview = ({ docAndNode }: PreviewProps) => { } function DialogTitle({ title }: { title: any }) { - // TODO: add warning button tooltip return
@@ -85,7 +85,13 @@ function DialogBody({ body }: { body: any }) { } -function DialogContent({ dialog }: { dialog: any }) { +function DialogInputs({ inputs }: { inputs: any[] | undefined }) { + return <> + {inputs?.map((i: any) => )} + +} + +function DialogActions({ dialog }: { dialog: any }) { const type = dialog.type?.replace(/^minecraft:/, '') if (type === 'dialog_list') { @@ -116,17 +122,6 @@ function DialogContent({ dialog }: { dialog: any }) { } - if (type === 'multi_action_input_form') { - return <> - {dialog.inputs?.map((i: any) => )} - - {dialog.actions?.map((a: any) => -
} - if (type === 'dialog_list') { - return
} - if (type === 'server_links') { - return
- } - return <> } diff --git a/src/styles/global.css b/src/styles/global.css index 718a4990..488bcd5e 100644 --- a/src/styles/global.css +++ b/src/styles/global.css @@ -1941,7 +1941,8 @@ hr { border-image-slice: 1 fill; border-image-repeat: repeat; display: flex; - align-items: center; + align-items: flex-start; + padding-top: calc(var(--dialog-px) * 4); padding-left: calc(var(--dialog-px) * 4); }