@hook-sdk/template 0.28.11 → 0.29.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +3 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +9 -1
- package/dist/index.d.ts +9 -1
- package/dist/index.js +4 -3
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/dist/index.d.cts
CHANGED
|
@@ -2,7 +2,7 @@ import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
|
2
2
|
import * as react from 'react';
|
|
3
3
|
import { ReactNode, ComponentType, Component } from 'react';
|
|
4
4
|
import * as _hook_sdk_sdk from '@hook-sdk/sdk';
|
|
5
|
-
import { HookContextValue, SubscribeAnonymousResult, CheckoutMethod as CheckoutMethod$1, CheckoutCycle, CheckoutCardData, CheckoutHolderInfo, CheckoutResult, PlanState, ReminderSlot } from '@hook-sdk/sdk';
|
|
5
|
+
import { HookContextValue, VideoConfig, SubscribeAnonymousResult, CheckoutMethod as CheckoutMethod$1, CheckoutCycle, CheckoutCardData, CheckoutHolderInfo, CheckoutResult, PlanState, ReminderSlot } from '@hook-sdk/sdk';
|
|
6
6
|
export { PlanInfo, PlanState, useTrackOnboardingStep } from '@hook-sdk/sdk';
|
|
7
7
|
import { z } from 'zod';
|
|
8
8
|
|
|
@@ -205,6 +205,14 @@ type AppRootSlots = {
|
|
|
205
205
|
type AppRootProps = AppRootSlots & {
|
|
206
206
|
config: AppConfig;
|
|
207
207
|
children?: ReactNode;
|
|
208
|
+
/**
|
|
209
|
+
* P-Video — per-videoId config map. Bundles that use <HookVideo> pass
|
|
210
|
+
* `videos.videos` from `import videos from './videos.json'` (file is
|
|
211
|
+
* synced from `hook/creators/<slug>/videos.json` by the build step).
|
|
212
|
+
* Omit when the app has no VSL screens — empty map is fine.
|
|
213
|
+
* Spec: docs/superpowers/specs/2026-05-16-hook-video-player-design.md
|
|
214
|
+
*/
|
|
215
|
+
videos?: Record<string, VideoConfig>;
|
|
208
216
|
/** Test-only: skip BrowserRouter (which fights jsdom's document.location). */
|
|
209
217
|
testRouter?: 'memory';
|
|
210
218
|
/** Test-only: initial entries for MemoryRouter. */
|
package/dist/index.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
|
2
2
|
import * as react from 'react';
|
|
3
3
|
import { ReactNode, ComponentType, Component } from 'react';
|
|
4
4
|
import * as _hook_sdk_sdk from '@hook-sdk/sdk';
|
|
5
|
-
import { HookContextValue, SubscribeAnonymousResult, CheckoutMethod as CheckoutMethod$1, CheckoutCycle, CheckoutCardData, CheckoutHolderInfo, CheckoutResult, PlanState, ReminderSlot } from '@hook-sdk/sdk';
|
|
5
|
+
import { HookContextValue, VideoConfig, SubscribeAnonymousResult, CheckoutMethod as CheckoutMethod$1, CheckoutCycle, CheckoutCardData, CheckoutHolderInfo, CheckoutResult, PlanState, ReminderSlot } from '@hook-sdk/sdk';
|
|
6
6
|
export { PlanInfo, PlanState, useTrackOnboardingStep } from '@hook-sdk/sdk';
|
|
7
7
|
import { z } from 'zod';
|
|
8
8
|
|
|
@@ -205,6 +205,14 @@ type AppRootSlots = {
|
|
|
205
205
|
type AppRootProps = AppRootSlots & {
|
|
206
206
|
config: AppConfig;
|
|
207
207
|
children?: ReactNode;
|
|
208
|
+
/**
|
|
209
|
+
* P-Video — per-videoId config map. Bundles that use <HookVideo> pass
|
|
210
|
+
* `videos.videos` from `import videos from './videos.json'` (file is
|
|
211
|
+
* synced from `hook/creators/<slug>/videos.json` by the build step).
|
|
212
|
+
* Omit when the app has no VSL screens — empty map is fine.
|
|
213
|
+
* Spec: docs/superpowers/specs/2026-05-16-hook-video-player-design.md
|
|
214
|
+
*/
|
|
215
|
+
videos?: Record<string, VideoConfig>;
|
|
208
216
|
/** Test-only: skip BrowserRouter (which fights jsdom's document.location). */
|
|
209
217
|
testRouter?: 'memory';
|
|
210
218
|
/** Test-only: initial entries for MemoryRouter. */
|
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// src/AppRoot.tsx
|
|
2
2
|
import { useMemo as useMemo3 } from "react";
|
|
3
3
|
import { BrowserRouter, MemoryRouter, Navigate, Route, Routes } from "react-router-dom";
|
|
4
|
-
import { useHook as useHook8 } from "@hook-sdk/sdk";
|
|
4
|
+
import { useHook as useHook8, VideoProvider } from "@hook-sdk/sdk";
|
|
5
5
|
|
|
6
6
|
// src/config/AppConfigContext.tsx
|
|
7
7
|
import { createContext, useContext } from "react";
|
|
@@ -2504,6 +2504,7 @@ function AppRoot(props) {
|
|
|
2504
2504
|
const {
|
|
2505
2505
|
config: rawConfig,
|
|
2506
2506
|
children,
|
|
2507
|
+
videos,
|
|
2507
2508
|
testRouter,
|
|
2508
2509
|
testInitialEntries,
|
|
2509
2510
|
Login,
|
|
@@ -2573,7 +2574,7 @@ function AppRoot(props) {
|
|
|
2573
2574
|
position === "pre-auth" ? /* @__PURE__ */ jsx23(InstallGate, { position: "pre-auth", children: authGated }) : authGated,
|
|
2574
2575
|
isDevToolsEnabled() && devSkipOnboarding ? /* @__PURE__ */ jsx23(DevSkipOnboardingFab, { defaults: devSkipOnboarding.defaults }) : null
|
|
2575
2576
|
] });
|
|
2576
|
-
return /* @__PURE__ */ jsx23(ErrorBoundary, { children: /* @__PURE__ */ jsx23(AppConfigProvider, { config, children: /* @__PURE__ */ jsx23(TemplateConfigProvider, { config: legacyShim, children: /* @__PURE__ */ jsx23(ThemeProvider, { children: /* @__PURE__ */ jsx23(PersistenceRegistry, { config: config.persistedKeys, children: config.i18n ? /* @__PURE__ */ jsx23(
|
|
2577
|
+
return /* @__PURE__ */ jsx23(ErrorBoundary, { children: /* @__PURE__ */ jsx23(AppConfigProvider, { config, children: /* @__PURE__ */ jsx23(TemplateConfigProvider, { config: legacyShim, children: /* @__PURE__ */ jsx23(ThemeProvider, { children: /* @__PURE__ */ jsx23(PersistenceRegistry, { config: config.persistedKeys, children: /* @__PURE__ */ jsx23(VideoProvider, { videos: videos ?? {}, children: config.i18n ? /* @__PURE__ */ jsx23(
|
|
2577
2578
|
I18nProvider,
|
|
2578
2579
|
{
|
|
2579
2580
|
defaultLocale: config.i18n.defaultLocale,
|
|
@@ -2581,7 +2582,7 @@ function AppRoot(props) {
|
|
|
2581
2582
|
resources: config.i18n.resources,
|
|
2582
2583
|
children: routedTree
|
|
2583
2584
|
}
|
|
2584
|
-
) : routedTree }) }) }) }) });
|
|
2585
|
+
) : routedTree }) }) }) }) }) });
|
|
2585
2586
|
}
|
|
2586
2587
|
function AuthGated({
|
|
2587
2588
|
children,
|