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

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;
@@ -238,7 +238,9 @@ export declare const textFieldSchema: z.ZodObject<{
238
238
  readonly passAttributes: "passAttributes";
239
239
  }>;
240
240
  sourceLookup: z.ZodString;
241
+ sourceSeperator: z.ZodString;
241
242
  hideEmpty: z.ZodBoolean;
243
+ editable: z.ZodBoolean;
242
244
  type: z.ZodLiteral<"text">;
243
245
  font: z.ZodString;
244
246
  fontOrientation: z.ZodEnum<{
@@ -270,6 +272,7 @@ export declare const textFieldSchema: z.ZodObject<{
270
272
  readonly Capitalize: "Capitalize";
271
273
  }>;
272
274
  maxCharacters: z.ZodNumber;
275
+ measuredWidth: z.ZodOptional<z.ZodNumber>;
273
276
  }, z.core.$strip>;
274
277
  export type TextField = z.infer<typeof textFieldSchema>;
275
278
  export declare const barcodeFieldSchema: z.ZodObject<{
@@ -286,7 +289,9 @@ export declare const barcodeFieldSchema: z.ZodObject<{
286
289
  readonly passAttributes: "passAttributes";
287
290
  }>;
288
291
  sourceLookup: z.ZodString;
292
+ sourceSeperator: z.ZodString;
289
293
  hideEmpty: z.ZodBoolean;
294
+ editable: z.ZodBoolean;
290
295
  type: z.ZodLiteral<"barcode">;
291
296
  barWidth: z.ZodNumber;
292
297
  orientation: z.ZodEnum<{
@@ -324,7 +329,9 @@ export declare const qrcodeFieldSchema: z.ZodObject<{
324
329
  readonly passAttributes: "passAttributes";
325
330
  }>;
326
331
  sourceLookup: z.ZodString;
332
+ sourceSeperator: z.ZodString;
327
333
  hideEmpty: z.ZodBoolean;
334
+ editable: z.ZodBoolean;
328
335
  type: z.ZodLiteral<"qrcode">;
329
336
  orientation: z.ZodLiteral<"N">;
330
337
  model: z.ZodLiteral<"2">;
@@ -352,7 +359,9 @@ export declare const fieldSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
352
359
  readonly passAttributes: "passAttributes";
353
360
  }>;
354
361
  sourceLookup: z.ZodString;
362
+ sourceSeperator: z.ZodString;
355
363
  hideEmpty: z.ZodBoolean;
364
+ editable: z.ZodBoolean;
356
365
  type: z.ZodLiteral<"text">;
357
366
  font: z.ZodString;
358
367
  fontOrientation: z.ZodEnum<{
@@ -384,6 +393,7 @@ export declare const fieldSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
384
393
  readonly Capitalize: "Capitalize";
385
394
  }>;
386
395
  maxCharacters: z.ZodNumber;
396
+ measuredWidth: z.ZodOptional<z.ZodNumber>;
387
397
  }, z.core.$strip>, z.ZodObject<{
388
398
  name: z.ZodString;
389
399
  x: z.ZodNumber;
@@ -398,7 +408,9 @@ export declare const fieldSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
398
408
  readonly passAttributes: "passAttributes";
399
409
  }>;
400
410
  sourceLookup: z.ZodString;
411
+ sourceSeperator: z.ZodString;
401
412
  hideEmpty: z.ZodBoolean;
413
+ editable: z.ZodBoolean;
402
414
  type: z.ZodLiteral<"barcode">;
403
415
  barWidth: z.ZodNumber;
404
416
  orientation: z.ZodEnum<{
@@ -434,7 +446,9 @@ export declare const fieldSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
434
446
  readonly passAttributes: "passAttributes";
435
447
  }>;
436
448
  sourceLookup: z.ZodString;
449
+ sourceSeperator: z.ZodString;
437
450
  hideEmpty: z.ZodBoolean;
451
+ editable: z.ZodBoolean;
438
452
  type: z.ZodLiteral<"qrcode">;
439
453
  orientation: z.ZodLiteral<"N">;
440
454
  model: z.ZodLiteral<"2">;
@@ -540,7 +554,9 @@ export declare const badgeSchema: z.ZodObject<{
540
554
  readonly passAttributes: "passAttributes";
541
555
  }>;
542
556
  sourceLookup: z.ZodString;
557
+ sourceSeperator: z.ZodString;
543
558
  hideEmpty: z.ZodBoolean;
559
+ editable: z.ZodBoolean;
544
560
  type: z.ZodLiteral<"text">;
545
561
  font: z.ZodString;
546
562
  fontOrientation: z.ZodEnum<{
@@ -572,6 +588,7 @@ export declare const badgeSchema: z.ZodObject<{
572
588
  readonly Capitalize: "Capitalize";
573
589
  }>;
574
590
  maxCharacters: z.ZodNumber;
591
+ measuredWidth: z.ZodOptional<z.ZodNumber>;
575
592
  }, z.core.$strip>, z.ZodObject<{
576
593
  name: z.ZodString;
577
594
  x: z.ZodNumber;
@@ -586,7 +603,9 @@ export declare const badgeSchema: z.ZodObject<{
586
603
  readonly passAttributes: "passAttributes";
587
604
  }>;
588
605
  sourceLookup: z.ZodString;
606
+ sourceSeperator: z.ZodString;
589
607
  hideEmpty: z.ZodBoolean;
608
+ editable: z.ZodBoolean;
590
609
  type: z.ZodLiteral<"barcode">;
591
610
  barWidth: z.ZodNumber;
592
611
  orientation: z.ZodEnum<{
@@ -622,7 +641,9 @@ export declare const badgeSchema: z.ZodObject<{
622
641
  readonly passAttributes: "passAttributes";
623
642
  }>;
624
643
  sourceLookup: z.ZodString;
644
+ sourceSeperator: z.ZodString;
625
645
  hideEmpty: z.ZodBoolean;
646
+ editable: z.ZodBoolean;
626
647
  type: z.ZodLiteral<"qrcode">;
627
648
  orientation: z.ZodLiteral<"N">;
628
649
  model: z.ZodLiteral<"2">;
@@ -688,7 +709,9 @@ export declare function validateBadge(data: Badge): z.ZodSafeParseResult<{
688
709
  defaultValue: string;
689
710
  sourceType: "account" | "accountAttributes" | "accountTiers" | "pass" | "passResponses" | "passAttributes";
690
711
  sourceLookup: string;
712
+ sourceSeperator: string;
691
713
  hideEmpty: boolean;
714
+ editable: boolean;
692
715
  type: "text";
693
716
  font: string;
694
717
  fontOrientation: "N" | "B" | "I" | "R";
@@ -702,6 +725,7 @@ export declare function validateBadge(data: Badge): z.ZodSafeParseResult<{
702
725
  charsPerLine: number;
703
726
  transformation: "None" | "Uppercase" | "Lowercase" | "Capitalize";
704
727
  maxCharacters: number;
728
+ measuredWidth?: number | undefined;
705
729
  } | {
706
730
  name: string;
707
731
  x: number;
@@ -709,7 +733,9 @@ export declare function validateBadge(data: Badge): z.ZodSafeParseResult<{
709
733
  defaultValue: string;
710
734
  sourceType: "account" | "accountAttributes" | "accountTiers" | "pass" | "passResponses" | "passAttributes";
711
735
  sourceLookup: string;
736
+ sourceSeperator: string;
712
737
  hideEmpty: boolean;
738
+ editable: boolean;
713
739
  type: "barcode";
714
740
  barWidth: number;
715
741
  orientation: "N" | "B" | "I" | "R";
@@ -724,7 +750,9 @@ export declare function validateBadge(data: Badge): z.ZodSafeParseResult<{
724
750
  defaultValue: string;
725
751
  sourceType: "account" | "accountAttributes" | "accountTiers" | "pass" | "passResponses" | "passAttributes";
726
752
  sourceLookup: string;
753
+ sourceSeperator: string;
727
754
  hideEmpty: boolean;
755
+ editable: boolean;
728
756
  type: "qrcode";
729
757
  orientation: "N";
730
758
  model: "2";
@@ -773,7 +801,9 @@ export declare function validateBadgeOrThrow(data: Badge): {
773
801
  defaultValue: string;
774
802
  sourceType: "account" | "accountAttributes" | "accountTiers" | "pass" | "passResponses" | "passAttributes";
775
803
  sourceLookup: string;
804
+ sourceSeperator: string;
776
805
  hideEmpty: boolean;
806
+ editable: boolean;
777
807
  type: "text";
778
808
  font: string;
779
809
  fontOrientation: "N" | "B" | "I" | "R";
@@ -787,6 +817,7 @@ export declare function validateBadgeOrThrow(data: Badge): {
787
817
  charsPerLine: number;
788
818
  transformation: "None" | "Uppercase" | "Lowercase" | "Capitalize";
789
819
  maxCharacters: number;
820
+ measuredWidth?: number | undefined;
790
821
  } | {
791
822
  name: string;
792
823
  x: number;
@@ -794,7 +825,9 @@ export declare function validateBadgeOrThrow(data: Badge): {
794
825
  defaultValue: string;
795
826
  sourceType: "account" | "accountAttributes" | "accountTiers" | "pass" | "passResponses" | "passAttributes";
796
827
  sourceLookup: string;
828
+ sourceSeperator: string;
797
829
  hideEmpty: boolean;
830
+ editable: boolean;
798
831
  type: "barcode";
799
832
  barWidth: number;
800
833
  orientation: "N" | "B" | "I" | "R";
@@ -809,7 +842,9 @@ export declare function validateBadgeOrThrow(data: Badge): {
809
842
  defaultValue: string;
810
843
  sourceType: "account" | "accountAttributes" | "accountTiers" | "pass" | "passResponses" | "passAttributes";
811
844
  sourceLookup: string;
845
+ sourceSeperator: string;
812
846
  hideEmpty: boolean;
847
+ editable: boolean;
813
848
  type: "qrcode";
814
849
  orientation: "N";
815
850
  model: "2";
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.6",
4
4
  "description": "",
5
5
  "license": "ISC",
6
6
  "author": "",