@particle-academy/react-fancy 5.53.1 → 5.54.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 (113) hide show
  1. package/CHANGELOG.md +100 -0
  2. package/dist/PdfViewer.types-BEk2Jq6p.d.ts +97 -0
  3. package/dist/PdfViewer.types-DyoUBa2g.d.cts +97 -0
  4. package/dist/button.cjs +4 -4
  5. package/dist/button.js +2 -2
  6. package/dist/chat-drawer.cjs +3 -3
  7. package/dist/chat-drawer.js +2 -2
  8. package/dist/chunk-2O5UXH5R.cjs +191 -0
  9. package/dist/chunk-2O5UXH5R.cjs.map +1 -0
  10. package/dist/{chunk-26JZ47BJ.js → chunk-45JO5BEZ.js} +17 -11
  11. package/dist/chunk-45JO5BEZ.js.map +1 -0
  12. package/dist/{chunk-TFKG5FSG.cjs → chunk-4I4Y5MZO.cjs} +4 -4
  13. package/dist/{chunk-TFKG5FSG.cjs.map → chunk-4I4Y5MZO.cjs.map} +1 -1
  14. package/dist/{chunk-2KFHSFFY.cjs → chunk-6GKR5OAW.cjs} +4 -4
  15. package/dist/{chunk-2KFHSFFY.cjs.map → chunk-6GKR5OAW.cjs.map} +1 -1
  16. package/dist/chunk-7MDHCYEB.cjs +414 -0
  17. package/dist/chunk-7MDHCYEB.cjs.map +1 -0
  18. package/dist/{chunk-X7H75WVP.cjs → chunk-BJKKW77L.cjs} +17 -8
  19. package/dist/chunk-BJKKW77L.cjs.map +1 -0
  20. package/dist/chunk-DXZCKDYS.js +189 -0
  21. package/dist/chunk-DXZCKDYS.js.map +1 -0
  22. package/dist/{chunk-EJ6P7K4G.js → chunk-EULOJOTU.js} +3 -3
  23. package/dist/{chunk-EJ6P7K4G.js.map → chunk-EULOJOTU.js.map} +1 -1
  24. package/dist/chunk-I27K6NLX.cjs +15 -0
  25. package/dist/chunk-I27K6NLX.cjs.map +1 -0
  26. package/dist/{chunk-N7ABDCQ6.cjs → chunk-I2TBENUQ.cjs} +11 -11
  27. package/dist/{chunk-N7ABDCQ6.cjs.map → chunk-I2TBENUQ.cjs.map} +1 -1
  28. package/dist/{chunk-IVRYSSM7.js → chunk-J3A4Z2P7.js} +2 -2
  29. package/dist/chunk-J3A4Z2P7.js.map +1 -0
  30. package/dist/{chunk-EEFWVFKO.js → chunk-KUJ5XRBD.js} +7 -4
  31. package/dist/chunk-KUJ5XRBD.js.map +1 -0
  32. package/dist/chunk-MORXQ5UM.js +412 -0
  33. package/dist/chunk-MORXQ5UM.js.map +1 -0
  34. package/dist/{chunk-D4QOV56U.js → chunk-MTTRPPHH.js} +3 -3
  35. package/dist/{chunk-D4QOV56U.js.map → chunk-MTTRPPHH.js.map} +1 -1
  36. package/dist/{chunk-QKFOJKVE.cjs → chunk-MXWR3T3N.cjs} +2 -2
  37. package/dist/chunk-MXWR3T3N.cjs.map +1 -0
  38. package/dist/{chunk-G4M3MCJO.cjs → chunk-ONHT2PDW.cjs} +4 -4
  39. package/dist/{chunk-G4M3MCJO.cjs.map → chunk-ONHT2PDW.cjs.map} +1 -1
  40. package/dist/{chunk-2MUGEPRD.js → chunk-REKY2CM6.js} +5 -5
  41. package/dist/{chunk-2MUGEPRD.js.map → chunk-REKY2CM6.js.map} +1 -1
  42. package/dist/{chunk-E4TRDGSU.cjs → chunk-SLCR7A6W.cjs} +4 -4
  43. package/dist/{chunk-E4TRDGSU.cjs.map → chunk-SLCR7A6W.cjs.map} +1 -1
  44. package/dist/chunk-SV5BW3IA.js +13 -0
  45. package/dist/chunk-SV5BW3IA.js.map +1 -0
  46. package/dist/{chunk-OC5OUZSD.js → chunk-TBXZ3NGR.js} +4 -4
  47. package/dist/{chunk-OC5OUZSD.js.map → chunk-TBXZ3NGR.js.map} +1 -1
  48. package/dist/{chunk-VP7MT7LH.cjs → chunk-TCW72JBU.cjs} +17 -17
  49. package/dist/{chunk-VP7MT7LH.cjs.map → chunk-TCW72JBU.cjs.map} +1 -1
  50. package/dist/{chunk-CF5KRDN4.js → chunk-TGBLDJ72.js} +18 -9
  51. package/dist/chunk-TGBLDJ72.js.map +1 -0
  52. package/dist/{chunk-QFC736WY.js → chunk-WE5WGVVX.js} +3 -3
  53. package/dist/{chunk-QFC736WY.js.map → chunk-WE5WGVVX.js.map} +1 -1
  54. package/dist/{chunk-YVTFODCJ.cjs → chunk-WUG646R4.cjs} +6 -3
  55. package/dist/chunk-WUG646R4.cjs.map +1 -0
  56. package/dist/{chunk-CAMQ5B3V.cjs → chunk-XOXA3QZR.cjs} +21 -15
  57. package/dist/chunk-XOXA3QZR.cjs.map +1 -0
  58. package/dist/{chunk-Y6LL3B5P.js → chunk-ZFU4FY3Q.js} +3 -3
  59. package/dist/{chunk-Y6LL3B5P.js.map → chunk-ZFU4FY3Q.js.map} +1 -1
  60. package/dist/icon.cjs +7 -7
  61. package/dist/icon.js +1 -1
  62. package/dist/{index-AesVUjQE.d.cts → index-Bd4br4sF.d.cts} +1 -1
  63. package/dist/{index-D3wJ8hrZ.d.ts → index-Bwrc9ktU.d.ts} +1 -1
  64. package/dist/index.cjs +45 -44
  65. package/dist/index.cjs.map +1 -1
  66. package/dist/index.d.cts +2 -2
  67. package/dist/index.d.ts +2 -2
  68. package/dist/index.js +13 -12
  69. package/dist/index.js.map +1 -1
  70. package/dist/inputs.cjs +5 -4
  71. package/dist/inputs.js +3 -2
  72. package/dist/json-editor.cjs +15 -15
  73. package/dist/json-editor.js +4 -4
  74. package/dist/magic-wand.cjs +4 -4
  75. package/dist/magic-wand.js +3 -3
  76. package/dist/media-viewer.cjs +3 -3
  77. package/dist/media-viewer.d.cts +2 -2
  78. package/dist/media-viewer.d.ts +2 -2
  79. package/dist/media-viewer.js +2 -2
  80. package/dist/multi-switch.cjs +3 -2
  81. package/dist/multi-switch.js +2 -1
  82. package/dist/pdf-viewer.cjs +2 -2
  83. package/dist/pdf-viewer.d.cts +13 -1
  84. package/dist/pdf-viewer.d.ts +13 -1
  85. package/dist/pdf-viewer.js +1 -1
  86. package/dist/prompt-input.cjs +6 -5
  87. package/dist/prompt-input.js +5 -4
  88. package/dist/reason-tag.cjs +4 -4
  89. package/dist/reason-tag.js +3 -3
  90. package/dist/switch.cjs +2 -2
  91. package/dist/switch.js +1 -1
  92. package/dist/tooltip.cjs +3 -2
  93. package/dist/tooltip.js +2 -1
  94. package/docs/PdfViewer.md +106 -4
  95. package/package.json +1 -1
  96. package/dist/PdfViewer.types-Bgn9EmZT.d.cts +0 -22
  97. package/dist/PdfViewer.types-xnPpdjJa.d.ts +0 -22
  98. package/dist/chunk-26JZ47BJ.js.map +0 -1
  99. package/dist/chunk-CAMQ5B3V.cjs.map +0 -1
  100. package/dist/chunk-CF5KRDN4.js.map +0 -1
  101. package/dist/chunk-EEFWVFKO.js.map +0 -1
  102. package/dist/chunk-HRH5BIYG.js +0 -56
  103. package/dist/chunk-HRH5BIYG.js.map +0 -1
  104. package/dist/chunk-IVRYSSM7.js.map +0 -1
  105. package/dist/chunk-QKFOJKVE.cjs.map +0 -1
  106. package/dist/chunk-RVBTDXPD.cjs +0 -169
  107. package/dist/chunk-RVBTDXPD.cjs.map +0 -1
  108. package/dist/chunk-VQXXX6DK.js +0 -167
  109. package/dist/chunk-VQXXX6DK.js.map +0 -1
  110. package/dist/chunk-X7H75WVP.cjs.map +0 -1
  111. package/dist/chunk-XM3W5ETT.cjs +0 -58
  112. package/dist/chunk-XM3W5ETT.cjs.map +0 -1
  113. package/dist/chunk-YVTFODCJ.cjs.map +0 -1
@@ -1,7 +1,7 @@
1
- export { JsonEditor, applyJsonEdit, describeEdit, findJsonConflicts, getAtPath, inferType, parseKeyMap, parsePath, pathToString, resolveKeyRule, typeMatches } from './chunk-OC5OUZSD.js';
1
+ export { JsonEditor, applyJsonEdit, describeEdit, findJsonConflicts, getAtPath, inferType, parseKeyMap, parsePath, pathToString, resolveKeyRule, typeMatches } from './chunk-TBXZ3NGR.js';
2
2
  import './chunk-XQDGUXMS.js';
3
3
  import './chunk-T45LBTXH.js';
4
- import './chunk-VQXXX6DK.js';
4
+ import './chunk-DXZCKDYS.js';
5
5
  import './chunk-2UTN3EFK.js';
6
6
  import './chunk-UVUBV4VZ.js';
7
7
  import './chunk-KXYMMNNV.js';
@@ -19,10 +19,10 @@ import './chunk-WHEXTDPV.js';
19
19
  import './chunk-6FCQD2KQ.js';
20
20
  import './chunk-RGANGU7X.js';
21
21
  import './chunk-JXE5XID6.js';
22
- import './chunk-26JZ47BJ.js';
22
+ import './chunk-45JO5BEZ.js';
23
23
  import './chunk-6TBRBN7H.js';
24
24
  import './chunk-45BBNJQD.js';
25
- import './chunk-IVRYSSM7.js';
25
+ import './chunk-J3A4Z2P7.js';
26
26
  import './chunk-ZXZJYVWP.js';
27
27
  import './chunk-EDYAXGUM.js';
28
28
  import './chunk-MMW2JGKZ.js';
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var chunk2KFHSFFY_cjs = require('./chunk-2KFHSFFY.cjs');
3
+ var chunk6GKR5OAW_cjs = require('./chunk-6GKR5OAW.cjs');
4
4
  require('./chunk-MAZEX4EZ.cjs');
5
5
  require('./chunk-MRZXTL46.cjs');
6
6
  require('./chunk-P53432AK.cjs');
@@ -12,17 +12,17 @@ require('./chunk-NBZC6LOB.cjs');
12
12
  require('./chunk-VBWRH4UW.cjs');
13
13
  require('./chunk-MOU6O324.cjs');
14
14
  require('./chunk-M5MUGSON.cjs');
15
- require('./chunk-CAMQ5B3V.cjs');
15
+ require('./chunk-XOXA3QZR.cjs');
16
16
  require('./chunk-X2FC7ODX.cjs');
17
17
  require('./chunk-XCZZVRBY.cjs');
18
- require('./chunk-QKFOJKVE.cjs');
18
+ require('./chunk-MXWR3T3N.cjs');
19
19
  require('./chunk-ZU5Q77OT.cjs');
20
20
 
21
21
 
22
22
 
23
23
  Object.defineProperty(exports, "MagicWand", {
24
24
  enumerable: true,
25
- get: function () { return chunk2KFHSFFY_cjs.MagicWand; }
25
+ get: function () { return chunk6GKR5OAW_cjs.MagicWand; }
26
26
  });
27
27
  //# sourceMappingURL=magic-wand.cjs.map
28
28
  //# sourceMappingURL=magic-wand.cjs.map
@@ -1,4 +1,4 @@
1
- export { MagicWand } from './chunk-EJ6P7K4G.js';
1
+ export { MagicWand } from './chunk-EULOJOTU.js';
2
2
  import './chunk-UVUBV4VZ.js';
3
3
  import './chunk-KXYMMNNV.js';
4
4
  import './chunk-WX5XYDVN.js';
@@ -10,10 +10,10 @@ import './chunk-WHEXTDPV.js';
10
10
  import './chunk-IQ4KQJAO.js';
11
11
  import './chunk-6FCQD2KQ.js';
12
12
  import './chunk-LQ4ICCN2.js';
13
- import './chunk-26JZ47BJ.js';
13
+ import './chunk-45JO5BEZ.js';
14
14
  import './chunk-6TBRBN7H.js';
15
15
  import './chunk-45BBNJQD.js';
16
- import './chunk-IVRYSSM7.js';
16
+ import './chunk-J3A4Z2P7.js';
17
17
  import './chunk-MMW2JGKZ.js';
18
18
  //# sourceMappingURL=magic-wand.js.map
19
19
  //# sourceMappingURL=magic-wand.js.map
@@ -1,8 +1,8 @@
1
1
  'use strict';
2
2
 
3
- var chunkE4TRDGSU_cjs = require('./chunk-E4TRDGSU.cjs');
3
+ var chunkSLCR7A6W_cjs = require('./chunk-SLCR7A6W.cjs');
4
4
  require('./chunk-TH7VP4CL.cjs');
5
- require('./chunk-XM3W5ETT.cjs');
5
+ require('./chunk-7MDHCYEB.cjs');
6
6
  require('./chunk-7QENPLOP.cjs');
7
7
  require('./chunk-M5SEYDSS.cjs');
8
8
  require('./chunk-T6YELZPJ.cjs');
@@ -14,7 +14,7 @@ require('./chunk-ZU5Q77OT.cjs');
14
14
 
15
15
  Object.defineProperty(exports, "MediaViewer", {
16
16
  enumerable: true,
17
- get: function () { return chunkE4TRDGSU_cjs.MediaViewer; }
17
+ get: function () { return chunkSLCR7A6W_cjs.MediaViewer; }
18
18
  });
19
19
  //# sourceMappingURL=media-viewer.cjs.map
20
20
  //# sourceMappingURL=media-viewer.cjs.map
@@ -1,7 +1,7 @@
1
- export { a as MediaViewer, b as MediaViewerProps } from './index-AesVUjQE.cjs';
1
+ export { a as MediaViewer, b as MediaViewerProps } from './index-Bd4br4sF.cjs';
2
2
  import 'react';
3
3
  import './ImageViewer.types-CtqaA6KV.cjs';
4
4
  import './FauxClient.types-Dtk9aRs6.cjs';
5
5
  import './VideoViewer.types-_AwQ8DQr.cjs';
6
6
  import './AudioViewer.types-CyhmQVQd.cjs';
7
- import './PdfViewer.types-Bgn9EmZT.cjs';
7
+ import './PdfViewer.types-DyoUBa2g.cjs';
@@ -1,7 +1,7 @@
1
- export { a as MediaViewer, b as MediaViewerProps } from './index-D3wJ8hrZ.js';
1
+ export { a as MediaViewer, b as MediaViewerProps } from './index-Bwrc9ktU.js';
2
2
  import 'react';
3
3
  import './ImageViewer.types-BDTxBYEN.js';
4
4
  import './FauxClient.types-Dtk9aRs6.js';
5
5
  import './VideoViewer.types-_AwQ8DQr.js';
6
6
  import './AudioViewer.types-CyhmQVQd.js';
7
- import './PdfViewer.types-xnPpdjJa.js';
7
+ import './PdfViewer.types-BEk2Jq6p.js';
@@ -1,6 +1,6 @@
1
- export { MediaViewer } from './chunk-D4QOV56U.js';
1
+ export { MediaViewer } from './chunk-MTTRPPHH.js';
2
2
  import './chunk-VOGI7GX3.js';
3
- import './chunk-HRH5BIYG.js';
3
+ import './chunk-MORXQ5UM.js';
4
4
  import './chunk-ICMLLZKZ.js';
5
5
  import './chunk-GVMWJ4NI.js';
6
6
  import './chunk-CPY7NHXM.js';
@@ -1,6 +1,7 @@
1
1
  'use strict';
2
2
 
3
- var chunkYVTFODCJ_cjs = require('./chunk-YVTFODCJ.cjs');
3
+ var chunkWUG646R4_cjs = require('./chunk-WUG646R4.cjs');
4
+ require('./chunk-I27K6NLX.cjs');
4
5
  require('./chunk-P53432AK.cjs');
5
6
  require('./chunk-QF7CD4JH.cjs');
6
7
  require('./chunk-O3F6DYWR.cjs');
@@ -13,7 +14,7 @@ require('./chunk-ZU5Q77OT.cjs');
13
14
 
14
15
  Object.defineProperty(exports, "MultiSwitch", {
15
16
  enumerable: true,
16
- get: function () { return chunkYVTFODCJ_cjs.MultiSwitch; }
17
+ get: function () { return chunkWUG646R4_cjs.MultiSwitch; }
17
18
  });
18
19
  //# sourceMappingURL=multi-switch.cjs.map
19
20
  //# sourceMappingURL=multi-switch.cjs.map
@@ -1,4 +1,5 @@
1
- export { MultiSwitch } from './chunk-EEFWVFKO.js';
1
+ export { MultiSwitch } from './chunk-KUJ5XRBD.js';
2
+ import './chunk-SV5BW3IA.js';
2
3
  import './chunk-WX5XYDVN.js';
3
4
  import './chunk-5WQ6FPSP.js';
4
5
  import './chunk-USWQAMI3.js';
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var chunkXM3W5ETT_cjs = require('./chunk-XM3W5ETT.cjs');
3
+ var chunk7MDHCYEB_cjs = require('./chunk-7MDHCYEB.cjs');
4
4
  require('./chunk-M5SEYDSS.cjs');
5
5
  require('./chunk-SNHU2AI4.cjs');
6
6
  require('./chunk-ZU5Q77OT.cjs');
@@ -9,7 +9,7 @@ require('./chunk-ZU5Q77OT.cjs');
9
9
 
10
10
  Object.defineProperty(exports, "PdfViewer", {
11
11
  enumerable: true,
12
- get: function () { return chunkXM3W5ETT_cjs.PdfViewer; }
12
+ get: function () { return chunk7MDHCYEB_cjs.PdfViewer; }
13
13
  });
14
14
  //# sourceMappingURL=pdf-viewer.cjs.map
15
15
  //# sourceMappingURL=pdf-viewer.cjs.map
@@ -1,5 +1,6 @@
1
1
  import * as react from 'react';
2
- import { P as PdfViewerProps } from './PdfViewer.types-Bgn9EmZT.cjs';
2
+ import { b as PdfViewerProps } from './PdfViewer.types-DyoUBa2g.cjs';
3
+ export { P as PdfPageSource, a as PdfViewerPolicy, c as PdfViewerWatermark } from './PdfViewer.types-DyoUBa2g.cjs';
3
4
  import './FauxClient.types-Dtk9aRs6.cjs';
4
5
 
5
6
  /**
@@ -11,6 +12,17 @@ import './FauxClient.types-Dtk9aRs6.cjs';
11
12
  * ```tsx
12
13
  * <PdfViewer src="/report.pdf" title="report.pdf" style={{ height: 600 }} />
13
14
  * ```
15
+ *
16
+ * With `pages` it shows page images the app rendered instead, and never
17
+ * fetches or references the PDF; `policy` and `watermark` apply there.
18
+ *
19
+ * ```tsx
20
+ * <PdfViewer
21
+ * pages={{ count: 12, url: (n, scale) => `/docs/7/pages/${n}.png?scale=${scale}` }}
22
+ * policy={{ download: false, print: false, copy: false, screenshot: "deter" }}
23
+ * watermark={{ text: "jane@example.com" }}
24
+ * />
25
+ * ```
14
26
  */
15
27
  declare const PdfViewer: react.ForwardRefExoticComponent<PdfViewerProps & react.RefAttributes<HTMLDivElement>>;
16
28
 
@@ -1,5 +1,6 @@
1
1
  import * as react from 'react';
2
- import { P as PdfViewerProps } from './PdfViewer.types-xnPpdjJa.js';
2
+ import { b as PdfViewerProps } from './PdfViewer.types-BEk2Jq6p.js';
3
+ export { P as PdfPageSource, a as PdfViewerPolicy, c as PdfViewerWatermark } from './PdfViewer.types-BEk2Jq6p.js';
3
4
  import './FauxClient.types-Dtk9aRs6.js';
4
5
 
5
6
  /**
@@ -11,6 +12,17 @@ import './FauxClient.types-Dtk9aRs6.js';
11
12
  * ```tsx
12
13
  * <PdfViewer src="/report.pdf" title="report.pdf" style={{ height: 600 }} />
13
14
  * ```
15
+ *
16
+ * With `pages` it shows page images the app rendered instead, and never
17
+ * fetches or references the PDF; `policy` and `watermark` apply there.
18
+ *
19
+ * ```tsx
20
+ * <PdfViewer
21
+ * pages={{ count: 12, url: (n, scale) => `/docs/7/pages/${n}.png?scale=${scale}` }}
22
+ * policy={{ download: false, print: false, copy: false, screenshot: "deter" }}
23
+ * watermark={{ text: "jane@example.com" }}
24
+ * />
25
+ * ```
14
26
  */
15
27
  declare const PdfViewer: react.ForwardRefExoticComponent<PdfViewerProps & react.RefAttributes<HTMLDivElement>>;
16
28
 
@@ -1,4 +1,4 @@
1
- export { PdfViewer } from './chunk-HRH5BIYG.js';
1
+ export { PdfViewer } from './chunk-MORXQ5UM.js';
2
2
  import './chunk-GVMWJ4NI.js';
3
3
  import './chunk-EDYAXGUM.js';
4
4
  import './chunk-MMW2JGKZ.js';
@@ -1,7 +1,8 @@
1
1
  'use strict';
2
2
 
3
- var chunkN7ABDCQ6_cjs = require('./chunk-N7ABDCQ6.cjs');
4
- require('./chunk-X7H75WVP.cjs');
3
+ var chunkI2TBENUQ_cjs = require('./chunk-I2TBENUQ.cjs');
4
+ require('./chunk-BJKKW77L.cjs');
5
+ require('./chunk-I27K6NLX.cjs');
5
6
  require('./chunk-AIA5UNQ5.cjs');
6
7
  require('./chunk-5JK2VDWY.cjs');
7
8
  require('./chunk-UZG6LO4Z.cjs');
@@ -10,10 +11,10 @@ require('./chunk-NBZC6LOB.cjs');
10
11
  require('./chunk-57FQGQJK.cjs');
11
12
  require('./chunk-RXDRYWVD.cjs');
12
13
  require('./chunk-M5MUGSON.cjs');
13
- require('./chunk-CAMQ5B3V.cjs');
14
+ require('./chunk-XOXA3QZR.cjs');
14
15
  require('./chunk-X2FC7ODX.cjs');
15
16
  require('./chunk-XCZZVRBY.cjs');
16
- require('./chunk-QKFOJKVE.cjs');
17
+ require('./chunk-MXWR3T3N.cjs');
17
18
  require('./chunk-SNHU2AI4.cjs');
18
19
  require('./chunk-ZU5Q77OT.cjs');
19
20
 
@@ -21,7 +22,7 @@ require('./chunk-ZU5Q77OT.cjs');
21
22
 
22
23
  Object.defineProperty(exports, "PromptInput", {
23
24
  enumerable: true,
24
- get: function () { return chunkN7ABDCQ6_cjs.PromptInput; }
25
+ get: function () { return chunkI2TBENUQ_cjs.PromptInput; }
25
26
  });
26
27
  //# sourceMappingURL=prompt-input.cjs.map
27
28
  //# sourceMappingURL=prompt-input.cjs.map
@@ -1,5 +1,6 @@
1
- export { PromptInput } from './chunk-2MUGEPRD.js';
2
- import './chunk-CF5KRDN4.js';
1
+ export { PromptInput } from './chunk-REKY2CM6.js';
2
+ import './chunk-TGBLDJ72.js';
3
+ import './chunk-SV5BW3IA.js';
3
4
  import './chunk-TJ66S5K6.js';
4
5
  import './chunk-M6XBF2ZS.js';
5
6
  import './chunk-XYOT75HH.js';
@@ -8,10 +9,10 @@ import './chunk-WHEXTDPV.js';
8
9
  import './chunk-RGANGU7X.js';
9
10
  import './chunk-JXE5XID6.js';
10
11
  import './chunk-LQ4ICCN2.js';
11
- import './chunk-26JZ47BJ.js';
12
+ import './chunk-45JO5BEZ.js';
12
13
  import './chunk-6TBRBN7H.js';
13
14
  import './chunk-45BBNJQD.js';
14
- import './chunk-IVRYSSM7.js';
15
+ import './chunk-J3A4Z2P7.js';
15
16
  import './chunk-EDYAXGUM.js';
16
17
  import './chunk-MMW2JGKZ.js';
17
18
  //# sourceMappingURL=prompt-input.js.map
@@ -1,23 +1,23 @@
1
1
  'use strict';
2
2
 
3
- var chunkTFKG5FSG_cjs = require('./chunk-TFKG5FSG.cjs');
3
+ var chunk4I4Y5MZO_cjs = require('./chunk-4I4Y5MZO.cjs');
4
4
  require('./chunk-UZG6LO4Z.cjs');
5
5
  require('./chunk-J2DI6RMR.cjs');
6
6
  require('./chunk-NBZC6LOB.cjs');
7
7
  require('./chunk-57FQGQJK.cjs');
8
8
  require('./chunk-RXDRYWVD.cjs');
9
9
  require('./chunk-M5MUGSON.cjs');
10
- require('./chunk-CAMQ5B3V.cjs');
10
+ require('./chunk-XOXA3QZR.cjs');
11
11
  require('./chunk-X2FC7ODX.cjs');
12
12
  require('./chunk-XCZZVRBY.cjs');
13
- require('./chunk-QKFOJKVE.cjs');
13
+ require('./chunk-MXWR3T3N.cjs');
14
14
  require('./chunk-ZU5Q77OT.cjs');
15
15
 
16
16
 
17
17
 
18
18
  Object.defineProperty(exports, "ReasonTag", {
19
19
  enumerable: true,
20
- get: function () { return chunkTFKG5FSG_cjs.ReasonTag; }
20
+ get: function () { return chunk4I4Y5MZO_cjs.ReasonTag; }
21
21
  });
22
22
  //# sourceMappingURL=reason-tag.cjs.map
23
23
  //# sourceMappingURL=reason-tag.cjs.map
@@ -1,14 +1,14 @@
1
- export { ReasonTag } from './chunk-Y6LL3B5P.js';
1
+ export { ReasonTag } from './chunk-ZFU4FY3Q.js';
2
2
  import './chunk-XYOT75HH.js';
3
3
  import './chunk-MQ6VGG62.js';
4
4
  import './chunk-WHEXTDPV.js';
5
5
  import './chunk-RGANGU7X.js';
6
6
  import './chunk-JXE5XID6.js';
7
7
  import './chunk-LQ4ICCN2.js';
8
- import './chunk-26JZ47BJ.js';
8
+ import './chunk-45JO5BEZ.js';
9
9
  import './chunk-6TBRBN7H.js';
10
10
  import './chunk-45BBNJQD.js';
11
- import './chunk-IVRYSSM7.js';
11
+ import './chunk-J3A4Z2P7.js';
12
12
  import './chunk-MMW2JGKZ.js';
13
13
  //# sourceMappingURL=reason-tag.js.map
14
14
  //# sourceMappingURL=reason-tag.js.map
package/dist/switch.cjs CHANGED
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
3
  require('./chunk-OYZDSMNP.cjs');
4
- var chunkRVBTDXPD_cjs = require('./chunk-RVBTDXPD.cjs');
4
+ var chunk2O5UXH5R_cjs = require('./chunk-2O5UXH5R.cjs');
5
5
  require('./chunk-O3F6DYWR.cjs');
6
6
  require('./chunk-KJ22KE56.cjs');
7
7
  require('./chunk-L3V3BYVS.cjs');
@@ -12,7 +12,7 @@ require('./chunk-ZU5Q77OT.cjs');
12
12
 
13
13
  Object.defineProperty(exports, "Switch", {
14
14
  enumerable: true,
15
- get: function () { return chunkRVBTDXPD_cjs.Switch; }
15
+ get: function () { return chunk2O5UXH5R_cjs.Switch; }
16
16
  });
17
17
  //# sourceMappingURL=switch.cjs.map
18
18
  //# sourceMappingURL=switch.cjs.map
package/dist/switch.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import './chunk-NW3GJWJ7.js';
2
- export { Switch } from './chunk-VQXXX6DK.js';
2
+ export { Switch } from './chunk-DXZCKDYS.js';
3
3
  import './chunk-USWQAMI3.js';
4
4
  import './chunk-OL53XYHF.js';
5
5
  import './chunk-NRXK42LO.js';
package/dist/tooltip.cjs CHANGED
@@ -1,6 +1,7 @@
1
1
  'use strict';
2
2
 
3
- var chunkX7H75WVP_cjs = require('./chunk-X7H75WVP.cjs');
3
+ var chunkBJKKW77L_cjs = require('./chunk-BJKKW77L.cjs');
4
+ require('./chunk-I27K6NLX.cjs');
4
5
  require('./chunk-J2DI6RMR.cjs');
5
6
  require('./chunk-NBZC6LOB.cjs');
6
7
  require('./chunk-ZU5Q77OT.cjs');
@@ -9,7 +10,7 @@ require('./chunk-ZU5Q77OT.cjs');
9
10
 
10
11
  Object.defineProperty(exports, "Tooltip", {
11
12
  enumerable: true,
12
- get: function () { return chunkX7H75WVP_cjs.Tooltip; }
13
+ get: function () { return chunkBJKKW77L_cjs.Tooltip; }
13
14
  });
14
15
  //# sourceMappingURL=tooltip.cjs.map
15
16
  //# sourceMappingURL=tooltip.cjs.map
package/dist/tooltip.js CHANGED
@@ -1,4 +1,5 @@
1
- export { Tooltip } from './chunk-CF5KRDN4.js';
1
+ export { Tooltip } from './chunk-TGBLDJ72.js';
2
+ import './chunk-SV5BW3IA.js';
2
3
  import './chunk-MQ6VGG62.js';
3
4
  import './chunk-WHEXTDPV.js';
4
5
  import './chunk-MMW2JGKZ.js';
package/docs/PdfViewer.md CHANGED
@@ -1,7 +1,13 @@
1
1
  # PdfViewer
2
2
 
3
- A standalone PDF viewer — embeds the document via the browser's native PDF
4
- plugin (`<object>`), falling back to an `<iframe>`, then to a download link.
3
+ A standalone PDF viewer with two modes:
4
+
5
+ - **`src`**: embeds the document via the browser's native PDF plugin
6
+ (`<object>`), falling back to an `<iframe>`, then to a download link.
7
+ - **`pages`** (page-image mode): shows page images your app rendered from the
8
+ PDF, behind its own auth, under an access `policy`, with an optional
9
+ `watermark`. The viewer never fetches or references the PDF.
10
+
5
11
  Renders for PDF sources inside `MediaViewer`.
6
12
 
7
13
  ## Import
@@ -19,11 +25,107 @@ import { PdfViewer } from "@particle-academy/react-fancy";
19
25
  The viewer fills its container, so give it a height. A `min-h` floor (`20rem`)
20
26
  is built in so it stays usable even without an explicit height.
21
27
 
28
+ The native plugin always shows its own download and print buttons and exposes
29
+ the file's URL, and a page cannot restrict it. If a viewer must not get the
30
+ file, use page-image mode.
31
+
32
+ ## Page-image mode
33
+
34
+ ```tsx
35
+ <PdfViewer
36
+ frame
37
+ title="contract-7.pdf"
38
+ pages={{ count: 12, url: (page, scale) => `/documents/7/pages/${page}.png?scale=${scale}` }}
39
+ policy={{ download: false, print: false, copy: false, screenshot: "deter" }}
40
+ watermark={{ text: "Jane Doe · jane@example.com · 2026-10-21 14:02" }}
41
+ style={{ height: 640 }}
42
+ />
43
+ ```
44
+
45
+ Your app turns the PDF into one image per page on its server, with whatever
46
+ tool it already uses, and serves them behind its own auth. react-fancy only
47
+ displays them. The `pages.url` images are the only requests the viewer makes;
48
+ `src` is ignored in this mode, even if you pass one.
49
+
50
+ - **`url(page, scale)`**: `page` is 1-based. `scale` is a resolution hint: the
51
+ zoom times the device pixel ratio, rounded **up** to one of `1`, `1.5`, `2`,
52
+ `3` or `4`, so a page is fetched at a handful of sizes rather than once per
53
+ zoom click. Render scale 1 at a width that reads sharply at fit-width in your
54
+ layout (e.g. 1000-1200 px).
55
+ - **`aspectRatio`** (optional, width / height) sizes a page before its image
56
+ arrives. Default A4 portrait. Each page switches to its image's real ratio
57
+ once it has loaded.
58
+ - **Lazy**: only pages near the viewport get an `<img>` (a viewport's height
59
+ above and below).
60
+ - **Toolbar**: previous / next page with "n / total", zoom out / zoom
61
+ percentage (click to reset) / zoom in, **Width** (fit width, which is 100%)
62
+ and **Page** (fit one page to the height). With `frame`, the `FauxClient`
63
+ frame adds full screen; the current page stays in place when the viewer
64
+ resizes.
65
+ - **No search.** Page images carry no text, so there is nothing to search.
66
+ This is a consequence of not sending the PDF.
67
+ - **Controlled state** for agents and hosts: `page` / `onPageChange` and
68
+ `zoom` / `onZoomChange`. Stable handles:
69
+ `[data-react-fancy-pdf-viewer-page][data-page="3"]`, and
70
+ `data-react-fancy-pdf-viewer-{prev,next,zoom-in,zoom-out,zoom-reset,fit-width,fit-page}`
71
+ on the buttons.
72
+
73
+ ### Policy: what each flag does and does not do
74
+
75
+ Every flag defaults to allowed. **These are deterrents.** A web page cannot stop
76
+ someone who is determined: anything drawn on a screen can be photographed,
77
+ screenshotted or pulled out of devtools. The real protection is that in this
78
+ mode the app never serves the PDF, and page images are all a viewer ever gets.
79
+
80
+ | Flag | Does | Does not |
81
+ |------|------|----------|
82
+ | `download: false` | Suppresses the context menu ("Save image as…") on the pages, and makes the images non-draggable. There is no download control in this mode at all, whatever the flag. | Stop the page images being captured: they are ordinary images the browser has fetched, visible in devtools and the browser's cache. |
83
+ | `print: false` | Print CSS blanks the viewer, so printing (Ctrl/Cmd+P, the browser menu, `window.print()`) produces an empty frame. Ctrl/Cmd+P is also intercepted while focus is inside the viewer. | Stop a screenshot, a "save page", or a user who edits the CSS in devtools. |
84
+ | `copy: false` | Turns user selection off. (There is no text layer to copy anyway.) | Anything else; the images can still be captured. |
85
+ | `screenshot: "deter"` | Blurs the pages while the tab is hidden or the window has lost focus. On a PrintScreen key it blurs them for 1.5 s and tries to clear the clipboard, best effort. | **Prevent screenshots. A web page cannot.** OS tools, other apps and phone cameras are all out of its reach, and PrintScreen usually captures before the page hears the key. |
86
+
87
+ ### Watermark
88
+
89
+ ```tsx
90
+ watermark={{ text: "jane@example.com", opacity: 0.15, angle: -30, density: 1 }}
91
+ ```
92
+
93
+ A tiled text overlay drawn over every page in the browser, with
94
+ `pointer-events: none`. Defaults: `opacity` 0.15, `angle` -30°, `density` 1
95
+ (2 halves the gap between repeats).
96
+
97
+ **A client-side watermark can be removed with devtools.** If yours must hold,
98
+ burn it into the page images on your server: the `url(page, scale)` callback is
99
+ the place to ask for that (e.g. a per-viewer URL your server stamps).
100
+
22
101
  ## Props
23
102
 
24
103
  | Prop | Type | Default | Description |
25
104
  |------|------|---------|-------------|
26
- | src | `string` | — | PDF source (`http(s):` / `data:` / `blob:`) |
27
- | title | `string` | `"PDF document"` | Accessible title for the embedded document |
105
+ | src | `string` | — | PDF source (`http(s):` / `data:` / `blob:`) for the native plugin. Ignored with `pages` |
106
+ | pages | `{ count: number; url: (page, scale) => string; aspectRatio?: number }` | — | Page-image mode |
107
+ | page | `number` | — | Current page (1-based), controlled |
108
+ | defaultPage | `number` | `1` | Starting page, uncontrolled |
109
+ | onPageChange | `(page: number) => void` | — | Page changed (toolbar or scrolling) |
110
+ | zoom | `number` | — | Zoom, 1 = fit width, controlled (page-image mode) |
111
+ | defaultZoom | `number` | `1` | Starting zoom, uncontrolled |
112
+ | onZoomChange | `(zoom: number) => void` | — | Zoom changed |
113
+ | policy | `{ download?: boolean; print?: boolean; copy?: boolean; screenshot?: "allow" \| "deter" }` | all allowed | See above (page-image mode only) |
114
+ | watermark | `{ text: string; opacity?: number; angle?: number; density?: number }` | — | See above (page-image mode only) |
115
+ | frame | `boolean` | `false` | Show inside the `FauxClient` frame, with full screen |
116
+ | frameProps | `Partial<FauxClientProps>` | — | Passed to the frame |
117
+ | title | `string` | `"PDF document"` | Accessible title, and the frame's address-bar text |
28
118
  | className | `string` | — | Classes for the container |
29
119
  | style | `CSSProperties` | — | Styles for the container (e.g. a height) |
120
+
121
+ ## Through MediaViewer and FileViewer
122
+
123
+ Both already forward `pdfProps` untouched, so page-image mode needs no new
124
+ props on either:
125
+
126
+ ```tsx
127
+ <MediaViewer kind="pdf" src="" pdfProps={{ pages, policy, watermark }} />
128
+
129
+ // @particle-academy/fancy-code
130
+ <FileViewer filename="contract.pdf" mediaProps={{ pdfProps: { pages, policy, watermark } }} />
131
+ ```
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@particle-academy/react-fancy",
3
- "version": "5.53.1",
3
+ "version": "5.54.1",
4
4
  "description": "React UI component library for Human+ UX — controlled, agent-bridgeable primitives",
5
5
  "repository": {
6
6
  "type": "git",
@@ -1,22 +0,0 @@
1
- import { F as FauxClientProps } from './FauxClient.types-Dtk9aRs6.cjs';
2
- import { CSSProperties } from 'react';
3
-
4
- interface PdfViewerProps {
5
- /**
6
- * Show the PDF in react-fancy's `FauxClient` frame with a full-screen button,
7
- * revealed on hover. Zoom stays on the browser's own PDF toolbar. Default `false`.
8
- */
9
- frame?: boolean;
10
- /** Passed to the frame (`variant`, `onFullscreenChange`, …). */
11
- frameProps?: Partial<FauxClientProps>;
12
- /** PDF source — an `http(s):`, `data:`, or `blob:` URL. */
13
- src: string;
14
- /** Accessible title for the embedded document (default `"PDF document"`). */
15
- title?: string;
16
- /** Additional CSS classes for the container. */
17
- className?: string;
18
- /** Inline styles for the container (e.g. a fixed height). */
19
- style?: CSSProperties;
20
- }
21
-
22
- export type { PdfViewerProps as P };
@@ -1,22 +0,0 @@
1
- import { F as FauxClientProps } from './FauxClient.types-Dtk9aRs6.js';
2
- import { CSSProperties } from 'react';
3
-
4
- interface PdfViewerProps {
5
- /**
6
- * Show the PDF in react-fancy's `FauxClient` frame with a full-screen button,
7
- * revealed on hover. Zoom stays on the browser's own PDF toolbar. Default `false`.
8
- */
9
- frame?: boolean;
10
- /** Passed to the frame (`variant`, `onFullscreenChange`, …). */
11
- frameProps?: Partial<FauxClientProps>;
12
- /** PDF source — an `http(s):`, `data:`, or `blob:` URL. */
13
- src: string;
14
- /** Accessible title for the embedded document (default `"PDF document"`). */
15
- title?: string;
16
- /** Additional CSS classes for the container. */
17
- className?: string;
18
- /** Inline styles for the container (e.g. a fixed height). */
19
- style?: CSSProperties;
20
- }
21
-
22
- export type { PdfViewerProps as P };