@rokt/dcui-orchestrator 1.2.1-rc.43 → 1.2.1-rc.44

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.
@@ -1,5 +1,13 @@
1
1
  import { AnyAction } from '@reduxjs/toolkit';
2
2
  import { ProgressionState } from '../../models';
3
3
  export declare function makeInitialProgressionState(): null;
4
+ /**
5
+ * A group size is usable only as a whole number from 1 up to the total count.
6
+ * The value comes from the layout's viewableItems, which the plugin does not
7
+ * re-check at runtime: a fraction below 1 makes totalCount / groupSize as
8
+ * large as the layout likes, and a fraction above 1 produces fractional offer
9
+ * indexes.
10
+ */
11
+ export declare function isValidGroupSize(groupSize: number, totalCount: number): boolean;
4
12
  export declare function getNumberOfGroups(totalCount: number, groupSize: number): number;
5
13
  export declare function progressionReducer(state: ProgressionState | undefined, action: AnyAction): ProgressionState;
@@ -14,3 +14,11 @@ export type Distribution = {
14
14
  };
15
15
  export declare function getDistribution(layout: LayoutSchemaModel): Distribution | undefined;
16
16
  export declare function getDistributionViewableItems(distribution: Distribution | undefined): Array<number> | undefined;
17
+ /**
18
+ * The layout's viewableItems entry for a breakpoint, made safe for the
19
+ * progression reducer: a value of at least 1 is rounded down to a whole
20
+ * number, so 2.5 keeps a group of 2, and anything else (a value below 1,
21
+ * a missing entry, a value that is not a finite number) becomes 1, the
22
+ * value the reducer already uses when a layout names no group size.
23
+ */
24
+ export declare function normaliseGroupSize(value: number | undefined): number;
@@ -3,5 +3,6 @@ export { Distribution } from './distribution';
3
3
  declare const _default: {
4
4
  getDistribution(layout: import("@rokt/dcui-layout-schema").LayoutSchemaModel): distributionUtils.Distribution | undefined;
5
5
  getDistributionViewableItems(distribution: distributionUtils.Distribution | undefined): Array<number> | undefined;
6
+ normaliseGroupSize(value: number | undefined): number;
6
7
  };
7
8
  export default _default;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rokt/dcui-orchestrator",
3
- "version": "1.2.1-rc.43",
3
+ "version": "1.2.1-rc.44",
4
4
  "description": "Rokt's DCUI rendering process",
5
5
  "main": "dist/index.cjs",
6
6
  "module": "dist/index.js",