Skip to content

Commit

Permalink
Merge pull request #151 from gridaco/organization
Browse files Browse the repository at this point in the history
Project Organization
  • Loading branch information
softmarshmallow authored Aug 27, 2021
2 parents 64e9ce1 + 80db25f commit f67ea01
Show file tree
Hide file tree
Showing 222 changed files with 812 additions and 621 deletions.
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,7 @@ webdev/.eslintcache


# we use yarn
package-lock.json
package-lock.json

# log including yarn error log
.log
13 changes: 4 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,8 @@ title: Grida assistant for figma, sketch, xd

![Grida assistant](./branding/assistant-cover-v2021.8.0.png)





<div style="text-align:center"><a href="https://www.producthunt.com/posts/grida-assistant-figma-2-flutter-react?utm_source=badge-featured&utm_medium=badge&utm_souce=badge-grida-assistant-figma-2-flutter-react" target="_blank"><img src="https://api.producthunt.com/widgets/embed-image/v1/featured.svg?post_id=310028&theme=light" alt="Grida Assistant - Figma 2 Flutter &React - Free & Opensource Design2Code Plugin with lot more features. | Product Hunt" style="width: 250px; height: 54px;" width="250" height="54" /></a></div>





# Grdia Assistant plugin (figma to flutter)

> Any design to high quality code, with live preview.
Expand Down Expand Up @@ -53,9 +45,12 @@ cd assistant
# [REQUIRED] yarn will install dependencies, link packages, and generate compiled code of packages, so it can be referenced by root projects.
yarn

# [OPTIONAL 1] run figma plugin in dev mode
# [OPTIONAL 1] run figma plugin in dev mode (use localhost server) (recommanded)
yarn figma

# [OPTIONAL 1-2] run figma plugin in dev mode (native)
yarn figma-native

# [OPTIONAL 2]run sketch plugin in dev mode
yarn sketch

Expand Down
File renamed without changes.
4 changes: 4 additions & 0 deletions app/__plugin__init__/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
// DO NOT REMOVE THIS LINE
import "../lib/pages/code/__plugin";
import "@app/data-mapper/__plugin";
import "@app/design-lint/__plugin";
2 changes: 1 addition & 1 deletion app/lib/components/animation/animated-check-icon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React from "react";
import styled from "@emotion/styled";

import { motion } from "framer-motion";
import { CheckIcon } from "../Icon/check-icon";
import CheckIcon from "@assistant/icons/check";

const variants = {
"make-active": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ interface IProgressBar {
contorl?: () => void;
}

export function ProgressBar(props: IProgressBar) {
export function AnimatedProgressBar(props: IProgressBar) {
return (
<Background>
<AnimatePresence>
Expand Down
4 changes: 2 additions & 2 deletions app/lib/components/comming-soon-template.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import styled from "@emotion/styled";
import React, { ReactNode } from "react";
import { BlackButton } from "./style/global-style";
import { BlackButtonStyle } from "@ui/core/button-style";

interface Props {
coverImage?: string;
Expand Down Expand Up @@ -50,6 +50,6 @@ const ButtonWrapper = styled.div`
`;

const Button = styled.button`
${BlackButton}
${BlackButtonStyle}
width: calc(100vw - 32px);
`;
3 changes: 2 additions & 1 deletion app/lib/components/navigation/secondary-workmode-menu.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import styled from "@emotion/styled";
import React from "react";
import { Column, Row } from "../style/global-style";
import { Column, Row } from "@ui/core";
import { SecondaryWorkmodeChoice } from "./secondary-workmode-choice";

export function SecondaryWorkmodeMenu<T extends string>(props: {
menus: {
id: T;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Button from "@material-ui/core/Button";
import * as React from "react";
import { BoxDirectoryInput } from "./box-directory-input";
// import { BoxDirectoryInput } from "./box-directory-input";

const TEST_STORYBOOK_ROOT =
"https://5f7d1f04988db70022c94c9a-bxsgusmnlc.chromatic.com";
Expand Down Expand Up @@ -39,7 +39,7 @@ export class BoxTab extends React.Component {
<div />
<Button onClick={this.onClickOpenStorybook}>open in storybook</Button>
<Button onClick={this.onClickOpenGithub}>open in github</Button>
<BoxDirectoryInput />
{/* <BoxDirectoryInput /> */}
<div />
<h6>Box section end</h6>
</div>
Expand Down
17 changes: 10 additions & 7 deletions app/lib/components/upload-steps.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
import React, { useEffect, useState } from "react";
import styled from "@emotion/styled";
import { BlackButton, TransparencyButton } from "./style/global-style";
import {
BlackButtonStyle,
TransparentButtonStyle,
} from "@ui/core/button-style";
import { Button } from "@material-ui/core";
import { ProgressBar } from "./animation/progress-bar";
import { AnimatedProgressBar } from "./animation/animated-progress-bar";
import { AnimatedCheckIcon } from "./animation/animated-check-icon";
import { motion } from "framer-motion";
import { Preview } from ".";
import { CheckIcon } from "./Icon/check-icon";
import { Preview } from "@ui/previewer";
import CheckIcon from "@assistant/icons/check";

const step = [
"converting design to universal format",
Expand Down Expand Up @@ -40,7 +43,7 @@ export function UploadSteps() {
return (
<>
<Preview auto />
{isLoading && <ProgressBar contorl={animateHandle} />}
{isLoading && <AnimatedProgressBar contorl={animateHandle} />}
<InnerWrapper variants={fieldVariants} animate="make-active">
{isLoading ? (
<Loading>
Expand Down Expand Up @@ -148,11 +151,11 @@ const IconBox = styled.div`
`;

const CheckButton = styled(Button)`
${BlackButton};
${BlackButtonStyle};
width: 100%;
`;
const UncheckButton = styled(Button)`
${TransparencyButton}
${TransparentButtonStyle}
width: 100%;
cursor: pointer;
text-transform: initial;
Expand Down
3 changes: 1 addition & 2 deletions app/lib/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
export * from "./components";
export * from "./main"
export * from "./main";
2 changes: 0 additions & 2 deletions app/lib/lint/index.ts

This file was deleted.

35 changes: 17 additions & 18 deletions app/lib/main/index.tsx
Original file line number Diff line number Diff line change
@@ -1,30 +1,29 @@
import React, { useState, useEffect } from "react";
import "../app.css"; /** TODO: remove raw css usage. */
import { initialize } from "../analytics";
import { initialize as analytics_initialize } from "@assistant-fp/analytics";

// UI COMPS
import { EK_SET_APP_MODE } from "../constants/ek.constant";
import { EK_SET_APP_MODE } from "@core/constant/ek.constant";
import { PluginApp } from "plugin-app";
import BatchMetaEditor from "../pages/tool-box/batch-meta-editor";
import { useHistory, Switch, Route } from "react-router-dom";
import type { TargetPlatform } from "@plugin-sdk/core";

//
// region screens import
import { FontReplacerScreen } from "../pages/tool-box/font-replacer";
import { ButtonMakerScreen } from "../pages/design/button-maker-screen";
import { ComponentViewScreen } from "../pages/component-view";
import { ButtonMakerScreen } from "@app/button-maker";
import { LayoutViewScreen } from "../pages/layout-view";
import { LintScreen } from "../pages/lint/lint-screen";
import { GlobalizationScreen } from "../pages/g11n-screen";
import { IconsScreen } from "../pages/icons-screen";
import { CodeScreen } from "../pages/code/code-screen";
import { ComponentViewScreen } from "@app/component-manage";
import { LintScreen } from "@app/design-lint";
import { IconsScreen } from "@app/icons-loader";
import { MetaEditorScreen, BatchMetaEditor } from "@app/meta-editor";
import { ExporterScreen } from "@app/export-scene-as-json";
import { DataMapperScreen } from "@app/data-mapper";
import { GlobalizationScreen } from "@app/i18n";
import { ToolboxScreen } from "../pages/tool-box";
import { MetaEditorScreen } from "../pages/tool-box/meta-editor";
import { ExporterScreen } from "../pages/tool-box/exporter";
import { DataMapperScreen } from "../pages/tool-box/data-mapper/data-mapper-screen";
import { TargetPlatform } from "../utils/plugin-init/init-target-platform";
import { FontReplacerScreen } from "@toolbox/font-replacer";
import { CodeScreen } from "../pages/code/code-screen";
import { AboutScreen } from "../pages/about";
import Signin from "../pages/signin";
import { SigninScreen } from "@app/auth";
// endregion screens import
//

Expand All @@ -50,7 +49,7 @@ import {
SecondaryMenuDropdown,
} from "../components/navigation";
import styled from "@emotion/styled";
import { Column, Row } from "../components/style/global-style";
import { Column, Row } from "@ui/core";
import { UploadSteps } from "../components/upload-steps";

function Screen(props: { screen: WorkScreen }) {
Expand Down Expand Up @@ -86,7 +85,7 @@ function Screen(props: { screen: WorkScreen }) {
case WorkScreen.scene_upload_steps_final:
return <UploadSteps />;
case WorkScreen.signin:
return <Signin />;
return <SigninScreen />;
default:
return <div>Not found</div>;
}
Expand Down Expand Up @@ -260,7 +259,7 @@ export default function App(props: { platform: TargetPlatform }) {

// region init analytics
try {
initialize();
analytics_initialize();
} catch (e) {
console.warn("Analytics disabled", e);
}
Expand Down
1 change: 0 additions & 1 deletion app/lib/mock/index.ts

This file was deleted.

2 changes: 1 addition & 1 deletion app/lib/pages/about/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from "react";
import styled from "@emotion/styled";
import * as about from "../../about";
import * as about from "./manifest";
import { __auth_proxy, ProxyAuthenticationMode } from "@base-sdk-fp/auth";
import { useHistory } from "react-router-dom";
import BackArrowIcon from "@assistant/icons/back-arrow";
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion app/lib/pages/code/__plugin/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {
EK_GENERATED_CODE_PLAIN,
EK_IMAGE_ASSET_REPOSITORY_MAP,
} from "app/lib/constants/ek.constant";
} from "@core/constant/ek.constant";
import {
onService,
_Code_Event,
Expand Down
8 changes: 4 additions & 4 deletions app/lib/pages/code/code-screen.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import React, { useEffect, useState } from "react";
import CodeBox, { SourceInput } from "../../components/codebox";
import { Preview } from "../../components/preview";
import { CodeBox, SourceInput } from "@ui/codebox";
import { Preview } from "@ui/previewer";
import {
EK_GENERATED_CODE_PLAIN,
EK_IMAGE_ASSET_REPOSITORY_MAP,
} from "../../constants/ek.constant";
} from "@core/constant/ek.constant";
import { repo_assets } from "@design-sdk/core";
import { assistant as analytics } from "@analytics.bridged.xyz/internal";
import {
Expand All @@ -19,7 +19,7 @@ import { PluginSdk } from "@plugin-sdk/app";
import { CodeScreenFooter } from "./footer-action/code-screen-footer";
import { CodeOptionsControl } from "./code-options-control";
import { fromApp, CodeGenRequest } from "./__plugin/events";
import { useSingleSelection } from "../../utils/plugin-hooks";
import { useSingleSelection } from "plugin-app";

type DesigntoCodeUserOptions = FrameworkOption;

Expand Down
6 changes: 3 additions & 3 deletions app/lib/pages/code/footer-action/code-screen-footer.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import React, { useState } from "react";
import styled from "@emotion/styled";
import { WhtieButton } from "../../../components/style/global-style";
import { WhtieButtonStyle } from "@ui/core/button-style";
import { assistant as analytics } from "@analytics.bridged.xyz/internal";
import { PluginSdk } from "@plugin-sdk/app";
import { preview } from "../../../scene-view";
import { preview } from "@app/scene-view";
import { NextUploadButton } from "./next-upload-button";
import type { ReflectSceneNode } from "@design-sdk/core/nodes";
import { Framework } from "../framework-option";
Expand Down Expand Up @@ -78,7 +78,7 @@ const CodeFooterCtaWrapper = styled.footer`
}
`;
const PreviewButton = styled.button`
${WhtieButton}
${WhtieButtonStyle}
/* 1/3 size. 12 is wrapper padding */
width: calc(33.333% - 12px);
`;
8 changes: 4 additions & 4 deletions app/lib/pages/code/footer-action/next-upload-button.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import React, { useState } from "react";
import styled from "@emotion/styled";
import { BlackButton } from "../../../components/style/global-style";
import { registerScene } from "../../../scene-view";
import { BlackButtonStyle } from "@ui/core/button-style";
import { registerScene } from "@app/scene-view";
import { PluginSdk } from "@plugin-sdk/app";
import type { IReflectNodeReference } from "@design-sdk/core/nodes/lignt";
import { isAuthenticated } from "../../../auth";
import { isAuthenticated } from "@assistant-fp/auth";
import { useHistory } from "react-router-dom";

export function NextUploadButton(props: {
Expand Down Expand Up @@ -82,7 +82,7 @@ function buildOpenUrlForRegisteredScene(sceneId: string) {
}

const NextStepButton = styled.button`
${BlackButton}
${BlackButtonStyle}
/* 2/3 size. 12 is wrapper padding */
width: calc(66.666% - 12px); /* FIXME: stupid! */
Expand Down
2 changes: 1 addition & 1 deletion app/lib/pages/code/formatter.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { format as dart_format } from "../../utils/dart-format";
import { format as dart_format } from "@core/code-formatter/dart-format";
import { Language } from "./framework-option";
import { format as remote_format } from "@base-sdk/functions-code-format";

Expand Down
5 changes: 0 additions & 5 deletions app/lib/pages/icons-screen.tsx

This file was deleted.

5 changes: 5 additions & 0 deletions app/lib/pages/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
///
/// re-exports all the pages
///

export { GlobalizationScreen } from "@app/i18n";
1 change: 0 additions & 1 deletion app/lib/pages/lint/index.ts

This file was deleted.

2 changes: 0 additions & 2 deletions app/lib/repositories/README.md

This file was deleted.

1 change: 0 additions & 1 deletion app/lib/utils/index.ts

This file was deleted.

4 changes: 0 additions & 4 deletions app/lib/utils/plugin-init/index.ts

This file was deleted.

42 changes: 0 additions & 42 deletions app/lib/utils/plugin-init/init-target-platform.ts

This file was deleted.

Loading

1 comment on commit f67ea01

@vercel
Copy link

@vercel vercel bot commented on f67ea01 Aug 27, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.