@funnelsgrove/cli 0.1.14 → 0.1.18
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/contracts/step-contract-v2.json +733 -0
- package/dist/analyticsOutput.d.ts +30 -15
- package/dist/analyticsOutput.js +45 -28
- package/dist/apiClient.d.ts +85 -0
- package/dist/apiClient.js +225 -8
- package/dist/cli.d.ts +149 -1
- package/dist/cli.js +1232 -71
- package/dist/diagnosticOutput.d.ts +42 -0
- package/dist/diagnosticOutput.js +83 -0
- package/dist/docsOutput.d.ts +19 -0
- package/dist/docsOutput.js +73 -0
- package/dist/docsTransaction.d.ts +81 -0
- package/dist/docsTransaction.js +1755 -0
- package/dist/funnelValidation.d.ts +14 -0
- package/dist/funnelValidation.js +297 -0
- package/dist/localSync.d.ts +79 -0
- package/dist/localSync.js +428 -53
- package/dist/projectValidator.d.ts +27 -0
- package/dist/projectValidator.js +208 -0
- package/dist/reskin.js +27 -1
- package/dist/stepContractMigration.d.ts +71 -0
- package/dist/stepContractMigration.js +1323 -0
- package/dist/templateDocs.js +8 -25
- package/docs-release-history.json +66 -0
- package/legacy-docs-catalog.json +1012 -0
- package/package.json +13 -4
- package/template_docs/.funnelsgrove-docs.json +144 -0
- package/template_docs/AGENTS.md +30 -58
- package/template_docs/CLAUDE.md +0 -2
- package/template_docs/docs/funnelsgrove/START-HERE.md +73 -0
- package/template_docs/docs/funnelsgrove/contracts/analytics-events.md +59 -0
- package/template_docs/docs/funnelsgrove/contracts/content-answers.md +44 -0
- package/template_docs/docs/funnelsgrove/contracts/flow-routing.md +41 -0
- package/template_docs/docs/funnelsgrove/contracts/payments.md +42 -0
- package/template_docs/docs/funnelsgrove/contracts/step-metadata.md +57 -0
- package/template_docs/docs/funnelsgrove/migrations/step-contract-v3.md +39 -0
- package/template_docs/docs/funnelsgrove/qa/analytics.md +43 -0
- package/template_docs/docs/funnelsgrove/qa/local.md +42 -0
- package/template_docs/docs/funnelsgrove/qa/paywall-checkout.md +55 -0
- package/template_docs/docs/funnelsgrove/qa/publish.md +32 -0
- package/template_docs/docs/funnelsgrove/recipes/add-experiment.md +34 -0
- package/template_docs/docs/funnelsgrove/recipes/add-step.md +33 -0
- package/template_docs/docs/funnelsgrove/recipes/edit-step.md +31 -0
- package/template_docs/docs/funnelsgrove/steps/INDEX.md +26 -0
- package/template_docs/docs/funnelsgrove/steps/cancellation_offer.md +112 -0
- package/template_docs/docs/funnelsgrove/steps/checkout.md +120 -0
- package/template_docs/docs/funnelsgrove/steps/form_input.md +115 -0
- package/template_docs/docs/funnelsgrove/steps/intro_hero.md +110 -0
- package/template_docs/docs/funnelsgrove/steps/multi_select_choice.md +123 -0
- package/template_docs/docs/funnelsgrove/steps/paywall_offer.md +115 -0
- package/template_docs/docs/funnelsgrove/steps/progress_interstitial.md +111 -0
- package/template_docs/docs/funnelsgrove/steps/purchase_completed.md +117 -0
- package/template_docs/docs/funnelsgrove/steps/single_step_choice.md +122 -0
- package/template_docs/docs/funnelsgrove/steps/single_step_choice_emoji.md +122 -0
- package/template_docs/docs/funnelsgrove/steps/social_proof.md +110 -0
- package/template_docs/docs/funnelsgrove/steps/subscription_handoff.md +113 -0
- package/template_docs/docs/funnelsgrove/steps/subscription_management.md +112 -0
- package/template_docs/docs/funnelsgrove/steps/summary_confirmation.md +110 -0
- package/template_docs/docs/funnelsgrove/steps/upsell_offer.md +112 -0
- package/template_docs/docs/funnelsgrove/steps/value_prop_story.md +110 -0
- package/template_docs/funnel-docs.config.json +43 -0
- package/template_scaffold/.env.example +41 -0
- package/template_scaffold/.funnelsgrove-contract-tools.json +19 -0
- package/template_scaffold/.funnelsgrove-docs.json +144 -0
- package/template_scaffold/.funnelsgrove-scaffold.json +1078 -0
- package/template_scaffold/AGENTS.md +42 -0
- package/template_scaffold/CLAUDE.md +1 -0
- package/template_scaffold/PLAN.md +81 -0
- package/template_scaffold/PRODUCT_SENSE.md +28 -0
- package/template_scaffold/context/build-context.md +34 -0
- package/template_scaffold/docs/AGENT_FUNNEL_IMPLEMENTATION_SPEC.md +5 -0
- package/template_scaffold/docs/ARCHITECTURE.md +5 -0
- package/template_scaffold/docs/FLOW_CONFIG_AND_ROUTING.md +5 -0
- package/template_scaffold/docs/PAYWALL_AND_PAYMENTS.md +5 -0
- package/template_scaffold/docs/README.md +5 -0
- package/template_scaffold/docs/funnelsgrove/START-HERE.md +73 -0
- package/template_scaffold/docs/funnelsgrove/contracts/analytics-events.md +59 -0
- package/template_scaffold/docs/funnelsgrove/contracts/content-answers.md +44 -0
- package/template_scaffold/docs/funnelsgrove/contracts/flow-routing.md +41 -0
- package/template_scaffold/docs/funnelsgrove/contracts/payments.md +42 -0
- package/template_scaffold/docs/funnelsgrove/contracts/step-metadata.md +57 -0
- package/template_scaffold/docs/funnelsgrove/migrations/step-contract-v3.md +39 -0
- package/template_scaffold/docs/funnelsgrove/qa/analytics.md +43 -0
- package/template_scaffold/docs/funnelsgrove/qa/local.md +42 -0
- package/template_scaffold/docs/funnelsgrove/qa/paywall-checkout.md +55 -0
- package/template_scaffold/docs/funnelsgrove/qa/publish.md +32 -0
- package/template_scaffold/docs/funnelsgrove/recipes/add-experiment.md +34 -0
- package/template_scaffold/docs/funnelsgrove/recipes/add-step.md +33 -0
- package/template_scaffold/docs/funnelsgrove/recipes/edit-step.md +31 -0
- package/template_scaffold/docs/funnelsgrove/steps/INDEX.md +26 -0
- package/template_scaffold/docs/funnelsgrove/steps/cancellation_offer.md +112 -0
- package/template_scaffold/docs/funnelsgrove/steps/checkout.md +120 -0
- package/template_scaffold/docs/funnelsgrove/steps/form_input.md +115 -0
- package/template_scaffold/docs/funnelsgrove/steps/intro_hero.md +110 -0
- package/template_scaffold/docs/funnelsgrove/steps/multi_select_choice.md +123 -0
- package/template_scaffold/docs/funnelsgrove/steps/paywall_offer.md +115 -0
- package/template_scaffold/docs/funnelsgrove/steps/progress_interstitial.md +111 -0
- package/template_scaffold/docs/funnelsgrove/steps/purchase_completed.md +117 -0
- package/template_scaffold/docs/funnelsgrove/steps/single_step_choice.md +122 -0
- package/template_scaffold/docs/funnelsgrove/steps/single_step_choice_emoji.md +122 -0
- package/template_scaffold/docs/funnelsgrove/steps/social_proof.md +110 -0
- package/template_scaffold/docs/funnelsgrove/steps/subscription_handoff.md +113 -0
- package/template_scaffold/docs/funnelsgrove/steps/subscription_management.md +112 -0
- package/template_scaffold/docs/funnelsgrove/steps/summary_confirmation.md +110 -0
- package/template_scaffold/docs/funnelsgrove/steps/upsell_offer.md +112 -0
- package/template_scaffold/docs/funnelsgrove/steps/value_prop_story.md +110 -0
- package/template_scaffold/docs/references/funnel-sdk-user-answers.md +5 -0
- package/template_scaffold/eslint.config.mjs +16 -0
- package/template_scaffold/funnel-agent-docs.test.ts +699 -0
- package/template_scaffold/funnel-docs.config.json +43 -0
- package/template_scaffold/funnel.config.json +5 -0
- package/template_scaffold/gitignore.template +5 -0
- package/template_scaffold/next-env.d.ts +6 -0
- package/template_scaffold/next.config.ts +53 -0
- package/template_scaffold/package-lock.json +7737 -0
- package/template_scaffold/package.json +37 -0
- package/template_scaffold/package.test.ts +23 -0
- package/template_scaffold/public/claimbee/bee.png +0 -0
- package/template_scaffold/public/claimbee/device-iphone.png +0 -0
- package/template_scaffold/public/claimbee/device-macbook.png +0 -0
- package/template_scaffold/public/claimbee/device-none.png +0 -0
- package/template_scaffold/public/claimbee/device-watch.png +0 -0
- package/template_scaffold/public/claimbee/glow.svg +3 -0
- package/template_scaffold/public/claimbee/steps-sprite-alt.png +0 -0
- package/template_scaffold/public/claimbee/steps-sprite-default.png +0 -0
- package/template_scaffold/public/claimbee/testimonial-avatar.png +0 -0
- package/template_scaffold/public/claimbee/testimonial-star.svg +3 -0
- package/template_scaffold/public/paywall/ai-claim-assistant.png +0 -0
- package/template_scaffold/public/paywall/claim-history.png +0 -0
- package/template_scaffold/public/paywall/clear-progress.png +0 -0
- package/template_scaffold/public/paywall/hero.png +0 -0
- package/template_scaffold/public/paywall/money-alerts.png +0 -0
- package/template_scaffold/public/paywall/money-back-badge.png +0 -0
- package/template_scaffold/public/paywall/paywall-image.png +0 -0
- package/template_scaffold/public/paywall/r1.png +0 -0
- package/template_scaffold/public/paywall/r2.png +0 -0
- package/template_scaffold/public/paywall/r3.png +0 -0
- package/template_scaffold/public/paywall/r4.png +0 -0
- package/template_scaffold/public/paywall/r5.png +0 -0
- package/template_scaffold/public/paywall/r6.png +0 -0
- package/template_scaffold/public/paywall/special-offer-gift.png +0 -0
- package/template_scaffold/public/please/bee.png +0 -0
- package/template_scaffold/public/please/device-iphone.png +0 -0
- package/template_scaffold/public/please/device-macbook.png +0 -0
- package/template_scaffold/public/please/device-none.png +0 -0
- package/template_scaffold/public/please/device-watch.png +0 -0
- package/template_scaffold/public/please/glow.svg +3 -0
- package/template_scaffold/public/please/steps-sprite-alt.png +0 -0
- package/template_scaffold/public/please/steps-sprite-default.png +0 -0
- package/template_scaffold/public/please/testimonial-avatar.png +0 -0
- package/template_scaffold/public/please/testimonial-star.svg +3 -0
- package/template_scaffold/public/upsell/upgrade-hero.png +0 -0
- package/template_scaffold/src/app/[stepId]/page.test.tsx +59 -0
- package/template_scaffold/src/app/[stepId]/page.tsx +62 -0
- package/template_scaffold/src/app/globals.css +49 -0
- package/template_scaffold/src/app/layout.test.ts +26 -0
- package/template_scaffold/src/app/layout.tsx +61 -0
- package/template_scaffold/src/app/page.tsx +8 -0
- package/template_scaffold/src/app/sdk/page.tsx +673 -0
- package/template_scaffold/src/app/subscription-dashboard/page.tsx +274 -0
- package/template_scaffold/src/assets/claimbee/bee.png +0 -0
- package/template_scaffold/src/assets/claimbee/device-iphone.png +0 -0
- package/template_scaffold/src/assets/claimbee/device-macbook.png +0 -0
- package/template_scaffold/src/assets/claimbee/device-none.png +0 -0
- package/template_scaffold/src/assets/claimbee/device-watch.png +0 -0
- package/template_scaffold/src/assets/claimbee/glow.svg +3 -0
- package/template_scaffold/src/assets/claimbee/steps-sprite-alt.png +0 -0
- package/template_scaffold/src/assets/claimbee/steps-sprite-default.png +0 -0
- package/template_scaffold/src/assets/claimbee/testimonial-avatar.png +0 -0
- package/template_scaffold/src/assets/claimbee/testimonial-star.svg +3 -0
- package/template_scaffold/src/components/FunnelEditorPanel.tsx +194 -0
- package/template_scaffold/src/components/FunnelFlow.test.tsx +17 -0
- package/template_scaffold/src/components/FunnelFlow.tsx +114 -0
- package/template_scaffold/src/components/FunnelStepImage.test.ts +15 -0
- package/template_scaffold/src/components/FunnelStepImage.tsx +28 -0
- package/template_scaffold/src/components/step/FunnelStepHeader.tsx +35 -0
- package/template_scaffold/src/config/billing.plans.test.ts +143 -0
- package/template_scaffold/src/config/billing.plans.ts +69 -0
- package/template_scaffold/src/config/billing.test.plans.ts +32 -0
- package/template_scaffold/src/config/experiments.generated.ts +4 -0
- package/template_scaffold/src/config/experiments.test.ts +12 -0
- package/template_scaffold/src/config/experiments.ts +9 -0
- package/template_scaffold/src/config/funnel.config.ts +12 -0
- package/template_scaffold/src/config/funnel.manifest.test.ts +166 -0
- package/template_scaffold/src/config/funnel.manifest.ts +139 -0
- package/template_scaffold/src/config/offer-sets.generated.ts +4 -0
- package/template_scaffold/src/contract/funnel-project.validation.test.ts +80 -0
- package/template_scaffold/src/contract/funnel-project.validation.ts +44 -0
- package/template_scaffold/src/contract/funnel-validator.vite.config.ts +11 -0
- package/template_scaffold/src/contract/golden/cancellation_offer.fixture.ts +29 -0
- package/template_scaffold/src/contract/golden/checkout.fixture.ts +37 -0
- package/template_scaffold/src/contract/golden/form_input.fixture.ts +28 -0
- package/template_scaffold/src/contract/golden/golden-fixtures.test.ts +190 -0
- package/template_scaffold/src/contract/golden/intro_hero.fixture.ts +27 -0
- package/template_scaffold/src/contract/golden/multi_select_choice.fixture.ts +37 -0
- package/template_scaffold/src/contract/golden/paywall_offer.fixture.ts +30 -0
- package/template_scaffold/src/contract/golden/progress_interstitial.fixture.ts +28 -0
- package/template_scaffold/src/contract/golden/purchase_completed.fixture.ts +33 -0
- package/template_scaffold/src/contract/golden/single_step_choice.fixture.ts +36 -0
- package/template_scaffold/src/contract/golden/single_step_choice_emoji.fixture.ts +36 -0
- package/template_scaffold/src/contract/golden/social_proof.fixture.ts +27 -0
- package/template_scaffold/src/contract/golden/subscription_handoff.fixture.ts +30 -0
- package/template_scaffold/src/contract/golden/subscription_management.fixture.ts +29 -0
- package/template_scaffold/src/contract/golden/summary_confirmation.fixture.ts +27 -0
- package/template_scaffold/src/contract/golden/upsell_offer.fixture.ts +29 -0
- package/template_scaffold/src/contract/golden/value_prop_story.fixture.ts +27 -0
- package/template_scaffold/src/contract/validate-funnel.cli.test.ts +180 -0
- package/template_scaffold/src/contract/validate-funnel.cli.ts +199 -0
- package/template_scaffold/src/runtime/checkout-runtime-config.test.ts +60 -0
- package/template_scaffold/src/runtime/checkout-runtime-config.ts +26 -0
- package/template_scaffold/src/runtime/funnel-runtime.test.ts +25 -0
- package/template_scaffold/src/runtime/funnel-runtime.ts +118 -0
- package/template_scaffold/src/runtime/step-content-context.test.ts +38 -0
- package/template_scaffold/src/runtime/step-content-context.ts +65 -0
- package/template_scaffold/src/runtime/step-registry.ts +66 -0
- package/template_scaffold/src/runtime/step-variable-values.ts +31 -0
- package/template_scaffold/src/runtime/use-funnel-flow-controller.integration.test.ts +203 -0
- package/template_scaffold/src/runtime/use-funnel-flow-controller.test.ts +76 -0
- package/template_scaffold/src/runtime/use-funnel-flow-controller.ts +53 -0
- package/template_scaffold/src/steps/content/email-capture.content.ts +29 -0
- package/template_scaffold/src/steps/content/manage-subscription.content.ts +62 -0
- package/template_scaffold/src/steps/content/paywall.content.ts +191 -0
- package/template_scaffold/src/steps/content/step-01.content.ts +23 -0
- package/template_scaffold/src/steps/content/step-02.content.ts +77 -0
- package/template_scaffold/src/steps/content/step-03.content.ts +40 -0
- package/template_scaffold/src/steps/content/step-04.content.ts +49 -0
- package/template_scaffold/src/steps/content/step-32-paywall.content.ts +352 -0
- package/template_scaffold/src/steps/content/subscription-started.content.ts +68 -0
- package/template_scaffold/src/steps/editor/email-capture.editor.ts +58 -0
- package/template_scaffold/src/steps/editor/manage-subscription.editor.ts +179 -0
- package/template_scaffold/src/steps/editor/paywall.editor.ts +232 -0
- package/template_scaffold/src/steps/editor/step-01.editor.ts +22 -0
- package/template_scaffold/src/steps/editor/step-02.editor.ts +41 -0
- package/template_scaffold/src/steps/editor/step-03.editor.ts +58 -0
- package/template_scaffold/src/steps/editor/step-04.editor.ts +98 -0
- package/template_scaffold/src/steps/editor/step-32-paywall.editor.ts +478 -0
- package/template_scaffold/src/steps/editor/subscription-started.editor.ts +131 -0
- package/template_scaffold/src/steps/index.ts +25 -0
- package/template_scaffold/src/steps/paywall-checkout-options.test.ts +104 -0
- package/template_scaffold/src/steps/paywall-checkout-options.ts +130 -0
- package/template_scaffold/src/steps/pricing/paywall-b.pricing.ts +12 -0
- package/template_scaffold/src/steps/pricing/paywall.pricing.ts +12 -0
- package/template_scaffold/src/steps/pricing/shared-plan-order.ts +17 -0
- package/template_scaffold/src/steps/pricing/upsell-form.pricing.ts +16 -0
- package/template_scaffold/src/steps/shared-header-contract.test.ts +27 -0
- package/template_scaffold/src/steps/step-01.test.ts +38 -0
- package/template_scaffold/src/steps/step-01.tsx +108 -0
- package/template_scaffold/src/steps/step-02.test.ts +43 -0
- package/template_scaffold/src/steps/step-02.tsx +140 -0
- package/template_scaffold/src/steps/step-03.test.ts +15 -0
- package/template_scaffold/src/steps/step-03.tsx +262 -0
- package/template_scaffold/src/steps/step-04.test.ts +32 -0
- package/template_scaffold/src/steps/step-04.tsx +673 -0
- package/template_scaffold/src/steps/step-31-email-capture.test.ts +22 -0
- package/template_scaffold/src/steps/step-31-email-capture.tsx +195 -0
- package/template_scaffold/src/steps/step-32-paywall.test.ts +770 -0
- package/template_scaffold/src/steps/step-32-paywall.tsx +2253 -0
- package/template_scaffold/src/steps/step-32b-paywall-b.tsx +35 -0
- package/template_scaffold/src/steps/step-33-subscription-started.test.ts +26 -0
- package/template_scaffold/src/steps/step-33-subscription-started.tsx +86 -0
- package/template_scaffold/src/steps/step-34-upsell-form.test.ts +27 -0
- package/template_scaffold/src/steps/step-35-manage-subscription.tsx +46 -0
- package/template_scaffold/src/steps/step-content.registry.ts +45 -0
- package/template_scaffold/src/steps/step-image-migration.test.ts +20 -0
- package/template_scaffold/src/steps/styles/index.css +2 -0
- package/template_scaffold/src/steps/styles/shared/final-flow-shared.css +55 -0
- package/template_scaffold/src/steps/styles/shared/funnel-base.css +543 -0
- package/template_scaffold/src/steps/styles/shared/info-shared.css +139 -0
- package/template_scaffold/src/steps/styles/shared/progress-shared.css +117 -0
- package/template_scaffold/src/steps/styles/shared/question-shared.css +76 -0
- package/template_scaffold/src/steps/styles/shared/responsive-container.css +176 -0
- package/template_scaffold/src/steps/types.ts +7 -0
- package/template_scaffold/src/steps/use-claimbee-step-content.ts +15 -0
- package/template_scaffold/src/theme/theme.ts +81 -0
- package/template_scaffold/tsconfig.json +38 -0
- package/template_scaffold/vitest.config.ts +32 -0
- package/template_validation/.funnelsgrove-contract-tools.json +19 -0
- package/template_validation/src/contract/funnel-project.validation.ts +44 -0
- package/template_validation/src/contract/funnel-validator.vite.config.ts +11 -0
- package/template_validation/src/contract/validate-funnel.cli.ts +199 -0
- package/template_docs/docs/ab-experiments.md +0 -55
- package/template_docs/docs/analytics.md +0 -65
- package/template_docs/docs/editing-flow.md +0 -125
- package/template_docs/docs/editing-step.md +0 -125
- package/template_docs/docs/editor-and-content.md +0 -58
- package/template_docs/docs/funnel-runtime-architecture.md +0 -125
- package/template_docs/docs/meta-pixel-conversions-api.md +0 -50
- package/template_docs/docs/payment-plans-and-discounts.md +0 -106
- package/template_docs/docs/publishing-and-versioning.md +0 -117
- package/template_docs/docs/qa-checklist.md +0 -80
- package/template_docs/docs/sdk-api-endpoints.md +0 -78
- package/template_docs/docs/step-ui-guidelines.md +0 -110
- package/template_docs/docs/theme.md +0 -35
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import { useEffect } from 'react';
|
|
4
|
+
import { StepPaywall, stepPaywall } from './step-32-paywall';
|
|
5
|
+
import type { FunnelStepMeta } from '@funnelsgrove/runtime';
|
|
6
|
+
|
|
7
|
+
export const stepPaywallBId = 'paywall-b';
|
|
8
|
+
|
|
9
|
+
export const stepPaywallB: FunnelStepMeta = {
|
|
10
|
+
...stepPaywall,
|
|
11
|
+
id: stepPaywallBId,
|
|
12
|
+
name: 'paywall-b',
|
|
13
|
+
type: 'paywall_offer',
|
|
14
|
+
title: 'Paywall B',
|
|
15
|
+
description: 'Duplicate ClaimBee paywall variant for A/B testing.',
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
export function StepPaywallB() {
|
|
19
|
+
useEffect(() => {
|
|
20
|
+
document.documentElement.dataset.paywallVariant = 'b';
|
|
21
|
+
|
|
22
|
+
return () => {
|
|
23
|
+
if (document.documentElement.dataset.paywallVariant === 'b') {
|
|
24
|
+
delete document.documentElement.dataset.paywallVariant;
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
}, []);
|
|
28
|
+
|
|
29
|
+
return (
|
|
30
|
+
<StepPaywall
|
|
31
|
+
analyticsStepId={stepPaywallBId}
|
|
32
|
+
analyticsStepName={stepPaywallB.name || stepPaywallB.title}
|
|
33
|
+
/>
|
|
34
|
+
);
|
|
35
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { readFileSync } from 'node:fs';
|
|
2
|
+
import path from 'node:path';
|
|
3
|
+
import { describe, expect, it } from 'vitest';
|
|
4
|
+
|
|
5
|
+
describe('template subscription-started source', () => {
|
|
6
|
+
it('uses the shared runtime handoff screen and tracks checkout returns with user_id metadata', () => {
|
|
7
|
+
const stepSource = readFileSync(
|
|
8
|
+
path.resolve(__dirname, './step-33-subscription-started.tsx'),
|
|
9
|
+
'utf8',
|
|
10
|
+
);
|
|
11
|
+
|
|
12
|
+
expect(stepSource).toContain('SubscriptionHandoffScreen');
|
|
13
|
+
expect(stepSource).toContain("completionMode='funnel'");
|
|
14
|
+
expect(stepSource).toContain('stepContractVersion: funnelManifest.stepContractVersion');
|
|
15
|
+
expect(stepSource).toContain("type: 'purchase_completed'");
|
|
16
|
+
expect(stepSource).toContain("user_id: searchParams.get('user_id') || null");
|
|
17
|
+
expect(stepSource).toContain('publicAnalyticsSdk.trackPaymentCheckoutSucceeded(eventInput);');
|
|
18
|
+
expect(stepSource).toContain('publicAnalyticsSdk.trackPaymentCheckoutReturned(eventInput);');
|
|
19
|
+
expect(stepSource).toContain('stepType: stepSubscriptionStarted.type');
|
|
20
|
+
expect(stepSource).not.toContain("eventType: redirectStatus === 'succeeded'");
|
|
21
|
+
expect(stepSource).not.toContain('trackPurchaseCompleted');
|
|
22
|
+
expect(stepSource).not.toContain("searchParams.get('userId')");
|
|
23
|
+
expect(stepSource).not.toContain('api.qrserver.com');
|
|
24
|
+
expect(stepSource).not.toContain('NEXT_PUBLIC_IOS_APP_STORE_URL');
|
|
25
|
+
});
|
|
26
|
+
});
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
// PLAN_STEP_PLACEHOLDER_ID:subscription-started
|
|
2
|
+
'use client';
|
|
3
|
+
|
|
4
|
+
import { useEffect } from 'react';
|
|
5
|
+
import { publicAnalyticsSdk } from '@funnelsgrove/analytics';
|
|
6
|
+
import {
|
|
7
|
+
SubscriptionHandoffScreen,
|
|
8
|
+
usePreviewStepLocalizedContent,
|
|
9
|
+
useFunnel,
|
|
10
|
+
type FunnelStepMeta,
|
|
11
|
+
} from '@funnelsgrove/runtime';
|
|
12
|
+
import { getStepContentLocale } from '@/runtime/step-content-context';
|
|
13
|
+
import { subscriptionStartedContent } from '@/steps/content/subscription-started.content';
|
|
14
|
+
import { funnelManifest } from '@/config/funnel.manifest';
|
|
15
|
+
|
|
16
|
+
export const stepSubscriptionStartedId = 'subscription-started';
|
|
17
|
+
|
|
18
|
+
export const stepSubscriptionStarted: FunnelStepMeta = {
|
|
19
|
+
id: stepSubscriptionStartedId,
|
|
20
|
+
name: 'subscription-started',
|
|
21
|
+
type: 'purchase_completed',
|
|
22
|
+
kind: 'subscription-handoff',
|
|
23
|
+
figmaNodeId: 'final-step-deep-link',
|
|
24
|
+
title: 'Subscription Started',
|
|
25
|
+
description: 'Post-checkout app handoff and deep-link step.',
|
|
26
|
+
actionBar: {
|
|
27
|
+
hidden: true,
|
|
28
|
+
},
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
export function StepSubscriptionStarted() {
|
|
32
|
+
const { user, attributes } = useFunnel();
|
|
33
|
+
const content = usePreviewStepLocalizedContent(
|
|
34
|
+
stepSubscriptionStartedId,
|
|
35
|
+
subscriptionStartedContent,
|
|
36
|
+
getStepContentLocale(attributes),
|
|
37
|
+
);
|
|
38
|
+
|
|
39
|
+
useEffect(() => {
|
|
40
|
+
if (typeof window === 'undefined') {
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
const searchParams = new URLSearchParams(window.location.search);
|
|
45
|
+
const paymentIntent = searchParams.get('payment_intent');
|
|
46
|
+
const redirectStatus = searchParams.get('redirect_status');
|
|
47
|
+
if (!paymentIntent || !redirectStatus) {
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
const dedupeKey = `app-deals:payment-intent:${paymentIntent}`;
|
|
52
|
+
if (window.sessionStorage.getItem(dedupeKey) === '1') {
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
window.sessionStorage.setItem(dedupeKey, '1');
|
|
56
|
+
|
|
57
|
+
const eventInput = {
|
|
58
|
+
stepId: stepSubscriptionStartedId,
|
|
59
|
+
stepName: stepSubscriptionStarted.name || stepSubscriptionStarted.title,
|
|
60
|
+
stepType: stepSubscriptionStarted.type,
|
|
61
|
+
stepContractVersion: funnelManifest.stepContractVersion,
|
|
62
|
+
metadata: {
|
|
63
|
+
source: searchParams.get('source') || null,
|
|
64
|
+
paymentIntent,
|
|
65
|
+
redirectStatus,
|
|
66
|
+
user_id: searchParams.get('user_id') || null,
|
|
67
|
+
funnelUserId: user.id || null,
|
|
68
|
+
},
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
if (redirectStatus === 'succeeded') {
|
|
72
|
+
publicAnalyticsSdk.trackPaymentCheckoutSucceeded(eventInput);
|
|
73
|
+
} else {
|
|
74
|
+
publicAnalyticsSdk.trackPaymentCheckoutReturned(eventInput);
|
|
75
|
+
}
|
|
76
|
+
}, [user.id]);
|
|
77
|
+
|
|
78
|
+
return (
|
|
79
|
+
<SubscriptionHandoffScreen
|
|
80
|
+
stepId={stepSubscriptionStartedId}
|
|
81
|
+
completionMode='funnel'
|
|
82
|
+
content={content}
|
|
83
|
+
nodeId='final-step-deep-link'
|
|
84
|
+
/>
|
|
85
|
+
);
|
|
86
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { readFileSync } from 'node:fs';
|
|
2
|
+
import path from 'node:path';
|
|
3
|
+
import { describe, expect, it } from 'vitest';
|
|
4
|
+
|
|
5
|
+
describe('template cleanup', () => {
|
|
6
|
+
it('keeps upsell removed while preserving the duplicate paywall variant', () => {
|
|
7
|
+
const manifestSource = readFileSync(
|
|
8
|
+
path.resolve(__dirname, '../config/funnel.manifest.ts'),
|
|
9
|
+
'utf8',
|
|
10
|
+
);
|
|
11
|
+
const registrySource = readFileSync(
|
|
12
|
+
path.resolve(__dirname, '../runtime/step-registry.ts'),
|
|
13
|
+
'utf8',
|
|
14
|
+
);
|
|
15
|
+
const contentRegistrySource = readFileSync(
|
|
16
|
+
path.resolve(__dirname, './step-content.registry.ts'),
|
|
17
|
+
'utf8',
|
|
18
|
+
);
|
|
19
|
+
|
|
20
|
+
expect(manifestSource).not.toContain("id: 'upsell-form'");
|
|
21
|
+
expect(manifestSource).toContain("id: 'paywall-b'");
|
|
22
|
+
expect(registrySource).not.toContain('stepUpsellForm');
|
|
23
|
+
expect(registrySource).toContain('stepPaywallB');
|
|
24
|
+
expect(contentRegistrySource).not.toContain("'upsell-form'");
|
|
25
|
+
expect(contentRegistrySource).toContain("'paywall-b'");
|
|
26
|
+
});
|
|
27
|
+
});
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import {
|
|
4
|
+
useFunnel,
|
|
5
|
+
usePreviewStepLocalizedContent,
|
|
6
|
+
type FunnelStepMeta,
|
|
7
|
+
} from '@funnelsgrove/runtime';
|
|
8
|
+
import { ManageSubscriptionScreen } from '@funnelsgrove/payments';
|
|
9
|
+
import { billingPlans } from '@/config/billing.plans';
|
|
10
|
+
import { getStepContentLocale } from '@/runtime/step-content-context';
|
|
11
|
+
import { stepOneId } from '@/steps/step-01';
|
|
12
|
+
import { manageSubscriptionContent } from '@/steps/content/manage-subscription.content';
|
|
13
|
+
|
|
14
|
+
export const stepManageSubscriptionId = 'manage-subscription';
|
|
15
|
+
|
|
16
|
+
export const stepManageSubscription: FunnelStepMeta = {
|
|
17
|
+
id: stepManageSubscriptionId,
|
|
18
|
+
name: 'manage-subscription',
|
|
19
|
+
type: 'subscription_management',
|
|
20
|
+
kind: 'manage-subscription',
|
|
21
|
+
figmaNodeId: 'template-35-manage-subscription',
|
|
22
|
+
title: 'Manage subscription',
|
|
23
|
+
description: 'Manage subscription flow: list, reason, cancellation, and confirmation.',
|
|
24
|
+
actionBar: {
|
|
25
|
+
hidden: true,
|
|
26
|
+
},
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
export function StepManageSubscription() {
|
|
30
|
+
const { attributes } = useFunnel();
|
|
31
|
+
const content = usePreviewStepLocalizedContent(
|
|
32
|
+
stepManageSubscriptionId,
|
|
33
|
+
manageSubscriptionContent,
|
|
34
|
+
getStepContentLocale(attributes),
|
|
35
|
+
);
|
|
36
|
+
|
|
37
|
+
return (
|
|
38
|
+
<ManageSubscriptionScreen
|
|
39
|
+
stepId={stepManageSubscriptionId}
|
|
40
|
+
content={content}
|
|
41
|
+
homeStepId={stepOneId}
|
|
42
|
+
nodeId='template:35-manage-subscription'
|
|
43
|
+
plans={billingPlans}
|
|
44
|
+
/>
|
|
45
|
+
);
|
|
46
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import type { FunnelChoiceOption } from '@funnelsgrove/runtime';
|
|
2
|
+
import { stepTwoOptions } from './content/step-02.content';
|
|
3
|
+
|
|
4
|
+
export const stepContentRegistry = {
|
|
5
|
+
'step-1': {
|
|
6
|
+
contentPath: 'src/steps/content/step-01.content.ts',
|
|
7
|
+
editorPath: 'src/steps/editor/step-01.editor.ts',
|
|
8
|
+
},
|
|
9
|
+
'step-2': {
|
|
10
|
+
contentPath: 'src/steps/content/step-02.content.ts',
|
|
11
|
+
editorPath: 'src/steps/editor/step-02.editor.ts',
|
|
12
|
+
},
|
|
13
|
+
'step-3': {
|
|
14
|
+
contentPath: 'src/steps/content/step-03.content.ts',
|
|
15
|
+
editorPath: 'src/steps/editor/step-03.editor.ts',
|
|
16
|
+
},
|
|
17
|
+
'step-4': {
|
|
18
|
+
contentPath: 'src/steps/content/step-04.content.ts',
|
|
19
|
+
editorPath: 'src/steps/editor/step-04.editor.ts',
|
|
20
|
+
},
|
|
21
|
+
'email-capture': {
|
|
22
|
+
contentPath: 'src/steps/content/email-capture.content.ts',
|
|
23
|
+
editorPath: 'src/steps/editor/email-capture.editor.ts',
|
|
24
|
+
},
|
|
25
|
+
paywall: {
|
|
26
|
+
contentPath: 'src/steps/content/step-32-paywall.content.ts',
|
|
27
|
+
editorPath: 'src/steps/editor/step-32-paywall.editor.ts',
|
|
28
|
+
},
|
|
29
|
+
'paywall-b': {
|
|
30
|
+
contentPath: 'src/steps/content/step-32-paywall.content.ts',
|
|
31
|
+
editorPath: 'src/steps/editor/step-32-paywall.editor.ts',
|
|
32
|
+
},
|
|
33
|
+
'manage-subscription': {
|
|
34
|
+
contentPath: 'src/steps/content/manage-subscription.content.ts',
|
|
35
|
+
editorPath: 'src/steps/editor/manage-subscription.editor.ts',
|
|
36
|
+
},
|
|
37
|
+
'subscription-started': {
|
|
38
|
+
contentPath: 'src/steps/content/subscription-started.content.ts',
|
|
39
|
+
editorPath: 'src/steps/editor/subscription-started.editor.ts',
|
|
40
|
+
},
|
|
41
|
+
} as const;
|
|
42
|
+
|
|
43
|
+
export const contentOptionsByStepId = {
|
|
44
|
+
'step-2': stepTwoOptions,
|
|
45
|
+
} as const satisfies Record<string, readonly FunnelChoiceOption[]>;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { readFileSync } from 'node:fs';
|
|
2
|
+
import path from 'node:path';
|
|
3
|
+
import { describe, expect, it } from 'vitest';
|
|
4
|
+
|
|
5
|
+
const stepFiles = [
|
|
6
|
+
'step-01.tsx',
|
|
7
|
+
'step-02.tsx',
|
|
8
|
+
'step-03.tsx',
|
|
9
|
+
'step-04.tsx',
|
|
10
|
+
] as const;
|
|
11
|
+
|
|
12
|
+
describe('funnel-template step image migration', () => {
|
|
13
|
+
it('does not leave raw img tags in migrated steps', () => {
|
|
14
|
+
for (const fileName of stepFiles) {
|
|
15
|
+
const filePath = path.resolve(__dirname, fileName);
|
|
16
|
+
const source = readFileSync(filePath, 'utf8');
|
|
17
|
+
expect(source).not.toContain('<img');
|
|
18
|
+
}
|
|
19
|
+
});
|
|
20
|
+
});
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
.filing-step,
|
|
2
|
+
.journey-step,
|
|
3
|
+
.warning-step,
|
|
4
|
+
.relationship-step,
|
|
5
|
+
.family-step,
|
|
6
|
+
.email-step,
|
|
7
|
+
.paywall-step {
|
|
8
|
+
position: absolute;
|
|
9
|
+
inset: 0;
|
|
10
|
+
background: var(--color-bg-muted);
|
|
11
|
+
font-family: var(--font-family-base);
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.filing-copy,
|
|
15
|
+
.journey-copy,
|
|
16
|
+
.relationship-copy,
|
|
17
|
+
.family-copy,
|
|
18
|
+
.email-copy,
|
|
19
|
+
.paywall-head {
|
|
20
|
+
position: absolute;
|
|
21
|
+
top: 122px;
|
|
22
|
+
left: var(--padding);
|
|
23
|
+
right: var(--padding);
|
|
24
|
+
width: auto;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.filing-title,
|
|
28
|
+
.journey-title,
|
|
29
|
+
.warning-title,
|
|
30
|
+
.relationship-title,
|
|
31
|
+
.email-title,
|
|
32
|
+
.paywall-title {
|
|
33
|
+
margin: 0;
|
|
34
|
+
color: var(--color-text);
|
|
35
|
+
font-size: 56px;
|
|
36
|
+
font-weight: 700;
|
|
37
|
+
line-height: 1.25;
|
|
38
|
+
letter-spacing: -0.04em;
|
|
39
|
+
overflow-wrap: anywhere;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.filing-text,
|
|
43
|
+
.journey-text,
|
|
44
|
+
.warning-text,
|
|
45
|
+
.relationship-text,
|
|
46
|
+
.family-text,
|
|
47
|
+
.email-text,
|
|
48
|
+
.paywall-subtitle {
|
|
49
|
+
margin: 16px 0 0;
|
|
50
|
+
color: var(--color-text);
|
|
51
|
+
font-size: 18px;
|
|
52
|
+
font-weight: 500;
|
|
53
|
+
line-height: 1.35;
|
|
54
|
+
overflow-wrap: anywhere;
|
|
55
|
+
}
|