@betterinternship/core 2.36.0 → 3.0.0

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 (60) hide show
  1. package/dist/index.d.ts +0 -1
  2. package/dist/index.js +0 -1
  3. package/dist/index.js.map +1 -1
  4. package/dist/lib/pdf-viewer/BasePdfViewer.d.ts +4 -2
  5. package/dist/lib/pdf-viewer/BasePdfViewer.js +203 -5
  6. package/dist/lib/pdf-viewer/BasePdfViewer.js.map +1 -1
  7. package/dist/lib/pdf-viewer/index.d.ts +0 -5
  8. package/dist/lib/pdf-viewer/index.js +0 -5
  9. package/dist/lib/pdf-viewer/index.js.map +1 -1
  10. package/dist/lib/pdf-viewer/use-pdf-page-renderer.js +38 -11
  11. package/dist/lib/pdf-viewer/use-pdf-page-renderer.js.map +1 -1
  12. package/package.json +88 -93
  13. package/dist/lib/forms/constants/fonts.d.ts +0 -131
  14. package/dist/lib/forms/constants/fonts.js +0 -55
  15. package/dist/lib/forms/constants/fonts.js.map +0 -1
  16. package/dist/lib/forms/constants/form.d.ts +0 -2
  17. package/dist/lib/forms/constants/form.js +0 -18
  18. package/dist/lib/forms/constants/form.js.map +0 -1
  19. package/dist/lib/forms/constants/index.d.ts +0 -2
  20. package/dist/lib/forms/constants/index.js +0 -3
  21. package/dist/lib/forms/constants/index.js.map +0 -1
  22. package/dist/lib/forms/field-preset-templates.d.ts +0 -23
  23. package/dist/lib/forms/field-preset-templates.js +0 -266
  24. package/dist/lib/forms/field-preset-templates.js.map +0 -1
  25. package/dist/lib/forms/fields.client.d.ts +0 -31
  26. package/dist/lib/forms/fields.client.js +0 -24
  27. package/dist/lib/forms/fields.client.js.map +0 -1
  28. package/dist/lib/forms/fields.server.d.ts +0 -16
  29. package/dist/lib/forms/fields.server.js +0 -2
  30. package/dist/lib/forms/fields.server.js.map +0 -1
  31. package/dist/lib/forms/form-metadata.d.ts +0 -142
  32. package/dist/lib/forms/form-metadata.js +0 -346
  33. package/dist/lib/forms/form-metadata.js.map +0 -1
  34. package/dist/lib/forms/index.d.ts +0 -9
  35. package/dist/lib/forms/index.js +0 -10
  36. package/dist/lib/forms/index.js.map +0 -1
  37. package/dist/lib/forms/recipient-email.d.ts +0 -7
  38. package/dist/lib/forms/recipient-email.js +0 -37
  39. package/dist/lib/forms/recipient-email.js.map +0 -1
  40. package/dist/lib/forms/signature-image.d.ts +0 -37
  41. package/dist/lib/forms/signature-image.js +0 -114
  42. package/dist/lib/forms/signature-image.js.map +0 -1
  43. package/dist/lib/forms/validator-ir.d.ts +0 -203
  44. package/dist/lib/forms/validator-ir.js +0 -2
  45. package/dist/lib/forms/validator-ir.js.map +0 -1
  46. package/dist/lib/pdf-viewer/FormFillPdfViewer.d.ts +0 -31
  47. package/dist/lib/pdf-viewer/FormFillPdfViewer.js +0 -107
  48. package/dist/lib/pdf-viewer/FormFillPdfViewer.js.map +0 -1
  49. package/dist/lib/pdf-viewer/PdfPageOverlay.d.ts +0 -18
  50. package/dist/lib/pdf-viewer/PdfPageOverlay.js +0 -236
  51. package/dist/lib/pdf-viewer/PdfPageOverlay.js.map +0 -1
  52. package/dist/lib/pdf-viewer/form-previewer-model.d.ts +0 -52
  53. package/dist/lib/pdf-viewer/form-previewer-model.js +0 -329
  54. package/dist/lib/pdf-viewer/form-previewer-model.js.map +0 -1
  55. package/dist/lib/pdf-viewer/form-previewer-rendering.d.ts +0 -55
  56. package/dist/lib/pdf-viewer/form-previewer-rendering.js +0 -317
  57. package/dist/lib/pdf-viewer/form-previewer-rendering.js.map +0 -1
  58. package/dist/lib/pdf-viewer/party-colors.d.ts +0 -22
  59. package/dist/lib/pdf-viewer/party-colors.js +0 -20
  60. package/dist/lib/pdf-viewer/party-colors.js.map +0 -1
@@ -1,131 +0,0 @@
1
- export declare const FONTS: readonly [{
2
- readonly name: "Arial";
3
- readonly filename: "arial.ttf";
4
- }, {
5
- readonly name: "Arial Bold";
6
- readonly filename: "arialbd.ttf";
7
- }, {
8
- readonly name: "Arial Bold Italic";
9
- readonly filename: "arialbi.ttf";
10
- }, {
11
- readonly name: "Arial Italic";
12
- readonly filename: "ariali.ttf";
13
- }, {
14
- readonly name: "Arial Narrow";
15
- readonly filename: "ARIALN.TTF";
16
- }, {
17
- readonly name: "Arial Narrow Bold";
18
- readonly filename: "ARIALNB.TTF";
19
- }, {
20
- readonly name: "Arial Narrow Bold Italic";
21
- readonly filename: "ARIALNBI.TTF";
22
- }, {
23
- readonly name: "Arial Narrow Italic";
24
- readonly filename: "ARIALNI.TTF";
25
- }, {
26
- readonly name: "Arial Black";
27
- readonly filename: "ariblk.ttf";
28
- }, {
29
- readonly name: "Roboto Regular";
30
- readonly filename: "Roboto-Regular.ttf";
31
- }, {
32
- readonly name: "Roboto Thin";
33
- readonly filename: "Roboto-Thin.ttf";
34
- }, {
35
- readonly name: "Roboto Thin Italic";
36
- readonly filename: "Roboto-ThinItalic.ttf";
37
- }, {
38
- readonly name: "Roboto Light";
39
- readonly filename: "Roboto-Light.ttf";
40
- }, {
41
- readonly name: "Roboto Light Italic";
42
- readonly filename: "Roboto-LightItalic.ttf";
43
- }, {
44
- readonly name: "Roboto Medium";
45
- readonly filename: "Roboto-Medium.ttf";
46
- }, {
47
- readonly name: "Roboto Medium Italic";
48
- readonly filename: "Roboto-MediumItalic.ttf";
49
- }, {
50
- readonly name: "Roboto Bold";
51
- readonly filename: "Roboto-Bold.ttf";
52
- }, {
53
- readonly name: "Roboto Bold Italic";
54
- readonly filename: "Roboto-BoldItalic.ttf";
55
- }, {
56
- readonly name: "Roboto Black";
57
- readonly filename: "Roboto-Black.ttf";
58
- }, {
59
- readonly name: "Roboto Black Italic";
60
- readonly filename: "Roboto-BlackItalic.ttf";
61
- }, {
62
- readonly name: "Roboto Italic";
63
- readonly filename: "Roboto-Italic.ttf";
64
- }, {
65
- readonly name: "Roboto Condensed Regular";
66
- readonly filename: "RobotoCondensed-Regular.ttf";
67
- }, {
68
- readonly name: "Roboto Condensed Light";
69
- readonly filename: "RobotoCondensed-Light.ttf";
70
- }, {
71
- readonly name: "Roboto Condensed Light Italic";
72
- readonly filename: "RobotoCondensed-LightItalic.ttf";
73
- }, {
74
- readonly name: "Roboto Condensed Bold";
75
- readonly filename: "RobotoCondensed-Bold.ttf";
76
- }, {
77
- readonly name: "Roboto Condensed Bold Italic";
78
- readonly filename: "RobotoCondensed-BoldItalic.ttf";
79
- }, {
80
- readonly name: "Roboto Condensed Italic";
81
- readonly filename: "RobotoCondensed-Italic.ttf";
82
- }, {
83
- readonly name: "Times New Roman";
84
- readonly filename: "TIMES.TTF";
85
- }, {
86
- readonly name: "Times New Roman Bold";
87
- readonly filename: "TIMESBD.TTF";
88
- }, {
89
- readonly name: "Times New Roman Bold Italic";
90
- readonly filename: "TIMESBI.TTF";
91
- }, {
92
- readonly name: "Times New Roman Italic";
93
- readonly filename: "TIMESI.TTF";
94
- }, {
95
- readonly name: "Ubuntu Mono Regular";
96
- readonly filename: "UbuntuMono-Regular.ttf";
97
- }, {
98
- readonly name: "Ubuntu Mono Bold";
99
- readonly filename: "UbuntuMono-Bold.ttf";
100
- }, {
101
- readonly name: "Ubuntu Mono Bold Italic";
102
- readonly filename: "UbuntuMono-BoldItalic.ttf";
103
- }, {
104
- readonly name: "Ubuntu Mono Italic";
105
- readonly filename: "UbuntuMono-Italic.ttf";
106
- }, {
107
- readonly name: "Inter";
108
- readonly filename: "Inter-Regular.ttf";
109
- }, {
110
- readonly name: "Italianno";
111
- readonly filename: "Italianno-Regular.ttf";
112
- }, {
113
- readonly name: "High Empathy";
114
- readonly filename: "high-empathy.regular.ttf";
115
- }, {
116
- readonly name: "Megastina";
117
- readonly filename: "megastina.regular.ttf";
118
- }, {
119
- readonly name: "Royalty Free";
120
- readonly filename: "royalty-free.regular.ttf";
121
- }, {
122
- readonly name: "Testimonia";
123
- readonly filename: "Testimonia.ttf";
124
- }, {
125
- readonly name: "The Signature";
126
- readonly filename: "thesignature.regular.ttf";
127
- }];
128
- export type FontRecord = (typeof FONTS)[number];
129
- export type FontName = FontRecord['name'];
130
- export type FontFilename = FontRecord['filename'];
131
- export declare function getFontFilename(name: FontName): FontFilename;
@@ -1,55 +0,0 @@
1
- export const FONTS = [
2
- { name: 'Arial', filename: 'arial.ttf' },
3
- { name: 'Arial Bold', filename: 'arialbd.ttf' },
4
- { name: 'Arial Bold Italic', filename: 'arialbi.ttf' },
5
- { name: 'Arial Italic', filename: 'ariali.ttf' },
6
- { name: 'Arial Narrow', filename: 'ARIALN.TTF' },
7
- { name: 'Arial Narrow Bold', filename: 'ARIALNB.TTF' },
8
- { name: 'Arial Narrow Bold Italic', filename: 'ARIALNBI.TTF' },
9
- { name: 'Arial Narrow Italic', filename: 'ARIALNI.TTF' },
10
- { name: 'Arial Black', filename: 'ariblk.ttf' },
11
- { name: 'Roboto Regular', filename: 'Roboto-Regular.ttf' },
12
- { name: 'Roboto Thin', filename: 'Roboto-Thin.ttf' },
13
- { name: 'Roboto Thin Italic', filename: 'Roboto-ThinItalic.ttf' },
14
- { name: 'Roboto Light', filename: 'Roboto-Light.ttf' },
15
- { name: 'Roboto Light Italic', filename: 'Roboto-LightItalic.ttf' },
16
- { name: 'Roboto Medium', filename: 'Roboto-Medium.ttf' },
17
- { name: 'Roboto Medium Italic', filename: 'Roboto-MediumItalic.ttf' },
18
- { name: 'Roboto Bold', filename: 'Roboto-Bold.ttf' },
19
- { name: 'Roboto Bold Italic', filename: 'Roboto-BoldItalic.ttf' },
20
- { name: 'Roboto Black', filename: 'Roboto-Black.ttf' },
21
- { name: 'Roboto Black Italic', filename: 'Roboto-BlackItalic.ttf' },
22
- { name: 'Roboto Italic', filename: 'Roboto-Italic.ttf' },
23
- { name: 'Roboto Condensed Regular', filename: 'RobotoCondensed-Regular.ttf' },
24
- { name: 'Roboto Condensed Light', filename: 'RobotoCondensed-Light.ttf' },
25
- {
26
- name: 'Roboto Condensed Light Italic',
27
- filename: 'RobotoCondensed-LightItalic.ttf',
28
- },
29
- { name: 'Roboto Condensed Bold', filename: 'RobotoCondensed-Bold.ttf' },
30
- {
31
- name: 'Roboto Condensed Bold Italic',
32
- filename: 'RobotoCondensed-BoldItalic.ttf',
33
- },
34
- { name: 'Roboto Condensed Italic', filename: 'RobotoCondensed-Italic.ttf' },
35
- { name: 'Times New Roman', filename: 'TIMES.TTF' },
36
- { name: 'Times New Roman Bold', filename: 'TIMESBD.TTF' },
37
- { name: 'Times New Roman Bold Italic', filename: 'TIMESBI.TTF' },
38
- { name: 'Times New Roman Italic', filename: 'TIMESI.TTF' },
39
- { name: 'Ubuntu Mono Regular', filename: 'UbuntuMono-Regular.ttf' },
40
- { name: 'Ubuntu Mono Bold', filename: 'UbuntuMono-Bold.ttf' },
41
- { name: 'Ubuntu Mono Bold Italic', filename: 'UbuntuMono-BoldItalic.ttf' },
42
- { name: 'Ubuntu Mono Italic', filename: 'UbuntuMono-Italic.ttf' },
43
- { name: 'Inter', filename: 'Inter-Regular.ttf' },
44
- { name: 'Italianno', filename: 'Italianno-Regular.ttf' },
45
- { name: 'High Empathy', filename: 'high-empathy.regular.ttf' },
46
- { name: 'Megastina', filename: 'megastina.regular.ttf' },
47
- { name: 'Royalty Free', filename: 'royalty-free.regular.ttf' },
48
- { name: 'Testimonia', filename: 'Testimonia.ttf' },
49
- { name: 'The Signature', filename: 'thesignature.regular.ttf' },
50
- ];
51
- export function getFontFilename(name) {
52
- const font = FONTS.find((f) => f.name === name);
53
- return font?.filename ?? FONTS[0].filename;
54
- }
55
- //# sourceMappingURL=fonts.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"fonts.js","sourceRoot":"","sources":["../../../../lib/forms/constants/fonts.ts"],"names":[],"mappings":"AAKA,MAAM,CAAC,MAAM,KAAK,GAAG;IAEnB,EAAE,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE;IACxC,EAAE,IAAI,EAAE,YAAY,EAAE,QAAQ,EAAE,aAAa,EAAE;IAC/C,EAAE,IAAI,EAAE,mBAAmB,EAAE,QAAQ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,EAAE,gBAAgB,EAAE;IAClD,EAAE,IAAI,EAAE,eAAe,EAAE,QAAQ,EAAE,0BAA0B,EAAE;CACvD,CAAC;AASX,MAAM,UAAU,eAAe,CAAC,IAAc;IAC5C,MAAM,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,IAAI,CAAC,CAAC;IAChD,OAAO,IAAI,EAAE,QAAQ,IAAI,KAAK,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC;AAC7C,CAAC"}
@@ -1,2 +0,0 @@
1
- import { IFormMetadata } from '../form-metadata.js';
2
- export declare const BLANK_FORM_METADATA: IFormMetadata;
@@ -1,18 +0,0 @@
1
- import { SCHEMA_VERSION } from '../form-metadata.js';
2
- export const BLANK_FORM_METADATA = {
3
- name: 'new-form',
4
- label: 'New Form',
5
- schema_version: SCHEMA_VERSION,
6
- schema: {
7
- blocks: [],
8
- },
9
- signing_parties: [
10
- {
11
- _id: 'initiator',
12
- order: 1,
13
- signatory_title: 'initiator',
14
- },
15
- ],
16
- subscribers: [],
17
- };
18
- //# sourceMappingURL=form.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"form.js","sourceRoot":"","sources":["../../../../lib/forms/constants/form.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAGpE,MAAM,CAAC,MAAM,mBAAmB,GAAkB;IAChD,IAAI,EAAE,UAAU;IAChB,KAAK,EAAE,UAAU;IACjB,cAAc,EAAE,cAAc;IAC9B,MAAM,EAAE;QACN,MAAM,EAAE,EAAE;KACX;IACD,eAAe,EAAE;QACf;YACE,GAAG,EAAE,WAAW;YAChB,KAAK,EAAE,CAAC;YACR,eAAe,EAAE,WAAW;SAC7B;KACF;IACD,WAAW,EAAE,EAAE;CAChB,CAAC"}
@@ -1,2 +0,0 @@
1
- export * from './fonts.js';
2
- export * from './form.js';
@@ -1,3 +0,0 @@
1
- export * from './fonts.js';
2
- export * from './form.js';
3
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../lib/forms/constants/index.ts"],"names":[],"mappings":"AAKA,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC"}
@@ -1,23 +0,0 @@
1
- import type { ValidatorIRv0 } from './validator-ir.js';
2
- import { SOURCES } from './form-metadata.js';
3
- export type FieldPresetTemplate = {
4
- id: string;
5
- name: string;
6
- label: string;
7
- iconKey: FieldPresetIconKey;
8
- type: 'text' | 'signature' | 'image';
9
- group?: 'core' | 'format';
10
- source: (typeof SOURCES)[number];
11
- shared: boolean;
12
- tag: string;
13
- preset: string;
14
- prefiller: string;
15
- tooltip_label: string;
16
- validator: string;
17
- validator_ir: ValidatorIRv0 | null;
18
- is_phantom: boolean;
19
- party?: string;
20
- };
21
- export type FieldPresetIconKey = 'shortText' | 'longText' | 'number' | 'signature' | 'dropdown' | 'multiselect' | 'date' | 'time' | 'url' | 'phone' | 'email' | 'radio';
22
- export declare const FIELD_PRESET_TEMPLATES: FieldPresetTemplate[];
23
- export declare function getFieldPresetTemplates(): FieldPresetTemplate[];
@@ -1,266 +0,0 @@
1
- const TEXT_PREPROCESS = `z.preprocess((v) => ((v ?? null) == null ? "" : (typeof v === "string" ? v.trim() : v)), `;
2
- const SHORT_TEXT_VALIDATOR = `${TEXT_PREPROCESS}z.string())`;
3
- const NAME_VALIDATOR = `${TEXT_PREPROCESS}z.string().min(1, { message: "This field is required." }).max(100).regex(/^(?!.*[\\p{Extended_Pictographic}\\uFE0F])(?!.*[\\u0000-\\u0008\\u000B\\u000C\\u000E-\\u001F\\u007F])(?!.*[\\u202A-\\u202E\\u2066-\\u2069])[\\p{L}\\p{M}\\p{Pc}\\p{Pd}\\p{Ps}\\p{Pe}\\p{Pi}\\p{Pf}\\p{Po}\\p{Zs}\\n\\r\\t]+$/u, "This field accepts letters, spaces, and common punctuation only. No numbers or emojis.").refine(s => s.replace(/\\p{L}+/gu, w => w[0].toLocaleUpperCase() + w.slice(1).toLocaleLowerCase()) === s, "Please write in title case (capitalize the first letter of each word)."))`;
4
- const LONG_TEXT_VALIDATOR = `${TEXT_PREPROCESS}z.string().describe("textarea"))`;
5
- const NUMBER_VALIDATOR = 'z.number()';
6
- const SIGNATURE_VALIDATOR = `${TEXT_PREPROCESS}z.string().nonempty({ message: "This field is required." }))`;
7
- const DROPDOWN_VALIDATOR = `z.enum(["Option 1", "Option 2"], {message:"This field is required."})`;
8
- const MULTISELECT_VALIDATOR = `z.array(
9
- z.enum(
10
- [
11
- "Option 1",
12
- "Option 2"
13
- ],
14
- { message: "This field is required." }
15
- )
16
- ).describe("multiselect")`;
17
- const DATE_VALIDATOR = 'z.coerce.date()';
18
- const TIME_VALIDATOR = 'z.string().describe("time")';
19
- const EMAIL_VALIDATOR = `${TEXT_PREPROCESS}z.string().email())`;
20
- const URL_VALIDATOR = `${TEXT_PREPROCESS}z.string().url())`;
21
- const PHONE_NUMBER_VALIDATOR = `${TEXT_PREPROCESS}z.string().regex(/^\\+?[0-9()\\-\\s]{7,20}$/, { message: "Please enter a valid phone number." }).describe("phone"))`;
22
- const RADIO_VALIDATOR = `z.enum(["X", ""]).describe("radio")`;
23
- const baseIr = (baseType, rules) => ({
24
- version: 0,
25
- baseType,
26
- rules,
27
- mode: 'builder',
28
- importStatus: 'exact',
29
- });
30
- export const FIELD_PRESET_TEMPLATES = [
31
- {
32
- id: 'preset-short-text',
33
- name: 'short_text',
34
- label: 'Short Text',
35
- iconKey: 'shortText',
36
- type: 'text',
37
- group: 'core',
38
- source: 'manual',
39
- shared: true,
40
- tag: 'preset',
41
- preset: 'preset',
42
- prefiller: '',
43
- tooltip_label: '',
44
- validator: SHORT_TEXT_VALIDATOR,
45
- validator_ir: baseIr('text', []),
46
- is_phantom: false,
47
- },
48
- {
49
- id: 'preset-name',
50
- name: 'name',
51
- label: 'Name',
52
- iconKey: 'shortText',
53
- type: 'text',
54
- group: 'core',
55
- source: 'manual',
56
- shared: true,
57
- tag: 'preset',
58
- preset: 'preset',
59
- prefiller: '',
60
- tooltip_label: '',
61
- validator: NAME_VALIDATOR,
62
- validator_ir: baseIr('text', [{ kind: 'plainText' }, { kind: 'titleCase' }]),
63
- is_phantom: false,
64
- },
65
- {
66
- id: 'preset-long-text',
67
- name: 'long_text',
68
- label: 'Long Text',
69
- iconKey: 'longText',
70
- type: 'text',
71
- group: 'core',
72
- source: 'manual',
73
- shared: true,
74
- tag: 'preset',
75
- preset: 'preset',
76
- prefiller: '',
77
- tooltip_label: '',
78
- validator: LONG_TEXT_VALIDATOR,
79
- validator_ir: baseIr('textarea', []),
80
- is_phantom: false,
81
- },
82
- {
83
- id: 'preset-number',
84
- name: 'number',
85
- label: 'Number',
86
- iconKey: 'number',
87
- type: 'text',
88
- group: 'core',
89
- source: 'manual',
90
- shared: true,
91
- tag: 'preset',
92
- preset: 'preset',
93
- prefiller: '',
94
- tooltip_label: '',
95
- validator: NUMBER_VALIDATOR,
96
- validator_ir: baseIr('number', []),
97
- is_phantom: false,
98
- },
99
- {
100
- id: 'preset-signature',
101
- name: 'signature',
102
- label: 'Signature',
103
- iconKey: 'signature',
104
- type: 'signature',
105
- group: 'core',
106
- source: 'manual',
107
- shared: true,
108
- tag: 'preset',
109
- preset: 'preset',
110
- prefiller: '',
111
- tooltip_label: '',
112
- validator: SIGNATURE_VALIDATOR,
113
- validator_ir: baseIr('signature', [{ kind: 'required' }]),
114
- is_phantom: false,
115
- },
116
- {
117
- id: 'preset-dropdown',
118
- name: 'dropdown',
119
- label: 'Dropdown',
120
- iconKey: 'dropdown',
121
- type: 'text',
122
- group: 'core',
123
- source: 'manual',
124
- shared: true,
125
- tag: 'preset',
126
- preset: 'preset',
127
- prefiller: '',
128
- tooltip_label: '',
129
- validator: DROPDOWN_VALIDATOR,
130
- validator_ir: baseIr('enum', [{ kind: 'enum', options: ['Option 1', 'Option 2'] }]),
131
- is_phantom: false,
132
- },
133
- {
134
- id: 'preset-multiselect',
135
- name: 'multiselect',
136
- label: 'Multiselect',
137
- iconKey: 'multiselect',
138
- type: 'text',
139
- group: 'core',
140
- source: 'manual',
141
- shared: true,
142
- tag: 'preset',
143
- preset: 'preset',
144
- prefiller: '',
145
- tooltip_label: '',
146
- validator: MULTISELECT_VALIDATOR,
147
- validator_ir: baseIr('array', [{ kind: 'array', options: ['Option 1', 'Option 2'] }]),
148
- is_phantom: false,
149
- },
150
- {
151
- id: 'preset-date',
152
- name: 'date',
153
- label: 'Date',
154
- iconKey: 'date',
155
- type: 'text',
156
- group: 'core',
157
- source: 'manual',
158
- shared: true,
159
- tag: 'preset',
160
- preset: 'preset',
161
- prefiller: '',
162
- tooltip_label: '',
163
- validator: DATE_VALIDATOR,
164
- validator_ir: baseIr('date', []),
165
- is_phantom: false,
166
- },
167
- {
168
- id: 'preset-time',
169
- name: 'time',
170
- label: 'Time',
171
- iconKey: 'time',
172
- type: 'text',
173
- group: 'core',
174
- source: 'manual',
175
- shared: true,
176
- tag: 'preset',
177
- preset: 'preset',
178
- prefiller: '',
179
- tooltip_label: '',
180
- validator: TIME_VALIDATOR,
181
- validator_ir: baseIr('time', []),
182
- is_phantom: false,
183
- },
184
- {
185
- id: 'preset-url',
186
- name: 'url',
187
- label: 'URL',
188
- iconKey: 'url',
189
- type: 'text',
190
- group: 'format',
191
- source: 'manual',
192
- shared: true,
193
- tag: 'preset',
194
- preset: 'preset',
195
- prefiller: '',
196
- tooltip_label: '',
197
- validator: URL_VALIDATOR,
198
- validator_ir: baseIr('url', []),
199
- is_phantom: false,
200
- },
201
- {
202
- id: 'preset-phone-number',
203
- name: 'phone_number',
204
- label: 'Phone Number',
205
- iconKey: 'phone',
206
- type: 'text',
207
- group: 'format',
208
- source: 'manual',
209
- shared: true,
210
- tag: 'preset',
211
- preset: 'preset',
212
- prefiller: '',
213
- tooltip_label: '',
214
- validator: PHONE_NUMBER_VALIDATOR,
215
- validator_ir: baseIr('phone', []),
216
- is_phantom: false,
217
- },
218
- {
219
- id: 'preset-email',
220
- name: 'email',
221
- label: 'Email',
222
- iconKey: 'email',
223
- type: 'text',
224
- group: 'format',
225
- source: 'manual',
226
- shared: true,
227
- tag: 'preset',
228
- preset: 'preset',
229
- prefiller: '',
230
- tooltip_label: '',
231
- validator: EMAIL_VALIDATOR,
232
- validator_ir: baseIr('email', []),
233
- is_phantom: false,
234
- },
235
- {
236
- id: 'preset-radio',
237
- name: 'radio',
238
- label: 'Radio Option',
239
- iconKey: 'radio',
240
- type: 'text',
241
- group: 'core',
242
- source: 'manual',
243
- shared: true,
244
- tag: 'preset',
245
- preset: 'preset',
246
- prefiller: '',
247
- tooltip_label: '',
248
- validator: RADIO_VALIDATOR,
249
- validator_ir: baseIr('radio', []),
250
- is_phantom: false,
251
- },
252
- ];
253
- export function getFieldPresetTemplates() {
254
- return FIELD_PRESET_TEMPLATES.map((preset) => ({
255
- ...preset,
256
- validator_ir: preset.validator_ir
257
- ? {
258
- ...preset.validator_ir,
259
- rules: Array.isArray(preset.validator_ir.rules)
260
- ? preset.validator_ir.rules.map((rule) => ({ ...rule }))
261
- : [],
262
- }
263
- : null,
264
- }));
265
- }
266
- //# sourceMappingURL=field-preset-templates.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"field-preset-templates.js","sourceRoot":"","sources":["../../../lib/forms/field-preset-templates.ts"],"names":[],"mappings":"AAyCA,MAAM,eAAe,GAAG,2FAA2F,CAAC;AACpH,MAAM,oBAAoB,GAAG,GAAG,eAAe,aAAa,CAAC;AAC7D,MAAM,cAAc,GAAG,GAAG,eAAe,0jBAA0jB,CAAC;AACpmB,MAAM,mBAAmB,GAAG,GAAG,eAAe,kCAAkC,CAAC;AACjF,MAAM,gBAAgB,GAAG,YAAY,CAAC;AACtC,MAAM,mBAAmB,GAAG,GAAG,eAAe,8DAA8D,CAAC;AAC7G,MAAM,kBAAkB,GAAG,uEAAuE,CAAC;AACnG,MAAM,qBAAqB,GAAG;;;;;;;;0BAQJ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AM;QACT,YAAY,EAAE,MAAM,CAAC,YAAY;YAC/B,CAAC,CAAC;gBACE,GAAG,MAAM,CAAC,YAAY;gBACtB,KAAK,EAAE,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,YAAY,CAAC,KAAK,CAAC;oBAC7C,CAAC,CAAC,MAAM,CAAC,YAAY,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,EAAE,GAAG,IAAI,EAAE,CAAC,CAAC;oBACxD,CAAC,CAAC,EAAE;aACP;YACH,CAAC,CAAC,IAAI;KACT,CAAC,CAAC,CAAC;AACN,CAAC"}
@@ -1,31 +0,0 @@
1
- import { ZodType } from 'zod';
2
- import { BLOCK_TYPES, IFormField, IFormFieldPrefiller, IFormFieldValidator, IFormPhantomField, IFormSigningParty } from './form-metadata.js';
3
- type EnumValue = string | number;
4
- export declare const getSchemaClientType: (s: ZodType) => ClientFieldType;
5
- export type ClientFieldType = 'text' | 'number' | 'date' | 'dropdown' | 'checkbox' | 'textarea' | 'multiselect' | 'time' | 'signature' | 'radio';
6
- export type ClientField<SourceDomains extends any[]> = Omit<IFormField, 'x' | 'y' | 'w' | 'h' | 'page' | 'type' | 'validator' | 'prefiller' | 'align_h' | 'align_v'> & {
7
- type: ClientFieldType;
8
- signing_party_id?: string;
9
- validator: IFormFieldValidator | null;
10
- prefiller: IFormFieldPrefiller<SourceDomains> | null;
11
- options?: EnumValue[];
12
- coerce: (s: string) => string | number | boolean | Date | Array<string> | undefined;
13
- };
14
- export type ClientPhantomField<SourceDomains extends any[]> = Omit<IFormPhantomField, 'type' | 'validator' | 'prefiller'> & {
15
- type: ClientFieldType;
16
- signing_party_id?: string;
17
- validator: IFormFieldValidator | null;
18
- prefiller: IFormFieldPrefiller<SourceDomains> | null;
19
- options?: EnumValue[];
20
- coerce: (s: string) => string | number | boolean | Date | Array<string> | undefined;
21
- };
22
- export declare const isFieldRequired: <SourceDomains extends any[]>(field: ClientField<SourceDomains> | ClientPhantomField<SourceDomains>) => boolean;
23
- export interface ClientBlock<SourceDomains extends any[]> {
24
- block_type: (typeof BLOCK_TYPES)[number];
25
- order: number;
26
- signing_party_id: IFormSigningParty['_id'];
27
- text_content?: string;
28
- field_schema?: ClientField<SourceDomains>;
29
- phantom_field_schema?: ClientPhantomField<SourceDomains>;
30
- }
31
- export {};
@@ -1,24 +0,0 @@
1
- import z from 'zod';
2
- export const getSchemaClientType = (s) => {
3
- const infer = s.type;
4
- const desc = s.description;
5
- if (desc === 'radio')
6
- return 'radio';
7
- if (infer === 'date' || desc === 'date')
8
- return 'date';
9
- if (infer === 'number' || desc === 'number')
10
- return 'number';
11
- if (infer === 'enum' || desc === 'dropdown')
12
- return 'dropdown';
13
- if (infer === 'boolean' || desc === 'checkbox')
14
- return 'checkbox';
15
- if (s instanceof z.ZodArray && desc === 'multiselect')
16
- return 'multiselect';
17
- if (desc === 'textarea')
18
- return 'textarea';
19
- if (desc === 'time')
20
- return 'time';
21
- return 'text';
22
- };
23
- export const isFieldRequired = (field) => !!field.validator && !field.validator.safeParse(field.coerce('')).success;
24
- //# sourceMappingURL=fields.client.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"fields.client.js","sourceRoot":"","sources":["../../../lib/forms/fields.client.ts"],"names":[],"mappings":"AAUA,OAAO,CAAc,MAAM,KAAK,CAAC;AAWjC,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,CAAU,EAAmB,EAAE;IACjE,MAAM,KAAK,GAAG,CAAC,CAAC,IAAI,CAAC;IACrB,MAAM,IAAI,GAAG,CAAC,CAAC,WAAW,CAAC;IAC3B,IAAI,IAAI,KAAK,OAAO;QAAE,OAAO,OAAO,CAAC;IACrC,IAAI,KAAK,KAAK,MAAM,IAAI,IAAI,KAAK,MAAM;QAAE,OAAO,MAAM,CAAC;IACvD,IAAI,KAAK,KAAK,QAAQ,IAAI,IAAI,KAAK,QAAQ;QAAE,OAAO,QAAQ,CAAC;IAC7D,IAAI,KAAK,KAAK,MAAM,IAAI,IAAI,KAAK,UAAU;QAAE,OAAO,UAAU,CAAC;IAC/D,IAAI,KAAK,KAAK,SAAS,IAAI,IAAI,KAAK,UAAU;QAAE,OAAO,UAAU,CAAC;IAClE,IAAI,CAAC,YAAY,CAAC,CAAC,QAAQ,IAAI,IAAI,KAAK,aAAa;QAAE,OAAO,aAAa,CAAC;IAC5E,IAAI,IAAI,KAAK,UAAU;QAAE,OAAO,UAAU,CAAC;IAC3C,IAAI,IAAI,KAAK,MAAM;QAAE,OAAO,MAAM,CAAC;IACnC,OAAO,MAAM,CAAC;AAChB,CAAC,CAAC;AA+CF,MAAM,CAAC,MAAM,eAAe,GAAG,CAC7B,KAAqE,EACrE,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,SAAS,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,SAAS,CAAC,KAAK,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC"}
@@ -1,16 +0,0 @@
1
- import { FontFilename } from './constants/fonts.js';
2
- export type ServerField = {
3
- x: number;
4
- y: number;
5
- w: number;
6
- h: number;
7
- page: number;
8
- type: 'text' | 'signature';
9
- field: string;
10
- value?: string;
11
- align_h: 'center' | 'left' | 'right';
12
- align_v: 'middle' | 'top' | 'bottom';
13
- size?: number;
14
- wrap?: boolean;
15
- font?: FontFilename;
16
- };
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=fields.server.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"fields.server.js","sourceRoot":"","sources":["../../../lib/forms/fields.server.ts"],"names":[],"mappings":""}