Layout view
; 6 | } 7 | -------------------------------------------------------------------------------- /app/lib/routing/README.md: -------------------------------------------------------------------------------- 1 | # Navigation management UI & Logics container -------------------------------------------------------------------------------- /app/lib/routing/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./navigation-store"; 2 | export * from "./layout-preference"; 3 | export * from "./work-mode"; 4 | export * from "./work-screen"; 5 | export * from "./primary-workmode-selector"; 6 | export * from "./pages"; 7 | export * from "./router"; 8 | -------------------------------------------------------------------------------- /app/lib/routing/navigation-store/README.md: -------------------------------------------------------------------------------- 1 | # Navigation store saving layout (workmode set + last workmode + last tab) 2 | 3 | ## Supported platforms 4 | 5 | - webdev 6 | - sketch 7 | 8 | ## Layout 9 | 10 | - get/set last work by workmode 11 | -------------------------------------------------------------------------------- /app/lib/routing/navigation-store/save-workmode-work.ts: -------------------------------------------------------------------------------- 1 | import { PluginSdk } from "@plugin-sdk/app"; 2 | import { WorkMode } from "../work-mode"; 3 | import { WorkScreen } from "../work-screen"; 4 | 5 | async function _set_work_by_workmode(workmode: WorkMode, work: string) { 6 | PluginSdk.setItem(_make_id(workmode), work); 7 | } 8 | 9 | async function _get_work_by_workmode(workmode: WorkMode) { 10 | const saved = await PluginSdk.getItem(_make_id(workmode)); 11 | if (!saved) { 12 | return _default_work_by_workmode(workmode); 13 | } 14 | } 15 | 16 | function _default_work_by_workmode(workmode: WorkMode): WorkScreen { 17 | switch (workmode) { 18 | case WorkMode.code: 19 | return WorkScreen.code; 20 | case WorkMode.design: 21 | return WorkScreen.icon; 22 | } 23 | } 24 | 25 | function _make_id(workmode: WorkMode): string { 26 | return `workmode-current-work-of-${workmode}`; 27 | } 28 | 29 | /// 30 | /// region export 31 | /// 32 | export const saved_work_by_workmode = { 33 | set: _set_work_by_workmode, 34 | get: _get_work_by_workmode, 35 | }; 36 | /// 37 | /// endregion export 38 | /// 39 | -------------------------------------------------------------------------------- /app/lib/routing/primary-workmode-selector.ts: -------------------------------------------------------------------------------- 1 | import { WorkMode } from "./work-mode"; 2 | export interface PrimaryWorkmodeSet { 3 | first: WorkMode; 4 | second: WorkMode; 5 | } 6 | 7 | export function getPrimaryWorkmodeSet(): PrimaryWorkmodeSet { 8 | return { 9 | first: WorkMode.design, 10 | second: WorkMode.code, 11 | }; 12 | } 13 | -------------------------------------------------------------------------------- /app/lib/routing/router.ts: -------------------------------------------------------------------------------- 1 | import { MemoryRouter, BrowserRouter } from "react-router-dom"; 2 | 3 | export const getDedicatedRouter = () => 4 | _is_in_iframe() ? MemoryRouter : BrowserRouter; 5 | 6 | function _is_in_iframe() { 7 | if (process["browser"]) { 8 | // The page is in an iframe 9 | return window.location !== window.parent.location; 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /app/lib/routing/work-mode.ts: -------------------------------------------------------------------------------- 1 | export enum WorkMode { 2 | code = "code", 3 | design = "design", 4 | asset = "asset", 5 | manage = "manage", 6 | tools = "tools", 7 | library = "library", 8 | settings = "settings", // "about" page for now 9 | about = "about", 10 | content = "content", 11 | toolbox = "toolbox", 12 | } 13 | -------------------------------------------------------------------------------- /app/lib/routing/work-screen.ts: -------------------------------------------------------------------------------- 1 | export enum WorkScreen { 2 | about = "about", 3 | /** todo: rename to code/preview */ 4 | code = "code", 5 | /** @deprecated only used for sendig event */ 6 | code_flutter = "code/flutter", 7 | /** @deprecated only used for sendig event */ 8 | code_react = "code/react", 9 | component = "component", 10 | preview = "preview", 11 | layout = "layout", 12 | copy = "copy", 13 | icon = "icon", 14 | photo = "photo", 15 | live = "live", 16 | lint = "lint", 17 | g11n = "g11n", 18 | dev = "dev", 19 | slot = "slot", 20 | exporter = "exporter", 21 | tool_home = "tools", 22 | tool_desing_button_maker = "tool_desing_button_maker", 23 | tool_code_syntax_highlighter = "tool_code_syntax_highlighter", 24 | tool_font_replacer = "tool_font_replacer", 25 | tool_meta_editor = "tool_meta_editor", 26 | tool_batch_meta_editor = "tool_batch_meta_editor", 27 | tool_data_mapper = "tool_data_mapper", 28 | signin = "signin", 29 | upgrade = "upgrade", 30 | } 31 | -------------------------------------------------------------------------------- /branding/assistant-cover-v0.1.1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridaco/assistant/5ad38fb22fa5fdf5e01ccb1272f871d02cb2c3e7/branding/assistant-cover-v0.1.1.png -------------------------------------------------------------------------------- /branding/assistant-cover-v2021.2.0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridaco/assistant/5ad38fb22fa5fdf5e01ccb1272f871d02cb2c3e7/branding/assistant-cover-v2021.2.0.png -------------------------------------------------------------------------------- /branding/assistant-cover-v2021.8.0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridaco/assistant/5ad38fb22fa5fdf5e01ccb1272f871d02cb2c3e7/branding/assistant-cover-v2021.8.0.png -------------------------------------------------------------------------------- /branding/assistant-logo-v0.1.1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridaco/assistant/5ad38fb22fa5fdf5e01ccb1272f871d02cb2c3e7/branding/assistant-logo-v0.1.1.png -------------------------------------------------------------------------------- /branding/design-assistant-icons-loader.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridaco/assistant/5ad38fb22fa5fdf5e01ccb1272f871d02cb2c3e7/branding/design-assistant-icons-loader.png -------------------------------------------------------------------------------- /docs/gifs/assistant-demo-2021.0.1.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridaco/assistant/5ad38fb22fa5fdf5e01ccb1272f871d02cb2c3e7/docs/gifs/assistant-demo-2021.0.1.gif -------------------------------------------------------------------------------- /docs/gifs/assistant-icons-loader-2021.0.1f.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridaco/assistant/5ad38fb22fa5fdf5e01ccb1272f871d02cb2c3e7/docs/gifs/assistant-icons-loader-2021.0.1f.gif -------------------------------------------------------------------------------- /docs/gifs/quicklook-demo-v002.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridaco/assistant/5ad38fb22fa5fdf5e01ccb1272f871d02cb2c3e7/docs/gifs/quicklook-demo-v002.gif -------------------------------------------------------------------------------- /docs/images/assistant-webdev-example.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridaco/assistant/5ad38fb22fa5fdf5e01ccb1272f871d02cb2c3e7/docs/images/assistant-webdev-example.png -------------------------------------------------------------------------------- /docs/images/plugin-flutter-example-v0.0.1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridaco/assistant/5ad38fb22fa5fdf5e01ccb1272f871d02cb2c3e7/docs/images/plugin-flutter-example-v0.0.1.png -------------------------------------------------------------------------------- /docs/images/plugin-flutter-example-v0.0.2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridaco/assistant/5ad38fb22fa5fdf5e01ccb1272f871d02cb2c3e7/docs/images/plugin-flutter-example-v0.0.2.png -------------------------------------------------------------------------------- /docs/images/plugin-flutter-example.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridaco/assistant/5ad38fb22fa5fdf5e01ccb1272f871d02cb2c3e7/docs/images/plugin-flutter-example.png -------------------------------------------------------------------------------- /example/README.md: -------------------------------------------------------------------------------- 1 | # Example designs and apps built with Bridged 2 | 3 | Please visit https://github.com/bridgedxyz/examples or https://bridged.xyz/docs 4 | -------------------------------------------------------------------------------- /figma-core/code-thread/broadcast-selection-preview.ts: -------------------------------------------------------------------------------- 1 | import { EK_CURRENT_SELECTION_PREVIEW_SOURCE_CHANGED } from "@core/constant/ek.constant"; 2 | import { preset, QuickImageExportPreset } from "@plugin-sdk/core"; 3 | 4 | /** 5 | * extracts the png image of selection, broadcasts to listeners. 6 | * @todo - only broadcast when required. 7 | * @param selection 8 | */ 9 | export function broadcastSelectionPreview(selection: SceneNode) { 10 | exportImage(selection).then((d) => { 11 | figma.ui.postMessage({ 12 | type: EK_CURRENT_SELECTION_PREVIEW_SOURCE_CHANGED, 13 | data: { 14 | source: d, 15 | name: selection.name, 16 | }, 17 | }); 18 | }); 19 | } 20 | 21 | export async function exportImage( 22 | target: SceneNode, 23 | options?: { 24 | preset?: QuickImageExportPreset; 25 | } 26 | ): Promiseselect component inside variant set
; 13 | > 14 | ); 15 | } 16 | -------------------------------------------------------------------------------- /packages/app-schema-editor/index.ts: -------------------------------------------------------------------------------- 1 | export { SchemaEditor } from "./schema-editor"; 2 | -------------------------------------------------------------------------------- /packages/app-schema-editor/interface-code-builder/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./props-builder"; 2 | export * from "./example-data-builder"; 3 | export * from "./jsx-view-example-builder"; 4 | -------------------------------------------------------------------------------- /packages/app-schema-editor/interface-code-builder/scoped-property-id-namer.ts: -------------------------------------------------------------------------------- 1 | import { ScopedVariableNamer } from "@coli.codes/naming"; 2 | import { ReservedKeywordPlatformPresets } from "coli"; 3 | 4 | const _default_key_val = "property-key"; 5 | export const reactNamer = (scope: string = _default_key_val) => 6 | new ScopedVariableNamer( 7 | _make_scope_name(scope), 8 | ReservedKeywordPlatformPresets.react 9 | ); 10 | 11 | export const tsNamer = (scope: string = _default_key_val) => 12 | new ScopedVariableNamer( 13 | _make_scope_name(scope), 14 | ReservedKeywordPlatformPresets.typescript 15 | ); 16 | 17 | const _make_scope_name = (scope: string) => 18 | scope === _default_key_val ? _default_key_val : `property-key-of-${scope}`; 19 | -------------------------------------------------------------------------------- /packages/app-schema-editor/interface-code-builder/single-layer-property-mapping-to-property-signature.ts: -------------------------------------------------------------------------------- 1 | import { NameCases } from "@coli.codes/naming"; 2 | import { FigmaNumber } from "@design-sdk/figma/dist/features/variant"; 3 | import { Identifier, PropertySignature } from "coli"; 4 | import { ISingleLayerPropertyMapping } from "../types/single-layer-property-type"; 5 | import { typeToColiType } from "./type-to-coli-type"; 6 | 7 | export function singleLayerPropertyMappingToPropertySignature({ 8 | singlePropertyMapping, 9 | propertyNamer, 10 | }: { 11 | singlePropertyMapping: ISingleLayerPropertyMapping; 12 | propertyNamer; 13 | }) { 14 | return new PropertySignature({ 15 | name: new Identifier( 16 | propertyNamer.nameit(singlePropertyMapping.schema.name, { 17 | case: NameCases.camel, 18 | }).name 19 | ), 20 | type: typeToColiType(FigmaNumber), // FIXME: use => n.schema.type 21 | }); 22 | } 23 | -------------------------------------------------------------------------------- /packages/app-schema-editor/interface-code-builder/type-to-coli-type.ts: -------------------------------------------------------------------------------- 1 | import { variant } from "@design-sdk/figma/dist/features"; 2 | import { 3 | FigmaBoolean, 4 | FigmaNumber, 5 | } from "@design-sdk/figma/dist/features/variant"; 6 | import { 7 | BooleanKeyword, 8 | LiteralType, 9 | NumberKeyword, 10 | StringLiteral, 11 | UnionType, 12 | } from "coli"; 13 | 14 | export function typeToColiType(t: variant.FigmaVariantPropertyCompatType) { 15 | if (t == FigmaNumber) { 16 | return new NumberKeyword(); 17 | } else if (t == FigmaBoolean) { 18 | return new BooleanKeyword(); 19 | } else if (t.type == "unique") { 20 | return new LiteralType(new StringLiteral(t.value)); 21 | } else if (t.type == "enum") { 22 | return new UnionType({ 23 | types: t.values.map((v) => { 24 | return new LiteralType(new StringLiteral(v)); 25 | }), 26 | }); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /packages/app-schema-editor/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@app/schema-editor", 3 | "description": "schema editor related package", 4 | "authors": "Grida.co", 5 | "version": "0.0.0", 6 | "private": false, 7 | "dependencies": { 8 | "@code-ui/completion-provider": "^0.0.4", 9 | "@code-ui/hover": "^0.0.2", 10 | "@code-ui/interface": "^0.0.5", 11 | "@code-ui/token": "^0.0.7", 12 | "@radix-ui/react-hover-card": "^0.1.0", 13 | "@tippyjs/react": "^4.2.5" 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /packages/app-schema-editor/types/index.ts: -------------------------------------------------------------------------------- 1 | import type { ISingleLayerPropertyMapping } from "./single-layer-property-type"; 2 | 3 | // region export 4 | export type IProperties = ISingleLayerPropertyMapping[]; 5 | export type { ISingleLayerPropertyMapping as ISingleLayerProperty } from "./single-layer-property-type"; 6 | -------------------------------------------------------------------------------- /packages/app-schema-editor/ux-messages/index.ts: -------------------------------------------------------------------------------- 1 | export const ERROR_MESSAGES = { 2 | nothing_is_selected: "Nothing is selected", 3 | you_must_select_instance_or_component_type_of_node: 4 | "You must select instance or component type of node.", 5 | }; 6 | -------------------------------------------------------------------------------- /packages/app-toolbox-home/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./toolbox-home"; 2 | -------------------------------------------------------------------------------- /packages/app-toolbox-home/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@app/toolbox", 3 | "version": "0.0.0" 4 | } -------------------------------------------------------------------------------- /packages/app-widget-maker-button/button-maker-screen.tsx: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | export function ButtonMakerScreen() { 3 | function handleRandomizeClick(e: any) { 4 | parent.postMessage( 5 | { 6 | pluginMessage: { 7 | type: "reflect-ui-generation/button-base", 8 | data: undefined, 9 | }, 10 | }, 11 | "*" 12 | ); 13 | } 14 | 15 | return ( 16 |Reflect button maker
18 | 19 |24 | converts all text in selected frame as Roboto Regular. this can be used 25 | when no font on original design is installed on your device. 26 |
27 | 30 |