code7-leia 0.1.78 → 0.1.80

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.
@@ -8,314 +8,11 @@ import { FaSearch, FaUpload, FaList, FaPlus, FaMicrophone } from 'react-icons/fa
8
8
  import unorm from 'unorm';
9
9
  import { MdClose, MdPerson2 } from 'react-icons/md';
10
10
  import { useDropzone } from 'react-dropzone';
11
- import { put, call } from 'redux-saga/effects';
12
- import axios from 'axios';
13
11
  import { PiWaveformBold } from 'react-icons/pi';
14
12
  import { createStore } from 'redux';
15
13
  import 'redux-persist';
16
14
  import { produce } from 'immer';
17
15
 
18
- function _regeneratorRuntime() {
19
- _regeneratorRuntime = function () {
20
- return e;
21
- };
22
- var t,
23
- e = {},
24
- r = Object.prototype,
25
- n = r.hasOwnProperty,
26
- o = Object.defineProperty || function (t, e, r) {
27
- t[e] = r.value;
28
- },
29
- i = "function" == typeof Symbol ? Symbol : {},
30
- a = i.iterator || "@@iterator",
31
- c = i.asyncIterator || "@@asyncIterator",
32
- u = i.toStringTag || "@@toStringTag";
33
- function define(t, e, r) {
34
- return Object.defineProperty(t, e, {
35
- value: r,
36
- enumerable: !0,
37
- configurable: !0,
38
- writable: !0
39
- }), t[e];
40
- }
41
- try {
42
- define({}, "");
43
- } catch (t) {
44
- define = function (t, e, r) {
45
- return t[e] = r;
46
- };
47
- }
48
- function wrap(t, e, r, n) {
49
- var i = e && e.prototype instanceof Generator ? e : Generator,
50
- a = Object.create(i.prototype),
51
- c = new Context(n || []);
52
- return o(a, "_invoke", {
53
- value: makeInvokeMethod(t, r, c)
54
- }), a;
55
- }
56
- function tryCatch(t, e, r) {
57
- try {
58
- return {
59
- type: "normal",
60
- arg: t.call(e, r)
61
- };
62
- } catch (t) {
63
- return {
64
- type: "throw",
65
- arg: t
66
- };
67
- }
68
- }
69
- e.wrap = wrap;
70
- var h = "suspendedStart",
71
- l = "suspendedYield",
72
- f = "executing",
73
- s = "completed",
74
- y = {};
75
- function Generator() {}
76
- function GeneratorFunction() {}
77
- function GeneratorFunctionPrototype() {}
78
- var p = {};
79
- define(p, a, function () {
80
- return this;
81
- });
82
- var d = Object.getPrototypeOf,
83
- v = d && d(d(values([])));
84
- v && v !== r && n.call(v, a) && (p = v);
85
- var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p);
86
- function defineIteratorMethods(t) {
87
- ["next", "throw", "return"].forEach(function (e) {
88
- define(t, e, function (t) {
89
- return this._invoke(e, t);
90
- });
91
- });
92
- }
93
- function AsyncIterator(t, e) {
94
- function invoke(r, o, i, a) {
95
- var c = tryCatch(t[r], t, o);
96
- if ("throw" !== c.type) {
97
- var u = c.arg,
98
- h = u.value;
99
- return h && "object" == typeof h && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) {
100
- invoke("next", t, i, a);
101
- }, function (t) {
102
- invoke("throw", t, i, a);
103
- }) : e.resolve(h).then(function (t) {
104
- u.value = t, i(u);
105
- }, function (t) {
106
- return invoke("throw", t, i, a);
107
- });
108
- }
109
- a(c.arg);
110
- }
111
- var r;
112
- o(this, "_invoke", {
113
- value: function (t, n) {
114
- function callInvokeWithMethodAndArg() {
115
- return new e(function (e, r) {
116
- invoke(t, n, e, r);
117
- });
118
- }
119
- return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
120
- }
121
- });
122
- }
123
- function makeInvokeMethod(e, r, n) {
124
- var o = h;
125
- return function (i, a) {
126
- if (o === f) throw new Error("Generator is already running");
127
- if (o === s) {
128
- if ("throw" === i) throw a;
129
- return {
130
- value: t,
131
- done: !0
132
- };
133
- }
134
- for (n.method = i, n.arg = a;;) {
135
- var c = n.delegate;
136
- if (c) {
137
- var u = maybeInvokeDelegate(c, n);
138
- if (u) {
139
- if (u === y) continue;
140
- return u;
141
- }
142
- }
143
- if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) {
144
- if (o === h) throw o = s, n.arg;
145
- n.dispatchException(n.arg);
146
- } else "return" === n.method && n.abrupt("return", n.arg);
147
- o = f;
148
- var p = tryCatch(e, r, n);
149
- if ("normal" === p.type) {
150
- if (o = n.done ? s : l, p.arg === y) continue;
151
- return {
152
- value: p.arg,
153
- done: n.done
154
- };
155
- }
156
- "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg);
157
- }
158
- };
159
- }
160
- function maybeInvokeDelegate(e, r) {
161
- var n = r.method,
162
- o = e.iterator[n];
163
- if (o === t) return r.delegate = null, "throw" === n && e.iterator.return && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y;
164
- var i = tryCatch(o, e.iterator, r.arg);
165
- if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y;
166
- var a = i.arg;
167
- return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y);
168
- }
169
- function pushTryEntry(t) {
170
- var e = {
171
- tryLoc: t[0]
172
- };
173
- 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e);
174
- }
175
- function resetTryEntry(t) {
176
- var e = t.completion || {};
177
- e.type = "normal", delete e.arg, t.completion = e;
178
- }
179
- function Context(t) {
180
- this.tryEntries = [{
181
- tryLoc: "root"
182
- }], t.forEach(pushTryEntry, this), this.reset(!0);
183
- }
184
- function values(e) {
185
- if (e || "" === e) {
186
- var r = e[a];
187
- if (r) return r.call(e);
188
- if ("function" == typeof e.next) return e;
189
- if (!isNaN(e.length)) {
190
- var o = -1,
191
- i = function next() {
192
- for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next;
193
- return next.value = t, next.done = !0, next;
194
- };
195
- return i.next = i;
196
- }
197
- }
198
- throw new TypeError(typeof e + " is not iterable");
199
- }
200
- return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", {
201
- value: GeneratorFunctionPrototype,
202
- configurable: !0
203
- }), o(GeneratorFunctionPrototype, "constructor", {
204
- value: GeneratorFunction,
205
- configurable: !0
206
- }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) {
207
- var e = "function" == typeof t && t.constructor;
208
- return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name));
209
- }, e.mark = function (t) {
210
- return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t;
211
- }, e.awrap = function (t) {
212
- return {
213
- __await: t
214
- };
215
- }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () {
216
- return this;
217
- }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) {
218
- void 0 === i && (i = Promise);
219
- var a = new AsyncIterator(wrap(t, r, n, o), i);
220
- return e.isGeneratorFunction(r) ? a : a.next().then(function (t) {
221
- return t.done ? t.value : a.next();
222
- });
223
- }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () {
224
- return this;
225
- }), define(g, "toString", function () {
226
- return "[object Generator]";
227
- }), e.keys = function (t) {
228
- var e = Object(t),
229
- r = [];
230
- for (var n in e) r.push(n);
231
- return r.reverse(), function next() {
232
- for (; r.length;) {
233
- var t = r.pop();
234
- if (t in e) return next.value = t, next.done = !1, next;
235
- }
236
- return next.done = !0, next;
237
- };
238
- }, e.values = values, Context.prototype = {
239
- constructor: Context,
240
- reset: function (e) {
241
- if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t);
242
- },
243
- stop: function () {
244
- this.done = !0;
245
- var t = this.tryEntries[0].completion;
246
- if ("throw" === t.type) throw t.arg;
247
- return this.rval;
248
- },
249
- dispatchException: function (e) {
250
- if (this.done) throw e;
251
- var r = this;
252
- function handle(n, o) {
253
- return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o;
254
- }
255
- for (var o = this.tryEntries.length - 1; o >= 0; --o) {
256
- var i = this.tryEntries[o],
257
- a = i.completion;
258
- if ("root" === i.tryLoc) return handle("end");
259
- if (i.tryLoc <= this.prev) {
260
- var c = n.call(i, "catchLoc"),
261
- u = n.call(i, "finallyLoc");
262
- if (c && u) {
263
- if (this.prev < i.catchLoc) return handle(i.catchLoc, !0);
264
- if (this.prev < i.finallyLoc) return handle(i.finallyLoc);
265
- } else if (c) {
266
- if (this.prev < i.catchLoc) return handle(i.catchLoc, !0);
267
- } else {
268
- if (!u) throw new Error("try statement without catch or finally");
269
- if (this.prev < i.finallyLoc) return handle(i.finallyLoc);
270
- }
271
- }
272
- }
273
- },
274
- abrupt: function (t, e) {
275
- for (var r = this.tryEntries.length - 1; r >= 0; --r) {
276
- var o = this.tryEntries[r];
277
- if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) {
278
- var i = o;
279
- break;
280
- }
281
- }
282
- i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null);
283
- var a = i ? i.completion : {};
284
- return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a);
285
- },
286
- complete: function (t, e) {
287
- if ("throw" === t.type) throw t.arg;
288
- return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y;
289
- },
290
- finish: function (t) {
291
- for (var e = this.tryEntries.length - 1; e >= 0; --e) {
292
- var r = this.tryEntries[e];
293
- if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y;
294
- }
295
- },
296
- catch: function (t) {
297
- for (var e = this.tryEntries.length - 1; e >= 0; --e) {
298
- var r = this.tryEntries[e];
299
- if (r.tryLoc === t) {
300
- var n = r.completion;
301
- if ("throw" === n.type) {
302
- var o = n.arg;
303
- resetTryEntry(r);
304
- }
305
- return o;
306
- }
307
- }
308
- throw new Error("illegal catch attempt");
309
- },
310
- delegateYield: function (e, r, n) {
311
- return this.delegate = {
312
- iterator: values(e),
313
- resultName: r,
314
- nextLoc: n
315
- }, "next" === this.method && (this.arg = t), y;
316
- }
317
- }, e;
318
- }
319
16
  function _extends() {
320
17
  _extends = Object.assign ? Object.assign.bind() : function (target) {
321
18
  for (var i = 1; i < arguments.length; i++) {
@@ -979,48 +676,18 @@ var SharedPropsProvider = function SharedPropsProvider(_ref) {
979
676
  }, children);
980
677
  };
981
678
 
982
- var url = 'http://localhost:5000';
983
- axios.defaults.baseURL = "" + url;
984
- var api = /*#__PURE__*/axios.create();
985
-
986
679
  var Types = {
987
680
  GET_FILES_REQUEST: '@files/GET_FILES_REQUEST',
988
681
  GET_FILES_SUCCESS: '@files/GET_FILES_SUCCESS'
989
682
  };
990
683
 
991
- var _marked = /*#__PURE__*/_regeneratorRuntime().mark(getFiles);
992
- function getFiles(id) {
993
- var _yield$call, data;
994
- return _regeneratorRuntime().wrap(function getFiles$(_context) {
995
- while (1) switch (_context.prev = _context.next) {
996
- case 0:
997
- _context.next = 2;
998
- return call(api.get, "/files/" + id);
999
- case 2:
1000
- _yield$call = _context.sent;
1001
- data = _yield$call.data;
1002
- _context.next = 6;
1003
- return put(getFilesActionSuccess(data.files));
1004
- case 6:
1005
- case "end":
1006
- return _context.stop();
1007
- }
1008
- }, _marked);
1009
- }
1010
-
1011
- function getFilesAction(id) {
684
+ var getFilesAction = function getFilesAction(payload) {
685
+ console.log('------------getFilesAction------------->', payload);
1012
686
  return {
1013
687
  type: Types.GET_FILES_REQUEST,
1014
- payload: getFiles(id)
1015
- };
1016
- }
1017
- function getFilesActionSuccess(data) {
1018
- console.log('------------getFilesActionSuccess------------->', data);
1019
- return {
1020
- type: Types.GET_FILES_SUCCESS,
1021
- payload: data
688
+ payload: payload
1022
689
  };
1023
- }
690
+ };
1024
691
 
1025
692
  var FileArea = function FileArea() {
1026
693
  var _useState = useState([]),
@@ -1286,12 +953,12 @@ var Leia = function Leia(props) {
1286
953
  })))));
1287
954
  };
1288
955
 
1289
- var initState = {
956
+ var INITIAL_STATE = {
1290
957
  files: []
1291
958
  };
1292
959
  function filesReducer(state, action) {
1293
960
  if (state === void 0) {
1294
- state = initState;
961
+ state = INITIAL_STATE;
1295
962
  }
1296
963
  console.log('action: ', action);
1297
964
  return produce(state, function (draft) {
@@ -1306,10 +973,6 @@ function filesReducer(state, action) {
1306
973
  });
1307
974
  }
1308
975
 
1309
- // import { FileData } from '../interface/FileData'
1310
- // const rootReducer = combineReducers({
1311
- // files: FilesReducer as unknown as [FileData],
1312
- // });
1313
976
  var store = /*#__PURE__*/createStore(filesReducer);
1314
977
 
1315
978
  function Code7(props) {