@ohhwells/bridge 0.1.130 → 0.1.131
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 +17739 -16811
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +35 -2
- package/dist/index.d.ts +35 -2
- package/dist/index.js +17700 -16775
- package/dist/index.js.map +1 -1
- package/dist/styles.css +9 -0
- package/package.json +3 -2
package/dist/index.d.cts
CHANGED
|
@@ -20,7 +20,7 @@ declare function OhhwellsBridge(): react_jsx_runtime.JSX.Element;
|
|
|
20
20
|
*/
|
|
21
21
|
declare const AI_TREE_SCHEMA_VERSIONS: readonly [1];
|
|
22
22
|
type SectionScaffold = 'stacked' | 'split' | 'overlay';
|
|
23
|
-
type AiBlockType = 'text' | 'button' | 'media' | 'media-list' | 'rating' | 'divider' | 'input' | 'section-header' | 'button-row' | 'card' | 'collection' | 'accordion' | 'media-strip' | 'form' | 'embed' | 'schedule-widget' | 'group' | 'link-list' | 'hours' | 'logo' | 'social-row' | 'video';
|
|
23
|
+
type AiBlockType = 'text' | 'button' | 'media' | 'media-list' | 'rating' | 'divider' | 'input' | 'section-header' | 'button-row' | 'card' | 'collection' | 'accordion' | 'media-strip' | 'form' | 'embed' | 'schedule-widget' | 'group' | 'link-list' | 'hours' | 'logo' | 'social-row' | 'video' | 'carousel';
|
|
24
24
|
interface AiBlockNode {
|
|
25
25
|
type: AiBlockType;
|
|
26
26
|
span: number;
|
|
@@ -58,6 +58,39 @@ interface AiSectionSettings {
|
|
|
58
58
|
/** Vertical distribution of column content (stacked/split scaffolds). */
|
|
59
59
|
textDistribution?: 'top' | 'center' | 'space-between';
|
|
60
60
|
}
|
|
61
|
+
/**
|
|
62
|
+
* Next slide a fade carousel should fall back to when the one on screen failed to load (OHH-796),
|
|
63
|
+
* or `null` when there is nothing useful to move to.
|
|
64
|
+
*
|
|
65
|
+
* Pulled out of the effect that drives it so the broken-image fallback is a rule that can be
|
|
66
|
+
* asserted directly, rather than only reachable by making a real image 404 in a browser. Scans
|
|
67
|
+
* forward and wraps, so a failure lands on the nearest following slide that still works.
|
|
68
|
+
*
|
|
69
|
+
* `null` covers both no-op cases: the current slide is fine, or every slide has failed (in which
|
|
70
|
+
* case the carousel hides its controls and renders nothing rather than cycling through blanks).
|
|
71
|
+
*/
|
|
72
|
+
declare function nextViableSlide(index: number, failed: ReadonlySet<number>, count: number): number | null;
|
|
73
|
+
/**
|
|
74
|
+
* Slide indexes a fade carousel can actually show, in order (OHH-796) — every slide whose image has
|
|
75
|
+
* not failed to load.
|
|
76
|
+
*
|
|
77
|
+
* The controls are built from this rather than from the raw child count. A dot per child means a
|
|
78
|
+
* visitor can click one that only bounces them straight back out (`nextViableSlide` above corrects
|
|
79
|
+
* a dead current slide the moment it becomes current), and the ticket's all-failed fallback row is
|
|
80
|
+
* "render the scrim/background only" — which means no chrome either, not chrome over a blank.
|
|
81
|
+
*/
|
|
82
|
+
declare function viableSlides(count: number, failed: ReadonlySet<number>): number[];
|
|
83
|
+
/**
|
|
84
|
+
* Where a chevron, swipe or arrow key should land from `index`, skipping slides that failed to load
|
|
85
|
+
* (OHH-796). Returns `index` unchanged when there is nowhere to go — a clamped end under
|
|
86
|
+
* `loop: false`, or no other viable slide at all.
|
|
87
|
+
*
|
|
88
|
+
* `index + 1` stops being good enough once a slide can die: stepping *backwards* onto a dead slide
|
|
89
|
+
* is immediately corrected *forwards* by `nextViableSlide`, so "previous" past a failure would walk
|
|
90
|
+
* the visitor the wrong way. Scanning in the direction of travel keeps one press equal to one slide
|
|
91
|
+
* as the visitor counts them.
|
|
92
|
+
*/
|
|
93
|
+
declare function stepViableSlide(index: number, failed: ReadonlySet<number>, count: number, dir: 1 | -1, loop: boolean): number;
|
|
61
94
|
interface AiLayoutTree {
|
|
62
95
|
schemaVersion: number;
|
|
63
96
|
type: 'section';
|
|
@@ -692,4 +725,4 @@ declare function useOhwCarousel(key: string, initial: CarouselSlide[]): {
|
|
|
692
725
|
bind: Record<string, string>;
|
|
693
726
|
};
|
|
694
727
|
|
|
695
|
-
export { AI_DEFAULT_BRAND, AI_FOOTER_KEY, AI_TREE_SCHEMA_VERSIONS, AI_TREE_TOKENS, type AiBlockNode, type AiBrandKit, type AiFooterBottomBar, type AiFooterColumn, type AiFooterLayoutTree, AiFooterRenderer, type AiFooterRendererProps, type AiLayoutTree, AiTreeRenderer, type AiTreeRendererProps, type CarouselSlide, CustomToolbar, CustomToolbarButton, CustomToolbarDivider, DragHandle, DropIndicator, type DropIndicatorProps, DropdownMenu, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuSeparator, DropdownMenuTrigger, EmptySection, type EmptySectionProps, FOOTER_COLUMN_BLOCKS, FOOTER_COLUMN_SPANS, FOOTER_SOCIAL_PLATFORMS, ItemActionToolbar, type ItemActionToolbarProps, ItemInteractionLayer, type ItemInteractionLayerProps, type ItemInteractionState, LinkEditorPanel, type LinkModalMode, type LinkModalProps, type LinkPage, LinkPopover, type LinkSection, OhhwellsBridge, SchedulingWidget, type SectionScaffold, type SiteLegalLinks, Toggle, ToggleGroup, ToggleGroupItem, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, addFooterLinkColumn, appendFooterSocial, buildDefaultFooterTree, buildTarget, dropIndicatorVariants, ensureFooterTree, filterAvailablePages, getEditModeInitialState, insertFooterHours, isEditSessionActive, isRenderableFooterTree, isRenderableTree, isValidUrl, parseAiFooterState, parseTarget, removeFooterBlock, resolveFooterCopyright, serializeAiFooterState, toggleVariants, useOhwCarousel, validateUrlInput };
|
|
728
|
+
export { AI_DEFAULT_BRAND, AI_FOOTER_KEY, AI_TREE_SCHEMA_VERSIONS, AI_TREE_TOKENS, type AiBlockNode, type AiBrandKit, type AiFooterBottomBar, type AiFooterColumn, type AiFooterLayoutTree, AiFooterRenderer, type AiFooterRendererProps, type AiLayoutTree, AiTreeRenderer, type AiTreeRendererProps, type CarouselSlide, CustomToolbar, CustomToolbarButton, CustomToolbarDivider, DragHandle, DropIndicator, type DropIndicatorProps, DropdownMenu, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuSeparator, DropdownMenuTrigger, EmptySection, type EmptySectionProps, FOOTER_COLUMN_BLOCKS, FOOTER_COLUMN_SPANS, FOOTER_SOCIAL_PLATFORMS, ItemActionToolbar, type ItemActionToolbarProps, ItemInteractionLayer, type ItemInteractionLayerProps, type ItemInteractionState, LinkEditorPanel, type LinkModalMode, type LinkModalProps, type LinkPage, LinkPopover, type LinkSection, OhhwellsBridge, SchedulingWidget, type SectionScaffold, type SiteLegalLinks, Toggle, ToggleGroup, ToggleGroupItem, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, addFooterLinkColumn, appendFooterSocial, buildDefaultFooterTree, buildTarget, dropIndicatorVariants, ensureFooterTree, filterAvailablePages, getEditModeInitialState, insertFooterHours, isEditSessionActive, isRenderableFooterTree, isRenderableTree, isValidUrl, nextViableSlide, parseAiFooterState, parseTarget, removeFooterBlock, resolveFooterCopyright, serializeAiFooterState, stepViableSlide, toggleVariants, useOhwCarousel, validateUrlInput, viableSlides };
|
package/dist/index.d.ts
CHANGED
|
@@ -20,7 +20,7 @@ declare function OhhwellsBridge(): react_jsx_runtime.JSX.Element;
|
|
|
20
20
|
*/
|
|
21
21
|
declare const AI_TREE_SCHEMA_VERSIONS: readonly [1];
|
|
22
22
|
type SectionScaffold = 'stacked' | 'split' | 'overlay';
|
|
23
|
-
type AiBlockType = 'text' | 'button' | 'media' | 'media-list' | 'rating' | 'divider' | 'input' | 'section-header' | 'button-row' | 'card' | 'collection' | 'accordion' | 'media-strip' | 'form' | 'embed' | 'schedule-widget' | 'group' | 'link-list' | 'hours' | 'logo' | 'social-row' | 'video';
|
|
23
|
+
type AiBlockType = 'text' | 'button' | 'media' | 'media-list' | 'rating' | 'divider' | 'input' | 'section-header' | 'button-row' | 'card' | 'collection' | 'accordion' | 'media-strip' | 'form' | 'embed' | 'schedule-widget' | 'group' | 'link-list' | 'hours' | 'logo' | 'social-row' | 'video' | 'carousel';
|
|
24
24
|
interface AiBlockNode {
|
|
25
25
|
type: AiBlockType;
|
|
26
26
|
span: number;
|
|
@@ -58,6 +58,39 @@ interface AiSectionSettings {
|
|
|
58
58
|
/** Vertical distribution of column content (stacked/split scaffolds). */
|
|
59
59
|
textDistribution?: 'top' | 'center' | 'space-between';
|
|
60
60
|
}
|
|
61
|
+
/**
|
|
62
|
+
* Next slide a fade carousel should fall back to when the one on screen failed to load (OHH-796),
|
|
63
|
+
* or `null` when there is nothing useful to move to.
|
|
64
|
+
*
|
|
65
|
+
* Pulled out of the effect that drives it so the broken-image fallback is a rule that can be
|
|
66
|
+
* asserted directly, rather than only reachable by making a real image 404 in a browser. Scans
|
|
67
|
+
* forward and wraps, so a failure lands on the nearest following slide that still works.
|
|
68
|
+
*
|
|
69
|
+
* `null` covers both no-op cases: the current slide is fine, or every slide has failed (in which
|
|
70
|
+
* case the carousel hides its controls and renders nothing rather than cycling through blanks).
|
|
71
|
+
*/
|
|
72
|
+
declare function nextViableSlide(index: number, failed: ReadonlySet<number>, count: number): number | null;
|
|
73
|
+
/**
|
|
74
|
+
* Slide indexes a fade carousel can actually show, in order (OHH-796) — every slide whose image has
|
|
75
|
+
* not failed to load.
|
|
76
|
+
*
|
|
77
|
+
* The controls are built from this rather than from the raw child count. A dot per child means a
|
|
78
|
+
* visitor can click one that only bounces them straight back out (`nextViableSlide` above corrects
|
|
79
|
+
* a dead current slide the moment it becomes current), and the ticket's all-failed fallback row is
|
|
80
|
+
* "render the scrim/background only" — which means no chrome either, not chrome over a blank.
|
|
81
|
+
*/
|
|
82
|
+
declare function viableSlides(count: number, failed: ReadonlySet<number>): number[];
|
|
83
|
+
/**
|
|
84
|
+
* Where a chevron, swipe or arrow key should land from `index`, skipping slides that failed to load
|
|
85
|
+
* (OHH-796). Returns `index` unchanged when there is nowhere to go — a clamped end under
|
|
86
|
+
* `loop: false`, or no other viable slide at all.
|
|
87
|
+
*
|
|
88
|
+
* `index + 1` stops being good enough once a slide can die: stepping *backwards* onto a dead slide
|
|
89
|
+
* is immediately corrected *forwards* by `nextViableSlide`, so "previous" past a failure would walk
|
|
90
|
+
* the visitor the wrong way. Scanning in the direction of travel keeps one press equal to one slide
|
|
91
|
+
* as the visitor counts them.
|
|
92
|
+
*/
|
|
93
|
+
declare function stepViableSlide(index: number, failed: ReadonlySet<number>, count: number, dir: 1 | -1, loop: boolean): number;
|
|
61
94
|
interface AiLayoutTree {
|
|
62
95
|
schemaVersion: number;
|
|
63
96
|
type: 'section';
|
|
@@ -692,4 +725,4 @@ declare function useOhwCarousel(key: string, initial: CarouselSlide[]): {
|
|
|
692
725
|
bind: Record<string, string>;
|
|
693
726
|
};
|
|
694
727
|
|
|
695
|
-
export { AI_DEFAULT_BRAND, AI_FOOTER_KEY, AI_TREE_SCHEMA_VERSIONS, AI_TREE_TOKENS, type AiBlockNode, type AiBrandKit, type AiFooterBottomBar, type AiFooterColumn, type AiFooterLayoutTree, AiFooterRenderer, type AiFooterRendererProps, type AiLayoutTree, AiTreeRenderer, type AiTreeRendererProps, type CarouselSlide, CustomToolbar, CustomToolbarButton, CustomToolbarDivider, DragHandle, DropIndicator, type DropIndicatorProps, DropdownMenu, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuSeparator, DropdownMenuTrigger, EmptySection, type EmptySectionProps, FOOTER_COLUMN_BLOCKS, FOOTER_COLUMN_SPANS, FOOTER_SOCIAL_PLATFORMS, ItemActionToolbar, type ItemActionToolbarProps, ItemInteractionLayer, type ItemInteractionLayerProps, type ItemInteractionState, LinkEditorPanel, type LinkModalMode, type LinkModalProps, type LinkPage, LinkPopover, type LinkSection, OhhwellsBridge, SchedulingWidget, type SectionScaffold, type SiteLegalLinks, Toggle, ToggleGroup, ToggleGroupItem, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, addFooterLinkColumn, appendFooterSocial, buildDefaultFooterTree, buildTarget, dropIndicatorVariants, ensureFooterTree, filterAvailablePages, getEditModeInitialState, insertFooterHours, isEditSessionActive, isRenderableFooterTree, isRenderableTree, isValidUrl, parseAiFooterState, parseTarget, removeFooterBlock, resolveFooterCopyright, serializeAiFooterState, toggleVariants, useOhwCarousel, validateUrlInput };
|
|
728
|
+
export { AI_DEFAULT_BRAND, AI_FOOTER_KEY, AI_TREE_SCHEMA_VERSIONS, AI_TREE_TOKENS, type AiBlockNode, type AiBrandKit, type AiFooterBottomBar, type AiFooterColumn, type AiFooterLayoutTree, AiFooterRenderer, type AiFooterRendererProps, type AiLayoutTree, AiTreeRenderer, type AiTreeRendererProps, type CarouselSlide, CustomToolbar, CustomToolbarButton, CustomToolbarDivider, DragHandle, DropIndicator, type DropIndicatorProps, DropdownMenu, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuSeparator, DropdownMenuTrigger, EmptySection, type EmptySectionProps, FOOTER_COLUMN_BLOCKS, FOOTER_COLUMN_SPANS, FOOTER_SOCIAL_PLATFORMS, ItemActionToolbar, type ItemActionToolbarProps, ItemInteractionLayer, type ItemInteractionLayerProps, type ItemInteractionState, LinkEditorPanel, type LinkModalMode, type LinkModalProps, type LinkPage, LinkPopover, type LinkSection, OhhwellsBridge, SchedulingWidget, type SectionScaffold, type SiteLegalLinks, Toggle, ToggleGroup, ToggleGroupItem, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, addFooterLinkColumn, appendFooterSocial, buildDefaultFooterTree, buildTarget, dropIndicatorVariants, ensureFooterTree, filterAvailablePages, getEditModeInitialState, insertFooterHours, isEditSessionActive, isRenderableFooterTree, isRenderableTree, isValidUrl, nextViableSlide, parseAiFooterState, parseTarget, removeFooterBlock, resolveFooterCopyright, serializeAiFooterState, stepViableSlide, toggleVariants, useOhwCarousel, validateUrlInput, viableSlides };
|