figspec-react

React binding for Figspec web components

Commits at v2.0.1

  1. 861737dd 2.0.1 Shota FUJI authored at Shota FUJI comitted at
  2. c5558f9d docs: v1.0.4 CHANGELOG Shota FUJI authored at Shota FUJI comitted at
  3. 1661470e deps: Add React@19 to peerDependencies I checked their upgrade guide and no breaking changes affects this project. Shota FUJI authored at Shota FUJI comitted at
  4. 42370c0b chore: Fix Storybook does not launch I tried to start dev work but Storybook failed to launch with, ``` Error [ERR_REQUIRE_ESM]: require() of ES Module /repo/.storybook/main.js from /repo/figspec-react/node_modules/@storybook/core-common/dist/cjs/utils/interpret-require.js not supported. ``` This rename is the easiest and quickest fix I know of. Shota FUJI authored at Shota FUJI comitted at
  5. 708a8d67 2.0.0 Shota FUJI authored at Shota FUJI comitted at
  6. f4b3693c feat: Drop CommonJS output As `@figspec/components` no longer have CJS dist. Shota FUJI authored at Shota FUJI comitted at
  7. 0f4646b4 feat: Upgrade to Figspec v2 `@lit-labs/react` is also needed to upgrade because somehow the old version is not able to detect properties correctly and sets props as attributes (attribute usage is not supported in Figspec v2). Shota FUJI authored at Shota FUJI comitted at
  8. 495f0b54 chore: Fix release workflow cannot publish the package ...again. I forgot the fact Yarn ignores npm config. Shota Fuji authored at Shota Fuji comitted at
  9. f1db17a5 1.0.3 Shota Fuji authored at Shota Fuji comitted at
  10. 5dc5fa6c docs: Fix CHANGELOG content to align with keepachangelog I didn't noticed there are links at the bottom... Shota Fuji authored at Shota Fuji comitted at
  11. c7137440 chore: Upgrade `@figspec/components` to v1.0.1 https://github.com/pocka/storybook-addon-designs/issues/161#issuecomment-1208178843 In order to avoid importing `copy-to-clipboard` package, which was [removed](https://github.com/pocka/figspec/pull/36) at v1.0.1. That package is written CJS so v1.0.0 ESM build does not work at all. Shota Fuji authored at Shota Fuji comitted at
  12. 4f28a418 chore: Fix release workflow cannot publish the package Shota Fuji authored at Shota Fuji comitted at
  13. 9ead1485 docs: Add CHANGELOG.md Shota Fuji authored at Shota Fuji comitted at
  14. 23725c71 1.0.2 Shota Fuji authored at Shota Fuji comitted at
  15. 7f436c07 chore: Add release flow Shota Fuji authored at Shota Fuji comitted at
  16. caed0004 chore: Add `repository` field to package.json This is helpful. Why did I leave this field missing? Shota Fuji authored at Shota Fuji comitted at
  17. 323fc9d9 docs: Update README.md * I love badges. * More friendly installation section. * Place a link for `@figspec/components` as there are none. Shota Fuji authored at Shota Fuji comitted at
  18. 2b633584 style: Format with Prettier :( Shota Fuji authored at Shota Fuji comitted at
  19. 2443fdde chore: Update test workflow Actions are outdated. Shota Fuji authored at Shota Fuji comitted at
  20. 4ec53c79 chore: Use Yarn v3 Yarn v1 is deprecated. I ended up adding [this](https://github.com/sachinraja/yarn-plugin-postinstall-dev) plugin due to Yarn berry no longer support `prepare` script. Good plugin. Shota Fuji authored at Shota Fuji comitted at
  21. dc29d241 docs: Update CONTRIBUTING.md monorepo -> multirepo Shota Fuji authored at Shota Fuji comitted at
  22. ef184d82 chore: Upgrade to Node.js v16 It's the Active LTS. Shota Fuji authored at Shota Fuji comitted at
  23. 0c278967 chore: Configure prettier and hooks These were root package.json in monorepo. Shota Fuji authored at Shota Fuji comitted at
  24. 794b8922 fix: Remove type params from `createComponent` `@lit-labs/react@1.0.3` [0] introduced a breaking change for typings. - Before: 2nd type param is `Record<string, (e: Event) => void>` - After: 2nd type param is `Record<string, string>` (both simplified) Because we can't omit the 2nd type parameter, I deleted both type parameters. These were only for preventing typo at 4th parameter, do not affect to exported typing as there are already `as unknown as ...`. [0]: https://github.com/lit/lit/blob/93b30f7de81eb203ad88abfc1e0e87a719d132c5/packages/labs/react/CHANGELOG.md#103 Shota Fuji authored at Shota Fuji comitted at
  25. fe86446f refactor: Move workspace-d dir to root In order to retain git history as much as possible, changes to files are minimized (will be in separated commits). Shota Fuji authored at Shota Fuji comitted at
  26. abb01ba7 chore: Remove scripts/ This package is just a binding. Rendering tests should be done on `@figspec/components`. Shota Fuji authored at Shota Fuji comitted at
  27. f8308400 refactor: Quit monorepo (remove components dir) * Each package don't recieve frequent updates. * Uses independent versioning. * Create tags and releases has been hard. * It's far easier to manage devDependencies in single repo than in monorepo. No need to worry about mixing Storybook versions. * User friendly. Shota Fuji authored at Shota Fuji comitted at
  28. 5b68255d test: Move @types/react devDeps to correct place I needed to add `skipLibCheck` because a lot of React packages Storybook internally uses start emitting errors due to changes between `@types/react@16` to `@17` and/or `@18` (...probably. I immediately turned on `skipLibCheck` after seeing "Found 180 errors.", without investigation). Shota Fuji authored at Shota Fuji comitted at
  29. afa8fad3 test(react): Use React@18 for Storybook To ensure this package works with React 18. Shota Fuji authored at Shota Fuji comitted at
  30. fd11a1d2 Merge pull request #43 from brettdewoody/41-support-react-18 Add React 18 as peer dependency. Shota FUJI authored at GitHub comitted at
  31. 459b423e react/v1.0.1 Shota Fuji authored at Shota Fuji comitted at
  32. 967c346d components/v1.0.1 Shota Fuji authored at Shota Fuji comitted at
  33. 4d901a9a Merge pull request #36 from e111077/remove-clipboard remove copy-to-clipboard Shota FUJI authored at GitHub comitted at
  34. e88d2e3f Merge pull request #35 from pocka/feature/lit-labs-react Use @lit-labs/react Shota FUJI authored at GitHub comitted at
  35. 887d2e74 Merge pull request #33 from e111077/lit-2 Upgrade to lit 2 Shota FUJI authored at GitHub comitted at
  36. 99f482a3 react/v1.0.0 Shota Fuji authored at Shota Fuji comitted at
  37. 64dac51c components/v1.0.0 Shota Fuji authored at Shota Fuji comitted at
  38. bbe9ce67 feat(components): Basic touch gestures https://github.com/pocka/figspec/issues/3 Added a dead simple touch gestures. Shota Fuji authored at Shota Fuji comitted at
  39. d0e35457 docs(components): Update TODO comment To reflect the current state correctly. Shota Fuji authored at Shota Fuji comitted at
  40. 37e79762 components/v0.1.10 Shota Fuji authored at Shota Fuji comitted at
  41. 311b1aad docs: Update README Simplified. Remove bloated feature goals. Shota Fuji authored at Shota Fuji comitted at
  42. 404f5196 chore(components): Declare lit-html as a regular dependency https://github.com/pocka/figspec/issues/29 Removed the use of transitive dependency in the package. Now works on PnP-ed projects without any configuration. Shota Fuji authored at Shota Fuji comitted at
  43. ed1245dc style(components): Format with Prettier Shota Fuji authored at Shota Fuji comitted at
  44. 6f276c53 components/v0.1.9 Shota Fuji authored at Shota Fuji comitted at
  45. 9547cdf2 fix(components): Use Figma's default background colour https://github.com/pocka/figspec/issues/24 Shota Fuji authored at Shota Fuji comitted at
  46. 6c520ea4 react/v0.1.6 Shota Fuji authored at Shota Fuji comitted at
  47. f130d0b8 react/v0.1.5 Shota Fuji authored at Shota Fuji comitted at
  48. ff275f40 components/v0.1.8 Shota Fuji authored at Shota Fuji comitted at
  49. fc0c6894 Merge pull request #25 from yannbf/feat/add-link-figspect-react Feat(@figspec/react): add link prop Shota Fuji authored at GitHub comitted at
  50. 9330dbde Merge pull request #26 from yannbf/fix/footer-position fix: apply correct zindex and border to footer and sidebar Shota Fuji authored at GitHub comitted at
  51. 46ed6677 components/v0.1.7 Shota Fuji authored at Shota Fuji comitted at
  52. cb642645 chore: Run tests and lint on PR as well Shota Fuji authored at Shota Fuji comitted at
  53. 82051efe style(components): Format with Prettier Shota Fuji authored at Shota Fuji comitted at
  54. 34a8ee8a misc(components): Add link for PR in TODO comment Shota Fuji authored at Shota Fuji comitted at
  55. 15584f99 Merge pull request #23 from yannbf/fix/component-variants fix: add check for component variant node type Shota Fuji authored at GitHub comitted at
  56. e24510cf Merge pull request #21 from yannbf/feature/figma-footer Feat: add Figma metadata footer Shota Fuji authored at GitHub comitted at
  57. dc7defad components/v0.1.6 Shota Fuji authored at Shota Fuji comitted at
  58. bd44a995 deps: Mark copy-to-clipboard as direct dependency https://github.com/pocka/figspec/issues/19 Added "copy-to-clipboard" package to "dependencies" section. It's added locally by @storybook/ui so builds passed. Shota Fuji authored at Shota Fuji comitted at
  59. 8d453f8d components/v0.1.5 Shota Fuji authored at Shota Fuji comitted at
  60. 02758bb8 feat: Support for MacOS Safari pinch gesture This commit adds support for MacOS Safari's non-standard GestureEvent. See more for GestureEvent at: https://developer.apple.com/documentation/webkitjs/gestureevent NOTE: The gesture does not perform zoom-at-point due to lack of offset point in the events https://github.com/pocka/figspec/issues/2 close #2 Shota Fuji authored at Shota Fuji comitted at
  61. d12f56b2 fix: "Fix" ugly error UI https://github.com/pocka/figspec/issues/10 Previous error UI is not clearly different than normal views. This commit "fixes" the UI and improve readability. Added a new CSS variable: --figspec-viewer-error-color close #10 Shota Fuji authored at Shota Fuji comitted at
  62. 0b8cf9f2 components/v0.1.4 Shota Fuji authored at Shota Fuji comitted at
  63. 061f2204 fix(components): Specify z-index on page selector Prevent canvas contents overlapping control UI, which visible for <figspec-file-viewer/>. Shota Fuji authored at Shota Fuji comitted at
  64. 669eb592 fix(components): Disable canvas interaction on inspector https://github.com/pocka/figspec/pull/12#issuecomment-754766352 Since event handlers listens at a root of the CustomElement, gestures working even on the inspector panel. This commit prevents these gestures from working on the inspector panel by adding `stopPropagation`. The "space+drag" functionallity, on the other hand, can't be prevented because it's registered via `onmouse~` but I don't think it's critical for UX. I also fixed some elements' sizing so they could scroll and be sized properly. Shota Fuji authored at Shota Fuji comitted at
  65. dfd433cc Merge pull request #12 from yannbf/feature/inspector-view Feature/inspector view Shota Fuji authored at GitHub comitted at
  66. bdca799c Merge pull request #18 from pocka/fix/react-jsx-transform Do not use new JSX transform Shota Fuji authored at GitHub comitted at
  67. 0d60d5f2 components/v0.1.3 Shota Fuji authored at Shota Fuji comitted at
  68. a17b8bd8 react/v0.1.4 Shota Fuji authored at Shota Fuji comitted at
  69. 7389f4ba chore: Fix cjs distribution Shota Fuji authored at Shota Fuji comitted at
  70. 5fdfd745 react/v0.1.3 Shota Fuji authored at Shota Fuji comitted at
  71. bd000198 fix(react): Mark optional properties optional Shota Fuji authored at Shota Fuji comitted at
  72. bf64254e react/v0.1.2 Shota Fuji authored at Shota Fuji comitted at
  73. 66e1651b components/v0.1.2 Shota Fuji authored at Shota Fuji comitted at
  74. fe98003d chore: Fix distribution Shota Fuji authored at Shota Fuji comitted at
  75. 593c1f69 chore: Explicitly specify typing files Even though TypeScript catches typing files, npmjs.com cannot detect whether the package has TypeScript typings. Shota Fuji authored at Shota Fuji comitted at
  76. 61c8c7be chore: Fix version commit message Shota Fuji authored at Shota Fuji comitted at
  77. 4ba2027a components/v0.1.1 Shota Fuji authored at Shota Fuji comitted at
  78. 2082d618 components/v0.1.1 Shota Fuji authored at Shota Fuji comitted at
  79. c8702d95 chore: Add prepublishOnly hooks Shota Fuji authored at Shota Fuji comitted at
  80. 126d01e5 chore: Include package name in version commit message Shota Fuji authored at Shota Fuji comitted at
  81. 9c57e527 v0.1.0 Shota Fuji authored at Shota Fuji comitted at
  82. 8b7b6f14 v0.1.0 Shota Fuji authored at Shota Fuji comitted at
  83. 4dd6427e chore: Add .yarnrc Shota Fuji authored at Shota Fuji comitted at
  84. 68ca1f28 Merge pull request #16 from pocka/feature/figma-file Figma file support Shota Fuji authored at GitHub comitted at
  85. 4c6e54c3 Merge pull request #15 from pocka/feature/events Custom Events Shota Fuji authored at GitHub comitted at
  86. def2c3a6 Merge pull request #14 from pocka/feature/cache-heavy-computation Cache tree node related things Shota Fuji authored at GitHub comitted at
  87. 9882ccad docs: Add CONTRIBUTING.md Shota Fuji authored at GitHub comitted at
  88. 1e1fa1e7 docs: Add CODE_OF_CONDUCT.md Shota Fuji authored at GitHub comitted at
  89. 82fa4961 chore: Lint files on push Shota Fuji authored at Shota Fuji comitted at
  90. 497e5f77 docs: README for an internal script Shota Fuji authored at Shota Fuji comitted at
  91. 30934c6d docs: Update README Wrote at-least-meaningful things. Shota Fuji authored at Shota Fuji comitted at
  92. dfe5a51a Merge pull request #13 from pocka/feature/react-binding React bindings Shota Fuji authored at GitHub comitted at
  93. 3524be23 Merge pull request #11 from pocka/feature/initial-zoom-level Initial zoom level Shota Fuji authored at GitHub comitted at
  94. 1f3fdd1f chore: Do not flag src/index.ts as pure Without specifying the file in package.json#sideEffects, webpack used by build-storybook marks the file as side-effect free and omits it! Shota Fuji authored at Shota Fuji comitted at
  95. 569c3f80 Merge pull request #9 from yannbf/feature/add-drag Feature: add drag functionality like figma Shota Fuji authored at GitHub comitted at
  96. d8991c59 refactor: Use single customElement for preview Use only <figspec-viewer> instead of with <figma-viewer-guide>. This reduces maintenance costs and makes modifying the codebase more easy. I also changed the DOM structure to rendering guides and tooltips inside one single <svg> container for simplicity (and for performance, hopefully). Shota Fuji authored at Shota Fuji comitted at
  97. 2a57a999 refactor: figma-viewer -> figspec-viewer To match the package name. Also avoids conflict with future (possible) official custom elements. Shota Fuji authored at Shota Fuji comitted at
  98. 063bdb78 Initial commit Shota Fuji authored at Shota Fuji comitted at
  99. 0182f0c6 chore(storybook): set stories to use fullscreen Yann Braga authored at Yann Braga comitted at
  100. f06f1246 feature: add drag like figma Figma provides drag functionality when holding space, so does other tools. Functionality is added to match that. Yann Braga authored at Yann Braga comitted at
  101. 8901f50d misc: Remove unnecessary default value from story Shota Fuji authored at Shota Fuji comitted at
  102. 55c50936 chore: Fix preview height on Docs page Shota Fuji authored at Shota Fuji comitted at
  103. c53ff5fe misc: Mark non-public properties as private Almost every public accesible properties are caught by web-component-analyzer and appears on Docs table. Some getters and inherited public properties are not intended to be used by users. Shota Fuji authored at Shota Fuji comitted at
  104. b6d4e733 feat: Initial zoom level https://github.com/pocka/figspec/issues/1 Sets initial zoom level based on element's size. This might not be same as Figma's behavior, but it's convenient. Shota Fuji authored at Shota Fuji comitted at
  105. 4184ab6e feat(react): React bindings You can use WebComponents (custom elements) in React, but the experience is not great. No props binding (React uses setAttribute), Poor type definition (JSX does great job though), Imperative event handling, etc... This bindings aim to solve these inconveniencies. Shota Fuji authored at Shota Fuji comitted at
  106. af9a7942 perf: Does not compute node related stuff each render https://github.com/pocka/figspec/issues/7 Only performe flattening the node tree, determining outermost bounding rect and construct distance-lines when related values have updated. From what I saw, this change stabilizes an average FPS and makes a memory usage more mild (less GC sweep). Shota Fuji authored at Shota Fuji comitted at
  107. 825ba0bc feat(react): Add event bindings Shota Fuji authored at Shota Fuji comitted at
  108. a6428c1f feat(components): Add custom events https://github.com/pocka/figspec/issues/5 Added `scalechange`, `positionchange` and `nodeselect` events. Shota Fuji authored at Shota Fuji comitted at
  109. 704cd1a8 docs(react): Update README Shota Fuji authored at Shota Fuji comitted at
  110. 5124aaa1 docs(components): Update README Shota Fuji authored at Shota Fuji comitted at
  111. d3024f17 feat(react): Figma file support Shota Fuji authored at Shota Fuji comitted at
  112. 4439e63f feat(components): Figma File support Shota Fuji authored at Shota Fuji comitted at
  113. 1f79281a refactor(components): Delegate viewer functionalitty into mixin Shota Fuji authored at Shota Fuji comitted at
  114. cc281367 refactor(components): Slim down figspec-viewer In order to add file viewer feature, I needed to split non-nodes related codes out from <figspec-viewer>. This commit does: 1. Make error UI as component (View function) 2. Move pan/scale related things out as a mixin With a little more cleanup, I can add file viewer feature without a bunch of duplicated code :) Shota Fuji authored at Shota Fuji comitted at
  115. dfa1d215 chore(scripts): Save images as well Shota Fuji authored at Shota Fuji comitted at
  116. 22478c88 chore(scripts): Support file fetching https://github.com/pocka/figspec/issues/8 Shota Fuji authored at Shota Fuji comitted at
  117. 90a93012 fix(react): Do not use new JSX transform https://github.com/pocka/figspec/issues/17 Shota Fuji authored at Shota Fuji comitted at
  118. 4996f1cb fix(components): stop click propagation on inspector view Yann Braga authored at Yann Braga comitted at
  119. d8378333 feat(components): deselect node when clicking outside of canvas Yann Braga authored at Yann Braga comitted at
  120. 551276fc feat(components): improve color calculation and property extraction Yann Braga authored at Yann Braga comitted at
  121. 24013dd3 feat(components): add inspector view to main viewer Yann Braga authored at Yann Braga comitted at
  122. f22f68dc feat(components): extract more properties in inspector view Yann Braga authored at Yann Braga comitted at
  123. 4ba33817 feat: add inspector view Yann Braga authored at Yann Braga comitted at
  124. db85e596 chore(deps): upgrade storybook to 6.2 Yann Braga authored at Yann Braga comitted at
  125. 50c3e78b feat: add figma footer - Present a footer with metadata of the figma file such as title, timestamp and a link to open on Figma Yann Braga authored at Yann Braga comitted at
  126. be5a37be fix: add check for component variant node type Yann Braga authored at Yann Braga comitted at
  127. d9025cc3 fix: apply correct zindex and border to footer and sidebar - The footer should be above the design, but below the sidebar Yann Braga authored at Yann Braga comitted at
  128. 3a4ddeb7 feat: add link property - Figspect will now present a footer with component meta in case link is passed Yann Braga authored at Yann Braga comitted at
  129. 44c6eda7 run prettier e111077 authored at e111077 comitted at
  130. 63b8aa12 run linter e111077 authored at e111077 comitted at
  131. f1566812 upgrade to lit 2 e111077 authored at e111077 comitted at
  132. b5180d5b refactor(react): Use @lit-labs/react https://github.com/pocka/figspec/issues/34 The existing glue code was working okay. However, adding property or attribute to the element is daunting and easy to misconfigure. I replaced the code with new integration package provided by official lit maintainers for maintanability reasons. I kept type signatures to make sure this change does not break users' type checking accidentally. close #34 Shota Fuji authored at Shota Fuji comitted at
  133. f702b258 clean up implementation e111077 authored at e111077 comitted at
  134. 681c8ad1 run prettier e111077 authored at e111077 comitted at
  135. a6603128 run linter e111077 authored at e111077 comitted at
  136. 7ab21cd6 remove copy-to-clipboard e111077 authored at e111077 comitted at
  137. 593b7e6b Add React 18 as peer dependency. Brett DeWoody authored at Brett DeWoody comitted at