@aglyn/plugins-mui 1.0.0-beta.143
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/LICENSE +201 -0
- package/README.md +22 -0
- package/package.json +47 -0
- package/src/index.d.ts +21 -0
- package/src/index.js +22 -0
- package/src/index.js.map +1 -0
- package/src/lib/components/accordion.d.ts +96 -0
- package/src/lib/components/accordion.js +392 -0
- package/src/lib/components/accordion.js.map +1 -0
- package/src/lib/components/app-bar.d.ts +32 -0
- package/src/lib/components/app-bar.js +86 -0
- package/src/lib/components/app-bar.js.map +1 -0
- package/src/lib/components/blocks.d.ts +46 -0
- package/src/lib/components/blocks.js +1007 -0
- package/src/lib/components/blocks.js.map +1 -0
- package/src/lib/components/box.d.ts +47 -0
- package/src/lib/components/box.js +125 -0
- package/src/lib/components/box.js.map +1 -0
- package/src/lib/components/breadcrumbs.d.ts +44 -0
- package/src/lib/components/breadcrumbs.js +172 -0
- package/src/lib/components/breadcrumbs.js.map +1 -0
- package/src/lib/components/button.d.ts +89 -0
- package/src/lib/components/button.js +272 -0
- package/src/lib/components/button.js.map +1 -0
- package/src/lib/components/card.d.ts +61 -0
- package/src/lib/components/card.js +336 -0
- package/src/lib/components/card.js.map +1 -0
- package/src/lib/components/collection.d.ts +514 -0
- package/src/lib/components/collection.js +2999 -0
- package/src/lib/components/collection.js.map +1 -0
- package/src/lib/components/container.d.ts +42 -0
- package/src/lib/components/container.js +169 -0
- package/src/lib/components/container.js.map +1 -0
- package/src/lib/components/custom-html.d.ts +78 -0
- package/src/lib/components/custom-html.js +219 -0
- package/src/lib/components/custom-html.js.map +1 -0
- package/src/lib/components/data-table.d.ts +57 -0
- package/src/lib/components/data-table.js +216 -0
- package/src/lib/components/data-table.js.map +1 -0
- package/src/lib/components/document-root.d.ts +77 -0
- package/src/lib/components/document-root.js +118 -0
- package/src/lib/components/document-root.js.map +1 -0
- package/src/lib/components/drawer.d.ts +93 -0
- package/src/lib/components/drawer.js +566 -0
- package/src/lib/components/drawer.js.map +1 -0
- package/src/lib/components/function-controls.d.ts +66 -0
- package/src/lib/components/function-controls.js +207 -0
- package/src/lib/components/function-controls.js.map +1 -0
- package/src/lib/components/function-scope.d.ts +110 -0
- package/src/lib/components/function-scope.js +478 -0
- package/src/lib/components/function-scope.js.map +1 -0
- package/src/lib/components/function-widget.d.ts +75 -0
- package/src/lib/components/function-widget.js +307 -0
- package/src/lib/components/function-widget.js.map +1 -0
- package/src/lib/components/grid.d.ts +91 -0
- package/src/lib/components/grid.js +322 -0
- package/src/lib/components/grid.js.map +1 -0
- package/src/lib/components/icon.d.ts +54 -0
- package/src/lib/components/icon.js +163 -0
- package/src/lib/components/icon.js.map +1 -0
- package/src/lib/components/image-list.d.ts +58 -0
- package/src/lib/components/image-list.js +336 -0
- package/src/lib/components/image-list.js.map +1 -0
- package/src/lib/components/image.d.ts +154 -0
- package/src/lib/components/image.js +451 -0
- package/src/lib/components/image.js.map +1 -0
- package/src/lib/components/inline-text.d.ts +74 -0
- package/src/lib/components/inline-text.js +407 -0
- package/src/lib/components/inline-text.js.map +1 -0
- package/src/lib/components/language-switcher.d.ts +35 -0
- package/src/lib/components/language-switcher.js +179 -0
- package/src/lib/components/language-switcher.js.map +1 -0
- package/src/lib/components/layout-slot.d.ts +68 -0
- package/src/lib/components/layout-slot.js +192 -0
- package/src/lib/components/layout-slot.js.map +1 -0
- package/src/lib/components/link-box-accessible-name.d.ts +79 -0
- package/src/lib/components/link-box-accessible-name.js +158 -0
- package/src/lib/components/link-box-accessible-name.js.map +1 -0
- package/src/lib/components/link-box.d.ts +66 -0
- package/src/lib/components/link-box.js +212 -0
- package/src/lib/components/link-box.js.map +1 -0
- package/src/lib/components/list-item-text.d.ts +22 -0
- package/src/lib/components/list-item-text.js +86 -0
- package/src/lib/components/list-item-text.js.map +1 -0
- package/src/lib/components/list-item.d.ts +32 -0
- package/src/lib/components/list-item.js +127 -0
- package/src/lib/components/list-item.js.map +1 -0
- package/src/lib/components/list.d.ts +34 -0
- package/src/lib/components/list.js +108 -0
- package/src/lib/components/list.js.map +1 -0
- package/src/lib/components/markdown.d.ts +129 -0
- package/src/lib/components/markdown.js +853 -0
- package/src/lib/components/markdown.js.map +1 -0
- package/src/lib/components/nav-menu.d.ts +68 -0
- package/src/lib/components/nav-menu.js +683 -0
- package/src/lib/components/nav-menu.js.map +1 -0
- package/src/lib/components/pagination.d.ts +59 -0
- package/src/lib/components/pagination.js +243 -0
- package/src/lib/components/pagination.js.map +1 -0
- package/src/lib/components/paper.d.ts +47 -0
- package/src/lib/components/paper.js +202 -0
- package/src/lib/components/paper.js.map +1 -0
- package/src/lib/components/plugin-frame.d.ts +64 -0
- package/src/lib/components/plugin-frame.js +335 -0
- package/src/lib/components/plugin-frame.js.map +1 -0
- package/src/lib/components/plugin.d.ts +95 -0
- package/src/lib/components/plugin.js +304 -0
- package/src/lib/components/plugin.js.map +1 -0
- package/src/lib/components/product.d.ts +40 -0
- package/src/lib/components/product.js +287 -0
- package/src/lib/components/product.js.map +1 -0
- package/src/lib/components/reusable-instance.d.ts +57 -0
- package/src/lib/components/reusable-instance.js +126 -0
- package/src/lib/components/reusable-instance.js.map +1 -0
- package/src/lib/components/screen-link.d.ts +85 -0
- package/src/lib/components/screen-link.js +324 -0
- package/src/lib/components/screen-link.js.map +1 -0
- package/src/lib/components/search-box.d.ts +41 -0
- package/src/lib/components/search-box.js +125 -0
- package/src/lib/components/search-box.js.map +1 -0
- package/src/lib/components/section.d.ts +56 -0
- package/src/lib/components/section.js +132 -0
- package/src/lib/components/section.js.map +1 -0
- package/src/lib/components/stack.d.ts +55 -0
- package/src/lib/components/stack.js +309 -0
- package/src/lib/components/stack.js.map +1 -0
- package/src/lib/components/tabs.d.ts +288 -0
- package/src/lib/components/tabs.js +788 -0
- package/src/lib/components/tabs.js.map +1 -0
- package/src/lib/components/theme-mode-switcher.d.ts +38 -0
- package/src/lib/components/theme-mode-switcher.js +168 -0
- package/src/lib/components/theme-mode-switcher.js.map +1 -0
- package/src/lib/components/toolbar.d.ts +37 -0
- package/src/lib/components/toolbar.js +117 -0
- package/src/lib/components/toolbar.js.map +1 -0
- package/src/lib/components/typography.d.ts +33 -0
- package/src/lib/components/typography.js +433 -0
- package/src/lib/components/typography.js.map +1 -0
- package/src/lib/components/video-lightbox-controls.d.ts +131 -0
- package/src/lib/components/video-lightbox-controls.js +536 -0
- package/src/lib/components/video-lightbox-controls.js.map +1 -0
- package/src/lib/components/video-lightbox.d.ts +60 -0
- package/src/lib/components/video-lightbox.js +247 -0
- package/src/lib/components/video-lightbox.js.map +1 -0
- package/src/lib/components/video-playback-beacon.d.ts +80 -0
- package/src/lib/components/video-playback-beacon.js +128 -0
- package/src/lib/components/video-playback-beacon.js.map +1 -0
- package/src/lib/components/video-player-frame.d.ts +58 -0
- package/src/lib/components/video-player-frame.js +51 -0
- package/src/lib/components/video-player-frame.js.map +1 -0
- package/src/lib/components/video.d.ts +220 -0
- package/src/lib/components/video.js +874 -0
- package/src/lib/components/video.js.map +1 -0
- package/src/lib/constants/bundle-common.d.ts +17 -0
- package/src/lib/constants/bundle-common.js +18 -0
- package/src/lib/constants/bundle-common.js.map +1 -0
- package/src/lib/constants/field-presets.d.ts +93 -0
- package/src/lib/constants/field-presets.js +248 -0
- package/src/lib/constants/field-presets.js.map +1 -0
- package/src/lib/plugin.d.ts +80 -0
- package/src/lib/plugin.js +599 -0
- package/src/lib/plugin.js.map +1 -0
- package/src/lib/utils/author-html-label.d.ts +73 -0
- package/src/lib/utils/author-html-label.js +89 -0
- package/src/lib/utils/author-html-label.js.map +1 -0
- package/src/lib/utils/drop-cleared-props.d.ts +18 -0
- package/src/lib/utils/drop-cleared-props.js +74 -0
- package/src/lib/utils/drop-cleared-props.js.map +1 -0
- package/src/lib/utils/element-picker.d.ts +99 -0
- package/src/lib/utils/element-picker.js +140 -0
- package/src/lib/utils/element-picker.js.map +1 -0
- package/src/lib/utils/generate-preset-id.d.ts +19 -0
- package/src/lib/utils/generate-preset-id.js +25 -0
- package/src/lib/utils/generate-preset-id.js.map +1 -0
- package/src/lib/utils/link-target-props.d.ts +53 -0
- package/src/lib/utils/link-target-props.js +53 -0
- package/src/lib/utils/link-target-props.js.map +1 -0
|
@@ -0,0 +1,392 @@
|
|
|
1
|
+
import { _ as _extends } from "@swc/helpers/_/_extends";
|
|
2
|
+
import { _ as _object_without_properties_loose } from "@swc/helpers/_/_object_without_properties_loose";
|
|
3
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
4
|
+
/**
|
|
5
|
+
* @license
|
|
6
|
+
* Copyright 2026 Aglyn LLC
|
|
7
|
+
*
|
|
8
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
9
|
+
* you may not use this file except in compliance with the License.
|
|
10
|
+
* You may obtain a copy of the License at
|
|
11
|
+
*
|
|
12
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
13
|
+
*
|
|
14
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
15
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
16
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
17
|
+
* See the License for the specific language governing permissions and
|
|
18
|
+
* limitations under the License.
|
|
19
|
+
*/ import * as Aglyn from "@aglyn/aglyn";
|
|
20
|
+
import { mdiChevronDown, mdiUnfoldMoreHorizontal } from "@aglyn/shared-data-mdi";
|
|
21
|
+
import { AppLink, MdiIcon } from "@aglyn/shared-ui-jsx";
|
|
22
|
+
import MuiAccordion from "@mui/material/Accordion";
|
|
23
|
+
import MuiAccordionDetails from "@mui/material/AccordionDetails";
|
|
24
|
+
import MuiAccordionSummary from "@mui/material/AccordionSummary";
|
|
25
|
+
import Box from "@mui/material/Box";
|
|
26
|
+
import Link from "@mui/material/Link";
|
|
27
|
+
import { forwardRef, isValidElement } from "react";
|
|
28
|
+
import { BUNDLE_ID } from "../constants/bundle-common.js";
|
|
29
|
+
import { FIELD_TEXT_CONTENT } from "../constants/field-presets.js";
|
|
30
|
+
import { authorHtmlLabel, withAuthorHtmlLabel } from "../utils/author-html-label.js";
|
|
31
|
+
import { generatePresetId } from "../utils/generate-preset-id.js";
|
|
32
|
+
// Component ids are persisted in screen documents; never rename.
|
|
33
|
+
export const ACCORDION_ID = 'muiAccordion';
|
|
34
|
+
export const ACCORDION_SUMMARY_ID = 'muiAccordionSummary';
|
|
35
|
+
export const ACCORDION_DETAILS_ID = 'muiAccordionDetails';
|
|
36
|
+
/**
|
|
37
|
+
* Expand/collapse panel (https://mui.com/material-ui/react-accordion/).
|
|
38
|
+
*
|
|
39
|
+
* On the besigner canvas it renders **expanded regardless of
|
|
40
|
+
* `defaultExpanded`**: collapsed details are unreachable for selection
|
|
41
|
+
* and styling, which is the same reason the Drawer expands its contents
|
|
42
|
+
* while selected (AGL-571). Preview and the published site both honour
|
|
43
|
+
* the author's setting and toggle normally, so what ships is never in
|
|
44
|
+
* doubt — only the editing surface differs.
|
|
45
|
+
*/ const AccordionElement = /*#__PURE__*/ forwardRef((props, ref)=>{
|
|
46
|
+
const { defaultExpanded, children } = props, rest = _object_without_properties_loose(props, [
|
|
47
|
+
"defaultExpanded",
|
|
48
|
+
"children"
|
|
49
|
+
]);
|
|
50
|
+
const { editorInert } = Aglyn.useScreenLink(undefined);
|
|
51
|
+
if (editorInert) {
|
|
52
|
+
// Controlled-open with no onChange: the canvas is a static surface,
|
|
53
|
+
// clicks there select rather than toggle.
|
|
54
|
+
// MUI types Accordion's children as NonNullable: an accordion with
|
|
55
|
+
// no summary/details is not a renderable shape, and the renderer
|
|
56
|
+
// always supplies the pair.
|
|
57
|
+
return /*#__PURE__*/ _jsx(MuiAccordion, _extends({
|
|
58
|
+
ref: ref,
|
|
59
|
+
expanded: true
|
|
60
|
+
}, rest, {
|
|
61
|
+
children: children
|
|
62
|
+
}));
|
|
63
|
+
}
|
|
64
|
+
return /*#__PURE__*/ _jsx(MuiAccordion, _extends({
|
|
65
|
+
ref: ref,
|
|
66
|
+
defaultExpanded: !!defaultExpanded
|
|
67
|
+
}, rest, {
|
|
68
|
+
children: children
|
|
69
|
+
}));
|
|
70
|
+
});
|
|
71
|
+
AccordionElement.displayName = 'AglynAccordion';
|
|
72
|
+
/** Label and chevron sit on one line; the label takes the slack. */ const SUMMARY_ROW_SX = {
|
|
73
|
+
display: 'flex',
|
|
74
|
+
alignItems: 'center',
|
|
75
|
+
width: '100%'
|
|
76
|
+
};
|
|
77
|
+
/** Matches MuiAccordionSummary's own gutters so the split row lines up. */ const SUMMARY_LABEL_SX = {
|
|
78
|
+
flex: 1,
|
|
79
|
+
minWidth: 0,
|
|
80
|
+
px: 2,
|
|
81
|
+
py: 1.5
|
|
82
|
+
};
|
|
83
|
+
/**
|
|
84
|
+
* The toggle keeps only its chevron: the label is a sibling now, so the
|
|
85
|
+
* summary's own content slot would just add empty width.
|
|
86
|
+
*/ const SUMMARY_TOGGLE_SX = {
|
|
87
|
+
flex: '0 0 auto',
|
|
88
|
+
'& .MuiAccordionSummary-content': {
|
|
89
|
+
display: 'none'
|
|
90
|
+
}
|
|
91
|
+
};
|
|
92
|
+
/**
|
|
93
|
+
* The visible text of a React children tree, for naming a control that has no
|
|
94
|
+
* text of its own (AGL-2349).
|
|
95
|
+
*
|
|
96
|
+
* It has to walk, not test: what arrives here is the node renderer's output,
|
|
97
|
+
* which wraps the authored string in an `<AglynText>` element inside an
|
|
98
|
+
* array (`libs/aglyn-node-renderer/src/lib/components/leaf.tsx`), so the string
|
|
99
|
+
* is a grandchild at best and never the value itself. Descends `props.children`
|
|
100
|
+
* rather than reading DOM text, because this runs on the React tree BEFORE
|
|
101
|
+
* anything is in the DOM to read. (It also predates AGL-2011, when
|
|
102
|
+
* `<aglyn-text>` was a shadow host whose `innerText` read back empty — that
|
|
103
|
+
* is no longer true, but walking props is still the right tool here.)
|
|
104
|
+
*/ const childText = (node)=>{
|
|
105
|
+
if (node == null || typeof node === 'boolean') return '';
|
|
106
|
+
if (typeof node === 'string' || typeof node === 'number') return String(node);
|
|
107
|
+
if (Array.isArray(node)) return node.map(childText).join('');
|
|
108
|
+
if (/*#__PURE__*/ isValidElement(node)) {
|
|
109
|
+
var _node_props;
|
|
110
|
+
return childText((_node_props = node.props) == null ? void 0 : _node_props.children);
|
|
111
|
+
}
|
|
112
|
+
return '';
|
|
113
|
+
};
|
|
114
|
+
/**
|
|
115
|
+
* The always-visible header row. Supplies the expand chevron MUI leaves
|
|
116
|
+
* to the caller — without it the control looks like inert text and gives
|
|
117
|
+
* no hint that there is anything to open.
|
|
118
|
+
*
|
|
119
|
+
* ## Why a linked header is a different shape (AGL-1232)
|
|
120
|
+
*
|
|
121
|
+
* `MuiAccordionSummary` renders a `<button>`, and the mobile drawer needs
|
|
122
|
+
* Product/Solutions to reach their jump pages as well as open. An anchor
|
|
123
|
+
* inside that button is invalid nesting — browsers unnest it, and nested
|
|
124
|
+
* interactive content is unusable with a screen reader or a keyboard — so
|
|
125
|
+
* the row cannot both toggle and navigate while it is one control.
|
|
126
|
+
*
|
|
127
|
+
* With a `screenId` set the row therefore splits in two: the label becomes
|
|
128
|
+
* a real anchor, and a chevron-only `MuiAccordionSummary` beside it becomes
|
|
129
|
+
* the toggle. Two siblings, each independently focusable, no nesting. The
|
|
130
|
+
* summary keeps driving the panel through MUI's accordion context, so
|
|
131
|
+
* `aria-expanded` and the transition are unchanged.
|
|
132
|
+
*
|
|
133
|
+
* With no `screenId` — every accordion authored before this — the output is
|
|
134
|
+
* byte-for-byte what it always was: one `MuiAccordionSummary`, whole row
|
|
135
|
+
* toggles.
|
|
136
|
+
*/ export const AccordionSummaryElement = /*#__PURE__*/ forwardRef((props, ref)=>{
|
|
137
|
+
var _authorHtmlLabel;
|
|
138
|
+
const { screenId, html } = props, rest = _object_without_properties_loose(props, [
|
|
139
|
+
"screenId",
|
|
140
|
+
"html"
|
|
141
|
+
]);
|
|
142
|
+
// Resolution is the routing map's job, exactly as Screen Link does it;
|
|
143
|
+
// an unpublished or deleted target yields no href.
|
|
144
|
+
const { href, suppressNavigation } = Aglyn.useScreenLink(screenId);
|
|
145
|
+
if (!screenId) {
|
|
146
|
+
return /*#__PURE__*/ _jsx(MuiAccordionSummary, _extends({
|
|
147
|
+
ref: ref,
|
|
148
|
+
expandIcon: /*#__PURE__*/ _jsx(MdiIcon, {
|
|
149
|
+
path: mdiChevronDown.path
|
|
150
|
+
})
|
|
151
|
+
}, withAuthorHtmlLabel(rest, html)));
|
|
152
|
+
}
|
|
153
|
+
const { children, sx } = rest, rowRest = _object_without_properties_loose(rest, [
|
|
154
|
+
"children",
|
|
155
|
+
"sx"
|
|
156
|
+
]);
|
|
157
|
+
const nodeSx = Array.isArray(sx) ? sx : sx ? [
|
|
158
|
+
sx
|
|
159
|
+
] : [];
|
|
160
|
+
// The chevron button's only content is an icon, so it needs a name of its
|
|
161
|
+
// own — "Product" the link and "Product" the toggle are two controls.
|
|
162
|
+
//
|
|
163
|
+
// This USED to be `typeof children === 'string'`, which is never true in
|
|
164
|
+
// production (AGL-2349). A summary's label is authored through
|
|
165
|
+
// FIELD_TEXT_CONTENT, and the node renderer does not pass that string down as
|
|
166
|
+
// `children` — `Leaf` lifts it out as `textContent` and renders
|
|
167
|
+
// `<Component>{children}<AglynText>{textContent}</…></Component>`,
|
|
168
|
+
// so `children` is always an ARRAY holding an element. The string branch was
|
|
169
|
+
// reachable only from a spec that handed the component a bare string, so
|
|
170
|
+
// every published split summary named its chevron "Toggle section".
|
|
171
|
+
//
|
|
172
|
+
// Read from `children` rather than from the formatted label below, because
|
|
173
|
+
// a formatted one is markup handed to `dangerouslySetInnerHTML` and has no
|
|
174
|
+
// React children to walk. `children` carries the same words either way.
|
|
175
|
+
const label = childText(children).trim();
|
|
176
|
+
const content = (_authorHtmlLabel = authorHtmlLabel(html)) != null ? _authorHtmlLabel : children;
|
|
177
|
+
return /*#__PURE__*/ _jsxs(Box, _extends({
|
|
178
|
+
ref: ref
|
|
179
|
+
}, rowRest, {
|
|
180
|
+
sx: [
|
|
181
|
+
SUMMARY_ROW_SX,
|
|
182
|
+
...nodeSx
|
|
183
|
+
],
|
|
184
|
+
children: [
|
|
185
|
+
href && !suppressNavigation ? /*#__PURE__*/ _jsx(AppLink, {
|
|
186
|
+
href: href,
|
|
187
|
+
underline: "hover",
|
|
188
|
+
sx: SUMMARY_LABEL_SX,
|
|
189
|
+
children: content
|
|
190
|
+
}) : // Unresolved target, or a surface that must not navigate (canvas,
|
|
191
|
+
// preview): same two-part shape, so the editor never shows a row
|
|
192
|
+
// that behaves differently from the one that ships.
|
|
193
|
+
//
|
|
194
|
+
// Same ELEMENT too, not just the same box (AGL-1268). `href` comes
|
|
195
|
+
// from the screens map, which differs between the render that
|
|
196
|
+
// produced an ISR page and the render that hydrates it — a screen
|
|
197
|
+
// published or unpublished in between. Switching `<a>` to `<span>`
|
|
198
|
+
// on that would remount the subtree at hydration; an `<a>` with no
|
|
199
|
+
// href is HTML's placeholder link, so the element is stable and the
|
|
200
|
+
// row is still inert. Link Container settled on this shape first.
|
|
201
|
+
/*#__PURE__*/ _jsx(Link, {
|
|
202
|
+
underline: "none",
|
|
203
|
+
color: "inherit",
|
|
204
|
+
sx: SUMMARY_LABEL_SX,
|
|
205
|
+
children: content
|
|
206
|
+
}),
|
|
207
|
+
/*#__PURE__*/ _jsx(MuiAccordionSummary, {
|
|
208
|
+
"aria-label": label ? `Toggle ${label}` : 'Toggle section',
|
|
209
|
+
expandIcon: /*#__PURE__*/ _jsx(MdiIcon, {
|
|
210
|
+
path: mdiChevronDown.path
|
|
211
|
+
}),
|
|
212
|
+
sx: SUMMARY_TOGGLE_SX
|
|
213
|
+
})
|
|
214
|
+
]
|
|
215
|
+
}));
|
|
216
|
+
});
|
|
217
|
+
AccordionSummaryElement.displayName = 'AglynAccordionSummary';
|
|
218
|
+
export const AccordionDetailsElement = /*#__PURE__*/ forwardRef((props, ref)=>/*#__PURE__*/ _jsx(MuiAccordionDetails, _extends({
|
|
219
|
+
ref: ref
|
|
220
|
+
}, props)));
|
|
221
|
+
AccordionDetailsElement.displayName = 'AglynAccordionDetails';
|
|
222
|
+
export const accordionSchema = {
|
|
223
|
+
$id: ACCORDION_ID,
|
|
224
|
+
pluginId: BUNDLE_ID,
|
|
225
|
+
displayName: 'Accordion',
|
|
226
|
+
description: 'Header that expands to reveal its details — FAQs, long forms, ' + 'anything progressive.',
|
|
227
|
+
category: Aglyn.ComponentCategory.SURFACE,
|
|
228
|
+
icon: {
|
|
229
|
+
path: mdiUnfoldMoreHorizontal.path,
|
|
230
|
+
sx: {
|
|
231
|
+
color: '#2196f3'
|
|
232
|
+
}
|
|
233
|
+
},
|
|
234
|
+
// Structure is fixed by MUI: summary first, details second.
|
|
235
|
+
restrictChildren: [
|
|
236
|
+
Aglyn.LinealDirectiveFlag.LIMIT_TO,
|
|
237
|
+
{
|
|
238
|
+
components: [
|
|
239
|
+
ACCORDION_SUMMARY_ID,
|
|
240
|
+
ACCORDION_DETAILS_ID
|
|
241
|
+
]
|
|
242
|
+
}
|
|
243
|
+
],
|
|
244
|
+
// …and it reads that structure BY INDEX, so the renderer has to hand it one
|
|
245
|
+
// React child per node child (AGL-1237). Without this the summary swallowed
|
|
246
|
+
// the details and every accordion on every published site expanded to reveal
|
|
247
|
+
// an empty panel, with its content rendering unconditionally inside the
|
|
248
|
+
// summary's heading.
|
|
249
|
+
flags: {
|
|
250
|
+
positionalChildren: Aglyn.FEATURE_FLAG.ENABLED
|
|
251
|
+
},
|
|
252
|
+
attributes: [
|
|
253
|
+
{
|
|
254
|
+
name: 'defaultExpanded',
|
|
255
|
+
label: 'Start expanded?',
|
|
256
|
+
description: 'If true, the panel is already open when a visitor arrives. The ' + 'canvas always shows it open so you can edit inside it.',
|
|
257
|
+
component: Aglyn.FieldComponentType.SWITCH
|
|
258
|
+
},
|
|
259
|
+
{
|
|
260
|
+
name: 'disableGutters',
|
|
261
|
+
label: 'Disable gutters?',
|
|
262
|
+
description: 'If true, the panel keeps its height when expanded instead of ' + 'gaining extra margin — the tighter look for a stacked FAQ.',
|
|
263
|
+
component: Aglyn.FieldComponentType.SWITCH
|
|
264
|
+
},
|
|
265
|
+
{
|
|
266
|
+
name: 'disabled',
|
|
267
|
+
label: 'Disabled?',
|
|
268
|
+
description: 'If true, visitors cannot expand the panel.',
|
|
269
|
+
component: Aglyn.FieldComponentType.SWITCH
|
|
270
|
+
}
|
|
271
|
+
]
|
|
272
|
+
};
|
|
273
|
+
export const accordionSummarySchema = {
|
|
274
|
+
$id: ACCORDION_SUMMARY_ID,
|
|
275
|
+
pluginId: BUNDLE_ID,
|
|
276
|
+
displayName: 'Accordion Summary',
|
|
277
|
+
description: 'The clickable header row of an accordion.',
|
|
278
|
+
category: Aglyn.ComponentCategory.SURFACE,
|
|
279
|
+
icon: {
|
|
280
|
+
path: mdiUnfoldMoreHorizontal.path,
|
|
281
|
+
sx: {
|
|
282
|
+
color: '#2196f3'
|
|
283
|
+
}
|
|
284
|
+
},
|
|
285
|
+
flags: {
|
|
286
|
+
textEditable: Aglyn.FEATURE_FLAG.ENABLED,
|
|
287
|
+
richTextEditable: Aglyn.FEATURE_FLAG.ENABLED
|
|
288
|
+
},
|
|
289
|
+
// Emphasis only (AGL-2557). The row is a `<button>`, and a list or a link
|
|
290
|
+
// inside one is invalid markup the parser unnests and a control a keyboard
|
|
291
|
+
// cannot reach — the same constraint that made a LINKED header two sibling
|
|
292
|
+
// controls rather than an anchor inside the toggle (AGL-1232).
|
|
293
|
+
richTextCommands: [
|
|
294
|
+
Aglyn.RICH_TEXT_COMMANDS.EMPHASIS
|
|
295
|
+
],
|
|
296
|
+
attributes: [
|
|
297
|
+
FIELD_TEXT_CONTENT,
|
|
298
|
+
{
|
|
299
|
+
name: 'screenId',
|
|
300
|
+
label: 'Header links to',
|
|
301
|
+
description: 'Optional. Give the header a destination and the row splits: the ' + 'text becomes a link to that screen and the chevron beside it ' + 'opens the panel. That is the only way a header can do both — a ' + 'link inside the toggle button is invalid and unreachable by ' + 'keyboard. Leave it empty and the whole row toggles, as before.',
|
|
302
|
+
component: Aglyn.FieldComponentType.SCREEN_SELECT
|
|
303
|
+
}
|
|
304
|
+
]
|
|
305
|
+
};
|
|
306
|
+
export const accordionDetailsSchema = {
|
|
307
|
+
$id: ACCORDION_DETAILS_ID,
|
|
308
|
+
pluginId: BUNDLE_ID,
|
|
309
|
+
displayName: 'Accordion Details',
|
|
310
|
+
description: 'The region an accordion reveals when expanded.',
|
|
311
|
+
category: Aglyn.ComponentCategory.SURFACE,
|
|
312
|
+
icon: {
|
|
313
|
+
path: mdiUnfoldMoreHorizontal.path,
|
|
314
|
+
sx: {
|
|
315
|
+
color: '#2196f3'
|
|
316
|
+
}
|
|
317
|
+
}
|
|
318
|
+
};
|
|
319
|
+
const panel = (summary, body)=>({
|
|
320
|
+
$id: null,
|
|
321
|
+
componentId: ACCORDION_ID,
|
|
322
|
+
pluginId: BUNDLE_ID,
|
|
323
|
+
props: {},
|
|
324
|
+
nodes: [
|
|
325
|
+
{
|
|
326
|
+
$id: null,
|
|
327
|
+
componentId: ACCORDION_SUMMARY_ID,
|
|
328
|
+
pluginId: BUNDLE_ID,
|
|
329
|
+
props: {
|
|
330
|
+
children: summary
|
|
331
|
+
}
|
|
332
|
+
},
|
|
333
|
+
{
|
|
334
|
+
$id: null,
|
|
335
|
+
componentId: ACCORDION_DETAILS_ID,
|
|
336
|
+
pluginId: BUNDLE_ID,
|
|
337
|
+
nodes: [
|
|
338
|
+
{
|
|
339
|
+
$id: null,
|
|
340
|
+
componentId: 'muiTypography',
|
|
341
|
+
pluginId: BUNDLE_ID,
|
|
342
|
+
props: {
|
|
343
|
+
variant: 'body2',
|
|
344
|
+
children: body
|
|
345
|
+
}
|
|
346
|
+
}
|
|
347
|
+
]
|
|
348
|
+
}
|
|
349
|
+
]
|
|
350
|
+
});
|
|
351
|
+
export const accordionPresets = [
|
|
352
|
+
{
|
|
353
|
+
$id: generatePresetId(ACCORDION_ID),
|
|
354
|
+
type: Aglyn.NodeType.PRESET,
|
|
355
|
+
displayName: 'Accordion',
|
|
356
|
+
pluginId: BUNDLE_ID,
|
|
357
|
+
description: 'One expandable panel with a header and body text',
|
|
358
|
+
category: Aglyn.ComponentCategory.SURFACE,
|
|
359
|
+
icon: accordionSchema.icon,
|
|
360
|
+
data: panel('Accordion header', 'The details revealed when expanded.')
|
|
361
|
+
},
|
|
362
|
+
{
|
|
363
|
+
$id: generatePresetId(ACCORDION_ID, 'faq'),
|
|
364
|
+
type: Aglyn.NodeType.PRESET,
|
|
365
|
+
displayName: 'FAQ',
|
|
366
|
+
pluginId: BUNDLE_ID,
|
|
367
|
+
description: 'Three stacked question panels, ready to edit',
|
|
368
|
+
category: Aglyn.ComponentCategory.SURFACE,
|
|
369
|
+
icon: {
|
|
370
|
+
path: mdiUnfoldMoreHorizontal.path,
|
|
371
|
+
sx: {
|
|
372
|
+
color: '#1976d2'
|
|
373
|
+
}
|
|
374
|
+
},
|
|
375
|
+
data: {
|
|
376
|
+
$id: null,
|
|
377
|
+
componentId: 'muiStack',
|
|
378
|
+
pluginId: BUNDLE_ID,
|
|
379
|
+
props: {
|
|
380
|
+
direction: 'column'
|
|
381
|
+
},
|
|
382
|
+
nodes: [
|
|
383
|
+
panel('How do I get started?', 'Answer the first question here.'),
|
|
384
|
+
panel('What does it cost?', 'Answer the second question here.'),
|
|
385
|
+
panel('How do I get support?', 'Answer the third question here.')
|
|
386
|
+
]
|
|
387
|
+
}
|
|
388
|
+
}
|
|
389
|
+
];
|
|
390
|
+
export default AccordionElement;
|
|
391
|
+
|
|
392
|
+
//# sourceMappingURL=accordion.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../../../libs/plugins/mui/src/lib/components/accordion.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 { mdiChevronDown, mdiUnfoldMoreHorizontal } from '@aglyn/shared-data-mdi'\nimport { AppLink, MdiIcon } from '@aglyn/shared-ui-jsx'\nimport MuiAccordion from '@mui/material/Accordion'\nimport MuiAccordionDetails from '@mui/material/AccordionDetails'\nimport MuiAccordionSummary from '@mui/material/AccordionSummary'\nimport Box from '@mui/material/Box'\nimport Link from '@mui/material/Link'\nimport type { SxProps } from '@mui/material/styles'\nimport { forwardRef, isValidElement, type ReactNode } from 'react'\nimport { BUNDLE_ID } from '../constants/bundle-common'\nimport { FIELD_TEXT_CONTENT } from '../constants/field-presets'\nimport {\n authorHtmlLabel,\n withAuthorHtmlLabel,\n} from '../utils/author-html-label'\nimport { generatePresetId } from '../utils/generate-preset-id'\n\n// Component ids are persisted in screen documents; never rename.\nexport const ACCORDION_ID: Aglyn.ComponentId = 'muiAccordion'\nexport const ACCORDION_SUMMARY_ID: Aglyn.ComponentId = 'muiAccordionSummary'\nexport const ACCORDION_DETAILS_ID: Aglyn.ComponentId = 'muiAccordionDetails'\n\nexport interface AccordionElementProps {\n /** Starts open on the published site. */\n defaultExpanded?: boolean\n disabled?: boolean\n /** Removes the extra margin an expanded accordion normally gains. */\n disableGutters?: boolean\n children?: ReactNode\n}\n\n/**\n * Expand/collapse panel (https://mui.com/material-ui/react-accordion/).\n *\n * On the besigner canvas it renders **expanded regardless of\n * `defaultExpanded`**: collapsed details are unreachable for selection\n * and styling, which is the same reason the Drawer expands its contents\n * while selected (AGL-571). Preview and the published site both honour\n * the author's setting and toggle normally, so what ships is never in\n * doubt — only the editing surface differs.\n */\nconst AccordionElement = forwardRef<HTMLDivElement, AccordionElementProps>(\n (props, ref) => {\n const { defaultExpanded, children, ...rest } = props\n const { editorInert } = Aglyn.useScreenLink(undefined)\n if (editorInert) {\n // Controlled-open with no onChange: the canvas is a static surface,\n // clicks there select rather than toggle.\n // MUI types Accordion's children as NonNullable: an accordion with\n // no summary/details is not a renderable shape, and the renderer\n // always supplies the pair.\n return (\n <MuiAccordion\n ref={ref}\n expanded\n {...rest}\n children={children as NonNullable<ReactNode>}\n />\n )\n }\n return (\n <MuiAccordion\n ref={ref}\n defaultExpanded={!!defaultExpanded}\n {...rest}\n children={children as NonNullable<ReactNode>}\n />\n )\n },\n)\nAccordionElement.displayName = 'AglynAccordion'\n\nexport interface AccordionSummaryElementProps {\n /**\n * Optional screen the header's label links to (AGL-1232). Setting it\n * SPLITS the row — see {@link AccordionSummaryElement}. A screen id, never\n * a path: the href is resolved from the host routing map at render time,\n * so a slug rename or re-parent cannot break it, and a bare `href` would\n * full-reload the site instead of routing.\n */\n screenId?: string\n /**\n * Authored node styles, handed over by the renderer rather than typed\n * into an attribute — recomposed below so the Styles panel's values are\n * merged rather than replaced (AGL-1240/1284).\n */\n sx?: SxProps\n /**\n * Sanitized emphasis markup for the label, written by the inline editor's\n * rich mode (AGL-2557). `children` keeps the plain-text reading of it, and\n * is what every surface that cannot render markup falls back to.\n */\n html?: string\n children?: ReactNode\n}\n\n/** Label and chevron sit on one line; the label takes the slack. */\nconst SUMMARY_ROW_SX = {\n display: 'flex',\n alignItems: 'center',\n width: '100%',\n} as const\n\n/** Matches MuiAccordionSummary's own gutters so the split row lines up. */\nconst SUMMARY_LABEL_SX = {\n flex: 1,\n minWidth: 0,\n px: 2,\n py: 1.5,\n} as const\n\n/**\n * The toggle keeps only its chevron: the label is a sibling now, so the\n * summary's own content slot would just add empty width.\n */\nconst SUMMARY_TOGGLE_SX = {\n flex: '0 0 auto',\n '& .MuiAccordionSummary-content': { display: 'none' },\n} as const\n\n/**\n * The visible text of a React children tree, for naming a control that has no\n * text of its own (AGL-2349).\n *\n * It has to walk, not test: what arrives here is the node renderer's output,\n * which wraps the authored string in an `<AglynText>` element inside an\n * array (`libs/aglyn-node-renderer/src/lib/components/leaf.tsx`), so the string\n * is a grandchild at best and never the value itself. Descends `props.children`\n * rather than reading DOM text, because this runs on the React tree BEFORE\n * anything is in the DOM to read. (It also predates AGL-2011, when\n * `<aglyn-text>` was a shadow host whose `innerText` read back empty — that\n * is no longer true, but walking props is still the right tool here.)\n */\nconst childText = (node: ReactNode): string => {\n if (node == null || typeof node === 'boolean') return ''\n if (typeof node === 'string' || typeof node === 'number') return String(node)\n if (Array.isArray(node)) return node.map(childText).join('')\n if (isValidElement(node)) {\n return childText((node.props as { children?: ReactNode })?.children)\n }\n return ''\n}\n\n/**\n * The always-visible header row. Supplies the expand chevron MUI leaves\n * to the caller — without it the control looks like inert text and gives\n * no hint that there is anything to open.\n *\n * ## Why a linked header is a different shape (AGL-1232)\n *\n * `MuiAccordionSummary` renders a `<button>`, and the mobile drawer needs\n * Product/Solutions to reach their jump pages as well as open. An anchor\n * inside that button is invalid nesting — browsers unnest it, and nested\n * interactive content is unusable with a screen reader or a keyboard — so\n * the row cannot both toggle and navigate while it is one control.\n *\n * With a `screenId` set the row therefore splits in two: the label becomes\n * a real anchor, and a chevron-only `MuiAccordionSummary` beside it becomes\n * the toggle. Two siblings, each independently focusable, no nesting. The\n * summary keeps driving the panel through MUI's accordion context, so\n * `aria-expanded` and the transition are unchanged.\n *\n * With no `screenId` — every accordion authored before this — the output is\n * byte-for-byte what it always was: one `MuiAccordionSummary`, whole row\n * toggles.\n */\nexport const AccordionSummaryElement = forwardRef<\n HTMLDivElement,\n AccordionSummaryElementProps\n>((props, ref) => {\n const { screenId, html, ...rest } = props\n // Resolution is the routing map's job, exactly as Screen Link does it;\n // an unpublished or deleted target yields no href.\n const { href, suppressNavigation } = Aglyn.useScreenLink(screenId)\n\n if (!screenId) {\n return (\n <MuiAccordionSummary\n ref={ref}\n expandIcon={<MdiIcon path={mdiChevronDown.path} />}\n {...withAuthorHtmlLabel(rest, html)}\n />\n )\n }\n\n const { children, sx, ...rowRest } = rest\n const nodeSx = Array.isArray(sx) ? sx : sx ? [sx] : []\n // The chevron button's only content is an icon, so it needs a name of its\n // own — \"Product\" the link and \"Product\" the toggle are two controls.\n //\n // This USED to be `typeof children === 'string'`, which is never true in\n // production (AGL-2349). A summary's label is authored through\n // FIELD_TEXT_CONTENT, and the node renderer does not pass that string down as\n // `children` — `Leaf` lifts it out as `textContent` and renders\n // `<Component>{children}<AglynText>{textContent}</…></Component>`,\n // so `children` is always an ARRAY holding an element. The string branch was\n // reachable only from a spec that handed the component a bare string, so\n // every published split summary named its chevron \"Toggle section\".\n //\n // Read from `children` rather than from the formatted label below, because\n // a formatted one is markup handed to `dangerouslySetInnerHTML` and has no\n // React children to walk. `children` carries the same words either way.\n const label = childText(children).trim()\n const content = authorHtmlLabel(html) ?? children\n return (\n <Box ref={ref} {...rowRest} sx={[SUMMARY_ROW_SX, ...nodeSx]}>\n {href && !suppressNavigation ? (\n <AppLink href={href} underline=\"hover\" sx={SUMMARY_LABEL_SX}>\n {content}\n </AppLink>\n ) : (\n // Unresolved target, or a surface that must not navigate (canvas,\n // preview): same two-part shape, so the editor never shows a row\n // that behaves differently from the one that ships.\n //\n // Same ELEMENT too, not just the same box (AGL-1268). `href` comes\n // from the screens map, which differs between the render that\n // produced an ISR page and the render that hydrates it — a screen\n // published or unpublished in between. Switching `<a>` to `<span>`\n // on that would remount the subtree at hydration; an `<a>` with no\n // href is HTML's placeholder link, so the element is stable and the\n // row is still inert. Link Container settled on this shape first.\n <Link underline=\"none\" color=\"inherit\" sx={SUMMARY_LABEL_SX}>\n {content}\n </Link>\n )}\n <MuiAccordionSummary\n aria-label={label ? `Toggle ${label}` : 'Toggle section'}\n expandIcon={<MdiIcon path={mdiChevronDown.path} />}\n sx={SUMMARY_TOGGLE_SX}\n />\n </Box>\n )\n})\nAccordionSummaryElement.displayName = 'AglynAccordionSummary'\n\nexport const AccordionDetailsElement = forwardRef<\n HTMLDivElement,\n { children?: ReactNode }\n>((props, ref) => <MuiAccordionDetails ref={ref} {...props} />)\nAccordionDetailsElement.displayName = 'AglynAccordionDetails'\n\nexport const accordionSchema: Aglyn.ComponentSchema<AccordionElementProps> = {\n $id: ACCORDION_ID,\n pluginId: BUNDLE_ID,\n displayName: 'Accordion',\n description:\n 'Header that expands to reveal its details — FAQs, long forms, ' +\n 'anything progressive.',\n category: Aglyn.ComponentCategory.SURFACE,\n icon: { path: mdiUnfoldMoreHorizontal.path, sx: { color: '#2196f3' } },\n // Structure is fixed by MUI: summary first, details second.\n restrictChildren: [\n Aglyn.LinealDirectiveFlag.LIMIT_TO,\n { components: [ACCORDION_SUMMARY_ID, ACCORDION_DETAILS_ID] },\n ],\n // …and it reads that structure BY INDEX, so the renderer has to hand it one\n // React child per node child (AGL-1237). Without this the summary swallowed\n // the details and every accordion on every published site expanded to reveal\n // an empty panel, with its content rendering unconditionally inside the\n // summary's heading.\n flags: { positionalChildren: Aglyn.FEATURE_FLAG.ENABLED },\n attributes: [\n {\n name: 'defaultExpanded',\n label: 'Start expanded?',\n description:\n 'If true, the panel is already open when a visitor arrives. The ' +\n 'canvas always shows it open so you can edit inside it.',\n component: Aglyn.FieldComponentType.SWITCH,\n },\n {\n name: 'disableGutters',\n label: 'Disable gutters?',\n description:\n 'If true, the panel keeps its height when expanded instead of ' +\n 'gaining extra margin — the tighter look for a stacked FAQ.',\n component: Aglyn.FieldComponentType.SWITCH,\n },\n {\n name: 'disabled',\n label: 'Disabled?',\n description: 'If true, visitors cannot expand the panel.',\n component: Aglyn.FieldComponentType.SWITCH,\n },\n ],\n}\n\nexport const accordionSummarySchema: Aglyn.ComponentSchema = {\n $id: ACCORDION_SUMMARY_ID,\n pluginId: BUNDLE_ID,\n displayName: 'Accordion Summary',\n description: 'The clickable header row of an accordion.',\n category: Aglyn.ComponentCategory.SURFACE,\n icon: { path: mdiUnfoldMoreHorizontal.path, sx: { color: '#2196f3' } },\n flags: {\n textEditable: Aglyn.FEATURE_FLAG.ENABLED,\n richTextEditable: Aglyn.FEATURE_FLAG.ENABLED,\n },\n // Emphasis only (AGL-2557). The row is a `<button>`, and a list or a link\n // inside one is invalid markup the parser unnests and a control a keyboard\n // cannot reach — the same constraint that made a LINKED header two sibling\n // controls rather than an anchor inside the toggle (AGL-1232).\n richTextCommands: [Aglyn.RICH_TEXT_COMMANDS.EMPHASIS],\n attributes: [\n FIELD_TEXT_CONTENT,\n {\n name: 'screenId',\n label: 'Header links to',\n description:\n 'Optional. Give the header a destination and the row splits: the ' +\n 'text becomes a link to that screen and the chevron beside it ' +\n 'opens the panel. That is the only way a header can do both — a ' +\n 'link inside the toggle button is invalid and unreachable by ' +\n 'keyboard. Leave it empty and the whole row toggles, as before.',\n component: Aglyn.FieldComponentType.SCREEN_SELECT,\n },\n ],\n}\n\nexport const accordionDetailsSchema: Aglyn.ComponentSchema = {\n $id: ACCORDION_DETAILS_ID,\n pluginId: BUNDLE_ID,\n displayName: 'Accordion Details',\n description: 'The region an accordion reveals when expanded.',\n category: Aglyn.ComponentCategory.SURFACE,\n icon: { path: mdiUnfoldMoreHorizontal.path, sx: { color: '#2196f3' } },\n}\n\nconst panel = (summary: string, body: string) => ({\n $id: null,\n componentId: ACCORDION_ID,\n pluginId: BUNDLE_ID,\n props: {},\n nodes: [\n {\n $id: null,\n componentId: ACCORDION_SUMMARY_ID,\n pluginId: BUNDLE_ID,\n props: { children: summary },\n },\n {\n $id: null,\n componentId: ACCORDION_DETAILS_ID,\n pluginId: BUNDLE_ID,\n nodes: [\n {\n $id: null,\n componentId: 'muiTypography',\n pluginId: BUNDLE_ID,\n props: { variant: 'body2', children: body },\n },\n ],\n },\n ],\n})\n\nexport const accordionPresets: Aglyn.PresetSchema[] = [\n {\n $id: generatePresetId(ACCORDION_ID),\n type: Aglyn.NodeType.PRESET,\n displayName: 'Accordion',\n pluginId: BUNDLE_ID,\n description: 'One expandable panel with a header and body text',\n category: Aglyn.ComponentCategory.SURFACE,\n icon: accordionSchema.icon,\n data: panel('Accordion header', 'The details revealed when expanded.'),\n },\n {\n $id: generatePresetId(ACCORDION_ID, 'faq'),\n type: Aglyn.NodeType.PRESET,\n displayName: 'FAQ',\n pluginId: BUNDLE_ID,\n description: 'Three stacked question panels, ready to edit',\n category: Aglyn.ComponentCategory.SURFACE,\n icon: { path: mdiUnfoldMoreHorizontal.path, sx: { color: '#1976d2' } },\n data: {\n $id: null,\n componentId: 'muiStack',\n pluginId: BUNDLE_ID,\n props: { direction: 'column' },\n nodes: [\n panel('How do I get started?', 'Answer the first question here.'),\n panel('What does it cost?', 'Answer the second question here.'),\n panel('How do I get support?', 'Answer the third question here.'),\n ],\n },\n },\n]\n\nexport default AccordionElement\n"],"names":["Aglyn","mdiChevronDown","mdiUnfoldMoreHorizontal","AppLink","MdiIcon","MuiAccordion","MuiAccordionDetails","MuiAccordionSummary","Box","Link","forwardRef","isValidElement","BUNDLE_ID","FIELD_TEXT_CONTENT","authorHtmlLabel","withAuthorHtmlLabel","generatePresetId","ACCORDION_ID","ACCORDION_SUMMARY_ID","ACCORDION_DETAILS_ID","AccordionElement","props","ref","defaultExpanded","children","rest","editorInert","useScreenLink","undefined","expanded","displayName","SUMMARY_ROW_SX","display","alignItems","width","SUMMARY_LABEL_SX","flex","minWidth","px","py","SUMMARY_TOGGLE_SX","childText","node","String","Array","isArray","map","join","AccordionSummaryElement","screenId","html","href","suppressNavigation","expandIcon","path","sx","rowRest","nodeSx","label","trim","content","underline","color","aria-label","AccordionDetailsElement","accordionSchema","$id","pluginId","description","category","ComponentCategory","SURFACE","icon","restrictChildren","LinealDirectiveFlag","LIMIT_TO","components","flags","positionalChildren","FEATURE_FLAG","ENABLED","attributes","name","component","FieldComponentType","SWITCH","accordionSummarySchema","textEditable","richTextEditable","richTextCommands","RICH_TEXT_COMMANDS","EMPHASIS","SCREEN_SELECT","accordionDetailsSchema","panel","summary","body","componentId","nodes","variant","accordionPresets","type","NodeType","PRESET","data","direction"],"mappings":";;;AAAA;;;;;;;;;;;;;;;CAeC,GAED,YAAYA,WAA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|
|
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 Aglyn from '@aglyn/aglyn';
|
|
18
|
+
import { type AppBarProps } from '@mui/material/AppBar';
|
|
19
|
+
/**
|
|
20
|
+
* MUI's AppBar behind the cleared-prop guard (AGL-1226).
|
|
21
|
+
*
|
|
22
|
+
* It was exported raw, which left BOTH of its authorable attributes exposed:
|
|
23
|
+
* `color` and `position` are each run through MUI's `capitalize`, so clearing
|
|
24
|
+
* either one persists a null that throws during SSR and 500s the page. A
|
|
25
|
+
* wrapper is the only place to intercept it, since the schema's props reach
|
|
26
|
+
* MUI directly. `createElement` rather than JSX keeps this a `.ts` file.
|
|
27
|
+
*/
|
|
28
|
+
declare const AppBar: import("react").ForwardRefExoticComponent<Omit<AppBarProps, "ref"> & import("react").RefAttributes<HTMLElement>>;
|
|
29
|
+
export declare const ID: Aglyn.ComponentId;
|
|
30
|
+
export declare const schema: Aglyn.ComponentSchema<AppBarProps>;
|
|
31
|
+
export declare const presets: Aglyn.PresetSchema[];
|
|
32
|
+
export default AppBar;
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { _ as _extends } from "@swc/helpers/_/_extends";
|
|
2
|
+
/**
|
|
3
|
+
* @license
|
|
4
|
+
* Copyright 2026 Aglyn LLC
|
|
5
|
+
*
|
|
6
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
7
|
+
* you may not use this file except in compliance with the License.
|
|
8
|
+
* You may obtain a copy of the License at
|
|
9
|
+
*
|
|
10
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
11
|
+
*
|
|
12
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
13
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
14
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
15
|
+
* See the License for the specific language governing permissions and
|
|
16
|
+
* limitations under the License.
|
|
17
|
+
*/ import * as Aglyn from "@aglyn/aglyn";
|
|
18
|
+
import { mdiPageLayoutHeader } from "@aglyn/shared-data-mdi";
|
|
19
|
+
import MuiAppBar from "@mui/material/AppBar";
|
|
20
|
+
import { createElement, forwardRef } from "react";
|
|
21
|
+
import { BUNDLE_ID } from "../constants/bundle-common.js";
|
|
22
|
+
import { applySemanticElement, semanticElementAttribute, semanticElementLabelAttribute } from "../utils/element-picker.js";
|
|
23
|
+
import { FIELD_COLOR_ALT1, FIELD_POSITION } from "../constants/field-presets.js";
|
|
24
|
+
import { dropClearedProps } from "../utils/drop-cleared-props.js";
|
|
25
|
+
import { generatePresetId } from "../utils/generate-preset-id.js";
|
|
26
|
+
import { ID as toolbarId } from "./toolbar.js";
|
|
27
|
+
/**
|
|
28
|
+
* MUI's AppBar behind the cleared-prop guard (AGL-1226).
|
|
29
|
+
*
|
|
30
|
+
* It was exported raw, which left BOTH of its authorable attributes exposed:
|
|
31
|
+
* `color` and `position` are each run through MUI's `capitalize`, so clearing
|
|
32
|
+
* either one persists a null that throws during SSR and 500s the page. A
|
|
33
|
+
* wrapper is the only place to intercept it, since the schema's props reach
|
|
34
|
+
* MUI directly. `createElement` rather than JSX keeps this a `.ts` file.
|
|
35
|
+
*/ const AppBar = forwardRef((props, ref)=>createElement(MuiAppBar, _extends({}, applySemanticElement(dropClearedProps(props)), {
|
|
36
|
+
ref
|
|
37
|
+
})));
|
|
38
|
+
AppBar.displayName = 'AglynAppBar';
|
|
39
|
+
// Component ids are persisted in screen documents; keep the legacy ids.
|
|
40
|
+
export const ID = 'muiAppBar';
|
|
41
|
+
export const schema = {
|
|
42
|
+
$id: ID,
|
|
43
|
+
pluginId: BUNDLE_ID,
|
|
44
|
+
displayName: 'App Bar',
|
|
45
|
+
description: 'The bar across the top of the site — put a Toolbar Content inside it.',
|
|
46
|
+
category: Aglyn.ComponentCategory.NAVIGATION,
|
|
47
|
+
icon: {
|
|
48
|
+
path: mdiPageLayoutHeader.path,
|
|
49
|
+
sx: {
|
|
50
|
+
color: '#2196f3'
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
attributes: [
|
|
54
|
+
semanticElementAttribute('this bar'),
|
|
55
|
+
semanticElementLabelAttribute(),
|
|
56
|
+
FIELD_COLOR_ALT1,
|
|
57
|
+
FIELD_POSITION
|
|
58
|
+
]
|
|
59
|
+
};
|
|
60
|
+
export const presets = [
|
|
61
|
+
{
|
|
62
|
+
$id: generatePresetId(ID),
|
|
63
|
+
type: Aglyn.NodeType.PRESET,
|
|
64
|
+
displayName: 'App Bar',
|
|
65
|
+
pluginId: BUNDLE_ID,
|
|
66
|
+
description: 'An app bar preset with the app bar and toolbar content nodes',
|
|
67
|
+
category: Aglyn.ComponentCategory.NAVIGATION,
|
|
68
|
+
icon: schema.icon,
|
|
69
|
+
data: {
|
|
70
|
+
$id: null,
|
|
71
|
+
componentId: ID,
|
|
72
|
+
pluginId: BUNDLE_ID,
|
|
73
|
+
nodes: [
|
|
74
|
+
{
|
|
75
|
+
$id: null,
|
|
76
|
+
componentId: toolbarId,
|
|
77
|
+
pluginId: BUNDLE_ID,
|
|
78
|
+
props: {}
|
|
79
|
+
}
|
|
80
|
+
]
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
];
|
|
84
|
+
export default AppBar;
|
|
85
|
+
|
|
86
|
+
//# sourceMappingURL=app-bar.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../../../libs/plugins/mui/src/lib/components/app-bar.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 { mdiPageLayoutHeader } from '@aglyn/shared-data-mdi'\nimport MuiAppBar, { type AppBarProps } from '@mui/material/AppBar'\nimport { createElement, forwardRef } from 'react'\nimport { BUNDLE_ID } from '../constants/bundle-common'\nimport {\n applySemanticElement,\n semanticElementAttribute,\n semanticElementLabelAttribute,\n} from '../utils/element-picker'\nimport { FIELD_COLOR_ALT1, FIELD_POSITION } from '../constants/field-presets'\nimport { dropClearedProps } from '../utils/drop-cleared-props'\nimport { generatePresetId } from '../utils/generate-preset-id'\nimport { ID as toolbarId } from './toolbar'\n\n/**\n * MUI's AppBar behind the cleared-prop guard (AGL-1226).\n *\n * It was exported raw, which left BOTH of its authorable attributes exposed:\n * `color` and `position` are each run through MUI's `capitalize`, so clearing\n * either one persists a null that throws during SSR and 500s the page. A\n * wrapper is the only place to intercept it, since the schema's props reach\n * MUI directly. `createElement` rather than JSX keeps this a `.ts` file.\n */\nconst AppBar = forwardRef<HTMLElement, AppBarProps>((props, ref) =>\n createElement(MuiAppBar, {\n // Unset leaves MUI's own default, which is `header` — the banner\n // landmark every site's chrome depends on (AGL-2525). A resolver that\n // answered `div` for \"unset\" would have stripped it the moment the\n // picker appeared.\n ...applySemanticElement(dropClearedProps(props) as Record<string, unknown>),\n ref,\n }),\n)\nAppBar.displayName = 'AglynAppBar'\n\n// Component ids are persisted in screen documents; keep the legacy ids.\nexport const ID: Aglyn.ComponentId = 'muiAppBar'\n\nexport const schema: Aglyn.ComponentSchema<AppBarProps> = {\n $id: ID,\n pluginId: BUNDLE_ID,\n displayName: 'App Bar',\n description:\n 'The bar across the top of the site — put a Toolbar Content inside it.',\n category: Aglyn.ComponentCategory.NAVIGATION,\n icon: {\n path: mdiPageLayoutHeader.path,\n sx: { color: '#2196f3' },\n },\n attributes: [\n semanticElementAttribute('this bar'),\n semanticElementLabelAttribute(),\n FIELD_COLOR_ALT1,\n FIELD_POSITION,\n ],\n}\n\nexport const presets: Aglyn.PresetSchema[] = [\n {\n $id: generatePresetId(ID),\n type: Aglyn.NodeType.PRESET,\n displayName: 'App Bar',\n pluginId: BUNDLE_ID,\n description: 'An app bar preset with the app bar and toolbar content nodes',\n category: Aglyn.ComponentCategory.NAVIGATION,\n icon: schema.icon,\n data: {\n $id: null,\n componentId: ID,\n pluginId: BUNDLE_ID,\n nodes: [\n {\n $id: null,\n componentId: toolbarId,\n pluginId: BUNDLE_ID,\n props: {},\n },\n ],\n },\n },\n]\n\nexport default AppBar\n"],"names":["Aglyn","mdiPageLayoutHeader","MuiAppBar","createElement","forwardRef","BUNDLE_ID","applySemanticElement","semanticElementAttribute","semanticElementLabelAttribute","FIELD_COLOR_ALT1","FIELD_POSITION","dropClearedProps","generatePresetId","ID","toolbarId","AppBar","props","ref","displayName","schema","$id","pluginId","description","category","ComponentCategory","NAVIGATION","icon","path","sx","color","attributes","presets","type","NodeType","PRESET","data","componentId","nodes"],"mappings":";AAAA;;;;;;;;;;;;;;;CAeC,GAED,YAAYA,WAAW,eAAc;AACrC,SAASC,mBAAmB,QAAQ,yBAAwB;AAC5D,OAAOC,eAAqC,uBAAsB;AAClE,SAASC,aAAa,EAAEC,UAAU,QAAQ,QAAO;AACjD,SAASC,SAAS,QAAQ,gCAA4B;AACtD,SACEC,oBAAoB,EACpBC,wBAAwB,EACxBC,6BAA6B,QACxB,6BAAyB;AAChC,SAASC,gBAAgB,EAAEC,cAAc,QAAQ,gCAA4B;AAC7E,SAASC,gBAAgB,QAAQ,iCAA6B;AAC9D,SAASC,gBAAgB,QAAQ,iCAA6B;AAC9D,SAASC,MAAMC,SAAS,QAAQ,eAAW;AAE3C;;;;;;;;CAQC,GACD,MAAMC,SAASX,WAAqC,CAACY,OAAOC,MAC1Dd,cAAcD,WAAW,aAKpBI,qBAAqBK,iBAAiBK;QACzCC;;AAGJF,OAAOG,WAAW,GAAG;AAErB,wEAAwE;AACxE,OAAO,MAAML,KAAwB,YAAW;AAEhD,OAAO,MAAMM,SAA6C;IACxDC,KAAKP;IACLQ,UAAUhB;IACVa,aAAa;IACbI,aACE;IACFC,UAAUvB,MAAMwB,iBAAiB,CAACC,UAAU;IAC5CC,MAAM;QACJC,MAAM1B,oBAAoB0B,IAAI;QAC9BC,IAAI;YAAEC,OAAO;QAAU;IACzB;IACAC,YAAY;QACVvB,yBAAyB;QACzBC;QACAC;QACAC;KACD;AACH,EAAC;AAED,OAAO,MAAMqB,UAAgC;IAC3C;QACEX,KAAKR,iBAAiBC;QACtBmB,MAAMhC,MAAMiC,QAAQ,CAACC,MAAM;QAC3BhB,aAAa;QACbG,UAAUhB;QACViB,aAAa;QACbC,UAAUvB,MAAMwB,iBAAiB,CAACC,UAAU;QAC5CC,MAAMP,OAAOO,IAAI;QACjBS,MAAM;YACJf,KAAK;YACLgB,aAAavB;YACbQ,UAAUhB;YACVgC,OAAO;gBACL;oBACEjB,KAAK;oBACLgB,aAAatB;oBACbO,UAAUhB;oBACVW,OAAO,CAAC;gBACV;aACD;QACH;IACF;CACD,CAAA;AAED,eAAeD,OAAM"}
|
|
@@ -0,0 +1,46 @@
|
|
|
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 Aglyn from '@aglyn/aglyn';
|
|
18
|
+
export declare const VIDEO_EMBED_ID: Aglyn.ComponentId;
|
|
19
|
+
export declare const SOCIAL_LINKS_ID: Aglyn.ComponentId;
|
|
20
|
+
export interface VideoEmbedProps {
|
|
21
|
+
/** YouTube or Vimeo video URL. */
|
|
22
|
+
url?: string;
|
|
23
|
+
/** CSS height (default 315px, 16:9-ish with full width). */
|
|
24
|
+
height?: string;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Builds the embed src from a PARSED video id — the raw user URL is never
|
|
28
|
+
* placed in the iframe, so only youtube-nocookie/vimeo player origins can
|
|
29
|
+
* ever load (block-library security posture).
|
|
30
|
+
*/
|
|
31
|
+
export declare function parseVideoEmbedSrc(url: string): string | null;
|
|
32
|
+
declare const VideoEmbed: import("react").ForwardRefExoticComponent<VideoEmbedProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
33
|
+
export declare const videoEmbedSchema: Aglyn.ComponentSchema<VideoEmbedProps>;
|
|
34
|
+
export interface SocialLinksProps {
|
|
35
|
+
twitter?: string;
|
|
36
|
+
instagram?: string;
|
|
37
|
+
facebook?: string;
|
|
38
|
+
linkedin?: string;
|
|
39
|
+
youtube?: string;
|
|
40
|
+
github?: string;
|
|
41
|
+
}
|
|
42
|
+
declare const SocialLinks: import("react").ForwardRefExoticComponent<SocialLinksProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
43
|
+
export declare const socialLinksSchema: Aglyn.ComponentSchema<SocialLinksProps>;
|
|
44
|
+
export declare const blockPresets: Aglyn.PresetSchema[];
|
|
45
|
+
export { SocialLinks, VideoEmbed };
|
|
46
|
+
export default VideoEmbed;
|