@aglyn/plugins-mui

中文文档
1.19.0发布于 2026/11/07Apache-2.0TypeScriptES Module构建来源已验证近 30 天下载 9436

The component palette for Aglyn sites, built on Material UI. It is the base element library every Aglyn site is drawn with: layout, text, navigation, media, content collections and more, each registered with the core component registry together with its s

原始使用文档
文档目录5 节
  1. Install
  2. What's in it
  3. Usage
  4. How it fits
  5. License

@aglyn/plugins-mui

The component palette for Aglyn sites, built on Material UI. It is the base element library every Aglyn site is drawn with: layout, text, navigation, media, content collections and more, each registered with the core component registry together with its schema and presets. Install it if you render Aglyn documents or run the Besigner; it is a first-party plugin, loaded through Aglyn's plugin manager.

Published to npm from the Aglyn monorepo. Versions follow semantic versioning.

Install

npm install @aglyn/plugins-mui

Peer dependencies: react, @mui/material, @mui/utils.

What's in it

The plugin has one registrar, registerMuiPlugin (the site registrar in plugins.config.json), and is marked always-on: it has no console page, no nav item and no API routes. Feature bundles from other plugins declare a dependency on it and wait until it is in the plugin manager.

Elements. The component ids the plugin registers are listed under contributes.site.components in plugins.config.json and as the keys of MUI_COMPONENT_SOURCES. By group:

  • Layout: section, muiContainer, muiStack, muiBox, muiGrid, muiPaper, layoutSlot.
  • Text and actions: muiTypography, muiInlineText, muiButton, markdown, tableOfContents, icon.
  • Navigation: muiAppBar, muiToolbar, muiNavMenu, muiMegaMenu, muiDrawer, muiDrawerToggle, muiScreenLink, muiLinkBox, muiBreadcrumbs, muiPagination, searchBox, languageSwitcher, themeModeSwitcher.
  • Surfaces: muiCard and its header, content and actions, muiAccordion and its summary and details, muiTabs, muiTabPanel, muiList, muiListItem, muiListItemText.
  • Media: image, video, videoEmbed, muiImageList, muiImageListItem, socialLinks.
  • Data and content: dataTable, collectionEntries, collectionEntryBody, collectionEntryMeta, collectionEntryAuthor, collectionRelated, collectionShare, collectionCategories, collectionSearch, contentAuthorProfile, product.
  • Other: reusableInstance, custom-html, marketplacePlugin, and div, the root of a document.

The calculator elements that put a site function on a page are not here: they are the Calculators marketplace plugin (libs/plugins/calculator, ids aglyn.calculator.*).

Component ids are persisted. Every node in a saved screen document stores its componentId beside pluginId: 'mui', so the ids above, including the legacy mui-prefixed ones, do not change without a document migration.

Per-component loading. Each element lives in its own module behind a dynamic import. registerMuiPlugin(use) accepts a PluginUse from @aglyn/aglyn; when use.componentIds names the elements a page places, only those modules are fetched. Called with no argument it registers the whole library, which is what the console and the Besigner need for their palette. Calling it again with further ids adds to what is already registered.

Exports from .

  • registerMuiPlugin, loadMuiBundle, MUI_COMPONENT_SOURCES, the MuiBundleEntry and MuiComponentSource types, and BUNDLE_ID ('mui').
  • PluginFrame and PluginFrameProps: the host side of the sandbox an installed marketplace plugin runs in. It renders the plugin in a cross-origin sandboxed iframe and talks to it only over a capability-scoped postMessage bridge, and shows a placeholder instead whenever the plugin cannot run safely.
  • muiPluginInstallToPreset, PluginInstallLike, PLUGIN_DRAWER_CATEGORY: how an installed marketplace plugin becomes a palette entry that places a marketplacePlugin node.
  • sanitizeCustomHtml: the sanitizer the custom-html element applies to authored markup.

Usage

import { registerMuiPlugin } from '@aglyn/plugins-mui'

// An editor or console: the whole palette.
await registerMuiPlugin()

// A published page: only the elements this page places.
await registerMuiPlugin({ componentIds: ['section', 'muiTypography', 'muiButton'] })

In an Aglyn app you do not call this yourself: the generated loader manifest calls the registrar and passes the component ids it read from the page's document. An element whose component was never registered renders nothing, so a surface that cannot say what it places should register the whole library.

How it fits

A plugin package (scope:plugin). It depends on the core (@aglyn/aglyn) and on generic shared packages (@aglyn/shared-ui-jsx, @aglyn/shared-ui-theme, @aglyn/shared-data-enums, @aglyn/shared-data-mdi, @aglyn/shared-util-vendor), and uses mobx to batch registration. It imports no other plugin and none of the designer UI. No other plugin imports it either: a feature bundle names mui as a dependency id in the plugin manager rather than importing the package, and the form elements that once lived here are in @aglyn/plugins-forms.

License

Apache-2.0. Source: https://github.com/aglyn/aglyn/tree/main/libs/plugins/mui

版本与发布记录

@aglyn/plugins-mui 共发布 162 个版本,首次发布于 2026/09/21;过去 12 个月发布了 162 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
1.19.0latest2026/11/07今天
1.18.02026/11/07今天
1.17.02026/11/07今天
1.16.02026/11/07今天
1.15.22026/11/061 天前
1.15.12026/11/061 天前

其他发布通道:beta → 1.0.0-beta.296。

关于 @aglyn/plugins-mui 的常见问题

@aglyn/plugins-mui 是什么?

The component palette for Aglyn sites, built on Material UI. It is the base element library every Aglyn site is drawn with: layout, text, navigation, media, content collections and more, each registered with the core component registry together with its s

如何安装 @aglyn/plugins-mui?

在项目目录运行 npm install @aglyn/plugins-mui,或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖:react(^19.2.8)、@mui/utils(^9.2.0)、@mui/material(^9.3.1)、@mui/x-date-pickers(^9.15.0)。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖,Yarn 需要手动安装。

@aglyn/plugins-mui 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@aglyn/plugins-mui 支持 ESM 还是 CommonJS?

以 ES Module 形式发布,推荐使用 import 引入。在 CommonJS 项目中,Node.js 20.19+ / 22.12+ 可以直接 require() 不含顶层 await 的 ES Module,更早的版本需要改用动态 import()。

@aglyn/plugins-mui 可以商用吗?

@aglyn/plugins-mui 使用 Apache-2.0 许可。宽松许可:允许商业使用、修改和再分发,并附带明确的专利授权;分发时需保留许可与 NOTICE 文件,修改过的文件要注明改动。以上为概括,不构成法律意见,请以许可原文为准。

@aglyn/plugins-mui 的下载量有多少?

根据 npm 官方下载统计,@aglyn/plugins-mui 在 2026/10/05 – 2026/11/03 这 30 天内被下载 9,436 次,日均约 315 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@aglyn/plugins-mui 还在维护吗?

最新版本 1.19.0 发布于 2026/11/07(今天);至今共发布 162 个版本,其中过去 12 个月发布了 162 个;首次发布于 2026/09/21。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。