js-draw 0.7.0 → 0.7.2
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.
- package/CHANGELOG.md +9 -0
- package/CONTRIBUTING.md +75 -0
- package/dist/bundle.js +1 -1
- package/dist/src/SVGLoader.js +1 -0
- package/dist/src/rendering/renderers/SVGRenderer.js +19 -7
- package/dist/src/tools/TextTool.js +7 -2
- package/package.json +1 -1
- package/src/SVGLoader.ts +1 -0
- package/src/rendering/renderers/SVGRenderer.ts +23 -7
- package/src/tools/TextTool.ts +9 -2
package/CHANGELOG.md
CHANGED
@@ -1,3 +1,12 @@
|
|
1
|
+
|
2
|
+
# 0.7.2
|
3
|
+
* Bug fixes
|
4
|
+
* Fix multi-line text displaying in wrong position in exported SVGs.
|
5
|
+
* Fix editing a different text node sometimes changing the color/font of the previous text node.
|
6
|
+
|
7
|
+
# 0.7.1
|
8
|
+
* Fix scrollbars in text tool appearing when they should not (mostly in Chrome).
|
9
|
+
|
1
10
|
# 0.7.0
|
2
11
|
* Text tool
|
3
12
|
* Edit existing text.
|
package/CONTRIBUTING.md
ADDED
@@ -0,0 +1,75 @@
|
|
1
|
+
# Building and testing
|
2
|
+
`js-draw` uses `yarn` as its build system and to manage dependencies. Thus, to install dependencies and build the project for the first time,
|
3
|
+
```bash
|
4
|
+
# After cloning the project,
|
5
|
+
bash$ cd path/to/js-draw
|
6
|
+
|
7
|
+
# Install dependencies
|
8
|
+
bash$ yarn install
|
9
|
+
|
10
|
+
# Run tests
|
11
|
+
bash$ yarn test
|
12
|
+
|
13
|
+
# Run tests/re-run tests when files change
|
14
|
+
bash$ yarn test --watch
|
15
|
+
|
16
|
+
# Build documentation
|
17
|
+
bash$ yarn doc
|
18
|
+
```
|
19
|
+
|
20
|
+
## Running/building the example projects
|
21
|
+
First, switch to the `docs` directory:
|
22
|
+
```console
|
23
|
+
bash$ cd path/to/js-draw/
|
24
|
+
bash$ cd docs/
|
25
|
+
```
|
26
|
+
|
27
|
+
Next, `cd` to one of the example projects.
|
28
|
+
|
29
|
+
### Main example project
|
30
|
+
```bash
|
31
|
+
bash$ cd example/
|
32
|
+
|
33
|
+
# Install dependencies for the example project
|
34
|
+
bash$ yarn install
|
35
|
+
|
36
|
+
# Re-build when files change
|
37
|
+
bash$ yarn watch
|
38
|
+
```
|
39
|
+
|
40
|
+
In a separate terminal, run a local web-server. Use the web-server to open the `example.html` file.
|
41
|
+
```bash
|
42
|
+
bash$ python3 -m http.server
|
43
|
+
```
|
44
|
+
|
45
|
+
### Collaborative editing project
|
46
|
+
```bash
|
47
|
+
bash$ cd example-collaborative/
|
48
|
+
|
49
|
+
# Re-build when files change
|
50
|
+
bash$ yarn watch
|
51
|
+
```
|
52
|
+
|
53
|
+
and in a separate terminal,
|
54
|
+
```bash
|
55
|
+
# Start the example project's server
|
56
|
+
bash$ python3 server.py
|
57
|
+
```
|
58
|
+
|
59
|
+
# Notable files and directories
|
60
|
+
> If this list is outdated, please open an issue.
|
61
|
+
|
62
|
+
- [`src/localizations`](https://github.com/personalizedrefrigerator/js-draw/tree/main/src/localizations) and [`getLocalizationTable.ts`](https://github.com/personalizedrefrigerator/js-draw/blob/main/src/localizations/getLocalizationTable.ts).
|
63
|
+
- [Stroke smoothing and geometric shape builders: `src/components/builders`](https://github.com/personalizedrefrigerator/js-draw/tree/main/src/components/builders)
|
64
|
+
- [Main app entrypoint: `src/Editor.ts`](https://github.com/personalizedrefrigerator/js-draw/blob/main/src/Editor.ts)
|
65
|
+
- [Default tools and sending events to them: `src/tools/ToolController.ts`](https://github.com/personalizedrefrigerator/js-draw/blob/main/src/tools/ToolController.ts)
|
66
|
+
|
67
|
+
# Code style
|
68
|
+
|
69
|
+
The coding style is, for the most part, enforced by a pre-commit hook.
|
70
|
+
|
71
|
+
Because `js-draw` was originally created as a part of a pull request for the Joplin note-taking app,
|
72
|
+
[it mostly follows Joplin's style guide](https://github.com/laurent22/joplin/blob/dev/readme/coding_style.md),
|
73
|
+
with the exception that TypeDoc-style comments (`/** */`) are permitted for documentation.
|
74
|
+
|
75
|
+
Note that `//`-style comments can also be used for documentation.
|