GithubHelp home page GithubHelp logo

gridaco / figma-sdk Goto Github PK

View Code? Open in Web Editor NEW
26.0 4.0 4.0 1.24 MB

🎨 Design SDK, Supercharged Figma API & Plugin Development

Home Page: https://grida.co/figma

License: MIT License

TypeScript 91.45% JavaScript 8.55%
figma grida xd sketch sdk plugin

figma-sdk's Introduction

DESIGN SDK

Build a single app that supports all figma, sketch, xd and bridged.

A mid wrapper for building consistant figma & sketch & reflection plugin, with single api reference

Powers Grida Figma Assistant

Features

  • mocks desing platform environment - faster development.
  • single api reference - write once, run everywhere.
  • reflect standard in the box - based on reflect DSL, develop with unified api structure.
  • UI support - different ui feedback features by platform such as modals (xd), notify (figma) is supported by ui library
  • OOP Based design access objects
  • General UI Related utilities in the box
  • Testing supported
  • Provides Web based development environment

Packages & Usage

yarn add @design-sdk/<package>

Packages

  • figma
    • figma-remote
    • figma-url
  • xd
  • sketch

Are you looking for universal design converter?

Take a look at design-file-converter

Sketch reference

Figma reference

XD reference

figma-sdk's People

Contributors

softmarshmallow avatar you-j avatar junhoyeo avatar

Stargazers

Cristiano Arêdes avatar BeiXiao avatar  avatar Alex avatar Feras Alnatsheh avatar Joel Javillo  avatar Katherine Martinez avatar  avatar Ben Chung avatar Michael Yagudaev avatar Stephan Wirsich avatar Bian Pratama avatar koppt avatar zhhyang avatar Tuan Duc Tran avatar Grida bot avatar Alexander Zizzo avatar Prad Nukala avatar Arjun Phlox avatar Aditya Sutar avatar Zeh Fernandes avatar Devin Halladay avatar  avatar  avatar 김우혁 avatar  avatar

Watchers

James Cloos avatar  avatar Alex Maina avatar  avatar

figma-sdk's Issues

Redesign nodes with types and properties.

Currently the sdk design follows the structure of figma plugin typings. which is poorly designed.

Need re-construction of nodes with types and properties separated.

E.g. Component should not be a type of a node, it rather be a property of a node of some other type. (which is frame.)

Higher order relative LCRS support.

current relative LCRS retrieval only works for direct parent. if the text is in the box under the root box, which box is same size as text, and the box aligned lest to the root, text will return value of center, which we should provide a way to get relative LCRS to specific target (a.k.a root)

  • root (root:box - left, root:text - left)
    • box (box:text - center)
      • text

Converting rect node to frame ignores rect's layer opacity.

image

on nodes-on-rect-convert.ts

  if (rect.visible !== false) {
    // FIXEME - on converting fills, it does not handles the rectnode's layer opacity. so dimmed color rect will be convered as non-dimmed color frame node.
    frameNode.fills = rect.fills;
    frameNode.fillStyleId = rect.fillStyleId;

    frameNode.strokes = rect.strokes;
    frameNode.strokeStyleId = rect.strokeStyleId;

    frameNode.effects = rect.effects;
    frameNode.effectStyleId = rect.effectStyleId;
  }

Add `--mock` flag support

Component variant on design tool often contains state of user interaction - e.g. A input cursor or a help text / actual input, a hover state.

See, the hover state is not a state that is exposed to outer component interface, it's a interaction state provided by native callbacks. So on design tool, hover=true variant should be marked as --mock so that design-sdk won't accidently recognize it as a state that is controllable by parent accessors.

Add variant-set node support on figma

variant-set will refuse to be converted and will throw error. this should be handled in more smarter way.

Idea: variant node as a limited type struct.
e.g.

variant-set {
   variants: component[]
}

TypeError: Cannot read property 'top' of undefined

TypeError: Cannot read property 'top' of undefined
    at convertToAutoLayout (auto-layout.convert.ts?c3e7:82)
    at convertNodesOnRectangle (nodes-on-rect.convert.ts?755f:70)
    at eval (index.ts?fcc0:178)
    at Array.map (<anonymous>)
    at intoReflectNodes (index.ts?fcc0:75)
    at convertFrameNodeToAlt (index.ts?fcc0:417)
    at eval (index.ts?fcc0:146)
    at Array.map (<anonymous>)
    at intoReflectNodes (index.ts?fcc0:75)
    at convertFrameNodeToAlt (index.ts?fcc0:417)
    at eval (index.ts?fcc0:146)
    at Array.map (<anonymous>)
    at intoReflectNodes (index.ts?fcc0:75)
    at convertFrameNodeToAlt (index.ts?fcc0:417)
    at eval (index.ts?fcc0:146)
    at Array.map (<anonymous>)
    at intoReflectNodes (index.ts?fcc0:75)
    at Module.intoReflectNode (index.ts?fcc0:67)

Error causing nodes

TypeError: Cannot read property '0' of undefined

base.node.ts?d2ee:144 Uncaught (in promise) TypeError: Cannot read property '0' of undefined
    at ReflectFrameNode.get (base.node.ts?d2ee:144)
    at getReletiveLCRS (lcrs.ts?f811:70)
    at ReflectTextNode.get (constraint.mixin.ts?87ec:26)
    at Module.commonPosition (common-position.ts?face:44)
    at retrieveAbsolutePosOrMakeWidget (positioned.wrap.ts?0736:58)
    at wrapWithPositioned (positioned.wrap.ts?0736:23)
    at TextBuilder.positionInParent (default.builder.ts?54e6:54)
    at flutterText (index.ts?6444:218)
    at handleNode (index.ts?6444:156)
    at eval (index.ts?6444:78)
    at Array.forEach (<anonymous>)
    at flutterWidgetGenerator (index.ts?6444:76)
    at flutterFrame (index.ts?6444:225)
    at handleNode (index.ts?6444:154)

This happens when absoluteTransform is undefined, caused by converting remote figma node into reflect node.

Example error causing desing

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.