accomadesc 0.2.12 → 0.2.14
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/dist/BookingRequest.svelte +16 -10
- package/dist/ContactForm.svelte +22 -12
- package/dist/types.d.ts +2 -0
- package/package.json +2 -2
|
@@ -25,6 +25,7 @@
|
|
|
25
25
|
submitText,
|
|
26
26
|
invalidText,
|
|
27
27
|
maxCharsAllowed = 300,
|
|
28
|
+
preview = false,
|
|
28
29
|
translateFunc,
|
|
29
30
|
formatDateFunc,
|
|
30
31
|
}: BookingRequestContent & I18nFacade = $props();
|
|
@@ -34,7 +35,6 @@
|
|
|
34
35
|
let message = $state('');
|
|
35
36
|
let arrival: DateTime | undefined = $state();
|
|
36
37
|
let leave: DateTime | undefined = $state();
|
|
37
|
-
let disabled = $state(false);
|
|
38
38
|
let inputDatesEngaged = $state(false);
|
|
39
39
|
|
|
40
40
|
let currentCharsCount = $derived(message.length);
|
|
@@ -50,8 +50,7 @@
|
|
|
50
50
|
let errored = $state(false);
|
|
51
51
|
let successfullySent = $state(false);
|
|
52
52
|
let sending = $state(false);
|
|
53
|
-
|
|
54
|
-
//https://popnapdkcdnabruxkjti.supabase.co/storage/v1/object/public/ical/81e66599-ac3c-4ad6-b261-fceeb784f9e9/050edcb4-680e-4542-96df-3ae4a2af89a5
|
|
53
|
+
let disabled = $derived(preview || errored || successfullySent);
|
|
55
54
|
|
|
56
55
|
const url = calUrl;
|
|
57
56
|
const oStateID = `i-${url}-${OCCUPATION_STATE}`;
|
|
@@ -165,6 +164,7 @@
|
|
|
165
164
|
{/if}
|
|
166
165
|
<div class="date-input-wrapper" id="engage-date-buttons">
|
|
167
166
|
<Button
|
|
167
|
+
enabled={!disabled}
|
|
168
168
|
id="date-input"
|
|
169
169
|
iconName="edit"
|
|
170
170
|
size={1.8}
|
|
@@ -190,18 +190,19 @@
|
|
|
190
190
|
</label>
|
|
191
191
|
|
|
192
192
|
<div class="message-wrapper">
|
|
193
|
-
{#if
|
|
194
|
-
|
|
193
|
+
{#if preview}<div>[PREVIEW]</div>{/if}
|
|
194
|
+
{#if successfullySent || preview}
|
|
195
|
+
<div class="messsage success">
|
|
195
196
|
{translateFunc ? translateFunc(successfullySentText) : 'Successfully Sent Email'}
|
|
196
197
|
</div>
|
|
197
198
|
{/if}
|
|
198
|
-
{#if errored}
|
|
199
|
-
<div class="error">
|
|
199
|
+
{#if errored || preview}
|
|
200
|
+
<div class="message error">
|
|
200
201
|
{translateFunc ? translateFunc(sentErroredText) : 'Error Occurred Sending Email'}
|
|
201
202
|
</div>
|
|
202
203
|
{/if}
|
|
203
|
-
{#if invalid}
|
|
204
|
-
<div class="error">
|
|
204
|
+
{#if invalid || preview}
|
|
205
|
+
<div class="message error">
|
|
205
206
|
{translateFunc ? translateFunc(invalidText) : 'Dates Are Not Available'}
|
|
206
207
|
</div>
|
|
207
208
|
{/if}
|
|
@@ -278,7 +279,7 @@
|
|
|
278
279
|
grid-column-start: start;
|
|
279
280
|
grid-column-end: end;
|
|
280
281
|
display: flex;
|
|
281
|
-
justify-content:
|
|
282
|
+
justify-content: space-between;
|
|
282
283
|
}
|
|
283
284
|
.button-wrapper {
|
|
284
285
|
grid-column-start: start;
|
|
@@ -293,6 +294,11 @@
|
|
|
293
294
|
color: var(--alert-font-color);
|
|
294
295
|
}
|
|
295
296
|
|
|
297
|
+
.message {
|
|
298
|
+
display: flex;
|
|
299
|
+
justify-content: space-between;
|
|
300
|
+
}
|
|
301
|
+
|
|
296
302
|
.success {
|
|
297
303
|
color: var(--accept-font-color);
|
|
298
304
|
font-weight: bolder;
|
package/dist/ContactForm.svelte
CHANGED
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
successfullySentText,
|
|
17
17
|
sentErroredText,
|
|
18
18
|
maxCharsAllowed = 300,
|
|
19
|
+
preview = false,
|
|
19
20
|
translateFunc,
|
|
20
21
|
}: ContactFormContent & I18nFacade = $props();
|
|
21
22
|
|
|
@@ -33,7 +34,8 @@
|
|
|
33
34
|
let currentCharsCount = $derived(question.length);
|
|
34
35
|
let showMaxCharsMessage = $derived(currentCharsCount > maxCharsAllowed - 50);
|
|
35
36
|
let canSubmit: boolean = $derived(
|
|
36
|
-
|
|
37
|
+
!preview &&
|
|
38
|
+
name.length > 0 &&
|
|
37
39
|
email.length > 0 &&
|
|
38
40
|
question.length > 0 &&
|
|
39
41
|
question.length <= maxCharsAllowed,
|
|
@@ -74,7 +76,7 @@
|
|
|
74
76
|
}, 15000);
|
|
75
77
|
};
|
|
76
78
|
|
|
77
|
-
let disabled = $derived(errored || successfullySent);
|
|
79
|
+
let disabled = $derived(preview || errored || successfullySent);
|
|
78
80
|
</script>
|
|
79
81
|
|
|
80
82
|
<div class="wrapper">
|
|
@@ -102,16 +104,19 @@
|
|
|
102
104
|
|
|
103
105
|
<Notes {disabled} changed={questionChanged} />
|
|
104
106
|
</label>
|
|
105
|
-
|
|
106
|
-
<div
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
107
|
+
<div class="message-wrapper">
|
|
108
|
+
{#if preview}<div>[PREVIEW]</div>{/if}
|
|
109
|
+
{#if successfullySent || preview}
|
|
110
|
+
<div class="success">
|
|
111
|
+
{translateFunc ? translateFunc(successfullySentText) : 'Successfully Sent Email'}
|
|
112
|
+
</div>
|
|
113
|
+
{/if}
|
|
114
|
+
{#if errored || preview}
|
|
115
|
+
<div class="error">
|
|
116
|
+
{translateFunc ? translateFunc(sentErroredText) : 'Error Occurred Sending Email'}
|
|
117
|
+
</div>
|
|
118
|
+
{/if}
|
|
119
|
+
</div>
|
|
115
120
|
<div class="button-wrapper">
|
|
116
121
|
<Button
|
|
117
122
|
enabled={canSubmit && !disabled}
|
|
@@ -146,6 +151,11 @@
|
|
|
146
151
|
}
|
|
147
152
|
}
|
|
148
153
|
|
|
154
|
+
.message-wrapper {
|
|
155
|
+
display: flex;
|
|
156
|
+
justify-content: space-between;
|
|
157
|
+
}
|
|
158
|
+
|
|
149
159
|
form {
|
|
150
160
|
display: flex;
|
|
151
161
|
flex-direction: column;
|
package/dist/types.d.ts
CHANGED
|
@@ -263,6 +263,7 @@ export interface ContactFormContent {
|
|
|
263
263
|
sentErroredText: string;
|
|
264
264
|
maxCharsAllowed?: number;
|
|
265
265
|
explainer?: string;
|
|
266
|
+
preview?: boolean;
|
|
266
267
|
}
|
|
267
268
|
export interface BookingRequest {
|
|
268
269
|
id: string;
|
|
@@ -285,6 +286,7 @@ export interface BookingRequestContent {
|
|
|
285
286
|
numberOfNightsLabel: string;
|
|
286
287
|
maxCharsAllowed?: number;
|
|
287
288
|
explainer?: string;
|
|
289
|
+
preview?: boolean;
|
|
288
290
|
}
|
|
289
291
|
export type Block = Text | Photo | PhotoGallery | Calendar | CalendarAvailable | CalendarGrid | CalendarRows | Pricing | PricingShort | AmenitiesCore | Weather | LeafletMap | AccoCard | AccoDescription | ContactForm | BookingRequest | undefined;
|
|
290
292
|
export interface FontSpec {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "accomadesc",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.14",
|
|
4
4
|
"scripts": {
|
|
5
5
|
"dev": "vite dev",
|
|
6
6
|
"build": "vite build && npm run package",
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
"publint": "^0.3.7",
|
|
49
49
|
"svelte": "^5.20.5",
|
|
50
50
|
"svelte-check": "^4.1.4",
|
|
51
|
-
"typescript": "^5.
|
|
51
|
+
"typescript": "^5.8.2",
|
|
52
52
|
"vite": "^6.2.0",
|
|
53
53
|
"vitest": "^2.1.9"
|
|
54
54
|
},
|