@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.
- package/dist/geometry/index.d.mts +1 -1
- package/dist/geometry/index.mjs +1 -1
- package/dist/{geometry-Brsa66kT.mjs → geometry-B6555wfO.mjs} +2 -8
- package/dist/grid/index.d.mts +1 -1
- package/dist/grid/index.mjs +1 -1
- package/dist/{grid-BR8od5w8.mjs → grid-BjZ79Ib6.mjs} +1 -4
- package/dist/{index-CYSqrhal.d.mts → index-BUdcJ8w8.d.mts} +1 -4
- package/dist/{index-Bt8yLTLG.d.mts → index-CukXdXbn.d.mts} +1 -4
- package/dist/index.d.mts +39 -157
- package/dist/index.mjs +48 -129
- package/package.json +1 -1
- package/src/assets/references.ts +1 -4
- package/src/assets/types.ts +1 -5
- package/src/assets/url.ts +1 -4
- package/src/bindings/bindings.ts +2 -15
- package/src/bindings/derive.ts +1 -4
- package/src/clipboard/format.ts +1 -4
- package/src/clipboard/insert.ts +1 -4
- package/src/commands/builtin.ts +13 -0
- package/src/editing-host.ts +3 -15
- package/src/editor.ts +7 -27
- package/src/events.ts +1 -4
- package/src/frames/frames.ts +2 -16
- package/src/geometry/curves.ts +1 -4
- package/src/geometry/simplify.ts +1 -4
- package/src/grid/math.ts +1 -4
- package/src/groups/cleanup.ts +1 -4
- package/src/image/images.ts +1 -4
- package/src/input/handle-sessions.ts +2 -7
- package/src/input/router.ts +1 -4
- package/src/interactions/interactions.ts +1 -4
- package/src/linear/elbow.ts +2 -8
- package/src/linear/linear.ts +1 -4
- package/src/links/links.ts +3 -14
- package/src/model/elements.ts +3 -12
- package/src/model/frame.ts +2 -9
- package/src/model/linear.ts +2 -8
- package/src/model/settings.ts +2 -5
- package/src/model/style.ts +2 -8
- package/src/modes/modes.ts +1 -0
- package/src/permissions/capabilities.ts +1 -0
- package/src/permissions/permissions.ts +6 -8
- package/src/plugins/plugins.ts +1 -6
- package/src/presence/presence.ts +1 -4
- package/src/scene/scene.ts +1 -5
- package/src/selection/selection.ts +1 -4
- package/src/snapping/snapping.ts +1 -2
- package/src/styles/styles.ts +1 -4
- package/src/sync/projection.ts +1 -4
- package/src/text/layout.ts +1 -4
- package/src/text/measure.ts +2 -8
- package/src/text/text.ts +1 -4
- package/src/transform/transform.ts +1 -2
- package/src/tx/derivation.ts +2 -10
- package/src/tx/document-steps.ts +1 -4
- 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
|
-
//
|
|
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> }
|
package/src/tx/derivation.ts
CHANGED
|
@@ -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,
|
package/src/tx/document-steps.ts
CHANGED
|
@@ -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[];
|
package/src/tx/record-writer.ts
CHANGED
|
@@ -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
|
|