@dealsystem/site 0.0.0-stage → 0.2.1
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/README.md +145 -2
- package/agent-files/claude/skills/angebote-einbauen/SKILL.md +30 -0
- package/agent-files/claude/skills/bild-einbauen/SKILL.md +43 -0
- package/agent-files/claude/skills/domain-verbinden/SKILL.md +23 -0
- package/agent-files/claude/skills/erster-entwurf/SKILL.md +54 -0
- package/agent-files/claude/skills/extern-einbinden/SKILL.md +37 -0
- package/agent-files/claude/skills/formular-anbinden/SKILL.md +34 -0
- package/agent-files/claude/skills/funnel-mehrstufig/BewertungFunnel.svelte +220 -0
- package/agent-files/claude/skills/funnel-mehrstufig/SKILL.md +101 -0
- package/agent-files/claude/skills/neue-seite/SKILL.md +47 -0
- package/agent-files/claude/skills/prueffehler-beheben/SKILL.md +31 -0
- package/agent-files/claude/skills/termin-buchung/SKILL.md +51 -0
- package/agent-files/claude/skills/veroeffentlichen/SKILL.md +38 -0
- package/agent-files/cursor/rules/dealsystem.mdc +7 -0
- package/agent-files/manifest.json +101 -0
- package/contract/README.md +41 -0
- package/contract/ds-content.v1.json +2355 -0
- package/contract/external-presets.v1.json +65 -0
- package/contract/funnel-code-config.md +87 -0
- package/contract/site-api.v1.json +3916 -0
- package/dist/client/altcha-workers.d.ts +10 -0
- package/dist/client/attribution.d.ts +119 -0
- package/dist/client/attribution.js +341 -0
- package/dist/client/bookingClient.svelte.d.ts +166 -0
- package/dist/client/bookingClient.svelte.js +369 -0
- package/dist/client/bookingTime.d.ts +46 -0
- package/dist/client/bookingTime.js +109 -0
- package/dist/client/captcha.d.ts +26 -0
- package/dist/client/captcha.js +71 -0
- package/dist/client/captchaSession.d.ts +21 -0
- package/dist/client/captchaSession.js +105 -0
- package/dist/client/collections.d.ts +34 -0
- package/dist/client/collections.js +40 -0
- package/dist/client/externalScript.d.ts +20 -0
- package/dist/client/externalScript.js +36 -0
- package/dist/client/funnelState.svelte.d.ts +47 -0
- package/dist/client/funnelState.svelte.js +81 -0
- package/dist/client/leadClient.svelte.d.ts +131 -0
- package/dist/client/leadClient.svelte.js +250 -0
- package/dist/client/pageview.d.ts +7 -0
- package/dist/client/pageview.js +44 -0
- package/dist/client/siteApi.d.ts +211 -0
- package/dist/client/siteApi.js +320 -0
- package/dist/client/tracking.d.ts +18 -0
- package/dist/client/tracking.js +93 -0
- package/dist/client/validation.d.ts +10 -0
- package/dist/client/validation.js +66 -0
- package/dist/components/Booker.svelte +729 -0
- package/dist/components/Booker.svelte.d.ts +42 -0
- package/dist/components/CollectionList.svelte +122 -0
- package/dist/components/CollectionList.svelte.d.ts +65 -0
- package/dist/components/ConsentGate.svelte +68 -0
- package/dist/components/ConsentGate.svelte.d.ts +44 -0
- package/dist/components/CookieBanner.svelte +303 -0
- package/dist/components/CookieBanner.svelte.d.ts +29 -0
- package/dist/components/Datenschutz.svelte +84 -0
- package/dist/components/Datenschutz.svelte.d.ts +26 -0
- package/dist/components/Embed.svelte +263 -0
- package/dist/components/Embed.svelte.d.ts +41 -0
- package/dist/components/ExternalScript.svelte +94 -0
- package/dist/components/ExternalScript.svelte.d.ts +41 -0
- package/dist/components/Impressum.svelte +59 -0
- package/dist/components/Impressum.svelte.d.ts +25 -0
- package/dist/components/LeadForm.svelte +475 -0
- package/dist/components/LeadForm.svelte.d.ts +35 -0
- package/dist/components/LeadHoneypot.svelte +43 -0
- package/dist/components/LeadHoneypot.svelte.d.ts +18 -0
- package/dist/components/Link.svelte +48 -0
- package/dist/components/Link.svelte.d.ts +30 -0
- package/dist/components/MapEmbed.svelte +154 -0
- package/dist/components/MapEmbed.svelte.d.ts +28 -0
- package/dist/components/MediaImage.svelte +218 -0
- package/dist/components/MediaImage.svelte.d.ts +128 -0
- package/dist/components/MediaVideo.svelte +103 -0
- package/dist/components/MediaVideo.svelte.d.ts +20 -0
- package/dist/components/RichText.svelte +105 -0
- package/dist/components/RichText.svelte.d.ts +55 -0
- package/dist/components/Seo.svelte +89 -0
- package/dist/components/Seo.svelte.d.ts +45 -0
- package/dist/components/SiteFooterLegal.svelte +75 -0
- package/dist/components/SiteFooterLegal.svelte.d.ts +22 -0
- package/dist/components/SiteHead.svelte +79 -0
- package/dist/components/SiteHead.svelte.d.ts +32 -0
- package/dist/components/Text.svelte +100 -0
- package/dist/components/Text.svelte.d.ts +55 -0
- package/dist/components/Tracking.svelte +30 -0
- package/dist/components/Tracking.svelte.d.ts +14 -0
- package/dist/components/Zeitfenster.svelte +92 -0
- package/dist/components/Zeitfenster.svelte.d.ts +34 -0
- package/dist/components/legal.d.ts +12 -0
- package/dist/components/legal.js +27 -0
- package/dist/config/index.d.ts +121 -0
- package/dist/config/index.js +602 -0
- package/dist/config/static/index.d.ts +3 -0
- package/dist/config/static/index.js +5 -0
- package/dist/config/static/lines.d.ts +9 -0
- package/dist/config/static/lines.js +22 -0
- package/dist/config/static/literal.d.ts +45 -0
- package/dist/config/static/literal.js +175 -0
- package/dist/config/static/siteConfig.d.ts +39 -0
- package/dist/config/static/siteConfig.js +150 -0
- package/dist/consent/consent.svelte.d.ts +91 -0
- package/dist/consent/consent.svelte.js +221 -0
- package/dist/content/index.d.ts +123 -0
- package/dist/content/index.js +247 -0
- package/dist/contentBlock.d.ts +45 -0
- package/dist/contentBlock.js +78 -0
- package/dist/csp/index.d.ts +27 -0
- package/dist/csp/index.js +74 -0
- package/dist/external/csp.d.ts +25 -0
- package/dist/external/csp.js +104 -0
- package/dist/external/hosts.d.ts +30 -0
- package/dist/external/hosts.js +128 -0
- package/dist/external/presets.d.ts +54 -0
- package/dist/external/presets.js +212 -0
- package/dist/external/resolve.d.ts +39 -0
- package/dist/external/resolve.js +254 -0
- package/dist/index.d.ts +32 -0
- package/dist/index.js +32 -0
- package/dist/internal/consentNeed.d.ts +21 -0
- package/dist/internal/consentNeed.js +50 -0
- package/dist/internal/dealsystem-legal-imprint.d.ts +2 -0
- package/dist/internal/dealsystem-legal-imprint.js +5 -0
- package/dist/internal/dealsystem-legal-privacy.d.ts +2 -0
- package/dist/internal/dealsystem-legal-privacy.js +5 -0
- package/dist/internal/dealsystem-site-data.d.ts +3 -0
- package/dist/internal/dealsystem-site-data.js +2 -0
- package/dist/internal/imprint.d.ts +4 -0
- package/dist/internal/imprint.js +10 -0
- package/dist/internal/mediaImage.d.ts +15 -0
- package/dist/internal/mediaImage.js +22 -0
- package/dist/internal/privacy.d.ts +4 -0
- package/dist/internal/privacy.js +10 -0
- package/dist/internal/providers.d.ts +9 -0
- package/dist/internal/providers.js +44 -0
- package/dist/internal/reload.d.ts +2 -0
- package/dist/internal/reload.js +5 -0
- package/dist/internal/seo.d.ts +41 -0
- package/dist/internal/seo.js +79 -0
- package/dist/internal/siteData.d.ts +7 -0
- package/dist/internal/siteData.js +39 -0
- package/dist/internal/usage.d.ts +7 -0
- package/dist/internal/usage.js +13 -0
- package/dist/keys.d.ts +20 -0
- package/dist/keys.js +58 -0
- package/dist/leadmagnet.d.ts +16 -0
- package/dist/leadmagnet.js +28 -0
- package/dist/paths.d.ts +8 -0
- package/dist/paths.js +9 -0
- package/dist/richtext/escape.d.ts +4 -0
- package/dist/richtext/escape.js +18 -0
- package/dist/richtext/server.d.ts +16 -0
- package/dist/richtext/server.js +123 -0
- package/dist/schedule.d.ts +23 -0
- package/dist/schedule.js +67 -0
- package/dist/slots.d.ts +9 -0
- package/dist/slots.js +38 -0
- package/dist/snapshot.d.ts +14 -0
- package/dist/snapshot.js +214 -0
- package/dist/types.d.ts +550 -0
- package/dist/types.js +4 -0
- package/dist/version.d.ts +2 -0
- package/dist/version.js +2 -0
- package/dist/vite/index.d.ts +85 -0
- package/dist/vite/index.js +641 -0
- package/dist/vite/scan.d.ts +47 -0
- package/dist/vite/scan.js +355 -0
- package/dist/vite/zeitfenster.d.ts +18 -0
- package/dist/vite/zeitfenster.js +76 -0
- package/docs/ablauf.md +191 -0
- package/docs/agents-block.md +101 -0
- package/docs/befehle.md +103 -0
- package/docs/extern.md +143 -0
- package/docs/gestaltung.md +139 -0
- package/docs/inhalte.md +224 -0
- package/docs/komponenten.md +1273 -0
- package/docs/konfiguration.md +310 -0
- package/docs/llms.txt +19 -0
- package/docs/rechtstexte.md +84 -0
- package/docs/regeln.md +108 -0
- package/docs/seo.md +55 -0
- package/docs/termine.md +73 -0
- package/package.json +115 -5
|
@@ -0,0 +1,212 @@
|
|
|
1
|
+
// Vorlagen für fremde Dienste: von DealSystem gepflegt und geprüft. Eine Vorlage legt Kategorie, Anbieter,
|
|
2
|
+
// Zweck, Datenschutz-Link, Hosts und die Einstellungen des iframes fest. Neue Vorlagen nur nach Prüfung:
|
|
3
|
+
// kein Laden vor der Einwilligung, kein Bedarf an `unsafe-eval`, Hosts so eng wie möglich.
|
|
4
|
+
//
|
|
5
|
+
// Auch Nocookie-Modus und `dnt=1` ersetzen die Einwilligung nicht (Konzept Phase 2, Abschnitt 4): Alle
|
|
6
|
+
// Vorlagen laden erst nach „Externe Inhalte“ (`media`).
|
|
7
|
+
import { EXTERNAL_DIRECTIVES } from './hosts.js';
|
|
8
|
+
const VIDEO_EMBED = {
|
|
9
|
+
sandbox: 'allow-scripts allow-same-origin allow-presentation allow-popups allow-popups-to-escape-sandbox',
|
|
10
|
+
allow: 'accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share',
|
|
11
|
+
allowFullscreen: true,
|
|
12
|
+
// YouTube spielt ohne Referrer nicht ab (Fehler 153).
|
|
13
|
+
referrerPolicy: 'strict-origin-when-cross-origin',
|
|
14
|
+
aspect: '16 / 9',
|
|
15
|
+
height: null,
|
|
16
|
+
};
|
|
17
|
+
const YOUTUBE_ID = /^[A-Za-z0-9_-]{11}$/;
|
|
18
|
+
const YOUTUBE_HOSTS = [
|
|
19
|
+
'youtube.com',
|
|
20
|
+
'www.youtube.com',
|
|
21
|
+
'm.youtube.com',
|
|
22
|
+
'youtube-nocookie.com',
|
|
23
|
+
'www.youtube-nocookie.com',
|
|
24
|
+
];
|
|
25
|
+
const YOUTUBE_PARAMS = [
|
|
26
|
+
'start',
|
|
27
|
+
'end',
|
|
28
|
+
'list',
|
|
29
|
+
'loop',
|
|
30
|
+
'playlist',
|
|
31
|
+
'rel',
|
|
32
|
+
'controls',
|
|
33
|
+
'cc_load_policy',
|
|
34
|
+
'hl',
|
|
35
|
+
];
|
|
36
|
+
function youtubeSeconds(value) {
|
|
37
|
+
if (!value)
|
|
38
|
+
return null;
|
|
39
|
+
if (/^\d+$/.test(value))
|
|
40
|
+
return value;
|
|
41
|
+
const m = /^(?:(\d+)h)?(?:(\d+)m)?(?:(\d+)s)?$/.exec(value);
|
|
42
|
+
if (!m || (!m[1] && !m[2] && !m[3]))
|
|
43
|
+
return null;
|
|
44
|
+
return String(Number(m[1] ?? 0) * 3600 + Number(m[2] ?? 0) * 60 + Number(m[3] ?? 0));
|
|
45
|
+
}
|
|
46
|
+
function normalizeYoutube(url) {
|
|
47
|
+
const host = url.hostname.toLowerCase();
|
|
48
|
+
const parts = url.pathname.split('/').filter(Boolean);
|
|
49
|
+
let id = null;
|
|
50
|
+
if (host === 'youtu.be')
|
|
51
|
+
id = parts[0] ?? null;
|
|
52
|
+
else if (YOUTUBE_HOSTS.includes(host)) {
|
|
53
|
+
if (parts[0] === 'watch')
|
|
54
|
+
id = url.searchParams.get('v');
|
|
55
|
+
else if (['embed', 'shorts', 'live', 'v'].includes(parts[0] ?? ''))
|
|
56
|
+
id = parts[1] ?? null;
|
|
57
|
+
}
|
|
58
|
+
if (!id || (id !== 'videoseries' && !YOUTUBE_ID.test(id)))
|
|
59
|
+
return null;
|
|
60
|
+
if (id === 'videoseries' && !url.searchParams.get('list'))
|
|
61
|
+
return null;
|
|
62
|
+
const out = new URL(`https://www.youtube-nocookie.com/embed/${id}`);
|
|
63
|
+
for (const key of YOUTUBE_PARAMS) {
|
|
64
|
+
const value = url.searchParams.get(key);
|
|
65
|
+
if (value && /^[A-Za-z0-9_,-]{1,64}$/.test(value))
|
|
66
|
+
out.searchParams.set(key, value);
|
|
67
|
+
}
|
|
68
|
+
const t = youtubeSeconds(url.searchParams.get('t'));
|
|
69
|
+
if (t && !out.searchParams.has('start'))
|
|
70
|
+
out.searchParams.set('start', t);
|
|
71
|
+
return out.href;
|
|
72
|
+
}
|
|
73
|
+
function normalizeVimeo(url) {
|
|
74
|
+
const host = url.hostname.toLowerCase();
|
|
75
|
+
const parts = url.pathname.split('/').filter(Boolean);
|
|
76
|
+
let id;
|
|
77
|
+
let hash = url.searchParams.get('h');
|
|
78
|
+
if (host === 'player.vimeo.com' && parts[0] === 'video')
|
|
79
|
+
id = parts[1];
|
|
80
|
+
else if (host === 'vimeo.com' || host === 'www.vimeo.com') {
|
|
81
|
+
id = parts[0];
|
|
82
|
+
if (parts[1] && /^[0-9a-f]{6,20}$/.test(parts[1]))
|
|
83
|
+
hash = parts[1];
|
|
84
|
+
}
|
|
85
|
+
if (!id || !/^\d{1,12}$/.test(id))
|
|
86
|
+
return null;
|
|
87
|
+
const out = new URL(`https://player.vimeo.com/video/${id}`);
|
|
88
|
+
if (hash && /^[0-9a-f]{6,20}$/.test(hash))
|
|
89
|
+
out.searchParams.set('h', hash);
|
|
90
|
+
// Vimeo erfasst mit dnt=1 keine Sitzungsdaten; die Einwilligung ersetzt das nicht.
|
|
91
|
+
out.searchParams.set('dnt', '1');
|
|
92
|
+
return out.href;
|
|
93
|
+
}
|
|
94
|
+
export const PRESETS = {
|
|
95
|
+
youtube: {
|
|
96
|
+
category: 'media',
|
|
97
|
+
provider: 'Google Ireland Limited, Irland (YouTube)',
|
|
98
|
+
purpose: 'Zeigt eingebettete Videos von YouTube.',
|
|
99
|
+
privacyUrl: 'https://policies.google.com/privacy',
|
|
100
|
+
hosts: { frame: ['https://www.youtube-nocookie.com'] },
|
|
101
|
+
embed: { ...VIDEO_EMBED, loadLabel: 'Video laden', noun: 'Das Video' },
|
|
102
|
+
normalize: normalizeYoutube,
|
|
103
|
+
original: (src) => {
|
|
104
|
+
const id = src.pathname.split('/').filter(Boolean)[1] ?? '';
|
|
105
|
+
const list = src.searchParams.get('list');
|
|
106
|
+
return id === 'videoseries' && list
|
|
107
|
+
? `https://www.youtube.com/playlist?list=${encodeURIComponent(list)}`
|
|
108
|
+
: `https://www.youtube.com/watch?v=${encodeURIComponent(id)}`;
|
|
109
|
+
},
|
|
110
|
+
},
|
|
111
|
+
vimeo: {
|
|
112
|
+
category: 'media',
|
|
113
|
+
provider: 'Vimeo.com, Inc., USA',
|
|
114
|
+
purpose: 'Zeigt eingebettete Videos von Vimeo.',
|
|
115
|
+
privacyUrl: 'https://vimeo.com/privacy',
|
|
116
|
+
hosts: { frame: ['https://player.vimeo.com'] },
|
|
117
|
+
embed: {
|
|
118
|
+
...VIDEO_EMBED,
|
|
119
|
+
allow: 'autoplay; fullscreen; picture-in-picture; clipboard-write',
|
|
120
|
+
loadLabel: 'Video laden',
|
|
121
|
+
noun: 'Das Video',
|
|
122
|
+
},
|
|
123
|
+
normalize: normalizeVimeo,
|
|
124
|
+
original: (src) => `https://vimeo.com/${src.pathname.split('/').filter(Boolean)[1] ?? ''}`,
|
|
125
|
+
},
|
|
126
|
+
'google-maps': {
|
|
127
|
+
category: 'media',
|
|
128
|
+
provider: 'Google Ireland Limited, Irland (Google Maps)',
|
|
129
|
+
purpose: 'Zeigt eine Karte von Google Maps.',
|
|
130
|
+
privacyUrl: 'https://policies.google.com/privacy',
|
|
131
|
+
hosts: { frame: ['https://www.google.com'] },
|
|
132
|
+
embed: {
|
|
133
|
+
sandbox: 'allow-scripts allow-same-origin allow-popups allow-popups-to-escape-sandbox',
|
|
134
|
+
allow: 'fullscreen',
|
|
135
|
+
allowFullscreen: true,
|
|
136
|
+
referrerPolicy: 'strict-origin-when-cross-origin',
|
|
137
|
+
loadLabel: 'Karte laden',
|
|
138
|
+
noun: 'Die Karte',
|
|
139
|
+
aspect: '4 / 3',
|
|
140
|
+
height: null,
|
|
141
|
+
},
|
|
142
|
+
// Nur die Adresse aus „Teilen → Karte einbetten“ (ohne API-Schlüssel).
|
|
143
|
+
normalize: (url) => url.hostname === 'www.google.com' && url.pathname === '/maps/embed' && url.searchParams.has('pb')
|
|
144
|
+
? `https://www.google.com/maps/embed?pb=${encodeURIComponent(url.searchParams.get('pb') ?? '')}`
|
|
145
|
+
: null,
|
|
146
|
+
original: () => 'https://www.google.com/maps',
|
|
147
|
+
},
|
|
148
|
+
calendly: {
|
|
149
|
+
category: 'media',
|
|
150
|
+
provider: 'Calendly LLC, USA',
|
|
151
|
+
purpose: 'Zeigt die Terminbuchung von Calendly.',
|
|
152
|
+
privacyUrl: 'https://calendly.com/privacy',
|
|
153
|
+
hosts: { frame: ['https://calendly.com'] },
|
|
154
|
+
embed: {
|
|
155
|
+
sandbox: 'allow-scripts allow-same-origin allow-forms allow-popups allow-popups-to-escape-sandbox',
|
|
156
|
+
allow: 'payment',
|
|
157
|
+
allowFullscreen: false,
|
|
158
|
+
referrerPolicy: 'strict-origin-when-cross-origin',
|
|
159
|
+
loadLabel: 'Terminbuchung laden',
|
|
160
|
+
noun: 'Die Terminbuchung',
|
|
161
|
+
aspect: null,
|
|
162
|
+
height: '700px',
|
|
163
|
+
},
|
|
164
|
+
normalize: (url) => {
|
|
165
|
+
if (url.hostname !== 'calendly.com')
|
|
166
|
+
return null;
|
|
167
|
+
const parts = url.pathname.split('/').filter(Boolean);
|
|
168
|
+
if (parts.length < 1 || parts.length > 2 || !parts.every((p) => /^[A-Za-z0-9_-]{1,100}$/.test(p)))
|
|
169
|
+
return null;
|
|
170
|
+
const out = new URL(`https://calendly.com/${parts.join('/')}`);
|
|
171
|
+
out.searchParams.set('embed_type', 'Inline');
|
|
172
|
+
// Den eigenen Hinweis von Calendly braucht es nicht: Eingewilligt ist schon.
|
|
173
|
+
out.searchParams.set('hide_gdpr_banner', '1');
|
|
174
|
+
return out.href;
|
|
175
|
+
},
|
|
176
|
+
original: (src) => `https://calendly.com${src.pathname}`,
|
|
177
|
+
},
|
|
178
|
+
};
|
|
179
|
+
/** Einstellungen für einen eigenen Dienst mit `frame`-Hosts (kein Preset). */
|
|
180
|
+
export const CUSTOM_EMBED = {
|
|
181
|
+
sandbox: 'allow-scripts allow-same-origin allow-forms allow-popups allow-popups-to-escape-sandbox',
|
|
182
|
+
allow: '',
|
|
183
|
+
allowFullscreen: false,
|
|
184
|
+
referrerPolicy: 'strict-origin-when-cross-origin',
|
|
185
|
+
loadLabel: 'Inhalt laden',
|
|
186
|
+
noun: 'Der Inhalt',
|
|
187
|
+
aspect: '16 / 9',
|
|
188
|
+
height: null,
|
|
189
|
+
};
|
|
190
|
+
export const PRESET_NAMES = Object.keys(PRESETS);
|
|
191
|
+
export function isPreset(value) {
|
|
192
|
+
return typeof value === 'string' && PRESET_NAMES.includes(value);
|
|
193
|
+
}
|
|
194
|
+
/** Fassung von `contract/external-presets.v1.json`. */
|
|
195
|
+
export const EXTERNAL_PRESETS_CONTRACT_VERSION = 1;
|
|
196
|
+
/**
|
|
197
|
+
* Inhalt von `contract/external-presets.v1.json`, aus `PRESETS` erzeugt. Der Core hält eine byte-gleiche Kopie und
|
|
198
|
+
* prüft seine Vorlagen dagegen: Ein Manifest-Eintrag zählt dort nur als Vorlage, wenn er genau diese Hosts trägt.
|
|
199
|
+
*/
|
|
200
|
+
export function externalPresetsContract() {
|
|
201
|
+
const presets = {};
|
|
202
|
+
for (const name of [...PRESET_NAMES].sort()) {
|
|
203
|
+
const preset = PRESETS[name];
|
|
204
|
+
const hosts = Object.fromEntries(EXTERNAL_DIRECTIVES.map((d) => [d, [...new Set(preset.hosts[d] ?? [])].sort()]));
|
|
205
|
+
presets[name] = { category: preset.category, provider: preset.provider, hosts };
|
|
206
|
+
}
|
|
207
|
+
return { version: EXTERNAL_PRESETS_CONTRACT_VERSION, presets };
|
|
208
|
+
}
|
|
209
|
+
/** Text der Vertragsdatei (JSON mit Tabulator, Zeilenende am Schluss). */
|
|
210
|
+
export function externalPresetsContractText() {
|
|
211
|
+
return `${JSON.stringify(externalPresetsContract(), null, '\t')}\n`;
|
|
212
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import type { ExternalCategory, ExternalDef, ExternalDirective, ResolvedExternal } from '../types.js';
|
|
2
|
+
import { type EmbedSettings } from './presets.js';
|
|
3
|
+
export declare const EXTERNAL_CATEGORIES: readonly ExternalCategory[];
|
|
4
|
+
/** Höchstlänge von Anbieter und Zweck (steht im Cookie-Hinweis). */
|
|
5
|
+
export declare const EXTERNAL_TEXT_MAX = 200;
|
|
6
|
+
/** Ein Problem in `external`; `path` wie bei `validateSiteConfig`, z. B. `external.chat.script[0]`. */
|
|
7
|
+
export interface ExternalProblem {
|
|
8
|
+
path: string;
|
|
9
|
+
message: string;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Prüft `external`. Leere Liste heißt gültig. Wird von `validateSiteConfig` aufgerufen; die Meldungen
|
|
13
|
+
* landen in `dealsystem check` unter SEC-005, weil sie die Sicherheitsregeln der Seite bestimmen.
|
|
14
|
+
*/
|
|
15
|
+
export declare function validateExternal(external: unknown): ExternalProblem[];
|
|
16
|
+
/**
|
|
17
|
+
* Löst die Vorlagen auf und bringt jeden Eintrag in eine feste Form (alle Direktiven, sortiert). Nach `id`
|
|
18
|
+
* sortiert. Erwartet eine gültige Konfiguration; ungültige Einträge werden übersprungen.
|
|
19
|
+
*/
|
|
20
|
+
export declare function resolveExternal(external: Readonly<Record<string, ExternalDef>> | undefined): ResolvedExternal[];
|
|
21
|
+
/** Ergebnis für `<Embed>`: fertige Adresse des iframes oder der Grund, warum sie nicht passt. */
|
|
22
|
+
export type EmbedSource = {
|
|
23
|
+
ok: true;
|
|
24
|
+
src: string;
|
|
25
|
+
original: string;
|
|
26
|
+
settings: EmbedSettings;
|
|
27
|
+
} | {
|
|
28
|
+
ok: false;
|
|
29
|
+
message: string;
|
|
30
|
+
};
|
|
31
|
+
/**
|
|
32
|
+
* Prüft die Adresse eines `<Embed>` gegen die Deklaration. Bei einer Vorlage wird eine kopierte Adresse
|
|
33
|
+
* (z. B. `https://www.youtube.com/watch?v=…`) in die Form der Einbettung gebracht.
|
|
34
|
+
*/
|
|
35
|
+
export declare function resolveEmbedSource(entry: ResolvedExternal, src: string): EmbedSource;
|
|
36
|
+
/** Prüft die Adresse eines `<ExternalScript>`: eigener Pfad aus `static/` oder ein `script`-Host der Deklaration. */
|
|
37
|
+
export declare function scriptSourceProblem(entry: ResolvedExternal, src: string): string | null;
|
|
38
|
+
/** Direktiven, die ein Eintrag öffnet, für Meldungen. */
|
|
39
|
+
export declare function directivesOf(entry: ResolvedExternal): ExternalDirective[];
|
|
@@ -0,0 +1,254 @@
|
|
|
1
|
+
// `external` aus dealsystem.config.ts: prüfen, Vorlagen auflösen, Adressen der Bausteine gegen die Deklaration
|
|
2
|
+
// abgleichen. Läuft im Build (Vite-Plugin, svelte.config.js), in `dealsystem check` und im Browser.
|
|
3
|
+
import { KEBAB_KEY_MAX_LENGTH, KEBAB_KEY_PATTERN } from '../keys.js';
|
|
4
|
+
import { EXTERNAL_DIRECTIVES, externalUrl, hostSourceMatches, hostSourceProblem, isLocalPath, MAX_EXTERNAL_ENTRIES, MAX_HOSTS_PER_DIRECTIVE, } from './hosts.js';
|
|
5
|
+
import { CUSTOM_EMBED, isPreset, PRESET_NAMES, PRESETS } from './presets.js';
|
|
6
|
+
export const EXTERNAL_CATEGORIES = ['statistics', 'marketing', 'media'];
|
|
7
|
+
const TEXT_KEYS = ['provider', 'purpose', 'privacyUrl'];
|
|
8
|
+
const CUSTOM_KEYS = ['category', ...TEXT_KEYS, ...EXTERNAL_DIRECTIVES];
|
|
9
|
+
/** Höchstlänge von Anbieter und Zweck (steht im Cookie-Hinweis). */
|
|
10
|
+
export const EXTERNAL_TEXT_MAX = 200;
|
|
11
|
+
function isRecord(value) {
|
|
12
|
+
return typeof value === 'object' && value !== null && !Array.isArray(value);
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Prüft `external`. Leere Liste heißt gültig. Wird von `validateSiteConfig` aufgerufen; die Meldungen
|
|
16
|
+
* landen in `dealsystem check` unter SEC-005, weil sie die Sicherheitsregeln der Seite bestimmen.
|
|
17
|
+
*/
|
|
18
|
+
export function validateExternal(external) {
|
|
19
|
+
const problems = [];
|
|
20
|
+
if (external === undefined)
|
|
21
|
+
return problems;
|
|
22
|
+
if (!isRecord(external)) {
|
|
23
|
+
return [
|
|
24
|
+
{
|
|
25
|
+
path: 'external',
|
|
26
|
+
message: "external ist ein Objekt: external: { video: { preset: 'youtube' } }.",
|
|
27
|
+
},
|
|
28
|
+
];
|
|
29
|
+
}
|
|
30
|
+
const entries = Object.entries(external);
|
|
31
|
+
if (entries.length > MAX_EXTERNAL_ENTRIES) {
|
|
32
|
+
problems.push({
|
|
33
|
+
path: 'external',
|
|
34
|
+
message: `external hat ${entries.length} Einträge. Erlaubt sind höchstens ${MAX_EXTERNAL_ENTRIES}.`,
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
for (const [id, def] of entries) {
|
|
38
|
+
const path = `external.${id}`;
|
|
39
|
+
if (!KEBAB_KEY_PATTERN.test(id) || id.length > KEBAB_KEY_MAX_LENGTH) {
|
|
40
|
+
problems.push({
|
|
41
|
+
path,
|
|
42
|
+
message: `Der Schlüssel "${id}" ist ungültig. Erlaubt: Kleinbuchstaben, Ziffern und Bindestriche, z. B. "video" oder "chat".`,
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
if (!isRecord(def)) {
|
|
46
|
+
problems.push({
|
|
47
|
+
path,
|
|
48
|
+
message: "Ein fremder Dienst ist ein Objekt, z. B. { preset: 'youtube' } oder { category: 'marketing', script: ['https://…'] }.",
|
|
49
|
+
});
|
|
50
|
+
continue;
|
|
51
|
+
}
|
|
52
|
+
if ('preset' in def) {
|
|
53
|
+
if (!isPreset(def.preset)) {
|
|
54
|
+
problems.push({
|
|
55
|
+
path: `${path}.preset`,
|
|
56
|
+
message: `Die Vorlage "${String(def.preset)}" gibt es nicht. Vorhanden: ${PRESET_NAMES.join(', ')}. Andere Dienste beschreibst du selbst mit category und Hosts.`,
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
const extra = Object.keys(def).filter((k) => k !== 'preset');
|
|
60
|
+
if (extra.length > 0) {
|
|
61
|
+
problems.push({
|
|
62
|
+
path,
|
|
63
|
+
message: `Bei einer Vorlage steht nur preset; Kategorie, Anbieter und Hosts legt die Vorlage fest. Entferne: ${extra.join(', ')}.`,
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
continue;
|
|
67
|
+
}
|
|
68
|
+
const unknown = Object.keys(def).filter((k) => !CUSTOM_KEYS.includes(k));
|
|
69
|
+
if (unknown.length > 0) {
|
|
70
|
+
problems.push({
|
|
71
|
+
path,
|
|
72
|
+
message: `Unbekannte Angabe: ${unknown.join(', ')}. Erlaubt: ${CUSTOM_KEYS.join(', ')} oder nur preset.`,
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
const category = def.category;
|
|
76
|
+
if (!EXTERNAL_CATEGORIES.includes(category)) {
|
|
77
|
+
const necessary = typeof category === 'string' && /^(necessary|notwendig|essential|required)$/i.test(category);
|
|
78
|
+
problems.push({
|
|
79
|
+
path: `${path}.category`,
|
|
80
|
+
message: necessary
|
|
81
|
+
? `"${category}" gibt es für eigene Dienste nicht: Fremdes lädt immer erst nach der Einwilligung. Wähle statistics, marketing oder media.`
|
|
82
|
+
: `category fehlt oder ist unbekannt. Erlaubt: ${EXTERNAL_CATEGORIES.join(', ')} (Statistik, Marketing, externe Inhalte wie Videos).`,
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
for (const key of TEXT_KEYS) {
|
|
86
|
+
const value = def[key];
|
|
87
|
+
if (value === undefined)
|
|
88
|
+
continue;
|
|
89
|
+
if (typeof value !== 'string' || value.trim() === '' || value.length > EXTERNAL_TEXT_MAX) {
|
|
90
|
+
problems.push({
|
|
91
|
+
path: `${path}.${key}`,
|
|
92
|
+
message: `${key} ist ein Text mit höchstens ${EXTERNAL_TEXT_MAX} Zeichen.`,
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
else if (key === 'privacyUrl' && !/^https:\/\/[^\s]+$/.test(value)) {
|
|
96
|
+
problems.push({
|
|
97
|
+
path: `${path}.privacyUrl`,
|
|
98
|
+
message: 'privacyUrl ist die Adresse der Datenschutzerklärung des Anbieters und beginnt mit https://.',
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
let hostCount = 0;
|
|
103
|
+
for (const directive of EXTERNAL_DIRECTIVES) {
|
|
104
|
+
const list = def[directive];
|
|
105
|
+
if (list === undefined)
|
|
106
|
+
continue;
|
|
107
|
+
if (!Array.isArray(list)) {
|
|
108
|
+
problems.push({
|
|
109
|
+
path: `${path}.${directive}`,
|
|
110
|
+
message: `${directive} ist eine Liste von Hosts, z. B. ${directive}: ['https://js.example.com'].`,
|
|
111
|
+
});
|
|
112
|
+
continue;
|
|
113
|
+
}
|
|
114
|
+
if (list.length > MAX_HOSTS_PER_DIRECTIVE) {
|
|
115
|
+
problems.push({
|
|
116
|
+
path: `${path}.${directive}`,
|
|
117
|
+
message: `${directive} hat ${list.length} Hosts. Erlaubt sind höchstens ${MAX_HOSTS_PER_DIRECTIVE}.`,
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
list.forEach((source, index) => {
|
|
121
|
+
const problem = hostSourceProblem(source, directive);
|
|
122
|
+
if (problem)
|
|
123
|
+
problems.push({ path: `${path}.${directive}[${index}]`, message: problem });
|
|
124
|
+
});
|
|
125
|
+
hostCount += list.length;
|
|
126
|
+
}
|
|
127
|
+
if (hostCount === 0) {
|
|
128
|
+
problems.push({
|
|
129
|
+
path,
|
|
130
|
+
message: `Der Dienst "${id}" nennt keinen Host. Trage mindestens einen ein, z. B. script: ['https://js.example.com'].`,
|
|
131
|
+
});
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
return problems;
|
|
135
|
+
}
|
|
136
|
+
function emptyHosts() {
|
|
137
|
+
return { script: [], connect: [], img: [], frame: [], media: [], style: [], font: [] };
|
|
138
|
+
}
|
|
139
|
+
function sortedUnique(values) {
|
|
140
|
+
return [...new Set((values ?? []).filter((v) => typeof v === 'string'))].sort();
|
|
141
|
+
}
|
|
142
|
+
/**
|
|
143
|
+
* Löst die Vorlagen auf und bringt jeden Eintrag in eine feste Form (alle Direktiven, sortiert). Nach `id`
|
|
144
|
+
* sortiert. Erwartet eine gültige Konfiguration; ungültige Einträge werden übersprungen.
|
|
145
|
+
*/
|
|
146
|
+
export function resolveExternal(external) {
|
|
147
|
+
if (!isRecord(external))
|
|
148
|
+
return [];
|
|
149
|
+
const out = [];
|
|
150
|
+
for (const [id, def] of Object.entries(external)) {
|
|
151
|
+
if (!isRecord(def))
|
|
152
|
+
continue;
|
|
153
|
+
const hosts = emptyHosts();
|
|
154
|
+
if ('preset' in def) {
|
|
155
|
+
if (!isPreset(def.preset))
|
|
156
|
+
continue;
|
|
157
|
+
const preset = PRESETS[def.preset];
|
|
158
|
+
for (const directive of EXTERNAL_DIRECTIVES)
|
|
159
|
+
hosts[directive] = sortedUnique(preset.hosts[directive]);
|
|
160
|
+
out.push({
|
|
161
|
+
id,
|
|
162
|
+
preset: def.preset,
|
|
163
|
+
category: preset.category,
|
|
164
|
+
provider: preset.provider,
|
|
165
|
+
purpose: preset.purpose,
|
|
166
|
+
privacyUrl: preset.privacyUrl,
|
|
167
|
+
hosts,
|
|
168
|
+
});
|
|
169
|
+
continue;
|
|
170
|
+
}
|
|
171
|
+
const custom = def;
|
|
172
|
+
if (!EXTERNAL_CATEGORIES.includes(custom.category))
|
|
173
|
+
continue;
|
|
174
|
+
for (const directive of EXTERNAL_DIRECTIVES) {
|
|
175
|
+
const list = custom[directive];
|
|
176
|
+
hosts[directive] = Array.isArray(list) ? sortedUnique(list) : [];
|
|
177
|
+
}
|
|
178
|
+
const text = (key) => typeof custom[key] === 'string' && custom[key].trim() !== ''
|
|
179
|
+
? custom[key].trim()
|
|
180
|
+
: null;
|
|
181
|
+
out.push({
|
|
182
|
+
id,
|
|
183
|
+
preset: null,
|
|
184
|
+
category: custom.category,
|
|
185
|
+
provider: text('provider'),
|
|
186
|
+
purpose: text('purpose'),
|
|
187
|
+
privacyUrl: text('privacyUrl'),
|
|
188
|
+
hosts,
|
|
189
|
+
});
|
|
190
|
+
}
|
|
191
|
+
return out.sort((a, b) => (a.id < b.id ? -1 : a.id > b.id ? 1 : 0));
|
|
192
|
+
}
|
|
193
|
+
/**
|
|
194
|
+
* Prüft die Adresse eines `<Embed>` gegen die Deklaration. Bei einer Vorlage wird eine kopierte Adresse
|
|
195
|
+
* (z. B. `https://www.youtube.com/watch?v=…`) in die Form der Einbettung gebracht.
|
|
196
|
+
*/
|
|
197
|
+
export function resolveEmbedSource(entry, src) {
|
|
198
|
+
const url = externalUrl(src);
|
|
199
|
+
if (!url || url.protocol !== 'https:') {
|
|
200
|
+
return { ok: false, message: `src="${src}" ist keine https-Adresse.` };
|
|
201
|
+
}
|
|
202
|
+
if (entry.preset) {
|
|
203
|
+
const preset = PRESETS[entry.preset];
|
|
204
|
+
const normalized = preset.normalize(url);
|
|
205
|
+
if (!normalized) {
|
|
206
|
+
return {
|
|
207
|
+
ok: false,
|
|
208
|
+
message: `src="${src}" passt nicht zur Vorlage ${entry.preset}. ${PRESET_SRC_HINT[entry.preset]}`,
|
|
209
|
+
};
|
|
210
|
+
}
|
|
211
|
+
return {
|
|
212
|
+
ok: true,
|
|
213
|
+
src: normalized,
|
|
214
|
+
original: preset.original(new URL(normalized)),
|
|
215
|
+
settings: preset.embed,
|
|
216
|
+
};
|
|
217
|
+
}
|
|
218
|
+
if (entry.hosts.frame.length === 0) {
|
|
219
|
+
return {
|
|
220
|
+
ok: false,
|
|
221
|
+
message: `Der Dienst "${entry.id}" hat keine frame-Hosts. Trage den Host unter external.${entry.id}.frame ein.`,
|
|
222
|
+
};
|
|
223
|
+
}
|
|
224
|
+
if (!entry.hosts.frame.some((h) => hostSourceMatches(h, url))) {
|
|
225
|
+
return {
|
|
226
|
+
ok: false,
|
|
227
|
+
message: `src="${src}": Der Host ${url.host} steht nicht unter external.${entry.id}.frame (${entry.hosts.frame.join(', ')}).`,
|
|
228
|
+
};
|
|
229
|
+
}
|
|
230
|
+
return { ok: true, src: url.href, original: url.href, settings: CUSTOM_EMBED };
|
|
231
|
+
}
|
|
232
|
+
const PRESET_SRC_HINT = {
|
|
233
|
+
youtube: 'Erwartet wird eine Video-Adresse von YouTube, z. B. https://www.youtube.com/watch?v=… oder https://youtu.be/….',
|
|
234
|
+
vimeo: 'Erwartet wird eine Video-Adresse von Vimeo, z. B. https://vimeo.com/123456789.',
|
|
235
|
+
'google-maps': 'Erwartet wird die Adresse aus Google Maps → Teilen → Karte einbetten (https://www.google.com/maps/embed?pb=…).',
|
|
236
|
+
calendly: 'Erwartet wird die Adresse deiner Calendly-Seite, z. B. https://calendly.com/name/termin.',
|
|
237
|
+
};
|
|
238
|
+
/** Prüft die Adresse eines `<ExternalScript>`: eigener Pfad aus `static/` oder ein `script`-Host der Deklaration. */
|
|
239
|
+
export function scriptSourceProblem(entry, src) {
|
|
240
|
+
if (isLocalPath(src))
|
|
241
|
+
return null;
|
|
242
|
+
const url = externalUrl(src);
|
|
243
|
+
if (!url || url.protocol !== 'https:') {
|
|
244
|
+
return `src="${src}" ist weder ein Pfad der Seite (/scripts/datei.js) noch eine https-Adresse.`;
|
|
245
|
+
}
|
|
246
|
+
if (!entry.hosts.script.some((h) => hostSourceMatches(h, url))) {
|
|
247
|
+
return `src="${src}": Der Host ${url.host} steht nicht unter external.${entry.id}.script${entry.hosts.script.length ? ` (${entry.hosts.script.join(', ')})` : ''}.`;
|
|
248
|
+
}
|
|
249
|
+
return null;
|
|
250
|
+
}
|
|
251
|
+
/** Direktiven, die ein Eintrag öffnet, für Meldungen. */
|
|
252
|
+
export function directivesOf(entry) {
|
|
253
|
+
return EXTERNAL_DIRECTIVES.filter((d) => entry.hosts[d].length > 0);
|
|
254
|
+
}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
export { default as Booker, type BookerProps } from './components/Booker.svelte';
|
|
2
|
+
export { default as CollectionList, type CollectionListProps } from './components/CollectionList.svelte';
|
|
3
|
+
export { default as ConsentGate, type ConsentGateProps } from './components/ConsentGate.svelte';
|
|
4
|
+
export { default as CookieBanner, type CookieBannerProps } from './components/CookieBanner.svelte';
|
|
5
|
+
export { default as Datenschutz, type DatenschutzProps } from './components/Datenschutz.svelte';
|
|
6
|
+
export { default as Embed, type EmbedProps } from './components/Embed.svelte';
|
|
7
|
+
export { default as ExternalScript, type ExternalScriptProps } from './components/ExternalScript.svelte';
|
|
8
|
+
export { default as Impressum, type ImpressumProps } from './components/Impressum.svelte';
|
|
9
|
+
export { default as Link, type LinkProps } from './components/Link.svelte';
|
|
10
|
+
export { default as LeadForm, type LeadFormProps } from './components/LeadForm.svelte';
|
|
11
|
+
export { default as LeadHoneypot, type LeadHoneypotProps } from './components/LeadHoneypot.svelte';
|
|
12
|
+
export { default as MapEmbed, type MapEmbedProps } from './components/MapEmbed.svelte';
|
|
13
|
+
export { default as MediaImage, type MediaImageProps } from './components/MediaImage.svelte';
|
|
14
|
+
export { default as MediaVideo, type MediaVideoProps } from './components/MediaVideo.svelte';
|
|
15
|
+
export { default as RichText, type RichTextProps } from './components/RichText.svelte';
|
|
16
|
+
export { default as Seo, type SeoProps } from './components/Seo.svelte';
|
|
17
|
+
export { default as SiteFooterLegal, type SiteFooterLegalProps } from './components/SiteFooterLegal.svelte';
|
|
18
|
+
export { default as SiteHead, type SiteHeadProps } from './components/SiteHead.svelte';
|
|
19
|
+
export { default as Text, type TextElement, type TextProps } from './components/Text.svelte';
|
|
20
|
+
export { default as Zeitfenster, type ZeitfensterProps } from './components/Zeitfenster.svelte';
|
|
21
|
+
export { default as Tracking } from './components/Tracking.svelte';
|
|
22
|
+
export { consent, type ConsentCategory, type ConsentProvider } from './consent/consent.svelte.js';
|
|
23
|
+
export type { ExternalScriptAttrs } from './client/externalScript.js';
|
|
24
|
+
export { loadCollection, loadEntry, type LoadedCollection } from './client/collections.js';
|
|
25
|
+
export { getCampaignParam } from './client/attribution.js';
|
|
26
|
+
export { createLeadClient, type LeadClient, type LeadClientStatus, type LeadFailureReason, type LeadFallback, type LeadResult, } from './client/leadClient.svelte.js';
|
|
27
|
+
export { createBookingClient, type BookingClient, type BookingClientStatus, type BookingFailure, type BookingFailureReason, type BookingInfoResult, type BookingInput, type BookingResult, type BookingSlotsResult, } from './client/bookingClient.svelte.js';
|
|
28
|
+
export { formatBookingDate, formatBookingTime, groupSlotsByDay, timeZoneLabel, visitorTimeZone, type BookingDay, type BookingSlotView, } from './client/bookingTime.js';
|
|
29
|
+
export { createFunnelState, type FunnelState, type FunnelStep } from './client/funnelState.svelte.js';
|
|
30
|
+
export type { BookingInfo, BookingLocationType, BookingQuestion, BookingSlot, SiteApiError, SiteApiErrorKind, SiteApiResult, } from './client/siteApi.js';
|
|
31
|
+
export type { BookingKey, CollectionEntry, CollectionKey, ContentSlotLinkValue, EnhancedPicture, EntryData, EntryMedia, ExternalKey, FunnelKey, LeadValues, MediaRef, MediaVariant, SafeHtml, SlotKey, } from './types.js';
|
|
32
|
+
export { SDK_VERSION } from './version.js';
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
// Öffentliche Schnittstelle von @dealsystem/site: Komponenten und was eine
|
|
2
|
+
// Seite im Browser braucht. Lade-Helfer für den Build: `@dealsystem/site/content`.
|
|
3
|
+
// Konfiguration: `@dealsystem/site/config`. Vite-Plugin: `@dealsystem/site/vite`.
|
|
4
|
+
export { default as Booker } from './components/Booker.svelte';
|
|
5
|
+
export { default as CollectionList } from './components/CollectionList.svelte';
|
|
6
|
+
export { default as ConsentGate } from './components/ConsentGate.svelte';
|
|
7
|
+
export { default as CookieBanner } from './components/CookieBanner.svelte';
|
|
8
|
+
export { default as Datenschutz } from './components/Datenschutz.svelte';
|
|
9
|
+
export { default as Embed } from './components/Embed.svelte';
|
|
10
|
+
export { default as ExternalScript } from './components/ExternalScript.svelte';
|
|
11
|
+
export { default as Impressum } from './components/Impressum.svelte';
|
|
12
|
+
export { default as Link } from './components/Link.svelte';
|
|
13
|
+
export { default as LeadForm } from './components/LeadForm.svelte';
|
|
14
|
+
export { default as LeadHoneypot } from './components/LeadHoneypot.svelte';
|
|
15
|
+
export { default as MapEmbed } from './components/MapEmbed.svelte';
|
|
16
|
+
export { default as MediaImage } from './components/MediaImage.svelte';
|
|
17
|
+
export { default as MediaVideo } from './components/MediaVideo.svelte';
|
|
18
|
+
export { default as RichText } from './components/RichText.svelte';
|
|
19
|
+
export { default as Seo } from './components/Seo.svelte';
|
|
20
|
+
export { default as SiteFooterLegal } from './components/SiteFooterLegal.svelte';
|
|
21
|
+
export { default as SiteHead } from './components/SiteHead.svelte';
|
|
22
|
+
export { default as Text } from './components/Text.svelte';
|
|
23
|
+
export { default as Zeitfenster } from './components/Zeitfenster.svelte';
|
|
24
|
+
export { default as Tracking } from './components/Tracking.svelte';
|
|
25
|
+
export { consent } from './consent/consent.svelte.js';
|
|
26
|
+
export { loadCollection, loadEntry } from './client/collections.js';
|
|
27
|
+
export { getCampaignParam } from './client/attribution.js';
|
|
28
|
+
export { createLeadClient, } from './client/leadClient.svelte.js';
|
|
29
|
+
export { createBookingClient, } from './client/bookingClient.svelte.js';
|
|
30
|
+
export { formatBookingDate, formatBookingTime, groupSlotsByDay, timeZoneLabel, visitorTimeZone, } from './client/bookingTime.js';
|
|
31
|
+
export { createFunnelState } from './client/funnelState.svelte.js';
|
|
32
|
+
export { SDK_VERSION } from './version.js';
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { ConsentCategory } from '../consent/consent.svelte.js';
|
|
2
|
+
/**
|
|
3
|
+
* Sind im CRM Tracking-Kennungen eingetragen? Dann fragt die Seite nach „Marketing“, schon im
|
|
4
|
+
* Server-Rendering. Ohne Kennung lädt `<Tracking>` nichts.
|
|
5
|
+
* @internal
|
|
6
|
+
*/
|
|
7
|
+
export declare function siteHasTracking(): boolean;
|
|
8
|
+
/**
|
|
9
|
+
* Braucht ein `<ConsentGate>` mit diesem Zweck eine Einwilligung? „Marketing“ nur, wenn etwas dafür da ist:
|
|
10
|
+
* eine Tracking-Kennung im CRM oder ein fremder Dienst mit `category: 'marketing'` in `dealsystem.config.ts`.
|
|
11
|
+
* Sonst lässt die CSP der Seite keinen Werbe-Dienst zu, und der Hinweis fragte ins Leere.
|
|
12
|
+
* @internal
|
|
13
|
+
*/
|
|
14
|
+
export declare function gateNeedsConsent(category: ConsentCategory): boolean;
|
|
15
|
+
/**
|
|
16
|
+
* Nutzt die Seite überhaupt etwas, das eine Einwilligung braucht (Tracking-Kennung oder ein fremder Dienst unter
|
|
17
|
+
* `external`)? Dann steht „Cookie-Einstellungen“ schon im fertigen HTML jeder Seite, damit der Widerruf überall
|
|
18
|
+
* erreichbar ist, auch auf Seiten ohne den Dienst.
|
|
19
|
+
* @internal
|
|
20
|
+
*/
|
|
21
|
+
export declare function siteUsesConsent(): boolean;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { getSiteData } from './siteData.js';
|
|
2
|
+
/**
|
|
3
|
+
* Sind im CRM Tracking-Kennungen eingetragen? Dann fragt die Seite nach „Marketing“, schon im
|
|
4
|
+
* Server-Rendering. Ohne Kennung lädt `<Tracking>` nichts.
|
|
5
|
+
* @internal
|
|
6
|
+
*/
|
|
7
|
+
export function siteHasTracking() {
|
|
8
|
+
try {
|
|
9
|
+
const { metaPixelId, googleTagId } = getSiteData().tracking;
|
|
10
|
+
return Boolean(metaPixelId || googleTagId);
|
|
11
|
+
}
|
|
12
|
+
catch {
|
|
13
|
+
// Ohne Vite-Plugin meldet sich der Fehler an anderer Stelle (`<Tracking>`, Lade-Helfer).
|
|
14
|
+
return false;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Braucht ein `<ConsentGate>` mit diesem Zweck eine Einwilligung? „Marketing“ nur, wenn etwas dafür da ist:
|
|
19
|
+
* eine Tracking-Kennung im CRM oder ein fremder Dienst mit `category: 'marketing'` in `dealsystem.config.ts`.
|
|
20
|
+
* Sonst lässt die CSP der Seite keinen Werbe-Dienst zu, und der Hinweis fragte ins Leere.
|
|
21
|
+
* @internal
|
|
22
|
+
*/
|
|
23
|
+
export function gateNeedsConsent(category) {
|
|
24
|
+
if (category !== 'marketing')
|
|
25
|
+
return true;
|
|
26
|
+
if (siteHasTracking())
|
|
27
|
+
return true;
|
|
28
|
+
try {
|
|
29
|
+
return Object.values(getSiteData().external ?? {}).some((e) => e.category === 'marketing');
|
|
30
|
+
}
|
|
31
|
+
catch {
|
|
32
|
+
return false;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Nutzt die Seite überhaupt etwas, das eine Einwilligung braucht (Tracking-Kennung oder ein fremder Dienst unter
|
|
37
|
+
* `external`)? Dann steht „Cookie-Einstellungen“ schon im fertigen HTML jeder Seite, damit der Widerruf überall
|
|
38
|
+
* erreichbar ist, auch auf Seiten ohne den Dienst.
|
|
39
|
+
* @internal
|
|
40
|
+
*/
|
|
41
|
+
export function siteUsesConsent() {
|
|
42
|
+
if (siteHasTracking())
|
|
43
|
+
return true;
|
|
44
|
+
try {
|
|
45
|
+
return Object.keys(getSiteData().external ?? {}).length > 0;
|
|
46
|
+
}
|
|
47
|
+
catch {
|
|
48
|
+
return false;
|
|
49
|
+
}
|
|
50
|
+
}
|