@aglyn/plugins-mui 1.0.0-beta.143 → 1.0.0-beta.144

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 (2) hide show
  1. package/README.md +53 -16
  2. package/package.json +7 -7
package/README.md CHANGED
@@ -1,22 +1,59 @@
1
- # @aglyn/plugins-ui-mui
1
+ # @aglyn/plugins-mui
2
2
 
3
- The canonical MUI component plugin. It absorbs the former
4
- `@aglyn/aglyn-plugin-mui` library and serves both runtimes:
3
+ 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.
5
4
 
6
- - **New runtime** (silo, console app-setup): register the exported `bundle`
7
- with `registerBundle` from `@aglyn/aglyn`.
8
- - **Legacy runtime** (`AglynNodeRenderer` pages in tenant and the console
9
- besigner page): call `registerLegacyMuiPlugin()` at module scope.
5
+ > Beta. Published from the Aglyn monorepo under the `beta` dist-tag; APIs can change between beta releases.
10
6
 
11
- ## Component ids
7
+ ## Install
12
8
 
13
- Component ids are persisted in screen documents (`componentId` +
14
- `pluginId: 'mui'` on every node), so this library keeps the legacy ids —
15
- `muiAppBar`, `muiButton`, `muiContainer`, `muiList`, `muiListItem`,
16
- `muiListItemText`, `muiStack`, `muiToolbar`, `muiTypography` — and existing
17
- documents resolve without migration in both runtimes. Do not rename them
18
- without a screen-document migration.
9
+ npm install @aglyn/plugins-mui@beta
19
10
 
20
- ## Running unit tests
11
+ Peer dependencies: `react`, `@mui/material`, `@mui/utils`.
21
12
 
22
- Run `nx test plugins-ui-mui` to execute the unit tests via [Jest](https://jestjs.io).
13
+ ## What's in it
14
+
15
+ 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.
16
+
17
+ **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:
18
+
19
+ - Layout: `section`, `muiContainer`, `muiStack`, `muiBox`, `muiGrid`, `muiPaper`, `layoutSlot`.
20
+ - Text and actions: `muiTypography`, `muiInlineText`, `muiButton`, `markdown`, `tableOfContents`, `icon`.
21
+ - Navigation: `muiAppBar`, `muiToolbar`, `muiNavMenu`, `muiMegaMenu`, `muiDrawer`, `muiDrawerToggle`, `muiScreenLink`, `muiLinkBox`, `muiBreadcrumbs`, `muiPagination`, `searchBox`, `languageSwitcher`, `themeModeSwitcher`.
22
+ - Surfaces: `muiCard` and its header, content and actions, `muiAccordion` and its summary and details, `muiTabs`, `muiTabPanel`, `muiList`, `muiListItem`, `muiListItemText`.
23
+ - Media: `image`, `video`, `videoEmbed`, `muiImageList`, `muiImageListItem`, `socialLinks`.
24
+ - Data and content: `dataTable`, `collectionEntries`, `collectionEntryBody`, `collectionEntryMeta`, `collectionEntryAuthor`, `collectionRelated`, `collectionShare`, `collectionCategories`, `collectionSearch`, `contentAuthorProfile`, `product`.
25
+ - Functions: `functionWidget`, `functionScope`, `functionInput`, `functionOutput`, `functionShow`.
26
+ - Other: `reusableInstance`, `custom-html`, `marketplacePlugin`, and `div`, the root of a document.
27
+
28
+ **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.
29
+
30
+ **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.
31
+
32
+ **Exports from `.`**
33
+
34
+ - `registerMuiPlugin`, `loadMuiBundle`, `MUI_COMPONENT_SOURCES`, the `MuiBundleEntry` and `MuiComponentSource` types, and `BUNDLE_ID` (`'mui'`).
35
+ - `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.
36
+ - `muiPluginInstallToPreset`, `PluginInstallLike`, `PLUGIN_DRAWER_CATEGORY`: how an installed marketplace plugin becomes a palette entry that places a `marketplacePlugin` node.
37
+ - `sanitizeCustomHtml`: the sanitizer the `custom-html` element applies to authored markup.
38
+
39
+ ## Usage
40
+
41
+ ```ts
42
+ import { registerMuiPlugin } from '@aglyn/plugins-mui'
43
+
44
+ // An editor or console: the whole palette.
45
+ await registerMuiPlugin()
46
+
47
+ // A published page: only the elements this page places.
48
+ await registerMuiPlugin({ componentIds: ['section', 'muiTypography', 'muiButton'] })
49
+ ```
50
+
51
+ 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.
52
+
53
+ ## How it fits
54
+
55
+ 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`.
56
+
57
+ ## License
58
+
59
+ Apache-2.0. Source: https://github.com/aglyn/aglyn/tree/main/libs/plugins/mui
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aglyn/plugins-mui",
3
- "version": "1.0.0-beta.143",
3
+ "version": "1.0.0-beta.144",
4
4
  "license": "Apache-2.0",
5
5
  "homepage": "https://aglyn.com",
6
6
  "repository": {
@@ -25,12 +25,12 @@
25
25
  "./package.json": "./package.json"
26
26
  },
27
27
  "dependencies": {
28
- "@aglyn/aglyn": "1.0.0-beta.143",
29
- "@aglyn/shared-data-enums": "1.0.0-beta.143",
30
- "@aglyn/shared-data-mdi": "1.0.0-beta.143",
31
- "@aglyn/shared-ui-jsx": "1.0.0-beta.143",
32
- "@aglyn/shared-ui-theme": "1.0.0-beta.143",
33
- "@aglyn/shared-util-vendor": "1.0.0-beta.143",
28
+ "@aglyn/aglyn": "1.0.0-beta.144",
29
+ "@aglyn/shared-data-enums": "1.0.0-beta.144",
30
+ "@aglyn/shared-data-mdi": "1.0.0-beta.144",
31
+ "@aglyn/shared-ui-jsx": "1.0.0-beta.144",
32
+ "@aglyn/shared-ui-theme": "1.0.0-beta.144",
33
+ "@aglyn/shared-util-vendor": "1.0.0-beta.144",
34
34
  "@swc/helpers": "0.5.23",
35
35
  "mobx": "^6.16.1",
36
36
  "mobx-react-lite": "^4.1.1"