profile
viewpoint
Pete Hunt petehunt Smyte San Francisco, CA CEO @ Smyte, ex-React team at Facebook

excalidraw/excalidraw 11550

Virtual whiteboard for sketching hand-drawn like diagrams

jsxstyle/jsxstyle 1941

Inline style system for React and Preact

andreypopp/reactify 696

[DEPRECATED] Browserify transform for JSX (superset of JavaScript used in React library by Facebook)

excalidraw/excalidraw-blog 34

Excalidraw blog build with Gatsby

petehunt/angularjs-tutorials 31

Fundoo Solution's AngularJS tutorials

hellojwilde/node-safebrowsing 8

(Work in progress.) Client for the Google Safe Browsing API v3.

push eventpetehunt/use-state-singleton

Pete Hunt

commit sha 835e275052094858a877d8f14e58d43ab8f2de8f

Vastly simplify the implementation and reduce deps

view details

push time in 9 hours

PR opened excalidraw/excalidraw

One-click installable libraries

This introduces a lightweight way of sharing libraries. Library authors can put their libraries up as static file somewhere (github gists work just great) and share clickable links for users to install them.

If this is accepted, I think we should create a wiki page where the community can add their own shape libraries.

To try it, click the link below: <will insert link after CI runs>

+44 -1

0 comment

3 changed files

pr created time in 3 days

create barnchpetehunt/excalidraw

branch : add-to-library-link

created branch time in 3 days

pull request commentexcalidraw/excalidraw

Fix pinch-to-zoom performance

i agree with your sentiment on DX vs UX but i don't see that tension here.

in my subjective view, a laggy zoom experience is a lot worse than 300ms of blurriness that may or may not be obvious to the user (depending on the zoom level). given this, i think this PR is the more user-friendly behavior since a heuristic based on the # of elements can't tell us for sure whether the pinch-to-zoom will be smooth. in the case of a smaller number of very complex elements -- or some future element type that is perhaps more expensive to render -- we could still see jank in the zoom experience. ensuring that expensive rendering won't happen during touch gestures is a stronger guarantee, and it's consistent with the UX of other apps with zoomable interfaces.

petehunt

comment created time in 3 days

pull request commentexcalidraw/excalidraw

Fix pinch-to-zoom performance

hm, can we close it in favor of this one? i don't like the idea of zoom user experience and performance characteristics changing at an arbitrary threshold of # of elements -- seems like it will lead to hard-to-repro issues eventually, and i'm not convinced that the improved UX in the low-element case is really worth it. wdyt?

petehunt

comment created time in 3 days

PR opened excalidraw/excalidraw

Fix middle mouse panning on windows

The middle mouse panning on Windows resulted in the canvas jumping the wrong direction.

Test plan:

  • Test middle mouse behavior on windows. Before it's broken. Now it works.
  • Test two finger pan on mac desktop touchpad. No regression.
+5 -0

0 comment

1 changed file

pr created time in 4 days

create barnchpetehunt/excalidraw

branch : fixpan

created branch time in 4 days

PR opened excalidraw/excalidraw

Fix pinch-to-zoom performance

Pinch-to-zoom is pretty unusable on large drawings using Chrome on my MacBook Pro. This introduces the debounced cache busting that is used in other parts of the codebase.

Test plan: pinched to zoom on a large drawing. Before, it was slow. Now it's fast (and blurry for up to 300ms before it rerenders).

+2 -0

0 comment

1 changed file

pr created time in 4 days

create barnchpetehunt/excalidraw

branch : fixzoom

created branch time in 4 days

issue openedexcalidraw/excalidraw

Reconciliation algorithm breaks z-order

The reconciliation algorithm does not sync z-order correctly. Repro by overlaying two shapes with solid fill colors and moving one to the front. You'll see that in collaborative mode both peers may not converge to the same state.

created time in 9 days

push eventpetehunt/use-state-singleton

Pete Hunt

commit sha 97a816cc96d6a0d0f7c949420edeb06a8a88cee2

Update README.md

view details

push time in a month

PublicEvent

pull request commentpetehunt/rowrm

add syntax highlighting to readme

thanks!

amilajack

comment created time in a month

push eventpetehunt/rowrm

Amila Welihinda

commit sha da4612c39b6f834ae9eef6535931df0992298926

add syntax highlighting to readme

view details

Pete Hunt

commit sha 2cba2a6b65b2f0ded8b1c25255c8b27b2bf23151

Merge pull request #1 from amilajack/patch-1 add syntax highlighting to readme

view details

push time in a month

PR merged petehunt/rowrm

add syntax highlighting to readme
+7 -7

0 comment

1 changed file

amilajack

pr closed time in a month

push eventpetehunt/rowrm

Pete Hunt

commit sha 46fd1f5a50552bc1314b0b96642201b6744e6356

Use proxies

view details

push time in 2 months

issue openedjsxstyle/jsxstyle

Ideas for a jsxstyle 3.0

Here's a few ideas for what we could do with jsxstyle 3:

  • Implement #148 and #149
  • Change the default API to instead override JSX. So you can do stuff like <input type="text" onChange={...} value={...} margin={10} border="1px solid black" />
  • Move the existing row/col/inline components to a contrib package. It's a good opportunity to reintroduce Table components and turn on #141.
  • Consider substantially simplifying the static style extraction:
    • Make it less ambitious: this should just be a runtime optimization to reduce the number of props that need to be reconciled. No need to emit a static CSS file.
    • Depend on typescript compiler API for this optimization. Use the typechecker to infer the literal string and number types rather than have our own custom AST traversal stuff.
  • Level up the hype train. I'm pretty convinced at this point that jsxstyle is a really great way to do

created time in 2 months

push eventpetehunt/rowrm

Pete Hunt

commit sha 1d05a975456f3eef6d83a3e8a9b5275c6bc0e031

Update README.md

view details

push time in 2 months

push eventpetehunt/use-state-singleton

Pete Hunt

commit sha 310da94302ad220cc39891324b2b47e8ecda693f

remove test.only, re-prettier, invariant -> tiny-invariant

view details

push time in 2 months

push eventpetehunt/use-state-singleton

dependabot[bot]

commit sha c78ad9e146d021b15ef57880300c0297a7f257f3

Bump lodash from 4.17.15 to 4.17.19 Bumps [lodash](https://github.com/lodash/lodash) from 4.17.15 to 4.17.19. - [Release notes](https://github.com/lodash/lodash/releases) - [Commits](https://github.com/lodash/lodash/compare/4.17.15...4.17.19) Signed-off-by: dependabot[bot] <support@github.com>

view details

Pete Hunt

commit sha ade06dcceccb2edc38fbfd235c238f9adcf330c6

Merge pull request #4 from petehunt/dependabot/npm_and_yarn/lodash-4.17.19 Bump lodash from 4.17.15 to 4.17.19

view details

push time in 2 months

PR merged petehunt/use-state-singleton

Bump lodash from 4.17.15 to 4.17.19 dependencies

Bumps lodash from 4.17.15 to 4.17.19. <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/lodash/lodash/releases">lodash's releases</a>.</em></p> <blockquote> <h2>4.17.16</h2> </blockquote> </details> <details> <summary>Commits</summary> <ul> <li><a href="https://github.com/lodash/lodash/commit/d7fbc52ee0466a6d248f047b5d5c3e6d1e099056"><code>d7fbc52</code></a> Bump to v4.17.19</li> <li><a href="https://github.com/lodash/lodash/commit/2e1c0f22f425e9c013815b2cd7c2ebd51f49a8d6"><code>2e1c0f2</code></a> Add npm-package</li> <li><a href="https://github.com/lodash/lodash/commit/1b6c282299f4e0271f932b466c67f0f822aa308e"><code>1b6c282</code></a> Bump to v4.17.18</li> <li><a href="https://github.com/lodash/lodash/commit/a370ac81408de2da77a82b3c4b61a01a3b9c2fac"><code>a370ac8</code></a> Bump to v4.17.17</li> <li><a href="https://github.com/lodash/lodash/commit/1144918f3578a84fcc4986da9b806e63a6175cbb"><code>1144918</code></a> Rebuild lodash and docs</li> <li><a href="https://github.com/lodash/lodash/commit/3a3b0fd339c2109563f7e8167dc95265ed82ef3e"><code>3a3b0fd</code></a> Bump to v4.17.16</li> <li><a href="https://github.com/lodash/lodash/commit/c84fe82760fb2d3e03a63379b297a1cc1a2fce12"><code>c84fe82</code></a> fix(zipObjectDeep): prototype pollution (<a href="https://github-redirect.dependabot.com/lodash/lodash/issues/4759">#4759</a>)</li> <li><a href="https://github.com/lodash/lodash/commit/e7b28ea6cb17b4ca021e7c9d66218c8c89782f32"><code>e7b28ea</code></a> Sanitize sourceURL so it cannot affect evaled code (<a href="https://github-redirect.dependabot.com/lodash/lodash/issues/4518">#4518</a>)</li> <li><a href="https://github.com/lodash/lodash/commit/0cec225778d4ac26c2bac95031ecc92a94f08bbb"><code>0cec225</code></a> Fix lodash.isEqual for circular references (<a href="https://github-redirect.dependabot.com/lodash/lodash/issues/4320">#4320</a>) (<a href="https://github-redirect.dependabot.com/lodash/lodash/issues/4515">#4515</a>)</li> <li><a href="https://github.com/lodash/lodash/commit/94c3a8133cb4fcdb50db72b4fd14dd884b195cd5"><code>94c3a81</code></a> Document matches* shorthands for over* methods (<a href="https://github-redirect.dependabot.com/lodash/lodash/issues/4510">#4510</a>) (<a href="https://github-redirect.dependabot.com/lodash/lodash/issues/4514">#4514</a>)</li> <li>Additional commits viewable in <a href="https://github.com/lodash/lodash/compare/4.17.15...4.17.19">compare view</a></li> </ul> </details> <details> <summary>Maintainer changes</summary> <p>This version was pushed to npm by <a href="https://www.npmjs.com/~mathias">mathias</a>, a new releaser for lodash since your current version.</p> </details> <br />

Dependabot compatibility score

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


<details> <summary>Dependabot commands and options</summary> <br />

You can trigger Dependabot actions by commenting on this PR:

  • @dependabot rebase will rebase this PR
  • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
  • @dependabot merge will merge this PR after your CI passes on it
  • @dependabot squash and merge will squash and merge this PR after your CI passes on it
  • @dependabot cancel merge will cancel a previously requested merge and block automerging
  • @dependabot reopen will reopen this PR if it is closed
  • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
  • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
  • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
  • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
  • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
  • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

You can disable automated security fix PRs for this repo from the Security Alerts page.

</details>

+3 -3

0 comment

1 changed file

dependabot[bot]

pr closed time in 2 months

push eventpetehunt/use-state-singleton

dependabot[bot]

commit sha b0ca452a92d82b4f8f523f905369252a83adbad7

Bump minimist from 1.2.0 to 1.2.5 Bumps [minimist](https://github.com/substack/minimist) from 1.2.0 to 1.2.5. - [Release notes](https://github.com/substack/minimist/releases) - [Commits](https://github.com/substack/minimist/compare/1.2.0...1.2.5) Signed-off-by: dependabot[bot] <support@github.com>

view details

Pete Hunt

commit sha ad897559bb885e98b1cafa19209d311b5703c02b

Merge pull request #3 from petehunt/dependabot/npm_and_yarn/minimist-1.2.5 Bump minimist from 1.2.0 to 1.2.5

view details

push time in 2 months

PR merged petehunt/use-state-singleton

Bump minimist from 1.2.0 to 1.2.5 dependencies

Bumps minimist from 1.2.0 to 1.2.5. <details> <summary>Commits</summary> <ul> <li><a href="https://github.com/substack/minimist/commit/aeb3e27dae0412de5c0494e9563a5f10c82cc7a9"><code>aeb3e27</code></a> 1.2.5</li> <li><a href="https://github.com/substack/minimist/commit/278677b171d956b46613a158c6c486c3ef979b20"><code>278677b</code></a> 1.2.4</li> <li><a href="https://github.com/substack/minimist/commit/4cf1354839cb972e38496d35e12f806eea92c11f"><code>4cf1354</code></a> security notice</li> <li><a href="https://github.com/substack/minimist/commit/1043d212c3caaf871966e710f52cfdf02f9eea4b"><code>1043d21</code></a> additional test for constructor prototype pollution</li> <li><a href="https://github.com/substack/minimist/commit/6457d7440a47f329c12c4a5abfbce211c4235b93"><code>6457d74</code></a> 1.2.3</li> <li><a href="https://github.com/substack/minimist/commit/38a4d1caead72ef99e824bb420a2528eec03d9ab"><code>38a4d1c</code></a> even more aggressive checks for protocol pollution</li> <li><a href="https://github.com/substack/minimist/commit/13c01a5327736903704984b7f65616b8476850cc"><code>13c01a5</code></a> more failing proto pollution tests</li> <li><a href="https://github.com/substack/minimist/commit/f34df077a6b2bee1344188849a95e66777109e89"><code>f34df07</code></a> 1.2.2</li> <li><a href="https://github.com/substack/minimist/commit/67d3722413448d00a62963d2d30c34656a92d7e2"><code>67d3722</code></a> cleanup</li> <li><a href="https://github.com/substack/minimist/commit/63e7ed05aa4b1889ec2f3b196426db4500cbda94"><code>63e7ed0</code></a> don't assign onto <strong>proto</strong></li> <li>Additional commits viewable in <a href="https://github.com/substack/minimist/compare/1.2.0...1.2.5">compare view</a></li> </ul> </details> <br />

Dependabot compatibility score

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


<details> <summary>Dependabot commands and options</summary> <br />

You can trigger Dependabot actions by commenting on this PR:

  • @dependabot rebase will rebase this PR
  • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
  • @dependabot merge will merge this PR after your CI passes on it
  • @dependabot squash and merge will squash and merge this PR after your CI passes on it
  • @dependabot cancel merge will cancel a previously requested merge and block automerging
  • @dependabot reopen will reopen this PR if it is closed
  • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
  • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
  • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
  • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
  • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
  • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

You can disable automated security fix PRs for this repo from the Security Alerts page.

</details>

+3 -3

0 comment

1 changed file

dependabot[bot]

pr closed time in 2 months

PR merged petehunt/use-state-singleton

Bump acorn from 6.4.0 to 6.4.1 dependencies

Bumps acorn from 6.4.0 to 6.4.1. <details> <summary>Commits</summary> <ul> <li><a href="https://github.com/acornjs/acorn/commit/9a2e9b6678e243d66846b91179d650d28453e70c"><code>9a2e9b6</code></a> Mark version 6.4.1</li> <li><a href="https://github.com/acornjs/acorn/commit/90a9548ea0ce351b54f956e2c4ed27cca9631284"><code>90a9548</code></a> More rigorously check surrogate pairs in regexp validator</li> <li>See full diff in <a href="https://github.com/acornjs/acorn/compare/6.4.0...6.4.1">compare view</a></li> </ul> </details> <br />

Dependabot compatibility score

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


<details> <summary>Dependabot commands and options</summary> <br />

You can trigger Dependabot actions by commenting on this PR:

  • @dependabot rebase will rebase this PR
  • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
  • @dependabot merge will merge this PR after your CI passes on it
  • @dependabot squash and merge will squash and merge this PR after your CI passes on it
  • @dependabot cancel merge will cancel a previously requested merge and block automerging
  • @dependabot reopen will reopen this PR if it is closed
  • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
  • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
  • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
  • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
  • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
  • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

You can disable automated security fix PRs for this repo from the Security Alerts page.

</details>

+6 -6

0 comment

1 changed file

dependabot[bot]

pr closed time in 2 months

push eventpetehunt/use-state-singleton

dependabot[bot]

commit sha ae31a4894969970fa9680816dcd0e2020b3c2241

Bump acorn from 6.4.0 to 6.4.1 Bumps [acorn](https://github.com/acornjs/acorn) from 6.4.0 to 6.4.1. - [Release notes](https://github.com/acornjs/acorn/releases) - [Commits](https://github.com/acornjs/acorn/compare/6.4.0...6.4.1) Signed-off-by: dependabot[bot] <support@github.com>

view details

Pete Hunt

commit sha 6c86eaa437fd4b2b38d6893046567f70b3e6e090

Merge pull request #2 from petehunt/dependabot/npm_and_yarn/acorn-6.4.1 Bump acorn from 6.4.0 to 6.4.1

view details

push time in 2 months

push eventpetehunt/rowrm

Pete Hunt

commit sha d66fdbf32ad52107f7d07267cfca296d326b65c6

Update README.md

view details

push time in 2 months

push eventpetehunt/rowrm

Pete Hunt

commit sha fa29bd271a37863670cc10a49bc5b861acd7bc01

Update README.md

view details

push time in 2 months

push eventpetehunt/rowrm

Pete Hunt

commit sha 72bb504b6e6567d055604144ab70128294bf17cc

comma splice

view details

push time in 2 months

push eventpetehunt/rowrm

Pete Hunt

commit sha df2329e2061d28e4965f80427449045c5244cb45

Update README.md

view details

push time in 2 months

push eventpetehunt/rowrm

Pete Hunt

commit sha 872f7dfdd4c30b02e698db21c9ad8441429a32e3

Update README.md

view details

push time in 2 months

push eventpetehunt/rowrm

Pete Hunt

commit sha 10601326392c68952ee9d9915d6820cd0363825f

Revert "rename to st-orm" This reverts commit 2c7aa1bf7c0d1e5c1fd39932e6a29b953bd3ba3c.

view details

push time in 2 months

push eventpetehunt/rowrm

Pete Hunt

commit sha 2c7aa1bf7c0d1e5c1fd39932e6a29b953bd3ba3c

rename to st-orm

view details

push time in 2 months

push eventpetehunt/rowrm

Pete Hunt

commit sha a7863a51ba82317246de6496e777da785d40f6c9

getOneOrThrow

view details

push time in 2 months

push eventpetehunt/rowrm

Pete Hunt

commit sha 85c247716dde3522b42e763a43d97867401a0859

Get rid of optional fields

view details

push time in 2 months

push eventpetehunt/rowrm

Pete Hunt

commit sha 3095b144562ebb53afc47bd35365ca74e8298e04

Fix bugs in publish process

view details

push time in 2 months

push eventpetehunt/rowrm

Pete Hunt

commit sha 26f6f46637fb20b51891bdf23a6862d70b1d0c01

fix package json

view details

push time in 2 months

push eventpetehunt/rowrm

Pete Hunt

commit sha 721d50dd302ceb59db8d3058b843bb937f9fcefc

add order by

view details

push time in 2 months

create barnchpetehunt/rowrm

branch : master

created branch time in 2 months

push eventpetehunt/rowrm

Pete Hunt

commit sha ab038aa204d43c294db2270a1279b6da0c41aced

add limitations

view details

push time in 2 months

create barnchpetehunt/rowrm

branch : rowrm

created branch time in 2 months

created repositorypetehunt/rowrm

created time in 2 months

issue openedForbesLindesay/atdatabases

@databases eats async stack traces

Here's a repro. The line numbers still aren't right, but that's an issue with ts-node and my repro I think (it works in my main project). I think the issue is then-queue is not using native promises.

import connect, { sql } from "@databases/sqlite";

async function broken() {
  const db = await connect();
  await db.query(sql`this is an invalid sql statement`);
}

async function works() {
  const db = await connect();
  try {
    await db.query(sql`this is an invalid sql statement`);
  } catch (e) {
    throw new Error(e);
  }
}

async function main() {
  // if you uncomment broken(), the following is printed to stderr:
  // Error: SQLITE_ERROR: near "this": syntax error
  //await broken();

  // if you uncomment works(), the following is printed to stderr:
  await works();
  // Error: Error: SQLITE_ERROR: near "this": syntax error
  //   at /mnt/d/Repos/rowrm/src/repro.ts:13:11
  //   at step (/mnt/d/Repos/rowrm/src/repro.ts:37:23)
  //   at Object.throw (/mnt/d/Repos/rowrm/src/repro.ts:18:53)
  //   at rejected (/mnt/d/Repos/rowrm/src/repro.ts:10:65)
}

main().catch((e) => {
  console.error(e.stack);
  process.exit(1);
});

created time in 2 months

issue openedForbesLindesay/atdatabases

sql.file does not support multiple statements for sqlite

hey - thanks for a great library. i haven't tested this with any other db besides sqlite, but it doesn't seem to support multiple statements via sql.file: https://gist.github.com/petehunt/6a889fc8d01e14fb1667a1e7f9cb0ffd

this is pretty important as most of the time i have a separate .sql file to set up the schema. right now i work around it by reading the file directly and splitting on semicolons -- not the most optimal way to do it i think :)

created time in 2 months

issue openedexcalidraw/excalidraw

Library improvements

I think the library could be improved a lot. I probably won't have time to get around to it so this would be a great set of tasks for someone new to the project to take on. These include:

[ ] Play with the rendering of the library grid. The squares could be smaller or adjust their size [ ] Make it more usable on mobile [ ] Create a way to import and export your library to a file, and add a wiki page where people can share their libraries [ ] Clean up the UX around adding to the library. I don't actually know exactly what to do here, but anything is better than what I did :)

created time in 2 months

push eventpetehunt/excalidraw

Pete Hunt

commit sha 2bb33f8bca9ab910e340296818a3bee5c445dc2b

Fix more race conditions

view details

push time in 2 months

PR opened excalidraw/excalidraw

Library state cleanup

I'm really worried about having promises interleaved into the react code. It could lead to pretty subtle race conditions. This moves to using a hooks-based approach.

+114 -98

0 comment

5 changed files

pr created time in 2 months

create barnchpetehunt/excalidraw

branch : kill-promises

created branch time in 2 months

Pull request review commentexcalidraw/excalidraw

Library MVP

 export const exportCanvas = async (       window.alert(t("alerts.couldNotCopyToClipboard"));     }   } else if (type === "backend") {-    const appState = getDefaultAppState();-    if (exportBackground) {-      appState.viewBackgroundColor = viewBackgroundColor;-    }-    exportToBackend(elements, appState);+    exportToBackend(elements, {+      ...appState,+      viewBackgroundColor: exportBackground+        ? appState.viewBackgroundColor+        : getDefaultAppState().viewBackgroundColor,+    });

thank you!

petehunt

comment created time in 3 months

Pull request review commentexcalidraw/excalidraw

Library MVP

 class App extends React.Component<ExcalidrawProps, AppState> {         this.setState(           (state) => ({             ...actionResult.appState,+            // use prev library to guard against clearing it when restoring etc.

i think this breaks the right click "add to library" menu option

petehunt

comment created time in 3 months

push eventpetehunt/excalidraw

Oren Me

commit sha 84abda82d579cc1aa79bc19b8f0a8c5d80749311

docs: add multiple selection docs (#1875)

view details

David Luzar

commit sha b1261eea70e3e93073e25c3b96098d80f77d30d6

duplicate point on cmd+d (#1831)

view details

Aakansha Doshi

commit sha 9351b2821c1d6a96f384d7fb2d92a006b9fc056e

feat: add width, height as props to App.tsx (#1871)

view details

Lipis

commit sha ead58bf2d9732867006ebc5409719c180fb834b4

New Crowdin updates (#1856)

view details

Aakansha Doshi

commit sha 01e546c230c0bd7425b1db44a4b310fefd5290b8

use width,height from current appstate when initializing scene (#1882) Co-authored-by: dwelle <luzar.david@gmail.com>

view details

dependabot-preview[bot]

commit sha 3a4bc68025dfc4f7bd404ca19880fa7e72459711

Bump typescript from 3.9.5 to 3.9.6 (#1874) Bumps [typescript](https://github.com/Microsoft/TypeScript) from 3.9.5 to 3.9.6. - [Release notes](https://github.com/Microsoft/TypeScript/releases) - [Commits](https://github.com/Microsoft/TypeScript/commits) Signed-off-by: dependabot-preview[bot] <support@dependabot.com> Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>

view details

dependabot-preview[bot]

commit sha eb9a9b628a6b7d94eeb8fadb6f9668309ec052f2

Bump browser-nativefs from 0.9.0 to 0.9.1 (#1873) Bumps [browser-nativefs](https://github.com/GoogleChromeLabs/browser-nativefs) from 0.9.0 to 0.9.1. - [Release notes](https://github.com/GoogleChromeLabs/browser-nativefs/releases) - [Commits](https://github.com/GoogleChromeLabs/browser-nativefs/commits) Signed-off-by: dependabot-preview[bot] <support@dependabot.com> Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>

view details

dependabot-preview[bot]

commit sha 6f1cff101a76e3234178fa704ce31ba1d2203c2c

Bump @testing-library/react from 10.4.3 to 10.4.4 (#1872) Bumps [@testing-library/react](https://github.com/testing-library/react-testing-library) from 10.4.3 to 10.4.4. - [Release notes](https://github.com/testing-library/react-testing-library/releases) - [Changelog](https://github.com/testing-library/react-testing-library/blob/master/CHANGELOG.md) - [Commits](https://github.com/testing-library/react-testing-library/compare/v10.4.3...v10.4.4) Signed-off-by: dependabot-preview[bot] <support@dependabot.com> Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>

view details

David Luzar

commit sha df5eb3f0d971e6172ced6ae7d8835179be131ca7

change copy/paste styles shortcuts (#1881) * change copy/paste styles shortcuts * use keyCode

view details

Pete Hunt

commit sha 2bfee253a2a8d611b05f0ea5ded7182193c773fb

library v0 Always show library Show library on mobile click to add Put a max height + scroll on the library menu More discoverable 'add to library' behavior 9 to open library Save and load library from local storage Make library openable on mobile

view details

push time in 3 months

issue commentexcalidraw/excalidraw

Persisted rooms

With some small changes we have the room server run reconciliation in a full e2e-encrypted manner. All it will know is how many shapes there are and how many are edited.

  1. Split room id into two parts /room/db_id#client_secret.
  2. Share id / version / versionNonce with the server as part of an unencrypted envelope wrapping the rest of the fields of the element which are encrypted.
  3. Server can run reconciliation and store it permanently.

This will also let us solve backpressure since the server can now mediate the message flow. I like this solution better because we don't need public/private crypto and we don't need to share a secret with the server. Also, asking the server to generate the secret key for you effectively introduces a back door which I'd like to avoid. What do you think?

vjeux

comment created time in 3 months

pull request commentexcalidraw/excalidraw

Library MVP

OK, I think this PR is reviewable. I think I did everything except:

  • Fix the toolbar to work well on mobile. This was already an issue and would prefer to do it separately
  • Support hotkeyed library items. I think this can be added later.
  • Didn't do size normalization, can be done later

Please double check the library loading logic -- not sure if I got all the places where app state is reloaded. And let me know what you think about the new adding experience.

petehunt

comment created time in 3 months

push eventpetehunt/excalidraw

Pete Hunt

commit sha 0f9950ce1deef97e8e0a054eb22ad36ad6e1f23f

Make library openable on mobile

view details

push time in 3 months

push eventpetehunt/excalidraw

Pete Hunt

commit sha e5879c351e1e5ce1189a3471282ec890415a40b3

Save and load library from local storage

view details

push time in 3 months

push eventpetehunt/excalidraw

Pete Hunt

commit sha ad9c68f55d036580fe8ddfea3f88c42e5aa4be54

Put a max height + scroll on the library menu

view details

Pete Hunt

commit sha 5a91ce70ade13a789601fa3a21fa5189680abb96

More discoverable 'add to library' behavior

view details

Pete Hunt

commit sha 33faeeb4b61a2445f1564533386a2ae60b393737

9 to open library

view details

push time in 3 months

push eventpetehunt/excalidraw

Kostas Bariotis

commit sha bda8415714980e12b6329f70cf1d4d8b5ed38012

Include stroke style when copy/paste styles (#1785)

view details

Kostas Bariotis

commit sha a357d00bbe1137a2e5dc0da1b4db467edbab904d

Hint for shortcut for moving the visible area (#1784)

view details

Daishi Kato

commit sha 482fa2d90f9f56ba9fa0dd2cc458f3af232c5598

fix visibility check on rotated elements (#1799)

view details

Jed Fox

commit sha b6bf011d0d5e49511e13787cc0d5fc1095b80837

Inline the dropdown icon (#1782)

view details

Daishi Kato

commit sha baa8fb6c14c49fdd0b6ff0b4a5ab768bb39071f9

grid support (1st iteration) (#1788) Co-authored-by: dwelle <luzar.david@gmail.com>

view details

dependabot-preview[bot]

commit sha 76cbefb4cec3bfc152554849bf33c65ccf29ebbf

Bump lint-staged from 10.2.10 to 10.2.11 (#1804) Bumps [lint-staged](https://github.com/okonet/lint-staged) from 10.2.10 to 10.2.11. - [Release notes](https://github.com/okonet/lint-staged/releases) - [Commits](https://github.com/okonet/lint-staged/compare/v10.2.10...v10.2.11) Signed-off-by: dependabot-preview[bot] <support@dependabot.com> Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>

view details

dependabot-preview[bot]

commit sha 5444abc8228c999eb3ea21ee93d410c2d0b4b666

Bump @types/react from 16.9.36 to 16.9.38 (#1802) Bumps [@types/react](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/react) from 16.9.36 to 16.9.38. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/react) Signed-off-by: dependabot-preview[bot] <support@dependabot.com> Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>

view details

dependabot-preview[bot]

commit sha cb13cc36cfd76b968a838e11b159a7d725bc775c

Bump @testing-library/react from 10.2.1 to 10.3.0 (#1801) Bumps [@testing-library/react](https://github.com/testing-library/react-testing-library) from 10.2.1 to 10.3.0. - [Release notes](https://github.com/testing-library/react-testing-library/releases) - [Changelog](https://github.com/testing-library/react-testing-library/blob/master/CHANGELOG.md) - [Commits](https://github.com/testing-library/react-testing-library/compare/v10.2.1...v10.3.0) Signed-off-by: dependabot-preview[bot] <support@dependabot.com> Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>

view details

dependabot-preview[bot]

commit sha 24a385ff73e0fbe3ab88f01e1c852ebf194325d2

Bump i18next-browser-languagedetector from 4.3.0 to 5.0.0 (#1803) Bumps [i18next-browser-languagedetector](https://github.com/i18next/i18next-browser-languageDetector) from 4.3.0 to 5.0.0. - [Release notes](https://github.com/i18next/i18next-browser-languageDetector/releases) - [Changelog](https://github.com/i18next/i18next-browser-languageDetector/blob/master/CHANGELOG.md) - [Commits](https://github.com/i18next/i18next-browser-languageDetector/compare/v4.3.0...v5.0.0) Signed-off-by: dependabot-preview[bot] <support@dependabot.com> Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>

view details

Lipis

commit sha e7ef02cc0f9615c0901807d095ff7753e2dbea49

New Crowdin updates and change code for Norwegian Bokmal (#1776) * New translations en.json (Turkish) * New translations en.json (French) * New translations en.json (Turkish) * New translations en.json (Turkish) * New translations en.json (Turkish) * New translations en.json (Turkish) * New translations en.json (Turkish) * New translations en.json (Turkish) * New translations en.json (Norwegian Bokmal) * Update i18n.ts * Remove no-NO * Update i18n.ts * Update i18n.ts * New translations en.json (Hindi) * New translations en.json (Hindi) * New translations en.json (Hindi) * New translations en.json (Hindi) * New translations en.json (French) * New translations en.json (Russian) * New translations en.json (Ukrainian) * New translations en.json (Persian) * New translations en.json (Albanian) * New translations en.json (Catalan) * New translations en.json (Hebrew) * New translations en.json (Hindi) * New translations en.json (Indonesian) * New translations en.json (Chinese Traditional) * New translations en.json (Chinese Simplified) * New translations en.json (Turkish) * New translations en.json (Portuguese) * New translations en.json (Spanish) * New translations en.json (Polish) * New translations en.json (Dutch) * New translations en.json (Korean) * New translations en.json (Japanese) * New translations en.json (Italian) * New translations en.json (Hungarian) * New translations en.json (Finnish) * New translations en.json (Greek) * New translations en.json (German) * New translations en.json (Bulgarian) * New translations en.json (Arabic) * New translations en.json (Norwegian Bokmal) * New translations en.json (Chinese Traditional) * New translations en.json (Norwegian Bokmal) * New translations en.json (Finnish) * New translations en.json (Persian) * New translations en.json (Portuguese) * New translations en.json (Turkish) * New translations en.json (Turkish) * New translations en.json (Turkish) * New translations en.json (German) * New translations en.json (French) * New translations en.json (Russian) * New translations en.json (Ukrainian) * New translations en.json (Persian) * New translations en.json (Albanian) * New translations en.json (Catalan) * New translations en.json (Hebrew) * New translations en.json (Hindi) * New translations en.json (Indonesian) * New translations en.json (Chinese Traditional) * New translations en.json (Chinese Simplified) * New translations en.json (Turkish) * New translations en.json (Portuguese) * New translations en.json (Spanish) * New translations en.json (Polish) * New translations en.json (Dutch) * New translations en.json (Korean) * New translations en.json (Japanese) * New translations en.json (Italian) * New translations en.json (Hungarian) * New translations en.json (Finnish) * New translations en.json (Greek) * New translations en.json (German) * New translations en.json (Bulgarian) * New translations en.json (Arabic) * New translations en.json (Norwegian Bokmal) * New translations en.json (Polish) * New translations en.json (Polish) * New translations en.json (Norwegian Bokmal) * New translations en.json (Portuguese) * New translations en.json (Persian) * New translations en.json (Finnish) * New translations en.json (Hindi) * New translations en.json (Ukrainian) * New translations en.json (German) * New translations en.json (Chinese Simplified) * New translations en.json (Chinese Simplified) * New translations en.json (Turkish) * New translations en.json (French) * New translations en.json (French) * New translations en.json (French) * New translations en.json (Russian) * New translations en.json (Ukrainian) * New translations en.json (Persian) * New translations en.json (Albanian) * New translations en.json (Catalan) * New translations en.json (Hebrew) * New translations en.json (Hindi) * New translations en.json (Indonesian) * New translations en.json (Chinese Traditional) * New translations en.json (Chinese Simplified) * New translations en.json (Turkish) * New translations en.json (Portuguese) * New translations en.json (Spanish) * New translations en.json (Polish) * New translations en.json (Dutch) * New translations en.json (Korean) * New translations en.json (Japanese) * New translations en.json (Italian) * New translations en.json (Hungarian) * New translations en.json (Finnish) * New translations en.json (Greek) * New translations en.json (German) * New translations en.json (Bulgarian) * New translations en.json (Arabic) * New translations en.json (Norwegian Bokmal) * New translations en.json (Finnish) * New translations en.json (Portuguese) * New translations en.json (Chinese Traditional)

view details

Daishi Kato

commit sha caa9b5489331d1538d9c769f1dcf92ece62f0573

do not render grid on export (#1814)

view details

dependabot-preview[bot]

commit sha 159890860acc26aa06dec3a6cac9cc5d9c85035a

Bump @testing-library/react from 10.3.0 to 10.4.1 (#1817) Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>

view details

Daishi Kato

commit sha 9c89504b6f35e66cdf627364c401e3c03423d1b2

fix: start dragging grouped elements (#1818) Co-authored-by: dwelle <luzar.david@gmail.com>

view details

David Luzar

commit sha cd87bd6901b47430a692a06a8928b0f732d77097

do not center text when not applicable (#1783)

view details

Saransh Barua

commit sha 1991511ef757a7e7af545bc17e99915b0b917b4d

Fix flickering outline on the dialogs while clicking (#1747)

view details

Lipis

commit sha 5970bb7ee95381d488b918e2995455685ae2b0b7

Remove duplicate string for toggle grid mode (#1821)

view details

Kostas Bariotis

commit sha 0a3fb70ec7a12898921dcde2ca98521b10fa9e08

Dynamicaly import locales (#1793) * dynamicly import locales * fix tests * reformat languages

view details

Minh Nguyen

commit sha a679ef78761186815c8743931c0661b76a492ed3

Refactor CJS require to ESM (#1841) Resolves https://github.com/excalidraw/excalidraw/pull/1793#discussion_r447067827

view details

Lipis

commit sha 483796f6fffe78cd5864072aeec3d4c65dc16cda

New Crowdin updates (#1813)

view details

Simon Riisnæs Dagfinrud

commit sha e23f7d37b6d9e40793da8370c0eb66a10161514a

Update Norwegian languages in list (#1843)

view details

push time in 3 months

create barnchpetehunt/excalidraw

branch : palette-with-click

created branch time in 3 months

issue openedjsxstyle/jsxstyle

Color helpers

Made a little color helper, it's pretty useful when you have a color palette

class ColorObj extends String {
  private readonly r: number;
  private readonly g: number;
  private readonly b: number;
  private readonly a: number;

  constructor(r: number, g: number, b: number, a: number = 1) {
    if (a === 1) {
      super(`rgb(${r}, ${g}, ${b})`);
    } else {
      super(`rgba(${r}, ${g}, ${b}, ${a})`);
    }

    this.r = r;
    this.g = g;
    this.b = b;
    this.a = a;
  }

  alpha(a: number): Color {
    return new ColorObj(this.r, this.g, this.b, this.a * a) as Color;
  }
}

export type Color = ColorObj & string;

export function rgba(r: number, g: number, b: number, a: number = 1): Color {
  return new ColorObj(r, g, b, a) as Color;
}

created time in 3 months

pull request commentexcalidraw/excalidraw

Library MVP

hey @bduffany -- i was planning on revisiting this PR on Sunday, but it's been hard for me to find time lately to work on this sort of thing. i'm totally down to have you finish it off if you'd like! just please let me know in the next day or two so i don't end up doing it this weekend :)

if you're going to take it over, i would consider pushing @dwelle's good suggestion of preventing duplicates in the library to another diff -- i found it to be a fairly involved change as you need to take into account some nondeterminism with floating point math and i think it's reasonable to do it later (@dwelle let me know if that's ok!)

additionally, i would suggest keeping it in appState for now and landing the localStorage piece in a separate diff -- this PR is already getting pretty big and it'd make code review easier.

again, just please let me know in the next day or two whether you want to take this over, otherwise i'll try to finish it up this weekend. thanks!

petehunt

comment created time in 3 months

issue openedjsxstyle/jsxstyle

Clean up the server rendering API

The server rendering API is a little hard to use. I think I'd prefer to have something like this:

import { cache } from "jsxstyle";
import { getStyleCache } from "jsxstyle-utils";

async function withJsxstyleCache<T>(
  cb: () => Promise<T>
): Promise<[T, string]> {
  const styles: string[] = [];
  Object.assign(cache, getStyleCache());

  cache.injectOptions({
    onInsertRule(css) {
      styles.push(css);
    },
  });

  const rv = await cb();
  const styleText = styles.join("");
  return [rv, styleText];
}

created time in 3 months

issue openedjsxstyle/jsxstyle

Add a `Styled` component

Styling inputs with jsxstyle sort of sucks. I made a component that makes it easier:

<Styled
      width="100%"
      background={Colors.COLOR_4}
      color={Colors.COLOR_1}
      padding="10px 20px"
    >
      <input type="text" placeholder="say something..." />
</Styled>

Seems like a thing that we could include in jsxstyle.

Implementation (does not support style extraction):

import { JsxstyleProps, cache } from "jsxstyle";
import { ReactElement } from "react";
import React from "react";

type IntrinsicElement = keyof JSX.IntrinsicElements;
type ValidComponentPropValue =
  | undefined
  | false
  | null
  | IntrinsicElement
  | React.StatelessComponent<any>
  | React.ComponentClass<any>;

export function Styled<C extends ValidComponentPropValue>({
  children,
  ...style
}: Omit<JsxstyleProps<C>, "component"> & { children: ReactElement }) {
  return (
    <>
      {React.Children.map(children, (child) =>
        React.cloneElement(child, {
          className: cache.getClassName(style, child.props.className),
        })
      )}
    </>
  );
}

created time in 3 months

more