This commit is contained in:
Rizky 2024-01-20 06:02:25 +07:00
parent 553b59460c
commit b0535338c4
2 changed files with 55 additions and 48 deletions

View File

@ -31,10 +31,13 @@ export const EdScriptWorkbench = () => {
<div className="flex flex-1 items-stretch">
<div className="flex flex-1 flex-col ">
<div className="flex border-b items-stretch">
{active.script_nav.list.length > 0 && (
<div className="border-r px-2 flex items-center">
<div
className={cx(scriptNav.canBack ? "" : "text-slate-200")}
className={cx(
scriptNav.canBack
? "cursor-pointer hover:text-blue-400"
: "text-slate-200"
)}
onClick={() => {
if (scriptNav.canBack) {
active.script_nav.idx = active.script_nav.idx - 1;
@ -55,7 +58,11 @@ export const EdScriptWorkbench = () => {
<ChevronLeft />
</div>
<div
className={cx(scriptNav.canNext ? "" : "text-slate-200")}
className={cx(
scriptNav.canNext
? "cursor-pointer hover:text-blue-400"
: "text-slate-200"
)}
onClick={() => {
if (scriptNav.canNext) {
active.script_nav.idx = active.script_nav.idx + 1;
@ -76,7 +83,6 @@ export const EdScriptWorkbench = () => {
<ChevronRight />
</div>
</div>
)}
{p.ui.popup.script.type === "prop-master" && <CompTitleMaster />}
{p.ui.popup.script.type === "prop-instance" && <CompTitleInstance />}
{p.ui.popup.script.type === "item" && (
@ -208,8 +214,8 @@ const ArrowRight = () => (
export const ChevronRight = () => (
<svg
xmlns="http://www.w3.org/2000/svg"
width={15}
height={15}
width={"22"}
height={"22"}
fill="none"
viewBox="0 0 15 15"
>
@ -225,8 +231,8 @@ export const ChevronRight = () => (
export const ChevronLeft = () => (
<svg
xmlns="http://www.w3.org/2000/svg"
width="15"
height="15"
width="22"
height="22"
viewBox="0 0 24 24"
>
<path

View File

@ -60,6 +60,7 @@ export const jsMount = async (editor: MonacoEditor, monaco: Monaco, p?: PG) => {
if (args.length === 3) {
const loc = extractLoc(args, p);
if (loc.meta) {
if (active.script_nav.idx >= 0)
active.script_nav.list.length = active.script_nav.idx;
active.script_nav.list.push({
item_id: active.item_id,