@aglyn/plugins-mui 1.0.0-beta.277 → 1.0.0-beta.278

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.277",
3
+ "version": "1.0.0-beta.278",
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.277",
29
- "@aglyn/shared-data-enums": "1.0.0-beta.277",
30
- "@aglyn/shared-data-mdi": "1.0.0-beta.277",
31
- "@aglyn/shared-ui-jsx": "1.0.0-beta.277",
32
- "@aglyn/shared-ui-theme": "1.0.0-beta.277",
33
- "@aglyn/shared-util-vendor": "1.0.0-beta.277",
28
+ "@aglyn/aglyn": "1.0.0-beta.278",
29
+ "@aglyn/shared-data-enums": "1.0.0-beta.278",
30
+ "@aglyn/shared-data-mdi": "1.0.0-beta.278",
31
+ "@aglyn/shared-ui-jsx": "1.0.0-beta.278",
32
+ "@aglyn/shared-ui-theme": "1.0.0-beta.278",
33
+ "@aglyn/shared-util-vendor": "1.0.0-beta.278",
34
34
  "@swc/helpers": "0.5.23",
35
35
  "dayjs": "^1.11.23",
36
36
  "mobx": "^7.0.5",
@@ -33,6 +33,8 @@ export interface ReusableInstanceProps extends BoxProps {
33
33
  * has no use for it, and it is stripped below rather than spread.
34
34
  */
35
35
  propValues?: Record<string, unknown>;
36
+ /** Formatted text for those props, addressed to the graft as well. */
37
+ propHtml?: Record<string, unknown>;
36
38
  }
37
39
  /**
38
40
  * Wrapper element for a reusable-component instance. On production surfaces
@@ -37,7 +37,7 @@ export const ID = Aglyn.REUSABLE_INSTANCE_COMPONENT_ID;
37
37
  * whose definition does not resolve is left empty by the compose step, and a
38
38
  * visitor must not see the marker there.
39
39
  */ const ReusableInstance = /*#__PURE__*/ forwardRef((props, ref)=>{
40
- const _key = Aglyn.REUSABLE_INSTANCE_PROP_VALUES_KEY, { refId: _refId, name, // Instance-scoped directives, not element attributes. `refId` and
40
+ const _key = Aglyn.REUSABLE_INSTANCE_PROP_VALUES_KEY, _key1 = Aglyn.REUSABLE_INSTANCE_PROP_HTML_KEY, { refId: _refId, name, // Instance-scoped directives, not element attributes. `refId` and
41
41
  // `name` were always stripped; `propValues` was not, so the author's
42
42
  // overrides spread onto the Box and reached the DOM — React logs
43
43
  // "does not recognize the `propValues` prop" on the canvas, and a
@@ -48,13 +48,15 @@ export const ID = Aglyn.REUSABLE_INSTANCE_COMPONENT_ID;
48
48
  // an instance the graft has not touched (definitions are not grafted
49
49
  // into the editable canvas), so a strip upstream would fix the
50
50
  // published page and leave the editor warning on every render.
51
- [_key]: _propValues, children, sx } = props, rest = _object_without_properties_loose(props, [
51
+ [_key]: _propValues, // Its formatted text, the same way and for the same reason.
52
+ [_key1]: _propHtml, children, sx } = props, rest = _object_without_properties_loose(props, [
52
53
  "refId",
53
54
  "name",
54
- _to_property_key(_key),
55
+ _key,
56
+ _key1,
55
57
  "children",
56
58
  "sx"
57
- ]);
59
+ ].map(_to_property_key));
58
60
  const { suppressNavigation } = useContext(Aglyn.ScreenLinkContext);
59
61
  return /*#__PURE__*/ _jsx(Box, _extends({
60
62
  ref: ref,
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../../../libs/plugins/mui/src/lib/components/reusable-instance.tsx"],"sourcesContent":["/**\n * @license\n * Copyright 2026 Aglyn LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport * as Aglyn from '@aglyn/aglyn'\nimport { mdiPackageVariant } from '@aglyn/shared-data-mdi'\nimport Box, { type BoxProps } from '@mui/material/Box'\nimport { forwardRef, useContext } from 'react'\nimport { BUNDLE_ID } from '../constants/bundle-common'\n\n// Persisted in screen documents; never rename (see AGL-34 ADR).\nexport const ID: Aglyn.ComponentId = Aglyn.REUSABLE_INSTANCE_COMPONENT_ID\n\nexport interface ReusableInstanceProps extends BoxProps {\n /** Definition id in `hosts/{hostId}/components`; grafted at render time. */\n refId?: string\n /**\n * The definition's display name, carried on the instance purely so the\n * editor placeholder can say which component this stands for (AGL-1193).\n * Never rendered on production surfaces, where the graft fills the box.\n */\n name?: string\n /**\n * This instance's declared-prop overrides (AGL-1247). Addressed to the\n * GRAFT, which reads it off the stored node to substitute `{{prop.*}}`\n * inside its private copy of the definition — the wrapper element itself\n * has no use for it, and it is stripped below rather than spread.\n */\n propValues?: Record<string, unknown>\n}\n\n/**\n * Wrapper element for a reusable-component instance. On production surfaces\n * the compose step (`composeReusableComponentNodes`) grafts the definition\n * subtree inside, so this renders as a plain container. In the editor the\n * instance has no children (definitions aren't grafted into the editable\n * canvas), so the CSS `:empty` placeholder marks it visibly instead — named,\n * since a layout whose chrome has been promoted is otherwise nothing but\n * indistinguishable dashed boxes.\n *\n * The placeholder is drawn on editing surfaces only. A published instance\n * whose definition does not resolve is left empty by the compose step, and a\n * visitor must not see the marker there.\n */\nconst ReusableInstance = forwardRef<any, ReusableInstanceProps>(\n (props, ref) => {\n const {\n refId: _refId,\n name,\n // Instance-scoped directives, not element attributes. `refId` and\n // `name` were always stripped; `propValues` was not, so the author's\n // overrides spread onto the Box and reached the DOM — React logs\n // \"does not recognize the `propValues` prop\" on the canvas, and a\n // published page serialised the same copy a second time as\n // `propvalues=\"[object Object]\"` on the wrapper (AGL-2486).\n //\n // Stripped HERE rather than in the graft because the canvas renders\n // an instance the graft has not touched (definitions are not grafted\n // into the editable canvas), so a strip upstream would fix the\n // published page and leave the editor warning on every render.\n [Aglyn.REUSABLE_INSTANCE_PROP_VALUES_KEY]: _propValues,\n children,\n sx,\n ...rest\n } = props\n const { suppressNavigation } = useContext(Aglyn.ScreenLinkContext)\n return (\n <Box\n ref={ref}\n // `content: attr()` rather than a child, so the box stays `:empty`\n // and the placeholder cannot be mistaken for grafted content.\n data-aglyn-component={name || 'Reusable component'}\n sx={[\n Boolean(suppressNavigation) && {\n '&:empty': {\n minHeight: 56,\n m: 1,\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n borderWidth: 1,\n borderStyle: 'dashed',\n borderColor: 'divider',\n borderRadius: 1,\n },\n '&:empty::after': {\n content: 'attr(data-aglyn-component)',\n color: 'text.secondary',\n fontSize: 12,\n letterSpacing: 1,\n textTransform: 'uppercase',\n },\n },\n ...(Array.isArray(sx) ? sx : sx ? [sx] : []),\n ]}\n {...rest}\n >\n {children}\n </Box>\n )\n },\n)\nReusableInstance.displayName = 'ReusableInstance'\n\nexport const schema: Aglyn.ComponentSchema<ReusableInstanceProps> = {\n $id: ID,\n pluginId: BUNDLE_ID,\n displayName: 'Reusable Component',\n description:\n 'Where a reusable component is placed. Edit the component once and every instance follows.',\n category: Aglyn.ComponentCategory.SURFACE,\n icon: {\n path: mdiPackageVariant.path,\n sx: { color: '#9c27b0' },\n },\n flags: {\n // Instances are opaque: their content lives in the definition, so\n // nothing may be dropped inside from the canvas.\n dropping: Aglyn.FEATURE_FLAG.DISABLED,\n },\n /*\n * No attributes. An instance is a REFERENCE, not an element: the graft puts\n * the definition's root in its place, so the only node that reaches a\n * published page is the component's own (AGL-2521). An element picker here\n * briefly existed (AGL-2514) and configured a wrapper that no longer\n * exists — what it was reaching for is **Change it on this page only →\n * Whole component**, which sets the definition root's element for this\n * placement (AGL-3288).\n */\n attributes: [],\n}\n\n/**\n * No static presets: instances are inserted from per-host definitions, which\n * the console registers dynamically (category \"Your components\").\n */\nexport const presets: Aglyn.PresetSchema[] = []\n\nexport default ReusableInstance\n"],"names":["Aglyn","mdiPackageVariant","Box","forwardRef","useContext","BUNDLE_ID","ID","REUSABLE_INSTANCE_COMPONENT_ID","ReusableInstance","props","ref","REUSABLE_INSTANCE_PROP_VALUES_KEY","refId","_refId","name","_propValues","children","sx","rest","suppressNavigation","ScreenLinkContext","data-aglyn-component","Boolean","minHeight","m","display","alignItems","justifyContent","borderWidth","borderStyle","borderColor","borderRadius","content","color","fontSize","letterSpacing","textTransform","Array","isArray","displayName","schema","$id","pluginId","description","category","ComponentCategory","SURFACE","icon","path","flags","dropping","FEATURE_FLAG","DISABLED","attributes","presets"],"mappings":";;;;AAAA;;;;;;;;;;;;;;;CAeC,GAED,YAAYA,WAAW,eAAc;AACrC,SAASC,iBAAiB,QAAQ,yBAAwB;AAC1D,OAAOC,SAA4B,oBAAmB;AACtD,SAASC,UAAU,EAAEC,UAAU,QAAQ,QAAO;AAC9C,SAASC,SAAS,QAAQ,gCAA4B;AAEtD,gEAAgE;AAChE,OAAO,MAAMC,KAAwBN,MAAMO,8BAA8B,CAAA;AAoBzE;;;;;;;;;;;;CAYC,GACD,MAAMC,iCAAmBL,WACvB,CAACM,OAAOC;IACN,aAcGV,MAAMW,iCAAiC,EAdpC,EACJC,OAAOC,MAAM,EACbC,IAAI,EACJ,kEAAkE;IAClE,qEAAqE;IACrE,iEAAiE;IACjE,kEAAkE;IAClE,2DAA2D;IAC3D,4DAA4D;IAC5D,EAAE;IACF,oEAAoE;IACpE,qEAAqE;IACrE,+DAA+D;IAC/D,+DAA+D;IAC/D,MAAyC,EAAEC,WAAW,EACtDC,QAAQ,EACRC,EAAE,EAEH,GAAGR,OADCS,wCACDT;;;;;;;IACJ,MAAM,EAAEU,kBAAkB,EAAE,GAAGf,WAAWJ,MAAMoB,iBAAiB;IACjE,qBACE,KAAClB;QACCQ,KAAKA;QACL,mEAAmE;QACnE,8DAA8D;QAC9DW,wBAAsBP,QAAQ;QAC9BG,IAAI;YACFK,QAAQH,uBAAuB;gBAC7B,WAAW;oBACTI,WAAW;oBACXC,GAAG;oBACHC,SAAS;oBACTC,YAAY;oBACZC,gBAAgB;oBAChBC,aAAa;oBACbC,aAAa;oBACbC,aAAa;oBACbC,cAAc;gBAChB;gBACA,kBAAkB;oBAChBC,SAAS;oBACTC,OAAO;oBACPC,UAAU;oBACVC,eAAe;oBACfC,eAAe;gBACjB;YACF;eACIC,MAAMC,OAAO,CAACrB,MAAMA,KAAKA,KAAK;gBAACA;aAAG,GAAG,EAAE;SAC5C;OACGC;kBAEHF;;AAGP;AAEFR,iBAAiB+B,WAAW,GAAG;AAE/B,OAAO,MAAMC,SAAuD;IAClEC,KAAKnC;IACLoC,UAAUrC;IACVkC,aAAa;IACbI,aACE;IACFC,UAAU5C,MAAM6C,iBAAiB,CAACC,OAAO;IACzCC,MAAM;QACJC,MAAM/C,kBAAkB+C,IAAI;QAC5B/B,IAAI;YAAEgB,OAAO;QAAU;IACzB;IACAgB,OAAO;QACL,kEAAkE;QAClE,iDAAiD;QACjDC,UAAUlD,MAAMmD,YAAY,CAACC,QAAQ;IACvC;IACA;;;;;;;;GAQC,GACDC,YAAY,EAAE;AAChB,EAAC;AAED;;;CAGC,GACD,OAAO,MAAMC,UAAgC,EAAE,CAAA;AAE/C,eAAe9C,iBAAgB"}
1
+ {"version":3,"sources":["../../../../../../../libs/plugins/mui/src/lib/components/reusable-instance.tsx"],"sourcesContent":["/**\n * @license\n * Copyright 2026 Aglyn LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport * as Aglyn from '@aglyn/aglyn'\nimport { mdiPackageVariant } from '@aglyn/shared-data-mdi'\nimport Box, { type BoxProps } from '@mui/material/Box'\nimport { forwardRef, useContext } from 'react'\nimport { BUNDLE_ID } from '../constants/bundle-common'\n\n// Persisted in screen documents; never rename (see AGL-34 ADR).\nexport const ID: Aglyn.ComponentId = Aglyn.REUSABLE_INSTANCE_COMPONENT_ID\n\nexport interface ReusableInstanceProps extends BoxProps {\n /** Definition id in `hosts/{hostId}/components`; grafted at render time. */\n refId?: string\n /**\n * The definition's display name, carried on the instance purely so the\n * editor placeholder can say which component this stands for (AGL-1193).\n * Never rendered on production surfaces, where the graft fills the box.\n */\n name?: string\n /**\n * This instance's declared-prop overrides (AGL-1247). Addressed to the\n * GRAFT, which reads it off the stored node to substitute `{{prop.*}}`\n * inside its private copy of the definition — the wrapper element itself\n * has no use for it, and it is stripped below rather than spread.\n */\n propValues?: Record<string, unknown>\n /** Formatted text for those props, addressed to the graft as well. */\n propHtml?: Record<string, unknown>\n}\n\n/**\n * Wrapper element for a reusable-component instance. On production surfaces\n * the compose step (`composeReusableComponentNodes`) grafts the definition\n * subtree inside, so this renders as a plain container. In the editor the\n * instance has no children (definitions aren't grafted into the editable\n * canvas), so the CSS `:empty` placeholder marks it visibly instead — named,\n * since a layout whose chrome has been promoted is otherwise nothing but\n * indistinguishable dashed boxes.\n *\n * The placeholder is drawn on editing surfaces only. A published instance\n * whose definition does not resolve is left empty by the compose step, and a\n * visitor must not see the marker there.\n */\nconst ReusableInstance = forwardRef<any, ReusableInstanceProps>(\n (props, ref) => {\n const {\n refId: _refId,\n name,\n // Instance-scoped directives, not element attributes. `refId` and\n // `name` were always stripped; `propValues` was not, so the author's\n // overrides spread onto the Box and reached the DOM — React logs\n // \"does not recognize the `propValues` prop\" on the canvas, and a\n // published page serialised the same copy a second time as\n // `propvalues=\"[object Object]\"` on the wrapper (AGL-2486).\n //\n // Stripped HERE rather than in the graft because the canvas renders\n // an instance the graft has not touched (definitions are not grafted\n // into the editable canvas), so a strip upstream would fix the\n // published page and leave the editor warning on every render.\n [Aglyn.REUSABLE_INSTANCE_PROP_VALUES_KEY]: _propValues,\n // Its formatted text, the same way and for the same reason.\n [Aglyn.REUSABLE_INSTANCE_PROP_HTML_KEY]: _propHtml,\n children,\n sx,\n ...rest\n } = props\n const { suppressNavigation } = useContext(Aglyn.ScreenLinkContext)\n return (\n <Box\n ref={ref}\n // `content: attr()` rather than a child, so the box stays `:empty`\n // and the placeholder cannot be mistaken for grafted content.\n data-aglyn-component={name || 'Reusable component'}\n sx={[\n Boolean(suppressNavigation) && {\n '&:empty': {\n minHeight: 56,\n m: 1,\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n borderWidth: 1,\n borderStyle: 'dashed',\n borderColor: 'divider',\n borderRadius: 1,\n },\n '&:empty::after': {\n content: 'attr(data-aglyn-component)',\n color: 'text.secondary',\n fontSize: 12,\n letterSpacing: 1,\n textTransform: 'uppercase',\n },\n },\n ...(Array.isArray(sx) ? sx : sx ? [sx] : []),\n ]}\n {...rest}\n >\n {children}\n </Box>\n )\n },\n)\nReusableInstance.displayName = 'ReusableInstance'\n\nexport const schema: Aglyn.ComponentSchema<ReusableInstanceProps> = {\n $id: ID,\n pluginId: BUNDLE_ID,\n displayName: 'Reusable Component',\n description:\n 'Where a reusable component is placed. Edit the component once and every instance follows.',\n category: Aglyn.ComponentCategory.SURFACE,\n icon: {\n path: mdiPackageVariant.path,\n sx: { color: '#9c27b0' },\n },\n flags: {\n // Instances are opaque: their content lives in the definition, so\n // nothing may be dropped inside from the canvas.\n dropping: Aglyn.FEATURE_FLAG.DISABLED,\n },\n /*\n * No attributes. An instance is a REFERENCE, not an element: the graft puts\n * the definition's root in its place, so the only node that reaches a\n * published page is the component's own (AGL-2521). An element picker here\n * briefly existed (AGL-2514) and configured a wrapper that no longer\n * exists — what it was reaching for is **Change it on this page only →\n * Whole component**, which sets the definition root's element for this\n * placement (AGL-3288).\n */\n attributes: [],\n}\n\n/**\n * No static presets: instances are inserted from per-host definitions, which\n * the console registers dynamically (category \"Your components\").\n */\nexport const presets: Aglyn.PresetSchema[] = []\n\nexport default ReusableInstance\n"],"names":["Aglyn","mdiPackageVariant","Box","forwardRef","useContext","BUNDLE_ID","ID","REUSABLE_INSTANCE_COMPONENT_ID","ReusableInstance","props","ref","REUSABLE_INSTANCE_PROP_VALUES_KEY","REUSABLE_INSTANCE_PROP_HTML_KEY","refId","_refId","name","_propValues","_propHtml","children","sx","rest","suppressNavigation","ScreenLinkContext","data-aglyn-component","Boolean","minHeight","m","display","alignItems","justifyContent","borderWidth","borderStyle","borderColor","borderRadius","content","color","fontSize","letterSpacing","textTransform","Array","isArray","displayName","schema","$id","pluginId","description","category","ComponentCategory","SURFACE","icon","path","flags","dropping","FEATURE_FLAG","DISABLED","attributes","presets"],"mappings":";;;;AAAA;;;;;;;;;;;;;;;CAeC,GAED,YAAYA,WAAW,eAAc;AACrC,SAASC,iBAAiB,QAAQ,yBAAwB;AAC1D,OAAOC,SAA4B,oBAAmB;AACtD,SAASC,UAAU,EAAEC,UAAU,QAAQ,QAAO;AAC9C,SAASC,SAAS,QAAQ,gCAA4B;AAEtD,gEAAgE;AAChE,OAAO,MAAMC,KAAwBN,MAAMO,8BAA8B,CAAA;AAsBzE;;;;;;;;;;;;CAYC,GACD,MAAMC,iCAAmBL,WACvB,CAACM,OAAOC;IACN,aAcGV,MAAMW,iCAAiC,UAEvCX,MAAMY,+BAA+B,EAhBlC,EACJC,OAAOC,MAAM,EACbC,IAAI,EACJ,kEAAkE;IAClE,qEAAqE;IACrE,iEAAiE;IACjE,kEAAkE;IAClE,2DAA2D;IAC3D,4DAA4D;IAC5D,EAAE;IACF,oEAAoE;IACpE,qEAAqE;IACrE,+DAA+D;IAC/D,+DAA+D;IAC/D,MAAyC,EAAEC,WAAW,EACtD,4DAA4D;IAC5D,OAAuC,EAAEC,SAAS,EAClDC,QAAQ,EACRC,EAAE,EAEH,GAAGV,OADCW,wCACDX;;;;;;;;IACJ,MAAM,EAAEY,kBAAkB,EAAE,GAAGjB,WAAWJ,MAAMsB,iBAAiB;IACjE,qBACE,KAACpB;QACCQ,KAAKA;QACL,mEAAmE;QACnE,8DAA8D;QAC9Da,wBAAsBR,QAAQ;QAC9BI,IAAI;YACFK,QAAQH,uBAAuB;gBAC7B,WAAW;oBACTI,WAAW;oBACXC,GAAG;oBACHC,SAAS;oBACTC,YAAY;oBACZC,gBAAgB;oBAChBC,aAAa;oBACbC,aAAa;oBACbC,aAAa;oBACbC,cAAc;gBAChB;gBACA,kBAAkB;oBAChBC,SAAS;oBACTC,OAAO;oBACPC,UAAU;oBACVC,eAAe;oBACfC,eAAe;gBACjB;YACF;eACIC,MAAMC,OAAO,CAACrB,MAAMA,KAAKA,KAAK;gBAACA;aAAG,GAAG,EAAE;SAC5C;OACGC;kBAEHF;;AAGP;AAEFV,iBAAiBiC,WAAW,GAAG;AAE/B,OAAO,MAAMC,SAAuD;IAClEC,KAAKrC;IACLsC,UAAUvC;IACVoC,aAAa;IACbI,aACE;IACFC,UAAU9C,MAAM+C,iBAAiB,CAACC,OAAO;IACzCC,MAAM;QACJC,MAAMjD,kBAAkBiD,IAAI;QAC5B/B,IAAI;YAAEgB,OAAO;QAAU;IACzB;IACAgB,OAAO;QACL,kEAAkE;QAClE,iDAAiD;QACjDC,UAAUpD,MAAMqD,YAAY,CAACC,QAAQ;IACvC;IACA;;;;;;;;GAQC,GACDC,YAAY,EAAE;AAChB,EAAC;AAED;;;CAGC,GACD,OAAO,MAAMC,UAAgC,EAAE,CAAA;AAE/C,eAAehD,iBAAgB"}