Skip to content

Commit ff43ef0

Browse files
committed
feat: release v1.0.2 demo
1 parent 73c84e1 commit ff43ef0

File tree

17 files changed

+211
-26490
lines changed

17 files changed

+211
-26490
lines changed

.github/workflows/main.yml

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
# This is a basic workflow to help you get started with Actions
2-
31
name: CI
42

53
# Controls when the workflow will run
@@ -20,7 +18,6 @@ jobs:
2018

2119
# Steps represent a sequence of tasks that will be executed as part of the job
2220
steps:
23-
# Runs a set of commands using the runners shell
2421
- name: Get Source
2522
run: |
2623
cd /home/ubuntu
@@ -30,22 +27,21 @@ jobs:
3027
- name: Prepare Files
3128
run: |
3229
# Create a temporary directory for the files to be uploaded
33-
mkdir -p /home/ubuntu/document-scanner-javascript/demo
30+
mkdir -p /home/ubuntu/document-scanner-javascript/deploy
3431
3532
# Copy the dist folder
36-
cp -r /home/ubuntu/document-scanner-javascript/dist /home/ubuntu/document-scanner-javascript/demo
33+
cp -r /home/ubuntu/document-scanner-javascript/dist /home/ubuntu/document-scanner-javascript/deploy
3734
38-
# Copy the samples folder and rename demo.html to index.html
39-
cp -r /home/ubuntu/document-scanner-javascript/samples/* /home/ubuntu/document-scanner-javascript/demo
40-
mv /home/ubuntu/document-scanner-javascript/demo/demo.html /home/ubuntu/document-scanner-javascript/demo/index.html
35+
# Copy demo and hello world. On demo branch, be sure to update the pathing for the demo
36+
cp -r /home/ubuntu/document-scanner-javascript/samples/demo/* /home/ubuntu/document-scanner-javascript/deploy
37+
cp -r /home/ubuntu/document-scanner-javascript/samples/hello-world.html /home/ubuntu/document-scanner-javascript/deploy
4138
42-
4339
- name: Sync files
4440
uses: SamKirkland/[email protected]
4541
with:
4642
server: ${{ secrets.FTP_DEMO_SERVER }}
4743
username: ${{ secrets.FTP_DEMO_USERNAME }}
4844
password: ${{ secrets.FTP_DEMO_PASSWORD }}
4945
port: 21
50-
local-dir: /home/ubuntu/document-scanner-javascript/demo/
51-
server-dir: /Demo.dynamsoft.com/document-scanner/
46+
local-dir: /home/ubuntu/document-scanner-javascript/deploy/
47+
server-dir: /Demo.dynamsoft.com/document-scanner/

dist/dds.bundle.esm.d.ts

Lines changed: 37 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -29,32 +29,35 @@ type ResultStatus = {
2929
code: EnumResultStatus;
3030
message?: string;
3131
};
32-
interface DocumentScanResult {
32+
interface DocumentResult {
3333
status: ResultStatus;
3434
correctedImageResult?: NormalizedImageResultItem | DSImageData;
3535
originalImageResult?: OriginalImageResultItem["imageData"];
3636
detectedQuadrilateral?: Quadrilateral;
3737
_flowType?: EnumFlowType;
3838
}
39-
interface ControlButton {
39+
type ToolbarButtonConfig = Pick<ToolbarButton, "icon" | "label" | "className" | "isHidden">;
40+
interface ToolbarButton {
41+
id: string;
4042
icon: string;
41-
text: string;
43+
label: string;
4244
onClick?: () => void | Promise<void>;
43-
disabled?: boolean;
45+
className?: string;
46+
isDisabled?: boolean;
47+
isHidden?: boolean;
4448
}
4549

46-
interface DocumentCorrectionViewControlIcons {
47-
fullImageBtn?: Pick<ControlButton, "icon" | "text">;
48-
detectBordersBtn?: Pick<ControlButton, "icon" | "text">;
49-
applyBtn?: Pick<ControlButton, "icon" | "text">;
50-
containerStyle?: Partial<CSSStyleDeclaration>;
50+
interface DocumentCorrectionViewToolbarButtonsConfig {
51+
fullImage?: ToolbarButtonConfig;
52+
detectBorders?: ToolbarButtonConfig;
53+
apply?: ToolbarButtonConfig;
5154
}
5255
interface DocumentCorrectionViewConfig {
5356
container?: HTMLElement;
54-
controlIcons?: DocumentCorrectionViewControlIcons;
57+
toolbarButtonsConfig?: DocumentCorrectionViewToolbarButtonsConfig;
5558
templateFilePath?: string;
5659
utilizedTemplateNames?: UtilizedTemplateNames;
57-
onFinish?: (result: DocumentScanResult) => void;
60+
onFinish?: (result: DocumentResult) => void;
5861
}
5962
declare class DocumentCorrectionView {
6063
private resources;
@@ -74,7 +77,7 @@ declare class DocumentCorrectionView {
7477
setFullImageBoundary(): void;
7578
setBoundaryAutomatically(): Promise<void>;
7679
confirmCorrection(): Promise<void>;
77-
launch(): Promise<DocumentScanResult>;
80+
launch(): Promise<DocumentResult>;
7881
hideView(): void;
7982
/**
8083
* Normalize an image with DDN given a set of points
@@ -147,32 +150,32 @@ declare class DocumentScannerView {
147150
* @returns normalized image by DDN
148151
*/
149152
private handleAutoCaptureMode;
150-
launch(_demo_cameraType?: _DEMO_CameraType): Promise<DocumentScanResult>;
153+
launch(_demo_cameraType?: _DEMO_CameraType): Promise<DocumentResult>;
151154
normalizeImage(points: Quadrilateral["points"], originalImageData: OriginalImageResultItem["imageData"]): Promise<NormalizedImageResultItem>;
152155
}
153156

154-
interface ScanResultViewControlIcons {
155-
uploadBtn?: Pick<ControlButton, "icon" | "text">;
156-
correctImageBtn?: Pick<ControlButton, "icon" | "text">;
157-
retakeBtn?: Pick<ControlButton, "icon" | "text">;
158-
doneBtn?: Pick<ControlButton, "icon" | "text">;
159-
containerStyle?: Partial<CSSStyleDeclaration>;
157+
interface DocumentResultViewToolbarButtonsConfig {
158+
retake?: ToolbarButtonConfig;
159+
correct?: ToolbarButtonConfig;
160+
share?: ToolbarButtonConfig;
161+
upload?: ToolbarButtonConfig;
162+
done?: ToolbarButtonConfig;
160163
}
161-
interface ScanResultViewConfig {
164+
interface DocumentResultViewConfig {
162165
container?: HTMLElement;
163-
controlIcons?: ScanResultViewControlIcons;
164-
onDone?: (result: DocumentScanResult) => Promise<void>;
165-
onUpload?: (result: DocumentScanResult) => Promise<void>;
166+
toolbarButtonsConfig?: DocumentResultViewToolbarButtonsConfig;
167+
onDone?: (result: DocumentResult) => Promise<void>;
168+
onUpload?: (result: DocumentResult) => Promise<void>;
166169
}
167-
declare class ScanResultView {
170+
declare class DocumentResultView {
168171
private resources;
169172
private config;
170173
private scannerView;
171174
private correctionView;
172175
private container;
173176
private currentScanResultViewResolver?;
174-
constructor(resources: SharedResources, config: ScanResultViewConfig, scannerView: DocumentScannerView, correctionView: DocumentCorrectionView);
175-
launch(): Promise<DocumentScanResult>;
177+
constructor(resources: SharedResources, config: DocumentResultViewConfig, scannerView: DocumentScannerView, correctionView: DocumentCorrectionView);
178+
launch(): Promise<DocumentResult>;
176179
private handleUploadAndShareBtn;
177180
private handleShare;
178181
private handleCorrectImage;
@@ -188,16 +191,16 @@ interface DocumentScannerConfig {
188191
license?: string;
189192
container?: HTMLElement | string;
190193
scannerViewConfig?: DocumentScannerViewConfig;
191-
scanResultViewConfig?: ScanResultViewConfig;
194+
resultViewConfig?: DocumentResultViewConfig;
192195
correctionViewConfig?: DocumentCorrectionViewConfig;
193196
utilizedTemplateNames?: UtilizedTemplateNames;
194197
}
195198
interface SharedResources {
196199
cvRouter?: CaptureVisionRouter;
197200
cameraEnhancer?: CameraEnhancer;
198201
cameraView?: CameraView;
199-
result?: DocumentScanResult;
200-
onResultUpdated?: (result: DocumentScanResult) => void;
202+
result?: DocumentResult;
203+
onResultUpdated?: (result: DocumentResult) => void;
201204
}
202205
declare class DocumentScanner {
203206
private config;
@@ -216,7 +219,7 @@ declare class DocumentScanner {
216219
components: {
217220
scannerView?: DocumentScannerView;
218221
correctionView?: DocumentCorrectionView;
219-
scanResultView?: ScanResultView;
222+
scanResultView?: DocumentResultView;
220223
};
221224
}>;
222225
private initializeResources;
@@ -247,7 +250,7 @@ declare class DocumentScanner {
247250
* - Only Correction available + existing result: Goes to Correction
248251
* - Only ScanResult available + existing result: Goes to ScanResult
249252
*
250-
* @returns Promise<DocumentScanResult> containing:
253+
* @returns Promise<DocumentResult> containing:
251254
* - status: Success/Failed/Cancelled with message
252255
* - originalImageResult: Raw captured image
253256
* - correctedImageResult: Normalized image (if correction applied)
@@ -256,7 +259,7 @@ declare class DocumentScanner {
256259
*
257260
* @throws Error if capture session already running
258261
*/
259-
launch(_demo_cameraType?: _DEMO_CameraType): Promise<DocumentScanResult>;
262+
launch(_demo_cameraType?: _DEMO_CameraType): Promise<DocumentResult>;
260263
/**
261264
* Checks if a capture session is currently in progress
262265
*/
@@ -267,8 +270,8 @@ declare const DDS: {
267270
DocumentScanner: typeof DocumentScanner;
268271
DocumentNormalizerView: typeof DocumentCorrectionView;
269272
DocumentScannerView: typeof DocumentScannerView;
270-
ScanResultView: typeof ScanResultView;
273+
DocumentResultView: typeof DocumentResultView;
271274
EnumResultStatus: typeof EnumResultStatus;
272275
};
273276

274-
export { ControlButton, DDS, DocumentCorrectionViewConfig, DocumentCorrectionViewControlIcons, DocumentCorrectionView as DocumentNormalizerView, DocumentScanResult, DocumentScanner, DocumentScannerConfig, DocumentScannerView, DocumentScannerViewConfig, EnumFlowType, EnumResultStatus, ResultStatus, ScanResultView, ScanResultViewConfig, ScanResultViewControlIcons, SharedResources, UtilizedTemplateNames };
277+
export { DDS, DocumentCorrectionViewConfig, DocumentCorrectionViewToolbarButtonsConfig, DocumentCorrectionView as DocumentNormalizerView, DocumentResult, DocumentResultView, DocumentResultViewConfig, DocumentResultViewToolbarButtonsConfig, DocumentScanner, DocumentScannerConfig, DocumentScannerView, DocumentScannerViewConfig, EnumFlowType, EnumResultStatus, ResultStatus, SharedResources, ToolbarButtonConfig, UtilizedTemplateNames };

0 commit comments

Comments
 (0)