@aglyn/plugins-mui 1.0.0-beta.217 → 1.0.0-beta.219

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.
Files changed (62) hide show
  1. package/README.md +2 -1
  2. package/package.json +9 -9
  3. package/src/lib/components/accordion.js +1 -1
  4. package/src/lib/components/accordion.js.map +1 -1
  5. package/src/lib/components/blocks.js +1 -1
  6. package/src/lib/components/blocks.js.map +1 -1
  7. package/src/lib/components/breadcrumbs.js +1 -1
  8. package/src/lib/components/breadcrumbs.js.map +1 -1
  9. package/src/lib/components/button.js +5 -5
  10. package/src/lib/components/button.js.map +1 -1
  11. package/src/lib/components/collection-categories.js +1 -1
  12. package/src/lib/components/collection-categories.js.map +1 -1
  13. package/src/lib/components/collection-entries.js +1 -1
  14. package/src/lib/components/collection-entries.js.map +1 -1
  15. package/src/lib/components/collection-entry-body.js +1 -1
  16. package/src/lib/components/collection-entry-body.js.map +1 -1
  17. package/src/lib/components/collection-search.js +1 -1
  18. package/src/lib/components/collection-search.js.map +1 -1
  19. package/src/lib/components/document-root.js +1 -1
  20. package/src/lib/components/document-root.js.map +1 -1
  21. package/src/lib/components/image.js +4 -4
  22. package/src/lib/components/image.js.map +1 -1
  23. package/src/lib/components/language-switcher.js +3 -3
  24. package/src/lib/components/language-switcher.js.map +1 -1
  25. package/src/lib/components/layout-slot.d.ts +1 -1
  26. package/src/lib/components/layout-slot.js +3 -3
  27. package/src/lib/components/layout-slot.js.map +1 -1
  28. package/src/lib/components/link-box.js +4 -4
  29. package/src/lib/components/link-box.js.map +1 -1
  30. package/src/lib/components/markdown.d.ts +3 -1
  31. package/src/lib/components/markdown.js +3 -3
  32. package/src/lib/components/markdown.js.map +1 -1
  33. package/src/lib/components/pagination.d.ts +1 -1
  34. package/src/lib/components/pagination.js +6 -2
  35. package/src/lib/components/pagination.js.map +1 -1
  36. package/src/lib/components/screen-link.js +7 -7
  37. package/src/lib/components/screen-link.js.map +1 -1
  38. package/src/lib/components/tabs.d.ts +1 -1
  39. package/src/lib/components/tabs.js +6 -2
  40. package/src/lib/components/tabs.js.map +1 -1
  41. package/src/lib/components/video.d.ts +5 -4
  42. package/src/lib/components/video.js +24 -22
  43. package/src/lib/components/video.js.map +1 -1
  44. package/src/lib/constants/field-presets.js +4 -0
  45. package/src/lib/constants/field-presets.js.map +1 -1
  46. package/src/lib/element-tier.d.ts +0 -2
  47. package/src/lib/element-tier.js +0 -2
  48. package/src/lib/element-tier.js.map +1 -1
  49. package/src/lib/plugin.js +0 -32
  50. package/src/lib/plugin.js.map +1 -1
  51. package/src/lib/video-embed-providers.d.ts +30 -0
  52. package/src/lib/video-embed-providers.js +125 -0
  53. package/src/lib/video-embed-providers.js.map +1 -0
  54. package/src/lib/components/function-controls.d.ts +0 -66
  55. package/src/lib/components/function-controls.js +0 -207
  56. package/src/lib/components/function-controls.js.map +0 -1
  57. package/src/lib/components/function-scope.d.ts +0 -110
  58. package/src/lib/components/function-scope.js +0 -478
  59. package/src/lib/components/function-scope.js.map +0 -1
  60. package/src/lib/components/function-widget.d.ts +0 -75
  61. package/src/lib/components/function-widget.js +0 -307
  62. package/src/lib/components/function-widget.js.map +0 -1
@@ -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 functionWidget = viaTier('functionWidget')\nconst functionScope = viaTier('functionScope')\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\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): Typography is `textEditable` and so a\n // leaf, which left no way to emphasize a phrase inside a sentence — every\n // statement rendered as one flat color.\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 },\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 functionWidget: {\n module: functionWidget,\n component: 'default',\n schema: 'schema',\n presets: 'presets',\n },\n functionScope: {\n module: functionScope,\n component: 'default',\n schema: 'schema',\n presets: 'presets',\n },\n functionInput: {\n module: functionScope,\n component: 'FunctionInput',\n schema: 'functionInputSchema',\n presets: 'functionInputPresets',\n },\n functionOutput: {\n module: functionScope,\n component: 'FunctionOutput',\n schema: 'functionOutputSchema',\n presets: 'functionOutputPresets',\n },\n functionShow: {\n module: functionScope,\n component: 'FunctionShow',\n schema: 'functionShowSchema',\n presets: 'functionShowPresets',\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 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","functionWidget","functionScope","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","contentAuthorProfile","muiScreenLink","muiLinkBox","muiNavMenu","muiMegaMenu","muiDrawer","muiDrawerToggle","functionInput","functionOutput","functionShow","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","index","mod","registeredById","registerEntries","entries","entry","components","registerComponent","length","registerPreset","registerMuiPlugin","use","wanted","has","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,MAAMW,YAAYX,OAAO;AACzB,MAAMY,MAAMZ,OAAO;AACnB,MAAMa,QAAQb,OAAO;AACrB,MAAMc,OAAOd,OAAO;AACpB,MAAMe,QAAQf,OAAO;AACrB,MAAMgB,aAAahB,OAAO;AAC1B,MAAMiB,aAAajB,OAAO;AAC1B,MAAMkB,SAASlB,OAAO;AACtB,MAAMmB,aAAanB,OAAO;AAC1B,MAAMoB,UAAUpB,OAAO;AACvB,MAAMqB,QAAQrB,OAAO;AACrB,MAAMsB,OAAOtB,OAAO;AAEpB,MAAMuB,OAAOlB,QAAQ;AACrB,MAAMmB,WAAWnB,QAAQ;AACzB,MAAMoB,eAAepB,QAAQ;AAC7B,MAAMqB,SAASrB,QAAQ;AACvB,MAAMsB,YAAYtB,QAAQ;AAC1B,MAAMuB,oBAAoBvB,QAAQ;AAClC,MAAMwB,sBAAsBxB,QAAQ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hC,MAAMJ,UAAUQ,OAAOJ,MAAM,GAAG,MAAMzB,cAAc6B,UAAU,EAAE;IAChE,KAAK,MAAMP,SAASD,QAAS;QAC3BF,eAAeH,GAAG,CAACM,MAAMhE,MAAM,CAAC4E,GAAG,EAAYZ;IACjD;IAEA,sEAAsE;IACtE,0EAA0E;IAC1E,8DAA8D;IAC9D,EAAE;IACF,sEAAsE;IACtE,yEAAyE;IACzE,0EAA0E;IAC1E,oEAAoE;IACpE,IAAIjI,MAAM2I,OAAO,CAACC,aAAa,CAAC1I,YAAY;QAC1C,IAAI8H,QAAQI,MAAM,EAAEL,gBAAgBC;QACpC;IACF;IAEAhI,MAAM2I,OAAO,CAACG,aAAa,CAAC;QAC1BD,KAAK3I;QACL6I,aAAa;QACbC,aAAa;QACbC,OAAO;QACPC,cAAc,CAAC;QACfzB;YACEM,gBAAgB;mBAAID,eAAeqB,MAAM;aAAG;QAC9C;QACAC;YACE,MAAMpB,UAAU;mBAAIF,eAAeqB,MAAM;aAAG;YAC5ClJ,YAAY;gBACV,KAAK,MAAMgI,SAASD,QAAS;wBACvBC;oBAAJ,KAAIA,iBAAAA,MAAM/D,OAAO,qBAAb+D,eAAeG,MAAM,EAAE;wBACzBpI,MAAMkI,UAAU,CAACmB,gBAAgB,CAC/BpB,MAAM/D,OAAO,CAACqD,GAAG,CAAC,CAAC+B,SAAWA,OAAOT,GAAG;oBAE5C;gBACF;gBACA,KAAK,MAAMZ,SAASD,QAAS;oBAC3BhI,MAAMkI,UAAU,CAACqB,mBAAmB,CAACtB,MAAMhE,MAAM,CAAC4E,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 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\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): Typography is `textEditable` and so a\n // leaf, which left no way to emphasize a phrase inside a sentence — every\n // statement rendered as one flat color.\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 },\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 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","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","index","mod","registeredById","registerEntries","entries","entry","components","registerComponent","length","registerPreset","registerMuiPlugin","use","wanted","has","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,yCA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MAAM;aAAG;YAC5C7I,YAAY;gBACV,KAAK,MAAM2H,SAASD,QAAS;wBACvBC;oBAAJ,KAAIA,iBAAAA,MAAM5D,OAAO,qBAAb4D,eAAeG,MAAM,EAAE;wBACzB/H,MAAM6H,UAAU,CAACmB,gBAAgB,CAC/BpB,MAAM5D,OAAO,CAACkD,GAAG,CAAC,CAAC+B,SAAWA,OAAOT,GAAG;oBAE5C;gBACF;gBACA,KAAK,MAAMZ,SAASD,QAAS;oBAC3B3H,MAAM6H,UAAU,CAACqB,mBAAmB,CAACtB,MAAM7D,MAAM,CAACyE,GAAG;gBACvD;YACF;QACF;IACF;AACF"}
@@ -0,0 +1,30 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2026 Aglyn LLC
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ import type { VideoEmbedProviderDeclaration } from '@aglyn/aglyn/plugin-manager/video-embed-provider';
18
+ /**
19
+ * The video hosts whose own player the Video element plays a link in
20
+ * (AGL-3080). Named under `videoEmbedProviders` in `plugins.config.json`: the
21
+ * manifest generator calls this, validates the answer and compiles it into
22
+ * core's `first-party-plugins.generated.ts`, where the published page, its
23
+ * `VideoObject`, the entry page and the tenant's `frame-src` read it without
24
+ * loading this plugin. Regenerate after changing it; `--check` refuses a
25
+ * stale copy.
26
+ *
27
+ * It lives in this plugin because the element that plays these links does:
28
+ * `components/video.tsx`, beside the YouTube and Vimeo embed block.
29
+ */
30
+ export declare function muiVideoEmbedProviders(): VideoEmbedProviderDeclaration[];
@@ -0,0 +1,125 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2026 Aglyn LLC
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */ /**
17
+ * The video hosts whose own player the Video element plays a link in
18
+ * (AGL-3080). Named under `videoEmbedProviders` in `plugins.config.json`: the
19
+ * manifest generator calls this, validates the answer and compiles it into
20
+ * core's `first-party-plugins.generated.ts`, where the published page, its
21
+ * `VideoObject`, the entry page and the tenant's `frame-src` read it without
22
+ * loading this plugin. Regenerate after changing it; `--check` refuses a
23
+ * stale copy.
24
+ *
25
+ * It lives in this plugin because the element that plays these links does:
26
+ * `components/video.tsx`, beside the YouTube and Vimeo embed block.
27
+ */ export function muiVideoEmbedProviders() {
28
+ return [
29
+ WISTIA
30
+ ];
31
+ }
32
+ /**
33
+ * Wistia (AGL-2826).
34
+ *
35
+ * ## The iframe embed, not the player script
36
+ *
37
+ * Wistia offers two embeds. The script embed runs Wistia's JavaScript in the
38
+ * page itself, so every site would need `connect-src`, `img-src` and
39
+ * `media-src` grants for Wistia's hosts, and the player's storage and beacons
40
+ * would run as the site. The iframe embed runs all of that inside a document
41
+ * on Wistia's origin, under Wistia's own policy: the page needs one
42
+ * `frame-src` entry, and whatever the player stores is keyed to Wistia inside
43
+ * the site's partition rather than written as the site.
44
+ *
45
+ * Measured on 2026-09-10: `fast.wistia.net/embed/iframe/{id}` answers 200
46
+ * with no redirect, so no second origin is involved in loading the frame.
47
+ *
48
+ * ## The links an author is handed
49
+ *
50
+ * Wistia's oEmbed endpoint matches on the path rather than the host, and so
51
+ * does this: a media page (`/medias/{id}`, and its `/manage`), its short form
52
+ * (`/m/{id}`), an iframe embed's own address, and a script embed's media
53
+ * address with or without its `.jsonp` suffix. A share link (`/s/{slug}`)
54
+ * names no id and is refused rather than guessed at. An id is a hashed id:
55
+ * ten lowercase letters and digits, e.g. `e4a27b971d`.
56
+ *
57
+ * ## The query
58
+ *
59
+ * `autoPlay` is stated both ways. The frame a page loads before anyone has
60
+ * pressed anything ("Load the player with the page", AGL-2962) says
61
+ * `autoPlay=false` rather than leaving the option out: an option in the
62
+ * embed overrides the media's own settings in the Wistia account, and those
63
+ * may be set to autoplay.
64
+ *
65
+ * `roundedPlayer=false` is on every address, and no option turns it back on
66
+ * (AGL-3209). Wistia's rounded chrome rounds and clips INSIDE the frame,
67
+ * where the document's own canvas is white: on a dark page the corner arcs
68
+ * and the clip's antialiased edge composite as a white ring around the film
69
+ * rather than as the page behind them. Measured on 2026-09-21 against the
70
+ * live videos page, whose background is `rgb(42 52 64)` and whose film is
71
+ * `rgb(22 30 52)`: the frame's first column read `rgb(137 141 152)` and its
72
+ * top-left corner `rgb(195 198 201)` — lighter than either, so painted rather
73
+ * than blended. With the option off the same pixels are the film. The shape
74
+ * is the placement's to decide in any case: `VideoPlayerFrame` takes a
75
+ * `radius` from the element's own control and puts it on the frame.
76
+ *
77
+ * `doNotTrack` is Wistia's embed option for not recording the viewing
78
+ * session; `endVideoBehavior=loop` is its loop.
79
+ */ const WISTIA = {
80
+ id: 'wistia',
81
+ label: 'Wistia',
82
+ domains: [
83
+ 'wistia.com',
84
+ 'wistia.net',
85
+ 'wi.st'
86
+ ],
87
+ mediaIdPaths: [
88
+ '^\\/medias\\/([^/]+)(?:\\/manage)?\\/?$',
89
+ '^\\/m\\/([^/]+)\\/?$',
90
+ '^\\/embed\\/iframe\\/([^/]+)\\/?$',
91
+ '^\\/embed\\/medias\\/([^/.]+)(?:\\.jsonp?)?\\/?$'
92
+ ],
93
+ mediaIdPattern: '^[a-z0-9]{10}$',
94
+ playerOrigin: 'https://fast.wistia.net',
95
+ playerPath: '/embed/iframe/{id}',
96
+ playerQuery: [
97
+ {
98
+ param: 'autoPlay',
99
+ option: 'autoPlay',
100
+ on: 'true',
101
+ off: 'false'
102
+ },
103
+ {
104
+ param: 'roundedPlayer',
105
+ value: 'false'
106
+ },
107
+ {
108
+ param: 'doNotTrack',
109
+ option: 'doNotTrack',
110
+ on: 'true'
111
+ },
112
+ {
113
+ param: 'muted',
114
+ option: 'muted',
115
+ on: 'true'
116
+ },
117
+ {
118
+ param: 'endVideoBehavior',
119
+ option: 'loop',
120
+ on: 'loop'
121
+ }
122
+ ]
123
+ };
124
+
125
+ //# sourceMappingURL=video-embed-providers.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../../libs/plugins/mui/src/lib/video-embed-providers.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 type { VideoEmbedProviderDeclaration } from '@aglyn/aglyn/plugin-manager/video-embed-provider'\n\n/**\n * The video hosts whose own player the Video element plays a link in\n * (AGL-3080). Named under `videoEmbedProviders` in `plugins.config.json`: the\n * manifest generator calls this, validates the answer and compiles it into\n * core's `first-party-plugins.generated.ts`, where the published page, its\n * `VideoObject`, the entry page and the tenant's `frame-src` read it without\n * loading this plugin. Regenerate after changing it; `--check` refuses a\n * stale copy.\n *\n * It lives in this plugin because the element that plays these links does:\n * `components/video.tsx`, beside the YouTube and Vimeo embed block.\n */\nexport function muiVideoEmbedProviders(): VideoEmbedProviderDeclaration[] {\n return [WISTIA]\n}\n\n/**\n * Wistia (AGL-2826).\n *\n * ## The iframe embed, not the player script\n *\n * Wistia offers two embeds. The script embed runs Wistia's JavaScript in the\n * page itself, so every site would need `connect-src`, `img-src` and\n * `media-src` grants for Wistia's hosts, and the player's storage and beacons\n * would run as the site. The iframe embed runs all of that inside a document\n * on Wistia's origin, under Wistia's own policy: the page needs one\n * `frame-src` entry, and whatever the player stores is keyed to Wistia inside\n * the site's partition rather than written as the site.\n *\n * Measured on 2026-09-10: `fast.wistia.net/embed/iframe/{id}` answers 200\n * with no redirect, so no second origin is involved in loading the frame.\n *\n * ## The links an author is handed\n *\n * Wistia's oEmbed endpoint matches on the path rather than the host, and so\n * does this: a media page (`/medias/{id}`, and its `/manage`), its short form\n * (`/m/{id}`), an iframe embed's own address, and a script embed's media\n * address with or without its `.jsonp` suffix. A share link (`/s/{slug}`)\n * names no id and is refused rather than guessed at. An id is a hashed id:\n * ten lowercase letters and digits, e.g. `e4a27b971d`.\n *\n * ## The query\n *\n * `autoPlay` is stated both ways. The frame a page loads before anyone has\n * pressed anything (\"Load the player with the page\", AGL-2962) says\n * `autoPlay=false` rather than leaving the option out: an option in the\n * embed overrides the media's own settings in the Wistia account, and those\n * may be set to autoplay.\n *\n * `roundedPlayer=false` is on every address, and no option turns it back on\n * (AGL-3209). Wistia's rounded chrome rounds and clips INSIDE the frame,\n * where the document's own canvas is white: on a dark page the corner arcs\n * and the clip's antialiased edge composite as a white ring around the film\n * rather than as the page behind them. Measured on 2026-09-21 against the\n * live videos page, whose background is `rgb(42 52 64)` and whose film is\n * `rgb(22 30 52)`: the frame's first column read `rgb(137 141 152)` and its\n * top-left corner `rgb(195 198 201)` — lighter than either, so painted rather\n * than blended. With the option off the same pixels are the film. The shape\n * is the placement's to decide in any case: `VideoPlayerFrame` takes a\n * `radius` from the element's own control and puts it on the frame.\n *\n * `doNotTrack` is Wistia's embed option for not recording the viewing\n * session; `endVideoBehavior=loop` is its loop.\n */\nconst WISTIA: VideoEmbedProviderDeclaration = {\n id: 'wistia',\n label: 'Wistia',\n domains: ['wistia.com', 'wistia.net', 'wi.st'],\n mediaIdPaths: [\n '^\\\\/medias\\\\/([^/]+)(?:\\\\/manage)?\\\\/?$',\n '^\\\\/m\\\\/([^/]+)\\\\/?$',\n '^\\\\/embed\\\\/iframe\\\\/([^/]+)\\\\/?$',\n '^\\\\/embed\\\\/medias\\\\/([^/.]+)(?:\\\\.jsonp?)?\\\\/?$',\n ],\n mediaIdPattern: '^[a-z0-9]{10}$',\n playerOrigin: 'https://fast.wistia.net',\n playerPath: '/embed/iframe/{id}',\n playerQuery: [\n { param: 'autoPlay', option: 'autoPlay', on: 'true', off: 'false' },\n { param: 'roundedPlayer', value: 'false' },\n { param: 'doNotTrack', option: 'doNotTrack', on: 'true' },\n { param: 'muted', option: 'muted', on: 'true' },\n { param: 'endVideoBehavior', option: 'loop', on: 'loop' },\n ],\n}\n"],"names":["muiVideoEmbedProviders","WISTIA","id","label","domains","mediaIdPaths","mediaIdPattern","playerOrigin","playerPath","playerQuery","param","option","on","off","value"],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC,GAID;;;;;;;;;;;CAWC,GACD,OAAO,SAASA;IACd,OAAO;QAACC;KAAO;AACjB;AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA+CC,GACD,MAAMA,SAAwC;IAC5CC,IAAI;IACJC,OAAO;IACPC,SAAS;QAAC;QAAc;QAAc;KAAQ;IAC9CC,cAAc;QACZ;QACA;QACA;QACA;KACD;IACDC,gBAAgB;IAChBC,cAAc;IACdC,YAAY;IACZC,aAAa;QACX;YAAEC,OAAO;YAAYC,QAAQ;YAAYC,IAAI;YAAQC,KAAK;QAAQ;QAClE;YAAEH,OAAO;YAAiBI,OAAO;QAAQ;QACzC;YAAEJ,OAAO;YAAcC,QAAQ;YAAcC,IAAI;QAAO;QACxD;YAAEF,OAAO;YAASC,QAAQ;YAASC,IAAI;QAAO;QAC9C;YAAEF,OAAO;YAAoBC,QAAQ;YAAQC,IAAI;QAAO;KACzD;AACH"}
@@ -1,66 +0,0 @@
1
- /**
2
- * @license
3
- * Copyright 2026 Aglyn LLC
4
- *
5
- * Licensed under the Apache License, Version 2.0 (the "License");
6
- * you may not use this file except in compliance with the License.
7
- * You may obtain a copy of the License at
8
- *
9
- * http://www.apache.org/licenses/LICENSE-2.0
10
- *
11
- * Unless required by applicable law or agreed to in writing, software
12
- * distributed under the License is distributed on an "AS IS" BASIS,
13
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
- * See the License for the specific language governing permissions and
15
- * limitations under the License.
16
- */
17
- import type * as Aglyn from '@aglyn/aglyn';
18
- /**
19
- * How one function parameter is ASKED (AGL-3202), shared by the Function
20
- * Widget, which asks every parameter in a row, and the Function Input
21
- * element, which asks one wherever the author put it.
22
- */
23
- /** The control a parameter is drawn as. `auto` follows the parameter. */
24
- export type FunctionControlKind = 'auto' | 'number' | 'text' | 'select' | 'chips' | 'switch';
25
- export declare const FUNCTION_CONTROL_KINDS: readonly FunctionControlKind[];
26
- /** What each input starts with: the parameter's own default, or nothing. */
27
- export declare function initialFunctionArguments(definition: Aglyn.HostFunction | undefined): Record<string, string>;
28
- /** A result as a visitor reads it. */
29
- export declare function displayFunctionValue(value: number | string | boolean | undefined): string;
30
- /**
31
- * Whether a result counts as "yes" for an element that shows or hides on it.
32
- * The strings a function is likely to have built — `'false'`, `'0'`, `'no'` —
33
- * read as no, because a text local is the only way a function can carry a
34
- * flag it computed from text.
35
- */
36
- export declare function isFunctionValueTruthy(value: number | string | boolean | undefined): boolean;
37
- /** `control: auto` resolved against what the parameter is. */
38
- export declare function resolveFunctionControl(control: FunctionControlKind | undefined, parameter: Pick<Aglyn.HostFunctionParameter, 'type' | 'options'> | undefined, hasChoices: boolean): Exclude<FunctionControlKind, 'auto'>;
39
- export interface FunctionParameterControlProps {
40
- /** The parameter's identifier; the label when nothing better is given. */
41
- name: string;
42
- type?: Aglyn.FunctionValueType;
43
- required?: boolean;
44
- control?: FunctionControlKind;
45
- label?: string;
46
- hideLabel?: boolean;
47
- /** The choices offered by a select or a row of chips. */
48
- options?: Aglyn.HostFunctionParameterOption[];
49
- value: string;
50
- onChange: (value: string) => void;
51
- /** The besigner draws the control so it can be designed around; it is inert. */
52
- disabled?: boolean;
53
- width?: number | string;
54
- }
55
- /**
56
- * One parameter, drawn as what it is.
57
- *
58
- * - **select** is NATIVE. A portal-mounted menu is one more thing a
59
- * transformed or clipped ancestor can misplace, and on a phone the platform
60
- * picker is the better control.
61
- * - **chips** are quick picks: buttons that SET the value, pressed when the
62
- * value matches. They are how a number box gets "10 · 25 · 50 · 100"
63
- * beside it — two controls on one parameter, which is why this takes a
64
- * value and an onChange and holds no state of its own.
65
- */
66
- export declare function FunctionParameterControl(props: FunctionParameterControlProps): import("react").JSX.Element;
@@ -1,207 +0,0 @@
1
- /**
2
- * @license
3
- * Copyright 2026 Aglyn LLC
4
- *
5
- * Licensed under the Apache License, Version 2.0 (the "License");
6
- * you may not use this file except in compliance with the License.
7
- * You may obtain a copy of the License at
8
- *
9
- * http://www.apache.org/licenses/LICENSE-2.0
10
- *
11
- * Unless required by applicable law or agreed to in writing, software
12
- * distributed under the License is distributed on an "AS IS" BASIS,
13
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
- * See the License for the specific language governing permissions and
15
- * limitations under the License.
16
- */ import { _ as _extends } from "@swc/helpers/_/_extends";
17
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
18
- import Chip from "@mui/material/Chip";
19
- import FormControlLabel from "@mui/material/FormControlLabel";
20
- import Stack from "@mui/material/Stack";
21
- import Switch from "@mui/material/Switch";
22
- import TextField from "@mui/material/TextField";
23
- import Typography from "@mui/material/Typography";
24
- import { useId } from "react";
25
- export const FUNCTION_CONTROL_KINDS = [
26
- 'auto',
27
- 'number',
28
- 'text',
29
- 'select',
30
- 'chips',
31
- 'switch'
32
- ];
33
- /** What each input starts with: the parameter's own default, or nothing. */ export function initialFunctionArguments(definition) {
34
- var _ref;
35
- const args = {};
36
- for (const parameter of (_ref = definition == null ? void 0 : definition.parameters) != null ? _ref : []){
37
- var _parameter_options;
38
- if (parameter.defaultValue != null && parameter.defaultValue !== '') {
39
- args[parameter.name] = String(parameter.defaultValue);
40
- } else if ((_parameter_options = parameter.options) == null ? void 0 : _parameter_options.length) {
41
- // A select always shows a choice, so the function has to receive the
42
- // one on screen — not an empty string the visitor never saw.
43
- args[parameter.name] = String(parameter.options[0].value);
44
- }
45
- }
46
- return args;
47
- }
48
- /** A result as a visitor reads it. */ export function displayFunctionValue(value) {
49
- if (typeof value === 'boolean') return value ? 'Yes' : 'No';
50
- return value == null ? '' : String(value);
51
- }
52
- /**
53
- * Whether a result counts as "yes" for an element that shows or hides on it.
54
- * The strings a function is likely to have built — `'false'`, `'0'`, `'no'` —
55
- * read as no, because a text local is the only way a function can carry a
56
- * flag it computed from text.
57
- */ export function isFunctionValueTruthy(value) {
58
- if (typeof value === 'boolean') return value;
59
- if (typeof value === 'number') return value !== 0 && !Number.isNaN(value);
60
- const text = String(value != null ? value : '').trim().toLowerCase();
61
- return text !== '' && text !== 'false' && text !== '0' && text !== 'no';
62
- }
63
- /** `control: auto` resolved against what the parameter is. */ export function resolveFunctionControl(control, parameter, hasChoices) {
64
- var _parameter_options;
65
- if (control && control !== 'auto') return control;
66
- if (hasChoices || (parameter == null ? void 0 : (_parameter_options = parameter.options) == null ? void 0 : _parameter_options.length)) return 'select';
67
- if ((parameter == null ? void 0 : parameter.type) === 'boolean') return 'switch';
68
- if ((parameter == null ? void 0 : parameter.type) === 'number') return 'number';
69
- return 'text';
70
- }
71
- /** Two values name the same choice: "25" and 25.0 are one quick pick. */ function sameChoice(left, right) {
72
- if (left === right) return true;
73
- if (left.trim() === '' || right.trim() === '') return false;
74
- const a = Number(left);
75
- const b = Number(right);
76
- return Number.isFinite(a) && Number.isFinite(b) && a === b;
77
- }
78
- /**
79
- * One parameter, drawn as what it is.
80
- *
81
- * - **select** is NATIVE. A portal-mounted menu is one more thing a
82
- * transformed or clipped ancestor can misplace, and on a phone the platform
83
- * picker is the better control.
84
- * - **chips** are quick picks: buttons that SET the value, pressed when the
85
- * value matches. They are how a number box gets "10 · 25 · 50 · 100"
86
- * beside it — two controls on one parameter, which is why this takes a
87
- * value and an onChange and holds no state of its own.
88
- */ export function FunctionParameterControl(props) {
89
- const { name, type, required, control, label, hideLabel, options = [], value, onChange, disabled, width } = props;
90
- const groupLabelId = useId();
91
- const text = (label == null ? void 0 : label.trim()) || name;
92
- const kind = resolveFunctionControl(control, {
93
- type,
94
- options
95
- }, options.length > 0);
96
- if (kind === 'chips') {
97
- return /*#__PURE__*/ _jsxs(Stack, {
98
- spacing: 0.75,
99
- role: "group",
100
- "aria-labelledby": groupLabelId,
101
- children: [
102
- /*#__PURE__*/ _jsx(Typography, {
103
- id: groupLabelId,
104
- variant: "caption",
105
- color: "text.secondary",
106
- sx: hideLabel ? visuallyHidden : {
107
- fontWeight: 500
108
- },
109
- children: text
110
- }),
111
- /*#__PURE__*/ _jsx(Stack, {
112
- direction: "row",
113
- spacing: 0.75,
114
- sx: {
115
- flexWrap: 'wrap',
116
- rowGap: 0.75
117
- },
118
- children: options.map((option)=>{
119
- var _option_label;
120
- const pressed = sameChoice(value, option.value);
121
- return /*#__PURE__*/ _jsx(Chip, {
122
- label: ((_option_label = option.label) == null ? void 0 : _option_label.trim()) || option.value,
123
- size: "small",
124
- clickable: !disabled,
125
- disabled: disabled,
126
- color: pressed ? 'primary' : 'default',
127
- variant: pressed ? 'filled' : 'outlined',
128
- "aria-pressed": pressed,
129
- onClick: ()=>onChange(option.value)
130
- }, option.value);
131
- })
132
- })
133
- ]
134
- });
135
- }
136
- if (kind === 'switch') {
137
- return /*#__PURE__*/ _jsx(FormControlLabel, {
138
- label: text,
139
- disabled: disabled,
140
- control: /*#__PURE__*/ _jsx(Switch, {
141
- checked: value === 'true',
142
- onChange: (event)=>onChange(event.target.checked ? 'true' : 'false')
143
- })
144
- });
145
- }
146
- if (kind === 'select') {
147
- return /*#__PURE__*/ _jsx(TextField, {
148
- select: true,
149
- label: hideLabel ? undefined : text,
150
- required: Boolean(required),
151
- value: value,
152
- disabled: disabled,
153
- onChange: (event)=>onChange(event.target.value),
154
- size: "small",
155
- slotProps: {
156
- select: {
157
- native: true
158
- },
159
- htmlInput: hideLabel ? {
160
- 'aria-label': text
161
- } : undefined
162
- },
163
- sx: {
164
- minWidth: width != null ? width : 200
165
- },
166
- children: options.map((option)=>{
167
- var _option_label;
168
- return /*#__PURE__*/ _jsx("option", {
169
- value: option.value,
170
- children: ((_option_label = option.label) == null ? void 0 : _option_label.trim()) || option.value
171
- }, option.value);
172
- })
173
- });
174
- }
175
- return /*#__PURE__*/ _jsx(TextField, {
176
- label: hideLabel ? undefined : text,
177
- required: Boolean(required),
178
- value: value,
179
- disabled: disabled,
180
- onChange: (event)=>onChange(event.target.value),
181
- size: "small",
182
- type: kind === 'number' ? 'number' : undefined,
183
- slotProps: {
184
- htmlInput: _extends({}, kind === 'number' ? {
185
- inputMode: 'decimal'
186
- } : {}, hideLabel ? {
187
- 'aria-label': text
188
- } : {})
189
- },
190
- sx: {
191
- width: width != null ? width : label ? 200 : 140
192
- }
193
- });
194
- }
195
- const visuallyHidden = {
196
- border: 0,
197
- clip: 'rect(0 0 0 0)',
198
- height: '1px',
199
- margin: '-1px',
200
- overflow: 'hidden',
201
- padding: 0,
202
- position: 'absolute',
203
- whiteSpace: 'nowrap',
204
- width: '1px'
205
- };
206
-
207
- //# sourceMappingURL=function-controls.js.map