@pod-os/elements 0.36.0-rc.1862cad.0 → 0.36.0-rc.3f5d940.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.
@@ -19152,7 +19152,7 @@ const PosUpload = class {
19152
19152
  theme: 'auto',
19153
19153
  })
19154
19154
  .use(ImageEditor)
19155
- .use(Webcam, { modes: ['picture'] });
19155
+ .use(Webcam, { modes: ['picture'], showVideoSourceDropdown: true });
19156
19156
  uppy.setOptions({
19157
19157
  restrictions: {
19158
19158
  allowedFileTypes: this.accept,
@@ -19182,7 +19182,7 @@ const PosUpload = class {
19182
19182
  }
19183
19183
  }
19184
19184
  render() {
19185
- return index.h("div", { key: 'e85f7055112697a463c2a7f2ad27932269e355e6', class: "container", ref: el => (this.uppy = el) });
19185
+ return index.h("div", { key: '0f77e2cac68f5aaf1d25a429b866015160c5787b', class: "container", ref: el => (this.uppy = el) });
19186
19186
  }
19187
19187
  };
19188
19188
  PosUpload.style = posUploadCss();
@@ -19,7 +19,7 @@ export class PosUpload {
19
19
  theme: 'auto',
20
20
  })
21
21
  .use(ImageEditor)
22
- .use(Webcam, { modes: ['picture'] });
22
+ .use(Webcam, { modes: ['picture'], showVideoSourceDropdown: true });
23
23
  uppy.setOptions({
24
24
  restrictions: {
25
25
  allowedFileTypes: this.accept,
@@ -49,7 +49,7 @@ export class PosUpload {
49
49
  }
50
50
  }
51
51
  render() {
52
- return h("div", { key: 'e85f7055112697a463c2a7f2ad27932269e355e6', class: "container", ref: el => (this.uppy = el) });
52
+ return h("div", { key: '0f77e2cac68f5aaf1d25a429b866015160c5787b', class: "container", ref: el => (this.uppy = el) });
53
53
  }
54
54
  static get is() { return "pos-upload"; }
55
55
  static get encapsulation() { return "shadow"; }
@@ -1 +1 @@
1
- {"version":3,"file":"pos-upload.js","sourceRoot":"","sources":["../../../../src/components/pos-upload/pos-upload.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,CAAC,E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G,EAAE,CAAC,EACxD,KAAK,CAAC,EAAE;oBACN,IAAI,CAAC,IAAI,CAAC,cAAc,EAAE,IAAI,EAAE,IAAI,KAAK,CAAC,KAAK,CAAC,KAAK,GAAG,KAAK,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC;gBACjF,CAAC,CACF,CAAC;YACN,CAAC;QACH,CAAC,CAAC,CAAC;IACL,CAAC;IAED,MAAM,CAAC,IAA2C;QAChD,IAAI,IAAI,CAAC,IAAI,YAAY,IAAI,EAAE,CAAC;YAC9B,OAAO,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACvB,CAAC;aAAM,IAAI,IAAI,CAAC,IAAI,YAAY,IAAI,EAAE,CAAC;YACrC,OAAO,EAAE,CAAC,IAAI,IAAI,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,IAAI,CAAC,IAAI,EAAE,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;QACnE,CAAC;aAAM,CAAC;YACN,OAAO,GAAG,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,kBAAkB,EAAE,MAAM,EAAE,2CAA2C,EAAE,CAAC,CAAC;QAC/G,CAAC;IACH,CAAC;IAED,MAAM;QACJ,OAAO,4DAAK,KAAK,EAAC,WAAW,EAAC,GAAG,EAAE,EAAE,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,GAAG,EAAE,CAAC,GAAQ,CAAC;IACpE,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, h, Prop } from '@stencil/core';\n\nimport Uppy, { Meta, UppyFile } from '@uppy/core';\nimport Dashboard from '@uppy/dashboard';\nimport ImageEditor from '@uppy/image-editor';\nimport Webcam from '@uppy/webcam';\nimport { err, ok, Result, ResultAsync } from 'neverthrow';\nimport { HttpProblem, NetworkProblem, Problem } from '@pod-os/core';\n\n@Component({\n tag: 'pos-upload',\n styleUrl: 'pos-upload.css',\n shadow: true,\n})\nexport class PosUpload {\n /**\n * The accepted file types.\n */\n @Prop()\n accept: string[] = ['image/*'];\n\n @Prop() uploader: (file: File) => ResultAsync<{ url: string }, HttpProblem | NetworkProblem>;\n\n uppy: HTMLElement;\n\n componentDidRender() {\n const uppy = new Uppy()\n .use(Dashboard, {\n inline: true,\n target: this.uppy,\n theme: 'auto',\n })\n .use(ImageEditor)\n .use(Webcam, { modes: ['picture'] });\n uppy.setOptions({\n restrictions: {\n allowedFileTypes: this.accept,\n },\n });\n uppy.addUploader(async fileIds => {\n const files = uppy.getFilesByIds(fileIds);\n uppy.emit('upload-start', files);\n\n for (const file of files) {\n await this.toFile(file)\n .asyncAndThen(it => this.uploader(it))\n .match(\n () => uppy.emit('upload-success', file, { status: 201 }),\n error => {\n uppy.emit('upload-error', file, new Error(error.title + ' - ' + error.detail));\n },\n );\n }\n });\n }\n\n toFile(file: UppyFile<Meta, Record<string, never>>): Result<File, Problem> {\n if (file.data instanceof File) {\n return ok(file.data);\n } else if (file.data instanceof Blob) {\n return ok(new File([file.data], file.name, { type: file.type }));\n } else {\n return err({ type: 'file', title: 'Unknow data type', detail: 'Expected file to be a File or Blob object' });\n }\n }\n\n render() {\n return <div class=\"container\" ref={el => (this.uppy = el)}></div>;\n }\n}\n"]}
1
+ {"version":3,"file":"pos-upload.js","sourceRoot":"","sources":["../../../../src/components/pos-upload/pos-upload.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAEnD,OAAO,IAAwB,MAAM,YAAY,CAAC;AAClD,OAAO,SAAS,MAAM,iBAAiB,CAAC;AACxC,OAAO,WAAW,MAAM,oBAAoB,CAAC;AAC7C,OAAO,MAAM,MAAM,cAAc,CAAC;AAClC,OAAO,EAAE,GAAG,EAAE,EAAE,EAAuB,MAAM,YAAY,CAAC;AAQ1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CAAC,CAAC;IACL,CAAC;IAED,MAAM,CAAC,IAA2C;QAChD,IAAI,IAAI,CAAC,IAAI,YAAY,IAAI,EAAE,CAAC;YAC9B,OAAO,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACvB,CAAC;aAAM,IAAI,IAAI,CAAC,IAAI,YAAY,IAAI,EAAE,CAAC;YACrC,OAAO,EAAE,CAAC,IAAI,IAAI,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,IAAI,CAAC,IAAI,EAAE,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;QACnE,CAAC;aAAM,CAAC;YACN,OAAO,GAAG,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,kBAAkB,EAAE,MAAM,EAAE,2CAA2C,EAAE,CAAC,CAAC;QAC/G,CAAC;IACH,CAAC;IAED,MAAM;QACJ,OAAO,4DAAK,KAAK,EAAC,WAAW,EAAC,GAAG,EAAE,EAAE,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,GAAG,EAAE,CAAC,GAAQ,CAAC;IACpE,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, h, Prop } from '@stencil/core';\n\nimport Uppy, { Meta, UppyFile } from '@uppy/core';\nimport Dashboard from '@uppy/dashboard';\nimport ImageEditor from '@uppy/image-editor';\nimport Webcam from '@uppy/webcam';\nimport { err, ok, Result, ResultAsync } from 'neverthrow';\nimport { HttpProblem, NetworkProblem, Problem } from '@pod-os/core';\n\n@Component({\n tag: 'pos-upload',\n styleUrl: 'pos-upload.css',\n shadow: true,\n})\nexport class PosUpload {\n /**\n * The accepted file types.\n */\n @Prop()\n accept: string[] = ['image/*'];\n\n @Prop() uploader: (file: File) => ResultAsync<{ url: string }, HttpProblem | NetworkProblem>;\n\n uppy: HTMLElement;\n\n componentDidRender() {\n const uppy = new Uppy()\n .use(Dashboard, {\n inline: true,\n target: this.uppy,\n theme: 'auto',\n })\n .use(ImageEditor)\n .use(Webcam, { modes: ['picture'], showVideoSourceDropdown: true });\n uppy.setOptions({\n restrictions: {\n allowedFileTypes: this.accept,\n },\n });\n uppy.addUploader(async fileIds => {\n const files = uppy.getFilesByIds(fileIds);\n uppy.emit('upload-start', files);\n\n for (const file of files) {\n await this.toFile(file)\n .asyncAndThen(it => this.uploader(it))\n .match(\n () => uppy.emit('upload-success', file, { status: 201 }),\n error => {\n uppy.emit('upload-error', file, new Error(error.title + ' - ' + error.detail));\n },\n );\n }\n });\n }\n\n toFile(file: UppyFile<Meta, Record<string, never>>): Result<File, Problem> {\n if (file.data instanceof File) {\n return ok(file.data);\n } else if (file.data instanceof Blob) {\n return ok(new File([file.data], file.name, { type: file.type }));\n } else {\n return err({ type: 'file', title: 'Unknow data type', detail: 'Expected file to be a File or Blob object' });\n }\n }\n\n render() {\n return <div class=\"container\" ref={el => (this.uppy = el)}></div>;\n }\n}\n"]}
@@ -12136,7 +12136,7 @@ const PosUpload = /*@__PURE__*/ proxyCustomElement(class PosUpload extends HTMLE
12136
12136
  theme: 'auto',
12137
12137
  })
12138
12138
  .use(ImageEditor)
12139
- .use(Webcam, { modes: ['picture'] });
12139
+ .use(Webcam, { modes: ['picture'], showVideoSourceDropdown: true });
12140
12140
  uppy.setOptions({
12141
12141
  restrictions: {
12142
12142
  allowedFileTypes: this.accept,
@@ -12166,7 +12166,7 @@ const PosUpload = /*@__PURE__*/ proxyCustomElement(class PosUpload extends HTMLE
12166
12166
  }
12167
12167
  }
12168
12168
  render() {
12169
- return h$2("div", { key: 'e85f7055112697a463c2a7f2ad27932269e355e6', class: "container", ref: el => (this.uppy = el) });
12169
+ return h$2("div", { key: '0f77e2cac68f5aaf1d25a429b866015160c5787b', class: "container", ref: el => (this.uppy = el) });
12170
12170
  }
12171
12171
  static get style() { return posUploadCss(); }
12172
12172
  }, [257, "pos-upload", {