@sitepulse/web 1.0.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.
@@ -0,0 +1,48 @@
1
+ /**
2
+ * SitePulse Campaign DOM Fixed Block Renderer (§8.3 & §3.2)
3
+ *
4
+ * SECURITY DECISION:
5
+ * Direct DOM element creation using document.createElement(), element.textContent,
6
+ * and explicit attribute setters ONLY.
7
+ *
8
+ * ZERO innerHTML with user-supplied strings anywhere in this module to guarantee
9
+ * zero possibility of XSS or malicious script injection on customer host sites.
10
+ */
11
+ import { ContentBlock, Design, Campaign } from "@sitepulse/types";
12
+ export interface CampaignActionHandlers {
13
+ onLinkClick?: (url: string, eventName?: string) => void;
14
+ onEventClick?: (eventName: string) => void;
15
+ onSubmit?: (formData: Record<string, string>) => void;
16
+ onClose?: () => void;
17
+ }
18
+ export declare function renderHeadingBlock(block: Extract<ContentBlock, {
19
+ type: "heading";
20
+ }>, design: Design, isBanner?: boolean): HTMLElement;
21
+ export declare function renderParagraphBlock(block: Extract<ContentBlock, {
22
+ type: "paragraph";
23
+ }>, design: Design, isBanner?: boolean): HTMLElement;
24
+ export declare function renderImageBlock(block: Extract<ContentBlock, {
25
+ type: "image";
26
+ }>, _design: Design): HTMLElement;
27
+ export declare function renderButtonBlock(block: Extract<ContentBlock, {
28
+ type: "button";
29
+ }>, design: Design, handlers: CampaignActionHandlers, isBanner?: boolean): HTMLElement;
30
+ export declare function renderInputBlock(block: Extract<ContentBlock, {
31
+ type: "input";
32
+ }>, design: Design, isOnlyInput?: boolean): HTMLElement;
33
+ export declare function renderCountdownBlock(block: Extract<ContentBlock, {
34
+ type: "countdown";
35
+ }>, design: Design): HTMLElement;
36
+ export declare function renderRatingBlock(block: Extract<ContentBlock, {
37
+ type: "rating";
38
+ }>, design: Design, isOnlyInput?: boolean): HTMLElement;
39
+ export declare function renderSocialProofBlock(block: Extract<ContentBlock, {
40
+ type: "social_proof";
41
+ }>, design: Design, siteId?: string, hasCloseButton?: boolean): HTMLElement;
42
+ export declare function renderDividerBlock(_block: Extract<ContentBlock, {
43
+ type: "divider";
44
+ }>, design: Design): HTMLElement;
45
+ export declare function renderCampaignDOM(campaign: Campaign, handlers?: CampaignActionHandlers): {
46
+ element: HTMLElement;
47
+ destroy: () => void;
48
+ };
@@ -0,0 +1,2 @@
1
+ export declare function getOrCreateAnonymousId(): string;
2
+ export declare function getOrCreateSessionId(): string;