foldkit-builder 0.1.2 → 0.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.
package/README.md CHANGED
@@ -178,8 +178,12 @@ Behaviors; `foldkit-mixins-builder` does.
178
178
  | Enter | edit its first text in place |
179
179
  | Escape | deselect it |
180
180
 
181
- Attach `keyCommand` to the layers panel and the canvas, not the whole editor,
182
- so Delete in a text box edits the text. A move the page refuses is refused
181
+ Attach `PageBuilder.keyPressed(model, key, modifiers)` to the layers panel
182
+ and the canvas, not the whole editor, so Delete in a text box edits the
183
+ text. It sends `KeyPressed` for every key a command binds, and `update`
184
+ runs `keyCommand` against the Model as it is then, not as the view last drew
185
+ it: a key pressed before the frame that draws a new selection acts on that
186
+ selection. A bound key with nothing to do has its default held back there. A move the page refuses is refused
183
187
  as any edit is. A key's `mod` is Ctrl, or ⌘ on a Mac; `mod` and `alt` must be
184
188
  as given, and `shift` only where given, so Delete takes Shift+Delete too.
185
189
  - **`Builder.make(name, { commands: built => ... })`** changes the table: another
@@ -223,8 +227,8 @@ Enter or leaving it ─► EditingCommitted Escape ─► EditingCancelled:
223
227
  already holds, so no step is empty. A session in which nothing was typed
224
228
  writes nothing when it ends, so a field only looked at does not put back
225
229
  over another's edit the text it showed.
226
- - **While text is edited, the keys are the text's:** `keyCommand` offers
227
- nothing, so Backspace deletes a letter, not the block.
230
+ - **While text is edited, the keys are the text's:** `keyPressed` and
231
+ `keyCommand` offer nothing, so Backspace deletes a letter, not the block.
228
232
  - **Editing ends when its node is no longer the one selected**, as a click
229
233
  elsewhere or a removal makes it, and at an undo or a redo, which change the
230
234
  page under the field.
@@ -432,9 +436,11 @@ Each helper that may have no answer returns an `Option`, as the Model's
432
436
  among its siblings; none at an end.
433
437
  - `PageBuilder.dropAt(document, source, target, zone)` is where a drag over
434
438
  `target` would put `dragged`; none where the page refuses it.
439
+ - `PageBuilder.keyPressed(model, key, modifiers)` is what a key on the layers
440
+ or the canvas sends, for Foldkit's `OnKeyDownPreventDefault`: `KeyPressed`
441
+ for a key a command binds, none for another or while text is edited.
435
442
  - `PageBuilder.keyCommand(model, key, modifiers)` is the Message a shortcut
436
- sends; none for a key it does not handle, which is what Foldkit's
437
- `OnKeyDownPreventDefault` takes.
443
+ runs in the Model given; none for a key with nothing to do there.
438
444
  - `PageBuilder.replace(model, document)` and `PageBuilder.settle(model)` are what
439
445
  the form control's fill and settle do.
440
446