@aglyn/besigner-ui 1.0.0-beta.292 → 1.0.0-beta.296
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/dnd/draggable-droppable.js +17 -8
- package/src/lib/components/dnd/draggable-droppable.js.map +1 -1
- package/src/lib/components/node-leaf.js +1 -1
- package/src/lib/components/node-leaf.js.map +1 -1
- package/src/lib/components/node-outline.d.ts +0 -6
- package/src/lib/components/node-outline.js +1 -28
- package/src/lib/components/node-outline.js.map +1 -1
- package/src/lib/components/node-overlay.js +14 -65
- package/src/lib/components/node-overlay.js.map +1 -1
- package/src/lib/drafts/besigner-server-draft.d.ts +4 -1
- package/src/lib/drafts/besigner-server-draft.js +6 -3
- package/src/lib/drafts/besigner-server-draft.js.map +1 -1
- package/src/lib/utils/docs-help.generated.d.ts +1 -1
- package/src/lib/utils/docs-help.generated.js +1 -0
- package/src/lib/utils/docs-help.generated.js.map +1 -1
- package/src/lib/utils/repeat-copy.d.ts +45 -9
- package/src/lib/utils/repeat-copy.js +71 -20
- package/src/lib/utils/repeat-copy.js.map +1 -1
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.296",
|
|
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.296",
|
|
29
|
+
"@aglyn/aglyn-markdown-editor": "1.0.0-beta.296",
|
|
30
|
+
"@aglyn/aglyn-node-renderer": "1.0.0-beta.296",
|
|
31
|
+
"@aglyn/besigner": "1.0.0-beta.296",
|
|
32
|
+
"@aglyn/shared-data-enums": "1.0.0-beta.296",
|
|
33
|
+
"@aglyn/shared-data-mdi": "1.0.0-beta.296",
|
|
34
|
+
"@aglyn/shared-data-types": "1.0.0-beta.296",
|
|
35
|
+
"@aglyn/shared-svg-icons": "1.0.0-beta.296",
|
|
36
|
+
"@aglyn/shared-ui-json-editor": "1.0.0-beta.296",
|
|
37
|
+
"@aglyn/shared-ui-jsx": "1.0.0-beta.296",
|
|
38
|
+
"@aglyn/shared-ui-jsx-forms": "1.0.0-beta.296",
|
|
39
|
+
"@aglyn/shared-ui-snackstack": "1.0.0-beta.296",
|
|
40
|
+
"@aglyn/shared-ui-theme": "1.0.0-beta.296",
|
|
41
|
+
"@aglyn/shared-util-dom": "1.0.0-beta.296",
|
|
42
|
+
"@aglyn/shared-util-tools": "1.0.0-beta.296",
|
|
43
|
+
"@aglyn/shared-util-vendor": "1.0.0-beta.296",
|
|
44
44
|
"@dnd-kit/core": "^6.3.1",
|
|
45
45
|
"@dnd-kit/utilities": "^3.2.2",
|
|
46
46
|
"@react-aria/utils": "^3.34.1",
|
|
@@ -31,7 +31,7 @@ import { findInstanceLeafAtPoint, findPlacementPartAtPoint } from "../../utils/i
|
|
|
31
31
|
import { pickPlacementPart } from "../../utils/placement-part-pick.js";
|
|
32
32
|
import { findLeafTextElement } from "../../utils/in-place-edit-surface.js";
|
|
33
33
|
import { holdKeyboardForEdit } from "../../utils/touch-keyboard.js";
|
|
34
|
-
import {
|
|
34
|
+
import { repeatCopyAt, repeatCopyStandIns } from "../../utils/repeat-copy.js";
|
|
35
35
|
import { DropSurface } from "./drop-surface.js";
|
|
36
36
|
/** The furthest a finger may slide and still be tapping, in px. */ const TAP_SLOP_PX = 10;
|
|
37
37
|
/** The longest a press may last and still be a tap, in ms; longer is a hold. */ const TAP_MAX_MS = 300;
|
|
@@ -282,7 +282,7 @@ export const DraggableDroppable = observer((props)=>{
|
|
|
282
282
|
* statement about THAT element, so leaving the previous selection in
|
|
283
283
|
* place would open the wrong menu.
|
|
284
284
|
*/ function handleContextMenu(e) {
|
|
285
|
-
var
|
|
285
|
+
var _ref;
|
|
286
286
|
if (isInlineEditWithin(el)) {
|
|
287
287
|
// An open text editor keeps the browser's own menu: cut, paste and
|
|
288
288
|
// spellcheck are the whole point of a right-click there.
|
|
@@ -291,13 +291,16 @@ export const DraggableDroppable = observer((props)=>{
|
|
|
291
291
|
}
|
|
292
292
|
e.preventDefault();
|
|
293
293
|
e.stopPropagation();
|
|
294
|
-
// On a repeat copy, the menu is the element the copy draws
|
|
295
|
-
|
|
294
|
+
// On a repeat copy, the menu is the element the copy draws, and the
|
|
295
|
+
// selection is outlined on the copy (`repeatCopyStandIns`).
|
|
296
|
+
const copy = repeatCopyAt(e.target);
|
|
297
|
+
const target = (_ref = copy == null ? void 0 : copy.original) != null ? _ref : node;
|
|
296
298
|
Besigner.focus.setSelectedNode(target);
|
|
299
|
+
repeatCopyStandIns.set('selected', copy);
|
|
297
300
|
requestCanvasContextMenu(target == null ? void 0 : target.$id);
|
|
298
301
|
}
|
|
299
302
|
function handleMouseOver(e) {
|
|
300
|
-
var
|
|
303
|
+
var _ref;
|
|
301
304
|
// Same stand-down, same reason to consume it: a hover repaint while
|
|
302
305
|
// the author is typing is a re-render of the subtree they are
|
|
303
306
|
// editing, and an ancestor leaf would repaint for them instead.
|
|
@@ -307,9 +310,13 @@ export const DraggableDroppable = observer((props)=>{
|
|
|
307
310
|
}
|
|
308
311
|
e.preventDefault();
|
|
309
312
|
e.stopPropagation();
|
|
310
|
-
|
|
313
|
+
// On a repeat copy: the element it draws, outlined on the copy.
|
|
314
|
+
const copy = repeatCopyAt(e.target);
|
|
315
|
+
Besigner.focus.setHoveredNode((_ref = copy == null ? void 0 : copy.original) != null ? _ref : node);
|
|
316
|
+
repeatCopyStandIns.set('hovered', copy);
|
|
311
317
|
}
|
|
312
318
|
function handleMouseDown(e) {
|
|
319
|
+
var _ref;
|
|
313
320
|
// Stand down while an edit is open in this leaf OR ANY LEAF INSIDE
|
|
314
321
|
// IT (AGL-2486) — but CONSUME the event rather than ignoring it.
|
|
315
322
|
//
|
|
@@ -340,8 +347,9 @@ export const DraggableDroppable = observer((props)=>{
|
|
|
340
347
|
e.stopPropagation();
|
|
341
348
|
// A press on one of this element's repeat copies (Sam, Jordan) means
|
|
342
349
|
// the element that copy draws, not this one around it — see
|
|
343
|
-
// `
|
|
344
|
-
const
|
|
350
|
+
// `repeatCopyAt`. Its selection is outlined on the copy pressed.
|
|
351
|
+
const copy = repeatCopyAt(e.target);
|
|
352
|
+
const original = (_ref = copy == null ? void 0 : copy.original) != null ? _ref : null;
|
|
345
353
|
const target = original != null ? original : node;
|
|
346
354
|
// Element-picker capture (AGL-574): while the interaction builder is
|
|
347
355
|
// picking, this click resolves the target and exits pick mode —
|
|
@@ -362,6 +370,7 @@ export const DraggableDroppable = observer((props)=>{
|
|
|
362
370
|
pickPartUnder(pointer);
|
|
363
371
|
}
|
|
364
372
|
}
|
|
373
|
+
repeatCopyStandIns.set('selected', copy);
|
|
365
374
|
}
|
|
366
375
|
/**
|
|
367
376
|
* A plain click on a placement (a component instance or a placed form)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../../../../../libs/besigner/feature/designer/src/lib/components/dnd/draggable-droppable.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 {\n canvas,\n components,\n FEATURE_FLAG,\n getInstanceEffectivePropHtml,\n getInstanceEffectivePropText,\n inheritedMediaAlt,\n isDefinitionPlacement,\n listPropFedTextNodeIds,\n placementDefinitionFor,\n resolveInstanceLeafBinding,\n REUSABLE_INSTANCE_COMPONENT_ID,\n REUSABLE_INSTANCE_PROP_VALUES_KEY,\n} from '@aglyn/aglyn'\nimport * as Besigner from '@aglyn/besigner'\nimport { mergeRefs, useId } from '@aglyn/shared-ui-jsx'\nimport { useDraggable, useDroppable } from '@dnd-kit/core'\nimport { CSS as css } from '@dnd-kit/utilities'\nimport { mergeProps } from '@react-aria/utils'\nimport { observer } from 'mobx-react-lite'\nimport {\n Children,\n cloneElement,\n CSSProperties,\n useCallback,\n useContext,\n useEffect,\n useRef,\n useState,\n} from 'react'\nimport ComponentPromotionContext from '../../contexts/component-promotion-context'\nimport { MediaPickerContext } from '../../contexts/media-picker-context'\nimport {\n findMarkdownAttributeName,\n inlineMarkdownEdit,\n} from '../../utils/inline-markdown-edit.store'\nimport {\n inlineTextEdit,\n isInlineEditWithin,\n} from '../../utils/inline-text-edit.store'\nimport { requestCanvasContextMenu } from '../../utils/canvas-context-menu'\nimport {\n findInstanceLeafAtPoint,\n findPlacementPartAtPoint,\n} from '../../utils/instance-leaf-hit'\nimport { pickPlacementPart } from '../../utils/placement-part-pick'\nimport { findLeafTextElement } from '../../utils/in-place-edit-surface'\nimport { holdKeyboardForEdit } from '../../utils/touch-keyboard'\nimport { repeatOriginalAt } from '../../utils/repeat-copy'\nimport { DropSurface } from './drop-surface'\n\n/** A pointer position, from a mouse event or a touch. */\ntype ClientPoint = { clientX: number; clientY: number }\n\n/** A finger's position and the event time it was read at. */\ntype TapPoint = { x: number; y: number; at: number }\n\n/** The furthest a finger may slide and still be tapping, in px. */\nconst TAP_SLOP_PX = 10\n/** The longest a press may last and still be a tap, in ms; longer is a hold. */\nconst TAP_MAX_MS = 300\n/** How soon the second tap of a double-tap must follow the first, in ms. */\nconst DOUBLE_TAP_WITHIN_MS = 350\n/** How far from the first tap the second may land, in px. */\nconst DOUBLE_TAP_SLOP_PX = 24\n\nconst distance = (a: { x: number; y: number }, b: { x: number; y: number }) =>\n Math.hypot(a.x - b.x, a.y - b.y)\n\nexport interface DraggableDroppableProps<T extends Aglyn.NodeSchema<any>> {\n children: JSX.Element\n node: T\n type: Besigner.DragType\n accept: Besigner.DragType[]\n disableDragging?: boolean\n disableDropping?: boolean\n idSuffix?: string\n}\n\nexport const DraggableDroppable = observer(\n <T extends Aglyn.NodeSchema<any>>(props: DraggableDroppableProps<T>) => {\n const {\n node,\n type,\n disableDragging,\n disableDropping,\n accept,\n children,\n idSuffix,\n } = props\n const id = useId(node?.$id)\n const ref = useRef<HTMLElement>(null)\n /**\n * The element as STATE, beside the ref, so the listeners below follow it.\n *\n * A component may render a different element for the same node: a\n * Typography whose text gains a line break holds block content, which a\n * `<p>` cannot, so it re-renders as a `<div>`. The listeners were bound\n * once per node, to the element that was there first, and stayed on the\n * detached `<p>` — a click on the text then reached the parent instead,\n * which selected the Stack around it, and a double-click opened nothing.\n */\n const [element, setElement] = useState<HTMLElement | null>(null)\n // Records a real element only. The merged ref below is a fresh callback\n // every render, so React hands it `null` and then the element on each\n // commit; setting the same element again bails out, a `null` would not.\n const trackElement = useCallback((next: HTMLElement | null) => {\n if (next) setElement(next)\n }, [])\n\n const draggable = useDraggable({\n id: `${id}:${type}${idSuffix || ''}`,\n data: { type, node },\n disabled: disableDragging,\n })\n\n const droppable = useDroppable({\n id: `${id}:${type}${idSuffix || ''}`,\n data: {\n type,\n node,\n accept,\n surface: DropSurface.CANVAS,\n // Measured live by the drop marker: dnd-kit's cached rect cannot\n // follow the canvas scrolling from inside its shadow root.\n getElement: () => ref.current,\n },\n disabled: disableDropping,\n })\n\n const transform = draggable.transform\n const isTransforming = Boolean(draggable.transform)\n const child = Children.only(children)\n const style: CSSProperties = {\n ...child.props.style,\n // cursor: 'move',\n outlineWidth: 2,\n outlineOffset: -1,\n outlineColor: 'grey',\n outlineStyle: 'dotted',\n // transform: css.Transform.toString(transform),\n // scale: css.Scale.toString(transform),\n translate: css.Translate.toString(transform),\n\n ...(isTransforming\n ? {\n // transform: `translate3d(${transform.x}px, ${transform.y}px, 0)`,\n // cursor: 'grab',\n }\n : {}),\n ...(droppable.isOver\n ? {\n outlineColor: 'lime',\n outlineStyle: 'solid',\n outlineOffset: '3',\n }\n : {}),\n ...(draggable.isDragging\n ? {\n outlineColor: 'grey',\n outlineStyle: 'double',\n outlineOffset: -1 as any,\n opacity: 0.5,\n cursor: 'move',\n }\n : {}),\n // Element-picker affordance (AGL-574): while the interaction builder\n // is picking a target, every leaf shows the crosshair and the hovered\n // one gets a distinct violet ring — deliberately unlike the normal\n // selection/drop outlines so \"pick this\" reads as its own mode.\n ...(Besigner.pick.isPicking() ? { cursor: 'crosshair' } : {}),\n ...(Besigner.pick.isPicking() && Besigner.focus.isNodeHovered(node)\n ? {\n outlineColor: '#7c4dff',\n outlineStyle: 'solid',\n outlineWidth: 2,\n outlineOffset: 2 as any,\n }\n : {}),\n }\n\n // Instance-internals double-click (AGL-1304) needs the component\n // definitions (hit-test) and the host's media picker (image props).\n // Read through a ref so the listener effect below keeps its `[node]`\n // dependency — context updates must not re-register DOM listeners.\n const { definitions, formDesigns } = useContext(ComponentPromotionContext)\n const { onPickMedia } = useContext(MediaPickerContext)\n const instanceEditRef = useRef({ definitions, formDesigns, onPickMedia })\n instanceEditRef.current = { definitions, formDesigns, onPickMedia }\n // Same reason: the touch listener below reads the live dnd-kit handlers.\n const listenersRef = useRef(draggable.listeners)\n listenersRef.current = draggable.listeners\n\n useEffect(() => {\n Besigner.refs.set(node.$id, ref)\n return () => {\n Besigner.refs.delete(node.$id)\n }\n }, [node?.$id])\n\n useEffect(() => {\n Besigner.handles.set(node.$id, {\n ...draggable.listeners,\n style: isTransforming ? { cursor: 'grab' } : { cursor: 'move' },\n })\n return () => {\n Besigner.handles.delete(node.$id)\n }\n }, [node.$id, draggable.listeners, isTransforming])\n\n useEffect(() => {\n const el = ref.current\n /**\n * Whether this element was already selected when the latest press on\n * it began. Read by the touch drag below, and reset by it, because the\n * press that selects an element must not also pick it up.\n */\n let selectedAtPress = false\n /** Where and when the finger on this element came down. */\n let pressStart: TapPoint | null = null\n /** The last quick, still tap on this element, waiting for its pair. */\n let lastTap: TapPoint | null = null\n /** When a double-tap opened an editor here, by event time. */\n let editOpenedByTapAt = -Infinity\n if (el) {\n el.addEventListener('mouseover', handleMouseOver)\n el.addEventListener('pointerover', handleMouseOver)\n el.addEventListener('mousedown', handleMouseDown)\n el.addEventListener('pointerdown', handleMouseDown)\n el.addEventListener('dblclick', handleDoubleClick)\n el.addEventListener('contextmenu', handleContextMenu)\n el.addEventListener('touchstart', handleTouchStart)\n el.addEventListener('touchend', handleTouchEnd)\n\n return () => {\n el.removeEventListener('mouseover', handleMouseOver)\n el.removeEventListener('pointerover', handleMouseOver)\n el.removeEventListener('mousedown', handleMouseDown)\n el.removeEventListener('pointerdown', handleMouseDown)\n el.removeEventListener('dblclick', handleDoubleClick)\n el.removeEventListener('contextmenu', handleContextMenu)\n el.removeEventListener('touchstart', handleTouchStart)\n el.removeEventListener('touchend', handleTouchEnd)\n }\n }\n /**\n * Press and hold a selected element to drag it on a touch screen.\n *\n * The element itself has never been a drag source: a mouse drags it by\n * the grip in its toolbar, and on a mouse that costs nothing, because a\n * press on the body selects it and the page stays put. A finger pressing\n * the body scrolls the page instead, which is what an author trying to\n * move the element saw. Handing the press to dnd-kit's TouchSensor\n * keeps a swipe a scroll — the sensor waits for a still hold before it\n * takes over — and makes a hold a drag.\n *\n * Native, like its neighbours: the canvas is a closed shadow root, so a\n * React `onTouchStart` would never fire. The sensor reads only\n * `nativeEvent`, and marks it, so an ancestor that is also selected\n * cannot claim the same touch.\n */\n function handleTouchStart(e: TouchEvent) {\n const touch = e.touches.length === 1 ? e.touches[0] : undefined\n pressStart = touch\n ? { x: touch.clientX, y: touch.clientY, at: e.timeStamp }\n : null\n const selected = selectedAtPress\n selectedAtPress = false\n if (!selected || isInlineEditWithin(el) || Besigner.pick.isPicking()) {\n return\n }\n listenersRef.current?.onTouchStart?.({ nativeEvent: e } as any)\n }\n /**\n * Double-tap a text element to edit it in place on a touch screen.\n *\n * A mouse gets there by `dblclick`, and on a touch screen that event is\n * the browser's to give. Chrome on Android turns two taps into one; on\n * a phone the in-place editor, and the B / I / U toolbar that comes\n * with it, did not open. So the two taps are counted here, by rules\n * that are this canvas's own rather than each browser's, and the same\n * open runs.\n *\n * Opening this way also puts the keyboard up (`holdKeyboardForEdit`),\n * which iOS only allows while the tap is still being handled — and the\n * `preventDefault` keeps Safari from zooming on the second tap, or\n * sending the `dblclick` Chrome would have sent after it.\n *\n * Two taps make a double-tap when each is quick and still, and the\n * second lands near the first soon after it. A hold is a drag, a slide\n * is a scroll, and neither counts.\n */\n function handleTouchEnd(e: TouchEvent) {\n const start = pressStart\n pressStart = null\n const touch = e.changedTouches[0]\n if (\n !start ||\n !touch ||\n e.touches.length > 0 ||\n // Inside an open edit, a double-tap selects a word.\n isInlineEditWithin(el) ||\n Besigner.pick.isPicking()\n ) {\n lastTap = null\n return\n }\n const tap = { x: touch.clientX, y: touch.clientY, at: e.timeStamp }\n if (\n distance(tap, start) > TAP_SLOP_PX ||\n tap.at - start.at > TAP_MAX_MS\n ) {\n lastTap = null\n return\n }\n const first = lastTap\n lastTap = tap\n if (\n !first ||\n tap.at - first.at > DOUBLE_TAP_WITHIN_MS ||\n distance(tap, first) > DOUBLE_TAP_SLOP_PX\n ) {\n return\n }\n lastTap = null\n if (!openEditAt({ clientX: tap.x, clientY: tap.y })) return\n e.preventDefault()\n e.stopPropagation()\n editOpenedByTapAt = e.timeStamp\n // A prop-fed image opens the media picker instead, which wants no\n // keyboard.\n if (inlineTextEdit.node || inlineMarkdownEdit.node) {\n holdKeyboardForEdit(tap)\n }\n }\n /**\n * Right-click opens this element's ⋮ menu (AGL-1405).\n *\n * A native listener like its neighbours, not an `onContextMenu` prop:\n * React delegates at the root container and the canvas is a closed\n * shadow root, so a delegated handler never sees the event.\n *\n * Selects first. The menu is rendered by the overlay, which only mounts\n * for a selected or hovered node — and right-clicking an element is a\n * statement about THAT element, so leaving the previous selection in\n * place would open the wrong menu.\n */\n function handleContextMenu(e: Event) {\n if (isInlineEditWithin(el)) {\n // An open text editor keeps the browser's own menu: cut, paste and\n // spellcheck are the whole point of a right-click there.\n e.stopPropagation()\n return\n }\n e.preventDefault()\n e.stopPropagation()\n // On a repeat copy, the menu is the element the copy draws.\n const target = repeatOriginalAt(e.target) ?? node\n Besigner.focus.setSelectedNode(target)\n requestCanvasContextMenu(target?.$id)\n }\n function handleMouseOver(e: Event) {\n // Same stand-down, same reason to consume it: a hover repaint while\n // the author is typing is a re-render of the subtree they are\n // editing, and an ancestor leaf would repaint for them instead.\n if (isInlineEditWithin(el)) {\n e.stopPropagation()\n return\n }\n e.preventDefault()\n e.stopPropagation()\n Besigner.focus.setHoveredNode(repeatOriginalAt(e.target) ?? node)\n }\n function handleMouseDown(e: Event) {\n // Stand down while an edit is open in this leaf OR ANY LEAF INSIDE\n // IT (AGL-2486) — but CONSUME the event rather than ignoring it.\n //\n // Two different mistakes produced the same symptom, an editor that\n // was open, styled and completely uninteractive. First, asking only\n // \"is this leaf the node being edited?\": a nested run — a Span\n // typography inside a Typography — silenced its OWN leaf, the event\n // bubbled to the ancestor leaf, and the ancestor called the\n // `preventDefault` that suppresses caret placement. Second, standing\n // down by simply returning: that also skipped `stopPropagation`, so\n // the gesture carried on up to the viewport, which treats a\n // mousedown on empty canvas as a deselect — and moving the selection\n // off the node closes the editor. A drag meant to select three words\n // tore the editor down instead.\n //\n // So: no `preventDefault`, because that is the caret; but still\n // `stopPropagation`, because nothing else on this canvas should see\n // a gesture aimed at text being edited. `stopPropagation` does not\n // suppress a default action, only delivery.\n if (isInlineEditWithin(el)) {\n e.stopPropagation()\n return\n }\n if (e.type === 'pointerdown') {\n selectedAtPress = Besigner.focus.isNodeSelected(node)\n }\n e.preventDefault()\n e.stopPropagation()\n // A press on one of this element's repeat copies (Sam, Jordan) means\n // the element that copy draws, not this one around it — see\n // `repeatOriginalAt`.\n const original = repeatOriginalAt(e.target)\n const target = original ?? node\n // Element-picker capture (AGL-574): while the interaction builder is\n // picking, this click resolves the target and exits pick mode —\n // never the normal select/navigate, so the designer's selection and\n // the open interaction stay put.\n if (Besigner.pick.isPicking()) {\n Besigner.pick.handlePickClick(target.$id)\n return\n }\n // Canvas multi-selection modifiers (AGL-12), mirroring the\n // hierarchy panel: Shift ranges, Cmd/Ctrl toggles.\n const pointer = e as globalThis.MouseEvent\n if (pointer.shiftKey) {\n Besigner.focus.rangeSelectNode(target)\n } else {\n Besigner.focus.handleNodeSelection(\n target,\n pointer.metaKey || pointer.ctrlKey,\n )\n if (!original && !pointer.metaKey && !pointer.ctrlKey) {\n pickPartUnder(pointer)\n }\n }\n }\n /**\n * A plain click on a placement (a component instance or a placed form)\n * also says WHICH part of it was under the pointer (AGL-3288), so the\n * Styles and Attributes tabs aim \"Which part?\" at what the author just\n * clicked. The parts themselves stay unselectable — they are drawn\n * inert — so this is the only way a click can reach one.\n */\n function pickPartUnder(pointer: globalThis.MouseEvent) {\n if (!isDefinitionPlacement(node)) return\n const container = ref.current\n if (!container || typeof pointer.clientX !== 'number') return\n const { definitions, formDesigns } = instanceEditRef.current\n const definition = placementDefinitionFor(node, {\n definitions,\n formDesigns,\n })\n if (!definition) return\n const key = findPlacementPartAtPoint(\n container,\n pointer.clientX,\n pointer.clientY,\n node.$id,\n (graftedId) =>\n resolveInstanceLeafBinding(\n graftedId,\n node.$id,\n definition,\n 'children',\n definition.rootId,\n ),\n definition.rootId,\n )\n pickPlacementPart(node.$id, key ?? '')\n }\n function handleDoubleClick(e: Event) {\n // The `dblclick` a browser may still send for two taps that already\n // opened an editor (see handleTouchEnd): consumed, not run twice.\n if (e.timeStamp - editOpenedByTapAt < DOUBLE_TAP_WITHIN_MS * 2) {\n e.preventDefault()\n e.stopPropagation()\n return\n }\n // Inside an open edit, a double-click selects a word, as the\n // double-tap does (see handleTouchEnd). The default is the word\n // selection, so it is left alone; only delivery stops, or an\n // instance would reopen its prop edit over the text being typed.\n if (isInlineEditWithin(el)) {\n e.stopPropagation()\n return\n }\n if (!openEditAt(e as globalThis.MouseEvent)) return\n e.preventDefault()\n e.stopPropagation()\n }\n /**\n * Opens this element's in-place editor for a double-click or a\n * double-tap at `point`, and says whether one opened — which is also\n * whether the gesture is spent here or goes on to an ancestor.\n */\n function openEditAt(point: ClientPoint): boolean {\n if (!el) return false\n // Prop-fed instance internals (AGL-1304): the rendered preview sits\n // under `pointer-events: none`, so the double-click lands HERE, on\n // the instance — hit-test the preview geometrically, map the grafted\n // leaf back to the definition, and if a declared prop feeds it, edit\n // that prop inline. Leaves the component owns stay locked (the\n // selection this dblclick's mousedowns already made puts AGL-1303's\n // \"Edit component\" in the panel — nothing extra to build).\n if (\n node?.componentId === REUSABLE_INSTANCE_COMPONENT_ID &&\n Besigner.dnd.canDragNode(node)\n ) {\n return handleInstanceDoubleClick(point)\n }\n // Locked nodes (layout chrome in the screen besigner) stay read-only —\n // same gate the drag system uses — and while the interaction builder\n // is picking a target, a double-click is two picks, never an edit.\n if (!Besigner.dnd.canDragNode(node) || Besigner.pick.isPicking()) {\n return false\n }\n // Inline text editing for components that declare textEditable.\n const flag = node?.componentSchema?.flags?.textEditable\n const editable =\n typeof flag === 'number' && (flag & FEATURE_FLAG.ENABLED) !== 0\n if (editable) {\n const root = el\n // The node's own `<aglyn-text>` whenever it renders one, and the\n // root only as a fallback (AGL-2556). In-place editing EMPTIES\n // whatever it is given, so handing it a composite's root deletes\n // the chrome that composite built — for Accordion Summary that is\n // the content div carrying MUI's `textAlign: 'start'`, without\n // which the UA stylesheet centres the label inside the `<button>`\n // for as long as the edit is open.\n const element = findLeafTextElement(root) ?? root\n const rect = element.getBoundingClientRect()\n inlineTextEdit.open(\n node,\n {\n left: rect.left,\n top: rect.top,\n width: rect.width,\n height: rect.height,\n },\n undefined,\n // The measured element travels with the rect so the overlay can\n // re-measure on scroll instead of drifting (AGL-1644).\n element,\n )\n return true\n }\n // In-place markdown editing (AGL-1624): a component whose schema\n // declares a MARKDOWN attribute — the Markdown element's `content` is\n // the one that exists — opens the WYSIWYG over the element, editing\n // the whole document without a trip to the attributes panel.\n //\n // `stopPropagation` on the NATIVE event is what keeps the canvas still:\n // React delegates `onDoubleClick` at the root container, so an event\n // consumed here never reaches `ZoomablePanningComponent`'s\n // double-click-to-zoom. That is the same guarantee the textEditable\n // branch above has always relied on, not a new mechanism.\n const markdownAttribute = findMarkdownAttributeName(node)\n if (!markdownAttribute) return false\n const markdownElement = el\n const markdownRect = markdownElement.getBoundingClientRect()\n const stored = (node.props as Record<string, unknown> | undefined)?.[\n markdownAttribute\n ]\n // The two mousedowns of a double-click TOGGLE selection, so by the time\n // this fires the node has been selected and then deselected again.\n // Editing an element is selecting it — the attributes panel should be\n // showing it — and the editor closes when the selection moves off the\n // node, so it has to be put back before the editor opens.\n Besigner.focus.setSelectedNode(node)\n inlineMarkdownEdit.open(\n node,\n {\n left: markdownRect.left,\n top: markdownRect.top,\n width: markdownRect.width,\n height: markdownRect.height,\n },\n markdownAttribute,\n typeof stored === 'string' ? stored : '',\n markdownElement,\n )\n return true\n }\n /** True when the double-click resolved to a prop edit it opened. */\n function handleInstanceDoubleClick(pointer: ClientPoint) {\n const { definitions, onPickMedia } = instanceEditRef.current\n const refId = (node?.props as { refId?: string } | undefined)?.refId\n const definition = refId ? definitions?.[refId] : undefined\n const container = ref.current\n if (!definition || !container) return false\n const hit = findInstanceLeafAtPoint(\n container,\n pointer.clientX,\n pointer.clientY,\n )\n if (!hit) return false\n // Text first: a leaf whose `children` a declared prop feeds opens\n // the EXISTING inline editor, anchored on the clicked leaf, and the\n // commit writes propValues[prop] on the instance (one undo entry,\n // mirrored to peers like any node edit).\n const text = resolveInstanceLeafBinding(\n hit.graftedId,\n node.$id,\n definition,\n )\n if (text?.boundProp) {\n const rect = hit.element.getBoundingClientRect()\n const propName = text.boundProp\n // The schema of the element the prop fills decides the toolbar, as\n // a node's own schema does. Formatting is offered only when EVERY\n // element the prop fills draws markup: the graft hands the markup\n // to each of them, and one that ignores it would show bold that\n // never renders.\n const schemaOf = (id: string) =>\n components.getSchema(\n (definition.nodes as Record<string, { componentId?: string }>)[\n id\n ]?.componentId as Aglyn.ComponentId,\n )\n const rich = listPropFedTextNodeIds(definition.nodes, propName).every(\n (id) =>\n ((schemaOf(id)?.flags?.richTextEditable ??\n FEATURE_FLAG.DISABLED) &\n FEATURE_FLAG.ENABLED) !==\n 0,\n )\n inlineTextEdit.open(\n node,\n {\n left: rect.left,\n top: rect.top,\n width: rect.width,\n height: rect.height,\n },\n {\n propName,\n initialText: getInstanceEffectivePropText(\n node.props,\n definition.props,\n propName,\n ),\n schema: schemaOf(text.componentInternalId),\n rich,\n initialHtml: rich\n ? getInstanceEffectivePropHtml(\n node.props,\n definition.props,\n propName,\n )\n : '',\n },\n // The GRAFTED leaf, not the instance node: it is what was measured,\n // and it is the one anchor `Besigner.refs` could never supply\n // because it is not a canvas node (AGL-1644).\n hit.element,\n )\n return true\n }\n // Image half: `src` fed by a declared prop opens the host's media\n // picker, committing the picked value to the same propValues slot —\n // the exact pipeline the Attributes panel's Browse button uses.\n const src = resolveInstanceLeafBinding(\n hit.graftedId,\n node.$id,\n definition,\n 'src',\n )\n if (src?.boundProp && onPickMedia) {\n const propName = src.boundProp\n // The SAME leaf's `alt`, if the component author bound one to a\n // declared prop too (AGL-1896). Resolvable here and nowhere else\n // in the instance pipeline: this path starts from a concrete leaf\n // in the definition tree, so \"which declared prop feeds this\n // image's alt\" is a lookup rather than a guess. The attributes\n // panel only ever sees a declared prop's NAME, and no convention\n // says which other prop is its alt — so it does not try.\n const altBinding = resolveInstanceLeafBinding(\n hit.graftedId,\n node.$id,\n definition,\n 'alt',\n )\n onPickMedia((value, asset) => {\n // Written through verbatim (media reference or raw URL — the\n // host app decides; AGL-1215). Snapshot via toJSON like the\n // panel: updateNodeProps REPLACES the props object.\n const current = (canvas.toJSON().nodes as Record<string, any>)[\n node.$id\n ]\n // What the instance renders for the alt prop TODAY — its own\n // override, else the component's default. Not the raw override:\n // a component whose default alt is already a real sentence must\n // not have it replaced just because this instance never set one.\n const altPropName = altBinding?.boundProp\n const effectiveAlt = altPropName\n ? getInstanceEffectivePropText(\n current?.props,\n definition.props,\n altPropName,\n )\n : undefined\n const inheritedAlt = altPropName\n ? inheritedMediaAlt({\n placementAlt: effectiveAlt,\n assetAlt: asset?.alt,\n })\n : undefined\n canvas.updateNodeProps(node, {\n ...current?.props,\n [REUSABLE_INSTANCE_PROP_VALUES_KEY]: {\n ...current?.props?.[REUSABLE_INSTANCE_PROP_VALUES_KEY],\n [propName]: value,\n ...(inheritedAlt && altPropName\n ? { [altPropName]: inheritedAlt }\n : {}),\n },\n })\n })\n return true\n }\n return false\n }\n }, [node, element])\n\n return cloneElement(\n child,\n mergeProps(child.props, draggable.attributes, {\n ref: mergeRefs(\n ref,\n trackElement,\n child.props.ref,\n draggable.setNodeRef,\n droppable.setNodeRef,\n ),\n style,\n sx: {\n '&, &:hover, &:focus': {\n cursor: draggable.isDragging ? 'move' : 'initial',\n },\n },\n }),\n )\n },\n)\n\nDraggableDroppable.displayName = 'DraggableDroppable'\n\nexport default DraggableDroppable\n"],"names":["canvas","components","FEATURE_FLAG","getInstanceEffectivePropHtml","getInstanceEffectivePropText","inheritedMediaAlt","isDefinitionPlacement","listPropFedTextNodeIds","placementDefinitionFor","resolveInstanceLeafBinding","REUSABLE_INSTANCE_COMPONENT_ID","REUSABLE_INSTANCE_PROP_VALUES_KEY","Besigner","mergeRefs","useId","useDraggable","useDroppable","CSS","css","mergeProps","observer","Children","cloneElement","useCallback","useContext","useEffect","useRef","useState","ComponentPromotionContext","MediaPickerContext","findMarkdownAttributeName","inlineMarkdownEdit","inlineTextEdit","isInlineEditWithin","requestCanvasContextMenu","findInstanceLeafAtPoint","findPlacementPartAtPoint","pickPlacementPart","findLeafTextElement","holdKeyboardForEdit","repeatOriginalAt","DropSurface","TAP_SLOP_PX","TAP_MAX_MS","DOUBLE_TAP_WITHIN_MS","DOUBLE_TAP_SLOP_PX","distance","a","b","Math","hypot","x","y","DraggableDroppable","props","node","type","disableDragging","disableDropping","accept","children","idSuffix","id","$id","ref","element","setElement","trackElement","next","draggable","data","disabled","droppable","surface","CANVAS","getElement","current","transform","isTransforming","Boolean","child","only","style","outlineWidth","outlineOffset","outlineColor","outlineStyle","translate","Translate","toString","isOver","isDragging","opacity","cursor","pick","isPicking","focus","isNodeHovered","definitions","formDesigns","onPickMedia","instanceEditRef","listenersRef","listeners","refs","set","delete","handles","el","selectedAtPress","pressStart","lastTap","editOpenedByTapAt","Infinity","addEventListener","handleMouseOver","handleMouseDown","handleDoubleClick","handleContextMenu","handleTouchStart","handleTouchEnd","removeEventListener","e","touch","touches","length","undefined","clientX","clientY","at","timeStamp","selected","onTouchStart","nativeEvent","start","changedTouches","tap","first","openEditAt","preventDefault","stopPropagation","target","setSelectedNode","setHoveredNode","isNodeSelected","original","handlePickClick","pointer","shiftKey","rangeSelectNode","handleNodeSelection","metaKey","ctrlKey","pickPartUnder","container","definition","key","graftedId","rootId","point","componentId","dnd","canDragNode","handleInstanceDoubleClick","flag","componentSchema","flags","textEditable","editable","ENABLED","root","rect","getBoundingClientRect","open","left","top","width","height","markdownAttribute","markdownElement","markdownRect","stored","refId","hit","text","boundProp","propName","schemaOf","getSchema","nodes","rich","every","richTextEditable","DISABLED","initialText","schema","componentInternalId","initialHtml","src","altBinding","value","asset","toJSON","altPropName","effectiveAlt","inheritedAlt","placementAlt","assetAlt","alt","updateNodeProps","attributes","setNodeRef","sx","displayName"],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC;AAGD,SACEA,MAAM,EACNC,UAAU,EACVC,YAAY,EACZC,4BAA4B,EAC5BC,4BAA4B,EAC5BC,iBAAiB,EACjBC,qBAAqB,EACrBC,sBAAsB,EACtBC,sBAAsB,EACtBC,0BAA0B,EAC1BC,8BAA8B,EAC9BC,iCAAiC,QAC5B,eAAc;AACrB,YAAYC,cAAc,kBAAiB;AAC3C,SAASC,SAAS,EAAEC,KAAK,QAAQ,uBAAsB;AACvD,SAASC,YAAY,EAAEC,YAAY,QAAQ,gBAAe;AAC1D,SAASC,OAAOC,GAAG,QAAQ,qBAAoB;AAC/C,SAASC,UAAU,QAAQ,oBAAmB;AAC9C,SAASC,QAAQ,QAAQ,kBAAiB;AAC1C,SACEC,QAAQ,EACRC,YAAY,EAEZC,WAAW,EACXC,UAAU,EACVC,SAAS,EACTC,MAAM,EACNC,QAAQ,QACH,QAAO;AACd,OAAOC,+BAA+B,gDAA4C;AAClF,SAASC,kBAAkB,QAAQ,yCAAqC;AACxE,SACEC,yBAAyB,EACzBC,kBAAkB,QACb,4CAAwC;AAC/C,SACEC,cAAc,EACdC,kBAAkB,QACb,wCAAoC;AAC3C,SAASC,wBAAwB,QAAQ,qCAAiC;AAC1E,SACEC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AwB,CAC5DtI,KAAKQ,GAAG,CACT;oBACD,6DAA6D;oBAC7D,gEAAgE;oBAChE,gEAAgE;oBAChE,iEAAiE;oBACjE,MAAM4I,cAAcJ,8BAAAA,WAAYd,SAAS;oBACzC,MAAMmB,eAAeD,cACjBvM,6BACEwE,2BAAAA,QAAStB,KAAK,EACdqG,WAAWrG,KAAK,EAChBqJ,eAEF7E;oBACJ,MAAM+E,eAAeF,cACjBtM,kBAAkB;wBAChByM,cAAcF;wBACdG,QAAQ,EAAEN,yBAAAA,MAAOO,GAAG;oBACtB,KACAlF;oBACJ9H,OAAOiN,eAAe,CAAC1J,MAAM,aACxBqB,2BAAAA,QAAStB,KAAK;wBACjB,CAAC3C,kCAAkC,EAAE,aAChCiE,4BAAAA,iBAAAA,QAAStB,KAAK,qBAAdsB,cAAgB,CAACjE,kCAAkC;4BACtD,CAAC+K,SAAS,EAAEc;2BACRK,gBAAgBF,cAChB;4BAAE,CAACA,YAAY,EAAEE;wBAAa,IAC9B,CAAC;;gBAGX;gBACA,OAAO;YACT;YACA,OAAO;QACT;IACF,GAAG;QAACtJ;QAAMU;KAAQ;IAElB,qBAAO3C,aACL0D,OACA7D,WAAW6D,MAAM1B,KAAK,EAAEe,UAAU6I,UAAU,EAAE;QAC5ClJ,KAAKnD,UACHmD,KACAG,cACAa,MAAM1B,KAAK,CAACU,GAAG,EACfK,UAAU8I,UAAU,EACpB3I,UAAU2I,UAAU;QAEtBjI;QACAkI,IAAI;YACF,uBAAuB;gBACrBvH,QAAQxB,UAAUsB,UAAU,GAAG,SAAS;YAC1C;QACF;IACF;AAEJ,GACD;AAEDtC,mBAAmBgK,WAAW,GAAG;AAEjC,eAAehK,mBAAkB"}
|
|
1
|
+
{"version":3,"sources":["../../../../../../../../../libs/besigner/feature/designer/src/lib/components/dnd/draggable-droppable.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 {\n canvas,\n components,\n FEATURE_FLAG,\n getInstanceEffectivePropHtml,\n getInstanceEffectivePropText,\n inheritedMediaAlt,\n isDefinitionPlacement,\n listPropFedTextNodeIds,\n placementDefinitionFor,\n resolveInstanceLeafBinding,\n REUSABLE_INSTANCE_COMPONENT_ID,\n REUSABLE_INSTANCE_PROP_VALUES_KEY,\n} from '@aglyn/aglyn'\nimport * as Besigner from '@aglyn/besigner'\nimport { mergeRefs, useId } from '@aglyn/shared-ui-jsx'\nimport { useDraggable, useDroppable } from '@dnd-kit/core'\nimport { CSS as css } from '@dnd-kit/utilities'\nimport { mergeProps } from '@react-aria/utils'\nimport { observer } from 'mobx-react-lite'\nimport {\n Children,\n cloneElement,\n CSSProperties,\n useCallback,\n useContext,\n useEffect,\n useRef,\n useState,\n} from 'react'\nimport ComponentPromotionContext from '../../contexts/component-promotion-context'\nimport { MediaPickerContext } from '../../contexts/media-picker-context'\nimport {\n findMarkdownAttributeName,\n inlineMarkdownEdit,\n} from '../../utils/inline-markdown-edit.store'\nimport {\n inlineTextEdit,\n isInlineEditWithin,\n} from '../../utils/inline-text-edit.store'\nimport { requestCanvasContextMenu } from '../../utils/canvas-context-menu'\nimport {\n findInstanceLeafAtPoint,\n findPlacementPartAtPoint,\n} from '../../utils/instance-leaf-hit'\nimport { pickPlacementPart } from '../../utils/placement-part-pick'\nimport { findLeafTextElement } from '../../utils/in-place-edit-surface'\nimport { holdKeyboardForEdit } from '../../utils/touch-keyboard'\nimport { repeatCopyAt, repeatCopyStandIns } from '../../utils/repeat-copy'\nimport { DropSurface } from './drop-surface'\n\n/** A pointer position, from a mouse event or a touch. */\ntype ClientPoint = { clientX: number; clientY: number }\n\n/** A finger's position and the event time it was read at. */\ntype TapPoint = { x: number; y: number; at: number }\n\n/** The furthest a finger may slide and still be tapping, in px. */\nconst TAP_SLOP_PX = 10\n/** The longest a press may last and still be a tap, in ms; longer is a hold. */\nconst TAP_MAX_MS = 300\n/** How soon the second tap of a double-tap must follow the first, in ms. */\nconst DOUBLE_TAP_WITHIN_MS = 350\n/** How far from the first tap the second may land, in px. */\nconst DOUBLE_TAP_SLOP_PX = 24\n\nconst distance = (a: { x: number; y: number }, b: { x: number; y: number }) =>\n Math.hypot(a.x - b.x, a.y - b.y)\n\nexport interface DraggableDroppableProps<T extends Aglyn.NodeSchema<any>> {\n children: JSX.Element\n node: T\n type: Besigner.DragType\n accept: Besigner.DragType[]\n disableDragging?: boolean\n disableDropping?: boolean\n idSuffix?: string\n}\n\nexport const DraggableDroppable = observer(\n <T extends Aglyn.NodeSchema<any>>(props: DraggableDroppableProps<T>) => {\n const {\n node,\n type,\n disableDragging,\n disableDropping,\n accept,\n children,\n idSuffix,\n } = props\n const id = useId(node?.$id)\n const ref = useRef<HTMLElement>(null)\n /**\n * The element as STATE, beside the ref, so the listeners below follow it.\n *\n * A component may render a different element for the same node: a\n * Typography whose text gains a line break holds block content, which a\n * `<p>` cannot, so it re-renders as a `<div>`. The listeners were bound\n * once per node, to the element that was there first, and stayed on the\n * detached `<p>` — a click on the text then reached the parent instead,\n * which selected the Stack around it, and a double-click opened nothing.\n */\n const [element, setElement] = useState<HTMLElement | null>(null)\n // Records a real element only. The merged ref below is a fresh callback\n // every render, so React hands it `null` and then the element on each\n // commit; setting the same element again bails out, a `null` would not.\n const trackElement = useCallback((next: HTMLElement | null) => {\n if (next) setElement(next)\n }, [])\n\n const draggable = useDraggable({\n id: `${id}:${type}${idSuffix || ''}`,\n data: { type, node },\n disabled: disableDragging,\n })\n\n const droppable = useDroppable({\n id: `${id}:${type}${idSuffix || ''}`,\n data: {\n type,\n node,\n accept,\n surface: DropSurface.CANVAS,\n // Measured live by the drop marker: dnd-kit's cached rect cannot\n // follow the canvas scrolling from inside its shadow root.\n getElement: () => ref.current,\n },\n disabled: disableDropping,\n })\n\n const transform = draggable.transform\n const isTransforming = Boolean(draggable.transform)\n const child = Children.only(children)\n const style: CSSProperties = {\n ...child.props.style,\n // cursor: 'move',\n outlineWidth: 2,\n outlineOffset: -1,\n outlineColor: 'grey',\n outlineStyle: 'dotted',\n // transform: css.Transform.toString(transform),\n // scale: css.Scale.toString(transform),\n translate: css.Translate.toString(transform),\n\n ...(isTransforming\n ? {\n // transform: `translate3d(${transform.x}px, ${transform.y}px, 0)`,\n // cursor: 'grab',\n }\n : {}),\n ...(droppable.isOver\n ? {\n outlineColor: 'lime',\n outlineStyle: 'solid',\n outlineOffset: '3',\n }\n : {}),\n ...(draggable.isDragging\n ? {\n outlineColor: 'grey',\n outlineStyle: 'double',\n outlineOffset: -1 as any,\n opacity: 0.5,\n cursor: 'move',\n }\n : {}),\n // Element-picker affordance (AGL-574): while the interaction builder\n // is picking a target, every leaf shows the crosshair and the hovered\n // one gets a distinct violet ring — deliberately unlike the normal\n // selection/drop outlines so \"pick this\" reads as its own mode.\n ...(Besigner.pick.isPicking() ? { cursor: 'crosshair' } : {}),\n ...(Besigner.pick.isPicking() && Besigner.focus.isNodeHovered(node)\n ? {\n outlineColor: '#7c4dff',\n outlineStyle: 'solid',\n outlineWidth: 2,\n outlineOffset: 2 as any,\n }\n : {}),\n }\n\n // Instance-internals double-click (AGL-1304) needs the component\n // definitions (hit-test) and the host's media picker (image props).\n // Read through a ref so the listener effect below keeps its `[node]`\n // dependency — context updates must not re-register DOM listeners.\n const { definitions, formDesigns } = useContext(ComponentPromotionContext)\n const { onPickMedia } = useContext(MediaPickerContext)\n const instanceEditRef = useRef({ definitions, formDesigns, onPickMedia })\n instanceEditRef.current = { definitions, formDesigns, onPickMedia }\n // Same reason: the touch listener below reads the live dnd-kit handlers.\n const listenersRef = useRef(draggable.listeners)\n listenersRef.current = draggable.listeners\n\n useEffect(() => {\n Besigner.refs.set(node.$id, ref)\n return () => {\n Besigner.refs.delete(node.$id)\n }\n }, [node?.$id])\n\n useEffect(() => {\n Besigner.handles.set(node.$id, {\n ...draggable.listeners,\n style: isTransforming ? { cursor: 'grab' } : { cursor: 'move' },\n })\n return () => {\n Besigner.handles.delete(node.$id)\n }\n }, [node.$id, draggable.listeners, isTransforming])\n\n useEffect(() => {\n const el = ref.current\n /**\n * Whether this element was already selected when the latest press on\n * it began. Read by the touch drag below, and reset by it, because the\n * press that selects an element must not also pick it up.\n */\n let selectedAtPress = false\n /** Where and when the finger on this element came down. */\n let pressStart: TapPoint | null = null\n /** The last quick, still tap on this element, waiting for its pair. */\n let lastTap: TapPoint | null = null\n /** When a double-tap opened an editor here, by event time. */\n let editOpenedByTapAt = -Infinity\n if (el) {\n el.addEventListener('mouseover', handleMouseOver)\n el.addEventListener('pointerover', handleMouseOver)\n el.addEventListener('mousedown', handleMouseDown)\n el.addEventListener('pointerdown', handleMouseDown)\n el.addEventListener('dblclick', handleDoubleClick)\n el.addEventListener('contextmenu', handleContextMenu)\n el.addEventListener('touchstart', handleTouchStart)\n el.addEventListener('touchend', handleTouchEnd)\n\n return () => {\n el.removeEventListener('mouseover', handleMouseOver)\n el.removeEventListener('pointerover', handleMouseOver)\n el.removeEventListener('mousedown', handleMouseDown)\n el.removeEventListener('pointerdown', handleMouseDown)\n el.removeEventListener('dblclick', handleDoubleClick)\n el.removeEventListener('contextmenu', handleContextMenu)\n el.removeEventListener('touchstart', handleTouchStart)\n el.removeEventListener('touchend', handleTouchEnd)\n }\n }\n /**\n * Press and hold a selected element to drag it on a touch screen.\n *\n * The element itself has never been a drag source: a mouse drags it by\n * the grip in its toolbar, and on a mouse that costs nothing, because a\n * press on the body selects it and the page stays put. A finger pressing\n * the body scrolls the page instead, which is what an author trying to\n * move the element saw. Handing the press to dnd-kit's TouchSensor\n * keeps a swipe a scroll — the sensor waits for a still hold before it\n * takes over — and makes a hold a drag.\n *\n * Native, like its neighbours: the canvas is a closed shadow root, so a\n * React `onTouchStart` would never fire. The sensor reads only\n * `nativeEvent`, and marks it, so an ancestor that is also selected\n * cannot claim the same touch.\n */\n function handleTouchStart(e: TouchEvent) {\n const touch = e.touches.length === 1 ? e.touches[0] : undefined\n pressStart = touch\n ? { x: touch.clientX, y: touch.clientY, at: e.timeStamp }\n : null\n const selected = selectedAtPress\n selectedAtPress = false\n if (!selected || isInlineEditWithin(el) || Besigner.pick.isPicking()) {\n return\n }\n listenersRef.current?.onTouchStart?.({ nativeEvent: e } as any)\n }\n /**\n * Double-tap a text element to edit it in place on a touch screen.\n *\n * A mouse gets there by `dblclick`, and on a touch screen that event is\n * the browser's to give. Chrome on Android turns two taps into one; on\n * a phone the in-place editor, and the B / I / U toolbar that comes\n * with it, did not open. So the two taps are counted here, by rules\n * that are this canvas's own rather than each browser's, and the same\n * open runs.\n *\n * Opening this way also puts the keyboard up (`holdKeyboardForEdit`),\n * which iOS only allows while the tap is still being handled — and the\n * `preventDefault` keeps Safari from zooming on the second tap, or\n * sending the `dblclick` Chrome would have sent after it.\n *\n * Two taps make a double-tap when each is quick and still, and the\n * second lands near the first soon after it. A hold is a drag, a slide\n * is a scroll, and neither counts.\n */\n function handleTouchEnd(e: TouchEvent) {\n const start = pressStart\n pressStart = null\n const touch = e.changedTouches[0]\n if (\n !start ||\n !touch ||\n e.touches.length > 0 ||\n // Inside an open edit, a double-tap selects a word.\n isInlineEditWithin(el) ||\n Besigner.pick.isPicking()\n ) {\n lastTap = null\n return\n }\n const tap = { x: touch.clientX, y: touch.clientY, at: e.timeStamp }\n if (\n distance(tap, start) > TAP_SLOP_PX ||\n tap.at - start.at > TAP_MAX_MS\n ) {\n lastTap = null\n return\n }\n const first = lastTap\n lastTap = tap\n if (\n !first ||\n tap.at - first.at > DOUBLE_TAP_WITHIN_MS ||\n distance(tap, first) > DOUBLE_TAP_SLOP_PX\n ) {\n return\n }\n lastTap = null\n if (!openEditAt({ clientX: tap.x, clientY: tap.y })) return\n e.preventDefault()\n e.stopPropagation()\n editOpenedByTapAt = e.timeStamp\n // A prop-fed image opens the media picker instead, which wants no\n // keyboard.\n if (inlineTextEdit.node || inlineMarkdownEdit.node) {\n holdKeyboardForEdit(tap)\n }\n }\n /**\n * Right-click opens this element's ⋮ menu (AGL-1405).\n *\n * A native listener like its neighbours, not an `onContextMenu` prop:\n * React delegates at the root container and the canvas is a closed\n * shadow root, so a delegated handler never sees the event.\n *\n * Selects first. The menu is rendered by the overlay, which only mounts\n * for a selected or hovered node — and right-clicking an element is a\n * statement about THAT element, so leaving the previous selection in\n * place would open the wrong menu.\n */\n function handleContextMenu(e: Event) {\n if (isInlineEditWithin(el)) {\n // An open text editor keeps the browser's own menu: cut, paste and\n // spellcheck are the whole point of a right-click there.\n e.stopPropagation()\n return\n }\n e.preventDefault()\n e.stopPropagation()\n // On a repeat copy, the menu is the element the copy draws, and the\n // selection is outlined on the copy (`repeatCopyStandIns`).\n const copy = repeatCopyAt(e.target)\n const target = copy?.original ?? node\n Besigner.focus.setSelectedNode(target)\n repeatCopyStandIns.set('selected', copy)\n requestCanvasContextMenu(target?.$id)\n }\n function handleMouseOver(e: Event) {\n // Same stand-down, same reason to consume it: a hover repaint while\n // the author is typing is a re-render of the subtree they are\n // editing, and an ancestor leaf would repaint for them instead.\n if (isInlineEditWithin(el)) {\n e.stopPropagation()\n return\n }\n e.preventDefault()\n e.stopPropagation()\n // On a repeat copy: the element it draws, outlined on the copy.\n const copy = repeatCopyAt(e.target)\n Besigner.focus.setHoveredNode(copy?.original ?? node)\n repeatCopyStandIns.set('hovered', copy)\n }\n function handleMouseDown(e: Event) {\n // Stand down while an edit is open in this leaf OR ANY LEAF INSIDE\n // IT (AGL-2486) — but CONSUME the event rather than ignoring it.\n //\n // Two different mistakes produced the same symptom, an editor that\n // was open, styled and completely uninteractive. First, asking only\n // \"is this leaf the node being edited?\": a nested run — a Span\n // typography inside a Typography — silenced its OWN leaf, the event\n // bubbled to the ancestor leaf, and the ancestor called the\n // `preventDefault` that suppresses caret placement. Second, standing\n // down by simply returning: that also skipped `stopPropagation`, so\n // the gesture carried on up to the viewport, which treats a\n // mousedown on empty canvas as a deselect — and moving the selection\n // off the node closes the editor. A drag meant to select three words\n // tore the editor down instead.\n //\n // So: no `preventDefault`, because that is the caret; but still\n // `stopPropagation`, because nothing else on this canvas should see\n // a gesture aimed at text being edited. `stopPropagation` does not\n // suppress a default action, only delivery.\n if (isInlineEditWithin(el)) {\n e.stopPropagation()\n return\n }\n if (e.type === 'pointerdown') {\n selectedAtPress = Besigner.focus.isNodeSelected(node)\n }\n e.preventDefault()\n e.stopPropagation()\n // A press on one of this element's repeat copies (Sam, Jordan) means\n // the element that copy draws, not this one around it — see\n // `repeatCopyAt`. Its selection is outlined on the copy pressed.\n const copy = repeatCopyAt(e.target)\n const original = copy?.original ?? null\n const target = original ?? node\n // Element-picker capture (AGL-574): while the interaction builder is\n // picking, this click resolves the target and exits pick mode —\n // never the normal select/navigate, so the designer's selection and\n // the open interaction stay put.\n if (Besigner.pick.isPicking()) {\n Besigner.pick.handlePickClick(target.$id)\n return\n }\n // Canvas multi-selection modifiers (AGL-12), mirroring the\n // hierarchy panel: Shift ranges, Cmd/Ctrl toggles.\n const pointer = e as globalThis.MouseEvent\n if (pointer.shiftKey) {\n Besigner.focus.rangeSelectNode(target)\n } else {\n Besigner.focus.handleNodeSelection(\n target,\n pointer.metaKey || pointer.ctrlKey,\n )\n if (!original && !pointer.metaKey && !pointer.ctrlKey) {\n pickPartUnder(pointer)\n }\n }\n repeatCopyStandIns.set('selected', copy)\n }\n /**\n * A plain click on a placement (a component instance or a placed form)\n * also says WHICH part of it was under the pointer (AGL-3288), so the\n * Styles and Attributes tabs aim \"Which part?\" at what the author just\n * clicked. The parts themselves stay unselectable — they are drawn\n * inert — so this is the only way a click can reach one.\n */\n function pickPartUnder(pointer: globalThis.MouseEvent) {\n if (!isDefinitionPlacement(node)) return\n const container = ref.current\n if (!container || typeof pointer.clientX !== 'number') return\n const { definitions, formDesigns } = instanceEditRef.current\n const definition = placementDefinitionFor(node, {\n definitions,\n formDesigns,\n })\n if (!definition) return\n const key = findPlacementPartAtPoint(\n container,\n pointer.clientX,\n pointer.clientY,\n node.$id,\n (graftedId) =>\n resolveInstanceLeafBinding(\n graftedId,\n node.$id,\n definition,\n 'children',\n definition.rootId,\n ),\n definition.rootId,\n )\n pickPlacementPart(node.$id, key ?? '')\n }\n function handleDoubleClick(e: Event) {\n // The `dblclick` a browser may still send for two taps that already\n // opened an editor (see handleTouchEnd): consumed, not run twice.\n if (e.timeStamp - editOpenedByTapAt < DOUBLE_TAP_WITHIN_MS * 2) {\n e.preventDefault()\n e.stopPropagation()\n return\n }\n // Inside an open edit, a double-click selects a word, as the\n // double-tap does (see handleTouchEnd). The default is the word\n // selection, so it is left alone; only delivery stops, or an\n // instance would reopen its prop edit over the text being typed.\n if (isInlineEditWithin(el)) {\n e.stopPropagation()\n return\n }\n if (!openEditAt(e as globalThis.MouseEvent)) return\n e.preventDefault()\n e.stopPropagation()\n }\n /**\n * Opens this element's in-place editor for a double-click or a\n * double-tap at `point`, and says whether one opened — which is also\n * whether the gesture is spent here or goes on to an ancestor.\n */\n function openEditAt(point: ClientPoint): boolean {\n if (!el) return false\n // Prop-fed instance internals (AGL-1304): the rendered preview sits\n // under `pointer-events: none`, so the double-click lands HERE, on\n // the instance — hit-test the preview geometrically, map the grafted\n // leaf back to the definition, and if a declared prop feeds it, edit\n // that prop inline. Leaves the component owns stay locked (the\n // selection this dblclick's mousedowns already made puts AGL-1303's\n // \"Edit component\" in the panel — nothing extra to build).\n if (\n node?.componentId === REUSABLE_INSTANCE_COMPONENT_ID &&\n Besigner.dnd.canDragNode(node)\n ) {\n return handleInstanceDoubleClick(point)\n }\n // Locked nodes (layout chrome in the screen besigner) stay read-only —\n // same gate the drag system uses — and while the interaction builder\n // is picking a target, a double-click is two picks, never an edit.\n if (!Besigner.dnd.canDragNode(node) || Besigner.pick.isPicking()) {\n return false\n }\n // Inline text editing for components that declare textEditable.\n const flag = node?.componentSchema?.flags?.textEditable\n const editable =\n typeof flag === 'number' && (flag & FEATURE_FLAG.ENABLED) !== 0\n if (editable) {\n const root = el\n // The node's own `<aglyn-text>` whenever it renders one, and the\n // root only as a fallback (AGL-2556). In-place editing EMPTIES\n // whatever it is given, so handing it a composite's root deletes\n // the chrome that composite built — for Accordion Summary that is\n // the content div carrying MUI's `textAlign: 'start'`, without\n // which the UA stylesheet centres the label inside the `<button>`\n // for as long as the edit is open.\n const element = findLeafTextElement(root) ?? root\n const rect = element.getBoundingClientRect()\n inlineTextEdit.open(\n node,\n {\n left: rect.left,\n top: rect.top,\n width: rect.width,\n height: rect.height,\n },\n undefined,\n // The measured element travels with the rect so the overlay can\n // re-measure on scroll instead of drifting (AGL-1644).\n element,\n )\n return true\n }\n // In-place markdown editing (AGL-1624): a component whose schema\n // declares a MARKDOWN attribute — the Markdown element's `content` is\n // the one that exists — opens the WYSIWYG over the element, editing\n // the whole document without a trip to the attributes panel.\n //\n // `stopPropagation` on the NATIVE event is what keeps the canvas still:\n // React delegates `onDoubleClick` at the root container, so an event\n // consumed here never reaches `ZoomablePanningComponent`'s\n // double-click-to-zoom. That is the same guarantee the textEditable\n // branch above has always relied on, not a new mechanism.\n const markdownAttribute = findMarkdownAttributeName(node)\n if (!markdownAttribute) return false\n const markdownElement = el\n const markdownRect = markdownElement.getBoundingClientRect()\n const stored = (node.props as Record<string, unknown> | undefined)?.[\n markdownAttribute\n ]\n // The two mousedowns of a double-click TOGGLE selection, so by the time\n // this fires the node has been selected and then deselected again.\n // Editing an element is selecting it — the attributes panel should be\n // showing it — and the editor closes when the selection moves off the\n // node, so it has to be put back before the editor opens.\n Besigner.focus.setSelectedNode(node)\n inlineMarkdownEdit.open(\n node,\n {\n left: markdownRect.left,\n top: markdownRect.top,\n width: markdownRect.width,\n height: markdownRect.height,\n },\n markdownAttribute,\n typeof stored === 'string' ? stored : '',\n markdownElement,\n )\n return true\n }\n /** True when the double-click resolved to a prop edit it opened. */\n function handleInstanceDoubleClick(pointer: ClientPoint) {\n const { definitions, onPickMedia } = instanceEditRef.current\n const refId = (node?.props as { refId?: string } | undefined)?.refId\n const definition = refId ? definitions?.[refId] : undefined\n const container = ref.current\n if (!definition || !container) return false\n const hit = findInstanceLeafAtPoint(\n container,\n pointer.clientX,\n pointer.clientY,\n )\n if (!hit) return false\n // Text first: a leaf whose `children` a declared prop feeds opens\n // the EXISTING inline editor, anchored on the clicked leaf, and the\n // commit writes propValues[prop] on the instance (one undo entry,\n // mirrored to peers like any node edit).\n const text = resolveInstanceLeafBinding(\n hit.graftedId,\n node.$id,\n definition,\n )\n if (text?.boundProp) {\n const rect = hit.element.getBoundingClientRect()\n const propName = text.boundProp\n // The schema of the element the prop fills decides the toolbar, as\n // a node's own schema does. Formatting is offered only when EVERY\n // element the prop fills draws markup: the graft hands the markup\n // to each of them, and one that ignores it would show bold that\n // never renders.\n const schemaOf = (id: string) =>\n components.getSchema(\n (definition.nodes as Record<string, { componentId?: string }>)[\n id\n ]?.componentId as Aglyn.ComponentId,\n )\n const rich = listPropFedTextNodeIds(definition.nodes, propName).every(\n (id) =>\n ((schemaOf(id)?.flags?.richTextEditable ??\n FEATURE_FLAG.DISABLED) &\n FEATURE_FLAG.ENABLED) !==\n 0,\n )\n inlineTextEdit.open(\n node,\n {\n left: rect.left,\n top: rect.top,\n width: rect.width,\n height: rect.height,\n },\n {\n propName,\n initialText: getInstanceEffectivePropText(\n node.props,\n definition.props,\n propName,\n ),\n schema: schemaOf(text.componentInternalId),\n rich,\n initialHtml: rich\n ? getInstanceEffectivePropHtml(\n node.props,\n definition.props,\n propName,\n )\n : '',\n },\n // The GRAFTED leaf, not the instance node: it is what was measured,\n // and it is the one anchor `Besigner.refs` could never supply\n // because it is not a canvas node (AGL-1644).\n hit.element,\n )\n return true\n }\n // Image half: `src` fed by a declared prop opens the host's media\n // picker, committing the picked value to the same propValues slot —\n // the exact pipeline the Attributes panel's Browse button uses.\n const src = resolveInstanceLeafBinding(\n hit.graftedId,\n node.$id,\n definition,\n 'src',\n )\n if (src?.boundProp && onPickMedia) {\n const propName = src.boundProp\n // The SAME leaf's `alt`, if the component author bound one to a\n // declared prop too (AGL-1896). Resolvable here and nowhere else\n // in the instance pipeline: this path starts from a concrete leaf\n // in the definition tree, so \"which declared prop feeds this\n // image's alt\" is a lookup rather than a guess. The attributes\n // panel only ever sees a declared prop's NAME, and no convention\n // says which other prop is its alt — so it does not try.\n const altBinding = resolveInstanceLeafBinding(\n hit.graftedId,\n node.$id,\n definition,\n 'alt',\n )\n onPickMedia((value, asset) => {\n // Written through verbatim (media reference or raw URL — the\n // host app decides; AGL-1215). Snapshot via toJSON like the\n // panel: updateNodeProps REPLACES the props object.\n const current = (canvas.toJSON().nodes as Record<string, any>)[\n node.$id\n ]\n // What the instance renders for the alt prop TODAY — its own\n // override, else the component's default. Not the raw override:\n // a component whose default alt is already a real sentence must\n // not have it replaced just because this instance never set one.\n const altPropName = altBinding?.boundProp\n const effectiveAlt = altPropName\n ? getInstanceEffectivePropText(\n current?.props,\n definition.props,\n altPropName,\n )\n : undefined\n const inheritedAlt = altPropName\n ? inheritedMediaAlt({\n placementAlt: effectiveAlt,\n assetAlt: asset?.alt,\n })\n : undefined\n canvas.updateNodeProps(node, {\n ...current?.props,\n [REUSABLE_INSTANCE_PROP_VALUES_KEY]: {\n ...current?.props?.[REUSABLE_INSTANCE_PROP_VALUES_KEY],\n [propName]: value,\n ...(inheritedAlt && altPropName\n ? { [altPropName]: inheritedAlt }\n : {}),\n },\n })\n })\n return true\n }\n return false\n }\n }, [node, element])\n\n return cloneElement(\n child,\n mergeProps(child.props, draggable.attributes, {\n ref: mergeRefs(\n ref,\n trackElement,\n child.props.ref,\n draggable.setNodeRef,\n droppable.setNodeRef,\n ),\n style,\n sx: {\n '&, &:hover, &:focus': {\n cursor: draggable.isDragging ? 'move' : 'initial',\n },\n },\n }),\n )\n },\n)\n\nDraggableDroppable.displayName = 'DraggableDroppable'\n\nexport default DraggableDroppable\n"],"names":["canvas","components","FEATURE_FLAG","getInstanceEffectivePropHtml","getInstanceEffectivePropText","inheritedMediaAlt","isDefinitionPlacement","listPropFedTextNodeIds","placementDefinitionFor","resolveInstanceLeafBinding","REUSABLE_INSTANCE_COMPONENT_ID","REUSABLE_INSTANCE_PROP_VALUES_KEY","Besigner","mergeRefs","useId","useDraggable","useDroppable","CSS","css","mergeProps","observer","Children","cloneElement","useCallback","useContext","useEffect","useRef","useState","ComponentPromotionContext","MediaPickerContext","findMarkdownAttributeName","inlineMarkdownEdit","inlineTextEdit","isInlineEditWithin","requestCanvasContextMenu","findInstanceLeafAtPoint","findPlacementPartAtPoint","pickPlacementPart","findLeafTextElement","holdKeyboardForEdit","repeatCopyAt","repeatCopyStandIns","DropSurface","TAP_SLOP_PX","TAP_MAX_MS","DOUBLE_TAP_WITHIN_MS","DOUBLE_TAP_SLOP_PX","distance","a","b","Math","hypot","x","y","DraggableDroppable","props","node","type","disableDragging","disableDropping","accept","children","idSuffix","id","$id","ref","element","setElement","trackElement","next","draggable","data","disabled","droppable","surface","CANVAS","getElement","current","transform","isTransforming","Boolean","child","only","style","outlineWidth","outlineOffset","outlineColor","outlineStyle","translate","Translate","toString","isOver","isDragging","opacity","cursor","pick","isPicking","focus","isNodeHovered","definitions","formDesigns","onPickMedia","instanceEditRef","listenersRef","listeners","refs","set","delete","handles","el","selectedAtPress","pressStart","lastTap","editOpenedByTapAt","Infinity","addEventListener","handleMouseOver","handleMouseDown","handleDoubleClick","handleContextMenu","handleTouchStart","handleTouchEnd","removeEventListener","e","touch","touches","length","undefined","clientX","clientY","at","timeStamp","selected","onTouchStart","nativeEvent","start","changedTouches","tap","first","openEditAt","preventDefault","stopPropagation","copy","target","original","setSelectedNode","setHoveredNode","isNodeSelected","handlePickClick","pointer","shiftKey","rangeSelectNode","handleNodeSelection","metaKey","ctrlKey","pickPartUnder","container","definition","key","graftedId","rootId","point","componentId","dnd","canDragNode","handleInstanceDoubleClick","flag","componentSchema","flags","textEditable","editable","ENABLED","root","rect","getBoundingClientRect","open","left","top","width","height","markdownAttribute","markdownElement","markdownRect","stored","refId","hit","text","boundProp","propName","schemaOf","getSchema","nodes","rich","every","richTextEditable","DISABLED","initialText","schema","componentInternalId","initialHtml","src","altBinding","value","asset","toJSON","altPropName","effectiveAlt","inheritedAlt","placementAlt","assetAlt","alt","updateNodeProps","attributes","setNodeRef","sx","displayName"],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC;AAGD,SACEA,MAAM,EACNC,UAAU,EACVC,YAAY,EACZC,4BAA4B,EAC5BC,4BAA4B,EAC5BC,iBAAiB,EACjBC,qBAAqB,EACrBC,sBAAsB,EACtBC,sBAAsB,EACtBC,0BAA0B,EAC1BC,8BAA8B,EAC9BC,iCAAiC,QAC5B,eAAc;AACrB,YAAYC,cAAc,kBAAiB;AAC3C,SAASC,SAAS,EAAEC,KAAK,QAAQ,uBAAsB;AACvD,SAASC,YAAY,EAAEC,YAAY,QAAQ,gBAAe;AAC1D,SAASC,OAAOC,GAAG,QAAQ,qBAAoB;AAC/C,SAASC,UAAU,QAAQ,oBAAmB;AAC9C,SAASC,QAAQ,QAAQ,kBAAiB;AAC1C,SACEC,QAAQ,EACRC,YAAY,EAEZC,WAAW,EACXC,UAAU,EACVC,SAAS,EACTC,MAAM,EACNC,QAAQ,QACH,QAAO;AACd,OAAOC,+BAA+B,gDAA4C;AAClF,SAASC,kBAAkB,QAAQ,yCAAqC;AACxE,SACEC,yBAAyB,EACzBC,kBAAkB,QACb,4CAAwC;AAC/C,SACEC,cAAc,EACdC,kBAAkB,QACb,wCAAoC;AAC3C,SAASC,wBAAwB,QAAQ,qCAAiC;AAC1E,SACEC,uBAAuB,EACvBC,wBAAwB,QACnB,mCAA+B;AACtC,SAASC,iBAAiB,QAAQ,qCAAiC;AACnE,SAASC,mBAAmB,QAAQ,uCAAmC;AACvE,SAASC,mBAAmB,QAAQ,gC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D;oBAC5D,oDAAoD;oBACpD,MAAMA,UAAU,AAAC7E,OAAO4M,MAAM,GAAGb,KAAK,AAAwB,CAC5DvI,KAAKQ,GAAG,CACT;oBACD,6DAA6D;oBAC7D,gEAAgE;oBAChE,gEAAgE;oBAChE,iEAAiE;oBACjE,MAAM6I,cAAcJ,8BAAAA,WAAYd,SAAS;oBACzC,MAAMmB,eAAeD,cACjBzM,6BACEyE,2BAAAA,QAAStB,KAAK,EACdsG,WAAWtG,KAAK,EAChBsJ,eAEF9E;oBACJ,MAAMgF,eAAeF,cACjBxM,kBAAkB;wBAChB2M,cAAcF;wBACdG,QAAQ,EAAEN,yBAAAA,MAAOO,GAAG;oBACtB,KACAnF;oBACJ/H,OAAOmN,eAAe,CAAC3J,MAAM,aACxBqB,2BAAAA,QAAStB,KAAK;wBACjB,CAAC5C,kCAAkC,EAAE,aAChCkE,4BAAAA,iBAAAA,QAAStB,KAAK,qBAAdsB,cAAgB,CAAClE,kCAAkC;4BACtD,CAACiL,SAAS,EAAEc;2BACRK,gBAAgBF,cAChB;4BAAE,CAACA,YAAY,EAAEE;wBAAa,IAC9B,CAAC;;gBAGX;gBACA,OAAO;YACT;YACA,OAAO;QACT;IACF,GAAG;QAACvJ;QAAMU;KAAQ;IAElB,qBAAO5C,aACL2D,OACA9D,WAAW8D,MAAM1B,KAAK,EAAEe,UAAU8I,UAAU,EAAE;QAC5CnJ,KAAKpD,UACHoD,KACAG,cACAa,MAAM1B,KAAK,CAACU,GAAG,EACfK,UAAU+I,UAAU,EACpB5I,UAAU4I,UAAU;QAEtBlI;QACAmI,IAAI;YACF,uBAAuB;gBACrBxH,QAAQxB,UAAUsB,UAAU,GAAG,SAAS;YAC1C;QACF;IACF;AAEJ,GACD;AAEDtC,mBAAmBiK,WAAW,GAAG;AAEjC,eAAejK,mBAAkB"}
|
|
@@ -775,7 +775,7 @@ export const NodeLeaf = observer(/*#__PURE__*/ forwardRef((props, ref)=>{
|
|
|
775
775
|
// Inert, like the component and form previews below: a copy is a
|
|
776
776
|
// picture of the template, not a document, so nothing in it is
|
|
777
777
|
// ever selected. A click on one goes to the element it draws —
|
|
778
|
-
// this leaf's own handlers redirect it (`
|
|
778
|
+
// this leaf's own handlers redirect it (`repeatCopyAt`).
|
|
779
779
|
/*#__PURE__*/ _jsxs(_Fragment, {
|
|
780
780
|
children: [
|
|
781
781
|
/*#__PURE__*/ _jsx("style", {
|