js-draw 0.4.0 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (66) hide show
  1. package/.github/pull_request_template.md +15 -0
  2. package/.github/workflows/firebase-hosting-merge.yml +7 -0
  3. package/.github/workflows/firebase-hosting-pull-request.yml +10 -0
  4. package/.github/workflows/github-pages.yml +2 -0
  5. package/CHANGELOG.md +15 -0
  6. package/dist/bundle.js +1 -1
  7. package/dist/src/Editor.d.ts +1 -1
  8. package/dist/src/Editor.js +8 -3
  9. package/dist/src/components/AbstractComponent.js +1 -0
  10. package/dist/src/components/Stroke.js +15 -9
  11. package/dist/src/components/Text.d.ts +1 -1
  12. package/dist/src/components/Text.js +1 -1
  13. package/dist/src/components/builders/FreehandLineBuilder.d.ts +1 -0
  14. package/dist/src/components/builders/FreehandLineBuilder.js +33 -35
  15. package/dist/src/math/Vec3.d.ts +1 -1
  16. package/dist/src/math/Vec3.js +1 -1
  17. package/dist/src/rendering/renderers/SVGRenderer.js +1 -1
  18. package/dist/src/testing/beforeEachFile.d.ts +1 -0
  19. package/dist/src/testing/beforeEachFile.js +3 -0
  20. package/dist/src/testing/createEditor.d.ts +1 -0
  21. package/dist/src/testing/createEditor.js +7 -1
  22. package/dist/src/testing/loadExpectExtensions.d.ts +0 -15
  23. package/dist/src/toolbar/widgets/BaseWidget.d.ts +2 -0
  24. package/dist/src/toolbar/widgets/BaseWidget.js +15 -0
  25. package/dist/src/toolbar/widgets/PenToolWidget.d.ts +2 -0
  26. package/dist/src/toolbar/widgets/PenToolWidget.js +14 -0
  27. package/dist/src/tools/SelectionTool/SelectionTool.js +8 -0
  28. package/dist/src/tools/ToolController.js +2 -0
  29. package/dist/src/tools/ToolbarShortcutHandler.d.ts +12 -0
  30. package/dist/src/tools/ToolbarShortcutHandler.js +23 -0
  31. package/dist/src/tools/lib.d.ts +1 -0
  32. package/dist/src/tools/lib.js +1 -0
  33. package/dist/src/types.d.ts +4 -2
  34. package/jest.config.js +5 -0
  35. package/package.json +15 -14
  36. package/src/Editor.ts +8 -2
  37. package/src/components/AbstractComponent.ts +2 -0
  38. package/src/components/Stroke.test.ts +0 -3
  39. package/src/components/Stroke.ts +14 -7
  40. package/src/components/Text.test.ts +0 -3
  41. package/src/components/Text.ts +2 -2
  42. package/src/components/builders/FreehandLineBuilder.ts +36 -42
  43. package/src/language/assertions.ts +2 -2
  44. package/src/math/LineSegment2.test.ts +8 -10
  45. package/src/math/Mat33.test.ts +0 -2
  46. package/src/math/Rect2.test.ts +0 -3
  47. package/src/math/Vec2.test.ts +0 -3
  48. package/src/math/Vec3.test.ts +0 -3
  49. package/src/math/Vec3.ts +1 -1
  50. package/src/rendering/renderers/SVGRenderer.ts +1 -1
  51. package/src/testing/beforeEachFile.ts +3 -0
  52. package/src/testing/createEditor.ts +8 -1
  53. package/src/testing/global.d.ts +17 -0
  54. package/src/testing/loadExpectExtensions.ts +0 -15
  55. package/src/toolbar/toolbar.css +3 -2
  56. package/src/toolbar/widgets/BaseWidget.ts +19 -1
  57. package/src/toolbar/widgets/PenToolWidget.ts +18 -1
  58. package/src/tools/Pen.test.ts +150 -0
  59. package/src/tools/SelectionTool/SelectionTool.css +1 -1
  60. package/src/tools/SelectionTool/SelectionTool.ts +9 -0
  61. package/src/tools/ToolController.ts +2 -0
  62. package/src/tools/ToolbarShortcutHandler.ts +34 -0
  63. package/src/tools/UndoRedoShortcut.test.ts +3 -0
  64. package/src/tools/lib.ts +1 -0
  65. package/src/types.ts +13 -8
  66. package/tsconfig.json +3 -1
@@ -0,0 +1,15 @@
1
+ # Summary
2
+ <!-- A description of the changes made by this PR. -->
3
+
4
+ # Testing <!-- (if applicable) -->
5
+ <!--
6
+ Describe what changes have automated tests and what changes don't. If changes lack automated tests, please describe how it can be verified that changes made by this pull request work as expected.
7
+ -->
8
+
9
+ # Screenshots/other information
10
+ <!--
11
+ If applicable, please include screenshots/screen recordings/other information that may help contributors review this pull request.
12
+ -->
13
+
14
+
15
+ Resolves #[issue number here].
@@ -6,6 +6,11 @@ name: Deploy to Firebase Hosting on merge
6
6
  push:
7
7
  branches:
8
8
  - 'main'
9
+
10
+ # See https://github.com/FirebaseExtended/action-hosting-deploy/issues/198
11
+ permissions:
12
+ contents: read
13
+
9
14
  jobs:
10
15
  build_and_deploy:
11
16
  runs-on: ubuntu-latest
@@ -15,6 +20,8 @@ jobs:
15
20
  run: yarn install
16
21
  - name: Run tests
17
22
  run: yarn test
23
+ - name: Lint
24
+ run: yarn lint-ci
18
25
  - name: Build
19
26
  run: cd docs/example && yarn install && yarn build
20
27
  - uses: FirebaseExtended/action-hosting-deploy@v0
@@ -3,6 +3,14 @@
3
3
 
4
4
  name: Deploy to Firebase Hosting on PR
5
5
  'on': pull_request
6
+
7
+ # See https://github.com/FirebaseExtended/action-hosting-deploy/issues/198
8
+ # and https://github.com/FirebaseExtended/action-hosting-deploy/issues/108#issuecomment-1036024111
9
+ permissions:
10
+ contents: read
11
+ pull-requests: write
12
+ checks: write
13
+
6
14
  jobs:
7
15
  build_and_preview:
8
16
  if: '${{ github.event.pull_request.head.repo.full_name == github.repository }}'
@@ -13,6 +21,8 @@ jobs:
13
21
  run: yarn install
14
22
  - name: Run tests
15
23
  run: yarn test
24
+ - name: Lint
25
+ run: yarn lint-ci
16
26
  - name: Build
17
27
  run: cd docs/example && yarn install && yarn build
18
28
  - uses: FirebaseExtended/action-hosting-deploy@v0
@@ -36,6 +36,8 @@ jobs:
36
36
  run: yarn install
37
37
  - name: Run tests
38
38
  run: yarn test
39
+ - name: Lint
40
+ run: yarn lint-ci
39
41
  - name: Build documentation
40
42
  run: yarn doc
41
43
  - name: Build
package/CHANGELOG.md CHANGED
@@ -1,3 +1,18 @@
1
+ # 0.5.0
2
+ * Increase contrast between selection box/background
3
+ * Keyboard shortcuts
4
+ * `Ctrl+1` through `Ctrl+9`: Switch pen drawing mode.
5
+ * For this to work, the `ToolbarShortcutHandler` must be loaded (and the toolbar must also be loaded).
6
+ * Bug fixes
7
+ * Fix text shifting away from strokes on paste.
8
+
9
+ # 0.4.1
10
+ * Bug fixes
11
+ * Fix in-progress strokes occasionally flickering and disappearing.
12
+ * This was caused by a division-by-zero error.
13
+ * Increase contrast between disabled and enabled buttons.
14
+ * Copy selected text objects as text.
15
+
1
16
  # 0.4.0
2
17
  * Moved the selection tool rotate handle to the top, added resize horizontally and resize vertically handles.
3
18
  * Selection-tool-related bug fixes