sk-front-lib 0.14.8 → 0.15.3

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 (327) hide show
  1. package/api/package.json +5 -6
  2. package/api/sk-api.module.d.ts +7 -0
  3. package/api/sk-api.service.d.ts +3 -0
  4. package/api/sk-front-lib-api.d.ts +1 -0
  5. package/article/package.json +5 -6
  6. package/article/sk-article-editor-server.component.d.ts +3 -0
  7. package/article/sk-article-editor.component.d.ts +3 -0
  8. package/article/sk-article-server.module.d.ts +6 -0
  9. package/article/sk-article.module.d.ts +7 -0
  10. package/article/sk-article.service.d.ts +3 -0
  11. package/article/sk-froala-editor.directive.d.ts +3 -0
  12. package/article/sk-front-lib-article.d.ts +1 -0
  13. package/crud/package.json +5 -6
  14. package/crud/sk-account.service.d.ts +3 -0
  15. package/crud/sk-auth-admin.guard.d.ts +3 -0
  16. package/crud/sk-auth.guard.d.ts +3 -0
  17. package/crud/sk-auth.service.d.ts +3 -0
  18. package/crud/sk-board.service.d.ts +3 -0
  19. package/crud/sk-brand.service.d.ts +3 -0
  20. package/crud/sk-cart.service.d.ts +7 -0
  21. package/crud/sk-category.service.d.ts +3 -0
  22. package/crud/sk-comment.service.d.ts +3 -0
  23. package/crud/sk-config.service.d.ts +3 -0
  24. package/crud/sk-contact.service.d.ts +3 -0
  25. package/crud/sk-coupon.service.d.ts +3 -0
  26. package/crud/sk-document.service.d.ts +3 -0
  27. package/crud/sk-etc.service.d.ts +3 -0
  28. package/crud/sk-file.service.d.ts +3 -0
  29. package/crud/sk-front-lib-crud.d.ts +1 -1
  30. package/crud/sk-keyword.service.d.ts +3 -0
  31. package/crud/sk-order.service.d.ts +3 -0
  32. package/crud/sk-point.service.d.ts +3 -0
  33. package/crud/sk-product.service.d.ts +4 -0
  34. package/crud/sk-promotion.service.d.ts +3 -0
  35. package/crud/sk-search.service.d.ts +3 -0
  36. package/crud/sk-store.service.d.ts +3 -0
  37. package/crud/sk-user.service.d.ts +3 -0
  38. package/{esm2015/api/model/api-config.js → esm2020/api/model/api-config.mjs} +0 -0
  39. package/{esm2015/api/model/api-pageable-param.js → esm2020/api/model/api-pageable-param.mjs} +0 -0
  40. package/{esm2015/api/model/api-pageable.js → esm2020/api/model/api-pageable.mjs} +0 -0
  41. package/{esm2015/api/model/api-response.js → esm2020/api/model/api-response.mjs} +0 -0
  42. package/{esm2015/api/model/index.js → esm2020/api/model/index.mjs} +0 -0
  43. package/{esm2015/api/public_api.js → esm2020/api/public_api.mjs} +0 -0
  44. package/esm2020/api/sk-api.module.mjs +35 -0
  45. package/esm2020/api/sk-api.service.mjs +145 -0
  46. package/{esm2015/api/sk-front-lib-api.js → esm2020/api/sk-front-lib-api.mjs} +0 -0
  47. package/{esm2015/article/public_api.js → esm2020/article/public_api.mjs} +0 -0
  48. package/esm2020/article/sk-article-editor-server.component.mjs +51 -0
  49. package/esm2020/article/sk-article-editor.component.mjs +93 -0
  50. package/esm2020/article/sk-article-server.module.mjs +33 -0
  51. package/esm2020/article/sk-article.module.mjs +32 -0
  52. package/esm2020/article/sk-article.service.mjs +248 -0
  53. package/esm2020/article/sk-froala-editor.directive.mjs +325 -0
  54. package/{esm2015/article/sk-front-lib-article.js → esm2020/article/sk-front-lib-article.mjs} +0 -0
  55. package/{esm2015/crud/public_api.js → esm2020/crud/public_api.mjs} +0 -0
  56. package/esm2020/crud/sk-account.service.mjs +36 -0
  57. package/esm2020/crud/sk-auth-admin.guard.mjs +31 -0
  58. package/esm2020/crud/sk-auth.guard.mjs +31 -0
  59. package/esm2020/crud/sk-auth.service.mjs +67 -0
  60. package/esm2020/crud/sk-board.service.mjs +54 -0
  61. package/esm2020/crud/sk-brand.service.mjs +46 -0
  62. package/esm2020/crud/sk-cart.service.mjs +255 -0
  63. package/esm2020/crud/sk-category.service.mjs +63 -0
  64. package/esm2020/crud/sk-comment.service.mjs +43 -0
  65. package/esm2020/crud/sk-config.service.mjs +31 -0
  66. package/esm2020/crud/sk-contact.service.mjs +39 -0
  67. package/esm2020/crud/sk-coupon.service.mjs +62 -0
  68. package/esm2020/crud/sk-document.service.mjs +95 -0
  69. package/esm2020/crud/sk-etc.service.mjs +25 -0
  70. package/esm2020/crud/sk-file.service.mjs +37 -0
  71. package/esm2020/crud/sk-front-lib-crud.mjs +5 -0
  72. package/esm2020/crud/sk-keyword.service.mjs +46 -0
  73. package/esm2020/crud/sk-order.service.mjs +133 -0
  74. package/esm2020/crud/sk-point.service.mjs +45 -0
  75. package/esm2020/crud/sk-product.service.mjs +156 -0
  76. package/esm2020/crud/sk-promotion.service.mjs +81 -0
  77. package/esm2020/crud/sk-search.service.mjs +25 -0
  78. package/esm2020/crud/sk-store.service.mjs +47 -0
  79. package/esm2020/crud/sk-user.service.mjs +69 -0
  80. package/esm2020/google-analytics/google-analytics-router.module.mjs +30 -0
  81. package/esm2020/google-analytics/google-analytics.module.mjs +40 -0
  82. package/esm2020/google-analytics/initializers/google-analytics-router.initializer.mjs +24 -0
  83. package/esm2020/google-analytics/initializers/google-analytics.initializer.mjs +46 -0
  84. package/{esm2015/google-analytics/interfaces/google-analytics-command.js → esm2020/google-analytics/interfaces/google-analytics-command.mjs} +0 -0
  85. package/{esm2015/google-analytics/interfaces/google-analytics-settings.js → esm2020/google-analytics/interfaces/google-analytics-settings.mjs} +0 -0
  86. package/{esm2015/google-analytics/public_api.js → esm2020/google-analytics/public_api.mjs} +0 -0
  87. package/esm2020/google-analytics/services/google-analytics.service.mjs +200 -0
  88. package/{esm2015/google-analytics/sk-front-lib-google-analytics.js → esm2020/google-analytics/sk-front-lib-google-analytics.mjs} +0 -0
  89. package/{esm2015/google-analytics/tokens/google-analytics-settings-token.js → esm2020/google-analytics/tokens/google-analytics-settings-token.mjs} +0 -0
  90. package/{esm2015/google-analytics/types/ga-action.type.js → esm2020/google-analytics/types/ga-action.type.mjs} +0 -0
  91. package/{esm2015/google-analytics/types/ga-bind.type.js → esm2020/google-analytics/types/ga-bind.type.mjs} +0 -0
  92. package/esm2020/image/public_api.mjs +3 -0
  93. package/esm2020/image/sk-front-lib-image.mjs +5 -0
  94. package/esm2020/image/sk-image.component.mjs +262 -0
  95. package/esm2020/image/sk-image.module.mjs +43 -0
  96. package/{esm2015/lib/sk-animations.js → esm2020/lib/sk-animations.mjs} +0 -0
  97. package/esm2020/lib/sk-byte.pipe.mjs +18 -0
  98. package/esm2020/lib/sk-date-time.pipe.mjs +16 -0
  99. package/esm2020/lib/sk-date.pipe.mjs +16 -0
  100. package/esm2020/lib/sk-front-lib.module.mjs +42 -0
  101. package/esm2020/lib/sk-keys.pipe.mjs +23 -0
  102. package/esm2020/lib/sk-time.pipe.mjs +16 -0
  103. package/{esm2015/lib/sk-utils.js → esm2020/lib/sk-utils.mjs} +0 -0
  104. package/{esm2015/model/lib/article.js → esm2020/model/lib/article.mjs} +0 -0
  105. package/{esm2015/model/lib/audit.js → esm2020/model/lib/audit.mjs} +0 -0
  106. package/{esm2015/model/lib/auth.js → esm2020/model/lib/auth.mjs} +0 -0
  107. package/{esm2015/model/lib/board.js → esm2020/model/lib/board.mjs} +0 -0
  108. package/{esm2015/model/lib/cart.js → esm2020/model/lib/cart.mjs} +0 -0
  109. package/{esm2015/model/lib/comment.js → esm2020/model/lib/comment.mjs} +0 -0
  110. package/{esm2015/model/lib/contact.js → esm2020/model/lib/contact.mjs} +0 -0
  111. package/{esm2015/model/lib/coupon.js → esm2020/model/lib/coupon.mjs} +0 -0
  112. package/{esm2015/model/lib/document.js → esm2020/model/lib/document.mjs} +0 -0
  113. package/{esm2015/model/lib/etc.js → esm2020/model/lib/etc.mjs} +0 -0
  114. package/{esm2015/model/lib/file.js → esm2020/model/lib/file.mjs} +0 -0
  115. package/{esm2015/model/lib/filetype.js → esm2020/model/lib/filetype.mjs} +0 -0
  116. package/{esm2015/model/lib/grid.js → esm2020/model/lib/grid.mjs} +0 -0
  117. package/{esm2015/model/lib/nicepay.js → esm2020/model/lib/nicepay.mjs} +0 -0
  118. package/{esm2015/model/lib/order.js → esm2020/model/lib/order.mjs} +0 -0
  119. package/{esm2015/model/lib/payment.js → esm2020/model/lib/payment.mjs} +0 -0
  120. package/{esm2015/model/lib/point.js → esm2020/model/lib/point.mjs} +0 -0
  121. package/{esm2015/model/lib/product-series.js → esm2020/model/lib/product-series.mjs} +0 -0
  122. package/{esm2015/model/lib/product.js → esm2020/model/lib/product.mjs} +1 -1
  123. package/esm2020/model/lib/promotion.mjs +79 -0
  124. package/{esm2015/model/lib/shipping.js → esm2020/model/lib/shipping.mjs} +0 -0
  125. package/{esm2015/model/lib/user.js → esm2020/model/lib/user.mjs} +0 -0
  126. package/{esm2015/model/public_api.js → esm2020/model/public_api.mjs} +0 -0
  127. package/{esm2015/model/sk-front-lib-model.js → esm2020/model/sk-front-lib-model.mjs} +0 -0
  128. package/{esm2015/public-api.js → esm2020/public-api.mjs} +2 -1
  129. package/esm2020/search-address/dialog/dialog.component.mjs +27 -0
  130. package/{esm2015/search-address/public_api.js → esm2020/search-address/public_api.mjs} +0 -0
  131. package/esm2020/search-address/sk-front-lib-search-address.mjs +5 -0
  132. package/esm2020/search-address/sk-search-address.directive.mjs +41 -0
  133. package/{esm2015/search-address/sk-search-address.model.js → esm2020/search-address/sk-search-address.model.mjs} +0 -0
  134. package/esm2020/search-address/sk-search-address.module.mjs +52 -0
  135. package/{esm2015/search-address/sk-search-address.service.js → esm2020/search-address/sk-search-address.service.mjs} +10 -8
  136. package/esm2020/sk-front-lib.mjs +5 -0
  137. package/{esm2015/uploader/public_api.js → esm2020/uploader/public_api.mjs} +0 -0
  138. package/esm2020/uploader/sk-front-lib-uploader.mjs +5 -0
  139. package/{esm2015/uploader/sk-uploader-file-item.model.js → esm2020/uploader/sk-uploader-file-item.model.mjs} +0 -0
  140. package/{esm2015/uploader/sk-uploader.animation.js → esm2020/uploader/sk-uploader.animation.mjs} +0 -0
  141. package/{esm2015/uploader/sk-uploader.class.js → esm2020/uploader/sk-uploader.class.mjs} +0 -0
  142. package/esm2020/uploader/sk-uploader.component.mjs +120 -0
  143. package/esm2020/uploader/sk-uploader.directive.mjs +44 -0
  144. package/esm2020/uploader/sk-uploader.module.mjs +62 -0
  145. package/fesm2015/sk-front-lib-api.mjs +218 -0
  146. package/fesm2015/sk-front-lib-api.mjs.map +1 -0
  147. package/fesm2015/{sk-front-lib-article.js → sk-front-lib-article.mjs} +183 -158
  148. package/fesm2015/sk-front-lib-article.mjs.map +1 -0
  149. package/fesm2015/sk-front-lib-crud.mjs +1403 -0
  150. package/fesm2015/sk-front-lib-crud.mjs.map +1 -0
  151. package/fesm2015/{sk-front-lib-google-analytics.js → sk-front-lib-google-analytics.mjs} +54 -33
  152. package/fesm2015/sk-front-lib-google-analytics.mjs.map +1 -0
  153. package/fesm2015/{sk-front-lib-image.js → sk-front-lib-image.mjs} +64 -48
  154. package/fesm2015/sk-front-lib-image.mjs.map +1 -0
  155. package/fesm2015/{sk-front-lib-model.js → sk-front-lib-model.mjs} +9 -2
  156. package/fesm2015/sk-front-lib-model.mjs.map +1 -0
  157. package/fesm2015/sk-front-lib-search-address.mjs +188 -0
  158. package/fesm2015/sk-front-lib-search-address.mjs.map +1 -0
  159. package/fesm2015/sk-front-lib-uploader.mjs +551 -0
  160. package/fesm2015/sk-front-lib-uploader.mjs.map +1 -0
  161. package/fesm2015/{sk-front-lib.js → sk-front-lib.mjs} +69 -41
  162. package/fesm2015/sk-front-lib.mjs.map +1 -0
  163. package/{fesm2015/sk-front-lib-api.js → fesm2020/sk-front-lib-api.mjs} +41 -26
  164. package/fesm2020/sk-front-lib-api.mjs.map +1 -0
  165. package/fesm2020/sk-front-lib-article.mjs +771 -0
  166. package/fesm2020/sk-front-lib-article.mjs.map +1 -0
  167. package/{fesm2015/sk-front-lib-crud.js → fesm2020/sk-front-lib-crud.mjs} +213 -236
  168. package/fesm2020/sk-front-lib-crud.mjs.map +1 -0
  169. package/fesm2020/sk-front-lib-google-analytics.mjs +336 -0
  170. package/fesm2020/sk-front-lib-google-analytics.mjs.map +1 -0
  171. package/fesm2020/sk-front-lib-image.mjs +309 -0
  172. package/fesm2020/sk-front-lib-image.mjs.map +1 -0
  173. package/fesm2020/sk-front-lib-model.mjs +1052 -0
  174. package/fesm2020/sk-front-lib-model.mjs.map +1 -0
  175. package/fesm2020/sk-front-lib-search-address.mjs +186 -0
  176. package/fesm2020/sk-front-lib-search-address.mjs.map +1 -0
  177. package/fesm2020/sk-front-lib-uploader.mjs +549 -0
  178. package/fesm2020/sk-front-lib-uploader.mjs.map +1 -0
  179. package/fesm2020/sk-front-lib.mjs +539 -0
  180. package/fesm2020/sk-front-lib.mjs.map +1 -0
  181. package/google-analytics/google-analytics-router.module.d.ts +6 -0
  182. package/google-analytics/google-analytics.module.d.ts +5 -0
  183. package/google-analytics/package.json +5 -6
  184. package/google-analytics/services/google-analytics.service.d.ts +3 -0
  185. package/google-analytics/sk-front-lib-google-analytics.d.ts +1 -0
  186. package/image/package.json +5 -6
  187. package/image/public_api.d.ts +1 -0
  188. package/image/sk-front-lib-image.d.ts +1 -1
  189. package/image/sk-image.component.d.ts +6 -3
  190. package/image/sk-image.module.d.ts +10 -0
  191. package/lib/sk-byte.pipe.d.ts +3 -0
  192. package/lib/sk-date-time.pipe.d.ts +3 -0
  193. package/lib/sk-date.pipe.d.ts +3 -0
  194. package/lib/sk-front-lib.module.d.ts +9 -0
  195. package/lib/sk-keys.pipe.d.ts +3 -0
  196. package/lib/sk-time.pipe.d.ts +3 -0
  197. package/model/lib/product.d.ts +1 -0
  198. package/model/lib/promotion.d.ts +12 -1
  199. package/model/package.json +5 -6
  200. package/model/sk-front-lib-model.d.ts +1 -0
  201. package/package.json +96 -20
  202. package/public-api.d.ts +1 -0
  203. package/search-address/dialog/dialog.component.d.ts +3 -0
  204. package/search-address/package.json +5 -6
  205. package/search-address/sk-front-lib-search-address.d.ts +1 -2
  206. package/search-address/sk-search-address.directive.d.ts +3 -0
  207. package/search-address/sk-search-address.module.d.ts +12 -0
  208. package/search-address/sk-search-address.service.d.ts +3 -0
  209. package/sk-front-lib.d.ts +1 -1
  210. package/uploader/package.json +5 -6
  211. package/uploader/sk-front-lib-uploader.d.ts +1 -1
  212. package/uploader/sk-uploader.component.d.ts +3 -0
  213. package/uploader/sk-uploader.directive.d.ts +3 -0
  214. package/uploader/sk-uploader.module.d.ts +14 -0
  215. package/api/sk-front-lib-api.metadata.json +0 -1
  216. package/article/sk-front-lib-article.metadata.json +0 -1
  217. package/bundles/sk-front-lib-api.umd.js +0 -230
  218. package/bundles/sk-front-lib-api.umd.js.map +0 -1
  219. package/bundles/sk-front-lib-api.umd.min.js +0 -2
  220. package/bundles/sk-front-lib-api.umd.min.js.map +0 -1
  221. package/bundles/sk-front-lib-article.umd.js +0 -772
  222. package/bundles/sk-front-lib-article.umd.js.map +0 -1
  223. package/bundles/sk-front-lib-article.umd.min.js +0 -2
  224. package/bundles/sk-front-lib-article.umd.min.js.map +0 -1
  225. package/bundles/sk-front-lib-crud.umd.js +0 -1846
  226. package/bundles/sk-front-lib-crud.umd.js.map +0 -1
  227. package/bundles/sk-front-lib-crud.umd.min.js +0 -2
  228. package/bundles/sk-front-lib-crud.umd.min.js.map +0 -1
  229. package/bundles/sk-front-lib-google-analytics.umd.js +0 -673
  230. package/bundles/sk-front-lib-google-analytics.umd.js.map +0 -1
  231. package/bundles/sk-front-lib-google-analytics.umd.min.js +0 -16
  232. package/bundles/sk-front-lib-google-analytics.umd.min.js.map +0 -1
  233. package/bundles/sk-front-lib-image.umd.js +0 -312
  234. package/bundles/sk-front-lib-image.umd.js.map +0 -1
  235. package/bundles/sk-front-lib-image.umd.min.js +0 -2
  236. package/bundles/sk-front-lib-image.umd.min.js.map +0 -1
  237. package/bundles/sk-front-lib-model.umd.js +0 -1464
  238. package/bundles/sk-front-lib-model.umd.js.map +0 -1
  239. package/bundles/sk-front-lib-model.umd.min.js +0 -16
  240. package/bundles/sk-front-lib-model.umd.min.js.map +0 -1
  241. package/bundles/sk-front-lib-search-address.umd.js +0 -182
  242. package/bundles/sk-front-lib-search-address.umd.js.map +0 -1
  243. package/bundles/sk-front-lib-search-address.umd.min.js +0 -2
  244. package/bundles/sk-front-lib-search-address.umd.min.js.map +0 -1
  245. package/bundles/sk-front-lib-uploader.umd.js +0 -534
  246. package/bundles/sk-front-lib-uploader.umd.js.map +0 -1
  247. package/bundles/sk-front-lib-uploader.umd.min.js +0 -2
  248. package/bundles/sk-front-lib-uploader.umd.min.js.map +0 -1
  249. package/bundles/sk-front-lib.umd.js +0 -546
  250. package/bundles/sk-front-lib.umd.js.map +0 -1
  251. package/bundles/sk-front-lib.umd.min.js +0 -2
  252. package/bundles/sk-front-lib.umd.min.js.map +0 -1
  253. package/crud/sk-front-lib-crud.metadata.json +0 -1
  254. package/esm2015/api/sk-api.module.js +0 -24
  255. package/esm2015/api/sk-api.service.js +0 -144
  256. package/esm2015/article/sk-article-editor-server.component.js +0 -54
  257. package/esm2015/article/sk-article-editor.component.js +0 -85
  258. package/esm2015/article/sk-article-server.module.js +0 -26
  259. package/esm2015/article/sk-article.module.js +0 -23
  260. package/esm2015/article/sk-article.service.js +0 -235
  261. package/esm2015/article/sk-froala-editor.directive.js +0 -320
  262. package/esm2015/crud/sk-account.service.js +0 -38
  263. package/esm2015/crud/sk-auth-admin.guard.js +0 -35
  264. package/esm2015/crud/sk-auth.guard.js +0 -35
  265. package/esm2015/crud/sk-auth.service.js +0 -71
  266. package/esm2015/crud/sk-board.service.js +0 -55
  267. package/esm2015/crud/sk-brand.service.js +0 -47
  268. package/esm2015/crud/sk-cart.service.js +0 -260
  269. package/esm2015/crud/sk-category.service.js +0 -64
  270. package/esm2015/crud/sk-comment.service.js +0 -44
  271. package/esm2015/crud/sk-config.service.js +0 -33
  272. package/esm2015/crud/sk-contact.service.js +0 -40
  273. package/esm2015/crud/sk-coupon.service.js +0 -63
  274. package/esm2015/crud/sk-document.service.js +0 -96
  275. package/esm2015/crud/sk-etc.service.js +0 -27
  276. package/esm2015/crud/sk-file.service.js +0 -38
  277. package/esm2015/crud/sk-front-lib-crud.js +0 -6
  278. package/esm2015/crud/sk-keyword.service.js +0 -47
  279. package/esm2015/crud/sk-order.service.js +0 -134
  280. package/esm2015/crud/sk-point.service.js +0 -46
  281. package/esm2015/crud/sk-product.service.js +0 -154
  282. package/esm2015/crud/sk-promotion.service.js +0 -82
  283. package/esm2015/crud/sk-search.service.js +0 -26
  284. package/esm2015/crud/sk-store.service.js +0 -48
  285. package/esm2015/crud/sk-user.service.js +0 -70
  286. package/esm2015/google-analytics/google-analytics-router.module.js +0 -19
  287. package/esm2015/google-analytics/google-analytics.module.js +0 -33
  288. package/esm2015/google-analytics/initializers/google-analytics-router.initializer.js +0 -25
  289. package/esm2015/google-analytics/initializers/google-analytics.initializer.js +0 -47
  290. package/esm2015/google-analytics/services/google-analytics.service.js +0 -199
  291. package/esm2015/image/public_api.js +0 -2
  292. package/esm2015/image/sk-front-lib-image.js +0 -6
  293. package/esm2015/image/sk-image.component.js +0 -258
  294. package/esm2015/image/sk-image.module.js +0 -28
  295. package/esm2015/lib/sk-byte.pipe.js +0 -14
  296. package/esm2015/lib/sk-date-time.pipe.js +0 -12
  297. package/esm2015/lib/sk-date.pipe.js +0 -12
  298. package/esm2015/lib/sk-front-lib.module.js +0 -29
  299. package/esm2015/lib/sk-keys.pipe.js +0 -19
  300. package/esm2015/lib/sk-time.pipe.js +0 -12
  301. package/esm2015/model/lib/promotion.js +0 -72
  302. package/esm2015/search-address/dialog/dialog.component.js +0 -28
  303. package/esm2015/search-address/sk-front-lib-search-address.js +0 -7
  304. package/esm2015/search-address/sk-search-address.directive.js +0 -39
  305. package/esm2015/search-address/sk-search-address.module.js +0 -34
  306. package/esm2015/sk-front-lib.js +0 -6
  307. package/esm2015/uploader/sk-front-lib-uploader.js +0 -6
  308. package/esm2015/uploader/sk-uploader.component.js +0 -106
  309. package/esm2015/uploader/sk-uploader.directive.js +0 -40
  310. package/esm2015/uploader/sk-uploader.module.js +0 -39
  311. package/fesm2015/sk-front-lib-api.js.map +0 -1
  312. package/fesm2015/sk-front-lib-article.js.map +0 -1
  313. package/fesm2015/sk-front-lib-crud.js.map +0 -1
  314. package/fesm2015/sk-front-lib-google-analytics.js.map +0 -1
  315. package/fesm2015/sk-front-lib-image.js.map +0 -1
  316. package/fesm2015/sk-front-lib-model.js.map +0 -1
  317. package/fesm2015/sk-front-lib-search-address.js +0 -166
  318. package/fesm2015/sk-front-lib-search-address.js.map +0 -1
  319. package/fesm2015/sk-front-lib-uploader.js +0 -510
  320. package/fesm2015/sk-front-lib-uploader.js.map +0 -1
  321. package/fesm2015/sk-front-lib.js.map +0 -1
  322. package/google-analytics/sk-front-lib-google-analytics.metadata.json +0 -1
  323. package/image/sk-front-lib-image.metadata.json +0 -1
  324. package/model/sk-front-lib-model.metadata.json +0 -1
  325. package/search-address/sk-front-lib-search-address.metadata.json +0 -1
  326. package/sk-front-lib.metadata.json +0 -1
  327. package/uploader/sk-front-lib-uploader.metadata.json +0 -1
@@ -0,0 +1,771 @@
1
+ import * as i0 from '@angular/core';
2
+ import { Injectable, Inject, EventEmitter, forwardRef, Directive, Input, Output, Component, NgModule } from '@angular/core';
3
+ import { SkFile } from 'sk-front-lib/model';
4
+ import * as i1 from 'sk-front-lib/api';
5
+ import FroalaEditor from 'froala-editor';
6
+ import 'froala-editor/js/plugins.pkgd.min.js';
7
+ import { NG_VALUE_ACCESSOR } from '@angular/forms';
8
+ import { CommonModule } from '@angular/common';
9
+
10
+ class SkArticleService {
11
+ constructor(environment) {
12
+ this.environment = environment;
13
+ this.initializeFroala();
14
+ }
15
+ initializeFroala() {
16
+ FroalaEditor.DefineIconTemplate('material_design', '<i class="material-icons">[NAME]</i>');
17
+ this.loadFontWeight();
18
+ this.registerShortcuts();
19
+ }
20
+ loadFontWeight() {
21
+ // Define an icon.
22
+ FroalaEditor.DefineIcon('font-weight', { NAME: 'format_size', template: 'material_design' });
23
+ // Define a dropdown button.
24
+ FroalaEditor.RegisterCommand('font-weight-drop', {
25
+ // Button title.
26
+ title: 'Font Weight',
27
+ // Mark the button as a dropdown.
28
+ type: 'dropdown',
29
+ // Specify the icon for the button.
30
+ // If this option is not specified, the button name will be used.
31
+ icon: 'font-weight',
32
+ // Options for the dropdown.
33
+ options: {
34
+ 100: 'Thin',
35
+ 300: 'Light',
36
+ 400: 'Regular',
37
+ 500: 'Medium',
38
+ 700: 'Bold',
39
+ 900: 'Black'
40
+ },
41
+ // If present, the options property will be ignored.
42
+ // It can be used to define a custom HTML for the dropdown.
43
+ // html: function () {
44
+ // // The current context is the editor instance.
45
+ // return '';
46
+ // },
47
+ // Save the dropdown action into undo stack.
48
+ undo: true,
49
+ // Focus inside the editor before callback.
50
+ focus: true,
51
+ // Refresh the button state after the callback.
52
+ refreshAfterCallback: true,
53
+ // Callback.
54
+ callback(cmd, val, params) {
55
+ this.format.removeStyle('font-weight');
56
+ this.format.applyStyle('font-weight', val);
57
+ },
58
+ // Called when the dropdown button state might have changed.
59
+ // refresh: function ($btn) {
60
+ // // The current context is the editor instance.
61
+ // console.log (this.selection.element());
62
+ // console.log(this);
63
+ // },
64
+ // Called when the dropdown is shown.
65
+ // refreshOnShow: function ($btn, $dropdown) {
66
+ // // The current context is the editor instance.
67
+ // console.log (this.selection.element());
68
+ // }
69
+ });
70
+ }
71
+ registerShortcuts() {
72
+ FroalaEditor.RegisterShortcut(49, 'paragraphFormat', 'H1', '1', false);
73
+ FroalaEditor.RegisterShortcut(50, 'paragraphFormat', 'H2', '2', false);
74
+ FroalaEditor.RegisterShortcut(51, 'paragraphFormat', 'H3', '3', false);
75
+ FroalaEditor.RegisterShortcut(52, 'paragraphFormat', 'N', '4', false);
76
+ FroalaEditor.RegisterShortcut(66, 'font-weight-drop', '700');
77
+ }
78
+ getBaseConfig() {
79
+ return {
80
+ key: 'Ig1A7vB2D2E2E1F1B4muvugzxmwA-7I-7A5B-21qrC-11A2B2C2A1C9B3B3C6E2C1==',
81
+ editorClass: 'sk-custom',
82
+ fontFamily: {
83
+ 'Noto Sans KR, Noto Sans, Arial,Helvetica,sans-serif': 'Noto Sans',
84
+ 'Roboto, Arial,Helvetica,sans-serif': 'Roboto',
85
+ 'Georgia,serif': 'Georgia',
86
+ 'Impact,Charcoal,sans-serif': 'Impact',
87
+ 'Tahoma,Geneva,sans-serif': 'Tahoma',
88
+ '\'Times New Roman\',Times,serif': 'Times New Roman',
89
+ 'Verdana,Geneva,sans-serif': 'Verdana'
90
+ },
91
+ imageDefaultWidth: 0,
92
+ // remove image manager
93
+ // imageInsertButtons: ['imageBack', '|', 'imageUpload', 'imageByURL', 'imageManager'],
94
+ imageInsertButtons: ['imageBack', '|', 'imageUpload', 'imageByURL'],
95
+ imageEditButtons: ['imageAlign', 'imageCaption', 'imageRemove', '|', 'imageLink', 'linkOpen', 'linkEdit', 'linkRemove', '-', 'imageDisplay', 'imageStyle', 'imageAlt', 'imageSize'],
96
+ imageAllowedTypes: ['jpeg', 'jpg', 'png', 'gif'],
97
+ // remove video upload
98
+ // ['videoBack', '|', 'videoByURL', 'videoEmbed', 'videoUpload']
99
+ videoInsertButtons: ['videoBack', '|', 'videoByURL', 'videoEmbed'],
100
+ videoUpload: false,
101
+ videoResponsive: true,
102
+ pastePlain: true,
103
+ pasteDeniedAttrs: ['class', 'id', 'style'],
104
+ pasteDeniedTags: ['div'],
105
+ wordPasteKeepFormatting: false,
106
+ imagePaste: false,
107
+ quickInsertEnabled: false,
108
+ paragraphFormat: {
109
+ H1: '대제목',
110
+ H2: '소제목',
111
+ H3: '문단 제목',
112
+ N: '본문'
113
+ },
114
+ // toolbarContainer: '.sk-custom-editor-toolbar',
115
+ toolbarSticky: false,
116
+ toolbarBottom: false,
117
+ attribution: false,
118
+ helpSets: [
119
+ {
120
+ title: 'Gearlounge Custom',
121
+ commands: [
122
+ { val: 'OSkey1', desc: '대제목' },
123
+ { val: 'OSkey2', desc: '소제목' },
124
+ { val: 'OSkey3', desc: '문단 제목' },
125
+ { val: 'OSkey4', desc: '본문' }
126
+ ]
127
+ },
128
+ {
129
+ title: 'Inline Editor',
130
+ commands: [
131
+ { val: 'OSkeyE', desc: 'Show the editor' }
132
+ ]
133
+ },
134
+ {
135
+ title: 'Common actions',
136
+ commands: [
137
+ { val: 'OSkeyC', desc: 'Copy' },
138
+ { val: 'OSkeyX', desc: 'Cut' },
139
+ { val: 'OSkeyV', desc: 'Paste' },
140
+ { val: 'OSkeyZ', desc: 'Undo' },
141
+ { val: 'OSkeyShift+Z', desc: 'Redo' },
142
+ { val: 'OSkeyK', desc: 'Insert Link' },
143
+ { val: 'OSkeyP', desc: 'Insert Image' }
144
+ ]
145
+ },
146
+ {
147
+ title: 'Basic Formatting',
148
+ commands: [
149
+ { val: 'OSkeyA', desc: 'Select All' },
150
+ { val: 'OSkeyB', desc: 'Bold' },
151
+ { val: 'OSkeyI', desc: 'Italic' },
152
+ { val: 'OSkeyU', desc: 'Underline' },
153
+ { val: 'OSkeyS', desc: 'Strikethrough' },
154
+ { val: 'OSkey]', desc: 'Increase Indent' },
155
+ { val: 'OSkey[', desc: 'Decrease Indent' }
156
+ ]
157
+ },
158
+ {
159
+ title: 'Quote',
160
+ commands: [
161
+ { val: 'OSkey\'', desc: 'Increase quote level' },
162
+ { val: 'OSkeyShift+\'', desc: 'Decrease quote level' }
163
+ ]
164
+ },
165
+ {
166
+ title: 'Image / Video',
167
+ commands: [
168
+ { val: 'OSkey+', desc: 'Resize larger' },
169
+ { val: 'OSkey-', desc: 'Resize smaller' }
170
+ ]
171
+ },
172
+ {
173
+ title: 'Table',
174
+ commands: [
175
+ { val: 'Alt+Space', desc: 'Select table cell' },
176
+ { val: 'Shift+Left/Right arrow', desc: 'Extend selection one cell' },
177
+ { val: 'Shift+Up/Down arrow', desc: 'Extend selection one row' }
178
+ ]
179
+ },
180
+ {
181
+ title: 'Navigation',
182
+ commands: [
183
+ { val: 'OSkey/', desc: 'Shortcuts' },
184
+ { val: 'Alt+F10', desc: 'Focus popup / toolbar' },
185
+ { val: 'Esc', desc: 'Return focus to previous position' }
186
+ ]
187
+ }
188
+ ],
189
+ };
190
+ }
191
+ getToolbar(type = 'default') {
192
+ if (type === 'default') {
193
+ return {
194
+ toolbarButtons: {
195
+ moreText: {
196
+ buttons: ['font-weight-drop', 'fontFamily', 'fontSize', 'textColor', 'clearFormatting', 'italic', 'strikeThrough', 'subscript', 'superscript', 'backgroundColor', 'inlineClass', 'inlineStyle'],
197
+ buttonsVisible: 5
198
+ },
199
+ moreParagraph: {
200
+ buttons: ['paragraphFormat', 'alignLeft', 'alignCenter', 'formatUL', 'quote', 'alignRight', 'alignJustify', 'formatOLSimple', 'formatOL', 'paragraphStyle', 'lineHeight', 'outdent', 'indent'],
201
+ buttonsVisible: 5
202
+ },
203
+ moreRich: {
204
+ buttons: ['insertLink', 'insertImage', 'insertVideo', 'insertHR', 'insertTable', 'emoticons', 'fontAwesome', 'specialCharacters', 'embedly', 'insertFile'],
205
+ buttonsVisible: 4
206
+ },
207
+ moreMisc: {
208
+ buttons: ['undo', 'redo', 'fullscreen', 'print', 'getPDF', 'spellChecker', 'selectAll', 'html', 'help'],
209
+ align: 'right',
210
+ buttonsVisible: 3
211
+ }
212
+ },
213
+ toolbarButtonsSm: {
214
+ moreText: {
215
+ buttons: ['font-weight-drop', 'underline', 'strikeThrough', 'subscript', 'superscript', 'fontFamily', 'fontSize', 'textColor', 'backgroundColor', 'inlineClass', 'inlineStyle', 'clearFormatting'],
216
+ buttonsVisible: 2
217
+ },
218
+ moreParagraph: {
219
+ buttons: ['alignLeft', 'alignCenter', 'formatOLSimple', 'alignRight', 'alignJustify', 'formatOL', 'formatUL', 'paragraphFormat', 'paragraphStyle', 'lineHeight', 'outdent', 'indent', 'quote'],
220
+ buttonsVisible: 2
221
+ },
222
+ moreRich: {
223
+ buttons: ['insertLink', 'insertImage', 'insertVideo', 'insertTable', 'emoticons', 'fontAwesome', 'specialCharacters', 'embedly', 'insertFile', 'insertHR'],
224
+ buttonsVisible: 2
225
+ },
226
+ moreMisc: {
227
+ buttons: ['undo', 'redo', 'fullscreen', 'print', 'getPDF', 'spellChecker', 'selectAll', 'html', 'help'],
228
+ align: 'right',
229
+ buttonsVisible: 2
230
+ }
231
+ },
232
+ };
233
+ }
234
+ else if (type === 'simple') {
235
+ return {
236
+ toolbarButtons: [['font-weight-drop', 'fontFamily', 'fontSize', 'textColor', 'clearFormatting'], ['paragraphFormat', 'alignLeft', 'alignCenter', 'formatUL', 'quote'], ['insertLink']],
237
+ toolbarButtonsSm: [['font-weight-drop', 'fontFamily', 'fontSize', 'textColor', 'clearFormatting'], ['paragraphFormat', 'alignLeft', 'alignCenter', 'formatUL', 'quote'], ['insertLink']],
238
+ };
239
+ }
240
+ }
241
+ }
242
+ SkArticleService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: SkArticleService, deps: [{ token: 'environment' }], target: i0.ɵɵFactoryTarget.Injectable });
243
+ SkArticleService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: SkArticleService, providedIn: 'root' });
244
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: SkArticleService, decorators: [{
245
+ type: Injectable,
246
+ args: [{
247
+ providedIn: 'root'
248
+ }]
249
+ }], ctorParameters: function () { return [{ type: undefined, decorators: [{
250
+ type: Inject,
251
+ args: ['environment']
252
+ }] }]; } });
253
+
254
+ class SkFroalaEditorDirective {
255
+ constructor(el, zone) {
256
+ this.zone = zone;
257
+ // editor options
258
+ this._opts = {
259
+ immediateAngularModelUpdate: false,
260
+ angularIgnoreAttrs: null
261
+ };
262
+ this.SPECIAL_TAGS = ['img', 'button', 'input', 'a'];
263
+ this.INNER_HTML_ATTR = 'innerHTML';
264
+ this._hasSpecialTag = false;
265
+ this._editorInitialized = false;
266
+ this._oldModel = null;
267
+ // froalaModel directive as output: update model if editor contentChanged
268
+ this.froalaModelChange = new EventEmitter();
269
+ // froalaInit directive as output: send manual editor initialization
270
+ this.froalaInit = new EventEmitter();
271
+ // Begin ControlValueAccesor methods.
272
+ this.onChange = (_) => {
273
+ };
274
+ this.onTouched = () => {
275
+ };
276
+ const element = el.nativeElement;
277
+ // check if the element is a special tag
278
+ if (this.SPECIAL_TAGS.indexOf(element.tagName.toLowerCase()) != -1) {
279
+ this._hasSpecialTag = true;
280
+ }
281
+ this._element = element;
282
+ this.zone = zone;
283
+ }
284
+ // End ControlValueAccesor methods.
285
+ // froalaEditor directive as input: store the editor options
286
+ set froalaEditor(opts) {
287
+ this._opts = this.clone(opts || this._opts);
288
+ this._opts = { ...this._opts };
289
+ }
290
+ // froalaModel directive as input: store initial editor content
291
+ set froalaModel(content) {
292
+ this.updateEditor(content);
293
+ }
294
+ // Form model content changed.
295
+ writeValue(content) {
296
+ this.updateEditor(content);
297
+ }
298
+ registerOnChange(fn) {
299
+ this.onChange = fn;
300
+ }
301
+ registerOnTouched(fn) {
302
+ this.onTouched = fn;
303
+ }
304
+ // TODO: replace clone method with better possible alternate
305
+ clone(item) {
306
+ const me = this;
307
+ if (!item) {
308
+ return item;
309
+ } // null, undefined values check
310
+ let types = [Number, String, Boolean], result;
311
+ // normalizing primitives if someone did new String('aaa'), or new Number('444');
312
+ types.forEach(function (type) {
313
+ if (item instanceof type) {
314
+ result = type(item);
315
+ }
316
+ });
317
+ if (typeof result == 'undefined') {
318
+ if (Object.prototype.toString.call(item) === '[object Array]') {
319
+ result = [];
320
+ item.forEach(function (child, index, array) {
321
+ result[index] = me.clone(child);
322
+ });
323
+ }
324
+ else if (typeof item == 'object') {
325
+ // testing that this is DOM
326
+ if (item.nodeType && typeof item.cloneNode == 'function') {
327
+ result = item.cloneNode(true);
328
+ }
329
+ else if (!item.prototype) { // check that this is a literal
330
+ if (item instanceof Date) {
331
+ result = new Date(item);
332
+ }
333
+ else {
334
+ // it is an object literal
335
+ result = {};
336
+ for (const i in item) {
337
+ result[i] = me.clone(item[i]);
338
+ }
339
+ }
340
+ }
341
+ else {
342
+ if (false && item.constructor) {
343
+ result = new item.constructor();
344
+ }
345
+ else {
346
+ result = item;
347
+ }
348
+ }
349
+ }
350
+ else {
351
+ result = item;
352
+ }
353
+ }
354
+ return result;
355
+ }
356
+ // Update editor with model contents.
357
+ updateEditor(content) {
358
+ if (JSON.stringify(this._oldModel) == JSON.stringify(content)) {
359
+ return;
360
+ }
361
+ if (!this._hasSpecialTag) {
362
+ this._oldModel = content;
363
+ }
364
+ else {
365
+ this._model = content;
366
+ }
367
+ if (this._editorInitialized) {
368
+ if (!this._hasSpecialTag) {
369
+ this._editor.html.set(content);
370
+ }
371
+ else {
372
+ this.setContent();
373
+ }
374
+ }
375
+ else {
376
+ if (!this._hasSpecialTag) {
377
+ this._element.innerHTML = content || '';
378
+ }
379
+ else {
380
+ this.setContent();
381
+ }
382
+ }
383
+ }
384
+ // update model if editor contentChanged
385
+ updateModel() {
386
+ this.zone.run(() => {
387
+ let modelContent = null;
388
+ if (this._hasSpecialTag) {
389
+ const attributeNodes = this._element.attributes;
390
+ const attrs = {};
391
+ for (let i = 0; i < attributeNodes.length; i++) {
392
+ const attrName = attributeNodes[i].name;
393
+ if (this._opts.angularIgnoreAttrs && this._opts.angularIgnoreAttrs.indexOf(attrName) != -1) {
394
+ continue;
395
+ }
396
+ attrs[attrName] = attributeNodes[i].value;
397
+ }
398
+ if (this._element.innerHTML) {
399
+ attrs[this.INNER_HTML_ATTR] = this._element.innerHTML;
400
+ }
401
+ modelContent = attrs;
402
+ }
403
+ else {
404
+ const returnedHtml = this._editor.html.get();
405
+ if (typeof returnedHtml === 'string') {
406
+ modelContent = returnedHtml;
407
+ }
408
+ }
409
+ if (this._oldModel !== modelContent) {
410
+ this._oldModel = modelContent;
411
+ // Update froalaModel.
412
+ this.froalaModelChange.emit(modelContent);
413
+ // Update form model.
414
+ this.onChange(modelContent);
415
+ }
416
+ });
417
+ }
418
+ registerEvent(eventName, callback) {
419
+ if (!eventName || !callback) {
420
+ return;
421
+ }
422
+ if (!this._opts.events) {
423
+ this._opts.events = {};
424
+ }
425
+ this._opts.events[eventName] = callback;
426
+ }
427
+ initListeners() {
428
+ const self = this;
429
+ // Check if we have events on the editor.
430
+ if (this._editor.events) {
431
+ // bind contentChange and keyup event to froalaModel
432
+ this._editor.events.on('contentChanged', function () {
433
+ setTimeout(function () {
434
+ self.updateModel();
435
+ }, 0);
436
+ });
437
+ this._editor.events.on('mousedown', function () {
438
+ setTimeout(function () {
439
+ self.onTouched();
440
+ }, 0);
441
+ });
442
+ if (this._opts.immediateAngularModelUpdate) {
443
+ this._editor.events.on('keyup', function () {
444
+ setTimeout(function () {
445
+ self.updateModel();
446
+ }, 0);
447
+ });
448
+ }
449
+ }
450
+ this._editorInitialized = true;
451
+ }
452
+ createEditor() {
453
+ if (this._editorInitialized) {
454
+ return;
455
+ }
456
+ this.setContent(true);
457
+ // init editor
458
+ this.zone.runOutsideAngular(() => {
459
+ // Add listeners on initialized event.
460
+ if (!this._opts.events) {
461
+ this._opts.events = {};
462
+ }
463
+ // Register initialized event.
464
+ this.registerEvent('initialized', this._opts.events && this._opts.events.initialized);
465
+ const existingInitCallback = this._opts.events.initialized;
466
+ // Default initialized event.
467
+ if (!this._opts.events.initialized || !this._opts.events.initialized.overridden) {
468
+ this._opts.events.initialized = () => {
469
+ this.initListeners();
470
+ existingInitCallback && existingInitCallback.call(this._editor, this);
471
+ };
472
+ this._opts.events.initialized.overridden = true;
473
+ }
474
+ // Initialize the Froala Editor.
475
+ this._editor = new FroalaEditor(this._element, this._opts);
476
+ });
477
+ }
478
+ setHtml() {
479
+ this._editor.html.set(this._model || '');
480
+ // This will reset the undo stack everytime the model changes externally. Can we fix this?
481
+ this._editor.undo.reset();
482
+ this._editor.undo.saveStep();
483
+ }
484
+ setContent(firstTime = false) {
485
+ const self = this;
486
+ // Set initial content
487
+ if (this._model || this._model == '') {
488
+ this._oldModel = this._model;
489
+ if (this._hasSpecialTag) {
490
+ const tags = this._model;
491
+ // add tags on element
492
+ if (tags) {
493
+ for (const attr in tags) {
494
+ if (tags.hasOwnProperty(attr) && attr != this.INNER_HTML_ATTR) {
495
+ this._element.setAttribute(attr, tags[attr]);
496
+ }
497
+ }
498
+ if (tags.hasOwnProperty(this.INNER_HTML_ATTR)) {
499
+ this._element.innerHTML = tags[this.INNER_HTML_ATTR];
500
+ }
501
+ }
502
+ }
503
+ else {
504
+ if (firstTime) {
505
+ this.registerEvent('initialized', function () {
506
+ self.setHtml();
507
+ });
508
+ }
509
+ else {
510
+ self.setHtml();
511
+ }
512
+ }
513
+ }
514
+ }
515
+ destroyEditor() {
516
+ if (this._editorInitialized) {
517
+ this._editor.destroy();
518
+ this._editorInitialized = false;
519
+ }
520
+ }
521
+ getEditor() {
522
+ if (this._element) {
523
+ return this._editor;
524
+ }
525
+ return null;
526
+ }
527
+ // send manual editor initialization
528
+ generateManualController() {
529
+ const controls = {
530
+ initialize: this.createEditor.bind(this),
531
+ destroy: this.destroyEditor.bind(this),
532
+ getEditor: this.getEditor.bind(this),
533
+ };
534
+ this.froalaInit.emit(controls);
535
+ }
536
+ // TODO not sure if ngOnInit is executed after @inputs
537
+ ngAfterViewInit() {
538
+ // check if output froalaInit is present. Maybe observers is private and should not be used?? TODO how to better test that an output directive is present.
539
+ if (!this.froalaInit.observers.length) {
540
+ this.createEditor();
541
+ }
542
+ else {
543
+ this.generateManualController();
544
+ }
545
+ }
546
+ ngOnDestroy() {
547
+ this.destroyEditor();
548
+ }
549
+ }
550
+ SkFroalaEditorDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: SkFroalaEditorDirective, deps: [{ token: i0.ElementRef }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Directive });
551
+ SkFroalaEditorDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.0.2", type: SkFroalaEditorDirective, selector: "[froalaEditor]", inputs: { froalaEditor: "froalaEditor", froalaModel: "froalaModel" }, outputs: { froalaModelChange: "froalaModelChange", froalaInit: "froalaInit" }, providers: [{
552
+ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => SkFroalaEditorDirective),
553
+ multi: true
554
+ }], exportAs: ["froalaEditor"], ngImport: i0 });
555
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: SkFroalaEditorDirective, decorators: [{
556
+ type: Directive,
557
+ args: [{
558
+ selector: '[froalaEditor]',
559
+ exportAs: 'froalaEditor',
560
+ providers: [{
561
+ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => SkFroalaEditorDirective),
562
+ multi: true
563
+ }]
564
+ }]
565
+ }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.NgZone }]; }, propDecorators: { froalaEditor: [{
566
+ type: Input
567
+ }], froalaModel: [{
568
+ type: Input
569
+ }], froalaModelChange: [{
570
+ type: Output
571
+ }], froalaInit: [{
572
+ type: Output
573
+ }] } });
574
+
575
+ class SkArticleEditorComponent {
576
+ constructor(_apiService, _articleService) {
577
+ this._apiService = _apiService;
578
+ this._articleService = _articleService;
579
+ this.toolbarType = 'default';
580
+ this._initOptions();
581
+ }
582
+ // -----------------------------------------------------------------------------------------------------
583
+ // @ Accessors
584
+ // ------------------------------------------1-----------------------------------------------------------
585
+ // -----------------------------------------------------------------------------------------------------
586
+ // @ Lifecycle hooks
587
+ // -----------------------------------------------------------------------------------------------------
588
+ ngOnInit() {
589
+ }
590
+ ngOnChanges(changes) {
591
+ this._initData();
592
+ this._initOptions();
593
+ }
594
+ // -----------------------------------------------------------------------------------------------------
595
+ // @ Public methods
596
+ // -----------------------------------------------------------------------------------------------------
597
+ getData() {
598
+ return { content: this.content, images: this.images };
599
+ }
600
+ // -----------------------------------------------------------------------------------------------------
601
+ // @ Private methods
602
+ // -----------------------------------------------------------------------------------------------------
603
+ _initData() {
604
+ if (!this.article) {
605
+ return;
606
+ }
607
+ this.content = this.article.content;
608
+ this.images = this.article.images || [];
609
+ }
610
+ _initOptions() {
611
+ this.editorConfig = Object.assign({}, this._articleService.getBaseConfig(), {
612
+ requestHeaders: {
613
+ 'Authorization': 'Bearer ' + this._apiService.getToken(),
614
+ 'ngsw-bypass': 'true'
615
+ },
616
+ imageUploadParams: {
617
+ imageUrl: this._articleService.environment.apiServer + '/api/public/images/'
618
+ },
619
+ imageUploadParam: 'file',
620
+ imageUploadRemoteUrls: true,
621
+ imageUploadURL: this._articleService.environment.apiServer + '/external/froala/upload',
622
+ fileUploadParams: {
623
+ imageUrl: this._articleService.environment.apiServer + '/api/public/files/'
624
+ },
625
+ fileUploadParam: 'file',
626
+ fileUploadURL: this._articleService.environment.apiServer + '/external/froala/upload',
627
+ events: {
628
+ 'image.inserted': ($img, response) => {
629
+ this._addImage(JSON.parse(response).file);
630
+ },
631
+ 'image.removed': ($img) => {
632
+ console.log($img, $img.dataset);
633
+ for (let i = 0; i < $img.length; i++) {
634
+ this._removeImage(Number($img[i].dataset.id));
635
+ }
636
+ }
637
+ },
638
+ ...this._articleService.getToolbar(this.toolbarType)
639
+ });
640
+ }
641
+ _addImage(file) {
642
+ this.images.push(new SkFile(file));
643
+ }
644
+ _removeImage(id) {
645
+ const index = this.images.findIndex(value => value.id === id);
646
+ if (index > -1) {
647
+ this.images.splice(index, 1);
648
+ }
649
+ }
650
+ }
651
+ SkArticleEditorComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: SkArticleEditorComponent, deps: [{ token: i1.SkApiService }, { token: SkArticleService }], target: i0.ɵɵFactoryTarget.Component });
652
+ SkArticleEditorComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.0.2", type: SkArticleEditorComponent, selector: "sk-article-editor", inputs: { article: "article", toolbarType: "toolbarType" }, usesOnChanges: true, ngImport: i0, template: "<div [froalaEditor]=\"editorConfig\" [(froalaModel)]=\"content\"></div>\n", styles: [":host{position:relative;display:block}\n"], directives: [{ type: SkFroalaEditorDirective, selector: "[froalaEditor]", inputs: ["froalaEditor", "froalaModel"], outputs: ["froalaModelChange", "froalaInit"], exportAs: ["froalaEditor"] }] });
653
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: SkArticleEditorComponent, decorators: [{
654
+ type: Component,
655
+ args: [{ selector: 'sk-article-editor', template: "<div [froalaEditor]=\"editorConfig\" [(froalaModel)]=\"content\"></div>\n", styles: [":host{position:relative;display:block}\n"] }]
656
+ }], ctorParameters: function () { return [{ type: i1.SkApiService }, { type: SkArticleService }]; }, propDecorators: { article: [{
657
+ type: Input
658
+ }], toolbarType: [{
659
+ type: Input
660
+ }] } });
661
+
662
+ class SkArticleModule {
663
+ }
664
+ SkArticleModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: SkArticleModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
665
+ SkArticleModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: SkArticleModule, declarations: [SkArticleEditorComponent,
666
+ SkFroalaEditorDirective], imports: [CommonModule], exports: [SkArticleEditorComponent,
667
+ SkFroalaEditorDirective] });
668
+ SkArticleModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: SkArticleModule, providers: [], imports: [[
669
+ CommonModule
670
+ ]] });
671
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: SkArticleModule, decorators: [{
672
+ type: NgModule,
673
+ args: [{
674
+ declarations: [
675
+ SkArticleEditorComponent,
676
+ SkFroalaEditorDirective
677
+ ],
678
+ imports: [
679
+ CommonModule
680
+ ],
681
+ exports: [
682
+ SkArticleEditorComponent,
683
+ SkFroalaEditorDirective
684
+ ],
685
+ providers: []
686
+ }]
687
+ }] });
688
+
689
+ class SkArticleEditorServerComponent {
690
+ constructor(_apiService) {
691
+ this._apiService = _apiService;
692
+ this.toolbarType = 'default';
693
+ this._initOptions();
694
+ }
695
+ // -----------------------------------------------------------------------------------------------------
696
+ // @ Accessors
697
+ // ------------------------------------------1-----------------------------------------------------------
698
+ // -----------------------------------------------------------------------------------------------------
699
+ // @ Lifecycle hooks
700
+ // -----------------------------------------------------------------------------------------------------
701
+ ngOnInit() {
702
+ }
703
+ ngOnChanges(changes) {
704
+ this._initData();
705
+ this._initOptions();
706
+ }
707
+ // -----------------------------------------------------------------------------------------------------
708
+ // @ Public methods
709
+ // -----------------------------------------------------------------------------------------------------
710
+ getData() {
711
+ return { content: this.content, images: this.images };
712
+ }
713
+ // -----------------------------------------------------------------------------------------------------
714
+ // @ Private methods
715
+ // -----------------------------------------------------------------------------------------------------
716
+ _initData() {
717
+ if (!this.article) {
718
+ return;
719
+ }
720
+ this.content = this.article.content;
721
+ this.images = this.article.images || [];
722
+ }
723
+ _initOptions() {
724
+ }
725
+ }
726
+ SkArticleEditorServerComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: SkArticleEditorServerComponent, deps: [{ token: i1.SkApiService }], target: i0.ɵɵFactoryTarget.Component });
727
+ SkArticleEditorServerComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.0.2", type: SkArticleEditorServerComponent, selector: "sk-article-editor", inputs: { article: "article", toolbarType: "toolbarType" }, usesOnChanges: true, ngImport: i0, template: "<div>Server</div>\n", styles: [":host{position:relative;display:block}\n"] });
728
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: SkArticleEditorServerComponent, decorators: [{
729
+ type: Component,
730
+ args: [{ selector: 'sk-article-editor', template: "<div>Server</div>\n", styles: [":host{position:relative;display:block}\n"] }]
731
+ }], ctorParameters: function () { return [{ type: i1.SkApiService }]; }, propDecorators: { article: [{
732
+ type: Input
733
+ }], toolbarType: [{
734
+ type: Input
735
+ }] } });
736
+
737
+ class SkArticleServerModule {
738
+ static forRoot(environment) {
739
+ return {
740
+ ngModule: SkArticleServerModule,
741
+ providers: []
742
+ };
743
+ }
744
+ }
745
+ SkArticleServerModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: SkArticleServerModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
746
+ SkArticleServerModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: SkArticleServerModule, declarations: [SkArticleEditorServerComponent], imports: [CommonModule], exports: [SkArticleEditorServerComponent] });
747
+ SkArticleServerModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: SkArticleServerModule, providers: [], imports: [[
748
+ CommonModule
749
+ ]] });
750
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: SkArticleServerModule, decorators: [{
751
+ type: NgModule,
752
+ args: [{
753
+ declarations: [
754
+ SkArticleEditorServerComponent,
755
+ ],
756
+ imports: [
757
+ CommonModule
758
+ ],
759
+ exports: [
760
+ SkArticleEditorServerComponent,
761
+ ],
762
+ providers: []
763
+ }]
764
+ }] });
765
+
766
+ /**
767
+ * Generated bundle index. Do not edit.
768
+ */
769
+
770
+ export { SkArticleEditorComponent, SkArticleEditorServerComponent, SkArticleModule, SkArticleServerModule, SkArticleService, SkFroalaEditorDirective };
771
+ //# sourceMappingURL=sk-front-lib-article.mjs.map