@cmstops/pro-compo 0.3.34 → 0.3.36
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/dist/index.css +269 -59
- package/dist/index.min.css +1 -1
- package/es/docPreview/component.d.ts +0 -0
- package/es/docPreview/component.js +153 -0
- package/es/docPreview/components/PreviewIframe.d.ts +0 -0
- package/es/docPreview/components/PreviewIframe.js +37 -0
- package/es/docPreview/images/phone.js +2 -0
- package/es/docPreview/index.d.ts +2 -0
- package/es/docPreview/index.js +7 -0
- package/es/docPreview/scripts/api.d.ts +1 -0
- package/es/docPreview/scripts/hook.d.ts +20 -0
- package/es/docPreview/scripts/hook.js +119 -0
- package/es/docPreview/style/css.js +1 -0
- package/es/docPreview/style/index.css +139 -0
- package/es/docPreview/style/index.d.ts +1 -0
- package/es/docPreview/style/index.js +1 -0
- package/es/docPreview/style/index.less +129 -0
- package/es/docPreview/style/previewIframe.less +36 -0
- package/es/hooks/useSelection.js +1 -1
- package/es/hooks/useUpload.d.ts +15 -0
- package/es/hooks/useUpload.js +88 -0
- package/es/index.css +269 -59
- package/es/index.d.ts +1 -0
- package/es/index.js +1 -0
- package/es/index.less +1 -0
- package/es/selectResourceModal/component.js +30 -16
- package/es/selectResourceModal/components/ListCardWrapper/index.d.ts +0 -0
- package/es/selectResourceModal/components/ListCardWrapper/index.js +56 -0
- package/es/selectResourceModal/components/ListContent/index.js +16 -36
- package/es/selectResourceModal/components/ListContentLocal/components/Upload.d.ts +0 -0
- package/es/selectResourceModal/components/ListContentLocal/components/Upload.js +56 -0
- package/es/selectResourceModal/components/ListContentLocal/index.d.ts +0 -0
- package/es/selectResourceModal/components/ListContentLocal/index.js +90 -0
- package/es/selectResourceModal/components/ListFilter/index.js +12 -4
- package/es/selectResourceModal/style/index.css +98 -58
- package/es/selectResourceModal/style/index.less +20 -2
- package/es/selectResourceModal/style/listCardWrapper.less +63 -0
- package/es/selectResourceModal/style/listContent.less +1 -63
- package/es/selectResourceModal/style/listContentLocal.less +26 -0
- package/es/selectResourceModal/style/listSelected.less +11 -3
- package/es/thumbCard/assets/magic.js +2 -0
- package/es/thumbCard/component.js +80 -53
- package/es/thumbCard/style/index.css +32 -1
- package/es/thumbCard/style/index.less +45 -7
- package/es/utils/index.d.ts +2 -0
- package/es/utils/index.js +40 -1
- package/es/utils/tusUpload.d.ts +8 -0
- package/es/utils/tusUpload.js +35 -1
- package/lib/docPreview/component.js +154 -0
- package/lib/docPreview/components/PreviewIframe.js +38 -0
- package/lib/docPreview/images/phone.js +3 -0
- package/lib/docPreview/index.js +8 -0
- package/lib/docPreview/scripts/hook.js +123 -0
- package/lib/docPreview/style/css.js +2 -0
- package/lib/docPreview/style/index.css +139 -0
- package/lib/docPreview/style/index.js +2 -0
- package/lib/docPreview/style/index.less +129 -0
- package/lib/docPreview/style/previewIframe.less +36 -0
- package/lib/hooks/useSelection.js +1 -1
- package/lib/hooks/useUpload.js +91 -0
- package/lib/index.css +269 -59
- package/lib/index.js +2 -0
- package/lib/index.less +1 -0
- package/lib/selectResourceModal/component.js +31 -17
- package/lib/selectResourceModal/components/ListCardWrapper/index.js +57 -0
- package/lib/selectResourceModal/components/ListContent/index.js +19 -39
- package/lib/selectResourceModal/components/ListContentLocal/components/Upload.js +57 -0
- package/lib/selectResourceModal/components/ListContentLocal/index.js +91 -0
- package/lib/selectResourceModal/components/ListFilter/index.js +12 -4
- package/lib/selectResourceModal/style/index.css +98 -58
- package/lib/selectResourceModal/style/index.less +20 -2
- package/lib/selectResourceModal/style/listCardWrapper.less +63 -0
- package/lib/selectResourceModal/style/listContent.less +1 -63
- package/lib/selectResourceModal/style/listContentLocal.less +26 -0
- package/lib/selectResourceModal/style/listSelected.less +11 -3
- package/lib/thumbCard/assets/magic.js +3 -0
- package/lib/thumbCard/component.js +78 -51
- package/lib/thumbCard/style/index.css +32 -1
- package/lib/thumbCard/style/index.less +45 -7
- package/lib/utils/index.js +41 -0
- package/lib/utils/tusUpload.js +35 -0
- package/package.json +1 -1
package/lib/utils/tusUpload.js
CHANGED
|
@@ -70,4 +70,39 @@ function getFileType(file) {
|
|
|
70
70
|
fType = "application/x-rar";
|
|
71
71
|
return fType;
|
|
72
72
|
}
|
|
73
|
+
class TusUploadTask {
|
|
74
|
+
constructor(file, platformKey) {
|
|
75
|
+
this.file = file;
|
|
76
|
+
this.platformKey = platformKey || "holly";
|
|
77
|
+
}
|
|
78
|
+
start(callback) {
|
|
79
|
+
return new Promise((resolve, reject) => {
|
|
80
|
+
const upload = new TUS__namespace.Upload(this.file, {
|
|
81
|
+
endpoint: `${config.DEFAULT_UPLOAD_URL}/upload/`,
|
|
82
|
+
chunkSize: config.DEFAULT_UPLOAD_CHUNK_SIZE || 5242880,
|
|
83
|
+
retryDelays: [0, 1e3, 3e3, 5e3],
|
|
84
|
+
overridePatchMethod: true,
|
|
85
|
+
removeFingerprintOnSuccess: true,
|
|
86
|
+
metadata: {
|
|
87
|
+
filename: this.file.name,
|
|
88
|
+
filetype: getFileType(this.file),
|
|
89
|
+
platform: this.platformKey
|
|
90
|
+
},
|
|
91
|
+
onBeforeRequest: (req) => {
|
|
92
|
+
const xhr = req.getUnderlyingObject();
|
|
93
|
+
xhr.withCredentials = true;
|
|
94
|
+
},
|
|
95
|
+
onProgress: callback,
|
|
96
|
+
onSuccess: () => resolve(upload.url),
|
|
97
|
+
onError: (error) => reject(error)
|
|
98
|
+
});
|
|
99
|
+
this.upload = upload;
|
|
100
|
+
upload.start();
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
abort() {
|
|
104
|
+
return this.upload.abort();
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
exports.TusUploadTask = TusUploadTask;
|
|
73
108
|
exports.uploadByTUS = uploadByTUS;
|