@rulecms/widget-angular 0.1.0

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/LICENSE +7 -0
  2. package/README.md +125 -0
  3. package/fesm2022/rulecms-widget-angular.mjs +3465 -0
  4. package/fesm2022/rulecms-widget-angular.mjs.map +1 -0
  5. package/index.d.ts +6 -0
  6. package/lib/fetch/fetch-rule-cms-widget.d.ts +23 -0
  7. package/lib/fetch/fetch-rule-cms-widget.d.ts.map +1 -0
  8. package/lib/fetch/resolve-widget-libraries.d.ts +16 -0
  9. package/lib/fetch/resolve-widget-libraries.d.ts.map +1 -0
  10. package/lib/helpers/background-image-types.d.ts +24 -0
  11. package/lib/helpers/background-image-types.d.ts.map +1 -0
  12. package/lib/helpers/border-types.d.ts +22 -0
  13. package/lib/helpers/border-types.d.ts.map +1 -0
  14. package/lib/helpers/box-shadow-types.d.ts +25 -0
  15. package/lib/helpers/box-shadow-types.d.ts.map +1 -0
  16. package/lib/helpers/box-spacing-style-attribute-entries.d.ts +4 -0
  17. package/lib/helpers/box-spacing-style-attribute-entries.d.ts.map +1 -0
  18. package/lib/helpers/box-spacing-types.d.ts +31 -0
  19. package/lib/helpers/box-spacing-types.d.ts.map +1 -0
  20. package/lib/helpers/cloudinary-image-url.d.ts +20 -0
  21. package/lib/helpers/cloudinary-image-url.d.ts.map +1 -0
  22. package/lib/helpers/collect-component-instance-paths.d.ts +16 -0
  23. package/lib/helpers/collect-component-instance-paths.d.ts.map +1 -0
  24. package/lib/helpers/constants.d.ts +5 -0
  25. package/lib/helpers/constants.d.ts.map +1 -0
  26. package/lib/helpers/css-classes.d.ts +13 -0
  27. package/lib/helpers/css-classes.d.ts.map +1 -0
  28. package/lib/helpers/css-color-types.d.ts +18 -0
  29. package/lib/helpers/css-color-types.d.ts.map +1 -0
  30. package/lib/helpers/css-enum-types.d.ts +41 -0
  31. package/lib/helpers/css-enum-types.d.ts.map +1 -0
  32. package/lib/helpers/css-variable-types.d.ts +33 -0
  33. package/lib/helpers/css-variable-types.d.ts.map +1 -0
  34. package/lib/helpers/derive-display-flex-if-needed.d.ts +13 -0
  35. package/lib/helpers/derive-display-flex-if-needed.d.ts.map +1 -0
  36. package/lib/helpers/format-background-image-styles.d.ts +12 -0
  37. package/lib/helpers/format-background-image-styles.d.ts.map +1 -0
  38. package/lib/helpers/format-border-styles.d.ts +9 -0
  39. package/lib/helpers/format-border-styles.d.ts.map +1 -0
  40. package/lib/helpers/format-box-shadow-styles.d.ts +8 -0
  41. package/lib/helpers/format-box-shadow-styles.d.ts.map +1 -0
  42. package/lib/helpers/format-box-spacing-styles.d.ts +11 -0
  43. package/lib/helpers/format-box-spacing-styles.d.ts.map +1 -0
  44. package/lib/helpers/format-css-color-styles.d.ts +8 -0
  45. package/lib/helpers/format-css-color-styles.d.ts.map +1 -0
  46. package/lib/helpers/format-css-enum-styles.d.ts +7 -0
  47. package/lib/helpers/format-css-enum-styles.d.ts.map +1 -0
  48. package/lib/helpers/format-css-length-styles.d.ts +9 -0
  49. package/lib/helpers/format-css-length-styles.d.ts.map +1 -0
  50. package/lib/helpers/format-line-height-styles.d.ts +8 -0
  51. package/lib/helpers/format-line-height-styles.d.ts.map +1 -0
  52. package/lib/helpers/format-opacity-styles.d.ts +8 -0
  53. package/lib/helpers/format-opacity-styles.d.ts.map +1 -0
  54. package/lib/helpers/format-spacing-side-value.d.ts +4 -0
  55. package/lib/helpers/format-spacing-side-value.d.ts.map +1 -0
  56. package/lib/helpers/get-column-attributes.d.ts +26 -0
  57. package/lib/helpers/get-column-attributes.d.ts.map +1 -0
  58. package/lib/helpers/get-component-attributes-and-styles.d.ts +23 -0
  59. package/lib/helpers/get-component-attributes-and-styles.d.ts.map +1 -0
  60. package/lib/helpers/get-default-dimension-attributes.d.ts +9 -0
  61. package/lib/helpers/get-default-dimension-attributes.d.ts.map +1 -0
  62. package/lib/helpers/get-device-type-based-attributes.d.ts +10 -0
  63. package/lib/helpers/get-device-type-based-attributes.d.ts.map +1 -0
  64. package/lib/helpers/get-merged-attributes.d.ts +11 -0
  65. package/lib/helpers/get-merged-attributes.d.ts.map +1 -0
  66. package/lib/helpers/has-items.d.ts +3 -0
  67. package/lib/helpers/has-items.d.ts.map +1 -0
  68. package/lib/helpers/index.d.ts +40 -0
  69. package/lib/helpers/index.d.ts.map +1 -0
  70. package/lib/helpers/line-height-types.d.ts +12 -0
  71. package/lib/helpers/line-height-types.d.ts.map +1 -0
  72. package/lib/helpers/object-style-attribute-registry.d.ts +44 -0
  73. package/lib/helpers/object-style-attribute-registry.d.ts.map +1 -0
  74. package/lib/helpers/opacity-types.d.ts +9 -0
  75. package/lib/helpers/opacity-types.d.ts.map +1 -0
  76. package/lib/helpers/resolve-row-styles.d.ts +23 -0
  77. package/lib/helpers/resolve-row-styles.d.ts.map +1 -0
  78. package/lib/helpers/resolve-widget-container-styles.d.ts +55 -0
  79. package/lib/helpers/resolve-widget-container-styles.d.ts.map +1 -0
  80. package/lib/helpers/resolve-widget-instance-props.d.ts +18 -0
  81. package/lib/helpers/resolve-widget-instance-props.d.ts.map +1 -0
  82. package/lib/helpers/types.d.ts +131 -0
  83. package/lib/helpers/types.d.ts.map +1 -0
  84. package/lib/helpers/warn-unmatched-component-props.d.ts +30 -0
  85. package/lib/helpers/warn-unmatched-component-props.d.ts.map +1 -0
  86. package/lib/helpers-display/dimension-wrapper-styles.d.ts +7 -0
  87. package/lib/helpers-display/dimension-wrapper-styles.d.ts.map +1 -0
  88. package/lib/helpers-display/resolve-no-container.d.ts +14 -0
  89. package/lib/helpers-display/resolve-no-container.d.ts.map +1 -0
  90. package/lib/helpers-display/resolve-renders-own-element.d.ts +15 -0
  91. package/lib/helpers-display/resolve-renders-own-element.d.ts.map +1 -0
  92. package/lib/id-utils/collection-col-type-prefix.d.ts +2 -0
  93. package/lib/id-utils/collection-col-type-prefix.d.ts.map +1 -0
  94. package/lib/id-utils/dev-client-token.d.ts +33 -0
  95. package/lib/id-utils/dev-client-token.d.ts.map +1 -0
  96. package/lib/id-utils/drag-item-id-helper.d.ts +9 -0
  97. package/lib/id-utils/drag-item-id-helper.d.ts.map +1 -0
  98. package/lib/id-utils/get-collection-id-for-collection-type.d.ts +2 -0
  99. package/lib/id-utils/get-collection-id-for-collection-type.d.ts.map +1 -0
  100. package/lib/id-utils/get-name-and-instance-id-from-widget-key.d.ts +6 -0
  101. package/lib/id-utils/get-name-and-instance-id-from-widget-key.d.ts.map +1 -0
  102. package/lib/id-utils/get-name-for-widget-key.d.ts +5 -0
  103. package/lib/id-utils/get-name-for-widget-key.d.ts.map +1 -0
  104. package/lib/id-utils/get-widget-key-for-collection.d.ts +16 -0
  105. package/lib/id-utils/get-widget-key-for-collection.d.ts.map +1 -0
  106. package/lib/id-utils/index.d.ts +11 -0
  107. package/lib/id-utils/index.d.ts.map +1 -0
  108. package/lib/id-utils/published-key-utilities.d.ts +24 -0
  109. package/lib/id-utils/published-key-utilities.d.ts.map +1 -0
  110. package/lib/id-utils/types.d.ts +25 -0
  111. package/lib/id-utils/types.d.ts.map +1 -0
  112. package/lib/id-utils/version-utilities.d.ts +7 -0
  113. package/lib/id-utils/version-utilities.d.ts.map +1 -0
  114. package/lib/library-registry/ComponentLibraryRegistry.d.ts +17 -0
  115. package/lib/library-registry/ComponentLibraryRegistry.d.ts.map +1 -0
  116. package/lib/library-registry/collect-referenced-library-ids.d.ts +20 -0
  117. package/lib/library-registry/collect-referenced-library-ids.d.ts.map +1 -0
  118. package/lib/library-registry/index.d.ts +5 -0
  119. package/lib/library-registry/index.d.ts.map +1 -0
  120. package/lib/library-registry/resolve-key.d.ts +16 -0
  121. package/lib/library-registry/resolve-key.d.ts.map +1 -0
  122. package/lib/library-registry/types.d.ts +142 -0
  123. package/lib/library-registry/types.d.ts.map +1 -0
  124. package/lib/provider/rule-cms-widget-context.service.d.ts +11 -0
  125. package/lib/provider/rule-cms-widget-context.service.d.ts.map +1 -0
  126. package/lib/provider/rule-cms-widget-provider.component.d.ts +26 -0
  127. package/lib/provider/rule-cms-widget-provider.component.d.ts.map +1 -0
  128. package/lib/render/breakpoint-variant-render.component.d.ts +21 -0
  129. package/lib/render/breakpoint-variant-render.component.d.ts.map +1 -0
  130. package/lib/render/breakpoint-variant-styles.d.ts +2 -0
  131. package/lib/render/breakpoint-variant-styles.d.ts.map +1 -0
  132. package/lib/render/display-component.component.d.ts +27 -0
  133. package/lib/render/display-component.component.d.ts.map +1 -0
  134. package/lib/render/display-device-type.d.ts +5 -0
  135. package/lib/render/display-device-type.d.ts.map +1 -0
  136. package/lib/render/embed-in-row.component.d.ts +21 -0
  137. package/lib/render/embed-in-row.component.d.ts.map +1 -0
  138. package/lib/render/embed-in-vertical-container.component.d.ts +24 -0
  139. package/lib/render/embed-in-vertical-container.component.d.ts.map +1 -0
  140. package/lib/render/get-components-plugin-from-plugins.d.ts +11 -0
  141. package/lib/render/get-components-plugin-from-plugins.d.ts.map +1 -0
  142. package/lib/render/has-device-divergent-values.d.ts +6 -0
  143. package/lib/render/has-device-divergent-values.d.ts.map +1 -0
  144. package/lib/render/render-components-for-device.component.d.ts +20 -0
  145. package/lib/render/render-components-for-device.component.d.ts.map +1 -0
  146. package/lib/render/render-components-inner.component.d.ts +33 -0
  147. package/lib/render/render-components-inner.component.d.ts.map +1 -0
  148. package/lib/render/render-components.component.d.ts +26 -0
  149. package/lib/render/render-components.component.d.ts.map +1 -0
  150. package/lib/render/types.d.ts +43 -0
  151. package/lib/render/types.d.ts.map +1 -0
  152. package/lib/widget/prepare-rule-cms-widget-data.d.ts +4 -0
  153. package/lib/widget/prepare-rule-cms-widget-data.d.ts.map +1 -0
  154. package/lib/widget/resolve-source-components-plugin.d.ts +19 -0
  155. package/lib/widget/resolve-source-components-plugin.d.ts.map +1 -0
  156. package/lib/widget/rule-cms-widget.component.d.ts +66 -0
  157. package/lib/widget/rule-cms-widget.component.d.ts.map +1 -0
  158. package/lib/widget/rule-cms-widget.styles.d.ts +9 -0
  159. package/lib/widget/rule-cms-widget.styles.d.ts.map +1 -0
  160. package/lib/widget/widget-data.types.d.ts +47 -0
  161. package/lib/widget/widget-data.types.d.ts.map +1 -0
  162. package/package.json +43 -0
  163. package/public-api.d.ts +22 -0
  164. package/public-api.d.ts.map +1 -0
  165. package/rulecms-widget-angular.d.ts.map +1 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"render-components-inner.component.d.ts","sourceRoot":"","sources":["../../../src/lib/render/render-components-inner.component.ts"],"names":[],"mappings":"AACA,OAAO,EACL,iBAAiB,EACjB,iBAAiB,EAEjB,kBAAkB,EAClB,KAAK,EACL,gBAAgB,EACjB,MAAM,kBAAkB,CAAC;AAI1B,OAAO,EAAE,sBAAsB,EAAE,MAAM,SAAS,CAAC;;AAKjD,qBAqDa,8BAA8B;IACd,eAAe,EAAG,KAAK,CAAC;IAC1C,aAAa,UAAS;IACtB,kBAAkB,UAAS;IACT,iBAAiB,EAAG;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,gBAAgB,CAAA;KAAE,CAAC;IAC1E,kBAAkB,UAAS;IAC3B,sBAAsB,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,EAAG,sBAAsB,CAAC;IACjC,iBAAiB,EAAG,MAAM,OAAO,kBAAkB,CAAC;IACtE,cAAc,CAAC,EAAE,iBAAiB,CAAC;IACnC,iBAAiB,CAAC,EAAE,MAAM,EAAE,CAAC;IAEtC,IAAI,UAAU,4EAEb;IAED,kBAAkB,CAAC,GAAG,EAAE,iBAAiB,GAAG,OAAO;IAqBnD,UAAU,CAAC,GAAG,EAAE,iBAAiB,GAAG;QAClC,mBAAmB,CAAC,EAAE;YAAE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;SAAE,CAAC;QAC7C,UAAU,CAAC,EAAE;YAAE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;SAAE,CAAC;KACrC;IAaD,aAAa,CAAC,GAAG,EAAE,iBAAiB,GAAG,KAAK,GAAG,IAAI;IAiBnD,gBAAgB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,EAAE;IAI5C,aAAa,CAAC,QAAQ,EAAE,MAAM;yCA1EnB,8BAA8B;2CAA9B,8BAA8B;CAiF1C"}
@@ -0,0 +1,26 @@
1
+ import { OnDestroy, OnInit } from '@angular/core';
2
+ import { ComponentPropsMap, DeviceDisplayTypes, Items, WidgetCollection } from '../helpers/types';
3
+ import { RenderComponentPlugins } from './types';
4
+ import * as i0 from "@angular/core";
5
+ export declare class RenderComponentsComponent implements OnInit, OnDestroy {
6
+ displayItemList: Items;
7
+ isComposeMode: boolean;
8
+ isWithinCollection: boolean;
9
+ widgetCollections: {
10
+ [key: string]: WidgetCollection;
11
+ };
12
+ showDropContainers: boolean;
13
+ reduxDeviceDisplayType?: string;
14
+ plugins: RenderComponentPlugins;
15
+ componentProps?: ComponentPropsMap;
16
+ deviceDisplayType: keyof typeof DeviceDisplayTypes;
17
+ private phoneQuery?;
18
+ private tabletQuery?;
19
+ private readonly onChange;
20
+ ngOnInit(): void;
21
+ ngOnDestroy(): void;
22
+ private updateDeviceType;
23
+ static ɵfac: i0.ɵɵFactoryDeclaration<RenderComponentsComponent, never>;
24
+ static ɵcmp: i0.ɵɵComponentDeclaration<RenderComponentsComponent, "rulecms-render-components", never, { "displayItemList": { "alias": "displayItemList"; "required": true; }; "isComposeMode": { "alias": "isComposeMode"; "required": false; }; "isWithinCollection": { "alias": "isWithinCollection"; "required": false; }; "widgetCollections": { "alias": "widgetCollections"; "required": true; }; "showDropContainers": { "alias": "showDropContainers"; "required": false; }; "reduxDeviceDisplayType": { "alias": "reduxDeviceDisplayType"; "required": false; }; "plugins": { "alias": "plugins"; "required": true; }; "componentProps": { "alias": "componentProps"; "required": false; }; }, {}, never, never, true, never>;
25
+ }
26
+ //# sourceMappingURL=render-components.component.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"render-components.component.d.ts","sourceRoot":"","sources":["../../../src/lib/render/render-components.component.ts"],"names":[],"mappings":"AAAA,OAAO,EAAoB,SAAS,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AACpE,OAAO,EACL,iBAAiB,EACjB,kBAAkB,EAClB,KAAK,EACL,gBAAgB,EACjB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,sBAAsB,EAAE,MAAM,SAAS,CAAC;;AAIjD,qBAmBa,yBAA0B,YAAW,MAAM,EAAE,SAAS;IACtC,eAAe,EAAG,KAAK,CAAC;IAC1C,aAAa,UAAS;IACtB,kBAAkB,UAAS;IACT,iBAAiB,EAAG;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,gBAAgB,CAAA;KAAE,CAAC;IAC1E,kBAAkB,UAAS;IAC3B,sBAAsB,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,EAAG,sBAAsB,CAAC;IACnD,cAAc,CAAC,EAAE,iBAAiB,CAAC;IAE5C,iBAAiB,EAAE,MAAM,OAAO,kBAAkB,CAAa;IAE/D,OAAO,CAAC,UAAU,CAAC,CAAiB;IACpC,OAAO,CAAC,WAAW,CAAC,CAAiB;IACrC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAiC;IAE1D,QAAQ,IAAI,IAAI;IAUhB,WAAW,IAAI,IAAI;IAKnB,OAAO,CAAC,gBAAgB;yCA/Bb,yBAAyB;2CAAzB,yBAAyB;CAsCrC"}
@@ -0,0 +1,43 @@
1
+ import type { ComponentPropsMap, DisplayItemColumn, Items, WidgetCollection, DeviceDisplayTypes } from '../helpers/types';
2
+ import type { SourceComponentsPlugin } from '../library-registry/types';
3
+ export interface RenderDroppableBoxProps {
4
+ col: DisplayItemColumn;
5
+ rowLength: number;
6
+ colLength: number;
7
+ isLastRow?: boolean;
8
+ isFirstCol?: boolean;
9
+ isLastCol?: boolean;
10
+ showDropContainers: boolean;
11
+ }
12
+ export interface ComponentWrapperForComposableModeProps {
13
+ id: string;
14
+ containerId: string;
15
+ componentType: string;
16
+ styleProps: {
17
+ [key: string]: any;
18
+ } | undefined;
19
+ }
20
+ export interface EditPlugin {
21
+ RenderDroppableBox: unknown;
22
+ ComponentWrapperForComposableMode: unknown;
23
+ }
24
+ export interface RenderComponentPlugins {
25
+ edit?: EditPlugin;
26
+ sourceComponents?: SourceComponentsPlugin;
27
+ }
28
+ export type RenderComponentsContext = {
29
+ displayItemList: Items;
30
+ isComposeMode: boolean;
31
+ isWithinCollection: boolean;
32
+ widgetCollections: {
33
+ [key: string]: WidgetCollection;
34
+ };
35
+ showDropContainers: boolean;
36
+ reduxDeviceDisplayType?: string;
37
+ plugins: RenderComponentPlugins;
38
+ editPluginComponents: any;
39
+ deviceDisplayType: keyof typeof DeviceDisplayTypes;
40
+ componentProps?: ComponentPropsMap;
41
+ ancestorColumnIds?: string[];
42
+ };
43
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/lib/render/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,iBAAiB,EACjB,iBAAiB,EACjB,KAAK,EACL,gBAAgB,EAChB,kBAAkB,EACnB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,2BAA2B,CAAC;AAExE,MAAM,WAAW,uBAAuB;IACtC,GAAG,EAAE,iBAAiB,CAAC;IACvB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,kBAAkB,EAAE,OAAO,CAAC;CAC7B;AAED,MAAM,WAAW,sCAAsC;IACrD,EAAE,EAAE,MAAM,CAAC;IACX,WAAW,EAAE,MAAM,CAAC;IACpB,aAAa,EAAE,MAAM,CAAC;IACtB,UAAU,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;KAAE,GAAG,SAAS,CAAC;CAChD;AAED,MAAM,WAAW,UAAU;IACzB,kBAAkB,EAAE,OAAO,CAAC;IAC5B,iCAAiC,EAAE,OAAO,CAAC;CAC5C;AAED,MAAM,WAAW,sBAAsB;IACrC,IAAI,CAAC,EAAE,UAAU,CAAC;IAClB,gBAAgB,CAAC,EAAE,sBAAsB,CAAC;CAC3C;AAED,MAAM,MAAM,uBAAuB,GAAG;IACpC,eAAe,EAAE,KAAK,CAAC;IACvB,aAAa,EAAE,OAAO,CAAC;IACvB,kBAAkB,EAAE,OAAO,CAAC;IAC5B,iBAAiB,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,gBAAgB,CAAA;KAAE,CAAC;IACvD,kBAAkB,EAAE,OAAO,CAAC;IAC5B,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAChC,OAAO,EAAE,sBAAsB,CAAC;IAChC,oBAAoB,EAAE,GAAG,CAAC;IAC1B,iBAAiB,EAAE,MAAM,OAAO,kBAAkB,CAAC;IACnD,cAAc,CAAC,EAAE,iBAAiB,CAAC;IACnC,iBAAiB,CAAC,EAAE,MAAM,EAAE,CAAC;CAC9B,CAAC"}
@@ -0,0 +1,4 @@
1
+ import { RuleCMSWidgetData, RuleCMSWidgetRawData } from './widget-data.types';
2
+ /** Transform raw widget API data into render-ready displayItemList + collections. */
3
+ export declare function prepareRuleCMSWidgetData(raw: RuleCMSWidgetRawData): RuleCMSWidgetData;
4
+ //# sourceMappingURL=prepare-rule-cms-widget-data.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"prepare-rule-cms-widget-data.d.ts","sourceRoot":"","sources":["../../../src/lib/widget/prepare-rule-cms-widget-data.ts"],"names":[],"mappings":"AACA,OAAO,EACL,iBAAiB,EACjB,oBAAoB,EAGrB,MAAM,qBAAqB,CAAC;AAoC7B,qFAAqF;AACrF,wBAAgB,wBAAwB,CACtC,GAAG,EAAE,oBAAoB,GACxB,iBAAiB,CAMnB"}
@@ -0,0 +1,19 @@
1
+ import type { ComponentLibraryRegistry, LibraryRegistrationMap, SourceComponentsPlugin } from '../library-registry/types';
2
+ import type { Items, WidgetCollection } from '../helpers/types';
3
+ export declare function resolveSourceComponentsPluginSync(params: {
4
+ displayItemList: Items | undefined;
5
+ widgetCollections: {
6
+ [key: string]: WidgetCollection;
7
+ } | undefined;
8
+ libraries?: LibraryRegistrationMap;
9
+ registry?: ComponentLibraryRegistry;
10
+ }): SourceComponentsPlugin | null;
11
+ export declare function resolveSourceComponentsPlugin(params: {
12
+ displayItemList: Items | undefined;
13
+ widgetCollections: {
14
+ [key: string]: WidgetCollection;
15
+ } | undefined;
16
+ libraries?: LibraryRegistrationMap;
17
+ registry?: ComponentLibraryRegistry;
18
+ }): Promise<SourceComponentsPlugin>;
19
+ //# sourceMappingURL=resolve-source-components-plugin.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resolve-source-components-plugin.d.ts","sourceRoot":"","sources":["../../../src/lib/widget/resolve-source-components-plugin.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EACV,wBAAwB,EACxB,sBAAsB,EACtB,sBAAsB,EACvB,MAAM,2BAA2B,CAAC;AACnC,OAAO,KAAK,EAAE,KAAK,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAEhE,wBAAgB,iCAAiC,CAAC,MAAM,EAAE;IACxD,eAAe,EAAE,KAAK,GAAG,SAAS,CAAC;IACnC,iBAAiB,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,gBAAgB,CAAA;KAAE,GAAG,SAAS,CAAC;IACnE,SAAS,CAAC,EAAE,sBAAsB,CAAC;IACnC,QAAQ,CAAC,EAAE,wBAAwB,CAAC;CACrC,GAAG,sBAAsB,GAAG,IAAI,CAOhC;AAED,wBAAgB,6BAA6B,CAAC,MAAM,EAAE;IACpD,eAAe,EAAE,KAAK,GAAG,SAAS,CAAC;IACnC,iBAAiB,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,gBAAgB,CAAA;KAAE,GAAG,SAAS,CAAC;IACnE,SAAS,CAAC,EAAE,sBAAsB,CAAC;IACnC,QAAQ,CAAC,EAAE,wBAAwB,CAAC;CACrC,GAAG,OAAO,CAAC,sBAAsB,CAAC,CAOlC"}
@@ -0,0 +1,66 @@
1
+ import { ErrorHandler, OnChanges, OnDestroy, OnInit, SimpleChanges } from '@angular/core';
2
+ import type { LibraryRegistrationMap } from '../library-registry/types';
3
+ import type { ComponentPropsMap } from '../helpers/types';
4
+ import { RuleCMSWidgetContextService } from '../provider/rule-cms-widget-context.service';
5
+ import type { RenderComponentPlugins } from '../render/types';
6
+ import type { SourceComponentsPlugin } from '../library-registry/types';
7
+ import type { RuleCMSWidgetData } from './widget-data.types';
8
+ import * as i0 from "@angular/core";
9
+ export declare class RuleCMSWidgetComponent implements OnInit, OnChanges, OnDestroy {
10
+ private readonly context;
11
+ private readonly errorHandler;
12
+ /**
13
+ * Staging/production: published key (`{environmentId}---{widgetKey}`).
14
+ * Development (`dev.` token): the live widget key itself (`widget-...`).
15
+ */
16
+ publishedKey: string;
17
+ /** Optional token for direct usage without a provider. */
18
+ token?: string;
19
+ /** Optional API origin override. */
20
+ endpoint?: string;
21
+ /**
22
+ * `'client-fetch'` (default) fetches in the browser.
23
+ * `'pre-fetched'` renders `initialData` with CSS breakpoint variants.
24
+ */
25
+ mode: 'client-fetch' | 'pre-fetched';
26
+ /** Required when `mode` is `'pre-fetched'`. */
27
+ initialData?: RuleCMSWidgetData;
28
+ /**
29
+ * Component library registrations for this widget (overrides the provider's
30
+ * map when both are set).
31
+ */
32
+ libraries?: LibraryRegistrationMap;
33
+ /**
34
+ * Extra props for individual component instances, keyed by column id.
35
+ * `r-button` reads `onClick` from the bag.
36
+ */
37
+ componentProps?: ComponentPropsMap;
38
+ readonly publishedKeyAttribute = "data-rulecms-published-key";
39
+ readonly loadingContainerStyle: Record<string, string>;
40
+ readonly spinnerContainerStyle: Record<string, string>;
41
+ readonly spinnerStyle: Record<string, string>;
42
+ readonly errorContainerStyle: Record<string, string>;
43
+ readonly errorTitleStyle: Record<string, string>;
44
+ readonly errorMessageStyle: Record<string, string>;
45
+ loading: boolean;
46
+ error: string | null;
47
+ preparedData: RuleCMSWidgetData | null;
48
+ sourceComponentsPlugin: SourceComponentsPlugin | null;
49
+ useBreakpointVariants: boolean;
50
+ private abortController;
51
+ private lastFetchKey;
52
+ private stylesInjected;
53
+ constructor(context: RuleCMSWidgetContextService | null, errorHandler: ErrorHandler | null);
54
+ get plugins(): RenderComponentPlugins;
55
+ ngOnInit(): void;
56
+ ngOnChanges(_changes: SimpleChanges): void;
57
+ ngOnDestroy(): void;
58
+ private syncFromInputs;
59
+ private resolveLibraries;
60
+ private warnUnmatched;
61
+ private fetchClient;
62
+ private ensureSpinnerStyles;
63
+ static ɵfac: i0.ɵɵFactoryDeclaration<RuleCMSWidgetComponent, [{ optional: true; }, { optional: true; }]>;
64
+ static ɵcmp: i0.ɵɵComponentDeclaration<RuleCMSWidgetComponent, "rulecms-widget", never, { "publishedKey": { "alias": "publishedKey"; "required": true; }; "token": { "alias": "token"; "required": false; }; "endpoint": { "alias": "endpoint"; "required": false; }; "mode": { "alias": "mode"; "required": false; }; "initialData": { "alias": "initialData"; "required": false; }; "libraries": { "alias": "libraries"; "required": false; }; "componentProps": { "alias": "componentProps"; "required": false; }; }, {}, never, never, true, never>;
65
+ }
66
+ //# sourceMappingURL=rule-cms-widget.component.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rule-cms-widget.component.d.ts","sourceRoot":"","sources":["../../../src/lib/widget/rule-cms-widget.component.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,YAAY,EAGZ,SAAS,EACT,SAAS,EACT,MAAM,EAEN,aAAa,EACd,MAAM,eAAe,CAAC;AAEvB,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,2BAA2B,CAAC;AACxE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAG1D,OAAO,EAAE,2BAA2B,EAAE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S;gBAGA,OAAO,EAAE,2BAA2B,GAAG,IAAI,EACrB,YAAY,EAAE,YAAY,GAAG,IAAI;IAGtF,IAAI,OAAO,IAAI,sBAAsB,CAEpC;IAED,QAAQ,IAAI,IAAI;IAIhB,WAAW,CAAC,QAAQ,EAAE,aAAa,GAAG,IAAI;IAI1C,WAAW,IAAI,IAAI;IAInB,OAAO,CAAC,cAAc;IAgBtB,OAAO,CAAC,gBAAgB;IAgCxB,OAAO,CAAC,aAAa;IAYrB,OAAO,CAAC,WAAW;IAkEnB,OAAO,CAAC,mBAAmB;yCAjMhB,sBAAsB;2CAAtB,sBAAsB;CA8MlC"}
@@ -0,0 +1,9 @@
1
+ export declare const loadingContainerStyle: Record<string, string>;
2
+ export declare const spinnerContainerStyle: Record<string, string>;
3
+ export declare const spinnerStyle: Record<string, string>;
4
+ export declare const errorContainerStyle: Record<string, string>;
5
+ export declare const errorTitleStyle: Record<string, string>;
6
+ export declare const errorMessageStyle: Record<string, string>;
7
+ export declare const globalStyles = "\n @keyframes spin {\n from {\n transform: rotate(0deg);\n }\n to {\n transform: rotate(360deg);\n }\n }\n";
8
+ export declare const RULECMS_PUBLISHED_KEY_ATTRIBUTE = "data-rulecms-published-key";
9
+ //# sourceMappingURL=rule-cms-widget.styles.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rule-cms-widget.styles.d.ts","sourceRoot":"","sources":["../../../src/lib/widget/rule-cms-widget.styles.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,qBAAqB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAMxD,CAAC;AAEF,eAAO,MAAM,qBAAqB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAIxD,CAAC;AAEF,eAAO,MAAM,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAO/C,CAAC;AAEF,eAAO,MAAM,mBAAmB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAMtD,CAAC;AAEF,eAAO,MAAM,eAAe,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAKlD,CAAC;AAEF,eAAO,MAAM,iBAAiB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAGpD,CAAC;AAEF,eAAO,MAAM,YAAY,uIASxB,CAAC;AAEF,eAAO,MAAM,+BAA+B,+BAA+B,CAAC"}
@@ -0,0 +1,47 @@
1
+ import { Items, WidgetCollection } from '../helpers/types';
2
+ import { ConfigLibrariesMap } from '../library-registry/types';
3
+ export interface WidgetData {
4
+ publishedKey: string;
5
+ name: string;
6
+ version: string;
7
+ environmentName: string;
8
+ itemList: string;
9
+ tagName?: string;
10
+ tagDescription?: string;
11
+ lastPublishedAt: string;
12
+ }
13
+ export interface ChildCollection {
14
+ publishedKey: string;
15
+ name: string;
16
+ version: string;
17
+ environmentName: string;
18
+ itemList: string;
19
+ tagName?: string;
20
+ tagDescription?: string;
21
+ lastPublishedAt: string;
22
+ }
23
+ export interface GetRuleCMSWidgetResponse {
24
+ success: boolean;
25
+ data: {
26
+ widget: WidgetData;
27
+ childCollections: {
28
+ [key: string]: ChildCollection;
29
+ };
30
+ libraries?: ConfigLibrariesMap;
31
+ };
32
+ }
33
+ export interface RuleCMSWidgetData {
34
+ displayItemList: Items;
35
+ widgetCollections: {
36
+ [key: string]: WidgetCollection;
37
+ };
38
+ libraries?: ConfigLibrariesMap;
39
+ }
40
+ export interface RuleCMSWidgetRawData {
41
+ widget: WidgetData;
42
+ childCollections: {
43
+ [key: string]: ChildCollection;
44
+ };
45
+ libraries?: ConfigLibrariesMap;
46
+ }
47
+ //# sourceMappingURL=widget-data.types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"widget-data.types.d.ts","sourceRoot":"","sources":["../../../src/lib/widget/widget-data.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAC3D,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAE/D,M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"version": "0.1.0",
4
+ "description": "Angular widget component for RuleCMS — the Angular counterpart of @rulecms/widget-react",
5
+ "license": "UNLICENSED",
6
+ "author": "RuleCMS, LLC",
7
+ "keywords": [
8
+ "rulecms",
9
+ "widget",
10
+ "angular",
11
+ "cms"
12
+ ],
13
+ "repository": {
14
+ "type": "git",
15
+ "url": "git+https://github.com/rulecms/widget-angular.git"
16
+ },
17
+ "sideEffects": false,
18
+ "private": false,
19
+ "peerDependencies": {
20
+ "@angular/common": ">=17.0.0",
21
+ "@angular/core": ">=17.0.0"
22
+ },
23
+ "publishConfig": {
24
+ "access": "public"
25
+ },
26
+ "engines": {
27
+ "node": ">=18.0.0"
28
+ },
29
+ "module": "fesm2022/rulecms-widget-angular.mjs",
30
+ "typings": "index.d.ts",
31
+ "exports": {
32
+ "./package.json": {
33
+ "default": "./package.json"
34
+ },
35
+ ".": {
36
+ "types": "./index.d.ts",
37
+ "default": "./fesm2022/rulecms-widget-angular.mjs"
38
+ }
39
+ },
40
+ "dependencies": {
41
+ "tslib": "^2.3.0"
42
+ }
43
+ }
@@ -0,0 +1,22 @@
1
+ export { RuleCMSWidgetProviderComponent } from './lib/provider/rule-cms-widget-provider.component';
2
+ export { RuleCMSWidgetContextService } from './lib/provider/rule-cms-widget-context.service';
3
+ export { RuleCMSWidgetComponent } from './lib/widget/rule-cms-widget.component';
4
+ export { RULECMS_PUBLISHED_KEY_ATTRIBUTE } from './lib/widget/rule-cms-widget.styles';
5
+ export { prepareRuleCMSWidgetData } from './lib/widget/prepare-rule-cms-widget-data';
6
+ export type { RuleCMSWidgetData, RuleCMSWidgetRawData, WidgetData, ChildCollection, GetRuleCMSWidgetResponse, } from './lib/widget/widget-data.types';
7
+ export * from './lib/helpers';
8
+ export * from './lib/id-utils';
9
+ export * from './lib/library-registry';
10
+ export { RenderComponentsComponent } from './lib/render/render-components.component';
11
+ export { RenderComponentsForDeviceComponent } from './lib/render/render-components-for-device.component';
12
+ export { RenderComponentsInnerComponent } from './lib/render/render-components-inner.component';
13
+ export { BreakpointVariantRenderComponent } from './lib/render/breakpoint-variant-render.component';
14
+ export { DisplayComponentComponent } from './lib/render/display-component.component';
15
+ export { hasDeviceDivergentValues } from './lib/render/has-device-divergent-values';
16
+ export { getComponentsPluginFromPlugins } from './lib/render/get-components-plugin-from-plugins';
17
+ export type { RenderComponentPlugins } from './lib/render/types';
18
+ export { fetchRuleCMSWidget, FetchRuleCMSWidgetError, } from './lib/fetch/fetch-rule-cms-widget';
19
+ export type { FetchRuleCMSWidgetParams } from './lib/fetch/fetch-rule-cms-widget';
20
+ export { resolveWidgetLibraries } from './lib/fetch/resolve-widget-libraries';
21
+ export type { ResolveWidgetLibrariesParams } from './lib/fetch/resolve-widget-libraries';
22
+ //# sourceMappingURL=public-api.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"public-api.d.ts","sourceRoot":"","sources":["../src/public-api.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,8BAA8B,EAAE,MAAM,mDAAmD,CAAC;AACnG,OAAO,EAAE,2BAA2B,EAAE,MAAM,gDAAgD,CAAC;AAC7F,OAAO,EAAE,sBAAsB,EAAE,MAAM,wCAAwC,CAAC;AAChF,OAAO,EAAE,+BAA+B,EAAE,MAAM,qCAAqC,CAAC;AACtF,OAAO,EAAE,wBAAwB,EAAE,MAAM,2CAA2C,CAAC;AACrF,YAAY,EACV,iBAAiB,EACjB,oBAAoB,EACpB,UAAU,EACV,eAAe,EACf,wBAAwB,GACzB,MAAM,gCAAgC,CAAC;AAExC,cAAc,eAAe,CAAC;AAC9B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,wBAAwB,CAAC;AAEvC,OAAO,EAAE,yBAAyB,EAAE,MAAM,0CAA0C,CAAC;AACrF,OAAO,EAAE,kCAAkC,EAAE,MAAM,qDAAqD,CAAC;AACzG,OAAO,EAAE,8BAA8B,EAAE,MAAM,gDAAgD,CAAC;AAChG,OAAO,EAAE,gCAAgC,EAAE,MAAM,kDAAkD,CAAC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