@wildo-ai/saas-website 1.1.2 → 1.1.4

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 (122) hide show
  1. package/dist/esm/astro/blog-post-bridge.d.ts +21 -0
  2. package/dist/esm/astro/blog-post-bridge.d.ts.map +1 -1
  3. package/dist/esm/astro/blog-post-bridge.js +5 -2
  4. package/dist/esm/astro/blog-post-bridge.js.map +1 -1
  5. package/dist/esm/astro/blog-post-head.renderer.d.ts.map +1 -1
  6. package/dist/esm/astro/bridge-runtime.d.ts +37 -0
  7. package/dist/esm/astro/bridge-runtime.d.ts.map +1 -1
  8. package/dist/esm/astro/bridge-runtime.js +6 -2
  9. package/dist/esm/astro/bridge-runtime.js.map +1 -1
  10. package/dist/esm/astro/collect-expected-label-keys.d.ts.map +1 -1
  11. package/dist/esm/astro/headers-renderer.d.ts.map +1 -1
  12. package/dist/esm/astro/i18n-routing.helper.d.ts.map +1 -1
  13. package/dist/esm/astro/label-pack-loader.d.ts.map +1 -1
  14. package/dist/esm/astro/llms-txt-server.d.ts.map +1 -1
  15. package/dist/esm/astro/pick-labels-for-page.d.ts.map +1 -1
  16. package/dist/esm/astro/robots-renderer.d.ts.map +1 -1
  17. package/dist/esm/astro/robots-renderer.js +14 -1
  18. package/dist/esm/astro/robots-renderer.js.map +1 -1
  19. package/dist/esm/astro/sitemap-coverage.d.ts.map +1 -1
  20. package/dist/esm/astro/structured-data.renderer.d.ts.map +1 -1
  21. package/dist/esm/astro/website-page-head.renderer.d.ts.map +1 -1
  22. package/dist/esm/astro/website-page-head.renderer.js +32 -12
  23. package/dist/esm/astro/website-page-head.renderer.js.map +1 -1
  24. package/dist/esm/astro/website-page-runtime.helper.d.ts.map +1 -1
  25. package/dist/esm/astro/website-site-context.d.ts.map +1 -1
  26. package/dist/esm/astro-island.d.ts.map +1 -1
  27. package/dist/esm/astro.d.ts.map +1 -1
  28. package/dist/esm/companion-exports.d.ts.map +1 -1
  29. package/dist/esm/components/low-level/WebsiteInternalButton.d.ts.map +1 -1
  30. package/dist/esm/components/low-level/WebsiteInternalLink.d.ts.map +1 -1
  31. package/dist/esm/config/define-website-config.d.ts.map +1 -1
  32. package/dist/esm/config/index.d.ts.map +1 -1
  33. package/dist/esm/config/load-website-config.d.ts.map +1 -1
  34. package/dist/esm/config/wildo-website-config.schemas.d.ts +12 -5
  35. package/dist/esm/config/wildo-website-config.schemas.d.ts.map +1 -1
  36. package/dist/esm/config/wildo-website-config.schemas.js +12 -5
  37. package/dist/esm/config/wildo-website-config.schemas.js.map +1 -1
  38. package/dist/esm/config-loader.d.ts.map +1 -1
  39. package/dist/esm/core/anonymous-session/InboundContactForm.d.ts.map +1 -1
  40. package/dist/esm/core/anonymous-session/inbound-contact-form.schema.d.ts +5 -5
  41. package/dist/esm/core/anonymous-session/inbound-contact-form.schema.d.ts.map +1 -1
  42. package/dist/esm/core/anonymous-session/inbound-contact-form.schema.js +7 -6
  43. package/dist/esm/core/anonymous-session/inbound-contact-form.schema.js.map +1 -1
  44. package/dist/esm/core/anonymous-session/website-anonymous-session-client.d.ts.map +1 -1
  45. package/dist/esm/core/contexts/WebsitePageContext.d.ts +4 -3
  46. package/dist/esm/core/contexts/WebsitePageContext.d.ts.map +1 -1
  47. package/dist/esm/core/contexts/WebsitePageContext.js.map +1 -1
  48. package/dist/esm/core/contexts/WebsiteRuntimeContext.d.ts +36 -7
  49. package/dist/esm/core/contexts/WebsiteRuntimeContext.d.ts.map +1 -1
  50. package/dist/esm/core/contexts/WebsiteRuntimeContext.js.map +1 -1
  51. package/dist/esm/core/contexts/WebsiteSectionContext.d.ts +3 -2
  52. package/dist/esm/core/contexts/WebsiteSectionContext.d.ts.map +1 -1
  53. package/dist/esm/core/contexts/WebsiteSectionContext.js.map +1 -1
  54. package/dist/esm/core/contexts/useWebsitePage.d.ts.map +1 -1
  55. package/dist/esm/core/contexts/useWebsiteRuntime.d.ts.map +1 -1
  56. package/dist/esm/core/contexts/useWebsiteSection.d.ts.map +1 -1
  57. package/dist/esm/core/external-providers/frontend-provider-registry.website.d.ts +37 -13
  58. package/dist/esm/core/external-providers/frontend-provider-registry.website.d.ts.map +1 -1
  59. package/dist/esm/core/external-providers/frontend-provider-registry.website.js +28 -19
  60. package/dist/esm/core/external-providers/frontend-provider-registry.website.js.map +1 -1
  61. package/dist/esm/core/external-providers/provider-scripts.website.d.ts +68 -0
  62. package/dist/esm/core/external-providers/provider-scripts.website.d.ts.map +1 -0
  63. package/dist/esm/core/external-providers/provider-scripts.website.js +99 -0
  64. package/dist/esm/core/external-providers/provider-scripts.website.js.map +1 -0
  65. package/dist/esm/core/external-providers/useWebsiteProviderScripts.d.ts +34 -0
  66. package/dist/esm/core/external-providers/useWebsiteProviderScripts.d.ts.map +1 -0
  67. package/dist/esm/core/external-providers/useWebsiteProviderScripts.js +78 -0
  68. package/dist/esm/core/external-providers/useWebsiteProviderScripts.js.map +1 -0
  69. package/dist/esm/core/factories/define-website-page-manifest.d.ts.map +1 -1
  70. package/dist/esm/core/factories/define-website-section.d.ts.map +1 -1
  71. package/dist/esm/core/hooks/useWebsiteDesignTokens.d.ts.map +1 -1
  72. package/dist/esm/core/hooks/useWebsiteLabel.d.ts.map +1 -1
  73. package/dist/esm/core/layouts/WebsitePageLayout.d.ts.map +1 -1
  74. package/dist/esm/core/layouts/WebsitePageLayout.js +7 -0
  75. package/dist/esm/core/layouts/WebsitePageLayout.js.map +1 -1
  76. package/dist/esm/core/layouts/WebsiteSection.d.ts.map +1 -1
  77. package/dist/esm/core/routing/internal-routing.utils.d.ts.map +1 -1
  78. package/dist/esm/index.d.ts.map +1 -1
  79. package/dist/esm/mdx/BlogPost.d.ts.map +1 -1
  80. package/dist/esm/mdx/blog-post-collection.config.d.ts.map +1 -1
  81. package/dist/esm/mdx/blog-post-frontmatter-source.d.ts.map +1 -1
  82. package/dist/esm/mdx/index.d.ts.map +1 -1
  83. package/dist/esm/mdx.d.ts.map +1 -1
  84. package/dist/esm/schemas/blog/blog-post-frontmatter.shared.schemas.d.ts.map +1 -1
  85. package/dist/esm/schemas/design-tokens/website-design-tokens.shared.schemas.d.ts.map +1 -1
  86. package/dist/esm/schemas/label-keys/website-label-key.schemas.d.ts.map +1 -1
  87. package/dist/esm/schemas/manifests/website-page-manifest.shared.schemas.d.ts.map +1 -1
  88. package/dist/esm/schemas/manifests/website-root-config.shared.schemas.d.ts.map +1 -1
  89. package/dist/esm/schemas/refs/page-ref.schemas.d.ts.map +1 -1
  90. package/dist/esm/schemas/refs/section-ref.schemas.d.ts.map +1 -1
  91. package/dist/esm/schemas/sections/website-section-category.shared.d.ts +19 -20
  92. package/dist/esm/schemas/sections/website-section-category.shared.d.ts.map +1 -1
  93. package/dist/esm/schemas/sections/website-section-category.shared.js +19 -20
  94. package/dist/esm/schemas/sections/website-section-category.shared.js.map +1 -1
  95. package/dist/esm/schemas/sections/website-section-definition.shared.schemas.d.ts.map +1 -1
  96. package/dist/esm/schemas/validators/label-pack.validator.d.ts.map +1 -1
  97. package/dist/tsconfig.build.tsbuildinfo +1 -1
  98. package/package.json +5 -4
  99. package/src/__tests__/bundle-isolation.test.ts +21 -0
  100. package/src/astro/__tests__/blog-post-bridge.test.tsx +2 -2
  101. package/src/astro/__tests__/bridge-runtime.test.tsx +57 -2
  102. package/src/astro/__tests__/robots-renderer.test.ts +16 -1
  103. package/src/astro/__tests__/website-page-head.renderer.test.ts +43 -0
  104. package/src/astro/__tests__/website-site-context.test.ts +1 -1
  105. package/src/astro/blog-post-bridge.tsx +26 -1
  106. package/src/astro/bridge-runtime.tsx +44 -1
  107. package/src/astro/robots-renderer.ts +14 -1
  108. package/src/astro/website-page-head.renderer.ts +32 -12
  109. package/src/config/__tests__/define-website-config.test.ts +9 -3
  110. package/src/config/wildo-website-config.schemas.ts +12 -5
  111. package/src/core/__tests__/WebsitePageLayout.test.tsx +47 -4
  112. package/src/core/anonymous-session/inbound-contact-form.schema.ts +7 -6
  113. package/src/core/contexts/WebsitePageContext.tsx +4 -3
  114. package/src/core/contexts/WebsiteRuntimeContext.tsx +36 -7
  115. package/src/core/contexts/WebsiteSectionContext.tsx +3 -2
  116. package/src/core/external-providers/__tests__/frontend-provider-registry.website.test.ts +79 -0
  117. package/src/core/external-providers/__tests__/provider-scripts.website.test.ts +146 -0
  118. package/src/core/external-providers/frontend-provider-registry.website.ts +53 -54
  119. package/src/core/external-providers/provider-scripts.website.ts +126 -0
  120. package/src/core/external-providers/useWebsiteProviderScripts.ts +92 -0
  121. package/src/core/layouts/WebsitePageLayout.tsx +11 -0
  122. package/src/schemas/sections/website-section-category.shared.ts +19 -20
@@ -1 +1 @@
1
- {"version":3,"file":"WebsiteSectionContext.d.ts","sourceRoot":"","sources":["../../../../../src/core/contexts/WebsiteSectionContext.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAiB,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAE7D,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,wDAAwD,CAAC;AACrG,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,wCAAwC,CAAC;AAEhF;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,WAAW,0BAA0B;IACzC;;;OAGG;IACH,UAAU,EAAE,iBAAiB,CAAC;IAC9B;;;;;OAKG;IACH,QAAQ,EAAE,sBAAsB,CAAC;CAClC;AAED,eAAO,MAAM,qBAAqB,EAAE,KAAK,CAAC,OAAO,CAAC,0BAA0B,GAAG,IAAI,CAC3B,CAAC;AAEzD,MAAM,WAAW,kCAAkC;IACjD,KAAK,EAAE,0BAA0B,CAAC;IAClC,QAAQ,EAAE,SAAS,CAAC;CACrB;AAED,wBAAgB,6BAA6B,CAAC,EAC5C,KAAK,EACL,QAAQ,GACT,EAAE,kCAAkC,GAAG,SAAS,CAMhD;yBATe,6BAA6B;;;AAW7C,0DAA0D"}
1
+ {"version":3,"file":"WebsiteSectionContext.d.ts","sourceRoot":"","sources":["../../../../src/core/contexts/WebsiteSectionContext.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAiB,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAE7D,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,wDAAwD,CAAC;AACrG,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,wCAAwC,CAAC;AAEhF;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,WAAW,0BAA0B;IACzC;;;OAGG;IACH,UAAU,EAAE,iBAAiB,CAAC;IAC9B;;;;;OAKG;IACH,QAAQ,EAAE,sBAAsB,CAAC;CAClC;AAED,eAAO,MAAM,qBAAqB,EAAE,KAAK,CAAC,OAAO,CAAC,0BAA0B,GAAG,IAAI,CAC3B,CAAC;AAEzD,MAAM,WAAW,kCAAkC;IACjD,KAAK,EAAE,0BAA0B,CAAC;IAClC,QAAQ,EAAE,SAAS,CAAC;CACrB;AAED,wBAAgB,6BAA6B,CAAC,EAC5C,KAAK,EACL,QAAQ,GACT,EAAE,kCAAkC,GAAG,SAAS,CAMhD;yBATe,6BAA6B;;;AAW7C,0DAA0D"}
@@ -1 +1 @@
1
- {"version":3,"file":"WebsiteSectionContext.js","sourceRoot":"","sources":["../../../../../src/core/contexts/WebsiteSectionContext.tsx"],"names":[],"mappings":";AAAA,OAAc,EAAE,aAAa,EAAkB,MAAM,OAAO,CAAC;AAuC7D,MAAM,CAAC,MAAM,qBAAqB,GAChC,aAAa,CAAoC,IAAI,CAAC,CAAC;AAOzD,MAAM,UAAU,6BAA6B,CAAC,EAC5C,KAAK,EACL,QAAQ,GAC2B;IACnC,OAAO,CACL,KAAC,qBAAqB,CAAC,QAAQ,IAAC,KAAK,EAAE,KAAK,YACzC,QAAQ,GACsB,CAClC,CAAC;AACJ,CAAC;AACD,6BAA6B,CAAC,WAAW,GAAG,+BAA+B,CAAC","sourcesContent":["import React, { createContext, type ReactNode } from 'react';\n\nimport type { WebsiteSectionCategory } from '../../schemas/sections/website-section-category.shared';\nimport type { WebsiteSectionRef } from '../../schemas/refs/section-ref.schemas';\n\n/**\n * @wildo_source:part:start saas.website.section.context facet:layer:core facet:family:website\n *\n * `WebsiteSectionContext` — identity + metadata of the section\n * currently rendering. Provided by `<WebsiteSection>` and consumed\n * by `useWebsiteLabel(leaf)` to compose the full label key, by\n * analytics overlays that need the category, and by SEO emitters\n * that decorate sections with `data-*` attributes.\n *\n * **Why expose `category` here (not just `sectionRef`)**: the\n * category is the section's semantic role (`hero`, `cta`, `social`,\n * etc.) and is needed by overlay tooling and analytics consumers\n * that don't know the per-site `sectionRef` vocabulary. Bundling\n * both saves consumers from having to thread the manifest just to\n * map a ref back to its category.\n *\n * **Why a separate file from the hook**: same Fast-Refresh rationale\n * as the runtime + page contexts.\n */\nexport interface WebsiteSectionContextValue {\n /**\n * The validated `WebsiteSectionRef` of the section currently\n * rendering. Composed by `useWebsiteLabel(leaf)` into the full key.\n */\n sectionRef: WebsiteSectionRef;\n /**\n * The semantic category of the section (`hero` / `cta` / etc.).\n * Sourced from the matching `WebsiteSectionDefinition.category`\n * by the host adapter and surfaced here so analytics + SEO\n * tooling does not need to re-resolve it.\n */\n category: WebsiteSectionCategory;\n}\n\nexport const WebsiteSectionContext: React.Context<WebsiteSectionContextValue | null> =\n createContext<WebsiteSectionContextValue | null>(null);\n\nexport interface WebsiteSectionContextProviderProps {\n value: WebsiteSectionContextValue;\n children: ReactNode;\n}\n\nexport function WebsiteSectionContextProvider({\n value,\n children,\n}: WebsiteSectionContextProviderProps): ReactNode {\n return (\n <WebsiteSectionContext.Provider value={value}>\n {children}\n </WebsiteSectionContext.Provider>\n );\n}\nWebsiteSectionContextProvider.displayName = 'WebsiteSectionContextProvider';\n/** @wildo_source:part:end saas.website.section.context */\n"]}
1
+ {"version":3,"file":"WebsiteSectionContext.js","sourceRoot":"","sources":["../../../../src/core/contexts/WebsiteSectionContext.tsx"],"names":[],"mappings":";AAAA,OAAc,EAAE,aAAa,EAAkB,MAAM,OAAO,CAAC;AAwC7D,MAAM,CAAC,MAAM,qBAAqB,GAChC,aAAa,CAAoC,IAAI,CAAC,CAAC;AAOzD,MAAM,UAAU,6BAA6B,CAAC,EAC5C,KAAK,EACL,QAAQ,GAC2B;IACnC,OAAO,CACL,KAAC,qBAAqB,CAAC,QAAQ,IAAC,KAAK,EAAE,KAAK,YACzC,QAAQ,GACsB,CAClC,CAAC;AACJ,CAAC;AACD,6BAA6B,CAAC,WAAW,GAAG,+BAA+B,CAAC","sourcesContent":["import React, { createContext, type ReactNode } from 'react';\n\nimport type { WebsiteSectionCategory } from '../../schemas/sections/website-section-category.shared';\nimport type { WebsiteSectionRef } from '../../schemas/refs/section-ref.schemas';\n\n/**\n * @wildo_source:part:start saas.website.section.context facet:layer:core facet:family:website\n *\n * `WebsiteSectionContext` — identity + metadata of the section\n * currently rendering. Provided by `<WebsiteSection>` and consumed\n * by `useWebsiteLabel(leaf)` to compose the full label key, by\n * analytics overlays that need the category, and by SEO emitters\n * that decorate sections with `data-*` attributes.\n *\n * **Why expose `category` here (not just `sectionRef`)**: the\n * category is the section's semantic role (`hero`, `cta`, `social`,\n * etc.) and is needed by overlay tooling and analytics consumers\n * that don't know the per-site `sectionRef` vocabulary. Bundling\n * both saves consumers from having to thread the manifest just to\n * map a ref back to its category.\n *\n * **Why the hook lives in a separate file**: same Fast-Refresh\n * rationale as the runtime + page contexts — context and provider\n * together here, the hook alone in `useWebsiteSection.ts`.\n */\nexport interface WebsiteSectionContextValue {\n /**\n * The validated `WebsiteSectionRef` of the section currently\n * rendering. Composed by `useWebsiteLabel(leaf)` into the full key.\n */\n sectionRef: WebsiteSectionRef;\n /**\n * The semantic category of the section (`hero` / `cta` / etc.).\n * Sourced from the matching `WebsiteSectionDefinition.category`\n * by the host adapter and surfaced here so analytics + SEO\n * tooling does not need to re-resolve it.\n */\n category: WebsiteSectionCategory;\n}\n\nexport const WebsiteSectionContext: React.Context<WebsiteSectionContextValue | null> =\n createContext<WebsiteSectionContextValue | null>(null);\n\nexport interface WebsiteSectionContextProviderProps {\n value: WebsiteSectionContextValue;\n children: ReactNode;\n}\n\nexport function WebsiteSectionContextProvider({\n value,\n children,\n}: WebsiteSectionContextProviderProps): ReactNode {\n return (\n <WebsiteSectionContext.Provider value={value}>\n {children}\n </WebsiteSectionContext.Provider>\n );\n}\nWebsiteSectionContextProvider.displayName = 'WebsiteSectionContextProvider';\n/** @wildo_source:part:end saas.website.section.context */\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"useWebsitePage.d.ts","sourceRoot":"","sources":["../../../../../src/core/contexts/useWebsitePage.ts"],"names":[],"mappings":"AAEA,OAAO,EAEL,KAAK,uBAAuB,EAC7B,MAAM,sBAAsB,CAAC;AAE9B;;;;;;;;GAQG;AACH,wBAAgB,cAAc,IAAI,uBAAuB,CAUxD;AACD,wDAAwD"}
1
+ {"version":3,"file":"useWebsitePage.d.ts","sourceRoot":"","sources":["../../../../src/core/contexts/useWebsitePage.ts"],"names":[],"mappings":"AAEA,OAAO,EAEL,KAAK,uBAAuB,EAC7B,MAAM,sBAAsB,CAAC;AAE9B;;;;;;;;GAQG;AACH,wBAAgB,cAAc,IAAI,uBAAuB,CAUxD;AACD,wDAAwD"}
@@ -1 +1 @@
1
- {"version":3,"file":"useWebsiteRuntime.d.ts","sourceRoot":"","sources":["../../../../../src/core/contexts/useWebsiteRuntime.ts"],"names":[],"mappings":"AAEA,OAAO,EAEL,KAAK,0BAA0B,EAChC,MAAM,yBAAyB,CAAC;AAEjC;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,iBAAiB,IAAI,0BAA0B,CAU9D;AACD,2DAA2D"}
1
+ {"version":3,"file":"useWebsiteRuntime.d.ts","sourceRoot":"","sources":["../../../../src/core/contexts/useWebsiteRuntime.ts"],"names":[],"mappings":"AAEA,OAAO,EAEL,KAAK,0BAA0B,EAChC,MAAM,yBAAyB,CAAC;AAEjC;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,iBAAiB,IAAI,0BAA0B,CAU9D;AACD,2DAA2D"}
@@ -1 +1 @@
1
- {"version":3,"file":"useWebsiteSection.d.ts","sourceRoot":"","sources":["../../../../../src/core/contexts/useWebsiteSection.ts"],"names":[],"mappings":"AAEA,OAAO,EAEL,KAAK,0BAA0B,EAChC,MAAM,yBAAyB,CAAC;AAEjC;;;;;;;GAOG;AACH,wBAAgB,iBAAiB,IAAI,0BAA0B,CAW9D;AACD,2DAA2D"}
1
+ {"version":3,"file":"useWebsiteSection.d.ts","sourceRoot":"","sources":["../../../../src/core/contexts/useWebsiteSection.ts"],"names":[],"mappings":"AAEA,OAAO,EAEL,KAAK,0BAA0B,EAChC,MAAM,yBAAyB,CAAC;AAEjC;;;;;;;GAOG;AACH,wBAAgB,iBAAiB,IAAI,0BAA0B,CAW9D;AACD,2DAA2D"}
@@ -1,17 +1,41 @@
1
- import type { FrontendProviderEntry, FrontendProvidersBlock, ProviderCapability } from '@wildo-ai/saas-models/public-runtime';
2
- export type FrontendWebsiteProviderRef = string & {
3
- readonly __brand: 'FrontendWebsiteProviderRef';
4
- };
5
- export type FrontendWebsiteProviderModule = FrontendProviderEntry;
6
- export interface FrontendWebsiteProviderRegistry {
7
- readonly modules: ReadonlyMap<FrontendWebsiteProviderRef, FrontendWebsiteProviderModule>;
8
- getProviderByRef(ref: FrontendWebsiteProviderRef): FrontendWebsiteProviderModule | undefined;
9
- getProvidersByProviderCapability(providerCapability: ProviderCapability): ReadonlyArray<FrontendWebsiteProviderModule>;
10
- findProviderByProviderCapability(providerCapability: ProviderCapability): FrontendWebsiteProviderModule | undefined;
1
+ /**
2
+ * The website's provider registry — now composed from BOTH channels.
3
+ *
4
+ * It used to build itself by casting each served `FrontendProviderEntry` to a
5
+ * module type that was an alias of that entry, which made the cast true and
6
+ * useless: the registry could never hold anything a JSON payload could not
7
+ * carry, so a provider's SDK loader had nowhere to arrive.
8
+ *
9
+ * - **DATA** — the materialized frontend-services block for THIS website
10
+ * service. Authoritative for which providers are on, in this environment.
11
+ * - **CODE** — `generatedFrontendProviderModules` from the website's own
12
+ * `src/generated/frontend-providers.generated.ts`, written by
13
+ * `wildo config sync` and handed in by the Astro bridge.
14
+ *
15
+ * The types are now the engine's own website-facet types rather than local
16
+ * aliases, so a provider module authored against
17
+ * `@wildo-ai/external-connectors-public/website` is the same type this registry
18
+ * holds. Re-exported under the same names so every consumer's import is
19
+ * unchanged.
20
+ */
21
+ import { type GeneratedWebsiteProviderModules } from '@wildo-ai/external-connectors-public/website';
22
+ import type { FrontendProvidersBlock } from '@wildo-ai/saas-models/public-runtime';
23
+ import type { FrontendProviderHydrationDiagnostic } from '@wildo-ai/external-connectors-public/website';
24
+ export type { FrontendWebsiteProviderModule, FrontendWebsiteProviderRef, FrontendWebsiteProviderRegistry, GeneratedWebsiteProviderModules, } from '@wildo-ai/external-connectors-public/website';
25
+ import type { FrontendWebsiteProviderRegistry } from '@wildo-ai/external-connectors-public/website';
26
+ export interface CreateFrontendWebsiteProviderRegistryInput {
27
+ /** The DATA channel: the materialized block for this website service. */
28
+ readonly entries?: FrontendProvidersBlock;
29
+ /**
30
+ * The CODE channel. Absent is the ordinary case for a website that declares
31
+ * no package-shipped provider — `wildo config sync` writes no generated file,
32
+ * so there is nothing to import and nothing to pass.
33
+ */
34
+ readonly modules?: GeneratedWebsiteProviderModules;
35
+ readonly onDiagnostic?: (diagnostic: FrontendProviderHydrationDiagnostic) => void;
11
36
  }
12
37
  /**
13
- * Website-side public-provider registry hydrated from the materialized
14
- * frontend-provider bootstrap block.
38
+ * Website-side public-provider registry, hydrated from both channels.
15
39
  */
16
- export declare function createFrontendWebsiteProviderRegistry(frontendProviders?: FrontendProvidersBlock): FrontendWebsiteProviderRegistry;
40
+ export declare function createFrontendWebsiteProviderRegistry(input?: CreateFrontendWebsiteProviderRegistryInput): FrontendWebsiteProviderRegistry;
17
41
  //# sourceMappingURL=frontend-provider-registry.website.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"frontend-provider-registry.website.d.ts","sourceRoot":"","sources":["../../../../../src/core/external-providers/frontend-provider-registry.website.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,qBAAqB,EACrB,sBAAsB,EACtB,kBAAkB,EACnB,MAAM,sCAAsC,CAAC;AAE9C,MAAM,MAAM,0BAA0B,GAAG,MAAM,GAAG;IAChD,QAAQ,CAAC,OAAO,EAAE,4BAA4B,CAAC;CAChD,CAAC;AAEF,MAAM,MAAM,6BAA6B,GAAG,qBAAqB,CAAC;AAElE,MAAM,WAAW,+BAA+B;IAC9C,QAAQ,CAAC,OAAO,EAAE,WAAW,CAC3B,0BAA0B,EAC1B,6BAA6B,CAC9B,CAAC;IAEF,gBAAgB,CACd,GAAG,EAAE,0BAA0B,GAC9B,6BAA6B,GAAG,SAAS,CAAC;IAE7C,gCAAgC,CAC9B,kBAAkB,EAAE,kBAAkB,GACrC,aAAa,CAAC,6BAA6B,CAAC,CAAC;IAEhD,gCAAgC,CAC9B,kBAAkB,EAAE,kBAAkB,GACrC,6BAA6B,GAAG,SAAS,CAAC;CAC9C;AAED;;;GAGG;AACH,wBAAgB,qCAAqC,CACnD,iBAAiB,CAAC,EAAE,sBAAsB,GACzC,+BAA+B,CAwBjC"}
1
+ {"version":3,"file":"frontend-provider-registry.website.d.ts","sourceRoot":"","sources":["../../../../src/core/external-providers/frontend-provider-registry.website.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAEL,KAAK,+BAA+B,EACrC,MAAM,8CAA8C,CAAC;AACtD,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,sCAAsC,CAAC;AACnF,OAAO,KAAK,EAAE,mCAAmC,EAAE,MAAM,8CAA8C,CAAC;AAExG,YAAY,EACV,6BAA6B,EAC7B,0BAA0B,EAC1B,+BAA+B,EAC/B,+BAA+B,GAChC,MAAM,8CAA8C,CAAC;AAEtD,OAAO,KAAK,EAAE,+BAA+B,EAAE,MAAM,8CAA8C,CAAC;AAEpG,MAAM,WAAW,0CAA0C;IACzD,yEAAyE;IACzE,QAAQ,CAAC,OAAO,CAAC,EAAE,sBAAsB,CAAC;IAC1C;;;;OAIG;IACH,QAAQ,CAAC,OAAO,CAAC,EAAE,+BAA+B,CAAC;IACnD,QAAQ,CAAC,YAAY,CAAC,EAAE,CAAC,UAAU,EAAE,mCAAmC,KAAK,IAAI,CAAC;CACnF;AAED;;GAEG;AACH,wBAAgB,qCAAqC,CACnD,KAAK,CAAC,EAAE,0CAA0C,GACjD,+BAA+B,CAMjC"}
@@ -1,23 +1,32 @@
1
1
  /**
2
- * Website-side public-provider registry hydrated from the materialized
3
- * frontend-provider bootstrap block.
2
+ * The website's provider registry — now composed from BOTH channels.
3
+ *
4
+ * It used to build itself by casting each served `FrontendProviderEntry` to a
5
+ * module type that was an alias of that entry, which made the cast true and
6
+ * useless: the registry could never hold anything a JSON payload could not
7
+ * carry, so a provider's SDK loader had nowhere to arrive.
8
+ *
9
+ * - **DATA** — the materialized frontend-services block for THIS website
10
+ * service. Authoritative for which providers are on, in this environment.
11
+ * - **CODE** — `generatedFrontendProviderModules` from the website's own
12
+ * `src/generated/frontend-providers.generated.ts`, written by
13
+ * `wildo config sync` and handed in by the Astro bridge.
14
+ *
15
+ * The types are now the engine's own website-facet types rather than local
16
+ * aliases, so a provider module authored against
17
+ * `@wildo-ai/external-connectors-public/website` is the same type this registry
18
+ * holds. Re-exported under the same names so every consumer's import is
19
+ * unchanged.
4
20
  */
5
- export function createFrontendWebsiteProviderRegistry(frontendProviders) {
6
- const modules = new Map(Object.entries(frontendProviders?.providers ?? {}).map(([ref, provider]) => [
7
- ref,
8
- provider,
9
- ]));
10
- return {
11
- modules,
12
- getProviderByRef(ref) {
13
- return modules.get(ref);
14
- },
15
- getProvidersByProviderCapability(providerCapability) {
16
- return [...modules.values()].filter((provider) => provider.providerCapabilities.includes(providerCapability));
17
- },
18
- findProviderByProviderCapability(providerCapability) {
19
- return [...modules.values()].find((provider) => provider.providerCapabilities.includes(providerCapability));
20
- },
21
- };
21
+ import { composeHydratedFrontendWebsiteProviders, } from '@wildo-ai/external-connectors-public/website';
22
+ /**
23
+ * Website-side public-provider registry, hydrated from both channels.
24
+ */
25
+ export function createFrontendWebsiteProviderRegistry(input) {
26
+ return composeHydratedFrontendWebsiteProviders({
27
+ entries: input?.entries,
28
+ modules: input?.modules,
29
+ onDiagnostic: input?.onDiagnostic,
30
+ });
22
31
  }
23
32
  //# sourceMappingURL=frontend-provider-registry.website.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"frontend-provider-registry.website.js","sourceRoot":"","sources":["../../../../../src/core/external-providers/frontend-provider-registry.website.ts"],"names":[],"mappings":"AA+BA;;;GAGG;AACH,MAAM,UAAU,qCAAqC,CACnD,iBAA0C;IAE1C,MAAM,OAAO,GAAG,IAAI,GAAG,CACrB,MAAM,CAAC,OAAO,CAAC,iBAAiB,EAAE,SAAS,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE,QAAQ,CAAC,EAAE,EAAE,CAAC;QAC1E,GAAiC;QACjC,QAAyC;KAC1C,CAAC,CACH,CAAC;IAEF,OAAO;QACL,OAAO;QACP,gBAAgB,CAAC,GAA+B;YAC9C,OAAO,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QAC1B,CAAC;QACD,gCAAgC,CAAC,kBAAsC;YACrE,OAAO,CAAC,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,QAAQ,EAAE,EAAE,CAC/C,QAAQ,CAAC,oBAAoB,CAAC,QAAQ,CAAC,kBAAkB,CAAC,CAC3D,CAAC;QACJ,CAAC;QACD,gCAAgC,CAAC,kBAAsC;YACrE,OAAO,CAAC,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE,EAAE,CAC7C,QAAQ,CAAC,oBAAoB,CAAC,QAAQ,CAAC,kBAAkB,CAAC,CAC3D,CAAC;QACJ,CAAC;KACF,CAAC;AACJ,CAAC","sourcesContent":["import type {\n FrontendProviderEntry,\n FrontendProvidersBlock,\n ProviderCapability,\n} from '@wildo-ai/saas-models/public-runtime';\n\nexport type FrontendWebsiteProviderRef = string & {\n readonly __brand: 'FrontendWebsiteProviderRef';\n};\n\nexport type FrontendWebsiteProviderModule = FrontendProviderEntry;\n\nexport interface FrontendWebsiteProviderRegistry {\n readonly modules: ReadonlyMap<\n FrontendWebsiteProviderRef,\n FrontendWebsiteProviderModule\n >;\n\n getProviderByRef(\n ref: FrontendWebsiteProviderRef,\n ): FrontendWebsiteProviderModule | undefined;\n\n getProvidersByProviderCapability(\n providerCapability: ProviderCapability,\n ): ReadonlyArray<FrontendWebsiteProviderModule>;\n\n findProviderByProviderCapability(\n providerCapability: ProviderCapability,\n ): FrontendWebsiteProviderModule | undefined;\n}\n\n/**\n * Website-side public-provider registry hydrated from the materialized\n * frontend-provider bootstrap block.\n */\nexport function createFrontendWebsiteProviderRegistry(\n frontendProviders?: FrontendProvidersBlock,\n): FrontendWebsiteProviderRegistry {\n const modules = new Map<FrontendWebsiteProviderRef, FrontendWebsiteProviderModule>(\n Object.entries(frontendProviders?.providers ?? {}).map(([ref, provider]) => [\n ref as FrontendWebsiteProviderRef,\n provider as FrontendWebsiteProviderModule,\n ]),\n );\n\n return {\n modules,\n getProviderByRef(ref: FrontendWebsiteProviderRef) {\n return modules.get(ref);\n },\n getProvidersByProviderCapability(providerCapability: ProviderCapability) {\n return [...modules.values()].filter((provider) =>\n provider.providerCapabilities.includes(providerCapability),\n );\n },\n findProviderByProviderCapability(providerCapability: ProviderCapability) {\n return [...modules.values()].find((provider) =>\n provider.providerCapabilities.includes(providerCapability),\n );\n },\n };\n}\n"]}
1
+ {"version":3,"file":"frontend-provider-registry.website.js","sourceRoot":"","sources":["../../../../src/core/external-providers/frontend-provider-registry.website.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EACL,uCAAuC,GAExC,MAAM,8CAA8C,CAAC;AAyBtD;;GAEG;AACH,MAAM,UAAU,qCAAqC,CACnD,KAAkD;IAElD,OAAO,uCAAuC,CAAC;QAC7C,OAAO,EAAE,KAAK,EAAE,OAAO;QACvB,OAAO,EAAE,KAAK,EAAE,OAAO;QACvB,YAAY,EAAE,KAAK,EAAE,YAAY;KAClC,CAAC,CAAC;AACL,CAAC","sourcesContent":["/**\n * The website's provider registry — now composed from BOTH channels.\n *\n * It used to build itself by casting each served `FrontendProviderEntry` to a\n * module type that was an alias of that entry, which made the cast true and\n * useless: the registry could never hold anything a JSON payload could not\n * carry, so a provider's SDK loader had nowhere to arrive.\n *\n * - **DATA** — the materialized frontend-services block for THIS website\n * service. Authoritative for which providers are on, in this environment.\n * - **CODE** — `generatedFrontendProviderModules` from the website's own\n * `src/generated/frontend-providers.generated.ts`, written by\n * `wildo config sync` and handed in by the Astro bridge.\n *\n * The types are now the engine's own website-facet types rather than local\n * aliases, so a provider module authored against\n * `@wildo-ai/external-connectors-public/website` is the same type this registry\n * holds. Re-exported under the same names so every consumer's import is\n * unchanged.\n */\n\nimport {\n composeHydratedFrontendWebsiteProviders,\n type GeneratedWebsiteProviderModules,\n} from '@wildo-ai/external-connectors-public/website';\nimport type { FrontendProvidersBlock } from '@wildo-ai/saas-models/public-runtime';\nimport type { FrontendProviderHydrationDiagnostic } from '@wildo-ai/external-connectors-public/website';\n\nexport type {\n FrontendWebsiteProviderModule,\n FrontendWebsiteProviderRef,\n FrontendWebsiteProviderRegistry,\n GeneratedWebsiteProviderModules,\n} from '@wildo-ai/external-connectors-public/website';\n\nimport type { FrontendWebsiteProviderRegistry } from '@wildo-ai/external-connectors-public/website';\n\nexport interface CreateFrontendWebsiteProviderRegistryInput {\n /** The DATA channel: the materialized block for this website service. */\n readonly entries?: FrontendProvidersBlock;\n /**\n * The CODE channel. Absent is the ordinary case for a website that declares\n * no package-shipped provider — `wildo config sync` writes no generated file,\n * so there is nothing to import and nothing to pass.\n */\n readonly modules?: GeneratedWebsiteProviderModules;\n readonly onDiagnostic?: (diagnostic: FrontendProviderHydrationDiagnostic) => void;\n}\n\n/**\n * Website-side public-provider registry, hydrated from both channels.\n */\nexport function createFrontendWebsiteProviderRegistry(\n input?: CreateFrontendWebsiteProviderRegistryInput,\n): FrontendWebsiteProviderRegistry {\n return composeHydratedFrontendWebsiteProviders({\n entries: input?.entries,\n modules: input?.modules,\n onDiagnostic: input?.onDiagnostic,\n });\n}\n"]}
@@ -0,0 +1,68 @@
1
+ /**
2
+ * Loading what a website provider actually declared, instead of naming it.
3
+ *
4
+ * `FRONTEND_SDK` was a label on this surface. The layout resolved the analytics,
5
+ * error-monitoring and captcha provider refs and stamped them into `data-*`
6
+ * attributes on the page root; no consumer loaded anything. A provider could be
7
+ * declared, enabled, hydrated — and do nothing at all.
8
+ *
9
+ * This is the consumer for the DATA half of a provider's executable surface: the
10
+ * `scripts` it declares (#332). It serves the case a dynamic `import()` cannot,
11
+ * and it is the dominant case on a marketing site: a vendor that ships a
12
+ * global-installing `<script>` tag rather than an npm module (reCAPTCHA, tag
13
+ * managers, chat widgets, and the CDN distributions of most analytics SDKs).
14
+ *
15
+ * The npm half — `sdk.activate`, a dynamic import inside the provider package —
16
+ * needs the CODE channel, which needs this package to depend on
17
+ * `@wildo-ai/external-connectors-public`. That dependency is not added here; see
18
+ * the note in the S4a ledger. Nothing below anticipates it: a provider that
19
+ * declares both gets its scripts from here and its SDK from there.
20
+ *
21
+ * ## Client-side injection, and the alternative that was rejected
22
+ *
23
+ * This is an Astro static site, so the "obvious" home for a third-party tag is
24
+ * the built HTML `<head>`. That was rejected for now: the set of live providers
25
+ * is per SERVICE and per ENVIRONMENT, resolved from the materialized artifact,
26
+ * while the built HTML is one artifact shared across deploys of the same build.
27
+ * Baking the tags in would make the build environment-specific — the same class
28
+ * of coupling the DATA channel exists to avoid. Injecting from the client keeps
29
+ * one build correct everywhere, at the cost of the tag arriving after hydration.
30
+ * Revisit if a provider ever needs to run before first paint.
31
+ */
32
+ import type { ProviderFrontendScriptDeclaration } from '@wildo-ai/saas-models/public-runtime';
33
+ import type { FrontendWebsiteProviderRegistry } from './frontend-provider-registry.website';
34
+ /**
35
+ * Marks a `<script>` this module owns, so a re-render, a client-side route
36
+ * change or a second layout mount finds it instead of appending a duplicate.
37
+ * A vendor tag loaded twice initialises twice — two analytics clients, two sets
38
+ * of events — which is the failure mode this attribute exists to prevent.
39
+ */
40
+ export declare const PROVIDER_SCRIPT_MARKER_ATTRIBUTE = "data-wildo-provider-script";
41
+ export interface DeclaredProviderScript {
42
+ readonly providerRef: string;
43
+ readonly declaration: ProviderFrontendScriptDeclaration;
44
+ }
45
+ /**
46
+ * Every script declared by the providers live on this surface, in registry
47
+ * order, with the declaring ref kept beside each one so a failure can name it.
48
+ */
49
+ export declare function collectDeclaredProviderScripts(registry: FrontendWebsiteProviderRegistry | undefined): ReadonlyArray<DeclaredProviderScript>;
50
+ export interface InjectProviderScriptsResult {
51
+ /** Refs whose script this call added. */
52
+ readonly injected: ReadonlyArray<string>;
53
+ /** Refs whose script was already present, so nothing was added. */
54
+ readonly alreadyPresent: ReadonlyArray<string>;
55
+ }
56
+ /**
57
+ * Adds each declared script to the document, once.
58
+ *
59
+ * Idempotent by `src`: a declaration whose element is already in the document is
60
+ * skipped. Callers may therefore run this on every mount without tracking state.
61
+ *
62
+ * `async` defaults to TRUE when the declaration says nothing. A third-party tag
63
+ * that blocks parsing is the single most common way an analytics provider costs
64
+ * a marketing site its paint metrics, and a provider author who has not thought
65
+ * about it should get the safe answer rather than the blocking one.
66
+ */
67
+ export declare function injectProviderScripts(scripts: ReadonlyArray<DeclaredProviderScript>, targetDocument: Document): InjectProviderScriptsResult;
68
+ //# sourceMappingURL=provider-scripts.website.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"provider-scripts.website.d.ts","sourceRoot":"","sources":["../../../../src/core/external-providers/provider-scripts.website.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AAEH,OAAO,KAAK,EAAE,iCAAiC,EAAE,MAAM,sCAAsC,CAAC;AAC9F,OAAO,KAAK,EAAE,+BAA+B,EAAE,MAAM,sCAAsC,CAAC;AAE5F;;;;;GAKG;AACH,eAAO,MAAM,gCAAgC,+BAA+B,CAAC;AAE7E,MAAM,WAAW,sBAAsB;IACrC,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,WAAW,EAAE,iCAAiC,CAAC;CACzD;AAED;;;GAGG;AACH,wBAAgB,8BAA8B,CAC5C,QAAQ,EAAE,+BAA+B,GAAG,SAAS,GACpD,aAAa,CAAC,sBAAsB,CAAC,CAUvC;AAED,MAAM,WAAW,2BAA2B;IAC1C,yCAAyC;IACzC,QAAQ,CAAC,QAAQ,EAAE,aAAa,CAAC,MAAM,CAAC,CAAC;IACzC,mEAAmE;IACnE,QAAQ,CAAC,cAAc,EAAE,aAAa,CAAC,MAAM,CAAC,CAAC;CAChD;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,qBAAqB,CACnC,OAAO,EAAE,aAAa,CAAC,sBAAsB,CAAC,EAC9C,cAAc,EAAE,QAAQ,GACvB,2BAA2B,CAsC7B"}
@@ -0,0 +1,99 @@
1
+ /**
2
+ * Loading what a website provider actually declared, instead of naming it.
3
+ *
4
+ * `FRONTEND_SDK` was a label on this surface. The layout resolved the analytics,
5
+ * error-monitoring and captcha provider refs and stamped them into `data-*`
6
+ * attributes on the page root; no consumer loaded anything. A provider could be
7
+ * declared, enabled, hydrated — and do nothing at all.
8
+ *
9
+ * This is the consumer for the DATA half of a provider's executable surface: the
10
+ * `scripts` it declares (#332). It serves the case a dynamic `import()` cannot,
11
+ * and it is the dominant case on a marketing site: a vendor that ships a
12
+ * global-installing `<script>` tag rather than an npm module (reCAPTCHA, tag
13
+ * managers, chat widgets, and the CDN distributions of most analytics SDKs).
14
+ *
15
+ * The npm half — `sdk.activate`, a dynamic import inside the provider package —
16
+ * needs the CODE channel, which needs this package to depend on
17
+ * `@wildo-ai/external-connectors-public`. That dependency is not added here; see
18
+ * the note in the S4a ledger. Nothing below anticipates it: a provider that
19
+ * declares both gets its scripts from here and its SDK from there.
20
+ *
21
+ * ## Client-side injection, and the alternative that was rejected
22
+ *
23
+ * This is an Astro static site, so the "obvious" home for a third-party tag is
24
+ * the built HTML `<head>`. That was rejected for now: the set of live providers
25
+ * is per SERVICE and per ENVIRONMENT, resolved from the materialized artifact,
26
+ * while the built HTML is one artifact shared across deploys of the same build.
27
+ * Baking the tags in would make the build environment-specific — the same class
28
+ * of coupling the DATA channel exists to avoid. Injecting from the client keeps
29
+ * one build correct everywhere, at the cost of the tag arriving after hydration.
30
+ * Revisit if a provider ever needs to run before first paint.
31
+ */
32
+ /**
33
+ * Marks a `<script>` this module owns, so a re-render, a client-side route
34
+ * change or a second layout mount finds it instead of appending a duplicate.
35
+ * A vendor tag loaded twice initialises twice — two analytics clients, two sets
36
+ * of events — which is the failure mode this attribute exists to prevent.
37
+ */
38
+ export const PROVIDER_SCRIPT_MARKER_ATTRIBUTE = 'data-wildo-provider-script';
39
+ /**
40
+ * Every script declared by the providers live on this surface, in registry
41
+ * order, with the declaring ref kept beside each one so a failure can name it.
42
+ */
43
+ export function collectDeclaredProviderScripts(registry) {
44
+ if (registry === undefined)
45
+ return [];
46
+ const collected = [];
47
+ for (const provider of registry.modules.values()) {
48
+ for (const declaration of provider.scripts ?? []) {
49
+ collected.push({ providerRef: provider.metadata.ref, declaration });
50
+ }
51
+ }
52
+ return collected;
53
+ }
54
+ /**
55
+ * Adds each declared script to the document, once.
56
+ *
57
+ * Idempotent by `src`: a declaration whose element is already in the document is
58
+ * skipped. Callers may therefore run this on every mount without tracking state.
59
+ *
60
+ * `async` defaults to TRUE when the declaration says nothing. A third-party tag
61
+ * that blocks parsing is the single most common way an analytics provider costs
62
+ * a marketing site its paint metrics, and a provider author who has not thought
63
+ * about it should get the safe answer rather than the blocking one.
64
+ */
65
+ export function injectProviderScripts(scripts, targetDocument) {
66
+ const injected = [];
67
+ const alreadyPresent = [];
68
+ for (const { providerRef, declaration } of scripts) {
69
+ // Matched by reading the attribute rather than by a selector carrying the
70
+ // URL: a `src` can contain characters a CSS selector would have to escape,
71
+ // and an escaping bug here would show up as a duplicated vendor tag — two
72
+ // analytics clients, two sets of events — rather than as an error.
73
+ const existing = [
74
+ ...targetDocument.querySelectorAll(`script[${PROVIDER_SCRIPT_MARKER_ATTRIBUTE}]`),
75
+ ].some((element) => element.getAttribute('src') === declaration.src);
76
+ if (existing) {
77
+ alreadyPresent.push(providerRef);
78
+ continue;
79
+ }
80
+ const element = targetDocument.createElement('script');
81
+ element.src = declaration.src;
82
+ element.setAttribute(PROVIDER_SCRIPT_MARKER_ATTRIBUTE, providerRef);
83
+ if (declaration.integrity !== undefined) {
84
+ element.integrity = declaration.integrity;
85
+ }
86
+ if (declaration.crossOrigin !== undefined) {
87
+ element.crossOrigin = declaration.crossOrigin;
88
+ }
89
+ // Both flags are set explicitly rather than left to the element's defaults:
90
+ // a dynamically created script is `async` by default, so `defer: true` alone
91
+ // would be silently ignored without the paired `async = false`.
92
+ element.async = declaration.async ?? declaration.defer !== true;
93
+ element.defer = declaration.defer ?? false;
94
+ targetDocument.head.appendChild(element);
95
+ injected.push(providerRef);
96
+ }
97
+ return { injected, alreadyPresent };
98
+ }
99
+ //# sourceMappingURL=provider-scripts.website.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"provider-scripts.website.js","sourceRoot":"","sources":["../../../../src/core/external-providers/provider-scripts.website.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AAKH;;;;;GAKG;AACH,MAAM,CAAC,MAAM,gCAAgC,GAAG,4BAA4B,CAAC;AAO7E;;;GAGG;AACH,MAAM,UAAU,8BAA8B,CAC5C,QAAqD;IAErD,IAAI,QAAQ,KAAK,SAAS;QAAE,OAAO,EAAE,CAAC;IAEtC,MAAM,SAAS,GAA6B,EAAE,CAAC;IAC/C,KAAK,MAAM,QAAQ,IAAI,QAAQ,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC;QACjD,KAAK,MAAM,WAAW,IAAI,QAAQ,CAAC,OAAO,IAAI,EAAE,EAAE,CAAC;YACjD,SAAS,CAAC,IAAI,CAAC,EAAE,WAAW,EAAE,QAAQ,CAAC,QAAQ,CAAC,GAAG,EAAE,WAAW,EAAE,CAAC,CAAC;QACtE,CAAC;IACH,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC;AASD;;;;;;;;;;GAUG;AACH,MAAM,UAAU,qBAAqB,CACnC,OAA8C,EAC9C,cAAwB;IAExB,MAAM,QAAQ,GAAa,EAAE,CAAC;IAC9B,MAAM,cAAc,GAAa,EAAE,CAAC;IAEpC,KAAK,MAAM,EAAE,WAAW,EAAE,WAAW,EAAE,IAAI,OAAO,EAAE,CAAC;QACnD,0EAA0E;QAC1E,2EAA2E;QAC3E,0EAA0E;QAC1E,mEAAmE;QACnE,MAAM,QAAQ,GAAG;YACf,GAAG,cAAc,CAAC,gBAAgB,CAAC,UAAU,gCAAgC,GAAG,CAAC;SAClF,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,YAAY,CAAC,KAAK,CAAC,KAAK,WAAW,CAAC,GAAG,CAAC,CAAC;QACrE,IAAI,QAAQ,EAAE,CAAC;YACb,cAAc,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;YACjC,SAAS;QACX,CAAC;QAED,MAAM,OAAO,GAAG,cAAc,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC;QACvD,OAAO,CAAC,GAAG,GAAG,WAAW,CAAC,GAAG,CAAC;QAC9B,OAAO,CAAC,YAAY,CAAC,gCAAgC,EAAE,WAAW,CAAC,CAAC;QAEpE,IAAI,WAAW,CAAC,SAAS,KAAK,SAAS,EAAE,CAAC;YACxC,OAAO,CAAC,SAAS,GAAG,WAAW,CAAC,SAAS,CAAC;QAC5C,CAAC;QACD,IAAI,WAAW,CAAC,WAAW,KAAK,SAAS,EAAE,CAAC;YAC1C,OAAO,CAAC,WAAW,GAAG,WAAW,CAAC,WAAW,CAAC;QAChD,CAAC;QACD,4EAA4E;QAC5E,6EAA6E;QAC7E,gEAAgE;QAChE,OAAO,CAAC,KAAK,GAAG,WAAW,CAAC,KAAK,IAAI,WAAW,CAAC,KAAK,KAAK,IAAI,CAAC;QAChE,OAAO,CAAC,KAAK,GAAG,WAAW,CAAC,KAAK,IAAI,KAAK,CAAC;QAE3C,cAAc,CAAC,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;QACzC,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;IAC7B,CAAC;IAED,OAAO,EAAE,QAAQ,EAAE,cAAc,EAAE,CAAC;AACtC,CAAC","sourcesContent":["/**\n * Loading what a website provider actually declared, instead of naming it.\n *\n * `FRONTEND_SDK` was a label on this surface. The layout resolved the analytics,\n * error-monitoring and captcha provider refs and stamped them into `data-*`\n * attributes on the page root; no consumer loaded anything. A provider could be\n * declared, enabled, hydrated — and do nothing at all.\n *\n * This is the consumer for the DATA half of a provider's executable surface: the\n * `scripts` it declares (#332). It serves the case a dynamic `import()` cannot,\n * and it is the dominant case on a marketing site: a vendor that ships a\n * global-installing `<script>` tag rather than an npm module (reCAPTCHA, tag\n * managers, chat widgets, and the CDN distributions of most analytics SDKs).\n *\n * The npm half — `sdk.activate`, a dynamic import inside the provider package —\n * needs the CODE channel, which needs this package to depend on\n * `@wildo-ai/external-connectors-public`. That dependency is not added here; see\n * the note in the S4a ledger. Nothing below anticipates it: a provider that\n * declares both gets its scripts from here and its SDK from there.\n *\n * ## Client-side injection, and the alternative that was rejected\n *\n * This is an Astro static site, so the \"obvious\" home for a third-party tag is\n * the built HTML `<head>`. That was rejected for now: the set of live providers\n * is per SERVICE and per ENVIRONMENT, resolved from the materialized artifact,\n * while the built HTML is one artifact shared across deploys of the same build.\n * Baking the tags in would make the build environment-specific — the same class\n * of coupling the DATA channel exists to avoid. Injecting from the client keeps\n * one build correct everywhere, at the cost of the tag arriving after hydration.\n * Revisit if a provider ever needs to run before first paint.\n */\n\nimport type { ProviderFrontendScriptDeclaration } from '@wildo-ai/saas-models/public-runtime';\nimport type { FrontendWebsiteProviderRegistry } from './frontend-provider-registry.website';\n\n/**\n * Marks a `<script>` this module owns, so a re-render, a client-side route\n * change or a second layout mount finds it instead of appending a duplicate.\n * A vendor tag loaded twice initialises twice — two analytics clients, two sets\n * of events — which is the failure mode this attribute exists to prevent.\n */\nexport const PROVIDER_SCRIPT_MARKER_ATTRIBUTE = 'data-wildo-provider-script';\n\nexport interface DeclaredProviderScript {\n readonly providerRef: string;\n readonly declaration: ProviderFrontendScriptDeclaration;\n}\n\n/**\n * Every script declared by the providers live on this surface, in registry\n * order, with the declaring ref kept beside each one so a failure can name it.\n */\nexport function collectDeclaredProviderScripts(\n registry: FrontendWebsiteProviderRegistry | undefined,\n): ReadonlyArray<DeclaredProviderScript> {\n if (registry === undefined) return [];\n\n const collected: DeclaredProviderScript[] = [];\n for (const provider of registry.modules.values()) {\n for (const declaration of provider.scripts ?? []) {\n collected.push({ providerRef: provider.metadata.ref, declaration });\n }\n }\n return collected;\n}\n\nexport interface InjectProviderScriptsResult {\n /** Refs whose script this call added. */\n readonly injected: ReadonlyArray<string>;\n /** Refs whose script was already present, so nothing was added. */\n readonly alreadyPresent: ReadonlyArray<string>;\n}\n\n/**\n * Adds each declared script to the document, once.\n *\n * Idempotent by `src`: a declaration whose element is already in the document is\n * skipped. Callers may therefore run this on every mount without tracking state.\n *\n * `async` defaults to TRUE when the declaration says nothing. A third-party tag\n * that blocks parsing is the single most common way an analytics provider costs\n * a marketing site its paint metrics, and a provider author who has not thought\n * about it should get the safe answer rather than the blocking one.\n */\nexport function injectProviderScripts(\n scripts: ReadonlyArray<DeclaredProviderScript>,\n targetDocument: Document,\n): InjectProviderScriptsResult {\n const injected: string[] = [];\n const alreadyPresent: string[] = [];\n\n for (const { providerRef, declaration } of scripts) {\n // Matched by reading the attribute rather than by a selector carrying the\n // URL: a `src` can contain characters a CSS selector would have to escape,\n // and an escaping bug here would show up as a duplicated vendor tag — two\n // analytics clients, two sets of events — rather than as an error.\n const existing = [\n ...targetDocument.querySelectorAll(`script[${PROVIDER_SCRIPT_MARKER_ATTRIBUTE}]`),\n ].some((element) => element.getAttribute('src') === declaration.src);\n if (existing) {\n alreadyPresent.push(providerRef);\n continue;\n }\n\n const element = targetDocument.createElement('script');\n element.src = declaration.src;\n element.setAttribute(PROVIDER_SCRIPT_MARKER_ATTRIBUTE, providerRef);\n\n if (declaration.integrity !== undefined) {\n element.integrity = declaration.integrity;\n }\n if (declaration.crossOrigin !== undefined) {\n element.crossOrigin = declaration.crossOrigin;\n }\n // Both flags are set explicitly rather than left to the element's defaults:\n // a dynamically created script is `async` by default, so `defer: true` alone\n // would be silently ignored without the paired `async = false`.\n element.async = declaration.async ?? declaration.defer !== true;\n element.defer = declaration.defer ?? false;\n\n targetDocument.head.appendChild(element);\n injected.push(providerRef);\n }\n\n return { injected, alreadyPresent };\n}\n"]}
@@ -0,0 +1,34 @@
1
+ /**
2
+ * The website's executable-surface hooks: load what the live providers declared.
3
+ *
4
+ * Two mechanisms, one per kind of vendor. `useWebsiteProviderScripts` adds the
5
+ * `<script>` tags a provider declared — the case a dynamic `import()` cannot
6
+ * serve, and the dominant one on a marketing site. `useWebsiteProviderSdks`
7
+ * activates the npm SDK of any provider that ships one, which reaches this
8
+ * bundle through the CODE channel.
9
+ *
10
+ * Both are effect-only, and that is not incidental: this is an Astro site, so
11
+ * page modules execute in Node at build time. Injecting into a document that
12
+ * does not exist would throw, and starting a vendor SDK there would run a live
13
+ * analytics client inside a build.
14
+ *
15
+ * SDK activation comes from `@wildo-ai/external-connectors-public/website`, which
16
+ * this package now depends on. The script injector beside it does NOT yet, and
17
+ * that is a timing artifact rather than a decision: it belongs in the same
18
+ * package so the technical doc can use one copy — a second copy of a DOM
19
+ * mutation eventually disagrees about idempotence, which is how a vendor tag
20
+ * gets loaded twice. Moving it needs that package's `dist` to carry it, and no
21
+ * watcher is running in this tree; consolidating it is a one-step follow-up, not
22
+ * a design question.
23
+ */
24
+ import type { FrontendWebsiteProviderRegistry } from './frontend-provider-registry.website';
25
+ export declare function useWebsiteProviderScripts(registry: FrontendWebsiteProviderRegistry | undefined): void;
26
+ /**
27
+ * Loads and starts the npm SDK of every live provider that declares one.
28
+ *
29
+ * Unlike a script tag, an SDK activation IS undone on unmount where the vendor
30
+ * offers a teardown — an analytics client that cannot be stopped cannot honour
31
+ * a consent withdrawal, and accumulates one instance per view transition.
32
+ */
33
+ export declare function useWebsiteProviderSdks(registry: FrontendWebsiteProviderRegistry | undefined): void;
34
+ //# sourceMappingURL=useWebsiteProviderScripts.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useWebsiteProviderScripts.d.ts","sourceRoot":"","sources":["../../../../src/core/external-providers/useWebsiteProviderScripts.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAYH,OAAO,KAAK,EAAE,+BAA+B,EAAE,MAAM,sCAAsC,CAAC;AAE5F,wBAAgB,yBAAyB,CACvC,QAAQ,EAAE,+BAA+B,GAAG,SAAS,GACpD,IAAI,CAaN;AAED;;;;;;GAMG;AACH,wBAAgB,sBAAsB,CACpC,QAAQ,EAAE,+BAA+B,GAAG,SAAS,GACpD,IAAI,CA6BN"}
@@ -0,0 +1,78 @@
1
+ /**
2
+ * The website's executable-surface hooks: load what the live providers declared.
3
+ *
4
+ * Two mechanisms, one per kind of vendor. `useWebsiteProviderScripts` adds the
5
+ * `<script>` tags a provider declared — the case a dynamic `import()` cannot
6
+ * serve, and the dominant one on a marketing site. `useWebsiteProviderSdks`
7
+ * activates the npm SDK of any provider that ships one, which reaches this
8
+ * bundle through the CODE channel.
9
+ *
10
+ * Both are effect-only, and that is not incidental: this is an Astro site, so
11
+ * page modules execute in Node at build time. Injecting into a document that
12
+ * does not exist would throw, and starting a vendor SDK there would run a live
13
+ * analytics client inside a build.
14
+ *
15
+ * SDK activation comes from `@wildo-ai/external-connectors-public/website`, which
16
+ * this package now depends on. The script injector beside it does NOT yet, and
17
+ * that is a timing artifact rather than a decision: it belongs in the same
18
+ * package so the technical doc can use one copy — a second copy of a DOM
19
+ * mutation eventually disagrees about idempotence, which is how a vendor tag
20
+ * gets loaded twice. Moving it needs that package's `dist` to carry it, and no
21
+ * watcher is running in this tree; consolidating it is a one-step follow-up, not
22
+ * a design question.
23
+ */
24
+ import { useEffect } from 'react';
25
+ import { activateFrontendProviderSdks, } from '@wildo-ai/external-connectors-public/website';
26
+ import { collectDeclaredProviderScripts, injectProviderScripts, } from './provider-scripts.website.js';
27
+ import { AppFrontendType } from '@wildo-ai/saas-models/public-runtime';
28
+ export function useWebsiteProviderScripts(registry) {
29
+ useEffect(() => {
30
+ if (typeof document === 'undefined')
31
+ return;
32
+ const scripts = collectDeclaredProviderScripts(registry);
33
+ if (scripts.length === 0)
34
+ return;
35
+ injectProviderScripts(scripts, document);
36
+ // Deliberately no teardown. A vendor tag installs a global and often starts
37
+ // work immediately; removing the element undoes neither, so a cleanup that
38
+ // removed it would only make the next mount inject a SECOND copy of an
39
+ // already-running script. Idempotence by `src` is the real guard.
40
+ }, [registry]);
41
+ }
42
+ /**
43
+ * Loads and starts the npm SDK of every live provider that declares one.
44
+ *
45
+ * Unlike a script tag, an SDK activation IS undone on unmount where the vendor
46
+ * offers a teardown — an analytics client that cannot be stopped cannot honour
47
+ * a consent withdrawal, and accumulates one instance per view transition.
48
+ */
49
+ export function useWebsiteProviderSdks(registry) {
50
+ useEffect(() => {
51
+ if (registry === undefined)
52
+ return;
53
+ let unmounted = false;
54
+ let activated;
55
+ void activateFrontendProviderSdks({
56
+ surface: AppFrontendType.STATIC_WEBSITE,
57
+ modules: registry.modules.values(),
58
+ onDiagnostic: (diagnostic) => {
59
+ // The website runtime has no logger service, and a provider that cannot
60
+ // start is a developer-facing fact that must not be silent.
61
+ // eslint-disable-next-line no-console
62
+ console.warn(`[wildo-provider-sdk] ${diagnostic.kind}: ${diagnostic.message}`);
63
+ },
64
+ }).then((result) => {
65
+ activated = result;
66
+ // Activation is asynchronous and unmount is not: if the surface went away
67
+ // while a vendor bundle was still downloading, stop what we just started
68
+ // rather than leaving a client nobody can reach.
69
+ if (unmounted)
70
+ void result.deactivateAll();
71
+ });
72
+ return () => {
73
+ unmounted = true;
74
+ void activated?.deactivateAll();
75
+ };
76
+ }, [registry]);
77
+ }
78
+ //# sourceMappingURL=useWebsiteProviderScripts.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useWebsiteProviderScripts.js","sourceRoot":"","sources":["../../../../src/core/external-providers/useWebsiteProviderScripts.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAClC,OAAO,EACL,4BAA4B,GAE7B,MAAM,8CAA8C,CAAC;AACtD,OAAO,EACL,8BAA8B,EAC9B,qBAAqB,GACtB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,eAAe,EAAE,MAAM,sCAAsC,CAAC;AAGvE,MAAM,UAAU,yBAAyB,CACvC,QAAqD;IAErD,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,OAAO,QAAQ,KAAK,WAAW;YAAE,OAAO;QAE5C,MAAM,OAAO,GAAG,8BAA8B,CAAC,QAAQ,CAAC,CAAC;QACzD,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC;YAAE,OAAO;QAEjC,qBAAqB,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;QACzC,4EAA4E;QAC5E,2EAA2E;QAC3E,uEAAuE;QACvE,kEAAkE;IACpE,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC;AACjB,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,sBAAsB,CACpC,QAAqD;IAErD,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,QAAQ,KAAK,SAAS;YAAE,OAAO;QAEnC,IAAI,SAAS,GAAG,KAAK,CAAC;QACtB,IAAI,SAAoD,CAAC;QAEzD,KAAK,4BAA4B,CAAC;YAChC,OAAO,EAAE,eAAe,CAAC,cAAc;YACvC,OAAO,EAAE,QAAQ,CAAC,OAAO,CAAC,MAAM,EAAE;YAClC,YAAY,EAAE,CAAC,UAAU,EAAE,EAAE;gBAC3B,wEAAwE;gBACxE,4DAA4D;gBAC5D,sCAAsC;gBACtC,OAAO,CAAC,IAAI,CAAC,wBAAwB,UAAU,CAAC,IAAI,KAAK,UAAU,CAAC,OAAO,EAAE,CAAC,CAAC;YACjF,CAAC;SACF,CAAC,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,EAAE;YACjB,SAAS,GAAG,MAAM,CAAC;YACnB,0EAA0E;YAC1E,yEAAyE;YACzE,iDAAiD;YACjD,IAAI,SAAS;gBAAE,KAAK,MAAM,CAAC,aAAa,EAAE,CAAC;QAC7C,CAAC,CAAC,CAAC;QAEH,OAAO,GAAG,EAAE;YACV,SAAS,GAAG,IAAI,CAAC;YACjB,KAAK,SAAS,EAAE,aAAa,EAAE,CAAC;QAClC,CAAC,CAAC;IACJ,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC;AACjB,CAAC","sourcesContent":["/**\n * The website's executable-surface hooks: load what the live providers declared.\n *\n * Two mechanisms, one per kind of vendor. `useWebsiteProviderScripts` adds the\n * `<script>` tags a provider declared — the case a dynamic `import()` cannot\n * serve, and the dominant one on a marketing site. `useWebsiteProviderSdks`\n * activates the npm SDK of any provider that ships one, which reaches this\n * bundle through the CODE channel.\n *\n * Both are effect-only, and that is not incidental: this is an Astro site, so\n * page modules execute in Node at build time. Injecting into a document that\n * does not exist would throw, and starting a vendor SDK there would run a live\n * analytics client inside a build.\n *\n * SDK activation comes from `@wildo-ai/external-connectors-public/website`, which\n * this package now depends on. The script injector beside it does NOT yet, and\n * that is a timing artifact rather than a decision: it belongs in the same\n * package so the technical doc can use one copy — a second copy of a DOM\n * mutation eventually disagrees about idempotence, which is how a vendor tag\n * gets loaded twice. Moving it needs that package's `dist` to carry it, and no\n * watcher is running in this tree; consolidating it is a one-step follow-up, not\n * a design question.\n */\n\nimport { useEffect } from 'react';\nimport {\n activateFrontendProviderSdks,\n type ActivatedFrontendProviderSdks,\n} from '@wildo-ai/external-connectors-public/website';\nimport {\n collectDeclaredProviderScripts,\n injectProviderScripts,\n} from './provider-scripts.website';\nimport { AppFrontendType } from '@wildo-ai/saas-models/public-runtime';\nimport type { FrontendWebsiteProviderRegistry } from './frontend-provider-registry.website';\n\nexport function useWebsiteProviderScripts(\n registry: FrontendWebsiteProviderRegistry | undefined,\n): void {\n useEffect(() => {\n if (typeof document === 'undefined') return;\n\n const scripts = collectDeclaredProviderScripts(registry);\n if (scripts.length === 0) return;\n\n injectProviderScripts(scripts, document);\n // Deliberately no teardown. A vendor tag installs a global and often starts\n // work immediately; removing the element undoes neither, so a cleanup that\n // removed it would only make the next mount inject a SECOND copy of an\n // already-running script. Idempotence by `src` is the real guard.\n }, [registry]);\n}\n\n/**\n * Loads and starts the npm SDK of every live provider that declares one.\n *\n * Unlike a script tag, an SDK activation IS undone on unmount where the vendor\n * offers a teardown — an analytics client that cannot be stopped cannot honour\n * a consent withdrawal, and accumulates one instance per view transition.\n */\nexport function useWebsiteProviderSdks(\n registry: FrontendWebsiteProviderRegistry | undefined,\n): void {\n useEffect(() => {\n if (registry === undefined) return;\n\n let unmounted = false;\n let activated: ActivatedFrontendProviderSdks | undefined;\n\n void activateFrontendProviderSdks({\n surface: AppFrontendType.STATIC_WEBSITE,\n modules: registry.modules.values(),\n onDiagnostic: (diagnostic) => {\n // The website runtime has no logger service, and a provider that cannot\n // start is a developer-facing fact that must not be silent.\n // eslint-disable-next-line no-console\n console.warn(`[wildo-provider-sdk] ${diagnostic.kind}: ${diagnostic.message}`);\n },\n }).then((result) => {\n activated = result;\n // Activation is asynchronous and unmount is not: if the surface went away\n // while a vendor bundle was still downloading, stop what we just started\n // rather than leaving a client nobody can reach.\n if (unmounted) void result.deactivateAll();\n });\n\n return () => {\n unmounted = true;\n void activated?.deactivateAll();\n };\n }, [registry]);\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"define-website-page-manifest.d.ts","sourceRoot":"","sources":["../../../../../src/core/factories/define-website-page-manifest.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAE3C,OAAO,EAEL,KAAK,mBAAmB,EACxB,KAAK,wBAAwB,EAC7B,KAAK,oBAAoB,EACzB,KAAK,oBAAoB,EACzB,4BAA4B,EAC7B,MAAM,8DAA8D,CAAC;AACtE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qCAAqC,CAAC;AAC1E,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,wCAAwC,CAAC;AAEhF;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,WAAW,8BAA8B,CAAC,MAAM;IACpD,GAAG,EAAE,cAAc,GAAG,MAAM,CAAC;IAC7B,SAAS,EAAE,oBAAoB,GAAG,MAAM,CAAC;IACzC,aAAa,EAAE,aAAa,CAAC,MAAM,CAAC,CAAC;IACrC,WAAW,EAAE,SAAS,CAAC,iBAAiB,GAAG,MAAM,CAAC,EAAE,CAAC;IACrD,aAAa,EAAE,wBAAwB,CAAC;IACxC,SAAS,CAAC,EAAE,4BAA4B,CAAC;IACzC,GAAG,CAAC,EAAE,oBAAoB,CAAC;CAC5B;AAED;;;;GAIG;AACH,MAAM,WAAW,wBAAwB,CAAC,MAAM,CAC9C,SAAQ,IAAI,CAAC,mBAAmB,EAAE,eAAe,CAAC;IAClD,aAAa,EAAE,aAAa,CAAC,MAAM,CAAC,CAAC;CACtC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,wBAAgB,yBAAyB,CAAC,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,EACtE,KAAK,EAAE,8BAA8B,CAAC,MAAM,CAAC,GAC5C,wBAAwB,CAAC,MAAM,CAAC,CAmBlC;AACD,yEAAyE"}
1
+ {"version":3,"file":"define-website-page-manifest.d.ts","sourceRoot":"","sources":["../../../../src/core/factories/define-website-page-manifest.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAE3C,OAAO,EAEL,KAAK,mBAAmB,EACxB,KAAK,wBAAwB,EAC7B,KAAK,oBAAoB,EACzB,KAAK,oBAAoB,EACzB,4BAA4B,EAC7B,MAAM,8DAA8D,CAAC;AACtE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qCAAqC,CAAC;AAC1E,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,wCAAwC,CAAC;AAEhF;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,WAAW,8BAA8B,CAAC,MAAM;IACpD,GAAG,EAAE,cAAc,GAAG,MAAM,CAAC;IAC7B,SAAS,EAAE,oBAAoB,GAAG,MAAM,CAAC;IACzC,aAAa,EAAE,aAAa,CAAC,MAAM,CAAC,CAAC;IACrC,WAAW,EAAE,SAAS,CAAC,iBAAiB,GAAG,MAAM,CAAC,EAAE,CAAC;IACrD,aAAa,EAAE,wBAAwB,CAAC;IACxC,SAAS,CAAC,EAAE,4BAA4B,CAAC;IACzC,GAAG,CAAC,EAAE,oBAAoB,CAAC;CAC5B;AAED;;;;GAIG;AACH,MAAM,WAAW,wBAAwB,CAAC,MAAM,CAC9C,SAAQ,IAAI,CAAC,mBAAmB,EAAE,eAAe,CAAC;IAClD,aAAa,EAAE,aAAa,CAAC,MAAM,CAAC,CAAC;CACtC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,wBAAgB,yBAAyB,CAAC,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,EACtE,KAAK,EAAE,8BAA8B,CAAC,MAAM,CAAC,GAC5C,wBAAwB,CAAC,MAAM,CAAC,CAmBlC;AACD,yEAAyE"}
@@ -1 +1 @@
1
- {"version":3,"file":"define-website-section.d.ts","sourceRoot":"","sources":["../../../../../src/core/factories/define-website-section.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAG3C,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,kEAAkE,CAAC;AACjH,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,wDAAwD,CAAC;AACrG,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,wCAAwC,CAAC;AAChF,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oDAAoD,CAAC;AAC1F,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,sEAAsE,CAAC;AAExH;;;;;;;;;;;;;;;GAeG;AACH,MAAM,WAAW,yBAAyB,CAAC,MAAM;IAC/C,UAAU,EAAE,iBAAiB,GAAG,MAAM,CAAC;IACvC,QAAQ,EAAE,sBAAsB,CAAC;IACjC,iBAAiB,EAAE,SAAS,CAAC,eAAe,GAAG,MAAM,CAAC,EAAE,CAAC;IACzD,SAAS,EAAE,aAAa,CAAC,MAAM,CAAC,CAAC;IACjC;;;;;OAKG;IACH,iBAAiB,CAAC,EAAE,MAAM,2BAA2B,CAAC;CACvD;AAED;;;;;;;;;;;GAWG;AACH,MAAM,WAAW,6BAA6B,CAAC,MAAM,CACnD,SAAQ,IAAI,CAAC,wBAAwB,EAAE,WAAW,GAAG,mBAAmB,CAAC;IACzE,SAAS,EAAE,aAAa,CAAC,MAAM,CAAC,CAAC;IACjC,iBAAiB,CAAC,EAAE,MAAM,2BAA2B,CAAC;CACvD;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8CG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EACzC,KAAK,EAAE,yBAAyB,CAAC,MAAM,CAAC,GACvC,6BAA6B,CAAC,MAAM,CAAC,CAoBvC;AACD,mEAAmE"}
1
+ {"version":3,"file":"define-website-section.d.ts","sourceRoot":"","sources":["../../../../src/core/factories/define-website-section.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAG3C,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,kEAAkE,CAAC;AACjH,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,wDAAwD,CAAC;AACrG,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,wCAAwC,CAAC;AAChF,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oDAAoD,CAAC;AAC1F,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,sEAAsE,CAAC;AAExH;;;;;;;;;;;;;;;GAeG;AACH,MAAM,WAAW,yBAAyB,CAAC,MAAM;IAC/C,UAAU,EAAE,iBAAiB,GAAG,MAAM,CAAC;IACvC,QAAQ,EAAE,sBAAsB,CAAC;IACjC,iBAAiB,EAAE,SAAS,CAAC,eAAe,GAAG,MAAM,CAAC,EAAE,CAAC;IACzD,SAAS,EAAE,aAAa,CAAC,MAAM,CAAC,CAAC;IACjC;;;;;OAKG;IACH,iBAAiB,CAAC,EAAE,MAAM,2BAA2B,CAAC;CACvD;AAED;;;;;;;;;;;GAWG;AACH,MAAM,WAAW,6BAA6B,CAAC,MAAM,CACnD,SAAQ,IAAI,CAAC,wBAAwB,EAAE,WAAW,GAAG,mBAAmB,CAAC;IACzE,SAAS,EAAE,aAAa,CAAC,MAAM,CAAC,CAAC;IACjC,iBAAiB,CAAC,EAAE,MAAM,2BAA2B,CAAC;CACvD;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8CG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EACzC,KAAK,EAAE,yBAAyB,CAAC,MAAM,CAAC,GACvC,6BAA6B,CAAC,MAAM,CAAC,CAoBvC;AACD,mEAAmE"}
@@ -1 +1 @@
1
- {"version":3,"file":"useWebsiteDesignTokens.d.ts","sourceRoot":"","sources":["../../../../../src/core/hooks/useWebsiteDesignTokens.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,kEAAkE,CAAC;AAE5G;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,sBAAsB,IAAI,mBAAmB,CAE5D;AACD,0DAA0D"}
1
+ {"version":3,"file":"useWebsiteDesignTokens.d.ts","sourceRoot":"","sources":["../../../../src/core/hooks/useWebsiteDesignTokens.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,kEAAkE,CAAC;AAE5G;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,sBAAsB,IAAI,mBAAmB,CAE5D;AACD,0DAA0D"}
@@ -1 +1 @@
1
- {"version":3,"file":"useWebsiteLabel.d.ts","sourceRoot":"","sources":["../../../../../src/core/hooks/useWebsiteLabel.ts"],"names":[],"mappings":"AAKA,OAAO,EAGL,KAAK,eAAe,EACrB,MAAM,oDAAoD,CAAC;AAE5D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AACH,wBAAgB,eAAe,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CA8BxD;AACD,yDAAyD;AAEzD;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,eAAe,GAAG,MAAM,CAajE;AACD,gEAAgE"}
1
+ {"version":3,"file":"useWebsiteLabel.d.ts","sourceRoot":"","sources":["../../../../src/core/hooks/useWebsiteLabel.ts"],"names":[],"mappings":"AAKA,OAAO,EAGL,KAAK,eAAe,EACrB,MAAM,oDAAoD,CAAC;AAE5D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AACH,wBAAgB,eAAe,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CA8BxD;AACD,yDAAyD;AAEzD;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,eAAe,GAAG,MAAM,CAajE;AACD,gEAAgE"}
@@ -1 +1 @@
1
- {"version":3,"file":"WebsitePageLayout.d.ts","sourceRoot":"","sources":["../../../../../src/core/layouts/WebsitePageLayout.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAW,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAOvD,OAAO,EAEL,KAAK,cAAc,EACpB,MAAM,qCAAqC,CAAC;AA6F7C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AACH,MAAM,WAAW,sBAAsB;IACrC;;;;;;;OAOG;IACH,OAAO,EAAE,cAAc,GAAG,MAAM,CAAC;IACjC;;;;;OAKG;IACH,MAAM,CAAC,EAAE,SAAS,GAAG,IAAI,CAAC;IAC1B;;OAEG;IACH,MAAM,CAAC,EAAE,SAAS,GAAG,IAAI,CAAC;IAC1B;;;;OAIG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;OAGG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB;;;OAGG;IACH,QAAQ,EAAE,SAAS,CAAC;CACrB;AAED,wBAAgB,iBAAiB,CAAC,EAChC,OAAO,EACP,MAAM,EACN,MAAM,EACN,SAAS,EACT,aAAa,EACb,QAAQ,GACT,EAAE,sBAAsB,GAAG,SAAS,CAsHpC;yBA7He,iBAAiB;;;AA+HjC,gEAAgE"}
1
+ {"version":3,"file":"WebsitePageLayout.d.ts","sourceRoot":"","sources":["../../../../src/core/layouts/WebsitePageLayout.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAW,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAWvD,OAAO,EAEL,KAAK,cAAc,EACpB,MAAM,qCAAqC,CAAC;AA6F7C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AACH,MAAM,WAAW,sBAAsB;IACrC;;;;;;;OAOG;IACH,OAAO,EAAE,cAAc,GAAG,MAAM,CAAC;IACjC;;;;;OAKG;IACH,MAAM,CAAC,EAAE,SAAS,GAAG,IAAI,CAAC;IAC1B;;OAEG;IACH,MAAM,CAAC,EAAE,SAAS,GAAG,IAAI,CAAC;IAC1B;;;;OAIG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;OAGG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB;;;OAGG;IACH,QAAQ,EAAE,SAAS,CAAC;CACrB;AAED,wBAAgB,iBAAiB,CAAC,EAChC,OAAO,EACP,MAAM,EACN,MAAM,EACN,SAAS,EACT,aAAa,EACb,QAAQ,GACT,EAAE,sBAAsB,GAAG,SAAS,CA6HpC;yBApIe,iBAAiB;;;AAsIjC,gEAAgE"}
@@ -2,6 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { useMemo } from 'react';
3
3
  import { BUILTIN_PROVIDER_CAPABILITY } from '@wildo-ai/saas-models/public-runtime';
4
4
  import { WebsitePageContextProvider } from '../contexts/WebsitePageContext.js';
5
+ import { useWebsiteProviderScripts, useWebsiteProviderSdks, } from '../external-providers/useWebsiteProviderScripts.js';
5
6
  import { useWebsiteRuntime } from '../contexts/useWebsiteRuntime.js';
6
7
  import { useWebsiteLabelByKey } from '../hooks/useWebsiteLabel.js';
7
8
  import { WebsitePageRefSchema, } from '../../schemas/refs/page-ref.schemas.js';
@@ -130,6 +131,12 @@ export function WebsitePageLayout({ pageRef, header, footer, className, mainClas
130
131
  const FooterComponent = runtime.navigation.footerComponent;
131
132
  return _jsx(FooterComponent, {});
132
133
  }, [footer, runtime.navigation.footerComponent]);
134
+ // Load whatever the live providers declared. Until this landed, the surface
135
+ // resolved provider refs and stamped them into the attributes below and
136
+ // stopped there — a provider could be declared, enabled and hydrated without
137
+ // anything of it ever running.
138
+ useWebsiteProviderScripts(runtime.frontendProviderRegistry);
139
+ useWebsiteProviderSdks(runtime.frontendProviderRegistry);
133
140
  const providerRootAttributes = useMemo(() => {
134
141
  const attrs = {};
135
142
  const productAnalyticsProviderRef = runtime.frontendProviderRegistry