PHP 8.2.31
Preview: pages.js Size: 2.23 KB
/home/nshryvcy/radiantskinclinics.org/wp-content/plugins/extendify_old/src/Launch/lib/pages.js

import {
	ContentGathering,
	state as contentGatheringState,
} from '@launch/pages/ContentGathering';
import { HomeSelect, state as homeSelectState } from '@launch/pages/HomeSelect';
import {
	ObjectiveSelection,
	state as objectiveSelectionState,
} from '@launch/pages/ObjectiveSelection';
import {
	PagesSelect,
	state as pagesSelectState,
} from '@launch/pages/PagesSelect';
import {
	SiteInformation,
	state as siteInfoState,
} from '@launch/pages/SiteInformation';
import { SitePrep, state as sitePrepState } from '@launch/pages/SitePrep';
import {
	SiteQuestions,
	state as siteQuestionsState,
} from '@launch/pages/SiteQuestions';
import {
	SiteStructure,
	state as siteStructureState,
} from '@launch/pages/SiteStructure';
import { useUserSelectionStore } from '@launch/state/user-selections';

const showSiteQuestions = window.extSharedData?.showSiteQuestions ?? false;

// This is the default pages array
// You can add pre-fetch functions to start fetching data for the next page
// Supports both [] and single fetcher functions
const initialPagesList = {
	'website-objective': {
		component: ObjectiveSelection,
		state: objectiveSelectionState,
		condition: () => !showSiteQuestions,
	},
	'site-information': {
		component: SiteInformation,
		state: siteInfoState,
	},
	'site-prep': {
		component: SitePrep,
		state: sitePrepState,
	},
	'site-questions': {
		component: SiteQuestions,
		state: siteQuestionsState,
		condition: () => showSiteQuestions,
	},
	'site-structure': {
		component: SiteStructure,
		state: siteStructureState,
		condition: ({ siteObjective }) =>
			siteObjective !== 'landing-page' || !showSiteQuestions,
	},
	'content-fetching': {
		component: ContentGathering,
		state: contentGatheringState,
	},
	layout: {
		component: HomeSelect,
		state: homeSelectState,
	},
	'page-select': {
		component: PagesSelect,
		state: pagesSelectState,
		condition: ({ siteStructure }) => siteStructure === 'multi-page',
	},
};

export const getPages = () => {
	const { siteStructure, siteObjective } =
		useUserSelectionStore?.getState() ?? {};
	const conditionData = { siteStructure, siteObjective };

	return Object.entries(initialPagesList).filter(
		([_, page]) => !page.condition || page.condition(conditionData),
	);
};

export const pages = getPages();

Directory Contents

Dirs: 1 × Files: 8

Name Size Perms Modified Actions
__tests__ DIR
- drwxr-xr-x 2026-04-28 02:40:02
Edit Download
154 B lrw-r--r-- 2025-08-27 17:47:28
Edit Download
1.91 KB lrw-r--r-- 2025-08-04 19:41:52
Edit Download
6.71 KB lrw-r--r-- 2026-03-19 23:35:18
Edit Download
1.30 KB lrw-r--r-- 2026-02-19 03:27:14
Edit Download
2.23 KB lrw-r--r-- 2025-07-16 19:39:24
Edit Download
1.60 KB lrw-r--r-- 2025-02-04 00:18:34
Edit Download
1.92 KB lrw-r--r-- 2026-02-19 03:27:14
Edit Download
12.71 KB lrw-r--r-- 2026-02-27 04:48:52
Edit Download

If ZipArchive is unavailable, a .tar will be created (no compression).