tui-image-editor-angular3 14.0.4 → 14.0.5

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 (148) hide show
  1. package/README.md +155 -155
  2. package/esm2020/lib/consts.mjs +170 -170
  3. package/esm2020/lib/i18n/en.mjs +129 -129
  4. package/esm2020/lib/i18n/nl.mjs +128 -128
  5. package/esm2020/lib/i18n/translation.service.mjs +40 -40
  6. package/esm2020/lib/interfaces/command.mjs +2 -2
  7. package/esm2020/lib/interfaces/history-item.mjs +343 -343
  8. package/esm2020/lib/interfaces/image-size.mjs +2 -2
  9. package/esm2020/lib/interfaces/tools-config.mjs +2 -2
  10. package/esm2020/lib/menus/buttons/crop/crop.component.mjs +22 -22
  11. package/esm2020/lib/menus/buttons/delete/delete.component.mjs +40 -40
  12. package/esm2020/lib/menus/buttons/delete-all/delete-all.component.mjs +27 -27
  13. package/esm2020/lib/menus/buttons/download/download.component.mjs +40 -40
  14. package/esm2020/lib/menus/buttons/drag/drag.component.mjs +41 -41
  15. package/esm2020/lib/menus/buttons/draw/draw.component.mjs +22 -22
  16. package/esm2020/lib/menus/buttons/filter/filter.component.mjs +22 -22
  17. package/esm2020/lib/menus/buttons/flip/flip.component.mjs +22 -22
  18. package/esm2020/lib/menus/buttons/history/history.component.mjs +41 -41
  19. package/esm2020/lib/menus/buttons/icon/icon.component.mjs +22 -22
  20. package/esm2020/lib/menus/buttons/load/load.component.mjs +23 -23
  21. package/esm2020/lib/menus/buttons/mask/mask.component.mjs +22 -22
  22. package/esm2020/lib/menus/buttons/redo/redo.component.mjs +36 -36
  23. package/esm2020/lib/menus/buttons/reset/reset.component.mjs +28 -28
  24. package/esm2020/lib/menus/buttons/rotate/rotate.component.mjs +22 -22
  25. package/esm2020/lib/menus/buttons/shape/shape.component.mjs +22 -22
  26. package/esm2020/lib/menus/buttons/text/text.component.mjs +22 -22
  27. package/esm2020/lib/menus/buttons/undo/undo.component.mjs +36 -36
  28. package/esm2020/lib/menus/buttons/zoom-in/zoom-in.component.mjs +45 -45
  29. package/esm2020/lib/menus/buttons/zoom-out/zoom-out.component.mjs +20 -20
  30. package/esm2020/lib/services/history.service.mjs +86 -86
  31. package/esm2020/lib/services/tools.config-manager.service.mjs +45 -50
  32. package/esm2020/lib/submenus/crop/crop.component.mjs +76 -76
  33. package/esm2020/lib/submenus/draw/draw.component.mjs +149 -149
  34. package/esm2020/lib/submenus/filter/filter.component.mjs +345 -345
  35. package/esm2020/lib/submenus/flip/flip.component.mjs +39 -39
  36. package/esm2020/lib/submenus/icon/icon.component.mjs +119 -119
  37. package/esm2020/lib/submenus/mask/mask.component.mjs +69 -69
  38. package/esm2020/lib/submenus/rotate/rotate.component.mjs +57 -57
  39. package/esm2020/lib/submenus/shape/shape.component.mjs +163 -163
  40. package/esm2020/lib/submenus/text/text.component.mjs +175 -195
  41. package/esm2020/lib/svg-definitions/svg-definitions.component.mjs +12 -12
  42. package/esm2020/lib/tui-image-editor.component.mjs +296 -304
  43. package/esm2020/lib/tui-image-editor.module.mjs +136 -136
  44. package/esm2020/lib/utils.mjs +173 -173
  45. package/esm2020/public-api.mjs +8 -8
  46. package/esm2020/tui-image-editor-angular3.mjs +4 -4
  47. package/fesm2015/tui-image-editor-angular3.mjs +3066 -3098
  48. package/fesm2015/tui-image-editor-angular3.mjs.map +1 -1
  49. package/fesm2020/tui-image-editor-angular3.mjs +3027 -3059
  50. package/fesm2020/tui-image-editor-angular3.mjs.map +1 -1
  51. package/index.d.ts +5 -5
  52. package/lib/consts.d.ts +144 -144
  53. package/lib/i18n/en.d.ts +128 -128
  54. package/lib/i18n/nl.d.ts +127 -127
  55. package/lib/i18n/translation.service.d.ts +14 -14
  56. package/lib/interfaces/command.d.ts +4 -4
  57. package/lib/interfaces/history-item.d.ts +26 -26
  58. package/lib/interfaces/image-size.d.ts +6 -6
  59. package/lib/interfaces/tools-config.d.ts +14 -18
  60. package/lib/menus/buttons/crop/crop.component.d.ts +10 -10
  61. package/lib/menus/buttons/delete/delete.component.d.ts +13 -13
  62. package/lib/menus/buttons/delete-all/delete-all.component.d.ts +11 -11
  63. package/lib/menus/buttons/download/download.component.d.ts +9 -9
  64. package/lib/menus/buttons/drag/drag.component.d.ts +11 -11
  65. package/lib/menus/buttons/draw/draw.component.d.ts +10 -10
  66. package/lib/menus/buttons/filter/filter.component.d.ts +10 -10
  67. package/lib/menus/buttons/flip/flip.component.d.ts +10 -10
  68. package/lib/menus/buttons/history/history.component.d.ts +13 -13
  69. package/lib/menus/buttons/icon/icon.component.d.ts +10 -10
  70. package/lib/menus/buttons/load/load.component.d.ts +9 -9
  71. package/lib/menus/buttons/mask/mask.component.d.ts +10 -10
  72. package/lib/menus/buttons/redo/redo.component.d.ts +12 -12
  73. package/lib/menus/buttons/reset/reset.component.d.ts +12 -12
  74. package/lib/menus/buttons/rotate/rotate.component.d.ts +10 -10
  75. package/lib/menus/buttons/shape/shape.component.d.ts +10 -10
  76. package/lib/menus/buttons/text/text.component.d.ts +10 -10
  77. package/lib/menus/buttons/undo/undo.component.d.ts +12 -12
  78. package/lib/menus/buttons/zoom-in/zoom-in.component.d.ts +12 -12
  79. package/lib/menus/buttons/zoom-out/zoom-out.component.d.ts +9 -9
  80. package/lib/services/history.service.d.ts +45 -45
  81. package/lib/services/tools.config-manager.service.d.ts +12 -12
  82. package/lib/submenus/crop/crop.component.d.ts +23 -23
  83. package/lib/submenus/draw/draw.component.d.ts +32 -32
  84. package/lib/submenus/filter/filter.component.d.ts +70 -70
  85. package/lib/submenus/flip/flip.component.d.ts +10 -10
  86. package/lib/submenus/icon/icon.component.d.ts +24 -24
  87. package/lib/submenus/mask/mask.component.d.ts +16 -16
  88. package/lib/submenus/rotate/rotate.component.d.ts +12 -12
  89. package/lib/submenus/shape/shape.component.d.ts +31 -31
  90. package/lib/submenus/text/text.component.d.ts +31 -33
  91. package/lib/svg-definitions/svg-definitions.component.d.ts +6 -6
  92. package/lib/tui-image-editor.component.d.ts +71 -73
  93. package/lib/tui-image-editor.module.d.ts +48 -48
  94. package/lib/utils.d.ts +45 -45
  95. package/package.json +1 -1
  96. package/public-api.d.ts +4 -4
  97. package/src/checkboxes.scss +95 -95
  98. package/src/theme.scss +936 -936
  99. package/esm2020/tui-image-editor-angular2.mjs +0 -5
  100. package/fesm2015/tui-image-editor-angular2.mjs +0 -5479
  101. package/fesm2015/tui-image-editor-angular2.mjs.map +0 -1
  102. package/fesm2020/tui-image-editor-angular2.mjs +0 -5156
  103. package/fesm2020/tui-image-editor-angular2.mjs.map +0 -1
  104. package/lib/consts.d.ts.map +0 -1
  105. package/lib/i18n/en.d.ts.map +0 -1
  106. package/lib/i18n/nl.d.ts.map +0 -1
  107. package/lib/i18n/translation.service.d.ts.map +0 -1
  108. package/lib/interfaces/command.d.ts.map +0 -1
  109. package/lib/interfaces/history-item.d.ts.map +0 -1
  110. package/lib/interfaces/image-size.d.ts.map +0 -1
  111. package/lib/interfaces/tools-config.d.ts.map +0 -1
  112. package/lib/menus/buttons/crop/crop.component.d.ts.map +0 -1
  113. package/lib/menus/buttons/delete/delete.component.d.ts.map +0 -1
  114. package/lib/menus/buttons/delete-all/delete-all.component.d.ts.map +0 -1
  115. package/lib/menus/buttons/download/download.component.d.ts.map +0 -1
  116. package/lib/menus/buttons/drag/drag.component.d.ts.map +0 -1
  117. package/lib/menus/buttons/draw/draw.component.d.ts.map +0 -1
  118. package/lib/menus/buttons/filter/filter.component.d.ts.map +0 -1
  119. package/lib/menus/buttons/flip/flip.component.d.ts.map +0 -1
  120. package/lib/menus/buttons/history/history.component.d.ts.map +0 -1
  121. package/lib/menus/buttons/icon/icon.component.d.ts.map +0 -1
  122. package/lib/menus/buttons/load/load.component.d.ts.map +0 -1
  123. package/lib/menus/buttons/mask/mask.component.d.ts.map +0 -1
  124. package/lib/menus/buttons/redo/redo.component.d.ts.map +0 -1
  125. package/lib/menus/buttons/reset/reset.component.d.ts.map +0 -1
  126. package/lib/menus/buttons/rotate/rotate.component.d.ts.map +0 -1
  127. package/lib/menus/buttons/shape/shape.component.d.ts.map +0 -1
  128. package/lib/menus/buttons/text/text.component.d.ts.map +0 -1
  129. package/lib/menus/buttons/undo/undo.component.d.ts.map +0 -1
  130. package/lib/menus/buttons/zoom-in/zoom-in.component.d.ts.map +0 -1
  131. package/lib/menus/buttons/zoom-out/zoom-out.component.d.ts.map +0 -1
  132. package/lib/services/history.service.d.ts.map +0 -1
  133. package/lib/services/tools.config-manager.service.d.ts.map +0 -1
  134. package/lib/submenus/crop/crop.component.d.ts.map +0 -1
  135. package/lib/submenus/draw/draw.component.d.ts.map +0 -1
  136. package/lib/submenus/filter/filter.component.d.ts.map +0 -1
  137. package/lib/submenus/flip/flip.component.d.ts.map +0 -1
  138. package/lib/submenus/icon/icon.component.d.ts.map +0 -1
  139. package/lib/submenus/mask/mask.component.d.ts.map +0 -1
  140. package/lib/submenus/rotate/rotate.component.d.ts.map +0 -1
  141. package/lib/submenus/shape/shape.component.d.ts.map +0 -1
  142. package/lib/submenus/text/text.component.d.ts.map +0 -1
  143. package/lib/svg-definitions/svg-definitions.component.d.ts.map +0 -1
  144. package/lib/tui-image-editor.component.d.ts.map +0 -1
  145. package/lib/tui-image-editor.module.d.ts.map +0 -1
  146. package/lib/utils.d.ts.map +0 -1
  147. package/public-api.d.ts.map +0 -1
  148. package/tui-image-editor-angular2.d.ts.map +0 -1
package/README.md CHANGED
@@ -1,155 +1,155 @@
1
- # Angular-Tui
2
-
3
- Based on the UI component of [tui.image-editor](https://github.com/nhn/tui.image-editor).
4
-
5
- ## 💾 Install
6
- *Note: this library only worked with Angular 11.2.0 up to version 0.0.15*
7
- <br>
8
- *Starting from Angular 14 we follow standard Angular version numbering, i.e. library version Y.x.x targets Angular Y.*
9
-
10
- ```sh
11
- npm install --save tui-image-editor-angular2
12
- ```
13
-
14
- Add needed package to NgModule imports:
15
- ```sh
16
- import { TuiImageEditorModule } from 'tui-image-editor-angular2';
17
-
18
- @NgModule({
19
- ...
20
- imports: [TuiImageEditorModule,...]
21
- ...
22
- })
23
- ```
24
-
25
- Import css:
26
- ```scss
27
- @import "tui-image-editor-angular2/src/theme.scss";
28
-
29
- ...
30
- ```
31
-
32
- ## 📊 Usage
33
- Place the following component somewhere on the page.
34
- It only needs to be defined once, for example inside your app.component.html file.
35
-
36
- ```html
37
- <tui-image-editor-svg-definitions></tui-image-editor-svg-definitions>
38
- ```
39
-
40
- <hr>
41
-
42
- [ngx-color-picker](https://github.com/zefoy/ngx-color-picker) requires exposing a ViewContainerRef so it can calculate the area/page's width/height correctly where it can/will be displayed.<br>*Note that if you don't do this, it'll still work, but the color-picker dialog may end up outside of your page's bounds.*
43
-
44
- ```
45
- [cpUseRootViewContainer] // Create dialog component in the root view container (false).
46
- // Note: The root component needs to have public viewContainerRef.
47
- ```
48
-
49
- This can be done like the documentation says by adding a public ViewContainerRef to your app's root component like so.
50
-
51
- ```
52
- @Component({
53
- selector: 'app-root',
54
- templateUrl: './app.component.html',
55
- styleUrls: ['./app.component.scss']
56
- })
57
- export class AppComponent {
58
- constructor(public vcRef: ViewContainerRef) {
59
- }
60
- }
61
- ```
62
-
63
- <hr>
64
-
65
- You should then be able to use the image editor component inside any component.
66
- ```html
67
- <tui-image-editor></tui-image-editor>
68
- ```
69
-
70
- ```js
71
- @Component({
72
- selector: 'tui-image-editor'
73
- })
74
- export class TuiImageEditorComponent{
75
- @Input() options: {
76
- usageStatistics: boolean;
77
- selectionStyle?: {
78
- cornerStyle: string;
79
- cornerSize: number;
80
- cornerColor: string;
81
- cornerStrokeColor: string;
82
- transparentCorners: boolean;
83
- lineWidth: number;
84
- borderColor: string;
85
- rotatingPointOffset: number;
86
- };
87
- applyCropSelectionStyle: boolean;
88
- applyGroupSelectionStyle: boolean;
89
- } = {
90
- usageStatistics: false,
91
- selectionStyle: {
92
- cornerStyle: 'circle',
93
- cornerSize: 32,
94
- cornerColor: '#fff',
95
- cornerStrokeColor: '#fff',
96
- transparentCorners: false,
97
- lineWidth: 4,
98
- borderColor: '#fff',
99
- rotatingPointOffset: 500
100
- },
101
- applyCropSelectionStyle: true,
102
- applyGroupSelectionStyle: true,
103
- };
104
- @Input() initialImage: string | File;
105
-
106
- ...
107
- }
108
- ```
109
-
110
- ## Dependencies
111
- This library currently depends on the following libraries:
112
- - [@ng-bootstrap/ng-bootstrap](https://ng-bootstrap.github.io/) for the [popover](https://ng-bootstrap.github.io/#/components/popover/examples) component.
113
- - [ngx-color-picker](https://www.npmjs.com/package/ngx-color-picker) for choosing the colors of certain elements.
114
- - [tui-image-editor](https://www.npmjs.com/package/tui-image-editor)
115
-
116
- ## Translations
117
- Currently, I've only supplied English and Dutch translations.
118
- You can however supply your own translations, or override mine like so:
119
-
120
- ```js
121
- import { TranslationService } from 'tui-image-editor-angular2';
122
- import { fr } from './i18n/fr';
123
- import { de } from './i18n/de';
124
-
125
-
126
- @Component({
127
- selector: 'app-root',
128
- templateUrl: './app.component.html',
129
- styleUrls: ['./app.component.scss'],
130
- })
131
- export class AppComponent {
132
- private availableLanguages = { fr, de };
133
-
134
- constructor(private translateService: TranslationService) {
135
- Object.keys(this.availableLanguages).forEach((language) => {
136
- translateService.loadCustomMessages(language, this.availableLanguages[language]);
137
- });
138
- }
139
-
140
- ...
141
- }
142
- ```
143
-
144
- fr.ts file example:
145
-
146
- ```js
147
- export const fr = {
148
- 'tui-image-editor-angular-menus-buttons-crop-tooltip': 'Recadrer',
149
- 'tui-image-editor-angular-menus-buttons-delete': 'Supprimer',
150
- 'tui-image-editor-angular-menus-buttons-deleteAll': 'Tout supprimer'
151
- ...
152
- }
153
- ```
154
-
155
- Take a look at my [en.ts](src/lib/i18n/en.ts) file to see which strings you can/should use/override.
1
+ # Angular-Tui
2
+
3
+ Based on the UI component of [tui.image-editor](https://github.com/nhn/tui.image-editor).
4
+
5
+ ## 💾 Install
6
+ *Note: this library only worked with Angular 11.2.0 up to version 0.0.15*
7
+ <br>
8
+ *Starting from Angular 14 we follow standard Angular version numbering, i.e. library version Y.x.x targets Angular Y.*
9
+
10
+ ```sh
11
+ npm install --save tui-image-editor-angular2
12
+ ```
13
+
14
+ Add needed package to NgModule imports:
15
+ ```sh
16
+ import { TuiImageEditorModule } from 'tui-image-editor-angular2';
17
+
18
+ @NgModule({
19
+ ...
20
+ imports: [TuiImageEditorModule,...]
21
+ ...
22
+ })
23
+ ```
24
+
25
+ Import css:
26
+ ```scss
27
+ @import "tui-image-editor-angular2/src/theme.scss";
28
+
29
+ ...
30
+ ```
31
+
32
+ ## 📊 Usage
33
+ Place the following component somewhere on the page.
34
+ It only needs to be defined once, for example inside your app.component.html file.
35
+
36
+ ```html
37
+ <tui-image-editor-svg-definitions></tui-image-editor-svg-definitions>
38
+ ```
39
+
40
+ <hr>
41
+
42
+ [ngx-color-picker](https://github.com/zefoy/ngx-color-picker) requires exposing a ViewContainerRef so it can calculate the area/page's width/height correctly where it can/will be displayed.<br>*Note that if you don't do this, it'll still work, but the color-picker dialog may end up outside of your page's bounds.*
43
+
44
+ ```
45
+ [cpUseRootViewContainer] // Create dialog component in the root view container (false).
46
+ // Note: The root component needs to have public viewContainerRef.
47
+ ```
48
+
49
+ This can be done like the documentation says by adding a public ViewContainerRef to your app's root component like so.
50
+
51
+ ```
52
+ @Component({
53
+ selector: 'app-root',
54
+ templateUrl: './app.component.html',
55
+ styleUrls: ['./app.component.scss']
56
+ })
57
+ export class AppComponent {
58
+ constructor(public vcRef: ViewContainerRef) {
59
+ }
60
+ }
61
+ ```
62
+
63
+ <hr>
64
+
65
+ You should then be able to use the image editor component inside any component.
66
+ ```html
67
+ <tui-image-editor></tui-image-editor>
68
+ ```
69
+
70
+ ```js
71
+ @Component({
72
+ selector: 'tui-image-editor'
73
+ })
74
+ export class TuiImageEditorComponent{
75
+ @Input() options: {
76
+ usageStatistics: boolean;
77
+ selectionStyle?: {
78
+ cornerStyle: string;
79
+ cornerSize: number;
80
+ cornerColor: string;
81
+ cornerStrokeColor: string;
82
+ transparentCorners: boolean;
83
+ lineWidth: number;
84
+ borderColor: string;
85
+ rotatingPointOffset: number;
86
+ };
87
+ applyCropSelectionStyle: boolean;
88
+ applyGroupSelectionStyle: boolean;
89
+ } = {
90
+ usageStatistics: false,
91
+ selectionStyle: {
92
+ cornerStyle: 'circle',
93
+ cornerSize: 32,
94
+ cornerColor: '#fff',
95
+ cornerStrokeColor: '#fff',
96
+ transparentCorners: false,
97
+ lineWidth: 4,
98
+ borderColor: '#fff',
99
+ rotatingPointOffset: 500
100
+ },
101
+ applyCropSelectionStyle: true,
102
+ applyGroupSelectionStyle: true,
103
+ };
104
+ @Input() initialImage: string | File;
105
+
106
+ ...
107
+ }
108
+ ```
109
+
110
+ ## Dependencies
111
+ This library currently depends on the following libraries:
112
+ - [@ng-bootstrap/ng-bootstrap](https://ng-bootstrap.github.io/) for the [popover](https://ng-bootstrap.github.io/#/components/popover/examples) component.
113
+ - [ngx-color-picker](https://www.npmjs.com/package/ngx-color-picker) for choosing the colors of certain elements.
114
+ - [tui-image-editor](https://www.npmjs.com/package/tui-image-editor)
115
+
116
+ ## Translations
117
+ Currently, I've only supplied English and Dutch translations.
118
+ You can however supply your own translations, or override mine like so:
119
+
120
+ ```js
121
+ import { TranslationService } from 'tui-image-editor-angular2';
122
+ import { fr } from './i18n/fr';
123
+ import { de } from './i18n/de';
124
+
125
+
126
+ @Component({
127
+ selector: 'app-root',
128
+ templateUrl: './app.component.html',
129
+ styleUrls: ['./app.component.scss'],
130
+ })
131
+ export class AppComponent {
132
+ private availableLanguages = { fr, de };
133
+
134
+ constructor(private translateService: TranslationService) {
135
+ Object.keys(this.availableLanguages).forEach((language) => {
136
+ translateService.loadCustomMessages(language, this.availableLanguages[language]);
137
+ });
138
+ }
139
+
140
+ ...
141
+ }
142
+ ```
143
+
144
+ fr.ts file example:
145
+
146
+ ```js
147
+ export const fr = {
148
+ 'tui-image-editor-angular-menus-buttons-crop-tooltip': 'Recadrer',
149
+ 'tui-image-editor-angular-menus-buttons-delete': 'Supprimer',
150
+ 'tui-image-editor-angular-menus-buttons-deleteAll': 'Tout supprimer'
151
+ ...
152
+ }
153
+ ```
154
+
155
+ Take a look at my [en.ts](src/lib/i18n/en.ts) file to see which strings you can/should use/override.