@ohhwells/bridge 0.1.47 → 0.1.48-next.113
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 +12 -0
- package/dist/index.cjs +971 -347
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +22 -1
- package/dist/index.d.ts +22 -1
- package/dist/index.js +917 -294
- package/dist/index.js.map +1 -1
- package/dist/styles.css +12 -18
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -221,4 +221,25 @@ declare function TooltipContent({ className, sideOffset, side, children, hideArr
|
|
|
221
221
|
|
|
222
222
|
declare function isEditSessionActive(): boolean;
|
|
223
223
|
|
|
224
|
-
|
|
224
|
+
type CarouselSlide = {
|
|
225
|
+
src: string;
|
|
226
|
+
alt: string;
|
|
227
|
+
};
|
|
228
|
+
/**
|
|
229
|
+
* Template hook. Owns the slide array in React state, stamps the DOM contract via `bind`, and
|
|
230
|
+
* listens for the bridge's change event so replace/add/delete re-render the component.
|
|
231
|
+
*
|
|
232
|
+
* `bind` is plain data attributes (no ref), so it spreads onto any element type without type
|
|
233
|
+
* friction; the hook finds its own container by key. Slides inside still need
|
|
234
|
+
* `data-ohw-carousel-slide={i}`.
|
|
235
|
+
*
|
|
236
|
+
* const { images, bind } = useOhwCarousel('hero-carousel', content.images)
|
|
237
|
+
* <div {...bind}>{images.map((img, i) => <Slide data-ohw-carousel-slide={i} … />)}</div>
|
|
238
|
+
*/
|
|
239
|
+
declare function useOhwCarousel(key: string, initial: CarouselSlide[]): {
|
|
240
|
+
images: CarouselSlide[];
|
|
241
|
+
setImages: React.Dispatch<React.SetStateAction<CarouselSlide[]>>;
|
|
242
|
+
bind: Record<string, string>;
|
|
243
|
+
};
|
|
244
|
+
|
|
245
|
+
export { type CarouselSlide, CustomToolbar, CustomToolbarButton, CustomToolbarDivider, DragHandle, DropIndicator, type DropIndicatorProps, ItemActionToolbar, type ItemActionToolbarProps, ItemInteractionLayer, type ItemInteractionLayerProps, type ItemInteractionState, LinkEditorPanel, type LinkModalMode, type LinkModalProps, type LinkPage, LinkPopover, type LinkSection, OhhwellsBridge, SchedulingWidget, Toggle, ToggleGroup, ToggleGroupItem, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, buildTarget, dropIndicatorVariants, filterAvailablePages, getEditModeInitialState, isEditSessionActive, isValidUrl, parseTarget, toggleVariants, useOhwCarousel, validateUrlInput };
|
package/dist/index.d.ts
CHANGED
|
@@ -221,4 +221,25 @@ declare function TooltipContent({ className, sideOffset, side, children, hideArr
|
|
|
221
221
|
|
|
222
222
|
declare function isEditSessionActive(): boolean;
|
|
223
223
|
|
|
224
|
-
|
|
224
|
+
type CarouselSlide = {
|
|
225
|
+
src: string;
|
|
226
|
+
alt: string;
|
|
227
|
+
};
|
|
228
|
+
/**
|
|
229
|
+
* Template hook. Owns the slide array in React state, stamps the DOM contract via `bind`, and
|
|
230
|
+
* listens for the bridge's change event so replace/add/delete re-render the component.
|
|
231
|
+
*
|
|
232
|
+
* `bind` is plain data attributes (no ref), so it spreads onto any element type without type
|
|
233
|
+
* friction; the hook finds its own container by key. Slides inside still need
|
|
234
|
+
* `data-ohw-carousel-slide={i}`.
|
|
235
|
+
*
|
|
236
|
+
* const { images, bind } = useOhwCarousel('hero-carousel', content.images)
|
|
237
|
+
* <div {...bind}>{images.map((img, i) => <Slide data-ohw-carousel-slide={i} … />)}</div>
|
|
238
|
+
*/
|
|
239
|
+
declare function useOhwCarousel(key: string, initial: CarouselSlide[]): {
|
|
240
|
+
images: CarouselSlide[];
|
|
241
|
+
setImages: React.Dispatch<React.SetStateAction<CarouselSlide[]>>;
|
|
242
|
+
bind: Record<string, string>;
|
|
243
|
+
};
|
|
244
|
+
|
|
245
|
+
export { type CarouselSlide, CustomToolbar, CustomToolbarButton, CustomToolbarDivider, DragHandle, DropIndicator, type DropIndicatorProps, ItemActionToolbar, type ItemActionToolbarProps, ItemInteractionLayer, type ItemInteractionLayerProps, type ItemInteractionState, LinkEditorPanel, type LinkModalMode, type LinkModalProps, type LinkPage, LinkPopover, type LinkSection, OhhwellsBridge, SchedulingWidget, Toggle, ToggleGroup, ToggleGroupItem, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, buildTarget, dropIndicatorVariants, filterAvailablePages, getEditModeInitialState, isEditSessionActive, isValidUrl, parseTarget, toggleVariants, useOhwCarousel, validateUrlInput };
|