@selfhelp/shared 1.21.3 → 1.21.6

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.
Files changed (53) hide show
  1. package/CHANGELOG.md +106 -0
  2. package/README.md +2 -1
  3. package/dist/index.d.mts +519 -24
  4. package/dist/index.d.ts +519 -24
  5. package/dist/index.js +723 -18
  6. package/dist/index.mjs +674 -18
  7. package/dist/plugin-sdk/index.d.mts +1 -1
  8. package/dist/plugin-sdk/index.d.ts +1 -1
  9. package/dist/plugin-sdk/index.js +2 -1
  10. package/dist/plugin-sdk/index.mjs +2 -1
  11. package/dist/registry/index.d.mts +2 -2
  12. package/dist/registry/index.d.ts +2 -2
  13. package/dist/registry/index.js +2 -1
  14. package/dist/registry/index.mjs +2 -1
  15. package/dist/{styles.registry-DEDEZ8l3.d.ts → styles.registry-DX79oirw.d.ts} +93 -16
  16. package/dist/{styles.registry-DHM4M77N.d.mts → styles.registry-ffw0MH3r.d.mts} +93 -16
  17. package/package.json +1 -1
  18. package/src/api/__tests__/endpoints.test.ts +37 -12
  19. package/src/api/endpoints.ts +5 -5
  20. package/src/api/index.ts +1 -0
  21. package/src/api/pagesResolve.ts +78 -0
  22. package/src/content/__tests__/fieldsMapLabels.test.ts +55 -0
  23. package/src/content/__tests__/formRecordPrefill.test.ts +104 -0
  24. package/src/content/__tests__/optionLabels.test.ts +100 -0
  25. package/src/content/fieldsMapLabels.ts +103 -0
  26. package/src/content/formRecordPrefill.ts +191 -0
  27. package/src/content/index.ts +3 -0
  28. package/src/content/optionLabels.ts +200 -0
  29. package/src/navigation/__tests__/navigation.test.ts +296 -6
  30. package/src/navigation/activeTrail.ts +99 -0
  31. package/src/navigation/branchNav.ts +155 -6
  32. package/src/navigation/footerPreset.ts +109 -0
  33. package/src/navigation/headerLayers.ts +56 -0
  34. package/src/navigation/headerPreset.ts +9 -2
  35. package/src/navigation/index.ts +4 -0
  36. package/src/navigation/menuDepth.ts +73 -37
  37. package/src/navigation/mobileRoute.ts +25 -0
  38. package/src/navigation/navLinks.ts +0 -4
  39. package/src/navigation/navigationBundle.ts +81 -0
  40. package/src/navigation/navigationPayload.ts +96 -17
  41. package/src/registry/__tests__/platform.test.ts +11 -10
  42. package/src/registry/styles.registry.ts +2 -1
  43. package/src/types/__tests__/preview-bridge.test.ts +7 -0
  44. package/src/types/auth.ts +4 -0
  45. package/src/types/cms-app.ts +74 -0
  46. package/src/types/index.ts +1 -0
  47. package/src/types/mobile-adapters.ts +1 -0
  48. package/src/types/pages.ts +6 -0
  49. package/src/types/preview-bridge.ts +22 -2
  50. package/src/types/styles/composite.ts +21 -0
  51. package/src/types/styles/forms.ts +57 -10
  52. package/src/types/styles/interactive.ts +1 -1
  53. package/src/types/styles/unknown.ts +2 -2
package/dist/index.d.mts CHANGED
@@ -1,5 +1,5 @@
1
- import { T as TStyleName, j as IContentField, k as TMobileButtonFeedback, l as TMobileFieldVariant, m as TMobileSelectPresentation } from './styles.registry-DHM4M77N.mjs';
2
- export { B as BASE_STYLE_REGISTRY, n as IAccordionItemStyle, o as IAccordionStyle, p as IActionIconStyle, q as IAlertStyle, r as IAspectRatioStyle, s as IAudioStyle, t as IAvatarStyle, u as IBackgroundImageStyle, v as IBadgeStyle, w as IBaseStyle, x as IBlockquoteStyle, y as IBoxStyle, z as IButtonStyle, A as ICardSegmentStyle, C as ICardStyle, D as ICarouselStyle, E as ICenterStyle, F as ICheckboxStyle, G as IChipStyle, H as ICodeStyle, J as IColorInputStyle, K as IColorPickerStyle, L as IComboboxStyle, M as IContainerStyle, N as IDataContainerStyle, O as IDatePickerStyle, P as IDividerStyle, Q as IEntryListStyle, R as IEntryRecordDeleteStyle, U as IEntryRecordStyle, V as IFieldsetStyle, W as IFigureStyle, X as IFileInputStyle, Y as IFlexStyle, Z as IFormLogStyle, $ as IFormRecordStyle, a0 as IFormStyle, a1 as IGridColumnStyle, a2 as IGridStyle, a3 as IGroupStyle, a4 as IHighlightStyle, a5 as IHtmlTagStyle, a6 as IImageStyle, a7 as IIndicatorStyle, a8 as IInputStyle, a9 as IKbdStyle, aa as ILinkStyle, ab as IListItemStyle, ac as IListStyle, ad as ILoginStyle, ae as ILoopStyle, af as IMissingStyle, ag as INoAccessStyle, ah as INotFoundStyle, ai as INotificationStyle, aj as INumberInputStyle, ak as IPaperStyle, a as IPluginStyleRegistryEntry, al as IProfileStyle, am as IProgressRootStyle, an as IProgressSectionStyle, ao as IProgressStyle, ap as IRadioStyle, aq as IRangeSliderStyle, ar as IRatingStyle, as as IRefContainerStyle, at as IRegisterStyle, au as IResetPasswordStyle, av as IRichTextEditorStyle, aw as IScrollAreaStyle, ax as ISegmentedControlStyle, ay as ISelectStyle, az as IShowUserInputEntry, aA as IShowUserInputStyle, aB as ISimpleGridStyle, aC as ISliderStyle, aD as ISpaceStyle, aE as ISpoilerStyle, aF as IStackStyle, I as IStyleRegistryEntry, aG as IStyleWithSpacing, aH as ISwitchStyle, aI as ITabStyle, aJ as ITabsStyle, aK as ITextInputStyle, aL as ITextStyle, aM as ITextareaStyle, aN as IThemeIconStyle, aO as ITimelineItemStyle, aP as ITimelineStyle, aQ as ITitleStyle, aR as ITwoFactorAuthStyle, aS as ITypographyStyle, aT as IUnknownStyle, aU as IValidateStyle, aV as IVersionStyle, aW as IVideoStyle, S as STYLE_REGISTRY, c as TConcretePlatform, aX as TMantineAccordionChevronPosition, aY as TMantineAccordionDisableChevronRotation, aZ as TMantineAccordionLoop, a_ as TMantineAccordionMultiple, a$ as TMantineAnchorUnderline, b0 as TMantineBorder, b1 as TMantineCardPadding, b2 as TMantineCardShadow, b3 as TMantineCols, b4 as TMantineDividerVariant, b5 as TMantineGap, b6 as TMantineGridOffset, b7 as TMantineGridOrder, b8 as TMantineHeight, b9 as TMantineIconSize, ba as TMantineImageFit, bb as TMantineLineClamp, bc as TMantineListCenter, bd as TMantineListStyleType, be as TMantineListType, bf as TMantineListWithPadding, bg as TMantinePaperShadow, bh as TMantineProgressTransition, bi as TMantineScrollAreaSize, bj as TMantineScrollAreaType, bk as TMantineTextAlign, bl as TMantineTextDecoration, bm as TMantineTextFontStyle, bn as TMantineTextFontWeight, bo as TMantineTextInherit, bp as TMantineTextInputVariant, bq as TMantineTextSpan, br as TMantineTextTransform, bs as TMantineTextTruncate, bt as TMantineTextVariant, bu as TMantineTextareaAutosize, bv as TMantineTextareaResize, bw as TMantineTextareaVariant, bx as TMantineTimelineAlign, by as TMantineTitleLineClamp, bz as TMantineTitleTextWrap, bA as TMantineTranslatable, bB as TMantineUseInputWrapper, bC as TMantineWidth, bD as TSharedBorder, bE as TSharedCols, bF as TSharedDimension, bG as TSharedDividerLabelPosition, bH as TSharedDividerVariant, bI as TSharedLabelPosition, bJ as TStyle, b as TStylePlacement, d as TStylePlatform, e as TStyleRegistryKey, _ as _AssertRegistryMatchesStyleName, f as _resetPluginStyleRegistry, g as extendStyleRegistry, h as getMergedStyleRegistry, i as getPluginStyleRegistry } from './styles.registry-DHM4M77N.mjs';
1
+ import { T as TStyleName, j as IContentField, k as TMobileButtonFeedback, l as TMobileFieldVariant, m as TMobileSelectPresentation } from './styles.registry-ffw0MH3r.mjs';
2
+ export { B as BASE_STYLE_REGISTRY, n as IAccordionItemStyle, o as IAccordionStyle, p as IActionIconStyle, q as IAlertStyle, r as IAspectRatioStyle, s as IAudioStyle, t as IAvatarStyle, u as IBackgroundImageStyle, v as IBadgeStyle, w as IBaseStyle, x as IBlockquoteStyle, y as IBoxStyle, z as IButtonStyle, A as ICardSegmentStyle, C as ICardStyle, D as ICarouselStyle, E as ICenterStyle, F as ICheckboxStyle, G as IChipStyle, H as ICodeStyle, J as IColorInputStyle, K as IColorPickerStyle, L as IComboboxStyle, M as IContainerStyle, N as IDataContainerStyle, O as IDatePickerStyle, P as IDividerStyle, Q as IEntryListStyle, R as IEntryRecordDeleteStyle, U as IEntryRecordFormStyle, V as IEntryRecordStyle, W as IEntryTableEntry, X as IEntryTableStyle, Y as IFieldsetStyle, Z as IFigureStyle, $ as IFileInputStyle, a0 as IFlexStyle, a1 as IFormLogStyle, a2 as IFormRecordStyle, a3 as IFormStyle, a4 as IGridColumnStyle, a5 as IGridStyle, a6 as IGroupStyle, a7 as IHighlightStyle, a8 as IHtmlTagStyle, a9 as IImageStyle, aa as IIndicatorStyle, ab as IInputStyle, ac as IKbdStyle, ad as ILinkStyle, ae as IListItemStyle, af as IListStyle, ag as ILoginStyle, ah as ILoopStyle, ai as IMissingStyle, aj as INoAccessStyle, ak as INotFoundStyle, al as INotificationStyle, am as INumberInputStyle, an as IPaperStyle, a as IPluginStyleRegistryEntry, ao as IProfileStyle, ap as IProgressRootStyle, aq as IProgressSectionStyle, ar as IProgressStyle, as as IRadioStyle, at as IRangeSliderStyle, au as IRatingStyle, av as IRefContainerStyle, aw as IRegisterStyle, ax as IResetPasswordStyle, ay as IRichTextEditorStyle, az as IScrollAreaStyle, aA as ISegmentedControlStyle, aB as ISelectStyle, aC as ISimpleGridStyle, aD as ISliderStyle, aE as ISpaceStyle, aF as ISpoilerStyle, aG as IStackStyle, I as IStyleRegistryEntry, aH as IStyleWithSpacing, aI as ISwitchStyle, aJ as ITabStyle, aK as ITabsStyle, aL as ITextInputStyle, aM as ITextStyle, aN as ITextareaStyle, aO as IThemeIconStyle, aP as ITimelineItemStyle, aQ as ITimelineStyle, aR as ITitleStyle, aS as ITwoFactorAuthStyle, aT as ITypographyStyle, aU as IUnknownStyle, aV as IValidateStyle, aW as IVersionStyle, aX as IVideoStyle, S as STYLE_REGISTRY, c as TConcretePlatform, aY as TMantineAccordionChevronPosition, aZ as TMantineAccordionDisableChevronRotation, a_ as TMantineAccordionLoop, a$ as TMantineAccordionMultiple, b0 as TMantineAnchorUnderline, b1 as TMantineBorder, b2 as TMantineCardPadding, b3 as TMantineCardShadow, b4 as TMantineCols, b5 as TMantineDividerVariant, b6 as TMantineGap, b7 as TMantineGridOffset, b8 as TMantineGridOrder, b9 as TMantineHeight, ba as TMantineIconSize, bb as TMantineImageFit, bc as TMantineLineClamp, bd as TMantineListCenter, be as TMantineListStyleType, bf as TMantineListType, bg as TMantineListWithPadding, bh as TMantinePaperShadow, bi as TMantineProgressTransition, bj as TMantineScrollAreaSize, bk as TMantineScrollAreaType, bl as TMantineTextAlign, bm as TMantineTextDecoration, bn as TMantineTextFontStyle, bo as TMantineTextFontWeight, bp as TMantineTextInherit, bq as TMantineTextInputVariant, br as TMantineTextSpan, bs as TMantineTextTransform, bt as TMantineTextTruncate, bu as TMantineTextVariant, bv as TMantineTextareaAutosize, bw as TMantineTextareaResize, bx as TMantineTextareaVariant, by as TMantineTimelineAlign, bz as TMantineTitleLineClamp, bA as TMantineTitleTextWrap, bB as TMantineTranslatable, bC as TMantineUseInputWrapper, bD as TMantineWidth, bE as TSharedBorder, bF as TSharedCols, bG as TSharedDimension, bH as TSharedDividerLabelPosition, bI as TSharedDividerVariant, bJ as TSharedLabelPosition, bK as TStyle, b as TStylePlacement, d as TStylePlatform, e as TStyleRegistryKey, _ as _AssertRegistryMatchesStyleName, f as _resetPluginStyleRegistry, g as extendStyleRegistry, h as getMergedStyleRegistry, i as getPluginStyleRegistry } from './styles.registry-ffw0MH3r.mjs';
3
3
  export { v as TMantineAccordionVariant, y as TMantineActionIconLoading, d as TMantineAlign, z as TMantineAllowNextClicks, A as TMantineAllowStepClick, B as TMantineAspectRatio, C as TMantineAutoContrast, r as TMantineAvatarVariant, q as TMantineBadgeVariant, D as TMantineBlock, E as TMantineCenterInline, F as TMantineChecked, G as TMantineChipChecked, H as TMantineChipMultiple, s as TMantineChipVariant, I as TMantineClampBehavior, J as TMantineCodeBlock, T as TMantineColor, K as TMantineColorFormat, L as TMantineColorInputSwatches, M as TMantineColorPickerSwatches, N as TMantineColorPickerSwatchesPerRow, O as TMantineCompact, P as TMantineContainerFluid, e as TMantineDirection, Q as TMantineDisabled, n as TMantineFieldsetVariant, R as TMantineFileAccept, S as TMantineFileInputMultiple, U as TMantineFluid, V as TMantineFullWidth, i as TMantineGridGrow, g as TMantineGridOverflow, h as TMantineGridSpan, W as TMantineGroupGrow, X as TMantineGroupWrap, Y as TMantineGrow, Z as TMantineHighlight, t as TMantineIndicatorPosition, _ as TMantineInline, $ as TMantineIsLink, c as TMantineJustify, a0 as TMantineKbdSize, a1 as TMantineLoading, a2 as TMantineMultiple, a3 as TMantineNotificationWithCloseButton, a4 as TMantineNumberInputDecimalScale, a5 as TMantineOpenInNewTab, j as TMantineOrientation, a6 as TMantineProcessing, a as TMantineRadius, a7 as TMantineRangeSliderMarks, a8 as TMantineRatingCount, a9 as TMantineRatingFractions, aa as TMantineRatingReadonly, ab as TMantineReadonly, m as TMantineSize, ac as TMantineSpaceHorizontal, ad as TMantineSpacing, o as TMantineSpoilerMaxHeight, ae as TMantineSwatches, af as TMantineTabDisabled, w as TMantineTabsVariant, u as TMantineThemeIconVariant, x as TMantineTimelineLineVariant, l as TMantineTitleOrder, ag as TMantineUseMantineStyle, p as TMantineVariant, ah as TMantineWithCloseButton, ai as TMantineWithIcon, f as TMantineWrap, k as TSharedRadius, b as TSharedSize } from './common-qaDIAYS3.mjs';
4
4
  import { ReactNode, ComponentType } from 'react';
5
5
  import { THeroUiButtonVariant, THeroUiSize } from './theme/index.mjs';
@@ -72,6 +72,12 @@ interface IPageContent {
72
72
  url: string | null;
73
73
  parent_page_id: number | null;
74
74
  is_headless: boolean;
75
+ /**
76
+ * CMS-in-CMS surface: `public` website pages vs `cms` admin-only snippets
77
+ * (entry-table / form). `cms` pages must not render on the public slug route;
78
+ * Host Admin hosts them under `/admin/cms-apps/.../content`.
79
+ */
80
+ page_surface?: 'public' | 'cms';
75
81
  /**
76
82
  * When true, the web frontend renders this page's content inside a modal
77
83
  * overlay (the page title becomes the modal header, with a close button)
@@ -217,6 +223,10 @@ declare const PERMISSIONS: {
217
223
  readonly ADMIN_PAGE_VERSION_PUBLISH: "admin.page.version.publish";
218
224
  readonly ADMIN_PAGE_VERSION_READ: "admin.page.version.read";
219
225
  readonly ADMIN_PAGE_VERSION_COMPARE: "admin.page.version.compare";
226
+ readonly ADMIN_CMS_APP_READ: "admin.cms_app.read";
227
+ readonly ADMIN_CMS_APP_CREATE: "admin.cms_app.create";
228
+ readonly ADMIN_CMS_APP_UPDATE: "admin.cms_app.update";
229
+ readonly ADMIN_CMS_APP_DELETE: "admin.cms_app.delete";
220
230
  readonly ADMIN_USER_READ: "admin.user.read";
221
231
  readonly ADMIN_USER_CREATE: "admin.user.create";
222
232
  readonly ADMIN_USER_UPDATE: "admin.user.update";
@@ -259,6 +269,49 @@ declare const PERMISSIONS: {
259
269
  };
260
270
  type TPermission = (typeof PERMISSIONS)[keyof typeof PERMISSIONS];
261
271
 
272
+ /**
273
+ * First-class CMS app contract (Host Admin product unit).
274
+ * Mirrors backend CmsAppRole + CmsAppService response shapes.
275
+ */
276
+ type TCmsAppRole = 'form' | 'cms_list' | 'cms_detail' | 'public_list' | 'public_detail' | 'other';
277
+ declare const CMS_APP_ROLES: readonly TCmsAppRole[];
278
+ declare const CMS_APP_PRIMARY_ROLES: readonly TCmsAppRole[];
279
+ /** Assigned page row inside a CMS app detail payload. */
280
+ interface ICmsAppPage {
281
+ page_id: number;
282
+ keyword: string;
283
+ url: string | null;
284
+ page_surface: string;
285
+ cms_app_role: TCmsAppRole | null;
286
+ }
287
+ /** @deprecated Prefer {@link ICmsAppPage} — kept for existing imports. */
288
+ type ICmsAppAssignedPage = ICmsAppPage;
289
+ /** List/summary row for GET /admin/cms-apps. */
290
+ interface ICmsAppSummary {
291
+ id: number;
292
+ name: string;
293
+ slug: string;
294
+ description: string | null;
295
+ page_count: number;
296
+ id_form_section: number | null;
297
+ id_cms_list_page: number | null;
298
+ cms_list_keyword: string | null;
299
+ cms_list_url: string | null;
300
+ id_cms_detail_page: number | null;
301
+ id_public_list_page: number | null;
302
+ public_list_keyword: string | null;
303
+ public_list_url: string | null;
304
+ id_public_detail_page: number | null;
305
+ created_at: string;
306
+ updated_at: string | null;
307
+ }
308
+ /** Detail payload (summary + assigned pages). Canonical alias: {@link ICmsApp}. */
309
+ interface ICmsAppDetail extends ICmsAppSummary {
310
+ pages: ICmsAppPage[];
311
+ }
312
+ /** Canonical CMS app detail contract. */
313
+ type ICmsApp = ICmsAppDetail;
314
+
262
315
  /**
263
316
  * Common API envelope returned by the Symfony backend's ApiResponseFormatter.
264
317
  */
@@ -999,6 +1052,12 @@ interface IPreviewNavigatedMessage {
999
1052
  keyword: string | null;
1000
1053
  /** Full in-frame href, for diagnostics / the toolbar URL display. */
1001
1054
  href: string;
1055
+ /**
1056
+ * Public CMS path when the frame resolved a parameterized route
1057
+ * (`/team-members/5`). The shell re-resolves via `/pages/resolve` so
1058
+ * `route_params` stay in sync. Optional for static keyword pages.
1059
+ */
1060
+ path?: string | null;
1002
1061
  locale?: string | null;
1003
1062
  }
1004
1063
  /**
@@ -1009,6 +1068,12 @@ interface IPreviewNavigatedMessage {
1009
1068
  interface IPreviewNavigateCommand {
1010
1069
  type: typeof PREVIEW_BRIDGE_MESSAGE.NAVIGATE;
1011
1070
  keyword: string | null;
1071
+ /**
1072
+ * Full public path when keyword alone is insufficient (parameterized routes
1073
+ * such as `/team-members/5`). The mobile frame resolves this via
1074
+ * `GET /pages/resolve` instead of routing by keyword only.
1075
+ */
1076
+ path?: string | null;
1012
1077
  }
1013
1078
  /**
1014
1079
  * shell → frame: apply the shared colour-scheme + language {@link IPreviewPreferences}
@@ -1689,6 +1754,7 @@ interface IMobileCheckboxProps extends IMobileAdapterBaseProps {
1689
1754
  interface IMobileSelectOption {
1690
1755
  value: string;
1691
1756
  label: string;
1757
+ disabled?: boolean;
1692
1758
  }
1693
1759
  interface IMobileSelectProps extends IMobileAdapterBaseProps {
1694
1760
  value?: string;
@@ -1766,11 +1832,12 @@ declare const ENDPOINTS: {
1766
1832
  readonly BY_KEYWORD: (keyword: string) => string;
1767
1833
  readonly BY_ID: (pageId: number) => string;
1768
1834
  /**
1769
- * DB-driven public path resolution (issue #30): maps a full public URL
1770
- * path (e.g. `/reset/42/abc`, `/team/7`) to a page payload + route
1771
- * params. `path` is sent URL-encoded as a query parameter.
1835
+ * Static resolve route (no query). Always pair with
1836
+ * {@link buildPagesResolveUrl} / {@link buildPagesResolvePath} so
1837
+ * `path`, `language_id`, and `preview` are encoded identically across
1838
+ * SSR, browser, and mobile.
1772
1839
  */
1773
- readonly RESOLVE: (path: string) => string;
1840
+ readonly RESOLVE_ROUTE: "/cms-api/v1/pages/resolve";
1774
1841
  };
1775
1842
  readonly NAVIGATION: {
1776
1843
  readonly GET: "/cms-api/v1/navigation";
@@ -1794,6 +1861,39 @@ declare const CLIENT_TYPE_MOBILE = "mobile";
1794
1861
  declare const CLIENT_TYPE_MOBILE_AND_WEB = "mobile_and_web";
1795
1862
  type TClientType = typeof CLIENT_TYPE_WEB | typeof CLIENT_TYPE_MOBILE | typeof CLIENT_TYPE_MOBILE_AND_WEB;
1796
1863
 
1864
+ /** Inputs accepted by `GET /pages/resolve`. */
1865
+ interface IPagesResolveParams {
1866
+ /** Public URL path, e.g. `/team/7`, `/reset/42/abc`, `/`. */
1867
+ path: string;
1868
+ /** Optional language id query param. */
1869
+ languageId?: number | null;
1870
+ /**
1871
+ * When true, request unpublished draft content. Backend requires an
1872
+ * authenticated caller (`preview=true`).
1873
+ */
1874
+ preview?: boolean;
1875
+ }
1876
+ /**
1877
+ * Normalize a public path for the resolve query: strip origin fragments /
1878
+ * search, ensure a leading slash, collapse a trailing slash (except root).
1879
+ */
1880
+ declare function normalizePagesResolvePath(rawPath: string): string;
1881
+ /**
1882
+ * Build the query string for `/pages/resolve` (no leading `?`).
1883
+ * Always includes `path`; optionally `language_id` and `preview=true`.
1884
+ */
1885
+ declare function buildPagesResolveQuery(params: IPagesResolveParams): string;
1886
+ /**
1887
+ * BFF-relative resolve path used by the Next.js frontend
1888
+ * (`/pages/resolve?path=…`).
1889
+ */
1890
+ declare function buildPagesResolvePath(params: IPagesResolveParams): string;
1891
+ /**
1892
+ * Full Symfony path including `/cms-api/v1` — used by mobile and any
1893
+ * direct-to-backend client.
1894
+ */
1895
+ declare function buildPagesResolveUrl(params: IPagesResolveParams): string;
1896
+
1797
1897
  /**
1798
1898
  * Mirrors the backend `PageDb::replace_calced_values()` regex:
1799
1899
  *
@@ -2035,6 +2135,141 @@ declare function hasInlineFormatting(value: string | null | undefined): boolean;
2035
2135
  */
2036
2136
  declare function stripHtmlToText(value: string | null | undefined): string;
2037
2137
 
2138
+ /**
2139
+ * Cross-platform helpers for user-owned option catalogs in CMS styles.
2140
+ *
2141
+ * The selected data row stores only stable option codes; labels are resolved
2142
+ * per language from translatable style config fields.
2143
+ */
2144
+ interface IOptionCatalogEntry {
2145
+ value: string;
2146
+ sort?: number;
2147
+ disabled?: boolean;
2148
+ meta?: Record<string, unknown>;
2149
+ /**
2150
+ * Compatibility-only label carried by legacy `{ value, text|label }`
2151
+ * catalogs. New catalogs keep labels in the translatable `option_labels`
2152
+ * field instead.
2153
+ */
2154
+ legacyLabel?: string;
2155
+ }
2156
+ interface IOptionLabelMap {
2157
+ [code: string]: string;
2158
+ }
2159
+ interface IResolvedOption {
2160
+ value: string;
2161
+ label: string;
2162
+ sort?: number;
2163
+ disabled?: boolean;
2164
+ meta?: Record<string, unknown>;
2165
+ }
2166
+ interface IOptionStyleConfig {
2167
+ catalogField: 'options' | 'radio_options' | 'combobox_options' | 'segmented_control_data';
2168
+ multipleField?: 'is_multiple' | 'web_combobox_multi_select';
2169
+ }
2170
+ /**
2171
+ * Option-bearing core styles and the fields that define their catalogs.
2172
+ * Boolean `checkbox` is intentionally absent because it is not an enum group.
2173
+ */
2174
+ declare const OPTION_STYLE_CONFIGS: {
2175
+ readonly select: {
2176
+ readonly catalogField: "options";
2177
+ readonly multipleField: "is_multiple";
2178
+ };
2179
+ readonly radio: {
2180
+ readonly catalogField: "radio_options";
2181
+ };
2182
+ readonly combobox: {
2183
+ readonly catalogField: "combobox_options";
2184
+ readonly multipleField: "web_combobox_multi_select";
2185
+ };
2186
+ readonly 'segmented-control': {
2187
+ readonly catalogField: "segmented_control_data";
2188
+ };
2189
+ };
2190
+ type TOptionStyleName = keyof typeof OPTION_STYLE_CONFIGS;
2191
+ /**
2192
+ * Parse option catalog from style field content.
2193
+ *
2194
+ * Supports both current legacy shape (`[{ value, text|label }]`) and the new
2195
+ * language-neutral base shape (`[{ value, sort, disabled, meta }]`).
2196
+ */
2197
+ declare function parseOptionCatalog(raw: unknown): IOptionCatalogEntry[];
2198
+ /**
2199
+ * Parse per-language labels map (`code -> label`) from a translatable style
2200
+ * field value.
2201
+ */
2202
+ declare function parseOptionLabels(raw: unknown): IOptionLabelMap;
2203
+ declare function resolveOptionLabel(code: string | null | undefined, labels: IOptionLabelMap, fallbackLabels?: IOptionLabelMap, legacyLabel?: string): string;
2204
+ declare function resolveOptions(catalogRaw: unknown, labelsRaw: unknown, fallbackLabelsRaw?: unknown): IResolvedOption[];
2205
+ declare function resolveOptionCodesLabels(codes: string[], labels: IOptionLabelMap, fallbackLabels?: IOptionLabelMap): string[];
2206
+ /** Normalize a stored single value, comma-separated multi value, or array. */
2207
+ declare function parseOptionCodes(value: unknown): string[];
2208
+ declare function resolveOptionValueLabels(value: unknown, labelsRaw: unknown, fallbackLabelsRaw?: unknown): string[];
2209
+
2210
+ /**
2211
+ * entry-table column catalog + per-language header labels (select-style split).
2212
+ */
2213
+ interface IFieldsMapStyleConfig {
2214
+ catalogField: 'fields_map';
2215
+ labelsField: 'fields_map_labels';
2216
+ }
2217
+ declare const FIELDS_MAP_STYLE_CONFIG: IFieldsMapStyleConfig;
2218
+ /** Parse ordered field_key catalog from property `fields_map`. */
2219
+ declare function parseFieldsMapCatalog(raw: unknown): string[];
2220
+ declare function parseFieldsMapLabels(raw: unknown): Record<string, string>;
2221
+ declare function resolveFieldsMapLabel(fieldKey: string, labels: Record<string, string>, fallbackLabels?: Record<string, string>): string;
2222
+ declare function serializeFieldsMapCatalog(fieldKeys: string[]): string;
2223
+ declare function serializeFieldsMapLabels(labels: Record<string, string>): string;
2224
+
2225
+ /**
2226
+ * Flatten server-hydrated form `section_data` into a form-record prefill map.
2227
+ *
2228
+ * Used by web `FormStyle` and mobile `FormUserInput` so create/edit hydration
2229
+ * cannot drift between clients. The backend owns which row is present
2230
+ * (`load_record_from`); this helper only reshapes that payload.
2231
+ */
2232
+ /** Per-language value for a translatable form field. */
2233
+ interface IFormRecordPrefillTranslatedValue {
2234
+ language_id: number;
2235
+ value: string;
2236
+ }
2237
+ type TFormRecordPrefillFieldValue = string | IFormRecordPrefillTranslatedValue[];
2238
+ interface IFormRecordPrefill {
2239
+ recordId: number | null;
2240
+ values: Record<string, TFormRecordPrefillFieldValue>;
2241
+ }
2242
+ /** Metadata fields that are never form inputs. */
2243
+ declare const FORM_RECORD_PREFILL_SKIP_FIELDS: ReadonlySet<string>;
2244
+ interface IFormRecordPrefillChild {
2245
+ name?: {
2246
+ content?: string;
2247
+ } | null;
2248
+ translatable?: {
2249
+ content?: string;
2250
+ } | null;
2251
+ }
2252
+ interface IFormRecordPrefillSection {
2253
+ section_data?: unknown;
2254
+ children?: IFormRecordPrefillChild[] | null;
2255
+ }
2256
+ /**
2257
+ * Parse hydrated `section_data` rows into `{ recordId, values }`.
2258
+ *
2259
+ * - Missing / empty / non-array `section_data` → empty create state.
2260
+ * - Rows without a numeric `record_id` are ignored.
2261
+ * - Translatable fields accumulate `{ language_id, value }[]` (language id `1`
2262
+ * is an Independent seed kept only until a public-language row arrives).
2263
+ * - Non-translatable fields prefer language id `1`, else the first seen value.
2264
+ */
2265
+ declare function parseFormRecordPrefill(section: IFormRecordPrefillSection): IFormRecordPrefill;
2266
+ /**
2267
+ * Flatten rich prefill values to plain strings for clients that do not keep
2268
+ * per-language arrays (mobile). Prefers `languageId` when present, else the
2269
+ * first translated entry, else the Independent seed string.
2270
+ */
2271
+ declare function flattenFormRecordPrefillValues(values: Record<string, TFormRecordPrefillFieldValue>, languageId?: number | null): Record<string, string>;
2272
+
2038
2273
  /**
2039
2274
  * Global web header presentation presets (menu-builder `web_header` menu).
2040
2275
  */
@@ -2048,11 +2283,22 @@ interface IWebHeaderPresetOption {
2048
2283
  }
2049
2284
  declare const WEB_HEADER_PRESET_OPTIONS: readonly IWebHeaderPresetOption[];
2050
2285
  declare function isWebHeaderPreset(value: unknown): value is TWebHeaderPreset;
2286
+ /** True for presets that render the two-row (top layer + main layer) header. */
2287
+ declare function isDoubleWebHeaderPreset(value: unknown): boolean;
2051
2288
  declare function resolveWebHeaderPreset(value: unknown, fallback?: TWebHeaderPreset): TWebHeaderPreset;
2052
2289
 
2053
2290
  type TNavigationMenuKey = 'web_header' | 'web_footer' | 'mobile_drawer' | 'mobile_bottom_tabs';
2054
2291
  type TNavigationMenuItemType = 'page' | 'external_url' | 'group';
2055
- type TNavigationChildSource = 'manual' | 'page_children' | 'manual_plus_suggestions';
2292
+ /** Header row assignment for `web_header` root items (`null` = main row). */
2293
+ type TNavigationHeaderLayer = 'top';
2294
+ /**
2295
+ * How a web page presents its menu branch (children/siblings):
2296
+ * `sidebar` = left sidebar + prev/next pager, `pills` = compact pill strip,
2297
+ * `none` = only the page content. Menu-level default (NULL resolves to
2298
+ * `sidebar`), overridable per parent item. Mobile menus have native
2299
+ * presentation and always carry `null`.
2300
+ */
2301
+ type TNavigationChildrenNavMode = 'sidebar' | 'pills' | 'none';
2056
2302
  type TNavigationSearchMode = 'off' | 'menu_pages' | 'searchable_pages' | 'content_index';
2057
2303
  type TNavigationStartMode = 'fixed_page' | 'last_visited_then_fixed_page';
2058
2304
  type TNavigationMobileStartSource = 'same_as_web' | 'custom_mobile_pages';
@@ -2061,34 +2307,47 @@ interface INavigationResolvedPageRef {
2061
2307
  keyword: string;
2062
2308
  url: string | null;
2063
2309
  title: string | null;
2064
- icon?: string | null;
2065
- mobile_icon?: string | null;
2066
2310
  has_content?: boolean;
2067
2311
  section_count?: number;
2068
2312
  }
2313
+ /**
2314
+ * Resolved public menu item (`GET /navigation`). Strict contract: every key is
2315
+ * always present; absence of a value is expressed as `null`, never a missing key.
2316
+ */
2069
2317
  interface INavigationMenuItem {
2070
- id: number | string;
2318
+ id: number;
2071
2319
  item_type: TNavigationMenuItemType;
2072
2320
  label: string;
2073
- description?: string | null;
2074
- aria_label?: string | null;
2075
- icon?: string | null;
2321
+ description: string | null;
2322
+ aria_label: string | null;
2323
+ icon: string | null;
2324
+ mobile_icon: string | null;
2076
2325
  position: number;
2077
- external_url?: string | null;
2078
- page?: INavigationResolvedPageRef | null;
2079
- is_virtual?: boolean;
2080
- is_active?: boolean;
2081
- child_source?: TNavigationChildSource;
2082
- children?: INavigationMenuItem[];
2326
+ /** Only meaningful on `web_header` root items; `null` everywhere else. */
2327
+ layer: TNavigationHeaderLayer | null;
2328
+ /** Per-parent-item override of the menu's `children_nav` default (web menus only). */
2329
+ children_nav: TNavigationChildrenNavMode | null;
2330
+ /** Per-parent-item override of the menu's `show_pager` default; `null` = inherit. */
2331
+ show_pager?: boolean | null;
2332
+ external_url: string | null;
2333
+ page: INavigationResolvedPageRef | null;
2334
+ is_active: boolean;
2335
+ children: INavigationMenuItem[];
2083
2336
  }
2084
2337
  interface INavigationMenu {
2085
2338
  key: TNavigationMenuKey;
2086
2339
  platform: 'web' | 'mobile';
2087
2340
  surface: 'header' | 'footer' | 'drawer' | 'bottom_tabs';
2088
- preset?: TWebHeaderPreset | string | null;
2089
- max_depth?: number | null;
2090
- item_limit?: number | null;
2091
- config?: Record<string, unknown> | null;
2341
+ /** Header presets for `web_header`, footer presets for `web_footer`, `null` for mobile menus. */
2342
+ preset: TWebHeaderPreset | TWebFooterPreset | null;
2343
+ max_depth: number | null;
2344
+ item_limit: number | null;
2345
+ /** Resolved branch presentation default; `sidebar`/`pills`/`none` on web menus, `null` on mobile menus. */
2346
+ children_nav: TNavigationChildrenNavMode | null;
2347
+ /** Breadcrumb trail above nested web pages; always `false` on mobile menus. */
2348
+ show_breadcrumbs: boolean;
2349
+ /** Prev/next pager on nested web pages; always `false` on mobile menus. */
2350
+ show_pager?: boolean;
2092
2351
  items: INavigationMenuItem[];
2093
2352
  }
2094
2353
  interface INavigationStartupConfig {
@@ -2109,11 +2368,174 @@ interface INavigationSearchConfig {
2109
2368
  default_visibility: string;
2110
2369
  field_policy: string;
2111
2370
  }
2371
+ /** Brand block size step; maps to logo heights 24/32/44/56px on web. */
2372
+ type TNavigationBrandingSize = 'sm' | 'md' | 'lg' | 'xl';
2373
+ /** Brand block layout: image + site name, image alone, or text alone. */
2374
+ type TNavigationBrandingVariant = 'logo-and-name' | 'logo-only' | 'name-only';
2375
+ /**
2376
+ * Global branding block shared by the web header and the mobile drawer:
2377
+ * `logo_url` = public path of the logo asset (null = text fallback),
2378
+ * `logo_alt` = accessible alt / brand text, `link_url` = logo click target
2379
+ * (null = home), `logo_size` + `logo_variant` = presentation options
2380
+ * (default `md` / `logo-and-name` when omitted by older backends).
2381
+ */
2382
+ interface INavigationBranding {
2383
+ logo_url: string | null;
2384
+ logo_alt: string | null;
2385
+ link_url: string | null;
2386
+ logo_size?: TNavigationBrandingSize;
2387
+ logo_variant?: TNavigationBrandingVariant;
2388
+ }
2389
+ /** Logo pixel heights per brand size step (shared by web header + mobile drawer). */
2390
+ declare const NAVIGATION_BRANDING_LOGO_HEIGHTS: Record<TNavigationBrandingSize, number>;
2391
+ /**
2392
+ * Resolve the branding presentation with cross-platform defaults: older
2393
+ * backends omit `logo_size` / `logo_variant`, and a missing logo image
2394
+ * degrades `logo-and-name` / `logo-only` to the text fallback.
2395
+ */
2396
+ declare function resolveBrandingPresentation(branding?: INavigationBranding | null): {
2397
+ size: TNavigationBrandingSize;
2398
+ variant: TNavigationBrandingVariant;
2399
+ logoHeight: number;
2400
+ showLogo: boolean;
2401
+ showName: boolean;
2402
+ };
2112
2403
  interface INavigationPayload {
2113
2404
  menus: Record<TNavigationMenuKey, INavigationMenu>;
2114
2405
  startup: INavigationStartupConfig;
2115
2406
  search: INavigationSearchConfig;
2407
+ branding?: INavigationBranding;
2408
+ }
2409
+
2410
+ /**
2411
+ * Global web footer presentation presets (menu-builder `web_footer` menu).
2412
+ *
2413
+ * Footer layout uses the same preset mechanism as the web header: the value is
2414
+ * stored on `navigation_menus.id_preset` and switching presets never mutates
2415
+ * menu items — `inline` flattens groups at render time only, so switching back
2416
+ * to `columns` restores the exact same groups.
2417
+ */
2418
+
2419
+ type TWebFooterPreset = 'columns' | 'inline';
2420
+ declare const WEB_FOOTER_PRESET_VALUES: readonly TWebFooterPreset[];
2421
+ declare const DEFAULT_WEB_FOOTER_PRESET: TWebFooterPreset;
2422
+ interface IWebFooterPresetOption {
2423
+ value: TWebFooterPreset;
2424
+ label: string;
2425
+ description: string;
2426
+ }
2427
+ declare const WEB_FOOTER_PRESET_OPTIONS: readonly IWebFooterPresetOption[];
2428
+ declare function isWebFooterPreset(value: unknown): value is TWebFooterPreset;
2429
+ declare function resolveWebFooterPreset(value: unknown, fallback?: TWebFooterPreset): TWebFooterPreset;
2430
+ /**
2431
+ * Flatten a footer tree for the `inline` preset: active page/external links are
2432
+ * kept in order, group children are promoted in place of their heading, and
2433
+ * inactive items or empty groups are dropped. Data is never mutated.
2434
+ */
2435
+ declare function flattenFooterItems(items: INavigationMenuItem[]): INavigationMenuItem[];
2436
+ /**
2437
+ * Footer columns for the `columns` preset: top-level groups that contain at
2438
+ * least one renderable link. Standalone (non-group) top-level links are not
2439
+ * columns — render them separately via {@link footerStandaloneItems}.
2440
+ */
2441
+ declare function footerColumnItems(items: INavigationMenuItem[]): INavigationMenuItem[];
2442
+ /** Active top-level non-group links (rendered as a trailing meta row in `columns` mode). */
2443
+ declare function footerStandaloneItems(items: INavigationMenuItem[]): INavigationMenuItem[];
2444
+ /** Renderable links inside one footer column/group. */
2445
+ declare function footerGroupLinks(group: INavigationMenuItem): INavigationMenuItem[];
2446
+
2447
+ /**
2448
+ * Web header layer helpers for double-header presets.
2449
+ *
2450
+ * `web_header` root items carry `layer: 'top' | null` (`null` = main row).
2451
+ * Double presets render two rows; single presets ignore the layer and merge
2452
+ * every root item into one row. Layer assignments are data, never destroyed by
2453
+ * switching presets — switching back to a double preset restores the split.
2454
+ */
2455
+
2456
+ declare const NAVIGATION_HEADER_LAYER_TOP: TNavigationHeaderLayer;
2457
+ interface IHeaderLayerSplit {
2458
+ /** Flat links for the top utility row (double presets only). */
2459
+ top: INavigationMenuItem[];
2460
+ /** Main navigation row items (preset-specific children rendering). */
2461
+ main: INavigationMenuItem[];
2462
+ }
2463
+ /**
2464
+ * Split root header items into top and main rows for double presets.
2465
+ * Top-row items are rendered as flat links; their children are ignored by design.
2466
+ */
2467
+ declare function splitHeaderLayers(items: INavigationMenuItem[]): IHeaderLayerSplit;
2468
+ /**
2469
+ * Merge root header items into one ordered row for single-layer presets:
2470
+ * main-row items first (position order), then top-row items appended
2471
+ * (position order). Deterministic and non-destructive — `layer` values stay
2472
+ * on the items so switching back to a double preset restores the split.
2473
+ */
2474
+ declare function mergeHeaderLayers(items: INavigationMenuItem[]): INavigationMenuItem[];
2475
+
2476
+ /**
2477
+ * `selfhelp/navigation-bundle` v2.0 — the only supported navigation bundle
2478
+ * schema. Bundles are an authoring/transfer format: optional keys mean "not
2479
+ * set" (unlike the strict runtime payload where every key is present).
2480
+ *
2481
+ * v2.0 replaces v1.0 entirely: menu `config` is gone (footer layout is a
2482
+ * preset), items carry `layer`, and translations use `aria_label` (the legacy
2483
+ * `n` key is not accepted). Imports reject any other version.
2484
+ */
2485
+
2486
+ declare const NAVIGATION_BUNDLE_FORMAT = "selfhelp/navigation-bundle";
2487
+ declare const NAVIGATION_BUNDLE_VERSION = "2.0";
2488
+ interface INavigationBundleItemTranslation {
2489
+ locale: string;
2490
+ label: string;
2491
+ description?: string | null;
2492
+ aria_label?: string | null;
2493
+ }
2494
+ interface INavigationBundleItem {
2495
+ /** Stable in-bundle reference used by children via `parent_ref`. */
2496
+ ref: string;
2497
+ parent_ref: string | null;
2498
+ item_type: TNavigationMenuItemType;
2499
+ position: number;
2500
+ is_active?: boolean;
2501
+ /** Top header row assignment (`web_header` root items only). */
2502
+ layer?: TNavigationHeaderLayer | null;
2503
+ /** Page items: target page keyword (resolved on import). */
2504
+ page_keyword?: string | null;
2505
+ /** External items: absolute URL. */
2506
+ external_url?: string | null;
2507
+ icon?: string | null;
2508
+ mobile_icon?: string | null;
2509
+ /** Default-language label cache for group/external items. */
2510
+ label?: string | null;
2511
+ translations?: INavigationBundleItemTranslation[];
2512
+ }
2513
+ interface INavigationBundleMenu {
2514
+ preset?: string | null;
2515
+ max_depth?: number | null;
2516
+ item_limit?: number | null;
2517
+ items: INavigationBundleItem[];
2518
+ }
2519
+ type TNavigationBundleExportMode = 'full_snapshot' | 'branch';
2520
+ interface INavigationBundleImportHints {
2521
+ default_keyword_prefix?: string;
2522
+ default_route_prefix?: string;
2116
2523
  }
2524
+ interface INavigationBundle {
2525
+ format: typeof NAVIGATION_BUNDLE_FORMAT;
2526
+ version: string;
2527
+ title?: string;
2528
+ description?: string;
2529
+ min_core_version?: string;
2530
+ exported_at?: string;
2531
+ core_version?: string;
2532
+ export_mode?: TNavigationBundleExportMode;
2533
+ import_hints?: INavigationBundleImportHints;
2534
+ menus: Partial<Record<TNavigationMenuKey, INavigationBundleMenu>>;
2535
+ /** Optional embedded `selfhelp/page-bundle` pages payload. */
2536
+ pages?: unknown[];
2537
+ }
2538
+ declare function isNavigationBundleVersionSupported(version: unknown): boolean;
2117
2539
 
2118
2540
  declare function collectPageIdsFromMenuItems(items: INavigationMenuItem[]): Set<number>;
2119
2541
  declare function isPageInMenuTree(items: INavigationMenuItem[], pageId: number): boolean;
@@ -2141,6 +2563,51 @@ interface IBranchNavSegment {
2141
2563
  declare function resolveBranchNavGroup(payload: INavigationPayload, currentPageId: number, menuKeys: Array<keyof INavigationPayload['menus']>): IBranchNavSegment[] | null;
2142
2564
  declare function resolveMobileSegmentGroup(payload: INavigationPayload, currentPageId: number): IBranchNavSegment[] | null;
2143
2565
  declare function resolveWebBranchNavGroup(payload: INavigationPayload, currentPageId: number): IBranchNavSegment[] | null;
2566
+ /** One breadcrumb step; group items produce unlinked crumbs (`pageId === null`). */
2567
+ interface IBreadcrumbEntry {
2568
+ label: string;
2569
+ pageId: number | null;
2570
+ keyword: string | null;
2571
+ url: string | null;
2572
+ }
2573
+ /**
2574
+ * Everything a web renderer needs to present the branch of the current page:
2575
+ * resolved presentation mode, the sidebar group, breadcrumbs, and the
2576
+ * prev/next pager. `null` when the page is a top-level leaf (no branch UI).
2577
+ */
2578
+ interface IBranchNavContext {
2579
+ /** `sidebar` | `pills` | `none` — parent-item override, else menu default, else `sidebar`. */
2580
+ mode: TNavigationChildrenNavMode;
2581
+ /** Menu-level toggle for the breadcrumb trail. */
2582
+ showBreadcrumbs: boolean;
2583
+ /** Prev/next pager — parent-item override, else menu default, else on. */
2584
+ showPager: boolean;
2585
+ /** Label of the branch parent (page or group), used as the sidebar heading. */
2586
+ heading: string | null;
2587
+ /** Branch parent as a navigable segment when the parent is a page. */
2588
+ parent: IBranchNavSegment | null;
2589
+ /** Ordered current-level group: children of the branch parent. */
2590
+ segments: IBranchNavSegment[];
2591
+ /** Menu path root → current page (current page is the last entry). */
2592
+ breadcrumbs: IBreadcrumbEntry[];
2593
+ /** Neighbours of the current page inside `segments`. */
2594
+ pager: {
2595
+ prev: IBranchNavSegment | null;
2596
+ next: IBranchNavSegment | null;
2597
+ };
2598
+ }
2599
+ /**
2600
+ * Resolve the full branch-navigation context of a web page: which presentation
2601
+ * to use (menu default + per-parent override), the sidebar group, breadcrumbs,
2602
+ * and prev/next neighbours.
2603
+ *
2604
+ * - Page with menu-visible children → the page is the branch parent, its
2605
+ * children are the group (no pager: the parent is the overview).
2606
+ * - Nested page → the parent item owns the branch, the siblings are the group,
2607
+ * the pager walks the group.
2608
+ * - Top-level leaf → `null` (no generated branch UI).
2609
+ */
2610
+ declare function resolveWebBranchNavContext(payload: INavigationPayload, currentPageId: number): IBranchNavContext | null;
2144
2611
  type TMobilePagePresentation = 'route' | 'modal';
2145
2612
  declare function resolveMobilePagePresentation(payload: INavigationPayload, pageId: number): TMobilePagePresentation;
2146
2613
  declare function isOnAnyMobileMenuFromPayload(payload: INavigationPayload, pageId: number): boolean;
@@ -2170,6 +2637,12 @@ declare function getNavigationItemKeyword(item: INavigationMenuItem): string | n
2170
2637
  * Wave 1 uses keyword-based routes (`[keyword].tsx`), not file `[...slug]`
2171
2638
  * segments. Nested public URLs (`/parent/child`) still navigate by keyword.
2172
2639
  */
2640
+ /**
2641
+ * Substitute `{param}` placeholders in a CMS page URL template using route
2642
+ * params (snake_case keys). Returns null when the template or params are
2643
+ * incomplete.
2644
+ */
2645
+ declare function buildPublicPathFromRoute(urlTemplate: string | null | undefined, routeParams: Record<string, string | undefined>): string | null;
2173
2646
  declare function pageUrlToMobileRoute(url: string | null | undefined, keyword: string): string;
2174
2647
 
2175
2648
  /**
@@ -2242,6 +2715,28 @@ declare function resolveMenuMaxDepth(maxDepth: number | null | undefined): numbe
2242
2715
  */
2243
2716
  declare function clampMenuItemsAtDepth(items: INavigationMenuItem[], maxDepth: number | null, depth?: number): INavigationMenuItem[];
2244
2717
 
2718
+ /**
2719
+ * Single active-state/active-trail implementation for every menu renderer:
2720
+ * web burger drawer, mobile drawer, and mobile bottom tabs all resolve
2721
+ * "is this item (or one of its descendants) the current page?" here.
2722
+ */
2723
+
2724
+ /** Expo Router href for a resolved menu item (mobile keyword routes). */
2725
+ declare function getNavigationItemMobileHref(item: INavigationMenuItem): string;
2726
+ /** Web pathname match: exact or a nested path under the item href. */
2727
+ declare function matchesWebPath(href: string, pathname: string): boolean;
2728
+ /** Mobile pathname match: exact, `/index` root aliases, or nested path. */
2729
+ declare function matchesMobilePath(href: string, pathname: string): boolean;
2730
+ /** True when the item or any descendant matches the current web pathname. */
2731
+ declare function isMenuItemActiveOnWeb(item: INavigationMenuItem, pathname: string): boolean;
2732
+ /** True when the item or any descendant matches the current mobile pathname. */
2733
+ declare function isMenuItemActiveOnMobile(item: INavigationMenuItem, pathname: string): boolean;
2734
+ /**
2735
+ * Ids of every item whose subtree contains the active page — the set of
2736
+ * parents a collapsible drawer should auto-expand for the current route.
2737
+ */
2738
+ declare function expandedIdsForActiveTrail(items: INavigationMenuItem[], pathname: string, platform: 'web' | 'mobile'): Set<number>;
2739
+
2245
2740
  /**
2246
2741
  * Parse the unified `spacing` field. The CMS
2247
2742
  * stores this as a JSON string with optional keys for each side:
@@ -2306,4 +2801,4 @@ declare function transformPageData(apiPage: IRawPage): IPageItem;
2306
2801
  */
2307
2802
  declare function transformPagesData(pages: IRawPage[] | null | undefined): IPageItem[];
2308
2803
 
2309
- export { API_VERSION_PREFIX, type AdvisoryAffected, type AdvisoryFeed, type AdvisorySeverity, type BackupManifest, type BackupRetentionPolicy, type BackupSchedulePolicy, type BundledPluginRef, CLASS_PATTERNS, CLASS_REMAP, CLIENT_TYPE_MOBILE, CLIENT_TYPE_MOBILE_AND_WEB, CLIENT_TYPE_WEB, COLOR_NAMES, type CheckSeverity, type CompatibilityRules, type CoreRelease, DEFAULT_MOBILE_ICON, DEFAULT_WEB_HEADER_PRESET, type DatabaseMigrationMetadata, ENDPOINTS, type FrontendRelease, HEADER_CLIENT_TYPE, type IApiError, type IApiMeta, type IAssetSource, type IBaseApiResponse, type IBasePageInfo, type IBasePageSection, type IBranchNavSegment, type IClassPattern, type IClassRemap, type ICompatibilityError, type IConditionContext, IContentField, type IEvaluatedCondition, type IForgotPasswordRequest, type IForgotPasswordResponse, type IFormDeleteRequest, type IFormDeleteResponse, type IFormResultLegacyFields, type IFormSubmitData, type IFormSubmitRequest, type IFormSubmitResponse, type IFormUpdateData, type IFormUpdateRequest, type IFormUpdateResponse, type IFrontendUpdatePreflight, type IFrontendUpdatePreflightResponse, type IFrontendUpdateReleases, type IFrontendUpdateReleasesResponse, type IFrontendUpdateRequest, type IFrontendUpdateRequestResponse, type IGetPageResponse, type IGetPagesResponse, type IInlineNode, type IJwtPayload, type ILanguage, type ILanguageItem, type ILanguagePreference, type ILanguagePreferenceUpdateResponse, type ILanguagesResponse, type ILoginRequest, type ILoginSuccessData, type ILoginSuccessResponse, type ILogoutSuccessResponse, type IMaintenanceSetRequest, type IMenuSearchHit, type IMeta, type IMobileAdapterBaseProps, type IMobileButtonProps, type IMobileCardProps, type IMobileCheckboxProps, type IMobileContainerProps, type IMobileIconEntry, type IMobileInputProps, type IMobileModalProps, type IMobilePreviewExchangeData, type IMobilePreviewExchangeRequest, type IMobilePreviewExchangeResponse, type IMobilePreviewSessionData, type IMobilePreviewSessionRequest, type IMobilePreviewSessionResponse, type IMobilePreviewUpdatePreflight, type IMobilePreviewUpdatePreflightResponse, type IMobilePreviewUpdateReleases, type IMobilePreviewUpdateReleasesResponse, type IMobilePreviewUpdateRequest, type IMobilePreviewUpdateRequestResponse, type IMobileSelectOption, type IMobileSelectProps, type IMobileSwitchProps, type IMobileTextProps, type IMobileTextareaProps, type IMobileUiAdapters, type INavigationMenu, type INavigationMenuItem, type INavigationPayload, type INavigationResolvedPageRef, type INavigationSearchConfig, type INavigationStartupConfig, type IPageAccessTypeInfo, type IPageContent, type IPageField, type IPageFieldTranslation, type IPageFieldsData, type IPageItem, type IPageRoute, type IPageSectionWithFields, type IPageSectionsData, type IPreviewNavigateCommand, type IPreviewNavigatedMessage, type IPreviewPreferences, type IPreviewPreferencesChangedMessage, type IPreviewReadyMessage, type IPreviewSetPreferencesCommand, type IRefreshRequest, type IRefreshSuccessResponse, type IResetPasswordRequest, type IResetPasswordResponse, type IResolvePageResponse, type ISpacingValue, type ISystemAdvisories, type ISystemAdvisoriesResponse, type ISystemAdvisory, type ISystemAdvisoryAffected, type ISystemHealth, type ISystemHealthComponent, type ISystemHealthResponse, type ISystemInstalledPlugin, type ISystemMaintenance, type ISystemMaintenanceResponse, type ISystemVersion, type ISystemVersionResponse, type ITwoFactorRequiredData, type ITwoFactorRequiredResponse, type ITwoFactorVerifyRequest, type ITwoFactorVerifySuccessResponse, type IUpdatePreflight, type IUpdatePreflightCheck, type IUpdatePreflightOption, type IUpdatePreflightResponse, type IUpdateRelease, type IUpdateReleases, type IUpdateReleasesResponse, type IUpdateRequest, type IUpdateRequestResponse, type IUpdateStatus, type IUpdateStatusManager, type IUpdateStatusResponse, type IUpdateStep, type IUserData, type IUserDataResponse, type IWebHeaderPresetOption, type ImageRef, type InstalledPlugin, type InstanceImages, type InstanceLock, type InstanceManifest, type InstanceMode, type InstanceResourceConfig, type InstanceRouting, type InstanceStatus, type InstanceVersions, type InventoryInstanceEntry, LITERAL_CLASSES, type LockPluginEntry, type LockServiceEntry, MOBILE_ICON_NAMES, MOBILE_ICON_SET, MOBILE_PREVIEW_ENDPOINTS, type MobilePreviewRelease, PERMISSIONS, PREVIEW_BRIDGE_MESSAGE, PREVIEW_PARENT_ORIGIN_PARAM, PREVIEW_SHELL_PARAM, type PluginRelease, type PreflightCheck, type PreflightOption, type PreflightStatus, RELEASE_CHANNELS, type RegistryIndex, type RegistryReleaseRef, type ReleaseChannel, type RuntimeServicePolicy, type RuntimeServiceRange, SIZE_VALUES, SPACING_VALUES, SYSTEM_ENDPOINTS, type SchedulerRelease, type SecurityAdvisory, type ServerInventory, type ServiceBackendCompatibility, type SignatureBlock, type SupportBundleMeta, type TCalcedValues, type TClassDecision, type TClientType, THeroUiButtonVariant, THeroUiSize, TMobileButtonFeedback, TMobileFieldVariant, type TMobilePagePresentation, TMobileSelectPresentation, type TNavigationChildSource, type TNavigationMenuItemType, type TNavigationMenuKey, type TNavigationMobileStartSource, type TNavigationSearchMode, type TNavigationStartMode, type TPermission, type TPlatform, type TPreviewBridgeMessage, type TPreviewBridgeMessageType, type TPreviewColorScheme, type TPreviewFrameSource, TStyleName, type TSystemAdvisorySeverity, type TSystemComponentStatus, type TSystemDeployment, type TSystemHealthOverall, type TUpdateCheckSeverity, type TUpdateKind, type TUpdateOperationStatus, type TUpdatePreflightStatus, type TWebHeaderPreset, type TrustLevel, type TrustedKey, type TrustedKeysFile, type UpdatePreflightResult, WEB_HEADER_PRESET_OPTIONS, WEB_HEADER_PRESET_VALUES, type WorkerRelease, arePreviewPreferencesEqual, buildConditionContext, clampMenuItemsAtDepth, classifyClass, classifyClassString, collectPageIdsFromMenuItems, evaluateCondition, findMenuItemByPageId, findNearestBottomTabMenuItemForPage, findPageRefInNavigationPayload, findRemap, flattenMenuItems, flattenNavigationMenuItems, getNavigationItemAriaLabel, getNavigationItemHref, getNavigationItemKeyword, getNavigationItemLabel, hasInlineFormatting, isBottomTabMenuItemActive, isMobileIconName, isOnAnyMobileMenu, isOnAnyMobileMenuFromPayload, isPageInMenuTree, isPageInResolvedMenus, isPageOnAnyMenu, isPageOnMobileMenu, isPageOnWebMenu, isPreviewBridgeMessage, isWebHeaderPreset, pageUrlToMobileRoute, parseInlineRich, parseSpacing, previewKeywordFromPath, replaceCalcedValues, resolveAssetSources, resolveAssetUrl, resolveBranchNavGroup, resolveHolderRedirectPath, resolveMenuMaxDepth, resolveMobileIcon, resolveMobilePagePresentation, resolveMobileSegmentGroup, resolveMobileStartupKeyword, resolveMobileStartupRoute, resolveWebBranchNavGroup, resolveWebHeaderPreset, resolveWebStartupPath, searchMenuPagesInPayload, spacingToClasses, stripHtmlToText, transformPageData, transformPagesData };
2804
+ export { API_VERSION_PREFIX, type AdvisoryAffected, type AdvisoryFeed, type AdvisorySeverity, type BackupManifest, type BackupRetentionPolicy, type BackupSchedulePolicy, type BundledPluginRef, CLASS_PATTERNS, CLASS_REMAP, CLIENT_TYPE_MOBILE, CLIENT_TYPE_MOBILE_AND_WEB, CLIENT_TYPE_WEB, CMS_APP_PRIMARY_ROLES, CMS_APP_ROLES, COLOR_NAMES, type CheckSeverity, type CompatibilityRules, type CoreRelease, DEFAULT_MOBILE_ICON, DEFAULT_WEB_FOOTER_PRESET, DEFAULT_WEB_HEADER_PRESET, type DatabaseMigrationMetadata, ENDPOINTS, FIELDS_MAP_STYLE_CONFIG, FORM_RECORD_PREFILL_SKIP_FIELDS, type FrontendRelease, HEADER_CLIENT_TYPE, type IApiError, type IApiMeta, type IAssetSource, type IBaseApiResponse, type IBasePageInfo, type IBasePageSection, type IBranchNavContext, type IBranchNavSegment, type IBreadcrumbEntry, type IClassPattern, type IClassRemap, type ICmsApp, type ICmsAppAssignedPage, type ICmsAppDetail, type ICmsAppPage, type ICmsAppSummary, type ICompatibilityError, type IConditionContext, IContentField, type IEvaluatedCondition, type IFieldsMapStyleConfig, type IForgotPasswordRequest, type IForgotPasswordResponse, type IFormDeleteRequest, type IFormDeleteResponse, type IFormRecordPrefill, type IFormRecordPrefillChild, type IFormRecordPrefillSection, type IFormRecordPrefillTranslatedValue, type IFormResultLegacyFields, type IFormSubmitData, type IFormSubmitRequest, type IFormSubmitResponse, type IFormUpdateData, type IFormUpdateRequest, type IFormUpdateResponse, type IFrontendUpdatePreflight, type IFrontendUpdatePreflightResponse, type IFrontendUpdateReleases, type IFrontendUpdateReleasesResponse, type IFrontendUpdateRequest, type IFrontendUpdateRequestResponse, type IGetPageResponse, type IGetPagesResponse, type IHeaderLayerSplit, type IInlineNode, type IJwtPayload, type ILanguage, type ILanguageItem, type ILanguagePreference, type ILanguagePreferenceUpdateResponse, type ILanguagesResponse, type ILoginRequest, type ILoginSuccessData, type ILoginSuccessResponse, type ILogoutSuccessResponse, type IMaintenanceSetRequest, type IMenuSearchHit, type IMeta, type IMobileAdapterBaseProps, type IMobileButtonProps, type IMobileCardProps, type IMobileCheckboxProps, type IMobileContainerProps, type IMobileIconEntry, type IMobileInputProps, type IMobileModalProps, type IMobilePreviewExchangeData, type IMobilePreviewExchangeRequest, type IMobilePreviewExchangeResponse, type IMobilePreviewSessionData, type IMobilePreviewSessionRequest, type IMobilePreviewSessionResponse, type IMobilePreviewUpdatePreflight, type IMobilePreviewUpdatePreflightResponse, type IMobilePreviewUpdateReleases, type IMobilePreviewUpdateReleasesResponse, type IMobilePreviewUpdateRequest, type IMobilePreviewUpdateRequestResponse, type IMobileSelectOption, type IMobileSelectProps, type IMobileSwitchProps, type IMobileTextProps, type IMobileTextareaProps, type IMobileUiAdapters, type INavigationBranding, type INavigationBundle, type INavigationBundleImportHints, type INavigationBundleItem, type INavigationBundleItemTranslation, type INavigationBundleMenu, type INavigationMenu, type INavigationMenuItem, type INavigationPayload, type INavigationResolvedPageRef, type INavigationSearchConfig, type INavigationStartupConfig, type IOptionCatalogEntry, type IOptionLabelMap, type IOptionStyleConfig, type IPageAccessTypeInfo, type IPageContent, type IPageField, type IPageFieldTranslation, type IPageFieldsData, type IPageItem, type IPageRoute, type IPageSectionWithFields, type IPageSectionsData, type IPagesResolveParams, type IPreviewNavigateCommand, type IPreviewNavigatedMessage, type IPreviewPreferences, type IPreviewPreferencesChangedMessage, type IPreviewReadyMessage, type IPreviewSetPreferencesCommand, type IRefreshRequest, type IRefreshSuccessResponse, type IResetPasswordRequest, type IResetPasswordResponse, type IResolvePageResponse, type IResolvedOption, type ISpacingValue, type ISystemAdvisories, type ISystemAdvisoriesResponse, type ISystemAdvisory, type ISystemAdvisoryAffected, type ISystemHealth, type ISystemHealthComponent, type ISystemHealthResponse, type ISystemInstalledPlugin, type ISystemMaintenance, type ISystemMaintenanceResponse, type ISystemVersion, type ISystemVersionResponse, type ITwoFactorRequiredData, type ITwoFactorRequiredResponse, type ITwoFactorVerifyRequest, type ITwoFactorVerifySuccessResponse, type IUpdatePreflight, type IUpdatePreflightCheck, type IUpdatePreflightOption, type IUpdatePreflightResponse, type IUpdateRelease, type IUpdateReleases, type IUpdateReleasesResponse, type IUpdateRequest, type IUpdateRequestResponse, type IUpdateStatus, type IUpdateStatusManager, type IUpdateStatusResponse, type IUpdateStep, type IUserData, type IUserDataResponse, type IWebFooterPresetOption, type IWebHeaderPresetOption, type ImageRef, type InstalledPlugin, type InstanceImages, type InstanceLock, type InstanceManifest, type InstanceMode, type InstanceResourceConfig, type InstanceRouting, type InstanceStatus, type InstanceVersions, type InventoryInstanceEntry, LITERAL_CLASSES, type LockPluginEntry, type LockServiceEntry, MOBILE_ICON_NAMES, MOBILE_ICON_SET, MOBILE_PREVIEW_ENDPOINTS, type MobilePreviewRelease, NAVIGATION_BRANDING_LOGO_HEIGHTS, NAVIGATION_BUNDLE_FORMAT, NAVIGATION_BUNDLE_VERSION, NAVIGATION_HEADER_LAYER_TOP, OPTION_STYLE_CONFIGS, PERMISSIONS, PREVIEW_BRIDGE_MESSAGE, PREVIEW_PARENT_ORIGIN_PARAM, PREVIEW_SHELL_PARAM, type PluginRelease, type PreflightCheck, type PreflightOption, type PreflightStatus, RELEASE_CHANNELS, type RegistryIndex, type RegistryReleaseRef, type ReleaseChannel, type RuntimeServicePolicy, type RuntimeServiceRange, SIZE_VALUES, SPACING_VALUES, SYSTEM_ENDPOINTS, type SchedulerRelease, type SecurityAdvisory, type ServerInventory, type ServiceBackendCompatibility, type SignatureBlock, type SupportBundleMeta, type TCalcedValues, type TClassDecision, type TClientType, type TCmsAppRole, type TFormRecordPrefillFieldValue, THeroUiButtonVariant, THeroUiSize, TMobileButtonFeedback, TMobileFieldVariant, type TMobilePagePresentation, TMobileSelectPresentation, type TNavigationBrandingSize, type TNavigationBrandingVariant, type TNavigationBundleExportMode, type TNavigationChildrenNavMode, type TNavigationHeaderLayer, type TNavigationMenuItemType, type TNavigationMenuKey, type TNavigationMobileStartSource, type TNavigationSearchMode, type TNavigationStartMode, type TOptionStyleName, type TPermission, type TPlatform, type TPreviewBridgeMessage, type TPreviewBridgeMessageType, type TPreviewColorScheme, type TPreviewFrameSource, TStyleName, type TSystemAdvisorySeverity, type TSystemComponentStatus, type TSystemDeployment, type TSystemHealthOverall, type TUpdateCheckSeverity, type TUpdateKind, type TUpdateOperationStatus, type TUpdatePreflightStatus, type TWebFooterPreset, type TWebHeaderPreset, type TrustLevel, type TrustedKey, type TrustedKeysFile, type UpdatePreflightResult, WEB_FOOTER_PRESET_OPTIONS, WEB_FOOTER_PRESET_VALUES, WEB_HEADER_PRESET_OPTIONS, WEB_HEADER_PRESET_VALUES, type WorkerRelease, arePreviewPreferencesEqual, buildConditionContext, buildPagesResolvePath, buildPagesResolveQuery, buildPagesResolveUrl, buildPublicPathFromRoute, clampMenuItemsAtDepth, classifyClass, classifyClassString, collectPageIdsFromMenuItems, evaluateCondition, expandedIdsForActiveTrail, findMenuItemByPageId, findNearestBottomTabMenuItemForPage, findPageRefInNavigationPayload, findRemap, flattenFooterItems, flattenFormRecordPrefillValues, flattenMenuItems, flattenNavigationMenuItems, footerColumnItems, footerGroupLinks, footerStandaloneItems, getNavigationItemAriaLabel, getNavigationItemHref, getNavigationItemKeyword, getNavigationItemLabel, getNavigationItemMobileHref, hasInlineFormatting, isBottomTabMenuItemActive, isDoubleWebHeaderPreset, isMenuItemActiveOnMobile, isMenuItemActiveOnWeb, isMobileIconName, isNavigationBundleVersionSupported, isOnAnyMobileMenu, isOnAnyMobileMenuFromPayload, isPageInMenuTree, isPageInResolvedMenus, isPageOnAnyMenu, isPageOnMobileMenu, isPageOnWebMenu, isPreviewBridgeMessage, isWebFooterPreset, isWebHeaderPreset, matchesMobilePath, matchesWebPath, mergeHeaderLayers, normalizePagesResolvePath, pageUrlToMobileRoute, parseFieldsMapCatalog, parseFieldsMapLabels, parseFormRecordPrefill, parseInlineRich, parseOptionCatalog, parseOptionCodes, parseOptionLabels, parseSpacing, previewKeywordFromPath, replaceCalcedValues, resolveAssetSources, resolveAssetUrl, resolveBranchNavGroup, resolveBrandingPresentation, resolveFieldsMapLabel, resolveHolderRedirectPath, resolveMenuMaxDepth, resolveMobileIcon, resolveMobilePagePresentation, resolveMobileSegmentGroup, resolveMobileStartupKeyword, resolveMobileStartupRoute, resolveOptionCodesLabels, resolveOptionLabel, resolveOptionValueLabels, resolveOptions, resolveWebBranchNavContext, resolveWebBranchNavGroup, resolveWebFooterPreset, resolveWebHeaderPreset, resolveWebStartupPath, searchMenuPagesInPayload, serializeFieldsMapCatalog, serializeFieldsMapLabels, spacingToClasses, splitHeaderLayers, stripHtmlToText, transformPageData, transformPagesData };