2025-12-02 09:54:38 +01:00
|
|
|
import type { Writable } from 'svelte/store';
|
|
|
|
|
import { writable } from 'svelte/store';
|
|
|
|
|
|
2026-04-12 08:58:41 +01:00
|
|
|
import type { OrgLandingPageJson } from '$lib/utils/types/org';
|
2026-05-18 03:47:22 +01:00
|
|
|
import type { LandingSectionKey } from '@cio/ui/custom/org-landing-page';
|
2026-04-12 08:58:41 +01:00
|
|
|
import { createDefaultLandingPageSettings } from '$features/org/utils/landing-page';
|
|
|
|
|
|
|
|
|
|
export const landingPageSettings: Writable<OrgLandingPageJson> = writable(createDefaultLandingPageSettings());
|
2026-05-18 03:47:22 +01:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Section currently selected in the landing-page editor preview. Shared between
|
|
|
|
|
* the left rail (which switches its panel based on this) and the preview wrappers
|
|
|
|
|
* (which render the outline + cap when their sectionKey matches). `null` means
|
|
|
|
|
* no section is selected — the editor shows the section list.
|
|
|
|
|
*/
|
|
|
|
|
export const landingPageEditorSelection: Writable<LandingSectionKey | null> = writable(null);
|
2026-06-22 05:43:48 +01:00
|
|
|
|
|
|
|
|
type SettingsHeaderAction = {
|
|
|
|
|
label: string;
|
|
|
|
|
disabled: boolean;
|
|
|
|
|
loading: boolean;
|
|
|
|
|
onClick: null | (() => void | Promise<void>);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export const settingsHeaderAction: Writable<SettingsHeaderAction> = writable({
|
|
|
|
|
label: 'Save',
|
|
|
|
|
disabled: true,
|
|
|
|
|
loading: false,
|
|
|
|
|
onClick: null
|
|
|
|
|
});
|