@aws-amplify/ui-react 1.2.26-unstable.2 → 2.0.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.
- package/dist/esm/index.css +1 -0
- package/dist/esm/index.css.map +7 -0
- package/dist/esm/index.js +1 -0
- package/dist/esm/index.js.map +7 -0
- package/dist/esm/legacy.js +1 -0
- package/dist/esm/legacy.js.map +7 -0
- package/dist/index.css +1 -0
- package/dist/index.css.map +7 -0
- package/dist/index.d.ts +7533 -0
- package/dist/index.js +1 -0
- package/dist/index.js.map +7 -0
- package/dist/legacy.d.ts +1 -0
- package/dist/legacy.js +1 -0
- package/dist/legacy.js.map +7 -0
- package/dist/primitives.json +22168 -0
- package/legacy/package.json +7 -0
- package/package.json +82 -40
- package/CHANGELOG.md +0 -339
- package/README.md +0 -1
- package/build.js +0 -5
- package/dist/0.js +0 -269
- package/dist/0.js.map +0 -1
- package/dist/1.js +0 -2111
- package/dist/1.js.map +0 -1
- package/dist/10.js +0 -707
- package/dist/10.js.map +0 -1
- package/dist/11.js +0 -45
- package/dist/11.js.map +0 -1
- package/dist/12.js +0 -1152
- package/dist/12.js.map +0 -1
- package/dist/13.js +0 -114
- package/dist/13.js.map +0 -1
- package/dist/14.js +0 -1194
- package/dist/14.js.map +0 -1
- package/dist/15.js +0 -61
- package/dist/15.js.map +0 -1
- package/dist/16.js +0 -37
- package/dist/16.js.map +0 -1
- package/dist/17.js +0 -127
- package/dist/17.js.map +0 -1
- package/dist/18.js +0 -90
- package/dist/18.js.map +0 -1
- package/dist/19.js +0 -267
- package/dist/19.js.map +0 -1
- package/dist/2.js +0 -766
- package/dist/2.js.map +0 -1
- package/dist/20.js +0 -74
- package/dist/20.js.map +0 -1
- package/dist/21.js +0 -50
- package/dist/21.js.map +0 -1
- package/dist/22.js +0 -57
- package/dist/22.js.map +0 -1
- package/dist/23.js +0 -50
- package/dist/23.js.map +0 -1
- package/dist/24.js +0 -271
- package/dist/24.js.map +0 -1
- package/dist/25.js +0 -102
- package/dist/25.js.map +0 -1
- package/dist/26.js +0 -64
- package/dist/26.js.map +0 -1
- package/dist/27.js +0 -379
- package/dist/27.js.map +0 -1
- package/dist/28.js +0 -47
- package/dist/28.js.map +0 -1
- package/dist/29.js +0 -46
- package/dist/29.js.map +0 -1
- package/dist/3.js +0 -2787
- package/dist/3.js.map +0 -1
- package/dist/30.js +0 -503
- package/dist/30.js.map +0 -1
- package/dist/31.js +0 -2
- package/dist/31.js.map +0 -1
- package/dist/32.js +0 -2
- package/dist/32.js.map +0 -1
- package/dist/33.js +0 -13
- package/dist/33.js.map +0 -1
- package/dist/4.js +0 -4126
- package/dist/4.js.map +0 -1
- package/dist/5.js +0 -817
- package/dist/5.js.map +0 -1
- package/dist/6.js +0 -619
- package/dist/6.js.map +0 -1
- package/dist/7.js +0 -662
- package/dist/7.js.map +0 -1
- package/dist/8.js +0 -614
- package/dist/8.js.map +0 -1
- package/dist/9.js +0 -665
- package/dist/9.js.map +0 -1
- package/dist/@aws-amplify/ui-react.js +0 -31875
- package/dist/@aws-amplify/ui-react.js.map +0 -1
- package/dist/aws-amplify-react.min.js +0 -28
- package/dist/aws-amplify-react.min.js.map +0 -1
- package/dist/polyfills-core-js.js +0 -5211
- package/dist/polyfills-core-js.js.map +0 -1
- package/dist/polyfills-css-shim.js +0 -467
- package/dist/polyfills-css-shim.js.map +0 -1
- package/dist/polyfills-dom.js +0 -2098
- package/dist/polyfills-dom.js.map +0 -1
- package/jest.config.js +0 -12
- package/lib/components.d.ts +0 -56
- package/lib/components.js +0 -64
- package/lib/components.js.map +0 -1
- package/lib/index.d.ts +0 -2
- package/lib/index.js +0 -9
- package/lib/index.js.map +0 -1
- package/lib/react-component-lib/createComponent.d.ts +0 -2
- package/lib/react-component-lib/createComponent.js +0 -91
- package/lib/react-component-lib/createComponent.js.map +0 -1
- package/lib/react-component-lib/createControllerComponent.d.ts +0 -43
- package/lib/react-component-lib/createControllerComponent.js +0 -152
- package/lib/react-component-lib/createControllerComponent.js.map +0 -1
- package/lib/react-component-lib/createOverlayComponent.d.ts +0 -45
- package/lib/react-component-lib/createOverlayComponent.js +0 -148
- package/lib/react-component-lib/createOverlayComponent.js.map +0 -1
- package/lib/react-component-lib/index.d.ts +0 -3
- package/lib/react-component-lib/index.js +0 -9
- package/lib/react-component-lib/index.js.map +0 -1
- package/lib/react-component-lib/utils/attachEventProps.d.ts +0 -8
- package/lib/react-component-lib/utils/attachEventProps.js +0 -85
- package/lib/react-component-lib/utils/attachEventProps.js.map +0 -1
- package/lib/react-component-lib/utils/index.d.ts +0 -8
- package/lib/react-component-lib/utils/index.js +0 -36
- package/lib/react-component-lib/utils/index.js.map +0 -1
- package/lib/withAuthenticator.d.ts +0 -3
- package/lib/withAuthenticator.js +0 -127
- package/lib/withAuthenticator.js.map +0 -1
- package/lib-esm/components.d.ts +0 -56
- package/lib-esm/components.js +0 -62
- package/lib-esm/components.js.map +0 -1
- package/lib-esm/index.d.ts +0 -2
- package/lib-esm/index.js +0 -3
- package/lib-esm/index.js.map +0 -1
- package/lib-esm/react-component-lib/createComponent.d.ts +0 -2
- package/lib-esm/react-component-lib/createComponent.js +0 -86
- package/lib-esm/react-component-lib/createComponent.js.map +0 -1
- package/lib-esm/react-component-lib/createControllerComponent.d.ts +0 -43
- package/lib-esm/react-component-lib/createControllerComponent.js +0 -146
- package/lib-esm/react-component-lib/createControllerComponent.js.map +0 -1
- package/lib-esm/react-component-lib/createOverlayComponent.d.ts +0 -45
- package/lib-esm/react-component-lib/createOverlayComponent.js +0 -142
- package/lib-esm/react-component-lib/createOverlayComponent.js.map +0 -1
- package/lib-esm/react-component-lib/index.d.ts +0 -3
- package/lib-esm/react-component-lib/index.js +0 -4
- package/lib-esm/react-component-lib/index.js.map +0 -1
- package/lib-esm/react-component-lib/utils/attachEventProps.d.ts +0 -8
- package/lib-esm/react-component-lib/utils/attachEventProps.js +0 -79
- package/lib-esm/react-component-lib/utils/attachEventProps.js.map +0 -1
- package/lib-esm/react-component-lib/utils/index.d.ts +0 -8
- package/lib-esm/react-component-lib/utils/index.js +0 -28
- package/lib-esm/react-component-lib/utils/index.js.map +0 -1
- package/lib-esm/withAuthenticator.d.ts +0 -3
- package/lib-esm/withAuthenticator.js +0 -121
- package/lib-esm/withAuthenticator.js.map +0 -1
- package/src/components.ts +0 -65
- package/src/index.ts +0 -3
- package/src/react-component-lib/createComponent.tsx +0 -69
- package/src/react-component-lib/createControllerComponent.tsx +0 -71
- package/src/react-component-lib/createOverlayComponent.tsx +0 -79
- package/src/react-component-lib/index.ts +0 -3
- package/src/react-component-lib/utils/attachEventProps.ts +0 -87
- package/src/react-component-lib/utils/index.tsx +0 -31
- package/src/withAuthenticator.tsx +0 -62
- package/webpack.config.dev.js +0 -6
- package/webpack.config.js +0 -56
package/dist/5.js
DELETED
|
@@ -1,817 +0,0 @@
|
|
|
1
|
-
(this["webpackJsonpaws_amplify_react"] = this["webpackJsonpaws_amplify_react"] || []).push([[5],{
|
|
2
|
-
|
|
3
|
-
/***/ "../amplify-ui-components/dist/esm-es5/amplify-s3-album.entry.js":
|
|
4
|
-
/*!***********************************************************************!*\
|
|
5
|
-
!*** ../amplify-ui-components/dist/esm-es5/amplify-s3-album.entry.js ***!
|
|
6
|
-
\***********************************************************************/
|
|
7
|
-
/*! exports provided: amplify_s3_album */
|
|
8
|
-
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
9
|
-
|
|
10
|
-
"use strict";
|
|
11
|
-
__webpack_require__.r(__webpack_exports__);
|
|
12
|
-
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "amplify_s3_album", function() { return AmplifyS3Album; });
|
|
13
|
-
/* harmony import */ var _index_83f2275b_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./index-83f2275b.js */ "../amplify-ui-components/dist/esm-es5/index-83f2275b.js");
|
|
14
|
-
/* harmony import */ var _aws_amplify_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @aws-amplify/core */ "@aws-amplify/core");
|
|
15
|
-
/* harmony import */ var _aws_amplify_core__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_aws_amplify_core__WEBPACK_IMPORTED_MODULE_1__);
|
|
16
|
-
/* harmony import */ var _storage_types_f257c0f2_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./storage-types-f257c0f2.js */ "../amplify-ui-components/dist/esm-es5/storage-types-f257c0f2.js");
|
|
17
|
-
/* harmony import */ var _aws_amplify_auth__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @aws-amplify/auth */ "@aws-amplify/auth");
|
|
18
|
-
/* harmony import */ var _aws_amplify_auth__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_aws_amplify_auth__WEBPACK_IMPORTED_MODULE_3__);
|
|
19
|
-
/* harmony import */ var _Translations_108d469f_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./Translations-108d469f.js */ "../amplify-ui-components/dist/esm-es5/Translations-108d469f.js");
|
|
20
|
-
/* harmony import */ var _constants_c8ecaa24_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./constants-c8ecaa24.js */ "../amplify-ui-components/dist/esm-es5/constants-c8ecaa24.js");
|
|
21
|
-
/* harmony import */ var _aws_amplify_storage__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @aws-amplify/storage */ "@aws-amplify/storage");
|
|
22
|
-
/* harmony import */ var _aws_amplify_storage__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_aws_amplify_storage__WEBPACK_IMPORTED_MODULE_6__);
|
|
23
|
-
/* harmony import */ var _storage_helpers_1afafead_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./storage-helpers-1afafead.js */ "../amplify-ui-components/dist/esm-es5/storage-helpers-1afafead.js");
|
|
24
|
-
var __awaiter = undefined && undefined.__awaiter || function (thisArg, _arguments, P, generator) {
|
|
25
|
-
function adopt(value) {
|
|
26
|
-
return value instanceof P ? value : new P(function (resolve) {
|
|
27
|
-
resolve(value);
|
|
28
|
-
});
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
32
|
-
function fulfilled(value) {
|
|
33
|
-
try {
|
|
34
|
-
step(generator.next(value));
|
|
35
|
-
} catch (e) {
|
|
36
|
-
reject(e);
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
function rejected(value) {
|
|
41
|
-
try {
|
|
42
|
-
step(generator["throw"](value));
|
|
43
|
-
} catch (e) {
|
|
44
|
-
reject(e);
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
function step(result) {
|
|
49
|
-
result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
53
|
-
});
|
|
54
|
-
};
|
|
55
|
-
|
|
56
|
-
var __generator = undefined && undefined.__generator || function (thisArg, body) {
|
|
57
|
-
var _ = {
|
|
58
|
-
label: 0,
|
|
59
|
-
sent: function sent() {
|
|
60
|
-
if (t[0] & 1) throw t[1];
|
|
61
|
-
return t[1];
|
|
62
|
-
},
|
|
63
|
-
trys: [],
|
|
64
|
-
ops: []
|
|
65
|
-
},
|
|
66
|
-
f,
|
|
67
|
-
y,
|
|
68
|
-
t,
|
|
69
|
-
g;
|
|
70
|
-
return g = {
|
|
71
|
-
next: verb(0),
|
|
72
|
-
"throw": verb(1),
|
|
73
|
-
"return": verb(2)
|
|
74
|
-
}, typeof Symbol === "function" && (g[Symbol.iterator] = function () {
|
|
75
|
-
return this;
|
|
76
|
-
}), g;
|
|
77
|
-
|
|
78
|
-
function verb(n) {
|
|
79
|
-
return function (v) {
|
|
80
|
-
return step([n, v]);
|
|
81
|
-
};
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
function step(op) {
|
|
85
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
86
|
-
|
|
87
|
-
while (_) {
|
|
88
|
-
try {
|
|
89
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
90
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
91
|
-
|
|
92
|
-
switch (op[0]) {
|
|
93
|
-
case 0:
|
|
94
|
-
case 1:
|
|
95
|
-
t = op;
|
|
96
|
-
break;
|
|
97
|
-
|
|
98
|
-
case 4:
|
|
99
|
-
_.label++;
|
|
100
|
-
return {
|
|
101
|
-
value: op[1],
|
|
102
|
-
done: false
|
|
103
|
-
};
|
|
104
|
-
|
|
105
|
-
case 5:
|
|
106
|
-
_.label++;
|
|
107
|
-
y = op[1];
|
|
108
|
-
op = [0];
|
|
109
|
-
continue;
|
|
110
|
-
|
|
111
|
-
case 7:
|
|
112
|
-
op = _.ops.pop();
|
|
113
|
-
|
|
114
|
-
_.trys.pop();
|
|
115
|
-
|
|
116
|
-
continue;
|
|
117
|
-
|
|
118
|
-
default:
|
|
119
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
|
|
120
|
-
_ = 0;
|
|
121
|
-
continue;
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
|
|
125
|
-
_.label = op[1];
|
|
126
|
-
break;
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
if (op[0] === 6 && _.label < t[1]) {
|
|
130
|
-
_.label = t[1];
|
|
131
|
-
t = op;
|
|
132
|
-
break;
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
if (t && _.label < t[2]) {
|
|
136
|
-
_.label = t[2];
|
|
137
|
-
|
|
138
|
-
_.ops.push(op);
|
|
139
|
-
|
|
140
|
-
break;
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
if (t[2]) _.ops.pop();
|
|
144
|
-
|
|
145
|
-
_.trys.pop();
|
|
146
|
-
|
|
147
|
-
continue;
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
op = body.call(thisArg, _);
|
|
151
|
-
} catch (e) {
|
|
152
|
-
op = [6, e];
|
|
153
|
-
y = 0;
|
|
154
|
-
} finally {
|
|
155
|
-
f = t = 0;
|
|
156
|
-
}
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
if (op[0] & 5) throw op[1];
|
|
160
|
-
return {
|
|
161
|
-
value: op[0] ? op[1] : void 0,
|
|
162
|
-
done: true
|
|
163
|
-
};
|
|
164
|
-
}
|
|
165
|
-
};
|
|
166
|
-
|
|
167
|
-
var __spreadArrays = undefined && undefined.__spreadArrays || function () {
|
|
168
|
-
for (var s = 0, i = 0, il = arguments.length; i < il; i++) {
|
|
169
|
-
s += arguments[i].length;
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
for (var r = Array(s), k = 0, i = 0; i < il; i++) {
|
|
173
|
-
for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) {
|
|
174
|
-
r[k] = a[j];
|
|
175
|
-
}
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
return r;
|
|
179
|
-
};
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
// Unique ID creation requires a high quality random # generator. In the browser we therefore
|
|
189
|
-
// require the crypto API and do not support built-in fallback to lower quality random number
|
|
190
|
-
// generators (like Math.random()).
|
|
191
|
-
|
|
192
|
-
var getRandomValues;
|
|
193
|
-
var rnds8 = new Uint8Array(16);
|
|
194
|
-
|
|
195
|
-
function rng() {
|
|
196
|
-
// lazy load so that environments that need to polyfill have a chance to do so
|
|
197
|
-
if (!getRandomValues) {
|
|
198
|
-
// getRandomValues needs to be invoked in a context where "this" is a Crypto implementation. Also,
|
|
199
|
-
// find the complete implementation of crypto (msCrypto) on IE11.
|
|
200
|
-
getRandomValues = typeof crypto !== 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto) || typeof msCrypto !== 'undefined' && typeof msCrypto.getRandomValues === 'function' && msCrypto.getRandomValues.bind(msCrypto);
|
|
201
|
-
|
|
202
|
-
if (!getRandomValues) {
|
|
203
|
-
throw new Error('crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported');
|
|
204
|
-
}
|
|
205
|
-
}
|
|
206
|
-
|
|
207
|
-
return getRandomValues(rnds8);
|
|
208
|
-
}
|
|
209
|
-
|
|
210
|
-
var REGEX = /^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;
|
|
211
|
-
|
|
212
|
-
function validate(uuid) {
|
|
213
|
-
return typeof uuid === 'string' && REGEX.test(uuid);
|
|
214
|
-
}
|
|
215
|
-
/**
|
|
216
|
-
* Convert array of 16 byte values to UUID string format of the form:
|
|
217
|
-
* XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
|
|
218
|
-
*/
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
var byteToHex = [];
|
|
222
|
-
|
|
223
|
-
for (var i = 0; i < 256; ++i) {
|
|
224
|
-
byteToHex.push((i + 0x100).toString(16).substr(1));
|
|
225
|
-
}
|
|
226
|
-
|
|
227
|
-
function stringify(arr) {
|
|
228
|
-
var offset = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0; // Note: Be careful editing this code! It's been tuned for performance
|
|
229
|
-
// and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434
|
|
230
|
-
|
|
231
|
-
var uuid = (byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + '-' + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + '-' + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + '-' + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + '-' + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]]).toLowerCase(); // Consistency check for valid UUID. If this throws, it's likely due to one
|
|
232
|
-
// of the following:
|
|
233
|
-
// - One or more input array values don't map to a hex octet (leading to
|
|
234
|
-
// "undefined" in the uuid)
|
|
235
|
-
// - Invalid input values for the RFC `version` or `variant` fields
|
|
236
|
-
|
|
237
|
-
if (!validate(uuid)) {
|
|
238
|
-
throw TypeError('Stringified UUID is invalid');
|
|
239
|
-
}
|
|
240
|
-
|
|
241
|
-
return uuid;
|
|
242
|
-
}
|
|
243
|
-
|
|
244
|
-
function v4(options, buf, offset) {
|
|
245
|
-
options = options || {};
|
|
246
|
-
var rnds = options.random || (options.rng || rng)(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`
|
|
247
|
-
|
|
248
|
-
rnds[6] = rnds[6] & 0x0f | 0x40;
|
|
249
|
-
rnds[8] = rnds[8] & 0x3f | 0x80; // Copy bytes to buffer, if provided
|
|
250
|
-
|
|
251
|
-
if (buf) {
|
|
252
|
-
offset = offset || 0;
|
|
253
|
-
|
|
254
|
-
for (var i = 0; i < 16; ++i) {
|
|
255
|
-
buf[offset + i] = rnds[i];
|
|
256
|
-
}
|
|
257
|
-
|
|
258
|
-
return buf;
|
|
259
|
-
}
|
|
260
|
-
|
|
261
|
-
return stringify(rnds);
|
|
262
|
-
}
|
|
263
|
-
|
|
264
|
-
var amplifyS3AlbumCss = ":host{--overlay-bg-color:rgba(0, 0, 0, 0.15)}.album-container{-webkit-box-sizing:border-box;box-sizing:border-box;max-width:100%;margin:0 auto;padding:0 2rem}.grid-row{display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;margin:-1rem -1rem;padding-bottom:3rem}.grid-item{position:relative;-ms-flex:1 0 22rem;flex:1 0 22rem;-ms-flex-positive:1;flex-grow:1;margin:1rem;display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center}amplify-s3-image{--width:22rem;--height:20rem;border-radius:5px;-o-object-fit:cover;object-fit:cover}.img-overlay{display:none;width:100%;height:21rem;position:absolute;top:0;left:0;background-color:var(--overlay-bg-color)}.grid-item:hover .img-overlay{display:block}";
|
|
265
|
-
var logger = new _aws_amplify_core__WEBPACK_IMPORTED_MODULE_1__["Logger"]('S3Album');
|
|
266
|
-
|
|
267
|
-
var AmplifyS3Album =
|
|
268
|
-
/** @class */
|
|
269
|
-
function () {
|
|
270
|
-
function class_1(hostRef) {
|
|
271
|
-
var _this = this;
|
|
272
|
-
|
|
273
|
-
Object(_index_83f2275b_js__WEBPACK_IMPORTED_MODULE_0__["r"])(this, hostRef);
|
|
274
|
-
/** The content type header used when uploading to S3 */
|
|
275
|
-
|
|
276
|
-
this.contentType = 'binary/octet-stream';
|
|
277
|
-
/** The access level of the files */
|
|
278
|
-
|
|
279
|
-
this.level = _storage_types_f257c0f2_js__WEBPACK_IMPORTED_MODULE_2__["A"].Public;
|
|
280
|
-
/** Boolean to enable or disable picker */
|
|
281
|
-
|
|
282
|
-
this.picker = true;
|
|
283
|
-
/** Picker button text */
|
|
284
|
-
|
|
285
|
-
this.pickerText = _Translations_108d469f_js__WEBPACK_IMPORTED_MODULE_4__["T"].PICKER_TEXT;
|
|
286
|
-
this.albumItems = [];
|
|
287
|
-
this.imgArr = {};
|
|
288
|
-
|
|
289
|
-
this.list = function () {
|
|
290
|
-
return __awaiter(_this, void 0, void 0, function () {
|
|
291
|
-
var _a, _b, path, level, track, identityId, data, error_1;
|
|
292
|
-
|
|
293
|
-
return __generator(this, function (_c) {
|
|
294
|
-
switch (_c.label) {
|
|
295
|
-
case 0:
|
|
296
|
-
_a = this, _b = _a.path, path = _b === void 0 ? '' : _b, level = _a.level, track = _a.track, identityId = _a.identityId;
|
|
297
|
-
logger.debug('Album path: ' + path);
|
|
298
|
-
|
|
299
|
-
if (!_aws_amplify_storage__WEBPACK_IMPORTED_MODULE_6__["Storage"] || typeof _aws_amplify_storage__WEBPACK_IMPORTED_MODULE_6__["Storage"].list !== 'function') {
|
|
300
|
-
throw new Error(_constants_c8ecaa24_js__WEBPACK_IMPORTED_MODULE_5__["d"]);
|
|
301
|
-
}
|
|
302
|
-
|
|
303
|
-
_c.label = 1;
|
|
304
|
-
|
|
305
|
-
case 1:
|
|
306
|
-
_c.trys.push([1, 3,, 4]);
|
|
307
|
-
|
|
308
|
-
return [4
|
|
309
|
-
/*yield*/
|
|
310
|
-
, _aws_amplify_storage__WEBPACK_IMPORTED_MODULE_6__["Storage"].list(path, {
|
|
311
|
-
level: level,
|
|
312
|
-
track: track,
|
|
313
|
-
identityId: identityId
|
|
314
|
-
})];
|
|
315
|
-
|
|
316
|
-
case 2:
|
|
317
|
-
data = _c.sent();
|
|
318
|
-
this.marshal(data);
|
|
319
|
-
return [3
|
|
320
|
-
/*break*/
|
|
321
|
-
, 4];
|
|
322
|
-
|
|
323
|
-
case 3:
|
|
324
|
-
error_1 = _c.sent();
|
|
325
|
-
logger.warn(error_1);
|
|
326
|
-
return [3
|
|
327
|
-
/*break*/
|
|
328
|
-
, 4];
|
|
329
|
-
|
|
330
|
-
case 4:
|
|
331
|
-
return [2
|
|
332
|
-
/*return*/
|
|
333
|
-
];
|
|
334
|
-
}
|
|
335
|
-
});
|
|
336
|
-
});
|
|
337
|
-
};
|
|
338
|
-
|
|
339
|
-
this.marshal = function (list) {
|
|
340
|
-
list.forEach(function (item) {
|
|
341
|
-
var name = item.key.toLowerCase();
|
|
342
|
-
var ext = name.split('.')[1];
|
|
343
|
-
|
|
344
|
-
if (_storage_helpers_1afafead_js__WEBPACK_IMPORTED_MODULE_7__["i"].has(ext)) {
|
|
345
|
-
if (!item.contentType || item.contentType && item.contentType === 'binary/octet-stream') {
|
|
346
|
-
item.contentType = _this.getContentType(item);
|
|
347
|
-
}
|
|
348
|
-
}
|
|
349
|
-
});
|
|
350
|
-
var filtered = list.filter(function (item) {
|
|
351
|
-
return item.contentType && item.contentType.startsWith('image/');
|
|
352
|
-
});
|
|
353
|
-
var items = _this.filter ? _this.filter(filtered) : filtered;
|
|
354
|
-
items = _this.sort ? _this.sort(items) : items;
|
|
355
|
-
_this.albumItems = items;
|
|
356
|
-
logger.debug('album items', _this.albumItems);
|
|
357
|
-
|
|
358
|
-
_this.constructImgArray(_this.albumItems);
|
|
359
|
-
};
|
|
360
|
-
|
|
361
|
-
this.constructImgArray = function (list) {
|
|
362
|
-
list.map(function (item) {
|
|
363
|
-
_this.imgArr["" + item['key']] = item['key'];
|
|
364
|
-
});
|
|
365
|
-
};
|
|
366
|
-
|
|
367
|
-
this.handlePick = function (event) {
|
|
368
|
-
return __awaiter(_this, void 0, void 0, function () {
|
|
369
|
-
var file, _a, _b, path, level, track, fileToKey, key, error_2, filtered;
|
|
370
|
-
|
|
371
|
-
return __generator(this, function (_c) {
|
|
372
|
-
switch (_c.label) {
|
|
373
|
-
case 0:
|
|
374
|
-
file = event.target.files[0];
|
|
375
|
-
_a = this, _b = _a.path, path = _b === void 0 ? '' : _b, level = _a.level, track = _a.track, fileToKey = _a.fileToKey;
|
|
376
|
-
key = path + Object(_storage_helpers_1afafead_js__WEBPACK_IMPORTED_MODULE_7__["c"])(file, fileToKey);
|
|
377
|
-
_c.label = 1;
|
|
378
|
-
|
|
379
|
-
case 1:
|
|
380
|
-
_c.trys.push([1, 3,, 4]);
|
|
381
|
-
|
|
382
|
-
return [4
|
|
383
|
-
/*yield*/
|
|
384
|
-
, Object(_storage_helpers_1afafead_js__WEBPACK_IMPORTED_MODULE_7__["p"])(key, file, level, track, file['type'], logger)];
|
|
385
|
-
|
|
386
|
-
case 2:
|
|
387
|
-
_c.sent();
|
|
388
|
-
|
|
389
|
-
return [3
|
|
390
|
-
/*break*/
|
|
391
|
-
, 4];
|
|
392
|
-
|
|
393
|
-
case 3:
|
|
394
|
-
error_2 = _c.sent();
|
|
395
|
-
logger.error(error_2);
|
|
396
|
-
throw new Error(error_2);
|
|
397
|
-
|
|
398
|
-
case 4:
|
|
399
|
-
if (Object.keys(this.imgArr).includes(key)) {
|
|
400
|
-
this.albumItems = __spreadArrays(this.albumItems);
|
|
401
|
-
this.imgArr[key] = key + "-" + v4();
|
|
402
|
-
} else {
|
|
403
|
-
filtered = __spreadArrays(this.albumItems, this.filter ? this.filter([{
|
|
404
|
-
key: key
|
|
405
|
-
}]) : [{
|
|
406
|
-
key: key
|
|
407
|
-
}]);
|
|
408
|
-
this.albumItems = this.sort ? this.sort(filtered) : filtered;
|
|
409
|
-
}
|
|
410
|
-
|
|
411
|
-
return [2
|
|
412
|
-
/*return*/
|
|
413
|
-
];
|
|
414
|
-
}
|
|
415
|
-
});
|
|
416
|
-
});
|
|
417
|
-
};
|
|
418
|
-
}
|
|
419
|
-
|
|
420
|
-
class_1.prototype.getContentType = function (item) {
|
|
421
|
-
return Object(_aws_amplify_core__WEBPACK_IMPORTED_MODULE_1__["filenameToContentType"])(item.key, 'image/*');
|
|
422
|
-
};
|
|
423
|
-
|
|
424
|
-
class_1.prototype.componentWillLoad = function () {
|
|
425
|
-
this.list();
|
|
426
|
-
};
|
|
427
|
-
|
|
428
|
-
class_1.prototype.render = function () {
|
|
429
|
-
var _this = this;
|
|
430
|
-
|
|
431
|
-
return Object(_index_83f2275b_js__WEBPACK_IMPORTED_MODULE_0__["h"])("div", null, Object(_index_83f2275b_js__WEBPACK_IMPORTED_MODULE_0__["h"])("div", {
|
|
432
|
-
"class": "album-container"
|
|
433
|
-
}, Object(_index_83f2275b_js__WEBPACK_IMPORTED_MODULE_0__["h"])("div", {
|
|
434
|
-
"class": "grid-row"
|
|
435
|
-
}, this.albumItems.map(function (item) {
|
|
436
|
-
return Object(_index_83f2275b_js__WEBPACK_IMPORTED_MODULE_0__["h"])("div", {
|
|
437
|
-
"class": "grid-item",
|
|
438
|
-
key: "key-" + item.key
|
|
439
|
-
}, Object(_index_83f2275b_js__WEBPACK_IMPORTED_MODULE_0__["h"])("amplify-s3-image", {
|
|
440
|
-
key: _this.imgArr[item.key],
|
|
441
|
-
imgKey: item.key,
|
|
442
|
-
level: _this.level,
|
|
443
|
-
path: _this.path,
|
|
444
|
-
identityId: _this.identityId,
|
|
445
|
-
track: _this.track,
|
|
446
|
-
handleOnError: _this.handleOnError,
|
|
447
|
-
handleOnLoad: _this.handleOnLoad
|
|
448
|
-
}), Object(_index_83f2275b_js__WEBPACK_IMPORTED_MODULE_0__["h"])("span", {
|
|
449
|
-
"class": "img-overlay"
|
|
450
|
-
}));
|
|
451
|
-
}))), this.picker && Object(_index_83f2275b_js__WEBPACK_IMPORTED_MODULE_0__["h"])("amplify-picker", {
|
|
452
|
-
pickerText: _aws_amplify_core__WEBPACK_IMPORTED_MODULE_1__["I18n"].get(this.pickerText),
|
|
453
|
-
inputHandler: function inputHandler(e) {
|
|
454
|
-
return _this.handlePick(e);
|
|
455
|
-
},
|
|
456
|
-
acceptValue: "image/*"
|
|
457
|
-
}));
|
|
458
|
-
};
|
|
459
|
-
|
|
460
|
-
return class_1;
|
|
461
|
-
}();
|
|
462
|
-
|
|
463
|
-
AmplifyS3Album.style = amplifyS3AlbumCss;
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
/***/ }),
|
|
467
|
-
|
|
468
|
-
/***/ "../amplify-ui-components/dist/esm-es5/storage-helpers-1afafead.js":
|
|
469
|
-
/*!*************************************************************************!*\
|
|
470
|
-
!*** ../amplify-ui-components/dist/esm-es5/storage-helpers-1afafead.js ***!
|
|
471
|
-
\*************************************************************************/
|
|
472
|
-
/*! exports provided: a, c, g, i, p */
|
|
473
|
-
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
474
|
-
|
|
475
|
-
"use strict";
|
|
476
|
-
__webpack_require__.r(__webpack_exports__);
|
|
477
|
-
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return getTextSource; });
|
|
478
|
-
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return calcKey; });
|
|
479
|
-
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "g", function() { return getStorageObject; });
|
|
480
|
-
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "i", function() { return imageFileType; });
|
|
481
|
-
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "p", function() { return putStorageObject; });
|
|
482
|
-
/* harmony import */ var _constants_c8ecaa24_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./constants-c8ecaa24.js */ "../amplify-ui-components/dist/esm-es5/constants-c8ecaa24.js");
|
|
483
|
-
/* harmony import */ var _aws_amplify_storage__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @aws-amplify/storage */ "@aws-amplify/storage");
|
|
484
|
-
/* harmony import */ var _aws_amplify_storage__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_aws_amplify_storage__WEBPACK_IMPORTED_MODULE_1__);
|
|
485
|
-
var __awaiter = undefined && undefined.__awaiter || function (thisArg, _arguments, P, generator) {
|
|
486
|
-
function adopt(value) {
|
|
487
|
-
return value instanceof P ? value : new P(function (resolve) {
|
|
488
|
-
resolve(value);
|
|
489
|
-
});
|
|
490
|
-
}
|
|
491
|
-
|
|
492
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
493
|
-
function fulfilled(value) {
|
|
494
|
-
try {
|
|
495
|
-
step(generator.next(value));
|
|
496
|
-
} catch (e) {
|
|
497
|
-
reject(e);
|
|
498
|
-
}
|
|
499
|
-
}
|
|
500
|
-
|
|
501
|
-
function rejected(value) {
|
|
502
|
-
try {
|
|
503
|
-
step(generator["throw"](value));
|
|
504
|
-
} catch (e) {
|
|
505
|
-
reject(e);
|
|
506
|
-
}
|
|
507
|
-
}
|
|
508
|
-
|
|
509
|
-
function step(result) {
|
|
510
|
-
result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
|
|
511
|
-
}
|
|
512
|
-
|
|
513
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
514
|
-
});
|
|
515
|
-
};
|
|
516
|
-
|
|
517
|
-
var __generator = undefined && undefined.__generator || function (thisArg, body) {
|
|
518
|
-
var _ = {
|
|
519
|
-
label: 0,
|
|
520
|
-
sent: function sent() {
|
|
521
|
-
if (t[0] & 1) throw t[1];
|
|
522
|
-
return t[1];
|
|
523
|
-
},
|
|
524
|
-
trys: [],
|
|
525
|
-
ops: []
|
|
526
|
-
},
|
|
527
|
-
f,
|
|
528
|
-
y,
|
|
529
|
-
t,
|
|
530
|
-
g;
|
|
531
|
-
return g = {
|
|
532
|
-
next: verb(0),
|
|
533
|
-
"throw": verb(1),
|
|
534
|
-
"return": verb(2)
|
|
535
|
-
}, typeof Symbol === "function" && (g[Symbol.iterator] = function () {
|
|
536
|
-
return this;
|
|
537
|
-
}), g;
|
|
538
|
-
|
|
539
|
-
function verb(n) {
|
|
540
|
-
return function (v) {
|
|
541
|
-
return step([n, v]);
|
|
542
|
-
};
|
|
543
|
-
}
|
|
544
|
-
|
|
545
|
-
function step(op) {
|
|
546
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
547
|
-
|
|
548
|
-
while (_) {
|
|
549
|
-
try {
|
|
550
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
551
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
552
|
-
|
|
553
|
-
switch (op[0]) {
|
|
554
|
-
case 0:
|
|
555
|
-
case 1:
|
|
556
|
-
t = op;
|
|
557
|
-
break;
|
|
558
|
-
|
|
559
|
-
case 4:
|
|
560
|
-
_.label++;
|
|
561
|
-
return {
|
|
562
|
-
value: op[1],
|
|
563
|
-
done: false
|
|
564
|
-
};
|
|
565
|
-
|
|
566
|
-
case 5:
|
|
567
|
-
_.label++;
|
|
568
|
-
y = op[1];
|
|
569
|
-
op = [0];
|
|
570
|
-
continue;
|
|
571
|
-
|
|
572
|
-
case 7:
|
|
573
|
-
op = _.ops.pop();
|
|
574
|
-
|
|
575
|
-
_.trys.pop();
|
|
576
|
-
|
|
577
|
-
continue;
|
|
578
|
-
|
|
579
|
-
default:
|
|
580
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
|
|
581
|
-
_ = 0;
|
|
582
|
-
continue;
|
|
583
|
-
}
|
|
584
|
-
|
|
585
|
-
if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
|
|
586
|
-
_.label = op[1];
|
|
587
|
-
break;
|
|
588
|
-
}
|
|
589
|
-
|
|
590
|
-
if (op[0] === 6 && _.label < t[1]) {
|
|
591
|
-
_.label = t[1];
|
|
592
|
-
t = op;
|
|
593
|
-
break;
|
|
594
|
-
}
|
|
595
|
-
|
|
596
|
-
if (t && _.label < t[2]) {
|
|
597
|
-
_.label = t[2];
|
|
598
|
-
|
|
599
|
-
_.ops.push(op);
|
|
600
|
-
|
|
601
|
-
break;
|
|
602
|
-
}
|
|
603
|
-
|
|
604
|
-
if (t[2]) _.ops.pop();
|
|
605
|
-
|
|
606
|
-
_.trys.pop();
|
|
607
|
-
|
|
608
|
-
continue;
|
|
609
|
-
}
|
|
610
|
-
|
|
611
|
-
op = body.call(thisArg, _);
|
|
612
|
-
} catch (e) {
|
|
613
|
-
op = [6, e];
|
|
614
|
-
y = 0;
|
|
615
|
-
} finally {
|
|
616
|
-
f = t = 0;
|
|
617
|
-
}
|
|
618
|
-
}
|
|
619
|
-
|
|
620
|
-
if (op[0] & 5) throw op[1];
|
|
621
|
-
return {
|
|
622
|
-
value: op[0] ? op[1] : void 0,
|
|
623
|
-
done: true
|
|
624
|
-
};
|
|
625
|
-
}
|
|
626
|
-
};
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
var imageFileType = new Set(['apng', 'bmp', 'gif', 'ico', 'cur', 'jpg', 'jpeg', 'jfif', 'pjpeg', 'pjp', 'png', 'svg', 'tif', 'tiff', 'webp']);
|
|
631
|
-
|
|
632
|
-
var calcKey = function calcKey(file, fileToKey) {
|
|
633
|
-
var name = file.name,
|
|
634
|
-
size = file.size,
|
|
635
|
-
type = file.type;
|
|
636
|
-
var key = encodeURI(name);
|
|
637
|
-
|
|
638
|
-
if (fileToKey) {
|
|
639
|
-
if (typeof fileToKey === 'string') {
|
|
640
|
-
key = fileToKey;
|
|
641
|
-
} else if (typeof fileToKey === 'function') {
|
|
642
|
-
key = fileToKey({
|
|
643
|
-
name: name,
|
|
644
|
-
size: size,
|
|
645
|
-
type: type
|
|
646
|
-
});
|
|
647
|
-
} else {
|
|
648
|
-
key = encodeURI(JSON.stringify(fileToKey));
|
|
649
|
-
}
|
|
650
|
-
|
|
651
|
-
if (!key) {
|
|
652
|
-
key = 'empty_key';
|
|
653
|
-
}
|
|
654
|
-
}
|
|
655
|
-
|
|
656
|
-
return key.replace(/\s/g, '_');
|
|
657
|
-
};
|
|
658
|
-
|
|
659
|
-
var getStorageObject = function getStorageObject(key, level, track, identityId, logger) {
|
|
660
|
-
return __awaiter(void 0, void 0, void 0, function () {
|
|
661
|
-
var src, error_1;
|
|
662
|
-
return __generator(this, function (_a) {
|
|
663
|
-
switch (_a.label) {
|
|
664
|
-
case 0:
|
|
665
|
-
if (!_aws_amplify_storage__WEBPACK_IMPORTED_MODULE_1__["Storage"] || typeof _aws_amplify_storage__WEBPACK_IMPORTED_MODULE_1__["Storage"].get !== 'function') {
|
|
666
|
-
throw new Error(_constants_c8ecaa24_js__WEBPACK_IMPORTED_MODULE_0__["d"]);
|
|
667
|
-
}
|
|
668
|
-
|
|
669
|
-
_a.label = 1;
|
|
670
|
-
|
|
671
|
-
case 1:
|
|
672
|
-
_a.trys.push([1, 3,, 4]);
|
|
673
|
-
|
|
674
|
-
return [4
|
|
675
|
-
/*yield*/
|
|
676
|
-
, _aws_amplify_storage__WEBPACK_IMPORTED_MODULE_1__["Storage"].get(key, {
|
|
677
|
-
level: level,
|
|
678
|
-
track: track,
|
|
679
|
-
identityId: identityId
|
|
680
|
-
})];
|
|
681
|
-
|
|
682
|
-
case 2:
|
|
683
|
-
src = _a.sent();
|
|
684
|
-
logger.debug('Storage image get', src);
|
|
685
|
-
return [2
|
|
686
|
-
/*return*/
|
|
687
|
-
, src];
|
|
688
|
-
|
|
689
|
-
case 3:
|
|
690
|
-
error_1 = _a.sent();
|
|
691
|
-
throw new Error(error_1);
|
|
692
|
-
|
|
693
|
-
case 4:
|
|
694
|
-
return [2
|
|
695
|
-
/*return*/
|
|
696
|
-
];
|
|
697
|
-
}
|
|
698
|
-
});
|
|
699
|
-
});
|
|
700
|
-
};
|
|
701
|
-
|
|
702
|
-
var readFileAsync = function readFileAsync(blob) {
|
|
703
|
-
return new Promise(function (resolve, reject) {
|
|
704
|
-
var reader = new FileReader();
|
|
705
|
-
|
|
706
|
-
reader.onload = function () {
|
|
707
|
-
resolve(reader.result);
|
|
708
|
-
};
|
|
709
|
-
|
|
710
|
-
reader.onerror = function () {
|
|
711
|
-
reject('Failed to read file!');
|
|
712
|
-
reader.abort();
|
|
713
|
-
};
|
|
714
|
-
|
|
715
|
-
reader.readAsText(blob);
|
|
716
|
-
});
|
|
717
|
-
};
|
|
718
|
-
|
|
719
|
-
var getTextSource = function getTextSource(key, level, track, identityId, logger) {
|
|
720
|
-
return __awaiter(void 0, void 0, void 0, function () {
|
|
721
|
-
var textSrc, text, error_2;
|
|
722
|
-
return __generator(this, function (_a) {
|
|
723
|
-
switch (_a.label) {
|
|
724
|
-
case 0:
|
|
725
|
-
if (!_aws_amplify_storage__WEBPACK_IMPORTED_MODULE_1__["Storage"] || typeof _aws_amplify_storage__WEBPACK_IMPORTED_MODULE_1__["Storage"].get !== 'function') {
|
|
726
|
-
throw new Error(_constants_c8ecaa24_js__WEBPACK_IMPORTED_MODULE_0__["d"]);
|
|
727
|
-
}
|
|
728
|
-
|
|
729
|
-
_a.label = 1;
|
|
730
|
-
|
|
731
|
-
case 1:
|
|
732
|
-
_a.trys.push([1, 4,, 5]);
|
|
733
|
-
|
|
734
|
-
return [4
|
|
735
|
-
/*yield*/
|
|
736
|
-
, _aws_amplify_storage__WEBPACK_IMPORTED_MODULE_1__["Storage"].get(key, {
|
|
737
|
-
download: true,
|
|
738
|
-
level: level,
|
|
739
|
-
track: track,
|
|
740
|
-
identityId: identityId
|
|
741
|
-
})];
|
|
742
|
-
|
|
743
|
-
case 2:
|
|
744
|
-
textSrc = _a.sent();
|
|
745
|
-
logger.debug(textSrc);
|
|
746
|
-
return [4
|
|
747
|
-
/*yield*/
|
|
748
|
-
, readFileAsync(textSrc['Body'])];
|
|
749
|
-
|
|
750
|
-
case 3:
|
|
751
|
-
text = _a.sent();
|
|
752
|
-
return [2
|
|
753
|
-
/*return*/
|
|
754
|
-
, text];
|
|
755
|
-
|
|
756
|
-
case 4:
|
|
757
|
-
error_2 = _a.sent();
|
|
758
|
-
throw new Error(error_2);
|
|
759
|
-
|
|
760
|
-
case 5:
|
|
761
|
-
return [2
|
|
762
|
-
/*return*/
|
|
763
|
-
];
|
|
764
|
-
}
|
|
765
|
-
});
|
|
766
|
-
});
|
|
767
|
-
};
|
|
768
|
-
|
|
769
|
-
var putStorageObject = function putStorageObject(key, body, level, track, contentType, logger) {
|
|
770
|
-
return __awaiter(void 0, void 0, void 0, function () {
|
|
771
|
-
var data, error_3;
|
|
772
|
-
return __generator(this, function (_a) {
|
|
773
|
-
switch (_a.label) {
|
|
774
|
-
case 0:
|
|
775
|
-
if (!_aws_amplify_storage__WEBPACK_IMPORTED_MODULE_1__["Storage"] || typeof _aws_amplify_storage__WEBPACK_IMPORTED_MODULE_1__["Storage"].put !== 'function') {
|
|
776
|
-
throw new Error(_constants_c8ecaa24_js__WEBPACK_IMPORTED_MODULE_0__["d"]);
|
|
777
|
-
}
|
|
778
|
-
|
|
779
|
-
_a.label = 1;
|
|
780
|
-
|
|
781
|
-
case 1:
|
|
782
|
-
_a.trys.push([1, 3,, 4]);
|
|
783
|
-
|
|
784
|
-
return [4
|
|
785
|
-
/*yield*/
|
|
786
|
-
, _aws_amplify_storage__WEBPACK_IMPORTED_MODULE_1__["Storage"].put(key, body, {
|
|
787
|
-
contentType: contentType,
|
|
788
|
-
level: level,
|
|
789
|
-
track: track
|
|
790
|
-
})];
|
|
791
|
-
|
|
792
|
-
case 2:
|
|
793
|
-
data = _a.sent();
|
|
794
|
-
logger.debug('Upload data', data);
|
|
795
|
-
return [3
|
|
796
|
-
/*break*/
|
|
797
|
-
, 4];
|
|
798
|
-
|
|
799
|
-
case 3:
|
|
800
|
-
error_3 = _a.sent();
|
|
801
|
-
throw new Error(error_3);
|
|
802
|
-
|
|
803
|
-
case 4:
|
|
804
|
-
return [2
|
|
805
|
-
/*return*/
|
|
806
|
-
];
|
|
807
|
-
}
|
|
808
|
-
});
|
|
809
|
-
});
|
|
810
|
-
};
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
/***/ })
|
|
815
|
-
|
|
816
|
-
}]);
|
|
817
|
-
//# sourceMappingURL=5.js.map
|