import { type Operation } from "../ir/operations.js"; import { type CompileContext } from "./shared.js"; /** * Per-site SXA-style enumeration template trio. Three templates with * distinct roles — emitted as siblings under the site's * `Presentation/` templates folder: * * Enumerations Folder → folder layers in the enum content tree * (root, per-folder grouping items) * └── __Standard Values Insert Options: Enumeration + Enumerations Folder * * Enumeration → per-enum container items * (`Color Scheme`, `Heading Size`, etc.) * └── __Standard Values Insert Options: Enumeration Value * * Enumeration Value → leaf value items * (`primary`, `accent`, `lg`, `shooting-star`) * └── Enumeration (section) * └── Value (Single-Line Text, shared) * * All three inherit from Standard Template only and stamp the * `keyboard_key_e.png` icon so the SXA editor recognises enum items * as enumeration entries (not folders) without per-item icon overrides. * * The `Value` field on `Enumeration Value` carries each value item's * actual enumeration string (`"primary"`, `"shooting-star"`, etc.) — * the canonical SXA "picked item's Value field" payload that Droplink * consumers (XM Cloud Pages, JSS variants, custom Edge resolvers) read. * * Insert Options are wired so authors can right-click without picking * templates from a long list: * - Inside an `Enumerations Folder` → Insert: `Enumeration` (typical) * or `Enumerations Folder` (nesting, e.g. `Theme/Color`) * - Inside an `Enumeration` → Insert: `Enumeration Value` only * - Inside an `Enumeration Value` → no Insert Options (leaves) * * Idempotent across the recipe set — the templates are emitted on * first call and re-uses are no-ops via the shared `emittedFolders` * set. Returns the deterministic refKeys for all three templates + * the `Value` field so callers can wire `templateOf` and `Value` field * writes correctly. */ export interface EnumerationTemplateRefs { folderTemplateRefKey: string; /** Per-enum container template (Color Scheme, Heading Size, …). */ enumerationTemplateRefKey: string; /** * RefKey of the `Value` Template Field under the *Enumeration* * template's inner `Enumeration` section. Carries each per-enum * container's canonical default (driven by `EnumerationRecipe.default`). * Distinct from `valueFieldRefKey` (which is on the Enumeration Value * template, for leaf items). */ containerValueFieldRefKey: string; /** Leaf value template (primary, accent, lg, …). Carries the `Value` field. */ valueTemplateRefKey: string; /** * RefKey of the `Value` Template Field under the Enumeration Value * template. Callers writing the field on individual value items pair * this with `fieldName: "Value"` so the executor's tenant-side * resolver can locate the field by name (recipe-derived field GUIDs * don't match the Sitecore-assigned ones). */ valueFieldRefKey: string; } /** * The `emittedFolders` sentinel key guarding the shared enumeration * template trio's one-time emission. Exported so `compileRecipeSet` can * PRE-SEED it: when the whole set is compiled, the templates + their * `__Standard Values` are emitted once via the stable * `__enumeration-templates__` FRONT aggregate (owned by that synthetic * handle so tenant ownership never drifts between rebuilds), and every * per-recipe `ensureEnumerationTemplates` call short-circuits to * refKeys-only. A single-recipe compile (no set, fresh set) still emits * the templates inline so the IR stays self-contained. */ export declare const enumerationTemplatesSentinel: (site: string) => string; export declare const ensureEnumerationTemplates: (operations: Operation[], context: CompileContext, site: string, emittedFolders: Set) => EnumerationTemplateRefs;