svedit 0.11.1 → 0.12.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/README.md +230 -64
- package/dist/Command.svelte.d.ts +21 -4
- package/dist/Command.svelte.d.ts.map +1 -1
- package/dist/Command.svelte.js +85 -27
- package/dist/Node.svelte +29 -1
- package/dist/Node.svelte.d.ts.map +1 -1
- package/dist/NodeArrayProperty.svelte +119 -12
- package/dist/NodeArrayProperty.svelte.d.ts.map +1 -1
- package/dist/NodeGap.svelte +48 -6
- package/dist/NodeGap.svelte.d.ts.map +1 -1
- package/dist/Session.svelte.d.ts +31 -14
- package/dist/Session.svelte.d.ts.map +1 -1
- package/dist/Session.svelte.js +155 -77
- package/dist/Svedit.svelte +110 -89
- package/dist/Svedit.svelte.d.ts.map +1 -1
- package/dist/{AnnotatedTextProperty.svelte → TextProperty.svelte} +45 -44
- package/dist/TextProperty.svelte.d.ts +7 -0
- package/dist/TextProperty.svelte.d.ts.map +1 -0
- package/dist/Transaction.svelte.d.ts +78 -40
- package/dist/Transaction.svelte.d.ts.map +1 -1
- package/dist/Transaction.svelte.js +412 -234
- package/dist/doc_utils.d.ts +96 -21
- package/dist/doc_utils.d.ts.map +1 -1
- package/dist/doc_utils.js +440 -168
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/node_visibility.svelte.d.ts +30 -4
- package/dist/node_visibility.svelte.d.ts.map +1 -1
- package/dist/node_visibility.svelte.js +327 -363
- package/dist/paste_utils.d.ts +3 -2
- package/dist/paste_utils.d.ts.map +1 -1
- package/dist/paste_utils.js +16 -13
- package/dist/transforms.svelte.d.ts.map +1 -1
- package/dist/transforms.svelte.js +5 -6
- package/dist/types.d.ts +112 -42
- package/dist/utils.d.ts +75 -12
- package/dist/utils.d.ts.map +1 -1
- package/dist/utils.js +292 -78
- package/package.json +4 -1
- package/src/lib/Command.svelte.js +85 -27
- package/src/lib/Node.svelte +29 -1
- package/src/lib/NodeArrayProperty.svelte +119 -12
- package/src/lib/NodeGap.svelte +48 -6
- package/src/lib/Session.svelte.js +155 -77
- package/src/lib/Svedit.svelte +110 -89
- package/src/lib/{AnnotatedTextProperty.svelte → TextProperty.svelte} +45 -44
- package/src/lib/Transaction.svelte.js +412 -234
- package/src/lib/doc_utils.js +440 -168
- package/src/lib/index.js +1 -1
- package/src/lib/node_visibility.svelte.js +327 -363
- package/src/lib/paste_utils.js +16 -13
- package/src/lib/transforms.svelte.js +5 -6
- package/src/lib/types.d.ts +112 -42
- package/src/lib/utils.js +292 -78
- package/dist/AnnotatedTextProperty.svelte.d.ts +0 -7
- package/dist/AnnotatedTextProperty.svelte.d.ts.map +0 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { default as Svedit } from "./Svedit.svelte";
|
|
2
|
-
export { default as
|
|
2
|
+
export { default as TextProperty } from "./TextProperty.svelte";
|
|
3
3
|
export { default as CustomProperty } from "./CustomProperty.svelte";
|
|
4
4
|
export { default as Node } from "./Node.svelte";
|
|
5
5
|
export { default as NodeArrayProperty } from "./NodeArrayProperty.svelte";
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// Main exports for the svedit library
|
|
2
2
|
export { default as Svedit } from './Svedit.svelte';
|
|
3
|
-
export { default as
|
|
3
|
+
export { default as TextProperty } from './TextProperty.svelte';
|
|
4
4
|
export { default as CustomProperty } from './CustomProperty.svelte';
|
|
5
5
|
export { default as Node } from './Node.svelte';
|
|
6
6
|
export { default as NodeArrayProperty } from './NodeArrayProperty.svelte';
|
|
@@ -1,9 +1,35 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Install the visibility registry on the svedit context
|
|
3
|
-
* the IntersectionObserver + MutationObserver lifecycle to editable
|
|
4
|
-
* state.
|
|
2
|
+
* Install the visibility registry on the svedit context.
|
|
5
3
|
*
|
|
6
|
-
*
|
|
4
|
+
* Elements register themselves via the track_node / track_array
|
|
5
|
+
* attachments, so registration follows the DOM's actual lifecycle.
|
|
6
|
+
* The IntersectionObservers own viewport changes; document changes
|
|
7
|
+
* only trigger an edge-state re-sync over the registered arrays.
|
|
8
|
+
*
|
|
9
|
+
* @param {object} svedit - Svedit context (session, editable)
|
|
7
10
|
*/
|
|
8
11
|
export function create_node_visibility(svedit: object): void;
|
|
12
|
+
/**
|
|
13
|
+
* Pure visibility check for a gap's `.positioned` class. NodeGap calls
|
|
14
|
+
* this from a $derived, so the `near.has()` reads are tracked at
|
|
15
|
+
* per-key granularity — a gap re-evaluates only when its own
|
|
16
|
+
* dependencies change. Applying the class declaratively means it
|
|
17
|
+
* survives DOM recreation without a document change (e.g. dev-mode
|
|
18
|
+
* HMR component swaps).
|
|
19
|
+
*
|
|
20
|
+
* `near` must come from `get_array_indices` held in a SEPARATE
|
|
21
|
+
* $derived (see the note there): membership reads on a set created
|
|
22
|
+
* within the same derived are not tracked by Svelte.
|
|
23
|
+
*
|
|
24
|
+
* @param {SvelteSet<number>} near - near child indices of the array
|
|
25
|
+
* @param {{ first: boolean, last: boolean } | undefined} edge_state
|
|
26
|
+
* @param {number} offset
|
|
27
|
+
* @param {boolean} is_last
|
|
28
|
+
* @param {boolean} empty
|
|
29
|
+
*/
|
|
30
|
+
export function should_position_gap(near: SvelteSet<number>, edge_state: {
|
|
31
|
+
first: boolean;
|
|
32
|
+
last: boolean;
|
|
33
|
+
} | undefined, offset: number, is_last: boolean, empty: boolean): boolean;
|
|
34
|
+
import { SvelteSet } from 'svelte/reactivity';
|
|
9
35
|
//# sourceMappingURL=node_visibility.svelte.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"node_visibility.svelte.d.ts","sourceRoot":"","sources":["../src/lib/node_visibility.svelte.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"node_visibility.svelte.d.ts","sourceRoot":"","sources":["../src/lib/node_visibility.svelte.js"],"names":[],"mappings":"AA8iBA;;;;;;;;;GASG;AACH,+CAFW,MAAM,QAsEhB;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,0CANW,SAAS,CAAC,MAAM,CAAC,cACjB;IAAE,KAAK,EAAE,OAAO,CAAC;IAAC,IAAI,EAAE,OAAO,CAAA;CAAE,GAAG,SAAS,UAC7C,MAAM,WACN,OAAO,SACP,OAAO,WA2BjB;0BAllBoC,mBAAmB"}
|