@solidpepper/solidpepper-soliddesigner 0.2.11 → 0.2.12
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/fesm2022/{solidpepper-solidpepper-soliddesigner-image-utils-D1vHcIM6.mjs → solidpepper-solidpepper-soliddesigner-image-utils-CsHCLYlK.mjs} +2 -2
- package/fesm2022/{solidpepper-solidpepper-soliddesigner-image-utils-D1vHcIM6.mjs.map → solidpepper-solidpepper-soliddesigner-image-utils-CsHCLYlK.mjs.map} +1 -1
- package/fesm2022/{solidpepper-solidpepper-soliddesigner-page-grid-modal.component-nH6bYnvT.mjs → solidpepper-solidpepper-soliddesigner-page-grid-modal.component-CKrZ7wW2.mjs} +2 -2
- package/fesm2022/{solidpepper-solidpepper-soliddesigner-page-grid-modal.component-nH6bYnvT.mjs.map → solidpepper-solidpepper-soliddesigner-page-grid-modal.component-CKrZ7wW2.mjs.map} +1 -1
- package/fesm2022/{solidpepper-solidpepper-soliddesigner-solidpepper-solidpepper-soliddesigner-DObN-3fp.mjs → solidpepper-solidpepper-soliddesigner-solidpepper-solidpepper-soliddesigner-DGb_DH3q.mjs} +4489 -1415
- package/fesm2022/solidpepper-solidpepper-soliddesigner-solidpepper-solidpepper-soliddesigner-DGb_DH3q.mjs.map +1 -0
- package/fesm2022/solidpepper-solidpepper-soliddesigner.mjs +1 -1
- package/index.d.ts +437 -3
- package/package.json +1 -1
- package/fesm2022/solidpepper-solidpepper-soliddesigner-solidpepper-solidpepper-soliddesigner-DObN-3fp.mjs.map +0 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { A as AppParamsService, c as SolidDesignerComponent } from './solidpepper-solidpepper-soliddesigner-solidpepper-solidpepper-soliddesigner-
|
|
1
|
+
export { A as AppParamsService, D as DocumentType, e as SOLID_DESIGNER_DOCUMENT_MODEL, c as SolidDesignerComponent, d as SvgJsonService } from './solidpepper-solidpepper-soliddesigner-solidpepper-solidpepper-soliddesigner-DGb_DH3q.mjs';
|
|
2
2
|
//# sourceMappingURL=solidpepper-solidpepper-soliddesigner.mjs.map
|
package/index.d.ts
CHANGED
|
@@ -231,7 +231,7 @@ declare class CanvasService {
|
|
|
231
231
|
}>;
|
|
232
232
|
readonly baseScale: _angular_core.WritableSignal<number>;
|
|
233
233
|
readonly isReady: _angular_core.WritableSignal<boolean>;
|
|
234
|
-
readonly currentContext: _angular_core.WritableSignal<
|
|
234
|
+
readonly currentContext: _angular_core.WritableSignal<SVGSVGElement | SVGGElement | null>;
|
|
235
235
|
readonly modifiedPulse: _angular_core.WritableSignal<number>;
|
|
236
236
|
readonly isSilent: _angular_core.WritableSignal<boolean>;
|
|
237
237
|
readonly versionUpgraded: _angular_core.WritableSignal<boolean>;
|
|
@@ -849,5 +849,439 @@ declare class AppComponent implements OnInit, OnChanges {
|
|
|
849
849
|
static ɵcmp: _angular_core.ɵɵComponentDeclaration<AppComponent, "solid-designer", never, { "token": { "alias": "token"; "required": false; }; "type": { "alias": "type"; "required": false; }; "guid": { "alias": "guid"; "required": false; }; "apiUrl": { "alias": "apiUrl"; "required": false; }; "language": { "alias": "language"; "required": false; }; "unit": { "alias": "unit"; "required": false; }; "pageNumber": { "alias": "pageNumber"; "required": false; }; "pageGuid": { "alias": "pageGuid"; "required": false; }; }, { "exitEditor": "exitEditor"; }, never, never, true, never>;
|
|
850
850
|
}
|
|
851
851
|
|
|
852
|
-
|
|
853
|
-
|
|
852
|
+
/**
|
|
853
|
+
* GENERATED FILE - DO NOT EDIT DIRECTLY.
|
|
854
|
+
* Generated automatically from designer.model.ts by tools/sync-designer-model.mjs
|
|
855
|
+
*/
|
|
856
|
+
declare const SOLID_DESIGNER_DOCUMENT_MODEL = "\n/* ========================================================================== */\n/* MODELS & INTERFACES */\n/* ========================================================================== */\n\nimport { DocumentType } from './document-type';\n\nexport { DocumentType };\n\n/**\n * Structure principale du document SolidDesigner en JSON\n */\nexport interface SolidDesignerDocument {\n spVersion: string;\n metadata?: DocumentMetadata;\n document: DocumentSettings;\n defs?: DocumentDefs;\n pages: DocumentPage[];\n}\n\nexport interface DocumentMetadata {\n title?: string;\n documentType: DocumentType | string; // document's type\n createdAt?: string;\n updatedAt?: string;\n author?: string;\n customData?: Record<string, any>;\n}\n\nexport interface DocumentSettings {\n width: number;\n height: number;\n unit: 'mm' | 'cm' | 'px' | 'in'; // even if the unit is different than px, consider it is in px for positionning, sizes, etc.\n viewBox?: string; // dimensions of the document (0 0 width height)\n backgroundColor?: string; // DON'T MODIFY IT. Use a rect element instead if you want to have a background color\n margins: DocumentMargins;\n doublePage: DoublePageSettings;\n}\n\nexport interface DocumentMargins {\n top: number;\n bottom: number;\n left: number;\n right: number;\n vertical?: number;\n horizontal?: number;\n headerHeight?: number;\n footerHeight?: number;\n bleed: BleedMargins;\n}\n\nexport interface BleedMargins {\n top: number;\n bottom: number;\n left: number;\n right: number;\n}\n\nexport interface DoublePageSettings {\n enabled: boolean;\n activeSide?: 'left' | 'right';\n}\n\nexport interface DocumentDefs {\n linearGradients?: LinearGradientDef[];\n radialGradients?: RadialGradientDef[];\n patterns?: PatternDef[];\n rawDefs?: string[];\n}\n\nexport interface LinearGradientDef {\n id: string;\n x1?: string;\n y1?: string;\n x2?: string;\n y2?: string;\n gradientTransform?: string;\n stops: Array<{ offset: string; color: string; opacity?: number }>;\n}\n\nexport interface RadialGradientDef {\n id: string;\n cx?: string;\n cy?: string;\n r?: string;\n gradientTransform?: string;\n stops: Array<{ offset: string; color: string; opacity?: number }>;\n}\n\nexport interface PatternDef {\n id: string;\n x?: string;\n y?: string;\n width: number | string;\n height: number | string;\n patternUnits?: string;\n patternContentHtml: string;\n}\n\nexport interface DocumentPage {\n id: string;\n side: 'left' | 'right' | 'single';\n elements: DesignerElement[];\n}\n\nexport interface ConditionalHideRule {\n enabled: boolean;\n attribute?: string;\n operator?: 'is_null' | 'is_not_null' | 'equals' | 'not_equals' | 'variant_exists' | 'variant_not_exists' | string;\n value?: string;\n variant?: number;\n}\n\nexport interface StrokeStyle {\n color: string;\n width: number;\n style?: 'solid' | 'dashed' | 'dotted' | string;\n dashArray?: string;\n lineCap?: 'butt' | 'round' | 'square' | string;\n lineJoin?: 'miter' | 'round' | 'bevel' | string;\n}\n\nexport interface ElementBorder {\n width?: string | number;\n color?: string;\n style?: string;\n radius?: number;\n}\n\nexport interface BaseElement {\n id: string;\n name?: string;\n type: ElementType;\n x: number;\n y: number;\n width?: number;\n height?: number;\n rotation?: number;\n opacity?: number;\n side?: 'left' | 'right';\n conditionalHide?: ConditionalHideRule;\n customDataAttributes?: Record<string, string>;\n}\n\nexport type ElementType =\n | 'text'\n | 'image'\n | 'dynamicImage'\n | 'qrcode'\n | 'barcode'\n | 'productTable'\n | 'variantsTable'\n | 'rect'\n | 'circle'\n | 'ellipse'\n | 'line'\n | 'polyline'\n | 'path'\n | 'template'\n | 'callout'\n | 'group'\n | 'svg';\n\nexport interface TextElement extends BaseElement {\n type: 'text';\n content: TextElementLine[]; // each element represent a line\n style: {\n fontFamily: string;\n fontSize: number;\n fontWeight?: string | number;\n fontStyle?: string;\n textDecoration?: string;\n textAlign: 'left' | 'center' | 'right' | 'justify' | string;\n lineHeight?: string; // Value in px (DON'T include the unit in the value). Default value is \"0\" and \"0\" mean automatic (adapt to font size). prefer using \"0\" to let the text adapt to font size.\n color: string;\n backgroundColor?: string;\n padding?: { top?: number; right?: number; bottom?: number; left?: number };\n border?: ElementBorder;\n };\n}\n\nexport interface TextElementLine {\n textElements: TextElementPart[];\n}\n\nexport interface TextElementPart {\n /**\n * Text element part, isVariable = true for a variable, false for a normal text. Only use text variables listed above\n */\n isVariable: boolean;\n content: string;\n color?: string;\n bold?: boolean;\n italic?: boolean;\n underline?: boolean;\n strikethrough?: boolean;\n highlightedColor?: string; // leave empty for no highlight\n}\n\nexport interface ImageElement extends BaseElement {\n /*\n For a dynamic image (most likely) : fill \"selectedImageField\" ONLY with image variable above.\n */\n type: 'image' | 'dynamicImage';\n isDynamic: boolean;\n source: {\n src?: string;\n assetGuid?: string;\n hdUrl?: string;\n sdUrl?: string;\n selectedImageField?: string;\n imageIndex?: number;\n };\n display: {\n objectFit: 'contain' | 'cover' | 'fill' | 'none' | string;\n filter?: string;\n internalRotation?: number;\n crop?: {\n top: number;\n right: number;\n bottom: number;\n left: number;\n };\n };\n border?: ElementBorder;\n}\n\nexport interface QrCodeElement extends BaseElement {\n type: 'qrcode';\n field: string;\n codeDimensions: {\n width: number;\n height: number;\n margin: number;\n };\n style: {\n dotType: 'square' | 'dots' | 'rounded';\n dotColor: string;\n cornersSquareType: 'square' | 'extra-rounded' | 'rounded';\n cornersSquareColor: string;\n cornersDotType: 'square' | 'dots' | 'rounded';\n cornersDotColor: string;\n backgroundColor: string;\n };\n logo?: {\n url?: string;\n size: number;\n margin: number;\n hideBackgroundDots: boolean;\n };\n}\n\nexport interface BarcodeElement extends BaseElement {\n type: 'barcode';\n field: string;\n format: 'EAN13' | 'EAN8' | 'EAN5' | 'EAN2' | 'UPC' | 'CODE128' | 'CODE128A' | 'CODE128C' | 'CODE39' | 'ITF' | 'MSI' | 'pharmacode';\n barWidth: 1 | 2 | 3 | 4;\n barHeight: 100;\n margin: 10;\n displayValue: boolean;\n textStyle?: {\n position?: 'bottom';\n align?: 'center';\n fontFamily?: string;\n fontSize?: number;\n };\n lineColor: string;\n backgroundColor: string;\n}\n\nexport interface TableElement extends BaseElement {\n type: 'productTable' | 'variantsTable';\n tableStyle: {\n verticalPadding: string;\n horizontalPadding: string;\n borderCollapse?: string;\n };\n columns: Array<{\n width: string;\n maxWidth?: string;\n }>;\n rows: Array<{\n isHeader?: boolean;\n minHeight?: string;\n cells: TableCell[];\n }>;\n}\n\nexport interface TableCell {\n content: string;\n colSpan?: number;\n rowSpan?: number;\n parentColIndex?: number;\n parentRowIndex?: number;\n styles?: {\n fontFamily?: string;\n fontSize?: string;\n fontWeight?: string;\n fontStyle?: string;\n textDecoration?: string;\n color?: string;\n backgroundColor?: string;\n textAlign?: string;\n alignItems?: string;\n justifyContent?: string;\n borders?: {\n top?: BorderSide;\n right?: BorderSide;\n bottom?: BorderSide;\n left?: BorderSide;\n };\n padding?: { top?: string; right?: string; bottom?: string; left?: string };\n };\n}\n\nexport interface BorderSide {\n width: string;\n color: string;\n style: 'dash' | 'solid' | 'dotted' | 'none';\n}\n\nexport interface RectElement extends BaseElement {\n type: 'rect';\n rx?: number;\n ry?: number;\n fill: string;\n stroke?: StrokeStyle;\n}\n\nexport interface EllipseElement extends BaseElement {\n type: 'ellipse' | 'circle';\n cx: number;\n cy: number;\n rx: number;\n ry: number;\n fill: string;\n stroke?: StrokeStyle;\n}\n\nexport interface LineElement extends BaseElement {\n type: 'line';\n x1: number;\n y1: number;\n x2: number;\n y2: number;\n stroke: StrokeStyle;\n}\n\nexport interface PathElement extends BaseElement {\n type: 'path' | 'polyline';\n d: string;\n fill?: string;\n stroke?: StrokeStyle;\n originalBBox?: { x: number; y: number; width: number; height: number };\n}\n\nexport interface TemplateElement extends BaseElement {\n type: 'template' | 'callout';\n templateGuid?: string;\n blockGuid?: string;\n skuGuid?: string;\n skuRef?: string;\n productSheetGuid?: string;\n isPlaceholder: boolean;\n children?: DesignerElement[];\n}\n\nexport interface GroupElement extends BaseElement {\n type: 'group';\n children: DesignerElement[];\n}\n\nexport type DesignerElement =\n | TextElement\n | ImageElement\n | QrCodeElement\n | BarcodeElement\n | TableElement\n | RectElement\n | EllipseElement\n | LineElement\n | PathElement\n | TemplateElement\n | GroupElement;\n";
|
|
857
|
+
|
|
858
|
+
/**
|
|
859
|
+
* Structure principale du document SolidDesigner en JSON
|
|
860
|
+
*/
|
|
861
|
+
interface SolidDesignerDocument {
|
|
862
|
+
spVersion: string;
|
|
863
|
+
metadata?: DocumentMetadata;
|
|
864
|
+
document: DocumentSettings;
|
|
865
|
+
defs?: DocumentDefs;
|
|
866
|
+
pages: DocumentPage[];
|
|
867
|
+
}
|
|
868
|
+
interface DocumentMetadata {
|
|
869
|
+
title?: string;
|
|
870
|
+
documentType: DocumentType | string;
|
|
871
|
+
createdAt?: string;
|
|
872
|
+
updatedAt?: string;
|
|
873
|
+
author?: string;
|
|
874
|
+
customData?: Record<string, any>;
|
|
875
|
+
}
|
|
876
|
+
interface DocumentSettings {
|
|
877
|
+
width: number;
|
|
878
|
+
height: number;
|
|
879
|
+
unit: 'mm' | 'cm' | 'px' | 'in';
|
|
880
|
+
viewBox?: string;
|
|
881
|
+
backgroundColor?: string;
|
|
882
|
+
margins: DocumentMargins;
|
|
883
|
+
doublePage: DoublePageSettings;
|
|
884
|
+
}
|
|
885
|
+
interface DocumentMargins {
|
|
886
|
+
top: number;
|
|
887
|
+
bottom: number;
|
|
888
|
+
left: number;
|
|
889
|
+
right: number;
|
|
890
|
+
vertical?: number;
|
|
891
|
+
horizontal?: number;
|
|
892
|
+
headerHeight?: number;
|
|
893
|
+
footerHeight?: number;
|
|
894
|
+
bleed: BleedMargins;
|
|
895
|
+
}
|
|
896
|
+
interface BleedMargins {
|
|
897
|
+
top: number;
|
|
898
|
+
bottom: number;
|
|
899
|
+
left: number;
|
|
900
|
+
right: number;
|
|
901
|
+
}
|
|
902
|
+
interface DoublePageSettings {
|
|
903
|
+
enabled: boolean;
|
|
904
|
+
activeSide?: 'left' | 'right';
|
|
905
|
+
}
|
|
906
|
+
interface DocumentDefs {
|
|
907
|
+
linearGradients?: LinearGradientDef[];
|
|
908
|
+
radialGradients?: RadialGradientDef[];
|
|
909
|
+
patterns?: PatternDef[];
|
|
910
|
+
rawDefs?: string[];
|
|
911
|
+
}
|
|
912
|
+
interface LinearGradientDef {
|
|
913
|
+
id: string;
|
|
914
|
+
x1?: string;
|
|
915
|
+
y1?: string;
|
|
916
|
+
x2?: string;
|
|
917
|
+
y2?: string;
|
|
918
|
+
gradientTransform?: string;
|
|
919
|
+
stops: Array<{
|
|
920
|
+
offset: string;
|
|
921
|
+
color: string;
|
|
922
|
+
opacity?: number;
|
|
923
|
+
}>;
|
|
924
|
+
}
|
|
925
|
+
interface RadialGradientDef {
|
|
926
|
+
id: string;
|
|
927
|
+
cx?: string;
|
|
928
|
+
cy?: string;
|
|
929
|
+
r?: string;
|
|
930
|
+
gradientTransform?: string;
|
|
931
|
+
stops: Array<{
|
|
932
|
+
offset: string;
|
|
933
|
+
color: string;
|
|
934
|
+
opacity?: number;
|
|
935
|
+
}>;
|
|
936
|
+
}
|
|
937
|
+
interface PatternDef {
|
|
938
|
+
id: string;
|
|
939
|
+
x?: string;
|
|
940
|
+
y?: string;
|
|
941
|
+
width: number | string;
|
|
942
|
+
height: number | string;
|
|
943
|
+
patternUnits?: string;
|
|
944
|
+
patternContentHtml: string;
|
|
945
|
+
}
|
|
946
|
+
interface DocumentPage {
|
|
947
|
+
id: string;
|
|
948
|
+
side: 'left' | 'right' | 'single';
|
|
949
|
+
elements: DesignerElement[];
|
|
950
|
+
}
|
|
951
|
+
interface ConditionalHideRule {
|
|
952
|
+
enabled: boolean;
|
|
953
|
+
attribute?: string;
|
|
954
|
+
operator?: 'is_null' | 'is_not_null' | 'equals' | 'not_equals' | 'variant_exists' | 'variant_not_exists' | string;
|
|
955
|
+
value?: string;
|
|
956
|
+
variant?: number;
|
|
957
|
+
}
|
|
958
|
+
interface StrokeStyle {
|
|
959
|
+
color: string;
|
|
960
|
+
width: number;
|
|
961
|
+
style?: 'solid' | 'dashed' | 'dotted' | string;
|
|
962
|
+
dashArray?: string;
|
|
963
|
+
lineCap?: 'butt' | 'round' | 'square' | string;
|
|
964
|
+
lineJoin?: 'miter' | 'round' | 'bevel' | string;
|
|
965
|
+
}
|
|
966
|
+
interface ElementBorder {
|
|
967
|
+
width?: string | number;
|
|
968
|
+
color?: string;
|
|
969
|
+
style?: string;
|
|
970
|
+
radius?: number;
|
|
971
|
+
}
|
|
972
|
+
interface BaseElement {
|
|
973
|
+
id: string;
|
|
974
|
+
name?: string;
|
|
975
|
+
type: ElementType;
|
|
976
|
+
x: number;
|
|
977
|
+
y: number;
|
|
978
|
+
width?: number;
|
|
979
|
+
height?: number;
|
|
980
|
+
rotation?: number;
|
|
981
|
+
opacity?: number;
|
|
982
|
+
side?: 'left' | 'right';
|
|
983
|
+
conditionalHide?: ConditionalHideRule;
|
|
984
|
+
customDataAttributes?: Record<string, string>;
|
|
985
|
+
}
|
|
986
|
+
type ElementType = 'text' | 'image' | 'dynamicImage' | 'qrcode' | 'barcode' | 'productTable' | 'variantsTable' | 'rect' | 'circle' | 'ellipse' | 'line' | 'polyline' | 'path' | 'template' | 'callout' | 'group' | 'svg';
|
|
987
|
+
interface TextElement extends BaseElement {
|
|
988
|
+
type: 'text';
|
|
989
|
+
content: TextElementLine[];
|
|
990
|
+
style: {
|
|
991
|
+
fontFamily: string;
|
|
992
|
+
fontSize: number;
|
|
993
|
+
fontWeight?: string | number;
|
|
994
|
+
fontStyle?: string;
|
|
995
|
+
textDecoration?: string;
|
|
996
|
+
textAlign: 'left' | 'center' | 'right' | 'justify' | string;
|
|
997
|
+
lineHeight?: string;
|
|
998
|
+
color: string;
|
|
999
|
+
backgroundColor?: string;
|
|
1000
|
+
padding?: {
|
|
1001
|
+
top?: number;
|
|
1002
|
+
right?: number;
|
|
1003
|
+
bottom?: number;
|
|
1004
|
+
left?: number;
|
|
1005
|
+
};
|
|
1006
|
+
border?: ElementBorder;
|
|
1007
|
+
};
|
|
1008
|
+
}
|
|
1009
|
+
interface TextElementLine {
|
|
1010
|
+
textElements: TextElementPart[];
|
|
1011
|
+
}
|
|
1012
|
+
interface TextElementPart {
|
|
1013
|
+
/**
|
|
1014
|
+
* Text element part, isVariable = true for a variable, false for a normal text. Only use text variables listed above
|
|
1015
|
+
*/
|
|
1016
|
+
isVariable: boolean;
|
|
1017
|
+
content: string;
|
|
1018
|
+
color?: string;
|
|
1019
|
+
bold?: boolean;
|
|
1020
|
+
italic?: boolean;
|
|
1021
|
+
underline?: boolean;
|
|
1022
|
+
strikethrough?: boolean;
|
|
1023
|
+
highlightedColor?: string;
|
|
1024
|
+
}
|
|
1025
|
+
interface ImageElement extends BaseElement {
|
|
1026
|
+
type: 'image' | 'dynamicImage';
|
|
1027
|
+
isDynamic: boolean;
|
|
1028
|
+
source: {
|
|
1029
|
+
src?: string;
|
|
1030
|
+
assetGuid?: string;
|
|
1031
|
+
hdUrl?: string;
|
|
1032
|
+
sdUrl?: string;
|
|
1033
|
+
selectedImageField?: string;
|
|
1034
|
+
imageIndex?: number;
|
|
1035
|
+
};
|
|
1036
|
+
display: {
|
|
1037
|
+
objectFit: 'contain' | 'cover' | 'fill' | 'none' | string;
|
|
1038
|
+
filter?: string;
|
|
1039
|
+
internalRotation?: number;
|
|
1040
|
+
crop?: {
|
|
1041
|
+
top: number;
|
|
1042
|
+
right: number;
|
|
1043
|
+
bottom: number;
|
|
1044
|
+
left: number;
|
|
1045
|
+
};
|
|
1046
|
+
};
|
|
1047
|
+
border?: ElementBorder;
|
|
1048
|
+
}
|
|
1049
|
+
interface QrCodeElement extends BaseElement {
|
|
1050
|
+
type: 'qrcode';
|
|
1051
|
+
field: string;
|
|
1052
|
+
codeDimensions: {
|
|
1053
|
+
width: number;
|
|
1054
|
+
height: number;
|
|
1055
|
+
margin: number;
|
|
1056
|
+
};
|
|
1057
|
+
style: {
|
|
1058
|
+
dotType: 'square' | 'dots' | 'rounded';
|
|
1059
|
+
dotColor: string;
|
|
1060
|
+
cornersSquareType: 'square' | 'extra-rounded' | 'rounded';
|
|
1061
|
+
cornersSquareColor: string;
|
|
1062
|
+
cornersDotType: 'square' | 'dots' | 'rounded';
|
|
1063
|
+
cornersDotColor: string;
|
|
1064
|
+
backgroundColor: string;
|
|
1065
|
+
};
|
|
1066
|
+
logo?: {
|
|
1067
|
+
url?: string;
|
|
1068
|
+
size: number;
|
|
1069
|
+
margin: number;
|
|
1070
|
+
hideBackgroundDots: boolean;
|
|
1071
|
+
};
|
|
1072
|
+
}
|
|
1073
|
+
interface BarcodeElement extends BaseElement {
|
|
1074
|
+
type: 'barcode';
|
|
1075
|
+
field: string;
|
|
1076
|
+
format: 'EAN13' | 'EAN8' | 'EAN5' | 'EAN2' | 'UPC' | 'CODE128' | 'CODE128A' | 'CODE128C' | 'CODE39' | 'ITF' | 'MSI' | 'pharmacode';
|
|
1077
|
+
barWidth: 1 | 2 | 3 | 4;
|
|
1078
|
+
barHeight: 100;
|
|
1079
|
+
margin: 10;
|
|
1080
|
+
displayValue: boolean;
|
|
1081
|
+
textStyle?: {
|
|
1082
|
+
position?: 'bottom';
|
|
1083
|
+
align?: 'center';
|
|
1084
|
+
fontFamily?: string;
|
|
1085
|
+
fontSize?: number;
|
|
1086
|
+
};
|
|
1087
|
+
lineColor: string;
|
|
1088
|
+
backgroundColor: string;
|
|
1089
|
+
}
|
|
1090
|
+
interface TableElement extends BaseElement {
|
|
1091
|
+
type: 'productTable' | 'variantsTable';
|
|
1092
|
+
tableStyle: {
|
|
1093
|
+
verticalPadding: string;
|
|
1094
|
+
horizontalPadding: string;
|
|
1095
|
+
borderCollapse?: string;
|
|
1096
|
+
};
|
|
1097
|
+
columns: Array<{
|
|
1098
|
+
width: string;
|
|
1099
|
+
maxWidth?: string;
|
|
1100
|
+
}>;
|
|
1101
|
+
rows: Array<{
|
|
1102
|
+
isHeader?: boolean;
|
|
1103
|
+
minHeight?: string;
|
|
1104
|
+
cells: TableCell[];
|
|
1105
|
+
}>;
|
|
1106
|
+
}
|
|
1107
|
+
interface TableCell {
|
|
1108
|
+
content: string;
|
|
1109
|
+
colSpan?: number;
|
|
1110
|
+
rowSpan?: number;
|
|
1111
|
+
parentColIndex?: number;
|
|
1112
|
+
parentRowIndex?: number;
|
|
1113
|
+
styles?: {
|
|
1114
|
+
fontFamily?: string;
|
|
1115
|
+
fontSize?: string;
|
|
1116
|
+
fontWeight?: string;
|
|
1117
|
+
fontStyle?: string;
|
|
1118
|
+
textDecoration?: string;
|
|
1119
|
+
color?: string;
|
|
1120
|
+
backgroundColor?: string;
|
|
1121
|
+
textAlign?: string;
|
|
1122
|
+
alignItems?: string;
|
|
1123
|
+
justifyContent?: string;
|
|
1124
|
+
borders?: {
|
|
1125
|
+
top?: BorderSide;
|
|
1126
|
+
right?: BorderSide;
|
|
1127
|
+
bottom?: BorderSide;
|
|
1128
|
+
left?: BorderSide;
|
|
1129
|
+
};
|
|
1130
|
+
padding?: {
|
|
1131
|
+
top?: string;
|
|
1132
|
+
right?: string;
|
|
1133
|
+
bottom?: string;
|
|
1134
|
+
left?: string;
|
|
1135
|
+
};
|
|
1136
|
+
};
|
|
1137
|
+
}
|
|
1138
|
+
interface BorderSide {
|
|
1139
|
+
width: string;
|
|
1140
|
+
color: string;
|
|
1141
|
+
style: 'dash' | 'solid' | 'dotted' | 'none';
|
|
1142
|
+
}
|
|
1143
|
+
interface RectElement extends BaseElement {
|
|
1144
|
+
type: 'rect';
|
|
1145
|
+
rx?: number;
|
|
1146
|
+
ry?: number;
|
|
1147
|
+
fill: string;
|
|
1148
|
+
stroke?: StrokeStyle;
|
|
1149
|
+
}
|
|
1150
|
+
interface EllipseElement extends BaseElement {
|
|
1151
|
+
type: 'ellipse' | 'circle';
|
|
1152
|
+
cx: number;
|
|
1153
|
+
cy: number;
|
|
1154
|
+
rx: number;
|
|
1155
|
+
ry: number;
|
|
1156
|
+
fill: string;
|
|
1157
|
+
stroke?: StrokeStyle;
|
|
1158
|
+
}
|
|
1159
|
+
interface LineElement extends BaseElement {
|
|
1160
|
+
type: 'line';
|
|
1161
|
+
x1: number;
|
|
1162
|
+
y1: number;
|
|
1163
|
+
x2: number;
|
|
1164
|
+
y2: number;
|
|
1165
|
+
stroke: StrokeStyle;
|
|
1166
|
+
}
|
|
1167
|
+
interface PathElement extends BaseElement {
|
|
1168
|
+
type: 'path' | 'polyline';
|
|
1169
|
+
d: string;
|
|
1170
|
+
fill?: string;
|
|
1171
|
+
stroke?: StrokeStyle;
|
|
1172
|
+
originalBBox?: {
|
|
1173
|
+
x: number;
|
|
1174
|
+
y: number;
|
|
1175
|
+
width: number;
|
|
1176
|
+
height: number;
|
|
1177
|
+
};
|
|
1178
|
+
}
|
|
1179
|
+
interface TemplateElement extends BaseElement {
|
|
1180
|
+
type: 'template' | 'callout';
|
|
1181
|
+
templateGuid?: string;
|
|
1182
|
+
blockGuid?: string;
|
|
1183
|
+
skuGuid?: string;
|
|
1184
|
+
skuRef?: string;
|
|
1185
|
+
productSheetGuid?: string;
|
|
1186
|
+
isPlaceholder: boolean;
|
|
1187
|
+
children?: DesignerElement[];
|
|
1188
|
+
}
|
|
1189
|
+
interface GroupElement extends BaseElement {
|
|
1190
|
+
type: 'group';
|
|
1191
|
+
children: DesignerElement[];
|
|
1192
|
+
}
|
|
1193
|
+
type DesignerElement = TextElement | ImageElement | QrCodeElement | BarcodeElement | TableElement | RectElement | EllipseElement | LineElement | PathElement | TemplateElement | GroupElement;
|
|
1194
|
+
|
|
1195
|
+
declare class SvgJsonService {
|
|
1196
|
+
private canvasService;
|
|
1197
|
+
private openService;
|
|
1198
|
+
private docService;
|
|
1199
|
+
private appParamsService;
|
|
1200
|
+
private imageElementService;
|
|
1201
|
+
private qrCodeElementService;
|
|
1202
|
+
private barcodeElementService;
|
|
1203
|
+
private readonly SVG_NS;
|
|
1204
|
+
private readonly XLINK_NS;
|
|
1205
|
+
private readonly XHTML_NS;
|
|
1206
|
+
/**
|
|
1207
|
+
* Convertit une chaîne SVG ou un élément SVGSVGElement en objet JSON structuré
|
|
1208
|
+
*/
|
|
1209
|
+
svgToJson(svgInput: string | SVGSVGElement): SolidDesignerDocument;
|
|
1210
|
+
/**
|
|
1211
|
+
* Extrait les propriétés globales du document depuis la balise <svg>
|
|
1212
|
+
*/
|
|
1213
|
+
private extractDocumentSettings;
|
|
1214
|
+
/**
|
|
1215
|
+
* Extrait les définitions SVG (<defs>)
|
|
1216
|
+
*/
|
|
1217
|
+
private extractDefs;
|
|
1218
|
+
/**
|
|
1219
|
+
* Parse récursivement un élément SVG en DesignerElement
|
|
1220
|
+
*/
|
|
1221
|
+
parseElement(el: SVGElement): DesignerElement | null;
|
|
1222
|
+
/**
|
|
1223
|
+
* Extrait les propriétés communes de BaseElement
|
|
1224
|
+
*/
|
|
1225
|
+
private extractBaseElementProps;
|
|
1226
|
+
private normalizeElementType;
|
|
1227
|
+
private parseTextElement;
|
|
1228
|
+
private parseTextLinesFromElement;
|
|
1229
|
+
private parseImageElement;
|
|
1230
|
+
private parseQrCodeElement;
|
|
1231
|
+
private parseBarcodeElement;
|
|
1232
|
+
private parseTableElement;
|
|
1233
|
+
private parseRectElement;
|
|
1234
|
+
private parseEllipseElement;
|
|
1235
|
+
private parseLineElement;
|
|
1236
|
+
private parsePathElement;
|
|
1237
|
+
private parseTemplateElement;
|
|
1238
|
+
private parseGroupElement;
|
|
1239
|
+
private extractStroke;
|
|
1240
|
+
private shouldIgnoreElement;
|
|
1241
|
+
/**
|
|
1242
|
+
* Convertit un document JSON SolidDesigner en élément DOM SVGSVGElement
|
|
1243
|
+
*/
|
|
1244
|
+
jsonToSvg(doc: SolidDesignerDocument): SVGSVGElement;
|
|
1245
|
+
/**
|
|
1246
|
+
* Convertit un document JSON en chaîne SVG XML complète
|
|
1247
|
+
*/
|
|
1248
|
+
jsonToSvgString(doc: SolidDesignerDocument): string;
|
|
1249
|
+
/**
|
|
1250
|
+
* Reconstruit la balise <defs>
|
|
1251
|
+
*/
|
|
1252
|
+
private buildDefs;
|
|
1253
|
+
/**
|
|
1254
|
+
* Construit un élément SVG DOM à partir de sa définition JSON
|
|
1255
|
+
*/
|
|
1256
|
+
buildElement(elData: DesignerElement, sideOverride?: 'left' | 'right' | 'both'): SVGElement | null;
|
|
1257
|
+
/**
|
|
1258
|
+
* Applique les attributs et styles communs (id, name, side, visibility, locks, hide-if)
|
|
1259
|
+
*/
|
|
1260
|
+
private applyBaseElementProps;
|
|
1261
|
+
private buildTextElement;
|
|
1262
|
+
private buildTextHtmlFromLines;
|
|
1263
|
+
private buildImageElement;
|
|
1264
|
+
private buildQrCodeElement;
|
|
1265
|
+
private buildBarcodeElement;
|
|
1266
|
+
private buildTableElement;
|
|
1267
|
+
private buildRectElement;
|
|
1268
|
+
private buildEllipseElement;
|
|
1269
|
+
private buildLineElement;
|
|
1270
|
+
private buildPathElement;
|
|
1271
|
+
private buildTemplateElement;
|
|
1272
|
+
private buildGroupElement;
|
|
1273
|
+
private applyStroke;
|
|
1274
|
+
/**
|
|
1275
|
+
* Exporte le contenu actuel du canvas en document JSON
|
|
1276
|
+
*/
|
|
1277
|
+
exportCurrentCanvasToJson(): SolidDesignerDocument | null;
|
|
1278
|
+
/**
|
|
1279
|
+
* Charge un document JSON directement dans le canvas du designer
|
|
1280
|
+
*/
|
|
1281
|
+
loadJsonToCanvas(doc: SolidDesignerDocument): void;
|
|
1282
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<SvgJsonService, never>;
|
|
1283
|
+
static ɵprov: _angular_core.ɵɵInjectableDeclaration<SvgJsonService>;
|
|
1284
|
+
}
|
|
1285
|
+
|
|
1286
|
+
export { AppParamsService, DocumentType, SOLID_DESIGNER_DOCUMENT_MODEL, AppComponent as SolidDesignerComponent, SvgJsonService };
|
|
1287
|
+
export type { AppParams, BarcodeElement, BaseElement, BleedMargins, BorderSide, ConditionalHideRule, DesignerElement, DocumentDefs, DocumentMargins, DocumentMetadata, DocumentPage, DocumentSettings, DoublePageSettings, ElementBorder, ElementType, EllipseElement, GroupElement, ImageElement, LineElement, LinearGradientDef, PathElement, PatternDef, QrCodeElement, RadialGradientDef, RectElement, SolidDesignerDocument, StrokeStyle, TableCell, TableElement, TemplateElement, TextElement, TextElementLine, TextElementPart };
|