@j2inn/fin5-ui-utils 8.2.0 → 9.0.0-beta.0

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 (243) hide show
  1. package/dist/fantomProps/createFin5Props/index.d.ts +12 -12
  2. package/dist/fantomProps/createFin5Props/index.js +146 -146
  3. package/dist/fantomProps/createFin5Props/index.js.map +1 -1
  4. package/dist/fantomProps/createFin5Props/runCreateFin5Props.d.ts +2 -2
  5. package/dist/fantomProps/createFin5Props/runCreateFin5Props.js +20 -20
  6. package/dist/fantomProps/createFin5Props/runCreateFin5Props.js.map +1 -1
  7. package/dist/fantomProps/fantomPropsToObject.d.ts +8 -8
  8. package/dist/fantomProps/fantomPropsToObject.js +182 -183
  9. package/dist/fantomProps/fantomPropsToObject.js.map +1 -1
  10. package/dist/fantomProps/generateJsonFromFantomPropsFile.d.ts +4 -4
  11. package/dist/fantomProps/generateJsonFromFantomPropsFile.js +51 -41
  12. package/dist/fantomProps/generateJsonFromFantomPropsFile.js.map +1 -1
  13. package/dist/fantomProps/localePropsToJson.d.ts +1 -1
  14. package/dist/fantomProps/localePropsToJson.js +60 -50
  15. package/dist/fantomProps/localePropsToJson.js.map +1 -1
  16. package/dist/fantomProps/readFantomPropsFile.d.ts +5 -5
  17. package/dist/fantomProps/readFantomPropsFile.js +74 -65
  18. package/dist/fantomProps/readFantomPropsFile.js.map +1 -1
  19. package/dist/fin5Top/fin5FileUpload.d.ts +24 -24
  20. package/dist/fin5Top/fin5FileUpload.js +51 -51
  21. package/dist/fin5Top/fin5FileUpload.js.map +1 -1
  22. package/dist/fin5Top/fin5Top.d.ts +188 -188
  23. package/dist/fin5Top/fin5Top.js +86 -86
  24. package/dist/fin5Top/fin5Top.js.map +1 -1
  25. package/dist/fin5Top/finEdge2Cloud.d.ts +6 -6
  26. package/dist/fin5Top/finEdge2Cloud.js +15 -15
  27. package/dist/fin5Top/getFin5BinUrl.d.ts +2 -2
  28. package/dist/fin5Top/getFin5BinUrl.js +9 -9
  29. package/dist/fin5Top/openFin5Alarm.d.ts +22 -22
  30. package/dist/fin5Top/openFin5Alarm.js +23 -23
  31. package/dist/fin5Top/openFin5Alarm.js.map +1 -1
  32. package/dist/fin5Top/openFin5Historian.d.ts +3 -3
  33. package/dist/fin5Top/openFin5Historian.js +19 -19
  34. package/dist/fin5Top/openFin5Historian.js.map +1 -1
  35. package/dist/fin5Top/useFin5AppURLHashParameter.d.ts +18 -18
  36. package/dist/fin5Top/useFin5AppURLHashParameter.js +133 -133
  37. package/dist/fin5Top/useFin5AppURLHashParameter.js.map +1 -1
  38. package/dist/index.d.ts +35 -35
  39. package/dist/index.js +69 -69
  40. package/dist/jobs/jobUtils.d.ts +14 -14
  41. package/dist/jobs/jobUtils.js +15 -15
  42. package/dist/jobs/jobUtils.js.map +1 -1
  43. package/dist/react/app/Fin5AppContainer.d.ts +36 -36
  44. package/dist/react/app/Fin5AppContainer.js +171 -161
  45. package/dist/react/app/Fin5AppContainer.js.map +1 -1
  46. package/dist/react/app/Fin5AppRootStore.d.ts +42 -42
  47. package/dist/react/app/Fin5AppRootStore.js +114 -114
  48. package/dist/react/app/Fin5AppRootStore.js.map +1 -1
  49. package/dist/react/components/ErrorBoundary.d.ts +57 -57
  50. package/dist/react/components/ErrorBoundary.js +160 -150
  51. package/dist/react/components/ErrorBoundary.js.map +1 -1
  52. package/dist/react/components/ErrorDisplayer.d.ts +19 -19
  53. package/dist/react/components/ErrorDisplayer.js +36 -36
  54. package/dist/react/components/ErrorDisplayer.js.map +1 -1
  55. package/dist/react/components/Loader.d.ts +9 -9
  56. package/dist/react/components/Loader.js +17 -17
  57. package/dist/react/components/LoadingSpinner.d.ts +2 -2
  58. package/dist/react/components/LoadingSpinner.js +27 -27
  59. package/dist/react/components/RecordImage.d.ts +20 -20
  60. package/dist/react/components/RecordImage.js +61 -51
  61. package/dist/react/components/RecordImage.js.map +1 -1
  62. package/dist/react/components/charts/QRCode.d.ts +25 -25
  63. package/dist/react/components/charts/QRCode.js +92 -82
  64. package/dist/react/components/charts/QRCode.js.map +1 -1
  65. package/dist/react/components/charts/line-bar/Chart.d.ts +166 -166
  66. package/dist/react/components/charts/line-bar/Chart.js +452 -442
  67. package/dist/react/components/charts/line-bar/Chart.js.map +1 -1
  68. package/dist/react/components/charts/line-bar/HGridChart.d.ts +58 -58
  69. package/dist/react/components/charts/line-bar/HGridChart.js +295 -285
  70. package/dist/react/components/charts/line-bar/HGridChart.js.map +1 -1
  71. package/dist/react/components/charts/pie/PieChart.d.ts +94 -94
  72. package/dist/react/components/charts/pie/PieChart.js +214 -204
  73. package/dist/react/components/charts/pie/PieChart.js.map +1 -1
  74. package/dist/react/components/charts/pie/SimplePieChart.d.ts +21 -21
  75. package/dist/react/components/charts/pie/SimplePieChart.js +65 -55
  76. package/dist/react/components/charts/pie/SimplePieChart.js.map +1 -1
  77. package/dist/react/components/graphics/GraphicViewer.d.ts +10 -10
  78. package/dist/react/components/graphics/GraphicViewer.js +29 -29
  79. package/dist/react/components/graphics/GraphicsTabViewer.d.ts +17 -17
  80. package/dist/react/components/graphics/GraphicsTabViewer.js +100 -90
  81. package/dist/react/components/graphics/GraphicsTabViewer.js.map +1 -1
  82. package/dist/react/components/makeCustomElement.d.ts +16 -16
  83. package/dist/react/components/makeCustomElement.js +150 -150
  84. package/dist/react/components/makeCustomElement.js.map +1 -1
  85. package/dist/react/components/navigation/BasicLayout.d.ts +41 -41
  86. package/dist/react/components/navigation/BasicLayout.js +165 -155
  87. package/dist/react/components/navigation/BasicLayout.js.map +1 -1
  88. package/dist/react/components/navigation/HeaderSiderLayout.d.ts +13 -13
  89. package/dist/react/components/navigation/HeaderSiderLayout.js +119 -110
  90. package/dist/react/components/navigation/HeaderSiderLayout.js.map +1 -1
  91. package/dist/react/components/navigation/MenuPage.d.ts +37 -37
  92. package/dist/react/components/navigation/MenuPage.js +35 -36
  93. package/dist/react/components/navigation/MenuPage.js.map +1 -1
  94. package/dist/react/components/navigation/MenuTrigger.d.ts +9 -9
  95. package/dist/react/components/navigation/MenuTrigger.js +33 -33
  96. package/dist/react/components/navigation/ReactRouterHeaderSiderLayout.d.ts +11 -11
  97. package/dist/react/components/navigation/ReactRouterHeaderSiderLayout.js +25 -25
  98. package/dist/react/components/navigation/ReactRouterHeaderSiderLayout.js.map +1 -1
  99. package/dist/react/components/navigation/ReactRouterLayout.d.ts +45 -46
  100. package/dist/react/components/navigation/ReactRouterLayout.js +142 -132
  101. package/dist/react/components/navigation/ReactRouterLayout.js.map +1 -1
  102. package/dist/react/components/navigation/customRouting/Router.d.ts +12 -12
  103. package/dist/react/components/navigation/customRouting/Router.js +54 -45
  104. package/dist/react/components/navigation/customRouting/Router.js.map +1 -1
  105. package/dist/react/components/navigation/customRouting/RouterLayout.d.ts +11 -11
  106. package/dist/react/components/navigation/customRouting/RouterLayout.js +71 -61
  107. package/dist/react/components/navigation/customRouting/RouterLayout.js.map +1 -1
  108. package/dist/react/components/resolvable/configurationForm/ConfigurationForm.d.ts +26 -27
  109. package/dist/react/components/resolvable/configurationForm/ConfigurationForm.js +105 -95
  110. package/dist/react/components/resolvable/configurationForm/ConfigurationForm.js.map +1 -1
  111. package/dist/react/components/resolvable/configurationForm/ConfigurationFormEntry.d.ts +15 -16
  112. package/dist/react/components/resolvable/configurationForm/ConfigurationFormEntry.js +98 -88
  113. package/dist/react/components/resolvable/configurationForm/ConfigurationFormEntry.js.map +1 -1
  114. package/dist/react/components/resolvable/configurationForm/getSectionDefault.d.ts +16 -16
  115. package/dist/react/components/resolvable/configurationForm/getSectionDefault.js +99 -99
  116. package/dist/react/components/resolvable/configurationForm/getSectionDefault.js.map +1 -1
  117. package/dist/react/hooks/useFin5BinUrl.d.ts +6 -6
  118. package/dist/react/hooks/useFin5BinUrl.js +15 -15
  119. package/dist/react/hooks/useFin5ColorScheme.d.ts +2 -2
  120. package/dist/react/hooks/useFin5ColorScheme.js +55 -56
  121. package/dist/react/hooks/useFin5ColorScheme.js.map +1 -1
  122. package/dist/react/hooks/useScreenSize.d.ts +7 -7
  123. package/dist/react/hooks/useScreenSize.js +31 -31
  124. package/dist_es/fantomProps/createFin5Props/index.d.ts +12 -12
  125. package/dist_es/fantomProps/createFin5Props/index.js +140 -140
  126. package/dist_es/fantomProps/createFin5Props/index.js.map +1 -1
  127. package/dist_es/fantomProps/createFin5Props/runCreateFin5Props.d.ts +2 -2
  128. package/dist_es/fantomProps/createFin5Props/runCreateFin5Props.js +15 -15
  129. package/dist_es/fantomProps/createFin5Props/runCreateFin5Props.js.map +1 -1
  130. package/dist_es/fantomProps/fantomPropsToObject.d.ts +8 -8
  131. package/dist_es/fantomProps/fantomPropsToObject.js +178 -178
  132. package/dist_es/fantomProps/fantomPropsToObject.js.map +1 -1
  133. package/dist_es/fantomProps/generateJsonFromFantomPropsFile.d.ts +4 -4
  134. package/dist_es/fantomProps/generateJsonFromFantomPropsFile.js +12 -12
  135. package/dist_es/fantomProps/localePropsToJson.d.ts +1 -1
  136. package/dist_es/fantomProps/localePropsToJson.js +21 -21
  137. package/dist_es/fantomProps/localePropsToJson.js.map +1 -1
  138. package/dist_es/fantomProps/readFantomPropsFile.d.ts +5 -5
  139. package/dist_es/fantomProps/readFantomPropsFile.js +38 -39
  140. package/dist_es/fantomProps/readFantomPropsFile.js.map +1 -1
  141. package/dist_es/fin5Top/fin5FileUpload.d.ts +24 -24
  142. package/dist_es/fin5Top/fin5FileUpload.js +47 -47
  143. package/dist_es/fin5Top/fin5FileUpload.js.map +1 -1
  144. package/dist_es/fin5Top/fin5Top.d.ts +188 -188
  145. package/dist_es/fin5Top/fin5Top.js +81 -81
  146. package/dist_es/fin5Top/fin5Top.js.map +1 -1
  147. package/dist_es/fin5Top/finEdge2Cloud.d.ts +6 -6
  148. package/dist_es/fin5Top/finEdge2Cloud.js +11 -11
  149. package/dist_es/fin5Top/getFin5BinUrl.d.ts +2 -2
  150. package/dist_es/fin5Top/getFin5BinUrl.js +5 -5
  151. package/dist_es/fin5Top/openFin5Alarm.d.ts +22 -22
  152. package/dist_es/fin5Top/openFin5Alarm.js +19 -19
  153. package/dist_es/fin5Top/openFin5Alarm.js.map +1 -1
  154. package/dist_es/fin5Top/openFin5Historian.d.ts +3 -3
  155. package/dist_es/fin5Top/openFin5Historian.js +15 -15
  156. package/dist_es/fin5Top/openFin5Historian.js.map +1 -1
  157. package/dist_es/fin5Top/useFin5AppURLHashParameter.d.ts +18 -18
  158. package/dist_es/fin5Top/useFin5AppURLHashParameter.js +124 -124
  159. package/dist_es/fin5Top/useFin5AppURLHashParameter.js.map +1 -1
  160. package/dist_es/index.d.ts +35 -35
  161. package/dist_es/index.js +53 -53
  162. package/dist_es/jobs/jobUtils.d.ts +14 -14
  163. package/dist_es/jobs/jobUtils.js +9 -9
  164. package/dist_es/react/app/Fin5AppContainer.d.ts +36 -36
  165. package/dist_es/react/app/Fin5AppContainer.js +132 -132
  166. package/dist_es/react/app/Fin5AppContainer.js.map +1 -1
  167. package/dist_es/react/app/Fin5AppRootStore.d.ts +42 -42
  168. package/dist_es/react/app/Fin5AppRootStore.js +110 -110
  169. package/dist_es/react/app/Fin5AppRootStore.js.map +1 -1
  170. package/dist_es/react/components/ErrorBoundary.d.ts +57 -57
  171. package/dist_es/react/components/ErrorBoundary.js +123 -123
  172. package/dist_es/react/components/ErrorDisplayer.d.ts +19 -19
  173. package/dist_es/react/components/ErrorDisplayer.js +28 -28
  174. package/dist_es/react/components/ErrorDisplayer.js.map +1 -1
  175. package/dist_es/react/components/Loader.d.ts +9 -9
  176. package/dist_es/react/components/Loader.js +12 -12
  177. package/dist_es/react/components/LoadingSpinner.d.ts +2 -2
  178. package/dist_es/react/components/LoadingSpinner.js +20 -20
  179. package/dist_es/react/components/RecordImage.d.ts +20 -20
  180. package/dist_es/react/components/RecordImage.js +24 -24
  181. package/dist_es/react/components/RecordImage.js.map +1 -1
  182. package/dist_es/react/components/charts/QRCode.d.ts +25 -25
  183. package/dist_es/react/components/charts/QRCode.js +52 -52
  184. package/dist_es/react/components/charts/QRCode.js.map +1 -1
  185. package/dist_es/react/components/charts/line-bar/Chart.d.ts +166 -166
  186. package/dist_es/react/components/charts/line-bar/Chart.js +415 -415
  187. package/dist_es/react/components/charts/line-bar/Chart.js.map +1 -1
  188. package/dist_es/react/components/charts/line-bar/HGridChart.d.ts +58 -58
  189. package/dist_es/react/components/charts/line-bar/HGridChart.js +250 -250
  190. package/dist_es/react/components/charts/line-bar/HGridChart.js.map +1 -1
  191. package/dist_es/react/components/charts/pie/PieChart.d.ts +94 -94
  192. package/dist_es/react/components/charts/pie/PieChart.js +177 -177
  193. package/dist_es/react/components/charts/pie/PieChart.js.map +1 -1
  194. package/dist_es/react/components/charts/pie/SimplePieChart.d.ts +21 -21
  195. package/dist_es/react/components/charts/pie/SimplePieChart.js +25 -25
  196. package/dist_es/react/components/graphics/GraphicViewer.d.ts +10 -10
  197. package/dist_es/react/components/graphics/GraphicViewer.js +22 -22
  198. package/dist_es/react/components/graphics/GraphicsTabViewer.d.ts +17 -17
  199. package/dist_es/react/components/graphics/GraphicsTabViewer.js +60 -60
  200. package/dist_es/react/components/graphics/GraphicsTabViewer.js.map +1 -1
  201. package/dist_es/react/components/makeCustomElement.d.ts +16 -16
  202. package/dist_es/react/components/makeCustomElement.js +142 -142
  203. package/dist_es/react/components/makeCustomElement.js.map +1 -1
  204. package/dist_es/react/components/navigation/BasicLayout.d.ts +41 -41
  205. package/dist_es/react/components/navigation/BasicLayout.js +124 -124
  206. package/dist_es/react/components/navigation/BasicLayout.js.map +1 -1
  207. package/dist_es/react/components/navigation/HeaderSiderLayout.d.ts +13 -13
  208. package/dist_es/react/components/navigation/HeaderSiderLayout.js +80 -80
  209. package/dist_es/react/components/navigation/HeaderSiderLayout.js.map +1 -1
  210. package/dist_es/react/components/navigation/MenuPage.d.ts +37 -37
  211. package/dist_es/react/components/navigation/MenuPage.js +30 -30
  212. package/dist_es/react/components/navigation/MenuPage.js.map +1 -1
  213. package/dist_es/react/components/navigation/MenuTrigger.d.ts +9 -9
  214. package/dist_es/react/components/navigation/MenuTrigger.js +28 -28
  215. package/dist_es/react/components/navigation/ReactRouterHeaderSiderLayout.d.ts +11 -11
  216. package/dist_es/react/components/navigation/ReactRouterHeaderSiderLayout.js +18 -18
  217. package/dist_es/react/components/navigation/ReactRouterHeaderSiderLayout.js.map +1 -1
  218. package/dist_es/react/components/navigation/ReactRouterLayout.d.ts +45 -46
  219. package/dist_es/react/components/navigation/ReactRouterLayout.js +99 -99
  220. package/dist_es/react/components/navigation/ReactRouterLayout.js.map +1 -1
  221. package/dist_es/react/components/navigation/customRouting/Router.d.ts +12 -12
  222. package/dist_es/react/components/navigation/customRouting/Router.js +18 -18
  223. package/dist_es/react/components/navigation/customRouting/Router.js.map +1 -1
  224. package/dist_es/react/components/navigation/customRouting/RouterLayout.d.ts +11 -11
  225. package/dist_es/react/components/navigation/customRouting/RouterLayout.js +34 -34
  226. package/dist_es/react/components/navigation/customRouting/RouterLayout.js.map +1 -1
  227. package/dist_es/react/components/resolvable/configurationForm/ConfigurationForm.d.ts +26 -27
  228. package/dist_es/react/components/resolvable/configurationForm/ConfigurationForm.js +64 -64
  229. package/dist_es/react/components/resolvable/configurationForm/ConfigurationForm.js.map +1 -1
  230. package/dist_es/react/components/resolvable/configurationForm/ConfigurationFormEntry.d.ts +15 -16
  231. package/dist_es/react/components/resolvable/configurationForm/ConfigurationFormEntry.js +58 -58
  232. package/dist_es/react/components/resolvable/configurationForm/ConfigurationFormEntry.js.map +1 -1
  233. package/dist_es/react/components/resolvable/configurationForm/getSectionDefault.d.ts +16 -16
  234. package/dist_es/react/components/resolvable/configurationForm/getSectionDefault.js +94 -94
  235. package/dist_es/react/components/resolvable/configurationForm/getSectionDefault.js.map +1 -1
  236. package/dist_es/react/hooks/useFin5BinUrl.d.ts +6 -6
  237. package/dist_es/react/hooks/useFin5BinUrl.js +11 -11
  238. package/dist_es/react/hooks/useFin5ColorScheme.d.ts +2 -2
  239. package/dist_es/react/hooks/useFin5ColorScheme.js +52 -52
  240. package/dist_es/react/hooks/useFin5ColorScheme.js.map +1 -1
  241. package/dist_es/react/hooks/useScreenSize.d.ts +7 -7
  242. package/dist_es/react/hooks/useScreenSize.js +27 -27
  243. package/package.json +26 -49
@@ -1,179 +1,179 @@
1
- /*
2
- * Copyright (c) 2022, J2 Innovations. All Rights Reserved
3
- */
4
- /**
5
- * Convert the given fantom props as string to JS object (@see https://fantom.org/doc/sys/InStream#readProps)
6
- */
7
- export default function fantomPropsToObject(props) {
8
- let i = 0;
9
- const readChar = () => {
10
- if (i < props.length) {
11
- i++;
12
- return props.charCodeAt(i - 1);
13
- }
14
- else
15
- return -1;
16
- };
17
- const unreadChar = () => {
18
- if (i > 0) {
19
- i--;
20
- }
21
- };
22
- return parseFantomProps(readChar, unreadChar);
23
- }
24
- var UTF_8;
25
- (function (UTF_8) {
26
- UTF_8[UTF_8["tab"] = 9] = "tab";
27
- UTF_8[UTF_8["lf"] = 10] = "lf";
28
- UTF_8[UTF_8["cr"] = 13] = "cr";
29
- UTF_8[UTF_8["space"] = 32] = "space";
30
- UTF_8[UTF_8["numberSign"] = 35] = "numberSign";
31
- UTF_8[UTF_8["asterisk"] = 42] = "asterisk";
32
- UTF_8[UTF_8["solidus"] = 47] = "solidus";
33
- UTF_8[UTF_8["equalSign"] = 61] = "equalSign";
34
- UTF_8[UTF_8["reverseSolidus"] = 92] = "reverseSolidus";
35
- UTF_8[UTF_8["n"] = 110] = "n";
36
- UTF_8[UTF_8["r"] = 114] = "r";
37
- UTF_8[UTF_8["t"] = 116] = "t";
38
- UTF_8[UTF_8["u"] = 117] = "u";
39
- })(UTF_8 || (UTF_8 = {}));
40
- const isSpace = (char) => char === UTF_8.space ||
41
- char === UTF_8.tab ||
42
- char === UTF_8.lf ||
43
- char === UTF_8.cr;
44
- const hex = function (c) {
45
- if (48 <= c && c <= 57)
46
- return c - 48;
47
- if (97 <= c && c <= 102)
48
- return c - 97 + 10;
49
- if (65 <= c && c <= 70)
50
- return c - 65 + 10;
51
- return -1;
52
- };
53
- /*
54
- * Parse the Fantom props file character by character.
55
- * Implementation based on https://github.com/fantom-lang/fantom/blob/master/src/sys/js/fan/InStream.js
56
- */
57
- export function parseFantomProps(readChar, unreadChar) {
58
- const props = {};
59
- let name = '';
60
- let value = null;
61
- let inBlockComment = 0;
62
- let inEndOfLineComment = false;
63
- let char = UTF_8.space, lastChar = UTF_8.space;
64
- let lineNum = 1;
65
- while (true) {
66
- lastChar = char;
67
- char = readChar();
68
- if (char < 0)
69
- break;
70
- // end of line
71
- if (char == UTF_8.lf || char == UTF_8.cr) {
72
- inEndOfLineComment = false;
73
- if (lastChar == UTF_8.cr && char == UTF_8.lf)
74
- continue;
75
- const n = name.trim();
76
- if (value !== null) {
77
- props[n] = value.trim();
78
- name = '';
79
- value = null;
80
- }
81
- else if (n.length > 0)
82
- throw new Error('Invalid name/value pair [Line ' + lineNum + ']');
83
- lineNum++;
84
- continue;
85
- }
86
- // if in comment
87
- if (inEndOfLineComment)
88
- continue;
89
- // block comment
90
- if (inBlockComment > 0) {
91
- if (lastChar == UTF_8.solidus && char == UTF_8.asterisk)
92
- inBlockComment++;
93
- if (lastChar == UTF_8.asterisk && char == UTF_8.solidus)
94
- inBlockComment--;
95
- continue;
96
- }
97
- // equal
98
- if (char == UTF_8.equalSign && value === null) {
99
- value = '';
100
- continue;
101
- }
102
- // line comment
103
- if (char === UTF_8.numberSign &&
104
- (lastChar == UTF_8.lf || lastChar == UTF_8.cr)) {
105
- inEndOfLineComment = true;
106
- continue;
107
- }
108
- // end of line comment
109
- if (char == UTF_8.solidus && isSpace(lastChar)) {
110
- const peek = readChar();
111
- if (peek < 0)
112
- break;
113
- if (peek == UTF_8.solidus) {
114
- inEndOfLineComment = true;
115
- continue;
116
- }
117
- if (peek == UTF_8.asterisk) {
118
- inBlockComment++;
119
- continue;
120
- }
121
- unreadChar(peek);
122
- }
123
- // escape or line continuation
124
- if (char == UTF_8.reverseSolidus) {
125
- let peek = readChar();
126
- if (peek < 0)
127
- break;
128
- else if (peek == UTF_8.n)
129
- char = UTF_8.lf;
130
- else if (peek == UTF_8.r)
131
- char = UTF_8.cr;
132
- else if (peek == UTF_8.t)
133
- char = UTF_8.tab;
134
- else if (peek == UTF_8.reverseSolidus)
135
- char = UTF_8.reverseSolidus;
136
- else if (peek == UTF_8.cr || peek == UTF_8.lf) {
137
- // line continuation
138
- lineNum++;
139
- if (peek == UTF_8.cr) {
140
- peek = readChar();
141
- if (peek != UTF_8.lf)
142
- unreadChar(peek);
143
- }
144
- while (true) {
145
- peek = readChar();
146
- if (peek == UTF_8.space || peek == UTF_8.tab)
147
- continue;
148
- unreadChar(peek);
149
- break;
150
- }
151
- continue;
152
- }
153
- else if (peek == UTF_8.u) {
154
- const n3 = hex(readChar());
155
- const n2 = hex(readChar());
156
- const n1 = hex(readChar());
157
- const n0 = hex(readChar());
158
- if (n3 < 0 || n2 < 0 || n1 < 0 || n0 < 0)
159
- throw new Error('Invalid hex value for \\uxxxx [Line ' + lineNum + ']');
160
- char = (n3 << 12) | (n2 << 8) | (n1 << 4) | n0;
161
- }
162
- else
163
- throw new Error('Invalid escape sequence [Line ' + lineNum + ']');
164
- }
165
- // normal character
166
- if (value === null)
167
- name += String.fromCharCode(char);
168
- else
169
- value += String.fromCharCode(char);
170
- }
171
- const n = name.trim();
172
- if (value !== null) {
173
- props[n] = value.trim();
174
- }
175
- else if (n.length > 0)
176
- throw new Error('Invalid name/value pair [Line ' + lineNum + ']');
177
- return props;
178
- }
1
+ /*
2
+ * Copyright (c) 2022, J2 Innovations. All Rights Reserved
3
+ */
4
+ /**
5
+ * Convert the given fantom props as string to JS object (@see https://fantom.org/doc/sys/InStream#readProps)
6
+ */
7
+ export default function fantomPropsToObject(props) {
8
+ let i = 0;
9
+ const readChar = () => {
10
+ if (i < props.length) {
11
+ i++;
12
+ return props.charCodeAt(i - 1);
13
+ }
14
+ else
15
+ return -1;
16
+ };
17
+ const unreadChar = () => {
18
+ if (i > 0) {
19
+ i--;
20
+ }
21
+ };
22
+ return parseFantomProps(readChar, unreadChar);
23
+ }
24
+ var UTF_8;
25
+ (function (UTF_8) {
26
+ UTF_8[UTF_8["tab"] = 9] = "tab";
27
+ UTF_8[UTF_8["lf"] = 10] = "lf";
28
+ UTF_8[UTF_8["cr"] = 13] = "cr";
29
+ UTF_8[UTF_8["space"] = 32] = "space";
30
+ UTF_8[UTF_8["numberSign"] = 35] = "numberSign";
31
+ UTF_8[UTF_8["asterisk"] = 42] = "asterisk";
32
+ UTF_8[UTF_8["solidus"] = 47] = "solidus";
33
+ UTF_8[UTF_8["equalSign"] = 61] = "equalSign";
34
+ UTF_8[UTF_8["reverseSolidus"] = 92] = "reverseSolidus";
35
+ UTF_8[UTF_8["n"] = 110] = "n";
36
+ UTF_8[UTF_8["r"] = 114] = "r";
37
+ UTF_8[UTF_8["t"] = 116] = "t";
38
+ UTF_8[UTF_8["u"] = 117] = "u";
39
+ })(UTF_8 || (UTF_8 = {}));
40
+ const isSpace = (char) => char === UTF_8.space ||
41
+ char === UTF_8.tab ||
42
+ char === UTF_8.lf ||
43
+ char === UTF_8.cr;
44
+ const hex = function (c) {
45
+ if (48 <= c && c <= 57)
46
+ return c - 48;
47
+ if (97 <= c && c <= 102)
48
+ return c - 97 + 10;
49
+ if (65 <= c && c <= 70)
50
+ return c - 65 + 10;
51
+ return -1;
52
+ };
53
+ /*
54
+ * Parse the Fantom props file character by character.
55
+ * Implementation based on https://github.com/fantom-lang/fantom/blob/master/src/sys/js/fan/InStream.js
56
+ */
57
+ export function parseFantomProps(readChar, unreadChar) {
58
+ const props = {};
59
+ let name = '';
60
+ let value = null;
61
+ let inBlockComment = 0;
62
+ let inEndOfLineComment = false;
63
+ let char = UTF_8.space, lastChar = UTF_8.space;
64
+ let lineNum = 1;
65
+ while (true) {
66
+ lastChar = char;
67
+ char = readChar();
68
+ if (char < 0)
69
+ break;
70
+ // end of line
71
+ if (char == UTF_8.lf || char == UTF_8.cr) {
72
+ inEndOfLineComment = false;
73
+ if (lastChar == UTF_8.cr && char == UTF_8.lf)
74
+ continue;
75
+ const n = name.trim();
76
+ if (value !== null) {
77
+ props[n] = value.trim();
78
+ name = '';
79
+ value = null;
80
+ }
81
+ else if (n.length > 0)
82
+ throw new Error('Invalid name/value pair [Line ' + lineNum + ']');
83
+ lineNum++;
84
+ continue;
85
+ }
86
+ // if in comment
87
+ if (inEndOfLineComment)
88
+ continue;
89
+ // block comment
90
+ if (inBlockComment > 0) {
91
+ if (lastChar == UTF_8.solidus && char == UTF_8.asterisk)
92
+ inBlockComment++;
93
+ if (lastChar == UTF_8.asterisk && char == UTF_8.solidus)
94
+ inBlockComment--;
95
+ continue;
96
+ }
97
+ // equal
98
+ if (char == UTF_8.equalSign && value === null) {
99
+ value = '';
100
+ continue;
101
+ }
102
+ // line comment
103
+ if (char === UTF_8.numberSign &&
104
+ (lastChar == UTF_8.lf || lastChar == UTF_8.cr)) {
105
+ inEndOfLineComment = true;
106
+ continue;
107
+ }
108
+ // end of line comment
109
+ if (char == UTF_8.solidus && isSpace(lastChar)) {
110
+ const peek = readChar();
111
+ if (peek < 0)
112
+ break;
113
+ if (peek == UTF_8.solidus) {
114
+ inEndOfLineComment = true;
115
+ continue;
116
+ }
117
+ if (peek == UTF_8.asterisk) {
118
+ inBlockComment++;
119
+ continue;
120
+ }
121
+ unreadChar(peek);
122
+ }
123
+ // escape or line continuation
124
+ if (char == UTF_8.reverseSolidus) {
125
+ let peek = readChar();
126
+ if (peek < 0)
127
+ break;
128
+ else if (peek == UTF_8.n)
129
+ char = UTF_8.lf;
130
+ else if (peek == UTF_8.r)
131
+ char = UTF_8.cr;
132
+ else if (peek == UTF_8.t)
133
+ char = UTF_8.tab;
134
+ else if (peek == UTF_8.reverseSolidus)
135
+ char = UTF_8.reverseSolidus;
136
+ else if (peek == UTF_8.cr || peek == UTF_8.lf) {
137
+ // line continuation
138
+ lineNum++;
139
+ if (peek == UTF_8.cr) {
140
+ peek = readChar();
141
+ if (peek != UTF_8.lf)
142
+ unreadChar(peek);
143
+ }
144
+ while (true) {
145
+ peek = readChar();
146
+ if (peek == UTF_8.space || peek == UTF_8.tab)
147
+ continue;
148
+ unreadChar(peek);
149
+ break;
150
+ }
151
+ continue;
152
+ }
153
+ else if (peek == UTF_8.u) {
154
+ const n3 = hex(readChar());
155
+ const n2 = hex(readChar());
156
+ const n1 = hex(readChar());
157
+ const n0 = hex(readChar());
158
+ if (n3 < 0 || n2 < 0 || n1 < 0 || n0 < 0)
159
+ throw new Error('Invalid hex value for \\uxxxx [Line ' + lineNum + ']');
160
+ char = (n3 << 12) | (n2 << 8) | (n1 << 4) | n0;
161
+ }
162
+ else
163
+ throw new Error('Invalid escape sequence [Line ' + lineNum + ']');
164
+ }
165
+ // normal character
166
+ if (value === null)
167
+ name += String.fromCharCode(char);
168
+ else
169
+ value += String.fromCharCode(char);
170
+ }
171
+ const n = name.trim();
172
+ if (value !== null) {
173
+ props[n] = value.trim();
174
+ }
175
+ else if (n.length > 0)
176
+ throw new Error('Invalid name/value pair [Line ' + lineNum + ']');
177
+ return props;
178
+ }
179
179
  //# sourceMappingURL=fantomPropsToObject.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"fantomPropsToObject.js","sourceRoot":"","sources":["../../src/fantomProps/fantomPropsToObject.ts"],"names":[],"mappings":"AAAA;;GAEG;AAMH;;GAEG;AACH,MAAM,CAAC,OAAO,UAAU,mBAAmB,CAAC,KAAa;IACxD,IAAI,CAAC,GAAG,CAAC,CAAA;IAET,MAAM,QAAQ,GAAG,GAAW,EAAE;QAC7B,IAAI,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE;YACrB,CAAC,EAAE,CAAA;YACH,OAAO,KAAK,CAAC,UAAU,CAAC,CAAC,GAAG,CAAC,CAAC,CAAA;SAC9B;;YAAM,OAAO,CAAC,CAAC,CAAA;IACjB,CAAC,CAAA;IAED,MAAM,UAAU,GAAG,GAAG,EAAE;QACvB,IAAI,CAAC,GAAG,CAAC,EAAE;YACV,CAAC,EA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,YAAY,CAAC,IAAI,CAAC,CAAA;;YAChD,KAAK,IAAI,MAAM,CAAC,YAAY,CAAC,IAAI,CAAC,CAAA;IACxC,CAAC;IAED,MAAM,CAAC,GAAG,IAAI,CAAC,IAAI,EAAE,CAAA;IACrB,IAAI,KAAK,KAAK,IAAI,EAAE,CAAC;QACpB,KAAK,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,IAAI,EAAE,CAAA;IACxB,CAAC;SAAM,IAAI,CAAC,CAAC,MAAM,GAAG,CAAC;QACtB,MAAM,IAAI,KAAK,CAAC,gCAAgC,GAAG,OAAO,GAAG,GAAG,CAAC,CAAA;IAElE,OAAO,KAAK,CAAA;AACb,CAAC"}
@@ -1,4 +1,4 @@
1
- /**
2
- * Converts props file to json file.
3
- */
4
- export default function generateJsonFromFantomPropsFile(inputPath?: string, outputPath?: string): Promise<void>;
1
+ /**
2
+ * Converts props file to json file.
3
+ */
4
+ export default function generateJsonFromFantomPropsFile(inputPath?: string, outputPath?: string): Promise<void>;
@@ -1,13 +1,13 @@
1
- /*
2
- * Copyright (c) 2022, J2 Innovations. All Rights Reserved
3
- */
4
- import * as fs from 'fs';
5
- import readFantomPropsFile from './readFantomPropsFile';
6
- /**
7
- * Converts props file to json file.
8
- */
9
- export default async function generateJsonFromFantomPropsFile(inputPath = '../locale/en.props', outputPath = './src/localeKeys.json') {
10
- const result = await readFantomPropsFile(inputPath);
11
- fs.writeFileSync(outputPath, JSON.stringify(result, null, '\t'));
12
- }
1
+ /*
2
+ * Copyright (c) 2022, J2 Innovations. All Rights Reserved
3
+ */
4
+ import * as fs from 'fs';
5
+ import readFantomPropsFile from './readFantomPropsFile';
6
+ /**
7
+ * Converts props file to json file.
8
+ */
9
+ export default async function generateJsonFromFantomPropsFile(inputPath = '../locale/en.props', outputPath = './src/localeKeys.json') {
10
+ const result = await readFantomPropsFile(inputPath);
11
+ fs.writeFileSync(outputPath, JSON.stringify(result, null, '\t'));
12
+ }
13
13
  //# sourceMappingURL=generateJsonFromFantomPropsFile.js.map
@@ -1 +1 @@
1
- export default function localePropsToJson(inputPath?: string, outputPath?: string, includeOnlyPrefixedBy?: string): Promise<void>;
1
+ export default function localePropsToJson(inputPath?: string, outputPath?: string, includeOnlyPrefixedBy?: string): Promise<void>;
@@ -1,22 +1,22 @@
1
- /*
2
- * Copyright (c) 2022, J2 Innovations. All Rights Reserved
3
- */
4
- import * as fs from 'fs';
5
- import readFantomPropsFile from './readFantomPropsFile';
6
- export default async function localePropsToJson(inputPath = '../locale/en.props', outputPath = './src/localeKeys.json', includeOnlyPrefixedBy = '') {
7
- const props = await readFantomPropsFile(inputPath);
8
- let localeKeys;
9
- if (includeOnlyPrefixedBy) {
10
- localeKeys = Object.fromEntries(Object.keys(props)
11
- .filter((key) => key.startsWith(includeOnlyPrefixedBy))
12
- .map((key) => [
13
- key.replace(includeOnlyPrefixedBy, '').replaceAll('.', '_'),
14
- key,
15
- ]));
16
- }
17
- else {
18
- localeKeys = Object.fromEntries(Object.keys(props).map((key) => [key.replaceAll('.', '_'), key]));
19
- }
20
- fs.writeFileSync(outputPath, JSON.stringify(localeKeys, null, '\t'));
21
- }
1
+ /*
2
+ * Copyright (c) 2022, J2 Innovations. All Rights Reserved
3
+ */
4
+ import * as fs from 'fs';
5
+ import readFantomPropsFile from './readFantomPropsFile';
6
+ export default async function localePropsToJson(inputPath = '../locale/en.props', outputPath = './src/localeKeys.json', includeOnlyPrefixedBy = '') {
7
+ const props = await readFantomPropsFile(inputPath);
8
+ let localeKeys;
9
+ if (includeOnlyPrefixedBy) {
10
+ localeKeys = Object.fromEntries(Object.keys(props)
11
+ .filter((key) => key.startsWith(includeOnlyPrefixedBy))
12
+ .map((key) => [
13
+ key.replace(includeOnlyPrefixedBy, '').replaceAll('.', '_'),
14
+ key,
15
+ ]));
16
+ }
17
+ else {
18
+ localeKeys = Object.fromEntries(Object.keys(props).map((key) => [key.replaceAll('.', '_'), key]));
19
+ }
20
+ fs.writeFileSync(outputPath, JSON.stringify(localeKeys, null, '\t'));
21
+ }
22
22
  //# sourceMappingURL=localePropsToJson.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"localePropsToJson.js","sourceRoot":"","sources":["../../src/fantomProps/localePropsToJson.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,MAAM,IAAI,CAAA;AACxB,OAAO,mBAAmB,MAAM,uBAAuB,CAAA;AAEvD,MAAM,CAAC,OAAO,CAAC,KAAK,UAAU,iBAAiB,CAC9C,SAAS,GAAG,oBAAoB,EAChC,UAAU,GAAG,uBAAuB,EACpC,qBAAqB,GAAG,EAAE;IAE1B,MAAM,KAAK,GAAG,MAAM,mBAAmB,CAAC,SAAS,CAAC,CAAA;IAElD,IAAI,UAAU,CAAA;IACd,IAAI,qBAAqB,EAAE;QAC1B,UAAU,GAAG,MAAM,CAAC,WAAW,CAC9B,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC;aAChB,MAAM,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,UAAU,CAAC,qBAAqB,CAAC,CAAC;aACtD,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC;YACb,GAAG,CAAC,OAAO,CAAC,qBAAqB,EAAE,EAAE,CAAC,CAAC,UAAU,CAAC,GAAG,EAAE,GAAG,CAAC;YAC3D,GAAG;SACH,CAAC,CACH,CAAA;KACD;SAAM;QACN,UAAU,GAAG,MAAM,CAAC,WAAW,CAC9B,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,UAAU,CAAC,GAAG,EAAE,GAAG,CAAC,EAAE,GAAG,CAAC,CAAC,CAChE,CAAA;KACD;IAED,EAAE,CAAC,aAAa,CAAC,UAAU,EAAE,IAAI,CAAC,SAAS,CAAC,UAAU,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC,CAAA;AACrE,CAAC"}
1
+ {"version":3,"file":"localePropsToJson.js","sourceRoot":"","sources":["../../src/fantomProps/localePropsToJson.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,MAAM,IAAI,CAAA;AACxB,OAAO,mBAAmB,MAAM,uBAAuB,CAAA;AAEvD,MAAM,CAAC,OAAO,CAAC,KAAK,UAAU,iBAAiB,CAC9C,SAAS,GAAG,oBAAoB,EAChC,UAAU,GAAG,uBAAuB,EACpC,qBAAqB,GAAG,EAAE;IAE1B,MAAM,KAAK,GAAG,MAAM,mBAAmB,CAAC,SAAS,CAAC,CAAA;IAElD,IAAI,UAAU,CAAA;IACd,IAAI,qBAAqB,EAAE,CAAC;QAC3B,UAAU,GAAG,MAAM,CAAC,WAAW,CAC9B,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC;aAChB,MAAM,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,UAAU,CAAC,qBAAqB,CAAC,CAAC;aACtD,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC;YACb,GAAG,CAAC,OAAO,CAAC,qBAAqB,EAAE,EAAE,CAAC,CAAC,UAAU,CAAC,GAAG,EAAE,GAAG,CAAC;YAC3D,GAAG;SACH,CAAC,CACH,CAAA;IACF,CAAC;SAAM,CAAC;QACP,UAAU,GAAG,MAAM,CAAC,WAAW,CAC9B,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,UAAU,CAAC,GAAG,EAAE,GAAG,CAAC,EAAE,GAAG,CAAC,CAAC,CAChE,CAAA;IACF,CAAC;IAED,EAAE,CAAC,aAAa,CAAC,UAAU,EAAE,IAAI,CAAC,SAAS,CAAC,UAAU,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC,CAAA;AACrE,CAAC"}
@@ -1,5 +1,5 @@
1
- import { Props } from './fantomPropsToObject';
2
- /**
3
- * Synchronously read the given Fantom props file to JS object (@see https://fantom.org/doc/sys/InStream#readProps)
4
- */
5
- export default function readFantomPropsFile(path: string): Promise<Props>;
1
+ import { Props } from './fantomPropsToObject';
2
+ /**
3
+ * Synchronously read the given Fantom props file to JS object (@see https://fantom.org/doc/sys/InStream#readProps)
4
+ */
5
+ export default function readFantomPropsFile(path: string): Promise<Props>;
@@ -1,40 +1,39 @@
1
- /*
2
- * Copyright (c) 2022, J2 Innovations. All Rights Reserved
3
- */
4
- import * as fs from 'fs';
5
- import { parseFantomProps } from './fantomPropsToObject';
6
- /**
7
- * Synchronously read the given Fantom props file to JS object (@see https://fantom.org/doc/sys/InStream#readProps)
8
- */
9
- export default function readFantomPropsFile(path) {
10
- return new Promise((resolve, reject) => {
11
- fs.readFile(path, (err, fileBuffer) => {
12
- if (err) {
13
- return reject(err);
14
- }
15
- let bufferIndex = 0;
16
- const bufferLength = fileBuffer.length;
17
- const unreadBuffer = []; // Stack to handle unreadChar operations
18
- const readChar = () => {
19
- if (unreadBuffer.length > 0) {
20
- // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
21
- return unreadBuffer.pop();
22
- }
23
- if (bufferIndex < bufferLength) {
24
- return fileBuffer[bufferIndex++];
25
- }
26
- return -1;
27
- };
28
- const unreadChar = (char) => {
29
- unreadBuffer.push(char);
30
- };
31
- try {
32
- resolve(parseFantomProps(readChar, unreadChar));
33
- }
34
- catch (error) {
35
- reject(error);
36
- }
37
- });
38
- });
39
- }
1
+ /*
2
+ * Copyright (c) 2022, J2 Innovations. All Rights Reserved
3
+ */
4
+ import * as fs from 'fs';
5
+ import { parseFantomProps } from './fantomPropsToObject';
6
+ /**
7
+ * Synchronously read the given Fantom props file to JS object (@see https://fantom.org/doc/sys/InStream#readProps)
8
+ */
9
+ export default function readFantomPropsFile(path) {
10
+ return new Promise((resolve, reject) => {
11
+ fs.readFile(path, (err, fileBuffer) => {
12
+ if (err) {
13
+ return reject(err);
14
+ }
15
+ let bufferIndex = 0;
16
+ const bufferLength = fileBuffer.length;
17
+ const unreadBuffer = []; // Stack to handle unreadChar operations
18
+ const readChar = () => {
19
+ if (unreadBuffer.length > 0) {
20
+ return unreadBuffer.pop();
21
+ }
22
+ if (bufferIndex < bufferLength) {
23
+ return fileBuffer[bufferIndex++];
24
+ }
25
+ return -1;
26
+ };
27
+ const unreadChar = (char) => {
28
+ unreadBuffer.push(char);
29
+ };
30
+ try {
31
+ resolve(parseFantomProps(readChar, unreadChar));
32
+ }
33
+ catch (error) {
34
+ reject(error);
35
+ }
36
+ });
37
+ });
38
+ }
40
39
  //# sourceMappingURL=readFantomPropsFile.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"readFantomPropsFile.js","sourceRoot":"","sources":["../../src/fantomProps/readFantomPropsFile.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,MAAM,IAAI,CAAA;AACxB,OAAO,EAAE,gBAAgB,EAAS,MAAM,uBAAuB,CAAA;AAE/D;;GAEG;AACH,MAAM,CAAC,OAAO,UAAU,mBAAmB,CAAC,IAAY;IACvD,OAAO,IAAI,OAAO,CAAQ,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QAC7C,EAAE,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC,GAAG,EAAE,UAAU,EAAE,EAAE;YACrC,IAAI,GAAG,EAAE;gBACR,OAAO,MAAM,CAAC,GAAG,CAAC,CAAA;aAClB;YAED,IAAI,WAAW,GAAG,CAAC,CAAA;YACnB,MAAM,YAAY,GAAG,UAAU,CAAC,MAAM,CAAA;YACtC,MAAM,YAAY,GAAa,EAAE,CAAA,CAAC,wCAAwC;YAE1E,MAAM,QAAQ,GAAG,GAAW,EAAE;gBAC7B,IAAI,YAAY,CAAC,MAAM,GAAG,CAAC,EAAE;oBAC5B,oEAAoE;oBACpE,OAAO,YAAY,CAAC,GAAG,EAAG,CAAA;iBAC1B;gBACD,IAAI,WAAW,GAAG,YAAY,EAAE;oBAC/B,OAAO,UAAU,CAAC,WAAW,EAAE,CAAC,CAAA;iBAChC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E,CAAC,CAAA;gBACjC,CAAC;gBACD,OAAO,CAAC,CAAC,CAAA;YACV,CAAC,CAAA;YAED,MAAM,UAAU,GAAG,CAAC,IAAY,EAAE,EAAE;gBACnC,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;YACxB,CAAC,CAAA;YAED,IAAI,CAAC;gBACJ,OAAO,CAAC,gBAAgB,CAAC,QAAQ,EAAE,UAAU,CAAC,CAAC,CAAA;YAChD,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBAChB,MAAM,CAAC,KAAK,CAAC,CAAA;YACd,CAAC;QACF,CAAC,CAAC,CAAA;IACH,CAAC,CAAC,CAAA;AACH,CAAC"}
@@ -1,24 +1,24 @@
1
- import { HDict } from 'haystack-core';
2
- /**
3
- * Upload a File to FIN5, using the FINStack /fileUpload API. Files can then be viewed using Folio menu.
4
- * @param projectName The name of the project where the files will be uploaded
5
- * @param file The File to upload
6
- * @param additionalTags Any additional tag that needs to be added to the file record. The tags should be
7
- * provided as URL search parameters. To add a marker tag, set the value of the param to `'true'`.
8
- * @returns the file record as an HDict
9
- * @example
10
- * <input type='file' onChange={async (e) => {
11
- * const file = e.target.files?.[0]
12
- * if (file) {
13
- * const params = new URLSearchParams()
14
- * params.set('myMarker', 'true')
15
- * params.set('myStrTag', 'abc')
16
- * const rec = await fin5FileUpload(
17
- * 'myprojectname',
18
- * file,
19
- * params
20
- * )
21
- * }
22
- * }} />
23
- */
24
- export declare const fin5FileUpload: (projectName: string, file: File, additionalTags?: URLSearchParams) => Promise<HDict>;
1
+ import { HDict } from 'haystack-core';
2
+ /**
3
+ * Upload a File to FIN5, using the FINStack /fileUpload API. Files can then be viewed using Folio menu.
4
+ * @param projectName The name of the project where the files will be uploaded
5
+ * @param file The File to upload
6
+ * @param additionalTags Any additional tag that needs to be added to the file record. The tags should be
7
+ * provided as URL search parameters. To add a marker tag, set the value of the param to `'true'`.
8
+ * @returns the file record as an HDict
9
+ * @example
10
+ * <input type='file' onChange={async (e) => {
11
+ * const file = e.target.files?.[0]
12
+ * if (file) {
13
+ * const params = new URLSearchParams()
14
+ * params.set('myMarker', 'true')
15
+ * params.set('myStrTag', 'abc')
16
+ * const rec = await fin5FileUpload(
17
+ * 'myprojectname',
18
+ * file,
19
+ * params
20
+ * )
21
+ * }
22
+ * }} />
23
+ */
24
+ export declare const fin5FileUpload: (projectName: string, file: File, additionalTags?: URLSearchParams) => Promise<HDict>;