argous 1.2.134 → 1.2.135

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 (256) hide show
  1. package/dist/actions/index.d.ts +58 -0
  2. package/dist/actions/index.js +59 -0
  3. package/dist/api/WebSocket.d.ts +25 -0
  4. package/dist/api/WebSocket.js +170 -0
  5. package/dist/api/index.d.ts +63 -0
  6. package/dist/api/index.js +762 -0
  7. package/dist/api/ws.d.ts +4 -0
  8. package/dist/api/ws.js +36 -0
  9. package/dist/components/Alert/Alert.d.ts +8 -0
  10. package/dist/components/Alert/Alert.js +68 -0
  11. package/dist/components/Alert/index.d.ts +2 -0
  12. package/dist/components/Alert/index.js +8 -0
  13. package/dist/components/ArgousAction/ArgousAction.d.ts +8 -0
  14. package/dist/components/ArgousAction/ArgousAction.js +87 -0
  15. package/dist/components/ArgousAction/index.d.ts +2 -0
  16. package/dist/components/ArgousAction/index.js +8 -0
  17. package/dist/components/ArgousAvatar/ArgousAvatar.d.ts +14 -0
  18. package/dist/components/ArgousAvatar/ArgousAvatar.js +124 -0
  19. package/dist/components/ArgousAvatar/index.d.ts +2 -0
  20. package/dist/components/ArgousAvatar/index.js +8 -0
  21. package/dist/components/ArgousComplexPagination/ArgousComplexPagination.d.ts +76 -0
  22. package/dist/components/ArgousComplexPagination/ArgousComplexPagination.js +156 -0
  23. package/dist/components/ArgousComplexPagination/index.d.ts +2 -0
  24. package/dist/components/ArgousComplexPagination/index.js +8 -0
  25. package/dist/components/ArgousComplexTable/ArgousComplexTable.d.ts +131 -0
  26. package/dist/components/ArgousComplexTable/ArgousComplexTable.js +333 -0
  27. package/dist/components/ArgousComplexTable/index.d.ts +2 -0
  28. package/dist/components/ArgousComplexTable/index.js +8 -0
  29. package/dist/components/ArgousComplexTableBody/ArgousComplexTableBody.d.ts +177 -0
  30. package/dist/components/ArgousComplexTableBody/ArgousComplexTableBody.js +155 -0
  31. package/dist/components/ArgousComplexTableBody/index.d.ts +2 -0
  32. package/dist/components/ArgousComplexTableBody/index.js +8 -0
  33. package/dist/components/ArgousComplexTableHead/ArgousComplexTableHead.d.ts +73 -0
  34. package/dist/components/ArgousComplexTableHead/ArgousComplexTableHead.js +88 -0
  35. package/dist/components/ArgousComplexTableHead/index.d.ts +2 -0
  36. package/dist/components/ArgousComplexTableHead/index.js +8 -0
  37. package/dist/components/ArgousComplexTableToolbar/ArgousComplexTableToolBar.d.ts +58 -0
  38. package/dist/components/ArgousComplexTableToolbar/ArgousComplexTableToolBar.js +70 -0
  39. package/dist/components/ArgousComplexTableToolbar/index.d.ts +2 -0
  40. package/dist/components/ArgousComplexTableToolbar/index.js +8 -0
  41. package/dist/components/ArgousInput/ArgousInput.d.ts +8 -0
  42. package/dist/components/ArgousInput/ArgousInput.js +578 -0
  43. package/dist/components/ArgousInput/index.d.ts +2 -0
  44. package/dist/components/ArgousInput/index.js +8 -0
  45. package/dist/components/ArgousPagination/ArgousPagination.d.ts +8 -0
  46. package/dist/components/ArgousPagination/ArgousPagination.js +29 -0
  47. package/dist/components/ArgousPagination/index.d.ts +2 -0
  48. package/dist/components/ArgousPagination/index.js +8 -0
  49. package/dist/components/ArgousProgressBar/ArgousProgressBar.d.ts +22 -0
  50. package/dist/components/ArgousProgressBar/ArgousProgressBar.js +162 -0
  51. package/dist/components/ArgousProgressBar/index.d.ts +2 -0
  52. package/dist/components/ArgousProgressBar/index.js +8 -0
  53. package/dist/components/ArgousSimpleTable/ArgousSimpleTable.d.ts +8 -0
  54. package/dist/components/ArgousSimpleTable/ArgousSimpleTable.js +201 -0
  55. package/dist/components/ArgousSimpleTable/index.d.ts +2 -0
  56. package/dist/components/ArgousSimpleTable/index.js +8 -0
  57. package/dist/components/AutoComplete/AutoComplete.d.ts +8 -0
  58. package/dist/components/AutoComplete/AutoComplete.js +185 -0
  59. package/dist/components/AutoComplete/index.d.ts +2 -0
  60. package/dist/components/AutoComplete/index.js +8 -0
  61. package/dist/components/BarChart/BarChart.d.ts +8 -0
  62. package/dist/components/BarChart/BarChart.js +125 -0
  63. package/dist/components/BarChart/index.d.ts +2 -0
  64. package/dist/components/BarChart/index.js +8 -0
  65. package/dist/components/BarraFerramentas/BarraFerramentas.d.ts +21 -0
  66. package/dist/components/BarraFerramentas/BarraFerramentas.js +228 -0
  67. package/dist/components/BarraFerramentas/index.d.ts +2 -0
  68. package/dist/components/BarraFerramentas/index.js +8 -0
  69. package/dist/components/Button/Button.d.ts +8 -0
  70. package/dist/components/Button/Button.js +144 -0
  71. package/dist/components/Button/index.d.ts +2 -0
  72. package/dist/components/Button/index.js +8 -0
  73. package/dist/components/Cabecalho/Cabecalho.d.ts +8 -0
  74. package/dist/components/Cabecalho/Cabecalho.js +231 -0
  75. package/dist/components/Cabecalho/index.d.ts +2 -0
  76. package/dist/components/Cabecalho/index.js +8 -0
  77. package/dist/components/Calendar/Calendar.d.ts +8 -0
  78. package/dist/components/Calendar/Calendar.js +171 -0
  79. package/dist/components/Calendar/index.d.ts +2 -0
  80. package/dist/components/Calendar/index.js +8 -0
  81. package/dist/components/CartaoUsuario/CartaoUsuario.d.ts +9 -0
  82. package/dist/components/CartaoUsuario/CartaoUsuario.js +165 -0
  83. package/dist/components/CartaoUsuario/index.d.ts +2 -0
  84. package/dist/components/CartaoUsuario/index.js +8 -0
  85. package/dist/components/Collapse/Collapse.d.ts +60 -0
  86. package/dist/components/Collapse/Collapse.js +290 -0
  87. package/dist/components/Collapse/index.d.ts +3 -0
  88. package/dist/components/Collapse/index.js +8 -0
  89. package/dist/components/Compartilhar/Compartilhar.d.ts +7 -0
  90. package/dist/components/Compartilhar/Compartilhar.js +266 -0
  91. package/dist/components/Compartilhar/index.d.ts +2 -0
  92. package/dist/components/Compartilhar/index.js +8 -0
  93. package/dist/components/ConfirmModal/BasicModal.d.ts +38 -0
  94. package/dist/components/ConfirmModal/BasicModal.js +29 -0
  95. package/dist/components/ConfirmModal/ModalProvider.d.ts +5 -0
  96. package/dist/components/ConfirmModal/ModalProvider.js +108 -0
  97. package/dist/components/ConfirmModal/WrapperModal.d.ts +18 -0
  98. package/dist/components/ConfirmModal/WrapperModal.js +41 -0
  99. package/dist/components/ConfirmModal/index.d.ts +20 -0
  100. package/dist/components/ConfirmModal/index.js +25 -0
  101. package/dist/components/DropArea/DropArea.d.ts +21 -0
  102. package/dist/components/DropArea/DropArea.js +149 -0
  103. package/dist/components/DropArea/Html5FileSelector.d.ts +16 -0
  104. package/dist/components/DropArea/Html5FileSelector.js +229 -0
  105. package/dist/components/DropArea/index.d.ts +2 -0
  106. package/dist/components/DropArea/index.js +8 -0
  107. package/dist/components/Editor/Events.d.ts +79 -0
  108. package/dist/components/Editor/Events.js +9 -0
  109. package/dist/components/Editor/ScriptLoader.d.ts +20 -0
  110. package/dist/components/Editor/ScriptLoader.js +70 -0
  111. package/dist/components/Editor/TinyMCE.d.ts +10 -0
  112. package/dist/components/Editor/TinyMCE.js +16 -0
  113. package/dist/components/Editor/Utils.d.ts +19 -0
  114. package/dist/components/Editor/Utils.js +62 -0
  115. package/dist/components/Editor/components/Editor.d.ts +67 -0
  116. package/dist/components/Editor/components/Editor.js +351 -0
  117. package/dist/components/Editor/components/EditorPropTypes.d.ts +18 -0
  118. package/dist/components/Editor/components/EditorPropTypes.js +110 -0
  119. package/dist/components/Editor/index.d.ts +9 -0
  120. package/dist/components/Editor/index.js +12 -0
  121. package/dist/components/Editor/tinymce/tinymce.d.ts +2963 -0
  122. package/dist/components/FilePreparer/FilePreparer.d.ts +26 -0
  123. package/dist/components/FilePreparer/FilePreparer.js +279 -0
  124. package/dist/components/FilePreparer/index.d.ts +2 -0
  125. package/dist/components/FilePreparer/index.js +8 -0
  126. package/dist/components/FileUploader/FileUploader.d.ts +9 -0
  127. package/dist/components/FileUploader/FileUploader.js +445 -0
  128. package/dist/components/FileUploader/index.d.ts +2 -0
  129. package/dist/components/FileUploader/index.js +8 -0
  130. package/dist/components/FormVisualizer/FormVisualizer.d.ts +92 -0
  131. package/dist/components/FormVisualizer/FormVisualizer.js +264 -0
  132. package/dist/components/FormVisualizer/index.d.ts +2 -0
  133. package/dist/components/FormVisualizer/index.js +8 -0
  134. package/dist/components/Highlight/Highlight.d.ts +7 -0
  135. package/dist/components/Highlight/Highlight.js +75 -0
  136. package/dist/components/Highlight/index.d.ts +2 -0
  137. package/dist/components/Highlight/index.js +8 -0
  138. package/dist/components/ImageResize/ImageResize.d.ts +28 -0
  139. package/dist/components/ImageResize/ImageResize.js +472 -0
  140. package/dist/components/ImageResize/index.d.ts +2 -0
  141. package/dist/components/ImageResize/index.js +8 -0
  142. package/dist/components/ImageResizeButton/ImageResizeButton.d.ts +26 -0
  143. package/dist/components/ImageResizeButton/ImageResizeButton.js +89 -0
  144. package/dist/components/ImageResizeButton/index.d.ts +2 -0
  145. package/dist/components/ImageResizeButton/index.js +8 -0
  146. package/dist/components/Input/Input.d.ts +8 -0
  147. package/dist/components/Input/Input.js +328 -0
  148. package/dist/components/Input/index.d.ts +2 -0
  149. package/dist/components/Input/index.js +8 -0
  150. package/dist/components/InputTags/InputTags.d.ts +8 -0
  151. package/dist/components/InputTags/InputTags.js +129 -0
  152. package/dist/components/InputTags/index.d.ts +2 -0
  153. package/dist/components/InputTags/index.js +8 -0
  154. package/dist/components/ListSelect/ListSelect.d.ts +8 -0
  155. package/dist/components/ListSelect/ListSelect.js +126 -0
  156. package/dist/components/ListSelect/index.d.ts +2 -0
  157. package/dist/components/ListSelect/index.js +8 -0
  158. package/dist/components/MaterialButton/MaterialButton.d.ts +13 -0
  159. package/dist/components/MaterialButton/MaterialButton.js +192 -0
  160. package/dist/components/MaterialButton/index.d.ts +2 -0
  161. package/dist/components/MaterialButton/index.js +8 -0
  162. package/dist/components/MenuBar/MenuBar.d.ts +8 -0
  163. package/dist/components/MenuBar/MenuBar.js +157 -0
  164. package/dist/components/MenuBar/index.d.ts +2 -0
  165. package/dist/components/MenuBar/index.js +8 -0
  166. package/dist/components/MonthPicker/MonthPicker.d.ts +8 -0
  167. package/dist/components/MonthPicker/MonthPicker.js +288 -0
  168. package/dist/components/MonthPicker/index.d.ts +2 -0
  169. package/dist/components/MonthPicker/index.js +8 -0
  170. package/dist/components/MultipleSelect/MultipleSelect.d.ts +8 -0
  171. package/dist/components/MultipleSelect/MultipleSelect.js +139 -0
  172. package/dist/components/MultipleSelect/index.d.ts +2 -0
  173. package/dist/components/MultipleSelect/index.js +8 -0
  174. package/dist/components/OtpInput/OtpInput.d.ts +18 -0
  175. package/dist/components/OtpInput/OtpInput.js +207 -0
  176. package/dist/components/OtpInput/index.d.ts +2 -0
  177. package/dist/components/OtpInput/index.js +8 -0
  178. package/dist/components/OutputText/OutputText.d.ts +8 -0
  179. package/dist/components/OutputText/OutputText.js +89 -0
  180. package/dist/components/OutputText/index.d.ts +2 -0
  181. package/dist/components/OutputText/index.js +8 -0
  182. package/dist/components/Pagination/Pagination.d.ts +8 -0
  183. package/dist/components/Pagination/Pagination.js +64 -0
  184. package/dist/components/Pagination/index.d.ts +2 -0
  185. package/dist/components/Pagination/index.js +8 -0
  186. package/dist/components/Programa/Programa.d.ts +31 -0
  187. package/dist/components/Programa/Programa.js +201 -0
  188. package/dist/components/Programa/index.d.ts +2 -0
  189. package/dist/components/Programa/index.js +8 -0
  190. package/dist/components/ProgressBar/ProgressBar.d.ts +8 -0
  191. package/dist/components/ProgressBar/ProgressBar.js +98 -0
  192. package/dist/components/ProgressBar/index.d.ts +2 -0
  193. package/dist/components/ProgressBar/index.js +8 -0
  194. package/dist/components/Select/Select.d.ts +8 -0
  195. package/dist/components/Select/Select.js +142 -0
  196. package/dist/components/Select/index.d.ts +2 -0
  197. package/dist/components/Select/index.js +8 -0
  198. package/dist/components/SimpleTable/SimpleTable.d.ts +13 -0
  199. package/dist/components/SimpleTable/SimpleTable.js +390 -0
  200. package/dist/components/SimpleTable/index.d.ts +2 -0
  201. package/dist/components/SimpleTable/index.js +10 -0
  202. package/dist/components/Stepper/Stepper.d.ts +54 -0
  203. package/dist/components/Stepper/Stepper.js +157 -0
  204. package/dist/components/Stepper/index.d.ts +2 -0
  205. package/dist/components/Stepper/index.js +8 -0
  206. package/dist/components/TablePicker/TablePicker.d.ts +8 -0
  207. package/dist/components/TablePicker/TablePicker.js +222 -0
  208. package/dist/components/TablePicker/index.d.ts +2 -0
  209. package/dist/components/TablePicker/index.js +8 -0
  210. package/dist/components/Tabs/Tabs.d.ts +8 -0
  211. package/dist/components/Tabs/Tabs.js +76 -0
  212. package/dist/components/Tabs/index.d.ts +2 -0
  213. package/dist/components/Tabs/index.js +8 -0
  214. package/dist/components/TextArea/TextArea.d.ts +8 -0
  215. package/dist/components/TextArea/TextArea.js +148 -0
  216. package/dist/components/TextArea/index.d.ts +2 -0
  217. package/dist/components/TextArea/index.js +8 -0
  218. package/dist/components/ThreadLog/ThreadLog.d.ts +8 -0
  219. package/dist/components/ThreadLog/ThreadLog.js +225 -0
  220. package/dist/components/ThreadLog/index.d.ts +2 -0
  221. package/dist/components/ThreadLog/index.js +8 -0
  222. package/dist/components/UtilAutoComplete/UtilAutoComplete.d.ts +93 -0
  223. package/dist/components/UtilAutoComplete/UtilAutoComplete.js +188 -0
  224. package/dist/components/UtilAutoComplete/index.d.ts +2 -0
  225. package/dist/components/UtilAutoComplete/index.js +8 -0
  226. package/dist/components/index.d.ts +148 -0
  227. package/dist/components/index.js +162 -0
  228. package/dist/fieldsRedux/createField.d.ts +8 -0
  229. package/dist/fieldsRedux/createField.js +149 -0
  230. package/dist/fieldsRedux/fieldsRedux.d.ts +71 -0
  231. package/dist/fieldsRedux/fieldsRedux.js +436 -0
  232. package/dist/fieldsRedux/index.d.ts +4 -0
  233. package/dist/fieldsRedux/index.js +27 -0
  234. package/dist/fieldsRedux/passFields.d.ts +5 -0
  235. package/dist/fieldsRedux/passFields.js +107 -0
  236. package/dist/reducers/argous.d.ts +76 -0
  237. package/dist/reducers/argous.js +63 -0
  238. package/dist/reducers/index.d.ts +4 -0
  239. package/dist/reducers/index.js +9 -0
  240. package/dist/types.d.ts +144 -0
  241. package/dist/utils/api.d.ts +29 -0
  242. package/dist/utils/api.js +255 -0
  243. package/dist/utils/config.d.ts +3 -0
  244. package/dist/utils/config.js +13 -0
  245. package/dist/utils/date.d.ts +8 -0
  246. package/dist/utils/date.js +60 -0
  247. package/dist/utils/index.d.ts +61 -0
  248. package/dist/utils/index.js +383 -0
  249. package/dist/utils/rippleEffect.d.ts +2 -0
  250. package/dist/utils/rippleEffect.js +173 -0
  251. package/dist/utils/store.d.ts +3 -0
  252. package/dist/utils/store.js +12 -0
  253. package/dist/utils/xmlToJson.d.ts +2 -0
  254. package/dist/utils/xmlToJson.js +158 -0
  255. package/lib/api/index.js +16 -0
  256. package/package.json +1 -1
@@ -0,0 +1,229 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ var __generator = (this && this.__generator) || function (thisArg, body) {
12
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
13
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
14
+ function verb(n) { return function (v) { return step([n, v]); }; }
15
+ function step(op) {
16
+ if (f) throw new TypeError("Generator is already executing.");
17
+ while (_) try {
18
+ 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;
19
+ if (y = 0, t) op = [op[0] & 2, t.value];
20
+ switch (op[0]) {
21
+ case 0: case 1: t = op; break;
22
+ case 4: _.label++; return { value: op[1], done: false };
23
+ case 5: _.label++; y = op[1]; op = [0]; continue;
24
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
25
+ default:
26
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
27
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
28
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
29
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
30
+ if (t[2]) _.ops.pop();
31
+ _.trys.pop(); continue;
32
+ }
33
+ op = body.call(thisArg, _);
34
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
35
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
36
+ }
37
+ };
38
+ Object.defineProperty(exports, "__esModule", { value: true });
39
+ exports.getDroppedOrSelectedFiles = exports.getDataTransferFiles = void 0;
40
+ var DEFAULT_FILES_TO_IGNORE = [
41
+ '.DS_Store',
42
+ 'Thumbs.db' // Windows indexing file
43
+ ];
44
+ // map of common (mostly media types) mime types to use when the browser does not supply the mime type
45
+ var EXTENSION_TO_MIME_TYPE_MAP = {
46
+ avi: 'video/avi',
47
+ gif: 'image/gif',
48
+ ico: 'image/x-icon',
49
+ jpeg: 'image/jpeg',
50
+ jpg: 'image/jpeg',
51
+ mkv: 'video/x-matroska',
52
+ mov: 'video/quicktime',
53
+ mp4: 'video/mp4',
54
+ pdf: 'application/pdf',
55
+ png: 'image/png',
56
+ zip: 'application/zip'
57
+ };
58
+ function shouldIgnoreFile(file) {
59
+ return DEFAULT_FILES_TO_IGNORE.indexOf(file.name) >= 0;
60
+ }
61
+ function copyString(aString) {
62
+ return (" " + aString).slice(1);
63
+ }
64
+ function traverseDirectory(entry) {
65
+ var reader = entry.createReader();
66
+ // Resolved when the entire directory is traversed
67
+ return new Promise(function (resolveDirectory) {
68
+ var iterationAttempts = [];
69
+ var errorHandler = function () { };
70
+ function readEntries() {
71
+ // According to the FileSystem API spec, readEntries() must be called until
72
+ // it calls the callback with an empty array.
73
+ reader.readEntries(function (batchEntries) {
74
+ if (!batchEntries.length) {
75
+ // Done iterating this particular directory
76
+ resolveDirectory(Promise.all(iterationAttempts));
77
+ }
78
+ else {
79
+ // Add a list of promises for each directory entry. If the entry is itself
80
+ // a directory, then that promise won't resolve until it is fully traversed.
81
+ iterationAttempts.push(Promise.all(batchEntries.map(function (batchEntry) {
82
+ if (batchEntry.isDirectory) {
83
+ return traverseDirectory(batchEntry);
84
+ }
85
+ return Promise.resolve(batchEntry);
86
+ })));
87
+ // Try calling readEntries() again for the same dir, according to spec
88
+ readEntries();
89
+ }
90
+ }, errorHandler);
91
+ }
92
+ // initial call to recursive entry reader function
93
+ readEntries();
94
+ });
95
+ }
96
+ // package the file in an object that includes the fullPath from the file entry
97
+ // that would otherwise be lost
98
+ function packageFile(file, entry) {
99
+ var _a;
100
+ // let fileTypeOverride = '';
101
+ // handle some browsers sometimes missing mime types for dropped files
102
+ // const hasExtension = file.name && file.name.lastIndexOf('.') !== -1;
103
+ // if (hasExtension && !file.type) {
104
+ // const fileExtension = (file.name || '').split('.').pop();
105
+ // fileTypeOverride = EXTENSION_TO_MIME_TYPE_MAP[fileExtension];
106
+ // }
107
+ return {
108
+ fileObject: file,
109
+ fullPath: entry ? (_a = copyString(entry.fullPath)) === null || _a === void 0 ? void 0 : _a.replace(file.name, '') : file.name,
110
+ // lastModified: file.lastModified,
111
+ // lastModifiedDate: file.lastModifiedDate,
112
+ // name: file.name,
113
+ // size: file.size,
114
+ // type: file.type ? file.type : fileTypeOverride,
115
+ // webkitRelativePath: file.webkitRelativePath
116
+ };
117
+ }
118
+ function getFile(entry) {
119
+ return new Promise(function (resolve) {
120
+ entry.file(function (file) {
121
+ resolve(packageFile(file, entry));
122
+ });
123
+ });
124
+ }
125
+ function handleFilePromises(promises, fileList) {
126
+ return __awaiter(this, void 0, void 0, function () {
127
+ var files;
128
+ return __generator(this, function (_a) {
129
+ switch (_a.label) {
130
+ case 0: return [4 /*yield*/, Promise.all(promises)];
131
+ case 1:
132
+ files = _a.sent();
133
+ files.forEach(function (file) {
134
+ if (!shouldIgnoreFile(file)) {
135
+ fileList.push(file);
136
+ }
137
+ });
138
+ return [2 /*return*/, fileList];
139
+ }
140
+ });
141
+ });
142
+ }
143
+ /**
144
+ * @param {DataTransfer} dataTransfer
145
+ */
146
+ function getDataTransferFiles(dataTransfer) {
147
+ return __awaiter(this, void 0, void 0, function () {
148
+ var dataTransferFiles, folderPromises, filePromises, flatten_1, fileEntries, flattenedEntries;
149
+ return __generator(this, function (_a) {
150
+ switch (_a.label) {
151
+ case 0:
152
+ dataTransferFiles = [];
153
+ folderPromises = [];
154
+ filePromises = [];
155
+ [].slice.call(dataTransfer.items).forEach(function (listItem) {
156
+ if (typeof listItem.webkitGetAsEntry === 'function') {
157
+ var entry = listItem.webkitGetAsEntry();
158
+ if (entry) {
159
+ if (entry.isDirectory) {
160
+ folderPromises.push(traverseDirectory(entry));
161
+ }
162
+ else {
163
+ filePromises.push(getFile(entry));
164
+ }
165
+ }
166
+ }
167
+ else {
168
+ dataTransferFiles.push(listItem);
169
+ }
170
+ });
171
+ if (!folderPromises.length) return [3 /*break*/, 3];
172
+ flatten_1 = function (array) { return array.reduce(function (a, b) { return a.concat(Array.isArray(b) ? flatten_1(b) : b); }, []); };
173
+ return [4 /*yield*/, Promise.all(folderPromises)];
174
+ case 1:
175
+ fileEntries = _a.sent();
176
+ flattenedEntries = flatten_1(fileEntries);
177
+ // collect async promises to convert each fileEntry into a File object
178
+ flattenedEntries.forEach(function (fileEntry) {
179
+ filePromises.push(getFile(fileEntry));
180
+ });
181
+ return [4 /*yield*/, handleFilePromises(filePromises, dataTransferFiles)];
182
+ case 2: return [2 /*return*/, _a.sent()];
183
+ case 3:
184
+ if (filePromises.length) {
185
+ return [2 /*return*/, handleFilePromises(filePromises, dataTransferFiles)];
186
+ }
187
+ _a.label = 4;
188
+ case 4: return [2 /*return*/, Promise.resolve(dataTransferFiles)];
189
+ }
190
+ });
191
+ });
192
+ }
193
+ exports.getDataTransferFiles = getDataTransferFiles;
194
+ /**
195
+ * This function should be called from both the onDrop event from your drag/drop
196
+ * dropzone as well as from the HTML5 file selector input field onChange event
197
+ * handler. Pass the event object from the triggered event into this function.
198
+ * Supports mix of files and folders dropped via drag/drop.
199
+ *
200
+ * Returns: an array of File objects, that includes all files within folders
201
+ * and subfolders of the dropped/selected items.
202
+ *
203
+ * @param {React.DragEvent<HTMLDivElement>} event
204
+ */
205
+ function getDroppedOrSelectedFiles(event) {
206
+ return __awaiter(this, void 0, void 0, function () {
207
+ var dataTransfer, files, dragDropFileList, inputFieldFileList, fileList, i;
208
+ return __generator(this, function (_a) {
209
+ switch (_a.label) {
210
+ case 0:
211
+ dataTransfer = event.dataTransfer;
212
+ if (!(dataTransfer && dataTransfer.items)) return [3 /*break*/, 2];
213
+ return [4 /*yield*/, getDataTransferFiles(dataTransfer)];
214
+ case 1: return [2 /*return*/, _a.sent()];
215
+ case 2:
216
+ files = [];
217
+ dragDropFileList = dataTransfer && dataTransfer.files;
218
+ inputFieldFileList = event.target && event.target.files;
219
+ fileList = dragDropFileList || inputFieldFileList || [];
220
+ // convert the FileList to a simple array of File objects
221
+ for (i = 0; i < fileList.length; i++) {
222
+ files.push(packageFile(fileList[i]));
223
+ }
224
+ return [2 /*return*/, files];
225
+ }
226
+ });
227
+ });
228
+ }
229
+ exports.getDroppedOrSelectedFiles = getDroppedOrSelectedFiles;
@@ -0,0 +1,2 @@
1
+ export { default } from './DropArea';
2
+ export * from './DropArea';
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.default = void 0;
7
+ var DropArea_1 = require("./DropArea");
8
+ Object.defineProperty(exports, "default", { enumerable: true, get: function () { return __importDefault(DropArea_1).default; } });
@@ -0,0 +1,79 @@
1
+ /**
2
+ * Copyright (c) 2017-present, Ephox, Inc.
3
+ *
4
+ * This source code is licensed under the Apache 2 license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ *
7
+ */
8
+ import { Editor as TinyMCEEditor, EditorEvent, Events } from './tinymce/tinymce';
9
+ export declare type EventHandler<A> = (a: EditorEvent<A>, editor: TinyMCEEditor) => unknown;
10
+ declare type EEventHandler<K extends keyof Events.EditorEventMap> = EventHandler<Events.EditorEventMap[K]>;
11
+ export interface INativeEvents {
12
+ onBeforePaste: EEventHandler<'beforepaste'>;
13
+ onBlur: EEventHandler<'blur'>;
14
+ onClick: EEventHandler<'click'>;
15
+ onContextMenu: EEventHandler<'contextmenu'>;
16
+ onCopy: EEventHandler<'copy'>;
17
+ onCut: EEventHandler<'cut'>;
18
+ onDblclick: EEventHandler<'dblclick'>;
19
+ onDrag: EEventHandler<'drag'>;
20
+ onDragDrop: EEventHandler<'dragdrop'>;
21
+ onDragEnd: EEventHandler<'dragend'>;
22
+ onDragGesture: EEventHandler<'draggesture'>;
23
+ onDragOver: EEventHandler<'dragover'>;
24
+ onDrop: EEventHandler<'drop'>;
25
+ onFocus: EEventHandler<'focus'>;
26
+ onFocusIn: EEventHandler<'focusin'>;
27
+ onFocusOut: EEventHandler<'focusout'>;
28
+ onKeyDown: EEventHandler<'keydown'>;
29
+ onKeyPress: EEventHandler<'keypress'>;
30
+ onKeyUp: EEventHandler<'keyup'>;
31
+ onMouseDown: EEventHandler<'mousedown'>;
32
+ onMouseEnter: EEventHandler<'mouseenter'>;
33
+ onMouseLeave: EEventHandler<'mouseleave'>;
34
+ onMouseMove: EEventHandler<'mousemove'>;
35
+ onMouseOut: EEventHandler<'mouseout'>;
36
+ onMouseOver: EEventHandler<'mouseover'>;
37
+ onMouseUp: EEventHandler<'mouseup'>;
38
+ onPaste: EEventHandler<'paste'>;
39
+ onSelectionChange: EEventHandler<'selectionchange'>;
40
+ }
41
+ export interface ITinyEvents {
42
+ onActivate: EEventHandler<'activate'>;
43
+ onAddUndo: EEventHandler<'AddUndo'>;
44
+ onBeforeAddUndo: EEventHandler<'BeforeAddUndo'>;
45
+ onBeforeExecCommand: EEventHandler<'BeforeExecCommand'>;
46
+ onBeforeGetContent: EEventHandler<'BeforeGetContent'>;
47
+ onBeforeRenderUI: EventHandler<unknown>;
48
+ onBeforeSetContent: EEventHandler<'BeforeSetContent'>;
49
+ onChange: EventHandler<unknown>;
50
+ onClearUndos: EEventHandler<'ClearUndos'>;
51
+ onDeactivate: EEventHandler<'deactivate'>;
52
+ onDirty: EventHandler<unknown>;
53
+ onExecCommand: EEventHandler<'ExecCommand'>;
54
+ onGetContent: EEventHandler<'GetContent'>;
55
+ onHide: EventHandler<unknown>;
56
+ onInit: EEventHandler<'init'>;
57
+ onLoadContent: EEventHandler<'LoadContent'>;
58
+ onNodeChange: EEventHandler<'NodeChange'>;
59
+ onPostProcess: EventHandler<unknown>;
60
+ onPostRender: EEventHandler<'PostRender'>;
61
+ onPreProcess: EventHandler<unknown>;
62
+ onProgressState: EEventHandler<'ProgressState'>;
63
+ onRedo: EEventHandler<'Redo'>;
64
+ onRemove: EEventHandler<'remove'>;
65
+ onReset: EventHandler<unknown>;
66
+ onSaveContent: EventHandler<unknown>;
67
+ onSetAttrib: EventHandler<unknown>;
68
+ onObjectResizeStart: EEventHandler<'ObjectResizeStart'>;
69
+ onObjectResized: EEventHandler<'ObjectResized'>;
70
+ onObjectSelected: EEventHandler<'ObjectSelected'>;
71
+ onSetContent: EEventHandler<'SetContent'>;
72
+ onShow: EventHandler<unknown>;
73
+ onSubmit: EventHandler<unknown>;
74
+ onUndo: EEventHandler<'Undo'>;
75
+ onVisualAid: EventHandler<unknown>;
76
+ }
77
+ export interface IEvents extends INativeEvents, ITinyEvents {
78
+ }
79
+ export {};
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ /**
3
+ * Copyright (c) 2017-present, Ephox, Inc.
4
+ *
5
+ * This source code is licensed under the Apache 2 license found in the
6
+ * LICENSE file in the root directory of this source tree.
7
+ *
8
+ */
9
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Copyright (c) 2017-present, Ephox, Inc.
3
+ *
4
+ * This source code is licensed under the Apache 2 license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ *
7
+ */
8
+ export declare type callbackFn = () => void;
9
+ export interface IStateObj {
10
+ listeners: callbackFn[];
11
+ scriptId: string;
12
+ scriptLoading: boolean;
13
+ scriptLoaded: boolean;
14
+ }
15
+ interface ScriptLoaderInterface {
16
+ load: (doc: Document, url: string, async: boolean, defer: boolean, delay: number, callback: callbackFn) => void;
17
+ reinitialize: () => void;
18
+ }
19
+ declare const ScriptLoader: ScriptLoaderInterface;
20
+ export { ScriptLoader };
@@ -0,0 +1,70 @@
1
+ "use strict";
2
+ /**
3
+ * Copyright (c) 2017-present, Ephox, Inc.
4
+ *
5
+ * This source code is licensed under the Apache 2 license found in the
6
+ * LICENSE file in the root directory of this source tree.
7
+ *
8
+ */
9
+ Object.defineProperty(exports, "__esModule", { value: true });
10
+ exports.ScriptLoader = void 0;
11
+ var Utils_1 = require("./Utils");
12
+ var createState = function () { return ({
13
+ listeners: [],
14
+ scriptId: Utils_1.uuid('tiny-script'),
15
+ scriptLoading: false,
16
+ scriptLoaded: false
17
+ }); };
18
+ var CreateScriptLoader = function () {
19
+ var state = createState();
20
+ var injectScriptTag = function (scriptId, doc, url, async, defer, callback) {
21
+ var scriptTag = doc.createElement('script');
22
+ scriptTag.referrerPolicy = 'origin';
23
+ scriptTag.type = 'application/javascript';
24
+ scriptTag.id = scriptId;
25
+ scriptTag.src = url;
26
+ scriptTag.async = async;
27
+ scriptTag.defer = defer;
28
+ // scriptTag.appendChild(document.createTextNode(url));
29
+ var handler = function () {
30
+ scriptTag.removeEventListener('load', handler);
31
+ callback();
32
+ };
33
+ scriptTag.addEventListener('load', handler);
34
+ if (doc.head) {
35
+ doc.head.appendChild(scriptTag);
36
+ }
37
+ // document.body.appendChild(scriptTag);
38
+ };
39
+ var load = function (doc, url, async, defer, delay, callback) {
40
+ var scriptTagInjection = function () { return injectScriptTag(state.scriptId, doc, url, async, defer, function () {
41
+ state.listeners.forEach(function (fn) { return fn(); });
42
+ state.scriptLoaded = true;
43
+ }); };
44
+ if (state.scriptLoaded) {
45
+ callback();
46
+ }
47
+ else {
48
+ state.listeners.push(callback);
49
+ if (!state.scriptLoading) {
50
+ state.scriptLoading = true;
51
+ if (delay > 0) {
52
+ setTimeout(scriptTagInjection, delay);
53
+ }
54
+ else {
55
+ scriptTagInjection();
56
+ }
57
+ }
58
+ }
59
+ };
60
+ // Only to be used by tests.
61
+ var reinitialize = function () {
62
+ state = createState();
63
+ };
64
+ return {
65
+ load: load,
66
+ reinitialize: reinitialize
67
+ };
68
+ };
69
+ var ScriptLoader = CreateScriptLoader();
70
+ exports.ScriptLoader = ScriptLoader;
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Copyright (c) 2017-present, Ephox, Inc.
3
+ *
4
+ * This source code is licensed under the Apache 2 license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ *
7
+ */
8
+ import { TinyMCE as TinyMCEGlobal } from './tinymce/tinymce';
9
+ declare const getTinymce: () => TinyMCEGlobal | null;
10
+ export { getTinymce };
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ /**
3
+ * Copyright (c) 2017-present, Ephox, Inc.
4
+ *
5
+ * This source code is licensed under the Apache 2 license found in the
6
+ * LICENSE file in the root directory of this source tree.
7
+ *
8
+ */
9
+ Object.defineProperty(exports, "__esModule", { value: true });
10
+ exports.getTinymce = void 0;
11
+ var getGlobal = function () { return (typeof window !== 'undefined' ? window : global); };
12
+ var getTinymce = function () {
13
+ var global = getGlobal();
14
+ return global && global.tinymce ? global.tinymce : null;
15
+ };
16
+ exports.getTinymce = getTinymce;
@@ -0,0 +1,19 @@
1
+ /**
2
+ * Copyright (c) 2017-present, Ephox, Inc.
3
+ *
4
+ * This source code is licensed under the Apache 2 license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ *
7
+ */
8
+ import { IAllProps } from './components/Editor';
9
+ import { IEventPropTypes } from './components/EditorPropTypes';
10
+ import { Editor as TinyMCEEditor, EditorEvent } from './tinymce/tinymce';
11
+ export declare const isFunction: (x: unknown) => x is Function;
12
+ declare type PropLookup = <K extends keyof IAllProps>(key: K) => IAllProps[K] | undefined;
13
+ export declare const configHandlers2: <H>(handlerLookup: PropLookup, on: (name: string, handler: H) => void, off: (name: string, handler: H) => void, adapter: <K extends keyof import("./Events").IEvents>(lookup: PropLookup, key: K) => H, prevProps: Partial<IAllProps>, props: Partial<IAllProps>, boundHandlers: Record<string, H>) => void;
14
+ export declare const configHandlers: (editor: TinyMCEEditor, prevProps: Partial<IAllProps>, props: Partial<IAllProps>, boundHandlers: Record<string, (event: EditorEvent<any>) => unknown>, lookup: PropLookup) => void;
15
+ export declare const uuid: (prefix: string) => string;
16
+ export declare const isTextareaOrInput: (element: Element | null) => element is HTMLInputElement | HTMLTextAreaElement;
17
+ export declare const mergePlugins: (initPlugins: string | string[] | undefined, inputPlugins: string | string[] | undefined) => string[];
18
+ export declare const isBeforeInputEventAvailable: () => boolean;
19
+ export {};
@@ -0,0 +1,62 @@
1
+ "use strict";
2
+ /**
3
+ * Copyright (c) 2017-present, Ephox, Inc.
4
+ *
5
+ * This source code is licensed under the Apache 2 license found in the
6
+ * LICENSE file in the root directory of this source tree.
7
+ *
8
+ */
9
+ Object.defineProperty(exports, "__esModule", { value: true });
10
+ exports.isBeforeInputEventAvailable = exports.mergePlugins = exports.isTextareaOrInput = exports.uuid = exports.configHandlers = exports.configHandlers2 = exports.isFunction = void 0;
11
+ var EditorPropTypes_1 = require("./components/EditorPropTypes");
12
+ var isFunction = function (x) { return typeof x === 'function'; };
13
+ exports.isFunction = isFunction;
14
+ var isEventProp = function (name) { return name in EditorPropTypes_1.eventPropTypes; };
15
+ var eventAttrToEventName = function (attrName) { return attrName.substr(2); };
16
+ var configHandlers2 = function (handlerLookup, on, off, adapter, prevProps, props, boundHandlers) {
17
+ var prevEventKeys = Object.keys(prevProps).filter(isEventProp);
18
+ var currEventKeys = Object.keys(props).filter(isEventProp);
19
+ var removedKeys = prevEventKeys.filter(function (key) { return props[key] === undefined; });
20
+ var addedKeys = currEventKeys.filter(function (key) { return prevProps[key] === undefined; });
21
+ removedKeys.forEach(function (key) {
22
+ // remove event handler
23
+ var eventName = eventAttrToEventName(key);
24
+ var wrappedHandler = boundHandlers[eventName];
25
+ off(eventName, wrappedHandler);
26
+ delete boundHandlers[eventName];
27
+ });
28
+ addedKeys.forEach(function (key) {
29
+ var wrappedHandler = adapter(handlerLookup, key);
30
+ var eventName = eventAttrToEventName(key);
31
+ boundHandlers[eventName] = wrappedHandler;
32
+ on(eventName, wrappedHandler);
33
+ });
34
+ };
35
+ exports.configHandlers2 = configHandlers2;
36
+ var configHandlers = function (editor, prevProps, props, boundHandlers, lookup) {
37
+ return exports.configHandlers2(lookup, editor.on.bind(editor), editor.off.bind(editor), function (handlerLookup, key) { return function (e) { var _a; return (_a = handlerLookup(key)) === null || _a === void 0 ? void 0 : _a(e, editor); }; }, prevProps, props, boundHandlers);
38
+ };
39
+ exports.configHandlers = configHandlers;
40
+ var unique = 0;
41
+ var uuid = function (prefix) {
42
+ var time = Date.now();
43
+ var random = Math.floor(Math.random() * 1000000000);
44
+ unique++;
45
+ return prefix + '_' + random + unique + String(time);
46
+ };
47
+ exports.uuid = uuid;
48
+ var isTextareaOrInput = function (element) {
49
+ return element !== null && (element.tagName.toLowerCase() === 'textarea' || element.tagName.toLowerCase() === 'input');
50
+ };
51
+ exports.isTextareaOrInput = isTextareaOrInput;
52
+ var normalizePluginArray = function (plugins) {
53
+ if (typeof plugins === 'undefined' || plugins === '') {
54
+ return [];
55
+ }
56
+ return Array.isArray(plugins) ? plugins : plugins.split(' ');
57
+ };
58
+ // eslint-disable-next-line max-len
59
+ var mergePlugins = function (initPlugins, inputPlugins) { return normalizePluginArray(initPlugins).concat(normalizePluginArray(inputPlugins)); };
60
+ exports.mergePlugins = mergePlugins;
61
+ var isBeforeInputEventAvailable = function () { return window.InputEvent && typeof InputEvent.prototype.getTargetRanges === 'function'; };
62
+ exports.isBeforeInputEventAvailable = isBeforeInputEventAvailable;
@@ -0,0 +1,67 @@
1
+ /**
2
+ * Copyright (c) 2017-present, Ephox, Inc.
3
+ *
4
+ * This source code is licensed under the Apache 2 license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ *
7
+ */
8
+ import { IEditorPropTypes } from './EditorPropTypes';
9
+ import { IEvents } from '../Events';
10
+ import { Editor as TinyMCEEditor, RawEditorSettings } from '../tinymce/tinymce';
11
+ import * as React from 'react';
12
+ export interface IProps {
13
+ apiKey: string;
14
+ id: string;
15
+ inline: boolean;
16
+ initialValue: string;
17
+ onEditorChange: (a: string, editor: TinyMCEEditor) => void;
18
+ value: string;
19
+ init: RawEditorSettings & {
20
+ selector?: undefined;
21
+ target?: undefined;
22
+ };
23
+ /** @deprecated use `editor.getContent({format: 'text' })` in `onEditorChange` prop instead */
24
+ outputFormat: 'html' | 'text';
25
+ tagName: string;
26
+ cloudChannel: string;
27
+ plugins: NonNullable<RawEditorSettings['plugins']>;
28
+ toolbar: NonNullable<RawEditorSettings['toolbar']>;
29
+ disabled: boolean;
30
+ textareaName: string;
31
+ tinymceScriptSrc: string;
32
+ scriptLoading: {
33
+ async?: boolean;
34
+ defer?: boolean;
35
+ delay?: number;
36
+ };
37
+ }
38
+ export interface IAllProps extends Partial<IProps>, Partial<IEvents> {
39
+ }
40
+ export declare class Editor extends React.Component<IAllProps> {
41
+ static propTypes: IEditorPropTypes;
42
+ static defaultProps: Partial<IAllProps>;
43
+ editor?: TinyMCEEditor;
44
+ private id;
45
+ private elementRef;
46
+ private inline;
47
+ private currentContent?;
48
+ private boundHandlers;
49
+ private rollbackTimer;
50
+ private valueCursor;
51
+ constructor(props: Partial<IAllProps>);
52
+ componentDidUpdate(prevProps: Partial<IAllProps>): void;
53
+ componentDidMount(): void;
54
+ componentWillUnmount(): void;
55
+ render(): JSX.Element;
56
+ private renderInline;
57
+ private renderIframe;
58
+ private getScriptSrc;
59
+ private getInitialValue;
60
+ private bindHandlers;
61
+ private rollbackChange;
62
+ private handleBeforeInput;
63
+ private handleBeforeInputSpecial;
64
+ private handleEditorChange;
65
+ private handleEditorChangeSpecial;
66
+ private initialise;
67
+ }