@pdfme/ui 1.0.18 → 1.1.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 (306) hide show
  1. package/declaration.d.ts +0 -4
  2. package/dist/cjs/__tests__/assets/helper.js +79 -0
  3. package/dist/cjs/__tests__/assets/helper.js.map +1 -0
  4. package/dist/cjs/__tests__/components/Designer.test.js +39 -0
  5. package/dist/cjs/__tests__/components/Designer.test.js.map +1 -0
  6. package/dist/cjs/__tests__/components/Preview.test.js +51 -0
  7. package/dist/cjs/__tests__/components/Preview.test.js.map +1 -0
  8. package/dist/cjs/__tests__/helper.test.js +94 -0
  9. package/dist/cjs/__tests__/helper.test.js.map +1 -0
  10. package/dist/cjs/src/Designer.js +62 -0
  11. package/dist/cjs/src/Designer.js.map +1 -0
  12. package/dist/cjs/src/Form.js +36 -0
  13. package/dist/cjs/src/Form.js.map +1 -0
  14. package/dist/cjs/src/Viewer.js +26 -0
  15. package/dist/cjs/src/Viewer.js.map +1 -0
  16. package/dist/cjs/src/assets/barcodeExamples/code128.png +0 -0
  17. package/dist/cjs/src/assets/barcodeExamples/code39.png +0 -0
  18. package/dist/cjs/src/assets/barcodeExamples/ean13.png +0 -0
  19. package/dist/cjs/src/assets/barcodeExamples/ean8.png +0 -0
  20. package/dist/cjs/src/assets/barcodeExamples/itf14.png +0 -0
  21. package/dist/cjs/src/assets/barcodeExamples/japanpost.png +0 -0
  22. package/dist/cjs/src/assets/barcodeExamples/nw7.png +0 -0
  23. package/dist/cjs/src/assets/barcodeExamples/qrcode.png +0 -0
  24. package/dist/cjs/src/assets/barcodeExamples/upca.png +0 -0
  25. package/dist/cjs/src/assets/barcodeExamples/upce.png +0 -0
  26. package/dist/cjs/src/class.js +120 -0
  27. package/dist/cjs/src/class.js.map +1 -0
  28. package/dist/cjs/src/components/CtlBar/Pager.js +49 -0
  29. package/dist/cjs/src/components/CtlBar/Pager.js.map +1 -0
  30. package/dist/cjs/src/components/CtlBar/Zoom.js +31 -0
  31. package/dist/cjs/src/components/CtlBar/Zoom.js.map +1 -0
  32. package/dist/cjs/src/components/CtlBar/index.js +33 -0
  33. package/dist/cjs/src/components/CtlBar/index.js.map +1 -0
  34. package/dist/cjs/src/components/Designer/Main/Guides.js +33 -0
  35. package/dist/cjs/src/components/Designer/Main/Guides.js.map +1 -0
  36. package/dist/cjs/src/components/Designer/Main/Mask.js +18 -0
  37. package/dist/cjs/src/components/Designer/Main/Mask.js.map +1 -0
  38. package/dist/cjs/src/components/Designer/Main/Moveable.js +37 -0
  39. package/dist/cjs/src/components/Designer/Main/Moveable.js.map +1 -0
  40. package/dist/cjs/src/components/Designer/Main/Selecto.js +11 -0
  41. package/dist/cjs/src/components/Designer/Main/Selecto.js.map +1 -0
  42. package/dist/cjs/src/components/Designer/Main/index.js +224 -0
  43. package/dist/cjs/src/components/Designer/Main/index.js.map +1 -0
  44. package/dist/cjs/src/components/Designer/Sidebar/DetailView/ExampleInputEditor.js +69 -0
  45. package/dist/cjs/src/components/Designer/Sidebar/DetailView/ExampleInputEditor.js.map +1 -0
  46. package/dist/cjs/src/components/Designer/Sidebar/DetailView/PositionAndSizeEditor.js +184 -0
  47. package/dist/cjs/src/components/Designer/Sidebar/DetailView/PositionAndSizeEditor.js.map +1 -0
  48. package/dist/cjs/src/components/Designer/Sidebar/DetailView/TextPropEditor.js +116 -0
  49. package/dist/cjs/src/components/Designer/Sidebar/DetailView/TextPropEditor.js.map +1 -0
  50. package/dist/cjs/src/components/Designer/Sidebar/DetailView/TypeAndKeyEditor.js +72 -0
  51. package/dist/cjs/src/components/Designer/Sidebar/DetailView/TypeAndKeyEditor.js.map +1 -0
  52. package/dist/cjs/src/components/Designer/Sidebar/DetailView/index.js +54 -0
  53. package/dist/cjs/src/components/Designer/Sidebar/DetailView/index.js.map +1 -0
  54. package/dist/cjs/src/components/Designer/Sidebar/ListView/Item.js +76 -0
  55. package/dist/cjs/src/components/Designer/Sidebar/ListView/Item.js.map +1 -0
  56. package/dist/cjs/src/components/Designer/Sidebar/ListView/SelectableSortableContainer.js +108 -0
  57. package/dist/cjs/src/components/Designer/Sidebar/ListView/SelectableSortableContainer.js.map +1 -0
  58. package/dist/cjs/src/components/Designer/Sidebar/ListView/SelectableSortableItem.js +62 -0
  59. package/dist/cjs/src/components/Designer/Sidebar/ListView/SelectableSortableItem.js.map +1 -0
  60. package/dist/cjs/src/components/Designer/Sidebar/ListView/index.js +84 -0
  61. package/dist/cjs/src/components/Designer/Sidebar/ListView/index.js.map +1 -0
  62. package/dist/cjs/src/components/Designer/Sidebar/index.js +105 -0
  63. package/dist/cjs/src/components/Designer/Sidebar/index.js.map +1 -0
  64. package/dist/cjs/src/components/Designer/index.js +235 -0
  65. package/dist/cjs/src/components/Designer/index.js.map +1 -0
  66. package/dist/cjs/src/components/Divider.js +9 -0
  67. package/dist/cjs/src/components/Divider.js.map +1 -0
  68. package/dist/cjs/src/components/Error.js +41 -0
  69. package/dist/cjs/src/components/Error.js.map +1 -0
  70. package/dist/cjs/src/components/Paper.js +63 -0
  71. package/dist/cjs/src/components/Paper.js.map +1 -0
  72. package/dist/cjs/src/components/Preview.js +102 -0
  73. package/dist/cjs/src/components/Preview.js.map +1 -0
  74. package/dist/cjs/src/components/Root.js +52 -0
  75. package/dist/cjs/src/components/Root.js.map +1 -0
  76. package/dist/cjs/src/components/Schemas/BarcodeSchema.js +107 -0
  77. package/dist/cjs/src/components/Schemas/BarcodeSchema.js.map +1 -0
  78. package/dist/cjs/src/components/Schemas/ImageSchema.js +72 -0
  79. package/dist/cjs/src/components/Schemas/ImageSchema.js.map +1 -0
  80. package/dist/cjs/src/components/Schemas/SchemaUI.js +55 -0
  81. package/dist/cjs/src/components/Schemas/SchemaUI.js.map +1 -0
  82. package/dist/cjs/src/components/Schemas/TextSchema.js +54 -0
  83. package/dist/cjs/src/components/Schemas/TextSchema.js.map +1 -0
  84. package/dist/cjs/src/components/Spinner.js +31 -0
  85. package/dist/cjs/src/components/Spinner.js.map +1 -0
  86. package/dist/cjs/src/components/UnitPager.js +63 -0
  87. package/dist/cjs/src/components/UnitPager.js.map +1 -0
  88. package/dist/cjs/src/constants.js +10 -0
  89. package/dist/cjs/src/constants.js.map +1 -0
  90. package/dist/cjs/src/contexts.js +10 -0
  91. package/dist/cjs/src/contexts.js.map +1 -0
  92. package/dist/cjs/src/helper.js +466 -0
  93. package/dist/cjs/src/helper.js.map +1 -0
  94. package/dist/cjs/src/hooks.js +100 -0
  95. package/dist/cjs/src/hooks.js.map +1 -0
  96. package/dist/cjs/src/i18n.js +50 -0
  97. package/dist/cjs/src/i18n.js.map +1 -0
  98. package/dist/cjs/src/index.js +24 -0
  99. package/dist/cjs/src/index.js.map +1 -0
  100. package/dist/esm/__tests__/assets/helper.js +51 -0
  101. package/dist/esm/__tests__/assets/helper.js.map +1 -0
  102. package/dist/esm/__tests__/components/Designer.test.js +34 -0
  103. package/dist/esm/__tests__/components/Designer.test.js.map +1 -0
  104. package/dist/esm/__tests__/components/Preview.test.js +46 -0
  105. package/dist/esm/__tests__/components/Preview.test.js.map +1 -0
  106. package/dist/esm/__tests__/helper.test.js +92 -0
  107. package/dist/esm/__tests__/helper.test.js.map +1 -0
  108. package/dist/esm/src/Designer.js +57 -0
  109. package/dist/esm/src/Designer.js.map +1 -0
  110. package/dist/esm/src/Form.js +31 -0
  111. package/dist/esm/src/Form.js.map +1 -0
  112. package/dist/esm/src/Viewer.js +21 -0
  113. package/dist/esm/src/Viewer.js.map +1 -0
  114. package/dist/esm/src/assets/barcodeExamples/code128.png +0 -0
  115. package/dist/esm/src/assets/barcodeExamples/code39.png +0 -0
  116. package/dist/esm/src/assets/barcodeExamples/ean13.png +0 -0
  117. package/dist/esm/src/assets/barcodeExamples/ean8.png +0 -0
  118. package/dist/esm/src/assets/barcodeExamples/itf14.png +0 -0
  119. package/dist/esm/src/assets/barcodeExamples/japanpost.png +0 -0
  120. package/dist/esm/src/assets/barcodeExamples/nw7.png +0 -0
  121. package/dist/esm/src/assets/barcodeExamples/qrcode.png +0 -0
  122. package/dist/esm/src/assets/barcodeExamples/upca.png +0 -0
  123. package/dist/esm/src/assets/barcodeExamples/upce.png +0 -0
  124. package/dist/esm/src/class.js +112 -0
  125. package/dist/esm/src/class.js.map +1 -0
  126. package/dist/esm/src/components/CtlBar/Pager.js +24 -0
  127. package/dist/esm/src/components/CtlBar/Pager.js.map +1 -0
  128. package/dist/esm/src/components/CtlBar/Zoom.js +26 -0
  129. package/dist/esm/src/components/CtlBar/Zoom.js.map +1 -0
  130. package/dist/esm/src/components/CtlBar/index.js +28 -0
  131. package/dist/esm/src/components/CtlBar/index.js.map +1 -0
  132. package/dist/esm/src/components/Designer/Main/Guides.js +28 -0
  133. package/dist/esm/src/components/Designer/Main/Guides.js.map +1 -0
  134. package/dist/esm/src/components/Designer/Main/Mask.js +13 -0
  135. package/dist/esm/src/components/Designer/Main/Mask.js.map +1 -0
  136. package/dist/esm/src/components/Designer/Main/Moveable.js +9 -0
  137. package/dist/esm/src/components/Designer/Main/Moveable.js.map +1 -0
  138. package/dist/esm/src/components/Designer/Main/Selecto.js +6 -0
  139. package/dist/esm/src/components/Designer/Main/Selecto.js.map +1 -0
  140. package/dist/esm/src/components/Designer/Main/index.js +196 -0
  141. package/dist/esm/src/components/Designer/Main/index.js.map +1 -0
  142. package/dist/esm/src/components/Designer/Sidebar/DetailView/ExampleInputEditor.js +44 -0
  143. package/dist/esm/src/components/Designer/Sidebar/DetailView/ExampleInputEditor.js.map +1 -0
  144. package/dist/esm/src/components/Designer/Sidebar/DetailView/PositionAndSizeEditor.js +179 -0
  145. package/dist/esm/src/components/Designer/Sidebar/DetailView/PositionAndSizeEditor.js.map +1 -0
  146. package/dist/esm/src/components/Designer/Sidebar/DetailView/TextPropEditor.js +91 -0
  147. package/dist/esm/src/components/Designer/Sidebar/DetailView/TextPropEditor.js.map +1 -0
  148. package/dist/esm/src/components/Designer/Sidebar/DetailView/TypeAndKeyEditor.js +47 -0
  149. package/dist/esm/src/components/Designer/Sidebar/DetailView/TypeAndKeyEditor.js.map +1 -0
  150. package/dist/esm/src/components/Designer/Sidebar/DetailView/index.js +26 -0
  151. package/dist/esm/src/components/Designer/Sidebar/DetailView/index.js.map +1 -0
  152. package/dist/esm/src/components/Designer/Sidebar/ListView/Item.js +51 -0
  153. package/dist/esm/src/components/Designer/Sidebar/ListView/Item.js.map +1 -0
  154. package/dist/esm/src/components/Designer/Sidebar/ListView/SelectableSortableContainer.js +80 -0
  155. package/dist/esm/src/components/Designer/Sidebar/ListView/SelectableSortableContainer.js.map +1 -0
  156. package/dist/esm/src/components/Designer/Sidebar/ListView/SelectableSortableItem.js +34 -0
  157. package/dist/esm/src/components/Designer/Sidebar/ListView/SelectableSortableItem.js.map +1 -0
  158. package/dist/esm/src/components/Designer/Sidebar/ListView/index.js +56 -0
  159. package/dist/esm/src/components/Designer/Sidebar/ListView/index.js.map +1 -0
  160. package/dist/esm/src/components/Designer/Sidebar/index.js +77 -0
  161. package/dist/esm/src/components/Designer/Sidebar/index.js.map +1 -0
  162. package/dist/esm/src/components/Designer/index.js +207 -0
  163. package/dist/esm/src/components/Designer/index.js.map +1 -0
  164. package/dist/esm/src/components/Divider.js +4 -0
  165. package/dist/esm/src/components/Divider.js.map +1 -0
  166. package/dist/esm/src/components/Error.js +16 -0
  167. package/dist/esm/src/components/Error.js.map +1 -0
  168. package/dist/esm/src/components/Paper.js +38 -0
  169. package/dist/esm/src/components/Paper.js.map +1 -0
  170. package/dist/esm/src/components/Preview.js +74 -0
  171. package/dist/esm/src/components/Preview.js.map +1 -0
  172. package/dist/esm/src/components/Root.js +24 -0
  173. package/dist/esm/src/components/Root.js.map +1 -0
  174. package/dist/esm/src/components/Schemas/BarcodeSchema.js +79 -0
  175. package/dist/esm/src/components/Schemas/BarcodeSchema.js.map +1 -0
  176. package/dist/esm/src/components/Schemas/ImageSchema.js +47 -0
  177. package/dist/esm/src/components/Schemas/ImageSchema.js.map +1 -0
  178. package/dist/esm/src/components/Schemas/SchemaUI.js +27 -0
  179. package/dist/esm/src/components/Schemas/SchemaUI.js.map +1 -0
  180. package/dist/esm/src/components/Schemas/TextSchema.js +29 -0
  181. package/dist/esm/src/components/Schemas/TextSchema.js.map +1 -0
  182. package/dist/esm/src/components/Spinner.js +26 -0
  183. package/dist/esm/src/components/Spinner.js.map +1 -0
  184. package/dist/esm/src/components/UnitPager.js +58 -0
  185. package/dist/esm/src/components/UnitPager.js.map +1 -0
  186. package/dist/esm/src/constants.js +7 -0
  187. package/dist/esm/src/constants.js.map +1 -0
  188. package/dist/esm/src/contexts.js +7 -0
  189. package/dist/esm/src/contexts.js.map +1 -0
  190. package/dist/esm/src/helper.js +439 -0
  191. package/dist/esm/src/helper.js.map +1 -0
  192. package/dist/esm/src/hooks.js +93 -0
  193. package/dist/esm/src/hooks.js.map +1 -0
  194. package/dist/esm/src/i18n.js +46 -0
  195. package/dist/esm/src/i18n.js.map +1 -0
  196. package/dist/esm/src/index.js +6 -0
  197. package/dist/esm/src/index.js.map +1 -0
  198. package/dist/types/__tests__/assets/helper.d.ts +3 -0
  199. package/dist/types/__tests__/components/Designer.test.d.ts +1 -0
  200. package/dist/types/__tests__/components/Preview.test.d.ts +1 -0
  201. package/dist/types/__tests__/helper.test.d.ts +1 -0
  202. package/dist/types/{Designer.d.ts → src/Designer.d.ts} +1 -1
  203. package/dist/types/{Form.d.ts → src/Form.d.ts} +1 -1
  204. package/dist/types/{Viewer.d.ts → src/Viewer.d.ts} +1 -1
  205. package/dist/types/{class.d.ts → src/class.d.ts} +12 -12
  206. package/dist/types/{components → src/components}/CtlBar/Pager.d.ts +1 -0
  207. package/dist/types/{components → src/components}/CtlBar/Zoom.d.ts +1 -0
  208. package/dist/types/{components → src/components}/CtlBar/index.d.ts +1 -0
  209. package/dist/types/{components → src/components}/Designer/Main/Guides.d.ts +0 -0
  210. package/dist/types/{components → src/components}/Designer/Main/Mask.d.ts +1 -0
  211. package/dist/types/{components → src/components}/Designer/Main/Moveable.d.ts +0 -0
  212. package/dist/types/{components → src/components}/Designer/Main/Selecto.d.ts +1 -0
  213. package/dist/types/{components → src/components}/Designer/Main/index.d.ts +0 -0
  214. package/dist/types/{components → src/components}/Designer/Sidebar/DetailView/ExampleInputEditor.d.ts +1 -0
  215. package/dist/types/{components → src/components}/Designer/Sidebar/DetailView/PositionAndSizeEditor.d.ts +2 -1
  216. package/dist/types/{components → src/components}/Designer/Sidebar/DetailView/TextPropEditor.d.ts +1 -0
  217. package/dist/types/{components → src/components}/Designer/Sidebar/DetailView/TypeAndKeyEditor.d.ts +2 -1
  218. package/dist/types/{components → src/components}/Designer/Sidebar/DetailView/index.d.ts +2 -1
  219. package/dist/types/{components → src/components}/Designer/Sidebar/ListView/Item.d.ts +0 -0
  220. package/dist/types/{components → src/components}/Designer/Sidebar/ListView/SelectableSortableContainer.d.ts +2 -1
  221. package/dist/types/{components → src/components}/Designer/Sidebar/ListView/SelectableSortableItem.d.ts +0 -0
  222. package/dist/types/{components → src/components}/Designer/Sidebar/ListView/index.d.ts +2 -1
  223. package/dist/types/{components → src/components}/Designer/Sidebar/index.d.ts +1 -0
  224. package/dist/types/{components → src/components}/Designer/index.d.ts +24 -23
  225. package/dist/types/{components → src/components}/Divider.d.ts +1 -0
  226. package/dist/types/{components → src/components}/Error.d.ts +1 -0
  227. package/dist/types/{components → src/components}/Paper.d.ts +0 -0
  228. package/dist/types/{components → src/components}/Preview.d.ts +1 -0
  229. package/dist/types/{components → src/components}/Root.d.ts +0 -0
  230. package/dist/types/{components → src/components}/Schemas/BarcodeSchema.d.ts +3 -3
  231. package/dist/types/{components → src/components}/Schemas/ImageSchema.d.ts +3 -3
  232. package/dist/types/{components → src/components}/Schemas/SchemaUI.d.ts +1 -1
  233. package/dist/types/{components → src/components}/Schemas/TextSchema.d.ts +7 -7
  234. package/dist/types/{components → src/components}/Spinner.d.ts +1 -0
  235. package/dist/types/{components → src/components}/UnitPager.d.ts +1 -0
  236. package/dist/types/{constants.d.ts → src/constants.d.ts} +0 -0
  237. package/dist/types/src/contexts.d.ts +7 -0
  238. package/dist/types/{helper.d.ts → src/helper.d.ts} +19 -19
  239. package/dist/types/{hooks.d.ts → src/hooks.d.ts} +1 -1
  240. package/dist/types/{i18n.d.ts → src/i18n.d.ts} +0 -9
  241. package/dist/types/{index.d.ts → src/index.d.ts} +3 -3
  242. package/package.json +22 -9
  243. package/src/Designer.tsx +5 -5
  244. package/src/Form.tsx +4 -4
  245. package/src/Viewer.tsx +4 -4
  246. package/src/class.ts +3 -3
  247. package/src/components/CtlBar/Pager.tsx +4 -5
  248. package/src/components/CtlBar/Zoom.tsx +4 -7
  249. package/src/components/CtlBar/index.tsx +2 -2
  250. package/src/components/Designer/Main/Guides.tsx +1 -1
  251. package/src/components/Designer/Main/Mask.tsx +1 -1
  252. package/src/components/Designer/Main/Selecto.tsx +1 -1
  253. package/src/components/Designer/Main/index.tsx +9 -9
  254. package/src/components/Designer/Sidebar/DetailView/ExampleInputEditor.tsx +4 -4
  255. package/src/components/Designer/Sidebar/DetailView/PositionAndSizeEditor.tsx +95 -19
  256. package/src/components/Designer/Sidebar/DetailView/TextPropEditor.tsx +3 -3
  257. package/src/components/Designer/Sidebar/DetailView/TypeAndKeyEditor.tsx +2 -2
  258. package/src/components/Designer/Sidebar/DetailView/index.tsx +7 -7
  259. package/src/components/Designer/Sidebar/ListView/Item.tsx +8 -10
  260. package/src/components/Designer/Sidebar/ListView/SelectableSortableContainer.tsx +3 -3
  261. package/src/components/Designer/Sidebar/ListView/SelectableSortableItem.tsx +3 -3
  262. package/src/components/Designer/Sidebar/ListView/index.tsx +5 -5
  263. package/src/components/Designer/Sidebar/index.tsx +11 -7
  264. package/src/components/Designer/index.tsx +9 -9
  265. package/src/components/Error.tsx +1 -1
  266. package/src/components/Paper.tsx +2 -2
  267. package/src/components/Preview.tsx +9 -9
  268. package/src/components/Root.tsx +2 -3
  269. package/src/components/Schemas/BarcodeSchema.tsx +2 -2
  270. package/src/components/Schemas/ImageSchema.tsx +6 -6
  271. package/src/components/Schemas/SchemaUI.tsx +4 -4
  272. package/src/components/Schemas/TextSchema.tsx +2 -2
  273. package/src/components/UnitPager.tsx +11 -12
  274. package/src/contexts.ts +2 -2
  275. package/src/helper.ts +2 -2
  276. package/src/hooks.ts +2 -2
  277. package/src/i18n.ts +1 -19
  278. package/src/index.ts +3 -3
  279. package/tsconfig.cjs.json +10 -0
  280. package/tsconfig.esm.json +10 -0
  281. package/dist/index.js +0 -3
  282. package/dist/index.js.LICENSE.txt +0 -97
  283. package/dist/index.js.map +0 -1
  284. package/dist/types/contexts.d.ts +0 -7
  285. package/src/assets/icons/add.svg +0 -3
  286. package/src/assets/icons/align-horizontal-center.svg +0 -1
  287. package/src/assets/icons/align-horizontal-left.svg +0 -1
  288. package/src/assets/icons/align-horizontal-right.svg +0 -1
  289. package/src/assets/icons/align-vertical-bottom.svg +0 -1
  290. package/src/assets/icons/align-vertical-middle.svg +0 -1
  291. package/src/assets/icons/align-vertical-top.svg +0 -1
  292. package/src/assets/icons/back.svg +0 -4
  293. package/src/assets/icons/close.svg +0 -4
  294. package/src/assets/icons/double-left.svg +0 -11
  295. package/src/assets/icons/double-right.svg +0 -11
  296. package/src/assets/icons/drag.svg +0 -3
  297. package/src/assets/icons/forward.svg +0 -4
  298. package/src/assets/icons/horizontal-distribute.svg +0 -1
  299. package/src/assets/icons/left.svg +0 -4
  300. package/src/assets/icons/remove.svg +0 -3
  301. package/src/assets/icons/right.svg +0 -4
  302. package/src/assets/icons/vertical-distribute.svg +0 -1
  303. package/src/assets/icons/warning.svg +0 -4
  304. package/src/assets/imageExample.png +0 -0
  305. package/tsconfig.json +0 -22
  306. package/webpack.config.js +0 -54
package/src/Form.tsx CHANGED
@@ -1,10 +1,10 @@
1
1
  import React from 'react';
2
2
  import ReactDOM from 'react-dom';
3
3
  import { PreviewProps } from '@pdfme/common';
4
- import { PreviewUI } from './class';
5
- import { DESTROYED_ERR_MSG } from './constants';
6
- import { I18nContext, FontContext } from './contexts';
7
- import Preview from './components/Preview';
4
+ import { PreviewUI } from './class.js';
5
+ import { DESTROYED_ERR_MSG } from './constants.js';
6
+ import { I18nContext, FontContext } from './contexts.js';
7
+ import Preview from './components/Preview.js';
8
8
 
9
9
  class Form extends PreviewUI {
10
10
  private onChangeInputCallback?: (arg: { index: number; value: string; key: string }) => void;
package/src/Viewer.tsx CHANGED
@@ -1,10 +1,10 @@
1
1
  import React from 'react';
2
2
  import ReactDOM from 'react-dom';
3
3
  import { PreviewProps } from '@pdfme/common';
4
- import { PreviewUI } from './class';
5
- import { DESTROYED_ERR_MSG } from './constants';
6
- import { I18nContext, FontContext } from './contexts';
7
- import Preview from './components/Preview';
4
+ import { PreviewUI } from './class.js';
5
+ import { DESTROYED_ERR_MSG } from './constants.js';
6
+ import { I18nContext, FontContext } from './contexts.js';
7
+ import Preview from './components/Preview.js';
8
8
 
9
9
  class Viewer extends PreviewUI {
10
10
  constructor(props: PreviewProps) {
package/src/class.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import ReactDOM from 'react-dom';
2
- import { curriedI18n } from './i18n';
3
- import { DESTROYED_ERR_MSG, DEFAULT_LANG } from './constants';
4
- import { debounce, flatten, cloneDeep } from './helper';
2
+ import { curriedI18n } from './i18n.js';
3
+ import { DESTROYED_ERR_MSG, DEFAULT_LANG } from './constants.js';
4
+ import { debounce, flatten, cloneDeep } from './helper.js';
5
5
  import {
6
6
  Template,
7
7
  Size,
@@ -1,7 +1,6 @@
1
1
  import React, { useContext } from 'react';
2
- import left from '../../assets/icons/left.svg';
3
- import right from '../../assets/icons/right.svg';
4
- import { I18nContext } from '../../contexts';
2
+ import { ChevronLeftIcon, ChevronRightIcon } from '@heroicons/react/24/outline';
3
+ import { I18nContext } from '../../contexts.js';
5
4
 
6
5
  const btnStyle: React.CSSProperties = {
7
6
  cursor: 'pointer',
@@ -31,7 +30,7 @@ const Pager = ({ pageCursor, pageNum, setPageCursor }: Props) => {
31
30
  disabled={pageCursor <= 0}
32
31
  onClick={() => setPageCursor(pageCursor - 1)}
33
32
  >
34
- <img src={left} alt={i18n('goToPrevious')} style={{ width: 20 }} />
33
+ <ChevronLeftIcon width={20} height={20} color={'#fff'} />
35
34
  </button>
36
35
  <strong style={{ color: 'white', fontSize: '0.9rem', minWidth: 45, textAlign: 'center' }}>
37
36
  {pageCursor + 1}/{pageNum}
@@ -45,7 +44,7 @@ const Pager = ({ pageCursor, pageNum, setPageCursor }: Props) => {
45
44
  disabled={pageCursor + 1 >= pageNum}
46
45
  onClick={() => setPageCursor(pageCursor + 1)}
47
46
  >
48
- <img src={right} alt={i18n('goToNext')} style={{ width: 20 }} />
47
+ <ChevronRightIcon width={20} height={20} color={'#fff'} />
49
48
  </button>
50
49
  </div>
51
50
  );
@@ -1,7 +1,5 @@
1
- import React, { useContext } from 'react';
2
- import { I18nContext } from '../../contexts';
3
- import add from '../../assets/icons/add.svg';
4
- import remove from '../../assets/icons/remove.svg';
1
+ import React from 'react';
2
+ import { MinusIcon, PlusIcon } from '@heroicons/react/24/outline';
5
3
 
6
4
  const btnStyle: React.CSSProperties = {
7
5
  cursor: 'pointer',
@@ -21,7 +19,6 @@ type Props = {
21
19
  };
22
20
 
23
21
  const Pager = ({ zoomLevel, setZoomLevel }: Props) => {
24
- const i18n = useContext(I18nContext);
25
22
  const nextZoomOut = zoomLevel - zoomStep;
26
23
  const nextZoomIn = zoomLevel + zoomStep;
27
24
 
@@ -36,7 +33,7 @@ const Pager = ({ zoomLevel, setZoomLevel }: Props) => {
36
33
  disabled={minZoom >= nextZoomOut}
37
34
  onClick={() => setZoomLevel(nextZoomOut)}
38
35
  >
39
- <img src={remove} alt={i18n('zoomOut')} style={{ width: 20 }} />
36
+ <MinusIcon width={20} height={20} color={'#fff'} />
40
37
  </button>
41
38
  <strong style={{ color: 'white', fontSize: '0.9rem', minWidth: 50, textAlign: 'center' }}>
42
39
  {Math.round(zoomLevel * 100)}%
@@ -50,7 +47,7 @@ const Pager = ({ zoomLevel, setZoomLevel }: Props) => {
50
47
  disabled={maxZoom < nextZoomIn}
51
48
  onClick={() => setZoomLevel(nextZoomIn)}
52
49
  >
53
- <img src={add} alt={i18n('zoomIn')} style={{ width: 20 }} />
50
+ <PlusIcon width={20} height={20} color={'#fff'} />
54
51
  </button>
55
52
  </div>
56
53
  );
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
- import Pager from './Pager';
3
- import Zoom from './Zoom';
2
+ import Pager from './Pager.js';
3
+ import Zoom from './Zoom.js';
4
4
  import { Size } from '@pdfme/common';
5
5
 
6
6
  type Props = {
@@ -1,7 +1,7 @@
1
1
  import React, { Ref } from 'react';
2
2
  import Guides from '@scena/react-guides';
3
3
  import { Size } from '@pdfme/common';
4
- import { ZOOM, RULER_HEIGHT } from '../../../constants';
4
+ import { ZOOM, RULER_HEIGHT } from '../../../constants.js';
5
5
 
6
6
  const _Guides = ({
7
7
  paperSize,
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import { Size } from '@pdfme/common';
3
- import { RULER_HEIGHT } from '../../../constants';
3
+ import { RULER_HEIGHT } from '../../../constants.js';
4
4
 
5
5
  const Mask = ({ width, height }: Size) => (
6
6
  <div
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import Selecto, { OnDragStart as _OnDragStart, OnSelect as _OnSelect } from 'react-selecto';
3
- import { SELECTABLE_CLASSNAME } from '../../../constants';
3
+ import { SELECTABLE_CLASSNAME } from '../../../constants.js';
4
4
 
5
5
  const _Selecto = ({
6
6
  container,
@@ -9,15 +9,15 @@ import React, {
9
9
  } from 'react';
10
10
  import { OnDrag, OnResize, OnClick } from 'react-moveable';
11
11
  import { SchemaForUI, Size } from '@pdfme/common';
12
- import { ZOOM, RULER_HEIGHT } from '../../../constants';
13
- import { usePrevious } from '../../../hooks';
14
- import { uuid, round, flatten } from '../../../helper';
15
- import Paper from '../../Paper';
16
- import SchemaUI from '../../Schemas/SchemaUI';
17
- import Selecto from './Selecto';
18
- import Moveable from './Moveable';
19
- import Guides from './Guides';
20
- import Mask from './Mask';
12
+ import { ZOOM, RULER_HEIGHT } from '../../../constants.js';
13
+ import { usePrevious } from '../../../hooks.js';
14
+ import { uuid, round, flatten } from '../../../helper.js';
15
+ import Paper from '../../Paper.js';
16
+ import SchemaUI from '../../Schemas/SchemaUI.js';
17
+ import Selecto from './Selecto.js';
18
+ import Moveable from './Moveable.js';
19
+ import Guides from './Guides.js';
20
+ import Mask from './Mask.js';
21
21
 
22
22
  const DELETE_BTN_ID = uuid();
23
23
  const fmt4Num = (prop: string) => Number(prop.replace('px', ''));
@@ -1,9 +1,9 @@
1
1
  import React, { useContext } from 'react';
2
2
  import { SchemaForUI } from '@pdfme/common';
3
- import { readFiles } from '../../../../helper';
4
- import { I18nContext } from '../../../../contexts';
3
+ import { readFiles } from '../../../../helper.js';
4
+ import { I18nContext } from '../../../../contexts.js';
5
5
  import { SidebarProps } from '..';
6
- import closeIcon from '../../../../assets/icons/close.svg';
6
+ import { XMarkIcon } from '@heroicons/react/24/outline';
7
7
 
8
8
  const ExampleInputEditor = (
9
9
  props: Pick<SidebarProps, 'changeSchemas'> & { activeSchema: SchemaForUI }
@@ -39,7 +39,7 @@ const ExampleInputEditor = (
39
39
  changeSchemas([{ key: 'data', value: '', schemaId: activeSchema.id }])
40
40
  }
41
41
  >
42
- <img src={closeIcon} alt="Close icon" width={10} />
42
+ <XMarkIcon width={10} height={10} />
43
43
  </button>
44
44
  <img style={{ maxHeight: 180 }} src={activeSchema.data} alt="Input Example" />
45
45
  </div>
@@ -1,15 +1,7 @@
1
1
  import React, { CSSProperties } from 'react';
2
2
  import { SchemaForUI } from '@pdfme/common';
3
- import { round } from '../../../../helper';
4
- import { SidebarProps } from '..';
5
- import alignVerticalTop from '../../../../assets/icons/align-vertical-top.svg';
6
- import alignVerticalMiddle from '../../../../assets/icons/align-vertical-middle.svg';
7
- import alignVerticalBottom from '../../../../assets/icons/align-vertical-bottom.svg';
8
- import alignHorizontalRight from '../../../../assets/icons/align-horizontal-right.svg';
9
- import alignHorizontalLeft from '../../../../assets/icons/align-horizontal-left.svg';
10
- import alignHorizontalCenter from '../../../../assets/icons/align-horizontal-center.svg';
11
- import verticalDistribute from '../../../../assets/icons/vertical-distribute.svg';
12
- import horizontalDistribute from '../../../../assets/icons/horizontal-distribute.svg';
3
+ import { round } from '../../../../helper.js';
4
+ import { SidebarProps } from '../index.js';
13
5
 
14
6
  const inputSetStyle: CSSProperties = { marginRight: '1rem', display: 'flex', alignItems: 'center' };
15
7
 
@@ -30,6 +22,16 @@ const buttonStyle: CSSProperties = {
30
22
  cursor: 'pointer',
31
23
  };
32
24
 
25
+ const svgBaseProp = {
26
+ style: { width: '100%', height: '100%' },
27
+ xmlns: 'http://www.w3.org/2000/svg',
28
+ enableBackground: 'new 0 0 24 24',
29
+ height: '24px',
30
+ viewBox: '0 0 24 24',
31
+ width: '24px',
32
+ fill: '#000000',
33
+ };
34
+
33
35
  const PositionAndSizeEditor = (
34
36
  props: Pick<SidebarProps, 'pageSize' | 'schemas' | 'changeSchemas' | 'activeElements'> & {
35
37
  activeSchema: SchemaForUI;
@@ -99,14 +101,86 @@ const PositionAndSizeEditor = (
99
101
  };
100
102
 
101
103
  const layoutBtns: { id: string; icon: any; action: () => void }[] = [
102
- { id: 'left', icon: alignHorizontalLeft, action: () => align('left') },
103
- { id: 'center', icon: alignHorizontalCenter, action: () => align('center') },
104
- { id: 'right', icon: alignHorizontalRight, action: () => align('right') },
105
- { id: 'top', icon: alignVerticalTop, action: () => align('top') },
106
- { id: 'middle', icon: alignVerticalMiddle, action: () => align('middle') },
107
- { id: 'bottom', icon: alignVerticalBottom, action: () => align('bottom') },
108
- { id: 'vertical', icon: verticalDistribute, action: () => distribute('vertical') },
109
- { id: 'horizontal', icon: horizontalDistribute, action: () => distribute('horizontal') },
104
+ {
105
+ id: 'left',
106
+ icon: (
107
+ <svg {...svgBaseProp}>
108
+ <rect fill="none" height="24" width="24" />
109
+ <path d="M4,22H2V2h2V22z M22,7H6v3h16V7z M16,14H6v3h10V14z" />
110
+ </svg>
111
+ ),
112
+ action: () => align('left'),
113
+ },
114
+ {
115
+ id: 'center',
116
+ icon: (
117
+ <svg {...svgBaseProp}>
118
+ <rect fill="none" height="24" width="24" />
119
+ <polygon points="11,2 13,2 13,7 21,7 21,10 13,10 13,14 18,14 18,17 13,17 13,22 11,22 11,17 6,17 6,14 11,14 11,10 3,10 3,7 11,7" />
120
+ </svg>
121
+ ),
122
+ action: () => align('center'),
123
+ },
124
+ {
125
+ id: 'right',
126
+ icon: (
127
+ <svg {...svgBaseProp}>
128
+ <rect fill="none" height="24" width="24" />
129
+ <path d="M20,2h2v20h-2V2z M2,10h16V7H2V10z M8,17h10v-3H8V17z" />
130
+ </svg>
131
+ ),
132
+ action: () => align('right'),
133
+ },
134
+ {
135
+ id: 'top',
136
+ icon: (
137
+ <svg {...svgBaseProp}>
138
+ <rect fill="none" height="24" width="24" />
139
+ <path d="M22,2v2H2V2H22z M7,22h3V6H7V22z M14,16h3V6h-3V16z" />
140
+ </svg>
141
+ ),
142
+ action: () => align('top'),
143
+ },
144
+ {
145
+ id: 'middle',
146
+ icon: (
147
+ <svg {...svgBaseProp}>
148
+ <rect fill="none" height="24" width="24" />
149
+ <polygon points="22,11 17,11 17,6 14,6 14,11 10,11 10,3 7,3 7,11 1.84,11 1.84,13 7,13 7,21 10,21 10,13 14,13 14,18 17,18 17,13 22,13" />
150
+ </svg>
151
+ ),
152
+ action: () => align('middle'),
153
+ },
154
+ {
155
+ id: 'bottom',
156
+ icon: (
157
+ <svg {...svgBaseProp}>
158
+ <rect fill="none" height="24" width="24" />
159
+ <path d="M22,22H2v-2h20V22z M10,2H7v16h3V2z M17,8h-3v10h3V8z" />
160
+ </svg>
161
+ ),
162
+ action: () => align('bottom'),
163
+ },
164
+ {
165
+ id: 'vertical',
166
+ icon: (
167
+ <svg {...svgBaseProp}>
168
+ <rect fill="none" height="24" width="24" />
169
+ <path d="M22,2v2H2V2H22z M7,10.5v3h10v-3H7z M2,20v2h20v-2H2z" />
170
+ </svg>
171
+ ),
172
+ action: () => distribute('vertical'),
173
+ },
174
+ {
175
+ id: 'horizontal',
176
+ icon: (
177
+ <svg {...svgBaseProp}>
178
+ <rect fill="none" height="24" width="24" />
179
+ <path d="M4,22H2V2h2V22z M22,2h-2v20h2V2z M13.5,7h-3v10h3V7z" />
180
+ </svg>
181
+ ),
182
+ action: () => distribute('horizontal'),
183
+ },
110
184
  ];
111
185
 
112
186
  return (
@@ -114,7 +188,9 @@ const PositionAndSizeEditor = (
114
188
  <div style={{ display: 'flex', alignItems: 'center', marginBottom: '0.5rem' }}>
115
189
  {layoutBtns.map((b) => (
116
190
  <button key={b.id} title={b.id} onClick={b.action} style={buttonStyle}>
117
- <img width={15} src={b.icon} />
191
+ <object width={15} height={15}>
192
+ {b.icon}
193
+ </object>
118
194
  </button>
119
195
  ))}
120
196
  </div>
@@ -7,9 +7,9 @@ import {
7
7
  DEFAULT_CHARACTER_SPACING,
8
8
  DEFAULT_FONT_COLOR,
9
9
  } from '@pdfme/common';
10
- import { FontContext } from '../../../../contexts';
10
+ import { FontContext } from '../../../../contexts.js';
11
11
  import { SidebarProps } from '..';
12
- import closeIcon from '../../../../assets/icons/close.svg';
12
+ import { XMarkIcon } from '@heroicons/react/24/outline';
13
13
 
14
14
  const inputStyle = {
15
15
  width: '90%',
@@ -60,7 +60,7 @@ const ColorInputSet = (props: {
60
60
  cursor: 'pointer',
61
61
  }}
62
62
  >
63
- <img src={closeIcon} width={10} alt="Close icon" />
63
+ <XMarkIcon width={10} height={10} />
64
64
  </button>
65
65
  </div>
66
66
  </div>
@@ -1,7 +1,7 @@
1
1
  import React, { useContext, useRef, useCallback } from 'react';
2
2
  import { schemaTypes, SchemaForUI } from '@pdfme/common';
3
- import { SidebarProps } from '..';
4
- import { I18nContext } from '../../../../contexts';
3
+ import { SidebarProps } from '../index.js';
4
+ import { I18nContext } from '../../../../contexts.js';
5
5
 
6
6
  const ErrorLabel = ({ isError, msg }: { isError: boolean; msg: string }) => (
7
7
  <span
@@ -1,12 +1,12 @@
1
1
  import React, { useContext } from 'react';
2
2
  import { SchemaForUI } from '@pdfme/common';
3
- import { I18nContext } from '../../../../contexts';
4
- import Divider from '../../../Divider';
5
- import { SidebarProps } from '..';
6
- import TextPropEditor from './TextPropEditor';
7
- import ExampleInputEditor from './ExampleInputEditor';
8
- import PositionAndSizeEditor from './PositionAndSizeEditor';
9
- import TypeAndKeyEditor from './TypeAndKeyEditor';
3
+ import { I18nContext } from '../../../../contexts.js';
4
+ import Divider from '../../../Divider.js';
5
+ import { SidebarProps } from '../index.js';
6
+ import TextPropEditor from './TextPropEditor.js';
7
+ import ExampleInputEditor from './ExampleInputEditor.js';
8
+ import PositionAndSizeEditor from './PositionAndSizeEditor.js';
9
+ import TypeAndKeyEditor from './TypeAndKeyEditor.js';
10
10
 
11
11
  const DetailView = (
12
12
  props: Pick<SidebarProps, 'schemas' | 'pageSize' | 'changeSchemas' | 'activeElements'> & {
@@ -1,8 +1,7 @@
1
1
  import React, { useEffect, useContext } from 'react';
2
2
  import { DraggableSyntheticListeners } from '@dnd-kit/core';
3
- import { I18nContext } from '../../../../contexts';
4
- import dragIcon from '../../../../assets/icons/drag.svg';
5
- import warningIcon from '../../../../assets/icons/warning.svg';
3
+ import { I18nContext } from '../../../../contexts.js';
4
+ import { ExclamationTriangleIcon } from '@heroicons/react/24/outline';
6
5
 
7
6
  interface Props {
8
7
  value: React.ReactNode;
@@ -73,7 +72,11 @@ const Item = React.memo(
73
72
  {...listeners}
74
73
  style={{ padding: '0.5rem', background: 'none', border: 'none', display: 'flex' }}
75
74
  >
76
- <img style={{ cursor: 'grab' }} src={dragIcon} width={15} alt="Drag icon" />
75
+ <object style={{ cursor: 'grab' }} width={15}>
76
+ <svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" width="16" height="16">
77
+ <path d="M10 13a1 1 0 100-2 1 1 0 000 2zm-4 0a1 1 0 100-2 1 1 0 000 2zm1-5a1 1 0 11-2 0 1 1 0 012 0zm3 1a1 1 0 100-2 1 1 0 000 2zm1-5a1 1 0 11-2 0 1 1 0 012 0zM6 5a1 1 0 100-2 1 1 0 000 2z"></path>
78
+ </svg>
79
+ </object>
77
80
  </button>
78
81
  <div
79
82
  style={{
@@ -92,12 +95,7 @@ const Item = React.memo(
92
95
  value
93
96
  ) : (
94
97
  <span style={{ display: 'flex', alignItems: 'center' }}>
95
- <img
96
- alt="Warning icon"
97
- src={warningIcon}
98
- width={15}
99
- style={{ marginRight: '0.5rem' }}
100
- />
98
+ <ExclamationTriangleIcon width={15} style={{ marginRight: '0.5rem' }} />
101
99
  {status === 'is-warning' ? i18n('noKeyName') : value}
102
100
  {status === 'is-danger' ? i18n('notUniq') : ''}
103
101
  </span>
@@ -16,9 +16,9 @@ import {
16
16
  verticalListSortingStrategy,
17
17
  } from '@dnd-kit/sortable';
18
18
  import { SchemaForUI } from '@pdfme/common';
19
- import Item from './Item';
20
- import SelectableSortableItem from './SelectableSortableItem';
21
- import { SidebarProps } from '../';
19
+ import Item from './Item.js';
20
+ import SelectableSortableItem from './SelectableSortableItem.js';
21
+ import { SidebarProps } from '../index.js';
22
22
 
23
23
  const SelectableSortableContainer = (
24
24
  props: Pick<
@@ -1,9 +1,9 @@
1
1
  import React, { useContext } from 'react';
2
2
  import { useSortable } from '@dnd-kit/sortable';
3
3
  import { SchemaForUI } from '@pdfme/common';
4
- import { I18nContext } from '../../../../contexts';
5
- import Item from './Item';
6
- import { useMountStatus } from '../../../../hooks';
4
+ import { I18nContext } from '../../../../contexts.js';
5
+ import Item from './Item.js';
6
+ import { useMountStatus } from '../../../../hooks.js';
7
7
 
8
8
  interface Props {
9
9
  isSelected: boolean;
@@ -1,9 +1,9 @@
1
1
  import React, { useContext, useState } from 'react';
2
- import { ZOOM, RULER_HEIGHT, SIDEBAR_WIDTH } from '../../../../constants';
3
- import { I18nContext } from '../../../../contexts';
4
- import Divider from '../../../Divider';
5
- import SelectableSortableContainer from './SelectableSortableContainer';
6
- import { SidebarProps } from '..';
2
+ import { RULER_HEIGHT, SIDEBAR_WIDTH } from '../../../../constants.js';
3
+ import { I18nContext } from '../../../../contexts.js';
4
+ import Divider from '../../../Divider.js';
5
+ import SelectableSortableContainer from './SelectableSortableContainer.js';
6
+ import { SidebarProps } from '../index.js';
7
7
 
8
8
  const ListView = (
9
9
  props: Pick<
@@ -1,11 +1,10 @@
1
1
  import React, { useState, useContext } from 'react';
2
2
  import { SchemaForUI, Size } from '@pdfme/common';
3
- import { ZOOM, RULER_HEIGHT, SIDEBAR_WIDTH } from '../../../constants';
4
- import { I18nContext } from '../../../contexts';
5
- import backIcon from '../../../assets/icons/back.svg';
6
- import forwardIcon from '../../../assets/icons/forward.svg';
7
- import ListView from './ListView';
8
- import DetailView from './DetailView';
3
+ import { RULER_HEIGHT, SIDEBAR_WIDTH } from '../../../constants.js';
4
+ import { I18nContext } from '../../../contexts.js';
5
+ import { ArrowLeftIcon, ArrowRightIcon } from '@heroicons/react/24/outline';
6
+ import ListView from './ListView/index.js';
7
+ import DetailView from './DetailView/index.js';
9
8
 
10
9
  export type SidebarProps = {
11
10
  height: number;
@@ -61,10 +60,15 @@ const Sidebar = (props: SidebarProps) => {
61
60
  cursor: 'pointer',
62
61
  background: '#eee',
63
62
  width: 30,
63
+ height: 30,
64
64
  }}
65
65
  onClick={() => setOpen(!open)}
66
66
  >
67
- <img src={open ? forwardIcon : backIcon} width={15} alt="Toggle icon" />
67
+ {open ? (
68
+ <ArrowRightIcon width={15} height={15} />
69
+ ) : (
70
+ <ArrowLeftIcon width={15} height={15} />
71
+ )}
68
72
  </button>
69
73
  <div
70
74
  style={{
@@ -1,9 +1,9 @@
1
1
  import React, { useRef, useState, useEffect, useContext, useCallback } from 'react';
2
2
  import { DesignerReactProps, Template, SchemaForUI } from '@pdfme/common';
3
- import Sidebar from './Sidebar';
4
- import Main from './Main';
5
- import { ZOOM, RULER_HEIGHT } from '../../constants';
6
- import { I18nContext } from '../../contexts';
3
+ import Sidebar from './Sidebar/index.js';
4
+ import Main from './Main/index.js';
5
+ import { ZOOM, RULER_HEIGHT } from '../../constants.js';
6
+ import { I18nContext } from '../../contexts.js';
7
7
  import {
8
8
  uuid,
9
9
  set,
@@ -18,11 +18,11 @@ import {
18
18
  getUniqSchemaKey,
19
19
  moveCommandToChangeSchemasArg,
20
20
  getPagesScrollTopByIndex,
21
- } from '../../helper';
22
- import { useUIPreProcessor, useScrollPageCursor } from '../../hooks';
23
- import Root from '../Root';
24
- import Error from '../Error';
25
- import CtlBar from '../CtlBar';
21
+ } from '../../helper.js';
22
+ import { useUIPreProcessor, useScrollPageCursor } from '../../hooks.js';
23
+ import Root from '../Root.js';
24
+ import Error from '../Error.js';
25
+ import CtlBar from '../CtlBar/index.js';
26
26
 
27
27
  const TemplateEditor = ({
28
28
  template,
@@ -1,6 +1,6 @@
1
1
  import React, { useContext } from 'react';
2
2
  import { Size } from '@pdfme/common';
3
- import { I18nContext } from '../contexts';
3
+ import { I18nContext } from '../contexts.js';
4
4
 
5
5
  const Error = ({ size, error }: { size: Size; error: Error }) => {
6
6
  const i18n = useContext(I18nContext);
@@ -1,7 +1,7 @@
1
1
  import React, { MutableRefObject, ReactNode, useContext } from 'react';
2
2
  import { SchemaForUI, Size, getFallbackFontName } from '@pdfme/common';
3
- import { FontContext } from '../contexts';
4
- import { ZOOM, RULER_HEIGHT } from '../constants';
3
+ import { FontContext } from '../contexts.js';
4
+ import { ZOOM, RULER_HEIGHT } from '../constants.js';
5
5
 
6
6
  const Paper = (porps: {
7
7
  paperRefs: MutableRefObject<HTMLDivElement[]>;
@@ -1,14 +1,14 @@
1
1
  import React, { useCallback, useRef, useState, useEffect } from 'react';
2
2
  import { PreviewReactProps, SchemaForUI } from '@pdfme/common';
3
- import { ZOOM, RULER_HEIGHT } from '../constants';
4
- import UnitPager from './UnitPager';
5
- import Root from './Root';
6
- import Error from './Error';
7
- import CtlBar from './CtlBar';
8
- import Paper from './Paper';
9
- import SchemaUI from './Schemas/SchemaUI';
10
- import { useUIPreProcessor, useScrollPageCursor } from '../hooks';
11
- import { templateSchemas2SchemasList, getPagesScrollTopByIndex } from '../helper';
3
+ import { ZOOM, RULER_HEIGHT } from '../constants.js';
4
+ import UnitPager from './UnitPager.js';
5
+ import Root from './Root.js';
6
+ import Error from './Error.js';
7
+ import CtlBar from './CtlBar/index.js';
8
+ import Paper from './Paper.js';
9
+ import SchemaUI from './Schemas/SchemaUI.js';
10
+ import { useUIPreProcessor, useScrollPageCursor } from '../hooks.js';
11
+ import { templateSchemas2SchemasList, getPagesScrollTopByIndex } from '../helper.js';
12
12
 
13
13
  const Preview = ({ template, inputs, size, onChangeInput }: PreviewReactProps) => {
14
14
  const rootRef = useRef<HTMLDivElement>(null);
@@ -1,9 +1,8 @@
1
1
  import type {} from 'css-font-loading-module';
2
2
  import React, { useContext, forwardRef, ReactNode, Ref, useEffect } from 'react';
3
3
  import { Size } from '@pdfme/common';
4
- import { RULER_HEIGHT } from '../constants';
5
- import { FontContext } from '../contexts';
6
- import Spinner from './Spinner';
4
+ import { FontContext } from '../contexts.js';
5
+ import Spinner from './Spinner.js';
7
6
 
8
7
  type Props = { size: Size; scale: number; children: ReactNode };
9
8
 
@@ -1,7 +1,7 @@
1
1
  import React, { forwardRef, Ref } from 'react';
2
2
  import { validateBarcodeInput, BarCodeType, BarcodeSchema } from '@pdfme/common';
3
- import { ZOOM } from '../../constants';
4
- import { SchemaUIProps } from './SchemaUI';
3
+ import { ZOOM } from '../../constants.js';
4
+ import { SchemaUIProps } from './SchemaUI.js';
5
5
  import ean8 from '../../assets/barcodeExamples/ean8.png';
6
6
  import ean13 from '../../assets/barcodeExamples/ean13.png';
7
7
  import code39 from '../../assets/barcodeExamples/code39.png';
@@ -1,9 +1,9 @@
1
- import React, { useState, forwardRef, ChangeEvent, useContext, Ref } from 'react';
1
+ import React, { useState, forwardRef, ChangeEvent, Ref } from 'react';
2
2
  import { ImageSchema } from '@pdfme/common';
3
- import { SchemaUIProps } from './SchemaUI';
4
- import { readFiles } from '../../helper';
5
- import { ZOOM } from '../../constants';
6
- import closeIcon from '../../assets/icons/close.svg';
3
+ import { SchemaUIProps } from './SchemaUI.js';
4
+ import { readFiles } from '../../helper.js';
5
+ import { ZOOM } from '../../constants.js';
6
+ import { XMarkIcon } from '@heroicons/react/24/outline';
7
7
 
8
8
  type Props = SchemaUIProps & { schema: ImageSchema };
9
9
 
@@ -55,7 +55,7 @@ const ImageSchemaUI = (props: Props, ref: Ref<HTMLInputElement>) => {
55
55
  onChange('');
56
56
  }}
57
57
  >
58
- <img src={closeIcon} alt="Close icon" width={10} />
58
+ <XMarkIcon width={10} height={10} />
59
59
  </button>
60
60
  )}
61
61
  </div>