@archie/devtools 0.1.3 → 0.1.5
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/README.md +28 -0
- package/dist/{chunk-U4KG6UDY.mjs → chunk-ZG6HZFTJ.mjs} +1 -0
- package/dist/client/client.js +203 -93
- package/dist/client/client.mjs +203 -93
- package/dist/collection-binding.mjs +1 -1
- package/dist/index.d.mts +9 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.js +38 -1
- package/dist/index.mjs +38 -2
- package/dist/inspector.standalone.js +395 -25
- package/dist/{inspector.standalone@0.1.3.js → inspector.standalone@0.1.5.js} +395 -25
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -114,6 +114,21 @@ Consume `@8base-archie/editor-protocol` como fuente única del contrato
|
|
|
114
114
|
(`Vid`, `NodeMeta`, `LockReason`, los schemas Zod) — ver
|
|
115
115
|
`src/types/editor-meta.ts`, que re-exporta esos tipos en vez de duplicarlos.
|
|
116
116
|
|
|
117
|
+
### `data-vid` en build de producción
|
|
118
|
+
|
|
119
|
+
En `vite build` (`command === 'build'`), `archieDevTools()` elimina el
|
|
120
|
+
atributo JSX `data-vid` del código generado — nada en el pipeline de deploy
|
|
121
|
+
lo hace por su cuenta, y el atributo no aporta nada en runtime (la identidad
|
|
122
|
+
sigue disponible vía `__editorMeta.vid`, que no se toca). Solo `vite dev`
|
|
123
|
+
conserva `data-vid` sin cambios: este plugin corre en `transform`, así que
|
|
124
|
+
`vite preview` sirve el `dist/` ya construido por `vite build` y por lo
|
|
125
|
+
tanto NO conserva `data-vid` — es el mismo build de producción, no un
|
|
126
|
+
comando propio de este plugin. Opt-out explícito:
|
|
127
|
+
|
|
128
|
+
```ts
|
|
129
|
+
archieDevTools({ stripVidsInBuild: false })
|
|
130
|
+
```
|
|
131
|
+
|
|
117
132
|
## Local linking
|
|
118
133
|
|
|
119
134
|
```bash
|
|
@@ -138,3 +153,16 @@ Tests follow a colocated-by-feature convention:
|
|
|
138
153
|
- small modules keep `*.test.ts(x)` beside the source file
|
|
139
154
|
- larger subsystems may use a local `__tests__/` folder next to the feature
|
|
140
155
|
- `src/client/dnd/design-mode/__tests__/` is the reference pattern for multi-file feature coverage
|
|
156
|
+
|
|
157
|
+
## Release notes
|
|
158
|
+
|
|
159
|
+
### 0.1.5
|
|
160
|
+
|
|
161
|
+
Treats a JSX comment (`{/* ... */}`) as a plain container, not an expression
|
|
162
|
+
one — a container whose only non-element child is a comment now gets
|
|
163
|
+
`containerKind: 'plain'` instead of `'expression'`. **This is coupled to
|
|
164
|
+
archie-code-generation (acg) PR #416**: acg's own container-kind handling
|
|
165
|
+
must already treat `{/* ... */}` the same way before this version is
|
|
166
|
+
deployed, or containers that used to agree between the two will disagree
|
|
167
|
+
once 0.1.5 ships. No code-level gate enforces the pairing — deploy acg #416
|
|
168
|
+
first (or together with this version), not after.
|
|
@@ -182,6 +182,7 @@ function babelPluginEditorMeta({ types: t }, opts = {}) {
|
|
|
182
182
|
const allPlain = children.every((c) => {
|
|
183
183
|
if (t.isJSXElement(c)) return true;
|
|
184
184
|
if (t.isJSXText(c)) return c.value.trim() === "";
|
|
185
|
+
if (t.isJSXExpressionContainer(c) && t.isJSXEmptyExpression(c.expression)) return true;
|
|
185
186
|
return false;
|
|
186
187
|
});
|
|
187
188
|
return allPlain ? "plain" : "expression";
|
package/dist/client/client.js
CHANGED
|
@@ -5169,7 +5169,7 @@ function shouldShowGrabFeedback(target, scannedByNodeId) {
|
|
|
5169
5169
|
}
|
|
5170
5170
|
const nodeId = host.getAttribute(DND_NODE_ID_ATTR);
|
|
5171
5171
|
const scanned = nodeId ? scannedByNodeId.get(nodeId) : null;
|
|
5172
|
-
return !scanned || scanned
|
|
5172
|
+
return !scanned || !isEligibleForDrag(scanned);
|
|
5173
5173
|
}
|
|
5174
5174
|
function isEligibleForDrag(sc) {
|
|
5175
5175
|
if (sc.draggable === false) return false;
|
|
@@ -5179,6 +5179,9 @@ function isEligibleForDrag(sc) {
|
|
|
5179
5179
|
// Section, …) carrying the usage's projected meta.
|
|
5180
5180
|
source === "projected-usage";
|
|
5181
5181
|
}
|
|
5182
|
+
function filterEligibleForDrag(elements) {
|
|
5183
|
+
return elements.filter(isEligibleForDrag);
|
|
5184
|
+
}
|
|
5182
5185
|
function isPointerInEdgeZone(px, py, guard) {
|
|
5183
5186
|
return px <= guard || py <= guard || px >= window.innerWidth - guard || py >= window.innerHeight - guard;
|
|
5184
5187
|
}
|
|
@@ -5449,7 +5452,12 @@ function scanElements(root, depth = 0, usedNodeIds = /* @__PURE__ */ new Set(),
|
|
|
5449
5452
|
eligibilitySource: smallEligibility,
|
|
5450
5453
|
draggable: false,
|
|
5451
5454
|
identityOrigin: templateFrameLabel(identityMeta3),
|
|
5452
|
-
|
|
5455
|
+
// `identityMeta` here is already `projectUsageMeta(el) ??
|
|
5456
|
+
// surfaceMeta` (no `ownerMeta` fallback in this branch) — see
|
|
5457
|
+
// the main scan's own `editorMeta: usageMeta ?? surfaceMeta`
|
|
5458
|
+
// below for the full rationale (ARCH-883-KOI
|
|
5459
|
+
// draggable-eligibility parity fix).
|
|
5460
|
+
editorMeta: identityMeta3
|
|
5453
5461
|
});
|
|
5454
5462
|
}
|
|
5455
5463
|
}
|
|
@@ -5524,7 +5532,29 @@ function scanElements(root, depth = 0, usedNodeIds = /* @__PURE__ */ new Set(),
|
|
|
5524
5532
|
containerStrategy,
|
|
5525
5533
|
eligibilitySource: inferredEligibility,
|
|
5526
5534
|
identityOrigin: templateFrameLabel(identityMeta2),
|
|
5527
|
-
|
|
5535
|
+
// `usageMeta ?? surfaceMeta`, NOT `identityMeta` (which also falls
|
|
5536
|
+
// back to `ownerMeta`): `isEligibleForDrag` (`isNonDraggableNodeMeta`)
|
|
5537
|
+
// reads THIS field to gate the actual drag start, and `surfaceMeta`
|
|
5538
|
+
// names the kit TEMPLATE's own meta (`isKitOrigin: true`) for any
|
|
5539
|
+
// kit-rendered host — even one this scan just correctly computed
|
|
5540
|
+
// `draggable: true` for via the SAME `usageMeta` projection above (a
|
|
5541
|
+
// `<Kit.Card>` usage's single host root). Storing `surfaceMeta` here
|
|
5542
|
+
// silently re-refused every such drag at gesture start (ARCH-883-KOI
|
|
5543
|
+
// draggable-eligibility parity fix). Falling back to `identityMeta`
|
|
5544
|
+
// instead of `usageMeta` would overcorrect: `ownerMeta` (a STRUCTURAL
|
|
5545
|
+
// ancestor's meta, borrowed only for `sourceMetaNodeId` on an
|
|
5546
|
+
// inferred-sortable-descendant with no meta of its own) is not this
|
|
5547
|
+
// element's own identity and must not leak into its eligibility/lock
|
|
5548
|
+
// reporting — `scanner-ast-first.test.ts`'s "free of structural owner
|
|
5549
|
+
// meta contamination" pins `editorMeta` staying `undefined` there.
|
|
5550
|
+
//
|
|
5551
|
+
// A meta-less host projected by `computeUsageMeta` onto its component
|
|
5552
|
+
// usage (e.g. `<MetricCard label="x"/>`'s host, `fiber-bridge.ts`)
|
|
5553
|
+
// inherits that usage's own `containerKind` — usually `'none'` for a
|
|
5554
|
+
// self-closing usage — so a drop INTO it now correctly refuses
|
|
5555
|
+
// CONTAINER_NOT_PLAIN: the host is a component instance, not a plain
|
|
5556
|
+
// JSX container in the user's own file, matching acg.
|
|
5557
|
+
editorMeta: usageMeta ?? surfaceMeta
|
|
5528
5558
|
});
|
|
5529
5559
|
if (!isSvgRoot) results.push(...scanElements(el, depth + 1, usedNodeIds, seenResolvedHosts, resolvedUnreported));
|
|
5530
5560
|
} else {
|
|
@@ -5548,7 +5578,8 @@ function buildMovedElementEntry(el, usedNodeIds) {
|
|
|
5548
5578
|
const parentEl = el.parentElement;
|
|
5549
5579
|
const surfaceMeta = getDirectEditorMeta(el) ?? void 0;
|
|
5550
5580
|
const ownerMeta = getEditorMeta(el);
|
|
5551
|
-
const
|
|
5581
|
+
const usageMeta = projectUsageMeta(el);
|
|
5582
|
+
const identityMeta2 = usageMeta ?? ownerMeta ?? surfaceMeta;
|
|
5552
5583
|
const selector = getUniqueSelector(el);
|
|
5553
5584
|
const eligibility = isInspectorEligible(el);
|
|
5554
5585
|
return {
|
|
@@ -5569,7 +5600,11 @@ function buildMovedElementEntry(el, usedNodeIds) {
|
|
|
5569
5600
|
containerStrategy: parentEl && isFlexOrGridParent(parentEl) ? resolveContainerStrategy(parentEl) : null,
|
|
5570
5601
|
eligibilitySource: eligibility ?? "force-allow",
|
|
5571
5602
|
identityOrigin: templateFrameLabel(identityMeta2),
|
|
5572
|
-
|
|
5603
|
+
// `usageMeta ?? surfaceMeta`, NOT `identityMeta` — same fix, same reason
|
|
5604
|
+
// as the main scan's own `editorMeta` (see there): `ownerMeta` is a
|
|
5605
|
+
// structural ancestor's meta borrowed only for `sourceMetaNodeId`/
|
|
5606
|
+
// `draggable`, and must not leak into eligibility/lock reporting.
|
|
5607
|
+
editorMeta: usageMeta ?? surfaceMeta
|
|
5573
5608
|
};
|
|
5574
5609
|
}
|
|
5575
5610
|
function useElementScanner(enabled) {
|
|
@@ -8303,6 +8338,7 @@ function useDragVisualLoop({
|
|
|
8303
8338
|
|
|
8304
8339
|
// src/client/dnd/design-mode/useDragLifecycle.ts
|
|
8305
8340
|
var import_react13 = require("react");
|
|
8341
|
+
var GATE_REJECT = "GATE_REJECT";
|
|
8306
8342
|
function emitRefused(code, cause, vid) {
|
|
8307
8343
|
dispatchRuntimeEvent({
|
|
8308
8344
|
type: "drag-refused",
|
|
@@ -8323,6 +8359,41 @@ function buildDragIntentEngineOptions(anchorElement, srcContainerId, blockedCont
|
|
|
8323
8359
|
blockedContainerIds
|
|
8324
8360
|
};
|
|
8325
8361
|
}
|
|
8362
|
+
function resolveDragEndRefusal(params) {
|
|
8363
|
+
if (!params.hasDragSession || params.blockedByGuard) return { kind: "silent" };
|
|
8364
|
+
if (!params.hasActiveElement || !params.hasSourcePosition) {
|
|
8365
|
+
return {
|
|
8366
|
+
kind: "refuse",
|
|
8367
|
+
code: GATE_REJECT,
|
|
8368
|
+
cause: "Drag ended with no resolvable source position for the dragged node."
|
|
8369
|
+
};
|
|
8370
|
+
}
|
|
8371
|
+
if (!params.hasNestTarget && !params.intentValid) {
|
|
8372
|
+
return {
|
|
8373
|
+
kind: "refuse",
|
|
8374
|
+
code: GATE_REJECT,
|
|
8375
|
+
cause: "No droppable target was resolved under the pointer for this drag."
|
|
8376
|
+
};
|
|
8377
|
+
}
|
|
8378
|
+
return { kind: "continue" };
|
|
8379
|
+
}
|
|
8380
|
+
function resolveDragEndBranch(params) {
|
|
8381
|
+
if (!params.dropTargetExistsInMap) return { kind: "refuse", reason: "drop-target-missing" };
|
|
8382
|
+
if (!params.dropTargetIsDroppable) return { kind: "refuse", reason: "drop-target-not-droppable" };
|
|
8383
|
+
if (params.hasNestTarget) {
|
|
8384
|
+
if (params.nestIsSelfOrDescendant) return { kind: "refuse", reason: "nest-self-or-descendant" };
|
|
8385
|
+
if (params.nestIsAncestor) return { kind: "refuse", reason: "nest-ancestor" };
|
|
8386
|
+
if (!params.nestHasCommitNodeId) return { kind: "refuse", reason: "nest-no-commit-node" };
|
|
8387
|
+
return { kind: "nest" };
|
|
8388
|
+
}
|
|
8389
|
+
if (params.intentIsReorder) {
|
|
8390
|
+
if (!params.hasResolvedReorder || !params.resolvedReorderMatchesIntent) {
|
|
8391
|
+
return { kind: "refuse", reason: "stale-reorder" };
|
|
8392
|
+
}
|
|
8393
|
+
return { kind: "reorder" };
|
|
8394
|
+
}
|
|
8395
|
+
return { kind: "refuse", reason: "no-move" };
|
|
8396
|
+
}
|
|
8326
8397
|
function buildRuntimeIdentityLocal(nodeId, resolveNodeElement, effectiveLaneSnapshot) {
|
|
8327
8398
|
if (!nodeId) return null;
|
|
8328
8399
|
const element = resolveNodeElement(nodeId);
|
|
@@ -8576,7 +8647,7 @@ function useDragLifecycle({
|
|
|
8576
8647
|
draggable: found.draggable
|
|
8577
8648
|
});
|
|
8578
8649
|
emitRefused(
|
|
8579
|
-
resolveRefusalCode(found.editorMeta,
|
|
8650
|
+
resolveRefusalCode(found.editorMeta, GATE_REJECT),
|
|
8580
8651
|
"Node is not draggable (dynamic render, chrome, or kit-origin).",
|
|
8581
8652
|
resolveVidForScannedNode(activeId, refs.nodeMapRef.current, found.element)
|
|
8582
8653
|
);
|
|
@@ -8605,7 +8676,7 @@ function useDragLifecycle({
|
|
|
8605
8676
|
const anchorScanned = refs.nodeMapRef.current.get(anchor.anchorNodeId) ?? found;
|
|
8606
8677
|
if (!anchorScanned || !isEligibleForDrag(anchorScanned)) {
|
|
8607
8678
|
emitRefused(
|
|
8608
|
-
resolveRefusalCode(anchorScanned?.editorMeta,
|
|
8679
|
+
resolveRefusalCode(anchorScanned?.editorMeta, GATE_REJECT),
|
|
8609
8680
|
"Resolved drag anchor is not draggable.",
|
|
8610
8681
|
resolveVidForScannedNode(
|
|
8611
8682
|
anchor.anchorNodeId,
|
|
@@ -8695,90 +8766,131 @@ function useDragLifecycle({
|
|
|
8695
8766
|
const intentHasContainer = intent ? refs.projectionRef.current.containerIndex.has(intent.containerId) : false;
|
|
8696
8767
|
const intentHasSlot = intent ? intent.mode === "nest" || refs.projectionRef.current.slotIndex.has(intent.slotId) : false;
|
|
8697
8768
|
const intentValid = !!intent && intentHasContainer && intentHasSlot;
|
|
8698
|
-
|
|
8699
|
-
|
|
8700
|
-
|
|
8701
|
-
|
|
8702
|
-
|
|
8703
|
-
|
|
8704
|
-
|
|
8705
|
-
|
|
8706
|
-
|
|
8707
|
-
|
|
8708
|
-
|
|
8709
|
-
|
|
8710
|
-
|
|
8711
|
-
|
|
8712
|
-
|
|
8713
|
-
|
|
8714
|
-
|
|
8715
|
-
|
|
8716
|
-
|
|
8717
|
-
|
|
8718
|
-
|
|
8719
|
-
|
|
8720
|
-
|
|
8721
|
-
|
|
8722
|
-
|
|
8723
|
-
|
|
8769
|
+
const anchorVid = () => resolveVidForScannedNode(anchorNodeId, refs.nodeMapRef.current, activeEl);
|
|
8770
|
+
const gate = resolveDragEndRefusal({
|
|
8771
|
+
hasDragSession: !!dragSession,
|
|
8772
|
+
blockedByGuard,
|
|
8773
|
+
hasActiveElement: !!activeEl,
|
|
8774
|
+
hasSourcePosition: !!sourcePos,
|
|
8775
|
+
hasNestTarget: !!nestTarget,
|
|
8776
|
+
intentValid
|
|
8777
|
+
});
|
|
8778
|
+
if (gate.kind === "silent") {
|
|
8779
|
+
clearDragState();
|
|
8780
|
+
syncHistoryAvailability();
|
|
8781
|
+
return;
|
|
8782
|
+
}
|
|
8783
|
+
if (gate.kind === "refuse") {
|
|
8784
|
+
emitRefused(gate.code, gate.cause, anchorVid());
|
|
8785
|
+
clearDragState();
|
|
8786
|
+
syncHistoryAvailability();
|
|
8787
|
+
return;
|
|
8788
|
+
}
|
|
8789
|
+
const el = activeEl;
|
|
8790
|
+
const pos = sourcePos;
|
|
8791
|
+
const dropTargetId = nestTarget?.nodeId ?? intent?.containerId;
|
|
8792
|
+
const resolvedReorder = refs.resolvedReorderRef.current;
|
|
8793
|
+
const branch = resolveDragEndBranch({
|
|
8794
|
+
dropTargetExistsInMap: refs.nodeMapRef.current.has(dropTargetId),
|
|
8795
|
+
dropTargetIsDroppable: !!refs.droppableContainerIdsRef.current?.has(dropTargetId),
|
|
8796
|
+
hasNestTarget: !!nestTarget,
|
|
8797
|
+
nestIsSelfOrDescendant: !!nestTarget && el.contains(nestTarget.element),
|
|
8798
|
+
nestIsAncestor: !!nestTarget && nestTarget.element.contains(el),
|
|
8799
|
+
nestHasCommitNodeId: !!pos.commitNodeId,
|
|
8800
|
+
intentIsReorder: intentValid && intent?.mode === "reorder",
|
|
8801
|
+
hasResolvedReorder: !!resolvedReorder,
|
|
8802
|
+
resolvedReorderMatchesIntent: !!resolvedReorder && !!intent && resolvedReorder.visual.containerId === intent.containerId
|
|
8803
|
+
});
|
|
8804
|
+
if (branch.kind === "refuse") {
|
|
8805
|
+
switch (branch.reason) {
|
|
8806
|
+
case "drop-target-missing":
|
|
8807
|
+
emitRefused(
|
|
8808
|
+
"VID_NOT_FOUND",
|
|
8809
|
+
"Drop target no longer exists.",
|
|
8810
|
+
resolveVidForScannedNodeStrict(dropTargetId, refs.nodeMapRef.current)
|
|
8724
8811
|
);
|
|
8725
|
-
|
|
8726
|
-
|
|
8727
|
-
|
|
8728
|
-
|
|
8729
|
-
|
|
8730
|
-
|
|
8731
|
-
|
|
8732
|
-
|
|
8733
|
-
|
|
8734
|
-
} else if (intentValid && intent.mode === "reorder") {
|
|
8735
|
-
const resolvedReorder = refs.resolvedReorderRef.current;
|
|
8736
|
-
if (!resolvedReorder || resolvedReorder.visual.containerId !== intent.containerId) {
|
|
8737
|
-
clearDragState();
|
|
8738
|
-
syncHistoryAvailability();
|
|
8739
|
-
return;
|
|
8740
|
-
}
|
|
8741
|
-
const targetPlacement = resolvedReorder.commit;
|
|
8742
|
-
command = {
|
|
8743
|
-
type: classifyCommandType(sourcePos, targetPlacement, false),
|
|
8744
|
-
nodeId: anchorNodeId,
|
|
8745
|
-
commitNodeId: targetPlacement.commitNodeId,
|
|
8746
|
-
from: sourcePos,
|
|
8747
|
-
to: targetPlacement,
|
|
8748
|
-
at: Date.now()
|
|
8749
|
-
};
|
|
8750
|
-
}
|
|
8751
|
-
if (command) {
|
|
8752
|
-
const anchorEl = resolveNodeElement(anchorNodeId) ?? activeEl;
|
|
8753
|
-
const selectedEl = resolveNodeElement(selectedNodeId) ?? anchorEl;
|
|
8754
|
-
const nodeKey = getNodeKeyFromElement(anchorEl);
|
|
8755
|
-
const inspRef = getInspectorRefFromElement(anchorEl);
|
|
8756
|
-
const selectedNodeKey = getNodeKeyFromElement(selectedEl);
|
|
8757
|
-
const selectedInspectorRef = getInspectorRefFromElement(selectedEl);
|
|
8758
|
-
const sourceLaneSnapshot = refs.sourceCommitLaneRef.current ?? getCommitLaneSnapshot(command.from.laneContainerId);
|
|
8759
|
-
const targetLaneSnapshot = command.to.laneContainerId === command.from.laneContainerId ? sourceLaneSnapshot : getCommitLaneSnapshot(command.to.laneContainerId);
|
|
8760
|
-
const committed = refs.historyRef.current.execute(command, applyCommand);
|
|
8761
|
-
if (committed) {
|
|
8762
|
-
activeEl.setAttribute("data-dnd-moved", "");
|
|
8763
|
-
selectElement(null);
|
|
8764
|
-
recordCommittedMove({
|
|
8765
|
-
command,
|
|
8766
|
-
anchorNodeId,
|
|
8767
|
-
selectedNodeId,
|
|
8768
|
-
anchorEl,
|
|
8769
|
-
selectedEl,
|
|
8770
|
-
nodeKey,
|
|
8771
|
-
inspRef,
|
|
8772
|
-
selectedNodeKey,
|
|
8773
|
-
selectedInspectorRef,
|
|
8774
|
-
sourceLaneSnapshot,
|
|
8775
|
-
targetLaneSnapshot,
|
|
8776
|
-
resolveNodeElement,
|
|
8777
|
-
recordMoveChange,
|
|
8778
|
-
nodeMap: refs.nodeMapRef.current
|
|
8779
|
-
});
|
|
8812
|
+
break;
|
|
8813
|
+
case "drop-target-not-droppable": {
|
|
8814
|
+
const targetMeta = refs.nodeMapRef.current.get(dropTargetId)?.editorMeta;
|
|
8815
|
+
emitRefused(
|
|
8816
|
+
resolveRefusalCode(targetMeta, "CONTAINER_NOT_PLAIN"),
|
|
8817
|
+
"Drop target is outside the droppable set for this node.",
|
|
8818
|
+
resolveVidForScannedNode(dropTargetId, refs.nodeMapRef.current, resolveNodeElement(dropTargetId))
|
|
8819
|
+
);
|
|
8820
|
+
break;
|
|
8780
8821
|
}
|
|
8822
|
+
case "nest-self-or-descendant":
|
|
8823
|
+
emitRefused(GATE_REJECT, "Cannot nest an element into itself or its own descendant.", anchorVid());
|
|
8824
|
+
break;
|
|
8825
|
+
case "nest-ancestor":
|
|
8826
|
+
emitRefused(GATE_REJECT, "Cannot nest an element into its own ancestor.", anchorVid());
|
|
8827
|
+
break;
|
|
8828
|
+
case "nest-no-commit-node":
|
|
8829
|
+
emitRefused(GATE_REJECT, "Cannot resolve the dragged node's source position for nesting.", anchorVid());
|
|
8830
|
+
break;
|
|
8831
|
+
case "stale-reorder":
|
|
8832
|
+
emitRefused(GATE_REJECT, "Resolved reorder placement no longer matches the drag intent.", anchorVid());
|
|
8833
|
+
break;
|
|
8834
|
+
case "no-move":
|
|
8835
|
+
emitRefused(GATE_REJECT, "Could not build a move for the resolved drag intent.", anchorVid());
|
|
8836
|
+
break;
|
|
8781
8837
|
}
|
|
8838
|
+
clearDragState();
|
|
8839
|
+
syncHistoryAvailability();
|
|
8840
|
+
return;
|
|
8841
|
+
}
|
|
8842
|
+
const command = branch.kind === "nest" ? (() => {
|
|
8843
|
+
const target = nestTarget;
|
|
8844
|
+
const nestPlacement = resolveAppendCommitPlacement(target.element, pos.commitNodeId, target.nodeId);
|
|
8845
|
+
return {
|
|
8846
|
+
type: classifyCommandType(pos, nestPlacement, true),
|
|
8847
|
+
nodeId: anchorNodeId,
|
|
8848
|
+
commitNodeId: pos.commitNodeId,
|
|
8849
|
+
from: pos,
|
|
8850
|
+
to: nestPlacement,
|
|
8851
|
+
at: Date.now()
|
|
8852
|
+
};
|
|
8853
|
+
})() : (() => {
|
|
8854
|
+
const targetPlacement = resolvedReorder.commit;
|
|
8855
|
+
return {
|
|
8856
|
+
type: classifyCommandType(pos, targetPlacement, false),
|
|
8857
|
+
nodeId: anchorNodeId,
|
|
8858
|
+
commitNodeId: targetPlacement.commitNodeId,
|
|
8859
|
+
from: pos,
|
|
8860
|
+
to: targetPlacement,
|
|
8861
|
+
at: Date.now()
|
|
8862
|
+
};
|
|
8863
|
+
})();
|
|
8864
|
+
const anchorEl = resolveNodeElement(anchorNodeId) ?? el;
|
|
8865
|
+
const selectedEl = resolveNodeElement(selectedNodeId) ?? anchorEl;
|
|
8866
|
+
const nodeKey = getNodeKeyFromElement(anchorEl);
|
|
8867
|
+
const inspRef = getInspectorRefFromElement(anchorEl);
|
|
8868
|
+
const selectedNodeKey = getNodeKeyFromElement(selectedEl);
|
|
8869
|
+
const selectedInspectorRef = getInspectorRefFromElement(selectedEl);
|
|
8870
|
+
const sourceLaneSnapshot = refs.sourceCommitLaneRef.current ?? getCommitLaneSnapshot(command.from.laneContainerId);
|
|
8871
|
+
const targetLaneSnapshot = command.to.laneContainerId === command.from.laneContainerId ? sourceLaneSnapshot : getCommitLaneSnapshot(command.to.laneContainerId);
|
|
8872
|
+
const committed = refs.historyRef.current.execute(command, applyCommand);
|
|
8873
|
+
if (committed) {
|
|
8874
|
+
el.setAttribute("data-dnd-moved", "");
|
|
8875
|
+
selectElement(null);
|
|
8876
|
+
recordCommittedMove({
|
|
8877
|
+
command,
|
|
8878
|
+
anchorNodeId,
|
|
8879
|
+
selectedNodeId,
|
|
8880
|
+
anchorEl,
|
|
8881
|
+
selectedEl,
|
|
8882
|
+
nodeKey,
|
|
8883
|
+
inspRef,
|
|
8884
|
+
selectedNodeKey,
|
|
8885
|
+
selectedInspectorRef,
|
|
8886
|
+
sourceLaneSnapshot,
|
|
8887
|
+
targetLaneSnapshot,
|
|
8888
|
+
resolveNodeElement,
|
|
8889
|
+
recordMoveChange,
|
|
8890
|
+
nodeMap: refs.nodeMapRef.current
|
|
8891
|
+
});
|
|
8892
|
+
} else {
|
|
8893
|
+
emitRefused(GATE_REJECT, "The resolved move could not be applied.", anchorVid());
|
|
8782
8894
|
}
|
|
8783
8895
|
clearDragState();
|
|
8784
8896
|
syncHistoryAvailability();
|
|
@@ -9317,7 +9429,7 @@ function HitArea({
|
|
|
9317
9429
|
"div",
|
|
9318
9430
|
{
|
|
9319
9431
|
ref: divRef,
|
|
9320
|
-
"data-design-mode-ui":
|
|
9432
|
+
"data-design-mode-ui": "hit-area",
|
|
9321
9433
|
style: { position: "fixed", left, top, width, height, zIndex: 99998, cursor },
|
|
9322
9434
|
onPointerMove: (e) => {
|
|
9323
9435
|
if (!isSelected || isDragging) {
|
|
@@ -9408,9 +9520,7 @@ function DesignModeOverlay() {
|
|
|
9408
9520
|
const draggableElements = (0, import_react16.useMemo)(() => {
|
|
9409
9521
|
if (elements.length === 0) return [];
|
|
9410
9522
|
const projection = buildProjection(elements);
|
|
9411
|
-
return collectDraggableAnchors(elements, projection, nodeMap)
|
|
9412
|
-
(el) => el.draggable !== false
|
|
9413
|
-
);
|
|
9523
|
+
return filterEligibleForDrag(collectDraggableAnchors(elements, projection, nodeMap));
|
|
9414
9524
|
}, [elements, nodeMap]);
|
|
9415
9525
|
const arrangeHitAreaElement = (0, import_react16.useMemo)(() => {
|
|
9416
9526
|
if (!arrangeSelectedNodeId) return null;
|
|
@@ -10020,7 +10130,7 @@ function isPreviewOrigin(origin) {
|
|
|
10020
10130
|
var DEFAULT_SCRIPT_ID = "archie-inspector-script";
|
|
10021
10131
|
var R2_INSPECTOR_BASE_URL = "https://pub-bf238c278d9644b39ec34ecaca1d315c.r2.dev";
|
|
10022
10132
|
function readBuildVersion() {
|
|
10023
|
-
return "0.1.
|
|
10133
|
+
return "0.1.5" ? "0.1.5" : null;
|
|
10024
10134
|
}
|
|
10025
10135
|
var REMOTE_INSPECTOR_VERSION = readBuildVersion();
|
|
10026
10136
|
var isRemoteInspectorUrlVersioned = REMOTE_INSPECTOR_VERSION !== null;
|