@bluepic/embed 0.6.23 → 0.6.25

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.
@@ -12698,7 +12698,9 @@ export declare class BluepicEmbed extends EventTarget {
12698
12698
  /** Unmount the editor and free the element (e.g. when its popup closes). */
12699
12699
  destroy(): void;
12700
12700
  private mount;
12701
+ /** A blank value (empty/whitespace-only string, `null`, `{ src: "" }`) means "not provided" and is ignored. */
12701
12702
  setVariable(key: string, value: unknown): void;
12703
+ /** Blank values are dropped first (see `setVariable`). */
12702
12704
  setData(dataset: {
12703
12705
  [key: string]: unknown;
12704
12706
  }, forceOverwrite?: boolean): void;
@@ -21,7 +21,11 @@ export type OpenPopupOptions = {
21
21
  campaignId: number | string;
22
22
  /** Open this template; default: the campaign's first. */
23
23
  templateId?: string;
24
- /** Pre-filled field values by binding key. */
24
+ /**
25
+ * Pre-filled field values by binding key. An empty or whitespace-only string
26
+ * (a merge tag with nothing behind it) means "not provided": the template's
27
+ * default value stays.
28
+ */
25
29
  data?: Record<string, unknown>;
26
30
  theme?: 'light' | 'dark' | 'auto';
27
31
  apiBaseUrl?: string;
@@ -37,4 +41,12 @@ export type BluepicPopupHandle = {
37
41
  /** The editor, once mounted (it mounts with the popup). */
38
42
  readonly embed: BluepicEmbed | undefined;
39
43
  };
44
+ /**
45
+ * Safe to call at any point of the page's life.
46
+ *
47
+ * The snippet may run from `<head>`, before there is a `<body>` to put the
48
+ * popup in: then the popup opens on `DOMContentLoaded`, and the handle works in
49
+ * the meantime (`close()` cancels the pending open). With a body — during
50
+ * parsing, after `DOMContentLoaded` or after `load` — it opens right away.
51
+ */
40
52
  export declare function openPopup(options: OpenPopupOptions): BluepicPopupHandle;