@drawback/core 0.2.0-rc.20261201121350 → 0.2.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 (56) hide show
  1. package/dist/geometry/index.d.mts +1 -1
  2. package/dist/geometry/index.mjs +1 -1
  3. package/dist/{geometry-Brsa66kT.mjs → geometry-B6555wfO.mjs} +2 -8
  4. package/dist/grid/index.d.mts +1 -1
  5. package/dist/grid/index.mjs +1 -1
  6. package/dist/{grid-BR8od5w8.mjs → grid-BjZ79Ib6.mjs} +1 -4
  7. package/dist/{index-CYSqrhal.d.mts → index-BUdcJ8w8.d.mts} +1 -4
  8. package/dist/{index-Bt8yLTLG.d.mts → index-CukXdXbn.d.mts} +1 -4
  9. package/dist/index.d.mts +39 -157
  10. package/dist/index.mjs +48 -129
  11. package/package.json +1 -1
  12. package/src/assets/references.ts +1 -4
  13. package/src/assets/types.ts +1 -5
  14. package/src/assets/url.ts +1 -4
  15. package/src/bindings/bindings.ts +2 -15
  16. package/src/bindings/derive.ts +1 -4
  17. package/src/clipboard/format.ts +1 -4
  18. package/src/clipboard/insert.ts +1 -4
  19. package/src/commands/builtin.ts +13 -0
  20. package/src/editing-host.ts +3 -15
  21. package/src/editor.ts +7 -27
  22. package/src/events.ts +1 -4
  23. package/src/frames/frames.ts +2 -16
  24. package/src/geometry/curves.ts +1 -4
  25. package/src/geometry/simplify.ts +1 -4
  26. package/src/grid/math.ts +1 -4
  27. package/src/groups/cleanup.ts +1 -4
  28. package/src/image/images.ts +1 -4
  29. package/src/input/handle-sessions.ts +2 -7
  30. package/src/input/router.ts +1 -4
  31. package/src/interactions/interactions.ts +1 -4
  32. package/src/linear/elbow.ts +2 -8
  33. package/src/linear/linear.ts +1 -4
  34. package/src/links/links.ts +3 -14
  35. package/src/model/elements.ts +3 -12
  36. package/src/model/frame.ts +2 -9
  37. package/src/model/linear.ts +2 -8
  38. package/src/model/settings.ts +2 -5
  39. package/src/model/style.ts +2 -8
  40. package/src/modes/modes.ts +1 -0
  41. package/src/permissions/capabilities.ts +1 -0
  42. package/src/permissions/permissions.ts +6 -8
  43. package/src/plugins/plugins.ts +1 -6
  44. package/src/presence/presence.ts +1 -4
  45. package/src/scene/scene.ts +1 -5
  46. package/src/selection/selection.ts +1 -4
  47. package/src/snapping/snapping.ts +1 -2
  48. package/src/styles/styles.ts +1 -4
  49. package/src/sync/projection.ts +1 -4
  50. package/src/text/layout.ts +1 -4
  51. package/src/text/measure.ts +2 -8
  52. package/src/text/text.ts +1 -4
  53. package/src/transform/transform.ts +1 -2
  54. package/src/tx/derivation.ts +2 -10
  55. package/src/tx/document-steps.ts +1 -4
  56. package/src/tx/record-writer.ts +1 -4
package/src/text/text.ts CHANGED
@@ -339,10 +339,7 @@ export class TextController {
339
339
  return boxContainsPoint(expandBox(layout.box, LABEL_GAP_PADDING), local);
340
340
  }
341
341
 
342
- /**
343
- * Extra fields that keep a text record consistent: auto boxes fit their text, fixed
344
- * boxes fit their height, corner scaling scales the font, labels grow their shape.
345
- */
342
+ /** Fields that keep a text record consistent (box fitting, corner scaling, labels). */
346
343
  normalize(
347
344
  before: ElementRecord | undefined,
348
345
  after: ElementRecord,
@@ -424,8 +424,7 @@ export class TransformController {
424
424
  idMap.set(element.id, createId());
425
425
  }
426
426
 
427
- // Each copy goes right after its original. Originals are handled in render order, so the
428
- // original's next sibling is unaffected by earlier copies: one position map per layer.
427
+ // Render order keeps each original's next sibling stable: one position map per layer.
429
428
  const layerOrders = new Map<
430
429
  string,
431
430
  { readonly siblings: readonly ElementRecord[]; readonly index: Map<string, number> }
@@ -23,12 +23,7 @@ export interface CommitDerivationContext {
23
23
  deleteRecord(key: string): void;
24
24
  }
25
25
 
26
- /**
27
- * One step run on every local commit, after permissions are enforced and before the change
28
- * set is validated. Steps run in order; each sees the intended changes plus earlier steps'
29
- * changes, and returns the record keys it changed. Remote changes are never derived: their
30
- * change sets already contain the sender's derived operations.
31
- */
26
+ /** Ordered local-commit step before validation; returns changed keys. Never runs for remote. */
32
27
  export interface CommitDerivation {
33
28
  readonly id: string;
34
29
  derive(context: CommitDerivationContext): readonly string[];
@@ -57,10 +52,7 @@ export interface DerivationRun {
57
52
  context(operations: readonly ChangeOperation[]): CommitDerivationContext;
58
53
  }
59
54
 
60
- /**
61
- * Runs `steps` in order and returns every record key they changed. The operations a step sees
62
- * are recomputed only when an earlier step changed something.
63
- */
55
+ /** Runs `steps` in order, recomputing operations only after a step changed something. */
64
56
  export function runCommitDerivations(
65
57
  steps: readonly CommitDerivation[],
66
58
  run: DerivationRun,
@@ -13,10 +13,7 @@ export interface DocumentLoadStep {
13
13
  run(event: DocumentLoadEvent): void;
14
14
  }
15
15
 
16
- /**
17
- * Runs the editor's internal reactions to document changes and loads, in the order they are
18
- * listed, before any public listener. A failing step is reported and the others still run.
19
- */
16
+ /** Internal reactions to changes and loads, before public listeners; a failure skips one step. */
20
17
  export class DocumentSteps {
21
18
  readonly #change: readonly DocumentChangeStep[];
22
19
  readonly #load: readonly DocumentLoadStep[];
@@ -65,10 +65,7 @@ export interface RecordWriterDependencies {
65
65
  creationLayer(): LayerId | undefined;
66
66
  }
67
67
 
68
- /**
69
- * Creates and updates normalized records inside a transaction's record store: ids, default
70
- * layer, order keys, style materialization and validation.
71
- */
68
+ /** Writes normalized records in a transaction: ids, layer, order, styles, validation. */
72
69
  export class RecordWriter {
73
70
  readonly #deps: RecordWriterDependencies;
74
71