@hprint/plugins 0.0.2 → 0.0.4
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/dist/index.js +10 -10
- package/dist/index.mjs +128 -130
- package/dist/src/plugins/BarCodePlugin.d.ts.map +1 -1
- package/package.json +3 -3
- package/src/plugins/AlignGuidLinePlugin.ts +1152 -1152
- package/src/plugins/BarCodePlugin.ts +18 -0
- package/src/plugins/GroupAlignPlugin.ts +365 -365
- package/src/plugins/LockPlugin.ts +242 -242
- package/src/plugins/ResizePlugin.ts +278 -278
- package/src/plugins/RulerPlugin.ts +78 -78
- package/src/plugins/UnitPlugin.ts +348 -348
- package/src/plugins/WaterMarkPlugin.ts +257 -257
- package/src/utils/ruler/ruler.ts +936 -936
|
@@ -881,6 +881,24 @@ class BarCodePlugin implements IPluginTempl {
|
|
|
881
881
|
originMapped.width = originMapped.boxWidth;
|
|
882
882
|
delete originMapped.boxWidth;
|
|
883
883
|
}
|
|
884
|
+
|
|
885
|
+
// Format extension values with precision
|
|
886
|
+
const precision = (this.editor as any).getPrecision?.();
|
|
887
|
+
const extensionFields: Record<string, any> = {};
|
|
888
|
+
// Store fontSize and other extension fields from origin
|
|
889
|
+
if (origin.fontSize !== undefined) {
|
|
890
|
+
extensionFields.fontSize = origin.fontSize;
|
|
891
|
+
}
|
|
892
|
+
// Add other extension-related fields if they exist in origin
|
|
893
|
+
const extensionKeys = ['fontFamily', 'fontWeight', 'fontStyle', 'underline', 'linethrough', 'textAlign', 'textPosition', 'charSpacing', 'lineHeight', 'isShowText'];
|
|
894
|
+
extensionKeys.forEach(key => {
|
|
895
|
+
if (origin[key] !== undefined) {
|
|
896
|
+
extensionFields[key] = origin[key];
|
|
897
|
+
}
|
|
898
|
+
});
|
|
899
|
+
const formattedExtension = formatOriginValues(extensionFields, precision);
|
|
900
|
+
originMapped.extension = formattedExtension;
|
|
901
|
+
|
|
884
902
|
(imgEl as any)._originSize = { [unit]: originMapped };
|
|
885
903
|
|
|
886
904
|
this._bindBarcodeEvents(imgEl);
|