From 81768922c2289c891c1a860a0e544de5564e2fa3 Mon Sep 17 00:00:00 2001 From: Craig Condon Date: Mon, 27 Nov 2023 09:25:49 +0700 Subject: [PATCH] remove center panel component --- .dockerignore | 4 +++ .github/workflows/Dockerfile | 35 +++++++++++++++++++++ libs/designer/src/ui/editor.pc | 33 +++++++------------ libs/designer/src/ui/logic/Editor/index.tsx | 4 +-- libs/evaluator/src/html/tests.rs | 11 ++++--- libs/parser/src/docco/parser.rs | 1 + libs/parser/src/docco/tokenizer.rs | 4 +++ 7 files changed, 63 insertions(+), 29 deletions(-) create mode 100644 .dockerignore create mode 100644 .github/workflows/Dockerfile diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 000000000..86cddaaea --- /dev/null +++ b/.dockerignore @@ -0,0 +1,4 @@ +node_modules +.cargo +**/node_modules + diff --git a/.github/workflows/Dockerfile b/.github/workflows/Dockerfile new file mode 100644 index 000000000..4f62db91a --- /dev/null +++ b/.github/workflows/Dockerfile @@ -0,0 +1,35 @@ +FROM ubuntu:22.04 + +# Update default packages +RUN apt-get update + +# Get Ubuntu packages +RUN apt-get install -y build-essential curl wget musl-tools unzip clang + +# Update new packages +RUN apt-get update + +RUN curl https://sh.rustup.rs -sSf | bash -s -- -y +ENV PATH="/root/.cargo/bin:${PATH}" + + + +RUN mkdir -p /tmp/protoc && cd /tmp/protoc +RUN wget -qO- https://github.com/protocolbuffers/protobuf/releases/download/v25.1/protoc-25.1-linux-x86_64.zip -O temp.zip +RUN unzip temp.zip +RUN unzip -o temp.zip -d "/usr" +RUN chmod 755 /usr/bin/protoc + + +COPY . /app +WORKDIR /app + +ENV TARGET=x86_64-unknown-linux-musl +ENV RUSTFLAGS='-C linker=clang -C link-arg=-fuse-ld=lld -C link-arg=-lpthread -C link-arg=-lm' +# ENV TARGET_CC=x86_64-linux-musl-gcc + + +RUN rustup target add ${TARGET} +RUN cargo build --release --locked --target ${TARGET} + +CMD echo "hello" \ No newline at end of file diff --git a/libs/designer/src/ui/editor.pc b/libs/designer/src/ui/editor.pc index efd62bc76..5afb270e1 100644 --- a/libs/designer/src/ui/editor.pc +++ b/libs/designer/src/ui/editor.pc @@ -47,7 +47,7 @@ public component SplashInfo { top: 60px } } - div commands { + div commandsContainer { style { display: flex flex-direction: column @@ -105,21 +105,6 @@ public component SplashInfo { } } -/** - * @bounds(x: 1209, y: -99, width: 886, height: 213) -*/ -public component CenterPanels { - render div { - style { - display: flex - flex: 1 - flex-direction: column - justify-content: space-between - } - toolbar.Toolbar - } -} - /** * @bounds(x: 6874, y: 1592, width: 345, height: 71) */ @@ -198,11 +183,7 @@ public component Editor { Canvas } if showSplash { - SplashInfo { - insert commands { - slot commands - } - } + SplashInfo splash } div editorPanels { style { @@ -219,7 +200,15 @@ public component Editor { } leftSidebar.LeftSidebar leftSidebar if showCanvas { - CenterPanels + render div centerPanels { + style { + display: flex + flex: 1 + flex-direction: column + justify-content: space-between + } + toolbar.Toolbar + } module.SidebarContainer { rightSidebar.RightSidebar rightPanel } diff --git a/libs/designer/src/ui/logic/Editor/index.tsx b/libs/designer/src/ui/logic/Editor/index.tsx index a3fa5310a..e6f3b5c42 100644 --- a/libs/designer/src/ui/logic/Editor/index.tsx +++ b/libs/designer/src/ui/logic/Editor/index.tsx @@ -19,7 +19,7 @@ export const Editor = (Base: React.FC) => () => { return ( <> - {shortcuts .filter((shortcut) => @@ -41,7 +41,7 @@ export const Editor = (Base: React.FC) => () => { /> ))} - } /> + }} /> diff --git a/libs/evaluator/src/html/tests.rs b/libs/evaluator/src/html/tests.rs index 8b3806e1c..1dac1ae6f 100644 --- a/libs/evaluator/src/html/tests.rs +++ b/libs/evaluator/src/html/tests.rs @@ -695,19 +695,20 @@ add_case! { } // add_case! { -// previews_are_also_used_in_instances, +// previews_can_define_a_collection_of_values, // [ // ("/entry.pc", r#" // /** -// * @preview(showTest: true, nested: (showSomethingElse: true)) +// * @preview(items: [(value: 1), (value: 2)]) // */ // component A { // render div root { -// if showTest { -// text "blarg" +// repeat items { +// div { +// slot value +// } // } -// B nested // } // } // A diff --git a/libs/parser/src/docco/parser.rs b/libs/parser/src/docco/parser.rs index 3f6eb875e..c54021143 100644 --- a/libs/parser/src/docco/parser.rs +++ b/libs/parser/src/docco/parser.rs @@ -245,6 +245,7 @@ fn parse_property_value( match context.curr_token { Some(Token::String(_)) => Ok(ast::property_value::Inner::Str(parse_string(context)?)), Some(Token::ParenOpen) => Ok(ast::property_value::Inner::Parameters(parse_parameters(context)?)), + // Some(Token::BracketOpen) => Ok(ast::property_value::Inner::Parameters(parse_parameters(context)?)), Some(Token::Number(_)) => Ok(ast::property_value::Inner::Num(parse_number(context)?)), Some(Token::Boolean(_)) => Ok(ast::property_value::Inner::Bool(parse_boolean(context)?)), _ => Err(context.new_unexpected_token_error()), diff --git a/libs/parser/src/docco/tokenizer.rs b/libs/parser/src/docco/tokenizer.rs index 84e8f5f24..9f7370e32 100644 --- a/libs/parser/src/docco/tokenizer.rs +++ b/libs/parser/src/docco/tokenizer.rs @@ -14,6 +14,8 @@ pub enum Token<'src> { Word(&'src [u8]), ParenOpen, ParenClose, + BracketOpen, + BracketClose, Boolean(bool), Colon, Comma, @@ -36,6 +38,8 @@ pub fn next_token<'src>( b'@' => Token::At, b'(' => Token::ParenOpen, b')' => Token::ParenClose, + b'[' => Token::BracketOpen, + b']' => Token::BracketClose, b':' => Token::Colon, b',' => Token::Comma, b'-' => {