@zohodesk/library-platform 1.1.13 → 1.2.0-exp.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 (165) hide show
  1. package/es/bc/column-chooser/EventHandlers.js +1 -2
  2. package/es/bc/sdk/ResourceNamesEnum.js +1 -0
  3. package/es/bc/zform/Properties.js +20 -0
  4. package/es/bc/zform/Symbol.js +3 -0
  5. package/es/bc/zrecord/Constants.js +2 -0
  6. package/es/cc/action-band/Properties.js +37 -0
  7. package/es/cc/action-band/constants/ExternalConstants.js +3 -1
  8. package/es/cc/component/Dispatch.js +1 -0
  9. package/es/cc/component/LifeCycleEventsEnum.js +1 -0
  10. package/es/cc/component/index.js +3 -0
  11. package/es/cc/fields/currency/Properties.js +9 -0
  12. package/es/cc/fields/decimal/Properties.js +9 -0
  13. package/es/cc/fields/email/Properties.js +9 -0
  14. package/es/cc/fields/lookup/Properties.js +10 -26
  15. package/es/cc/fields/multi-line/Properties.js +1 -0
  16. package/es/cc/fields/number/Properties.js +10 -1
  17. package/es/cc/fields/phone/Properties.js +9 -0
  18. package/es/cc/fields/text/Properties.js +2 -2
  19. package/es/cc/fields/url/Properties.js +9 -0
  20. package/es/cc/one-unification/Constants.js +24 -0
  21. package/es/cc/one-unification/unified-navigation/ActionTypes.js +1 -0
  22. package/es/cc/one-unification/unified-navigation/CommonTypes.js +1 -0
  23. package/es/cc/one-unification/unified-navigation/ConfigTypes.js +1 -0
  24. package/es/cc/one-unification/unified-navigation/HandlerTypes.js +1 -0
  25. package/es/cc/one-unification/unified-navigation/Types.js +1 -0
  26. package/es/cc/one-unification/unified-navigation/UnifiedNavigation.d.js +0 -0
  27. package/es/cc/one-unification/unified-navigation/index.js +1 -0
  28. package/es/cc/smart-navigation/Constants.js +8 -0
  29. package/es/cc/smart-navigation/Events.js +107 -0
  30. package/es/cc/smart-navigation/Properties.js +87 -0
  31. package/es/cc/smart-navigation/index.js +4 -0
  32. package/es/cc/table-column-chooser/Constants.js +2 -1
  33. package/es/cc/table-connected/SdkContract.js +22 -0
  34. package/es/cc/text/Properties.js +100 -0
  35. package/es/cc/textbox/Properties.js +1 -1
  36. package/es/index.js +8 -3
  37. package/es/library/behaviours/clip-wrap/applications/usecases/ClipWrapUpdateUseCase.js +19 -0
  38. package/es/library/behaviours/library-loader/adapters/controllers/LibraryLoaderController.js +17 -0
  39. package/es/library/behaviours/library-loader/adapters/gateways/LibraryLoaderAdapter.js +29 -0
  40. package/es/library/behaviours/library-loader/applications/usecases/LoadLibraryUseCase.js +42 -0
  41. package/es/library/behaviours/library-loader/domain/entities/interfaces/ILibraryLoader.js +1 -0
  42. package/es/library/behaviours/library-loader/frameworks/LibraryLoaderBehaviour.js +26 -0
  43. package/es/library/behaviours/search/adapters/controllers/UpdatePropertiesController.js +9 -4
  44. package/es/library/custom-component/adapters/gateways/event-manager/EventManager.js +4 -3
  45. package/es/library/custom-component/applications/usecases/DispatchUseCase.js +1 -0
  46. package/es/library/custom-component/applications/usecases/InitializeUseCase.js +1 -0
  47. package/es/library/custom-component/applications/usecases/MountUseCase.js +1 -0
  48. package/es/library/custom-component/applications/usecases/SetRefUseCase.js +7 -0
  49. package/es/library/custom-component/applications/usecases/UnmountUseCase.js +1 -0
  50. package/es/library/custom-component/applications/usecases/UpdatePropertyUseCase.js +1 -0
  51. package/es/library/custom-component/domain/entities/Component.js +1 -0
  52. package/es/library/custom-component/domain/entities/Logger.js +4 -9
  53. package/es/library/dot/components/form-fields/currency/frameworks/ui/CurrencyView.js +2 -0
  54. package/es/library/dot/components/form-fields/decimal/frameworks/ui/DecimalView.js +2 -0
  55. package/es/library/dot/components/form-fields/email/frameworks/ui/Email.js +1 -1
  56. package/es/library/dot/components/form-fields/email/frameworks/ui/EmailView.js +2 -0
  57. package/es/library/dot/components/form-fields/number/frameworks/ui/NumberView.js +2 -0
  58. package/es/library/dot/components/form-fields/phone/frameworks/ui/PhoneView.js +2 -0
  59. package/es/library/dot/components/form-fields/textarea/frameworks/ui/TextArea.js +1 -1
  60. package/es/library/dot/components/form-fields/textarea/frameworks/ui/TextAreaView.js +4 -2
  61. package/es/library/dot/components/form-fields/textbox/frameworks/ui/TextBoxView.js +2 -0
  62. package/es/library/dot/components/form-fields/url/frameworks/ui/UrlView.js +2 -0
  63. package/es/library/dot/components/table-list/frameworks/ui/sub-components/header/HeaderData.js +1 -1
  64. package/es/library/dot/legacy-to-new-arch/table-field-components/text-field/frameworks/ui/TextFieldView.js +20 -0
  65. package/es/library/dot/legacy-to-new-arch/text/frameworks/ui/Text.js +2 -2
  66. package/es/library/dot/legacy-to-new-arch/text/frameworks/ui/TextView.js +22 -1
  67. package/es/platform/app-context-behaviour/adapters/controllers/AbstractController.js +9 -0
  68. package/es/platform/app-context-behaviour/adapters/controllers/UpdatePropertiesController.js +32 -0
  69. package/es/platform/app-context-behaviour/adapters/gateway/Repository.js +22 -0
  70. package/es/platform/app-context-behaviour/adapters/gateway/Service.js +10 -0
  71. package/es/platform/app-context-behaviour/adapters/presenter/Presenter.js +16 -0
  72. package/es/platform/app-context-behaviour/applications/interfaces/UseCaseDependencies.js +1 -0
  73. package/es/platform/app-context-behaviour/applications/interfaces/gateways/IRepository.js +1 -0
  74. package/es/platform/app-context-behaviour/applications/interfaces/gateways/IService.js +1 -0
  75. package/es/platform/app-context-behaviour/applications/interfaces/input/UpdatePropertiesInputModel.js +1 -0
  76. package/es/platform/app-context-behaviour/applications/interfaces/output/BehaviourOutputModel.js +1 -0
  77. package/es/platform/app-context-behaviour/applications/interfaces/output/IPresenter.js +1 -0
  78. package/es/platform/app-context-behaviour/applications/usecases/AbstractUseCase.js +17 -0
  79. package/es/platform/app-context-behaviour/applications/usecases/UpdatePropertiesUsecase.js +25 -0
  80. package/es/platform/app-context-behaviour/domain/entities/AppContext.js +44 -0
  81. package/es/platform/app-context-behaviour/domain/entities/interfaces/IAppContext.js +1 -0
  82. package/es/platform/app-context-behaviour/frameworks/AppContextBehaviourFactory.js +2 -2
  83. package/es/platform/app-context-behaviour/frameworks/EventHandlerFactory.js +22 -0
  84. package/es/platform/client-actions/behaviour/zclient-actions/adapters/presenters/FilterUtils.js +11 -0
  85. package/es/platform/client-actions/behaviour/zclient-actions/adapters/resources/ClientActionsFetchSDK.js +76 -0
  86. package/es/platform/client-actions/behaviour/zclient-actions/applications/interfaces/ClientActionsAPIGatewayParams.js +1 -0
  87. package/es/platform/client-actions/behaviour/zclient-actions/applications/interfaces/ClientActionsFetchSDKParams.js +10 -0
  88. package/es/platform/client-actions/behaviour/zclient-actions/applications/interfaces/IClientActionsFetchSDK.js +0 -0
  89. package/es/platform/client-scripts/behaviour/zclient-scripts-fetch/adapters/resources/ClientScriptsFetchSDK.js +43 -0
  90. package/es/platform/client-scripts/behaviour/zclient-scripts-fetch/applications/interfaces/ClientScriptsAPIGatewayParams.js +1 -0
  91. package/es/platform/client-scripts/behaviour/zclient-scripts-fetch/applications/interfaces/ClientScriptsSDKFetchParams.js +1 -0
  92. package/es/platform/client-scripts/behaviour/zclient-scripts-fetch/applications/interfaces/IClientScriptsFetchSDK.js +0 -0
  93. package/es/platform/column-chooser/adapters/controllers/ColumnChooserOpenController.js +14 -6
  94. package/es/platform/column-chooser/adapters/controllers/ColumnChooserUpdateController.js +22 -0
  95. package/es/platform/column-chooser/adapters/gateways/Repository.js +12 -1
  96. package/es/platform/column-chooser/adapters/gateways/Service.js +2 -0
  97. package/es/platform/column-chooser/applications/interfaces/input/ColumnChooserUpdateInput.js +1 -0
  98. package/es/platform/column-chooser/applications/usecases/ColumnChooserSaveUseCase.js +8 -1
  99. package/es/platform/column-chooser/applications/usecases/ColumnChooserUpdateUseCase.js +35 -0
  100. package/es/platform/column-chooser/domain/entities/ColumnChooserImp.js +6 -0
  101. package/es/platform/column-chooser/frameworks/EventHandlersFactory.js +6 -4
  102. package/es/platform/components/index.js +1 -0
  103. package/es/platform/components/smart-action-band/adapters/presenters/ActionBandTranslator.js +70 -8
  104. package/es/platform/components/smart-action-band/adapters/presenters/utils/DefaultClientActions.js +32 -0
  105. package/es/platform/components/smart-action-band/frameworks/EventHandlersFactory.js +42 -1
  106. package/es/platform/components/smart-action-band/frameworks/SmartActionBandFactory.js +4 -1
  107. package/es/platform/components/smart-navigation/adapters/controllers/LoadScriptController.js +0 -0
  108. package/es/platform/components/smart-navigation/adapters/controllers/UiModelInitializeController.js +0 -0
  109. package/es/platform/components/smart-navigation/adapters/presenters/OneUnifiedNavigationTranslator.js +248 -0
  110. package/es/platform/components/smart-navigation/adapters/presenters/Present.js +77 -0
  111. package/es/platform/components/smart-navigation/adapters/presenters/SampleModel.js +356 -0
  112. package/es/platform/components/smart-navigation/adapters/resources/SmartNavigationResource.js +96 -0
  113. package/es/platform/components/smart-navigation/applications/usecases/NavigateModuleUseCase.js +0 -0
  114. package/es/platform/components/smart-navigation/frameworks/CustomElementRenderer.js +22 -0
  115. package/es/platform/components/smart-navigation/frameworks/SmartNavigation.js +12 -0
  116. package/es/platform/components/smart-navigation/frameworks/one-unification/OneUnificationEventHandlers.js +156 -0
  117. package/es/platform/components/smart-navigation/frameworks/one-unification/SmartNavigation.js +83 -0
  118. package/es/platform/components/smart-navigation/frameworks/one-unification/SmartNavigation.module.css +3 -0
  119. package/es/platform/components/smart-navigation/frameworks/one-unification/SmartNavigationEventHandlers.js +173 -0
  120. package/es/platform/components/smart-navigation/frameworks/one-unification/UnifiedNavigation.js +48 -0
  121. package/es/platform/components/smart-navigation/frameworks/one-unification/UnifiedNavigationActions.js +144 -0
  122. package/es/platform/components/table-connected/adapters/resources/SmartTableResource.js +52 -0
  123. package/es/platform/components/table-connected/frameworks/EventHandlersFactory.js +1 -7
  124. package/es/platform/components/table-connected/frameworks/ListSdkFactory.js +4 -2
  125. package/es/platform/data-source/http-template/fetchLookupFields.js +0 -6
  126. package/es/platform/data-source/http-template/getPageClientActions.js +23 -0
  127. package/es/platform/data-source/http-template/getSingleRecord.js +51 -0
  128. package/es/platform/data-source/index.js +2 -0
  129. package/es/platform/data-source/utils/validation-rules/FieldConditions.js +1 -1
  130. package/es/platform/sdk-behaviour/adapters/controllers/InitializeController.js +7 -2
  131. package/es/platform/sdk-behaviour/applications/usecases/CreateResourceInstanceUseCase.js +10 -1
  132. package/es/platform/zform/adapters/controllers/GetInitialRecordSuccessController.js +31 -0
  133. package/es/platform/zform/adapters/gateway/FormRepository.js +10 -2
  134. package/es/platform/zform/adapters/gateway/Service.js +2 -0
  135. package/es/platform/zform/adapters/presenter/FormTranslator.js +27 -15
  136. package/es/platform/zform/adapters/presenter/translators/SectionTranslator.js +1 -1
  137. package/es/platform/zform/adapters/presenter/translators/fields/CurrencyFieldTranslator.js +1 -0
  138. package/es/platform/zform/adapters/presenter/translators/fields/DecimalFieldTranslator.js +1 -0
  139. package/es/platform/zform/adapters/presenter/translators/fields/EmailFieldTranslator.js +1 -0
  140. package/es/platform/zform/adapters/presenter/translators/fields/LookUpFieldTranslator.js +11 -7
  141. package/es/platform/zform/adapters/presenter/translators/fields/NumberFieldTranslator.js +1 -0
  142. package/es/platform/zform/adapters/presenter/translators/fields/PhoneFieldTranslator.js +1 -0
  143. package/es/platform/zform/adapters/presenter/translators/fields/TextAreaFieldTranslator.js +1 -0
  144. package/es/platform/zform/adapters/presenter/translators/fields/TextFieldTranslator.js +1 -0
  145. package/es/platform/zform/adapters/presenter/translators/fields/URLFieldTranslator.js +1 -0
  146. package/es/platform/zform/adapters/presenter/utils/sanitizeHtmlString.js +2 -2
  147. package/es/platform/zform/applications/interfaces/input/GetInitialRecordSuccessUseCaseInputModel.js +1 -0
  148. package/es/platform/zform/applications/usecases/GetInitialRecordSuccessUseCase.js +132 -0
  149. package/es/platform/zform/applications/usecases/InitializeUseCase.js +54 -30
  150. package/es/platform/zform/applications/usecases/LookupFieldSuccessUseCase.js +5 -0
  151. package/es/platform/zform/applications/usecases/MyFormSuccessUseCase.js +12 -11
  152. package/es/platform/zform/applications/usecases/SubmitValidationCompletedUseCase.js +21 -8
  153. package/es/platform/zform/domain/ZField.js +7 -5
  154. package/es/platform/zform/domain/ZForm.js +97 -20
  155. package/es/platform/zform/frameworks/ui/EventHandlerFactory.js +23 -5
  156. package/es/platform/zform/frameworks/ui/ZFormBehaviourFactory.js +2 -0
  157. package/es/platform/zlist/adapters/presenters/TableTranslator.js +5 -4
  158. package/es/platform/zrecord/adapters/controllers/UpdateRecordController.js +30 -0
  159. package/es/platform/zrecord/adapters/gateways/Service.js +2 -0
  160. package/es/platform/zrecord/applications/interfaces/input/UpdateRecordInputModel.js +0 -0
  161. package/es/platform/zrecord/applications/usecases/UpdateRecordUseCase.js +30 -0
  162. package/es/platform/zrecord/frameworks/ActionsHandlersFactory.js +4 -1
  163. package/package.json +9 -11
  164. package/es/platform/components/table-connected/adapters/controllers/ColumnChooserOpenedController.js +0 -28
  165. package/es/platform/components/table-connected/adapters/controllers/ColumnChooserUpdateController.js +0 -31
@@ -0,0 +1,356 @@
1
+ import { ONE_UNIFICATION } from "../../../../../cc/one-unification/Constants";
2
+ export const deskModel = {
3
+ loadOnDiv: ONE_UNIFICATION.ELEMENTS.SIDE_PANE,
4
+ appName: 'Zoho Desk',
5
+ appLogoURL: 'https://desk.zoho.com/api/v1/organizations/163390704/logo?no-cache=1766673022841&fileSize=THUMBNAIL',
6
+ isCommonSearchEnabled: true,
7
+ switcher: {
8
+ label: 'Departments',
9
+ key: 'department-switcher',
10
+ isSearchEnabled: true,
11
+ options: [{
12
+ label: 'Zylker Support',
13
+ key: 'zylker-support',
14
+ iconLink: 'https://desk.zoho.com/api/v1/organizations/163390704/logo?no-cache=1766673022841&fileSize=THUMBNAIL',
15
+ selected: true
16
+ }, {
17
+ label: 'Marketing Team',
18
+ key: 'marketing-team',
19
+ iconLink: 'https://picsum.photos/seed/' + Math.random() + '/24/24'
20
+ }, {
21
+ label: 'Sales Team',
22
+ key: 'sales-team',
23
+ iconLink: 'https://picsum.photos/seed/' + Math.random() + '/24/24'
24
+ }]
25
+ },
26
+ modules: [{
27
+ label: 'Requests',
28
+ key: 'requests',
29
+ icon: 'home',
30
+ subModules: [{
31
+ label: 'Headquarters',
32
+ key: 'headquarters'
33
+ }, {
34
+ label: 'Team Feeds',
35
+ key: 'team-feeds'
36
+ }, {
37
+ label: 'Views',
38
+ key: 'views11',
39
+ moduleSpecificConfig: {
40
+ isSearchEnabled: true,
41
+ isAddEnabled: true,
42
+ accordionMode: 'Focused'
43
+ },
44
+ loadOnDemand: true,
45
+ subModuels: [] // subModules: [
46
+ // {
47
+ // label: 'Starred Views',
48
+ // key: 'starred-views',
49
+ // moduleConfig: {
50
+ // isMoreEnabled: true,
51
+ // isReorderEnabled: true,
52
+ // moreOptions: [
53
+ // {
54
+ // label: 'Export',
55
+ // key: 'export',
56
+ // icon: 'lms'
57
+ // },
58
+ // {
59
+ // label: 'Open in New Tab',
60
+ // key: 'open-in-new-tab',
61
+ // icon: '_icon_open_new_tab'
62
+ // },
63
+ // {
64
+ // key: 'favorite',
65
+ // state: false,
66
+ // on: {
67
+ // label: 'Unstar',
68
+ // icon: '_icon_m_fil_star'
69
+ // },
70
+ // off: {
71
+ // label: 'Star',
72
+ // icon: '_icon_m_star'
73
+ // }
74
+ // }
75
+ // ]
76
+ // },
77
+ // subModules: [
78
+ // {
79
+ // label: 'All Requests',
80
+ // key: 'all-requests',
81
+ // count: '99'
82
+ // },
83
+ // {
84
+ // label: 'My Requests',
85
+ // key: 'my-requests',
86
+ // count: '250'
87
+ // },
88
+ // {
89
+ // label: 'My Open Requests',
90
+ // key: 'my-open-requests',
91
+ // count: '12002'
92
+ // },
93
+ // {
94
+ // label: 'Telephony Team',
95
+ // key: 'telephony-team',
96
+ // count: '8'
97
+ // },
98
+ // {
99
+ // label: 'Customization',
100
+ // key: 'customization',
101
+ // count: '1'
102
+ // },
103
+ // {
104
+ // label: 'Zoho Desk Support',
105
+ // key: 'zoho-desk-support',
106
+ // count: '15'
107
+ // }
108
+ // ]
109
+ // },
110
+ // {
111
+ // label: 'All Views',
112
+ // key: 'all-views',
113
+ // moduleConfig: {
114
+ // isMoreEnabled: true,
115
+ // moreOptions: [
116
+ // {
117
+ // label: 'Export',
118
+ // key: 'export',
119
+ // icon: 'lms'
120
+ // },
121
+ // {
122
+ // label: 'Open in New Tab',
123
+ // key: 'open-in-new-tab',
124
+ // icon: '_icon_open_new_tab'
125
+ // },
126
+ // {
127
+ // key: 'favorite',
128
+ // state: false,
129
+ // on: {
130
+ // label: 'Unstar',
131
+ // icon: '_icon_m_fil_star'
132
+ // },
133
+ // off: {
134
+ // label: 'Star',
135
+ // icon: '_icon_m_star'
136
+ // }
137
+ // }
138
+ // ]
139
+ // },
140
+ // subModules: [
141
+ // {
142
+ // label: 'All Requests',
143
+ // key: 'all-requests-2'
144
+ // },
145
+ // {
146
+ // label: 'My Requests',
147
+ // key: 'my-requests-2'
148
+ // },
149
+ // {
150
+ // label: 'Closed Requests',
151
+ // key: 'closed-requests'
152
+ // }
153
+ // ]
154
+ // }
155
+ // ]
156
+
157
+ }, {
158
+ label: 'Agent Queue',
159
+ key: 'agent-queue'
160
+ }, {
161
+ label: 'Team Queue',
162
+ key: 'team-queue'
163
+ }, {
164
+ label: 'Tags',
165
+ key: 'tags'
166
+ }]
167
+ }, {
168
+ label: 'Customers',
169
+ key: 'customers',
170
+ icon: 'home',
171
+ subModules: [{
172
+ label: 'Contacts',
173
+ key: 'contacts',
174
+ icon: 'home',
175
+ moduleSpecificConfig: {
176
+ isSearchEnabled: true,
177
+ isAddEnabled: true,
178
+ accordionMode: 'Focused'
179
+ },
180
+ subModules: [{
181
+ label: 'Starred Views',
182
+ key: 'starred-views-contacts',
183
+ subModules: [{
184
+ label: 'All Contacts',
185
+ key: 'all-contacts'
186
+ }]
187
+ }, {
188
+ label: 'All Views',
189
+ key: 'all-views-contacts',
190
+ subModules: [{
191
+ label: 'All Contacts',
192
+ key: 'all-contacts-2'
193
+ }, {
194
+ label: 'ANonymous Contacts',
195
+ key: 'anonymous-contacts'
196
+ }, {
197
+ label: 'Last 30 days',
198
+ key: 'last-30-days'
199
+ }]
200
+ }, {
201
+ label: 'Archived views',
202
+ key: 'archived-views',
203
+ moduleSpecificConfig: {
204
+ loadOnDemand: true
205
+ }
206
+ }, {
207
+ label: 'Duplicates',
208
+ key: 'duplicates',
209
+ moduleSpecificConfig: {
210
+ isSearchEnabled: true
211
+ },
212
+ subModules: [{
213
+ label: 'abhishek',
214
+ key: 'abhishek',
215
+ count: '5'
216
+ }, {
217
+ label: 'john doe',
218
+ key: 'john-doe',
219
+ count: '2'
220
+ }, {
221
+ label: 'jane doe',
222
+ key: 'jane-doe',
223
+ count: '3'
224
+ }]
225
+ }]
226
+ }, {
227
+ label: 'Accounts',
228
+ key: 'accounts'
229
+ }]
230
+ }, {
231
+ label: 'Knowledge Base',
232
+ key: 'knowledge-base',
233
+ icon: 'home',
234
+ subModules: [{
235
+ label: 'Dashboard',
236
+ key: 'dashboard'
237
+ }, {
238
+ label: 'Articles',
239
+ key: 'articles',
240
+ moduleSpecificConfig: {
241
+ accordionMode: 'Focused'
242
+ },
243
+ subModules: [{
244
+ label: 'Product Mangement',
245
+ key: 'product-management',
246
+ expanded: true,
247
+ subModules: [{
248
+ label: 'Management',
249
+ key: 'management',
250
+ icon: 'lms',
251
+ expanded: true,
252
+ subModules: [{
253
+ label: 'Core Module',
254
+ key: 'core-module',
255
+ icon: 'lms',
256
+ expanded: true,
257
+ subModules: [{
258
+ label: 'Tickets',
259
+ key: 'tickets',
260
+ moduleSpecificConfig: {
261
+ loadOnDemand: true
262
+ }
263
+ }, {
264
+ label: 'Modules',
265
+ key: 'modules',
266
+ icon: 'lms',
267
+ expanded: true,
268
+ subModules: [{
269
+ label: 'Views',
270
+ key: 'views'
271
+ }]
272
+ }]
273
+ }, {
274
+ label: 'Zoho Desk Mail',
275
+ key: 'zoho-desk-mail'
276
+ }]
277
+ }]
278
+ }]
279
+ }, {
280
+ label: 'Templates',
281
+ key: 'templates'
282
+ }, {
283
+ label: 'Manage KB',
284
+ key: 'manage-kb'
285
+ }, {
286
+ label: 'Gallery',
287
+ key: 'gallery'
288
+ }, {
289
+ label: 'Recycle Bin',
290
+ key: 'recycle-bin'
291
+ }]
292
+ }, {
293
+ label: 'Analytics',
294
+ key: 'analytics',
295
+ icon: 'home',
296
+ subModules: [{
297
+ label: 'Dashboards',
298
+ key: 'dashboards',
299
+ moduleSpecificConfig: {
300
+ isSearchEnabled: true,
301
+ accordionMode: 'Focused'
302
+ },
303
+ subModules: [{
304
+ label: 'My Dashboards',
305
+ key: 'my-dashboards',
306
+ moduleSpecificConfig: {
307
+ isAccordionSelectable: true
308
+ },
309
+ subModules: [{
310
+ label: 'Zia',
311
+ key: 'zia'
312
+ }, {
313
+ label: 'Test',
314
+ key: 'test'
315
+ }]
316
+ }, {
317
+ label: 'Starred Dashboards',
318
+ key: 'starred-dashboards',
319
+ moduleSpecificConfig: {
320
+ loadOnDemand: true,
321
+ isAccordionSelectable: true
322
+ }
323
+ }, {
324
+ label: 'Popular Dashboards',
325
+ key: 'popular-dashboards',
326
+ moduleSpecificConfig: {
327
+ loadOnDemand: true,
328
+ isAccordionSelectable: true
329
+ }
330
+ }]
331
+ }, {
332
+ label: 'Reports',
333
+ key: 'reports'
334
+ }, {
335
+ label: 'Advanced analytics',
336
+ key: 'advanced-analytics',
337
+ actionIcons: [{
338
+ icon: '_icon_open_new_tab',
339
+ tooltipText: 'Open in new tab',
340
+ key: 'open-in-new-tab'
341
+ }]
342
+ }]
343
+ }, {
344
+ label: 'Activities',
345
+ key: 'activities',
346
+ icon: 'home'
347
+ }, {
348
+ label: 'IM',
349
+ key: 'im',
350
+ icon: 'home'
351
+ }, {
352
+ label: 'Add Module',
353
+ key: 'add-module',
354
+ icon: 'add'
355
+ }]
356
+ };
@@ -0,0 +1,96 @@
1
+ import { AbstractResource } from "../../../../sdk/application/interfaces/gateways/AbstractResource";
2
+ import { translateModule } from "../presenters/OneUnifiedNavigationTranslator";
3
+ import { ONE_UNIFICATION } from "../../../../../cc/one-unification/Constants";
4
+ export class SmartNavigationResource extends AbstractResource {
5
+ initialize() {}
6
+
7
+ destroy() {}
8
+
9
+ initializeModel(model) {
10
+ this.validateLibraryLoaded();
11
+ globalThis.ZUnify.UnifiedNavigation.initUIModel(model);
12
+ }
13
+
14
+ modifyTab(tabKey, tabData) {
15
+ this.validateLibraryLoaded();
16
+ globalThis.ZUnify.UnifiedNavigation.modifyTab(tabKey, tabData);
17
+ }
18
+
19
+ modifyModule(moduleKey, moduleData) {
20
+ this.validateLibraryLoaded();
21
+ globalThis.ZUnify.UnifiedNavigation.modifyModule(moduleKey, moduleData);
22
+ }
23
+
24
+ addModule(moduleParentKey, moduleData) {
25
+ this.validateLibraryLoaded();
26
+ const transformedModuleData = moduleData.map(module => translateModule(module));
27
+ globalThis.ZOUnifiedNavLib.addModule(moduleParentKey, transformedModuleData);
28
+ }
29
+
30
+ appendModule(moduleData) {
31
+ this.validateLibraryLoaded();
32
+ const transformedModuleData = moduleData.map(module => translateModule(module))[0];
33
+ ZOUnifiedNavLib.addModule('default-tab', transformedModuleData);
34
+ }
35
+
36
+ loadModule(moduleKey, moduleData) {
37
+ this.validateLibraryLoaded();
38
+ const transformedModuleData = moduleData.map(module => translateModule(module));
39
+ globalThis.ZUnify.UnifiedNavigation.onLoadComplete({
40
+ key: moduleKey,
41
+ items: transformedModuleData
42
+ });
43
+ }
44
+
45
+ selectModule(moduleKey) {
46
+ this.validateLibraryLoaded();
47
+ globalThis.ZUnify.UnifiedNavigation.selectModule(moduleKey);
48
+ }
49
+
50
+ setNotificationCount(key, count) {
51
+ this.validateLibraryLoaded();
52
+ globalThis.ZUnify.UnifiedNavigation.setNotificationCount(key, count);
53
+ }
54
+
55
+ pinModule(moduleKey) {
56
+ this.validateLibraryLoaded();
57
+ globalThis.ZUnify.UnifiedNavigation.pinModule(moduleKey);
58
+ }
59
+
60
+ favouriteModule(moduleKey) {
61
+ this.validateLibraryLoaded();
62
+ globalThis.ZUnify.UnifiedNavigation.favouriteModule(moduleKey);
63
+ }
64
+
65
+ hideModule(moduleKey) {
66
+ this.validateLibraryLoaded();
67
+ globalThis.ZUnify.UnifiedNavigation.hideModule(moduleKey);
68
+ }
69
+
70
+ activateFilterOnModule(moduleKey) {
71
+ this.validateLibraryLoaded();
72
+ globalThis.ZUnify.UnifiedNavigation.activateFitlerOnModule(moduleKey);
73
+ }
74
+
75
+ changeDepartment(departmentKey) {
76
+ this.validateLibraryLoaded();
77
+ globalThis.ZUnify.UnifiedNavigation.onSwitcherSelectionComplete(ONE_UNIFICATION.ELEMENTS.DEPARTMENT_SWITCHER, departmentKey);
78
+ }
79
+
80
+ expandPanel() {
81
+ this.validateLibraryLoaded();
82
+ globalThis.ZUnify.UnifiedNavigation.setCollapsed(false);
83
+ }
84
+
85
+ collapsePanel() {
86
+ this.validateLibraryLoaded();
87
+ globalThis.ZUnify.UnifiedNavigation.setCollapsed(true);
88
+ }
89
+
90
+ validateLibraryLoaded() {
91
+ if (!globalThis.ZUnify || !globalThis.ZUnify.UnifiedNavigation) {
92
+ throw new Error('Unification library is not loaded yet.');
93
+ }
94
+ }
95
+
96
+ }
@@ -0,0 +1,22 @@
1
+ import React from 'react';
2
+ import ReactDOM from 'react-dom';
3
+
4
+ function createButtonElement(config) {
5
+ return /*#__PURE__*/React.createElement('button', {
6
+ onClick: config.onClick
7
+ }, config.label);
8
+ }
9
+
10
+ export function renderIconSlot(iconSlot, buttonConfig) {
11
+ const container = document.getElementById(iconSlot.id);
12
+
13
+ if (!container) {
14
+ __DEVELOPMENT__ && console.warn(`[CustomElementRenderer] DOM node not found for iconSlot.id: "${iconSlot.id}"`);
15
+ return null;
16
+ }
17
+
18
+ if (iconSlot.width !== undefined) container.style.width = `${iconSlot.width}px`;
19
+ if (iconSlot.height !== undefined) container.style.height = `${iconSlot.height}px`;
20
+ ReactDOM.render(createButtonElement(buttonConfig), container);
21
+ return () => ReactDOM.unmountComponentAtNode(container);
22
+ }
@@ -0,0 +1,12 @@
1
+ import React from 'react';
2
+ const library = 'one-unification';
3
+
4
+ if (library === 'one-unification') {
5
+ import("./one-unification/SmartNavigation").then(module => {
6
+ const SmartNavigation = module.SmartNavigation;
7
+ return SmartNavigation;
8
+ });
9
+ } else {
10
+ /*#__PURE__*/
11
+ React.createElement("div", null, "Unsupported library for Smart Navigation");
12
+ }
@@ -0,0 +1,156 @@
1
+ import { ONE_UNIFICATION } from "../../../../../cc/one-unification/Constants";
2
+ import { UnifiedNavigationActions } from "./UnifiedNavigationActions";
3
+ export class UnifiedNavigationEvent {
4
+ static defineCallBackProxy(dispatch) {
5
+ return {
6
+ get(target, prop, receiver) {
7
+ return function (args) {
8
+ dispatch({
9
+ type: ONE_UNIFICATION.EVENTS.ACTION_TRIGGERED,
10
+ payload: {
11
+ actionMethod: prop,
12
+ data: args
13
+ }
14
+ });
15
+
16
+ if (target[prop] && target[prop] instanceof Function) {
17
+ return target[prop].apply(this, args);
18
+ }
19
+ };
20
+ }
21
+
22
+ };
23
+ }
24
+
25
+ static getConfigJSON() {
26
+ return {
27
+ AccessibilitySettings: {
28
+ darkModeEnabled: true
29
+ },
30
+ AppsMenu: {
31
+ libraryURL: 'https://one-lab.localzoho.com/zd/library.js?app_name=support&org_id=115233295&zaaid=115233993'
32
+ },
33
+ unifiedNavigation: {
34
+ sidePaneSelector: ONE_UNIFICATION.ELEMENTS.SIDE_PANE,
35
+ topBarSelector: ONE_UNIFICATION.ELEMENTS.TOP_BAR,
36
+ appDisplayName: 'Desk',
37
+ appLogo: 'desk-logo',
38
+ appLogoURL: 'https://www.zohowebstatic.com/sites/zweb/images/desk/images/desk-128.png',
39
+ isInCollapsedState: false
40
+ }
41
+ };
42
+ }
43
+
44
+ onScriptLoad(_ref) {
45
+ let {
46
+ action,
47
+ dispatch
48
+ } = _ref;
49
+ const {
50
+ scriptId
51
+ } = action.payload;
52
+
53
+ if (scriptId !== ONE_UNIFICATION.SCRIPT_ID) {
54
+ return;
55
+ }
56
+
57
+ globalThis.onZUnifyLibReady = () => dispatch({
58
+ type: ONE_UNIFICATION.EVENTS.LIBRARY_READY
59
+ }); // moved to App Level
60
+
61
+
62
+ globalThis.onZDLibraryReady = () => dispatch({
63
+ type: ONE_UNIFICATION.EVENTS.ZD_LIBRARY_READY
64
+ }); // moved to App Level
65
+
66
+ }
67
+
68
+ onZUnifyReady(_ref2) {
69
+ let {
70
+ state,
71
+ dispatch
72
+ } = _ref2;
73
+ const {
74
+ ZUnify,
75
+ ZUnifyImpl
76
+ } = globalThis;
77
+ ZUnify.register(UnifiedNavigationEvent.getConfigJSON());
78
+ UnifiedNavigationEvent.loadNavigationData({
79
+ state,
80
+ dispatch
81
+ });
82
+ }
83
+
84
+ static loadNavigationData(_ref3) {
85
+ let {
86
+ state,
87
+ dispatch
88
+ } = _ref3;
89
+ const {
90
+ ZUnify,
91
+ ZUnifyImpl
92
+ } = globalThis;
93
+ const {
94
+ model
95
+ } = state.properties;
96
+ ZUnify.UnifiedNavigation.initUIModel(model);
97
+ ZUnifyImpl.UnifiedNavigation = new Proxy(ZUnifyImpl.UnifiedNavigation, UnifiedNavigationEvent.defineCallBackProxy(dispatch));
98
+ dispatch({
99
+ type: ONE_UNIFICATION.EVENTS.UNIFIED_NAVIGATION_INITIALIZED,
100
+ payload: {
101
+ model
102
+ }
103
+ }); // ZUnifyImpl.UnifiedNavigation.clickModule = (...args) => console.log('<DK>', 'click module is also working fine', args[0]);
104
+ } // TODO: Yet to implement this method
105
+
106
+
107
+ onZDLibraryReady(_ref4) {
108
+ let {
109
+ state,
110
+ dispatch
111
+ } = _ref4;
112
+ globalThis.ZDLibrary.Launcher.init({
113
+ csrfName: 'crmcsrfparam',
114
+ // Product specific csrf value;
115
+ getCsrfValue: function () {
116
+ return ''; //getCSRFCookie(); // Product specific csrf value;
117
+ }
118
+ });
119
+ }
120
+
121
+ onActionTriggered(_ref5) {
122
+ let {
123
+ action,
124
+ state,
125
+ dispatch
126
+ } = _ref5;
127
+ const {
128
+ actionMethod,
129
+ data
130
+ } = action.payload;
131
+ UnifiedNavigationActions.handle(actionMethod, data, dispatch);
132
+ }
133
+
134
+ getHandlers() {
135
+ return {
136
+ [ONE_UNIFICATION.EVENTS.LIBRARY_READY]: this.onZUnifyReady,
137
+ [ONE_UNIFICATION.EVENTS.ZD_LIBRARY_READY]: this.onZDLibraryReady,
138
+ [ONE_UNIFICATION.EVENTS.ACTION_TRIGGERED]: this.onActionTriggered,
139
+ // Library Loader moved to App level
140
+ ['LIBRARY_LOADER#SUCCESS']: this.onScriptLoad,
141
+ ['LIBRARY_LOADER#FAILURE']: _ref6 => {
142
+ let {
143
+ state,
144
+ action,
145
+ dispatch
146
+ } = _ref6;
147
+ const {
148
+ scriptId,
149
+ error
150
+ } = action.payload;
151
+ console.error(`Failed to load library: ${scriptId}, Error: ${error}`);
152
+ }
153
+ };
154
+ }
155
+
156
+ }