@telia-ace/widget-core 1.0.1 → 1.0.5

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 (89) hide show
  1. package/LICENSE.txt +5 -5
  2. package/README.md +3 -3
  3. package/{lib-esm → dist}/action-resolver.d.ts +0 -0
  4. package/{lib-esm → dist}/component-platform/actions-controller.d.ts +0 -0
  5. package/{lib-esm → dist}/component-platform/changeset-provider.d.ts +0 -0
  6. package/dist/component-platform/component-configuration-api.d.ts +2 -0
  7. package/{lib-esm → dist}/component-platform/component-controller.d.ts +0 -0
  8. package/{lib-esm → dist}/component-platform/component-node-collection.d.ts +0 -0
  9. package/{lib-esm → dist}/component-platform/component-node.d.ts +0 -0
  10. package/{lib → dist}/component-platform/component-platform.d.ts +4 -0
  11. package/{lib-esm → dist}/component-platform/component-query.d.ts +0 -0
  12. package/dist/component-platform/create-component-model.d.ts +36 -0
  13. package/dist/component-platform/custom-component-handler.d.ts +21 -0
  14. package/{lib-esm → dist}/component-platform/descriptor.d.ts +0 -0
  15. package/{lib-esm → dist}/component-platform/extend-component.d.ts +0 -0
  16. package/{lib → dist}/component-platform/index.d.ts +3 -1
  17. package/{lib-esm → dist}/component-platform/queries.d.ts +0 -0
  18. package/{lib-esm → dist}/component-platform/state-processor.d.ts +0 -0
  19. package/{lib-esm → dist}/component-resolver.d.ts +0 -0
  20. package/{lib-esm → dist}/event-subscriber.d.ts +0 -0
  21. package/dist/index.d.ts +8 -0
  22. package/dist/index.js +1047 -0
  23. package/dist/index.js.map +1 -0
  24. package/{lib-esm → dist}/types/configuration.d.ts +0 -0
  25. package/{lib-esm → dist}/types/index.d.ts +0 -0
  26. package/{lib-esm → dist}/types/ui.d.ts +0 -1
  27. package/package.json +9 -9
  28. package/lib/action-resolver.d.ts +0 -8
  29. package/lib/action-resolver.js +0 -19
  30. package/lib/component-platform/actions-controller.d.ts +0 -40
  31. package/lib/component-platform/actions-controller.js +0 -119
  32. package/lib/component-platform/changeset-provider.d.ts +0 -8
  33. package/lib/component-platform/changeset-provider.js +0 -2
  34. package/lib/component-platform/component-controller.d.ts +0 -38
  35. package/lib/component-platform/component-controller.js +0 -119
  36. package/lib/component-platform/component-node-collection.d.ts +0 -18
  37. package/lib/component-platform/component-node-collection.js +0 -51
  38. package/lib/component-platform/component-node.d.ts +0 -63
  39. package/lib/component-platform/component-node.js +0 -190
  40. package/lib/component-platform/component-platform.js +0 -209
  41. package/lib/component-platform/component-query.d.ts +0 -16
  42. package/lib/component-platform/component-query.js +0 -35
  43. package/lib/component-platform/create-component-model.d.ts +0 -19
  44. package/lib/component-platform/create-component-model.js +0 -126
  45. package/lib/component-platform/descriptor.d.ts +0 -8
  46. package/lib/component-platform/descriptor.js +0 -12
  47. package/lib/component-platform/extend-component.d.ts +0 -8
  48. package/lib/component-platform/extend-component.js +0 -57
  49. package/lib/component-platform/index.js +0 -24
  50. package/lib/component-platform/queries.d.ts +0 -6
  51. package/lib/component-platform/queries.js +0 -53
  52. package/lib/component-platform/state-processor.d.ts +0 -12
  53. package/lib/component-platform/state-processor.js +0 -209
  54. package/lib/component-resolver.d.ts +0 -14
  55. package/lib/component-resolver.js +0 -49
  56. package/lib/event-subscriber.d.ts +0 -7
  57. package/lib/event-subscriber.js +0 -22
  58. package/lib/index.d.ts +0 -8
  59. package/lib/index.js +0 -39
  60. package/lib/types/configuration.d.ts +0 -86
  61. package/lib/types/configuration.js +0 -16
  62. package/lib/types/index.d.ts +0 -2
  63. package/lib/types/index.js +0 -18
  64. package/lib/types/ui.d.ts +0 -55
  65. package/lib/types/ui.js +0 -2
  66. package/lib-esm/action-resolver.js +0 -17
  67. package/lib-esm/component-platform/actions-controller.js +0 -116
  68. package/lib-esm/component-platform/changeset-provider.js +0 -1
  69. package/lib-esm/component-platform/component-controller.js +0 -116
  70. package/lib-esm/component-platform/component-node-collection.js +0 -48
  71. package/lib-esm/component-platform/component-node.js +0 -187
  72. package/lib-esm/component-platform/component-platform.d.ts +0 -50
  73. package/lib-esm/component-platform/component-platform.js +0 -206
  74. package/lib-esm/component-platform/component-query.js +0 -32
  75. package/lib-esm/component-platform/create-component-model.d.ts +0 -19
  76. package/lib-esm/component-platform/create-component-model.js +0 -121
  77. package/lib-esm/component-platform/descriptor.js +0 -8
  78. package/lib-esm/component-platform/extend-component.js +0 -53
  79. package/lib-esm/component-platform/index.d.ts +0 -16
  80. package/lib-esm/component-platform/index.js +0 -9
  81. package/lib-esm/component-platform/queries.js +0 -46
  82. package/lib-esm/component-platform/state-processor.js +0 -205
  83. package/lib-esm/component-resolver.js +0 -47
  84. package/lib-esm/event-subscriber.js +0 -18
  85. package/lib-esm/index.d.ts +0 -8
  86. package/lib-esm/index.js +0 -5
  87. package/lib-esm/types/configuration.js +0 -13
  88. package/lib-esm/types/index.js +0 -2
  89. package/lib-esm/types/ui.js +0 -1
package/LICENSE.txt CHANGED
@@ -1,6 +1,6 @@
1
- Copyright © 2021, Telia Company AB. All rights reserved.
2
-
3
- THIS PACKAGE AND CONTAINING SOFTWARE IS PART OF
4
- THE HUMANY SERVICE. BY USING THIS SOFTWARE YOU
5
- AGREE TO THE FOLLOWING TERMS AND CONDITIONS:
1
+ Copyright © 2021, Telia Company AB. All rights reserved.
2
+
3
+ THIS PACKAGE AND CONTAINING SOFTWARE IS PART OF
4
+ THE HUMANY SERVICE. BY USING THIS SOFTWARE YOU
5
+ AGREE TO THE FOLLOWING TERMS AND CONDITIONS:
6
6
  http://www.humany.com/legal
package/README.md CHANGED
@@ -1,3 +1,3 @@
1
- # `@telia-ace/widget-core`
2
-
3
- Core framework for ACE widgets.
1
+ # `@telia-ace/widget-core`
2
+
3
+ Core framework for ACE widgets.
File without changes
@@ -0,0 +1,2 @@
1
+ declare const _default: import("@webprovisions/platform").ConfigurationApiDefinition;
2
+ export default _default;
@@ -4,6 +4,7 @@ import { ChangesetProvider } from './changeset-provider';
4
4
  import { ChangesetOptions, ComponentNode, ComponentNodeSettings, RemoveChangeset } from './component-node';
5
5
  import { ComponentNodeCollection } from './component-node-collection';
6
6
  import { ComponentQuery } from './component-query';
7
+ import { CustomHandlerCallback } from './custom-component-handler';
7
8
  export declare type MergeOptions = {
8
9
  breakpoints?: string[];
9
10
  };
@@ -28,6 +29,7 @@ export declare class ComponentPlatform {
28
29
  private changesets;
29
30
  private subscriptions;
30
31
  private processNode;
32
+ private customComponentHandler;
31
33
  constructor(widget: Widget, providers?: {
32
34
  [key: string]: ChangesetProvider;
33
35
  });
@@ -46,5 +48,7 @@ export declare class ComponentPlatform {
46
48
  components(): ComponentQuery;
47
49
  actions(target: ComponentQuery, ns: string): ActionsController;
48
50
  write(data: ChangesetData): RemoveChangeset;
51
+ addComponentHandler(definitionType: string, fn: CustomHandlerCallback): void;
52
+ getComponentHandler(definitionType: string): CustomHandlerCallback | undefined;
49
53
  dispose(): void;
50
54
  }
@@ -0,0 +1,36 @@
1
+ import { EventSubscriptionCancellation } from '@webprovisions/platform';
2
+ import { Breakpoints, ComponentSettings, ViewDefinition, WidgetSettings } from '../types';
3
+ import { ComponentNode, ComponentNodeContext, ComponentNodeLayout, ComponentNodeProperties } from './component-node';
4
+ import { ComponentPlatform } from './component-platform';
5
+ declare type ComponentReference = string | [string, ...ComponentReferenceOverride[]];
6
+ declare type ComponentReferenceOverride = {
7
+ breakpoints?: Breakpoints;
8
+ tags?: string[];
9
+ context?: ComponentNodeContext;
10
+ properties?: ComponentNodeProperties;
11
+ layout?: ComponentNodeLayout;
12
+ };
13
+ export declare type NormalizedComponentReference = {
14
+ definitionId: string;
15
+ overrides: ComponentReferenceOverride[];
16
+ };
17
+ export declare const normalizeReference: (reference: ComponentReference) => NormalizedComponentReference;
18
+ export declare type ComponentHandlerOptions = {
19
+ platform: ComponentPlatform;
20
+ node: ComponentNode;
21
+ references: ComponentReference[];
22
+ definitions: {
23
+ [name: string]: ComponentSettings;
24
+ };
25
+ views: {
26
+ [key: string]: ViewDefinition;
27
+ };
28
+ branch?: string;
29
+ };
30
+ export declare const createChildren: (platform: ComponentPlatform, node: ComponentNode, references: ComponentReference[], definitions: {
31
+ [name: string]: ComponentSettings;
32
+ }, views: {
33
+ [key: string]: ViewDefinition;
34
+ }, branch?: string | undefined) => void;
35
+ export declare const createComponentModel: (platform: ComponentPlatform, settings: WidgetSettings) => EventSubscriptionCancellation;
36
+ export {};
@@ -0,0 +1,21 @@
1
+ import { ComponentReference, ComponentSettings, ViewDefinition } from '../types';
2
+ import { ComponentNode } from './component-node';
3
+ import { ComponentPlatform } from './component-platform';
4
+ import { NormalizedComponentReference } from './create-component-model';
5
+ export declare type CustomHandlerCallback = (ref: NormalizedComponentReference, options: {
6
+ platform: ComponentPlatform;
7
+ node: ComponentNode;
8
+ references: ComponentReference[];
9
+ definitions: {
10
+ [name: string]: ComponentSettings;
11
+ };
12
+ views: {
13
+ [key: string]: ViewDefinition;
14
+ };
15
+ branch?: string;
16
+ }) => void;
17
+ export declare class CustomComponentHandler {
18
+ private handlers;
19
+ add(name: string, fn: CustomHandlerCallback): void;
20
+ get(name: string): CustomHandlerCallback | undefined;
21
+ }
@@ -1,6 +1,7 @@
1
1
  export { ActionsController } from './actions-controller';
2
2
  export type { WatchActionDelegate } from './actions-controller';
3
3
  export type { ChangesetProvider } from './changeset-provider';
4
+ export { default as componentConfigurationApi } from './component-configuration-api';
4
5
  export { AbstractComponentController, ComponentNodeController } from './component-controller';
5
6
  export { ComponentNode } from './component-node';
6
7
  export type { ChangesetOptions, ComponentNodeAttributes, ComponentNodeContext, ComponentNodeLayout, ComponentNodeProperties, ComponentNodeSettings, Size, } from './component-node';
@@ -8,7 +9,8 @@ export { ComponentPlatform } from './component-platform';
8
9
  export type { SwitchMap } from './component-platform';
9
10
  export { ComponentQuery } from './component-query';
10
11
  export type { ComponentQueryRule } from './component-query';
11
- export { createComponentModel } from './create-component-model';
12
+ export { createChildren, createComponentModel } from './create-component-model';
13
+ export type { ComponentHandlerOptions, NormalizedComponentReference, } from './create-component-model';
12
14
  export { asDescriptor } from './descriptor';
13
15
  export type { ComponentDescriptor } from './descriptor';
14
16
  export { extendComponent } from './extend-component';
File without changes
File without changes
@@ -0,0 +1,8 @@
1
+ export { default as ActionResolver } from './action-resolver';
2
+ export { ActionsController, asDescriptor, componentConfigurationApi, ComponentNode, ComponentNodeController, ComponentPlatform, ComponentQuery, createChildren, createComponentModel, extendComponent, findComponent, findVisibleComponents, traverseComponents, } from './component-platform';
3
+ export type { ChangesetOptions, ChangesetProvider, ComponentDescriptor, ComponentHandlerOptions, ComponentNodeAttributes, ComponentNodeContext, ComponentNodeLayout, ComponentNodeProperties, ComponentNodeSettings, ComponentQueryRule, ExtendComponentHandler, ExtendComponentOptions, NormalizedComponentReference, Size, SwitchMap, WatchActionDelegate, } from './component-platform';
4
+ export { default as ComponentResolver } from './component-resolver';
5
+ export type { ReactComponent } from './component-resolver';
6
+ export { createEventSubscriber } from './event-subscriber';
7
+ export type { SubscribeDelegate } from './event-subscriber';
8
+ export * from './types';