Skip to content
This repository was archived by the owner on Oct 28, 2024. It is now read-only.

Commit 65b3099

Browse files
committed
Merge branch 'ng6'
* ng6: Add rxjs6 as peer dependency for 3.0.0. Bump to 3.0.1 Add Angular6 and rxjs^6 support. Change the way of building the library
2 parents c5a7718 + f398559 commit 65b3099

File tree

108 files changed

+16076
-2322
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

108 files changed

+16076
-2322
lines changed

README.md

Lines changed: 4 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,11 @@
22

33

44
## Canvas version changes
5-
v2.0.0 and Premade Shapes are here. Since this is a breaking changes version,
6-
here are the things that have changed:
7-
* Added shapes and shapes service for registering new shapes (see below)
8-
* Added a shapesMap to keep check of which shapes are drawn (maybe for drag and move in the future)
9-
* Added the `export interface CanvasWhiteboardOptions` to a different file so please reimport it
10-
* Made the undo function to only undo your drawings and not someone else
11-
* After a drawing, remove the redo items from the stack
12-
* Changed the `CanvasWhiteboardUpdate` deserialize and serialize methods and variables, so please check them out. (Example: the deserializeJson uses JSON.parse on the data received)
13-
* Added debounce timer for window resize to improve performance and redrawing
14-
* Added `fillColor` and fill color colorpicker
15-
* Added the text: "Transparent" in colorpickers for people to be able to select transparent color
16-
* The undo and redo outputs now output the UUID of the shape to undo/redo
17-
18-
Add a canvas component which the user can draw on.
19-
<br/>The coordinates are drawn as a percentage of the containers width and height.
20-
<br/>To reuse them anywhere, they need to be remapped (multiply the received x and y coordinates with their width and height accordingly)
5+
#### v3.0.0 Removes the `rxjs-compat` library and adds `rxjs^6`. This means that older versions will not be supported if they upgrade to `ng2-canvas-whiteboard^3.0.0`.
6+
#### *This version also changes the way of how this library is built and made ready for publish.*
217

8+
#### For applications before Angular 6 please use versions below v3.0.0.
9+
#
2210
**Features:**<br/>
2311
- Premade Shapes
2412
- The ability to create custom premade shapes
@@ -31,8 +19,6 @@ Add a canvas component which the user can draw on.
3119

3220
# Install
3321

34-
*NOTE: If you are using `rxjs^6`, please use `npm install --save rxjs-compat` to allow backwards compatibility for this module*
35-
3622
1. Install npm module:
3723

3824
```bash

build.js

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
"use strict";
2+
3+
require('shelljs/global');
4+
const chalk = require('chalk');
5+
6+
const PACKAGE = `ng2-canvas-whiteboard`;
7+
const NPM_DIR = `dist`;
8+
const MODULES_DIR = `${NPM_DIR}/modules`;
9+
const BUNDLES_DIR = `${NPM_DIR}/bundles`;
10+
11+
echo('Start building...');
12+
13+
rm(`-Rf`, `${NPM_DIR}/*`);
14+
mkdir(`-p`, `./${MODULES_DIR}`);
15+
mkdir(`-p`, `./${BUNDLES_DIR}`);
16+
17+
/* Aot compilation: ES2015 sources */
18+
echo(`Start AoT compilation`);
19+
exec(`ngc -p tsconfig-build.json`);
20+
echo(chalk.green(`AoT compilation completed`));
21+
22+
/* Creates bundles: ESM/ES5 and UMD bundles */
23+
echo(`Start bundling`);
24+
echo(`Rollup package`);
25+
exec(`rollup -i ${NPM_DIR}/${PACKAGE}.js -o ${MODULES_DIR}/${PACKAGE}.js --sourcemap`, {silent: true});
26+
exec(`node scripts/map-sources -f ${MODULES_DIR}/${PACKAGE}.js`);
27+
28+
echo(`Downleveling ES2015 to ESM/ES5`);
29+
cp(`${MODULES_DIR}/${PACKAGE}.js`, `${MODULES_DIR}/${PACKAGE}.es5.ts`);
30+
exec(`tsc ${MODULES_DIR}/${PACKAGE}.es5.ts --target es5 --module es2015 --noLib --sourceMap`, {silent: true});
31+
exec(`node scripts/map-sources -f ${MODULES_DIR}/${PACKAGE}.es5.js`);
32+
rm(`-f`, `${MODULES_DIR}/${PACKAGE}.es5.ts`);
33+
34+
echo(`Run Rollup conversion on package`);
35+
exec(`rollup -c rollup.config.js --sourcemap`, {silent: true});
36+
exec(`node scripts/map-sources -f ${BUNDLES_DIR}/${PACKAGE}.umd.js`);
37+
38+
echo(`Minifying`);
39+
cd(`${BUNDLES_DIR}`);
40+
exec(`uglifyjs -c --screw-ie8 --comments -o ${PACKAGE}.umd.min.js --source-map ${PACKAGE}.umd.min.js.map --source-map-include-sources ${PACKAGE}.umd.js`, {silent: true});
41+
exec(`node ../../scripts/map-sources -f ${PACKAGE}.umd.min.js`);
42+
cd(`..`);
43+
cd(`..`);
44+
45+
echo(chalk.green(`Bundling completed`));
46+
47+
rm(`-Rf`, `${NPM_DIR}/*.js`);
48+
rm(`-Rf`, `${NPM_DIR}/*.js.map`);
49+
rm(`-Rf`, `${NPM_DIR}/src/**/*.js`);
50+
rm(`-Rf`, `${NPM_DIR}/src/**/*.js.map`);
51+
52+
cp(`-Rf`, [`package.json`, `LICENSE`, `README.md`], `${NPM_DIR}`);
53+
54+
echo(chalk.green(`End building`));

dist/LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2017 Web Factory LLC
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

0 commit comments

Comments
 (0)