@alfresco/aca-shared 2.0.1 → 4.0.0-4895381898

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 (248) hide show
  1. package/README.md +7 -6
  2. package/esm2020/lib/adf-extensions/extensions-data-loader.guard.mjs +73 -0
  3. package/esm2020/lib/components/document-base-page/document-base-page.component.mjs +176 -0
  4. package/esm2020/lib/components/document-base-page/document-base-page.service.mjs +26 -0
  5. package/esm2020/lib/components/generic-error/generic-error.component.mjs +41 -0
  6. package/esm2020/lib/components/generic-error/generic-error.module.mjs +44 -0
  7. package/esm2020/lib/components/info-drawer/info-drawer.component.mjs +123 -0
  8. package/esm2020/lib/components/info-drawer/shared-info-drawer.module.mjs +46 -0
  9. package/esm2020/lib/components/locked-by/locked-by.component.mjs +52 -0
  10. package/esm2020/lib/components/locked-by/locked-by.module.mjs +44 -0
  11. package/esm2020/lib/components/open-in-app/open-in-app.component.mjs +58 -0
  12. package/esm2020/lib/components/page-layout/page-layout-content.component.mjs +48 -0
  13. package/esm2020/lib/components/page-layout/page-layout-error.component.mjs +40 -0
  14. package/esm2020/lib/components/page-layout/page-layout-header.component.mjs +40 -0
  15. package/esm2020/lib/components/page-layout/page-layout.component.mjs +57 -0
  16. package/esm2020/lib/components/page-layout/page-layout.module.mjs +47 -0
  17. package/esm2020/lib/components/tool-bar/shared-toolbar.module.mjs +46 -0
  18. package/esm2020/lib/components/tool-bar/toolbar-action/toolbar-action.component.mjs +59 -0
  19. package/esm2020/lib/components/tool-bar/toolbar-button/toolbar-button.component.mjs +69 -0
  20. package/esm2020/lib/components/tool-bar/toolbar-menu/toolbar-menu.component.mjs +82 -0
  21. package/esm2020/lib/components/tool-bar/toolbar-menu-item/toolbar-menu-item.component.mjs +68 -0
  22. package/esm2020/lib/directives/contextmenu/contextmenu.directive.mjs +106 -0
  23. package/esm2020/lib/directives/contextmenu/contextmenu.module.mjs +42 -0
  24. package/esm2020/lib/directives/pagination.directive.mjs +54 -0
  25. package/esm2020/lib/directives/shared.directives.module.mjs +41 -0
  26. package/esm2020/lib/models/modal-configuration.mjs +25 -0
  27. package/esm2020/lib/models/types.mjs +25 -0
  28. package/esm2020/lib/models/viewer.rules.mjs +25 -0
  29. package/esm2020/lib/routing/shared.guard.mjs +48 -0
  30. package/esm2020/lib/services/aca-file-auto-download.service.mjs +55 -0
  31. package/esm2020/lib/services/aca-mobile-app-switcher.service.mjs +107 -0
  32. package/esm2020/lib/services/alfresco-office-extension.service.mjs +63 -0
  33. package/esm2020/lib/services/app-hook.service.mjs +87 -0
  34. package/esm2020/lib/services/app.extension.service.mjs +444 -0
  35. package/esm2020/lib/services/app.service.mjs +223 -0
  36. package/esm2020/lib/services/content-api.service.mjs +266 -0
  37. package/esm2020/lib/services/node-permission.service.mjs +89 -0
  38. package/esm2020/lib/services/router.extension.service.mjs +105 -0
  39. package/esm2020/lib/shared.module.mjs +54 -0
  40. package/esm2020/lib/testing/lib-testing-module.mjs +115 -0
  41. package/esm2020/lib/utils/node.utils.mjs +42 -0
  42. package/esm2020/public-api.mjs +62 -0
  43. package/esm2020/rules/app.rules.mjs +526 -0
  44. package/esm2020/rules/navigation.rules.mjs +156 -0
  45. package/esm2020/rules/public-api.mjs +28 -0
  46. package/esm2020/rules/repository.rules.mjs +33 -0
  47. package/esm2020/rules/user.rules.mjs +29 -0
  48. package/esm2020/store/actions/app-action-types.mjs +46 -0
  49. package/esm2020/store/actions/app.actions.mjs +128 -0
  50. package/esm2020/store/actions/context-menu-action-types.mjs +28 -0
  51. package/esm2020/store/actions/contextmenu.actions.mjs +31 -0
  52. package/esm2020/store/actions/library.actions.mjs +63 -0
  53. package/esm2020/store/actions/metadata-aspect.actions.mjs +31 -0
  54. package/esm2020/store/actions/node.actions.mjs +188 -0
  55. package/esm2020/store/actions/router-action-types.mjs +32 -0
  56. package/esm2020/store/actions/router.actions.mjs +54 -0
  57. package/esm2020/store/actions/search.actions.mjs +41 -0
  58. package/esm2020/store/actions/snackbar.actions.mjs +57 -0
  59. package/esm2020/store/actions/template-action-types.mjs +31 -0
  60. package/esm2020/store/actions/template.actions.mjs +47 -0
  61. package/esm2020/store/actions/upload.actions.mjs +49 -0
  62. package/esm2020/store/actions/viewer.actions.mjs +81 -0
  63. package/esm2020/store/effects/dialog.effects.mjs +44 -0
  64. package/esm2020/store/effects/router.effects.mjs +116 -0
  65. package/esm2020/store/effects/snackbar.effects.mjs +85 -0
  66. package/esm2020/store/models/delete-status.model.mjs +25 -0
  67. package/esm2020/store/models/deleted-node-info.model.mjs +25 -0
  68. package/esm2020/store/models/modal-configuration.mjs +25 -0
  69. package/esm2020/store/models/node-info.model.mjs +25 -0
  70. package/esm2020/store/models/search-option.model.mjs +30 -0
  71. package/esm2020/store/public-api.mjs +49 -0
  72. package/esm2020/store/selectors/app.selectors.mjs +56 -0
  73. package/esm2020/store/states/app.state.mjs +26 -0
  74. package/esm2020/store/store.module.mjs +42 -0
  75. package/fesm2015/alfresco-aca-shared-rules.mjs +775 -0
  76. package/fesm2015/alfresco-aca-shared-rules.mjs.map +1 -0
  77. package/fesm2015/{alfresco-aca-shared-store.js → alfresco-aca-shared-store.mjs} +395 -396
  78. package/fesm2015/alfresco-aca-shared-store.mjs.map +1 -0
  79. package/fesm2015/alfresco-aca-shared.mjs +2902 -0
  80. package/fesm2015/alfresco-aca-shared.mjs.map +1 -0
  81. package/{fesm2015/alfresco-aca-shared-rules.js → fesm2020/alfresco-aca-shared-rules.mjs} +274 -180
  82. package/fesm2020/alfresco-aca-shared-rules.mjs.map +1 -0
  83. package/fesm2020/alfresco-aca-shared-store.mjs +1376 -0
  84. package/fesm2020/alfresco-aca-shared-store.mjs.map +1 -0
  85. package/fesm2020/alfresco-aca-shared.mjs +3049 -0
  86. package/fesm2020/alfresco-aca-shared.mjs.map +1 -0
  87. package/{alfresco-aca-shared.d.ts → index.d.ts} +1 -0
  88. package/lib/adf-extensions/extensions-data-loader.guard.d.ts +9 -7
  89. package/lib/components/document-base-page/document-base-page.component.d.ts +76 -0
  90. package/lib/components/document-base-page/document-base-page.service.d.ts +28 -0
  91. package/lib/components/generic-error/generic-error.component.d.ts +3 -24
  92. package/lib/components/generic-error/generic-error.module.d.ts +8 -24
  93. package/lib/components/info-drawer/info-drawer.component.d.ts +11 -6
  94. package/lib/components/info-drawer/shared-info-drawer.module.d.ts +11 -24
  95. package/lib/components/locked-by/locked-by.component.d.ts +5 -30
  96. package/lib/components/locked-by/locked-by.module.d.ts +8 -24
  97. package/lib/components/open-in-app/open-in-app.component.d.ts +16 -0
  98. package/lib/components/page-layout/page-layout-content.component.d.ts +3 -24
  99. package/lib/components/page-layout/page-layout-error.component.d.ts +3 -24
  100. package/lib/components/page-layout/page-layout-header.component.d.ts +3 -24
  101. package/lib/components/page-layout/page-layout.component.d.ts +18 -7
  102. package/lib/components/page-layout/page-layout.module.d.ts +12 -24
  103. package/lib/components/tool-bar/shared-toolbar.module.d.ts +11 -24
  104. package/lib/components/tool-bar/toolbar-action/toolbar-action.component.d.ts +16 -8
  105. package/lib/components/tool-bar/toolbar-button/toolbar-button.component.d.ts +10 -25
  106. package/lib/components/tool-bar/toolbar-menu/toolbar-menu.component.d.ts +23 -13
  107. package/lib/components/tool-bar/toolbar-menu-item/toolbar-menu-item.component.d.ts +7 -27
  108. package/lib/directives/contextmenu/contextmenu.directive.d.ts +10 -7
  109. package/lib/directives/contextmenu/contextmenu.module.d.ts +5 -24
  110. package/lib/directives/pagination.directive.d.ts +8 -6
  111. package/lib/directives/shared.directives.module.d.ts +6 -24
  112. package/lib/models/modal-configuration.d.ts +26 -0
  113. package/lib/models/types.d.ts +5 -6
  114. package/lib/models/viewer.rules.d.ts +9 -6
  115. package/lib/routing/shared.guard.d.ts +5 -26
  116. package/lib/services/aca-file-auto-download.service.d.ts +13 -0
  117. package/lib/services/aca-mobile-app-switcher.service.d.ts +48 -0
  118. package/lib/services/alfresco-office-extension.service.d.ts +11 -0
  119. package/lib/services/app-hook.service.d.ts +55 -0
  120. package/lib/services/app.extension.service.d.ts +30 -45
  121. package/lib/services/app.service.d.ts +51 -12
  122. package/lib/services/content-api.service.d.ts +34 -25
  123. package/lib/services/node-permission.service.d.ts +3 -24
  124. package/lib/services/router.extension.service.d.ts +3 -24
  125. package/lib/shared.module.d.ts +15 -6
  126. package/lib/testing/lib-testing-module.d.ts +41 -0
  127. package/lib/utils/node.utils.d.ts +5 -6
  128. package/package.json +60 -18
  129. package/public-api.d.ts +12 -7
  130. package/rules/app.rules.d.ts +128 -36
  131. package/rules/{alfresco-aca-shared-rules.d.ts → index.d.ts} +1 -0
  132. package/rules/navigation.rules.d.ts +12 -12
  133. package/rules/public-api.d.ts +5 -6
  134. package/rules/repository.rules.d.ts +7 -7
  135. package/rules/user.rules.d.ts +6 -7
  136. package/store/actions/app-action-types.d.ts +44 -0
  137. package/store/actions/app.actions.d.ts +24 -29
  138. package/store/actions/context-menu-action-types.d.ts +26 -0
  139. package/store/actions/contextmenu.actions.d.ts +6 -9
  140. package/store/actions/library.actions.d.ts +8 -7
  141. package/store/actions/metadata-aspect.actions.d.ts +5 -6
  142. package/store/actions/node.actions.d.ts +38 -13
  143. package/store/actions/router-action-types.d.ts +30 -0
  144. package/store/actions/router.actions.d.ts +10 -12
  145. package/store/actions/search.actions.d.ts +11 -19
  146. package/store/actions/snackbar.actions.d.ts +13 -17
  147. package/store/actions/template-action-types.d.ts +29 -0
  148. package/store/actions/template.actions.d.ts +6 -12
  149. package/store/actions/upload.actions.d.ts +8 -7
  150. package/store/actions/viewer.actions.d.ts +11 -6
  151. package/store/effects/dialog.effects.d.ts +9 -7
  152. package/store/effects/router.effects.d.ts +11 -29
  153. package/store/effects/snackbar.effects.d.ts +11 -9
  154. package/store/{alfresco-aca-shared-store.d.ts → index.d.ts} +1 -0
  155. package/store/models/delete-status.model.d.ts +5 -6
  156. package/store/models/deleted-node-info.model.d.ts +5 -6
  157. package/store/models/modal-configuration.d.ts +26 -0
  158. package/store/models/node-info.model.d.ts +5 -6
  159. package/store/models/search-option.model.d.ts +5 -6
  160. package/store/public-api.d.ts +9 -6
  161. package/store/selectors/app.selectors.d.ts +10 -9
  162. package/store/states/app.state.d.ts +12 -9
  163. package/store/store.module.d.ts +5 -24
  164. package/alfresco-aca-shared.metadata.json +0 -1
  165. package/bundles/alfresco-aca-shared-rules.umd.js +0 -745
  166. package/bundles/alfresco-aca-shared-rules.umd.js.map +0 -1
  167. package/bundles/alfresco-aca-shared-rules.umd.min.js +0 -125
  168. package/bundles/alfresco-aca-shared-rules.umd.min.js.map +0 -1
  169. package/bundles/alfresco-aca-shared-store.umd.js +0 -1784
  170. package/bundles/alfresco-aca-shared-store.umd.js.map +0 -1
  171. package/bundles/alfresco-aca-shared-store.umd.min.js +0 -462
  172. package/bundles/alfresco-aca-shared-store.umd.min.js.map +0 -1
  173. package/bundles/alfresco-aca-shared.umd.js +0 -2523
  174. package/bundles/alfresco-aca-shared.umd.js.map +0 -1
  175. package/bundles/alfresco-aca-shared.umd.min.js +0 -740
  176. package/bundles/alfresco-aca-shared.umd.min.js.map +0 -1
  177. package/esm2015/lib/adf-extensions/extensions-data-loader.guard.js +0 -74
  178. package/esm2015/lib/components/generic-error/generic-error.component.js +0 -44
  179. package/esm2015/lib/components/generic-error/generic-error.module.js +0 -39
  180. package/esm2015/lib/components/info-drawer/info-drawer.component.js +0 -105
  181. package/esm2015/lib/components/info-drawer/shared-info-drawer.module.js +0 -41
  182. package/esm2015/lib/components/locked-by/locked-by.component.js +0 -54
  183. package/esm2015/lib/components/locked-by/locked-by.module.js +0 -38
  184. package/esm2015/lib/components/page-layout/page-layout-content.component.js +0 -43
  185. package/esm2015/lib/components/page-layout/page-layout-error.component.js +0 -37
  186. package/esm2015/lib/components/page-layout/page-layout-header.component.js +0 -37
  187. package/esm2015/lib/components/page-layout/page-layout.component.js +0 -44
  188. package/esm2015/lib/components/page-layout/page-layout.module.js +0 -40
  189. package/esm2015/lib/components/tool-bar/shared-toolbar.module.js +0 -42
  190. package/esm2015/lib/components/tool-bar/toolbar-action/toolbar-action.component.js +0 -57
  191. package/esm2015/lib/components/tool-bar/toolbar-button/toolbar-button.component.js +0 -66
  192. package/esm2015/lib/components/tool-bar/toolbar-menu/toolbar-menu.component.js +0 -55
  193. package/esm2015/lib/components/tool-bar/toolbar-menu-item/toolbar-menu-item.component.js +0 -65
  194. package/esm2015/lib/directives/contextmenu/contextmenu.directive.js +0 -97
  195. package/esm2015/lib/directives/contextmenu/contextmenu.module.js +0 -38
  196. package/esm2015/lib/directives/pagination.directive.js +0 -55
  197. package/esm2015/lib/directives/shared.directives.module.js +0 -37
  198. package/esm2015/lib/models/types.js +0 -25
  199. package/esm2015/lib/models/viewer.rules.js +0 -25
  200. package/esm2015/lib/routing/app.routes.strategy.js +0 -105
  201. package/esm2015/lib/routing/shared.guard.js +0 -50
  202. package/esm2015/lib/services/app.extension.service.js +0 -398
  203. package/esm2015/lib/services/app.service.js +0 -69
  204. package/esm2015/lib/services/content-api.service.js +0 -205
  205. package/esm2015/lib/services/node-permission.service.js +0 -88
  206. package/esm2015/lib/services/router.extension.service.js +0 -110
  207. package/esm2015/lib/shared.module.js +0 -44
  208. package/esm2015/lib/utils/node.utils.js +0 -34
  209. package/esm2015/public-api.js +0 -57
  210. package/esm2015/rules/app.rules.js +0 -420
  211. package/esm2015/rules/navigation.rules.js +0 -164
  212. package/esm2015/rules/public-api.js +0 -29
  213. package/esm2015/rules/repository.rules.js +0 -32
  214. package/esm2015/rules/user.rules.js +0 -32
  215. package/esm2015/store/actions/app.actions.js +0 -130
  216. package/esm2015/store/actions/contextmenu.actions.js +0 -35
  217. package/esm2015/store/actions/library.actions.js +0 -63
  218. package/esm2015/store/actions/metadata-aspect.actions.js +0 -32
  219. package/esm2015/store/actions/node.actions.js +0 -161
  220. package/esm2015/store/actions/router.actions.js +0 -56
  221. package/esm2015/store/actions/search.actions.js +0 -54
  222. package/esm2015/store/actions/snackbar.actions.js +0 -61
  223. package/esm2015/store/actions/template.actions.js +0 -54
  224. package/esm2015/store/actions/upload.actions.js +0 -49
  225. package/esm2015/store/actions/viewer.actions.js +0 -75
  226. package/esm2015/store/effects/dialog.effects.js +0 -49
  227. package/esm2015/store/effects/router.effects.js +0 -132
  228. package/esm2015/store/effects/snackbar.effects.js +0 -90
  229. package/esm2015/store/models/delete-status.model.js +0 -25
  230. package/esm2015/store/models/deleted-node-info.model.js +0 -25
  231. package/esm2015/store/models/node-info.model.js +0 -25
  232. package/esm2015/store/models/search-option.model.js +0 -31
  233. package/esm2015/store/public-api.js +0 -46
  234. package/esm2015/store/selectors/app.selectors.js +0 -80
  235. package/esm2015/store/states/app.state.js +0 -25
  236. package/esm2015/store/store.module.js +0 -37
  237. package/fesm2015/alfresco-aca-shared-rules.js.map +0 -1
  238. package/fesm2015/alfresco-aca-shared-store.js.map +0 -1
  239. package/fesm2015/alfresco-aca-shared.js +0 -2167
  240. package/fesm2015/alfresco-aca-shared.js.map +0 -1
  241. package/lib/routing/app.routes.strategy.d.ts +0 -40
  242. package/rules/alfresco-aca-shared-rules.metadata.json +0 -1
  243. package/rules/package.json +0 -11
  244. package/store/alfresco-aca-shared-store.metadata.json +0 -1
  245. package/store/package.json +0 -11
  246. /package/{esm2015/alfresco-aca-shared.js → esm2020/alfresco-aca-shared.mjs} +0 -0
  247. /package/{esm2015/rules/alfresco-aca-shared-rules.js → esm2020/rules/alfresco-aca-shared-rules.mjs} +0 -0
  248. /package/{esm2015/store/alfresco-aca-shared-store.js → esm2020/store/alfresco-aca-shared-store.mjs} +0 -0
@@ -0,0 +1,775 @@
1
+ /*!
2
+ * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved.
3
+ *
4
+ * Alfresco Example Content Application
5
+ *
6
+ * This file is part of the Alfresco Example Content Application.
7
+ * If the software was purchased under a paid Alfresco license, the terms of
8
+ * the paid license agreement will prevail. Otherwise, the software is
9
+ * provided under the following open source license terms:
10
+ *
11
+ * The Alfresco Example Content Application is free software: you can redistribute it and/or modify
12
+ * it under the terms of the GNU Lesser General Public License as published by
13
+ * the Free Software Foundation, either version 3 of the License, or
14
+ * (at your option) any later version.
15
+ *
16
+ * The Alfresco Example Content Application is distributed in the hope that it will be useful,
17
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
18
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19
+ * GNU Lesser General Public License for more details.
20
+ *
21
+ * You should have received a copy of the GNU Lesser General Public License
22
+ * from Hyland Software. If not, see <http://www.gnu.org/licenses/>.
23
+ */
24
+ /**
25
+ * Checks if a Preview route is activated.
26
+ * JSON ref: `app.navigation.isPreview`
27
+ */
28
+ function isPreview(context) {
29
+ const { url } = context.navigation;
30
+ return url && (url.includes('/preview/') || url.includes('viewer:view') || url.includes('/view/'));
31
+ }
32
+ /**
33
+ * Checks if a **Favorites** route is activated.
34
+ * JSON ref: `app.navigation.isFavorites`
35
+ */
36
+ function isFavorites(context) {
37
+ const { url } = context.navigation;
38
+ return url && url.startsWith('/favorites') && !isPreview(context);
39
+ }
40
+ /**
41
+ * Checks if the activated route is not **Favorites**.
42
+ * JSON ref: `app.navigation.isNotFavorites`
43
+ */
44
+ const isNotFavorites = (context) => !isFavorites(context);
45
+ /**
46
+ * Checks if a **Shared Files** route is activated.
47
+ * JSON ref: `app.navigation.isSharedFiles`
48
+ */
49
+ function isSharedFiles(context) {
50
+ const { url } = context.navigation;
51
+ return url && url.startsWith('/shared') && !isPreview(context);
52
+ }
53
+ /**
54
+ * Checks if the activated route is not **Shared Files**.
55
+ * JSON ref: `app.navigation.isNotSharedFiles`
56
+ */
57
+ const isNotSharedFiles = (context) => !isSharedFiles(context);
58
+ /**
59
+ * Checks if a **Trashcan** route is activated.
60
+ * JSON ref: `app.navigation.isTrashcan`
61
+ */
62
+ function isTrashcan(context) {
63
+ const { url } = context.navigation;
64
+ return url && url.startsWith('/trashcan');
65
+ }
66
+ /**
67
+ * Checks if the activated route is not **Trashcan**.
68
+ * JSON ref: `app.navigation.isNotTrashcan`
69
+ */
70
+ const isNotTrashcan = (context) => !isTrashcan(context);
71
+ /**
72
+ * Checks if a **Personal Files** route is activated.
73
+ * JSON ref: `app.navigation.isPersonalFiles`
74
+ */
75
+ function isPersonalFiles(context) {
76
+ const { url } = context.navigation;
77
+ return url && url.startsWith('/personal-files');
78
+ }
79
+ /**
80
+ * Checks if a **Library Files** route is activated.
81
+ * JSON ref: `app.navigation.isLibraryFiles`
82
+ */
83
+ function isLibraryFiles(context) {
84
+ const { url } = context.navigation;
85
+ return url && url.startsWith('/libraries');
86
+ }
87
+ /**
88
+ * Checks if a **Library Files** or **Library Search Result** route is activated.
89
+ * JSON ref: `app.navigation.isLibraryFiles`
90
+ */
91
+ function isLibraries(context) {
92
+ const { url } = context.navigation;
93
+ return url && (url.endsWith('/libraries') || url.startsWith('/search-libraries'));
94
+ }
95
+ function isLibraryContent(context) {
96
+ const { url } = context.navigation;
97
+ return url && (url.endsWith('/libraries') || url.includes('/libraries/') || url.startsWith('/search-libraries'));
98
+ }
99
+ /**
100
+ * Checks if the activated route is neither **Libraries** nor **Library Search Results**.
101
+ * JSON ref: `app.navigation.isNotLibraries`
102
+ */
103
+ const isNotLibraries = (context) => !isLibraries(context);
104
+ /**
105
+ * Checks if a **Recent Files** route is activated.
106
+ * JSON ref: `app.navigation.isRecentFiles`
107
+ */
108
+ function isRecentFiles(context) {
109
+ const { url } = context.navigation;
110
+ return url && url.startsWith('/recent-files');
111
+ }
112
+ /**
113
+ * Checks if the activated route is not **Recent Files**.
114
+ * JSON ref: `app.navigation.isNotRecentFiles`
115
+ */
116
+ const isNotRecentFiles = (context) => !isRecentFiles(context);
117
+ /**
118
+ * Checks if a **Search Results** route is activated.
119
+ * JSON ref: `app.navigation.isSearchResults`
120
+ */
121
+ function isSearchResults(context
122
+ // ...args: RuleParameter[]
123
+ ) {
124
+ const { url } = context.navigation;
125
+ return url && url.startsWith('/search');
126
+ }
127
+ /**
128
+ * Checks if the activated route is not **Search Results**.
129
+ * JSON ref: `app.navigation.isNotSearchResults`
130
+ */
131
+ const isNotSearchResults = (context) => !isSearchResults(context);
132
+ /**
133
+ * Checks if a **Shared Preview** route is activated.
134
+ * JSON ref: `app.navigation.isSharedPreview`
135
+ */
136
+ function isSharedPreview(context) {
137
+ const { url } = context.navigation;
138
+ return url && (url.startsWith('/shared/preview/') || (url.startsWith('/shared') && url.includes('viewer:view')));
139
+ }
140
+ /**
141
+ * Checks if a **Favorites Preview** route is activated.
142
+ * JSON ref: `app.navigation.isFavoritesPreview`
143
+ */
144
+ function isFavoritesPreview(context) {
145
+ const { url } = context.navigation;
146
+ return url && (url.startsWith('/favorites/preview/') || (url.startsWith('/favorites') && url.includes('viewer:view')));
147
+ }
148
+ /**
149
+ * Checks if a **Shared File Preview** route is activated.
150
+ * JSON ref: `app.navigation.isFavoritesPreview`
151
+ */
152
+ function isSharedFileViewer(context) {
153
+ const { url } = context.navigation;
154
+ return url && url.startsWith('/preview/s/');
155
+ }
156
+
157
+ /*!
158
+ * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved.
159
+ *
160
+ * Alfresco Example Content Application
161
+ *
162
+ * This file is part of the Alfresco Example Content Application.
163
+ * If the software was purchased under a paid Alfresco license, the terms of
164
+ * the paid license agreement will prevail. Otherwise, the software is
165
+ * provided under the following open source license terms:
166
+ *
167
+ * The Alfresco Example Content Application is free software: you can redistribute it and/or modify
168
+ * it under the terms of the GNU Lesser General Public License as published by
169
+ * the Free Software Foundation, either version 3 of the License, or
170
+ * (at your option) any later version.
171
+ *
172
+ * The Alfresco Example Content Application is distributed in the hope that it will be useful,
173
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
174
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
175
+ * GNU Lesser General Public License for more details.
176
+ *
177
+ * You should have received a copy of the GNU Lesser General Public License
178
+ * from Hyland Software. If not, see <http://www.gnu.org/licenses/>.
179
+ */
180
+ /**
181
+ * Checks if the quick share repository option is enabled or not.
182
+ * JSON ref: `repository.isQuickShareEnabled`
183
+ */
184
+ const hasQuickShareEnabled = (context) => context.repository.status.isQuickShareEnabled;
185
+ function isMajorVersionAvailable(context, versionNumber) {
186
+ var _a;
187
+ const majorVersion = ((_a = context.repository.version) === null || _a === void 0 ? void 0 : _a.major) ? parseInt(context.repository.version.major, 10) : 0;
188
+ return majorVersion >= parseInt(versionNumber, 10);
189
+ }
190
+
191
+ /*!
192
+ * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved.
193
+ *
194
+ * Alfresco Example Content Application
195
+ *
196
+ * This file is part of the Alfresco Example Content Application.
197
+ * If the software was purchased under a paid Alfresco license, the terms of
198
+ * the paid license agreement will prevail. Otherwise, the software is
199
+ * provided under the following open source license terms:
200
+ *
201
+ * The Alfresco Example Content Application is free software: you can redistribute it and/or modify
202
+ * it under the terms of the GNU Lesser General Public License as published by
203
+ * the Free Software Foundation, either version 3 of the License, or
204
+ * (at your option) any later version.
205
+ *
206
+ * The Alfresco Example Content Application is distributed in the hope that it will be useful,
207
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
208
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
209
+ * GNU Lesser General Public License for more details.
210
+ *
211
+ * You should have received a copy of the GNU Lesser General Public License
212
+ * from Hyland Software. If not, see <http://www.gnu.org/licenses/>.
213
+ */
214
+ /**
215
+ * Checks if user is admin.
216
+ * JSON ref: `user.isAdmin`
217
+ */
218
+ const isAdmin = (context) => context.profile.isAdmin;
219
+
220
+ /*!
221
+ * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved.
222
+ *
223
+ * Alfresco Example Content Application
224
+ *
225
+ * This file is part of the Alfresco Example Content Application.
226
+ * If the software was purchased under a paid Alfresco license, the terms of
227
+ * the paid license agreement will prevail. Otherwise, the software is
228
+ * provided under the following open source license terms:
229
+ *
230
+ * The Alfresco Example Content Application is free software: you can redistribute it and/or modify
231
+ * it under the terms of the GNU Lesser General Public License as published by
232
+ * the Free Software Foundation, either version 3 of the License, or
233
+ * (at your option) any later version.
234
+ *
235
+ * The Alfresco Example Content Application is distributed in the hope that it will be useful,
236
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
237
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
238
+ * GNU Lesser General Public License for more details.
239
+ *
240
+ * You should have received a copy of the GNU Lesser General Public License
241
+ * from Hyland Software. If not, see <http://www.gnu.org/licenses/>.
242
+ */
243
+ /* cspell:disable */
244
+ const supportedExtensions = {
245
+ doc: 'ms-word',
246
+ docx: 'ms-word',
247
+ docm: 'ms-word',
248
+ dot: 'ms-word',
249
+ dotx: 'ms-word',
250
+ dotm: 'ms-word',
251
+ rtf: 'ms-word',
252
+ xls: 'ms-excel',
253
+ xlsx: 'ms-excel',
254
+ xlsb: 'ms-excel',
255
+ xlsm: 'ms-excel',
256
+ xlt: 'ms-excel',
257
+ xltx: 'ms-excel',
258
+ xltm: 'ms-excel',
259
+ xlam: 'ms-excel',
260
+ ppt: 'ms-powerpoint',
261
+ pptx: 'ms-powerpoint',
262
+ pot: 'ms-powerpoint',
263
+ potx: 'ms-powerpoint',
264
+ potm: 'ms-powerpoint',
265
+ pptm: 'ms-powerpoint',
266
+ pps: 'ms-powerpoint',
267
+ ppsx: 'ms-powerpoint',
268
+ ppam: 'ms-powerpoint',
269
+ ppsm: 'ms-powerpoint',
270
+ sldx: 'ms-powerpoint',
271
+ sldm: 'ms-powerpoint',
272
+ vsd: 'ms-visio',
273
+ vss: 'ms-visio',
274
+ vst: 'ms-visio',
275
+ vsdx: 'ms-visio',
276
+ vsdm: 'ms-visio',
277
+ vssx: 'ms-visio',
278
+ vssm: 'ms-visio',
279
+ vstx: 'ms-visio',
280
+ vstm: 'ms-visio'
281
+ };
282
+ /* cspell:enable */
283
+ function getFileExtension(fileName) {
284
+ if (fileName) {
285
+ const match = fileName.match(/\.([^\./\?\#]+)($|\?|\#)/);
286
+ return match ? match[1] : null;
287
+ }
288
+ return null;
289
+ }
290
+ /**
291
+ * Checks if the content plugin is enabled.
292
+ * JSON ref: `app.isContentServiceEnabled`
293
+ */
294
+ const isContentServiceEnabled = () => localStorage && localStorage.getItem('contentService') !== 'false';
295
+ /**
296
+ * Checks if Search is supported for active view
297
+ * JSON ref: `app.isSearchSupported`
298
+ */
299
+ const isSearchSupported = (context) => [isNotSearchResults(context) /* , !hasSelection(context)*/].every(Boolean);
300
+ /**
301
+ * Checks if upload action is supported for the given context
302
+ * JSON ref: `app.isUploadSupported`
303
+ *
304
+ * @param content Rule execution context
305
+ */
306
+ const isUploadSupported = (context) => [isContentServiceEnabled(), isPersonalFiles(context) || isLibraryContent(context), canUpload(context)].every(Boolean);
307
+ /**
308
+ * Checks if user can copy selected node.
309
+ * JSON ref: `app.canCopyNode`
310
+ *
311
+ * @param context Rule execution context
312
+ */
313
+ const canCopyNode = (context) => [hasSelection(context), isNotTrashcan(context), isNotLibraries(context)].every(Boolean);
314
+ /**
315
+ * Checks if user can mark selected nodes as **Favorite**.
316
+ * JSON ref: `app.selection.canAddFavorite`
317
+ */
318
+ function canAddFavorite(context) {
319
+ if (!context.selection.isEmpty) {
320
+ if (isFavorites(context) || isLibraries(context) || isTrashcan(context)) {
321
+ return false;
322
+ }
323
+ return context.selection.nodes.some((node) => !node.entry.isFavorite);
324
+ }
325
+ return false;
326
+ }
327
+ /**
328
+ * Checks if user can un-mark selected nodes as **Favorite**.
329
+ * JSON ref: `app.selection.canRemoveFavorite`
330
+ */
331
+ function canRemoveFavorite(context) {
332
+ if (!context.selection.isEmpty && !isTrashcan(context)) {
333
+ if (isFavorites(context)) {
334
+ return true;
335
+ }
336
+ return context.selection.nodes.every((node) => node.entry.isFavorite);
337
+ }
338
+ return false;
339
+ }
340
+ /**
341
+ * Checks if user can share selected file.
342
+ * JSON ref: `app.selection.file.canShare`
343
+ */
344
+ const canShareFile = (context) => [context.selection.file, isNotTrashcan(context), hasQuickShareEnabled(context), !isShared(context)].every(Boolean);
345
+ /**
346
+ * Checks if user can perform "Join" or "Cancel Join Request" on a library.
347
+ * JSON ref: `canToggleJoinLibrary`
348
+ */
349
+ const canToggleJoinLibrary = (context) => [hasLibrarySelected(context), !isPrivateLibrary(context), hasNoLibraryRole(context)].every(Boolean) ||
350
+ [hasLibrarySelected(context), isPrivateLibrary(context), hasNoLibraryRole(context), isAdmin(context)].every(Boolean);
351
+ /**
352
+ * Checks if user can edit the selected folder.
353
+ * JSON ref: `canEditFolder`
354
+ *
355
+ * @param context Rule execution context
356
+ */
357
+ const canEditFolder = (context) => [canUpdateSelectedFolder(context), isNotTrashcan(context)].every(Boolean);
358
+ /**
359
+ * Checks if the selected file is already shared.
360
+ * JSON ref: `app.selection.file.isShared`
361
+ */
362
+ function isShared(context) {
363
+ if (isSharedFiles(context) && context.selection.file) {
364
+ return true;
365
+ }
366
+ if (isNotTrashcan(context) && !context.selection.isEmpty && context.selection.file) {
367
+ return !!(context.selection.file.entry && context.selection.file.entry.properties && context.selection.file.entry.properties['qshare:sharedId']);
368
+ }
369
+ return false;
370
+ }
371
+ /**
372
+ * Checks if user can delete selected nodes.
373
+ * JSON ref: `app.selection.canDelete`
374
+ */
375
+ function canDeleteSelection(context) {
376
+ if (isNotTrashcan(context) &&
377
+ isNotLibraries(context) &&
378
+ isNotSearchResults(context) &&
379
+ !context.selection.isEmpty) {
380
+ if (hasLockedFiles(context)) {
381
+ return false;
382
+ }
383
+ // temp workaround for Favorites api
384
+ if (isFavorites(context)) {
385
+ return true;
386
+ }
387
+ if (isPreview(context)) {
388
+ return context.permissions.check(context.selection.nodes, ['delete']);
389
+ }
390
+ // workaround for Shared Files
391
+ if (isSharedFiles(context)) {
392
+ return context.permissions.check(context.selection.nodes, ['delete'], {
393
+ target: 'allowableOperationsOnTarget'
394
+ });
395
+ }
396
+ return context.permissions.check(context.selection.nodes, ['delete']);
397
+ }
398
+ return false;
399
+ }
400
+ /**
401
+ * Checks if user can un-share selected nodes.
402
+ * JSON ref: `app.selection.canUnshare`
403
+ */
404
+ function canUnshareNodes(context) {
405
+ if (!context.selection.isEmpty) {
406
+ return context.permissions.check(context.selection.nodes, ['delete'], {
407
+ target: 'allowableOperationsOnTarget'
408
+ });
409
+ }
410
+ return false;
411
+ }
412
+ /**
413
+ * Checks if user selected anything.
414
+ * JSON ref: `app.selection.notEmpty`
415
+ */
416
+ const hasSelection = (context) => !context.selection.isEmpty;
417
+ /**
418
+ * Checks if user can create a new folder with current path.
419
+ * JSON ref: `app.navigation.folder.canCreate`
420
+ */
421
+ function canCreateFolder(context) {
422
+ if (isContentServiceEnabled() && (isPersonalFiles(context) || isLibraryContent(context))) {
423
+ const { currentFolder } = context.navigation;
424
+ if (currentFolder) {
425
+ return context.permissions.check(currentFolder, ['create']);
426
+ }
427
+ }
428
+ return false;
429
+ }
430
+ /**
431
+ * Checks if user can create a Library
432
+ * JSON ref: `app.canCreateLibrary`
433
+ *
434
+ * @param context Rule execution context
435
+ */
436
+ const canCreateLibrary = (context) => [isContentServiceEnabled(), isLibraries(context)].every(Boolean);
437
+ /**
438
+ * Checks if user can upload content to current folder.
439
+ * JSON ref: `app.navigation.folder.canUpload`
440
+ */
441
+ function canUpload(context) {
442
+ if (isContentServiceEnabled() && (isPersonalFiles(context) || isLibraryContent(context))) {
443
+ const { currentFolder } = context.navigation;
444
+ if (currentFolder) {
445
+ return context.permissions.check(currentFolder, ['create']);
446
+ }
447
+ }
448
+ return false;
449
+ }
450
+ /**
451
+ * Checks if user can download selected nodes (either files or folders).
452
+ * JSON ref: `app.selection.canDownload`
453
+ */
454
+ function canDownloadSelection(context) {
455
+ if (!context.selection.isEmpty && isNotTrashcan(context)) {
456
+ return context.selection.nodes.every((node) => node.entry && (node.entry.isFile || node.entry.isFolder || !!node.entry.nodeId));
457
+ }
458
+ return false;
459
+ }
460
+ /**
461
+ * Checks if user has selected a folder.
462
+ * JSON ref: `app.selection.folder`
463
+ */
464
+ const hasFolderSelected = (context) => !!context.selection.folder;
465
+ /**
466
+ * Checks if user has selected a library (site).
467
+ * JSON ref: `app.selection.library`
468
+ */
469
+ const hasLibrarySelected = (context) => !!context.selection.library;
470
+ /**
471
+ * Checks if user has selected a **private** library (site)
472
+ * JSON ref: `app.selection.isPrivateLibrary`
473
+ */
474
+ function isPrivateLibrary(context) {
475
+ const library = context.selection.library;
476
+ return library ? !!(library.entry && library.entry.visibility && library.entry.visibility === 'PRIVATE') : false;
477
+ }
478
+ /**
479
+ * Checks if the selected library has a **role** property defined.
480
+ * JSON ref: `app.selection.hasLibraryRole`
481
+ */
482
+ function hasLibraryRole(context) {
483
+ const library = context.selection.library;
484
+ return library ? !!(library.entry && library.entry.role) : false;
485
+ }
486
+ /**
487
+ * Checks if the selected library has no **role** property defined.
488
+ * JSON ref: `app.selection.hasNoLibraryRole`
489
+ */
490
+ const hasNoLibraryRole = (context) => !hasLibraryRole(context);
491
+ /**
492
+ * Checks if user has selected a file.
493
+ * JSON ref: `app.selection.file`
494
+ */
495
+ const hasFileSelected = (context) => !!(context && context.selection && context.selection.file);
496
+ /**
497
+ * Checks if user can update the first selected node.
498
+ * JSON ref: `app.selection.first.canUpdate`
499
+ */
500
+ function canUpdateSelectedNode(context) {
501
+ if (context.selection && !context.selection.isEmpty) {
502
+ const node = context.selection.first;
503
+ if ((node === null || node === void 0 ? void 0 : node.entry.isFile) && hasLockedFiles(context)) {
504
+ return false;
505
+ }
506
+ return context.permissions.check(node, ['update']);
507
+ }
508
+ return false;
509
+ }
510
+ function isMultiselection(context) {
511
+ let isMultiNodeSelected = false;
512
+ if (context.selection && !context.selection.isEmpty) {
513
+ isMultiNodeSelected = context.selection.count > 1;
514
+ }
515
+ return isMultiNodeSelected;
516
+ }
517
+ /**
518
+ * Checks if user can update the first selected folder.
519
+ * JSON ref: `app.selection.folder.canUpdate`
520
+ */
521
+ function canUpdateSelectedFolder(context) {
522
+ const { folder } = context.selection;
523
+ if (folder) {
524
+ return (
525
+ // workaround for Favorites Api
526
+ isFavorites(context) || context.permissions.check(folder.entry, ['update']));
527
+ }
528
+ return false;
529
+ }
530
+ /**
531
+ * Checks if user has selected a **locked** file node.
532
+ * JSON ref: `app.selection.file.isLocked`
533
+ */
534
+ function hasLockedFiles(context) {
535
+ if (context && context.selection && context.selection.nodes) {
536
+ return context.selection.nodes.some((node) => {
537
+ if (!node.entry.isFile) {
538
+ return false;
539
+ }
540
+ return node.entry.isLocked || (node.entry.properties && node.entry.properties['cm:lockType'] === 'READ_ONLY_LOCK');
541
+ });
542
+ }
543
+ return false;
544
+ }
545
+ /**
546
+ * Checks if the selected file has **write** or **read-only** locks specified.
547
+ * JSON ref: `app.selection.file.isLocked`
548
+ */
549
+ const isWriteLocked = (context) => !!(context &&
550
+ context.selection &&
551
+ context.selection.file &&
552
+ context.selection.file.entry &&
553
+ context.selection.file.entry.properties &&
554
+ (context.selection.file.entry.properties['cm:lockType'] === 'WRITE_LOCK' ||
555
+ context.selection.file.entry.properties['cm:lockType'] === 'READ_ONLY_LOCK'));
556
+ /**
557
+ * Checks if the selected file has **write** or **read-only** locks specified,
558
+ * and that current user is the owner of the lock.
559
+ * JSON ref: `app.selection.file.isLockOwner`
560
+ */
561
+ const isUserWriteLockOwner = (context) => {
562
+ var _a, _b;
563
+ return isWriteLocked(context) &&
564
+ ((_a = context.selection.file) === null || _a === void 0 ? void 0 : _a.entry.properties['cm:lockOwner']) &&
565
+ ((_b = context.selection.file) === null || _b === void 0 ? void 0 : _b.entry.properties['cm:lockOwner'].id) === context.profile.id;
566
+ };
567
+ /**
568
+ * Checks if user can lock selected file.
569
+ * JSON ref: `app.selection.file.canLock`
570
+ */
571
+ const canLockFile = (context) => !isWriteLocked(context) && canUpdateSelectedNode(context);
572
+ /**
573
+ * Checks if user can unlock selected file.
574
+ * JSON ref: `app.selection.file.canUnlock`
575
+ */
576
+ function canUnlockFile(context) {
577
+ const { file } = context.selection;
578
+ return isWriteLocked(context) && (context.permissions.check(file === null || file === void 0 ? void 0 : file.entry, ['delete']) || isUserWriteLockOwner(context));
579
+ }
580
+ /**
581
+ * Checks if user can upload a new version of the file.
582
+ * JSON ref: `app.selection.file.canUploadVersion`
583
+ */
584
+ function canUploadVersion(context) {
585
+ if (isFavorites(context) || isSharedFiles(context)) {
586
+ return hasFileSelected(context);
587
+ }
588
+ return [
589
+ hasFileSelected(context),
590
+ isNotTrashcan(context),
591
+ isWriteLocked(context) ? isUserWriteLockOwner(context) : canUpdateSelectedNode(context)
592
+ ].every(Boolean);
593
+ }
594
+ /**
595
+ * Checks if user has trashcan item selected.
596
+ * JSON ref: `isTrashcanItemSelected`
597
+ *
598
+ * @param context Rule execution context
599
+ */
600
+ const isTrashcanItemSelected = (context) => [isTrashcan(context), hasSelection(context)].every(Boolean);
601
+ /**
602
+ * Checks if user can view the file.
603
+ * JSON ref: `canViewFile`
604
+ *
605
+ * @param context Rule execution context
606
+ */
607
+ const canViewFile = (context) => [hasFileSelected(context), isNotTrashcan(context)].every(Boolean);
608
+ /**
609
+ * Checks if user can **Leave** selected library.
610
+ * JSON ref: `canLeaveLibrary`
611
+ *
612
+ * @param context Rule execution context
613
+ */
614
+ const canLeaveLibrary = (context) => [hasLibrarySelected(context), hasLibraryRole(context)].every(Boolean);
615
+ /**
616
+ * Checks if user can toggle shared link mode.
617
+ * JSON ref: `canToggleSharedLink`
618
+ *
619
+ * @param context Rule execution context
620
+ */
621
+ const canToggleSharedLink = (context) => [hasFileSelected(context), [canShareFile(context), isShared(context)].some(Boolean)].every(Boolean);
622
+ /**
623
+ * Checks if user can show **Info Drawer** for the selected node.
624
+ * JSON ref: `canShowInfoDrawer`
625
+ *
626
+ * @param context Rule execution context
627
+ */
628
+ const canShowInfoDrawer = (context) => [hasSelection(context), isNotLibraries(context), isNotTrashcan(context)].every(Boolean);
629
+ /**
630
+ * Checks if user can manage file versions for the selected node.
631
+ * JSON ref: `canManageFileVersions`
632
+ *
633
+ * @param context Rule execution context
634
+ */
635
+ const canManageFileVersions = (context) => [hasFileSelected(context), isNotTrashcan(context), !hasLockedFiles(context)].every(Boolean);
636
+ /**
637
+ * Checks if user can edit aspects for the selected node.
638
+ * JSON ref: `canEditAspects`
639
+ *
640
+ * @param context Rule execution context
641
+ */
642
+ const canEditAspects = (context) => [
643
+ !isMultiselection(context),
644
+ canUpdateSelectedNode(context),
645
+ !isWriteLocked(context),
646
+ isNotTrashcan(context),
647
+ isMajorVersionAvailable(context, '7')
648
+ ].every(Boolean);
649
+ /**
650
+ * Checks if user can manage permissions for the selected node.
651
+ * JSON ref: `canManagePermissions`
652
+ *
653
+ * @param context Rule execution context
654
+ */
655
+ const canManagePermissions = (context) => [canUpdateSelectedNode(context), isNotTrashcan(context)].every(Boolean);
656
+ /**
657
+ * Checks if user can toggle **Edit Offline** mode for selected node.
658
+ * JSON ref: `canToggleEditOffline`
659
+ *
660
+ * @param context Rule execution context
661
+ */
662
+ const canToggleEditOffline = (context) => [hasFileSelected(context), isNotTrashcan(context), canLockFile(context) || canUnlockFile(context)].every(Boolean);
663
+ /**
664
+ * @deprecated Uses workarounds for for recent files and search api issues.
665
+ * Checks if user can toggle **Favorite** state for a node.
666
+ * @param context Rule execution context
667
+ */
668
+ const canToggleFavorite = (context) => [
669
+ [canAddFavorite(context), canRemoveFavorite(context)].some(Boolean),
670
+ [isRecentFiles(context), isSharedFiles(context), isSearchResults(context), isFavorites(context)].some(Boolean)
671
+ ].every(Boolean);
672
+ /**
673
+ * Checks if application should render logout option.
674
+ * JSON ref: `canShowLogout`
675
+ *
676
+ * @param context Rule execution context
677
+ */
678
+ const canShowLogout = (context) => !context.withCredentials;
679
+ /**
680
+ * Checks if user is library manager
681
+ * JSON ref: `isLibraryManager`
682
+ *
683
+ * @param context Rule execution context
684
+ */
685
+ const isLibraryManager = (context) => { var _a; return hasLibrarySelected(context) && ((_a = context.selection.library) === null || _a === void 0 ? void 0 : _a.entry.role) === 'SiteManager'; };
686
+ /**
687
+ * Checks if the preview button for search results can be showed
688
+ * JSON ref: `canInfoPreview`
689
+ *
690
+ * @param context Rule execution context
691
+ */
692
+ const canInfoPreview = (context) => {
693
+ const isSearchResult = isSearchResults(context);
694
+ const isNotMultiselect = !isMultiselection(context);
695
+ const isFileSelected = !hasFolderSelected(context);
696
+ const isPreview$1 = !isPreview(context);
697
+ return isSearchResult && isNotMultiselect && isFileSelected && isPreview$1;
698
+ };
699
+ const showInfoSelectionButton = (context) => isSearchResults(context) && !isPreview(context);
700
+ /**
701
+ * Checks if the file can be opened with MS Office
702
+ * JSON ref: `aos.canOpenWithOffice`
703
+ *
704
+ * @param context Rule execution context
705
+ */
706
+ function canOpenWithOffice(context) {
707
+ if (context.navigation && context.navigation.url && context.navigation.url.startsWith('/trashcan')) {
708
+ return false;
709
+ }
710
+ if (!context || !context.selection) {
711
+ return false;
712
+ }
713
+ const { file } = context.selection;
714
+ if (!file || !file.entry) {
715
+ return false;
716
+ }
717
+ const extension = getFileExtension(file.entry.name);
718
+ if (!extension || !supportedExtensions[extension]) {
719
+ return false;
720
+ }
721
+ if (!file.entry.properties) {
722
+ return false;
723
+ }
724
+ if (file.entry.isLocked) {
725
+ return false;
726
+ }
727
+ if (file.entry.properties['cm:lockType'] === 'WRITE_LOCK' || file.entry.properties['cm:lockType'] === 'READ_ONLY_LOCK') {
728
+ return false;
729
+ }
730
+ const lockOwner = file.entry.properties['cm:lockOwner'];
731
+ if (lockOwner && lockOwner.id !== context.profile.id) {
732
+ return false;
733
+ }
734
+ // workaround for Shared files
735
+ if (context.navigation && context.navigation.url && context.navigation.url.startsWith('/shared')) {
736
+ // eslint-disable-next-line no-prototype-builtins
737
+ if (file.entry.hasOwnProperty('allowableOperationsOnTarget')) {
738
+ return context.permissions.check(file, ['update'], {
739
+ target: 'allowableOperationsOnTarget'
740
+ });
741
+ }
742
+ }
743
+ return context.permissions.check(file, ['update']);
744
+ }
745
+
746
+ /*!
747
+ * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved.
748
+ *
749
+ * Alfresco Example Content Application
750
+ *
751
+ * This file is part of the Alfresco Example Content Application.
752
+ * If the software was purchased under a paid Alfresco license, the terms of
753
+ * the paid license agreement will prevail. Otherwise, the software is
754
+ * provided under the following open source license terms:
755
+ *
756
+ * The Alfresco Example Content Application is free software: you can redistribute it and/or modify
757
+ * it under the terms of the GNU Lesser General Public License as published by
758
+ * the Free Software Foundation, either version 3 of the License, or
759
+ * (at your option) any later version.
760
+ *
761
+ * The Alfresco Example Content Application is distributed in the hope that it will be useful,
762
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
763
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
764
+ * GNU Lesser General Public License for more details.
765
+ *
766
+ * You should have received a copy of the GNU Lesser General Public License
767
+ * from Hyland Software. If not, see <http://www.gnu.org/licenses/>.
768
+ */
769
+
770
+ /**
771
+ * Generated bundle index. Do not edit.
772
+ */
773
+
774
+ export { canAddFavorite, canCopyNode, canCreateFolder, canCreateLibrary, canDeleteSelection, canDownloadSelection, canEditAspects, canEditFolder, canInfoPreview, canLeaveLibrary, canLockFile, canManageFileVersions, canManagePermissions, canOpenWithOffice, canRemoveFavorite, canShareFile, canShowInfoDrawer, canShowLogout, canToggleEditOffline, canToggleFavorite, canToggleJoinLibrary, canToggleSharedLink, canUnlockFile, canUnshareNodes, canUpdateSelectedFolder, canUpdateSelectedNode, canUpload, canUploadVersion, canViewFile, getFileExtension, hasFileSelected, hasFolderSelected, hasLibraryRole, hasLibrarySelected, hasLockedFiles, hasNoLibraryRole, hasQuickShareEnabled, hasSelection, isAdmin, isContentServiceEnabled, isFavorites, isFavoritesPreview, isLibraries, isLibraryContent, isLibraryFiles, isLibraryManager, isMajorVersionAvailable, isMultiselection, isNotFavorites, isNotLibraries, isNotRecentFiles, isNotSearchResults, isNotSharedFiles, isNotTrashcan, isPersonalFiles, isPreview, isPrivateLibrary, isRecentFiles, isSearchResults, isSearchSupported, isShared, isSharedFileViewer, isSharedFiles, isSharedPreview, isTrashcan, isTrashcanItemSelected, isUploadSupported, isUserWriteLockOwner, isWriteLocked, showInfoSelectionButton, supportedExtensions };
775
+ //# sourceMappingURL=alfresco-aca-shared-rules.mjs.map