@deallony/shared 1.2.80 → 1.2.81
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/cjs/constants/events/EventBirthday.d.ts +2 -0
- package/dist/cjs/constants/events/EventBirthday.js +12 -0
- package/dist/cjs/constants/events/EventCustomization.d.ts +21 -0
- package/dist/cjs/constants/events/EventCustomization.js +23 -2
- package/dist/cjs/constants/events/EventDressCode.d.ts +65 -0
- package/dist/cjs/constants/events/EventDressCode.js +56 -0
- package/dist/cjs/constants/events/EventOccasion.d.ts +63 -0
- package/dist/cjs/constants/events/EventOccasion.js +242 -0
- package/dist/cjs/constants/events/EventPreview.d.ts +3 -0
- package/dist/cjs/constants/events/EventPreview.js +9 -1
- package/dist/cjs/constants/events/EventTemplate.d.ts +518 -10
- package/dist/cjs/constants/events/EventTemplate.js +81 -11
- package/dist/cjs/constants/events/EventTextPolicy.d.ts +7 -0
- package/dist/cjs/constants/events/EventTextPolicy.js +66 -0
- package/dist/cjs/constants/events/EventType.d.ts +273 -8
- package/dist/cjs/constants/events/EventType.js +38 -2
- package/dist/cjs/constants/events/EventVisibility.d.ts +19 -0
- package/dist/cjs/constants/events/EventVisibility.js +18 -0
- package/dist/cjs/constants/events/EventWedding.js +3 -0
- package/dist/cjs/constants/events/EventWeddingReligion.d.ts +72 -0
- package/dist/cjs/constants/events/EventWeddingReligion.js +126 -0
- package/dist/cjs/constants/events/index.d.ts +6 -0
- package/dist/cjs/constants/events/index.js +6 -0
- package/dist/cjs/constants/routes/app.d.ts +42 -0
- package/dist/cjs/constants/routes/app.js +14 -0
- package/dist/cjs/dto/events/EventBirthday.dto.d.ts +3 -0
- package/dist/cjs/dto/events/EventBirthday.dto.js +2 -0
- package/dist/cjs/dto/events/EventOccasion.dto.d.ts +3 -0
- package/dist/cjs/dto/events/EventOccasion.dto.js +2 -0
- package/dist/cjs/dto/events/index.d.ts +2 -0
- package/dist/cjs/dto/events/index.js +2 -0
- package/dist/cjs/schema/communication/ai-conversation.schema.d.ts +53 -1
- package/dist/cjs/schema/communication/ai-conversation.schema.js +28 -3
- package/dist/cjs/schema/communication/support-ticket.schema.d.ts +136 -0
- package/dist/cjs/schema/communication/support-ticket.schema.js +47 -2
- package/dist/cjs/schema/events/Event.schema.d.ts +294 -0
- package/dist/cjs/schema/events/Event.schema.js +48 -1
- package/dist/cjs/schema/events/EventBirthday.schema.d.ts +19 -0
- package/dist/cjs/schema/events/EventBirthday.schema.js +17 -0
- package/dist/cjs/schema/events/EventOccasion.schema.d.ts +22 -0
- package/dist/cjs/schema/events/EventOccasion.schema.js +31 -0
- package/dist/cjs/schema/events/EventRsvp.schema.d.ts +4 -0
- package/dist/cjs/schema/events/EventRsvp.schema.js +1 -0
- package/dist/cjs/schema/events/EventTimeline.schema.d.ts +5 -0
- package/dist/cjs/schema/events/EventTimeline.schema.js +14 -1
- package/dist/cjs/schema/events/EventWedding.schema.d.ts +32 -0
- package/dist/cjs/schema/events/EventWedding.schema.js +11 -0
- package/dist/cjs/schema/events/index.d.ts +2 -0
- package/dist/cjs/schema/events/index.js +2 -0
- package/dist/cjs/types/communication/Notification.d.ts +13 -2
- package/dist/cjs/types/communication/Notification.js +8 -0
- package/dist/cjs/types/events/Event.d.ts +14 -1
- package/dist/cjs/types/events/EventBirthday.d.ts +17 -0
- package/dist/cjs/types/events/EventBirthday.js +2 -0
- package/dist/cjs/types/events/EventCustomization.d.ts +4 -0
- package/dist/cjs/types/events/EventDressCode.d.ts +13 -0
- package/dist/cjs/types/events/EventDressCode.js +2 -0
- package/dist/cjs/types/events/EventOccasion.d.ts +24 -0
- package/dist/cjs/types/events/EventOccasion.js +2 -0
- package/dist/cjs/types/events/EventRsvp.d.ts +2 -0
- package/dist/cjs/types/events/EventTimeline.d.ts +2 -0
- package/dist/cjs/types/events/EventWedding.d.ts +7 -0
- package/dist/cjs/types/events/index.d.ts +3 -0
- package/dist/cjs/types/events/index.js +3 -0
- package/dist/cjs/types/index.d.ts +3 -0
- package/dist/cjs/types/index.js +5 -2
- package/dist/cjs/types/user/SavedSearch.d.ts +38 -0
- package/dist/cjs/types/user/SavedSearch.js +11 -0
- package/dist/esm/constants/events/EventBirthday.js +9 -0
- package/dist/esm/constants/events/EventCustomization.js +21 -1
- package/dist/esm/constants/events/EventDressCode.js +49 -0
- package/dist/esm/constants/events/EventOccasion.js +235 -0
- package/dist/esm/constants/events/EventPreview.js +7 -0
- package/dist/esm/constants/events/EventTemplate.js +78 -10
- package/dist/esm/constants/events/EventTextPolicy.js +61 -0
- package/dist/esm/constants/events/EventType.js +34 -1
- package/dist/esm/constants/events/EventVisibility.js +15 -0
- package/dist/esm/constants/events/EventWedding.js +3 -0
- package/dist/esm/constants/events/EventWeddingReligion.js +118 -0
- package/dist/esm/constants/events/index.js +6 -0
- package/dist/esm/constants/routes/app.js +14 -0
- package/dist/esm/dto/events/EventBirthday.dto.js +1 -0
- package/dist/esm/dto/events/EventOccasion.dto.js +1 -0
- package/dist/esm/dto/events/index.js +2 -0
- package/dist/esm/schema/communication/ai-conversation.schema.js +27 -2
- package/dist/esm/schema/communication/support-ticket.schema.js +46 -1
- package/dist/esm/schema/events/Event.schema.js +48 -1
- package/dist/esm/schema/events/EventBirthday.schema.js +14 -0
- package/dist/esm/schema/events/EventOccasion.schema.js +28 -0
- package/dist/esm/schema/events/EventRsvp.schema.js +1 -0
- package/dist/esm/schema/events/EventTimeline.schema.js +14 -1
- package/dist/esm/schema/events/EventWedding.schema.js +11 -0
- package/dist/esm/schema/events/index.js +2 -0
- package/dist/esm/types/communication/Notification.js +8 -0
- package/dist/esm/types/events/EventBirthday.js +1 -0
- package/dist/esm/types/events/EventDressCode.js +1 -0
- package/dist/esm/types/events/EventOccasion.js +1 -0
- package/dist/esm/types/events/index.js +3 -0
- package/dist/esm/types/index.js +3 -0
- package/dist/esm/types/user/SavedSearch.js +8 -0
- package/package.json +1 -1
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.emptyEventBirthday = void 0;
|
|
4
|
+
exports.emptyEventBirthday = {
|
|
5
|
+
id: 0,
|
|
6
|
+
event_id: 0,
|
|
7
|
+
cover: null,
|
|
8
|
+
celebrant_name: null,
|
|
9
|
+
age: null,
|
|
10
|
+
host_name: null,
|
|
11
|
+
phone: null,
|
|
12
|
+
};
|
|
@@ -40,6 +40,8 @@ export type EventCustomizationTrack = {
|
|
|
40
40
|
};
|
|
41
41
|
/** Path on the event site */
|
|
42
42
|
src: string;
|
|
43
|
+
/** Event types the track is offered for */
|
|
44
|
+
event_types: string[];
|
|
43
45
|
};
|
|
44
46
|
/** Music the owner can pick; add a track here once its file is on the event site under /music */
|
|
45
47
|
export declare const EventCustomizationTracks: EventCustomizationTrack[];
|
|
@@ -50,6 +52,7 @@ export declare const EventCustomizationSection: {
|
|
|
50
52
|
readonly GALLERY: "gallery";
|
|
51
53
|
readonly RSVP: "rsvp";
|
|
52
54
|
readonly MUSIC: "music";
|
|
55
|
+
readonly DRESS_CODE: "dress_code";
|
|
53
56
|
};
|
|
54
57
|
export type EventCustomizationSectionKey = (typeof EventCustomizationSection)[keyof typeof EventCustomizationSection];
|
|
55
58
|
export declare const EventCustomizationSectionOptions: {
|
|
@@ -60,10 +63,28 @@ export declare const EventCustomizationSectionOptions: {
|
|
|
60
63
|
};
|
|
61
64
|
}[];
|
|
62
65
|
export declare const EVENT_CUSTOMIZATION_TEXT_MAX = 160;
|
|
66
|
+
/** How the invitation opens for a guest; no value keeps the template's own opening */
|
|
67
|
+
export declare const EventCustomizationOpening: {
|
|
68
|
+
readonly NONE: "none";
|
|
69
|
+
readonly ENVELOPE: "envelope";
|
|
70
|
+
readonly CURTAIN: "curtain";
|
|
71
|
+
readonly CARD: "card";
|
|
72
|
+
};
|
|
73
|
+
export type EventCustomizationOpeningValue = (typeof EventCustomizationOpening)[keyof typeof EventCustomizationOpening];
|
|
74
|
+
export declare const EventCustomizationOpeningOptions: {
|
|
75
|
+
value: EventCustomizationOpeningValue;
|
|
76
|
+
name: {
|
|
77
|
+
en: string;
|
|
78
|
+
ar: string;
|
|
79
|
+
};
|
|
80
|
+
}[];
|
|
63
81
|
export declare const EventCustomizationPaletteValues: [string, ...string[]];
|
|
64
82
|
export declare const EventCustomizationFontValues: [string, ...string[]];
|
|
65
83
|
export declare const EventCustomizationTrackValues: [string, ...string[]];
|
|
66
84
|
export declare const EventCustomizationSectionValues: [EventCustomizationSectionKey, ...EventCustomizationSectionKey[]];
|
|
85
|
+
export declare const EventCustomizationOpeningValues: [EventCustomizationOpeningValue, ...EventCustomizationOpeningValue[]];
|
|
67
86
|
export declare const findEventCustomizationPalette: (value: string | null | undefined) => EventCustomizationPalette | null;
|
|
68
87
|
export declare const findEventCustomizationFont: (value: string | null | undefined) => EventCustomizationFont | null;
|
|
88
|
+
/** Tracks offered for an event type; events without a type are weddings */
|
|
89
|
+
export declare const eventCustomizationTracksFor: (eventType: string | null | undefined) => EventCustomizationTrack[];
|
|
69
90
|
export declare const findEventCustomizationTrack: (value: string | null | undefined) => EventCustomizationTrack | null;
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Every field is optional: an empty value keeps the chosen template's own look.
|
|
5
5
|
*/
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
exports.findEventCustomizationTrack = exports.findEventCustomizationFont = exports.findEventCustomizationPalette = exports.EventCustomizationSectionValues = exports.EventCustomizationTrackValues = exports.EventCustomizationFontValues = exports.EventCustomizationPaletteValues = exports.EVENT_CUSTOMIZATION_TEXT_MAX = exports.EventCustomizationSectionOptions = exports.EventCustomizationSection = exports.EventCustomizationTracks = exports.EventCustomizationFonts = exports.EventCustomizationPalettes = void 0;
|
|
7
|
+
exports.findEventCustomizationTrack = exports.eventCustomizationTracksFor = exports.findEventCustomizationFont = exports.findEventCustomizationPalette = exports.EventCustomizationOpeningValues = exports.EventCustomizationSectionValues = exports.EventCustomizationTrackValues = exports.EventCustomizationFontValues = exports.EventCustomizationPaletteValues = exports.EventCustomizationOpeningOptions = exports.EventCustomizationOpening = exports.EVENT_CUSTOMIZATION_TEXT_MAX = exports.EventCustomizationSectionOptions = exports.EventCustomizationSection = exports.EventCustomizationTracks = exports.EventCustomizationFonts = exports.EventCustomizationPalettes = void 0;
|
|
8
8
|
exports.EventCustomizationPalettes = [
|
|
9
9
|
{ value: "night", name: { en: "Night", ar: "ليلي" }, background: "#0f0c18", surface: "#1b1628", text: "#efe8f6", accent: "#d6b36a", is_dark: true },
|
|
10
10
|
{ value: "ivory", name: { en: "Ivory", ar: "عاجي" }, background: "#fbf6ee", surface: "#ffffff", text: "#2a2118", accent: "#9c6b3c", is_dark: false },
|
|
@@ -20,7 +20,9 @@ exports.EventCustomizationFonts = [
|
|
|
20
20
|
];
|
|
21
21
|
/** Music the owner can pick; add a track here once its file is on the event site under /music */
|
|
22
22
|
exports.EventCustomizationTracks = [
|
|
23
|
-
{ value: "wedding-theme", name: { en: "Wedding theme", ar: "لحن الزفاف" }, src: "/music/wedding-theme.mp3" },
|
|
23
|
+
{ value: "wedding-theme", name: { en: "Wedding theme", ar: "لحن الزفاف" }, src: "/music/wedding-theme.mp3", event_types: ["wedding", "engagement", "marriage", "proposal", "valentine"] },
|
|
24
|
+
{ value: "birthday-theme", name: { en: "Happy birthday", ar: "لحن عيد الميلاد" }, src: "/music/birthday-theme.mp3", event_types: ["birthday"] },
|
|
25
|
+
{ value: "celebration-theme", name: { en: "Celebration", ar: "لحن الاحتفال" }, src: "/music/celebration-theme.mp3", event_types: ["bachelor", "newborn", "gender_reveal", "circumcision", "graduation", "hajj", "mothers_day", "valentine", "opening", "general", "proposal", "engagement", "marriage"] },
|
|
24
26
|
];
|
|
25
27
|
exports.EventCustomizationSection = {
|
|
26
28
|
COUNTDOWN: "countdown",
|
|
@@ -29,6 +31,7 @@ exports.EventCustomizationSection = {
|
|
|
29
31
|
GALLERY: "gallery",
|
|
30
32
|
RSVP: "rsvp",
|
|
31
33
|
MUSIC: "music",
|
|
34
|
+
DRESS_CODE: "dress_code",
|
|
32
35
|
};
|
|
33
36
|
exports.EventCustomizationSectionOptions = [
|
|
34
37
|
{ value: "countdown", name: { en: "Countdown", ar: "العد التنازلي" } },
|
|
@@ -37,15 +40,33 @@ exports.EventCustomizationSectionOptions = [
|
|
|
37
40
|
{ value: "gallery", name: { en: "Photos", ar: "الصور" } },
|
|
38
41
|
{ value: "rsvp", name: { en: "RSVP", ar: "تأكيد الحضور" } },
|
|
39
42
|
{ value: "music", name: { en: "Music", ar: "الموسيقى" } },
|
|
43
|
+
{ value: "dress_code", name: { en: "Dress code", ar: "اللباس المطلوب" } },
|
|
40
44
|
];
|
|
41
45
|
exports.EVENT_CUSTOMIZATION_TEXT_MAX = 160;
|
|
46
|
+
/** How the invitation opens for a guest; no value keeps the template's own opening */
|
|
47
|
+
exports.EventCustomizationOpening = {
|
|
48
|
+
NONE: "none",
|
|
49
|
+
ENVELOPE: "envelope",
|
|
50
|
+
CURTAIN: "curtain",
|
|
51
|
+
CARD: "card",
|
|
52
|
+
};
|
|
53
|
+
exports.EventCustomizationOpeningOptions = [
|
|
54
|
+
{ value: "none", name: { en: "None", ar: "بدون" } },
|
|
55
|
+
{ value: "envelope", name: { en: "Envelope", ar: "ظرف" } },
|
|
56
|
+
{ value: "curtain", name: { en: "Curtain", ar: "ستارة" } },
|
|
57
|
+
{ value: "card", name: { en: "Card", ar: "بطاقة" } },
|
|
58
|
+
];
|
|
42
59
|
exports.EventCustomizationPaletteValues = exports.EventCustomizationPalettes.map((p) => p.value);
|
|
43
60
|
exports.EventCustomizationFontValues = exports.EventCustomizationFonts.map((f) => f.value);
|
|
44
61
|
exports.EventCustomizationTrackValues = exports.EventCustomizationTracks.map((t) => t.value);
|
|
45
62
|
exports.EventCustomizationSectionValues = exports.EventCustomizationSectionOptions.map((s) => s.value);
|
|
63
|
+
exports.EventCustomizationOpeningValues = exports.EventCustomizationOpeningOptions.map((o) => o.value);
|
|
46
64
|
const findEventCustomizationPalette = (value) => { var _a; return (_a = exports.EventCustomizationPalettes.find((p) => p.value === value)) !== null && _a !== void 0 ? _a : null; };
|
|
47
65
|
exports.findEventCustomizationPalette = findEventCustomizationPalette;
|
|
48
66
|
const findEventCustomizationFont = (value) => { var _a; return (_a = exports.EventCustomizationFonts.find((f) => f.value === value)) !== null && _a !== void 0 ? _a : null; };
|
|
49
67
|
exports.findEventCustomizationFont = findEventCustomizationFont;
|
|
68
|
+
/** Tracks offered for an event type; events without a type are weddings */
|
|
69
|
+
const eventCustomizationTracksFor = (eventType) => exports.EventCustomizationTracks.filter((t) => t.event_types.includes(eventType || "wedding"));
|
|
70
|
+
exports.eventCustomizationTracksFor = eventCustomizationTracksFor;
|
|
50
71
|
const findEventCustomizationTrack = (value) => { var _a; return (_a = exports.EventCustomizationTracks.find((t) => t.value === value)) !== null && _a !== void 0 ? _a : null; };
|
|
51
72
|
exports.findEventCustomizationTrack = findEventCustomizationTrack;
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/** Optional dress code an event owner can show on the invitation (all event types) */
|
|
2
|
+
export declare const EventDressCodeStyleValues: readonly ["formal", "evening", "semi_formal", "smart_casual", "traditional", "custom"];
|
|
3
|
+
export type EventDressCodeStyle = (typeof EventDressCodeStyleValues)[number];
|
|
4
|
+
export declare const EventDressCodeStyleOptions: {
|
|
5
|
+
value: EventDressCodeStyle;
|
|
6
|
+
name: {
|
|
7
|
+
en: string;
|
|
8
|
+
ar: string;
|
|
9
|
+
};
|
|
10
|
+
}[];
|
|
11
|
+
/** wear = colours guests are asked to wear, avoid = colours guests should not wear */
|
|
12
|
+
export declare const EventDressCodeColorModeValues: readonly ["wear", "avoid"];
|
|
13
|
+
export type EventDressCodeColorMode = (typeof EventDressCodeColorModeValues)[number];
|
|
14
|
+
export declare const EventDressCodeColorModeNames: Record<EventDressCodeColorMode, {
|
|
15
|
+
en: string;
|
|
16
|
+
ar: string;
|
|
17
|
+
}>;
|
|
18
|
+
/** Heading shown on the invitation above the colour dots */
|
|
19
|
+
export declare const EventDressCodeColorModeTitles: Record<EventDressCodeColorMode, {
|
|
20
|
+
en: string;
|
|
21
|
+
ar: string;
|
|
22
|
+
}>;
|
|
23
|
+
export declare const EventDressCodeColors: {
|
|
24
|
+
value: string;
|
|
25
|
+
hex: string;
|
|
26
|
+
name: {
|
|
27
|
+
en: string;
|
|
28
|
+
ar: string;
|
|
29
|
+
};
|
|
30
|
+
}[];
|
|
31
|
+
export declare const EventDressCodeColorValues: [string, ...string[]];
|
|
32
|
+
/** @deprecated colours are no longer limited; kept for older imports */
|
|
33
|
+
export declare const EVENT_DRESS_CODE_MAX_COLORS = 9;
|
|
34
|
+
export declare const EVENT_DRESS_CODE_NOTE_MAX = 120;
|
|
35
|
+
export declare const findEventDressCodeStyle: (value: string | null | undefined) => {
|
|
36
|
+
value: EventDressCodeStyle;
|
|
37
|
+
name: {
|
|
38
|
+
en: string;
|
|
39
|
+
ar: string;
|
|
40
|
+
};
|
|
41
|
+
} | null;
|
|
42
|
+
export declare const findEventDressCodeColor: (value: string | null | undefined) => {
|
|
43
|
+
value: string;
|
|
44
|
+
hex: string;
|
|
45
|
+
name: {
|
|
46
|
+
en: string;
|
|
47
|
+
ar: string;
|
|
48
|
+
};
|
|
49
|
+
} | null;
|
|
50
|
+
/** True when the owner filled at least one part of the dress code */
|
|
51
|
+
export declare const hasEventDressCode: (dc: {
|
|
52
|
+
style?: string | null;
|
|
53
|
+
colors?: string[] | null;
|
|
54
|
+
avoid_colors?: string[] | null;
|
|
55
|
+
note?: string | null;
|
|
56
|
+
} | null | undefined) => boolean;
|
|
57
|
+
/** Wanted and avoided colours, reading old saves where color_mode "avoid" marked `colors` */
|
|
58
|
+
export declare const eventDressCodeColorLists: (dc: {
|
|
59
|
+
colors?: string[] | null;
|
|
60
|
+
avoid_colors?: string[] | null;
|
|
61
|
+
color_mode?: string | null;
|
|
62
|
+
} | null | undefined) => {
|
|
63
|
+
wear: string[];
|
|
64
|
+
avoid: string[];
|
|
65
|
+
};
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.eventDressCodeColorLists = exports.hasEventDressCode = exports.findEventDressCodeColor = exports.findEventDressCodeStyle = exports.EVENT_DRESS_CODE_NOTE_MAX = exports.EVENT_DRESS_CODE_MAX_COLORS = exports.EventDressCodeColorValues = exports.EventDressCodeColors = exports.EventDressCodeColorModeTitles = exports.EventDressCodeColorModeNames = exports.EventDressCodeColorModeValues = exports.EventDressCodeStyleOptions = exports.EventDressCodeStyleValues = void 0;
|
|
4
|
+
/** Optional dress code an event owner can show on the invitation (all event types) */
|
|
5
|
+
exports.EventDressCodeStyleValues = ["formal", "evening", "semi_formal", "smart_casual", "traditional", "custom"];
|
|
6
|
+
exports.EventDressCodeStyleOptions = [
|
|
7
|
+
{ value: "formal", name: { en: "Formal", ar: "رسمي" } },
|
|
8
|
+
{ value: "evening", name: { en: "Evening wear", ar: "سهرة" } },
|
|
9
|
+
{ value: "semi_formal", name: { en: "Semi-formal", ar: "شبه رسمي" } },
|
|
10
|
+
{ value: "smart_casual", name: { en: "Smart casual", ar: "كاجوال أنيق" } },
|
|
11
|
+
{ value: "traditional", name: { en: "Traditional", ar: "تقليدي" } },
|
|
12
|
+
{ value: "custom", name: { en: "Custom text", ar: "نص خاص" } },
|
|
13
|
+
];
|
|
14
|
+
/** wear = colours guests are asked to wear, avoid = colours guests should not wear */
|
|
15
|
+
exports.EventDressCodeColorModeValues = ["wear", "avoid"];
|
|
16
|
+
exports.EventDressCodeColorModeNames = {
|
|
17
|
+
wear: { en: "Colours to wear", ar: "ألوان مرغوبة" },
|
|
18
|
+
avoid: { en: "Colours to avoid", ar: "ألوان يجب تجنبها" },
|
|
19
|
+
};
|
|
20
|
+
/** Heading shown on the invitation above the colour dots */
|
|
21
|
+
exports.EventDressCodeColorModeTitles = {
|
|
22
|
+
wear: { en: "Suggested colours", ar: "ألوان مقترحة" },
|
|
23
|
+
avoid: { en: "Please avoid", ar: "نرجو تجنّب" },
|
|
24
|
+
};
|
|
25
|
+
exports.EventDressCodeColors = [
|
|
26
|
+
{ value: "white", hex: "#FFFFFF", name: { en: "White", ar: "أبيض" } },
|
|
27
|
+
{ value: "black", hex: "#000000", name: { en: "Black", ar: "أسود" } },
|
|
28
|
+
{ value: "gold", hex: "#D4AF37", name: { en: "Gold", ar: "ذهبي" } },
|
|
29
|
+
{ value: "beige", hex: "#C9C0B3", name: { en: "Beige", ar: "بيج" } },
|
|
30
|
+
{ value: "navy", hex: "#1F3A5F", name: { en: "Navy", ar: "كحلي" } },
|
|
31
|
+
{ value: "burgundy", hex: "#7A1F2B", name: { en: "Burgundy", ar: "عنابي" } },
|
|
32
|
+
{ value: "sage", hex: "#B7C9A8", name: { en: "Light green", ar: "أخضر فاتح" } },
|
|
33
|
+
{ value: "pink", hex: "#E8B4BC", name: { en: "Pink", ar: "وردي" } },
|
|
34
|
+
{ value: "grey", hex: "#9AA5B1", name: { en: "Grey", ar: "رمادي" } },
|
|
35
|
+
];
|
|
36
|
+
exports.EventDressCodeColorValues = exports.EventDressCodeColors.map((c) => c.value);
|
|
37
|
+
/** @deprecated colours are no longer limited; kept for older imports */
|
|
38
|
+
exports.EVENT_DRESS_CODE_MAX_COLORS = 9;
|
|
39
|
+
exports.EVENT_DRESS_CODE_NOTE_MAX = 120;
|
|
40
|
+
const findEventDressCodeStyle = (value) => { var _a; return (_a = exports.EventDressCodeStyleOptions.find((s) => s.value === value)) !== null && _a !== void 0 ? _a : null; };
|
|
41
|
+
exports.findEventDressCodeStyle = findEventDressCodeStyle;
|
|
42
|
+
const findEventDressCodeColor = (value) => { var _a; return (_a = exports.EventDressCodeColors.find((c) => c.value === value)) !== null && _a !== void 0 ? _a : null; };
|
|
43
|
+
exports.findEventDressCodeColor = findEventDressCodeColor;
|
|
44
|
+
/** True when the owner filled at least one part of the dress code */
|
|
45
|
+
const hasEventDressCode = (dc) => { var _a, _b, _c; return !!dc && (!!dc.style || !!((_a = dc.colors) === null || _a === void 0 ? void 0 : _a.length) || !!((_b = dc.avoid_colors) === null || _b === void 0 ? void 0 : _b.length) || !!((_c = dc.note) === null || _c === void 0 ? void 0 : _c.trim())); };
|
|
46
|
+
exports.hasEventDressCode = hasEventDressCode;
|
|
47
|
+
/** Wanted and avoided colours, reading old saves where color_mode "avoid" marked `colors` */
|
|
48
|
+
const eventDressCodeColorLists = (dc) => {
|
|
49
|
+
var _a, _b, _c;
|
|
50
|
+
const legacyAvoid = (dc === null || dc === void 0 ? void 0 : dc.color_mode) === "avoid";
|
|
51
|
+
return {
|
|
52
|
+
wear: legacyAvoid ? [] : ((_a = dc === null || dc === void 0 ? void 0 : dc.colors) !== null && _a !== void 0 ? _a : []),
|
|
53
|
+
avoid: [...(legacyAvoid ? ((_b = dc === null || dc === void 0 ? void 0 : dc.colors) !== null && _b !== void 0 ? _b : []) : []), ...((_c = dc === null || dc === void 0 ? void 0 : dc.avoid_colors) !== null && _c !== void 0 ? _c : [])],
|
|
54
|
+
};
|
|
55
|
+
};
|
|
56
|
+
exports.eventDressCodeColorLists = eventDressCodeColorLists;
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import type { IEventOccasion } from "../../types/events/EventOccasion";
|
|
2
|
+
type Text = {
|
|
3
|
+
en: string;
|
|
4
|
+
ar: string;
|
|
5
|
+
};
|
|
6
|
+
/** Where a field is saved: a column of event.occasion, or a key inside its `details` */
|
|
7
|
+
export type EventOccasionFieldKey = "primary_name" | "secondary_name" | "host_name" | `details.${string}`;
|
|
8
|
+
export type EventOccasionField = {
|
|
9
|
+
key: EventOccasionFieldKey;
|
|
10
|
+
label: Text;
|
|
11
|
+
/** text (default), multiline, number, date (YYYY-MM-DD) or choice */
|
|
12
|
+
input?: "text" | "multiline" | "number" | "date" | "choice";
|
|
13
|
+
required?: boolean;
|
|
14
|
+
hint?: Text;
|
|
15
|
+
placeholder?: Text;
|
|
16
|
+
options?: {
|
|
17
|
+
value: string;
|
|
18
|
+
label: Text;
|
|
19
|
+
}[];
|
|
20
|
+
min?: number;
|
|
21
|
+
max?: number;
|
|
22
|
+
};
|
|
23
|
+
/** Form and wording of an occasion type (every type whose details live in event.occasion) */
|
|
24
|
+
export type EventOccasionTypeConfig = {
|
|
25
|
+
type: string;
|
|
26
|
+
/** Short line on the type card */
|
|
27
|
+
description: Text;
|
|
28
|
+
/** Name fields first, then the type's own details */
|
|
29
|
+
fields: EventOccasionField[];
|
|
30
|
+
/** Title in lists and page titles; {name} is primary_name (or its fallback) */
|
|
31
|
+
title: Text;
|
|
32
|
+
/** Used for {name} while primary_name is empty */
|
|
33
|
+
name_fallback: Text;
|
|
34
|
+
/** First line of the invitation; {host} is host_name */
|
|
35
|
+
invite_line: {
|
|
36
|
+
with_host: Text;
|
|
37
|
+
without_host: Text;
|
|
38
|
+
};
|
|
39
|
+
/** Default welcome text under the name */
|
|
40
|
+
welcome: Text;
|
|
41
|
+
/** Default text above the RSVP form */
|
|
42
|
+
rsvp: Text;
|
|
43
|
+
/** New events of this type are public (listed, indexed) unless the owner changes it */
|
|
44
|
+
default_public?: boolean;
|
|
45
|
+
};
|
|
46
|
+
export declare const EVENT_OCCASION_TEXT_MAX = 255;
|
|
47
|
+
export declare const EVENT_OCCASION_LONG_TEXT_MAX = 500;
|
|
48
|
+
export declare const EVENT_BIRTHDAY_AGE_LIMIT = 120;
|
|
49
|
+
export declare const EventOccasionTypeConfigs: Record<string, EventOccasionTypeConfig>;
|
|
50
|
+
export declare const findEventOccasionConfig: (eventType: string | null | undefined) => EventOccasionTypeConfig | null;
|
|
51
|
+
/** Value of a field (column or details key) */
|
|
52
|
+
export declare const eventOccasionFieldValue: (occasion: Partial<IEventOccasion> | null | undefined, key: EventOccasionFieldKey) => unknown;
|
|
53
|
+
/** «تخرج أحمد», «افتتاح بن الشام» */
|
|
54
|
+
export declare const eventOccasionTitle: (eventType: string | null | undefined, occasion: Partial<IEventOccasion> | null | undefined, lang?: "ar" | "en") => string;
|
|
55
|
+
/** First line of the invitation, e.g. «عائلة أحمد يدعونكم لحفل تخرج» */
|
|
56
|
+
export declare const eventOccasionInviteLine: (eventType: string | null | undefined, occasion: Partial<IEventOccasion> | null | undefined, lang?: "ar" | "en") => string;
|
|
57
|
+
/** Answer keys a guest can send with an RSVP */
|
|
58
|
+
export declare const EventRsvpAnswerKeys: {
|
|
59
|
+
/** Gender reveal guess: boy | girl */
|
|
60
|
+
readonly GENDER_GUESS: "gender_guess";
|
|
61
|
+
};
|
|
62
|
+
export declare const emptyEventOccasion: IEventOccasion;
|
|
63
|
+
export {};
|
|
@@ -0,0 +1,242 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.emptyEventOccasion = exports.EventRsvpAnswerKeys = exports.eventOccasionInviteLine = exports.eventOccasionTitle = exports.eventOccasionFieldValue = exports.findEventOccasionConfig = exports.EventOccasionTypeConfigs = exports.EVENT_BIRTHDAY_AGE_LIMIT = exports.EVENT_OCCASION_LONG_TEXT_MAX = exports.EVENT_OCCASION_TEXT_MAX = void 0;
|
|
4
|
+
const host = (ar, en) => ({
|
|
5
|
+
key: "host_name",
|
|
6
|
+
label: { ar, en },
|
|
7
|
+
placeholder: { ar: "«عائلة الأحمد»", en: "e.g. The Ahmad family" },
|
|
8
|
+
});
|
|
9
|
+
exports.EVENT_OCCASION_TEXT_MAX = 255;
|
|
10
|
+
exports.EVENT_OCCASION_LONG_TEXT_MAX = 500;
|
|
11
|
+
exports.EVENT_BIRTHDAY_AGE_LIMIT = 120;
|
|
12
|
+
exports.EventOccasionTypeConfigs = {
|
|
13
|
+
birthday: {
|
|
14
|
+
type: "birthday",
|
|
15
|
+
description: { ar: "للأطفال والكبار", en: "For kids and adults" },
|
|
16
|
+
fields: [
|
|
17
|
+
{ key: "primary_name", label: { ar: "اسم صاحب عيد الميلاد", en: "Whose birthday" }, required: true, placeholder: { ar: "«ريم»", en: "e.g. Reem" } },
|
|
18
|
+
{ key: "details.age", label: { ar: "العمر الذي يتمّه", en: "Age they are turning" }, input: "number", min: 1, max: exports.EVENT_BIRTHDAY_AGE_LIMIT },
|
|
19
|
+
host("من يدعو", "Who is inviting"),
|
|
20
|
+
],
|
|
21
|
+
title: { ar: "عيد ميلاد {name}", en: "{name}'s birthday" },
|
|
22
|
+
name_fallback: { ar: "صاحب المناسبة", en: "the birthday star" },
|
|
23
|
+
invite_line: { with_host: { ar: "{host} يدعونكم لحضور عيد ميلاد", en: "{host} invite you to the birthday of" }, without_host: { ar: "أنتم مدعوون لعيد ميلاد", en: "You are invited to the birthday of" } },
|
|
24
|
+
welcome: { ar: "سنة جديدة من الفرح، تعالوا نحتفل معاً بالكعك والبالونات", en: "A new year of joy, come celebrate with us" },
|
|
25
|
+
rsvp: { ar: "أكّد حضورك لنجهّز لك مكاناً وقطعة كعك", en: "Confirm so we save you a seat and a slice of cake" },
|
|
26
|
+
},
|
|
27
|
+
proposal: {
|
|
28
|
+
type: "proposal",
|
|
29
|
+
description: { ar: "لحظة طلب الزواج", en: "The moment of the question" },
|
|
30
|
+
fields: [
|
|
31
|
+
{ key: "primary_name", label: { ar: "اسم من سيطلب", en: "Who is proposing" }, required: true },
|
|
32
|
+
{ key: "secondary_name", label: { ar: "اسم الشريك", en: "Partner's name" } },
|
|
33
|
+
{ key: "details.surprise", label: { ar: "مفاجأة", en: "Surprise" }, input: "choice", hint: { ar: "عند المفاجأة لا يظهر اسم الشريك في الدعوة", en: "A surprise hides the partner's name on the invitation" }, options: [{ value: "yes", label: { ar: "نعم، مفاجأة", en: "Yes, a surprise" } }, { value: "no", label: { ar: "لا", en: "No" } }] },
|
|
34
|
+
host("من ينظّم", "Organiser"),
|
|
35
|
+
],
|
|
36
|
+
title: { ar: "Proposal {name}", en: "{name}'s proposal" },
|
|
37
|
+
name_fallback: { ar: "صاحب المفاجأة", en: "the proposer" },
|
|
38
|
+
invite_line: { with_host: { ar: "{host} يدعونكم ليوم مميز", en: "{host} invite you to a special day" }, without_host: { ar: "ندعوكم لحضور لحظة مميزة", en: "Join us for a special moment" } },
|
|
39
|
+
welcome: { ar: "لحظة «هل تقبلين؟» نريدكم معنا فيها", en: "We want you there for the big question" },
|
|
40
|
+
rsvp: { ar: "أكّد حضورك، ولا تخبر أحداً", en: "Confirm, and keep the secret" },
|
|
41
|
+
},
|
|
42
|
+
bachelor: {
|
|
43
|
+
type: "bachelor",
|
|
44
|
+
description: { ar: "سهرة قبل الزفاف", en: "A night before the wedding" },
|
|
45
|
+
fields: [
|
|
46
|
+
{ key: "primary_name", label: { ar: "اسم العروس أو العريس", en: "Bride or groom" }, required: true },
|
|
47
|
+
{ key: "details.side", label: { ar: "الحفل لـ", en: "Party for" }, input: "choice", options: [{ value: "bride", label: { ar: "العروس", en: "The bride" } }, { value: "groom", label: { ar: "العريس", en: "The groom" } }] },
|
|
48
|
+
host("من ينظّم", "Organiser"),
|
|
49
|
+
{ key: "details.dress_code", label: { ar: "اللباس المطلوب", en: "Dress code" } },
|
|
50
|
+
],
|
|
51
|
+
title: { ar: "توديع عزوبية {name}", en: "{name}'s bachelor party" },
|
|
52
|
+
name_fallback: { ar: "العروس", en: "the bride" },
|
|
53
|
+
invite_line: { with_host: { ar: "{host} يدعونكم لحفل توديع العزوبية", en: "{host} invite you to the bachelor party of" }, without_host: { ar: "أنتم مدعوون لحفل توديع عزوبية", en: "You are invited to the bachelor party of" } },
|
|
54
|
+
welcome: { ar: "آخر سهرة قبل القفص الذهبي، لا تفوّتوها", en: "One last night out before the big day" },
|
|
55
|
+
rsvp: { ar: "أكّد حضورك لنحجز لك مكاناً", en: "Confirm so we save you a spot" },
|
|
56
|
+
},
|
|
57
|
+
newborn: {
|
|
58
|
+
type: "newborn",
|
|
59
|
+
description: { ar: "استقبال المولود الجديد", en: "Welcome the new baby" },
|
|
60
|
+
fields: [
|
|
61
|
+
{ key: "primary_name", label: { ar: "اسم المولود", en: "Baby's name" }, required: true },
|
|
62
|
+
{ key: "details.gender", label: { ar: "المولود", en: "Baby" }, input: "choice", hint: { ar: "يغيّر ألوان الدعوة", en: "Changes the invitation colours" }, options: [{ value: "boy", label: { ar: "ولد", en: "Boy" } }, { value: "girl", label: { ar: "بنت", en: "Girl" } }] },
|
|
63
|
+
{ key: "details.birth_date", label: { ar: "تاريخ الولادة", en: "Birth date" }, input: "date" },
|
|
64
|
+
host("الأهل", "Parents"),
|
|
65
|
+
],
|
|
66
|
+
title: { ar: "مباركة المولود {name}", en: "Welcoming baby {name}" },
|
|
67
|
+
name_fallback: { ar: "المولود", en: "the baby" },
|
|
68
|
+
invite_line: { with_host: { ar: "{host} يدعونكم لمباركة المولود", en: "{host} invite you to welcome" }, without_host: { ar: "أنتم مدعوون لمباركة المولود", en: "You are invited to welcome" } },
|
|
69
|
+
welcome: { ar: "أهلاً بالقمر الصغير، شاركونا الفرحة", en: "Our little one is here, share our joy" },
|
|
70
|
+
rsvp: { ar: "أكّد حضورك لتشاركنا الفرحة", en: "Confirm to share the joy with us" },
|
|
71
|
+
},
|
|
72
|
+
gender_reveal: {
|
|
73
|
+
type: "gender_reveal",
|
|
74
|
+
description: { ar: "ولد أم بنت؟ مع تصويت", en: "Boy or girl? with a guess" },
|
|
75
|
+
fields: [
|
|
76
|
+
{ key: "primary_name", label: { ar: "اسم الأهل", en: "Parents' names" }, required: true, placeholder: { ar: "«أحمد وريم»", en: "e.g. Ahmad & Reem" } },
|
|
77
|
+
{ key: "details.due_date", label: { ar: "موعد الولادة المتوقع", en: "Due date" }, input: "date" },
|
|
78
|
+
{ key: "details.guessing", label: { ar: "تصويت المدعوين", en: "Guests guess" }, input: "choice", hint: { ar: "يختار الضيف ولد أو بنت مع رده", en: "Guests pick boy or girl with their reply" }, options: [{ value: "on", label: { ar: "مفعّل", en: "On" } }, { value: "off", label: { ar: "بدون تصويت", en: "Off" } }] },
|
|
79
|
+
{ key: "details.revealed_gender", label: { ar: "النتيجة (بعد الحفل)", en: "Result (after the party)" }, input: "choice", hint: { ar: "اتركها فارغة حتى الحفل، ثم تظهر في الدعوة", en: "Leave empty until the party, then it shows on the invitation" }, options: [{ value: "boy", label: { ar: "ولد", en: "Boy" } }, { value: "girl", label: { ar: "بنت", en: "Girl" } }] },
|
|
80
|
+
],
|
|
81
|
+
title: { ar: "جنس مولود {name}", en: "{name}'s gender reveal" },
|
|
82
|
+
name_fallback: { ar: "الأهل", en: "the parents" },
|
|
83
|
+
invite_line: { with_host: { ar: "{name} يدعونكم لاكتشاف", en: "{name} invite you to find out" }, without_host: { ar: "{name} يدعونكم لاكتشاف", en: "{name} invite you to find out" } },
|
|
84
|
+
welcome: { ar: "خمّن قبل الحفل، وتعال نعرف معاً", en: "Make your guess, then find out with us" },
|
|
85
|
+
rsvp: { ar: "أكّد حضورك وقل لنا توقعك", en: "Confirm and tell us your guess" },
|
|
86
|
+
},
|
|
87
|
+
circumcision: {
|
|
88
|
+
type: "circumcision",
|
|
89
|
+
description: { ar: "فرحة العائلة بابنها", en: "A family celebration" },
|
|
90
|
+
fields: [
|
|
91
|
+
{ key: "primary_name", label: { ar: "اسم الطفل", en: "Child's name" }, required: true },
|
|
92
|
+
host("الأهل", "Parents"),
|
|
93
|
+
],
|
|
94
|
+
title: { ar: "طهور {name}", en: "{name}'s celebration" },
|
|
95
|
+
name_fallback: { ar: "ابننا", en: "our son" },
|
|
96
|
+
invite_line: { with_host: { ar: "{host} يدعونكم لحفل طهور", en: "{host} invite you to the celebration of" }, without_host: { ar: "أنتم مدعوون لحفل طهور", en: "You are invited to the celebration of" } },
|
|
97
|
+
welcome: { ar: "شاركونا فرحتنا بابننا", en: "Share our joy with our son" },
|
|
98
|
+
rsvp: { ar: "أكّد حضورك لتشاركنا الفرحة", en: "Confirm to share the joy with us" },
|
|
99
|
+
},
|
|
100
|
+
graduation: {
|
|
101
|
+
type: "graduation",
|
|
102
|
+
description: { ar: "جامعة أو مدرسة", en: "University or school" },
|
|
103
|
+
fields: [
|
|
104
|
+
{ key: "primary_name", label: { ar: "اسم الخريج", en: "Graduate's name" }, required: true },
|
|
105
|
+
{ key: "details.institution", label: { ar: "الجامعة أو المدرسة", en: "University or school" } },
|
|
106
|
+
{ key: "details.major", label: { ar: "التخصص", en: "Major" } },
|
|
107
|
+
{ key: "details.class_year", label: { ar: "الدفعة", en: "Class of" }, input: "number", min: 1950, max: 2100, placeholder: { ar: "٢٠٢٦", en: "2026" } },
|
|
108
|
+
host("من يدعو", "Who is inviting"),
|
|
109
|
+
],
|
|
110
|
+
title: { ar: "تخرج {name}", en: "{name}'s graduation" },
|
|
111
|
+
name_fallback: { ar: "الخريج", en: "the graduate" },
|
|
112
|
+
invite_line: { with_host: { ar: "{host} يدعونكم لحفل تخرج", en: "{host} invite you to the graduation of" }, without_host: { ar: "أنتم مدعوون لحفل تخرج", en: "You are invited to the graduation of" } },
|
|
113
|
+
welcome: { ar: "تعب السنين صار فرحة، شاركونا الاحتفال", en: "Years of work, one big celebration" },
|
|
114
|
+
rsvp: { ar: "أكّد حضورك لتشاركنا الفرحة", en: "Confirm to celebrate with us" },
|
|
115
|
+
},
|
|
116
|
+
hajj: {
|
|
117
|
+
type: "hajj",
|
|
118
|
+
description: { ar: "استقبال الحاج بعد عودته", en: "Welcome a pilgrim home" },
|
|
119
|
+
fields: [
|
|
120
|
+
{ key: "primary_name", label: { ar: "اسم الحاج أو الحاجة", en: "Pilgrim's name" }, required: true },
|
|
121
|
+
{ key: "secondary_name", label: { ar: "حاج ثانٍ", en: "Second pilgrim" }, hint: { ar: "إن كانا اثنين", en: "If there are two" } },
|
|
122
|
+
{ key: "details.return_date", label: { ar: "تاريخ العودة", en: "Return date" }, input: "date" },
|
|
123
|
+
host("من يدعو", "Who is inviting"),
|
|
124
|
+
],
|
|
125
|
+
title: { ar: "استقبال الحاج {name}", en: "Welcoming pilgrim {name}" },
|
|
126
|
+
name_fallback: { ar: "الحاج", en: "the pilgrim" },
|
|
127
|
+
invite_line: { with_host: { ar: "{host} يدعونكم لاستقبال", en: "{host} invite you to welcome" }, without_host: { ar: "يسعدنا دعوتكم لاستقبال", en: "Join us in welcoming" } },
|
|
128
|
+
welcome: { ar: "حجاً مبروراً وسعياً مشكوراً وذنباً مغفوراً", en: "May the Hajj be accepted" },
|
|
129
|
+
rsvp: { ar: "أكّد حضورك لنستقبله معاً", en: "Confirm to welcome them with us" },
|
|
130
|
+
},
|
|
131
|
+
mothers_day: {
|
|
132
|
+
type: "mothers_day",
|
|
133
|
+
description: { ar: "تكريم الأم", en: "Celebrate mum" },
|
|
134
|
+
fields: [
|
|
135
|
+
{ key: "primary_name", label: { ar: "اسم الأم", en: "Mother's name" }, hint: { ar: "أو اتركه فارغاً لحفل عام", en: "Or leave empty for a general party" } },
|
|
136
|
+
host("من يدعو", "Who is inviting"),
|
|
137
|
+
{ key: "details.message", label: { ar: "كلمة للأم", en: "A note for mum" }, input: "multiline" },
|
|
138
|
+
],
|
|
139
|
+
title: { ar: "عيد الأم · {name}", en: "Mother's Day · {name}" },
|
|
140
|
+
name_fallback: { ar: "ست الحبايب", en: "Mum" },
|
|
141
|
+
invite_line: { with_host: { ar: "{host} يدعونكم للاحتفال بعيد الأم", en: "{host} invite you to celebrate Mother's Day with" }, without_host: { ar: "ندعوكم للاحتفال بعيد الأم", en: "Celebrate Mother's Day with" } },
|
|
142
|
+
welcome: { ar: "«الجنة تحت أقدام الأمهات»", en: "To the heart of our home" },
|
|
143
|
+
rsvp: { ar: "أكّد حضورك لنحتفل بها معاً", en: "Confirm to celebrate her with us" },
|
|
144
|
+
},
|
|
145
|
+
valentine: {
|
|
146
|
+
type: "valentine",
|
|
147
|
+
description: { ar: "لزوجين أو لسهرة في مكان", en: "For a couple or a venue night" },
|
|
148
|
+
fields: [
|
|
149
|
+
{ key: "primary_name", label: { ar: "الاسم الأول أو عنوان السهرة", en: "First name or party title" }, required: true, placeholder: { ar: "«ليلة ١٤ شباط»", en: "e.g. Valentine's night" } },
|
|
150
|
+
{ key: "secondary_name", label: { ar: "الاسم الثاني", en: "Second name" } },
|
|
151
|
+
host("من يدعو", "Who is inviting"),
|
|
152
|
+
{ key: "details.dress_code", label: { ar: "اللباس المطلوب", en: "Dress code" }, placeholder: { ar: "«أحمر»", en: "e.g. Red" } },
|
|
153
|
+
],
|
|
154
|
+
title: { ar: "عيد الحب · {name}", en: "Valentine's · {name}" },
|
|
155
|
+
name_fallback: { ar: "سهرة عيد الحب", en: "Valentine's night" },
|
|
156
|
+
invite_line: { with_host: { ar: "{host} يدعونكم لسهرة عيد الحب", en: "{host} invite you to a Valentine's night" }, without_host: { ar: "ندعوكم لسهرة عيد الحب", en: "Join us for Valentine's night" } },
|
|
157
|
+
welcome: { ar: "ليلة من الحب والموسيقى", en: "A night of love and music" },
|
|
158
|
+
rsvp: { ar: "أكّد حضورك لنحجز لك مكاناً", en: "Confirm so we save your seat" },
|
|
159
|
+
},
|
|
160
|
+
opening: {
|
|
161
|
+
type: "opening",
|
|
162
|
+
description: { ar: "محل، مطعم أو براند جديد", en: "A new shop, restaurant or brand" },
|
|
163
|
+
fields: [
|
|
164
|
+
{ key: "primary_name", label: { ar: "اسم المحل أو البراند", en: "Shop or brand name" }, required: true },
|
|
165
|
+
{ key: "details.business_type", label: { ar: "نوع النشاط", en: "Business type" }, placeholder: { ar: "«محمصة وقهوة مختصة»", en: "e.g. Coffee roastery" } },
|
|
166
|
+
{ key: "details.offer", label: { ar: "عرض الافتتاح", en: "Opening offer" }, placeholder: { ar: "«خصم ٢٠٪ أول أسبوع»", en: "e.g. 20% off the first week" } },
|
|
167
|
+
host("من يدعو", "Who is inviting"),
|
|
168
|
+
],
|
|
169
|
+
title: { ar: "افتتاح {name}", en: "{name} opening" },
|
|
170
|
+
name_fallback: { ar: "محلنا الجديد", en: "our new place" },
|
|
171
|
+
invite_line: { with_host: { ar: "{host} يتشرفون بدعوتكم لافتتاح", en: "{host} invite you to the opening of" }, without_host: { ar: "يسعدنا دعوتكم لافتتاح", en: "You are invited to the opening of" } },
|
|
172
|
+
welcome: { ar: "كونوا أول من يزورنا", en: "Be among our first guests" },
|
|
173
|
+
rsvp: { ar: "أكّد حضورك لنجهّز لك هدية الافتتاح", en: "Confirm so we prepare your opening gift" },
|
|
174
|
+
default_public: true,
|
|
175
|
+
},
|
|
176
|
+
general: {
|
|
177
|
+
type: "general",
|
|
178
|
+
description: { ar: "أي مناسبة أخرى", en: "Any other occasion" },
|
|
179
|
+
fields: [
|
|
180
|
+
{ key: "primary_name", label: { ar: "عنوان الحفلة", en: "Party title" }, required: true, placeholder: { ar: "«سهرة نهاية الصيف»", en: "e.g. End of summer party" } },
|
|
181
|
+
host("من يدعو", "Who is inviting"),
|
|
182
|
+
{ key: "details.description", label: { ar: "وصف قصير", en: "Short description" }, input: "multiline" },
|
|
183
|
+
{ key: "details.dress_code", label: { ar: "اللباس المطلوب", en: "Dress code" } },
|
|
184
|
+
],
|
|
185
|
+
title: { ar: "{name}", en: "{name}" },
|
|
186
|
+
name_fallback: { ar: "حفلتنا", en: "our party" },
|
|
187
|
+
invite_line: { with_host: { ar: "{host} يدعونكم إلى", en: "{host} invite you to" }, without_host: { ar: "أنتم مدعوون إلى", en: "You are invited to" } },
|
|
188
|
+
welcome: { ar: "نسعد بحضوركم ومشاركتكم", en: "We would love to have you" },
|
|
189
|
+
rsvp: { ar: "أكّد حضورك لنجهّز لك مكاناً", en: "Confirm so we save you a seat" },
|
|
190
|
+
},
|
|
191
|
+
};
|
|
192
|
+
const findEventOccasionConfig = (eventType) => (eventType && exports.EventOccasionTypeConfigs[eventType]) || null;
|
|
193
|
+
exports.findEventOccasionConfig = findEventOccasionConfig;
|
|
194
|
+
/** Value of a field (column or details key) */
|
|
195
|
+
const eventOccasionFieldValue = (occasion, key) => {
|
|
196
|
+
var _a, _b, _c;
|
|
197
|
+
if (!occasion)
|
|
198
|
+
return null;
|
|
199
|
+
if (key.startsWith("details."))
|
|
200
|
+
return (_b = (_a = occasion.details) === null || _a === void 0 ? void 0 : _a[key.slice(8)]) !== null && _b !== void 0 ? _b : null;
|
|
201
|
+
return (_c = occasion[key]) !== null && _c !== void 0 ? _c : null;
|
|
202
|
+
};
|
|
203
|
+
exports.eventOccasionFieldValue = eventOccasionFieldValue;
|
|
204
|
+
const fill = (text, values) => text.replace(/\{(\w+)\}/g, (_, k) => { var _a; return (_a = values[k]) !== null && _a !== void 0 ? _a : ""; });
|
|
205
|
+
/** «تخرج أحمد», «افتتاح بن الشام» */
|
|
206
|
+
const eventOccasionTitle = (eventType, occasion, lang = "ar") => {
|
|
207
|
+
var _a;
|
|
208
|
+
const config = (0, exports.findEventOccasionConfig)(eventType);
|
|
209
|
+
if (!config)
|
|
210
|
+
return "";
|
|
211
|
+
const name = ((_a = occasion === null || occasion === void 0 ? void 0 : occasion.primary_name) === null || _a === void 0 ? void 0 : _a.trim()) || config.name_fallback[lang];
|
|
212
|
+
return fill(config.title[lang], { name }).trim();
|
|
213
|
+
};
|
|
214
|
+
exports.eventOccasionTitle = eventOccasionTitle;
|
|
215
|
+
/** First line of the invitation, e.g. «عائلة أحمد يدعونكم لحفل تخرج» */
|
|
216
|
+
const eventOccasionInviteLine = (eventType, occasion, lang = "ar") => {
|
|
217
|
+
var _a, _b;
|
|
218
|
+
const config = (0, exports.findEventOccasionConfig)(eventType);
|
|
219
|
+
if (!config)
|
|
220
|
+
return "";
|
|
221
|
+
const hostName = (_a = occasion === null || occasion === void 0 ? void 0 : occasion.host_name) === null || _a === void 0 ? void 0 : _a.trim();
|
|
222
|
+
const name = ((_b = occasion === null || occasion === void 0 ? void 0 : occasion.primary_name) === null || _b === void 0 ? void 0 : _b.trim()) || config.name_fallback[lang];
|
|
223
|
+
const line = hostName ? config.invite_line.with_host : config.invite_line.without_host;
|
|
224
|
+
return fill(line[lang], { host: hostName !== null && hostName !== void 0 ? hostName : "", name });
|
|
225
|
+
};
|
|
226
|
+
exports.eventOccasionInviteLine = eventOccasionInviteLine;
|
|
227
|
+
/** Answer keys a guest can send with an RSVP */
|
|
228
|
+
exports.EventRsvpAnswerKeys = {
|
|
229
|
+
/** Gender reveal guess: boy | girl */
|
|
230
|
+
GENDER_GUESS: "gender_guess",
|
|
231
|
+
};
|
|
232
|
+
exports.emptyEventOccasion = {
|
|
233
|
+
id: 0,
|
|
234
|
+
event_id: 0,
|
|
235
|
+
primary_name: null,
|
|
236
|
+
secondary_name: null,
|
|
237
|
+
host_name: null,
|
|
238
|
+
phone: null,
|
|
239
|
+
cover: null,
|
|
240
|
+
photos: [],
|
|
241
|
+
details: {},
|
|
242
|
+
};
|
|
@@ -19,3 +19,6 @@ export type EventPreviewMessage = {
|
|
|
19
19
|
/** Query parameter that picks the template on the preview page's first paint */
|
|
20
20
|
export declare const EventPreviewTemplateParam = "template";
|
|
21
21
|
export declare const DEFAULT_WEDDING_TEMPLATE = "wedding-01";
|
|
22
|
+
export declare const DEFAULT_BIRTHDAY_TEMPLATE = "birthday-01";
|
|
23
|
+
/** The template a new event of this type starts with */
|
|
24
|
+
export declare const defaultEventTemplate: (eventType: string | null | undefined) => string;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.DEFAULT_WEDDING_TEMPLATE = exports.EventPreviewTemplateParam = exports.EventPreviewMessageType = void 0;
|
|
3
|
+
exports.defaultEventTemplate = exports.DEFAULT_BIRTHDAY_TEMPLATE = exports.DEFAULT_WEDDING_TEMPLATE = exports.EventPreviewTemplateParam = exports.EventPreviewMessageType = void 0;
|
|
4
|
+
const EventTemplate_1 = require("./EventTemplate");
|
|
4
5
|
/** Messages between the app (WebView / iframe) and the event site's /preview/:token page */
|
|
5
6
|
exports.EventPreviewMessageType = {
|
|
6
7
|
SET_TEMPLATE: "deallony:set-template",
|
|
@@ -11,3 +12,10 @@ exports.EventPreviewMessageType = {
|
|
|
11
12
|
/** Query parameter that picks the template on the preview page's first paint */
|
|
12
13
|
exports.EventPreviewTemplateParam = "template";
|
|
13
14
|
exports.DEFAULT_WEDDING_TEMPLATE = "wedding-01";
|
|
15
|
+
exports.DEFAULT_BIRTHDAY_TEMPLATE = "birthday-01";
|
|
16
|
+
/** The template a new event of this type starts with */
|
|
17
|
+
const defaultEventTemplate = (eventType) => {
|
|
18
|
+
var _a, _b;
|
|
19
|
+
return (_b = (_a = EventTemplate_1.EventTemplateOptions.find((t) => !t.hidden && t.event_types.includes(eventType || "wedding"))) === null || _a === void 0 ? void 0 : _a.value) !== null && _b !== void 0 ? _b : exports.DEFAULT_WEDDING_TEMPLATE;
|
|
20
|
+
};
|
|
21
|
+
exports.defaultEventTemplate = defaultEventTemplate;
|