@solidpepper/solidpepper-solidgeneration 0.1.1

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.
package/index.d.ts ADDED
@@ -0,0 +1,229 @@
1
+ declare enum SourceData {
2
+ All = 1,
3
+ Publication = 2,
4
+ Sku = 3,
5
+ Variant = 4,
6
+ BatchGeneration = 5,
7
+ Document = 6
8
+ }
9
+ declare enum TypeDatasheet {
10
+ OneFileForAllProducts = 1,
11
+ OneFileForEachProduct = 2
12
+ }
13
+ declare class DataSheet {
14
+ previewId: number;
15
+ sourceData: SourceData;
16
+ typeOfDataSheet: TypeDatasheet;
17
+ language: string;
18
+ highDefinition: boolean;
19
+ leftPage: boolean;
20
+ assetTemplateFile: string;
21
+ pageTemplateFile: string;
22
+ ratebase: number;
23
+ priceListGuid: string;
24
+ accountGuid: string;
25
+ coverPage: string;
26
+ assetTemplatePathFile: string;
27
+ pageTemplatePathFile: string;
28
+ coverTemplatePathFile: string;
29
+ absolutePathFile: string;
30
+ relativePathFile: string;
31
+ nameFinalName: string;
32
+ absolutePathImages: string;
33
+ relativePathImages: string;
34
+ pagesSettings: any[];
35
+ customerFileName: string;
36
+ importFontFamily: string;
37
+ DictImportFontFamily: string[];
38
+ urlService: string;
39
+ publicationTemplateSettingVariants: any;
40
+ publicationTemplateSettingVariantsTableStyle: string;
41
+ publicationTemplateWidth: number;
42
+ publicationTemplateHeight: number;
43
+ publicationTemplateProductBlockY: number;
44
+ publicationTemplateProductBlockWidth: number;
45
+ publicationTemplateBackgroundHeightHeader: number;
46
+ publicationTemplateBackgroundHeightFooter: number;
47
+ publicationTemplateBackgroundRightMargin: number;
48
+ publicationTemplateBackgroundLeftMargin: number;
49
+ publicationTemplateBackgroundFooterY: number;
50
+ publicationTemplateBackgroundMarginX: number;
51
+ showHeader: boolean;
52
+ backgroundVariation: boolean;
53
+ backgroundVariationColor: string;
54
+ hideEmptyCells: boolean;
55
+ publicationTemplateTemplateId: number;
56
+ currentWidth: number;
57
+ lastGabaritHeight: number;
58
+ pricesListCurrency: string;
59
+ gabarits: never[];
60
+ defaultGabaritGuid: null;
61
+ backgrounds: never[];
62
+ defaultBackgroundGuid: null;
63
+ marketing: never[];
64
+ preview: boolean;
65
+ imageFastPreview: boolean;
66
+ bleedMargin: boolean;
67
+ backgroundBleedMarginTop: number;
68
+ backgroundBleedMarginBottom: number;
69
+ backgroundBleedMarginLeft: number;
70
+ backgroundBleedMarginRight: number;
71
+ showCuttingLine: boolean;
72
+ currentStep: number;
73
+ currentObjectName: string;
74
+ currentSectionName: string;
75
+ messageGeneration: string;
76
+ nbSkusSection: number;
77
+ maxSkusSection: number;
78
+ nbSections: number;
79
+ maxSections: number;
80
+ downloadLink: string;
81
+ progress: number;
82
+ translate: {};
83
+ variantTables: any;
84
+ variantTableFirstHeight: number;
85
+ variantTableLastHeight: number;
86
+ backgroundWidth: number;
87
+ backgroundHeight: number;
88
+ backgroundMarginTop: number;
89
+ backgroundMarginLeft: number;
90
+ backgroundMarginRight: number;
91
+ backgroundMarginBottom: number;
92
+ variantWidth: number;
93
+ variantHeight: number;
94
+ variantX: number;
95
+ variantY: number;
96
+ productBlockWidth: number;
97
+ productBlockHeight: number;
98
+ productBlockX: number;
99
+ productBlockY: number;
100
+ maxHeightLineProductBlock: number;
101
+ attributes: any;
102
+ fields: any[];
103
+ defaultStyle: string;
104
+ mapping: any[];
105
+ startPageNumber: number;
106
+ constructor(init?: Partial<DataSheet>);
107
+ getMessageGeneration(): any;
108
+ GetBlockY(allTags: any): number;
109
+ setStyleTagForTableVariants(): void;
110
+ cleanMemory(): void;
111
+ }
112
+
113
+ declare class DataSheetSVG {
114
+ DataSheet: DataSheet;
115
+ previewId: number;
116
+ constructor(dataSheet: DataSheet);
117
+ setParams(apiUrl: string, token: string): void;
118
+ GenerateSvgFiles(lstSkus: any, backgroundTplLeft: any, backgroundTplRight: any, sectionId?: string, fast?: boolean): Promise<{
119
+ name: string;
120
+ sectionId: string;
121
+ svg: string;
122
+ }[] | null>;
123
+ private GenerateProductBlock;
124
+ GenerateOnlyProductBlock(publicationTemplateString: any, publicationTemplateVariantTableSetting: any, templateGuid: string, publicationTemplateGuid: string, productData: any, xStart?: number, yStart?: number): Promise<{
125
+ groupString: string;
126
+ styleString: string;
127
+ defString: string;
128
+ } | null>;
129
+ LoadAttributesIfEmpty(): Promise<void>;
130
+ RemoveUnwantedSVGTags(svgContent: string): string;
131
+ CleanMissingFilters(svgContent: string): string;
132
+ RemoveUnwantedSVGTagsOld(svgContent: string): string;
133
+ ChangeAllIdsGroup(tplGroup: any, count: number): any;
134
+ ChangeAllX(tplGroup: any, count: number, blockWidth: number): any;
135
+ ChangeAllYBis(tplGroup: any, blockHeight: number): any;
136
+ ChangeAllXOldV2(tplGroup: any, count: number, blockWidth: number): any;
137
+ ChangeAllYBisOld(tplGroup: any, blockHeight: number): any;
138
+ CleanHtmlAttributesBeforeParsing(html: string): string;
139
+ NormalizeHTML(str: string): string;
140
+ GetAllTags(svgString?: string): Element[] | null;
141
+ CleanDuplicateViewBox(svgString: string): string;
142
+ SetAllInfos(element: any): any;
143
+ parseCellTemplates(td: HTMLElement): {
144
+ type: string | null;
145
+ textBefore: string;
146
+ text: string;
147
+ textAfter: string;
148
+ format: string | null;
149
+ height: string | null;
150
+ textTransform: string | null;
151
+ }[];
152
+ getDataAttribute(el: HTMLElement, attr: string, defaultValue: string | null): string | null;
153
+ safeParseFloat(val: string | null | undefined): number;
154
+ GetFieldsToReplace(element: any): any[];
155
+ getPropertyOfField(fieldToSearch: string): string | null;
156
+ getNewValTable(jRowSku: any, tag: any, svgContent: any, allBlocksHeight: any, blockWidth: any, nbBlockInRow: any): Promise<any[] | null>;
157
+ generateRowHTML(jSku: any, arrayField: any[], SkuRows: string[], iSku: number): Promise<{
158
+ currentRow: string;
159
+ currentRowWithoutStyle: string;
160
+ }>;
161
+ generateCellContent(fieldObjectTable: any, skuValue: string, skuRowValue: string): Promise<string>;
162
+ generateCellStyle(header: any, body: any, iSku: number): string;
163
+ removeEmptyColumns(tableHtml: string, tag: any, tpl?: string): {
164
+ colgroup: null;
165
+ thead: null;
166
+ tbodyArray: null;
167
+ } | {
168
+ colgroup: string;
169
+ thead: any;
170
+ tbodyArray: any[];
171
+ };
172
+ removeEmptyColumnsOld(tableHtml: string, tag: any, tpl?: string): string;
173
+ getNewVal(field: string, jRowSku: any, idVal?: string, tag?: any, showText?: boolean, showPicto?: boolean, separator?: string): string | null;
174
+ getNewColorVal(field: any, jRowSku: any, idVal: any): string;
175
+ addStyle(styles: any, key: any, value: any): void;
176
+ private getHierarchyWrapper;
177
+ FormatPrice(val: any): string;
178
+ replaceDynamicTextInHtml(html: any, target: any, replacement: any): any;
179
+ escapeRegex(string: any): any;
180
+ replaceSpecialCharactersForHtml(newVal: any): any;
181
+ PrepareBackgroundTpl(svg: any): any;
182
+ GetSvgGroupToReplace(svg: any): any;
183
+ delay(ms?: number): Promise<unknown>;
184
+ ReplaceFieldsTemplateSVG(jRowSku: any, tpl: any, allTags: any, allBlocksHeight?: number, nbBlockInRow?: number): Promise<any>;
185
+ optimizeProductTable(foEl: any, tpl?: string): {
186
+ width: number;
187
+ height: number;
188
+ };
189
+ deleteBlock(svg: any): Promise<any>;
190
+ deleteLine(svg: any): Promise<any>;
191
+ getBackgroundSectionForPreview(section: any): any;
192
+ getMarketingSectionForPreview(section: any): any;
193
+ getCleanedSVGString(svg: string, soft?: boolean): Promise<string | undefined>;
194
+ selfCloseImgTags(svg: string): string;
195
+ sanitizeSVGString(svg: string): string;
196
+ removeDuplicateAttributesFromTag(tagString: string): string;
197
+ addWidthHeightFromViewBox(svgElement: SVGSVGElement): void;
198
+ convertImgSrcToBase64(svgElement: Element): Promise<void>;
199
+ private blobToBase64;
200
+ removeDuplicateAttributes(element: Element): void;
201
+ GenerateBarcode(tag: any, newVal: string, defaultFormat?: string): Promise<string>;
202
+ GenerateQRCode(tag: any, newVal: string): Promise<string>;
203
+ ChangeBlockHeight(svgContents: string, newHeight: number, oldHeight: number, allTags: any[], currentTag: any): string | null;
204
+ GetRectPositions(tag: any, listTags: any[]): void;
205
+ GetLinkedRect(tag: any, listTags: any[]): any;
206
+ GetXY(element: any): (string | null)[];
207
+ SetHeight(tag: any, height: number): void;
208
+ GetTagUrl(tag: any, jRowSku: any): string | null;
209
+ addCuttingLine(): string;
210
+ createLineSVG(x0: number, y0: number, x1: number, y1: number): string;
211
+ keepOnlySideRegex(svg: string, sideToKeep: string): string;
212
+ applyTextTransform(val: any, transform: string | null): any;
213
+ }
214
+
215
+ declare class DataSheetSingleton {
216
+ private static instance;
217
+ attributes: any[];
218
+ fields: any[];
219
+ token: string;
220
+ apiUrl: string;
221
+ private constructor();
222
+ static getInstance(): DataSheetSingleton;
223
+ private getAttributesByType;
224
+ private getFields;
225
+ loadAttributes(): Promise<any[]>;
226
+ destroy(): void;
227
+ }
228
+
229
+ export { DataSheet, DataSheetSVG, DataSheetSingleton, SourceData, TypeDatasheet };
package/package.json ADDED
@@ -0,0 +1,26 @@
1
+ {
2
+ "name": "@solidpepper/solidpepper-solidgeneration",
3
+ "version": "0.1.1",
4
+ "description": "Solidpepper - generation service",
5
+ "peerDependencies": {
6
+ "@angular/common": "^20.1.6",
7
+ "@angular/core": "^20.1.6"
8
+ },
9
+ "dependencies": {
10
+ "jsbarcode": "^3.12.3",
11
+ "qr-code-styling": "^1.9.2",
12
+ "tslib": "^2.3.0"
13
+ },
14
+ "sideEffects": false,
15
+ "module": "fesm2022/solidpepper-solidpepper-solidgeneration.mjs",
16
+ "typings": "index.d.ts",
17
+ "exports": {
18
+ "./package.json": {
19
+ "default": "./package.json"
20
+ },
21
+ ".": {
22
+ "types": "./index.d.ts",
23
+ "default": "./fesm2022/solidpepper-solidpepper-solidgeneration.mjs"
24
+ }
25
+ }
26
+ }