@operato/ocr 0.2.15 → 0.2.22

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 (45) hide show
  1. package/CHANGELOG.md +47 -0
  2. package/demo/index.html +699 -25
  3. package/dist/src/index.d.ts +1 -1
  4. package/dist/src/index.js +1 -1
  5. package/dist/src/index.js.map +1 -1
  6. package/dist/src/{camera-capturer.d.ts → ox-camera-capturer.d.ts} +0 -0
  7. package/dist/src/{camera-capturer.js → ox-camera-capturer.js} +18 -10
  8. package/dist/src/ox-camera-capturer.js.map +1 -0
  9. package/dist/src/{ocr-helper.d.ts → ox-ocr-helper.d.ts} +8 -4
  10. package/dist/src/{ocr-helper.js → ox-ocr-helper.js} +47 -51
  11. package/dist/src/ox-ocr-helper.js.map +1 -0
  12. package/dist/src/ox-ocr-result-image.d.ts +37 -0
  13. package/dist/src/ox-ocr-result-image.js +279 -0
  14. package/dist/src/ox-ocr-result-image.js.map +1 -0
  15. package/dist/src/type.d.ts +15 -0
  16. package/dist/src/type.js +6 -0
  17. package/dist/src/type.js.map +1 -0
  18. package/dist/src/{file-drop-helper.d.ts → utils/file-drop-helper.d.ts} +0 -0
  19. package/dist/src/{file-drop-helper.js → utils/file-drop-helper.js} +0 -0
  20. package/dist/src/utils/file-drop-helper.js.map +1 -0
  21. package/dist/src/utils/touch-to-mouse-event.d.ts +1 -0
  22. package/dist/src/utils/touch-to-mouse-event.js +34 -0
  23. package/dist/src/utils/touch-to-mouse-event.js.map +1 -0
  24. package/dist/stories/index.stories.d.ts +1 -1
  25. package/dist/stories/index.stories.js +10 -14
  26. package/dist/stories/index.stories.js.map +1 -1
  27. package/dist/test/ox-ocr-helper.test.d.ts +1 -0
  28. package/dist/test/{ocr-helper.test.js → ox-ocr-helper.test.js} +7 -7
  29. package/dist/test/ox-ocr-helper.test.js.map +1 -0
  30. package/dist/tsconfig.tsbuildinfo +1 -1
  31. package/package.json +3 -2
  32. package/src/index.ts +1 -1
  33. package/src/{camera-capturer.ts → ox-camera-capturer.ts} +17 -9
  34. package/src/{ocr-helper.ts → ox-ocr-helper.ts} +43 -49
  35. package/src/ox-ocr-result-image.ts +303 -0
  36. package/src/type.ts +13 -0
  37. package/src/{file-drop-helper.ts → utils/file-drop-helper.ts} +0 -0
  38. package/src/utils/touch-to-mouse-event.ts +39 -0
  39. package/stories/index.stories.ts +29 -37
  40. package/test/{ocr-helper.test.ts → ox-ocr-helper.test.ts} +8 -7
  41. package/dist/src/camera-capturer.js.map +0 -1
  42. package/dist/src/file-drop-helper.js.map +0 -1
  43. package/dist/src/ocr-helper.js.map +0 -1
  44. package/dist/test/ocr-helper.test.d.ts +0 -1
  45. package/dist/test/ocr-helper.test.js.map +0 -1
@@ -0,0 +1,15 @@
1
+ export declare type ScanResult = {
2
+ key_values: {
3
+ [key: string]: Array<string>;
4
+ };
5
+ boundaries: Array<Array<{
6
+ x: number;
7
+ y: number;
8
+ }>>;
9
+ texts: Array<string>;
10
+ };
11
+ export declare const NOTHING_RESULT: {
12
+ boundaries: never[];
13
+ key_values: {};
14
+ texts: never[];
15
+ };
@@ -0,0 +1,6 @@
1
+ export const NOTHING_RESULT = {
2
+ boundaries: [],
3
+ key_values: {},
4
+ texts: []
5
+ };
6
+ //# sourceMappingURL=type.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"type.js","sourceRoot":"","sources":["../../src/type.ts"],"names":[],"mappings":"AAQA,MAAM,CAAC,MAAM,cAAc,GAAG;IAC5B,UAAU,EAAE,EAAE;IACd,UAAU,EAAE,EAAE;IACd,KAAK,EAAE,EAAE;CACV,CAAA","sourcesContent":["export type ScanResult = {\n key_values: {\n [key: string]: Array<string>\n }\n boundaries: Array<Array<{ x: number; y: number }>>\n texts: Array<string>\n}\n\nexport const NOTHING_RESULT = {\n boundaries: [],\n key_values: {},\n texts: []\n}\n"]}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"file-drop-helper.js","sourceRoot":"","sources":["../../../src/utils/file-drop-helper.ts"],"names":[],"mappings":"AAKA;;GAEG;AACH,MAAM,OAAO,cAAc;IACzB;;;;OAIG;IACH,MAAM,CAAC,GAAG,CAAC,QAAqB,EAAE,KAAqB;QACrD,IAAI,eAAe,GAAG,CAAC,CAAQ,EAAE,EAAE;YACjC,IAAI,CAAC,KAAK,IAAI,KAAK,EAAE,EAAE;gBACrB,CAAC,CAAC,cAAc,EAAE,CAAA;gBAClB,CAAC,CAAC,eAAe,EAAE,CAAA;aACpB;QACH,CAAC,CAAA;QAED,IAAI,SAAS,GAAG,CAAC,CAAQ,EAAE,EAAE;YAC3B,IAAI,CAAC,KAAK,IAAI,KAAK,EAAE,EAAE;gBACrB,QAAQ,CAAC,SAAS,CAAC,GAAG,CAAC,SAAS,CAAC,CAAA;aAClC;QACH,CAAC,CAAA;QAED,IAAI,WAAW,GAAG,CAAC,CAAQ,EAAE,EAAE;YAC7B,IAAI,CAAC,KAAK,IAAI,KAAK,EAAE,EAAE;gBACrB,QAAQ,CAAC,SAAS,CAAC,MAAM,CAAC,SAAS,CAAC,CAAA;aACrC;QACH,CAAC,CAEA;QAAA,CAAC,WAAW,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE;YAC9D,QAAQ,CAAC,gBAAgB,CAAC,KAAK,EAAE,eAAe,EAAE,KAAK,CAAC,CAAA;QAC1D,CAAC,CAAC,CACD;QAAA,CAAC,WAAW,EAAE,UAAU,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE;YACzC,QAAQ,CAAC,gBAAgB,CAAC,KAAK,EAAE,SAAS,EAAE,KAAK,CAAC,CAAA;QACpD,CAAC,CAAC,CACD;QAAA,CAAC,WAAW,EAAE,MAAM,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE;YACrC,QAAQ,CAAC,gBAAgB,CAAC,KAAK,EAAE,WAAW,EAAE,KAAK,CAAC,CAAA;QACtD,CAAC,CAAC,CAAA;QAEF,QAAQ,CAAC,gBAAgB,CACvB,MAAM,EACN,CAAC,CAAC,EAAE;YACF,IAAI,CAAC,KAAK,IAAI,KAAK,EAAE,EAAE;gBACrB,IAAI,EAAE,GAAG,CAAC,CAAC,YAAa,CAAA;gBACxB,IAAI,KAAK,GAAG,EAAE,CAAC,KAAK,CAAA;gBAEpB,QAAQ,CAAC,aAAa,CACpB,IAAI,WAAW,CAAC,WAAW,EAAE;oBAC3B,MAAM,EAAE,CAAC,GAAG,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;iBAC/B,CAAC,CACH,CAAA;aACF;QACH,CAAC,EACD,KAAK,CACN,CAAA;IACH,CAAC;CACF","sourcesContent":["/**\n * judge callback function for FileDropHelper.set\n */\ntype JudgeCallback = () => boolean\n\n/**\n * file drop assist class\n */\nexport class FileDropHelper {\n /**\n * 파일 드롭 영역에서의 file drag&drop과 관련된 이벤트에 대한 처리를 설정한다.\n * @param dropArea file drag&drop target area\n * @param [judge] file drag&drop과 관련된 이벤트에 대한 judge callback function\n */\n static set(dropArea: HTMLElement, judge?: JudgeCallback) {\n var preventDefaults = (e: Event) => {\n if (!judge || judge()) {\n e.preventDefault()\n e.stopPropagation()\n }\n }\n\n var highlight = (e: Event) => {\n if (!judge || judge()) {\n dropArea.classList.add('candrop')\n }\n }\n\n var unhighlight = (e: Event) => {\n if (!judge || judge()) {\n dropArea.classList.remove('candrop')\n }\n }\n\n ;['dragenter', 'dragover', 'dragleave', 'drop'].forEach(event => {\n dropArea.addEventListener(event, preventDefaults, false)\n })\n ;['dragenter', 'dragover'].forEach(event => {\n dropArea.addEventListener(event, highlight, false)\n })\n ;['dragleave', 'drop'].forEach(event => {\n dropArea.addEventListener(event, unhighlight, false)\n })\n\n dropArea.addEventListener(\n 'drop',\n e => {\n if (!judge || judge()) {\n let dt = e.dataTransfer!\n let files = dt.files\n\n dropArea.dispatchEvent(\n new CustomEvent('file-drop', {\n detail: [...Array.from(files)]\n })\n )\n }\n },\n false\n )\n }\n}\n"]}
@@ -0,0 +1 @@
1
+ export declare function touch2mouse(e: TouchEvent): void;
@@ -0,0 +1,34 @@
1
+ export function touch2mouse(e) {
2
+ var _a;
3
+ e.preventDefault();
4
+ if (e.touches.length > 1 || (e.type == 'touchend' && e.touches.length > 0)) {
5
+ return;
6
+ }
7
+ var type = '';
8
+ const touch = e.changedTouches[0];
9
+ switch (e.type) {
10
+ case 'touchstart':
11
+ type = 'mousedown';
12
+ break;
13
+ case 'touchmove':
14
+ type = 'mousemove';
15
+ break;
16
+ case 'touchend':
17
+ type = 'mouseup';
18
+ break;
19
+ }
20
+ const { screenX, screenY, clientX, clientY } = touch;
21
+ const { ctrlKey, altKey, shiftKey, metaKey } = e;
22
+ (_a = e.target) === null || _a === void 0 ? void 0 : _a.dispatchEvent(new MouseEvent(type, {
23
+ screenX,
24
+ screenY,
25
+ clientX,
26
+ clientY,
27
+ ctrlKey,
28
+ altKey,
29
+ shiftKey,
30
+ metaKey,
31
+ button: 0
32
+ }));
33
+ }
34
+ //# sourceMappingURL=touch-to-mouse-event.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"touch-to-mouse-event.js","sourceRoot":"","sources":["../../../src/utils/touch-to-mouse-event.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,WAAW,CAAC,CAAa;;IACvC,CAAC,CAAC,cAAc,EAAE,CAAA;IAElB,IAAI,CAAC,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,IAAI,UAAU,IAAI,CAAC,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC,EAAE;QAC1E,OAAM;KACP;IAED,IAAI,IAAI,GAAG,EAAE,CAAA;IACb,MAAM,KAAK,GAAG,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,CAAA;IAEjC,QAAQ,CAAC,CAAC,IAAI,EAAE;QACd,KAAK,YAAY;YACf,IAAI,GAAG,WAAW,CAAA;YAClB,MAAK;QACP,KAAK,WAAW;YACd,IAAI,GAAG,WAAW,CAAA;YAClB,MAAK;QACP,KAAK,UAAU;YACb,IAAI,GAAG,SAAS,CAAA;YAChB,MAAK;KACR;IAED,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,GAAG,KAAK,CAAA;IACpD,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,GAAG,CAAC,CAAA;IAEhD,MAAA,CAAC,CAAC,MAAM,0CAAE,aAAa,CACrB,IAAI,UAAU,CAAC,IAAI,EAAE;QACnB,OAAO;QACP,OAAO;QACP,OAAO;QACP,OAAO;QACP,OAAO;QACP,MAAM;QACN,QAAQ;QACR,OAAO;QACP,MAAM,EAAE,CAAC;KACV,CAAC,CACH,CAAA;AACH,CAAC","sourcesContent":["export function touch2mouse(e: TouchEvent) {\n e.preventDefault()\n\n if (e.touches.length > 1 || (e.type == 'touchend' && e.touches.length > 0)) {\n return\n }\n\n var type = ''\n const touch = e.changedTouches[0]\n\n switch (e.type) {\n case 'touchstart':\n type = 'mousedown'\n break\n case 'touchmove':\n type = 'mousemove'\n break\n case 'touchend':\n type = 'mouseup'\n break\n }\n\n const { screenX, screenY, clientX, clientY } = touch\n const { ctrlKey, altKey, shiftKey, metaKey } = e\n\n e.target?.dispatchEvent(\n new MouseEvent(type, {\n screenX,\n screenY,\n clientX,\n clientY,\n ctrlKey,\n altKey,\n shiftKey,\n metaKey,\n button: 0\n })\n )\n}\n"]}
@@ -1,5 +1,5 @@
1
+ import '../src/ox-ocr-helper.js';
1
2
  import { TemplateResult } from 'lit';
2
- import '../src/ocr-helper.js';
3
3
  declare const _default: {
4
4
  title: string;
5
5
  component: string;
@@ -1,37 +1,33 @@
1
+ import '../src/ox-ocr-helper.js';
1
2
  import { html } from 'lit';
2
- import '../src/ocr-helper.js';
3
3
  export default {
4
4
  title: 'OcrHelper',
5
- component: 'ocr-helper',
5
+ component: 'ox-ocr-helper',
6
6
  argTypes: {
7
7
  title: { control: 'text' },
8
8
  counter: { control: 'number' },
9
- textColor: { control: 'color' },
10
- },
9
+ textColor: { control: 'color' }
10
+ }
11
11
  };
12
- const Template = ({ title = 'Hello world', counter = 5, textColor, slot, }) => html `
13
- <ocr-helper
14
- style="--ocr-helper-text-color: ${textColor || 'black'}"
15
- .title=${title}
16
- .counter=${counter}
17
- >
12
+ const Template = ({ title = 'Hello world', counter = 5, textColor, slot }) => html `
13
+ <ocr-helper style="--ocr-helper-text-color: ${textColor || 'black'}" .title=${title} .counter=${counter}>
18
14
  ${slot}
19
15
  </ocr-helper>
20
16
  `;
21
17
  export const Regular = Template.bind({});
22
18
  export const CustomTitle = Template.bind({});
23
19
  CustomTitle.args = {
24
- title: 'My title',
20
+ title: 'My title'
25
21
  };
26
22
  export const CustomCounter = Template.bind({});
27
23
  CustomCounter.args = {
28
- counter: 123456,
24
+ counter: 123456
29
25
  };
30
26
  export const SlottedContent = Template.bind({});
31
27
  SlottedContent.args = {
32
- slot: html `<p>Slotted content</p>`,
28
+ slot: html `<p>Slotted content</p>`
33
29
  };
34
30
  SlottedContent.argTypes = {
35
- slot: { table: { disable: true } },
31
+ slot: { table: { disable: true } }
36
32
  };
37
33
  //# sourceMappingURL=index.stories.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.stories.js","sourceRoot":"","sources":["../../stories/index.stories.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAkB,MAAM,KAAK,CAAC;AAC3C,OAAO,sBAAsB,CAAC;AAE9B,eAAe;IACb,KAAK,EAAE,WAAW;IAClB,SAAS,EAAE,YAAY;IACvB,QAAQ,EAAE;QACR,KAAK,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE;QAC1B,OAAO,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE;QAC9B,SAAS,EAAE,EAAE,OAAO,EAAE,OAAO,EAAE;KAChC;CACF,CAAC;AAeF,MAAM,QAAQ,GAAoB,CAAC,EACjC,KAAK,GAAG,aAAa,EACrB,OAAO,GAAG,CAAC,EACX,SAAS,EACT,IAAI,GACK,EAAE,EAAE,CAAC,IAAI,CAAA;;sCAEkB,SAAS,IAAI,OAAO;aAC7C,KAAK;eACH,OAAO;;MAEhB,IAAI;;CAET,CAAC;AAEF,MAAM,CAAC,MAAM,OAAO,GAAG,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AAEzC,MAAM,CAAC,MAAM,WAAW,GAAG,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AAC7C,WAAW,CAAC,IAAI,GAAG;IACjB,KAAK,EAAE,UAAU;CAClB,CAAC;AAEF,MAAM,CAAC,MAAM,aAAa,GAAG,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AAC/C,aAAa,CAAC,IAAI,GAAG;IACnB,OAAO,EAAE,MAAM;CAChB,CAAC;AAEF,MAAM,CAAC,MAAM,cAAc,GAAG,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AAChD,cAAc,CAAC,IAAI,GAAG;IACpB,IAAI,EAAE,IAAI,CAAA,wBAAwB;CACnC,CAAC;AACF,cAAc,CAAC,QAAQ,GAAG;IACxB,IAAI,EAAE,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE;CACnC,CAAC","sourcesContent":["import { html, TemplateResult } from 'lit';\nimport '../src/ocr-helper.js';\n\nexport default {\n title: 'OcrHelper',\n component: 'ocr-helper',\n argTypes: {\n title: { control: 'text' },\n counter: { control: 'number' },\n textColor: { control: 'color' },\n },\n};\n\ninterface Story<T> {\n (args: T): TemplateResult;\n args?: Partial<T>;\n argTypes?: Record<string, unknown>;\n}\n\ninterface ArgTypes {\n title?: string;\n counter?: number;\n textColor?: string;\n slot?: TemplateResult;\n}\n\nconst Template: Story<ArgTypes> = ({\n title = 'Hello world',\n counter = 5,\n textColor,\n slot,\n}: ArgTypes) => html`\n <ocr-helper\n style=\"--ocr-helper-text-color: ${textColor || 'black'}\"\n .title=${title}\n .counter=${counter}\n >\n ${slot}\n </ocr-helper>\n`;\n\nexport const Regular = Template.bind({});\n\nexport const CustomTitle = Template.bind({});\nCustomTitle.args = {\n title: 'My title',\n};\n\nexport const CustomCounter = Template.bind({});\nCustomCounter.args = {\n counter: 123456,\n};\n\nexport const SlottedContent = Template.bind({});\nSlottedContent.args = {\n slot: html`<p>Slotted content</p>`,\n};\nSlottedContent.argTypes = {\n slot: { table: { disable: true } },\n};\n"]}
1
+ {"version":3,"file":"index.stories.js","sourceRoot":"","sources":["../../stories/index.stories.ts"],"names":[],"mappings":"AAAA,OAAO,yBAAyB,CAAA;AAEhC,OAAO,EAAE,IAAI,EAAkB,MAAM,KAAK,CAAA;AAE1C,eAAe;IACb,KAAK,EAAE,WAAW;IAClB,SAAS,EAAE,eAAe;IAC1B,QAAQ,EAAE;QACR,KAAK,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE;QAC1B,OAAO,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE;QAC9B,SAAS,EAAE,EAAE,OAAO,EAAE,OAAO,EAAE;KAChC;CACF,CAAA;AAeD,MAAM,QAAQ,GAAoB,CAAC,EAAE,KAAK,GAAG,aAAa,EAAE,OAAO,GAAG,CAAC,EAAE,SAAS,EAAE,IAAI,EAAY,EAAE,EAAE,CAAC,IAAI,CAAA;gDAC7D,SAAS,IAAI,OAAO,YAAY,KAAK,aAAa,OAAO;MACnG,IAAI;;CAET,CAAA;AAED,MAAM,CAAC,MAAM,OAAO,GAAG,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;AAExC,MAAM,CAAC,MAAM,WAAW,GAAG,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;AAC5C,WAAW,CAAC,IAAI,GAAG;IACjB,KAAK,EAAE,UAAU;CAClB,CAAA;AAED,MAAM,CAAC,MAAM,aAAa,GAAG,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;AAC9C,aAAa,CAAC,IAAI,GAAG;IACnB,OAAO,EAAE,MAAM;CAChB,CAAA;AAED,MAAM,CAAC,MAAM,cAAc,GAAG,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;AAC/C,cAAc,CAAC,IAAI,GAAG;IACpB,IAAI,EAAE,IAAI,CAAA,wBAAwB;CACnC,CAAA;AACD,cAAc,CAAC,QAAQ,GAAG;IACxB,IAAI,EAAE,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE;CACnC,CAAA","sourcesContent":["import '../src/ox-ocr-helper.js'\n\nimport { html, TemplateResult } from 'lit'\n\nexport default {\n title: 'OcrHelper',\n component: 'ox-ocr-helper',\n argTypes: {\n title: { control: 'text' },\n counter: { control: 'number' },\n textColor: { control: 'color' }\n }\n}\n\ninterface Story<T> {\n (args: T): TemplateResult\n args?: Partial<T>\n argTypes?: Record<string, unknown>\n}\n\ninterface ArgTypes {\n title?: string\n counter?: number\n textColor?: string\n slot?: TemplateResult\n}\n\nconst Template: Story<ArgTypes> = ({ title = 'Hello world', counter = 5, textColor, slot }: ArgTypes) => html`\n <ocr-helper style=\"--ocr-helper-text-color: ${textColor || 'black'}\" .title=${title} .counter=${counter}>\n ${slot}\n </ocr-helper>\n`\n\nexport const Regular = Template.bind({})\n\nexport const CustomTitle = Template.bind({})\nCustomTitle.args = {\n title: 'My title'\n}\n\nexport const CustomCounter = Template.bind({})\nCustomCounter.args = {\n counter: 123456\n}\n\nexport const SlottedContent = Template.bind({})\nSlottedContent.args = {\n slot: html`<p>Slotted content</p>`\n}\nSlottedContent.argTypes = {\n slot: { table: { disable: true } }\n}\n"]}
@@ -0,0 +1 @@
1
+ import '../src/ox-ocr-helper.js';
@@ -1,24 +1,24 @@
1
- import '../src/ocr-helper.js';
2
- import { expect, fixture } from '@open-wc/testing';
1
+ import '../src/ox-ocr-helper.js';
3
2
  import { html } from 'lit';
3
+ import { expect, fixture } from '@open-wc/testing';
4
4
  describe('OcrHelper', () => {
5
5
  it('has a default title "Hey there" and counter 5', async () => {
6
- const el = await fixture(html `<ocr-helper></ocr-helper>`);
6
+ const el = await fixture(html `<ox-ocr-helper></ox-ocr-helper>`);
7
7
  expect(el.title).to.equal('Hey there');
8
8
  // expect(el.counter).to.equal(5)
9
9
  });
10
10
  it('increases the counter on button click', async () => {
11
- const el = await fixture(html `<ocr-helper></ocr-helper>`);
11
+ const el = await fixture(html `<ox-ocr-helper></ox-ocr-helper>`);
12
12
  el.shadowRoot.querySelector('button').click();
13
13
  // expect(el.counter).to.equal(6)
14
14
  });
15
15
  it('can override the title via attribute', async () => {
16
- const el = await fixture(html `<ocr-helper title="attribute title"></ocr-helper>`);
16
+ const el = await fixture(html `<ox-ocr-helper title="attribute title"></ox-ocr-helper>`);
17
17
  expect(el.title).to.equal('attribute title');
18
18
  });
19
19
  it('passes the a11y audit', async () => {
20
- const el = await fixture(html `<ocr-helper></ocr-helper>`);
20
+ const el = await fixture(html `<ox-ocr-helper></ox-ocr-helper>`);
21
21
  await expect(el).shadowDom.to.be.accessible();
22
22
  });
23
23
  });
24
- //# sourceMappingURL=ocr-helper.test.js.map
24
+ //# sourceMappingURL=ox-ocr-helper.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ox-ocr-helper.test.js","sourceRoot":"","sources":["../../test/ox-ocr-helper.test.ts"],"names":[],"mappings":"AAAA,OAAO,yBAAyB,CAAA;AAEhC,OAAO,EAAE,IAAI,EAAE,MAAM,KAAK,CAAA;AAE1B,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAA;AAIlD,QAAQ,CAAC,WAAW,EAAE,GAAG,EAAE;IACzB,EAAE,CAAC,+CAA+C,EAAE,KAAK,IAAI,EAAE;QAC7D,MAAM,EAAE,GAAG,MAAM,OAAO,CAAY,IAAI,CAAA,iCAAiC,CAAC,CAAA;QAE1E,MAAM,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,WAAW,CAAC,CAAA;QACtC,iCAAiC;IACnC,CAAC,CAAC,CAAA;IAEF,EAAE,CAAC,uCAAuC,EAAE,KAAK,IAAI,EAAE;QACrD,MAAM,EAAE,GAAG,MAAM,OAAO,CAAY,IAAI,CAAA,iCAAiC,CAAC,CAAA;QAC1E,EAAE,CAAC,UAAW,CAAC,aAAa,CAAC,QAAQ,CAAE,CAAC,KAAK,EAAE,CAAA;QAE/C,iCAAiC;IACnC,CAAC,CAAC,CAAA;IAEF,EAAE,CAAC,sCAAsC,EAAE,KAAK,IAAI,EAAE;QACpD,MAAM,EAAE,GAAG,MAAM,OAAO,CAAY,IAAI,CAAA,yDAAyD,CAAC,CAAA;QAElG,MAAM,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,iBAAiB,CAAC,CAAA;IAC9C,CAAC,CAAC,CAAA;IAEF,EAAE,CAAC,uBAAuB,EAAE,KAAK,IAAI,EAAE;QACrC,MAAM,EAAE,GAAG,MAAM,OAAO,CAAY,IAAI,CAAA,iCAAiC,CAAC,CAAA;QAE1E,MAAM,MAAM,CAAC,EAAE,CAAC,CAAC,SAAS,CAAC,EAAE,CAAC,EAAE,CAAC,UAAU,EAAE,CAAA;IAC/C,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA","sourcesContent":["import '../src/ox-ocr-helper.js'\n\nimport { html } from 'lit'\n\nimport { expect, fixture } from '@open-wc/testing'\n\nimport { OcrHelper } from '../src/ox-ocr-helper.js'\n\ndescribe('OcrHelper', () => {\n it('has a default title \"Hey there\" and counter 5', async () => {\n const el = await fixture<OcrHelper>(html`<ox-ocr-helper></ox-ocr-helper>`)\n\n expect(el.title).to.equal('Hey there')\n // expect(el.counter).to.equal(5)\n })\n\n it('increases the counter on button click', async () => {\n const el = await fixture<OcrHelper>(html`<ox-ocr-helper></ox-ocr-helper>`)\n el.shadowRoot!.querySelector('button')!.click()\n\n // expect(el.counter).to.equal(6)\n })\n\n it('can override the title via attribute', async () => {\n const el = await fixture<OcrHelper>(html`<ox-ocr-helper title=\"attribute title\"></ox-ocr-helper>`)\n\n expect(el.title).to.equal('attribute title')\n })\n\n it('passes the a11y audit', async () => {\n const el = await fixture<OcrHelper>(html`<ox-ocr-helper></ox-ocr-helper>`)\n\n await expect(el).shadowDom.to.be.accessible()\n })\n})\n"]}