js-draw 0.9.3 → 0.10.1

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 (48) hide show
  1. package/.github/ISSUE_TEMPLATE/translation.yml +9 -1
  2. package/CHANGELOG.md +14 -0
  3. package/build_tools/buildTranslationTemplate.ts +6 -4
  4. package/dist/build_tools/buildTranslationTemplate.js +5 -4
  5. package/dist/bundle.js +1 -1
  6. package/dist/src/Color4.d.ts +1 -0
  7. package/dist/src/Color4.js +34 -15
  8. package/dist/src/Editor.js +2 -3
  9. package/dist/src/SVGLoader.js +25 -11
  10. package/dist/src/components/builders/FreehandLineBuilder.js +3 -2
  11. package/dist/src/components/builders/PressureSensitiveFreehandLineBuilder.js +2 -2
  12. package/dist/src/components/util/StrokeSmoother.js +3 -3
  13. package/dist/src/rendering/renderers/SVGRenderer.d.ts +1 -0
  14. package/dist/src/rendering/renderers/SVGRenderer.js +23 -6
  15. package/dist/src/toolbar/HTMLToolbar.d.ts +6 -1
  16. package/dist/src/toolbar/HTMLToolbar.js +24 -27
  17. package/dist/src/toolbar/IconProvider.d.ts +1 -1
  18. package/dist/src/toolbar/IconProvider.js +11 -3
  19. package/dist/src/toolbar/widgets/ActionButtonWidget.d.ts +3 -3
  20. package/dist/src/toolbar/widgets/BaseWidget.d.ts +1 -1
  21. package/dist/src/toolbar/widgets/BaseWidget.js +9 -4
  22. package/dist/src/toolbar/widgets/PenToolWidget.js +2 -1
  23. package/dist/src/tools/PanZoom.d.ts +5 -1
  24. package/dist/src/tools/PanZoom.js +118 -10
  25. package/dist/src/tools/SelectionTool/SelectionHandle.js +1 -1
  26. package/dist/src/{language → util}/assertions.d.ts +0 -0
  27. package/dist/src/{language → util}/assertions.js +1 -0
  28. package/dist/src/util/untilNextAnimationFrame.d.ts +3 -0
  29. package/dist/src/util/untilNextAnimationFrame.js +7 -0
  30. package/package.json +1 -1
  31. package/src/Color4.test.ts +7 -0
  32. package/src/Color4.ts +47 -18
  33. package/src/Editor.toSVG.test.ts +84 -0
  34. package/src/Editor.ts +2 -3
  35. package/src/SVGLoader.ts +26 -10
  36. package/src/components/builders/FreehandLineBuilder.ts +3 -2
  37. package/src/components/builders/PressureSensitiveFreehandLineBuilder.ts +2 -2
  38. package/src/components/util/StrokeSmoother.ts +3 -3
  39. package/src/rendering/renderers/SVGRenderer.ts +23 -5
  40. package/src/toolbar/HTMLToolbar.ts +33 -30
  41. package/src/toolbar/IconProvider.ts +15 -3
  42. package/src/toolbar/widgets/ActionButtonWidget.ts +2 -2
  43. package/src/toolbar/widgets/BaseWidget.ts +9 -4
  44. package/src/toolbar/widgets/PenToolWidget.ts +3 -1
  45. package/src/tools/PanZoom.ts +137 -7
  46. package/src/tools/SelectionTool/SelectionHandle.ts +1 -1
  47. package/src/{language → util}/assertions.ts +1 -0
  48. package/src/util/untilNextAnimationFrame.ts +9 -0
@@ -13,7 +13,7 @@ body:
13
13
  - type: markdown
14
14
  attributes:
15
15
  value: |
16
- (Optional)Ifyouwouldliketosubmitapullrequestthatappliesthistranslation,notethatexistingtranslationsarepresentin[src/localizations/](https://github.com/personalizedrefrigerator/js-draw/tree/main/src/localizations).
16
+ (Optional) If you would like to submit a pull request that applies this translation, note that existing translations are present in [src/localizations/](https://github.com/personalizedrefrigerator/js-draw/tree/main/src/localizations).
17
17
  - type: input
18
18
  id: language-name
19
19
  attributes:
@@ -93,6 +93,14 @@ body:
93
93
  placeholder: "Font: "
94
94
  validations:
95
95
  required: false
96
+ - type: input
97
+ id: translation-textSize
98
+ attributes:
99
+ label: "textSize"
100
+ description: "Translate `Size: `."
101
+ placeholder: "Size: "
102
+ validations:
103
+ required: false
96
104
  - type: input
97
105
  id: translation-resizeImageToSelection
98
106
  attributes:
package/CHANGELOG.md CHANGED
@@ -1,3 +1,17 @@
1
+ # 0.10.1
2
+ * Different icons for rounded pens.
3
+ * Bug fixes
4
+ * Different pen types, for the same size, previously had different actual widths.
5
+ * Inertial touchscreen scrolling previously sometimes started even if the initiating gesture was, just before stopping, stationary for several seconds.
6
+
7
+ # 0.10.0
8
+ * Inertial touchscreen scrolling.
9
+ * Bug fixes
10
+ * Fixed keyboard shortcuts broken when undo/redo buttons are selected.
11
+ * Fixed text objects saving with duplicate properties.
12
+ * Fixed blank lines disappearing from text objects when attempting to edit a loaded-from-file text object.
13
+ * Breaking changes
14
+ * `HTMLToolbar::addActionButton` no longer takes a `parent` argument and returns a `BaseWidget`.
1
15
 
2
16
  # 0.9.3
3
17
  * Decrease amount text shifts by when editing.
@@ -35,6 +35,8 @@ const codeFormat = (text: string) => {
35
35
  return `${codeStartEnd}${text}${codeStartEnd}`;
36
36
  };
37
37
 
38
+ const collapseSpaces = (text: string) => text.replace(/\s+/g, ' ');
39
+
38
40
  const generateTranslationTemplate = () => {
39
41
  const bodyContentLines: string[] = [];
40
42
 
@@ -66,17 +68,17 @@ const generateTranslationTemplate = () => {
66
68
  bodyContentLines.push(' ' + text);
67
69
  };
68
70
 
69
- addLabel(`
71
+ addLabel(collapseSpaces(`
70
72
  Thank you for taking the time to translate \`js-draw\`! If you don't have time to translate
71
73
  all of the strings below, feel free to submit an incomplete translation and edit it later.
72
74
  Use this template to update an existing translation or to create a new translation.
73
- `.replace(/\s+/g, ' '));
75
+ `));
74
76
 
75
- addLabel(`
77
+ addLabel(collapseSpaces(`
76
78
  (Optional) If you would like to submit a pull request that applies this translation,
77
79
  note that existing translations are present in
78
80
  [src/localizations/](https://github.com/personalizedrefrigerator/js-draw/tree/main/src/localizations).
79
- `.replace(/\s+/g, ''));
81
+ `));
80
82
 
81
83
  addInput('input', 'language-name', {
82
84
  label: 'Language',
@@ -26,6 +26,7 @@ const codeFormat = (text) => {
26
26
  }
27
27
  return `${codeStartEnd}${text}${codeStartEnd}`;
28
28
  };
29
+ const collapseSpaces = (text) => text.replace(/\s+/g, ' ');
29
30
  const generateTranslationTemplate = () => {
30
31
  const bodyContentLines = [];
31
32
  const addInput = (type, id, attrs, required = false) => {
@@ -48,16 +49,16 @@ const generateTranslationTemplate = () => {
48
49
  bodyContentLines.push(' value: |');
49
50
  bodyContentLines.push(' ' + text);
50
51
  };
51
- addLabel(`
52
+ addLabel(collapseSpaces(`
52
53
  Thank you for taking the time to translate \`js-draw\`! If you don't have time to translate
53
54
  all of the strings below, feel free to submit an incomplete translation and edit it later.
54
55
  Use this template to update an existing translation or to create a new translation.
55
- `.replace(/\s+/g, ' '));
56
- addLabel(`
56
+ `));
57
+ addLabel(collapseSpaces(`
57
58
  (Optional) If you would like to submit a pull request that applies this translation,
58
59
  note that existing translations are present in
59
60
  [src/localizations/](https://github.com/personalizedrefrigerator/js-draw/tree/main/src/localizations).
60
- `.replace(/\s+/g, ''));
61
+ `));
61
62
  addInput('input', 'language-name', {
62
63
  label: 'Language',
63
64
  description: 'The name of the language to translate to in English (e.g. Spanish)',