@zohodesk/library-platform 1.2.0-exp.1 → 1.2.0-exp.2

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 (40) hide show
  1. package/es/.DS_Store +0 -0
  2. package/es/bc/sdk/ResourceNamesEnum.js +0 -1
  3. package/es/index.js +1 -1
  4. package/es/platform/.DS_Store +0 -0
  5. package/es/platform/components/index.js +0 -1
  6. package/package.json +2 -3
  7. package/es/cc/component/Dispatch.js +0 -1
  8. package/es/cc/component/index.js +0 -3
  9. package/es/cc/one-unification/Constants.js +0 -24
  10. package/es/cc/one-unification/unified-navigation/ActionTypes.js +0 -1
  11. package/es/cc/one-unification/unified-navigation/CommonTypes.js +0 -1
  12. package/es/cc/one-unification/unified-navigation/ConfigTypes.js +0 -1
  13. package/es/cc/one-unification/unified-navigation/HandlerTypes.js +0 -1
  14. package/es/cc/one-unification/unified-navigation/Types.js +0 -1
  15. package/es/cc/one-unification/unified-navigation/UnifiedNavigation.d.js +0 -0
  16. package/es/cc/one-unification/unified-navigation/index.js +0 -1
  17. package/es/cc/smart-navigation/Constants.js +0 -8
  18. package/es/cc/smart-navigation/Events.js +0 -107
  19. package/es/cc/smart-navigation/Properties.js +0 -87
  20. package/es/cc/smart-navigation/index.js +0 -4
  21. package/es/library/behaviours/library-loader/adapters/controllers/LibraryLoaderController.js +0 -17
  22. package/es/library/behaviours/library-loader/adapters/gateways/LibraryLoaderAdapter.js +0 -29
  23. package/es/library/behaviours/library-loader/applications/usecases/LoadLibraryUseCase.js +0 -42
  24. package/es/library/behaviours/library-loader/domain/entities/interfaces/ILibraryLoader.js +0 -1
  25. package/es/library/behaviours/library-loader/frameworks/LibraryLoaderBehaviour.js +0 -26
  26. package/es/platform/components/smart-navigation/adapters/controllers/LoadScriptController.js +0 -0
  27. package/es/platform/components/smart-navigation/adapters/controllers/UiModelInitializeController.js +0 -0
  28. package/es/platform/components/smart-navigation/adapters/presenters/OneUnifiedNavigationTranslator.js +0 -248
  29. package/es/platform/components/smart-navigation/adapters/presenters/Present.js +0 -77
  30. package/es/platform/components/smart-navigation/adapters/presenters/SampleModel.js +0 -356
  31. package/es/platform/components/smart-navigation/adapters/resources/SmartNavigationResource.js +0 -96
  32. package/es/platform/components/smart-navigation/applications/usecases/NavigateModuleUseCase.js +0 -0
  33. package/es/platform/components/smart-navigation/frameworks/CustomElementRenderer.js +0 -22
  34. package/es/platform/components/smart-navigation/frameworks/SmartNavigation.js +0 -12
  35. package/es/platform/components/smart-navigation/frameworks/one-unification/OneUnificationEventHandlers.js +0 -156
  36. package/es/platform/components/smart-navigation/frameworks/one-unification/SmartNavigation.js +0 -83
  37. package/es/platform/components/smart-navigation/frameworks/one-unification/SmartNavigation.module.css +0 -3
  38. package/es/platform/components/smart-navigation/frameworks/one-unification/SmartNavigationEventHandlers.js +0 -173
  39. package/es/platform/components/smart-navigation/frameworks/one-unification/UnifiedNavigation.js +0 -48
  40. package/es/platform/components/smart-navigation/frameworks/one-unification/UnifiedNavigationActions.js +0 -144
package/es/.DS_Store ADDED
Binary file
@@ -2,7 +2,6 @@ var ResourceNamesEnum = /*#__PURE__*/function (ResourceNamesEnum) {
2
2
  ResourceNamesEnum["APP"] = "app";
3
3
  ResourceNamesEnum["SMART_TABLE"] = "smartTable";
4
4
  ResourceNamesEnum["SMART_FORM"] = "smartForm";
5
- ResourceNamesEnum["SMART_NAVIGATION"] = "smartNavigation";
6
5
  ResourceNamesEnum["SMART_ACTION_BAND"] = "smartActionBand";
7
6
  ResourceNamesEnum["CLIENT_ACTION"] = "clientAction";
8
7
  return ResourceNamesEnum;
package/es/index.js CHANGED
@@ -19,7 +19,7 @@ export const CC = { ...CCNamespace,
19
19
  import * as _BC from "./bc";
20
20
  export { _BC as BC };
21
21
  export * from "./library/analytics";
22
- export { TableConnectedFactory, FormConnectedFactory, SmartNavigation, createSmartNavigation, SmartActionBandFactory } from "./platform/components";
22
+ export { TableConnectedFactory, FormConnectedFactory, SmartActionBandFactory } from "./platform/components";
23
23
  export { ComponentRegistry, createCustomComponent } from "./library";
24
24
  export { default as TableFieldComponents } from "./library/dot/legacy-to-new-arch/table-field-components";
25
25
  import * as _Components from "./library/dot/legacy-to-new-arch";
Binary file
@@ -1,4 +1,3 @@
1
1
  export { default as TableConnectedFactory } from "./table-connected/frameworks/TableConnectedFactory";
2
2
  export { default as FormConnectedFactory } from "./form-connected/frameworks/FormConnectedFactory";
3
- export { SmartNavigation, createSmartNavigation } from "./smart-navigation/frameworks/one-unification/SmartNavigation";
4
3
  export { default as SmartActionBandFactory } from "./smart-action-band/frameworks/SmartActionBandFactory";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zohodesk/library-platform",
3
- "version": "1.2.0-exp.1",
3
+ "version": "1.2.0-exp.2",
4
4
  "description": "",
5
5
  "main": "es/index.js",
6
6
  "files": [
@@ -82,7 +82,7 @@
82
82
  "@zohodesk/dot": "1.8.6",
83
83
  "@zohodesk/dotkit": "1.0.7",
84
84
  "@zohodesk/hooks": "2.0.6",
85
- "@zohodesk/i18n": "1.0.0-beta.31",
85
+ "@zohodesk/i18n": "1.0.0-beta.35",
86
86
  "@zohodesk/icons": "1.1.5",
87
87
  "@zohodesk/layout": "3.1.0",
88
88
  "@zohodesk/svg": "1.2.6",
@@ -91,7 +91,6 @@
91
91
  "react-sortable-hoc": "1.11.0"
92
92
  },
93
93
  "dependencies": {
94
- "@zohodesk/client_build_tool": "0.0.10",
95
94
  "ajv": "6.12.6",
96
95
  "jsep": "0.3.5",
97
96
  "object-path-immutable": "4.1.2"
@@ -1 +0,0 @@
1
- export {};
@@ -1,3 +0,0 @@
1
- export { default as EventHandlers } from "./EventHandlers";
2
- export { Behaviours } from "./Behaviour";
3
- export { Dispatch } from "./Dispatch";
@@ -1,24 +0,0 @@
1
- const EVENTS = {
2
- ACTION_TRIGGERED: 'ZUNIFY#ACTION_TRIGGERED',
3
- UNIFIED_NAVIGATION_INITIALIZED: 'ZUNIFY#INITIALIZED',
4
- LIBRARY_READY: 'ZUNIFY#LIBRARY_READY',
5
- ZD_LIBRARY_READY: 'ZUNIFY#ZD_LIBRARY_READY',
6
- ITEM_ADD: 'ZUNIFY#ITEM_ADD',
7
- ITEM_CHANGE: 'ZUNIFY#ITEM_CHANGE',
8
- CUSTOM_ACTION: 'ZUNIFY#CUSTOM_ACTION',
9
- LOAD_DATA: 'ZUNIFY#LOAD_DATA',
10
- SEARCH: 'ZUNIFY#SEARCH',
11
- DEPARTMENT_SWITCH: 'ZUNIFY#DEPARTMENT_SWITCH',
12
- NAVIGATION_STATE_CHANGE: 'ZUNIFY#NAVIGATION_STATE_CHANGE',
13
- ITEM_COLLAPSE: 'ZUNIFY#ITEM_COLLAPSE',
14
- ITEM_EXPAND: 'ZUNIFY#ITEM_EXPAND'
15
- };
16
- export const ONE_UNIFICATION = {
17
- SCRIPT_ID: 'zunify-script',
18
- ELEMENTS: {
19
- SIDE_PANE: 'unified-navigation-side-panel',
20
- TOP_BAR: 'unified-navigation-top-bar',
21
- DEPARTMENT_SWITCHER: 'department-switcher'
22
- },
23
- EVENTS
24
- };
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1,8 +0,0 @@
1
- export const MODULE_CHANGE = 'SMART_NAVIGATION#MODULE_CHANGE';
2
- export const MODULE_ADD = 'SMART_NAVIGATION#MODULE_ADD';
3
- export const LOAD_DATA = 'SMART_NAVIGATION#LOAD_DATA';
4
- export const SEARCH = 'SMART_NAVIGATION#SEARCH';
5
- export const NAVIGATION_PANEL_EXPANDED = 'SMART_NAVIGATION#PANEL_EXPANDED';
6
- export const NAVIGATION_PANEL_COLLAPSED = 'SMART_NAVIGATION#PANEL_COLLAPSED';
7
- export const CUSTOM_ACTION = 'SMART_NAVIGATION#CUSTOM_ACTION_TRIGGERED';
8
- export const DEPARTMENT_SWITCH = 'SMART_NAVIGATION#DEPARTMENT_SWITCH';
@@ -1,107 +0,0 @@
1
- import { MODULE_CHANGE, MODULE_ADD, LOAD_DATA, SEARCH, NAVIGATION_PANEL_EXPANDED, NAVIGATION_PANEL_COLLAPSED, CUSTOM_ACTION, DEPARTMENT_SWITCH } from "./Constants";
2
- const Events = [{
3
- type: MODULE_CHANGE,
4
- payload: {
5
- type: 'object',
6
- properties: {
7
- selectedModule: {
8
- type: 'object',
9
- additionalProperties: true
10
- },
11
- moduleParentApiNames: {
12
- type: 'array',
13
- items: {
14
- type: 'string'
15
- }
16
- }
17
- }
18
- }
19
- }, {
20
- type: MODULE_ADD,
21
- payload: {
22
- type: 'object',
23
- properties: {
24
- newLink: {
25
- type: 'object',
26
- additionalProperties: true
27
- },
28
- currentModule: {
29
- type: 'object',
30
- additionalProperties: true
31
- },
32
- moduleParentApiNames: {
33
- type: 'array',
34
- items: {
35
- type: 'string'
36
- }
37
- }
38
- }
39
- }
40
- }, {
41
- type: LOAD_DATA,
42
- payload: {
43
- type: 'object',
44
- properties: {
45
- module: {
46
- type: 'object',
47
- additionalProperties: true
48
- }
49
- }
50
- }
51
- }, {
52
- type: SEARCH,
53
- payload: {
54
- type: 'object',
55
- properties: {
56
- currentModule: {
57
- type: 'object',
58
- additionalProperties: true
59
- },
60
- searchValue: {
61
- type: 'string'
62
- }
63
- }
64
- }
65
- }, {
66
- type: NAVIGATION_PANEL_EXPANDED,
67
- payload: {
68
- type: 'object'
69
- }
70
- }, {
71
- type: NAVIGATION_PANEL_COLLAPSED,
72
- payload: {
73
- type: 'object'
74
- }
75
- }, {
76
- type: CUSTOM_ACTION,
77
- payload: {
78
- type: 'object',
79
- properties: {
80
- actionName: {
81
- type: 'string'
82
- },
83
- currentModule: {
84
- type: 'object',
85
- additionalProperties: true
86
- },
87
- moduleParentApiNames: {
88
- type: 'array',
89
- items: {
90
- type: 'string'
91
- }
92
- }
93
- }
94
- }
95
- }, {
96
- type: DEPARTMENT_SWITCH,
97
- payload: {
98
- type: 'object',
99
- properties: {
100
- currentDepartment: {
101
- type: 'object',
102
- additionalProperties: true
103
- }
104
- }
105
- }
106
- }];
107
- export default Events;
@@ -1,87 +0,0 @@
1
- export const Properties = {
2
- iconMap: {
3
- required: false,
4
- defaultValue: {},
5
- typeMetadata: {
6
- schema: {
7
- type: 'object'
8
- }
9
- }
10
- },
11
- selectedModule: {
12
- required: true,
13
- typeMetadata: {
14
- schema: {
15
- type: 'string'
16
- }
17
- }
18
- },
19
- modules: {
20
- required: true,
21
- typeMetadata: {
22
- schema: {
23
- type: 'array',
24
- items: {
25
- type: 'object'
26
- }
27
- }
28
- }
29
- },
30
- views: {
31
- required: true,
32
- typeMetadata: {
33
- schema: {
34
- type: 'array',
35
- items: {
36
- type: 'object'
37
- }
38
- }
39
- }
40
- },
41
- departments: {
42
- required: true,
43
- typeMetadata: {
44
- schema: {
45
- type: 'array',
46
- items: {
47
- type: 'object'
48
- }
49
- }
50
- }
51
- },
52
- clientActions: {
53
- required: true,
54
- typeMetadata: {
55
- schema: {
56
- type: 'array',
57
- items: {
58
- type: 'object'
59
- }
60
- }
61
- }
62
- },
63
- overLayModules: {
64
- required: false,
65
- defaultValue: [],
66
- typeMetadata: {
67
- schema: {
68
- type: 'array',
69
- items: {
70
- type: 'string'
71
- }
72
- }
73
- }
74
- },
75
- onDemandModules: {
76
- required: false,
77
- defaultValue: [],
78
- typeMetadata: {
79
- schema: {
80
- type: 'array',
81
- items: {
82
- type: 'string'
83
- }
84
- }
85
- }
86
- }
87
- };
@@ -1,4 +0,0 @@
1
- export { Properties as SmartNavigationProperties } from "./Properties";
2
- export * from "./Properties";
3
- import * as _SmartNavigationConstants from "./Constants";
4
- export { _SmartNavigationConstants as SmartNavigationConstants };
@@ -1,17 +0,0 @@
1
- export class LibraryLoaderController {
2
- constructor(loadLibraryUseCase, scriptId) {
3
- this.loadLibraryUseCase = loadLibraryUseCase;
4
- this.scriptId = scriptId;
5
- }
6
-
7
- handleMount(_ref) {
8
- let {
9
- dispatch
10
- } = _ref;
11
- this.loadLibraryUseCase.execute({
12
- dispatch,
13
- scriptId: this.scriptId
14
- });
15
- }
16
-
17
- }
@@ -1,29 +0,0 @@
1
- export class LibraryLoaderAdapter {
2
- constructor(url) {
3
- this.url = url;
4
- }
5
-
6
- isScriptLoaded() {
7
- return Array.from(document.querySelectorAll('script[data-library-loader-script="true"]')).some(script => script.src === this.url);
8
- }
9
-
10
- loadScript() {
11
- if (this.isScriptLoaded()) {
12
- return Promise.resolve();
13
- }
14
-
15
- return new Promise((resolve, reject) => {
16
- const script = document.createElement('script');
17
- script.src = this.url;
18
- script.async = true;
19
- script.setAttribute('data-library-loader-script', 'true');
20
-
21
- script.onload = () => resolve();
22
-
23
- script.onerror = () => reject(new Error(`Failed to load script: ${this.url}`));
24
-
25
- document.head.appendChild(script);
26
- });
27
- }
28
-
29
- }
@@ -1,42 +0,0 @@
1
- export class LoadLibraryUseCase {
2
- constructor(loader) {
3
- this.loader = loader;
4
- }
5
-
6
- async execute(_ref) {
7
- let {
8
- dispatch,
9
- scriptId
10
- } = _ref;
11
-
12
- // If the loader has isScriptLoaded, use it
13
- if (typeof this.loader.isScriptLoaded === 'function' && this.loader.isScriptLoaded()) {
14
- dispatch({
15
- type: 'LIBRARY_LOADER#ALREADY_LOADED',
16
- payload: {
17
- scriptId: scriptId
18
- }
19
- });
20
- return;
21
- }
22
-
23
- try {
24
- await this.loader.loadScript();
25
- dispatch({
26
- type: 'LIBRARY_LOADER#SUCCESS',
27
- payload: {
28
- scriptId: scriptId
29
- }
30
- });
31
- } catch (error) {
32
- dispatch({
33
- type: 'LIBRARY_LOADER#FAILURE',
34
- payload: {
35
- scriptId: scriptId,
36
- error: error.message
37
- }
38
- });
39
- }
40
- }
41
-
42
- }
@@ -1,26 +0,0 @@
1
- import { LibraryLoaderAdapter } from "../adapters/gateways/LibraryLoaderAdapter";
2
- import { LoadLibraryUseCase } from "../applications/usecases/LoadLibraryUseCase";
3
- import { LibraryLoaderController } from "../adapters/controllers/LibraryLoaderController";
4
- export function LibraryLoaderBehaviour(scriptId, url) {
5
- const loader = new LibraryLoaderAdapter(url);
6
- const loadLibraryUseCase = new LoadLibraryUseCase(loader);
7
- const controller = new LibraryLoaderController(loadLibraryUseCase, scriptId);
8
- return {
9
- name: 'LibraryLoaderBehaviour',
10
- setInitialState: () => ({}),
11
- eventHandlers: {
12
- MOUNT: controller.handleMount.bind(controller)
13
- },
14
- properties: {
15
- url: {
16
- required: true,
17
- defaultValue: url,
18
- typeMetadata: {
19
- schema: {
20
- type: 'string'
21
- }
22
- }
23
- }
24
- }
25
- };
26
- }