unlayer-types 1.330.0 → 1.331.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.
Files changed (2) hide show
  1. package/embed.d.ts +160 -7
  2. package/package.json +1 -1
package/embed.d.ts CHANGED
@@ -83,13 +83,17 @@ declare module "editor/components/editors/types" {
83
83
  Record<string, any>,
84
84
  Record<string, any>,
85
85
  {
86
+ rowIndex: number | undefined;
87
+ rowCells: number[] | undefined;
88
+ rowValues: Record<string, any> | undefined;
89
+ columnIndex: number | undefined;
90
+ columnValues: Record<string, any> | undefined;
91
+ bodyValues: Record<string, any> | undefined;
86
92
  displayMode: DisplayMode;
87
93
  embeddedValues: Record<string, any>;
88
94
  isViewer: boolean;
89
95
  variant: Variant;
90
96
  type?: string;
91
- columnIndex?: number;
92
- rowCells?: number[];
93
97
  }
94
98
  ];
95
99
  export interface Head {
@@ -1719,6 +1723,84 @@ declare module "state/types/types" {
1719
1723
  }[];
1720
1724
  }[];
1721
1725
  };
1726
+ export type ExporterName = DisplayMode | 'ampWeb' | 'ampEmail' | 'classic';
1727
+ export type BodyContainerExporter = (innerHTML: string, bodyValues: Record<string, any>, // @deprecated use last param instead
1728
+ meta: {
1729
+ bodyValues: RootState['design']['bodies'][string]['values'];
1730
+ type: string;
1731
+ variant: Variant;
1732
+ }) => string;
1733
+ export type BodyContainerExporters = Partial<Record<ExporterName, BodyContainerExporter>>;
1734
+ export type RowContainerExporter = (innerHTML: string, rowValues: RootState['design']['rows'][string]['values'], // @deprecated use last param instead
1735
+ bodyValues: RootState['design']['bodies'][string]['values'], // @deprecated use last param instead
1736
+ meta: {
1737
+ rowIndex: number;
1738
+ rowCells: number[];
1739
+ rowValues: RootState['design']['rows'][string]['values'];
1740
+ bodyValues: RootState['design']['bodies'][string]['values'];
1741
+ variant: Variant | undefined;
1742
+ language: string | undefined;
1743
+ collection: Collection;
1744
+ }) => string;
1745
+ export type RowContainerExporters = Partial<Record<ExporterName, RowContainerExporter>>;
1746
+ export type ColumnContainerExporter = (innerHTML: string, columnValues: Record<string, any>, // @deprecated use last param instead
1747
+ columnIndex: number, // @deprecated use last param instead
1748
+ rowCells: number[], // @deprecated use last param instead
1749
+ bodyValues: RootState['design']['bodies'][string]['values'], // @deprecated use last param instead
1750
+ rowValues: RootState['design']['rows'][string]['values'], // @deprecated use last param instead
1751
+ meta: {
1752
+ columnIndex: number;
1753
+ columnValues: RootState['design']['columns'][string]['values'];
1754
+ rowIndex: number;
1755
+ rowCells: number[];
1756
+ rowValues: RootState['design']['rows'][string]['values'];
1757
+ bodyValues: RootState['design']['bodies'][string]['values'];
1758
+ variant: Variant;
1759
+ language: string;
1760
+ }) => string;
1761
+ export type ColumnContainerExporters = Partial<Record<ExporterName, ColumnContainerExporter>>;
1762
+ export type ContentContainerExporter = (innerHTML: string, contentValues: Record<string, any>, // @deprecated use last param instead
1763
+ bodyValues: RootState['design']['bodies'][string]['values'], // @deprecated use last param instead
1764
+ meta: {
1765
+ index: number;
1766
+ columnIndex: number;
1767
+ columnValues: RootState['design']['columns'][string]['values'];
1768
+ rowIndex: number;
1769
+ rowCells: number[];
1770
+ rowValues: RootState['design']['rows'][string]['values'];
1771
+ bodyValues: RootState['design']['bodies'][string]['values'];
1772
+ variant: Variant | undefined;
1773
+ language: string | undefined;
1774
+ embeddedValues: Record<string, unknown>;
1775
+ mergeTagState: {
1776
+ mergeTagGroup: string;
1777
+ mergeTagRule: string;
1778
+ mergeTags: MergeTagsValues;
1779
+ };
1780
+ }) => string;
1781
+ export type ContentContainerExporters = Partial<Record<ExporterName, ContentContainerExporter>>;
1782
+ export type ItemExporter = (renderValues: Record<string, unknown>, index: number, // @deprecated use last param instead
1783
+ columnIndex: number, // @deprecated use last param instead
1784
+ rowCells: number[], // @deprecated use last param instead
1785
+ bodyValues: RootState['design']['bodies'][string]['values'], // @deprecated use last param instead
1786
+ rowValues: RootState['design']['rows'][string]['values'], // @deprecated use last param instead
1787
+ embeddedValues: Record<string, unknown>, // @deprecated use last param instead
1788
+ meta: {
1789
+ index: number;
1790
+ columnIndex: number;
1791
+ columnValues: RootState['design']['columns'][string]['values'];
1792
+ rowIndex: number;
1793
+ rowCells: number[];
1794
+ rowValues: RootState['design']['rows'][string]['values'];
1795
+ bodyValues: RootState['design']['bodies'][string]['values'];
1796
+ embeddedValues: Record<string, unknown>;
1797
+ mergeTagState: {
1798
+ mergeTagGroup: string;
1799
+ mergeTagRule: string;
1800
+ mergeTags: MergeTagsValues;
1801
+ };
1802
+ }) => string;
1803
+ export type ItemExporters = Partial<Record<ExporterName, ItemExporter>>;
1722
1804
  }
1723
1805
  declare module "engine/utils/pruneObj" {
1724
1806
  export function pruneObj<T extends Record<string, any>>(obj: T, options?: {
@@ -2879,12 +2961,83 @@ declare module "editor/helpers/placeholders" {
2879
2961
  type ToolType = 'image' | 'carousel';
2880
2962
  export function getPlaceholderUrl(type: ToolType): string;
2881
2963
  }
2964
+ declare module "engine/utils/explodeBorder" {
2965
+ export function explodeBorder(value: number | string | {
2966
+ borderTopWidth?: string;
2967
+ borderTopStyle?: string;
2968
+ borderTopColor?: string;
2969
+ borderLeftWidth?: string;
2970
+ borderLeftStyle?: string;
2971
+ borderLeftColor?: string;
2972
+ borderRightWidth?: string;
2973
+ borderRightStyle?: string;
2974
+ borderRightColor?: string;
2975
+ borderBottomWidth?: string;
2976
+ borderBottomStyle?: string;
2977
+ borderBottomColor?: string;
2978
+ } | undefined): {
2979
+ top: number | undefined;
2980
+ right: number | undefined;
2981
+ bottom: number | undefined;
2982
+ left: number | undefined;
2983
+ };
2984
+ }
2882
2985
  declare module "engine/utils/imageRendering" {
2883
- export function isFixedContentWidth(bodyValues: any): boolean;
2884
- export function getAvailableWidth(values: any, { columnIndex, rowCells, bodyValues }: {
2885
- columnIndex: any;
2886
- rowCells: any;
2887
- bodyValues: any;
2986
+ import { explodePaddingsOrMargins } from "engine/utils/explodePaddingsOrMargins";
2987
+ import { explodeBorder } from "engine/utils/explodeBorder";
2988
+ export function isFixedContentWidth(bodyValues?: {
2989
+ contentWidth: number | string;
2990
+ }): boolean;
2991
+ export function getBodyAvailableWidth({ body, fallbackBodyContentWidth, }: {
2992
+ body: {
2993
+ values: {
2994
+ contentWidth: number | string;
2995
+ padding?: Parameters<typeof explodePaddingsOrMargins>[0];
2996
+ border?: Parameters<typeof explodeBorder>[0];
2997
+ };
2998
+ };
2999
+ fallbackBodyContentWidth?: number;
3000
+ }): number;
3001
+ export function getRowAvailableWidth({ body, row, }: {
3002
+ body: Parameters<typeof getBodyAvailableWidth>[0]['body'];
3003
+ row: {
3004
+ values: {
3005
+ padding: Parameters<typeof explodePaddingsOrMargins>[0];
3006
+ border?: Parameters<typeof explodeBorder>[0];
3007
+ };
3008
+ };
3009
+ }): number;
3010
+ export function getColumnAvailableWidth({ body, row, column, }: {
3011
+ body: Parameters<typeof getRowAvailableWidth>[0]['body'];
3012
+ row: Parameters<typeof getRowAvailableWidth>[0]['row'] & {
3013
+ cells: number[];
3014
+ };
3015
+ column: {
3016
+ index: number;
3017
+ values: {
3018
+ padding: Parameters<typeof explodePaddingsOrMargins>[0];
3019
+ border: Parameters<typeof explodeBorder>[0];
3020
+ };
3021
+ };
3022
+ }): number;
3023
+ export function getContentAvailableWidth({ body, row, column, item, }: {
3024
+ body: Parameters<typeof getColumnAvailableWidth>[0]['body'];
3025
+ row: Parameters<typeof getColumnAvailableWidth>[0]['row'];
3026
+ column: Parameters<typeof getColumnAvailableWidth>[0]['column'];
3027
+ item: {
3028
+ values: {
3029
+ containerPadding?: Parameters<typeof explodePaddingsOrMargins>[0];
3030
+ border?: Parameters<typeof explodeBorder>[0];
3031
+ };
3032
+ };
3033
+ }): number;
3034
+ export function getAvailableWidth({ values, columnIndex, columnValues, rowCells, rowValues, bodyValues, }: {
3035
+ values: Parameters<typeof getContentAvailableWidth>[0]['item']['values'];
3036
+ columnIndex: Parameters<typeof getContentAvailableWidth>[0]['column']['index'];
3037
+ columnValues: Parameters<typeof getContentAvailableWidth>[0]['column']['values'];
3038
+ rowCells: Parameters<typeof getContentAvailableWidth>[0]['row']['cells'];
3039
+ rowValues: Parameters<typeof getContentAvailableWidth>[0]['row']['values'];
3040
+ bodyValues: Parameters<typeof getContentAvailableWidth>[0]['body']['values'];
2888
3041
  }): number;
2889
3042
  export function getImageWidthAndMaxWidth(widthValue: {
2890
3043
  autoWidth?: boolean;
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "unlayer-types",
3
- "version": "1.330.0",
3
+ "version": "1.331.0",
4
4
  "license": "MIT"
5
5
  }