@aglyn/plugins-mui 1.0.0-beta.244 → 1.0.0-beta.247

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.
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../../../libs/plugins/mui/src/lib/components/form-controls.tsx"],"sourcesContent":["/**\n * @license\n * Copyright 2026 Aglyn LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport * as Aglyn from '@aglyn/aglyn'\nimport {\n mdiCheckboxMarkedOutline,\n mdiFormDropdown,\n mdiFormTextbox,\n mdiFormatText,\n mdiRadioboxMarked,\n mdiStarOutline,\n mdiTextShort,\n mdiTagOutline,\n mdiFormSelect,\n} from '@aglyn/shared-data-mdi'\nimport Checkbox, { type CheckboxProps } from '@mui/material/Checkbox'\nimport FormControl, { type FormControlProps } from '@mui/material/FormControl'\nimport FormControlLabel from '@mui/material/FormControlLabel'\nimport FormHelperText, {\n type FormHelperTextProps,\n} from '@mui/material/FormHelperText'\nimport FilledInput from '@mui/material/FilledInput'\nimport FormLabel, { type FormLabelProps } from '@mui/material/FormLabel'\nimport NativeSelect from '@mui/material/NativeSelect'\nimport OutlinedInput from '@mui/material/OutlinedInput'\nimport Radio, { type RadioProps } from '@mui/material/Radio'\nimport RadioGroup, { type RadioGroupProps } from '@mui/material/RadioGroup'\nimport Rating, { type RatingProps } from '@mui/material/Rating'\nimport {\n alpha,\n type SxProps,\n type Theme,\n useTheme,\n} from '@mui/material/styles'\nimport {\n createContext,\n forwardRef,\n type ReactNode,\n useContext,\n useId,\n} from 'react'\nimport { BUNDLE_ID } from '../constants/bundle-common'\nimport { FIELD_TEXT_CONTENT } from '../constants/field-presets'\nimport { dropClearedProps } from '../utils/drop-cleared-props'\nimport { generatePresetId } from '../utils/generate-preset-id'\n\n/*\n * MUI's FORM ELEMENTS, ONE BESIGNER ELEMENT EACH.\n *\n * A field is not one element: it is a Form Control holding a label, an input\n * and a line of help text, exactly as MUI builds it. Each piece is placed,\n * selected and styled on its own — a label's color, an input's fill and\n * corners, the help text's size — with the ordinary Styles panel, and the\n * presets at the bottom of this file are just ready-made arrangements of\n * them. Nothing here knows about forms submitting: an input carries a NAME,\n * and whatever form it sits in sends what the browser sends.\n *\n * Component ids are persisted in documents; never rename them.\n */\nexport const FORM_CONTROL_ID: Aglyn.ComponentId = 'muiFormControl'\nexport const FORM_LABEL_ID: Aglyn.ComponentId = 'muiFormLabel'\nexport const INPUT_ID: Aglyn.ComponentId = 'muiInput'\nexport const FORM_HELPER_TEXT_ID: Aglyn.ComponentId = 'muiFormHelperText'\nexport const SELECT_ID: Aglyn.ComponentId = 'muiSelect'\nexport const SELECT_OPTION_ID: Aglyn.ComponentId = 'muiSelectOption'\nexport const CHECKBOX_ID: Aglyn.ComponentId = 'muiCheckbox'\nexport const RADIO_GROUP_ID: Aglyn.ComponentId = 'muiRadioGroup'\nexport const RADIO_ID: Aglyn.ComponentId = 'muiRadio'\nexport const CHOICE_LABEL_ID: Aglyn.ComponentId = 'muiFormControlLabel'\nexport const RATING_ID: Aglyn.ComponentId = 'muiRating'\n\n/**\n * The id a Form Control gives the input inside it, so the Form Label beside\n * that input names it (`for=`) without the author wiring anything.\n */\nconst FieldIdContext = createContext<string | undefined>(undefined)\n\nexport interface AglynFormControlProps extends FormControlProps {\n children?: ReactNode\n}\n\n/** A field's frame: label, input and help text together. */\nexport const AglynFormControl = forwardRef<HTMLDivElement, AglynFormControlProps>(\n (props, ref) => {\n const id = `field-${useId().replace(/:/g, '')}`\n return (\n <FieldIdContext.Provider value={id}>\n <FormControl ref={ref} {...dropClearedProps(props)} />\n </FieldIdContext.Provider>\n )\n },\n)\nAglynFormControl.displayName = 'AglynFormControl'\n\n/** The label above an input, linked to it by the Form Control. */\nexport const AglynFormLabel = forwardRef<HTMLLabelElement, FormLabelProps>(\n (props, ref) => {\n const id = useContext(FieldIdContext)\n return (\n <FormLabel\n ref={ref as never}\n component=\"label\"\n {...(id ? { htmlFor: id } : {})}\n {...dropClearedProps(props)}\n />\n )\n },\n)\nAglynFormLabel.displayName = 'AglynFormLabel'\n\nexport interface AglynInputProps {\n /** What the answer is sent as. */\n name?: string\n type?: 'text' | 'email' | 'tel' | 'url' | 'number'\n /** Several lines (a message box) instead of one. */\n multiline?: boolean\n /** Lines a multi-line input starts at. */\n minRows?: number\n placeholder?: string\n required?: boolean\n /**\n * A name for assistive technology when no Form Label sits beside the\n * input — a sign-up row with only a placeholder, for one.\n */\n ariaLabel?: string\n fullWidth?: boolean\n [key: string]: any\n}\n\n/**\n * The outline an Input or Select draws, ON ITS OWN BOX.\n *\n * MUI paints an outlined input's border with an inner `<fieldset>`, so the\n * Styles panel's Border Color, Border and Corner Radius — which reach the\n * element's own box — would change nothing a visitor can see. Hiding that\n * fieldset and drawing the same outline (MUI's resting, hover, focus and\n * error colors) on the box itself puts every border and corner field on the\n * outline you actually see. The node's own styles come after, so whatever an\n * author sets wins; focus and error still show through their own rules.\n *\n * The resting outline sits under `:where()`, which weighs nothing, so the\n * site theme's input border color (the Style components card) outranks it,\n * as MUI's own corner radius and the theme's corners already do.\n */\nconst outlinedBoxSx = (theme: Theme) => ({\n '*:where(&)': {\n border: '1px solid',\n borderColor: alpha(theme.palette.text.primary, 0.23),\n },\n '& .MuiOutlinedInput-notchedOutline': { display: 'none' },\n '&:hover': { borderColor: 'text.primary' },\n '&.Mui-focused': {\n borderColor: 'primary.main',\n boxShadow: `0 0 0 1px ${theme.palette.primary.main}`,\n },\n '&.Mui-error': { borderColor: 'error.main' },\n '&.Mui-disabled': { borderColor: 'action.disabled' },\n})\n\n/**\n * Whether the site theme draws inputs filled: the Input style its Style\n * components card sets, which is MUI's own text field default.\n */\nconst useFilledInputs = () =>\n useTheme().components?.MuiTextField?.defaultProps?.variant === 'filled'\n\n/** A node's `sx`, as a list the outline can go in front of. */\nconst nodeSxList = (sx: unknown): SxProps<Theme>[] =>\n sx === undefined || sx === null\n ? []\n : ((Array.isArray(sx) ? sx : [sx]) as SxProps<Theme>[])\n\n/** The box a visitor types in. */\nexport const AglynInput = forwardRef<HTMLDivElement, AglynInputProps>(\n (props, ref) => {\n const {\n name,\n type,\n multiline,\n minRows,\n placeholder,\n required,\n ariaLabel,\n datasetFieldId: _datasetFieldId,\n ...rest\n } = dropClearedProps(props)\n const id = useContext(FieldIdContext)\n const filled = useFilledInputs()\n const inputProps = {\n ...(id ? { id } : {}),\n name: name || undefined,\n type: multiline ? undefined : type || 'text',\n multiline: Boolean(multiline),\n ...(multiline ? { minRows: minRows || 3 } : {}),\n placeholder: placeholder || undefined,\n required: Boolean(required),\n inputProps: ariaLabel ? { 'aria-label': ariaLabel } : undefined,\n }\n if (filled) return <FilledInput ref={ref} {...inputProps} {...rest} />\n return (\n <OutlinedInput\n ref={ref}\n // The label is its own element above the box, so the outline never\n // carries a notch for a floating one.\n notched={false}\n {...inputProps}\n {...rest}\n sx={[outlinedBoxSx, ...nodeSxList(rest['sx'])] as SxProps<Theme>}\n />\n )\n },\n)\nAglynInput.displayName = 'AglynInput'\n\n/** One line of help or guidance under a field. */\nexport const AglynFormHelperText = forwardRef<\n HTMLParagraphElement,\n FormHelperTextProps\n>((props, ref) => <FormHelperText ref={ref} {...dropClearedProps(props)} />)\nAglynFormHelperText.displayName = 'AglynFormHelperText'\n\nexport interface AglynSelectProps {\n name?: string\n required?: boolean\n /** Shown until a choice is made; never sent as an answer. */\n placeholder?: string\n ariaLabel?: string\n fullWidth?: boolean\n size?: 'small' | 'medium'\n children?: ReactNode\n [key: string]: any\n}\n\n/**\n * A dropdown. Its choices are Select Option elements inside it — the\n * browser's own list, so every choice is a real element a page can edit.\n */\nexport const AglynSelect = forwardRef<HTMLDivElement, AglynSelectProps>(\n (props, ref) => {\n const {\n name,\n required,\n placeholder,\n ariaLabel,\n children,\n size,\n datasetFieldId: _datasetFieldId,\n ...rest\n } = dropClearedProps(props)\n const id = useContext(FieldIdContext)\n const filled = useFilledInputs()\n return (\n <NativeSelect\n ref={ref}\n input={\n filled ? (\n <FilledInput size={size} sx={rest['sx']} />\n ) : (\n <OutlinedInput\n notched={false}\n size={size}\n sx={[outlinedBoxSx, ...nodeSxList(rest['sx'])] as SxProps<Theme>}\n />\n )\n }\n defaultValue=\"\"\n inputProps={{\n ...(id ? { id } : {}),\n name: name || undefined,\n required: Boolean(required),\n ...(ariaLabel ? { 'aria-label': ariaLabel } : {}),\n }}\n {...rest}\n // The node's styles ride the outlined box above, where they reach\n // what a visitor sees.\n sx={undefined}\n >\n <option value=\"\" disabled={Boolean(required)}>\n {placeholder || ''}\n </option>\n {children}\n </NativeSelect>\n )\n },\n)\nAglynSelect.displayName = 'AglynSelect'\n\nexport interface AglynSelectOptionProps {\n value?: string\n children?: ReactNode\n}\n\n/** One choice in a Select. */\nexport const AglynSelectOption = forwardRef<\n HTMLOptionElement,\n AglynSelectOptionProps\n>((props, ref) => {\n const { value, children, ...rest } = dropClearedProps(props)\n const text = typeof children === 'string' ? children : ''\n return (\n <option ref={ref} value={value ?? text} {...(rest as object)}>\n {children}\n </option>\n )\n})\nAglynSelectOption.displayName = 'AglynSelectOption'\n\n/**\n * The props an answer element hands MUI: cleared values dropped, and the\n * dataset mapping — authoring data read off the node, never a DOM attribute —\n * taken out.\n */\nfunction withoutMapping<T extends object>(props: T): T {\n const { datasetFieldId: _datasetFieldId, ...rest } = dropClearedProps(\n props as T & { datasetFieldId?: unknown },\n )\n return rest as T\n}\n\n/** A tick box. Put it in a Choice Label to give it words. */\nexport const AglynCheckbox = forwardRef<HTMLButtonElement, CheckboxProps>(\n (props, ref) => <Checkbox ref={ref} {...withoutMapping(props)} />,\n)\nAglynCheckbox.displayName = 'AglynCheckbox'\n\n/** A set of Radio choices sharing one name; one may be picked. */\nexport const AglynRadioGroup = forwardRef<HTMLDivElement, RadioGroupProps>(\n (props, ref) => <RadioGroup ref={ref} {...withoutMapping(props)} />,\n)\nAglynRadioGroup.displayName = 'AglynRadioGroup'\n\n/** One choice in a Radio Group. Put it in a Choice Label to give it words. */\nexport const AglynRadio = forwardRef<HTMLButtonElement, RadioProps>(\n (props, ref) => <Radio ref={ref} {...dropClearedProps(props)} />,\n)\nAglynRadio.displayName = 'AglynRadio'\n\nexport interface AglynChoiceLabelProps {\n /** The words beside the tick box or radio. */\n label?: string\n children?: ReactNode\n [key: string]: any\n}\n\n/**\n * The words beside a Checkbox or Radio, clickable as one with it — MUI's\n * FormControlLabel, holding the control as its child element.\n */\nexport const AglynChoiceLabel = forwardRef<HTMLLabelElement, AglynChoiceLabelProps>(\n (props, ref) => {\n const { label, children, ...rest } = dropClearedProps(props)\n return (\n <FormControlLabel\n ref={ref}\n label={label ?? ''}\n // The control is whatever element the author placed inside; a\n // `display: contents` holder keeps it the label's direct box.\n control={<span style={{ display: 'contents' }}>{children}</span>}\n {...rest}\n />\n )\n },\n)\nAglynChoiceLabel.displayName = 'AglynChoiceLabel'\n\n/** Stars a visitor picks; sends the number chosen. */\nexport const AglynRating = forwardRef<HTMLSpanElement, RatingProps>(\n (props, ref) => <Rating ref={ref} {...withoutMapping(props)} />,\n)\nAglynRating.displayName = 'AglynRating'\n\n// ── Attributes ──────────────────────────────────────────────────────────────\n\nconst FIELD_NAME: Aglyn.AglynAttributeSchema = {\n name: 'name',\n label: 'Field name',\n description:\n 'What the answer is sent as — the key it is stored under in submissions. ' +\n 'Two inputs in one form need two names (radios share their group’s).',\n component: Aglyn.FieldComponentType.TEXT_FIELD,\n}\n/**\n * Which field of the form's dataset this answer is stored under — the same\n * picker the all-in-one Form Field had, listing the fields of the dataset\n * chosen on the Form around it. Stored by id, so renaming the dataset field\n * never breaks the mapping; left empty, the answer matches by name.\n */\nconst FIELD_DATASET_FIELD: Aglyn.AglynAttributeSchema = {\n name: 'datasetFieldId',\n label: 'Maps to schema field',\n description:\n 'The field of the form’s dataset this answer is stored under. Left ' +\n 'empty, it matches a dataset field by its Field name.',\n component: Aglyn.FieldComponentType.DATASET_FIELD_SELECT,\n}\nconst FIELD_INPUT_SIZE: Aglyn.AglynAttributeSchema = {\n name: 'size',\n label: 'Size',\n description: 'Normal is 56px tall; Small is 40px, to sit beside a button.',\n component: Aglyn.FieldComponentType.SELECT,\n options: [\n { value: 'medium', label: 'Normal' },\n { value: 'small', label: 'Small' },\n ],\n}\nconst FIELD_REQUIRED: Aglyn.AglynAttributeSchema = {\n name: 'required',\n label: 'Required?',\n description: 'The form will not send until this is answered.',\n component: Aglyn.FieldComponentType.SWITCH,\n}\nconst FIELD_ARIA_LABEL: Aglyn.AglynAttributeSchema = {\n name: 'ariaLabel',\n label: 'Accessible label',\n description:\n 'Names the input for screen readers when there is no Form Label beside ' +\n 'it. Not shown on the page.',\n component: Aglyn.FieldComponentType.TEXT_FIELD,\n}\nconst FIELD_FULL_WIDTH: Aglyn.AglynAttributeSchema = {\n name: 'fullWidth',\n label: 'Full width?',\n description: 'Fills the width of whatever holds it.',\n component: Aglyn.FieldComponentType.SWITCH,\n}\nconst FIELD_PLACEHOLDER: Aglyn.AglynAttributeSchema = {\n name: 'placeholder',\n label: 'Placeholder',\n description:\n 'A gray hint inside the empty input, such as you@company.com. It is ' +\n 'not a label: it disappears as soon as someone types.',\n component: Aglyn.FieldComponentType.TEXT_FIELD,\n}\nconst FIELD_CHOICE_VALUE: Aglyn.AglynAttributeSchema = {\n name: 'value',\n label: 'Value',\n description: 'What is sent when this is chosen.',\n component: Aglyn.FieldComponentType.TEXT_FIELD,\n}\n\nconst category = Aglyn.ComponentCategory.FORMS\n\nexport const formControlSchema: Aglyn.ComponentSchema<AglynFormControlProps> = {\n $id: FORM_CONTROL_ID,\n pluginId: BUNDLE_ID,\n displayName: 'Form Control',\n description:\n 'One field’s frame: holds a Form Label, an input and Helper Text, and ' +\n 'links the label to the input.',\n category,\n icon: { path: mdiFormTextbox.path, sx: { color: 'info.main' } },\n attributes: [\n FIELD_FULL_WIDTH,\n {\n ...FIELD_REQUIRED,\n description: 'Marks the label with an asterisk. Set Required? on the input too.',\n },\n ],\n}\n\nexport const formLabelSchema: Aglyn.ComponentSchema<FormLabelProps> = {\n $id: FORM_LABEL_ID,\n pluginId: BUNDLE_ID,\n displayName: 'Form Label',\n description: 'The words that name a field, above its input.',\n category,\n icon: { path: mdiTagOutline.path, sx: { color: 'info.main' } },\n flags: { textEditable: Aglyn.FEATURE_FLAG.ENABLED },\n attributes: [FIELD_TEXT_CONTENT],\n}\n\nexport const inputSchema: Aglyn.ComponentSchema<AglynInputProps> = {\n $id: INPUT_ID,\n pluginId: BUNDLE_ID,\n displayName: 'Input',\n description: 'A box a visitor types in: text, email, phone, link or number.',\n category,\n icon: { path: mdiTextShort.path, sx: { color: 'info.main' } },\n flags: { selfClosing: Aglyn.FEATURE_FLAG.ENABLED },\n attributes: [\n FIELD_NAME,\n FIELD_DATASET_FIELD,\n {\n name: 'type',\n label: 'Type',\n description: 'What goes in it. Email, phone and link bring the right phone keyboard.',\n component: Aglyn.FieldComponentType.SELECT,\n options: [\n { value: 'text', label: 'Text' },\n { value: 'email', label: 'Email' },\n { value: 'tel', label: 'Phone' },\n { value: 'url', label: 'Link' },\n { value: 'number', label: 'Number' },\n ],\n },\n FIELD_PLACEHOLDER,\n FIELD_REQUIRED,\n {\n name: 'multiline',\n label: 'Several lines?',\n description: 'A message box instead of a single line.',\n component: Aglyn.FieldComponentType.SWITCH,\n },\n FIELD_INPUT_SIZE,\n FIELD_FULL_WIDTH,\n FIELD_ARIA_LABEL,\n ],\n}\n\nexport const formHelperTextSchema: Aglyn.ComponentSchema<FormHelperTextProps> = {\n $id: FORM_HELPER_TEXT_ID,\n pluginId: BUNDLE_ID,\n displayName: 'Helper Text',\n description: 'A line of guidance under a field.',\n category,\n icon: { path: mdiFormatText.path, sx: { color: 'info.main' } },\n flags: { textEditable: Aglyn.FEATURE_FLAG.ENABLED },\n attributes: [FIELD_TEXT_CONTENT],\n}\n\nexport const selectSchema: Aglyn.ComponentSchema<AglynSelectProps> = {\n $id: SELECT_ID,\n pluginId: BUNDLE_ID,\n displayName: 'Select',\n description: 'A dropdown of Select Options; one may be picked.',\n category,\n icon: { path: mdiFormDropdown.path, sx: { color: 'info.main' } },\n restrictChildren: [\n Aglyn.LinealDirectiveFlag.LIMIT_TO,\n { components: [SELECT_OPTION_ID] },\n ],\n attributes: [\n FIELD_NAME,\n FIELD_DATASET_FIELD,\n { ...FIELD_PLACEHOLDER, description: 'Shown until a choice is made; never sent.' },\n FIELD_REQUIRED,\n FIELD_INPUT_SIZE,\n FIELD_FULL_WIDTH,\n FIELD_ARIA_LABEL,\n ],\n}\n\nexport const selectOptionSchema: Aglyn.ComponentSchema<AglynSelectOptionProps> = {\n $id: SELECT_OPTION_ID,\n pluginId: BUNDLE_ID,\n displayName: 'Select Option',\n description: 'One choice in a Select.',\n category,\n icon: { path: mdiFormSelect.path, sx: { color: 'info.main' } },\n flags: {\n selfClosing: Aglyn.FEATURE_FLAG.ENABLED,\n textEditable: Aglyn.FEATURE_FLAG.ENABLED,\n },\n attributes: [\n FIELD_TEXT_CONTENT,\n { ...FIELD_CHOICE_VALUE, description: 'What is sent. Leave empty to send the text.' },\n ],\n}\n\nexport const checkboxSchema: Aglyn.ComponentSchema<CheckboxProps> = {\n $id: CHECKBOX_ID,\n pluginId: BUNDLE_ID,\n displayName: 'Checkbox',\n description: 'A tick box. Put it in a Choice Label to give it words.',\n category,\n icon: { path: mdiCheckboxMarkedOutline.path, sx: { color: 'info.main' } },\n flags: { selfClosing: Aglyn.FEATURE_FLAG.ENABLED },\n attributes: [\n FIELD_NAME,\n FIELD_DATASET_FIELD,\n { ...FIELD_CHOICE_VALUE, description: 'What is sent when ticked, such as Yes.' },\n FIELD_REQUIRED,\n ],\n}\n\nexport const radioGroupSchema: Aglyn.ComponentSchema<RadioGroupProps> = {\n $id: RADIO_GROUP_ID,\n pluginId: BUNDLE_ID,\n displayName: 'Radio Group',\n description: 'A set of Radio choices; one may be picked.',\n category,\n icon: { path: mdiRadioboxMarked.path, sx: { color: 'info.main' } },\n attributes: [\n FIELD_NAME,\n FIELD_DATASET_FIELD,\n {\n name: 'row',\n label: 'In a row?',\n description: 'Side by side instead of one under another.',\n component: Aglyn.FieldComponentType.SWITCH,\n },\n ],\n}\n\nexport const radioSchema: Aglyn.ComponentSchema<RadioProps> = {\n $id: RADIO_ID,\n pluginId: BUNDLE_ID,\n displayName: 'Radio',\n description: 'One choice in a Radio Group. Put it in a Choice Label to give it words.',\n category,\n icon: { path: mdiRadioboxMarked.path, sx: { color: 'info.main' } },\n flags: { selfClosing: Aglyn.FEATURE_FLAG.ENABLED },\n attributes: [FIELD_CHOICE_VALUE, FIELD_REQUIRED],\n}\n\nexport const choiceLabelSchema: Aglyn.ComponentSchema<AglynChoiceLabelProps> = {\n $id: CHOICE_LABEL_ID,\n pluginId: BUNDLE_ID,\n displayName: 'Choice Label',\n description: 'The words beside a Checkbox or Radio placed inside it; clicking them ticks it.',\n category,\n icon: { path: mdiTagOutline.path, sx: { color: 'info.main' } },\n restrictChildren: [\n Aglyn.LinealDirectiveFlag.LIMIT_TO,\n { components: [CHECKBOX_ID, RADIO_ID] },\n ],\n attributes: [\n {\n name: 'label',\n label: 'Text',\n description: 'The words beside the box.',\n component: Aglyn.FieldComponentType.TEXT_FIELD,\n },\n ],\n}\n\nexport const ratingSchema: Aglyn.ComponentSchema<RatingProps> = {\n $id: RATING_ID,\n pluginId: BUNDLE_ID,\n displayName: 'Rating',\n description: 'Stars a visitor picks; sends the number chosen.',\n category,\n icon: { path: mdiStarOutline.path, sx: { color: 'info.main' } },\n flags: { selfClosing: Aglyn.FEATURE_FLAG.ENABLED },\n attributes: [\n FIELD_NAME,\n FIELD_DATASET_FIELD,\n {\n name: 'max',\n label: 'Stars',\n description: 'How many stars to show.',\n component: Aglyn.FieldComponentType.TEXT_FIELD,\n type: 'number',\n },\n ],\n}\n\n// ── Presets: ready-made arrangements of the pieces above ────────────────────\n\nconst node = (\n componentId: Aglyn.ComponentId,\n props?: Record<string, unknown>,\n nodes?: Aglyn.NodePresetData[],\n sx?: Record<string, unknown>,\n): Aglyn.NodePresetData =>\n ({\n $id: null,\n componentId,\n pluginId: BUNDLE_ID,\n ...(props ? { props } : {}),\n ...(nodes ? { nodes } : {}),\n ...(sx ? { sx } : {}),\n }) as Aglyn.NodePresetData\n\n/** A labelled text field: Form Control › Form Label + Input. */\nexport const textFieldPreset = (\n label: string,\n input: Record<string, unknown>,\n): Aglyn.NodePresetData =>\n node(FORM_CONTROL_ID, { fullWidth: true }, [\n node(FORM_LABEL_ID, { children: label }),\n node(INPUT_ID, { fullWidth: true, ...input }),\n ])\n\nconst preset = (\n $id: string,\n displayName: string,\n description: string,\n icon: string,\n data: Aglyn.NodePresetData,\n): Aglyn.PresetSchema => ({\n $id,\n type: Aglyn.NodeType.PRESET,\n displayName,\n description,\n pluginId: BUNDLE_ID,\n category,\n icon: { path: icon, sx: { color: 'info.main' } },\n data,\n})\n\n/**\n * Each element on its own, so any piece can be inserted by itself — a bare\n * Input beside a Button in a sign-up row, a Form Label above a field the\n * author is assembling, one more Radio in a group. The field presets below\n * are ready-made arrangements of the same pieces.\n */\nconst singleElementPresets: Aglyn.PresetSchema[] = [\n preset(\n generatePresetId(FORM_CONTROL_ID),\n 'Form Control',\n 'An empty field frame: put a Form Label, an input and Helper Text in it.',\n mdiFormTextbox.path,\n node(FORM_CONTROL_ID, { fullWidth: true }),\n ),\n preset(\n generatePresetId(FORM_LABEL_ID),\n 'Form Label',\n 'The words that name a field, above its input.',\n mdiTagOutline.path,\n node(FORM_LABEL_ID, { children: 'Label' }),\n ),\n preset(\n generatePresetId(INPUT_ID),\n 'Input',\n 'A box a visitor types in, on its own.',\n mdiTextShort.path,\n node(INPUT_ID, { name: 'field', placeholder: 'Type here' }),\n ),\n preset(\n generatePresetId(SELECT_ID),\n 'Select',\n 'A dropdown with two options.',\n mdiFormDropdown.path,\n node(SELECT_ID, { name: 'choice', placeholder: 'Choose…' }, [\n node(SELECT_OPTION_ID, { children: 'Option one' }),\n node(SELECT_OPTION_ID, { children: 'Option two' }),\n ]),\n ),\n preset(\n generatePresetId(SELECT_OPTION_ID),\n 'Select Option',\n 'One more choice for a Select.',\n mdiFormSelect.path,\n node(SELECT_OPTION_ID, { children: 'Option' }),\n ),\n preset(\n generatePresetId(RADIO_GROUP_ID),\n 'Radio Group',\n 'A set of Radio choices sharing one Field name.',\n mdiRadioboxMarked.path,\n node(RADIO_GROUP_ID, { name: 'pick' }, [\n node(CHOICE_LABEL_ID, { label: 'First' }, [node(RADIO_ID, { value: 'First' })]),\n node(CHOICE_LABEL_ID, { label: 'Second' }, [node(RADIO_ID, { value: 'Second' })]),\n ]),\n ),\n preset(\n generatePresetId(RADIO_ID),\n 'Radio',\n 'One more choice for a Radio Group, with its words.',\n mdiRadioboxMarked.path,\n node(CHOICE_LABEL_ID, { label: 'Another choice' }, [\n node(RADIO_ID, { value: 'Another choice' }),\n ]),\n ),\n preset(\n generatePresetId(CHOICE_LABEL_ID),\n 'Choice Label',\n 'Words beside a tick box; holds a Checkbox.',\n mdiTagOutline.path,\n node(CHOICE_LABEL_ID, { label: 'Yes, please' }, [\n node(CHECKBOX_ID, { name: 'agree', value: 'Yes' }),\n ]),\n ),\n preset(\n generatePresetId(RATING_ID),\n 'Rating',\n 'Five stars, on their own.',\n mdiStarOutline.path,\n node(RATING_ID, { name: 'rating' }),\n ),\n]\n\nexport const formControlPresets: Aglyn.PresetSchema[] = [\n ...singleElementPresets,\n preset(\n generatePresetId(FORM_CONTROL_ID, 'text'),\n 'Text field',\n 'A label and a one-line input.',\n mdiFormTextbox.path,\n textFieldPreset('Name', { name: 'name' }),\n ),\n preset(\n generatePresetId(FORM_CONTROL_ID, 'email'),\n 'Email field',\n 'A label and an email input.',\n mdiFormTextbox.path,\n textFieldPreset('Email', { name: 'email', type: 'email', required: true }),\n ),\n preset(\n generatePresetId(FORM_CONTROL_ID, 'message'),\n 'Message field',\n 'A label and a several-line input.',\n mdiFormTextbox.path,\n textFieldPreset('Message', { name: 'message', multiline: true, minRows: 4 }),\n ),\n preset(\n generatePresetId(FORM_CONTROL_ID, 'select'),\n 'Dropdown field',\n 'A label and a Select with three options.',\n mdiFormDropdown.path,\n node(FORM_CONTROL_ID, { fullWidth: true }, [\n node(FORM_LABEL_ID, { children: 'Choose one' }),\n node(SELECT_ID, { name: 'choice', fullWidth: true, placeholder: 'Choose…' }, [\n node(SELECT_OPTION_ID, { children: 'Option one' }),\n node(SELECT_OPTION_ID, { children: 'Option two' }),\n node(SELECT_OPTION_ID, { children: 'Option three' }),\n ]),\n ]),\n ),\n preset(\n generatePresetId(FORM_CONTROL_ID, 'radio'),\n 'Radio choice field',\n 'A label and a Radio Group with three choices.',\n mdiRadioboxMarked.path,\n node(FORM_CONTROL_ID, {}, [\n node(FORM_LABEL_ID, { children: 'Pick one' }),\n node(RADIO_GROUP_ID, { name: 'pick' }, [\n node(CHOICE_LABEL_ID, { label: 'First' }, [node(RADIO_ID, { value: 'First' })]),\n node(CHOICE_LABEL_ID, { label: 'Second' }, [node(RADIO_ID, { value: 'Second' })]),\n node(CHOICE_LABEL_ID, { label: 'Third' }, [node(RADIO_ID, { value: 'Third' })]),\n ]),\n ]),\n ),\n preset(\n generatePresetId(FORM_CONTROL_ID, 'checkbox'),\n 'Checkbox',\n 'A tick box with words beside it.',\n mdiCheckboxMarkedOutline.path,\n node(CHOICE_LABEL_ID, { label: 'Yes, please' }, [\n node(CHECKBOX_ID, { name: 'agree', value: 'Yes' }),\n ]),\n ),\n preset(\n generatePresetId(FORM_HELPER_TEXT_ID),\n 'Helper Text',\n 'A line of guidance under a field.',\n mdiFormatText.path,\n node(FORM_HELPER_TEXT_ID, { children: 'We never share your address.' }),\n ),\n preset(\n generatePresetId(FORM_CONTROL_ID, 'rating'),\n 'Rating field',\n 'A label and five stars.',\n mdiStarOutline.path,\n node(FORM_CONTROL_ID, {}, [\n node(FORM_LABEL_ID, { children: 'How did we do?' }),\n node(RATING_ID, { name: 'rating' }),\n ]),\n ),\n]\n"],"names":["Aglyn","mdiCheckboxMarkedOutline","mdiFormDropdown","mdiFormTextbox","mdiFormatText","mdiRadioboxMarked","mdiStarOutline","mdiTextShort","mdiTagOutline","mdiFormSelect","Checkbox","FormControl","FormControlLabel","FormHelperText","FilledInput","FormLabel","NativeSelect","OutlinedInput","Radio","RadioGroup","Rating","alpha","useTheme","createContext","forwardRef","useContext","useId","BUNDLE_ID","FIELD_TEXT_CONTENT","dropClearedProps","generatePresetId","FORM_CONTROL_ID","FORM_LABEL_ID","INPUT_ID","FORM_HELPER_TEXT_ID","SELECT_ID","SELECT_OPTION_ID","CHECKBOX_ID","RADIO_GROUP_ID","RADIO_ID","CHOICE_LABEL_ID","RATING_ID","FieldIdContext","undefined","AglynFormControl","props","ref","id","replace","Provider","value","displayName","AglynFormLabel","component","htmlFor","outlinedBoxSx","theme","border","borderColor","palette","text","primary","display","boxShadow","main","useFilledInputs","components","MuiTextField","defaultProps","variant","nodeSxList","sx","Array","isArray","AglynInput","name","type","multiline","minRows","placeholder","required","ariaLabel","datasetFieldId","_datasetFieldId","rest","filled","inputProps","Boolean","notched","AglynFormHelperText","AglynSelect","children","size","input","defaultValue","option","disabled","AglynSelectOption","withoutMapping","AglynCheckbox","AglynRadioGroup","AglynRadio","AglynChoiceLabel","label","control","span","style","AglynRating","FIELD_NAME","description","FieldComponentType","TEXT_FIELD","FIELD_DATASET_FIELD","DATASET_FIELD_SELECT","FIELD_INPUT_SIZE","SELECT","options","FIELD_REQUIRED","SWITCH","FIELD_ARIA_LABEL","FIELD_FULL_WIDTH","FIELD_PLACEHOLDER","FIELD_CHOICE_VALUE","category","ComponentCategory","FORMS","formControlSchema","$id","pluginId","icon","path","color","attributes","formLabelSchema","flags","textEditable","FEATURE_FLAG","ENABLED","inputSchema","selfClosing","formHelperTextSchema","selectSchema","restrictChildren","LinealDirectiveFlag","LIMIT_TO","selectOptionSchema","checkboxSchema","radioGroupSchema","radioSchema","choiceLabelSchema","ratingSchema","node","componentId","nodes","textFieldPreset","fullWidth","preset","data","NodeType","PRESET","singleElementPresets","formControlPresets"],"mappings":";;;AAAA;;;;;;;;;;;;;;;CAeC,GAED,YAAYA,WAAW,eAAc;AACrC,SACEC,wBAAwB,EACxBC,eAAe,EACfC,cAAc,EACdC,aAAa,EACbC,iBAAiB,EACjBC,cAAc,EACdC,YAAY,EACZC,aAAa,EACbC,aAAa,QACR,yBAAwB;AAC/B,OAAOC,cAAsC,yBAAwB;AACrE,OAAOC,iBAA4C,4BAA2B;AAC9E,OAAOC,sBAAsB,iCAAgC;AAC7D,OAAOC,oBAEA,+BAA8B;AACrC,OAAOC,iBAAiB,4BAA2B;AACnD,OAAOC,eAAwC,0BAAyB;AACxE,OAAOC,kBAAkB,6BAA4B;AACrD,OAAOC,mBAAmB,8BAA6B;AACvD,OAAOC,WAAgC,sBAAqB;AAC5D,OAAOC,gBAA0C,2BAA0B;AAC3E,OAAOC,YAAkC,uBAAsB;AAC/D,SACEC,KAAK,EAGLC,QAAQ,QACH,uBAAsB;AAC7B,SACEC,aAAa,EACbC,UAAU,EAEVC,UAAU,EACVC,KAAK,QACA,QAAO;AACd,SAASC,SAAS,QAAQ,gCAA4B;AACtD,SAASC,kBAAkB,QAAQ,gCAA4B;AAC/D,SAASC,gBAAgB,QAAQ,iCAA6B;AAC9D,SAASC,gBAAgB,QAAQ,iCAA6B;AAE9D;;;;;;;;;;;;CAYC,GACD,OAAO,MAAMC,kBAAqC,iBAAgB;AAClE,OAAO,MAAMC,gBAAmC,eAAc;AAC9D,OAAO,MAAMC,WAA8B,WAAU;AACrD,OAAO,MAAMC,sBAAyC,oBAAmB;AACzE,OAAO,MAAMC,YAA+B,YAAW;AACvD,OAAO,MAAMC,mBAAsC,kBAAiB;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AG;QAC9CgD,KAAKlH,aAAa;YAAEsC,MAAM;YAASzB,OAAO;QAAM;KACjD;IAEH0G,OACE9H,iBAAiBI,sBACjB,eACA,qCACA9B,cAAc8H,IAAI,EAClBqB,KAAKrH,qBAAqB;QAAEyD,UAAU;IAA+B;IAEvEiE,OACE9H,iBAAiBC,iBAAiB,WAClC,gBACA,2BACAzB,eAAe4H,IAAI,EACnBqB,KAAKxH,iBAAiB,CAAC,GAAG;QACxBwH,KAAKvH,eAAe;YAAE2D,UAAU;QAAiB;QACjD4D,KAAK9G,WAAW;YAAEkC,MAAM;QAAS;KAClC;CAEJ,CAAA"}
@@ -94,6 +94,7 @@ export declare const CORE_ELEMENTS: {
94
94
  export declare const list: () => Promise<typeof import("./components/list")>;
95
95
  export declare const listItem: () => Promise<typeof import("./components/list-item")>;
96
96
  export declare const listItemText: () => Promise<typeof import("./components/list-item-text")>;
97
+ export declare const formControls: () => Promise<typeof import("./components/form-controls")>;
97
98
  export declare const blocks: () => Promise<typeof import("./components/blocks")>;
98
99
  export declare const dataTable: () => Promise<typeof import("./components/data-table")>;
99
100
  export declare const collectionEntries: () => Promise<typeof import("./components/collection-entries")>;
@@ -91,6 +91,7 @@ import * as icon from "./components/icon.js";
91
91
  /** The elements a page places less often, each loaded when it is placed. */ export const list = ()=>import("./components/list.js");
92
92
  export const listItem = ()=>import("./components/list-item.js");
93
93
  export const listItemText = ()=>import("./components/list-item-text.js");
94
+ export const formControls = ()=>import("./components/form-controls.js");
94
95
  export const blocks = ()=>import("./components/blocks.js");
95
96
  export const dataTable = ()=>import("./components/data-table.js");
96
97
  // The collection family is one module per element (AGL-3401): a page placing
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../../libs/plugins/mui/src/lib/element-tier.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2026 Aglyn LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport * as appBar from './components/app-bar'\nimport * as toolbar from './components/toolbar'\nimport * as layoutSlot from './components/layout-slot'\nimport * as documentRoot from './components/document-root'\nimport * as section from './components/section'\nimport * as container from './components/container'\nimport * as box from './components/box'\nimport * as stack from './components/stack'\nimport * as grid from './components/grid'\nimport * as paper from './components/paper'\nimport * as typography from './components/typography'\nimport * as inlineText from './components/inline-text'\nimport * as button from './components/button'\nimport * as screenLink from './components/screen-link'\nimport * as linkBox from './components/link-box'\nimport * as image from './components/image'\nimport * as icon from './components/icon'\n\n/**\n * The element tier: how a page's mui elements reach it (AGL-3401).\n *\n * `plugin.ts` imports this module lazily, and every element module is reached\n * through it — the common ones as part of it, the rest by an `import()` written\n * HERE. Where that `import()` is written is the whole point.\n *\n * ## Why not sixty sibling imports\n *\n * Each `import()` is a chunk group, and Turbopack gives each group every\n * module it needs that its PARENT group has not already loaded. Sixty element\n * imports written side by side in `plugin.ts` were sixty siblings: none of\n * them could count on another having loaded `@mui/material/Button`, so the\n * chunker merged a copy of Button, ButtonBase and its ripple, SvgIcon, Paper,\n * Stack, the link helpers and the field presets into group after group. On a\n * production aglyn.com build 30% of the module code a page downloaded was a\n * second-or-later copy (Button eight times, SvgIcon fifteen).\n *\n * No chunking switch fixes that without trading it for requests: turning the\n * merge off removed the copies and cost a page 280 files, which compress\n * worse than the bytes they saved (measured in AGL-3401).\n *\n * ## What this module does instead\n *\n * `CORE_ELEMENTS` are the elements nearly every page places — its frame, its\n * layout, its text, its links, buttons and images. They load together as one\n * chunk, and so do the MUI modules they share. Every other element's\n * `import()` is written below, which makes its group a CHILD of this one:\n * whatever this chunk carries is available to it, so none of it is copied.\n *\n * The price is on either side of that line. A page that places none of the\n * core elements but the frame still downloads them (a six-element page paid\n * 3.7 KB more), and an element outside the core arrives one request later,\n * after this chunk. Moving an element into the core is right when most pages\n * place it; `check:tenant-wire-weight`'s duplication measure is what says\n * whether the copies are coming back.\n *\n * Each core element is held as a module namespace, because the registry reads\n * a component, its schema and its presets off it by export name.\n */\n\nexport const CORE_ELEMENTS = {\n appBar,\n toolbar,\n layoutSlot,\n documentRoot,\n section,\n container,\n box,\n stack,\n grid,\n paper,\n typography,\n inlineText,\n button,\n screenLink,\n linkBox,\n image,\n icon,\n}\n\n/** The elements a page places less often, each loaded when it is placed. */\nexport const list = () => import('./components/list')\nexport const listItem = () => import('./components/list-item')\nexport const listItemText = () => import('./components/list-item-text')\nexport const blocks = () => import('./components/blocks')\nexport const dataTable = () => import('./components/data-table')\n// The collection family is one module per element (AGL-3401): a page placing\n// an entries list does not download the entry body's markdown renderer, the\n// author cards' platform marks or the search box.\nexport const collectionEntries = () => import('./components/collection-entries')\nexport const collectionEntryBody = () =>\n import('./components/collection-entry-body')\nexport const collectionRelated = () => import('./components/collection-related')\nexport const collectionShare = () => import('./components/collection-share')\nexport const collectionEntryMeta = () =>\n import('./components/collection-entry-meta')\nexport const collectionEntryAuthor = () =>\n import('./components/collection-entry-author')\nexport const collectionAuthorProfile = () =>\n import('./components/collection-author-profile')\nexport const collectionCategories = () =>\n import('./components/collection-categories')\nexport const collectionSearch = () => import('./components/collection-search')\nexport const video = () => import('./components/video')\nexport const languageSwitcher = () => import('./components/language-switcher')\nexport const reusableInstance = () => import('./components/reusable-instance')\nexport const navMenu = () => import('./components/nav-menu')\nexport const drawer = () => import('./components/drawer')\nexport const product = () => import('./components/product')\nexport const plugin = () => import('./components/plugin')\nexport const customHtml = () => import('./components/custom-html')\nexport const searchBox = () => import('./components/search-box')\nexport const markdown = () => import('./components/markdown')\nexport const card = () => import('./components/card')\nexport const accordion = () => import('./components/accordion')\nexport const tabs = () => import('./components/tabs')\nexport const imageList = () => import('./components/image-list')\nexport const pagination = () => import('./components/pagination')\nexport const breadcrumbs = () => import('./components/breadcrumbs')\nexport const themeModeSwitcher = () =>\n import('./components/theme-mode-switcher')\n"],"names":["appBar","toolbar","layoutSlot","documentRoot","section","container","box","stack","grid","paper","typography","inlineText","button","screenLink","linkBox","image","icon","CORE_ELEMENTS","list","listItem","listItemText","blocks","dataTable","collectionEntries","collectionEntryBody","collectionRelated","collectionShare","collectionEntryMeta","collectionEntryAuthor","collectionAuthorProfile","collectionCategories","collectionSearch","video","languageSwitcher","reusableInstance","navMenu","drawer","product","plugin","customHtml","searchBox","markdown","card","accordion","tabs","imageList","pagination","breadcrumbs","themeModeSwitcher"],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC,GACD,YAAYA,YAAY,0BAAsB;AAC9C,YAAYC,aAAa,0BAAsB;AAC/C,YAAYC,gBAAgB,8BAA0B;AACtD,YAAYC,kBAAkB,gCAA4B;AAC1D,YAAYC,aAAa,0BAAsB;AAC/C,YAAYC,eAAe,4BAAwB;AACnD,YAAYC,SAAS,sBAAkB;AACvC,YAAYC,WAAW,wBAAoB;AAC3C,YAAYC,UAAU,uBAAmB;AACzC,YAAYC,WAAW,wBAAoB;AAC3C,YAAYC,gBAAgB,6BAAyB;AACrD,YAAYC,gBAAgB,8BAA0B;AACtD,YAAYC,YAAY,yBAAqB;AAC7C,YAAYC,gBAAgB,8BAA0B;AACtD,YAAYC,aAAa,2BAAuB;AAChD,YAAYC,WAAW,wBAAoB;AAC3C,YAAYC,UAAU,uBAAmB;AAEzC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAuCC,GAED,OAAO,MAAMC,gBAAgB;IAC3BjB;IACAC;IACAC;IACAC;IACAC;IACAC;IACAC;IACAC;IACAC;IACAC;IACAC;IACAC;IACAC;IACAC;IACAC;IACAC;IACAC;AACF,EAAC;AAED,0EAA0E,GAC1E,OAAO,MAAME,OAAO,IAAM,MAAM,CAAC,wBAAoB;AACrD,OAAO,MAAMC,WAAW,IAAM,MAAM,CAAC,6BAAyB;AAC9D,OAAO,M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AO,IAAM,MAAM,CAAC,wBAAoB;AACrD,OAAO,MAAMC,YAAY,IAAM,MAAM,CAAC,6BAAyB;AAC/D,OAAO,MAAMC,OAAO,IAAM,MAAM,CAAC,wBAAoB;AACrD,OAAO,MAAMC,YAAY,IAAM,MAAM,CAAC,8BAA0B;AAChE,OAAO,MAAMC,aAAa,IAAM,MAAM,CAAC,8BAA0B;AACjE,OAAO,MAAMC,cAAc,IAAM,MAAM,CAAC,+BAA2B;AACnE,OAAO,MAAMC,oBAAoB,IAC/B,MAAM,CAAC,uCAAmC"}
1
+ {"version":3,"sources":["../../../../../../libs/plugins/mui/src/lib/element-tier.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2026 Aglyn LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport * as appBar from './components/app-bar'\nimport * as toolbar from './components/toolbar'\nimport * as layoutSlot from './components/layout-slot'\nimport * as documentRoot from './components/document-root'\nimport * as section from './components/section'\nimport * as container from './components/container'\nimport * as box from './components/box'\nimport * as stack from './components/stack'\nimport * as grid from './components/grid'\nimport * as paper from './components/paper'\nimport * as typography from './components/typography'\nimport * as inlineText from './components/inline-text'\nimport * as button from './components/button'\nimport * as screenLink from './components/screen-link'\nimport * as linkBox from './components/link-box'\nimport * as image from './components/image'\nimport * as icon from './components/icon'\n\n/**\n * The element tier: how a page's mui elements reach it (AGL-3401).\n *\n * `plugin.ts` imports this module lazily, and every element module is reached\n * through it — the common ones as part of it, the rest by an `import()` written\n * HERE. Where that `import()` is written is the whole point.\n *\n * ## Why not sixty sibling imports\n *\n * Each `import()` is a chunk group, and Turbopack gives each group every\n * module it needs that its PARENT group has not already loaded. Sixty element\n * imports written side by side in `plugin.ts` were sixty siblings: none of\n * them could count on another having loaded `@mui/material/Button`, so the\n * chunker merged a copy of Button, ButtonBase and its ripple, SvgIcon, Paper,\n * Stack, the link helpers and the field presets into group after group. On a\n * production aglyn.com build 30% of the module code a page downloaded was a\n * second-or-later copy (Button eight times, SvgIcon fifteen).\n *\n * No chunking switch fixes that without trading it for requests: turning the\n * merge off removed the copies and cost a page 280 files, which compress\n * worse than the bytes they saved (measured in AGL-3401).\n *\n * ## What this module does instead\n *\n * `CORE_ELEMENTS` are the elements nearly every page places — its frame, its\n * layout, its text, its links, buttons and images. They load together as one\n * chunk, and so do the MUI modules they share. Every other element's\n * `import()` is written below, which makes its group a CHILD of this one:\n * whatever this chunk carries is available to it, so none of it is copied.\n *\n * The price is on either side of that line. A page that places none of the\n * core elements but the frame still downloads them (a six-element page paid\n * 3.7 KB more), and an element outside the core arrives one request later,\n * after this chunk. Moving an element into the core is right when most pages\n * place it; `check:tenant-wire-weight`'s duplication measure is what says\n * whether the copies are coming back.\n *\n * Each core element is held as a module namespace, because the registry reads\n * a component, its schema and its presets off it by export name.\n */\n\nexport const CORE_ELEMENTS = {\n appBar,\n toolbar,\n layoutSlot,\n documentRoot,\n section,\n container,\n box,\n stack,\n grid,\n paper,\n typography,\n inlineText,\n button,\n screenLink,\n linkBox,\n image,\n icon,\n}\n\n/** The elements a page places less often, each loaded when it is placed. */\nexport const list = () => import('./components/list')\nexport const listItem = () => import('./components/list-item')\nexport const listItemText = () => import('./components/list-item-text')\nexport const formControls = () => import('./components/form-controls')\nexport const blocks = () => import('./components/blocks')\nexport const dataTable = () => import('./components/data-table')\n// The collection family is one module per element (AGL-3401): a page placing\n// an entries list does not download the entry body's markdown renderer, the\n// author cards' platform marks or the search box.\nexport const collectionEntries = () => import('./components/collection-entries')\nexport const collectionEntryBody = () =>\n import('./components/collection-entry-body')\nexport const collectionRelated = () => import('./components/collection-related')\nexport const collectionShare = () => import('./components/collection-share')\nexport const collectionEntryMeta = () =>\n import('./components/collection-entry-meta')\nexport const collectionEntryAuthor = () =>\n import('./components/collection-entry-author')\nexport const collectionAuthorProfile = () =>\n import('./components/collection-author-profile')\nexport const collectionCategories = () =>\n import('./components/collection-categories')\nexport const collectionSearch = () => import('./components/collection-search')\nexport const video = () => import('./components/video')\nexport const languageSwitcher = () => import('./components/language-switcher')\nexport const reusableInstance = () => import('./components/reusable-instance')\nexport const navMenu = () => import('./components/nav-menu')\nexport const drawer = () => import('./components/drawer')\nexport const product = () => import('./components/product')\nexport const plugin = () => import('./components/plugin')\nexport const customHtml = () => import('./components/custom-html')\nexport const searchBox = () => import('./components/search-box')\nexport const markdown = () => import('./components/markdown')\nexport const card = () => import('./components/card')\nexport const accordion = () => import('./components/accordion')\nexport const tabs = () => import('./components/tabs')\nexport const imageList = () => import('./components/image-list')\nexport const pagination = () => import('./components/pagination')\nexport const breadcrumbs = () => import('./components/breadcrumbs')\nexport const themeModeSwitcher = () =>\n import('./components/theme-mode-switcher')\n"],"names":["appBar","toolbar","layoutSlot","documentRoot","section","container","box","stack","grid","paper","typography","inlineText","button","screenLink","linkBox","image","icon","CORE_ELEMENTS","list","listItem","listItemText","formControls","blocks","dataTable","collectionEntries","collectionEntryBody","collectionRelated","collectionShare","collectionEntryMeta","collectionEntryAuthor","collectionAuthorProfile","collectionCategories","collectionSearch","video","languageSwitcher","reusableInstance","navMenu","drawer","product","plugin","customHtml","searchBox","markdown","card","accordion","tabs","imageList","pagination","breadcrumbs","themeModeSwitcher"],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC,GACD,YAAYA,YAAY,0BAAsB;AAC9C,YAAYC,aAAa,0BAAsB;AAC/C,YAAYC,gBAAgB,8BAA0B;AACtD,YAAYC,kBAAkB,gCAA4B;AAC1D,YAAYC,aAAa,0BAAsB;AAC/C,YAAYC,eAAe,4BAAwB;AACnD,YAAYC,SAAS,sBAAkB;AACvC,YAAYC,WAAW,wBAAoB;AAC3C,YAAYC,UAA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,MAAM,CAAC,yCAAqC;AAC9C,OAAO,MAAMC,mBAAmB,IAAM,MAAM,CAAC,qCAAiC;AAC9E,OAAO,MAAMC,QAAQ,IAAM,MAAM,CAAC,yBAAqB;AACvD,OAAO,MAAMC,mBAAmB,IAAM,MAAM,CAAC,qCAAiC;AAC9E,OAAO,MAAMC,mBAAmB,IAAM,MAAM,CAAC,qCAAiC;AAC9E,OAAO,MAAMC,UAAU,IAAM,MAAM,CAAC,4BAAwB;AAC5D,OAAO,MAAMC,SAAS,IAAM,MAAM,CAAC,0BAAsB;AACzD,OAAO,MAAMC,UAAU,IAAM,MAAM,CAAC,2BAAuB;AAC3D,OAAO,MAAMC,SAAS,IAAM,MAAM,CAAC,0BAAsB;AACzD,OAAO,MAAMC,aAAa,IAAM,MAAM,CAAC,+BAA2B;AAClE,OAAO,MAAMC,YAAY,IAAM,MAAM,CAAC,8BAA0B;AAChE,OAAO,MAAMC,WAAW,IAAM,MAAM,CAAC,4BAAwB;AAC7D,OAAO,MAAMC,OAAO,IAAM,MAAM,CAAC,wBAAoB;AACrD,OAAO,MAAMC,YAAY,IAAM,MAAM,CAAC,6BAAyB;AAC/D,OAAO,MAAMC,OAAO,IAAM,MAAM,CAAC,wBAAoB;AACrD,OAAO,MAAMC,YAAY,IAAM,MAAM,CAAC,8BAA0B;AAChE,OAAO,MAAMC,aAAa,IAAM,MAAM,CAAC,8BAA0B;AACjE,OAAO,MAAMC,cAAc,IAAM,MAAM,CAAC,+BAA2B;AACnE,OAAO,MAAMC,oBAAoB,IAC/B,MAAM,CAAC,uCAAmC"}
package/src/lib/plugin.js CHANGED
@@ -50,6 +50,7 @@ const icon = inTier('icon');
50
50
  const list = viaTier('list');
51
51
  const listItem = viaTier('listItem');
52
52
  const listItemText = viaTier('listItemText');
53
+ const formControls = viaTier('formControls');
53
54
  const blocks = viaTier('blocks');
54
55
  const dataTable = viaTier('dataTable');
55
56
  const collectionEntries = viaTier('collectionEntries');
@@ -154,6 +155,63 @@ const themeModeSwitcher = viaTier('themeModeSwitcher');
154
155
  schema: 'schema',
155
156
  presets: 'presets'
156
157
  },
158
+ // MUI's form elements, one element each (form-controls.tsx).
159
+ muiFormControl: {
160
+ module: formControls,
161
+ component: 'AglynFormControl',
162
+ schema: 'formControlSchema',
163
+ presets: 'formControlPresets'
164
+ },
165
+ muiFormLabel: {
166
+ module: formControls,
167
+ component: 'AglynFormLabel',
168
+ schema: 'formLabelSchema'
169
+ },
170
+ muiInput: {
171
+ module: formControls,
172
+ component: 'AglynInput',
173
+ schema: 'inputSchema'
174
+ },
175
+ muiFormHelperText: {
176
+ module: formControls,
177
+ component: 'AglynFormHelperText',
178
+ schema: 'formHelperTextSchema'
179
+ },
180
+ muiSelect: {
181
+ module: formControls,
182
+ component: 'AglynSelect',
183
+ schema: 'selectSchema'
184
+ },
185
+ muiSelectOption: {
186
+ module: formControls,
187
+ component: 'AglynSelectOption',
188
+ schema: 'selectOptionSchema'
189
+ },
190
+ muiCheckbox: {
191
+ module: formControls,
192
+ component: 'AglynCheckbox',
193
+ schema: 'checkboxSchema'
194
+ },
195
+ muiRadioGroup: {
196
+ module: formControls,
197
+ component: 'AglynRadioGroup',
198
+ schema: 'radioGroupSchema'
199
+ },
200
+ muiRadio: {
201
+ module: formControls,
202
+ component: 'AglynRadio',
203
+ schema: 'radioSchema'
204
+ },
205
+ muiFormControlLabel: {
206
+ module: formControls,
207
+ component: 'AglynChoiceLabel',
208
+ schema: 'choiceLabelSchema'
209
+ },
210
+ muiRating: {
211
+ module: formControls,
212
+ component: 'AglynRating',
213
+ schema: 'ratingSchema'
214
+ },
157
215
  // form, formField moved to @aglyn/plugins-forms (AGL-395).
158
216
  videoEmbed: {
159
217
  module: blocks,
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../../libs/plugins/mui/src/lib/plugin.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2026 Aglyn LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n registerPluginInstallPresetMapper,\n registerPluginInstallPresetsMapper,\n} from '@aglyn/aglyn'\nimport {\n muiPluginInstallToPreset,\n muiPluginInstallToPresets,\n} from './components/plugin-install-presets'\nimport * as Aglyn from '@aglyn/aglyn'\nimport { runInAction } from 'mobx'\nimport { BUNDLE_ID } from './constants/bundle-common'\n\n/**\n * One thunk per component module, named here because several ids share one:\n * `card.tsx` and `accordion.tsx` each export several elements, and a module is\n * imported once however many of its components a surface asks for.\n *\n * Every thunk goes through the element tier (AGL-3401). The common elements\n * are part of it; the rest are `import()`s written inside it, so they can\n * rely on what it loaded instead of each carrying a copy. `element-tier.ts`\n * has the reasoning, and which elements are which.\n */\ntype ElementTier = typeof import('./element-tier')\ntype TierElement = keyof ElementTier['CORE_ELEMENTS']\ntype LazyElement = Exclude<keyof ElementTier, 'CORE_ELEMENTS'>\n\ntype ElementModule = Promise<Record<string, unknown>>\n\n/**\n * One load of the tier, however many thunks ask at once. The bundler shares\n * a module across concurrent imports anyway; a loader that hands out a\n * module while it is still evaluating does not — jiti, which the AI palette\n * and page-axe generators load this bundle through, resolved the second of\n * sixty concurrent imports to the tier's exports before `CORE_ELEMENTS` was\n * assigned.\n */\nlet tierLoad: Promise<ElementTier> | undefined\nconst elementTier = (): Promise<ElementTier> =>\n (tierLoad ??= import('./element-tier'))\nconst inTier =\n (name: TierElement): MuiComponentSource['module'] =>\n () =>\n elementTier().then(\n (tier): Record<string, unknown> => tier.CORE_ELEMENTS[name],\n )\nconst viaTier =\n (name: LazyElement): MuiComponentSource['module'] =>\n () =>\n elementTier().then((tier): ElementModule => tier[name]())\n\nconst appBar = inTier('appBar')\nconst toolbar = inTier('toolbar')\nconst layoutSlot = inTier('layoutSlot')\nconst documentRoot = inTier('documentRoot')\nconst section = inTier('section')\nconst container = inTier('container')\nconst box = inTier('box')\nconst stack = inTier('stack')\nconst grid = inTier('grid')\nconst paper = inTier('paper')\nconst typography = inTier('typography')\nconst inlineText = inTier('inlineText')\nconst button = inTier('button')\nconst screenLink = inTier('screenLink')\nconst linkBox = inTier('linkBox')\nconst image = inTier('image')\nconst icon = inTier('icon')\n\nconst list = viaTier('list')\nconst listItem = viaTier('listItem')\nconst listItemText = viaTier('listItemText')\nconst blocks = viaTier('blocks')\nconst dataTable = viaTier('dataTable')\nconst collectionEntries = viaTier('collectionEntries')\nconst collectionEntryBody = viaTier('collectionEntryBody')\nconst collectionRelated = viaTier('collectionRelated')\nconst collectionShare = viaTier('collectionShare')\nconst collectionEntryMeta = viaTier('collectionEntryMeta')\nconst collectionEntryAuthor = viaTier('collectionEntryAuthor')\nconst collectionAuthorProfile = viaTier('collectionAuthorProfile')\nconst collectionCategories = viaTier('collectionCategories')\nconst collectionSearch = viaTier('collectionSearch')\nconst video = viaTier('video')\nconst languageSwitcher = viaTier('languageSwitcher')\nconst reusableInstance = viaTier('reusableInstance')\nconst navMenu = viaTier('navMenu')\nconst drawer = viaTier('drawer')\nconst product = viaTier('product')\nconst plugin = viaTier('plugin')\nconst customHtml = viaTier('customHtml')\nconst searchBox = viaTier('searchBox')\nconst markdown = viaTier('markdown')\nconst card = viaTier('card')\nconst accordion = viaTier('accordion')\nconst tabs = viaTier('tabs')\nconst imageList = viaTier('imageList')\nconst pagination = viaTier('pagination')\nconst breadcrumbs = viaTier('breadcrumbs')\nconst themeModeSwitcher = viaTier('themeModeSwitcher')\n\n/** One entry of the bundle: what the registry is handed for a component. */\nexport interface MuiBundleEntry {\n component: any\n schema: Aglyn.ComponentSchema<any>\n presets?: Aglyn.PresetSchema[]\n}\n\n/**\n * Where a component id's code lives, and what it is called there (AGL-3141).\n *\n * An id names a module AND an export on it, never a module alone: several\n * modules export more than one element, and the registry needs the component,\n * its schema and — for the element that carries them — its presets by name.\n */\nexport interface MuiComponentSource {\n /** The module, as a thunk, so the bundler gives it a chunk of its own. */\n module: () => Promise<Record<string, unknown>>\n /** The component's export name on that module. */\n component: string\n /** Its schema's export name. */\n schema: string\n /** The export carrying its presets, for the element that ships them. */\n presets?: string\n /**\n * An export that loads what SOME instances of the element render, before\n * any of them does (AGL-3438) — `(everything: boolean) => Promise | void`.\n *\n * For a module the element fetches only when an instance's props ask for\n * it, the way Collection Entries fetches its search box. The element alone\n * knows when a render must not wait for that fetch; `everything` tells it\n * the whole library is loading, which is what the console and the besigner\n * ask for. The bundle is handed over once the load it returns has settled.\n */\n prepare?: string\n}\n\n/**\n * Every component this bundle can register (AGL-140, AGL-3141).\n *\n * One entry per component keeps register/unregister symmetric — the old\n * hand-maintained lists had drifted, and several components were never\n * unregistered on destroy. It replaces a single array built from sixty static\n * imports, which put every element on every published page while the page\n * rendered about nineteen of them.\n *\n * Exported so the bundle is assertable (AGL-1201): duplicate component or\n * preset ids collapse silently inside the registry's keyed records, so they\n * can only be caught before registration.\n */\nexport const MUI_COMPONENT_SOURCES: Readonly<\n Record<string, MuiComponentSource>\n> = {\n muiAppBar: {\n module: appBar,\n component: 'default',\n schema: 'schema',\n presets: 'presets',\n },\n muiToolbar: {\n module: toolbar,\n component: 'default',\n schema: 'schema',\n presets: 'presets',\n },\n muiTypography: {\n module: typography,\n component: 'default',\n schema: 'schema',\n presets: 'presets',\n },\n // The inline text run (AGL-1235): one styled phrase inside a sentence.\n // Typography also holds elements now (AGL-3672), but a run is still the\n // element that flows and wraps as part of the line.\n muiInlineText: {\n module: inlineText,\n component: 'default',\n schema: 'schema',\n presets: 'presets',\n },\n muiButton: {\n module: button,\n component: 'default',\n schema: 'schema',\n presets: 'presets',\n },\n muiContainer: {\n module: container,\n component: 'default',\n schema: 'schema',\n presets: 'presets',\n },\n layoutSlot: {\n module: layoutSlot,\n component: 'default',\n schema: 'schema',\n presets: 'presets',\n },\n muiList: {\n module: list,\n component: 'default',\n schema: 'schema',\n presets: 'presets',\n },\n muiListItem: {\n module: listItem,\n component: 'default',\n schema: 'schema',\n presets: 'presets',\n },\n muiListItemText: {\n module: listItemText,\n component: 'default',\n schema: 'schema',\n presets: 'presets',\n },\n // form, formField moved to @aglyn/plugins-forms (AGL-395).\n videoEmbed: {\n module: blocks,\n component: 'VideoEmbed',\n schema: 'videoEmbedSchema',\n presets: 'blockPresets',\n },\n socialLinks: {\n module: blocks,\n component: 'SocialLinks',\n schema: 'socialLinksSchema',\n },\n // A real data grid (AGL-2543): the feature matrix a comparison page is\n // built around, which the palette had no element for at all.\n dataTable: {\n module: dataTable,\n component: 'default',\n schema: 'dataTableSchema',\n presets: 'dataTablePresets',\n },\n // Content collections (AGL-551/582): entries repeater, markdown entry\n // body, related posts, share bar, entry meta.\n collectionEntries: {\n module: collectionEntries,\n component: 'CollectionEntries',\n schema: 'collectionEntriesSchema',\n presets: 'collectionPresets',\n prepare: 'prepareEntriesSearch',\n },\n collectionEntryBody: {\n module: collectionEntryBody,\n component: 'CollectionEntryBody',\n schema: 'collectionEntryBodySchema',\n },\n collectionRelated: {\n module: collectionRelated,\n component: 'CollectionRelated',\n schema: 'collectionRelatedSchema',\n },\n collectionShare: {\n module: collectionShare,\n component: 'CollectionShare',\n schema: 'collectionShareSchema',\n },\n collectionEntryMeta: {\n module: collectionEntryMeta,\n component: 'CollectionEntryMeta',\n schema: 'collectionEntryMetaSchema',\n },\n // The author card that closes an article (AGL-2486): the byline block\n // prints a name, and the record behind it also has a portrait and a bio.\n collectionEntryAuthor: {\n module: collectionEntryAuthor,\n component: 'CollectionEntryAuthor',\n schema: 'collectionEntryAuthorSchema',\n },\n // The subject of an author's own page (AGL-2518): the same person the\n // card above draws as a footnote, with the role fields it has no room for.\n contentAuthorProfile: {\n module: collectionAuthorProfile,\n component: 'ContentAuthorProfile',\n schema: 'contentAuthorProfileSchema',\n },\n // Category pills (AGL-1321): real anchors to /{collection}/category/{slug}.\n collectionCategories: {\n module: collectionCategories,\n component: 'CollectionCategories',\n schema: 'collectionCategoriesSchema',\n },\n // The toolbar search box (AGL-1516): the entries block's own field cannot\n // leave it, so the frame's pills-left / search-right row needs a block.\n collectionSearch: {\n module: collectionSearch,\n component: 'CollectionSearch',\n schema: 'collectionSearchSchema',\n },\n image: {\n module: image,\n component: 'default',\n schema: 'schema',\n presets: 'presets',\n },\n video: {\n module: video,\n component: 'default',\n schema: 'schema',\n presets: 'presets',\n },\n icon: {\n module: icon,\n component: 'default',\n schema: 'schema',\n presets: 'presets',\n },\n // booking moved to @aglyn/plugins-bookings (AGL-395).\n // eventList moved to @aglyn/plugins-events-calendar (AGL-313).\n languageSwitcher: {\n module: languageSwitcher,\n component: 'default',\n schema: 'schema',\n presets: 'presets',\n },\n reusableInstance: {\n module: reusableInstance,\n component: 'default',\n schema: 'schema',\n presets: 'presets',\n },\n muiScreenLink: {\n module: screenLink,\n component: 'default',\n schema: 'schema',\n presets: 'presets',\n },\n // The linking container (AGL-1231): every other link element is a leaf,\n // so a tile whose icon and description also belong to the target had no\n // way to be authored.\n muiLinkBox: {\n module: linkBox,\n component: 'default',\n schema: 'schema',\n presets: 'presets',\n },\n // Nav menu system (AGL-562): dropdown, mega menu, drawer + menu button.\n muiNavMenu: {\n module: navMenu,\n component: 'default',\n schema: 'navMenuSchema',\n presets: 'navMenuPresets',\n },\n muiMegaMenu: {\n module: navMenu,\n component: 'MegaMenu',\n schema: 'megaMenuSchema',\n },\n muiDrawer: {\n module: drawer,\n component: 'default',\n schema: 'drawerSchema',\n presets: 'drawerPresets',\n },\n muiDrawerToggle: {\n module: drawer,\n component: 'DrawerToggle',\n schema: 'drawerToggleSchema',\n },\n product: {\n module: product,\n component: 'default',\n schema: 'schema',\n presets: 'presets',\n },\n marketplacePlugin: {\n module: plugin,\n component: 'default',\n schema: 'schema',\n presets: 'presets',\n },\n 'custom-html': {\n module: customHtml,\n component: 'default',\n schema: 'schema',\n presets: 'presets',\n },\n searchBox: {\n module: searchBox,\n component: 'default',\n schema: 'schema',\n presets: 'presets',\n },\n // Long-form documents (AGL-1162): one markdown element carrying the whole\n // page, and an \"On this page\" aside derived from its headings.\n markdown: {\n module: markdown,\n component: 'Markdown',\n schema: 'markdownSchema',\n presets: 'markdownPresets',\n },\n tableOfContents: {\n module: markdown,\n component: 'TableOfContents',\n schema: 'tableOfContentsSchema',\n },\n section: {\n module: section,\n component: 'default',\n schema: 'schema',\n presets: 'presets',\n },\n muiStack: {\n module: stack,\n component: 'default',\n schema: 'schema',\n presets: 'presets',\n },\n // Layout & surface primitives (AGL-1201).\n muiBox: {\n module: box,\n component: 'default',\n schema: 'schema',\n presets: 'presets',\n },\n // The canvas ROOT (AGL-2486): registered so the Document layer has a\n // schema — an element picker — instead of falling through to the\n // renderer's unstyled div. No preset: it is not an element anybody drops.\n div: {\n module: documentRoot,\n component: 'default',\n schema: 'schema',\n },\n muiGrid: {\n module: grid,\n component: 'default',\n schema: 'schema',\n presets: 'presets',\n },\n muiPaper: {\n module: paper,\n component: 'default',\n schema: 'schema',\n presets: 'presets',\n },\n muiCard: {\n module: card,\n component: 'default',\n schema: 'cardSchema',\n presets: 'cardPresets',\n },\n muiCardHeader: {\n module: card,\n component: 'CardHeaderElement',\n schema: 'cardHeaderSchema',\n },\n muiCardContent: {\n module: card,\n component: 'CardContentElement',\n schema: 'cardContentSchema',\n },\n muiCardActions: {\n module: card,\n component: 'CardActionsElement',\n schema: 'cardActionsSchema',\n },\n muiAccordion: {\n module: accordion,\n component: 'default',\n schema: 'accordionSchema',\n presets: 'accordionPresets',\n },\n muiAccordionSummary: {\n module: accordion,\n component: 'AccordionSummaryElement',\n schema: 'accordionSummarySchema',\n },\n muiAccordionDetails: {\n module: accordion,\n component: 'AccordionDetailsElement',\n schema: 'accordionDetailsSchema',\n },\n muiTabs: {\n module: tabs,\n component: 'default',\n schema: 'tabsSchema',\n presets: 'tabsPresets',\n },\n muiTabPanel: {\n module: tabs,\n component: 'TabPanelElement',\n schema: 'tabPanelSchema',\n },\n muiImageList: {\n module: imageList,\n component: 'default',\n schema: 'imageListSchema',\n presets: 'imageListPresets',\n },\n muiImageListItem: {\n module: imageList,\n component: 'ImageListItemElement',\n schema: 'imageListItemSchema',\n },\n muiPagination: {\n module: pagination,\n component: 'default',\n schema: 'schema',\n presets: 'presets',\n },\n muiBreadcrumbs: {\n module: breadcrumbs,\n component: 'default',\n schema: 'schema',\n presets: 'presets',\n },\n themeModeSwitcher: {\n module: themeModeSwitcher,\n component: 'default',\n schema: 'schema',\n presets: 'presets',\n },\n}\n\n/**\n * The bundle entries for `componentIds` — every component when none are\n * named, which is what the console and the besigner ask for because their\n * palette shows every element.\n *\n * Both paths go through the same map, so there is one statement of where a\n * component comes from. An id the map does not know is dropped rather than\n * resolved to an undefined component: a page whose document carries an\n * element this bundle does not own is a document for another plugin's\n * element, not a reason to register a blank.\n */\nexport async function loadMuiBundle(\n componentIds?: readonly string[],\n): Promise<MuiBundleEntry[]> {\n const ids = (componentIds ?? Object.keys(MUI_COMPONENT_SOURCES)).filter(\n (id) => id in MUI_COMPONENT_SOURCES,\n )\n // Keyed on the THUNK, so a module that exports several elements is\n // imported once for all the ids that name it rather than once per id.\n const pending = new Map<\n MuiComponentSource['module'],\n Promise<Record<string, unknown>>\n >()\n const modules = await Promise.all(\n ids.map((id) => {\n const source = MUI_COMPONENT_SOURCES[id] as MuiComponentSource\n let load = pending.get(source.module)\n if (!load) {\n load = source.module()\n pending.set(source.module, load)\n }\n return load\n }),\n )\n // Each module's on-demand parts, once per module, before anything renders.\n const everything = componentIds === undefined\n const prepared = new Set<unknown>()\n await Promise.all(\n ids.map((id, index) => {\n const source = MUI_COMPONENT_SOURCES[id] as MuiComponentSource\n const mod = modules[index] as Record<string, unknown>\n if (!source.prepare || prepared.has(mod)) return undefined\n prepared.add(mod)\n const prepare = mod[source.prepare] as\n | ((everything: boolean) => Promise<unknown> | void)\n | undefined\n // A failed fetch is the render's to report, not the registration's:\n // the element asks again when it renders, and a block that still\n // cannot have it fails alone instead of taking the page with it.\n return Promise.resolve(prepare?.(everything)).catch(() => undefined)\n }),\n )\n return ids.map((id, index) => {\n const source = MUI_COMPONENT_SOURCES[id] as MuiComponentSource\n const mod = modules[index] as Record<string, unknown>\n return {\n component: mod[source.component],\n schema: mod[source.schema] as Aglyn.ComponentSchema<any>,\n ...(source.presets\n ? { presets: mod[source.presets] as Aglyn.PresetSchema[] }\n : {}),\n }\n })\n}\n\n/**\n * Every component registered so far, by id.\n *\n * A second page places elements the first did not, and reaches this bundle\n * again with them; the map is what tells the two apart, and what `load` and\n * `destroy` read so a reload registers everything asked for so far and\n * unregistration stays symmetric with registration.\n */\nconst registeredById = new Map<string, MuiBundleEntry>()\n\nfunction registerEntries(entries: readonly MuiBundleEntry[]): void {\n // One mobx transaction (AGL-371): a single observer notification\n // for the whole batch instead of one per component/preset.\n runInAction(() => {\n for (const entry of entries) {\n Aglyn.components.registerComponent(entry.component, entry.schema)\n }\n for (const entry of entries) {\n if (entry.presets?.length) {\n Aglyn.components.registerPreset(entry.presets)\n }\n }\n })\n}\n\n/**\n * Registers the core MUI component library with the `@aglyn/aglyn` global\n * plugin registry (`AglynNodeRenderer`, `Aglyn.canvas`, ...). This is the\n * platform's core component bundle; feature bundles (commerce,\n * events-calendar, email) declare a dependency on it.\n *\n * `use.componentIds` narrows it to the elements the surface places\n * (AGL-3116/AGL-3141), so a published page fetches those modules and no\n * others. A caller that names nothing gets the whole library, which is what\n * the console and the besigner need and what any surface that cannot say\n * what it places must be given: an element whose component never registered\n * renders NOTHING, silently (AGL-52).\n */\nexport async function registerMuiPlugin(use?: Aglyn.PluginUse): Promise<void> {\n // Install→preset mapper (AGL-419): the console's drawer registration\n // consumes it through core, never importing this plugin.\n registerPluginInstallPresetMapper(muiPluginInstallToPreset)\n // Declared canvas elements become their own palette entries (AGL-1031).\n registerPluginInstallPresetsMapper(muiPluginInstallToPresets)\n\n const wanted = (use?.componentIds ?? Object.keys(MUI_COMPONENT_SOURCES))\n .filter((id) => id in MUI_COMPONENT_SOURCES)\n .filter((id) => !registeredById.has(id))\n const existing = Aglyn.plugins.getDependency(BUNDLE_ID)\n if (existing && !wanted.length) return\n\n const entries = wanted.length ? await loadMuiBundle(wanted) : []\n for (const entry of entries) {\n registeredById.set(entry.schema.$id as string, entry)\n }\n\n // The dependency is added even when this page places nothing of it: a\n // feature bundle declares mui as a dependency and stays WAITING — its own\n // components never registering — until mui is in the manager.\n //\n // Re-read after the imports rather than trusting the check above: the\n // manager runs `load()` from `addDependency` synchronously, so the first\n // caller to get here creates the dependency and every later one takes the\n // branch that registers what it added into a bundle already LOADED.\n if (Aglyn.plugins.getDependency(BUNDLE_ID)) {\n if (entries.length) registerEntries(entries)\n return\n }\n\n Aglyn.plugins.addDependency({\n $id: BUNDLE_ID,\n displayName: 'Material UI',\n description: 'Material UI elements',\n title: 'Material UI',\n dependencies: {},\n load(): void {\n registerEntries([...registeredById.values()])\n },\n destroy(): void {\n const entries = [...registeredById.values()]\n runInAction(() => {\n for (const entry of entries) {\n if (entry.presets?.length) {\n Aglyn.components.unregisterPreset(\n entry.presets.map((preset) => preset.$id),\n )\n }\n }\n for (const entry of entries) {\n Aglyn.components.unregisterComponent(entry.schema.$id)\n }\n })\n },\n })\n}\n"],"names":["registerPluginInstallPresetMapper","registerPluginInstallPresetsMapper","muiPluginInstallToPreset","muiPluginInstallToPresets","Aglyn","runInAction","BUNDLE_ID","tierLoad","elementTier","inTier","name","then","tier","CORE_ELEMENTS","viaTier","appBar","toolbar","layoutSlot","documentRoot","section","container","box","stack","grid","paper","typography","inlineText","button","screenLink","linkBox","image","icon","list","listItem","listItemText","blocks","dataTable","collectionEntries","collectionEntryBody","collectionRelated","collectionShare","collectionEntryMeta","collectionEntryAuthor","collectionAuthorProfile","collectionCategories","collectionSearch","video","languageSwitcher","reusableInstance","navMenu","drawer","product","plugin","customHtml","searchBox","markdown","card","accordion","tabs","imageList","pagination","breadcrumbs","themeModeSwitcher","MUI_COMPONENT_SOURCES","muiAppBar","module","component","schema","presets","muiToolbar","muiTypography","muiInlineText","muiButton","muiContainer","muiList","muiListItem","muiListItemText","videoEmbed","socialLinks","prepare","contentAuthorProfile","muiScreenLink","muiLinkBox","muiNavMenu","muiMegaMenu","muiDrawer","muiDrawerToggle","marketplacePlugin","tableOfContents","muiStack","muiBox","div","muiGrid","muiPaper","muiCard","muiCardHeader","muiCardContent","muiCardActions","muiAccordion","muiAccordionSummary","muiAccordionDetails","muiTabs","muiTabPanel","muiImageList","muiImageListItem","muiPagination","muiBreadcrumbs","loadMuiBundle","componentIds","ids","Object","keys","filter","id","pending","Map","modules","Promise","all","map","source","load","get","set","everything","undefined","prepared","Set","index","mod","has","add","resolve","catch","registeredById","registerEntries","entries","entry","components","registerComponent","length","registerPreset","registerMuiPlugin","use","wanted","existing","plugins","getDependency","$id","addDependency","displayName","description","title","dependencies","values","destroy","unregisterPreset","preset","unregisterComponent"],"mappings":";AAAA;;;;;;;;;;;;;;;CAeC,GAED,SACEA,iCAAiC,EACjCC,kCAAkC,QAC7B,eAAc;AACrB,SACEC,wBAAwB,EACxBC,yBAAyB,QACpB,yCAAqC;AAC5C,YAAYC,WAAW,eAAc;AACrC,SAASC,WAAW,QAAQ,OAAM;AAClC,SAASC,SAAS,QAAQ,+BAA2B;AAkBrD;;;;;;;CAOC,GACD,IAAIC;AACJ,MAAMC,cAAc,IACjBD,mBAAAA,WAAAA,WAAa,MAAM,CAAC;AACvB,MAAME,SACJ,CAACC,OACD,IACEF,cAAcG,IAAI,CAChB,CAACC,OAAkCA,KAAKC,aAAa,CAACH,KAAK;AAEjE,MAAMI,UACJ,CAACJ,OACD,IACEF,cAAcG,IAAI,CAAC,CAACC,OAAwBA,IAAI,CAACF,KAAK;AAE1D,MAAMK,SAASN,OAAO;AACtB,MAAMO,UAAUP,OAAO;AACvB,MAAMQ,aAAaR,OAAO;AAC1B,MAAMS,eAAeT,OAAO;AAC5B,MAAMU,UAAUV,OAAO;AACvB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eAAeoB,MAAM;aAAG;YAC5CrJ,YAAY;gBACV,KAAK,MAAMoI,SAASD,QAAS;wBACvBC;oBAAJ,KAAIA,iBAAAA,MAAMrE,OAAO,qBAAbqE,eAAeG,MAAM,EAAE;wBACzBxI,MAAMsI,UAAU,CAACkB,gBAAgB,CAC/BnB,MAAMrE,OAAO,CAACmD,GAAG,CAAC,CAACsC,SAAWA,OAAOT,GAAG;oBAE5C;gBACF;gBACA,KAAK,MAAMX,SAASD,QAAS;oBAC3BpI,MAAMsI,UAAU,CAACoB,mBAAmB,CAACrB,MAAMtE,MAAM,CAACiF,GAAG;gBACvD;YACF;QACF;IACF;AACF"}
1
+ {"version":3,"sources":["../../../../../../libs/plugins/mui/src/lib/plugin.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2026 Aglyn LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n registerPluginInstallPresetMapper,\n registerPluginInstallPresetsMapper,\n} from '@aglyn/aglyn'\nimport {\n muiPluginInstallToPreset,\n muiPluginInstallToPresets,\n} from './components/plugin-install-presets'\nimport * as Aglyn from '@aglyn/aglyn'\nimport { runInAction } from 'mobx'\nimport { BUNDLE_ID } from './constants/bundle-common'\n\n/**\n * One thunk per component module, named here because several ids share one:\n * `card.tsx` and `accordion.tsx` each export several elements, and a module is\n * imported once however many of its components a surface asks for.\n *\n * Every thunk goes through the element tier (AGL-3401). The common elements\n * are part of it; the rest are `import()`s written inside it, so they can\n * rely on what it loaded instead of each carrying a copy. `element-tier.ts`\n * has the reasoning, and which elements are which.\n */\ntype ElementTier = typeof import('./element-tier')\ntype TierElement = keyof ElementTier['CORE_ELEMENTS']\ntype LazyElement = Exclude<keyof ElementTier, 'CORE_ELEMENTS'>\n\ntype ElementModule = Promise<Record<string, unknown>>\n\n/**\n * One load of the tier, however many thunks ask at once. The bundler shares\n * a module across concurrent imports anyway; a loader that hands out a\n * module while it is still evaluating does not — jiti, which the AI palette\n * and page-axe generators load this bundle through, resolved the second of\n * sixty concurrent imports to the tier's exports before `CORE_ELEMENTS` was\n * assigned.\n */\nlet tierLoad: Promise<ElementTier> | undefined\nconst elementTier = (): Promise<ElementTier> =>\n (tierLoad ??= import('./element-tier'))\nconst inTier =\n (name: TierElement): MuiComponentSource['module'] =>\n () =>\n elementTier().then(\n (tier): Record<string, unknown> => tier.CORE_ELEMENTS[name],\n )\nconst viaTier =\n (name: LazyElement): MuiComponentSource['module'] =>\n () =>\n elementTier().then((tier): ElementModule => tier[name]())\n\nconst appBar = inTier('appBar')\nconst toolbar = inTier('toolbar')\nconst layoutSlot = inTier('layoutSlot')\nconst documentRoot = inTier('documentRoot')\nconst section = inTier('section')\nconst container = inTier('container')\nconst box = inTier('box')\nconst stack = inTier('stack')\nconst grid = inTier('grid')\nconst paper = inTier('paper')\nconst typography = inTier('typography')\nconst inlineText = inTier('inlineText')\nconst button = inTier('button')\nconst screenLink = inTier('screenLink')\nconst linkBox = inTier('linkBox')\nconst image = inTier('image')\nconst icon = inTier('icon')\n\nconst list = viaTier('list')\nconst listItem = viaTier('listItem')\nconst listItemText = viaTier('listItemText')\nconst formControls = viaTier('formControls')\nconst blocks = viaTier('blocks')\nconst dataTable = viaTier('dataTable')\nconst collectionEntries = viaTier('collectionEntries')\nconst collectionEntryBody = viaTier('collectionEntryBody')\nconst collectionRelated = viaTier('collectionRelated')\nconst collectionShare = viaTier('collectionShare')\nconst collectionEntryMeta = viaTier('collectionEntryMeta')\nconst collectionEntryAuthor = viaTier('collectionEntryAuthor')\nconst collectionAuthorProfile = viaTier('collectionAuthorProfile')\nconst collectionCategories = viaTier('collectionCategories')\nconst collectionSearch = viaTier('collectionSearch')\nconst video = viaTier('video')\nconst languageSwitcher = viaTier('languageSwitcher')\nconst reusableInstance = viaTier('reusableInstance')\nconst navMenu = viaTier('navMenu')\nconst drawer = viaTier('drawer')\nconst product = viaTier('product')\nconst plugin = viaTier('plugin')\nconst customHtml = viaTier('customHtml')\nconst searchBox = viaTier('searchBox')\nconst markdown = viaTier('markdown')\nconst card = viaTier('card')\nconst accordion = viaTier('accordion')\nconst tabs = viaTier('tabs')\nconst imageList = viaTier('imageList')\nconst pagination = viaTier('pagination')\nconst breadcrumbs = viaTier('breadcrumbs')\nconst themeModeSwitcher = viaTier('themeModeSwitcher')\n\n/** One entry of the bundle: what the registry is handed for a component. */\nexport interface MuiBundleEntry {\n component: any\n schema: Aglyn.ComponentSchema<any>\n presets?: Aglyn.PresetSchema[]\n}\n\n/**\n * Where a component id's code lives, and what it is called there (AGL-3141).\n *\n * An id names a module AND an export on it, never a module alone: several\n * modules export more than one element, and the registry needs the component,\n * its schema and — for the element that carries them — its presets by name.\n */\nexport interface MuiComponentSource {\n /** The module, as a thunk, so the bundler gives it a chunk of its own. */\n module: () => Promise<Record<string, unknown>>\n /** The component's export name on that module. */\n component: string\n /** Its schema's export name. */\n schema: string\n /** The export carrying its presets, for the element that ships them. */\n presets?: string\n /**\n * An export that loads what SOME instances of the element render, before\n * any of them does (AGL-3438) — `(everything: boolean) => Promise | void`.\n *\n * For a module the element fetches only when an instance's props ask for\n * it, the way Collection Entries fetches its search box. The element alone\n * knows when a render must not wait for that fetch; `everything` tells it\n * the whole library is loading, which is what the console and the besigner\n * ask for. The bundle is handed over once the load it returns has settled.\n */\n prepare?: string\n}\n\n/**\n * Every component this bundle can register (AGL-140, AGL-3141).\n *\n * One entry per component keeps register/unregister symmetric — the old\n * hand-maintained lists had drifted, and several components were never\n * unregistered on destroy. It replaces a single array built from sixty static\n * imports, which put every element on every published page while the page\n * rendered about nineteen of them.\n *\n * Exported so the bundle is assertable (AGL-1201): duplicate component or\n * preset ids collapse silently inside the registry's keyed records, so they\n * can only be caught before registration.\n */\nexport const MUI_COMPONENT_SOURCES: Readonly<\n Record<string, MuiComponentSource>\n> = {\n muiAppBar: {\n module: appBar,\n component: 'default',\n schema: 'schema',\n presets: 'presets',\n },\n muiToolbar: {\n module: toolbar,\n component: 'default',\n schema: 'schema',\n presets: 'presets',\n },\n muiTypography: {\n module: typography,\n component: 'default',\n schema: 'schema',\n presets: 'presets',\n },\n // The inline text run (AGL-1235): one styled phrase inside a sentence.\n // Typography also holds elements now (AGL-3672), but a run is still the\n // element that flows and wraps as part of the line.\n muiInlineText: {\n module: inlineText,\n component: 'default',\n schema: 'schema',\n presets: 'presets',\n },\n muiButton: {\n module: button,\n component: 'default',\n schema: 'schema',\n presets: 'presets',\n },\n muiContainer: {\n module: container,\n component: 'default',\n schema: 'schema',\n presets: 'presets',\n },\n layoutSlot: {\n module: layoutSlot,\n component: 'default',\n schema: 'schema',\n presets: 'presets',\n },\n muiList: {\n module: list,\n component: 'default',\n schema: 'schema',\n presets: 'presets',\n },\n muiListItem: {\n module: listItem,\n component: 'default',\n schema: 'schema',\n presets: 'presets',\n },\n muiListItemText: {\n module: listItemText,\n component: 'default',\n schema: 'schema',\n presets: 'presets',\n },\n // MUI's form elements, one element each (form-controls.tsx).\n muiFormControl: {\n module: formControls,\n component: 'AglynFormControl',\n schema: 'formControlSchema',\n presets: 'formControlPresets',\n },\n muiFormLabel: {\n module: formControls,\n component: 'AglynFormLabel',\n schema: 'formLabelSchema',\n },\n muiInput: {\n module: formControls,\n component: 'AglynInput',\n schema: 'inputSchema',\n },\n muiFormHelperText: {\n module: formControls,\n component: 'AglynFormHelperText',\n schema: 'formHelperTextSchema',\n },\n muiSelect: {\n module: formControls,\n component: 'AglynSelect',\n schema: 'selectSchema',\n },\n muiSelectOption: {\n module: formControls,\n component: 'AglynSelectOption',\n schema: 'selectOptionSchema',\n },\n muiCheckbox: {\n module: formControls,\n component: 'AglynCheckbox',\n schema: 'checkboxSchema',\n },\n muiRadioGroup: {\n module: formControls,\n component: 'AglynRadioGroup',\n schema: 'radioGroupSchema',\n },\n muiRadio: {\n module: formControls,\n component: 'AglynRadio',\n schema: 'radioSchema',\n },\n muiFormControlLabel: {\n module: formControls,\n component: 'AglynChoiceLabel',\n schema: 'choiceLabelSchema',\n },\n muiRating: {\n module: formControls,\n component: 'AglynRating',\n schema: 'ratingSchema',\n },\n // form, formField moved to @aglyn/plugins-forms (AGL-395).\n videoEmbed: {\n module: blocks,\n component: 'VideoEmbed',\n schema: 'videoEmbedSchema',\n presets: 'blockPresets',\n },\n socialLinks: {\n module: blocks,\n component: 'SocialLinks',\n schema: 'socialLinksSchema',\n },\n // A real data grid (AGL-2543): the feature matrix a comparison page is\n // built around, which the palette had no element for at all.\n dataTable: {\n module: dataTable,\n component: 'default',\n schema: 'dataTableSchema',\n presets: 'dataTablePresets',\n },\n // Content collections (AGL-551/582): entries repeater, markdown entry\n // body, related posts, share bar, entry meta.\n collectionEntries: {\n module: collectionEntries,\n component: 'CollectionEntries',\n schema: 'collectionEntriesSchema',\n presets: 'collectionPresets',\n prepare: 'prepareEntriesSearch',\n },\n collectionEntryBody: {\n module: collectionEntryBody,\n component: 'CollectionEntryBody',\n schema: 'collectionEntryBodySchema',\n },\n collectionRelated: {\n module: collectionRelated,\n component: 'CollectionRelated',\n schema: 'collectionRelatedSchema',\n },\n collectionShare: {\n module: collectionShare,\n component: 'CollectionShare',\n schema: 'collectionShareSchema',\n },\n collectionEntryMeta: {\n module: collectionEntryMeta,\n component: 'CollectionEntryMeta',\n schema: 'collectionEntryMetaSchema',\n },\n // The author card that closes an article (AGL-2486): the byline block\n // prints a name, and the record behind it also has a portrait and a bio.\n collectionEntryAuthor: {\n module: collectionEntryAuthor,\n component: 'CollectionEntryAuthor',\n schema: 'collectionEntryAuthorSchema',\n },\n // The subject of an author's own page (AGL-2518): the same person the\n // card above draws as a footnote, with the role fields it has no room for.\n contentAuthorProfile: {\n module: collectionAuthorProfile,\n component: 'ContentAuthorProfile',\n schema: 'contentAuthorProfileSchema',\n },\n // Category pills (AGL-1321): real anchors to /{collection}/category/{slug}.\n collectionCategories: {\n module: collectionCategories,\n component: 'CollectionCategories',\n schema: 'collectionCategoriesSchema',\n },\n // The toolbar search box (AGL-1516): the entries block's own field cannot\n // leave it, so the frame's pills-left / search-right row needs a block.\n collectionSearch: {\n module: collectionSearch,\n component: 'CollectionSearch',\n schema: 'collectionSearchSchema',\n },\n image: {\n module: image,\n component: 'default',\n schema: 'schema',\n presets: 'presets',\n },\n video: {\n module: video,\n component: 'default',\n schema: 'schema',\n presets: 'presets',\n },\n icon: {\n module: icon,\n component: 'default',\n schema: 'schema',\n presets: 'presets',\n },\n // booking moved to @aglyn/plugins-bookings (AGL-395).\n // eventList moved to @aglyn/plugins-events-calendar (AGL-313).\n languageSwitcher: {\n module: languageSwitcher,\n component: 'default',\n schema: 'schema',\n presets: 'presets',\n },\n reusableInstance: {\n module: reusableInstance,\n component: 'default',\n schema: 'schema',\n presets: 'presets',\n },\n muiScreenLink: {\n module: screenLink,\n component: 'default',\n schema: 'schema',\n presets: 'presets',\n },\n // The linking container (AGL-1231): every other link element is a leaf,\n // so a tile whose icon and description also belong to the target had no\n // way to be authored.\n muiLinkBox: {\n module: linkBox,\n component: 'default',\n schema: 'schema',\n presets: 'presets',\n },\n // Nav menu system (AGL-562): dropdown, mega menu, drawer + menu button.\n muiNavMenu: {\n module: navMenu,\n component: 'default',\n schema: 'navMenuSchema',\n presets: 'navMenuPresets',\n },\n muiMegaMenu: {\n module: navMenu,\n component: 'MegaMenu',\n schema: 'megaMenuSchema',\n },\n muiDrawer: {\n module: drawer,\n component: 'default',\n schema: 'drawerSchema',\n presets: 'drawerPresets',\n },\n muiDrawerToggle: {\n module: drawer,\n component: 'DrawerToggle',\n schema: 'drawerToggleSchema',\n },\n product: {\n module: product,\n component: 'default',\n schema: 'schema',\n presets: 'presets',\n },\n marketplacePlugin: {\n module: plugin,\n component: 'default',\n schema: 'schema',\n presets: 'presets',\n },\n 'custom-html': {\n module: customHtml,\n component: 'default',\n schema: 'schema',\n presets: 'presets',\n },\n searchBox: {\n module: searchBox,\n component: 'default',\n schema: 'schema',\n presets: 'presets',\n },\n // Long-form documents (AGL-1162): one markdown element carrying the whole\n // page, and an \"On this page\" aside derived from its headings.\n markdown: {\n module: markdown,\n component: 'Markdown',\n schema: 'markdownSchema',\n presets: 'markdownPresets',\n },\n tableOfContents: {\n module: markdown,\n component: 'TableOfContents',\n schema: 'tableOfContentsSchema',\n },\n section: {\n module: section,\n component: 'default',\n schema: 'schema',\n presets: 'presets',\n },\n muiStack: {\n module: stack,\n component: 'default',\n schema: 'schema',\n presets: 'presets',\n },\n // Layout & surface primitives (AGL-1201).\n muiBox: {\n module: box,\n component: 'default',\n schema: 'schema',\n presets: 'presets',\n },\n // The canvas ROOT (AGL-2486): registered so the Document layer has a\n // schema — an element picker — instead of falling through to the\n // renderer's unstyled div. No preset: it is not an element anybody drops.\n div: {\n module: documentRoot,\n component: 'default',\n schema: 'schema',\n },\n muiGrid: {\n module: grid,\n component: 'default',\n schema: 'schema',\n presets: 'presets',\n },\n muiPaper: {\n module: paper,\n component: 'default',\n schema: 'schema',\n presets: 'presets',\n },\n muiCard: {\n module: card,\n component: 'default',\n schema: 'cardSchema',\n presets: 'cardPresets',\n },\n muiCardHeader: {\n module: card,\n component: 'CardHeaderElement',\n schema: 'cardHeaderSchema',\n },\n muiCardContent: {\n module: card,\n component: 'CardContentElement',\n schema: 'cardContentSchema',\n },\n muiCardActions: {\n module: card,\n component: 'CardActionsElement',\n schema: 'cardActionsSchema',\n },\n muiAccordion: {\n module: accordion,\n component: 'default',\n schema: 'accordionSchema',\n presets: 'accordionPresets',\n },\n muiAccordionSummary: {\n module: accordion,\n component: 'AccordionSummaryElement',\n schema: 'accordionSummarySchema',\n },\n muiAccordionDetails: {\n module: accordion,\n component: 'AccordionDetailsElement',\n schema: 'accordionDetailsSchema',\n },\n muiTabs: {\n module: tabs,\n component: 'default',\n schema: 'tabsSchema',\n presets: 'tabsPresets',\n },\n muiTabPanel: {\n module: tabs,\n component: 'TabPanelElement',\n schema: 'tabPanelSchema',\n },\n muiImageList: {\n module: imageList,\n component: 'default',\n schema: 'imageListSchema',\n presets: 'imageListPresets',\n },\n muiImageListItem: {\n module: imageList,\n component: 'ImageListItemElement',\n schema: 'imageListItemSchema',\n },\n muiPagination: {\n module: pagination,\n component: 'default',\n schema: 'schema',\n presets: 'presets',\n },\n muiBreadcrumbs: {\n module: breadcrumbs,\n component: 'default',\n schema: 'schema',\n presets: 'presets',\n },\n themeModeSwitcher: {\n module: themeModeSwitcher,\n component: 'default',\n schema: 'schema',\n presets: 'presets',\n },\n}\n\n/**\n * The bundle entries for `componentIds` — every component when none are\n * named, which is what the console and the besigner ask for because their\n * palette shows every element.\n *\n * Both paths go through the same map, so there is one statement of where a\n * component comes from. An id the map does not know is dropped rather than\n * resolved to an undefined component: a page whose document carries an\n * element this bundle does not own is a document for another plugin's\n * element, not a reason to register a blank.\n */\nexport async function loadMuiBundle(\n componentIds?: readonly string[],\n): Promise<MuiBundleEntry[]> {\n const ids = (componentIds ?? Object.keys(MUI_COMPONENT_SOURCES)).filter(\n (id) => id in MUI_COMPONENT_SOURCES,\n )\n // Keyed on the THUNK, so a module that exports several elements is\n // imported once for all the ids that name it rather than once per id.\n const pending = new Map<\n MuiComponentSource['module'],\n Promise<Record<string, unknown>>\n >()\n const modules = await Promise.all(\n ids.map((id) => {\n const source = MUI_COMPONENT_SOURCES[id] as MuiComponentSource\n let load = pending.get(source.module)\n if (!load) {\n load = source.module()\n pending.set(source.module, load)\n }\n return load\n }),\n )\n // Each module's on-demand parts, once per module, before anything renders.\n const everything = componentIds === undefined\n const prepared = new Set<unknown>()\n await Promise.all(\n ids.map((id, index) => {\n const source = MUI_COMPONENT_SOURCES[id] as MuiComponentSource\n const mod = modules[index] as Record<string, unknown>\n if (!source.prepare || prepared.has(mod)) return undefined\n prepared.add(mod)\n const prepare = mod[source.prepare] as\n | ((everything: boolean) => Promise<unknown> | void)\n | undefined\n // A failed fetch is the render's to report, not the registration's:\n // the element asks again when it renders, and a block that still\n // cannot have it fails alone instead of taking the page with it.\n return Promise.resolve(prepare?.(everything)).catch(() => undefined)\n }),\n )\n return ids.map((id, index) => {\n const source = MUI_COMPONENT_SOURCES[id] as MuiComponentSource\n const mod = modules[index] as Record<string, unknown>\n return {\n component: mod[source.component],\n schema: mod[source.schema] as Aglyn.ComponentSchema<any>,\n ...(source.presets\n ? { presets: mod[source.presets] as Aglyn.PresetSchema[] }\n : {}),\n }\n })\n}\n\n/**\n * Every component registered so far, by id.\n *\n * A second page places elements the first did not, and reaches this bundle\n * again with them; the map is what tells the two apart, and what `load` and\n * `destroy` read so a reload registers everything asked for so far and\n * unregistration stays symmetric with registration.\n */\nconst registeredById = new Map<string, MuiBundleEntry>()\n\nfunction registerEntries(entries: readonly MuiBundleEntry[]): void {\n // One mobx transaction (AGL-371): a single observer notification\n // for the whole batch instead of one per component/preset.\n runInAction(() => {\n for (const entry of entries) {\n Aglyn.components.registerComponent(entry.component, entry.schema)\n }\n for (const entry of entries) {\n if (entry.presets?.length) {\n Aglyn.components.registerPreset(entry.presets)\n }\n }\n })\n}\n\n/**\n * Registers the core MUI component library with the `@aglyn/aglyn` global\n * plugin registry (`AglynNodeRenderer`, `Aglyn.canvas`, ...). This is the\n * platform's core component bundle; feature bundles (commerce,\n * events-calendar, email) declare a dependency on it.\n *\n * `use.componentIds` narrows it to the elements the surface places\n * (AGL-3116/AGL-3141), so a published page fetches those modules and no\n * others. A caller that names nothing gets the whole library, which is what\n * the console and the besigner need and what any surface that cannot say\n * what it places must be given: an element whose component never registered\n * renders NOTHING, silently (AGL-52).\n */\nexport async function registerMuiPlugin(use?: Aglyn.PluginUse): Promise<void> {\n // Install→preset mapper (AGL-419): the console's drawer registration\n // consumes it through core, never importing this plugin.\n registerPluginInstallPresetMapper(muiPluginInstallToPreset)\n // Declared canvas elements become their own palette entries (AGL-1031).\n registerPluginInstallPresetsMapper(muiPluginInstallToPresets)\n\n const wanted = (use?.componentIds ?? Object.keys(MUI_COMPONENT_SOURCES))\n .filter((id) => id in MUI_COMPONENT_SOURCES)\n .filter((id) => !registeredById.has(id))\n const existing = Aglyn.plugins.getDependency(BUNDLE_ID)\n if (existing && !wanted.length) return\n\n const entries = wanted.length ? await loadMuiBundle(wanted) : []\n for (const entry of entries) {\n registeredById.set(entry.schema.$id as string, entry)\n }\n\n // The dependency is added even when this page places nothing of it: a\n // feature bundle declares mui as a dependency and stays WAITING — its own\n // components never registering — until mui is in the manager.\n //\n // Re-read after the imports rather than trusting the check above: the\n // manager runs `load()` from `addDependency` synchronously, so the first\n // caller to get here creates the dependency and every later one takes the\n // branch that registers what it added into a bundle already LOADED.\n if (Aglyn.plugins.getDependency(BUNDLE_ID)) {\n if (entries.length) registerEntries(entries)\n return\n }\n\n Aglyn.plugins.addDependency({\n $id: BUNDLE_ID,\n displayName: 'Material UI',\n description: 'Material UI elements',\n title: 'Material UI',\n dependencies: {},\n load(): void {\n registerEntries([...registeredById.values()])\n },\n destroy(): void {\n const entries = [...registeredById.values()]\n runInAction(() => {\n for (const entry of entries) {\n if (entry.presets?.length) {\n Aglyn.components.unregisterPreset(\n entry.presets.map((preset) => preset.$id),\n )\n }\n }\n for (const entry of entries) {\n Aglyn.components.unregisterComponent(entry.schema.$id)\n }\n })\n },\n })\n}\n"],"names":["registerPluginInstallPresetMapper","registerPluginInstallPresetsMapper","muiPluginInstallToPreset","muiPluginInstallToPresets","Aglyn","runInAction","BUNDLE_ID","tierLoad","elementTier","inTier","name","then","tier","CORE_ELEMENTS","viaTier","appBar","toolbar","layoutSlot","documentRoot","section","container","box","stack","grid","paper","typography","inlineText","button","screenLink","linkBox","image","icon","list","listItem","listItemText","formControls","blocks","dataTable","collectionEntries","collectionEntryBody","collectionRelated","collectionShare","collectionEntryMeta","collectionEntryAuthor","collectionAuthorProfile","collectionCategories","collectionSearch","video","languageSwitcher","reusableInstance","navMenu","drawer","product","plugin","customHtml","searchBox","markdown","card","accordion","tabs","imageList","pagination","breadcrumbs","themeModeSwitcher","MUI_COMPONENT_SOURCES","muiAppBar","module","component","schema","presets","muiToolbar","muiTypography","muiInlineText","muiButton","muiContainer","muiList","muiListItem","muiListItemText","muiFormControl","muiFormLabel","muiInput","muiFormHelperText","muiSelect","muiSelectOption","muiCheckbox","muiRadioGroup","muiRadio","muiFormControlLabel","muiRating","videoEmbed","socialLinks","prepare","contentAuthorProfile","muiScreenLink","muiLinkBox","muiNavMenu","muiMegaMenu","muiDrawer","muiDrawerToggle","marketplacePlugin","tableOfContents","muiStack","muiBox","div","muiGrid","muiPaper","muiCard","muiCardHeader","muiCardContent","muiCardActions","muiAccordion","muiAccordionSummary","muiAccordionDetails","muiTabs","muiTabPanel","muiImageList","muiImageListItem","muiPagination","muiBreadcrumbs","loadMuiBundle","componentIds","ids","Object","keys","filter","id","pending","Map","modules","Promise","all","map","source","load","get","set","everything","undefined","prepared","Set","index","mod","has","add","resolve","catch","registeredById","registerEntries","entries","entry","components","registerComponent","length","registerPreset","registerMuiPlugin","use","wanted","existing","plugins","getDependency","$id","addDependency","displayName","description","title","dependencies","values","destroy","unregisterPreset","preset","unregisterComponent"],"mappings":";AAAA;;;;;;;;;;;;;;;CAeC,GAED,SACEA,iCAAiC,EACjCC,kCAAkC,QAC7B,eAAc;AACrB,SACEC,wBAAwB,EACxBC,yBAAyB,QACpB,yCAAqC;AAC5C,YAAYC,WAAW,eAAc;AACrC,SAASC,WAAW,QAAQ,OAAM;AAClC,SAASC,SAAS,QAAQ,+BAA2B;AAkBrD;;;;;;;CAOC,GACD,IAAIC;AACJ,MAAMC,cAAc,IACjBD,mBAAAA,WAAAA,WAAa,MAAM,CAAC;AACvB,MAAME,SACJ,CAACC,OACD,IACEF,cAAcG,IAAI,CAChB,CAACC,OAAkCA,KAAKC,aAAa,CAACH,KAAK;AAEjE,MAAMI,UACJ,CAACJ,OACD,IACEF,cAAcG,IAAI,CAAC,CA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