@pallasoft/ps-file-components 1.4.0 → 2.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 (194) hide show
  1. package/dist/components/ps-document-scanner-loader.d.ts +1 -1
  2. package/dist/components/ps-document-scanner-sheet.d.ts +1 -1
  3. package/dist/components/ps-document-scanner-sheet.js +64 -86
  4. package/dist/components/ps-document-scanner.d.ts +1 -1
  5. package/dist/components/ps-document-scanner.js +2 -3
  6. package/dist/components/ps-file-picker-actions.d.ts +10 -0
  7. package/dist/components/ps-file-picker-actions.js +21 -0
  8. package/dist/components/ps-file-picker.d.ts +7 -1
  9. package/dist/components/ps-file-picker.js +30 -6
  10. package/dist/components/ps-scan-button.d.ts +13 -0
  11. package/dist/components/ps-scan-button.js +9 -0
  12. package/dist/components/ps-scan-camera-view.d.ts +11 -8
  13. package/dist/components/ps-scan-camera-view.js +14 -16
  14. package/dist/components/ps-scan-crop-editor.d.ts +4 -4
  15. package/dist/components/ps-scan-crop-editor.js +24 -8
  16. package/dist/components/ps-scan-denied-steps.d.ts +6 -0
  17. package/dist/components/ps-scan-denied-steps.js +33 -0
  18. package/dist/components/ps-scan-icon-button.d.ts +4 -3
  19. package/dist/components/ps-scan-icon-button.js +3 -1
  20. package/dist/components/ps-scan-illustration.d.ts +1 -0
  21. package/dist/components/ps-scan-illustration.js +6 -0
  22. package/dist/components/ps-scan-loupe.d.ts +10 -0
  23. package/dist/components/ps-scan-loupe.js +31 -0
  24. package/dist/components/ps-scan-permission-view.d.ts +10 -0
  25. package/dist/components/ps-scan-permission-view.js +48 -0
  26. package/dist/components/ps-scan-photo-button.d.ts +7 -0
  27. package/dist/components/ps-scan-photo-button.js +20 -0
  28. package/dist/components/ps-scan-preview.d.ts +12 -0
  29. package/dist/components/ps-scan-preview.js +10 -0
  30. package/dist/components/ps-scan-shutter.d.ts +6 -0
  31. package/dist/components/ps-scan-shutter.js +6 -0
  32. package/dist/components/ps-scan-viewfinder-overlay.d.ts +8 -0
  33. package/dist/components/ps-scan-viewfinder-overlay.js +28 -0
  34. package/dist/components/ps-upload-row.js +1 -1
  35. package/dist/constants/ps-document-scanner-labels.d.ts +39 -38
  36. package/dist/constants/ps-document-scanner-labels.js +39 -38
  37. package/dist/constants/ps-file-picker-labels.d.ts +5 -3
  38. package/dist/constants/ps-file-picker-labels.js +5 -3
  39. package/dist/constants/ps-scan-camera-status.d.ts +4 -0
  40. package/dist/constants/ps-scan-camera-status.js +4 -0
  41. package/dist/constants/ps-scan-chrome-classes.d.ts +10 -0
  42. package/dist/constants/ps-scan-chrome-classes.js +13 -0
  43. package/dist/constants/ps-scan-config.d.ts +34 -24
  44. package/dist/constants/ps-scan-config.js +34 -24
  45. package/dist/constants/ps-scan-platform.d.ts +6 -0
  46. package/dist/constants/ps-scan-platform.js +8 -0
  47. package/dist/constants/ps-scan-step.d.ts +1 -1
  48. package/dist/constants/ps-scan-step.js +1 -1
  49. package/dist/esm/components/ps-document-scanner-sheet.js +67 -89
  50. package/dist/esm/components/ps-document-scanner.js +2 -3
  51. package/dist/esm/components/ps-file-picker-actions.js +17 -0
  52. package/dist/esm/components/ps-file-picker.js +31 -7
  53. package/dist/esm/components/ps-scan-button.js +5 -0
  54. package/dist/esm/components/ps-scan-camera-view.js +17 -19
  55. package/dist/esm/components/ps-scan-crop-editor.js +26 -10
  56. package/dist/esm/components/ps-scan-denied-steps.js +29 -0
  57. package/dist/esm/components/ps-scan-icon-button.js +3 -1
  58. package/dist/esm/components/ps-scan-illustration.js +2 -0
  59. package/dist/esm/components/ps-scan-loupe.js +27 -0
  60. package/dist/esm/components/ps-scan-permission-view.js +44 -0
  61. package/dist/esm/components/ps-scan-photo-button.js +16 -0
  62. package/dist/esm/components/ps-scan-preview.js +6 -0
  63. package/dist/esm/components/ps-scan-shutter.js +2 -0
  64. package/dist/esm/components/ps-scan-viewfinder-overlay.js +24 -0
  65. package/dist/esm/components/ps-upload-row.js +1 -1
  66. package/dist/esm/constants/ps-document-scanner-labels.js +39 -38
  67. package/dist/esm/constants/ps-file-picker-labels.js +5 -3
  68. package/dist/esm/constants/ps-scan-camera-status.js +4 -0
  69. package/dist/esm/constants/ps-scan-chrome-classes.js +10 -0
  70. package/dist/esm/constants/ps-scan-config.js +34 -24
  71. package/dist/esm/constants/ps-scan-platform.js +5 -0
  72. package/dist/esm/constants/ps-scan-step.js +1 -1
  73. package/dist/esm/hooks/use-ps-scan-camera.js +52 -15
  74. package/dist/esm/hooks/use-ps-scan-live-detection.js +41 -0
  75. package/dist/esm/hooks/use-ps-scan-photo.js +42 -0
  76. package/dist/esm/index.js +1 -2
  77. package/dist/esm/models/ps-scan-region.js +1 -0
  78. package/dist/esm/models/ps-scan-result.js +1 -0
  79. package/dist/esm/models/ps-scan-stability.js +1 -0
  80. package/dist/esm/services/ps-scan-camera-service.js +52 -7
  81. package/dist/esm/services/ps-scan-canny-service.js +93 -0
  82. package/dist/esm/services/ps-scan-canvas-service.js +13 -1
  83. package/dist/esm/services/ps-scan-edge-service.js +73 -137
  84. package/dist/esm/services/ps-scan-file-name-service.js +2 -11
  85. package/dist/esm/services/ps-scan-geometry-service.js +56 -0
  86. package/dist/esm/services/ps-scan-hull-service.js +0 -39
  87. package/dist/esm/services/ps-scan-image-filter-service.js +0 -21
  88. package/dist/esm/services/ps-scan-morphology-service.js +44 -0
  89. package/dist/esm/services/ps-scan-pipeline-service.js +9 -19
  90. package/dist/esm/services/ps-scan-platform-service.js +15 -0
  91. package/dist/esm/services/ps-scan-polygon-service.js +75 -0
  92. package/dist/esm/services/ps-scan-region-service.js +52 -0
  93. package/dist/esm/services/ps-scan-stability-service.js +28 -0
  94. package/dist/esm/services/ps-scan-warp-service.js +8 -2
  95. package/dist/esm/services/ps-scan-yield-service.js +5 -0
  96. package/dist/hooks/use-ps-scan-camera.d.ts +3 -1
  97. package/dist/hooks/use-ps-scan-camera.js +52 -15
  98. package/dist/hooks/use-ps-scan-live-detection.d.ts +3 -0
  99. package/dist/hooks/use-ps-scan-live-detection.js +45 -0
  100. package/dist/hooks/use-ps-scan-photo.d.ts +9 -0
  101. package/dist/hooks/use-ps-scan-photo.js +46 -0
  102. package/dist/index.d.ts +1 -2
  103. package/dist/index.js +1 -2
  104. package/dist/models/ps-document-scanner-props.d.ts +0 -3
  105. package/dist/models/ps-document-scanner-sheet-props.d.ts +0 -3
  106. package/dist/models/ps-file-picker-scan.d.ts +4 -0
  107. package/dist/models/ps-scan-gradient.d.ts +4 -0
  108. package/dist/models/ps-scan-live-detection.d.ts +4 -0
  109. package/dist/models/ps-scan-located.d.ts +5 -0
  110. package/dist/models/ps-scan-photo.d.ts +9 -0
  111. package/dist/models/ps-scan-region.d.ts +5 -0
  112. package/dist/models/ps-scan-region.js +2 -0
  113. package/dist/models/ps-scan-result.d.ts +6 -0
  114. package/dist/models/ps-scan-result.js +2 -0
  115. package/dist/models/ps-scan-stability.d.ts +5 -0
  116. package/dist/models/ps-scan-stability.js +2 -0
  117. package/dist/services/ps-scan-camera-service.d.ts +4 -0
  118. package/dist/services/ps-scan-camera-service.js +52 -7
  119. package/dist/services/ps-scan-canny-service.d.ts +7 -0
  120. package/dist/services/ps-scan-canny-service.js +97 -0
  121. package/dist/services/ps-scan-canvas-service.d.ts +1 -0
  122. package/dist/services/ps-scan-canvas-service.js +13 -1
  123. package/dist/services/ps-scan-edge-service.d.ts +5 -5
  124. package/dist/services/ps-scan-edge-service.js +73 -137
  125. package/dist/services/ps-scan-file-name-service.d.ts +1 -3
  126. package/dist/services/ps-scan-file-name-service.js +2 -11
  127. package/dist/services/ps-scan-geometry-service.d.ts +4 -0
  128. package/dist/services/ps-scan-geometry-service.js +56 -0
  129. package/dist/services/ps-scan-hull-service.d.ts +0 -2
  130. package/dist/services/ps-scan-hull-service.js +0 -39
  131. package/dist/services/ps-scan-image-filter-service.d.ts +0 -1
  132. package/dist/services/ps-scan-image-filter-service.js +0 -21
  133. package/dist/services/ps-scan-morphology-service.d.ts +7 -0
  134. package/dist/services/ps-scan-morphology-service.js +48 -0
  135. package/dist/services/ps-scan-pipeline-service.d.ts +2 -5
  136. package/dist/services/ps-scan-pipeline-service.js +9 -19
  137. package/dist/services/ps-scan-platform-service.d.ts +4 -0
  138. package/dist/services/ps-scan-platform-service.js +19 -0
  139. package/dist/services/ps-scan-polygon-service.d.ts +8 -0
  140. package/dist/services/ps-scan-polygon-service.js +79 -0
  141. package/dist/services/ps-scan-region-service.d.ts +4 -0
  142. package/dist/services/ps-scan-region-service.js +56 -0
  143. package/dist/services/ps-scan-stability-service.d.ts +7 -0
  144. package/dist/services/ps-scan-stability-service.js +32 -0
  145. package/dist/services/ps-scan-warp-service.d.ts +1 -1
  146. package/dist/services/ps-scan-warp-service.js +8 -2
  147. package/dist/services/ps-scan-yield-service.d.ts +3 -0
  148. package/dist/services/ps-scan-yield-service.js +9 -0
  149. package/package.json +3 -3
  150. package/dist/components/ps-scan-page-list.d.ts +0 -12
  151. package/dist/components/ps-scan-page-list.js +0 -23
  152. package/dist/components/ps-scan-review.d.ts +0 -23
  153. package/dist/components/ps-scan-review.js +0 -20
  154. package/dist/constants/ps-scan-filter.d.ts +0 -7
  155. package/dist/constants/ps-scan-filter.js +0 -9
  156. package/dist/constants/ps-scan-output-format.d.ts +0 -5
  157. package/dist/constants/ps-scan-output-format.js +0 -7
  158. package/dist/esm/components/ps-scan-page-list.js +0 -19
  159. package/dist/esm/components/ps-scan-review.js +0 -16
  160. package/dist/esm/constants/ps-scan-filter.js +0 -6
  161. package/dist/esm/constants/ps-scan-output-format.js +0 -4
  162. package/dist/esm/hooks/use-ps-scan-pages.js +0 -62
  163. package/dist/esm/hooks/use-ps-scan-previews.js +0 -57
  164. package/dist/esm/services/ps-scan-enhance-service.js +0 -97
  165. package/dist/esm/services/ps-scan-order-service.js +0 -13
  166. package/dist/esm/services/ps-scan-output-service.js +0 -24
  167. package/dist/esm/services/ps-scan-pdf-service.js +0 -56
  168. package/dist/hooks/use-ps-scan-pages.d.ts +0 -12
  169. package/dist/hooks/use-ps-scan-pages.js +0 -66
  170. package/dist/hooks/use-ps-scan-previews.d.ts +0 -2
  171. package/dist/hooks/use-ps-scan-previews.js +0 -61
  172. package/dist/models/ps-scan-added-page.d.ts +0 -5
  173. package/dist/models/ps-scan-levels.d.ts +0 -4
  174. package/dist/models/ps-scan-output-options.d.ts +0 -7
  175. package/dist/models/ps-scan-page.d.ts +0 -12
  176. package/dist/models/ps-scan-pdf-page.d.ts +0 -5
  177. package/dist/services/ps-scan-enhance-service.d.ts +0 -9
  178. package/dist/services/ps-scan-enhance-service.js +0 -101
  179. package/dist/services/ps-scan-order-service.d.ts +0 -4
  180. package/dist/services/ps-scan-order-service.js +0 -17
  181. package/dist/services/ps-scan-output-service.d.ts +0 -5
  182. package/dist/services/ps-scan-output-service.js +0 -28
  183. package/dist/services/ps-scan-pdf-service.d.ts +0 -5
  184. package/dist/services/ps-scan-pdf-service.js +0 -60
  185. /package/dist/esm/models/{ps-scan-added-page.js → ps-file-picker-scan.js} +0 -0
  186. /package/dist/esm/models/{ps-scan-levels.js → ps-scan-gradient.js} +0 -0
  187. /package/dist/esm/models/{ps-scan-output-options.js → ps-scan-live-detection.js} +0 -0
  188. /package/dist/esm/models/{ps-scan-page.js → ps-scan-located.js} +0 -0
  189. /package/dist/esm/models/{ps-scan-pdf-page.js → ps-scan-photo.js} +0 -0
  190. /package/dist/models/{ps-scan-added-page.js → ps-file-picker-scan.js} +0 -0
  191. /package/dist/models/{ps-scan-levels.js → ps-scan-gradient.js} +0 -0
  192. /package/dist/models/{ps-scan-output-options.js → ps-scan-live-detection.js} +0 -0
  193. /package/dist/models/{ps-scan-page.js → ps-scan-located.js} +0 -0
  194. /package/dist/models/{ps-scan-pdf-page.js → ps-scan-photo.js} +0 -0
@@ -0,0 +1,33 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PsScanDeniedSteps = void 0;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const react_1 = require("react");
6
+ const ps_design_system_1 = require("@pallasoft/ps-design-system");
7
+ const ps_scan_platform_1 = require("../constants/ps-scan-platform");
8
+ const ps_scan_platform_service_1 = require("../services/ps-scan-platform-service");
9
+ const PsScanDeniedSteps = ({ labels }) => {
10
+ const [platform, setPlatform] = (0, react_1.useState)(() => ps_scan_platform_service_1.PsScanPlatformService.detect());
11
+ const platforms = [
12
+ {
13
+ key: ps_scan_platform_1.PsScanPlatform.Ios,
14
+ label: labels.platformIos,
15
+ steps: [labels.deniedIos1, labels.deniedIos2, labels.deniedIos3],
16
+ },
17
+ {
18
+ key: ps_scan_platform_1.PsScanPlatform.Android,
19
+ label: labels.platformAndroid,
20
+ steps: [labels.deniedAndroid1, labels.deniedAndroid2, labels.deniedAndroid3],
21
+ },
22
+ {
23
+ key: ps_scan_platform_1.PsScanPlatform.Desktop,
24
+ label: labels.platformDesktop,
25
+ steps: [labels.deniedDesktop1, labels.deniedDesktop2, labels.deniedDesktop3],
26
+ },
27
+ ];
28
+ const active = platforms.find((item) => item.key === platform);
29
+ return ((0, jsx_runtime_1.jsxs)("div", { className: 'flex w-full flex-col gap-4 rounded-ps-control border border-white/10 bg-white/5 p-4 text-left', children: [(0, jsx_runtime_1.jsx)("div", { className: 'grid grid-cols-3 gap-1 rounded-ps-control bg-black/40 p-1', role: 'group', children: platforms.map((item) => ((0, jsx_runtime_1.jsx)("button", { "aria-pressed": item.key === platform, className: ps_design_system_1.PallasoftClassNameService.merge('ps-focus-ring ps-control min-w-0 truncate rounded-ps-control px-2 text-xs font-semibold transition', item.key === platform
30
+ ? 'bg-white text-black'
31
+ : 'text-white/70 hover:bg-white/10 hover:text-white'), onClick: () => setPlatform(item.key), type: 'button', children: item.label }, item.key))) }), (0, jsx_runtime_1.jsx)("ol", { className: 'flex flex-col gap-3', children: (active === undefined ? [] : active.steps).map((step, index) => ((0, jsx_runtime_1.jsxs)("li", { className: 'flex items-start gap-3 text-sm leading-5 text-white/85', children: [(0, jsx_runtime_1.jsx)("span", { className: 'flex size-6 shrink-0 items-center justify-center rounded-full bg-primary text-xs font-bold text-[color:var(--ps-color-primary-contrast)]', children: index + 1 }), (0, jsx_runtime_1.jsx)("span", { className: 'pt-0.5', children: step })] }, step))) })] }));
32
+ };
33
+ exports.PsScanDeniedSteps = PsScanDeniedSteps;
@@ -1,10 +1,11 @@
1
- import type { ReactNode } from 'react';
1
+ import { type PsIconKey } from '@pallasoft/ps-icons';
2
2
  export interface PsScanIconButtonProps {
3
- children: ReactNode;
4
3
  className?: string;
5
4
  disabled?: boolean;
5
+ iconClassName?: string;
6
+ iconKey: PsIconKey;
6
7
  isPressed?: boolean;
7
8
  label: string;
8
9
  onClick: () => void;
9
10
  }
10
- export declare const PsScanIconButton: ({ children, className, disabled, isPressed, label, onClick, }: PsScanIconButtonProps) => import("react").JSX.Element;
11
+ export declare const PsScanIconButton: ({ className, disabled, iconClassName, iconKey, isPressed, label, onClick, }: PsScanIconButtonProps) => import("react").JSX.Element;
@@ -3,5 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.PsScanIconButton = void 0;
4
4
  const jsx_runtime_1 = require("react/jsx-runtime");
5
5
  const ps_design_system_1 = require("@pallasoft/ps-design-system");
6
- const PsScanIconButton = ({ children, className, disabled, isPressed, label, onClick, }) => ((0, jsx_runtime_1.jsx)("button", { "aria-label": label, "aria-pressed": isPressed, className: ps_design_system_1.PallasoftClassNameService.merge('ps-focus-ring inline-flex size-11 min-h-11 min-w-11 shrink-0 items-center justify-center rounded-ps-control border border-line bg-surface text-ink transition hover:border-primary/40 hover:text-primary disabled:pointer-events-none disabled:opacity-40', isPressed ? 'border-primary bg-primary-soft text-primary' : '', className), disabled: disabled, onClick: onClick, title: label, type: 'button', children: children }));
6
+ const ps_icons_1 = require("@pallasoft/ps-icons");
7
+ const ps_scan_chrome_classes_1 = require("../constants/ps-scan-chrome-classes");
8
+ const PsScanIconButton = ({ className, disabled, iconClassName, iconKey, isPressed, label, onClick, }) => ((0, jsx_runtime_1.jsx)("button", { "aria-label": label, "aria-pressed": isPressed, className: ps_design_system_1.PallasoftClassNameService.merge(ps_scan_chrome_classes_1.PsScanChromeClasses.icon, isPressed ? ps_scan_chrome_classes_1.PsScanChromeClasses.iconOn : ps_scan_chrome_classes_1.PsScanChromeClasses.iconOff, className), disabled: disabled, onClick: onClick, title: label, type: 'button', children: (0, jsx_runtime_1.jsx)(ps_icons_1.PsIcon, { "aria-hidden": 'true', className: ps_design_system_1.PallasoftClassNameService.merge('size-ps-control-icon-standalone', iconClassName), iconKey: iconKey }) }));
7
9
  exports.PsScanIconButton = PsScanIconButton;
@@ -0,0 +1 @@
1
+ export declare const PsScanIllustration: () => import("react").JSX.Element;
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PsScanIllustration = void 0;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const PsScanIllustration = () => ((0, jsx_runtime_1.jsxs)("svg", { "aria-hidden": 'true', className: 'h-auto w-40', fill: 'none', viewBox: '0 0 160 160', children: [(0, jsx_runtime_1.jsx)("rect", { className: 'fill-white/5 stroke-white/15', height: '148', rx: '28', width: '148', x: '6', y: '6' }), (0, jsx_runtime_1.jsx)("path", { className: 'fill-white', d: 'M52 34h56a4 4 0 0 1 4 4v84l-8-5-8 5-8-5-8 5-8-5-8 5-8-5-8 5V38a4 4 0 0 1 4-4Z' }), (0, jsx_runtime_1.jsx)("path", { className: 'stroke-black/25', d: 'M62 52h36M62 64h28M62 76h36M62 88h20M88 100h10', strokeLinecap: 'round', strokeWidth: '4' }), (0, jsx_runtime_1.jsx)("path", { className: 'stroke-primary', d: 'M38 46V30a6 6 0 0 1 6-6h16M100 24h16a6 6 0 0 1 6 6v16M122 114v16a6 6 0 0 1-6 6h-16M60 136H44a6 6 0 0 1-6-6v-16', strokeLinecap: 'round', strokeWidth: '5' }), (0, jsx_runtime_1.jsx)("rect", { className: 'fill-primary motion-safe:animate-pulse', height: '4', rx: '2', width: '96', x: '32', y: '78' })] }));
6
+ exports.PsScanIllustration = PsScanIllustration;
@@ -0,0 +1,10 @@
1
+ import type { PsPageSize } from '../models/ps-page-size';
2
+ import type { PsPoint } from '../models/ps-point';
3
+ import type { PsScanQuad } from '../models/ps-scan-quad';
4
+ export interface PsScanLoupeProps {
5
+ corners: PsScanQuad;
6
+ point: PsPoint;
7
+ source: string;
8
+ stage: PsPageSize;
9
+ }
10
+ export declare const PsScanLoupe: ({ corners, point, source, stage }: PsScanLoupeProps) => import("react").JSX.Element;
@@ -0,0 +1,31 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PsScanLoupe = void 0;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const ps_scan_config_1 = require("../constants/ps-scan-config");
6
+ const PsScanLoupe = ({ corners, point, source, stage }) => {
7
+ const size = ps_scan_config_1.PsScanConfig.loupeSize;
8
+ const zoom = ps_scan_config_1.PsScanConfig.loupeZoom;
9
+ const centreX = point.x * stage.width * zoom;
10
+ const centreY = point.y * stage.height * zoom;
11
+ const pointX = point.x * stage.width;
12
+ const pointY = point.y * stage.height;
13
+ const isBelow = pointY - ps_scan_config_1.PsScanConfig.loupeOffset - size < 0;
14
+ const left = Math.min(Math.max(pointX - size / 2, -size / 4), stage.width - (size * 3) / 4);
15
+ const top = isBelow
16
+ ? pointY + ps_scan_config_1.PsScanConfig.loupeOffset
17
+ : pointY - ps_scan_config_1.PsScanConfig.loupeOffset - size;
18
+ return ((0, jsx_runtime_1.jsx)("div", { "aria-hidden": 'true', className: 'pointer-events-none absolute z-10 overflow-hidden rounded-full border-4 border-white bg-black shadow-2xl animate-ps-scale-in', style: {
19
+ backgroundImage: `url("${source}")`,
20
+ backgroundPosition: `${size / 2 - centreX}px ${size / 2 - centreY}px`,
21
+ backgroundRepeat: 'no-repeat',
22
+ backgroundSize: `${stage.width * zoom}px ${stage.height * zoom}px`,
23
+ height: size,
24
+ left,
25
+ top,
26
+ width: size,
27
+ }, children: (0, jsx_runtime_1.jsxs)("svg", { className: 'absolute inset-0 size-full', viewBox: `0 0 ${size} ${size}`, children: [(0, jsx_runtime_1.jsx)("polygon", { className: 'fill-none stroke-primary', points: corners
28
+ .map((corner) => `${corner.x * stage.width * zoom - centreX + size / 2},${corner.y * stage.height * zoom - centreY + size / 2}`)
29
+ .join(' '), strokeWidth: '2' }), (0, jsx_runtime_1.jsx)("path", { className: 'stroke-white', d: `M${size / 2 - 10} ${size / 2}H${size / 2 + 10}M${size / 2} ${size / 2 - 10}V${size / 2 + 10}`, strokeLinecap: 'round', strokeWidth: '2' })] }) }));
30
+ };
31
+ exports.PsScanLoupe = PsScanLoupe;
@@ -0,0 +1,10 @@
1
+ import { PsDocumentScannerLabels } from '../constants/ps-document-scanner-labels';
2
+ import { PsScanCameraStatus } from '../constants/ps-scan-camera-status';
3
+ import type { PsLabelSet } from '../models/ps-label-set';
4
+ export interface PsScanPermissionViewProps {
5
+ labels: PsLabelSet<typeof PsDocumentScannerLabels>;
6
+ onAllow: () => void;
7
+ onFile: (file: File) => void;
8
+ status: PsScanCameraStatus;
9
+ }
10
+ export declare const PsScanPermissionView: ({ labels, onAllow, onFile, status, }: PsScanPermissionViewProps) => import("react").JSX.Element;
@@ -0,0 +1,48 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PsScanPermissionView = void 0;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const ps_core_components_1 = require("@pallasoft/ps-core-components");
6
+ const ps_icons_1 = require("@pallasoft/ps-icons");
7
+ const ps_scan_camera_status_1 = require("../constants/ps-scan-camera-status");
8
+ const ps_scan_button_1 = require("./ps-scan-button");
9
+ const ps_scan_denied_steps_1 = require("./ps-scan-denied-steps");
10
+ const ps_scan_illustration_1 = require("./ps-scan-illustration");
11
+ const ps_scan_photo_button_1 = require("./ps-scan-photo-button");
12
+ const PsScanPermissionView = ({ labels, onAllow, onFile, status, }) => {
13
+ if (status === ps_scan_camera_status_1.PsScanCameraStatus.Checking || status === ps_scan_camera_status_1.PsScanCameraStatus.Starting)
14
+ return ((0, jsx_runtime_1.jsxs)("div", { className: 'flex h-full flex-col items-center justify-center gap-3 text-sm text-white/75', role: 'status', children: [(0, jsx_runtime_1.jsx)(ps_core_components_1.PsSpinner, { color: 'current', label: labels.cameraStarting, size: 'small' }), (0, jsx_runtime_1.jsx)("span", { children: labels.cameraStarting })] }));
15
+ const screens = {
16
+ [ps_scan_camera_status_1.PsScanCameraStatus.Busy]: {
17
+ body: labels.busyBody,
18
+ iconKey: ps_icons_1.PsIconKey.Camera,
19
+ title: labels.busyTitle,
20
+ },
21
+ [ps_scan_camera_status_1.PsScanCameraStatus.Denied]: {
22
+ body: labels.deniedBody,
23
+ iconKey: ps_icons_1.PsIconKey.CameraOff,
24
+ title: labels.deniedTitle,
25
+ },
26
+ [ps_scan_camera_status_1.PsScanCameraStatus.Insecure]: {
27
+ body: labels.insecureBody,
28
+ iconKey: ps_icons_1.PsIconKey.Shield,
29
+ title: labels.insecureTitle,
30
+ },
31
+ [ps_scan_camera_status_1.PsScanCameraStatus.Prompt]: {
32
+ body: labels.primerBody,
33
+ iconKey: ps_icons_1.PsIconKey.Camera,
34
+ title: labels.primerTitle,
35
+ },
36
+ [ps_scan_camera_status_1.PsScanCameraStatus.Ready]: { body: '', iconKey: ps_icons_1.PsIconKey.Camera, title: '' },
37
+ [ps_scan_camera_status_1.PsScanCameraStatus.Unavailable]: {
38
+ body: labels.unavailableBody,
39
+ iconKey: ps_icons_1.PsIconKey.CameraOff,
40
+ title: labels.unavailableTitle,
41
+ },
42
+ };
43
+ const screen = screens[status];
44
+ const isPrimer = status === ps_scan_camera_status_1.PsScanCameraStatus.Prompt;
45
+ const canRetry = status === ps_scan_camera_status_1.PsScanCameraStatus.Denied || status === ps_scan_camera_status_1.PsScanCameraStatus.Busy;
46
+ return ((0, jsx_runtime_1.jsx)("div", { className: 'flex h-full min-h-0 flex-col overflow-y-auto', children: (0, jsx_runtime_1.jsxs)("div", { className: 'm-auto flex w-full max-w-sm flex-col items-center gap-6 px-6 pb-[max(1.5rem,env(safe-area-inset-bottom))] pt-20 text-center animate-ps-slide-up', children: [isPrimer ? ((0, jsx_runtime_1.jsx)(ps_scan_illustration_1.PsScanIllustration, {})) : ((0, jsx_runtime_1.jsx)("span", { className: 'flex size-20 items-center justify-center rounded-full bg-white/10 text-white', children: (0, jsx_runtime_1.jsx)(ps_icons_1.PsIcon, { "aria-hidden": 'true', className: 'size-9', iconKey: screen.iconKey }) })), (0, jsx_runtime_1.jsxs)("div", { className: 'flex flex-col gap-2', children: [(0, jsx_runtime_1.jsx)("h2", { className: 'text-xl font-semibold leading-tight text-white sm:text-2xl', children: screen.title }), (0, jsx_runtime_1.jsx)("p", { className: 'text-sm leading-6 text-white/70', children: screen.body })] }), status === ps_scan_camera_status_1.PsScanCameraStatus.Denied ? (0, jsx_runtime_1.jsx)(ps_scan_denied_steps_1.PsScanDeniedSteps, { labels: labels }) : null, (0, jsx_runtime_1.jsxs)("div", { className: 'flex w-full flex-col gap-3', children: [isPrimer || canRetry ? ((0, jsx_runtime_1.jsx)(ps_scan_button_1.PsScanButton, { className: 'w-full', isLarge: true, isPrimary: true, leadingIcon: isPrimer ? ((0, jsx_runtime_1.jsx)(ps_icons_1.PsIcon, { "aria-hidden": 'true', className: 'size-4', iconKey: ps_icons_1.PsIconKey.Camera })) : undefined, onClick: onAllow, children: isPrimer ? labels.allowCamera : labels.tryAgain })) : null, (0, jsx_runtime_1.jsx)(ps_scan_photo_button_1.PsScanPhotoButton, { className: 'w-full', label: labels.choosePhoto, onFile: onFile })] })] }) }));
47
+ };
48
+ exports.PsScanPermissionView = PsScanPermissionView;
@@ -0,0 +1,7 @@
1
+ export interface PsScanPhotoButtonProps {
2
+ className?: string;
3
+ isIconOnly?: boolean;
4
+ label: string;
5
+ onFile: (file: File) => void;
6
+ }
7
+ export declare const PsScanPhotoButton: ({ className, isIconOnly, label, onFile, }: PsScanPhotoButtonProps) => import("react").JSX.Element;
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PsScanPhotoButton = void 0;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const react_1 = require("react");
6
+ const ps_icons_1 = require("@pallasoft/ps-icons");
7
+ const ps_scan_button_1 = require("./ps-scan-button");
8
+ const ps_scan_icon_button_1 = require("./ps-scan-icon-button");
9
+ const PsScanPhotoButton = ({ className, isIconOnly = false, label, onFile, }) => {
10
+ const input = (0, react_1.useRef)(null);
11
+ const open = () => input.current?.click();
12
+ const onChange = (event) => {
13
+ const file = event.target.files === null ? undefined : event.target.files[0];
14
+ event.target.value = '';
15
+ if (file !== undefined)
16
+ onFile(file);
17
+ };
18
+ return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [isIconOnly ? ((0, jsx_runtime_1.jsx)(ps_scan_icon_button_1.PsScanIconButton, { className: className, iconKey: ps_icons_1.PsIconKey.Image, label: label, onClick: open })) : ((0, jsx_runtime_1.jsx)(ps_scan_button_1.PsScanButton, { className: className, isLarge: true, leadingIcon: (0, jsx_runtime_1.jsx)(ps_icons_1.PsIcon, { "aria-hidden": 'true', className: 'size-4', iconKey: ps_icons_1.PsIconKey.Image }), onClick: open, children: label })), (0, jsx_runtime_1.jsx)("input", { accept: 'image/*', "aria-hidden": 'true', className: 'sr-only', onChange: onChange, ref: input, tabIndex: -1, type: 'file' })] }));
19
+ };
20
+ exports.PsScanPhotoButton = PsScanPhotoButton;
@@ -0,0 +1,12 @@
1
+ import { PsDocumentScannerLabels } from '../constants/ps-document-scanner-labels';
2
+ import type { PsLabelSet } from '../models/ps-label-set';
3
+ import type { PsScanResult } from '../models/ps-scan-result';
4
+ export interface PsScanPreviewProps {
5
+ error: string;
6
+ labels: PsLabelSet<typeof PsDocumentScannerLabels>;
7
+ onAdjust: () => void;
8
+ onRetake: () => void;
9
+ onUse: () => void;
10
+ result: PsScanResult | null;
11
+ }
12
+ export declare const PsScanPreview: ({ error, labels, onAdjust, onRetake, onUse, result, }: PsScanPreviewProps) => import("react").JSX.Element;
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PsScanPreview = void 0;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const ps_core_components_1 = require("@pallasoft/ps-core-components");
6
+ const ps_icons_1 = require("@pallasoft/ps-icons");
7
+ const ps_scan_button_1 = require("./ps-scan-button");
8
+ const ps_scan_icon_button_1 = require("./ps-scan-icon-button");
9
+ const PsScanPreview = ({ error, labels, onAdjust, onRetake, onUse, result, }) => ((0, jsx_runtime_1.jsxs)("div", { className: 'flex h-full min-h-0 flex-col bg-black text-white animate-ps-fade-in', children: [(0, jsx_runtime_1.jsxs)("header", { className: 'grid shrink-0 grid-cols-[2.75rem_1fr_2.75rem] items-center gap-3 px-4 pb-1 pt-[max(1rem,env(safe-area-inset-top))]', children: [(0, jsx_runtime_1.jsx)(ps_scan_icon_button_1.PsScanIconButton, { iconKey: ps_icons_1.PsIconKey.Crop, label: labels.cropTitle, onClick: onAdjust }), (0, jsx_runtime_1.jsx)("h2", { className: 'truncate text-center text-base font-semibold', children: labels.previewTitle }), (0, jsx_runtime_1.jsx)("span", { "aria-hidden": 'true' })] }), (0, jsx_runtime_1.jsx)("div", { className: 'flex min-h-0 flex-1 items-center justify-center px-6 py-4', children: result === null ? ((0, jsx_runtime_1.jsxs)("div", { className: 'flex flex-col items-center gap-3 text-sm text-white/75', role: 'status', children: [(0, jsx_runtime_1.jsx)(ps_core_components_1.PsSpinner, { color: 'current', label: labels.preparing, size: 'small' }), (0, jsx_runtime_1.jsx)("span", { children: labels.preparing })] })) : ((0, jsx_runtime_1.jsx)("img", { alt: labels.previewAlt, className: 'max-h-full max-w-full rounded-sm bg-white object-contain shadow-[0_24px_60px_-20px_rgb(0_0_0/0.9)] animate-ps-fade-in', src: result.url })) }), error === '' ? null : ((0, jsx_runtime_1.jsx)("p", { className: 'mx-auto mb-2 max-w-sm rounded-ps-control bg-danger px-3 py-2 text-center text-sm text-white', role: 'alert', children: error })), (0, jsx_runtime_1.jsxs)("footer", { className: 'mx-auto grid w-full max-w-md shrink-0 grid-cols-2 gap-3 px-4 pb-[max(1.25rem,env(safe-area-inset-bottom))] pt-2', children: [(0, jsx_runtime_1.jsx)(ps_scan_button_1.PsScanButton, { isLarge: true, onClick: onRetake, children: labels.retake }), (0, jsx_runtime_1.jsx)(ps_scan_button_1.PsScanButton, { disabled: result === null, isLarge: true, isPrimary: true, leadingIcon: (0, jsx_runtime_1.jsx)(ps_icons_1.PsIcon, { "aria-hidden": 'true', className: 'size-4', iconKey: ps_icons_1.PsIconKey.Check }), onClick: onUse, children: labels.useScan })] })] }));
10
+ exports.PsScanPreview = PsScanPreview;
@@ -0,0 +1,6 @@
1
+ export interface PsScanShutterProps {
2
+ disabled: boolean;
3
+ label: string;
4
+ onCapture: () => void;
5
+ }
6
+ export declare const PsScanShutter: ({ disabled, label, onCapture }: PsScanShutterProps) => import("react").JSX.Element;
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PsScanShutter = void 0;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const PsScanShutter = ({ disabled, label, onCapture }) => ((0, jsx_runtime_1.jsxs)("button", { "aria-label": label, className: 'ps-focus-ring group relative flex size-[4.75rem] shrink-0 items-center justify-center rounded-full disabled:opacity-40', disabled: disabled, onClick: onCapture, title: label, type: 'button', children: [(0, jsx_runtime_1.jsx)("svg", { "aria-hidden": 'true', className: 'absolute inset-0 size-full -rotate-90', viewBox: '0 0 76 76', children: (0, jsx_runtime_1.jsx)("circle", { className: 'stroke-white', cx: '38', cy: '38', fill: 'none', r: '35', strokeWidth: '4' }) }), (0, jsx_runtime_1.jsx)("span", { className: 'size-[3.75rem] rounded-full bg-white transition-transform duration-150 group-active:scale-90' })] }));
6
+ exports.PsScanShutter = PsScanShutter;
@@ -0,0 +1,8 @@
1
+ import type { PsPageSize } from '../models/ps-page-size';
2
+ import type { PsScanQuad } from '../models/ps-scan-quad';
3
+ export interface PsScanViewfinderOverlayProps {
4
+ area: PsPageSize;
5
+ quad: PsScanQuad | null;
6
+ video: PsPageSize;
7
+ }
8
+ export declare const PsScanViewfinderOverlay: ({ area, quad, video }: PsScanViewfinderOverlayProps) => import("react").JSX.Element | null;
@@ -0,0 +1,28 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PsScanViewfinderOverlay = void 0;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const ps_scan_config_1 = require("../constants/ps-scan-config");
6
+ const ps_scan_geometry_service_1 = require("../services/ps-scan-geometry-service");
7
+ const PsScanViewfinderOverlay = ({ area, quad, video }) => {
8
+ if (area.width <= 0 || area.height <= 0)
9
+ return null;
10
+ const box = ps_scan_geometry_service_1.PsScanGeometryService.cover(area, video);
11
+ const left = (area.width - box.width) / 2;
12
+ const top = (area.height - box.height) / 2;
13
+ const frameHeight = Math.min(area.height * ps_scan_config_1.PsScanConfig.guideHeightRatio, (area.width * ps_scan_config_1.PsScanConfig.guideWidthRatio) / ps_scan_config_1.PsScanConfig.guideAspect);
14
+ const frameWidth = frameHeight * ps_scan_config_1.PsScanConfig.guideAspect;
15
+ const frameLeft = (area.width - frameWidth) / 2;
16
+ const frameTop = (area.height - frameHeight) / 2 - area.height * ps_scan_config_1.PsScanConfig.guideLift;
17
+ const arm = Math.min(ps_scan_config_1.PsScanConfig.guideArm, frameWidth * ps_scan_config_1.PsScanConfig.guideArmRatio);
18
+ const corners = [
19
+ `M${frameLeft} ${frameTop + arm}V${frameTop}H${frameLeft + arm}`,
20
+ `M${frameLeft + frameWidth - arm} ${frameTop}H${frameLeft + frameWidth}V${frameTop + arm}`,
21
+ `M${frameLeft + frameWidth} ${frameTop + frameHeight - arm}V${frameTop + frameHeight}H${frameLeft + frameWidth - arm}`,
22
+ `M${frameLeft + arm} ${frameTop + frameHeight}H${frameLeft}V${frameTop + frameHeight - arm}`,
23
+ ].join('');
24
+ return ((0, jsx_runtime_1.jsx)("svg", { "aria-hidden": 'true', className: 'pointer-events-none absolute inset-0 size-full', viewBox: `0 0 ${area.width} ${area.height}`, children: quad === null || box.width === 0 ? ((0, jsx_runtime_1.jsx)("path", { className: 'stroke-white/75 animate-ps-fade-in', d: corners, fill: 'none', strokeLinecap: 'round', strokeLinejoin: 'round', strokeWidth: '4' })) : ((0, jsx_runtime_1.jsx)("polygon", { className: 'fill-primary/10 stroke-primary', points: quad
25
+ .map((point) => `${left + point.x * box.width},${top + point.y * box.height}`)
26
+ .join(' '), strokeLinejoin: 'round', strokeWidth: '3' })) }));
27
+ };
28
+ exports.PsScanViewfinderOverlay = PsScanViewfinderOverlay;
@@ -19,6 +19,6 @@ const PsUploadRow = ({ item, labels, onCancel, onRemove, onRetry }) => {
19
19
  : item.status === ps_upload_status_1.PsUploadStatus.failed && item.error
20
20
  ? item.error
21
21
  : labels[item.status];
22
- return ((0, jsx_runtime_1.jsxs)("li", { className: 'flex items-center gap-3 rounded-ps-control border border-line px-3 py-2.5', children: [(0, jsx_runtime_1.jsx)(ps_file_kind_icon_1.PsFileKindIcon, { contentType: item.file.type, name: item.file.name }), (0, jsx_runtime_1.jsxs)("div", { className: 'flex min-w-0 flex-1 flex-col gap-1.5', children: [(0, jsx_runtime_1.jsx)("p", { className: 'truncate text-sm font-medium text-ink', children: item.file.name }), (0, jsx_runtime_1.jsx)(ps_progress_bar_1.PsProgressBar, { label: item.file.name, tone: ps_upload_status_tones_1.PsUploadStatusTones[item.status], value: isProblem ? 1 : item.progress }), (0, jsx_runtime_1.jsxs)("p", { className: `truncate text-xs ${isProblem ? 'text-danger' : item.status === ps_upload_status_1.PsUploadStatus.done ? 'text-success' : 'text-ink/55'}`, role: item.status === ps_upload_status_1.PsUploadStatus.failed ? 'alert' : undefined, children: [size, " \u00B7 ", status] })] }), (0, jsx_runtime_1.jsxs)("div", { className: 'flex w-16 shrink-0 items-center justify-end gap-0.5', children: [isProblem ? ((0, jsx_runtime_1.jsx)(ps_file_icon_button_1.PsFileIconButton, { iconKey: ps_icons_1.PsIconKey.Refresh, label: `${labels.retry} ${item.file.name}`, onClick: onRetry })) : null, isActive ? ((0, jsx_runtime_1.jsx)(ps_file_icon_button_1.PsFileIconButton, { iconKey: ps_icons_1.PsIconKey.Close, label: `${labels.cancel} ${item.file.name}`, onClick: onCancel, tone: 'danger' })) : item.status === ps_upload_status_1.PsUploadStatus.done ? ((0, jsx_runtime_1.jsx)("span", { className: 'ps-control-square ps-control-compact inline-flex items-center justify-center text-success', children: (0, jsx_runtime_1.jsx)(ps_icons_1.PsIcon, { "aria-label": labels.done, className: 'h-4 w-4', iconKey: ps_icons_1.PsIconKey.Check }) })) : ((0, jsx_runtime_1.jsx)(ps_file_icon_button_1.PsFileIconButton, { iconKey: ps_icons_1.PsIconKey.Close, label: `${labels.remove} ${item.file.name}`, onClick: onRemove }))] })] }));
22
+ return ((0, jsx_runtime_1.jsxs)("li", { className: 'flex items-center gap-3 rounded-ps-control border border-line px-3 py-2.5', children: [(0, jsx_runtime_1.jsx)(ps_file_kind_icon_1.PsFileKindIcon, { contentType: item.file.type, name: item.file.name }), (0, jsx_runtime_1.jsxs)("div", { className: 'flex min-w-0 flex-1 flex-col gap-1.5', children: [(0, jsx_runtime_1.jsx)("p", { className: 'truncate text-sm font-medium text-ink', children: item.file.name }), (0, jsx_runtime_1.jsx)(ps_progress_bar_1.PsProgressBar, { label: item.file.name, tone: ps_upload_status_tones_1.PsUploadStatusTones[item.status], value: isProblem ? 1 : item.progress }), (0, jsx_runtime_1.jsxs)("p", { className: `truncate text-xs ${isProblem ? 'text-danger' : item.status === ps_upload_status_1.PsUploadStatus.done ? 'text-success' : 'text-ink/55'}`, role: item.status === ps_upload_status_1.PsUploadStatus.failed ? 'alert' : undefined, children: [size, " \u00B7 ", status] })] }), (0, jsx_runtime_1.jsxs)("div", { className: 'flex w-20 shrink-0 items-center justify-end gap-1', children: [isProblem ? ((0, jsx_runtime_1.jsx)(ps_file_icon_button_1.PsFileIconButton, { iconKey: ps_icons_1.PsIconKey.Refresh, label: `${labels.retry} ${item.file.name}`, onClick: onRetry })) : null, isActive ? ((0, jsx_runtime_1.jsx)(ps_file_icon_button_1.PsFileIconButton, { iconKey: ps_icons_1.PsIconKey.Close, label: `${labels.cancel} ${item.file.name}`, onClick: onCancel, tone: 'danger' })) : item.status === ps_upload_status_1.PsUploadStatus.done ? ((0, jsx_runtime_1.jsx)("span", { className: 'ps-control-square ps-control-compact inline-flex items-center justify-center text-success', children: (0, jsx_runtime_1.jsx)(ps_icons_1.PsIcon, { "aria-label": labels.done, className: 'h-4 w-4', iconKey: ps_icons_1.PsIconKey.Check }) })) : ((0, jsx_runtime_1.jsx)(ps_file_icon_button_1.PsFileIconButton, { iconKey: ps_icons_1.PsIconKey.Close, label: `${labels.remove} ${item.file.name}`, onClick: onRemove }))] })] }));
23
23
  };
24
24
  exports.PsUploadRow = PsUploadRow;
@@ -1,50 +1,51 @@
1
1
  export declare const PsDocumentScannerLabels: {
2
- readonly addPage: "Add page";
3
- readonly autoDetect: "Auto-detect edges";
4
- readonly cameraDenied: "Camera access was blocked. Allow it in your browser settings, or take a photo or choose existing photos instead.";
2
+ readonly allowCamera: "Allow camera";
3
+ readonly autoDetect: "Detect edges";
4
+ readonly busyBody: "Another app is using the camera. Close it, then try again.";
5
+ readonly busyTitle: "Your camera is busy";
5
6
  readonly cameraStarting: "Starting camera";
6
- readonly cameraUnavailable: "No camera is available here. Take a photo or choose existing photos instead.";
7
- readonly backToPages: "Back to pages";
8
- readonly capture: "Capture page";
9
- readonly choosePhotos: "Choose photos";
7
+ readonly capture: "Take photo";
8
+ readonly choosePhoto: "Choose a photo instead";
10
9
  readonly close: "Close scanner";
10
+ readonly continue: "Continue";
11
11
  readonly cornerBottomLeft: "Bottom left corner";
12
12
  readonly cornerBottomRight: "Bottom right corner";
13
13
  readonly cornerTopLeft: "Top left corner";
14
14
  readonly cornerTopRight: "Top right corner";
15
- readonly cropApply: "Use crop";
16
- readonly cropHint: "Drag the corners to fit the page, or use the arrow keys on a focused corner.";
17
- readonly cropTitle: "Adjust edges";
18
- readonly deletePage: "Delete page";
19
- readonly dragPage: "Drag {page} to reorder";
20
- readonly editCrop: "Edit edges";
15
+ readonly cropHint: "Drag the corners to the edges of the page.";
16
+ readonly cropTitle: "Adjust corners";
17
+ readonly deniedAndroid1: "Tap the icon to the left of the address bar.";
18
+ readonly deniedAndroid2: "Open Permissions, then Camera.";
19
+ readonly deniedAndroid3: "Choose Allow, then come back and tap Try again.";
20
+ readonly deniedBody: "You can turn it back on in a few taps.";
21
+ readonly deniedDesktop1: "Click the camera or site icon in the address bar.";
22
+ readonly deniedDesktop2: "Set Camera to Allow for this site.";
23
+ readonly deniedDesktop3: "Close the menu, then click Try again.";
24
+ readonly deniedIos1: "Tap aA in the address bar, then Website Settings.";
25
+ readonly deniedIos2: "Set Camera to Allow.";
26
+ readonly deniedIos3: "Come back and tap Try again.";
27
+ readonly deniedTitle: "Camera access is off";
21
28
  readonly edgesFound: "Page edges found.";
22
- readonly edgesNotFound: "Edges not found. Adjust the corners.";
23
- readonly filterColour: "Colour";
24
- readonly filterDocument: "Black and white";
25
- readonly filterGreyscale: "Greyscale";
26
- readonly filterOriginal: "Original";
27
- readonly filters: "Enhance";
28
- readonly finish: "Use scan";
29
- readonly finishing: "Preparing your scan";
30
- readonly maxPages: "You reached the page limit.";
31
- readonly moveDown: "Move {page} down";
32
- readonly moveUp: "Move {page} up";
33
- readonly page: "Page";
34
- readonly pageAdded: "Page {position} added.";
35
- readonly pageDeleted: "Page deleted.";
36
- readonly pageMoved: "{page} moved to position {position} of {count}.";
37
- readonly pages: "Pages";
29
+ readonly edgesNotFound: "Edges not found. Drag the corners to the page.";
30
+ readonly hintFind: "Point your camera at a document";
31
+ readonly hintFound: "Document found";
32
+ readonly insecureBody: "The camera only works on a secure (https) page. You can still choose a photo.";
33
+ readonly insecureTitle: "Camera not available here";
34
+ readonly platformAndroid: "Android";
35
+ readonly platformDesktop: "Computer";
36
+ readonly platformIos: "iPhone";
37
+ readonly preparing: "Preparing your scan";
38
+ readonly previewAlt: "Your flattened scan";
39
+ readonly previewTitle: "Your scan";
40
+ readonly primerBody: "The camera is only used while the scanner is open. Nothing is saved until you upload.";
41
+ readonly primerTitle: "Allow camera access to scan your documents";
38
42
  readonly processFailed: "The scan could not be prepared. Try again.";
39
- readonly reorderCancelled: "{page} stays where it was.";
40
- readonly reorderDropped: "{page} dropped at {position} of {count}.";
41
- readonly reorderInstructions: "Press space to lift a page, the arrow keys to move it and space to drop it.";
42
- readonly reorderLifted: "{page} lifted from {position} of {count}.";
43
- readonly reorderMoved: "{page} is now {position} of {count}.";
44
43
  readonly retake: "Retake";
45
- readonly rotate: "Rotate";
46
- readonly takePhoto: "Take photo";
47
44
  readonly title: "Scan document";
48
- readonly torchOff: "Turn light off";
49
- readonly torchOn: "Turn light on";
45
+ readonly torchOff: "Turn flash off";
46
+ readonly torchOn: "Turn flash on";
47
+ readonly tryAgain: "Try again";
48
+ readonly unavailableBody: "This device has no camera the browser can use. Choose a photo of the page instead.";
49
+ readonly unavailableTitle: "No camera found";
50
+ readonly useScan: "Use scan";
50
51
  };
@@ -2,52 +2,53 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.PsDocumentScannerLabels = void 0;
4
4
  exports.PsDocumentScannerLabels = {
5
- addPage: 'Add page',
6
- autoDetect: 'Auto-detect edges',
7
- cameraDenied: 'Camera access was blocked. Allow it in your browser settings, or take a photo or choose existing photos instead.',
5
+ allowCamera: 'Allow camera',
6
+ autoDetect: 'Detect edges',
7
+ busyBody: 'Another app is using the camera. Close it, then try again.',
8
+ busyTitle: 'Your camera is busy',
8
9
  cameraStarting: 'Starting camera',
9
- cameraUnavailable: 'No camera is available here. Take a photo or choose existing photos instead.',
10
- backToPages: 'Back to pages',
11
- capture: 'Capture page',
12
- choosePhotos: 'Choose photos',
10
+ capture: 'Take photo',
11
+ choosePhoto: 'Choose a photo instead',
13
12
  close: 'Close scanner',
13
+ continue: 'Continue',
14
14
  cornerBottomLeft: 'Bottom left corner',
15
15
  cornerBottomRight: 'Bottom right corner',
16
16
  cornerTopLeft: 'Top left corner',
17
17
  cornerTopRight: 'Top right corner',
18
- cropApply: 'Use crop',
19
- cropHint: 'Drag the corners to fit the page, or use the arrow keys on a focused corner.',
20
- cropTitle: 'Adjust edges',
21
- deletePage: 'Delete page',
22
- dragPage: 'Drag {page} to reorder',
23
- editCrop: 'Edit edges',
18
+ cropHint: 'Drag the corners to the edges of the page.',
19
+ cropTitle: 'Adjust corners',
20
+ deniedAndroid1: 'Tap the icon to the left of the address bar.',
21
+ deniedAndroid2: 'Open Permissions, then Camera.',
22
+ deniedAndroid3: 'Choose Allow, then come back and tap Try again.',
23
+ deniedBody: 'You can turn it back on in a few taps.',
24
+ deniedDesktop1: 'Click the camera or site icon in the address bar.',
25
+ deniedDesktop2: 'Set Camera to Allow for this site.',
26
+ deniedDesktop3: 'Close the menu, then click Try again.',
27
+ deniedIos1: 'Tap aA in the address bar, then Website Settings.',
28
+ deniedIos2: 'Set Camera to Allow.',
29
+ deniedIos3: 'Come back and tap Try again.',
30
+ deniedTitle: 'Camera access is off',
24
31
  edgesFound: 'Page edges found.',
25
- edgesNotFound: 'Edges not found. Adjust the corners.',
26
- filterColour: 'Colour',
27
- filterDocument: 'Black and white',
28
- filterGreyscale: 'Greyscale',
29
- filterOriginal: 'Original',
30
- filters: 'Enhance',
31
- finish: 'Use scan',
32
- finishing: 'Preparing your scan',
33
- maxPages: 'You reached the page limit.',
34
- moveDown: 'Move {page} down',
35
- moveUp: 'Move {page} up',
36
- page: 'Page',
37
- pageAdded: 'Page {position} added.',
38
- pageDeleted: 'Page deleted.',
39
- pageMoved: '{page} moved to position {position} of {count}.',
40
- pages: 'Pages',
32
+ edgesNotFound: 'Edges not found. Drag the corners to the page.',
33
+ hintFind: 'Point your camera at a document',
34
+ hintFound: 'Document found',
35
+ insecureBody: 'The camera only works on a secure (https) page. You can still choose a photo.',
36
+ insecureTitle: 'Camera not available here',
37
+ platformAndroid: 'Android',
38
+ platformDesktop: 'Computer',
39
+ platformIos: 'iPhone',
40
+ preparing: 'Preparing your scan',
41
+ previewAlt: 'Your flattened scan',
42
+ previewTitle: 'Your scan',
43
+ primerBody: 'The camera is only used while the scanner is open. Nothing is saved until you upload.',
44
+ primerTitle: 'Allow camera access to scan your documents',
41
45
  processFailed: 'The scan could not be prepared. Try again.',
42
- reorderCancelled: '{page} stays where it was.',
43
- reorderDropped: '{page} dropped at {position} of {count}.',
44
- reorderInstructions: 'Press space to lift a page, the arrow keys to move it and space to drop it.',
45
- reorderLifted: '{page} lifted from {position} of {count}.',
46
- reorderMoved: '{page} is now {position} of {count}.',
47
46
  retake: 'Retake',
48
- rotate: 'Rotate',
49
- takePhoto: 'Take photo',
50
47
  title: 'Scan document',
51
- torchOff: 'Turn light off',
52
- torchOn: 'Turn light on',
48
+ torchOff: 'Turn flash off',
49
+ torchOn: 'Turn flash on',
50
+ tryAgain: 'Try again',
51
+ unavailableBody: 'This device has no camera the browser can use. Choose a photo of the page instead.',
52
+ unavailableTitle: 'No camera found',
53
+ useScan: 'Use scan',
53
54
  };
@@ -1,8 +1,10 @@
1
1
  export declare const PsFilePickerLabels: {
2
- readonly browse: "or click to browse your files";
3
- readonly browseTouch: "or tap to choose from your device";
2
+ readonly choose: "Choose files";
3
+ readonly chooseOne: "Choose a file";
4
+ readonly dragHint: "Drag and drop files here";
5
+ readonly dragHintOne: "Drag and drop a file here";
4
6
  readonly dropActive: "Drop to upload";
5
- readonly formats: "Accepted formats:";
6
7
  readonly invalidType: "is not a supported file type.";
8
+ readonly scan: "Scan with camera";
7
9
  readonly tooLarge: "is too large.";
8
10
  };
@@ -2,10 +2,12 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.PsFilePickerLabels = void 0;
4
4
  exports.PsFilePickerLabels = {
5
- browse: 'or click to browse your files',
6
- browseTouch: 'or tap to choose from your device',
5
+ choose: 'Choose files',
6
+ chooseOne: 'Choose a file',
7
+ dragHint: 'Drag and drop files here',
8
+ dragHintOne: 'Drag and drop a file here',
7
9
  dropActive: 'Drop to upload',
8
- formats: 'Accepted formats:',
9
10
  invalidType: 'is not a supported file type.',
11
+ scan: 'Scan with camera',
10
12
  tooLarge: 'is too large.',
11
13
  };
@@ -1,5 +1,9 @@
1
1
  export declare const PsScanCameraStatus: {
2
+ readonly Busy: "busy";
3
+ readonly Checking: "checking";
2
4
  readonly Denied: "denied";
5
+ readonly Insecure: "insecure";
6
+ readonly Prompt: "prompt";
3
7
  readonly Ready: "ready";
4
8
  readonly Starting: "starting";
5
9
  readonly Unavailable: "unavailable";
@@ -2,7 +2,11 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.PsScanCameraStatus = void 0;
4
4
  exports.PsScanCameraStatus = {
5
+ Busy: 'busy',
6
+ Checking: 'checking',
5
7
  Denied: 'denied',
8
+ Insecure: 'insecure',
9
+ Prompt: 'prompt',
6
10
  Ready: 'ready',
7
11
  Starting: 'starting',
8
12
  Unavailable: 'unavailable',
@@ -0,0 +1,10 @@
1
+ export declare const PsScanChromeClasses: {
2
+ readonly button: "ps-focus-ring ps-control ps-control-padding inline-flex max-w-full items-center justify-center gap-2 rounded-ps-control border text-sm font-semibold leading-5 transition disabled:pointer-events-none disabled:opacity-40";
3
+ readonly buttonLarge: "ps-control-large ps-control-padding-large";
4
+ readonly buttonPrimary: "border-primary bg-primary text-[color:var(--ps-color-primary-contrast)] hover:border-primary-dark hover:bg-primary-dark";
5
+ readonly buttonQuiet: "border-white/15 bg-white/10 text-white hover:border-white/25 hover:bg-white/20";
6
+ readonly icon: "ps-focus-ring ps-control ps-control-square inline-flex shrink-0 items-center justify-center rounded-ps-control text-white transition disabled:pointer-events-none disabled:opacity-40";
7
+ readonly iconOff: "bg-black/45 backdrop-blur-md hover:bg-white/20";
8
+ readonly iconOn: "bg-white text-black hover:bg-white/90";
9
+ readonly pill: "pointer-events-none rounded-ps-pill bg-black/55 px-3.5 py-1.5 text-sm font-medium text-white backdrop-blur-md";
10
+ };
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PsScanChromeClasses = void 0;
4
+ exports.PsScanChromeClasses = {
5
+ button: 'ps-focus-ring ps-control ps-control-padding inline-flex max-w-full items-center justify-center gap-2 rounded-ps-control border text-sm font-semibold leading-5 transition disabled:pointer-events-none disabled:opacity-40',
6
+ buttonLarge: 'ps-control-large ps-control-padding-large',
7
+ buttonPrimary: 'border-primary bg-primary text-[color:var(--ps-color-primary-contrast)] hover:border-primary-dark hover:bg-primary-dark',
8
+ buttonQuiet: 'border-white/15 bg-white/10 text-white hover:border-white/25 hover:bg-white/20',
9
+ icon: 'ps-focus-ring ps-control ps-control-square inline-flex shrink-0 items-center justify-center rounded-ps-control text-white transition disabled:pointer-events-none disabled:opacity-40',
10
+ iconOff: 'bg-black/45 backdrop-blur-md hover:bg-white/20',
11
+ iconOn: 'bg-white text-black hover:bg-white/90',
12
+ pill: 'pointer-events-none rounded-ps-pill bg-black/55 px-3.5 py-1.5 text-sm font-medium text-white backdrop-blur-md',
13
+ };