accomadesc 0.1.16 → 0.1.18
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/Calendar.svelte +3 -1
- package/dist/Calendar.svelte.d.ts +3 -1
- package/dist/CalendarAvailable.svelte +3 -2
- package/dist/CalendarAvailable.svelte.d.ts +3 -1
- package/dist/CalendarGrid.svelte +7 -1
- package/dist/CalendarGrid.svelte.d.ts +3 -1
- package/dist/CalendarRows.svelte +7 -1
- package/dist/CalendarRows.svelte.d.ts +3 -1
- package/dist/index.d.ts +2 -1
- package/dist/occuplan/OccuPlanAvailableInfo.svelte +4 -1
- package/dist/occuplan/OccuPlanAvailableInfo.svelte.d.ts +1 -0
- package/dist/occuplan/OccuPlanGrid.svelte +4 -1
- package/dist/occuplan/OccuPlanGrid.svelte.d.ts +1 -0
- package/dist/occuplan/OccuPlanPicker.svelte +4 -1
- package/dist/occuplan/OccuPlanPicker.svelte.d.ts +1 -0
- package/dist/occuplan/OccuPlanRows.svelte +4 -1
- package/dist/occuplan/OccuPlanRows.svelte.d.ts +1 -0
- package/dist/occuplan/OccuPlanWrapper.svelte +3 -10
- package/dist/occuplan/state.svelte.d.ts +4 -2
- package/dist/occuplan/state.svelte.js +13 -3
- package/dist/types.d.ts +49 -12
- package/dist/types.js +14 -0
- package/package.json +2 -1
package/dist/Calendar.svelte
CHANGED
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
let {
|
|
6
6
|
url,
|
|
7
|
+
debug = false,
|
|
7
8
|
calendarTranslation,
|
|
8
9
|
toggleGridOffset,
|
|
9
10
|
gridMonthNumbers,
|
|
@@ -14,12 +15,13 @@
|
|
|
14
15
|
rowsFirstMonth,
|
|
15
16
|
rowsMaxWidth,
|
|
16
17
|
translateFunc,
|
|
17
|
-
}: CalendarContent & I18nFacade = $props();
|
|
18
|
+
}: CalendarContent & I18nFacade & { debug?: boolean } = $props();
|
|
18
19
|
</script>
|
|
19
20
|
|
|
20
21
|
<div class="cal-wrapper">
|
|
21
22
|
<OccuPlanWrapper
|
|
22
23
|
{url}
|
|
24
|
+
{debug}
|
|
23
25
|
{toggleGridOffset}
|
|
24
26
|
gridNumberOfMonths={gridMonthNumbers}
|
|
25
27
|
{gridFirstMonth}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import type { CalendarContent, I18nFacade } from './types.js';
|
|
2
|
-
type $$ComponentProps = CalendarContent & I18nFacade
|
|
2
|
+
type $$ComponentProps = CalendarContent & I18nFacade & {
|
|
3
|
+
debug?: boolean;
|
|
4
|
+
};
|
|
3
5
|
declare const Calendar: import("svelte").Component<$$ComponentProps, {}, "">;
|
|
4
6
|
type Calendar = ReturnType<typeof Calendar>;
|
|
5
7
|
export default Calendar;
|
|
@@ -6,11 +6,12 @@
|
|
|
6
6
|
|
|
7
7
|
let {
|
|
8
8
|
url,
|
|
9
|
+
debug = true,
|
|
9
10
|
search = [3, 7, 14],
|
|
10
11
|
maxFutureDate = DateTime.now().plus({ years: 2 }).toISO(),
|
|
11
12
|
formatFunc,
|
|
12
13
|
translateFunc,
|
|
13
|
-
}: CalendarAvailableContent & I18nFacade = $props();
|
|
14
|
+
}: CalendarAvailableContent & I18nFacade & { debug?: boolean } = $props();
|
|
14
15
|
|
|
15
16
|
let availHeader = $derived(translateFunc ? translateFunc('availability') : '[AVAILABILITY]');
|
|
16
17
|
|
|
@@ -32,7 +33,7 @@
|
|
|
32
33
|
<div class="cal-wrapper">
|
|
33
34
|
<h3>{availHeader}</h3>
|
|
34
35
|
|
|
35
|
-
<OccuPlanAvailableInfo {search} {url}>
|
|
36
|
+
<OccuPlanAvailableInfo {debug} {search} {url}>
|
|
36
37
|
{#snippet children(av: AvailableSpans)}
|
|
37
38
|
<ul>
|
|
38
39
|
{#each search as s}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import type { CalendarAvailableContent, I18nFacade } from './types.js';
|
|
2
|
-
type $$ComponentProps = CalendarAvailableContent & I18nFacade
|
|
2
|
+
type $$ComponentProps = CalendarAvailableContent & I18nFacade & {
|
|
3
|
+
debug?: boolean;
|
|
4
|
+
};
|
|
3
5
|
declare const CalendarAvailable: import("svelte").Component<$$ComponentProps, {}, "">;
|
|
4
6
|
type CalendarAvailable = ReturnType<typeof CalendarAvailable>;
|
|
5
7
|
export default CalendarAvailable;
|
package/dist/CalendarGrid.svelte
CHANGED
|
@@ -2,12 +2,18 @@
|
|
|
2
2
|
import type { CalendarGridContent, I18nFacade } from './types.js';
|
|
3
3
|
import OccuPlanGrid from './occuplan/OccuPlanGrid.svelte';
|
|
4
4
|
|
|
5
|
-
let {
|
|
5
|
+
let {
|
|
6
|
+
url,
|
|
7
|
+
debug = false,
|
|
8
|
+
calendarTranslation,
|
|
9
|
+
translateFunc,
|
|
10
|
+
}: CalendarGridContent & I18nFacade & { debug?: boolean } = $props();
|
|
6
11
|
</script>
|
|
7
12
|
|
|
8
13
|
<div class="cal-wrapper">
|
|
9
14
|
<OccuPlanGrid
|
|
10
15
|
{url}
|
|
16
|
+
{debug}
|
|
11
17
|
header={translateFunc ? translateFunc('calendarHeader') : ''}
|
|
12
18
|
{...calendarTranslation}
|
|
13
19
|
/>
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import type { CalendarGridContent, I18nFacade } from './types.js';
|
|
2
|
-
type $$ComponentProps = CalendarGridContent & I18nFacade
|
|
2
|
+
type $$ComponentProps = CalendarGridContent & I18nFacade & {
|
|
3
|
+
debug?: boolean;
|
|
4
|
+
};
|
|
3
5
|
declare const CalendarGrid: import("svelte").Component<$$ComponentProps, {}, "">;
|
|
4
6
|
type CalendarGrid = ReturnType<typeof CalendarGrid>;
|
|
5
7
|
export default CalendarGrid;
|
package/dist/CalendarRows.svelte
CHANGED
|
@@ -2,12 +2,18 @@
|
|
|
2
2
|
import type { CalendarRowsContent, I18nFacade } from './types.js';
|
|
3
3
|
import OccuPlanRows from './occuplan/OccuPlanRows.svelte';
|
|
4
4
|
|
|
5
|
-
let {
|
|
5
|
+
let {
|
|
6
|
+
url,
|
|
7
|
+
debug,
|
|
8
|
+
calendarTranslation,
|
|
9
|
+
translateFunc,
|
|
10
|
+
}: CalendarRowsContent & I18nFacade & { debug?: boolean } = $props();
|
|
6
11
|
</script>
|
|
7
12
|
|
|
8
13
|
<div class="cal-wrapper">
|
|
9
14
|
<OccuPlanRows
|
|
10
15
|
{url}
|
|
16
|
+
{debug}
|
|
11
17
|
header={translateFunc ? translateFunc('calendarHeader') : ''}
|
|
12
18
|
{...calendarTranslation}
|
|
13
19
|
/>
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import type { CalendarRowsContent, I18nFacade } from './types.js';
|
|
2
|
-
type $$ComponentProps = CalendarRowsContent & I18nFacade
|
|
2
|
+
type $$ComponentProps = CalendarRowsContent & I18nFacade & {
|
|
3
|
+
debug?: boolean;
|
|
4
|
+
};
|
|
3
5
|
declare const CalendarRows: import("svelte").Component<$$ComponentProps, {}, "">;
|
|
4
6
|
type CalendarRows = ReturnType<typeof CalendarRows>;
|
|
5
7
|
export default CalendarRows;
|
package/dist/index.d.ts
CHANGED
|
@@ -23,6 +23,7 @@ import Section from './Section.svelte';
|
|
|
23
23
|
import Text from './Text.svelte';
|
|
24
24
|
import Weather from './Weather.svelte';
|
|
25
25
|
import PageComponent from './PageComponent.svelte';
|
|
26
|
-
export type {
|
|
26
|
+
export type { OccuplanTranslations } from './occuplan/state.svelte.ts';
|
|
27
|
+
export type { GridPhoto, LeafletMap as LeafletMapI, LeafletMapContent, Calendar as CalendarI, CalendarContent, CalendarAvailable as CalendarAvailableI, CalendarAvailableContent, CalendarGrid as CalendarGridI, CalendarGridContent, CalendarRows as CalendarRowsI, CalendarRowsContent, Text as TextI, TextContent, Weather as WeatherI, WeatherContent, Photo as PhotoI, PhotoContent, PhotoGallery as PhotoGalleryI, PhotoGalleryContent, Pricing as PricingI, PricingContent, PricingShort as PricingShortI, PricingShortContent, PricingEntry, PricingRange, PricingColumn, StaticRangeDate, StaticPricingRange, AmenitiesCore as AmenitiesCoreI, AmenitiesCoreContent, AccoCard as AccoCardI, AccoCardContent, ContactForm as ContactFormI, ContactFormContent, BookingRequest as BookingRequestI, BookingRequestContent, CardContent, AccoDescription as AccoDescriptionI, AccoDescriptionContent, Section as SectionI, I18nFacade, Block, PageProps, Nav as NavI, FormatSpec, FormatTemplateName, SiteConfig, SiteTranslation, FontSpec, } from './types.js';
|
|
27
28
|
export { PRICING_COLUMNS, isAccoCard, isText, isPhoto, isGallery, isLeafletMap, isWeather, isAmenitiesCore, isCalendarAvailable, isCalendar, isCalendarGrid, isCalendarRows, isPricing, isPricingShort, isAccoDescription, isBookingRequest, isContactForm, } from './types.js';
|
|
28
29
|
export { randomID, randomName, Avatar, Button, Icon, Spinner, TextInput, AccoCard, AccoDescription, AmenitiesCore, Calendar, CalendarAvailable, LeafletMap, Photo, PhotoGallery, Pricing, PricingShort, Section, Text, Weather, BookingRequest, ContactForm, CalendarRows, CalendarGrid, Notes, PageComponent, };
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
import {
|
|
6
6
|
OCCUPATION_STATE,
|
|
7
7
|
OccupationState,
|
|
8
|
+
getOccupationState,
|
|
8
9
|
type AvailableSpans,
|
|
9
10
|
} from './state.svelte.js';
|
|
10
11
|
import Spinner from '../basic/Spinner.svelte';
|
|
@@ -12,11 +13,13 @@
|
|
|
12
13
|
|
|
13
14
|
let {
|
|
14
15
|
url,
|
|
16
|
+
debug = false,
|
|
15
17
|
search = [3, 7, 14],
|
|
16
18
|
maxFutureDate = normalizeDate(DateTime.utc().plus({ years: 1 })),
|
|
17
19
|
children,
|
|
18
20
|
}: {
|
|
19
21
|
url: string;
|
|
22
|
+
debug?: boolean;
|
|
20
23
|
search?: number[];
|
|
21
24
|
maxFutureDate?: DateTime;
|
|
22
25
|
children: Snippet<[AvailableSpans]>;
|
|
@@ -27,7 +30,7 @@
|
|
|
27
30
|
|
|
28
31
|
$effect(() => {
|
|
29
32
|
if (!occupationState && browser) {
|
|
30
|
-
occupationState =
|
|
33
|
+
occupationState = getOccupationState(url, debug);
|
|
31
34
|
setContext(oStateID, occupationState);
|
|
32
35
|
}
|
|
33
36
|
});
|
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
defaultWeekdayLabels,
|
|
8
8
|
OCCUPATION_STATE,
|
|
9
9
|
OccupationState,
|
|
10
|
+
getOccupationState,
|
|
10
11
|
occupationTypeFormatting,
|
|
11
12
|
realFirstMonth,
|
|
12
13
|
type FirstMonth,
|
|
@@ -20,6 +21,7 @@
|
|
|
20
21
|
|
|
21
22
|
let {
|
|
22
23
|
url,
|
|
24
|
+
debug = false,
|
|
23
25
|
header = '',
|
|
24
26
|
footer = '',
|
|
25
27
|
nextPage = '>',
|
|
@@ -39,6 +41,7 @@
|
|
|
39
41
|
},
|
|
40
42
|
}: OccuplanTranslations & {
|
|
41
43
|
url: string;
|
|
44
|
+
debug?: boolean;
|
|
42
45
|
numberOfMonth?: number;
|
|
43
46
|
firstMonth?: FirstMonth;
|
|
44
47
|
minDate?: DateTime;
|
|
@@ -50,7 +53,7 @@
|
|
|
50
53
|
let occupationState: OccupationState = $state(getContext(oStateID));
|
|
51
54
|
$effect(() => {
|
|
52
55
|
if (!occupationState && browser) {
|
|
53
|
-
occupationState =
|
|
56
|
+
occupationState = getOccupationState(url, debug);
|
|
54
57
|
setContext(oStateID, occupationState);
|
|
55
58
|
}
|
|
56
59
|
});
|
|
@@ -2,6 +2,7 @@ import { DateTime } from 'luxon';
|
|
|
2
2
|
import { type FirstMonth, type OccuplanTranslations } from './state.svelte.js';
|
|
3
3
|
type $$ComponentProps = OccuplanTranslations & {
|
|
4
4
|
url: string;
|
|
5
|
+
debug?: boolean;
|
|
5
6
|
numberOfMonth?: number;
|
|
6
7
|
firstMonth?: FirstMonth;
|
|
7
8
|
minDate?: DateTime;
|
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
defaultWeekdayLabels,
|
|
8
8
|
OCCUPATION_STATE,
|
|
9
9
|
OccupationState,
|
|
10
|
+
getOccupationState,
|
|
10
11
|
realFirstMonth,
|
|
11
12
|
type OccuplanTranslations,
|
|
12
13
|
} from './state.svelte.js';
|
|
@@ -18,6 +19,7 @@
|
|
|
18
19
|
|
|
19
20
|
let {
|
|
20
21
|
url,
|
|
22
|
+
debug = false,
|
|
21
23
|
arrival = undefined,
|
|
22
24
|
leave = undefined,
|
|
23
25
|
nextPage = '>',
|
|
@@ -46,6 +48,7 @@
|
|
|
46
48
|
},
|
|
47
49
|
}: OccuplanTranslations & {
|
|
48
50
|
url: string;
|
|
51
|
+
debug?: boolean;
|
|
49
52
|
arrival?: DateTime;
|
|
50
53
|
leave?: DateTime;
|
|
51
54
|
showArrival?: boolean;
|
|
@@ -60,7 +63,7 @@
|
|
|
60
63
|
let occupationState: OccupationState = $state(getContext(oStateID));
|
|
61
64
|
$effect(() => {
|
|
62
65
|
if (!occupationState && browser) {
|
|
63
|
-
occupationState =
|
|
66
|
+
occupationState = getOccupationState(url, debug);
|
|
64
67
|
setContext(oStateID, occupationState);
|
|
65
68
|
}
|
|
66
69
|
});
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
defaultMonthLabels,
|
|
5
5
|
defaultWeekendLabel,
|
|
6
6
|
OccupationState,
|
|
7
|
+
getOccupationState,
|
|
7
8
|
occupationTypeFormatting,
|
|
8
9
|
type OccupationType,
|
|
9
10
|
type OccuplanTranslations,
|
|
@@ -19,6 +20,7 @@
|
|
|
19
20
|
|
|
20
21
|
let {
|
|
21
22
|
url,
|
|
23
|
+
debug = false,
|
|
22
24
|
header = '',
|
|
23
25
|
footer = '',
|
|
24
26
|
weekendLabel = defaultWeekendLabel,
|
|
@@ -35,6 +37,7 @@
|
|
|
35
37
|
},
|
|
36
38
|
}: OccuplanTranslations & {
|
|
37
39
|
url: string;
|
|
40
|
+
debug?: boolean;
|
|
38
41
|
numberOfMonth?: number;
|
|
39
42
|
firstMonth?: FirstMonth;
|
|
40
43
|
minDate?: DateTime;
|
|
@@ -46,7 +49,7 @@
|
|
|
46
49
|
let occupationState: OccupationState = $state(getContext(oStateID));
|
|
47
50
|
$effect(() => {
|
|
48
51
|
if (!occupationState && browser) {
|
|
49
|
-
occupationState =
|
|
52
|
+
occupationState = getOccupationState(url, debug);
|
|
50
53
|
setContext(oStateID, occupationState);
|
|
51
54
|
}
|
|
52
55
|
});
|
|
@@ -2,6 +2,7 @@ import { DateTime } from 'luxon';
|
|
|
2
2
|
import { type OccuplanTranslations, type FirstMonth } from './state.svelte.js';
|
|
3
3
|
type $$ComponentProps = OccuplanTranslations & {
|
|
4
4
|
url: string;
|
|
5
|
+
debug?: boolean;
|
|
5
6
|
numberOfMonth?: number;
|
|
6
7
|
firstMonth?: FirstMonth;
|
|
7
8
|
minDate?: DateTime;
|
|
@@ -19,6 +19,7 @@
|
|
|
19
19
|
url,
|
|
20
20
|
header = '',
|
|
21
21
|
footer = '',
|
|
22
|
+
debug = false,
|
|
22
23
|
weekendLabel = defaultWeekendLabel,
|
|
23
24
|
monthLabels = defaultMonthLabels,
|
|
24
25
|
weekdayLabels = defaultWeekdayLabels,
|
|
@@ -42,16 +43,6 @@
|
|
|
42
43
|
},
|
|
43
44
|
}: OccuplanTranslations & OccuplanMiscProps = $props();
|
|
44
45
|
|
|
45
|
-
/*const oStateID = `i-${url}-${OCCUPATION_STATE}`;
|
|
46
|
-
let occupationState: OccupationState = getContext(oStateID);
|
|
47
|
-
$effect(() => {
|
|
48
|
-
if (browser && !occupationState) {
|
|
49
|
-
occupationState = new OccupationState(url);
|
|
50
|
-
setContext(oStateID, occupationState);
|
|
51
|
-
}
|
|
52
|
-
});
|
|
53
|
-
*/
|
|
54
|
-
|
|
55
46
|
/*
|
|
56
47
|
use different component based on different media size.
|
|
57
48
|
*/
|
|
@@ -76,6 +67,7 @@
|
|
|
76
67
|
<div class="calendar-wrapper" bind:clientWidth={w}>
|
|
77
68
|
{#if showRows}
|
|
78
69
|
<OccuPlanRows
|
|
70
|
+
{debug}
|
|
79
71
|
{url}
|
|
80
72
|
{header}
|
|
81
73
|
{footer}
|
|
@@ -90,6 +82,7 @@
|
|
|
90
82
|
/>
|
|
91
83
|
{:else if showGrid}
|
|
92
84
|
<OccuPlanGrid
|
|
85
|
+
{debug}
|
|
93
86
|
{url}
|
|
94
87
|
{header}
|
|
95
88
|
{footer}
|
|
@@ -51,6 +51,7 @@ export type PrevMonthNumbers = '-1' | '-2' | '-3' | '-4' | '-5' | '-6' | '-7' |
|
|
|
51
51
|
export type FirstMonth = MonthNumbers | NextMonthNumbers | PrevMonthNumbers | 0;
|
|
52
52
|
export interface OccuplanMiscProps {
|
|
53
53
|
url: string;
|
|
54
|
+
debug?: boolean;
|
|
54
55
|
gridNumberOfMonths?: number;
|
|
55
56
|
gridFirstMonth?: FirstMonth;
|
|
56
57
|
gridMaxWidth?: string;
|
|
@@ -71,7 +72,8 @@ export declare class OccupationState {
|
|
|
71
72
|
occupiedDays: Record<string, boolean>;
|
|
72
73
|
occupations: Occupation[];
|
|
73
74
|
loading: boolean;
|
|
74
|
-
|
|
75
|
+
debug: boolean;
|
|
76
|
+
constructor(iCalURL: string, debug?: boolean);
|
|
75
77
|
private loadOccupations;
|
|
76
78
|
private eventsIncomingCallback;
|
|
77
79
|
private dayKey;
|
|
@@ -87,4 +89,4 @@ export declare class OccupationState {
|
|
|
87
89
|
validRequest: (from: DateTime, to: DateTime) => boolean;
|
|
88
90
|
occupationStyle: (d: DayHelper, highlightWeekend: boolean | undefined, maxDate: DateTime) => string;
|
|
89
91
|
}
|
|
90
|
-
export declare const getOccupationState: (url: string) => OccupationState;
|
|
92
|
+
export declare const getOccupationState: (url: string, debug?: boolean) => OccupationState;
|
|
@@ -179,11 +179,17 @@ export class OccupationState {
|
|
|
179
179
|
occupiedDays = $state({});
|
|
180
180
|
occupations = $state([]);
|
|
181
181
|
loading = $state(false);
|
|
182
|
-
|
|
182
|
+
debug = $state(false);
|
|
183
|
+
constructor(iCalURL, debug = false) {
|
|
184
|
+
this.debug = debug;
|
|
185
|
+
if (this.debug)
|
|
186
|
+
console.log('Constructing OState with CalUrl: ', iCalURL);
|
|
183
187
|
this.iCalURL = iCalURL;
|
|
184
188
|
this.loadOccupations();
|
|
185
189
|
}
|
|
186
190
|
loadOccupations = async () => {
|
|
191
|
+
if (this.debug)
|
|
192
|
+
console.log('(Re)Loading Occupations');
|
|
187
193
|
this.loading = true;
|
|
188
194
|
if (this.iCalURL) {
|
|
189
195
|
const eventsResult = await getEvents(this.iCalURL, this.eventsIncomingCallback);
|
|
@@ -193,6 +199,8 @@ export class OccupationState {
|
|
|
193
199
|
return false;
|
|
194
200
|
};
|
|
195
201
|
eventsIncomingCallback = (o) => {
|
|
202
|
+
if (this.debug)
|
|
203
|
+
console.log('Occupation incoming: ', o);
|
|
196
204
|
this.occupations.push(o);
|
|
197
205
|
this.updateOccupiedDays(o);
|
|
198
206
|
};
|
|
@@ -373,11 +381,13 @@ export class OccupationState {
|
|
|
373
381
|
};
|
|
374
382
|
}
|
|
375
383
|
let _instances = {};
|
|
376
|
-
export const getOccupationState = (url) => {
|
|
384
|
+
export const getOccupationState = (url, debug = false) => {
|
|
385
|
+
if (debug)
|
|
386
|
+
console.log('Get OState /w url', url);
|
|
377
387
|
const currentInstance = _instances[url];
|
|
378
388
|
if (currentInstance)
|
|
379
389
|
return currentInstance;
|
|
380
|
-
const newInstance = new OccupationState(url);
|
|
390
|
+
const newInstance = new OccupationState(url, debug);
|
|
381
391
|
_instances[url] = newInstance;
|
|
382
392
|
return _instances[url];
|
|
383
393
|
};
|
package/dist/types.d.ts
CHANGED
|
@@ -1,22 +1,13 @@
|
|
|
1
1
|
import { type Dinero, type DineroSnapshot } from 'dinero.js';
|
|
2
|
-
import type { FirstMonth } from './occuplan/state.svelte.js';
|
|
2
|
+
import type { FirstMonth, OccuplanTranslations } from './occuplan/state.svelte.js';
|
|
3
3
|
import type { DateTime, MonthNumbers, WeekdayNumbers } from 'luxon';
|
|
4
|
+
import type { CookieType, Translation as CookieTranslation } from 'gdpr-cooco-banner';
|
|
4
5
|
export type WeekdayLabels = {
|
|
5
6
|
[key in WeekdayNumbers]: string;
|
|
6
7
|
};
|
|
7
8
|
export type MonthLabels = {
|
|
8
9
|
[key in MonthNumbers]: string;
|
|
9
10
|
};
|
|
10
|
-
export interface OccuplanTranslation {
|
|
11
|
-
weekendLabel?: string;
|
|
12
|
-
weekdayLabels?: WeekdayLabels;
|
|
13
|
-
monthLabels?: MonthLabels;
|
|
14
|
-
monthHeaderFormat?: string;
|
|
15
|
-
typeNames?: {
|
|
16
|
-
defaultOccupationTypeName: string;
|
|
17
|
-
[key: string]: string;
|
|
18
|
-
};
|
|
19
|
-
}
|
|
20
11
|
export interface GridPhoto {
|
|
21
12
|
photo: Photo;
|
|
22
13
|
zoomed: boolean;
|
|
@@ -288,6 +279,52 @@ export interface BookingRequestContent {
|
|
|
288
279
|
explainer?: string;
|
|
289
280
|
}
|
|
290
281
|
export type Block = Text | Photo | PhotoGallery | Calendar | CalendarAvailable | CalendarGrid | CalendarRows | Pricing | PricingShort | AmenitiesCore | Weather | LeafletMap | AccoCard | AccoDescription | ContactForm | BookingRequest | undefined;
|
|
282
|
+
export interface FontSpec {
|
|
283
|
+
shortName: string;
|
|
284
|
+
cssName: string;
|
|
285
|
+
variant: string;
|
|
286
|
+
fallback: string;
|
|
287
|
+
fontsource: boolean;
|
|
288
|
+
}
|
|
289
|
+
export interface SiteTranslation {
|
|
290
|
+
calendar: OccuplanTranslations;
|
|
291
|
+
cookies: CookieTranslation;
|
|
292
|
+
site: Record<string, string>;
|
|
293
|
+
}
|
|
294
|
+
export declare const FORMAT_TEMPLATE_NAMES: string[];
|
|
295
|
+
export type FormatTemplateName = (typeof FORMAT_TEMPLATE_NAMES)[number];
|
|
296
|
+
export interface FormatSpec {
|
|
297
|
+
locale: string;
|
|
298
|
+
[tmpl: TemplateName]: string;
|
|
299
|
+
}
|
|
300
|
+
export interface SiteConfig {
|
|
301
|
+
settings: {
|
|
302
|
+
ACCOMADE_USER_ID: string;
|
|
303
|
+
PUBLIC_SUPABASE_URL: string;
|
|
304
|
+
};
|
|
305
|
+
cookies: {
|
|
306
|
+
types: CookieType[];
|
|
307
|
+
showIcon: boolean;
|
|
308
|
+
};
|
|
309
|
+
fonts: {
|
|
310
|
+
main: FontSpec;
|
|
311
|
+
nav: FontSpec;
|
|
312
|
+
pageTitle: FontSpec;
|
|
313
|
+
landingTitle: FontSpec;
|
|
314
|
+
header: FontSpec;
|
|
315
|
+
};
|
|
316
|
+
nav: Nav;
|
|
317
|
+
pages: {
|
|
318
|
+
'/': PageProps;
|
|
319
|
+
[key: string]: PageProps;
|
|
320
|
+
};
|
|
321
|
+
lang: {
|
|
322
|
+
defaultLang: string;
|
|
323
|
+
supportedLangs: string[];
|
|
324
|
+
translations: Record<string, SiteTranslation>;
|
|
325
|
+
formats: Record<string, FormatSpec>;
|
|
326
|
+
};
|
|
327
|
+
}
|
|
291
328
|
export interface PageProps {
|
|
292
329
|
id: string;
|
|
293
330
|
path: string;
|
|
@@ -330,7 +367,7 @@ export interface Section {
|
|
|
330
367
|
export interface I18nFacade {
|
|
331
368
|
currentLang?: string;
|
|
332
369
|
supportedLangs?: string[];
|
|
333
|
-
calendarTranslation?:
|
|
370
|
+
calendarTranslation?: OccuplanTranslations;
|
|
334
371
|
translateFunc?: (ref: string) => string;
|
|
335
372
|
formatFunc?: (formatter: string, props: Record<string, any>) => string;
|
|
336
373
|
formatMoneyFunc?: (d: Dinero<number> | DineroSnapshot<number>) => string;
|
package/dist/types.js
CHANGED
|
@@ -13,6 +13,20 @@ export const PRICING_COLUMNS = [
|
|
|
13
13
|
'extraPerson',
|
|
14
14
|
'minNumNights',
|
|
15
15
|
];
|
|
16
|
+
export const FORMAT_TEMPLATE_NAMES = [
|
|
17
|
+
'dateFormat',
|
|
18
|
+
'monthHeader',
|
|
19
|
+
'nothingAvailable',
|
|
20
|
+
'availableFromFor',
|
|
21
|
+
'minimumPrice',
|
|
22
|
+
'maximumPrice',
|
|
23
|
+
'additionalPersonPrice',
|
|
24
|
+
'minNumberOfNights',
|
|
25
|
+
'seating',
|
|
26
|
+
'numberOf',
|
|
27
|
+
'size',
|
|
28
|
+
'bed',
|
|
29
|
+
];
|
|
16
30
|
export const isAccoCard = (b) => {
|
|
17
31
|
if (!b)
|
|
18
32
|
return false;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "accomadesc",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.18",
|
|
4
4
|
"scripts": {
|
|
5
5
|
"dev": "vite dev",
|
|
6
6
|
"build": "vite build && npm run package",
|
|
@@ -42,6 +42,7 @@
|
|
|
42
42
|
"@sveltejs/package": "^2.3.7",
|
|
43
43
|
"@sveltejs/vite-plugin-svelte": "^5.0.3",
|
|
44
44
|
"@types/luxon": "^3.4.2",
|
|
45
|
+
"gdpr-cooco-banner": "^0.0.11",
|
|
45
46
|
"prettier": "^3.4.2",
|
|
46
47
|
"prettier-plugin-svelte": "^3.3.3",
|
|
47
48
|
"publint": "^0.3.2",
|