@ohhwells/bridge 0.1.117 → 0.1.119-next.331

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.d.cts CHANGED
@@ -20,7 +20,14 @@ 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' | 'form' | 'embed' | 'schedule-widget' | 'group';
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';
24
+ /** media-strip's `items[]` entry shape (rn-mobile-backend's `itemFields` for that block). */
25
+ interface MediaStripItem {
26
+ assetId: string;
27
+ alt: string;
28
+ href?: string;
29
+ linkTarget?: 'new-tab' | 'same-tab';
30
+ }
24
31
  interface AiBlockNode {
25
32
  type: AiBlockType;
26
33
  span: number;
@@ -28,10 +35,12 @@ interface AiBlockNode {
28
35
  align?: 'left' | 'center' | 'right';
29
36
  slots?: Record<string, unknown>;
30
37
  children?: AiBlockNode[];
38
+ /** Shape is per-block-type, defined by the backend's `BlockDef.itemFields` (accordion's
39
+ * question/answer, media-strip's assetId/alt/href/linkTarget). */
31
40
  items?: Array<{
32
41
  question: string;
33
42
  answer: string;
34
- }>;
43
+ } | MediaStripItem>;
35
44
  animation?: {
36
45
  effect: 'fade-in' | 'fade-in-up' | 'slide-in-left' | 'slide-in-right' | 'zoom-in';
37
46
  trigger: 'on-scroll' | 'on-load' | 'on-hover';
@@ -63,6 +72,21 @@ interface AiLayoutTree {
63
72
  align?: 'top' | 'center' | 'bottom' | 'stretch';
64
73
  }>;
65
74
  }
75
+ declare const BUTTON_FILL_TOKENS: readonly ["dark", "primary", "accent", "light"];
76
+ declare const BUTTON_STYLES: readonly ["solid", "outline", "ghost"];
77
+ declare const BUTTON_RADII: readonly ["square", "rounded", "pill"];
78
+ declare const BUTTON_SIZES: readonly ["s", "m", "l"];
79
+ interface ButtonStyle {
80
+ fill: (typeof BUTTON_FILL_TOKENS)[number];
81
+ textColor: (typeof BUTTON_FILL_TOKENS)[number];
82
+ style: (typeof BUTTON_STYLES)[number];
83
+ radius: (typeof BUTTON_RADII)[number];
84
+ size: (typeof BUTTON_SIZES)[number];
85
+ }
86
+ interface ButtonStyles {
87
+ primary: ButtonStyle;
88
+ secondary: ButtonStyle;
89
+ }
66
90
  /** One uploaded weight file for a custom font family. */
67
91
  interface AiCustomFontWeight {
68
92
  weight: number;
@@ -96,7 +120,20 @@ interface AiBrandKit {
96
120
  heading: string;
97
121
  body: string;
98
122
  };
123
+ /** Absent on a kit saved before OHH-791 — renderer falls back to today's hardcoded button look. */
124
+ buttons?: ButtonStyles;
99
125
  customFonts?: AiCustomFont[];
126
+ /** Which parts the user actually set. Absent (kits saved before this field) = both, as ever;
127
+ * an unset part is a carried-over template snapshot and must not be written onto the page. */
128
+ touched?: {
129
+ palette?: boolean;
130
+ fonts?: boolean;
131
+ /** Per variant, the button fields the user set (fill, textColor, style, radius, size). */
132
+ buttons?: {
133
+ primary?: (keyof ButtonStyle)[];
134
+ secondary?: (keyof ButtonStyle)[];
135
+ };
136
+ };
100
137
  }
101
138
  /**
102
139
  * Shape, padding and typography measured off a host-template CTA, so generated buttons read as the
@@ -431,9 +468,15 @@ type ItemInteractionLayerProps = {
431
468
  chromeGap?: number;
432
469
  /** Toolbar alignment over the element; forms hang theirs on the left edge (OHH-642). */
433
470
  toolbarAlign?: 'center' | 'left';
471
+ /**
472
+ * Parent-scroll hide. `applyToolbarPos` sets `display:none` on this node when the
473
+ * selection leaves the canvas; React will not clear that on the next selection unless
474
+ * we own `display` here (same node, same `display:block` in the prev VDOM).
475
+ */
476
+ hidden?: boolean;
434
477
  className?: string;
435
478
  };
436
- declare function ItemInteractionLayer({ rect, state, elRef, toolbar, toolbarBelowRect, toolbarBelowEl, showHandle, dragDisabled, dragHandleLabel, onDragHandleDragStart, onDragHandleDragEnd, onItemPointerDown, onItemClick, itemDragSurface, chromeGap, toolbarAlign, className, }: ItemInteractionLayerProps): react_jsx_runtime.JSX.Element | null;
479
+ declare function ItemInteractionLayer({ rect, state, elRef, toolbar, toolbarBelowRect, toolbarBelowEl, showHandle, dragDisabled, dragHandleLabel, onDragHandleDragStart, onDragHandleDragEnd, onItemPointerDown, onItemClick, itemDragSurface, chromeGap, toolbarAlign, hidden, className, }: ItemInteractionLayerProps): react_jsx_runtime.JSX.Element | null;
437
480
 
438
481
  declare function DropdownMenu({ ...props }: React.ComponentProps<typeof DropdownMenu$1.Root>): react_jsx_runtime.JSX.Element;
439
482
  /**
@@ -469,6 +512,16 @@ declare function TooltipContent({ className, sideOffset, side, children, hideArr
469
512
  hideArrow?: boolean;
470
513
  }): react_jsx_runtime.JSX.Element;
471
514
 
515
+ interface EmptySectionProps {
516
+ title: string;
517
+ homeHref?: string;
518
+ /** data-ohw-key values for the editable text nodes — omit a key to leave that node non-editable. */
519
+ eyebrowKey?: string;
520
+ titleKey?: string;
521
+ subtitleKey?: string;
522
+ }
523
+ declare function EmptySection({ title, homeHref, eyebrowKey, titleKey, subtitleKey }: EmptySectionProps): react_jsx_runtime.JSX.Element;
524
+
472
525
  declare function isEditSessionActive(): boolean;
473
526
 
474
527
  type CarouselSlide = {
@@ -492,4 +545,4 @@ declare function useOhwCarousel(key: string, initial: CarouselSlide[]): {
492
545
  bind: Record<string, string>;
493
546
  };
494
547
 
495
- export { AI_DEFAULT_BRAND, AI_TREE_SCHEMA_VERSIONS, AI_TREE_TOKENS, type AiBlockNode, type AiBrandKit, type AiLayoutTree, AiTreeRenderer, type AiTreeRendererProps, type CarouselSlide, CustomToolbar, CustomToolbarButton, CustomToolbarDivider, DragHandle, DropIndicator, type DropIndicatorProps, DropdownMenu, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuSeparator, DropdownMenuTrigger, ItemActionToolbar, type ItemActionToolbarProps, ItemInteractionLayer, type ItemInteractionLayerProps, type ItemInteractionState, LinkEditorPanel, type LinkModalMode, type LinkModalProps, type LinkPage, LinkPopover, type LinkSection, OhhwellsBridge, SchedulingWidget, type SectionScaffold, Toggle, ToggleGroup, ToggleGroupItem, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, buildTarget, dropIndicatorVariants, filterAvailablePages, getEditModeInitialState, isEditSessionActive, isRenderableTree, isValidUrl, parseTarget, toggleVariants, useOhwCarousel, validateUrlInput };
548
+ export { AI_DEFAULT_BRAND, AI_TREE_SCHEMA_VERSIONS, AI_TREE_TOKENS, type AiBlockNode, type AiBrandKit, type AiLayoutTree, AiTreeRenderer, type AiTreeRendererProps, type CarouselSlide, CustomToolbar, CustomToolbarButton, CustomToolbarDivider, DragHandle, DropIndicator, type DropIndicatorProps, DropdownMenu, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuSeparator, DropdownMenuTrigger, EmptySection, type EmptySectionProps, ItemActionToolbar, type ItemActionToolbarProps, ItemInteractionLayer, type ItemInteractionLayerProps, type ItemInteractionState, LinkEditorPanel, type LinkModalMode, type LinkModalProps, type LinkPage, LinkPopover, type LinkSection, OhhwellsBridge, SchedulingWidget, type SectionScaffold, Toggle, ToggleGroup, ToggleGroupItem, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, buildTarget, dropIndicatorVariants, filterAvailablePages, getEditModeInitialState, isEditSessionActive, isRenderableTree, isValidUrl, parseTarget, toggleVariants, useOhwCarousel, validateUrlInput };
package/dist/index.d.ts CHANGED
@@ -20,7 +20,14 @@ 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' | 'form' | 'embed' | 'schedule-widget' | 'group';
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';
24
+ /** media-strip's `items[]` entry shape (rn-mobile-backend's `itemFields` for that block). */
25
+ interface MediaStripItem {
26
+ assetId: string;
27
+ alt: string;
28
+ href?: string;
29
+ linkTarget?: 'new-tab' | 'same-tab';
30
+ }
24
31
  interface AiBlockNode {
25
32
  type: AiBlockType;
26
33
  span: number;
@@ -28,10 +35,12 @@ interface AiBlockNode {
28
35
  align?: 'left' | 'center' | 'right';
29
36
  slots?: Record<string, unknown>;
30
37
  children?: AiBlockNode[];
38
+ /** Shape is per-block-type, defined by the backend's `BlockDef.itemFields` (accordion's
39
+ * question/answer, media-strip's assetId/alt/href/linkTarget). */
31
40
  items?: Array<{
32
41
  question: string;
33
42
  answer: string;
34
- }>;
43
+ } | MediaStripItem>;
35
44
  animation?: {
36
45
  effect: 'fade-in' | 'fade-in-up' | 'slide-in-left' | 'slide-in-right' | 'zoom-in';
37
46
  trigger: 'on-scroll' | 'on-load' | 'on-hover';
@@ -63,6 +72,21 @@ interface AiLayoutTree {
63
72
  align?: 'top' | 'center' | 'bottom' | 'stretch';
64
73
  }>;
65
74
  }
75
+ declare const BUTTON_FILL_TOKENS: readonly ["dark", "primary", "accent", "light"];
76
+ declare const BUTTON_STYLES: readonly ["solid", "outline", "ghost"];
77
+ declare const BUTTON_RADII: readonly ["square", "rounded", "pill"];
78
+ declare const BUTTON_SIZES: readonly ["s", "m", "l"];
79
+ interface ButtonStyle {
80
+ fill: (typeof BUTTON_FILL_TOKENS)[number];
81
+ textColor: (typeof BUTTON_FILL_TOKENS)[number];
82
+ style: (typeof BUTTON_STYLES)[number];
83
+ radius: (typeof BUTTON_RADII)[number];
84
+ size: (typeof BUTTON_SIZES)[number];
85
+ }
86
+ interface ButtonStyles {
87
+ primary: ButtonStyle;
88
+ secondary: ButtonStyle;
89
+ }
66
90
  /** One uploaded weight file for a custom font family. */
67
91
  interface AiCustomFontWeight {
68
92
  weight: number;
@@ -96,7 +120,20 @@ interface AiBrandKit {
96
120
  heading: string;
97
121
  body: string;
98
122
  };
123
+ /** Absent on a kit saved before OHH-791 — renderer falls back to today's hardcoded button look. */
124
+ buttons?: ButtonStyles;
99
125
  customFonts?: AiCustomFont[];
126
+ /** Which parts the user actually set. Absent (kits saved before this field) = both, as ever;
127
+ * an unset part is a carried-over template snapshot and must not be written onto the page. */
128
+ touched?: {
129
+ palette?: boolean;
130
+ fonts?: boolean;
131
+ /** Per variant, the button fields the user set (fill, textColor, style, radius, size). */
132
+ buttons?: {
133
+ primary?: (keyof ButtonStyle)[];
134
+ secondary?: (keyof ButtonStyle)[];
135
+ };
136
+ };
100
137
  }
101
138
  /**
102
139
  * Shape, padding and typography measured off a host-template CTA, so generated buttons read as the
@@ -431,9 +468,15 @@ type ItemInteractionLayerProps = {
431
468
  chromeGap?: number;
432
469
  /** Toolbar alignment over the element; forms hang theirs on the left edge (OHH-642). */
433
470
  toolbarAlign?: 'center' | 'left';
471
+ /**
472
+ * Parent-scroll hide. `applyToolbarPos` sets `display:none` on this node when the
473
+ * selection leaves the canvas; React will not clear that on the next selection unless
474
+ * we own `display` here (same node, same `display:block` in the prev VDOM).
475
+ */
476
+ hidden?: boolean;
434
477
  className?: string;
435
478
  };
436
- declare function ItemInteractionLayer({ rect, state, elRef, toolbar, toolbarBelowRect, toolbarBelowEl, showHandle, dragDisabled, dragHandleLabel, onDragHandleDragStart, onDragHandleDragEnd, onItemPointerDown, onItemClick, itemDragSurface, chromeGap, toolbarAlign, className, }: ItemInteractionLayerProps): react_jsx_runtime.JSX.Element | null;
479
+ declare function ItemInteractionLayer({ rect, state, elRef, toolbar, toolbarBelowRect, toolbarBelowEl, showHandle, dragDisabled, dragHandleLabel, onDragHandleDragStart, onDragHandleDragEnd, onItemPointerDown, onItemClick, itemDragSurface, chromeGap, toolbarAlign, hidden, className, }: ItemInteractionLayerProps): react_jsx_runtime.JSX.Element | null;
437
480
 
438
481
  declare function DropdownMenu({ ...props }: React.ComponentProps<typeof DropdownMenu$1.Root>): react_jsx_runtime.JSX.Element;
439
482
  /**
@@ -469,6 +512,16 @@ declare function TooltipContent({ className, sideOffset, side, children, hideArr
469
512
  hideArrow?: boolean;
470
513
  }): react_jsx_runtime.JSX.Element;
471
514
 
515
+ interface EmptySectionProps {
516
+ title: string;
517
+ homeHref?: string;
518
+ /** data-ohw-key values for the editable text nodes — omit a key to leave that node non-editable. */
519
+ eyebrowKey?: string;
520
+ titleKey?: string;
521
+ subtitleKey?: string;
522
+ }
523
+ declare function EmptySection({ title, homeHref, eyebrowKey, titleKey, subtitleKey }: EmptySectionProps): react_jsx_runtime.JSX.Element;
524
+
472
525
  declare function isEditSessionActive(): boolean;
473
526
 
474
527
  type CarouselSlide = {
@@ -492,4 +545,4 @@ declare function useOhwCarousel(key: string, initial: CarouselSlide[]): {
492
545
  bind: Record<string, string>;
493
546
  };
494
547
 
495
- export { AI_DEFAULT_BRAND, AI_TREE_SCHEMA_VERSIONS, AI_TREE_TOKENS, type AiBlockNode, type AiBrandKit, type AiLayoutTree, AiTreeRenderer, type AiTreeRendererProps, type CarouselSlide, CustomToolbar, CustomToolbarButton, CustomToolbarDivider, DragHandle, DropIndicator, type DropIndicatorProps, DropdownMenu, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuSeparator, DropdownMenuTrigger, ItemActionToolbar, type ItemActionToolbarProps, ItemInteractionLayer, type ItemInteractionLayerProps, type ItemInteractionState, LinkEditorPanel, type LinkModalMode, type LinkModalProps, type LinkPage, LinkPopover, type LinkSection, OhhwellsBridge, SchedulingWidget, type SectionScaffold, Toggle, ToggleGroup, ToggleGroupItem, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, buildTarget, dropIndicatorVariants, filterAvailablePages, getEditModeInitialState, isEditSessionActive, isRenderableTree, isValidUrl, parseTarget, toggleVariants, useOhwCarousel, validateUrlInput };
548
+ export { AI_DEFAULT_BRAND, AI_TREE_SCHEMA_VERSIONS, AI_TREE_TOKENS, type AiBlockNode, type AiBrandKit, type AiLayoutTree, AiTreeRenderer, type AiTreeRendererProps, type CarouselSlide, CustomToolbar, CustomToolbarButton, CustomToolbarDivider, DragHandle, DropIndicator, type DropIndicatorProps, DropdownMenu, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuSeparator, DropdownMenuTrigger, EmptySection, type EmptySectionProps, ItemActionToolbar, type ItemActionToolbarProps, ItemInteractionLayer, type ItemInteractionLayerProps, type ItemInteractionState, LinkEditorPanel, type LinkModalMode, type LinkModalProps, type LinkPage, LinkPopover, type LinkSection, OhhwellsBridge, SchedulingWidget, type SectionScaffold, Toggle, ToggleGroup, ToggleGroupItem, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, buildTarget, dropIndicatorVariants, filterAvailablePages, getEditModeInitialState, isEditSessionActive, isRenderableTree, isValidUrl, parseTarget, toggleVariants, useOhwCarousel, validateUrlInput };