@aglyn/plugins-mui 1.0.0-beta.261 → 1.0.0-beta.263

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.261",
3
+ "version": "1.0.0-beta.263",
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.261",
29
- "@aglyn/shared-data-enums": "1.0.0-beta.261",
30
- "@aglyn/shared-data-mdi": "1.0.0-beta.261",
31
- "@aglyn/shared-ui-jsx": "1.0.0-beta.261",
32
- "@aglyn/shared-ui-theme": "1.0.0-beta.261",
33
- "@aglyn/shared-util-vendor": "1.0.0-beta.261",
28
+ "@aglyn/aglyn": "1.0.0-beta.263",
29
+ "@aglyn/shared-data-enums": "1.0.0-beta.263",
30
+ "@aglyn/shared-data-mdi": "1.0.0-beta.263",
31
+ "@aglyn/shared-ui-jsx": "1.0.0-beta.263",
32
+ "@aglyn/shared-ui-theme": "1.0.0-beta.263",
33
+ "@aglyn/shared-util-vendor": "1.0.0-beta.263",
34
34
  "@swc/helpers": "0.5.23",
35
35
  "dayjs": "^1.11.23",
36
36
  "mobx": "^7.0.5",
@@ -15,8 +15,31 @@
15
15
  * limitations under the License.
16
16
  */
17
17
  import * as Aglyn from '@aglyn/aglyn';
18
- import ListItemText, { type ListItemTextProps } from '@mui/material/ListItemText';
18
+ import { type ListItemTextProps } from '@mui/material/ListItemText';
19
19
  export declare const ID: Aglyn.ComponentId;
20
- export declare const schema: Aglyn.ComponentSchema<ListItemTextProps>;
20
+ /**
21
+ * The colors the secondary words can take: the theme's muted text color
22
+ * (MUI's own default), or the color of the row around them.
23
+ */
24
+ export declare const LIST_ITEM_TEXT_SECONDARY_COLORS: readonly ["textSecondary", "inherit"];
25
+ export type ListItemTextSecondaryColor = (typeof LIST_ITEM_TEXT_SECONDARY_COLORS)[number];
26
+ export interface ListItemTextElementProps extends ListItemTextProps {
27
+ /**
28
+ * The secondary words' color. MUI draws them in the theme's
29
+ * `text.secondary`, which is chosen for the page's own background, so on
30
+ * a band painted in a brand color they nearly vanish. `inherit` draws them
31
+ * in the color the row inherits, as the primary words already are.
32
+ */
33
+ secondaryColor?: ListItemTextSecondaryColor;
34
+ }
35
+ /**
36
+ * List Item Text (https://mui.com/material-ui/api/list-item-text/).
37
+ *
38
+ * Wraps MUI's ListItemText only to turn the authored `secondaryColor` into
39
+ * the secondary slot's Typography `color`, which MUI otherwise fixes at
40
+ * `textSecondary`.
41
+ */
42
+ declare const ListItemText: import("react").ForwardRefExoticComponent<Omit<ListItemTextElementProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
43
+ export declare const schema: Aglyn.ComponentSchema<ListItemTextElementProps>;
21
44
  export declare const presets: Aglyn.PresetSchema[];
22
45
  export default ListItemText;
@@ -1,3 +1,5 @@
1
+ import { _ as _extends } from "@swc/helpers/_/_extends";
2
+ import { _ as _object_without_properties_loose } from "@swc/helpers/_/_object_without_properties_loose";
1
3
  /**
2
4
  * @license
3
5
  * Copyright 2026 Aglyn LLC
@@ -15,11 +17,42 @@
15
17
  * limitations under the License.
16
18
  */ import * as Aglyn from "@aglyn/aglyn";
17
19
  import { mdiFormatListChecks } from "@aglyn/shared-data-mdi";
18
- import ListItemText from "@mui/material/ListItemText";
20
+ import MuiListItemText from "@mui/material/ListItemText";
21
+ import { createElement, forwardRef } from "react";
19
22
  import { BUNDLE_ID } from "../constants/bundle-common.js";
20
23
  import { generatePresetId } from "../utils/generate-preset-id.js";
21
24
  // Component ids are persisted in screen documents; keep the legacy ids.
22
25
  export const ID = 'muiListItemText';
26
+ /**
27
+ * The colors the secondary words can take: the theme's muted text color
28
+ * (MUI's own default), or the color of the row around them.
29
+ */ export const LIST_ITEM_TEXT_SECONDARY_COLORS = [
30
+ 'textSecondary',
31
+ 'inherit'
32
+ ];
33
+ /**
34
+ * List Item Text (https://mui.com/material-ui/api/list-item-text/).
35
+ *
36
+ * Wraps MUI's ListItemText only to turn the authored `secondaryColor` into
37
+ * the secondary slot's Typography `color`, which MUI otherwise fixes at
38
+ * `textSecondary`.
39
+ */ const ListItemText = forwardRef((props, ref)=>{
40
+ const { secondaryColor, slotProps } = props, rest = _object_without_properties_loose(props, [
41
+ "secondaryColor",
42
+ "slotProps"
43
+ ]);
44
+ const own = slotProps == null ? void 0 : slotProps.secondary;
45
+ return createElement(MuiListItemText, _extends({
46
+ ref
47
+ }, rest, {
48
+ slotProps: secondaryColor === 'inherit' ? _extends({}, slotProps, {
49
+ secondary: _extends({}, typeof own === 'object' ? own : {}, {
50
+ color: 'inherit'
51
+ })
52
+ }) : slotProps
53
+ }));
54
+ });
55
+ ListItemText.displayName = 'AglynListItemText';
23
56
  export const schema = {
24
57
  $id: ID,
25
58
  pluginId: BUNDLE_ID,
@@ -55,6 +88,22 @@ export const schema = {
55
88
  component: Aglyn.FieldComponentType.TEXTAREA,
56
89
  label: 'Secondary text'
57
90
  },
91
+ {
92
+ name: 'secondaryColor',
93
+ description: 'Muted draws the secondary text in the theme’s quieter text color, ' + 'made for the page background. On a band painted in a brand color, ' + 'pick Same as the primary text so it reads in the band’s own text ' + 'color.',
94
+ component: Aglyn.FieldComponentType.SELECT,
95
+ label: 'Secondary text color',
96
+ options: [
97
+ {
98
+ value: 'textSecondary',
99
+ label: 'Muted (default)'
100
+ },
101
+ {
102
+ value: 'inherit',
103
+ label: 'Same as the primary text'
104
+ }
105
+ ]
106
+ },
58
107
  {
59
108
  name: 'inset',
60
109
  description: 'Indents the text to line up with rows that have an icon or ' + 'avatar, so a mixed list keeps one text column.',
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../../../libs/plugins/mui/src/lib/components/list-item-text.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 * as Aglyn from '@aglyn/aglyn'\nimport {\n mdiFormatListChecks,\n} from '@aglyn/shared-data-mdi'\nimport ListItemText, {\n type ListItemTextProps,\n} from '@mui/material/ListItemText'\nimport { BUNDLE_ID } from '../constants/bundle-common'\nimport { generatePresetId } from '../utils/generate-preset-id'\n\n// Component ids are persisted in screen documents; keep the legacy ids.\nexport const ID: Aglyn.ComponentId = 'muiListItemText'\n\nexport const schema: Aglyn.ComponentSchema<ListItemTextProps> = {\n $id: ID,\n pluginId: BUNDLE_ID,\n displayName: 'List Item Text',\n description: 'The primary and secondary text pair inside a list row.',\n category: Aglyn.ComponentCategory.DATA_DISPLAY,\n icon: { path: mdiFormatListChecks.path },\n // Text lives in `primary`/`secondary` (not `children`), so this component\n // exposes its own text fields instead of FIELD_TEXT_CONTENT.\n flags: {\n // Static: may sit in a subtree that keeps its server HTML (AGL-3581).\n lazyHydration: Aglyn.FEATURE_FLAG.ENABLED,\n // …and MUI reads `children` ONLY as a fallback for a missing `primary`\n // (`primary = primaryProp != null ? primaryProp : children`), so with a\n // primary set — which every preset and every authored row has — a node\n // dropped in here is discarded at render with no warning. Same shape as\n // the Markdown block that swallowed three /press screenshots\n // (AGL-1388): the row's text is its attributes, not its child list.\n dropping: Aglyn.FEATURE_FLAG.DISABLED,\n },\n attributes: [\n {\n name: 'primary',\n description: 'The main content text.',\n component: Aglyn.FieldComponentType.TEXTAREA,\n label: 'Primary text',\n },\n {\n name: 'secondary',\n description: 'The secondary content text.',\n component: Aglyn.FieldComponentType.TEXTAREA,\n label: 'Secondary text',\n },\n {\n name: 'inset',\n description:\n 'Indents the text to line up with rows that have an icon or ' +\n 'avatar, so a mixed list keeps one text column.',\n component: Aglyn.FieldComponentType.SWITCH,\n label: 'Inset?',\n },\n ],\n}\n\nexport const presets: Aglyn.PresetSchema[] = [\n {\n $id: generatePresetId(ID),\n type: Aglyn.NodeType.PRESET,\n displayName: 'List Item Text',\n icon: { path: mdiFormatListChecks.path },\n category: Aglyn.ComponentCategory.DATA_DISPLAY,\n data: {\n $id: null,\n componentId: ID,\n pluginId: BUNDLE_ID,\n props: {\n primary: 'Item Primary',\n secondary: 'This is the secondary',\n },\n },\n },\n]\n\nexport default ListItemText\n"],"names":["Aglyn","mdiFormatListChecks","ListItemText","BUNDLE_ID","generatePresetId","ID","schema","$id","pluginId","displayName","description","category","ComponentCategory","DATA_DISPLAY","icon","path","flags","lazyHydration","FEATURE_FLAG","ENABLED","dropping","DISABLED","attributes","name","component","FieldComponentType","TEXTAREA","label","SWITCH","presets","type","NodeType","PRESET","data","componentId","props","primary","secondary"],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC,GAED,YAAYA,WAAW,eAAc;AACrC,SACEC,mBAAmB,QACd,yBAAwB;AAC/B,OAAOC,kBAEA,6BAA4B;AACnC,SAASC,SAAS,QAAQ,gCAA4B;AACtD,SAASC,gBAAgB,QAAQ,iCAA6B;AAE9D,wEAAwE;AACxE,OAAO,MAAMC,KAAwB,kBAAiB;AAEtD,OAAO,MAAMC,SAAmD;IAC9DC,KAAKF;IACLG,UAAUL;IACVM,aAAa;IACbC,aAAa;IACbC,UAAUX,MAAMY,iBAAiB,CAACC,YAAY;IAC9CC,MAAM;QAAEC,MAAMd,oBAAoBc,IAAI;IAAC;IACvC,0EAA0E;IAC1E,6DAA6D;IAC7DC,OAAO;QACL,sEAAsE;QACtEC,eAAejB,MAAMkB,YAAY,CAACC,OAAO;QACzC,uEAAuE;QACvE,wEAAwE;QACxE,uEAAuE;QACvE,wEAAwE;QACxE,6DAA6D;QAC7D,oEAAoE;QACpEC,UAAUpB,MAAMkB,YAAY,CAACG,QAAQ;IACvC;IACAC,YAAY;QACV;YACEC,MAAM;YACNb,aAAa;YACbc,WAAWxB,MAAMyB,kBAAkB,CAACC,QAAQ;YAC5CC,OAAO;QACT;QACA;YACEJ,MAAM;YACNb,aAAa;YACbc,WAAWxB,MAAMyB,kBAAkB,CAACC,QAAQ;YAC5CC,OAAO;QACT;QACA;YACEJ,MAAM;YACNb,aACE,gEACA;YACFc,WAAWxB,MAAMyB,kBAAkB,CAACG,MAAM;YAC1CD,OAAO;QACT;KACD;AACH,EAAC;AAED,OAAO,MAAME,UAAgC;IAC3C;QACEtB,KAAKH,iBAAiBC;QACtByB,MAAM9B,MAAM+B,QAAQ,CAACC,MAAM;QAC3BvB,aAAa;QACbK,MAAM;YAAEC,MAAMd,oBAAoBc,IAAI;QAAC;QACvCJ,UAAUX,MAAMY,iBAAiB,CAACC,YAAY;QAC9CoB,MAAM;YACJ1B,KAAK;YACL2B,aAAa7B;YACbG,UAAUL;YACVgC,OAAO;gBACLC,SAAS;gBACTC,WAAW;YACb;QACF;IACF;CACD,CAAA;AAED,eAAenC,aAAY"}
1
+ {"version":3,"sources":["../../../../../../../libs/plugins/mui/src/lib/components/list-item-text.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 * as Aglyn from '@aglyn/aglyn'\nimport {\n mdiFormatListChecks,\n} from '@aglyn/shared-data-mdi'\nimport MuiListItemText, {\n type ListItemTextProps,\n} from '@mui/material/ListItemText'\nimport { createElement, forwardRef } from 'react'\nimport { BUNDLE_ID } from '../constants/bundle-common'\nimport { generatePresetId } from '../utils/generate-preset-id'\n\n// Component ids are persisted in screen documents; keep the legacy ids.\nexport const ID: Aglyn.ComponentId = 'muiListItemText'\n\n/**\n * The colors the secondary words can take: the theme's muted text color\n * (MUI's own default), or the color of the row around them.\n */\nexport const LIST_ITEM_TEXT_SECONDARY_COLORS = ['textSecondary', 'inherit'] as const\nexport type ListItemTextSecondaryColor =\n (typeof LIST_ITEM_TEXT_SECONDARY_COLORS)[number]\n\nexport interface ListItemTextElementProps extends ListItemTextProps {\n /**\n * The secondary words' color. MUI draws them in the theme's\n * `text.secondary`, which is chosen for the page's own background, so on\n * a band painted in a brand color they nearly vanish. `inherit` draws them\n * in the color the row inherits, as the primary words already are.\n */\n secondaryColor?: ListItemTextSecondaryColor\n}\n\n/**\n * List Item Text (https://mui.com/material-ui/api/list-item-text/).\n *\n * Wraps MUI's ListItemText only to turn the authored `secondaryColor` into\n * the secondary slot's Typography `color`, which MUI otherwise fixes at\n * `textSecondary`.\n */\nconst ListItemText = forwardRef<HTMLDivElement, ListItemTextElementProps>(\n (props, ref) => {\n const { secondaryColor, slotProps, ...rest } = props\n const own = slotProps?.secondary\n return createElement(MuiListItemText, {\n ref,\n ...rest,\n slotProps:\n secondaryColor === 'inherit'\n ? {\n ...slotProps,\n secondary: {\n ...(typeof own === 'object' ? own : {}),\n color: 'inherit',\n },\n }\n : slotProps,\n })\n },\n)\nListItemText.displayName = 'AglynListItemText'\n\nexport const schema: Aglyn.ComponentSchema<ListItemTextElementProps> = {\n $id: ID,\n pluginId: BUNDLE_ID,\n displayName: 'List Item Text',\n description: 'The primary and secondary text pair inside a list row.',\n category: Aglyn.ComponentCategory.DATA_DISPLAY,\n icon: { path: mdiFormatListChecks.path },\n // Text lives in `primary`/`secondary` (not `children`), so this component\n // exposes its own text fields instead of FIELD_TEXT_CONTENT.\n flags: {\n // Static: may sit in a subtree that keeps its server HTML (AGL-3581).\n lazyHydration: Aglyn.FEATURE_FLAG.ENABLED,\n // …and MUI reads `children` ONLY as a fallback for a missing `primary`\n // (`primary = primaryProp != null ? primaryProp : children`), so with a\n // primary set — which every preset and every authored row has — a node\n // dropped in here is discarded at render with no warning. Same shape as\n // the Markdown block that swallowed three /press screenshots\n // (AGL-1388): the row's text is its attributes, not its child list.\n dropping: Aglyn.FEATURE_FLAG.DISABLED,\n },\n attributes: [\n {\n name: 'primary',\n description: 'The main content text.',\n component: Aglyn.FieldComponentType.TEXTAREA,\n label: 'Primary text',\n },\n {\n name: 'secondary',\n description: 'The secondary content text.',\n component: Aglyn.FieldComponentType.TEXTAREA,\n label: 'Secondary text',\n },\n {\n name: 'secondaryColor',\n description:\n 'Muted draws the secondary text in the theme’s quieter text color, ' +\n 'made for the page background. On a band painted in a brand color, ' +\n 'pick Same as the primary text so it reads in the band’s own text ' +\n 'color.',\n component: Aglyn.FieldComponentType.SELECT,\n label: 'Secondary text color',\n options: [\n { value: 'textSecondary', label: 'Muted (default)' },\n { value: 'inherit', label: 'Same as the primary text' },\n ],\n },\n {\n name: 'inset',\n description:\n 'Indents the text to line up with rows that have an icon or ' +\n 'avatar, so a mixed list keeps one text column.',\n component: Aglyn.FieldComponentType.SWITCH,\n label: 'Inset?',\n },\n ],\n}\n\nexport const presets: Aglyn.PresetSchema[] = [\n {\n $id: generatePresetId(ID),\n type: Aglyn.NodeType.PRESET,\n displayName: 'List Item Text',\n icon: { path: mdiFormatListChecks.path },\n category: Aglyn.ComponentCategory.DATA_DISPLAY,\n data: {\n $id: null,\n componentId: ID,\n pluginId: BUNDLE_ID,\n props: {\n primary: 'Item Primary',\n secondary: 'This is the secondary',\n },\n },\n },\n]\n\nexport default ListItemText\n"],"names":["Aglyn","mdiFormatListChecks","MuiListItemText","createElement","forwardRef","BUNDLE_ID","generatePresetId","ID","LIST_ITEM_TEXT_SECONDARY_COLORS","ListItemText","props","ref","secondaryColor","slotProps","rest","own","secondary","color","displayName","schema","$id","pluginId","description","category","ComponentCategory","DATA_DISPLAY","icon","path","flags","lazyHydration","FEATURE_FLAG","ENABLED","dropping","DISABLED","attributes","name","component","FieldComponentType","TEXTAREA","label","SELECT","options","value","SWITCH","presets","type","NodeType","PRESET","data","componentId","primary"],"mappings":";;AAAA;;;;;;;;;;;;;;;CAeC,GAED,YAAYA,WAAW,eAAc;AACrC,SACEC,mBAAmB,QACd,yBAAwB;AAC/B,OAAOC,qBAEA,6BAA4B;AACnC,SAASC,aAAa,EAAEC,UAAU,QAAQ,QAAO;AACjD,SAASC,SAAS,QAAQ,gCAA4B;AACtD,SAASC,gBAAgB,QAAQ,iCAA6B;AAE9D,wEAAwE;AACxE,OAAO,MAAMC,KAAwB,kBAAiB;AAEtD;;;CAGC,GACD,OAAO,MAAMC,kCAAkC;IAAC;IAAiB;CAAU,CAAS;AAcpF;;;;;;CAMC,GACD,MAAMC,eAAeL,WACnB,CAACM,OAAOC;IACN,MAAM,EAAEC,cAAc,EAAEC,SAAS,EAAW,GAAGH,OAATI,wCAASJ;;;;IAC/C,MAAMK,MAAMF,6BAAAA,UAAWG,SAAS;IAChC,OAAOb,cAAcD,iBAAiB;QACpCS;OACGG;QACHD,WACED,mBAAmB,YACf,aACKC;YACHG,WAAW,aACL,OAAOD,QAAQ,WAAWA,MAAM,CAAC;gBACrCE,OAAO;;aAGXJ;;AAEV;AAEFJ,aAAaS,WAAW,GAAG;AAE3B,OAAO,MAAMC,SAA0D;IACrEC,KAAKb;IACLc,UAAUhB;IACVa,aAAa;IACbI,aAAa;IACbC,UAAUvB,MAAMwB,iBAAiB,CAACC,YAAY;IAC9CC,MAAM;QAAEC,MAAM1B,oBAAoB0B,IAAI;IAAC;IACvC,0EAA0E;IAC1E,6DAA6D;IAC7DC,OAAO;QACL,sEAAsE;QACtEC,eAAe7B,MAAM8B,YAAY,CAACC,OAAO;QACzC,uEAAuE;QACvE,wEAAwE;QACxE,uEAAuE;QACvE,wEAAwE;QACxE,6DAA6D;QAC7D,oEAAoE;QACpEC,UAAUhC,MAAM8B,YAAY,CAACG,QAAQ;IACvC;IACAC,YAAY;QACV;YACEC,MAAM;YACNb,aAAa;YACbc,WAAWpC,MAAMqC,kBAAkB,CAACC,QAAQ;YAC5CC,OAAO;QACT;QACA;YACEJ,MAAM;YACNb,aAAa;YACbc,WAAWpC,MAAMqC,kBAAkB,CAACC,QAAQ;YAC5CC,OAAO;QACT;QACA;YACEJ,MAAM;YACNb,aACE,uEACA,uEACA,sEACA;YACFc,WAAWpC,MAAMqC,kBAAkB,CAACG,MAAM;YAC1CD,OAAO;YACPE,SAAS;gBACP;oBAAEC,OAAO;oBAAiBH,OAAO;gBAAkB;gBACnD;oBAAEG,OAAO;oBAAWH,OAAO;gBAA2B;aACvD;QACH;QACA;YACEJ,MAAM;YACNb,aACE,gEACA;YACFc,WAAWpC,MAAMqC,kBAAkB,CAACM,MAAM;YAC1CJ,OAAO;QACT;KACD;AACH,EAAC;AAED,OAAO,MAAMK,UAAgC;IAC3C;QACExB,KAAKd,iBAAiBC;QACtBsC,MAAM7C,MAAM8C,QAAQ,CAACC,MAAM;QAC3B7B,aAAa;QACbQ,MAAM;YAAEC,MAAM1B,oBAAoB0B,IAAI;QAAC;QACvCJ,UAAUvB,MAAMwB,iBAAiB,CAACC,YAAY;QAC9CuB,MAAM;YACJ5B,KAAK;YACL6B,aAAa1C;YACbc,UAAUhB;YACVK,OAAO;gBACLwC,SAAS;gBACTlC,WAAW;YACb;QACF;IACF;CACD,CAAA;AAED,eAAeP,aAAY"}