@particle-academy/react-fancy 5.71.3 → 6.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.
Files changed (61) hide show
  1. package/CHANGELOG.md +116 -0
  2. package/dist/button.cjs +3 -3
  3. package/dist/button.js +1 -1
  4. package/dist/chat-thread.cjs +5 -5
  5. package/dist/chat-thread.js +3 -3
  6. package/dist/{chunk-R2MFCR7H.js → chunk-3RIBZZLT.js} +3 -3
  7. package/dist/{chunk-R2MFCR7H.js.map → chunk-3RIBZZLT.js.map} +1 -1
  8. package/dist/{chunk-MPUR2ZLF.cjs → chunk-BGRVHPGP.cjs} +7 -6
  9. package/dist/chunk-BGRVHPGP.cjs.map +1 -0
  10. package/dist/{chunk-2KQVBD7K.cjs → chunk-BX6ZVWTO.cjs} +29 -4
  11. package/dist/chunk-BX6ZVWTO.cjs.map +1 -0
  12. package/dist/{chunk-HTPMFADD.js → chunk-CWWMT57K.js} +4 -4
  13. package/dist/{chunk-HTPMFADD.js.map → chunk-CWWMT57K.js.map} +1 -1
  14. package/dist/{chunk-FJJ3GMXI.js → chunk-GBR4Q6CP.js} +3 -3
  15. package/dist/{chunk-FJJ3GMXI.js.map → chunk-GBR4Q6CP.js.map} +1 -1
  16. package/dist/{chunk-7PUTP2N7.cjs → chunk-IA6JKI4P.cjs} +10 -10
  17. package/dist/chunk-IA6JKI4P.cjs.map +1 -0
  18. package/dist/{chunk-JGEFIWDA.cjs → chunk-JKH5ODNG.cjs} +9 -9
  19. package/dist/{chunk-JGEFIWDA.cjs.map → chunk-JKH5ODNG.cjs.map} +1 -1
  20. package/dist/{chunk-FUMX6TYZ.js → chunk-KOECVLC4.js} +3 -3
  21. package/dist/{chunk-FUMX6TYZ.js.map → chunk-KOECVLC4.js.map} +1 -1
  22. package/dist/{chunk-7T7L5IK5.js → chunk-LWOA2ET6.js} +4 -3
  23. package/dist/chunk-LWOA2ET6.js.map +1 -0
  24. package/dist/{chunk-AWIUXZTG.cjs → chunk-ND5SBHGH.cjs} +4 -4
  25. package/dist/{chunk-AWIUXZTG.cjs.map → chunk-ND5SBHGH.cjs.map} +1 -1
  26. package/dist/{chunk-WFEX7DAR.js → chunk-PACFMPSX.js} +5 -5
  27. package/dist/chunk-PACFMPSX.js.map +1 -0
  28. package/dist/{chunk-7OKF6M32.cjs → chunk-VNOUXFZ2.cjs} +15 -15
  29. package/dist/{chunk-7OKF6M32.cjs.map → chunk-VNOUXFZ2.cjs.map} +1 -1
  30. package/dist/{chunk-CINWSRA2.js → chunk-VZ7IDHUY.js} +3 -3
  31. package/dist/{chunk-CINWSRA2.js.map → chunk-VZ7IDHUY.js.map} +1 -1
  32. package/dist/{chunk-VV5435PS.js → chunk-WLDDGIGC.js} +29 -5
  33. package/dist/chunk-WLDDGIGC.js.map +1 -0
  34. package/dist/{chunk-BL6HCIP4.cjs → chunk-X354OVSC.cjs} +12 -12
  35. package/dist/{chunk-BL6HCIP4.cjs.map → chunk-X354OVSC.cjs.map} +1 -1
  36. package/dist/{chunk-EEKIVROJ.cjs → chunk-ZXGX5RI5.cjs} +4 -4
  37. package/dist/{chunk-EEKIVROJ.cjs.map → chunk-ZXGX5RI5.cjs.map} +1 -1
  38. package/dist/content-renderer.cjs +5 -5
  39. package/dist/content-renderer.js +2 -2
  40. package/dist/editor.cjs +5 -5
  41. package/dist/editor.js +3 -3
  42. package/dist/index.cjs +40 -40
  43. package/dist/index.d.cts +5 -3
  44. package/dist/index.d.ts +5 -3
  45. package/dist/index.js +8 -8
  46. package/dist/json-editor.cjs +13 -13
  47. package/dist/json-editor.js +2 -2
  48. package/dist/magic-wand.cjs +3 -3
  49. package/dist/magic-wand.js +2 -2
  50. package/dist/prompt-input.cjs +5 -5
  51. package/dist/prompt-input.js +2 -2
  52. package/dist/reason-tag.cjs +3 -3
  53. package/dist/reason-tag.js +2 -2
  54. package/docs/Button.md +13 -0
  55. package/package.json +1 -1
  56. package/dist/chunk-2KQVBD7K.cjs.map +0 -1
  57. package/dist/chunk-7PUTP2N7.cjs.map +0 -1
  58. package/dist/chunk-7T7L5IK5.js.map +0 -1
  59. package/dist/chunk-MPUR2ZLF.cjs.map +0 -1
  60. package/dist/chunk-VV5435PS.js.map +0 -1
  61. package/dist/chunk-WFEX7DAR.js.map +0 -1
package/CHANGELOG.md CHANGED
@@ -11,6 +11,122 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
11
11
 
12
12
  ## [Unreleased]
13
13
 
14
+ ## [6.0.0] - 2026-11-01
15
+
16
+ ### Changed
17
+
18
+ - **BREAKING: `Button` defaults to `type="button"`.** A `<Button>` with no
19
+ `type` used to render a bare `<button>`, and the HTML default for a bare
20
+ `<button>` is `submit`. Every Button inside a `<form>` therefore submitted it
21
+ on click, including a Cancel, a toolbar toggle, and the kit's own internal
22
+ buttons (listed below). An explicit `type` still wins: `type="submit"`,
23
+ `type="reset"` and `type="button"` render exactly as written.
24
+ (`type={undefined}`, which a wrapper forwarding an optional prop passes, gets
25
+ the default too.)
26
+
27
+ **What a consumer must DO:** add `type="submit"` to every `<Button>` (or the
28
+ deprecated `<Action>`) that is meant to submit a form. To find candidates,
29
+ list the Buttons in every file that renders a form:
30
+
31
+ ```bash
32
+ grep -rlE '<(form|Form)\b' --include='*.tsx' --include='*.jsx' src resources/js \
33
+ | xargs grep -nE '<(Button|Action)\b'
34
+ ```
35
+
36
+ Any hit without a `type` that is the form's Save / Submit / Send / Sign in is
37
+ one to change. Also check Buttons that submit a form from OUTSIDE it with the
38
+ `form="<id>"` attribute (`grep -rnE '\bform="' --include='*.tsx' --include='*.jsx' .`):
39
+ those need `type="submit"` as well. One more effect of the same cause: per the
40
+ HTML spec, pressing Enter in a field submits through the form's first submit
41
+ button, so a form with several fields whose only submit was an untyped Button
42
+ also stops submitting on Enter. Adding `type="submit"` restores both.
43
+
44
+ **What needs no action:**
45
+ - Buttons outside any `<form>` (the large majority). `button` and `submit`
46
+ behave identically there.
47
+ - Buttons that already pass a `type`.
48
+ - Anchor-mode Buttons (`href`, not disabled): they render an `<a>`, which has
49
+ no submit behaviour, and still get no `type` attribute. A disabled Button
50
+ with an `href` falls back to a `<button>` and gets the default like any
51
+ other.
52
+ - Forms submitted from code (`form.requestSubmit()`, a fetch in `onClick`).
53
+
54
+ **Internal components whose effective button type changed** (`submit` to
55
+ `button`; none of them was meant to submit a host's form, and each one now
56
+ stops doing so):
57
+ - **`PromptInput`**: the attach button, the send button (both
58
+ `sendButton="label"` and `"icon"`), and the attachment chip's remove button
59
+ (a native `<button>` with no type; fixed directly). Sending still calls
60
+ `onSubmit` exactly as before. **If you wrapped `PromptInput` in your own
61
+ `<form>` and relied on clicking send to ALSO submit that form natively**
62
+ (for its `name` / `pasteFilesName` fields), call `form.requestSubmit()` from
63
+ your `onSubmit`. ⌘/Ctrl+Enter never submitted the enclosing form, so until
64
+ now the click did and the keyboard did not.
65
+ - **`JsonEditor`**: the pending-strip accept / reject, the add (`+`) button,
66
+ and every row button: expand toggle, add, move up / move down, remove,
67
+ pending accept / reject, and the add form's Add / Cancel.
68
+ - **`MagicWand`**: every action in the floating / pill toolbar.
69
+ - **`ReasonTag`**: the "ask follow-up" button in its popover.
70
+
71
+ Already explicit, so unchanged: `ChatThread` (load earlier, jump to latest),
72
+ `ChatMessage` proposal accept / reject, and the `ContentRenderer` copy button.
73
+ Components that render their own native `<button>` (Dropdown triggers, Modal
74
+ close, Tabs, Accordion, Pagination, Calendar navigation, ColorPicker,
75
+ Sidebar, FullScreen toggle and the rest) do not go through `Button` and
76
+ already set `type="button"`; nothing about them changed. The one exception
77
+ was the `PromptInput` attachment chip above.
78
+
79
+ Raised with the Change Council as a MAJOR change: **CC-fancy-0003**, approved
80
+ by the owner on 2026-11-01 ("consumers need to adopt and adapt").
81
+ **A `^5` range will not receive this release**, by design: npm will not cross
82
+ a major on its own. Upgrading is a deliberate `npm install
83
+ @particle-academy/react-fancy@^6`. Sibling packages that declare a peer range
84
+ capped at `<6` must widen it before a consumer can install them alongside 6.
85
+
86
+ - `docs/Button.md` documents the `type` prop and its default, with a form
87
+ example.
88
+ - The `PromptInput` markup snapshots (`tests/__snapshots__/prompt-input-draft.test.tsx.snap`)
89
+ gained `type="button"` on the attach and send buttons, and nothing else.
90
+
91
+ ## [5.72.0] - 2026-11-01
92
+
93
+ ### Added
94
+
95
+ - **`blob:` hrefs are accepted** (reported by Genie). A `URL.createObjectURL`
96
+ URL for an in-memory file was refused by `sanitizeHref` without a word, so
97
+ `<Button href="blob:...">` rendered a plain `<button>` and the link was
98
+ dead. `blob:` is accepted in the form a browser mints it,
99
+ `blob:<origin>/<id>` with an `http(s)://`, `null` or `file://` origin;
100
+ `blob:javascript:...`, `blob:data:...` and other wrappers stay refused. The
101
+ allow-list is shared, so this reaches every caller of it:
102
+ - `Button` (`href`, anchor mode)
103
+ - `ChatThread` / `ChatMessage` attachment links (`attachment.url`)
104
+ - `ContentRenderer` extension-tag attributes (`href`, `src`, `action`,
105
+ `formaction`, `xlink:href`)
106
+ - `sanitizeHtml` in its default (blocklist) mode, and so `ContentRenderer`,
107
+ `Editor` and `renderMarkdown` without `sanitize` options. Allowlist mode
108
+ (`sanitizeHtml(html, options)`) is unchanged: it keeps only the schemes
109
+ you list.
110
+ - the exported `sanitizeHref` itself
111
+ - **A development warning when a component drops an href.** `Button` and
112
+ `ChatMessage` now `console.warn` once per distinct href when a non-empty
113
+ href is refused, naming the component and the scheme and showing only a
114
+ short prefix of the URL. Nothing is logged in production
115
+ (`NODE_ENV === "production"`), for an empty or missing href, or when
116
+ sanitising content (markdown, HTML, extension tags), where refusing hostile
117
+ markup is the job rather than a mistake.
118
+
119
+ ### Security
120
+
121
+ - **`data:` remains refused, by decision**, for every media type and with or
122
+ without `download`: a navigable `data:text/html` is the risky case. Now
123
+ pinned by tests, together with `javascript:`, `vbscript:`, `file:` and the
124
+ obfuscated spellings (leading control characters, mixed case, whitespace
125
+ inside the scheme, entity and percent-encoded colons).
126
+
127
+ **Consumer action: none.** An href that was silently dropped now works if it
128
+ is `blob:`, and otherwise warns in development.
129
+
14
130
  ## [5.71.3] - 2026-11-01
15
131
 
16
132
  ### Fixed
package/dist/button.cjs CHANGED
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
3
  require('./chunk-M5MUGSON.cjs');
4
- var chunk2KQVBD7K_cjs = require('./chunk-2KQVBD7K.cjs');
4
+ var chunkBX6ZVWTO_cjs = require('./chunk-BX6ZVWTO.cjs');
5
5
  require('./chunk-XCZZVRBY.cjs');
6
6
  require('./chunk-MXWR3T3N.cjs');
7
7
  require('./chunk-ZU5Q77OT.cjs');
@@ -10,11 +10,11 @@ require('./chunk-ZU5Q77OT.cjs');
10
10
 
11
11
  Object.defineProperty(exports, "Action", {
12
12
  enumerable: true,
13
- get: function () { return chunk2KQVBD7K_cjs.Action; }
13
+ get: function () { return chunkBX6ZVWTO_cjs.Action; }
14
14
  });
15
15
  Object.defineProperty(exports, "Button", {
16
16
  enumerable: true,
17
- get: function () { return chunk2KQVBD7K_cjs.Button; }
17
+ get: function () { return chunkBX6ZVWTO_cjs.Button; }
18
18
  });
19
19
  //# sourceMappingURL=button.cjs.map
20
20
  //# sourceMappingURL=button.cjs.map
package/dist/button.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import './chunk-LQ4ICCN2.js';
2
- export { Action, Button } from './chunk-VV5435PS.js';
2
+ export { Action, Button } from './chunk-WLDDGIGC.js';
3
3
  import './chunk-45BBNJQD.js';
4
4
  import './chunk-J3A4Z2P7.js';
5
5
  import './chunk-MMW2JGKZ.js';
@@ -1,14 +1,14 @@
1
1
  'use strict';
2
2
 
3
- var chunk7PUTP2N7_cjs = require('./chunk-7PUTP2N7.cjs');
3
+ var chunkIA6JKI4P_cjs = require('./chunk-IA6JKI4P.cjs');
4
4
  require('./chunk-S3TRSECD.cjs');
5
- require('./chunk-JGEFIWDA.cjs');
5
+ require('./chunk-JKH5ODNG.cjs');
6
6
  require('./chunk-2C64OVOZ.cjs');
7
7
  require('./chunk-BJL3VDRK.cjs');
8
8
  require('./chunk-VBWRH4UW.cjs');
9
9
  require('./chunk-MOU6O324.cjs');
10
10
  require('./chunk-M5MUGSON.cjs');
11
- require('./chunk-2KQVBD7K.cjs');
11
+ require('./chunk-BX6ZVWTO.cjs');
12
12
  require('./chunk-XCZZVRBY.cjs');
13
13
  require('./chunk-MXWR3T3N.cjs');
14
14
  require('./chunk-ZU5Q77OT.cjs');
@@ -17,11 +17,11 @@ require('./chunk-ZU5Q77OT.cjs');
17
17
 
18
18
  Object.defineProperty(exports, "ChatMessage", {
19
19
  enumerable: true,
20
- get: function () { return chunk7PUTP2N7_cjs.ChatMessage; }
20
+ get: function () { return chunkIA6JKI4P_cjs.ChatMessage; }
21
21
  });
22
22
  Object.defineProperty(exports, "ChatThread", {
23
23
  enumerable: true,
24
- get: function () { return chunk7PUTP2N7_cjs.ChatThread; }
24
+ get: function () { return chunkIA6JKI4P_cjs.ChatThread; }
25
25
  });
26
26
  //# sourceMappingURL=chat-thread.cjs.map
27
27
  //# sourceMappingURL=chat-thread.cjs.map
@@ -1,12 +1,12 @@
1
- export { ChatMessage, ChatThread } from './chunk-WFEX7DAR.js';
1
+ export { ChatMessage, ChatThread } from './chunk-PACFMPSX.js';
2
2
  import './chunk-AUTW5O4W.js';
3
- import './chunk-FJJ3GMXI.js';
3
+ import './chunk-GBR4Q6CP.js';
4
4
  import './chunk-I3LAFKJU.js';
5
5
  import './chunk-UZCR7DK5.js';
6
6
  import './chunk-IQ4KQJAO.js';
7
7
  import './chunk-6FCQD2KQ.js';
8
8
  import './chunk-LQ4ICCN2.js';
9
- import './chunk-VV5435PS.js';
9
+ import './chunk-WLDDGIGC.js';
10
10
  import './chunk-45BBNJQD.js';
11
11
  import './chunk-J3A4Z2P7.js';
12
12
  import './chunk-MMW2JGKZ.js';
@@ -10,7 +10,7 @@ import { ColorPicker } from './chunk-SVSQXKFL.js';
10
10
  import { useInlineEdit } from './chunk-OL53XYHF.js';
11
11
  import { isImeComposing } from './chunk-S42OGG43.js';
12
12
  import { Badge } from './chunk-6FCQD2KQ.js';
13
- import { Button } from './chunk-VV5435PS.js';
13
+ import { Button } from './chunk-WLDDGIGC.js';
14
14
  import { Callout } from './chunk-ZXZJYVWP.js';
15
15
  import { cn } from './chunk-MMW2JGKZ.js';
16
16
  import { createContext, forwardRef, useId, useRef, useMemo, useState, useEffect, useCallback, useContext } from 'react';
@@ -1338,5 +1338,5 @@ function buildItems({
1338
1338
  }
1339
1339
 
1340
1340
  export { JSON_FIELD_TYPES, JsonEditor, applyJsonEdit, describeEdit, findJsonConflicts, getAtPath, inferType, parseKeyMap, parsePath, pathToString, resolveKeyRule, typeMatches };
1341
- //# sourceMappingURL=chunk-R2MFCR7H.js.map
1342
- //# sourceMappingURL=chunk-R2MFCR7H.js.map
1341
+ //# sourceMappingURL=chunk-3RIBZZLT.js.map
1342
+ //# sourceMappingURL=chunk-3RIBZZLT.js.map