From 71f4e9507cac5386980945544df85a9deb70a142 Mon Sep 17 00:00:00 2001 From: Anthony Donlon Date: Mon, 22 Dec 2025 21:27:47 +0800 Subject: [PATCH] editor/web: support responsive save as dialog --- editor/web/index.html | 134 +++++++++++++++++++++--------- editor/web/src/codegen/js.ejs | 2 +- editor/web/src/codegen/json.ejs | 2 +- editor/web/src/codegen/python.ejs | 2 +- editor/web/src/index.js | 13 +-- 5 files changed, 106 insertions(+), 47 deletions(-) diff --git a/editor/web/index.html b/editor/web/index.html index 5d1e72b..e34a755 100644 --- a/editor/web/index.html +++ b/editor/web/index.html @@ -148,6 +148,75 @@ --bs-popover-body-padding-x: 0.7rem !important; --bs-popover-body-padding-y: 0.5rem !important; } + + .save-as-dialog__container { + display: grid; + grid-template-areas: + "selector" + "code" + "buttons"; + height: fit-content; + grid-template-columns: auto; + gap: 1em; + } + + .save-as-dialog__selector { + grid-area: selector; + min-width: 10em; + } + + .save-as-dialog__code { + grid-area: code; + width: 100%; + height: 100%; + min-height: 700px !important; + font-family: monospace; + font-size: 0.8em !important; + } + + .save-as-dialog__buttons { + grid-area: buttons; + flex-direction: row; + } + + .save-as-dialog__buttons>* { + flex: 1 1 auto; + } + + @media (min-width: 576px) { + .save-as-dialog__container { + grid-template-areas: + "selector code" + "buttons code"; + grid-template-columns: auto 2fr; + height: 100%; + } + + .save-as-dialog__selector { + text-align: right; + } + + .save-as-dialog__code { + min-height: 0 !important; + } + + .save-as-dialog__buttons { + grid-area: buttons; + flex-direction: column; + justify-content: flex-end !important; + } + + .save-as-dialog__buttons>* { + flex: none; + } + } + + @media (min-width: 992px) { + .save-as-dialog__selector { + grid-area: selector; + min-width: 13em; + } + } @@ -408,7 +477,7 @@ - +
@@ -443,51 +512,38 @@
-