@witty-works/editor 2.2.1 → 2.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
@@ -8,7 +8,7 @@ One self-contained script: no framework, no stylesheet to include.
8
8
 
9
9
  ```html
10
10
  <div id="editor"></div>
11
- <script src="https://cdn.jsdelivr.net/npm/@witty-works/editor@2.2.1/dist/witty-editor.js"></script>
11
+ <script src="https://cdn.jsdelivr.net/npm/@witty-works/editor@2.3.0/dist/witty-editor.js"></script>
12
12
  <script>
13
13
  const editor = WittyEditor.mount(document.getElementById('editor'), {
14
14
  endpoint: 'https://your-nlp-api.example/',
@@ -56,10 +56,10 @@ It returns a handle:
56
56
  The W icon at the end of the toolbar shows whether Witty is checking, and opens a menu (a keyboard-operable ARIA menu: arrow keys, Home and End move, Escape closes and returns focus to the icon):
57
57
 
58
58
  - **Settings…**: Witty's categories and preferences, as in the browser extension.
59
- - **Switch gender format…**: rewrites every gendered form in the text into one of the eight German separator formats (`/in`, `/-in`, `_in`, `*in`, `:in`, `(-)`, `()`, `In`), labelled as in the settings. The Inklusivum (`de-e`) is listed but not available yet.
59
+ - **Switch gender format…**: rewrites every gendered form in the text into one of the eight German separator formats (`/in`, `/-in`, `_in`, `*in`, `:in`, `(-)`, `()`, `In`), labelled as in the settings. It also genders roles in the generic masculine (`Der Lehrer` → `Die:der Lehrer:in`) and pair formulas (`Schüler und Schülerinnen` → `Schüler:innen`), as far as the API marks them. The Inklusivum (`de-e`) is listed but not available yet.
60
60
  - **Help** and **About**: the Witty Works help on the editor and the website, in a new tab.
61
61
 
62
- A switch makes the chosen format the configured one, waits until the whole text has been checked (every batch of a long text), and then applies all alerts the API marked with `bulk: "gender_format"` in one transaction, so a single undo restores the text. The result is announced in the live region and passed to `onStatus` as `genderFormatSwitch`. If only part of the text was checked (`limitReached`), what was checked is switched and the message says so.
62
+ A switch makes the chosen format the configured one, waits until the whole text has been checked (every batch of a long text), and then applies all alerts the API marked with `bulk: "gender_format"` in one transaction, so a single undo restores the text. The result is announced once, in the editor's live region, and passed to `onStatus` as `genderFormatSwitch`; `count` includes the gendered masculines. If only part of the text was checked (`limitReached`), what was checked is switched and the message says so.
63
63
 
64
64
  The switch's checks ask for the gender-format alerts even where the account turned them off: `gendered_denominations_ending_advanced` is taken out of `disabled_categories` and `gendered_roles_format` is `inclusive_gender`, for those requests only; the user's settings stay as they are. If the API still sends none, because the account's stored configuration forces them off, the editor says "Switching the gender format is turned off for this account".
65
65
 
@@ -69,7 +69,11 @@ An organisation or user config can also force the gender format. The API then co
69
69
 
70
70
  The editor decides what to apply by `bulk` alone, never by subcategory:
71
71
 
72
- - A check result with `bulk: "gender_format"` belongs to the switch to the configured `german_gender_ending`. It has exactly one alternative, the form in that format, and such results never overlap.
72
+ - A check result with `bulk: "gender_format"` belongs to the switch to the configured `german_gender_ending`: a form in another separator format, a role in the generic masculine, or a pair formula the API recognises.
73
+ - `bulk_alternative` is the index into its `alternatives` of the one the switch applies. The editor applies `alternatives[bulk_alternative]` when the index is an integer within range and that alternative has a `text`, and skips the result otherwise.
74
+ - Without `bulk_alternative` (API versions before it), a result is applied only if it has exactly one alternative, which is then the form in the target format.
75
+ - Such results never overlap, and applying all of them in any order gives the same text.
76
+ - Feminine forms, address forms, pronouns and pair formulas the API didn't recognise are left out by the API on purpose; the editor applies nothing it isn't marked for.
73
77
  - `bulk` is absent (or `null`) on every other result. Unknown `bulk` values are ignored.
74
78
  - Every check response lists the groups the request can return in `bulk_actions`, whether or not a result does: `["gender_format"]` for German with a separator format, inclusive roles and the gender-format alerts on, `[]` otherwise. After the switch's check, a list without `"gender_format"` means the account keeps the switch off.
75
79
  - `gender_separator` in the check response is the format the API applied; for German it is a `german_gender_ending` value.