@weasel-js/text-tools 1.19.1 → 2.0.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 CHANGED
@@ -12,25 +12,25 @@ npm install @weasel-js/text-tools
12
12
  ```
13
13
 
14
14
  Core knows no text. A canvas whose scene holds text nodes (data with a string
15
- `text`) turns them on with `textPreset`:
15
+ `text`) turns them on with `textTools.text`:
16
16
 
17
17
  ```tsx
18
18
  import { SceneCanvas } from '@weasel-js/core';
19
- import { textPreset, textToolsPreset } from '@weasel-js/text-tools';
20
- import { drawPreset } from '@weasel-js/editing';
19
+ import * as textTools from '@weasel-js/text-tools/presets';
20
+ import * as presets from '@weasel-js/editing/presets';
21
21
 
22
- <SceneCanvas scene={scene} features={[drawPreset, textToolsPreset]} />;
22
+ <SceneCanvas scene={scene} features={[presets.draw, textTools.textTools]} />;
23
23
  ```
24
24
 
25
25
  | Preset | What it adds |
26
26
  |---|---|
27
- | `textPreset` | the `kit:text` painter, whose glyphs are its outline for booleans and Create Outlines; `'text'` routing and properties; the `text` and `sticky` inserts; the canvas's own editor and the `textEdit` dep; `enterTextEdit`, a double-click opening text in place, and a click opening a path effect's hidden text; plain-text paste |
27
+ | `textTools.text` | the `kit:text` painter, whose glyphs are its outline for booleans and Create Outlines; `'text'` routing and properties; the `text` and `sticky` inserts; the canvas's own editor and the `textEdit` dep; `enterTextEdit`, a double-click opening text in place, and a click opening a path effect's hidden text; plain-text paste |
28
28
  | `createTextPreset({ editor })` | the same, with the editor configured by `useSceneTextEdit`'s options, or `editor: false` for none |
29
- | `textToolsPreset` | the text and sticky-note tools, with `textPreset` |
30
- | `whiteboardPreset` | the pencil, text and the sticky note on an open canvas, with view, pick, move, resize and edit |
29
+ | `textTools.textTools` | the text and sticky-note tools, with `textTools.text` |
30
+ | `textTools.whiteboard` | the pencil, text and the sticky note on an open canvas, with view, pick, move, resize and edit |
31
31
 
32
32
  A canvas taking its tools through `<SceneCanvas tools>` gets the same two from
33
- `useTextToolsTools()`, beside `textPreset`. A scene drawn with no canvas
33
+ `useTextToolsTools()`, beside `textTools.text`. A scene drawn with no canvas
34
34
  (`renderSceneToPixels`, an export) paints text once `TEXT_PAINTER` is
35
35
  registered for it: `nodeShapesOf(scene).register(TEXT_PAINTER)`.
36
36