File tree Expand file tree Collapse file tree 5 files changed +28
-8
lines changed Expand file tree Collapse file tree 5 files changed +28
-8
lines changed Original file line number Diff line number Diff line change
1
+ ## 0.2.0
2
+
3
+ This version improves support for UMD bundles.
4
+
1
5
## 0.1.1
2
6
3
7
Add ` stroke ` and ` strokeWidth ` fields to the properties editor for the textbox.
Original file line number Diff line number Diff line change @@ -55,8 +55,9 @@ Add the below code to your head section in HTML document.
55
55
``` html
56
56
<head >
57
57
...
58
- <link href =" https://cdn.jsdelivr.net/npm/mini-canvas-editor@0.1.1/css/editor.css" rel =" stylesheet" >
59
- <script src =" https://cdn.jsdelivr.net/npm/mini-canvas-editor@0.1.1/dist/index.umd.js" ></script >
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 >
60
61
```
61
62
62
63
Create the editor by:
Original file line number Diff line number Diff line change 14
14
"prettier:fix" : " prettier --write ./src"
15
15
},
16
16
"dependencies" : {
17
- "mini-canvas-editor" : " ^0.1.1 " ,
18
- "mini-canvas-core" : " ^0.1.1 " ,
17
+ "mini-canvas-editor" : " ^0.2.0 " ,
18
+ "mini-canvas-core" : " ^0.2.0 " ,
19
19
"fabric" : " 6.0.0-beta13" ,
20
20
"canvas" : " ^2.11.2"
21
21
},
Original file line number Diff line number Diff line change 14
14
"prettier:fix" : " prettier --write ./src ./public/**/*.html ./public/**/*.css"
15
15
},
16
16
"dependencies" : {
17
- "mini-canvas-editor" : " ^0.1.1 " ,
18
- "mini-canvas-core" : " ^0.1.1 "
17
+ "mini-canvas-editor" : " ^0.2.0 " ,
18
+ "mini-canvas-core" : " ^0.2.0 "
19
19
},
20
20
"devDependencies" : {
21
21
"ts-loader" : " ^9.4.2" ,
Original file line number Diff line number Diff line change @@ -37,8 +37,23 @@ <h1>📦 Vanilla JavaScript Example</h1>
37
37
</ p >
38
38
< p > This example uses vanilla JavaScript!</ p >
39
39
40
- < link href ="https://cdn.jsdelivr.net/npm/mini-canvas-editor@0.1.1/css/editor.css " rel ="stylesheet " />
41
- < script src ="https://cdn.jsdelivr.net/npm/mini-canvas-editor@0.1.1/dist/index.umd.js "> </ script >
40
+ < script >
41
+ const isLocalhost = [ 'localhost' , '127.0.0.1' ] . includes ( location . hostname ) ;
42
+ const cssUrl = isLocalhost
43
+ ? '../../../editor/css/editor.css'
44
+ : 'https://cdn.jsdelivr.net/npm/mini-canvas-editor@0.2.0/css/editor.css' ;
45
+ const coreUrl = isLocalhost
46
+ ? '../../../core/dist/index.umd.js'
47
+ : 'https://cdn.jsdelivr.net/npm/mini-canvas-core@0.2.0/dist/index.umd.js' ;
48
+ const editorUrl = isLocalhost
49
+ ? '../../../editor/dist/index.umd.js'
50
+ : 'https://cdn.jsdelivr.net/npm/mini-canvas-editor@0.2.0/dist/index.umd.js' ;
51
+
52
+ document . write ( '<link href="' + cssUrl + '" rel="stylesheet" \/>' ) ;
53
+ document . write ( '<script src="' + coreUrl + '"><\/script>' ) ;
54
+ document . write ( '<script src="' + editorUrl + '"><\/script>' ) ;
55
+ </ script >
56
+
42
57
< script >
43
58
const placeholder = document . getElementById ( 'placeholder' ) ;
44
59
const saveButton = document . getElementById ( 'saveButton' ) ;
You can’t perform that action at this time.
0 commit comments