@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.
Files changed (65) hide show
  1. package/package.json +17 -17
  2. package/src/lib/components/app-bar-breadcrumbs.component.js +4 -2
  3. package/src/lib/components/app-bar-breadcrumbs.component.js.map +1 -1
  4. package/src/lib/components/aside-panel.component.js +19 -3
  5. package/src/lib/components/aside-panel.component.js.map +1 -1
  6. package/src/lib/components/besigner-dnd-context.component.js +46 -5
  7. package/src/lib/components/besigner-dnd-context.component.js.map +1 -1
  8. package/src/lib/components/dnd/canvas-drop-indicator.d.ts +11 -0
  9. package/src/lib/components/dnd/canvas-drop-indicator.js +32 -34
  10. package/src/lib/components/dnd/canvas-drop-indicator.js.map +1 -1
  11. package/src/lib/components/dnd/draggable-droppable.js +124 -23
  12. package/src/lib/components/dnd/draggable-droppable.js.map +1 -1
  13. package/src/lib/components/dnd/drop-indicator-geometry.d.ts +64 -0
  14. package/src/lib/components/dnd/drop-indicator-geometry.js +77 -0
  15. package/src/lib/components/dnd/drop-indicator-geometry.js.map +1 -0
  16. package/src/lib/components/dnd/drop-indicator.d.ts +13 -11
  17. package/src/lib/components/dnd/drop-indicator.js +52 -63
  18. package/src/lib/components/dnd/drop-indicator.js.map +1 -1
  19. package/src/lib/components/dnd/drop-surface.d.ts +91 -0
  20. package/src/lib/components/dnd/drop-surface.js +172 -0
  21. package/src/lib/components/dnd/drop-surface.js.map +1 -0
  22. package/src/lib/components/dnd/drop-targeting.d.ts +94 -0
  23. package/src/lib/components/dnd/drop-targeting.js +184 -0
  24. package/src/lib/components/dnd/drop-targeting.js.map +1 -0
  25. package/src/lib/components/element-interactions-form.component.js +5 -9
  26. package/src/lib/components/element-interactions-form.component.js.map +1 -1
  27. package/src/lib/components/element-props-form.component.js +0 -4
  28. package/src/lib/components/element-props-form.component.js.map +1 -1
  29. package/src/lib/components/layout-part-menu.component.d.ts +65 -0
  30. package/src/lib/components/layout-part-menu.component.js +151 -0
  31. package/src/lib/components/layout-part-menu.component.js.map +1 -0
  32. package/src/lib/components/layout-style-picker.component.d.ts +2 -0
  33. package/src/lib/components/layout-style-picker.component.js +2 -2
  34. package/src/lib/components/layout-style-picker.component.js.map +1 -1
  35. package/src/lib/components/node-context-menu.js +8 -0
  36. package/src/lib/components/node-context-menu.js.map +1 -1
  37. package/src/lib/components/node-leaf.js +50 -19
  38. package/src/lib/components/node-leaf.js.map +1 -1
  39. package/src/lib/components/node-overlay.js +61 -21
  40. package/src/lib/components/node-overlay.js.map +1 -1
  41. package/src/lib/components/node-quick-actions.js +40 -23
  42. package/src/lib/components/node-quick-actions.js.map +1 -1
  43. package/src/lib/components/node-tree-view.d.ts +2 -0
  44. package/src/lib/components/node-tree-view.js +16 -4
  45. package/src/lib/components/node-tree-view.js.map +1 -1
  46. package/src/lib/components/viewport-canvas.component.js +3 -1
  47. package/src/lib/components/viewport-canvas.component.js.map +1 -1
  48. package/src/lib/components/viewport-frame.component.js +27 -1
  49. package/src/lib/components/viewport-frame.component.js.map +1 -1
  50. package/src/lib/components/workspace-editor.component.js +43 -22
  51. package/src/lib/components/workspace-editor.component.js.map +1 -1
  52. package/src/lib/contexts/layout-chrome-context.d.ts +10 -0
  53. package/src/lib/contexts/layout-chrome-context.js.map +1 -1
  54. package/src/lib/hooks/use-leaf-drop.d.ts +7 -1
  55. package/src/lib/hooks/use-leaf-drop.js +11 -5
  56. package/src/lib/hooks/use-leaf-drop.js.map +1 -1
  57. package/src/lib/hooks/use-preview-repeats.d.ts +22 -0
  58. package/src/lib/hooks/use-preview-repeats.js +91 -0
  59. package/src/lib/hooks/use-preview-repeats.js.map +1 -0
  60. package/src/lib/utils/repeat-copy.d.ts +36 -0
  61. package/src/lib/utils/repeat-copy.js +51 -0
  62. package/src/lib/utils/repeat-copy.js.map +1 -0
  63. package/src/lib/utils/touch-keyboard.d.ts +41 -0
  64. package/src/lib/utils/touch-keyboard.js +72 -0
  65. package/src/lib/utils/touch-keyboard.js.map +1 -0
@@ -0,0 +1,64 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2026 Aglyn LLC
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ import { type DroppableClientRect, DropRegion } from '@aglyn/besigner';
18
+ /** Thickness of the marker's line, in px. */
19
+ export declare const DROP_LINE_WIDTH = 6;
20
+ /** Diameter of the round handle at each end of the line, in px. */
21
+ export declare const DROP_HANDLE_WIDTH: number;
22
+ /**
23
+ * Where a hierarchy row's label starts, in px from the row's left edge, for a
24
+ * drop beside the row (`sibling`) and a drop into it (`child`). The line
25
+ * starts there, so its indent says which level the element lands on.
26
+ */
27
+ export interface DropIndicatorInset {
28
+ sibling?: number;
29
+ child?: number;
30
+ }
31
+ /** The marker's box in viewport px, and whether it is drawn upright. */
32
+ export interface DropIndicatorBox {
33
+ left: number;
34
+ top: number;
35
+ width: number;
36
+ height: number;
37
+ vertical: boolean;
38
+ }
39
+ type Edges = {
40
+ left: number;
41
+ top: number;
42
+ right: number;
43
+ bottom: number;
44
+ };
45
+ export interface DropIndicatorBoxOptions {
46
+ region: DropRegion;
47
+ rect: DroppableClientRect;
48
+ inset?: DropIndicatorInset;
49
+ /** The visible part of the target's surface; the line never leaves it. */
50
+ clip?: Edges | null;
51
+ }
52
+ /**
53
+ * The box the marker occupies for a drop into `region` of `rect`.
54
+ *
55
+ * Every dimension is stated for every region. The previous marker animated
56
+ * only the dimension a region named and left the other at whatever the last
57
+ * region had set, so a line along a top edge drawn just after one down a left
58
+ * edge kept that edge's full height, and the flex layout centred it — the
59
+ * "before" marker turned up across the middle of the element.
60
+ *
61
+ * Returns null when the line would fall entirely outside `clip`.
62
+ */
63
+ export declare function dropIndicatorBox(options: DropIndicatorBoxOptions): DropIndicatorBox | null;
64
+ export {};
@@ -0,0 +1,77 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2026 Aglyn LLC
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */ import { DropRegion } from "@aglyn/besigner";
17
+ /** Thickness of the marker's line, in px. */ export const DROP_LINE_WIDTH = 6;
18
+ /** Diameter of the round handle at each end of the line, in px. */ export const DROP_HANDLE_WIDTH = DROP_LINE_WIDTH + DROP_LINE_WIDTH * 1.27;
19
+ const HALF = DROP_HANDLE_WIDTH / 2;
20
+ /**
21
+ * The box the marker occupies for a drop into `region` of `rect`.
22
+ *
23
+ * Every dimension is stated for every region. The previous marker animated
24
+ * only the dimension a region named and left the other at whatever the last
25
+ * region had set, so a line along a top edge drawn just after one down a left
26
+ * edge kept that edge's full height, and the flex layout centred it — the
27
+ * "before" marker turned up across the middle of the element.
28
+ *
29
+ * Returns null when the line would fall entirely outside `clip`.
30
+ */ export function dropIndicatorBox(options) {
31
+ var _ref, _ref1;
32
+ const { region, rect, inset, clip } = options;
33
+ const right = rect.left + rect.width;
34
+ const bottom = rect.top + rect.height;
35
+ if (region === DropRegion.LEFT || region === DropRegion.RIGHT) {
36
+ const x = region === DropRegion.LEFT ? rect.left : right;
37
+ let y0 = rect.top;
38
+ let y1 = bottom;
39
+ if (clip) {
40
+ if (x < clip.left || x > clip.right) return null;
41
+ y0 = Math.max(y0, clip.top);
42
+ y1 = Math.min(y1, clip.bottom);
43
+ if (y1 < y0) return null;
44
+ }
45
+ return {
46
+ vertical: true,
47
+ left: x - HALF,
48
+ top: y0 - HALF,
49
+ width: DROP_HANDLE_WIDTH,
50
+ height: y1 - y0 + DROP_HANDLE_WIDTH
51
+ };
52
+ }
53
+ const inside = region === DropRegion.CHILDREN;
54
+ const y = region === DropRegion.TOP ? rect.top : region === DropRegion.BOTTOM ? bottom : rect.top + rect.height / 2;
55
+ // Inside is drawn a handle's width in from both ends, so it reads as
56
+ // within the target rather than along its edge.
57
+ let x0 = rect.left + (inside ? ((_ref = inset == null ? void 0 : inset.child) != null ? _ref : 0) + DROP_HANDLE_WIDTH : (_ref1 = inset == null ? void 0 : inset.sibling) != null ? _ref1 : 0);
58
+ let x1 = inside ? right - DROP_HANDLE_WIDTH : right;
59
+ // A deep row in a narrow panel can indent past its own end; keep a stub
60
+ // at the end rather than nothing.
61
+ x0 = Math.min(x0, x1 - DROP_HANDLE_WIDTH);
62
+ if (clip) {
63
+ if (y < clip.top || y > clip.bottom) return null;
64
+ x0 = Math.max(x0, clip.left);
65
+ x1 = Math.min(x1, clip.right);
66
+ if (x1 < x0) return null;
67
+ }
68
+ return {
69
+ vertical: false,
70
+ left: x0 - HALF,
71
+ top: y - HALF,
72
+ width: x1 - x0 + DROP_HANDLE_WIDTH,
73
+ height: DROP_HANDLE_WIDTH
74
+ };
75
+ }
76
+
77
+ //# sourceMappingURL=drop-indicator-geometry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../../../../../libs/besigner/feature/designer/src/lib/components/dnd/drop-indicator-geometry.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2026 Aglyn LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { type DroppableClientRect, DropRegion } from '@aglyn/besigner'\n\n/** Thickness of the marker's line, in px. */\nexport const DROP_LINE_WIDTH = 6\n\n/** Diameter of the round handle at each end of the line, in px. */\nexport const DROP_HANDLE_WIDTH = DROP_LINE_WIDTH + DROP_LINE_WIDTH * 1.27\n\nconst HALF = DROP_HANDLE_WIDTH / 2\n\n/**\n * Where a hierarchy row's label starts, in px from the row's left edge, for a\n * drop beside the row (`sibling`) and a drop into it (`child`). The line\n * starts there, so its indent says which level the element lands on.\n */\nexport interface DropIndicatorInset {\n sibling?: number\n child?: number\n}\n\n/** The marker's box in viewport px, and whether it is drawn upright. */\nexport interface DropIndicatorBox {\n left: number\n top: number\n width: number\n height: number\n vertical: boolean\n}\n\ntype Edges = { left: number; top: number; right: number; bottom: number }\n\nexport interface DropIndicatorBoxOptions {\n region: DropRegion\n rect: DroppableClientRect\n inset?: DropIndicatorInset\n /** The visible part of the target's surface; the line never leaves it. */\n clip?: Edges | null\n}\n\n/**\n * The box the marker occupies for a drop into `region` of `rect`.\n *\n * Every dimension is stated for every region. The previous marker animated\n * only the dimension a region named and left the other at whatever the last\n * region had set, so a line along a top edge drawn just after one down a left\n * edge kept that edge's full height, and the flex layout centred it — the\n * \"before\" marker turned up across the middle of the element.\n *\n * Returns null when the line would fall entirely outside `clip`.\n */\nexport function dropIndicatorBox(\n options: DropIndicatorBoxOptions,\n): DropIndicatorBox | null {\n const { region, rect, inset, clip } = options\n const right = rect.left + rect.width\n const bottom = rect.top + rect.height\n\n if (region === DropRegion.LEFT || region === DropRegion.RIGHT) {\n const x = region === DropRegion.LEFT ? rect.left : right\n let y0 = rect.top\n let y1 = bottom\n if (clip) {\n if (x < clip.left || x > clip.right) return null\n y0 = Math.max(y0, clip.top)\n y1 = Math.min(y1, clip.bottom)\n if (y1 < y0) return null\n }\n return {\n vertical: true,\n left: x - HALF,\n top: y0 - HALF,\n width: DROP_HANDLE_WIDTH,\n height: y1 - y0 + DROP_HANDLE_WIDTH,\n }\n }\n\n const inside = region === DropRegion.CHILDREN\n const y =\n region === DropRegion.TOP\n ? rect.top\n : region === DropRegion.BOTTOM\n ? bottom\n : rect.top + rect.height / 2\n // Inside is drawn a handle's width in from both ends, so it reads as\n // within the target rather than along its edge.\n let x0 =\n rect.left +\n (inside ? (inset?.child ?? 0) + DROP_HANDLE_WIDTH : (inset?.sibling ?? 0))\n let x1 = inside ? right - DROP_HANDLE_WIDTH : right\n // A deep row in a narrow panel can indent past its own end; keep a stub\n // at the end rather than nothing.\n x0 = Math.min(x0, x1 - DROP_HANDLE_WIDTH)\n if (clip) {\n if (y < clip.top || y > clip.bottom) return null\n x0 = Math.max(x0, clip.left)\n x1 = Math.min(x1, clip.right)\n if (x1 < x0) return null\n }\n return {\n vertical: false,\n left: x0 - HALF,\n top: y - HALF,\n width: x1 - x0 + DROP_HANDLE_WIDTH,\n height: DROP_HANDLE_WIDTH,\n }\n}\n"],"names":["DropRegion","DROP_LINE_WIDTH","DROP_HANDLE_WIDTH","HALF","dropIndicatorBox","options","region","rect","inset","clip","right","left","width","bottom","top","height","LEFT","RIGHT","x","y0","y1","Math","max","min","vertical","inside","CHILDREN","y","TOP","BOTTOM","x0","child","sibling","x1"],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC,GAED,SAAmCA,UAAU,QAAQ,kBAAiB;AAEtE,2CAA2C,GAC3C,OAAO,MAAMC,kBAAkB,EAAC;AAEhC,iEAAiE,GACjE,OAAO,MAAMC,oBAAoBD,kBAAkBA,kBAAkB,KAAI;AAEzE,MAAME,OAAOD,oBAAoB;AA+BjC;;;;;;;;;;CAUC,GACD,OAAO,SAASE,iBACdC,OAAgC;;IAEhC,MAAM,EAAEC,MAAM,EAAEC,IAAI,EAAEC,KAAK,EAAEC,IAAI,EAAE,GAAGJ;IACtC,MAAM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EAAE,OAAO;QAC5CiB,KAAKT,KAAKC,GAAG,CAACQ,IAAIrB,KAAKE,IAAI;QAC3BsB,KAAKZ,KAAKE,GAAG,CAACU,IAAIxB,KAAKC,KAAK;QAC5B,IAAIuB,KAAKH,IAAI,OAAO;IACtB;IACA,OAAO;QACLN,UAAU;QACVb,MAAMmB,KAAK3B;QACXW,KAAKa,IAAIxB;QACTS,OAAOqB,KAAKH,KAAK5B;QACjBa,QAAQb;IACV;AACF"}
@@ -14,18 +14,20 @@
14
14
  * See the License for the specific language governing permissions and
15
15
  * limitations under the License.
16
16
  */
17
- import * as Besigner from '@aglyn/besigner';
18
- import { type ClientRect } from '@dnd-kit/core';
19
17
  import type { ComponentProps } from 'react';
20
- declare const Indicator: import("@emotion/styled").StyledComponent<Omit<import("framer-motion").HTMLMotionProps<"div">, "ref"> & import("react").RefAttributes<HTMLDivElement> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme> & {
21
- variant?: "vertical" | "horizontal";
22
- className?: string;
23
- }, {}, {}>;
24
- export interface DropIndicatorProps extends ComponentProps<typeof Indicator> {
25
- visible?: boolean;
26
- rect: ClientRect;
27
- region: Besigner.DropRegion;
28
- className?: string;
18
+ import { type DropIndicatorBox } from './drop-indicator-geometry';
19
+ export interface DropIndicatorProps extends ComponentProps<'div'> {
20
+ /** Where to draw, from `dropIndicatorBox`; null hides the marker. */
21
+ box: DropIndicatorBox | null;
22
+ /** The drop this marks would be refused. */
23
+ rejected?: boolean;
29
24
  }
25
+ /**
26
+ * The line that says where a dragged element will land.
27
+ *
28
+ * Placed, not animated. It used to tween each move over framer-motion's
29
+ * default duration, so it trailed the pointer and swept across the canvas
30
+ * from one target to the next; it now sits exactly where the drop resolves.
31
+ */
30
32
  export declare const DropIndicator: import("react").ForwardRefExoticComponent<Omit<DropIndicatorProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
31
33
  export default DropIndicator;
@@ -16,31 +16,32 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
16
16
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17
17
  * See the License for the specific language governing permissions and
18
18
  * limitations under the License.
19
- */ import * as Besigner from "@aglyn/besigner";
20
- import { generateComponentClassKeys } from "@aglyn/shared-ui-theme";
19
+ */ import { generateComponentClassKeys } from "@aglyn/shared-ui-theme";
21
20
  import { _isEqualitySameType } from "@aglyn/shared-util-tools";
22
21
  import { Portal, styled } from "@mui/material";
23
22
  import clsx from "clsx";
24
- import { motion } from "framer-motion";
25
23
  import { forwardRef } from "react";
24
+ import { DROP_HANDLE_WIDTH, DROP_LINE_WIDTH } from "./drop-indicator-geometry.js";
26
25
  const classes = generateComponentClassKeys('DropIndicator', [
27
26
  'root',
28
27
  'line',
29
- 'handle'
28
+ 'handle',
29
+ 'rejected'
30
30
  ]);
31
- const lineW = 6;
32
- const handleW = lineW + lineW * 1.27;
33
- const handleHalf = handleW / 2;
34
- const Indicator = styled(motion.div, {
31
+ const Indicator = styled('div', {
35
32
  name: 'DropIndicator',
36
- shouldForwardProp: (propName)=>!_isEqualitySameType(propName, null, 'variant', 'visible')
33
+ shouldForwardProp: (propName)=>!_isEqualitySameType(propName, null, 'variant')
37
34
  })(({ theme, variant })=>{
38
35
  const vertical = variant === 'vertical';
39
36
  // In CSS vars mode, theme.palette.* is always the static light values.
40
37
  // Use (theme.vars || theme) so these become live CSS custom-property refs.
41
38
  const tv = theme.vars || theme;
42
39
  return {
43
- position: 'absolute',
40
+ // Viewport px, like the rectangles it is placed from.
41
+ position: 'fixed',
42
+ // Drawn over the pointer, and must never be what the pointer is over:
43
+ // the drop target is hit-tested by what is painted under the pointer.
44
+ pointerEvents: 'none',
44
45
  display: 'flex',
45
46
  flexDirection: vertical ? 'column' : 'row',
46
47
  alignItems: 'center',
@@ -49,75 +50,63 @@ const Indicator = styled(motion.div, {
49
50
  [`& .${classes.line}`]: {
50
51
  // Slate, not the accent (AGL-1194): the indicator is drawn over the
51
52
  // user's design and must not read as part of it.
52
- border: `${lineW / 2}px solid ${tv.palette.tertiary.main}`,
53
+ border: `${DROP_LINE_WIDTH / 2}px solid ${tv.palette.tertiary.main}`,
53
54
  flexGrow: 1,
54
- width: !vertical ? undefined : lineW,
55
- height: !vertical ? lineW : undefined,
55
+ width: !vertical ? undefined : DROP_LINE_WIDTH,
56
+ height: !vertical ? DROP_LINE_WIDTH : undefined,
56
57
  display: 'block',
57
58
  content: '""'
58
59
  },
59
60
  [`& .${classes.handle}`]: {
60
61
  backgroundColor: tv.palette.surface.main,
61
- borderRadius: handleW,
62
+ borderRadius: DROP_HANDLE_WIDTH,
62
63
  border: `1px solid ${tv.palette.tertiary.dark}`,
63
- width: handleW,
64
- height: handleW,
64
+ width: DROP_HANDLE_WIDTH,
65
+ height: DROP_HANDLE_WIDTH,
66
+ flexShrink: 0,
65
67
  display: 'block',
66
68
  content: '""'
67
- }
68
- };
69
- });
70
- export const DropIndicator = /*#__PURE__*/ forwardRef((props, ref)=>{
71
- const { visible, region, rect, className } = props, rest = _object_without_properties_loose(props, [
72
- "visible",
73
- "region",
74
- "rect",
75
- "className"
76
- ]);
77
- const styles = {
78
- [Besigner.DropRegion.LEFT]: {
79
- left: rect.left - handleHalf,
80
- top: rect.top - handleHalf,
81
- height: rect.height + handleW,
82
- width: undefined
83
- },
84
- [Besigner.DropRegion.TOP]: {
85
- left: rect.left - handleHalf,
86
- top: rect.top - handleHalf,
87
- width: rect.width + handleW,
88
- height: undefined
89
69
  },
90
- [Besigner.DropRegion.RIGHT]: {
91
- left: rect.left + rect.width - handleHalf,
92
- top: rect.top - handleHalf,
93
- height: rect.height + handleW,
94
- width: undefined
70
+ // A drop here would be refused (an element that can't hold children, a
71
+ // parent the element isn't allowed in). Said before the drop, rather
72
+ // than by a warning after a marker that looked like any other.
73
+ [`&.${classes.rejected} .${classes.line}`]: {
74
+ borderColor: tv.palette.error.main
95
75
  },
96
- [Besigner.DropRegion.BOTTOM]: {
97
- left: rect.left - handleHalf,
98
- top: rect.top + rect.height - handleHalf,
99
- width: rect.width + handleW,
100
- height: undefined
101
- },
102
- [Besigner.DropRegion.CHILDREN]: {
103
- left: rect.left + handleHalf,
104
- top: rect.top + rect.height / 2 - handleHalf,
105
- width: rect.width - handleW,
106
- height: undefined
76
+ [`&.${classes.rejected} .${classes.handle}`]: {
77
+ borderColor: tv.palette.error.dark
107
78
  }
108
79
  };
109
- const vertical = region === Besigner.DropRegion.LEFT || region === Besigner.DropRegion.RIGHT;
80
+ });
81
+ /**
82
+ * The line that says where a dragged element will land.
83
+ *
84
+ * Placed, not animated. It used to tween each move over framer-motion's
85
+ * default duration, so it trailed the pointer and swept across the canvas
86
+ * from one target to the next; it now sits exactly where the drop resolves.
87
+ */ export const DropIndicator = /*#__PURE__*/ forwardRef((props, ref)=>{
88
+ const { box, rejected, className, style } = props, rest = _object_without_properties_loose(props, [
89
+ "box",
90
+ "rejected",
91
+ "className",
92
+ "style"
93
+ ]);
110
94
  return /*#__PURE__*/ _jsx(Portal, {
111
95
  children: /*#__PURE__*/ _jsxs(Indicator, _extends({
112
96
  ref: ref,
113
- className: clsx(classes.root, className),
114
- variant: vertical ? 'vertical' : 'horizontal',
115
- animate: _extends({}, styles[region], {
116
- visibility: visible ? 'visible' : 'hidden'
117
- }),
118
- transition: {
119
- type: 'keyframes'
120
- }
97
+ "aria-hidden": true,
98
+ className: clsx(classes.root, {
99
+ [classes.rejected]: Boolean(rejected)
100
+ }, className),
101
+ variant: (box == null ? void 0 : box.vertical) ? 'vertical' : 'horizontal',
102
+ style: _extends({}, style, box ? {
103
+ left: box.left,
104
+ top: box.top,
105
+ width: box.width,
106
+ height: box.height
107
+ } : {}, {
108
+ visibility: box ? 'visible' : 'hidden'
109
+ })
121
110
  }, rest, {
122
111
  children: [
123
112
  /*#__PURE__*/ _jsx("div", {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../../../../../libs/besigner/feature/designer/src/lib/components/dnd/drop-indicator.tsx"],"sourcesContent":["/**\n * @license\n * Copyright 2026 Aglyn LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport * as Besigner from '@aglyn/besigner'\nimport { generateComponentClassKeys } from '@aglyn/shared-ui-theme'\nimport { _isEqualitySameType } from '@aglyn/shared-util-tools'\nimport { type ClientRect } from '@dnd-kit/core'\nimport { Portal, styled } from '@mui/material'\nimport clsx from 'clsx'\nimport { motion } from 'framer-motion'\nimport type { ComponentProps } from 'react'\nimport { forwardRef } from 'react'\n\nconst classes = generateComponentClassKeys('DropIndicator', [\n 'root',\n 'line',\n 'handle',\n])\n\ntype IndicatorProps = ComponentProps<typeof motion.div> & {\n variant?: 'vertical' | 'horizontal'\n // framer-motion's HTML prop types omit className; MUI styled() accepts it.\n className?: string\n}\n\nconst lineW = 6\nconst handleW = lineW + lineW * 1.27\nconst handleHalf = handleW / 2\n\nconst Indicator = styled(motion.div, {\n name: 'DropIndicator',\n shouldForwardProp: (propName) =>\n !_isEqualitySameType(propName, null, 'variant', 'visible'),\n})<IndicatorProps>(({ theme, variant }) => {\n const vertical = variant === 'vertical'\n // In CSS vars mode, theme.palette.* is always the static light values.\n // Use (theme.vars || theme) so these become live CSS custom-property refs.\n const tv = (theme as any).vars || theme\n\n return {\n position: 'absolute',\n display: 'flex',\n flexDirection: vertical ? 'column' : 'row',\n alignItems: 'center',\n justifyContent: 'center',\n zIndex: theme.zIndex.modal,\n\n [`& .${classes.line}`]: {\n // Slate, not the accent (AGL-1194): the indicator is drawn over the\n // user's design and must not read as part of it.\n border: `${lineW / 2}px solid ${tv.palette.tertiary.main}`,\n flexGrow: 1,\n width: !vertical ? undefined : lineW,\n height: !vertical ? lineW : undefined,\n display: 'block',\n content: '\"\"',\n },\n [`& .${classes.handle}`]: {\n backgroundColor: tv.palette.surface.main,\n borderRadius: handleW,\n border: `1px solid ${tv.palette.tertiary.dark}`,\n width: handleW,\n height: handleW,\n display: 'block',\n content: '\"\"',\n },\n }\n})\n\nexport interface DropIndicatorProps extends ComponentProps<typeof Indicator> {\n visible?: boolean\n rect: ClientRect\n region: Besigner.DropRegion\n // framer-motion's HTML prop types omit className; MUI styled() accepts it.\n className?: string\n}\n\nexport const DropIndicator = forwardRef<HTMLDivElement, DropIndicatorProps>(\n (props, ref) => {\n const { visible, region, rect, className, ...rest } = props\n\n const styles = {\n [Besigner.DropRegion.LEFT]: {\n left: rect.left - handleHalf,\n top: rect.top - handleHalf,\n height: rect.height + handleW,\n width: undefined,\n },\n [Besigner.DropRegion.TOP]: {\n left: rect.left - handleHalf,\n top: rect.top - handleHalf,\n width: rect.width + handleW,\n height: undefined,\n },\n [Besigner.DropRegion.RIGHT]: {\n left: rect.left + rect.width - handleHalf,\n top: rect.top - handleHalf,\n height: rect.height + handleW,\n width: undefined,\n },\n [Besigner.DropRegion.BOTTOM]: {\n left: rect.left - handleHalf,\n top: rect.top + rect.height - handleHalf,\n width: rect.width + handleW,\n height: undefined,\n },\n [Besigner.DropRegion.CHILDREN]: {\n left: rect.left + handleHalf,\n top: rect.top + rect.height / 2 - handleHalf,\n width: rect.width - handleW,\n height: undefined,\n },\n }\n\n const vertical =\n region === Besigner.DropRegion.LEFT ||\n region === Besigner.DropRegion.RIGHT\n\n return (\n <Portal>\n <Indicator\n ref={ref}\n className={clsx(classes.root, className)}\n variant={vertical ? 'vertical' : 'horizontal'}\n animate={{\n ...styles[region],\n visibility: visible ? 'visible' : 'hidden',\n }}\n transition={{ type: 'keyframes' }}\n {...rest}\n >\n <div className={classes.handle} />\n <div className={classes.line} />\n <div className={classes.handle} />\n </Indicator>\n </Portal>\n )\n },\n)\nDropIndicator.displayName = 'DropIndicator'\n\nexport default DropIndicator\n"],"names":["Besigner","generateComponentClassKeys","_isEqualitySameType","Portal","styled","clsx","motion","forwardRef","classes","lineW","handleW","handleHalf","Indicator","div","name","shouldForwardProp","propName","theme","variant","vertical","tv","vars","position","display","flexDirection","alignItems","justifyContent","zIndex","modal","line","border","palette","tertiary","main","flexGrow","width","undefined","height","content","handle","backgroundColor","surface","borderRadius","dark","DropIndicator","props","ref","visible","region","rect","className","rest","styles","DropRegion","LEFT","left","top","TOP","RIGHT","BOTTOM","CHILDREN","root","animate","visibility","transition","type","displayName"],"mappings":";;;AAAA;;;;;;;;;;;;;;;CAeC,GAED,YAAYA,cAAc,kBAAiB;AAC3C,SAASC,0BAA0B,QAAQ,yBAAwB;AACnE,SAASC,mBAAmB,QAAQ,2BAA0B;AAE9D,SAASC,MAAM,EAAEC,MAAM,QAAQ,gBAAe;AAC9C,OAAOC,UAAU,OAAM;AACvB,SAASC,MAAM,QAAQ,gBAAe;AAEtC,SAASC,UAAU,QAAQ,QAAO;AAElC,MAAMC,UAAUP,2BAA2B,iBAAiB;IAC1D;IACA;IACA;CACD;AAQD,MAAMQ,QAAQ;AACd,MAAMC,UAAUD,QAAQA,QAAQ;AAChC,MAAME,aAAaD,UAAU;AAE7B,MAAME,YAAYR,OAAOE,OAAOO,GAAG,EAAE;IACnCC,MAAM;IACNC,mBAAmB,CAACC,WAClB,CAACd,oBAAoBc,UAAU,MAAM,WAAW;AACpD,GAAmB,CAAC,EAAEC,KAAK,EAAEC,OAAO,EAAE;IACpC,MAAMC,WAAWD,YAAY;IAC7B,uEAAuE;IACvE,2EAA2E;IAC3E,MAAME,KAAK,AAACH,MAAcI,IAAI,IAAIJ;IAElC,OAAO;QACLK,UAAU;QACVC,SAAS;QACTC,eAAeL,WAAW,WAAW;QACrCM,YAAY;QACZC,gBAAgB;QAChBC,QAAQV,MAAMU,MAAM,CAACC,KAAK;QAE1B,CAAC,CAAC,GAAG,EAAEpB,QAAQqB,IAAI,EAAE,CAAC,EAAE;YACtB,oEAAoE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;YACtByB,OAAOC;QACT;QACA,CAACpC,SAASqD,UAAU,CAACM,MAAM,CAAC,EAAE;YAC5BJ,MAAMN,KAAKM,IAAI,GAAG5C;YAClB6C,KAAKP,KAAKO,GAAG,GAAGP,KAAKZ,MAAM,GAAG1B;YAC9BwB,OAAOc,KAAKd,KAAK,GAAGzB;YACpB2B,QAAQD;QACV;QACA,CAACpC,SAASqD,UAAU,CAACO,QAAQ,CAAC,EAAE;YAC9BL,MAAMN,KAAKM,IAAI,GAAG5C;YAClB6C,KAAKP,KAAKO,GAAG,GAAGP,KAAKZ,MAAM,GAAG,IAAI1B;YAClCwB,OAAOc,KAAKd,KAAK,GAAGzB;YACpB2B,QAAQD;QACV;IACF;IAEA,MAAMjB,WACJ6B,WAAWhD,SAASqD,UAAU,CAACC,IAAI,IACnCN,WAAWhD,SAASqD,UAAU,CAACK,KAAK;IAEtC,qBACE,KAACvD;kBACC,cAAA,MAACS;YACCkC,KAAKA;YACLI,WAAW7C,KAAKG,QAAQqD,IAAI,EAAEX;YAC9BhC,SAASC,WAAW,aAAa;YACjC2C,SAAS,aACJV,MAAM,CAACJ,OAAO;gBACjBe,YAAYhB,UAAU,YAAY;;YAEpCiB,YAAY;gBAAEC,MAAM;YAAY;WAC5Bd;;8BAEJ,KAACtC;oBAAIqC,WAAW1C,QAAQ+B,MAAM;;8BAC9B,KAAC1B;oBAAIqC,WAAW1C,QAAQqB,IAAI;;8BAC5B,KAAChB;oBAAIqC,WAAW1C,QAAQ+B,MAAM;;;;;AAItC,GACD;AACDK,cAAcsB,WAAW,GAAG;AAE5B,eAAetB,cAAa"}
1
+ {"version":3,"sources":["../../../../../../../../../libs/besigner/feature/designer/src/lib/components/dnd/drop-indicator.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 { generateComponentClassKeys } from '@aglyn/shared-ui-theme'\nimport { _isEqualitySameType } from '@aglyn/shared-util-tools'\nimport { Portal, styled } from '@mui/material'\nimport clsx from 'clsx'\nimport type { ComponentProps } from 'react'\nimport { forwardRef } from 'react'\nimport {\n DROP_HANDLE_WIDTH,\n DROP_LINE_WIDTH,\n type DropIndicatorBox,\n} from './drop-indicator-geometry'\n\nconst classes = generateComponentClassKeys('DropIndicator', [\n 'root',\n 'line',\n 'handle',\n 'rejected',\n])\n\ntype IndicatorProps = ComponentProps<'div'> & {\n variant?: 'vertical' | 'horizontal'\n}\n\nconst Indicator = styled('div', {\n name: 'DropIndicator',\n shouldForwardProp: (propName) =>\n !_isEqualitySameType(propName, null, 'variant'),\n})<IndicatorProps>(({ theme, variant }) => {\n const vertical = variant === 'vertical'\n // In CSS vars mode, theme.palette.* is always the static light values.\n // Use (theme.vars || theme) so these become live CSS custom-property refs.\n const tv = (theme as any).vars || theme\n\n return {\n // Viewport px, like the rectangles it is placed from.\n position: 'fixed',\n // Drawn over the pointer, and must never be what the pointer is over:\n // the drop target is hit-tested by what is painted under the pointer.\n pointerEvents: 'none',\n display: 'flex',\n flexDirection: vertical ? 'column' : 'row',\n alignItems: 'center',\n justifyContent: 'center',\n zIndex: theme.zIndex.modal,\n\n [`& .${classes.line}`]: {\n // Slate, not the accent (AGL-1194): the indicator is drawn over the\n // user's design and must not read as part of it.\n border: `${DROP_LINE_WIDTH / 2}px solid ${tv.palette.tertiary.main}`,\n flexGrow: 1,\n width: !vertical ? undefined : DROP_LINE_WIDTH,\n height: !vertical ? DROP_LINE_WIDTH : undefined,\n display: 'block',\n content: '\"\"',\n },\n [`& .${classes.handle}`]: {\n backgroundColor: tv.palette.surface.main,\n borderRadius: DROP_HANDLE_WIDTH,\n border: `1px solid ${tv.palette.tertiary.dark}`,\n width: DROP_HANDLE_WIDTH,\n height: DROP_HANDLE_WIDTH,\n flexShrink: 0,\n display: 'block',\n content: '\"\"',\n },\n // A drop here would be refused (an element that can't hold children, a\n // parent the element isn't allowed in). Said before the drop, rather\n // than by a warning after a marker that looked like any other.\n [`&.${classes.rejected} .${classes.line}`]: {\n borderColor: tv.palette.error.main,\n },\n [`&.${classes.rejected} .${classes.handle}`]: {\n borderColor: tv.palette.error.dark,\n },\n }\n})\n\nexport interface DropIndicatorProps extends ComponentProps<'div'> {\n /** Where to draw, from `dropIndicatorBox`; null hides the marker. */\n box: DropIndicatorBox | null\n /** The drop this marks would be refused. */\n rejected?: boolean\n}\n\n/**\n * The line that says where a dragged element will land.\n *\n * Placed, not animated. It used to tween each move over framer-motion's\n * default duration, so it trailed the pointer and swept across the canvas\n * from one target to the next; it now sits exactly where the drop resolves.\n */\nexport const DropIndicator = forwardRef<HTMLDivElement, DropIndicatorProps>(\n (props, ref) => {\n const { box, rejected, className, style, ...rest } = props\n\n return (\n <Portal>\n <Indicator\n ref={ref}\n aria-hidden\n className={clsx(\n classes.root,\n { [classes.rejected]: Boolean(rejected) },\n className,\n )}\n variant={box?.vertical ? 'vertical' : 'horizontal'}\n style={{\n ...style,\n ...(box\n ? {\n left: box.left,\n top: box.top,\n width: box.width,\n height: box.height,\n }\n : {}),\n visibility: box ? 'visible' : 'hidden',\n }}\n {...rest}\n >\n <div className={classes.handle} />\n <div className={classes.line} />\n <div className={classes.handle} />\n </Indicator>\n </Portal>\n )\n },\n)\nDropIndicator.displayName = 'DropIndicator'\n\nexport default DropIndicator\n"],"names":["generateComponentClassKeys","_isEqualitySameType","Portal","styled","clsx","forwardRef","DROP_HANDLE_WIDTH","DROP_LINE_WIDTH","classes","Indicator","name","shouldForwardProp","propName","theme","variant","vertical","tv","vars","position","pointerEvents","display","flexDirection","alignItems","justifyContent","zIndex","modal","line","border","palette","tertiary","main","flexGrow","width","undefined","height","content","handle","backgroundColor","surface","borderRadius","dark","flexShrink","rejected","borderColor","error","DropIndicator","props","ref","box","className","style","rest","aria-hidden","root","Boolean","left","top","visibility","div","displayName"],"mappings":";;;AAAA;;;;;;;;;;;;;;;CAeC,GAED,SAASA,0BAA0B,QAAQ,yBAAwB;AACnE,SAASC,mBAAmB,QAAQ,2BAA0B;AAC9D,SAASC,MAAM,EAAEC,MAAM,QAAQ,gBAAe;AAC9C,OAAOC,UAAU,OAAM;AAEvB,SAASC,UAAU,QAAQ,QAAO;AAClC,SACEC,iBAAiB,EACjBC,eAAe,QAEV,+BAA2B;AAElC,MAAMC,UAAUR,2BAA2B,iBAAiB;IAC1D;IACA;IACA;IACA;CACD;AAMD,MAAMS,YAAYN,OAAO,OAAO;IAC9BO,MAAM;IACNC,mBAAmB,CAACC,WAClB,CAACX,oBAAoBW,UAAU,MAAM;AACzC,GAAmB,CAAC,EAAEC,KAAK,EAAEC,OAAO,EAAE;IACpC,MAAMC,WAAWD,YAAY;IAC7B,uEAAuE;IACvE,2EAA2E;IAC3E,MAAME,KAAK,AAACH,MAAcI,IAAI,IAAIJ;IAElC,OAAO;QACL,sDAAsD;QACtDK,UAAU;QACV,sEAAsE;QACtE,sEAAsE;QACtEC,eAAe;QACfC,SAAS;QACTC,eAAeN,WAAW,WAAW;QACrCO,YAAY;QACZC,gBAAgB;QAChBC,QAAQX,MAAMW,MAAM,CAACC,KAAK;QAE1B,CAAC,CAAC,GAAG,EAAEjB,QAAQkB,IAAI,EAAE,CAAC,EAAE;YACtB,oEAAoE;YACpE,iDAAiD;YACjDC,QAAQ,GAAGpB,kBAAkB,EAAE,SAAS,EAAES,GAAGY,OAAO,CAACC,QAAQ,CAACC,IAAI,EAAE;YACpEC,UAAU;YACVC,OAAO,CAACjB,WAAWkB,YAAY1B;YAC/B2B,QAAQ,CAACnB,WAAWR,kBAAkB0B;YACtCb,SAAS;YACTe,SAAS;QACX;QACA,CAAC,CAAC,GAAG,EAAE3B,QAAQ4B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AEJ,KAACO;oBAAIT,WAAWzC,QAAQ4B,MAAM;;8BAC9B,KAACsB;oBAAIT,WAAWzC,QAAQkB,IAAI;;8BAC5B,KAACgC;oBAAIT,WAAWzC,QAAQ4B,MAAM;;;;;AAItC,GACD;AACDS,cAAcc,WAAW,GAAG;AAE5B,eAAed,cAAa"}
@@ -0,0 +1,91 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2026 Aglyn LLC
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ import type { DropAxis, DroppableClientRect } from '@aglyn/besigner';
18
+ /**
19
+ * The places a drop target can live. Each is one element in the designer,
20
+ * marked with {@link DROP_SURFACE_ATTRIBUTE}, and a drop only ever resolves
21
+ * against targets on the surface the pointer is actually over.
22
+ *
23
+ * That last part is the reason this exists. dnd-kit hit-tests rectangles, and
24
+ * a rectangle knows nothing about what is painted on top of it: a canvas
25
+ * element scrolled under the hierarchy panel, or under the app bar, still
26
+ * "contains" the pointer. So a row being dragged through the hierarchy could
27
+ * resolve against a canvas element nobody could see, and the marker jumped to
28
+ * wherever that element's edge was.
29
+ */
30
+ export declare enum DropSurface {
31
+ CANVAS = "canvas",
32
+ TREE = "tree",
33
+ BREADCRUMBS = "breadcrumbs"
34
+ }
35
+ export declare const DROP_SURFACE_ATTRIBUTE = "data-aglyn-drop-surface";
36
+ /** Props that mark an element as a drop surface. */
37
+ export declare function dropSurfaceProps(surface: DropSurface): {
38
+ "data-aglyn-drop-surface": DropSurface;
39
+ };
40
+ /**
41
+ * The surface an element sits on, climbing out of shadow roots: every canvas
42
+ * element lives inside the canvas's closed shadow root, and `closest` stops at
43
+ * a shadow boundary.
44
+ */
45
+ export declare function closestDropSurface(node: Node | null | undefined): Element | null;
46
+ /**
47
+ * The surface painted at a viewport point: `null` when the pointer is over
48
+ * something that is not one (the app bar, the attributes panel), `undefined`
49
+ * when this document cannot hit-test at all, in which case nothing is ruled
50
+ * out on these grounds.
51
+ */
52
+ export declare function dropSurfaceAtPoint(x: number, y: number, doc?: Document | undefined): Element | null | undefined;
53
+ /**
54
+ * The part of an element that is actually on screen: its rectangle cut down
55
+ * by every ancestor that clips its overflow. The marker is drawn in a portal
56
+ * above everything, so without this a line along a canvas element that runs
57
+ * under a side panel is drawn across the panel.
58
+ */
59
+ export declare function visibleRectOf(element: Element | null | undefined): {
60
+ left: number;
61
+ top: number;
62
+ right: number;
63
+ bottom: number;
64
+ width: number;
65
+ height: number;
66
+ };
67
+ /**
68
+ * The visible rectangle of the named surface that holds `rect`. There is one
69
+ * of each per designer today, but a second hierarchy would be picked by where
70
+ * the target is rather than by document order.
71
+ */
72
+ export declare function visibleSurfaceRect(surface: DropSurface | undefined, rect: DroppableClientRect): {
73
+ left: number;
74
+ top: number;
75
+ right: number;
76
+ bottom: number;
77
+ width: number;
78
+ height: number;
79
+ };
80
+ /**
81
+ * Which way the siblings of a canvas element run, read off the page rather
82
+ * than the schema: a Stack can be a row or a column, a Grid wraps, and a
83
+ * component can lay its children out any way it likes.
84
+ *
85
+ * The neighbours answer first. A sibling BESIDE this element (sharing some of
86
+ * its height, none of its width) means a row; one above or below means a
87
+ * column. Wrapped rows put the previous item on the line above, which is why
88
+ * beside wins whenever either neighbour says so. With no neighbour to ask —
89
+ * an only child — the parent's declared layout decides.
90
+ */
91
+ export declare function flowAxisOf(element: Element | null | undefined): DropAxis;