amotify 0.0.8 → 0.0.10

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 (261) hide show
  1. package/{dist/@types/_.d.ts → @types/_.tsx} +3 -4
  2. package/{src/@types → @types}/amot.tsx +125 -85
  3. package/{src/@types → @types}/fn.tsx +52 -53
  4. package/{src/@types → @types}/jsminAmotifyExtension.tsx +1 -2
  5. package/@types/module.tsx +1 -0
  6. package/dist/amotify.js +328 -0
  7. package/{public → dist}/amotify.min.css +339 -339
  8. package/package.json +11 -12
  9. package/src/{Atoms/@export.tsx → @atoms.tsx} +3 -3
  10. package/src/@functions.tsx +29 -0
  11. package/src/{Global/@export.tsx → @global.tsx} +9 -9
  12. package/src/@jsminAmotifyExtension/formCollect.tsx +1 -1
  13. package/src/{Molecules/@export.tsx → @molecules.tsx} +5 -4
  14. package/src/@organisms.tsx +5 -0
  15. package/src/@styles/UniStyling.scss +1 -1
  16. package/src/@styles/init.scss +1 -1
  17. package/src/@styles/styleSet.scss +1 -1
  18. package/src/{Templates/@export.tsx → @templates.tsx} +1 -1
  19. package/src/{Atoms → atoms}/FAIcon/parts.tsx +4 -3
  20. package/src/{Atoms → atoms}/FAIcon/style.module.scss +1 -2
  21. package/src/{Atoms → atoms}/Logo/parts.tsx +2 -2
  22. package/src/{Atoms → atoms}/Logo/style.module.scss +1 -2
  23. package/src/{Atoms → atoms}/Various/parts.tsx +10 -9
  24. package/src/{Atoms → atoms}/Various/style.module.scss +3 -2
  25. package/src/config.tsx +4 -4
  26. package/src/{Functions → functions}/Button/_.tsx +2 -1
  27. package/src/{Functions → functions}/Button/style.module.scss +3 -2
  28. package/src/{Functions → functions}/Cropper/parts.tsx +16 -20
  29. package/src/{Functions → functions}/Cropper/style.module.scss +1 -1
  30. package/src/{Functions → functions}/Effects/Fade.tsx +6 -11
  31. package/src/{Functions → functions}/Effects/style.module.scss +1 -1
  32. package/src/{Functions → functions}/Input/Chips/Selector.tsx +17 -21
  33. package/src/{Functions → functions}/Input/Chips/_.tsx +12 -17
  34. package/src/functions/Input/Chips/style.module.scss +6 -0
  35. package/src/{Functions → functions}/Input/DigitCharacters.tsx +6 -10
  36. package/src/{Functions → functions}/Input/File/_.tsx +13 -16
  37. package/src/{Functions → functions}/Input/File/style.module.scss +1 -1
  38. package/src/{Functions → functions}/Input/Hidden.tsx +4 -3
  39. package/src/{Functions → functions}/Input/List/_.tsx +8 -12
  40. package/src/{Functions → functions}/Input/List/style.module.scss +1 -1
  41. package/src/{Functions → functions}/Input/Segmented/_.tsx +2 -2
  42. package/src/{Functions → functions}/Input/Segmented/style.module.scss +2 -2
  43. package/src/{Functions → functions}/Input/Select/_.tsx +8 -11
  44. package/src/{Functions → functions}/Input/Select/style.module.scss +1 -1
  45. package/src/{Functions → functions}/Input/Slider/_.tsx +9 -12
  46. package/src/{Functions → functions}/Input/Slider/style.module.scss +2 -2
  47. package/src/{Functions → functions}/Input/Switch/_.tsx +7 -11
  48. package/src/{Functions → functions}/Input/Switch/style.module.scss +1 -1
  49. package/src/{Functions → functions}/Input/Text.tsx +6 -11
  50. package/src/{Functions → functions}/Input/TextArea.tsx +4 -8
  51. package/src/{Functions → functions}/Input/Time/Picker.tsx +11 -16
  52. package/src/{Functions → functions}/Input/Time/_.tsx +13 -17
  53. package/src/{Functions → functions}/Input/Time/style.module.scss +1 -1
  54. package/src/{Functions → functions}/Input/_.tsx +12 -17
  55. package/src/{Functions → functions}/Input/core.tsx +14 -19
  56. package/src/{Functions → functions}/Input/style.module.scss +1 -1
  57. package/src/{Functions → functions}/Inputs/style.module.scss +1 -1
  58. package/src/{Functions → functions}/Inputs/text.tsx +5 -17
  59. package/src/functions/Inputs/types.d.ts +13 -0
  60. package/src/{Functions → functions}/Layout/PageNotFound.tsx +6 -7
  61. package/src/{Functions → functions}/Layout/PageRouter.tsx +25 -34
  62. package/src/{Functions → functions}/Layout/PageViewController/parts.tsx +6 -9
  63. package/src/{Functions → functions}/Layout/Plate.tsx +3 -2
  64. package/src/{Functions → functions}/Layout/RootViewController/parts.tsx +6 -8
  65. package/src/{Functions → functions}/Layout/RootViewController/style.module.scss +1 -1
  66. package/src/{Functions → functions}/Layout/SwipeView/parts.tsx +11 -16
  67. package/src/{Functions → functions}/Layout/SwipeView/style.module.scss +1 -1
  68. package/src/{Functions → functions}/Layout/TabBar.tsx +6 -10
  69. package/src/{Functions → functions}/Loader/corner.tsx +6 -12
  70. package/src/{Functions → functions}/Loader/mini.tsx +9 -12
  71. package/src/{Functions → functions}/Loader/parts.tsx +7 -10
  72. package/src/{Functions → functions}/Loader/style.module.scss +1 -1
  73. package/src/{Functions → functions}/Loader/top.tsx +6 -12
  74. package/src/{Functions → functions}/Sheet/parts.tsx +16 -19
  75. package/src/{Functions → functions}/Sheet/style.module.scss +1 -1
  76. package/src/{Functions → functions}/SnackBar/parts.tsx +14 -17
  77. package/src/{Functions → functions}/SnackBar/style.module.scss +1 -1
  78. package/src/{Functions → functions}/Table/Data/parts.tsx +4 -4
  79. package/src/{Functions → functions}/Table/Drag/parts.tsx +12 -15
  80. package/src/{Functions → functions}/Table/Normal/parts.tsx +5 -5
  81. package/src/{Functions → functions}/Table/_.tsx +4 -4
  82. package/src/{Functions → functions}/Table/style.module.scss +3 -2
  83. package/src/{Functions → functions}/Tooltips/parts.tsx +3 -2
  84. package/src/{Global → global}/LaunchReactApplication.tsx +4 -3
  85. package/src/{Global → global}/styleConverter.tsx +3 -7
  86. package/src/launch.tsx +16 -11
  87. package/src/{Molecules → molecules}/Accordion/parts.tsx +8 -12
  88. package/src/{Molecules → molecules}/Accordion/style.module.scss +1 -1
  89. package/src/{Molecules → molecules}/LinkifyText/parts.tsx +4 -3
  90. package/src/{Molecules → molecules}/List.tsx +3 -2
  91. package/src/{Organisms → organisms}/DisplayStyleInput/darkmode.tsx +6 -11
  92. package/src/{Organisms → organisms}/DisplayStyleInput/themeColor.tsx +7 -12
  93. package/src/{Templates → templates}/PlayGround/parts.tsx +12 -40
  94. package/src/{Templates → templates}/PlayGround/style.module.scss +1 -1
  95. package/tsconfig.json +19 -5
  96. package/webpack.config.js +18 -7
  97. package/dist/@jsminAmotifyExtension/_.d.ts +0 -4
  98. package/dist/@jsminAmotifyExtension/_.js +0 -6
  99. package/dist/@jsminAmotifyExtension/fetch.d.ts +0 -9
  100. package/dist/@jsminAmotifyExtension/fetch.js +0 -199
  101. package/dist/@jsminAmotifyExtension/formCollect.d.ts +0 -1
  102. package/dist/@jsminAmotifyExtension/formCollect.js +0 -137
  103. package/dist/@jsminAmotifyExtension/spreadSheet.d.ts +0 -4
  104. package/dist/@jsminAmotifyExtension/spreadSheet.js +0 -314
  105. package/dist/@jsminAmotifyExtension/variables.d.ts +0 -0
  106. package/dist/@jsminAmotifyExtension/variables.js +0 -186
  107. package/dist/@types/_.js +0 -8
  108. package/dist/@types/amot.d.ts +0 -260
  109. package/dist/@types/amot.js +0 -2
  110. package/dist/@types/fn.d.ts +0 -1040
  111. package/dist/@types/fn.js +0 -2
  112. package/dist/@types/index.d.ts +0 -62
  113. package/dist/@types/index.js +0 -2
  114. package/dist/@types/jsminAmotifyExtension.d.ts +0 -134
  115. package/dist/@types/jsminAmotifyExtension.js +0 -2
  116. package/dist/@types/module.d.ts +0 -2
  117. package/dist/@types/module.js +0 -1
  118. package/dist/@types/state.d.ts +0 -145
  119. package/dist/@types/state.js +0 -2
  120. package/dist/Atoms/@export.d.ts +0 -4
  121. package/dist/Atoms/@export.js +0 -16
  122. package/dist/Atoms/FAIcon/parts.d.ts +0 -2
  123. package/dist/Atoms/FAIcon/parts.js +0 -152
  124. package/dist/Atoms/Logo/parts.d.ts +0 -1
  125. package/dist/Atoms/Logo/parts.js +0 -154
  126. package/dist/Atoms/Various/parts.d.ts +0 -9
  127. package/dist/Atoms/Various/parts.js +0 -113
  128. package/dist/Functions/@export.d.ts +0 -12
  129. package/dist/Functions/@export.js +0 -25
  130. package/dist/Functions/Button/_.d.ts +0 -1
  131. package/dist/Functions/Button/_.js +0 -270
  132. package/dist/Functions/Cropper/parts.d.ts +0 -1
  133. package/dist/Functions/Cropper/parts.js +0 -783
  134. package/dist/Functions/Effects/Fade.d.ts +0 -1
  135. package/dist/Functions/Effects/Fade.js +0 -82
  136. package/dist/Functions/Effects/Ripple.d.ts +0 -1
  137. package/dist/Functions/Effects/Ripple.js +0 -107
  138. package/dist/Functions/Effects/_.d.ts +0 -3
  139. package/dist/Functions/Effects/_.js +0 -43
  140. package/dist/Functions/Input/Chips/Selector.d.ts +0 -1
  141. package/dist/Functions/Input/Chips/Selector.js +0 -356
  142. package/dist/Functions/Input/Chips/_.d.ts +0 -2
  143. package/dist/Functions/Input/Chips/_.js +0 -218
  144. package/dist/Functions/Input/DigitCharacters.d.ts +0 -1
  145. package/dist/Functions/Input/DigitCharacters.js +0 -178
  146. package/dist/Functions/Input/File/_.d.ts +0 -2
  147. package/dist/Functions/Input/File/_.js +0 -458
  148. package/dist/Functions/Input/Hidden.d.ts +0 -1
  149. package/dist/Functions/Input/Hidden.js +0 -30
  150. package/dist/Functions/Input/List/_.d.ts +0 -1
  151. package/dist/Functions/Input/List/_.js +0 -232
  152. package/dist/Functions/Input/Segmented/_.d.ts +0 -1
  153. package/dist/Functions/Input/Segmented/_.js +0 -111
  154. package/dist/Functions/Input/Select/_.d.ts +0 -1
  155. package/dist/Functions/Input/Select/_.js +0 -154
  156. package/dist/Functions/Input/Slider/_.d.ts +0 -1
  157. package/dist/Functions/Input/Slider/_.js +0 -308
  158. package/dist/Functions/Input/Switch/_.d.ts +0 -1
  159. package/dist/Functions/Input/Switch/_.js +0 -120
  160. package/dist/Functions/Input/Text.d.ts +0 -5
  161. package/dist/Functions/Input/Text.js +0 -340
  162. package/dist/Functions/Input/TextArea.d.ts +0 -1
  163. package/dist/Functions/Input/TextArea.js +0 -98
  164. package/dist/Functions/Input/Time/Picker.d.ts +0 -1
  165. package/dist/Functions/Input/Time/Picker.js +0 -581
  166. package/dist/Functions/Input/Time/_.d.ts +0 -2
  167. package/dist/Functions/Input/Time/_.js +0 -567
  168. package/dist/Functions/Input/_.d.ts +0 -5
  169. package/dist/Functions/Input/_.js +0 -446
  170. package/dist/Functions/Input/core.d.ts +0 -34
  171. package/dist/Functions/Input/core.js +0 -324
  172. package/dist/Functions/Inputs/_.d.ts +0 -3
  173. package/dist/Functions/Inputs/_.js +0 -7
  174. package/dist/Functions/Inputs/text.d.ts +0 -12
  175. package/dist/Functions/Inputs/text.js +0 -46
  176. package/dist/Functions/Layout/PageNotFound.d.ts +0 -1
  177. package/dist/Functions/Layout/PageNotFound.js +0 -30
  178. package/dist/Functions/Layout/PageRouter.d.ts +0 -2
  179. package/dist/Functions/Layout/PageRouter.js +0 -65
  180. package/dist/Functions/Layout/PageViewController/parts.d.ts +0 -1
  181. package/dist/Functions/Layout/PageViewController/parts.js +0 -31
  182. package/dist/Functions/Layout/Plate.d.ts +0 -1
  183. package/dist/Functions/Layout/Plate.js +0 -39
  184. package/dist/Functions/Layout/RootViewController/parts.d.ts +0 -1
  185. package/dist/Functions/Layout/RootViewController/parts.js +0 -202
  186. package/dist/Functions/Layout/SwipeView/parts.d.ts +0 -2
  187. package/dist/Functions/Layout/SwipeView/parts.js +0 -319
  188. package/dist/Functions/Layout/TabBar.d.ts +0 -1
  189. package/dist/Functions/Layout/TabBar.js +0 -49
  190. package/dist/Functions/Layout/_.d.ts +0 -2
  191. package/dist/Functions/Layout/_.js +0 -20
  192. package/dist/Functions/Loader/corner.d.ts +0 -1
  193. package/dist/Functions/Loader/corner.js +0 -59
  194. package/dist/Functions/Loader/mini.d.ts +0 -33
  195. package/dist/Functions/Loader/mini.js +0 -126
  196. package/dist/Functions/Loader/parts.d.ts +0 -3
  197. package/dist/Functions/Loader/parts.js +0 -108
  198. package/dist/Functions/Loader/top.d.ts +0 -1
  199. package/dist/Functions/Loader/top.js +0 -69
  200. package/dist/Functions/Sheet/parts.d.ts +0 -2
  201. package/dist/Functions/Sheet/parts.js +0 -724
  202. package/dist/Functions/SnackBar/parts.d.ts +0 -2
  203. package/dist/Functions/SnackBar/parts.js +0 -171
  204. package/dist/Functions/Table/Data/parts.d.ts +0 -3
  205. package/dist/Functions/Table/Data/parts.js +0 -629
  206. package/dist/Functions/Table/Drag/parts.d.ts +0 -1
  207. package/dist/Functions/Table/Drag/parts.js +0 -359
  208. package/dist/Functions/Table/Normal/parts.d.ts +0 -1
  209. package/dist/Functions/Table/Normal/parts.js +0 -92
  210. package/dist/Functions/Table/_.d.ts +0 -9
  211. package/dist/Functions/Table/_.js +0 -153
  212. package/dist/Functions/Tooltips/parts.d.ts +0 -2
  213. package/dist/Functions/Tooltips/parts.js +0 -71
  214. package/dist/Global/@export.d.ts +0 -12
  215. package/dist/Global/@export.js +0 -198
  216. package/dist/Global/LaunchReactApplication.d.ts +0 -1
  217. package/dist/Global/LaunchReactApplication.js +0 -48
  218. package/dist/Global/styleConverter.d.ts +0 -2
  219. package/dist/Global/styleConverter.js +0 -349
  220. package/dist/Molecules/@export.d.ts +0 -21
  221. package/dist/Molecules/@export.js +0 -41
  222. package/dist/Molecules/Accordion/parts.d.ts +0 -2
  223. package/dist/Molecules/Accordion/parts.js +0 -165
  224. package/dist/Molecules/LinkifyText/parts.d.ts +0 -1
  225. package/dist/Molecules/LinkifyText/parts.js +0 -39
  226. package/dist/Molecules/List.d.ts +0 -1
  227. package/dist/Molecules/List.js +0 -35
  228. package/dist/Organisms/@export.d.ts +0 -2
  229. package/dist/Organisms/@export.js +0 -5
  230. package/dist/Organisms/DisplayStyleInput/_.d.ts +0 -1
  231. package/dist/Organisms/DisplayStyleInput/_.js +0 -15
  232. package/dist/Organisms/DisplayStyleInput/darkmode.d.ts +0 -1
  233. package/dist/Organisms/DisplayStyleInput/darkmode.js +0 -77
  234. package/dist/Organisms/DisplayStyleInput/themeColor.d.ts +0 -27
  235. package/dist/Organisms/DisplayStyleInput/themeColor.js +0 -185
  236. package/dist/Templates/@export.d.ts +0 -2
  237. package/dist/Templates/@export.js +0 -5
  238. package/dist/Templates/PlayGround/parts.d.ts +0 -1
  239. package/dist/Templates/PlayGround/parts.js +0 -55
  240. package/dist/config.d.ts +0 -16
  241. package/dist/config.js +0 -171
  242. package/dist/launch.d.ts +0 -9
  243. package/dist/launch.js +0 -46
  244. package/dist/preload.d.ts +0 -1
  245. package/dist/preload.js +0 -73
  246. package/public/amotify.js +0 -310
  247. package/src/@types/_.tsx +0 -6
  248. package/src/@types/index.tsx +0 -74
  249. package/src/@types/module.tsx +0 -2
  250. package/src/Functions/@export.tsx +0 -29
  251. package/src/Functions/Input/Chips/style.module.scss +0 -6
  252. package/src/Functions/Inputs/types.d.ts +0 -1
  253. package/src/Global/exe.tsx +0 -0
  254. package/src/Organisms/@export.tsx +0 -5
  255. package/src/index.js +0 -0
  256. /package/{src/@types → @types}/state.tsx +0 -0
  257. /package/src/{Functions → functions}/Effects/Ripple.tsx +0 -0
  258. /package/src/{Functions → functions}/Effects/_.tsx +0 -0
  259. /package/src/{Functions → functions}/Inputs/_.tsx +0 -0
  260. /package/src/{Functions → functions}/Layout/_.tsx +0 -0
  261. /package/src/{Organisms → organisms}/DisplayStyleInput/_.tsx +0 -0
@@ -1,783 +0,0 @@
1
- "use strict";
2
- var __assign = (this && this.__assign) || function () {
3
- __assign = Object.assign || function(t) {
4
- for (var s, i = 1, n = arguments.length; i < n; i++) {
5
- s = arguments[i];
6
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
- t[p] = s[p];
8
- }
9
- return t;
10
- };
11
- return __assign.apply(this, arguments);
12
- };
13
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
14
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
15
- return new (P || (P = Promise))(function (resolve, reject) {
16
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
17
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
18
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
19
- step((generator = generator.apply(thisArg, _arguments || [])).next());
20
- });
21
- };
22
- var __generator = (this && this.__generator) || function (thisArg, body) {
23
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
24
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
25
- function verb(n) { return function (v) { return step([n, v]); }; }
26
- function step(op) {
27
- if (f) throw new TypeError("Generator is already executing.");
28
- while (_) try {
29
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
30
- if (y = 0, t) op = [op[0] & 2, t.value];
31
- switch (op[0]) {
32
- case 0: case 1: t = op; break;
33
- case 4: _.label++; return { value: op[1], done: false };
34
- case 5: _.label++; y = op[1]; op = [0]; continue;
35
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
36
- default:
37
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
38
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
39
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
40
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
41
- if (t[2]) _.ops.pop();
42
- _.trys.pop(); continue;
43
- }
44
- op = body.call(thisArg, _);
45
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
46
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
47
- }
48
- };
49
- var __read = (this && this.__read) || function (o, n) {
50
- var m = typeof Symbol === "function" && o[Symbol.iterator];
51
- if (!m) return o;
52
- var i = m.call(o), r, ar = [], e;
53
- try {
54
- while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
55
- }
56
- catch (error) { e = { error: error }; }
57
- finally {
58
- try {
59
- if (r && !r.done && (m = i["return"])) m.call(i);
60
- }
61
- finally { if (e) throw e.error; }
62
- }
63
- return ar;
64
- };
65
- var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
66
- if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
67
- if (ar || !(i in from)) {
68
- if (!ar) ar = Array.prototype.slice.call(from, 0, i);
69
- ar[i] = from[i];
70
- }
71
- }
72
- return to.concat(ar || Array.prototype.slice.call(from));
73
- };
74
- var __importDefault = (this && this.__importDefault) || function (mod) {
75
- return (mod && mod.__esModule) ? mod : { "default": mod };
76
- };
77
- Object.defineProperty(exports, "__esModule", { value: true });
78
- exports.Cropper = void 0;
79
- var _export_1 = require("../../Global/@export");
80
- var _export_2 = require("../../Atoms/@export");
81
- var _export_3 = require("../../Molecules/@export");
82
- var _export_4 = require("../../Functions/@export");
83
- var useState = React.useState, useEffect = React.useEffect;
84
- var style_module_scss_1 = __importDefault(require("./style.module.scss"));
85
- var CroppImage = /** @class */ (function () {
86
- function CroppImage(params) {
87
- this.set_scale = params.set_scale;
88
- this.val_file = params.val_file;
89
- this.develops = params.develops;
90
- this.use = params.use;
91
- this.componentID = params.componentID;
92
- this.scale = {
93
- current: params.scale.default,
94
- default: params.scale.default,
95
- min: params.scale.min,
96
- max: params.scale.max
97
- };
98
- var Canvas = params.canvas;
99
- var cvsW = Canvas.width, cvsH = Canvas.height;
100
- var Picture = params.picture.image;
101
- var pictW = Picture.width, pictH = Picture.height;
102
- var pictAsp = pictW / pictH;
103
- this.Canvas = {
104
- elm: Canvas,
105
- ctx: Canvas.getContext('2d')
106
- };
107
- var frameW = 0, frameH = 0;
108
- if (this.use == 'profile') {
109
- frameW = Canvas.width / 3 * 2;
110
- frameH = Canvas.height / 3 * 2;
111
- }
112
- else if (this.use == 'header') {
113
- frameW = Canvas.width * (7 / 9);
114
- frameH = frameW / 3;
115
- }
116
- var frameX = (Canvas.width - frameW) / 2;
117
- var frameY = (Canvas.height - frameH) / 2;
118
- var frameAsp = frameW / frameH;
119
- this.Picture = {
120
- elm: Picture,
121
- originDataUrl: Picture.src,
122
- aspect: pictAsp,
123
- revisedAspect: frameAsp > pictAsp
124
- ? frameW / pictW
125
- : frameH / pictH,
126
- rotate: params.picture.rotate,
127
- grayScale: params.picture.grayScale,
128
- tone: params.picture.tone
129
- };
130
- this.pst = {
131
- frame: {
132
- x: frameX,
133
- y: frameY,
134
- w: frameW,
135
- h: frameH,
136
- aspect: frameAsp,
137
- },
138
- outImage: { x: 0, y: 0, w: 0, h: 0 },
139
- imageX: pictW / 2,
140
- imageY: pictH / 2,
141
- centerX: cvsW / 2,
142
- centerY: cvsH / 2
143
- };
144
- this.dragEffectInfo = {
145
- origin: { x: 0, y: 0 },
146
- frameExpandRate: { x: 0, y: 0 }
147
- };
148
- this.pinchEffectInfo = {
149
- origin: {
150
- x: 0, y: 0,
151
- scale: this.scale.current
152
- }
153
- };
154
- this.modifyImage();
155
- }
156
- CroppImage.prototype.dragEffect = function (params) {
157
- var eventType = params.eventType, x = params.x, y = params.y;
158
- if (eventType == 'start') {
159
- var CanvasRect = this.Canvas.elm.position();
160
- this.dragEffectInfo = {
161
- origin: { x: x, y: y },
162
- frameExpandRate: {
163
- x: this.Canvas.elm.width / CanvasRect.width,
164
- y: this.Canvas.elm.height / CanvasRect.height
165
- }
166
- };
167
- }
168
- else {
169
- var _a = this.dragEffectInfo, origin_1 = _a.origin, frameExpandRate = _a.frameExpandRate;
170
- var dragX = origin_1.x - x;
171
- var dragY = origin_1.y - y;
172
- var scale = this.scale.current * this.Picture.revisedAspect / 100;
173
- var shiftX = dragX / scale * frameExpandRate.x;
174
- var shiftY = dragY / scale * frameExpandRate.y;
175
- if (eventType == 'move') {
176
- this.drawImage(this.pst.imageX + shiftX, this.pst.imageY + shiftY);
177
- }
178
- else if (eventType == 'end') {
179
- this.drawImage(this.pst.imageX += shiftX, this.pst.imageY += shiftY);
180
- }
181
- }
182
- };
183
- CroppImage.prototype.pinchEffect = function (params) {
184
- var eventType = params.eventType, event = params.event;
185
- var _a = $.getCursor(event.touches[0]), x1 = _a.x, y1 = _a.y;
186
- var _b = $.getCursor(event.touches[1]), x2 = _b.x, y2 = _b.y;
187
- var marginX = x2 - x1;
188
- var marginY = y2 - y1;
189
- if (eventType == 'start') {
190
- this.pinchEffectInfo.origin = {
191
- x: marginX, y: marginY,
192
- scale: this.scale.current
193
- };
194
- }
195
- else if (eventType == 'move') {
196
- var origin_2 = this.pinchEffectInfo.origin;
197
- var originDist = Math.sqrt(Math.pow(origin_2.x, 2) + Math.pow(origin_2.y, 2));
198
- var dist = Math.sqrt(Math.pow(marginX, 2) + Math.pow(marginY, 2));
199
- var margin = dist / originDist;
200
- var scale = Number(origin_2.scale * margin);
201
- this.set_scale(scale);
202
- }
203
- };
204
- CroppImage.prototype.updateScale = function (scale) {
205
- var nextValue = scale;
206
- nextValue = Math.max(nextValue, this.scale.min);
207
- nextValue = Math.min(nextValue, this.scale.max);
208
- this.scale.current = nextValue;
209
- this.drawImage();
210
- };
211
- CroppImage.prototype.updateFilter = function (params) {
212
- this.Picture.grayScale = params.grayScale;
213
- this.Picture.tone = params.tone;
214
- this.Picture.rotate = params.rotate;
215
- this.modifyImage();
216
- };
217
- CroppImage.prototype.modifyImage = function () {
218
- return __awaiter(this, void 0, void 0, function () {
219
- var _a, grayScale, tone, rotate, canvas, ctx, image, ImageW, ImageH, newImage, imgData, ColorDir, rCorrect, gCorrect, bCorrect, iH, iW, Index, terminal, k, current, newDataUrl, Picture, pictW, pictH, pictAsp;
220
- return __generator(this, function (_b) {
221
- switch (_b.label) {
222
- case 0:
223
- _a = this.Picture, grayScale = _a.grayScale, tone = _a.tone, rotate = _a.rotate;
224
- canvas = document.createElement('canvas');
225
- ctx = canvas.getContext('2d');
226
- image = new Image();
227
- image.src = this.Picture.originDataUrl;
228
- ImageW = image.width;
229
- ImageH = image.height;
230
- if (rotate == 90 || rotate == 270) {
231
- ImageW = image.height;
232
- ImageH = image.width;
233
- }
234
- canvas.width = ImageW;
235
- canvas.height = ImageH;
236
- if (grayScale)
237
- ctx.filter = 'grayscale(' + grayScale + '%)';
238
- if (rotate) {
239
- ctx.translate(ImageW / 2, ImageH / 2);
240
- ctx.rotate(rotate * Math.PI / 180);
241
- if ([90, 270].includes(rotate)) {
242
- ctx.translate(-ImageH / 2, -ImageW / 2);
243
- }
244
- else {
245
- ctx.translate(-ImageW / 2, -ImageH / 2);
246
- }
247
- }
248
- ctx.drawImage(image, 0, 0, image.width, image.height);
249
- newImage = ctx.getImageData(0, 0, canvas.width, canvas.height);
250
- imgData = newImage.data;
251
- {
252
- grayScale /= 100;
253
- ColorDir = [
254
- [255, 255, 255],
255
- [255, 200, 100],
256
- [170, 170, 255],
257
- [240, 200, 145],
258
- [128, 255, 255],
259
- [255, 128, 255],
260
- [255, 255, 128],
261
- [128, 158, 169],
262
- [128, 112, 162],
263
- [50, 192, 87],
264
- [246, 100, 140], // Origin4
265
- ][tone];
266
- rCorrect = ColorDir[0] / 255;
267
- gCorrect = ColorDir[1] / 255;
268
- bCorrect = ColorDir[2] / 255;
269
- for (iH = 0; iH < ImageH; iH++) {
270
- for (iW = 0; iW < ImageW; iW++) {
271
- Index = (iH * ImageW + iW) * 4;
272
- if (grayScale) {
273
- terminal = 0.3 * imgData[Index] + 0.59 * imgData[Index + 1] + 0.11 * imgData[Index + 2];
274
- for (k = 0; k < 3; k++) {
275
- current = imgData[Index + k];
276
- imgData[Index + k] = current + (terminal - current) * grayScale;
277
- }
278
- }
279
- imgData[Index] *= rCorrect;
280
- imgData[Index + 1] *= gCorrect;
281
- imgData[Index + 2] *= bCorrect;
282
- }
283
- }
284
- }
285
- ctx.putImageData(newImage, 0, 0);
286
- newDataUrl = canvas.toDataURL('image/jpeg');
287
- return [4 /*yield*/, $.ImageLoader(newDataUrl)];
288
- case 1:
289
- Picture = _b.sent();
290
- pictW = Picture.width, pictH = Picture.height;
291
- pictAsp = pictW / pictH;
292
- this.Picture = __assign(__assign({}, this.Picture), { elm: Picture, aspect: pictAsp, revisedAspect: this.pst.frame.aspect > pictAsp
293
- ? this.pst.frame.w / pictW
294
- : this.pst.frame.h / pictH });
295
- this.drawImage();
296
- return [2 /*return*/];
297
- }
298
- });
299
- });
300
- };
301
- CroppImage.prototype.drawImage = function (_imageX, _imageY) {
302
- var _a = this, use = _a.use, ctx = _a.Canvas.ctx, frame = _a.pst.frame;
303
- var ImageX = _imageX || this.pst.imageX;
304
- var ImageY = _imageY || this.pst.imageY;
305
- {
306
- var scale = this.scale.current / 100;
307
- var totalScale = this.Picture.revisedAspect * scale;
308
- var imgX = this.pst.centerX - ImageX * totalScale;
309
- var imgY = this.pst.centerY - ImageY * totalScale;
310
- var imgW = this.Picture.elm.width * totalScale;
311
- var imgH = this.Picture.elm.height * totalScale;
312
- {
313
- var minX = this.pst.frame.x + this.pst.frame.w - imgW;
314
- var maxX = this.pst.frame.x;
315
- var minY = this.pst.frame.y + this.pst.frame.h - imgH;
316
- var maxY = this.pst.frame.y;
317
- var extraX = 0;
318
- if (imgX < minX)
319
- extraX = imgX - minX;
320
- if (imgX > maxX)
321
- extraX = imgX - maxX;
322
- var extraY = 0;
323
- if (imgY < minY)
324
- extraY = imgY - minY;
325
- if (imgY > maxY)
326
- extraY = imgY - maxY;
327
- this.dragEffectInfo.origin.x += extraX / 2 / this.dragEffectInfo.frameExpandRate.x;
328
- this.dragEffectInfo.origin.y += extraY / 2 / this.dragEffectInfo.frameExpandRate.y;
329
- imgX = Math.min(Math.max(imgX, minX), maxX);
330
- imgY = Math.min(Math.max(imgY, minY), maxY);
331
- }
332
- this.pst.outImage = {
333
- x: imgX, y: imgY,
334
- w: imgW, h: imgH
335
- };
336
- ctx.clearRect(0, 0, this.Canvas.elm.width, this.Canvas.elm.height);
337
- ctx.drawImage(this.Picture.elm, 0, 0, this.Picture.elm.width, this.Picture.elm.height, imgX, imgY, imgW, imgH);
338
- }
339
- {
340
- if (use == 'profile') {
341
- ctx.fillStyle = 'rgba( 20,24,20,.3 )';
342
- ctx.beginPath();
343
- ctx.arc(this.Canvas.elm.width / 2, this.Canvas.elm.height / 2, this.Canvas.elm.width, 0, Math.PI * 2, true);
344
- ctx.arc(this.Canvas.elm.width / 2, this.Canvas.elm.height / 2, this.Canvas.elm.width / 3 * 2 / 2, 0, Math.PI * 2, false);
345
- ctx.closePath();
346
- ctx.fill();
347
- }
348
- else if (use == 'header') {
349
- ctx.fillStyle = 'rgba( 20,24,20,.3 )';
350
- }
351
- ctx.beginPath();
352
- ctx.moveTo(0, 0);
353
- ctx.lineTo(this.Canvas.elm.width, 0);
354
- ctx.lineTo(this.Canvas.elm.width, this.Canvas.elm.height);
355
- ctx.lineTo(0, this.Canvas.elm.height);
356
- ctx.lineTo(0, 0);
357
- ctx.closePath();
358
- ctx.lineTo(frame.x, frame.y);
359
- ctx.lineTo(frame.x, frame.y + frame.h);
360
- ctx.lineTo(frame.x + frame.w, frame.y + frame.h);
361
- ctx.lineTo(frame.x + frame.w, frame.y);
362
- ctx.lineTo(frame.x, frame.y);
363
- ctx.fill();
364
- var body = $(document.body);
365
- var themeColorHSL = body.getStyleProperty('--color-theme-hsl');
366
- ctx.lineWidth = this.Canvas.elm.width / 200;
367
- ctx.strokeStyle = "hsla( ".concat(themeColorHSL, ",1 )");
368
- ctx.strokeRect(frame.x, frame.y, frame.w, frame.h);
369
- }
370
- };
371
- CroppImage.prototype.export = function () {
372
- return __awaiter(this, void 0, void 0, function () {
373
- var _a, develops, Picture, _b, outImage, frame, ratioX, ratioY, Left, Right, Top, Bottom, Files, MimeType, index, _c, size, maxSize, width, height, Preview, previewCtx, dataUrl, blob, Ratio, file;
374
- return __generator(this, function (_d) {
375
- switch (_d.label) {
376
- case 0:
377
- _a = this, develops = _a.develops, Picture = _a.Picture, _b = _a.pst, outImage = _b.outImage, frame = _b.frame;
378
- ratioX = outImage.w / Picture.elm.width;
379
- ratioY = outImage.h / Picture.elm.height;
380
- Left = (frame.x - outImage.x) / ratioX;
381
- Right = (frame.x - outImage.x + frame.w) / ratioX;
382
- Top = (frame.y - outImage.y) / ratioY;
383
- Bottom = (frame.y - outImage.y + frame.h) / ratioY;
384
- Files = Array.from({ length: develops.length });
385
- MimeType = 'image/jpeg';
386
- index = 0;
387
- _d.label = 1;
388
- case 1:
389
- if (!(index < develops.length)) return [3 /*break*/, 6];
390
- _c = develops[index], size = _c.size, maxSize = _c.maxSize;
391
- maxSize = maxSize || {
392
- S: 1024 * 20,
393
- R: 1024 * 100,
394
- L: 1024 * 350
395
- }[size];
396
- width = {
397
- S: 144,
398
- R: 576,
399
- L: 1152
400
- }[size];
401
- height = this.use == 'profile' ? width : width / 3;
402
- Preview = document.createElement('canvas');
403
- Preview.width = width;
404
- Preview.height = height;
405
- previewCtx = Preview.getContext('2d');
406
- if (!previewCtx)
407
- return [2 /*return*/];
408
- previewCtx.clearRect(0, 0, width, height);
409
- previewCtx.drawImage(this.Picture.elm, Left, Top, Right - Left, Bottom - Top, 0, 0, width, height);
410
- dataUrl = Preview.toDataURL(MimeType);
411
- return [4 /*yield*/, dataUrl.toBlob(MimeType)];
412
- case 2:
413
- blob = _d.sent();
414
- if (!blob)
415
- return [2 /*return*/];
416
- if (!(blob.size >= maxSize)) return [3 /*break*/, 4];
417
- Ratio = maxSize / blob.size;
418
- dataUrl = Preview.toDataURL(MimeType, Ratio * 0.92);
419
- return [4 /*yield*/, dataUrl.toBlob(MimeType)];
420
- case 3:
421
- blob = _d.sent();
422
- if (!blob)
423
- return [2 /*return*/];
424
- _d.label = 4;
425
- case 4:
426
- file = new File([blob], this.val_file.name, { type: MimeType });
427
- Files[index] = file;
428
- _d.label = 5;
429
- case 5:
430
- index++;
431
- return [3 /*break*/, 1];
432
- case 6: return [2 /*return*/, Files];
433
- }
434
- });
435
- });
436
- };
437
- return CroppImage;
438
- }());
439
- var Comps = {
440
- Core: function (params) {
441
- var val_file = params.val_file, options = params.options, finishedCallback = params.finishedCallback, abortCallback = params.abortCallback;
442
- var use = options.use, _a = options.develops, develops = _a === void 0 ? [] : _a;
443
- var _b = __read(useState($.uuidGen(32)), 1), val_componentID = _b[0];
444
- var DefaultOptions = {
445
- scale: {
446
- default: 125,
447
- min: 100,
448
- max: 300
449
- },
450
- rotate: 0,
451
- grayScale: 0,
452
- tone: 0
453
- };
454
- var _c = __read(useState(DefaultOptions.scale.default), 2), val_scale = _c[0], set_scale = _c[1];
455
- var _d = __read(useState(DefaultOptions.rotate), 2), val_rotate = _d[0], set_rotate = _d[1];
456
- var _e = __read(useState(DefaultOptions.grayScale), 2), val_grayScale = _e[0], set_grayScale = _e[1];
457
- var _f = __read(useState(DefaultOptions.tone), 2), val_tone = _f[0], set_tone = _f[1];
458
- useEffect(function () {
459
- _export_1.useStore.set({
460
- key: val_componentID,
461
- value: {}
462
- });
463
- (function () { return __awaiter(void 0, void 0, void 0, function () {
464
- var target, dataUrl, Canvas, __Cropper, _a, UserEffectStart, DragEffect, EventEnd;
465
- var _b, _c;
466
- return __generator(this, function (_d) {
467
- switch (_d.label) {
468
- case 0:
469
- amotify.fn.Loader.fn.corner.active();
470
- return [4 /*yield*/, val_file.read()];
471
- case 1:
472
- target = (_d.sent()).target;
473
- if (!target)
474
- return [2 /*return*/];
475
- dataUrl = target.result;
476
- Canvas = $('#Canvas-' + val_componentID)[0];
477
- if (!Canvas)
478
- return [2 /*return*/];
479
- _a = CroppImage.bind;
480
- _b = {
481
- set_scale: set_scale,
482
- val_file: val_file,
483
- develops: develops,
484
- use: use,
485
- scale: DefaultOptions.scale,
486
- componentID: val_componentID,
487
- canvas: Canvas
488
- };
489
- _c = {};
490
- return [4 /*yield*/, $.ImageLoader(dataUrl)];
491
- case 2:
492
- __Cropper = new (_a.apply(CroppImage, [void 0, (_b.picture = (_c.image = _d.sent(),
493
- _c.grayScale = DefaultOptions.grayScale,
494
- _c.tone = DefaultOptions.tone,
495
- _c.rotate = DefaultOptions.rotate,
496
- _c),
497
- _b)]))();
498
- _export_1.useStore.set({
499
- key: val_componentID,
500
- value: {
501
- Instance: __Cropper
502
- }
503
- });
504
- UserEffectStart = function (event) {
505
- event.preventDefault();
506
- if (event.touches && event.touches.length > 1) {
507
- __Cropper.pinchEffect({
508
- eventType: 'start',
509
- event: event
510
- });
511
- $(document)
512
- .addEvent({
513
- eventType: 'touchmove', eventID: 'CropperEffectMove', option: { passive: false },
514
- callback: function (event) {
515
- event.preventDefault();
516
- __Cropper.pinchEffect({
517
- eventType: 'move',
518
- event: event
519
- });
520
- },
521
- })
522
- .addEvent({
523
- eventType: 'touchend', eventID: 'CropperEffectEnd', option: { passive: false },
524
- callback: EventEnd,
525
- });
526
- }
527
- else {
528
- __Cropper.dragEffect(__assign({ eventType: 'start' }, $.getCursor(event)));
529
- var type = event.type;
530
- $(document)
531
- .addEvent({
532
- eventType: type == 'touchstart' ? 'touchmove' : 'mousemove', eventID: 'CropperEffectMove', option: { passive: false },
533
- callback: function (event) {
534
- DragEffect('move', event);
535
- },
536
- })
537
- .addEvent({
538
- eventType: type == 'touchstart' ? 'touchend' : 'mouseup', eventID: 'CropperEffectEnd', option: { passive: false },
539
- callback: function (event) {
540
- DragEffect('end', event);
541
- EventEnd(event);
542
- },
543
- });
544
- }
545
- };
546
- DragEffect = function (eventType, event) {
547
- event.preventDefault();
548
- __Cropper.dragEffect(__assign({ eventType: eventType }, $.getCursor(event)));
549
- };
550
- EventEnd = function (event) {
551
- event.preventDefault();
552
- $(document).removeEvent([
553
- 'CropperEffectMove',
554
- 'CropperEffectEnd'
555
- ]);
556
- };
557
- $(Canvas)
558
- .removeEvent([
559
- 'CropperMouseWheel',
560
- 'CropperTouchStart',
561
- 'CropperMouseDown'
562
- ])
563
- .addEvent({
564
- eventID: 'CropperMouseWheel',
565
- eventType: 'wheel',
566
- callback: function (event) {
567
- event.preventDefault();
568
- var bitScale = Number(event.wheelDelta * 0.04);
569
- var nextScale = __Cropper.scale.current + bitScale;
570
- nextScale = Math.max(nextScale, __Cropper.scale.min);
571
- nextScale = Math.min(nextScale, __Cropper.scale.max);
572
- set_scale(nextScale);
573
- },
574
- option: { passive: false }
575
- })
576
- .addEvent({
577
- eventType: 'touchstart', eventID: 'CropperTouchStart',
578
- callback: UserEffectStart, option: { passive: false }
579
- })
580
- .addEvent({
581
- eventType: 'mousedown', eventID: 'CropperMouseDown',
582
- callback: UserEffectStart, option: { passive: false }
583
- });
584
- setTimeout(function () {
585
- amotify.fn.Loader.fn.corner.stop();
586
- }, 1000);
587
- return [2 /*return*/];
588
- }
589
- });
590
- }); })();
591
- }, [val_file.id]);
592
- useEffect(function () {
593
- var _a;
594
- var Instance = (_a = _export_1.useStore.get(val_componentID)) === null || _a === void 0 ? void 0 : _a.Instance;
595
- if (Instance) {
596
- Instance.updateScale(val_scale);
597
- }
598
- }, [val_scale]);
599
- useEffect(function () {
600
- var _a;
601
- var Instance = (_a = _export_1.useStore.get(val_componentID)) === null || _a === void 0 ? void 0 : _a.Instance;
602
- if (Instance) {
603
- Instance.updateFilter({
604
- grayScale: val_grayScale,
605
- tone: val_tone,
606
- rotate: val_rotate
607
- });
608
- }
609
- }, [val_grayScale, val_tone, val_rotate]);
610
- return (React.createElement(_export_4.Sheet.Comps.Body, null,
611
- React.createElement(_export_2.Flex, { className: [style_module_scss_1.default.Wrap, 'Use_' + use].join(' '), flexWrap: false, position: 'relative', overflow: 'hidden', borderRadius: 'inherit', boxShadow: 3, UnderBreakPointStyles: {
612
- flexType: 'col'
613
- } },
614
- React.createElement(_export_2.Box, { flexGrid: 3, UnderBreakPointStyles: {
615
- width: 1,
616
- padding: 2
617
- } },
618
- React.createElement(_export_2.Box, { overflow: 'hidden', position: 'relative', backgroundColor: '4.layer.darken', freeCSS: {
619
- zIndex: 1
620
- }, UnderBreakPointStyles: {
621
- borderRadius: '1.tone.primary'
622
- } },
623
- React.createElement("canvas", { width: '2400', height: use == 'profile' ? '2400' : '1800', className: style_module_scss_1.default.Canvas, id: 'Canvas-' + val_componentID }))),
624
- React.createElement(_export_3.Column, { gap: 0, flexGrid: 2, boxShadow: 3, UnderBreakPointStyles: {
625
- width: 1,
626
- maxWidth: 'unset'
627
- }, freeCSS: {
628
- maxWidth: 12 * 28
629
- } },
630
- React.createElement(_export_3.Column, { gap: 1, flexSizing: 0, overflow: 'auto', padding: 1.5, UnderBreakPointStyles: {
631
- flexSizing: 'none'
632
- } },
633
- React.createElement(_export_2.Box, { flexSizing: 'none', fontSize: '4.thirdTitle', isBoldFont: true }, "\u30D5\u30A3\u30EB\u30BF\u30FC"),
634
- React.createElement(Comps.SettingRegion, { DefaultOptions: DefaultOptions, val_scale: val_scale, set_scale: set_scale, val_tone: val_tone, set_tone: set_tone, val_grayScale: val_grayScale, set_grayScale: set_grayScale, val_rotate: val_rotate, set_rotate: set_rotate })),
635
- React.createElement(_export_2.Flex, { padding: 1.5, flexSizing: 'none', gap: 1, borderTop: true },
636
- React.createElement(_export_4.Buttons.Button.Border.R, { flexGrid: 1, onClick: function () {
637
- abortCallback();
638
- } }, "\u30AD\u30E3\u30F3\u30BB\u30EB"),
639
- React.createElement(_export_4.Buttons.Button.Prime.R, { flexGrid: 2, onClick: function () { return __awaiter(void 0, void 0, void 0, function () {
640
- var Instance, Files;
641
- var _a;
642
- return __generator(this, function (_b) {
643
- switch (_b.label) {
644
- case 0:
645
- Instance = (_a = _export_1.useStore.get(val_componentID)) === null || _a === void 0 ? void 0 : _a.Instance;
646
- if (!Instance)
647
- return [2 /*return*/];
648
- amotify.fn.Loader.fn.mini.active('CropperExportation');
649
- return [4 /*yield*/, Instance.export()];
650
- case 1:
651
- Files = _b.sent();
652
- setTimeout(function () {
653
- amotify.fn.Loader.fn.mini.stop('CropperExportation');
654
- finishedCallback(Files);
655
- }, 3000);
656
- return [2 /*return*/];
657
- }
658
- });
659
- }); } },
660
- React.createElement(_export_3.Row.Center, { gap: '1/2' },
661
- React.createElement(_export_4.Loader.White.R, { loaderID: 'CropperExportation' }),
662
- "\u6C7A\u5B9A")))))));
663
- },
664
- SettingRegion: function (params) {
665
- var ToneList = [];
666
- for (var index = 1; index <= 10; index++) {
667
- ToneList.push({
668
- value: index,
669
- label: React.createElement(React.Fragment, null,
670
- React.createElement(_export_2.Box, { className: [
671
- style_module_scss_1.default.ToneBall,
672
- style_module_scss_1.default['ToneBall_' + index]
673
- ].join(' ') }),
674
- React.createElement(_export_2.Box, { textAlign: 'center', flexSizing: 'auto' }, ['', '暖色', '寒色', 'セピア', 'シアン', 'マゼンタ', 'イエロー', 'オリジナル1', 'オリジナル2', 'オリジナル3', 'オリジナル4'][index]))
675
- });
676
- }
677
- return (React.createElement(React.Fragment, null,
678
- React.createElement(_export_3.Column, { gap: '1/3' },
679
- React.createElement(_export_2.Box, null,
680
- React.createElement(_export_2.FAIcon.Rotate, { fontSize: '3.paragraph' }),
681
- " Rotate"),
682
- React.createElement(_export_3.Row.Separate, { flexChilds: 'even', paddingLeft: 2 },
683
- React.createElement(_export_4.Buttons.Button.Border.R, { onClick: function () {
684
- var next = params.val_rotate - 90;
685
- if (next < 0)
686
- next += 360;
687
- params.set_rotate(next);
688
- } },
689
- React.createElement(_export_2.FAIcon.RotateLeft, null),
690
- " \u5DE6\u306B\u56DE\u8EE2"),
691
- React.createElement(_export_4.Buttons.Button.Border.R, { onClick: function () {
692
- params.set_rotate((params.val_rotate + 90) % 360);
693
- } },
694
- "\u53F3\u306B\u56DE\u8EE2 ",
695
- React.createElement(_export_2.FAIcon.RotateRight, null)))),
696
- React.createElement(_export_3.Column, { gap: '1/3' },
697
- React.createElement(_export_2.Box, null,
698
- React.createElement(_export_2.FAIcon, { fontSize: '3.paragraph', d: 'magnifying-glass-plus' }),
699
- " Zoom"),
700
- React.createElement(_export_2.Box, { paddingLeft: 2 },
701
- React.createElement(_export_4.Input.Slider, { override: 'force', value: params.val_scale - 100, min: params.DefaultOptions.scale.min - 100, max: params.DefaultOptions.scale.max - 100, step: 25, onUpdateValidValue: function (_a) {
702
- var eventType = _a.eventType, value = _a.value;
703
- params.set_scale(value + 100);
704
- }, legends: {
705
- enable: true,
706
- custom: function (value) {
707
- var scale = Math.round(100 + value);
708
- return 'x' + scale / 100;
709
- }
710
- } }))),
711
- React.createElement(_export_3.Column, { gap: '1/3' },
712
- React.createElement(_export_2.Box, null,
713
- React.createElement(_export_2.FAIcon, { fontSize: '3.paragraph', d: 'palette' }),
714
- " Gray Scale"),
715
- React.createElement(_export_2.Box, { paddingLeft: 2 },
716
- React.createElement(_export_4.Input.Slider, { value: params.val_grayScale, min: 0, max: 100, step: 25, onUpdateValidValue: function (_a) {
717
- var value = _a.value;
718
- params.set_grayScale(value);
719
- }, legends: {
720
- enable: true,
721
- custom: function (value) { return (value + '%'); }
722
- } }))),
723
- React.createElement(_export_3.Column, { gap: '1/3' },
724
- React.createElement(_export_2.Box, null,
725
- React.createElement(_export_2.FAIcon, { fontSize: '3.paragraph', d: 'bars-staggered' }),
726
- " Tone"),
727
- React.createElement(_export_2.Box, { paddingLeft: 2 },
728
- React.createElement(_export_4.Input.Radio, { value: params.val_tone, gap: '1/2', cellStyles: {
729
- isRounded: true,
730
- borderWidth: 2,
731
- borderColor: '1.thin',
732
- padding: '1/2',
733
- paddingRight: 1,
734
- fontSize: '1.mini',
735
- gap: '1/3',
736
- flexSizing: 'auto'
737
- }, options: __spreadArray([
738
- {
739
- value: 0, label: 'なし',
740
- padding: ['1/2', 1],
741
- flexCenter: true
742
- }
743
- ], __read(ToneList), false), onUpdateValidValue: function (_a) {
744
- var value = _a.value;
745
- params.set_tone(value[0]);
746
- } })))));
747
- }
748
- };
749
- exports.Cropper = {
750
- open: function (params) { return __awaiter(void 0, void 0, void 0, function () {
751
- var Image, sheetID;
752
- return __generator(this, function (_a) {
753
- switch (_a.label) {
754
- case 0: return [4 /*yield*/, _export_4.Input.File.fn.openDialog({
755
- // accept: 'image/jpeg,image/jpg,image/png,image/gif',
756
- accept: 'image',
757
- multiple: false
758
- })];
759
- case 1:
760
- Image = _a.sent();
761
- sheetID = 'CropperImage';
762
- amotify.fn.Sheet.open({
763
- sheetID: sheetID,
764
- type: 'normal.middleCenter',
765
- size: '3L',
766
- freeCSS: {
767
- width: params.use == 'header' ? 12 * 100 : 12 * 80
768
- },
769
- content: React.createElement(Comps.Core, { val_file: Image[0], options: params, finishedCallback: function (files) {
770
- amotify.fn.Sheet.close(sheetID);
771
- params.onProcessFinished(files);
772
- }, abortCallback: function () {
773
- amotify.fn.Sheet.close(sheetID);
774
- } }),
775
- closeOption: {
776
- escapeKeyDown: false
777
- }
778
- });
779
- return [2 /*return*/];
780
- }
781
- });
782
- }); }
783
- };