npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@yunser/sketch-lib

v0.0.6

Published

Sketch parse to Std UI.

Downloads

3

Readme

npm run write 生成 sketch 文件,在 output/ui.sketch 就是 STD JSON 转 sketch

npm run read 读取 sketch 文件,生成 STD JSON

iframe 必须在 0, 0

入 JSON 校验

  • 功能:读取、生成 sketch

  • 封装

  • 去掉注释

  • 发布

  • 测试

  • TODO

    • blob 类型
    • 包大小
  • 生成 Sketch

    • 进度:20%
    • 问题
      • 文本没显示
      • 路径不正常显示
      • 箭头没显示
      • 分组内的形状位置不对
      • 多重分组
      • 组件
      • 切片
      • 虚线
      • visible
      • 图片圆角
      • 复合形状
      • 路径 MLCZ
      • 字体迁入
      • 打开后的位置
      • console.log('translate')
      • 非闭合路径
      • sketch 模糊不能 visible
  • 读取 Sketch

    • 进度:5%
    • 完成
      • 形状
        • rect
        • line
        • polygon
        • polyline
        • text
          • content
        • path
      • style
      • 生成 SVG
        • 暂不支持布尔运算(联合图形)
      • visible
    • TODO
      • 箭头
      • 多个外阴影
      • 内阴影
        • 多个
      • line height
      • fill
        • 多个填充
      • stroke
        • 多个
      • out of board
      • svg 大小
      • artboard name
      • page bg color
      • 兼容插件
      • 富文本
      • 混合模式
    • 问题
      • 联合图形卡住,原因:路径解析有问题
      • 不支持联合图形(布尔操作生成的图形)
      • 文字解析有问题(浏览器能力不足?不同字体的行高不一致,而浏览器无法获取行高?)
  • 生成 Sketch

    • 进度?
    • 问题
      • 不支持 group。
      • 文字样式有问题。
      • 不支持阴影。
      • 不支持渐变。
      • 路径不支持端点类型(Sketch 不支持)。
      • 不支持图片圆角(Sketch 不支持)。
      • Sketch 本身的 bug
        • 导出的svg 与 图片阴影不一致。
        • 文本 100大小,140 行高时,导出的svg 与 图片阴影不一致。字体粗细不一致。
        • 边框颜色有透明度,且设置了边框位置时,导出的 SVG 与设计稿不一致。
  • Sketch 知识

    • 直线不能翻转

Sketch 界面显示的 rotation 与代码里的不一致。

正常(代码)
//   90
//180  0
//  270



正常(界面)
//   -90
//180  0
//  90

上下翻转、左右翻转(界面)
//   90
//180  0
//  -90

翻转(代码)
//   90
//180  0
//  270

Update Log

  • v0.0.5
    • Many functions.
  • v0.0.4
    • 修改接口,兼容浏览器。

https://developer.sketch.com/reference/api/#introduction https://developer.sketchapp.boltdoggy.com/guides/first-plugin/ https://github.com/sketch-hq

zip -r -X sketch-single.sketch *

var sketch = require('sketch/dom') var async = require('sketch/async') var DataSupplier = require('sketch/data-supplier') var UI = require('sketch/ui') var Settings = require('sketch/settings')

// a more convenient require which exposes everything (might be a bit slower) var sketch = require('sketch')

Sketch 知识

  • Artboard 里面的元素位置是相对坐标,相对于 Artboard。
  • STD 里面元素的坐标是绝对坐标,相对于耶页面。