@twinfinity/printing 6.0.1-ci.28952-beta → 6.0.2-beta

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.
Files changed (82) hide show
  1. package/README.md +3 -3
  2. package/dist/BuildInfo.js +3 -3
  3. package/dist/BuildInfo.js.map +1 -1
  4. package/dist/index.js.map +1 -1
  5. package/dist/layout/analyzeTemplate.js.map +1 -1
  6. package/dist/layout/clipUtils.js.map +1 -1
  7. package/dist/layout/colorConstants.js.map +1 -1
  8. package/dist/layout/elementKinds.js.map +1 -1
  9. package/dist/layout/exportDrawing.js.map +1 -1
  10. package/dist/layout/filters.js.map +1 -1
  11. package/dist/layout/geometryConstants.js.map +1 -1
  12. package/dist/layout/index.js.map +1 -1
  13. package/dist/layout/itemBuilders.js.map +1 -1
  14. package/dist/layout/labelsRender.js.map +1 -1
  15. package/dist/layout/legendConstants.js.map +1 -1
  16. package/dist/layout/legendRender.js.map +1 -1
  17. package/dist/layout/legendRows.js.map +1 -1
  18. package/dist/layout/legendUtils.js.map +1 -1
  19. package/dist/layout/metadata.js.map +1 -1
  20. package/dist/layout/model.js.map +1 -1
  21. package/dist/layout/options.js.map +1 -1
  22. package/dist/layout/presets.js.map +1 -1
  23. package/dist/layout/qrRender.js.map +1 -1
  24. package/dist/layout/renderDrawing.js.map +1 -1
  25. package/dist/layout/renderUtils.js.map +1 -1
  26. package/dist/layout/sectionValidation.js.map +1 -1
  27. package/dist/layout/templateVariables.js.map +1 -1
  28. package/dist/layout/typeGuards.js.map +1 -1
  29. package/dist/layout/types.js.map +1 -1
  30. package/dist/layout/utils.js.map +1 -1
  31. package/dist/layout/validation.js.map +1 -1
  32. package/dist/layout/validationHelpers.js.map +1 -1
  33. package/dist/layout/validationUtils.js.map +1 -1
  34. package/dist/layout/viewportPrep.js.map +1 -1
  35. package/dist/layout/viewportRender.js.map +1 -1
  36. package/dist/layout/viewportUtils.js.map +1 -1
  37. package/dist/layout/warnings.js.map +1 -1
  38. package/dist/printToPdf.js.map +1 -1
  39. package/dist/printToSvg.js.map +1 -1
  40. package/dist/sections.js.map +1 -1
  41. package/dist/types.js.map +1 -1
  42. package/package.json +2 -2
  43. package/src/BuildInfo.ts +41 -41
  44. package/src/index.ts +10 -10
  45. package/src/layout/analyzeTemplate.ts +218 -218
  46. package/src/layout/clipUtils.ts +193 -193
  47. package/src/layout/colorConstants.ts +16 -16
  48. package/src/layout/elementKinds.ts +35 -35
  49. package/src/layout/exportDrawing.ts +206 -206
  50. package/src/layout/filters.ts +80 -80
  51. package/src/layout/geometryConstants.ts +11 -11
  52. package/src/layout/index.ts +671 -671
  53. package/src/layout/itemBuilders.ts +159 -159
  54. package/src/layout/labelsRender.ts +170 -170
  55. package/src/layout/legendConstants.ts +11 -11
  56. package/src/layout/legendRender.ts +543 -543
  57. package/src/layout/legendRows.ts +62 -62
  58. package/src/layout/legendUtils.ts +144 -144
  59. package/src/layout/metadata.ts +210 -210
  60. package/src/layout/model.ts +372 -372
  61. package/src/layout/options.ts +17 -17
  62. package/src/layout/presets.ts +51 -51
  63. package/src/layout/qrRender.ts +126 -126
  64. package/src/layout/qrcode.d.ts +2 -2
  65. package/src/layout/renderDrawing.ts +710 -710
  66. package/src/layout/renderUtils.ts +138 -138
  67. package/src/layout/sectionValidation.ts +2 -2
  68. package/src/layout/templateVariables.ts +317 -317
  69. package/src/layout/typeGuards.ts +9 -9
  70. package/src/layout/types.ts +835 -835
  71. package/src/layout/utils.ts +85 -85
  72. package/src/layout/validation.ts +392 -392
  73. package/src/layout/validationHelpers.ts +59 -59
  74. package/src/layout/validationUtils.ts +6 -6
  75. package/src/layout/viewportPrep.ts +351 -351
  76. package/src/layout/viewportRender.ts +442 -442
  77. package/src/layout/viewportUtils.ts +50 -50
  78. package/src/layout/warnings.ts +3 -3
  79. package/src/printToPdf.ts +108 -108
  80. package/src/printToSvg.ts +188 -188
  81. package/src/sections.ts +1019 -1019
  82. package/src/types.ts +49 -49
@@ -1,59 +1,59 @@
1
- import { isNonEmptyString } from './validationUtils';
2
- import { ValidationIssue } from './types';
3
-
4
- import { isRecord, getProp } from './typeGuards';
5
- export { isRecord, getProp };
6
-
7
- /**
8
- * Check if path is a valid short path: SetName.propertyName (e.g., "Pset_SpaceCommon.Reference")
9
- * This is the only accepted format for template paths.
10
- */
11
- export const isShortPath = (path: string): boolean =>
12
- typeof path === 'string' && /^[A-Za-z_][A-Za-z0-9_]*\.[A-Za-z_][A-Za-z0-9_]*$/.test(path.trim());
13
-
14
- /**
15
- * Push a "must use short path" error to the errors array.
16
- */
17
- export const pushShortPathError = (errors: ValidationIssue[], path: string, context: string): void => {
18
- errors.push({
19
- path,
20
- message: `${context} must use short format: SetName.propName (e.g., "Pset_SpaceCommon.Reference")`
21
- });
22
- };
23
-
24
- export const validateFilterPaths = (
25
- filters: unknown,
26
- basePath: string,
27
- errors: ValidationIssue[],
28
- context: string
29
- ): void => {
30
- if (Array.isArray(filters)) {
31
- filters.forEach((f: unknown, idx: number) => {
32
- const path = getProp(f, 'path');
33
- if (isRecord(f) && isNonEmptyString(path) && !isShortPath(path as string)) {
34
- errors.push({
35
- path: `${basePath}[${idx}].path`,
36
- message: `${context} path must use short format: SetName.propName (e.g., "Pset_SpaceCommon.Reference")`
37
- });
38
- }
39
- });
40
- }
41
- };
42
-
43
- export const validatePathShape = (
44
- path: string | undefined,
45
- errors: ValidationIssue[],
46
- fieldPath: string,
47
- context: string
48
- ): void => {
49
- if (!path || !path.trim().length) {
50
- errors.push({ path: fieldPath, message: `${context} path is required.` });
51
- return;
52
- }
53
- if (!isShortPath(path)) {
54
- errors.push({
55
- path: fieldPath,
56
- message: `${context} path must use short format: SetName.propName (e.g., "Pset_SpaceCommon.Reference")`
57
- });
58
- }
59
- };
1
+ import { isNonEmptyString } from './validationUtils';
2
+ import { ValidationIssue } from './types';
3
+
4
+ import { isRecord, getProp } from './typeGuards';
5
+ export { isRecord, getProp };
6
+
7
+ /**
8
+ * Check if path is a valid short path: SetName.propertyName (e.g., "Pset_SpaceCommon.Reference")
9
+ * This is the only accepted format for template paths.
10
+ */
11
+ export const isShortPath = (path: string): boolean =>
12
+ typeof path === 'string' && /^[A-Za-z_][A-Za-z0-9_]*\.[A-Za-z_][A-Za-z0-9_]*$/.test(path.trim());
13
+
14
+ /**
15
+ * Push a "must use short path" error to the errors array.
16
+ */
17
+ export const pushShortPathError = (errors: ValidationIssue[], path: string, context: string): void => {
18
+ errors.push({
19
+ path,
20
+ message: `${context} must use short format: SetName.propName (e.g., "Pset_SpaceCommon.Reference")`
21
+ });
22
+ };
23
+
24
+ export const validateFilterPaths = (
25
+ filters: unknown,
26
+ basePath: string,
27
+ errors: ValidationIssue[],
28
+ context: string
29
+ ): void => {
30
+ if (Array.isArray(filters)) {
31
+ filters.forEach((f: unknown, idx: number) => {
32
+ const path = getProp(f, 'path');
33
+ if (isRecord(f) && isNonEmptyString(path) && !isShortPath(path as string)) {
34
+ errors.push({
35
+ path: `${basePath}[${idx}].path`,
36
+ message: `${context} path must use short format: SetName.propName (e.g., "Pset_SpaceCommon.Reference")`
37
+ });
38
+ }
39
+ });
40
+ }
41
+ };
42
+
43
+ export const validatePathShape = (
44
+ path: string | undefined,
45
+ errors: ValidationIssue[],
46
+ fieldPath: string,
47
+ context: string
48
+ ): void => {
49
+ if (!path || !path.trim().length) {
50
+ errors.push({ path: fieldPath, message: `${context} path is required.` });
51
+ return;
52
+ }
53
+ if (!isShortPath(path)) {
54
+ errors.push({
55
+ path: fieldPath,
56
+ message: `${context} path must use short format: SetName.propName (e.g., "Pset_SpaceCommon.Reference")`
57
+ });
58
+ }
59
+ };
@@ -1,6 +1,6 @@
1
- export const isNonEmptyString = (value: unknown): value is string =>
2
- typeof value === 'string' && value.trim().length > 0;
3
- export const isPositiveNumber = (value: unknown): value is number =>
4
- typeof value === 'number' && Number.isFinite(value) && value > 0;
5
- export const isRemoteUrl = (value: string): boolean => /^https?:\/\//i.test(value);
6
- export const isDataUrl = (value: string): boolean => /^data:/i.test(value);
1
+ export const isNonEmptyString = (value: unknown): value is string =>
2
+ typeof value === 'string' && value.trim().length > 0;
3
+ export const isPositiveNumber = (value: unknown): value is number =>
4
+ typeof value === 'number' && Number.isFinite(value) && value > 0;
5
+ export const isRemoteUrl = (value: string): boolean => /^https?:\/\//i.test(value);
6
+ export const isDataUrl = (value: string): boolean => /^data:/i.test(value);