@alfakit/core 0.1.12 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -0
- package/dist/cms.d.ts +10 -1
- package/dist/cms.d.ts.map +1 -1
- package/dist/cms.js +30 -1
- package/dist/cms.js.map +1 -1
- package/dist/form.d.ts +10 -1
- package/dist/form.d.ts.map +1 -1
- package/dist/form.js +26 -4
- package/dist/form.js.map +1 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.js +2 -2
- package/dist/kanban.d.ts.map +1 -1
- package/dist/kanban.js +25 -1
- package/dist/kanban.js.map +1 -1
- package/dist/schema/cms.d.ts +23 -0
- package/dist/schema/cms.d.ts.map +1 -1
- package/dist/schema/components.d.ts +2 -0
- package/dist/schema/components.d.ts.map +1 -1
- package/dist/schema/components.js.map +1 -1
- package/dist/schema/index.d.ts +2 -2
- package/package.json +1 -1
- package/themes.css +92 -0
|
@@ -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 /**\n * `extraItemActions()` evaluated without an item (`$arguments['item']` null), for items\n * the browser added since the last response; server-rendered items carry their own.\n */\n extraItemActions?: ActionSchema[]\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":";AA6qBA,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 /** Short names of the accepted types for the drop zone hint (`PNG, JPG, ICO`, `Images`). */\n acceptedFileTypesLabel?: 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 /**\n * `extraItemActions()` evaluated without an item (`$arguments['item']` null), for items\n * the browser added since the last response; server-rendered items carry their own.\n */\n extraItemActions?: ActionSchema[]\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":";AA+qBA,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"}
|
package/dist/schema/index.d.ts
CHANGED
|
@@ -22,8 +22,8 @@ import { DevToolsClass, DevToolsContext, DevToolsSchema } from "./dev-tools.js";
|
|
|
22
22
|
import { PwaPushSchema, PwaSchema } from "./pwa.js";
|
|
23
23
|
import { StandaloneComponentSchema, isStandaloneComponent } from "./standalone.js";
|
|
24
24
|
import { AlfakitPageProps, BreadcrumbSchema, ContentBlock, DefaultActionSchema, ErrorNotificationEntrySchema, ErrorNotificationsSchema, ImpersonationSchema, LanguageSwitcherPosition, LocaleSchema, LocalizationSchema, MenuItemSchema, NavigationBadgeSchema, NavigationGroupSchema, NavigationItemSchema, NavigationStateSchema, PageLayout, PageSchema, PanelDesignSchema, PanelEndpoints, PanelSchema, PanelThemeSchema, PanelUserSchema, PolledComponents, SlotDataValue, SlotItemSchema, StarterKitDashboardWidgetsSchema, StarterKitNavigationSchema, StarterKitWidgetsSchema, SubNavigationSchema, TENANT_MENU_COMPONENT, TenantSchema, ToastPosition, USER_MENU_COMPONENT } from "./panel.js";
|
|
25
|
-
import { CmsAdminBarSchema, CmsAlternateSchema, CmsAspectRatio, CmsAutosaveResult, CmsBlockSchema, CmsBreadcrumbSchema, CmsBuiltInBlocks, CmsCallToActionBlockData, CmsColumnsBlockData, CmsEditorStatusSchema, CmsEmbedBlockData, CmsFaqBlockData, CmsFeatureSchema, CmsFeaturesBlockData, CmsFormBlockData, CmsGalleryBlockData, CmsHeroBlockData, CmsImageBlockData, CmsImageSchema, CmsLinkSchema, CmsLivePreviewSchema, CmsMenuItemSchema, CmsMenuSchema, CmsPageProps, CmsPageSchema, CmsPayload, CmsRichTextBlockData, CmsSectionBlockData, CmsSeoSchema, CmsSiteSchema, CmsTestimonialSchema, CmsTestimonialsBlockData } from "./cms.js";
|
|
25
|
+
import { CmsAdminBarSchema, CmsAlternateSchema, CmsAspectRatio, CmsAutosaveResult, CmsBlockSchema, CmsBlockStyle, CmsBreadcrumbSchema, CmsBuiltInBlocks, CmsCallToActionBlockData, CmsColumnsBlockData, CmsEditorStatusSchema, CmsEmbedBlockData, CmsFaqBlockData, CmsFeatureSchema, CmsFeaturesBlockData, CmsFormBlockData, CmsGalleryBlockData, CmsHeroBlockData, CmsImageBlockData, CmsImageSchema, CmsLinkSchema, CmsLivePreviewSchema, CmsMenuItemSchema, CmsMenuSchema, CmsPageProps, CmsPageSchema, CmsPayload, CmsRichTextBlockData, CmsSectionBlockData, CmsSeoSchema, CmsSiteDesign, CmsSiteSchema, CmsTestimonialSchema, CmsTestimonialsBlockData } from "./cms.js";
|
|
26
26
|
import { HelpdeskActivity, HelpdeskAttachment, HelpdeskBadge, HelpdeskChatConfig, HelpdeskChatConversation, HelpdeskChatMessage, HelpdeskChatResponse, HelpdeskInboxList, HelpdeskInboxSchema, HelpdeskMessage, HelpdeskSla, HelpdeskTicket, HelpdeskTicketSummary, HelpdeskView } from "./helpdesk.js";
|
|
27
27
|
import { TranslationCellSchema, TranslationFilter, TranslationHistoryEntry, TranslationLocaleSchema, TranslationManagerSchema, TranslationProgressSchema, TranslationRowSchema, TranslationRowsResult, TranslationSaveResult, TranslationSuggestionSchema } from "./translation-manager.js";
|
|
28
28
|
import { RecordVersionChangeSchema, RecordVersionSchema, RecordVersionsSchema } from "./versions.js";
|
|
29
|
-
export { ActionGroupSchema, ActionModalCancelledResponse, ActionModalSchema, ActionResultFlash, ActionSchema, ActionVariant, ActionsComponentSchema, Affixes, AiActionStatus, AiConversationSchema, AiCopilotSchema, AiMessageRole, AiMessageSchema, AiProposedActionSchema, AiSetupNoticeSchema, AiStreamSchema, AlfakitPageProps, Alignment, AnalyticsBreakdownRowSchema, AnalyticsBreakdownTabSchema, AnalyticsBreakdownWidgetSchema, AnyActionSchema, AnyPaginationSchema, AppendingPaginationSchema, Attributes, BaseColumnSchema, BaseComponent, BaseEntry, BaseField, BaseWidgetSchema, BreadcrumbSchema, Breakpoint, Breakpoints, BuilderBlockSchema, BuilderItemSchema, BuilderItemState, BuilderSchema, BulkToggleActionSchema, COMMANDS_COMPONENT, CalendarChangeResult, CalendarEventSchema, CalendarView, CalendarWidgetSchema, CalloutSchema, CellSchema, ChartEmptyStateSchema, ChartFiltersFormSchema, ChartWidgetSchema, CheckboxColumnSchema, CheckboxListSchema, CheckboxSchema, CmsAdminBarSchema, CmsAlternateSchema, CmsAspectRatio, CmsAutosaveResult, CmsBlockSchema, CmsBreadcrumbSchema, CmsBuiltInBlocks, CmsCallToActionBlockData, CmsColumnsBlockData, CmsEditorStatusSchema, CmsEmbedBlockData, CmsFaqBlockData, CmsFeatureSchema, CmsFeaturesBlockData, CmsFormBlockData, CmsGalleryBlockData, CmsHeroBlockData, CmsImageBlockData, CmsImageSchema, CmsLinkSchema, CmsLivePreviewSchema, CmsMenuItemSchema, CmsMenuSchema, CmsPageProps, CmsPageSchema, CmsPayload, CmsRichTextBlockData, CmsSectionBlockData, CmsSeoSchema, CmsSiteSchema, CmsTestimonialSchema, CmsTestimonialsBlockData, CodeEditorSchema, CodeEntrySchema, Color, ColorColumnSchema, ColorEntrySchema, ColorPickerSchema, ColumnGroupSchema, ColumnLayoutColumnRef, ColumnLayoutNode, ColumnLayoutSchema, ColumnSchema, ColumnSpanValue, ColumnSummariesSchema, CommandPaletteLinkSchema, CommandPaletteResponse, CommandPaletteSchema, CommandSchema, ConflictsSchema, ContainerBreakpoint, ContentBlock, ContentSlotItem, ContentSlotName, ContentSlotSchema, ContentSlots, CursorPaginationSchema, CustomWidgetSchema, DashboardCustomizeSchema, DashboardLayoutEntry, DashboardLibraryWidget, DashboardSpanOption, DatabaseNotificationsResponse, DatePickerSchema, DebugClosure, DebugDeprecation, DebugNode, DebugSchema, DebugServerTimings, DefaultActionSchema, DeferredBadgeSchema, DeferredTabBadges, DevToolsClass, DevToolsContext, DevToolsSchema, EditableColumnSchema, EmptyStateComponentSchema, EmptyStateSchema, EntrySchema, ErrorNotificationEntrySchema, ErrorNotificationsSchema, FIELD_TYPES, FieldActionResponse, FieldActions, FieldSchema, FieldsetSchema, FileManagerActionNames, FileManagerBreadcrumbSchema, FileManagerDetailsSchema, FileManagerEntrySchema, FileManagerFolderSchema, FileManagerKind, FileManagerLinkSchema, FileManagerListingSchema, FileManagerPermissionsSchema, FileManagerPickedFileSchema, FileManagerPickerSchema, FileManagerPreviewSchema, FileManagerResult, FileManagerSchema, FileUploadImageEditorSchema, FileUploadPositions, FileUploadSchema, FilterIndicator, FilterSchema, FiltersFormWidth, FlexSchema, FormBlock, FormPayload, FormattedStateProps, FusedGroupSchema, GlobalSearchGroupSchema, GlobalSearchResultSchema, GridLayoutSchema, GridSchema, GroupSchema, HelpdeskActivity, HelpdeskAttachment, HelpdeskBadge, HelpdeskChatConfig, HelpdeskChatConversation, HelpdeskChatMessage, HelpdeskChatResponse, HelpdeskInboxList, HelpdeskInboxSchema, HelpdeskMessage, HelpdeskSla, HelpdeskTicket, HelpdeskTicketSummary, HelpdeskView, HiddenSchema, HtmlSchema, IconCellItem, IconColumnSchema, IconEntrySchema, IconName, IconPickerOption, IconPickerResponse, IconPickerSchema, IconPickerSetSchema, IconPosition, IconSchema, ImageCellSchema, ImageColumnSchema, ImageEntrySchema, ImageSchema, ImageStackProps, ImpersonationSchema, InfolistBlock, ItemActionName, ItemActionSchema, ItemActionsItemProps, ItemActionsProps, ItemActionsSchema, KanbanAssigneeSchema, KanbanBadgeSchema, KanbanCardSchema, KanbanColumnSchema, KanbanFetchResult, KanbanFiltersSchema, KanbanLaneSchema, KanbanMoveResult, KanbanSchema, KanbanWidgetSchema, KeyValueEntrySchema, KeyValueSchema, KeyboardShortcutsSchema, LanguageSwitcherPosition, LayoutSchema, LazyRelationManagerSchema, LazyWidgetSchema, LinksBlock, ListTabSchema, ListTabsProps, LiveConfig, LiveUpdatesSchema, LocaleSchema, LocalizationSchema, MenuItemSchema, ModalTableSelectResponse, ModalTableSelectSchema, MoneyInputSchema, NavigationBadgeSchema, NavigationGroupSchema, NavigationItemSchema, NavigationStateSchema, NotificationActionSchema, NotificationSchema, NotificationUndoSchema, OneTimeCodeInputSchema, Operation, Option, OptionGroup, OptionOrGroup, OptionsGridDirection, PageLayout, PageSchema, PaginationSchema, PanelDesignSchema, PanelEndpoints, PanelLayoutSchema, PanelSchema, PanelThemeSchema, PanelUserSchema, PartialFormPayload, PlaceholderSchema, PolledComponents, PresenceSchema, PresenceState, PwaPushSchema, PwaSchema, QueryBuilderConstraintRule, QueryBuilderConstraintSchema, QueryBuilderGroup, QueryBuilderGroupRule, QueryBuilderInput, QueryBuilderOperatorSchema, QueryBuilderRule, QueryBuilderRulesSchema, RadioSchema, RealtimeSchema, RecordKey, RecordVersionChangeSchema, RecordVersionSchema, RecordVersionsSchema, RelationGroupSchema, RelationManagerSchema, RelationManagersBlock, RelationManagersContentTabSchema, RepeatableEntrySchema, RepeaterItemSchema, RepeaterSchema, RichEditorCustomBlockSchema, RichEditorMentionSchema, RichEditorMergeTagSchema, RichEditorSchema, RichEditorToolSchema, RichEditorToolbarGroupSchema, SchemaBlock, SchemaComponent, SchemaComponentContext, SchemaPatch, SchemaRefreshResponse, SectionSchema, SelectColumnSchema, SelectOptionsResponse, SelectSchema, SimplePaginationSchema, Size, SliderBehavior, SliderNonLinearPoint, SliderPipSchema, SliderSchema, SlotDataValue, SlotItemSchema, SplitLayoutSchema, StackLayoutSchema, StandaloneComponentSchema, StarterKitDashboardWidgetsSchema, StarterKitNavigationSchema, StarterKitWidgetsSchema, StatSchema, StatsOverviewWidgetSchema, StepSchema, StepValidationHaltedResponse, SubNavigationSchema, SummaryValueSchema, TENANT_MENU_COMPONENT, TabSchema, TableBlock, TableColumnSchema, TableDeferredTotalsSchema, TableGroupOptionSchema, TableGroupingSchema, TablePersistedStateKey, TableRecordGroupSchema, TableRecordSchema, TableSchema, TableSortSchema, TableSpreadsheetSchema, TableSummariesSchema, TableSummaryRowSchema, TableTotalsSchema, TableTriggerActionKey, TableTriggerActionSchema, TableTriggerModalSchema, TableViewItemSchema, TableViewsSchema, TableWidgetSchema, TabsSchema, TagsInputSchema, TenantSchema, TextColumnSchema, TextEntrySchema, TextInputColumnSchema, TextInputSchema, TextSchema, TextStyleProps, TextareaSchema, ToastPosition, ToggleButtonsSchema, ToggleColumnSchema, ToggleSchema, TranslatableLocaleSchema, TranslatableSchema, TranslationCellSchema, TranslationFilter, TranslationHistoryEntry, TranslationLocaleSchema, TranslationManagerSchema, TranslationProgressSchema, TranslationRowSchema, TranslationRowsResult, TranslationSaveResult, TranslationSuggestionSchema, TreeNodeSchema, TreeSchema, TreeStructureItem, TreeWidgetSchema, USER_MENU_COMPONENT, UnorderedListSchema, UploadedFile, VerticalAlignment, ViewColumnSchema, ViewEntrySchema, ViewSchema, VirtualizeSchema, WidgetSchema, WidgetsBlock, Width, WizardSchema, isActionGroup, isField, isOptionGroup, isPartialFormPayload, isStandaloneComponent };
|
|
29
|
+
export { ActionGroupSchema, ActionModalCancelledResponse, ActionModalSchema, ActionResultFlash, ActionSchema, ActionVariant, ActionsComponentSchema, Affixes, AiActionStatus, AiConversationSchema, AiCopilotSchema, AiMessageRole, AiMessageSchema, AiProposedActionSchema, AiSetupNoticeSchema, AiStreamSchema, AlfakitPageProps, Alignment, AnalyticsBreakdownRowSchema, AnalyticsBreakdownTabSchema, AnalyticsBreakdownWidgetSchema, AnyActionSchema, AnyPaginationSchema, AppendingPaginationSchema, Attributes, BaseColumnSchema, BaseComponent, BaseEntry, BaseField, BaseWidgetSchema, BreadcrumbSchema, Breakpoint, Breakpoints, BuilderBlockSchema, BuilderItemSchema, BuilderItemState, BuilderSchema, BulkToggleActionSchema, COMMANDS_COMPONENT, CalendarChangeResult, CalendarEventSchema, CalendarView, CalendarWidgetSchema, CalloutSchema, CellSchema, ChartEmptyStateSchema, ChartFiltersFormSchema, ChartWidgetSchema, CheckboxColumnSchema, CheckboxListSchema, CheckboxSchema, CmsAdminBarSchema, CmsAlternateSchema, CmsAspectRatio, CmsAutosaveResult, CmsBlockSchema, CmsBlockStyle, CmsBreadcrumbSchema, CmsBuiltInBlocks, CmsCallToActionBlockData, CmsColumnsBlockData, CmsEditorStatusSchema, CmsEmbedBlockData, CmsFaqBlockData, CmsFeatureSchema, CmsFeaturesBlockData, CmsFormBlockData, CmsGalleryBlockData, CmsHeroBlockData, CmsImageBlockData, CmsImageSchema, CmsLinkSchema, CmsLivePreviewSchema, CmsMenuItemSchema, CmsMenuSchema, CmsPageProps, CmsPageSchema, CmsPayload, CmsRichTextBlockData, CmsSectionBlockData, CmsSeoSchema, CmsSiteDesign, CmsSiteSchema, CmsTestimonialSchema, CmsTestimonialsBlockData, CodeEditorSchema, CodeEntrySchema, Color, ColorColumnSchema, ColorEntrySchema, ColorPickerSchema, ColumnGroupSchema, ColumnLayoutColumnRef, ColumnLayoutNode, ColumnLayoutSchema, ColumnSchema, ColumnSpanValue, ColumnSummariesSchema, CommandPaletteLinkSchema, CommandPaletteResponse, CommandPaletteSchema, CommandSchema, ConflictsSchema, ContainerBreakpoint, ContentBlock, ContentSlotItem, ContentSlotName, ContentSlotSchema, ContentSlots, CursorPaginationSchema, CustomWidgetSchema, DashboardCustomizeSchema, DashboardLayoutEntry, DashboardLibraryWidget, DashboardSpanOption, DatabaseNotificationsResponse, DatePickerSchema, DebugClosure, DebugDeprecation, DebugNode, DebugSchema, DebugServerTimings, DefaultActionSchema, DeferredBadgeSchema, DeferredTabBadges, DevToolsClass, DevToolsContext, DevToolsSchema, EditableColumnSchema, EmptyStateComponentSchema, EmptyStateSchema, EntrySchema, ErrorNotificationEntrySchema, ErrorNotificationsSchema, FIELD_TYPES, FieldActionResponse, FieldActions, FieldSchema, FieldsetSchema, FileManagerActionNames, FileManagerBreadcrumbSchema, FileManagerDetailsSchema, FileManagerEntrySchema, FileManagerFolderSchema, FileManagerKind, FileManagerLinkSchema, FileManagerListingSchema, FileManagerPermissionsSchema, FileManagerPickedFileSchema, FileManagerPickerSchema, FileManagerPreviewSchema, FileManagerResult, FileManagerSchema, FileUploadImageEditorSchema, FileUploadPositions, FileUploadSchema, FilterIndicator, FilterSchema, FiltersFormWidth, FlexSchema, FormBlock, FormPayload, FormattedStateProps, FusedGroupSchema, GlobalSearchGroupSchema, GlobalSearchResultSchema, GridLayoutSchema, GridSchema, GroupSchema, HelpdeskActivity, HelpdeskAttachment, HelpdeskBadge, HelpdeskChatConfig, HelpdeskChatConversation, HelpdeskChatMessage, HelpdeskChatResponse, HelpdeskInboxList, HelpdeskInboxSchema, HelpdeskMessage, HelpdeskSla, HelpdeskTicket, HelpdeskTicketSummary, HelpdeskView, HiddenSchema, HtmlSchema, IconCellItem, IconColumnSchema, IconEntrySchema, IconName, IconPickerOption, IconPickerResponse, IconPickerSchema, IconPickerSetSchema, IconPosition, IconSchema, ImageCellSchema, ImageColumnSchema, ImageEntrySchema, ImageSchema, ImageStackProps, ImpersonationSchema, InfolistBlock, ItemActionName, ItemActionSchema, ItemActionsItemProps, ItemActionsProps, ItemActionsSchema, KanbanAssigneeSchema, KanbanBadgeSchema, KanbanCardSchema, KanbanColumnSchema, KanbanFetchResult, KanbanFiltersSchema, KanbanLaneSchema, KanbanMoveResult, KanbanSchema, KanbanWidgetSchema, KeyValueEntrySchema, KeyValueSchema, KeyboardShortcutsSchema, LanguageSwitcherPosition, LayoutSchema, LazyRelationManagerSchema, LazyWidgetSchema, LinksBlock, ListTabSchema, ListTabsProps, LiveConfig, LiveUpdatesSchema, LocaleSchema, LocalizationSchema, MenuItemSchema, ModalTableSelectResponse, ModalTableSelectSchema, MoneyInputSchema, NavigationBadgeSchema, NavigationGroupSchema, NavigationItemSchema, NavigationStateSchema, NotificationActionSchema, NotificationSchema, NotificationUndoSchema, OneTimeCodeInputSchema, Operation, Option, OptionGroup, OptionOrGroup, OptionsGridDirection, PageLayout, PageSchema, PaginationSchema, PanelDesignSchema, PanelEndpoints, PanelLayoutSchema, PanelSchema, PanelThemeSchema, PanelUserSchema, PartialFormPayload, PlaceholderSchema, PolledComponents, PresenceSchema, PresenceState, PwaPushSchema, PwaSchema, QueryBuilderConstraintRule, QueryBuilderConstraintSchema, QueryBuilderGroup, QueryBuilderGroupRule, QueryBuilderInput, QueryBuilderOperatorSchema, QueryBuilderRule, QueryBuilderRulesSchema, RadioSchema, RealtimeSchema, RecordKey, RecordVersionChangeSchema, RecordVersionSchema, RecordVersionsSchema, RelationGroupSchema, RelationManagerSchema, RelationManagersBlock, RelationManagersContentTabSchema, RepeatableEntrySchema, RepeaterItemSchema, RepeaterSchema, RichEditorCustomBlockSchema, RichEditorMentionSchema, RichEditorMergeTagSchema, RichEditorSchema, RichEditorToolSchema, RichEditorToolbarGroupSchema, SchemaBlock, SchemaComponent, SchemaComponentContext, SchemaPatch, SchemaRefreshResponse, SectionSchema, SelectColumnSchema, SelectOptionsResponse, SelectSchema, SimplePaginationSchema, Size, SliderBehavior, SliderNonLinearPoint, SliderPipSchema, SliderSchema, SlotDataValue, SlotItemSchema, SplitLayoutSchema, StackLayoutSchema, StandaloneComponentSchema, StarterKitDashboardWidgetsSchema, StarterKitNavigationSchema, StarterKitWidgetsSchema, StatSchema, StatsOverviewWidgetSchema, StepSchema, StepValidationHaltedResponse, SubNavigationSchema, SummaryValueSchema, TENANT_MENU_COMPONENT, TabSchema, TableBlock, TableColumnSchema, TableDeferredTotalsSchema, TableGroupOptionSchema, TableGroupingSchema, TablePersistedStateKey, TableRecordGroupSchema, TableRecordSchema, TableSchema, TableSortSchema, TableSpreadsheetSchema, TableSummariesSchema, TableSummaryRowSchema, TableTotalsSchema, TableTriggerActionKey, TableTriggerActionSchema, TableTriggerModalSchema, TableViewItemSchema, TableViewsSchema, TableWidgetSchema, TabsSchema, TagsInputSchema, TenantSchema, TextColumnSchema, TextEntrySchema, TextInputColumnSchema, TextInputSchema, TextSchema, TextStyleProps, TextareaSchema, ToastPosition, ToggleButtonsSchema, ToggleColumnSchema, ToggleSchema, TranslatableLocaleSchema, TranslatableSchema, TranslationCellSchema, TranslationFilter, TranslationHistoryEntry, TranslationLocaleSchema, TranslationManagerSchema, TranslationProgressSchema, TranslationRowSchema, TranslationRowsResult, TranslationSaveResult, TranslationSuggestionSchema, TreeNodeSchema, TreeSchema, TreeStructureItem, TreeWidgetSchema, USER_MENU_COMPONENT, UnorderedListSchema, UploadedFile, VerticalAlignment, ViewColumnSchema, ViewEntrySchema, ViewSchema, VirtualizeSchema, WidgetSchema, WidgetsBlock, Width, WizardSchema, isActionGroup, isField, isOptionGroup, isPartialFormPayload, isStandaloneComponent };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@alfakit/core",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
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)",
|
package/themes.css
CHANGED
|
@@ -1015,3 +1015,95 @@
|
|
|
1015
1015
|
box-shadow: none;
|
|
1016
1016
|
outline: none;
|
|
1017
1017
|
}
|
|
1018
|
+
|
|
1019
|
+
/* ------------------------------------------------------------------ CMS site design */
|
|
1020
|
+
|
|
1021
|
+
/*
|
|
1022
|
+
* Public CMS pages (alfasix/alfakit-cms). **Site design** sets the theme variables on the
|
|
1023
|
+
* document root; these rules apply its fonts and each block's **Style** section
|
|
1024
|
+
* (`data-cms-background`, `data-cms-spacing`, `data-cms-visibility` on
|
|
1025
|
+
* `data-slot="cms-block"`). The page keeps copies of its colours so a coloured block can
|
|
1026
|
+
* swap them for its content.
|
|
1027
|
+
*/
|
|
1028
|
+
[data-slot='cms-page'] {
|
|
1029
|
+
--cms-primary: var(--primary);
|
|
1030
|
+
--cms-on-primary: var(--primary-foreground);
|
|
1031
|
+
--cms-secondary: var(--secondary);
|
|
1032
|
+
--cms-on-secondary: var(--secondary-foreground);
|
|
1033
|
+
font-family: var(--cms-font-body);
|
|
1034
|
+
}
|
|
1035
|
+
|
|
1036
|
+
/* In-page links (`#pricing`) stop below the sticky site header. */
|
|
1037
|
+
[data-slot='cms-page'] [data-slot='cms-block'][id] {
|
|
1038
|
+
scroll-margin-top: 5rem;
|
|
1039
|
+
}
|
|
1040
|
+
|
|
1041
|
+
[data-slot='cms-page'] :is(h1, h2, h3, h4, h5, h6) {
|
|
1042
|
+
font-family: var(--cms-font-heading, var(--cms-font-body));
|
|
1043
|
+
}
|
|
1044
|
+
|
|
1045
|
+
[data-slot='cms-block'][data-cms-background] {
|
|
1046
|
+
background-color: var(--background);
|
|
1047
|
+
color: var(--foreground);
|
|
1048
|
+
}
|
|
1049
|
+
|
|
1050
|
+
[data-slot='cms-block'][data-cms-background='muted'] {
|
|
1051
|
+
--background: var(--muted);
|
|
1052
|
+
}
|
|
1053
|
+
|
|
1054
|
+
[data-slot='cms-block'][data-cms-background='primary'],
|
|
1055
|
+
[data-slot='cms-block'][data-cms-background='secondary'],
|
|
1056
|
+
[data-slot='cms-block'][data-cms-background='dark'] {
|
|
1057
|
+
--muted: color-mix(in oklab, var(--foreground) 10%, var(--background));
|
|
1058
|
+
--muted-foreground: color-mix(in oklab, var(--foreground) 80%, var(--background));
|
|
1059
|
+
--border: color-mix(in oklab, var(--foreground) 22%, var(--background));
|
|
1060
|
+
--card: color-mix(in oklab, var(--foreground) 7%, var(--background));
|
|
1061
|
+
--card-foreground: var(--foreground);
|
|
1062
|
+
}
|
|
1063
|
+
|
|
1064
|
+
[data-slot='cms-block'][data-cms-background='primary'] {
|
|
1065
|
+
--background: var(--cms-primary);
|
|
1066
|
+
--foreground: var(--cms-on-primary);
|
|
1067
|
+
--primary: var(--cms-on-primary);
|
|
1068
|
+
--primary-foreground: var(--cms-primary);
|
|
1069
|
+
}
|
|
1070
|
+
|
|
1071
|
+
[data-slot='cms-block'][data-cms-background='secondary'] {
|
|
1072
|
+
--background: var(--cms-secondary);
|
|
1073
|
+
--foreground: var(--cms-on-secondary);
|
|
1074
|
+
}
|
|
1075
|
+
|
|
1076
|
+
[data-slot='cms-block'][data-cms-background='dark'] {
|
|
1077
|
+
--background: oklch(0.205 0 0);
|
|
1078
|
+
--foreground: oklch(0.985 0 0);
|
|
1079
|
+
}
|
|
1080
|
+
|
|
1081
|
+
[data-slot='cms-block'][data-cms-spacing='none'] > * {
|
|
1082
|
+
padding-block: 0;
|
|
1083
|
+
}
|
|
1084
|
+
|
|
1085
|
+
[data-slot='cms-block'][data-cms-spacing='small'] > * {
|
|
1086
|
+
padding-block: 1.5rem;
|
|
1087
|
+
}
|
|
1088
|
+
|
|
1089
|
+
[data-slot='cms-block'][data-cms-spacing='large'] > * {
|
|
1090
|
+
padding-block: 6rem;
|
|
1091
|
+
}
|
|
1092
|
+
|
|
1093
|
+
@media (min-width: 640px) {
|
|
1094
|
+
[data-slot='cms-block'][data-cms-spacing='large'] > * {
|
|
1095
|
+
padding-block: 8rem;
|
|
1096
|
+
}
|
|
1097
|
+
}
|
|
1098
|
+
|
|
1099
|
+
@media (max-width: 767.98px) {
|
|
1100
|
+
[data-slot='cms-block'][data-cms-visibility='desktop'] {
|
|
1101
|
+
display: none;
|
|
1102
|
+
}
|
|
1103
|
+
}
|
|
1104
|
+
|
|
1105
|
+
@media (min-width: 768px) {
|
|
1106
|
+
[data-slot='cms-block'][data-cms-visibility='mobile'] {
|
|
1107
|
+
display: none;
|
|
1108
|
+
}
|
|
1109
|
+
}
|