cty-mui-core 1.0.40 → 1.0.42
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/components/camera.js +7 -8
- package/components/cty-camera-photo.js +1 -1
- package/components/cty-media-capture.js +4 -7
- package/components/cty-record.js +1 -1
- package/components/cty-segment-slides.js +3 -1
- package/components/video-capture.js +1 -1
- package/dist/cjs/cty-camera-photo.cjs.entry.js +1 -1
- package/dist/cjs/cty-camera_2.cjs.entry.js +6 -8
- package/dist/cjs/cty-media-capture.cjs.entry.js +5 -8
- package/dist/cjs/cty-mui.cjs.js +1 -1
- package/dist/cjs/cty-record.cjs.entry.js +1 -1
- package/dist/cjs/cty-segment-slides.cjs.entry.js +2 -1
- package/dist/cjs/index.cjs.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{video-capture-BO4sLa1e.js → video-capture-CzRkzdTQ.js} +1 -1
- package/dist/collection/components/camera/camera.js +26 -8
- package/dist/collection/components/camera-photo/camera-photo.js +1 -1
- package/dist/collection/components/media-capture/media-capture.css +8 -5
- package/dist/collection/components/media-capture/media-capture.js +3 -6
- package/dist/collection/components/record/record.js +1 -1
- package/dist/collection/components/segment-slides/segment-slides.js +26 -1
- package/dist/collection/utils/native/video-capture.js +1 -1
- package/dist/cty-mui/cty-mui.esm.js +1 -1
- package/dist/cty-mui/index.esm.js +1 -1
- package/dist/cty-mui/{p-a68cdc7f.system.entry.js → p-1aefb4ae.system.entry.js} +1 -1
- package/dist/cty-mui/p-229a567b.entry.js +1 -0
- package/dist/cty-mui/p-2823d286.entry.js +1 -0
- package/dist/cty-mui/p-53bbf0f2.entry.js +1 -0
- package/dist/cty-mui/{p-a337c7a9.system.entry.js → p-62bc50b2.system.entry.js} +1 -1
- package/dist/cty-mui/p-73fd4dc6.system.entry.js +1 -0
- package/dist/cty-mui/p-7ff05ecc.entry.js +1 -0
- package/dist/cty-mui/p-Cegbc1c7.system.js +1 -1
- package/dist/cty-mui/{p-CPg00410.system.js → p-CzcPp1ts.system.js} +1 -1
- package/dist/cty-mui/p-e57f36cd.entry.js +1 -0
- package/dist/cty-mui/{p-5d4ba642.system.entry.js → p-ea19acc4.system.entry.js} +1 -1
- package/dist/cty-mui/p-fc390cba.system.entry.js +1 -0
- package/dist/docs.json +76 -8
- package/dist/esm/cty-camera-photo.entry.js +1 -1
- package/dist/esm/cty-camera_2.entry.js +6 -8
- package/dist/esm/cty-media-capture.entry.js +5 -8
- package/dist/esm/cty-mui.js +1 -1
- package/dist/esm/cty-record.entry.js +1 -1
- package/dist/esm/cty-segment-slides.entry.js +2 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{video-capture-B83C8hW9.js → video-capture-0OPsBqGv.js} +1 -1
- package/dist/esm-es5/cty-camera-photo.entry.js +1 -1
- package/dist/esm-es5/cty-camera_2.entry.js +1 -1
- package/dist/esm-es5/cty-media-capture.entry.js +1 -1
- package/dist/esm-es5/cty-mui.js +1 -1
- package/dist/esm-es5/cty-record.entry.js +1 -1
- package/dist/esm-es5/cty-segment-slides.entry.js +1 -1
- package/dist/esm-es5/index.js +1 -1
- package/dist/esm-es5/loader.js +1 -1
- package/dist/types/components/camera/camera.d.ts +1 -0
- package/dist/types/components/segment-slides/segment-slides.d.ts +1 -0
- package/dist/types/components.d.ts +4 -0
- package/dist/types/utils/native/camera-preview.d.ts +1 -0
- package/package.json +1 -1
- package/dist/cty-mui/p-0c4881aa.system.entry.js +0 -1
- package/dist/cty-mui/p-6ff6ece0.entry.js +0 -1
- package/dist/cty-mui/p-94e99338.system.entry.js +0 -1
- package/dist/cty-mui/p-aeb79634.entry.js +0 -1
- package/dist/cty-mui/p-ccc21f2e.entry.js +0 -1
- package/dist/cty-mui/p-ced85d3d.entry.js +0 -1
- package/dist/cty-mui/p-e3653feb.entry.js +0 -1
- /package/dist/cty-mui/{p-CnG0E7wf.js → p-14Xxxqjd.js} +0 -0
- /package/dist/cty-mui/{p-B0tecevi.system.js → p-BaJIoBSd.system.js} +0 -0
- /package/dist/esm-es5/{video-capture-B83C8hW9.js → video-capture-0OPsBqGv.js} +0 -0
package/components/camera.js
CHANGED
|
@@ -38,6 +38,7 @@ const Camera = /*@__PURE__*/ proxyCustomElement(class Camera extends HTMLElement
|
|
|
38
38
|
this.quality = 85;
|
|
39
39
|
this.includeThumb = true;
|
|
40
40
|
this.thumbWidth = 120;
|
|
41
|
+
this.saveToLibrary = true;
|
|
41
42
|
this.file = true;
|
|
42
43
|
this.max = 9;
|
|
43
44
|
this.flipText = '翻转';
|
|
@@ -177,12 +178,12 @@ const Camera = /*@__PURE__*/ proxyCustomElement(class Camera extends HTMLElement
|
|
|
177
178
|
return cameraPreview.setZoom(idx === 0 ? 0 : Math.min(zoom, maxZoom));
|
|
178
179
|
}
|
|
179
180
|
async takePhoto() {
|
|
180
|
-
const { quality, width, height, includeThumb, thumbWidth, file, max, pictures } = this;
|
|
181
|
+
const { quality, width, height, includeThumb, thumbWidth, saveToLibrary, file, max, pictures } = this;
|
|
181
182
|
if (max > 0 && pictures.length >= max || this.currentPhotoMode === 'single' && this.pictures.length > 0 || this.isTakingPhoto) {
|
|
182
183
|
return;
|
|
183
184
|
}
|
|
184
185
|
this.isTakingPhoto = true;
|
|
185
|
-
const data = await cameraPreview.takePicture({ width, height, quality, includeThumb, thumbWidth });
|
|
186
|
+
const data = await cameraPreview.takePicture({ width, height, quality, includeThumb, thumbWidth, saveToLibrary });
|
|
186
187
|
let uri = '';
|
|
187
188
|
let thumbnail = '';
|
|
188
189
|
if (data && typeof data === 'object') {
|
|
@@ -287,12 +288,9 @@ const Camera = /*@__PURE__*/ proxyCustomElement(class Camera extends HTMLElement
|
|
|
287
288
|
if (item.action == 'permission') {
|
|
288
289
|
try {
|
|
289
290
|
await cameraPreview.openAppSettings();
|
|
290
|
-
this.permissionAlertVisible = false;
|
|
291
|
-
this.initCamera();
|
|
292
|
-
}
|
|
293
|
-
catch (error) {
|
|
294
|
-
this.closePermissionAlert(event);
|
|
295
291
|
}
|
|
292
|
+
catch (error) { }
|
|
293
|
+
this.closePermissionAlert(event);
|
|
296
294
|
}
|
|
297
295
|
}
|
|
298
296
|
closePermissionAlert(e) {
|
|
@@ -302,7 +300,7 @@ const Camera = /*@__PURE__*/ proxyCustomElement(class Camera extends HTMLElement
|
|
|
302
300
|
}
|
|
303
301
|
render() {
|
|
304
302
|
const { title, closeIcon, flash, flipText, flashText, ratioText, ratios, ratioIndex, zoomIndex, zooms, mode, singleText, multipleText, currentPhotoMode, confirmIcon, confirmText, deleteIcon, pictures, showImageViewer, imageViewerIndex, touchZoom, currentZoom } = this;
|
|
305
|
-
return (h(Host, { key: '
|
|
303
|
+
return (h(Host, { key: 'bb83ee1726feef5c84057c7723892d43f93c898c', class: "cty-camera", onClick: (e) => e.stopPropagation() }, h("cty-nav-bar", { key: '7f13f48d4ed2de835c0cd6a045268080d5c1b43e', title: title, type: "clear" }, h("slot", { key: 'fbc7dceb192a03a24396ca3be62c6c9f53825292', name: "header-start", slot: "start" }, !!closeIcon && h("ion-button", { key: 'fbf1536e049bec42259893653081110a2a1958f5', class: "cty-camera__close", onClick: () => this.close() }, h("cty-icon", { key: 'f34a507791bab61880f1f053a0e7ff5176c295dd', class: "cty-camera__close-icon", name: closeIcon })))), h("div", { key: '8277b267a0671f64c217e25d7b2669e8f9eeb1d8', class: "cty-camera-main", onTouchStart: (e) => this.touchstart(e), onTouchMove: (e) => this.touchmove(e), onTouchEnd: (e) => this.touchend(e) }, h("div", { key: '9b64b1fca0ad1bf01fe6cd383ff469e5fe9a1243', class: "cty-camera-widgets", part: "widgets" }, !!flipText && h("button", { key: 'cada5f233a4b755c00360641c0971309f310ef02', class: "cty-button-native cty-camera-widget", part: "widget", onClick: () => this.flipCamera() }, h("cty-icon", { key: 'af24b7d537825729e046aba6564c4f9e988983d4', class: "cty-camera-widget__icon", name: "cty-flip" }), !!flipText && h("span", { key: 'faa5b6ffb51768edc8e7d0bccddf33eb3531e466', class: "cty-camera-widget__text" }, flipText)), !!flashText && h("button", { key: '9addc710c3ff9fa7fe5e2dca9d7080a5b48821f4', class: "cty-button-native cty-camera-widget", part: "widget", onClick: () => this.toggleFlash() }, h("cty-icon", { key: 'b352d50ee12ffe92498e0c0a3c950a3cfc835b17', class: "cty-camera-widget__icon", name: flash ? 'cty-flash-on' : 'cty-flash-off' }), !!flashText && h("span", { key: '15daf94ee7856595ebfd0427275c30136a21085c', class: "cty-camera-widget__text" }, flashText)), !!ratioText && h("button", { key: '5d9ac7d3112165332b415636ca1f66cea5b4b576', class: "cty-button-native cty-camera-widget", part: "ratio", onClick: () => this.ratioChange() }, h("span", { key: 'adc545b141ae4cafe0ad0ee4b3f961617185bf50', class: "cty-camera-widget__ratio flex-center" }, ratios[ratioIndex]), !!ratioText && h("span", { key: 'ec406cf9e24e5a22fe81ad446b6217d27811cd82', class: "cty-camera-widget__text" }, ratioText)))), h("div", { key: '24080708dbaa7b58eff5fac1477b8bf2556aabf5', class: "cty-camera-controls safe-area-bottom-padding" }, mode == 'both' && pictures.length <= 0 && h("div", { key: '2856de71e0a012616e0fd5b634d32d6f51d817c1', class: "cty-camera-controls__mode flex-center", part: "mode" }, h("button", { key: '689ba86505b49126c6794858e00903926744f4c5', class: { 'cty-button-native cty-camera-controls__mode-button': true, 'cty-camera-controls__mode-button__active': currentPhotoMode === 'single' }, onClick: () => this.currentPhotoMode = 'single' }, singleText), h("button", { key: '78b37ce3691d31241f25226165ed539f93f45fb8', class: { 'cty-button-native cty-camera-controls__mode-button': true, 'cty-camera-controls__mode-button__active': currentPhotoMode === 'multiple' }, onClick: () => this.currentPhotoMode = 'multiple' }, multipleText)), h("slot", { key: '321e3e6c93cb0c0474fd18811dc58c8e9553e99a', name: "zooms" }, !touchZoom && zooms.length > 0 && h("div", { key: '5633dfbc4a605ab9650d225b6ac81fb8a6549759', class: "cty-camera-controls__zooms flex-center", part: "zooms" }, zooms.map((item, idx) => (h("div", { class: { 'cty-camera-controls__zoom-item flex-center': true, 'cty-camera-controls__zoom-item__active': zoomIndex === idx }, onClick: () => this.setZoom(idx) }, h("span", { class: "cty-camera-controls__zoom-text flex-center" }, item, "X"))))), touchZoom && h("div", { key: 'ceeaa663f2c0af94ee6a9e7396ac6fca0969fa8b', class: "cty-camera-controls__zooms flex-center", part: "zooms" }, h("div", { key: 'eb7f380ce6b4fa09ece885f4b644258346417fa9', class: { 'cty-camera-controls__zoom-item flex-center cty-camera-controls__zoom-item__active': true }, onClick: () => this.resetZoom() }, h("span", { key: '54935930412f8a827d56735da55e02caeb272c65', class: "cty-camera-controls__zoom-text flex-center" }, currentZoom, "X")))), h("div", { key: '429b787c541081536061362da6eb4055a402d90c', class: "cty-camera-controls__main flex-center" }, h("div", { key: 'da4502d5cba1ef557847ceda031ef12757637134', class: "cty-camera-controls__main-left flex-center" }), h("div", { key: '32faefbc45c3a6101f12048e7e498c47dd7aec26', class: "cty-camera-controls__take-photo flex-center" }, h("button", { key: '62b7db4847e099acdfdebbad0b6fd8e933b089cf', class: "cty-button-native cty-camera-controls__take-photo-button", part: "take-photo", onClick: () => this.takePhoto() })), h("div", { key: '368c5af68ee1c0da60afe16eb0faca9ec8e56561', class: "cty-camera-controls__main-confirm flex-center" }, currentPhotoMode !== 'single' && pictures.length > 0 && !!deleteIcon && h("button", { key: 'a7867e322531dd4bd2597915e14fbb469f0b9a58', class: "cty-camera-controls__main-delete cty-button-native flex-column-center", onClick: () => this.deleteLastPicture() }, h("cty-icon", { key: '355bd21f2feb8c790dcdb1e52301257b7d3ccdef', class: "cty-camera-controls__main-delete-icon", name: deleteIcon })), currentPhotoMode !== 'single' && pictures.length > 0 && h("button", { key: 'd577f40fe7ba3cc3f38defec443357fc2c3fc7fe', class: "cty-button-native flex-column-center", onClick: () => this.confirm() }, h("cty-icon", { key: '67599611fbcc9c5bb292e4d2d4fe7d93dbf6e274', class: "cty-camera-controls__main-confirm-icon", name: confirmIcon }), confirmText && h("span", { key: 'b592907eb84e2d6c255c252e5bbd50533c737c47', class: "cty-camera-controls__main-confirm-text" }, confirmText)))), h("slot", { key: '6dbc7b9d6ed47f647c561ed1a1e7ff621dfe635e', name: "images" }, h("div", { key: '5428de1571189999e306abd4115487a681360e79', class: "cty-camera-controls__images flex-align-center" }, currentPhotoMode !== 'single' && pictures.map((item, idx) => (h("div", { class: "cty-camera-controls__image", onClick: () => this.toImageViewer(idx) }, h("img", { class: 'cty-camera-controls__image-img', src: item.thumbnail || item.url }), h("button", { class: "cty-button-native", onClick: (e) => this.deletePicture(e, idx) }, h("cty-icon", { class: "cty-camera-controls__image-delete", name: closeOutline })))))))), showImageViewer && h("cty-image-viewer", { key: 'd42a638850e04f7920176fd63af812034ab754a6', images: pictures.map(item => item.url), initialSlide: imageViewerIndex, overlayIndex: 100, backdropDismiss: false, closeable: false, onCtyDismiss: (e) => this.closeImageViewer(e) }, currentPhotoMode !== 'multiple' && h("div", { key: '2dc441f65a66d38d271c390bc2fb1ebaa26c52f5', class: "cty-camera-viewer__single flex-center-between", slot: "pager" }, h("button", { key: '8c80910fb2d0ef00c828f0eec19d9c50309d2dca', class: "cty-camera-viewer__single-close cty-button-native", onClick: (event) => this.closeSingleImageViewer(event) }, h("cty-icon", { key: '3c606131b6693c04957d4114d4cf757a1df5453a', name: "cty-close2" })), h("button", { key: '56e9915d1224049cc9d48d7aa3a875d66a47c50a', class: "cty-camera-viewer__single-confirm cty-button-native", onClick: () => this.confirm() }, h("cty-icon", { key: '895c32f1f067760c15ac82ce0c1f31db069daa82', name: "cty-tick" }))), currentPhotoMode !== 'multiple' && h("i", { key: '5b4a7c8cc661e11127804aad19204cd4abdbb6dc', slot: "close" })), this.permissionAlertVisible && h("cty-permission-alert", { key: '87f6eac68fd015a6a1902a1cda5d546cabea9e3b', part: "permission-alert", title: this.permissionAlertTitle, content: this.permissionAlertContent, buttons: this.permissionAlertbuttons, onCtyDismiss: (e) => this.closePermissionAlert(e), onCtyTap: (e) => this.toOpenAppSetting(e) }), h("ion-toast", { key: '7fe4417cee38fe17e86cc52ddda0f09a3270b38e', "is-open": this.isToastOpen, message: this.toastContent, duration: 2000, position: 'middle' })));
|
|
306
304
|
}
|
|
307
305
|
get el() { return this; }
|
|
308
306
|
static get style() { return cameraCss; }
|
|
@@ -317,6 +315,7 @@ const Camera = /*@__PURE__*/ proxyCustomElement(class Camera extends HTMLElement
|
|
|
317
315
|
"quality": [2],
|
|
318
316
|
"includeThumb": [4, "include-thumb"],
|
|
319
317
|
"thumbWidth": [2, "thumb-width"],
|
|
318
|
+
"saveToLibrary": [4, "save-to-library"],
|
|
320
319
|
"file": [4],
|
|
321
320
|
"max": [2],
|
|
322
321
|
"flipText": [1, "flip-text"],
|
|
@@ -271,7 +271,7 @@ const CameraPhoto = /*@__PURE__*/ proxyCustomElement(class CameraPhoto extends H
|
|
|
271
271
|
this.permissionAlertVisible = false;
|
|
272
272
|
}
|
|
273
273
|
render() {
|
|
274
|
-
return (h(Host, { key: '6626fa119a9c343df0fd6175c16c0a9cd18b6bf2', class: Object.assign(Object.assign({}, getClassMap(this.cssClass)), { 'overlay-hidden': true, 'cty-pos-cover': this.overlay }), style: { zIndex: `${20000 + this.overlayIndex}` } }, h("cty-action-sheet", { key: 'b88a31483aaee47dad3969a616eb74945d199447', class: "cty-camera-photo", animated: false, overlayIndex: 1, backdropDismiss: this.backdropDismiss, title: this.title, closeable: this.closeable, closeIcon: this.closeIcon, cancelText: this.cancelText, options: this.options, onCtyDismiss: () => this.dismiss(), onCtyTap: e => this._buttonClick(e) }), this.showCropImage && (h("cty-backdrop", { key: '83e30b75f98f48e69e97898c6b95e835e519f999', backdropDismiss: false }, h("cty-crop-image", { key: 'e382a18a7c8d9b212f01843d78a1000112e5d486', url: this.clipImage, cancelText: this.clipCancelText, confirmText: this.clipCconfirmText, imageWidth: this.clipImageWidth, imageBackground: this.clipImageBg, maxScale: this.clipMaxScale, minScale: this.clipMinScale, suffix: this.clipImageSuffix, quality: this.clipImageQuality, onCtyCancel: () => this._doCropCancel(), onCtyConfirm: (e) => this._doCropConfirm(e) }))), this.showPermissionPurpose && h("cty-permission-purpose", { key: '55dd946e9896839ccd7930b1b3e0573429e29dc1', description: this.permissionDescription }), this.continuous && this.showCameraPreview && h("cty-camera", Object.assign({ key: '67729d43a590b8630169bd1daac1117f1f41641c' }, this.cameraProps, { onCtyDismiss: () => this.showCameraPreview = false, onCtyConfirm: (e) => this.continuousConfirm(e) })), this.permissionAlertVisible && h("cty-permission-alert", { key: '
|
|
274
|
+
return (h(Host, { key: '6626fa119a9c343df0fd6175c16c0a9cd18b6bf2', class: Object.assign(Object.assign({}, getClassMap(this.cssClass)), { 'overlay-hidden': true, 'cty-pos-cover': this.overlay }), style: { zIndex: `${20000 + this.overlayIndex}` } }, h("cty-action-sheet", { key: 'b88a31483aaee47dad3969a616eb74945d199447', class: "cty-camera-photo", animated: false, overlayIndex: 1, backdropDismiss: this.backdropDismiss, title: this.title, closeable: this.closeable, closeIcon: this.closeIcon, cancelText: this.cancelText, options: this.options, onCtyDismiss: () => this.dismiss(), onCtyTap: e => this._buttonClick(e) }), this.showCropImage && (h("cty-backdrop", { key: '83e30b75f98f48e69e97898c6b95e835e519f999', backdropDismiss: false }, h("cty-crop-image", { key: 'e382a18a7c8d9b212f01843d78a1000112e5d486', url: this.clipImage, cancelText: this.clipCancelText, confirmText: this.clipCconfirmText, imageWidth: this.clipImageWidth, imageBackground: this.clipImageBg, maxScale: this.clipMaxScale, minScale: this.clipMinScale, suffix: this.clipImageSuffix, quality: this.clipImageQuality, onCtyCancel: () => this._doCropCancel(), onCtyConfirm: (e) => this._doCropConfirm(e) }))), this.showPermissionPurpose && h("cty-permission-purpose", { key: '55dd946e9896839ccd7930b1b3e0573429e29dc1', description: this.permissionDescription }), this.continuous && this.showCameraPreview && h("cty-camera", Object.assign({ key: '67729d43a590b8630169bd1daac1117f1f41641c' }, this.cameraProps, { onCtyDismiss: () => this.showCameraPreview = false, onCtyConfirm: (e) => this.continuousConfirm(e) })), this.permissionAlertVisible && h("cty-permission-alert", { key: '64742e62f0a6172a8533e68d815f9ab2a084cf32', part: "permission-alert", title: this.permissionAlertTitle, content: this.permissionAlertContent, buttons: this.permissionAlertbuttons, onCtyDismiss: (e) => this.closePermissionAlert(e), onCtyTap: (e) => this.toOpenAppSetting(e) }), h("ion-toast", { key: 'c5b814ec61ba275fe28c5fc49160955914756a68', "is-open": this.isToastOpen, message: this.toastContent, duration: 2000, position: 'middle' })));
|
|
275
275
|
}
|
|
276
276
|
get el() { return this; }
|
|
277
277
|
static get watchers() { return {
|
|
@@ -8,7 +8,7 @@ import { d as defineCustomElement$4 } from './icon.js';
|
|
|
8
8
|
import { d as defineCustomElement$3 } from './permission-alert.js';
|
|
9
9
|
import { d as defineCustomElement$2 } from './icon2.js';
|
|
10
10
|
|
|
11
|
-
const mediaCaptureCss = "*{-webkit-box-sizing:border-box;box-sizing:border-box}p,h1,h2,h3,h4,h5,h6{margin:0;padding:0}.flex{display:-ms-flexbox;display:flex}.flex-wrap{display:-ms-flexbox;display:flex;-ms-flex-flow:wrap;flex-flow:wrap}.flex-align-start{display:-ms-flexbox;display:flex;-ms-flex-align:start;align-items:flex-start}.flex-align-center{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}.flex-align-end{display:-ms-flexbox;display:flex;-ms-flex-align:end;align-items:flex-end}.flex-justify-start{display:-ms-flexbox;display:flex;-ms-flex-pack:start;justify-content:flex-start}.flex-justify-center{display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center}.flex-justify-end{display:-ms-flexbox;display:flex;-ms-flex-pack:end;justify-content:flex-end}.flex-align-end-start{display:-ms-flexbox;display:flex;-ms-flex-align:end;align-items:flex-end;-ms-flex-pack:start;justify-content:flex-start}.flex-align-end-center{display:-ms-flexbox;display:flex;-ms-flex-align:end;align-items:flex-end;-ms-flex-pack:center;justify-content:center}.flex-align-end-end{display:-ms-flexbox;display:flex;-ms-flex-align:end;align-items:flex-end;-ms-flex-pack:end;justify-content:flex-end}.flex-center{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center}.flex-center-justify-end{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:end;justify-content:flex-end}.flex-between{display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between}.flex-center-between{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:justify;justify-content:space-between}.flex-column{display:-ms-flexbox;display:flex;-ms-flex-flow:column;flex-flow:column}.flex-column-align-center{display:-ms-flexbox;display:flex;-ms-flex-flow:column;flex-flow:column;-ms-flex-align:center;align-items:center}.flex-column-justify-center{display:-ms-flexbox;display:flex;-ms-flex-flow:column;flex-flow:column;-ms-flex-pack:center;justify-content:center}.flex-column-center{display:-ms-flexbox;display:flex;-ms-flex-flow:column;flex-flow:column;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center}.flex-column-between{display:-ms-flexbox;display:flex;-ms-flex-flow:column;flex-flow:column;-ms-flex-pack:justify;justify-content:space-between}.flex-column-center-between{display:-ms-flexbox;display:flex;-ms-flex-flow:column;flex-flow:column;-ms-flex-align:center;align-items:center;-ms-flex-pack:justify;justify-content:space-between}.cty-button-native{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;margin:0;padding:0;background:transparent;font-family:inherit;font-size:inherit;font-style:inherit;font-weight:inherit;letter-spacing:inherit;text-decoration:inherit;text-indent:inherit;text-overflow:inherit;text-transform:inherit;text-align:inherit;white-space:inherit;color:inherit;line-height:1;border:0;outline:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-appearance:none;-moz-appearance:none;appearance:none;border-radius:0;-webkit-box-shadow:none;box-shadow:none;cursor:pointer}:host{--cty-media-capture-video-background:var(--cty-color-black);--cty-media-capture-header-top:var(--ion-safe-area-top, 44px);--cty-media-capture-header-padding-start:
|
|
11
|
+
const mediaCaptureCss = "*{-webkit-box-sizing:border-box;box-sizing:border-box}p,h1,h2,h3,h4,h5,h6{margin:0;padding:0}.flex{display:-ms-flexbox;display:flex}.flex-wrap{display:-ms-flexbox;display:flex;-ms-flex-flow:wrap;flex-flow:wrap}.flex-align-start{display:-ms-flexbox;display:flex;-ms-flex-align:start;align-items:flex-start}.flex-align-center{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}.flex-align-end{display:-ms-flexbox;display:flex;-ms-flex-align:end;align-items:flex-end}.flex-justify-start{display:-ms-flexbox;display:flex;-ms-flex-pack:start;justify-content:flex-start}.flex-justify-center{display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center}.flex-justify-end{display:-ms-flexbox;display:flex;-ms-flex-pack:end;justify-content:flex-end}.flex-align-end-start{display:-ms-flexbox;display:flex;-ms-flex-align:end;align-items:flex-end;-ms-flex-pack:start;justify-content:flex-start}.flex-align-end-center{display:-ms-flexbox;display:flex;-ms-flex-align:end;align-items:flex-end;-ms-flex-pack:center;justify-content:center}.flex-align-end-end{display:-ms-flexbox;display:flex;-ms-flex-align:end;align-items:flex-end;-ms-flex-pack:end;justify-content:flex-end}.flex-center{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center}.flex-center-justify-end{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:end;justify-content:flex-end}.flex-between{display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between}.flex-center-between{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:justify;justify-content:space-between}.flex-column{display:-ms-flexbox;display:flex;-ms-flex-flow:column;flex-flow:column}.flex-column-align-center{display:-ms-flexbox;display:flex;-ms-flex-flow:column;flex-flow:column;-ms-flex-align:center;align-items:center}.flex-column-justify-center{display:-ms-flexbox;display:flex;-ms-flex-flow:column;flex-flow:column;-ms-flex-pack:center;justify-content:center}.flex-column-center{display:-ms-flexbox;display:flex;-ms-flex-flow:column;flex-flow:column;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center}.flex-column-between{display:-ms-flexbox;display:flex;-ms-flex-flow:column;flex-flow:column;-ms-flex-pack:justify;justify-content:space-between}.flex-column-center-between{display:-ms-flexbox;display:flex;-ms-flex-flow:column;flex-flow:column;-ms-flex-align:center;align-items:center;-ms-flex-pack:justify;justify-content:space-between}.cty-button-native{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;margin:0;padding:0;background:transparent;font-family:inherit;font-size:inherit;font-style:inherit;font-weight:inherit;letter-spacing:inherit;text-decoration:inherit;text-indent:inherit;text-overflow:inherit;text-transform:inherit;text-align:inherit;white-space:inherit;color:inherit;line-height:1;border:0;outline:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-appearance:none;-moz-appearance:none;appearance:none;border-radius:0;-webkit-box-shadow:none;box-shadow:none;cursor:pointer}:host{--cty-media-capture-video-background:var(--cty-color-black);--cty-media-capture-header-top:var(--ion-safe-area-top, 44px);--cty-media-capture-header-padding-start:6px;--cty-media-capture-header-padding-end:15px;--cty-media-capture-close-icon-size:32px;--cty-media-capture-close-icon-color:var(--cty-color-primary);--cty-media-capture-time-padding:2px 5px;--cty-media-capture-time-bg-color:#f00;--cty-media-capture-time-size:var(--cty-font-size-base);--cty-media-capture-time-color:var(--cty-color-white);--cty-media-capture-time-border-radius:var(--cty-border-radius-small);--cty-media-capture-footer-bottom:var(--ion-safe-area-bottom, 30px);--cty-media-capture-switch-size:60px;--cty-media-capture-switch-bg-color:var(--cty-color-primary);--cty-media-capture-switch-active-bg-color:#f00;--cty-media-capture-switch-border-width:3px;--cty-media-capture-switch-active-size:24px;--cty-media-capture-status-size:48px;--cty-media-capture-confirm-min-height:30px;--cty-media-capture-confirm-padding:0 1em;--cty-media-capture-confirm-size:var(--cty-font-size-base);--cty-media-capture-confirm-color:var(--cty-color-white);--cty-media-capture-confirm-bg-color:var(--cty-color-primary);--cty-media-capture-confirm-right:15px;--cty-media-capture-confirm-border-radius:var(--cty-border-radius-base);--cty-media-capture-video-object-fit:cover;position:absolute;left:0;top:0;width:100vw;height:100vh;visibility:visible !important}:host(.cty-media-captured){background:var(--cty-media-capture-video-background)}.cty-media-capture__header{position:absolute;z-index:1;left:0;top:var(--cty-media-capture-header-top);width:100%;padding-left:var(--cty-media-capture-header-padding-start);padding-right:var(--cty-media-capture-header-padding-end)}.cty-media-close__captured{margin-left:6px}.cty-capture__close-icon{font-size:var(--cty-media-capture-close-icon-size);color:var(--cty-media-capture-close-icon-color)}.cty-media-capture__time{position:absolute;left:50%;top:50%;padding:var(--cty-media-capture-time-padding);border-radius:var(--cty-media-capture-time-border-radius);font-size:var(--cty-media-capture-time-size);color:var(--cty-media-capture-time-color);-webkit-transform:translate(-50%, -50%);transform:translate(-50%, -50%)}.cty-media-capture__time-active{background:var(--cty-media-capture-time-bg-color)}.cty-media-capture__footer{position:absolute;bottom:var(--cty-media-capture-footer-bottom);left:0;width:100%}.cty-media-capture__switch{width:var(--cty-media-capture-switch-size);height:var(--cty-media-capture-switch-size);border-color:var(--cty-media-capture-switch-bg-color);border-width:var(--cty-media-capture-switch-border-width);border-style:solid;border-radius:var(--cty-border-radius-circle);cursor:pointer}.cty-media-capture__status{width:var(--cty-media-capture-status-size);height:var(--cty-media-capture-status-size);border-radius:var(--cty-border-radius-circle);background:var(--cty-media-capture-switch-bg-color);-webkit-transition:0.3s;transition:0.3s}.cty-media-capture__status-active{width:var(--cty-media-capture-switch-active-size);height:var(--cty-media-capture-switch-active-size);border-radius:var(--cty-border-radius-base);background:var(--cty-media-capture-switch-active-bg-color)}.cty-media-capture__confirm{position:absolute;right:var(--cty-media-capture-confirm-right);bottom:0;min-height:var(--cty-media-capture-confirm-min-height);background:var(--cty-media-capture-confirm-bg-color);padding:var(--cty-media-capture-confirm-padding);color:var(--cty-media-capture-confirm-color);font-size:var(--cty-media-capture-confirm-size);border-radius:var(--cty-media-capture-confirm-border-radius)}.cty-media-capture__video{position:absolute;left:0;top:0;width:100%;height:100%;-o-object-fit:var(--cty-media-capture-video-object-fit);object-fit:var(--cty-media-capture-video-object-fit)}";
|
|
12
12
|
|
|
13
13
|
const MediaCapture = /*@__PURE__*/ proxyCustomElement(class MediaCapture extends HTMLElement {
|
|
14
14
|
constructor() {
|
|
@@ -133,12 +133,9 @@ const MediaCapture = /*@__PURE__*/ proxyCustomElement(class MediaCapture extends
|
|
|
133
133
|
if (item.action == 'permission') {
|
|
134
134
|
try {
|
|
135
135
|
await videoCapture.openAppSettings();
|
|
136
|
-
this.permissionAlertVisible = false;
|
|
137
|
-
this.initVideoCapture();
|
|
138
|
-
}
|
|
139
|
-
catch (error) {
|
|
140
|
-
this.closePermissionAlert(event);
|
|
141
136
|
}
|
|
137
|
+
catch (error) { }
|
|
138
|
+
this.closePermissionAlert(event);
|
|
142
139
|
}
|
|
143
140
|
}
|
|
144
141
|
closePermissionAlert(e) {
|
|
@@ -148,7 +145,7 @@ const MediaCapture = /*@__PURE__*/ proxyCustomElement(class MediaCapture extends
|
|
|
148
145
|
}
|
|
149
146
|
render() {
|
|
150
147
|
const captureDuration = secondsToVehicle(this.captureDuration);
|
|
151
|
-
return (h(Host, { key: '
|
|
148
|
+
return (h(Host, { key: '4b705601c4835f377f498ccef4aa73def22e382f', class: { 'cty-media-capture': true, 'cty-media-captured': this.isCaptured } }, h("div", { key: '871a7976fddfeaf2628fc8fbb2a3817f94fcf4a2', class: "cty-media-capture__header" }, h("button", { key: '54a7555a893326ffa82b00244715141da60c49ff', onClick: () => this.doHeaderAction(), class: { 'cty-button-native': true, 'cty-media-close__captured': this.isCaptured } }, h("cty-icon", { key: '17e1c892e2662ed027216cceb869f5e6e6aaed0e', class: "cty-capture__close-icon", name: this.isCaptured ? this.revocationIcon : this.closeIcon })), this.captureTime && (this.isCaptured || this.capturing) && (h("span", { key: '5aa04bea03cca3c38a3085a2c1ef056f00a0ee1e', class: { 'cty-media-capture__time': true, 'cty-media-capture__time-active': this.capturing } }, captureDuration))), this.isCaptured && (h("video", { key: '98ae7adc1a838d36efe3899617c360627d2d54d0', ref: el => (this.videoEl = el), class: "cty-media-capture__video", autoplay: this.autoplay, loop: this.loop, poster: this.poster, src: this.videoFileUrl, playsinline: true, "webkit-playsinline": true, controls: this.controls, onClick: e => this.toggleVideo(e) })), h("div", { key: '2f3ae3d6e0f7cba849f8f3a65ce0b6ba8aec7569', class: "cty-media-capture__footer flex-center" }, !this.isCaptured && (h("button", { key: '2a6028f8e92173d141ca40070baf16b3114fdea0', class: "cty-media-capture__switch cty-button-native", onClick: () => this.doCapture() }, h("span", { key: '9e137a557d954aab33231e3cb543f545d77e3c98', class: { 'cty-media-capture__status': true, 'cty-media-capture__status-active': this.capturing } }))), this.isCaptured && (h("button", { key: '5cfbe32fc7402c0dbef603de2836dc754933049e', class: "cty-media-capture__confirm cty-button-native", onClick: () => this.confirm() }, this.confirmText))), h("slot", { key: '25348589fab2be43d9bea0cadfc14f052166d7dc' }), this.permissionAlertVisible && h("cty-permission-alert", { key: '776845d27801596c0761c7867b9fb0c2088810ff', part: "permission-alert", title: this.permissionAlertTitle, content: this.permissionAlertContent, buttons: this.permissionAlertbuttons, onCtyDismiss: (e) => this.closePermissionAlert(e), onCtyTap: (e) => this.toOpenAppSetting(e) })));
|
|
152
149
|
}
|
|
153
150
|
get el() { return this; }
|
|
154
151
|
static get style() { return mediaCaptureCss; }
|
package/components/cty-record.js
CHANGED
|
@@ -291,7 +291,7 @@ const Record = /*@__PURE__*/ proxyCustomElement(class Record extends HTMLElement
|
|
|
291
291
|
this.permissionAlertVisible = false;
|
|
292
292
|
}
|
|
293
293
|
render() {
|
|
294
|
-
return (h(Host, { key: '43324ef68b0f2e8d1a9ce076112c87432df17213', class: Object.assign(Object.assign({}, getClassMap(this.cssClass)), { 'overlay-hidden cty-pos-cover': true }), style: { zIndex: `${20000 + this.overlayIndex}` } }, h("cty-backdrop", { key: '45ebeab107e3af77c58e3680b8dad93b299de623', position: "bottom", backdropDismiss: this.backdropDismiss, onCtyDismiss: () => this.dismiss() }, h("div", { key: 'd215b46f4de67b97979831404e9bb708a0b4fffe', class: "cty-record safe-area-bottom-padding flex-center-column", onClick: (e) => e.stopPropagation() }, h("slot", { key: 'b4b9ea9cfc0956436174eb43957f0d13217ec549', name: "header" }), this.closeable && (h("div", { key: 'a5ca9aadbc15f2d8e69b26acad63e4b9cb19cc37', class: "cty-record__close", onClick: () => this.handleCloseRecord() }, h("cty-icon", { key: 'ef0fa355dea771b315667761c4a0ea304ad90364', name: closeOutline }))), h("p", { key: 'bd67297dfaafcadb7f77816f1bfcf1231a59dea6', class: "cty-record__desc" }, this.recordDescription), h("p", { key: '327aa0fa2fa70dc70a9e8c91f481ddff0dd930dd', class: "cty-record__time" }, this.recordDuration), h("div", { key: 'a3f5acd54fda613ec1dbb70428dfbb64a34cc579', class: "cty-record__main flex-align-end-center" }, this.recorded && (h("button", { key: 'f6a65afcbcd1f395765df9ce2629dd4b53593f84', class: "cty-record__redo flex-column-center cty-button-native", onClick: () => this.restartRecording() }, h("cty-icon", { key: '4530c67455c3d551c16cba6a0a081a4cf9e22809', name: "cty-redo", class: "flex-center" }), h("span", { key: '4940cdee4266b61742b23ae60c78fc62c07cb09c' }, "\u91CD\u5F55"))), !this.recording && (h("button", { key: '54e3efce63bd0cdd1e96777252571e1c8945cdaa', class: "cty-record__button cty-button-native", onClick: () => this.handleRecordAction() }, !this.auditioning && !this.recorded && h("cty-icon", { key: '4cb49678c931c4f806a3e2c54b398fa0b62e56b8', name: "cty-record" }), this.auditioning && this.recorded && h("cty-icon", { key: '6ccc9e0e3a35a7a0daa50af3e2fcac2e81e44be2', name: "cty-pause" }), !this.auditioning && this.recorded && h("cty-icon", { key: 'aea60df70839e471250802a87682c293e9f9ea55', name: "cty-play" }))), this.recording && (h("div", { key: '719d50881292e5555acf44bb2047bb84d32ee3e7', class: "cty-record__recording flex-center", onClick: () => this.stopRecording() }, h("cty-circle", { key: '744b19f125e415686936d1af242ad96b7ad6508c', rate: (this.recordSecond / this.maxSeconds) * 100, width: this.circleWidth, color: this.circleColor }), h("cty-icon", { key: 'ef31ac9b11abad0f5d989c1647ce6203961cb84e', name: "cty-pause" }))), this.recorded && (h("button", { key: '50466c6883029528186cada3bb0c4a2d0bef71bf', class: "cty-record__yes flex-column-center cty-button-native", onClick: () => this.confirmRecording() }, h("cty-icon", { key: 'd5d2b82dcf94217659140b802237449ebeeddd87', name: "cty-yes", class: "flex-center" }), h("span", { key: '2a71ba3edecc390e8e246ed396665ece96154ed4' }, "\u786E\u5B9A")))), !this.auditioning && !this.recorded && !this.recording && h("p", { key: 'd10af2a0a94fed05752d36d90433e2e779253ae1', class: "cty-record__send" }, "\u4EC5\u53D1\u9001\u8BED\u97F3"), (this.auditioning || this.recorded || this.recording) && h("p", { key: '926937f8eb05e802b790d76e93936c95d1692695', class: "cty-record__status" }, this.recordState))), h("ion-toast", { key: '4590611480e2b27ecd1e0c8ac0719924252948a9', isOpen: this.toastOptions.isOpen, message: this.toastOptions.message, duration: 2000, position: "middle", onIonToastWillDismiss: () => (this.toastOptions.isOpen = false) }), this.showWarning && h("cty-alert", { key: 'bdfe00993cdb88a3a4f63292610e56b4cc6dbbf6', title: "\u53D6\u6D88\u5F55\u97F3", content: "\u786E\u5B9A\u53D6\u6D88\u672C\u6761\u5F55\u97F3\uFF1F", buttons: ['取消', '确定'], overlayIndex: 1, onCtyTap: e => this.handleAlertAction(e) }, h("button", { key: 'e34d25e615d06fde71388d50ebb0ddc47be989a9', slot: "close", class: "cty--record__alert-close cty-button-native", onClick: () => this.showWarning = false }, h("cty-icon", { key: '4c4fe78dd1011901e763bbf41cb6e40409ce70e1', name: "cty-close2" }))), this.permissionAlertVisible && h("cty-permission-alert", { key: '
|
|
294
|
+
return (h(Host, { key: '43324ef68b0f2e8d1a9ce076112c87432df17213', class: Object.assign(Object.assign({}, getClassMap(this.cssClass)), { 'overlay-hidden cty-pos-cover': true }), style: { zIndex: `${20000 + this.overlayIndex}` } }, h("cty-backdrop", { key: '45ebeab107e3af77c58e3680b8dad93b299de623', position: "bottom", backdropDismiss: this.backdropDismiss, onCtyDismiss: () => this.dismiss() }, h("div", { key: 'd215b46f4de67b97979831404e9bb708a0b4fffe', class: "cty-record safe-area-bottom-padding flex-center-column", onClick: (e) => e.stopPropagation() }, h("slot", { key: 'b4b9ea9cfc0956436174eb43957f0d13217ec549', name: "header" }), this.closeable && (h("div", { key: 'a5ca9aadbc15f2d8e69b26acad63e4b9cb19cc37', class: "cty-record__close", onClick: () => this.handleCloseRecord() }, h("cty-icon", { key: 'ef0fa355dea771b315667761c4a0ea304ad90364', name: closeOutline }))), h("p", { key: 'bd67297dfaafcadb7f77816f1bfcf1231a59dea6', class: "cty-record__desc" }, this.recordDescription), h("p", { key: '327aa0fa2fa70dc70a9e8c91f481ddff0dd930dd', class: "cty-record__time" }, this.recordDuration), h("div", { key: 'a3f5acd54fda613ec1dbb70428dfbb64a34cc579', class: "cty-record__main flex-align-end-center" }, this.recorded && (h("button", { key: 'f6a65afcbcd1f395765df9ce2629dd4b53593f84', class: "cty-record__redo flex-column-center cty-button-native", onClick: () => this.restartRecording() }, h("cty-icon", { key: '4530c67455c3d551c16cba6a0a081a4cf9e22809', name: "cty-redo", class: "flex-center" }), h("span", { key: '4940cdee4266b61742b23ae60c78fc62c07cb09c' }, "\u91CD\u5F55"))), !this.recording && (h("button", { key: '54e3efce63bd0cdd1e96777252571e1c8945cdaa', class: "cty-record__button cty-button-native", onClick: () => this.handleRecordAction() }, !this.auditioning && !this.recorded && h("cty-icon", { key: '4cb49678c931c4f806a3e2c54b398fa0b62e56b8', name: "cty-record" }), this.auditioning && this.recorded && h("cty-icon", { key: '6ccc9e0e3a35a7a0daa50af3e2fcac2e81e44be2', name: "cty-pause" }), !this.auditioning && this.recorded && h("cty-icon", { key: 'aea60df70839e471250802a87682c293e9f9ea55', name: "cty-play" }))), this.recording && (h("div", { key: '719d50881292e5555acf44bb2047bb84d32ee3e7', class: "cty-record__recording flex-center", onClick: () => this.stopRecording() }, h("cty-circle", { key: '744b19f125e415686936d1af242ad96b7ad6508c', rate: (this.recordSecond / this.maxSeconds) * 100, width: this.circleWidth, color: this.circleColor }), h("cty-icon", { key: 'ef31ac9b11abad0f5d989c1647ce6203961cb84e', name: "cty-pause" }))), this.recorded && (h("button", { key: '50466c6883029528186cada3bb0c4a2d0bef71bf', class: "cty-record__yes flex-column-center cty-button-native", onClick: () => this.confirmRecording() }, h("cty-icon", { key: 'd5d2b82dcf94217659140b802237449ebeeddd87', name: "cty-yes", class: "flex-center" }), h("span", { key: '2a71ba3edecc390e8e246ed396665ece96154ed4' }, "\u786E\u5B9A")))), !this.auditioning && !this.recorded && !this.recording && h("p", { key: 'd10af2a0a94fed05752d36d90433e2e779253ae1', class: "cty-record__send" }, "\u4EC5\u53D1\u9001\u8BED\u97F3"), (this.auditioning || this.recorded || this.recording) && h("p", { key: '926937f8eb05e802b790d76e93936c95d1692695', class: "cty-record__status" }, this.recordState))), h("ion-toast", { key: '4590611480e2b27ecd1e0c8ac0719924252948a9', isOpen: this.toastOptions.isOpen, message: this.toastOptions.message, duration: 2000, position: "middle", onIonToastWillDismiss: () => (this.toastOptions.isOpen = false) }), this.showWarning && h("cty-alert", { key: 'bdfe00993cdb88a3a4f63292610e56b4cc6dbbf6', title: "\u53D6\u6D88\u5F55\u97F3", content: "\u786E\u5B9A\u53D6\u6D88\u672C\u6761\u5F55\u97F3\uFF1F", buttons: ['取消', '确定'], overlayIndex: 1, onCtyTap: e => this.handleAlertAction(e) }, h("button", { key: 'e34d25e615d06fde71388d50ebb0ddc47be989a9', slot: "close", class: "cty--record__alert-close cty-button-native", onClick: () => this.showWarning = false }, h("cty-icon", { key: '4c4fe78dd1011901e763bbf41cb6e40409ce70e1', name: "cty-close2" }))), this.permissionAlertVisible && h("cty-permission-alert", { key: 'd202830e71c289c27f13c9fffba8b2d4aa292889', part: "permission-alert", title: this.permissionAlertTitle, content: this.permissionAlertContent, buttons: this.permissionAlertbuttons, onCtyDismiss: (e) => this.closePermissionAlert(e), onCtyTap: (e) => this.toOpenAppSetting(e) })));
|
|
295
295
|
}
|
|
296
296
|
get el() { return this; }
|
|
297
297
|
static get watchers() { return {
|
|
@@ -21,6 +21,7 @@ const SegmentSlides = /*@__PURE__*/ proxyCustomElement(class SegmentSlides exten
|
|
|
21
21
|
this.layout = 'icon-hide';
|
|
22
22
|
this.observer = true;
|
|
23
23
|
this.observerParents = true;
|
|
24
|
+
this.swiperAttrs = {};
|
|
24
25
|
this._slideValue = 0;
|
|
25
26
|
this._segments = [];
|
|
26
27
|
this._top = '';
|
|
@@ -67,7 +68,7 @@ const SegmentSlides = /*@__PURE__*/ proxyCustomElement(class SegmentSlides exten
|
|
|
67
68
|
return this.slidesEl.swiper;
|
|
68
69
|
}
|
|
69
70
|
render() {
|
|
70
|
-
return (h(Host, { key: '
|
|
71
|
+
return (h(Host, { key: 'dac01b0e399fe6888b3028b42f226a62ac066632', class: "cty-segment-slides" }, h("ion-segment", { key: '97b449e41655ebc75aa323ed5c7c7db47b8d0816', part: "segment", class: "cty-segment-slides__segment", value: this._slideValue, onIonChange: (e) => this.segmentChanged(e), mode: "md", style: { 'top': this._top } }, h("slot", { key: '6ba4c2144f9bf51c52ce8bd1f534084c8fa3bd1b', name: 'segments' }), this._segments.map((item, idx) => h("ion-segment-button", { part: "segment-button", value: idx, layout: this.layout, class: "cty-segment-slides__segment-button" }, item[this._segmentProps['label']] && h("span", { class: "cty-segment-slides__segment-label" }, item[this._segmentProps['label']]), item[this._segmentProps['icon']] && h("cty-icon", { name: item[this._segmentProps['icon']], class: "cty-segment-slides__segment-icon" }), h("slot", { name: 'segment-button' + idx })))), h("swiper-container", Object.assign({ key: 'c2128d0ff3197fdfb15db197bd1f6bbe615f8b72', part: "container", class: "cty-segment-slides__swiper-container", ref: (el) => this.slidesEl = el, observer: this.observer, observerParents: this.observerParents, resistanceRatio: '0', autoHeight: this.autoHeight, onSwiperslidechangetransitionstart: () => this.slideChange() }, this.swiperAttrs), this._segments.map((_, idx) => h("swiper-slide", { part: "slide", class: "cty-segment-slides__swiper-slide" }, h("slot", { name: 'content' + idx }))))));
|
|
71
72
|
}
|
|
72
73
|
get el() { return this; }
|
|
73
74
|
static get watchers() { return {
|
|
@@ -83,6 +84,7 @@ const SegmentSlides = /*@__PURE__*/ proxyCustomElement(class SegmentSlides exten
|
|
|
83
84
|
"layout": [1],
|
|
84
85
|
"observer": [4],
|
|
85
86
|
"observerParents": [4, "observer-parents"],
|
|
87
|
+
"swiperAttrs": [16, "swiper-attrs"],
|
|
86
88
|
"_slideValue": [32],
|
|
87
89
|
"_segments": [32],
|
|
88
90
|
"_top": [32],
|
|
@@ -79,7 +79,7 @@ class CTYVideoCapture {
|
|
|
79
79
|
return reject('Video capture plugin is not available.');
|
|
80
80
|
}
|
|
81
81
|
try {
|
|
82
|
-
//不能把resolve作为
|
|
82
|
+
//不能把resolve作为stopVideoCapture的第一个参数
|
|
83
83
|
this._videoCapturePlugin.stopVideoCapture(() => { }, reject);
|
|
84
84
|
resolve();
|
|
85
85
|
}
|
|
@@ -260,7 +260,7 @@ const CameraPhoto = class {
|
|
|
260
260
|
this.permissionAlertVisible = false;
|
|
261
261
|
}
|
|
262
262
|
render() {
|
|
263
|
-
return (index.h(index.Host, { key: '6626fa119a9c343df0fd6175c16c0a9cd18b6bf2', class: Object.assign(Object.assign({}, theme.getClassMap(this.cssClass)), { 'overlay-hidden': true, 'cty-pos-cover': this.overlay }), style: { zIndex: `${20000 + this.overlayIndex}` } }, index.h("cty-action-sheet", { key: 'b88a31483aaee47dad3969a616eb74945d199447', class: "cty-camera-photo", animated: false, overlayIndex: 1, backdropDismiss: this.backdropDismiss, title: this.title, closeable: this.closeable, closeIcon: this.closeIcon, cancelText: this.cancelText, options: this.options, onCtyDismiss: () => this.dismiss(), onCtyTap: e => this._buttonClick(e) }), this.showCropImage && (index.h("cty-backdrop", { key: '83e30b75f98f48e69e97898c6b95e835e519f999', backdropDismiss: false }, index.h("cty-crop-image", { key: 'e382a18a7c8d9b212f01843d78a1000112e5d486', url: this.clipImage, cancelText: this.clipCancelText, confirmText: this.clipCconfirmText, imageWidth: this.clipImageWidth, imageBackground: this.clipImageBg, maxScale: this.clipMaxScale, minScale: this.clipMinScale, suffix: this.clipImageSuffix, quality: this.clipImageQuality, onCtyCancel: () => this._doCropCancel(), onCtyConfirm: (e) => this._doCropConfirm(e) }))), this.showPermissionPurpose && index.h("cty-permission-purpose", { key: '55dd946e9896839ccd7930b1b3e0573429e29dc1', description: this.permissionDescription }), this.continuous && this.showCameraPreview && index.h("cty-camera", Object.assign({ key: '67729d43a590b8630169bd1daac1117f1f41641c' }, this.cameraProps, { onCtyDismiss: () => this.showCameraPreview = false, onCtyConfirm: (e) => this.continuousConfirm(e) })), this.permissionAlertVisible && index.h("cty-permission-alert", { key: '
|
|
263
|
+
return (index.h(index.Host, { key: '6626fa119a9c343df0fd6175c16c0a9cd18b6bf2', class: Object.assign(Object.assign({}, theme.getClassMap(this.cssClass)), { 'overlay-hidden': true, 'cty-pos-cover': this.overlay }), style: { zIndex: `${20000 + this.overlayIndex}` } }, index.h("cty-action-sheet", { key: 'b88a31483aaee47dad3969a616eb74945d199447', class: "cty-camera-photo", animated: false, overlayIndex: 1, backdropDismiss: this.backdropDismiss, title: this.title, closeable: this.closeable, closeIcon: this.closeIcon, cancelText: this.cancelText, options: this.options, onCtyDismiss: () => this.dismiss(), onCtyTap: e => this._buttonClick(e) }), this.showCropImage && (index.h("cty-backdrop", { key: '83e30b75f98f48e69e97898c6b95e835e519f999', backdropDismiss: false }, index.h("cty-crop-image", { key: 'e382a18a7c8d9b212f01843d78a1000112e5d486', url: this.clipImage, cancelText: this.clipCancelText, confirmText: this.clipCconfirmText, imageWidth: this.clipImageWidth, imageBackground: this.clipImageBg, maxScale: this.clipMaxScale, minScale: this.clipMinScale, suffix: this.clipImageSuffix, quality: this.clipImageQuality, onCtyCancel: () => this._doCropCancel(), onCtyConfirm: (e) => this._doCropConfirm(e) }))), this.showPermissionPurpose && index.h("cty-permission-purpose", { key: '55dd946e9896839ccd7930b1b3e0573429e29dc1', description: this.permissionDescription }), this.continuous && this.showCameraPreview && index.h("cty-camera", Object.assign({ key: '67729d43a590b8630169bd1daac1117f1f41641c' }, this.cameraProps, { onCtyDismiss: () => this.showCameraPreview = false, onCtyConfirm: (e) => this.continuousConfirm(e) })), this.permissionAlertVisible && index.h("cty-permission-alert", { key: '64742e62f0a6172a8533e68d815f9ab2a084cf32', part: "permission-alert", title: this.permissionAlertTitle, content: this.permissionAlertContent, buttons: this.permissionAlertbuttons, onCtyDismiss: (e) => this.closePermissionAlert(e), onCtyTap: (e) => this.toOpenAppSetting(e) }), index.h("ion-toast", { key: 'c5b814ec61ba275fe28c5fc49160955914756a68', "is-open": this.isToastOpen, message: this.toastContent, duration: 2000, position: 'middle' })));
|
|
264
264
|
}
|
|
265
265
|
get el() { return index.getElement(this); }
|
|
266
266
|
static get watchers() { return {
|
|
@@ -29,6 +29,7 @@ const Camera = class {
|
|
|
29
29
|
this.quality = 85;
|
|
30
30
|
this.includeThumb = true;
|
|
31
31
|
this.thumbWidth = 120;
|
|
32
|
+
this.saveToLibrary = true;
|
|
32
33
|
this.file = true;
|
|
33
34
|
this.max = 9;
|
|
34
35
|
this.flipText = '翻转';
|
|
@@ -168,12 +169,12 @@ const Camera = class {
|
|
|
168
169
|
return cameraPreview.cameraPreview.setZoom(idx === 0 ? 0 : Math.min(zoom, maxZoom));
|
|
169
170
|
}
|
|
170
171
|
async takePhoto() {
|
|
171
|
-
const { quality, width, height, includeThumb, thumbWidth, file, max, pictures } = this;
|
|
172
|
+
const { quality, width, height, includeThumb, thumbWidth, saveToLibrary, file, max, pictures } = this;
|
|
172
173
|
if (max > 0 && pictures.length >= max || this.currentPhotoMode === 'single' && this.pictures.length > 0 || this.isTakingPhoto) {
|
|
173
174
|
return;
|
|
174
175
|
}
|
|
175
176
|
this.isTakingPhoto = true;
|
|
176
|
-
const data = await cameraPreview.cameraPreview.takePicture({ width, height, quality, includeThumb, thumbWidth });
|
|
177
|
+
const data = await cameraPreview.cameraPreview.takePicture({ width, height, quality, includeThumb, thumbWidth, saveToLibrary });
|
|
177
178
|
let uri = '';
|
|
178
179
|
let thumbnail = '';
|
|
179
180
|
if (data && typeof data === 'object') {
|
|
@@ -278,12 +279,9 @@ const Camera = class {
|
|
|
278
279
|
if (item.action == 'permission') {
|
|
279
280
|
try {
|
|
280
281
|
await cameraPreview.cameraPreview.openAppSettings();
|
|
281
|
-
this.permissionAlertVisible = false;
|
|
282
|
-
this.initCamera();
|
|
283
|
-
}
|
|
284
|
-
catch (error) {
|
|
285
|
-
this.closePermissionAlert(event);
|
|
286
282
|
}
|
|
283
|
+
catch (error) { }
|
|
284
|
+
this.closePermissionAlert(event);
|
|
287
285
|
}
|
|
288
286
|
}
|
|
289
287
|
closePermissionAlert(e) {
|
|
@@ -293,7 +291,7 @@ const Camera = class {
|
|
|
293
291
|
}
|
|
294
292
|
render() {
|
|
295
293
|
const { title, closeIcon, flash, flipText, flashText, ratioText, ratios, ratioIndex, zoomIndex, zooms, mode, singleText, multipleText, currentPhotoMode, confirmIcon, confirmText, deleteIcon, pictures, showImageViewer, imageViewerIndex, touchZoom, currentZoom } = this;
|
|
296
|
-
return (index.h(index.Host, { key: '
|
|
294
|
+
return (index.h(index.Host, { key: 'bb83ee1726feef5c84057c7723892d43f93c898c', class: "cty-camera", onClick: (e) => e.stopPropagation() }, index.h("cty-nav-bar", { key: '7f13f48d4ed2de835c0cd6a045268080d5c1b43e', title: title, type: "clear" }, index.h("slot", { key: 'fbc7dceb192a03a24396ca3be62c6c9f53825292', name: "header-start", slot: "start" }, !!closeIcon && index.h("ion-button", { key: 'fbf1536e049bec42259893653081110a2a1958f5', class: "cty-camera__close", onClick: () => this.close() }, index.h("cty-icon", { key: 'f34a507791bab61880f1f053a0e7ff5176c295dd', class: "cty-camera__close-icon", name: closeIcon })))), index.h("div", { key: '8277b267a0671f64c217e25d7b2669e8f9eeb1d8', class: "cty-camera-main", onTouchStart: (e) => this.touchstart(e), onTouchMove: (e) => this.touchmove(e), onTouchEnd: (e) => this.touchend(e) }, index.h("div", { key: '9b64b1fca0ad1bf01fe6cd383ff469e5fe9a1243', class: "cty-camera-widgets", part: "widgets" }, !!flipText && index.h("button", { key: 'cada5f233a4b755c00360641c0971309f310ef02', class: "cty-button-native cty-camera-widget", part: "widget", onClick: () => this.flipCamera() }, index.h("cty-icon", { key: 'af24b7d537825729e046aba6564c4f9e988983d4', class: "cty-camera-widget__icon", name: "cty-flip" }), !!flipText && index.h("span", { key: 'faa5b6ffb51768edc8e7d0bccddf33eb3531e466', class: "cty-camera-widget__text" }, flipText)), !!flashText && index.h("button", { key: '9addc710c3ff9fa7fe5e2dca9d7080a5b48821f4', class: "cty-button-native cty-camera-widget", part: "widget", onClick: () => this.toggleFlash() }, index.h("cty-icon", { key: 'b352d50ee12ffe92498e0c0a3c950a3cfc835b17', class: "cty-camera-widget__icon", name: flash ? 'cty-flash-on' : 'cty-flash-off' }), !!flashText && index.h("span", { key: '15daf94ee7856595ebfd0427275c30136a21085c', class: "cty-camera-widget__text" }, flashText)), !!ratioText && index.h("button", { key: '5d9ac7d3112165332b415636ca1f66cea5b4b576', class: "cty-button-native cty-camera-widget", part: "ratio", onClick: () => this.ratioChange() }, index.h("span", { key: 'adc545b141ae4cafe0ad0ee4b3f961617185bf50', class: "cty-camera-widget__ratio flex-center" }, ratios[ratioIndex]), !!ratioText && index.h("span", { key: 'ec406cf9e24e5a22fe81ad446b6217d27811cd82', class: "cty-camera-widget__text" }, ratioText)))), index.h("div", { key: '24080708dbaa7b58eff5fac1477b8bf2556aabf5', class: "cty-camera-controls safe-area-bottom-padding" }, mode == 'both' && pictures.length <= 0 && index.h("div", { key: '2856de71e0a012616e0fd5b634d32d6f51d817c1', class: "cty-camera-controls__mode flex-center", part: "mode" }, index.h("button", { key: '689ba86505b49126c6794858e00903926744f4c5', class: { 'cty-button-native cty-camera-controls__mode-button': true, 'cty-camera-controls__mode-button__active': currentPhotoMode === 'single' }, onClick: () => this.currentPhotoMode = 'single' }, singleText), index.h("button", { key: '78b37ce3691d31241f25226165ed539f93f45fb8', class: { 'cty-button-native cty-camera-controls__mode-button': true, 'cty-camera-controls__mode-button__active': currentPhotoMode === 'multiple' }, onClick: () => this.currentPhotoMode = 'multiple' }, multipleText)), index.h("slot", { key: '321e3e6c93cb0c0474fd18811dc58c8e9553e99a', name: "zooms" }, !touchZoom && zooms.length > 0 && index.h("div", { key: '5633dfbc4a605ab9650d225b6ac81fb8a6549759', class: "cty-camera-controls__zooms flex-center", part: "zooms" }, zooms.map((item, idx) => (index.h("div", { class: { 'cty-camera-controls__zoom-item flex-center': true, 'cty-camera-controls__zoom-item__active': zoomIndex === idx }, onClick: () => this.setZoom(idx) }, index.h("span", { class: "cty-camera-controls__zoom-text flex-center" }, item, "X"))))), touchZoom && index.h("div", { key: 'ceeaa663f2c0af94ee6a9e7396ac6fca0969fa8b', class: "cty-camera-controls__zooms flex-center", part: "zooms" }, index.h("div", { key: 'eb7f380ce6b4fa09ece885f4b644258346417fa9', class: { 'cty-camera-controls__zoom-item flex-center cty-camera-controls__zoom-item__active': true }, onClick: () => this.resetZoom() }, index.h("span", { key: '54935930412f8a827d56735da55e02caeb272c65', class: "cty-camera-controls__zoom-text flex-center" }, currentZoom, "X")))), index.h("div", { key: '429b787c541081536061362da6eb4055a402d90c', class: "cty-camera-controls__main flex-center" }, index.h("div", { key: 'da4502d5cba1ef557847ceda031ef12757637134', class: "cty-camera-controls__main-left flex-center" }), index.h("div", { key: '32faefbc45c3a6101f12048e7e498c47dd7aec26', class: "cty-camera-controls__take-photo flex-center" }, index.h("button", { key: '62b7db4847e099acdfdebbad0b6fd8e933b089cf', class: "cty-button-native cty-camera-controls__take-photo-button", part: "take-photo", onClick: () => this.takePhoto() })), index.h("div", { key: '368c5af68ee1c0da60afe16eb0faca9ec8e56561', class: "cty-camera-controls__main-confirm flex-center" }, currentPhotoMode !== 'single' && pictures.length > 0 && !!deleteIcon && index.h("button", { key: 'a7867e322531dd4bd2597915e14fbb469f0b9a58', class: "cty-camera-controls__main-delete cty-button-native flex-column-center", onClick: () => this.deleteLastPicture() }, index.h("cty-icon", { key: '355bd21f2feb8c790dcdb1e52301257b7d3ccdef', class: "cty-camera-controls__main-delete-icon", name: deleteIcon })), currentPhotoMode !== 'single' && pictures.length > 0 && index.h("button", { key: 'd577f40fe7ba3cc3f38defec443357fc2c3fc7fe', class: "cty-button-native flex-column-center", onClick: () => this.confirm() }, index.h("cty-icon", { key: '67599611fbcc9c5bb292e4d2d4fe7d93dbf6e274', class: "cty-camera-controls__main-confirm-icon", name: confirmIcon }), confirmText && index.h("span", { key: 'b592907eb84e2d6c255c252e5bbd50533c737c47', class: "cty-camera-controls__main-confirm-text" }, confirmText)))), index.h("slot", { key: '6dbc7b9d6ed47f647c561ed1a1e7ff621dfe635e', name: "images" }, index.h("div", { key: '5428de1571189999e306abd4115487a681360e79', class: "cty-camera-controls__images flex-align-center" }, currentPhotoMode !== 'single' && pictures.map((item, idx) => (index.h("div", { class: "cty-camera-controls__image", onClick: () => this.toImageViewer(idx) }, index.h("img", { class: 'cty-camera-controls__image-img', src: item.thumbnail || item.url }), index.h("button", { class: "cty-button-native", onClick: (e) => this.deletePicture(e, idx) }, index.h("cty-icon", { class: "cty-camera-controls__image-delete", name: index$1.closeOutline })))))))), showImageViewer && index.h("cty-image-viewer", { key: 'd42a638850e04f7920176fd63af812034ab754a6', images: pictures.map(item => item.url), initialSlide: imageViewerIndex, overlayIndex: 100, backdropDismiss: false, closeable: false, onCtyDismiss: (e) => this.closeImageViewer(e) }, currentPhotoMode !== 'multiple' && index.h("div", { key: '2dc441f65a66d38d271c390bc2fb1ebaa26c52f5', class: "cty-camera-viewer__single flex-center-between", slot: "pager" }, index.h("button", { key: '8c80910fb2d0ef00c828f0eec19d9c50309d2dca', class: "cty-camera-viewer__single-close cty-button-native", onClick: (event) => this.closeSingleImageViewer(event) }, index.h("cty-icon", { key: '3c606131b6693c04957d4114d4cf757a1df5453a', name: "cty-close2" })), index.h("button", { key: '56e9915d1224049cc9d48d7aa3a875d66a47c50a', class: "cty-camera-viewer__single-confirm cty-button-native", onClick: () => this.confirm() }, index.h("cty-icon", { key: '895c32f1f067760c15ac82ce0c1f31db069daa82', name: "cty-tick" }))), currentPhotoMode !== 'multiple' && index.h("i", { key: '5b4a7c8cc661e11127804aad19204cd4abdbb6dc', slot: "close" })), this.permissionAlertVisible && index.h("cty-permission-alert", { key: '87f6eac68fd015a6a1902a1cda5d546cabea9e3b', part: "permission-alert", title: this.permissionAlertTitle, content: this.permissionAlertContent, buttons: this.permissionAlertbuttons, onCtyDismiss: (e) => this.closePermissionAlert(e), onCtyTap: (e) => this.toOpenAppSetting(e) }), index.h("ion-toast", { key: '7fe4417cee38fe17e86cc52ddda0f09a3270b38e', "is-open": this.isToastOpen, message: this.toastContent, duration: 2000, position: 'middle' })));
|
|
297
295
|
}
|
|
298
296
|
get el() { return index.getElement(this); }
|
|
299
297
|
};
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
var index = require('./index-DCK462Hl.js');
|
|
4
4
|
var statusBar = require('./status-bar-1jhnFEuR.js');
|
|
5
|
-
var videoCapture = require('./video-capture-
|
|
5
|
+
var videoCapture = require('./video-capture-CzRkzdTQ.js');
|
|
6
6
|
var index$1 = require('./index-DASUhQA3.js');
|
|
7
7
|
require('./config-Bn2x7PFv.js');
|
|
8
8
|
require('./format-BSDO5P-c.js');
|
|
@@ -11,7 +11,7 @@ require('./device-info-BPtPRb6d.js');
|
|
|
11
11
|
require('./platform-DJmEyHMN.js');
|
|
12
12
|
require('./network-D7xvJurk.js');
|
|
13
13
|
|
|
14
|
-
const mediaCaptureCss = "*{-webkit-box-sizing:border-box;box-sizing:border-box}p,h1,h2,h3,h4,h5,h6{margin:0;padding:0}.flex{display:-ms-flexbox;display:flex}.flex-wrap{display:-ms-flexbox;display:flex;-ms-flex-flow:wrap;flex-flow:wrap}.flex-align-start{display:-ms-flexbox;display:flex;-ms-flex-align:start;align-items:flex-start}.flex-align-center{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}.flex-align-end{display:-ms-flexbox;display:flex;-ms-flex-align:end;align-items:flex-end}.flex-justify-start{display:-ms-flexbox;display:flex;-ms-flex-pack:start;justify-content:flex-start}.flex-justify-center{display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center}.flex-justify-end{display:-ms-flexbox;display:flex;-ms-flex-pack:end;justify-content:flex-end}.flex-align-end-start{display:-ms-flexbox;display:flex;-ms-flex-align:end;align-items:flex-end;-ms-flex-pack:start;justify-content:flex-start}.flex-align-end-center{display:-ms-flexbox;display:flex;-ms-flex-align:end;align-items:flex-end;-ms-flex-pack:center;justify-content:center}.flex-align-end-end{display:-ms-flexbox;display:flex;-ms-flex-align:end;align-items:flex-end;-ms-flex-pack:end;justify-content:flex-end}.flex-center{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center}.flex-center-justify-end{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:end;justify-content:flex-end}.flex-between{display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between}.flex-center-between{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:justify;justify-content:space-between}.flex-column{display:-ms-flexbox;display:flex;-ms-flex-flow:column;flex-flow:column}.flex-column-align-center{display:-ms-flexbox;display:flex;-ms-flex-flow:column;flex-flow:column;-ms-flex-align:center;align-items:center}.flex-column-justify-center{display:-ms-flexbox;display:flex;-ms-flex-flow:column;flex-flow:column;-ms-flex-pack:center;justify-content:center}.flex-column-center{display:-ms-flexbox;display:flex;-ms-flex-flow:column;flex-flow:column;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center}.flex-column-between{display:-ms-flexbox;display:flex;-ms-flex-flow:column;flex-flow:column;-ms-flex-pack:justify;justify-content:space-between}.flex-column-center-between{display:-ms-flexbox;display:flex;-ms-flex-flow:column;flex-flow:column;-ms-flex-align:center;align-items:center;-ms-flex-pack:justify;justify-content:space-between}.cty-button-native{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;margin:0;padding:0;background:transparent;font-family:inherit;font-size:inherit;font-style:inherit;font-weight:inherit;letter-spacing:inherit;text-decoration:inherit;text-indent:inherit;text-overflow:inherit;text-transform:inherit;text-align:inherit;white-space:inherit;color:inherit;line-height:1;border:0;outline:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-appearance:none;-moz-appearance:none;appearance:none;border-radius:0;-webkit-box-shadow:none;box-shadow:none;cursor:pointer}:host{--cty-media-capture-video-background:var(--cty-color-black);--cty-media-capture-header-top:var(--ion-safe-area-top, 44px);--cty-media-capture-header-padding-start:
|
|
14
|
+
const mediaCaptureCss = "*{-webkit-box-sizing:border-box;box-sizing:border-box}p,h1,h2,h3,h4,h5,h6{margin:0;padding:0}.flex{display:-ms-flexbox;display:flex}.flex-wrap{display:-ms-flexbox;display:flex;-ms-flex-flow:wrap;flex-flow:wrap}.flex-align-start{display:-ms-flexbox;display:flex;-ms-flex-align:start;align-items:flex-start}.flex-align-center{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}.flex-align-end{display:-ms-flexbox;display:flex;-ms-flex-align:end;align-items:flex-end}.flex-justify-start{display:-ms-flexbox;display:flex;-ms-flex-pack:start;justify-content:flex-start}.flex-justify-center{display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center}.flex-justify-end{display:-ms-flexbox;display:flex;-ms-flex-pack:end;justify-content:flex-end}.flex-align-end-start{display:-ms-flexbox;display:flex;-ms-flex-align:end;align-items:flex-end;-ms-flex-pack:start;justify-content:flex-start}.flex-align-end-center{display:-ms-flexbox;display:flex;-ms-flex-align:end;align-items:flex-end;-ms-flex-pack:center;justify-content:center}.flex-align-end-end{display:-ms-flexbox;display:flex;-ms-flex-align:end;align-items:flex-end;-ms-flex-pack:end;justify-content:flex-end}.flex-center{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center}.flex-center-justify-end{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:end;justify-content:flex-end}.flex-between{display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between}.flex-center-between{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:justify;justify-content:space-between}.flex-column{display:-ms-flexbox;display:flex;-ms-flex-flow:column;flex-flow:column}.flex-column-align-center{display:-ms-flexbox;display:flex;-ms-flex-flow:column;flex-flow:column;-ms-flex-align:center;align-items:center}.flex-column-justify-center{display:-ms-flexbox;display:flex;-ms-flex-flow:column;flex-flow:column;-ms-flex-pack:center;justify-content:center}.flex-column-center{display:-ms-flexbox;display:flex;-ms-flex-flow:column;flex-flow:column;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center}.flex-column-between{display:-ms-flexbox;display:flex;-ms-flex-flow:column;flex-flow:column;-ms-flex-pack:justify;justify-content:space-between}.flex-column-center-between{display:-ms-flexbox;display:flex;-ms-flex-flow:column;flex-flow:column;-ms-flex-align:center;align-items:center;-ms-flex-pack:justify;justify-content:space-between}.cty-button-native{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;margin:0;padding:0;background:transparent;font-family:inherit;font-size:inherit;font-style:inherit;font-weight:inherit;letter-spacing:inherit;text-decoration:inherit;text-indent:inherit;text-overflow:inherit;text-transform:inherit;text-align:inherit;white-space:inherit;color:inherit;line-height:1;border:0;outline:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-appearance:none;-moz-appearance:none;appearance:none;border-radius:0;-webkit-box-shadow:none;box-shadow:none;cursor:pointer}:host{--cty-media-capture-video-background:var(--cty-color-black);--cty-media-capture-header-top:var(--ion-safe-area-top, 44px);--cty-media-capture-header-padding-start:6px;--cty-media-capture-header-padding-end:15px;--cty-media-capture-close-icon-size:32px;--cty-media-capture-close-icon-color:var(--cty-color-primary);--cty-media-capture-time-padding:2px 5px;--cty-media-capture-time-bg-color:#f00;--cty-media-capture-time-size:var(--cty-font-size-base);--cty-media-capture-time-color:var(--cty-color-white);--cty-media-capture-time-border-radius:var(--cty-border-radius-small);--cty-media-capture-footer-bottom:var(--ion-safe-area-bottom, 30px);--cty-media-capture-switch-size:60px;--cty-media-capture-switch-bg-color:var(--cty-color-primary);--cty-media-capture-switch-active-bg-color:#f00;--cty-media-capture-switch-border-width:3px;--cty-media-capture-switch-active-size:24px;--cty-media-capture-status-size:48px;--cty-media-capture-confirm-min-height:30px;--cty-media-capture-confirm-padding:0 1em;--cty-media-capture-confirm-size:var(--cty-font-size-base);--cty-media-capture-confirm-color:var(--cty-color-white);--cty-media-capture-confirm-bg-color:var(--cty-color-primary);--cty-media-capture-confirm-right:15px;--cty-media-capture-confirm-border-radius:var(--cty-border-radius-base);--cty-media-capture-video-object-fit:cover;position:absolute;left:0;top:0;width:100vw;height:100vh;visibility:visible !important}:host(.cty-media-captured){background:var(--cty-media-capture-video-background)}.cty-media-capture__header{position:absolute;z-index:1;left:0;top:var(--cty-media-capture-header-top);width:100%;padding-left:var(--cty-media-capture-header-padding-start);padding-right:var(--cty-media-capture-header-padding-end)}.cty-media-close__captured{margin-left:6px}.cty-capture__close-icon{font-size:var(--cty-media-capture-close-icon-size);color:var(--cty-media-capture-close-icon-color)}.cty-media-capture__time{position:absolute;left:50%;top:50%;padding:var(--cty-media-capture-time-padding);border-radius:var(--cty-media-capture-time-border-radius);font-size:var(--cty-media-capture-time-size);color:var(--cty-media-capture-time-color);-webkit-transform:translate(-50%, -50%);transform:translate(-50%, -50%)}.cty-media-capture__time-active{background:var(--cty-media-capture-time-bg-color)}.cty-media-capture__footer{position:absolute;bottom:var(--cty-media-capture-footer-bottom);left:0;width:100%}.cty-media-capture__switch{width:var(--cty-media-capture-switch-size);height:var(--cty-media-capture-switch-size);border-color:var(--cty-media-capture-switch-bg-color);border-width:var(--cty-media-capture-switch-border-width);border-style:solid;border-radius:var(--cty-border-radius-circle);cursor:pointer}.cty-media-capture__status{width:var(--cty-media-capture-status-size);height:var(--cty-media-capture-status-size);border-radius:var(--cty-border-radius-circle);background:var(--cty-media-capture-switch-bg-color);-webkit-transition:0.3s;transition:0.3s}.cty-media-capture__status-active{width:var(--cty-media-capture-switch-active-size);height:var(--cty-media-capture-switch-active-size);border-radius:var(--cty-border-radius-base);background:var(--cty-media-capture-switch-active-bg-color)}.cty-media-capture__confirm{position:absolute;right:var(--cty-media-capture-confirm-right);bottom:0;min-height:var(--cty-media-capture-confirm-min-height);background:var(--cty-media-capture-confirm-bg-color);padding:var(--cty-media-capture-confirm-padding);color:var(--cty-media-capture-confirm-color);font-size:var(--cty-media-capture-confirm-size);border-radius:var(--cty-media-capture-confirm-border-radius)}.cty-media-capture__video{position:absolute;left:0;top:0;width:100%;height:100%;-o-object-fit:var(--cty-media-capture-video-object-fit);object-fit:var(--cty-media-capture-video-object-fit)}";
|
|
15
15
|
|
|
16
16
|
const MediaCapture = class {
|
|
17
17
|
constructor(hostRef) {
|
|
@@ -134,12 +134,9 @@ const MediaCapture = class {
|
|
|
134
134
|
if (item.action == 'permission') {
|
|
135
135
|
try {
|
|
136
136
|
await videoCapture.videoCapture.openAppSettings();
|
|
137
|
-
this.permissionAlertVisible = false;
|
|
138
|
-
this.initVideoCapture();
|
|
139
|
-
}
|
|
140
|
-
catch (error) {
|
|
141
|
-
this.closePermissionAlert(event);
|
|
142
137
|
}
|
|
138
|
+
catch (error) { }
|
|
139
|
+
this.closePermissionAlert(event);
|
|
143
140
|
}
|
|
144
141
|
}
|
|
145
142
|
closePermissionAlert(e) {
|
|
@@ -149,7 +146,7 @@ const MediaCapture = class {
|
|
|
149
146
|
}
|
|
150
147
|
render() {
|
|
151
148
|
const captureDuration = statusBar.secondsToVehicle(this.captureDuration);
|
|
152
|
-
return (index.h(index.Host, { key: '
|
|
149
|
+
return (index.h(index.Host, { key: '4b705601c4835f377f498ccef4aa73def22e382f', class: { 'cty-media-capture': true, 'cty-media-captured': this.isCaptured } }, index.h("div", { key: '871a7976fddfeaf2628fc8fbb2a3817f94fcf4a2', class: "cty-media-capture__header" }, index.h("button", { key: '54a7555a893326ffa82b00244715141da60c49ff', onClick: () => this.doHeaderAction(), class: { 'cty-button-native': true, 'cty-media-close__captured': this.isCaptured } }, index.h("cty-icon", { key: '17e1c892e2662ed027216cceb869f5e6e6aaed0e', class: "cty-capture__close-icon", name: this.isCaptured ? this.revocationIcon : this.closeIcon })), this.captureTime && (this.isCaptured || this.capturing) && (index.h("span", { key: '5aa04bea03cca3c38a3085a2c1ef056f00a0ee1e', class: { 'cty-media-capture__time': true, 'cty-media-capture__time-active': this.capturing } }, captureDuration))), this.isCaptured && (index.h("video", { key: '98ae7adc1a838d36efe3899617c360627d2d54d0', ref: el => (this.videoEl = el), class: "cty-media-capture__video", autoplay: this.autoplay, loop: this.loop, poster: this.poster, src: this.videoFileUrl, playsinline: true, "webkit-playsinline": true, controls: this.controls, onClick: e => this.toggleVideo(e) })), index.h("div", { key: '2f3ae3d6e0f7cba849f8f3a65ce0b6ba8aec7569', class: "cty-media-capture__footer flex-center" }, !this.isCaptured && (index.h("button", { key: '2a6028f8e92173d141ca40070baf16b3114fdea0', class: "cty-media-capture__switch cty-button-native", onClick: () => this.doCapture() }, index.h("span", { key: '9e137a557d954aab33231e3cb543f545d77e3c98', class: { 'cty-media-capture__status': true, 'cty-media-capture__status-active': this.capturing } }))), this.isCaptured && (index.h("button", { key: '5cfbe32fc7402c0dbef603de2836dc754933049e', class: "cty-media-capture__confirm cty-button-native", onClick: () => this.confirm() }, this.confirmText))), index.h("slot", { key: '25348589fab2be43d9bea0cadfc14f052166d7dc' }), this.permissionAlertVisible && index.h("cty-permission-alert", { key: '776845d27801596c0761c7867b9fb0c2088810ff', part: "permission-alert", title: this.permissionAlertTitle, content: this.permissionAlertContent, buttons: this.permissionAlertbuttons, onCtyDismiss: (e) => this.closePermissionAlert(e), onCtyTap: (e) => this.toOpenAppSetting(e) })));
|
|
153
150
|
}
|
|
154
151
|
get el() { return index.getElement(this); }
|
|
155
152
|
};
|