@shop-on/theme-routes 0.5.0 → 0.7.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.
@@ -1,5 +1,6 @@
1
1
  import { useTemplate } from "../use-template.js";
2
2
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
3
+ import { OrganizationJsonLd } from "@shop-on/theme-react/organization-json-ld";
3
4
  import { WebsiteJsonLd } from "@shop-on/theme-react/website-json-ld";
4
5
  //#region src/components/home-page.tsx
5
6
  /** Homepage body. Kept out of `routes/home.ts` so `WebsiteJsonLd` rides the
@@ -8,7 +9,11 @@ function homeRouteComponent(adapter) {
8
9
  const { TemplateRenderer } = adapter;
9
10
  return function HomePage() {
10
11
  const template = useTemplate();
11
- return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(TemplateRenderer, { template }), template.websiteSchema ? /* @__PURE__ */ jsx(WebsiteJsonLd, { data: template.websiteSchema }) : null] });
12
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
13
+ /* @__PURE__ */ jsx(TemplateRenderer, { template }),
14
+ template.websiteSchema ? /* @__PURE__ */ jsx(WebsiteJsonLd, { data: template.websiteSchema }) : null,
15
+ template.organizationSchema ? /* @__PURE__ */ jsx(OrganizationJsonLd, { data: template.organizationSchema }) : null
16
+ ] });
12
17
  };
13
18
  }
14
19
  //#endregion
@@ -10,12 +10,14 @@ export interface AnalyticsProxyDeps {
10
10
  clientIp: string | null | undefined;
11
11
  fbp: string | undefined;
12
12
  fbc: string | undefined;
13
+ cookies: string | undefined;
13
14
  eventSourceUrl: string | null;
14
15
  }): Promise<unknown>;
15
16
  extractClientIp(headers: Headers): string | null | undefined;
16
17
  parseMarketingCookies(cookie: string | null): {
17
18
  fbp?: string;
18
19
  fbc?: string;
20
+ cookies?: string;
19
21
  };
20
22
  }
21
23
  export declare function analyticsVisitsHandler(deps: AnalyticsProxyDeps): ServerRouteHandler;
@@ -2,7 +2,7 @@
2
2
  function analyticsBeaconHandler(endpoint, deps) {
3
3
  return async ({ request: req }) => {
4
4
  const body = await req.json().catch(() => ({}));
5
- const { fbp, fbc } = deps.parseMarketingCookies(req.headers.get("cookie"));
5
+ const { fbp, fbc, cookies } = deps.parseMarketingCookies(req.headers.get("cookie"));
6
6
  try {
7
7
  await deps.proxyAnalytics({
8
8
  endpoint,
@@ -13,6 +13,7 @@ function analyticsBeaconHandler(endpoint, deps) {
13
13
  clientIp: deps.extractClientIp(req.headers),
14
14
  fbp,
15
15
  fbc,
16
+ cookies,
16
17
  eventSourceUrl: req.headers.get("referer")
17
18
  });
18
19
  } catch (err) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shop-on/theme-routes",
3
- "version": "0.5.0",
3
+ "version": "0.7.0",
4
4
  "license": "SEE LICENSE IN dist/LICENSE.md",
5
5
  "files": [
6
6
  "dist"
@@ -17,8 +17,8 @@
17
17
  "./package.json": "./package.json"
18
18
  },
19
19
  "dependencies": {
20
- "@shop-on/theme-react": "0.5.0",
21
- "@shop-on/theme-runtime": "0.5.0"
20
+ "@shop-on/theme-react": "0.7.0",
21
+ "@shop-on/theme-runtime": "0.7.0"
22
22
  },
23
23
  "devDependencies": {
24
24
  "@bprogress/core": "1.3.4",