@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,322 @@
|
|
|
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 } 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 { mdiViewGrid, mdiViewGridOutline } from "@aglyn/shared-data-mdi";
|
|
21
|
+
// Deep import, NOT the barrel (AGL-1151): `@aglyn/shared-data-enums` re-exports
|
|
22
|
+
// `firebase-auth`, whose `AuthErrorCodes` is a VALUE import of `firebase/auth`.
|
|
23
|
+
// This bundle is `alwaysOn`, so the barrel put the whole Firebase auth client
|
|
24
|
+
// into the chunk every published tenant page loads — a database/identity SDK
|
|
25
|
+
// shipped and evaluated to render static HTML that authenticates nobody. Three
|
|
26
|
+
// breakpoint symbols are the entire reason this module reaches for that
|
|
27
|
+
// library; they live here, one file away from the barrel.
|
|
28
|
+
import { parseBreakpointSpan, SPAN_BREAKPOINTS } from "@aglyn/shared-data-enums/breakpoint-span";
|
|
29
|
+
import MuiGrid from "@mui/material/Grid";
|
|
30
|
+
import { forwardRef } from "react";
|
|
31
|
+
import { applySemanticElement, semanticElementAttribute, semanticElementLabelAttribute } from "../utils/element-picker.js";
|
|
32
|
+
import { BUNDLE_ID } from "../constants/bundle-common.js";
|
|
33
|
+
import { dropClearedProps } from "../utils/drop-cleared-props.js";
|
|
34
|
+
import { generatePresetId } from "../utils/generate-preset-id.js";
|
|
35
|
+
// Component ids are persisted in screen documents; never rename.
|
|
36
|
+
export const ID = 'muiGrid';
|
|
37
|
+
/**
|
|
38
|
+
* Breakpoint keys MUI's responsive `size`/`offset` objects accept.
|
|
39
|
+
*
|
|
40
|
+
* Re-exported from `@aglyn/shared-data-enums` rather than declared twice
|
|
41
|
+
* (AGL-2486): the attributes panel's breakpoint row and this parser have to
|
|
42
|
+
* agree on the list, and two copies is how they stop agreeing.
|
|
43
|
+
*/ export const BREAKPOINTS = SPAN_BREAKPOINTS;
|
|
44
|
+
/**
|
|
45
|
+
* Parses the authored span syntax into what MUI v6+ Grid expects.
|
|
46
|
+
*
|
|
47
|
+
* MUI dropped the `item` prop and the per-breakpoint `xs=`/`md=` props in
|
|
48
|
+
* v6; v9 (installed here) takes a single `size` that is either a value or
|
|
49
|
+
* a `{ xs, md, … }` object. One STORED string covers both, and this parser
|
|
50
|
+
* owns the translation:
|
|
51
|
+
*
|
|
52
|
+
* `6` → 6
|
|
53
|
+
* `auto` → 'auto'
|
|
54
|
+
* `grow` → 'grow'
|
|
55
|
+
* `xs:12 md:6` → { xs: 12, md: 6 }
|
|
56
|
+
*
|
|
57
|
+
* Anything unparseable returns `undefined` rather than a partial object:
|
|
58
|
+
* a half-applied breakpoint map is a layout that silently differs from
|
|
59
|
+
* what the author typed.
|
|
60
|
+
*/ export function parseSpan(value) {
|
|
61
|
+
// The reading itself is `parseBreakpointSpan` in `@aglyn/shared-data-enums`
|
|
62
|
+
// (AGL-2486), shared with the attributes panel's breakpoint row so the
|
|
63
|
+
// editor and the renderer cannot disagree about a stored string. This
|
|
64
|
+
// function keeps its own signature and its "unparseable means unset"
|
|
65
|
+
// contract: `raw` is what the editor hands back untouched, and what MUI
|
|
66
|
+
// must never receive.
|
|
67
|
+
const span = parseBreakpointSpan(value);
|
|
68
|
+
if (span.raw !== undefined) return undefined;
|
|
69
|
+
if (span.base !== undefined) return span.base;
|
|
70
|
+
return span.values && Object.keys(span.values).length ? span.values : undefined;
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Same syntax as `parseSpan`, minus `grow`.
|
|
74
|
+
*
|
|
75
|
+
* MUI's `GridOffset` is `'auto' | number` only — a `grow` offset is not
|
|
76
|
+
* a wider gap, it is a value the layout cannot use, so it is dropped
|
|
77
|
+
* here rather than passed through to be ignored.
|
|
78
|
+
*/ export function parseOffset(value) {
|
|
79
|
+
const parsed = parseSpan(value);
|
|
80
|
+
if (parsed === 'grow') return undefined;
|
|
81
|
+
if (parsed && typeof parsed === 'object') {
|
|
82
|
+
const kept = Object.fromEntries(Object.entries(parsed).filter(([, span])=>span !== 'grow'));
|
|
83
|
+
return Object.keys(kept).length ? kept : undefined;
|
|
84
|
+
}
|
|
85
|
+
return parsed;
|
|
86
|
+
}
|
|
87
|
+
/** Spacing/columns arrive as strings from number fields; MUI wants numbers. */ function toNumber(value) {
|
|
88
|
+
if (value == null || value === '') return undefined;
|
|
89
|
+
const parsed = Number(value);
|
|
90
|
+
return Number.isFinite(parsed) ? parsed : undefined;
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* Responsive 12-column grid (https://mui.com/material-ui/react-grid/).
|
|
94
|
+
* One element covers both roles, matching MUI v6+: switch **Container**
|
|
95
|
+
* on for the row, leave it off and set a **Span** for each cell.
|
|
96
|
+
*/ const GridElement = /*#__PURE__*/ forwardRef((props, ref)=>{
|
|
97
|
+
const { container, size, offset, spacing, rowSpacing, columnSpacing, columns, direction, wrap, children } = props, rest = _object_without_properties_loose(props, [
|
|
98
|
+
"container",
|
|
99
|
+
"size",
|
|
100
|
+
"offset",
|
|
101
|
+
"spacing",
|
|
102
|
+
"rowSpacing",
|
|
103
|
+
"columnSpacing",
|
|
104
|
+
"columns",
|
|
105
|
+
"direction",
|
|
106
|
+
"wrap",
|
|
107
|
+
"children"
|
|
108
|
+
]);
|
|
109
|
+
return /*#__PURE__*/ _jsx(MuiGrid, _extends({
|
|
110
|
+
ref: ref,
|
|
111
|
+
container: !!container,
|
|
112
|
+
size: parseSpan(size),
|
|
113
|
+
offset: parseOffset(offset),
|
|
114
|
+
// Spacing props only apply to containers; MUI ignores them on
|
|
115
|
+
// items, so no need to strip them here.
|
|
116
|
+
spacing: toNumber(spacing),
|
|
117
|
+
rowSpacing: toNumber(rowSpacing),
|
|
118
|
+
columnSpacing: toNumber(columnSpacing),
|
|
119
|
+
columns: toNumber(columns)
|
|
120
|
+
}, dropClearedProps({
|
|
121
|
+
direction,
|
|
122
|
+
wrap
|
|
123
|
+
}), applySemanticElement(dropClearedProps(rest)), {
|
|
124
|
+
children: children
|
|
125
|
+
}));
|
|
126
|
+
});
|
|
127
|
+
GridElement.displayName = 'AglynGrid';
|
|
128
|
+
/** Container-only props: MUI ignores these on an item. */ const CONTAINER_ONLY = {
|
|
129
|
+
when: 'container',
|
|
130
|
+
is: true
|
|
131
|
+
};
|
|
132
|
+
/** Item-only props: a container spans its parent, not a column count. */ const ITEM_ONLY = {
|
|
133
|
+
when: 'container',
|
|
134
|
+
is: true,
|
|
135
|
+
notMatch: true
|
|
136
|
+
};
|
|
137
|
+
const SPAN_HELP = 'How many columns this cell takes. Set **All** for every screen size, or ' + 'give individual breakpoints a value — `xs` applies from the smallest ' + 'screens up and each larger breakpoint overrides it. `auto` fits the ' + 'content, `grow` takes the remaining space.';
|
|
138
|
+
export const schema = {
|
|
139
|
+
$id: ID,
|
|
140
|
+
pluginId: BUNDLE_ID,
|
|
141
|
+
displayName: 'Grid',
|
|
142
|
+
description: 'Responsive 12-column layout. Turn on Container for the row; give ' + 'each cell a Span.',
|
|
143
|
+
category: Aglyn.ComponentCategory.LAYOUT,
|
|
144
|
+
icon: {
|
|
145
|
+
path: mdiViewGrid.path,
|
|
146
|
+
sx: {
|
|
147
|
+
color: '#2196f3'
|
|
148
|
+
}
|
|
149
|
+
},
|
|
150
|
+
attributes: [
|
|
151
|
+
semanticElementAttribute('this grid'),
|
|
152
|
+
semanticElementLabelAttribute(),
|
|
153
|
+
{
|
|
154
|
+
name: 'container',
|
|
155
|
+
label: 'Container?',
|
|
156
|
+
description: 'If true, this grid lays its direct Grid children out in columns. ' + 'Leave it off for a cell inside another grid.',
|
|
157
|
+
component: Aglyn.FieldComponentType.SWITCH
|
|
158
|
+
},
|
|
159
|
+
{
|
|
160
|
+
name: 'size',
|
|
161
|
+
label: 'Span',
|
|
162
|
+
description: SPAN_HELP,
|
|
163
|
+
// A row of breakpoint controls rather than a text box (AGL-2486). The
|
|
164
|
+
// STORED value is the same string it always was; only the way it is
|
|
165
|
+
// authored changed. `xs:12 md:2` was a developer syntax documented
|
|
166
|
+
// nowhere but this tooltip, so the responsive capability was there and
|
|
167
|
+
// effectively unreachable.
|
|
168
|
+
component: Aglyn.FieldComponentType.BREAKPOINT_SPAN,
|
|
169
|
+
condition: ITEM_ONLY
|
|
170
|
+
},
|
|
171
|
+
{
|
|
172
|
+
name: 'offset',
|
|
173
|
+
label: 'Offset',
|
|
174
|
+
description: 'Empty columns before this cell. `auto` pushes the cell to the ' + 'right; `grow` is a span keyword and not an offset, so it is not ' + 'offered here.',
|
|
175
|
+
component: Aglyn.FieldComponentType.BREAKPOINT_SPAN,
|
|
176
|
+
// MUI's GridOffset is `'auto' | number`: a zero offset is a real
|
|
177
|
+
// choice, and `grow` is not one at all.
|
|
178
|
+
allowGrow: false,
|
|
179
|
+
minSpan: 0,
|
|
180
|
+
condition: ITEM_ONLY
|
|
181
|
+
},
|
|
182
|
+
{
|
|
183
|
+
name: 'spacing',
|
|
184
|
+
label: 'Spacing',
|
|
185
|
+
description: 'Gap between cells, in theme spacing units (1 = 8px by default).',
|
|
186
|
+
component: Aglyn.FieldComponentType.TEXT_FIELD,
|
|
187
|
+
type: 'number',
|
|
188
|
+
condition: CONTAINER_ONLY
|
|
189
|
+
},
|
|
190
|
+
{
|
|
191
|
+
name: 'rowSpacing',
|
|
192
|
+
label: 'Row spacing',
|
|
193
|
+
description: 'Vertical gap only; overrides Spacing.',
|
|
194
|
+
component: Aglyn.FieldComponentType.TEXT_FIELD,
|
|
195
|
+
type: 'number',
|
|
196
|
+
condition: CONTAINER_ONLY
|
|
197
|
+
},
|
|
198
|
+
{
|
|
199
|
+
name: 'columnSpacing',
|
|
200
|
+
label: 'Column spacing',
|
|
201
|
+
description: 'Horizontal gap only; overrides Spacing.',
|
|
202
|
+
component: Aglyn.FieldComponentType.TEXT_FIELD,
|
|
203
|
+
type: 'number',
|
|
204
|
+
condition: CONTAINER_ONLY
|
|
205
|
+
},
|
|
206
|
+
{
|
|
207
|
+
name: 'columns',
|
|
208
|
+
label: 'Columns',
|
|
209
|
+
description: 'Total columns the row is divided into. Default 12.',
|
|
210
|
+
component: Aglyn.FieldComponentType.TEXT_FIELD,
|
|
211
|
+
type: 'number',
|
|
212
|
+
condition: CONTAINER_ONLY
|
|
213
|
+
},
|
|
214
|
+
{
|
|
215
|
+
name: 'direction',
|
|
216
|
+
label: 'Direction',
|
|
217
|
+
// The option that is NOT offered is the point of this field. MUI's own
|
|
218
|
+
// API doc: "Only `row` and `row-reverse` are supported. `column` and
|
|
219
|
+
// `column-reverse` are not supported, because the Grid component is
|
|
220
|
+
// designed to subdivide layouts into columns, not rows." Offering them
|
|
221
|
+
// would be a control that silently does nothing.
|
|
222
|
+
description: 'Sets the `flex-direction` for the row. Only Row and Row Reversed ' + 'are supported — Grid divides a layout into columns, so a column ' + 'direction does nothing. Use a Stack for a vertical layout.',
|
|
223
|
+
component: Aglyn.FieldComponentType.SELECT,
|
|
224
|
+
options: [
|
|
225
|
+
{
|
|
226
|
+
value: 'row',
|
|
227
|
+
label: 'Row'
|
|
228
|
+
},
|
|
229
|
+
{
|
|
230
|
+
value: 'row-reverse',
|
|
231
|
+
label: 'Row Reversed'
|
|
232
|
+
}
|
|
233
|
+
],
|
|
234
|
+
condition: CONTAINER_ONLY
|
|
235
|
+
},
|
|
236
|
+
{
|
|
237
|
+
name: 'wrap',
|
|
238
|
+
label: 'Wrap',
|
|
239
|
+
description: 'Whether cells that do not fit move onto a new line. Default Wrap; ' + 'No Wrap keeps every cell on one line and lets them shrink instead.',
|
|
240
|
+
component: Aglyn.FieldComponentType.SELECT,
|
|
241
|
+
options: [
|
|
242
|
+
{
|
|
243
|
+
value: 'wrap',
|
|
244
|
+
label: 'Wrap'
|
|
245
|
+
},
|
|
246
|
+
{
|
|
247
|
+
value: 'nowrap',
|
|
248
|
+
label: 'No Wrap'
|
|
249
|
+
},
|
|
250
|
+
{
|
|
251
|
+
value: 'wrap-reverse',
|
|
252
|
+
label: 'Wrap Reversed'
|
|
253
|
+
}
|
|
254
|
+
],
|
|
255
|
+
condition: CONTAINER_ONLY
|
|
256
|
+
}
|
|
257
|
+
]
|
|
258
|
+
};
|
|
259
|
+
const cell = (size, text)=>({
|
|
260
|
+
$id: null,
|
|
261
|
+
componentId: ID,
|
|
262
|
+
pluginId: BUNDLE_ID,
|
|
263
|
+
props: {
|
|
264
|
+
size
|
|
265
|
+
},
|
|
266
|
+
nodes: [
|
|
267
|
+
{
|
|
268
|
+
$id: null,
|
|
269
|
+
componentId: 'muiTypography',
|
|
270
|
+
pluginId: BUNDLE_ID,
|
|
271
|
+
props: {
|
|
272
|
+
variant: 'body2',
|
|
273
|
+
children: text
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
]
|
|
277
|
+
});
|
|
278
|
+
export const presets = [
|
|
279
|
+
{
|
|
280
|
+
// Ships as a working responsive row, not a bare container: an empty
|
|
281
|
+
// grid renders as nothing at all on the canvas.
|
|
282
|
+
$id: generatePresetId(ID),
|
|
283
|
+
type: Aglyn.NodeType.PRESET,
|
|
284
|
+
displayName: 'Grid',
|
|
285
|
+
pluginId: BUNDLE_ID,
|
|
286
|
+
description: 'Responsive row — three columns that stack on mobile',
|
|
287
|
+
category: Aglyn.ComponentCategory.LAYOUT,
|
|
288
|
+
icon: schema.icon,
|
|
289
|
+
data: {
|
|
290
|
+
$id: null,
|
|
291
|
+
componentId: ID,
|
|
292
|
+
pluginId: BUNDLE_ID,
|
|
293
|
+
props: {
|
|
294
|
+
container: true,
|
|
295
|
+
spacing: 2
|
|
296
|
+
},
|
|
297
|
+
nodes: [
|
|
298
|
+
cell('xs:12 md:4', 'Column one'),
|
|
299
|
+
cell('xs:12 md:4', 'Column two'),
|
|
300
|
+
cell('xs:12 md:4', 'Column three')
|
|
301
|
+
]
|
|
302
|
+
}
|
|
303
|
+
},
|
|
304
|
+
{
|
|
305
|
+
$id: generatePresetId(ID, 'cell'),
|
|
306
|
+
type: Aglyn.NodeType.PRESET,
|
|
307
|
+
displayName: 'Grid Cell',
|
|
308
|
+
pluginId: BUNDLE_ID,
|
|
309
|
+
description: 'A single cell to add to an existing grid row',
|
|
310
|
+
category: Aglyn.ComponentCategory.LAYOUT,
|
|
311
|
+
icon: {
|
|
312
|
+
path: mdiViewGridOutline.path,
|
|
313
|
+
sx: {
|
|
314
|
+
color: '#2196f3'
|
|
315
|
+
}
|
|
316
|
+
},
|
|
317
|
+
data: cell('xs:12 md:6', 'Cell')
|
|
318
|
+
}
|
|
319
|
+
];
|
|
320
|
+
export default GridElement;
|
|
321
|
+
|
|
322
|
+
//# sourceMappingURL=grid.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../../../libs/plugins/mui/src/lib/components/grid.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 { mdiViewGrid, mdiViewGridOutline } from '@aglyn/shared-data-mdi'\n// Deep import, NOT the barrel (AGL-1151): `@aglyn/shared-data-enums` re-exports\n// `firebase-auth`, whose `AuthErrorCodes` is a VALUE import of `firebase/auth`.\n// This bundle is `alwaysOn`, so the barrel put the whole Firebase auth client\n// into the chunk every published tenant page loads — a database/identity SDK\n// shipped and evaluated to render static HTML that authenticates nobody. Three\n// breakpoint symbols are the entire reason this module reaches for that\n// library; they live here, one file away from the barrel.\nimport {\n parseBreakpointSpan,\n SPAN_BREAKPOINTS,\n type SpanBreakpoint,\n} from '@aglyn/shared-data-enums/breakpoint-span'\nimport MuiGrid from '@mui/material/Grid'\nimport { forwardRef, type ReactNode } from 'react'\nimport {\n applySemanticElement,\n semanticElementAttribute,\n semanticElementLabelAttribute,\n} from '../utils/element-picker'\nimport { BUNDLE_ID } from '../constants/bundle-common'\nimport { dropClearedProps } from '../utils/drop-cleared-props'\nimport { generatePresetId } from '../utils/generate-preset-id'\n\n// Component ids are persisted in screen documents; never rename.\nexport const ID: Aglyn.ComponentId = 'muiGrid'\n\n/**\n * Breakpoint keys MUI's responsive `size`/`offset` objects accept.\n *\n * Re-exported from `@aglyn/shared-data-enums` rather than declared twice\n * (AGL-2486): the attributes panel's breakpoint row and this parser have to\n * agree on the list, and two copies is how they stop agreeing.\n */\nexport const BREAKPOINTS = SPAN_BREAKPOINTS\nexport type Breakpoint = SpanBreakpoint\n\nexport interface GridElementProps {\n /** Flex container behavior; items are its direct Grid children. */\n container?: boolean\n /**\n * Column span. Persisted as one string: a bare span (`6`), the keywords\n * `auto`/`grow`, or per-breakpoint pairs (`xs:12 md:6`). Authored through\n * the breakpoint row in the attributes panel (AGL-2486); the stored\n * format is unchanged from when it was a text box.\n */\n size?: string | number\n /** Empty columns before the item; same syntax as `size`, minus `grow`. */\n offset?: string | number\n spacing?: number | string\n rowSpacing?: number | string\n columnSpacing?: number | string\n /** Total columns in the container; MUI's default is 12. */\n columns?: number | string\n /**\n * Container flow. MUI supports `row`/`row-reverse` ONLY — Grid subdivides\n * a layout into columns, and `column`/`column-reverse` are documented as\n * unsupported (use a Stack for a vertical layout).\n */\n direction?: 'row' | 'row-reverse'\n /** `flex-wrap` for the container; MUI's default is `wrap`. */\n wrap?: 'nowrap' | 'wrap' | 'wrap-reverse'\n children?: ReactNode\n}\n\n/**\n * Parses the authored span syntax into what MUI v6+ Grid expects.\n *\n * MUI dropped the `item` prop and the per-breakpoint `xs=`/`md=` props in\n * v6; v9 (installed here) takes a single `size` that is either a value or\n * a `{ xs, md, … }` object. One STORED string covers both, and this parser\n * owns the translation:\n *\n * `6` → 6\n * `auto` → 'auto'\n * `grow` → 'grow'\n * `xs:12 md:6` → { xs: 12, md: 6 }\n *\n * Anything unparseable returns `undefined` rather than a partial object:\n * a half-applied breakpoint map is a layout that silently differs from\n * what the author typed.\n */\nexport function parseSpan(\n value: unknown,\n): number | 'auto' | 'grow' | Record<string, number | 'auto' | 'grow'> | undefined {\n // The reading itself is `parseBreakpointSpan` in `@aglyn/shared-data-enums`\n // (AGL-2486), shared with the attributes panel's breakpoint row so the\n // editor and the renderer cannot disagree about a stored string. This\n // function keeps its own signature and its \"unparseable means unset\"\n // contract: `raw` is what the editor hands back untouched, and what MUI\n // must never receive.\n const span = parseBreakpointSpan(value as string | number)\n if (span.raw !== undefined) return undefined\n if (span.base !== undefined) return span.base\n return span.values && Object.keys(span.values).length\n ? (span.values as Record<string, number | 'auto' | 'grow'>)\n : undefined\n}\n\n/**\n * Same syntax as `parseSpan`, minus `grow`.\n *\n * MUI's `GridOffset` is `'auto' | number` only — a `grow` offset is not\n * a wider gap, it is a value the layout cannot use, so it is dropped\n * here rather than passed through to be ignored.\n */\nexport function parseOffset(value: unknown) {\n const parsed = parseSpan(value)\n if (parsed === 'grow') return undefined\n if (parsed && typeof parsed === 'object') {\n const kept = Object.fromEntries(\n Object.entries(parsed).filter(([, span]) => span !== 'grow'),\n )\n return Object.keys(kept).length\n ? (kept as Record<string, number | 'auto'>)\n : undefined\n }\n return parsed as number | 'auto' | undefined\n}\n\n/** Spacing/columns arrive as strings from number fields; MUI wants numbers. */\nfunction toNumber(value: unknown): number | undefined {\n if (value == null || value === '') return undefined\n const parsed = Number(value)\n return Number.isFinite(parsed) ? parsed : undefined\n}\n\n/**\n * Responsive 12-column grid (https://mui.com/material-ui/react-grid/).\n * One element covers both roles, matching MUI v6+: switch **Container**\n * on for the row, leave it off and set a **Span** for each cell.\n */\nconst GridElement = forwardRef<HTMLDivElement, GridElementProps>(\n (props, ref) => {\n const {\n container,\n size,\n offset,\n spacing,\n rowSpacing,\n columnSpacing,\n columns,\n direction,\n wrap,\n children,\n ...rest\n } = props\n return (\n <MuiGrid\n ref={ref}\n container={!!container}\n size={parseSpan(size)}\n offset={parseOffset(offset)}\n // Spacing props only apply to containers; MUI ignores them on\n // items, so no need to strip them here.\n spacing={toNumber(spacing)}\n rowSpacing={toNumber(rowSpacing)}\n columnSpacing={toNumber(columnSpacing)}\n columns={toNumber(columns)}\n // A CLEARED select persists as `null`, and MUI resolves both of these\n // as responsive values — `null.xs` throws during SSR and 500s the\n // published page (the AGL-1226 shape). `undefined` is what \"cleared\"\n // has to mean by the time it reaches MUI.\n {...dropClearedProps({ direction, wrap })}\n {...applySemanticElement(dropClearedProps(rest) as Record<string, unknown>)}\n >\n {children}\n </MuiGrid>\n )\n },\n)\nGridElement.displayName = 'AglynGrid'\n\n/** Container-only props: MUI ignores these on an item. */\nconst CONTAINER_ONLY = { when: 'container', is: true }\n/** Item-only props: a container spans its parent, not a column count. */\nconst ITEM_ONLY = { when: 'container', is: true, notMatch: true }\n\nconst SPAN_HELP =\n 'How many columns this cell takes. Set **All** for every screen size, or ' +\n 'give individual breakpoints a value — `xs` applies from the smallest ' +\n 'screens up and each larger breakpoint overrides it. `auto` fits the ' +\n 'content, `grow` takes the remaining space.'\n\nexport const schema: Aglyn.ComponentSchema<GridElementProps> = {\n $id: ID,\n pluginId: BUNDLE_ID,\n displayName: 'Grid',\n description:\n 'Responsive 12-column layout. Turn on Container for the row; give ' +\n 'each cell a Span.',\n category: Aglyn.ComponentCategory.LAYOUT,\n icon: { path: mdiViewGrid.path, sx: { color: '#2196f3' } },\n attributes: [\n semanticElementAttribute('this grid'),\n semanticElementLabelAttribute(),\n {\n name: 'container',\n label: 'Container?',\n description:\n 'If true, this grid lays its direct Grid children out in columns. ' +\n 'Leave it off for a cell inside another grid.',\n component: Aglyn.FieldComponentType.SWITCH,\n },\n {\n name: 'size',\n label: 'Span',\n description: SPAN_HELP,\n // A row of breakpoint controls rather than a text box (AGL-2486). The\n // STORED value is the same string it always was; only the way it is\n // authored changed. `xs:12 md:2` was a developer syntax documented\n // nowhere but this tooltip, so the responsive capability was there and\n // effectively unreachable.\n component: Aglyn.FieldComponentType.BREAKPOINT_SPAN,\n condition: ITEM_ONLY,\n },\n {\n name: 'offset',\n label: 'Offset',\n description:\n 'Empty columns before this cell. `auto` pushes the cell to the ' +\n 'right; `grow` is a span keyword and not an offset, so it is not ' +\n 'offered here.',\n component: Aglyn.FieldComponentType.BREAKPOINT_SPAN,\n // MUI's GridOffset is `'auto' | number`: a zero offset is a real\n // choice, and `grow` is not one at all.\n allowGrow: false,\n minSpan: 0,\n condition: ITEM_ONLY,\n },\n {\n name: 'spacing',\n label: 'Spacing',\n description:\n 'Gap between cells, in theme spacing units (1 = 8px by default).',\n component: Aglyn.FieldComponentType.TEXT_FIELD,\n type: 'number',\n condition: CONTAINER_ONLY,\n },\n {\n name: 'rowSpacing',\n label: 'Row spacing',\n description: 'Vertical gap only; overrides Spacing.',\n component: Aglyn.FieldComponentType.TEXT_FIELD,\n type: 'number',\n condition: CONTAINER_ONLY,\n },\n {\n name: 'columnSpacing',\n label: 'Column spacing',\n description: 'Horizontal gap only; overrides Spacing.',\n component: Aglyn.FieldComponentType.TEXT_FIELD,\n type: 'number',\n condition: CONTAINER_ONLY,\n },\n {\n name: 'columns',\n label: 'Columns',\n description: 'Total columns the row is divided into. Default 12.',\n component: Aglyn.FieldComponentType.TEXT_FIELD,\n type: 'number',\n condition: CONTAINER_ONLY,\n },\n {\n name: 'direction',\n label: 'Direction',\n // The option that is NOT offered is the point of this field. MUI's own\n // API doc: \"Only `row` and `row-reverse` are supported. `column` and\n // `column-reverse` are not supported, because the Grid component is\n // designed to subdivide layouts into columns, not rows.\" Offering them\n // would be a control that silently does nothing.\n description:\n 'Sets the `flex-direction` for the row. Only Row and Row Reversed ' +\n 'are supported — Grid divides a layout into columns, so a column ' +\n 'direction does nothing. Use a Stack for a vertical layout.',\n component: Aglyn.FieldComponentType.SELECT,\n options: [\n { value: 'row', label: 'Row' },\n { value: 'row-reverse', label: 'Row Reversed' },\n ],\n condition: CONTAINER_ONLY,\n },\n {\n name: 'wrap',\n label: 'Wrap',\n description:\n 'Whether cells that do not fit move onto a new line. Default Wrap; ' +\n 'No Wrap keeps every cell on one line and lets them shrink instead.',\n component: Aglyn.FieldComponentType.SELECT,\n options: [\n { value: 'wrap', label: 'Wrap' },\n { value: 'nowrap', label: 'No Wrap' },\n { value: 'wrap-reverse', label: 'Wrap Reversed' },\n ],\n condition: CONTAINER_ONLY,\n },\n ],\n}\n\nconst cell = (size: string, text: string) => ({\n $id: null,\n componentId: ID,\n pluginId: BUNDLE_ID,\n props: { size },\n nodes: [\n {\n $id: null,\n componentId: 'muiTypography',\n pluginId: BUNDLE_ID,\n props: { variant: 'body2', children: text },\n },\n ],\n})\n\nexport const presets: Aglyn.PresetSchema[] = [\n {\n // Ships as a working responsive row, not a bare container: an empty\n // grid renders as nothing at all on the canvas.\n $id: generatePresetId(ID),\n type: Aglyn.NodeType.PRESET,\n displayName: 'Grid',\n pluginId: BUNDLE_ID,\n description: 'Responsive row — three columns that stack on mobile',\n category: Aglyn.ComponentCategory.LAYOUT,\n icon: schema.icon,\n data: {\n $id: null,\n componentId: ID,\n pluginId: BUNDLE_ID,\n props: { container: true, spacing: 2 },\n nodes: [\n cell('xs:12 md:4', 'Column one'),\n cell('xs:12 md:4', 'Column two'),\n cell('xs:12 md:4', 'Column three'),\n ],\n },\n },\n {\n $id: generatePresetId(ID, 'cell'),\n type: Aglyn.NodeType.PRESET,\n displayName: 'Grid Cell',\n pluginId: BUNDLE_ID,\n description: 'A single cell to add to an existing grid row',\n category: Aglyn.ComponentCategory.LAYOUT,\n icon: { path: mdiViewGridOutline.path, sx: { color: '#2196f3' } },\n data: cell('xs:12 md:6', 'Cell'),\n },\n]\n\nexport default GridElement\n"],"names":["Aglyn","mdiViewGrid","mdiViewGridOutline","parseBreakpointSpan","SPAN_BREAKPOINTS","MuiGrid","forwardRef","applySemanticElement","semanticElementAttribute","semanticElementLabelAttribute","BUNDLE_ID","dropClearedProps","generatePresetId","ID","BREAKPOINTS","parseSpan","value","span","raw","undefined","base","values","Object","keys","length","parseOffset","parsed","kept","fromEntries","entries","filter","toNumber","Number","isFinite","GridElement","props","ref","container","size","offset","spacing","rowSpacing","columnSpacing","columns","direction","wrap","children","rest","displayName","CONTAINER_ONLY","when","is","ITEM_ONLY","notMatch","SPAN_HELP","schema","$id","pluginId","description","category","ComponentCategory","LAYOUT","icon","path","sx","color","attributes","name","label","component","FieldComponentType","SWITCH","BREAKPOINT_SPAN","condition","allowGrow","minSpan","TEXT_FIELD","type","SELECT","options","cell","text","componentId","nodes","variant","presets","NodeType","PRESET","data"],"mappings":";;;AAAA;;;;;;;;;;;;;;;CAeC,GAED,YAAYA,WAAW,eAAc;AACrC,SAASC,WAAW,EAAEC,kBAAkB,QAAQ,yBAAwB;AACxE,gFAAgF;AAChF,gFAAgF;AAChF,8EAA8E;AAC9E,6EAA6E;AAC7E,+EAA+E;AAC/E,wEAAwE;AACxE,0DAA0D;AAC1D,S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
*
|
|
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 { SxProps } from '@mui/material/styles';
|
|
19
|
+
export declare const ID: Aglyn.ComponentId;
|
|
20
|
+
export interface IconProps {
|
|
21
|
+
/** mdi icon id from the picker (AGL-146). */
|
|
22
|
+
iconId?: string;
|
|
23
|
+
/**
|
|
24
|
+
* Resolved SVG path for `iconId`, denormalized at author time (AGL-1212).
|
|
25
|
+
* Render surfaces read this and never load the icon catalog.
|
|
26
|
+
*/
|
|
27
|
+
iconPath?: string;
|
|
28
|
+
/** Icon size in px; defaults to 24. */
|
|
29
|
+
size?: number;
|
|
30
|
+
/** CSS color; defaults to the inherited text color. */
|
|
31
|
+
color?: string;
|
|
32
|
+
/**
|
|
33
|
+
* Authored node styles, handed over by the renderer rather than typed
|
|
34
|
+
* into an attribute — recomposed below so the Styles panel's values are
|
|
35
|
+
* merged rather than replaced (AGL-1284).
|
|
36
|
+
*/
|
|
37
|
+
sx?: SxProps;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Icon element (AGL-146): renders a picked mdi icon with size/color
|
|
41
|
+
* controls; an empty pick shows a labeled placeholder so the element stays
|
|
42
|
+
* selectable in the editor.
|
|
43
|
+
*
|
|
44
|
+
* Path resolution order (AGL-1212): the persisted `iconPath` first, then the
|
|
45
|
+
* in-memory catalog for documents authored before paths were stored. The
|
|
46
|
+
* catalog is ~2.9 MB and is only loaded by picker surfaces, so on the tenant
|
|
47
|
+
* site and in preview the second lookup misses — which is why it must NOT go
|
|
48
|
+
* through `getMdiIconFromId`, whose `DEFAULT_ICON` fallback carries a real
|
|
49
|
+
* path and rendered a "help" glyph on every published page.
|
|
50
|
+
*/
|
|
51
|
+
declare const Icon: import("react").ForwardRefExoticComponent<IconProps & import("react").RefAttributes<HTMLElement>>;
|
|
52
|
+
export declare const schema: Aglyn.ComponentSchema<IconProps>;
|
|
53
|
+
export declare const presets: Aglyn.PresetSchema[];
|
|
54
|
+
export default Icon;
|
|
@@ -0,0 +1,163 @@
|
|
|
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 } 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 { getMdiIconPath, mdiShapePlus } from "@aglyn/shared-data-mdi";
|
|
21
|
+
import { MdiIcon } from "@aglyn/shared-ui-jsx";
|
|
22
|
+
import Box from "@mui/material/Box";
|
|
23
|
+
import { forwardRef, useContext } from "react";
|
|
24
|
+
import { BUNDLE_ID } from "../constants/bundle-common.js";
|
|
25
|
+
import { generatePresetId } from "../utils/generate-preset-id.js";
|
|
26
|
+
// Component ids are persisted in screen documents; never rename.
|
|
27
|
+
export const ID = 'icon';
|
|
28
|
+
/**
|
|
29
|
+
* Icon element (AGL-146): renders a picked mdi icon with size/color
|
|
30
|
+
* controls; an empty pick shows a labeled placeholder so the element stays
|
|
31
|
+
* selectable in the editor.
|
|
32
|
+
*
|
|
33
|
+
* Path resolution order (AGL-1212): the persisted `iconPath` first, then the
|
|
34
|
+
* in-memory catalog for documents authored before paths were stored. The
|
|
35
|
+
* catalog is ~2.9 MB and is only loaded by picker surfaces, so on the tenant
|
|
36
|
+
* site and in preview the second lookup misses — which is why it must NOT go
|
|
37
|
+
* through `getMdiIconFromId`, whose `DEFAULT_ICON` fallback carries a real
|
|
38
|
+
* path and rendered a "help" glyph on every published page.
|
|
39
|
+
*/ const Icon = /*#__PURE__*/ forwardRef((props, ref)=>{
|
|
40
|
+
const { iconId, iconPath, size, color } = props, rest = _object_without_properties_loose(props, [
|
|
41
|
+
"iconId",
|
|
42
|
+
"iconPath",
|
|
43
|
+
"size",
|
|
44
|
+
"color"
|
|
45
|
+
]);
|
|
46
|
+
// Node styles ride the renderer-merged sx; recompose (stack.ts pattern).
|
|
47
|
+
const nodeSx = Array.isArray(props['sx']) ? props['sx'] : [
|
|
48
|
+
props['sx']
|
|
49
|
+
];
|
|
50
|
+
const { suppressNavigation } = useContext(Aglyn.ScreenLinkContext);
|
|
51
|
+
const path = iconPath || getMdiIconPath(iconId);
|
|
52
|
+
const icon = path ? {
|
|
53
|
+
path
|
|
54
|
+
} : undefined;
|
|
55
|
+
if (!(icon == null ? void 0 : icon.path)) {
|
|
56
|
+
// The labeled box is for the author, so only editing surfaces draw it; a
|
|
57
|
+
// published page renders the bare element, as the span a picked icon is.
|
|
58
|
+
if (!suppressNavigation) return /*#__PURE__*/ _jsx(Box, _extends({
|
|
59
|
+
ref: ref,
|
|
60
|
+
component: "span"
|
|
61
|
+
}, rest));
|
|
62
|
+
return /*#__PURE__*/ _jsx(Box, _extends({
|
|
63
|
+
ref: ref
|
|
64
|
+
}, rest, {
|
|
65
|
+
sx: [
|
|
66
|
+
{
|
|
67
|
+
width: 48,
|
|
68
|
+
height: 48,
|
|
69
|
+
display: 'inline-flex',
|
|
70
|
+
alignItems: 'center',
|
|
71
|
+
justifyContent: 'center',
|
|
72
|
+
border: '1px dashed',
|
|
73
|
+
borderColor: 'divider',
|
|
74
|
+
borderRadius: 1,
|
|
75
|
+
color: 'text.secondary',
|
|
76
|
+
fontSize: 10,
|
|
77
|
+
fontFamily: 'system-ui, sans-serif'
|
|
78
|
+
},
|
|
79
|
+
...nodeSx
|
|
80
|
+
],
|
|
81
|
+
children: 'Icon'
|
|
82
|
+
}));
|
|
83
|
+
}
|
|
84
|
+
return /*#__PURE__*/ _jsx(Box, _extends({
|
|
85
|
+
ref: ref,
|
|
86
|
+
component: "span",
|
|
87
|
+
sx: {
|
|
88
|
+
display: 'inline-flex'
|
|
89
|
+
}
|
|
90
|
+
}, rest, {
|
|
91
|
+
children: /*#__PURE__*/ _jsx(MdiIcon, {
|
|
92
|
+
path: icon.path,
|
|
93
|
+
sx: _extends({
|
|
94
|
+
fontSize: size && size > 0 ? size : 24
|
|
95
|
+
}, color ? {
|
|
96
|
+
color
|
|
97
|
+
} : {})
|
|
98
|
+
})
|
|
99
|
+
}));
|
|
100
|
+
});
|
|
101
|
+
Icon.displayName = 'Icon';
|
|
102
|
+
export const schema = {
|
|
103
|
+
$id: ID,
|
|
104
|
+
pluginId: BUNDLE_ID,
|
|
105
|
+
displayName: 'Icon',
|
|
106
|
+
description: 'A single icon from the library, at the size and color you pick.',
|
|
107
|
+
category: Aglyn.ComponentCategory.MEDIA,
|
|
108
|
+
icon: {
|
|
109
|
+
path: mdiShapePlus.path,
|
|
110
|
+
sx: {
|
|
111
|
+
color: '#7b1fa2'
|
|
112
|
+
}
|
|
113
|
+
},
|
|
114
|
+
flags: {
|
|
115
|
+
selfClosing: Aglyn.FEATURE_FLAG.ENABLED
|
|
116
|
+
},
|
|
117
|
+
attributes: [
|
|
118
|
+
{
|
|
119
|
+
name: 'iconId',
|
|
120
|
+
description: 'Pick any icon from the library.',
|
|
121
|
+
component: Aglyn.FieldComponentType.ICON_PICKER,
|
|
122
|
+
label: 'Icon'
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
name: 'size',
|
|
126
|
+
description: 'Icon size in pixels (default 24).',
|
|
127
|
+
component: Aglyn.FieldComponentType.TEXT_FIELD,
|
|
128
|
+
label: 'Size (px)',
|
|
129
|
+
type: 'number'
|
|
130
|
+
},
|
|
131
|
+
{
|
|
132
|
+
name: 'color',
|
|
133
|
+
description: 'CSS color, e.g. #7b1fa2; empty inherits the text color.',
|
|
134
|
+
component: Aglyn.FieldComponentType.TEXT_FIELD,
|
|
135
|
+
label: 'Color'
|
|
136
|
+
}
|
|
137
|
+
]
|
|
138
|
+
};
|
|
139
|
+
export const presets = [
|
|
140
|
+
{
|
|
141
|
+
$id: generatePresetId(ID),
|
|
142
|
+
type: Aglyn.NodeType.PRESET,
|
|
143
|
+
displayName: 'Icon',
|
|
144
|
+
pluginId: BUNDLE_ID,
|
|
145
|
+
description: 'A single icon from the mdi library',
|
|
146
|
+
category: Aglyn.ComponentCategory.MEDIA,
|
|
147
|
+
icon: {
|
|
148
|
+
path: mdiShapePlus.path,
|
|
149
|
+
sx: {
|
|
150
|
+
color: '#7b1fa2'
|
|
151
|
+
}
|
|
152
|
+
},
|
|
153
|
+
data: {
|
|
154
|
+
$id: null,
|
|
155
|
+
componentId: ID,
|
|
156
|
+
pluginId: BUNDLE_ID,
|
|
157
|
+
props: {}
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
];
|
|
161
|
+
export default Icon;
|
|
162
|
+
|
|
163
|
+
//# sourceMappingURL=icon.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../../../libs/plugins/mui/src/lib/components/icon.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 { getMdiIconPath, mdiShapePlus } from '@aglyn/shared-data-mdi'\nimport { MdiIcon } from '@aglyn/shared-ui-jsx'\nimport Box from '@mui/material/Box'\nimport type { SxProps } from '@mui/material/styles'\nimport { forwardRef, useContext } 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; never rename.\nexport const ID: Aglyn.ComponentId = 'icon'\n\nexport interface IconProps {\n /** mdi icon id from the picker (AGL-146). */\n iconId?: string\n /**\n * Resolved SVG path for `iconId`, denormalized at author time (AGL-1212).\n * Render surfaces read this and never load the icon catalog.\n */\n iconPath?: string\n /** Icon size in px; defaults to 24. */\n size?: number\n /** CSS color; defaults to the inherited text color. */\n color?: 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-1284).\n */\n sx?: SxProps\n}\n\n/**\n * Icon element (AGL-146): renders a picked mdi icon with size/color\n * controls; an empty pick shows a labeled placeholder so the element stays\n * selectable in the editor.\n *\n * Path resolution order (AGL-1212): the persisted `iconPath` first, then the\n * in-memory catalog for documents authored before paths were stored. The\n * catalog is ~2.9 MB and is only loaded by picker surfaces, so on the tenant\n * site and in preview the second lookup misses — which is why it must NOT go\n * through `getMdiIconFromId`, whose `DEFAULT_ICON` fallback carries a real\n * path and rendered a \"help\" glyph on every published page.\n */\nconst Icon = forwardRef<HTMLElement, IconProps>((props, ref) => {\n const { iconId, iconPath, size, color, ...rest } = props\n // Node styles ride the renderer-merged sx; recompose (stack.ts pattern).\n const nodeSx = Array.isArray(props['sx']) ? props['sx'] : [props['sx']]\n const { suppressNavigation } = useContext(Aglyn.ScreenLinkContext)\n const path = iconPath || getMdiIconPath(iconId)\n const icon = path ? { path } : undefined\n if (!icon?.path) {\n // The labeled box is for the author, so only editing surfaces draw it; a\n // published page renders the bare element, as the span a picked icon is.\n if (!suppressNavigation) return <Box ref={ref} component=\"span\" {...rest} />\n return (\n <Box\n ref={ref}\n {...rest}\n sx={[\n {\n width: 48,\n height: 48,\n display: 'inline-flex',\n alignItems: 'center',\n justifyContent: 'center',\n border: '1px dashed',\n borderColor: 'divider',\n borderRadius: 1,\n color: 'text.secondary',\n fontSize: 10,\n fontFamily: 'system-ui, sans-serif',\n },\n ...nodeSx,\n ]}\n >\n {'Icon'}\n </Box>\n )\n }\n return (\n <Box ref={ref} component=\"span\" sx={{ display: 'inline-flex' }} {...rest}>\n <MdiIcon\n path={icon.path}\n sx={{\n fontSize: size && size > 0 ? size : 24,\n ...(color ? { color } : {}),\n }}\n />\n </Box>\n )\n})\nIcon.displayName = 'Icon'\n\nexport const schema: Aglyn.ComponentSchema<IconProps> = {\n $id: ID,\n pluginId: BUNDLE_ID,\n displayName: 'Icon',\n description:\n 'A single icon from the library, at the size and color you pick.',\n category: Aglyn.ComponentCategory.MEDIA,\n icon: {\n path: mdiShapePlus.path,\n sx: { color: '#7b1fa2' },\n },\n flags: {\n selfClosing: Aglyn.FEATURE_FLAG.ENABLED,\n },\n attributes: [\n {\n name: 'iconId',\n description: 'Pick any icon from the library.',\n component: Aglyn.FieldComponentType.ICON_PICKER,\n label: 'Icon',\n },\n {\n name: 'size',\n description: 'Icon size in pixels (default 24).',\n component: Aglyn.FieldComponentType.TEXT_FIELD,\n label: 'Size (px)',\n type: 'number',\n },\n {\n name: 'color',\n description: 'CSS color, e.g. #7b1fa2; empty inherits the text color.',\n component: Aglyn.FieldComponentType.TEXT_FIELD,\n label: 'Color',\n },\n ],\n}\n\nexport const presets: Aglyn.PresetSchema[] = [\n {\n $id: generatePresetId(ID),\n type: Aglyn.NodeType.PRESET,\n displayName: 'Icon',\n pluginId: BUNDLE_ID,\n description: 'A single icon from the mdi library',\n category: Aglyn.ComponentCategory.MEDIA,\n icon: {\n path: mdiShapePlus.path,\n sx: { color: '#7b1fa2' },\n },\n data: {\n $id: null,\n componentId: ID,\n pluginId: BUNDLE_ID,\n props: {},\n },\n },\n]\n\nexport default Icon\n"],"names":["Aglyn","getMdiIconPath","mdiShapePlus","MdiIcon","Box","forwardRef","useContext","BUNDLE_ID","generatePresetId","ID","Icon","props","ref","iconId","iconPath","size","color","rest","nodeSx","Array","isArray","suppressNavigation","ScreenLinkContext","path","icon","undefined","component","sx","width","height","display","alignItems","justifyContent","border","borderColor","borderRadius","fontSize","fontFamily","displayName","schema","$id","pluginId","description","category","ComponentCategory","MEDIA","flags","selfClosing","FEATURE_FLAG","ENABLED","attributes","name","FieldComponentType","ICON_PICKER","label","TEXT_FIELD","type","presets","NodeType","PRESET","data","componentId"],"mappings":";;;AAAA;;;;;;;;;;;;;;;CAeC,GAED,YAAYA,WAAW,eAAc;AACrC,SAASC,cAAc,EAAEC,YAAY,QAAQ,yBAAwB;AACrE,SAASC,OAAO,QAAQ,uBAAsB;AAC9C,OAAOC,SAAS,oBAAmB;AAEnC,SAASC,UAAU,EAAEC,UAAU,QAAQ,QAAO;AAC9C,SAASC,SAAS,QAAQ,gCAA4B;AACtD,SAASC,gBAAgB,QAAQ,iCAA6B;AAE9D,iEAAiE;AACjE,OAAO,MAAMC,KAAwB,OAAM;AAsB3C;;;;;;;;;;;CAWC,GACD,MAAMC,qBAAOL,WAAmC,CAACM,OAAOC;IACtD,MAAM,EAAEC,MAAM,EAAEC,QAAQ,EAAEC,IAAI,EAAEC,KAAK,EAAW,GAAGL,OAATM,wCAASN;;;;;;IACnD,yEAAyE;I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;YACbhB,WAAW1B,MAAMoD,kBAAkB,CAACC,WAAW;YAC/CC,OAAO;QACT;QACA;YACEH,MAAM;YACNT,aAAa;YACbhB,WAAW1B,MAAMoD,kBAAkB,CAACG,UAAU;YAC9CD,OAAO;YACPE,MAAM;QACR;QACA;YACEL,MAAM;YACNT,aAAa;YACbhB,WAAW1B,MAAMoD,kBAAkB,CAACG,UAAU;YAC9CD,OAAO;QACT;KACD;AACH,EAAC;AAED,OAAO,MAAMG,UAAgC;IAC3C;QACEjB,KAAKhC,iBAAiBC;QACtB+C,MAAMxD,MAAM0D,QAAQ,CAACC,MAAM;QAC3BrB,aAAa;QACbG,UAAUlC;QACVmC,aAAa;QACbC,UAAU3C,MAAM4C,iBAAiB,CAACC,KAAK;QACvCrB,MAAM;YACJD,MAAMrB,aAAaqB,IAAI;YACvBI,IAAI;gBAAEX,OAAO;YAAU;QACzB;QACA4C,MAAM;YACJpB,KAAK;YACLqB,aAAapD;YACbgC,UAAUlC;YACVI,OAAO,CAAC;QACV;IACF;CACD,CAAA;AAED,eAAeD,KAAI"}
|
|
@@ -0,0 +1,58 @@
|
|
|
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
|
+
import { type ReactNode } from 'react';
|
|
19
|
+
export declare const IMAGE_LIST_ID: Aglyn.ComponentId;
|
|
20
|
+
export declare const IMAGE_LIST_ITEM_ID: Aglyn.ComponentId;
|
|
21
|
+
export type ImageListVariant = 'standard' | 'quilted' | 'masonry' | 'woven';
|
|
22
|
+
export interface ImageListElementProps {
|
|
23
|
+
cols?: number | string;
|
|
24
|
+
gap?: number | string;
|
|
25
|
+
/** Row height in px, or blank for `auto`. */
|
|
26
|
+
rowHeight?: number | string;
|
|
27
|
+
variant?: ImageListVariant;
|
|
28
|
+
children?: ReactNode;
|
|
29
|
+
}
|
|
30
|
+
export interface ImageListItemElementProps {
|
|
31
|
+
/** Columns this tile spans (quilted lists). */
|
|
32
|
+
cols?: number | string;
|
|
33
|
+
/** Rows this tile spans (quilted lists). */
|
|
34
|
+
rows?: number | string;
|
|
35
|
+
/** Caption bar text; the bar is omitted entirely when both are blank. */
|
|
36
|
+
title?: string;
|
|
37
|
+
subtitle?: string;
|
|
38
|
+
barPosition?: 'below' | 'top' | 'bottom';
|
|
39
|
+
children?: ReactNode;
|
|
40
|
+
}
|
|
41
|
+
/** Number fields round-trip as strings; MUI's grid math needs numbers. */
|
|
42
|
+
export declare function toCount(value: unknown, fallback?: number): number | undefined;
|
|
43
|
+
/**
|
|
44
|
+
* Image list (https://mui.com/material-ui/react-image-list/): a masonry
|
|
45
|
+
* or quilted grid of images, denser than a Grid of cards.
|
|
46
|
+
*/
|
|
47
|
+
declare const ImageListElement: import("react").ForwardRefExoticComponent<ImageListElementProps & import("react").RefAttributes<HTMLUListElement>>;
|
|
48
|
+
/**
|
|
49
|
+
* One tile. The image itself is an ordinary Image element dropped
|
|
50
|
+
* inside, so tiles keep the media-CDN srcSet, lazy loading and
|
|
51
|
+
* empty-source placeholder (AGL-74/175) rather than a second, worse
|
|
52
|
+
* image implementation living here.
|
|
53
|
+
*/
|
|
54
|
+
export declare const ImageListItemElement: import("react").ForwardRefExoticComponent<ImageListItemElementProps & import("react").RefAttributes<HTMLLIElement>>;
|
|
55
|
+
export declare const imageListSchema: Aglyn.ComponentSchema<ImageListElementProps>;
|
|
56
|
+
export declare const imageListItemSchema: Aglyn.ComponentSchema<ImageListItemElementProps>;
|
|
57
|
+
export declare const imageListPresets: Aglyn.PresetSchema[];
|
|
58
|
+
export default ImageListElement;
|