@heyo-sh/create-heyo-docs 0.2.3 → 0.3.0

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.
@@ -9,6 +9,65 @@ import {
9
9
  type MetaFunction,
10
10
  } from "react-router";
11
11
  import { pathnameFromMarkdownPath } from "@heyo-sh/heyo-docs";
12
+ import { adobeAnalyticsScript } from "@heyo-sh/heyo-docs/integrations/analytics/adobe";
13
+ import { amplitudeAnalyticsScript } from "@heyo-sh/heyo-docs/integrations/analytics/amplitude";
14
+ import { clarityBootstrapScript } from "@heyo-sh/heyo-docs/integrations/analytics/clarity";
15
+ import { clearbitAnalyticsScript } from "@heyo-sh/heyo-docs/integrations/analytics/clearbit";
16
+ import { fathomAnalyticsScript } from "@heyo-sh/heyo-docs/integrations/analytics/fathom";
17
+ import {
18
+ googleAnalyticsBootstrapScript,
19
+ googleAnalyticsScript,
20
+ } from "@heyo-sh/heyo-docs/integrations/analytics/google-analytics";
21
+ import {
22
+ googleTagManagerBootstrapScript,
23
+ googleTagManagerNoScriptUrl,
24
+ } from "@heyo-sh/heyo-docs/integrations/analytics/google-tag-manager";
25
+ import { heapBootstrapScript } from "@heyo-sh/heyo-docs/integrations/analytics/heap";
26
+ import { hotjarBootstrapScript } from "@heyo-sh/heyo-docs/integrations/analytics/hotjar";
27
+ import {
28
+ logRocketBootstrapScript,
29
+ logRocketScript,
30
+ } from "@heyo-sh/heyo-docs/integrations/analytics/logrocket";
31
+ import {
32
+ mixpanelBootstrapScript,
33
+ mixpanelScript,
34
+ } from "@heyo-sh/heyo-docs/integrations/analytics/mixpanel";
35
+ import {
36
+ openpanelBootstrapScript,
37
+ openpanelScript,
38
+ } from "@heyo-sh/heyo-docs/integrations/analytics/openpanel";
39
+ import { openReplayBootstrapScript } from "@heyo-sh/heyo-docs/integrations/analytics/openreplay";
40
+ import { osanoConsentScript } from "@heyo-sh/heyo-docs/integrations/consent/osano";
41
+ import {
42
+ transcendConsentScript,
43
+ transcendGoogleConsentModeDefaultsScript,
44
+ } from "@heyo-sh/heyo-docs/integrations/consent/transcend";
45
+ import { pirschAnalyticsScript } from "@heyo-sh/heyo-docs/integrations/analytics/pirsch";
46
+ import { plausibleAnalyticsScript } from "@heyo-sh/heyo-docs/integrations/analytics/plausible";
47
+ import {
48
+ posthogApiHost,
49
+ posthogBootstrapScript,
50
+ posthogScript,
51
+ } from "@heyo-sh/heyo-docs/integrations/analytics/posthog";
52
+ import { rybbitAnalyticsScript } from "@heyo-sh/heyo-docs/integrations/analytics/rybbit";
53
+ import {
54
+ swetrixBootstrapScript,
55
+ swetrixScript,
56
+ } from "@heyo-sh/heyo-docs/integrations/analytics/swetrix";
57
+ import { chaskiqBootstrapScript } from "@heyo-sh/heyo-docs/integrations/support/chaskiq";
58
+ import { chatwootBootstrapScript } from "@heyo-sh/heyo-docs/integrations/support/chatwoot";
59
+ import {
60
+ frontChatBootstrapScript,
61
+ frontChatScript,
62
+ } from "@heyo-sh/heyo-docs/integrations/support/front";
63
+ import { intercomBootstrapScript } from "@heyo-sh/heyo-docs/integrations/support/intercom";
64
+ import { papercupsBootstrapScript } from "@heyo-sh/heyo-docs/integrations/support/papercups";
65
+ import { typebotBootstrapScript } from "@heyo-sh/heyo-docs/integrations/support/typebot";
66
+ import { umamiAnalyticsScript } from "@heyo-sh/heyo-docs/integrations/analytics/umami";
67
+ import {
68
+ zammadBootstrapScript,
69
+ zammadChatScript,
70
+ } from "@heyo-sh/heyo-docs/integrations/support/zammad";
12
71
  import type { Route } from "./+types/root";
13
72
 
14
73
  import "./app.css";
@@ -80,22 +139,321 @@ export const links: LinksFunction = () => [
80
139
  : []),
81
140
  ];
82
141
 
142
+ const osano = config.integrations.consent.osano
143
+ ? osanoConsentScript(config.integrations.consent.osano)
144
+ : undefined;
145
+ const transcend = config.integrations.consent.transcend
146
+ ? transcendConsentScript(config.integrations.consent.transcend)
147
+ : undefined;
148
+ const transcendGoogleConsentDefaults =
149
+ transcend &&
150
+ (config.integrations.analytics.ga4 || config.integrations.analytics.gtm)
151
+ ? transcendGoogleConsentModeDefaultsScript()
152
+ : undefined;
153
+ const adobe = config.integrations.analytics.adobe
154
+ ? adobeAnalyticsScript(config.integrations.analytics.adobe)
155
+ : undefined;
156
+ const amplitude = config.integrations.analytics.amplitude
157
+ ? amplitudeAnalyticsScript(config.integrations.analytics.amplitude)
158
+ : undefined;
159
+ const clarity = config.integrations.analytics.clarity
160
+ ? clarityBootstrapScript()
161
+ : undefined;
162
+ const clearbit = config.integrations.analytics.clearbit
163
+ ? clearbitAnalyticsScript(config.integrations.analytics.clearbit)
164
+ : undefined;
165
+ const fathom = config.integrations.analytics.fathom
166
+ ? fathomAnalyticsScript(config.integrations.analytics.fathom)
167
+ : undefined;
168
+ const googleAnalytics = config.integrations.analytics.ga4
169
+ ? googleAnalyticsScript(config.integrations.analytics.ga4)
170
+ : undefined;
171
+ const googleAnalyticsBootstrap = googleAnalytics
172
+ ? googleAnalyticsBootstrapScript()
173
+ : undefined;
174
+ const googleTagManager = config.integrations.analytics.gtm
175
+ ? googleTagManagerBootstrapScript()
176
+ : undefined;
177
+ const googleTagManagerNoScript = config.integrations.analytics.gtm
178
+ ? googleTagManagerNoScriptUrl(config.integrations.analytics.gtm)
179
+ : undefined;
180
+ const heap = config.integrations.analytics.heap
181
+ ? heapBootstrapScript()
182
+ : undefined;
183
+ const hotjar = config.integrations.analytics.hotjar
184
+ ? hotjarBootstrapScript()
185
+ : undefined;
186
+ const logRocket = config.integrations.analytics.logrocket
187
+ ? logRocketScript()
188
+ : undefined;
189
+ const logRocketBootstrap = logRocket ? logRocketBootstrapScript() : undefined;
190
+ const mixpanel = config.integrations.analytics.mixpanel
191
+ ? mixpanelScript()
192
+ : undefined;
193
+ const mixpanelBootstrap = mixpanel ? mixpanelBootstrapScript() : undefined;
194
+ const openpanel = config.integrations.analytics.openpanel
195
+ ? openpanelScript()
196
+ : undefined;
197
+ const openpanelBootstrap = openpanel ? openpanelBootstrapScript() : undefined;
198
+ const openReplay = config.integrations.analytics.openreplay
199
+ ? openReplayBootstrapScript()
200
+ : undefined;
201
+ const pirsch = config.integrations.analytics.pirsch
202
+ ? pirschAnalyticsScript(config.integrations.analytics.pirsch)
203
+ : undefined;
204
+ const plausible = config.integrations.analytics.plausible
205
+ ? plausibleAnalyticsScript(config.integrations.analytics.plausible)
206
+ : undefined;
207
+ const posthog = config.integrations.analytics.posthog
208
+ ? posthogScript(config.integrations.analytics.posthog)
209
+ : undefined;
210
+ const posthogBootstrap = posthog ? posthogBootstrapScript() : undefined;
211
+ const posthogHost = config.integrations.analytics.posthog
212
+ ? posthogApiHost(config.integrations.analytics.posthog)
213
+ : undefined;
214
+ const rybbit = config.integrations.analytics.rybbit
215
+ ? rybbitAnalyticsScript(config.integrations.analytics.rybbit)
216
+ : undefined;
217
+ const swetrix = config.integrations.analytics.swetrix
218
+ ? swetrixScript()
219
+ : undefined;
220
+ const swetrixBootstrap = swetrix ? swetrixBootstrapScript() : undefined;
221
+ const umami = config.integrations.analytics.umami
222
+ ? umamiAnalyticsScript(config.integrations.analytics.umami)
223
+ : undefined;
224
+ const intercom = config.integrations.support.intercom
225
+ ? intercomBootstrapScript()
226
+ : undefined;
227
+ const front = config.integrations.support.front ? frontChatScript() : undefined;
228
+ const frontBootstrap = front ? frontChatBootstrapScript() : undefined;
229
+ const chatwoot = config.integrations.support.chatwoot
230
+ ? chatwootBootstrapScript()
231
+ : undefined;
232
+ const chaskiq = config.integrations.support.chaskiq
233
+ ? chaskiqBootstrapScript()
234
+ : undefined;
235
+ const papercups = config.integrations.support.papercups
236
+ ? papercupsBootstrapScript()
237
+ : undefined;
238
+ const typebot = config.integrations.support.typebot
239
+ ? typebotBootstrapScript()
240
+ : undefined;
241
+ const zammad = config.integrations.support.zammad
242
+ ? zammadChatScript(config.integrations.support.zammad)
243
+ : undefined;
244
+ const zammadBootstrap = zammad ? zammadBootstrapScript() : undefined;
245
+
83
246
  export function Layout({ children }: { children: ReactNode }) {
84
247
  return (
85
248
  <html lang="en" suppressHydrationWarning>
86
249
  <head>
250
+ {transcendGoogleConsentDefaults && (
251
+ <script
252
+ dangerouslySetInnerHTML={{
253
+ __html: transcendGoogleConsentDefaults,
254
+ }}
255
+ />
256
+ )}
257
+ {transcend && (
258
+ <script data-cfasync={transcend.dataCfasync} src={transcend.src} />
259
+ )}
87
260
  <meta charSet="utf-8" />
88
261
  <meta name="viewport" content="width=device-width, initial-scale=1" />
89
262
  <meta name="color-scheme" content="light dark" />
263
+ {osano && <script src={osano.src} />}
264
+ {googleTagManager && (
265
+ <script
266
+ data-google-tag-manager-container-id={
267
+ config.integrations.analytics.gtm?.containerId
268
+ }
269
+ dangerouslySetInnerHTML={{ __html: googleTagManager }}
270
+ />
271
+ )}
90
272
  <script
91
273
  dangerouslySetInnerHTML={{
92
274
  __html: getThemeScript(THEME_STORAGE_KEY, config.mode),
93
275
  }}
94
276
  />
277
+ {adobe && <script async={adobe.async} src={adobe.src} />}
278
+ {amplitude && <script src={amplitude.src} />}
279
+ {clarity && (
280
+ <script
281
+ data-clarity-project-id={
282
+ config.integrations.analytics.clarity?.projectId
283
+ }
284
+ dangerouslySetInnerHTML={{ __html: clarity }}
285
+ />
286
+ )}
287
+ {clearbit && <script src={clearbit.src} />}
288
+ {fathom && (
289
+ <script
290
+ data-site={fathom.siteId}
291
+ data-spa={fathom.spa}
292
+ defer={fathom.defer}
293
+ src={fathom.src}
294
+ />
295
+ )}
296
+ {googleAnalytics && googleAnalyticsBootstrap && (
297
+ <>
298
+ <script async={googleAnalytics.async} src={googleAnalytics.src} />
299
+ <script
300
+ data-google-analytics-measurement-id={
301
+ config.integrations.analytics.ga4?.measurementId
302
+ }
303
+ dangerouslySetInnerHTML={{ __html: googleAnalyticsBootstrap }}
304
+ />
305
+ </>
306
+ )}
307
+ {heap && (
308
+ <script
309
+ data-heap-environment-id={
310
+ config.integrations.analytics.heap?.environmentId
311
+ }
312
+ dangerouslySetInnerHTML={{ __html: heap }}
313
+ />
314
+ )}
315
+ {hotjar && (
316
+ <script
317
+ data-hotjar-site-id={config.integrations.analytics.hotjar?.siteId}
318
+ data-hotjar-snippet-version={
319
+ config.integrations.analytics.hotjar?.snippetVersion
320
+ }
321
+ dangerouslySetInnerHTML={{ __html: hotjar }}
322
+ />
323
+ )}
324
+ {logRocket && logRocketBootstrap && (
325
+ <>
326
+ <script crossOrigin={logRocket.crossOrigin} src={logRocket.src} />
327
+ <script
328
+ data-logrocket-app-id={
329
+ config.integrations.analytics.logrocket?.appId
330
+ }
331
+ dangerouslySetInnerHTML={{ __html: logRocketBootstrap }}
332
+ />
333
+ </>
334
+ )}
335
+ {mixpanel && mixpanelBootstrap && (
336
+ <>
337
+ <script src={mixpanel.src} />
338
+ <script
339
+ data-mixpanel-project-token={
340
+ config.integrations.analytics.mixpanel?.projectToken
341
+ }
342
+ dangerouslySetInnerHTML={{ __html: mixpanelBootstrap }}
343
+ />
344
+ </>
345
+ )}
346
+ {openpanel && openpanelBootstrap && (
347
+ <>
348
+ <script
349
+ data-openpanel-api-url={
350
+ config.integrations.analytics.openpanel?.apiUrl
351
+ }
352
+ data-openpanel-client-id={
353
+ config.integrations.analytics.openpanel?.clientId
354
+ }
355
+ dangerouslySetInnerHTML={{ __html: openpanelBootstrap }}
356
+ />
357
+ <script
358
+ async={openpanel.async}
359
+ defer={openpanel.defer}
360
+ src={openpanel.src}
361
+ />
362
+ </>
363
+ )}
364
+ {openReplay && (
365
+ <script
366
+ data-openreplay-ingest-point={
367
+ config.integrations.analytics.openreplay?.ingestPoint
368
+ }
369
+ data-openreplay-project-key={
370
+ config.integrations.analytics.openreplay?.projectKey
371
+ }
372
+ dangerouslySetInnerHTML={{ __html: openReplay }}
373
+ />
374
+ )}
375
+ {pirsch && (
376
+ <script
377
+ data-code={pirsch.code}
378
+ defer={pirsch.defer}
379
+ src={pirsch.src}
380
+ />
381
+ )}
382
+ {plausible && (
383
+ <script
384
+ data-domain={plausible.domain}
385
+ defer={plausible.defer}
386
+ src={plausible.src}
387
+ />
388
+ )}
389
+ {posthog && posthogBootstrap && posthogHost && (
390
+ <>
391
+ <script src={posthog.src} />
392
+ <script
393
+ data-posthog-api-host={posthogHost}
394
+ data-posthog-project-api-key={
395
+ config.integrations.analytics.posthog?.projectApiKey
396
+ }
397
+ dangerouslySetInnerHTML={{ __html: posthogBootstrap }}
398
+ />
399
+ </>
400
+ )}
401
+ {rybbit && (
402
+ <script
403
+ data-site-id={rybbit.siteId}
404
+ defer={rybbit.defer}
405
+ src={rybbit.src}
406
+ />
407
+ )}
408
+ {umami && (
409
+ <script
410
+ data-website-id={umami.websiteId}
411
+ defer={umami.defer}
412
+ src={umami.src}
413
+ />
414
+ )}
415
+ {chaskiq && (
416
+ <script
417
+ data-chaskiq-app-id={config.integrations.support.chaskiq?.appId}
418
+ data-chaskiq-base-url={config.integrations.support.chaskiq?.baseUrl}
419
+ data-chaskiq-ws-url={config.integrations.support.chaskiq?.wsUrl}
420
+ dangerouslySetInnerHTML={{ __html: chaskiq }}
421
+ />
422
+ )}
423
+ {papercups && (
424
+ <script
425
+ data-papercups-base-url={
426
+ config.integrations.support.papercups?.baseUrl
427
+ }
428
+ data-papercups-inbox={config.integrations.support.papercups?.inbox}
429
+ data-papercups-token={config.integrations.support.papercups?.token}
430
+ dangerouslySetInnerHTML={{ __html: papercups }}
431
+ />
432
+ )}
433
+ {typebot && (
434
+ <script
435
+ data-heyo-typebot
436
+ data-typebot-api-host={config.integrations.support.typebot?.apiHost}
437
+ data-typebot-id={config.integrations.support.typebot?.typebot}
438
+ dangerouslySetInnerHTML={{ __html: typebot }}
439
+ type="module"
440
+ />
441
+ )}
95
442
  <Meta />
96
443
  <Links />
97
444
  </head>
98
445
  <body>
446
+ {googleTagManagerNoScript && (
447
+ <noscript>
448
+ <iframe
449
+ height="0"
450
+ src={googleTagManagerNoScript}
451
+ style={{ display: "none", visibility: "hidden" }}
452
+ title="Google Tag Manager"
453
+ width="0"
454
+ />
455
+ </noscript>
456
+ )}
99
457
  <ThemeProvider
100
458
  defaultTheme={config.mode}
101
459
  storageKey={THEME_STORAGE_KEY}
@@ -104,6 +462,58 @@ export function Layout({ children }: { children: ReactNode }) {
104
462
  <ScrollRestoration />
105
463
  <Scripts />
106
464
  </ThemeProvider>
465
+ {swetrix && swetrixBootstrap && (
466
+ <>
467
+ <script defer={swetrix.defer} src={swetrix.src} />
468
+ <script
469
+ data-swetrix-api-url={
470
+ config.integrations.analytics.swetrix?.apiUrl
471
+ }
472
+ data-swetrix-project-id={
473
+ config.integrations.analytics.swetrix?.projectId
474
+ }
475
+ dangerouslySetInnerHTML={{ __html: swetrixBootstrap }}
476
+ />
477
+ </>
478
+ )}
479
+ {intercom && (
480
+ <script
481
+ data-intercom-app-id={config.integrations.support.intercom?.appId}
482
+ data-intercom-api-base={
483
+ config.integrations.support.intercom?.apiBase
484
+ }
485
+ dangerouslySetInnerHTML={{ __html: intercom }}
486
+ />
487
+ )}
488
+ {front && frontBootstrap && (
489
+ <>
490
+ <script src={front.src} />
491
+ <script
492
+ data-front-chat-id={config.integrations.support.front?.chatId}
493
+ dangerouslySetInnerHTML={{ __html: frontBootstrap }}
494
+ />
495
+ </>
496
+ )}
497
+ {chatwoot && (
498
+ <script
499
+ data-chatwoot-base-url={
500
+ config.integrations.support.chatwoot?.baseUrl
501
+ }
502
+ data-chatwoot-website-token={
503
+ config.integrations.support.chatwoot?.websiteToken
504
+ }
505
+ dangerouslySetInnerHTML={{ __html: chatwoot }}
506
+ />
507
+ )}
508
+ {zammad && zammadBootstrap && (
509
+ <>
510
+ <script src={zammad.src} />
511
+ <script
512
+ data-zammad-chat-id={config.integrations.support.zammad?.chatId}
513
+ dangerouslySetInnerHTML={{ __html: zammadBootstrap }}
514
+ />
515
+ </>
516
+ )}
107
517
  </body>
108
518
  </html>
109
519
  );