@medienreaktor/neos-studio 2.0.5 → 2.1.1

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 (3) hide show
  1. package/README.md +2 -2
  2. package/index.d.ts +13 -5
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -1,14 +1,14 @@
1
1
  # @medienreaktor/neos-studio
2
2
 
3
3
  TypeScript declarations of the [Neos Studio](https://github.com/medienreaktor/Medienreaktor.NeosStudio)
4
- plugin API, version 2.0.5 of Studio. Types only: a plugin imports from
4
+ plugin API, version 2.1.1 of Studio. Types only: a plugin imports from
5
5
  `@medienreaktor/neos-studio` and marks that import (and `react`, `react-dom`,
6
6
  `react/jsx-runtime`) external in its bundler, mapped to the globals the shell
7
7
  publishes (`window.NeosStudio`, `window.React`, ...). Install the version
8
8
  matching the Studio you build against:
9
9
 
10
10
  ```bash
11
- npm install -D @medienreaktor/neos-studio@2.0.5 @types/react
11
+ npm install -D @medienreaktor/neos-studio@2.1.1 @types/react
12
12
  ```
13
13
 
14
14
  See "Extending Studio" in Studio's README for the full setup.
package/index.d.ts CHANGED
@@ -14397,13 +14397,14 @@ interface PropertyEditorSubject {
14397
14397
  * hosts remount on a subject change to reset), and report outward through two
14398
14398
  * callbacks. The split is what lets one editor serve both hosts:
14399
14399
  *
14400
- * - `onCommit` fires at a natural commit boundary (blur, Enter, a discrete
14401
- * pick) and carries the value worth keeping. The inspector persists here;
14400
+ * - `onCommit` fires at an explicit commit (Enter, a text editor's inline
14401
+ * apply button, a discrete pick) and carries the value worth keeping -
14402
+ * leaving a field does not commit. The inspector persists here;
14402
14403
  * it is the essential signal, so every editor must call it.
14403
14404
  * - `onChange` fires on every keystroke-level change, before a commit, so a
14404
14405
  * host tracking a live working copy stays current. The creation dialog
14405
- * needs this - its required-field validation gates the Create button, which
14406
- * would otherwise lag a click behind commit-on-blur. Editors with no
14406
+ * needs this - it submits what was typed, committed or not, and its
14407
+ * required-field validation gates the Create button. Editors with no
14407
14408
  * distinct editing phase (a checkbox, a select) need only call `onCommit`.
14408
14409
  *
14409
14410
  * The host decides what those mean: the inspector auto-saves on commit, the
@@ -14415,12 +14416,19 @@ interface PropertyEditorProps {
14415
14416
  subject: PropertyEditorSubject;
14416
14417
  /** The current value as the node carries it. Seeds the editor's state; `undefined` means unset, `null` clears it. */
14417
14418
  value: unknown;
14418
- /** Commit a value worth keeping (blur, Enter, a discrete pick). Required - the inspector persists here. */
14419
+ /** Commit a value worth keeping (Enter, an apply button, a discrete pick). Required - the inspector persists here. */
14419
14420
  onCommit: (value: unknown) => void;
14420
14421
  /** Report a live, pre-commit value (per keystroke). Optional - only hosts tracking a working copy (the creation dialog) consume it. */
14421
14422
  onChange?: (value: unknown) => void;
14422
14423
  /** The editor's configuration - ui.inspector.editorOptions / ui.editorOptions for this property. */
14423
14424
  options: Record<string, unknown>;
14425
+ /**
14426
+ * The id for the editor's main control (its input, textarea, trigger
14427
+ * button or editable): the host's label points at it, which names the
14428
+ * control and focuses it on a click. Editors should set it on exactly one
14429
+ * focusable element; absent when the host renders no label.
14430
+ */
14431
+ id?: string;
14424
14432
  /** Focus on mount; the host sets this for the first field of a form. */
14425
14433
  autoFocus?: boolean;
14426
14434
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@medienreaktor/neos-studio",
3
- "version": "2.0.5",
3
+ "version": "2.1.1",
4
4
  "description": "TypeScript declarations of the Neos Studio plugin API (window.NeosStudio). Types only - mark the import external in your plugin bundle.",
5
5
  "license": "GPL-3.0-or-later",
6
6
  "homepage": "https://github.com/medienreaktor/Medienreaktor.NeosStudio#extending-studio",