@selfhelp/shared 1.28.0 → 1.30.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 CHANGED
@@ -10,6 +10,64 @@ 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.30.0
14
+
15
+ Minor: language-independent sentinel as one named constant (task
16
+ `2026-11-24-language-independent`; pairs with backend 0.1.51, frontend 0.1.78,
17
+ mobile 0.1.40). Additive, no breaking change.
18
+
19
+ - **Added** `LANGUAGE_INDEPENDENT_ID` (`1`), `LANGUAGE_INDEPENDENT_LOCALE`
20
+ (`'all'`) and `isLanguageIndependent()` from the package root (`src/content/
21
+ languageIndependent.ts`). The backend `languages` row id 1 holds values that
22
+ are the same in every language; it is not a real language.
23
+ - **Changed** `formRecordPrefill` to use `isLanguageIndependent` instead of a
24
+ bare comparison with `1`. Behaviour unchanged.
25
+ Minor: plugin SDK additions for the SurveyJS 3 upgrade (pairs with the backend,
26
+ frontend and SurveyJS plugin releases of that work). Additive, no breaking change.
27
+
28
+ - **`IPluginApi.sanitizeHtml(html, mode)`.** The web host lends plugins its
29
+ HTML sanitizer (`inline` or `block`), the same rules core pages use, so no
30
+ plugin bundles its own DOMPurify. Not on `IMobilePluginApi`: React Native does
31
+ not render HTML. A host must now provide it, so a plugin that calls it
32
+ declares the first host version that does (`compatibility` in its manifest);
33
+ on an older host it is undefined.
34
+ - **Plugin styles know their page.** `IPluginStyleProps.page:
35
+ IPluginStylePage` (`id`, `languageId`, `preview`, `routeParams`), so a plugin
36
+ names the page and the section in its calls and the server checks access and
37
+ reads the section's settings itself (rule 7.7). With it,
38
+ `IPluginStyleProps.pageModal` (`inModal`, `closeModal`) for a style shown in
39
+ the page popup. Both are new required props: a plugin that reads them
40
+ declares the first host version that passes them; an older host does not.
41
+ - **Plugin manifest: catalogue sections (rule 7.8, F112).** `IPluginManifest`
42
+ gains `styleGroups`, `fieldTypes` and `fields`; `IPluginManifestStyle` gains
43
+ `group`, `renamedFrom` and `fields` (the style's field list). The host
44
+ installer writes these rows, tagged with the plugin id, so a plugin migration
45
+ touches only the plugin's own tables. New exported types:
46
+ `IPluginManifestStyleField`, `IPluginManifestStyleGroup`,
47
+ `IPluginManifestFieldType`, `IPluginManifestField`. Additive; needs a minor
48
+ version bump at release (the manifest JSON Schema changed).
49
+ - **Plugin styles can close their popup.** New `IPluginStyleProps` (the props
50
+ the host passes to a plugin style component) with `pageModal:
51
+ IPluginPageModal` (`inModal`, `closeModal()`), so a plugin closes the popup
52
+ its page is shown in the way the core form does with `close_modal_on_save`.
53
+ Additive.
54
+
55
+ ## v1.29.0
56
+
57
+ Minor: live-sync follow-ups (task `2026-11-23-live-sync-follow-ups`; pairs with
58
+ backend 0.1.50, frontend 0.1.77, mobile 0.1.39). Additive, no breaking change.
59
+
60
+ - **Added** `LOCK_IDLE_ENDED_ERROR` (`lock_idle_ended`): `409` when a holder's own
61
+ lock ended by idle expiry and they try to renew; data is `IPageLockStatus`;
62
+ resume through take-over.
63
+ - **Added** `IPagePayload` and `pageFromPayload()` (payload `sync` wins, then
64
+ `page.sync`; no page → `null`; no sync → page unchanged). Prefer these over
65
+ client-local copies.
66
+ - **Changed** `IGetPageResponse` / `IResolvePageResponse` data to
67
+ `{ page; sync?: ISyncBlock | null }`.
68
+ - **Added** schema-parity row for `responses/auth/events.json` ↔
69
+ `IAuthEventsBootstrap`.
70
+
13
71
  ## v1.28.0
14
72
 
15
73
  Minor: live-sync contract (task `2026-11-20-live-sync-and-edit-lock`; pairs with the
package/dist/index.d.mts CHANGED
@@ -79,6 +79,12 @@ interface IAuthEventsBootstrap {
79
79
  declare const PAGE_VERSION_REQUIRED_ERROR: "page_version_required";
80
80
  declare const STALE_PAGE_VERSION_ERROR: "stale_page_version";
81
81
  declare const PAGE_LOCKED_ERROR: "page_locked";
82
+ /**
83
+ * `409` when the caller's own page edit lock ended by idle expiry and they try
84
+ * to renew (`POST .../lock`). Data is {@link IPageLockStatus}. Resume through
85
+ * take-over (`POST .../lock/take-over`), not a plain acquire.
86
+ */
87
+ declare const LOCK_IDLE_ENDED_ERROR: "lock_idle_ended";
82
88
  /**
83
89
  * Draft version of a page (C8). `GET /admin/pages/{page_id}` returns it in its
84
90
  * data (and in the `X-Page-Version` header); admin page types extend this so
@@ -506,6 +512,8 @@ type ILanguagesResponse = IBaseApiResponse<ILanguageItem[]>;
506
512
 
507
513
  type IGetPageResponse = IBaseApiResponse<{
508
514
  page: IPageContent;
515
+ /** Live-sync block next to the page (contract C6); optional on older servers. */
516
+ sync?: ISyncBlock | null;
509
517
  }>;
510
518
  type IGetPagesResponse = IBaseApiResponse<IPageItem[]>;
511
519
  /**
@@ -515,6 +523,8 @@ type IGetPagesResponse = IBaseApiResponse<IPageItem[]>;
515
523
  */
516
524
  type IResolvePageResponse = IBaseApiResponse<{
517
525
  page: IPageContent;
526
+ /** Live-sync block next to the page (contract C6); optional on older servers. */
527
+ sync?: ISyncBlock | null;
518
528
  }>;
519
529
 
520
530
  /**
@@ -2374,6 +2384,23 @@ declare function resolveFieldsMapLabel(fieldKey: string, labels: Record<string,
2374
2384
  declare function serializeFieldsMapCatalog(fieldKeys: string[]): string;
2375
2385
  declare function serializeFieldsMapLabels(labels: Record<string, string>): string;
2376
2386
 
2387
+ /**
2388
+ * Language-independent sentinel (backend `languages` row id 1, locale `all`).
2389
+ *
2390
+ * That row holds values that are the same in every language: page and section
2391
+ * properties, plain-text form cells, and the `all` entries of bundles. It is
2392
+ * not a real language and must not be chosen as a user's language or the CMS
2393
+ * default. Clients refer to it only through these constants — never a bare `1`.
2394
+ *
2395
+ * Mirrors backend `App\Entity\Language::INDEPENDENT_ID` / `INDEPENDENT_LOCALE`.
2396
+ */
2397
+ /** Fixed id of the language-independent sentinel row. */
2398
+ declare const LANGUAGE_INDEPENDENT_ID = 1;
2399
+ /** Locale token of the language-independent sentinel row (`all` in bundles). */
2400
+ declare const LANGUAGE_INDEPENDENT_LOCALE = "all";
2401
+ /** True when `languageId` is the language-independent sentinel. */
2402
+ declare function isLanguageIndependent(languageId: number | null | undefined): boolean;
2403
+
2377
2404
  /**
2378
2405
  * Flatten server-hydrated form `section_data` into a form-record prefill map.
2379
2406
  *
@@ -2431,9 +2458,10 @@ declare function asFilesCell(value: unknown): TFormRecordPrefillFileValue | null
2431
2458
  *
2432
2459
  * - Missing / empty / non-array `section_data` → empty create state.
2433
2460
  * - Rows without a numeric `record_id` are ignored.
2434
- * - Translatable fields accumulate `{ language_id, value }[]` (language id `1`
2435
- * is an Independent seed kept only until a public-language row arrives).
2436
- * - Non-translatable fields prefer language id `1`, else the first seen value.
2461
+ * - Translatable fields accumulate `{ language_id, value }[]` (the
2462
+ * language-independent seed is kept only until a public-language row arrives).
2463
+ * - Non-translatable fields prefer the language-independent row, else the first
2464
+ * seen value.
2437
2465
  */
2438
2466
  declare function parseFormRecordPrefill(section: IFormRecordPrefillSection): IFormRecordPrefill;
2439
2467
  /** A record version as the page offers it: a whole number of at least 1, as a number or as digits. */
@@ -3160,6 +3188,27 @@ declare function pageDependsOn(sync: ISyncBlock | null | undefined, tags: readon
3160
3188
  */
3161
3189
  declare function syncRefetchDelayMs(kind: TSyncRefetchKind, random?: () => number): number;
3162
3190
 
3191
+ /**
3192
+ * Unwrap a page API response so the live-sync block travels with the page.
3193
+ *
3194
+ * The backend answers `{ data: { page, sync } }`: the sync block (contract C6)
3195
+ * sits next to the page, not inside it. Clients that cache the page read
3196
+ * `page.sync` for tag matching and `valid_until`, so every unwrap goes through
3197
+ * {@link pageFromPayload}.
3198
+ */
3199
+
3200
+ /** The `data` of a page response (`/pages/by-keyword`, `/pages/resolve`). */
3201
+ interface IPagePayload {
3202
+ page?: IPageContent | null;
3203
+ sync?: ISyncBlock | null;
3204
+ }
3205
+ /**
3206
+ * The page of a response's `data`, carrying the response's `sync` block.
3207
+ * Prefers `payload.sync`, falls back to `page.sync`. Returns `null` when there
3208
+ * is no page. With no sync at all, returns the page unchanged.
3209
+ */
3210
+ declare function pageFromPayload(payload: IPagePayload | null | undefined): IPageContent | null;
3211
+
3163
3212
  /**
3164
3213
  * Parse the unified `spacing` field. The CMS
3165
3214
  * stores this as a JSON string with optional keys for each side:
@@ -3221,4 +3270,4 @@ declare function transformPageData(apiPage: IRawPage): IPageItem;
3221
3270
  */
3222
3271
  declare function transformPagesData(pages: IRawPage[] | null | undefined): IPageItem[];
3223
3272
 
3224
- 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_RATE_LIMIT_MESSAGE, DEFAULT_WEB_FOOTER_PRESET, DEFAULT_WEB_HEADER_PRESET, type DatabaseMigrationMetadata, ENDPOINTS, FIELDS_MAP_STYLE_CONFIG, FORM_LIST_MAX_PAGE, FORM_LIST_MAX_ROUTE_PARAMS, FORM_LIST_MAX_ROUTE_VALUE_LENGTH, FORM_LIST_MAX_SORTS, FORM_LIST_MAX_VALUE_BYTES, FORM_LIST_MODES, FORM_LIST_SEARCH_MAX_LENGTH, FORM_LIST_SEARCH_MIN_LENGTH, FORM_RECORD_PREFILL_SKIP_FIELDS, type FrontendRelease, HEADER_ACL_STAMP, HEADER_CLIENT_TYPE, HEADER_PAGE_VERSION, HEADER_PAGE_VIEW, IAboutItem, type IAssetSource, type IAuthEventsBootstrap, 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, IFormInvalidData, type IFormListCacheScope, type IFormListFailure, IFormListFilesCell, IFormListRestoreBlockedData, IFormListSort, type IFormListUrlError, type IFormListUrlRules, type IFormListUrlState, type IFormRecordPrefill, type IFormRecordPrefillChild, type IFormRecordPrefillSection, type IFormRecordPrefillTranslatedValue, IFormStaleVersionData, 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 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 IPageDraftVersioned, type IPageField, type IPageFieldTranslation, type IPageFieldsData, type IPageItem, type IPageLockHolder, type IPageLockStatus, 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 IStalePageVersionData, type ISyncBlock, type ISyncChangeMessage, 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, PAGE_LOCKED_ERROR, PAGE_VERSION_REQUIRED_ERROR, 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, STALE_PAGE_VERSION_ERROR, SYNC_CHANGED_MAX_DELAY_MS, SYNC_EVENT_NAME, SYNC_MESSAGE_VERSION, SYNC_TAG_PATTERN, SYNC_VALID_UNTIL_MAX_DELAY_MS, SYSTEM_ENDPOINTS, type SchedulerRelease, type SecurityAdvisory, type ServerInventory, type ServiceBackendCompatibility, type SignatureBlock, type SupportBundleMeta, type TCalcedValues, type TClassDecision, type TClientType, type TCmsAppRole, TFormListMode, type TFormListUrlChange, type TFormListUrlErrorReason, type TFormListUrlParse, type TFormRecordPrefillFieldValue, type TFormRecordPrefillFileValue, 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 TSyncRefetchKind, type TSyncTag, 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, applyFormListUrlChange, arePreviewPreferencesEqual, asFilesCell, asRecordVersion, buildConditionContext, buildPagesResolvePath, buildPagesResolveQuery, buildPagesResolveUrl, buildPublicPathFromRoute, clampMenuItemsAtDepth, classifyClass, classifyClassString, collectPageIdsFromMenuItems, emptyFormListUrlState, encodeFormListQuery, evaluateCondition, expandedIdsForActiveTrail, findMenuItemByPageId, findNearestBottomTabMenuItemForPage, findPageRefInNavigationPayload, findRemap, flattenFooterItems, flattenFormRecordPrefillValues, flattenMenuItems, flattenNavigationMenuItems, footerColumnItems, footerGroupLinks, footerStandaloneItems, formListCacheKey, formListQueryString, formListRouteQuery, formatRateLimitMessage, getFormInvalidData, getFormListFailure, getFormListRestoreBlocked, getFormStaleVersion, getNavigationItemAriaLabel, getNavigationItemHref, getNavigationItemKeyword, getNavigationItemLabel, getNavigationItemMobileHref, getRateLimitRetryAfter, hasInlineFormatting, isBottomTabMenuItemActive, isDoubleWebHeaderPreset, isFormListParam, isMenuItemActiveOnMobile, isMenuItemActiveOnWeb, isMobileIconName, isNavigationBundleVersionSupported, isOnAnyMobileMenu, isOnAnyMobileMenuFromPayload, isPageInMenuTree, isPageInResolvedMenus, isPageOnAnyMenu, isPageOnMobileMenu, isPageOnWebMenu, isPreviewBridgeMessage, isWebFooterPreset, isWebHeaderPreset, matchesMobilePath, matchesWebPath, mergeHeaderLayers, nextSortOnHeaderClick, normalizePagesResolvePath, pageDependsOn, pageUrlToMobileRoute, parseFieldsMapCatalog, parseFieldsMapLabels, parseFormListQuery, parseFormRecordPrefill, parseInlineRich, parseOptionCatalog, parseOptionCodes, parseOptionLabels, parseSpacing, parseSyncMessage, parseSyncMessageJson, pickFormListQuery, 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, syncRefetchDelayMs, transformPageData, transformPagesData };
3273
+ 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_RATE_LIMIT_MESSAGE, DEFAULT_WEB_FOOTER_PRESET, DEFAULT_WEB_HEADER_PRESET, type DatabaseMigrationMetadata, ENDPOINTS, FIELDS_MAP_STYLE_CONFIG, FORM_LIST_MAX_PAGE, FORM_LIST_MAX_ROUTE_PARAMS, FORM_LIST_MAX_ROUTE_VALUE_LENGTH, FORM_LIST_MAX_SORTS, FORM_LIST_MAX_VALUE_BYTES, FORM_LIST_MODES, FORM_LIST_SEARCH_MAX_LENGTH, FORM_LIST_SEARCH_MIN_LENGTH, FORM_RECORD_PREFILL_SKIP_FIELDS, type FrontendRelease, HEADER_ACL_STAMP, HEADER_CLIENT_TYPE, HEADER_PAGE_VERSION, HEADER_PAGE_VIEW, IAboutItem, type IAssetSource, type IAuthEventsBootstrap, 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, IFormInvalidData, type IFormListCacheScope, type IFormListFailure, IFormListFilesCell, IFormListRestoreBlockedData, IFormListSort, type IFormListUrlError, type IFormListUrlRules, type IFormListUrlState, type IFormRecordPrefill, type IFormRecordPrefillChild, type IFormRecordPrefillSection, type IFormRecordPrefillTranslatedValue, IFormStaleVersionData, 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 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 IPageDraftVersioned, type IPageField, type IPageFieldTranslation, type IPageFieldsData, type IPageItem, type IPageLockHolder, type IPageLockStatus, type IPagePayload, 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 IStalePageVersionData, type ISyncBlock, type ISyncChangeMessage, 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, LANGUAGE_INDEPENDENT_ID, LANGUAGE_INDEPENDENT_LOCALE, LITERAL_CLASSES, LOCK_IDLE_ENDED_ERROR, 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, PAGE_LOCKED_ERROR, PAGE_VERSION_REQUIRED_ERROR, 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, STALE_PAGE_VERSION_ERROR, SYNC_CHANGED_MAX_DELAY_MS, SYNC_EVENT_NAME, SYNC_MESSAGE_VERSION, SYNC_TAG_PATTERN, SYNC_VALID_UNTIL_MAX_DELAY_MS, SYSTEM_ENDPOINTS, type SchedulerRelease, type SecurityAdvisory, type ServerInventory, type ServiceBackendCompatibility, type SignatureBlock, type SupportBundleMeta, type TCalcedValues, type TClassDecision, type TClientType, type TCmsAppRole, TFormListMode, type TFormListUrlChange, type TFormListUrlErrorReason, type TFormListUrlParse, type TFormRecordPrefillFieldValue, type TFormRecordPrefillFileValue, 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 TSyncRefetchKind, type TSyncTag, 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, applyFormListUrlChange, arePreviewPreferencesEqual, asFilesCell, asRecordVersion, buildConditionContext, buildPagesResolvePath, buildPagesResolveQuery, buildPagesResolveUrl, buildPublicPathFromRoute, clampMenuItemsAtDepth, classifyClass, classifyClassString, collectPageIdsFromMenuItems, emptyFormListUrlState, encodeFormListQuery, evaluateCondition, expandedIdsForActiveTrail, findMenuItemByPageId, findNearestBottomTabMenuItemForPage, findPageRefInNavigationPayload, findRemap, flattenFooterItems, flattenFormRecordPrefillValues, flattenMenuItems, flattenNavigationMenuItems, footerColumnItems, footerGroupLinks, footerStandaloneItems, formListCacheKey, formListQueryString, formListRouteQuery, formatRateLimitMessage, getFormInvalidData, getFormListFailure, getFormListRestoreBlocked, getFormStaleVersion, getNavigationItemAriaLabel, getNavigationItemHref, getNavigationItemKeyword, getNavigationItemLabel, getNavigationItemMobileHref, getRateLimitRetryAfter, hasInlineFormatting, isBottomTabMenuItemActive, isDoubleWebHeaderPreset, isFormListParam, isLanguageIndependent, isMenuItemActiveOnMobile, isMenuItemActiveOnWeb, isMobileIconName, isNavigationBundleVersionSupported, isOnAnyMobileMenu, isOnAnyMobileMenuFromPayload, isPageInMenuTree, isPageInResolvedMenus, isPageOnAnyMenu, isPageOnMobileMenu, isPageOnWebMenu, isPreviewBridgeMessage, isWebFooterPreset, isWebHeaderPreset, matchesMobilePath, matchesWebPath, mergeHeaderLayers, nextSortOnHeaderClick, normalizePagesResolvePath, pageDependsOn, pageFromPayload, pageUrlToMobileRoute, parseFieldsMapCatalog, parseFieldsMapLabels, parseFormListQuery, parseFormRecordPrefill, parseInlineRich, parseOptionCatalog, parseOptionCodes, parseOptionLabels, parseSpacing, parseSyncMessage, parseSyncMessageJson, pickFormListQuery, 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, syncRefetchDelayMs, transformPageData, transformPagesData };
package/dist/index.d.ts CHANGED
@@ -79,6 +79,12 @@ interface IAuthEventsBootstrap {
79
79
  declare const PAGE_VERSION_REQUIRED_ERROR: "page_version_required";
80
80
  declare const STALE_PAGE_VERSION_ERROR: "stale_page_version";
81
81
  declare const PAGE_LOCKED_ERROR: "page_locked";
82
+ /**
83
+ * `409` when the caller's own page edit lock ended by idle expiry and they try
84
+ * to renew (`POST .../lock`). Data is {@link IPageLockStatus}. Resume through
85
+ * take-over (`POST .../lock/take-over`), not a plain acquire.
86
+ */
87
+ declare const LOCK_IDLE_ENDED_ERROR: "lock_idle_ended";
82
88
  /**
83
89
  * Draft version of a page (C8). `GET /admin/pages/{page_id}` returns it in its
84
90
  * data (and in the `X-Page-Version` header); admin page types extend this so
@@ -506,6 +512,8 @@ type ILanguagesResponse = IBaseApiResponse<ILanguageItem[]>;
506
512
 
507
513
  type IGetPageResponse = IBaseApiResponse<{
508
514
  page: IPageContent;
515
+ /** Live-sync block next to the page (contract C6); optional on older servers. */
516
+ sync?: ISyncBlock | null;
509
517
  }>;
510
518
  type IGetPagesResponse = IBaseApiResponse<IPageItem[]>;
511
519
  /**
@@ -515,6 +523,8 @@ type IGetPagesResponse = IBaseApiResponse<IPageItem[]>;
515
523
  */
516
524
  type IResolvePageResponse = IBaseApiResponse<{
517
525
  page: IPageContent;
526
+ /** Live-sync block next to the page (contract C6); optional on older servers. */
527
+ sync?: ISyncBlock | null;
518
528
  }>;
519
529
 
520
530
  /**
@@ -2374,6 +2384,23 @@ declare function resolveFieldsMapLabel(fieldKey: string, labels: Record<string,
2374
2384
  declare function serializeFieldsMapCatalog(fieldKeys: string[]): string;
2375
2385
  declare function serializeFieldsMapLabels(labels: Record<string, string>): string;
2376
2386
 
2387
+ /**
2388
+ * Language-independent sentinel (backend `languages` row id 1, locale `all`).
2389
+ *
2390
+ * That row holds values that are the same in every language: page and section
2391
+ * properties, plain-text form cells, and the `all` entries of bundles. It is
2392
+ * not a real language and must not be chosen as a user's language or the CMS
2393
+ * default. Clients refer to it only through these constants — never a bare `1`.
2394
+ *
2395
+ * Mirrors backend `App\Entity\Language::INDEPENDENT_ID` / `INDEPENDENT_LOCALE`.
2396
+ */
2397
+ /** Fixed id of the language-independent sentinel row. */
2398
+ declare const LANGUAGE_INDEPENDENT_ID = 1;
2399
+ /** Locale token of the language-independent sentinel row (`all` in bundles). */
2400
+ declare const LANGUAGE_INDEPENDENT_LOCALE = "all";
2401
+ /** True when `languageId` is the language-independent sentinel. */
2402
+ declare function isLanguageIndependent(languageId: number | null | undefined): boolean;
2403
+
2377
2404
  /**
2378
2405
  * Flatten server-hydrated form `section_data` into a form-record prefill map.
2379
2406
  *
@@ -2431,9 +2458,10 @@ declare function asFilesCell(value: unknown): TFormRecordPrefillFileValue | null
2431
2458
  *
2432
2459
  * - Missing / empty / non-array `section_data` → empty create state.
2433
2460
  * - Rows without a numeric `record_id` are ignored.
2434
- * - Translatable fields accumulate `{ language_id, value }[]` (language id `1`
2435
- * is an Independent seed kept only until a public-language row arrives).
2436
- * - Non-translatable fields prefer language id `1`, else the first seen value.
2461
+ * - Translatable fields accumulate `{ language_id, value }[]` (the
2462
+ * language-independent seed is kept only until a public-language row arrives).
2463
+ * - Non-translatable fields prefer the language-independent row, else the first
2464
+ * seen value.
2437
2465
  */
2438
2466
  declare function parseFormRecordPrefill(section: IFormRecordPrefillSection): IFormRecordPrefill;
2439
2467
  /** A record version as the page offers it: a whole number of at least 1, as a number or as digits. */
@@ -3160,6 +3188,27 @@ declare function pageDependsOn(sync: ISyncBlock | null | undefined, tags: readon
3160
3188
  */
3161
3189
  declare function syncRefetchDelayMs(kind: TSyncRefetchKind, random?: () => number): number;
3162
3190
 
3191
+ /**
3192
+ * Unwrap a page API response so the live-sync block travels with the page.
3193
+ *
3194
+ * The backend answers `{ data: { page, sync } }`: the sync block (contract C6)
3195
+ * sits next to the page, not inside it. Clients that cache the page read
3196
+ * `page.sync` for tag matching and `valid_until`, so every unwrap goes through
3197
+ * {@link pageFromPayload}.
3198
+ */
3199
+
3200
+ /** The `data` of a page response (`/pages/by-keyword`, `/pages/resolve`). */
3201
+ interface IPagePayload {
3202
+ page?: IPageContent | null;
3203
+ sync?: ISyncBlock | null;
3204
+ }
3205
+ /**
3206
+ * The page of a response's `data`, carrying the response's `sync` block.
3207
+ * Prefers `payload.sync`, falls back to `page.sync`. Returns `null` when there
3208
+ * is no page. With no sync at all, returns the page unchanged.
3209
+ */
3210
+ declare function pageFromPayload(payload: IPagePayload | null | undefined): IPageContent | null;
3211
+
3163
3212
  /**
3164
3213
  * Parse the unified `spacing` field. The CMS
3165
3214
  * stores this as a JSON string with optional keys for each side:
@@ -3221,4 +3270,4 @@ declare function transformPageData(apiPage: IRawPage): IPageItem;
3221
3270
  */
3222
3271
  declare function transformPagesData(pages: IRawPage[] | null | undefined): IPageItem[];
3223
3272
 
3224
- 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_RATE_LIMIT_MESSAGE, DEFAULT_WEB_FOOTER_PRESET, DEFAULT_WEB_HEADER_PRESET, type DatabaseMigrationMetadata, ENDPOINTS, FIELDS_MAP_STYLE_CONFIG, FORM_LIST_MAX_PAGE, FORM_LIST_MAX_ROUTE_PARAMS, FORM_LIST_MAX_ROUTE_VALUE_LENGTH, FORM_LIST_MAX_SORTS, FORM_LIST_MAX_VALUE_BYTES, FORM_LIST_MODES, FORM_LIST_SEARCH_MAX_LENGTH, FORM_LIST_SEARCH_MIN_LENGTH, FORM_RECORD_PREFILL_SKIP_FIELDS, type FrontendRelease, HEADER_ACL_STAMP, HEADER_CLIENT_TYPE, HEADER_PAGE_VERSION, HEADER_PAGE_VIEW, IAboutItem, type IAssetSource, type IAuthEventsBootstrap, 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, IFormInvalidData, type IFormListCacheScope, type IFormListFailure, IFormListFilesCell, IFormListRestoreBlockedData, IFormListSort, type IFormListUrlError, type IFormListUrlRules, type IFormListUrlState, type IFormRecordPrefill, type IFormRecordPrefillChild, type IFormRecordPrefillSection, type IFormRecordPrefillTranslatedValue, IFormStaleVersionData, 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 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 IPageDraftVersioned, type IPageField, type IPageFieldTranslation, type IPageFieldsData, type IPageItem, type IPageLockHolder, type IPageLockStatus, 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 IStalePageVersionData, type ISyncBlock, type ISyncChangeMessage, 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, PAGE_LOCKED_ERROR, PAGE_VERSION_REQUIRED_ERROR, 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, STALE_PAGE_VERSION_ERROR, SYNC_CHANGED_MAX_DELAY_MS, SYNC_EVENT_NAME, SYNC_MESSAGE_VERSION, SYNC_TAG_PATTERN, SYNC_VALID_UNTIL_MAX_DELAY_MS, SYSTEM_ENDPOINTS, type SchedulerRelease, type SecurityAdvisory, type ServerInventory, type ServiceBackendCompatibility, type SignatureBlock, type SupportBundleMeta, type TCalcedValues, type TClassDecision, type TClientType, type TCmsAppRole, TFormListMode, type TFormListUrlChange, type TFormListUrlErrorReason, type TFormListUrlParse, type TFormRecordPrefillFieldValue, type TFormRecordPrefillFileValue, 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 TSyncRefetchKind, type TSyncTag, 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, applyFormListUrlChange, arePreviewPreferencesEqual, asFilesCell, asRecordVersion, buildConditionContext, buildPagesResolvePath, buildPagesResolveQuery, buildPagesResolveUrl, buildPublicPathFromRoute, clampMenuItemsAtDepth, classifyClass, classifyClassString, collectPageIdsFromMenuItems, emptyFormListUrlState, encodeFormListQuery, evaluateCondition, expandedIdsForActiveTrail, findMenuItemByPageId, findNearestBottomTabMenuItemForPage, findPageRefInNavigationPayload, findRemap, flattenFooterItems, flattenFormRecordPrefillValues, flattenMenuItems, flattenNavigationMenuItems, footerColumnItems, footerGroupLinks, footerStandaloneItems, formListCacheKey, formListQueryString, formListRouteQuery, formatRateLimitMessage, getFormInvalidData, getFormListFailure, getFormListRestoreBlocked, getFormStaleVersion, getNavigationItemAriaLabel, getNavigationItemHref, getNavigationItemKeyword, getNavigationItemLabel, getNavigationItemMobileHref, getRateLimitRetryAfter, hasInlineFormatting, isBottomTabMenuItemActive, isDoubleWebHeaderPreset, isFormListParam, isMenuItemActiveOnMobile, isMenuItemActiveOnWeb, isMobileIconName, isNavigationBundleVersionSupported, isOnAnyMobileMenu, isOnAnyMobileMenuFromPayload, isPageInMenuTree, isPageInResolvedMenus, isPageOnAnyMenu, isPageOnMobileMenu, isPageOnWebMenu, isPreviewBridgeMessage, isWebFooterPreset, isWebHeaderPreset, matchesMobilePath, matchesWebPath, mergeHeaderLayers, nextSortOnHeaderClick, normalizePagesResolvePath, pageDependsOn, pageUrlToMobileRoute, parseFieldsMapCatalog, parseFieldsMapLabels, parseFormListQuery, parseFormRecordPrefill, parseInlineRich, parseOptionCatalog, parseOptionCodes, parseOptionLabels, parseSpacing, parseSyncMessage, parseSyncMessageJson, pickFormListQuery, 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, syncRefetchDelayMs, transformPageData, transformPagesData };
3273
+ 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_RATE_LIMIT_MESSAGE, DEFAULT_WEB_FOOTER_PRESET, DEFAULT_WEB_HEADER_PRESET, type DatabaseMigrationMetadata, ENDPOINTS, FIELDS_MAP_STYLE_CONFIG, FORM_LIST_MAX_PAGE, FORM_LIST_MAX_ROUTE_PARAMS, FORM_LIST_MAX_ROUTE_VALUE_LENGTH, FORM_LIST_MAX_SORTS, FORM_LIST_MAX_VALUE_BYTES, FORM_LIST_MODES, FORM_LIST_SEARCH_MAX_LENGTH, FORM_LIST_SEARCH_MIN_LENGTH, FORM_RECORD_PREFILL_SKIP_FIELDS, type FrontendRelease, HEADER_ACL_STAMP, HEADER_CLIENT_TYPE, HEADER_PAGE_VERSION, HEADER_PAGE_VIEW, IAboutItem, type IAssetSource, type IAuthEventsBootstrap, 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, IFormInvalidData, type IFormListCacheScope, type IFormListFailure, IFormListFilesCell, IFormListRestoreBlockedData, IFormListSort, type IFormListUrlError, type IFormListUrlRules, type IFormListUrlState, type IFormRecordPrefill, type IFormRecordPrefillChild, type IFormRecordPrefillSection, type IFormRecordPrefillTranslatedValue, IFormStaleVersionData, 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 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 IPageDraftVersioned, type IPageField, type IPageFieldTranslation, type IPageFieldsData, type IPageItem, type IPageLockHolder, type IPageLockStatus, type IPagePayload, 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 IStalePageVersionData, type ISyncBlock, type ISyncChangeMessage, 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, LANGUAGE_INDEPENDENT_ID, LANGUAGE_INDEPENDENT_LOCALE, LITERAL_CLASSES, LOCK_IDLE_ENDED_ERROR, 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, PAGE_LOCKED_ERROR, PAGE_VERSION_REQUIRED_ERROR, 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, STALE_PAGE_VERSION_ERROR, SYNC_CHANGED_MAX_DELAY_MS, SYNC_EVENT_NAME, SYNC_MESSAGE_VERSION, SYNC_TAG_PATTERN, SYNC_VALID_UNTIL_MAX_DELAY_MS, SYSTEM_ENDPOINTS, type SchedulerRelease, type SecurityAdvisory, type ServerInventory, type ServiceBackendCompatibility, type SignatureBlock, type SupportBundleMeta, type TCalcedValues, type TClassDecision, type TClientType, type TCmsAppRole, TFormListMode, type TFormListUrlChange, type TFormListUrlErrorReason, type TFormListUrlParse, type TFormRecordPrefillFieldValue, type TFormRecordPrefillFileValue, 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 TSyncRefetchKind, type TSyncTag, 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, applyFormListUrlChange, arePreviewPreferencesEqual, asFilesCell, asRecordVersion, buildConditionContext, buildPagesResolvePath, buildPagesResolveQuery, buildPagesResolveUrl, buildPublicPathFromRoute, clampMenuItemsAtDepth, classifyClass, classifyClassString, collectPageIdsFromMenuItems, emptyFormListUrlState, encodeFormListQuery, evaluateCondition, expandedIdsForActiveTrail, findMenuItemByPageId, findNearestBottomTabMenuItemForPage, findPageRefInNavigationPayload, findRemap, flattenFooterItems, flattenFormRecordPrefillValues, flattenMenuItems, flattenNavigationMenuItems, footerColumnItems, footerGroupLinks, footerStandaloneItems, formListCacheKey, formListQueryString, formListRouteQuery, formatRateLimitMessage, getFormInvalidData, getFormListFailure, getFormListRestoreBlocked, getFormStaleVersion, getNavigationItemAriaLabel, getNavigationItemHref, getNavigationItemKeyword, getNavigationItemLabel, getNavigationItemMobileHref, getRateLimitRetryAfter, hasInlineFormatting, isBottomTabMenuItemActive, isDoubleWebHeaderPreset, isFormListParam, isLanguageIndependent, isMenuItemActiveOnMobile, isMenuItemActiveOnWeb, isMobileIconName, isNavigationBundleVersionSupported, isOnAnyMobileMenu, isOnAnyMobileMenuFromPayload, isPageInMenuTree, isPageInResolvedMenus, isPageOnAnyMenu, isPageOnMobileMenu, isPageOnWebMenu, isPreviewBridgeMessage, isWebFooterPreset, isWebHeaderPreset, matchesMobilePath, matchesWebPath, mergeHeaderLayers, nextSortOnHeaderClick, normalizePagesResolvePath, pageDependsOn, pageFromPayload, pageUrlToMobileRoute, parseFieldsMapCatalog, parseFieldsMapLabels, parseFormListQuery, parseFormRecordPrefill, parseInlineRich, parseOptionCatalog, parseOptionCodes, parseOptionLabels, parseSpacing, parseSyncMessage, parseSyncMessageJson, pickFormListQuery, 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, syncRefetchDelayMs, transformPageData, transformPagesData };
package/dist/index.js CHANGED
@@ -65,8 +65,11 @@ __export(index_exports, {
65
65
  HEADER_CLIENT_TYPE: () => HEADER_CLIENT_TYPE,
66
66
  HEADER_PAGE_VERSION: () => HEADER_PAGE_VERSION,
67
67
  HEADER_PAGE_VIEW: () => HEADER_PAGE_VIEW,
68
+ LANGUAGE_INDEPENDENT_ID: () => LANGUAGE_INDEPENDENT_ID,
69
+ LANGUAGE_INDEPENDENT_LOCALE: () => LANGUAGE_INDEPENDENT_LOCALE,
68
70
  LINE_HEIGHT: () => LINE_HEIGHT,
69
71
  LITERAL_CLASSES: () => LITERAL_CLASSES,
72
+ LOCK_IDLE_ENDED_ERROR: () => LOCK_IDLE_ENDED_ERROR,
70
73
  MOBILE_ICON_NAMES: () => MOBILE_ICON_NAMES,
71
74
  MOBILE_ICON_SET: () => MOBILE_ICON_SET,
72
75
  MOBILE_PREVIEW_ENDPOINTS: () => MOBILE_PREVIEW_ENDPOINTS,
@@ -157,6 +160,7 @@ __export(index_exports, {
157
160
  isDoubleWebHeaderPreset: () => isDoubleWebHeaderPreset,
158
161
  isFormListParam: () => isFormListParam,
159
162
  isKnownStyleName: () => isKnownStyleName,
163
+ isLanguageIndependent: () => isLanguageIndependent,
160
164
  isMenuItemActiveOnMobile: () => isMenuItemActiveOnMobile,
161
165
  isMenuItemActiveOnWeb: () => isMenuItemActiveOnWeb,
162
166
  isMobileIconName: () => isMobileIconName,
@@ -192,6 +196,7 @@ __export(index_exports, {
192
196
  nextSortOnHeaderClick: () => nextSortOnHeaderClick,
193
197
  normalizePagesResolvePath: () => normalizePagesResolvePath,
194
198
  pageDependsOn: () => pageDependsOn,
199
+ pageFromPayload: () => pageFromPayload,
195
200
  pageUrlToMobileRoute: () => pageUrlToMobileRoute,
196
201
  parseDimensionToReactNative: () => parseDimensionToReactNative,
197
202
  parseDimensionToWeb: () => parseDimensionToWeb,
@@ -2037,6 +2042,13 @@ function serializeFieldsMapLabels(labels) {
2037
2042
  return JSON.stringify(clean);
2038
2043
  }
2039
2044
 
2045
+ // src/content/languageIndependent.ts
2046
+ var LANGUAGE_INDEPENDENT_ID = 1;
2047
+ var LANGUAGE_INDEPENDENT_LOCALE = "all";
2048
+ function isLanguageIndependent(languageId) {
2049
+ return languageId === LANGUAGE_INDEPENDENT_ID;
2050
+ }
2051
+
2040
2052
  // src/content/formRecordPrefill.ts
2041
2053
  var FORM_RECORD_PREFILL_SKIP_FIELDS = /* @__PURE__ */ new Set([
2042
2054
  "record_id",
@@ -2131,7 +2143,7 @@ function parseFormRecordPrefill(section) {
2131
2143
  }
2132
2144
  const filesCell = asFilesCell(fieldValue);
2133
2145
  if (filesCell !== null) {
2134
- if (languageId === 1 || !recordGroups[recordId][fieldName]) {
2146
+ if (isLanguageIndependent(languageId) || !recordGroups[recordId][fieldName]) {
2135
2147
  recordGroups[recordId][fieldName] = filesCell;
2136
2148
  }
2137
2149
  continue;
@@ -2142,7 +2154,7 @@ function parseFormRecordPrefill(section) {
2142
2154
  }
2143
2155
  const translatable = isTranslatableChild(section.children, fieldName);
2144
2156
  if (translatable) {
2145
- if (languageId === 1) {
2157
+ if (isLanguageIndependent(languageId)) {
2146
2158
  if (!recordGroups[recordId][fieldName]) {
2147
2159
  recordGroups[recordId][fieldName] = value;
2148
2160
  }
@@ -2163,7 +2175,7 @@ function parseFormRecordPrefill(section) {
2163
2175
  }
2164
2176
  }
2165
2177
  }
2166
- } else if (languageId === 1 || !recordGroups[recordId][fieldName]) {
2178
+ } else if (isLanguageIndependent(languageId) || !recordGroups[recordId][fieldName]) {
2167
2179
  recordGroups[recordId][fieldName] = value;
2168
2180
  }
2169
2181
  }
@@ -2200,7 +2212,7 @@ function flattenFormRecordPrefillValues(values, languageId) {
2200
2212
  continue;
2201
2213
  }
2202
2214
  }
2203
- const nonIndependent = value.find((entry) => entry.language_id !== 1);
2215
+ const nonIndependent = value.find((entry) => !isLanguageIndependent(entry.language_id));
2204
2216
  out[key] = (nonIndependent ?? value[0]).value;
2205
2217
  }
2206
2218
  return out;
@@ -3290,6 +3302,7 @@ var SYNC_TAG_PATTERN = /^(acl|navigation|global_values|page:\d+|page_draft:\d+|p
3290
3302
  var PAGE_VERSION_REQUIRED_ERROR = "page_version_required";
3291
3303
  var STALE_PAGE_VERSION_ERROR = "stale_page_version";
3292
3304
  var PAGE_LOCKED_ERROR = "page_locked";
3305
+ var LOCK_IDLE_ENDED_ERROR = "lock_idle_ended";
3293
3306
 
3294
3307
  // src/sync/sync.ts
3295
3308
  var SYNC_CHANGED_MAX_DELAY_MS = 300;
@@ -3329,6 +3342,16 @@ function syncRefetchDelayMs(kind, random = Math.random) {
3329
3342
  return Math.min(max, Math.floor(unit * (max + 1)));
3330
3343
  }
3331
3344
 
3345
+ // src/sync/page-payload.ts
3346
+ function pageFromPayload(payload) {
3347
+ const page = payload?.page;
3348
+ if (!page) {
3349
+ return null;
3350
+ }
3351
+ const sync = payload.sync ?? page.sync;
3352
+ return sync ? { ...page, sync } : page;
3353
+ }
3354
+
3332
3355
  // src/utils/spacing.ts
3333
3356
  var ALLOWED_KEYS = ["mt", "mb", "ms", "me", "pt", "pb", "ps", "pe"];
3334
3357
  function parseSpacing(raw) {
@@ -3430,8 +3453,11 @@ function transformPagesData(pages) {
3430
3453
  HEADER_CLIENT_TYPE,
3431
3454
  HEADER_PAGE_VERSION,
3432
3455
  HEADER_PAGE_VIEW,
3456
+ LANGUAGE_INDEPENDENT_ID,
3457
+ LANGUAGE_INDEPENDENT_LOCALE,
3433
3458
  LINE_HEIGHT,
3434
3459
  LITERAL_CLASSES,
3460
+ LOCK_IDLE_ENDED_ERROR,
3435
3461
  MOBILE_ICON_NAMES,
3436
3462
  MOBILE_ICON_SET,
3437
3463
  MOBILE_PREVIEW_ENDPOINTS,
@@ -3522,6 +3548,7 @@ function transformPagesData(pages) {
3522
3548
  isDoubleWebHeaderPreset,
3523
3549
  isFormListParam,
3524
3550
  isKnownStyleName,
3551
+ isLanguageIndependent,
3525
3552
  isMenuItemActiveOnMobile,
3526
3553
  isMenuItemActiveOnWeb,
3527
3554
  isMobileIconName,
@@ -3557,6 +3584,7 @@ function transformPagesData(pages) {
3557
3584
  nextSortOnHeaderClick,
3558
3585
  normalizePagesResolvePath,
3559
3586
  pageDependsOn,
3587
+ pageFromPayload,
3560
3588
  pageUrlToMobileRoute,
3561
3589
  parseDimensionToReactNative,
3562
3590
  parseDimensionToWeb,
package/dist/index.mjs CHANGED
@@ -1778,6 +1778,13 @@ function serializeFieldsMapLabels(labels) {
1778
1778
  return JSON.stringify(clean);
1779
1779
  }
1780
1780
 
1781
+ // src/content/languageIndependent.ts
1782
+ var LANGUAGE_INDEPENDENT_ID = 1;
1783
+ var LANGUAGE_INDEPENDENT_LOCALE = "all";
1784
+ function isLanguageIndependent(languageId) {
1785
+ return languageId === LANGUAGE_INDEPENDENT_ID;
1786
+ }
1787
+
1781
1788
  // src/content/formRecordPrefill.ts
1782
1789
  var FORM_RECORD_PREFILL_SKIP_FIELDS = /* @__PURE__ */ new Set([
1783
1790
  "record_id",
@@ -1872,7 +1879,7 @@ function parseFormRecordPrefill(section) {
1872
1879
  }
1873
1880
  const filesCell = asFilesCell(fieldValue);
1874
1881
  if (filesCell !== null) {
1875
- if (languageId === 1 || !recordGroups[recordId][fieldName]) {
1882
+ if (isLanguageIndependent(languageId) || !recordGroups[recordId][fieldName]) {
1876
1883
  recordGroups[recordId][fieldName] = filesCell;
1877
1884
  }
1878
1885
  continue;
@@ -1883,7 +1890,7 @@ function parseFormRecordPrefill(section) {
1883
1890
  }
1884
1891
  const translatable = isTranslatableChild(section.children, fieldName);
1885
1892
  if (translatable) {
1886
- if (languageId === 1) {
1893
+ if (isLanguageIndependent(languageId)) {
1887
1894
  if (!recordGroups[recordId][fieldName]) {
1888
1895
  recordGroups[recordId][fieldName] = value;
1889
1896
  }
@@ -1904,7 +1911,7 @@ function parseFormRecordPrefill(section) {
1904
1911
  }
1905
1912
  }
1906
1913
  }
1907
- } else if (languageId === 1 || !recordGroups[recordId][fieldName]) {
1914
+ } else if (isLanguageIndependent(languageId) || !recordGroups[recordId][fieldName]) {
1908
1915
  recordGroups[recordId][fieldName] = value;
1909
1916
  }
1910
1917
  }
@@ -1941,7 +1948,7 @@ function flattenFormRecordPrefillValues(values, languageId) {
1941
1948
  continue;
1942
1949
  }
1943
1950
  }
1944
- const nonIndependent = value.find((entry) => entry.language_id !== 1);
1951
+ const nonIndependent = value.find((entry) => !isLanguageIndependent(entry.language_id));
1945
1952
  out[key] = (nonIndependent ?? value[0]).value;
1946
1953
  }
1947
1954
  return out;
@@ -3031,6 +3038,7 @@ var SYNC_TAG_PATTERN = /^(acl|navigation|global_values|page:\d+|page_draft:\d+|p
3031
3038
  var PAGE_VERSION_REQUIRED_ERROR = "page_version_required";
3032
3039
  var STALE_PAGE_VERSION_ERROR = "stale_page_version";
3033
3040
  var PAGE_LOCKED_ERROR = "page_locked";
3041
+ var LOCK_IDLE_ENDED_ERROR = "lock_idle_ended";
3034
3042
 
3035
3043
  // src/sync/sync.ts
3036
3044
  var SYNC_CHANGED_MAX_DELAY_MS = 300;
@@ -3070,6 +3078,16 @@ function syncRefetchDelayMs(kind, random = Math.random) {
3070
3078
  return Math.min(max, Math.floor(unit * (max + 1)));
3071
3079
  }
3072
3080
 
3081
+ // src/sync/page-payload.ts
3082
+ function pageFromPayload(payload) {
3083
+ const page = payload?.page;
3084
+ if (!page) {
3085
+ return null;
3086
+ }
3087
+ const sync = payload.sync ?? page.sync;
3088
+ return sync ? { ...page, sync } : page;
3089
+ }
3090
+
3073
3091
  // src/utils/spacing.ts
3074
3092
  var ALLOWED_KEYS = ["mt", "mb", "ms", "me", "pt", "pb", "ps", "pe"];
3075
3093
  function parseSpacing(raw) {
@@ -3170,8 +3188,11 @@ export {
3170
3188
  HEADER_CLIENT_TYPE,
3171
3189
  HEADER_PAGE_VERSION,
3172
3190
  HEADER_PAGE_VIEW,
3191
+ LANGUAGE_INDEPENDENT_ID,
3192
+ LANGUAGE_INDEPENDENT_LOCALE,
3173
3193
  LINE_HEIGHT,
3174
3194
  LITERAL_CLASSES,
3195
+ LOCK_IDLE_ENDED_ERROR,
3175
3196
  MOBILE_ICON_NAMES,
3176
3197
  MOBILE_ICON_SET,
3177
3198
  MOBILE_PREVIEW_ENDPOINTS,
@@ -3262,6 +3283,7 @@ export {
3262
3283
  isDoubleWebHeaderPreset,
3263
3284
  isFormListParam,
3264
3285
  isKnownStyleName,
3286
+ isLanguageIndependent,
3265
3287
  isMenuItemActiveOnMobile,
3266
3288
  isMenuItemActiveOnWeb,
3267
3289
  isMobileIconName,
@@ -3297,6 +3319,7 @@ export {
3297
3319
  nextSortOnHeaderClick,
3298
3320
  normalizePagesResolvePath,
3299
3321
  pageDependsOn,
3322
+ pageFromPayload,
3300
3323
  pageUrlToMobileRoute,
3301
3324
  parseDimensionToReactNative,
3302
3325
  parseDimensionToWeb,
@@ -127,6 +127,16 @@ interface IPluginManifestPermission {
127
127
  /** Optional default role keys the permission is granted to. */
128
128
  defaultRoles?: string[];
129
129
  }
130
+ /** A field linked to a plugin style, with its editor metadata. */
131
+ interface IPluginManifestStyleField {
132
+ /** A field of the plugin (`fields`) or a core field such as `own_entries_only`. */
133
+ name: string;
134
+ title?: string;
135
+ help?: string;
136
+ default?: string | null;
137
+ hidden?: boolean;
138
+ disabled?: boolean;
139
+ }
130
140
  interface IPluginManifestStyle {
131
141
  /** Style name (used as `style_name` discriminator). */
132
142
  name: string;
@@ -134,6 +144,34 @@ interface IPluginManifestStyle {
134
144
  canHaveChildren: boolean;
135
145
  /** Optional capability requirement (e.g. `frontendStyles`). */
136
146
  capability?: IPluginManifestCapability;
147
+ /** Style group name; required when the installer creates the style. */
148
+ group?: string;
149
+ /** Earlier names of this style; the installer renames the row in place. */
150
+ renamedFrom?: string[];
151
+ /** When present, the installer makes the style's field links match this list. */
152
+ fields?: IPluginManifestStyleField[];
153
+ }
154
+ /** Style group written into `style_groups` by the host installer (rule 7.8). */
155
+ interface IPluginManifestStyleGroup {
156
+ name: string;
157
+ description?: string;
158
+ position?: number;
159
+ }
160
+ /** Field type (editor control) written into `field_types`; kebab-case name. */
161
+ interface IPluginManifestFieldType {
162
+ name: string;
163
+ position?: number;
164
+ }
165
+ /** Plugin-owned field written into `fields`; snake_case name. */
166
+ interface IPluginManifestField {
167
+ name: string;
168
+ /** A core field type or one declared under `fieldTypes`. */
169
+ type: string;
170
+ /** True for participant-facing content stored per language. */
171
+ translatable?: boolean;
172
+ config?: Record<string, unknown> | null;
173
+ /** Earlier names of this field; the installer renames the row in place. */
174
+ renamedFrom?: string[];
137
175
  }
138
176
  interface IPluginManifestAdminPage {
139
177
  /** Slug under `/admin/plugins-host/{pluginId}/`. */
@@ -249,6 +287,12 @@ interface IPluginManifest {
249
287
  };
250
288
  /** Styles contributed to the registry. */
251
289
  styles?: IPluginManifestStyle[];
290
+ /** Style groups the host installer writes (rule 7.8). */
291
+ styleGroups?: IPluginManifestStyleGroup[];
292
+ /** Field types the host installer writes (rule 7.8). */
293
+ fieldTypes?: IPluginManifestFieldType[];
294
+ /** Plugin-owned fields the host installer writes (rule 7.8). */
295
+ fields?: IPluginManifestField[];
252
296
  /** Admin pages mounted under `/admin/plugins-host/{pluginId}/`. */
253
297
  adminPages?: IPluginManifestAdminPage[];
254
298
  /** Plugin-owned API routes. */
@@ -263,4 +307,4 @@ interface IPluginManifest {
263
307
  labels?: Record<string, string>;
264
308
  }
265
309
 
266
- export type { IPluginManifest as I, IPluginManifestAdminPage as a, IPluginManifestApiRoute as b, IPluginManifestAsset as c, IPluginManifestCapability as d, IPluginManifestCompatibility as e, IPluginManifestConflict as f, IPluginManifestDataAccess as g, IPluginManifestDependency as h, IPluginManifestExternalHost as i, IPluginManifestFeatureFlag as j, IPluginManifestHealth as k, IPluginManifestLookupExtension as l, IPluginManifestMobile as m, IPluginManifestPermission as n, IPluginManifestRealtimeTopic as o, IPluginManifestScheduledJob as p, IPluginManifestSecurity as q, IPluginManifestStyle as r, IPluginManifestTrustLevel as s };
310
+ export type { IPluginManifest as I, IPluginManifestAdminPage as a, IPluginManifestApiRoute as b, IPluginManifestAsset as c, IPluginManifestCapability as d, IPluginManifestCompatibility as e, IPluginManifestConflict as f, IPluginManifestDataAccess as g, IPluginManifestDependency as h, IPluginManifestExternalHost as i, IPluginManifestFeatureFlag as j, IPluginManifestField as k, IPluginManifestFieldType as l, IPluginManifestHealth as m, IPluginManifestLookupExtension as n, IPluginManifestMobile as o, IPluginManifestPermission as p, IPluginManifestRealtimeTopic as q, IPluginManifestScheduledJob as r, IPluginManifestSecurity as s, IPluginManifestStyle as t, IPluginManifestStyleField as u, IPluginManifestStyleGroup as v, IPluginManifestTrustLevel as w };