@selfhelp/shared 1.17.1 → 1.19.0
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/CHANGELOG.md +37 -0
- package/dist/index.d.mts +168 -1
- package/dist/index.d.ts +168 -1
- package/dist/index.js +194 -1
- package/dist/index.mjs +174 -1
- package/package.json +1 -1
- package/src/api/__tests__/endpoints.test.ts +23 -0
- package/src/api/endpoints.ts +7 -0
- package/src/index.ts +1 -0
- package/src/navigation/__tests__/navigation.test.ts +106 -0
- package/src/navigation/index.ts +12 -0
- package/src/navigation/menuVisibility.ts +38 -0
- package/src/navigation/mobileIcons.ts +86 -0
- package/src/navigation/navRender.ts +132 -0
- package/src/types/api/__tests__/page-routing.test.ts +110 -0
- package/src/types/api/page.ts +7 -0
- package/src/types/pages.ts +44 -0
- package/src/utils/__tests__/transformPageData.test.ts +23 -0
- package/src/utils/transformPageData.ts +17 -0
package/CHANGELOG.md
CHANGED
|
@@ -9,6 +9,43 @@ All notable changes to `@selfhelp/shared` will be documented in this file.
|
|
|
9
9
|
|
|
10
10
|
This project follows semantic versioning.
|
|
11
11
|
|
|
12
|
+
## v1.19.0
|
|
13
|
+
|
|
14
|
+
**Navigation rendering + page icons contract (navigation pages)** — additive
|
|
15
|
+
contracts for the configurable navigation-rendering model and the web/mobile
|
|
16
|
+
page-icon fields. `IPageItem` and `IPageContent` (`src/types/pages.ts`) gain the
|
|
17
|
+
optional `icon`, `mobile_icon`, `web_nav_render`, and `mobile_nav_render`
|
|
18
|
+
fields, and `transformPageData` now passes them through. A new `navigation`
|
|
19
|
+
module (`src/navigation/`) is exported from the package root with:
|
|
20
|
+
|
|
21
|
+
- `TWebNavRender` (`header-dropdown | tabs | sidebar-drawer | hero-cards`) and
|
|
22
|
+
`TMobileNavRender` (`segmented-tabs | bottom-tabs | drawer | hero-cards`) plus
|
|
23
|
+
their value lists, defaults (`DEFAULT_WEB_NAV_RENDER` = `tabs`,
|
|
24
|
+
`DEFAULT_MOBILE_NAV_RENDER` = `segmented-tabs`, global defaults
|
|
25
|
+
`header-dropdown` / `bottom-tabs`), option metadata (`WEB_NAV_RENDER_OPTIONS`,
|
|
26
|
+
`MOBILE_NAV_RENDER_OPTIONS`), and `resolveWebNavRender` / `resolveMobileNavRender`.
|
|
27
|
+
- The curated mobile icon set (`MOBILE_ICON_SET`, `MOBILE_ICON_NAMES`,
|
|
28
|
+
`DEFAULT_MOBILE_ICON`, `resolveMobileIcon`) — lucide names shared by the admin
|
|
29
|
+
picker and the mobile renderer so they never drift.
|
|
30
|
+
- The shared menu-visibility predicate (`isMenuVisible`,
|
|
31
|
+
`getMenuVisibleChildren`, `isNavigationPage`) used by web + mobile menus and by
|
|
32
|
+
the automatic virtual-navigation decision.
|
|
33
|
+
|
|
34
|
+
All additions are optional/new, so `^1.x` consumers are unaffected.
|
|
35
|
+
|
|
36
|
+
## v1.18.0
|
|
37
|
+
|
|
38
|
+
**DB-driven public routing types (issue #30)** — additive contracts for the new
|
|
39
|
+
backend public-routing resolver. `IPageContent` (`src/types/pages.ts`) gains the
|
|
40
|
+
optional route metadata `route_params` (`Record<string, string>`),
|
|
41
|
+
`matched_url_pattern`, and `canonical_url`; a new `IResolvePageResponse`
|
|
42
|
+
(`src/types/api/page.ts`) types the `GET /cms-api/v1/pages/resolve` payload; and
|
|
43
|
+
`PAGES.RESOLVE` is added to the endpoint registry (`src/api/endpoints.ts`). The
|
|
44
|
+
resolved dynamic URL params surface to interpolation as `{{route.<snake_case>}}`.
|
|
45
|
+
|
|
46
|
+
All additions are optional/new, so `^1.x` consumers are unaffected. Pairs with
|
|
47
|
+
core `0.1.31`, frontend `0.1.57`, and mobile `0.1.31`.
|
|
48
|
+
|
|
12
49
|
## v1.17.1
|
|
13
50
|
|
|
14
51
|
**`IShowUserInputStyle.field_labels`** — adds the optional header map
|
package/dist/index.d.mts
CHANGED
|
@@ -7,6 +7,56 @@ export { COLOR_PALETTE, COLOR_SCALES, CONTAINER_SIZE_PX, FONT_SIZE_PX, FULL_RADI
|
|
|
7
7
|
export { TAnyStyleName, TPluginStyleImplMap, TStyleImplMap, getRegistryEntry, getRegistryEntryAny, getStylePlacement, getStylePlatforms, getStylePluginId, isKnownStyleName, isRegisteredStyleName, isStyleAllowedOnPage, isStylePlacementAllowed, isStyleSupportedOnPlatform, setToStylePlatform, stylePlatformToSet } from './registry/index.mjs';
|
|
8
8
|
export { sharedTailwindExtend, sharedTailwindPreset } from './theme/tailwind.mjs';
|
|
9
9
|
|
|
10
|
+
/**
|
|
11
|
+
* Navigation rendering contract (shared by web + mobile).
|
|
12
|
+
*
|
|
13
|
+
* The page TREE defines navigation STRUCTURE (parent/child + `nav_position`).
|
|
14
|
+
* A per-page render type controls PRESENTATION only — it never changes the
|
|
15
|
+
* structure or the URLs. Web and mobile each pick their own renderer from the
|
|
16
|
+
* stored value, so the same subtree can render differently per platform.
|
|
17
|
+
*
|
|
18
|
+
* - `web_nav_render` selects the web renderer for a page's children.
|
|
19
|
+
* - `mobile_nav_render` selects the mobile renderer for a page's children.
|
|
20
|
+
*
|
|
21
|
+
* Both fields are OPTIONAL on a page; when unset the platform applies its
|
|
22
|
+
* default (web `tabs`, mobile `segmented-tabs` for a navigation page's
|
|
23
|
+
* children; the GLOBAL app menu defaults to web `header-dropdown` and mobile
|
|
24
|
+
* `bottom-tabs`).
|
|
25
|
+
*/
|
|
26
|
+
type TWebNavRender = 'header-dropdown' | 'tabs' | 'sidebar-drawer' | 'hero-cards';
|
|
27
|
+
type TMobileNavRender = 'segmented-tabs' | 'bottom-tabs' | 'drawer' | 'hero-cards';
|
|
28
|
+
declare const WEB_NAV_RENDER_VALUES: readonly TWebNavRender[];
|
|
29
|
+
declare const MOBILE_NAV_RENDER_VALUES: readonly TMobileNavRender[];
|
|
30
|
+
/** Default renderer for a navigation page's CHILDREN. */
|
|
31
|
+
declare const DEFAULT_WEB_NAV_RENDER: TWebNavRender;
|
|
32
|
+
declare const DEFAULT_MOBILE_NAV_RENDER: TMobileNavRender;
|
|
33
|
+
/** Default renderer for the GLOBAL app menu (header / shell). */
|
|
34
|
+
declare const DEFAULT_WEB_GLOBAL_NAV_RENDER: TWebNavRender;
|
|
35
|
+
declare const DEFAULT_MOBILE_GLOBAL_NAV_RENDER: TMobileNavRender;
|
|
36
|
+
interface INavRenderOption<T extends string> {
|
|
37
|
+
value: T;
|
|
38
|
+
/** Friendly label for the admin select. */
|
|
39
|
+
label: string;
|
|
40
|
+
/** Short, plain-language explanation shown under the select. */
|
|
41
|
+
description: string;
|
|
42
|
+
}
|
|
43
|
+
/** Option metadata for the admin "Web menu style" select. */
|
|
44
|
+
declare const WEB_NAV_RENDER_OPTIONS: readonly INavRenderOption<TWebNavRender>[];
|
|
45
|
+
/** Option metadata for the admin "Mobile menu style" select. */
|
|
46
|
+
declare const MOBILE_NAV_RENDER_OPTIONS: readonly INavRenderOption<TMobileNavRender>[];
|
|
47
|
+
declare function isWebNavRender(value: unknown): value is TWebNavRender;
|
|
48
|
+
declare function isMobileNavRender(value: unknown): value is TMobileNavRender;
|
|
49
|
+
/**
|
|
50
|
+
* Resolve a stored `web_nav_render` value to a concrete renderer, falling back
|
|
51
|
+
* to the supplied default (page-children default by default).
|
|
52
|
+
*/
|
|
53
|
+
declare function resolveWebNavRender(value: unknown, fallback?: TWebNavRender): TWebNavRender;
|
|
54
|
+
/**
|
|
55
|
+
* Resolve a stored `mobile_nav_render` value to a concrete renderer, falling
|
|
56
|
+
* back to the supplied default (page-children default by default).
|
|
57
|
+
*/
|
|
58
|
+
declare function resolveMobileNavRender(value: unknown, fallback?: TMobileNavRender): TMobileNavRender;
|
|
59
|
+
|
|
10
60
|
/**
|
|
11
61
|
* Comprehensive page type system, single source of truth for both apps.
|
|
12
62
|
*/
|
|
@@ -62,6 +112,14 @@ interface IPageItem extends IBasePageInfo {
|
|
|
62
112
|
id_page_access_types?: number;
|
|
63
113
|
title?: string | null;
|
|
64
114
|
description?: string | null;
|
|
115
|
+
/** Web menu icon (Tabler component name, e.g. `IconHome`). Page property field `icon`. */
|
|
116
|
+
icon?: string | null;
|
|
117
|
+
/** Mobile menu icon (curated lucide name, e.g. `Home`). Page property field `mobile_icon`. */
|
|
118
|
+
mobile_icon?: string | null;
|
|
119
|
+
/** How this page renders its children as navigation on web. Page property field `web_nav_render`. */
|
|
120
|
+
web_nav_render?: TWebNavRender | null;
|
|
121
|
+
/** How this page renders its children as navigation on mobile. Page property field `mobile_nav_render`. */
|
|
122
|
+
mobile_nav_render?: TMobileNavRender | null;
|
|
65
123
|
children?: IPageItem[];
|
|
66
124
|
}
|
|
67
125
|
interface IPageContent {
|
|
@@ -74,8 +132,42 @@ interface IPageContent {
|
|
|
74
132
|
footer_position: number | null;
|
|
75
133
|
title?: string | null;
|
|
76
134
|
description?: string | null;
|
|
135
|
+
/** Web menu icon (Tabler component name). Mirrors the `icon` page property field. */
|
|
136
|
+
icon?: string | null;
|
|
137
|
+
/** Mobile menu icon (curated lucide name). Mirrors the `mobile_icon` page property field. */
|
|
138
|
+
mobile_icon?: string | null;
|
|
139
|
+
/** Web child-navigation render type. Mirrors the `web_nav_render` page property field. */
|
|
140
|
+
web_nav_render?: TWebNavRender | null;
|
|
141
|
+
/** Mobile child-navigation render type. Mirrors the `mobile_nav_render` page property field. */
|
|
142
|
+
mobile_nav_render?: TMobileNavRender | null;
|
|
143
|
+
/**
|
|
144
|
+
* Snake_case route params extracted from the matched public URL pattern
|
|
145
|
+
* (e.g. `{ user_id: '42', token: 'abc' }` or `{ record_id: '7' }`). Present
|
|
146
|
+
* only when the page was resolved via `GET /pages/resolve`. Backend also
|
|
147
|
+
* exposes these to interpolation as `{{route.<name>}}`.
|
|
148
|
+
*/
|
|
149
|
+
route_params?: Record<string, string>;
|
|
150
|
+
/** The `page_routes` pattern that matched (e.g. `/reset/{user_id}/{token}`). Resolve responses only. */
|
|
151
|
+
matched_url_pattern?: string | null;
|
|
152
|
+
/** The canonical active route pattern for the page, for canonical-link generation. Resolve responses only. */
|
|
153
|
+
canonical_url?: string | null;
|
|
77
154
|
sections: IPageSectionWithFields[];
|
|
78
155
|
}
|
|
156
|
+
/**
|
|
157
|
+
* A public, parameterized route contract for a CMS page (issue #30). Mirrors a
|
|
158
|
+
* backend `page_routes` row. `path_pattern` uses Symfony route syntax
|
|
159
|
+
* (`/team/{record_id}`) and `requirements` maps each placeholder to a regex
|
|
160
|
+
* (`{ record_id: '\\d+' }`). Param names are snake_case and are NEVER remapped
|
|
161
|
+
* on export/import. Used by the admin page-routes editor and page export/import.
|
|
162
|
+
*/
|
|
163
|
+
interface IPageRoute {
|
|
164
|
+
id?: number;
|
|
165
|
+
path_pattern: string;
|
|
166
|
+
requirements?: Record<string, string> | null;
|
|
167
|
+
is_canonical: boolean;
|
|
168
|
+
is_active: boolean;
|
|
169
|
+
priority: number;
|
|
170
|
+
}
|
|
79
171
|
interface IPageFieldTranslation {
|
|
80
172
|
language_id: number;
|
|
81
173
|
language_code: string;
|
|
@@ -370,6 +462,14 @@ type IGetPageResponse = IBaseApiResponse<{
|
|
|
370
462
|
page: IPageContent;
|
|
371
463
|
}>;
|
|
372
464
|
type IGetPagesResponse = IBaseApiResponse<IPageItem[]>;
|
|
465
|
+
/**
|
|
466
|
+
* Response of `GET /cms-api/v1/pages/resolve?path=...` (issue #30). Identical
|
|
467
|
+
* envelope to {@link IGetPageResponse}; the resolved `page` additionally carries
|
|
468
|
+
* `route_params`, `matched_url_pattern`, and `canonical_url`.
|
|
469
|
+
*/
|
|
470
|
+
type IResolvePageResponse = IBaseApiResponse<{
|
|
471
|
+
page: IPageContent;
|
|
472
|
+
}>;
|
|
373
473
|
|
|
374
474
|
/**
|
|
375
475
|
* System maintenance / update contracts (SelfHelp Manager <-> CMS <-> admin UI).
|
|
@@ -1705,6 +1805,12 @@ declare const ENDPOINTS: {
|
|
|
1705
1805
|
readonly LIST_WITH_LANGUAGE: (languageId: number) => string;
|
|
1706
1806
|
readonly BY_KEYWORD: (keyword: string) => string;
|
|
1707
1807
|
readonly BY_ID: (pageId: number) => string;
|
|
1808
|
+
/**
|
|
1809
|
+
* DB-driven public path resolution (issue #30): maps a full public URL
|
|
1810
|
+
* path (e.g. `/reset/42/abc`, `/team/7`) to a page payload + route
|
|
1811
|
+
* params. `path` is sent URL-encoded as a query parameter.
|
|
1812
|
+
*/
|
|
1813
|
+
readonly RESOLVE: (path: string) => string;
|
|
1708
1814
|
};
|
|
1709
1815
|
readonly LANGUAGES: "/cms-api/v1/languages";
|
|
1710
1816
|
readonly FORMS: {
|
|
@@ -1961,6 +2067,55 @@ declare function hasInlineFormatting(value: string | null | undefined): boolean;
|
|
|
1961
2067
|
*/
|
|
1962
2068
|
declare function stripHtmlToText(value: string | null | undefined): string;
|
|
1963
2069
|
|
|
2070
|
+
/**
|
|
2071
|
+
* Curated mobile icon set — the SINGLE source of truth shared by the admin
|
|
2072
|
+
* `select-icon-mobile` picker (web frontend, drawn with `lucide-react`) and the
|
|
2073
|
+
* mobile menu renderers (drawn with `lucide-react-native`).
|
|
2074
|
+
*
|
|
2075
|
+
* Storing the lucide PascalCase export name keeps the contract stable: both
|
|
2076
|
+
* `lucide-react` and `lucide-react-native` expose identical named exports, so a
|
|
2077
|
+
* renderer maps `name -> (LucideIcons as Record<string, Component>)[name]`.
|
|
2078
|
+
*
|
|
2079
|
+
* Keep this list to icons that read well at small sizes in a tab bar / drawer
|
|
2080
|
+
* and that exist in BOTH lucide packages. Add entries here (never per-app) so
|
|
2081
|
+
* the picker and the renderer never drift.
|
|
2082
|
+
*/
|
|
2083
|
+
interface IMobileIconEntry {
|
|
2084
|
+
/** lucide PascalCase export name, e.g. `Home`, `Users`, `LayoutDashboard`. */
|
|
2085
|
+
name: string;
|
|
2086
|
+
/** Friendly label for the admin picker. */
|
|
2087
|
+
label: string;
|
|
2088
|
+
}
|
|
2089
|
+
declare const MOBILE_ICON_SET: readonly IMobileIconEntry[];
|
|
2090
|
+
/** All valid mobile icon names (for validation / membership checks). */
|
|
2091
|
+
declare const MOBILE_ICON_NAMES: readonly string[];
|
|
2092
|
+
/** Neutral fallback used when a page has no `mobile_icon` or an unknown value. */
|
|
2093
|
+
declare const DEFAULT_MOBILE_ICON = "Circle";
|
|
2094
|
+
declare function isMobileIconName(value: unknown): value is string;
|
|
2095
|
+
/** Resolve a stored `mobile_icon` to a drawable name, falling back to the default. */
|
|
2096
|
+
declare function resolveMobileIcon(value: unknown): string;
|
|
2097
|
+
|
|
2098
|
+
/**
|
|
2099
|
+
* The single "is this page on the menu?" predicate, shared by web + mobile menu
|
|
2100
|
+
* renderers AND by the automatic virtual-navigation decision. A page is on the
|
|
2101
|
+
* menu when the author placed it there (`navPosition != null`) and it is not a
|
|
2102
|
+
* headless content-only fragment.
|
|
2103
|
+
*
|
|
2104
|
+
* Footer-only pages (`footerPosition != null && navPosition == null`), headless
|
|
2105
|
+
* pages, and ACL-pruned pages (never in the tree to begin with) are NOT menu
|
|
2106
|
+
* pages, so they never appear in a navigation block.
|
|
2107
|
+
*/
|
|
2108
|
+
|
|
2109
|
+
declare function isMenuVisible(page: Pick<IPageItem, 'is_headless' | 'navPosition'>): boolean;
|
|
2110
|
+
/** Children of `page` that should appear in a navigation block, in nav order. */
|
|
2111
|
+
declare function getMenuVisibleChildren(page: IPageItem): IPageItem[];
|
|
2112
|
+
/**
|
|
2113
|
+
* A "navigation page" is a page whose children act as its menu. The hybrid
|
|
2114
|
+
* auto-render rule additionally requires the page to have no visible body
|
|
2115
|
+
* sections (decided by the caller, which has the resolved page content).
|
|
2116
|
+
*/
|
|
2117
|
+
declare function isNavigationPage(page: IPageItem): boolean;
|
|
2118
|
+
|
|
1964
2119
|
/**
|
|
1965
2120
|
* Parse the unified `spacing` field. The CMS
|
|
1966
2121
|
* stores this as a JSON string with optional keys for each side:
|
|
@@ -2005,6 +2160,14 @@ declare function spacingToClasses(spacing: ISpacingValue, spacingToTailwind: Rec
|
|
|
2005
2160
|
* removed all legacy aliases (`parent`, `id_type`,
|
|
2006
2161
|
* `id_pageAccessTypes`). The backend is the single source of canonical
|
|
2007
2162
|
* keys; the transformer no longer accepts the legacy shapes.
|
|
2163
|
+
*
|
|
2164
|
+
* ROUTE METADATA (issue #30): this transformer deliberately does NOT carry
|
|
2165
|
+
* `route_params` / `matched_url_pattern` / `canonical_url`. Those are
|
|
2166
|
+
* resolve-time fields of a single page's full content (`IPageContent`, returned
|
|
2167
|
+
* by `GET /pages/resolve`) and are consumed directly off that type. `IPageItem`
|
|
2168
|
+
* is the navigation/menu projection of the page tree (keyword, url,
|
|
2169
|
+
* nav/footer position, parent/children) and never participates in URL
|
|
2170
|
+
* resolution, so adding a route passthrough here would be dead weight.
|
|
2008
2171
|
*/
|
|
2009
2172
|
|
|
2010
2173
|
interface IRawPage {
|
|
@@ -2023,6 +2186,10 @@ interface IRawPage {
|
|
|
2023
2186
|
is_open_access?: number | boolean | null;
|
|
2024
2187
|
title?: string | null;
|
|
2025
2188
|
description?: string | null;
|
|
2189
|
+
icon?: string | null;
|
|
2190
|
+
mobile_icon?: string | null;
|
|
2191
|
+
web_nav_render?: TWebNavRender | string | null;
|
|
2192
|
+
mobile_nav_render?: TMobileNavRender | string | null;
|
|
2026
2193
|
id_users?: number;
|
|
2027
2194
|
acl_select?: 0 | 1;
|
|
2028
2195
|
acl_insert?: 0 | 1;
|
|
@@ -2040,4 +2207,4 @@ declare function transformPageData(apiPage: IRawPage): IPageItem;
|
|
|
2040
2207
|
*/
|
|
2041
2208
|
declare function transformPagesData(pages: IRawPage[] | null | undefined): IPageItem[];
|
|
2042
2209
|
|
|
2043
|
-
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, type DatabaseMigrationMetadata, ENDPOINTS, type FrontendRelease, HEADER_CLIENT_TYPE, type IApiError, type IApiMeta, type IAssetSource, type IBaseApiResponse, type IBasePageInfo, type IBasePageSection, 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 IMeta, type IMobileAdapterBaseProps, type IMobileButtonProps, type IMobileCardProps, type IMobileCheckboxProps, type IMobileContainerProps, 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 IPageAccessTypeInfo, type IPageContent, type IPageField, type IPageFieldTranslation, type IPageFieldsData, type IPageItem, 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 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 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_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, TMobileSelectPresentation, 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 TrustLevel, type TrustedKey, type TrustedKeysFile, type UpdatePreflightResult, type WorkerRelease, arePreviewPreferencesEqual, buildConditionContext, classifyClass, classifyClassString, evaluateCondition, findRemap, hasInlineFormatting, isPreviewBridgeMessage, parseInlineRich, parseSpacing, previewKeywordFromPath, replaceCalcedValues, resolveAssetSources, resolveAssetUrl, spacingToClasses, stripHtmlToText, transformPageData, transformPagesData };
|
|
2210
|
+
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_GLOBAL_NAV_RENDER, DEFAULT_MOBILE_ICON, DEFAULT_MOBILE_NAV_RENDER, DEFAULT_WEB_GLOBAL_NAV_RENDER, DEFAULT_WEB_NAV_RENDER, type DatabaseMigrationMetadata, ENDPOINTS, type FrontendRelease, HEADER_CLIENT_TYPE, type IApiError, type IApiMeta, type IAssetSource, type IBaseApiResponse, type IBasePageInfo, type IBasePageSection, 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 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 INavRenderOption, 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 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_NAV_RENDER_OPTIONS, MOBILE_NAV_RENDER_VALUES, 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 TMobileNavRender, TMobileSelectPresentation, 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 TWebNavRender, type TrustLevel, type TrustedKey, type TrustedKeysFile, type UpdatePreflightResult, WEB_NAV_RENDER_OPTIONS, WEB_NAV_RENDER_VALUES, type WorkerRelease, arePreviewPreferencesEqual, buildConditionContext, classifyClass, classifyClassString, evaluateCondition, findRemap, getMenuVisibleChildren, hasInlineFormatting, isMenuVisible, isMobileIconName, isMobileNavRender, isNavigationPage, isPreviewBridgeMessage, isWebNavRender, parseInlineRich, parseSpacing, previewKeywordFromPath, replaceCalcedValues, resolveAssetSources, resolveAssetUrl, resolveMobileIcon, resolveMobileNavRender, resolveWebNavRender, spacingToClasses, stripHtmlToText, transformPageData, transformPagesData };
|
package/dist/index.d.ts
CHANGED
|
@@ -7,6 +7,56 @@ export { COLOR_PALETTE, COLOR_SCALES, CONTAINER_SIZE_PX, FONT_SIZE_PX, FULL_RADI
|
|
|
7
7
|
export { TAnyStyleName, TPluginStyleImplMap, TStyleImplMap, getRegistryEntry, getRegistryEntryAny, getStylePlacement, getStylePlatforms, getStylePluginId, isKnownStyleName, isRegisteredStyleName, isStyleAllowedOnPage, isStylePlacementAllowed, isStyleSupportedOnPlatform, setToStylePlatform, stylePlatformToSet } from './registry/index.js';
|
|
8
8
|
export { sharedTailwindExtend, sharedTailwindPreset } from './theme/tailwind.js';
|
|
9
9
|
|
|
10
|
+
/**
|
|
11
|
+
* Navigation rendering contract (shared by web + mobile).
|
|
12
|
+
*
|
|
13
|
+
* The page TREE defines navigation STRUCTURE (parent/child + `nav_position`).
|
|
14
|
+
* A per-page render type controls PRESENTATION only — it never changes the
|
|
15
|
+
* structure or the URLs. Web and mobile each pick their own renderer from the
|
|
16
|
+
* stored value, so the same subtree can render differently per platform.
|
|
17
|
+
*
|
|
18
|
+
* - `web_nav_render` selects the web renderer for a page's children.
|
|
19
|
+
* - `mobile_nav_render` selects the mobile renderer for a page's children.
|
|
20
|
+
*
|
|
21
|
+
* Both fields are OPTIONAL on a page; when unset the platform applies its
|
|
22
|
+
* default (web `tabs`, mobile `segmented-tabs` for a navigation page's
|
|
23
|
+
* children; the GLOBAL app menu defaults to web `header-dropdown` and mobile
|
|
24
|
+
* `bottom-tabs`).
|
|
25
|
+
*/
|
|
26
|
+
type TWebNavRender = 'header-dropdown' | 'tabs' | 'sidebar-drawer' | 'hero-cards';
|
|
27
|
+
type TMobileNavRender = 'segmented-tabs' | 'bottom-tabs' | 'drawer' | 'hero-cards';
|
|
28
|
+
declare const WEB_NAV_RENDER_VALUES: readonly TWebNavRender[];
|
|
29
|
+
declare const MOBILE_NAV_RENDER_VALUES: readonly TMobileNavRender[];
|
|
30
|
+
/** Default renderer for a navigation page's CHILDREN. */
|
|
31
|
+
declare const DEFAULT_WEB_NAV_RENDER: TWebNavRender;
|
|
32
|
+
declare const DEFAULT_MOBILE_NAV_RENDER: TMobileNavRender;
|
|
33
|
+
/** Default renderer for the GLOBAL app menu (header / shell). */
|
|
34
|
+
declare const DEFAULT_WEB_GLOBAL_NAV_RENDER: TWebNavRender;
|
|
35
|
+
declare const DEFAULT_MOBILE_GLOBAL_NAV_RENDER: TMobileNavRender;
|
|
36
|
+
interface INavRenderOption<T extends string> {
|
|
37
|
+
value: T;
|
|
38
|
+
/** Friendly label for the admin select. */
|
|
39
|
+
label: string;
|
|
40
|
+
/** Short, plain-language explanation shown under the select. */
|
|
41
|
+
description: string;
|
|
42
|
+
}
|
|
43
|
+
/** Option metadata for the admin "Web menu style" select. */
|
|
44
|
+
declare const WEB_NAV_RENDER_OPTIONS: readonly INavRenderOption<TWebNavRender>[];
|
|
45
|
+
/** Option metadata for the admin "Mobile menu style" select. */
|
|
46
|
+
declare const MOBILE_NAV_RENDER_OPTIONS: readonly INavRenderOption<TMobileNavRender>[];
|
|
47
|
+
declare function isWebNavRender(value: unknown): value is TWebNavRender;
|
|
48
|
+
declare function isMobileNavRender(value: unknown): value is TMobileNavRender;
|
|
49
|
+
/**
|
|
50
|
+
* Resolve a stored `web_nav_render` value to a concrete renderer, falling back
|
|
51
|
+
* to the supplied default (page-children default by default).
|
|
52
|
+
*/
|
|
53
|
+
declare function resolveWebNavRender(value: unknown, fallback?: TWebNavRender): TWebNavRender;
|
|
54
|
+
/**
|
|
55
|
+
* Resolve a stored `mobile_nav_render` value to a concrete renderer, falling
|
|
56
|
+
* back to the supplied default (page-children default by default).
|
|
57
|
+
*/
|
|
58
|
+
declare function resolveMobileNavRender(value: unknown, fallback?: TMobileNavRender): TMobileNavRender;
|
|
59
|
+
|
|
10
60
|
/**
|
|
11
61
|
* Comprehensive page type system, single source of truth for both apps.
|
|
12
62
|
*/
|
|
@@ -62,6 +112,14 @@ interface IPageItem extends IBasePageInfo {
|
|
|
62
112
|
id_page_access_types?: number;
|
|
63
113
|
title?: string | null;
|
|
64
114
|
description?: string | null;
|
|
115
|
+
/** Web menu icon (Tabler component name, e.g. `IconHome`). Page property field `icon`. */
|
|
116
|
+
icon?: string | null;
|
|
117
|
+
/** Mobile menu icon (curated lucide name, e.g. `Home`). Page property field `mobile_icon`. */
|
|
118
|
+
mobile_icon?: string | null;
|
|
119
|
+
/** How this page renders its children as navigation on web. Page property field `web_nav_render`. */
|
|
120
|
+
web_nav_render?: TWebNavRender | null;
|
|
121
|
+
/** How this page renders its children as navigation on mobile. Page property field `mobile_nav_render`. */
|
|
122
|
+
mobile_nav_render?: TMobileNavRender | null;
|
|
65
123
|
children?: IPageItem[];
|
|
66
124
|
}
|
|
67
125
|
interface IPageContent {
|
|
@@ -74,8 +132,42 @@ interface IPageContent {
|
|
|
74
132
|
footer_position: number | null;
|
|
75
133
|
title?: string | null;
|
|
76
134
|
description?: string | null;
|
|
135
|
+
/** Web menu icon (Tabler component name). Mirrors the `icon` page property field. */
|
|
136
|
+
icon?: string | null;
|
|
137
|
+
/** Mobile menu icon (curated lucide name). Mirrors the `mobile_icon` page property field. */
|
|
138
|
+
mobile_icon?: string | null;
|
|
139
|
+
/** Web child-navigation render type. Mirrors the `web_nav_render` page property field. */
|
|
140
|
+
web_nav_render?: TWebNavRender | null;
|
|
141
|
+
/** Mobile child-navigation render type. Mirrors the `mobile_nav_render` page property field. */
|
|
142
|
+
mobile_nav_render?: TMobileNavRender | null;
|
|
143
|
+
/**
|
|
144
|
+
* Snake_case route params extracted from the matched public URL pattern
|
|
145
|
+
* (e.g. `{ user_id: '42', token: 'abc' }` or `{ record_id: '7' }`). Present
|
|
146
|
+
* only when the page was resolved via `GET /pages/resolve`. Backend also
|
|
147
|
+
* exposes these to interpolation as `{{route.<name>}}`.
|
|
148
|
+
*/
|
|
149
|
+
route_params?: Record<string, string>;
|
|
150
|
+
/** The `page_routes` pattern that matched (e.g. `/reset/{user_id}/{token}`). Resolve responses only. */
|
|
151
|
+
matched_url_pattern?: string | null;
|
|
152
|
+
/** The canonical active route pattern for the page, for canonical-link generation. Resolve responses only. */
|
|
153
|
+
canonical_url?: string | null;
|
|
77
154
|
sections: IPageSectionWithFields[];
|
|
78
155
|
}
|
|
156
|
+
/**
|
|
157
|
+
* A public, parameterized route contract for a CMS page (issue #30). Mirrors a
|
|
158
|
+
* backend `page_routes` row. `path_pattern` uses Symfony route syntax
|
|
159
|
+
* (`/team/{record_id}`) and `requirements` maps each placeholder to a regex
|
|
160
|
+
* (`{ record_id: '\\d+' }`). Param names are snake_case and are NEVER remapped
|
|
161
|
+
* on export/import. Used by the admin page-routes editor and page export/import.
|
|
162
|
+
*/
|
|
163
|
+
interface IPageRoute {
|
|
164
|
+
id?: number;
|
|
165
|
+
path_pattern: string;
|
|
166
|
+
requirements?: Record<string, string> | null;
|
|
167
|
+
is_canonical: boolean;
|
|
168
|
+
is_active: boolean;
|
|
169
|
+
priority: number;
|
|
170
|
+
}
|
|
79
171
|
interface IPageFieldTranslation {
|
|
80
172
|
language_id: number;
|
|
81
173
|
language_code: string;
|
|
@@ -370,6 +462,14 @@ type IGetPageResponse = IBaseApiResponse<{
|
|
|
370
462
|
page: IPageContent;
|
|
371
463
|
}>;
|
|
372
464
|
type IGetPagesResponse = IBaseApiResponse<IPageItem[]>;
|
|
465
|
+
/**
|
|
466
|
+
* Response of `GET /cms-api/v1/pages/resolve?path=...` (issue #30). Identical
|
|
467
|
+
* envelope to {@link IGetPageResponse}; the resolved `page` additionally carries
|
|
468
|
+
* `route_params`, `matched_url_pattern`, and `canonical_url`.
|
|
469
|
+
*/
|
|
470
|
+
type IResolvePageResponse = IBaseApiResponse<{
|
|
471
|
+
page: IPageContent;
|
|
472
|
+
}>;
|
|
373
473
|
|
|
374
474
|
/**
|
|
375
475
|
* System maintenance / update contracts (SelfHelp Manager <-> CMS <-> admin UI).
|
|
@@ -1705,6 +1805,12 @@ declare const ENDPOINTS: {
|
|
|
1705
1805
|
readonly LIST_WITH_LANGUAGE: (languageId: number) => string;
|
|
1706
1806
|
readonly BY_KEYWORD: (keyword: string) => string;
|
|
1707
1807
|
readonly BY_ID: (pageId: number) => string;
|
|
1808
|
+
/**
|
|
1809
|
+
* DB-driven public path resolution (issue #30): maps a full public URL
|
|
1810
|
+
* path (e.g. `/reset/42/abc`, `/team/7`) to a page payload + route
|
|
1811
|
+
* params. `path` is sent URL-encoded as a query parameter.
|
|
1812
|
+
*/
|
|
1813
|
+
readonly RESOLVE: (path: string) => string;
|
|
1708
1814
|
};
|
|
1709
1815
|
readonly LANGUAGES: "/cms-api/v1/languages";
|
|
1710
1816
|
readonly FORMS: {
|
|
@@ -1961,6 +2067,55 @@ declare function hasInlineFormatting(value: string | null | undefined): boolean;
|
|
|
1961
2067
|
*/
|
|
1962
2068
|
declare function stripHtmlToText(value: string | null | undefined): string;
|
|
1963
2069
|
|
|
2070
|
+
/**
|
|
2071
|
+
* Curated mobile icon set — the SINGLE source of truth shared by the admin
|
|
2072
|
+
* `select-icon-mobile` picker (web frontend, drawn with `lucide-react`) and the
|
|
2073
|
+
* mobile menu renderers (drawn with `lucide-react-native`).
|
|
2074
|
+
*
|
|
2075
|
+
* Storing the lucide PascalCase export name keeps the contract stable: both
|
|
2076
|
+
* `lucide-react` and `lucide-react-native` expose identical named exports, so a
|
|
2077
|
+
* renderer maps `name -> (LucideIcons as Record<string, Component>)[name]`.
|
|
2078
|
+
*
|
|
2079
|
+
* Keep this list to icons that read well at small sizes in a tab bar / drawer
|
|
2080
|
+
* and that exist in BOTH lucide packages. Add entries here (never per-app) so
|
|
2081
|
+
* the picker and the renderer never drift.
|
|
2082
|
+
*/
|
|
2083
|
+
interface IMobileIconEntry {
|
|
2084
|
+
/** lucide PascalCase export name, e.g. `Home`, `Users`, `LayoutDashboard`. */
|
|
2085
|
+
name: string;
|
|
2086
|
+
/** Friendly label for the admin picker. */
|
|
2087
|
+
label: string;
|
|
2088
|
+
}
|
|
2089
|
+
declare const MOBILE_ICON_SET: readonly IMobileIconEntry[];
|
|
2090
|
+
/** All valid mobile icon names (for validation / membership checks). */
|
|
2091
|
+
declare const MOBILE_ICON_NAMES: readonly string[];
|
|
2092
|
+
/** Neutral fallback used when a page has no `mobile_icon` or an unknown value. */
|
|
2093
|
+
declare const DEFAULT_MOBILE_ICON = "Circle";
|
|
2094
|
+
declare function isMobileIconName(value: unknown): value is string;
|
|
2095
|
+
/** Resolve a stored `mobile_icon` to a drawable name, falling back to the default. */
|
|
2096
|
+
declare function resolveMobileIcon(value: unknown): string;
|
|
2097
|
+
|
|
2098
|
+
/**
|
|
2099
|
+
* The single "is this page on the menu?" predicate, shared by web + mobile menu
|
|
2100
|
+
* renderers AND by the automatic virtual-navigation decision. A page is on the
|
|
2101
|
+
* menu when the author placed it there (`navPosition != null`) and it is not a
|
|
2102
|
+
* headless content-only fragment.
|
|
2103
|
+
*
|
|
2104
|
+
* Footer-only pages (`footerPosition != null && navPosition == null`), headless
|
|
2105
|
+
* pages, and ACL-pruned pages (never in the tree to begin with) are NOT menu
|
|
2106
|
+
* pages, so they never appear in a navigation block.
|
|
2107
|
+
*/
|
|
2108
|
+
|
|
2109
|
+
declare function isMenuVisible(page: Pick<IPageItem, 'is_headless' | 'navPosition'>): boolean;
|
|
2110
|
+
/** Children of `page` that should appear in a navigation block, in nav order. */
|
|
2111
|
+
declare function getMenuVisibleChildren(page: IPageItem): IPageItem[];
|
|
2112
|
+
/**
|
|
2113
|
+
* A "navigation page" is a page whose children act as its menu. The hybrid
|
|
2114
|
+
* auto-render rule additionally requires the page to have no visible body
|
|
2115
|
+
* sections (decided by the caller, which has the resolved page content).
|
|
2116
|
+
*/
|
|
2117
|
+
declare function isNavigationPage(page: IPageItem): boolean;
|
|
2118
|
+
|
|
1964
2119
|
/**
|
|
1965
2120
|
* Parse the unified `spacing` field. The CMS
|
|
1966
2121
|
* stores this as a JSON string with optional keys for each side:
|
|
@@ -2005,6 +2160,14 @@ declare function spacingToClasses(spacing: ISpacingValue, spacingToTailwind: Rec
|
|
|
2005
2160
|
* removed all legacy aliases (`parent`, `id_type`,
|
|
2006
2161
|
* `id_pageAccessTypes`). The backend is the single source of canonical
|
|
2007
2162
|
* keys; the transformer no longer accepts the legacy shapes.
|
|
2163
|
+
*
|
|
2164
|
+
* ROUTE METADATA (issue #30): this transformer deliberately does NOT carry
|
|
2165
|
+
* `route_params` / `matched_url_pattern` / `canonical_url`. Those are
|
|
2166
|
+
* resolve-time fields of a single page's full content (`IPageContent`, returned
|
|
2167
|
+
* by `GET /pages/resolve`) and are consumed directly off that type. `IPageItem`
|
|
2168
|
+
* is the navigation/menu projection of the page tree (keyword, url,
|
|
2169
|
+
* nav/footer position, parent/children) and never participates in URL
|
|
2170
|
+
* resolution, so adding a route passthrough here would be dead weight.
|
|
2008
2171
|
*/
|
|
2009
2172
|
|
|
2010
2173
|
interface IRawPage {
|
|
@@ -2023,6 +2186,10 @@ interface IRawPage {
|
|
|
2023
2186
|
is_open_access?: number | boolean | null;
|
|
2024
2187
|
title?: string | null;
|
|
2025
2188
|
description?: string | null;
|
|
2189
|
+
icon?: string | null;
|
|
2190
|
+
mobile_icon?: string | null;
|
|
2191
|
+
web_nav_render?: TWebNavRender | string | null;
|
|
2192
|
+
mobile_nav_render?: TMobileNavRender | string | null;
|
|
2026
2193
|
id_users?: number;
|
|
2027
2194
|
acl_select?: 0 | 1;
|
|
2028
2195
|
acl_insert?: 0 | 1;
|
|
@@ -2040,4 +2207,4 @@ declare function transformPageData(apiPage: IRawPage): IPageItem;
|
|
|
2040
2207
|
*/
|
|
2041
2208
|
declare function transformPagesData(pages: IRawPage[] | null | undefined): IPageItem[];
|
|
2042
2209
|
|
|
2043
|
-
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, type DatabaseMigrationMetadata, ENDPOINTS, type FrontendRelease, HEADER_CLIENT_TYPE, type IApiError, type IApiMeta, type IAssetSource, type IBaseApiResponse, type IBasePageInfo, type IBasePageSection, 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 IMeta, type IMobileAdapterBaseProps, type IMobileButtonProps, type IMobileCardProps, type IMobileCheckboxProps, type IMobileContainerProps, 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 IPageAccessTypeInfo, type IPageContent, type IPageField, type IPageFieldTranslation, type IPageFieldsData, type IPageItem, 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 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 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_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, TMobileSelectPresentation, 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 TrustLevel, type TrustedKey, type TrustedKeysFile, type UpdatePreflightResult, type WorkerRelease, arePreviewPreferencesEqual, buildConditionContext, classifyClass, classifyClassString, evaluateCondition, findRemap, hasInlineFormatting, isPreviewBridgeMessage, parseInlineRich, parseSpacing, previewKeywordFromPath, replaceCalcedValues, resolveAssetSources, resolveAssetUrl, spacingToClasses, stripHtmlToText, transformPageData, transformPagesData };
|
|
2210
|
+
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_GLOBAL_NAV_RENDER, DEFAULT_MOBILE_ICON, DEFAULT_MOBILE_NAV_RENDER, DEFAULT_WEB_GLOBAL_NAV_RENDER, DEFAULT_WEB_NAV_RENDER, type DatabaseMigrationMetadata, ENDPOINTS, type FrontendRelease, HEADER_CLIENT_TYPE, type IApiError, type IApiMeta, type IAssetSource, type IBaseApiResponse, type IBasePageInfo, type IBasePageSection, 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 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 INavRenderOption, 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 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_NAV_RENDER_OPTIONS, MOBILE_NAV_RENDER_VALUES, 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 TMobileNavRender, TMobileSelectPresentation, 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 TWebNavRender, type TrustLevel, type TrustedKey, type TrustedKeysFile, type UpdatePreflightResult, WEB_NAV_RENDER_OPTIONS, WEB_NAV_RENDER_VALUES, type WorkerRelease, arePreviewPreferencesEqual, buildConditionContext, classifyClass, classifyClassString, evaluateCondition, findRemap, getMenuVisibleChildren, hasInlineFormatting, isMenuVisible, isMobileIconName, isMobileNavRender, isNavigationPage, isPreviewBridgeMessage, isWebNavRender, parseInlineRich, parseSpacing, previewKeywordFromPath, replaceCalcedValues, resolveAssetSources, resolveAssetUrl, resolveMobileIcon, resolveMobileNavRender, resolveWebNavRender, spacingToClasses, stripHtmlToText, transformPageData, transformPagesData };
|