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

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.
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Escapes the characters that can end or escape a double-quoted CSS string:
3
+ * a double quote and a backslash get a backslash in front, and a CSS newline
4
+ * (LF, CR, FF) becomes its hex escape with a space terminator. A value written
5
+ * into url("...") then stays inside the quotes even when the validator in
6
+ * front of it lets one of them through.
7
+ *
8
+ * A colon and a semicolon become their hex escapes too. The css writer
9
+ * (Emotion) scans the whole style string for `label:<name>` and appends the
10
+ * name to the class it inserts, and the rule's own closing `");` ends a
11
+ * label that the value starts (the `")` is read into the name, the `;` ends
12
+ * it), so a label read out of the value would turn that class into a
13
+ * selector list that reaches the host page. The colon is escaped so the word
14
+ * label can never be followed by one, and the semicolon so a raw one cannot
15
+ * end such a label. The browser decodes both back to the same url.
16
+ */
17
+ export declare function escapeCSSString(value: string): string;
@@ -1,4 +1,5 @@
1
1
  export * from './apply-from-spec';
2
+ export * from './escape-css-string';
2
3
  export * from './join';
3
4
  export * from './join-to-css-rule';
4
5
  export * from './join-to-media-query';
@@ -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.45",
4
4
  "description": "Rokt's DCUI rendering process",
5
5
  "main": "dist/index.cjs",
6
6
  "module": "dist/index.js",