@selfhelp/shared 1.21.5 → 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.
- package/CHANGELOG.md +23 -0
- package/dist/index.d.mts +93 -5
- package/dist/index.d.ts +93 -5
- package/dist/index.js +163 -5
- package/dist/index.mjs +156 -5
- package/package.json +1 -1
- package/src/api/__tests__/endpoints.test.ts +37 -12
- package/src/api/endpoints.ts +5 -5
- package/src/api/index.ts +1 -0
- package/src/api/pagesResolve.ts +78 -0
- package/src/content/__tests__/formRecordPrefill.test.ts +104 -0
- package/src/content/formRecordPrefill.ts +191 -0
- package/src/content/index.ts +1 -0
- package/src/types/preview-bridge.ts +10 -1
package/CHANGELOG.md
CHANGED
|
@@ -10,6 +10,29 @@ All notable changes to `@selfhelp/shared` will be documented in this file.
|
|
|
10
10
|
This project follows semantic versioning.
|
|
11
11
|
|
|
12
12
|
|
|
13
|
+
## v1.21.6
|
|
14
|
+
|
|
15
|
+
Unreleased wave cleanup (pairs with core `0.1.36`, frontend `0.1.63`, mobile
|
|
16
|
+
`supports.core >=0.1.36`).
|
|
17
|
+
|
|
18
|
+
### Canonical public page resolve helper
|
|
19
|
+
|
|
20
|
+
- `buildPagesResolveUrl` / `buildPagesResolvePath` / `buildPagesResolveQuery` /
|
|
21
|
+
`normalizePagesResolvePath` — single encoding for `path`, `language_id`, and
|
|
22
|
+
`preview` used by frontend SSR, frontend browser client, and mobile.
|
|
23
|
+
- `ENDPOINTS.PAGES.RESOLVE_ROUTE` is the static `/cms-api/v1/pages/resolve`
|
|
24
|
+
path; the old `ENDPOINTS.PAGES.RESOLVE(path)` builder is removed (no alias).
|
|
25
|
+
|
|
26
|
+
### Form-record prefill
|
|
27
|
+
|
|
28
|
+
- `parseFormRecordPrefill` + `flattenFormRecordPrefillValues` — shared
|
|
29
|
+
`section_data` → form prefill map (web + mobile).
|
|
30
|
+
|
|
31
|
+
### Preview bridge
|
|
32
|
+
|
|
33
|
+
- `IPreviewNavigatedMessage.path` — optional public CMS path so the shell can
|
|
34
|
+
re-resolve parameterized routes via `/pages/resolve`.
|
|
35
|
+
|
|
13
36
|
## v1.21.5
|
|
14
37
|
|
|
15
38
|
Single publish of the DB-routing / CMS-apps / navigation / entry-binding wave
|
package/dist/index.d.mts
CHANGED
|
@@ -1052,6 +1052,12 @@ interface IPreviewNavigatedMessage {
|
|
|
1052
1052
|
keyword: string | null;
|
|
1053
1053
|
/** Full in-frame href, for diagnostics / the toolbar URL display. */
|
|
1054
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;
|
|
1055
1061
|
locale?: string | null;
|
|
1056
1062
|
}
|
|
1057
1063
|
/**
|
|
@@ -1826,11 +1832,12 @@ declare const ENDPOINTS: {
|
|
|
1826
1832
|
readonly BY_KEYWORD: (keyword: string) => string;
|
|
1827
1833
|
readonly BY_ID: (pageId: number) => string;
|
|
1828
1834
|
/**
|
|
1829
|
-
*
|
|
1830
|
-
*
|
|
1831
|
-
*
|
|
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.
|
|
1832
1839
|
*/
|
|
1833
|
-
readonly
|
|
1840
|
+
readonly RESOLVE_ROUTE: "/cms-api/v1/pages/resolve";
|
|
1834
1841
|
};
|
|
1835
1842
|
readonly NAVIGATION: {
|
|
1836
1843
|
readonly GET: "/cms-api/v1/navigation";
|
|
@@ -1854,6 +1861,39 @@ declare const CLIENT_TYPE_MOBILE = "mobile";
|
|
|
1854
1861
|
declare const CLIENT_TYPE_MOBILE_AND_WEB = "mobile_and_web";
|
|
1855
1862
|
type TClientType = typeof CLIENT_TYPE_WEB | typeof CLIENT_TYPE_MOBILE | typeof CLIENT_TYPE_MOBILE_AND_WEB;
|
|
1856
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
|
+
|
|
1857
1897
|
/**
|
|
1858
1898
|
* Mirrors the backend `PageDb::replace_calced_values()` regex:
|
|
1859
1899
|
*
|
|
@@ -2182,6 +2222,54 @@ declare function resolveFieldsMapLabel(fieldKey: string, labels: Record<string,
|
|
|
2182
2222
|
declare function serializeFieldsMapCatalog(fieldKeys: string[]): string;
|
|
2183
2223
|
declare function serializeFieldsMapLabels(labels: Record<string, string>): string;
|
|
2184
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
|
+
|
|
2185
2273
|
/**
|
|
2186
2274
|
* Global web header presentation presets (menu-builder `web_header` menu).
|
|
2187
2275
|
*/
|
|
@@ -2713,4 +2801,4 @@ declare function transformPageData(apiPage: IRawPage): IPageItem;
|
|
|
2713
2801
|
*/
|
|
2714
2802
|
declare function transformPagesData(pages: IRawPage[] | null | undefined): IPageItem[];
|
|
2715
2803
|
|
|
2716
|
-
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, 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 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 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, 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, buildPublicPathFromRoute, clampMenuItemsAtDepth, classifyClass, classifyClassString, collectPageIdsFromMenuItems, evaluateCondition, expandedIdsForActiveTrail, findMenuItemByPageId, findNearestBottomTabMenuItemForPage, findPageRefInNavigationPayload, findRemap, flattenFooterItems, 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, pageUrlToMobileRoute, parseFieldsMapCatalog, parseFieldsMapLabels, 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 };
|
|
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 };
|
package/dist/index.d.ts
CHANGED
|
@@ -1052,6 +1052,12 @@ interface IPreviewNavigatedMessage {
|
|
|
1052
1052
|
keyword: string | null;
|
|
1053
1053
|
/** Full in-frame href, for diagnostics / the toolbar URL display. */
|
|
1054
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;
|
|
1055
1061
|
locale?: string | null;
|
|
1056
1062
|
}
|
|
1057
1063
|
/**
|
|
@@ -1826,11 +1832,12 @@ declare const ENDPOINTS: {
|
|
|
1826
1832
|
readonly BY_KEYWORD: (keyword: string) => string;
|
|
1827
1833
|
readonly BY_ID: (pageId: number) => string;
|
|
1828
1834
|
/**
|
|
1829
|
-
*
|
|
1830
|
-
*
|
|
1831
|
-
*
|
|
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.
|
|
1832
1839
|
*/
|
|
1833
|
-
readonly
|
|
1840
|
+
readonly RESOLVE_ROUTE: "/cms-api/v1/pages/resolve";
|
|
1834
1841
|
};
|
|
1835
1842
|
readonly NAVIGATION: {
|
|
1836
1843
|
readonly GET: "/cms-api/v1/navigation";
|
|
@@ -1854,6 +1861,39 @@ declare const CLIENT_TYPE_MOBILE = "mobile";
|
|
|
1854
1861
|
declare const CLIENT_TYPE_MOBILE_AND_WEB = "mobile_and_web";
|
|
1855
1862
|
type TClientType = typeof CLIENT_TYPE_WEB | typeof CLIENT_TYPE_MOBILE | typeof CLIENT_TYPE_MOBILE_AND_WEB;
|
|
1856
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
|
+
|
|
1857
1897
|
/**
|
|
1858
1898
|
* Mirrors the backend `PageDb::replace_calced_values()` regex:
|
|
1859
1899
|
*
|
|
@@ -2182,6 +2222,54 @@ declare function resolveFieldsMapLabel(fieldKey: string, labels: Record<string,
|
|
|
2182
2222
|
declare function serializeFieldsMapCatalog(fieldKeys: string[]): string;
|
|
2183
2223
|
declare function serializeFieldsMapLabels(labels: Record<string, string>): string;
|
|
2184
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
|
+
|
|
2185
2273
|
/**
|
|
2186
2274
|
* Global web header presentation presets (menu-builder `web_header` menu).
|
|
2187
2275
|
*/
|
|
@@ -2713,4 +2801,4 @@ declare function transformPageData(apiPage: IRawPage): IPageItem;
|
|
|
2713
2801
|
*/
|
|
2714
2802
|
declare function transformPagesData(pages: IRawPage[] | null | undefined): IPageItem[];
|
|
2715
2803
|
|
|
2716
|
-
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, 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 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 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, 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, buildPublicPathFromRoute, clampMenuItemsAtDepth, classifyClass, classifyClassString, collectPageIdsFromMenuItems, evaluateCondition, expandedIdsForActiveTrail, findMenuItemByPageId, findNearestBottomTabMenuItemForPage, findPageRefInNavigationPayload, findRemap, flattenFooterItems, 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, pageUrlToMobileRoute, parseFieldsMapCatalog, parseFieldsMapLabels, 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 };
|
|
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 };
|
package/dist/index.js
CHANGED
|
@@ -49,6 +49,7 @@ __export(index_exports, {
|
|
|
49
49
|
ENDPOINTS: () => ENDPOINTS,
|
|
50
50
|
FIELDS_MAP_STYLE_CONFIG: () => FIELDS_MAP_STYLE_CONFIG,
|
|
51
51
|
FONT_SIZE_PX: () => FONT_SIZE_PX,
|
|
52
|
+
FORM_RECORD_PREFILL_SKIP_FIELDS: () => FORM_RECORD_PREFILL_SKIP_FIELDS,
|
|
52
53
|
FULL_RADIUS_PX: () => FULL_RADIUS_PX,
|
|
53
54
|
HEADER_CLIENT_TYPE: () => HEADER_CLIENT_TYPE,
|
|
54
55
|
LINE_HEIGHT: () => LINE_HEIGHT,
|
|
@@ -80,6 +81,9 @@ __export(index_exports, {
|
|
|
80
81
|
_resetPluginStyleRegistry: () => _resetPluginStyleRegistry,
|
|
81
82
|
arePreviewPreferencesEqual: () => arePreviewPreferencesEqual,
|
|
82
83
|
buildConditionContext: () => buildConditionContext,
|
|
84
|
+
buildPagesResolvePath: () => buildPagesResolvePath,
|
|
85
|
+
buildPagesResolveQuery: () => buildPagesResolveQuery,
|
|
86
|
+
buildPagesResolveUrl: () => buildPagesResolveUrl,
|
|
83
87
|
buildPublicPathFromRoute: () => buildPublicPathFromRoute,
|
|
84
88
|
clampMenuItemsAtDepth: () => clampMenuItemsAtDepth,
|
|
85
89
|
classifyClass: () => classifyClass,
|
|
@@ -94,6 +98,7 @@ __export(index_exports, {
|
|
|
94
98
|
findPageRefInNavigationPayload: () => findPageRefInNavigationPayload,
|
|
95
99
|
findRemap: () => findRemap,
|
|
96
100
|
flattenFooterItems: () => flattenFooterItems,
|
|
101
|
+
flattenFormRecordPrefillValues: () => flattenFormRecordPrefillValues,
|
|
97
102
|
flattenMenuItems: () => flattenMenuItems,
|
|
98
103
|
flattenNavigationMenuItems: () => flattenNavigationMenuItems,
|
|
99
104
|
footerColumnItems: () => footerColumnItems,
|
|
@@ -148,11 +153,13 @@ __export(index_exports, {
|
|
|
148
153
|
matchesMobilePath: () => matchesMobilePath,
|
|
149
154
|
matchesWebPath: () => matchesWebPath,
|
|
150
155
|
mergeHeaderLayers: () => mergeHeaderLayers,
|
|
156
|
+
normalizePagesResolvePath: () => normalizePagesResolvePath,
|
|
151
157
|
pageUrlToMobileRoute: () => pageUrlToMobileRoute,
|
|
152
158
|
parseDimensionToReactNative: () => parseDimensionToReactNative,
|
|
153
159
|
parseDimensionToWeb: () => parseDimensionToWeb,
|
|
154
160
|
parseFieldsMapCatalog: () => parseFieldsMapCatalog,
|
|
155
161
|
parseFieldsMapLabels: () => parseFieldsMapLabels,
|
|
162
|
+
parseFormRecordPrefill: () => parseFormRecordPrefill,
|
|
156
163
|
parseInlineRich: () => parseInlineRich,
|
|
157
164
|
parseOptionCatalog: () => parseOptionCatalog,
|
|
158
165
|
parseOptionCodes: () => parseOptionCodes,
|
|
@@ -350,7 +357,7 @@ function isPreviewBridgeMessage(value) {
|
|
|
350
357
|
case PREVIEW_BRIDGE_MESSAGE.READY:
|
|
351
358
|
return record.source === "web" || record.source === "mobile";
|
|
352
359
|
case PREVIEW_BRIDGE_MESSAGE.NAVIGATED:
|
|
353
|
-
return (record.source === "web" || record.source === "mobile") && (typeof record.keyword === "string" || record.keyword === null) && typeof record.href === "string";
|
|
360
|
+
return (record.source === "web" || record.source === "mobile") && (typeof record.keyword === "string" || record.keyword === null) && typeof record.href === "string" && (record.path === void 0 || record.path === null || typeof record.path === "string");
|
|
354
361
|
case PREVIEW_BRIDGE_MESSAGE.NAVIGATE:
|
|
355
362
|
return (typeof record.keyword === "string" || record.keyword === null) && (record.path === void 0 || record.path === null || typeof record.path === "string");
|
|
356
363
|
case PREVIEW_BRIDGE_MESSAGE.SET_PREFERENCES:
|
|
@@ -624,11 +631,12 @@ var ENDPOINTS = {
|
|
|
624
631
|
BY_KEYWORD: (keyword) => `${API_VERSION_PREFIX}/pages/by-keyword/${encodeURIComponent(keyword)}`,
|
|
625
632
|
BY_ID: (pageId) => `${API_VERSION_PREFIX}/pages/${pageId}`,
|
|
626
633
|
/**
|
|
627
|
-
*
|
|
628
|
-
*
|
|
629
|
-
*
|
|
634
|
+
* Static resolve route (no query). Always pair with
|
|
635
|
+
* {@link buildPagesResolveUrl} / {@link buildPagesResolvePath} so
|
|
636
|
+
* `path`, `language_id`, and `preview` are encoded identically across
|
|
637
|
+
* SSR, browser, and mobile.
|
|
630
638
|
*/
|
|
631
|
-
|
|
639
|
+
RESOLVE_ROUTE: `${API_VERSION_PREFIX}/pages/resolve`
|
|
632
640
|
},
|
|
633
641
|
NAVIGATION: {
|
|
634
642
|
GET: `${API_VERSION_PREFIX}/navigation`,
|
|
@@ -650,6 +658,37 @@ var CLIENT_TYPE_WEB = "web";
|
|
|
650
658
|
var CLIENT_TYPE_MOBILE = "mobile";
|
|
651
659
|
var CLIENT_TYPE_MOBILE_AND_WEB = "mobile_and_web";
|
|
652
660
|
|
|
661
|
+
// src/api/pagesResolve.ts
|
|
662
|
+
function normalizePagesResolvePath(rawPath) {
|
|
663
|
+
const withoutOrigin = rawPath.includes("://") ? (() => {
|
|
664
|
+
try {
|
|
665
|
+
return new URL(rawPath).pathname;
|
|
666
|
+
} catch {
|
|
667
|
+
return rawPath;
|
|
668
|
+
}
|
|
669
|
+
})() : rawPath;
|
|
670
|
+
const pathOnly = withoutOrigin.split("#")[0].split("?")[0];
|
|
671
|
+
const withSlash = pathOnly.startsWith("/") ? pathOnly : `/${pathOnly}`;
|
|
672
|
+
return withSlash.replace(/\/+$/, "") || "/";
|
|
673
|
+
}
|
|
674
|
+
function buildPagesResolveQuery(params) {
|
|
675
|
+
const search = new URLSearchParams();
|
|
676
|
+
search.set("path", normalizePagesResolvePath(params.path));
|
|
677
|
+
if (params.languageId != null && Number.isFinite(params.languageId) && params.languageId > 0) {
|
|
678
|
+
search.set("language_id", String(params.languageId));
|
|
679
|
+
}
|
|
680
|
+
if (params.preview) {
|
|
681
|
+
search.set("preview", "true");
|
|
682
|
+
}
|
|
683
|
+
return search.toString();
|
|
684
|
+
}
|
|
685
|
+
function buildPagesResolvePath(params) {
|
|
686
|
+
return `/pages/resolve?${buildPagesResolveQuery(params)}`;
|
|
687
|
+
}
|
|
688
|
+
function buildPagesResolveUrl(params) {
|
|
689
|
+
return `${API_VERSION_PREFIX}${buildPagesResolvePath(params)}`;
|
|
690
|
+
}
|
|
691
|
+
|
|
653
692
|
// src/theme/tokens.ts
|
|
654
693
|
var FONT_SIZE_PX = {
|
|
655
694
|
xs: 12,
|
|
@@ -1813,6 +1852,118 @@ function serializeFieldsMapLabels(labels) {
|
|
|
1813
1852
|
return JSON.stringify(clean);
|
|
1814
1853
|
}
|
|
1815
1854
|
|
|
1855
|
+
// src/content/formRecordPrefill.ts
|
|
1856
|
+
var FORM_RECORD_PREFILL_SKIP_FIELDS = /* @__PURE__ */ new Set([
|
|
1857
|
+
"record_id",
|
|
1858
|
+
"entry_date",
|
|
1859
|
+
"id_users",
|
|
1860
|
+
"user_name",
|
|
1861
|
+
"user_code",
|
|
1862
|
+
"id_actionTriggerTypes",
|
|
1863
|
+
"triggerType",
|
|
1864
|
+
"id_languages",
|
|
1865
|
+
"language_locale",
|
|
1866
|
+
"language_name"
|
|
1867
|
+
]);
|
|
1868
|
+
function isTranslatableChild(children, fieldName) {
|
|
1869
|
+
if (!Array.isArray(children)) {
|
|
1870
|
+
return false;
|
|
1871
|
+
}
|
|
1872
|
+
const child = children.find((item) => item?.name?.content === fieldName);
|
|
1873
|
+
return child?.translatable?.content === "1";
|
|
1874
|
+
}
|
|
1875
|
+
function asScalarString(value) {
|
|
1876
|
+
if (value === null || value === void 0) {
|
|
1877
|
+
return null;
|
|
1878
|
+
}
|
|
1879
|
+
if (typeof value === "string" || typeof value === "number" || typeof value === "boolean") {
|
|
1880
|
+
return String(value);
|
|
1881
|
+
}
|
|
1882
|
+
return null;
|
|
1883
|
+
}
|
|
1884
|
+
function parseFormRecordPrefill(section) {
|
|
1885
|
+
const sectionDataArray = section?.section_data;
|
|
1886
|
+
if (!Array.isArray(sectionDataArray) || sectionDataArray.length === 0) {
|
|
1887
|
+
return { recordId: null, values: {} };
|
|
1888
|
+
}
|
|
1889
|
+
const recordGroups = {};
|
|
1890
|
+
for (const row of sectionDataArray) {
|
|
1891
|
+
if (!row || typeof row !== "object" || Array.isArray(row)) {
|
|
1892
|
+
continue;
|
|
1893
|
+
}
|
|
1894
|
+
const record = row;
|
|
1895
|
+
const rawRecordId = record.record_id;
|
|
1896
|
+
const recordId = typeof rawRecordId === "number" ? rawRecordId : typeof rawRecordId === "string" && rawRecordId.trim() !== "" && Number.isFinite(Number(rawRecordId)) ? Number(rawRecordId) : null;
|
|
1897
|
+
if (recordId === null) {
|
|
1898
|
+
continue;
|
|
1899
|
+
}
|
|
1900
|
+
if (!recordGroups[recordId]) {
|
|
1901
|
+
recordGroups[recordId] = {};
|
|
1902
|
+
}
|
|
1903
|
+
const languageId = typeof record.id_languages === "number" ? record.id_languages : typeof record.id_languages === "string" && Number.isFinite(Number(record.id_languages)) ? Number(record.id_languages) : void 0;
|
|
1904
|
+
for (const [fieldName, fieldValue] of Object.entries(record)) {
|
|
1905
|
+
if (FORM_RECORD_PREFILL_SKIP_FIELDS.has(fieldName)) {
|
|
1906
|
+
continue;
|
|
1907
|
+
}
|
|
1908
|
+
const value = asScalarString(fieldValue);
|
|
1909
|
+
if (value === null) {
|
|
1910
|
+
continue;
|
|
1911
|
+
}
|
|
1912
|
+
const translatable = isTranslatableChild(section.children, fieldName);
|
|
1913
|
+
if (translatable) {
|
|
1914
|
+
if (languageId === 1) {
|
|
1915
|
+
if (!recordGroups[recordId][fieldName]) {
|
|
1916
|
+
recordGroups[recordId][fieldName] = value;
|
|
1917
|
+
}
|
|
1918
|
+
} else if (typeof languageId === "number") {
|
|
1919
|
+
const current = recordGroups[recordId][fieldName];
|
|
1920
|
+
if (typeof current === "string" || !current) {
|
|
1921
|
+
recordGroups[recordId][fieldName] = [{ language_id: languageId, value }];
|
|
1922
|
+
} else {
|
|
1923
|
+
const langValues = current;
|
|
1924
|
+
const existingIndex = langValues.findIndex((v) => v.language_id === languageId);
|
|
1925
|
+
if (existingIndex >= 0) {
|
|
1926
|
+
langValues[existingIndex] = { language_id: languageId, value };
|
|
1927
|
+
} else {
|
|
1928
|
+
langValues.push({ language_id: languageId, value });
|
|
1929
|
+
}
|
|
1930
|
+
}
|
|
1931
|
+
}
|
|
1932
|
+
} else if (languageId === 1 || !recordGroups[recordId][fieldName]) {
|
|
1933
|
+
recordGroups[recordId][fieldName] = value;
|
|
1934
|
+
}
|
|
1935
|
+
}
|
|
1936
|
+
}
|
|
1937
|
+
const firstRecordId = Object.keys(recordGroups)[0];
|
|
1938
|
+
if (!firstRecordId) {
|
|
1939
|
+
return { recordId: null, values: {} };
|
|
1940
|
+
}
|
|
1941
|
+
const id = Number(firstRecordId);
|
|
1942
|
+
return { recordId: id, values: recordGroups[id] ?? {} };
|
|
1943
|
+
}
|
|
1944
|
+
function flattenFormRecordPrefillValues(values, languageId) {
|
|
1945
|
+
const out = {};
|
|
1946
|
+
for (const [key, value] of Object.entries(values)) {
|
|
1947
|
+
if (typeof value === "string") {
|
|
1948
|
+
out[key] = value;
|
|
1949
|
+
continue;
|
|
1950
|
+
}
|
|
1951
|
+
if (!Array.isArray(value) || value.length === 0) {
|
|
1952
|
+
continue;
|
|
1953
|
+
}
|
|
1954
|
+
if (languageId != null) {
|
|
1955
|
+
const match = value.find((entry) => entry.language_id === languageId);
|
|
1956
|
+
if (match) {
|
|
1957
|
+
out[key] = match.value;
|
|
1958
|
+
continue;
|
|
1959
|
+
}
|
|
1960
|
+
}
|
|
1961
|
+
const nonIndependent = value.find((entry) => entry.language_id !== 1);
|
|
1962
|
+
out[key] = (nonIndependent ?? value[0]).value;
|
|
1963
|
+
}
|
|
1964
|
+
return out;
|
|
1965
|
+
}
|
|
1966
|
+
|
|
1816
1967
|
// src/navigation/headerPreset.ts
|
|
1817
1968
|
var WEB_HEADER_PRESET_VALUES = [
|
|
1818
1969
|
"simple",
|
|
@@ -2665,6 +2816,7 @@ function transformPagesData(pages) {
|
|
|
2665
2816
|
ENDPOINTS,
|
|
2666
2817
|
FIELDS_MAP_STYLE_CONFIG,
|
|
2667
2818
|
FONT_SIZE_PX,
|
|
2819
|
+
FORM_RECORD_PREFILL_SKIP_FIELDS,
|
|
2668
2820
|
FULL_RADIUS_PX,
|
|
2669
2821
|
HEADER_CLIENT_TYPE,
|
|
2670
2822
|
LINE_HEIGHT,
|
|
@@ -2696,6 +2848,9 @@ function transformPagesData(pages) {
|
|
|
2696
2848
|
_resetPluginStyleRegistry,
|
|
2697
2849
|
arePreviewPreferencesEqual,
|
|
2698
2850
|
buildConditionContext,
|
|
2851
|
+
buildPagesResolvePath,
|
|
2852
|
+
buildPagesResolveQuery,
|
|
2853
|
+
buildPagesResolveUrl,
|
|
2699
2854
|
buildPublicPathFromRoute,
|
|
2700
2855
|
clampMenuItemsAtDepth,
|
|
2701
2856
|
classifyClass,
|
|
@@ -2710,6 +2865,7 @@ function transformPagesData(pages) {
|
|
|
2710
2865
|
findPageRefInNavigationPayload,
|
|
2711
2866
|
findRemap,
|
|
2712
2867
|
flattenFooterItems,
|
|
2868
|
+
flattenFormRecordPrefillValues,
|
|
2713
2869
|
flattenMenuItems,
|
|
2714
2870
|
flattenNavigationMenuItems,
|
|
2715
2871
|
footerColumnItems,
|
|
@@ -2764,11 +2920,13 @@ function transformPagesData(pages) {
|
|
|
2764
2920
|
matchesMobilePath,
|
|
2765
2921
|
matchesWebPath,
|
|
2766
2922
|
mergeHeaderLayers,
|
|
2923
|
+
normalizePagesResolvePath,
|
|
2767
2924
|
pageUrlToMobileRoute,
|
|
2768
2925
|
parseDimensionToReactNative,
|
|
2769
2926
|
parseDimensionToWeb,
|
|
2770
2927
|
parseFieldsMapCatalog,
|
|
2771
2928
|
parseFieldsMapLabels,
|
|
2929
|
+
parseFormRecordPrefill,
|
|
2772
2930
|
parseInlineRich,
|
|
2773
2931
|
parseOptionCatalog,
|
|
2774
2932
|
parseOptionCodes,
|