@makeswift/runtime 0.28.1-canary.0 → 0.28.1-canary.2

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.
Files changed (43) hide show
  1. package/dist/cjs/api-handler/handlers/manifest.js +1 -1
  2. package/dist/cjs/api-handler/handlers/webhook/diff-projection.js +62 -0
  3. package/dist/cjs/api-handler/handlers/webhook/diff-projection.js.map +1 -0
  4. package/dist/cjs/api-handler/handlers/webhook/site-published.js +2 -2
  5. package/dist/cjs/api-handler/handlers/webhook/site-published.js.map +1 -1
  6. package/dist/cjs/api-handler/handlers/webhook/types.js +6 -1
  7. package/dist/cjs/api-handler/handlers/webhook/types.js.map +1 -1
  8. package/dist/cjs/api-handler/index.js.map +1 -1
  9. package/dist/cjs/client/index.js +3 -3
  10. package/dist/cjs/global.d.js.map +1 -1
  11. package/dist/cjs/state/builder-api/api.js.map +1 -1
  12. package/dist/cjs/state/builder-api/navigation-listener.js +31 -11
  13. package/dist/cjs/state/builder-api/navigation-listener.js.map +1 -1
  14. package/dist/cjs/unstable-framework-support/index.js.map +1 -1
  15. package/dist/esm/api-handler/handlers/manifest.js +1 -1
  16. package/dist/esm/api-handler/handlers/webhook/diff-projection.js +38 -0
  17. package/dist/esm/api-handler/handlers/webhook/diff-projection.js.map +1 -0
  18. package/dist/esm/api-handler/handlers/webhook/site-published.js +2 -2
  19. package/dist/esm/api-handler/handlers/webhook/site-published.js.map +1 -1
  20. package/dist/esm/api-handler/handlers/webhook/types.js +6 -1
  21. package/dist/esm/api-handler/handlers/webhook/types.js.map +1 -1
  22. package/dist/esm/api-handler/index.js.map +1 -1
  23. package/dist/esm/client/index.js +3 -3
  24. package/dist/esm/global.d.js.map +1 -1
  25. package/dist/esm/state/builder-api/navigation-listener.js +31 -11
  26. package/dist/esm/state/builder-api/navigation-listener.js.map +1 -1
  27. package/dist/esm/unstable-framework-support/index.js +3 -1
  28. package/dist/esm/unstable-framework-support/index.js.map +1 -1
  29. package/dist/types/api-handler/handlers/webhook/diff-projection.d.ts +201 -0
  30. package/dist/types/api-handler/handlers/webhook/diff-projection.d.ts.map +1 -0
  31. package/dist/types/api-handler/handlers/webhook/site-published.d.ts +1 -1
  32. package/dist/types/api-handler/handlers/webhook/site-published.d.ts.map +1 -1
  33. package/dist/types/api-handler/handlers/webhook/types.d.ts +672 -1
  34. package/dist/types/api-handler/handlers/webhook/types.d.ts.map +1 -1
  35. package/dist/types/api-handler/index.d.ts +2 -2
  36. package/dist/types/api-handler/index.d.ts.map +1 -1
  37. package/dist/types/state/builder-api/api.d.ts +2 -1
  38. package/dist/types/state/builder-api/api.d.ts.map +1 -1
  39. package/dist/types/state/builder-api/navigation-listener.d.ts +2 -5
  40. package/dist/types/state/builder-api/navigation-listener.d.ts.map +1 -1
  41. package/dist/types/unstable-framework-support/index.d.ts +1 -1
  42. package/dist/types/unstable-framework-support/index.d.ts.map +1 -1
  43. package/package.json +1 -1
@@ -1,14 +1,15 @@
1
1
  const CLICK_NAVIGATION_THRESHOLD_MS = 100;
2
- const LOCATION_CHECK_DELAY_MS = 700;
2
+ const CLICK_NAVIGATION_CHECK_INTERVAL_MS = 200;
3
+ const CLICK_NAVIGATION_MAX_CHECKS = 20;
3
4
  function setupNavigationListener(callback) {
4
5
  let previousLocation = null;
5
6
  const handleNavigate = (event) => {
6
- if (event.url === previousLocation)
7
+ if (!event.navigationCompleted && event.url === previousLocation)
7
8
  return;
8
9
  callback(event);
9
10
  previousLocation = event.url;
10
11
  };
11
- handleNavigate({ url: windowLocation(), initialPageLoad: true });
12
+ handleNavigate({ url: windowLocation(), navigationCompleted: "initial-page-load" });
12
13
  if (typeof window === "undefined") {
13
14
  return () => {
14
15
  };
@@ -16,9 +17,19 @@ function setupNavigationListener(callback) {
16
17
  const unsubscribes = [];
17
18
  if ("navigation" in window && window.navigation) {
18
19
  const navigation = window.navigation;
19
- const handler = ({ destination }) => handleNavigate({ url: destination.url, initialPageLoad: false });
20
- navigation.addEventListener("navigate", handler);
21
- unsubscribes.push(() => navigation.removeEventListener("navigate", handler));
20
+ const navigateHandler = ({ destination }) => handleNavigate({ url: destination.url });
21
+ const navigateSuccessHandler = () => {
22
+ handleNavigate({
23
+ url: navigation.currentEntry.url,
24
+ navigationCompleted: "client-side-navigation"
25
+ });
26
+ };
27
+ navigation.addEventListener("navigate", navigateHandler);
28
+ navigation.addEventListener("navigatesuccess", navigateSuccessHandler);
29
+ unsubscribes.push(() => navigation.removeEventListener("navigate", navigateHandler));
30
+ unsubscribes.push(
31
+ () => navigation.removeEventListener("navigatesuccess", navigateSuccessHandler)
32
+ );
22
33
  return () => {
23
34
  unsubscribes.forEach((u) => u());
24
35
  };
@@ -29,10 +40,19 @@ function setupNavigationListener(callback) {
29
40
  if (!a)
30
41
  return;
31
42
  lastClickEvent = { href: a.href, timestamp: Date.now() };
32
- window.setTimeout(
33
- () => handleNavigate({ url: windowLocation(), initialPageLoad: false }),
34
- LOCATION_CHECK_DELAY_MS
35
- );
43
+ const pageUrlBeforeClick = windowLocation();
44
+ let navigationCheckCounter = 0;
45
+ const checkIfNavigationOccurred = () => {
46
+ const url = windowLocation();
47
+ if (url !== pageUrlBeforeClick) {
48
+ handleNavigate({ url, polyfilled: true });
49
+ return;
50
+ }
51
+ if (++navigationCheckCounter < CLICK_NAVIGATION_MAX_CHECKS) {
52
+ window.setTimeout(checkIfNavigationOccurred, CLICK_NAVIGATION_CHECK_INTERVAL_MS);
53
+ }
54
+ };
55
+ window.setTimeout(checkIfNavigationOccurred, CLICK_NAVIGATION_CHECK_INTERVAL_MS);
36
56
  };
37
57
  window.document.addEventListener(
38
58
  "click",
@@ -49,7 +69,7 @@ function setupNavigationListener(callback) {
49
69
  const msSinceLastClick = Date.now() - lastClickEvent.timestamp;
50
70
  handleNavigate({
51
71
  url: msSinceLastClick < CLICK_NAVIGATION_THRESHOLD_MS ? lastClickEvent.href ?? null : null,
52
- initialPageLoad: false
72
+ polyfilled: true
53
73
  });
54
74
  lastClickEvent = null;
55
75
  };
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/state/builder-api/navigation-listener.ts"],"sourcesContent":["export type SiteNavigationEvent = {\n url: string | null\n initialPageLoad: boolean\n}\n\ntype ClickEvent = {\n href: string\n timestamp: number\n}\n\nconst CLICK_NAVIGATION_THRESHOLD_MS = 100\nconst LOCATION_CHECK_DELAY_MS = 700 // give the host generous time to perform the navigation\n\nexport function setupNavigationListener(\n callback: (args: SiteNavigationEvent) => void,\n): VoidFunction {\n let previousLocation: string | null = null\n\n const handleNavigate = (event: SiteNavigationEvent) => {\n if (event.url === previousLocation) return\n\n callback(event)\n previousLocation = event.url\n }\n\n // trigger navigation callback on initial page load\n handleNavigate({ url: windowLocation(), initialPageLoad: true })\n\n if (typeof window === 'undefined') {\n return () => {}\n }\n\n const unsubscribes: (() => void)[] = []\n\n // check for availability of the Navigation API (baseline feature since January 2026),\n // see https://developer.mozilla.org/en-US/docs/Web/API/Navigation_API\n if ('navigation' in window && window.navigation) {\n const navigation = window.navigation\n\n const handler = ({ destination }: NavigateEvent) =>\n handleNavigate({ url: destination.url, initialPageLoad: false })\n\n // note that in order to capture destination URLs that might not be Makeswift-enabled,\n // we send a `SiteNavigationEvent` at the start of navigation, but do not track whether\n // the navigation was successful or not (possible future improvement)\n navigation.addEventListener('navigate', handler)\n unsubscribes.push(() => navigation.removeEventListener('navigate', handler))\n\n return () => {\n unsubscribes.forEach(u => u())\n }\n }\n\n // for browsers lacking Navigation API support, we manually track:\n // - link clicks to capture destination URLs\n // - page unload events to detect cross-page navigation\n let lastClickEvent: ClickEvent | null = null\n\n const clickHandler = (e: MouseEvent) => {\n const a =\n e.composedPath?.()?.find(n => n instanceof HTMLAnchorElement) ??\n (e.target instanceof Element && e.target.closest?.('a'))\n\n if (!a) return\n\n lastClickEvent = { href: a.href, timestamp: Date.now() }\n\n // handle navigation between pages in the host; note that we intentionally are\n // not cancelling the timer on cleanup to ensure we report the navigation\n window.setTimeout(\n () => handleNavigate({ url: windowLocation(), initialPageLoad: false }),\n LOCATION_CHECK_DELAY_MS,\n )\n }\n\n window.document.addEventListener(\n 'click',\n clickHandler,\n { capture: true }, // run before bubbling to fortify against `stopPropagation()` calls\n )\n\n unsubscribes.push(() =>\n window.document.removeEventListener('click', clickHandler, { capture: true }),\n )\n\n // handle external navigation\n const unloadHandler = () => {\n if (!lastClickEvent) return\n\n const msSinceLastClick = Date.now() - lastClickEvent.timestamp\n handleNavigate({\n url: msSinceLastClick < CLICK_NAVIGATION_THRESHOLD_MS ? (lastClickEvent.href ?? null) : null,\n initialPageLoad: false,\n })\n\n lastClickEvent = null\n }\n\n window.addEventListener('beforeunload', unloadHandler)\n unsubscribes.push(() => window.removeEventListener('beforeunload', unloadHandler))\n\n return () => {\n unsubscribes.forEach(u => u())\n }\n}\n\nconst windowLocation = (): string | null =>\n typeof window !== 'undefined' ? window.location.href : null\n"],"mappings":"AAUA,MAAM,gCAAgC;AACtC,MAAM,0BAA0B;AAEzB,SAAS,wBACd,UACc;AACd,MAAI,mBAAkC;AAEtC,QAAM,iBAAiB,CAAC,UAA+B;AACrD,QAAI,MAAM,QAAQ;AAAkB;AAEpC,aAAS,KAAK;AACd,uBAAmB,MAAM;AAAA,EAC3B;AAGA,iBAAe,EAAE,KAAK,eAAe,GAAG,iBAAiB,KAAK,CAAC;AAE/D,MAAI,OAAO,WAAW,aAAa;AACjC,WAAO,MAAM;AAAA,IAAC;AAAA,EAChB;AAEA,QAAM,eAA+B,CAAC;AAItC,MAAI,gBAAgB,UAAU,OAAO,YAAY;AAC/C,UAAM,aAAa,OAAO;AAE1B,UAAM,UAAU,CAAC,EAAE,YAAY,MAC7B,eAAe,EAAE,KAAK,YAAY,KAAK,iBAAiB,MAAM,CAAC;AAKjE,eAAW,iBAAiB,YAAY,OAAO;AAC/C,iBAAa,KAAK,MAAM,WAAW,oBAAoB,YAAY,OAAO,CAAC;AAE3E,WAAO,MAAM;AACX,mBAAa,QAAQ,OAAK,EAAE,CAAC;AAAA,IAC/B;AAAA,EACF;AAKA,MAAI,iBAAoC;AAExC,QAAM,eAAe,CAAC,MAAkB;AACtC,UAAM,IACJ,EAAE,eAAe,GAAG,KAAK,OAAK,aAAa,iBAAiB,MAC3D,EAAE,kBAAkB,WAAW,EAAE,OAAO,UAAU,GAAG;AAExD,QAAI,CAAC;AAAG;AAER,qBAAiB,EAAE,MAAM,EAAE,MAAM,WAAW,KAAK,IAAI,EAAE;AAIvD,WAAO;AAAA,MACL,MAAM,eAAe,EAAE,KAAK,eAAe,GAAG,iBAAiB,MAAM,CAAC;AAAA,MACtE;AAAA,IACF;AAAA,EACF;AAEA,SAAO,SAAS;AAAA,IACd;AAAA,IACA;AAAA,IACA,EAAE,SAAS,KAAK;AAAA;AAAA,EAClB;AAEA,eAAa;AAAA,IAAK,MAChB,OAAO,SAAS,oBAAoB,SAAS,cAAc,EAAE,SAAS,KAAK,CAAC;AAAA,EAC9E;AAGA,QAAM,gBAAgB,MAAM;AAC1B,QAAI,CAAC;AAAgB;AAErB,UAAM,mBAAmB,KAAK,IAAI,IAAI,eAAe;AACrD,mBAAe;AAAA,MACb,KAAK,mBAAmB,gCAAiC,eAAe,QAAQ,OAAQ;AAAA,MACxF,iBAAiB;AAAA,IACnB,CAAC;AAED,qBAAiB;AAAA,EACnB;AAEA,SAAO,iBAAiB,gBAAgB,aAAa;AACrD,eAAa,KAAK,MAAM,OAAO,oBAAoB,gBAAgB,aAAa,CAAC;AAEjF,SAAO,MAAM;AACX,iBAAa,QAAQ,OAAK,EAAE,CAAC;AAAA,EAC/B;AACF;AAEA,MAAM,iBAAiB,MACrB,OAAO,WAAW,cAAc,OAAO,SAAS,OAAO;","names":[]}
1
+ {"version":3,"sources":["../../../../src/state/builder-api/navigation-listener.ts"],"sourcesContent":["import { type HostNavigationEvent } from './api'\n\ntype ClickEvent = {\n href: string\n timestamp: number\n}\n\nconst CLICK_NAVIGATION_THRESHOLD_MS = 100\nconst CLICK_NAVIGATION_CHECK_INTERVAL_MS = 200\nconst CLICK_NAVIGATION_MAX_CHECKS = 20\n\nexport function setupNavigationListener(\n callback: (args: HostNavigationEvent) => void,\n): VoidFunction {\n let previousLocation: string | null = null\n\n const handleNavigate = (event: HostNavigationEvent) => {\n if (!event.navigationCompleted && event.url === previousLocation) return\n\n callback(event)\n previousLocation = event.url\n }\n\n // trigger navigation callback on initial page load\n handleNavigate({ url: windowLocation(), navigationCompleted: 'initial-page-load' })\n\n if (typeof window === 'undefined') {\n return () => {}\n }\n\n const unsubscribes: (() => void)[] = []\n\n // check for availability of the Navigation API (baseline feature since January 2026),\n // see https://developer.mozilla.org/en-US/docs/Web/API/Navigation_API\n if ('navigation' in window && window.navigation) {\n const navigation = window.navigation\n\n const navigateHandler = ({ destination }: NavigateEvent) =>\n handleNavigate({ url: destination.url })\n\n const navigateSuccessHandler = () => {\n handleNavigate({\n url: navigation.currentEntry.url,\n navigationCompleted: 'client-side-navigation',\n })\n }\n\n // note that in order to capture destination URLs that might not be Makeswift-enabled,\n // we send a `SiteNavigationEvent` at the start of navigation, but do not track whether\n // the navigation was successful or not (possible future improvement)\n navigation.addEventListener('navigate', navigateHandler)\n navigation.addEventListener('navigatesuccess', navigateSuccessHandler)\n unsubscribes.push(() => navigation.removeEventListener('navigate', navigateHandler))\n unsubscribes.push(() =>\n navigation.removeEventListener('navigatesuccess', navigateSuccessHandler),\n )\n\n return () => {\n unsubscribes.forEach(u => u())\n }\n }\n\n // for browsers lacking Navigation API support, we manually track:\n // - link clicks to capture destination URLs\n // - page unload events to detect cross-page navigation\n //\n // this works well enough to keep this polyfill in place for now, but not nearly as\n // reliably as the Navigation API\n let lastClickEvent: ClickEvent | null = null\n\n const clickHandler = (e: MouseEvent) => {\n const a =\n e.composedPath?.()?.find(n => n instanceof HTMLAnchorElement) ??\n (e.target instanceof Element && e.target.closest?.('a'))\n\n if (!a) return\n\n lastClickEvent = { href: a.href, timestamp: Date.now() }\n\n const pageUrlBeforeClick = windowLocation()\n let navigationCheckCounter = 0\n\n // handle navigation between pages in the host; note that we intentionally are\n // not cancelling the timer on cleanup to ensure we report the navigation\n const checkIfNavigationOccurred = () => {\n const url = windowLocation()\n\n if (url !== pageUrlBeforeClick) {\n // the host navigated to a different page, report the new URL to the builder\n handleNavigate({ url, polyfilled: true })\n return\n }\n\n // we're still on the same page, recheck until the max number of checks is reached\n if (++navigationCheckCounter < CLICK_NAVIGATION_MAX_CHECKS) {\n window.setTimeout(checkIfNavigationOccurred, CLICK_NAVIGATION_CHECK_INTERVAL_MS)\n }\n }\n\n window.setTimeout(checkIfNavigationOccurred, CLICK_NAVIGATION_CHECK_INTERVAL_MS)\n }\n\n window.document.addEventListener(\n 'click',\n clickHandler,\n { capture: true }, // run before bubbling to fortify against `stopPropagation()` calls\n )\n\n unsubscribes.push(() =>\n window.document.removeEventListener('click', clickHandler, { capture: true }),\n )\n\n // handle external navigation\n const unloadHandler = () => {\n if (!lastClickEvent) return\n\n const msSinceLastClick = Date.now() - lastClickEvent.timestamp\n handleNavigate({\n url: msSinceLastClick < CLICK_NAVIGATION_THRESHOLD_MS ? (lastClickEvent.href ?? null) : null,\n polyfilled: true,\n })\n\n lastClickEvent = null\n }\n\n window.addEventListener('beforeunload', unloadHandler)\n unsubscribes.push(() => window.removeEventListener('beforeunload', unloadHandler))\n\n return () => {\n unsubscribes.forEach(u => u())\n }\n}\n\nconst windowLocation = (): string | null =>\n typeof window !== 'undefined' ? window.location.href : null\n"],"mappings":"AAOA,MAAM,gCAAgC;AACtC,MAAM,qCAAqC;AAC3C,MAAM,8BAA8B;AAE7B,SAAS,wBACd,UACc;AACd,MAAI,mBAAkC;AAEtC,QAAM,iBAAiB,CAAC,UAA+B;AACrD,QAAI,CAAC,MAAM,uBAAuB,MAAM,QAAQ;AAAkB;AAElE,aAAS,KAAK;AACd,uBAAmB,MAAM;AAAA,EAC3B;AAGA,iBAAe,EAAE,KAAK,eAAe,GAAG,qBAAqB,oBAAoB,CAAC;AAElF,MAAI,OAAO,WAAW,aAAa;AACjC,WAAO,MAAM;AAAA,IAAC;AAAA,EAChB;AAEA,QAAM,eAA+B,CAAC;AAItC,MAAI,gBAAgB,UAAU,OAAO,YAAY;AAC/C,UAAM,aAAa,OAAO;AAE1B,UAAM,kBAAkB,CAAC,EAAE,YAAY,MACrC,eAAe,EAAE,KAAK,YAAY,IAAI,CAAC;AAEzC,UAAM,yBAAyB,MAAM;AACnC,qBAAe;AAAA,QACb,KAAK,WAAW,aAAa;AAAA,QAC7B,qBAAqB;AAAA,MACvB,CAAC;AAAA,IACH;AAKA,eAAW,iBAAiB,YAAY,eAAe;AACvD,eAAW,iBAAiB,mBAAmB,sBAAsB;AACrE,iBAAa,KAAK,MAAM,WAAW,oBAAoB,YAAY,eAAe,CAAC;AACnF,iBAAa;AAAA,MAAK,MAChB,WAAW,oBAAoB,mBAAmB,sBAAsB;AAAA,IAC1E;AAEA,WAAO,MAAM;AACX,mBAAa,QAAQ,OAAK,EAAE,CAAC;AAAA,IAC/B;AAAA,EACF;AAQA,MAAI,iBAAoC;AAExC,QAAM,eAAe,CAAC,MAAkB;AACtC,UAAM,IACJ,EAAE,eAAe,GAAG,KAAK,OAAK,aAAa,iBAAiB,MAC3D,EAAE,kBAAkB,WAAW,EAAE,OAAO,UAAU,GAAG;AAExD,QAAI,CAAC;AAAG;AAER,qBAAiB,EAAE,MAAM,EAAE,MAAM,WAAW,KAAK,IAAI,EAAE;AAEvD,UAAM,qBAAqB,eAAe;AAC1C,QAAI,yBAAyB;AAI7B,UAAM,4BAA4B,MAAM;AACtC,YAAM,MAAM,eAAe;AAE3B,UAAI,QAAQ,oBAAoB;AAE9B,uBAAe,EAAE,KAAK,YAAY,KAAK,CAAC;AACxC;AAAA,MACF;AAGA,UAAI,EAAE,yBAAyB,6BAA6B;AAC1D,eAAO,WAAW,2BAA2B,kCAAkC;AAAA,MACjF;AAAA,IACF;AAEA,WAAO,WAAW,2BAA2B,kCAAkC;AAAA,EACjF;AAEA,SAAO,SAAS;AAAA,IACd;AAAA,IACA;AAAA,IACA,EAAE,SAAS,KAAK;AAAA;AAAA,EAClB;AAEA,eAAa;AAAA,IAAK,MAChB,OAAO,SAAS,oBAAoB,SAAS,cAAc,EAAE,SAAS,KAAK,CAAC;AAAA,EAC9E;AAGA,QAAM,gBAAgB,MAAM;AAC1B,QAAI,CAAC;AAAgB;AAErB,UAAM,mBAAmB,KAAK,IAAI,IAAI,eAAe;AACrD,mBAAe;AAAA,MACb,KAAK,mBAAmB,gCAAiC,eAAe,QAAQ,OAAQ;AAAA,MACxF,YAAY;AAAA,IACd,CAAC;AAED,qBAAiB;AAAA,EACnB;AAEA,SAAO,iBAAiB,gBAAgB,aAAa;AACrD,eAAa,KAAK,MAAM,OAAO,oBAAoB,gBAAgB,aAAa,CAAC;AAEjF,SAAO,MAAM;AACX,iBAAa,QAAQ,OAAK,EAAE,CAAC;AAAA,EAC/B;AACF;AAEA,MAAM,iBAAiB,MACrB,OAAO,WAAW,cAAc,OAAO,SAAS,OAAO;","names":[]}
@@ -3,7 +3,9 @@ import {
3
3
  deserializeSiteVersion,
4
4
  secondsUntilSiteVersionExpiration
5
5
  } from "../api/site-version";
6
- import { createApiHandler } from "../api-handler";
6
+ import {
7
+ createApiHandler
8
+ } from "../api-handler";
7
9
  import { SET_COOKIE_HEADER, cookieSettingOptions } from "../api-handler/cookies";
8
10
  import { REDIRECT_SEARCH_PARAM, redirectLiveHandler } from "../api-handler/handlers/redirect-live";
9
11
  import { toApiRequest, pipeResponseTo } from "../api-handler/node-request-response";
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/unstable-framework-support/index.ts"],"sourcesContent":["export {\n type SiteVersion,\n serializeSiteVersion,\n deserializeSiteVersion,\n secondsUntilSiteVersionExpiration,\n} from '../api/site-version'\n\nexport { type ApiHandlerUserConfig, createApiHandler } from '../api-handler'\nexport { SET_COOKIE_HEADER, cookieSettingOptions } from '../api-handler/cookies'\nexport { REDIRECT_SEARCH_PARAM, redirectLiveHandler } from '../api-handler/handlers/redirect-live'\nexport { toApiRequest, pipeResponseTo } from '../api-handler/node-request-response'\nexport { MAKESWIFT_SITE_VERSION_COOKIE, SearchParams } from '../api-handler/preview'\n\nexport { MakeswiftClient } from '../client'\n\nexport { type BreakpointsInput as Breakpoints } from '../state/modules/breakpoints'\n\nexport {\n FrameworkContext,\n DefaultHead,\n DefaultHeadSnippet,\n DefaultImage,\n} from '../runtimes/react/components/framework-context'\n\nexport { MakeswiftComponent } from '../runtimes/react/components/MakeswiftComponent'\nexport { Page } from '../runtimes/react/components/page'\nexport { RuntimeProvider } from '../runtimes/react/components/RuntimeProvider'\nexport { Slot } from '../runtimes/react/components/Slot'\n\nexport { GoogleFontLink } from '../runtimes/react/components/GoogleFontLink'\nexport { MakeswiftFonts } from '../runtimes/react/components/MakeswiftFonts'\n\nexport {\n createRootStyleCache,\n RootStyleRegistry,\n styleTagHtml,\n StyleTagSSR,\n type RootStyleProps,\n} from '../runtimes/react/root-style-registry'\n\nexport { ReactRuntime } from '../runtimes/react/react-runtime'\n"],"mappings":"AAAA;AAAA,EAEE;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAEP,SAAoC,wBAAwB;AAC5D,SAAS,mBAAmB,4BAA4B;AACxD,SAAS,uBAAuB,2BAA2B;AAC3D,SAAS,cAAc,sBAAsB;AAC7C,SAAS,+BAA+B,oBAAoB;AAE5D,SAAS,uBAAuB;AAIhC;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAEP,SAAS,0BAA0B;AACnC,SAAS,YAAY;AACrB,SAAS,uBAAuB;AAChC,SAAS,YAAY;AAErB,SAAS,sBAAsB;AAC/B,SAAS,sBAAsB;AAE/B;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAEK;AAEP,SAAS,oBAAoB;","names":[]}
1
+ {"version":3,"sources":["../../../src/unstable-framework-support/index.ts"],"sourcesContent":["export {\n type SiteVersion,\n serializeSiteVersion,\n deserializeSiteVersion,\n secondsUntilSiteVersionExpiration,\n} from '../api/site-version'\n\nexport {\n type ApiHandlerUserConfig,\n createApiHandler,\n type SitePublishedWebhookPayloadData,\n} from '../api-handler'\nexport { SET_COOKIE_HEADER, cookieSettingOptions } from '../api-handler/cookies'\nexport { REDIRECT_SEARCH_PARAM, redirectLiveHandler } from '../api-handler/handlers/redirect-live'\nexport { toApiRequest, pipeResponseTo } from '../api-handler/node-request-response'\nexport { MAKESWIFT_SITE_VERSION_COOKIE, SearchParams } from '../api-handler/preview'\n\nexport { MakeswiftClient } from '../client'\n\nexport { type BreakpointsInput as Breakpoints } from '../state/modules/breakpoints'\n\nexport {\n FrameworkContext,\n DefaultHead,\n DefaultHeadSnippet,\n DefaultImage,\n} from '../runtimes/react/components/framework-context'\n\nexport { MakeswiftComponent } from '../runtimes/react/components/MakeswiftComponent'\nexport { Page } from '../runtimes/react/components/page'\nexport { RuntimeProvider } from '../runtimes/react/components/RuntimeProvider'\nexport { Slot } from '../runtimes/react/components/Slot'\n\nexport { GoogleFontLink } from '../runtimes/react/components/GoogleFontLink'\nexport { MakeswiftFonts } from '../runtimes/react/components/MakeswiftFonts'\n\nexport {\n createRootStyleCache,\n RootStyleRegistry,\n styleTagHtml,\n StyleTagSSR,\n type RootStyleProps,\n} from '../runtimes/react/root-style-registry'\n\nexport { ReactRuntime } from '../runtimes/react/react-runtime'\n"],"mappings":"AAAA;AAAA,EAEE;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAEP;AAAA,EAEE;AAAA,OAEK;AACP,SAAS,mBAAmB,4BAA4B;AACxD,SAAS,uBAAuB,2BAA2B;AAC3D,SAAS,cAAc,sBAAsB;AAC7C,SAAS,+BAA+B,oBAAoB;AAE5D,SAAS,uBAAuB;AAIhC;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAEP,SAAS,0BAA0B;AACnC,SAAS,YAAY;AACrB,SAAS,uBAAuB;AAChC,SAAS,YAAY;AAErB,SAAS,sBAAsB;AAC/B,SAAS,sBAAsB;AAE/B;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAEK;AAEP,SAAS,oBAAoB;","names":[]}
@@ -0,0 +1,201 @@
1
+ import { z } from 'zod';
2
+ export declare const diffProjectionSchema: z.ZodObject<{
3
+ components: z.ZodArray<z.ZodObject<{
4
+ id: z.ZodString;
5
+ locale: z.ZodNullable<z.ZodString>;
6
+ changeType: z.ZodEnum<["created", "updated", "deleted"]>;
7
+ }, "strip", z.ZodTypeAny, {
8
+ id: string;
9
+ locale: string | null;
10
+ changeType: "deleted" | "created" | "updated";
11
+ }, {
12
+ id: string;
13
+ locale: string | null;
14
+ changeType: "deleted" | "created" | "updated";
15
+ }>, "many">;
16
+ pages: z.ZodArray<z.ZodObject<{
17
+ pageId: z.ZodString;
18
+ locale: z.ZodNullable<z.ZodString>;
19
+ changeType: z.ZodEnum<["created", "updated", "deleted"]>;
20
+ pathname: z.ZodString;
21
+ previousPathname: z.ZodOptional<z.ZodString>;
22
+ }, "strip", z.ZodTypeAny, {
23
+ pathname: string;
24
+ locale: string | null;
25
+ pageId: string;
26
+ changeType: "deleted" | "created" | "updated";
27
+ previousPathname?: string | undefined;
28
+ }, {
29
+ pathname: string;
30
+ locale: string | null;
31
+ pageId: string;
32
+ changeType: "deleted" | "created" | "updated";
33
+ previousPathname?: string | undefined;
34
+ }>, "many">;
35
+ globalElements: z.ZodArray<z.ZodObject<{
36
+ id: z.ZodString;
37
+ locale: z.ZodNullable<z.ZodString>;
38
+ changeType: z.ZodEnum<["created", "updated", "deleted"]>;
39
+ }, "strip", z.ZodTypeAny, {
40
+ id: string;
41
+ locale: string | null;
42
+ changeType: "deleted" | "created" | "updated";
43
+ }, {
44
+ id: string;
45
+ locale: string | null;
46
+ changeType: "deleted" | "created" | "updated";
47
+ }>, "many">;
48
+ swatches: z.ZodArray<z.ZodObject<{
49
+ id: z.ZodString;
50
+ changeType: z.ZodEnum<["created", "updated", "deleted"]>;
51
+ }, "strip", z.ZodTypeAny, {
52
+ id: string;
53
+ changeType: "deleted" | "created" | "updated";
54
+ }, {
55
+ id: string;
56
+ changeType: "deleted" | "created" | "updated";
57
+ }>, "many">;
58
+ typographies: z.ZodArray<z.ZodObject<{
59
+ id: z.ZodString;
60
+ changeType: z.ZodEnum<["created", "updated", "deleted"]>;
61
+ }, "strip", z.ZodTypeAny, {
62
+ id: string;
63
+ changeType: "deleted" | "created" | "updated";
64
+ }, {
65
+ id: string;
66
+ changeType: "deleted" | "created" | "updated";
67
+ }>, "many">;
68
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
69
+ components: z.ZodArray<z.ZodObject<{
70
+ id: z.ZodString;
71
+ locale: z.ZodNullable<z.ZodString>;
72
+ changeType: z.ZodEnum<["created", "updated", "deleted"]>;
73
+ }, "strip", z.ZodTypeAny, {
74
+ id: string;
75
+ locale: string | null;
76
+ changeType: "deleted" | "created" | "updated";
77
+ }, {
78
+ id: string;
79
+ locale: string | null;
80
+ changeType: "deleted" | "created" | "updated";
81
+ }>, "many">;
82
+ pages: z.ZodArray<z.ZodObject<{
83
+ pageId: z.ZodString;
84
+ locale: z.ZodNullable<z.ZodString>;
85
+ changeType: z.ZodEnum<["created", "updated", "deleted"]>;
86
+ pathname: z.ZodString;
87
+ previousPathname: z.ZodOptional<z.ZodString>;
88
+ }, "strip", z.ZodTypeAny, {
89
+ pathname: string;
90
+ locale: string | null;
91
+ pageId: string;
92
+ changeType: "deleted" | "created" | "updated";
93
+ previousPathname?: string | undefined;
94
+ }, {
95
+ pathname: string;
96
+ locale: string | null;
97
+ pageId: string;
98
+ changeType: "deleted" | "created" | "updated";
99
+ previousPathname?: string | undefined;
100
+ }>, "many">;
101
+ globalElements: z.ZodArray<z.ZodObject<{
102
+ id: z.ZodString;
103
+ locale: z.ZodNullable<z.ZodString>;
104
+ changeType: z.ZodEnum<["created", "updated", "deleted"]>;
105
+ }, "strip", z.ZodTypeAny, {
106
+ id: string;
107
+ locale: string | null;
108
+ changeType: "deleted" | "created" | "updated";
109
+ }, {
110
+ id: string;
111
+ locale: string | null;
112
+ changeType: "deleted" | "created" | "updated";
113
+ }>, "many">;
114
+ swatches: z.ZodArray<z.ZodObject<{
115
+ id: z.ZodString;
116
+ changeType: z.ZodEnum<["created", "updated", "deleted"]>;
117
+ }, "strip", z.ZodTypeAny, {
118
+ id: string;
119
+ changeType: "deleted" | "created" | "updated";
120
+ }, {
121
+ id: string;
122
+ changeType: "deleted" | "created" | "updated";
123
+ }>, "many">;
124
+ typographies: z.ZodArray<z.ZodObject<{
125
+ id: z.ZodString;
126
+ changeType: z.ZodEnum<["created", "updated", "deleted"]>;
127
+ }, "strip", z.ZodTypeAny, {
128
+ id: string;
129
+ changeType: "deleted" | "created" | "updated";
130
+ }, {
131
+ id: string;
132
+ changeType: "deleted" | "created" | "updated";
133
+ }>, "many">;
134
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
135
+ components: z.ZodArray<z.ZodObject<{
136
+ id: z.ZodString;
137
+ locale: z.ZodNullable<z.ZodString>;
138
+ changeType: z.ZodEnum<["created", "updated", "deleted"]>;
139
+ }, "strip", z.ZodTypeAny, {
140
+ id: string;
141
+ locale: string | null;
142
+ changeType: "deleted" | "created" | "updated";
143
+ }, {
144
+ id: string;
145
+ locale: string | null;
146
+ changeType: "deleted" | "created" | "updated";
147
+ }>, "many">;
148
+ pages: z.ZodArray<z.ZodObject<{
149
+ pageId: z.ZodString;
150
+ locale: z.ZodNullable<z.ZodString>;
151
+ changeType: z.ZodEnum<["created", "updated", "deleted"]>;
152
+ pathname: z.ZodString;
153
+ previousPathname: z.ZodOptional<z.ZodString>;
154
+ }, "strip", z.ZodTypeAny, {
155
+ pathname: string;
156
+ locale: string | null;
157
+ pageId: string;
158
+ changeType: "deleted" | "created" | "updated";
159
+ previousPathname?: string | undefined;
160
+ }, {
161
+ pathname: string;
162
+ locale: string | null;
163
+ pageId: string;
164
+ changeType: "deleted" | "created" | "updated";
165
+ previousPathname?: string | undefined;
166
+ }>, "many">;
167
+ globalElements: z.ZodArray<z.ZodObject<{
168
+ id: z.ZodString;
169
+ locale: z.ZodNullable<z.ZodString>;
170
+ changeType: z.ZodEnum<["created", "updated", "deleted"]>;
171
+ }, "strip", z.ZodTypeAny, {
172
+ id: string;
173
+ locale: string | null;
174
+ changeType: "deleted" | "created" | "updated";
175
+ }, {
176
+ id: string;
177
+ locale: string | null;
178
+ changeType: "deleted" | "created" | "updated";
179
+ }>, "many">;
180
+ swatches: z.ZodArray<z.ZodObject<{
181
+ id: z.ZodString;
182
+ changeType: z.ZodEnum<["created", "updated", "deleted"]>;
183
+ }, "strip", z.ZodTypeAny, {
184
+ id: string;
185
+ changeType: "deleted" | "created" | "updated";
186
+ }, {
187
+ id: string;
188
+ changeType: "deleted" | "created" | "updated";
189
+ }>, "many">;
190
+ typographies: z.ZodArray<z.ZodObject<{
191
+ id: z.ZodString;
192
+ changeType: z.ZodEnum<["created", "updated", "deleted"]>;
193
+ }, "strip", z.ZodTypeAny, {
194
+ id: string;
195
+ changeType: "deleted" | "created" | "updated";
196
+ }, {
197
+ id: string;
198
+ changeType: "deleted" | "created" | "updated";
199
+ }>, "many">;
200
+ }, z.ZodTypeAny, "passthrough">>;
201
+ //# sourceMappingURL=diff-projection.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"diff-projection.d.ts","sourceRoot":"","sources":["../../../../../src/api-handler/handlers/webhook/diff-projection.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAqCvB,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gCAWjB,CAAA"}
@@ -3,6 +3,6 @@ type SitePublishedParams = {
3
3
  onPublish?: OnPublish;
4
4
  revalidate: () => void;
5
5
  };
6
- export declare function handleSitePublished(_payload: SitePublishedWebhookPayload, { onPublish, revalidate }: SitePublishedParams): Promise<WebhookHandlerResult>;
6
+ export declare function handleSitePublished(payload: SitePublishedWebhookPayload, { onPublish, revalidate }: SitePublishedParams): Promise<WebhookHandlerResult>;
7
7
  export {};
8
8
  //# sourceMappingURL=site-published.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"site-published.d.ts","sourceRoot":"","sources":["../../../../../src/api-handler/handlers/webhook/site-published.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,SAAS,EACd,KAAK,2BAA2B,EAChC,KAAK,oBAAoB,EAC1B,MAAM,SAAS,CAAA;AAEhB,KAAK,mBAAmB,GAAG;IACzB,SAAS,CAAC,EAAE,SAAS,CAAA;IACrB,UAAU,EAAE,MAAM,IAAI,CAAA;CACvB,CAAA;AAED,wBAAsB,mBAAmB,CACvC,QAAQ,EAAE,2BAA2B,EACrC,EAAE,SAAS,EAAE,UAAU,EAAE,EAAE,mBAAmB,GAC7C,OAAO,CAAC,oBAAoB,CAAC,CAW/B"}
1
+ {"version":3,"file":"site-published.d.ts","sourceRoot":"","sources":["../../../../../src/api-handler/handlers/webhook/site-published.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,SAAS,EACd,KAAK,2BAA2B,EAChC,KAAK,oBAAoB,EAC1B,MAAM,SAAS,CAAA;AAEhB,KAAK,mBAAmB,GAAG;IACzB,SAAS,CAAC,EAAE,SAAS,CAAA;IACrB,UAAU,EAAE,MAAM,IAAI,CAAA;CACvB,CAAA;AAED,wBAAsB,mBAAmB,CACvC,OAAO,EAAE,2BAA2B,EACpC,EAAE,SAAS,EAAE,UAAU,EAAE,EAAE,mBAAmB,GAC7C,OAAO,CAAC,oBAAoB,CAAC,CAW/B"}