@ohhwells/bridge 0.1.164 → 0.1.166-next.442
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 +1785 -1268
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +68 -1
- package/dist/index.d.ts +68 -1
- package/dist/index.js +1425 -896
- package/dist/index.js.map +1 -1
- package/dist/pages.cjs.map +1 -1
- package/dist/pages.js.map +1 -1
- package/dist/styles.css +116 -0
- package/package.json +3 -3
package/dist/index.d.cts
CHANGED
|
@@ -991,6 +991,14 @@ declare function releaseTemplateLogoIfReplaced(img: HTMLImageElement, url: strin
|
|
|
991
991
|
*/
|
|
992
992
|
declare function hasMountedContentNodes(records: MutationRecord[]): boolean;
|
|
993
993
|
|
|
994
|
+
/**
|
|
995
|
+
* The text with its placeholders cut out and the gaps they leave tidied. Leading and trailing
|
|
996
|
+
* whitespace is kept as is: a text node's edge spaces separate it from the inline element next to it.
|
|
997
|
+
*/
|
|
998
|
+
declare function stripPlaceholderText(text: string): string;
|
|
999
|
+
/** Strips every placeholder under `root`, `root` included. Returns how many nodes changed. */
|
|
1000
|
+
declare function stripPlaceholders(root: Node): number;
|
|
1001
|
+
|
|
994
1002
|
/**
|
|
995
1003
|
* Deciding when a client-side page switch actually needs to ask the backend for content.
|
|
996
1004
|
*
|
|
@@ -1043,6 +1051,65 @@ declare function indexCollectionItems(pages: readonly SitePageEntry[]): Collecti
|
|
|
1043
1051
|
*/
|
|
1044
1052
|
declare function matchCollectionItemClick(target: Element | null, index: CollectionItemIndex): CollectionItemHit | null;
|
|
1045
1053
|
|
|
1054
|
+
/**
|
|
1055
|
+
* Menu and footer follow the onboarding build's page choices (OHH-909).
|
|
1056
|
+
*
|
|
1057
|
+
* After the build removes or renames template pages, the editor posts `ow:pages-sync`. The menu
|
|
1058
|
+
* and footer are shared chrome stored as content keys, so this edits them on the canvas exactly
|
|
1059
|
+
* the way a person deleting or renaming a link would, and posts one `ow:change` for the save:
|
|
1060
|
+
*
|
|
1061
|
+
* - links to a page that no longer renders are removed (navbar and footer)
|
|
1062
|
+
* - a chrome button that is not a menu item (the navbar CTA) is pointed at the contact page
|
|
1063
|
+
* instead, the same target the backend gives body links
|
|
1064
|
+
* - links to a kept page take the plan's label, only while they still carry the template's own
|
|
1065
|
+
* title (a link the person renamed is theirs)
|
|
1066
|
+
* - on a one-page template, `#anchor` links take the plan's label the same way
|
|
1067
|
+
*
|
|
1068
|
+
* Pure planning (`planBuildPageSync`) is split from the DOM work so it can be tested without one.
|
|
1069
|
+
*/
|
|
1070
|
+
|
|
1071
|
+
type PagesSyncMessage = {
|
|
1072
|
+
type: 'ow:pages-sync';
|
|
1073
|
+
/** Paths the build soft-deleted. */
|
|
1074
|
+
removed: string[];
|
|
1075
|
+
/** Every path that still renders. */
|
|
1076
|
+
livePaths: string[];
|
|
1077
|
+
relabel: {
|
|
1078
|
+
path: string;
|
|
1079
|
+
label: string;
|
|
1080
|
+
oldTitle: string;
|
|
1081
|
+
}[];
|
|
1082
|
+
anchorLabels: {
|
|
1083
|
+
anchors: string[];
|
|
1084
|
+
label: string;
|
|
1085
|
+
type: string;
|
|
1086
|
+
}[];
|
|
1087
|
+
};
|
|
1088
|
+
type SyncLink = {
|
|
1089
|
+
hrefKey: string;
|
|
1090
|
+
href: string;
|
|
1091
|
+
label: string;
|
|
1092
|
+
/** `chrome`: a shared-chrome link that is not a menu or footer item, such as the navbar CTA. */
|
|
1093
|
+
area: 'nav' | 'footer' | 'chrome';
|
|
1094
|
+
};
|
|
1095
|
+
type SyncPlan = {
|
|
1096
|
+
/** href keys whose links are removed. */
|
|
1097
|
+
remove: string[];
|
|
1098
|
+
/** label key → new label. */
|
|
1099
|
+
relabel: {
|
|
1100
|
+
hrefKey: string;
|
|
1101
|
+
label: string;
|
|
1102
|
+
}[];
|
|
1103
|
+
/** href key → new href, for chrome links that cannot be removed. */
|
|
1104
|
+
retarget: {
|
|
1105
|
+
hrefKey: string;
|
|
1106
|
+
href: string;
|
|
1107
|
+
}[];
|
|
1108
|
+
};
|
|
1109
|
+
/** Mirror of the backend's `isDeadPageHref`: anchors, mailto and external links never are. */
|
|
1110
|
+
declare function isDeadPageHref(href: string, livePaths: string[]): boolean;
|
|
1111
|
+
declare function planBuildPageSync(links: SyncLink[], msg: PagesSyncMessage): SyncPlan;
|
|
1112
|
+
|
|
1046
1113
|
declare function isStickySearchParam(name: string): boolean;
|
|
1047
1114
|
/**
|
|
1048
1115
|
* Copy the sticky params of `currentSearch` onto `target`, and report whether anything changed.
|
|
@@ -1087,4 +1154,4 @@ declare function useOhwCarousel(key: string, initial: CarouselSlide[]): {
|
|
|
1087
1154
|
bind: Record<string, string>;
|
|
1088
1155
|
};
|
|
1089
1156
|
|
|
1090
|
-
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, BRAND_TITLE_KEY, type CarouselSlide, type CollectionItemHit, type CollectionItemIndex, 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, OHW_LOADER_PREHYDRATE_SCRIPT, OHW_LOADER_STYLE, OhhwellsBridge, OhwLoaderSpinner, OhwLoaderSurface, SITE_OG_IMAGE_KEY, SchedulingWidget, type SectionScaffold, type SiteLegalLinks, type SitePageEntry, TEMPLATE_LOGO_ATTR, Toggle, ToggleGroup, ToggleGroupItem, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, addFooterLinkColumn, appendFooterSocial, applyBrandChrome, applyStickySearchParams, buildDefaultFooterTree, buildTarget, dropIndicatorVariants, ensureFooterTree, filterAvailablePages, foldAlignIntoTrees, getEditModeInitialState, hasMountedContentNodes, indexCollectionItems, insertFooterHours, isEditSessionActive, isPlainLeftClick, isRenderableFooterTree, isRenderableTree, isStickySearchParam, isValidUrl, matchCollectionItemClick, nextViableSlide, parseAiFooterState, parseAiSectionsState, parseTarget, recordOverriddenPaths, releaseTemplateLogoIfReplaced, removeFooterBlock, resetOverriddenPathsCache, resolveFooterCopyright, resolveStickyNavigation, serializeAiFooterState, shouldFetchContentForPath, stepViableSlide, stripTextAlignCss, toggleVariants, useOhwCarousel, validateUrlInput, viableSlides };
|
|
1157
|
+
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, BRAND_TITLE_KEY, type CarouselSlide, type CollectionItemHit, type CollectionItemIndex, 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, OHW_LOADER_PREHYDRATE_SCRIPT, OHW_LOADER_STYLE, OhhwellsBridge, OhwLoaderSpinner, OhwLoaderSurface, type PagesSyncMessage, SITE_OG_IMAGE_KEY, SchedulingWidget, type SectionScaffold, type SiteLegalLinks, type SitePageEntry, type SyncLink, type SyncPlan, TEMPLATE_LOGO_ATTR, Toggle, ToggleGroup, ToggleGroupItem, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, addFooterLinkColumn, appendFooterSocial, applyBrandChrome, applyStickySearchParams, buildDefaultFooterTree, buildTarget, dropIndicatorVariants, ensureFooterTree, filterAvailablePages, foldAlignIntoTrees, getEditModeInitialState, hasMountedContentNodes, indexCollectionItems, insertFooterHours, isDeadPageHref, isEditSessionActive, isPlainLeftClick, isRenderableFooterTree, isRenderableTree, isStickySearchParam, isValidUrl, matchCollectionItemClick, nextViableSlide, parseAiFooterState, parseAiSectionsState, parseTarget, planBuildPageSync, recordOverriddenPaths, releaseTemplateLogoIfReplaced, removeFooterBlock, resetOverriddenPathsCache, resolveFooterCopyright, resolveStickyNavigation, serializeAiFooterState, shouldFetchContentForPath, stepViableSlide, stripPlaceholderText, stripPlaceholders, stripTextAlignCss, toggleVariants, useOhwCarousel, validateUrlInput, viableSlides };
|
package/dist/index.d.ts
CHANGED
|
@@ -991,6 +991,14 @@ declare function releaseTemplateLogoIfReplaced(img: HTMLImageElement, url: strin
|
|
|
991
991
|
*/
|
|
992
992
|
declare function hasMountedContentNodes(records: MutationRecord[]): boolean;
|
|
993
993
|
|
|
994
|
+
/**
|
|
995
|
+
* The text with its placeholders cut out and the gaps they leave tidied. Leading and trailing
|
|
996
|
+
* whitespace is kept as is: a text node's edge spaces separate it from the inline element next to it.
|
|
997
|
+
*/
|
|
998
|
+
declare function stripPlaceholderText(text: string): string;
|
|
999
|
+
/** Strips every placeholder under `root`, `root` included. Returns how many nodes changed. */
|
|
1000
|
+
declare function stripPlaceholders(root: Node): number;
|
|
1001
|
+
|
|
994
1002
|
/**
|
|
995
1003
|
* Deciding when a client-side page switch actually needs to ask the backend for content.
|
|
996
1004
|
*
|
|
@@ -1043,6 +1051,65 @@ declare function indexCollectionItems(pages: readonly SitePageEntry[]): Collecti
|
|
|
1043
1051
|
*/
|
|
1044
1052
|
declare function matchCollectionItemClick(target: Element | null, index: CollectionItemIndex): CollectionItemHit | null;
|
|
1045
1053
|
|
|
1054
|
+
/**
|
|
1055
|
+
* Menu and footer follow the onboarding build's page choices (OHH-909).
|
|
1056
|
+
*
|
|
1057
|
+
* After the build removes or renames template pages, the editor posts `ow:pages-sync`. The menu
|
|
1058
|
+
* and footer are shared chrome stored as content keys, so this edits them on the canvas exactly
|
|
1059
|
+
* the way a person deleting or renaming a link would, and posts one `ow:change` for the save:
|
|
1060
|
+
*
|
|
1061
|
+
* - links to a page that no longer renders are removed (navbar and footer)
|
|
1062
|
+
* - a chrome button that is not a menu item (the navbar CTA) is pointed at the contact page
|
|
1063
|
+
* instead, the same target the backend gives body links
|
|
1064
|
+
* - links to a kept page take the plan's label, only while they still carry the template's own
|
|
1065
|
+
* title (a link the person renamed is theirs)
|
|
1066
|
+
* - on a one-page template, `#anchor` links take the plan's label the same way
|
|
1067
|
+
*
|
|
1068
|
+
* Pure planning (`planBuildPageSync`) is split from the DOM work so it can be tested without one.
|
|
1069
|
+
*/
|
|
1070
|
+
|
|
1071
|
+
type PagesSyncMessage = {
|
|
1072
|
+
type: 'ow:pages-sync';
|
|
1073
|
+
/** Paths the build soft-deleted. */
|
|
1074
|
+
removed: string[];
|
|
1075
|
+
/** Every path that still renders. */
|
|
1076
|
+
livePaths: string[];
|
|
1077
|
+
relabel: {
|
|
1078
|
+
path: string;
|
|
1079
|
+
label: string;
|
|
1080
|
+
oldTitle: string;
|
|
1081
|
+
}[];
|
|
1082
|
+
anchorLabels: {
|
|
1083
|
+
anchors: string[];
|
|
1084
|
+
label: string;
|
|
1085
|
+
type: string;
|
|
1086
|
+
}[];
|
|
1087
|
+
};
|
|
1088
|
+
type SyncLink = {
|
|
1089
|
+
hrefKey: string;
|
|
1090
|
+
href: string;
|
|
1091
|
+
label: string;
|
|
1092
|
+
/** `chrome`: a shared-chrome link that is not a menu or footer item, such as the navbar CTA. */
|
|
1093
|
+
area: 'nav' | 'footer' | 'chrome';
|
|
1094
|
+
};
|
|
1095
|
+
type SyncPlan = {
|
|
1096
|
+
/** href keys whose links are removed. */
|
|
1097
|
+
remove: string[];
|
|
1098
|
+
/** label key → new label. */
|
|
1099
|
+
relabel: {
|
|
1100
|
+
hrefKey: string;
|
|
1101
|
+
label: string;
|
|
1102
|
+
}[];
|
|
1103
|
+
/** href key → new href, for chrome links that cannot be removed. */
|
|
1104
|
+
retarget: {
|
|
1105
|
+
hrefKey: string;
|
|
1106
|
+
href: string;
|
|
1107
|
+
}[];
|
|
1108
|
+
};
|
|
1109
|
+
/** Mirror of the backend's `isDeadPageHref`: anchors, mailto and external links never are. */
|
|
1110
|
+
declare function isDeadPageHref(href: string, livePaths: string[]): boolean;
|
|
1111
|
+
declare function planBuildPageSync(links: SyncLink[], msg: PagesSyncMessage): SyncPlan;
|
|
1112
|
+
|
|
1046
1113
|
declare function isStickySearchParam(name: string): boolean;
|
|
1047
1114
|
/**
|
|
1048
1115
|
* Copy the sticky params of `currentSearch` onto `target`, and report whether anything changed.
|
|
@@ -1087,4 +1154,4 @@ declare function useOhwCarousel(key: string, initial: CarouselSlide[]): {
|
|
|
1087
1154
|
bind: Record<string, string>;
|
|
1088
1155
|
};
|
|
1089
1156
|
|
|
1090
|
-
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, BRAND_TITLE_KEY, type CarouselSlide, type CollectionItemHit, type CollectionItemIndex, 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, OHW_LOADER_PREHYDRATE_SCRIPT, OHW_LOADER_STYLE, OhhwellsBridge, OhwLoaderSpinner, OhwLoaderSurface, SITE_OG_IMAGE_KEY, SchedulingWidget, type SectionScaffold, type SiteLegalLinks, type SitePageEntry, TEMPLATE_LOGO_ATTR, Toggle, ToggleGroup, ToggleGroupItem, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, addFooterLinkColumn, appendFooterSocial, applyBrandChrome, applyStickySearchParams, buildDefaultFooterTree, buildTarget, dropIndicatorVariants, ensureFooterTree, filterAvailablePages, foldAlignIntoTrees, getEditModeInitialState, hasMountedContentNodes, indexCollectionItems, insertFooterHours, isEditSessionActive, isPlainLeftClick, isRenderableFooterTree, isRenderableTree, isStickySearchParam, isValidUrl, matchCollectionItemClick, nextViableSlide, parseAiFooterState, parseAiSectionsState, parseTarget, recordOverriddenPaths, releaseTemplateLogoIfReplaced, removeFooterBlock, resetOverriddenPathsCache, resolveFooterCopyright, resolveStickyNavigation, serializeAiFooterState, shouldFetchContentForPath, stepViableSlide, stripTextAlignCss, toggleVariants, useOhwCarousel, validateUrlInput, viableSlides };
|
|
1157
|
+
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, BRAND_TITLE_KEY, type CarouselSlide, type CollectionItemHit, type CollectionItemIndex, 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, OHW_LOADER_PREHYDRATE_SCRIPT, OHW_LOADER_STYLE, OhhwellsBridge, OhwLoaderSpinner, OhwLoaderSurface, type PagesSyncMessage, SITE_OG_IMAGE_KEY, SchedulingWidget, type SectionScaffold, type SiteLegalLinks, type SitePageEntry, type SyncLink, type SyncPlan, TEMPLATE_LOGO_ATTR, Toggle, ToggleGroup, ToggleGroupItem, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, addFooterLinkColumn, appendFooterSocial, applyBrandChrome, applyStickySearchParams, buildDefaultFooterTree, buildTarget, dropIndicatorVariants, ensureFooterTree, filterAvailablePages, foldAlignIntoTrees, getEditModeInitialState, hasMountedContentNodes, indexCollectionItems, insertFooterHours, isDeadPageHref, isEditSessionActive, isPlainLeftClick, isRenderableFooterTree, isRenderableTree, isStickySearchParam, isValidUrl, matchCollectionItemClick, nextViableSlide, parseAiFooterState, parseAiSectionsState, parseTarget, planBuildPageSync, recordOverriddenPaths, releaseTemplateLogoIfReplaced, removeFooterBlock, resetOverriddenPathsCache, resolveFooterCopyright, resolveStickyNavigation, serializeAiFooterState, shouldFetchContentForPath, stepViableSlide, stripPlaceholderText, stripPlaceholders, stripTextAlignCss, toggleVariants, useOhwCarousel, validateUrlInput, viableSlides };
|