UNPKG

@persona/layout-editor-remote-module

Version:

Shared manifest format, Vite plugin, and host/iframe bridge for remotely-defined dashboard layout modules in Persona dashboard apps.

24 lines (22 loc) • 1.33 kB
import { n as JsonSchemaObject, t as Json } from "./types-CBSiNsDJ.mjs"; //#region src/config-form.d.ts /** JSON pointer, in the nested schema, of the module's own config schema. */ declare const REMOTE_CONFIG_POINTER_PREFIX = "#/properties/config"; /** * Nest a manifest `configSchema` under a top-level `config` property, rewriting `$ref`s so they * still resolve. Drops `$schema` and `$id`; keeps `$defs` / `definitions` at the root. */ declare function nestRemoteConfigSchema(configSchema: JsonSchemaObject): JsonSchemaObject; /** * Nest a manifest `uiConfigSchema` to match {@link nestRemoteConfigSchema}, hiding the wrapper * object's title so the module's fields render as if top level. */ declare function nestRemoteUiConfigSchema(uiConfigSchema: JsonSchemaObject | undefined): JsonSchemaObject; /** * A config holding each top-level `configSchema` property's `default`, overlaid with the selected * layout's `defaultConfig`. Hosts pass `manifest.defaultConfig?.[layoutType]`; both sources are * cloned so the result can be mutated freely. */ declare function remoteConfigDefaults(configSchema: JsonSchemaObject | undefined, layoutDefaults?: Record<string, unknown>): Record<string, Json>; //#endregion export { REMOTE_CONFIG_POINTER_PREFIX, nestRemoteConfigSchema, nestRemoteUiConfigSchema, remoteConfigDefaults };