@selfhelp/shared 1.29.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 +42 -0
- package/dist/index.d.mts +22 -4
- package/dist/index.d.ts +22 -4
- package/dist/index.js +17 -4
- package/dist/index.mjs +14 -4
- package/dist/{manifest-BNnCN1Qo.d.mts → manifest-DRlcSvvy.d.mts} +45 -1
- package/dist/{manifest-BNnCN1Qo.d.ts → manifest-DRlcSvvy.d.ts} +45 -1
- package/dist/plugin-sdk/index.d.mts +57 -4
- package/dist/plugin-sdk/index.d.ts +57 -4
- package/dist/testing/index.d.mts +1 -1
- package/dist/testing/index.d.ts +1 -1
- package/package.json +1 -1
- package/src/content/__tests__/languageIndependent.test.ts +26 -0
- package/src/content/__tests__/languageIndependentLiteral.test.ts +62 -0
- package/src/content/formRecordPrefill.ts +9 -7
- package/src/content/index.ts +1 -0
- package/src/content/languageIndependent.ts +28 -0
- package/src/plugin-sdk/index.ts +7 -0
- package/src/plugin-sdk/manifest.ts +51 -0
- package/src/plugin-sdk/types.ts +58 -2
package/CHANGELOG.md
CHANGED
|
@@ -10,6 +10,48 @@ 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
|
+
|
|
13
55
|
## v1.29.0
|
|
14
56
|
|
|
15
57
|
Minor: live-sync follow-ups (task `2026-11-23-live-sync-follow-ups`; pairs with
|
package/dist/index.d.mts
CHANGED
|
@@ -2384,6 +2384,23 @@ declare function resolveFieldsMapLabel(fieldKey: string, labels: Record<string,
|
|
|
2384
2384
|
declare function serializeFieldsMapCatalog(fieldKeys: string[]): string;
|
|
2385
2385
|
declare function serializeFieldsMapLabels(labels: Record<string, string>): string;
|
|
2386
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
|
+
|
|
2387
2404
|
/**
|
|
2388
2405
|
* Flatten server-hydrated form `section_data` into a form-record prefill map.
|
|
2389
2406
|
*
|
|
@@ -2441,9 +2458,10 @@ declare function asFilesCell(value: unknown): TFormRecordPrefillFileValue | null
|
|
|
2441
2458
|
*
|
|
2442
2459
|
* - Missing / empty / non-array `section_data` → empty create state.
|
|
2443
2460
|
* - Rows without a numeric `record_id` are ignored.
|
|
2444
|
-
* - Translatable fields accumulate `{ language_id, value }[]` (
|
|
2445
|
-
*
|
|
2446
|
-
* - Non-translatable fields prefer language
|
|
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.
|
|
2447
2465
|
*/
|
|
2448
2466
|
declare function parseFormRecordPrefill(section: IFormRecordPrefillSection): IFormRecordPrefill;
|
|
2449
2467
|
/** A record version as the page offers it: a whole number of at least 1, as a number or as digits. */
|
|
@@ -3252,4 +3270,4 @@ declare function transformPageData(apiPage: IRawPage): IPageItem;
|
|
|
3252
3270
|
*/
|
|
3253
3271
|
declare function transformPagesData(pages: IRawPage[] | null | undefined): IPageItem[];
|
|
3254
3272
|
|
|
3255
|
-
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, 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, 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 };
|
|
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
|
@@ -2384,6 +2384,23 @@ declare function resolveFieldsMapLabel(fieldKey: string, labels: Record<string,
|
|
|
2384
2384
|
declare function serializeFieldsMapCatalog(fieldKeys: string[]): string;
|
|
2385
2385
|
declare function serializeFieldsMapLabels(labels: Record<string, string>): string;
|
|
2386
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
|
+
|
|
2387
2404
|
/**
|
|
2388
2405
|
* Flatten server-hydrated form `section_data` into a form-record prefill map.
|
|
2389
2406
|
*
|
|
@@ -2441,9 +2458,10 @@ declare function asFilesCell(value: unknown): TFormRecordPrefillFileValue | null
|
|
|
2441
2458
|
*
|
|
2442
2459
|
* - Missing / empty / non-array `section_data` → empty create state.
|
|
2443
2460
|
* - Rows without a numeric `record_id` are ignored.
|
|
2444
|
-
* - Translatable fields accumulate `{ language_id, value }[]` (
|
|
2445
|
-
*
|
|
2446
|
-
* - Non-translatable fields prefer language
|
|
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.
|
|
2447
2465
|
*/
|
|
2448
2466
|
declare function parseFormRecordPrefill(section: IFormRecordPrefillSection): IFormRecordPrefill;
|
|
2449
2467
|
/** A record version as the page offers it: a whole number of at least 1, as a number or as digits. */
|
|
@@ -3252,4 +3270,4 @@ declare function transformPageData(apiPage: IRawPage): IPageItem;
|
|
|
3252
3270
|
*/
|
|
3253
3271
|
declare function transformPagesData(pages: IRawPage[] | null | undefined): IPageItem[];
|
|
3254
3272
|
|
|
3255
|
-
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, 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, 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 };
|
|
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,6 +65,8 @@ __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,
|
|
70
72
|
LOCK_IDLE_ENDED_ERROR: () => LOCK_IDLE_ENDED_ERROR,
|
|
@@ -158,6 +160,7 @@ __export(index_exports, {
|
|
|
158
160
|
isDoubleWebHeaderPreset: () => isDoubleWebHeaderPreset,
|
|
159
161
|
isFormListParam: () => isFormListParam,
|
|
160
162
|
isKnownStyleName: () => isKnownStyleName,
|
|
163
|
+
isLanguageIndependent: () => isLanguageIndependent,
|
|
161
164
|
isMenuItemActiveOnMobile: () => isMenuItemActiveOnMobile,
|
|
162
165
|
isMenuItemActiveOnWeb: () => isMenuItemActiveOnWeb,
|
|
163
166
|
isMobileIconName: () => isMobileIconName,
|
|
@@ -2039,6 +2042,13 @@ function serializeFieldsMapLabels(labels) {
|
|
|
2039
2042
|
return JSON.stringify(clean);
|
|
2040
2043
|
}
|
|
2041
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
|
+
|
|
2042
2052
|
// src/content/formRecordPrefill.ts
|
|
2043
2053
|
var FORM_RECORD_PREFILL_SKIP_FIELDS = /* @__PURE__ */ new Set([
|
|
2044
2054
|
"record_id",
|
|
@@ -2133,7 +2143,7 @@ function parseFormRecordPrefill(section) {
|
|
|
2133
2143
|
}
|
|
2134
2144
|
const filesCell = asFilesCell(fieldValue);
|
|
2135
2145
|
if (filesCell !== null) {
|
|
2136
|
-
if (languageId
|
|
2146
|
+
if (isLanguageIndependent(languageId) || !recordGroups[recordId][fieldName]) {
|
|
2137
2147
|
recordGroups[recordId][fieldName] = filesCell;
|
|
2138
2148
|
}
|
|
2139
2149
|
continue;
|
|
@@ -2144,7 +2154,7 @@ function parseFormRecordPrefill(section) {
|
|
|
2144
2154
|
}
|
|
2145
2155
|
const translatable = isTranslatableChild(section.children, fieldName);
|
|
2146
2156
|
if (translatable) {
|
|
2147
|
-
if (languageId
|
|
2157
|
+
if (isLanguageIndependent(languageId)) {
|
|
2148
2158
|
if (!recordGroups[recordId][fieldName]) {
|
|
2149
2159
|
recordGroups[recordId][fieldName] = value;
|
|
2150
2160
|
}
|
|
@@ -2165,7 +2175,7 @@ function parseFormRecordPrefill(section) {
|
|
|
2165
2175
|
}
|
|
2166
2176
|
}
|
|
2167
2177
|
}
|
|
2168
|
-
} else if (languageId
|
|
2178
|
+
} else if (isLanguageIndependent(languageId) || !recordGroups[recordId][fieldName]) {
|
|
2169
2179
|
recordGroups[recordId][fieldName] = value;
|
|
2170
2180
|
}
|
|
2171
2181
|
}
|
|
@@ -2202,7 +2212,7 @@ function flattenFormRecordPrefillValues(values, languageId) {
|
|
|
2202
2212
|
continue;
|
|
2203
2213
|
}
|
|
2204
2214
|
}
|
|
2205
|
-
const nonIndependent = value.find((entry) => entry.language_id
|
|
2215
|
+
const nonIndependent = value.find((entry) => !isLanguageIndependent(entry.language_id));
|
|
2206
2216
|
out[key] = (nonIndependent ?? value[0]).value;
|
|
2207
2217
|
}
|
|
2208
2218
|
return out;
|
|
@@ -3443,6 +3453,8 @@ function transformPagesData(pages) {
|
|
|
3443
3453
|
HEADER_CLIENT_TYPE,
|
|
3444
3454
|
HEADER_PAGE_VERSION,
|
|
3445
3455
|
HEADER_PAGE_VIEW,
|
|
3456
|
+
LANGUAGE_INDEPENDENT_ID,
|
|
3457
|
+
LANGUAGE_INDEPENDENT_LOCALE,
|
|
3446
3458
|
LINE_HEIGHT,
|
|
3447
3459
|
LITERAL_CLASSES,
|
|
3448
3460
|
LOCK_IDLE_ENDED_ERROR,
|
|
@@ -3536,6 +3548,7 @@ function transformPagesData(pages) {
|
|
|
3536
3548
|
isDoubleWebHeaderPreset,
|
|
3537
3549
|
isFormListParam,
|
|
3538
3550
|
isKnownStyleName,
|
|
3551
|
+
isLanguageIndependent,
|
|
3539
3552
|
isMenuItemActiveOnMobile,
|
|
3540
3553
|
isMenuItemActiveOnWeb,
|
|
3541
3554
|
isMobileIconName,
|
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
|
|
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
|
|
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
|
|
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
|
|
1951
|
+
const nonIndependent = value.find((entry) => !isLanguageIndependent(entry.language_id));
|
|
1945
1952
|
out[key] = (nonIndependent ?? value[0]).value;
|
|
1946
1953
|
}
|
|
1947
1954
|
return out;
|
|
@@ -3181,6 +3188,8 @@ export {
|
|
|
3181
3188
|
HEADER_CLIENT_TYPE,
|
|
3182
3189
|
HEADER_PAGE_VERSION,
|
|
3183
3190
|
HEADER_PAGE_VIEW,
|
|
3191
|
+
LANGUAGE_INDEPENDENT_ID,
|
|
3192
|
+
LANGUAGE_INDEPENDENT_LOCALE,
|
|
3184
3193
|
LINE_HEIGHT,
|
|
3185
3194
|
LITERAL_CLASSES,
|
|
3186
3195
|
LOCK_IDLE_ENDED_ERROR,
|
|
@@ -3274,6 +3283,7 @@ export {
|
|
|
3274
3283
|
isDoubleWebHeaderPreset,
|
|
3275
3284
|
isFormListParam,
|
|
3276
3285
|
isKnownStyleName,
|
|
3286
|
+
isLanguageIndependent,
|
|
3277
3287
|
isMenuItemActiveOnMobile,
|
|
3278
3288
|
isMenuItemActiveOnWeb,
|
|
3279
3289
|
isMobileIconName,
|
|
@@ -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,
|
|
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 };
|
|
@@ -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,
|
|
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 };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { I as IPluginManifest, a as IPluginManifestAdminPage, b as IPluginManifestApiRoute, c as IPluginManifestAsset, d as IPluginManifestCapability, e as IPluginManifestCompatibility, f as IPluginManifestConflict, g as IPluginManifestDataAccess, h as IPluginManifestDependency, i as IPluginManifestExternalHost, j as IPluginManifestFeatureFlag, k as
|
|
1
|
+
export { I as IPluginManifest, a as IPluginManifestAdminPage, b as IPluginManifestApiRoute, c as IPluginManifestAsset, d as IPluginManifestCapability, e as IPluginManifestCompatibility, f as IPluginManifestConflict, g as IPluginManifestDataAccess, h as IPluginManifestDependency, i as IPluginManifestExternalHost, j as IPluginManifestFeatureFlag, k as IPluginManifestField, l as IPluginManifestFieldType, m as IPluginManifestHealth, n as IPluginManifestLookupExtension, o as IPluginManifestMobile, p as IPluginManifestPermission, q as IPluginManifestRealtimeTopic, r as IPluginManifestScheduledJob, s as IPluginManifestSecurity, t as IPluginManifestStyle, u as IPluginManifestStyleField, v as IPluginManifestStyleGroup, w as IPluginManifestTrustLevel } from '../manifest-DRlcSvvy.mjs';
|
|
2
2
|
import { I as IStyleRegistryEntry } from '../styles.registry-DnIJqEzM.mjs';
|
|
3
3
|
import '../common-qaDIAYS3.mjs';
|
|
4
4
|
|
|
@@ -404,6 +404,49 @@ interface IStyleDefinition extends Omit<IStyleRegistryEntry, 'category'> {
|
|
|
404
404
|
/** Style implementation component (React or React Native). */
|
|
405
405
|
component: TPluginComponent;
|
|
406
406
|
}
|
|
407
|
+
/**
|
|
408
|
+
* The popup a page is shown in, as the host sees it. Outside a popup
|
|
409
|
+
* `inModal` is false and `closeModal()` does nothing, so a plugin can call
|
|
410
|
+
* it unconditionally (for example after a save, like the core form's
|
|
411
|
+
* `close_modal_on_save`).
|
|
412
|
+
*/
|
|
413
|
+
interface IPluginPageModal {
|
|
414
|
+
inModal: boolean;
|
|
415
|
+
closeModal: () => void;
|
|
416
|
+
}
|
|
417
|
+
/**
|
|
418
|
+
* The page a plugin section is drawn on. A plugin endpoint that serves or
|
|
419
|
+
* accepts data for the section names the page and the section in every call
|
|
420
|
+
* (with this language, preview state and route), so the server can check
|
|
421
|
+
* access and read the section's settings itself (rule 7.7), like the core
|
|
422
|
+
* form and form list do.
|
|
423
|
+
*/
|
|
424
|
+
interface IPluginStylePage {
|
|
425
|
+
/** Page id; null while the page content is not known yet. */
|
|
426
|
+
id: number | null;
|
|
427
|
+
languageId: number | null;
|
|
428
|
+
/** Whether the page is shown as the editor's draft (preview mode). */
|
|
429
|
+
preview: boolean;
|
|
430
|
+
/** The page's declared route parameters (`page.route_params`). */
|
|
431
|
+
routeParams: Record<string, string>;
|
|
432
|
+
}
|
|
433
|
+
/**
|
|
434
|
+
* Props the host passes to a plugin style component (the `component` of an
|
|
435
|
+
* {@link IStyleDefinition}). `style` is the section as the page payload
|
|
436
|
+
* carries it (fields keyed by name).
|
|
437
|
+
*/
|
|
438
|
+
interface IPluginStyleProps {
|
|
439
|
+
style: Record<string, unknown>;
|
|
440
|
+
styleProps: Record<string, string>;
|
|
441
|
+
cssClass: string;
|
|
442
|
+
parentActive?: number;
|
|
443
|
+
childIndex?: number;
|
|
444
|
+
parentColor?: string;
|
|
445
|
+
/** The popup the page is shown in; a no-op outside one. */
|
|
446
|
+
pageModal: IPluginPageModal;
|
|
447
|
+
/** The page the section is on, to name in plugin calls. */
|
|
448
|
+
page: IPluginStylePage;
|
|
449
|
+
}
|
|
407
450
|
/**
|
|
408
451
|
* Props passed by the host's section-field editor to a plugin-supplied
|
|
409
452
|
* field renderer. The host owns the surrounding label / help tooltip /
|
|
@@ -605,6 +648,13 @@ interface IPluginApi {
|
|
|
605
648
|
realtime?: IPluginRealtimePublisher;
|
|
606
649
|
/** Host rich-text editor adapter. */
|
|
607
650
|
richTextEditor: IRichTextEditorAdapter;
|
|
651
|
+
/**
|
|
652
|
+
* The host's HTML sanitizer, with the same rules core pages use (web:
|
|
653
|
+
* DOMPurify, plus the host's link rewrites). Call it before rendering any
|
|
654
|
+
* CMS or user HTML; never bundle a sanitizer of your own. `inline` keeps
|
|
655
|
+
* inline markup only, `block` also keeps headings, lists and paragraphs.
|
|
656
|
+
*/
|
|
657
|
+
sanitizeHtml(html: string, mode: 'inline' | 'block'): string;
|
|
608
658
|
/**
|
|
609
659
|
* Logger that respects the host's debug config. Avoid `console.log`
|
|
610
660
|
* in plugin code; route everything through this.
|
|
@@ -618,9 +668,12 @@ interface IPluginApi {
|
|
|
618
668
|
}
|
|
619
669
|
/**
|
|
620
670
|
* Same shape on mobile, minus the rich-text editor adapter when the
|
|
621
|
-
* plugin only supports read-only mobile rendering.
|
|
671
|
+
* plugin only supports read-only mobile rendering. React Native does not
|
|
672
|
+
* render HTML, so there is no `sanitizeHtml`: mobile plugins show CMS text
|
|
673
|
+
* with `parseInlineRich` / `stripHtmlToText`. A plugin that renders HTML in
|
|
674
|
+
* a WebView sanitizes it there itself.
|
|
622
675
|
*/
|
|
623
|
-
interface IMobilePluginApi extends Omit<IPluginApi, 'richTextEditor'> {
|
|
676
|
+
interface IMobilePluginApi extends Omit<IPluginApi, 'richTextEditor' | 'sanitizeHtml'> {
|
|
624
677
|
/** Mobile builds without rich-text support set this to `null`. */
|
|
625
678
|
richTextEditor: IRichTextEditorAdapter | null;
|
|
626
679
|
}
|
|
@@ -1006,4 +1059,4 @@ declare function isPluginRuntimeShimSpecifier(value: unknown): value is TPluginR
|
|
|
1006
1059
|
*/
|
|
1007
1060
|
declare const PLUGIN_RUNTIME_IMPORT_MAP: Readonly<Record<TPluginRuntimeShimSpecifier, string>>;
|
|
1008
1061
|
|
|
1009
|
-
export { type IAdminPageDefinition, type IFieldRendererDefinition, type IMenuItemDefinition, type IMobileHostRequest, type IMobileHostResponse, type IMobileHostServices, type IMobilePluginApi, type IMobilePluginRegistration, type IPluginApi, type IPluginFeatureFlag, type IPluginFieldRendererProps, type IPluginHealthCheck, type IPluginLock, type IPluginLockEntry, type IPluginLockMigration, type IPluginLockMobileEntry, type IPluginRealtimePublisher, type IPluginRealtimeTopic, type IPluginRegistration, type IPluginRegistry, type IPluginRelease, type IRealtimeTransport, type IRegistryReleaseRef, type IRegistrySignatureBlock, type IRichTextEditorAdapter, type IRichTextEditorAdapterOptions, type IRichTextEditorValue, type IStyleDefinition, type IUsePluginRealtimeOptions, type IUsePluginRealtimeResult, MOBILE_RENDERER_VERSION, PLUGIN_API_VERSION, PLUGIN_REGISTRY_CHANNELS, PLUGIN_RUNTIME_GLOBAL_KEY, PLUGIN_RUNTIME_IMPORT_MAP, PLUGIN_RUNTIME_SHIM_BASE_PATH, PLUGIN_RUNTIME_SHIM_SPECIFIERS, type TMobileHostMethod, type TPluginRegistryChannel, type TPluginRuntimeShimSpecifier, type TRealtimeTransportFactory, assertCmsCompatibility, assertPluginApiVersion, assertPluginVersionSemantics, buildPluginRuntimeShimPath, compareSemver, defineMobilePlugin, definePlugin, definePluginRealtimeTopic, getMobileHostServices, isMobileRendererCompatible, isPluginApiCompatible, isPluginRuntimeShimSpecifier, parseSemver, satisfiesSemverRange, setMobileHostServices, usePluginRealtime };
|
|
1062
|
+
export { type IAdminPageDefinition, type IFieldRendererDefinition, type IMenuItemDefinition, type IMobileHostRequest, type IMobileHostResponse, type IMobileHostServices, type IMobilePluginApi, type IMobilePluginRegistration, type IPluginApi, type IPluginFeatureFlag, type IPluginFieldRendererProps, type IPluginHealthCheck, type IPluginLock, type IPluginLockEntry, type IPluginLockMigration, type IPluginLockMobileEntry, type IPluginPageModal, type IPluginRealtimePublisher, type IPluginRealtimeTopic, type IPluginRegistration, type IPluginRegistry, type IPluginRelease, type IPluginStylePage, type IPluginStyleProps, type IRealtimeTransport, type IRegistryReleaseRef, type IRegistrySignatureBlock, type IRichTextEditorAdapter, type IRichTextEditorAdapterOptions, type IRichTextEditorValue, type IStyleDefinition, type IUsePluginRealtimeOptions, type IUsePluginRealtimeResult, MOBILE_RENDERER_VERSION, PLUGIN_API_VERSION, PLUGIN_REGISTRY_CHANNELS, PLUGIN_RUNTIME_GLOBAL_KEY, PLUGIN_RUNTIME_IMPORT_MAP, PLUGIN_RUNTIME_SHIM_BASE_PATH, PLUGIN_RUNTIME_SHIM_SPECIFIERS, type TMobileHostMethod, type TPluginRegistryChannel, type TPluginRuntimeShimSpecifier, type TRealtimeTransportFactory, assertCmsCompatibility, assertPluginApiVersion, assertPluginVersionSemantics, buildPluginRuntimeShimPath, compareSemver, defineMobilePlugin, definePlugin, definePluginRealtimeTopic, getMobileHostServices, isMobileRendererCompatible, isPluginApiCompatible, isPluginRuntimeShimSpecifier, parseSemver, satisfiesSemverRange, setMobileHostServices, usePluginRealtime };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { I as IPluginManifest, a as IPluginManifestAdminPage, b as IPluginManifestApiRoute, c as IPluginManifestAsset, d as IPluginManifestCapability, e as IPluginManifestCompatibility, f as IPluginManifestConflict, g as IPluginManifestDataAccess, h as IPluginManifestDependency, i as IPluginManifestExternalHost, j as IPluginManifestFeatureFlag, k as
|
|
1
|
+
export { I as IPluginManifest, a as IPluginManifestAdminPage, b as IPluginManifestApiRoute, c as IPluginManifestAsset, d as IPluginManifestCapability, e as IPluginManifestCompatibility, f as IPluginManifestConflict, g as IPluginManifestDataAccess, h as IPluginManifestDependency, i as IPluginManifestExternalHost, j as IPluginManifestFeatureFlag, k as IPluginManifestField, l as IPluginManifestFieldType, m as IPluginManifestHealth, n as IPluginManifestLookupExtension, o as IPluginManifestMobile, p as IPluginManifestPermission, q as IPluginManifestRealtimeTopic, r as IPluginManifestScheduledJob, s as IPluginManifestSecurity, t as IPluginManifestStyle, u as IPluginManifestStyleField, v as IPluginManifestStyleGroup, w as IPluginManifestTrustLevel } from '../manifest-DRlcSvvy.js';
|
|
2
2
|
import { I as IStyleRegistryEntry } from '../styles.registry-C2ACy7H0.js';
|
|
3
3
|
import '../common-qaDIAYS3.js';
|
|
4
4
|
|
|
@@ -404,6 +404,49 @@ interface IStyleDefinition extends Omit<IStyleRegistryEntry, 'category'> {
|
|
|
404
404
|
/** Style implementation component (React or React Native). */
|
|
405
405
|
component: TPluginComponent;
|
|
406
406
|
}
|
|
407
|
+
/**
|
|
408
|
+
* The popup a page is shown in, as the host sees it. Outside a popup
|
|
409
|
+
* `inModal` is false and `closeModal()` does nothing, so a plugin can call
|
|
410
|
+
* it unconditionally (for example after a save, like the core form's
|
|
411
|
+
* `close_modal_on_save`).
|
|
412
|
+
*/
|
|
413
|
+
interface IPluginPageModal {
|
|
414
|
+
inModal: boolean;
|
|
415
|
+
closeModal: () => void;
|
|
416
|
+
}
|
|
417
|
+
/**
|
|
418
|
+
* The page a plugin section is drawn on. A plugin endpoint that serves or
|
|
419
|
+
* accepts data for the section names the page and the section in every call
|
|
420
|
+
* (with this language, preview state and route), so the server can check
|
|
421
|
+
* access and read the section's settings itself (rule 7.7), like the core
|
|
422
|
+
* form and form list do.
|
|
423
|
+
*/
|
|
424
|
+
interface IPluginStylePage {
|
|
425
|
+
/** Page id; null while the page content is not known yet. */
|
|
426
|
+
id: number | null;
|
|
427
|
+
languageId: number | null;
|
|
428
|
+
/** Whether the page is shown as the editor's draft (preview mode). */
|
|
429
|
+
preview: boolean;
|
|
430
|
+
/** The page's declared route parameters (`page.route_params`). */
|
|
431
|
+
routeParams: Record<string, string>;
|
|
432
|
+
}
|
|
433
|
+
/**
|
|
434
|
+
* Props the host passes to a plugin style component (the `component` of an
|
|
435
|
+
* {@link IStyleDefinition}). `style` is the section as the page payload
|
|
436
|
+
* carries it (fields keyed by name).
|
|
437
|
+
*/
|
|
438
|
+
interface IPluginStyleProps {
|
|
439
|
+
style: Record<string, unknown>;
|
|
440
|
+
styleProps: Record<string, string>;
|
|
441
|
+
cssClass: string;
|
|
442
|
+
parentActive?: number;
|
|
443
|
+
childIndex?: number;
|
|
444
|
+
parentColor?: string;
|
|
445
|
+
/** The popup the page is shown in; a no-op outside one. */
|
|
446
|
+
pageModal: IPluginPageModal;
|
|
447
|
+
/** The page the section is on, to name in plugin calls. */
|
|
448
|
+
page: IPluginStylePage;
|
|
449
|
+
}
|
|
407
450
|
/**
|
|
408
451
|
* Props passed by the host's section-field editor to a plugin-supplied
|
|
409
452
|
* field renderer. The host owns the surrounding label / help tooltip /
|
|
@@ -605,6 +648,13 @@ interface IPluginApi {
|
|
|
605
648
|
realtime?: IPluginRealtimePublisher;
|
|
606
649
|
/** Host rich-text editor adapter. */
|
|
607
650
|
richTextEditor: IRichTextEditorAdapter;
|
|
651
|
+
/**
|
|
652
|
+
* The host's HTML sanitizer, with the same rules core pages use (web:
|
|
653
|
+
* DOMPurify, plus the host's link rewrites). Call it before rendering any
|
|
654
|
+
* CMS or user HTML; never bundle a sanitizer of your own. `inline` keeps
|
|
655
|
+
* inline markup only, `block` also keeps headings, lists and paragraphs.
|
|
656
|
+
*/
|
|
657
|
+
sanitizeHtml(html: string, mode: 'inline' | 'block'): string;
|
|
608
658
|
/**
|
|
609
659
|
* Logger that respects the host's debug config. Avoid `console.log`
|
|
610
660
|
* in plugin code; route everything through this.
|
|
@@ -618,9 +668,12 @@ interface IPluginApi {
|
|
|
618
668
|
}
|
|
619
669
|
/**
|
|
620
670
|
* Same shape on mobile, minus the rich-text editor adapter when the
|
|
621
|
-
* plugin only supports read-only mobile rendering.
|
|
671
|
+
* plugin only supports read-only mobile rendering. React Native does not
|
|
672
|
+
* render HTML, so there is no `sanitizeHtml`: mobile plugins show CMS text
|
|
673
|
+
* with `parseInlineRich` / `stripHtmlToText`. A plugin that renders HTML in
|
|
674
|
+
* a WebView sanitizes it there itself.
|
|
622
675
|
*/
|
|
623
|
-
interface IMobilePluginApi extends Omit<IPluginApi, 'richTextEditor'> {
|
|
676
|
+
interface IMobilePluginApi extends Omit<IPluginApi, 'richTextEditor' | 'sanitizeHtml'> {
|
|
624
677
|
/** Mobile builds without rich-text support set this to `null`. */
|
|
625
678
|
richTextEditor: IRichTextEditorAdapter | null;
|
|
626
679
|
}
|
|
@@ -1006,4 +1059,4 @@ declare function isPluginRuntimeShimSpecifier(value: unknown): value is TPluginR
|
|
|
1006
1059
|
*/
|
|
1007
1060
|
declare const PLUGIN_RUNTIME_IMPORT_MAP: Readonly<Record<TPluginRuntimeShimSpecifier, string>>;
|
|
1008
1061
|
|
|
1009
|
-
export { type IAdminPageDefinition, type IFieldRendererDefinition, type IMenuItemDefinition, type IMobileHostRequest, type IMobileHostResponse, type IMobileHostServices, type IMobilePluginApi, type IMobilePluginRegistration, type IPluginApi, type IPluginFeatureFlag, type IPluginFieldRendererProps, type IPluginHealthCheck, type IPluginLock, type IPluginLockEntry, type IPluginLockMigration, type IPluginLockMobileEntry, type IPluginRealtimePublisher, type IPluginRealtimeTopic, type IPluginRegistration, type IPluginRegistry, type IPluginRelease, type IRealtimeTransport, type IRegistryReleaseRef, type IRegistrySignatureBlock, type IRichTextEditorAdapter, type IRichTextEditorAdapterOptions, type IRichTextEditorValue, type IStyleDefinition, type IUsePluginRealtimeOptions, type IUsePluginRealtimeResult, MOBILE_RENDERER_VERSION, PLUGIN_API_VERSION, PLUGIN_REGISTRY_CHANNELS, PLUGIN_RUNTIME_GLOBAL_KEY, PLUGIN_RUNTIME_IMPORT_MAP, PLUGIN_RUNTIME_SHIM_BASE_PATH, PLUGIN_RUNTIME_SHIM_SPECIFIERS, type TMobileHostMethod, type TPluginRegistryChannel, type TPluginRuntimeShimSpecifier, type TRealtimeTransportFactory, assertCmsCompatibility, assertPluginApiVersion, assertPluginVersionSemantics, buildPluginRuntimeShimPath, compareSemver, defineMobilePlugin, definePlugin, definePluginRealtimeTopic, getMobileHostServices, isMobileRendererCompatible, isPluginApiCompatible, isPluginRuntimeShimSpecifier, parseSemver, satisfiesSemverRange, setMobileHostServices, usePluginRealtime };
|
|
1062
|
+
export { type IAdminPageDefinition, type IFieldRendererDefinition, type IMenuItemDefinition, type IMobileHostRequest, type IMobileHostResponse, type IMobileHostServices, type IMobilePluginApi, type IMobilePluginRegistration, type IPluginApi, type IPluginFeatureFlag, type IPluginFieldRendererProps, type IPluginHealthCheck, type IPluginLock, type IPluginLockEntry, type IPluginLockMigration, type IPluginLockMobileEntry, type IPluginPageModal, type IPluginRealtimePublisher, type IPluginRealtimeTopic, type IPluginRegistration, type IPluginRegistry, type IPluginRelease, type IPluginStylePage, type IPluginStyleProps, type IRealtimeTransport, type IRegistryReleaseRef, type IRegistrySignatureBlock, type IRichTextEditorAdapter, type IRichTextEditorAdapterOptions, type IRichTextEditorValue, type IStyleDefinition, type IUsePluginRealtimeOptions, type IUsePluginRealtimeResult, MOBILE_RENDERER_VERSION, PLUGIN_API_VERSION, PLUGIN_REGISTRY_CHANNELS, PLUGIN_RUNTIME_GLOBAL_KEY, PLUGIN_RUNTIME_IMPORT_MAP, PLUGIN_RUNTIME_SHIM_BASE_PATH, PLUGIN_RUNTIME_SHIM_SPECIFIERS, type TMobileHostMethod, type TPluginRegistryChannel, type TPluginRuntimeShimSpecifier, type TRealtimeTransportFactory, assertCmsCompatibility, assertPluginApiVersion, assertPluginVersionSemantics, buildPluginRuntimeShimPath, compareSemver, defineMobilePlugin, definePlugin, definePluginRealtimeTopic, getMobileHostServices, isMobileRendererCompatible, isPluginApiCompatible, isPluginRuntimeShimSpecifier, parseSemver, satisfiesSemverRange, setMobileHostServices, usePluginRealtime };
|
package/dist/testing/index.d.mts
CHANGED
package/dist/testing/index.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@selfhelp/shared",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.30.0",
|
|
4
4
|
"description": "Shared TypeScript package for SelfHelp web frontend and mobile app: style registry, types, API contracts, Mantine theme tokens, condition + interpolation engines, CMS class allow-list.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* SPDX-FileCopyrightText: 2026 Humdek, University of Bern
|
|
3
|
+
* SPDX-License-Identifier: MPL-2.0
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import { describe, expect, it } from 'vitest';
|
|
7
|
+
import {
|
|
8
|
+
LANGUAGE_INDEPENDENT_ID,
|
|
9
|
+
LANGUAGE_INDEPENDENT_LOCALE,
|
|
10
|
+
isLanguageIndependent,
|
|
11
|
+
} from '../languageIndependent';
|
|
12
|
+
|
|
13
|
+
describe('isLanguageIndependent', () => {
|
|
14
|
+
it('is true only for the sentinel id 1', () => {
|
|
15
|
+
expect(LANGUAGE_INDEPENDENT_ID).toBe(1);
|
|
16
|
+
expect(LANGUAGE_INDEPENDENT_LOCALE).toBe('all');
|
|
17
|
+
expect(isLanguageIndependent(1)).toBe(true);
|
|
18
|
+
expect(isLanguageIndependent(LANGUAGE_INDEPENDENT_ID)).toBe(true);
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
it('is false for a real language, null and undefined', () => {
|
|
22
|
+
expect(isLanguageIndependent(2)).toBe(false);
|
|
23
|
+
expect(isLanguageIndependent(null)).toBe(false);
|
|
24
|
+
expect(isLanguageIndependent(undefined)).toBe(false);
|
|
25
|
+
});
|
|
26
|
+
});
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* SPDX-FileCopyrightText: 2026 Humdek, University of Bern
|
|
3
|
+
* SPDX-License-Identifier: MPL-2.0
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import { readdirSync, readFileSync, statSync } from 'node:fs';
|
|
7
|
+
import { join, relative, sep } from 'node:path';
|
|
8
|
+
import { describe, expect, it } from 'vitest';
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Fails when source under `src/` still compares against bare language id 1 or
|
|
12
|
+
* locale `all`. The constant module itself and every `__tests__` folder are
|
|
13
|
+
* excluded; clients must import `LANGUAGE_INDEPENDENT_*` / `isLanguageIndependent`.
|
|
14
|
+
*/
|
|
15
|
+
const SRC_ROOT = join(__dirname, '..', '..');
|
|
16
|
+
const OWN_MODULE = join('content', 'languageIndependent.ts');
|
|
17
|
+
|
|
18
|
+
const FORBIDDEN = [
|
|
19
|
+
/language_id\s*===\s*1\b/,
|
|
20
|
+
/language_id\s*!==\s*1\b/,
|
|
21
|
+
/languageId\s*===\s*1\b/,
|
|
22
|
+
/language_id\s*>\s*1\b/,
|
|
23
|
+
/locale\s*===\s*['"]all['"]/,
|
|
24
|
+
] as const;
|
|
25
|
+
|
|
26
|
+
function listSourceFiles(dir: string): string[] {
|
|
27
|
+
const out: string[] = [];
|
|
28
|
+
for (const name of readdirSync(dir)) {
|
|
29
|
+
const full = join(dir, name);
|
|
30
|
+
const st = statSync(full);
|
|
31
|
+
if (st.isDirectory()) {
|
|
32
|
+
if (name === '__tests__' || name === 'node_modules' || name === 'dist') {
|
|
33
|
+
continue;
|
|
34
|
+
}
|
|
35
|
+
out.push(...listSourceFiles(full));
|
|
36
|
+
continue;
|
|
37
|
+
}
|
|
38
|
+
if (/\.(ts|tsx|js|mjs|cjs)$/.test(name) && !name.endsWith('.d.ts')) {
|
|
39
|
+
out.push(full);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
return out;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
describe('language-independent literals in src/', () => {
|
|
46
|
+
it('uses LANGUAGE_INDEPENDENT_* / isLanguageIndependent instead of bare 1 or locale all', () => {
|
|
47
|
+
const hits: string[] = [];
|
|
48
|
+
for (const file of listSourceFiles(SRC_ROOT)) {
|
|
49
|
+
const rel = relative(SRC_ROOT, file).split(sep).join('/');
|
|
50
|
+
if (rel === OWN_MODULE.replace(/\\/g, '/')) {
|
|
51
|
+
continue;
|
|
52
|
+
}
|
|
53
|
+
const text = readFileSync(file, 'utf8');
|
|
54
|
+
for (const pattern of FORBIDDEN) {
|
|
55
|
+
if (pattern.test(text)) {
|
|
56
|
+
hits.push(`${rel} matches ${pattern}`);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
expect(hits).toEqual([]);
|
|
61
|
+
});
|
|
62
|
+
});
|
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
*/
|
|
13
13
|
|
|
14
14
|
import type { IFormListFilesCell, IFormListFileValue } from '../types/api/form-lists';
|
|
15
|
+
import { isLanguageIndependent } from './languageIndependent';
|
|
15
16
|
|
|
16
17
|
/** Per-language value for a translatable form field. */
|
|
17
18
|
export interface IFormRecordPrefillTranslatedValue {
|
|
@@ -142,9 +143,10 @@ export function asFilesCell(value: unknown): TFormRecordPrefillFileValue | null
|
|
|
142
143
|
*
|
|
143
144
|
* - Missing / empty / non-array `section_data` → empty create state.
|
|
144
145
|
* - Rows without a numeric `record_id` are ignored.
|
|
145
|
-
* - Translatable fields accumulate `{ language_id, value }[]` (
|
|
146
|
-
*
|
|
147
|
-
* - Non-translatable fields prefer language
|
|
146
|
+
* - Translatable fields accumulate `{ language_id, value }[]` (the
|
|
147
|
+
* language-independent seed is kept only until a public-language row arrives).
|
|
148
|
+
* - Non-translatable fields prefer the language-independent row, else the first
|
|
149
|
+
* seen value.
|
|
148
150
|
*/
|
|
149
151
|
export function parseFormRecordPrefill(section: IFormRecordPrefillSection): IFormRecordPrefill {
|
|
150
152
|
const sectionDataArray = section?.section_data;
|
|
@@ -194,7 +196,7 @@ export function parseFormRecordPrefill(section: IFormRecordPrefillSection): IFor
|
|
|
194
196
|
}
|
|
195
197
|
const filesCell = asFilesCell(fieldValue);
|
|
196
198
|
if (filesCell !== null) {
|
|
197
|
-
if (languageId
|
|
199
|
+
if (isLanguageIndependent(languageId) || !recordGroups[recordId][fieldName]) {
|
|
198
200
|
recordGroups[recordId][fieldName] = filesCell;
|
|
199
201
|
}
|
|
200
202
|
continue;
|
|
@@ -207,7 +209,7 @@ export function parseFormRecordPrefill(section: IFormRecordPrefillSection): IFor
|
|
|
207
209
|
const translatable = isTranslatableChild(section.children, fieldName);
|
|
208
210
|
|
|
209
211
|
if (translatable) {
|
|
210
|
-
if (languageId
|
|
212
|
+
if (isLanguageIndependent(languageId)) {
|
|
211
213
|
if (!recordGroups[recordId][fieldName]) {
|
|
212
214
|
recordGroups[recordId][fieldName] = value;
|
|
213
215
|
}
|
|
@@ -229,7 +231,7 @@ export function parseFormRecordPrefill(section: IFormRecordPrefillSection): IFor
|
|
|
229
231
|
}
|
|
230
232
|
}
|
|
231
233
|
}
|
|
232
|
-
} else if (languageId
|
|
234
|
+
} else if (isLanguageIndependent(languageId) || !recordGroups[recordId][fieldName]) {
|
|
233
235
|
recordGroups[recordId][fieldName] = value;
|
|
234
236
|
}
|
|
235
237
|
}
|
|
@@ -287,7 +289,7 @@ export function flattenFormRecordPrefillValues(
|
|
|
287
289
|
continue;
|
|
288
290
|
}
|
|
289
291
|
}
|
|
290
|
-
const nonIndependent = value.find((entry) => entry.language_id
|
|
292
|
+
const nonIndependent = value.find((entry) => !isLanguageIndependent(entry.language_id));
|
|
291
293
|
out[key] = (nonIndependent ?? value[0]).value;
|
|
292
294
|
}
|
|
293
295
|
return out;
|
package/src/content/index.ts
CHANGED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* SPDX-FileCopyrightText: 2026 Humdek, University of Bern
|
|
3
|
+
* SPDX-License-Identifier: MPL-2.0
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Language-independent sentinel (backend `languages` row id 1, locale `all`).
|
|
8
|
+
*
|
|
9
|
+
* That row holds values that are the same in every language: page and section
|
|
10
|
+
* properties, plain-text form cells, and the `all` entries of bundles. It is
|
|
11
|
+
* not a real language and must not be chosen as a user's language or the CMS
|
|
12
|
+
* default. Clients refer to it only through these constants — never a bare `1`.
|
|
13
|
+
*
|
|
14
|
+
* Mirrors backend `App\Entity\Language::INDEPENDENT_ID` / `INDEPENDENT_LOCALE`.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
/** Fixed id of the language-independent sentinel row. */
|
|
18
|
+
export const LANGUAGE_INDEPENDENT_ID = 1;
|
|
19
|
+
|
|
20
|
+
/** Locale token of the language-independent sentinel row (`all` in bundles). */
|
|
21
|
+
export const LANGUAGE_INDEPENDENT_LOCALE = 'all';
|
|
22
|
+
|
|
23
|
+
/** True when `languageId` is the language-independent sentinel. */
|
|
24
|
+
export function isLanguageIndependent(
|
|
25
|
+
languageId: number | null | undefined,
|
|
26
|
+
): boolean {
|
|
27
|
+
return languageId === LANGUAGE_INDEPENDENT_ID;
|
|
28
|
+
}
|
package/src/plugin-sdk/index.ts
CHANGED
|
@@ -41,6 +41,10 @@ export type {
|
|
|
41
41
|
IPluginManifestLookupExtension,
|
|
42
42
|
IPluginManifestPermission,
|
|
43
43
|
IPluginManifestStyle,
|
|
44
|
+
IPluginManifestStyleField,
|
|
45
|
+
IPluginManifestStyleGroup,
|
|
46
|
+
IPluginManifestFieldType,
|
|
47
|
+
IPluginManifestField,
|
|
44
48
|
IPluginManifestAdminPage,
|
|
45
49
|
IPluginManifestApiRoute,
|
|
46
50
|
IPluginManifestScheduledJob,
|
|
@@ -73,6 +77,9 @@ export type {
|
|
|
73
77
|
IStyleDefinition,
|
|
74
78
|
IFieldRendererDefinition,
|
|
75
79
|
IPluginFieldRendererProps,
|
|
80
|
+
IPluginPageModal,
|
|
81
|
+
IPluginStylePage,
|
|
82
|
+
IPluginStyleProps,
|
|
76
83
|
IAdminPageDefinition,
|
|
77
84
|
IMenuItemDefinition,
|
|
78
85
|
IPluginApi,
|
|
@@ -163,6 +163,17 @@ export interface IPluginManifestPermission {
|
|
|
163
163
|
defaultRoles?: string[];
|
|
164
164
|
}
|
|
165
165
|
|
|
166
|
+
/** A field linked to a plugin style, with its editor metadata. */
|
|
167
|
+
export interface IPluginManifestStyleField {
|
|
168
|
+
/** A field of the plugin (`fields`) or a core field such as `own_entries_only`. */
|
|
169
|
+
name: string;
|
|
170
|
+
title?: string;
|
|
171
|
+
help?: string;
|
|
172
|
+
default?: string | null;
|
|
173
|
+
hidden?: boolean;
|
|
174
|
+
disabled?: boolean;
|
|
175
|
+
}
|
|
176
|
+
|
|
166
177
|
export interface IPluginManifestStyle {
|
|
167
178
|
/** Style name (used as `style_name` discriminator). */
|
|
168
179
|
name: string;
|
|
@@ -170,6 +181,37 @@ export interface IPluginManifestStyle {
|
|
|
170
181
|
canHaveChildren: boolean;
|
|
171
182
|
/** Optional capability requirement (e.g. `frontendStyles`). */
|
|
172
183
|
capability?: IPluginManifestCapability;
|
|
184
|
+
/** Style group name; required when the installer creates the style. */
|
|
185
|
+
group?: string;
|
|
186
|
+
/** Earlier names of this style; the installer renames the row in place. */
|
|
187
|
+
renamedFrom?: string[];
|
|
188
|
+
/** When present, the installer makes the style's field links match this list. */
|
|
189
|
+
fields?: IPluginManifestStyleField[];
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
/** Style group written into `style_groups` by the host installer (rule 7.8). */
|
|
193
|
+
export interface IPluginManifestStyleGroup {
|
|
194
|
+
name: string;
|
|
195
|
+
description?: string;
|
|
196
|
+
position?: number;
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
/** Field type (editor control) written into `field_types`; kebab-case name. */
|
|
200
|
+
export interface IPluginManifestFieldType {
|
|
201
|
+
name: string;
|
|
202
|
+
position?: number;
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
/** Plugin-owned field written into `fields`; snake_case name. */
|
|
206
|
+
export interface IPluginManifestField {
|
|
207
|
+
name: string;
|
|
208
|
+
/** A core field type or one declared under `fieldTypes`. */
|
|
209
|
+
type: string;
|
|
210
|
+
/** True for participant-facing content stored per language. */
|
|
211
|
+
translatable?: boolean;
|
|
212
|
+
config?: Record<string, unknown> | null;
|
|
213
|
+
/** Earlier names of this field; the installer renames the row in place. */
|
|
214
|
+
renamedFrom?: string[];
|
|
173
215
|
}
|
|
174
216
|
|
|
175
217
|
export interface IPluginManifestAdminPage {
|
|
@@ -302,6 +344,15 @@ export interface IPluginManifest {
|
|
|
302
344
|
/** Styles contributed to the registry. */
|
|
303
345
|
styles?: IPluginManifestStyle[];
|
|
304
346
|
|
|
347
|
+
/** Style groups the host installer writes (rule 7.8). */
|
|
348
|
+
styleGroups?: IPluginManifestStyleGroup[];
|
|
349
|
+
|
|
350
|
+
/** Field types the host installer writes (rule 7.8). */
|
|
351
|
+
fieldTypes?: IPluginManifestFieldType[];
|
|
352
|
+
|
|
353
|
+
/** Plugin-owned fields the host installer writes (rule 7.8). */
|
|
354
|
+
fields?: IPluginManifestField[];
|
|
355
|
+
|
|
305
356
|
/** Admin pages mounted under `/admin/plugins-host/{pluginId}/`. */
|
|
306
357
|
adminPages?: IPluginManifestAdminPage[];
|
|
307
358
|
|
package/src/plugin-sdk/types.ts
CHANGED
|
@@ -40,6 +40,52 @@ export interface IStyleDefinition extends Omit<IStyleRegistryEntry, 'category'>
|
|
|
40
40
|
component: TPluginComponent;
|
|
41
41
|
}
|
|
42
42
|
|
|
43
|
+
/**
|
|
44
|
+
* The popup a page is shown in, as the host sees it. Outside a popup
|
|
45
|
+
* `inModal` is false and `closeModal()` does nothing, so a plugin can call
|
|
46
|
+
* it unconditionally (for example after a save, like the core form's
|
|
47
|
+
* `close_modal_on_save`).
|
|
48
|
+
*/
|
|
49
|
+
export interface IPluginPageModal {
|
|
50
|
+
inModal: boolean;
|
|
51
|
+
closeModal: () => void;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* The page a plugin section is drawn on. A plugin endpoint that serves or
|
|
56
|
+
* accepts data for the section names the page and the section in every call
|
|
57
|
+
* (with this language, preview state and route), so the server can check
|
|
58
|
+
* access and read the section's settings itself (rule 7.7), like the core
|
|
59
|
+
* form and form list do.
|
|
60
|
+
*/
|
|
61
|
+
export interface IPluginStylePage {
|
|
62
|
+
/** Page id; null while the page content is not known yet. */
|
|
63
|
+
id: number | null;
|
|
64
|
+
languageId: number | null;
|
|
65
|
+
/** Whether the page is shown as the editor's draft (preview mode). */
|
|
66
|
+
preview: boolean;
|
|
67
|
+
/** The page's declared route parameters (`page.route_params`). */
|
|
68
|
+
routeParams: Record<string, string>;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* Props the host passes to a plugin style component (the `component` of an
|
|
73
|
+
* {@link IStyleDefinition}). `style` is the section as the page payload
|
|
74
|
+
* carries it (fields keyed by name).
|
|
75
|
+
*/
|
|
76
|
+
export interface IPluginStyleProps {
|
|
77
|
+
style: Record<string, unknown>;
|
|
78
|
+
styleProps: Record<string, string>;
|
|
79
|
+
cssClass: string;
|
|
80
|
+
parentActive?: number;
|
|
81
|
+
childIndex?: number;
|
|
82
|
+
parentColor?: string;
|
|
83
|
+
/** The popup the page is shown in; a no-op outside one. */
|
|
84
|
+
pageModal: IPluginPageModal;
|
|
85
|
+
/** The page the section is on, to name in plugin calls. */
|
|
86
|
+
page: IPluginStylePage;
|
|
87
|
+
}
|
|
88
|
+
|
|
43
89
|
/**
|
|
44
90
|
* Props passed by the host's section-field editor to a plugin-supplied
|
|
45
91
|
* field renderer. The host owns the surrounding label / help tooltip /
|
|
@@ -246,6 +292,13 @@ export interface IPluginApi {
|
|
|
246
292
|
realtime?: IPluginRealtimePublisher;
|
|
247
293
|
/** Host rich-text editor adapter. */
|
|
248
294
|
richTextEditor: IRichTextEditorAdapter;
|
|
295
|
+
/**
|
|
296
|
+
* The host's HTML sanitizer, with the same rules core pages use (web:
|
|
297
|
+
* DOMPurify, plus the host's link rewrites). Call it before rendering any
|
|
298
|
+
* CMS or user HTML; never bundle a sanitizer of your own. `inline` keeps
|
|
299
|
+
* inline markup only, `block` also keeps headings, lists and paragraphs.
|
|
300
|
+
*/
|
|
301
|
+
sanitizeHtml(html: string, mode: 'inline' | 'block'): string;
|
|
249
302
|
/**
|
|
250
303
|
* Logger that respects the host's debug config. Avoid `console.log`
|
|
251
304
|
* in plugin code; route everything through this.
|
|
@@ -260,9 +313,12 @@ export interface IPluginApi {
|
|
|
260
313
|
|
|
261
314
|
/**
|
|
262
315
|
* Same shape on mobile, minus the rich-text editor adapter when the
|
|
263
|
-
* plugin only supports read-only mobile rendering.
|
|
316
|
+
* plugin only supports read-only mobile rendering. React Native does not
|
|
317
|
+
* render HTML, so there is no `sanitizeHtml`: mobile plugins show CMS text
|
|
318
|
+
* with `parseInlineRich` / `stripHtmlToText`. A plugin that renders HTML in
|
|
319
|
+
* a WebView sanitizes it there itself.
|
|
264
320
|
*/
|
|
265
|
-
export interface IMobilePluginApi extends Omit<IPluginApi, 'richTextEditor'> {
|
|
321
|
+
export interface IMobilePluginApi extends Omit<IPluginApi, 'richTextEditor' | 'sanitizeHtml'> {
|
|
266
322
|
/** Mobile builds without rich-text support set this to `null`. */
|
|
267
323
|
richTextEditor: IRichTextEditorAdapter | null;
|
|
268
324
|
}
|