@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.
- package/dist/components/ps-accessibility-gate/index.d.ts +2 -0
- package/dist/components/ps-accessibility-gate/index.js +2 -0
- package/dist/components/ps-accessibility-gate/ps-accessibility-gate-props.d.ts +5 -0
- package/dist/components/ps-accessibility-gate/ps-accessibility-gate-props.js +1 -0
- package/dist/components/ps-accessibility-gate/ps-accessibility-gate.d.ts +2 -0
- package/dist/components/ps-accessibility-gate/ps-accessibility-gate.js +4 -0
- package/dist/components/ps-app-lock-screen/ps-app-lock-screen.js +1 -1
- package/dist/components/ps-cartesian-chart/ps-cartesian-chart.d.ts +1 -1
- package/dist/components/ps-cartesian-chart/ps-cartesian-chart.js +25 -17
- package/dist/components/ps-chart-empty-state/ps-chart-empty-state.js +5 -1
- package/dist/components/ps-chart-frame/ps-chart-frame.js +10 -1
- package/dist/components/ps-chart-legend/ps-chart-legend.js +11 -2
- package/dist/components/ps-chart-readout/ps-chart-readout-props.d.ts +1 -0
- package/dist/components/ps-chart-readout/ps-chart-readout.d.ts +1 -1
- package/dist/components/ps-chart-readout/ps-chart-readout.js +8 -2
- package/dist/components/ps-chart-skeleton/ps-chart-skeleton.d.ts +1 -1
- package/dist/components/ps-chart-skeleton/ps-chart-skeleton.js +5 -1
- package/dist/components/ps-donut-chart/ps-donut-chart.js +23 -5
- package/dist/components/ps-kpi-card/ps-kpi-card.js +4 -1
- package/dist/components/ps-list/ps-list-select-row.js +8 -4
- package/dist/components/ps-menu-popup/ps-menu-popup-divider.js +8 -2
- package/dist/components/ps-menu-popup/ps-menu-popup-row.js +21 -9
- package/dist/components/ps-menu-popup/ps-menu-popup.js +28 -17
- package/dist/components/ps-privacy-cover/ps-privacy-cover-props.d.ts +1 -0
- package/dist/components/ps-privacy-cover/ps-privacy-cover.d.ts +1 -1
- package/dist/components/ps-privacy-cover/ps-privacy-cover.js +12 -3
- package/dist/components/ps-sortable-grid/ps-sortable-grid.js +8 -4
- package/dist/components/ps-sortable-grid/ps-sortable-item-props.d.ts +1 -0
- package/dist/components/ps-sortable-grid/ps-sortable-item.d.ts +1 -1
- package/dist/components/ps-sortable-grid/ps-sortable-item.js +3 -2
- package/dist/components/ps-sparkline/ps-sparkline.d.ts +1 -1
- package/dist/components/ps-sparkline/ps-sparkline.js +3 -1
- package/dist/components/ps-waterfall-chart/ps-waterfall-chart.d.ts +1 -1
- package/dist/components/ps-waterfall-chart/ps-waterfall-chart.js +15 -9
- package/dist/constants/ps-accessibility-config.d.ts +5 -0
- package/dist/constants/ps-accessibility-config.js +5 -0
- package/dist/constants/ps-chart-config.d.ts +26 -1
- package/dist/constants/ps-chart-config.js +26 -1
- package/dist/constants/ps-material-menu-config.d.ts +12 -0
- package/dist/constants/ps-material-menu-config.js +12 -0
- package/dist/constants/ps-scan-format.d.ts +4 -0
- package/dist/constants/ps-scan-format.js +5 -0
- package/dist/constants/ps-scan-output-config.d.ts +17 -0
- package/dist/constants/ps-scan-output-config.js +23 -0
- package/dist/constants/ps-screen-capture-config.d.ts +4 -0
- package/dist/constants/ps-screen-capture-config.js +4 -0
- package/dist/contexts/ps-widget-fill-context.d.ts +1 -0
- package/dist/contexts/ps-widget-fill-context.js +2 -0
- package/dist/hooks/use-ps-document-scanner.js +3 -2
- package/dist/hooks/use-ps-menu-popup-reveal.d.ts +3 -0
- package/dist/hooks/use-ps-menu-popup-reveal.js +28 -0
- package/dist/hooks/use-ps-screen-capture-prevention.d.ts +2 -0
- package/dist/hooks/use-ps-screen-capture-prevention.js +12 -0
- package/dist/hooks/use-ps-widget-fill.d.ts +1 -0
- package/dist/hooks/use-ps-widget-fill.js +3 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.js +6 -0
- package/dist/interfaces/ps-capture-options.d.ts +2 -0
- package/dist/interfaces/ps-chart-bar-group.d.ts +4 -0
- package/dist/interfaces/ps-chart-bar-group.js +1 -0
- package/dist/interfaces/ps-chart-x-labels.d.ts +4 -0
- package/dist/interfaces/ps-chart-x-labels.js +1 -0
- package/dist/interfaces/ps-document-scanner-options.d.ts +2 -0
- package/dist/interfaces/ps-donut-chart-layout.d.ts +4 -0
- package/dist/interfaces/ps-donut-chart-layout.js +1 -0
- package/dist/interfaces/ps-image-manipulator-native.d.ts +19 -0
- package/dist/interfaces/ps-image-manipulator-native.js +1 -0
- package/dist/interfaces/ps-menu-popup-container-style.d.ts +8 -0
- package/dist/interfaces/ps-menu-popup-container-style.js +1 -0
- package/dist/interfaces/ps-menu-popup-divider-style.d.ts +4 -0
- package/dist/interfaces/ps-menu-popup-divider-style.js +1 -0
- package/dist/interfaces/ps-menu-popup-layout.d.ts +1 -0
- package/dist/interfaces/ps-menu-popup-row-style.d.ts +6 -0
- package/dist/interfaces/ps-menu-popup-row-style.js +1 -0
- package/dist/interfaces/ps-menu-popup-size.d.ts +4 -0
- package/dist/interfaces/ps-menu-popup-size.js +1 -0
- package/dist/interfaces/ps-page-size.d.ts +4 -0
- package/dist/interfaces/ps-page-size.js +1 -0
- package/dist/interfaces/ps-pdf-page.d.ts +5 -0
- package/dist/interfaces/ps-pdf-page.js +1 -0
- package/dist/interfaces/ps-scan-format-labels.d.ts +7 -0
- package/dist/interfaces/ps-scan-format-labels.js +1 -0
- package/dist/interfaces/ps-screen-capture-native.d.ts +4 -0
- package/dist/interfaces/ps-screen-capture-native.js +1 -0
- package/dist/interfaces/use-ps-screen-capture-prevention-options.d.ts +3 -0
- package/dist/interfaces/use-ps-screen-capture-prevention-options.js +1 -0
- package/dist/services/ps-capture-picker-service.js +1 -0
- package/dist/services/ps-chart-axis-service.d.ts +5 -0
- package/dist/services/ps-chart-axis-service.js +32 -0
- package/dist/services/ps-chart-bar-service.d.ts +2 -0
- package/dist/services/ps-chart-bar-service.js +11 -4
- package/dist/services/ps-chart-donut-service.d.ts +3 -0
- package/dist/services/ps-chart-donut-service.js +11 -0
- package/dist/services/ps-chart-readout-service.d.ts +3 -0
- package/dist/services/ps-chart-readout-service.js +25 -0
- package/dist/services/ps-chart-scale-service.d.ts +1 -1
- package/dist/services/ps-chart-scale-service.js +2 -2
- package/dist/services/ps-chart-text-service.d.ts +6 -0
- package/dist/services/ps-chart-text-service.js +23 -0
- package/dist/services/ps-document-scanner-service.d.ts +2 -0
- package/dist/services/ps-document-scanner-service.js +21 -4
- package/dist/services/ps-jpeg-size-service.d.ts +4 -0
- package/dist/services/ps-jpeg-size-service.js +32 -0
- package/dist/services/ps-menu-popup-service.js +1 -0
- package/dist/services/ps-menu-popup-style-service.d.ts +13 -0
- package/dist/services/ps-menu-popup-style-service.js +55 -0
- package/dist/services/ps-scan-format-prompt-service.d.ts +6 -0
- package/dist/services/ps-scan-format-prompt-service.js +21 -0
- package/dist/services/ps-scan-image-converter-service.d.ts +5 -0
- package/dist/services/ps-scan-image-converter-service.js +22 -0
- package/dist/services/ps-scan-output-service.d.ts +10 -0
- package/dist/services/ps-scan-output-service.js +55 -0
- package/dist/services/ps-scan-pdf-service.d.ts +4 -0
- package/dist/services/ps-scan-pdf-service.js +6 -0
- package/dist/services/ps-screen-capture-service.d.ts +6 -0
- package/dist/services/ps-screen-capture-service.js +35 -0
- package/dist/services/ps-sortable-grid-service.d.ts +2 -0
- package/dist/services/ps-sortable-grid-service.js +10 -3
- package/dist/services/ps-waterfall-service.js +2 -3
- package/jest-setup.js +1 -1
- 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
|
|
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:
|
|
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:
|
|
32
|
+
return _jsx(PsChartEmptyState, { height: baseHeight, label: emptyLabel });
|
|
27
33
|
const colors = [theme.chart[0], theme.danger, theme.primary700];
|
|
28
|
-
const
|
|
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 -
|
|
36
|
-
}),
|
|
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
|
};
|
|
@@ -1,31 +1,56 @@
|
|
|
1
1
|
export declare const PsChartConfig: {
|
|
2
2
|
readonly areaOpacity: 0.18;
|
|
3
|
-
readonly
|
|
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
|
-
|
|
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,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 @@
|
|
|
1
|
+
export declare const PsWidgetFillContext: import("react").Context<number>;
|
|
@@ -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,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,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;
|
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';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -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 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -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
|
}
|