@1agh/maude 0.28.0 → 0.28.1
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/cli/commands/design.mjs +69 -3
- package/cli/commands/design.test.mjs +97 -1
- package/cli/lib/cache.mjs +1 -1
- package/cli/lib/config-lint.mjs +1 -1
- package/cli/lib/copy-tree.mjs +1 -1
- package/cli/lib/design-link.mjs +1 -1
- package/cli/lib/flow-design-integration.test.mjs +1 -1
- package/cli/lib/gitignore-block.test.mjs +2 -2
- package/cli/lib/stack-detect.mjs +1 -1
- package/package.json +9 -9
- package/plugins/design/dev-server/annotations-context-toolbar.tsx +1 -1
- package/plugins/design/dev-server/annotations-layer.tsx +3 -3
- package/plugins/design/dev-server/api.ts +1 -1
- package/plugins/design/dev-server/bin/scenario-report.mjs +1 -1
- package/plugins/design/dev-server/bin/server-up.sh +102 -9
- package/plugins/design/dev-server/bin/visual-sanity.sh +19 -3
- package/plugins/design/dev-server/canvas-comment-mount.tsx +1 -1
- package/plugins/design/dev-server/canvas-cursors.ts +1 -1
- package/plugins/design/dev-server/canvas-lib.tsx +10 -21
- package/plugins/design/dev-server/canvas-shell.tsx +1 -1
- package/plugins/design/dev-server/collab/awareness-bridge.ts +1 -1
- package/plugins/design/dev-server/collab/index.ts +4 -4
- package/plugins/design/dev-server/collab/persistence.ts +1 -1
- package/plugins/design/dev-server/context-menu.tsx +1 -1
- package/plugins/design/dev-server/dist/client.bundle.js +4 -4
- package/plugins/design/dev-server/dist/comment-mount.js +5 -5
- package/plugins/design/dev-server/dist/runtime/lib0_decoding.js +1 -620
- package/plugins/design/dev-server/dist/runtime/lib0_encoding.js +1 -604
- package/plugins/design/dev-server/dist/runtime/motion.js +4 -4944
- package/plugins/design/dev-server/dist/runtime/motion_react.js +10 -10054
- package/plugins/design/dev-server/dist/runtime/pixi-js.js +2775 -52482
- package/plugins/design/dev-server/dist/runtime/react-dom.js +1 -231
- package/plugins/design/dev-server/dist/runtime/react-dom_client.js +9 -10357
- package/plugins/design/dev-server/dist/runtime/react.js +1 -535
- package/plugins/design/dev-server/dist/runtime/react_jsx-dev-runtime.js +1 -60
- package/plugins/design/dev-server/dist/runtime/react_jsx-runtime.js +1 -85
- package/plugins/design/dev-server/dist/runtime/y-protocols_awareness.js +1 -376
- package/plugins/design/dev-server/dist/runtime/y-protocols_sync.js +1 -100
- package/plugins/design/dev-server/dist/runtime/yjs.js +5 -6687
- package/plugins/design/dev-server/draw/brush.ts +3 -3
- package/plugins/design/dev-server/draw/index.ts +5 -5
- package/plugins/design/dev-server/draw/layout.ts +1 -1
- package/plugins/design/dev-server/draw/test/geometry.test.ts +1 -1
- package/plugins/design/dev-server/draw/test/layout.test.ts +1 -1
- package/plugins/design/dev-server/draw/test/primitives.test.ts +1 -1
- package/plugins/design/dev-server/draw/test/serialize.test.ts +1 -1
- package/plugins/design/dev-server/equal-spacing-handles.tsx +1 -1
- package/plugins/design/dev-server/examples/perf-100-artboards.tsx +1 -2
- package/plugins/design/dev-server/export-dialog.tsx +1 -1
- package/plugins/design/dev-server/exporters/html.ts +1 -1
- package/plugins/design/dev-server/exporters/index.ts +2 -2
- package/plugins/design/dev-server/exporters/pdf.ts +1 -1
- package/plugins/design/dev-server/exporters/png.ts +1 -1
- package/plugins/design/dev-server/exporters/pptx.ts +1 -1
- package/plugins/design/dev-server/exporters/svg.ts +1 -1
- package/plugins/design/dev-server/http.ts +1 -1
- package/plugins/design/dev-server/marquee-overlay.tsx +1 -1
- package/plugins/design/dev-server/server.ts +1 -1
- package/plugins/design/dev-server/sync/agent.ts +1 -1
- package/plugins/design/dev-server/sync/index.ts +5 -5
- package/plugins/design/dev-server/sync/materialize.ts +2 -2
- package/plugins/design/dev-server/sync/migrate-seed.ts +1 -1
- package/plugins/design/dev-server/sync/projection.ts +3 -3
- package/plugins/design/dev-server/test/ai-activity.test.ts +1 -1
- package/plugins/design/dev-server/test/annotations-api.test.ts +1 -2
- package/plugins/design/dev-server/test/annotations-draw-modifiers.test.ts +2 -2
- package/plugins/design/dev-server/test/annotations-layer.test.ts +6 -6
- package/plugins/design/dev-server/test/annotations-roundtrip.test.ts +1 -1
- package/plugins/design/dev-server/test/boot-self-heal.test.ts +1 -1
- package/plugins/design/dev-server/test/canvas-cursors.test.ts +1 -1
- package/plugins/design/dev-server/test/canvas-edit.test.ts +1 -1
- package/plugins/design/dev-server/test/canvas-header.test.ts +1 -1
- package/plugins/design/dev-server/test/canvas-hmr-runtime.test.tsx +1 -1
- package/plugins/design/dev-server/test/canvas-lib-inline.test.ts +1 -1
- package/plugins/design/dev-server/test/canvas-lib-resolver.test.ts +1 -2
- package/plugins/design/dev-server/test/canvas-meta-api.test.ts +1 -2
- package/plugins/design/dev-server/test/canvas-origin-gate.test.ts +1 -2
- package/plugins/design/dev-server/test/collab-annotations-bridge.test.ts +1 -1
- package/plugins/design/dev-server/test/collab-bridge.test.ts +1 -1
- package/plugins/design/dev-server/test/collab-protocol.test.ts +2 -2
- package/plugins/design/dev-server/test/collab-room.test.ts +1 -1
- package/plugins/design/dev-server/test/collab-stress.test.ts +1 -1
- package/plugins/design/dev-server/test/comments-api.test.ts +1 -2
- package/plugins/design/dev-server/test/compile-entry.test.ts +1 -2
- package/plugins/design/dev-server/test/exporters/canva.test.ts +1 -2
- package/plugins/design/dev-server/test/exporters/history.test.ts +1 -2
- package/plugins/design/dev-server/test/exporters/pw-launch.test.ts +1 -1
- package/plugins/design/dev-server/test/exporters/scope.test.ts +1 -2
- package/plugins/design/dev-server/test/exporters/zip.test.ts +1 -2
- package/plugins/design/dev-server/test/git-lifecycle.test.ts +1 -2
- package/plugins/design/dev-server/test/handoff-static-frames.test.ts +1 -1
- package/plugins/design/dev-server/test/handoff.test.ts +1 -1
- package/plugins/design/dev-server/test/hmr-broadcast.test.ts +1 -1
- package/plugins/design/dev-server/test/input-router.test.ts +2 -2
- package/plugins/design/dev-server/test/locator.test.ts +1 -1
- package/plugins/design/dev-server/test/runtime-bundle.test.ts +1 -1
- package/plugins/design/dev-server/test/shared-doc-convergence.test.ts +1 -1
- package/plugins/design/dev-server/test/shared-doc-migrate.test.ts +2 -3
- package/plugins/design/dev-server/test/shared-doc-projection.test.ts +1 -1
- package/plugins/design/dev-server/test/snap-distance-pill.test.ts +1 -1
- package/plugins/design/dev-server/test/sync-agent.test.ts +2 -3
- package/plugins/design/dev-server/test/sync-atomic-write.test.ts +2 -3
- package/plugins/design/dev-server/test/sync-codec.test.ts +1 -1
- package/plugins/design/dev-server/test/sync-connection-state.test.ts +1 -1
- package/plugins/design/dev-server/test/sync-echo-guard.test.ts +1 -1
- package/plugins/design/dev-server/test/sync-fs-mirror.test.ts +1 -2
- package/plugins/design/dev-server/test/sync-hardening.test.ts +4 -5
- package/plugins/design/dev-server/test/sync-hubs-config.test.ts +1 -2
- package/plugins/design/dev-server/test/sync-meta-codec.test.ts +1 -1
- package/plugins/design/dev-server/test/sync-runtime.test.ts +3 -8
- package/plugins/design/dev-server/test/sync-status.test.ts +1 -1
- package/plugins/design/dev-server/test/sync-untrusted.test.ts +1 -2
- package/plugins/design/dev-server/test/undo-stack.test.ts +2 -2
- package/plugins/design/dev-server/test/use-agent-presence.test.tsx +4 -1
- package/plugins/design/dev-server/test/use-artboard-drag.test.ts +3 -3
- package/plugins/design/dev-server/test/use-canvas-activity.test.tsx +2 -2
- package/plugins/design/dev-server/test/use-selection-set.test.tsx +1 -1
- package/plugins/design/dev-server/test/use-snap-guides.test.ts +1 -1
- package/plugins/design/dev-server/test/use-undo-stack.test.tsx +2 -2
- package/plugins/design/dev-server/use-agent-presence.tsx +1 -1
- package/plugins/design/dev-server/use-annotation-resize.tsx +1 -5
- package/plugins/design/dev-server/use-annotation-selection.tsx +2 -6
- package/plugins/design/dev-server/use-annotations-visibility.tsx +1 -1
- package/plugins/design/dev-server/use-artboard-drag.tsx +1 -1
- package/plugins/design/dev-server/use-canvas-activity.tsx +1 -1
- package/plugins/design/dev-server/use-collab.tsx +3 -4
- package/plugins/design/dev-server/use-selection-set.tsx +1 -1
- package/plugins/design/dev-server/use-tool-mode.tsx +1 -1
- package/plugins/design/dev-server/use-undo-stack.tsx +4 -5
- package/plugins/design/templates/_shell.html +3 -3
- package/plugins/design/templates/design-system-inspiration/SUB-AGENT-PROMPTS.md +18 -3
|
@@ -4,12 +4,11 @@
|
|
|
4
4
|
// `_active.json` shapes. `project-raw` exercises the fs walk inside a
|
|
5
5
|
// throwaway temp dir; the other three branches don't touch disk.
|
|
6
6
|
|
|
7
|
+
import { describe, expect, test } from 'bun:test';
|
|
7
8
|
import { mkdirSync, mkdtempSync, writeFileSync } from 'node:fs';
|
|
8
9
|
import { tmpdir } from 'node:os';
|
|
9
10
|
import { join } from 'node:path';
|
|
10
11
|
|
|
11
|
-
import { describe, expect, test } from 'bun:test';
|
|
12
|
-
|
|
13
12
|
import { type ActiveJsonShape, resolveScope } from '../../exporters/scope.ts';
|
|
14
13
|
|
|
15
14
|
function emptyActive(): ActiveJsonShape {
|
|
@@ -3,11 +3,10 @@
|
|
|
3
3
|
// Real walk + bundle against a sandboxed designRoot, then unzip the result
|
|
4
4
|
// and diff against expected contents.
|
|
5
5
|
|
|
6
|
+
import { describe, expect, test } from 'bun:test';
|
|
6
7
|
import { mkdirSync, mkdtempSync, writeFileSync } from 'node:fs';
|
|
7
8
|
import { tmpdir } from 'node:os';
|
|
8
9
|
import { join } from 'node:path';
|
|
9
|
-
|
|
10
|
-
import { describe, expect, test } from 'bun:test';
|
|
11
10
|
import JSZip from 'jszip';
|
|
12
11
|
|
|
13
12
|
import { resolveScope } from '../../exporters/scope.ts';
|
|
@@ -8,12 +8,11 @@
|
|
|
8
8
|
// already exposes flushAll(). The integration with .git/HEAD writes is
|
|
9
9
|
// exercised manually in the Task 7 acceptance test (Phase 8 plan validate row).
|
|
10
10
|
|
|
11
|
+
import { afterEach, beforeEach, describe, expect, test } from 'bun:test';
|
|
11
12
|
import { existsSync, mkdirSync, mkdtempSync, rmSync, writeFileSync } from 'node:fs';
|
|
12
13
|
import { tmpdir } from 'node:os';
|
|
13
14
|
import path from 'node:path';
|
|
14
15
|
|
|
15
|
-
import { afterEach, beforeEach, describe, expect, test } from 'bun:test';
|
|
16
|
-
|
|
17
16
|
import { createGitLifecycle } from '../collab/git-lifecycle.ts';
|
|
18
17
|
import { createRegistry } from '../collab/registry.ts';
|
|
19
18
|
import type { RoomCallbacks } from '../collab/room.ts';
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
import { describe, expect, test } from 'bun:test';
|
|
6
6
|
|
|
7
7
|
import { buildLibMap, inlineUsedExports } from '../canvas-lib-inline.ts';
|
|
8
|
-
import {
|
|
8
|
+
import { applyHandoffStaticOverrides, HANDOFF_STATIC_FRAME_EXPORTS } from '../handoff.ts';
|
|
9
9
|
|
|
10
10
|
const LIB_PATH = '/virtual/_lib/canvas-lib.tsx';
|
|
11
11
|
|
|
@@ -9,12 +9,12 @@ import path from 'node:path';
|
|
|
9
9
|
|
|
10
10
|
import { transpileCanvasSource } from '../canvas-pipeline.ts';
|
|
11
11
|
import {
|
|
12
|
-
type RegistryItem,
|
|
13
12
|
classifyImports,
|
|
14
13
|
collectClassNames,
|
|
15
14
|
emitRegistryItem,
|
|
16
15
|
filterComponentsCss,
|
|
17
16
|
filterTokensCss,
|
|
17
|
+
type RegistryItem,
|
|
18
18
|
stripDataCdId,
|
|
19
19
|
writeRegistryItem,
|
|
20
20
|
} from '../handoff.ts';
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
import { describe, expect, test } from 'bun:test';
|
|
4
4
|
|
|
5
5
|
import { type Context, createBus } from '../context.ts';
|
|
6
|
-
import { HMR_DEBOUNCE_MS, type HmrMessage
|
|
6
|
+
import { createHmrBroadcaster, HMR_DEBOUNCE_MS, type HmrMessage } from '../hmr-broadcast.ts';
|
|
7
7
|
|
|
8
8
|
function mkCtx(): Context {
|
|
9
9
|
const bus = createBus();
|
|
@@ -4,11 +4,11 @@ import { describe, expect, test } from 'bun:test';
|
|
|
4
4
|
|
|
5
5
|
import {
|
|
6
6
|
type ClassifyInput,
|
|
7
|
-
DRAG_THRESHOLD_PX,
|
|
8
|
-
type Tool,
|
|
9
7
|
classify,
|
|
10
8
|
crossedDragThreshold,
|
|
9
|
+
DRAG_THRESHOLD_PX,
|
|
11
10
|
isEditableTarget,
|
|
11
|
+
type Tool,
|
|
12
12
|
} from '../input-router.tsx';
|
|
13
13
|
|
|
14
14
|
const base = (over: Partial<ClassifyInput>): ClassifyInput => ({
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
import { describe, expect, test } from 'bun:test';
|
|
10
10
|
|
|
11
|
-
import {
|
|
11
|
+
import { getRuntimeBundle, packageForSlug, RUNTIME_PACKAGES, slugFor } from '../runtime-bundle.ts';
|
|
12
12
|
|
|
13
13
|
describe('runtime-bundle', () => {
|
|
14
14
|
test('builds all four sub-bundles successfully', async () => {
|
|
@@ -24,11 +24,11 @@ import * as Y from 'yjs';
|
|
|
24
24
|
|
|
25
25
|
import { Y_TYPES } from '../collab/persistence.ts';
|
|
26
26
|
import {
|
|
27
|
-
Y_SYNC_TYPES,
|
|
28
27
|
applyCommentsToDoc,
|
|
29
28
|
applyCssToDoc,
|
|
30
29
|
applyHtmlToDoc,
|
|
31
30
|
applyMetaToDoc,
|
|
31
|
+
Y_SYNC_TYPES,
|
|
32
32
|
} from '../sync/codec.ts';
|
|
33
33
|
import { createEchoGuard, hashBytes } from '../sync/echo-guard.ts';
|
|
34
34
|
import { materialize, materializeCanonical } from '../sync/materialize.ts';
|
|
@@ -4,14 +4,13 @@
|
|
|
4
4
|
// populated from ONE source. These tests prove migrateSeed never duplicates
|
|
5
5
|
// comments and is idempotent across re-runs (server restarts).
|
|
6
6
|
|
|
7
|
+
import { afterEach, beforeEach, describe, expect, test } from 'bun:test';
|
|
7
8
|
import { mkdtempSync, readdirSync, rmSync, writeFileSync } from 'node:fs';
|
|
8
9
|
import { tmpdir } from 'node:os';
|
|
9
10
|
import { join } from 'node:path';
|
|
10
|
-
|
|
11
|
-
import { afterEach, beforeEach, describe, expect, test } from 'bun:test';
|
|
12
11
|
import * as Y from 'yjs';
|
|
13
12
|
|
|
14
|
-
import {
|
|
13
|
+
import { createPersistence, Y_TYPES } from '../collab/persistence.ts';
|
|
15
14
|
import type { Context } from '../context.ts';
|
|
16
15
|
import { applyCommentsToDoc, applyHtmlToDoc } from '../sync/codec.ts';
|
|
17
16
|
import { docIsEmpty, migrateSeed } from '../sync/migrate-seed.ts';
|
|
@@ -22,7 +22,7 @@ import { describe, expect, test } from 'bun:test';
|
|
|
22
22
|
import * as Y from 'yjs';
|
|
23
23
|
|
|
24
24
|
import { Y_TYPES } from '../collab/persistence.ts';
|
|
25
|
-
import {
|
|
25
|
+
import { applyHtmlToDoc, MAX_HTML_BYTES } from '../sync/codec.ts';
|
|
26
26
|
import { createEchoGuard, hashBytes } from '../sync/echo-guard.ts';
|
|
27
27
|
import { ORIGINS } from '../sync/origins.ts';
|
|
28
28
|
import { createDocProjection } from '../sync/projection.ts';
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
|
|
6
6
|
import { describe, expect, test } from 'bun:test';
|
|
7
7
|
|
|
8
|
-
import { type Rect, type SnapOptions
|
|
8
|
+
import { computeSnap, type Rect, type SnapOptions } from '../use-snap-guides.tsx';
|
|
9
9
|
|
|
10
10
|
const DEFAULTS: SnapOptions = { gridSize: 40, tolerance: 8, disabled: false };
|
|
11
11
|
const rect = (x: number, y: number, w = 100, h = 80): Rect => ({ x, y, w, h });
|
|
@@ -10,15 +10,14 @@
|
|
|
10
10
|
// This lets us validate the whole bidi loop, echo prevention, and the
|
|
11
11
|
// 100-event stress scenario from the plan without booting a real hub.
|
|
12
12
|
|
|
13
|
+
import { afterEach, beforeEach, describe, expect, test } from 'bun:test';
|
|
13
14
|
import { mkdtempSync, readFileSync, rmSync, writeFileSync } from 'node:fs';
|
|
14
15
|
import { tmpdir } from 'node:os';
|
|
15
16
|
import { join } from 'node:path';
|
|
16
|
-
|
|
17
|
-
import { afterEach, beforeEach, describe, expect, test } from 'bun:test';
|
|
18
17
|
import * as Y from 'yjs';
|
|
19
18
|
|
|
20
19
|
import { type CanvasSyncAgent, createCanvasSyncAgent } from '../sync/agent.ts';
|
|
21
|
-
import {
|
|
20
|
+
import { applyHtmlToDoc, htmlFromDoc, Y_SYNC_TYPES } from '../sync/codec.ts';
|
|
22
21
|
import { createEchoGuard, hashBytes } from '../sync/echo-guard.ts';
|
|
23
22
|
import { createFsReader } from '../sync/fs-mirror.ts';
|
|
24
23
|
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
// Atomic-write unit tests — Phase 9 Task 4.
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
import { afterEach, beforeEach, describe, expect, test } from 'bun:test';
|
|
4
|
+
import { mkdtempSync, readdirSync, readFileSync, rmSync, writeFileSync } from 'node:fs';
|
|
4
5
|
import { tmpdir } from 'node:os';
|
|
5
6
|
import { join } from 'node:path';
|
|
6
7
|
|
|
7
|
-
import { afterEach, beforeEach, describe, expect, test } from 'bun:test';
|
|
8
|
-
|
|
9
8
|
import { atomicWrite } from '../sync/atomic-write.ts';
|
|
10
9
|
|
|
11
10
|
let dir: string;
|
|
@@ -8,13 +8,13 @@ import * as Y from 'yjs';
|
|
|
8
8
|
|
|
9
9
|
import { Y_TYPES } from '../collab/persistence.ts';
|
|
10
10
|
import {
|
|
11
|
-
Y_SYNC_TYPES,
|
|
12
11
|
annotationsFromDoc,
|
|
13
12
|
applyAnnotationsToDoc,
|
|
14
13
|
applyCommentsToDoc,
|
|
15
14
|
applyHtmlToDoc,
|
|
16
15
|
commentsFromDoc,
|
|
17
16
|
htmlFromDoc,
|
|
17
|
+
Y_SYNC_TYPES,
|
|
18
18
|
} from '../sync/codec.ts';
|
|
19
19
|
|
|
20
20
|
describe('HTML codec', () => {
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
|
|
6
6
|
import { describe, expect, test } from 'bun:test';
|
|
7
7
|
|
|
8
|
-
import { type SyncStatusSnapshot
|
|
8
|
+
import { createConnectionMonitor, type SyncStatusSnapshot } from '../sync/connection-state.ts';
|
|
9
9
|
|
|
10
10
|
/** A controllable timer queue: setTimer enqueues, advance() fires due timers. */
|
|
11
11
|
function fakeClock() {
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import { describe, expect, test } from 'bun:test';
|
|
4
4
|
|
|
5
|
-
import {
|
|
5
|
+
import { createEchoGuard, ECHO_TTL_MS, hashBytes } from '../sync/echo-guard.ts';
|
|
6
6
|
|
|
7
7
|
describe('hashBytes', () => {
|
|
8
8
|
test('stable hex SHA-256 of bytes', () => {
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
// fs-mirror unit tests — Phase 9 Task 4.
|
|
2
2
|
|
|
3
|
+
import { afterEach, beforeEach, describe, expect, test } from 'bun:test';
|
|
3
4
|
import { mkdtempSync, rmSync, writeFileSync } from 'node:fs';
|
|
4
5
|
import { tmpdir } from 'node:os';
|
|
5
6
|
import { join } from 'node:path';
|
|
6
7
|
|
|
7
|
-
import { afterEach, beforeEach, describe, expect, test } from 'bun:test';
|
|
8
|
-
|
|
9
8
|
import { hashBytes } from '../sync/echo-guard.ts';
|
|
10
9
|
import { createFsReader } from '../sync/fs-mirror.ts';
|
|
11
10
|
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
// Targets the 8 quick-win fixes recorded in DDR-054 §2 against the findings
|
|
4
4
|
// in `.ai/logs/security-reviews/phase-9-task-4-bidi-fs-sync-{defender,attacker}.md`.
|
|
5
5
|
|
|
6
|
+
import { afterEach, beforeEach, describe, expect, test } from 'bun:test';
|
|
6
7
|
import {
|
|
7
8
|
chmodSync,
|
|
8
9
|
existsSync,
|
|
@@ -15,20 +16,18 @@ import {
|
|
|
15
16
|
} from 'node:fs';
|
|
16
17
|
import { tmpdir } from 'node:os';
|
|
17
18
|
import { join } from 'node:path';
|
|
18
|
-
|
|
19
|
-
import { afterEach, beforeEach, describe, expect, test } from 'bun:test';
|
|
20
19
|
import * as Y from 'yjs';
|
|
21
20
|
|
|
22
21
|
import { createCanvasSyncAgent } from '../sync/agent.ts';
|
|
23
22
|
import { atomicWrite } from '../sync/atomic-write.ts';
|
|
24
23
|
import {
|
|
25
|
-
MAX_ANNOTATIONS_BYTES,
|
|
26
|
-
MAX_COMMENTS_BYTES,
|
|
27
|
-
MAX_HTML_BYTES,
|
|
28
24
|
applyAnnotationsToDoc,
|
|
29
25
|
applyCommentsToDoc,
|
|
30
26
|
applyHtmlToDoc,
|
|
31
27
|
htmlFromDoc,
|
|
28
|
+
MAX_ANNOTATIONS_BYTES,
|
|
29
|
+
MAX_COMMENTS_BYTES,
|
|
30
|
+
MAX_HTML_BYTES,
|
|
32
31
|
} from '../sync/codec.ts';
|
|
33
32
|
import { createEchoGuard, hashBytes } from '../sync/echo-guard.ts';
|
|
34
33
|
import { createFsReader } from '../sync/fs-mirror.ts';
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
// hubs-config reader tests — Phase 9 Task 4.
|
|
2
2
|
|
|
3
|
+
import { afterEach, beforeEach, describe, expect, test } from 'bun:test';
|
|
3
4
|
import { chmodSync, mkdtempSync, rmSync, writeFileSync } from 'node:fs';
|
|
4
5
|
import { tmpdir } from 'node:os';
|
|
5
6
|
import { join } from 'node:path';
|
|
6
7
|
|
|
7
|
-
import { afterEach, beforeEach, describe, expect, test } from 'bun:test';
|
|
8
|
-
|
|
9
8
|
import { getHubToken, hubsConfigPath, loadHubsConfig, normalizeUrl } from '../sync/hubs-config.ts';
|
|
10
9
|
|
|
11
10
|
let dir: string;
|
|
@@ -10,10 +10,10 @@ import { describe, expect, test } from 'bun:test';
|
|
|
10
10
|
import * as Y from 'yjs';
|
|
11
11
|
|
|
12
12
|
import {
|
|
13
|
-
META_LOCAL_KEYS,
|
|
14
13
|
applyCssToDoc,
|
|
15
14
|
applyMetaToDoc,
|
|
16
15
|
cssFromDoc,
|
|
16
|
+
META_LOCAL_KEYS,
|
|
17
17
|
mergeSharedMetaIntoLocal,
|
|
18
18
|
metaFromDoc,
|
|
19
19
|
} from '../sync/codec.ts';
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
// honors linkedHub config, discovers canvases, wires up agents, and
|
|
6
6
|
// dispatches fs events through the bus correctly.
|
|
7
7
|
|
|
8
|
+
import { afterEach, beforeEach, describe, expect, test } from 'bun:test';
|
|
8
9
|
import {
|
|
9
10
|
chmodSync,
|
|
10
11
|
existsSync,
|
|
@@ -16,8 +17,6 @@ import {
|
|
|
16
17
|
} from 'node:fs';
|
|
17
18
|
import { tmpdir } from 'node:os';
|
|
18
19
|
import { join } from 'node:path';
|
|
19
|
-
|
|
20
|
-
import { afterEach, beforeEach, describe, expect, test } from 'bun:test';
|
|
21
20
|
import { Awareness } from 'y-protocols/awareness';
|
|
22
21
|
import * as Y from 'yjs';
|
|
23
22
|
|
|
@@ -29,10 +28,10 @@ import { createBus } from '../context.ts';
|
|
|
29
28
|
import { createConnectionMonitor } from '../sync/connection-state.ts';
|
|
30
29
|
import {
|
|
31
30
|
type AwarenessRegistry,
|
|
32
|
-
type SyncProvider,
|
|
33
31
|
buildNoSyncablePayload,
|
|
34
32
|
createSyncRuntime,
|
|
35
33
|
discoverCanvases,
|
|
34
|
+
type SyncProvider,
|
|
36
35
|
scanCanvases,
|
|
37
36
|
toWsUrl,
|
|
38
37
|
} from '../sync/index.ts';
|
|
@@ -108,11 +107,7 @@ function makeCtx(linkedHub?: DevServerConfig['linkedHub'], canvasOrigin?: string
|
|
|
108
107
|
}
|
|
109
108
|
|
|
110
109
|
function inMemoryProviderFactory(): {
|
|
111
|
-
factory: (args: {
|
|
112
|
-
url: string;
|
|
113
|
-
token: string;
|
|
114
|
-
documentName: string;
|
|
115
|
-
}) => SyncProvider;
|
|
110
|
+
factory: (args: { url: string; token: string; documentName: string }) => SyncProvider;
|
|
116
111
|
peerOf: (slug: string) => Y.Doc;
|
|
117
112
|
} {
|
|
118
113
|
// Map of slug -> { local, peer } Y.Docs cross-linked via applyUpdate.
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
import { describe, expect, test } from 'bun:test';
|
|
4
4
|
|
|
5
5
|
import type { SyncStatusSnapshot } from '../sync/connection-state.ts';
|
|
6
|
-
import { type SyncStatusPayload
|
|
6
|
+
import { createSyncStatusStore, type SyncStatusPayload } from '../sync/status.ts';
|
|
7
7
|
|
|
8
8
|
function snap(partial: Partial<SyncStatusSnapshot> = {}): SyncStatusSnapshot {
|
|
9
9
|
return {
|
|
@@ -3,12 +3,11 @@
|
|
|
3
3
|
// for the syncable set, cleared when empty, stale entries dropped on re-write,
|
|
4
4
|
// and user-authored `.claudeignore` content outside the block preserved.
|
|
5
5
|
|
|
6
|
+
import { afterEach, beforeEach, describe, expect, test } from 'bun:test';
|
|
6
7
|
import { existsSync, mkdirSync, mkdtempSync, readFileSync, writeFileSync } from 'node:fs';
|
|
7
8
|
import { tmpdir } from 'node:os';
|
|
8
9
|
import { join } from 'node:path';
|
|
9
10
|
|
|
10
|
-
import { afterEach, beforeEach, describe, expect, test } from 'bun:test';
|
|
11
|
-
|
|
12
11
|
import type { Context } from '../context.ts';
|
|
13
12
|
import type { CanvasDescriptor } from '../sync/index.ts';
|
|
14
13
|
import { clearUntrustedMarkers, writeUntrustedMarkers } from '../sync/untrusted.ts';
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { afterEach, describe, expect, test } from 'bun:test';
|
|
2
2
|
|
|
3
3
|
import {
|
|
4
|
-
type CommandRecord,
|
|
5
|
-
MAX_DEPTH,
|
|
6
4
|
_clearBuilderRegistry,
|
|
7
5
|
_clearStackStore,
|
|
6
|
+
type CommandRecord,
|
|
8
7
|
canRedo,
|
|
9
8
|
canUndo,
|
|
10
9
|
createUndoStackState,
|
|
11
10
|
loadStackState,
|
|
11
|
+
MAX_DEPTH,
|
|
12
12
|
peekRedo,
|
|
13
13
|
peekUndo,
|
|
14
14
|
rebuildCommand,
|
|
@@ -64,7 +64,10 @@ describe('use-agent-presence / provider gating', () => {
|
|
|
64
64
|
function Wrap({
|
|
65
65
|
initialAgent,
|
|
66
66
|
children,
|
|
67
|
-
}: {
|
|
67
|
+
}: {
|
|
68
|
+
initialAgent: AgentPresence | null;
|
|
69
|
+
children: ReactNode;
|
|
70
|
+
}) {
|
|
68
71
|
return <AgentPresenceProvider initialAgent={initialAgent}>{children}</AgentPresenceProvider>;
|
|
69
72
|
}
|
|
70
73
|
|
|
@@ -8,14 +8,14 @@
|
|
|
8
8
|
import { describe, expect, test } from 'bun:test';
|
|
9
9
|
|
|
10
10
|
import {
|
|
11
|
+
commitFromState,
|
|
12
|
+
computeFollowers,
|
|
13
|
+
computeOthers,
|
|
11
14
|
DEFAULT_GRID_SIZE,
|
|
12
15
|
DEFAULT_SNAP_TOLERANCE,
|
|
13
16
|
DRAG_THRESHOLD_PX,
|
|
14
17
|
type DragEvent,
|
|
15
18
|
type DragState,
|
|
16
|
-
commitFromState,
|
|
17
|
-
computeFollowers,
|
|
18
|
-
computeOthers,
|
|
19
19
|
dragReducer,
|
|
20
20
|
selectionsToArtboardIds,
|
|
21
21
|
} from '../use-artboard-drag.tsx';
|
|
@@ -14,10 +14,10 @@ import { renderToStaticMarkup } from 'react-dom/server';
|
|
|
14
14
|
|
|
15
15
|
import {
|
|
16
16
|
type ActivityMessage,
|
|
17
|
-
type CanvasActivity,
|
|
18
|
-
CanvasActivityProvider,
|
|
19
17
|
activityKey,
|
|
20
18
|
applyActivityChange,
|
|
19
|
+
type CanvasActivity,
|
|
20
|
+
CanvasActivityProvider,
|
|
21
21
|
matchesArtboard,
|
|
22
22
|
useCanvasActivity,
|
|
23
23
|
} from '../use-canvas-activity.tsx';
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import { describe, expect, test } from 'bun:test';
|
|
4
4
|
|
|
5
|
-
import { type Rect, type SnapOptions
|
|
5
|
+
import { computeSnap, type Rect, type SnapOptions } from '../use-snap-guides.tsx';
|
|
6
6
|
|
|
7
7
|
const DEFAULTS: SnapOptions = { gridSize: 40, tolerance: 8, disabled: false };
|
|
8
8
|
|
|
@@ -8,10 +8,10 @@ import { afterEach, beforeEach, describe, expect, mock, test } from 'bun:test';
|
|
|
8
8
|
import { renderToStaticMarkup } from 'react-dom/server';
|
|
9
9
|
|
|
10
10
|
import {
|
|
11
|
-
type CommandRecord,
|
|
12
|
-
type CommandSinks,
|
|
13
11
|
_clearBuilderRegistry,
|
|
14
12
|
_clearStackStore,
|
|
13
|
+
type CommandRecord,
|
|
14
|
+
type CommandSinks,
|
|
15
15
|
registerCommand,
|
|
16
16
|
} from '../undo-stack.ts';
|
|
17
17
|
import {
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
* same cross-bundle rule as the activity context (DDR-077 lesson).
|
|
22
22
|
*/
|
|
23
23
|
|
|
24
|
-
import { type ReactNode,
|
|
24
|
+
import { createContext, type ReactNode, useContext, useEffect, useMemo, useState } from 'react';
|
|
25
25
|
|
|
26
26
|
import { colorForName } from './use-collab.tsx';
|
|
27
27
|
|
|
@@ -297,11 +297,7 @@ function handlePositions(s: Stroke): Array<{ corner: Corner; x: number; y: numbe
|
|
|
297
297
|
];
|
|
298
298
|
}
|
|
299
299
|
|
|
300
|
-
export function AnnotationResizeOverlay({
|
|
301
|
-
store,
|
|
302
|
-
}: {
|
|
303
|
-
store: StrokesStoreValue | null;
|
|
304
|
-
}): ReactNode {
|
|
300
|
+
export function AnnotationResizeOverlay({ store }: { store: StrokesStoreValue | null }): ReactNode {
|
|
305
301
|
ensureResizeStyles();
|
|
306
302
|
const annotSel = useAnnotationSelection();
|
|
307
303
|
const controller = useViewportControllerContext();
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
* selection resets (the strokes themselves persist via `.annotations.svg`).
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
|
-
import { type ReactNode,
|
|
13
|
+
import { createContext, type ReactNode, useCallback, useContext, useMemo, useState } from 'react';
|
|
14
14
|
|
|
15
15
|
export interface AnnotationSelectionValue {
|
|
16
16
|
selectedIds: string[];
|
|
@@ -34,11 +34,7 @@ function dedupe(ids: string[]): string[] {
|
|
|
34
34
|
return out;
|
|
35
35
|
}
|
|
36
36
|
|
|
37
|
-
export function AnnotationSelectionProvider({
|
|
38
|
-
children,
|
|
39
|
-
}: {
|
|
40
|
-
children: ReactNode;
|
|
41
|
-
}) {
|
|
37
|
+
export function AnnotationSelectionProvider({ children }: { children: ReactNode }) {
|
|
42
38
|
const [selectedIds, setSelectedIds] = useState<string[]>([]);
|
|
43
39
|
|
|
44
40
|
const replace = useCallback((id: string | string[]) => {
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* siblings under CanvasRouter all consume the same value.
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
|
-
import { type ReactNode,
|
|
11
|
+
import { createContext, type ReactNode, useCallback, useContext, useMemo, useState } from 'react';
|
|
12
12
|
|
|
13
13
|
export interface AnnotationsVisibilityValue {
|
|
14
14
|
visible: boolean;
|
|
@@ -38,7 +38,7 @@ import {
|
|
|
38
38
|
|
|
39
39
|
import { DRAG_THRESHOLD_PX as INPUT_DRAG_THRESHOLD_PX } from './input-router.tsx';
|
|
40
40
|
import type { Selection } from './use-selection-set.tsx';
|
|
41
|
-
import { type Rect, type SnapResult
|
|
41
|
+
import { computeSnap, type Rect, type SnapResult } from './use-snap-guides.tsx';
|
|
42
42
|
|
|
43
43
|
// ─────────────────────────────────────────────────────────────────────────────
|
|
44
44
|
// Constants
|
|
@@ -16,9 +16,11 @@
|
|
|
16
16
|
* <CollabProvider> never resolve these specifiers and pay zero bundle cost.
|
|
17
17
|
*/
|
|
18
18
|
|
|
19
|
+
import * as decoding from 'lib0/decoding';
|
|
20
|
+
import * as encoding from 'lib0/encoding';
|
|
19
21
|
import {
|
|
20
|
-
type ReactNode,
|
|
21
22
|
createContext,
|
|
23
|
+
type ReactNode,
|
|
22
24
|
useCallback,
|
|
23
25
|
useContext,
|
|
24
26
|
useEffect,
|
|
@@ -26,9 +28,6 @@ import {
|
|
|
26
28
|
useRef,
|
|
27
29
|
useState,
|
|
28
30
|
} from 'react';
|
|
29
|
-
|
|
30
|
-
import * as decoding from 'lib0/decoding';
|
|
31
|
-
import * as encoding from 'lib0/encoding';
|
|
32
31
|
import { Awareness, applyAwarenessUpdate, encodeAwarenessUpdate } from 'y-protocols/awareness';
|
|
33
32
|
import { readSyncMessage, writeSyncStep1, writeUpdate } from 'y-protocols/sync';
|
|
34
33
|
import * as Y from 'yjs';
|
|
@@ -18,8 +18,8 @@
|
|
|
18
18
|
*/
|
|
19
19
|
|
|
20
20
|
import {
|
|
21
|
-
type ReactNode,
|
|
22
21
|
createContext,
|
|
22
|
+
type ReactNode,
|
|
23
23
|
useCallback,
|
|
24
24
|
useContext,
|
|
25
25
|
useEffect,
|
|
@@ -31,13 +31,13 @@ import {
|
|
|
31
31
|
import {
|
|
32
32
|
type CommandRecord,
|
|
33
33
|
type CommandSinks,
|
|
34
|
-
type EditCommand,
|
|
35
|
-
type UndoStackState,
|
|
36
34
|
canRedo as canRedoOf,
|
|
37
35
|
canUndo as canUndoOf,
|
|
36
|
+
type EditCommand,
|
|
38
37
|
loadStackState,
|
|
39
38
|
rebuildCommand,
|
|
40
39
|
saveStackState,
|
|
40
|
+
type UndoStackState,
|
|
41
41
|
undoReducer,
|
|
42
42
|
} from './undo-stack.ts';
|
|
43
43
|
|
|
@@ -349,7 +349,6 @@ export function useUndoSinks(): UndoSinksValue {
|
|
|
349
349
|
return useContext(UndoSinksContext) ?? NOOP_SINKS;
|
|
350
350
|
}
|
|
351
351
|
|
|
352
|
-
export { UndoStackContext, UndoSinksContext };
|
|
353
|
-
|
|
354
352
|
// Re-export the EditCommand type for ergonomic single-import in consumers.
|
|
355
353
|
export type { CommandRecord, EditCommand } from './undo-stack.ts';
|
|
354
|
+
export { UndoSinksContext, UndoStackContext };
|