diff --git a/.gitignore b/.gitignore
index 7bb59f4a..ac0c76f0 100644
--- a/.gitignore
+++ b/.gitignore
@@ -7,4 +7,7 @@ webdev/.eslintcache
# we use yarn
-package-lock.json
\ No newline at end of file
+package-lock.json
+
+# log including yarn error log
+.log
\ No newline at end of file
diff --git a/README.md b/README.md
index 048ea9c6..e73e7df3 100644
--- a/README.md
+++ b/README.md
@@ -6,8 +6,10 @@ title: Grida assistant for figma, sketch, xd
+
+![Grida assistant](./branding/assistant-cover-v2021.8.0.png)
-![Grida assistant](./branding/assistant-cover-v2021.2.0.png)
+
# Grdia Assistant plugin (figma to flutter)
@@ -43,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
diff --git a/app/lib/utils/plugin-init/README.md b/app/__plugin__init__/README.md
similarity index 100%
rename from app/lib/utils/plugin-init/README.md
rename to app/__plugin__init__/README.md
diff --git a/app/__plugin__init__/index.ts b/app/__plugin__init__/index.ts
new file mode 100644
index 00000000..ef25073e
--- /dev/null
+++ b/app/__plugin__init__/index.ts
@@ -0,0 +1,4 @@
+// DO NOT REMOVE THIS LINE
+import "../lib/pages/code/__plugin";
+import "@app/data-mapper/__plugin";
+import "@app/design-lint/__plugin";
diff --git a/app/lib/components/animation/animated-check-icon.tsx b/app/lib/components/animation/animated-check-icon.tsx
index e6e39877..e75532c3 100644
--- a/app/lib/components/animation/animated-check-icon.tsx
+++ b/app/lib/components/animation/animated-check-icon.tsx
@@ -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": {
diff --git a/app/lib/components/animation/progress-bar.tsx b/app/lib/components/animation/animated-progress-bar.tsx
similarity index 92%
rename from app/lib/components/animation/progress-bar.tsx
rename to app/lib/components/animation/animated-progress-bar.tsx
index b695ad13..f1dfe3da 100644
--- a/app/lib/components/animation/progress-bar.tsx
+++ b/app/lib/components/animation/animated-progress-bar.tsx
@@ -7,7 +7,7 @@ interface IProgressBar {
contorl?: () => void;
}
-export function ProgressBar(props: IProgressBar) {
+export function AnimatedProgressBar(props: IProgressBar) {
return (
diff --git a/app/lib/components/comming-soon-template.tsx b/app/lib/components/comming-soon-template.tsx
index dbe21cd7..de9b03ec 100644
--- a/app/lib/components/comming-soon-template.tsx
+++ b/app/lib/components/comming-soon-template.tsx
@@ -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;
@@ -50,6 +50,6 @@ const ButtonWrapper = styled.div`
`;
const Button = styled.button`
- ${BlackButton}
+ ${BlackButtonStyle}
width: calc(100vw - 32px);
`;
diff --git a/app/lib/components/navigation/secondary-workmode-menu.tsx b/app/lib/components/navigation/secondary-workmode-menu.tsx
index 7beb1673..b7bc33a2 100644
--- a/app/lib/components/navigation/secondary-workmode-menu.tsx
+++ b/app/lib/components/navigation/secondary-workmode-menu.tsx
@@ -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(props: {
menus: {
id: T;
diff --git a/app/lib/components/box-tab.tsx b/app/lib/components/storybook-screen.tsx
similarity index 92%
rename from app/lib/components/box-tab.tsx
rename to app/lib/components/storybook-screen.tsx
index 11bd05d8..247d06b6 100644
--- a/app/lib/components/box-tab.tsx
+++ b/app/lib/components/storybook-screen.tsx
@@ -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";
@@ -39,7 +39,7 @@ export class BoxTab extends React.Component {
-
+ {/* */}
Box section end
diff --git a/app/lib/components/upload-steps.tsx b/app/lib/components/upload-steps.tsx
index 7b707638..7fa8ae16 100644
--- a/app/lib/components/upload-steps.tsx
+++ b/app/lib/components/upload-steps.tsx
@@ -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",
@@ -40,7 +43,7 @@ export function UploadSteps() {
return (
<>
- {isLoading && }
+ {isLoading && }
{isLoading ? (
@@ -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;
diff --git a/app/lib/index.ts b/app/lib/index.ts
index 74a48b44..d66d2cdb 100644
--- a/app/lib/index.ts
+++ b/app/lib/index.ts
@@ -1,2 +1 @@
-export * from "./components";
-export * from "./main"
\ No newline at end of file
+export * from "./main";
diff --git a/app/lib/lint/index.ts b/app/lib/lint/index.ts
deleted file mode 100644
index 27973214..00000000
--- a/app/lib/lint/index.ts
+++ /dev/null
@@ -1,2 +0,0 @@
-export * from "./lint-item-row";
-export * from "./lint-tree-view";
diff --git a/app/lib/main/index.tsx b/app/lib/main/index.tsx
index d9d52fbb..f7db192d 100644
--- a/app/lib/main/index.tsx
+++ b/app/lib/main/index.tsx
@@ -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
//
@@ -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 }) {
@@ -86,7 +85,7 @@ function Screen(props: { screen: WorkScreen }) {
case WorkScreen.scene_upload_steps_final:
return ;
case WorkScreen.signin:
- return ;
+ return ;
default:
return Not found
;
}
@@ -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);
}
@@ -268,8 +267,11 @@ export default function App(props: { platform: TargetPlatform }) {
}, []);
const Router = getDedicatedRouter();
+
+ const Loading = <>>;
+
return (
-
+
{/* @ts-ignore */}
diff --git a/app/lib/mock/index.ts b/app/lib/mock/index.ts
deleted file mode 100644
index 21cd2cbc..00000000
--- a/app/lib/mock/index.ts
+++ /dev/null
@@ -1 +0,0 @@
-export * from "./metadata"
\ No newline at end of file
diff --git a/app/lib/navigation/release-visibility-preference.ts b/app/lib/navigation/release-visibility-preference.ts
index 425493e1..1c2e5f04 100644
--- a/app/lib/navigation/release-visibility-preference.ts
+++ b/app/lib/navigation/release-visibility-preference.ts
@@ -10,7 +10,7 @@ export interface ReleaseVisibilityPreference {
const SCREEN_VISIBILITY_PREFERENCE: Map = new Map([
[WorkScreen.code, "release"],
[WorkScreen.about, "release"],
- [WorkScreen.component, "release"],
+ [WorkScreen.component, "beta"],
[WorkScreen.layout, "beta"],
[WorkScreen.icon, "release"],
[WorkScreen.lint, "release"],
diff --git a/app/lib/pages/about/index.tsx b/app/lib/pages/about/index.tsx
index c6883b38..bf784987 100644
--- a/app/lib/pages/about/index.tsx
+++ b/app/lib/pages/about/index.tsx
@@ -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";
@@ -8,25 +8,25 @@ import { PluginSdk } from "@plugin-sdk/app";
const URLS = {
logo_256:
"https://bridged-service-static.s3-us-west-1.amazonaws.com/branding/logo/256.png",
- github_assitant: "https://github.com/bridgedxyz/assistant",
- github_bridged: "https://github.com/bridgedxyz",
- homepage_bridged: "https://bridged.xyz/",
+ github_assitant: "https://github.com/gridaco/assistant",
+ github_grida: "https://github.com/gridaco",
+ homepage_grida: "https://grida.co/",
/**
* @todo
*/
homepage_assitant: "N/A",
report_issue:
- "https://github.com/bridgedxyz/assistant/issues/new?assignees=&labels=&template=bug_report.md&title=%5BBug%5D",
+ "https://github.com/gridaco/assistant/issues/new?assignees=&labels=&template=bug_report.md&title=%5BBug%5D",
feature_request:
- "https://github.com/bridgedxyz/assistant/issues/new?assignees=&labels=&template=feature_request.md&title=FeatureRequest",
- signup: "https://accounts.bridged.xyz/signup",
- blog: "https://blog.bridged.xyz",
- twitter: "https://twitter.com/bridgedxyz",
- facebook: "https://www.facebook.com/bridged.xyz/",
+ "https://github.com/gridaco/assistant/issues/new?assignees=&labels=&template=feature_request.md&title=FeatureRequest",
+ signup: "https://accounts.grida.co/signup",
+ blog: "https://blog.grida.co",
+ twitter: "https://twitter.com/grida_co",
+ facebook: "https://www.facebook.com/grida.co/",
youtube: "https://www.youtube.com/channel/UCgJO5apXl_pXRfTxNrkbEBw",
slack:
- "https://join.slack.com/t/bridgedxyz/shared_invite/zt-nmf59381-prFEqq032K~aWe_zOekUmQ",
- instagram: "https://www.instagram.com/bridged.xyz/",
+ "https://join.slack.com/t/gridaco/shared_invite/zt-nmf59381-prFEqq032K~aWe_zOekUmQ",
+ instagram: "https://www.instagram.com/grida.co/",
};
export function AboutScreen() {
@@ -63,42 +63,42 @@ export function AboutScreen() {
- More from Bridged
+ More from Grida
-
+
>
diff --git a/app/lib/about.ts b/app/lib/pages/about/manifest.ts
similarity index 69%
rename from app/lib/about.ts
rename to app/lib/pages/about/manifest.ts
index 19728849..27336806 100644
--- a/app/lib/about.ts
+++ b/app/lib/pages/about/manifest.ts
@@ -1,4 +1,4 @@
// const _package = require("../package.jsonn");
export const name = "Grida Assistant";
-export const version = "2021.2.2f0"; /*_package.version*/
+export const version = "2021.8.1f0"; /*_package.version*/
export const versionText = `v${version}`;
diff --git a/app/lib/pages/code/__plugin/index.ts b/app/lib/pages/code/__plugin/index.ts
index 0dfbcb35..fbcef43b 100644
--- a/app/lib/pages/code/__plugin/index.ts
+++ b/app/lib/pages/code/__plugin/index.ts
@@ -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,
diff --git a/app/lib/pages/code/code-screen.tsx b/app/lib/pages/code/code-screen.tsx
index e95d41a3..c69f585c 100644
--- a/app/lib/pages/code/code-screen.tsx
+++ b/app/lib/pages/code/code-screen.tsx
@@ -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 {
@@ -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;
diff --git a/app/lib/pages/code/footer-action/code-screen-footer.tsx b/app/lib/pages/code/footer-action/code-screen-footer.tsx
index 81fb0cfa..3cefe062 100644
--- a/app/lib/pages/code/footer-action/code-screen-footer.tsx
+++ b/app/lib/pages/code/footer-action/code-screen-footer.tsx
@@ -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";
@@ -62,8 +62,8 @@ export function CodeScreenFooter(props: ICodeScreenFooter) {
}
const CodeFooterCtaWrapper = styled.footer`
- /* 16 is body's padding */
- width: calc(100% - 16px);
+ /* 32 is padding */
+ width: calc(100% - 32px);
padding: 12px 16px;
display: flex;
background: #fff;
@@ -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);
`;
diff --git a/app/lib/pages/code/footer-action/next-upload-button.tsx b/app/lib/pages/code/footer-action/next-upload-button.tsx
index 54216d1c..bedfb3ef 100644
--- a/app/lib/pages/code/footer-action/next-upload-button.tsx
+++ b/app/lib/pages/code/footer-action/next-upload-button.tsx
@@ -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: {
@@ -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! */
diff --git a/app/lib/pages/code/formatter.ts b/app/lib/pages/code/formatter.ts
index a7b6c1bb..2eed6074 100644
--- a/app/lib/pages/code/formatter.ts
+++ b/app/lib/pages/code/formatter.ts
@@ -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";
diff --git a/app/lib/pages/icons-screen.tsx b/app/lib/pages/icons-screen.tsx
deleted file mode 100644
index 6bfe36c7..00000000
--- a/app/lib/pages/icons-screen.tsx
+++ /dev/null
@@ -1,5 +0,0 @@
-import React from "react"
-import { IconsLoader } from "../components/icons-loader"
-export function IconsScreen() {
- return
-}
\ No newline at end of file
diff --git a/app/lib/pages/index.ts b/app/lib/pages/index.ts
new file mode 100644
index 00000000..e7fb3727
--- /dev/null
+++ b/app/lib/pages/index.ts
@@ -0,0 +1,5 @@
+///
+/// re-exports all the pages
+///
+
+export { GlobalizationScreen } from "@app/i18n";
diff --git a/app/lib/pages/lint/index.ts b/app/lib/pages/lint/index.ts
deleted file mode 100644
index df8c0a77..00000000
--- a/app/lib/pages/lint/index.ts
+++ /dev/null
@@ -1 +0,0 @@
-export * from "./lint-screen";
diff --git a/app/lib/repositories/README.md b/app/lib/repositories/README.md
deleted file mode 100644
index d8102d62..00000000
--- a/app/lib/repositories/README.md
+++ /dev/null
@@ -1,2 +0,0 @@
-# Repositories
-> A repository directory to hold inter app related data store implementations
\ No newline at end of file
diff --git a/app/lib/utils/index.ts b/app/lib/utils/index.ts
deleted file mode 100644
index 6454e2e6..00000000
--- a/app/lib/utils/index.ts
+++ /dev/null
@@ -1 +0,0 @@
-export { Logger } from "./logger";
diff --git a/app/lib/utils/plugin-init/index.ts b/app/lib/utils/plugin-init/index.ts
deleted file mode 100644
index 323e283a..00000000
--- a/app/lib/utils/plugin-init/index.ts
+++ /dev/null
@@ -1,4 +0,0 @@
-// DO NOT REMOVE THIS LINE
-import "../../pages/code/__plugin";
-import "../../pages/tool-box/data-mapper/__plugin";
-import "../../lint/__plugin";
diff --git a/app/lib/utils/plugin-init/init-target-platform.ts b/app/lib/utils/plugin-init/init-target-platform.ts
deleted file mode 100644
index 7bec58a1..00000000
--- a/app/lib/utils/plugin-init/init-target-platform.ts
+++ /dev/null
@@ -1,42 +0,0 @@
-import { PluginSdk } from "@plugin-sdk/app";
-
-/**
- * Target platform this ui runs on. this gloval variable will be set on initial entry on each platform's main ui import
- */
-export let TARGET_PLATFORM: TargetPlatform;
-
-/**
- * this only sets TARGET_PLATFORM on ui thread.
- * @param platform
- */
-export async function initializeTargetPlatform(platform: TargetPlatform) {
- TARGET_PLATFORM = platform;
- if (platform == TargetPlatform.webdev) {
- return true;
- }
-
- // sync this to code side.
- await PluginSdk.request({
- namespace: "__INTERNAL__",
- key: "sync-target-platform",
- data: platform,
- });
- console.info(`thread#ui: target platform set as ${platform}`);
-}
-
-export function __syncTargetPlatformForCodeThread(
- platform: TargetPlatform
-): boolean {
- console.info(`thread#code: syncing target platform to ${platform}`);
- TARGET_PLATFORM = platform;
- return true;
-}
-
-export enum TargetPlatform {
- bridged = "xyz.bridged.bridged",
- figma = "com.figma.Desktop",
- sketch = "com.bohemiancoding.sketch3",
- xd = "xd",
- zeplin = "zeplin",
- webdev = "xyz.bridged.assistant-web-dev",
-}
diff --git a/app/package.json b/app/package.json
index ba5f9097..4daf202b 100644
--- a/app/package.json
+++ b/app/package.json
@@ -9,6 +9,7 @@
"dependencies": {
"@assistant/icons": "0.0.0",
"@assistant/lint-icons": "0.0.0",
+ "@app/data-mapper": "0.0.0",
"@analytics.bridged.xyz/internal": "^0.0.9",
"@base-sdk-fp/auth": "0.1.0-2",
"@base-sdk/base": "0.1.0-5",
@@ -29,7 +30,6 @@
"classnames": "^2.3.1",
"coli": "0.0.3",
"copy-to-clipboard": "^3.3.1",
- "dart-style": "^1.3.2-dev",
"firebase": "^7.23.0",
"framer-motion": "^4.1.17",
"lodash": "^4.17.21",
diff --git a/branding/assistant-cover-v2021.8.0.png b/branding/assistant-cover-v2021.8.0.png
new file mode 100644
index 00000000..821f9ceb
Binary files /dev/null and b/branding/assistant-cover-v2021.8.0.png differ
diff --git a/figma-core/README.md b/figma-core/README.md
new file mode 100644
index 00000000..2b152794
--- /dev/null
+++ b/figma-core/README.md
@@ -0,0 +1,7 @@
+# Figma core api module
+
+> all figma accessing logics will be placed here
+
+## Good to know - Somethings leart from mistakes
+
+- figma's node does return property until they are referenced
diff --git a/figma-core/code-thread/broadcast-selection-preview.ts b/figma-core/code-thread/broadcast-selection-preview.ts
index 153f1077..e1923c1a 100644
--- a/figma-core/code-thread/broadcast-selection-preview.ts
+++ b/figma-core/code-thread/broadcast-selection-preview.ts
@@ -1,4 +1,4 @@
-import { EK_PREVIEW_SOURCE } from "app/lib/constants/ek.constant";
+import { EK_PREVIEW_SOURCE } from "@core/constant/ek.constant";
/**
* extracts the png image of selection, broadcasts to listeners.
diff --git a/figma-core/code-thread/runon.ts b/figma-core/code-thread/runon.ts
index 8d8975b4..8f359dde 100644
--- a/figma-core/code-thread/runon.ts
+++ b/figma-core/code-thread/runon.ts
@@ -2,7 +2,7 @@ import {
EK_COMPUTE_STARTED,
EK_IMAGE_ASSET_REPOSITORY_MAP,
EK_VANILLA_TRANSPORT,
-} from "app/lib/constants/ek.constant";
+} from "@core/constant/ek.constant";
import { vanilla } from "@design-sdk/core";
import { ReflectFrameNode, ReflectSceneNode } from "@design-sdk/core/nodes";
import { user_interest } from "./user-interest";
diff --git a/figma-core/code-thread/selection.ts b/figma-core/code-thread/selection.ts
index a21eedd9..2fb3afa4 100644
--- a/figma-core/code-thread/selection.ts
+++ b/figma-core/code-thread/selection.ts
@@ -1,6 +1,6 @@
import { analyzeSelection, SelectionAnalysis } from "plugin-app/utils";
import { convert } from "@design-sdk/figma";
-import { Logger } from "app/lib/utils";
+import { Logger } from "logger";
import { light } from "@design-sdk/core/nodes";
import { runon } from "./runon";
import { FigmaNodeCache } from "../node-cache";
diff --git a/figma-core/code-thread/user-interest.ts b/figma-core/code-thread/user-interest.ts
index 2cd29a10..f66750ec 100644
--- a/figma-core/code-thread/user-interest.ts
+++ b/figma-core/code-thread/user-interest.ts
@@ -1,4 +1,4 @@
-import { EK_SET_APP_MODE } from "app/lib/constants";
+import { EK_SET_APP_MODE } from "@core/constant";
import { addEventHandler } from "./message-handler";
/**
diff --git a/figma-core/event-handlers/create-icon.ts b/figma-core/event-handlers/create-icon.ts
index f8467a9e..fbaf63d6 100644
--- a/figma-core/event-handlers/create-icon.ts
+++ b/figma-core/event-handlers/create-icon.ts
@@ -1,5 +1,5 @@
import { IconConfig } from "@reflect-ui/core";
-import { EK_CREATE_ICON, EK_ICON_DRAG_AND_DROPPED } from "app/lib/constants";
+import { EK_CREATE_ICON, EK_ICON_DRAG_AND_DROPPED } from "@core/constant";
import { PluginSdkService } from "@plugin-sdk/service";
import { IconPlacement, renderSvgIcon } from "../reflect-render/icons.render";
import { addEventHandler } from "../code-thread";
diff --git a/figma-core/event-handlers/replace-font.ts b/figma-core/event-handlers/replace-font.ts
index 0b868703..bdd3fe5f 100644
--- a/figma-core/event-handlers/replace-font.ts
+++ b/figma-core/event-handlers/replace-font.ts
@@ -1,4 +1,4 @@
-import { EK_REPLACE_FONT } from "app/lib/constants";
+import { EK_REPLACE_FONT } from "@core/constant";
import { replaceAllTextFontInFrame } from "../tool-box/manipulate";
import { addEventHandler, singleFigmaNodeSelection } from "../code-thread";
diff --git a/figma-core/index.ts b/figma-core/index.ts
index e9c2798d..65751d47 100644
--- a/figma-core/index.ts
+++ b/figma-core/index.ts
@@ -1,6 +1,6 @@
// ==========
// init plugin
-/* do not delete this line */ import "app/lib/utils/plugin-init"; // NO REMOVE
+/* do not delete this line */ import "app/__plugin__init__"; // NO REMOVE
// ==========
// ==========
diff --git a/figma-core/platform-features/file-checksum/store.ts b/figma-core/platform-features/file-checksum/store.ts
index 2787f98d..46353c8f 100644
--- a/figma-core/platform-features/file-checksum/store.ts
+++ b/figma-core/platform-features/file-checksum/store.ts
@@ -1,4 +1,4 @@
-import { ASSISTANT_PLUGIN_NAMESPACE__NOCHANGE } from "app/lib/constants";
+import { ASSISTANT_PLUGIN_NAMESPACE__NOCHANGE } from "@core/constant";
import { checksum } from "./api";
/**
* root node's id is always 0:0 on plugin api. [learn more](https://github.com/figma/plugin-typings/issues/13)
diff --git a/figma-lite/README.md b/figma-lite/README.md
deleted file mode 100644
index 6e4db78f..00000000
--- a/figma-lite/README.md
+++ /dev/null
@@ -1 +0,0 @@
-# Figma lite - A web hosted version of figma plugin.
diff --git a/figma-lite/manifest.json b/figma-lite/manifest.json
deleted file mode 100644
index f31d254a..00000000
--- a/figma-lite/manifest.json
+++ /dev/null
@@ -1,7 +0,0 @@
-{
- "name": "Grida",
- "id": "896445082033423994",
- "api": "1.0.0",
- "main": "dist/code.js",
- "ui": "dist/ui.html"
-}
\ No newline at end of file
diff --git a/figma-lite/package.json b/figma-lite/package.json
deleted file mode 100644
index 094cec4a..00000000
--- a/figma-lite/package.json
+++ /dev/null
@@ -1,15 +0,0 @@
-{
- "name": "figma-lite",
- "description": "A web hosted version of figma plugin.",
- "authors": "Grida.co",
- "version": "0.0.0",
- "private": false,
- "dependencies": {
- "@ui/skeleton": "0.0.0"
- },
- "scripts": {
- "build": "webpack -p --mode=production",
- "build:dev": "webpack --mode=development",
- "watch": "webpack --watch"
- }
-}
\ No newline at end of file
diff --git a/figma-lite/src/handle-proxy-requests.ts b/figma-lite/src/handle-proxy-requests.ts
deleted file mode 100644
index 4b6cf0a1..00000000
--- a/figma-lite/src/handle-proxy-requests.ts
+++ /dev/null
@@ -1,11 +0,0 @@
-import {
- TransportPluginEvent,
- PLUGIN_SDK_EK_BROWSER_OPEN_URI,
-} from "@plugin-sdk/core";
-
-export function handle(payload: TransportPluginEvent) {
- console.log("handling proxy request from hosted app.", payload);
- if (payload.key == PLUGIN_SDK_EK_BROWSER_OPEN_URI) {
- open(payload.data.uri);
- }
-}
diff --git a/figma-lite/src/ui.tsx b/figma-lite/src/ui.tsx
deleted file mode 100644
index 5dfb96ab..00000000
--- a/figma-lite/src/ui.tsx
+++ /dev/null
@@ -1,82 +0,0 @@
-import React, { useRef, useState, useEffect } from "react";
-import * as ReactDOM from "react-dom";
-import { AppSkeleton } from "@ui/skeleton";
-import { handle } from "./handle-proxy-requests";
-
-ReactDOM.render(
- ,
- document.getElementById("react-page")
-);
-
-function LiteHostedAppConnector() {
- const frame = useRef();
-
- const [initialized, setInitialized] = useState(false);
-
- useEffect(() => {
- if (frame) {
- window.addEventListener("message", (event) => {
- // console.log("event recievd from lite-fima-app", event.data);
- if (event.data == "plugin-app-initialized") {
- setInitialized(true);
- }
-
- if ("pluginMessage" in event.data) {
- if (event.data.pluginMessage.__proxy_request_from_hosted_plugin) {
- handle(event.data.pluginMessage);
- return;
- }
- if (
- "pluginId" in event.data ||
- event.data.pluginMessage.type === "response"
- ) {
- frame.current.contentWindow.postMessage(event.data, "*");
- } else {
- parent.postMessage(
- {
- ...event.data,
- "message-transport": true,
- },
- "*"
- );
- }
- }
- });
- }
- }, [frame]);
-
- const _host =
- process.env.NODE_ENV === "production"
- ? "https://assistant-serve.grida.co"
- : "http://localhost:3000";
-
- // use opacity
- // if (initialized) => show iframe only
- // eles, show iframe with opacity 0 & enable AppSkeleton
- //
-
- return (
-
- );
-}
diff --git a/figma/.env.defaults b/figma-native/.env.defaults
similarity index 100%
rename from figma/.env.defaults
rename to figma-native/.env.defaults
diff --git a/figma-native/.gitignore b/figma-native/.gitignore
new file mode 100644
index 00000000..06bf2e9e
--- /dev/null
+++ b/figma-native/.gitignore
@@ -0,0 +1,117 @@
+# Logs
+logs
+*.log
+npm-debug.log*
+yarn-debug.log*
+yarn-error.log*
+lerna-debug.log*
+
+# Diagnostic reports (https://nodejs.org/api/report.html)
+report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
+
+# Runtime data
+pids
+*.pid
+*.seed
+*.pid.lock
+
+# Directory for instrumented libs generated by jscoverage/JSCover
+lib-cov
+
+# Coverage directory used by tools like istanbul
+coverage
+*.lcov
+
+# nyc test coverage
+.nyc_output
+
+# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
+.grunt
+
+# Bower dependency directory (https://bower.io/)
+bower_components
+
+# node-waf configuration
+.lock-wscript
+
+# Compiled binary addons (https://nodejs.org/api/addons.html)
+build/Release
+build
+
+# Dependency directories
+node_modules/
+jspm_packages/
+
+# Snowpack dependency directory (https://snowpack.dev/)
+web_modules/
+
+# TypeScript cache
+*.tsbuildinfo
+
+# Optional npm cache directory
+.npm
+
+# Optional eslint cache
+.eslintcache
+
+# Microbundle cache
+.rpt2_cache/
+.rts2_cache_cjs/
+.rts2_cache_es/
+.rts2_cache_umd/
+
+# Optional REPL history
+.node_repl_history
+
+# Output of 'npm pack'
+*.tgz
+
+# Yarn Integrity file
+.yarn-integrity
+
+# dotenv environment variables file
+.env
+.env.test
+
+# parcel-bundler cache (https://parceljs.org/)
+.cache
+.parcel-cache
+
+# Next.js build output
+.next
+out
+
+# Nuxt.js build / generate output
+.nuxt
+dist
+
+# Gatsby files
+.cache/
+# Comment in the public line in if your project uses Gatsby and not Next.js
+# https://nextjs.org/blog/next-9-1#public-directory-support
+# public
+
+# vuepress build output
+.vuepress/dist
+
+# Serverless directories
+.serverless/
+
+# FuseBox cache
+.fusebox/
+
+# DynamoDB Local files
+.dynamodb/
+
+# TernJS port file
+.tern-port
+
+# Stores VSCode versions used for testing VSCode extensions
+.vscode-test
+
+# yarn v2
+.yarn/cache
+.yarn/unplugged
+.yarn/build-state.yml
+.yarn/install-state.gz
+.pnp.*
\ No newline at end of file
diff --git a/figma-native/CONTRIBUTING.md b/figma-native/CONTRIBUTING.md
new file mode 100644
index 00000000..2aac1249
--- /dev/null
+++ b/figma-native/CONTRIBUTING.md
@@ -0,0 +1,10 @@
+# Contributing to assistant figma platform
+
+## Setting up Env vars (.env)
+
+> In most case, you won't have to specify contents or create `figma-native/.env` file.
+
+**Variables**
+
+- `FIGMA_PERSONAL_ACCESS_TOKEN` - (Optional) For using figma developer tools.
+- `BRIDGED_FIRST_PARTY_APP_TOTP_SECRET` - (Not Required) Used for communicating with bridged first party cloud services. set this as "s1v1-assistant-development". learn more at [base's security startegy](https://github.com/gridaco/base/blob/main/docs/security.md)
diff --git a/figma-native/README.md b/figma-native/README.md
new file mode 100644
index 00000000..3987cbc1
--- /dev/null
+++ b/figma-native/README.md
@@ -0,0 +1,5 @@
+# Figma Native - A non-web-hosted version of figma plugin.
+
+This runs everything within only figma host. even webpages are served internally, not via localhost;
+
+Using this will overload plugin booting time & interaction delay
diff --git a/figma-native/manifest.json b/figma-native/manifest.json
new file mode 100644
index 00000000..685bb512
--- /dev/null
+++ b/figma-native/manifest.json
@@ -0,0 +1,10 @@
+{
+ "name": "Grida (Heavy)",
+ "id": "1009859297533324545",
+ "api": "1.0.0",
+ "main": "dist/code.js",
+ "ui": "dist/ui.html",
+ "editorType": [
+ "figma"
+ ]
+}
\ No newline at end of file
diff --git a/figma-native/package.json b/figma-native/package.json
new file mode 100644
index 00000000..6e88f2bb
--- /dev/null
+++ b/figma-native/package.json
@@ -0,0 +1,50 @@
+{
+ "name": "figma-native",
+ "version": "2021.0.1f1.1",
+ "keywords": [
+ "figma",
+ "bridged",
+ "flutter",
+ "flutter-figma",
+ "figma-plugin"
+ ],
+ "license": "https://github.com/bridgedxyz/contributing-and-license",
+ "author": "bridged.xyz by softmarshmallow ",
+ "dependencies": {
+ "app": "^0.0.1",
+ "figma-js": "^1.13.0",
+ "figma-core": "0.0.0"
+ },
+ "devDependencies": {
+ "@babel/core": "^7.14.3",
+ "@babel/plugin-syntax-dynamic-import": "^7.8.3",
+ "@babel/plugin-transform-runtime": "^7.14.3",
+ "@babel/preset-env": "^7.14.2",
+ "@babel/preset-react": "^7.13.13",
+ "@babel/preset-typescript": "^7.13.0",
+ "@babel/runtime": "^7.14.0",
+ "@types/fs-extra": "^9.0.1",
+ "@types/node": "^14.11.8",
+ "@types/pug": "^2.0.4",
+ "@types/react": "^17.0.3",
+ "@types/react-dom": "^16.9.8",
+ "babel-loader": "^8.2.2",
+ "css-loader": "^3.1.0",
+ "dotenv": "^8.2.0",
+ "dotenv-webpack": "^2.0.0",
+ "html-webpack-inline-source-plugin": "0.0.10",
+ "html-webpack-plugin": "^3.2.0",
+ "style-loader": "^0.23.1",
+ "terser-webpack-plugin": "^4.2.3",
+ "ts-loader": "^6.0.4",
+ "typescript": "^4.0.5",
+ "url-loader": "^2.1.0",
+ "webpack": "^4.38.0",
+ "webpack-cli": "^3.3.6"
+ },
+ "scripts": {
+ "webpack:watch": "webpack --watch",
+ "build": "webpack -p --mode=production",
+ "dev": "webpack --watch"
+ }
+}
\ No newline at end of file
diff --git a/figma-lite/src/code.ts b/figma-native/src/code.ts
similarity index 100%
rename from figma-lite/src/code.ts
rename to figma-native/src/code.ts
diff --git a/figma-lite/src/ui.html b/figma-native/src/ui.html
similarity index 92%
rename from figma-lite/src/ui.html
rename to figma-native/src/ui.html
index 9c12cd84..d4903ad9 100644
--- a/figma-lite/src/ui.html
+++ b/figma-native/src/ui.html
@@ -11,10 +11,6 @@
/>
-
+
+