@wysio/react 0.1.0-alpha.0 → 0.1.0-alpha.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,21 @@
1
1
  # @wysio/react
2
2
 
3
+ ## 0.1.0-alpha.1
4
+
5
+ ### Minor Changes
6
+
7
+ - 22876f8: Form fields:
8
+
9
+ - New `attributes` option and `editor.setAttributes()` for extra attributes on the editing area, such as `aria-invalid` and `aria-describedby` for validation errors. `@wysio/vue` and `@wysio/react` get an `attributes` prop that applies changes without recreating the editor.
10
+ - `<wysio-editor>`: an `options` attribute (JSON) for any other option; a `<label for>` or wrapping `<label>` names the editor and focuses it; `focus()` focuses the editing area; new `ready` and `error` events.
11
+
12
+ ### Patch Changes
13
+
14
+ - Updated dependencies [51886e3]
15
+ - Updated dependencies [22876f8]
16
+ - Updated dependencies [e091b7c]
17
+ - wysio@0.2.0-alpha.7
18
+
3
19
  ## 0.1.0-alpha.0
4
20
 
5
21
  ### Minor Changes
package/README.md CHANGED
@@ -50,6 +50,7 @@ export function PostForm() {
50
50
  | `placeholder` | `string` | |
51
51
  | `id` | id of the editing area, so `<label htmlFor>` names and focuses it | |
52
52
  | `minHeight` | pixels or a CSS length (`'20rem'`) | `10rem` |
53
+ | `attributes` | extra attributes for the editing area, e.g. `{ 'aria-invalid': 'true', 'aria-describedby': 'body-error' }`; applied live | |
53
54
  | `editable` | `boolean` | `true` |
54
55
  | `options` | any other `createEditor` option from the [`wysio` README](https://www.npmjs.com/package/wysio) (`upload`, `sticky`, `messages`, …) | `{}` |
55
56
  | `className` | class names for the wrapper (`.wysio-react`) | |
@@ -58,7 +59,7 @@ export function PostForm() {
58
59
  | `onBlur` | `(event, editor) => void` | |
59
60
  | `onError` | `(error, { source, file }) => void`, e.g. a failed upload | |
60
61
 
61
- `editable` applies immediately. Changing `toolbar`, `plugins`, `locale`, `format`, `placeholder`, `id`, `minHeight` or `options` recreates the editor and keeps its content (`onReady` is called again). Inline arrays and objects are fine: only real changes count. Define functions such as `upload` outside the component (or with `useCallback`), since a new function counts as a change. The callbacks (`onChange`, `onFocus`, …) can change freely.
62
+ `editable` and `attributes` apply immediately. Changing `toolbar`, `plugins`, `locale`, `format`, `placeholder`, `id`, `minHeight` or `options` recreates the editor and keeps its content (`onReady` is called again). Inline arrays and objects are fine: only real changes count. Define functions such as `upload` outside the component (or with `useCallback`), since a new function counts as a change. The callbacks (`onChange`, `onFocus`, …) can change freely.
62
63
 
63
64
  A controlled `value` only replaces the editor content when it is an outside change. The values the editor reported through `onChange` coming back (also an older one, while typing faster than React renders) never reset the cursor.
64
65
 
@@ -30,6 +30,11 @@ export interface WysioEditorProps {
30
30
  id?: string;
31
31
  /** Minimum height of the editing area: pixels, or a CSS length such as `'20rem'`. */
32
32
  minHeight?: number | string;
33
+ /**
34
+ * Extra attributes for the editing area, e.g. `{ 'aria-invalid': 'true',
35
+ * 'aria-describedby': 'body-error' }`. Applied without recreating the editor.
36
+ */
37
+ attributes?: Record<string, string>;
33
38
  /** Any other `createEditor` options. The props above take precedence. */
34
39
  options?: EditorOptions;
35
40
  /** Class names for the wrapper element (`wysio-react`). */
@@ -1 +1 @@
1
- {"version":3,"file":"WysioEditor.d.ts","sourceRoot":"","sources":["../src/WysioEditor.ts"],"names":[],"mappings":"AASA,OAAO,EAGL,KAAK,aAAa,EAClB,KAAK,MAAM,EACX,KAAK,eAAe,EACpB,KAAK,aAAa,EAClB,KAAK,WAAW,EAChB,KAAK,QAAQ,EACb,KAAK,WAAW,EACjB,MAAM,OAAO,CAAC;AAEf;;;;;GAKG;AACH,wBAAgB,UAAU,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,OAAO,GAAG,OAAO,CAe1D;AAED,6FAA6F;AAC7F,MAAM,MAAM,UAAU,GAAG,MAAM,GAAG,WAAW,CAAC;AAE9C,MAAM,WAAW,gBAAgB;IAC/B;;;OAGG;IACH,KAAK,CAAC,EAA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AM,EAAE,MAAM,KAAK,IAAI,CAAC;IACnC,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IACtD,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IACrD,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,eAAe,KAAK,IAAI,CAAC;CAC3D;AAoID;;;;;;;;GAQG;AACH,eAAO,MAAM,WAAW,4GAA+B,CAAC"}
@@ -11,12 +11,17 @@ function s(e, t) {
11
11
  }
12
12
  return !1;
13
13
  }
14
- var c = (e, t) => t === "json" ? e.isEmpty ? "" : e.getJSON() : e.serialize(t);
15
- function l(e, t) {
14
+ function c(e, t) {
15
+ let n = { ...t };
16
+ for (let r of Object.keys(e ?? {})) r in (t ?? {}) || (n[r] = null);
17
+ return n;
18
+ }
19
+ var l = (e, t) => t === "json" ? e.isEmpty ? "" : e.getJSON() : e.serialize(t);
20
+ function u(e, t) {
16
21
  return e == null || e === "" ? t == null || t === "" : typeof e == "object" || typeof t == "object" ? JSON.stringify(e) === JSON.stringify(t) : e === t;
17
22
  }
18
- var u = 100;
19
- function d(e) {
23
+ var d = 100;
24
+ function f(e) {
20
25
  let t = i({
21
26
  config: e,
22
27
  version: 0
@@ -26,58 +31,66 @@ function d(e) {
26
31
  version: t.current.version + 1
27
32
  }), t.current.version;
28
33
  }
29
- function f(t, s) {
30
- let { format: f = "html", editable: p = !0 } = t, m = i(null), [h, g] = a(null), _ = i(t);
31
- _.current = t;
32
- let v = i(null), y = i([]);
33
- r(s, () => h, [h]);
34
- let b = d([
34
+ function p(t, p) {
35
+ let { format: m = "html", editable: h = !0 } = t, g = i(null), [_, v] = a(null), y = i(t);
36
+ y.current = t;
37
+ let b = i(null), x = i([]), S = i(void 0);
38
+ r(p, () => _, [_]);
39
+ let C = f([
35
40
  t.toolbar,
36
41
  t.plugins,
37
42
  t.locale,
38
- f,
43
+ m,
39
44
  t.placeholder,
40
45
  t.id,
41
46
  t.minHeight,
42
47
  t.options
43
48
  ]);
44
49
  n(() => {
45
- let e = _.current, t = e.options ?? {}, n = e.value === void 0 ? v.current ?? e.defaultValue ?? t.content ?? "" : e.value ?? "", r = o(m.current, {
50
+ let e = y.current, t = e.options ?? {}, n = e.value === void 0 ? b.current ?? e.defaultValue ?? t.content ?? "" : e.value ?? "", r = o(g.current, {
46
51
  ...t,
47
52
  content: n,
48
- format: f,
53
+ format: m,
49
54
  toolbar: e.toolbar ?? t.toolbar,
50
55
  plugins: [...t.plugins ?? [], ...e.plugins ?? []],
51
56
  locale: e.locale ?? t.locale,
52
57
  placeholder: e.placeholder ?? t.placeholder,
53
58
  editable: e.editable ?? !0,
54
59
  id: e.id ?? t.id,
55
- minHeight: e.minHeight ?? t.minHeight
60
+ minHeight: e.minHeight ?? t.minHeight,
61
+ attributes: {
62
+ ...t.attributes,
63
+ ...e.attributes
64
+ }
56
65
  });
57
- return y.current = [], r.on("change", () => {
58
- let e = c(r, f);
59
- y.current.push(e), y.current.length > u && y.current.shift(), _.current.onChange?.(e, r);
60
- }), r.on("focus", (e, t) => _.current.onFocus?.(t, r)), r.on("blur", (e, t) => _.current.onBlur?.(t, r)), r.on("error", (e, t, n) => _.current.onError?.(t, n)), g(r), e.onReady?.(r), () => {
61
- v.current = r.getJSON(), r.destroy(), m.current?.replaceChildren(), g(null);
66
+ return S.current = e.attributes, x.current = [], r.on("change", () => {
67
+ let e = l(r, m);
68
+ x.current.push(e), x.current.length > d && x.current.shift(), y.current.onChange?.(e, r);
69
+ }), r.on("focus", (e, t) => y.current.onFocus?.(t, r)), r.on("blur", (e, t) => y.current.onBlur?.(t, r)), r.on("error", (e, t, n) => y.current.onError?.(t, n)), v(r), e.onReady?.(r), () => {
70
+ b.current = r.getJSON(), r.destroy(), g.current?.replaceChildren(), v(null);
62
71
  };
63
- }, [b]);
64
- let { value: x } = t;
72
+ }, [C]);
73
+ let { value: w } = t;
65
74
  n(() => {
66
- if (!h || x === void 0) return;
67
- let e = y.current.findIndex((e) => l(e, x));
68
- e >= 0 ? y.current.splice(0, e + 1) : (y.current = [], l(c(h, f), x) || h.setContent(x ?? ""));
75
+ if (!_ || w === void 0) return;
76
+ let e = x.current.findIndex((e) => u(e, w));
77
+ e >= 0 ? x.current.splice(0, e + 1) : (x.current = [], u(l(_, m), w) || _.setContent(w ?? ""));
69
78
  }, [
70
- h,
71
- x,
72
- f
79
+ _,
80
+ w,
81
+ m
73
82
  ]), n(() => {
74
- h?.setEditable(p);
75
- }, [h, p]);
76
- let S = t.className ? `wysio-react ${t.className}` : "wysio-react";
77
- return e("div", { className: S }, e("div", { ref: m }));
83
+ _?.setEditable(h);
84
+ }, [_, h]);
85
+ let { attributes: T } = t;
86
+ n(() => {
87
+ _ && !s(S.current, T) && (_.setAttributes(c(S.current, T)), S.current = T);
88
+ }, [_, T]);
89
+ let E = t.className ? `wysio-react ${t.className}` : "wysio-react";
90
+ return e("div", { className: E }, e("div", { ref: g }));
78
91
  }
79
- var p = t(f);
80
- p.displayName = "WysioEditor";
81
- export { p as WysioEditor, s as sameConfig };
92
+ var m = t(p);
93
+ m.displayName = "WysioEditor";
94
+ export { m as WysioEditor, s as sameConfig };
82
95
 
83
96
  //# sourceMappingURL=wysio-react.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"wysio-react.js","names":["createElement","forwardRef","useEffect","useImperativeHandle","useRef","useState","createEditor","sameConfig","a","b","item","i","plain","v","keys","key","valueOf","editor","format","sameValue","MAX_PENDING","useConfigVersion","config","ref","WysioEditorInner","props","editable","target","setEditor","latest","kept","pending","version","p","options","content","ed","next","_e","event","error","info","value","echo","className","WysioEditor"],"sources":["../src/WysioEditor.ts"],"sourcesContent":["import {\n createElement,\n forwardRef,\n useEffect,\n useImperativeHandle,\n useRef,\n useState,\n type ForwardedRef,\n} from 'react';\nimport {\n createEditor,\n type Content,\n type ContentFormat,\n type Editor,\n type EditorErrorInfo,\n type EditorOptions,\n type JSONContent,\n type Messages,\n type WysioPlugin,\n} from 'wysio';\n\n/**\n * Structural equality for editor configuration: arrays and plain objects by content,\n * everything else (functions, plugin objects, …) by identity. Components create new\n * arrays and objects on every render (`toolbar={['bold']}`), which must not count as\n * a change.\n */\nexport function sameConfig(a: unknown, b: unknown): boolean {\n if (a === b) return true;\n if (Array.isArray(a) && Array.isArray(b)) {\n return a.length === b.length && a.every((item, i) => sameConfig(item, b[i]));\n }\n const plain = (v: unknown): v is Record<string, unknown> =>\n !!v && typeof v === 'object' && Object.getPrototypeOf(v) === Object.prototype;\n if (plain(a) && plain(b)) {\n const keys = Object.keys(a);\n return (\n keys.length === Object.keys(b).length &&\n keys.every((key) => key in b && sameConfig(a[key], b[key]))\n );\n }\n return false;\n}\n\n/** The value: a string in `format`, or a ProseMirror JSON object when `format` is `json`. */\nexport type WysioValue = string | JSONContent;\n\nexport interface WysioEditorProps {\n /**\n * The content, controlled: update it from `onChange`. HTML by default; see `format`.\n * Leave it out (and use `defaultValue`) for an uncontrolled editor.\n */\n value?: WysioValue | null;\n /** Initial content of an uncontrolled editor. */\n defaultValue?: WysioValue | null;\n /** Called with the new value on every change made in the editor. */\n onChange?: (value: WysioValue, editor: Editor) => void;\n /** `html` (default), `markdown` (needs the markdown plugin) or `json` (an object). */\n format?: ContentFormat;\n toolbar?: readonly string[] | false;\n plugins?: readonly (WysioPlugin | string)[];\n locale?: string | Messages;\n placeholder?: string;\n /** Default `true`. Applied without recreating the editor. */\n editable?: boolean;\n /** Id of the editing area, so `<label htmlFor>` names and focuses the editor. */\n id?: string;\n /** Minimum height of the editing area: pixels, or a CSS length such as `'20rem'`. */\n minHeight?: number | string;\n /** Any other `createEditor` options. The props above take precedence. */\n options?: EditorOptions;\n /** Class names for the wrapper element (`wysio-react`). */\n className?: string;\n onReady?: (editor: Editor) => void;\n onFocus?: (event: FocusEvent, editor: Editor) => void;\n onBlur?: (event: FocusEvent, editor: Editor) => void;\n onError?: (error: unknown, info: EditorErrorInfo) => void;\n}\n\nconst valueOf = (editor: Editor, format: ContentFormat): WysioValue =>\n format === 'json' ? (editor.isEmpty ? '' : editor.getJSON()) : editor.serialize(format);\n\n/** Values compared as the editor reports them: null and '' are the same, JSON by content. */\nfunction sameValue(a: WysioValue | null, b: WysioValue | null): boolean {\n if (a == null || a === '') return b == null || b === '';\n if (typeof a === 'object' || typeof b === 'object')\n return JSON.stringify(a) === JSON.stringify(b);\n return a === b;\n}\n\n/** Reported values not yet seen back as `value`; more means the parent ignores onChange. */\nconst MAX_PENDING = 100;\n\n/** A number that only changes when the configuration really changes (see sameConfig). */\nfunction useConfigVersion(config: unknown[]): number {\n const ref = useRef({ config, version: 0 });\n if (!sameConfig(ref.current.config, config)) {\n ref.current = { config, version: ref.current.version + 1 };\n }\n return ref.current.version;\n}\n\nfunction WysioEditorInner(props: WysioEditorProps, ref: ForwardedRef<Editor | null>) {\n const { format = 'html', editable = true } = props;\n const target = useRef<HTMLDivElement>(null);\n const [editor, setEditor] = useState<Editor | null>(null);\n // Callbacks and the value as of the latest render, for listeners set up once.\n const latest = useRef(props);\n latest.current = props;\n // The content when an editor is torn down, for the next one (config change, StrictMode).\n const kept = useRef<JSONContent | null>(null);\n // Values reported through onChange that haven't come back as `value` yet. React runs\n // effects after paint, so while typing fast a render can carry an older reported value\n // than the editor now has: that is an echo, not an outside change.\n const pending = useRef<WysioValue[]>([]);\n\n useImperativeHandle<Editor | null, Editor | null>(ref, () => editor, [editor]);\n\n const version = useConfigVersion([\n props.toolbar,\n props.plugins,\n props.locale,\n format,\n props.placeholder,\n props.id,\n props.minHeight,\n props.options,\n ]);\n\n // These are fixed when an editor is created: recreate it, keeping the content, but\n // only for real changes.\n useEffect(() => {\n const p = latest.current;\n const options = p.options ?? {};\n const controlled = p.value !== undefined;\n const content: Content = controlled\n ? (p.value ?? '')\n : (kept.current ?? p.defaultValue ?? options.content ?? '');\n const ed = createEditor(target.current!, {\n ...options,\n content,\n format,\n toolbar: p.toolbar ?? options.toolbar,\n plugins: [...(options.plugins ?? []), ...(p.plugins ?? [])],\n locale: p.locale ?? options.locale,\n placeholder: p.placeholder ?? options.placeholder,\n editable: p.editable ?? true,\n id: p.id ?? options.id,\n minHeight: p.minHeight ?? options.minHeight,\n });\n pending.current = [];\n ed.on('change', () => {\n const next = valueOf(ed, format);\n pending.current.push(next);\n if (pending.current.length > MAX_PENDING) pending.current.shift();\n latest.current.onChange?.(next, ed);\n });\n ed.on('focus', (_e, event) => latest.current.onFocus?.(event, ed));\n ed.on('blur', (_e, event) => latest.current.onBlur?.(event, ed));\n ed.on('error', (_e, error, info) => latest.current.onError?.(error, info));\n setEditor(ed);\n p.onReady?.(ed);\n\n return () => {\n kept.current = ed.getJSON();\n ed.destroy();\n // destroy() leaves the final HTML in the element; the next editor brings its own.\n target.current?.replaceChildren();\n setEditor(null);\n };\n // Only `version`: everything else is read from `latest` when the editor is created.\n }, [version]);\n\n // Outside changes only: values the editor reported come back here too (possibly an\n // older one than the editor has by now), and setContent for those would reset the\n // cursor and drop what was typed since.\n const { value } = props;\n useEffect(() => {\n if (!editor || value === undefined) return;\n const echo = pending.current.findIndex((v) => sameValue(v, value));\n if (echo >= 0) {\n pending.current.splice(0, echo + 1);\n return;\n }\n pending.current = [];\n if (!sameValue(valueOf(editor, format), value)) editor.setContent(value ?? '');\n }, [editor, value, format]);\n\n useEffect(() => {\n editor?.setEditable(editable);\n }, [editor, editable]);\n\n const className = props.className ? `wysio-react ${props.className}` : 'wysio-react';\n // The editor owns the inner element (it adds the `wysio` class and its own children),\n // so React never re-renders its attributes.\n return createElement('div', { className }, createElement('div', { ref: target }));\n}\n\n/**\n * React component around `createEditor`:\n *\n * ```tsx\n * <WysioEditor value={body} onChange={setBody} locale=\"nl\" ref={editorRef} />\n * ```\n *\n * The ref gives the editor instance (null until it is created).\n */\nexport const WysioEditor = forwardRef(WysioEditorInner);\nWysioEditor.displayName = 'WysioEditor';\n"],"mappings":";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AAG,GAAG,SAASE,GAAIC,MAAUV,EAAO,QAAQ,SAASU,GAAOH,CAAE,CAAC,GAC/DA,EAAG,GAAG,UAAUE,GAAIE,GAAOC,MAASZ,EAAO,QAAQ,UAAUW,GAAOC,CAAI,CAAC,GACzEb,EAAUQ,CAAE,GACZH,EAAE,UAAUG,CAAE,SAED;GACXN,EAAK,UAAUM,EAAG,QAAQ,GAC1BA,EAAG,QAAQ,GAEXT,EAAO,SAAS,gBAAgB,GAChCC,EAAU,IAAI;EAChB;CAEF,GAAG,CAACI,CAAO,CAAC;CAKZ,IAAM,EAAEU,aAAUjB;CAClBvB,QAAgB;EACd,IAAI,CAACe,KAAUyB,MAAU,KAAA,GAAW;EACpC,IAAMC,IAAOZ,EAAQ,QAAQ,WAAWlB,MAAMM,EAAUN,GAAG6B,CAAK,CAAC;EAC7DC,KAAQ,IACVZ,EAAQ,QAAQ,OAAO,GAAGY,IAAO,CAAC,KAGpCZ,EAAQ,UAAU,CAAC,GACdZ,EAAUH,EAAQC,GAAQC,CAAM,GAAGwB,CAAK,KAAGzB,EAAO,WAAWyB,KAAS,EAAE;CAC/E,GAAG;EAACzB;EAAQyB;EAAOxB;CAAM,CAAC,GAE1BhB,QAAgB;EACde,GAAQ,YAAYS,CAAQ;CAC9B,GAAG,CAACT,GAAQS,CAAQ,CAAC;CAErB,IAAMkB,IAAYnB,EAAM,YAAY,eAAeA,EAAM,cAAc;CAGvE,OAAOzB,EAAc,OAAO,EAAE4C,aAAU,GAAG5C,EAAc,OAAO,EAAE,KAAK2B,EAAO,CAAC,CAAC;AAClF;AAWA,IAAakB,IAAc5C,EAAWuB,CAAgB;AACtDqB,EAAY,cAAc"}
1
+ {"version":3,"file":"wysio-react.js","names":["createElement","forwardRef","useEffect","useImperativeHandle","useRef","useState","createEditor","sameConfig","a","b","item","i","plain","v","keys","key","attributeChanges","previous","next","changes","name","valueOf","editor","format","sameValue","MAX_PENDING","useConfigVersion","config","ref","WysioEditorInner","props","editable","target","setEditor","latest","kept","pending","appliedAttributes","version","p","options","content","ed","_e","event","error","info","value","echo","attributes","className","WysioEditor"],"sources":["../src/WysioEditor.ts"],"sourcesContent":["import {\n createElement,\n forwardRef,\n useEffect,\n useImperativeHandle,\n useRef,\n useState,\n type ForwardedRef,\n} from 'react';\nimport {\n createEditor,\n type Content,\n type ContentFormat,\n type Editor,\n type EditorErrorInfo,\n type EditorOptions,\n type JSONContent,\n type Messages,\n type WysioPlugin,\n} from 'wysio';\n\n/**\n * Structural equality for editor configuration: arrays and plain objects by content,\n * everything else (functions, plugin objects, …) by identity. Components create new\n * arrays and objects on every render (`toolbar={['bold']}`), which must not count as\n * a change.\n */\nexport function sameConfig(a: unknown, b: unknown): boolean {\n if (a === b) return true;\n if (Array.isArray(a) && Array.isArray(b)) {\n return a.length === b.length && a.every((item, i) => sameConfig(item, b[i]));\n }\n const plain = (v: unknown): v is Record<string, unknown> =>\n !!v && typeof v === 'object' && Object.getPrototypeOf(v) === Object.prototype;\n if (plain(a) && plain(b)) {\n const keys = Object.keys(a);\n return (\n keys.length === Object.keys(b).length &&\n keys.every((key) => key in b && sameConfig(a[key], b[key]))\n );\n }\n return false;\n}\n\n/** What setAttributes() needs to go from one attributes object to the next. */\nfunction attributeChanges(\n previous: Record<string, string> | undefined,\n next: Record<string, string> | undefined,\n): Record<string, string | null> {\n const changes: Record<string, string | null> = { ...next };\n for (const name of Object.keys(previous ?? {})) if (!(name in (next ?? {}))) changes[name] = null;\n return changes;\n}\n\n/** The value: a string in `format`, or a ProseMirror JSON object when `format` is `json`. */\nexport type WysioValue = string | JSONContent;\n\nexport interface WysioEditorProps {\n /**\n * The content, controlled: update it from `onChange`. HTML by default; see `format`.\n * Leave it out (and use `defaultValue`) for an uncontrolled editor.\n */\n value?: WysioValue | null;\n /** Initial content of an uncontrolled editor. */\n defaultValue?: WysioValue | null;\n /** Called with the new value on every change made in the editor. */\n onChange?: (value: WysioValue, editor: Editor) => void;\n /** `html` (default), `markdown` (needs the markdown plugin) or `json` (an object). */\n format?: ContentFormat;\n toolbar?: readonly string[] | false;\n plugins?: readonly (WysioPlugin | string)[];\n locale?: string | Messages;\n placeholder?: string;\n /** Default `true`. Applied without recreating the editor. */\n editable?: boolean;\n /** Id of the editing area, so `<label htmlFor>` names and focuses the editor. */\n id?: string;\n /** Minimum height of the editing area: pixels, or a CSS length such as `'20rem'`. */\n minHeight?: number | string;\n /**\n * Extra attributes for the editing area, e.g. `{ 'aria-invalid': 'true',\n * 'aria-describedby': 'body-error' }`. Applied without recreating the editor.\n */\n attributes?: Record<string, string>;\n /** Any other `createEditor` options. The props above take precedence. */\n options?: EditorOptions;\n /** Class names for the wrapper element (`wysio-react`). */\n className?: string;\n onReady?: (editor: Editor) => void;\n onFocus?: (event: FocusEvent, editor: Editor) => void;\n onBlur?: (event: FocusEvent, editor: Editor) => void;\n onError?: (error: unknown, info: EditorErrorInfo) => void;\n}\n\nconst valueOf = (editor: Editor, format: ContentFormat): WysioValue =>\n format === 'json' ? (editor.isEmpty ? '' : editor.getJSON()) : editor.serialize(format);\n\n/** Values compared as the editor reports them: null and '' are the same, JSON by content. */\nfunction sameValue(a: WysioValue | null, b: WysioValue | null): boolean {\n if (a == null || a === '') return b == null || b === '';\n if (typeof a === 'object' || typeof b === 'object')\n return JSON.stringify(a) === JSON.stringify(b);\n return a === b;\n}\n\n/** Reported values not yet seen back as `value`; more means the parent ignores onChange. */\nconst MAX_PENDING = 100;\n\n/** A number that only changes when the configuration really changes (see sameConfig). */\nfunction useConfigVersion(config: unknown[]): number {\n const ref = useRef({ config, version: 0 });\n if (!sameConfig(ref.current.config, config)) {\n ref.current = { config, version: ref.current.version + 1 };\n }\n return ref.current.version;\n}\n\nfunction WysioEditorInner(props: WysioEditorProps, ref: ForwardedRef<Editor | null>) {\n const { format = 'html', editable = true } = props;\n const target = useRef<HTMLDivElement>(null);\n const [editor, setEditor] = useState<Editor | null>(null);\n // Callbacks and the value as of the latest render, for listeners set up once.\n const latest = useRef(props);\n latest.current = props;\n // The content when an editor is torn down, for the next one (config change, StrictMode).\n const kept = useRef<JSONContent | null>(null);\n // Values reported through onChange that haven't come back as `value` yet. React runs\n // effects after paint, so while typing fast a render can carry an older reported value\n // than the editor now has: that is an echo, not an outside change.\n const pending = useRef<WysioValue[]>([]);\n // The `attributes` prop as last applied to the editor.\n const appliedAttributes = useRef<Record<string, string> | undefined>(undefined);\n\n useImperativeHandle<Editor | null, Editor | null>(ref, () => editor, [editor]);\n\n const version = useConfigVersion([\n props.toolbar,\n props.plugins,\n props.locale,\n format,\n props.placeholder,\n props.id,\n props.minHeight,\n props.options,\n ]);\n\n // These are fixed when an editor is created: recreate it, keeping the content, but\n // only for real changes.\n useEffect(() => {\n const p = latest.current;\n const options = p.options ?? {};\n const controlled = p.value !== undefined;\n const content: Content = controlled\n ? (p.value ?? '')\n : (kept.current ?? p.defaultValue ?? options.content ?? '');\n const ed = createEditor(target.current!, {\n ...options,\n content,\n format,\n toolbar: p.toolbar ?? options.toolbar,\n plugins: [...(options.plugins ?? []), ...(p.plugins ?? [])],\n locale: p.locale ?? options.locale,\n placeholder: p.placeholder ?? options.placeholder,\n editable: p.editable ?? true,\n id: p.id ?? options.id,\n minHeight: p.minHeight ?? options.minHeight,\n attributes: { ...options.attributes, ...p.attributes },\n });\n appliedAttributes.current = p.attributes;\n pending.current = [];\n ed.on('change', () => {\n const next = valueOf(ed, format);\n pending.current.push(next);\n if (pending.current.length > MAX_PENDING) pending.current.shift();\n latest.current.onChange?.(next, ed);\n });\n ed.on('focus', (_e, event) => latest.current.onFocus?.(event, ed));\n ed.on('blur', (_e, event) => latest.current.onBlur?.(event, ed));\n ed.on('error', (_e, error, info) => latest.current.onError?.(error, info));\n setEditor(ed);\n p.onReady?.(ed);\n\n return () => {\n kept.current = ed.getJSON();\n ed.destroy();\n // destroy() leaves the final HTML in the element; the next editor brings its own.\n target.current?.replaceChildren();\n setEditor(null);\n };\n // Only `version`: everything else is read from `latest` when the editor is created.\n }, [version]);\n\n // Outside changes only: values the editor reported come back here too (possibly an\n // older one than the editor has by now), and setContent for those would reset the\n // cursor and drop what was typed since.\n const { value } = props;\n useEffect(() => {\n if (!editor || value === undefined) return;\n const echo = pending.current.findIndex((v) => sameValue(v, value));\n if (echo >= 0) {\n pending.current.splice(0, echo + 1);\n return;\n }\n pending.current = [];\n if (!sameValue(valueOf(editor, format), value)) editor.setContent(value ?? '');\n }, [editor, value, format]);\n\n useEffect(() => {\n editor?.setEditable(editable);\n }, [editor, editable]);\n\n const { attributes } = props;\n useEffect(() => {\n if (!editor || sameConfig(appliedAttributes.current, attributes)) return;\n editor.setAttributes(attributeChanges(appliedAttributes.current, attributes));\n appliedAttributes.current = attributes;\n }, [editor, attributes]);\n\n const className = props.className ? `wysio-react ${props.className}` : 'wysio-react';\n // The editor owns the inner element (it adds the `wysio` class and its own children),\n // so React never re-renders its attributes.\n return createElement('div', { className }, createElement('div', { ref: target }));\n}\n\n/**\n * React component around `createEditor`:\n *\n * ```tsx\n * <WysioEditor value={body} onChange={setBody} locale=\"nl\" ref={editorRef} />\n * ```\n *\n * The ref gives the editor instance (null until it is created).\n */\nexport const WysioEditor = forwardRef(WysioEditorInner);\nWysioEditor.displayName = 'WysioEditor';\n"],"mappings":";;;AA2BA,SAAgBO,EAAWC,GAAYC,GAAqB;CAC1D,IAAID,MAAMC,GAAG,OAAO;CACpB,IAAI,MAAM,QAAQD,CAAC,KAAK,MAAM,QAAQC,CAAC,GACrC,OAAOD,EAAE,WAAWC,EAAE,UAAUD,EAAE,OAAOE,GAAMC,MAAMJ,EAAWG,GAAMD,EAAEE,EAAE,CAAC;CAE7E,IAAMC,KAASC,MACb,CAAC,CAACA,KAAK,OAAOA,KAAM,YAAY,OAAO,eAAeA,CAAC,MAAM,OAAO;CACtE,IAAID,EAAMJ,CAAC,KAAKI,EAAMH,CAAC,GAAG;EACxB,IAAMK,IAAO,OAAO,KAAKN,CAAC;EAC1B,OACEM,EAAK,WAAW,OAAO,KAAKL,CAAC,CAAC,CAAC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React component for Wysio Editor, the ProseMirror-based WYSIWYG editor.",
5
5
  "license": "MIT",
6
6
  "author": "EveraertCooreman",
@@ -48,7 +48,7 @@
48
48
  "react-dom": "^18.0.0 || ^19.0.0"
49
49
  },
50
50
  "dependencies": {
51
- "wysio": "^0.2.0-alpha.6"
51
+ "wysio": "^0.2.0-alpha.7"
52
52
  },
53
53
  "devDependencies": {
54
54
  "@testing-library/react": "^16.3.3",