@useinsider/guido 3.19.0-beta.cac604e → 3.19.0-beta.dcea8c0

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,26 +0,0 @@
1
- import { ATTR_CUSTOM_PREFIX as f, RECOMMENDATION_ID_ATTR as o } from "../constants/selectors.js";
2
- const s = new RegExp(`\\s${o}="(\\d+)"`, "g");
3
- function u(t) {
4
- if (typeof t == "string")
5
- return t.trim() !== "";
6
- if (t && typeof t == "object" && "strategyId" in t) {
7
- const { strategyId: r } = t;
8
- return (typeof r == "string" || typeof r == "number") && String(r).trim() !== "";
9
- }
10
- return !1;
11
- }
12
- function a(t) {
13
- return new Set([...t.matchAll(s)].map((r) => Number(r[1])));
14
- }
15
- function g({ config: t, blockId: r, partnerName: e, campaignUrls: n, loadedIds: i }) {
16
- return e ? t.partnerName ? t.partnerName !== e : !t.strategyId || !n || !i.has(r) ? !1 : !u(n[String(r)]) : !1;
17
- }
18
- function p(t) {
19
- return t.filter((r) => !r.startsWith(f));
20
- }
21
- export {
22
- g as carriesForeignPartnerConfig,
23
- u as isDefinedCampaignUrl,
24
- a as loadedRecommendationIds,
25
- p as withoutCustomAttributes
26
- };
@@ -1,27 +0,0 @@
1
- import type { RecommendationNodeConfig } from '../types/nodeConfig';
2
- /**
3
- * Mirrors the backend's `RecommendationCampaignUrls::isDefined`: a legacy feed URL
4
- * string or an entry that names a strategy.
5
- */
6
- export declare function isDefinedCampaignUrl(value: unknown): boolean;
7
- /** Recommendation block ids present in the HTML the host loaded the editor with. */
8
- export declare function loadedRecommendationIds(html: string): Set<number>;
9
- export interface PartnerScopeInputs {
10
- config: Pick<RecommendationNodeConfig, 'strategyId' | 'partnerName'>;
11
- blockId: number;
12
- partnerName: string;
13
- /** `undefined` when the host does not pass the map — the unstamped check is then off. */
14
- campaignUrls: Record<string, unknown> | undefined;
15
- loadedIds: Set<number>;
16
- }
17
- /**
18
- * Whether a block carries another account's strategy config (SD-151945).
19
- *
20
- * A stamped block is judged by its stamp. An unstamped one predates the stamp, so it
21
- * falls back to the backend's own signal: a cross-account duplicate drops the block's
22
- * strategy entry from the campaign URL map but leaves the HTML untouched. That check
23
- * only holds for blocks the host loaded, whose map entry the host actually sent — a
24
- * saved module or a clone arrives under an id the map never had.
25
- */
26
- export declare function carriesForeignPartnerConfig({ config, blockId, partnerName, campaignUrls, loadedIds }: PartnerScopeInputs): boolean;
27
- export declare function withoutCustomAttributes(composition: string[]): string[];