@riverbankcms/sdk 0.60.0 → 0.60.3
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/README.md +20 -3
- package/dist/_dts/api/src/bookingManagementEndpoints.d.ts +1 -3
- package/dist/_dts/api/src/bookingRecords.d.ts +8 -0
- package/dist/_dts/api/src/communications.d.ts +1 -0
- package/dist/_dts/api/src/contentRuntime.d.ts +8 -0
- package/dist/_dts/api/src/endpoints.d.ts +18 -1
- package/dist/_dts/api/src/index.d.ts +1 -1
- package/dist/_dts/api/src/media.d.ts +1 -1
- package/dist/_dts/api/src/siteManagementEndpoints.d.ts +45 -1
- package/dist/_dts/api/src/siteRuntimeEndpoints.d.ts +24 -1
- package/dist/_dts/api/src/siteSettings.d.ts +7 -0
- package/dist/_dts/api/src/types.d.ts +1 -1
- package/dist/_dts/billing/src/plans/types.d.ts +27 -0
- package/dist/_dts/blocks/src/system/blocks/events/event-calendar.d.ts +1 -0
- package/dist/_dts/blocks/src/system/blocks/location-map.d.ts +3 -0
- package/dist/_dts/blocks/src/system/blocks/site-footer.d.ts +1 -0
- package/dist/_dts/blocks/src/system/runtime/components/registry.client.d.ts +173 -2
- package/dist/_dts/blocks/src/system/runtime/components/runtime-backed-blocks.d.ts +24 -2
- package/dist/_dts/blocks/src/system/runtime/header/shared.d.ts +1 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/booking-form.client.d.ts +1 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/events/shared/AgendaEventCard.d.ts +2 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/events/shared/DayEventsModal.d.ts +2 -1
- package/dist/_dts/blocks/src/system/runtime/nodes/events/shared/EventDetailModal.d.ts +2 -1
- package/dist/_dts/blocks/src/system/runtime/nodes/events/shared/EventModals.d.ts +2 -1
- package/dist/_dts/blocks/src/system/runtime/nodes/events/shared/WeekAgendaView.d.ts +1 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/events/shared/WeekTimetableView.d.ts +1 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/events/shared/eventCapacity.d.ts +16 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/events/shared/timetableModel.d.ts +2 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/location-map.server.d.ts +4 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/location-map.shared.d.ts +38 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/location-map.view.d.ts +2 -1
- package/dist/_dts/content-editor/src/index.d.ts +2 -2
- package/dist/_dts/content-editor/src/primitives/shared/activePreviewField.d.ts +9 -0
- package/dist/_dts/content-editor/src/primitives/shared/index.d.ts +1 -0
- package/dist/_dts/content-editor/src/ui/editorUiStore.d.ts +10 -0
- package/dist/_dts/core/src/business-address.d.ts +38 -0
- package/dist/_dts/core/src/index.d.ts +1 -0
- package/dist/_dts/db/src/generated/supabase/database.types.d.ts +22 -0
- package/dist/_dts/editor-blocks/src/BlockEditor.d.ts +3 -0
- package/dist/_dts/editor-blocks/src/BlockForm.d.ts +4 -0
- package/dist/_dts/editor-blocks/src/block-editor/BlockCard.d.ts +8 -5
- package/dist/_dts/editor-blocks/src/block-editor/BlockCardHeader.d.ts +7 -5
- package/dist/_dts/editor-blocks/src/block-editor/SortableBlockItem.d.ts +2 -0
- package/dist/_dts/editor-blocks/src/block-editor/reorderControlMode.d.ts +3 -0
- package/dist/_dts/editor-blocks/src/block-editor/types.d.ts +4 -0
- package/dist/_dts/media-react/src/hooks/useApiMediaUploader.d.ts +14 -0
- package/dist/_dts/media-react/src/index.d.ts +1 -1
- package/dist/_dts/preview-next/src/client/blocks/runOptimisticCustomizeAction.d.ts +43 -20
- package/dist/_dts/preview-next/src/client/index.d.ts +2 -0
- package/dist/_dts/preview-next/src/client/preview/PageDesignEditorStateContext.d.ts +11 -28
- package/dist/_dts/preview-next/src/client/preview/PreviewEditorSidebar.d.ts +7 -1
- package/dist/_dts/preview-next/src/client/preview/PreviewEditorUI.d.ts +1 -1
- package/dist/_dts/preview-next/src/client/preview/PreviewShell.d.ts +12 -1
- package/dist/_dts/preview-next/src/client/preview/PreviewShellLayout.d.ts +6 -1
- package/dist/_dts/preview-next/src/client/preview/StyleConfigurator.d.ts +20 -0
- package/dist/_dts/preview-next/src/client/preview/StyleConfigurator.state.d.ts +99 -0
- package/dist/_dts/preview-next/src/client/preview/previewChromeSurface.d.ts +12 -0
- package/dist/_dts/preview-next/src/client/preview/previewCustomizeHistory.d.ts +41 -0
- package/dist/_dts/preview-next/src/client/preview/previewCustomizeRuntimePatch.d.ts +15 -0
- package/dist/_dts/preview-next/src/client/preview/previewCustomizeWorkflowState.d.ts +106 -0
- package/dist/_dts/preview-next/src/client/preview/previewUndoDomains.d.ts +34 -0
- package/dist/_dts/preview-next/src/client/preview/sidebarTabPreference.d.ts +2 -1
- package/dist/_dts/preview-next/src/client/preview/useOnboardingConfirmationCheck.d.ts +4 -9
- package/dist/_dts/preview-next/src/constants.d.ts +0 -1
- package/dist/_dts/preview-next/src/index.d.ts +1 -0
- package/dist/_dts/preview-next/src/onboarding-preview-planner.d.ts +89 -0
- package/dist/_dts/preview-next/src/route-contract.d.ts +37 -0
- package/dist/_dts/sdk/src/public-api/contracts.d.ts +11 -1
- package/dist/_dts/sdk/src/rendering/components/Block.d.ts +7 -76
- package/dist/_dts/sdk/src/rendering/components/Block.server.d.ts +9 -0
- package/dist/_dts/sdk/src/rendering/components/Block.shared.d.ts +78 -0
- package/dist/_dts/sdk/src/rendering/components/Layout.d.ts +5 -5
- package/dist/_dts/sdk/src/rendering/server.d.ts +2 -2
- package/dist/_dts/sdk/src/version.d.ts +1 -1
- package/dist/_dts/theme-core/src/buttons/constants.d.ts +9 -1
- package/dist/_dts/theme-core/src/buttons/generateButtonCss.d.ts +16 -11
- package/dist/_dts/theme-core/src/buttons/generateDefaultButtonSystem.d.ts +9 -16
- package/dist/_dts/theme-core/src/buttons/index.d.ts +1 -0
- package/dist/_dts/theme-core/src/buttons/personalities/brushed-wash.d.ts +11 -0
- package/dist/_dts/theme-core/src/buttons/personalities/confident-chip.d.ts +11 -0
- package/dist/_dts/theme-core/src/buttons/personalities/editorial-link.d.ts +11 -0
- package/dist/_dts/theme-core/src/buttons/personalities/index.d.ts +14 -0
- package/dist/_dts/theme-core/src/buttons/personalities/ink-stamp.d.ts +11 -0
- package/dist/_dts/theme-core/src/buttons/personalities/pebble.d.ts +11 -0
- package/dist/_dts/theme-core/src/buttons/personalities/soft-pill.d.ts +11 -0
- package/dist/_dts/theme-core/src/buttons/personalities/types.d.ts +268 -0
- package/dist/_dts/theme-core/src/buttons/types.d.ts +253 -72
- package/dist/_dts/theme-core/src/generated/containerResponsiveThemeCss.d.ts +1 -1
- package/dist/_dts/theme-core/src/index.d.ts +17 -16
- package/dist/_dts/theme-core/src/mock-themes/all.d.ts +69 -15
- package/dist/_dts/theme-core/src/palette/index.d.ts +1 -0
- package/dist/_dts/theme-core/src/palette/variants/brand-led.d.ts +28 -0
- package/dist/_dts/theme-core/src/palette/variants/high-contrast.d.ts +28 -0
- package/dist/_dts/theme-core/src/palette/variants/index.d.ts +17 -0
- package/dist/_dts/theme-core/src/palette/variants/soft-natural.d.ts +28 -0
- package/dist/_dts/theme-core/src/palette/variants/types.d.ts +154 -0
- package/dist/_dts/theme-core/src/palette/variants/warm-neutral.d.ts +28 -0
- package/dist/_dts/theme-core/src/responsiveDisplay.d.ts +23 -0
- package/dist/_dts/theme-core/src/responsiveMode.d.ts +21 -0
- package/dist/_dts/theme-core/src/schema.d.ts +122 -10
- package/dist/_dts/theme-core/src/site-styles/compatibility.d.ts +109 -0
- package/dist/_dts/theme-core/src/site-styles/curatedSiteStyles.d.ts +193 -0
- package/dist/_dts/theme-core/src/site-styles/index.d.ts +2 -0
- package/dist/_dts/theme-core/src/site-styles/pageDesignEditorErrors.d.ts +1 -0
- package/dist/_dts/theme-core/src/site-styles/pageDesignEditorModel.d.ts +4 -0
- package/dist/_dts/theme-core/src/site-styles/previewCompiler.d.ts +43 -2
- package/dist/_dts/theme-core/src/site-styles/runtimeCompiler.d.ts +23 -1
- package/dist/_dts/ui/src/badge.d.ts +1 -1
- package/dist/_dts/ui/src/callout.d.ts +1 -1
- package/dist/_dts/ui/src/command-multi-select.d.ts +2 -2
- package/dist/cli/index.mjs +1590 -302
- package/dist/client/bookings.mjs +321 -144
- package/dist/client/client.mjs +4371 -2715
- package/dist/client/hooks.mjs +2826 -1675
- package/dist/client/rendering/client.mjs +3570 -2262
- package/dist/client/rendering/islands.mjs +1948 -756
- package/dist/client/rendering.mjs +42015 -40278
- package/dist/preview-next/before-render.mjs +5542 -0
- package/dist/preview-next/client/runtime.mjs +103364 -99924
- package/dist/preview-next/constants.mjs +0 -2
- package/dist/preview-next/index.mjs +0 -2
- package/dist/preview-next/middleware.mjs +5552 -1
- package/dist/server/components.mjs +11234 -9740
- package/dist/server/config-validation.mjs +3057 -1906
- package/dist/server/config.mjs +3057 -1906
- package/dist/server/data.mjs +2826 -1675
- package/dist/server/index.mjs +19 -2
- package/dist/server/next.mjs +3997 -2507
- package/dist/server/page-converter.mjs +2970 -1836
- package/dist/server/prebuild.mjs +1 -1
- package/dist/server/rendering/server.mjs +5960 -3200
- package/dist/server/rendering.mjs +12734 -11162
- package/dist/server/routing.mjs +3045 -1743
- package/dist/server/server.mjs +2827 -1676
- package/dist/server/theme-bridge.mjs +2074 -839
- package/dist/server/theme.mjs +1087 -492
- package/dist/styles/index.css +343 -299
- package/package.json +1 -1
- package/dist/_dts/preview-next/src/client/preview/PreviewSiteStyleSwitcher.d.ts +0 -11
- package/dist/_dts/preview-next/src/client/preview/PreviewSiteStyleSwitcher.state.d.ts +0 -43
|
@@ -8311,6 +8311,7 @@ export type Database = {
|
|
|
8311
8311
|
reply_to_email: string | null;
|
|
8312
8312
|
sender_address_line_1: string | null;
|
|
8313
8313
|
sender_address_line_2: string | null;
|
|
8314
|
+
sender_address_source: string;
|
|
8314
8315
|
sender_city: string | null;
|
|
8315
8316
|
sender_country: string | null;
|
|
8316
8317
|
sender_display_name: string | null;
|
|
@@ -8332,6 +8333,7 @@ export type Database = {
|
|
|
8332
8333
|
reply_to_email?: string | null;
|
|
8333
8334
|
sender_address_line_1?: string | null;
|
|
8334
8335
|
sender_address_line_2?: string | null;
|
|
8336
|
+
sender_address_source?: string;
|
|
8335
8337
|
sender_city?: string | null;
|
|
8336
8338
|
sender_country?: string | null;
|
|
8337
8339
|
sender_display_name?: string | null;
|
|
@@ -8353,6 +8355,7 @@ export type Database = {
|
|
|
8353
8355
|
reply_to_email?: string | null;
|
|
8354
8356
|
sender_address_line_1?: string | null;
|
|
8355
8357
|
sender_address_line_2?: string | null;
|
|
8358
|
+
sender_address_source?: string;
|
|
8356
8359
|
sender_city?: string | null;
|
|
8357
8360
|
sender_country?: string | null;
|
|
8358
8361
|
sender_display_name?: string | null;
|
|
@@ -11716,6 +11719,7 @@ export type Database = {
|
|
|
11716
11719
|
banner_settings: Json;
|
|
11717
11720
|
billing_settings: Json | null;
|
|
11718
11721
|
booking_settings: Json;
|
|
11722
|
+
business_address: Json | null;
|
|
11719
11723
|
created_at: string;
|
|
11720
11724
|
favicon_asset_id: string | null;
|
|
11721
11725
|
footer_content_json: Json;
|
|
@@ -11742,6 +11746,7 @@ export type Database = {
|
|
|
11742
11746
|
banner_settings?: Json;
|
|
11743
11747
|
billing_settings?: Json | null;
|
|
11744
11748
|
booking_settings?: Json;
|
|
11749
|
+
business_address?: Json | null;
|
|
11745
11750
|
created_at?: string;
|
|
11746
11751
|
favicon_asset_id?: string | null;
|
|
11747
11752
|
footer_content_json?: Json;
|
|
@@ -11768,6 +11773,7 @@ export type Database = {
|
|
|
11768
11773
|
banner_settings?: Json;
|
|
11769
11774
|
billing_settings?: Json | null;
|
|
11770
11775
|
booking_settings?: Json;
|
|
11776
|
+
business_address?: Json | null;
|
|
11771
11777
|
created_at?: string;
|
|
11772
11778
|
favicon_asset_id?: string | null;
|
|
11773
11779
|
footer_content_json?: Json;
|
|
@@ -12010,30 +12016,39 @@ export type Database = {
|
|
|
12010
12016
|
};
|
|
12011
12017
|
site_theme_selections: {
|
|
12012
12018
|
Row: {
|
|
12019
|
+
button_personality_id: string | null;
|
|
12013
12020
|
created_at: string;
|
|
12014
12021
|
id: string;
|
|
12015
12022
|
is_current: boolean;
|
|
12016
12023
|
overrides: Json;
|
|
12024
|
+
palette_overrides: Json | null;
|
|
12025
|
+
palette_variant_id: string | null;
|
|
12017
12026
|
site_id: string;
|
|
12018
12027
|
theme_id: string;
|
|
12019
12028
|
updated_at: string;
|
|
12020
12029
|
user_id: string;
|
|
12021
12030
|
};
|
|
12022
12031
|
Insert: {
|
|
12032
|
+
button_personality_id?: string | null;
|
|
12023
12033
|
created_at?: string;
|
|
12024
12034
|
id?: string;
|
|
12025
12035
|
is_current?: boolean;
|
|
12026
12036
|
overrides?: Json;
|
|
12037
|
+
palette_overrides?: Json | null;
|
|
12038
|
+
palette_variant_id?: string | null;
|
|
12027
12039
|
site_id: string;
|
|
12028
12040
|
theme_id: string;
|
|
12029
12041
|
updated_at?: string;
|
|
12030
12042
|
user_id: string;
|
|
12031
12043
|
};
|
|
12032
12044
|
Update: {
|
|
12045
|
+
button_personality_id?: string | null;
|
|
12033
12046
|
created_at?: string;
|
|
12034
12047
|
id?: string;
|
|
12035
12048
|
is_current?: boolean;
|
|
12036
12049
|
overrides?: Json;
|
|
12050
|
+
palette_overrides?: Json | null;
|
|
12051
|
+
palette_variant_id?: string | null;
|
|
12037
12052
|
site_id?: string;
|
|
12038
12053
|
theme_id?: string;
|
|
12039
12054
|
updated_at?: string;
|
|
@@ -13914,6 +13929,13 @@ export type Database = {
|
|
|
13914
13929
|
waitlist_position: number;
|
|
13915
13930
|
}[];
|
|
13916
13931
|
};
|
|
13932
|
+
create_media_asset_with_storage_quota: {
|
|
13933
|
+
Args: {
|
|
13934
|
+
p_asset: Json;
|
|
13935
|
+
p_max_bytes: number;
|
|
13936
|
+
};
|
|
13937
|
+
Returns: string;
|
|
13938
|
+
};
|
|
13917
13939
|
create_order_shipment_atomic: {
|
|
13918
13940
|
Args: {
|
|
13919
13941
|
p_carrier_name?: string;
|
|
@@ -5,6 +5,7 @@ import { type Theme } from '@riverbankcms/blocks';
|
|
|
5
5
|
import type { PageDesignEditorReadModel } from '@riverbankcms/theme-core/site-styles';
|
|
6
6
|
import { type EditorStructuralCommand } from '@riverbankcms/core';
|
|
7
7
|
import { type SdkConfigForBlockPicker } from './block-editor/sdkBlockMerger';
|
|
8
|
+
import { type ReorderControlMode } from './block-editor/reorderControlMode';
|
|
8
9
|
import type { ArrayKeysManager, BlockEditorHandle, BlockItem, BlockFocusRequest, UiSlice, DraftsSlice } from './block-editor/types';
|
|
9
10
|
import type { BlockDraftSaveability, FieldWidgetComponent } from '@riverbankcms/block-form/client';
|
|
10
11
|
type UiState = {
|
|
@@ -13,6 +14,7 @@ type UiState = {
|
|
|
13
14
|
requestFocus: UiSlice['requestFocus'];
|
|
14
15
|
clearFocus: () => void;
|
|
15
16
|
setActiveBlockId: UiSlice['setActiveBlockId'];
|
|
17
|
+
setActivePreviewField: UiSlice['setActivePreviewField'];
|
|
16
18
|
arrayKeys: ArrayKeysManager;
|
|
17
19
|
blockValidation: {
|
|
18
20
|
markPathEdited: (blockId: Parameters<DraftsSlice['setAtPath']>[0], path: string) => void;
|
|
@@ -49,6 +51,7 @@ export type BlockEditorProps = {
|
|
|
49
51
|
pageDesignEditorModel?: PageDesignEditorReadModel | null;
|
|
50
52
|
enabledContentTypes?: string[];
|
|
51
53
|
sdkConfig?: SdkConfigForBlockPicker | null;
|
|
54
|
+
reorderControlMode?: ReorderControlMode;
|
|
52
55
|
};
|
|
53
56
|
export declare const BlockEditor: import("react").ForwardRefExoticComponent<BlockEditorProps & import("react").RefAttributes<BlockEditorHandle>>;
|
|
54
57
|
export {};
|
|
@@ -5,6 +5,10 @@ import { type PageDesignEditorBlock } from '@riverbankcms/theme-core/site-styles
|
|
|
5
5
|
import { type EditorBlockId } from '@riverbankcms/core';
|
|
6
6
|
import type { ArrayKeysManager, DraftsSlice, UiStore as BlockEditorUiStore } from './block-editor/types';
|
|
7
7
|
type UiStoreState = {
|
|
8
|
+
setActivePreviewField: (field: {
|
|
9
|
+
blockId: EditorBlockId;
|
|
10
|
+
fieldPath: string;
|
|
11
|
+
} | null) => void;
|
|
8
12
|
blockValidation: {
|
|
9
13
|
markPathEdited: (blockId: EditorBlockId, path: string) => void;
|
|
10
14
|
isPathEdited: (blockId: EditorBlockId, path: string) => boolean;
|
|
@@ -1,13 +1,15 @@
|
|
|
1
|
+
import type { SyntheticListenerMap } from '@dnd-kit/core/dist/hooks/utilities';
|
|
1
2
|
import { type EditorBlockId } from '@riverbankcms/core';
|
|
2
3
|
import type { PageDesignEditorBlock } from '@riverbankcms/theme-core/site-styles';
|
|
3
4
|
import type { SystemBlockDefinition } from '@riverbankcms/blocks';
|
|
4
|
-
import type { Theme } from '@riverbankcms/blocks';
|
|
5
5
|
import type { BlockDraftSaveability } from '@riverbankcms/block-form/client';
|
|
6
|
+
import type { FieldWidgetComponent } from '@riverbankcms/block-form/client';
|
|
7
|
+
import type { Theme } from '@riverbankcms/blocks';
|
|
8
|
+
import { type ReorderControlMode } from './reorderControlMode';
|
|
6
9
|
import type { ArrayKeysManager, BlockFocusRequest, BlockItem, UiStore, DraftsSlice, UiSlice } from './types';
|
|
7
10
|
/** Drag listener props from dnd-kit */
|
|
8
|
-
type DragListeners =
|
|
9
|
-
|
|
10
|
-
type BlockCardStore = UiStore<Pick<UiSlice, 'activeBlockId' | 'setActiveBlockId'> & {
|
|
11
|
+
type DragListeners = SyntheticListenerMap | undefined;
|
|
12
|
+
type BlockCardStore = UiStore<Pick<UiSlice, 'activeBlockId' | 'setActiveBlockId' | 'setActivePreviewField'> & {
|
|
11
13
|
blockValidation: {
|
|
12
14
|
markPathEdited: (blockId: EditorBlockId, path: string) => void;
|
|
13
15
|
isPathEdited: (blockId: EditorBlockId, path: string) => boolean;
|
|
@@ -17,7 +19,7 @@ type BlockCardStore = UiStore<Pick<UiSlice, 'activeBlockId' | 'setActiveBlockId'
|
|
|
17
19
|
drafts: Pick<DraftsSlice, 'getBlockSnapshot' | 'getCurrentValues' | 'getAtPath' | 'setAtPath' | 'edit' | 'initNewBlock' | 'updateBlockBaseline' | 'clearError'>;
|
|
18
20
|
arrayKeys: ArrayKeysManager;
|
|
19
21
|
}>;
|
|
20
|
-
export declare function BlockCard({ siteId, block, manifest, isFirst, isLast, isMoving, onMove, onDuplicate, onDelete, dragListeners, canReorder, collapsed, onCollapsedChange, highlighted, hasRecoveryConflict, focusSignal, onFocusHandled, onBlockSave, theme, widgetOverrides, uiStore, hideThemeV2RawStyleFields, pageDesignBlock, }: {
|
|
22
|
+
export declare function BlockCard({ siteId, block, manifest, isFirst, isLast, isMoving, onMove, onDuplicate, onDelete, dragListeners, canReorder, collapsed, onCollapsedChange, highlighted, hasRecoveryConflict, focusSignal, onFocusHandled, onBlockSave, theme, widgetOverrides, uiStore, hideThemeV2RawStyleFields, pageDesignBlock, reorderControlMode, }: {
|
|
21
23
|
siteId: string;
|
|
22
24
|
block: BlockItem;
|
|
23
25
|
manifest: SystemBlockDefinition['manifest'];
|
|
@@ -41,5 +43,6 @@ export declare function BlockCard({ siteId, block, manifest, isFirst, isLast, is
|
|
|
41
43
|
uiStore: BlockCardStore;
|
|
42
44
|
hideThemeV2RawStyleFields?: boolean;
|
|
43
45
|
pageDesignBlock?: PageDesignEditorBlock | null;
|
|
46
|
+
reorderControlMode?: ReorderControlMode;
|
|
44
47
|
}): import("react/jsx-runtime").JSX.Element;
|
|
45
48
|
export {};
|
|
@@ -1,14 +1,15 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
/** Drag listener props from dnd-kit */
|
|
3
|
-
type DragListeners = Record<string, Function> | undefined;
|
|
4
|
-
import type { SystemBlockDefinition } from '@riverbankcms/blocks';
|
|
1
|
+
import type { SyntheticListenerMap } from '@dnd-kit/core/dist/hooks/utilities';
|
|
5
2
|
import type { FieldWidgetComponent } from '@riverbankcms/block-form/client';
|
|
3
|
+
import { type SystemBlockDefinition, type Theme } from '@riverbankcms/blocks';
|
|
4
|
+
import type { ReorderControlMode } from './reorderControlMode';
|
|
6
5
|
import type { BlockItem, UiStore, DraftsSlice, ArrayKeysManager } from './types';
|
|
6
|
+
/** Drag listener props from dnd-kit */
|
|
7
|
+
type DragListeners = SyntheticListenerMap | undefined;
|
|
7
8
|
type BlockCardHeaderStore = UiStore<{
|
|
8
9
|
drafts: Pick<DraftsSlice, 'getBlockSnapshot' | 'getCurrentValues' | 'initNewBlock' | 'updateBlockBaseline' | 'clearError' | 'setAtPath' | 'getAtPath'>;
|
|
9
10
|
arrayKeys: ArrayKeysManager;
|
|
10
11
|
}>;
|
|
11
|
-
export declare function BlockCardHeader({ block, manifest, isFirst, isLast, isMoving, onMove, onDuplicate, onDelete, dragListeners, canReorder, collapsed, onToggleCollapsed, contentId, uiStore, widgetOverrides, theme, hideThemeV2RawStyleFields, }: {
|
|
12
|
+
export declare function BlockCardHeader({ block, manifest, isFirst, isLast, isMoving, onMove, onDuplicate, onDelete, dragListeners, canReorder, collapsed, onToggleCollapsed, contentId, uiStore, widgetOverrides, theme, hideThemeV2RawStyleFields, reorderControlMode, }: {
|
|
12
13
|
block: BlockItem;
|
|
13
14
|
manifest: SystemBlockDefinition['manifest'];
|
|
14
15
|
isFirst: boolean;
|
|
@@ -27,5 +28,6 @@ export declare function BlockCardHeader({ block, manifest, isFirst, isLast, isMo
|
|
|
27
28
|
widgetOverrides?: Record<string, FieldWidgetComponent>;
|
|
28
29
|
theme?: Theme | null;
|
|
29
30
|
hideThemeV2RawStyleFields?: boolean;
|
|
31
|
+
reorderControlMode?: ReorderControlMode;
|
|
30
32
|
}): import("react/jsx-runtime").JSX.Element;
|
|
31
33
|
export {};
|
|
@@ -5,6 +5,7 @@ import type { BlockFocusRequest, BlockItem } from './types';
|
|
|
5
5
|
import { type SdkConfigForBlockPicker } from './sdkBlockMerger';
|
|
6
6
|
import { BlockCard } from './BlockCard';
|
|
7
7
|
import type { FieldWidgetComponent } from '@riverbankcms/block-form/client';
|
|
8
|
+
import { type ReorderControlMode } from './reorderControlMode';
|
|
8
9
|
export declare const SortableBlockItem: import("react").NamedExoticComponent<{
|
|
9
10
|
siteId: string;
|
|
10
11
|
block: BlockItem;
|
|
@@ -28,4 +29,5 @@ export declare const SortableBlockItem: import("react").NamedExoticComponent<{
|
|
|
28
29
|
sdkConfig?: SdkConfigForBlockPicker | null;
|
|
29
30
|
hideThemeV2RawStyleFields?: boolean;
|
|
30
31
|
pageDesignBlock?: PageDesignEditorBlock | null;
|
|
32
|
+
reorderControlMode?: ReorderControlMode;
|
|
31
33
|
}>;
|
|
@@ -43,6 +43,10 @@ export type UiSlice = {
|
|
|
43
43
|
itemIndex?: number | null;
|
|
44
44
|
}) => void;
|
|
45
45
|
clearFocus: () => void;
|
|
46
|
+
setActivePreviewField: (field: {
|
|
47
|
+
blockId: EditorBlockId;
|
|
48
|
+
fieldPath: string;
|
|
49
|
+
} | null) => void;
|
|
46
50
|
};
|
|
47
51
|
export type ArrayKeysManager = {
|
|
48
52
|
get: (scope: string, path: string) => string[] | undefined;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { ApiErrorCode, FieldError } from '@riverbankcms/api/common';
|
|
1
2
|
import { type ApiClient } from '@riverbankcms/api/request';
|
|
2
3
|
import type { UploadIntentContract } from '@riverbankcms/api';
|
|
3
4
|
import type { VideoPrepIntent } from '@riverbankcms/media-core';
|
|
@@ -6,6 +7,19 @@ import type { UploadProgressHandler } from './useUploads';
|
|
|
6
7
|
import { type ClassificationHook, type LoggerLike } from './internal/classification';
|
|
7
8
|
export type UploadIntentResolver = UploadIntentContract | ((file: File) => UploadIntentContract | undefined);
|
|
8
9
|
export type VideoPrepIntentResolver = VideoPrepIntent | ((file: File) => VideoPrepIntent | undefined);
|
|
10
|
+
export declare class MediaUploaderError extends Error {
|
|
11
|
+
readonly code?: ApiErrorCode;
|
|
12
|
+
readonly status?: number;
|
|
13
|
+
readonly fieldErrors?: readonly FieldError[];
|
|
14
|
+
readonly cause?: unknown;
|
|
15
|
+
constructor(message: string, options?: {
|
|
16
|
+
readonly code?: ApiErrorCode;
|
|
17
|
+
readonly status?: number;
|
|
18
|
+
readonly fieldErrors?: readonly FieldError[];
|
|
19
|
+
readonly cause?: unknown;
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
export declare function getMediaUploaderErrorCode(error: Error | undefined): ApiErrorCode | undefined;
|
|
9
23
|
export type UseApiMediaUploaderOptions = {
|
|
10
24
|
siteId: string;
|
|
11
25
|
apiClient: ApiClient;
|
|
@@ -6,7 +6,7 @@ export { useUploads } from './hooks/useUploads';
|
|
|
6
6
|
export type { UseUploadsOptions, UseUploadsResult, UploadItem, UploadStatus, UploadProgressStage, UploadProgressHandler } from './hooks/useUploads';
|
|
7
7
|
export { useSupabaseMediaUploader } from './hooks/useSupabaseMediaUploader';
|
|
8
8
|
export type { UseSupabaseMediaUploaderOptions } from './hooks/useSupabaseMediaUploader';
|
|
9
|
-
export { useApiMediaUploader } from './hooks/useApiMediaUploader';
|
|
9
|
+
export { getMediaUploaderErrorCode, MediaUploaderError, useApiMediaUploader, } from './hooks/useApiMediaUploader';
|
|
10
10
|
export type { UploadIntentResolver, UseApiMediaUploaderOptions, VideoPrepIntentResolver } from './hooks/useApiMediaUploader';
|
|
11
11
|
export { useAuthenticatedImageSrc } from './hooks/useAuthenticatedImageSrc';
|
|
12
12
|
export { extractVideoPosterFrame } from './videoFrameExtraction';
|
|
@@ -1,21 +1,44 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Sequence-numbered runner for optimistic save flows where the user can fire
|
|
3
|
+
* the next action before the previous save resolves. Each invocation gets a
|
|
4
|
+
* fresh sequence number from a shared `nextSequence` callback; the runner
|
|
5
|
+
* only commits success / failure when its sequence is still the latest.
|
|
6
|
+
*
|
|
7
|
+
* Used by the Style configurator: tapping personality A then quickly tapping
|
|
8
|
+
* personality B should land B's save even if A's network round-trip is
|
|
9
|
+
* slower, and A's late-arriving response must not clobber B's local state.
|
|
10
|
+
*/
|
|
11
|
+
export type OptimisticActionRun<TSuccess> = Readonly<{
|
|
12
|
+
/**
|
|
13
|
+
* Pure result computed locally before the network call fires (the
|
|
14
|
+
* optimistic "this is what the world will look like" snapshot). Skipped
|
|
15
|
+
* if the runner has already been superseded.
|
|
16
|
+
*/
|
|
17
|
+
optimistic?: () => void;
|
|
18
|
+
/** The network call. Resolves with the persisted payload. */
|
|
19
|
+
network: () => Promise<TSuccess>;
|
|
20
|
+
/**
|
|
21
|
+
* Invoked when `network` resolves AND this run is still the latest.
|
|
22
|
+
* Stale runs swallow the success silently — the next run will reconcile.
|
|
23
|
+
*/
|
|
24
|
+
onSuccess: (success: TSuccess) => void;
|
|
25
|
+
/**
|
|
26
|
+
* Invoked when `network` rejects AND this run is still the latest. Stale
|
|
27
|
+
* failures are ignored on the same principle.
|
|
28
|
+
*/
|
|
29
|
+
onError: (error: unknown) => void;
|
|
8
30
|
}>;
|
|
9
|
-
export
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
31
|
+
export type OptimisticActionRunner = Readonly<{
|
|
32
|
+
/** Schedule a new run; returns its sequence number for debugging / tests. */
|
|
33
|
+
run: <TSuccess>(action: OptimisticActionRun<TSuccess>) => Promise<number>;
|
|
34
|
+
/** Force the runner into a known sequence — useful for unmount sentinels. */
|
|
35
|
+
invalidate: () => void;
|
|
36
|
+
/** Read the latest sequence. Test/debug only; UI should not branch on it. */
|
|
37
|
+
current: () => number;
|
|
38
|
+
}>;
|
|
39
|
+
/**
|
|
40
|
+
* Create a runner. The runner is stateful (holds the latest sequence)
|
|
41
|
+
* but the inputs to each `run` call are pure data — so individual actions
|
|
42
|
+
* remain easy to unit-test by stubbing `network`.
|
|
43
|
+
*/
|
|
44
|
+
export declare function createOptimisticActionRunner(): OptimisticActionRunner;
|
|
@@ -2,6 +2,8 @@ export type { PreviewAuthFailureSource, PreviewAuthFetch, PreviewAuthState, } fr
|
|
|
2
2
|
export { initPreviewAuth, markPreviewAuthExpired, usePreviewAuth, usePreviewAuthFetch, usePreviewToken, } from "./previewAuthStore";
|
|
3
3
|
export type { OnboardingPreviewRedirectAuthPlan, PreviewAuthMode, PreviewExchangeTokenKind, PreviewRuntimeSession, PreviewSessionAuthMode, PreviewSessionTokens, } from "../auth-contract";
|
|
4
4
|
export { getPreviewRuntimeSessionAuthMode, isPreviewRuntimeSessionEditable, resolveOnboardingPreviewRedirectAuthPlan, resolvePreviewAuthMode, resolvePreviewExchangeTokenKind, resolvePreviewRuntimeSession, resolvePreviewSessionCanEdit, } from "../auth-contract";
|
|
5
|
+
export type { OnboardingPreviewEndpointUrlInput, OnboardingPreviewStage, PreviewAuthEntryUrlInput, PreviewAuthExchangeUrlInput, PreviewBrowserEntryRouteKey, PreviewDashboardApiEndpointKey, } from "../route-contract";
|
|
6
|
+
export { buildOnboardingPreviewStatusUrl, buildOnboardingResendConfirmationUrl, buildPreviewAuthEntryUrl, buildPreviewAuthExchangeUrl, previewAuthEntryPathname, previewBrowserEntries, previewDashboardApiEndpoints, } from "../route-contract";
|
|
5
7
|
export { PreviewShellSmoke } from "./PreviewShellSmoke";
|
|
6
8
|
export { PreviewLayoutProvider, usePreviewLayout, } from "./layout/PreviewLayoutContext";
|
|
7
9
|
export { useOptionalPreviewLayout } from "./layout/PreviewLayoutContext";
|
|
@@ -1,37 +1,22 @@
|
|
|
1
1
|
import { type ReactNode } from 'react';
|
|
2
|
-
import type { APIEndpoints } from '@riverbankcms/api';
|
|
3
2
|
import { type ApiClient } from '@riverbankcms/api/request';
|
|
4
3
|
import type { PreviewCustomizeAction } from '../blocks/previewCustomizeActions';
|
|
5
|
-
type
|
|
6
|
-
type
|
|
7
|
-
export type PreviewPageDesignEditorApplyOutcome = Readonly<{
|
|
8
|
-
kind: 'saved';
|
|
9
|
-
response: ApplyPageDesignEditorActionResponse;
|
|
10
|
-
}> | Readonly<{
|
|
11
|
-
kind: 'skipped';
|
|
12
|
-
}> | Readonly<{
|
|
13
|
-
kind: 'stale';
|
|
14
|
-
message: string;
|
|
15
|
-
}> | Readonly<{
|
|
16
|
-
kind: 'invalid';
|
|
17
|
-
message: string;
|
|
18
|
-
}> | Readonly<{
|
|
19
|
-
kind: 'failed';
|
|
20
|
-
message: string;
|
|
21
|
-
}>;
|
|
22
|
-
export type PreviewPageDesignEditorState = Readonly<{
|
|
23
|
-
kind: 'unsupported';
|
|
24
|
-
}> | Readonly<{
|
|
25
|
-
kind: 'loading';
|
|
26
|
-
}> | Readonly<{
|
|
27
|
-
kind: 'failed';
|
|
28
|
-
message: string;
|
|
29
|
-
}> | ApiPageDesignEditorStateResponse;
|
|
4
|
+
import { type PreviewPageDesignEditorApplyOutcome, type PreviewPageDesignEditorState } from './previewCustomizeWorkflowState';
|
|
5
|
+
export type { PreviewPageDesignEditorApplyOutcome, PreviewPageDesignEditorState, } from './previewCustomizeWorkflowState';
|
|
30
6
|
type PageDesignEditorStateContextValue = Readonly<{
|
|
31
7
|
state: PreviewPageDesignEditorState;
|
|
32
8
|
reload: () => void;
|
|
33
9
|
applyAction: (action: PreviewCustomizeAction) => Promise<PreviewPageDesignEditorApplyOutcome>;
|
|
10
|
+
undo: () => Promise<PreviewPageDesignEditorApplyOutcome>;
|
|
11
|
+
redo: () => Promise<PreviewPageDesignEditorApplyOutcome>;
|
|
12
|
+
canUndo: boolean;
|
|
13
|
+
canRedo: boolean;
|
|
14
|
+
isHistoryPending: boolean;
|
|
15
|
+
isHistoryStale: boolean;
|
|
16
|
+
historyFailure: string | null;
|
|
34
17
|
}>;
|
|
18
|
+
export declare const PREVIEW_CUSTOMIZE_STALE_MESSAGE = "This page changed since that design choice. Refresh the preview, then try again.";
|
|
19
|
+
export { applyPreviewCustomizeActionToState } from './previewCustomizeWorkflowState';
|
|
35
20
|
export declare function PreviewPageDesignEditorStateProvider({ apiClient, siteId, pageId, enabled, children, }: Readonly<{
|
|
36
21
|
apiClient: ApiClient;
|
|
37
22
|
siteId: string;
|
|
@@ -40,5 +25,3 @@ export declare function PreviewPageDesignEditorStateProvider({ apiClient, siteId
|
|
|
40
25
|
children: ReactNode;
|
|
41
26
|
}>): import("react/jsx-runtime").JSX.Element;
|
|
42
27
|
export declare function usePreviewPageDesignEditorState(): PageDesignEditorStateContextValue;
|
|
43
|
-
export declare function applyPreviewCustomizeActionToState(state: PreviewPageDesignEditorState, action: PreviewCustomizeAction): PreviewPageDesignEditorState;
|
|
44
|
-
export {};
|
|
@@ -5,6 +5,8 @@ import type { SurfaceId } from "@riverbankcms/surfaces";
|
|
|
5
5
|
import type { MediaAssetIndexItem, OccurrenceContextData, Theme } from "@riverbankcms/blocks";
|
|
6
6
|
import { type ContentTypeSchema } from "@riverbankcms/content-model";
|
|
7
7
|
import { type ZoomLevel } from "@riverbankcms/content-editor";
|
|
8
|
+
import type { ButtonPersonalityId } from "@riverbankcms/theme-core/buttons";
|
|
9
|
+
import type { PaletteOverrides, PaletteVariantId } from "@riverbankcms/theme-core/palette";
|
|
8
10
|
import type { ViewportMode, ViewportWidth } from "./PreviewViewportControls";
|
|
9
11
|
import { type SiteStyleAccess } from "./siteStyleAccess";
|
|
10
12
|
export type PreviewEditorSidebarTab = "editor" | "assistant";
|
|
@@ -29,6 +31,10 @@ export type PreviewEditorSidebarProps = {
|
|
|
29
31
|
theme?: Theme | null;
|
|
30
32
|
themeId?: string | null;
|
|
31
33
|
themeSelectionId?: string | null;
|
|
34
|
+
/** Persisted Style configurator selections (Phase C / E). */
|
|
35
|
+
themeSelectionButtonPersonalityId?: ButtonPersonalityId | null;
|
|
36
|
+
themeSelectionPaletteVariantId?: PaletteVariantId | null;
|
|
37
|
+
themeSelectionPaletteOverrides?: PaletteOverrides | null;
|
|
32
38
|
apiClient: ApiClient;
|
|
33
39
|
bearerToken?: string | null;
|
|
34
40
|
supabaseUrl?: string;
|
|
@@ -47,4 +53,4 @@ export type PreviewEditorSidebarProps = {
|
|
|
47
53
|
onViewportWidthChange: (width: ViewportWidth) => void;
|
|
48
54
|
onZoomChange: (zoom: ZoomLevel) => void;
|
|
49
55
|
};
|
|
50
|
-
export declare function PreviewEditorSidebar({ surfaceId, siteId, dashboardBaseUrl, pageId, entryData, contentTypeSchema, referenceContentTypeKeys, draftContent, currentTemplate, theme, themeId, themeSelectionId, apiClient, bearerToken, supabaseUrl, occurrenceContext, assistantPanel, sdkConfig, mediaAssets, siteStyleAccess, activeTab, onTabChange, onClose, viewportMode, viewportWidth, zoom, onViewportModeChange, onViewportWidthChange, onZoomChange, }: PreviewEditorSidebarProps): import("react/jsx-runtime").JSX.Element;
|
|
56
|
+
export declare function PreviewEditorSidebar({ surfaceId, siteId, dashboardBaseUrl, pageId, entryData, contentTypeSchema, referenceContentTypeKeys, draftContent, currentTemplate, theme, themeId, themeSelectionId, themeSelectionButtonPersonalityId, themeSelectionPaletteVariantId, themeSelectionPaletteOverrides, apiClient, bearerToken, supabaseUrl, occurrenceContext, assistantPanel, sdkConfig, mediaAssets, siteStyleAccess, activeTab, onTabChange, onClose, viewportMode, viewportWidth, zoom, onViewportModeChange, onViewportWidthChange, onZoomChange, }: PreviewEditorSidebarProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { ApiClient } from '@riverbankcms/api/request';
|
|
3
|
-
import type
|
|
3
|
+
import { type SurfaceId } from '@riverbankcms/surfaces';
|
|
4
4
|
type PreviewEditorUIProps = {
|
|
5
5
|
inMaintenanceMode?: boolean;
|
|
6
6
|
siteId?: string;
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { type ComponentProps, type ReactNode } from "react";
|
|
2
2
|
import { BlockApiProvider } from "@riverbankcms/blocks/client";
|
|
3
|
+
import type { ButtonPersonalityId } from "@riverbankcms/theme-core/buttons";
|
|
4
|
+
import type { PaletteOverrides, PaletteVariantId } from "@riverbankcms/theme-core/palette";
|
|
3
5
|
import type { MediaAssetIndexItem, OccurrenceContextData, Theme } from "@riverbankcms/blocks";
|
|
4
6
|
import type { ContentTypeSchema } from "@riverbankcms/content-model";
|
|
5
7
|
import type { SdkConfigForBlockPicker } from "@riverbankcms/editor-blocks";
|
|
@@ -31,6 +33,15 @@ export type PreviewShellProps = {
|
|
|
31
33
|
theme: Theme;
|
|
32
34
|
themeId?: string | null;
|
|
33
35
|
themeSelectionId?: string | null;
|
|
36
|
+
/**
|
|
37
|
+
* Persisted Style configurator selections (Phase C). Forwarded into the
|
|
38
|
+
* StyleConfigurator so reload renders the user's saved button personality
|
|
39
|
+
* + palette variant + sparse overrides instead of falling back to the
|
|
40
|
+
* site style defaults.
|
|
41
|
+
*/
|
|
42
|
+
themeSelectionButtonPersonalityId?: ButtonPersonalityId | null;
|
|
43
|
+
themeSelectionPaletteVariantId?: PaletteVariantId | null;
|
|
44
|
+
themeSelectionPaletteOverrides?: PaletteOverrides | null;
|
|
34
45
|
pageId: string | null;
|
|
35
46
|
routeId: string | null;
|
|
36
47
|
entryData?: PreviewContentEntryData | null;
|
|
@@ -52,7 +63,7 @@ export type PreviewShellProps = {
|
|
|
52
63
|
designEditorEligibility?: PreviewDesignEditorEligibility;
|
|
53
64
|
baseFetch?: BaseFetch;
|
|
54
65
|
};
|
|
55
|
-
export declare function PreviewShell({ children, apiBaseUrl, blockApiConfig, siteId, siteSlug, editableId, previewSession, previewToken, dashboardBaseUrl, surfaceId, theme, themeId, themeSelectionId, pageId, routeId, entryData, contentTypeSchema, referenceContentTypeKeys, draftContent, currentTemplate, initialStatus, initialBlocks, pageMetadata, isSiteLaunched, maintenanceModeEnabled, occurrenceContext, assistantPanel, sdkConfig, mediaAssets, supabaseUrl, useThemeScope, designEditorEligibility, baseFetch, }: PreviewShellProps): import("react/jsx-runtime").JSX.Element;
|
|
66
|
+
export declare function PreviewShell({ children, apiBaseUrl, blockApiConfig, siteId, siteSlug, editableId, previewSession, previewToken, dashboardBaseUrl, surfaceId, theme, themeId, themeSelectionId, themeSelectionButtonPersonalityId, themeSelectionPaletteVariantId, themeSelectionPaletteOverrides, pageId, routeId, entryData, contentTypeSchema, referenceContentTypeKeys, draftContent, currentTemplate, initialStatus, initialBlocks, pageMetadata, isSiteLaunched, maintenanceModeEnabled, occurrenceContext, assistantPanel, sdkConfig, mediaAssets, supabaseUrl, useThemeScope, designEditorEligibility, baseFetch, }: PreviewShellProps): import("react/jsx-runtime").JSX.Element;
|
|
56
67
|
export declare function defaultDesignEditorEligibility(input: Readonly<{
|
|
57
68
|
pageId: string | null;
|
|
58
69
|
entryData?: PreviewContentEntryData | null;
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { type ReactNode } from "react";
|
|
2
2
|
import { type MediaAssetIndexItem, type OccurrenceContextData, type Theme } from "@riverbankcms/blocks";
|
|
3
|
+
import type { ButtonPersonalityId } from "@riverbankcms/theme-core/buttons";
|
|
4
|
+
import type { PaletteOverrides, PaletteVariantId } from "@riverbankcms/theme-core/palette";
|
|
3
5
|
import type { ContentTypeSchema } from "@riverbankcms/content-model";
|
|
4
6
|
import type { ApiClient } from "@riverbankcms/api/request";
|
|
5
7
|
import type { SdkConfigForBlockPicker } from "@riverbankcms/editor-blocks";
|
|
@@ -22,6 +24,9 @@ export type PreviewShellLayoutProps = {
|
|
|
22
24
|
bearerToken?: string | null;
|
|
23
25
|
themeId?: string | null;
|
|
24
26
|
themeSelectionId?: string | null;
|
|
27
|
+
themeSelectionButtonPersonalityId?: ButtonPersonalityId | null;
|
|
28
|
+
themeSelectionPaletteVariantId?: PaletteVariantId | null;
|
|
29
|
+
themeSelectionPaletteOverrides?: PaletteOverrides | null;
|
|
25
30
|
supabaseUrl?: string;
|
|
26
31
|
isSiteLaunched: boolean;
|
|
27
32
|
maintenanceModeEnabled: boolean;
|
|
@@ -32,4 +37,4 @@ export type PreviewShellLayoutProps = {
|
|
|
32
37
|
useThemeScope?: boolean;
|
|
33
38
|
siteStyleAccess?: SiteStyleAccess;
|
|
34
39
|
};
|
|
35
|
-
export declare function PreviewShellLayout({ children, theme, surfaceId, siteId, dashboardBaseUrl, pageId, entryData, contentTypeSchema, referenceContentTypeKeys, draftContent, currentTemplate, apiClient, bearerToken, themeId, themeSelectionId, supabaseUrl, isSiteLaunched, maintenanceModeEnabled, occurrenceContext, assistantPanel, sdkConfig, mediaAssets, useThemeScope, siteStyleAccess, }: PreviewShellLayoutProps): import("react/jsx-runtime").JSX.Element;
|
|
40
|
+
export declare function PreviewShellLayout({ children, theme, surfaceId, siteId, dashboardBaseUrl, pageId, entryData, contentTypeSchema, referenceContentTypeKeys, draftContent, currentTemplate, apiClient, bearerToken, themeId, themeSelectionId, themeSelectionButtonPersonalityId, themeSelectionPaletteVariantId, themeSelectionPaletteOverrides, supabaseUrl, isSiteLaunched, maintenanceModeEnabled, occurrenceContext, assistantPanel, sdkConfig, mediaAssets, useThemeScope, siteStyleAccess, }: PreviewShellLayoutProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { ApiClient } from '@riverbankcms/api/request';
|
|
2
|
+
import type { Theme } from '@riverbankcms/blocks';
|
|
3
|
+
import { type ButtonPersonalityId } from '@riverbankcms/theme-core/buttons';
|
|
4
|
+
import { type PaletteVariantId, type PaletteOverrides } from '@riverbankcms/theme-core/palette';
|
|
5
|
+
import { type VisibleSiteStyleAccess } from './siteStyleAccess';
|
|
6
|
+
export type StyleConfiguratorProps = Readonly<{
|
|
7
|
+
siteId: string;
|
|
8
|
+
apiClient: ApiClient;
|
|
9
|
+
theme?: Theme | null;
|
|
10
|
+
themeId?: string | null;
|
|
11
|
+
selectionId?: string | null;
|
|
12
|
+
/** Server-persisted Style configurator selections (Phase C). */
|
|
13
|
+
initialSelections: Readonly<{
|
|
14
|
+
buttonPersonalityId: ButtonPersonalityId | null;
|
|
15
|
+
paletteVariantId: PaletteVariantId | null;
|
|
16
|
+
paletteOverrides: PaletteOverrides | null;
|
|
17
|
+
}>;
|
|
18
|
+
siteStyleAccess: VisibleSiteStyleAccess;
|
|
19
|
+
}>;
|
|
20
|
+
export declare function StyleConfigurator({ siteId, apiClient, theme, themeId, selectionId, initialSelections, siteStyleAccess, }: StyleConfiguratorProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pure state module for the Style configurator. Per-action function style so
|
|
3
|
+
* the picker rows, apply flow, and concurrency layer can call into a small,
|
|
4
|
+
* exhaustive set of named transitions instead of a centralised reducer
|
|
5
|
+
* switch.
|
|
6
|
+
*
|
|
7
|
+
* The configurator surfaces three site-level decisions (site style, button
|
|
8
|
+
* personality, palette variant) plus optional sparse palette overrides. The
|
|
9
|
+
* "base" snapshot is what the server has persisted; "previewed" is what the
|
|
10
|
+
* preview pane is currently rendering. They diverge while the user is
|
|
11
|
+
* picking and converge on apply-success.
|
|
12
|
+
*/
|
|
13
|
+
import type { ButtonPersonalityId } from '@riverbankcms/theme-core/buttons';
|
|
14
|
+
import type { PaletteOverrides, PaletteVariantId } from '@riverbankcms/theme-core/palette';
|
|
15
|
+
import type { CompatibilityWarning, SiteStyleId } from '@riverbankcms/theme-core/site-styles/previewCompiler';
|
|
16
|
+
export type StyleConfiguratorSaveStatus = Readonly<{
|
|
17
|
+
kind: 'idle';
|
|
18
|
+
}> | Readonly<{
|
|
19
|
+
kind: 'saving';
|
|
20
|
+
}> | Readonly<{
|
|
21
|
+
kind: 'saved';
|
|
22
|
+
}> | Readonly<{
|
|
23
|
+
kind: 'failed';
|
|
24
|
+
message: string;
|
|
25
|
+
}>;
|
|
26
|
+
export type StyleConfiguratorExpandedRow = 'style' | 'buttons' | 'palette' | 'colours' | null;
|
|
27
|
+
/**
|
|
28
|
+
* Configurator-level notices that aren't compiler compatibility warnings.
|
|
29
|
+
* Kept separate from `CompatibilityWarning` (which comes from
|
|
30
|
+
* `compileSiteThemeFromSelections`) so the layers stay clean: warnings are
|
|
31
|
+
* compiler-emitted, notices are UI-level decisions the configurator makes.
|
|
32
|
+
*/
|
|
33
|
+
export type StyleConfiguratorNotice = Readonly<{
|
|
34
|
+
kind: 'overrides-cleared-by-site-style-switch';
|
|
35
|
+
}>;
|
|
36
|
+
export type SelectionSnapshot = Readonly<{
|
|
37
|
+
siteStyleId: SiteStyleId;
|
|
38
|
+
buttonPersonalityId: ButtonPersonalityId;
|
|
39
|
+
paletteVariantId: PaletteVariantId;
|
|
40
|
+
paletteOverrides: PaletteOverrides | null;
|
|
41
|
+
}>;
|
|
42
|
+
export type StyleConfiguratorState = Readonly<{
|
|
43
|
+
/**
|
|
44
|
+
* Last persisted server snapshot. Updated on apply-success (and on
|
|
45
|
+
* external rebases via `syncStyleConfiguratorState`).
|
|
46
|
+
*/
|
|
47
|
+
base: SelectionSnapshot;
|
|
48
|
+
/**
|
|
49
|
+
* Currently rendered selection. Diverges from `base` while the user is
|
|
50
|
+
* previewing changes. Identical to `base` after apply-success.
|
|
51
|
+
*/
|
|
52
|
+
previewed: SelectionSnapshot;
|
|
53
|
+
saveStatus: StyleConfiguratorSaveStatus;
|
|
54
|
+
warnings: ReadonlyArray<CompatibilityWarning>;
|
|
55
|
+
notices: ReadonlyArray<StyleConfiguratorNotice>;
|
|
56
|
+
expandedRow: StyleConfiguratorExpandedRow;
|
|
57
|
+
}>;
|
|
58
|
+
export declare function createStyleConfiguratorState(base: SelectionSnapshot): StyleConfiguratorState;
|
|
59
|
+
/**
|
|
60
|
+
* True iff the user has previewed a change that hasn't been applied yet.
|
|
61
|
+
* Drives the "Apply" / "Cancel" footer visibility and the live-preview
|
|
62
|
+
* `setOverrideTheme` call.
|
|
63
|
+
*/
|
|
64
|
+
export declare function isPreviewingChange(state: StyleConfiguratorState): boolean;
|
|
65
|
+
export declare function previewSiteStyle(state: StyleConfiguratorState, siteStyleId: SiteStyleId): StyleConfiguratorState;
|
|
66
|
+
export declare function previewButtonPersonality(state: StyleConfiguratorState, buttonPersonalityId: ButtonPersonalityId): StyleConfiguratorState;
|
|
67
|
+
export declare function previewPaletteVariant(state: StyleConfiguratorState, paletteVariantId: PaletteVariantId): StyleConfiguratorState;
|
|
68
|
+
export declare function setPaletteOverrides(state: StyleConfiguratorState, paletteOverrides: PaletteOverrides | null): StyleConfiguratorState;
|
|
69
|
+
/**
|
|
70
|
+
* Records the post-compile resolved selection + any compatibility warnings.
|
|
71
|
+
* Used after `compileSiteThemeFromSelections` runs against a new site style:
|
|
72
|
+
* the resolver may have auto-picked a different personality / palette if the
|
|
73
|
+
* user's previous selections weren't compatible with the new style.
|
|
74
|
+
*
|
|
75
|
+
* When `clearOverrides` is true, sparse `paletteOverrides` from the previous
|
|
76
|
+
* site style are dropped — the new variant has different colour-role meanings
|
|
77
|
+
* (e.g. the previous `primary` override doesn't apply to the new variant's
|
|
78
|
+
* `primary` if the new style has a fundamentally different palette voice).
|
|
79
|
+
* A `'overrides-cleared-by-site-style-switch'` notice is appended so the UI
|
|
80
|
+
* can surface a "we cleared your colour overrides" line.
|
|
81
|
+
*/
|
|
82
|
+
export declare function applyResolvedSelections(state: StyleConfiguratorState, input: Readonly<{
|
|
83
|
+
resolved: Pick<SelectionSnapshot, 'buttonPersonalityId' | 'paletteVariantId'>;
|
|
84
|
+
warnings: ReadonlyArray<CompatibilityWarning>;
|
|
85
|
+
clearOverrides?: boolean;
|
|
86
|
+
}>): StyleConfiguratorState;
|
|
87
|
+
export declare function cancelPreview(state: StyleConfiguratorState): StyleConfiguratorState;
|
|
88
|
+
export declare function markApplySaving(state: StyleConfiguratorState): StyleConfiguratorState;
|
|
89
|
+
export declare function markApplySaved(state: StyleConfiguratorState, persisted: SelectionSnapshot): StyleConfiguratorState;
|
|
90
|
+
export declare function markApplyFailed(state: StyleConfiguratorState, message: string): StyleConfiguratorState;
|
|
91
|
+
export declare function toggleRow(state: StyleConfiguratorState, row: StyleConfiguratorExpandedRow): StyleConfiguratorState;
|
|
92
|
+
export declare function dismissWarnings(state: StyleConfiguratorState): StyleConfiguratorState;
|
|
93
|
+
export declare function dismissNotices(state: StyleConfiguratorState): StyleConfiguratorState;
|
|
94
|
+
/**
|
|
95
|
+
* Reconciles local state with a fresh server snapshot — used after
|
|
96
|
+
* `router.refresh()` lands new theme data, or when an external write
|
|
97
|
+
* changes the persisted selection out-of-band.
|
|
98
|
+
*/
|
|
99
|
+
export declare function syncStyleConfiguratorState(state: StyleConfiguratorState, base: SelectionSnapshot): StyleConfiguratorState;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type SurfaceId } from "@riverbankcms/surfaces";
|
|
2
|
+
export declare const PREVIEW_CHROME_THEME_CLASS_NAME = "builder-dashboard-chrome-theme";
|
|
3
|
+
export declare const PREVIEW_CHROME_PORTAL_CLASS_NAME = "builder-editor-chrome";
|
|
4
|
+
export type PreviewChromeSurface = Readonly<{
|
|
5
|
+
surfaceClassName: string | null;
|
|
6
|
+
dataSurface: string | null;
|
|
7
|
+
}>;
|
|
8
|
+
export declare function resolvePreviewChromeSurface(surfaceId?: SurfaceId | null): PreviewChromeSurface;
|
|
9
|
+
export declare function getPreviewChromeSurfaceDataProps(surface: PreviewChromeSurface): Readonly<Record<string, string>>;
|
|
10
|
+
export declare function applyPreviewChromeSurfaceToElement(element: HTMLElement, surface: PreviewChromeSurface, options?: Readonly<{
|
|
11
|
+
includePortalClass?: boolean;
|
|
12
|
+
}>): void;
|