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