@alfakit/core 0.1.0 → 0.1.2

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.
@@ -1 +1 @@
1
- {"version":3,"file":"components.d.ts","names":[],"sources":["../../src/schema/components.ts"],"mappings":";;;;;;;iBAyBiB;EACf;EACA;EACA;EACA;EACA;EACA,UAAU;EACV,aAAa,YAAY;EACzB,cAAc;;EAEd,cAAc;EACd,kBAAkB;EAClB,OAAO;;EAEP;;EAEA,SAAS;;EAET;;EAEA;;EAEA,UAAU;;;;;EAKV;;EAEA;;;iBAIe;EACf,YAAY;EACZ;;EAEA,SAAS;;EAET,OAAO;;EAEP;;iBAGe;EACf;EACA;;;;;;;iBAQe;EACf,gBAAgB;EAChB,gBAAgB;EAChB,cAAc;;;;;;YAOJ;;;;;YAgBA;EACR,WAAW;EAAiB;;EAAqB,QAAQ;EAAiB;;iBAE7D;EACf,OAAO;;EAEP;;iBAGe;EACf,QAAQ,QAAQ,OAAO,iBAAiB;;;iBAIzB,kBAAkB,eAAe,cAAc;EAC9D;EACA;EACA;EACA;EACA;EACA;EACA;;EAEA;EACA,WAAW;EACX,YAAY;;EAEZ;EACA,OAAO;EACP,uBAAuB;;EAEvB,8BAA8B;;EAE9B;;;;;EAKA,eAAe;;;iBAIA;EACf;;EAEA;;EAEA;EACA;;EAEA;;iBAGe;EACf,SAAS;EACT;;iBAGe;EACf;EACA;EACA,aAAa;EACb,aAAa;EACb,kBAAkB;EAClB,kBAAkB;;iBAKH,wBAAwB,WAAW;EAClD;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;EAEA;EACA;EACA;;EAEA;;EAEA;EACA;;EAEA;;iBAGe,uBAAuB;EACtC;EACA;EACA;EACA;EACA;EACA;;iBAGe,qBAAqB;EACpC;;;iBAIe,+BAA+B;EAC9C;;EAEA;;EAEA;;iBAGe,uBAAuB;EACtC;EACA;;iBAGe,qBAAqB;EACpC;EACA;EACA,SAAS;EACT,UAAU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,gBACA,iBACA,aACA,YACA,eACA,aACA,oBACA,aACA,aACA;iBAIa,kBAAkB,eAAe,cAAc;EAC9D;EACA;EACA;EACA;EACA;EACA;;EAEA;EACA,WAAW;EACX,YAAY;EACZ;;EAEA;;;;;EAKA,8BAA8B;;EAE9B,YAAY;;iBAGG;EACf;EACA;EACA;EACA;EACA;EACA;EACA;;EAEA;EACA;;iBAGe;EACf;EACA;EACA;EACA;EACA;;;;;EAKA;EACA;;;iBAIe;;EAEf;;EAEA;;iBAGe,wBAAwB,WAAW,gBAAgB;EAClE;EACA,oCAAoC;EACpC,QAAQ;EACR,OAAO;EACP,eAAe;EACf,YAAY;;EAEZ,aAAa,MAAM;;EAEnB,YAAY,MAAM;;EAElB,WAAW;EACX;;iBAGe,wBAAwB;EACvC;EACA,OAAO;EACP,QAAQ;EACR,OAAO;;iBAGQ,yBAAyB,WAAW;EACnD;;EAEA,qBAAqB;EACrB;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;EAEA;;EAEA;;EAEA;;EAEA,OAAO;;;iBAIQ,wBAAwB;EACvC;EACA;;EAEA;;EAEA;EACA;EACA;EACA;;EAEA;;iBAGe,yBAAyB,WAAW;EACnD;EACA;;iBAGe,4BAA4B;EAC3C;EACA,QAAQ;EACR;EACA;;iBAGe,8BAA8B;EAC7C;EACA,OAAO;EACP;EACA,OAAO;;EAEP,QAAQ;;;iBAIO,wBAAwB;EACvC;EACA;EACA,QAAQ;;YAGE,cACR,kBACA,kBACA,kBACA,mBACA,kBACA,mBACA,sBACA;YAEQ,kBACV,cAAc,eAAe,eAAe;EAAkB"}
1
+ {"version":3,"file":"components.d.ts","names":[],"sources":["../../src/schema/components.ts"],"mappings":";;;;;;;iBAyBiB;EACf;EACA;EACA;EACA;EACA;EACA,UAAU;EACV,aAAa,YAAY;EACzB,cAAc;;EAEd,cAAc;EACd,kBAAkB;EAClB,OAAO;;EAEP;;EAEA,SAAS;;EAET;;EAEA;;EAEA,UAAU;;;;;EAKV;;EAEA;;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oC;EACpC,QAAQ;EACR,OAAO;EACP,eAAe;EACf,YAAY;;EAEZ,aAAa,MAAM;;EAEnB,YAAY,MAAM;;EAElB,WAAW;EACX;;iBAGe,wBAAwB;EACvC;EACA,OAAO;EACP,QAAQ;EACR,OAAO;;iBAGQ,yBAAyB,WAAW;EACnD;;EAEA,qBAAqB;EACrB;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;EAEA;;EAEA;;EAEA;;EAEA,OAAO;;;iBAIQ,wBAAwB;EACvC;EACA;;EAEA;;EAEA;EACA;EACA;EACA;;EAEA;;iBAGe,yBAAyB,WAAW;EACnD;EACA;;iBAGe,4BAA4B;EAC3C;EACA,QAAQ;EACR;EACA;;iBAGe,8BAA8B;EAC7C;EACA,OAAO;EACP;EACA,OAAO;;EAEP,QAAQ;;;iBAIO,wBAAwB;EACvC;EACA;EACA,QAAQ;;YAGE,cACR,kBACA,kBACA,kBACA,mBACA,kBACA,mBACA,sBACA;YAEQ,kBACV,cAAc,eAAe,eAAe;EAAkB"}
@@ -1 +1 @@
1
- {"version":3,"file":"components.js","names":[],"sources":["../../src/schema/components.ts"],"sourcesContent":["import type { ActionSchema, AnyActionSchema } from './actions'\nimport type {\n BuilderSchema,\n CodeEditorSchema,\n ModalTableSelectSchema,\n SliderSchema,\n ToggleButtonsSchema,\n} from './advanced-fields'\nimport type {\n Alignment,\n Attributes,\n Breakpoints,\n Color,\n ColumnSpanValue,\n IconName,\n IconPosition,\n Operation,\n OptionOrGroup,\n Size,\n VirtualizeSchema,\n} from './common'\nimport type { FileManagerPickerSchema } from './file-manager'\nimport type { IconPickerSchema } from './icon-picker'\n\n/** Properties every schema component carries. */\nexport interface BaseComponent {\n type: string\n key: string\n id?: string\n label?: string | null\n disabled?: boolean\n columns?: Breakpoints\n columnSpan?: Breakpoints<ColumnSpanValue>\n columnStart?: Breakpoints<number | string | null>\n /** `columnOrder()`: CSS `order` in the parent grid, per breakpoint. */\n columnOrder?: Breakpoints<number | null>\n extraAttributes?: Attributes\n meta?: Record<string, unknown>\n /** `false` keeps the component at its natural width inside a `Flex`. */\n grow?: boolean\n /** Child components (layout containers). */\n schema?: SchemaComponent[]\n /** `dense()`: half the gap between the children (layout containers). */\n dense?: boolean\n /** `gap(false)`: no gap between the children (layout containers). */\n gap?: false\n /** `exposeContext()`: what a custom frontend component may read about its schema. */\n context?: SchemaComponentContext\n /**\n * `deferLoading()`: sent without its children on the page's first response; the\n * renderer loads them from `schemaDeferred` once the placeholder is in view.\n */\n deferred?: boolean\n /** State paths of the fields inside a deferred component (loaded early on errors). */\n deferredPaths?: string[]\n}\n\n/** Server-provided context of a component (`exposeContext()`), read with the renderers' context helper. */\nexport interface SchemaComponentContext {\n operation?: Operation | null\n recordKey?: string | number | null\n /** The record attributes listed in `exposeContext(record: [...])`. */\n record?: Record<string, unknown> | null\n /** `exposeContext(data: [...])`. */\n data?: Record<string, unknown> | null\n /** The state path of the component's container (e.g. `items.0` in a repeater item); relative `get()` paths start here. */\n basePath?: string | null\n}\n\nexport interface LiveConfig {\n onBlur: boolean\n debounce: number | null\n}\n\n/**\n * Actions attached to a field or entry: before (`prefixActions`) and after\n * (`suffixActions`) the control, and next to the label (`hintActions`). They run as field\n * actions (`field:{schema}::{key}`, see `fieldActionContext()`).\n */\nexport interface FieldActions {\n prefixActions?: ActionSchema[]\n suffixActions?: ActionSchema[]\n hintActions?: ActionSchema[]\n}\n\n/**\n * Content slots of a field or entry (`aboveLabel()`, `afterContent()`…). The error message\n * slots exist on fields only and show while the field has a validation error.\n */\nexport type ContentSlotName =\n | 'aboveLabel'\n | 'beforeLabel'\n | 'afterLabel'\n | 'belowLabel'\n | 'aboveContent'\n | 'beforeContent'\n | 'afterContent'\n | 'belowContent'\n | 'aboveErrorMessage'\n | 'belowErrorMessage'\n\n/**\n * One item of a content slot: a schema component (strings arrive as `Text`, `Htmlable`\n * values as `Html`) or an action / action group, run as a field action.\n */\nexport type ContentSlotItem =\n { component: SchemaComponent; action?: never } | { action: AnyActionSchema; component?: never }\n\nexport interface ContentSlotSchema {\n items: ContentSlotItem[]\n /** `afterLabel` defaults to `end`, every other slot to `start`. */\n alignment: 'start' | 'end' | 'between'\n}\n\nexport interface ContentSlots {\n slots?: Partial<Record<ContentSlotName, ContentSlotSchema>>\n}\n\n/** Properties every form field carries. */\nexport interface BaseField extends BaseComponent, FieldActions, ContentSlots {\n name: string\n statePath: string\n required?: boolean\n readOnly?: boolean\n autofocus?: boolean\n placeholder?: string\n helperText?: string\n /** HTML: plain strings are escaped by the server, `Htmlable` values are sent as is. */\n hint?: string\n hintIcon?: IconName\n hintColor?: Color\n /** `inlineLabel()`: the label sits beside the control from the `sm` breakpoint up. */\n inlineLabel?: boolean\n live?: LiveConfig\n extraInputAttributes?: Attributes\n /** Attributes for the `data-slot=\"field\"` wrapper, merged with `extraAttributes`. */\n extraFieldWrapperAttributes?: Attributes\n /** `allowHtmlValidationMessages()`: the error message is rendered as HTML. */\n allowHtmlValidationMessages?: boolean\n /**\n * `->translatable()`: the state is a `{ [locale code]: value }` object and the renderer\n * shows one input per language (see `translatableLocaleField()`).\n */\n translatable?: TranslatableSchema\n}\n\n/** A language of a translatable field. */\nexport interface TranslatableLocaleSchema {\n code: string\n /** BCP 47 tag for the `lang` attribute. */\n tag: string\n /** The language's own name. */\n label: string\n direction: 'ltr' | 'rtl'\n /** Must be filled when the field is required. */\n required?: boolean | null\n}\n\nexport interface TranslatableSchema {\n locales: TranslatableLocaleSchema[]\n defaultLocale: string\n}\n\nexport interface Affixes {\n prefix?: string\n suffix?: string\n prefixIcon?: IconName\n suffixIcon?: IconName\n prefixIconColor?: Color\n suffixIconColor?: Color\n}\n\n// ---------------------------------------------------------------- Fields\n\nexport interface TextInputSchema extends BaseField, Affixes {\n type: 'TextInput'\n inputType: 'text' | 'email' | 'password' | 'number' | 'tel' | 'url' | 'search' | (string & {})\n revealable?: boolean\n minLength?: number\n maxLength?: number\n min?: number\n max?: number\n step?: number | string\n mask?: string\n /** `autocomplete(false)` arrives as `off`. */\n autocomplete?: string\n inputMode?: string\n datalist?: string[]\n /** HTML `autocapitalize` hint (`on`, `off`, `none`, `sentences`, `words`, `characters`). */\n autocapitalize?: 'on' | 'off' | 'none' | 'sentences' | 'words' | 'characters' | (string & {})\n /** `copyable()`: a button in the input copies its value. */\n copyable?: boolean\n copyMessage?: string\n /** Milliseconds the copied confirmation stays visible. */\n copyMessageDuration?: number\n}\n\nexport interface TextareaSchema extends BaseField {\n type: 'Textarea'\n rows?: number\n cols?: number\n minLength?: number\n maxLength?: number\n autosize?: boolean\n}\n\nexport interface HiddenSchema extends BaseField {\n type: 'Hidden'\n}\n\n/** `OneTimeCodeInput`: a numeric code with `autocomplete=\"one-time-code\"`. */\nexport interface OneTimeCodeInputSchema extends BaseField {\n type: 'OneTimeCodeInput'\n /** Number of digits. */\n length: number\n /** `submitOnCompletion()`: submit the form once every digit is entered. */\n submitOnCompletion?: boolean\n}\n\nexport interface CheckboxSchema extends BaseField {\n type: 'Checkbox'\n inline: boolean\n}\n\nexport interface ToggleSchema extends BaseField {\n type: 'Toggle'\n inline: boolean\n onIcon?: IconName\n offIcon?: IconName\n onColor?: Color\n offColor?: Color\n}\n\nexport interface SelectSchema extends BaseField, Affixes {\n type: 'Select'\n options: OptionOrGroup[]\n /** Labels for the currently selected values of a searchable select. */\n selectedLabels?: Record<string, string>\n multiple?: boolean\n searchable?: boolean\n native?: boolean\n selectablePlaceholder: boolean\n searchDebounce?: number\n noSearchResultsMessage?: string\n searchPrompt?: string\n loadingMessage?: string\n /** Shown when the select has no options at all. */\n noOptionsMessage?: string\n /** Shown while search results load. */\n searchingMessage?: string\n /** Option labels are HTML (sanitised by the server). */\n allowHtml?: boolean\n /** `false`: long option labels are truncated instead of wrapping. */\n wrapOptionLabels?: false\n maxItems?: number\n minItems?: number\n /** `reorderable()` on a multi-select: chosen chips can be reordered (drag or keyboard). */\n reorderable?: boolean\n}\n\nexport interface CheckboxListSchema extends BaseField {\n type: 'CheckboxList'\n options: OptionOrGroup[]\n searchable?: boolean\n /** `noSearchResultsMessage()`: shown when the search matches no option. */\n noSearchResultsMessage?: string\n /** `searchPrompt()`: placeholder of the search input. */\n searchPrompt?: string\n /** `searchDebounce()`: milliseconds to wait after typing before filtering. */\n searchDebounce?: number\n bulkToggleable?: boolean\n inline?: boolean\n gridColumns?: number\n /** `column` fills the grid column by column; row by row otherwise. */\n gridDirection?: OptionsGridDirection\n /** Option labels are HTML (sanitised by the server). */\n allowHtml?: boolean\n /** Customised bulk toggle links (`selectAllAction()` / `deselectAllAction()`). */\n selectAllAction?: BulkToggleActionSchema\n deselectAllAction?: BulkToggleActionSchema\n}\n\nexport type OptionsGridDirection = 'row' | 'column'\n\nexport interface BulkToggleActionSchema {\n label?: string\n icon?: IconName\n hidden?: boolean\n}\n\nexport interface RadioSchema extends BaseField {\n type: 'Radio'\n options: OptionOrGroup[]\n inline?: boolean\n}\n\nexport interface DatePickerSchema extends BaseField, Affixes {\n type: 'DatePicker' | 'DateTimePicker' | 'TimePicker'\n /** PHP date format of the stored value. */\n format: string\n displayFormat?: string\n hasDate: boolean\n hasTime: boolean\n hasSeconds?: boolean\n minDate?: string\n maxDate?: string\n disabledDates?: string[]\n native: boolean\n timezone: string\n firstDayOfWeek: number\n closeOnDateSelection: boolean\n /** Steps of the time inputs (`hoursStep()`, `minutesStep()`, `secondsStep()`). */\n hoursStep?: number\n minutesStep?: number\n secondsStep?: number\n /** The month the calendar opens on while empty, in the storage format. */\n defaultFocusedDate?: string\n /** `locale()`: BCP 47 tag for this picker's names and display format (the panel's otherwise). */\n locale?: string\n /** `datalist()`: suggested values in the storage format (native pickers only). */\n datalist?: string[]\n}\n\nexport interface MoneyInputSchema extends BaseField, Affixes {\n type: 'MoneyInput'\n /** ISO 4217 code. */\n currency: string\n /** Minor-unit digits of the currency (USD 2, BHD 3, JPY 0). */\n decimals: number\n min?: number\n max?: number\n}\n\nexport interface ColorPickerSchema extends BaseField {\n type: 'ColorPicker'\n format: 'hex' | 'rgb' | 'rgba' | 'hsl'\n}\n\nexport interface TagsInputSchema extends BaseField {\n type: 'TagsInput'\n suggestions?: string[]\n splitKeys: string[]\n color?: Color\n reorderable?: boolean\n tagPrefix?: string\n tagSuffix?: string\n}\n\nexport interface KeyValueSchema extends BaseField {\n type: 'KeyValue'\n keyLabel: string\n valueLabel: string\n keyPlaceholder?: string\n valuePlaceholder?: string\n addActionLabel: string\n addable: boolean\n deletable: boolean\n reorderable: boolean\n editableKeys: boolean\n editableValues: boolean\n /** `addAction()`, `deleteAction()`, `reorderAction()`; null = hidden. */\n itemActions?: Partial<Record<'add' | 'delete' | 'reorder', ItemActionSchema | null>>\n}\n\nexport interface UploadedFile {\n path: string\n name: string\n url?: string\n /** `getOpenableFileUrlUsing()`: where \"open\" links to, when not `url`. */\n openUrl?: string\n /** `getDownloadableFileUrlUsing()`: where \"download\" links to, when not `url`. */\n downloadUrl?: string\n /** `fetchFileInformation()`: the stored file no longer exists on its disk. */\n missing?: boolean\n temporary?: boolean\n size?: number\n}\n\n/** Logical sides of a file upload's controls (`removeUploadedFileButtonPosition()`…). */\nexport interface FileUploadPositions {\n removeButton?: 'start' | 'end'\n progressIndicator?: 'start' | 'end'\n uploadButton?: 'start' | 'center' | 'end'\n}\n\nexport interface FileUploadSchema extends BaseField {\n type: 'FileUpload'\n multiple?: boolean\n image?: boolean\n avatar?: boolean\n acceptedFileTypes?: string[]\n maxSize?: number\n minSize?: number\n /** Encrypted limits sent with each upload so the endpoint applies the field's `maxSize()`. */\n uploadPolicy?: string | null\n maxFiles?: number\n minFiles?: number\n downloadable?: boolean\n openable?: boolean\n previewable: boolean\n reorderable?: boolean\n deletable: boolean\n panelLayout: 'compact' | 'grid' | 'integrated' | 'circle' | (string & {})\n /** `panelAspectRatio()`: aspect ratio of the drop zone, e.g. `'2:1'`. */\n panelAspectRatio?: string\n imagePreviewHeight?: number | string\n /** `maxParallelUploads()`: files of one selection uploading at once (default 1). */\n maxParallelUploads?: number\n /** `appendFiles(false)`: new uploads go before the existing files. */\n appendFiles?: boolean\n /** `mimeTypeMap()`: extension → MIME type, for extensions browsers don't recognise. */\n mimeTypeMap?: Record<string, string>\n positions?: FileUploadPositions\n /** Images are cropped/resized in the browser before upload with these options. */\n imageCropAspectRatio?: string\n imageResizeMode?: 'cover' | 'contain' | 'force' | (string & {})\n imageResizeTargetWidth?: number\n imageResizeTargetHeight?: number\n uploadingMessage?: string\n /** `imageEditor()`: crop / rotate / flip each image before it is uploaded. */\n imageEditor?: FileUploadImageEditorSchema | null\n /** `imageAspectRatio()`: ratios the server accepts (checked on the file's pixels). */\n imageAspectRatio?: string[] | null\n /** `imageDimensions()`: pixel limits the server checks. */\n imageDimensions?: {\n minWidth?: number\n minHeight?: number\n maxWidth?: number\n maxHeight?: number\n } | null\n /** Re-encode JPEGs upright in the browser (sent only when the server can't do it). */\n orientImagesFromExif?: boolean | null\n /** `pasteable()`: accept files pasted while the drop zone has focus. */\n pasteable?: boolean\n files: UploadedFile[]\n}\n\nexport interface FileUploadImageEditorSchema {\n /** `'16:9'`-style ratios; `null` is free cropping. The first one is selected. */\n aspectRatios: Array<string | null>\n /** `circleCropper()`: a round viewport (the output stays square). */\n circle: boolean\n /** `imageEditorMode()` (Cropper.js `viewMode`): `0` lets the crop leave the image. */\n mode?: 0 | 1 | 2 | 3\n /** `imageEditorEmptyFillColor()`: colour of the empty space around the image. */\n emptyFillColor?: string | null\n /** `imageEditorViewportWidth()/Height()`: the crop ratio the editor opens with. */\n viewportWidth?: number | null\n viewportHeight?: number | null\n}\n\n/** A custom block a RichEditor can insert (`RichEditor::blocks()`). */\nexport interface RichEditorCustomBlockSchema {\n id: string\n label: string\n icon?: IconName\n /** The panel group (`customBlocks(['Marketing' => [...]])`). */\n group?: string\n /**\n * The field action (`customBlock:{id}`) that inserts the block: with a modal when the\n * block has a configuration form. It returns `{ id, config, preview }`.\n */\n action: ActionSchema\n}\n\n/** A mention trigger (`RichEditor::mentions()`). */\nexport interface RichEditorMentionSchema {\n /** The character that starts a mention, e.g. `@` or `#`. */\n trigger: string\n /** Static items; omitted when the server searches them (`getSearchResultsUsing`). */\n items?: Array<{ id: string; label: string }>\n /** Search on the server through the options endpoint as the user types. */\n searchable?: boolean\n searchDebounce?: number\n}\n\n/** A merge tag (`RichEditor::mergeTags()`), stored as `{{ id }}`. */\nexport interface RichEditorMergeTagSchema {\n id: string\n label: string\n}\n\n/** A toolbar dropdown (`ToolbarButtonGroup::make()`), referenced as `group:{n}` in a toolbar. */\nexport interface RichEditorToolbarGroupSchema {\n label: string\n /** Fixed trigger icon; without one the trigger shows the active (or first) button's icon. */\n icon?: IconName\n buttons: string[]\n /** `textualButtons()`: list the buttons with their labels. */\n textual?: boolean\n}\n\n/** A toolbar button from a rich content plugin (`RichEditorTool`). */\nexport interface RichEditorToolSchema {\n name: string\n label: string\n icon?: IconName\n /** Tiptap chain commands run on click: `[name, ...args]` each. */\n commands?: Array<[string, ...unknown[]]>\n /**\n * The plugin's editor action (opened with `editorSelection` and `attributes` arguments).\n * It may return `{ editorCommands, editorSelection }` (`RichEditor::runCommands()`).\n */\n action?: ActionSchema\n /** Pressed while this mark or node (with these attributes) is active. */\n active?: { name: string; attributes?: Record<string, unknown> }\n}\n\nexport interface RichEditorSchema extends BaseField {\n type: 'RichEditor' | 'MarkdownEditor'\n /** Button names, `'|'` separators and `group:{n}` dropdowns (see `toolbarButtonGroups`). */\n toolbarButtons: string[]\n toolbarButtonGroups?: Record<string, RichEditorToolbarGroupSchema> | null\n /**\n * `floatingToolbars()`: buttons shown next to the selection, keyed by node name\n * (`paragraph`, `heading`, `table`, `image`, …).\n */\n floatingToolbars?: Record<string, string[]> | null\n stickyToolbar?: boolean | null\n stickyPanels?: boolean | null\n /** CSS length; null measures the panel's sticky topbar. */\n stickyOffset?: string | null\n /** `resizableImages()`: drag handles; the width is stored on the image. */\n resizableImages?: boolean | null\n minimalCustomBlockControls?: boolean | null\n customBlocksGrid?: boolean | null\n searchableCustomBlocks?: boolean | null\n /** The panel open on load (`activePanel()`). */\n activePanel?: 'customBlocks' | 'mergeTags' | null\n /** Plugin toolbar buttons, usable by name in the toolbars. */\n editorTools?: RichEditorToolSchema[] | null\n /** Registry keys of plugin Tiptap extensions (`createAlfakit({ richEditorExtensions })`). */\n extensions?: string[] | null\n fileAttachments: {\n disk: string\n directory: string | null\n /** MIME types an inserted image may have; the server checks them on save. */\n acceptedFileTypes?: string[]\n /** Kilobytes. */\n maxSize?: number\n /** Encrypted limits sent with each upload (size and types of attachments). */\n uploadPolicy?: string | null\n }\n /** The `textColor` button's palette (`textColors()`); only sent with that button. */\n textColors?: Array<{ value: string; label: string }> | null\n /** `customTextColors()`: also offer a free colour picker. */\n customTextColors?: boolean | null\n minHeight?: number\n maxHeight?: number\n /**\n * `linkProtocols()`: URL schemes links may use (relative links always can); null keeps\n * the defaults. The server drops other links when the content is saved.\n */\n linkProtocols?: string[] | null\n /**\n * MarkdownEditor: the Markdown state rendered as HTML, which is what the editor loads.\n * A translatable editor gets one document per language code (see\n * `translatableLocaleField()`, which picks the current one).\n */\n html?: string | Record<string, string | null> | null\n /** RichEditor: the state is a Tiptap JSON document instead of HTML. */\n json?: boolean\n customBlocks?: RichEditorCustomBlockSchema[]\n mentions?: RichEditorMentionSchema[]\n mergeTags?: RichEditorMergeTagSchema[]\n}\n\n/** A column of a Repeater or RepeatableEntry shown as a table (`->table([...])`). */\nexport interface TableColumnSchema {\n label: string\n /** The item component the column shows: a field's relative state path or an entry's name. */\n name?: string\n hiddenLabel?: boolean\n required?: boolean\n /** CSS width, e.g. `200px` or `30%`. */\n width?: string\n alignment?: 'start' | 'center' | 'end'\n wrapHeader?: boolean\n}\n\n/** Built-in actions of a Repeater, Builder or KeyValue (`deleteAction(fn ($a) => …)`). */\nexport type ItemActionName =\n | 'add'\n | 'delete'\n | 'clone'\n | 'reorder'\n | 'moveUp'\n | 'moveDown'\n | 'collapse'\n | 'expand'\n | 'collapseAll'\n | 'expandAll'\n\n/**\n * A built-in item action. Without `server` the renderer applies it in the browser; with\n * it (customised with a modal, handler or hooks) it runs through the field action\n * endpoint with `arguments.item` (`items` for reorder, `block` for a Builder's add).\n */\nexport interface ItemActionSchema extends ActionSchema {\n server?: boolean\n}\n\n/** Customised built-in actions by name; null = hidden. Absent names use the renderer's default. */\nexport type ItemActionsSchema = Partial<Record<ItemActionName, ItemActionSchema | null>>\n\n/** Item action props shared by Repeater and Builder. */\nexport interface ItemActionsProps {\n /** Field-level built-in actions (item actions evaluated without an item). */\n itemActions?: ItemActionsSchema\n /** `reorderableWithButtons(false)`: no move up / down buttons. */\n reorderableWithButtons?: boolean\n /** `reorderableWithDragAndDrop(false)`: no drag handle. */\n reorderableWithDragAndDrop?: boolean\n addActionAlignment?: Alignment\n itemNumbers?: boolean\n}\n\n/** Per-item action props: customised built-ins for this item, `extraItemActions()`. */\nexport interface ItemActionsItemProps {\n itemActions?: ItemActionsSchema\n actions?: ActionSchema[]\n}\n\nexport interface RepeaterItemSchema extends ItemActionsItemProps {\n key: string\n label?: string | null\n schema: SchemaComponent[]\n}\n\nexport interface RepeaterSchema extends BaseField, ItemActionsProps {\n type: 'Repeater'\n items: RepeaterItemSchema[]\n /** Blank item schema; `__INDEX__` placeholders must be replaced with the new index. */\n template: SchemaComponent[]\n templateState: Record<string, unknown>\n simple?: boolean\n minItems?: number\n maxItems?: number\n addable: boolean\n deletable: boolean\n reorderable: boolean\n cloneable?: boolean\n collapsible?: boolean\n collapsed?: boolean\n addActionLabel: string\n grid?: Breakpoints\n /** Render items as table rows: one column per item field, in schema order. */\n table?: TableColumnSchema[]\n /** `compact()`: a table layout with tighter cells. */\n compact?: boolean\n /** Render only the visible items above a threshold (`virtualize()`, on by default). */\n virtualize?: VirtualizeSchema\n}\n\nexport type FieldSchema =\n | TextInputSchema\n | TextareaSchema\n | HiddenSchema\n | OneTimeCodeInputSchema\n | CheckboxSchema\n | ToggleSchema\n | SelectSchema\n | CheckboxListSchema\n | RadioSchema\n | DatePickerSchema\n | MoneyInputSchema\n | ColorPickerSchema\n | TagsInputSchema\n | KeyValueSchema\n | FileUploadSchema\n | RichEditorSchema\n | RepeaterSchema\n | BuilderSchema\n | ToggleButtonsSchema\n | SliderSchema\n | CodeEditorSchema\n | ModalTableSelectSchema\n | IconPickerSchema\n | FileManagerPickerSchema\n\nexport const FIELD_TYPES = [\n 'TextInput',\n 'Textarea',\n 'Hidden',\n 'OneTimeCodeInput',\n 'Checkbox',\n 'Toggle',\n 'Select',\n 'CheckboxList',\n 'Radio',\n 'DatePicker',\n 'DateTimePicker',\n 'MoneyInput',\n 'TimePicker',\n 'ColorPicker',\n 'TagsInput',\n 'KeyValue',\n 'FileUpload',\n 'RichEditor',\n 'MarkdownEditor',\n 'Repeater',\n 'Builder',\n 'ToggleButtons',\n 'Slider',\n 'CodeEditor',\n 'ModalTableSelect',\n 'IconPicker',\n // alfasix/alfakit-file-manager\n 'FileManagerPicker',\n] as const\n\nexport function isField(component: SchemaComponent): component is FieldSchema {\n return (\n 'statePath' in component &&\n typeof (component as BaseField).statePath === 'string' &&\n (FIELD_TYPES as readonly string[]).includes(component.type)\n )\n}\n\n// ---------------------------------------------------------------- Layout\n\nexport interface GridSchema extends BaseComponent {\n type: 'Grid'\n}\n\nexport interface GroupSchema extends BaseComponent {\n type: 'Group'\n}\n\n/**\n * Fields fused into one control (shared border, no gaps). Child labels become\n * screen-reader text and their errors are listed below the group.\n */\nexport interface FusedGroupSchema extends BaseComponent {\n type: 'FusedGroup'\n}\n\nexport interface SectionSchema extends BaseComponent {\n type: 'Section'\n heading?: string\n /** The heading's level (`2` = `h2`): `rootHeadingLevel()` plus the nesting depth. */\n headingLevel?: number\n description?: string\n icon?: IconName\n collapsible?: boolean\n collapsed?: boolean\n /** `persistCollapsed()`: the local storage key the collapsed state is kept under. */\n persistCollapsed?: string\n compact?: boolean\n aside?: boolean\n secondary?: boolean\n headerActions?: AnyActionSchema[]\n /** `afterHeader()`: actions and components at the end of the header. */\n afterHeader?: ContentSlotItem[]\n footerActions?: AnyActionSchema[]\n /** `footerActionsAlignment()`: alignment of `footerActions` (default `start`). */\n footerActionsAlignment?: Alignment\n /** `footer()`: actions and components in the footer, after `footerActions`. */\n footer?: ContentSlotItem[]\n}\n\nexport interface FieldsetSchema extends BaseComponent {\n type: 'Fieldset'\n /** `contained(false)`: no border or padding around the fields. */\n contained?: false\n}\n\nexport interface TabSchema extends BaseComponent {\n type: 'Tab'\n icon?: IconName\n iconPosition?: IconPosition\n badge?: string | number\n badgeColor?: Color\n /** `Tab::badgeTooltip()`: shown on hover (title) of the badge. */\n badgeTooltip?: string\n /** `deferBadge()`: the badge is loaded from `schemaDeferred` after the page renders. */\n badgeDeferred?: boolean\n}\n\n/** What `schemaDeferred` returns for a `Tab::deferBadge()` tab. */\nexport interface DeferredBadgeSchema {\n badge?: string | number | null\n badgeColor?: Color | null\n badgeTooltip?: string | null\n}\n\nexport interface TabsSchema extends BaseComponent {\n type: 'Tabs'\n schema: TabSchema[]\n activeTab: number\n contained?: boolean\n vertical?: boolean\n queryStringKey?: string\n /** `scrollable(false)`: the tab list wraps instead of scrolling sideways. */\n scrollable?: false\n /** `persistTab()`: where the active tab is remembered in the browser. */\n persistTab?: { key: string; storage: 'local' | 'session' }\n}\n\nexport interface StepSchema extends BaseComponent {\n type: 'Step'\n description?: string\n icon?: IconName\n /** Icon once the step is completed (falls back to the wizard's, then a check mark). */\n completedIcon?: IconName\n}\n\nexport interface WizardSchema extends BaseComponent {\n type: 'Wizard'\n schema: StepSchema[]\n startStep: number\n skippable?: boolean\n submitActionLabel?: string\n /** `submitAction(Action)`: rendered on the last step, runs through the action endpoint. */\n submitAction?: ActionSchema\n /** `submitAction(Htmlable)`: markup rendered on the last step. */\n submitActionHtml?: string\n nextActionLabel: string\n previousActionLabel: string\n /**\n * `nextAction(fn)` / `previousAction(fn)`: the button's appearance; `false` hides it.\n * Absent when not customised (the default buttons render).\n */\n nextAction?: ActionSchema | false\n previousAction?: ActionSchema | false\n completedIcon?: IconName\n /** Query-string key the current step is kept under (`true` from older servers = `step`). */\n persistStepInQueryString?: string | boolean\n /**\n * `goToStep()`: the server asked the wizard to show the step with this key. `id` is new\n * on every response, so the same step can be requested again.\n */\n goToStep?: { step: string; id: string }\n}\n\nexport interface PlaceholderSchema extends BaseComponent {\n type: 'Placeholder'\n content?: string\n helperText?: string\n}\n\nexport interface HtmlSchema extends BaseComponent {\n type: 'Html'\n content: string\n}\n\nexport interface TextSchema extends BaseComponent {\n type: 'Text'\n content: string\n color?: Color\n icon?: IconName\n size?: string\n weight?: string\n badge?: boolean\n /** `sans`, `serif` or `mono`. */\n fontFamily?: string\n tooltip?: string\n /** `copyable()`: a button copies `content` to the clipboard. */\n copyable?: boolean\n copyMessage?: string\n /** Milliseconds the copy confirmation shows. */\n copyMessageDuration?: number\n}\n\n/** A custom frontend component registered in the renderer. */\nexport interface ViewSchema extends BaseComponent {\n type: 'View'\n component: string\n props?: Record<string, unknown>\n}\n\n/** Children side by side, stacked below the `from` breakpoint. */\nexport interface FlexSchema extends BaseComponent {\n type: 'Flex'\n from: 'default' | 'sm' | 'md' | 'lg' | 'xl' | '2xl'\n verticalAlignment?: 'start' | 'center' | 'end'\n /** `alignment()`: horizontal alignment of the children (`justify` spreads them like `between`). */\n alignment?: Alignment\n}\n\n/** A highlighted message box. `description` is HTML (plain strings escaped by the server). */\nexport interface CalloutSchema extends BaseComponent {\n type: 'Callout'\n heading?: string\n description?: string\n icon?: IconName\n /** `iconSize()`: `sm`, `md` or `lg` (default). */\n iconSize?: Size\n color?: Color\n /**\n * `status()` / `danger()`…: kept after `color(null)` so the icon keeps its status colour\n * and danger/warning callouts keep `role=\"alert\"`.\n */\n status?: Color\n /** `iconColor()`: overrides the icon's colour. */\n iconColor?: Color\n actions?: AnyActionSchema[]\n /** `footerActionsAlignment()`: alignment of `actions` (default `start`). */\n footerActionsAlignment?: Alignment\n /** `controls()` and `controlActions()`: shown in the top end corner. */\n controls?: ContentSlotItem[]\n /** `footer()`: actions and components under the description. */\n footer?: ContentSlotItem[]\n}\n\n/**\n * A row of action buttons placed freely in a form or infolist. The actions run in the\n * component's field context (`field:{schema}::{key}`), like a field's suffix actions.\n */\nexport interface ActionsComponentSchema extends BaseComponent {\n type: 'Actions'\n actions: AnyActionSchema[]\n alignment?: Alignment\n verticalAlignment?: 'start' | 'center' | 'end'\n fullWidth?: boolean\n}\n\n/** Placeholder for missing content. `description` is HTML (escaped by the server). */\nexport interface EmptyStateComponentSchema extends BaseComponent {\n type: 'EmptyState'\n heading?: string\n description?: string\n icon?: IconName\n color?: Color\n contained: boolean\n actions?: AnyActionSchema[]\n /** `footer()`: actions and components under the description (after `actions`). */\n footer?: ContentSlotItem[]\n}\n\nexport interface IconSchema extends BaseComponent {\n type: 'Icon'\n icon: IconName\n color?: Color\n size?: Size | string\n tooltip?: string\n}\n\nexport interface ImageSchema extends BaseComponent {\n type: 'Image'\n url: string\n alt: string\n /** CSS lengths. */\n imageWidth?: string\n imageHeight?: string\n alignment?: Alignment\n circular?: boolean\n tooltip?: string\n}\n\n/** A bulleted list; every child component is one item. */\nexport interface UnorderedListSchema extends BaseComponent {\n type: 'UnorderedList'\n size?: Size | string\n}\n\nexport type LayoutSchema =\n | FlexSchema\n | CalloutSchema\n | ActionsComponentSchema\n | EmptyStateComponentSchema\n | IconSchema\n | ImageSchema\n | UnorderedListSchema\n | GridSchema\n | GroupSchema\n | FusedGroupSchema\n | SectionSchema\n | FieldsetSchema\n | TabsSchema\n | TabSchema\n | WizardSchema\n | StepSchema\n | PlaceholderSchema\n | HtmlSchema\n | TextSchema\n | ViewSchema\n\n// ---------------------------------------------------------------- Infolist entries\n\nexport interface BaseEntry extends BaseComponent, FieldActions, ContentSlots {\n name: string\n state?: unknown\n url?: string\n openUrlInNewTab?: boolean\n tooltip?: string\n helperText?: string\n /** HTML: plain strings are escaped by the server, `Htmlable` values are sent as is. */\n hint?: string\n hintIcon?: IconName\n hintColor?: Color\n placeholder?: string\n /** `inlineLabel()`: the label sits beside the value from the `sm` breakpoint up. */\n inlineLabel?: boolean\n /**\n * Attributes for the `data-slot=\"entry\"` wrapper. `extraAttributes` go on the value\n * (`data-slot=\"entry-value\"`).\n */\n extraEntryWrapperAttributes?: Attributes\n /** `alignment()`: horizontal alignment of the value. */\n alignment?: Alignment\n}\n\nexport interface TextStyleProps {\n size?: string\n weight?: string\n fontFamily?: string\n lineClamp?: number\n badge?: boolean\n copyable?: boolean\n copyMessage?: string\n /** Milliseconds the copy confirmation shows (`copyMessageDuration()`, default 1500). */\n copyMessageDuration?: number\n wrap?: boolean\n}\n\nexport interface FormattedStateProps {\n html?: boolean\n listWithLineBreaks?: boolean\n bulleted?: boolean\n placeholder?: string\n boolean?: boolean\n /**\n * `limitList()` + `expandableLimitedList()`: every item is sent; the first `listLimit`\n * show with a \"+N more\" toggle for the rest.\n */\n expandableLimitedList?: boolean\n listLimit?: number\n}\n\n/** `ring()` / `overlap()` / `extraImgAttributes()` of image columns and entries. */\nexport interface ImageStackProps {\n /** Ring width in pixels around stacked images (0–8, default 2). */\n ring?: number\n /** Overlap of stacked images in quarter rems (0–8, default 2). */\n overlap?: number\n}\n\nexport interface TextEntrySchema extends BaseEntry, TextStyleProps, FormattedStateProps {\n type: 'TextEntry'\n state?: string | number | boolean | Array<string | number> | null\n color?: Color\n icon?: IconName\n iconPosition?: IconPosition\n iconColor?: Color\n /** Per-item colours of a list state (enums whose items differ), aligned with the items. */\n itemColors?: Array<Color | null>\n /** Per-item icons of a list state, aligned with the items. */\n itemIcons?: Array<IconName | null>\n /** Per-item links of a relationship list (`tags.name` with a `url()` closure). */\n itemUrls?: Array<string | null>\n prose?: boolean\n}\n\nexport interface IconEntrySchema extends BaseEntry {\n type: 'IconEntry'\n icon?: IconName\n color?: Color\n size?: Size | string\n}\n\nexport interface ImageEntrySchema extends BaseEntry, ImageStackProps {\n type: 'ImageEntry'\n /** HTML attributes for every `<img>` (`extraImgAttributes()`). */\n extraImgAttributes?: Attributes\n state?: string[]\n circular?: boolean\n square?: boolean\n size?: number | string\n height?: number | string\n width?: number | string\n stacked?: boolean\n limit?: number\n /** `limitedRemainingText(false)` hides the \"+N\" of images past `limit` (shown by default). */\n limitedRemainingText?: boolean\n /** Text size of the \"+N\" (`limitedRemainingText(size:)`). */\n limitedRemainingTextSize?: 'xs' | 'sm' | 'md' | 'lg'\n /** Alternative text shared by every image. */\n alt?: string\n /** Alternative text per image, aligned with `state`, when a closure gives different texts. */\n alts?: Array<string | null>\n}\n\n/** Highlighted read-only code. Array state arrives as pretty-printed JSON. */\nexport interface CodeEntrySchema extends BaseEntry {\n type: 'CodeEntry'\n state?: string | null\n /** Highlighting grammar (`json`, `php`, `js`…); unknown grammars render as plain code. */\n grammar?: string\n /** Theme names exposed to CSS as `data-light-theme` / `data-dark-theme`. */\n lightTheme?: string\n darkTheme?: string\n copyable?: boolean\n copyMessage?: string\n /** Milliseconds the copy confirmation shows. */\n copyMessageDuration?: number\n}\n\nexport interface ColorEntrySchema extends BaseEntry, TextStyleProps {\n type: 'ColorEntry'\n state?: string | string[] | null\n}\n\nexport interface KeyValueEntrySchema extends BaseEntry {\n type: 'KeyValueEntry'\n state?: Record<string, unknown>\n keyLabel: string\n valueLabel: string\n}\n\nexport interface RepeatableEntrySchema extends BaseEntry {\n type: 'RepeatableEntry'\n items: SchemaComponent[][]\n contained: boolean\n grid?: Breakpoints\n /** Render items as table rows: one column per item entry, in schema order. */\n table?: TableColumnSchema[]\n}\n\n/** An entry rendered by an application component registered under `component`. */\nexport interface ViewEntrySchema extends BaseEntry {\n type: 'ViewEntry'\n component?: string\n props?: Record<string, unknown>\n}\n\nexport type EntrySchema =\n | ViewEntrySchema\n | TextEntrySchema\n | IconEntrySchema\n | ImageEntrySchema\n | CodeEntrySchema\n | ColorEntrySchema\n | KeyValueEntrySchema\n | RepeatableEntrySchema\n\nexport type SchemaComponent =\n FieldSchema | LayoutSchema | EntrySchema | (BaseComponent & { type: string })\n\nexport type { Alignment }\n"],"mappings":";AAwqBA,MAAa,cAAc;CACzB;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CAEA;AACF;AAEA,SAAgB,QAAQ,WAAsD;CAC5E,OACE,eAAe,aACf,OAAQ,UAAwB,cAAc,YAC7C,YAAkC,SAAS,UAAU,IAAI;AAE9D"}
1
+ {"version":3,"file":"components.js","names":[],"sources":["../../src/schema/components.ts"],"sourcesContent":["import type { ActionSchema, AnyActionSchema } from './actions'\nimport type {\n BuilderSchema,\n CodeEditorSchema,\n ModalTableSelectSchema,\n SliderSchema,\n ToggleButtonsSchema,\n} from './advanced-fields'\nimport type {\n Alignment,\n Attributes,\n Breakpoints,\n Color,\n ColumnSpanValue,\n IconName,\n IconPosition,\n Operation,\n OptionOrGroup,\n Size,\n VirtualizeSchema,\n} from './common'\nimport type { FileManagerPickerSchema } from './file-manager'\nimport type { IconPickerSchema } from './icon-picker'\n\n/** Properties every schema component carries. */\nexport interface BaseComponent {\n type: string\n key: string\n id?: string\n label?: string | null\n disabled?: boolean\n columns?: Breakpoints\n columnSpan?: Breakpoints<ColumnSpanValue>\n columnStart?: Breakpoints<number | string | null>\n /** `columnOrder()`: CSS `order` in the parent grid, per breakpoint. */\n columnOrder?: Breakpoints<number | null>\n extraAttributes?: Attributes\n meta?: Record<string, unknown>\n /** `false` keeps the component at its natural width inside a `Flex`. */\n grow?: boolean\n /** Child components (layout containers). */\n schema?: SchemaComponent[]\n /** `dense()`: half the gap between the children (layout containers). */\n dense?: boolean\n /** `gap(false)`: no gap between the children (layout containers). */\n gap?: false\n /** `exposeContext()`: what a custom frontend component may read about its schema. */\n context?: SchemaComponentContext\n /**\n * `deferLoading()`: sent without its children on the page's first response; the\n * renderer loads them from `schemaDeferred` once the placeholder is in view.\n */\n deferred?: boolean\n /** State paths of the fields inside a deferred component (loaded early on errors). */\n deferredPaths?: string[]\n}\n\n/** Server-provided context of a component (`exposeContext()`), read with the renderers' context helper. */\nexport interface SchemaComponentContext {\n operation?: Operation | null\n recordKey?: string | number | null\n /** The record attributes listed in `exposeContext(record: [...])`. */\n record?: Record<string, unknown> | null\n /** `exposeContext(data: [...])`. */\n data?: Record<string, unknown> | null\n /** The state path of the component's container (e.g. `items.0` in a repeater item); relative `get()` paths start here. */\n basePath?: string | null\n}\n\nexport interface LiveConfig {\n onBlur: boolean\n debounce: number | null\n}\n\n/**\n * Actions attached to a field or entry: before (`prefixActions`) and after\n * (`suffixActions`) the control, and next to the label (`hintActions`). They run as field\n * actions (`field:{schema}::{key}`, see `fieldActionContext()`).\n */\nexport interface FieldActions {\n prefixActions?: ActionSchema[]\n suffixActions?: ActionSchema[]\n hintActions?: ActionSchema[]\n}\n\n/**\n * Content slots of a field or entry (`aboveLabel()`, `afterContent()`…). The error message\n * slots exist on fields only and show while the field has a validation error.\n */\nexport type ContentSlotName =\n | 'aboveLabel'\n | 'beforeLabel'\n | 'afterLabel'\n | 'belowLabel'\n | 'aboveContent'\n | 'beforeContent'\n | 'afterContent'\n | 'belowContent'\n | 'aboveErrorMessage'\n | 'belowErrorMessage'\n\n/**\n * One item of a content slot: a schema component (strings arrive as `Text`, `Htmlable`\n * values as `Html`) or an action / action group, run as a field action.\n */\nexport type ContentSlotItem =\n { component: SchemaComponent; action?: never } | { action: AnyActionSchema; component?: never }\n\nexport interface ContentSlotSchema {\n items: ContentSlotItem[]\n /** `afterLabel` defaults to `end`, every other slot to `start`. */\n alignment: 'start' | 'end' | 'between'\n}\n\nexport interface ContentSlots {\n slots?: Partial<Record<ContentSlotName, ContentSlotSchema>>\n}\n\n/** Properties every form field carries. */\nexport interface BaseField extends BaseComponent, FieldActions, ContentSlots {\n name: string\n statePath: string\n required?: boolean\n readOnly?: boolean\n autofocus?: boolean\n placeholder?: string\n helperText?: string\n /** HTML: plain strings are escaped by the server, `Htmlable` values are sent as is. */\n hint?: string\n hintIcon?: IconName\n hintColor?: Color\n /** `inlineLabel()`: the label sits beside the control from the `sm` breakpoint up. */\n inlineLabel?: boolean\n live?: LiveConfig\n extraInputAttributes?: Attributes\n /** Attributes for the `data-slot=\"field\"` wrapper, merged with `extraAttributes`. */\n extraFieldWrapperAttributes?: Attributes\n /** `allowHtmlValidationMessages()`: the error message is rendered as HTML. */\n allowHtmlValidationMessages?: boolean\n /**\n * `->translatable()`: the state is a `{ [locale code]: value }` object and the renderer\n * shows one input per language (see `translatableLocaleField()`).\n */\n translatable?: TranslatableSchema\n}\n\n/** A language of a translatable field. */\nexport interface TranslatableLocaleSchema {\n code: string\n /** BCP 47 tag for the `lang` attribute. */\n tag: string\n /** The language's own name. */\n label: string\n direction: 'ltr' | 'rtl'\n /** Must be filled when the field is required. */\n required?: boolean | null\n}\n\nexport interface TranslatableSchema {\n locales: TranslatableLocaleSchema[]\n defaultLocale: string\n}\n\nexport interface Affixes {\n prefix?: string\n suffix?: string\n prefixIcon?: IconName\n suffixIcon?: IconName\n prefixIconColor?: Color\n suffixIconColor?: Color\n}\n\n// ---------------------------------------------------------------- Fields\n\nexport interface TextInputSchema extends BaseField, Affixes {\n type: 'TextInput'\n inputType: 'text' | 'email' | 'password' | 'number' | 'tel' | 'url' | 'search' | (string & {})\n revealable?: boolean\n minLength?: number\n maxLength?: number\n min?: number\n max?: number\n step?: number | string\n mask?: string\n /** `autocomplete(false)` arrives as `off`. */\n autocomplete?: string\n inputMode?: string\n datalist?: string[]\n /** HTML `autocapitalize` hint (`on`, `off`, `none`, `sentences`, `words`, `characters`). */\n autocapitalize?: 'on' | 'off' | 'none' | 'sentences' | 'words' | 'characters' | (string & {})\n /** `copyable()`: a button in the input copies its value. */\n copyable?: boolean\n copyMessage?: string\n /** Milliseconds the copied confirmation stays visible. */\n copyMessageDuration?: number\n}\n\nexport interface TextareaSchema extends BaseField {\n type: 'Textarea'\n rows?: number\n cols?: number\n minLength?: number\n maxLength?: number\n autosize?: boolean\n}\n\nexport interface HiddenSchema extends BaseField {\n type: 'Hidden'\n}\n\n/** `OneTimeCodeInput`: a numeric code with `autocomplete=\"one-time-code\"`. */\nexport interface OneTimeCodeInputSchema extends BaseField {\n type: 'OneTimeCodeInput'\n /** Number of digits. */\n length: number\n /** `submitOnCompletion()`: submit the form once every digit is entered. */\n submitOnCompletion?: boolean\n}\n\nexport interface CheckboxSchema extends BaseField {\n type: 'Checkbox'\n inline: boolean\n}\n\nexport interface ToggleSchema extends BaseField {\n type: 'Toggle'\n inline: boolean\n onIcon?: IconName\n offIcon?: IconName\n onColor?: Color\n offColor?: Color\n}\n\nexport interface SelectSchema extends BaseField, Affixes {\n type: 'Select'\n options: OptionOrGroup[]\n /** Labels for the currently selected values of a searchable select. */\n selectedLabels?: Record<string, string>\n multiple?: boolean\n searchable?: boolean\n native?: boolean\n selectablePlaceholder: boolean\n searchDebounce?: number\n noSearchResultsMessage?: string\n searchPrompt?: string\n loadingMessage?: string\n /** Shown when the select has no options at all. */\n noOptionsMessage?: string\n /** Shown while search results load. */\n searchingMessage?: string\n /** Option labels are HTML (sanitised by the server). */\n allowHtml?: boolean\n /** `false`: long option labels are truncated instead of wrapping. */\n wrapOptionLabels?: false\n maxItems?: number\n minItems?: number\n /** `reorderable()` on a multi-select: chosen chips can be reordered (drag or keyboard). */\n reorderable?: boolean\n}\n\nexport interface CheckboxListSchema extends BaseField {\n type: 'CheckboxList'\n options: OptionOrGroup[]\n searchable?: boolean\n /** `noSearchResultsMessage()`: shown when the search matches no option. */\n noSearchResultsMessage?: string\n /** `searchPrompt()`: placeholder of the search input. */\n searchPrompt?: string\n /** `searchDebounce()`: milliseconds to wait after typing before filtering. */\n searchDebounce?: number\n bulkToggleable?: boolean\n inline?: boolean\n gridColumns?: number\n /** `column` fills the grid column by column; row by row otherwise. */\n gridDirection?: OptionsGridDirection\n /** Option labels are HTML (sanitised by the server). */\n allowHtml?: boolean\n /** Customised bulk toggle links (`selectAllAction()` / `deselectAllAction()`). */\n selectAllAction?: BulkToggleActionSchema\n deselectAllAction?: BulkToggleActionSchema\n}\n\nexport type OptionsGridDirection = 'row' | 'column'\n\nexport interface BulkToggleActionSchema {\n label?: string\n icon?: IconName\n hidden?: boolean\n}\n\nexport interface RadioSchema extends BaseField {\n type: 'Radio'\n options: OptionOrGroup[]\n inline?: boolean\n}\n\nexport interface DatePickerSchema extends BaseField, Affixes {\n type: 'DatePicker' | 'DateTimePicker' | 'TimePicker'\n /** PHP date format of the stored value. */\n format: string\n displayFormat?: string\n hasDate: boolean\n hasTime: boolean\n hasSeconds?: boolean\n minDate?: string\n maxDate?: string\n disabledDates?: string[]\n native: boolean\n timezone: string\n firstDayOfWeek: number\n closeOnDateSelection: boolean\n /** Steps of the time inputs (`hoursStep()`, `minutesStep()`, `secondsStep()`). */\n hoursStep?: number\n minutesStep?: number\n secondsStep?: number\n /** The month the calendar opens on while empty, in the storage format. */\n defaultFocusedDate?: string\n /** `locale()`: BCP 47 tag for this picker's names and display format (the panel's otherwise). */\n locale?: string\n /** `datalist()`: suggested values in the storage format (native pickers only). */\n datalist?: string[]\n}\n\nexport interface MoneyInputSchema extends BaseField, Affixes {\n type: 'MoneyInput'\n /** ISO 4217 code. */\n currency: string\n /** Minor-unit digits of the currency (USD 2, BHD 3, JPY 0). */\n decimals: number\n min?: number\n max?: number\n}\n\nexport interface ColorPickerSchema extends BaseField {\n type: 'ColorPicker'\n format: 'hex' | 'rgb' | 'rgba' | 'hsl'\n}\n\nexport interface TagsInputSchema extends BaseField {\n type: 'TagsInput'\n suggestions?: string[]\n splitKeys: string[]\n color?: Color\n reorderable?: boolean\n tagPrefix?: string\n tagSuffix?: string\n}\n\nexport interface KeyValueSchema extends BaseField {\n type: 'KeyValue'\n keyLabel: string\n valueLabel: string\n keyPlaceholder?: string\n valuePlaceholder?: string\n addActionLabel: string\n addable: boolean\n deletable: boolean\n reorderable: boolean\n editableKeys: boolean\n editableValues: boolean\n /** `addAction()`, `deleteAction()`, `reorderAction()`; null = hidden. */\n itemActions?: Partial<Record<'add' | 'delete' | 'reorder', ItemActionSchema | null>>\n}\n\nexport interface UploadedFile {\n path: string\n name: string\n url?: string\n /** `getOpenableFileUrlUsing()`: where \"open\" links to, when not `url`. */\n openUrl?: string\n /** `getDownloadableFileUrlUsing()`: where \"download\" links to, when not `url`. */\n downloadUrl?: string\n /** `fetchFileInformation()`: the stored file no longer exists on its disk. */\n missing?: boolean\n temporary?: boolean\n size?: number\n}\n\n/** Logical sides of a file upload's controls (`removeUploadedFileButtonPosition()`…). */\nexport interface FileUploadPositions {\n removeButton?: 'start' | 'end'\n progressIndicator?: 'start' | 'end'\n uploadButton?: 'start' | 'center' | 'end'\n}\n\nexport interface FileUploadSchema extends BaseField {\n type: 'FileUpload'\n multiple?: boolean\n image?: boolean\n avatar?: boolean\n acceptedFileTypes?: string[]\n maxSize?: number\n minSize?: number\n /** Encrypted limits sent with each upload so the endpoint applies the field's `maxSize()`. */\n uploadPolicy?: string | null\n maxFiles?: number\n minFiles?: number\n downloadable?: boolean\n openable?: boolean\n previewable: boolean\n reorderable?: boolean\n deletable: boolean\n panelLayout: 'compact' | 'grid' | 'integrated' | 'circle' | (string & {})\n /** `panelAspectRatio()`: aspect ratio of the drop zone, e.g. `'2:1'`. */\n panelAspectRatio?: string\n imagePreviewHeight?: number | string\n /** `maxParallelUploads()`: files of one selection uploading at once (default 1). */\n maxParallelUploads?: number\n /** `appendFiles(false)`: new uploads go before the existing files. */\n appendFiles?: boolean\n /** `mimeTypeMap()`: extension → MIME type, for extensions browsers don't recognise. */\n mimeTypeMap?: Record<string, string>\n positions?: FileUploadPositions\n /** Images are cropped/resized in the browser before upload with these options. */\n imageCropAspectRatio?: string\n imageResizeMode?: 'cover' | 'contain' | 'force' | (string & {})\n imageResizeTargetWidth?: number\n imageResizeTargetHeight?: number\n uploadingMessage?: string\n /** `imageEditor()`: crop / rotate / flip each image before it is uploaded. */\n imageEditor?: FileUploadImageEditorSchema | null\n /** `imageAspectRatio()`: ratios the server accepts (checked on the file's pixels). */\n imageAspectRatio?: string[] | null\n /** `imageDimensions()`: pixel limits the server checks. */\n imageDimensions?: {\n minWidth?: number\n minHeight?: number\n maxWidth?: number\n maxHeight?: number\n } | null\n /** Re-encode JPEGs upright in the browser (sent only when the server can't do it). */\n orientImagesFromExif?: boolean | null\n /** `pasteable()`: accept files pasted while the drop zone has focus. */\n pasteable?: boolean\n files: UploadedFile[]\n}\n\nexport interface FileUploadImageEditorSchema {\n /** `'16:9'`-style ratios; `null` is free cropping. The first one is selected. */\n aspectRatios: Array<string | null>\n /** `circleCropper()`: a round viewport (the output stays square). */\n circle: boolean\n /** `imageEditorMode()` (Cropper.js `viewMode`): `0` lets the crop leave the image. */\n mode?: 0 | 1 | 2 | 3\n /** `imageEditorEmptyFillColor()`: colour of the empty space around the image. */\n emptyFillColor?: string | null\n /** `imageEditorViewportWidth()/Height()`: the crop ratio the editor opens with. */\n viewportWidth?: number | null\n viewportHeight?: number | null\n}\n\n/** A custom block a RichEditor can insert (`RichEditor::blocks()`). */\nexport interface RichEditorCustomBlockSchema {\n id: string\n label: string\n icon?: IconName\n /** The panel group (`customBlocks(['Marketing' => [...]])`). */\n group?: string\n /**\n * The field action (`customBlock:{id}`) that inserts the block: with a modal when the\n * block has a configuration form. It returns `{ id, config, preview }`.\n */\n action: ActionSchema\n}\n\n/** A mention trigger (`RichEditor::mentions()`). */\nexport interface RichEditorMentionSchema {\n /** The character that starts a mention, e.g. `@` or `#`. */\n trigger: string\n /** Static items; omitted when the server searches them (`getSearchResultsUsing`). */\n items?: Array<{ id: string; label: string }>\n /** Search on the server through the options endpoint as the user types. */\n searchable?: boolean\n searchDebounce?: number\n}\n\n/** A merge tag (`RichEditor::mergeTags()`), stored as `{{ id }}`. */\nexport interface RichEditorMergeTagSchema {\n id: string\n label: string\n}\n\n/** A toolbar dropdown (`ToolbarButtonGroup::make()`), referenced as `group:{n}` in a toolbar. */\nexport interface RichEditorToolbarGroupSchema {\n label: string\n /** Fixed trigger icon; without one the trigger shows the active (or first) button's icon. */\n icon?: IconName\n buttons: string[]\n /** `textualButtons()`: list the buttons with their labels. */\n textual?: boolean\n}\n\n/** A toolbar button from a rich content plugin (`RichEditorTool`). */\nexport interface RichEditorToolSchema {\n name: string\n label: string\n icon?: IconName\n /** Tiptap chain commands run on click: `[name, ...args]` each. */\n commands?: Array<[string, ...unknown[]]>\n /**\n * The plugin's editor action (opened with `editorSelection` and `attributes` arguments).\n * It may return `{ editorCommands, editorSelection }` (`RichEditor::runCommands()`).\n */\n action?: ActionSchema\n /** Pressed while this mark or node (with these attributes) is active. */\n active?: { name: string; attributes?: Record<string, unknown> }\n}\n\nexport interface RichEditorSchema extends BaseField {\n type: 'RichEditor' | 'MarkdownEditor'\n /** Button names, `'|'` separators and `group:{n}` dropdowns (see `toolbarButtonGroups`). */\n toolbarButtons: string[]\n toolbarButtonGroups?: Record<string, RichEditorToolbarGroupSchema> | null\n /**\n * `floatingToolbars()`: buttons shown next to the selection, keyed by node name\n * (`paragraph`, `heading`, `table`, `image`, …).\n */\n floatingToolbars?: Record<string, string[]> | null\n stickyToolbar?: boolean | null\n stickyPanels?: boolean | null\n /** CSS length; null measures the panel's sticky topbar. */\n stickyOffset?: string | null\n /** `resizableImages()`: drag handles; the width is stored on the image. */\n resizableImages?: boolean | null\n minimalCustomBlockControls?: boolean | null\n customBlocksGrid?: boolean | null\n searchableCustomBlocks?: boolean | null\n /** The panel open on load (`activePanel()`). */\n activePanel?: 'customBlocks' | 'mergeTags' | null\n /** Plugin toolbar buttons, usable by name in the toolbars. */\n editorTools?: RichEditorToolSchema[] | null\n /** Registry keys of plugin Tiptap extensions (`createAlfakit({ richEditorExtensions })`). */\n extensions?: string[] | null\n fileAttachments: {\n disk: string\n directory: string | null\n /** MIME types an inserted image may have; the server checks them on save. */\n acceptedFileTypes?: string[]\n /** Kilobytes. */\n maxSize?: number\n /** Encrypted limits sent with each upload (size and types of attachments). */\n uploadPolicy?: string | null\n }\n /** The `textColor` button's palette (`textColors()`); only sent with that button. */\n textColors?: Array<{ value: string; label: string }> | null\n /** `customTextColors()`: also offer a free colour picker. */\n customTextColors?: boolean | null\n minHeight?: number\n maxHeight?: number\n /**\n * `linkProtocols()`: URL schemes links may use (relative links always can); null keeps\n * the defaults. The server drops other links when the content is saved.\n */\n linkProtocols?: string[] | null\n /**\n * MarkdownEditor: the Markdown state rendered as HTML, which is what the editor loads.\n * A translatable editor gets one document per language code (see\n * `translatableLocaleField()`, which picks the current one).\n */\n html?: string | Record<string, string | null> | null\n /** RichEditor: the state is a Tiptap JSON document instead of HTML. */\n json?: boolean\n customBlocks?: RichEditorCustomBlockSchema[]\n mentions?: RichEditorMentionSchema[]\n mergeTags?: RichEditorMergeTagSchema[]\n}\n\n/** A column of a Repeater or RepeatableEntry shown as a table (`->table([...])`). */\nexport interface TableColumnSchema {\n label: string\n /** The item component the column shows: a field's relative state path or an entry's name. */\n name?: string\n hiddenLabel?: boolean\n required?: boolean\n /** CSS width, e.g. `200px` or `30%`. */\n width?: string\n alignment?: 'start' | 'center' | 'end'\n wrapHeader?: boolean\n}\n\n/** Built-in actions of a Repeater, Builder or KeyValue (`deleteAction(fn ($a) => …)`). */\nexport type ItemActionName =\n | 'add'\n | 'delete'\n | 'clone'\n | 'reorder'\n | 'moveUp'\n | 'moveDown'\n | 'collapse'\n | 'expand'\n | 'collapseAll'\n | 'expandAll'\n\n/**\n * A built-in item action. Without `server` the renderer applies it in the browser; with\n * it (customised with a modal, handler or hooks) it runs through the field action\n * endpoint with `arguments.item` (`items` for reorder, `block` for a Builder's add).\n */\nexport interface ItemActionSchema extends ActionSchema {\n server?: boolean\n}\n\n/** Customised built-in actions by name; null = hidden. Absent names use the renderer's default. */\nexport type ItemActionsSchema = Partial<Record<ItemActionName, ItemActionSchema | null>>\n\n/** Item action props shared by Repeater and Builder. */\nexport interface ItemActionsProps {\n /** Field-level built-in actions (item actions evaluated without an item). */\n itemActions?: ItemActionsSchema\n /** `reorderableWithButtons(false)`: no move up / down buttons. */\n reorderableWithButtons?: boolean\n /** `reorderableWithDragAndDrop(false)`: no drag handle. */\n reorderableWithDragAndDrop?: boolean\n addActionAlignment?: Alignment\n itemNumbers?: boolean\n}\n\n/** Per-item action props: customised built-ins for this item, `extraItemActions()`. */\nexport interface ItemActionsItemProps {\n itemActions?: ItemActionsSchema\n actions?: ActionSchema[]\n}\n\nexport interface RepeaterItemSchema extends ItemActionsItemProps {\n key: string\n label?: string | null\n schema: SchemaComponent[]\n}\n\nexport interface RepeaterSchema extends BaseField, ItemActionsProps {\n type: 'Repeater'\n items: RepeaterItemSchema[]\n /** Blank item schema; `__INDEX__` placeholders must be replaced with the new index. */\n template: SchemaComponent[]\n templateState: Record<string, unknown>\n simple?: boolean\n minItems?: number\n maxItems?: number\n addable: boolean\n deletable: boolean\n reorderable: boolean\n cloneable?: boolean\n collapsible?: boolean\n collapsed?: boolean\n addActionLabel: string\n grid?: Breakpoints\n /** Render items as table rows: one column per item field, in schema order. */\n table?: TableColumnSchema[]\n /** `compact()`: a table layout with tighter cells. */\n compact?: boolean\n /** Render only the visible items above a threshold (`virtualize()`, on by default). */\n virtualize?: VirtualizeSchema\n}\n\nexport type FieldSchema =\n | TextInputSchema\n | TextareaSchema\n | HiddenSchema\n | OneTimeCodeInputSchema\n | CheckboxSchema\n | ToggleSchema\n | SelectSchema\n | CheckboxListSchema\n | RadioSchema\n | DatePickerSchema\n | MoneyInputSchema\n | ColorPickerSchema\n | TagsInputSchema\n | KeyValueSchema\n | FileUploadSchema\n | RichEditorSchema\n | RepeaterSchema\n | BuilderSchema\n | ToggleButtonsSchema\n | SliderSchema\n | CodeEditorSchema\n | ModalTableSelectSchema\n | IconPickerSchema\n | FileManagerPickerSchema\n\nexport const FIELD_TYPES = [\n 'TextInput',\n 'Textarea',\n 'Hidden',\n 'OneTimeCodeInput',\n 'Checkbox',\n 'Toggle',\n 'Select',\n 'CheckboxList',\n 'Radio',\n 'DatePicker',\n 'DateTimePicker',\n 'MoneyInput',\n 'TimePicker',\n 'ColorPicker',\n 'TagsInput',\n 'KeyValue',\n 'FileUpload',\n 'RichEditor',\n 'MarkdownEditor',\n 'Repeater',\n 'Builder',\n 'ToggleButtons',\n 'Slider',\n 'CodeEditor',\n 'ModalTableSelect',\n 'IconPicker',\n // alfasix/alfakit-file-manager\n 'FileManagerPicker',\n] as const\n\nexport function isField(component: SchemaComponent): component is FieldSchema {\n return (\n 'statePath' in component &&\n typeof (component as BaseField).statePath === 'string' &&\n (FIELD_TYPES as readonly string[]).includes(component.type)\n )\n}\n\n// ---------------------------------------------------------------- Layout\n\nexport interface GridSchema extends BaseComponent {\n type: 'Grid'\n}\n\nexport interface GroupSchema extends BaseComponent {\n type: 'Group'\n}\n\n/**\n * Fields fused into one control (shared border, no gaps). Child labels become\n * screen-reader text and their errors are listed below the group.\n */\nexport interface FusedGroupSchema extends BaseComponent {\n type: 'FusedGroup'\n}\n\nexport interface SectionSchema extends BaseComponent {\n type: 'Section'\n heading?: string\n /** The heading's level (`2` = `h2`): `rootHeadingLevel()` plus the nesting depth. */\n headingLevel?: number\n description?: string\n icon?: IconName\n collapsible?: boolean\n collapsed?: boolean\n /** `persistCollapsed()`: the local storage key the collapsed state is kept under. */\n persistCollapsed?: string\n compact?: boolean\n aside?: boolean\n secondary?: boolean\n headerActions?: AnyActionSchema[]\n /** `afterHeader()`: actions and components at the end of the header. */\n afterHeader?: ContentSlotItem[]\n footerActions?: AnyActionSchema[]\n /** `footerActionsAlignment()`: alignment of `footerActions` (default `start`). */\n footerActionsAlignment?: Alignment\n /** `footer()`: actions and components in the footer, after `footerActions`. */\n footer?: ContentSlotItem[]\n}\n\nexport interface FieldsetSchema extends BaseComponent {\n type: 'Fieldset'\n /** `contained(false)`: no border or padding around the fields. */\n contained?: false\n}\n\nexport interface TabSchema extends BaseComponent {\n type: 'Tab'\n /**\n * The tab's readable value in the query string when its tabs `persistTabInQueryString()`:\n * its `id()`, explicit `key()` or label slug (`?tab=billing-address`).\n */\n queryValue?: string\n icon?: IconName\n iconPosition?: IconPosition\n badge?: string | number\n badgeColor?: Color\n /** `Tab::badgeTooltip()`: shown on hover (title) of the badge. */\n badgeTooltip?: string\n /** `deferBadge()`: the badge is loaded from `schemaDeferred` after the page renders. */\n badgeDeferred?: boolean\n}\n\n/** What `schemaDeferred` returns for a `Tab::deferBadge()` tab. */\nexport interface DeferredBadgeSchema {\n badge?: string | number | null\n badgeColor?: Color | null\n badgeTooltip?: string | null\n}\n\nexport interface TabsSchema extends BaseComponent {\n type: 'Tabs'\n schema: TabSchema[]\n activeTab: number\n contained?: boolean\n vertical?: boolean\n queryStringKey?: string\n /** `scrollable(false)`: the tab list wraps instead of scrolling sideways. */\n scrollable?: false\n /** `persistTab()`: where the active tab is remembered in the browser. */\n persistTab?: { key: string; storage: 'local' | 'session' }\n}\n\nexport interface StepSchema extends BaseComponent {\n type: 'Step'\n description?: string\n icon?: IconName\n /** Icon once the step is completed (falls back to the wizard's, then a check mark). */\n completedIcon?: IconName\n}\n\nexport interface WizardSchema extends BaseComponent {\n type: 'Wizard'\n schema: StepSchema[]\n startStep: number\n skippable?: boolean\n submitActionLabel?: string\n /** `submitAction(Action)`: rendered on the last step, runs through the action endpoint. */\n submitAction?: ActionSchema\n /** `submitAction(Htmlable)`: markup rendered on the last step. */\n submitActionHtml?: string\n nextActionLabel: string\n previousActionLabel: string\n /**\n * `nextAction(fn)` / `previousAction(fn)`: the button's appearance; `false` hides it.\n * Absent when not customised (the default buttons render).\n */\n nextAction?: ActionSchema | false\n previousAction?: ActionSchema | false\n completedIcon?: IconName\n /** Query-string key the current step is kept under (`true` from older servers = `step`). */\n persistStepInQueryString?: string | boolean\n /**\n * `goToStep()`: the server asked the wizard to show the step with this key. `id` is new\n * on every response, so the same step can be requested again.\n */\n goToStep?: { step: string; id: string }\n}\n\nexport interface PlaceholderSchema extends BaseComponent {\n type: 'Placeholder'\n content?: string\n helperText?: string\n}\n\nexport interface HtmlSchema extends BaseComponent {\n type: 'Html'\n content: string\n}\n\nexport interface TextSchema extends BaseComponent {\n type: 'Text'\n content: string\n color?: Color\n icon?: IconName\n size?: string\n weight?: string\n badge?: boolean\n /** `sans`, `serif` or `mono`. */\n fontFamily?: string\n tooltip?: string\n /** `copyable()`: a button copies `content` to the clipboard. */\n copyable?: boolean\n copyMessage?: string\n /** Milliseconds the copy confirmation shows. */\n copyMessageDuration?: number\n}\n\n/** A custom frontend component registered in the renderer. */\nexport interface ViewSchema extends BaseComponent {\n type: 'View'\n component: string\n props?: Record<string, unknown>\n}\n\n/** Children side by side, stacked below the `from` breakpoint. */\nexport interface FlexSchema extends BaseComponent {\n type: 'Flex'\n from: 'default' | 'sm' | 'md' | 'lg' | 'xl' | '2xl'\n verticalAlignment?: 'start' | 'center' | 'end'\n /** `alignment()`: horizontal alignment of the children (`justify` spreads them like `between`). */\n alignment?: Alignment\n}\n\n/** A highlighted message box. `description` is HTML (plain strings escaped by the server). */\nexport interface CalloutSchema extends BaseComponent {\n type: 'Callout'\n heading?: string\n description?: string\n icon?: IconName\n /** `iconSize()`: `sm`, `md` or `lg` (default). */\n iconSize?: Size\n color?: Color\n /**\n * `status()` / `danger()`…: kept after `color(null)` so the icon keeps its status colour\n * and danger/warning callouts keep `role=\"alert\"`.\n */\n status?: Color\n /** `iconColor()`: overrides the icon's colour. */\n iconColor?: Color\n actions?: AnyActionSchema[]\n /** `footerActionsAlignment()`: alignment of `actions` (default `start`). */\n footerActionsAlignment?: Alignment\n /** `controls()` and `controlActions()`: shown in the top end corner. */\n controls?: ContentSlotItem[]\n /** `footer()`: actions and components under the description. */\n footer?: ContentSlotItem[]\n}\n\n/**\n * A row of action buttons placed freely in a form or infolist. The actions run in the\n * component's field context (`field:{schema}::{key}`), like a field's suffix actions.\n */\nexport interface ActionsComponentSchema extends BaseComponent {\n type: 'Actions'\n actions: AnyActionSchema[]\n alignment?: Alignment\n verticalAlignment?: 'start' | 'center' | 'end'\n fullWidth?: boolean\n}\n\n/** Placeholder for missing content. `description` is HTML (escaped by the server). */\nexport interface EmptyStateComponentSchema extends BaseComponent {\n type: 'EmptyState'\n heading?: string\n description?: string\n icon?: IconName\n color?: Color\n contained: boolean\n actions?: AnyActionSchema[]\n /** `footer()`: actions and components under the description (after `actions`). */\n footer?: ContentSlotItem[]\n}\n\nexport interface IconSchema extends BaseComponent {\n type: 'Icon'\n icon: IconName\n color?: Color\n size?: Size | string\n tooltip?: string\n}\n\nexport interface ImageSchema extends BaseComponent {\n type: 'Image'\n url: string\n alt: string\n /** CSS lengths. */\n imageWidth?: string\n imageHeight?: string\n alignment?: Alignment\n circular?: boolean\n tooltip?: string\n}\n\n/** A bulleted list; every child component is one item. */\nexport interface UnorderedListSchema extends BaseComponent {\n type: 'UnorderedList'\n size?: Size | string\n}\n\nexport type LayoutSchema =\n | FlexSchema\n | CalloutSchema\n | ActionsComponentSchema\n | EmptyStateComponentSchema\n | IconSchema\n | ImageSchema\n | UnorderedListSchema\n | GridSchema\n | GroupSchema\n | FusedGroupSchema\n | SectionSchema\n | FieldsetSchema\n | TabsSchema\n | TabSchema\n | WizardSchema\n | StepSchema\n | PlaceholderSchema\n | HtmlSchema\n | TextSchema\n | ViewSchema\n\n// ---------------------------------------------------------------- Infolist entries\n\nexport interface BaseEntry extends BaseComponent, FieldActions, ContentSlots {\n name: string\n state?: unknown\n url?: string\n openUrlInNewTab?: boolean\n tooltip?: string\n helperText?: string\n /** HTML: plain strings are escaped by the server, `Htmlable` values are sent as is. */\n hint?: string\n hintIcon?: IconName\n hintColor?: Color\n placeholder?: string\n /** `inlineLabel()`: the label sits beside the value from the `sm` breakpoint up. */\n inlineLabel?: boolean\n /**\n * Attributes for the `data-slot=\"entry\"` wrapper. `extraAttributes` go on the value\n * (`data-slot=\"entry-value\"`).\n */\n extraEntryWrapperAttributes?: Attributes\n /** `alignment()`: horizontal alignment of the value. */\n alignment?: Alignment\n}\n\nexport interface TextStyleProps {\n size?: string\n weight?: string\n fontFamily?: string\n lineClamp?: number\n badge?: boolean\n copyable?: boolean\n copyMessage?: string\n /** Milliseconds the copy confirmation shows (`copyMessageDuration()`, default 1500). */\n copyMessageDuration?: number\n wrap?: boolean\n}\n\nexport interface FormattedStateProps {\n html?: boolean\n listWithLineBreaks?: boolean\n bulleted?: boolean\n placeholder?: string\n boolean?: boolean\n /**\n * `limitList()` + `expandableLimitedList()`: every item is sent; the first `listLimit`\n * show with a \"+N more\" toggle for the rest.\n */\n expandableLimitedList?: boolean\n listLimit?: number\n}\n\n/** `ring()` / `overlap()` / `extraImgAttributes()` of image columns and entries. */\nexport interface ImageStackProps {\n /** Ring width in pixels around stacked images (0–8, default 2). */\n ring?: number\n /** Overlap of stacked images in quarter rems (0–8, default 2). */\n overlap?: number\n}\n\nexport interface TextEntrySchema extends BaseEntry, TextStyleProps, FormattedStateProps {\n type: 'TextEntry'\n state?: string | number | boolean | Array<string | number> | null\n color?: Color\n icon?: IconName\n iconPosition?: IconPosition\n iconColor?: Color\n /** Per-item colours of a list state (enums whose items differ), aligned with the items. */\n itemColors?: Array<Color | null>\n /** Per-item icons of a list state, aligned with the items. */\n itemIcons?: Array<IconName | null>\n /** Per-item links of a relationship list (`tags.name` with a `url()` closure). */\n itemUrls?: Array<string | null>\n prose?: boolean\n}\n\nexport interface IconEntrySchema extends BaseEntry {\n type: 'IconEntry'\n icon?: IconName\n color?: Color\n size?: Size | string\n}\n\nexport interface ImageEntrySchema extends BaseEntry, ImageStackProps {\n type: 'ImageEntry'\n /** HTML attributes for every `<img>` (`extraImgAttributes()`). */\n extraImgAttributes?: Attributes\n state?: string[]\n circular?: boolean\n square?: boolean\n size?: number | string\n height?: number | string\n width?: number | string\n stacked?: boolean\n limit?: number\n /** `limitedRemainingText(false)` hides the \"+N\" of images past `limit` (shown by default). */\n limitedRemainingText?: boolean\n /** Text size of the \"+N\" (`limitedRemainingText(size:)`). */\n limitedRemainingTextSize?: 'xs' | 'sm' | 'md' | 'lg'\n /** Alternative text shared by every image. */\n alt?: string\n /** Alternative text per image, aligned with `state`, when a closure gives different texts. */\n alts?: Array<string | null>\n}\n\n/** Highlighted read-only code. Array state arrives as pretty-printed JSON. */\nexport interface CodeEntrySchema extends BaseEntry {\n type: 'CodeEntry'\n state?: string | null\n /** Highlighting grammar (`json`, `php`, `js`…); unknown grammars render as plain code. */\n grammar?: string\n /** Theme names exposed to CSS as `data-light-theme` / `data-dark-theme`. */\n lightTheme?: string\n darkTheme?: string\n copyable?: boolean\n copyMessage?: string\n /** Milliseconds the copy confirmation shows. */\n copyMessageDuration?: number\n}\n\nexport interface ColorEntrySchema extends BaseEntry, TextStyleProps {\n type: 'ColorEntry'\n state?: string | string[] | null\n}\n\nexport interface KeyValueEntrySchema extends BaseEntry {\n type: 'KeyValueEntry'\n state?: Record<string, unknown>\n keyLabel: string\n valueLabel: string\n}\n\nexport interface RepeatableEntrySchema extends BaseEntry {\n type: 'RepeatableEntry'\n items: SchemaComponent[][]\n contained: boolean\n grid?: Breakpoints\n /** Render items as table rows: one column per item entry, in schema order. */\n table?: TableColumnSchema[]\n}\n\n/** An entry rendered by an application component registered under `component`. */\nexport interface ViewEntrySchema extends BaseEntry {\n type: 'ViewEntry'\n component?: string\n props?: Record<string, unknown>\n}\n\nexport type EntrySchema =\n | ViewEntrySchema\n | TextEntrySchema\n | IconEntrySchema\n | ImageEntrySchema\n | CodeEntrySchema\n | ColorEntrySchema\n | KeyValueEntrySchema\n | RepeatableEntrySchema\n\nexport type SchemaComponent =\n FieldSchema | LayoutSchema | EntrySchema | (BaseComponent & { type: string })\n\nexport type { Alignment }\n"],"mappings":";AAwqBA,MAAa,cAAc;CACzB;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CAEA;AACF;AAEA,SAAgB,QAAQ,WAAsD;CAC5E,OACE,eAAe,aACf,OAAQ,UAAwB,cAAc,YAC7C,YAAkC,SAAS,UAAU,IAAI;AAE9D"}
@@ -99,6 +99,8 @@ export interface StarterKitWidgetsSchema {
99
99
  current?: TenantSchema | null;
100
100
  tenants: TenantSchema[];
101
101
  registrationUrl?: string;
102
+ /** The registration page's own label (`RegisterTenant::getLabel()`). */
103
+ registrationLabel?: string;
102
104
  searchable?: true;
103
105
  };
104
106
  }
@@ -396,6 +398,10 @@ export interface PanelSchema {
396
398
  tenants: TenantSchema[];
397
399
  registrationUrl?: string;
398
400
  profileUrl?: string;
401
+ /** The registration page's own label (`RegisterTenant::getLabel()`); else "New". */
402
+ registrationLabel?: string;
403
+ /** The profile page's own label (`EditTenantProfile::getLabel()`); else "Settings". */
404
+ profileLabel?: string;
399
405
  /** The customised `register` entry of `tenantMenuItems()`. */
400
406
  registration?: MenuItemSchema;
401
407
  /** The customised `profile` entry of `tenantMenuItems()`. */
@@ -1 +1 @@
1
- {"version":3,"file":"panel.d.ts","names":[],"sources":["../../src/schema/panel.ts"],"mappings":";;;;;;;;;;;;;;iBAciB;;EAEf;;EAEA;EACA,OAAO;;;;;EAKP,aAAa;EACb;EACA;EACA;EACA;EACA,aAAa;EACb;;EAEA;;EAEA;;EAEA,kBAAkB;EAClB,WAAW;;iBAGI;EACf;EACA,OAAO;EACP;EACA;EACA,OAAO;;EAEP,yBAAyB;;EAEzB,wBAAwB;;;iBAIT;EACf;EACA,aAAa;EACb;;;;;;iBAOe;;EAEf;;EAEA,SAAS,eAAe;;;iBAIT;;EAEf;;EAEA;EACA;;EAEA,QAAQ;;EAER,UAAU;;;;;;;iBAQK;;EAEf;;EAEA;IAAW;IAAuB;;;EAElC;IAAkB;IAAe;;;EAEjC;IACE,UAAU;IACV,SAAS;IACT;IACA;;;;iBAKa;EACf;EACA,QAAQ;;;;;;;iBAQO;EACf;EACA,OAAO;EACP;EACA;EACA,QAAQ;EACR;EACA,SAAS;;EAET;;;qBAIW;qBACA;iBAEI;EACf,IAAI;EACJ;EACA;EACA;;iBAGe;EACf,IAAI;;EAEJ;;EAEA;EACA;EACA;;EAEA;;;iBAIe;EACf;;EAEA;EACA;EACA;EACA;EACA;;EAEA;;EAEA;;EAEA;;EAEA;;EAEA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EAKhB,WAAW;;EAEX,gBAAgB;;EAEhB,iBAAiB;;EAEjB,oBAAoB;;EAEpB,MAAM;EACN,cAAc;EACd;EACA,cAAc;;iBAGC;EACf;EACA;;YAGU,eACR,YACA,gBACA,cACA,aACA,wBACA,eACA;EACE;EAAc;GAAc;;YAEtB;;iBAGK;EACf;EACA,QAAQ;EACR;EACA;EACA;EACA,cAAc;EACd,kBAAkB;;EAElB;IAAe;IAAiB;;;EAEhC,gBAAgB;EAChB,gBAAgB;;EAEhB;;EAEA,sBAAsB;EACtB,SAAS;;EAET;EACA,SAAS;EACT;IAAS;IAAmB,OAAO;;;;;;EAKnC,gBAAgB;;;;;;EAMhB,qBAAqB;;EAErB,WAAW;;EAEX,YAAY;;;iBAIG;EACf,QAAQ;;EAER;EACA,SAAS;EACT,YAAY;;;;;;YAOF,mBAAmB,eAAe,eAAe,eAAe;;iBAG3D;EACf,SAAS;EACT,OAAO;;EAEP,cAAc;;;;;EAKd,cAAc;;EAEd,mBAAmB;;;;;EAKnB,0BAA0B,eAAe;EACzC;;EAEA;;;;;EAKA,oBAAoB;;;;;;EAMpB,eAAe;;;;;EAKf,kBAAkB;EAClB;IACE,uBAAuB;IACvB;MACE;MACA;MACA;MACA;;KAED;;EAEH,SAAS;GACR"}
1
+ {"version":3,"file":"panel.d.ts","names":[],"sources":["../../src/schema/panel.ts"],"mappings":";;;;;;;;;;;;;;iBAciB;;EAEf;;EAEA;EACA,OAAO;;;;;EAKP,aAAa;EACb;EACA;EACA;EACA;EACA,aAAa;EACb;;EAEA;;EAEA;;EAEA,kBAAkB;EAClB,WAAW;;iBAGI;EACf;EACA,OAAO;EACP;EACA;EACA,OAAO;;EAEP,yBAAyB;;EAEzB,wBAAwB;;;iBAIT;EACf;EACA,aAAa;EACb;;;;;;iBAOe;;EAEf;;EAEA,SAAS,eAAe;;;iBAIT;;EAEf;;EAEA;EACA;;EAEA,QAAQ;;EAER,UAAU;;;;;;;iBAQK;;EAEf;;EAEA;IAAW;IAAu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kB;;;;;;EAMlB;EACA,OAAO;EACP;IACE,OAAO;IACP;IACA;;IAEA,UAAU;;IAEV,SAAS;;;;;IAKT;;EAEF;IACE,UAAU;IACV,SAAS;IACT;IACA;;IAEA;;IAEA;;IAEA,eAAe;;IAEf,UAAU;IACV,OAAO;;IAEP;;IAEA;;EAEF;IACE;IACA;;;;;IAKA;;EAEF;IACE;IACA;;IAEA;;IAEA;;IAEA;;;;;IAKA;;EAEF,WAAW,QAAQ;IAAoB;;;EAEvC;EACA;IAAQ;IAAgB;IAAmB;;EAC3C;;EAEA,gBAAgB;;;;;EAKhB,WAAW;;EAEX,gBAAgB;;EAEhB,iBAAiB;;EAEjB,oBAAoB;;EAEpB,MAAM;EACN,cAAc;EACd;EACA,cAAc;;iBAGC;EACf;EACA;;YAGU,eACR,YACA,gBACA,cACA,aACA,wBACA,eACA;EACE;EAAc;GAAc;;YAEtB;;iBAGK;EACf;EACA,QAAQ;EACR;EACA;EACA;EACA,cAAc;EACd,kBAAkB;;EAElB;IAAe;IAAiB;;;EAEhC,gBAAgB;EAChB,gBAAgB;;EAEhB;;EAEA,sBAAsB;EACtB,SAAS;;EAET;EACA,SAAS;EACT;IAAS;IAAmB,OAAO;;;;;;EAKnC,gBAAgB;;;;;;EAMhB,qBAAqB;;EAErB,WAAW;;EAEX,YAAY;;;iBAIG;EACf,QAAQ;;EAER;EACA,SAAS;EACT,YAAY;;;;;;YAOF,mBAAmB,eAAe,eAAe,eAAe;;iBAG3D;EACf,SAAS;EACT,OAAO;;EAEP,cAAc;;;;;EAKd,cAAc;;EAEd,mBAAmB;;;;;EAKnB,0BAA0B,eAAe;EACzC;;EAEA;;;;;EAKA,oBAAoB;;;;;;EAMpB,eAAe;;;;;EAKf,kBAAkB;EAClB;IACE,uBAAuB;IACvB;MACE;MACA;MACA;MACA;;KAED;;EAEH,SAAS;GACR"}
@@ -1 +1 @@
1
- {"version":3,"file":"panel.js","names":[],"sources":["../../src/schema/panel.ts"],"sourcesContent":["import type { ActionSchema, AnyActionSchema } from './actions'\nimport type { CommandPaletteSchema, KeyboardShortcutsSchema } from './command-palette'\nimport type { Color, IconName, RecordKey, Width } from './common'\nimport type { SchemaComponent } from './components'\nimport type { DebugSchema } from './debug'\nimport type { DevToolsSchema } from './dev-tools'\nimport type { FormBlock, InfolistBlock, LinksBlock, SchemaBlock } from './form'\nimport type { NotificationSchema } from './notifications'\nimport type { PwaSchema } from './pwa'\nimport type { ConflictsSchema, PresenceSchema, RealtimeSchema } from './realtime'\nimport type { DeferredTabBadges } from './resources'\nimport type { RelationManagerSchema, RelationManagersBlock, TableBlock } from './table'\nimport type { WidgetSchema, WidgetsBlock } from './widgets'\n\nexport interface NavigationItemSchema {\n /** Text, or sanitised HTML when `labelHtml` is true (an `Htmlable` label). */\n label: string\n /** `label` is sanitised HTML: render it as markup (use `htmlLabelToText()` for text). */\n labelHtml?: boolean\n icon?: IconName\n /**\n * Split navigation (`alfakit.navigation` is an Inertia once prop): the icon of the item\n * while active, swapped in by `resolvePanelNavigation()`.\n */\n activeIcon?: IconName\n url?: string\n openInNewTab?: boolean\n active?: boolean\n badge?: string | number\n badgeColor?: Color\n badgeTooltip?: string\n /** `Panel::deferNavigationBadges()`: the item has a badge that loads after the page. */\n deferredBadge?: boolean\n /** Set by `resolvePanelNavigation()` while a deferred badge is loading (show a placeholder). */\n badgePending?: boolean\n /** `NavigationItem::extraAttributes()`: HTML attributes for the item's link (`class` merges). */\n extraAttributes?: Record<string, string | number | boolean | null>\n children?: NavigationItemSchema[]\n}\n\nexport interface NavigationGroupSchema {\n label?: string | null\n icon?: IconName\n collapsible: boolean\n collapsed?: boolean\n items: NavigationItemSchema[]\n /** `NavigationGroup::extraSidebarAttributes()`: HTML attributes for the group in the sidebar. */\n extraSidebarAttributes?: Record<string, string | number | boolean | null>\n /** `NavigationGroup::extraTopbarAttributes()`: HTML attributes for the group in the top navigation. */\n extraTopbarAttributes?: Record<string, string | number | boolean | null>\n}\n\n/** A navigation item's badge, from `navigationState` or the deferred `alfakitNavigationBadges` prop. */\nexport interface NavigationBadgeSchema {\n badge: string | number\n badgeColor?: Color\n badgeTooltip?: string\n}\n\n/**\n * The per-request part of the panel navigation, whose structure (`navigation`) is an\n * Inertia once prop. Items are addressed by position: `group.item[.child…]` (`0.2.1`).\n */\nexport interface NavigationStateSchema {\n /** The active items (an active child's ancestors included). */\n active?: string[]\n /** Badges, unless `Panel::deferNavigationBadges()` defers them. */\n badges?: Record<string, NavigationBadgeSchema>\n}\n\n/** One `starterKit()` panel's navigation, as shared with the host application's pages. */\nexport interface StarterKitNavigationSchema {\n /** The panel id. */\n id: string\n /** The panel's home URL. */\n url: string\n brandName: string\n /** Empty for tenancy panels outside a tenant (their items link to tenant routes). */\n groups: NavigationGroupSchema[]\n /** What the drop-in header components render before they load. */\n widgets?: StarterKitWidgetsSchema\n}\n\n/**\n * The `widgets` of a `starterKit()` panel's shared navigation: what `<AlfakitSearch />`,\n * `<AlfakitNotifications />` and `<AlfakitTenantSwitcher />` show on any host page before\n * their code and the panel data (`endpoint`) have loaded.\n */\nexport interface StarterKitWidgetsSchema {\n /** GET: the panel data the components render with (the `alfakit` prop of the panel's pages). */\n endpoint: string\n /** Global search or the command palette (tenancy panels: only inside a tenant). */\n search?: { keyBindings: string[]; placeholder: string }\n /** `databaseNotifications()`: the bell's label and the user's unread count. */\n notifications?: { label: string; unreadCount: number }\n /** Tenancy panels: the user's tenants; `current` is null on the host's own pages. */\n tenancy?: {\n current?: TenantSchema | null\n tenants: TenantSchema[]\n registrationUrl?: string\n searchable?: true\n }\n}\n\n/** A page's secondary navigation: cluster pages or a record's pages. */\nexport interface SubNavigationSchema {\n position: 'start' | 'end' | 'top'\n groups: NavigationGroupSchema[]\n}\n\n/**\n * An entry of the user or tenant menu: a link (`url`, `method: 'post'` for POST links) or\n * an `Action` with server logic or a modal (`action`), run through the action endpoint\n * with the component `userMenu` / `tenantMenu` and the page's token.\n */\nexport interface MenuItemSchema {\n label?: string\n icon?: IconName\n url?: string\n openInNewTab?: boolean\n color?: Color\n method?: 'post'\n action?: ActionSchema\n /** Group index (nested arrays in `userMenuItems()`); a separator divides groups. */\n group?: number\n}\n\n/** Action endpoint components of the menus (`Panel::USER_MENU_COMPONENT`, …). */\nexport const USER_MENU_COMPONENT = 'userMenu'\nexport const TENANT_MENU_COMPONENT = 'tenantMenu'\n\nexport interface PanelUserSchema {\n id: RecordKey\n name: string\n email?: string | null\n avatar?: string | null\n}\n\nexport interface TenantSchema {\n id: RecordKey\n /** Text, or sanitised HTML when `nameHtml` is true (an `Htmlable` `getAlfakitName()`). */\n name: string\n /** `name` is sanitised HTML: render it as markup (use `htmlLabelToText()` for text). */\n nameHtml?: boolean\n avatar?: string | null\n url: string\n /** `HasCurrentTenantLabel`: a caption shown with the current tenant (\"Active team\"). */\n label?: string | null\n}\n\n/** The panel's design, see `Panel::theme()`. */\nexport interface PanelThemeSchema {\n name: string\n /** Value of `data-alfakit-theme`, base theme first: `\"alfakit acme\"`. */\n attribute: string\n sidebar: 'inset' | 'floating' | 'flush'\n density: 'comfortable' | 'compact'\n radius?: string | null\n font?: string | null\n /** CSS value for `--alfakit-font`. */\n fontCss?: string | null\n /** CSS value for `--alfakit-heading-font`. */\n headingFontCss?: string | null\n /** Stylesheet that loads the font, if any. */\n fontUrl?: string | null\n /** Every font stylesheet to load (body and heading fonts). */\n fontUrls?: string[]\n /** Structure and component styles; mirrored as `data-*` attributes on `<html>`. */\n design: PanelDesignSchema\n /**\n * Icon aliases replaced with `Icons::register()` (`alfakit::panels.sidebar.collapse-button`\n * → a Lucide name, image URL or sanitised SVG). The chrome falls back to its own icon.\n */\n icons?: Record<string, string> | null\n}\n\nexport interface PanelDesignSchema {\n layout: 'sidebar' | 'topbar' | 'rail'\n nav: 'soft' | 'pill' | 'bar' | 'underline'\n header: 'plain' | 'banner' | 'band' | 'compact'\n surfaces: 'bordered' | 'elevated' | 'flat' | 'ring'\n inputs: 'outline' | 'filled' | 'underline'\n buttons: 'rounded' | 'pill' | 'square'\n tables: 'lined' | 'striped' | 'minimal'\n /**\n * Below the `md` breakpoint: `drawer` (default) or the `bottom` mobile preset (bottom\n * navigation bar, tables as stacked cards, slide-over modals, 44px touch targets and\n * sticky form actions). See `Panel::mobile()`.\n */\n mobile?: 'drawer' | 'bottom'\n}\n\n/**\n * One piece of slot content: server-rendered HTML or a schema component. `for` lists the\n * components (`relationManager:<class>`, `widget:<id>`) it is scoped to: such items only\n * render in a `<Slot scope=\"…\">` of a matching component. `when` (`Panel::slot(…, when:)`)\n * limits it to renders whose slot data matches: `{ column: 'title' }` only renders in the\n * `table.header-cell` slot of the `title` column; a list value matches any of its entries.\n */\nexport type SlotItemSchema = (\n { type: 'html'; html: string } | { type: 'component'; component: SchemaComponent }\n) & { for?: string[]; when?: Record<string, SlotDataValue | SlotDataValue[]> }\n\n/** A value in a slot's render data (`<Slot data={{ column: 'title' }}>`). */\nexport type SlotDataValue = string | number | boolean | null\n\n/** A language the panel can be displayed in. */\nexport interface LocaleSchema {\n /** Laravel-style code: `en`, `pt_BR`, `zh_Hant`. */\n code: string\n /** BCP 47 tag for `Intl` and the `lang` attribute: `pt-BR`. */\n tag: string\n /** The language's own name: `Deutsch`, `العربية`. */\n label: string\n direction: 'ltr' | 'rtl'\n}\n\n/** The current request's language, formats and the panel's language list. */\nexport interface LocalizationSchema extends LocaleSchema {\n fallbackLocale: string\n /** 0 = Sunday … 6 = Saturday. */\n firstDayOfWeek: number\n /** Default ISO 4217 currency. */\n currency: string\n /** IANA timezone dates are displayed in. */\n timezone: string\n /** Whether to show a language menu. */\n switcher: boolean\n /**\n * Where panel pages offer the menu (`Panel::languageSwitcher()`): the user menu (default\n * when absent), a top bar button, both, or neither. Auth pages keep their switcher.\n */\n switcherPosition?: LanguageSwitcherPosition\n /** Languages to offer in the menu (empty when the switcher is off). */\n locales: LocaleSchema[]\n}\n\nexport type LanguageSwitcherPosition = 'user-menu' | 'topbar' | 'both' | 'hidden'\n\nexport interface PanelEndpoints {\n action: string\n modal: string\n schemaRefresh: string\n schemaOptions: string\n /** Validates one wizard step's fields (`step` = the Step component's key). */\n schemaValidate?: string\n /** Loads `deferLoading()` children and `Tab::deferBadge()` badges (`{schema}::{key}`). */\n schemaDeferred?: string\n tableCell: string\n tableReorder: string\n /** Stores a user's column order (`reorderableColumns()`). */\n tableColumns?: string\n /** `Table::deferTotals()`: the record count and summaries, loaded after the rows. */\n tableTotals?: string\n /** `Table::savedViews()`: save, share, rename, delete and pick a default view. */\n tableViews?: string\n /** `Table::spreadsheet()`: batch save (or validate) grid edits. */\n tableCells?: string\n /** Fresh schemas of lazy and polled components by token (components outside panels). */\n components?: string\n locale: string\n /** Calls `#[Expose]` methods of custom pages (`usePageMethod()`). */\n pageCall?: string\n /** Edit pages: what changed since the form was loaded (`detectConflicts()`). */\n conflicts?: string\n upload: string\n uploadDestroy: string\n /** Starts a resumable chunked upload (`{uploadChunks}/{id}` takes chunks, `/complete` finishes). */\n uploadChunks?: string\n globalSearch: string\n /** Command palette: \"create\" links and recent records (GET). */\n commandPalette?: string\n /** Stores the user's customised keyboard shortcuts (POST `{shortcuts}`). */\n shortcuts?: string\n /** `Action::undoable()`: undoes an action from its toast (POST `{undo}`). */\n undo?: string\n /** `Dashboard::customizable()`: saves or resets the user's layout (POST `{token, layout}`). */\n dashboardLayout?: string\n notifications: string\n notificationsReadAll: string\n notificationsDestroyAll: string\n logout: string\n}\n\n/** Where toasts appear (`Panel::toastPosition()`); `start`/`end` follow the reading direction. */\nexport type ToastPosition =\n 'top-start' | 'top-center' | 'top-end' | 'bottom-start' | 'bottom-center' | 'bottom-end'\n\n/** Shown while impersonating another user (`ImpersonateAction`). */\nexport interface ImpersonationSchema {\n /** \"You are signed in as …\", translated on the server. */\n label: string\n leaveLabel: string\n /** POST here to return to the real user. */\n leaveUrl: string\n}\n\n/** The `alfakit` prop shared with every page of a panel. */\n/**\n * One `errorNotifications` entry: the text to show, or `hidden` (caught, nothing shown,\n * `hiddenErrorNotification()`) or `disabled` (default handling, `disabledErrorNotification()`).\n */\nexport interface ErrorNotificationEntrySchema {\n title?: string\n body?: string | null\n icon?: IconName\n hidden?: boolean\n disabled?: boolean\n}\n\n/** `errorNotifications`, keyed by HTTP status plus `default`. */\nexport type ErrorNotificationsSchema = Record<string, ErrorNotificationEntrySchema>\n\nexport interface PanelSchema {\n id: string\n /**\n * The schema contract version the server serialised (`SchemaContract::VERSION`). Renderers\n * compare its major part with `SCHEMA_CONTRACT_VERSION`; absent on servers before 1.0.\n */\n schemaContract?: string\n path: string\n url?: string\n brandName: string\n brandLogo?: string\n darkModeBrandLogo?: string\n brandLogoHeight?: string\n favicon?: string\n /**\n * Colour custom properties without the `--alfakit-` prefix: `primary`, its readable\n * `primary-foreground` and, for palettes (`Color::Indigo`), `primary-50` … `primary-950`.\n */\n colors?: Record<string, string>\n /**\n * CSS for custom colour names (`colors(['brand' => …])`): `.alfakit-color-{name}` rules\n * that point the generic colour utilities of themes.css at `--alfakit-{name}`.\n */\n colorCss?: string\n darkMode: {\n enabled: boolean\n forced: boolean\n /** `defaultThemeMode()`; absent for `system`. */\n default?: 'light' | 'dark'\n /** `false` when `themeSwitcher(false)`: no switcher, always the default mode. */\n switcher?: false\n }\n /** `false` when `topbar(false)`: sidebar layouts render no top bar (a slim bar on phones). */\n topbar?: false\n sidebarCollapsibleOnDesktop: boolean\n sidebarFullyCollapsibleOnDesktop?: boolean\n topNavigation?: boolean\n maxContentWidth?: Width | string\n breadcrumbs: boolean\n unsavedChangesAlerts?: boolean\n /** `false` when `collapsibleNavigationGroups(false)`: groups never collapse. */\n collapsibleNavigationGroups?: false\n /** CSS lengths for the open and icon-only sidebar (`--sidebar-width`, `--sidebar-width-icon`). */\n sidebarWidth?: string\n collapsedSidebarWidth?: string\n /** Max width of `auth` layout pages (login, registration…). */\n simplePageMaxContentWidth?: Width | string\n /** `false` when `spa(false)`: every link loads a full page. */\n spa?: false\n /** URL patterns (`*` wildcard) that load with a full page request. */\n spaUrlExceptions?: string[]\n /**\n * Notifications shown instead of Inertia's error modal, keyed by HTTP status plus\n * `default`. Absent when disabled or in debug mode. A page's own `errorNotifications`\n * replaces it while that page is open.\n */\n errorNotifications?: ErrorNotificationsSchema\n theme: PanelThemeSchema\n /** Content inserted with `Panel::slot()`, keyed by slot name. */\n slots?: Record<string, SlotItemSchema[]>\n /**\n * Empty for `starterKit()` panels: their navigation is the `alfakitNavigation` page prop,\n * which every page of the host application carries (not only the panel's).\n */\n navigation: NavigationGroupSchema[]\n /**\n * The active items and badges of this request; `navigation` holds only the structure\n * (sent once). Read the navigation through `usePanel()`, which merges the two.\n */\n navigationState?: NavigationStateSchema\n /**\n * `Panel::starterKit()`: the panel runs inside a Laravel starter kit app. Its pages render\n * in the host's own layout (sidebar, header, appearance) and the host's shadcn tokens;\n * the panel's own chrome, theme attributes and colour scheme are not applied.\n */\n starterKit?: true\n user?: PanelUserSchema\n userMenu?: {\n items: MenuItemSchema[]\n profileUrl?: string\n logoutUrl: string\n /** The `profile` entry as customised in `userMenuItems()` (replaces the built-in link). */\n profile?: MenuItemSchema\n /** The customised `logout` entry, or `false` when it is hidden. */\n logout?: MenuItemSchema | false\n /**\n * `topbar` when `userMenu(position: UserMenuPosition::Topbar)`: sidebar layouts show the\n * menu in the top bar instead of the sidebar footer. Omitted for the sidebar.\n */\n position?: 'topbar'\n }\n tenancy?: {\n current?: TenantSchema | null\n tenants: TenantSchema[]\n registrationUrl?: string\n profileUrl?: string\n /** The customised `register` entry of `tenantMenuItems()`. */\n registration?: MenuItemSchema\n /** The customised `profile` entry of `tenantMenuItems()`. */\n profile?: MenuItemSchema\n menu?: MenuItemSchema[]\n /** `false` when `tenantSwitcher(false)`: `tenants` is empty and the menu lists no others. */\n switcher?: false\n /** `searchableTenantMenu()`, or more than 10 tenants: show a search field in the menu. */\n searchable?: boolean\n }\n databaseNotifications?: {\n pollingInterval?: string\n unreadCount: number\n /**\n * `sidebar` when `databaseNotifications(position: 'sidebar')` or `topbar(false)`: sidebar\n * layouts show the bell in the sidebar instead of the top bar. Omitted for the top bar.\n */\n position?: 'sidebar'\n }\n globalSearch?: {\n keyBindings: string[]\n placeholder: string\n /** `globalSearchDebounce()` in milliseconds; renderers default to 250. */\n debounce?: number\n /** `globalSearchFieldSuffix()`: text shown at the end of the field instead of the key hint. */\n suffix?: string\n /** `false` when `globalSearchFieldKeyBindingSuffix(false)`: no key binding hint. */\n keyBindingSuffix?: false\n /**\n * `sidebar` when `globalSearch(position: GlobalSearchPosition::Sidebar)` or\n * `topbar(false)`: sidebar layouts show the field in the sidebar header. Omitted for the top bar.\n */\n position?: 'sidebar'\n }\n endpoints: Partial<PanelEndpoints> & { logout: string }\n /** `alfakit.uploads.chunk_size` in bytes: larger files are uploaded in chunks. */\n uploadChunkSize?: number\n auth: { login?: string; register?: string; passwordReset?: string }\n flashKey: string\n /** Present while impersonating: render a banner with a way back. */\n impersonation?: ImpersonationSchema\n /**\n * `Panel::realtimeNotifications()`: the private channel to listen on with Laravel Echo;\n * with `Panel::realtime()` also the connection (`live`, `authEndpoint`, `echo`).\n */\n realtime?: RealtimeSchema\n /** Omitted for the default (`top-end`). */\n toastPosition?: ToastPosition\n /** The command palette's extras: page actions, panel commands, navigation, create links, recent records. */\n commandPalette?: CommandPaletteSchema\n /** Keyboard shortcuts (`false` with `keyboardShortcuts(false)`); absent for guests. */\n keyboardShortcuts?: KeyboardShortcutsSchema | false\n /** `Panel::pwa()`: service worker, install prompt and Web Push; absent when off. */\n pwa?: PwaSchema\n localization: LocalizationSchema\n csrf: string\n translations: Record<string, unknown>\n}\n\nexport interface BreadcrumbSchema {\n label: string\n url?: string\n}\n\nexport type ContentBlock =\n | FormBlock\n | InfolistBlock\n | SchemaBlock\n | TableBlock\n | RelationManagersBlock\n | WidgetsBlock\n | LinksBlock\n | { type: string; key: string; [key: string]: unknown }\n\nexport type PageLayout = 'app' | 'auth' | 'blank' | 'fullscreen'\n\n/** The `page` prop rendered by `Alfakit/Page`. */\nexport interface PageSchema {\n class: string\n layout: PageLayout\n title: string\n heading?: string\n subheading?: string\n breadcrumbs?: BreadcrumbSchema[]\n maxContentWidth?: Width | string\n /** `fullscreen` layout: whether to show the slim header, and where its exit link goes. */\n fullscreen?: { header: boolean; exitUrl?: string }\n /** Cluster or record sub-navigation. */\n subNavigation?: SubNavigationSchema\n headerActions?: AnyActionSchema[]\n /** `$headerActionsAlignment`; absent for `end` (the default). */\n headerActionsAlignment?: 'start' | 'center' | 'end' | 'between' | 'justify'\n /** `$extraBodyAttributes` / `getExtraBodyAttributes()`: set on `<body>` while the page is open. */\n extraBodyAttributes?: Record<string, string>\n content: ContentBlock[]\n /** Encrypted context token for internal endpoints. */\n token: string\n record?: RecordKey\n view?: { component: string; props: Record<string, unknown> }\n /**\n * An action whose modal the renderer opens once the page hydrated (`$defaultAction`,\n * `?defaultAction=`, `?tableAction=&tableActionRecord=`).\n */\n defaultAction?: DefaultActionSchema\n /**\n * Page override of the panel's `errorNotifications` (`$hasErrorNotifications`,\n * `setUpErrorNotifications()`): `false` turns them off on this page. Absent when the\n * page follows the panel.\n */\n errorNotifications?: ErrorNotificationsSchema | false\n /** Record pages with `Panel::realtime()`: who else is on the record. */\n presence?: PresenceSchema\n /** Edit pages with `detectConflicts()`: the version the form was loaded from. */\n conflicts?: ConflictsSchema\n}\n\n/** `PageSchema::defaultAction`: what to open and in which context. */\nexport interface DefaultActionSchema {\n action: ActionSchema\n /** Context component: `page`, `table`, `relationManager:…`. */\n component: string\n record?: RecordKey\n arguments?: Record<string, unknown>\n}\n\n/**\n * Fresh schemas returned by a poll, keyed by poll target: `table`, `relationManager:Class`\n * or `widget:<id or class>`.\n */\nexport type PolledComponents = Record<string, ContentBlock | WidgetSchema | RelationManagerSchema>\n\n/** Shape of `usePage().props` on an Alfakit page. */\nexport interface AlfakitPageProps {\n alfakit: PanelSchema\n page?: PageSchema\n /** Components refreshed by a poll (only present after one); merged into `page`. */\n alfakitPoll?: PolledComponents\n /**\n * Lazy widgets and relation managers (`Page::LAZY_PROP`), an Inertia deferred prop that\n * arrives right after the first response; `resolveLazyComponents()` puts them in `page`.\n */\n alfakitLazy?: PolledComponents\n /** Badges of `Tab::deferBadge()` list tabs, a deferred prop loaded after the page. */\n alfakitTabBadges?: DeferredTabBadges\n /**\n * `Panel::deferNavigationBadges()`: the navigation badges keyed by item id\n * (`navigationState`), a deferred prop loaded after the page.\n */\n alfakitNavigationBadges?: Record<string, NavigationBadgeSchema>\n alfakitAppearance?: 'light' | 'dark' | 'system'\n /** The stored sidebar state (`alfakit_sidebar_state` cookie); null when never toggled. */\n alfakitSidebarOpen?: boolean | null\n /**\n * The navigation of the application's `starterKit()` panels, shared with every Inertia\n * page (the host's own pages too) for the host sidebar. Null for guests.\n */\n alfakitNavigation?: StarterKitNavigationSchema[] | null\n /**\n * The developer debug panel's data (`Page::DEBUG_PROP`): schema tree with visibility and\n * authorisation, evaluated closures and server timings. Only present while the panel's\n * debug panel is active; never in production.\n */\n alfakitDebug?: DebugSchema\n /**\n * The schema inspector's data (context identity, class links). Only present while the\n * panel's dev tools are on (`Panel::devTools()` with `app.debug`); never in production.\n */\n alfakitDevTools?: DevToolsSchema\n flash?: {\n alfakitNotifications?: NotificationSchema[]\n alfakitAction?: {\n name: string\n status: 'success' | 'halted' | 'cancelled'\n closeModal?: boolean\n deselectRecords?: boolean | null\n }\n [key: string]: unknown\n }\n errors?: Record<string, string>\n [key: string]: unknown\n}\n\nexport type { ActionSchema }\n"],"mappings":";;AAgIA,MAAa,sBAAsB;AACnC,MAAa,wBAAwB"}
1
+ {"version":3,"file":"panel.js","names":[],"sources":["../../src/schema/panel.ts"],"sourcesContent":["import type { ActionSchema, AnyActionSchema } from './actions'\nimport type { CommandPaletteSchema, KeyboardShortcutsSchema } from './command-palette'\nimport type { Color, IconName, RecordKey, Width } from './common'\nimport type { SchemaComponent } from './components'\nimport type { DebugSchema } from './debug'\nimport type { DevToolsSchema } from './dev-tools'\nimport type { FormBlock, InfolistBlock, LinksBlock, SchemaBlock } from './form'\nimport type { NotificationSchema } from './notifications'\nimport type { PwaSchema } from './pwa'\nimport type { ConflictsSchema, PresenceSchema, RealtimeSchema } from './realtime'\nimport type { DeferredTabBadges } from './resources'\nimport type { RelationManagerSchema, RelationManagersBlock, TableBlock } from './table'\nimport type { WidgetSchema, WidgetsBlock } from './widgets'\n\nexport interface NavigationItemSchema {\n /** Text, or sanitised HTML when `labelHtml` is true (an `Htmlable` label). */\n label: string\n /** `label` is sanitised HTML: render it as markup (use `htmlLabelToText()` for text). */\n labelHtml?: boolean\n icon?: IconName\n /**\n * Split navigation (`alfakit.navigation` is an Inertia once prop): the icon of the item\n * while active, swapped in by `resolvePanelNavigation()`.\n */\n activeIcon?: IconName\n url?: string\n openInNewTab?: boolean\n active?: boolean\n badge?: string | number\n badgeColor?: Color\n badgeTooltip?: string\n /** `Panel::deferNavigationBadges()`: the item has a badge that loads after the page. */\n deferredBadge?: boolean\n /** Set by `resolvePanelNavigation()` while a deferred badge is loading (show a placeholder). */\n badgePending?: boolean\n /** `NavigationItem::extraAttributes()`: HTML attributes for the item's link (`class` merges). */\n extraAttributes?: Record<string, string | number | boolean | null>\n children?: NavigationItemSchema[]\n}\n\nexport interface NavigationGroupSchema {\n label?: string | null\n icon?: IconName\n collapsible: boolean\n collapsed?: boolean\n items: NavigationItemSchema[]\n /** `NavigationGroup::extraSidebarAttributes()`: HTML attributes for the group in the sidebar. */\n extraSidebarAttributes?: Record<string, string | number | boolean | null>\n /** `NavigationGroup::extraTopbarAttributes()`: HTML attributes for the group in the top navigation. */\n extraTopbarAttributes?: Record<string, string | number | boolean | null>\n}\n\n/** A navigation item's badge, from `navigationState` or the deferred `alfakitNavigationBadges` prop. */\nexport interface NavigationBadgeSchema {\n badge: string | number\n badgeColor?: Color\n badgeTooltip?: string\n}\n\n/**\n * The per-request part of the panel navigation, whose structure (`navigation`) is an\n * Inertia once prop. Items are addressed by position: `group.item[.child…]` (`0.2.1`).\n */\nexport interface NavigationStateSchema {\n /** The active items (an active child's ancestors included). */\n active?: string[]\n /** Badges, unless `Panel::deferNavigationBadges()` defers them. */\n badges?: Record<string, NavigationBadgeSchema>\n}\n\n/** One `starterKit()` panel's navigation, as shared with the host application's pages. */\nexport interface StarterKitNavigationSchema {\n /** The panel id. */\n id: string\n /** The panel's home URL. */\n url: string\n brandName: string\n /** Empty for tenancy panels outside a tenant (their items link to tenant routes). */\n groups: NavigationGroupSchema[]\n /** What the drop-in header components render before they load. */\n widgets?: StarterKitWidgetsSchema\n}\n\n/**\n * The `widgets` of a `starterKit()` panel's shared navigation: what `<AlfakitSearch />`,\n * `<AlfakitNotifications />` and `<AlfakitTenantSwitcher />` show on any host page before\n * their code and the panel data (`endpoint`) have loaded.\n */\nexport interface StarterKitWidgetsSchema {\n /** GET: the panel data the components render with (the `alfakit` prop of the panel's pages). */\n endpoint: string\n /** Global search or the command palette (tenancy panels: only inside a tenant). */\n search?: { keyBindings: string[]; placeholder: string }\n /** `databaseNotifications()`: the bell's label and the user's unread count. */\n notifications?: { label: string; unreadCount: number }\n /** Tenancy panels: the user's tenants; `current` is null on the host's own pages. */\n tenancy?: {\n current?: TenantSchema | null\n tenants: TenantSchema[]\n registrationUrl?: string\n /** The registration page's own label (`RegisterTenant::getLabel()`). */\n registrationLabel?: string\n searchable?: true\n }\n}\n\n/** A page's secondary navigation: cluster pages or a record's pages. */\nexport interface SubNavigationSchema {\n position: 'start' | 'end' | 'top'\n groups: NavigationGroupSchema[]\n}\n\n/**\n * An entry of the user or tenant menu: a link (`url`, `method: 'post'` for POST links) or\n * an `Action` with server logic or a modal (`action`), run through the action endpoint\n * with the component `userMenu` / `tenantMenu` and the page's token.\n */\nexport interface MenuItemSchema {\n label?: string\n icon?: IconName\n url?: string\n openInNewTab?: boolean\n color?: Color\n method?: 'post'\n action?: ActionSchema\n /** Group index (nested arrays in `userMenuItems()`); a separator divides groups. */\n group?: number\n}\n\n/** Action endpoint components of the menus (`Panel::USER_MENU_COMPONENT`, …). */\nexport const USER_MENU_COMPONENT = 'userMenu'\nexport const TENANT_MENU_COMPONENT = 'tenantMenu'\n\nexport interface PanelUserSchema {\n id: RecordKey\n name: string\n email?: string | null\n avatar?: string | null\n}\n\nexport interface TenantSchema {\n id: RecordKey\n /** Text, or sanitised HTML when `nameHtml` is true (an `Htmlable` `getAlfakitName()`). */\n name: string\n /** `name` is sanitised HTML: render it as markup (use `htmlLabelToText()` for text). */\n nameHtml?: boolean\n avatar?: string | null\n url: string\n /** `HasCurrentTenantLabel`: a caption shown with the current tenant (\"Active team\"). */\n label?: string | null\n}\n\n/** The panel's design, see `Panel::theme()`. */\nexport interface PanelThemeSchema {\n name: string\n /** Value of `data-alfakit-theme`, base theme first: `\"alfakit acme\"`. */\n attribute: string\n sidebar: 'inset' | 'floating' | 'flush'\n density: 'comfortable' | 'compact'\n radius?: string | null\n font?: string | null\n /** CSS value for `--alfakit-font`. */\n fontCss?: string | null\n /** CSS value for `--alfakit-heading-font`. */\n headingFontCss?: string | null\n /** Stylesheet that loads the font, if any. */\n fontUrl?: string | null\n /** Every font stylesheet to load (body and heading fonts). */\n fontUrls?: string[]\n /** Structure and component styles; mirrored as `data-*` attributes on `<html>`. */\n design: PanelDesignSchema\n /**\n * Icon aliases replaced with `Icons::register()` (`alfakit::panels.sidebar.collapse-button`\n * → a Lucide name, image URL or sanitised SVG). The chrome falls back to its own icon.\n */\n icons?: Record<string, string> | null\n}\n\nexport interface PanelDesignSchema {\n layout: 'sidebar' | 'topbar' | 'rail'\n nav: 'soft' | 'pill' | 'bar' | 'underline'\n header: 'plain' | 'banner' | 'band' | 'compact'\n surfaces: 'bordered' | 'elevated' | 'flat' | 'ring'\n inputs: 'outline' | 'filled' | 'underline'\n buttons: 'rounded' | 'pill' | 'square'\n tables: 'lined' | 'striped' | 'minimal'\n /**\n * Below the `md` breakpoint: `drawer` (default) or the `bottom` mobile preset (bottom\n * navigation bar, tables as stacked cards, slide-over modals, 44px touch targets and\n * sticky form actions). See `Panel::mobile()`.\n */\n mobile?: 'drawer' | 'bottom'\n}\n\n/**\n * One piece of slot content: server-rendered HTML or a schema component. `for` lists the\n * components (`relationManager:<class>`, `widget:<id>`) it is scoped to: such items only\n * render in a `<Slot scope=\"…\">` of a matching component. `when` (`Panel::slot(…, when:)`)\n * limits it to renders whose slot data matches: `{ column: 'title' }` only renders in the\n * `table.header-cell` slot of the `title` column; a list value matches any of its entries.\n */\nexport type SlotItemSchema = (\n { type: 'html'; html: string } | { type: 'component'; component: SchemaComponent }\n) & { for?: string[]; when?: Record<string, SlotDataValue | SlotDataValue[]> }\n\n/** A value in a slot's render data (`<Slot data={{ column: 'title' }}>`). */\nexport type SlotDataValue = string | number | boolean | null\n\n/** A language the panel can be displayed in. */\nexport interface LocaleSchema {\n /** Laravel-style code: `en`, `pt_BR`, `zh_Hant`. */\n code: string\n /** BCP 47 tag for `Intl` and the `lang` attribute: `pt-BR`. */\n tag: string\n /** The language's own name: `Deutsch`, `العربية`. */\n label: string\n direction: 'ltr' | 'rtl'\n}\n\n/** The current request's language, formats and the panel's language list. */\nexport interface LocalizationSchema extends LocaleSchema {\n fallbackLocale: string\n /** 0 = Sunday … 6 = Saturday. */\n firstDayOfWeek: number\n /** Default ISO 4217 currency. */\n currency: string\n /** IANA timezone dates are displayed in. */\n timezone: string\n /** Whether to show a language menu. */\n switcher: boolean\n /**\n * Where panel pages offer the menu (`Panel::languageSwitcher()`): the user menu (default\n * when absent), a top bar button, both, or neither. Auth pages keep their switcher.\n */\n switcherPosition?: LanguageSwitcherPosition\n /** Languages to offer in the menu (empty when the switcher is off). */\n locales: LocaleSchema[]\n}\n\nexport type LanguageSwitcherPosition = 'user-menu' | 'topbar' | 'both' | 'hidden'\n\nexport interface PanelEndpoints {\n action: string\n modal: string\n schemaRefresh: string\n schemaOptions: string\n /** Validates one wizard step's fields (`step` = the Step component's key). */\n schemaValidate?: string\n /** Loads `deferLoading()` children and `Tab::deferBadge()` badges (`{schema}::{key}`). */\n schemaDeferred?: string\n tableCell: string\n tableReorder: string\n /** Stores a user's column order (`reorderableColumns()`). */\n tableColumns?: string\n /** `Table::deferTotals()`: the record count and summaries, loaded after the rows. */\n tableTotals?: string\n /** `Table::savedViews()`: save, share, rename, delete and pick a default view. */\n tableViews?: string\n /** `Table::spreadsheet()`: batch save (or validate) grid edits. */\n tableCells?: string\n /** Fresh schemas of lazy and polled components by token (components outside panels). */\n components?: string\n locale: string\n /** Calls `#[Expose]` methods of custom pages (`usePageMethod()`). */\n pageCall?: string\n /** Edit pages: what changed since the form was loaded (`detectConflicts()`). */\n conflicts?: string\n upload: string\n uploadDestroy: string\n /** Starts a resumable chunked upload (`{uploadChunks}/{id}` takes chunks, `/complete` finishes). */\n uploadChunks?: string\n globalSearch: string\n /** Command palette: \"create\" links and recent records (GET). */\n commandPalette?: string\n /** Stores the user's customised keyboard shortcuts (POST `{shortcuts}`). */\n shortcuts?: string\n /** `Action::undoable()`: undoes an action from its toast (POST `{undo}`). */\n undo?: string\n /** `Dashboard::customizable()`: saves or resets the user's layout (POST `{token, layout}`). */\n dashboardLayout?: string\n notifications: string\n notificationsReadAll: string\n notificationsDestroyAll: string\n logout: string\n}\n\n/** Where toasts appear (`Panel::toastPosition()`); `start`/`end` follow the reading direction. */\nexport type ToastPosition =\n 'top-start' | 'top-center' | 'top-end' | 'bottom-start' | 'bottom-center' | 'bottom-end'\n\n/** Shown while impersonating another user (`ImpersonateAction`). */\nexport interface ImpersonationSchema {\n /** \"You are signed in as …\", translated on the server. */\n label: string\n leaveLabel: string\n /** POST here to return to the real user. */\n leaveUrl: string\n}\n\n/** The `alfakit` prop shared with every page of a panel. */\n/**\n * One `errorNotifications` entry: the text to show, or `hidden` (caught, nothing shown,\n * `hiddenErrorNotification()`) or `disabled` (default handling, `disabledErrorNotification()`).\n */\nexport interface ErrorNotificationEntrySchema {\n title?: string\n body?: string | null\n icon?: IconName\n hidden?: boolean\n disabled?: boolean\n}\n\n/** `errorNotifications`, keyed by HTTP status plus `default`. */\nexport type ErrorNotificationsSchema = Record<string, ErrorNotificationEntrySchema>\n\nexport interface PanelSchema {\n id: string\n /**\n * The schema contract version the server serialised (`SchemaContract::VERSION`). Renderers\n * compare its major part with `SCHEMA_CONTRACT_VERSION`; absent on servers before 1.0.\n */\n schemaContract?: string\n path: string\n url?: string\n brandName: string\n brandLogo?: string\n darkModeBrandLogo?: string\n brandLogoHeight?: string\n favicon?: string\n /**\n * Colour custom properties without the `--alfakit-` prefix: `primary`, its readable\n * `primary-foreground` and, for palettes (`Color::Indigo`), `primary-50` … `primary-950`.\n */\n colors?: Record<string, string>\n /**\n * CSS for custom colour names (`colors(['brand' => …])`): `.alfakit-color-{name}` rules\n * that point the generic colour utilities of themes.css at `--alfakit-{name}`.\n */\n colorCss?: string\n darkMode: {\n enabled: boolean\n forced: boolean\n /** `defaultThemeMode()`; absent for `system`. */\n default?: 'light' | 'dark'\n /** `false` when `themeSwitcher(false)`: no switcher, always the default mode. */\n switcher?: false\n }\n /** `false` when `topbar(false)`: sidebar layouts render no top bar (a slim bar on phones). */\n topbar?: false\n sidebarCollapsibleOnDesktop: boolean\n sidebarFullyCollapsibleOnDesktop?: boolean\n topNavigation?: boolean\n maxContentWidth?: Width | string\n breadcrumbs: boolean\n unsavedChangesAlerts?: boolean\n /** `false` when `collapsibleNavigationGroups(false)`: groups never collapse. */\n collapsibleNavigationGroups?: false\n /** CSS lengths for the open and icon-only sidebar (`--sidebar-width`, `--sidebar-width-icon`). */\n sidebarWidth?: string\n collapsedSidebarWidth?: string\n /** Max width of `auth` layout pages (login, registration…). */\n simplePageMaxContentWidth?: Width | string\n /** `false` when `spa(false)`: every link loads a full page. */\n spa?: false\n /** URL patterns (`*` wildcard) that load with a full page request. */\n spaUrlExceptions?: string[]\n /**\n * Notifications shown instead of Inertia's error modal, keyed by HTTP status plus\n * `default`. Absent when disabled or in debug mode. A page's own `errorNotifications`\n * replaces it while that page is open.\n */\n errorNotifications?: ErrorNotificationsSchema\n theme: PanelThemeSchema\n /** Content inserted with `Panel::slot()`, keyed by slot name. */\n slots?: Record<string, SlotItemSchema[]>\n /**\n * Empty for `starterKit()` panels: their navigation is the `alfakitNavigation` page prop,\n * which every page of the host application carries (not only the panel's).\n */\n navigation: NavigationGroupSchema[]\n /**\n * The active items and badges of this request; `navigation` holds only the structure\n * (sent once). Read the navigation through `usePanel()`, which merges the two.\n */\n navigationState?: NavigationStateSchema\n /**\n * `Panel::starterKit()`: the panel runs inside a Laravel starter kit app. Its pages render\n * in the host's own layout (sidebar, header, appearance) and the host's shadcn tokens;\n * the panel's own chrome, theme attributes and colour scheme are not applied.\n */\n starterKit?: true\n user?: PanelUserSchema\n userMenu?: {\n items: MenuItemSchema[]\n profileUrl?: string\n logoutUrl: string\n /** The `profile` entry as customised in `userMenuItems()` (replaces the built-in link). */\n profile?: MenuItemSchema\n /** The customised `logout` entry, or `false` when it is hidden. */\n logout?: MenuItemSchema | false\n /**\n * `topbar` when `userMenu(position: UserMenuPosition::Topbar)`: sidebar layouts show the\n * menu in the top bar instead of the sidebar footer. Omitted for the sidebar.\n */\n position?: 'topbar'\n }\n tenancy?: {\n current?: TenantSchema | null\n tenants: TenantSchema[]\n registrationUrl?: string\n profileUrl?: string\n /** The registration page's own label (`RegisterTenant::getLabel()`); else \"New\". */\n registrationLabel?: string\n /** The profile page's own label (`EditTenantProfile::getLabel()`); else \"Settings\". */\n profileLabel?: string\n /** The customised `register` entry of `tenantMenuItems()`. */\n registration?: MenuItemSchema\n /** The customised `profile` entry of `tenantMenuItems()`. */\n profile?: MenuItemSchema\n menu?: MenuItemSchema[]\n /** `false` when `tenantSwitcher(false)`: `tenants` is empty and the menu lists no others. */\n switcher?: false\n /** `searchableTenantMenu()`, or more than 10 tenants: show a search field in the menu. */\n searchable?: boolean\n }\n databaseNotifications?: {\n pollingInterval?: string\n unreadCount: number\n /**\n * `sidebar` when `databaseNotifications(position: 'sidebar')` or `topbar(false)`: sidebar\n * layouts show the bell in the sidebar instead of the top bar. Omitted for the top bar.\n */\n position?: 'sidebar'\n }\n globalSearch?: {\n keyBindings: string[]\n placeholder: string\n /** `globalSearchDebounce()` in milliseconds; renderers default to 250. */\n debounce?: number\n /** `globalSearchFieldSuffix()`: text shown at the end of the field instead of the key hint. */\n suffix?: string\n /** `false` when `globalSearchFieldKeyBindingSuffix(false)`: no key binding hint. */\n keyBindingSuffix?: false\n /**\n * `sidebar` when `globalSearch(position: GlobalSearchPosition::Sidebar)` or\n * `topbar(false)`: sidebar layouts show the field in the sidebar header. Omitted for the top bar.\n */\n position?: 'sidebar'\n }\n endpoints: Partial<PanelEndpoints> & { logout: string }\n /** `alfakit.uploads.chunk_size` in bytes: larger files are uploaded in chunks. */\n uploadChunkSize?: number\n auth: { login?: string; register?: string; passwordReset?: string }\n flashKey: string\n /** Present while impersonating: render a banner with a way back. */\n impersonation?: ImpersonationSchema\n /**\n * `Panel::realtimeNotifications()`: the private channel to listen on with Laravel Echo;\n * with `Panel::realtime()` also the connection (`live`, `authEndpoint`, `echo`).\n */\n realtime?: RealtimeSchema\n /** Omitted for the default (`top-end`). */\n toastPosition?: ToastPosition\n /** The command palette's extras: page actions, panel commands, navigation, create links, recent records. */\n commandPalette?: CommandPaletteSchema\n /** Keyboard shortcuts (`false` with `keyboardShortcuts(false)`); absent for guests. */\n keyboardShortcuts?: KeyboardShortcutsSchema | false\n /** `Panel::pwa()`: service worker, install prompt and Web Push; absent when off. */\n pwa?: PwaSchema\n localization: LocalizationSchema\n csrf: string\n translations: Record<string, unknown>\n}\n\nexport interface BreadcrumbSchema {\n label: string\n url?: string\n}\n\nexport type ContentBlock =\n | FormBlock\n | InfolistBlock\n | SchemaBlock\n | TableBlock\n | RelationManagersBlock\n | WidgetsBlock\n | LinksBlock\n | { type: string; key: string; [key: string]: unknown }\n\nexport type PageLayout = 'app' | 'auth' | 'blank' | 'fullscreen'\n\n/** The `page` prop rendered by `Alfakit/Page`. */\nexport interface PageSchema {\n class: string\n layout: PageLayout\n title: string\n heading?: string\n subheading?: string\n breadcrumbs?: BreadcrumbSchema[]\n maxContentWidth?: Width | string\n /** `fullscreen` layout: whether to show the slim header, and where its exit link goes. */\n fullscreen?: { header: boolean; exitUrl?: string }\n /** Cluster or record sub-navigation. */\n subNavigation?: SubNavigationSchema\n headerActions?: AnyActionSchema[]\n /** `$headerActionsAlignment`; absent for `end` (the default). */\n headerActionsAlignment?: 'start' | 'center' | 'end' | 'between' | 'justify'\n /** `$extraBodyAttributes` / `getExtraBodyAttributes()`: set on `<body>` while the page is open. */\n extraBodyAttributes?: Record<string, string>\n content: ContentBlock[]\n /** Encrypted context token for internal endpoints. */\n token: string\n record?: RecordKey\n view?: { component: string; props: Record<string, unknown> }\n /**\n * An action whose modal the renderer opens once the page hydrated (`$defaultAction`,\n * `?defaultAction=`, `?tableAction=&tableActionRecord=`).\n */\n defaultAction?: DefaultActionSchema\n /**\n * Page override of the panel's `errorNotifications` (`$hasErrorNotifications`,\n * `setUpErrorNotifications()`): `false` turns them off on this page. Absent when the\n * page follows the panel.\n */\n errorNotifications?: ErrorNotificationsSchema | false\n /** Record pages with `Panel::realtime()`: who else is on the record. */\n presence?: PresenceSchema\n /** Edit pages with `detectConflicts()`: the version the form was loaded from. */\n conflicts?: ConflictsSchema\n}\n\n/** `PageSchema::defaultAction`: what to open and in which context. */\nexport interface DefaultActionSchema {\n action: ActionSchema\n /** Context component: `page`, `table`, `relationManager:…`. */\n component: string\n record?: RecordKey\n arguments?: Record<string, unknown>\n}\n\n/**\n * Fresh schemas returned by a poll, keyed by poll target: `table`, `relationManager:Class`\n * or `widget:<id or class>`.\n */\nexport type PolledComponents = Record<string, ContentBlock | WidgetSchema | RelationManagerSchema>\n\n/** Shape of `usePage().props` on an Alfakit page. */\nexport interface AlfakitPageProps {\n alfakit: PanelSchema\n page?: PageSchema\n /** Components refreshed by a poll (only present after one); merged into `page`. */\n alfakitPoll?: PolledComponents\n /**\n * Lazy widgets and relation managers (`Page::LAZY_PROP`), an Inertia deferred prop that\n * arrives right after the first response; `resolveLazyComponents()` puts them in `page`.\n */\n alfakitLazy?: PolledComponents\n /** Badges of `Tab::deferBadge()` list tabs, a deferred prop loaded after the page. */\n alfakitTabBadges?: DeferredTabBadges\n /**\n * `Panel::deferNavigationBadges()`: the navigation badges keyed by item id\n * (`navigationState`), a deferred prop loaded after the page.\n */\n alfakitNavigationBadges?: Record<string, NavigationBadgeSchema>\n alfakitAppearance?: 'light' | 'dark' | 'system'\n /** The stored sidebar state (`alfakit_sidebar_state` cookie); null when never toggled. */\n alfakitSidebarOpen?: boolean | null\n /**\n * The navigation of the application's `starterKit()` panels, shared with every Inertia\n * page (the host's own pages too) for the host sidebar. Null for guests.\n */\n alfakitNavigation?: StarterKitNavigationSchema[] | null\n /**\n * The developer debug panel's data (`Page::DEBUG_PROP`): schema tree with visibility and\n * authorisation, evaluated closures and server timings. Only present while the panel's\n * debug panel is active; never in production.\n */\n alfakitDebug?: DebugSchema\n /**\n * The schema inspector's data (context identity, class links). Only present while the\n * panel's dev tools are on (`Panel::devTools()` with `app.debug`); never in production.\n */\n alfakitDevTools?: DevToolsSchema\n flash?: {\n alfakitNotifications?: NotificationSchema[]\n alfakitAction?: {\n name: string\n status: 'success' | 'halted' | 'cancelled'\n closeModal?: boolean\n deselectRecords?: boolean | null\n }\n [key: string]: unknown\n }\n errors?: Record<string, string>\n [key: string]: unknown\n}\n\nexport type { ActionSchema }\n"],"mappings":";;AAkIA,MAAa,sBAAsB;AACnC,MAAa,wBAAwB"}
@@ -1,4 +1,4 @@
1
- import { Breakpoints, IconName, Option } from "./common.js";
1
+ import { Breakpoints, Color, IconName, Option } from "./common.js";
2
2
  import { BaseField } from "./components.js";
3
3
  //#region src/schema/table-grouping.d.ts
4
4
  /** One summarizer's formatted value (`Sum::make()` → `{ label: 'Sum', value: '€9.00' }`). */
@@ -48,6 +48,10 @@ export interface TableRecordGroupSchema {
48
48
  key: string;
49
49
  title: string;
50
50
  description?: string;
51
+ /** The enum's icon (`HasIcon`) when the group state is an enum. */
52
+ icon?: IconName;
53
+ /** The enum's colour (`HasColor`), applied to the icon. */
54
+ color?: Color;
51
55
  summary?: ColumnSummariesSchema;
52
56
  collapsible?: boolean;
53
57
  }
@@ -1 +1 @@
1
- {"version":3,"file":"table-grouping.d.ts","names":[],"sources":["../../src/schema/table-grouping.ts"],"mappings":";;;;iBAMiB;EACf;;EAEA;EACA;;EAEA,QAAQ;IAAQ,MAAM;IAAU;IAAuB;;;;YAI7C,wBAAwB,eAAe;iBAElC;;EAEf;EACA,QAAQ;;iBAGO;;EAEf,OAAO;;EAEP,MAAM;;;iBAMS;EACf;EACA;;;iBAIe;EACf;EACA;EACA;EACA;EACA;;EAEA;;;iBAIe;;EAEf;EACA;EACA;EACA,UAAU;EACV;;YAKU;iBAGK;EACf;EACA;;EAEA,OAAO;;EAEP,UAAU;;iBAGK;EACf;EACA;EACA;EACA,OAAO;EACP,WAAW;;EAEX,UAAU;EACV;;EAEA;EACA;;EAEA;;;iBAIe,gCAAgC;EAC/C;EACA,aAAa;;EAEb;;EAEA,0BAA0B;;EAE1B;;iBAGe;EACf;EACA;EACA;EACA;;iBAGe;EACf;EACA,OAAO;;iBAGQ,8BAA8B;EAC7C;;YAGU,mBAAmB,6BAA6B"}
1
+ {"version":3,"file":"table-grouping.d.ts","names":[],"sources":["../../src/schema/table-grouping.ts"],"mappings":";;;;iBAMiB;EACf;;EAEA;EACA;;EAEA,QAAQ;IAAQ,MAAM;IAAU;IAAuB;;;;YAI7C,wBAAwB,eAAe;iBAElC;;EAEf;EACA,QAAQ;;iBAGO;;EAEf,OAAO;;EAEP,MAAM;;;iBAMS;EACf;EACA;;;iBAIe;EACf;EACA;EACA;EACA;EACA;;EAEA;;;iBAIe;;EAEf;EACA;EACA;;EAEA,OAAO;;EAEP,QAAQ;EACR,UAAU;EACV;;YAKU;iBAGK;EACf;EACA;;EAEA,OAAO;;EAEP,UAAU;;iBAGK;EACf;EACA;EACA;EACA,OAAO;EACP,WAAW;;EAEX,UAAU;EACV;;EAEA;EACA;;EAEA;;;iBAIe,gCAAgC;EAC/C;EACA,aAAa;;EAEb;;EAEA,0BAA0B;;EAE1B;;iBAGe;EACf;EACA;EACA;EACA;;iBAGe;EACf;EACA,OAAO;;iBAGQ,8BAA8B;EAC7C;;YAGU,mBAAmB,6BAA6B"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alfakit/core",
3
- "version": "0.1.0",
3
+ "version": "0.1.2",
4
4
  "description": "Framework-agnostic schema types and state management for Alfakit, the Laravel admin panel builder by Alfa Six.",
5
5
  "license": "MIT",
6
6
  "author": "Alfa Six (https://alfasixbh.com)",
@@ -34,13 +34,15 @@
34
34
  "import": "./dist/schema/index.js"
35
35
  },
36
36
  "./package.json": "./package.json",
37
- "./themes.css": "./themes.css"
37
+ "./themes.css": "./themes.css",
38
+ "./components.css": "./components.css"
38
39
  },
39
40
  "files": [
40
41
  "dist",
41
42
  "README.md",
42
43
  "CHANGELOG.md",
43
- "themes.css"
44
+ "themes.css",
45
+ "components.css"
44
46
  ],
45
47
  "dependencies": {
46
48
  "@inertiajs/core": "^3.8.0"