@beyondwork/docx-react-component 1.0.106 → 1.0.109
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 +19 -5
- package/src/api/geometry-overlay-rects.ts +5 -0
- package/src/api/package-version.ts +1 -1
- package/src/api/page-anchor-id.ts +5 -0
- package/src/api/public-types.ts +16 -9
- package/src/api/table-node-specs.ts +6 -0
- package/src/api/v3/_create.ts +2 -1
- package/src/api/v3/_page-anchor-id.ts +52 -0
- package/src/api/v3/_runtime-handle.ts +92 -1
- package/src/api/v3/ai/_audit-time.ts +5 -0
- package/src/api/v3/ai/_pe2-evidence.ts +38 -0
- package/src/api/v3/ai/attach.ts +7 -2
- package/src/api/v3/ai/replacement.ts +101 -18
- package/src/api/v3/ai/resolve.ts +2 -2
- package/src/api/v3/ai/review.ts +177 -3
- package/src/api/v3/index.ts +1 -0
- package/src/api/v3/runtime/collab.ts +462 -0
- package/src/api/v3/runtime/document.ts +503 -20
- package/src/api/v3/runtime/geometry.ts +97 -0
- package/src/api/v3/runtime/layout.ts +744 -0
- package/src/api/v3/runtime/perf-probe.ts +14 -0
- package/src/api/v3/runtime/viewport.ts +9 -8
- package/src/api/v3/ui/_types.ts +149 -55
- package/src/api/v3/ui/chrome-preset-model.ts +5 -5
- package/src/api/v3/ui/debug.ts +115 -2
- package/src/api/v3/ui/index.ts +13 -0
- package/src/api/v3/ui/overlays.ts +0 -8
- package/src/api/v3/ui/surface.ts +56 -0
- package/src/api/v3/ui/viewport.ts +22 -9
- package/src/core/commands/image-commands.ts +1 -0
- package/src/core/commands/index.ts +6 -0
- package/src/core/schema/text-schema.ts +43 -5
- package/src/core/selection/mapping.ts +8 -1
- package/src/core/selection/review-anchors.ts +5 -1
- package/src/core/state/text-transaction.ts +8 -2
- package/src/io/export/serialize-revisions.ts +149 -1
- package/src/io/normalize/normalize-text.ts +6 -0
- package/src/io/ooxml/parse-bookmark-references.ts +55 -0
- package/src/io/ooxml/parse-fields.ts +24 -2
- package/src/io/ooxml/parse-headers-footers.ts +38 -5
- package/src/io/ooxml/parse-main-document.ts +153 -9
- package/src/io/ooxml/parse-numbering.ts +20 -0
- package/src/io/ooxml/parse-revisions.ts +19 -8
- package/src/io/opc/package-reader.ts +98 -8
- package/src/model/anchor.ts +4 -3
- package/src/model/canonical-document.ts +220 -2
- package/src/model/canonical-hash.ts +221 -0
- package/src/model/canonical-layout-inputs.ts +245 -6
- package/src/model/layout/index.ts +1 -0
- package/src/model/layout/page-graph-types.ts +118 -1
- package/src/model/review/revision-types.ts +14 -3
- package/src/preservation/store.ts +20 -4
- package/src/review/README.md +1 -1
- package/src/review/store/revision-actions.ts +14 -2
- package/src/runtime/collab/event-types.ts +67 -1
- package/src/runtime/collab/runtime-collab-sync.ts +177 -5
- package/src/runtime/diagnostics/layout-guard-warning.ts +18 -0
- package/src/runtime/document-heading-outline.ts +147 -0
- package/src/runtime/document-navigation.ts +8 -243
- package/src/runtime/document-runtime.ts +240 -97
- package/src/runtime/edit-dispatch/dispatch-text-command.ts +11 -0
- package/src/runtime/formatting/layout-inputs.ts +38 -5
- package/src/runtime/formatting/numbering/geometry.ts +28 -2
- package/src/runtime/geometry/adjacent-geometry-intake.ts +835 -0
- package/src/runtime/geometry/caret-geometry.ts +5 -6
- package/src/runtime/geometry/geometry-facet.ts +60 -10
- package/src/runtime/geometry/geometry-index.ts +591 -20
- package/src/runtime/geometry/geometry-types.ts +59 -0
- package/src/runtime/geometry/hit-test.ts +11 -1
- package/src/runtime/geometry/overlay-rects.ts +5 -3
- package/src/runtime/geometry/project-anchors.ts +1 -1
- package/src/runtime/geometry/word-layout-v2-line-intake.ts +323 -0
- package/src/runtime/layout/index.ts +6 -0
- package/src/runtime/layout/layout-engine-instance.ts +6 -1
- package/src/runtime/layout/layout-engine-version.ts +181 -16
- package/src/runtime/layout/layout-facet-types.ts +6 -0
- package/src/runtime/layout/page-graph.ts +21 -4
- package/src/runtime/layout/paginated-layout-engine.ts +139 -15
- package/src/runtime/layout/project-block-fragments.ts +265 -7
- package/src/runtime/layout/public-facet.ts +78 -24
- package/src/runtime/layout/table-row-continuation-contract.ts +107 -0
- package/src/runtime/layout/table-row-split.ts +92 -35
- package/src/runtime/prerender/cache-envelope.ts +2 -2
- package/src/runtime/prerender/cache-key.ts +5 -4
- package/src/runtime/prerender/customxml-cache.ts +0 -1
- package/src/runtime/render/render-kernel.ts +1 -1
- package/src/runtime/revision-runtime.ts +112 -10
- package/src/runtime/scopes/_scope-dependencies.ts +1 -0
- package/src/runtime/scopes/action-validation.ts +22 -2
- package/src/runtime/scopes/capabilities.ts +316 -0
- package/src/runtime/scopes/compile-scope-bundle.ts +14 -0
- package/src/runtime/scopes/compiler-service.ts +108 -4
- package/src/runtime/scopes/content-control-evidence.ts +79 -0
- package/src/runtime/scopes/create-issue.ts +5 -5
- package/src/runtime/scopes/evidence.ts +91 -0
- package/src/runtime/scopes/formatting/apply.ts +2 -0
- package/src/runtime/scopes/geometry-evidence.ts +130 -0
- package/src/runtime/scopes/index.ts +54 -0
- package/src/runtime/scopes/issue-lifecycle.ts +224 -0
- package/src/runtime/scopes/layout-evidence.ts +374 -0
- package/src/runtime/scopes/multi-paragraph-refusal.ts +37 -0
- package/src/runtime/scopes/preservation-boundary.ts +7 -1
- package/src/runtime/scopes/replacement/apply.ts +97 -34
- package/src/runtime/scopes/scope-kinds/paragraph.ts +108 -12
- package/src/runtime/scopes/semantic-scope-types.ts +242 -3
- package/src/runtime/scopes/visualization.ts +28 -0
- package/src/runtime/surface-projection.ts +44 -5
- package/src/runtime/telemetry/perf-probe.ts +216 -0
- package/src/runtime/virtualized-rendering.ts +36 -1
- package/src/runtime/workflow/ai-issue-lifecycle.ts +253 -0
- package/src/runtime/workflow/coordinator.ts +39 -11
- package/src/runtime/workflow/derived-scope-resolver.ts +63 -9
- package/src/runtime/workflow/index.ts +3 -0
- package/src/runtime/workflow/overlay-lane-types.ts +58 -0
- package/src/runtime/workflow/overlay-lanes.ts +168 -10
- package/src/runtime/workflow/overlay-store.ts +2 -2
- package/src/runtime/workflow/redline-posture-calibration.ts +257 -0
- package/src/runtime/workflow/word-field-matrix-calibration.ts +231 -0
- package/src/session/_sync-legacy.ts +17 -27
- package/src/session/import/loader.ts +6 -4
- package/src/session/import/source-package-evidence.ts +186 -2
- package/src/session/index.ts +5 -6
- package/src/session/session.ts +30 -56
- package/src/session/types.ts +8 -13
- package/src/shell/session-bootstrap.ts +155 -81
- package/src/ui/WordReviewEditor.tsx +520 -12
- package/src/ui/editor-shell-view.tsx +14 -4
- package/src/ui/editor-surface-controller.tsx +5 -3
- package/src/ui/headless/selection-tool-resolver.ts +1 -2
- package/src/ui/presence-overlay-lane.ts +0 -1
- package/src/ui/ui-controller-factory.ts +7 -0
- package/src/ui-tailwind/chrome/build-context-menu-entries.ts +5 -1
- package/src/ui-tailwind/chrome/editor-action-registry.ts +105 -5
- package/src/ui-tailwind/chrome/editor-actions-to-palette.ts +7 -0
- package/src/ui-tailwind/chrome/layer-debug-contracts.ts +208 -0
- package/src/ui-tailwind/chrome/resolve-target-kind.ts +13 -0
- package/src/ui-tailwind/chrome/tw-alert-banner.tsx +11 -3
- package/src/ui-tailwind/chrome/tw-command-palette.tsx +36 -6
- package/src/ui-tailwind/chrome/tw-context-menu.tsx +6 -1
- package/src/ui-tailwind/chrome/tw-display-mode-selector.tsx +42 -109
- package/src/ui-tailwind/chrome/tw-inline-find-bar.tsx +26 -6
- package/src/ui-tailwind/chrome/tw-navigation-command-bar.tsx +328 -0
- package/src/ui-tailwind/chrome/tw-object-context-toolbar.tsx +8 -4
- package/src/ui-tailwind/chrome/tw-runtime-repl-dialog.tsx +129 -1
- package/src/ui-tailwind/chrome/tw-selection-tool-host.tsx +19 -5
- package/src/ui-tailwind/chrome/tw-selection-tool-structure.tsx +5 -1
- package/src/ui-tailwind/chrome/tw-workspace-chrome-host.tsx +28 -12
- package/src/ui-tailwind/chrome-overlay/tw-chrome-overlay.tsx +30 -3
- package/src/ui-tailwind/chrome-overlay/tw-object-selection-overlay.tsx +116 -10
- package/src/ui-tailwind/chrome-overlay/tw-page-stack-overlay-layer.tsx +223 -94
- package/src/ui-tailwind/chrome-overlay/tw-presence-overlay-lane.tsx +157 -0
- package/src/ui-tailwind/chrome-overlay/tw-review-overlay-lane-markers.tsx +259 -0
- package/src/ui-tailwind/chrome-overlay/tw-scope-card-layer.tsx +5 -2
- package/src/ui-tailwind/chrome-overlay/tw-substrate-overlay-lanes.tsx +314 -0
- package/src/ui-tailwind/debug/README.md +4 -1
- package/src/ui-tailwind/debug/layer11-consumer-readiness.ts +272 -0
- package/src/ui-tailwind/debug/layer11-word-field-matrix-evidence.ts +160 -0
- package/src/ui-tailwind/editor-surface/perf-probe.ts +14 -215
- package/src/ui-tailwind/editor-surface/pm-decorations.ts +42 -0
- package/src/ui-tailwind/editor-surface/pm-position-map.ts +38 -2
- package/src/ui-tailwind/editor-surface/pm-schema.ts +14 -4
- package/src/ui-tailwind/editor-surface/pm-state-from-snapshot.ts +34 -5
- package/src/ui-tailwind/editor-surface/runtime-decoration-plugin.ts +9 -19
- package/src/ui-tailwind/editor-surface/surface-build-keys.ts +2 -2
- package/src/ui-tailwind/editor-surface/tw-page-block-view.helpers.ts +145 -0
- package/src/ui-tailwind/editor-surface/tw-page-block-view.tsx +16 -11
- package/src/ui-tailwind/editor-surface/tw-prosemirror-surface.tsx +8 -10
- package/src/ui-tailwind/editor-surface/tw-table-node-view.tsx +3 -0
- package/src/ui-tailwind/page-stack/tw-page-chrome-entry.tsx +4 -2
- package/src/ui-tailwind/page-stack/tw-page-stack-chrome-layer.tsx +60 -20
- package/src/ui-tailwind/page-stack/tw-region-block-renderer.tsx +16 -11
- package/src/ui-tailwind/review/tw-health-panel.tsx +36 -17
- package/src/ui-tailwind/review/tw-review-rail.tsx +7 -4
- package/src/ui-tailwind/review-workspace/diagnostics-visibility.ts +44 -0
- package/src/ui-tailwind/review-workspace/page-shell-metrics.ts +11 -0
- package/src/ui-tailwind/review-workspace/tw-review-workspace-rail.tsx +16 -1
- package/src/ui-tailwind/review-workspace/types.ts +26 -12
- package/src/ui-tailwind/review-workspace/use-diagnostics-signal.ts +40 -11
- package/src/ui-tailwind/review-workspace/use-layout-facet-render-signal.ts +2 -1
- package/src/ui-tailwind/review-workspace/use-page-markers.ts +15 -26
- package/src/ui-tailwind/review-workspace/use-scope-card-state.ts +35 -18
- package/src/ui-tailwind/review-workspace/use-selection-toolbar-placement.ts +41 -32
- package/src/ui-tailwind/review-workspace/use-status-bar-page-facts.ts +2 -1
- package/src/ui-tailwind/review-workspace/use-workspace-side-effects.ts +2 -1
- package/src/ui-tailwind/status/tw-status-bar.tsx +6 -5
- package/src/ui-tailwind/toolbar/tw-role-action-region.tsx +52 -80
- package/src/ui-tailwind/toolbar/tw-shell-header.tsx +12 -48
- package/src/ui-tailwind/toolbar/tw-toolbar-icon-button.tsx +9 -4
- package/src/ui-tailwind/toolbar/tw-toolbar.tsx +328 -361
- package/src/ui-tailwind/tw-review-workspace.tsx +152 -286
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export {
|
|
2
|
+
finishPerfProbe,
|
|
3
|
+
getLatestPerfSummary,
|
|
4
|
+
incrementInvalidationCounter,
|
|
5
|
+
PREDICTED_LANE_COUNTERS,
|
|
6
|
+
recordPerfSample,
|
|
7
|
+
resetPerfProbeState,
|
|
8
|
+
startPerfProbe,
|
|
9
|
+
} from "../../../runtime/telemetry/perf-probe.ts";
|
|
10
|
+
export type {
|
|
11
|
+
PerfProbeKind,
|
|
12
|
+
PerfProbeSample,
|
|
13
|
+
PerfProbeSummary,
|
|
14
|
+
} from "../../../runtime/telemetry/perf-probe.ts";
|
|
@@ -21,21 +21,22 @@
|
|
|
21
21
|
* reads; `stateClass: "A-canonical"` + `persistsTo: "canonical"` — the
|
|
22
22
|
* layout facet is derived canonical state.
|
|
23
23
|
*
|
|
24
|
-
* `elementId`
|
|
25
|
-
*
|
|
26
|
-
*
|
|
24
|
+
* `elementId` matches the stable per-page card anchor id that L11 paints on the
|
|
25
|
+
* page-card layer. Callers can prefer the element when mounted and fall back to
|
|
26
|
+
* `scrollY` / `pageRect` in headless or prerender paths.
|
|
27
27
|
*/
|
|
28
28
|
|
|
29
29
|
import type { RuntimeApiHandle } from "../_runtime-handle.ts";
|
|
30
30
|
import type { ApiV3FnMetadata } from "../_layer-metadata.ts";
|
|
31
31
|
import { DEFAULT_PX_PER_TWIP } from "../../public-types.ts";
|
|
32
|
+
import { buildPageAnchorElementId } from "../_page-anchor-id.ts";
|
|
32
33
|
|
|
33
34
|
/**
|
|
34
35
|
* Resolves a 1-based page number to a stable scroll target.
|
|
35
36
|
*
|
|
36
|
-
* - `elementId`: DOM id L11 populates on the per-page
|
|
37
|
-
*
|
|
38
|
-
*
|
|
37
|
+
* - `elementId`: DOM id L11 populates on the per-page card anchor.
|
|
38
|
+
* Mounted callers can scroll/focus by element; headless callers still use
|
|
39
|
+
* `scrollY`.
|
|
39
40
|
* - `scrollY`: scroll-container-relative Y offset of the page's top
|
|
40
41
|
* edge in CSS px. Computed as the sum of prior pages' heights via
|
|
41
42
|
* the layout facet's page graph.
|
|
@@ -94,7 +95,7 @@ export const getPageAnchorMetadata: ApiV3FnMetadata = {
|
|
|
94
95
|
stateClass: "A-canonical",
|
|
95
96
|
persistsTo: "canonical",
|
|
96
97
|
rwdReference:
|
|
97
|
-
"§Runtime API § runtime.viewport.getPageAnchor. Reads the kernel-authoritative page frame from `handle.geometry.getPage(index).frame` — same source `ui.viewport.scrollToPage(n)` consumes (coord-10 §γ shipment `b8116b97`), so values stay consistent across the two surfaces. `elementId`
|
|
98
|
+
"§Runtime API § runtime.viewport.getPageAnchor. Reads the kernel-authoritative page frame from `handle.geometry.getPage(index).frame` — same source `ui.viewport.scrollToPage(n)` consumes (coord-10 §γ shipment `b8116b97`), so values stay consistent across the two surfaces. `elementId` is the stable L11 page-card anchor id; mounted callers can resolve it when the page-card layer is present and fall back to `scrollY` / `pageRect` otherwise. Promotes to `live` when the geometry facet surfaces a direct `getPageAnchor(pageNumber)` reader.",
|
|
98
99
|
};
|
|
99
100
|
|
|
100
101
|
/* ================================================================== */
|
|
@@ -145,7 +146,7 @@ export function createViewportFamily(runtime: RuntimeApiHandle) {
|
|
|
145
146
|
const page = geometry?.getPage(pageIndex);
|
|
146
147
|
if (!page) return null;
|
|
147
148
|
return {
|
|
148
|
-
elementId:
|
|
149
|
+
elementId: buildPageAnchorElementId(page.pageId, pageIndex),
|
|
149
150
|
scrollY: page.frame.topPx,
|
|
150
151
|
pageRect: {
|
|
151
152
|
left: page.frame.leftPx,
|
package/src/api/v3/ui/_types.ts
CHANGED
|
@@ -35,6 +35,14 @@ import type {
|
|
|
35
35
|
WorkflowMarkupMode,
|
|
36
36
|
} from "../../public-types.ts";
|
|
37
37
|
import type { GeometryRect } from "../../../runtime/geometry/geometry-types.ts";
|
|
38
|
+
import type {
|
|
39
|
+
WorkflowOverlayAnchorQuery,
|
|
40
|
+
WorkflowOverlayLaneEntry,
|
|
41
|
+
WorkflowOverlayLaneKind,
|
|
42
|
+
WorkflowOverlayLaneSnapshot,
|
|
43
|
+
WorkflowOverlayLaneSource,
|
|
44
|
+
WorkflowOverlayLaneStatus,
|
|
45
|
+
} from "../../../runtime/workflow/overlay-lane-types.ts";
|
|
38
46
|
import type {
|
|
39
47
|
ChromeComposition,
|
|
40
48
|
ChromeCompositionInput,
|
|
@@ -104,6 +112,15 @@ export interface UiController {
|
|
|
104
112
|
* the scroll settles (or immediately for `behavior: "instant"`).
|
|
105
113
|
*/
|
|
106
114
|
readonly dispatchScroll?: (target: ScrollTarget) => Promise<void>;
|
|
115
|
+
/**
|
|
116
|
+
* Object-drag lifecycle for mounted object handles. The bind-side owns the
|
|
117
|
+
* concrete mutation path (image resize/reposition today) and returns a
|
|
118
|
+
* session object with update/commit/cancel methods. Missing hook means the
|
|
119
|
+
* mounted surface has not wired object drag.
|
|
120
|
+
*/
|
|
121
|
+
readonly beginObjectDrag?: (
|
|
122
|
+
input: UiObjectDragStartInput,
|
|
123
|
+
) => UiObjectDragSession;
|
|
107
124
|
/**
|
|
108
125
|
* Viewport provider. Optional. Slice 2 reads viewport through this when
|
|
109
126
|
* present; a geometry-backed path lands when `RuntimeApiHandle` gains a
|
|
@@ -202,6 +219,23 @@ export interface UiController {
|
|
|
202
219
|
readonly subscribeChrome?: (
|
|
203
220
|
listener: UiListener<ChromePosture>,
|
|
204
221
|
) => UiUnsubscribe;
|
|
222
|
+
/**
|
|
223
|
+
* KI-010 debug-inspector evidence lane read. Debug infra owns the
|
|
224
|
+
* evidence adapters; L10 owns the mounted UI API seam that exposes
|
|
225
|
+
* their plain snapshots without layout/cache ownership.
|
|
226
|
+
*/
|
|
227
|
+
readonly getDebugEvidenceLane?: (
|
|
228
|
+
kind: UiDebugEvidenceLaneKind,
|
|
229
|
+
) => UiDebugEvidenceLaneSnapshot;
|
|
230
|
+
/**
|
|
231
|
+
* KI-010 debug-inspector evidence lane subscription. Fan-out is UI
|
|
232
|
+
* state only; bind-side implementations must not dispatch PM
|
|
233
|
+
* transactions or invalidate L04 layout.
|
|
234
|
+
*/
|
|
235
|
+
readonly subscribeDebugEvidenceLane?: (
|
|
236
|
+
kind: UiDebugEvidenceLaneKind,
|
|
237
|
+
listener: UiListener<UiDebugEvidenceLaneSnapshot>,
|
|
238
|
+
) => UiUnsubscribe;
|
|
205
239
|
}
|
|
206
240
|
|
|
207
241
|
/**
|
|
@@ -296,10 +330,14 @@ export type ScrollTarget =
|
|
|
296
330
|
* that want to verify their own scroll container landed at the
|
|
297
331
|
* expected coordinate (visual-fidelity harness: deterministic
|
|
298
332
|
* per-page capture).
|
|
333
|
+
* - `elementId` is the stable mounted page-card anchor id produced by
|
|
334
|
+
* Layer 11. Mounted consumers can resolve it directly and fall back to
|
|
335
|
+
* `scrollY` in headless / pre-mount paths.
|
|
299
336
|
*/
|
|
300
337
|
export interface ScrollToPageResult {
|
|
301
338
|
readonly actualPage: number;
|
|
302
339
|
readonly scrollY: number;
|
|
340
|
+
readonly elementId: string;
|
|
303
341
|
}
|
|
304
342
|
|
|
305
343
|
export interface SelectionRangeInput {
|
|
@@ -309,71 +347,79 @@ export interface SelectionRangeInput {
|
|
|
309
347
|
}
|
|
310
348
|
|
|
311
349
|
/* ================================================================== */
|
|
312
|
-
/*
|
|
350
|
+
/* Object drag — mounted object handles */
|
|
313
351
|
/* ================================================================== */
|
|
314
352
|
|
|
315
|
-
export type
|
|
316
|
-
|
|
|
317
|
-
|
|
|
318
|
-
|
|
|
319
|
-
|
|
|
320
|
-
|
|
|
321
|
-
|
|
|
353
|
+
export type UiObjectDragHandle =
|
|
354
|
+
| "move"
|
|
355
|
+
| "rotate"
|
|
356
|
+
| "nw"
|
|
357
|
+
| "n"
|
|
358
|
+
| "ne"
|
|
359
|
+
| "w"
|
|
360
|
+
| "e"
|
|
361
|
+
| "sw"
|
|
362
|
+
| "s"
|
|
363
|
+
| "se";
|
|
364
|
+
|
|
365
|
+
export interface UiObjectDragPoint {
|
|
366
|
+
readonly clientX: number;
|
|
367
|
+
readonly clientY: number;
|
|
368
|
+
}
|
|
322
369
|
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
370
|
+
export interface UiObjectDragStartInput extends UiObjectDragPoint {
|
|
371
|
+
readonly objectId: string;
|
|
372
|
+
readonly handle: UiObjectDragHandle;
|
|
373
|
+
readonly initialRect: GeometryRect;
|
|
374
|
+
}
|
|
326
375
|
|
|
327
|
-
export
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
| "field-scopes"
|
|
332
|
-
| "broad-scopes"
|
|
333
|
-
| "comments"
|
|
334
|
-
| "issues"
|
|
335
|
-
| "tables"
|
|
336
|
-
| "objects"
|
|
337
|
-
| "search"
|
|
338
|
-
| "presence";
|
|
339
|
-
|
|
340
|
-
export type UiOverlayLaneStatus =
|
|
341
|
-
| "resolved"
|
|
342
|
-
| "requires-rehydration"
|
|
343
|
-
| "unavailable";
|
|
376
|
+
export interface UiObjectDragUpdateInput extends Partial<UiObjectDragPoint> {
|
|
377
|
+
readonly deltaX?: number;
|
|
378
|
+
readonly deltaY?: number;
|
|
379
|
+
}
|
|
344
380
|
|
|
345
|
-
export
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
| "
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
381
|
+
export interface UiObjectDragSnapshot {
|
|
382
|
+
readonly objectId: string;
|
|
383
|
+
readonly handle: UiObjectDragHandle;
|
|
384
|
+
readonly status: "active" | "committed" | "cancelled";
|
|
385
|
+
readonly deltaPx: { readonly x: number; readonly y: number };
|
|
386
|
+
readonly previewRect?: GeometryRect;
|
|
387
|
+
}
|
|
352
388
|
|
|
353
|
-
export interface
|
|
354
|
-
readonly
|
|
355
|
-
readonly status: UiOverlayLaneStatus;
|
|
356
|
-
readonly anchor?: OverlayAnchorQuery;
|
|
357
|
-
readonly rects?: readonly GeometryRect[];
|
|
389
|
+
export interface UiObjectDragCommitResult extends UiObjectDragSnapshot {
|
|
390
|
+
readonly changed: boolean;
|
|
358
391
|
readonly reason?: string;
|
|
359
|
-
/**
|
|
360
|
-
* Lane-specific plain payload. Examples: peer identity for presence,
|
|
361
|
-
* issue severity, search rank, table/object classification. Kept plain
|
|
362
|
-
* so non-React consumers and debug runners can serialize snapshots.
|
|
363
|
-
*/
|
|
364
|
-
readonly data?: Readonly<Record<string, unknown>>;
|
|
365
392
|
}
|
|
366
393
|
|
|
367
|
-
export interface
|
|
368
|
-
readonly
|
|
369
|
-
readonly
|
|
370
|
-
readonly
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
readonly reason?: string;
|
|
394
|
+
export interface UiObjectDragSession {
|
|
395
|
+
readonly id: string;
|
|
396
|
+
readonly objectId: string;
|
|
397
|
+
readonly handle: UiObjectDragHandle;
|
|
398
|
+
update(input: UiObjectDragUpdateInput): UiObjectDragSnapshot;
|
|
399
|
+
commit(input?: UiObjectDragUpdateInput): UiObjectDragCommitResult;
|
|
400
|
+
cancel(): UiObjectDragCommitResult;
|
|
375
401
|
}
|
|
376
402
|
|
|
403
|
+
/* Overlays — U4: anchor derivation from geometry */
|
|
404
|
+
/* ================================================================== */
|
|
405
|
+
|
|
406
|
+
export type OverlayAnchorQuery = WorkflowOverlayAnchorQuery;
|
|
407
|
+
|
|
408
|
+
/* ================================================================== */
|
|
409
|
+
/* PE2 overlay lanes */
|
|
410
|
+
/* ================================================================== */
|
|
411
|
+
|
|
412
|
+
/**
|
|
413
|
+
* L10 re-exports the plain PE2 overlay lane contract, but the canonical
|
|
414
|
+
* snapshot shape lives in Layer 6 workflow because durable review/workflow
|
|
415
|
+
* lanes are authored there and consumed by L10/L11.
|
|
416
|
+
*/
|
|
417
|
+
export type UiOverlayLaneKind = WorkflowOverlayLaneKind;
|
|
418
|
+
export type UiOverlayLaneStatus = WorkflowOverlayLaneStatus;
|
|
419
|
+
export type UiOverlayLaneSource = WorkflowOverlayLaneSource;
|
|
420
|
+
export type UiOverlayLaneEntry = WorkflowOverlayLaneEntry;
|
|
421
|
+
export type UiOverlayLaneSnapshot = WorkflowOverlayLaneSnapshot;
|
|
422
|
+
|
|
377
423
|
/* ================================================================== */
|
|
378
424
|
/* Overlay visibility — U9 (state-classes X3) */
|
|
379
425
|
/* ================================================================== */
|
|
@@ -463,6 +509,48 @@ export interface DebugAttachment {
|
|
|
463
509
|
readonly detach: () => void;
|
|
464
510
|
}
|
|
465
511
|
|
|
512
|
+
export const UI_DEBUG_EVIDENCE_LANE_KINDS = [
|
|
513
|
+
"artifact-integrity",
|
|
514
|
+
"pe2-runtime-projection",
|
|
515
|
+
"visual-manifest",
|
|
516
|
+
"cross-oracle",
|
|
517
|
+
"overlay-invalidation",
|
|
518
|
+
"word-field-matrix",
|
|
519
|
+
] as const;
|
|
520
|
+
|
|
521
|
+
export type UiDebugEvidenceLaneKind =
|
|
522
|
+
typeof UI_DEBUG_EVIDENCE_LANE_KINDS[number];
|
|
523
|
+
|
|
524
|
+
export type UiDebugEvidenceLaneStatus =
|
|
525
|
+
| "available"
|
|
526
|
+
| "requires-rehydration"
|
|
527
|
+
| "unavailable"
|
|
528
|
+
| "infra-blocked";
|
|
529
|
+
|
|
530
|
+
export type UiDebugEvidenceLaneSource =
|
|
531
|
+
| "controller"
|
|
532
|
+
| "unavailable";
|
|
533
|
+
|
|
534
|
+
export interface UiDebugEvidenceLaneEntry {
|
|
535
|
+
readonly id: string;
|
|
536
|
+
readonly status: UiDebugEvidenceLaneStatus;
|
|
537
|
+
readonly label?: string;
|
|
538
|
+
readonly source?: string;
|
|
539
|
+
readonly summary?: string;
|
|
540
|
+
readonly reason?: string;
|
|
541
|
+
readonly payload?: unknown;
|
|
542
|
+
}
|
|
543
|
+
|
|
544
|
+
export interface UiDebugEvidenceLaneSnapshot {
|
|
545
|
+
readonly __mock?: true;
|
|
546
|
+
readonly kind: UiDebugEvidenceLaneKind;
|
|
547
|
+
readonly status: UiDebugEvidenceLaneStatus;
|
|
548
|
+
readonly revision: number;
|
|
549
|
+
readonly source: UiDebugEvidenceLaneSource;
|
|
550
|
+
readonly entries: readonly UiDebugEvidenceLaneEntry[];
|
|
551
|
+
readonly reason?: string;
|
|
552
|
+
}
|
|
553
|
+
|
|
466
554
|
/* ================================================================== */
|
|
467
555
|
/* Subscription */
|
|
468
556
|
/* ================================================================== */
|
|
@@ -485,6 +573,7 @@ export interface ApiV3UiSurface {
|
|
|
485
573
|
setSelection(range: SelectionRangeInput): void;
|
|
486
574
|
getViewport(): ViewportState;
|
|
487
575
|
scrollTo(target: ScrollTarget): Promise<void>;
|
|
576
|
+
beginObjectDrag(input: UiObjectDragStartInput): UiObjectDragSession;
|
|
488
577
|
}
|
|
489
578
|
|
|
490
579
|
export interface ApiV3UiViewport {
|
|
@@ -510,7 +599,7 @@ export interface ApiV3UiViewport {
|
|
|
510
599
|
* Scroll the mounted surface to a specific 1-based page number.
|
|
511
600
|
* Resolves via `handle.geometry.getPage`; dispatches through the
|
|
512
601
|
* bound controller's `dispatchScroll` hook. Returns the settled
|
|
513
|
-
* `{ actualPage, scrollY }` or `null` when geometry cannot resolve
|
|
602
|
+
* `{ actualPage, scrollY, elementId }` or `null` when geometry cannot resolve
|
|
514
603
|
* any page / no controller bound / no dispatchScroll hook.
|
|
515
604
|
* Clamps pageNumber to the document's valid range; `actualPage`
|
|
516
605
|
* reflects the clamp. coord-10 §γ first-class replacement for the
|
|
@@ -680,6 +769,11 @@ export interface ApiV3UiChrome {
|
|
|
680
769
|
export interface ApiV3UiDebug {
|
|
681
770
|
attach(session: DebugSession): DebugAttachment;
|
|
682
771
|
detach(): void;
|
|
772
|
+
getEvidenceLane(kind: UiDebugEvidenceLaneKind): UiDebugEvidenceLaneSnapshot;
|
|
773
|
+
subscribeEvidenceLane(
|
|
774
|
+
kind: UiDebugEvidenceLaneKind,
|
|
775
|
+
listener: UiListener<UiDebugEvidenceLaneSnapshot>,
|
|
776
|
+
): UiUnsubscribe;
|
|
683
777
|
}
|
|
684
778
|
|
|
685
779
|
export interface UiScopeListFilter {
|
|
@@ -127,7 +127,7 @@ export function resolveChromeVisibilityForPreset(input: {
|
|
|
127
127
|
pageChrome: true,
|
|
128
128
|
statusBar: true,
|
|
129
129
|
reviewRail: false,
|
|
130
|
-
shellHeader:
|
|
130
|
+
shellHeader: false,
|
|
131
131
|
},
|
|
132
132
|
advanced: {
|
|
133
133
|
toolbar: true,
|
|
@@ -138,7 +138,7 @@ export function resolveChromeVisibilityForPreset(input: {
|
|
|
138
138
|
pageChrome: true,
|
|
139
139
|
statusBar: true,
|
|
140
140
|
reviewRail: true,
|
|
141
|
-
shellHeader:
|
|
141
|
+
shellHeader: false,
|
|
142
142
|
},
|
|
143
143
|
review: {
|
|
144
144
|
toolbar: true,
|
|
@@ -149,7 +149,7 @@ export function resolveChromeVisibilityForPreset(input: {
|
|
|
149
149
|
pageChrome: true,
|
|
150
150
|
statusBar: true,
|
|
151
151
|
reviewRail: options.showReviewRail,
|
|
152
|
-
shellHeader:
|
|
152
|
+
shellHeader: false,
|
|
153
153
|
},
|
|
154
154
|
workflow: {
|
|
155
155
|
toolbar: true,
|
|
@@ -160,7 +160,7 @@ export function resolveChromeVisibilityForPreset(input: {
|
|
|
160
160
|
pageChrome: true,
|
|
161
161
|
statusBar: true,
|
|
162
162
|
reviewRail: options.showReviewRail,
|
|
163
|
-
shellHeader:
|
|
163
|
+
shellHeader: false,
|
|
164
164
|
},
|
|
165
165
|
collab: {
|
|
166
166
|
toolbar: true,
|
|
@@ -171,7 +171,7 @@ export function resolveChromeVisibilityForPreset(input: {
|
|
|
171
171
|
pageChrome: true,
|
|
172
172
|
statusBar: true,
|
|
173
173
|
reviewRail: options.showReviewRail,
|
|
174
|
-
shellHeader:
|
|
174
|
+
shellHeader: false,
|
|
175
175
|
},
|
|
176
176
|
};
|
|
177
177
|
|
package/src/api/v3/ui/debug.ts
CHANGED
|
@@ -12,7 +12,15 @@
|
|
|
12
12
|
*/
|
|
13
13
|
|
|
14
14
|
import type { ApiV3FnMetadata } from "../_layer-metadata.ts";
|
|
15
|
-
import
|
|
15
|
+
import { emitUxResponse } from "../_ux-response.ts";
|
|
16
|
+
import type {
|
|
17
|
+
DebugSession,
|
|
18
|
+
DebugAttachment,
|
|
19
|
+
UiDebugEvidenceLaneKind,
|
|
20
|
+
UiDebugEvidenceLaneSnapshot,
|
|
21
|
+
UiListener,
|
|
22
|
+
UiUnsubscribe,
|
|
23
|
+
} from "./_types.ts";
|
|
16
24
|
import type { UiApiContext } from "./_context.ts";
|
|
17
25
|
|
|
18
26
|
export const attachMetadata: ApiV3FnMetadata = {
|
|
@@ -47,10 +55,82 @@ export const detachMetadata: ApiV3FnMetadata = {
|
|
|
47
55
|
"§UI API § ui.debug.detach. Production-disabled companion no-op retained for defensive cleanup compatibility.",
|
|
48
56
|
};
|
|
49
57
|
|
|
58
|
+
export const getEvidenceLaneMetadata: ApiV3FnMetadata = {
|
|
59
|
+
name: "ui.debug.getEvidenceLane",
|
|
60
|
+
status: "live-with-adapter",
|
|
61
|
+
sourceLayer: "presentation",
|
|
62
|
+
liveEvidence: {
|
|
63
|
+
runnerTest: "test/api/v3/ui/debug-evidence-lanes.test.ts",
|
|
64
|
+
commit: "refactor-10-ki-010",
|
|
65
|
+
},
|
|
66
|
+
mockShape: {
|
|
67
|
+
deterministic: true,
|
|
68
|
+
seededFrom: "fixed",
|
|
69
|
+
shapeDescription:
|
|
70
|
+
"Unavailable UiDebugEvidenceLaneSnapshot with entries:[] and revision:0 when the mounted controller has not wired the requested debug evidence lane yet.",
|
|
71
|
+
carriesMockFlag: true,
|
|
72
|
+
},
|
|
73
|
+
uxIntent: { uiVisible: false },
|
|
74
|
+
agentMetadata: {
|
|
75
|
+
readOrMutate: "read",
|
|
76
|
+
boundedScope: "session",
|
|
77
|
+
auditCategory: "ui-debug-evidence-read",
|
|
78
|
+
},
|
|
79
|
+
stateClass: "C-local",
|
|
80
|
+
persistsTo: "none",
|
|
81
|
+
rwdReference:
|
|
82
|
+
"§UI API § KI-010 debug inspector evidence lanes. Reads a mounted controller-provided plain evidence lane snapshot for artifact integrity, PE2 runtime projection, visual manifest, cross-oracle, overlay invalidation, or Word-first field matrix evidence. Returns explicit status:'unavailable' when unwired; never dispatches PM transactions or invalidates layout.",
|
|
83
|
+
};
|
|
84
|
+
|
|
85
|
+
export const subscribeEvidenceLaneMetadata: ApiV3FnMetadata = {
|
|
86
|
+
name: "ui.debug.subscribeEvidenceLane",
|
|
87
|
+
status: "live-with-adapter",
|
|
88
|
+
sourceLayer: "presentation",
|
|
89
|
+
liveEvidence: {
|
|
90
|
+
runnerTest: "test/api/v3/ui/debug-evidence-lanes.test.ts",
|
|
91
|
+
commit: "refactor-10-ki-010",
|
|
92
|
+
},
|
|
93
|
+
uxIntent: {
|
|
94
|
+
uiVisible: true,
|
|
95
|
+
expectsUxResponse: "surface-refresh",
|
|
96
|
+
expectedDelta:
|
|
97
|
+
"debug evidence lane subscriber attached; future plain evidence snapshots propagate through the listener without PM document transactions or layout invalidation",
|
|
98
|
+
},
|
|
99
|
+
agentMetadata: {
|
|
100
|
+
readOrMutate: "read",
|
|
101
|
+
boundedScope: "session",
|
|
102
|
+
auditCategory: "ui-debug-evidence-subscribe",
|
|
103
|
+
},
|
|
104
|
+
stateClass: "C-local",
|
|
105
|
+
persistsTo: "none",
|
|
106
|
+
bidirectional: true,
|
|
107
|
+
subscriptionShape: {
|
|
108
|
+
eventType: "ui.debug.evidence_lane_changed",
|
|
109
|
+
payloadType: "UiDebugEvidenceLaneSnapshot",
|
|
110
|
+
coalescing: "raf",
|
|
111
|
+
},
|
|
112
|
+
rwdReference:
|
|
113
|
+
"§UI API § KI-010 debug inspector evidence lanes. Adapter delegates to UiController.subscribeDebugEvidenceLane(kind, listener). Debug infra owns evidence adapters; L10 exposes only plain snapshots and subscription fan-out.",
|
|
114
|
+
};
|
|
115
|
+
|
|
50
116
|
const DEBUG_ATTACH_DISABLED_MESSAGE =
|
|
51
117
|
"ui.debug.attach is disabled in production; use the runtime REPL keyboard shortcut instead.";
|
|
52
118
|
|
|
53
|
-
|
|
119
|
+
function unavailableEvidenceLane(
|
|
120
|
+
kind: UiDebugEvidenceLaneKind,
|
|
121
|
+
): UiDebugEvidenceLaneSnapshot {
|
|
122
|
+
return {
|
|
123
|
+
__mock: true,
|
|
124
|
+
kind,
|
|
125
|
+
status: "unavailable",
|
|
126
|
+
revision: 0,
|
|
127
|
+
source: "unavailable",
|
|
128
|
+
entries: [],
|
|
129
|
+
reason: "debug evidence lane is unavailable until the mounted controller wires it",
|
|
130
|
+
};
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
export function createDebugFamily(ctx: UiApiContext) {
|
|
54
134
|
return {
|
|
55
135
|
attach(_session: DebugSession): DebugAttachment {
|
|
56
136
|
throw new Error(DEBUG_ATTACH_DISABLED_MESSAGE);
|
|
@@ -58,5 +138,38 @@ export function createDebugFamily(_ctx: UiApiContext) {
|
|
|
58
138
|
detach(): void {
|
|
59
139
|
// Idempotent compatibility no-op.
|
|
60
140
|
},
|
|
141
|
+
getEvidenceLane(kind: UiDebugEvidenceLaneKind): UiDebugEvidenceLaneSnapshot {
|
|
142
|
+
return ctx.binding?.controller.getDebugEvidenceLane?.(kind) ??
|
|
143
|
+
unavailableEvidenceLane(kind);
|
|
144
|
+
},
|
|
145
|
+
subscribeEvidenceLane(
|
|
146
|
+
kind: UiDebugEvidenceLaneKind,
|
|
147
|
+
listener: UiListener<UiDebugEvidenceLaneSnapshot>,
|
|
148
|
+
): UiUnsubscribe {
|
|
149
|
+
const controller = ctx.binding?.controller;
|
|
150
|
+
if (!controller) {
|
|
151
|
+
throw new Error(
|
|
152
|
+
"ui.debug.subscribeEvidenceLane: no controller bound — call ui.session.bind(controller) first",
|
|
153
|
+
);
|
|
154
|
+
}
|
|
155
|
+
if (!controller.subscribeDebugEvidenceLane) {
|
|
156
|
+
throw new Error(
|
|
157
|
+
`ui.debug.subscribeEvidenceLane: controller of kind "${controller.kind}" did not provide a subscribeDebugEvidenceLane hook`,
|
|
158
|
+
);
|
|
159
|
+
}
|
|
160
|
+
const unsubscribe = controller.subscribeDebugEvidenceLane(kind, listener);
|
|
161
|
+
emitUxResponse(ctx.handle, {
|
|
162
|
+
apiFn: subscribeEvidenceLaneMetadata.name,
|
|
163
|
+
intent: subscribeEvidenceLaneMetadata.uxIntent.expectedDelta ?? "",
|
|
164
|
+
mockOrLive: "live-with-adapter",
|
|
165
|
+
uiVisible: true,
|
|
166
|
+
expectedDelta: subscribeEvidenceLaneMetadata.uxIntent.expectedDelta,
|
|
167
|
+
actualDelta: {
|
|
168
|
+
kind: "surface-refresh",
|
|
169
|
+
payload: { subscribed: "ui.debug.evidenceLane", lane: kind },
|
|
170
|
+
},
|
|
171
|
+
});
|
|
172
|
+
return unsubscribe;
|
|
173
|
+
},
|
|
61
174
|
};
|
|
62
175
|
}
|
package/src/api/v3/ui/index.ts
CHANGED
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
8
|
export { createUiApi } from "./_create.ts";
|
|
9
|
+
export { UI_DEBUG_EVIDENCE_LANE_KINDS } from "./_types.ts";
|
|
9
10
|
export type {
|
|
10
11
|
ApiV3Ui,
|
|
11
12
|
ApiV3UiSession,
|
|
@@ -32,6 +33,13 @@ export type {
|
|
|
32
33
|
ScrollTargetBehavior,
|
|
33
34
|
ScrollToPageResult,
|
|
34
35
|
SelectionRangeInput,
|
|
36
|
+
UiObjectDragCommitResult,
|
|
37
|
+
UiObjectDragHandle,
|
|
38
|
+
UiObjectDragPoint,
|
|
39
|
+
UiObjectDragSession,
|
|
40
|
+
UiObjectDragSnapshot,
|
|
41
|
+
UiObjectDragStartInput,
|
|
42
|
+
UiObjectDragUpdateInput,
|
|
35
43
|
OverlayAnchorQuery,
|
|
36
44
|
OverlayKind,
|
|
37
45
|
OverlayVisibility,
|
|
@@ -46,6 +54,11 @@ export type {
|
|
|
46
54
|
ChromeDebugMode,
|
|
47
55
|
DebugSession,
|
|
48
56
|
DebugAttachment,
|
|
57
|
+
UiDebugEvidenceLaneEntry,
|
|
58
|
+
UiDebugEvidenceLaneKind,
|
|
59
|
+
UiDebugEvidenceLaneSnapshot,
|
|
60
|
+
UiDebugEvidenceLaneSource,
|
|
61
|
+
UiDebugEvidenceLaneStatus,
|
|
49
62
|
GeometryRect,
|
|
50
63
|
UiOverlayLaneEntry,
|
|
51
64
|
UiOverlayLaneKind,
|
|
@@ -207,13 +207,6 @@ export const getLaneMetadata: ApiV3FnMetadata = {
|
|
|
207
207
|
runnerTest: "test/api/v3/ui/overlays-lanes.test.ts",
|
|
208
208
|
commit: "refactor-10-pe2-overlay-lanes",
|
|
209
209
|
},
|
|
210
|
-
mockShape: {
|
|
211
|
-
deterministic: true,
|
|
212
|
-
seededFrom: "fixed",
|
|
213
|
-
shapeDescription:
|
|
214
|
-
"Unavailable UiOverlayLaneSnapshot with entries:[] and revision:0 when the mounted controller has not wired the requested PE2 overlay lane yet.",
|
|
215
|
-
carriesMockFlag: true,
|
|
216
|
-
},
|
|
217
210
|
uxIntent: { uiVisible: false },
|
|
218
211
|
agentMetadata: { readOrMutate: "read", boundedScope: "session", auditCategory: "ui-overlays-lane-read" },
|
|
219
212
|
stateClass: "C-local",
|
|
@@ -412,7 +405,6 @@ export function createOverlaysFamily(ctx: UiApiContext) {
|
|
|
412
405
|
reason = "overlay lane is not wired on the active controller",
|
|
413
406
|
): UiOverlayLaneSnapshot {
|
|
414
407
|
return {
|
|
415
|
-
__mock: true,
|
|
416
408
|
kind,
|
|
417
409
|
status: "unavailable",
|
|
418
410
|
entries: Object.freeze([]),
|
package/src/api/v3/ui/surface.ts
CHANGED
|
@@ -24,6 +24,7 @@ import type { SelectionSnapshot } from "../../public-types.ts";
|
|
|
24
24
|
import type {
|
|
25
25
|
SelectionRangeInput,
|
|
26
26
|
ScrollTarget,
|
|
27
|
+
UiObjectDragStartInput,
|
|
27
28
|
ViewportState,
|
|
28
29
|
} from "./_types.ts";
|
|
29
30
|
import type { UiApiContext } from "./_context.ts";
|
|
@@ -105,6 +106,31 @@ export const scrollToMetadata: ApiV3FnMetadata = {
|
|
|
105
106
|
rwdReference: "§UI API § ui.surface.scrollTo. Adapter delegates to UiController.dispatchScroll. Slice 3 adds geometry-backed target resolution for block/scope/comment/revision kinds prior to dispatch.",
|
|
106
107
|
};
|
|
107
108
|
|
|
109
|
+
export const beginObjectDragMetadata: ApiV3FnMetadata = {
|
|
110
|
+
name: "ui.surface.beginObjectDrag",
|
|
111
|
+
status: "live-with-adapter",
|
|
112
|
+
sourceLayer: "presentation",
|
|
113
|
+
liveEvidence: {
|
|
114
|
+
runnerTest: "test/api/v3/ui/object-drag.test.ts",
|
|
115
|
+
commit: "refactor-10-object-drag-lifecycle",
|
|
116
|
+
},
|
|
117
|
+
uxIntent: {
|
|
118
|
+
uiVisible: true,
|
|
119
|
+
expectsUxResponse: "surface-refresh",
|
|
120
|
+
expectedDelta: "object drag lifecycle starts for a mounted object handle",
|
|
121
|
+
},
|
|
122
|
+
agentMetadata: {
|
|
123
|
+
readOrMutate: "mutate",
|
|
124
|
+
boundedScope: "selection",
|
|
125
|
+
auditCategory: "ui-surface-object-drag",
|
|
126
|
+
},
|
|
127
|
+
stateClass: "C-local",
|
|
128
|
+
persistsTo: "none",
|
|
129
|
+
bidirectional: true,
|
|
130
|
+
rwdReference:
|
|
131
|
+
"§UI API § object handles. Adapter delegates mounted object drag to UiController.beginObjectDrag; commit routes through host-owned runtime mutation and layout invalidation paths.",
|
|
132
|
+
};
|
|
133
|
+
|
|
108
134
|
export function createSurfaceFamily(ctx: UiApiContext) {
|
|
109
135
|
return {
|
|
110
136
|
getSelection(): SelectionSnapshot | null {
|
|
@@ -166,5 +192,35 @@ export function createSurfaceFamily(ctx: UiApiContext) {
|
|
|
166
192
|
actualDelta: { kind: "surface-refresh", payload: { kind: target.kind, value: target.kind === "scope" || target.kind === "comment" || target.kind === "revision" || target.kind === "block" ? target.value : undefined } },
|
|
167
193
|
});
|
|
168
194
|
},
|
|
195
|
+
beginObjectDrag(input: UiObjectDragStartInput) {
|
|
196
|
+
const controller = ctx.binding?.controller;
|
|
197
|
+
if (!controller) {
|
|
198
|
+
throw new Error(
|
|
199
|
+
"ui.surface.beginObjectDrag: no controller bound — call ui.session.bind(controller) first",
|
|
200
|
+
);
|
|
201
|
+
}
|
|
202
|
+
if (!controller.beginObjectDrag) {
|
|
203
|
+
throw new Error(
|
|
204
|
+
`ui.surface.beginObjectDrag: controller of kind "${controller.kind}" did not provide a beginObjectDrag hook`,
|
|
205
|
+
);
|
|
206
|
+
}
|
|
207
|
+
const session = controller.beginObjectDrag(input);
|
|
208
|
+
emitUxResponse(ctx.handle, {
|
|
209
|
+
apiFn: beginObjectDragMetadata.name,
|
|
210
|
+
intent: beginObjectDragMetadata.uxIntent.expectedDelta ?? "",
|
|
211
|
+
mockOrLive: "live-with-adapter",
|
|
212
|
+
uiVisible: true,
|
|
213
|
+
expectedDelta: beginObjectDragMetadata.uxIntent.expectedDelta,
|
|
214
|
+
actualDelta: {
|
|
215
|
+
kind: "surface-refresh",
|
|
216
|
+
payload: {
|
|
217
|
+
objectId: input.objectId,
|
|
218
|
+
handle: input.handle,
|
|
219
|
+
sessionId: session.id,
|
|
220
|
+
},
|
|
221
|
+
},
|
|
222
|
+
});
|
|
223
|
+
return session;
|
|
224
|
+
},
|
|
169
225
|
};
|
|
170
226
|
}
|