@aglyn/besigner-ui 1.0.0-beta.274 → 1.0.0-beta.277
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +17 -17
- package/src/lib/components/app-bar-breadcrumbs.component.js +4 -2
- package/src/lib/components/app-bar-breadcrumbs.component.js.map +1 -1
- package/src/lib/components/aside-panel.component.js +19 -3
- package/src/lib/components/aside-panel.component.js.map +1 -1
- package/src/lib/components/besigner-dnd-context.component.js +46 -5
- package/src/lib/components/besigner-dnd-context.component.js.map +1 -1
- package/src/lib/components/dnd/canvas-drop-indicator.d.ts +11 -0
- package/src/lib/components/dnd/canvas-drop-indicator.js +32 -34
- package/src/lib/components/dnd/canvas-drop-indicator.js.map +1 -1
- package/src/lib/components/dnd/draggable-droppable.js +124 -23
- package/src/lib/components/dnd/draggable-droppable.js.map +1 -1
- package/src/lib/components/dnd/drop-indicator-geometry.d.ts +64 -0
- package/src/lib/components/dnd/drop-indicator-geometry.js +77 -0
- package/src/lib/components/dnd/drop-indicator-geometry.js.map +1 -0
- package/src/lib/components/dnd/drop-indicator.d.ts +13 -11
- package/src/lib/components/dnd/drop-indicator.js +52 -63
- package/src/lib/components/dnd/drop-indicator.js.map +1 -1
- package/src/lib/components/dnd/drop-surface.d.ts +91 -0
- package/src/lib/components/dnd/drop-surface.js +172 -0
- package/src/lib/components/dnd/drop-surface.js.map +1 -0
- package/src/lib/components/dnd/drop-targeting.d.ts +94 -0
- package/src/lib/components/dnd/drop-targeting.js +184 -0
- package/src/lib/components/dnd/drop-targeting.js.map +1 -0
- package/src/lib/components/element-interactions-form.component.js +5 -9
- package/src/lib/components/element-interactions-form.component.js.map +1 -1
- package/src/lib/components/element-props-form.component.js +0 -4
- package/src/lib/components/element-props-form.component.js.map +1 -1
- package/src/lib/components/layout-part-menu.component.d.ts +65 -0
- package/src/lib/components/layout-part-menu.component.js +151 -0
- package/src/lib/components/layout-part-menu.component.js.map +1 -0
- package/src/lib/components/layout-style-picker.component.d.ts +2 -0
- package/src/lib/components/layout-style-picker.component.js +2 -2
- package/src/lib/components/layout-style-picker.component.js.map +1 -1
- package/src/lib/components/node-context-menu.js +8 -0
- package/src/lib/components/node-context-menu.js.map +1 -1
- package/src/lib/components/node-leaf.js +50 -19
- package/src/lib/components/node-leaf.js.map +1 -1
- package/src/lib/components/node-overlay.js +61 -21
- package/src/lib/components/node-overlay.js.map +1 -1
- package/src/lib/components/node-quick-actions.js +40 -23
- package/src/lib/components/node-quick-actions.js.map +1 -1
- package/src/lib/components/node-tree-view.d.ts +2 -0
- package/src/lib/components/node-tree-view.js +16 -4
- package/src/lib/components/node-tree-view.js.map +1 -1
- package/src/lib/components/viewport-canvas.component.js +3 -1
- package/src/lib/components/viewport-canvas.component.js.map +1 -1
- package/src/lib/components/viewport-frame.component.js +27 -1
- package/src/lib/components/viewport-frame.component.js.map +1 -1
- package/src/lib/components/workspace-editor.component.js +43 -22
- package/src/lib/components/workspace-editor.component.js.map +1 -1
- package/src/lib/contexts/layout-chrome-context.d.ts +10 -0
- package/src/lib/contexts/layout-chrome-context.js.map +1 -1
- package/src/lib/hooks/use-leaf-drop.d.ts +7 -1
- package/src/lib/hooks/use-leaf-drop.js +11 -5
- package/src/lib/hooks/use-leaf-drop.js.map +1 -1
- package/src/lib/hooks/use-preview-repeats.d.ts +22 -0
- package/src/lib/hooks/use-preview-repeats.js +91 -0
- package/src/lib/hooks/use-preview-repeats.js.map +1 -0
- package/src/lib/utils/repeat-copy.d.ts +36 -0
- package/src/lib/utils/repeat-copy.js +51 -0
- package/src/lib/utils/repeat-copy.js.map +1 -0
- package/src/lib/utils/touch-keyboard.d.ts +41 -0
- package/src/lib/utils/touch-keyboard.js +72 -0
- package/src/lib/utils/touch-keyboard.js.map +1 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aglyn/besigner-ui",
|
|
3
|
-
"version": "1.0.0-beta.
|
|
3
|
+
"version": "1.0.0-beta.277",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"homepage": "https://aglyn.com",
|
|
6
6
|
"repository": {
|
|
@@ -25,22 +25,22 @@
|
|
|
25
25
|
"./package.json": "./package.json"
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@aglyn/aglyn": "1.0.0-beta.
|
|
29
|
-
"@aglyn/aglyn-markdown-editor": "1.0.0-beta.
|
|
30
|
-
"@aglyn/aglyn-node-renderer": "1.0.0-beta.
|
|
31
|
-
"@aglyn/besigner": "1.0.0-beta.
|
|
32
|
-
"@aglyn/shared-data-enums": "1.0.0-beta.
|
|
33
|
-
"@aglyn/shared-data-mdi": "1.0.0-beta.
|
|
34
|
-
"@aglyn/shared-data-types": "1.0.0-beta.
|
|
35
|
-
"@aglyn/shared-svg-icons": "1.0.0-beta.
|
|
36
|
-
"@aglyn/shared-ui-json-editor": "1.0.0-beta.
|
|
37
|
-
"@aglyn/shared-ui-jsx": "1.0.0-beta.
|
|
38
|
-
"@aglyn/shared-ui-jsx-forms": "1.0.0-beta.
|
|
39
|
-
"@aglyn/shared-ui-snackstack": "1.0.0-beta.
|
|
40
|
-
"@aglyn/shared-ui-theme": "1.0.0-beta.
|
|
41
|
-
"@aglyn/shared-util-dom": "1.0.0-beta.
|
|
42
|
-
"@aglyn/shared-util-tools": "1.0.0-beta.
|
|
43
|
-
"@aglyn/shared-util-vendor": "1.0.0-beta.
|
|
28
|
+
"@aglyn/aglyn": "1.0.0-beta.277",
|
|
29
|
+
"@aglyn/aglyn-markdown-editor": "1.0.0-beta.277",
|
|
30
|
+
"@aglyn/aglyn-node-renderer": "1.0.0-beta.277",
|
|
31
|
+
"@aglyn/besigner": "1.0.0-beta.277",
|
|
32
|
+
"@aglyn/shared-data-enums": "1.0.0-beta.277",
|
|
33
|
+
"@aglyn/shared-data-mdi": "1.0.0-beta.277",
|
|
34
|
+
"@aglyn/shared-data-types": "1.0.0-beta.277",
|
|
35
|
+
"@aglyn/shared-svg-icons": "1.0.0-beta.277",
|
|
36
|
+
"@aglyn/shared-ui-json-editor": "1.0.0-beta.277",
|
|
37
|
+
"@aglyn/shared-ui-jsx": "1.0.0-beta.277",
|
|
38
|
+
"@aglyn/shared-ui-jsx-forms": "1.0.0-beta.277",
|
|
39
|
+
"@aglyn/shared-ui-snackstack": "1.0.0-beta.277",
|
|
40
|
+
"@aglyn/shared-ui-theme": "1.0.0-beta.277",
|
|
41
|
+
"@aglyn/shared-util-dom": "1.0.0-beta.277",
|
|
42
|
+
"@aglyn/shared-util-tools": "1.0.0-beta.277",
|
|
43
|
+
"@aglyn/shared-util-vendor": "1.0.0-beta.277",
|
|
44
44
|
"@dnd-kit/core": "^6.3.1",
|
|
45
45
|
"@dnd-kit/utilities": "^3.2.2",
|
|
46
46
|
"@react-aria/utils": "^3.34.1",
|
|
@@ -24,6 +24,7 @@ import clsx from "clsx";
|
|
|
24
24
|
import { observer } from "mobx-react-lite";
|
|
25
25
|
import { forwardRef, useCallback, useEffect, useRef } from "react";
|
|
26
26
|
import useLeafDrop from "../hooks/use-leaf-drop.js";
|
|
27
|
+
import { DropSurface, dropSurfaceProps } from "./dnd/drop-surface.js";
|
|
27
28
|
const breadcrumbItemClassKey = generateComponentClassKeys('BreadcrumbItem', [
|
|
28
29
|
'root',
|
|
29
30
|
'lastItem',
|
|
@@ -107,7 +108,7 @@ const BreadcrumbItem = observer((props)=>{
|
|
|
107
108
|
]);
|
|
108
109
|
const node = canvas.getNode($id);
|
|
109
110
|
const isHovered = Besigner.focus.isNodeHovered(node);
|
|
110
|
-
const { setNodeRef: setDroppableNodeRef } = useLeafDrop(node, undefined,
|
|
111
|
+
const { setNodeRef: setDroppableNodeRef } = useLeafDrop(node, undefined, DropSurface.BREADCRUMBS);
|
|
111
112
|
const handleClick = useCallback((e)=>{
|
|
112
113
|
onClick && onClick(e, node);
|
|
113
114
|
}, [
|
|
@@ -229,7 +230,8 @@ export const AppBarBreadcrumbsComponent = /*#__PURE__*/ forwardRef((props, ref)=
|
|
|
229
230
|
}, []);
|
|
230
231
|
return /*#__PURE__*/ _jsx(MuiAppBar, _extends({
|
|
231
232
|
ref: setRefs,
|
|
232
|
-
id: "aglyn:besigner-appbar-secondary"
|
|
233
|
+
id: "aglyn:besigner-appbar-secondary"
|
|
234
|
+
}, dropSurfaceProps(DropSurface.BREADCRUMBS), {
|
|
233
235
|
"aria-label": "secondary app toolbar",
|
|
234
236
|
position: "static",
|
|
235
237
|
color: "surface",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../../../../libs/besigner/feature/designer/src/lib/components/app-bar-breadcrumbs.component.tsx"],"sourcesContent":["/**\n * @license\n * Copyright 2023 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 type * as Aglyn from '@aglyn/aglyn'\nimport { canvas } from '@aglyn/aglyn'\nimport * as Besigner from '@aglyn/besigner'\nimport {\n generateComponentClassKeys,\n mergeSxProps,\n styled,\n} from '@aglyn/shared-ui-theme'\nimport {\n alpha,\n AppBar as MuiAppBar,\n type AppBarProps as MuiAppBarProps,\n Breadcrumbs as MuiBreadcrumbs,\n breadcrumbsClasses,\n type BreadcrumbsProps as MuiBreadcrumbsProps,\n ButtonBase as MuiButtonBase,\n type ButtonBaseProps as ButtonBaseProps,\n Chip,\n Stack,\n Toolbar as MuiToolbar,\n} from '@mui/material'\nimport clsx from 'clsx'\nimport { observer } from 'mobx-react-lite'\nimport { forwardRef, useCallback, useEffect, useRef } from 'react'\nimport useLeafDrop from '../hooks/use-leaf-drop'\n\nconst breadcrumbItemClassKey = generateComponentClassKeys('BreadcrumbItem', [\n 'root',\n 'lastItem',\n 'hovered',\n])\n\nconst StyledBreadcrumbs = styled(MuiBreadcrumbs)(({ theme }) => {\n const tv = (theme as any).vars || theme\n return {\n lineHeight: 1,\n fontSize: 11,\n overflowX: 'auto',\n\n [`.${breadcrumbsClasses.ol}`]: {\n flexWrap: 'nowrap',\n whiteSpace: 'nowrap',\n },\n [`.${breadcrumbsClasses.separator}`]: {\n margin: 0,\n padding: 0,\n },\n [`.${breadcrumbsClasses.li}`]: {\n marginLeft: theme.spacing(-0.5),\n [`.${breadcrumbItemClassKey.root}`]: {\n fontSize: 'inherit',\n padding: theme.spacing(0.75),\n paddingLeft: theme.spacing(1.75),\n paddingRight: theme.spacing(1.75),\n marginLeft: theme.spacing(-0.5),\n clipPath: `polygon(calc(100% - ${theme.spacing(\n 1,\n )}) 0px, 100% 50%, calc(100% - ${theme.spacing(\n 1,\n )}) 100%, 0% 100%, ${theme.spacing(1)} 50%, 0% 0%)`,\n\n color: tv.palette.text.primary,\n background: `rgba(${tv.palette.primary.lightChannel} / ${theme.palette.action.hoverOpacity})`,\n [`:hover, .${breadcrumbItemClassKey.hovered}`]: {\n background: `rgba(${tv.palette.primary.lightChannel} / ${theme.palette.action.activatedOpacity})`,\n },\n [`:focus`]: {\n background: `rgba(${tv.palette.primary.lightChannel} / ${theme.palette.action.focusOpacity})`,\n },\n [`:active`]: {\n background: `rgba(${tv.palette.primary.lightChannel} / ${theme.palette.action.activatedOpacity})`,\n },\n },\n\n [':before']: {\n content: '\"\"',\n position: 'absolute',\n top: 0,\n height: '100%',\n width: `calc(${theme.spacing(1)} + 1px)`,\n backgroundColor: tv.palette.divider,\n marginLeft: theme.spacing(-0.5),\n clipPath: `polygon(calc(100% - ${theme.spacing(\n 1,\n )}) 0px, 100% 50%, calc(100% - ${theme.spacing(\n 1,\n )}) 100%, 0% 100%, ${theme.spacing(1)} 50%, 0% 0%)`,\n },\n\n [`:first-of-type .${breadcrumbItemClassKey.root}`]: {\n clipPath: `polygon(calc(100% - ${theme.spacing(\n 1,\n )}) 0px, 100% 50%, calc(100% - ${theme.spacing(\n 1,\n )}) 100%, 0% 100%, 0% 0%, 0% 0%)`,\n },\n\n [[\n `:last-of-type .${breadcrumbItemClassKey.root}`,\n `.${breadcrumbItemClassKey.root} .${breadcrumbItemClassKey.lastItem}`,\n ].join()]: {\n color: tv.palette.text.primary,\n background: `rgba(${tv.palette.secondary.lightChannel} / ${theme.palette.action.selectedOpacity})`,\n [`:hover, ${breadcrumbItemClassKey.hovered}`]: {\n background: `rgba(${tv.palette.secondary.lightChannel} / ${theme.palette.action.activatedOpacity})`,\n },\n [`:focus, .Mui-focusVisible`]: {\n background: `rgba(${tv.palette.secondary.lightChannel} / ${theme.palette.action.focusOpacity})`,\n },\n [`:active`]: {\n background: `rgba(${tv.palette.secondary.lightChannel} / ${theme.palette.action.hoverOpacity})`,\n },\n },\n },\n }\n})\n\nexport interface BreadcrumbItemProps\n extends Partial<\n Omit<\n ButtonBaseProps<'button'>,\n 'onClick' | 'onMouseEnter' | 'onFocusVisible'\n >\n > {\n $id: Aglyn.NodeId\n lastItem?: boolean\n onClick?: (e, node: Aglyn.NodeSchema<any>) => void\n onMouseEnter?: (e, node: Aglyn.NodeSchema<any>) => void\n onFocusVisible?: (e, node: Aglyn.NodeSchema<any>) => void\n}\n\nconst BreadcrumbItem = observer((props: BreadcrumbItemProps) => {\n const {\n children,\n $id,\n lastItem,\n onClick,\n onMouseEnter,\n onFocusVisible,\n ...rest\n } = props\n const node = canvas.getNode($id)\n const isHovered = Besigner.focus.isNodeHovered(node)\n const { setNodeRef: setDroppableNodeRef } = useLeafDrop(\n node,\n undefined,\n 'breadcrumbs',\n )\n\n const handleClick = useCallback(\n (e) => {\n onClick && onClick(e, node)\n },\n [onClick, node],\n )\n\n const handleMouseEnter = useCallback(\n (e) => {\n onMouseEnter && onMouseEnter(e, node)\n },\n [onMouseEnter, node],\n )\n\n const handleFocusVisible = useCallback(\n (e) => {\n onFocusVisible && onFocusVisible(e, node)\n },\n [onFocusVisible, node],\n )\n\n return (\n <MuiButtonBase\n ref={setDroppableNodeRef}\n onClick={handleClick}\n onMouseEnter={handleMouseEnter}\n onFocusVisible={handleFocusVisible}\n className={clsx(breadcrumbItemClassKey.root, {\n [breadcrumbItemClassKey.lastItem]: lastItem,\n [breadcrumbItemClassKey.hovered]: isHovered,\n })}\n {...rest}\n >\n <>\n {node?.labelShort}\n {children}\n </>\n </MuiButtonBase>\n )\n})\n\ninterface BreadcrumbsProps extends Partial<MuiBreadcrumbsProps> {}\n\nconst Breadcrumbs = observer((props: BreadcrumbsProps) => {\n const { children, sx, ...rest } = props\n const lastSelected = Besigner.focus.getLastSelected()\n const selectionCount = Besigner.focus.selectionCount()\n\n const handleClick = useCallback((e, node: Aglyn.NodeSchema<any>) => {\n Besigner.focus.setSelectedNode(node)\n }, [])\n\n const handleMouseEnter = useCallback((e, node: Aglyn.NodeSchema<any>) => {\n Besigner.focus.setHoveredNode(node)\n }, [])\n\n const handleFocusVisible = useCallback((e, node: Aglyn.NodeSchema<any>) => {\n Besigner.focus.setHoveredNode(node)\n }, [])\n\n return (\n <StyledBreadcrumbs\n separator={null}\n aria-label=\"breadcrumb\"\n sx={sx}\n {...rest}\n >\n {lastSelected?.breadcrumbPath.map(($id) => {\n return (\n <BreadcrumbItem\n key={$id}\n $id={$id}\n onClick={handleClick}\n onMouseEnter={handleMouseEnter}\n onFocusVisible={handleFocusVisible}\n lastItem={lastSelected?.$id === $id}\n />\n )\n })}\n {selectionCount > 1 ? (\n <Chip\n label={`+${selectionCount - 1} selected`}\n size=\"small\"\n variant=\"outlined\"\n color=\"primary\"\n sx={{ ml: 0.5, height: 18, fontSize: '0.65rem' }}\n />\n ) : null}\n </StyledBreadcrumbs>\n )\n})\n\nexport interface AppBarBreadcrumbsComponentProps\n extends Partial<MuiAppBarProps> {}\n\nexport const AppBarBreadcrumbsComponent = forwardRef<\n any,\n AppBarBreadcrumbsComponentProps\n>((props, ref) => {\n const { children, sx, ...rest } = props\n\n // This strip is the canvas column's bottom chrome, so it is what a\n // viewport-fixed affordance in that corner would clip (AGL-2486). It\n // publishes its own height as the stand-off a dock launcher reads;\n // measured rather than assumed, because \"24px dense toolbar plus a\n // border\" is exactly the kind of constant that stops being true the\n // first time a chip wraps.\n const stripRef = useRef<HTMLElement | null>(null)\n const setRefs = useCallback(\n (node: HTMLElement | null) => {\n stripRef.current = node\n if (typeof ref === 'function') ref(node)\n else if (ref) (ref as { current: unknown }).current = node\n },\n [ref],\n )\n useEffect(() => {\n const node = stripRef.current\n if (!node) return undefined\n const root = document.documentElement\n const property = '--aglyn-dock-inset-bottom'\n const publish = () => {\n const { height } = node.getBoundingClientRect()\n root.style.setProperty(property, `${Math.round(height) + 20}px`)\n }\n publish()\n // Guarded: jsdom has no ResizeObserver, and the initial publish above\n // is the part that matters — the observer only keeps it honest.\n const observer =\n typeof ResizeObserver === 'undefined' ? null : new ResizeObserver(publish)\n observer?.observe(node)\n return () => {\n observer?.disconnect()\n root.style.removeProperty(property)\n }\n }, [])\n\n return (\n <MuiAppBar\n ref={setRefs}\n id=\"aglyn:besigner-appbar-secondary\"\n aria-label=\"secondary app toolbar\"\n position=\"static\"\n color=\"surface\"\n component=\"header\"\n elevation={0}\n sx={mergeSxProps(\n {\n top: 0,\n // Stack above the canvas selection overlays (portaled, low z).\n position: 'relative',\n zIndex: 'appBar',\n borderBottomWidth: '1px',\n borderBottomStyle: 'solid',\n borderBottomColor: 'divider',\n [`& .MuiToolbar-root`]: { minHeight: 24 },\n },\n sx,\n )}\n {...rest}\n >\n <MuiToolbar variant=\"dense\" sx={{ px: { xs: 0, sm: 0 } }}>\n <Stack\n direction=\"row\"\n spacing={1}\n sx={{\n alignItems: \"center\",\n justifyContent: \"space-between\",\n width: 1\n }}>\n <Breadcrumbs />\n {children}\n </Stack>\n </MuiToolbar>\n </MuiAppBar>\n );\n})\n\nAppBarBreadcrumbsComponent.displayName = 'AppBarBreadcrumbsComponent'\nAppBarBreadcrumbsComponent.aglyn = true\n\nexport default AppBarBreadcrumbsComponent\n"],"names":["canvas","Besigner","generateComponentClassKeys","mergeSxProps","styled","AppBar","MuiAppBar","Breadcrumbs","MuiBreadcrumbs","breadcrumbsClasses","ButtonBase","MuiButtonBase","Chip","Stack","Toolbar","MuiToolbar","clsx","observer","forwardRef","useCallback","useEffect","useRef","useLeafDrop","breadcrumbItemClassKey","StyledBreadcrumbs","theme","tv","vars","lineHeight","fontSize","overflowX","ol","flexWrap","whiteSpace","separator","margin","padding","li","marginLeft","spacing","root","paddingLeft","paddingRight","clipPath","color","palette","text","primary","background","lightChannel","action","hoverOpacity","hovered","activatedOpacity","focusOpacity","content","position","top","height","width","backgroundColor","divider","lastItem","join","secondary","selectedOpacity","BreadcrumbItem","props","children","$id","onClick","onMouseEnter","onFocusVisible","rest","node","getNode","isHovered","focus","isNodeHovered","setNodeRef","setDroppableNodeRef","undefined","handleClick","e","handleMouseEnter","handleFocusVisible","ref","className","labelShort","sx","lastSelected","getLastSelected","selectionCount","setSelectedNode","setHoveredNode","aria-label","breadcrumbPath","map","label","size","variant","ml","AppBarBreadcrumbsComponent","stripRef","setRefs","current","document","documentElement","property","publish","getBoundingClientRect","style","setProperty","Math","round","ResizeObserver","observe","disconnect","removeProperty","id","component","elevation","zIndex","borderBottomWidth","borderBottomStyle","borderBottomColor","minHeight","px","xs","sm","direction","alignItems","justifyContent","displayName","aglyn"],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC;;;AAGD,SAASA,MAAM,QAAQ,eAAc;AACrC,YAAYC,cAAc,kBAAiB;AAC3C,SACEC,0BAA0B,EAC1BC,YAAY,EACZC,MAAM,QACD,yBAAwB;AAC/B,SAEEC,UAAUC,SAAS,EAEnBC,eAAeC,cAAc,EAC7BC,kBAAkB,EAElBC,cAAcC,aAAa,EAE3BC,IAAI,EACJC,KAAK,EACLC,WAAWC,UAAU,QAChB,gBAAe;AACtB,OAAOC,UAAU,OAAM;AACvB,SAASC,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G,EAAE,CAAC;QACjE;QACAmD;QACA,sEAAsE;QACtE,gEAAgE;QAChE,MAAM5F,WACJ,OAAOkG,mBAAmB,cAAc,OAAO,IAAIA,eAAeN;QACpE5F,4BAAAA,SAAUmG,OAAO,CAAC1C;QAClB,OAAO;YACLzD,4BAAAA,SAAUoG,UAAU;YACpB7E,KAAKuE,KAAK,CAACO,cAAc,CAACV;QAC5B;IACF,GAAG,EAAE;IAEL,qBACE,KAACtG;QACCgF,KAAKkB;QACLe,IAAG;QACHxB,cAAW;QACXvC,UAAS;QACTZ,OAAM;QACN4E,WAAU;QACVC,WAAW;QACXhC,IAAItF,aACF;YACEsD,KAAK;YACL,+DAA+D;YAC/DD,UAAU;YACVkE,QAAQ;YACRC,mBAAmB;YACnBC,mBAAmB;YACnBC,mBAAmB;YACnB,CAAC,CAAC,kBAAkB,CAAC,CAAC,EAAE;gBAAEC,WAAW;YAAG;QAC1C,GACArC;OAEEhB;kBAEJ,cAAA,KAAC1D;YAAWqF,SAAQ;YAAQX,IAAI;gBAAEsC,IAAI;oBAAEC,IAAI;oBAAGC,IAAI;gBAAE;YAAE;sBACrD,cAAA,MAACpH;gBACCqH,WAAU;gBACV3F,SAAS;gBACTkD,IAAI;oBACF0C,YAAY;oBACZC,gBAAgB;oBAChBzE,OAAO;gBACT;;kCACA,KAACpD;oBACA6D;;;;;AAKX,GAAE;AAEFkC,2BAA2B+B,WAAW,GAAG;AACzC/B,2BAA2BgC,KAAK,GAAG;AAEnC,eAAehC,2BAA0B"}
|
|
1
|
+
{"version":3,"sources":["../../../../../../../../libs/besigner/feature/designer/src/lib/components/app-bar-breadcrumbs.component.tsx"],"sourcesContent":["/**\n * @license\n * Copyright 2023 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 type * as Aglyn from '@aglyn/aglyn'\nimport { canvas } from '@aglyn/aglyn'\nimport * as Besigner from '@aglyn/besigner'\nimport {\n generateComponentClassKeys,\n mergeSxProps,\n styled,\n} from '@aglyn/shared-ui-theme'\nimport {\n alpha,\n AppBar as MuiAppBar,\n type AppBarProps as MuiAppBarProps,\n Breadcrumbs as MuiBreadcrumbs,\n breadcrumbsClasses,\n type BreadcrumbsProps as MuiBreadcrumbsProps,\n ButtonBase as MuiButtonBase,\n type ButtonBaseProps as ButtonBaseProps,\n Chip,\n Stack,\n Toolbar as MuiToolbar,\n} from '@mui/material'\nimport clsx from 'clsx'\nimport { observer } from 'mobx-react-lite'\nimport { forwardRef, useCallback, useEffect, useRef } from 'react'\nimport useLeafDrop from '../hooks/use-leaf-drop'\nimport { DropSurface, dropSurfaceProps } from './dnd/drop-surface'\n\nconst breadcrumbItemClassKey = generateComponentClassKeys('BreadcrumbItem', [\n 'root',\n 'lastItem',\n 'hovered',\n])\n\nconst StyledBreadcrumbs = styled(MuiBreadcrumbs)(({ theme }) => {\n const tv = (theme as any).vars || theme\n return {\n lineHeight: 1,\n fontSize: 11,\n overflowX: 'auto',\n\n [`.${breadcrumbsClasses.ol}`]: {\n flexWrap: 'nowrap',\n whiteSpace: 'nowrap',\n },\n [`.${breadcrumbsClasses.separator}`]: {\n margin: 0,\n padding: 0,\n },\n [`.${breadcrumbsClasses.li}`]: {\n marginLeft: theme.spacing(-0.5),\n [`.${breadcrumbItemClassKey.root}`]: {\n fontSize: 'inherit',\n padding: theme.spacing(0.75),\n paddingLeft: theme.spacing(1.75),\n paddingRight: theme.spacing(1.75),\n marginLeft: theme.spacing(-0.5),\n clipPath: `polygon(calc(100% - ${theme.spacing(\n 1,\n )}) 0px, 100% 50%, calc(100% - ${theme.spacing(\n 1,\n )}) 100%, 0% 100%, ${theme.spacing(1)} 50%, 0% 0%)`,\n\n color: tv.palette.text.primary,\n background: `rgba(${tv.palette.primary.lightChannel} / ${theme.palette.action.hoverOpacity})`,\n [`:hover, .${breadcrumbItemClassKey.hovered}`]: {\n background: `rgba(${tv.palette.primary.lightChannel} / ${theme.palette.action.activatedOpacity})`,\n },\n [`:focus`]: {\n background: `rgba(${tv.palette.primary.lightChannel} / ${theme.palette.action.focusOpacity})`,\n },\n [`:active`]: {\n background: `rgba(${tv.palette.primary.lightChannel} / ${theme.palette.action.activatedOpacity})`,\n },\n },\n\n [':before']: {\n content: '\"\"',\n position: 'absolute',\n top: 0,\n height: '100%',\n width: `calc(${theme.spacing(1)} + 1px)`,\n backgroundColor: tv.palette.divider,\n marginLeft: theme.spacing(-0.5),\n clipPath: `polygon(calc(100% - ${theme.spacing(\n 1,\n )}) 0px, 100% 50%, calc(100% - ${theme.spacing(\n 1,\n )}) 100%, 0% 100%, ${theme.spacing(1)} 50%, 0% 0%)`,\n },\n\n [`:first-of-type .${breadcrumbItemClassKey.root}`]: {\n clipPath: `polygon(calc(100% - ${theme.spacing(\n 1,\n )}) 0px, 100% 50%, calc(100% - ${theme.spacing(\n 1,\n )}) 100%, 0% 100%, 0% 0%, 0% 0%)`,\n },\n\n [[\n `:last-of-type .${breadcrumbItemClassKey.root}`,\n `.${breadcrumbItemClassKey.root} .${breadcrumbItemClassKey.lastItem}`,\n ].join()]: {\n color: tv.palette.text.primary,\n background: `rgba(${tv.palette.secondary.lightChannel} / ${theme.palette.action.selectedOpacity})`,\n [`:hover, ${breadcrumbItemClassKey.hovered}`]: {\n background: `rgba(${tv.palette.secondary.lightChannel} / ${theme.palette.action.activatedOpacity})`,\n },\n [`:focus, .Mui-focusVisible`]: {\n background: `rgba(${tv.palette.secondary.lightChannel} / ${theme.palette.action.focusOpacity})`,\n },\n [`:active`]: {\n background: `rgba(${tv.palette.secondary.lightChannel} / ${theme.palette.action.hoverOpacity})`,\n },\n },\n },\n }\n})\n\nexport interface BreadcrumbItemProps\n extends Partial<\n Omit<\n ButtonBaseProps<'button'>,\n 'onClick' | 'onMouseEnter' | 'onFocusVisible'\n >\n > {\n $id: Aglyn.NodeId\n lastItem?: boolean\n onClick?: (e, node: Aglyn.NodeSchema<any>) => void\n onMouseEnter?: (e, node: Aglyn.NodeSchema<any>) => void\n onFocusVisible?: (e, node: Aglyn.NodeSchema<any>) => void\n}\n\nconst BreadcrumbItem = observer((props: BreadcrumbItemProps) => {\n const {\n children,\n $id,\n lastItem,\n onClick,\n onMouseEnter,\n onFocusVisible,\n ...rest\n } = props\n const node = canvas.getNode($id)\n const isHovered = Besigner.focus.isNodeHovered(node)\n const { setNodeRef: setDroppableNodeRef } = useLeafDrop(\n node,\n undefined,\n DropSurface.BREADCRUMBS,\n )\n\n const handleClick = useCallback(\n (e) => {\n onClick && onClick(e, node)\n },\n [onClick, node],\n )\n\n const handleMouseEnter = useCallback(\n (e) => {\n onMouseEnter && onMouseEnter(e, node)\n },\n [onMouseEnter, node],\n )\n\n const handleFocusVisible = useCallback(\n (e) => {\n onFocusVisible && onFocusVisible(e, node)\n },\n [onFocusVisible, node],\n )\n\n return (\n <MuiButtonBase\n ref={setDroppableNodeRef}\n onClick={handleClick}\n onMouseEnter={handleMouseEnter}\n onFocusVisible={handleFocusVisible}\n className={clsx(breadcrumbItemClassKey.root, {\n [breadcrumbItemClassKey.lastItem]: lastItem,\n [breadcrumbItemClassKey.hovered]: isHovered,\n })}\n {...rest}\n >\n <>\n {node?.labelShort}\n {children}\n </>\n </MuiButtonBase>\n )\n})\n\ninterface BreadcrumbsProps extends Partial<MuiBreadcrumbsProps> {}\n\nconst Breadcrumbs = observer((props: BreadcrumbsProps) => {\n const { children, sx, ...rest } = props\n const lastSelected = Besigner.focus.getLastSelected()\n const selectionCount = Besigner.focus.selectionCount()\n\n const handleClick = useCallback((e, node: Aglyn.NodeSchema<any>) => {\n Besigner.focus.setSelectedNode(node)\n }, [])\n\n const handleMouseEnter = useCallback((e, node: Aglyn.NodeSchema<any>) => {\n Besigner.focus.setHoveredNode(node)\n }, [])\n\n const handleFocusVisible = useCallback((e, node: Aglyn.NodeSchema<any>) => {\n Besigner.focus.setHoveredNode(node)\n }, [])\n\n return (\n <StyledBreadcrumbs\n separator={null}\n aria-label=\"breadcrumb\"\n sx={sx}\n {...rest}\n >\n {lastSelected?.breadcrumbPath.map(($id) => {\n return (\n <BreadcrumbItem\n key={$id}\n $id={$id}\n onClick={handleClick}\n onMouseEnter={handleMouseEnter}\n onFocusVisible={handleFocusVisible}\n lastItem={lastSelected?.$id === $id}\n />\n )\n })}\n {selectionCount > 1 ? (\n <Chip\n label={`+${selectionCount - 1} selected`}\n size=\"small\"\n variant=\"outlined\"\n color=\"primary\"\n sx={{ ml: 0.5, height: 18, fontSize: '0.65rem' }}\n />\n ) : null}\n </StyledBreadcrumbs>\n )\n})\n\nexport interface AppBarBreadcrumbsComponentProps\n extends Partial<MuiAppBarProps> {}\n\nexport const AppBarBreadcrumbsComponent = forwardRef<\n any,\n AppBarBreadcrumbsComponentProps\n>((props, ref) => {\n const { children, sx, ...rest } = props\n\n // This strip is the canvas column's bottom chrome, so it is what a\n // viewport-fixed affordance in that corner would clip (AGL-2486). It\n // publishes its own height as the stand-off a dock launcher reads;\n // measured rather than assumed, because \"24px dense toolbar plus a\n // border\" is exactly the kind of constant that stops being true the\n // first time a chip wraps.\n const stripRef = useRef<HTMLElement | null>(null)\n const setRefs = useCallback(\n (node: HTMLElement | null) => {\n stripRef.current = node\n if (typeof ref === 'function') ref(node)\n else if (ref) (ref as { current: unknown }).current = node\n },\n [ref],\n )\n useEffect(() => {\n const node = stripRef.current\n if (!node) return undefined\n const root = document.documentElement\n const property = '--aglyn-dock-inset-bottom'\n const publish = () => {\n const { height } = node.getBoundingClientRect()\n root.style.setProperty(property, `${Math.round(height) + 20}px`)\n }\n publish()\n // Guarded: jsdom has no ResizeObserver, and the initial publish above\n // is the part that matters — the observer only keeps it honest.\n const observer =\n typeof ResizeObserver === 'undefined' ? null : new ResizeObserver(publish)\n observer?.observe(node)\n return () => {\n observer?.disconnect()\n root.style.removeProperty(property)\n }\n }, [])\n\n return (\n <MuiAppBar\n ref={setRefs}\n id=\"aglyn:besigner-appbar-secondary\"\n {...dropSurfaceProps(DropSurface.BREADCRUMBS)}\n aria-label=\"secondary app toolbar\"\n position=\"static\"\n color=\"surface\"\n component=\"header\"\n elevation={0}\n sx={mergeSxProps(\n {\n top: 0,\n // Stack above the canvas selection overlays (portaled, low z).\n position: 'relative',\n zIndex: 'appBar',\n borderBottomWidth: '1px',\n borderBottomStyle: 'solid',\n borderBottomColor: 'divider',\n [`& .MuiToolbar-root`]: { minHeight: 24 },\n },\n sx,\n )}\n {...rest}\n >\n <MuiToolbar variant=\"dense\" sx={{ px: { xs: 0, sm: 0 } }}>\n <Stack\n direction=\"row\"\n spacing={1}\n sx={{\n alignItems: \"center\",\n justifyContent: \"space-between\",\n width: 1\n }}>\n <Breadcrumbs />\n {children}\n </Stack>\n </MuiToolbar>\n </MuiAppBar>\n );\n})\n\nAppBarBreadcrumbsComponent.displayName = 'AppBarBreadcrumbsComponent'\nAppBarBreadcrumbsComponent.aglyn = true\n\nexport default AppBarBreadcrumbsComponent\n"],"names":["canvas","Besigner","generateComponentClassKeys","mergeSxProps","styled","AppBar","MuiAppBar","Breadcrumbs","MuiBreadcrumbs","breadcrumbsClasses","ButtonBase","MuiButtonBase","Chip","Stack","Toolbar","MuiToolbar","clsx","observer","forwardRef","useCallback","useEffect","useRef","useLeafDrop","DropSurface","dropSurfaceProps","breadcrumbItemClassKey","StyledBreadcrumbs","theme","tv","vars","lineHeight","fontSize","overflowX","ol","flexWrap","whiteSpace","separator","margin","padding","li","marginLeft","spacing","root","paddingLeft","paddingRight","clipPath","color","palette","text","primary","background","lightChannel","action","hoverOpacity","hovered","activatedOpacity","focusOpacity","content","position","top","height","width","backgroundColor","divider","lastItem","join","secondary","selectedOpacity","BreadcrumbItem","props","children","$id","onClick","onMouseEnter","onFocusVisible","rest","node","getNode","isHovered","focus","isNodeHovered","setNodeRef","setDroppableNodeRef","undefined","BREADCRUMBS","handleClick","e","handleMouseEnter","handleFocusVisible","ref","className","labelShort","sx","lastSelected","getLastSelected","selectionCount","setSelectedNode","setHoveredNode","aria-label","breadcrumbPath","map","label","size","variant","ml","AppBarBreadcrumbsComponent","stripRef","setRefs","current","document","documentElement","property","publish","getBoundingClientRect","style","setProperty","Math","round","ResizeObserver","observe","disconnect","removeProperty","id","component","elevation","zIndex","borderBottomWidth","borderBottomStyle","borderBottomColor","minHeight","px","xs","sm","direction","alignItems","justifyContent","displayName","aglyn"],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC;;;AAGD,SAASA,MAAM,QAAQ,eAAc;AACrC,YAAYC,cAAc,kBAAiB;AAC3C,SACEC,0BAA0B,EAC1BC,YAAY,EACZC,MAAM,QACD,yBAAwB;AAC/B,SAEEC,UAAUC,SAAS,EAEnBC,eAAeC,cAAc,EAC7BC,kBAAkB,EAElBC,cAAcC,aAAa,EAE3BC,IAAI,EACJC,KAAK,EACLC,WAAWC,UAAU,QAChB,gBAAe;AACtB,OAAOC,UAAU,OAAM;AACvB,SAASC,QAAQ,QAAQ,kBAAiB;AAC1C,SAASC,UAAU,EAAEC,WAAW,EAAEC,SAAS,EAAEC,MAAM,QAAQ,QAAO;AAClE,OAAOC,iBAAiB,4BAAwB;AAChD,SAASC,WAAW,EAAEC,gBAAgB,QAAQ,wBAAoB;AAElE,MAAMC,yBAAyBvB,2BAA2B,kBAAkB;IAC1E;IACA;IACA;CACD;AAED,MAAMwB,oBAAoBtB,OAAOI,gBAAgB,CAAC,EAAEmB,KAAK,EAAE;IACzD,MAAMC,KAAK,AAACD,MAAcE,IAAI,IAAIF;IAClC,OAAO;QACLG,YAAY;QACZC,UAAU;QACVC,WAAW;QAEX,CAAC,CAAC,CAAC,EAAEvB,mBAAmBwB,EAAE,EAAE,CAAC,EAAE;YAC7BC,UAAU;YACVC,YAAY;QACd;QACA,CAAC,CAAC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YACL,+DAA+D;YAC/DD,UAAU;YACVmE,QAAQ;YACRC,mBAAmB;YACnBC,mBAAmB;YACnBC,mBAAmB;YACnB,CAAC,CAAC,kBAAkB,CAAC,CAAC,EAAE;gBAAEC,WAAW;YAAG;QAC1C,GACArC;OAEEjB;kBAEJ,cAAA,KAAC5D;YAAWwF,SAAQ;YAAQX,IAAI;gBAAEsC,IAAI;oBAAEC,IAAI;oBAAGC,IAAI;gBAAE;YAAE;sBACrD,cAAA,MAACvH;gBACCwH,WAAU;gBACV5F,SAAS;gBACTmD,IAAI;oBACF0C,YAAY;oBACZC,gBAAgB;oBAChB1E,OAAO;gBACT;;kCACA,KAACtD;oBACA+D;;;;;AAKX,GAAE;AAEFmC,2BAA2B+B,WAAW,GAAG;AACzC/B,2BAA2BgC,KAAK,GAAG;AAEnC,eAAehC,2BAA0B"}
|
|
@@ -30,6 +30,7 @@ import { observer } from "mobx-react-lite";
|
|
|
30
30
|
import { forwardRef, useCallback, useEffect } from "react";
|
|
31
31
|
import useAddElementDrawerCallback from "../hooks/use-add-element-drawer-callback.js";
|
|
32
32
|
import useAglynBesignerPanel from "../hooks/use-aglyn-besigner-panel.js";
|
|
33
|
+
import ElementInfoDetails from "./element-info-details.component.js";
|
|
33
34
|
import ElementInteractionsForm from "./element-interactions-form.component.js";
|
|
34
35
|
import ComponentAccordionList from "./component-accordion-list.js";
|
|
35
36
|
import ElementPropsForm from "./element-props-form.component.js";
|
|
@@ -288,11 +289,24 @@ const withTabPanelInner = (Component)=>(props)=>{
|
|
|
288
289
|
const supplied = useBesignerInspectorExtras();
|
|
289
290
|
const inspected = besignerInspected(props.node);
|
|
290
291
|
const extras = inspected ? inspectorExtrasFor(supplied, inspected) : null;
|
|
291
|
-
return /*#__PURE__*/ _jsxs(
|
|
292
|
+
return /*#__PURE__*/ _jsxs(TabPanelInner, {
|
|
293
|
+
sx: {
|
|
294
|
+
pb: 2
|
|
295
|
+
},
|
|
292
296
|
children: [
|
|
293
|
-
/*#__PURE__*/ _jsx(
|
|
297
|
+
/*#__PURE__*/ _jsx(Box, {
|
|
298
|
+
sx: {
|
|
299
|
+
px: 2,
|
|
300
|
+
pt: 2
|
|
301
|
+
},
|
|
302
|
+
children: /*#__PURE__*/ _jsx(ElementPropsForm, _extends({}, props))
|
|
303
|
+
}),
|
|
304
|
+
/*#__PURE__*/ _jsx(ElementInfoDetails, {
|
|
305
|
+
node: props.node
|
|
306
|
+
}),
|
|
294
307
|
extras ? /*#__PURE__*/ _jsx(Box, {
|
|
295
308
|
sx: {
|
|
309
|
+
px: 2,
|
|
296
310
|
pt: 2
|
|
297
311
|
},
|
|
298
312
|
children: extras
|
|
@@ -398,7 +412,9 @@ const panelTabs = {
|
|
|
398
412
|
label: 'Attributes'
|
|
399
413
|
},
|
|
400
414
|
panel: {
|
|
401
|
-
|
|
415
|
+
// Pads its own form and extras, not the whole tab, so the element
|
|
416
|
+
// info accordions between them can run edge to edge.
|
|
417
|
+
Component: withLastSelectedNode(ElementPropsFormWithExtras)
|
|
402
418
|
}
|
|
403
419
|
},
|
|
404
420
|
{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../../../../libs/besigner/feature/designer/src/lib/components/aside-panel.component.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 { canvas, NODE_ROOT_ID } from '@aglyn/aglyn'\nimport * as Besigner from '@aglyn/besigner'\nimport {\n type BesignerPanelKey,\n BesignerPanelTabFlag,\n} from '@aglyn/besigner'\nimport {\n ICON_VARIANT_ELEMENT,\n ICON_VARIANT_ELEMENT_BROWSE,\n ICON_VARIANT_ELEMENT_INTERACTIONS,\n ICON_VARIANT_ELEMENT_PROPERTIES,\n ICON_VARIANT_ELEMENT_STYLES,\n ICON_VARIANT_ELEMENT_TREE_VIEW,\n ICON_VARIANT_MODIFY_ADD,\n} from '@aglyn/shared-data-enums'\nimport { HelpTip, MdiIcon } from '@aglyn/shared-ui-jsx'\nimport { mergeSxProps, styled } from '@aglyn/shared-ui-theme'\nimport {\n getDisplayName,\n numberFromHexadecimal,\n numberToHexadecimal,\n} from '@aglyn/shared-util-tools'\nimport { hoistNonReactStatics } from '@aglyn/shared-util-vendor'\nimport {\n TabContext as MuiTabContext,\n TabList as MuiTabList,\n TabPanel as MuiTabPanel,\n type TabPanelProps as MuiTabPanelProps,\n} from '@mui/lab'\nimport {\n AppBar as MuiAppBar,\n Box,\n Button,\n Chip,\n Stack,\n Tab as MuiTab,\n Typography,\n useMediaQuery,\n useTheme,\n} from '@mui/material'\nimport { observer } from 'mobx-react-lite'\nimport {\n type ComponentType,\n forwardRef,\n type SyntheticEvent,\n useCallback,\n useEffect,\n useMemo,\n useState,\n} from 'react'\nimport useAddElementDrawerCallback from '../hooks/use-add-element-drawer-callback'\nimport useAglynBesignerPanel from '../hooks/use-aglyn-besigner-panel'\nimport AccordionListComponent from './accordion-list.component'\nimport ElementInteractionsForm from './element-interactions-form.component'\nimport ComponentAccordionList from './component-accordion-list'\nimport ElementPropsForm from './element-props-form.component'\nimport ElementStylesForm from './element-styles-form.component'\nimport NodeTreeView, { type NodeTreeViewProps } from './node-tree-view'\nimport SiteThemeColorTokensProvider from './site-theme-color-tokens-provider.component'\nimport { usePublishActiveHostTheme } from '../utils/active-host-theme'\nimport { besignerInspected } from '../contexts/inspected-selection'\nimport {\n type LayoutElementSelection,\n layoutStyleSelection,\n} from '../contexts/layout-style-selection'\nimport {\n inspectorExtrasFor,\n useBesignerInspectorExtras,\n} from '../contexts/inspector-extras-context'\nimport { besignerDocsUrl } from '../utils/docs-help'\nimport WorkspacePanelComponent, {\n type WorkspacePanelComponentProps,\n} from './workspace-panel.component'\n\nconst TabPanel = styled(MuiTabPanel, {\n name: 'AglynTabPanel',\n})<MuiTabPanelProps>({\n padding: 0,\n overflow: 'auto',\n height: '100%',\n})\nconst TabPanelInner = styled('div', {\n name: 'AglynTabPanelInner',\n})(({ theme }) => ({\n width: '100%',\n}))\n\nconst emptyView = (\n <Stack\n direction=\"column\"\n component={TabPanelInner}\n sx={{\n justifyContent: 'center',\n height: 1,\n p: 2,\n }}\n >\n <Typography\n color=\"textSecondary\"\n variant=\"overline\"\n component=\"div\"\n align=\"center\"\n >\n <MdiIcon\n sx={{ opacity: 0.3, fontSize: 80 }}\n path={ICON_VARIANT_ELEMENT.path}\n />\n <div>{'Select an element'}</div>\n </Typography>\n </Stack>\n)\n\n\n/**\n * `Hero · Section` with a `SELECTED` tag — the inspector header the\n * `/product` hero mockup shows (AGL-2175).\n *\n * The right panel had no header at all: three tabs of controls with\n * nothing naming what they act on. On a canvas where clicking a child\n * moves the selection under you, that is the difference between editing\n * the section and editing the heading inside it — and the panel looked\n * identical either way.\n *\n * The second half is the COMPONENT, not a category: `labelShort` is the\n * preset's name (`Hero`) and the schema's is what it actually is\n * (`Section`). They are the same word often enough that it is dropped\n * when it would only repeat itself.\n */\nconst SelectedNodeHeader = observer(\n ({ node }: { node: Besigner.LastSelectedNode }) => {\n const name = node?.labelShort ?? ''\n const component = (node as { componentSchema?: { displayName?: string } })\n ?.componentSchema?.displayName\n const subtitle =\n component && component.toLowerCase() !== name.toLowerCase()\n ? `${name} · ${component}`\n : name\n return (\n <Stack\n direction=\"row\"\n spacing={1}\n sx={{\n alignItems: 'center',\n px: 2,\n py: 1,\n borderBottom: 1,\n borderColor: 'divider',\n }}\n >\n <Typography variant=\"subtitle2\" noWrap sx={{ flex: 1, minWidth: 0 }}>\n {subtitle || 'Element'}\n </Typography>\n <Chip\n size=\"small\"\n variant=\"outlined\"\n color=\"secondary\"\n label=\"SELECTED\"\n sx={{ height: 18, '& .MuiChip-label': { px: 0.75, fontSize: 10 } }}\n />\n </Stack>\n )\n },\n)\nSelectedNodeHeader.displayName = 'SelectedNodeHeader'\n\n/**\n * The panel while a shared-layout element is the target (AGL-3286): named in\n * the header like any selection, and marked as the layout's, styles only.\n */\nconst LayoutElementHeader = ({\n selection,\n}: {\n selection: LayoutElementSelection\n}) => (\n <Stack\n direction=\"row\"\n spacing={1}\n sx={{\n alignItems: 'center',\n px: 2,\n py: 1,\n borderBottom: 1,\n borderColor: 'divider',\n }}\n >\n <Typography variant=\"subtitle2\" noWrap sx={{ flex: 1, minWidth: 0 }}>\n {`${selection.label} · Layout`}\n </Typography>\n <Chip\n size=\"small\"\n variant=\"outlined\"\n color=\"info\"\n label=\"STYLES ONLY\"\n sx={{ height: 18, '& .MuiChip-label': { px: 0.75, fontSize: 10 } }}\n />\n </Stack>\n)\n\n/** What the Attributes and Interactions tabs say about a layout element. */\nconst LayoutElementNote = ({\n selection,\n}: {\n selection: LayoutElementSelection\n}) => (\n <Stack spacing={1.5} sx={{ p: 2 }}>\n <Typography variant=\"body2\" color=\"text.secondary\">\n {`This element belongs to the shared layout${\n selection.layoutName ? ` \"${selection.layoutName}\"` : ''\n }. Its content is edited in the layout itself — use Edit layout above ` +\n 'the canvas. On this page you can change how it looks on the Styles tab.'}\n </Typography>\n <Button\n size=\"small\"\n variant=\"outlined\"\n onClick={() => layoutStyleSelection.clear()}\n >\n {'Back to page elements'}\n </Button>\n </Stack>\n)\n\nfunction withLastSelectedNode<P>(\n WrappedComponent: JSX.ComponentType<P & { node: Besigner.LastSelectedNode }>,\n /**\n * What this tab shows while a layout element is the target (AGL-3286):\n * `styles` hands the wrapped Styles form the screen root and the target;\n * `note` says where the element's content is edited.\n */\n layoutMode: 'styles' | 'note' = 'note',\n) {\n const displayName = getDisplayName(WrappedComponent)\n\n const WithLastSelectedNode = observer((props: P) => {\n const { ...rest } = props\n const layoutTarget = layoutStyleSelection.current\n const selected = Besigner.focus.getLastSelected()\n /**\n * The LIVE node for that selection, re-resolved by id every render\n * (AGL-2486).\n *\n * The focus store holds node OBJECTS, not ids. Anything that replaces the\n * canvas map wholesale — `undo`, `redo`, a co-editing `applyNodes`, a\n * local-draft restore — builds fresh node instances and leaves the store\n * pointing at the pre-restore ones. The panels then read their fields from\n * an orphan and, worse, write back through it: `updateNodeProps` assigns\n * `node.props` on an object the canvas no longer owns, so the edit lands\n * nowhere. Nothing throws and nothing marks the document dirty, so an\n * author sees their new text in the box, an unchanged canvas, and `UP TO\n * DATE` — the reported \"the Text attribute silently discards edits\".\n *\n * Resolving here rather than in the three panels because they share this\n * one seam, and it is `observer`-tracked: `getNode` reads the observable\n * map, so a restore re-renders the panel with the live node instead of\n * leaving stale values in the fields.\n *\n * A node the map no longer has (deleted, or a test node that was never in\n * it) falls back to the stored object, which is exactly today's behaviour\n * for that case — there is no live node to prefer.\n */\n const lastSelected = selected\n ? canvas.getNode(selected.$id) ?? selected\n : selected\n\n if (layoutTarget) {\n // The page's layout overrides are kept on the screen root, so that is\n // the node the Styles form is handed; the target says which slice.\n const root = canvas.getNode(NODE_ROOT_ID)\n return (\n <>\n <LayoutElementHeader selection={layoutTarget} />\n {layoutMode === 'styles' && root ? (\n <WrappedComponent\n node={root}\n {...({ layoutTarget } as any)}\n {...rest}\n />\n ) : (\n <LayoutElementNote selection={layoutTarget} />\n )}\n </>\n )\n }\n\n return (\n <>\n {!lastSelected ? (\n emptyView\n ) : (\n <>\n {/* One header for all three right-panel tabs, so Attributes,\n Styles and Info cannot disagree about what is selected. */}\n <SelectedNodeHeader node={lastSelected} />\n <WrappedComponent node={lastSelected} {...rest} />\n </>\n )}\n </>\n )\n })\n WithLastSelectedNode.displayName = `WithLastSelectedNode(${displayName})`\n hoistNonReactStatics(WithLastSelectedNode, WrappedComponent)\n\n return WithLastSelectedNode\n}\n\nconst withTabPanelInner = (Component: ComponentType<any>) => (props: any) => {\n return (\n <TabPanelInner sx={{ p: 2 }}>\n <Component {...props} />\n </TabPanelInner>\n )\n}\n\n/**\n * The Attributes form with the host app's section beneath it (AGL-2940):\n * whatever `BesignerInspectorExtrasContext` carries, drawn under the\n * selected element's own fields — for that element, when the host supplied\n * a function — and nothing when the host supplied nothing.\n *\n * The selection travels with `editable` (AGL-2908), the same rule the form's\n * own Save as reusable component and Detach actions are drawn under: the\n * canvas root and locked layout chrome answer false. It is read here because\n * a host section has the node and not the editor, and the rule is the drag\n * manager's.\n */\nconst ElementPropsFormWithExtras = (props: any) => {\n const supplied = useBesignerInspectorExtras()\n const inspected = besignerInspected(props.node)\n const extras = inspected ? inspectorExtrasFor(supplied, inspected) : null\n return (\n <>\n <ElementPropsForm {...props} />\n {extras ? <Box sx={{ pt: 2 }}>{extras}</Box> : null}\n </>\n )\n}\n\nconst ElementsTree = forwardRef<any, NodeTreeViewProps>((props, ref) => {\n const handleAddElementClick = useAddElementDrawerCallback()\n return (\n <TabPanelInner sx={{ pl: 0.5 }}>\n <Box\n sx={{\n px: 0.05,\n pb: 1,\n pt: 1,\n display: 'flex',\n alignItems: 'center',\n }}\n >\n <Button\n color=\"primary\"\n startIcon={\n <MdiIcon fontSize=\"inherit\" path={ICON_VARIANT_MODIFY_ADD.path} />\n }\n onClick={() =>\n handleAddElementClick(Besigner.focus.getLastSelected())\n }\n >\n {'Add Element'}\n </Button>\n {/* The hierarchy is the one panel whose rules are not visible in it\n (AGL-2167): which elements accept children, and what dropping on\n an edge does versus dropping in the center. */}\n <HelpTip\n title=\"Drag, drop & hierarchy\"\n excerpt=\"Reparent by dragging here or on the canvas. Containers accept children; dropping on a leaf element makes a sibling instead.\"\n href={besignerDocsUrl('dragDropHierarchy', '#drop-zones-edges-vs-center')}\n sx={{ ml: 'auto', mr: 0.5, fontSize: '0.9em' }}\n />\n </Box>\n <NodeTreeView ref={ref} {...props} />\n </TabPanelInner>\n )\n})\n\nconst panelTabs: Partial<Record<BesignerPanelKey, any>> = {\n panelLeft: {\n defaultTab: BesignerPanelTabFlag.ELEMENTS_TREE,\n panel: {\n id: 'left',\n anchor: 'left',\n 'aria-label': 'left toolbox panel',\n },\n tabs: [\n {\n value: BesignerPanelTabFlag.ELEMENTS_TREE,\n tab: {\n icon: { path: ICON_VARIANT_ELEMENT_TREE_VIEW.path },\n label: 'Hierarchy',\n },\n panel: {\n Component: ElementsTree,\n },\n },\n {\n value: BesignerPanelTabFlag.ELEMENT_BROWSE,\n tab: {\n icon: { path: ICON_VARIANT_ELEMENT_BROWSE.path },\n label: 'Elements',\n },\n panel: {\n Component: ComponentAccordionList,\n },\n },\n ],\n },\n panelRight: {\n // Attributes first and open by default — it is what you reach for on\n // selecting an element. Tab order here is display order only; the flag\n // values are persisted in panel state, so they stay put.\n defaultTab: BesignerPanelTabFlag.ELEMENT_PROPS_FORM,\n panel: {\n id: 'right',\n anchor: 'right',\n 'aria-label': 'right toolbox panel',\n },\n tabs: [\n {\n value: BesignerPanelTabFlag.ELEMENT_PROPS_FORM,\n tab: {\n icon: { path: ICON_VARIANT_ELEMENT_PROPERTIES.path },\n label: 'Attributes',\n },\n panel: {\n Component: withLastSelectedNode(withTabPanelInner(ElementPropsFormWithExtras)),\n },\n },\n {\n value: BesignerPanelTabFlag.ELEMENT_STYLES,\n tab: {\n icon: { path: ICON_VARIANT_ELEMENT_STYLES.path },\n label: 'Styles',\n },\n panel: {\n Component: withLastSelectedNode(ElementStylesForm as any, 'styles'),\n },\n },\n /*\n * Interactions, between Styles and where Info used to be.\n *\n * They lived at the bottom of Attributes, under every field the\n * component declares — below the fold on anything with more than a\n * handful, so an author had no reason to believe the element had any.\n * An interaction is not an attribute: it is a behaviour, authored in a\n * dialog rather than a field, and it belongs beside the styles as a\n * peer.\n *\n * INFO IS GONE. Its two accordions are reference detail about the\n * component and the node's ids — worth having, not worth a tab — and\n * they now sit at the bottom of Attributes, beside the fields they\n * describe. Its flag value stays reserved; panel state is persisted,\n * and a reader whose last session ended on Info would otherwise return\n * to a tab id that means something else.\n */\n {\n value: BesignerPanelTabFlag.ELEMENT_INTERACTIONS,\n tab: {\n icon: { path: ICON_VARIANT_ELEMENT_INTERACTIONS.path },\n label: 'Interactions',\n },\n panel: {\n Component: withLastSelectedNode(\n withTabPanelInner(ElementInteractionsForm as any),\n ),\n },\n },\n ],\n },\n}\n\nexport interface AsidePanelComponentProps extends WorkspacePanelComponentProps {\n panel: BesignerPanelKey\n}\n\nexport const AsidePanelComponent = forwardRef<any, AsidePanelComponentProps>(\n (props, ref) => {\n const { children, panel: panelKey, ...rest } = props\n\n // Republish the page's site theme for surfaces that render OUTSIDE the\n // page tree (AGL-2486). This panel is inside `HostThemeDocumentContext`;\n // the Choose-element dialog — rendered by `withBesignerContext`, which\n // wraps the page — is not, and its element preview was painting the\n // console's brand onto someone else's site.\n usePublishActiveHostTheme()\n\n const [panel, setPanel] = useAglynBesignerPanel(panelKey)\n const {\n panel: { id, ...panelProps },\n defaultTab,\n tabs,\n } = panelTabs[panelKey]\n const { toggled, tab, size } = panel || {}\n const value = tab || defaultTab\n\n // Below `md` there is no room for a docked panel beside the canvas, so\n // the panel overlays it as a temporary drawer instead (AGL-3599): from\n // its own side on a tablet, and as a bottom sheet on a phone, where a\n // side drawer would leave a sliver of canvas nobody can use.\n const theme = useTheme()\n const compact = useMediaQuery(theme.breakpoints.down('md'), {\n noSsr: true,\n })\n const phone = useMediaQuery(theme.breakpoints.down('sm'), { noSsr: true })\n const handleClose = useCallback(\n () => setPanel((prev) => ({ ...prev, toggled: false })),\n [setPanel],\n )\n const handleOpen = useCallback(\n () => setPanel((prev) => ({ ...prev, toggled: true })),\n [setPanel],\n )\n\n // The bottom-right corner belongs to this panel while it is open\n // (AGL-2486), so publish how far a viewport-fixed affordance has to\n // stand off to clear it. A console-dock launcher reads this; the console's\n // own chrome leaves the corner free and never sets it, which is why the\n // variable carries the offset rather than the panel width — an unset\n // variable then means \"the corner is yours\" everywhere else.\n //\n // Kept in an effect on the LIVE panel state so it tracks the author\n // dragging the panel wider or collapsing it, and removed on unmount:\n // navigating from the besigner back into the console must not leave a\n // 395px inset behind on a page with no panel at all.\n // `size` is `string | number` on the panel state, so a numeric width is\n // parsed rather than added to: `'375' + 20` is `'37520'`, which is a\n // perfectly valid CSS length and would park the launcher off-screen.\n const panelWidth = Number.parseFloat(String(size ?? ''))\n // An overlaying drawer owns no corner: it is dismissed before anything\n // under it is reached.\n const rightInset =\n panelKey === 'panelRight' &&\n toggled &&\n !compact &&\n Number.isFinite(panelWidth)\n ? panelWidth + 20\n : null\n useEffect(() => {\n if (panelKey !== 'panelRight') return undefined\n const root = document.documentElement\n const property = '--aglyn-dock-inset-right'\n if (rightInset === null) {\n root.style.removeProperty(property)\n } else {\n root.style.setProperty(property, `${rightInset}px`)\n }\n return () => {\n root.style.removeProperty(property)\n }\n }, [panelKey, rightInset])\n\n const handleTabChange = useCallback(\n (e: SyntheticEvent, val: string) => {\n setPanel((panel) => ({ ...panel, tab: numberFromHexadecimal(val) }))\n },\n [setPanel],\n )\n\n return (\n <WorkspacePanelComponent\n ref={ref}\n id={`aglyn:panel-${id}`}\n aria-label=\"left toolbox panel\"\n size={size}\n open={toggled}\n component=\"aside\"\n temporary={compact}\n temporaryAnchor={phone ? 'bottom' : undefined}\n onClose={handleClose}\n onOpen={handleOpen}\n {...panelProps}\n {...rest}\n >\n <MuiTabContext value={numberToHexadecimal(value)}>\n <Box sx={{ borderBottom: 1, borderColor: 'divider' }}>\n <MuiAppBar\n color=\"surface\"\n position=\"relative\"\n elevation={0}\n enableColorOnDark\n >\n <MuiTabList\n onChange={handleTabChange}\n variant=\"fullWidth\"\n sx={{\n '& .MuiTab-root': {\n '&.Mui-selected': {\n // Use sx string shorthands instead of palette callbacks so the\n // sx system resolves them via theme.vars (CSS custom-property refs)\n // rather than the static light-mode palette values.\n color: 'text.primary',\n backgroundColor: 'background.paper',\n },\n },\n '& .MuiTabs-indicator': {\n top: 0,\n backgroundColor: 'secondary.main',\n },\n }}\n >\n {tabs.map(({ value, tab: { icon, ...tab } }) => (\n <MuiTab\n key={value}\n // color={'tertiary'}\n value={numberToHexadecimal(value)}\n iconPosition=\"top\"\n icon={<MdiIcon {...icon} fontSize=\"small\" />}\n sx={{\n minHeight: 'unset',\n fontSize: (theme) => theme.typography.pxToRem(12),\n lineHeight: 0.8,\n pt: 1,\n }}\n {...tab}\n />\n ))}\n </MuiTabList>\n </MuiAppBar>\n </Box>\n\n {/* Site-theme color tokens (AGL-588): every COLOR_PICKER field\n in these panels — styles panel, attribute forms, email\n blocks — offers the site palette's token references. */}\n <SiteThemeColorTokensProvider>\n {tabs.map(({ value, panel: { Component, ...panel } }) => (\n <TabPanel\n key={value}\n value={numberToHexadecimal(value)}\n {...panel}\n >\n <Component />\n </TabPanel>\n ))}\n </SiteThemeColorTokensProvider>\n </MuiTabContext>\n\n {children}\n </WorkspacePanelComponent>\n )\n },\n)\n\nAsidePanelComponent.displayName = 'AsidePanelComponent'\nAsidePanelComponent.aglyn = true\n\nexport default AsidePanelComponent\n"],"names":["canvas","NODE_ROOT_ID","Besigner","BesignerPanelTabFlag","ICON_VARIANT_ELEMENT","ICON_VARIANT_ELEMENT_BROWSE","ICON_VARIANT_ELEMENT_INTERACTIONS","ICON_VARIANT_ELEMENT_PROPERTIES","ICON_VARIANT_ELEMENT_STYLES","ICON_VARIANT_ELEMENT_TREE_VIEW","ICON_VARIANT_MODIFY_ADD","HelpTip","MdiIcon","styled","getDisplayName","numberFromHexadecimal","numberToHexadecimal","hoistNonReactStatics","TabContext","MuiTabContext","TabList","MuiTabList","TabPanel","MuiTabPanel","AppBar","MuiAppBar","Box","Button","Chip","Stack","Tab","MuiTab","Typography","useMediaQuery","useTheme","observer","forwardRef","useCallback","useEffect","useAddElementDrawerCallback","useAglynBesignerPanel","ElementInteractionsForm","ComponentAccordionList","ElementPropsForm","ElementStylesForm","NodeTreeView","SiteThemeColorTokensProvider","usePublishActiveHostTheme","besignerInspected","layoutStyleSelection","inspectorExtrasFor","useBesignerInspectorExtras","besignerDocsUrl","WorkspacePanelComponent","name","padding","overflow","height","TabPanelInner","theme","width","emptyView","direction","component","sx","justifyContent","p","color","variant","align","opacity","fontSize","path","div","SelectedNodeHeader","node","labelShort","componentSchema","displayName","subtitle","toLowerCase","spacing","alignItems","px","py","borderBottom","borderColor","noWrap","flex","minWidth","size","label","LayoutElementHeader","selection","LayoutElementNote","layoutName","onClick","clear","withLastSelectedNode","WrappedComponent","layoutMode","WithLastSelectedNode","props","rest","layoutTarget","current","selected","focus","getLastSelected","lastSelected","getNode","$id","root","withTabPanelInner","Component","ElementPropsFormWithExtras","supplied","inspected","extras","pt","ElementsTree","ref","handleAddElementClick","pl","pb","display","startIcon","title","excerpt","href","ml","mr","panelTabs","panelLeft","defaultTab","ELEMENTS_TREE","panel","id","anchor","tabs","value","tab","icon","ELEMENT_BROWSE","panelRight","ELEMENT_PROPS_FORM","ELEMENT_STYLES","ELEMENT_INTERACTIONS","AsidePanelComponent","children","panelKey","setPanel","panelProps","toggled","compact","breakpoints","down","noSsr","phone","handleClose","prev","handleOpen","panelWidth","Number","parseFloat","String","rightInset","isFinite","undefined","document","documentElement","property","style","removeProperty","setProperty","handleTabChange","e","val","aria-label","open","temporary","temporaryAnchor","onClose","onOpen","position","elevation","enableColorOnDark","onChange","backgroundColor","top","map","iconPosition","minHeight","typography","pxToRem","lineHeight","aglyn"],"mappings":";;;AAAA;;;;;;;;;;;;;;;CAeC,GAED,SAASA,MAAM,EAAEC,YAAY,QAAQ,eAAc;AACnD,YAAYC,cAAc,kBAAiB;AAC3C,SAEEC,oBAAoB,QACf,kBAAiB;AACxB,SACEC,oBAAoB,EACpBC,2BAA2B,EAC3BC,iCAAiC,EACjCC,+BAA+B,EAC/BC,2BAA2B,EAC3BC,8BAA8B,EAC9BC,uBAAuB,QAClB,2BAA0B;AACjC,SAASC,OAAO,EAAEC,OAAO,QAAQ,uBAAsB;AACvD,SAAuBC,MAAM,QAAQ,yBAAwB;AAC7D,SACEC,cAAc,EACdC,qBAAqB,EACrBC,mBAAmB,QACd,2BAA0B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,kBAAkB;4CAChB,+DAA+D;4CAC/D,oEAAoE;4CACpE,oDAAoD;4CACpDG,OAAO;4CACPyH,iBAAiB;wCACnB;oCACF;oCACA,wBAAwB;wCACtBC,KAAK;wCACLD,iBAAiB;oCACnB;gCACF;0CAECjD,KAAKmD,GAAG,CAAC;wCAAC,EAAElD,KAAK,EAAEC,SAAAA,EAAuB,OAAlB,EAAEC,IAAI,EAAU,SAALD;;;yDAClC,KAAC9G;wCAEC,qBAAqB;wCACrB6G,OAAO5H,oBAAoB4H;wCAC3BmD,cAAa;wCACbjD,oBAAM,KAAClI,sBAAYkI;4CAAMvE,UAAS;;wCAClCP,IAAI;4CACFgI,WAAW;4CACXzH,UAAU,CAACZ,QAAUA,MAAMsI,UAAU,CAACC,OAAO,CAAC;4CAC9CC,YAAY;4CACZ5E,IAAI;wCACN;uCACIsB,MAXCD;;;;;kCAqBf,KAAC9F;kCACE6F,KAAKmD,GAAG,CAAC;gCAAC,EAAElD,KAAK,EAAEJ,WAAAA,EAAgC,OAAzB,EAAEtB,SAAS,EAAY,SAAPsB;;;iDACzC,KAAClH;gCAECsH,OAAO5H,oBAAoB4H;+BACvBJ;0CAEJ,cAAA,KAACtB;gCAJI0B;;;;;YAUZS;;;AAGP,GACD;AAEDD,oBAAoBtE,WAAW,GAAG;AAClCsE,oBAAoBgD,KAAK,GAAG;AAE5B,eAAehD,oBAAmB"}
|
|
1
|
+
{"version":3,"sources":["../../../../../../../../libs/besigner/feature/designer/src/lib/components/aside-panel.component.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 { canvas, NODE_ROOT_ID } from '@aglyn/aglyn'\nimport * as Besigner from '@aglyn/besigner'\nimport {\n type BesignerPanelKey,\n BesignerPanelTabFlag,\n} from '@aglyn/besigner'\nimport {\n ICON_VARIANT_ELEMENT,\n ICON_VARIANT_ELEMENT_BROWSE,\n ICON_VARIANT_ELEMENT_INTERACTIONS,\n ICON_VARIANT_ELEMENT_PROPERTIES,\n ICON_VARIANT_ELEMENT_STYLES,\n ICON_VARIANT_ELEMENT_TREE_VIEW,\n ICON_VARIANT_MODIFY_ADD,\n} from '@aglyn/shared-data-enums'\nimport { HelpTip, MdiIcon } from '@aglyn/shared-ui-jsx'\nimport { mergeSxProps, styled } from '@aglyn/shared-ui-theme'\nimport {\n getDisplayName,\n numberFromHexadecimal,\n numberToHexadecimal,\n} from '@aglyn/shared-util-tools'\nimport { hoistNonReactStatics } from '@aglyn/shared-util-vendor'\nimport {\n TabContext as MuiTabContext,\n TabList as MuiTabList,\n TabPanel as MuiTabPanel,\n type TabPanelProps as MuiTabPanelProps,\n} from '@mui/lab'\nimport {\n AppBar as MuiAppBar,\n Box,\n Button,\n Chip,\n Stack,\n Tab as MuiTab,\n Typography,\n useMediaQuery,\n useTheme,\n} from '@mui/material'\nimport { observer } from 'mobx-react-lite'\nimport {\n type ComponentType,\n forwardRef,\n type SyntheticEvent,\n useCallback,\n useEffect,\n useMemo,\n useState,\n} from 'react'\nimport useAddElementDrawerCallback from '../hooks/use-add-element-drawer-callback'\nimport useAglynBesignerPanel from '../hooks/use-aglyn-besigner-panel'\nimport AccordionListComponent from './accordion-list.component'\nimport ElementInfoDetails from './element-info-details.component'\nimport ElementInteractionsForm from './element-interactions-form.component'\nimport ComponentAccordionList from './component-accordion-list'\nimport ElementPropsForm from './element-props-form.component'\nimport ElementStylesForm from './element-styles-form.component'\nimport NodeTreeView, { type NodeTreeViewProps } from './node-tree-view'\nimport SiteThemeColorTokensProvider from './site-theme-color-tokens-provider.component'\nimport { usePublishActiveHostTheme } from '../utils/active-host-theme'\nimport { besignerInspected } from '../contexts/inspected-selection'\nimport {\n type LayoutElementSelection,\n layoutStyleSelection,\n} from '../contexts/layout-style-selection'\nimport {\n inspectorExtrasFor,\n useBesignerInspectorExtras,\n} from '../contexts/inspector-extras-context'\nimport { besignerDocsUrl } from '../utils/docs-help'\nimport WorkspacePanelComponent, {\n type WorkspacePanelComponentProps,\n} from './workspace-panel.component'\n\nconst TabPanel = styled(MuiTabPanel, {\n name: 'AglynTabPanel',\n})<MuiTabPanelProps>({\n padding: 0,\n overflow: 'auto',\n height: '100%',\n})\nconst TabPanelInner = styled('div', {\n name: 'AglynTabPanelInner',\n})(({ theme }) => ({\n width: '100%',\n}))\n\nconst emptyView = (\n <Stack\n direction=\"column\"\n component={TabPanelInner}\n sx={{\n justifyContent: 'center',\n height: 1,\n p: 2,\n }}\n >\n <Typography\n color=\"textSecondary\"\n variant=\"overline\"\n component=\"div\"\n align=\"center\"\n >\n <MdiIcon\n sx={{ opacity: 0.3, fontSize: 80 }}\n path={ICON_VARIANT_ELEMENT.path}\n />\n <div>{'Select an element'}</div>\n </Typography>\n </Stack>\n)\n\n\n/**\n * `Hero · Section` with a `SELECTED` tag — the inspector header the\n * `/product` hero mockup shows (AGL-2175).\n *\n * The right panel had no header at all: three tabs of controls with\n * nothing naming what they act on. On a canvas where clicking a child\n * moves the selection under you, that is the difference between editing\n * the section and editing the heading inside it — and the panel looked\n * identical either way.\n *\n * The second half is the COMPONENT, not a category: `labelShort` is the\n * preset's name (`Hero`) and the schema's is what it actually is\n * (`Section`). They are the same word often enough that it is dropped\n * when it would only repeat itself.\n */\nconst SelectedNodeHeader = observer(\n ({ node }: { node: Besigner.LastSelectedNode }) => {\n const name = node?.labelShort ?? ''\n const component = (node as { componentSchema?: { displayName?: string } })\n ?.componentSchema?.displayName\n const subtitle =\n component && component.toLowerCase() !== name.toLowerCase()\n ? `${name} · ${component}`\n : name\n return (\n <Stack\n direction=\"row\"\n spacing={1}\n sx={{\n alignItems: 'center',\n px: 2,\n py: 1,\n borderBottom: 1,\n borderColor: 'divider',\n }}\n >\n <Typography variant=\"subtitle2\" noWrap sx={{ flex: 1, minWidth: 0 }}>\n {subtitle || 'Element'}\n </Typography>\n <Chip\n size=\"small\"\n variant=\"outlined\"\n color=\"secondary\"\n label=\"SELECTED\"\n sx={{ height: 18, '& .MuiChip-label': { px: 0.75, fontSize: 10 } }}\n />\n </Stack>\n )\n },\n)\nSelectedNodeHeader.displayName = 'SelectedNodeHeader'\n\n/**\n * The panel while a shared-layout element is the target (AGL-3286): named in\n * the header like any selection, and marked as the layout's, styles only.\n */\nconst LayoutElementHeader = ({\n selection,\n}: {\n selection: LayoutElementSelection\n}) => (\n <Stack\n direction=\"row\"\n spacing={1}\n sx={{\n alignItems: 'center',\n px: 2,\n py: 1,\n borderBottom: 1,\n borderColor: 'divider',\n }}\n >\n <Typography variant=\"subtitle2\" noWrap sx={{ flex: 1, minWidth: 0 }}>\n {`${selection.label} · Layout`}\n </Typography>\n <Chip\n size=\"small\"\n variant=\"outlined\"\n color=\"info\"\n label=\"STYLES ONLY\"\n sx={{ height: 18, '& .MuiChip-label': { px: 0.75, fontSize: 10 } }}\n />\n </Stack>\n)\n\n/** What the Attributes and Interactions tabs say about a layout element. */\nconst LayoutElementNote = ({\n selection,\n}: {\n selection: LayoutElementSelection\n}) => (\n <Stack spacing={1.5} sx={{ p: 2 }}>\n <Typography variant=\"body2\" color=\"text.secondary\">\n {`This element belongs to the shared layout${\n selection.layoutName ? ` \"${selection.layoutName}\"` : ''\n }. Its content is edited in the layout itself — use Edit layout above ` +\n 'the canvas. On this page you can change how it looks on the Styles tab.'}\n </Typography>\n <Button\n size=\"small\"\n variant=\"outlined\"\n onClick={() => layoutStyleSelection.clear()}\n >\n {'Back to page elements'}\n </Button>\n </Stack>\n)\n\nfunction withLastSelectedNode<P>(\n WrappedComponent: JSX.ComponentType<P & { node: Besigner.LastSelectedNode }>,\n /**\n * What this tab shows while a layout element is the target (AGL-3286):\n * `styles` hands the wrapped Styles form the screen root and the target;\n * `note` says where the element's content is edited.\n */\n layoutMode: 'styles' | 'note' = 'note',\n) {\n const displayName = getDisplayName(WrappedComponent)\n\n const WithLastSelectedNode = observer((props: P) => {\n const { ...rest } = props\n const layoutTarget = layoutStyleSelection.current\n const selected = Besigner.focus.getLastSelected()\n /**\n * The LIVE node for that selection, re-resolved by id every render\n * (AGL-2486).\n *\n * The focus store holds node OBJECTS, not ids. Anything that replaces the\n * canvas map wholesale — `undo`, `redo`, a co-editing `applyNodes`, a\n * local-draft restore — builds fresh node instances and leaves the store\n * pointing at the pre-restore ones. The panels then read their fields from\n * an orphan and, worse, write back through it: `updateNodeProps` assigns\n * `node.props` on an object the canvas no longer owns, so the edit lands\n * nowhere. Nothing throws and nothing marks the document dirty, so an\n * author sees their new text in the box, an unchanged canvas, and `UP TO\n * DATE` — the reported \"the Text attribute silently discards edits\".\n *\n * Resolving here rather than in the three panels because they share this\n * one seam, and it is `observer`-tracked: `getNode` reads the observable\n * map, so a restore re-renders the panel with the live node instead of\n * leaving stale values in the fields.\n *\n * A node the map no longer has (deleted, or a test node that was never in\n * it) falls back to the stored object, which is exactly today's behaviour\n * for that case — there is no live node to prefer.\n */\n const lastSelected = selected\n ? canvas.getNode(selected.$id) ?? selected\n : selected\n\n if (layoutTarget) {\n // The page's layout overrides are kept on the screen root, so that is\n // the node the Styles form is handed; the target says which slice.\n const root = canvas.getNode(NODE_ROOT_ID)\n return (\n <>\n <LayoutElementHeader selection={layoutTarget} />\n {layoutMode === 'styles' && root ? (\n <WrappedComponent\n node={root}\n {...({ layoutTarget } as any)}\n {...rest}\n />\n ) : (\n <LayoutElementNote selection={layoutTarget} />\n )}\n </>\n )\n }\n\n return (\n <>\n {!lastSelected ? (\n emptyView\n ) : (\n <>\n {/* One header for all three right-panel tabs, so Attributes,\n Styles and Info cannot disagree about what is selected. */}\n <SelectedNodeHeader node={lastSelected} />\n <WrappedComponent node={lastSelected} {...rest} />\n </>\n )}\n </>\n )\n })\n WithLastSelectedNode.displayName = `WithLastSelectedNode(${displayName})`\n hoistNonReactStatics(WithLastSelectedNode, WrappedComponent)\n\n return WithLastSelectedNode\n}\n\nconst withTabPanelInner = (Component: ComponentType<any>) => (props: any) => {\n return (\n <TabPanelInner sx={{ p: 2 }}>\n <Component {...props} />\n </TabPanelInner>\n )\n}\n\n/**\n * The Attributes form with the host app's section beneath it (AGL-2940):\n * whatever `BesignerInspectorExtrasContext` carries, drawn under the\n * selected element's own fields — for that element, when the host supplied\n * a function — and nothing when the host supplied nothing.\n *\n * The selection travels with `editable` (AGL-2908), the same rule the form's\n * own Save as reusable component and Detach actions are drawn under: the\n * canvas root and locked layout chrome answer false. It is read here because\n * a host section has the node and not the editor, and the rule is the drag\n * manager's.\n */\nconst ElementPropsFormWithExtras = (props: any) => {\n const supplied = useBesignerInspectorExtras()\n const inspected = besignerInspected(props.node)\n const extras = inspected ? inspectorExtrasFor(supplied, inspected) : null\n return (\n <TabPanelInner sx={{ pb: 2 }}>\n <Box sx={{ px: 2, pt: 2 }}>\n <ElementPropsForm {...props} />\n </Box>\n {/* What this element IS: the component's own description and the\n node's ids, in two collapsed accordions. They were a tab of their\n own, which cost every reader a third of the panel's header for\n reference detail most of them never open. Last, and closed, so they\n cost nothing until wanted.\n\n Full width, between the padded form above and the padded extras\n below, the way the Styles panel lays its accordions out. Inside the\n form's padding they were the one pair of accordions in the right\n panel boxed in from both edges. */}\n <ElementInfoDetails node={props.node} />\n {extras ? <Box sx={{ px: 2, pt: 2 }}>{extras}</Box> : null}\n </TabPanelInner>\n )\n}\n\nconst ElementsTree = forwardRef<any, NodeTreeViewProps>((props, ref) => {\n const handleAddElementClick = useAddElementDrawerCallback()\n return (\n <TabPanelInner sx={{ pl: 0.5 }}>\n <Box\n sx={{\n px: 0.05,\n pb: 1,\n pt: 1,\n display: 'flex',\n alignItems: 'center',\n }}\n >\n <Button\n color=\"primary\"\n startIcon={\n <MdiIcon fontSize=\"inherit\" path={ICON_VARIANT_MODIFY_ADD.path} />\n }\n onClick={() =>\n handleAddElementClick(Besigner.focus.getLastSelected())\n }\n >\n {'Add Element'}\n </Button>\n {/* The hierarchy is the one panel whose rules are not visible in it\n (AGL-2167): which elements accept children, and what dropping on\n an edge does versus dropping in the center. */}\n <HelpTip\n title=\"Drag, drop & hierarchy\"\n excerpt=\"Reparent by dragging here or on the canvas. Containers accept children; dropping on a leaf element makes a sibling instead.\"\n href={besignerDocsUrl('dragDropHierarchy', '#drop-zones-edges-vs-center')}\n sx={{ ml: 'auto', mr: 0.5, fontSize: '0.9em' }}\n />\n </Box>\n <NodeTreeView ref={ref} {...props} />\n </TabPanelInner>\n )\n})\n\nconst panelTabs: Partial<Record<BesignerPanelKey, any>> = {\n panelLeft: {\n defaultTab: BesignerPanelTabFlag.ELEMENTS_TREE,\n panel: {\n id: 'left',\n anchor: 'left',\n 'aria-label': 'left toolbox panel',\n },\n tabs: [\n {\n value: BesignerPanelTabFlag.ELEMENTS_TREE,\n tab: {\n icon: { path: ICON_VARIANT_ELEMENT_TREE_VIEW.path },\n label: 'Hierarchy',\n },\n panel: {\n Component: ElementsTree,\n },\n },\n {\n value: BesignerPanelTabFlag.ELEMENT_BROWSE,\n tab: {\n icon: { path: ICON_VARIANT_ELEMENT_BROWSE.path },\n label: 'Elements',\n },\n panel: {\n Component: ComponentAccordionList,\n },\n },\n ],\n },\n panelRight: {\n // Attributes first and open by default — it is what you reach for on\n // selecting an element. Tab order here is display order only; the flag\n // values are persisted in panel state, so they stay put.\n defaultTab: BesignerPanelTabFlag.ELEMENT_PROPS_FORM,\n panel: {\n id: 'right',\n anchor: 'right',\n 'aria-label': 'right toolbox panel',\n },\n tabs: [\n {\n value: BesignerPanelTabFlag.ELEMENT_PROPS_FORM,\n tab: {\n icon: { path: ICON_VARIANT_ELEMENT_PROPERTIES.path },\n label: 'Attributes',\n },\n panel: {\n // Pads its own form and extras, not the whole tab, so the element\n // info accordions between them can run edge to edge.\n Component: withLastSelectedNode(ElementPropsFormWithExtras),\n },\n },\n {\n value: BesignerPanelTabFlag.ELEMENT_STYLES,\n tab: {\n icon: { path: ICON_VARIANT_ELEMENT_STYLES.path },\n label: 'Styles',\n },\n panel: {\n Component: withLastSelectedNode(ElementStylesForm as any, 'styles'),\n },\n },\n /*\n * Interactions, between Styles and where Info used to be.\n *\n * They lived at the bottom of Attributes, under every field the\n * component declares — below the fold on anything with more than a\n * handful, so an author had no reason to believe the element had any.\n * An interaction is not an attribute: it is a behaviour, authored in a\n * dialog rather than a field, and it belongs beside the styles as a\n * peer.\n *\n * INFO IS GONE. Its two accordions are reference detail about the\n * component and the node's ids — worth having, not worth a tab — and\n * they now sit at the bottom of Attributes, beside the fields they\n * describe. Its flag value stays reserved; panel state is persisted,\n * and a reader whose last session ended on Info would otherwise return\n * to a tab id that means something else.\n */\n {\n value: BesignerPanelTabFlag.ELEMENT_INTERACTIONS,\n tab: {\n icon: { path: ICON_VARIANT_ELEMENT_INTERACTIONS.path },\n label: 'Interactions',\n },\n panel: {\n Component: withLastSelectedNode(\n withTabPanelInner(ElementInteractionsForm as any),\n ),\n },\n },\n ],\n },\n}\n\nexport interface AsidePanelComponentProps extends WorkspacePanelComponentProps {\n panel: BesignerPanelKey\n}\n\nexport const AsidePanelComponent = forwardRef<any, AsidePanelComponentProps>(\n (props, ref) => {\n const { children, panel: panelKey, ...rest } = props\n\n // Republish the page's site theme for surfaces that render OUTSIDE the\n // page tree (AGL-2486). This panel is inside `HostThemeDocumentContext`;\n // the Choose-element dialog — rendered by `withBesignerContext`, which\n // wraps the page — is not, and its element preview was painting the\n // console's brand onto someone else's site.\n usePublishActiveHostTheme()\n\n const [panel, setPanel] = useAglynBesignerPanel(panelKey)\n const {\n panel: { id, ...panelProps },\n defaultTab,\n tabs,\n } = panelTabs[panelKey]\n const { toggled, tab, size } = panel || {}\n const value = tab || defaultTab\n\n // Below `md` there is no room for a docked panel beside the canvas, so\n // the panel overlays it as a temporary drawer instead (AGL-3599): from\n // its own side on a tablet, and as a bottom sheet on a phone, where a\n // side drawer would leave a sliver of canvas nobody can use.\n const theme = useTheme()\n const compact = useMediaQuery(theme.breakpoints.down('md'), {\n noSsr: true,\n })\n const phone = useMediaQuery(theme.breakpoints.down('sm'), { noSsr: true })\n const handleClose = useCallback(\n () => setPanel((prev) => ({ ...prev, toggled: false })),\n [setPanel],\n )\n const handleOpen = useCallback(\n () => setPanel((prev) => ({ ...prev, toggled: true })),\n [setPanel],\n )\n\n // The bottom-right corner belongs to this panel while it is open\n // (AGL-2486), so publish how far a viewport-fixed affordance has to\n // stand off to clear it. A console-dock launcher reads this; the console's\n // own chrome leaves the corner free and never sets it, which is why the\n // variable carries the offset rather than the panel width — an unset\n // variable then means \"the corner is yours\" everywhere else.\n //\n // Kept in an effect on the LIVE panel state so it tracks the author\n // dragging the panel wider or collapsing it, and removed on unmount:\n // navigating from the besigner back into the console must not leave a\n // 395px inset behind on a page with no panel at all.\n // `size` is `string | number` on the panel state, so a numeric width is\n // parsed rather than added to: `'375' + 20` is `'37520'`, which is a\n // perfectly valid CSS length and would park the launcher off-screen.\n const panelWidth = Number.parseFloat(String(size ?? ''))\n // An overlaying drawer owns no corner: it is dismissed before anything\n // under it is reached.\n const rightInset =\n panelKey === 'panelRight' &&\n toggled &&\n !compact &&\n Number.isFinite(panelWidth)\n ? panelWidth + 20\n : null\n useEffect(() => {\n if (panelKey !== 'panelRight') return undefined\n const root = document.documentElement\n const property = '--aglyn-dock-inset-right'\n if (rightInset === null) {\n root.style.removeProperty(property)\n } else {\n root.style.setProperty(property, `${rightInset}px`)\n }\n return () => {\n root.style.removeProperty(property)\n }\n }, [panelKey, rightInset])\n\n const handleTabChange = useCallback(\n (e: SyntheticEvent, val: string) => {\n setPanel((panel) => ({ ...panel, tab: numberFromHexadecimal(val) }))\n },\n [setPanel],\n )\n\n return (\n <WorkspacePanelComponent\n ref={ref}\n id={`aglyn:panel-${id}`}\n aria-label=\"left toolbox panel\"\n size={size}\n open={toggled}\n component=\"aside\"\n temporary={compact}\n temporaryAnchor={phone ? 'bottom' : undefined}\n onClose={handleClose}\n onOpen={handleOpen}\n {...panelProps}\n {...rest}\n >\n <MuiTabContext value={numberToHexadecimal(value)}>\n <Box sx={{ borderBottom: 1, borderColor: 'divider' }}>\n <MuiAppBar\n color=\"surface\"\n position=\"relative\"\n elevation={0}\n enableColorOnDark\n >\n <MuiTabList\n onChange={handleTabChange}\n variant=\"fullWidth\"\n sx={{\n '& .MuiTab-root': {\n '&.Mui-selected': {\n // Use sx string shorthands instead of palette callbacks so the\n // sx system resolves them via theme.vars (CSS custom-property refs)\n // rather than the static light-mode palette values.\n color: 'text.primary',\n backgroundColor: 'background.paper',\n },\n },\n '& .MuiTabs-indicator': {\n top: 0,\n backgroundColor: 'secondary.main',\n },\n }}\n >\n {tabs.map(({ value, tab: { icon, ...tab } }) => (\n <MuiTab\n key={value}\n // color={'tertiary'}\n value={numberToHexadecimal(value)}\n iconPosition=\"top\"\n icon={<MdiIcon {...icon} fontSize=\"small\" />}\n sx={{\n minHeight: 'unset',\n fontSize: (theme) => theme.typography.pxToRem(12),\n lineHeight: 0.8,\n pt: 1,\n }}\n {...tab}\n />\n ))}\n </MuiTabList>\n </MuiAppBar>\n </Box>\n\n {/* Site-theme color tokens (AGL-588): every COLOR_PICKER field\n in these panels — styles panel, attribute forms, email\n blocks — offers the site palette's token references. */}\n <SiteThemeColorTokensProvider>\n {tabs.map(({ value, panel: { Component, ...panel } }) => (\n <TabPanel\n key={value}\n value={numberToHexadecimal(value)}\n {...panel}\n >\n <Component />\n </TabPanel>\n ))}\n </SiteThemeColorTokensProvider>\n </MuiTabContext>\n\n {children}\n </WorkspacePanelComponent>\n )\n },\n)\n\nAsidePanelComponent.displayName = 'AsidePanelComponent'\nAsidePanelComponent.aglyn = true\n\nexport default AsidePanelComponent\n"],"names":["canvas","NODE_ROOT_ID","Besigner","BesignerPanelTabFlag","ICON_VARIANT_ELEMENT","ICON_VARIANT_ELEMENT_BROWSE","ICON_VARIANT_ELEMENT_INTERACTIONS","ICON_VARIANT_ELEMENT_PROPERTIES","ICON_VARIANT_ELEMENT_STYLES","ICON_VARIANT_ELEMENT_TREE_VIEW","ICON_VARIANT_MODIFY_ADD","HelpTip","MdiIcon","styled","getDisplayName","numberFromHexadecimal","numberToHexadecimal","hoistNonReactStatics","TabContext","MuiTabContext","TabList","MuiTabList","TabPanel","MuiTabPanel","AppBar","MuiAppBar","Box","Button","Chip","Stack","Tab","MuiTab","Typography","useMediaQuery","useTheme","observer","forwardRef","useCallback","useEffect","useAddElementDrawerCallback","useAglynBesignerPanel","ElementInfoDetails","ElementInteractionsForm","ComponentAccordionList","ElementPropsForm","ElementStylesForm","NodeTreeView","SiteThemeColorTokensProvider","usePublishActiveHostTheme","besignerInspected","layoutStyleSelection","inspectorExtrasFor","useBesignerInspectorExtras","besignerDocsUrl","WorkspacePanelComponent","name","padding","overflow","height","TabPanelInner","theme","width","emptyView","direction","component","sx","justifyContent","p","color","variant","align","opacity","fontSize","path","div","SelectedNodeHeader","node","labelShort","componentSchema","displayName","subtitle","toLowerCase","spacing","alignItems","px","py","borderBottom","borderColor","noWrap","flex","minWidth","size","label","LayoutElementHeader","selection","LayoutElementNote","layoutName","onClick","clear","withLastSelectedNode","WrappedComponent","layoutMode","WithLastSelectedNode","props","rest","layoutTarget","current","selected","focus","getLastSelected","lastSelected","getNode","$id","root","withTabPanelInner","Component","ElementPropsFormWithExtras","supplied","inspected","extras","pb","pt","ElementsTree","ref","handleAddElementClick","pl","display","startIcon","title","excerpt","href","ml","mr","panelTabs","panelLeft","defaultTab","ELEMENTS_TREE","panel","id","anchor","tabs","value","tab","icon","ELEMENT_BROWSE","panelRight","ELEMENT_PROPS_FORM","ELEMENT_STYLES","ELEMENT_INTERACTIONS","AsidePanelComponent","children","panelKey","setPanel","panelProps","toggled","compact","breakpoints","down","noSsr","phone","handleClose","prev","handleOpen","panelWidth","Number","parseFloat","String","rightInset","isFinite","undefined","document","documentElement","property","style","removeProperty","setProperty","handleTabChange","e","val","aria-label","open","temporary","temporaryAnchor","onClose","onOpen","position","elevation","enableColorOnDark","onChange","backgroundColor","top","map","iconPosition","minHeight","typography","pxToRem","lineHeight","aglyn"],"mappings":";;;AAAA;;;;;;;;;;;;;;;CAeC,GAED,SAASA,MAAM,EAAEC,YAAY,QAAQ,eAAc;AACnD,YAAYC,cAAc,kBAAiB;AAC3C,SAEEC,oBAAoB,QACf,kBAAiB;AACxB,SACEC,oBAAoB,EACpBC,2BAA2B,EAC3BC,iCAAiC,EACjCC,+BAA+B,EAC/BC,2BAA2B,EAC3BC,8BAA8B,EAC9BC,uBAAuB,QAClB,2BAA0B;AACjC,SAASC,OAAO,EAAEC,OAAO,QAAQ,uBAAsB;AACvD,SAAuBC,MAAM,QAAQ,yBAAwB;AAC7D,SACEC,cAAc,EACdC,qBAAqB,EACrBC,mBAAmB,QACd,2BAA0B;AACjC,SAASC,oBAAoB,QAAQ,4BAA2B;AAChE,SACEC,cAAcC,aAAa,EAC3BC,WAAWC,UAAU,EACrBC,YAAYC,WAAW,QAElB,WAAU;AACjB,SACEC,UAAUC,SAAS,EACnBC,GAAG,EACHC,MAAM,EACNC,IAAI,EACJC,KAAK,EACLC,OAAOC,MAAM,EACbC,UAAU,EACVC,aAAa,EACbC,QAAQ,QACH,gBAAe;AACtB,SAASC,QAAQ,QAAQ,kBAAiB;AAC1C,SAEEC,UAAU,EAEVC,WAAW,EACXC,SAAS,QAGJ,QAAO;AACd,OAAOC,iCAAiC,8CAA0C;AAClF,OAAOC,2BAA2B,uCAAmC;AAErE,OAAOC,wBAAwB,sCAAkC;AACjE,OAAOC,6BAA6B,2CAAuC;AAC3E,OAAOC,4BAA4B,gCAA4B;AAC/D,OAAOC,sBAAsB,oCAAgC;AAC7D,OAAOC,uBAAuB,qCAAiC;AAC/D,OAAOC,kBAA8C,sBAAkB;AACvE,OAAOC,kCAAkC,kDAA8C;AACvF,SAASC,yBAAyB,QAAQ,gCAA4B;AACtE,SAASC,iB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AAU,CAACZ,QAAUA,MAAMsI,UAAU,CAACC,OAAO,CAAC;4CAC9CC,YAAY;4CACZ3E,IAAI;wCACN;uCACIqB,MAXCD;;;;;kCAqBf,KAAC9F;kCACE6F,KAAKmD,GAAG,CAAC;gCAAC,EAAElD,KAAK,EAAEJ,WAAAA,EAAgC,OAAzB,EAAEtB,SAAS,EAAY,SAAPsB;;;iDACzC,KAACnH;gCAECuH,OAAO7H,oBAAoB6H;+BACvBJ;0CAEJ,cAAA,KAACtB;gCAJI0B;;;;;YAUZS;;;AAGP,GACD;AAEDD,oBAAoBtE,WAAW,GAAG;AAClCsE,oBAAoBgD,KAAK,GAAG;AAE5B,eAAehD,oBAAmB"}
|
|
@@ -15,11 +15,13 @@
|
|
|
15
15
|
* limitations under the License.
|
|
16
16
|
*/ import { _ as _extends } from "@swc/helpers/_/_extends";
|
|
17
17
|
import { _ as _object_without_properties_loose } from "@swc/helpers/_/_object_without_properties_loose";
|
|
18
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
19
|
-
import { DndContext, KeyboardSensor, MeasuringStrategy, PointerSensor,
|
|
18
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
19
|
+
import { DndContext, KeyboardSensor, MeasuringStrategy, PointerSensor, TouchSensor, useDndContext, useSensor, useSensors } from "@dnd-kit/core";
|
|
20
20
|
import { getEventCoordinates } from "@dnd-kit/utilities";
|
|
21
|
+
import { useEffect } from "react";
|
|
21
22
|
import { DndProvider } from "react-dnd";
|
|
22
23
|
import { HTML5Backend } from "react-dnd-html5-backend";
|
|
24
|
+
import { besignerCollisionDetection } from "./dnd/drop-targeting.js";
|
|
23
25
|
export const snapDraggingToCursor = ({ activatorEvent, draggingNodeRect, transform })=>{
|
|
24
26
|
if (draggingNodeRect && activatorEvent) {
|
|
25
27
|
const activatorCoordinates = getEventCoordinates(activatorEvent);
|
|
@@ -58,6 +60,42 @@ NonTouchPointerSensor.activators = PointerSensor.activators.map((activator)=>_ex
|
|
|
58
60
|
delay: 250,
|
|
59
61
|
tolerance: 8
|
|
60
62
|
};
|
|
63
|
+
/**
|
|
64
|
+
* Re-measures every drop target when anything scrolls mid-drag.
|
|
65
|
+
*
|
|
66
|
+
* dnd-kit keeps its rectangles in step with scrolling only for the scroll
|
|
67
|
+
* containers it finds by walking up from each target, and that walk stops at
|
|
68
|
+
* a shadow root. The canvas lives in one, so scrolling the canvas during a
|
|
69
|
+
* drag — by hand, or near an edge — left every canvas target where it had
|
|
70
|
+
* been, and drops resolved against elements that had scrolled away.
|
|
71
|
+
*/ function RemeasureOnScroll() {
|
|
72
|
+
const { active, measureDroppableContainers } = useDndContext();
|
|
73
|
+
const dragging = Boolean(active);
|
|
74
|
+
useEffect(()=>{
|
|
75
|
+
if (!dragging) return;
|
|
76
|
+
let frame = 0;
|
|
77
|
+
const onScroll = ()=>{
|
|
78
|
+
if (frame) return;
|
|
79
|
+
frame = requestAnimationFrame(()=>{
|
|
80
|
+
frame = 0;
|
|
81
|
+
measureDroppableContainers([]);
|
|
82
|
+
});
|
|
83
|
+
};
|
|
84
|
+
const options = {
|
|
85
|
+
capture: true,
|
|
86
|
+
passive: true
|
|
87
|
+
};
|
|
88
|
+
document.addEventListener('scroll', onScroll, options);
|
|
89
|
+
return ()=>{
|
|
90
|
+
document.removeEventListener('scroll', onScroll, options);
|
|
91
|
+
if (frame) cancelAnimationFrame(frame);
|
|
92
|
+
};
|
|
93
|
+
}, [
|
|
94
|
+
dragging,
|
|
95
|
+
measureDroppableContainers
|
|
96
|
+
]);
|
|
97
|
+
return null;
|
|
98
|
+
}
|
|
61
99
|
export function BesignerDndContext(props) {
|
|
62
100
|
const { children, options } = props, rest = _object_without_properties_loose(props, [
|
|
63
101
|
"children",
|
|
@@ -82,18 +120,21 @@ export function BesignerDndContext(props) {
|
|
|
82
120
|
options: opts
|
|
83
121
|
}, rest, {
|
|
84
122
|
debugMode: true,
|
|
85
|
-
children: /*#__PURE__*/
|
|
123
|
+
children: /*#__PURE__*/ _jsxs(DndContext, {
|
|
86
124
|
sensors: sensors,
|
|
87
125
|
modifiers: [
|
|
88
126
|
snapDraggingToCursor
|
|
89
127
|
],
|
|
90
|
-
collisionDetection:
|
|
128
|
+
collisionDetection: besignerCollisionDetection,
|
|
91
129
|
measuring: {
|
|
92
130
|
droppable: {
|
|
93
131
|
strategy: MeasuringStrategy.Always
|
|
94
132
|
}
|
|
95
133
|
},
|
|
96
|
-
children:
|
|
134
|
+
children: [
|
|
135
|
+
/*#__PURE__*/ _jsx(RemeasureOnScroll, {}),
|
|
136
|
+
children
|
|
137
|
+
]
|
|
97
138
|
})
|
|
98
139
|
}));
|
|
99
140
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../../../../libs/besigner/feature/designer/src/lib/components/besigner-dnd-context.component.tsx"],"sourcesContent":["/**\n * @license\n * Copyright 2023 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 type { Modifier } from '@dnd-kit/core'\nimport {\n DndContext,\n KeyboardSensor,\n MeasuringStrategy,\n PointerSensor,\n
|
|
1
|
+
{"version":3,"sources":["../../../../../../../../libs/besigner/feature/designer/src/lib/components/besigner-dnd-context.component.tsx"],"sourcesContent":["/**\n * @license\n * Copyright 2023 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 type { Modifier } from '@dnd-kit/core'\nimport {\n DndContext,\n KeyboardSensor,\n MeasuringStrategy,\n PointerSensor,\n TouchSensor,\n useDndContext,\n useSensor,\n useSensors,\n} from '@dnd-kit/core'\nimport { getEventCoordinates } from '@dnd-kit/utilities'\nimport type { BackendFactory } from 'dnd-core'\nimport { useEffect } from 'react'\nimport { DndProvider } from 'react-dnd'\nimport { HTML5Backend } from 'react-dnd-html5-backend'\nimport { besignerCollisionDetection } from './dnd/drop-targeting'\n\nexport const snapDraggingToCursor: Modifier = ({\n activatorEvent,\n draggingNodeRect,\n transform,\n}) => {\n if (draggingNodeRect && activatorEvent) {\n const activatorCoordinates = getEventCoordinates(activatorEvent)\n if (!activatorCoordinates) return transform\n\n const offsetX = activatorCoordinates.x - draggingNodeRect.left\n const offsetY = activatorCoordinates.y - draggingNodeRect.top\n\n return {\n ...transform,\n x: transform.x + offsetX + 2,\n y: transform.y + offsetY + 2,\n }\n }\n\n return transform\n}\n/**\n * Pointer events cover mouse, pen AND touch, and dnd-kit hands a gesture to\n * whichever sensor's activator claims it first — `pointerdown` always fires\n * before `touchstart`, so a plain PointerSensor would swallow every touch and\n * the TouchSensor's press-and-hold would never run. Declining touch pointers\n * here leaves them to the TouchSensor, which is what lets a finger scroll the\n * palette, the layers tree and the canvas without picking anything up.\n */\nclass NonTouchPointerSensor extends PointerSensor {\n static activators: typeof PointerSensor.activators =\n PointerSensor.activators.map((activator) => ({\n ...activator,\n handler: (event, options) =>\n event.nativeEvent.pointerType !== 'touch' &&\n activator.handler(event, options),\n }))\n}\n\n/**\n * A mouse or pen drag starts after a few pixels of travel, so a click on a\n * drag handle (the overlay's move button, a palette card) stays a click.\n */\nconst POINTER_ACTIVATION = { distance: 6 }\n\n/**\n * A finger drag starts after a short hold; moving further than the tolerance\n * before then is a scroll, and the drag never starts.\n */\nconst TOUCH_ACTIVATION = { delay: 250, tolerance: 8 }\n\n/**\n * Re-measures every drop target when anything scrolls mid-drag.\n *\n * dnd-kit keeps its rectangles in step with scrolling only for the scroll\n * containers it finds by walking up from each target, and that walk stops at\n * a shadow root. The canvas lives in one, so scrolling the canvas during a\n * drag — by hand, or near an edge — left every canvas target where it had\n * been, and drops resolved against elements that had scrolled away.\n */\nfunction RemeasureOnScroll() {\n const { active, measureDroppableContainers } = useDndContext()\n const dragging = Boolean(active)\n useEffect(() => {\n if (!dragging) return\n let frame = 0\n const onScroll = () => {\n if (frame) return\n frame = requestAnimationFrame(() => {\n frame = 0\n measureDroppableContainers([])\n })\n }\n const options = { capture: true, passive: true }\n document.addEventListener('scroll', onScroll, options)\n return () => {\n document.removeEventListener('scroll', onScroll, options)\n if (frame) cancelAnimationFrame(frame)\n }\n }, [dragging, measureDroppableContainers])\n return null\n}\n\nexport interface BesignerDndContextProps<BackendContext, BackendOptions> {\n children?: JSX.Children\n backend?: BackendFactory\n context?: BackendContext\n options?: BackendOptions\n debugMode?: boolean\n}\n\nexport function BesignerDndContext<T, U>(props: BesignerDndContextProps<T, U>) {\n const { children, options, ...rest } = props\n const opts = {\n enableTouchEvents: true,\n enableMouseEvents: true,\n enableKeyboardEvents: true,\n delay: 0,\n delayTouchStart: 0,\n delayMouseStart: 0,\n touchSlop: 0,\n ...options,\n }\n\n const sensors = useSensors(\n useSensor(NonTouchPointerSensor, {\n activationConstraint: POINTER_ACTIVATION,\n }),\n useSensor(TouchSensor, { activationConstraint: TOUCH_ACTIVATION }),\n useSensor(KeyboardSensor),\n )\n\n return (\n <DndProvider backend={HTML5Backend} options={opts} {...rest} debugMode>\n <DndContext\n sensors={sensors}\n modifiers={[snapDraggingToCursor]}\n collisionDetection={besignerCollisionDetection}\n measuring={{\n droppable: {\n strategy: MeasuringStrategy.Always,\n },\n }}\n >\n <RemeasureOnScroll />\n {children}\n </DndContext>\n </DndProvider>\n )\n}\nBesignerDndContext.displayName = 'BesignerDndContext'\nBesignerDndContext.aglyn = true\n\nexport default BesignerDndContext\n"],"names":["DndContext","KeyboardSensor","MeasuringStrategy","PointerSensor","TouchSensor","useDndContext","useSensor","useSensors","getEventCoordinates","useEffect","DndProvider","HTML5Backend","besignerCollisionDetection","snapDraggingToCursor","activatorEvent","draggingNodeRect","transform","activatorCoordinates","offsetX","x","left","offsetY","y","top","NonTouchPointerSensor","activators","map","activator","handler","event","options","nativeEvent","pointerType","POINTER_ACTIVATION","distance","TOUCH_ACTIVATION","delay","tolerance","RemeasureOnScroll","active","measureDroppableContainers","dragging","Boolean","frame","onScroll","requestAnimationFrame","capture","passive","document","addEventListener","removeEventListener","cancelAnimationFrame","BesignerDndContext","props","children","rest","opts","enableTouchEvents","enableMouseEvents","enableKeyboardEvents","delayTouchStart","delayMouseStart","touchSlop","sensors","activationConstraint","backend","debugMode","modifiers","collisionDetection","measuring","droppable","strategy","Always","displayName","aglyn"],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC;;;AAGD,SACEA,UAAU,EACVC,cAAc,EACdC,iBAAiB,EACjBC,aAAa,EACbC,WAAW,EACXC,aAAa,EACbC,SAAS,EACTC,UAAU,QACL,gBAAe;AACtB,SAASC,mBAAmB,QAAQ,qBAAoB;AAExD,SAASC,SAAS,QAAQ,QAAO;AACjC,SAASC,WAAW,QAAQ,YAAW;AACvC,SAASC,YAAY,QAAQ,0BAAyB;AACtD,SAASC,0BAA0B,QAAQ,0BAAsB;AAEjE,OAAO,MAAMC,uBAAiC,CAAC,EAC7CC,cAAc,EACdC,gBAAgB,EAChBC,SAAS,EACV;IACC,IAAID,oBAAoBD,gBAAgB;QACtC,MAAMG,uBAAuBT,oBAAoBM;QACjD,IAAI,CAACG,sBAAsB,OAAOD;QAElC,MAAME,UAAUD,qBAAqBE,CAAC,GAAGJ,iBAAiBK,IAAI;QAC9D,MAAMC,UAAUJ,qBAAqBK,CAAC,GAAGP,iBAAiBQ,GAAG;QAE7D,OAAO,aACFP;YACHG,GAAGH,UAAUG,CAAC,GAAGD,UAAU;YAC3BI,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QAC/BwC,sBAAsB/B;IACxB,IACA3B,UAAUF,aAAa;QAAE4D,sBAAsB7B;IAAiB,IAChE7B,UAAUL;IAGZ,qBACE,KAACS;QAAYuD,SAAStD;QAAcmB,SAAS0B;OAAUD;QAAMW,SAAS;kBACpE,cAAA,MAAClE;YACC+D,SAASA;YACTI,WAAW;gBAACtD;aAAqB;YACjCuD,oBAAoBxD;YACpByD,WAAW;gBACTC,WAAW;oBACTC,UAAUrE,kBAAkBsE,MAAM;gBACpC;YACF;;8BAEA,KAAClC;gBACAgB;;;;AAIT;AACAF,mBAAmBqB,WAAW,GAAG;AACjCrB,mBAAmBsB,KAAK,GAAG;AAE3B,eAAetB,mBAAkB"}
|
|
@@ -14,6 +14,17 @@
|
|
|
14
14
|
* See the License for the specific language governing permissions and
|
|
15
15
|
* limitations under the License.
|
|
16
16
|
*/
|
|
17
|
+
/**
|
|
18
|
+
* The drop marker for every besigner drag — canvas, hierarchy and breadcrumbs.
|
|
19
|
+
*
|
|
20
|
+
* It reads one source for each half of what it draws: the target from
|
|
21
|
+
* dnd-kit's live `over`, the region from the dnd store the workspace fills on
|
|
22
|
+
* every move. It used to keep its own copies, taking the rectangle only when
|
|
23
|
+
* the target changed and the region from a value the workspace wrote onto
|
|
24
|
+
* the target — which this component's listener, registered first, read
|
|
25
|
+
* before the workspace had written it. So the marker showed the region from
|
|
26
|
+
* one move ago, on a rectangle from whenever the target was entered.
|
|
27
|
+
*/
|
|
17
28
|
export declare const CanvasDropIndicator: (() => import("react").JSX.Element) & import("react").NamedExoticComponent<unknown> & {
|
|
18
29
|
readonly type: () => import("react").JSX.Element;
|
|
19
30
|
};
|