@aglyn/plugins-mui 1.0.0-beta.213 → 1.0.0-beta.214

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aglyn/plugins-mui",
3
- "version": "1.0.0-beta.213",
3
+ "version": "1.0.0-beta.214",
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.213",
29
- "@aglyn/shared-data-enums": "1.0.0-beta.213",
30
- "@aglyn/shared-data-mdi": "1.0.0-beta.213",
31
- "@aglyn/shared-ui-jsx": "1.0.0-beta.213",
32
- "@aglyn/shared-ui-theme": "1.0.0-beta.213",
33
- "@aglyn/shared-util-vendor": "1.0.0-beta.213",
28
+ "@aglyn/aglyn": "1.0.0-beta.214",
29
+ "@aglyn/shared-data-enums": "1.0.0-beta.214",
30
+ "@aglyn/shared-data-mdi": "1.0.0-beta.214",
31
+ "@aglyn/shared-ui-jsx": "1.0.0-beta.214",
32
+ "@aglyn/shared-ui-theme": "1.0.0-beta.214",
33
+ "@aglyn/shared-util-vendor": "1.0.0-beta.214",
34
34
  "@swc/helpers": "0.5.23",
35
35
  "mobx": "^6.16.1",
36
36
  "mobx-react-lite": "^4.1.1"
@@ -0,0 +1,47 @@
1
+ /**
2
+ * The drawer presets an installed marketplace plugin contributes (AGL-190,
3
+ * AGL-1031), apart from the element that renders them.
4
+ *
5
+ * `plugin.ts` registers these mappers on every surface, published pages
6
+ * included, and the Plugin element itself loads only where it is placed. In
7
+ * the element's module the mappers pinned the whole module — its component
8
+ * and the sandboxed frame — to every published page, because a module a
9
+ * surface imports statically and also lazily is one module, with every export
10
+ * kept (AGL-3401).
11
+ */
12
+ import * as Aglyn from '@aglyn/aglyn';
13
+ /** The besigner drawer category installed plugins register under (AGL-190). */
14
+ export declare const PLUGIN_DRAWER_CATEGORY = "Marketplace";
15
+ export interface PluginInstallLike {
16
+ listingId?: string;
17
+ $id?: string;
18
+ displayName?: string;
19
+ pluginId?: string;
20
+ manifest?: {
21
+ name?: string;
22
+ restrictParent?: string[];
23
+ restrictChildren?: string[];
24
+ };
25
+ }
26
+ /**
27
+ * Builds a besigner preset for an installed plugin (AGL-190): a named,
28
+ * draggable drawer entry that drops a `marketplacePlugin` node with the
29
+ * listing id pre-pinned, so editors never hand-type ids. Reuses the single
30
+ * `marketplacePlugin` renderer — no per-plugin component registration. The
31
+ * manifest's lineal rules ride on the node data for later enforcement.
32
+ * Returns null for an install without a resolvable listing id.
33
+ */
34
+ export declare function muiPluginInstallToPreset(install: PluginInstallLike): Aglyn.PresetSchema | null;
35
+ /**
36
+ * Every drawer preset an installed plugin contributes (AGL-1031).
37
+ *
38
+ * The generic Plugin element, plus one per element the PINNED version
39
+ * declares. Declared elements save as the same node with an `elementId`
40
+ * alongside the listing id — the issue's preferred answer, and the one that
41
+ * keeps a single compose path and a single sandbox. What changes is the
42
+ * palette entry and the label, not what executes.
43
+ *
44
+ * Resolved from the pin, so an element appears only where the plugin is
45
+ * installed and disappears with a revoked or downgraded version.
46
+ */
47
+ export declare function muiPluginInstallToPresets(install: PluginInstallLike): Aglyn.PresetSchema[];
@@ -0,0 +1,136 @@
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
+ */ 'use client';
17
+ import { _ as _extends } from "@swc/helpers/_/_extends";
18
+ /**
19
+ * The drawer presets an installed marketplace plugin contributes (AGL-190,
20
+ * AGL-1031), apart from the element that renders them.
21
+ *
22
+ * `plugin.ts` registers these mappers on every surface, published pages
23
+ * included, and the Plugin element itself loads only where it is placed. In
24
+ * the element's module the mappers pinned the whole module — its component
25
+ * and the sandboxed frame — to every published page, because a module a
26
+ * surface imports statically and also lazily is one module, with every export
27
+ * kept (AGL-3401).
28
+ */ import * as Aglyn from "@aglyn/aglyn";
29
+ import { MdiIcons, mdiPuzzle } from "@aglyn/shared-data-mdi";
30
+ import { BUNDLE_ID } from "../constants/bundle-common.js";
31
+ /** The Plugin element's component id, as the presets name it. */ const ID = Aglyn.PLUGIN_COMPONENT_ID;
32
+ /** The besigner drawer category installed plugins register under (AGL-190). */ export const PLUGIN_DRAWER_CATEGORY = 'Marketplace';
33
+ /**
34
+ * Builds a besigner preset for an installed plugin (AGL-190): a named,
35
+ * draggable drawer entry that drops a `marketplacePlugin` node with the
36
+ * listing id pre-pinned, so editors never hand-type ids. Reuses the single
37
+ * `marketplacePlugin` renderer — no per-plugin component registration. The
38
+ * manifest's lineal rules ride on the node data for later enforcement.
39
+ * Returns null for an install without a resolvable listing id.
40
+ */ export function muiPluginInstallToPreset(install) {
41
+ var _install_listingId;
42
+ var _install_manifest, _install_manifest1, _install_manifest2;
43
+ const listingId = (_install_listingId = install.listingId) != null ? _install_listingId : install.$id;
44
+ if (!listingId) return null;
45
+ const name = install.displayName || ((_install_manifest = install.manifest) == null ? void 0 : _install_manifest.name) || 'Marketplace plugin';
46
+ return {
47
+ $id: `plugin__${listingId}`,
48
+ type: Aglyn.NodeType.PRESET,
49
+ displayName: name,
50
+ pluginId: BUNDLE_ID,
51
+ description: 'Installed marketplace plugin',
52
+ category: PLUGIN_DRAWER_CATEGORY,
53
+ icon: {
54
+ path: mdiPuzzle.path,
55
+ sx: {
56
+ color: '#5e35b1'
57
+ }
58
+ },
59
+ data: _extends({
60
+ $id: null,
61
+ componentId: ID,
62
+ pluginId: BUNDLE_ID,
63
+ props: {
64
+ listingId
65
+ }
66
+ }, ((_install_manifest1 = install.manifest) == null ? void 0 : _install_manifest1.restrictParent) ? {
67
+ restrictParent: install.manifest.restrictParent
68
+ } : {}, ((_install_manifest2 = install.manifest) == null ? void 0 : _install_manifest2.restrictChildren) ? {
69
+ restrictChildren: install.manifest.restrictChildren
70
+ } : {})
71
+ };
72
+ }
73
+ /**
74
+ * Every drawer preset an installed plugin contributes (AGL-1031).
75
+ *
76
+ * The generic Plugin element, plus one per element the PINNED version
77
+ * declares. Declared elements save as the same node with an `elementId`
78
+ * alongside the listing id — the issue's preferred answer, and the one that
79
+ * keeps a single compose path and a single sandbox. What changes is the
80
+ * palette entry and the label, not what executes.
81
+ *
82
+ * Resolved from the pin, so an element appears only where the plugin is
83
+ * installed and disappears with a revoked or downgraded version.
84
+ */ export function muiPluginInstallToPresets(install) {
85
+ var _install_listingId;
86
+ var _install_manifest;
87
+ const generic = muiPluginInstallToPreset(install);
88
+ const presets = generic ? [
89
+ generic
90
+ ] : [];
91
+ const listingId = (_install_listingId = install.listingId) != null ? _install_listingId : install.$id;
92
+ if (!listingId) return presets;
93
+ for (const element of Aglyn.resolvePluginElements({
94
+ listingId,
95
+ capabilities: (_install_manifest = install.manifest) == null ? void 0 : _install_manifest.capabilities,
96
+ manifest: install.manifest
97
+ })){
98
+ var _element_description, _ref;
99
+ var _install_manifest1, _install_manifest2;
100
+ // The declared icon is an mdi NAME; look it up in the set the host already
101
+ // ships. An unresolved name falls back to the puzzle mark rather than
102
+ // rendering nothing — the entry is still placeable, which matters more
103
+ // than the glyph.
104
+ const declared = element.icon ? MdiIcons.get(element.icon) : undefined;
105
+ presets.push({
106
+ $id: `plugin__${listingId}__${element.elementId}`,
107
+ type: Aglyn.NodeType.PRESET,
108
+ displayName: element.displayName,
109
+ pluginId: BUNDLE_ID,
110
+ description: (_element_description = element.description) != null ? _element_description : 'Installed marketplace plugin',
111
+ category: element.category,
112
+ icon: {
113
+ path: (_ref = declared == null ? void 0 : declared.path) != null ? _ref : mdiPuzzle.path,
114
+ sx: {
115
+ color: '#5e35b1'
116
+ }
117
+ },
118
+ data: _extends({
119
+ $id: null,
120
+ componentId: ID,
121
+ pluginId: BUNDLE_ID,
122
+ props: {
123
+ listingId,
124
+ elementId: element.elementId
125
+ }
126
+ }, ((_install_manifest1 = install.manifest) == null ? void 0 : _install_manifest1.restrictParent) ? {
127
+ restrictParent: install.manifest.restrictParent
128
+ } : {}, ((_install_manifest2 = install.manifest) == null ? void 0 : _install_manifest2.restrictChildren) ? {
129
+ restrictChildren: install.manifest.restrictChildren
130
+ } : {})
131
+ });
132
+ }
133
+ return presets;
134
+ }
135
+
136
+ //# sourceMappingURL=plugin-install-presets.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../../../libs/plugins/mui/src/lib/components/plugin-install-presets.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'use client'\n\n/**\n * The drawer presets an installed marketplace plugin contributes (AGL-190,\n * AGL-1031), apart from the element that renders them.\n *\n * `plugin.ts` registers these mappers on every surface, published pages\n * included, and the Plugin element itself loads only where it is placed. In\n * the element's module the mappers pinned the whole module — its component\n * and the sandboxed frame — to every published page, because a module a\n * surface imports statically and also lazily is one module, with every export\n * kept (AGL-3401).\n */\n\nimport * as Aglyn from '@aglyn/aglyn'\nimport { MdiIcons, mdiPuzzle } from '@aglyn/shared-data-mdi'\nimport { BUNDLE_ID } from '../constants/bundle-common'\n\n/** The Plugin element's component id, as the presets name it. */\nconst ID: Aglyn.ComponentId = Aglyn.PLUGIN_COMPONENT_ID\n\n/** The besigner drawer category installed plugins register under (AGL-190). */\nexport const PLUGIN_DRAWER_CATEGORY = 'Marketplace'\n\nexport interface PluginInstallLike {\n listingId?: string\n $id?: string\n displayName?: string\n pluginId?: string\n manifest?: {\n name?: string\n restrictParent?: string[]\n restrictChildren?: string[]\n }\n}\n\n/**\n * Builds a besigner preset for an installed plugin (AGL-190): a named,\n * draggable drawer entry that drops a `marketplacePlugin` node with the\n * listing id pre-pinned, so editors never hand-type ids. Reuses the single\n * `marketplacePlugin` renderer — no per-plugin component registration. The\n * manifest's lineal rules ride on the node data for later enforcement.\n * Returns null for an install without a resolvable listing id.\n */\nexport function muiPluginInstallToPreset(\n install: PluginInstallLike,\n): Aglyn.PresetSchema | null {\n const listingId = install.listingId ?? install.$id\n if (!listingId) return null\n const name =\n install.displayName || install.manifest?.name || 'Marketplace plugin'\n return {\n $id: `plugin__${listingId}`,\n type: Aglyn.NodeType.PRESET,\n displayName: name,\n pluginId: BUNDLE_ID,\n description: 'Installed marketplace plugin',\n category: PLUGIN_DRAWER_CATEGORY,\n icon: { path: mdiPuzzle.path, sx: { color: '#5e35b1' } },\n data: {\n $id: null,\n componentId: ID,\n pluginId: BUNDLE_ID,\n props: { listingId },\n ...(install.manifest?.restrictParent\n ? { restrictParent: install.manifest.restrictParent }\n : {}),\n ...(install.manifest?.restrictChildren\n ? { restrictChildren: install.manifest.restrictChildren }\n : {}),\n } as any,\n }\n}\n\n/**\n * Every drawer preset an installed plugin contributes (AGL-1031).\n *\n * The generic Plugin element, plus one per element the PINNED version\n * declares. Declared elements save as the same node with an `elementId`\n * alongside the listing id — the issue's preferred answer, and the one that\n * keeps a single compose path and a single sandbox. What changes is the\n * palette entry and the label, not what executes.\n *\n * Resolved from the pin, so an element appears only where the plugin is\n * installed and disappears with a revoked or downgraded version.\n */\nexport function muiPluginInstallToPresets(\n install: PluginInstallLike,\n): Aglyn.PresetSchema[] {\n const generic = muiPluginInstallToPreset(install)\n const presets = generic ? [generic] : []\n const listingId = install.listingId ?? install.$id\n if (!listingId) return presets\n\n for (const element of Aglyn.resolvePluginElements({\n listingId,\n capabilities: (install as any).manifest?.capabilities,\n manifest: (install as any).manifest,\n })) {\n // The declared icon is an mdi NAME; look it up in the set the host already\n // ships. An unresolved name falls back to the puzzle mark rather than\n // rendering nothing — the entry is still placeable, which matters more\n // than the glyph.\n const declared = element.icon ? MdiIcons.get(element.icon as never) : undefined\n presets.push({\n $id: `plugin__${listingId}__${element.elementId}`,\n type: Aglyn.NodeType.PRESET,\n displayName: element.displayName,\n pluginId: BUNDLE_ID,\n description: element.description ?? 'Installed marketplace plugin',\n category: element.category,\n icon: {\n path: (declared as { path?: string } | undefined)?.path ?? mdiPuzzle.path,\n sx: { color: '#5e35b1' },\n },\n data: {\n $id: null,\n componentId: ID,\n pluginId: BUNDLE_ID,\n props: { listingId, elementId: element.elementId },\n ...(install.manifest?.restrictParent\n ? { restrictParent: install.manifest.restrictParent }\n : {}),\n ...(install.manifest?.restrictChildren\n ? { restrictChildren: install.manifest.restrictChildren }\n : {}),\n } as any,\n })\n }\n return presets\n}\n"],"names":["Aglyn","MdiIcons","mdiPuzzle","BUNDLE_ID","ID","PLUGIN_COMPONENT_ID","PLUGIN_DRAWER_CATEGORY","muiPluginInstallToPreset","install","listingId","$id","name","displayName","manifest","type","NodeType","PRESET","pluginId","description","category","icon","path","sx","color","data","componentId","props","restrictParent","restrictChildren","muiPluginInstallToPresets","generic","presets","element","resolvePluginElements","capabilities","declared","get","undefined","push","elementId"],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC,GACD;;AAEA;;;;;;;;;;CAUC,GAED,YAAYA,WAAW,eAAc;AACrC,SAASC,QAAQ,EAAEC,SAAS,QAAQ,yBAAwB;AAC5D,SAASC,SAAS,QAAQ,gCAA4B;AAEtD,+DAA+D,GAC/D,MAAMC,KAAwBJ,MAAMK,mBAAmB;AAEvD,6EAA6E,GAC7E,OAAO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oBAAA,AAAC1B,QAAgBK,QAAQ,qBAAzB,kBAA2BqB,YAAY;QACrDrB,UAAU,AAACL,QAAgBK,QAAQ;IACrC,GAAI;YAWamB;YAWPxB,oBAGAA;QAxBR,2EAA2E;QAC3E,sEAAsE;QACtE,uEAAuE;QACvE,kBAAkB;QAClB,MAAM2B,WAAWH,QAAQZ,IAAI,GAAGnB,SAASmC,GAAG,CAACJ,QAAQZ,IAAI,IAAaiB;QACtEN,QAAQO,IAAI,CAAC;YACX5B,KAAK,CAAC,QAAQ,EAAED,UAAU,EAAE,EAAEuB,QAAQO,SAAS,EAAE;YACjDzB,MAAMd,MAAMe,QAAQ,CAACC,MAAM;YAC3BJ,aAAaoB,QAAQpB,WAAW;YAChCK,UAAUd;YACVe,WAAW,GAAEc,uBAAAA,QAAQd,WAAW,YAAnBc,uBAAuB;YACpCb,UAAUa,QAAQb,QAAQ;YAC1BC,MAAM;gBACJC,IAAI,UAAGc,4BAAD,AAACA,SAA4Cd,IAAI,mBAAInB,UAAUmB,IAAI;gBACzEC,IAAI;oBAAEC,OAAO;gBAAU;YACzB;YACAC,MAAM;gBACJd,KAAK;gBACLe,aAAarB;gBACba,UAAUd;gBACVuB,OAAO;oBAAEjB;oBAAW8B,WAAWP,QAAQO,SAAS;gBAAC;eAC7C/B,EAAAA,qBAAAA,QAAQK,QAAQ,qBAAhBL,mBAAkBmB,cAAc,IAChC;gBAAEA,gBAAgBnB,QAAQK,QAAQ,CAACc,cAAc;YAAC,IAClD,CAAC,GACDnB,EAAAA,qBAAAA,QAAQK,QAAQ,qBAAhBL,mBAAkBoB,gBAAgB,IAClC;gBAAEA,kBAAkBpB,QAAQK,QAAQ,CAACe,gBAAgB;YAAC,IACtD,CAAC;QAET;IACF;IACA,OAAOG;AACT"}
@@ -57,39 +57,5 @@ export declare function placeholderText(listingId: string | undefined): string;
57
57
  declare const MarketplacePlugin: import("react").ForwardRefExoticComponent<MarketplacePluginProps & import("react").RefAttributes<HTMLElement>>;
58
58
  export declare const schema: Aglyn.ComponentSchema<MarketplacePluginProps>;
59
59
  export declare const presets: Aglyn.PresetSchema[];
60
- /** The besigner drawer category installed plugins register under (AGL-190). */
61
- export declare const PLUGIN_DRAWER_CATEGORY = "Marketplace";
62
- export interface PluginInstallLike {
63
- listingId?: string;
64
- $id?: string;
65
- displayName?: string;
66
- pluginId?: string;
67
- manifest?: {
68
- name?: string;
69
- restrictParent?: string[];
70
- restrictChildren?: string[];
71
- };
72
- }
73
- /**
74
- * Builds a besigner preset for an installed plugin (AGL-190): a named,
75
- * draggable drawer entry that drops a `marketplacePlugin` node with the
76
- * listing id pre-pinned, so editors never hand-type ids. Reuses the single
77
- * `marketplacePlugin` renderer — no per-plugin component registration. The
78
- * manifest's lineal rules ride on the node data for later enforcement.
79
- * Returns null for an install without a resolvable listing id.
80
- */
81
- export declare function muiPluginInstallToPreset(install: PluginInstallLike): Aglyn.PresetSchema | null;
82
- /**
83
- * Every drawer preset an installed plugin contributes (AGL-1031).
84
- *
85
- * The generic Plugin element, plus one per element the PINNED version
86
- * declares. Declared elements save as the same node with an `elementId`
87
- * alongside the listing id — the issue's preferred answer, and the one that
88
- * keeps a single compose path and a single sandbox. What changes is the
89
- * palette entry and the label, not what executes.
90
- *
91
- * Resolved from the pin, so an element appears only where the plugin is
92
- * installed and disappears with a revoked or downgraded version.
93
- */
94
- export declare function muiPluginInstallToPresets(install: PluginInstallLike): Aglyn.PresetSchema[];
60
+ export { PLUGIN_DRAWER_CATEGORY, type PluginInstallLike, muiPluginInstallToPreset, muiPluginInstallToPresets, } from './plugin-install-presets';
95
61
  export default MarketplacePlugin;
@@ -18,7 +18,6 @@ import { _ as _extends } from "@swc/helpers/_/_extends";
18
18
  import { _ as _object_without_properties_loose } from "@swc/helpers/_/_object_without_properties_loose";
19
19
  import { jsx as _jsx } from "react/jsx-runtime";
20
20
  import * as Aglyn from "@aglyn/aglyn";
21
- import { MdiIcons } from "@aglyn/shared-data-mdi";
22
21
  import { mdiPuzzle } from "@aglyn/shared-data-mdi";
23
22
  import Box from "@mui/material/Box";
24
23
  import { forwardRef, useContext } from "react";
@@ -196,109 +195,7 @@ export const presets = [
196
195
  }
197
196
  }
198
197
  ];
199
- /** The besigner drawer category installed plugins register under (AGL-190). */ export const PLUGIN_DRAWER_CATEGORY = 'Marketplace';
200
- /**
201
- * Builds a besigner preset for an installed plugin (AGL-190): a named,
202
- * draggable drawer entry that drops a `marketplacePlugin` node with the
203
- * listing id pre-pinned, so editors never hand-type ids. Reuses the single
204
- * `marketplacePlugin` renderer — no per-plugin component registration. The
205
- * manifest's lineal rules ride on the node data for later enforcement.
206
- * Returns null for an install without a resolvable listing id.
207
- */ export function muiPluginInstallToPreset(install) {
208
- var _install_listingId;
209
- var _install_manifest, _install_manifest1, _install_manifest2;
210
- const listingId = (_install_listingId = install.listingId) != null ? _install_listingId : install.$id;
211
- if (!listingId) return null;
212
- const name = install.displayName || ((_install_manifest = install.manifest) == null ? void 0 : _install_manifest.name) || 'Marketplace plugin';
213
- return {
214
- $id: `plugin__${listingId}`,
215
- type: Aglyn.NodeType.PRESET,
216
- displayName: name,
217
- pluginId: BUNDLE_ID,
218
- description: 'Installed marketplace plugin',
219
- category: PLUGIN_DRAWER_CATEGORY,
220
- icon: {
221
- path: mdiPuzzle.path,
222
- sx: {
223
- color: '#5e35b1'
224
- }
225
- },
226
- data: _extends({
227
- $id: null,
228
- componentId: ID,
229
- pluginId: BUNDLE_ID,
230
- props: {
231
- listingId
232
- }
233
- }, ((_install_manifest1 = install.manifest) == null ? void 0 : _install_manifest1.restrictParent) ? {
234
- restrictParent: install.manifest.restrictParent
235
- } : {}, ((_install_manifest2 = install.manifest) == null ? void 0 : _install_manifest2.restrictChildren) ? {
236
- restrictChildren: install.manifest.restrictChildren
237
- } : {})
238
- };
239
- }
240
- /**
241
- * Every drawer preset an installed plugin contributes (AGL-1031).
242
- *
243
- * The generic Plugin element, plus one per element the PINNED version
244
- * declares. Declared elements save as the same node with an `elementId`
245
- * alongside the listing id — the issue's preferred answer, and the one that
246
- * keeps a single compose path and a single sandbox. What changes is the
247
- * palette entry and the label, not what executes.
248
- *
249
- * Resolved from the pin, so an element appears only where the plugin is
250
- * installed and disappears with a revoked or downgraded version.
251
- */ export function muiPluginInstallToPresets(install) {
252
- var _install_listingId;
253
- var _install_manifest;
254
- const generic = muiPluginInstallToPreset(install);
255
- const presets = generic ? [
256
- generic
257
- ] : [];
258
- const listingId = (_install_listingId = install.listingId) != null ? _install_listingId : install.$id;
259
- if (!listingId) return presets;
260
- for (const element of Aglyn.resolvePluginElements({
261
- listingId,
262
- capabilities: (_install_manifest = install.manifest) == null ? void 0 : _install_manifest.capabilities,
263
- manifest: install.manifest
264
- })){
265
- var _element_description, _ref;
266
- var _install_manifest1, _install_manifest2;
267
- // The declared icon is an mdi NAME; look it up in the set the host already
268
- // ships. An unresolved name falls back to the puzzle mark rather than
269
- // rendering nothing — the entry is still placeable, which matters more
270
- // than the glyph.
271
- const declared = element.icon ? MdiIcons.get(element.icon) : undefined;
272
- presets.push({
273
- $id: `plugin__${listingId}__${element.elementId}`,
274
- type: Aglyn.NodeType.PRESET,
275
- displayName: element.displayName,
276
- pluginId: BUNDLE_ID,
277
- description: (_element_description = element.description) != null ? _element_description : 'Installed marketplace plugin',
278
- category: element.category,
279
- icon: {
280
- path: (_ref = declared == null ? void 0 : declared.path) != null ? _ref : mdiPuzzle.path,
281
- sx: {
282
- color: '#5e35b1'
283
- }
284
- },
285
- data: _extends({
286
- $id: null,
287
- componentId: ID,
288
- pluginId: BUNDLE_ID,
289
- props: {
290
- listingId,
291
- elementId: element.elementId
292
- }
293
- }, ((_install_manifest1 = install.manifest) == null ? void 0 : _install_manifest1.restrictParent) ? {
294
- restrictParent: install.manifest.restrictParent
295
- } : {}, ((_install_manifest2 = install.manifest) == null ? void 0 : _install_manifest2.restrictChildren) ? {
296
- restrictChildren: install.manifest.restrictChildren
297
- } : {})
298
- });
299
- }
300
- return presets;
301
- }
198
+ export { PLUGIN_DRAWER_CATEGORY, muiPluginInstallToPreset, muiPluginInstallToPresets } from "./plugin-install-presets.js";
302
199
  export default MarketplacePlugin;
303
200
 
304
201
  //# sourceMappingURL=plugin.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../../../libs/plugins/mui/src/lib/components/plugin.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'use client'\n\nimport * as Aglyn from '@aglyn/aglyn'\nimport { MdiIcons } from '@aglyn/shared-data-mdi'\nimport { registerPluginInstallPresetMapper } from '@aglyn/aglyn'\nimport { mdiPuzzle } from '@aglyn/shared-data-mdi'\nimport Box from '@mui/material/Box'\nimport { forwardRef, useContext } from 'react'\nimport { BUNDLE_ID } from '../constants/bundle-common'\nimport { generatePresetId } from '../utils/generate-preset-id'\nimport { PluginFrame } from './plugin-frame'\n\n// Component id is persisted in screen documents; never rename.\nexport const ID: Aglyn.ComponentId = Aglyn.PLUGIN_COMPONENT_ID\n\nexport interface MarketplacePluginProps {\n /** Installed listing id; the only prop authors set. */\n listingId?: string\n /**\n * Which DECLARED element of the plugin this node is (AGL-1031). Set by the\n * palette preset; absent for the generic Plugin element. Passed through to\n * the sandboxed frame as an ordinary prop, so one node type and one compose\n * path serve both.\n */\n elementId?: string\n /** Injected at compose by `attachPluginInstalls` (AGL-45). */\n version?: string\n sha256?: string\n capabilities?: Aglyn.PluginCapabilities\n revoked?: boolean\n /** Extra props forwarded to the plugin (filtered to its allowlist). */\n pluginProps?: Record<string, unknown>\n /**\n * Per-placement plugin settings as JSON (AGL-192), authored in the\n * element panel. Parsed into `pluginProps` and filtered to the\n * manifest's declared props before it reaches the plugin.\n */\n pluginPropsJson?: string\n}\n\n/** Parses the authored settings JSON; invalid input yields no props. */\nexport function parsePluginPropsJson(\n raw: string | undefined,\n): Record<string, unknown> | undefined {\n if (!raw || !raw.trim()) return undefined\n try {\n const parsed = JSON.parse(raw)\n return parsed && typeof parsed === 'object' && !Array.isArray(parsed)\n ? (parsed as Record<string, unknown>)\n : undefined\n } catch {\n return undefined\n }\n}\n\n/**\n * What the inert placeholder says, and — more to the point — what it refuses\n * to say (AGL-1029).\n *\n * It used to read \"not installed on this site\" for EVERY plugin with a listing\n * id, because it inferred installation from `version`/`sha256`: fields the\n * tenant compose pass injects and the canvas never has. Plugins do not execute\n * in the editor by design, so their absence there means nothing about the pin,\n * and the first thing an author saw after installing was a message telling them\n * the install had failed.\n *\n * The claim is only made when it has been earned. The editor publishes the\n * installs it reads (`setKnownPluginInstalls`); a listing id missing from that\n * list really is not installed. Where nothing published a list — a preview —\n * the placeholder states what is true of the placement instead and asserts\n * nothing about installation. A published page draws no placeholder at all.\n */\nexport function placeholderText(listingId: string | undefined): string {\n if (!listingId) return 'Plugin — pick an installed plugin'\n const known = Aglyn.getKnownPluginInstall(listingId)\n if (known) {\n const name = known.displayName || 'Plugin'\n return known.scope === 'org'\n ? `${name} — installed org-wide; renders on the published site`\n : `${name} — renders on the published site`\n }\n return Aglyn.hasKnownPluginInstalls()\n ? 'Plugin — not installed on this site'\n : 'Plugin — renders on the published site'\n}\n\n/**\n * Marketplace plugin element (AGL-45): a placement for an installed executable\n * plugin. The saved node carries only `listingId`; the tenant compose pass\n * (`attachPluginInstalls`) injects the pinned version/sha256/capabilities +\n * kill-switch state, and this renders them through the sandboxed\n * `PluginFrame`. Without a resolved install (the editor canvas, or an\n * uninstalled listing) it shows an inert placeholder — plugins never\n * execute in the editor. The plugin origin is a NEXT_PUBLIC env so it's\n * available in the browser bundle; unset = plugins disabled (placeholder).\n */\nconst MarketplacePlugin = forwardRef<HTMLElement, MarketplacePluginProps>(\n (props, ref) => {\n const {\n listingId,\n elementId,\n version,\n sha256,\n capabilities,\n revoked,\n pluginProps,\n pluginPropsJson,\n ...rest\n } = props\n // Node styles ride the renderer-merged sx; recompose (stack.ts pattern).\n const nodeSx = Array.isArray(props['sx']) ? props['sx'] : [props['sx']]\n // Merge authored settings (AGL-192) under any compose-injected props;\n // PluginFrame filters the result to the manifest allowlist.\n const resolvedPluginProps = {\n ...(pluginProps ?? {}),\n ...(parsePluginPropsJson(pluginPropsJson) ?? {}),\n }\n const pluginOrigin =\n typeof process !== 'undefined'\n ? // Dot notation (AGL-2037) — a client component; the bracket\n // form reads undefined in the browser.\n process.env.NEXT_PUBLIC_PLUGIN_ORIGIN\n : undefined\n // Host id for host-mediated fetch (AGL-191); empty in the editor.\n const { hostId } = Aglyn.useSite()\n const { suppressNavigation } = useContext(Aglyn.ScreenLinkContext)\n\n // No resolved install (editor canvas / uninstalled): inert placeholder,\n // which speaks to the author, so a published page renders the bare\n // element instead.\n if (!listingId || !version || !sha256) {\n if (!suppressNavigation) return <Box ref={ref as any} {...rest} />\n return (\n <Box\n ref={ref as any}\n {...rest}\n sx={[\n {\n minHeight: 120,\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n border: '1px dashed',\n borderColor: 'divider',\n borderRadius: 1,\n color: 'text.secondary',\n fontSize: 13,\n fontFamily: 'system-ui, sans-serif',\n p: 2,\n textAlign: 'center',\n },\n ...nodeSx,\n ]}\n >\n {placeholderText(listingId)}\n </Box>\n )\n }\n\n return (\n <PluginFrame\n ref={ref as any}\n pluginOrigin={pluginOrigin}\n hostId={hostId}\n listingId={listingId}\n elementId={elementId}\n version={version}\n sha256={sha256}\n capabilities={capabilities}\n pluginProps={resolvedPluginProps}\n revoked={revoked}\n />\n )\n },\n)\nMarketplacePlugin.displayName = 'AglynMarketplacePlugin'\n\nexport const schema: Aglyn.ComponentSchema<MarketplacePluginProps> = {\n $id: ID,\n pluginId: BUNDLE_ID,\n displayName: 'Plugin',\n description:\n 'Where an installed marketplace plugin renders, in its own sandbox.',\n category: Aglyn.ComponentCategory.DATA_DISPLAY,\n icon: { path: mdiPuzzle.path, sx: { color: '#5e35b1' } },\n flags: { selfClosing: Aglyn.FEATURE_FLAG.ENABLED },\n attributes: [\n {\n name: 'listingId',\n // A picker over what is actually installed (AGL-1030), not a typed\n // document id: a mistyped character used to produce an element that\n // looked broken with no clue why. The old helper text also pointed at\n // \"Manage → Plugins\", a path AGL-1011 removed (AGL-1029).\n description:\n 'Which installed plugin to place here. The sandboxed plugin renders ' +\n 'in an isolated iframe region on the published site.',\n component: Aglyn.FieldComponentType.PLUGIN_SELECT,\n label: 'Plugin',\n },\n {\n name: 'pluginPropsJson',\n description:\n 'Only what this plugin declares in its manifest is offered here, so ' +\n 'what you set is what it receives. \"Edit as JSON\" covers anything a ' +\n 'declaration does not.',\n // Was a raw JSON textarea (AGL-1049): authors guessed key names, and a\n // typo did not fail — `filterPluginProps` silently dropped it.\n component: Aglyn.FieldComponentType.PLUGIN_SETTINGS,\n label: 'Plugin settings',\n },\n ],\n}\n\nexport const presets: Aglyn.PresetSchema[] = [\n {\n $id: generatePresetId(ID),\n type: Aglyn.NodeType.PRESET,\n displayName: 'Plugin',\n pluginId: BUNDLE_ID,\n description: 'Sandboxed marketplace plugin region',\n category: Aglyn.ComponentCategory.DATA_DISPLAY,\n icon: { path: mdiPuzzle.path, sx: { color: '#5e35b1' } },\n data: {\n $id: null,\n componentId: ID,\n pluginId: BUNDLE_ID,\n props: {},\n },\n },\n]\n\n/** The besigner drawer category installed plugins register under (AGL-190). */\nexport const PLUGIN_DRAWER_CATEGORY = 'Marketplace'\n\nexport interface PluginInstallLike {\n listingId?: string\n $id?: string\n displayName?: string\n pluginId?: string\n manifest?: {\n name?: string\n restrictParent?: string[]\n restrictChildren?: string[]\n }\n}\n\n/**\n * Builds a besigner preset for an installed plugin (AGL-190): a named,\n * draggable drawer entry that drops a `marketplacePlugin` node with the\n * listing id pre-pinned, so editors never hand-type ids. Reuses the single\n * `marketplacePlugin` renderer — no per-plugin component registration. The\n * manifest's lineal rules ride on the node data for later enforcement.\n * Returns null for an install without a resolvable listing id.\n */\nexport function muiPluginInstallToPreset(\n install: PluginInstallLike,\n): Aglyn.PresetSchema | null {\n const listingId = install.listingId ?? install.$id\n if (!listingId) return null\n const name =\n install.displayName || install.manifest?.name || 'Marketplace plugin'\n return {\n $id: `plugin__${listingId}`,\n type: Aglyn.NodeType.PRESET,\n displayName: name,\n pluginId: BUNDLE_ID,\n description: 'Installed marketplace plugin',\n category: PLUGIN_DRAWER_CATEGORY,\n icon: { path: mdiPuzzle.path, sx: { color: '#5e35b1' } },\n data: {\n $id: null,\n componentId: ID,\n pluginId: BUNDLE_ID,\n props: { listingId },\n ...(install.manifest?.restrictParent\n ? { restrictParent: install.manifest.restrictParent }\n : {}),\n ...(install.manifest?.restrictChildren\n ? { restrictChildren: install.manifest.restrictChildren }\n : {}),\n } as any,\n }\n}\n\n/**\n * Every drawer preset an installed plugin contributes (AGL-1031).\n *\n * The generic Plugin element, plus one per element the PINNED version\n * declares. Declared elements save as the same node with an `elementId`\n * alongside the listing id — the issue's preferred answer, and the one that\n * keeps a single compose path and a single sandbox. What changes is the\n * palette entry and the label, not what executes.\n *\n * Resolved from the pin, so an element appears only where the plugin is\n * installed and disappears with a revoked or downgraded version.\n */\nexport function muiPluginInstallToPresets(\n install: PluginInstallLike,\n): Aglyn.PresetSchema[] {\n const generic = muiPluginInstallToPreset(install)\n const presets = generic ? [generic] : []\n const listingId = install.listingId ?? install.$id\n if (!listingId) return presets\n\n for (const element of Aglyn.resolvePluginElements({\n listingId,\n capabilities: (install as any).manifest?.capabilities,\n manifest: (install as any).manifest,\n })) {\n // The declared icon is an mdi NAME; look it up in the set the host already\n // ships. An unresolved name falls back to the puzzle mark rather than\n // rendering nothing — the entry is still placeable, which matters more\n // than the glyph.\n const declared = element.icon ? MdiIcons.get(element.icon as never) : undefined\n presets.push({\n $id: `plugin__${listingId}__${element.elementId}`,\n type: Aglyn.NodeType.PRESET,\n displayName: element.displayName,\n pluginId: BUNDLE_ID,\n description: element.description ?? 'Installed marketplace plugin',\n category: element.category,\n icon: {\n path: (declared as { path?: string } | undefined)?.path ?? mdiPuzzle.path,\n sx: { color: '#5e35b1' },\n },\n data: {\n $id: null,\n componentId: ID,\n pluginId: BUNDLE_ID,\n props: { listingId, elementId: element.elementId },\n ...(install.manifest?.restrictParent\n ? { restrictParent: install.manifest.restrictParent }\n : {}),\n ...(install.manifest?.restrictChildren\n ? { restrictChildren: install.manifest.restrictChildren }\n : {}),\n } as any,\n })\n }\n return presets\n}\n\nexport default MarketplacePlugin\n"],"names":["Aglyn","MdiIcons","mdiPuzzle","Box","forwardRef","useContext","BUNDLE_ID","generatePresetId","PluginFrame","ID","PLUGIN_COMPONENT_ID","parsePluginPropsJson","raw","trim","undefined","parsed","JSON","parse","Array","isArray","placeholderText","listingId","known","getKnownPluginInstall","name","displayName","scope","hasKnownPluginInstalls","MarketplacePlugin","props","ref","elementId","version","sha256","capabilities","revoked","pluginProps","pluginPropsJson","rest","nodeSx","resolvedPluginProps","pluginOrigin","process","env","NEXT_PUBLIC_PLUGIN_ORIGIN","hostId","useSite","suppressNavigation","ScreenLinkContext","sx","minHeight","display","alignItems","justifyContent","border","borderColor","borderRadius","color","fontSize","fontFamily","p","textAlign","schema","$id","pluginId","description","category","ComponentCategory","DATA_DISPLAY","icon","path","flags","selfClosing","FEATURE_FLAG","ENABLED","attributes","component","FieldComponentType","PLUGIN_SELECT","label","PLUGIN_SETTINGS","presets","type","NodeType","PRESET","data","componentId","PLUGIN_DRAWER_CATEGORY","muiPluginInstallToPreset","install","manifest","restrictParent","restrictChildren","muiPluginInstallToPresets","generic","element","resolvePluginElements","declared","get","push"],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC,GACD;;;;AAEA,YAAYA,WAAW,eAAc;AACrC,SAASC,QAAQ,QAAQ,yBAAwB;AAEjD,SAASC,SAAS,QA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WAAW;YAChCuC,UAAU1D;YACV2D,WAAW,GAAE8B,uBAAAA,QAAQ9B,WAAW,YAAnB8B,uBAAuB;YACpC7B,UAAU6B,QAAQ7B,QAAQ;YAC1BG,MAAM;gBACJC,IAAI,UAAG2B,4BAAD,AAACA,SAA4C3B,IAAI,mBAAIpE,UAAUoE,IAAI;gBACzErB,IAAI;oBAAEQ,OAAO;gBAAU;YACzB;YACA4B,MAAM;gBACJtB,KAAK;gBACLuB,aAAa7E;gBACbuD,UAAU1D;gBACVuB,OAAO;oBAAER;oBAAWU,WAAWgE,QAAQhE,SAAS;gBAAC;eAC7C0D,EAAAA,qBAAAA,QAAQC,QAAQ,qBAAhBD,mBAAkBE,cAAc,IAChC;gBAAEA,gBAAgBF,QAAQC,QAAQ,CAACC,cAAc;YAAC,IAClD,CAAC,GACDF,EAAAA,qBAAAA,QAAQC,QAAQ,qBAAhBD,mBAAkBG,gBAAgB,IAClC;gBAAEA,kBAAkBH,QAAQC,QAAQ,CAACE,gBAAgB;YAAC,IACtD,CAAC;QAET;IACF;IACA,OAAOX;AACT;AAEA,eAAerD,kBAAiB"}
1
+ {"version":3,"sources":["../../../../../../../libs/plugins/mui/src/lib/components/plugin.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'use client'\n\nimport * as Aglyn from '@aglyn/aglyn'\nimport { mdiPuzzle } from '@aglyn/shared-data-mdi'\nimport Box from '@mui/material/Box'\nimport { forwardRef, useContext } from 'react'\nimport { BUNDLE_ID } from '../constants/bundle-common'\nimport { generatePresetId } from '../utils/generate-preset-id'\nimport { PluginFrame } from './plugin-frame'\n\n// Component id is persisted in screen documents; never rename.\nexport const ID: Aglyn.ComponentId = Aglyn.PLUGIN_COMPONENT_ID\n\nexport interface MarketplacePluginProps {\n /** Installed listing id; the only prop authors set. */\n listingId?: string\n /**\n * Which DECLARED element of the plugin this node is (AGL-1031). Set by the\n * palette preset; absent for the generic Plugin element. Passed through to\n * the sandboxed frame as an ordinary prop, so one node type and one compose\n * path serve both.\n */\n elementId?: string\n /** Injected at compose by `attachPluginInstalls` (AGL-45). */\n version?: string\n sha256?: string\n capabilities?: Aglyn.PluginCapabilities\n revoked?: boolean\n /** Extra props forwarded to the plugin (filtered to its allowlist). */\n pluginProps?: Record<string, unknown>\n /**\n * Per-placement plugin settings as JSON (AGL-192), authored in the\n * element panel. Parsed into `pluginProps` and filtered to the\n * manifest's declared props before it reaches the plugin.\n */\n pluginPropsJson?: string\n}\n\n/** Parses the authored settings JSON; invalid input yields no props. */\nexport function parsePluginPropsJson(\n raw: string | undefined,\n): Record<string, unknown> | undefined {\n if (!raw || !raw.trim()) return undefined\n try {\n const parsed = JSON.parse(raw)\n return parsed && typeof parsed === 'object' && !Array.isArray(parsed)\n ? (parsed as Record<string, unknown>)\n : undefined\n } catch {\n return undefined\n }\n}\n\n/**\n * What the inert placeholder says, and — more to the point — what it refuses\n * to say (AGL-1029).\n *\n * It used to read \"not installed on this site\" for EVERY plugin with a listing\n * id, because it inferred installation from `version`/`sha256`: fields the\n * tenant compose pass injects and the canvas never has. Plugins do not execute\n * in the editor by design, so their absence there means nothing about the pin,\n * and the first thing an author saw after installing was a message telling them\n * the install had failed.\n *\n * The claim is only made when it has been earned. The editor publishes the\n * installs it reads (`setKnownPluginInstalls`); a listing id missing from that\n * list really is not installed. Where nothing published a list — a preview —\n * the placeholder states what is true of the placement instead and asserts\n * nothing about installation. A published page draws no placeholder at all.\n */\nexport function placeholderText(listingId: string | undefined): string {\n if (!listingId) return 'Plugin — pick an installed plugin'\n const known = Aglyn.getKnownPluginInstall(listingId)\n if (known) {\n const name = known.displayName || 'Plugin'\n return known.scope === 'org'\n ? `${name} — installed org-wide; renders on the published site`\n : `${name} — renders on the published site`\n }\n return Aglyn.hasKnownPluginInstalls()\n ? 'Plugin — not installed on this site'\n : 'Plugin — renders on the published site'\n}\n\n/**\n * Marketplace plugin element (AGL-45): a placement for an installed executable\n * plugin. The saved node carries only `listingId`; the tenant compose pass\n * (`attachPluginInstalls`) injects the pinned version/sha256/capabilities +\n * kill-switch state, and this renders them through the sandboxed\n * `PluginFrame`. Without a resolved install (the editor canvas, or an\n * uninstalled listing) it shows an inert placeholder — plugins never\n * execute in the editor. The plugin origin is a NEXT_PUBLIC env so it's\n * available in the browser bundle; unset = plugins disabled (placeholder).\n */\nconst MarketplacePlugin = forwardRef<HTMLElement, MarketplacePluginProps>(\n (props, ref) => {\n const {\n listingId,\n elementId,\n version,\n sha256,\n capabilities,\n revoked,\n pluginProps,\n pluginPropsJson,\n ...rest\n } = props\n // Node styles ride the renderer-merged sx; recompose (stack.ts pattern).\n const nodeSx = Array.isArray(props['sx']) ? props['sx'] : [props['sx']]\n // Merge authored settings (AGL-192) under any compose-injected props;\n // PluginFrame filters the result to the manifest allowlist.\n const resolvedPluginProps = {\n ...(pluginProps ?? {}),\n ...(parsePluginPropsJson(pluginPropsJson) ?? {}),\n }\n const pluginOrigin =\n typeof process !== 'undefined'\n ? // Dot notation (AGL-2037) — a client component; the bracket\n // form reads undefined in the browser.\n process.env.NEXT_PUBLIC_PLUGIN_ORIGIN\n : undefined\n // Host id for host-mediated fetch (AGL-191); empty in the editor.\n const { hostId } = Aglyn.useSite()\n const { suppressNavigation } = useContext(Aglyn.ScreenLinkContext)\n\n // No resolved install (editor canvas / uninstalled): inert placeholder,\n // which speaks to the author, so a published page renders the bare\n // element instead.\n if (!listingId || !version || !sha256) {\n if (!suppressNavigation) return <Box ref={ref as any} {...rest} />\n return (\n <Box\n ref={ref as any}\n {...rest}\n sx={[\n {\n minHeight: 120,\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n border: '1px dashed',\n borderColor: 'divider',\n borderRadius: 1,\n color: 'text.secondary',\n fontSize: 13,\n fontFamily: 'system-ui, sans-serif',\n p: 2,\n textAlign: 'center',\n },\n ...nodeSx,\n ]}\n >\n {placeholderText(listingId)}\n </Box>\n )\n }\n\n return (\n <PluginFrame\n ref={ref as any}\n pluginOrigin={pluginOrigin}\n hostId={hostId}\n listingId={listingId}\n elementId={elementId}\n version={version}\n sha256={sha256}\n capabilities={capabilities}\n pluginProps={resolvedPluginProps}\n revoked={revoked}\n />\n )\n },\n)\nMarketplacePlugin.displayName = 'AglynMarketplacePlugin'\n\nexport const schema: Aglyn.ComponentSchema<MarketplacePluginProps> = {\n $id: ID,\n pluginId: BUNDLE_ID,\n displayName: 'Plugin',\n description:\n 'Where an installed marketplace plugin renders, in its own sandbox.',\n category: Aglyn.ComponentCategory.DATA_DISPLAY,\n icon: { path: mdiPuzzle.path, sx: { color: '#5e35b1' } },\n flags: { selfClosing: Aglyn.FEATURE_FLAG.ENABLED },\n attributes: [\n {\n name: 'listingId',\n // A picker over what is actually installed (AGL-1030), not a typed\n // document id: a mistyped character used to produce an element that\n // looked broken with no clue why. The old helper text also pointed at\n // \"Manage → Plugins\", a path AGL-1011 removed (AGL-1029).\n description:\n 'Which installed plugin to place here. The sandboxed plugin renders ' +\n 'in an isolated iframe region on the published site.',\n component: Aglyn.FieldComponentType.PLUGIN_SELECT,\n label: 'Plugin',\n },\n {\n name: 'pluginPropsJson',\n description:\n 'Only what this plugin declares in its manifest is offered here, so ' +\n 'what you set is what it receives. \"Edit as JSON\" covers anything a ' +\n 'declaration does not.',\n // Was a raw JSON textarea (AGL-1049): authors guessed key names, and a\n // typo did not fail — `filterPluginProps` silently dropped it.\n component: Aglyn.FieldComponentType.PLUGIN_SETTINGS,\n label: 'Plugin settings',\n },\n ],\n}\n\nexport const presets: Aglyn.PresetSchema[] = [\n {\n $id: generatePresetId(ID),\n type: Aglyn.NodeType.PRESET,\n displayName: 'Plugin',\n pluginId: BUNDLE_ID,\n description: 'Sandboxed marketplace plugin region',\n category: Aglyn.ComponentCategory.DATA_DISPLAY,\n icon: { path: mdiPuzzle.path, sx: { color: '#5e35b1' } },\n data: {\n $id: null,\n componentId: ID,\n pluginId: BUNDLE_ID,\n props: {},\n },\n },\n]\n\nexport {\n PLUGIN_DRAWER_CATEGORY,\n type PluginInstallLike,\n muiPluginInstallToPreset,\n muiPluginInstallToPresets,\n} from './plugin-install-presets'\n\nexport default MarketplacePlugin\n"],"names":["Aglyn","mdiPuzzle","Box","forwardRef","useContext","BUNDLE_ID","generatePresetId","PluginFrame","ID","PLUGIN_COMPONENT_ID","parsePluginPropsJson","raw","trim","undefined","parsed","JSON","parse","Array","isArray","placeholderText","listingId","known","getKnownPluginInstall","name","displayName","scope","hasKnownPluginInstalls","MarketplacePlugin","props","ref","elementId","version","sha256","capabilities","revoked","pluginProps","pluginPropsJson","rest","nodeSx","resolvedPluginProps","pluginOrigin","process","env","NEXT_PUBLIC_PLUGIN_ORIGIN","hostId","useSite","suppressNavigation","ScreenLinkContext","sx","minHeight","display","alignItems","justifyContent","border","borderColor","borderRadius","color","fontSize","fontFamily","p","textAlign","schema","$id","pluginId","description","category","ComponentCategory","DATA_DISPLAY","icon","path","flags","selfClosing","FEATURE_FLAG","ENABLED","attributes","component","FieldComponentType","PLUGIN_SELECT","label","PLUGIN_SETTINGS","presets","type","NodeType","PRESET","data","componentId","PLUGIN_DRAWER_CATEGORY","muiPluginInstallToPreset","muiPluginInstallToPresets"],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC,GACD;;;;AAEA,YAAYA,WAAW,eAAc;AACrC,SAASC,SAAS,QAAQ,yBAAwB;AAClD,OAAOC,SAAS,oBAAmB;AACnC,SAASC,UAAU,EAAEC,UAAU,QAAQ,QAAO;AAC9C,SAASC,SAAS,QAAQ,gCAA4B;AACtD,SAASC,gBAAgB,QAAQ,iCAA6B;AAC9D,SAASC,WAAW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AACC,aAAa;YACjDC,OAAO;QACT;QACA;YACEvD,MAAM;YACNyC,aACE,wEACA,wEACA;YACF,uEAAuE;YACvE,+DAA+D;YAC/DW,WAAW3E,MAAM4E,kBAAkB,CAACG,eAAe;YACnDD,OAAO;QACT;KACD;AACH,EAAC;AAED,OAAO,MAAME,UAAgC;IAC3C;QACElB,KAAKxD,iBAAiBE;QACtByE,MAAMjF,MAAMkF,QAAQ,CAACC,MAAM;QAC3B3D,aAAa;QACbuC,UAAU1D;QACV2D,aAAa;QACbC,UAAUjE,MAAMkE,iBAAiB,CAACC,YAAY;QAC9CC,MAAM;YAAEC,MAAMpE,UAAUoE,IAAI;YAAErB,IAAI;gBAAEQ,OAAO;YAAU;QAAE;QACvD4B,MAAM;YACJtB,KAAK;YACLuB,aAAa7E;YACbuD,UAAU1D;YACVuB,OAAO,CAAC;QACV;IACF;CACD,CAAA;AAED,SACE0D,sBAAsB,EAEtBC,wBAAwB,EACxBC,yBAAyB,QACpB,8BAA0B;AAEjC,eAAe7D,kBAAiB"}
@@ -25,7 +25,7 @@ export declare const typographyVariants: {
25
25
  }[];
26
26
  export declare const schema: Aglyn.ComponentSchema;
27
27
  export declare const presets: Aglyn.PresetSchema[];
28
- declare const AglynTypography: import("react").ForwardRefExoticComponent<Omit<import("@mui/material").TypographyOwnProps & import("@mui/material/OverridableComponent").CommonProps & Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "color" | "sx" | "children" | "style" | "className" | "classes" | "variant" | "align" | "noWrap" | "gutterBottom" | "variantMapping"> & {
28
+ declare const AglynTypography: import("react").ForwardRefExoticComponent<Omit<import("@mui/material").TypographyOwnProps & import("@mui/material/OverridableComponent").CommonProps & Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "children" | "sx" | "className" | "style" | "classes" | "color" | "variant" | "align" | "noWrap" | "gutterBottom" | "variantMapping"> & {
29
29
  component?: React.ElementType | undefined;
30
30
  } & {
31
31
  html?: string;
@@ -0,0 +1,118 @@
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 * as appBar from './components/app-bar';
18
+ import * as toolbar from './components/toolbar';
19
+ import * as layoutSlot from './components/layout-slot';
20
+ import * as documentRoot from './components/document-root';
21
+ import * as section from './components/section';
22
+ import * as container from './components/container';
23
+ import * as box from './components/box';
24
+ import * as stack from './components/stack';
25
+ import * as grid from './components/grid';
26
+ import * as paper from './components/paper';
27
+ import * as typography from './components/typography';
28
+ import * as inlineText from './components/inline-text';
29
+ import * as button from './components/button';
30
+ import * as screenLink from './components/screen-link';
31
+ import * as linkBox from './components/link-box';
32
+ import * as image from './components/image';
33
+ import * as icon from './components/icon';
34
+ /**
35
+ * The element tier: how a page's mui elements reach it (AGL-3401).
36
+ *
37
+ * `plugin.ts` imports this module lazily, and every element module is reached
38
+ * through it — the common ones as part of it, the rest by an `import()` written
39
+ * HERE. Where that `import()` is written is the whole point.
40
+ *
41
+ * ## Why not sixty sibling imports
42
+ *
43
+ * Each `import()` is a chunk group, and Turbopack gives each group every
44
+ * module it needs that its PARENT group has not already loaded. Sixty element
45
+ * imports written side by side in `plugin.ts` were sixty siblings: none of
46
+ * them could count on another having loaded `@mui/material/Button`, so the
47
+ * chunker merged a copy of Button, ButtonBase and its ripple, SvgIcon, Paper,
48
+ * Stack, the link helpers and the field presets into group after group. On a
49
+ * production aglyn.com build 30% of the module code a page downloaded was a
50
+ * second-or-later copy (Button eight times, SvgIcon fifteen).
51
+ *
52
+ * No chunking switch fixes that without trading it for requests: turning the
53
+ * merge off removed the copies and cost a page 280 files, which compress
54
+ * worse than the bytes they saved (measured in AGL-3401).
55
+ *
56
+ * ## What this module does instead
57
+ *
58
+ * `CORE_ELEMENTS` are the elements nearly every page places — its frame, its
59
+ * layout, its text, its links, buttons and images. They load together as one
60
+ * chunk, and so do the MUI modules they share. Every other element's
61
+ * `import()` is written below, which makes its group a CHILD of this one:
62
+ * whatever this chunk carries is available to it, so none of it is copied.
63
+ *
64
+ * The price is on either side of that line. A page that places none of the
65
+ * core elements but the frame still downloads them (a six-element page paid
66
+ * 3.7 KB more), and an element outside the core arrives one request later,
67
+ * after this chunk. Moving an element into the core is right when most pages
68
+ * place it; `check:tenant-wire-weight`'s duplication measure is what says
69
+ * whether the copies are coming back.
70
+ *
71
+ * Each core element is held as a module namespace, because the registry reads
72
+ * a component, its schema and its presets off it by export name.
73
+ */
74
+ export declare const CORE_ELEMENTS: {
75
+ appBar: typeof appBar;
76
+ toolbar: typeof toolbar;
77
+ layoutSlot: typeof layoutSlot;
78
+ documentRoot: typeof documentRoot;
79
+ section: typeof section;
80
+ container: typeof container;
81
+ box: typeof box;
82
+ stack: typeof stack;
83
+ grid: typeof grid;
84
+ paper: typeof paper;
85
+ typography: typeof typography;
86
+ inlineText: typeof inlineText;
87
+ button: typeof button;
88
+ screenLink: typeof screenLink;
89
+ linkBox: typeof linkBox;
90
+ image: typeof image;
91
+ icon: typeof icon;
92
+ };
93
+ /** The elements a page places less often, each loaded when it is placed. */
94
+ export declare const list: () => Promise<typeof import("./components/list")>;
95
+ export declare const listItem: () => Promise<typeof import("./components/list-item")>;
96
+ export declare const listItemText: () => Promise<typeof import("./components/list-item-text")>;
97
+ export declare const blocks: () => Promise<typeof import("./components/blocks")>;
98
+ export declare const dataTable: () => Promise<typeof import("./components/data-table")>;
99
+ export declare const collection: () => Promise<typeof import("./components/collection")>;
100
+ export declare const video: () => Promise<typeof import("./components/video")>;
101
+ export declare const languageSwitcher: () => Promise<typeof import("./components/language-switcher")>;
102
+ export declare const reusableInstance: () => Promise<typeof import("./components/reusable-instance")>;
103
+ export declare const navMenu: () => Promise<typeof import("./components/nav-menu")>;
104
+ export declare const drawer: () => Promise<typeof import("./components/drawer")>;
105
+ export declare const functionWidget: () => Promise<typeof import("./components/function-widget")>;
106
+ export declare const functionScope: () => Promise<typeof import("./components/function-scope")>;
107
+ export declare const product: () => Promise<typeof import("./components/product")>;
108
+ export declare const plugin: () => Promise<typeof import("./components/plugin")>;
109
+ export declare const customHtml: () => Promise<typeof import("./components/custom-html")>;
110
+ export declare const searchBox: () => Promise<typeof import("./components/search-box")>;
111
+ export declare const markdown: () => Promise<typeof import("./components/markdown")>;
112
+ export declare const card: () => Promise<typeof import("./components/card")>;
113
+ export declare const accordion: () => Promise<typeof import("./components/accordion")>;
114
+ export declare const tabs: () => Promise<typeof import("./components/tabs")>;
115
+ export declare const imageList: () => Promise<typeof import("./components/image-list")>;
116
+ export declare const pagination: () => Promise<typeof import("./components/pagination")>;
117
+ export declare const breadcrumbs: () => Promise<typeof import("./components/breadcrumbs")>;
118
+ export declare const themeModeSwitcher: () => Promise<typeof import("./components/theme-mode-switcher")>;
@@ -0,0 +1,117 @@
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 appBar from "./components/app-bar.js";
17
+ import * as toolbar from "./components/toolbar.js";
18
+ import * as layoutSlot from "./components/layout-slot.js";
19
+ import * as documentRoot from "./components/document-root.js";
20
+ import * as section from "./components/section.js";
21
+ import * as container from "./components/container.js";
22
+ import * as box from "./components/box.js";
23
+ import * as stack from "./components/stack.js";
24
+ import * as grid from "./components/grid.js";
25
+ import * as paper from "./components/paper.js";
26
+ import * as typography from "./components/typography.js";
27
+ import * as inlineText from "./components/inline-text.js";
28
+ import * as button from "./components/button.js";
29
+ import * as screenLink from "./components/screen-link.js";
30
+ import * as linkBox from "./components/link-box.js";
31
+ import * as image from "./components/image.js";
32
+ import * as icon from "./components/icon.js";
33
+ /**
34
+ * The element tier: how a page's mui elements reach it (AGL-3401).
35
+ *
36
+ * `plugin.ts` imports this module lazily, and every element module is reached
37
+ * through it — the common ones as part of it, the rest by an `import()` written
38
+ * HERE. Where that `import()` is written is the whole point.
39
+ *
40
+ * ## Why not sixty sibling imports
41
+ *
42
+ * Each `import()` is a chunk group, and Turbopack gives each group every
43
+ * module it needs that its PARENT group has not already loaded. Sixty element
44
+ * imports written side by side in `plugin.ts` were sixty siblings: none of
45
+ * them could count on another having loaded `@mui/material/Button`, so the
46
+ * chunker merged a copy of Button, ButtonBase and its ripple, SvgIcon, Paper,
47
+ * Stack, the link helpers and the field presets into group after group. On a
48
+ * production aglyn.com build 30% of the module code a page downloaded was a
49
+ * second-or-later copy (Button eight times, SvgIcon fifteen).
50
+ *
51
+ * No chunking switch fixes that without trading it for requests: turning the
52
+ * merge off removed the copies and cost a page 280 files, which compress
53
+ * worse than the bytes they saved (measured in AGL-3401).
54
+ *
55
+ * ## What this module does instead
56
+ *
57
+ * `CORE_ELEMENTS` are the elements nearly every page places — its frame, its
58
+ * layout, its text, its links, buttons and images. They load together as one
59
+ * chunk, and so do the MUI modules they share. Every other element's
60
+ * `import()` is written below, which makes its group a CHILD of this one:
61
+ * whatever this chunk carries is available to it, so none of it is copied.
62
+ *
63
+ * The price is on either side of that line. A page that places none of the
64
+ * core elements but the frame still downloads them (a six-element page paid
65
+ * 3.7 KB more), and an element outside the core arrives one request later,
66
+ * after this chunk. Moving an element into the core is right when most pages
67
+ * place it; `check:tenant-wire-weight`'s duplication measure is what says
68
+ * whether the copies are coming back.
69
+ *
70
+ * Each core element is held as a module namespace, because the registry reads
71
+ * a component, its schema and its presets off it by export name.
72
+ */ export const CORE_ELEMENTS = {
73
+ appBar,
74
+ toolbar,
75
+ layoutSlot,
76
+ documentRoot,
77
+ section,
78
+ container,
79
+ box,
80
+ stack,
81
+ grid,
82
+ paper,
83
+ typography,
84
+ inlineText,
85
+ button,
86
+ screenLink,
87
+ linkBox,
88
+ image,
89
+ icon
90
+ };
91
+ /** The elements a page places less often, each loaded when it is placed. */ export const list = ()=>import("./components/list.js");
92
+ export const listItem = ()=>import("./components/list-item.js");
93
+ export const listItemText = ()=>import("./components/list-item-text.js");
94
+ export const blocks = ()=>import("./components/blocks.js");
95
+ export const dataTable = ()=>import("./components/data-table.js");
96
+ export const collection = ()=>import("./components/collection.js");
97
+ export const video = ()=>import("./components/video.js");
98
+ export const languageSwitcher = ()=>import("./components/language-switcher.js");
99
+ export const reusableInstance = ()=>import("./components/reusable-instance.js");
100
+ export const navMenu = ()=>import("./components/nav-menu.js");
101
+ export const drawer = ()=>import("./components/drawer.js");
102
+ export const functionWidget = ()=>import("./components/function-widget.js");
103
+ export const functionScope = ()=>import("./components/function-scope.js");
104
+ export const product = ()=>import("./components/product.js");
105
+ export const plugin = ()=>import("./components/plugin.js");
106
+ export const customHtml = ()=>import("./components/custom-html.js");
107
+ export const searchBox = ()=>import("./components/search-box.js");
108
+ export const markdown = ()=>import("./components/markdown.js");
109
+ export const card = ()=>import("./components/card.js");
110
+ export const accordion = ()=>import("./components/accordion.js");
111
+ export const tabs = ()=>import("./components/tabs.js");
112
+ export const imageList = ()=>import("./components/image-list.js");
113
+ export const pagination = ()=>import("./components/pagination.js");
114
+ export const breadcrumbs = ()=>import("./components/breadcrumbs.js");
115
+ export const themeModeSwitcher = ()=>import("./components/theme-mode-switcher.js");
116
+
117
+ //# sourceMappingURL=element-tier.js.map
@@ -0,0 +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')\nexport const collection = () => import('./components/collection')\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 functionWidget = () => import('./components/function-widget')\nexport const functionScope = () => import('./components/function-scope')\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","collection","video","languageSwitcher","reusableInstance","navMenu","drawer","functionWidget","functionScope","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,MAAMC,eAAe,IAAM,MAAM,CAAC,kCAA8B;AACvE,OAAO,MAAMC,SAAS,IAAM,MAAM,CAAC,0BAAsB;AACzD,OAAO,MAAMC,YAAY,IAAM,MAAM,CAAC,8BAA0B;AAChE,OAAO,MAAMC,aAAa,IAAM,MAAM,CAAC,8BAA0B;AACjE,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,iBAAiB,IAAM,MAAM,CAAC,mCAA+B;AAC1E,OAAO,MAAMC,gBAAgB,IAAM,MAAM,CAAC,kCAA8B;AACxE,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
@@ -15,56 +15,63 @@ import { _ as _extends } from "@swc/helpers/_/_extends";
15
15
  * See the License for the specific language governing permissions and
16
16
  * limitations under the License.
17
17
  */ import { registerPluginInstallPresetMapper, registerPluginInstallPresetsMapper } from "@aglyn/aglyn";
18
- import { muiPluginInstallToPreset, muiPluginInstallToPresets } from "./components/plugin.js";
18
+ import { muiPluginInstallToPreset, muiPluginInstallToPresets } from "./components/plugin-install-presets.js";
19
19
  import * as Aglyn from "@aglyn/aglyn";
20
20
  import { runInAction } from "mobx";
21
21
  import { BUNDLE_ID } from "./constants/bundle-common.js";
22
22
  /**
23
- * One thunk per component module, named here because several ids share one:
24
- * `collection.tsx` alone exports eight elements, and a module is imported
25
- * once however many of its components a surface asks for.
26
- */ const appBar = ()=>import("./components/app-bar.js");
27
- const toolbar = ()=>import("./components/toolbar.js");
28
- const typography = ()=>import("./components/typography.js");
29
- const inlineText = ()=>import("./components/inline-text.js");
30
- const button = ()=>import("./components/button.js");
31
- const container = ()=>import("./components/container.js");
32
- const layoutSlot = ()=>import("./components/layout-slot.js");
33
- const list = ()=>import("./components/list.js");
34
- const listItem = ()=>import("./components/list-item.js");
35
- const listItemText = ()=>import("./components/list-item-text.js");
36
- const blocks = ()=>import("./components/blocks.js");
37
- const dataTable = ()=>import("./components/data-table.js");
38
- const collection = ()=>import("./components/collection.js");
39
- const image = ()=>import("./components/image.js");
40
- const video = ()=>import("./components/video.js");
41
- const icon = ()=>import("./components/icon.js");
42
- const languageSwitcher = ()=>import("./components/language-switcher.js");
43
- const reusableInstance = ()=>import("./components/reusable-instance.js");
44
- const screenLink = ()=>import("./components/screen-link.js");
45
- const linkBox = ()=>import("./components/link-box.js");
46
- const navMenu = ()=>import("./components/nav-menu.js");
47
- const drawer = ()=>import("./components/drawer.js");
48
- const functionWidget = ()=>import("./components/function-widget.js");
49
- const functionScope = ()=>import("./components/function-scope.js");
50
- const product = ()=>import("./components/product.js");
51
- const plugin = ()=>import("./components/plugin.js");
52
- const customHtml = ()=>import("./components/custom-html.js");
53
- const searchBox = ()=>import("./components/search-box.js");
54
- const markdown = ()=>import("./components/markdown.js");
55
- const section = ()=>import("./components/section.js");
56
- const stack = ()=>import("./components/stack.js");
57
- const box = ()=>import("./components/box.js");
58
- const documentRoot = ()=>import("./components/document-root.js");
59
- const grid = ()=>import("./components/grid.js");
60
- const paper = ()=>import("./components/paper.js");
61
- const card = ()=>import("./components/card.js");
62
- const accordion = ()=>import("./components/accordion.js");
63
- const tabs = ()=>import("./components/tabs.js");
64
- const imageList = ()=>import("./components/image-list.js");
65
- const pagination = ()=>import("./components/pagination.js");
66
- const breadcrumbs = ()=>import("./components/breadcrumbs.js");
67
- const themeModeSwitcher = ()=>import("./components/theme-mode-switcher.js");
23
+ * One load of the tier, however many thunks ask at once. The bundler shares
24
+ * a module across concurrent imports anyway; a loader that hands out a
25
+ * module while it is still evaluating does not — jiti, which the AI palette
26
+ * and page-axe generators load this bundle through, resolved the second of
27
+ * sixty concurrent imports to the tier's exports before `CORE_ELEMENTS` was
28
+ * assigned.
29
+ */ let tierLoad;
30
+ const elementTier = ()=>tierLoad != null ? tierLoad : tierLoad = import("./element-tier.js");
31
+ const inTier = (name)=>()=>elementTier().then((tier)=>tier.CORE_ELEMENTS[name]);
32
+ const viaTier = (name)=>()=>elementTier().then((tier)=>tier[name]());
33
+ const appBar = inTier('appBar');
34
+ const toolbar = inTier('toolbar');
35
+ const layoutSlot = inTier('layoutSlot');
36
+ const documentRoot = inTier('documentRoot');
37
+ const section = inTier('section');
38
+ const container = inTier('container');
39
+ const box = inTier('box');
40
+ const stack = inTier('stack');
41
+ const grid = inTier('grid');
42
+ const paper = inTier('paper');
43
+ const typography = inTier('typography');
44
+ const inlineText = inTier('inlineText');
45
+ const button = inTier('button');
46
+ const screenLink = inTier('screenLink');
47
+ const linkBox = inTier('linkBox');
48
+ const image = inTier('image');
49
+ const icon = inTier('icon');
50
+ const list = viaTier('list');
51
+ const listItem = viaTier('listItem');
52
+ const listItemText = viaTier('listItemText');
53
+ const blocks = viaTier('blocks');
54
+ const dataTable = viaTier('dataTable');
55
+ const collection = viaTier('collection');
56
+ const video = viaTier('video');
57
+ const languageSwitcher = viaTier('languageSwitcher');
58
+ const reusableInstance = viaTier('reusableInstance');
59
+ const navMenu = viaTier('navMenu');
60
+ const drawer = viaTier('drawer');
61
+ const functionWidget = viaTier('functionWidget');
62
+ const functionScope = viaTier('functionScope');
63
+ const product = viaTier('product');
64
+ const plugin = viaTier('plugin');
65
+ const customHtml = viaTier('customHtml');
66
+ const searchBox = viaTier('searchBox');
67
+ const markdown = viaTier('markdown');
68
+ const card = viaTier('card');
69
+ const accordion = viaTier('accordion');
70
+ const tabs = viaTier('tabs');
71
+ const imageList = viaTier('imageList');
72
+ const pagination = viaTier('pagination');
73
+ const breadcrumbs = viaTier('breadcrumbs');
74
+ const themeModeSwitcher = viaTier('themeModeSwitcher');
68
75
  /**
69
76
  * Every component this bundle can register (AGL-140, AGL-3141).
70
77
  *
@@ -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'\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 * `collection.tsx` alone exports eight elements, and a module is imported\n * once however many of its components a surface asks for.\n */\nconst appBar = () => import('./components/app-bar')\nconst toolbar = () => import('./components/toolbar')\nconst typography = () => import('./components/typography')\nconst inlineText = () => import('./components/inline-text')\nconst button = () => import('./components/button')\nconst container = () => import('./components/container')\nconst layoutSlot = () => import('./components/layout-slot')\nconst list = () => import('./components/list')\nconst listItem = () => import('./components/list-item')\nconst listItemText = () => import('./components/list-item-text')\nconst blocks = () => import('./components/blocks')\nconst dataTable = () => import('./components/data-table')\nconst collection = () => import('./components/collection')\nconst image = () => import('./components/image')\nconst video = () => import('./components/video')\nconst icon = () => import('./components/icon')\nconst languageSwitcher = () => import('./components/language-switcher')\nconst reusableInstance = () => import('./components/reusable-instance')\nconst screenLink = () => import('./components/screen-link')\nconst linkBox = () => import('./components/link-box')\nconst navMenu = () => import('./components/nav-menu')\nconst drawer = () => import('./components/drawer')\nconst functionWidget = () => import('./components/function-widget')\nconst functionScope = () => import('./components/function-scope')\nconst product = () => import('./components/product')\nconst plugin = () => import('./components/plugin')\nconst customHtml = () => import('./components/custom-html')\nconst searchBox = () => import('./components/search-box')\nconst markdown = () => import('./components/markdown')\nconst section = () => import('./components/section')\nconst stack = () => import('./components/stack')\nconst box = () => import('./components/box')\nconst documentRoot = () => import('./components/document-root')\nconst grid = () => import('./components/grid')\nconst paper = () => import('./components/paper')\nconst card = () => import('./components/card')\nconst accordion = () => import('./components/accordion')\nconst tabs = () => import('./components/tabs')\nconst imageList = () => import('./components/image-list')\nconst pagination = () => import('./components/pagination')\nconst breadcrumbs = () => import('./components/breadcrumbs')\nconst themeModeSwitcher = () => import('./components/theme-mode-switcher')\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: collection,\n component: 'CollectionEntries',\n schema: 'collectionEntriesSchema',\n presets: 'collectionPresets',\n },\n collectionEntryBody: {\n module: collection,\n component: 'CollectionEntryBody',\n schema: 'collectionEntryBodySchema',\n },\n collectionRelated: {\n module: collection,\n component: 'CollectionRelated',\n schema: 'collectionRelatedSchema',\n },\n collectionShare: {\n module: collection,\n component: 'CollectionShare',\n schema: 'collectionShareSchema',\n },\n collectionEntryMeta: {\n module: collection,\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: collection,\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: collection,\n component: 'ContentAuthorProfile',\n schema: 'contentAuthorProfileSchema',\n },\n // Category pills (AGL-1321): real anchors to /{collection}/category/{slug}.\n collectionCategories: {\n module: collection,\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: collection,\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 `collection.tsx` is imported once for the eight\n // ids that name it rather than eight times.\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","appBar","toolbar","typography","inlineText","button","container","layoutSlot","list","listItem","listItemText","blocks","dataTable","collection","image","video","icon","languageSwitcher","reusableInstance","screenLink","linkBox","navMenu","drawer","functionWidget","functionScope","product","plugin","customHtml","searchBox","markdown","section","stack","box","documentRoot","grid","paper","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","collectionEntries","collectionEntryBody","collectionRelated","collectionShare","collectionEntryMeta","collectionEntryAuthor","contentAuthorProfile","collectionCategories","collectionSearch","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;;;;;;;;;;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8DAA8D;IAC9D,EAAE;IACF,sEAAsE;IACtE,yEAAyE;IACzE,0EAA0E;IAC1E,oEAAoE;IACpE,IAAIzH,MAAMmI,OAAO,CAACC,aAAa,CAAClI,YAAY;QAC1C,IAAIsH,QAAQI,MAAM,EAAEL,gBAAgBC;QACpC;IACF;IAEAxH,MAAMmI,OAAO,CAACG,aAAa,CAAC;QAC1BD,KAAKnI;QACLqI,aAAa;QACbC,aAAa;QACbC,OAAO;QACPC,cAAc,CAAC;QACfzB;YACEM,gBAAgB;mBAAID,eAAeqB,MAAM;aAAG;QAC9C;QACAC;YACE,MAAMpB,UAAU;mBAAIF,eAAeqB,MAAM;aAAG;YAC5C1I,YAAY;gBACV,KAAK,MAAMwH,SAASD,QAAS;wBACvBC;oBAAJ,KAAIA,iBAAAA,MAAMvE,OAAO,qBAAbuE,eAAeG,MAAM,EAAE;wBACzB5H,MAAM0H,UAAU,CAACmB,gBAAgB,CAC/BpB,MAAMvE,OAAO,CAAC6D,GAAG,CAAC,CAAC+B,SAAWA,OAAOT,GAAG;oBAE5C;gBACF;gBACA,KAAK,MAAMZ,SAASD,QAAS;oBAC3BxH,MAAM0H,UAAU,CAACqB,mBAAmB,CAACtB,MAAMxE,MAAM,CAACoF,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 * `collection.tsx` alone exports eight elements, and a module is imported\n * 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 collection = viaTier('collection')\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: collection,\n component: 'CollectionEntries',\n schema: 'collectionEntriesSchema',\n presets: 'collectionPresets',\n },\n collectionEntryBody: {\n module: collection,\n component: 'CollectionEntryBody',\n schema: 'collectionEntryBodySchema',\n },\n collectionRelated: {\n module: collection,\n component: 'CollectionRelated',\n schema: 'collectionRelatedSchema',\n },\n collectionShare: {\n module: collection,\n component: 'CollectionShare',\n schema: 'collectionShareSchema',\n },\n collectionEntryMeta: {\n module: collection,\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: collection,\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: collection,\n component: 'ContentAuthorProfile',\n schema: 'contentAuthorProfileSchema',\n },\n // Category pills (AGL-1321): real anchors to /{collection}/category/{slug}.\n collectionCategories: {\n module: collection,\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: collection,\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 `collection.tsx` is imported once for the eight\n // ids that name it rather than eight times.\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","collection","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","collectionEntries","collectionEntryBody","collectionRelated","collectionShare","collectionEntryMeta","collectionEntryAuthor","contentAuthorProfile","collectionCategories","collectionSearch","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;;;;;;;C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