accomadesc 0.1.1 → 0.1.3

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.
@@ -1,10 +1,24 @@
1
1
  <script lang="ts">
2
- import type { AccoDescriptionContent, I18nFacade } from './types.js';
2
+ import {
3
+ type AccoDescriptionContent,
4
+ type I18nFacade,
5
+ DEFAULT_TEXT_FONT_SIZE,
6
+ DEFAULT_HEADERS_FONT_SIZE,
7
+ DEFAULT_EXT_HEADERS_1_FONT_SIZE,
8
+ DEFAULT_EXT_HEADERS_2_FONT_SIZE,
9
+ DEFAULT_EXT_HEADERS_3_FONT_SIZE,
10
+ DEFAULT_EXT_HEADERS_4_FONT_SIZE,
11
+ } from './types.js';
3
12
  let {
4
13
  ref,
5
14
  minHeight = '100%',
6
- textFontSize = '1rem',
7
- headerFontSize = '1.5rem',
15
+ textFontSize = DEFAULT_TEXT_FONT_SIZE,
16
+ headerFontSize = DEFAULT_HEADERS_FONT_SIZE,
17
+ extendedHeaders = false,
18
+ extendedHeaders1Size = DEFAULT_EXT_HEADERS_1_FONT_SIZE,
19
+ extendedHeaders2Size = DEFAULT_EXT_HEADERS_2_FONT_SIZE,
20
+ extendedHeaders3Size = DEFAULT_EXT_HEADERS_3_FONT_SIZE,
21
+ extendedHeaders4Size = DEFAULT_EXT_HEADERS_4_FONT_SIZE,
8
22
  translateFunc,
9
23
  }: AccoDescriptionContent & I18nFacade = $props();
10
24
 
@@ -17,8 +31,13 @@
17
31
  min-height: {minHeight};
18
32
  --font-size-text-text-editor: {textFontSize};
19
33
  --font-size-header-text-editor: {headerFontSize};
20
- "
34
+ --font-size-header-1: {extendedHeaders1Size};
35
+ --font-size-header-2: {extendedHeaders2Size};
36
+ --font-size-header-3: {extendedHeaders3Size};
37
+ --font-size-header-4: {extendedHeaders4Size};
38
+ "
21
39
  class="content"
40
+ class:extended={extendedHeaders}
22
41
  id="content"
23
42
  >
24
43
  {@html translatedRef}
@@ -26,27 +45,46 @@
26
45
  </div>
27
46
 
28
47
  <style>
29
- .content {
30
- width: 100%;
48
+ .container {
49
+ position: relative;
31
50
  height: 100%;
51
+ width: 100%;
32
52
 
33
- text-align: left;
34
- margin-left: 0.2rem;
35
- margin-right: 0.2rem;
36
- }
53
+ .content {
54
+ width: 100%;
55
+ height: 100%;
37
56
 
38
- .content :global(*) {
39
- font-size: var(--font-size-text-text-editor);
40
- }
57
+ text-align: left;
58
+ margin-left: 0.2rem;
59
+ margin-right: 0.2rem;
41
60
 
42
- .content :global(h3) {
43
- font-size: var(--font-size-header-text-editor);
44
- text-align: left;
45
- }
61
+ :global(*) {
62
+ font-size: var(--font-size-text-text-editor);
63
+ }
46
64
 
47
- .container {
48
- position: relative;
49
- height: 100%;
50
- width: 100%;
65
+ :global(h3) {
66
+ font-size: var(--font-size-header-text-editor);
67
+ text-align: left;
68
+ }
69
+ }
70
+
71
+ .content.extended {
72
+ :global(h1) {
73
+ font-size: var(--font-size-header-1);
74
+ text-align: left;
75
+ }
76
+ :global(h2) {
77
+ font-size: var(--font-size-header-2);
78
+ text-align: left;
79
+ }
80
+ :global(h3) {
81
+ font-size: var(--font-size-header-3);
82
+ text-align: left;
83
+ }
84
+ :global(h4) {
85
+ font-size: var(--font-size-header-4);
86
+ text-align: left;
87
+ }
88
+ }
51
89
  }
52
90
  </style>
@@ -1,4 +1,4 @@
1
- import type { AccoDescriptionContent, I18nFacade } from './types.js';
1
+ import { type AccoDescriptionContent, type I18nFacade } from './types.js';
2
2
  type $$ComponentProps = AccoDescriptionContent & I18nFacade;
3
3
  declare const AccoDescription: import("svelte").Component<$$ComponentProps, {}, "">;
4
4
  type AccoDescription = ReturnType<typeof AccoDescription>;
@@ -12,7 +12,7 @@
12
12
 
13
13
  const {
14
14
  endpoint,
15
- acco,
15
+ accoID,
16
16
  messageLabel,
17
17
  calUrl,
18
18
  userID,
@@ -53,7 +53,7 @@
53
53
 
54
54
  //https://popnapdkcdnabruxkjti.supabase.co/storage/v1/object/public/ical/81e66599-ac3c-4ad6-b261-fceeb784f9e9/050edcb4-680e-4542-96df-3ae4a2af89a5
55
55
 
56
- const url = calUrl; //`${accomadeBaseUrl}/${userID}/${acco.path}`;
56
+ const url = calUrl;
57
57
  const oStateID = `i-${url}-${OCCUPATION_STATE}`;
58
58
  let occupationState: OccupationState = $state(getContext(oStateID));
59
59
  let invalid = $derived(
@@ -92,7 +92,7 @@
92
92
  },
93
93
  body: JSON.stringify({
94
94
  userID: userID,
95
- acco: acco.path,
95
+ acco: accoID,
96
96
  guestEmail: email,
97
97
  guestName: name,
98
98
  message: message,
@@ -0,0 +1,56 @@
1
+ <script lang="ts">
2
+ import type { Nav, I18nFacade } from './types.js';
3
+ import { blur } from 'svelte/transition';
4
+
5
+ import MainNav from './MainNav.svelte';
6
+ import HamburgerSVG from './svg/HamburgerSVG.svelte';
7
+ import XSVG from './svg/XSVG.svelte';
8
+
9
+ let {
10
+ nav,
11
+ translateFunc,
12
+ currentLang,
13
+ supportedLangs,
14
+ updateCurrentLang,
15
+ isMenuOpen = $bindable(false),
16
+ }: {
17
+ nav: Nav;
18
+ isMenuOpen: boolean;
19
+ } & I18nFacade = $props();
20
+ </script>
21
+
22
+ {#if isMenuOpen}
23
+ <MainNav
24
+ {nav}
25
+ {translateFunc}
26
+ {updateCurrentLang}
27
+ {currentLang}
28
+ {supportedLangs}
29
+ close={() => (isMenuOpen = false)}
30
+ />
31
+ {/if}
32
+
33
+ <button
34
+ transition:blur
35
+ onclick={() => (isMenuOpen = !isMenuOpen)}
36
+ aria-pressed={isMenuOpen}
37
+ aria-label="menu button"
38
+ tabindex={isMenuOpen ? 0 : -1}
39
+ >
40
+ {#if isMenuOpen}
41
+ <XSVG />
42
+ {:else}
43
+ <HamburgerSVG />
44
+ {/if}
45
+ </button>
46
+
47
+ <style>
48
+ button {
49
+ background-color: transparent;
50
+ border: 0;
51
+ width: 3rem;
52
+ height: 3rem;
53
+ z-index: 999;
54
+ position: relative;
55
+ }
56
+ </style>
@@ -0,0 +1,8 @@
1
+ import type { Nav, I18nFacade } from './types.js';
2
+ type $$ComponentProps = {
3
+ nav: Nav;
4
+ isMenuOpen: boolean;
5
+ } & I18nFacade;
6
+ declare const Hamburger: import("svelte").Component<$$ComponentProps, {}, "isMenuOpen">;
7
+ type Hamburger = ReturnType<typeof Hamburger>;
8
+ export default Hamburger;
@@ -0,0 +1,138 @@
1
+ <script lang="ts">
2
+ import { page } from '$app/state';
3
+ import { fade } from 'svelte/transition';
4
+ import type { Nav, I18nFacade } from './types.js';
5
+ import NavItem from './NavItem.svelte';
6
+
7
+ let currentPath = $derived(page.url.pathname);
8
+ let {
9
+ nav,
10
+ close,
11
+ translateFunc,
12
+ updateCurrentLang,
13
+ currentLang,
14
+ supportedLangs,
15
+ }: {
16
+ nav: Nav;
17
+ close: () => void;
18
+ } & I18nFacade = $props();
19
+
20
+ let allTranslations = $state(supportedLangs);
21
+
22
+ const pathForLang = (lang: string) => {
23
+ const pathElements = currentPath.split('/');
24
+ //initial slash results in empty string real first element
25
+ if (pathElements.length == 1) return `/${lang}`;
26
+
27
+ const firstElement = pathElements[1];
28
+ if (allTranslations?.includes(firstElement)) {
29
+ return ['', lang, ...pathElements.slice(2)].join('/');
30
+ } else {
31
+ return ['', lang, ...pathElements.slice(1)].join('/');
32
+ }
33
+ };
34
+ </script>
35
+
36
+ <button class="not-nav" onclick={close} aria-label="close" transition:fade|global></button>
37
+
38
+ <nav class="main-nav open" transition:fade|global>
39
+ <ul>
40
+ {#each nav.main as n}
41
+ <li>
42
+ <NavItem {n} {supportedLangs} {currentLang} {translateFunc} onclick={close} />
43
+ </li>
44
+ {/each}
45
+ </ul>
46
+ {#if allTranslations && allTranslations.length > 1}
47
+ <fieldset>
48
+ <legend>{translateFunc ? translateFunc('lang') : ''}</legend>
49
+
50
+ {#each allTranslations as langKey}
51
+ <a
52
+ class="lang-link"
53
+ rel="alternate"
54
+ onclick={() => (updateCurrentLang ? updateCurrentLang(langKey) : '')}
55
+ href={pathForLang(langKey)}
56
+ hreflang={langKey}
57
+ >
58
+ <div class="radio-wrapper">
59
+ <input
60
+ type="radio"
61
+ name="language"
62
+ id={langKey}
63
+ value={langKey}
64
+ checked={langKey === currentLang}
65
+ />
66
+ <label for={langKey}>{translateFunc ? translateFunc(langKey) : ''}</label>
67
+ </div>
68
+ </a>
69
+ {/each}
70
+ </fieldset>
71
+ {/if}
72
+ </nav>
73
+
74
+ <style>
75
+ fieldset {
76
+ padding-left: 1rem;
77
+ padding-right: 1rem;
78
+ margin-left: 1rem;
79
+ }
80
+
81
+ nav {
82
+ z-index: 998;
83
+ position: fixed;
84
+ padding-right: 1rem;
85
+ top: 0;
86
+ right: 0;
87
+ padding-top: 3rem;
88
+ background-color: var(--nav-bg-color);
89
+ color: var(--nav-font-color);
90
+ height: 100vh;
91
+ font-family: var(--nav-font-family);
92
+ font-variant: var(--nav-font-variant);
93
+ font-size: 1.6rem;
94
+ font-weight: bold;
95
+
96
+ overflow-y: auto;
97
+ overflow-x: hidden;
98
+
99
+ * {
100
+ color: var(--nav-font-color);
101
+ }
102
+ }
103
+
104
+ .not-nav {
105
+ border: none;
106
+ position: fixed;
107
+ top: 0;
108
+ right: 0;
109
+ bottom: 0;
110
+ left: 0;
111
+ background-color: rgba(0, 0, 0, 0.1);
112
+ overflow-y: hidden;
113
+ overflow-x: hidden;
114
+ }
115
+
116
+ li {
117
+ list-style: none;
118
+ margin-bottom: 1rem;
119
+ }
120
+
121
+ .radio-wrapper {
122
+ font-family: var(--nav-font-family);
123
+ font-variant: var(--nav-font-variant);
124
+ font-size: 1.6rem;
125
+ font-weight: bold;
126
+ line-height: 1.1;
127
+ display: grid;
128
+ grid-template-columns: 1em auto;
129
+ gap: 0.5em;
130
+ margin-top: 1rem;
131
+ margin-bottom: 1rem;
132
+ }
133
+
134
+ ul {
135
+ padding-left: 2.5rem;
136
+ margin: 0;
137
+ }
138
+ </style>
@@ -0,0 +1,8 @@
1
+ import type { Nav, I18nFacade } from './types.js';
2
+ type $$ComponentProps = {
3
+ nav: Nav;
4
+ close: () => void;
5
+ } & I18nFacade;
6
+ declare const MainNav: import("svelte").Component<$$ComponentProps, {}, "">;
7
+ type MainNav = ReturnType<typeof MainNav>;
8
+ export default MainNav;
@@ -0,0 +1,68 @@
1
+ <script lang="ts">
2
+ import type { NavItem, I18nFacade } from './types.js';
3
+ import ExtLinkSvg from './svg/ExtLinkSVG.svelte';
4
+
5
+ let {
6
+ n,
7
+ onclick,
8
+ currentLang,
9
+ translateFunc,
10
+ }: {
11
+ n: NavItem;
12
+ onclick?: () => void;
13
+ } & I18nFacade = $props();
14
+
15
+ const path = $derived(`/${currentLang}${n.path}`);
16
+ </script>
17
+
18
+ <div class="wrapper" class:sub={n.sub}>
19
+ {#if n.path}
20
+ {#if n.external}
21
+ <div class="ext-link-wrapper">
22
+ <div class="link-icon-wrapper">
23
+ <ExtLinkSvg size="1.6rem" />
24
+ </div>
25
+ <a href={n.path} target="_blank" rel="noreferrer noopener">
26
+ {translateFunc ? translateFunc(n.key) : ''}
27
+ </a>
28
+ </div>
29
+ {:else}
30
+ <a href={path} {onclick}>
31
+ {translateFunc ? translateFunc(n.key) : ''}
32
+ </a>
33
+ {/if}
34
+ {:else}
35
+ <span>{translateFunc ? translateFunc(n.key) : ''}</span>
36
+ {/if}
37
+ </div>
38
+
39
+ <style>
40
+ .sub {
41
+ font-size: 1.2rem;
42
+ margin-left: 0.4rem;
43
+ }
44
+
45
+ a {
46
+ text-decoration: underline;
47
+ color: var(--nav-font-color);
48
+ }
49
+
50
+ span {
51
+ color: var(--nav-font-color);
52
+ }
53
+
54
+ .link-icon-wrapper {
55
+ position: absolute;
56
+ left: -1.8rem;
57
+ top: 0rem;
58
+ }
59
+ .sub .link-icon-wrapper {
60
+ left: -2.2rem;
61
+ }
62
+
63
+ .ext-link-wrapper {
64
+ display: flex;
65
+ position: relative;
66
+ width: 100%;
67
+ }
68
+ </style>
@@ -0,0 +1,8 @@
1
+ import type { NavItem, I18nFacade } from './types.js';
2
+ type $$ComponentProps = {
3
+ n: NavItem;
4
+ onclick?: () => void;
5
+ } & I18nFacade;
6
+ declare const NavItem: import("svelte").Component<$$ComponentProps, {}, "">;
7
+ type NavItem = ReturnType<typeof NavItem>;
8
+ export default NavItem;
@@ -0,0 +1,191 @@
1
+ <script lang="ts">
2
+ import Photo from './Photo.svelte';
3
+ import Section from './Section.svelte';
4
+ import Hamburger from './Hamburger.svelte';
5
+ import PageHeader from './PageHeader.svelte';
6
+ import PageFooter from './PageFooter.svelte';
7
+ import type { Page, Section as SectionI, I18nFacade } from './types.ts';
8
+
9
+ let {
10
+ hero,
11
+ header,
12
+ title,
13
+ slug,
14
+ logoLink,
15
+ content,
16
+ nav,
17
+ showFooter = true,
18
+ fixedHamburger = true,
19
+ translateFunc,
20
+ formatMoneyFunc,
21
+ formatDateFunc,
22
+ formatFunc,
23
+ supportedLangs,
24
+ updateCurrentLang,
25
+ currentLang,
26
+ calendarTranslation,
27
+ }: Page & I18nFacade = $props();
28
+
29
+ let pageTitle = hero && hero.title ? hero.title : header ? header : title;
30
+
31
+ let hamburgerOpen = $state(false);
32
+ </script>
33
+
34
+ <svelte:head>
35
+ <title
36
+ >{translateFunc && pageTitle
37
+ ? translateFunc(pageTitle)
38
+ : //TODO default to something here?
39
+ ''}</title
40
+ >
41
+ </svelte:head>
42
+
43
+ <div class="page-wrapper">
44
+ {#if hero}
45
+ <header class="hero-image">
46
+ <Photo photoPath={hero.photoPath} alt="Hero Image" eager={true} />
47
+ </header>
48
+
49
+ <div class="floating-title">
50
+ <h1>{translateFunc ? translateFunc(hero.title) : ''}</h1>
51
+ </div>
52
+ {:else}
53
+ {#if title}
54
+ <PageHeader {title} {slug} {logoLink} {translateFunc} />
55
+ {/if}
56
+ {#if header}
57
+ <h1>{@html translateFunc ? translateFunc(header) : ''}</h1>
58
+ {/if}
59
+ {/if}
60
+
61
+ <main class:hero-margin={hero}>
62
+ {#if content}
63
+ {#each content as s}
64
+ <div class="section-wrapper">
65
+ <Section
66
+ {...s as SectionI}
67
+ {translateFunc}
68
+ {formatMoneyFunc}
69
+ {formatDateFunc}
70
+ {formatFunc}
71
+ {currentLang}
72
+ {calendarTranslation}
73
+ />
74
+ </div>
75
+ {/each}
76
+ {/if}
77
+ </main>
78
+
79
+ {#if nav && showFooter}
80
+ <div class="footer-wrapper">
81
+ <PageFooter {nav} {translateFunc} {currentLang} />
82
+ </div>
83
+ {/if}
84
+
85
+ {#if nav}
86
+ <div class="ham-wrapper" class:fixed={fixedHamburger || hamburgerOpen}>
87
+ <Hamburger
88
+ {nav}
89
+ {translateFunc}
90
+ {currentLang}
91
+ {supportedLangs}
92
+ {updateCurrentLang}
93
+ bind:isMenuOpen={hamburgerOpen}
94
+ />
95
+ </div>
96
+ {/if}
97
+ </div>
98
+
99
+ <style>
100
+ .section-wrapper {
101
+ margin-bottom: 2rem;
102
+ width: 100%;
103
+ overflow-y: clip;
104
+ display: flex;
105
+ flex-direction: column;
106
+ align-items: center;
107
+
108
+ text-align: center;
109
+ }
110
+
111
+ h1 {
112
+ margin-bottom: 0;
113
+ margin-top: 1rem;
114
+ }
115
+
116
+ header {
117
+ position: absolute;
118
+ top: 0;
119
+ left: 0;
120
+ width: 100%;
121
+ height: calc(100vh - 2rem);
122
+ }
123
+
124
+ main {
125
+ display: flex;
126
+ flex-direction: column;
127
+ align-items: center;
128
+ overflow-y: clip;
129
+
130
+ width: 100%;
131
+ min-height: 100%;
132
+
133
+ text-align: center;
134
+ }
135
+
136
+ main.hero-margin {
137
+ margin-top: calc(100vh - 1rem);
138
+ }
139
+
140
+ .floating-title {
141
+ width: 100%;
142
+ height: calc(100vh - 2rem);
143
+ position: absolute;
144
+ top: 0;
145
+ left: 0;
146
+ padding-left: 2rem;
147
+ padding-right: 2rem;
148
+ display: flex;
149
+ align-items: center;
150
+ justify-content: center;
151
+ /* mix-blend-mode: difference; */
152
+ text-align: center;
153
+ }
154
+
155
+ .floating-title h1 {
156
+ font-weight: bolder;
157
+ font-size: 2.8rem;
158
+ font-family: var(--landing-title-font-family, 'sans-serif');
159
+ font-variant: var(--landing-title-font-variant, 'small-caps');
160
+ color: var(--title-font-color);
161
+ filter: drop-shadow(0.2rem 0.3rem 0.2rem black);
162
+ }
163
+
164
+ @media (max-width: 300px) {
165
+ .floating-title h1 {
166
+ font-size: 1.6rem;
167
+ }
168
+ }
169
+
170
+ .ham-wrapper {
171
+ position: absolute;
172
+ right: 1rem;
173
+ top: 1rem;
174
+ width: 3rem;
175
+ height: 3rem;
176
+ z-index: 999;
177
+ }
178
+
179
+ .fixed {
180
+ position: fixed;
181
+ }
182
+
183
+ .page-wrapper {
184
+ display: flex;
185
+ flex-direction: column;
186
+ width: 100%;
187
+ position: relative;
188
+
189
+ background-color: var(--main-bg-color);
190
+ }
191
+ </style>
@@ -0,0 +1,4 @@
1
+ import type { Page } from './types.ts';
2
+ declare const Page: any;
3
+ type Page = ReturnType<typeof Page>;
4
+ export default Page;
@@ -0,0 +1,80 @@
1
+ <script lang="ts">
2
+ import type { Nav, I18nFacade } from './types.js';
3
+ import NavItem from './NavItem.svelte';
4
+
5
+ let { nav, translateFunc, currentLang }: { nav: Nav } & I18nFacade = $props();
6
+ </script>
7
+
8
+ <footer>
9
+ <div class="nav">
10
+ {#each nav.footer as n}
11
+ <div class="link-wrapper">
12
+ <NavItem {n} {currentLang} {translateFunc} />
13
+ </div>
14
+ {/each}
15
+ </div>
16
+ <div class="content">
17
+ {@html translateFunc ? translateFunc('footer_html') : ''}
18
+ </div>
19
+ </footer>
20
+
21
+ <style>
22
+ .nav {
23
+ display: flex;
24
+ flex-direction: row;
25
+ justify-content: space-around;
26
+ flex-wrap: wrap;
27
+ flex-grow: 3;
28
+ }
29
+ .content {
30
+ flex-grow: 1;
31
+ display: flex;
32
+ flex-direction: row;
33
+ justify-content: right;
34
+ }
35
+
36
+ .content :global(*) {
37
+ background-color: var(--footer-bg-color);
38
+ color: var(--footer-font-color);
39
+ }
40
+
41
+ .link-wrapper {
42
+ text-decoration: underline;
43
+ font-family: var(--nav-font-family, 'mono');
44
+ font-variant: var(--nav-font-variant, 'normal');
45
+ font-size: 1.4rem;
46
+ font-weight: bold;
47
+
48
+ display: flex;
49
+ align-items: center;
50
+ margin-left: 1rem;
51
+ margin-right: 1rem;
52
+ }
53
+
54
+ footer {
55
+ display: flex;
56
+ flex-direction: row;
57
+ justify-content: space-between;
58
+
59
+ color: var(--footer-font-color);
60
+ background-color: var(--footer-bg-color);
61
+ margin-top: 1rem;
62
+ width: 100%;
63
+
64
+ padding-top: 1rem;
65
+ padding-bottom: 1rem;
66
+ padding-left: 2rem;
67
+ padding-right: 2rem;
68
+ min-height: 5rem;
69
+ * {
70
+ color: var(--nav-font-color);
71
+ }
72
+ }
73
+
74
+ @media (max-width: 500px) {
75
+ .nav {
76
+ flex-direction: row;
77
+ justify-content: left;
78
+ }
79
+ }
80
+ </style>
@@ -0,0 +1,7 @@
1
+ import type { Nav, I18nFacade } from './types.js';
2
+ type $$ComponentProps = {
3
+ nav: Nav;
4
+ } & I18nFacade;
5
+ declare const PageFooter: import("svelte").Component<$$ComponentProps, {}, "">;
6
+ type PageFooter = ReturnType<typeof PageFooter>;
7
+ export default PageFooter;
@@ -0,0 +1,111 @@
1
+ <script lang="ts">
2
+ import type { I18nFacade } from './types.ts';
3
+
4
+ let {
5
+ logoLink,
6
+ title,
7
+ slug,
8
+ translateFunc,
9
+ }: {
10
+ title: string;
11
+ slug?: string;
12
+ logoLink?: string;
13
+ } & I18nFacade = $props();
14
+ </script>
15
+
16
+ <header>
17
+ <object title="logo" class="logo" data={logoLink}></object>
18
+ <div class="text-wrapper">
19
+ <div class="header"><h1>{@html translateFunc ? translateFunc(title) : ''}</h1></div>
20
+ {#if slug}
21
+ <div class="slug">{@html translateFunc ? translateFunc(slug) : ''}</div>
22
+ {/if}
23
+ </div>
24
+ </header>
25
+
26
+ <style>
27
+ header {
28
+ position: relative;
29
+ display: flex;
30
+ justify-content: center;
31
+ margin: 0;
32
+ width: 100%;
33
+ background-color: var(--header-bg-color);
34
+ * {
35
+ color: var(--header-font-color);
36
+ }
37
+ }
38
+
39
+ .text-wrapper {
40
+ min-height: 12rem;
41
+ display: flex;
42
+ flex-direction: column;
43
+ align-items: center;
44
+ justify-content: center;
45
+ margin-left: 10rem;
46
+ margin-right: 8rem;
47
+ }
48
+
49
+ .slug {
50
+ font-size: 1.6rem;
51
+ font-family: var(--header-font-family, 'sans-serif');
52
+ font-variant: var(--header-font-variant, 'small-caps');
53
+ margin-bottom: 1rem;
54
+ }
55
+
56
+ .header h1 {
57
+ margin-top: 0.6rem;
58
+ margin-bottom: 0.3rem;
59
+ font-family: var(--page-title-font-family, 'sans-serif');
60
+ font-variant: var(--page-title-font-variant, 'small-caps');
61
+ }
62
+
63
+ .logo {
64
+ position: absolute;
65
+ left: 0;
66
+ top: 0;
67
+
68
+ margin-left: 0.6rem;
69
+ margin-top: 0.6rem;
70
+ width: 10rem;
71
+ }
72
+
73
+ @media (max-width: 550px) {
74
+ .text-wrapper {
75
+ margin-left: 10rem;
76
+ margin-right: 2rem;
77
+ }
78
+ }
79
+
80
+ @media (max-width: 500px) {
81
+ .text-wrapper {
82
+ min-height: 6rem;
83
+ margin-left: 6rem;
84
+ }
85
+
86
+ .slug {
87
+ display: none;
88
+ }
89
+ .logo {
90
+ width: 5rem;
91
+ }
92
+ .header h1 {
93
+ font-size: 2.2rem;
94
+ }
95
+ }
96
+
97
+ @media (max-width: 300px) {
98
+ .text-wrapper {
99
+ min-height: 4rem;
100
+ margin-left: 0.5rem;
101
+ margin-right: 1rem;
102
+ }
103
+
104
+ .logo {
105
+ display: none;
106
+ }
107
+ .header h1 {
108
+ padding-left: 1rem;
109
+ }
110
+ }
111
+ </style>
@@ -0,0 +1,9 @@
1
+ import type { I18nFacade } from './types.ts';
2
+ type $$ComponentProps = {
3
+ title: string;
4
+ slug?: string;
5
+ logoLink?: string;
6
+ } & I18nFacade;
7
+ declare const PageHeader: import("svelte").Component<$$ComponentProps, {}, "">;
8
+ type PageHeader = ReturnType<typeof PageHeader>;
9
+ export default PageHeader;
@@ -11,6 +11,10 @@
11
11
  import LeafletMap from './LeafletMap.svelte';
12
12
  import AccoCard from './AccoCard.svelte';
13
13
  import AccoDescription from './AccoDescription.svelte';
14
+ import ContactForm from './ContactForm.svelte';
15
+ import BookingRequest from './BookingRequest.svelte';
16
+ import CalendarRows from './CalendarRows.svelte';
17
+ import CalendarGrid from './CalendarGrid.svelte';
14
18
 
15
19
  import {
16
20
  type Section as SectionI,
@@ -27,12 +31,17 @@
27
31
  isPricingShort,
28
32
  isAccoDescription,
29
33
  isAccoCard,
34
+ isContactForm,
35
+ isCalendarGrid,
36
+ isCalendarRows,
37
+ isBookingRequest,
30
38
  } from './types.js';
31
39
 
32
40
  let {
33
41
  header = undefined,
34
42
  columnCount = 2,
35
43
  padding = $bindable('10vw'),
44
+ maxWidth,
36
45
  blocks = [],
37
46
  translateFunc,
38
47
  formatMoneyFunc,
@@ -46,6 +55,8 @@
46
55
 
47
56
  let gridTemplateColumns = $state(`repeat(${columnCount}, 1fr)`);
48
57
 
58
+ let originalPadding = $state(padding);
59
+
49
60
  let clientWidth = $state(Number.MAX_SAFE_INTEGER);
50
61
  $effect(() => {
51
62
  if (clientWidth < 500) {
@@ -53,17 +64,23 @@
53
64
  padding = '0';
54
65
  } else if (clientWidth < 800 && clientWidth >= 500 && !!columnCount && columnCount > 2) {
55
66
  gridTemplateColumns = '1fr 1fr';
67
+ padding = originalPadding;
56
68
  } else {
57
69
  if (!!columnCount && columnCount > 1) {
58
70
  gridTemplateColumns = `repeat(${columnCount}, 1fr)`;
59
71
  }
72
+ padding = originalPadding;
60
73
  }
61
74
  });
75
+
76
+ let widthStyle = $derived(
77
+ maxWidth ? `max-width: ${maxWidth};` : `padding-left: ${padding}; padding-right: ${padding};`,
78
+ );
62
79
  </script>
63
80
 
64
81
  <svelte:window bind:innerWidth={clientWidth} />
65
82
 
66
- <section style="padding-left: {padding}; padding-right: {padding};">
83
+ <section style={widthStyle}>
67
84
  {#if header}
68
85
  <h2>{translatedHeader}</h2>
69
86
  {/if}
@@ -101,6 +118,14 @@
101
118
  <Text {...block.content} {translateFunc} />
102
119
  {:else if isWeather(block)}
103
120
  <Weather {...block.content} {translateFunc} {currentLang} />
121
+ {:else if isBookingRequest(block)}
122
+ <BookingRequest {...block.content} {translateFunc} {formatDateFunc} />
123
+ {:else if isCalendarRows(block)}
124
+ <CalendarRows {...block.content} {translateFunc} />
125
+ {:else if isCalendarGrid(block)}
126
+ <CalendarGrid {...block.content} {translateFunc} />
127
+ {:else if isContactForm(block)}
128
+ <ContactForm {...block.content} {translateFunc} />
104
129
  {:else}
105
130
  <div>[UNEXPECTED VALUE]</div>
106
131
  {/if}
package/dist/Text.svelte CHANGED
@@ -1,11 +1,25 @@
1
1
  <script lang="ts">
2
- import type { TextContent, I18nFacade } from './types.js';
2
+ import {
3
+ type TextContent,
4
+ type I18nFacade,
5
+ DEFAULT_TEXT_FONT_SIZE,
6
+ DEFAULT_HEADERS_FONT_SIZE,
7
+ DEFAULT_EXT_HEADERS_1_FONT_SIZE,
8
+ DEFAULT_EXT_HEADERS_2_FONT_SIZE,
9
+ DEFAULT_EXT_HEADERS_3_FONT_SIZE,
10
+ DEFAULT_EXT_HEADERS_4_FONT_SIZE,
11
+ } from './types.js';
3
12
 
4
13
  let {
5
14
  ref,
6
15
  minHeight = '100%',
7
- textFontSize = '1rem',
8
- headerFontSize = '1.5rem',
16
+ textFontSize = DEFAULT_TEXT_FONT_SIZE,
17
+ headerFontSize = DEFAULT_HEADERS_FONT_SIZE,
18
+ extendedHeaders = false,
19
+ extendedHeaders1Size = DEFAULT_EXT_HEADERS_1_FONT_SIZE,
20
+ extendedHeaders2Size = DEFAULT_EXT_HEADERS_2_FONT_SIZE,
21
+ extendedHeaders3Size = DEFAULT_EXT_HEADERS_3_FONT_SIZE,
22
+ extendedHeaders4Size = DEFAULT_EXT_HEADERS_4_FONT_SIZE,
9
23
  translateFunc,
10
24
  }: TextContent & I18nFacade = $props();
11
25
 
@@ -18,9 +32,14 @@
18
32
  min-height: {minHeight};
19
33
  --font-size-text: {textFontSize};
20
34
  --font-size-header: {headerFontSize};
35
+ --font-size-header-1: {extendedHeaders1Size};
36
+ --font-size-header-2: {extendedHeaders2Size};
37
+ --font-size-header-3: {extendedHeaders3Size};
38
+ --font-size-header-4: {extendedHeaders4Size};
21
39
  "
22
40
  class="content"
23
41
  id="content"
42
+ class:extended={extendedHeaders}
24
43
  >
25
44
  {@html translated}
26
45
  </div>
@@ -45,11 +64,28 @@
45
64
  color: var(--main-font-color);
46
65
  font-size: var(--font-size-text);
47
66
  }
48
-
49
67
  :global(h3) {
50
68
  font-size: var(--font-size-header);
51
69
  text-align: left;
52
70
  }
53
71
  }
72
+ .extended {
73
+ :global(h1) {
74
+ font-size: var(--font-size-header-1);
75
+ text-align: left;
76
+ }
77
+ :global(h2) {
78
+ font-size: var(--font-size-header-2);
79
+ text-align: left;
80
+ }
81
+ :global(h3) {
82
+ font-size: var(--font-size-header-3);
83
+ text-align: left;
84
+ }
85
+ :global(h4) {
86
+ font-size: var(--font-size-header-4);
87
+ text-align: left;
88
+ }
89
+ }
54
90
  }
55
91
  </style>
@@ -1,4 +1,4 @@
1
- import type { TextContent, I18nFacade } from './types.js';
1
+ import { type TextContent, type I18nFacade } from './types.js';
2
2
  type $$ComponentProps = TextContent & I18nFacade;
3
3
  declare const Text: import("svelte").Component<$$ComponentProps, {}, "">;
4
4
  type Text = ReturnType<typeof Text>;
package/dist/index.d.ts CHANGED
@@ -22,6 +22,7 @@ import PricingShort from './PricingShort.svelte';
22
22
  import Section from './Section.svelte';
23
23
  import Text from './Text.svelte';
24
24
  import Weather from './Weather.svelte';
25
- 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, Acco as AccoI, } from './types.js';
25
+ import Page from './Page.svelte';
26
+ 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, Page as PageI, } from './types.js';
26
27
  export { PRICING_COLUMNS, isAccoCard, isText, isPhoto, isGallery, isLeafletMap, isWeather, isAmenitiesCore, isCalendarAvailable, isCalendar, isCalendarGrid, isCalendarRows, isPricing, isPricingShort, isAccoDescription, isBookingRequest, isContactForm, } from './types.js';
27
- 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, };
28
+ 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, Page, };
package/dist/index.js CHANGED
@@ -23,5 +23,6 @@ import PricingShort from './PricingShort.svelte';
23
23
  import Section from './Section.svelte';
24
24
  import Text from './Text.svelte';
25
25
  import Weather from './Weather.svelte';
26
+ import Page from './Page.svelte';
26
27
  export { PRICING_COLUMNS, isAccoCard, isText, isPhoto, isGallery, isLeafletMap, isWeather, isAmenitiesCore, isCalendarAvailable, isCalendar, isCalendarGrid, isCalendarRows, isPricing, isPricingShort, isAccoDescription, isBookingRequest, isContactForm, } from './types.js';
27
- 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, };
28
+ 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, Page, };
package/dist/types.d.ts CHANGED
@@ -69,11 +69,22 @@ export interface Text {
69
69
  kind: 'text';
70
70
  content: TextContent;
71
71
  }
72
+ export declare const DEFAULT_TEXT_FONT_SIZE = "1rem";
73
+ export declare const DEFAULT_HEADERS_FONT_SIZE = "1.5rem";
74
+ export declare const DEFAULT_EXT_HEADERS_1_FONT_SIZE = "3.2rem";
75
+ export declare const DEFAULT_EXT_HEADERS_2_FONT_SIZE = "2.2rem";
76
+ export declare const DEFAULT_EXT_HEADERS_3_FONT_SIZE = "1.8rem";
77
+ export declare const DEFAULT_EXT_HEADERS_4_FONT_SIZE = "1.2rem";
72
78
  export interface TextContent {
73
79
  ref: string;
74
80
  minHeight?: string;
75
81
  textFontSize?: string;
76
82
  headerFontSize?: string;
83
+ extendedHeaders?: boolean;
84
+ extendedHeaders1Size?: string;
85
+ extendedHeaders2Size?: string;
86
+ extendedHeaders3Size?: string;
87
+ extendedHeaders4Size?: string;
77
88
  }
78
89
  export interface Weather {
79
90
  id: string;
@@ -192,12 +203,6 @@ export interface AmenitiesCoreContent {
192
203
  parking: boolean;
193
204
  showParking?: boolean;
194
205
  }
195
- export interface Acco {
196
- path: string;
197
- displayName: string;
198
- cardContent?: AccoCardContent;
199
- siteContent?: Section[];
200
- }
201
206
  export interface AccoCard {
202
207
  id: string;
203
208
  kind: 'acco-card';
@@ -222,6 +227,11 @@ export interface AccoDescriptionContent {
222
227
  minHeight?: string;
223
228
  textFontSize?: string;
224
229
  headerFontSize?: string;
230
+ extendedHeaders?: boolean;
231
+ extendedHeaders1Size?: string;
232
+ extendedHeaders2Size?: string;
233
+ extendedHeaders3Size?: string;
234
+ extendedHeaders4Size?: string;
225
235
  }
226
236
  export interface ContactForm {
227
237
  id: string;
@@ -248,7 +258,7 @@ export interface BookingRequest {
248
258
  export interface BookingRequestContent {
249
259
  endpoint: string;
250
260
  userID: string;
251
- acco: Acco;
261
+ accoID: string;
252
262
  calUrl: string;
253
263
  nameLabel: string;
254
264
  emailLabel: string;
@@ -263,21 +273,52 @@ export interface BookingRequestContent {
263
273
  explainer?: string;
264
274
  }
265
275
  export type Block = Text | Photo | PhotoGallery | Calendar | CalendarAvailable | CalendarGrid | CalendarRows | Pricing | PricingShort | AmenitiesCore | Weather | LeafletMap | AccoCard | AccoDescription | ContactForm | BookingRequest | undefined;
276
+ export interface Page {
277
+ id: string;
278
+ path: string;
279
+ nav?: Nav;
280
+ hero?: Hero;
281
+ title?: string;
282
+ slug?: string;
283
+ logoLink?: string;
284
+ header?: string;
285
+ showFooter?: boolean;
286
+ fixedHamburger?: boolean;
287
+ content?: Section[];
288
+ }
289
+ export interface NavItem {
290
+ key: string;
291
+ path?: string;
292
+ external?: boolean;
293
+ sub?: boolean;
294
+ }
295
+ export interface Nav {
296
+ main: NavItem[];
297
+ footer: NavItem[];
298
+ }
299
+ export interface Hero {
300
+ id: string;
301
+ title: string;
302
+ photoPath: string;
303
+ }
266
304
  export interface Section {
267
305
  id: string;
268
306
  header?: string;
269
307
  translatedHeader?: string;
270
308
  columnCount?: number;
271
309
  padding?: string;
310
+ maxWidth?: string;
272
311
  blocks?: Block[];
273
312
  }
274
313
  export interface I18nFacade {
275
314
  currentLang?: string;
315
+ supportedLangs?: string[];
276
316
  calendarTranslation?: I18n;
277
317
  translateFunc?: (ref: string) => string;
278
318
  formatFunc?: (formatter: string, props: Record<string, any>) => string;
279
319
  formatMoneyFunc?: (d: Dinero<number> | DineroSnapshot<number>) => string;
280
320
  formatDateFunc?: (d: DateTime | string) => string;
321
+ updateCurrentLang?: (lang: string) => void;
281
322
  }
282
323
  export declare const isAccoCard: (b: Block) => b is AccoCard;
283
324
  export declare const isText: (b: Block) => b is Text;
package/dist/types.js CHANGED
@@ -1,4 +1,10 @@
1
1
  import {} from 'dinero.js';
2
+ export const DEFAULT_TEXT_FONT_SIZE = '1rem';
3
+ export const DEFAULT_HEADERS_FONT_SIZE = '1.5rem';
4
+ export const DEFAULT_EXT_HEADERS_1_FONT_SIZE = '3.2rem';
5
+ export const DEFAULT_EXT_HEADERS_2_FONT_SIZE = '2.2rem';
6
+ export const DEFAULT_EXT_HEADERS_3_FONT_SIZE = '1.8rem';
7
+ export const DEFAULT_EXT_HEADERS_4_FONT_SIZE = '1.2rem';
2
8
  export const PRICING_COLUMNS = [
3
9
  'timeRange',
4
10
  'firstNight',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "accomadesc",
3
- "version": "0.1.1",
3
+ "version": "0.1.3",
4
4
  "scripts": {
5
5
  "dev": "vite dev",
6
6
  "build": "vite build && npm run package",
@@ -38,15 +38,15 @@
38
38
  },
39
39
  "devDependencies": {
40
40
  "@sveltejs/adapter-auto": "^3.3.1",
41
- "@sveltejs/kit": "^2.15.2",
41
+ "@sveltejs/kit": "^2.15.3",
42
42
  "@sveltejs/package": "^2.3.7",
43
43
  "@sveltejs/vite-plugin-svelte": "^5.0.3",
44
44
  "@types/luxon": "^3.4.2",
45
45
  "prettier": "^3.4.2",
46
- "prettier-plugin-svelte": "^3.3.2",
47
- "publint": "^0.3.1",
48
- "svelte": "^5.17.3",
49
- "svelte-check": "^4.1.3",
46
+ "prettier-plugin-svelte": "^3.3.3",
47
+ "publint": "^0.3.2",
48
+ "svelte": "^5.18.0",
49
+ "svelte-check": "^4.1.4",
50
50
  "typescript": "^5.7.3",
51
51
  "vite": "^6.0.7",
52
52
  "vitest": "^2.1.8"