Skip to content

Commit 8a225ce

Browse files
authored
0.3.0.
0.3.0.
2 parents b86f1e4 + fd37baa commit 8a225ce

File tree

91 files changed

+6616
-182
lines changed

Some content is hidden

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

91 files changed

+6616
-182
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 0.3.0
2+
3+
This version changed the license to MIT.
4+
15
## 0.2.0
26

37
This version improves support for UMD bundles.

LICENSE

Lines changed: 5 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -1,67 +1,9 @@
1-
# Commercial license
1+
The MIT License (MIT)
22

3-
Commercial license for Mini Canvas Editor
3+
Copyright (c) 2024 N4NO.com
44

5-
Copyright (C) 2023 N4NO.com
5+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
66

7-
This Software License AGREEMENT is between N4NO.com and YOU (including your agents and affiliates).
7+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
88

9-
1. DEFINITIONS
10-
11-
1.1. SOFTWARE means Mini Canvas Editor by N4NO.com
12-
13-
1.2. MODIFICATION means any change, revision, adaptation, or derivative of SOFTWARE produced by YOU.
14-
15-
1.3. LICENSED DEVELOPER shall mean an individual person permitted to use SOFTWARE and make MODIFICATIONS for APPLICATIONS, whether such person is YOUR employee or a consultant or contractor providing services to YOU.
16-
17-
1.4. END USER means end user of APPLICATION, who acquires a license to such solely for their own use and not for distribution, resale, user interface design, or software development purposes.
18-
19-
1.5. APPLICATION means application, or elements that LICENSED DEVELOPER develop using SOFTWARE or MODIFICATION in accordance with AGREEMENT.
20-
21-
2. LICENSES
22-
23-
2.1. HOBBY LICENSE
24-
25-
2.1.1. HOBBY LICENSE grants you a right to use SOFTWARE to create one (1) APPLICATION.
26-
27-
2.1.2. HOBBY LICENSE grants permission for one (1) LICENSED DEVELOPER to access and use SOFTWARE.
28-
29-
2.2. TEAM LICENSE
30-
31-
2.2.1. TEAM LICENSE grants you a right to use SOFTWARE to create two (2) APPLICATIONS.
32-
33-
2.2.2. TEAM LICENSE grants permission for four (4) LICENSED DEVELOPERS to access and use SOFTWARE.
34-
35-
2.3. ENTERPRISE LICENSE
36-
37-
2.3.1. ENTERPRISE LICENSE grants you a right to use SOFTWARE to create unlimited APPLICATIONS.
38-
39-
2.3.2. ENTERPRISE LICENSE grants permission for unlimited LICENSED DEVELOPERS to access and use SOFTWARE.
40-
41-
3. GRANT OF LICENSE
42-
43-
3.1. This is a license agreement and not an agreement for sale.
44-
45-
3.2. N4NO.com grants to YOU a revocable, non-exclusive, non-transferable license: (i) for use of SOFTWARE by the number of LICENSED DEVELOPERS and for the number of MODIFICATIONS and APPLICATIONS as dictated by your purchased license; (ii) for YOU to distribute SOFTWARE and/or MODIFICATIONS to an unlimited number of END USERS solely as integrated into APPLICATIONS; and (iii) for END USERS to use SOFTWARE as incorporated into your APPLICATIONS in accordance with the terms of AGREEMENT.
46-
47-
4. RECEIVE UPDATES
48-
49-
4.1. YOU will be eligible to receive all major and minor updates for SOFTWARE with no limitation period.
50-
51-
5. RENTAL
52-
53-
5.1. You may not rent, lease, or lend SOFTWARE.
54-
55-
6. TRANSFER
56-
57-
6.1. You may not permanently or temporarily transfer any of your rights under AGREEMENT to any individual or business or government entity without prior written approval from N4NO.com.
58-
59-
7. WARRANTY
60-
61-
7.1. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
62-
63-
8. TERMINATION AND REFUNDS
64-
65-
8.1. Without prejudice to any other rights or remedies, N4NO.com will terminate AGREEMENT upon your failure to comply with all the terms and conditions of AGREEMENT. In such events, YOU must destroy all copies of SOFTWARE and all of its component parts including any related documentation and must remove any and all use of N4NO.com intellectual property from any applications distributed by YOU, whether in native, altered or compiled states.
66-
67-
8.2. YOU has an unconditional right to terminate before the first fourteen (14) days of purchase of SOFTWARE and shall be entitled to a full refund.
9+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

README.md

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
# Mini Canvas Editor
44

5-
[![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fimg-js%2Fmini-canvas-editor%2Fbadge%3Fref%3Dmain&style=flat-square)](https://actions-badge.atrox.dev/img-js/mini-canvas-editor/goto?ref=main) [![View this project on NPM](https://img.shields.io/npm/v/mini-canvas-editor.svg?style=flat-square)](https://npmjs.org/package/mini-canvas-editor)
5+
[![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fimg-js%2Fmini-canvas-editor%2Fbadge%3Fref%3Dmain&style=flat-square)](https://actions-badge.atrox.dev/img-js/mini-canvas-editor/goto?ref=main) [![License: MIT](https://img.shields.io/badge/license-MIT-green?style=flat-square)](/LICENSE) [![View this project on NPM](https://img.shields.io/npm/v/mini-canvas-editor.svg?style=flat-square)](https://npmjs.org/package/mini-canvas-editor)
66

77
Canvas editor component for JavaScript application. Works with any front-end framework. Easy to integrate and use. Well-known graphical interface. Edit images, draw shapes, add texts and more. Gzipped size less than 100 KB. Uses Fabric.js internally.
88

@@ -55,9 +55,9 @@ Add the below code to your head section in HTML document.
5555
```html
5656
<head>
5757
...
58-
<link href="https://cdn.jsdelivr.net/npm/mini-canvas-editor@0.2.0/css/editor.css" rel="stylesheet">
59-
<script src="https://cdn.jsdelivr.net/npm/mini-canvas-core@0.2.0/dist/index.umd.js"></script>
60-
<script src="https://cdn.jsdelivr.net/npm/mini-canvas-editor@0.2.0/dist/index.umd.js"></script>
58+
<link href="https://cdn.jsdelivr.net/npm/mini-canvas-editor@0.3.0/css/editor.css" rel="stylesheet">
59+
<script src="https://cdn.jsdelivr.net/npm/mini-canvas-core@0.3.0/dist/index.umd.js"></script>
60+
<script src="https://cdn.jsdelivr.net/npm/mini-canvas-editor@0.3.0/dist/index.umd.js"></script>
6161
```
6262

6363
Create the editor by:
@@ -68,14 +68,4 @@ miniCanvasEditor.Editor.createBlank(placeholder, 200, 300, {});
6868

6969
## 💡 License
7070

71-
Pick one license that fits your needs.
72-
73-
| License | Details | |
74-
| ---------------- | - | - |
75-
| 🍪 Hobby | **1** application<br />**1** developer<br />1 year updates | [📦 Buy license](https://buy.stripe.com/14k8yq3p048L7fO4gj) |
76-
| 🍰 Standard | **2** applications<br />**up to 4** developers<br />1 year updates | |
77-
| 🎂 Enterprise | **unlimited** applications<br />**unlimited** developers<br />1 year updates | |
78-
79-
The license is perpetual. By buying the license you get an access to the source code of the editor.
80-
81-
See the [LICENSE](/LICENSE) file for more details.
71+
This project is released under the MIT license.

core/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
lib/

core/LICENSE

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

core/README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Mini Canvas
2+
3+
This package contains the core features for [Mini Canvas Editor](https://github.com/img-js/mini-canvas-editor).
4+
5+
## 💡 License
6+
7+
See the [LICENSE](/LICENSE) file for more details.

core/package.json

Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
{
2+
"name": "mini-canvas-core",
3+
"description": "Core library for Mini Canvas Editor.",
4+
"version": "0.3.0",
5+
"license": "SEE LICENSE IN LICENSE",
6+
"type": "module",
7+
"main": "./lib/cjs/index.browser.cjs",
8+
"types": "./lib/index.browser.d.ts",
9+
"exports": {
10+
".": {
11+
"types": {
12+
"require": "./lib/index.browser.d.ts",
13+
"default": "./lib/index.browser.d.ts"
14+
},
15+
"default": {
16+
"require": "./lib/cjs/index.browser.cjs",
17+
"default": "./lib/esm/index.browser.js"
18+
}
19+
},
20+
"./node": {
21+
"types": {
22+
"require": "./lib/index.node.d.ts",
23+
"default": "./lib/index.node.d.ts"
24+
},
25+
"default": {
26+
"require": "./lib/cjs/index.node.cjs",
27+
"default": "./lib/esm/index.node.js"
28+
}
29+
}
30+
},
31+
"typesVersions": {
32+
"*": {
33+
".": [
34+
"./lib/index.browser.d.ts"
35+
],
36+
"node": [
37+
"./lib/index.node.d.ts"
38+
]
39+
}
40+
},
41+
"sideEffects": false,
42+
"files": [
43+
"lib/",
44+
"dist/"
45+
],
46+
"publishConfig": {
47+
"registry": "https://registry.npmjs.org/"
48+
},
49+
"repository": {
50+
"type": "git",
51+
"url": "https://github.com/b4rtaz/mini-canvas-editor.git"
52+
},
53+
"author": {
54+
"name": "N4NO",
55+
"url": "https://n4no.com/"
56+
},
57+
"homepage": "https://n4no.com/",
58+
"scripts": {
59+
"prepare": "cp ../LICENSE LICENSE",
60+
"clean": "rm -rf lib && rm -rf node_modules/.cache/rollup-plugin-typescript2",
61+
"build": "pnpm clean && rollup -c",
62+
"start": "pnpm clean && rollup -c --watch",
63+
"eslint": "eslint ./src --ext .ts",
64+
"prettier": "prettier --check ./src",
65+
"prettier:fix": "prettier --write ./src"
66+
},
67+
"dependencies": {
68+
"fabric": "6.0.0-beta14"
69+
},
70+
"devDependencies": {
71+
"tslib": "^2.6.2",
72+
"typescript": "^5.2.2",
73+
"rollup": "^4.1.4",
74+
"rollup-plugin-dts": "^6.1.0",
75+
"rollup-plugin-typescript2": "^0.36.0",
76+
"@rollup/plugin-node-resolve": "^15.2.2",
77+
"@rollup/plugin-terser": "^0.4.4",
78+
"@rollup/plugin-replace": "^5.0.4",
79+
"prettier": "^3.0.3",
80+
"@typescript-eslint/eslint-plugin": "^6.7.5",
81+
"@typescript-eslint/parser": "^6.7.5",
82+
"eslint": "^8.51.0"
83+
},
84+
"keywords": [
85+
"canvas",
86+
"editor",
87+
"image",
88+
"image editor",
89+
"photo editor",
90+
"photo",
91+
"javascript image editor",
92+
"paint",
93+
"js paint",
94+
"image crop",
95+
"image resize",
96+
"inpainting"
97+
]
98+
}

core/rollup.config.mjs

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
import dts from 'rollup-plugin-dts';
2+
import typescript from 'rollup-plugin-typescript2';
3+
import replace from '@rollup/plugin-replace';
4+
import { nodeResolve } from '@rollup/plugin-node-resolve';
5+
import terser from '@rollup/plugin-terser';
6+
import fs from 'fs';
7+
8+
const packageJson = JSON.parse(fs.readFileSync('./package.json', 'utf8'));
9+
const external = Object.keys(packageJson.dependencies);
10+
11+
const ts = typescript({
12+
useTsconfigDeclarationDir: true
13+
});
14+
15+
function bundle(fileName, node) {
16+
return [
17+
{
18+
input: './src/index.ts',
19+
plugins: [
20+
node ? replace({
21+
preventAssignment: true,
22+
delimiters: ['', ''],
23+
values: {
24+
'\'fabric\'': '\'fabric/node\'',
25+
}
26+
}) : false,
27+
ts,
28+
terser()
29+
],
30+
cache: false,
31+
external,
32+
output: [
33+
{
34+
file: `./lib/cjs/${fileName}.cjs`,
35+
format: 'cjs'
36+
},
37+
{
38+
file: `./lib/esm/${fileName}.js`,
39+
format: 'es'
40+
}
41+
]
42+
},
43+
{
44+
input: `./build/index.d.ts`,
45+
output: [
46+
{
47+
file: `./lib/${fileName}.d.ts`,
48+
format: 'es'
49+
}
50+
],
51+
plugins: [dts()],
52+
}
53+
];
54+
}
55+
56+
export default [
57+
...bundle('index.browser', false),
58+
...bundle('index.node', true),
59+
{
60+
input: './src/index.ts',
61+
plugins: [
62+
nodeResolve({
63+
browser: true,
64+
}),
65+
ts,
66+
terser()
67+
],
68+
output: [
69+
{
70+
file: './dist/index.umd.js',
71+
format: 'umd',
72+
name: 'miniCanvasCore'
73+
}
74+
]
75+
}
76+
];

core/src/canvas-grid.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
export function createCanvasGrid(): HTMLCanvasElement {
2+
const canvas = document.createElement('canvas');
3+
canvas.width = 10;
4+
canvas.height = 10;
5+
const context = canvas.getContext('2d')!;
6+
context.fillStyle = '#ffffff';
7+
context.fillRect(0, 0, 10, 10);
8+
context.fillStyle = '#f0f0f0';
9+
context.fillRect(0, 0, 5, 5);
10+
context.fillRect(5, 5, 5, 5);
11+
return canvas;
12+
}

core/src/index.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
export * from 'fabric';
2+
export * from './replacer';
3+
export * from './shapes';
4+
export * from './mce-canvas';
5+
export * from './mce-image-json';
6+
export * from './mce-layer';
7+
export * from './mce-static-canvas';

0 commit comments

Comments
 (0)