accomadesc 0.4.18 → 0.4.21

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.
@@ -14,7 +14,7 @@
14
14
  </script>
15
15
 
16
16
  <header>
17
- <object title="logo" class="logo" data={logoLink}></object>
17
+ <img title="logo" class="logo" src={logoLink} alt="logo" />
18
18
  <div class="text-wrapper">
19
19
  <div class="header"><h1>{@html translateFunc ? translateFunc(title) : ''}</h1></div>
20
20
  {#if slug}
@@ -59,7 +59,7 @@
59
59
  color: var(--header-font-color);
60
60
  }
61
61
 
62
- object.logo {
62
+ img.logo {
63
63
  position: absolute;
64
64
  left: 0;
65
65
  top: 0;
@@ -85,7 +85,7 @@
85
85
  div.slug {
86
86
  display: none;
87
87
  }
88
- object.logo {
88
+ img.logo {
89
89
  width: 4.5rem;
90
90
  }
91
91
  div.header h1 {
@@ -100,7 +100,7 @@
100
100
  margin-right: 1rem;
101
101
  }
102
102
 
103
- object.logo {
103
+ img.logo {
104
104
  display: none;
105
105
  }
106
106
  div.header h1 {
@@ -1,11 +1,11 @@
1
1
  export const uiIcons = {
2
- moon: `
3
- <svg width="100%" height="100%" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
4
- <path d="M16 0.5C7.4375 0.5 0.5 7.4375 0.5 16C0.5 24.5625 7.4375 31.5 16 31.5C24.5625 31.5 31.5 24.5625 31.5 16C31.5 7.4375 24.5625 0.5 16 0.5ZM15.25 2C15.25 1.5875 15.5875 1.25 16 1.25C21.275 1.25 25.625 5.6 25.625 10.875C25.625 11.2875 25.2875 11.625 24.875 11.625H22.125C21.7125 11.625 21.375 11.2875 21.375 10.875C21.375 6.9375 18.0625 3.625 14.125 3.625C13.7125 3.625 13.375 3.2875 13.375 2.875C13.375 2.4625 13.7125 2.125 14.125 2H15.25ZM10.625 5.75C10.625 5.3375 10.9625 5 11.375 5H13.625C14.0375 5 14.375 5.3375 14.375 5.75C14.375 6.1625 14.0375 6.5 13.625 6.5H11.375C10.9625 6.5 10.625 6.1625 10.625 5.75ZM5 14.375C5 13.9625 5.3375 13.625 5.75 13.625H8C8.4125 13.625 8.75 13.9625 8.75 14.375C8.75 14.7875 8.4125 15.125 8 15.125H5.75C5.3375 15.125 5 14.7875 5 14.375ZM26.25 14.375C26.25 13.9625 26.5875 13.625 27 13.625H29.25C29.6625 13.625 30 13.9625 30 14.375C30 14.7875 29.6625 15.125 29.25 15.125H27C26.5875 15.125 26.25 14.7875 26.25 14.375ZM8.75 21.375C8.75 20.9625 9.0875 20.625 9.5 20.625H11.75C12.1625 20.625 12.5 20.9625 12.5 21.375C12.5 21.7875 12.1625 22.125 11.75 22.125H9.5C9.0875 22.125 8.75 21.7875 8.75 21.375ZM14.375 25.125C14.375 24.7125 14.7125 24.375 15.125 24.375H17.875C18.2875 24.375 18.625 24.7125 18.625 25.125C18.625 25.5375 18.2875 25.875 17.875 25.875H15.125C14.7125 25.875 14.375 25.5375 14.375 25.125Z" fill="{color}"/>
2
+ moon: `<svg xmlns="http://www.w3.org/2000/svg" width="100%" height="100%" viewBox="0 0 1024 1024">
3
+ <!-- Icon downloaded from https://icon-sets.iconify.design/ant-design/moon-outlined/ -->
4
+ <path fill="{color}" fill-rule="evenodd" d="M489.493 111.658c30.658-1.792 45.991 36.44 22.59 56.329C457.831 214.095 426 281.423 426 354c0 134.757 109.243 244 244 244c72.577 0 139.905-31.832 186.014-86.084c19.868-23.377 58.064-8.102 56.332 22.53C900.4 745.823 725.141 912 512.5 912C291.31 912 112 732.69 112 511.5c0-211.39 164.287-386.024 374.198-399.649l.206-.013zm-81.143 79.75l-4.112 1.362C271.1 237.943 176 364.092 176 511.5C176 697.344 326.656 848 512.5 848c148.28 0 274.938-96.192 319.453-230.41l.625-1.934l-.11.071c-47.18 29.331-102.126 45.755-159.723 46.26L670 662c-170.104 0-308-137.896-308-308c0-58.595 16.476-114.54 46.273-162.467z" />
5
5
  </svg>`,
6
- sun: `
7
- <svg width="100%" height="100%" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
8
- <path d="M16 0.5C7.4375 0.5 0.5 7.4375 0.5 16C0.5 24.5625 7.4375 31.5 16 31.5C24.5625 31.5 31.5 24.5625 31.5 16C31.5 7.4375 24.5625 0.5 16 0.5ZM14.125 2.875C13.7125 2.875 13.375 3.2125 13.375 3.625V5.875C13.375 6.2875 13.7125 6.625 14.125 6.625C14.5375 6.625 14.875 6.2875 14.875 5.875V3.625C14.875 3.2125 14.5375 2.875 14.125 2.875ZM5.75 8.75C5.3375 8.75 5 9.0875 5 9.5V11.75C5 12.1625 5.3375 12.5 5.75 12.5C6.1625 12.5 6.5 12.1625 6.5 11.75V9.5C6.5 9.0875 6.1625 8.75 5.75 8.75ZM2 16C2 15.5875 2.3375 15.25 2.75 15.25H5C5.4125 15.25 5.75 15.5875 5.75 16C5.75 16.4125 5.4125 16.75 5 16.75H2.75C2.3375 16.75 2 16.4125 2 16ZM26.25 15.25C26.6625 15.25 27 15.5875 27 16C27 16.4125 26.6625 16.75 26.25 16.75H24C23.5875 16.75 23.25 16.4125 23.25 16C23.25 15.5875 23.5875 15.25 24 15.25H26.25ZM8.75 19.375C8.75 18.9625 9.0875 18.625 9.5 18.625H11.75C12.1625 18.625 12.5 18.9625 12.5 19.375C12.5 19.7875 12.1625 20.125 11.75 20.125H9.5C9.0875 20.125 8.75 19.7875 8.75 19.375ZM14.875 25.375V27.625C14.875 28.0375 14.5375 28.375 14.125 28.375C13.7125 28.375 13.375 28.0375 13.375 27.625V25.375C13.375 24.9625 13.7125 24.625 14.125 24.625C14.5375 24.625 14.875 24.9625 14.875 25.375ZM22.125 12.5C22.5375 12.5 22.875 12.1625 22.875 11.75V9.5C22.875 9.0875 22.5375 8.75 22.125 8.75C21.7125 8.75 21.375 9.0875 21.375 9.5V11.75C21.375 12.1625 21.7125 12.5 22.125 12.5ZM16 22.125C12.6 22.125 9.875 19.4 9.875 16C9.875 12.6 12.6 9.875 16 9.875C19.4 9.875 22.125 12.6 22.125 16C22.125 19.4 19.4 22.125 16 22.125Z" fill="{color}"/>
6
+ sun: `<svg xmlns="http://www.w3.org/2000/svg" width="100%" height="100%" viewBox="0 0 1024 1024">
7
+ <!-- Icon downloaded from https://icon-sets.iconify.design/ant-design/sun-outlined/ -->
8
+ <path fill="{color}" fill-rule="evenodd" d="M548 818v126c0 8.837-7.163 16-16 16h-40c-8.837 0-16-7.163-16-16V818q23.768 2.464 36 2.464T548 818m205.251-115.66l89.096 89.095c6.248 6.248 6.248 16.38 0 22.627l-28.285 28.285c-6.248 6.248-16.379 6.248-22.627 0L702.34 753.25q18.548-15.064 27.198-23.713q8.649-8.65 23.713-27.198m-482.502 0q15.064 18.548 23.713 27.198q8.65 8.649 27.198 23.713l-89.095 89.096c-6.248 6.248-16.38 6.248-22.627 0l-28.285-28.285c-6.248-6.248-6.248-16.379 0-22.627zM512 278c129.235 0 234 104.765 234 234S641.235 746 512 746S278 641.235 278 512s104.765-234 234-234m0 72c-89.47 0-162 72.53-162 162s72.53 162 162 162s162-72.53 162-162s-72.53-162-162-162M206 476q-2.464 23.768-2.464 36T206 548H80c-8.837 0-16-7.163-16-16v-40c0-8.837 7.163-16 16-16zm738 0c8.837 0 16 7.163 16 16v40c0 8.837-7.163 16-16 16H818q2.464-23.768 2.464-36T818 476ZM814.062 180.653l28.285 28.285c6.248 6.248 6.248 16.379 0 22.627L753.25 320.66q-15.064-18.548-23.713-27.198q-8.65-8.649-27.198-23.713l89.095-89.096c6.248-6.248 16.38-6.248 22.627 0m-581.497 0l89.095 89.096q-18.548 15.064-27.198 23.713q-8.649 8.65-23.713 27.198l-89.096-89.095c-6.248-6.248-6.248-16.38 0-22.627l28.285-28.285c6.248-6.248 16.379-6.248 22.627 0M532 64c8.837 0 16 7.163 16 16v126q-23.768-2.464-36-2.464T476 206V80c0-8.837 7.163-16 16-16z" />
9
9
  </svg>`,
10
10
  close: `
11
11
  <svg width="100%" height="100%" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
@@ -40,4 +40,10 @@
40
40
  <Spinner />
41
41
  {/if}
42
42
 
43
- {@render children(av)}
43
+ {#if occupationState?.error}
44
+ <div class="occuplan-error">
45
+ <p>{occupationState.error}</p>
46
+ </div>
47
+ {:else}
48
+ {@render children(av)}
49
+ {/if}
@@ -164,6 +164,12 @@
164
164
  <Spinner />
165
165
  {/if}
166
166
 
167
+ {#if occupationState?.error}
168
+ <div class="occuplan-error">
169
+ <p>{occupationState.error}</p>
170
+ </div>
171
+ {/if}
172
+
167
173
  <section class="occuplan-wrapper" style="max-width: {maxWidth};">
168
174
  <header class="occupation-plan-header">
169
175
  <div class="header-controls">
@@ -380,4 +386,13 @@
380
386
  .header-controls {
381
387
  width: 2rem;
382
388
  }
389
+
390
+ .occuplan-error {
391
+ border: var(--occuplan-main-border);
392
+ border-radius: 0.5rem;
393
+ padding: 1rem;
394
+ color: var(--occuplan-main-font-color);
395
+ background-color: var(--occuplan-main-bg-color);
396
+ text-align: center;
397
+ }
383
398
  </style>
@@ -220,6 +220,12 @@
220
220
  <Spinner />
221
221
  {/if}
222
222
 
223
+ {#if occupationState?.error}
224
+ <div class="occuplan-error">
225
+ <p>{occupationState.error}</p>
226
+ </div>
227
+ {/if}
228
+
223
229
  <div class="wrapper">
224
230
  <section class="occuplan-wrapper" style="max-width: {maxWidth}; width: 100%;">
225
231
  <header class="occupation-plan-header">
@@ -581,4 +587,13 @@
581
587
  background-color: var(--occupation-type-2-bg-color);
582
588
  color: var(--occupation-type-font-bg-color);
583
589
  }
590
+
591
+ .occuplan-error {
592
+ border: var(--occuplan-main-border);
593
+ border-radius: 0.5rem;
594
+ padding: 1rem;
595
+ color: var(--occuplan-main-font-color);
596
+ background-color: var(--occuplan-main-bg-color);
597
+ text-align: center;
598
+ }
584
599
  </style>
@@ -146,6 +146,12 @@
146
146
  <Spinner />
147
147
  {/if}
148
148
 
149
+ {#if occupationState?.error}
150
+ <div class="occuplan-error">
151
+ <p>{occupationState.error}</p>
152
+ </div>
153
+ {/if}
154
+
149
155
  <section class="occuplan-wrapper" style="max-width: {maxWidth};">
150
156
  <header class="occupation-plan-header">
151
157
  <div class="header-controls">
@@ -373,4 +379,13 @@
373
379
  font-size: clamp(1rem, 55cqh, 2rem);
374
380
  }
375
381
  }
382
+
383
+ .occuplan-error {
384
+ border: var(--occuplan-main-border);
385
+ border-radius: 0.5rem;
386
+ padding: 1rem;
387
+ color: var(--occuplan-main-font-color);
388
+ background-color: var(--occuplan-main-bg-color);
389
+ text-align: center;
390
+ }
376
391
  </style>
@@ -72,6 +72,7 @@ export declare class OccupationState {
72
72
  occupiedDays: Record<string, boolean>;
73
73
  occupations: Occupation[];
74
74
  loading: boolean;
75
+ error: string;
75
76
  debug: boolean;
76
77
  constructor(iniFn: () => {
77
78
  iCalURL: string;
@@ -196,6 +196,7 @@ export class OccupationState {
196
196
  occupiedDays = $state({});
197
197
  occupations = $state([]);
198
198
  loading = $state(false);
199
+ error = $state('');
199
200
  debug = $state(false);
200
201
  constructor(iniFn) {
201
202
  const data = iniFn();
@@ -209,11 +210,18 @@ export class OccupationState {
209
210
  if (this.debug)
210
211
  console.log('(Re)Loading Occupations');
211
212
  this.loading = true;
213
+ this.error = '';
212
214
  if (this.iCalURL) {
213
215
  const eventsResult = await getEvents(this.iCalURL, this.eventsIncomingCallback);
214
216
  this.loading = false;
215
- return !eventsResult.error;
217
+ if (eventsResult.error) {
218
+ this.error = eventsResult.message || 'Failed to load calendar data';
219
+ return false;
220
+ }
221
+ return true;
216
222
  }
223
+ this.loading = false;
224
+ this.error = 'No calendar URL configured';
217
225
  return false;
218
226
  };
219
227
  eventsIncomingCallback = (o) => {
package/package.json CHANGED
@@ -1,58 +1,58 @@
1
1
  {
2
2
  "name": "accomadesc",
3
- "version": "0.4.18",
3
+ "version": "0.4.21",
4
+ "license": "MIT",
4
5
  "files": [
5
6
  "dist",
6
7
  "!dist/**/*.test.*",
7
8
  "!dist/**/*.spec.*"
8
9
  ],
10
+ "type": "module",
9
11
  "sideEffects": [
10
12
  "**/*.css"
11
13
  ],
12
- "license": "MIT",
13
- "svelte": "./dist/index.js",
14
14
  "types": "./dist/index.d.ts",
15
- "type": "module",
15
+ "svelte": "./dist/index.js",
16
16
  "exports": {
17
17
  ".": {
18
18
  "types": "./dist/index.d.ts",
19
19
  "svelte": "./dist/index.js"
20
20
  }
21
21
  },
22
- "peerDependencies": {
23
- "@sveltejs/kit": "^2.15.2",
24
- "svelte": "^5.0.0"
22
+ "dependencies": {
23
+ "@fontsource/raleway": "^5.3.0",
24
+ "@twicpics/components": "^0.33.0",
25
+ "@types/leaflet": "^1.9.22",
26
+ "leaflet": "^1.9.4",
27
+ "luxon": "^3.7.2"
25
28
  },
26
29
  "devDependencies": {
27
- "@playwright/test": "^1.60.0",
30
+ "@playwright/test": "^1.63.0",
28
31
  "@sveltejs/adapter-auto": "^7.0.1",
29
32
  "@sveltejs/adapter-static": "^3.0.10",
30
- "@sveltejs/kit": "^2.63.0",
33
+ "@sveltejs/kit": "^2.70.3",
31
34
  "@sveltejs/package": "^2.5.8",
32
- "@sveltejs/vite-plugin-svelte": "^7.1.2",
33
- "@testing-library/dom": "^10.4.1",
34
- "@testing-library/jest-dom": "^6.9.1",
35
- "@testing-library/svelte": "^5.3.1",
36
- "@types/luxon": "^3.7.1",
37
- "@types/node": "^25.9.1",
38
- "@vitest/ui": "^4.1.8",
35
+ "@sveltejs/vite-plugin-svelte": "^7.3.0",
36
+ "@testing-library/dom": "^10.4.2",
37
+ "@testing-library/jest-dom": "^7.0.1",
38
+ "@testing-library/svelte": "^5.4.2",
39
+ "@types/luxon": "^3.7.5",
40
+ "@types/node": "^26.6.1",
41
+ "@vitest/ui": "^5.0.1",
39
42
  "gdpr-cooco-banner": "^0.0.13",
40
- "jsdom": "^29.1.1",
41
- "prettier": "^3.8.3",
42
- "prettier-plugin-svelte": "^4.1.0",
43
- "publint": "^0.3.21",
44
- "svelte": "^5.56.1",
45
- "svelte-check": "^4.6.0",
46
- "typescript": "^6.0.3",
47
- "vite": "^8.0.16",
48
- "vitest": "^4.1.8"
43
+ "jsdom": "^30.0.1",
44
+ "prettier": "^3.9.7",
45
+ "prettier-plugin-svelte": "^4.1.1",
46
+ "publint": "^0.3.24",
47
+ "svelte": "^5.57.0",
48
+ "svelte-check": "^4.7.6",
49
+ "typescript": "6",
50
+ "vite": "^8.3.0",
51
+ "vitest": "^5.0.1"
49
52
  },
50
- "dependencies": {
51
- "@fontsource/raleway": "^5.2.8",
52
- "@twicpics/components": "^0.33.0",
53
- "@types/leaflet": "^1.9.21",
54
- "leaflet": "^1.9.4",
55
- "luxon": "^3.7.2"
53
+ "peerDependencies": {
54
+ "@sveltejs/kit": "^2.15.2",
55
+ "svelte": "^5.0.0"
56
56
  },
57
57
  "scripts": {
58
58
  "dev": "vite dev",