@connectedxm/zpl-generator 0.0.4-beta.4 → 0.0.4-beta.5

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.
@@ -7,11 +7,9 @@ export declare function getFieldValue(field: Field, data?: SourceData): string |
7
7
  * Exported so consuming projects (e.g. React label previews) can reuse
8
8
  * the same logic to stay in sync with the generator.
9
9
  *
10
- * When wordWidths are provided, simulates ZPL word-wrap: words are placed
11
- * on the current line until the next word would exceed maxWidth, then a
12
- * new line is started. Explicit \& breaks always start a new line.
10
+ * When measuredWidth is provided (total rendered width in dots, as measured
11
+ * by the consumer), line count is estimated via ceil(measuredWidth / maxWidth).
13
12
  *
14
- * When wordWidths are not provided, falls back to a character-width
15
- * heuristic using fontHeight.
13
+ * Otherwise falls back to a character-width heuristic using charsPerLine.
16
14
  */
17
15
  export declare function countLines(field: TextField, value: string): number;
@@ -270,6 +270,7 @@ export declare const textFieldSchema: z.ZodObject<{
270
270
  readonly Capitalize: "Capitalize";
271
271
  }>;
272
272
  maxCharacters: z.ZodNumber;
273
+ measuredWidth: z.ZodOptional<z.ZodNumber>;
273
274
  }, z.core.$strip>;
274
275
  export type TextField = z.infer<typeof textFieldSchema>;
275
276
  export declare const barcodeFieldSchema: z.ZodObject<{
@@ -384,6 +385,7 @@ export declare const fieldSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
384
385
  readonly Capitalize: "Capitalize";
385
386
  }>;
386
387
  maxCharacters: z.ZodNumber;
388
+ measuredWidth: z.ZodOptional<z.ZodNumber>;
387
389
  }, z.core.$strip>, z.ZodObject<{
388
390
  name: z.ZodString;
389
391
  x: z.ZodNumber;
@@ -572,6 +574,7 @@ export declare const badgeSchema: z.ZodObject<{
572
574
  readonly Capitalize: "Capitalize";
573
575
  }>;
574
576
  maxCharacters: z.ZodNumber;
577
+ measuredWidth: z.ZodOptional<z.ZodNumber>;
575
578
  }, z.core.$strip>, z.ZodObject<{
576
579
  name: z.ZodString;
577
580
  x: z.ZodNumber;
@@ -702,6 +705,7 @@ export declare function validateBadge(data: Badge): z.ZodSafeParseResult<{
702
705
  charsPerLine: number;
703
706
  transformation: "None" | "Uppercase" | "Lowercase" | "Capitalize";
704
707
  maxCharacters: number;
708
+ measuredWidth?: number | undefined;
705
709
  } | {
706
710
  name: string;
707
711
  x: number;
@@ -787,6 +791,7 @@ export declare function validateBadgeOrThrow(data: Badge): {
787
791
  charsPerLine: number;
788
792
  transformation: "None" | "Uppercase" | "Lowercase" | "Capitalize";
789
793
  maxCharacters: number;
794
+ measuredWidth?: number | undefined;
790
795
  } | {
791
796
  name: string;
792
797
  x: number;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@connectedxm/zpl-generator",
3
- "version": "0.0.4-beta.4",
3
+ "version": "0.0.4-beta.5",
4
4
  "description": "",
5
5
  "license": "ISC",
6
6
  "author": "",