@unlayer/types 1.526.0 → 1.529.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.
@@ -4,7 +4,7 @@ import type { Audit, Validator } from './audit';
4
4
  import type { EditorSettings, InferSchemaType, SafeHtmlOptions, Tabs, User, WidgetConfig, WidgetMountFn, WidgetRenderFn } from './config';
5
5
  import type { DesignMode, DesignTags, DesignTagsConfig, JSONTemplate } from './design';
6
6
  import type { DisplayConditions } from './display-conditions';
7
- import type { ExportFromApiResult, ExportHtmlOptions, ExportHtmlResult, ExportImageFromApiOptions, ExportLiveHtmlOptions, ExportLiveHtmlResult, ExportPdfFromApiOptions, ExportPlainTextOptions, ExportPlainTextResult, ExportZipFromApiOptions, SaveDesignOptions } from './export';
7
+ import type { ExportFromApiResult, ExportHtmlOptions, ExportHtmlResult, ExportImageFromApiOptions, ExportLiveHtmlOptions, ExportLiveHtmlResult, ExportPdfFromApiOptions, ExportPlainTextOptions, ExportPlainTextResult, ExportZipFromApiOptions, PdfWatermarkOptions, SaveDesignOptions } from './export';
8
8
  import type { ColorPicker, Features } from './features';
9
9
  import type { Fonts } from './font';
10
10
  import type { Language, Locale, TextDirection, Translations, UnlayerLocale, UnlayerTranslations } from './intl';
@@ -337,6 +337,16 @@ interface Config {
337
337
  agentApi?: boolean;
338
338
  }
339
339
 
340
+ export type PdfWatermarkPosition =
341
+ | 'diagonal'
342
+ | 'center'
343
+ | 'top'
344
+ | 'bottom';
345
+ /**
346
+ * Custom watermark drawn over every page of a document-mode PDF preview or
347
+ * export. Requires a plan that includes Document Watermarks.
348
+ */
349
+
340
350
  export interface AgentTarget {
341
351
  /** Index into `describe().editors`. Defaults to the first editor. */
342
352
  editor?: number;
@@ -607,6 +617,12 @@ declare class EditorClass<TClassDisplayMode extends DisplayMode | undefined = un
607
617
  showPreview(payload: {
608
618
  device?: Device;
609
619
  resolution?: number;
620
+ /**
621
+ * Watermark for the document PDF preview and its Download PDF
622
+ * button. Overrides the `features.watermark` init option; `false` turns
623
+ * it off for this preview.
624
+ */
625
+ watermark?: PdfWatermarkOptions | false;
610
626
  } | Device): void;
611
627
  hidePreview(): void;
612
628
  canUndo(callback: (result: boolean) => void): void;
@@ -1,6 +1,7 @@
1
1
  // Auto-generated by build-values-types.js. Do not edit manually.
2
2
 
3
3
  import type { JSONTemplate } from './design';
4
+ import type { PdfWatermarkPosition } from './editor';
4
5
  import type { FontList } from './font';
5
6
  import type { TextDirection } from './intl';
6
7
  import type { MergeTagsValues } from './merge-tags';
@@ -116,9 +117,28 @@ export type PdfPageSize =
116
117
  | 'A5'
117
118
  | 'A6';
118
119
 
120
+ export interface PdfWatermarkOptions {
121
+ /** Plain text, printed literally on one line (1-100 characters, no HTML). */
122
+ text: string;
123
+ /** Where the watermark sits on each page. Defaults to `'diagonal'`. */
124
+ position?: PdfWatermarkPosition;
125
+ /** Opacity from 0.05 to 1. Defaults to 0.2. */
126
+ opacity?: number;
127
+ /**
128
+ * Color as `#RGB`, `#RRGGBB` or `rgb(r, g, b)` with 0-255 channels.
129
+ * Defaults to `#808080`.
130
+ */
131
+ color?: string;
132
+ }
133
+
119
134
  export interface ExportPdfFromApiOptions extends BaseExportFromApiOptions {
120
135
  documentOrientation?: DocumentOrientation;
121
136
  pageSize?: PdfPageSize;
137
+ /**
138
+ * Watermark for this export. Overrides the `features.watermark` init option;
139
+ * `false` turns the init default off for this call.
140
+ */
141
+ watermark?: PdfWatermarkOptions | false;
122
142
  }
123
143
 
124
144
  export interface ExportZipFromApiOptions extends BaseExportFromApiOptions {
@@ -1,6 +1,7 @@
1
1
  // Auto-generated by build-values-types.js. Do not edit manually.
2
2
 
3
3
  import type { AIImageProvider, AIProvider, ImageSource, InboxPreviewClientId } from './editor';
4
+ import type { PdfWatermarkOptions } from './export';
4
5
  import type { Language } from './intl';
5
6
  import type { Resolution } from './types';
6
7
 
@@ -356,6 +357,13 @@ export interface Features {
356
357
  syncedBlocks?: boolean;
357
358
  minimap?: boolean;
358
359
  normalizeEmailLineHeights?: boolean;
360
+ /**
361
+ * Default watermark for every document PDF preview and `exportPdf` call,
362
+ * also drawn on each page of the document canvas and its minimap. A call's
363
+ * own `watermark` option overrides it. Requires a plan that includes
364
+ * Document Watermarks.
365
+ */
366
+ watermark?: PdfWatermarkOptions;
359
367
  }
360
368
 
361
369
  // ───────────────────────────────────────────────────────────────────────────
@@ -798,6 +798,16 @@ export type EditorTranslationKey =
798
798
  | 'modals.preview.download_pdf.downloading'
799
799
  | 'modals.preview.download_pdf.not_downloaded'
800
800
  | 'modals.preview.download_pdf.subscription_expired'
801
+ | 'modals.preview.download_pdf.watermark_invalid'
802
+ | 'modals.preview.download_pdf.watermark_not_confirmed'
803
+ | 'modals.preview.download_pdf.watermark_not_included'
804
+ | 'modals.preview.download_pdf.watermark_problem_color'
805
+ | 'modals.preview.download_pdf.watermark_problem_opacity'
806
+ | 'modals.preview.download_pdf.watermark_problem_options'
807
+ | 'modals.preview.download_pdf.watermark_problem_position'
808
+ | 'modals.preview.download_pdf.watermark_problem_shape'
809
+ | 'modals.preview.download_pdf.watermark_problem_text'
810
+ | 'modals.preview.download_pdf.watermark_problem_text_too_long'
801
811
  | 'modals.preview.exit_preview'
802
812
  | 'modals.preview.inbox_preview.button.check_status'
803
813
  | 'modals.preview.inbox_preview.button.generate_again'
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@unlayer/types",
3
- "version": "1.526.0",
3
+ "version": "1.529.0",
4
4
  "license": "MIT",
5
5
  "private": false,
6
6
  "types": "./dist/index.d.ts",