@alfresco/adf-core 8.3.0 → 8.3.1

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 (304) hide show
  1. package/api/lib/adf-http-client.service.d.ts +3 -9
  2. package/app.config.schema.json +4 -3
  3. package/auth/authentication-interceptor/authentication.interceptor.d.ts +1 -3
  4. package/breadcrumbs/components/breadcrumb/breadcrumb.component.d.ts +2 -3
  5. package/breadcrumbs/directives/breadcrumb-focus.directive.d.ts +1 -19
  6. package/bundles/assets/adf-core/i18n/ar.json +0 -5
  7. package/bundles/assets/adf-core/i18n/cs.json +0 -5
  8. package/bundles/assets/adf-core/i18n/da.json +0 -5
  9. package/bundles/assets/adf-core/i18n/de.json +30 -13
  10. package/bundles/assets/adf-core/i18n/en.json +34 -17
  11. package/bundles/assets/adf-core/i18n/es.json +30 -13
  12. package/bundles/assets/adf-core/i18n/fi.json +0 -5
  13. package/bundles/assets/adf-core/i18n/fr.json +30 -13
  14. package/bundles/assets/adf-core/i18n/it.json +30 -13
  15. package/bundles/assets/adf-core/i18n/ja.json +0 -5
  16. package/bundles/assets/adf-core/i18n/nb.json +0 -5
  17. package/bundles/assets/adf-core/i18n/nl.json +0 -5
  18. package/bundles/assets/adf-core/i18n/pl.json +30 -13
  19. package/bundles/assets/adf-core/i18n/pt-BR.json +0 -5
  20. package/bundles/assets/adf-core/i18n/pt.json +30 -13
  21. package/bundles/assets/adf-core/i18n/ru.json +0 -5
  22. package/bundles/assets/adf-core/i18n/sv.json +0 -5
  23. package/bundles/assets/adf-core/i18n/zh-CN.json +0 -5
  24. package/custom-theme/material-theme.scss +13 -13
  25. package/custom-theme/theme/custom-palette-creator.scss +25 -27
  26. package/custom-theme/theme/custom-theme-palettes.scss +7 -7
  27. package/custom-theme/theme/theme-data.scss +13 -13
  28. package/custom-theme/theme/typography.scss +5 -5
  29. package/feature-flags/lib/components/feature-override-indicator.component.d.ts +2 -20
  30. package/feature-flags/lib/components/flags/flags.component.d.ts +4 -4
  31. package/feature-flags/lib/directives/features.directive.d.ts +5 -23
  32. package/feature-flags/lib/directives/not-features.directive.d.ts +5 -23
  33. package/feature-flags/lib/guards/is-feature-off.guard.d.ts +1 -3
  34. package/feature-flags/lib/guards/is-feature-on.guard.d.ts +1 -3
  35. package/feature-flags/lib/guards/is-flags-override-on.guard.d.ts +2 -3
  36. package/feature-flags/lib/services/debug-features.service.d.ts +6 -6
  37. package/feature-flags/lib/services/qa-features.helper.d.ts +2 -21
  38. package/feature-flags/lib/services/storage-features.service.d.ts +4 -4
  39. package/fesm2022/adf-core.mjs +4861 -4176
  40. package/fesm2022/adf-core.mjs.map +1 -1
  41. package/fesm2022/alfresco-adf-core-api.mjs +14 -16
  42. package/fesm2022/alfresco-adf-core-api.mjs.map +1 -1
  43. package/fesm2022/alfresco-adf-core-auth.mjs +7 -7
  44. package/fesm2022/alfresco-adf-core-auth.mjs.map +1 -1
  45. package/fesm2022/alfresco-adf-core-breadcrumbs.mjs +21 -20
  46. package/fesm2022/alfresco-adf-core-breadcrumbs.mjs.map +1 -1
  47. package/fesm2022/alfresco-adf-core-feature-flags.mjs +84 -129
  48. package/fesm2022/alfresco-adf-core-feature-flags.mjs.map +1 -1
  49. package/fesm2022/alfresco-adf-core-shell.mjs +24 -32
  50. package/fesm2022/alfresco-adf-core-shell.mjs.map +1 -1
  51. package/lib/about/about-license-list/about-license-list.component.d.ts +2 -1
  52. package/lib/about/about-license-list/about-license-list.component.scss +7 -0
  53. package/lib/about/about-server-settings/about-server-settings.component.d.ts +1 -3
  54. package/lib/about/interfaces.d.ts +1 -1
  55. package/lib/app-config/app-config-storage-prefix.factory.d.ts +3 -5
  56. package/lib/app-config/app-config.pipe.d.ts +1 -3
  57. package/lib/app-config/app-config.service.d.ts +31 -28
  58. package/lib/auth/authentication-interceptor/auth-bearer.interceptor.d.ts +2 -4
  59. package/lib/auth/basic-auth/basic-alfresco-auth.service.d.ts +2 -6
  60. package/lib/auth/basic-auth/content-auth.d.ts +4 -7
  61. package/lib/auth/basic-auth/process-auth.d.ts +4 -7
  62. package/lib/auth/guard/auth-guard.service.d.ts +7 -31
  63. package/lib/auth/models/oauth-config.model.d.ts +0 -1
  64. package/lib/auth/oidc/auth-config.service.d.ts +2 -5
  65. package/lib/auth/oidc/oidc-authentication.service.d.ts +4 -10
  66. package/lib/auth/oidc/redirect-auth.service.d.ts +6 -6
  67. package/lib/auth/oidc/retry-login.service.d.ts +1 -1
  68. package/lib/auth/services/authentication.service.d.ts +1 -19
  69. package/lib/auth/services/base-authentication.service.d.ts +1 -3
  70. package/lib/auth/services/identity-group.service.d.ts +2 -5
  71. package/lib/auth/services/identity-role.service.d.ts +1 -1
  72. package/lib/auth/services/identity-user.service.d.ts +3 -7
  73. package/lib/auth/services/jwt-helper.service.d.ts +1 -1
  74. package/lib/auth/services/oauth2.service.d.ts +1 -3
  75. package/lib/auth/services/time-sync.service.d.ts +3 -5
  76. package/lib/auth/services/user-access.service.d.ts +2 -5
  77. package/lib/card-view/components/card-view/card-view.component.d.ts +1 -3
  78. package/lib/card-view/components/card-view/card-view.component.scss +0 -90
  79. package/lib/card-view/components/card-view-arrayitem/card-view-arrayitem.component.scss +1 -9
  80. package/lib/card-view/components/card-view-boolitem/card-view-boolitem.component.d.ts +4 -2
  81. package/lib/card-view/components/card-view-dateitem/card-view-dateitem.component.d.ts +5 -10
  82. package/lib/card-view/components/card-view-dateitem/card-view-dateitem.component.scss +36 -41
  83. package/lib/card-view/components/card-view-item-dispatcher/card-view-item-dispatcher.component.d.ts +3 -5
  84. package/lib/card-view/components/card-view-selectitem/card-view-selectitem.component.d.ts +4 -1
  85. package/lib/card-view/components/card-view-selectitem/card-view-selectitem.component.scss +0 -12
  86. package/lib/card-view/components/card-view-selectitem/select-filter-input/select-filter-input.component.d.ts +1 -3
  87. package/lib/card-view/components/card-view-textitem/card-view-textitem.component.d.ts +5 -10
  88. package/lib/card-view/components/card-view-textitem/card-view-textitem.component.scss +18 -19
  89. package/lib/card-view/directives/card-view-property-validator.directive.d.ts +28 -0
  90. package/lib/card-view/models/card-view-dateitem.model.d.ts +0 -2
  91. package/lib/card-view/public-api.d.ts +0 -1
  92. package/lib/card-view/validators/card-view-item-length.validator.d.ts +2 -2
  93. package/lib/card-view/validators/card-view-item-match.validator.d.ts +3 -3
  94. package/lib/card-view/validators/card-view-item-minmax.validator.d.ts +3 -3
  95. package/lib/clipboard/clipboard.directive.d.ts +6 -11
  96. package/lib/clipboard/clipboard.module.d.ts +5 -4
  97. package/lib/clipboard/clipboard.service.d.ts +2 -4
  98. package/lib/comments/comment-list/comment-list.component.d.ts +1 -1
  99. package/lib/comments/comments.component.d.ts +3 -2
  100. package/lib/comments/comments.component.scss +3 -32
  101. package/lib/common/index.d.ts +0 -1
  102. package/lib/common/services/log.service.d.ts +2 -6
  103. package/lib/common/services/page-title.service.d.ts +4 -7
  104. package/lib/common/services/thumbnail.service.d.ts +1 -3
  105. package/lib/common/services/url.service.d.ts +1 -3
  106. package/lib/common/services/user-preferences.service.d.ts +78 -15
  107. package/lib/common/utils/date-fns-adapter.d.ts +3 -5
  108. package/lib/common/utils/date-fns-utils.d.ts +1 -1
  109. package/lib/common/utils/datetime-fns-adapter.d.ts +3 -5
  110. package/lib/common/utils/moment-date-adapter.d.ts +1 -2
  111. package/lib/context-menu/context-menu-list.component.d.ts +8 -8
  112. package/lib/context-menu/context-menu-overlay.d.ts +1 -1
  113. package/lib/context-menu/context-menu-overlay.service.d.ts +2 -21
  114. package/lib/context-menu/context-menu.directive.d.ts +1 -3
  115. package/lib/context-menu/context-menu.tokens.d.ts +2 -1
  116. package/lib/context-menu/interfaces.d.ts +14 -1
  117. package/lib/core.module.d.ts +78 -83
  118. package/lib/datatable/components/amount-cell/amount-cell.component.d.ts +3 -19
  119. package/lib/datatable/components/boolean-cell/boolean-cell.component.d.ts +3 -20
  120. package/lib/datatable/components/columns-selector/columns-search-filter.pipe.d.ts +1 -1
  121. package/lib/datatable/components/columns-selector/columns-selector.component.d.ts +2 -1
  122. package/lib/datatable/components/columns-selector/columns-selector.component.scss +64 -81
  123. package/lib/datatable/components/datatable/datatable.component.d.ts +12 -13
  124. package/lib/datatable/components/datatable/datatable.component.scss +48 -20
  125. package/lib/datatable/components/datatable-cell/datatable-cell.component.d.ts +20 -0
  126. package/lib/datatable/components/datatable-row/datatable-row.component.d.ts +2 -3
  127. package/lib/datatable/components/date-cell/date-cell.component.d.ts +9 -2
  128. package/lib/datatable/components/filesize-cell/filesize-cell.component.d.ts +1 -19
  129. package/lib/datatable/components/icon-cell/icon-cell.component.d.ts +3 -6
  130. package/lib/datatable/components/json-cell/json-cell.component.d.ts +4 -22
  131. package/lib/datatable/components/location-cell/location-cell.component.d.ts +3 -20
  132. package/lib/datatable/components/number-cell/number-cell.component.d.ts +3 -19
  133. package/lib/datatable/data/data-table.schema.d.ts +4 -4
  134. package/lib/datatable/data/datatable-adapter.d.ts +2 -0
  135. package/lib/datatable/data/object-datarow.model.d.ts +1 -1
  136. package/lib/datatable/data-column/data-column-header.component.d.ts +1 -3
  137. package/lib/datatable/directives/drop-zone.directive.d.ts +4 -4
  138. package/lib/datatable/directives/header-filter-template.directive.d.ts +1 -3
  139. package/lib/datatable/directives/loading-template.directive.d.ts +1 -3
  140. package/lib/datatable/directives/main-data-table-action-template.directive.d.ts +1 -3
  141. package/lib/datatable/directives/no-content-template.directive.d.ts +1 -3
  142. package/lib/datatable/directives/no-permission-template.directive.d.ts +1 -3
  143. package/lib/datatable/directives/resizable/resizable.directive.d.ts +8 -3
  144. package/lib/datatable/directives/resizable/resize-handle.directive.d.ts +2 -2
  145. package/lib/dialogs/confirm-dialog/confirm.dialog.d.ts +3 -3
  146. package/lib/dialogs/dialog/dialog.component.d.ts +2 -2
  147. package/lib/dialogs/edit-json/edit-json.dialog.d.ts +1 -2
  148. package/lib/dialogs/unsaved-changes-dialog/unsaved-changes-dialog.component.d.ts +1 -3
  149. package/lib/dialogs/unsaved-changes-dialog/unsaved-changes.guard.d.ts +3 -6
  150. package/lib/directives/highlight.directive.d.ts +4 -6
  151. package/lib/directives/infinite-select-scroll.directive.d.ts +1 -3
  152. package/lib/directives/logout.directive.d.ts +6 -10
  153. package/lib/directives/tooltip-card/tooltip-card.component.d.ts +1 -3
  154. package/lib/directives/tooltip-card/tooltip-card.directive.d.ts +4 -6
  155. package/lib/directives/upload.directive.d.ts +7 -7
  156. package/lib/dynamic-chip-list/dynamic-chip-list.component.d.ts +3 -4
  157. package/lib/dynamic-chip-list/dynamic-chip-list.component.scss +1 -1
  158. package/lib/form/components/form-base.component.d.ts +1 -1
  159. package/lib/form/components/form-field/form-field.component.d.ts +5 -0
  160. package/lib/form/components/form-renderer.component.d.ts +7 -7
  161. package/lib/form/components/form-renderer.component.scss +48 -34
  162. package/lib/form/components/widgets/amount/amount.widget.d.ts +26 -6
  163. package/lib/form/components/widgets/base-display-text/base-display-text.widget.d.ts +43 -0
  164. package/lib/form/components/widgets/base-viewer/base-viewer.widget.d.ts +16 -2
  165. package/lib/form/components/widgets/button/button.widget.d.ts +9 -0
  166. package/lib/form/components/widgets/button/button.widget.scss +14 -0
  167. package/lib/form/components/widgets/checkbox/checkbox.widget.d.ts +0 -4
  168. package/lib/form/components/widgets/core/container-column.model.d.ts +2 -0
  169. package/lib/{models/decimal-number.model.d.ts → form/components/widgets/core/container-row.model.d.ts} +9 -5
  170. package/lib/{common/models/user-info-mode.enum.d.ts → form/components/widgets/core/custom-validation-message.token.d.ts} +3 -7
  171. package/lib/form/components/widgets/core/form-field-types.d.ts +5 -0
  172. package/lib/form/components/widgets/core/form-field-validator.d.ts +10 -10
  173. package/lib/form/components/widgets/core/form-field.model.d.ts +29 -2
  174. package/lib/form/components/widgets/core/form.model.d.ts +38 -2
  175. package/lib/{datatable/components/mocks/datatable.mock.d.ts → form/components/widgets/core/handlers/form-field-rule.handler.d.ts} +5 -5
  176. package/lib/{blank-page/public-api.d.ts → form/components/widgets/core/handlers/form-field-visibility-condition.handler.d.ts} +5 -2
  177. package/lib/form/components/widgets/core/index.d.ts +2 -0
  178. package/lib/{login/components/login-dialog/login-dialog-component-data.interface.d.ts → form/components/widgets/core/repeatable-section.model.d.ts} +7 -5
  179. package/lib/form/components/widgets/decimal/decimal.component.d.ts +0 -3
  180. package/lib/form/components/widgets/display-text/display-text.widget.d.ts +5 -5
  181. package/lib/form/components/widgets/error/error.component.d.ts +0 -3
  182. package/lib/form/components/widgets/error/error.component.scss +4 -0
  183. package/lib/form/components/widgets/hyperlink/hyperlink.widget.d.ts +0 -3
  184. package/lib/form/components/widgets/index.d.ts +5 -1
  185. package/lib/form/components/widgets/json/json.widget.d.ts +1 -5
  186. package/lib/form/components/widgets/multiline-text/multiline-text.widget.d.ts +5 -4
  187. package/lib/form/components/widgets/number/number.widget.d.ts +1 -5
  188. package/lib/form/components/widgets/reactive-widget.interface.d.ts +4 -0
  189. package/lib/form/components/widgets/repeat/repeat.widget.d.ts +9 -0
  190. package/lib/form/components/widgets/repeat/repeat.widget.scss +36 -0
  191. package/lib/form/components/widgets/text/text-mask.component.d.ts +6 -7
  192. package/lib/form/components/widgets/text/text.widget.d.ts +13 -4
  193. package/lib/form/components/widgets/unknown/unknown.widget.d.ts +0 -3
  194. package/lib/form/components/widgets/widget.component.d.ts +1 -2
  195. package/lib/form/form-base.module.d.ts +3 -2
  196. package/lib/form/models/widget-visibility.model.d.ts +7 -6
  197. package/lib/form/public-api.d.ts +1 -0
  198. package/lib/form/services/form-expression.service.d.ts +14 -0
  199. package/lib/form/services/form.service.d.ts +3 -3
  200. package/lib/{interface/index.d.ts → icon/icon-alias-map.token.d.ts} +3 -1
  201. package/lib/{interface/public-api.d.ts → icon/icon-alias-map.type.d.ts} +1 -1
  202. package/lib/icon/icon.component.d.ts +31 -4
  203. package/lib/{pipes/multi-value.pipe.d.ts → icon/icon.directive.d.ts} +13 -6
  204. package/lib/icon/icon.module.d.ts +3 -6
  205. package/lib/icon/public-api.d.ts +3 -0
  206. package/lib/info-drawer/info-drawer-layout.component.scss +2 -2
  207. package/lib/info-drawer/info-drawer.component.scss +6 -0
  208. package/lib/language-menu/language-menu.component.d.ts +2 -3
  209. package/lib/language-menu/service/language.service.d.ts +2 -4
  210. package/lib/layout/components/header/header.component.d.ts +1 -3
  211. package/lib/layout/components/sidebar-action/sidebar-action-menu.component.scss +1 -2
  212. package/lib/layout/components/sidenav-layout/sidenav-layout.component.d.ts +3 -5
  213. package/lib/layout/components/sidenav-layout/sidenav-layout.component.scss +4 -4
  214. package/lib/login/components/login/login.component.d.ts +10 -17
  215. package/lib/login/components/login/login.component.scss +6 -8
  216. package/lib/login/directives/login-footer.directive.d.ts +1 -3
  217. package/lib/login/directives/login-header.directive.d.ts +1 -3
  218. package/lib/login/login.module.d.ts +3 -5
  219. package/lib/login/public-api.d.ts +0 -2
  220. package/lib/mock/form/widget-visibility.service.mock.d.ts +1 -0
  221. package/lib/mock/public-api.d.ts +0 -1
  222. package/lib/mock/translation.service.mock.d.ts +2 -2
  223. package/lib/models/public-api.d.ts +0 -2
  224. package/lib/notifications/components/notification-history.component.d.ts +10 -7
  225. package/lib/notifications/models/notification.model.d.ts +7 -6
  226. package/lib/notifications/notification-history.module.d.ts +2 -4
  227. package/lib/notifications/public-api.d.ts +0 -1
  228. package/lib/notifications/services/notification.service.d.ts +3 -5
  229. package/lib/pagination/infinite-pagination.component.d.ts +3 -5
  230. package/lib/pagination/pagination.component.d.ts +6 -9
  231. package/lib/pipes/decimal-number.pipe.d.ts +6 -3
  232. package/lib/pipes/file-size.pipe.d.ts +2 -4
  233. package/lib/pipes/localized-date.pipe.d.ts +3 -6
  234. package/lib/pipes/pipe.module.d.ts +6 -8
  235. package/lib/pipes/public-api.d.ts +0 -1
  236. package/lib/pipes/text-highlight.pipe.d.ts +1 -3
  237. package/lib/pipes/time-ago.pipe.d.ts +1 -2
  238. package/lib/pipes/user-initial.pipe.d.ts +2 -3
  239. package/lib/search-text/models/search-text-input.model.d.ts +5 -4
  240. package/lib/search-text/search-text-input.component.d.ts +4 -5
  241. package/lib/search-text/search-text-input.component.scss +0 -6
  242. package/lib/search-text/search-trigger.directive.d.ts +6 -7
  243. package/lib/snackbar-content/snackbar-content.component.d.ts +1 -1
  244. package/lib/{blank-page/index.d.ts → stories/core-story.providers.d.ts} +7 -1
  245. package/lib/{sorting-picker → stories}/index.d.ts +1 -1
  246. package/lib/styles/_flex.scss +21 -16
  247. package/lib/styles/{material.theme.scss → _globals.scss} +6 -6
  248. package/lib/styles/_index.scss +4 -126
  249. package/lib/styles/_mat-selectors.scss +1 -17
  250. package/lib/templates/empty-content/empty-content.component.scss +2 -5
  251. package/lib/templates/error-content/error-content.component.d.ts +3 -7
  252. package/lib/templates/error-content/error-content.component.scss +1 -1
  253. package/lib/testing/index.d.ts +0 -1
  254. package/lib/testing/noop-translate.module.d.ts +3 -4
  255. package/lib/testing/unit-testing-utils.d.ts +14 -0
  256. package/lib/toolbar/toolbar.component.scss +1 -1
  257. package/lib/translation/provide-i18n.d.ts +5 -0
  258. package/lib/translation/translate-loader.service.d.ts +4 -22
  259. package/lib/translation/translation.service.d.ts +10 -3
  260. package/lib/viewer/components/download-prompt-dialog/download-prompt-dialog.component.d.ts +4 -2
  261. package/lib/viewer/components/img-viewer/img-viewer.component.d.ts +9 -5
  262. package/lib/viewer/components/media-player/media-player.component.d.ts +3 -5
  263. package/lib/viewer/components/pdf-viewer/pdf-viewer-host.component.scss +28 -0
  264. package/lib/viewer/components/pdf-viewer/pdf-viewer.component.d.ts +52 -17
  265. package/lib/viewer/components/pdf-viewer/pdf-viewer.component.scss +4 -2
  266. package/lib/viewer/components/pdf-viewer-password-dialog/pdf-viewer-password-dialog.d.ts +1 -3
  267. package/lib/viewer/components/pdf-viewer-thumb/pdf-viewer-thumb.component.d.ts +3 -5
  268. package/lib/viewer/components/pdf-viewer-thumbnails/pdf-viewer-thumbnails.component.d.ts +7 -8
  269. package/lib/viewer/components/txt-viewer/txt-viewer.component.d.ts +3 -22
  270. package/lib/viewer/components/viewer-render/viewer-render.component.d.ts +8 -8
  271. package/lib/viewer/components/viewer.component.d.ts +16 -14
  272. package/lib/viewer/components/viewer.component.scss +1 -1
  273. package/lib/viewer/directives/viewer-extension.directive.d.ts +7 -6
  274. package/lib/viewer/models/download-prompt.actions.d.ts +5 -4
  275. package/lib/viewer/models/viewer.model.d.ts +5 -4
  276. package/lib/viewer/services/rendering-queue.services.d.ts +35 -12
  277. package/lib/viewer/services/view-util.service.d.ts +4 -5
  278. package/package.json +4 -5
  279. package/public-api.d.ts +1 -6
  280. package/schematics/migrations/schematics/migrations/7_0_0/index.d.ts +1 -2
  281. package/schematics/migrations/schematics/migrations/7_0_0/index.js +44 -59
  282. package/schematics/migrations/schematics/migrations/7_0_0/index.js.map +1 -1
  283. package/schematics/migrations/schematics/migrations/collection.json +0 -5
  284. package/shell/lib/components/shell/shell.component.d.ts +7 -10
  285. package/lib/blank-page/blank-page.component.d.ts +0 -5
  286. package/lib/blank-page/blank-page.module.d.ts +0 -8
  287. package/lib/button/button.component.d.ts +0 -19
  288. package/lib/button/button.component.scss +0 -13
  289. package/lib/clipboard/clipboard.theme.scss +0 -19
  290. package/lib/interface/injection.tokens.d.ts +0 -18
  291. package/lib/landing-page/index.d.ts +0 -17
  292. package/lib/landing-page/provider.d.ts +0 -24
  293. package/lib/landing-page/public-api.d.ts +0 -17
  294. package/lib/login/components/login-dialog/login-dialog.component.d.ts +0 -15
  295. package/lib/login/components/login-dialog/login-dialog.component.scss +0 -4
  296. package/lib/mock/data-column.mock.d.ts +0 -51
  297. package/lib/models/product-version.model.d.ts +0 -24
  298. package/lib/notifications/components/add-notification.stories.component.d.ts +0 -10
  299. package/lib/progress/progress.component.d.ts +0 -36
  300. package/lib/sorting-picker/public-api.d.ts +0 -17
  301. package/lib/sorting-picker/sorting-picker.component.d.ts +0 -38
  302. package/lib/styles/_theming.scss +0 -3
  303. package/lib/styles/_typography.scss +0 -18
  304. package/lib/testing/core.story.module.d.ts +0 -9
@@ -1,31 +1,12 @@
1
- /*!
2
- * @license
3
- * Copyright © 2005-2025 Hyland Software, Inc. and its affiliates. All rights reserved.
4
- *
5
- * Licensed under the Apache License, Version 2.0 (the "License");
6
- * you may not use this file except in compliance with the License.
7
- * You may obtain a copy of the License at
8
- *
9
- * http://www.apache.org/licenses/LICENSE-2.0
10
- *
11
- * Unless required by applicable law or agreed to in writing, software
12
- * distributed under the License is distributed on an "AS IS" BASIS,
13
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
- * See the License for the specific language governing permissions and
15
- * limitations under the License.
16
- */
17
- import { HttpClient } from '@angular/common/http';
18
1
  import { EventEmitter, OnChanges, SimpleChanges } from '@angular/core';
19
- import { AppConfigService } from '../../../app-config';
20
2
  import * as i0 from "@angular/core";
21
3
  export declare class TxtViewerComponent implements OnChanges {
22
- private http;
23
- private appConfigService;
24
- urlFile: any;
4
+ private readonly http;
5
+ private readonly appConfigService;
6
+ urlFile: string;
25
7
  blobFile: Blob;
26
8
  contentLoaded: EventEmitter<void>;
27
9
  content: string | ArrayBuffer;
28
- constructor(http: HttpClient, appConfigService: AppConfigService);
29
10
  ngOnChanges(changes: SimpleChanges): Promise<void>;
30
11
  private getUrlContent;
31
12
  private readBlob;
@@ -14,15 +14,15 @@
14
14
  * See the License for the specific language governing permissions and
15
15
  * limitations under the License.
16
16
  */
17
- import { AppExtensionService, ViewerExtensionRef } from '@alfresco/adf-extensions';
17
+ import { ViewerExtensionRef } from '@alfresco/adf-extensions';
18
18
  import { EventEmitter, Injector, OnChanges, OnInit, TemplateRef } from '@angular/core';
19
19
  import { MatDialog } from '@angular/material/dialog';
20
20
  import { Track } from '../../models/viewer.model';
21
- import { ViewUtilService } from '../../services/view-util.service';
21
+ import { ImgViewerComponent } from '../img-viewer/img-viewer.component';
22
22
  import * as i0 from "@angular/core";
23
23
  export declare class ViewerRenderComponent implements OnChanges, OnInit {
24
- private viewUtilService;
25
- private extensionService;
24
+ private readonly viewUtilService;
25
+ private readonly extensionService;
26
26
  dialog: MatDialog;
27
27
  readonly injector: Injector;
28
28
  /**
@@ -37,7 +37,7 @@ export declare class ViewerRenderComponent implements OnChanges, OnInit {
37
37
  /** Toggles PDF thumbnails. */
38
38
  allowThumbnails: boolean;
39
39
  /** The template for the pdf thumbnails. */
40
- thumbnailsTemplate: TemplateRef<any>;
40
+ thumbnailsTemplate: TemplateRef<unknown>;
41
41
  /** MIME type of the file content (when not determined by the filename extension). */
42
42
  mimeType: string;
43
43
  /** Override Content filename. */
@@ -57,7 +57,7 @@ export declare class ViewerRenderComponent implements OnChanges, OnInit {
57
57
  /** Identifier of a node that is opened by the viewer. */
58
58
  nodeId: string;
59
59
  /** Template containing ViewerExtensionDirective instances providing different viewer extensions based on supported file extension. */
60
- viewerTemplateExtensions: TemplateRef<any>;
60
+ viewerTemplateExtensions: TemplateRef<unknown>;
61
61
  /** Custom error message to be displayed in the viewer. */
62
62
  customError: string;
63
63
  /** Emitted when the filename extension changes. */
@@ -68,8 +68,9 @@ export declare class ViewerRenderComponent implements OnChanges, OnInit {
68
68
  close: EventEmitter<boolean>;
69
69
  /** Emitted when the img is saving. */
70
70
  isSaving: EventEmitter<boolean>;
71
+ imgViewer: ImgViewerComponent;
71
72
  extensionTemplates: {
72
- template: TemplateRef<any>;
73
+ template: TemplateRef<unknown>;
73
74
  isVisible: boolean;
74
75
  }[];
75
76
  extensionsSupportedByTemplates: string[];
@@ -92,7 +93,6 @@ export declare class ViewerRenderComponent implements OnChanges, OnInit {
92
93
  private _externalViewer;
93
94
  get externalViewer(): ViewerExtensionRef;
94
95
  cacheTypeForContent: string;
95
- constructor(viewUtilService: ViewUtilService, extensionService: AppExtensionService, dialog: MatDialog, injector: Injector);
96
96
  ngOnInit(): void;
97
97
  ngOnChanges(): void;
98
98
  markAsLoaded(): void;
@@ -1,26 +1,28 @@
1
- import { ElementRef, EventEmitter, OnChanges, OnDestroy, OnInit, SimpleChanges, TemplateRef } from '@angular/core';
1
+ import { EventEmitter, OnChanges, OnDestroy, OnInit, SimpleChanges, TemplateRef } from '@angular/core';
2
2
  import { MatDialog } from '@angular/material/dialog';
3
- import { AppConfigService } from '../../app-config';
4
3
  import { CloseButtonPosition, Track } from '../models/viewer.model';
5
- import { ViewUtilService } from '../services/view-util.service';
6
4
  import { ViewerMoreActionsComponent } from './viewer-more-actions.component';
7
5
  import { ViewerOpenWithComponent } from './viewer-open-with.component';
6
+ import { ViewerRenderComponent } from './viewer-render/viewer-render.component';
8
7
  import { ViewerSidebarComponent } from './viewer-sidebar.component';
9
8
  import { ViewerToolbarComponent } from './viewer-toolbar.component';
10
9
  import * as i0 from "@angular/core";
11
10
  export declare class ViewerComponent<T> implements OnDestroy, OnInit, OnChanges {
12
- private el;
11
+ private readonly el;
13
12
  dialog: MatDialog;
14
- private viewUtilsService;
15
- private appConfigService;
16
- private thumbnailService;
13
+ private readonly viewUtilsService;
14
+ private readonly appConfigService;
15
+ private readonly thumbnailService;
17
16
  get isInline(): boolean;
18
17
  toolbar: ViewerToolbarComponent;
19
18
  sidebar: ViewerSidebarComponent;
20
19
  mnuOpenWith: ViewerOpenWithComponent;
21
20
  mnuMoreActions: ViewerMoreActionsComponent;
22
- viewerTemplateExtensions: TemplateRef<any>;
23
- get CloseButtonPosition(): typeof CloseButtonPosition;
21
+ viewerTemplateExtensions: TemplateRef<unknown>;
22
+ get CloseButtonPosition(): {
23
+ readonly Right: "right";
24
+ readonly Left: "left";
25
+ };
24
26
  /**
25
27
  * If you want to load an external file that does not come from ACS you
26
28
  * can use this URL to specify where to load the file from.
@@ -59,9 +61,9 @@ export declare class ViewerComponent<T> implements OnDestroy, OnInit, OnChanges
59
61
  /** Toggles left sidebar visibility. Requires `allowLeftSidebar` to be set to `true`. */
60
62
  showLeftSidebar: boolean;
61
63
  /** The template for the right sidebar. The template context contains the loaded node data. */
62
- sidebarRightTemplate: TemplateRef<any>;
64
+ sidebarRightTemplate: TemplateRef<unknown>;
63
65
  /** The template for the left sidebar. The template context contains the loaded node data. */
64
- sidebarLeftTemplate: TemplateRef<any>;
66
+ sidebarLeftTemplate: TemplateRef<unknown>;
65
67
  /** Enable when where is possible the editing functionalities */
66
68
  readOnly: boolean;
67
69
  /**
@@ -91,7 +93,7 @@ export declare class ViewerComponent<T> implements OnDestroy, OnInit, OnChanges
91
93
  /** Toggles the 'Info Button' */
92
94
  hideInfoButton: boolean;
93
95
  /** Template containing ViewerExtensionDirective instances providing different viewer extensions based on supported file extension. */
94
- viewerExtensions: TemplateRef<any>;
96
+ viewerExtensions: TemplateRef<unknown>;
95
97
  /** Identifier of a node that is opened by the viewer. */
96
98
  nodeId: string;
97
99
  /** Original node mime type, should be provided when renditions mime type is different. */
@@ -128,8 +130,9 @@ export declare class ViewerComponent<T> implements OnDestroy, OnInit, OnChanges
128
130
  showViewerChange: EventEmitter<boolean>;
129
131
  /** Emitted when the img is submitted in the img viewer. */
130
132
  submitFile: EventEmitter<Blob>;
133
+ viewerRenderer: ViewerRenderComponent;
131
134
  private closeViewer;
132
- private keyDown$;
135
+ private readonly keyDown$;
133
136
  private isDialogVisible;
134
137
  private _fileName;
135
138
  private _fileNameWithoutExtension;
@@ -147,7 +150,6 @@ export declare class ViewerComponent<T> implements OnDestroy, OnInit, OnChanges
147
150
  get fileName(): string;
148
151
  get fileExtension(): string;
149
152
  get fileNameWithoutExtension(): string;
150
- constructor(el: ElementRef, dialog: MatDialog, viewUtilsService: ViewUtilService, appConfigService: AppConfigService);
151
153
  ngOnChanges(changes: SimpleChanges): void;
152
154
  ngOnInit(): void;
153
155
  private closeOverlayManager;
@@ -13,7 +13,7 @@
13
13
  height: 100%;
14
14
 
15
15
  #{ms.$mat-toolbar} {
16
- color: var(--adf-theme-foreground-text-color-054);
16
+ color: var(--adf-theme-foreground-text-color-064);
17
17
 
18
18
  .adf-toolbar-title {
19
19
  width: auto;
@@ -14,18 +14,19 @@
14
14
  * See the License for the specific language governing permissions and
15
15
  * limitations under the License.
16
16
  */
17
- import { AfterContentInit } from '@angular/core';
18
- import { ViewerRenderComponent } from '../components/viewer-render/viewer-render.component';
17
+ import { AfterContentInit, TemplateRef } from '@angular/core';
19
18
  import * as i0 from "@angular/core";
20
19
  export declare class ViewerExtensionDirective implements AfterContentInit {
21
- private viewerComponent;
22
- template: any;
20
+ private readonly viewerComponent;
21
+ template: TemplateRef<unknown>;
23
22
  urlFileContent: string;
24
23
  extension: string;
25
24
  supportedExtensions: string[];
26
- templateModel: any;
25
+ templateModel: {
26
+ template: TemplateRef<unknown>;
27
+ isVisible: boolean;
28
+ };
27
29
  private readonly destroyRef;
28
- constructor(viewerComponent: ViewerRenderComponent);
29
30
  ngAfterContentInit(): void;
30
31
  /**
31
32
  * Check if the current extension in the viewer is compatible with this extension checking against `supportedExtensions`
@@ -14,7 +14,8 @@
14
14
  * See the License for the specific language governing permissions and
15
15
  * limitations under the License.
16
16
  */
17
- export declare enum DownloadPromptActions {
18
- 'WAIT' = 0,
19
- 'DOWNLOAD' = 1
20
- }
17
+ export declare const DownloadPromptActions: {
18
+ readonly WAIT: "WAIT";
19
+ readonly DOWNLOAD: "DOWNLOAD";
20
+ };
21
+ export type DownloadPromptActions = (typeof DownloadPromptActions)[keyof typeof DownloadPromptActions];
@@ -14,10 +14,11 @@
14
14
  * See the License for the specific language governing permissions and
15
15
  * limitations under the License.
16
16
  */
17
- export declare enum CloseButtonPosition {
18
- Right = "right",
19
- Left = "left"
20
- }
17
+ export declare const CloseButtonPosition: {
18
+ readonly Right: "right";
19
+ readonly Left: "left";
20
+ };
21
+ export type CloseButtonPosition = (typeof CloseButtonPosition)[keyof typeof CloseButtonPosition];
21
22
  export interface Track {
22
23
  src: string;
23
24
  label?: string;
@@ -1,4 +1,17 @@
1
+ import type { PDFViewer } from 'pdfjs-dist/types/web/pdf_viewer';
2
+ import type { PDFThumbnailViewer } from 'pdfjs-dist/types/web/pdf_thumbnail_viewer';
3
+ import type { PDFPageView } from 'pdfjs-dist/types/web/pdf_page_view';
1
4
  import * as i0 from "@angular/core";
5
+ interface VisiblePage {
6
+ id: number;
7
+ }
8
+ interface VisiblePages {
9
+ first?: VisiblePage;
10
+ last?: VisiblePage;
11
+ views?: Array<{
12
+ view: PDFPageView;
13
+ }>;
14
+ }
2
15
  /**
3
16
  *
4
17
  * RenderingQueueServices rendering of the views for pages and thumbnails.
@@ -12,34 +25,43 @@ export declare class RenderingQueueServices {
12
25
  FINISHED: number;
13
26
  };
14
27
  CLEANUP_TIMEOUT: number;
15
- pdfViewer: any;
16
- pdfThumbnailViewer: any;
17
- onIdle: any;
28
+ pdfViewer: PDFViewer | null;
29
+ pdfThumbnailViewer: PDFThumbnailViewer | null;
30
+ onIdle: (() => void) | null;
18
31
  highestPriorityPage: string | null;
19
- idleTimeout: any;
20
- printing: any;
32
+ idleTimeout: number | null;
33
+ printing: boolean;
21
34
  isThumbnailViewEnabled: boolean;
22
35
  /**
23
36
  * Set the instance of the PDF Viewer
24
37
  *
25
38
  * @param pdfViewer viewer instance
26
39
  */
27
- setViewer(pdfViewer: any): void;
40
+ setViewer(pdfViewer: PDFViewer): void;
28
41
  /**
29
42
  * Sets the instance of the PDF Thumbnail Viewer
30
43
  *
31
44
  * @param pdfThumbnailViewer viewer instance
32
45
  */
33
- setThumbnailViewer(pdfThumbnailViewer: any): void;
46
+ setThumbnailViewer(pdfThumbnailViewer: PDFThumbnailViewer): void;
34
47
  /**
35
48
  * Check if the view has highest rendering priority
36
49
  *
37
50
  * @param view view to render
38
51
  * @returns `true` if the view has higher priority, otherwise `false`
39
52
  */
40
- isHighestPriority(view: any): boolean;
41
- renderHighestPriority(currentlyVisiblePages: any): void;
42
- getHighestPriority(visible: any, views: any, scrolledDown: any): any;
53
+ isHighestPriority(view: PDFPageView): boolean;
54
+ renderHighestPriority(currentlyVisiblePages?: unknown): void;
55
+ /**
56
+ * Gets the highest priority page to render from the visible pages
57
+ * This method is part of the PDFRenderingQueue interface compatibility
58
+ *
59
+ * @param visible visible pages information
60
+ * @param views array of page views
61
+ * @param scrolledDown whether the user scrolled down
62
+ * @returns the highest priority page view to render, null if all done, or false if no visible pages
63
+ */
64
+ getHighestPriority(visible: VisiblePages, views: PDFPageView[], scrolledDown: boolean): PDFPageView | null | false;
43
65
  hasViewer(): boolean;
44
66
  /**
45
67
  * Checks if the view rendering is finished
@@ -47,7 +69,7 @@ export declare class RenderingQueueServices {
47
69
  * @param view the View instance to check
48
70
  * @returns `true` if rendering is finished, otherwise `false`
49
71
  */
50
- isViewFinished(view: any): boolean;
72
+ isViewFinished(view: PDFPageView): boolean;
51
73
  /**
52
74
  * Render a page or thumbnail view. This calls the appropriate function
53
75
  * based on the views state. If the view is already rendered it will return
@@ -56,7 +78,8 @@ export declare class RenderingQueueServices {
56
78
  * @param view View instance to render
57
79
  * @returns the rendered state of the view
58
80
  */
59
- renderView(view: any): boolean;
81
+ renderView(view: PDFPageView): boolean;
60
82
  static ɵfac: i0.ɵɵFactoryDeclaration<RenderingQueueServices, never>;
61
83
  static ɵprov: i0.ɵɵInjectableDeclaration<RenderingQueueServices>;
62
84
  }
85
+ export {};
@@ -1,9 +1,9 @@
1
- import { AppExtensionService, ViewerExtensionRef } from '@alfresco/adf-extensions';
1
+ import { ViewerExtensionRef } from '@alfresco/adf-extensions';
2
2
  import * as i0 from "@angular/core";
3
3
  export declare class ViewUtilService {
4
- private extensionService;
5
- private extensions;
6
- private mimeTypes;
4
+ private readonly extensionService;
5
+ private readonly extensions;
6
+ private readonly mimeTypes;
7
7
  /**
8
8
  * Returns a list of the active Viewer content extensions.
9
9
  *
@@ -16,7 +16,6 @@ export declare class ViewUtilService {
16
16
  * @returns list of extensions
17
17
  */
18
18
  get externalExtensions(): string[];
19
- constructor(extensionService: AppExtensionService);
20
19
  /**
21
20
  * get File name from url
22
21
  *
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@alfresco/adf-core",
3
3
  "description": "Alfresco ADF core",
4
- "version": "8.3.0",
4
+ "version": "8.3.1",
5
5
  "author": "Hyland Software, Inc. and its affiliates",
6
6
  "repository": {
7
7
  "type": "git",
@@ -63,11 +63,10 @@
63
63
  "@angular/router": ">=16.0.0",
64
64
  "@mat-datetimepicker/core": ">=12.0.1",
65
65
  "@ngx-translate/core": ">=16.0.0",
66
- "@alfresco/js-api": ">=9.1.1",
67
- "@alfresco/adf-extensions": ">=8.2.0",
66
+ "@alfresco/js-api": ">=9.3.1",
67
+ "@alfresco/adf-extensions": ">=8.3.1",
68
68
  "minimatch": ">=10.0.0",
69
- "pdfjs-dist": ">=3.3.122",
70
- "ts-morph": ">=20.0.0"
69
+ "pdfjs-dist": ">=3.3.122"
71
70
  },
72
71
  "keywords": [
73
72
  "core",
package/public-api.d.ts CHANGED
@@ -16,14 +16,11 @@
16
16
  */
17
17
  export * from './lib/about/index';
18
18
  export * from './lib/avatar/avatar.component';
19
- export * from './lib/button/button.component';
20
- export * from './lib/progress/progress.component';
21
19
  export * from './lib/viewer/index';
22
20
  export * from './lib/toolbar/index';
23
21
  export * from './lib/header/index';
24
22
  export * from './lib/pagination/index';
25
23
  export * from './lib/login/index';
26
- export * from './lib/landing-page/index';
27
24
  export * from './lib/language-menu/index';
28
25
  export * from './lib/info-drawer/index';
29
26
  export * from './lib/identity-user-info/index';
@@ -35,7 +32,6 @@ export * from './lib/app-config/index';
35
32
  export * from './lib/form/index';
36
33
  export * from './lib/layout/index';
37
34
  export * from './lib/comments/index';
38
- export * from './lib/sorting-picker/index';
39
35
  export * from './lib/templates/index';
40
36
  export * from './lib/pipes/index';
41
37
  export * from './lib/directives/index';
@@ -44,16 +40,15 @@ export * from './lib/clipboard/index';
44
40
  export * from './lib/dialogs/index';
45
41
  export * from './lib/icon/index';
46
42
  export * from './lib/notifications/index';
47
- export * from './lib/blank-page/index';
48
43
  export * from './lib/search-text/index';
49
44
  export * from './lib/snackbar-content/index';
50
45
  export * from './lib/translation/index';
51
46
  export * from './lib/common/utils/index';
52
- export * from './lib/interface/index';
53
47
  export * from './lib/models/index';
54
48
  export * from './lib/events/index';
55
49
  export * from './lib/mock/index';
56
50
  export * from './lib/testing';
51
+ export * from './lib/stories/index';
57
52
  export * from './lib/auth';
58
53
  export * from './lib/common';
59
54
  export * from './lib/core.module';
@@ -15,10 +15,9 @@
15
15
  * limitations under the License.
16
16
  */
17
17
  import { Rule, Tree } from '@angular-devkit/schematics';
18
- import { Project } from 'ts-morph';
19
18
  /**
20
19
  * @returns Schematic rule for updating imports
21
20
  */
22
21
  export declare function updateAlfrescoApiImports(): Rule;
23
- export declare const visitor: (filePath: string, tree: Pick<Tree, "read" | "overwrite">, project: Project) => void;
22
+ export declare const visitor: (filePath: string, tree: Pick<Tree, "read" | "overwrite">) => void;
24
23
  export default updateAlfrescoApiImports;
@@ -18,8 +18,8 @@
18
18
  Object.defineProperty(exports, "__esModule", { value: true });
19
19
  exports.visitor = void 0;
20
20
  exports.updateAlfrescoApiImports = updateAlfrescoApiImports;
21
+ const ts = require("typescript");
21
22
  const schematics_1 = require("@angular-devkit/schematics");
22
- const ts_morph_1 = require("ts-morph");
23
23
  const alfrescoApiServiceMigration = {
24
24
  change: {
25
25
  importedValue: 'AlfrescoApiService',
@@ -55,14 +55,12 @@ const migrations = [alfrescoApiServiceMigration, alfrescoApiMockMigration, alfre
55
55
  * @returns Schematic rule for updating imports
56
56
  */
57
57
  function updateAlfrescoApiImports() {
58
- const project = new ts_morph_1.Project();
59
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
60
- return (tree, _context) => {
61
- tree.visit((filePath) => (0, exports.visitor)(filePath, tree, project));
58
+ return (tree) => {
59
+ tree.visit((filePath) => (0, exports.visitor)(filePath, tree));
62
60
  return tree;
63
61
  };
64
62
  }
65
- const visitor = (filePath, tree, project) => {
63
+ const visitor = (filePath, tree) => {
66
64
  if (!filePath.includes('/.git/') &&
67
65
  !filePath.includes('/node_modules/') &&
68
66
  !filePath.includes('/.angular/') &&
@@ -72,8 +70,10 @@ const visitor = (filePath, tree, project) => {
72
70
  if (!bufferFileContent) {
73
71
  throw new schematics_1.SchematicsException(`Could not read file: ${filePath}`);
74
72
  }
73
+ const fileContent = bufferFileContent.toString();
74
+ const sourceFile = ts.createSourceFile(filePath, fileContent, ts.ScriptTarget.Latest, true);
75
75
  migrations.forEach((migrationData) => {
76
- const fileWithUpdatedImport = moveImport(filePath, bufferFileContent, project, migrationData);
76
+ const fileWithUpdatedImport = moveImport(bufferFileContent, sourceFile, migrationData);
77
77
  if (fileWithUpdatedImport) {
78
78
  tree.overwrite(filePath, fileWithUpdatedImport);
79
79
  }
@@ -81,64 +81,49 @@ const visitor = (filePath, tree, project) => {
81
81
  }
82
82
  };
83
83
  exports.visitor = visitor;
84
- const moveImport = (filePath, bufferFileContent, project, migrationData) => {
85
- var _a, _b, _c;
84
+ const moveImport = (bufferFileContent, sourceFile, migrationData) => {
86
85
  const fileContent = bufferFileContent.toString();
87
86
  const predictImport = fileContent.includes(migrationData.change.importedValue);
88
- if (predictImport) {
89
- const sourceFile = (_a = project.getSourceFile(`migration-${filePath}`)) !== null && _a !== void 0 ? _a : project.createSourceFile(`migration-${filePath}`, fileContent);
90
- const alfrescoApiImportResult = getImportedValueFromSource(sourceFile, {
91
- importedIdentifier: migrationData.change.importedValue,
92
- from: migrationData.change.importSource
93
- });
94
- if (alfrescoApiImportResult === null || alfrescoApiImportResult === void 0 ? void 0 : alfrescoApiImportResult.importedValue) {
95
- if (alfrescoApiImportResult.allImportedValuesCount === 1) {
96
- // There is only one import e.g. import { A } from 'A';
97
- // Therefore, we need to remove whole import statement
98
- (_b = alfrescoApiImportResult.importSource) === null || _b === void 0 ? void 0 : _b.remove();
99
- }
100
- else {
101
- (_c = alfrescoApiImportResult.importedValue) === null || _c === void 0 ? void 0 : _c.remove();
102
- }
103
- const alfrescoContentServiceImport = getSourceImport(sourceFile, migrationData.to.importSource);
104
- if (alfrescoContentServiceImport) {
105
- alfrescoContentServiceImport.addNamedImport(migrationData.to.importedValue);
106
- }
107
- else {
108
- sourceFile.insertStatements(sourceFile.getImportDeclarations().length + 1, `import { ${migrationData.to.importedValue} } from '${migrationData.to.importSource}';`);
109
- }
110
- return sourceFile.getFullText();
111
- }
87
+ if (!predictImport) {
88
+ return undefined;
112
89
  }
113
- return undefined;
114
- };
115
- const getSourceImport = (sourceFile, from) => {
116
- const moduleImports = sourceFile.getImportDeclarations();
90
+ const moduleImports = sourceFile.statements.filter(ts.isImportDeclaration);
117
91
  const importDeclaration = moduleImports.find((moduleImport) => {
118
- const currentImportSource = moduleImport.getModuleSpecifierValue();
119
- return currentImportSource === from;
92
+ const currentImportSource = moduleImport.moduleSpecifier.getText().replace(/['"]/g, '');
93
+ return currentImportSource === migrationData.change.importSource;
120
94
  });
121
- return importDeclaration;
122
- };
123
- const getImportedValueFromSource = (sourceFile, searchedImport) => {
124
- var _a;
125
- const importSource = getSourceImport(sourceFile, searchedImport.from);
126
- if (!importSource) {
127
- return {
128
- importedValue: undefined,
129
- importSource: undefined,
130
- allImportedValuesCount: undefined
131
- };
95
+ if (!importDeclaration?.importClause?.namedBindings) {
96
+ return undefined;
132
97
  }
133
- const importedValues = importSource === null || importSource === void 0 ? void 0 : importSource.getImportClause();
134
- const namedImports = importedValues === null || importedValues === void 0 ? void 0 : importedValues.getNamedBindings();
135
- const namedImportsElements = (_a = namedImports === null || namedImports === void 0 ? void 0 : namedImports.getElements()) !== null && _a !== void 0 ? _a : [];
136
- const importedValue = namedImportsElements.find((binding) => binding.getName() === searchedImport.importedIdentifier);
137
- return {
138
- importedValue,
139
- importSource,
140
- allImportedValuesCount: namedImportsElements.length
141
- };
98
+ if (!ts.isNamedImports(importDeclaration.importClause.namedBindings)) {
99
+ return undefined;
100
+ }
101
+ const namedImportsElements = importDeclaration.importClause.namedBindings.elements;
102
+ const importedValue = namedImportsElements.find((binding) => binding.name.text === migrationData.change.importedValue);
103
+ if (importedValue) {
104
+ let updatedContent = namedImportsElements.length === 1
105
+ ? removeTextRange(fileContent, importDeclaration.getFullStart(), importDeclaration.getEnd())
106
+ : removeTextRange(fileContent, importedValue.getFullStart(), importedValue.getEnd());
107
+ const alreadyImported = moduleImports.some((moduleImport) => {
108
+ const currentImportSource = moduleImport.moduleSpecifier.getText().replace(/['"]/g, '');
109
+ return (currentImportSource === migrationData.to.importSource &&
110
+ moduleImport.importClause?.namedBindings &&
111
+ ts.isNamedImports(moduleImport.importClause.namedBindings) &&
112
+ moduleImport.importClause.namedBindings.elements.some((element) => element.name.text === migrationData.to.importedValue));
113
+ });
114
+ if (!alreadyImported) {
115
+ const firstNonImport = sourceFile.statements.find((statement) => !ts.isImportDeclaration(statement));
116
+ const insertPosition = firstNonImport ? firstNonImport.getFullStart() : fileContent.length;
117
+ updatedContent =
118
+ updatedContent.slice(0, insertPosition).trimEnd() +
119
+ `\nimport { ${migrationData.to.importedValue} } from '${migrationData.to.importSource}';\n` +
120
+ updatedContent.slice(insertPosition);
121
+ }
122
+ updatedContent = updatedContent.replace(/^\s*\n+/g, '').replace(/\n{3,}/g, '\n\n');
123
+ return updatedContent;
124
+ }
125
+ return undefined;
142
126
  };
127
+ const removeTextRange = (text, start, end) => text.slice(0, start) + text.slice(end);
143
128
  exports.default = updateAlfrescoApiImports;
144
129
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../../lib/core/schematics/migrations/7_0_0/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;GAeG;;;AAsDH,4DASC;AA7DD,2DAA+F;AAC/F,uCAAiG;AAajG,MAAM,2BAA2B,GAAkB;IAC/C,MAAM,EAAE;QACJ,aAAa,EAAE,oBAAoB;QACnC,YAAY,EAAE,oBAAoB;KACrC;IACD,EAAE,EAAE;QACA,aAAa,EAAE,oBAAoB;QACnC,YAAY,EAAE,gCAAgC;KACjD;CACJ,CAAC;AAEF,MAAM,wBAAwB,GAAkB;IAC5C,MAAM,EAAE;QACJ,aAAa,EAAE,wBAAwB;QACvC,YAAY,EAAE,oBAAoB;KACrC;IACD,EAAE,EAAE;QACA,aAAa,EAAE,wBAAwB;QACvC,YAAY,EA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AAM,YAAY,GAAG,cAAc,aAAd,cAAc,uBAAd,cAAc,CAAE,gBAAgB,EAAkB,CAAC;IACxE,MAAM,oBAAoB,GAAG,MAAA,YAAY,aAAZ,YAAY,uBAAZ,YAAY,CAAE,WAAW,EAAE,mCAAI,EAAE,CAAC;IAE/D,MAAM,aAAa,GAAG,oBAAoB,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,OAAO,EAAE,KAAK,cAAc,CAAC,kBAAkB,CAAC,CAAC;IAEtH,OAAO;QACH,aAAa;QACb,YAAY;QACZ,sBAAsB,EAAE,oBAAoB,CAAC,MAAM;KACtD,CAAC;AACN,CAAC,CAAC;AAEF,kBAAe,wBAAwB,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../../lib/core/schematics/migrations/7_0_0/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;GAeG;;;AAsDH,4DAKC;AAzDD,iCAAiC;AACjC,2DAA6E;AAa7E,MAAM,2BAA2B,GAAkB;IAC/C,MAAM,EAAE;QACJ,aAAa,EAAE,oBAAoB;QACnC,YAAY,EAAE,oBAAoB;KACrC;IACD,EAAE,EAAE;QACA,aAAa,EAAE,oBAAoB;QACnC,YAAY,EAAE,gCAAgC;KACjD;CACJ,CAAC;AAEF,MAAM,wBAAwB,GAAkB;IAC5C,MAAM,EAAE;QACJ,aAAa,EAAE,wBAAwB;QACvC,YAAY,EAAE,oBAAoB;KACrC;IACD,EAAE,EAAE;QACA,aAAa,EAAE,wBAAwB;QACvC,YAAY,EAAE,gCAAgC;KACjD;CACJ,CAAC;AAEF,MAAM,2BAA2B,GAAkB;IAC/C,MAAM,EAAE;QACJ,aAAa,EAAE,oBAAoB;QACnC,YAAY,EAAE,oBAAoB;KACrC;IACD,EAAE,EAAE;QACA,aAAa,EAAE,oBAAoB;QACnC,YAAY,EAAE,gCAAgC;KACjD;CACJ,CAAC;AAEF,MAAM,UAAU,GAAoB,CAA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AE;oBACjD,cAAc,aAAa,CAAC,EAAE,CAAC,aAAa,YAAY,aAAa,CAAC,EAAE,CAAC,YAAY,MAAM;oBAC3F,cAAc,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC;QAC7C,CAAC;QACD,cAAc,GAAG,cAAc,CAAC,OAAO,CAAC,UAAU,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC;QAEnF,OAAO,cAAc,CAAC;IAC1B,CAAC;IAED,OAAO,SAAS,CAAC;AACrB,CAAC,CAAC;AAEF,MAAM,eAAe,GAAG,CAAC,IAAY,EAAE,KAAa,EAAE,GAAW,EAAU,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,KAAK,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;AAErH,kBAAe,wBAAwB,CAAC"}
@@ -11,11 +11,6 @@
11
11
  "move-out-alfresco-api": {
12
12
  "version": "7.0.0",
13
13
  "packages": {
14
- "ts-morph": {
15
- "version": "^20.0.0",
16
- "alwaysAddToPackageJson": true,
17
- "addToPackageJson": "devDependencies"
18
- },
19
14
  "@alfresco/adf-content-services": {
20
15
  "version": "7.0.0",
21
16
  "alwaysAddToPackageJson": false