@operato/ocr 0.2.49 → 0.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +47 -0
- package/dist/src/ox-ocr-helper.d.ts +2 -2
- package/dist/src/ox-ocr-helper.js +9 -11
- package/dist/src/ox-ocr-helper.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +7 -5
- package/src/ox-ocr-helper.ts +10 -12
- package/tsconfig.json +1 -0
- package/dist/src/ox-camera-capturer.d.ts +0 -16
- package/dist/src/ox-camera-capturer.js +0 -191
- package/dist/src/ox-camera-capturer.js.map +0 -1
- package/dist/src/utils/file-drop-helper.d.ts +0 -16
- package/dist/src/utils/file-drop-helper.js +0 -47
- package/dist/src/utils/file-drop-helper.js.map +0 -1
- package/src/ox-camera-capturer.ts +0 -196
- package/src/utils/file-drop-helper.ts +0 -62
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,53 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
### [0.3.1](https://github.com/hatiolab/operato/compare/v0.3.0...v0.3.1) (2021-12-31)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @operato/ocr
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
## [0.3.0](https://github.com/hatiolab/operato/compare/v0.2.52...v0.3.0) (2021-12-31)
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
### :rocket: New Features
|
|
18
|
+
|
|
19
|
+
* add tsconfig option useDefineForClassFields ([6291438](https://github.com/hatiolab/operato/commit/6291438571eee0f095064e7d2ada1c620832e092))
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
### :bug: Bug Fix
|
|
23
|
+
|
|
24
|
+
* remove duplicate ([9f274e7](https://github.com/hatiolab/operato/commit/9f274e70f7a8ae3615d4cf083451b0589e924ee9))
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
### [0.2.52](https://github.com/hatiolab/operato/compare/v0.2.51...v0.2.52) (2021-12-21)
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
### :bug: Bug Fix
|
|
32
|
+
|
|
33
|
+
* upgrade dependencies ([3fde5e7](https://github.com/hatiolab/operato/commit/3fde5e7182bb4b502103bcb70de2f1bfab2bc1ff))
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
### [0.2.51](https://github.com/hatiolab/operato/compare/v0.2.50...v0.2.51) (2021-12-16)
|
|
38
|
+
|
|
39
|
+
**Note:** Version bump only for package @operato/ocr
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
### [0.2.50](https://github.com/hatiolab/operato/compare/v0.2.49...v0.2.50) (2021-12-16)
|
|
46
|
+
|
|
47
|
+
**Note:** Version bump only for package @operato/ocr
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
|
|
6
53
|
### [0.2.49](https://github.com/hatiolab/operato/compare/v0.2.48...v0.2.49) (2021-12-14)
|
|
7
54
|
|
|
8
55
|
**Note:** Version bump only for package @operato/ocr
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import '@material/mwc-linear-progress';
|
|
2
|
-
import '
|
|
2
|
+
import '@operato/input';
|
|
3
3
|
import './ox-ocr-result-image';
|
|
4
4
|
import { LitElement } from 'lit';
|
|
5
5
|
import { ScanResult } from './type';
|
|
@@ -11,7 +11,7 @@ export declare class OcrHelper extends LitElement {
|
|
|
11
11
|
fileUploader: any;
|
|
12
12
|
copied: HTMLElement;
|
|
13
13
|
render(): import("lit-html").TemplateResult<1>;
|
|
14
|
-
fileschange(e: Event): void;
|
|
15
14
|
reset(): void;
|
|
15
|
+
onFilesChange(e: Event): void;
|
|
16
16
|
onSelected(e: CustomEvent): void;
|
|
17
17
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { __decorate } from "tslib";
|
|
2
2
|
import '@material/mwc-linear-progress';
|
|
3
|
-
import '
|
|
3
|
+
import '@operato/input';
|
|
4
4
|
import './ox-ocr-result-image';
|
|
5
5
|
import { css, html, LitElement } from 'lit';
|
|
6
6
|
import { customElement, property, query, state } from 'lit/decorators.js';
|
|
@@ -20,17 +20,15 @@ let OcrHelper = class OcrHelper extends LitElement {
|
|
|
20
20
|
const result = ((_a = this.result) === null || _a === void 0 ? void 0 : _a[index]) || NOTHING_RESULT;
|
|
21
21
|
return html `
|
|
22
22
|
<div attachment-wrap>
|
|
23
|
-
<ox-
|
|
24
|
-
name="scanner"
|
|
23
|
+
<ox-input-file
|
|
25
24
|
id="capturer"
|
|
26
25
|
label="Capture Images"
|
|
27
26
|
accept="image/*"
|
|
28
27
|
multiple="true"
|
|
29
28
|
?hidden=${false}
|
|
30
|
-
|
|
31
|
-
@files-change=${(e) => this.fileschange(e)}
|
|
29
|
+
@change=${(e) => this.onFilesChange(e)}
|
|
32
30
|
hide-filelist
|
|
33
|
-
></ox-
|
|
31
|
+
></ox-input-file>
|
|
34
32
|
</div>
|
|
35
33
|
${this.files.length > 0 && !(this.result.length > 0)
|
|
36
34
|
? html `<mwc-linear-progress indeterminate></mwc-linear-progress> `
|
|
@@ -60,7 +58,11 @@ let OcrHelper = class OcrHelper extends LitElement {
|
|
|
60
58
|
<div id="copied"></div>
|
|
61
59
|
`;
|
|
62
60
|
}
|
|
63
|
-
|
|
61
|
+
reset() {
|
|
62
|
+
this.fileUploader.reset();
|
|
63
|
+
this.copied.textContent = '';
|
|
64
|
+
}
|
|
65
|
+
onFilesChange(e) {
|
|
64
66
|
var _a;
|
|
65
67
|
this.files = this.fileUploader.files;
|
|
66
68
|
this.result = [];
|
|
@@ -68,10 +70,6 @@ let OcrHelper = class OcrHelper extends LitElement {
|
|
|
68
70
|
detail: (_a = this.fileUploader) === null || _a === void 0 ? void 0 : _a.files
|
|
69
71
|
}));
|
|
70
72
|
}
|
|
71
|
-
reset() {
|
|
72
|
-
this.fileUploader.reset();
|
|
73
|
-
this.copied.textContent = '';
|
|
74
|
-
}
|
|
75
73
|
onSelected(e) {
|
|
76
74
|
navigator.clipboard.writeText(e.detail);
|
|
77
75
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ox-ocr-helper.js","sourceRoot":"","sources":["../../src/ox-ocr-helper.ts"],"names":[],"mappings":";AAAA,OAAO,+BAA+B,CAAA;AACtC,OAAO,
|
|
1
|
+
{"version":3,"file":"ox-ocr-helper.js","sourceRoot":"","sources":["../../src/ox-ocr-helper.ts"],"names":[],"mappings":";AAAA,OAAO,+BAA+B,CAAA;AACtC,OAAO,gBAAgB,CAAA;AACvB,OAAO,uBAAuB,CAAA;AAE9B,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,KAAK,CAAA;AAC3C,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AAEzE,OAAO,EAAE,cAAc,EAAc,MAAM,QAAQ,CAAA;AAGnD,IAAa,SAAS,GAAtB,MAAa,SAAU,SAAQ,UAAU;IAAzC;;QAgD6B,WAAM,GAAiB,EAAE,CAAA;QACzB,UAAK,GAAe,EAAE,CAAA;QAExC,WAAM,GAAW,CAAC,CAAA;IAsE7B,CAAC;IAjEC,MAAM;;QACJ,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,IAAI,EAAE,CAAA;QAC9B,MAAM,KAAK,GAAG,IAAI,CAAC,MAAM,IAAI,CAAC,CAAA;QAC9B,MAAM,IAAI,GAAG,KAAK,CAAC,KAAK,CAAC,CAAA;QACzB,MAAM,MAAM,GAAG,CAAA,MAAA,IAAI,CAAC,MAAM,0CAAG,KAAK,CAAC,KAAI,cAAc,CAAA;QAErD,OAAO,IAAI,CAAA;;;;;;;oBAOK,KAAK;oBAC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AAA,IAAI,CAAC,YAAY,0CAAE,KAAK;SACjC,CAAC,CACH,CAAA;IACH,CAAC;IAED,UAAU,CAAC,CAAc;QACvB,SAAS,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC,CAAA;IACzC,CAAC;CACF,CAAA;AAxHQ,gBAAM,GAAG;IACd,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KA2CF;CACF,CAAA;AAE0B;IAA1B,QAAQ,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;yCAA0B;AACzB;IAA1B,QAAQ,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;wCAAuB;AAExC;IAAR,KAAK,EAAE;yCAAmB;AAEP;IAAnB,KAAK,CAAC,WAAW,CAAC;+CAAmB;AACpB;IAAjB,KAAK,CAAC,SAAS,CAAC;yCAAqB;AAtD3B,SAAS;IADrB,aAAa,CAAC,eAAe,CAAC;GAClB,SAAS,CAyHrB;SAzHY,SAAS","sourcesContent":["import '@material/mwc-linear-progress'\nimport '@operato/input'\nimport './ox-ocr-result-image'\n\nimport { css, html, LitElement } from 'lit'\nimport { customElement, property, query, state } from 'lit/decorators.js'\n\nimport { NOTHING_RESULT, ScanResult } from './type'\n\n@customElement('ox-ocr-helper')\nexport class OcrHelper extends LitElement {\n static styles = [\n css`\n :host {\n display: flex;\n flex-direction: column;\n min-width: 240px;\n }\n\n [buttons] {\n display: flex;\n flex-direction: row-reverse;\n }\n\n #images {\n flex: 1;\n background-color: var(--main-section-background-color, #f4f7fb);\n color: white;\n\n display: flex;\n flex-direction: column;\n }\n\n [tab] {\n display: flex;\n flex-direction: row;\n }\n\n [i] {\n min-width: 50px;\n background-color: var(--secondary-color, #394e64);\n border-right: 1px solid rgba(0, 0, 0, 0.2);\n padding: var(--padding-narrow, 4px);\n text-align: center;\n height: 1.4em;\n }\n\n [i][active] {\n background-color: var(--primary-color, #22a6a7);\n font-weight: bold;\n }\n\n ox-ocr-result-image {\n flex: 1;\n }\n `\n ]\n\n @property({ type: Array }) result: ScanResult[] = []\n @property({ type: Array }) files: Array<any> = []\n\n @state() _index: number = 0\n\n @query('#capturer') fileUploader!: any\n @query('#copied') copied!: HTMLElement\n\n render() {\n const files = this.files || []\n const index = this._index || 0\n const file = files[index]\n const result = this.result?.[index] || NOTHING_RESULT\n\n return html`\n <div attachment-wrap>\n <ox-input-file\n id=\"capturer\"\n label=\"Capture Images\"\n accept=\"image/*\"\n multiple=\"true\"\n ?hidden=${false}\n @change=${(e: Event) => this.onFilesChange(e)}\n hide-filelist\n ></ox-input-file>\n </div>\n ${this.files.length > 0 && !(this.result.length > 0)\n ? html`<mwc-linear-progress indeterminate></mwc-linear-progress> `\n : html``}\n\n <div id=\"images\">\n <div\n tab\n @click=${(e: MouseEvent) => {\n const item = (e.target as HTMLElement)?.closest('[i]')\n const children = (e.currentTarget as HTMLElement)?.querySelectorAll('[i]')\n if (item) {\n this._index = Array.from(children).indexOf(item)\n }\n }}\n >\n ${files.map((file: any, idx: number) => html`<div i ?active=${idx === index}>${idx}</div>`)}\n </div>\n <ox-ocr-result-image\n .file=${file}\n @selected=${(e: CustomEvent) => this.onSelected(e)}\n .result=${result}\n ></ox-ocr-result-image>\n </div>\n\n <div id=\"copied\"></div>\n `\n }\n\n reset() {\n this.fileUploader.reset()\n this.copied.textContent = ''\n }\n\n onFilesChange(e: Event) {\n this.files = this.fileUploader.files\n this.result = []\n\n this.dispatchEvent(\n new CustomEvent('attached', {\n detail: this.fileUploader?.files\n })\n )\n }\n\n onSelected(e: CustomEvent) {\n navigator.clipboard.writeText(e.detail)\n }\n}\n"]}
|