@pallasoft/ps-mobile-components 1.6.0 → 1.8.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 (121) hide show
  1. package/dist/components/ps-accessibility-gate/index.d.ts +2 -0
  2. package/dist/components/ps-accessibility-gate/index.js +2 -0
  3. package/dist/components/ps-accessibility-gate/ps-accessibility-gate-props.d.ts +5 -0
  4. package/dist/components/ps-accessibility-gate/ps-accessibility-gate-props.js +1 -0
  5. package/dist/components/ps-accessibility-gate/ps-accessibility-gate.d.ts +2 -0
  6. package/dist/components/ps-accessibility-gate/ps-accessibility-gate.js +4 -0
  7. package/dist/components/ps-app-lock-screen/ps-app-lock-screen.js +1 -1
  8. package/dist/components/ps-cartesian-chart/ps-cartesian-chart.d.ts +1 -1
  9. package/dist/components/ps-cartesian-chart/ps-cartesian-chart.js +25 -17
  10. package/dist/components/ps-chart-empty-state/ps-chart-empty-state.js +5 -1
  11. package/dist/components/ps-chart-frame/ps-chart-frame.js +10 -1
  12. package/dist/components/ps-chart-legend/ps-chart-legend.js +11 -2
  13. package/dist/components/ps-chart-readout/ps-chart-readout-props.d.ts +1 -0
  14. package/dist/components/ps-chart-readout/ps-chart-readout.d.ts +1 -1
  15. package/dist/components/ps-chart-readout/ps-chart-readout.js +8 -2
  16. package/dist/components/ps-chart-skeleton/ps-chart-skeleton.d.ts +1 -1
  17. package/dist/components/ps-chart-skeleton/ps-chart-skeleton.js +5 -1
  18. package/dist/components/ps-donut-chart/ps-donut-chart.js +23 -5
  19. package/dist/components/ps-kpi-card/ps-kpi-card.js +4 -1
  20. package/dist/components/ps-list/ps-list-select-row.js +8 -4
  21. package/dist/components/ps-menu-popup/ps-menu-popup-divider.js +8 -2
  22. package/dist/components/ps-menu-popup/ps-menu-popup-row.js +21 -9
  23. package/dist/components/ps-menu-popup/ps-menu-popup.js +28 -17
  24. package/dist/components/ps-privacy-cover/ps-privacy-cover-props.d.ts +1 -0
  25. package/dist/components/ps-privacy-cover/ps-privacy-cover.d.ts +1 -1
  26. package/dist/components/ps-privacy-cover/ps-privacy-cover.js +12 -3
  27. package/dist/components/ps-sortable-grid/ps-sortable-grid.js +8 -4
  28. package/dist/components/ps-sortable-grid/ps-sortable-item-props.d.ts +1 -0
  29. package/dist/components/ps-sortable-grid/ps-sortable-item.d.ts +1 -1
  30. package/dist/components/ps-sortable-grid/ps-sortable-item.js +3 -2
  31. package/dist/components/ps-sparkline/ps-sparkline.d.ts +1 -1
  32. package/dist/components/ps-sparkline/ps-sparkline.js +3 -1
  33. package/dist/components/ps-waterfall-chart/ps-waterfall-chart.d.ts +1 -1
  34. package/dist/components/ps-waterfall-chart/ps-waterfall-chart.js +15 -9
  35. package/dist/constants/ps-accessibility-config.d.ts +5 -0
  36. package/dist/constants/ps-accessibility-config.js +5 -0
  37. package/dist/constants/ps-chart-config.d.ts +26 -1
  38. package/dist/constants/ps-chart-config.js +26 -1
  39. package/dist/constants/ps-material-menu-config.d.ts +12 -0
  40. package/dist/constants/ps-material-menu-config.js +12 -0
  41. package/dist/constants/ps-scan-format.d.ts +4 -0
  42. package/dist/constants/ps-scan-format.js +5 -0
  43. package/dist/constants/ps-scan-output-config.d.ts +17 -0
  44. package/dist/constants/ps-scan-output-config.js +23 -0
  45. package/dist/constants/ps-screen-capture-config.d.ts +4 -0
  46. package/dist/constants/ps-screen-capture-config.js +4 -0
  47. package/dist/contexts/ps-widget-fill-context.d.ts +1 -0
  48. package/dist/contexts/ps-widget-fill-context.js +2 -0
  49. package/dist/hooks/use-ps-document-scanner.js +3 -2
  50. package/dist/hooks/use-ps-menu-popup-reveal.d.ts +3 -0
  51. package/dist/hooks/use-ps-menu-popup-reveal.js +28 -0
  52. package/dist/hooks/use-ps-screen-capture-prevention.d.ts +2 -0
  53. package/dist/hooks/use-ps-screen-capture-prevention.js +12 -0
  54. package/dist/hooks/use-ps-widget-fill.d.ts +1 -0
  55. package/dist/hooks/use-ps-widget-fill.js +3 -0
  56. package/dist/index.d.ts +6 -0
  57. package/dist/index.js +6 -0
  58. package/dist/interfaces/ps-capture-options.d.ts +2 -0
  59. package/dist/interfaces/ps-chart-bar-group.d.ts +4 -0
  60. package/dist/interfaces/ps-chart-bar-group.js +1 -0
  61. package/dist/interfaces/ps-chart-x-labels.d.ts +4 -0
  62. package/dist/interfaces/ps-chart-x-labels.js +1 -0
  63. package/dist/interfaces/ps-document-scanner-options.d.ts +2 -0
  64. package/dist/interfaces/ps-donut-chart-layout.d.ts +4 -0
  65. package/dist/interfaces/ps-donut-chart-layout.js +1 -0
  66. package/dist/interfaces/ps-image-manipulator-native.d.ts +19 -0
  67. package/dist/interfaces/ps-image-manipulator-native.js +1 -0
  68. package/dist/interfaces/ps-menu-popup-container-style.d.ts +8 -0
  69. package/dist/interfaces/ps-menu-popup-container-style.js +1 -0
  70. package/dist/interfaces/ps-menu-popup-divider-style.d.ts +4 -0
  71. package/dist/interfaces/ps-menu-popup-divider-style.js +1 -0
  72. package/dist/interfaces/ps-menu-popup-layout.d.ts +1 -0
  73. package/dist/interfaces/ps-menu-popup-row-style.d.ts +6 -0
  74. package/dist/interfaces/ps-menu-popup-row-style.js +1 -0
  75. package/dist/interfaces/ps-menu-popup-size.d.ts +4 -0
  76. package/dist/interfaces/ps-menu-popup-size.js +1 -0
  77. package/dist/interfaces/ps-page-size.d.ts +4 -0
  78. package/dist/interfaces/ps-page-size.js +1 -0
  79. package/dist/interfaces/ps-pdf-page.d.ts +5 -0
  80. package/dist/interfaces/ps-pdf-page.js +1 -0
  81. package/dist/interfaces/ps-scan-format-labels.d.ts +7 -0
  82. package/dist/interfaces/ps-scan-format-labels.js +1 -0
  83. package/dist/interfaces/ps-screen-capture-native.d.ts +4 -0
  84. package/dist/interfaces/ps-screen-capture-native.js +1 -0
  85. package/dist/interfaces/use-ps-screen-capture-prevention-options.d.ts +3 -0
  86. package/dist/interfaces/use-ps-screen-capture-prevention-options.js +1 -0
  87. package/dist/services/ps-capture-picker-service.js +1 -0
  88. package/dist/services/ps-chart-axis-service.d.ts +5 -0
  89. package/dist/services/ps-chart-axis-service.js +32 -0
  90. package/dist/services/ps-chart-bar-service.d.ts +2 -0
  91. package/dist/services/ps-chart-bar-service.js +11 -4
  92. package/dist/services/ps-chart-donut-service.d.ts +3 -0
  93. package/dist/services/ps-chart-donut-service.js +11 -0
  94. package/dist/services/ps-chart-readout-service.d.ts +3 -0
  95. package/dist/services/ps-chart-readout-service.js +25 -0
  96. package/dist/services/ps-chart-scale-service.d.ts +1 -1
  97. package/dist/services/ps-chart-scale-service.js +2 -2
  98. package/dist/services/ps-chart-text-service.d.ts +6 -0
  99. package/dist/services/ps-chart-text-service.js +23 -0
  100. package/dist/services/ps-document-scanner-service.d.ts +2 -0
  101. package/dist/services/ps-document-scanner-service.js +21 -4
  102. package/dist/services/ps-jpeg-size-service.d.ts +4 -0
  103. package/dist/services/ps-jpeg-size-service.js +32 -0
  104. package/dist/services/ps-menu-popup-service.js +1 -0
  105. package/dist/services/ps-menu-popup-style-service.d.ts +13 -0
  106. package/dist/services/ps-menu-popup-style-service.js +55 -0
  107. package/dist/services/ps-scan-format-prompt-service.d.ts +6 -0
  108. package/dist/services/ps-scan-format-prompt-service.js +21 -0
  109. package/dist/services/ps-scan-image-converter-service.d.ts +5 -0
  110. package/dist/services/ps-scan-image-converter-service.js +22 -0
  111. package/dist/services/ps-scan-output-service.d.ts +10 -0
  112. package/dist/services/ps-scan-output-service.js +55 -0
  113. package/dist/services/ps-scan-pdf-service.d.ts +4 -0
  114. package/dist/services/ps-scan-pdf-service.js +6 -0
  115. package/dist/services/ps-screen-capture-service.d.ts +6 -0
  116. package/dist/services/ps-screen-capture-service.js +35 -0
  117. package/dist/services/ps-sortable-grid-service.d.ts +2 -0
  118. package/dist/services/ps-sortable-grid-service.js +10 -3
  119. package/dist/services/ps-waterfall-service.js +2 -3
  120. package/jest-setup.js +1 -1
  121. package/package.json +10 -2
@@ -1,2 +1,2 @@
1
1
  import type { PsSparklineProps } from './ps-sparkline-props';
2
- export declare const PsSparkline: ({ color, height, isLoading, showArea, values, }: PsSparklineProps) => import("react").JSX.Element;
2
+ export declare const PsSparkline: ({ color, height: baseHeight, isLoading, showArea, values, }: PsSparklineProps) => import("react").JSX.Element;
@@ -6,11 +6,13 @@ import { PsChartSkeletonVariant } from '../../constants/ps-chart-skeleton-varian
6
6
  import { usePsChartReveal } from '../../hooks/use-ps-chart-reveal';
7
7
  import { usePsChartWidth } from '../../hooks/use-ps-chart-width';
8
8
  import { usePsMobileTheme } from '../../hooks/use-ps-mobile-theme';
9
+ import { usePsWidgetFill } from '../../hooks/use-ps-widget-fill';
9
10
  import { PsChartScaleService } from '../../services/ps-chart-scale-service';
10
11
  import { PsChartLine } from '../ps-chart-line/ps-chart-line';
11
12
  import { PsChartSkeleton } from '../ps-chart-skeleton/ps-chart-skeleton';
12
- export const PsSparkline = ({ color, height = PsChartConfig.sparklineHeight, isLoading = false, showArea = true, values, }) => {
13
+ export const PsSparkline = ({ color, height: baseHeight = PsChartConfig.sparklineHeight, isLoading = false, showArea = true, values, }) => {
13
14
  const theme = usePsMobileTheme();
15
+ const height = baseHeight + usePsWidgetFill();
14
16
  const { onLayout, width } = usePsChartWidth();
15
17
  const progress = usePsChartReveal(values.join(','));
16
18
  if (isLoading)
@@ -1,2 +1,2 @@
1
1
  import type { PsWaterfallChartProps } from './ps-waterfall-chart-props';
2
- export declare const PsWaterfallChart: ({ data, emptyLabel, formatTick, formatValue, height, isLoading, }: PsWaterfallChartProps) => import("react").JSX.Element;
2
+ export declare const PsWaterfallChart: ({ data, emptyLabel, formatTick, formatValue, height: baseHeight, isLoading, }: PsWaterfallChartProps) => import("react").JSX.Element;
@@ -7,31 +7,37 @@ import { usePsChartReveal } from '../../hooks/use-ps-chart-reveal';
7
7
  import { usePsChartScrub } from '../../hooks/use-ps-chart-scrub';
8
8
  import { usePsChartWidth } from '../../hooks/use-ps-chart-width';
9
9
  import { usePsMobileTheme } from '../../hooks/use-ps-mobile-theme';
10
+ import { usePsWidgetFill } from '../../hooks/use-ps-widget-fill';
11
+ import { PsChartAxisService } from '../../services/ps-chart-axis-service';
10
12
  import { PsChartScaleService } from '../../services/ps-chart-scale-service';
13
+ import { PsChartTextService } from '../../services/ps-chart-text-service';
11
14
  import { PsWaterfallService } from '../../services/ps-waterfall-service';
12
15
  import { PsChartBar } from '../ps-chart-bar/ps-chart-bar';
13
16
  import { PsChartEmptyState } from '../ps-chart-empty-state/ps-chart-empty-state';
14
17
  import { PsChartReadout } from '../ps-chart-readout/ps-chart-readout';
15
18
  import { PsChartSkeleton } from '../ps-chart-skeleton/ps-chart-skeleton';
16
- export const PsWaterfallChart = ({ data, emptyLabel, formatTick, formatValue, height = PsChartConfig.chartHeight, isLoading = false, }) => {
19
+ export const PsWaterfallChart = ({ data, emptyLabel, formatTick, formatValue, height: baseHeight = PsChartConfig.chartHeight, isLoading = false, }) => {
17
20
  const theme = usePsMobileTheme();
18
21
  const { onLayout, width } = usePsChartWidth();
19
- const plot = PsChartScaleService.plot(width, height);
20
- const { index, panHandlers } = usePsChartScrub(data.length, true, plot);
22
+ const height = baseHeight + usePsWidgetFill();
21
23
  const steps = PsWaterfallService.steps(data);
24
+ const domain = PsChartScaleService.domain(PsWaterfallService.values(steps));
25
+ const tickLabels = PsChartScaleService.ticks(domain).map((tick) => formatTick(tick));
26
+ const plot = PsChartScaleService.plot(width, height, PsChartAxisService.yAxisWidth(tickLabels, width));
27
+ const { index, panHandlers } = usePsChartScrub(data.length, true, plot);
22
28
  const progress = usePsChartReveal(`waterfall:${PsWaterfallService.values(steps).join(',')}`);
23
29
  if (isLoading)
24
- return _jsx(PsChartSkeleton, { height: height, variant: PsChartSkeletonVariant.Bars });
30
+ return _jsx(PsChartSkeleton, { height: baseHeight, variant: PsChartSkeletonVariant.Bars });
25
31
  if (steps.length === 0 || PsWaterfallService.values(steps).every((value) => value === 0))
26
- return _jsx(PsChartEmptyState, { height: height, label: emptyLabel });
32
+ return _jsx(PsChartEmptyState, { height: baseHeight, label: emptyLabel });
27
33
  const colors = [theme.chart[0], theme.danger, theme.primary700];
28
- const domain = PsChartScaleService.domain(PsWaterfallService.values(steps));
34
+ const xLabels = PsChartAxisService.xLabels(steps.map((entry) => entry.label), plot.right - plot.left, true);
29
35
  const selected = index === null ? steps.length - 1 : index;
30
36
  const step = steps[selected];
31
37
  const rects = PsWaterfallService.rects(steps, colors, domain, plot);
32
38
  const color = step.isTotal ? colors[2] : step.value < 0 ? colors[1] : colors[0];
33
- return (_jsxs(View, { style: { gap: 8 }, children: [_jsx(PsChartReadout, { items: [{ color, label: step.label, value: formatValue(step.value) }], title: step.label }), _jsx(View, { accessible: true, accessibilityLabel: `${step.label}, ${formatValue(step.value)}`, accessibilityRole: 'image', onLayout: onLayout, style: { height }, children: width === 0 ? null : (_jsxs(_Fragment, { children: [_jsxs(Svg, { height: height, pointerEvents: 'none', width: width, children: [PsChartScaleService.ticks(domain).map((tick) => {
39
+ return (_jsxs(View, { style: { gap: 8 }, children: [_jsx(PsChartReadout, { items: [{ color, label: step.label, value: formatValue(step.value) }], title: step.label }), _jsx(View, { accessible: true, accessibilityLabel: `${step.label}, ${formatValue(step.value)}`, accessibilityRole: 'image', onLayout: onLayout, style: { height }, children: width === 0 ? null : (_jsxs(_Fragment, { children: [_jsxs(Svg, { height: height, pointerEvents: 'none', width: width, children: [PsChartScaleService.ticks(domain).map((tick, tickIndex) => {
34
40
  const y = PsChartScaleService.y(tick, domain, plot);
35
- return (_jsxs(G, { children: [_jsx(Line, { stroke: theme.line, strokeWidth: PsChartConfig.gridLineWidth, x1: plot.left, x2: plot.right, y1: y, y2: y }), _jsx(SvgText, { fill: theme.muted, fontFamily: theme.fonts.medium, fontSize: PsChartConfig.axisLabelSize, textAnchor: 'end', x: plot.left - 6, y: y + 3, children: formatTick(tick) })] }, tick));
36
- }), steps.map((entry, position) => (_jsx(SvgText, { fill: theme.muted, fontFamily: theme.fonts.medium, fontSize: PsChartConfig.axisLabelSize, textAnchor: 'middle', x: PsChartScaleService.categoryX(position, steps.length, plot, true), y: height - 6, children: entry.label }, entry.label))), rects.map((rect) => (_jsx(PsChartBar, { progress: progress, rect: rect }, rect.id)))] }), _jsx(View, { ...panHandlers, style: StyleSheet.absoluteFill, testID: 'ps-chart-touch' })] })) })] }));
41
+ return (_jsxs(G, { children: [_jsx(Line, { stroke: theme.line, strokeWidth: PsChartConfig.gridLineWidth, x1: plot.left, x2: plot.right, y1: y, y2: y }), _jsx(SvgText, { fill: theme.muted, fontFamily: theme.fonts.medium, fontSize: PsChartConfig.axisLabelSize, textAnchor: 'end', x: plot.left - PsChartConfig.axisTickGap, y: y + PsChartConfig.axisLabelSize / 3, children: PsChartTextService.fit(tickLabels[tickIndex], plot.left - PsChartConfig.axisTickGap, PsChartConfig.axisLabelSize) })] }, tick));
42
+ }), xLabels.indexes.map((position) => (_jsx(SvgText, { fill: theme.muted, fontFamily: theme.fonts.medium, fontSize: PsChartConfig.axisLabelSize, textAnchor: 'middle', x: PsChartScaleService.categoryX(position, steps.length, plot, true), y: height - 6, children: PsChartTextService.fit(steps[position].label, xLabels.maxWidth, PsChartConfig.axisLabelSize) }, steps[position].label))), rects.map((rect) => (_jsx(PsChartBar, { progress: progress, rect: rect }, rect.id)))] }), _jsx(View, { ...panHandlers, style: StyleSheet.absoluteFill, testID: 'ps-chart-touch' })] })) })] }));
37
43
  };
@@ -0,0 +1,5 @@
1
+ export declare const PsAccessibilityConfig: {
2
+ readonly focusEvent: "focus";
3
+ readonly hiddenImportance: "no-hide-descendants";
4
+ readonly visibleImportance: "auto";
5
+ };
@@ -0,0 +1,5 @@
1
+ export const PsAccessibilityConfig = {
2
+ focusEvent: 'focus',
3
+ hiddenImportance: 'no-hide-descendants',
4
+ visibleImportance: 'auto',
5
+ };
@@ -1,31 +1,56 @@
1
1
  export declare const PsChartConfig: {
2
2
  readonly areaOpacity: 0.18;
3
- readonly axisLabelSize: 10;
3
+ readonly axisLabelGap: 8;
4
+ readonly axisLabelMaxWidth: 48;
5
+ readonly axisLabelSize: 11;
6
+ readonly axisTickGap: 6;
4
7
  readonly barGapRatio: 0.3;
5
8
  readonly barRadius: 4;
9
+ readonly charWidthRatio: 0.62;
10
+ readonly compactBarGapRatio: 0.15;
11
+ readonly compactSlot: 24;
6
12
  readonly cardPadding: 16;
7
13
  readonly cardRadius: 16;
8
14
  readonly chartHeight: 180;
9
15
  readonly deltaIconSize: 10;
10
16
  readonly donutHeight: 160;
11
17
  readonly donutThickness: 22;
18
+ readonly donutCenterFontMax: 18;
19
+ readonly donutCenterFontMin: 11;
20
+ readonly donutCenterPadding: 8;
21
+ readonly donutGap: 16;
22
+ readonly donutMinLegendWidth: 120;
12
23
  readonly donutSliceGap: 2;
13
24
  readonly drawMs: 700;
25
+ readonly ellipsis: "…";
14
26
  readonly gridLineCount: 3;
15
27
  readonly gridLineWidth: 1;
28
+ readonly kpiDeltaHeight: 20;
16
29
  readonly kpiGap: 12;
30
+ readonly kpiPeriodHeight: 16;
31
+ readonly kpiValueFontMax: 24;
32
+ readonly kpiValueFontMin: 16;
33
+ readonly legendHitSlop: 8;
17
34
  readonly legendDot: 8;
18
35
  readonly lineWidth: 2.5;
19
36
  readonly markerRadius: 4;
37
+ readonly minBarWidth: 4;
20
38
  readonly maxXLabels: 4;
39
+ readonly minXLabels: 2;
21
40
  readonly paddingBottom: 22;
22
41
  readonly paddingRight: 8;
23
42
  readonly paddingTop: 8;
24
43
  readonly readoutHeight: 40;
44
+ readonly readoutItemGap: 12;
45
+ readonly readoutLineHeight: 22;
46
+ readonly readoutRowGap: 2;
47
+ readonly readoutValueSize: 15;
25
48
  readonly scrubLineWidth: 1;
26
49
  readonly skeletonBarHeights: readonly [0.45, 0.7, 0.55, 0.85, 0.65, 0.95, 0.75];
27
50
  readonly skeletonPulseMs: 900;
28
51
  readonly sparklineHeight: 40;
29
52
  readonly sparklineWidth: 2;
53
+ readonly yAxisMaxRatio: 0.35;
54
+ readonly yAxisMinWidth: 28;
30
55
  readonly yAxisWidth: 52;
31
56
  };
@@ -1,31 +1,56 @@
1
1
  export const PsChartConfig = {
2
2
  areaOpacity: 0.18,
3
- axisLabelSize: 10,
3
+ axisLabelGap: 8,
4
+ axisLabelMaxWidth: 48,
5
+ axisLabelSize: 11,
6
+ axisTickGap: 6,
4
7
  barGapRatio: 0.3,
5
8
  barRadius: 4,
9
+ charWidthRatio: 0.62,
10
+ compactBarGapRatio: 0.15,
11
+ compactSlot: 24,
6
12
  cardPadding: 16,
7
13
  cardRadius: 16,
8
14
  chartHeight: 180,
9
15
  deltaIconSize: 10,
10
16
  donutHeight: 160,
11
17
  donutThickness: 22,
18
+ donutCenterFontMax: 18,
19
+ donutCenterFontMin: 11,
20
+ donutCenterPadding: 8,
21
+ donutGap: 16,
22
+ donutMinLegendWidth: 120,
12
23
  donutSliceGap: 2,
13
24
  drawMs: 700,
25
+ ellipsis: '…',
14
26
  gridLineCount: 3,
15
27
  gridLineWidth: 1,
28
+ kpiDeltaHeight: 20,
16
29
  kpiGap: 12,
30
+ kpiPeriodHeight: 16,
31
+ kpiValueFontMax: 24,
32
+ kpiValueFontMin: 16,
33
+ legendHitSlop: 8,
17
34
  legendDot: 8,
18
35
  lineWidth: 2.5,
19
36
  markerRadius: 4,
37
+ minBarWidth: 4,
20
38
  maxXLabels: 4,
39
+ minXLabels: 2,
21
40
  paddingBottom: 22,
22
41
  paddingRight: 8,
23
42
  paddingTop: 8,
24
43
  readoutHeight: 40,
44
+ readoutItemGap: 12,
45
+ readoutLineHeight: 22,
46
+ readoutRowGap: 2,
47
+ readoutValueSize: 15,
25
48
  scrubLineWidth: 1,
26
49
  skeletonBarHeights: [0.45, 0.7, 0.55, 0.85, 0.65, 0.95, 0.75],
27
50
  skeletonPulseMs: 900,
28
51
  sparklineHeight: 40,
29
52
  sparklineWidth: 2,
53
+ yAxisMaxRatio: 0.35,
54
+ yAxisMinWidth: 28,
30
55
  yAxisWidth: 52,
31
56
  };
@@ -0,0 +1,12 @@
1
+ export declare const PsMaterialMenuConfig: {
2
+ readonly dividerInset: 8;
3
+ readonly elevation: 3;
4
+ readonly enterEasing: readonly [0.05, 0.7, 0.1, 1];
5
+ readonly enterDurationMs: 150;
6
+ readonly enterScale: 0.8;
7
+ readonly itemInset: 4;
8
+ readonly itemRadius: 12;
9
+ readonly paddingVertical: 4;
10
+ readonly radius: 16;
11
+ readonly rowPaddingHorizontal: 12;
12
+ };
@@ -0,0 +1,12 @@
1
+ export const PsMaterialMenuConfig = {
2
+ dividerInset: 8,
3
+ elevation: 3,
4
+ enterEasing: [0.05, 0.7, 0.1, 1],
5
+ enterDurationMs: 150,
6
+ enterScale: 0.8,
7
+ itemInset: 4,
8
+ itemRadius: 12,
9
+ paddingVertical: 4,
10
+ radius: 16,
11
+ rowPaddingHorizontal: 12,
12
+ };
@@ -0,0 +1,4 @@
1
+ export declare enum PsScanFormat {
2
+ Pdf = "pdf",
3
+ Png = "png"
4
+ }
@@ -0,0 +1,5 @@
1
+ export var PsScanFormat;
2
+ (function (PsScanFormat) {
3
+ PsScanFormat["Pdf"] = "pdf";
4
+ PsScanFormat["Png"] = "png";
5
+ })(PsScanFormat || (PsScanFormat = {}));
@@ -0,0 +1,17 @@
1
+ import { PsScanFormat } from './ps-scan-format';
2
+ export declare const PsScanOutputConfig: {
3
+ readonly extensions: Record<PsScanFormat, string>;
4
+ readonly jpegMarkerPrefix: 255;
5
+ readonly jpegSizeMarkers: readonly [192, 193, 194, 195, 197, 198, 199, 201, 202, 203, 205, 206, 207];
6
+ readonly jpegStartMarker: 216;
7
+ readonly jpegSegmentHeaderLength: 2;
8
+ readonly jpegSizeOffset: 3;
9
+ readonly pdfBinaryComment: readonly [37, 226, 227, 207, 211, 10];
10
+ readonly pdfLongEdgePoints: 842;
11
+ readonly pdfObjectsPerPage: 3;
12
+ readonly pdfPageObjectBase: 3;
13
+ readonly pdfType: "application/pdf";
14
+ readonly pngType: "image/png";
15
+ readonly promptDelayMs: 400;
16
+ readonly types: Record<PsScanFormat, string>;
17
+ };
@@ -0,0 +1,23 @@
1
+ import { PsScanFormat } from './ps-scan-format';
2
+ export const PsScanOutputConfig = {
3
+ extensions: {
4
+ [PsScanFormat.Pdf]: 'pdf',
5
+ [PsScanFormat.Png]: 'png',
6
+ },
7
+ jpegMarkerPrefix: 0xff,
8
+ jpegSizeMarkers: [0xc0, 0xc1, 0xc2, 0xc3, 0xc5, 0xc6, 0xc7, 0xc9, 0xca, 0xcb, 0xcd, 0xce, 0xcf],
9
+ jpegStartMarker: 0xd8,
10
+ jpegSegmentHeaderLength: 2,
11
+ jpegSizeOffset: 3,
12
+ pdfBinaryComment: [0x25, 0xe2, 0xe3, 0xcf, 0xd3, 0x0a],
13
+ pdfLongEdgePoints: 842,
14
+ pdfObjectsPerPage: 3,
15
+ pdfPageObjectBase: 3,
16
+ pdfType: 'application/pdf',
17
+ pngType: 'image/png',
18
+ promptDelayMs: 400,
19
+ types: {
20
+ [PsScanFormat.Pdf]: 'application/pdf',
21
+ [PsScanFormat.Png]: 'image/png',
22
+ },
23
+ };
@@ -0,0 +1,4 @@
1
+ export declare const PsScreenCaptureConfig: {
2
+ readonly key: "ps-mobile-components";
3
+ readonly moduleName: "expo-screen-capture";
4
+ };
@@ -0,0 +1,4 @@
1
+ export const PsScreenCaptureConfig = {
2
+ key: 'ps-mobile-components',
3
+ moduleName: 'expo-screen-capture',
4
+ };
@@ -0,0 +1 @@
1
+ export declare const PsWidgetFillContext: import("react").Context<number>;
@@ -0,0 +1,2 @@
1
+ import { createContext } from 'react';
2
+ export const PsWidgetFillContext = createContext(0);
@@ -3,12 +3,13 @@ import { PsDocumentScannerService } from '../services/ps-document-scanner-servic
3
3
  export const usePsDocumentScanner = (defaults = {}) => {
4
4
  const [isScanning, setIsScanning] = useState(false);
5
5
  const isAvailable = useMemo(() => PsDocumentScannerService.isAvailable(), []);
6
- const { fileName, jpegQuality, maxPages } = defaults;
6
+ const { fileName, formatLabels, jpegQuality, maxPages } = defaults;
7
7
  const scan = useCallback(async (options = {}) => {
8
8
  setIsScanning(true);
9
9
  try {
10
10
  return await PsDocumentScannerService.scan({
11
11
  fileName: options.fileName === undefined ? fileName : options.fileName,
12
+ formatLabels: options.formatLabels === undefined ? formatLabels : options.formatLabels,
12
13
  jpegQuality: options.jpegQuality === undefined ? jpegQuality : options.jpegQuality,
13
14
  maxPages: options.maxPages === undefined ? maxPages : options.maxPages,
14
15
  });
@@ -16,6 +17,6 @@ export const usePsDocumentScanner = (defaults = {}) => {
16
17
  finally {
17
18
  setIsScanning(false);
18
19
  }
19
- }, [fileName, jpegQuality, maxPages]);
20
+ }, [fileName, formatLabels, jpegQuality, maxPages]);
20
21
  return { isAvailable, isScanning, scan };
21
22
  };
@@ -0,0 +1,3 @@
1
+ import type { ViewStyle } from 'react-native';
2
+ import { type AnimatedStyle } from 'react-native-reanimated';
3
+ export declare const usePsMenuPopupReveal: (isPlaced: boolean, isBelow: boolean, isMaterial: boolean) => AnimatedStyle<ViewStyle>;
@@ -0,0 +1,28 @@
1
+ import { useEffect } from 'react';
2
+ import { Easing, interpolate, useAnimatedStyle, useSharedValue, withTiming, } from 'react-native-reanimated';
3
+ import { PsMaterialMenuConfig } from '../constants/ps-material-menu-config';
4
+ import { usePsMobileTheme } from './use-ps-mobile-theme';
5
+ export const usePsMenuPopupReveal = (isPlaced, isBelow, isMaterial) => {
6
+ const { isReduceMotion } = usePsMobileTheme();
7
+ const isInstant = isReduceMotion || !isMaterial;
8
+ const progress = useSharedValue(isInstant ? 1 : 0);
9
+ useEffect(() => {
10
+ if (!isPlaced)
11
+ return;
12
+ if (isInstant) {
13
+ progress.set(1);
14
+ return;
15
+ }
16
+ progress.set(withTiming(1, {
17
+ duration: PsMaterialMenuConfig.enterDurationMs,
18
+ easing: Easing.bezier(...PsMaterialMenuConfig.enterEasing),
19
+ }));
20
+ }, [isInstant, isPlaced, progress]);
21
+ return useAnimatedStyle(() => ({
22
+ opacity: isPlaced ? progress.get() : 0,
23
+ transform: [
24
+ { scaleY: interpolate(progress.get(), [0, 1], [PsMaterialMenuConfig.enterScale, 1]) },
25
+ ],
26
+ transformOrigin: isBelow ? 'top' : 'bottom',
27
+ }));
28
+ };
@@ -0,0 +1,2 @@
1
+ import type { UsePsScreenCapturePreventionOptions } from '../interfaces/use-ps-screen-capture-prevention-options';
2
+ export declare const usePsScreenCapturePrevention: ({ isEnabled, }?: UsePsScreenCapturePreventionOptions) => void;
@@ -0,0 +1,12 @@
1
+ import { useEffect } from 'react';
2
+ import { PsScreenCaptureService } from '../services/ps-screen-capture-service';
3
+ export const usePsScreenCapturePrevention = ({ isEnabled = true, } = {}) => {
4
+ useEffect(() => {
5
+ if (!isEnabled)
6
+ return;
7
+ void PsScreenCaptureService.prevent();
8
+ return () => {
9
+ void PsScreenCaptureService.allow();
10
+ };
11
+ }, [isEnabled]);
12
+ };
@@ -0,0 +1 @@
1
+ export declare const usePsWidgetFill: () => number;
@@ -0,0 +1,3 @@
1
+ import { useContext } from 'react';
2
+ import { PsWidgetFillContext } from '../contexts/ps-widget-fill-context';
3
+ export const usePsWidgetFill = () => useContext(PsWidgetFillContext);
package/dist/index.d.ts CHANGED
@@ -49,6 +49,8 @@ export * from './constants/ps-capture-source';
49
49
  export * from './constants/ps-document-kind';
50
50
  export * from './constants/ps-document-load-status';
51
51
  export * from './constants/ps-document-scanner-config';
52
+ export * from './constants/ps-scan-format';
53
+ export * from './interfaces/ps-scan-format-labels';
52
54
  export * from './constants/ps-chart-delta';
53
55
  export * from './constants/ps-cartesian-series-shape';
54
56
  export * from './constants/ps-chart-kind';
@@ -144,10 +146,14 @@ export * from './interfaces/ps-text-variant';
144
146
  export * from './interfaces/ps-sheet-action';
145
147
  export * from './interfaces/ps-sheet-leading-kind';
146
148
  export * from './interfaces/ps-sheet-page';
149
+ export * from './components/ps-accessibility-gate';
147
150
  export * from './components/ps-app-lock-screen';
148
151
  export * from './components/ps-privacy-cover';
149
152
  export * from './constants/ps-biometry-kind';
150
153
  export * from './hooks/use-ps-app-lock';
154
+ export * from './hooks/use-ps-screen-capture-prevention';
155
+ export * from './interfaces/use-ps-screen-capture-prevention-options';
156
+ export { PsScreenCaptureService } from './services/ps-screen-capture-service';
151
157
  export * from './interfaces/ps-app-lock-prompt';
152
158
  export * from './interfaces/use-ps-app-lock-options';
153
159
  export * from './interfaces/use-ps-app-lock-result';
package/dist/index.js CHANGED
@@ -49,6 +49,8 @@ export * from './constants/ps-capture-source';
49
49
  export * from './constants/ps-document-kind';
50
50
  export * from './constants/ps-document-load-status';
51
51
  export * from './constants/ps-document-scanner-config';
52
+ export * from './constants/ps-scan-format';
53
+ export * from './interfaces/ps-scan-format-labels';
52
54
  export * from './constants/ps-chart-delta';
53
55
  export * from './constants/ps-cartesian-series-shape';
54
56
  export * from './constants/ps-chart-kind';
@@ -139,10 +141,14 @@ export * from './interfaces/ps-text-variant';
139
141
  export * from './interfaces/ps-sheet-action';
140
142
  export * from './interfaces/ps-sheet-leading-kind';
141
143
  export * from './interfaces/ps-sheet-page';
144
+ export * from './components/ps-accessibility-gate';
142
145
  export * from './components/ps-app-lock-screen';
143
146
  export * from './components/ps-privacy-cover';
144
147
  export * from './constants/ps-biometry-kind';
145
148
  export * from './hooks/use-ps-app-lock';
149
+ export * from './hooks/use-ps-screen-capture-prevention';
150
+ export * from './interfaces/use-ps-screen-capture-prevention-options';
151
+ export { PsScreenCaptureService } from './services/ps-screen-capture-service';
146
152
  export * from './interfaces/ps-app-lock-prompt';
147
153
  export * from './interfaces/use-ps-app-lock-options';
148
154
  export * from './interfaces/use-ps-app-lock-result';
@@ -1,6 +1,8 @@
1
+ import type { PsScanFormatLabels } from './ps-scan-format-labels';
1
2
  export interface PsCaptureOptions {
2
3
  documentTypes?: string[];
3
4
  imageQuality?: number;
4
5
  scanFileName?: string;
6
+ scanFormatLabels?: PsScanFormatLabels;
5
7
  scanQuality?: number;
6
8
  }
@@ -0,0 +1,4 @@
1
+ export interface PsChartBarGroup {
2
+ offset: number;
3
+ width: number;
4
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,4 @@
1
+ export interface PsChartXLabels {
2
+ indexes: number[];
3
+ maxWidth: number;
4
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -1,5 +1,7 @@
1
+ import type { PsScanFormatLabels } from './ps-scan-format-labels';
1
2
  export interface PsDocumentScannerOptions {
2
3
  fileName?: string;
4
+ formatLabels?: PsScanFormatLabels;
3
5
  jpegQuality?: number;
4
6
  maxPages?: number;
5
7
  }
@@ -0,0 +1,4 @@
1
+ export interface PsDonutChartLayout {
2
+ isStacked: boolean;
3
+ size: number;
4
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,19 @@
1
+ export interface PsImageManipulatorResult {
2
+ uri: string;
3
+ }
4
+ export interface PsImageManipulatorContext {
5
+ renderAsync: () => Promise<PsImageManipulatorRendered>;
6
+ }
7
+ export interface PsImageManipulatorRendered {
8
+ saveAsync: (options: {
9
+ format: string;
10
+ }) => Promise<PsImageManipulatorResult>;
11
+ }
12
+ export interface PsImageManipulatorModule {
13
+ ImageManipulator: {
14
+ manipulate: (uri: string) => PsImageManipulatorContext;
15
+ };
16
+ SaveFormat: {
17
+ PNG: string;
18
+ };
19
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,8 @@
1
+ export interface PsMenuPopupContainerStyle {
2
+ backgroundColor: string;
3
+ borderColor: string;
4
+ borderRadius: number;
5
+ borderWidth: number;
6
+ elevation: number;
7
+ paddingVertical: number;
8
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,4 @@
1
+ export interface PsMenuPopupDividerStyle {
2
+ backgroundColor: string;
3
+ marginVertical: number;
4
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -1,4 +1,5 @@
1
1
  export interface PsMenuPopupLayout {
2
+ isBelow: boolean;
2
3
  left: number;
3
4
  maxHeight: number;
4
5
  top: number;
@@ -0,0 +1,6 @@
1
+ export interface PsMenuPopupRowStyle {
2
+ backgroundColor: string;
3
+ borderRadius: number;
4
+ marginHorizontal: number;
5
+ paddingHorizontal: number;
6
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,4 @@
1
+ export interface PsMenuPopupSize {
2
+ height: number;
3
+ width: number;
4
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,4 @@
1
+ export interface PsPageSize {
2
+ height: number;
3
+ width: number;
4
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,5 @@
1
+ export interface PsPdfPage {
2
+ bytes: Uint8Array;
3
+ height: number;
4
+ width: number;
5
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,7 @@
1
+ export interface PsScanFormatLabels {
2
+ cancel: string;
3
+ images: string;
4
+ message: string;
5
+ pdf: string;
6
+ title: string;
7
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,4 @@
1
+ export interface PsScreenCaptureNative {
2
+ allowScreenCaptureAsync: (key?: string) => Promise<void>;
3
+ preventScreenCaptureAsync: (key?: string) => Promise<void>;
4
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,3 @@
1
+ export interface UsePsScreenCapturePreventionOptions {
2
+ isEnabled?: boolean;
3
+ }
@@ -23,6 +23,7 @@ export class PsCapturePickerService {
23
23
  }
24
24
  return PsDocumentScannerService.scan({
25
25
  fileName: options.scanFileName === undefined ? PsCaptureConfig.scanFileName : options.scanFileName,
26
+ formatLabels: options.scanFormatLabels,
26
27
  jpegQuality: options.scanQuality === undefined ? PsCaptureConfig.scanQuality : options.scanQuality,
27
28
  });
28
29
  }