@1agh/maude 1.2.0 → 1.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (83) hide show
  1. package/README.md +3 -1
  2. package/apps/studio/acp/index.ts +43 -7
  3. package/apps/studio/annotations-layer.tsx +191 -116
  4. package/apps/studio/annotations-model.ts +39 -0
  5. package/apps/studio/annotations-sync.ts +50 -0
  6. package/apps/studio/api.ts +689 -36
  7. package/apps/studio/bin/annotate.mjs +3 -1
  8. package/apps/studio/bin/server-up.sh +17 -2
  9. package/apps/studio/canvas-edit.ts +391 -7
  10. package/apps/studio/canvas-lib.tsx +82 -18
  11. package/apps/studio/canvas-notice-message.ts +16 -0
  12. package/apps/studio/canvas-notifications.tsx +19 -0
  13. package/apps/studio/canvas-shell.tsx +57 -6
  14. package/apps/studio/client/app.jsx +686 -241
  15. package/apps/studio/client/apply-edit-request.ts +55 -0
  16. package/apps/studio/client/export-center.jsx +111 -61
  17. package/apps/studio/client/github.js +38 -1
  18. package/apps/studio/client/index-loader.ts +76 -0
  19. package/apps/studio/client/panels/CloudBar.jsx +52 -6
  20. package/apps/studio/client/panels/GitPanel.jsx +103 -0
  21. package/apps/studio/client/panels/OnboardingWizard.jsx +36 -7
  22. package/apps/studio/client/panels/RepoBranchSwitcher.jsx +92 -27
  23. package/apps/studio/client/panels/SourceConflictPanel.jsx +166 -0
  24. package/apps/studio/client/panels/SyncPanel.jsx +113 -0
  25. package/apps/studio/client/panels/TeamProjects.jsx +376 -0
  26. package/apps/studio/client/panels/file-deep-link-dialog.jsx +54 -0
  27. package/apps/studio/client/photo-knobs.jsx +3 -0
  28. package/apps/studio/client/share-dialog.jsx +91 -0
  29. package/apps/studio/client/share-link.js +94 -0
  30. package/apps/studio/client/styles/3-shell-maude.css +35 -18
  31. package/apps/studio/client/styles/4-components.css +18 -1
  32. package/apps/studio/client/tree-row-menu.jsx +48 -3
  33. package/apps/studio/client/whats-new.jsx +26 -32
  34. package/apps/studio/cloud/endpoints.ts +132 -0
  35. package/apps/studio/collab/index.ts +4 -0
  36. package/apps/studio/collab/persistence.ts +5 -1
  37. package/apps/studio/collab/registry.ts +9 -3
  38. package/apps/studio/collab/room.ts +13 -2
  39. package/apps/studio/context.ts +59 -0
  40. package/apps/studio/dist/client.bundle.js +1586 -1554
  41. package/apps/studio/dist/runtime/.min-sizes.json +1 -0
  42. package/apps/studio/dist/runtime/sonner.js +1 -0
  43. package/apps/studio/dist/styles.css +1 -1
  44. package/apps/studio/http.ts +289 -18
  45. package/apps/studio/inspect.ts +19 -0
  46. package/apps/studio/managed-projects.ts +150 -0
  47. package/apps/studio/notifications.tsx +292 -0
  48. package/apps/studio/runtime-bundle.ts +2 -0
  49. package/apps/studio/server.ts +59 -3
  50. package/apps/studio/sync/accepted-cold-start.ts +225 -0
  51. package/apps/studio/sync/accepted-link.ts +320 -0
  52. package/apps/studio/sync/action-stage.ts +343 -0
  53. package/apps/studio/sync/agent.ts +12 -60
  54. package/apps/studio/sync/cell-file-events.ts +3 -0
  55. package/apps/studio/sync/codec.ts +73 -6
  56. package/apps/studio/sync/ctl-provider.ts +15 -2
  57. package/apps/studio/sync/document-discovery.ts +81 -0
  58. package/apps/studio/sync/file-membership.ts +10 -2
  59. package/apps/studio/sync/file-plane.ts +309 -26
  60. package/apps/studio/sync/index.ts +1078 -19
  61. package/apps/studio/sync/migrate-seed.ts +110 -19
  62. package/apps/studio/sync/poke.ts +4 -2
  63. package/apps/studio/sync/presentation.ts +285 -2
  64. package/apps/studio/sync/projection.ts +820 -23
  65. package/apps/studio/sync/repeated-module.ts +73 -0
  66. package/apps/studio/sync/revision-barrier.ts +129 -0
  67. package/apps/studio/sync/seed-repair.ts +46 -0
  68. package/apps/studio/sync/source-merge.ts +100 -0
  69. package/apps/studio/sync/source-ops.ts +289 -0
  70. package/apps/studio/sync/source-recovery.ts +70 -0
  71. package/apps/studio/sync/source-validation.ts +56 -0
  72. package/apps/studio/sync/status.ts +79 -1
  73. package/apps/studio/sync/transaction-client.ts +460 -0
  74. package/apps/studio/sync/writer-registry.ts +236 -0
  75. package/apps/studio/text-caret.ts +35 -0
  76. package/apps/studio/undo-hud.tsx +9 -87
  77. package/apps/studio/use-canvas-media-drop.tsx +4 -39
  78. package/apps/studio/whats-new.json +101 -0
  79. package/cli/lib/harness/codex-runtime.mjs +4 -1
  80. package/package.json +9 -8
  81. package/plugins/design/dependencies.json +3 -3
  82. package/plugins/design/templates/_shell.html +47 -0
  83. package/plugins/flow/dependencies.json +3 -3
@@ -542,6 +542,45 @@ export const DEFAULT_HIGHLIGHTER_WIDTH = HIGHLIGHTER_WIDTHS[1];
542
542
  export const STICKY_DEFAULT_W = 200;
543
543
  export const STICKY_DEFAULT_H = 200;
544
544
  export const STICKY_MIN_SIZE = 40;
545
+ /**
546
+ * Ceiling for the grow-to-fit in `grownStickyBox` — ~370 lines at the default
547
+ * type. `fontSize` comes from a synced stroke's `data-fs` and is only checked
548
+ * for finiteness, so without this a peer could set `data-fs="200000"`, wait for
549
+ * the local user to edit that note, and have THEIR client persist a card
550
+ * millions of units tall — grow-only, undoable by hand alone.
551
+ */
552
+ export const STICKY_MAX_GROWN_H = 8000;
553
+
554
+ /**
555
+ * issue-106 — the box a sticky needs so its committed text is not clipped, or
556
+ * null when the text already fits.
557
+ *
558
+ * `.dc-sticky-body` is `overflow: hidden` on a card whose size was fixed at
559
+ * creation, and nothing ever grew it: past a card's capacity every further line
560
+ * was simply invisible, which is what made Shift+Enter look inert on a full
561
+ * note. `measuredH` is the editor's own `scrollHeight` — same class, width and
562
+ * font as the committed body, in world units — so the growth is exact rather
563
+ * than estimated.
564
+ *
565
+ * GROWS ONLY, and never past `STICKY_MAX_GROWN_H`: a sticky the user
566
+ * deliberately made roomy never shrinks back on a text edit. The box is normalized on the way out (a sticky dragged bottom-up
567
+ * carries a negative w/h), which is idempotent — every renderer already reads
568
+ * it through the same min/abs pair.
569
+ */
570
+ export function grownStickyBox(
571
+ s: Pick<StickyStroke, 'x' | 'y' | 'w' | 'h'>,
572
+ measuredH: number
573
+ ): { x: number; y: number; w: number; h: number } | null {
574
+ if (!Number.isFinite(measuredH) || measuredH <= 0) return null;
575
+ const next = Math.min(Math.ceil(measuredH), STICKY_MAX_GROWN_H);
576
+ if (next <= Math.abs(s.h)) return null;
577
+ return {
578
+ x: Math.min(s.x, s.x + s.w),
579
+ y: Math.min(s.y, s.y + s.h),
580
+ w: Math.abs(s.w),
581
+ h: next,
582
+ };
583
+ }
545
584
  // Phase 24 — a bare tap with the Shape tool drops a default-sized shape at the
546
585
  // tap point (FigJam parity: click commits, drag sizes). Square aspect.
547
586
  export const SHAPE_DEFAULT_SIZE = 120;
@@ -0,0 +1,50 @@
1
+ import type * as Y from 'yjs';
2
+
3
+ /** Echo identity is transport metadata, never authorization or a durable ACK. */
4
+ export const ANNOTATION_WRITE_ID = 'writeId';
5
+
6
+ export function validAnnotationWriteId(value: unknown): value is string {
7
+ return typeof value === 'string' && /^[a-zA-Z0-9_-]{1,96}$/.test(value);
8
+ }
9
+
10
+ /** Remember authored operations, not previously rendered content (A → B → A). */
11
+ export function createAnnotationEchoGuard() {
12
+ const authored = new Map<string, string>();
13
+ return {
14
+ remember(id: string, svg: string) {
15
+ authored.set(id, svg);
16
+ if (authored.size > 64) {
17
+ const oldest = authored.keys().next().value;
18
+ if (oldest !== undefined) authored.delete(oldest);
19
+ }
20
+ },
21
+ forget(id: string) {
22
+ authored.delete(id);
23
+ },
24
+ isOwn(svg: string, id: unknown) {
25
+ return validAnnotationWriteId(id) && authored.get(id) === svg;
26
+ },
27
+ };
28
+ }
29
+
30
+ /** Old clients/importers may change svg without changing its old writeId. */
31
+ export function observeAnnotationSnapshots(
32
+ doc: Y.Doc,
33
+ receive: (svg: string, writeId: unknown) => void
34
+ ): () => void {
35
+ const map = doc.getMap<unknown>('annotations');
36
+ const apply = (event?: Y.YMapEvent<unknown>) => {
37
+ if (event && !event.keysChanged.has('svg') && !event.keysChanged.has(ANNOTATION_WRITE_ID))
38
+ return;
39
+ const svg = map.get('svg');
40
+ if (typeof svg !== 'string' && !event?.keysChanged.has('svg')) return;
41
+ const id =
42
+ !event || event.keysChanged.has(ANNOTATION_WRITE_ID)
43
+ ? map.get(ANNOTATION_WRITE_ID)
44
+ : undefined;
45
+ receive(typeof svg === 'string' ? svg : '', id);
46
+ };
47
+ map.observe(apply);
48
+ apply();
49
+ return () => map.unobserve(apply);
50
+ }