@rokt/dcui-orchestrator 1.2.1-rc.47 → 1.2.1-rc.49

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,9 +1,11 @@
1
1
  /**
2
2
  * Escapes the characters that can end or escape a double-quoted CSS string:
3
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.
4
+ * (LF, CR, FF) or a NUL becomes its hex escape with a space terminator. The
5
+ * css writer's parser (stylis) ends a quoted string at a raw NUL; the escape
6
+ * `\0 ` is read by the browser as U+FFFD, the code point CSS gives a NUL. A
7
+ * value written into url("...") then stays inside the quotes even when the
8
+ * validator in front of it lets one of them through.
7
9
  *
8
10
  * A colon and a semicolon become their hex escapes too. The css writer
9
11
  * (Emotion) scans the whole style string for `label:<name>` and appends the
@@ -2,6 +2,7 @@ export * from './apply-image-dimension-bounding';
2
2
  export * from './get-disabled-attributes';
3
3
  export * from './is-escape-hatch';
4
4
  export * from './is-touch-device';
5
+ export * from './link-schemes';
5
6
  export * from './merge-styles-with-defaults';
6
7
  export * from './node-factories';
7
8
  export * from './responsive-css';
@@ -0,0 +1,35 @@
1
+ /**
2
+ * True when the url parses to a scheme that runs script. No base is needed: a
3
+ * relative href resolves to the page's own scheme, so it can never be one.
4
+ */
5
+ export declare function isScriptUrl(url: string): boolean;
6
+ /**
7
+ * A relative href ("#anchor", "/path") resolves against base, the page the
8
+ * plugin runs in. With no base only an absolute url can pass, because nothing
9
+ * says what the relative one would open.
10
+ */
11
+ export declare function isNavigableUrl(url: string, base?: string): boolean;
12
+ /**
13
+ * What the asserts throw, so a catch block can tell the guard's refusal from
14
+ * a failed open and report it under REFUSED_LINK_SCHEME rather than
15
+ * FAILED_TO_OPEN_LINK. The message names the scheme for whoever reads that
16
+ * report.
17
+ */
18
+ export declare class RefusedLinkError extends Error {
19
+ constructor(message: string);
20
+ }
21
+ export declare function isRefusedLink(err: unknown): err is RefusedLinkError;
22
+ export declare function assertNavigableUrl(url: string, base?: string): void;
23
+ export declare function assertNotScriptUrl(url: string, base?: string): void;
24
+ /**
25
+ * The html a rich text renders has passed the sanitiser, but an entity in an
26
+ * href ("javascript&colon;", "java&#9;script:") is decoded by the browser
27
+ * only after that check. This parses the html the way the browser will, into
28
+ * an inert template, and removes every anchor href whose decoded scheme runs
29
+ * script. Html with nothing to remove is returned exactly as it came.
30
+ *
31
+ * Call it on the final string, after every regex pass that rewrites tags. An
32
+ * older serialiser writes "<" raw inside an attribute value, so a pass that
33
+ * runs after it can turn an href's text into a tag with its own attributes.
34
+ */
35
+ export declare function dropScriptHrefs(html: string): string;
@@ -1,6 +1,7 @@
1
1
  export declare const INVALID_RESPONSE_OBJECT = "INVALID_RESPONSE_OBJECT";
2
2
  export declare const INVALID_MODULE_NAME = "INVALID_MODULE_NAME";
3
3
  export declare const FAILED_TO_OPEN_LINK = "FAILED_TO_OPEN_LINK";
4
+ export declare const REFUSED_LINK_SCHEME = "REFUSED_LINK_SCHEME";
4
5
  export declare const LINK_OPEN_RESULT = "LINK_OPEN_RESULT";
5
6
  export declare const FAILED_TO_ISSUE_SIGNAL = "FAILED_TO_ISSUE_SIGNAL";
6
7
  export declare const FAILED_TO_CLOSE_PLUGIN = "FAILED_TO_CLOSE_PLUGIN";
@@ -18,3 +19,4 @@ export declare const FAILED_TO_ESTABLISH_PARTNER_VALIDATION = "FAILED_TO_ESTABLI
18
19
  export declare const PARTNER_VALIDATION_UPDATE_FAILED = "PARTNER_VALIDATION_UPDATE_FAILED";
19
20
  export declare const CART_SERVICE_RESPONSE_ERROR = "CART_SERVICE_RESPONSE_ERROR";
20
21
  export declare const UNSUPPORTED_LAYOUT_ACTION = "UNSUPPORTED_LAYOUT_ACTION";
22
+ export declare const INVALID_GROUP_SIZE = "INVALID_GROUP_SIZE";
@@ -14,6 +14,7 @@ declare const _default: {
14
14
  partner: import("../../../../../index").PartnerInteractionService;
15
15
  };
16
16
  }, injectedWindow?: Pick<Window, "top" | "open" | "RoktWebViewSDK"> & {
17
+ location?: Pick<Location, "href">;
17
18
  navigator?: Omit<Navigator, "userActivation"> & {
18
19
  userActivation?: UserActivation;
19
20
  };
@@ -23,6 +23,7 @@ export type HandleUnavailable = {
23
23
  };
24
24
  export declare function isHandleUnavailable(value: unknown): value is HandleUnavailable;
25
25
  type InjectedWindow = Pick<Window, 'top' | 'open' | 'RoktWebViewSDK'> & {
26
+ location?: Pick<Location, 'href'>;
26
27
  navigator?: Omit<Navigator, 'userActivation'> & {
27
28
  userActivation?: UserActivation;
28
29
  };
@@ -22,3 +22,9 @@ export declare function getDistributionViewableItems(distribution: Distribution
22
22
  * value the reducer already uses when a layout names no group size.
23
23
  */
24
24
  export declare function normaliseGroupSize(value: number | undefined): number;
25
+ /**
26
+ * True when normaliseGroupSize uses a value other than the one the layout
27
+ * configured, the case the plugin saga reports as INVALID_GROUP_SIZE. A
28
+ * missing entry is a layout that names no group size, not a changed one.
29
+ */
30
+ export declare function isGroupSizeChanged(value: number | undefined): boolean;
@@ -4,5 +4,6 @@ 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
6
  normaliseGroupSize(value: number | undefined): number;
7
+ isGroupSizeChanged(value: number | undefined): boolean;
7
8
  };
8
9
  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.47",
3
+ "version": "1.2.1-rc.49",
4
4
  "description": "Rokt's DCUI rendering process",
5
5
  "main": "dist/index.cjs",
6
6
  "module": "dist/index.js",