@frigear-nu/forms 0.0.6 → 0.0.8
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/README.md +16 -1
- package/dist/module.d.mts +148 -8
- package/dist/module.json +1 -1
- package/dist/module.mjs +65 -35
- package/dist/runtime/app/components/FormBuilder.d.vue.ts +26 -0
- package/dist/runtime/app/components/FormBuilder.vue +220 -0
- package/dist/runtime/app/components/FormBuilder.vue.d.ts +26 -0
- package/dist/runtime/app/components/FormBuilderAccess.d.vue.ts +16 -0
- package/dist/runtime/app/components/FormBuilderAccess.vue +404 -0
- package/dist/runtime/app/components/FormBuilderAccess.vue.d.ts +16 -0
- package/dist/runtime/app/components/FormBuilderCaptchaSettings.d.vue.ts +15 -0
- package/dist/runtime/app/components/FormBuilderCaptchaSettings.vue +126 -0
- package/dist/runtime/app/components/FormBuilderCaptchaSettings.vue.d.ts +15 -0
- package/dist/runtime/app/components/FormBuilderCondition.d.vue.ts +16 -0
- package/dist/runtime/app/components/FormBuilderCondition.vue +62 -0
- package/dist/runtime/app/components/FormBuilderCondition.vue.d.ts +16 -0
- package/dist/runtime/app/components/FormBuilderFieldRow.d.vue.ts +27 -0
- package/dist/runtime/app/components/FormBuilderFieldRow.vue +87 -0
- package/dist/runtime/app/components/FormBuilderFieldRow.vue.d.ts +27 -0
- package/dist/runtime/app/components/FormBuilderFieldSettings.d.vue.ts +25 -0
- package/dist/runtime/app/components/FormBuilderFieldSettings.vue +170 -0
- package/dist/runtime/app/components/FormBuilderFieldSettings.vue.d.ts +25 -0
- package/dist/runtime/app/components/FormBuilderInsertRow.d.vue.ts +20 -0
- package/dist/runtime/app/components/FormBuilderInsertRow.vue +51 -0
- package/dist/runtime/app/components/FormBuilderInsertRow.vue.d.ts +20 -0
- package/dist/runtime/app/components/FormBuilderOptions.d.vue.ts +11 -0
- package/dist/runtime/app/components/FormBuilderOptions.vue +81 -0
- package/dist/runtime/app/components/FormBuilderOptions.vue.d.ts +11 -0
- package/dist/runtime/app/components/FormBuilderPhoneSettings.d.vue.ts +11 -0
- package/dist/runtime/app/components/FormBuilderPhoneSettings.vue +63 -0
- package/dist/runtime/app/components/FormBuilderPhoneSettings.vue.d.ts +11 -0
- package/dist/runtime/app/components/FormBuilderSettings.d.vue.ts +11 -0
- package/dist/runtime/app/components/FormBuilderSettings.vue +233 -0
- package/dist/runtime/app/components/FormBuilderSettings.vue.d.ts +11 -0
- package/dist/runtime/app/components/FormBuilderStepHeader.d.vue.ts +27 -0
- package/dist/runtime/app/components/FormBuilderStepHeader.vue +71 -0
- package/dist/runtime/app/components/FormBuilderStepHeader.vue.d.ts +27 -0
- package/dist/runtime/app/components/FormBuilderStepSettings.d.vue.ts +13 -0
- package/dist/runtime/app/components/FormBuilderStepSettings.vue +33 -0
- package/dist/runtime/app/components/FormBuilderStepSettings.vue.d.ts +13 -0
- package/dist/runtime/app/components/FormBuilderText.d.vue.ts +19 -0
- package/dist/runtime/app/components/FormBuilderText.vue +127 -0
- package/dist/runtime/app/components/FormBuilderText.vue.d.ts +19 -0
- package/dist/runtime/app/components/FormCaptcha.d.vue.ts +19 -0
- package/dist/runtime/app/components/FormCaptcha.vue +95 -0
- package/dist/runtime/app/components/FormCaptcha.vue.d.ts +19 -0
- package/dist/runtime/app/components/FormEmbed.d.vue.ts +17 -0
- package/dist/runtime/app/components/FormEmbed.vue +113 -0
- package/dist/runtime/app/components/FormEmbed.vue.d.ts +17 -0
- package/dist/runtime/app/components/FormField.d.vue.ts +4 -0
- package/dist/runtime/app/components/FormField.vue +35 -3
- package/dist/runtime/app/components/FormField.vue.d.ts +4 -0
- package/dist/runtime/app/components/FormPhoneInput.d.vue.ts +20 -0
- package/dist/runtime/app/components/FormPhoneInput.vue +56 -0
- package/dist/runtime/app/components/FormPhoneInput.vue.d.ts +20 -0
- package/dist/runtime/app/components/FormPreview.d.vue.ts +12 -0
- package/dist/runtime/app/components/FormPreview.vue +244 -0
- package/dist/runtime/app/components/FormPreview.vue.d.ts +12 -0
- package/dist/runtime/app/components/FormRenderer.d.vue.ts +6 -0
- package/dist/runtime/app/components/FormRenderer.vue +16 -7
- package/dist/runtime/app/components/FormRenderer.vue.d.ts +6 -0
- package/dist/runtime/app/components/FormSubmissionView.vue +2 -2
- package/dist/runtime/app/composables/index.d.ts +4 -1
- package/dist/runtime/app/composables/index.js +4 -1
- package/dist/runtime/app/composables/useCaptcha.d.ts +22 -0
- package/dist/runtime/app/composables/useCaptcha.js +39 -0
- package/dist/runtime/app/composables/useCaptchaSecrets.d.ts +7 -0
- package/dist/runtime/app/composables/useCaptchaSecrets.js +69 -0
- package/dist/runtime/app/composables/useFormBuilderEditor.d.ts +49 -0
- package/dist/runtime/app/composables/useFormBuilderEditor.js +210 -0
- package/dist/runtime/app/composables/useFormBuilderLabels.d.ts +8 -0
- package/dist/runtime/app/composables/useFormBuilderLabels.js +41 -0
- package/dist/runtime/app/composables/useForms.d.ts +18 -3
- package/dist/runtime/app/composables/useForms.js +38 -5
- package/dist/runtime/app/pages/admin-form.vue +112 -69
- package/dist/runtime/app/pages/admin-submission.vue +7 -16
- package/dist/runtime/app/pages/admin-submissions.vue +41 -46
- package/dist/runtime/app/pages/admin.vue +128 -44
- package/dist/runtime/app/pages/form.vue +71 -5
- package/dist/runtime/i18n/lang/da.json +231 -3
- package/dist/runtime/i18n/lang/en.json +231 -3
- package/dist/runtime/menus.js +10 -0
- package/dist/runtime/server/db/schema.sqlite.d.ts +283 -0
- package/dist/runtime/server/db/schema.sqlite.js +33 -1
- package/dist/runtime/server/mcp/schemas.d.ts +9 -0
- package/dist/runtime/server/mcp/schemas.js +8 -0
- package/dist/runtime/server/mcp/tools/admin/create-form.d.ts +2 -0
- package/dist/runtime/server/mcp/tools/admin/create-form.js +21 -0
- package/dist/runtime/server/mcp/tools/admin/get-form-definition.d.ts +2 -0
- package/dist/runtime/server/mcp/tools/admin/get-form-definition.js +14 -0
- package/dist/runtime/server/mcp/tools/admin/get-submission.d.ts +2 -0
- package/dist/runtime/server/mcp/tools/admin/get-submission.js +26 -0
- package/dist/runtime/server/mcp/tools/admin/list-all-forms.d.ts +2 -0
- package/dist/runtime/server/mcp/tools/admin/list-all-forms.js +21 -0
- package/dist/runtime/server/mcp/tools/admin/list-submissions.d.ts +2 -0
- package/dist/runtime/server/mcp/tools/admin/list-submissions.js +22 -0
- package/dist/runtime/server/mcp/tools/admin/update-form.d.ts +2 -0
- package/dist/runtime/server/mcp/tools/admin/update-form.js +24 -0
- package/dist/runtime/server/mcp/tools/get-form.d.ts +2 -0
- package/dist/runtime/server/mcp/tools/get-form.js +12 -0
- package/dist/runtime/server/mcp/tools/list-forms.d.ts +2 -0
- package/dist/runtime/server/mcp/tools/list-forms.js +11 -0
- package/dist/runtime/server/mcp/tools/submit-form.d.ts +2 -0
- package/dist/runtime/server/mcp/tools/submit-form.js +17 -0
- package/dist/runtime/server/plugins/email-delivery.js +16 -11
- package/dist/runtime/server/plugins/encryption.d.ts +2 -0
- package/dist/runtime/server/plugins/encryption.js +4 -0
- package/dist/runtime/server/plugins/staff-scopes.d.ts +2 -0
- package/dist/runtime/server/plugins/staff-scopes.js +1 -0
- package/dist/runtime/server/routes/admin/form-clone.post.d.ts +2 -0
- package/dist/runtime/server/routes/admin/form-clone.post.js +17 -0
- package/dist/runtime/server/routes/admin/form-password.delete.d.ts +2 -0
- package/dist/runtime/server/routes/admin/form-password.delete.js +8 -0
- package/dist/runtime/server/routes/admin/form-password.get.d.ts +2 -0
- package/dist/runtime/server/routes/admin/form-password.get.js +8 -0
- package/dist/runtime/server/routes/admin/form-password.put.d.ts +2 -0
- package/dist/runtime/server/routes/admin/form-password.put.js +14 -0
- package/dist/runtime/server/routes/admin/form-secret.delete.d.ts +2 -0
- package/dist/runtime/server/routes/admin/form-secret.delete.js +8 -0
- package/dist/runtime/server/routes/admin/form-secrets.get.d.ts +2 -0
- package/dist/runtime/server/routes/admin/form-secrets.get.js +5 -0
- package/dist/runtime/server/routes/admin/form-secrets.put.d.ts +2 -0
- package/dist/runtime/server/routes/admin/form-secrets.put.js +12 -0
- package/dist/runtime/server/routes/admin/form-token.delete.d.ts +2 -0
- package/dist/runtime/server/routes/admin/form-token.delete.js +12 -0
- package/dist/runtime/server/routes/admin/form-tokens.get.d.ts +2 -0
- package/dist/runtime/server/routes/admin/form-tokens.get.js +8 -0
- package/dist/runtime/server/routes/admin/form-tokens.post.d.ts +2 -0
- package/dist/runtime/server/routes/admin/form-tokens.post.js +12 -0
- package/dist/runtime/server/routes/admin/form.get.js +5 -1
- package/dist/runtime/server/routes/admin/form.patch.js +3 -12
- package/dist/runtime/server/routes/admin/forms.post.js +1 -6
- package/dist/runtime/server/routes/public/access.get.d.ts +2 -0
- package/dist/runtime/server/routes/public/access.get.js +3 -0
- package/dist/runtime/server/routes/public/form.get.js +3 -1
- package/dist/runtime/server/routes/public/submit.post.js +2 -2
- package/dist/runtime/server/utils/access.d.ts +27 -0
- package/dist/runtime/server/utils/access.js +63 -0
- package/dist/runtime/server/utils/admin-schemas.d.ts +219 -15
- package/dist/runtime/server/utils/auth.d.ts +7 -7
- package/dist/runtime/server/utils/auth.js +4 -4
- package/dist/runtime/server/utils/captcha.d.ts +10 -0
- package/dist/runtime/server/utils/captcha.js +25 -0
- package/dist/runtime/server/utils/crypto.d.ts +18 -0
- package/dist/runtime/server/utils/crypto.js +48 -0
- package/dist/runtime/server/utils/forms.d.ts +6 -1
- package/dist/runtime/server/utils/forms.js +28 -0
- package/dist/runtime/server/utils/mcp-access.d.ts +9 -0
- package/dist/runtime/server/utils/mcp-access.js +8 -0
- package/dist/runtime/server/utils/rate-limit.d.ts +3 -0
- package/dist/runtime/server/utils/rate-limit.js +19 -0
- package/dist/runtime/server/utils/render.d.ts +2 -11
- package/dist/runtime/server/utils/render.js +1 -26
- package/dist/runtime/server/utils/secrets.d.ts +28 -0
- package/dist/runtime/server/utils/secrets.js +60 -0
- package/dist/runtime/server/utils/submit.d.ts +12 -1
- package/dist/runtime/server/utils/submit.js +18 -4
- package/dist/runtime/utils/builder.d.ts +73 -0
- package/dist/runtime/utils/builder.js +220 -0
- package/dist/runtime/utils/captcha.d.ts +9 -0
- package/dist/runtime/utils/captcha.js +7 -0
- package/dist/runtime/utils/conditions.d.ts +3 -1
- package/dist/runtime/utils/conditions.js +4 -0
- package/dist/runtime/utils/definition.d.ts +116 -6
- package/dist/runtime/utils/definition.js +53 -4
- package/dist/runtime/utils/embed.d.ts +8 -0
- package/dist/runtime/utils/embed.js +7 -0
- package/dist/runtime/utils/index.d.ts +16 -3
- package/dist/runtime/utils/index.js +66 -3
- package/dist/runtime/utils/markdown.d.ts +1 -5
- package/dist/runtime/utils/markdown.js +1 -5
- package/dist/runtime/utils/phone.d.ts +29 -0
- package/dist/runtime/utils/phone.js +294 -0
- package/dist/runtime/utils/preview.d.ts +12 -0
- package/dist/runtime/utils/preview.js +17 -0
- package/dist/runtime/utils/schedule.d.ts +1 -0
- package/dist/runtime/utils/schedule.js +1 -0
- package/dist/runtime/utils/schema.d.ts +2 -0
- package/dist/runtime/utils/schema.js +12 -4
- package/dist/runtime/utils/template.d.ts +57 -0
- package/dist/runtime/utils/template.js +147 -0
- package/dist/runtime/utils/text.d.ts +0 -3
- package/dist/runtime/utils/text.js +0 -5
- package/dist/types.d.mts +5 -1
- package/package.json +13 -5
|
@@ -0,0 +1,294 @@
|
|
|
1
|
+
const DIAL_CODES = {
|
|
2
|
+
AD: "376",
|
|
3
|
+
AE: "971",
|
|
4
|
+
AF: "93",
|
|
5
|
+
AG: "1268",
|
|
6
|
+
AI: "1264",
|
|
7
|
+
AL: "355",
|
|
8
|
+
AM: "374",
|
|
9
|
+
AO: "244",
|
|
10
|
+
AR: "54",
|
|
11
|
+
AS: "1684",
|
|
12
|
+
AT: "43",
|
|
13
|
+
AU: "61",
|
|
14
|
+
AW: "297",
|
|
15
|
+
AX: "358",
|
|
16
|
+
AZ: "994",
|
|
17
|
+
BA: "387",
|
|
18
|
+
BB: "1246",
|
|
19
|
+
BD: "880",
|
|
20
|
+
BE: "32",
|
|
21
|
+
BF: "226",
|
|
22
|
+
BG: "359",
|
|
23
|
+
BH: "973",
|
|
24
|
+
BI: "257",
|
|
25
|
+
BJ: "229",
|
|
26
|
+
BL: "590",
|
|
27
|
+
BM: "1441",
|
|
28
|
+
BN: "673",
|
|
29
|
+
BO: "591",
|
|
30
|
+
BQ: "599",
|
|
31
|
+
BR: "55",
|
|
32
|
+
BS: "1242",
|
|
33
|
+
BT: "975",
|
|
34
|
+
BW: "267",
|
|
35
|
+
BY: "375",
|
|
36
|
+
BZ: "501",
|
|
37
|
+
CA: "1",
|
|
38
|
+
CC: "61",
|
|
39
|
+
CD: "243",
|
|
40
|
+
CF: "236",
|
|
41
|
+
CG: "242",
|
|
42
|
+
CH: "41",
|
|
43
|
+
CI: "225",
|
|
44
|
+
CK: "682",
|
|
45
|
+
CL: "56",
|
|
46
|
+
CM: "237",
|
|
47
|
+
CN: "86",
|
|
48
|
+
CO: "57",
|
|
49
|
+
CR: "506",
|
|
50
|
+
CU: "53",
|
|
51
|
+
CV: "238",
|
|
52
|
+
CW: "599",
|
|
53
|
+
CX: "61",
|
|
54
|
+
CY: "357",
|
|
55
|
+
CZ: "420",
|
|
56
|
+
DE: "49",
|
|
57
|
+
DJ: "253",
|
|
58
|
+
DK: "45",
|
|
59
|
+
DM: "1767",
|
|
60
|
+
DO: "1809",
|
|
61
|
+
DZ: "213",
|
|
62
|
+
EC: "593",
|
|
63
|
+
EE: "372",
|
|
64
|
+
EG: "20",
|
|
65
|
+
EH: "212",
|
|
66
|
+
ER: "291",
|
|
67
|
+
ES: "34",
|
|
68
|
+
ET: "251",
|
|
69
|
+
FI: "358",
|
|
70
|
+
FJ: "679",
|
|
71
|
+
FK: "500",
|
|
72
|
+
FM: "691",
|
|
73
|
+
FO: "298",
|
|
74
|
+
FR: "33",
|
|
75
|
+
GA: "241",
|
|
76
|
+
GB: "44",
|
|
77
|
+
GD: "1473",
|
|
78
|
+
GE: "995",
|
|
79
|
+
GF: "594",
|
|
80
|
+
GG: "44",
|
|
81
|
+
GH: "233",
|
|
82
|
+
GI: "350",
|
|
83
|
+
GL: "299",
|
|
84
|
+
GM: "220",
|
|
85
|
+
GN: "224",
|
|
86
|
+
GP: "590",
|
|
87
|
+
GQ: "240",
|
|
88
|
+
GR: "30",
|
|
89
|
+
GT: "502",
|
|
90
|
+
GU: "1671",
|
|
91
|
+
GW: "245",
|
|
92
|
+
GY: "592",
|
|
93
|
+
HK: "852",
|
|
94
|
+
HN: "504",
|
|
95
|
+
HR: "385",
|
|
96
|
+
HT: "509",
|
|
97
|
+
HU: "36",
|
|
98
|
+
ID: "62",
|
|
99
|
+
IE: "353",
|
|
100
|
+
IL: "972",
|
|
101
|
+
IM: "44",
|
|
102
|
+
IN: "91",
|
|
103
|
+
IO: "246",
|
|
104
|
+
IQ: "964",
|
|
105
|
+
IR: "98",
|
|
106
|
+
IS: "354",
|
|
107
|
+
IT: "39",
|
|
108
|
+
JE: "44",
|
|
109
|
+
JM: "1876",
|
|
110
|
+
JO: "962",
|
|
111
|
+
JP: "81",
|
|
112
|
+
KE: "254",
|
|
113
|
+
KG: "996",
|
|
114
|
+
KH: "855",
|
|
115
|
+
KI: "686",
|
|
116
|
+
KM: "269",
|
|
117
|
+
KN: "1869",
|
|
118
|
+
KP: "850",
|
|
119
|
+
KR: "82",
|
|
120
|
+
KW: "965",
|
|
121
|
+
KY: "1345",
|
|
122
|
+
KZ: "7",
|
|
123
|
+
LA: "856",
|
|
124
|
+
LB: "961",
|
|
125
|
+
LC: "1758",
|
|
126
|
+
LI: "423",
|
|
127
|
+
LK: "94",
|
|
128
|
+
LR: "231",
|
|
129
|
+
LS: "266",
|
|
130
|
+
LT: "370",
|
|
131
|
+
LU: "352",
|
|
132
|
+
LV: "371",
|
|
133
|
+
LY: "218",
|
|
134
|
+
MA: "212",
|
|
135
|
+
MC: "377",
|
|
136
|
+
MD: "373",
|
|
137
|
+
ME: "382",
|
|
138
|
+
MF: "590",
|
|
139
|
+
MG: "261",
|
|
140
|
+
MH: "692",
|
|
141
|
+
MK: "389",
|
|
142
|
+
ML: "223",
|
|
143
|
+
MM: "95",
|
|
144
|
+
MN: "976",
|
|
145
|
+
MO: "853",
|
|
146
|
+
MP: "1670",
|
|
147
|
+
MQ: "596",
|
|
148
|
+
MR: "222",
|
|
149
|
+
MS: "1664",
|
|
150
|
+
MT: "356",
|
|
151
|
+
MU: "230",
|
|
152
|
+
MV: "960",
|
|
153
|
+
MW: "265",
|
|
154
|
+
MX: "52",
|
|
155
|
+
MY: "60",
|
|
156
|
+
MZ: "258",
|
|
157
|
+
NA: "264",
|
|
158
|
+
NC: "687",
|
|
159
|
+
NE: "227",
|
|
160
|
+
NF: "672",
|
|
161
|
+
NG: "234",
|
|
162
|
+
NI: "505",
|
|
163
|
+
NL: "31",
|
|
164
|
+
NO: "47",
|
|
165
|
+
NP: "977",
|
|
166
|
+
NR: "674",
|
|
167
|
+
NU: "683",
|
|
168
|
+
NZ: "64",
|
|
169
|
+
OM: "968",
|
|
170
|
+
PA: "507",
|
|
171
|
+
PE: "51",
|
|
172
|
+
PF: "689",
|
|
173
|
+
PG: "675",
|
|
174
|
+
PH: "63",
|
|
175
|
+
PK: "92",
|
|
176
|
+
PL: "48",
|
|
177
|
+
PM: "508",
|
|
178
|
+
PR: "1787",
|
|
179
|
+
PS: "970",
|
|
180
|
+
PT: "351",
|
|
181
|
+
PW: "680",
|
|
182
|
+
PY: "595",
|
|
183
|
+
QA: "974",
|
|
184
|
+
RE: "262",
|
|
185
|
+
RO: "40",
|
|
186
|
+
RS: "381",
|
|
187
|
+
RU: "7",
|
|
188
|
+
RW: "250",
|
|
189
|
+
SA: "966",
|
|
190
|
+
SB: "677",
|
|
191
|
+
SC: "248",
|
|
192
|
+
SD: "249",
|
|
193
|
+
SE: "46",
|
|
194
|
+
SG: "65",
|
|
195
|
+
SH: "290",
|
|
196
|
+
SI: "386",
|
|
197
|
+
SJ: "47",
|
|
198
|
+
SK: "421",
|
|
199
|
+
SL: "232",
|
|
200
|
+
SM: "378",
|
|
201
|
+
SN: "221",
|
|
202
|
+
SO: "252",
|
|
203
|
+
SR: "597",
|
|
204
|
+
SS: "211",
|
|
205
|
+
ST: "239",
|
|
206
|
+
SV: "503",
|
|
207
|
+
SX: "1721",
|
|
208
|
+
SY: "963",
|
|
209
|
+
SZ: "268",
|
|
210
|
+
TC: "1649",
|
|
211
|
+
TD: "235",
|
|
212
|
+
TG: "228",
|
|
213
|
+
TH: "66",
|
|
214
|
+
TJ: "992",
|
|
215
|
+
TK: "690",
|
|
216
|
+
TL: "670",
|
|
217
|
+
TM: "993",
|
|
218
|
+
TN: "216",
|
|
219
|
+
TO: "676",
|
|
220
|
+
TR: "90",
|
|
221
|
+
TT: "1868",
|
|
222
|
+
TV: "688",
|
|
223
|
+
TW: "886",
|
|
224
|
+
TZ: "255",
|
|
225
|
+
UA: "380",
|
|
226
|
+
UG: "256",
|
|
227
|
+
US: "1",
|
|
228
|
+
UY: "598",
|
|
229
|
+
UZ: "998",
|
|
230
|
+
VA: "39",
|
|
231
|
+
VC: "1784",
|
|
232
|
+
VE: "58",
|
|
233
|
+
VG: "1284",
|
|
234
|
+
VI: "1340",
|
|
235
|
+
VN: "84",
|
|
236
|
+
VU: "678",
|
|
237
|
+
WF: "681",
|
|
238
|
+
WS: "685",
|
|
239
|
+
XK: "383",
|
|
240
|
+
YE: "967",
|
|
241
|
+
YT: "262",
|
|
242
|
+
ZA: "27",
|
|
243
|
+
ZM: "260",
|
|
244
|
+
ZW: "263"
|
|
245
|
+
};
|
|
246
|
+
export const DEFAULT_PHONE_COUNTRY = "DK";
|
|
247
|
+
const MAX_DIGITS = 15;
|
|
248
|
+
const MIN_NATIONAL_DIGITS = 4;
|
|
249
|
+
const flag = (code) => String.fromCodePoint(...[...code].map((char) => 127397 + char.charCodeAt(0)));
|
|
250
|
+
export const allPhoneCountries = Object.entries(DIAL_CODES).map(([code, dial]) => ({ code, dial, flag: flag(code) }));
|
|
251
|
+
export const isPhoneCountry = (code) => code in DIAL_CODES;
|
|
252
|
+
export const isCountryPhone = (field) => field.type === "tel" && field.phone?.mode === "country";
|
|
253
|
+
export function phoneCountries(config) {
|
|
254
|
+
const wanted = [...new Set(config?.countries?.map((code) => code.toUpperCase()))];
|
|
255
|
+
const list = wanted.flatMap((code) => allPhoneCountries.find((country) => country.code === code) ?? []);
|
|
256
|
+
return list.length ? list : allPhoneCountries;
|
|
257
|
+
}
|
|
258
|
+
export function defaultPhoneCountry(config) {
|
|
259
|
+
const list = phoneCountries(config);
|
|
260
|
+
const preferred = [config?.defaultCountry?.toUpperCase(), DEFAULT_PHONE_COUNTRY];
|
|
261
|
+
return preferred.find((code) => code && list.some((country) => country.code === code)) ?? list[0].code;
|
|
262
|
+
}
|
|
263
|
+
export function countryName(code, locale) {
|
|
264
|
+
try {
|
|
265
|
+
return new Intl.DisplayNames([locale], { type: "region" }).of(code) ?? code;
|
|
266
|
+
} catch {
|
|
267
|
+
return code;
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
const digitsOf = (value) => value.replace(/\D/g, "");
|
|
271
|
+
export function composePhone(country, national) {
|
|
272
|
+
const dial = DIAL_CODES[country];
|
|
273
|
+
const digits = dial === "39" ? digitsOf(national) : digitsOf(national).replace(/^0+(?=\d)/, "");
|
|
274
|
+
return dial && digits ? `+${dial}${digits}` : "";
|
|
275
|
+
}
|
|
276
|
+
export function parsePhone(value, config, preferred) {
|
|
277
|
+
const fallback = preferred ?? defaultPhoneCountry(config);
|
|
278
|
+
const digits = digitsOf(value);
|
|
279
|
+
if (!value.trim().startsWith("+")) return { country: fallback, national: digits };
|
|
280
|
+
const matches = phoneCountries(config).filter((country) => digits.startsWith(country.dial)).sort((a, b) => b.dial.length - a.dial.length);
|
|
281
|
+
const longest = matches[0];
|
|
282
|
+
if (!longest) return { country: fallback, national: digits };
|
|
283
|
+
const chosen = matches.find((country) => country.dial === longest.dial && country.code === preferred) ?? longest;
|
|
284
|
+
return { country: chosen.code, national: digits.slice(chosen.dial.length) };
|
|
285
|
+
}
|
|
286
|
+
export function phoneIssue(field, value) {
|
|
287
|
+
if (field.phone?.mode !== "country") return /^[+()\d\s-]{5,}$/.test(value) ? void 0 : "format";
|
|
288
|
+
if (!/^\+\d+$/.test(value.replace(/[\s()-]/g, ""))) return "format";
|
|
289
|
+
const digits = digitsOf(value);
|
|
290
|
+
if (digits.length > MAX_DIGITS) return "format";
|
|
291
|
+
const country = phoneCountries(field.phone).find((candidate) => digits.startsWith(candidate.dial));
|
|
292
|
+
if (!country) return "country";
|
|
293
|
+
return digits.length - country.dial.length >= MIN_NATIONAL_DIGITS ? void 0 : "format";
|
|
294
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { FormDefinition } from '../../types.js';
|
|
2
|
+
import type { Answers } from './conditions.js';
|
|
3
|
+
export type PreviewDevice = 'mobile' | 'desktop';
|
|
4
|
+
/** Real rendering width (px) of each preview device. */
|
|
5
|
+
export declare const PREVIEW_WIDTHS: Record<PreviewDevice, number>;
|
|
6
|
+
/** Scale that fits `width` into `available`; never upscales, never collapses to zero. */
|
|
7
|
+
export declare function previewScale(available: number, width: number): number;
|
|
8
|
+
/**
|
|
9
|
+
* The answers a real submit would send: only visible input fields (never the captcha token), with files described by
|
|
10
|
+
* name/size/type so the result can be shown as JSON.
|
|
11
|
+
*/
|
|
12
|
+
export declare function previewPayload(definition: FormDefinition, answers: Answers): Record<string, unknown>;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { validatedFields } from "./schema.js";
|
|
2
|
+
import { isAnswerField } from "./conditions.js";
|
|
3
|
+
export const PREVIEW_WIDTHS = { mobile: 390, desktop: 960 };
|
|
4
|
+
export function previewScale(available, width) {
|
|
5
|
+
if (!(available > 0) || !(width > 0)) return 1;
|
|
6
|
+
return Math.min(1, Math.max(0.1, available / width));
|
|
7
|
+
}
|
|
8
|
+
const isFile = (value) => typeof File !== "undefined" && value instanceof File;
|
|
9
|
+
export function previewPayload(definition, answers) {
|
|
10
|
+
const payload = {};
|
|
11
|
+
for (const field of validatedFields(definition, answers).filter(isAnswerField)) {
|
|
12
|
+
const value = answers[field.key];
|
|
13
|
+
if (value === void 0) continue;
|
|
14
|
+
payload[field.key] = Array.isArray(value) ? value.map((item) => isFile(item) ? { name: item.name, size: item.size, type: item.type } : item) : isFile(value) ? { name: value.name, size: value.size, type: value.type } : value;
|
|
15
|
+
}
|
|
16
|
+
return payload;
|
|
17
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { isScheduleOpen as isFormOpen, nextScheduleOpening as nextFormOpening } from '@frigear-nu/module-kit/schedule';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { isScheduleOpen as isFormOpen, nextScheduleOpening as nextFormOpening } from "@frigear-nu/module-kit/schedule";
|
|
@@ -7,6 +7,8 @@ export type SchemaOptions = {
|
|
|
7
7
|
t?: MessageTranslator;
|
|
8
8
|
/** Locale used for `validation.message` overrides from the definition. */
|
|
9
9
|
locale?: string;
|
|
10
|
+
/** Leaves `captcha` fields out (submissions authenticated by an API token skip the captcha). */
|
|
11
|
+
skipCaptcha?: boolean;
|
|
10
12
|
};
|
|
11
13
|
/** Applied when a file field sets no `maxSize` / `maxFiles`, so uploads are always bounded. */
|
|
12
14
|
export declare const DEFAULT_MAX_FILE_SIZE = 10000000;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import { isInputField, resolveVisibility } from "./conditions.js";
|
|
3
|
-
import {
|
|
3
|
+
import { phoneIssue } from "./phone.js";
|
|
4
|
+
import { translate } from "@frigear-nu/ui/translated";
|
|
5
|
+
import { defaultMessages } from "./text.js";
|
|
4
6
|
const EMAIL = /^[^\s@]+@[^\s@][^\s.@]*\.[^\s@]+$/;
|
|
5
|
-
const PHONE = /^[+()\d\s-]{5,}$/;
|
|
6
7
|
const DATE = /^\d{4}-\d{2}-\d{2}/;
|
|
7
8
|
export const DEFAULT_MAX_FILE_SIZE = 1e7;
|
|
8
9
|
export const DEFAULT_MAX_FILES = 10;
|
|
@@ -15,6 +16,10 @@ export function buildFieldSchema(field, options = {}) {
|
|
|
15
16
|
const override = rules.message ? translate(rules.message, options.locale) : void 0;
|
|
16
17
|
const message = (key, fallback, params) => override ?? t(`validation.${key}`, fallback, params);
|
|
17
18
|
const requiredMessage = () => message("required", "This field is required.");
|
|
19
|
+
if (field.type === "captcha") {
|
|
20
|
+
const captchaMessage = override ?? t("validation.captcha", "Please complete the captcha.");
|
|
21
|
+
return z.string({ error: captchaMessage }).trim().min(1, { error: captchaMessage });
|
|
22
|
+
}
|
|
18
23
|
if (field.type === "checkbox") {
|
|
19
24
|
const boolean = z.boolean({ error: requiredMessage });
|
|
20
25
|
return required ? boolean.refine((value) => value === true, { error: requiredMessage }) : boolean.optional();
|
|
@@ -62,8 +67,10 @@ export function buildFieldSchema(field, options = {}) {
|
|
|
62
67
|
if (field.type === "email" && !EMAIL.test(value)) {
|
|
63
68
|
ctx.addIssue({ code: "custom", message: message("email", "Enter a valid email address.") });
|
|
64
69
|
}
|
|
65
|
-
if (field.type === "tel"
|
|
66
|
-
|
|
70
|
+
if (field.type === "tel") {
|
|
71
|
+
const issue = phoneIssue(field, value);
|
|
72
|
+
if (issue === "country") ctx.addIssue({ code: "custom", message: message("telCountry", "Phone numbers from this country are not accepted.") });
|
|
73
|
+
else if (issue) ctx.addIssue({ code: "custom", message: message("tel", "Enter a valid phone number.") });
|
|
67
74
|
}
|
|
68
75
|
if (field.type === "date" && !DATE.test(value)) {
|
|
69
76
|
ctx.addIssue({ code: "custom", message: message("date", "Enter a valid date.") });
|
|
@@ -89,6 +96,7 @@ export function validatedFields(definition, answers, stepIndex) {
|
|
|
89
96
|
export function buildFormSchema(definition, answers, options = {}) {
|
|
90
97
|
const shape = {};
|
|
91
98
|
for (const field of validatedFields(definition, answers, options.stepIndex)) {
|
|
99
|
+
if (field.type === "captcha" && options.skipCaptcha) continue;
|
|
92
100
|
shape[field.key] = buildFieldSchema(field, options);
|
|
93
101
|
}
|
|
94
102
|
return z.object(shape);
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import type { FormDefinition, FormField, Translated } from '../../types.js';
|
|
2
|
+
export type RenderedAnswer = {
|
|
3
|
+
key: string;
|
|
4
|
+
label: string;
|
|
5
|
+
value: string;
|
|
6
|
+
};
|
|
7
|
+
export declare function formatValue(field: FormField, value: unknown, locale: string): string;
|
|
8
|
+
/** Answers as label/value rows in form order, using the definition the answers were given against. */
|
|
9
|
+
export declare function renderAnswers(definition: FormDefinition, answers: Record<string, unknown>, locale: string): RenderedAnswer[];
|
|
10
|
+
export declare const escapeHtml: (value: string) => string;
|
|
11
|
+
export declare function answersToText(rows: RenderedAnswer[]): string;
|
|
12
|
+
export declare function answersToHtml(rows: RenderedAnswer[]): string;
|
|
13
|
+
/** Everything a template can refer to. */
|
|
14
|
+
export type EmailContext = {
|
|
15
|
+
form: {
|
|
16
|
+
name: string;
|
|
17
|
+
slug: string;
|
|
18
|
+
version: number;
|
|
19
|
+
};
|
|
20
|
+
/** `id` is `null` when the form does not store submissions. */
|
|
21
|
+
submission: {
|
|
22
|
+
id: string | null;
|
|
23
|
+
createdAt: string;
|
|
24
|
+
locale: string;
|
|
25
|
+
};
|
|
26
|
+
answers: RenderedAnswer[];
|
|
27
|
+
/** Names of the files stored with the submission. */
|
|
28
|
+
files?: string[];
|
|
29
|
+
replyTo?: string;
|
|
30
|
+
};
|
|
31
|
+
/** Variables that are not tied to a field. */
|
|
32
|
+
export declare const staticVariables: readonly ["form.name", "form.slug", "form.version", "submission.id", "submission.createdAt", "submission.locale", "answers", "files", "replyTo"];
|
|
33
|
+
/** Names used in a template, in order of appearance, without duplicates. */
|
|
34
|
+
export declare function templateVariables(template: string): string[];
|
|
35
|
+
/** Plain-text rendering; unknown variables become empty. */
|
|
36
|
+
export declare function renderTemplateText(template: string, ctx: EmailContext): string;
|
|
37
|
+
/** HTML rendering: every literal and value is escaped, newlines become `<br>`; `{{answers}}` is the rendered table. */
|
|
38
|
+
export declare function renderTemplateHtml(template: string, ctx: EmailContext): string;
|
|
39
|
+
/** A one-line header value: variables resolved, line breaks collapsed so nothing can inject a header. */
|
|
40
|
+
export declare function renderTemplateLine(template: string, ctx: EmailContext): string;
|
|
41
|
+
type EmailSettings = {
|
|
42
|
+
subject?: Translated;
|
|
43
|
+
body?: Translated;
|
|
44
|
+
};
|
|
45
|
+
/** Subject, HTML and text of the notification. Without a custom `body` this is the generated answers email. */
|
|
46
|
+
export declare function composeEmail(email: EmailSettings, ctx: EmailContext): {
|
|
47
|
+
subject: string;
|
|
48
|
+
body: string;
|
|
49
|
+
text: string;
|
|
50
|
+
};
|
|
51
|
+
/** Variable names an email's subject and body can use for this definition. */
|
|
52
|
+
export declare function availableVariables(definition: FormDefinition): string[];
|
|
53
|
+
/** Variables in the subject / body (any language) that match nothing; they render empty, so this is a warning. */
|
|
54
|
+
export declare function unknownBodyVariables(definition: FormDefinition): string[];
|
|
55
|
+
/** Example answers for every input field, to preview a template with. */
|
|
56
|
+
export declare function sampleAnswers(definition: FormDefinition): Record<string, unknown>;
|
|
57
|
+
export {};
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
import { isAnswerField, resolveVisibility } from "./conditions.js";
|
|
2
|
+
import { translate } from "@frigear-nu/ui/translated";
|
|
3
|
+
const YES_NO = { en: ["Yes", "No"], da: ["Ja", "Nej"] };
|
|
4
|
+
const optionLabel = (field, value, locale) => translate(field.options?.find((option) => option.value === value)?.label, locale) || value;
|
|
5
|
+
export function formatValue(field, value, locale) {
|
|
6
|
+
if (value === void 0 || value === null || value === "") return "";
|
|
7
|
+
if (field.type === "checkbox") return (YES_NO[locale.split(/[-_]/)[0]] ?? YES_NO.en)[value === true ? 0 : 1];
|
|
8
|
+
if (field.type === "file") return Array.isArray(value) ? value.map((file) => file.name).join(", ") : "";
|
|
9
|
+
if ((field.type === "select" || field.type === "radio") && typeof value === "string") return optionLabel(field, value, locale);
|
|
10
|
+
if (Array.isArray(value)) return value.map((entry) => field.options ? optionLabel(field, String(entry), locale) : String(entry)).join(", ");
|
|
11
|
+
return String(value);
|
|
12
|
+
}
|
|
13
|
+
export function renderAnswers(definition, answers, locale) {
|
|
14
|
+
return resolveVisibility(definition, answers).flatMap(({ fields }) => fields).filter(isAnswerField).map((field) => ({
|
|
15
|
+
key: field.key,
|
|
16
|
+
label: translate(field.label, locale) || field.key,
|
|
17
|
+
value: formatValue(field, answers[field.key], locale)
|
|
18
|
+
}));
|
|
19
|
+
}
|
|
20
|
+
export const escapeHtml = (value) => value.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """);
|
|
21
|
+
export function answersToText(rows) {
|
|
22
|
+
return rows.map((row) => `${row.label}: ${row.value || "-"}`).join("\n");
|
|
23
|
+
}
|
|
24
|
+
export function answersToHtml(rows) {
|
|
25
|
+
const body = rows.map(
|
|
26
|
+
(row) => `<tr><td style="padding:4px 12px 4px 0;vertical-align:top;font-weight:600">${escapeHtml(row.label)}</td><td style="padding:4px 0;white-space:pre-wrap">${escapeHtml(row.value) || "-"}</td></tr>`
|
|
27
|
+
).join("");
|
|
28
|
+
return `<table style="border-collapse:collapse;font-family:sans-serif;font-size:14px">${body}</table>`;
|
|
29
|
+
}
|
|
30
|
+
const VARIABLE = /\{\{\s*([A-Z_][\w.]*)\s*\}\}/gi;
|
|
31
|
+
export const staticVariables = [
|
|
32
|
+
"form.name",
|
|
33
|
+
"form.slug",
|
|
34
|
+
"form.version",
|
|
35
|
+
"submission.id",
|
|
36
|
+
"submission.createdAt",
|
|
37
|
+
"submission.locale",
|
|
38
|
+
"answers",
|
|
39
|
+
"files",
|
|
40
|
+
"replyTo"
|
|
41
|
+
];
|
|
42
|
+
export function templateVariables(template) {
|
|
43
|
+
return [...new Set([...template.matchAll(VARIABLE)].map((match) => match[1]))];
|
|
44
|
+
}
|
|
45
|
+
function variableText(name, ctx) {
|
|
46
|
+
switch (name) {
|
|
47
|
+
case "form.name":
|
|
48
|
+
return ctx.form.name;
|
|
49
|
+
case "form.slug":
|
|
50
|
+
return ctx.form.slug;
|
|
51
|
+
case "form.version":
|
|
52
|
+
return String(ctx.form.version);
|
|
53
|
+
case "submission.id":
|
|
54
|
+
return ctx.submission.id ?? "";
|
|
55
|
+
case "submission.createdAt":
|
|
56
|
+
return ctx.submission.createdAt;
|
|
57
|
+
case "submission.locale":
|
|
58
|
+
return ctx.submission.locale;
|
|
59
|
+
case "answers":
|
|
60
|
+
return answersToText(ctx.answers);
|
|
61
|
+
case "files":
|
|
62
|
+
return (ctx.files ?? []).join(", ");
|
|
63
|
+
case "replyTo":
|
|
64
|
+
return ctx.replyTo ?? "";
|
|
65
|
+
}
|
|
66
|
+
if (name.startsWith("answer.")) return ctx.answers.find((row) => row.key === name.slice(7))?.value ?? "";
|
|
67
|
+
return void 0;
|
|
68
|
+
}
|
|
69
|
+
function tokens(template) {
|
|
70
|
+
const out = [];
|
|
71
|
+
let last = 0;
|
|
72
|
+
for (const match of template.matchAll(VARIABLE)) {
|
|
73
|
+
if (match.index > last) out.push({ literal: template.slice(last, match.index) });
|
|
74
|
+
out.push({ name: match[1] });
|
|
75
|
+
last = match.index + match[0].length;
|
|
76
|
+
}
|
|
77
|
+
if (last < template.length) out.push({ literal: template.slice(last) });
|
|
78
|
+
return out;
|
|
79
|
+
}
|
|
80
|
+
const normalizeNewlines = (value) => value.replace(/\r\n?/g, "\n");
|
|
81
|
+
const textToHtml = (value) => escapeHtml(normalizeNewlines(value)).replaceAll("\n", "<br>");
|
|
82
|
+
export function renderTemplateText(template, ctx) {
|
|
83
|
+
return normalizeNewlines(tokens(template).map((token) => token.name ? variableText(token.name, ctx) ?? "" : token.literal).join(""));
|
|
84
|
+
}
|
|
85
|
+
export function renderTemplateHtml(template, ctx) {
|
|
86
|
+
const html = tokens(template).map((token) => {
|
|
87
|
+
if (!token.name) return textToHtml(token.literal);
|
|
88
|
+
if (token.name === "answers") return answersToHtml(ctx.answers);
|
|
89
|
+
return textToHtml(variableText(token.name, ctx) ?? "");
|
|
90
|
+
}).join("");
|
|
91
|
+
return `<div style="font-family:sans-serif;font-size:14px;line-height:1.5">${html}</div>`;
|
|
92
|
+
}
|
|
93
|
+
export function renderTemplateLine(template, ctx) {
|
|
94
|
+
return renderTemplateText(template, ctx).replace(/\s*\n\s*/g, " ").trim();
|
|
95
|
+
}
|
|
96
|
+
export function composeEmail(email, ctx) {
|
|
97
|
+
const locale = ctx.submission.locale;
|
|
98
|
+
const subjectTemplate = translate(email.subject, locale);
|
|
99
|
+
const subject = subjectTemplate && renderTemplateLine(subjectTemplate, ctx) || `New submission: ${ctx.form.name}`;
|
|
100
|
+
const template = translate(email.body, locale).trim() ? translate(email.body, locale) : "";
|
|
101
|
+
if (template) return { subject, body: renderTemplateHtml(template, ctx), text: renderTemplateText(template, ctx) };
|
|
102
|
+
const files = ctx.files ?? [];
|
|
103
|
+
return {
|
|
104
|
+
subject,
|
|
105
|
+
body: `<p><strong>${escapeHtml(ctx.form.name)}</strong></p>${answersToHtml(ctx.answers)}` + (files.length ? `<p>Files stored with the submission: ${escapeHtml(files.join(", "))}</p>` : ""),
|
|
106
|
+
text: answersToText(ctx.answers) + (files.length ? `
|
|
107
|
+
|
|
108
|
+
Files stored with the submission: ${files.join(", ")}` : "")
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
export function availableVariables(definition) {
|
|
112
|
+
const answerKeys = definition.steps.flatMap((step) => step.fields.filter(isAnswerField).map((field) => `answer.${field.key}`));
|
|
113
|
+
return [...staticVariables, ...answerKeys];
|
|
114
|
+
}
|
|
115
|
+
export function unknownBodyVariables(definition) {
|
|
116
|
+
const email = definition.delivery?.email;
|
|
117
|
+
if (!email) return [];
|
|
118
|
+
const known = new Set(availableVariables(definition));
|
|
119
|
+
const texts = [email.subject, email.body].flatMap((value) => !value ? [] : typeof value === "string" ? [value] : Object.values(value));
|
|
120
|
+
return [...new Set(texts.flatMap(templateVariables))].filter((name) => !known.has(name));
|
|
121
|
+
}
|
|
122
|
+
const sampleValue = (field) => {
|
|
123
|
+
switch (field.type) {
|
|
124
|
+
case "email":
|
|
125
|
+
return "name@example.com";
|
|
126
|
+
case "tel":
|
|
127
|
+
return "+45 12 34 56 78";
|
|
128
|
+
case "number":
|
|
129
|
+
return 42;
|
|
130
|
+
case "textarea":
|
|
131
|
+
return "A longer message\non two lines.";
|
|
132
|
+
case "select":
|
|
133
|
+
case "radio":
|
|
134
|
+
return field.options?.[0]?.value;
|
|
135
|
+
case "checkbox":
|
|
136
|
+
return true;
|
|
137
|
+
case "date":
|
|
138
|
+
return "2026-01-31";
|
|
139
|
+
case "file":
|
|
140
|
+
return [{ name: "document.pdf" }];
|
|
141
|
+
default:
|
|
142
|
+
return "Sample text";
|
|
143
|
+
}
|
|
144
|
+
};
|
|
145
|
+
export function sampleAnswers(definition) {
|
|
146
|
+
return Object.fromEntries(definition.steps.flatMap((step) => step.fields.filter(isAnswerField).map((field) => [field.key, sampleValue(field)])));
|
|
147
|
+
}
|
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
import type { Translated } from '../../types.js';
|
|
2
|
-
/** Picks the text for a locale, falling back to `en`, then to the first available entry. */
|
|
3
|
-
export declare function translate(value: Translated | null | undefined, locale?: string): string;
|
|
4
1
|
export type TranslateParams = Record<string, string | number>;
|
|
5
2
|
/** `(key, englishFallback, params) => text`, the shape of `useModuleT('forms')`. */
|
|
6
3
|
export type MessageTranslator = (key: string, fallback: string, params?: TranslateParams) => string;
|
|
@@ -1,8 +1,3 @@
|
|
|
1
|
-
export function translate(value, locale = "en") {
|
|
2
|
-
if (!value) return "";
|
|
3
|
-
if (typeof value === "string") return value;
|
|
4
|
-
return value[locale] ?? value.en ?? Object.values(value)[0] ?? "";
|
|
5
|
-
}
|
|
6
1
|
export function interpolate(text, params = {}) {
|
|
7
2
|
return Object.entries(params).reduce((result, [name, value]) => result.replaceAll(`{${name}}`, String(value)), text);
|
|
8
3
|
}
|
package/dist/types.d.mts
CHANGED
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
export { type FormSchedule, type FormScheduleMoment } from '@frigear-nu/module-kit/schedule'
|
|
2
|
+
|
|
3
|
+
export { type Translated } from '@frigear-nu/ui/translated'
|
|
4
|
+
|
|
1
5
|
export { default } from './module.mjs'
|
|
2
6
|
|
|
3
|
-
export { type AuthorizeContext, type Condition, type ConditionOp, type DeliveredContext, type DeliveryStatus, type FieldOption, type FieldType, type FieldValidation, type FileDescriptor, type FormAdminDto, type FormDefinition, type FormDelivery, type FormField, type FormMode, type FormStatus, type FormStep, type FormStorage, type FormSubmitSettings, type FormSummaryDto, type FormsRuntimeConfig, type ModuleOptions, type PublicFormDto, type PublicModuleOptions, type SeedForm, type SubmissionDto, type SubmissionFileDto, type SubmissionSummaryDto, type SubmitResponse, type SubmittedContext, type SubmittedFile
|
|
7
|
+
export { type AuthorizeContext, type CaptchaConfig, type CaptchaProvider, type CaptchaVerifyContext, type Condition, type ConditionOp, type CreatedFormAccessTokenDto, type DeliveredContext, type DeliveryStatus, type FieldOption, type FieldType, type FieldValidation, type FileDescriptor, type FormAccess, type FormAccessInfoDto, type FormAccessTokenDto, type FormAdminDto, type FormAuthMode, type FormAvailability, type FormDefinition, type FormDelivery, type FormField, type FormMode, type FormPasswordStatusDto, type FormSecretsDto, type FormStatus, type FormStep, type FormStorage, type FormSubmitSettings, type FormSummaryDto, type FormsRuntimeConfig, type ModuleOptions, type PhoneConfig, type PublicFormDto, type PublicModuleOptions, type SecretSource, type SeedForm, type SubmissionDto, type SubmissionFileDto, type SubmissionSummaryDto, type SubmitResponse, type SubmittedContext, type SubmittedFile } from './module.mjs'
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@frigear-nu/forms",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.8",
|
|
4
4
|
"description": "Dynamic, database-stored forms (single page or stepped) with submissions, file uploads and email delivery for the frigear ecosystem.",
|
|
5
5
|
"homepage": "https://docs.frigear.dev/modules/forms",
|
|
6
6
|
"repository": {
|
|
@@ -30,10 +30,13 @@
|
|
|
30
30
|
"playground"
|
|
31
31
|
],
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"@frigear-nu/
|
|
34
|
-
"@frigear-nu/module-kit": "0.
|
|
35
|
-
"@frigear-nu/notify": "0.0.
|
|
36
|
-
"@frigear-nu/
|
|
33
|
+
"@frigear-nu/admin": "0.0.3",
|
|
34
|
+
"@frigear-nu/module-kit": "1.0.0",
|
|
35
|
+
"@frigear-nu/notify": "0.0.10",
|
|
36
|
+
"@frigear-nu/ui": "0.0.8",
|
|
37
|
+
"@frigear-nu/auth": "0.0.4",
|
|
38
|
+
"@frigear-nu/mcp": "0.0.4",
|
|
39
|
+
"@frigear-nu/users": "1.0.10",
|
|
37
40
|
"@libsql/client": "^0.18.0",
|
|
38
41
|
"@nuxt/kit": "^4.6.0",
|
|
39
42
|
"drizzle-kit": "^0.31.11",
|
|
@@ -43,15 +46,20 @@
|
|
|
43
46
|
"zod": "^4.6.5"
|
|
44
47
|
},
|
|
45
48
|
"peerDependencies": {
|
|
49
|
+
"@frigear-nu/menu": "0.0.10",
|
|
46
50
|
"@nuxt/ui": "^4.10.0",
|
|
47
51
|
"@nuxthub/core": "^0.10.8"
|
|
48
52
|
},
|
|
49
53
|
"peerDependenciesMeta": {
|
|
54
|
+
"@frigear-nu/menu": {
|
|
55
|
+
"optional": true
|
|
56
|
+
},
|
|
50
57
|
"@nuxt/ui": {
|
|
51
58
|
"optional": true
|
|
52
59
|
}
|
|
53
60
|
},
|
|
54
61
|
"devDependencies": {
|
|
62
|
+
"@frigear-nu/menu": "0.0.10",
|
|
55
63
|
"@nuxt/devtools": "^3.4.2",
|
|
56
64
|
"@nuxt/eslint-config": "^1.17.0",
|
|
57
65
|
"@nuxt/module-builder": "^1.0.3",
|