@aglyn/plugins-mui 1.0.0-beta.224 → 1.0.0-beta.226
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 +7 -7
- package/src/lib/components/app-bar.d.ts +15 -2
- package/src/lib/components/app-bar.js +94 -3
- package/src/lib/components/app-bar.js.map +1 -1
- package/src/lib/components/box.js +6 -0
- package/src/lib/components/box.js.map +1 -1
- package/src/lib/components/button.js +2 -0
- package/src/lib/components/button.js.map +1 -1
- package/src/lib/components/container.js +6 -0
- package/src/lib/components/container.js.map +1 -1
- package/src/lib/components/grid.js +6 -0
- package/src/lib/components/grid.js.map +1 -1
- package/src/lib/components/icon.js +2 -0
- package/src/lib/components/icon.js.map +1 -1
- package/src/lib/components/image.js +2 -0
- package/src/lib/components/image.js.map +1 -1
- package/src/lib/components/inline-text.js +2 -0
- package/src/lib/components/inline-text.js.map +1 -1
- package/src/lib/components/layout-slot.js +4 -0
- package/src/lib/components/layout-slot.js.map +1 -1
- package/src/lib/components/link-box.js +6 -0
- package/src/lib/components/link-box.js.map +1 -1
- package/src/lib/components/list-item-text.js +2 -0
- package/src/lib/components/list-item-text.js.map +1 -1
- package/src/lib/components/list-item.js +4 -0
- package/src/lib/components/list-item.js.map +1 -1
- package/src/lib/components/list.js +4 -0
- package/src/lib/components/list.js.map +1 -1
- package/src/lib/components/paper.js +6 -0
- package/src/lib/components/paper.js.map +1 -1
- package/src/lib/components/screen-link.js +2 -0
- package/src/lib/components/screen-link.js.map +1 -1
- package/src/lib/components/section.js +6 -0
- package/src/lib/components/section.js.map +1 -1
- package/src/lib/components/stack.js +4 -0
- package/src/lib/components/stack.js.map +1 -1
- package/src/lib/components/typography.js +2 -0
- package/src/lib/components/typography.js.map +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../../../libs/plugins/mui/src/lib/components/typography.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 {\n mdiAlphabetical,\n mdiFormatHeader1,\n mdiFormatHeader2,\n mdiFormatHeader3,\n mdiFormatHeader4,\n mdiFormatHeader5,\n mdiFormatHeader6,\n mdiFormatText,\n} from '@aglyn/shared-data-mdi'\nimport Typography, { type TypographyProps } from '@mui/material/Typography'\nimport { forwardRef } from 'react'\nimport { BUNDLE_ID } from '../constants/bundle-common'\nimport { FIELD_TEXT_CONTENT } from '../constants/field-presets'\nimport { dropClearedProps } from '../utils/drop-cleared-props'\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 = 'muiTypography'\n// The brand's own rungs sit alongside MUI's. They were added to the theme\n// (AGL-1308 for the body scale, for the display rung) but never to\n// this list, so the only way to reach one was to hand-write its pixels into\n// the Styles panel — which is the very thing the tokens exist to stop.\n// Display first: the list reads largest to smallest.\n//\n// Exported because it is the theme's rung list, not this element's: any block\n// that offers a type step has to offer the SAME one, or a rung added to the\n// theme becomes reachable from the Typography element and nowhere else.\nexport const typographyVariants = [\n {\n value: 'displayXl',\n label: 'Display XL',\n icon: { path: mdiFormatHeader1.path },\n },\n { value: 'h1', label: 'Heading 1', icon: { path: mdiFormatHeader1.path } },\n { value: 'h2', label: 'Heading 2', icon: { path: mdiFormatHeader2.path } },\n { value: 'h3', label: 'Heading 3', icon: { path: mdiFormatHeader3.path } },\n { value: 'h4', label: 'Heading 4', icon: { path: mdiFormatHeader4.path } },\n { value: 'h5', label: 'Heading 5', icon: { path: mdiFormatHeader5.path } },\n { value: 'h6', label: 'Heading 6', icon: { path: mdiFormatHeader6.path } },\n {\n value: 'subtitle1',\n label: 'Subtitle 1',\n icon: { path: mdiFormatText.path },\n },\n {\n value: 'subtitle2',\n label: 'Subtitle 2',\n icon: { path: mdiFormatText.path },\n },\n { value: 'body1', label: 'Body 1', icon: { path: mdiFormatText.path } },\n { value: 'body2', label: 'Body 2', icon: { path: mdiFormatText.path } },\n { value: 'lede', label: 'Lede', icon: { path: mdiFormatText.path } },\n { value: 'overline', label: 'Overline', icon: { path: mdiFormatText.path } },\n { value: 'caption', label: 'Caption', icon: { path: mdiFormatText.path } },\n {\n value: 'bodyCompact',\n label: 'Body compact',\n icon: { path: mdiFormatText.path },\n },\n { value: 'micro', label: 'Micro', icon: { path: mdiFormatText.path } },\n]\n\nexport const schema: Aglyn.ComponentSchema = {\n $id: ID,\n pluginId: BUNDLE_ID,\n displayName: 'Typography',\n description: \"A block of text in one of the theme's type styles.\",\n category: Aglyn.ComponentCategory.TEXT,\n icon: {\n path: mdiAlphabetical.path,\n sx: { color: '#057822' },\n },\n flags: {\n textEditable: Aglyn.FEATURE_FLAG.ENABLED,\n richTextEditable: Aglyn.FEATURE_FLAG.ENABLED,\n },\n attributes: [\n FIELD_TEXT_CONTENT,\n // FIELD_COLOR,\n {\n name: 'variant',\n description:\n 'Which typography step from the site theme this text uses — h1–h6, ' +\n 'body, subtitle, caption, overline. It sets size, weight and line ' +\n 'height together; it does NOT change the HTML element, which is the ' +\n 'field below.',\n component: Aglyn.FieldComponentType.SELECT,\n label: 'Variant',\n // \"Default\" deleted (AGL-1453): unpersistable, and a second name for\n // `body1`, MUI's own default, already in `typographyVariants`.\n options: [...typographyVariants],\n },\n {\n name: 'component',\n description: 'The html element to use.',\n component: Aglyn.FieldComponentType.SELECT,\n label: 'Component',\n // \"Default\" deleted rather than given a sentinel (AGL-1453), and this\n // is the prop that shows why a sentinel is not always available: MUI\n // derives the element from `variantMapping[variant]`, so \"Default\"\n // resolves to a DIFFERENT tag per variant — `h2` for a Heading 2, `p`\n // for Body 1. No single value on this list expresses that, and picking\n // one would pin the tag and change the document outline. Unset is the\n // only thing that means \"let the variant decide\", and the field's ✕ is\n // how an author says it.\n options: [\n { value: 'h1', label: 'Heading 1' },\n { value: 'h2', label: 'Heading 2' },\n { value: 'h3', label: 'Heading 3' },\n { value: 'h4', label: 'Heading 4' },\n { value: 'h5', label: 'Heading 5' },\n { value: 'h6', label: 'Heading 6' },\n { value: 'p', label: 'Paragraph' },\n { value: 'div', label: 'Div' },\n { value: 'span', label: 'Span' },\n ],\n },\n {\n name: 'align',\n description: 'The text alignment',\n component: Aglyn.FieldComponentType.SELECT,\n label: 'Alignment',\n // \"Default\" deleted (AGL-1453): unpersistable, and a second name for\n // `inherit`, MUI Typography's own default, already on the list.\n options: [\n { value: 'inherit', label: 'Inherit' },\n { value: 'left', label: 'Left' },\n { value: 'center', label: 'Center' },\n { value: 'right', label: 'Right' },\n { value: 'justify', label: 'Justified' },\n ],\n },\n {\n name: 'noWrap',\n description: 'If true, the text will not wrap/fold.',\n component: Aglyn.FieldComponentType.SWITCH,\n label: 'Disable wrapping?',\n },\n {\n name: 'gutterBottom',\n description: 'If true, the text will have a space beneath.',\n component: Aglyn.FieldComponentType.SWITCH,\n label: 'Gutter bottom?',\n },\n ],\n}\n\nexport const presets: Aglyn.PresetSchema[] = [\n ...typographyVariants.map((item): Aglyn.PresetSchema => ({\n $id: generatePresetId(ID, item.value),\n type: Aglyn.NodeType.PRESET,\n displayName: item.label,\n pluginId: BUNDLE_ID,\n description: `Element with ${item.label} styles`,\n category: Aglyn.ComponentCategory.TEXT,\n icon: {\n sx: { color: '#057822' },\n ...item.icon,\n },\n data: {\n $id: null,\n componentId: ID,\n pluginId: BUNDLE_ID,\n props: {\n variant: item.value,\n children: item.label,\n },\n },\n })),\n]\n\n/**\n * Typography that renders rich text (AGL-54): when the node carries an\n * `html` prop it renders as innerHTML; otherwise plain `children`.\n *\n * The `html` prop is re-sanitized on EVERY render (AGL-497). The inline\n * editor sanitizes at commit, but screen node props are written directly via\n * the Firebase client SDK, so a host editor can plant arbitrary `html`\n * (bypassing the editor) that would execute on the public site AND in the\n * besigner canvas on app.aglyn.com.\n *\n * The sanitizer is `Aglyn.sanitizeAuthorHtml` (AGL-1901), which needs no DOM\n * and so runs on the server too — the DOMPurify call this replaced could\n * not, which is why the content used to be deferred to an effect and left\n * every rich-text body out of the server response. The allowlist it enforces\n * is a subset of the old DOMPurify config's, pinned pair by pair in\n * `rich-text-hydration.spec.tsx`.\n */\nfunction sanitizeTypographyHtml(html: string): string {\n return Aglyn.sanitizeAuthorHtml(html)\n}\n\n/**\n * MUI's own `defaultVariantMapping`, plus its `span` fallback — the element\n * Typography will actually render for a given variant. Copied rather than\n * imported because MUI does not export it; `author-html-round-trip.spec.tsx`\n * asserts this table still matches what MUI actually renders, so a MUI upgrade that\n * changed the mapping fails there rather than silently reopening the\n * reparenting hazard below.\n */\n/**\n * The element each variant renders as, and the ONE place that decides\n *.\n *\n * MUI's own `variantMapping` sends `subtitle1` and `subtitle2` to `<h6>`.\n * That is a typographic choice made in a component library, and on a page\n * builder it is a document-outline decision made by somebody who has never\n * seen the page: a subtitle is a label, not a section, and every one on every\n * Aglyn site was silently inserting an `<h6>` into the heading order. It is\n * what Lighthouse's `heading-order` was reporting — a \"Open source &\n * self-hostable\" card label rendering ahead of the page's own `<h1>`, from a\n * node whose author had selected Subtitle 1 and nothing else.\n *\n * Subtitles render as `<p>` here. An author who wants a heading still says so\n * with the Component field, which is the control for exactly that question\n * and is unchanged.\n *\n * Passed to MUI as `variantMapping` rather than only consulted by\n * `blockSafeComponent`, so the table cannot describe one thing while the\n * element is another.\n */\nconst VARIANT_ELEMENT: Record<string, string> = {\n h1: 'h1', h2: 'h2', h3: 'h3', h4: 'h4', h5: 'h5', h6: 'h6',\n subtitle1: 'p', subtitle2: 'p', body1: 'p', body2: 'p', inherit: 'p',\n}\n\n/**\n * The element the rich-text body is put INSIDE, which may have to be a\n * `<div>` rather than the one the variant implies (AGL-1901).\n *\n * The parser closes a `<p>` on any block start tag, and a heading on any\n * other heading. So a body with an `<h2>` in it, served inside the `<p>` MUI\n * renders for `body1`, arrives at the browser as\n * `<p class=\"MuiTypography-root\"></p><h2>…</h2>` — the container emptied and\n * the body promoted to a sibling. React then hydrates against a DOM that is\n * not the one it described and reports a mismatch: the live React #418 shape\n * on tenant (AGL-1926), which this change must not add to.\n *\n * This never mattered before because the server `<p>` was EMPTY and the body\n * arrived through an `innerHTML` assignment, which parses in the CONTEXT of\n * the `<p>` and so does not reparent. Serving the body is what makes the\n * container's element type load-bearing.\n *\n * `authorHtmlBreaksContainer` holds the rule, next to the table of tags it\n * depends on. Returns `'div'` to override, or `undefined` to leave MUI's\n * choice alone; the decision is a pure function of props, so the server and\n * the client make it identically.\n */\nfunction blockSafeComponent(\n sanitized: string,\n rest: TypographyProps,\n): 'div' | undefined {\n const element =\n (rest.component as string | undefined) ??\n // MUI's own default variant is `body1`, which maps to `p` — the case that\n // matters, since a Typography with no variant set is the shape nearly\n // every rich-text node has. (`paragraph` is gone in MUI v7, so the\n // variant mapping is the only other input.)\n VARIANT_ELEMENT[(rest.variant as string) ?? 'body1'] ??\n 'span'\n return Aglyn.authorHtmlBreaksContainer(sanitized, element) ? 'div' : undefined\n}\n\nconst AglynTypography = forwardRef<\n HTMLElement,\n TypographyProps & { html?: string }\n>(function AglynTypography(props, ref) {\n const { html, children, ...spread } = props\n // A cleared `align` persists as null and MUI capitalizes it — an SSR throw\n // that 500s the page (AGL-1226, same shape as the button colour).\n const rest = dropClearedProps(spread)\n const hasHtml = typeof html === 'string' && Boolean(html)\n // Sanitized DURING render, on the server and in the browser alike\n // (AGL-1901). The effect this replaced existed because DOMPurify needs a\n // DOM: the server rendered nothing, so the first client render had to\n // render nothing too or hydration would mismatch (AGL-1268) — the two\n // sides agreed only by both being empty, and the body never reached a\n // crawler. `sanitizeAuthorHtml` is a pure function of the string with no\n // DOM dependency, so both sides now compute the same bytes from the same\n // prop and agree on the CONTENT instead of on the absence of it.\n const sanitized = hasHtml ? sanitizeTypographyHtml(html as string) : null\n if (sanitized !== null) {\n // A `<p>` cannot hold the block content a rich-text body may contain —\n // see `blockSafeComponent`. `undefined` leaves MUI's own choice alone.\n const component = blockSafeComponent(sanitized, rest as TypographyProps)\n return (\n <Typography\n ref={ref}\n variantMapping={VARIANT_ELEMENT}\n {...rest}\n {...(component ? { component } : {})}\n dangerouslySetInnerHTML={{ __html: sanitized }}\n />\n )\n }\n return (\n <Typography ref={ref} variantMapping={VARIANT_ELEMENT} {...rest}>\n {children}\n </Typography>\n )\n})\n\nexport default AglynTypography\n"],"names":["Aglyn","mdiAlphabetical","mdiFormatHeader1","mdiFormatHeader2","mdiFormatHeader3","mdiFormatHeader4","mdiFormatHeader5","mdiFormatHeader6","mdiFormatText","Typography","forwardRef","BUNDLE_ID","FIELD_TEXT_CONTENT","dropClearedProps","generatePresetId","ID","typographyVariants","value","label","icon","path","schema","$id","pluginId","displayName","description","category","ComponentCategory","TEXT","sx","color","flags","textEditable","FEATURE_FLAG","ENABLED","richTextEditable","attributes","name","component","FieldComponentType","SELECT","options","SWITCH","presets","map","item","type","NodeType","PRESET","data","componentId","props","variant","children","sanitizeTypographyHtml","html","sanitizeAuthorHtml","VARIANT_ELEMENT","h1","h2","h3","h4","h5","h6","subtitle1","subtitle2","body1","body2","inherit","blockSafeComponent","sanitized","rest","element","authorHtmlBreaksContainer","undefined","AglynTypography","ref","spread","hasHtml","Boolean","variantMapping","dangerouslySetInnerHTML","__html"],"mappings":";;;AAAA;;;;;;;;;;;;;;;CAeC,GAED,YAAYA,WAAW,eAAc;AACrC,SACEC,eAAe,EACfC,gBAAgB,EAChBC,gBAAgB,EAChBC,gBAAgB,EAChBC,gBAAgB,EAChBC,gBAAgB,EAChBC,gBAAgB,EAChBC,aAAa,QACR,yBAAwB;AAC/B,OAAOC,gBAA0C,2BAA0B;AAC3E,SAASC,UAAU,QAAQ,Q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S,YAAYwB,QAAQxB;IACpD,kEAAkE;IAClE,yEAAyE;IACzE,sEAAsE;IACtE,sEAAsE;IACtE,sEAAsE;IACtE,yEAAyE;IACzE,yEAAyE;IACzE,iEAAiE;IACjE,MAAMe,YAAYQ,UAAUxB,uBAAuBC,QAAkB;IACrE,IAAIe,cAAc,MAAM;QACtB,uEAAuE;QACvE,uEAAuE;QACvE,MAAMhC,YAAY+B,mBAAmBC,WAAWC;QAChD,qBACE,KAAC9D;YACCmE,KAAKA;YACLI,gBAAgBvB;WACZc,MACCjC,YAAY;YAAEA;QAAU,IAAI,CAAC;YAClC2C,yBAAyB;gBAAEC,QAAQZ;YAAU;;IAGnD;IACA,qBACE,KAAC7D;QAAWmE,KAAKA;QAAKI,gBAAgBvB;OAAqBc;kBACxDlB;;AAGP;AAEA,eAAesB,gBAAe"}
|
|
1
|
+
{"version":3,"sources":["../../../../../../../libs/plugins/mui/src/lib/components/typography.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 {\n mdiAlphabetical,\n mdiFormatHeader1,\n mdiFormatHeader2,\n mdiFormatHeader3,\n mdiFormatHeader4,\n mdiFormatHeader5,\n mdiFormatHeader6,\n mdiFormatText,\n} from '@aglyn/shared-data-mdi'\nimport Typography, { type TypographyProps } from '@mui/material/Typography'\nimport { forwardRef } from 'react'\nimport { BUNDLE_ID } from '../constants/bundle-common'\nimport { FIELD_TEXT_CONTENT } from '../constants/field-presets'\nimport { dropClearedProps } from '../utils/drop-cleared-props'\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 = 'muiTypography'\n// The brand's own rungs sit alongside MUI's. They were added to the theme\n// (AGL-1308 for the body scale, for the display rung) but never to\n// this list, so the only way to reach one was to hand-write its pixels into\n// the Styles panel — which is the very thing the tokens exist to stop.\n// Display first: the list reads largest to smallest.\n//\n// Exported because it is the theme's rung list, not this element's: any block\n// that offers a type step has to offer the SAME one, or a rung added to the\n// theme becomes reachable from the Typography element and nowhere else.\nexport const typographyVariants = [\n {\n value: 'displayXl',\n label: 'Display XL',\n icon: { path: mdiFormatHeader1.path },\n },\n { value: 'h1', label: 'Heading 1', icon: { path: mdiFormatHeader1.path } },\n { value: 'h2', label: 'Heading 2', icon: { path: mdiFormatHeader2.path } },\n { value: 'h3', label: 'Heading 3', icon: { path: mdiFormatHeader3.path } },\n { value: 'h4', label: 'Heading 4', icon: { path: mdiFormatHeader4.path } },\n { value: 'h5', label: 'Heading 5', icon: { path: mdiFormatHeader5.path } },\n { value: 'h6', label: 'Heading 6', icon: { path: mdiFormatHeader6.path } },\n {\n value: 'subtitle1',\n label: 'Subtitle 1',\n icon: { path: mdiFormatText.path },\n },\n {\n value: 'subtitle2',\n label: 'Subtitle 2',\n icon: { path: mdiFormatText.path },\n },\n { value: 'body1', label: 'Body 1', icon: { path: mdiFormatText.path } },\n { value: 'body2', label: 'Body 2', icon: { path: mdiFormatText.path } },\n { value: 'lede', label: 'Lede', icon: { path: mdiFormatText.path } },\n { value: 'overline', label: 'Overline', icon: { path: mdiFormatText.path } },\n { value: 'caption', label: 'Caption', icon: { path: mdiFormatText.path } },\n {\n value: 'bodyCompact',\n label: 'Body compact',\n icon: { path: mdiFormatText.path },\n },\n { value: 'micro', label: 'Micro', icon: { path: mdiFormatText.path } },\n]\n\nexport const schema: Aglyn.ComponentSchema = {\n $id: ID,\n pluginId: BUNDLE_ID,\n displayName: 'Typography',\n description: \"A block of text in one of the theme's type styles.\",\n category: Aglyn.ComponentCategory.TEXT,\n icon: {\n path: mdiAlphabetical.path,\n sx: { color: '#057822' },\n },\n flags: {\n // Static: may sit in a subtree that keeps its server HTML (AGL-3581).\n lazyHydration: Aglyn.FEATURE_FLAG.ENABLED,\n textEditable: Aglyn.FEATURE_FLAG.ENABLED,\n richTextEditable: Aglyn.FEATURE_FLAG.ENABLED,\n },\n attributes: [\n FIELD_TEXT_CONTENT,\n // FIELD_COLOR,\n {\n name: 'variant',\n description:\n 'Which typography step from the site theme this text uses — h1–h6, ' +\n 'body, subtitle, caption, overline. It sets size, weight and line ' +\n 'height together; it does NOT change the HTML element, which is the ' +\n 'field below.',\n component: Aglyn.FieldComponentType.SELECT,\n label: 'Variant',\n // \"Default\" deleted (AGL-1453): unpersistable, and a second name for\n // `body1`, MUI's own default, already in `typographyVariants`.\n options: [...typographyVariants],\n },\n {\n name: 'component',\n description: 'The html element to use.',\n component: Aglyn.FieldComponentType.SELECT,\n label: 'Component',\n // \"Default\" deleted rather than given a sentinel (AGL-1453), and this\n // is the prop that shows why a sentinel is not always available: MUI\n // derives the element from `variantMapping[variant]`, so \"Default\"\n // resolves to a DIFFERENT tag per variant — `h2` for a Heading 2, `p`\n // for Body 1. No single value on this list expresses that, and picking\n // one would pin the tag and change the document outline. Unset is the\n // only thing that means \"let the variant decide\", and the field's ✕ is\n // how an author says it.\n options: [\n { value: 'h1', label: 'Heading 1' },\n { value: 'h2', label: 'Heading 2' },\n { value: 'h3', label: 'Heading 3' },\n { value: 'h4', label: 'Heading 4' },\n { value: 'h5', label: 'Heading 5' },\n { value: 'h6', label: 'Heading 6' },\n { value: 'p', label: 'Paragraph' },\n { value: 'div', label: 'Div' },\n { value: 'span', label: 'Span' },\n ],\n },\n {\n name: 'align',\n description: 'The text alignment',\n component: Aglyn.FieldComponentType.SELECT,\n label: 'Alignment',\n // \"Default\" deleted (AGL-1453): unpersistable, and a second name for\n // `inherit`, MUI Typography's own default, already on the list.\n options: [\n { value: 'inherit', label: 'Inherit' },\n { value: 'left', label: 'Left' },\n { value: 'center', label: 'Center' },\n { value: 'right', label: 'Right' },\n { value: 'justify', label: 'Justified' },\n ],\n },\n {\n name: 'noWrap',\n description: 'If true, the text will not wrap/fold.',\n component: Aglyn.FieldComponentType.SWITCH,\n label: 'Disable wrapping?',\n },\n {\n name: 'gutterBottom',\n description: 'If true, the text will have a space beneath.',\n component: Aglyn.FieldComponentType.SWITCH,\n label: 'Gutter bottom?',\n },\n ],\n}\n\nexport const presets: Aglyn.PresetSchema[] = [\n ...typographyVariants.map((item): Aglyn.PresetSchema => ({\n $id: generatePresetId(ID, item.value),\n type: Aglyn.NodeType.PRESET,\n displayName: item.label,\n pluginId: BUNDLE_ID,\n description: `Element with ${item.label} styles`,\n category: Aglyn.ComponentCategory.TEXT,\n icon: {\n sx: { color: '#057822' },\n ...item.icon,\n },\n data: {\n $id: null,\n componentId: ID,\n pluginId: BUNDLE_ID,\n props: {\n variant: item.value,\n children: item.label,\n },\n },\n })),\n]\n\n/**\n * Typography that renders rich text (AGL-54): when the node carries an\n * `html` prop it renders as innerHTML; otherwise plain `children`.\n *\n * The `html` prop is re-sanitized on EVERY render (AGL-497). The inline\n * editor sanitizes at commit, but screen node props are written directly via\n * the Firebase client SDK, so a host editor can plant arbitrary `html`\n * (bypassing the editor) that would execute on the public site AND in the\n * besigner canvas on app.aglyn.com.\n *\n * The sanitizer is `Aglyn.sanitizeAuthorHtml` (AGL-1901), which needs no DOM\n * and so runs on the server too — the DOMPurify call this replaced could\n * not, which is why the content used to be deferred to an effect and left\n * every rich-text body out of the server response. The allowlist it enforces\n * is a subset of the old DOMPurify config's, pinned pair by pair in\n * `rich-text-hydration.spec.tsx`.\n */\nfunction sanitizeTypographyHtml(html: string): string {\n return Aglyn.sanitizeAuthorHtml(html)\n}\n\n/**\n * MUI's own `defaultVariantMapping`, plus its `span` fallback — the element\n * Typography will actually render for a given variant. Copied rather than\n * imported because MUI does not export it; `author-html-round-trip.spec.tsx`\n * asserts this table still matches what MUI actually renders, so a MUI upgrade that\n * changed the mapping fails there rather than silently reopening the\n * reparenting hazard below.\n */\n/**\n * The element each variant renders as, and the ONE place that decides\n *.\n *\n * MUI's own `variantMapping` sends `subtitle1` and `subtitle2` to `<h6>`.\n * That is a typographic choice made in a component library, and on a page\n * builder it is a document-outline decision made by somebody who has never\n * seen the page: a subtitle is a label, not a section, and every one on every\n * Aglyn site was silently inserting an `<h6>` into the heading order. It is\n * what Lighthouse's `heading-order` was reporting — a \"Open source &\n * self-hostable\" card label rendering ahead of the page's own `<h1>`, from a\n * node whose author had selected Subtitle 1 and nothing else.\n *\n * Subtitles render as `<p>` here. An author who wants a heading still says so\n * with the Component field, which is the control for exactly that question\n * and is unchanged.\n *\n * Passed to MUI as `variantMapping` rather than only consulted by\n * `blockSafeComponent`, so the table cannot describe one thing while the\n * element is another.\n */\nconst VARIANT_ELEMENT: Record<string, string> = {\n h1: 'h1', h2: 'h2', h3: 'h3', h4: 'h4', h5: 'h5', h6: 'h6',\n subtitle1: 'p', subtitle2: 'p', body1: 'p', body2: 'p', inherit: 'p',\n}\n\n/**\n * The element the rich-text body is put INSIDE, which may have to be a\n * `<div>` rather than the one the variant implies (AGL-1901).\n *\n * The parser closes a `<p>` on any block start tag, and a heading on any\n * other heading. So a body with an `<h2>` in it, served inside the `<p>` MUI\n * renders for `body1`, arrives at the browser as\n * `<p class=\"MuiTypography-root\"></p><h2>…</h2>` — the container emptied and\n * the body promoted to a sibling. React then hydrates against a DOM that is\n * not the one it described and reports a mismatch: the live React #418 shape\n * on tenant (AGL-1926), which this change must not add to.\n *\n * This never mattered before because the server `<p>` was EMPTY and the body\n * arrived through an `innerHTML` assignment, which parses in the CONTEXT of\n * the `<p>` and so does not reparent. Serving the body is what makes the\n * container's element type load-bearing.\n *\n * `authorHtmlBreaksContainer` holds the rule, next to the table of tags it\n * depends on. Returns `'div'` to override, or `undefined` to leave MUI's\n * choice alone; the decision is a pure function of props, so the server and\n * the client make it identically.\n */\nfunction blockSafeComponent(\n sanitized: string,\n rest: TypographyProps,\n): 'div' | undefined {\n const element =\n (rest.component as string | undefined) ??\n // MUI's own default variant is `body1`, which maps to `p` — the case that\n // matters, since a Typography with no variant set is the shape nearly\n // every rich-text node has. (`paragraph` is gone in MUI v7, so the\n // variant mapping is the only other input.)\n VARIANT_ELEMENT[(rest.variant as string) ?? 'body1'] ??\n 'span'\n return Aglyn.authorHtmlBreaksContainer(sanitized, element) ? 'div' : undefined\n}\n\nconst AglynTypography = forwardRef<\n HTMLElement,\n TypographyProps & { html?: string }\n>(function AglynTypography(props, ref) {\n const { html, children, ...spread } = props\n // A cleared `align` persists as null and MUI capitalizes it — an SSR throw\n // that 500s the page (AGL-1226, same shape as the button colour).\n const rest = dropClearedProps(spread)\n const hasHtml = typeof html === 'string' && Boolean(html)\n // Sanitized DURING render, on the server and in the browser alike\n // (AGL-1901). The effect this replaced existed because DOMPurify needs a\n // DOM: the server rendered nothing, so the first client render had to\n // render nothing too or hydration would mismatch (AGL-1268) — the two\n // sides agreed only by both being empty, and the body never reached a\n // crawler. `sanitizeAuthorHtml` is a pure function of the string with no\n // DOM dependency, so both sides now compute the same bytes from the same\n // prop and agree on the CONTENT instead of on the absence of it.\n const sanitized = hasHtml ? sanitizeTypographyHtml(html as string) : null\n if (sanitized !== null) {\n // A `<p>` cannot hold the block content a rich-text body may contain —\n // see `blockSafeComponent`. `undefined` leaves MUI's own choice alone.\n const component = blockSafeComponent(sanitized, rest as TypographyProps)\n return (\n <Typography\n ref={ref}\n variantMapping={VARIANT_ELEMENT}\n {...rest}\n {...(component ? { component } : {})}\n dangerouslySetInnerHTML={{ __html: sanitized }}\n />\n )\n }\n return (\n <Typography ref={ref} variantMapping={VARIANT_ELEMENT} {...rest}>\n {children}\n </Typography>\n )\n})\n\nexport default AglynTypography\n"],"names":["Aglyn","mdiAlphabetical","mdiFormatHeader1","mdiFormatHeader2","mdiFormatHeader3","mdiFormatHeader4","mdiFormatHeader5","mdiFormatHeader6","mdiFormatText","Typography","forwardRef","BUNDLE_ID","FIELD_TEXT_CONTENT","dropClearedProps","generatePresetId","ID","typographyVariants","value","label","icon","path","schema","$id","pluginId","displayName","description","category","ComponentCategory","TEXT","sx","color","flags","lazyHydration","FEATURE_FLAG","ENABLED","textEditable","richTextEditable","attributes","name","component","FieldComponentType","SELECT","options","SWITCH","presets","map","item","type","NodeType","PRESET","data","componentId","props","variant","children","sanitizeTypographyHtml","html","sanitizeAuthorHtml","VARIANT_ELEMENT","h1","h2","h3","h4","h5","h6","subtitle1","subtitle2","body1","body2","inherit","blockSafeComponent","sanitized","rest","element","authorHtmlBreaksContainer","undefined","AglynTypography","ref","spread","hasHtml","Boolean","variantMapping","dangerouslySetInnerHTML","__html"],"mappings":";;;AAAA;;;;;;;;;;;;;;;CAeC,GAED,YAAYA,WAAW,eAAc;AACrC,SACEC,eAAe,EACfC,gBAAgB,EAChBC,gBAAgB,EAChBC,gBAAgB,EAChBC,gBAAgB,EAChBC,gBAAgB,EAChBC,gBAAgB,EAChBC,aAAa,QACR,yBAAwB;AAC/B,OAAOC,gBAA0C,2BAA0B;AAC3E,SAASC,UAAU,QAAQ,QAAO;AAClC,SAASC,SAAS,QAAQ,gCAA4B;AACtD,SAASC,kBAAkB,QAAQ,gCAA4B;AAC/D,SAASC,gBAAgB,QAAQ,iCAA6B;AAC9D,SAASC,gBAAgB,QAAQ,iCAA6B;AAE9D,wEAAwE;AACxE,OAAO,MAAMC,KAAwB,gBAAe;AACpD,0EAA0E;AAC1E,mEAAmE;AACnE,4EAA4E;AAC5E,uEAAuE;AACvE,qDAAqD;AACrD,EAAE;AACF,8EAA8E;AAC9E,4EAA4E;AAC5E,wEAAwE;AACxE,OAAO,MAAMC,qBAAqB;IAChC;QACEC,OAAO;QACPC,OAAO;QACPC,MAAM;YAAEC,MAAMlB,iBAAiBkB,IAAI;QAAC;IACtC;IACA;QAAEH,OAAO;QAAMC,OAAO;QAAaC,MAAM;YAAEC,MAAMlB,iBAAiBkB,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