@plasmicpkgs/plasmic-giphy 0.0.76 → 0.0.78
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/plasmic-giphy.cjs.development.js +125 -322
- package/dist/plasmic-giphy.cjs.development.js.map +1 -1
- package/dist/plasmic-giphy.cjs.production.min.js +1 -1
- package/dist/plasmic-giphy.cjs.production.min.js.map +1 -1
- package/dist/plasmic-giphy.esm.js +125 -322
- package/dist/plasmic-giphy.esm.js.map +1 -1
- package/package.json +3 -3
|
@@ -34,306 +34,113 @@ function _asyncToGenerator(n) {
|
|
|
34
34
|
});
|
|
35
35
|
};
|
|
36
36
|
}
|
|
37
|
-
function
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
return o(a, "_invoke", {
|
|
72
|
-
value: makeInvokeMethod(t, r, c)
|
|
73
|
-
}), a;
|
|
74
|
-
}
|
|
75
|
-
function tryCatch(t, e, r) {
|
|
76
|
-
try {
|
|
77
|
-
return {
|
|
78
|
-
type: "normal",
|
|
79
|
-
arg: t.call(e, r)
|
|
80
|
-
};
|
|
81
|
-
} catch (t) {
|
|
82
|
-
return {
|
|
83
|
-
type: "throw",
|
|
84
|
-
arg: t
|
|
85
|
-
};
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
e.wrap = wrap;
|
|
89
|
-
var h = "suspendedStart",
|
|
90
|
-
l = "suspendedYield",
|
|
91
|
-
f = "executing",
|
|
92
|
-
s = "completed",
|
|
93
|
-
y = {};
|
|
94
|
-
function Generator() {}
|
|
95
|
-
function GeneratorFunction() {}
|
|
96
|
-
function GeneratorFunctionPrototype() {}
|
|
97
|
-
var p = {};
|
|
98
|
-
define(p, a, function () {
|
|
99
|
-
return this;
|
|
100
|
-
});
|
|
101
|
-
var d = Object.getPrototypeOf,
|
|
102
|
-
v = d && d(d(values([])));
|
|
103
|
-
v && v !== r && n.call(v, a) && (p = v);
|
|
104
|
-
var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p);
|
|
105
|
-
function defineIteratorMethods(t) {
|
|
106
|
-
["next", "throw", "return"].forEach(function (e) {
|
|
107
|
-
define(t, e, function (t) {
|
|
108
|
-
return this._invoke(e, t);
|
|
109
|
-
});
|
|
110
|
-
});
|
|
111
|
-
}
|
|
112
|
-
function AsyncIterator(t, e) {
|
|
113
|
-
function invoke(r, o, i, a) {
|
|
114
|
-
var c = tryCatch(t[r], t, o);
|
|
115
|
-
if ("throw" !== c.type) {
|
|
116
|
-
var u = c.arg,
|
|
117
|
-
h = u.value;
|
|
118
|
-
return h && "object" == typeof h && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) {
|
|
119
|
-
invoke("next", t, i, a);
|
|
120
|
-
}, function (t) {
|
|
121
|
-
invoke("throw", t, i, a);
|
|
122
|
-
}) : e.resolve(h).then(function (t) {
|
|
123
|
-
u.value = t, i(u);
|
|
124
|
-
}, function (t) {
|
|
125
|
-
return invoke("throw", t, i, a);
|
|
126
|
-
});
|
|
127
|
-
}
|
|
128
|
-
a(c.arg);
|
|
129
|
-
}
|
|
130
|
-
var r;
|
|
131
|
-
o(this, "_invoke", {
|
|
132
|
-
value: function (t, n) {
|
|
133
|
-
function callInvokeWithMethodAndArg() {
|
|
134
|
-
return new e(function (e, r) {
|
|
135
|
-
invoke(t, n, e, r);
|
|
136
|
-
});
|
|
37
|
+
function _regenerator() {
|
|
38
|
+
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */
|
|
39
|
+
var e,
|
|
40
|
+
t,
|
|
41
|
+
r = "function" == typeof Symbol ? Symbol : {},
|
|
42
|
+
n = r.iterator || "@@iterator",
|
|
43
|
+
o = r.toStringTag || "@@toStringTag";
|
|
44
|
+
function i(r, n, o, i) {
|
|
45
|
+
var c = n && n.prototype instanceof Generator ? n : Generator,
|
|
46
|
+
u = Object.create(c.prototype);
|
|
47
|
+
return _regeneratorDefine(u, "_invoke", function (r, n, o) {
|
|
48
|
+
var i,
|
|
49
|
+
c,
|
|
50
|
+
u,
|
|
51
|
+
f = 0,
|
|
52
|
+
p = o || [],
|
|
53
|
+
y = !1,
|
|
54
|
+
G = {
|
|
55
|
+
p: 0,
|
|
56
|
+
n: 0,
|
|
57
|
+
v: e,
|
|
58
|
+
a: d,
|
|
59
|
+
f: d.bind(e, 4),
|
|
60
|
+
d: function (t, r) {
|
|
61
|
+
return i = t, c = 0, u = e, G.n = r, a;
|
|
62
|
+
}
|
|
63
|
+
};
|
|
64
|
+
function d(r, n) {
|
|
65
|
+
for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) {
|
|
66
|
+
var o,
|
|
67
|
+
i = p[t],
|
|
68
|
+
d = G.p,
|
|
69
|
+
l = i[2];
|
|
70
|
+
r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0));
|
|
137
71
|
}
|
|
138
|
-
|
|
72
|
+
if (o || r > 1) return a;
|
|
73
|
+
throw y = !0, n;
|
|
139
74
|
}
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
75
|
+
return function (o, p, l) {
|
|
76
|
+
if (f > 1) throw TypeError("Generator is already running");
|
|
77
|
+
for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) {
|
|
78
|
+
i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u);
|
|
79
|
+
try {
|
|
80
|
+
if (f = 2, i) {
|
|
81
|
+
if (c || (o = "next"), t = i[o]) {
|
|
82
|
+
if (!(t = t.call(i, u))) throw TypeError("iterator result is not an object");
|
|
83
|
+
if (!t.done) return t;
|
|
84
|
+
u = t.value, c < 2 && (c = 0);
|
|
85
|
+
} else 1 === c && (t = i.return) && t.call(i), c < 2 && (u = TypeError("The iterator does not provide a '" + o + "' method"), c = 1);
|
|
86
|
+
i = e;
|
|
87
|
+
} else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break;
|
|
88
|
+
} catch (t) {
|
|
89
|
+
i = e, c = 1, u = t;
|
|
90
|
+
} finally {
|
|
91
|
+
f = 1;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
148
94
|
return {
|
|
149
95
|
value: t,
|
|
150
|
-
done:
|
|
96
|
+
done: y
|
|
151
97
|
};
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
var c = n.delegate;
|
|
155
|
-
if (c) {
|
|
156
|
-
var u = maybeInvokeDelegate(c, n);
|
|
157
|
-
if (u) {
|
|
158
|
-
if (u === y) continue;
|
|
159
|
-
return u;
|
|
160
|
-
}
|
|
161
|
-
}
|
|
162
|
-
if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) {
|
|
163
|
-
if (o === h) throw o = s, n.arg;
|
|
164
|
-
n.dispatchException(n.arg);
|
|
165
|
-
} else "return" === n.method && n.abrupt("return", n.arg);
|
|
166
|
-
o = f;
|
|
167
|
-
var p = tryCatch(e, r, n);
|
|
168
|
-
if ("normal" === p.type) {
|
|
169
|
-
if (o = n.done ? s : l, p.arg === y) continue;
|
|
170
|
-
return {
|
|
171
|
-
value: p.arg,
|
|
172
|
-
done: n.done
|
|
173
|
-
};
|
|
174
|
-
}
|
|
175
|
-
"throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg);
|
|
176
|
-
}
|
|
177
|
-
};
|
|
178
|
-
}
|
|
179
|
-
function maybeInvokeDelegate(e, r) {
|
|
180
|
-
var n = r.method,
|
|
181
|
-
o = e.iterator[n];
|
|
182
|
-
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;
|
|
183
|
-
var i = tryCatch(o, e.iterator, r.arg);
|
|
184
|
-
if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y;
|
|
185
|
-
var a = i.arg;
|
|
186
|
-
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);
|
|
187
|
-
}
|
|
188
|
-
function pushTryEntry(t) {
|
|
189
|
-
var e = {
|
|
190
|
-
tryLoc: t[0]
|
|
191
|
-
};
|
|
192
|
-
1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e);
|
|
193
|
-
}
|
|
194
|
-
function resetTryEntry(t) {
|
|
195
|
-
var e = t.completion || {};
|
|
196
|
-
e.type = "normal", delete e.arg, t.completion = e;
|
|
197
|
-
}
|
|
198
|
-
function Context(t) {
|
|
199
|
-
this.tryEntries = [{
|
|
200
|
-
tryLoc: "root"
|
|
201
|
-
}], t.forEach(pushTryEntry, this), this.reset(!0);
|
|
98
|
+
};
|
|
99
|
+
}(r, o, i), !0), u;
|
|
202
100
|
}
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
return i.next = i;
|
|
215
|
-
}
|
|
216
|
-
}
|
|
217
|
-
throw new TypeError(typeof e + " is not iterable");
|
|
101
|
+
var a = {};
|
|
102
|
+
function Generator() {}
|
|
103
|
+
function GeneratorFunction() {}
|
|
104
|
+
function GeneratorFunctionPrototype() {}
|
|
105
|
+
t = Object.getPrototypeOf;
|
|
106
|
+
var c = [][n] ? t(t([][n]())) : (_regeneratorDefine(t = {}, n, function () {
|
|
107
|
+
return this;
|
|
108
|
+
}), t),
|
|
109
|
+
u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c);
|
|
110
|
+
function f(e) {
|
|
111
|
+
return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, _regeneratorDefine(e, o, "GeneratorFunction")), e.prototype = Object.create(u), e;
|
|
218
112
|
}
|
|
219
|
-
return GeneratorFunction.prototype = GeneratorFunctionPrototype,
|
|
220
|
-
value: GeneratorFunctionPrototype,
|
|
221
|
-
configurable: !0
|
|
222
|
-
}), o(GeneratorFunctionPrototype, "constructor", {
|
|
223
|
-
value: GeneratorFunction,
|
|
224
|
-
configurable: !0
|
|
225
|
-
}), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) {
|
|
226
|
-
var e = "function" == typeof t && t.constructor;
|
|
227
|
-
return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name));
|
|
228
|
-
}, e.mark = function (t) {
|
|
229
|
-
return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t;
|
|
230
|
-
}, e.awrap = function (t) {
|
|
231
|
-
return {
|
|
232
|
-
__await: t
|
|
233
|
-
};
|
|
234
|
-
}, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () {
|
|
235
|
-
return this;
|
|
236
|
-
}), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) {
|
|
237
|
-
void 0 === i && (i = Promise);
|
|
238
|
-
var a = new AsyncIterator(wrap(t, r, n, o), i);
|
|
239
|
-
return e.isGeneratorFunction(r) ? a : a.next().then(function (t) {
|
|
240
|
-
return t.done ? t.value : a.next();
|
|
241
|
-
});
|
|
242
|
-
}, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () {
|
|
113
|
+
return GeneratorFunction.prototype = GeneratorFunctionPrototype, _regeneratorDefine(u, "constructor", GeneratorFunctionPrototype), _regeneratorDefine(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = "GeneratorFunction", _regeneratorDefine(GeneratorFunctionPrototype, o, "GeneratorFunction"), _regeneratorDefine(u), _regeneratorDefine(u, o, "Generator"), _regeneratorDefine(u, n, function () {
|
|
243
114
|
return this;
|
|
244
|
-
}),
|
|
115
|
+
}), _regeneratorDefine(u, "toString", function () {
|
|
245
116
|
return "[object Generator]";
|
|
246
|
-
}),
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
return r.reverse(), function next() {
|
|
251
|
-
for (; r.length;) {
|
|
252
|
-
var t = r.pop();
|
|
253
|
-
if (t in e) return next.value = t, next.done = !1, next;
|
|
254
|
-
}
|
|
255
|
-
return next.done = !0, next;
|
|
117
|
+
}), (_regenerator = function () {
|
|
118
|
+
return {
|
|
119
|
+
w: i,
|
|
120
|
+
m: f
|
|
256
121
|
};
|
|
257
|
-
}
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
function handle(n, o) {
|
|
272
|
-
return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o;
|
|
273
|
-
}
|
|
274
|
-
for (var o = this.tryEntries.length - 1; o >= 0; --o) {
|
|
275
|
-
var i = this.tryEntries[o],
|
|
276
|
-
a = i.completion;
|
|
277
|
-
if ("root" === i.tryLoc) return handle("end");
|
|
278
|
-
if (i.tryLoc <= this.prev) {
|
|
279
|
-
var c = n.call(i, "catchLoc"),
|
|
280
|
-
u = n.call(i, "finallyLoc");
|
|
281
|
-
if (c && u) {
|
|
282
|
-
if (this.prev < i.catchLoc) return handle(i.catchLoc, !0);
|
|
283
|
-
if (this.prev < i.finallyLoc) return handle(i.finallyLoc);
|
|
284
|
-
} else if (c) {
|
|
285
|
-
if (this.prev < i.catchLoc) return handle(i.catchLoc, !0);
|
|
286
|
-
} else {
|
|
287
|
-
if (!u) throw Error("try statement without catch or finally");
|
|
288
|
-
if (this.prev < i.finallyLoc) return handle(i.finallyLoc);
|
|
289
|
-
}
|
|
290
|
-
}
|
|
291
|
-
}
|
|
292
|
-
},
|
|
293
|
-
abrupt: function (t, e) {
|
|
294
|
-
for (var r = this.tryEntries.length - 1; r >= 0; --r) {
|
|
295
|
-
var o = this.tryEntries[r];
|
|
296
|
-
if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) {
|
|
297
|
-
var i = o;
|
|
298
|
-
break;
|
|
299
|
-
}
|
|
300
|
-
}
|
|
301
|
-
i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null);
|
|
302
|
-
var a = i ? i.completion : {};
|
|
303
|
-
return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a);
|
|
304
|
-
},
|
|
305
|
-
complete: function (t, e) {
|
|
306
|
-
if ("throw" === t.type) throw t.arg;
|
|
307
|
-
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;
|
|
308
|
-
},
|
|
309
|
-
finish: function (t) {
|
|
310
|
-
for (var e = this.tryEntries.length - 1; e >= 0; --e) {
|
|
311
|
-
var r = this.tryEntries[e];
|
|
312
|
-
if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y;
|
|
313
|
-
}
|
|
314
|
-
},
|
|
315
|
-
catch: function (t) {
|
|
316
|
-
for (var e = this.tryEntries.length - 1; e >= 0; --e) {
|
|
317
|
-
var r = this.tryEntries[e];
|
|
318
|
-
if (r.tryLoc === t) {
|
|
319
|
-
var n = r.completion;
|
|
320
|
-
if ("throw" === n.type) {
|
|
321
|
-
var o = n.arg;
|
|
322
|
-
resetTryEntry(r);
|
|
323
|
-
}
|
|
324
|
-
return o;
|
|
325
|
-
}
|
|
326
|
-
}
|
|
327
|
-
throw Error("illegal catch attempt");
|
|
328
|
-
},
|
|
329
|
-
delegateYield: function (e, r, n) {
|
|
330
|
-
return this.delegate = {
|
|
331
|
-
iterator: values(e),
|
|
332
|
-
resultName: r,
|
|
333
|
-
nextLoc: n
|
|
334
|
-
}, "next" === this.method && (this.arg = t), y;
|
|
122
|
+
})();
|
|
123
|
+
}
|
|
124
|
+
function _regeneratorDefine(e, r, n, t) {
|
|
125
|
+
var i = Object.defineProperty;
|
|
126
|
+
try {
|
|
127
|
+
i({}, "", {});
|
|
128
|
+
} catch (e) {
|
|
129
|
+
i = 0;
|
|
130
|
+
}
|
|
131
|
+
_regeneratorDefine = function (e, r, n, t) {
|
|
132
|
+
function o(r, n) {
|
|
133
|
+
_regeneratorDefine(e, r, function (e) {
|
|
134
|
+
return this._invoke(r, n, e);
|
|
135
|
+
});
|
|
335
136
|
}
|
|
336
|
-
|
|
137
|
+
r ? i ? i(e, r, {
|
|
138
|
+
value: n,
|
|
139
|
+
enumerable: !t,
|
|
140
|
+
configurable: !t,
|
|
141
|
+
writable: !t
|
|
142
|
+
}) : e[r] = n : (o("next", 0), o("throw", 1), o("return", 2));
|
|
143
|
+
}, _regeneratorDefine(e, r, n, t);
|
|
337
144
|
}
|
|
338
145
|
|
|
339
146
|
var useFetch = function useFetch(_ref) {
|
|
@@ -345,34 +152,33 @@ var useFetch = function useFetch(_ref) {
|
|
|
345
152
|
if (keyword) fetchGiphy();
|
|
346
153
|
}, [keyword]);
|
|
347
154
|
var fetchGiphy = /*#__PURE__*/function () {
|
|
348
|
-
var _ref2 = _asyncToGenerator(/*#__PURE__*/
|
|
349
|
-
var _data$, response, _yield$response$json, data;
|
|
350
|
-
return
|
|
351
|
-
while (1) switch (_context.
|
|
155
|
+
var _ref2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee() {
|
|
156
|
+
var _data$, response, _yield$response$json, data, _t;
|
|
157
|
+
return _regenerator().w(function (_context) {
|
|
158
|
+
while (1) switch (_context.p = _context.n) {
|
|
352
159
|
case 0:
|
|
353
|
-
_context.
|
|
354
|
-
_context.
|
|
160
|
+
_context.p = 0;
|
|
161
|
+
_context.n = 1;
|
|
355
162
|
return fetch("https://api.giphy.com/v1/gifs/search?api_key=X1q3afkDR9WHSZJhLS6H9yYTQMPIWOTK&q=" + keyword.split(" ").join("") + "&limit=1");
|
|
356
|
-
case
|
|
357
|
-
response = _context.
|
|
358
|
-
_context.
|
|
163
|
+
case 1:
|
|
164
|
+
response = _context.v;
|
|
165
|
+
_context.n = 2;
|
|
359
166
|
return response.json();
|
|
360
|
-
case
|
|
361
|
-
_yield$response$json = _context.
|
|
167
|
+
case 2:
|
|
168
|
+
_yield$response$json = _context.v;
|
|
362
169
|
data = _yield$response$json.data;
|
|
363
170
|
setGiphyId((_data$ = data[0]) == null ? void 0 : _data$.id);
|
|
364
|
-
_context.
|
|
171
|
+
_context.n = 4;
|
|
365
172
|
break;
|
|
366
|
-
case
|
|
367
|
-
_context.
|
|
368
|
-
|
|
369
|
-
console.log("Error in gif api retrieval: ",
|
|
173
|
+
case 3:
|
|
174
|
+
_context.p = 3;
|
|
175
|
+
_t = _context.v;
|
|
176
|
+
console.log("Error in gif api retrieval: ", _t);
|
|
370
177
|
setGiphyId("");
|
|
371
|
-
case
|
|
372
|
-
|
|
373
|
-
return _context.stop();
|
|
178
|
+
case 4:
|
|
179
|
+
return _context.a(2);
|
|
374
180
|
}
|
|
375
|
-
}, _callee, null, [[0,
|
|
181
|
+
}, _callee, null, [[0, 3]]);
|
|
376
182
|
}));
|
|
377
183
|
return function fetchGiphy() {
|
|
378
184
|
return _ref2.apply(this, arguments);
|
|
@@ -418,27 +224,24 @@ function Giphy(_ref) {
|
|
|
418
224
|
var gf = new jsFetchApi.GiphyFetch("X1q3afkDR9WHSZJhLS6H9yYTQMPIWOTK");
|
|
419
225
|
React.useEffect(function () {
|
|
420
226
|
var fetchGif = /*#__PURE__*/function () {
|
|
421
|
-
var _ref2 = _asyncToGenerator(/*#__PURE__*/
|
|
227
|
+
var _ref2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee() {
|
|
422
228
|
var _yield$gf$gif, data;
|
|
423
|
-
return
|
|
424
|
-
while (1) switch (_context.
|
|
229
|
+
return _regenerator().w(function (_context) {
|
|
230
|
+
while (1) switch (_context.n) {
|
|
425
231
|
case 0:
|
|
426
232
|
if (id) {
|
|
427
|
-
_context.
|
|
233
|
+
_context.n = 1;
|
|
428
234
|
break;
|
|
429
235
|
}
|
|
430
|
-
return _context.
|
|
431
|
-
case
|
|
432
|
-
_context.
|
|
236
|
+
return _context.a(2, null);
|
|
237
|
+
case 1:
|
|
238
|
+
_context.n = 2;
|
|
433
239
|
return gf.gif(id);
|
|
434
|
-
case
|
|
435
|
-
_yield$gf$gif = _context.
|
|
240
|
+
case 2:
|
|
241
|
+
_yield$gf$gif = _context.v;
|
|
436
242
|
data = _yield$gf$gif.data;
|
|
437
243
|
setGif(data);
|
|
438
|
-
return _context.
|
|
439
|
-
case 8:
|
|
440
|
-
case "end":
|
|
441
|
-
return _context.stop();
|
|
244
|
+
return _context.a(2, data);
|
|
442
245
|
}
|
|
443
246
|
}, _callee);
|
|
444
247
|
}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plasmic-giphy.cjs.development.js","sources":["../src/hooks/useFetch.ts","../src/giphy.tsx","../src/index.tsx"],"sourcesContent":["import { useState, useEffect } from \"react\";\n\ninterface HookProps {\n keyword: string\n}\nexport const useFetch = ({ keyword }: HookProps) => {\n const [giphyId, setGiphyId] = useState(\"\");\n\n useEffect(() => {\n if (keyword) fetchGiphy();\n }, [keyword]);\n\n const fetchGiphy = async () => {\n try {\n const response = await fetch(\n `https://api.giphy.com/v1/gifs/search?api_key=X1q3afkDR9WHSZJhLS6H9yYTQMPIWOTK&q=${keyword\n .split(\" \")\n .join(\"\")}&limit=1`\n );\n\n const { data } = await response.json();\n\n setGiphyId(data[0]?.id);\n } catch (error) {\n console.log(\"Error in gif api retrieval: \", error);\n setGiphyId(\"\");\n }\n };\n return giphyId;\n};\n","import { GiphyFetch } from \"@giphy/js-fetch-api\";\nimport { IGif } from \"@giphy/js-types\";\nimport { CodeComponentMeta } from \"@plasmicapp/host/registerComponent\";\nimport React, { useEffect, useState } from \"react\";\nimport { useFetch } from \"./hooks/useFetch\";\n\nexport function ensure<T>(x: T | null | undefined): T {\n if (x === null || x === undefined) {\n debugger;\n throw new Error(`Value must not be undefined or null`);\n } else {\n return x;\n }\n}\n\nconst modulePath = \"@plasmicpkgs/plasmic-giphy\";\n\ninterface GiphyProps {\n searchTerm: string;\n className: string;\n noLayout?: boolean;\n}\n\nexport const GiphyMeta: CodeComponentMeta<GiphyProps> = {\n name: \"hostless-giphy\",\n displayName: \"Giphy\",\n importName: \"Giphy\",\n importPath: modulePath,\n providesData: true,\n description: \"Fetches Giphy data and render it\",\n props: {\n searchTerm: {\n type: \"string\",\n displayName: \"Search Term\",\n description: \"Search term for fetching gif \",\n defaultValue: \"Cat\",\n },\n },\n};\n\nexport function Giphy({ searchTerm, className }: GiphyProps) {\n const id = useFetch({ keyword: searchTerm });\n const [gif, setGif] = useState<IGif | null>(null);\n\n const gf = new GiphyFetch(\"X1q3afkDR9WHSZJhLS6H9yYTQMPIWOTK\");\n useEffect(() => {\n const fetchGif = async () => {\n if (!id) {\n return null;\n }\n const { data } = await gf.gif(id);\n setGif(data);\n return data;\n };\n fetchGif();\n }, [id]);\n\n return (\n <img\n src={gif?.images.downsized_medium.url}\n alt=\"Gif\"\n className={className}\n />\n );\n}\n","import registerComponent, {\n CodeComponentMeta,\n} from \"@plasmicapp/host/registerComponent\";\nimport registerGlobalContext from \"@plasmicapp/host/registerGlobalContext\";\n\nimport { Giphy, GiphyMeta } from \"./giphy\";\n\nexport function registerAll(loader?: {\n registerComponent: typeof registerComponent;\n registerGlobalContext: typeof registerGlobalContext;\n}) {\n const _registerComponent = <T extends React.ComponentType<any>>(\n Component: T,\n defaultMeta: CodeComponentMeta<React.ComponentProps<T>>\n ) => {\n if (loader) {\n loader.registerComponent(Component, defaultMeta);\n } else {\n registerComponent(Component, defaultMeta);\n }\n };\n\n _registerComponent(Giphy, GiphyMeta);\n}\n\nexport * from \"./giphy\";\n"],"names":["useFetch","_ref","keyword","_useState","useState","giphyId","setGiphyId","useEffect","fetchGiphy","_ref2","_asyncToGenerator","
|
|
1
|
+
{"version":3,"file":"plasmic-giphy.cjs.development.js","sources":["../src/hooks/useFetch.ts","../src/giphy.tsx","../src/index.tsx"],"sourcesContent":["import { useState, useEffect } from \"react\";\n\ninterface HookProps {\n keyword: string\n}\nexport const useFetch = ({ keyword }: HookProps) => {\n const [giphyId, setGiphyId] = useState(\"\");\n\n useEffect(() => {\n if (keyword) fetchGiphy();\n }, [keyword]);\n\n const fetchGiphy = async () => {\n try {\n const response = await fetch(\n `https://api.giphy.com/v1/gifs/search?api_key=X1q3afkDR9WHSZJhLS6H9yYTQMPIWOTK&q=${keyword\n .split(\" \")\n .join(\"\")}&limit=1`\n );\n\n const { data } = await response.json();\n\n setGiphyId(data[0]?.id);\n } catch (error) {\n console.log(\"Error in gif api retrieval: \", error);\n setGiphyId(\"\");\n }\n };\n return giphyId;\n};\n","import { GiphyFetch } from \"@giphy/js-fetch-api\";\nimport { IGif } from \"@giphy/js-types\";\nimport { CodeComponentMeta } from \"@plasmicapp/host/registerComponent\";\nimport React, { useEffect, useState } from \"react\";\nimport { useFetch } from \"./hooks/useFetch\";\n\nexport function ensure<T>(x: T | null | undefined): T {\n if (x === null || x === undefined) {\n debugger;\n throw new Error(`Value must not be undefined or null`);\n } else {\n return x;\n }\n}\n\nconst modulePath = \"@plasmicpkgs/plasmic-giphy\";\n\ninterface GiphyProps {\n searchTerm: string;\n className: string;\n noLayout?: boolean;\n}\n\nexport const GiphyMeta: CodeComponentMeta<GiphyProps> = {\n name: \"hostless-giphy\",\n displayName: \"Giphy\",\n importName: \"Giphy\",\n importPath: modulePath,\n providesData: true,\n description: \"Fetches Giphy data and render it\",\n props: {\n searchTerm: {\n type: \"string\",\n displayName: \"Search Term\",\n description: \"Search term for fetching gif \",\n defaultValue: \"Cat\",\n },\n },\n};\n\nexport function Giphy({ searchTerm, className }: GiphyProps) {\n const id = useFetch({ keyword: searchTerm });\n const [gif, setGif] = useState<IGif | null>(null);\n\n const gf = new GiphyFetch(\"X1q3afkDR9WHSZJhLS6H9yYTQMPIWOTK\");\n useEffect(() => {\n const fetchGif = async () => {\n if (!id) {\n return null;\n }\n const { data } = await gf.gif(id);\n setGif(data);\n return data;\n };\n fetchGif();\n }, [id]);\n\n return (\n <img\n src={gif?.images.downsized_medium.url}\n alt=\"Gif\"\n className={className}\n />\n );\n}\n","import registerComponent, {\n CodeComponentMeta,\n} from \"@plasmicapp/host/registerComponent\";\nimport registerGlobalContext from \"@plasmicapp/host/registerGlobalContext\";\n\nimport { Giphy, GiphyMeta } from \"./giphy\";\n\nexport function registerAll(loader?: {\n registerComponent: typeof registerComponent;\n registerGlobalContext: typeof registerGlobalContext;\n}) {\n const _registerComponent = <T extends React.ComponentType<any>>(\n Component: T,\n defaultMeta: CodeComponentMeta<React.ComponentProps<T>>\n ) => {\n if (loader) {\n loader.registerComponent(Component, defaultMeta);\n } else {\n registerComponent(Component, defaultMeta);\n }\n };\n\n _registerComponent(Giphy, GiphyMeta);\n}\n\nexport * from \"./giphy\";\n"],"names":["useFetch","_ref","keyword","_useState","useState","giphyId","setGiphyId","useEffect","fetchGiphy","_ref2","_asyncToGenerator","_regenerator","m","_callee","_data$","response","_yield$response$json","data","_t","w","_context","p","n","fetch","split","join","v","json","id","console","log","a","apply","arguments","ensure","x","undefined","Error","modulePath","GiphyMeta","name","displayName","importName","importPath","providesData","description","props","searchTerm","type","defaultValue","Giphy","className","gif","setGif","gf","GiphyFetch","fetchGif","_yield$gf$gif","React","src","images","downsized_medium","url","alt","registerAll","loader","_registerComponent","Component","defaultMeta","registerComponent"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAKO,IAAMA,QAAQ,GAAG,SAAXA,QAAQA,CAAAC,IAAA;MAAMC,OAAO,GAAAD,IAAA,CAAPC,OAAO;EAC9B,IAAAC,SAAA,GAA8BC,cAAQ,CAAC,EAAE,CAAC;IAAnCC,OAAO,GAAAF,SAAA;IAAEG,UAAU,GAAAH,SAAA;EAE1BI,eAAS,CAAC;IACN,IAAIL,OAAO,EAAEM,UAAU,EAAE;GAC5B,EAAE,CAACN,OAAO,CAAC,CAAC;EAEb,IAAMM,UAAU;IAAA,IAAAC,KAAA,GAAAC,iBAAA,cAAAC,YAAA,GAAAC,CAAA,CAAG,SAAAC;MAAA,IAAAC,MAAA,EAAAC,QAAA,EAAAC,oBAAA,EAAAC,IAAA,EAAAC,EAAA;MAAA,OAAAP,YAAA,GAAAQ,CAAA,WAAAC,QAAA;QAAA,kBAAAA,QAAA,CAAAC,CAAA,GAAAD,QAAA,CAAAE,CAAA;UAAA;YAAAF,QAAA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,CAAC;EAER,OACE8B;IACEC,GAAG,EAAEP,GAAG,oBAAHA,GAAG,CAAEQ,MAAM,CAACC,gBAAgB,CAACC,GAAG;IACrCC,GAAG,EAAC,KAAK;IACTZ,SAAS,EAAEA;IACX;AAEN;;SCzDgBa,WAAWA,CAACC,MAG3B;EACC,IAAMC,kBAAkB,GAAG,SAArBA,kBAAkBA,CACtBC,SAAY,EACZC,WAAuD;IAEvD,IAAIH,MAAM,EAAE;MACVA,MAAM,CAACI,iBAAiB,CAACF,SAAS,EAAEC,WAAW,CAAC;KACjD,MAAM;MACLC,iBAAiB,CAACF,SAAS,EAAEC,WAAW,CAAC;;GAE5C;EAEDF,kBAAkB,CAAChB,KAAK,EAAEX,SAAS,CAAC;AACtC;;;;;;;"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";function t(t){return t&&"object"==typeof t&&"default"in t?t.default:t}Object.defineProperty(exports,"__esModule",{value:!0});var
|
|
1
|
+
"use strict";function t(t){return t&&"object"==typeof t&&"default"in t?t.default:t}Object.defineProperty(exports,"__esModule",{value:!0});var e=t(require("@plasmicapp/host/registerComponent")),r=require("@giphy/js-fetch-api"),n=require("react"),o=t(n);function i(t,e,r,n,o,i,a){try{var u=t[i](a),c=u.value}catch(t){return void r(t)}u.done?e(c):Promise.resolve(c).then(n,o)}function a(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var a=t.apply(e,r);function u(t){i(a,n,o,u,c,"next",t)}function c(t){i(a,n,o,u,c,"throw",t)}u(void 0)}))}}function u(){var t,e,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",o=r.toStringTag||"@@toStringTag";function i(r,n,o,i){var u=Object.create((n&&n.prototype instanceof f?n:f).prototype);return c(u,"_invoke",function(r,n,o){var i,u,c,f=0,s=o||[],p=!1,l={p:0,n:0,v:t,a:h,f:h.bind(t,4),d:function(e,r){return i=e,u=0,c=t,l.n=r,a}};function h(r,n){for(u=r,c=n,e=0;!p&&f&&!o&&e<s.length;e++){var o,i=s[e],h=l.p,y=i[2];r>3?(o=y===n)&&(c=i[(u=i[4])?5:(u=3,3)],i[4]=i[5]=t):i[0]<=h&&((o=r<2&&h<i[1])?(u=0,l.v=n,l.n=i[1]):h<y&&(o=r<3||i[0]>n||n>y)&&(i[4]=r,i[5]=n,l.n=y,u=0))}if(o||r>1)return a;throw p=!0,n}return function(o,s,y){if(f>1)throw TypeError("Generator is already running");for(p&&1===s&&h(s,y),u=s,c=y;(e=u<2?t:c)||!p;){i||(u?u<3?(u>1&&(l.n=-1),h(u,c)):l.n=c:l.v=c);try{if(f=2,i){if(u||(o="next"),e=i[o]){if(!(e=e.call(i,c)))throw TypeError("iterator result is not an object");if(!e.done)return e;c=e.value,u<2&&(u=0)}else 1===u&&(e=i.return)&&e.call(i),u<2&&(c=TypeError("The iterator does not provide a '"+o+"' method"),u=1);i=t}else if((e=(p=l.n<0)?c:r.call(n,l))!==a)break}catch(e){i=t,u=1,c=e}finally{f=1}}return{value:e,done:p}}}(r,o,i),!0),u}var a={};function f(){}function s(){}function p(){}e=Object.getPrototypeOf;var l=[][n]?e(e([][n]())):(c(e={},n,(function(){return this})),e),h=p.prototype=f.prototype=Object.create(l);function y(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,p):(t.__proto__=p,c(t,o,"GeneratorFunction")),t.prototype=Object.create(h),t}return s.prototype=p,c(h,"constructor",p),c(p,"constructor",s),s.displayName="GeneratorFunction",c(p,o,"GeneratorFunction"),c(h),c(h,o,"Generator"),c(h,n,(function(){return this})),c(h,"toString",(function(){return"[object Generator]"})),(u=function(){return{w:i,m:y}})()}function c(t,e,r,n){var o=Object.defineProperty;try{o({},"",{})}catch(t){o=0}(c=function(t,e,r,n){function i(e,r){c(t,e,(function(t){return this._invoke(e,r,t)}))}e?o?o(t,e,{value:r,enumerable:!n,configurable:!n,writable:!n}):t[e]=r:(i("next",0),i("throw",1),i("return",2))})(t,e,r,n)}var f={name:"hostless-giphy",displayName:"Giphy",importName:"Giphy",importPath:"@plasmicpkgs/plasmic-giphy",providesData:!0,description:"Fetches Giphy data and render it",props:{searchTerm:{type:"string",displayName:"Search Term",description:"Search term for fetching gif ",defaultValue:"Cat"}}};function s(t){var e=t.className,i=function(t){var e=t.keyword,r=n.useState(""),o=r[0],i=r[1];n.useEffect((function(){e&&c()}),[e]);var c=function(){var t=a(u().m((function t(){var r,n;return u().w((function(t){for(;;)switch(t.p=t.n){case 0:return t.p=0,t.n=1,fetch("https://api.giphy.com/v1/gifs/search?api_key=X1q3afkDR9WHSZJhLS6H9yYTQMPIWOTK&q="+e.split(" ").join("")+"&limit=1");case 1:return n=t.v,t.n=2,n.json();case 2:i(null==(r=t.v.data[0])?void 0:r.id),t.n=4;break;case 3:t.p=3,console.log("Error in gif api retrieval: ",t.v),i("");case 4:return t.a(2)}}),t,null,[[0,3]])})));return function(){return t.apply(this,arguments)}}();return o}({keyword:t.searchTerm}),c=n.useState(null),f=c[0],s=c[1],p=new r.GiphyFetch("X1q3afkDR9WHSZJhLS6H9yYTQMPIWOTK");return n.useEffect((function(){!function(){var t=a(u().m((function t(){var e;return u().w((function(t){for(;;)switch(t.n){case 0:if(i){t.n=1;break}return t.a(2,null);case 1:return t.n=2,p.gif(i);case 2:return s(e=t.v.data),t.a(2,e)}}),t)})));return function(){return t.apply(this,arguments)}}()()}),[i]),o.createElement("img",{src:null==f?void 0:f.images.downsized_medium.url,alt:"Gif",className:e})}exports.Giphy=s,exports.GiphyMeta=f,exports.ensure=function(t){if(null==t)throw new Error("Value must not be undefined or null");return t},exports.registerAll=function(t){var r,n;r=s,n=f,t?t.registerComponent(r,n):e(r,n)};
|
|
2
2
|
//# sourceMappingURL=plasmic-giphy.cjs.production.min.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plasmic-giphy.cjs.production.min.js","sources":["../src/giphy.tsx","../src/hooks/useFetch.ts","../src/index.tsx"],"sourcesContent":["import { GiphyFetch } from \"@giphy/js-fetch-api\";\nimport { IGif } from \"@giphy/js-types\";\nimport { CodeComponentMeta } from \"@plasmicapp/host/registerComponent\";\nimport React, { useEffect, useState } from \"react\";\nimport { useFetch } from \"./hooks/useFetch\";\n\nexport function ensure<T>(x: T | null | undefined): T {\n if (x === null || x === undefined) {\n debugger;\n throw new Error(`Value must not be undefined or null`);\n } else {\n return x;\n }\n}\n\nconst modulePath = \"@plasmicpkgs/plasmic-giphy\";\n\ninterface GiphyProps {\n searchTerm: string;\n className: string;\n noLayout?: boolean;\n}\n\nexport const GiphyMeta: CodeComponentMeta<GiphyProps> = {\n name: \"hostless-giphy\",\n displayName: \"Giphy\",\n importName: \"Giphy\",\n importPath: modulePath,\n providesData: true,\n description: \"Fetches Giphy data and render it\",\n props: {\n searchTerm: {\n type: \"string\",\n displayName: \"Search Term\",\n description: \"Search term for fetching gif \",\n defaultValue: \"Cat\",\n },\n },\n};\n\nexport function Giphy({ searchTerm, className }: GiphyProps) {\n const id = useFetch({ keyword: searchTerm });\n const [gif, setGif] = useState<IGif | null>(null);\n\n const gf = new GiphyFetch(\"X1q3afkDR9WHSZJhLS6H9yYTQMPIWOTK\");\n useEffect(() => {\n const fetchGif = async () => {\n if (!id) {\n return null;\n }\n const { data } = await gf.gif(id);\n setGif(data);\n return data;\n };\n fetchGif();\n }, [id]);\n\n return (\n <img\n src={gif?.images.downsized_medium.url}\n alt=\"Gif\"\n className={className}\n />\n );\n}\n","import { useState, useEffect } from \"react\";\n\ninterface HookProps {\n keyword: string\n}\nexport const useFetch = ({ keyword }: HookProps) => {\n const [giphyId, setGiphyId] = useState(\"\");\n\n useEffect(() => {\n if (keyword) fetchGiphy();\n }, [keyword]);\n\n const fetchGiphy = async () => {\n try {\n const response = await fetch(\n `https://api.giphy.com/v1/gifs/search?api_key=X1q3afkDR9WHSZJhLS6H9yYTQMPIWOTK&q=${keyword\n .split(\" \")\n .join(\"\")}&limit=1`\n );\n\n const { data } = await response.json();\n\n setGiphyId(data[0]?.id);\n } catch (error) {\n console.log(\"Error in gif api retrieval: \", error);\n setGiphyId(\"\");\n }\n };\n return giphyId;\n};\n","import registerComponent, {\n CodeComponentMeta,\n} from \"@plasmicapp/host/registerComponent\";\nimport registerGlobalContext from \"@plasmicapp/host/registerGlobalContext\";\n\nimport { Giphy, GiphyMeta } from \"./giphy\";\n\nexport function registerAll(loader?: {\n registerComponent: typeof registerComponent;\n registerGlobalContext: typeof registerGlobalContext;\n}) {\n const _registerComponent = <T extends React.ComponentType<any>>(\n Component: T,\n defaultMeta: CodeComponentMeta<React.ComponentProps<T>>\n ) => {\n if (loader) {\n loader.registerComponent(Component, defaultMeta);\n } else {\n registerComponent(Component, defaultMeta);\n }\n };\n\n _registerComponent(Giphy, GiphyMeta);\n}\n\nexport * from \"./giphy\";\n"],"names":["GiphyMeta","name","displayName","importName","importPath","providesData","description","props","searchTerm","type","defaultValue","Giphy","_ref","className","id","keyword","_useState","useState","giphyId","setGiphyId","useEffect","fetchGiphy","_ref2","_asyncToGenerator","
|
|
1
|
+
{"version":3,"file":"plasmic-giphy.cjs.production.min.js","sources":["../src/giphy.tsx","../src/hooks/useFetch.ts","../src/index.tsx"],"sourcesContent":["import { GiphyFetch } from \"@giphy/js-fetch-api\";\nimport { IGif } from \"@giphy/js-types\";\nimport { CodeComponentMeta } from \"@plasmicapp/host/registerComponent\";\nimport React, { useEffect, useState } from \"react\";\nimport { useFetch } from \"./hooks/useFetch\";\n\nexport function ensure<T>(x: T | null | undefined): T {\n if (x === null || x === undefined) {\n debugger;\n throw new Error(`Value must not be undefined or null`);\n } else {\n return x;\n }\n}\n\nconst modulePath = \"@plasmicpkgs/plasmic-giphy\";\n\ninterface GiphyProps {\n searchTerm: string;\n className: string;\n noLayout?: boolean;\n}\n\nexport const GiphyMeta: CodeComponentMeta<GiphyProps> = {\n name: \"hostless-giphy\",\n displayName: \"Giphy\",\n importName: \"Giphy\",\n importPath: modulePath,\n providesData: true,\n description: \"Fetches Giphy data and render it\",\n props: {\n searchTerm: {\n type: \"string\",\n displayName: \"Search Term\",\n description: \"Search term for fetching gif \",\n defaultValue: \"Cat\",\n },\n },\n};\n\nexport function Giphy({ searchTerm, className }: GiphyProps) {\n const id = useFetch({ keyword: searchTerm });\n const [gif, setGif] = useState<IGif | null>(null);\n\n const gf = new GiphyFetch(\"X1q3afkDR9WHSZJhLS6H9yYTQMPIWOTK\");\n useEffect(() => {\n const fetchGif = async () => {\n if (!id) {\n return null;\n }\n const { data } = await gf.gif(id);\n setGif(data);\n return data;\n };\n fetchGif();\n }, [id]);\n\n return (\n <img\n src={gif?.images.downsized_medium.url}\n alt=\"Gif\"\n className={className}\n />\n );\n}\n","import { useState, useEffect } from \"react\";\n\ninterface HookProps {\n keyword: string\n}\nexport const useFetch = ({ keyword }: HookProps) => {\n const [giphyId, setGiphyId] = useState(\"\");\n\n useEffect(() => {\n if (keyword) fetchGiphy();\n }, [keyword]);\n\n const fetchGiphy = async () => {\n try {\n const response = await fetch(\n `https://api.giphy.com/v1/gifs/search?api_key=X1q3afkDR9WHSZJhLS6H9yYTQMPIWOTK&q=${keyword\n .split(\" \")\n .join(\"\")}&limit=1`\n );\n\n const { data } = await response.json();\n\n setGiphyId(data[0]?.id);\n } catch (error) {\n console.log(\"Error in gif api retrieval: \", error);\n setGiphyId(\"\");\n }\n };\n return giphyId;\n};\n","import registerComponent, {\n CodeComponentMeta,\n} from \"@plasmicapp/host/registerComponent\";\nimport registerGlobalContext from \"@plasmicapp/host/registerGlobalContext\";\n\nimport { Giphy, GiphyMeta } from \"./giphy\";\n\nexport function registerAll(loader?: {\n registerComponent: typeof registerComponent;\n registerGlobalContext: typeof registerGlobalContext;\n}) {\n const _registerComponent = <T extends React.ComponentType<any>>(\n Component: T,\n defaultMeta: CodeComponentMeta<React.ComponentProps<T>>\n ) => {\n if (loader) {\n loader.registerComponent(Component, defaultMeta);\n } else {\n registerComponent(Component, defaultMeta);\n }\n };\n\n _registerComponent(Giphy, GiphyMeta);\n}\n\nexport * from \"./giphy\";\n"],"names":["GiphyMeta","name","displayName","importName","importPath","providesData","description","props","searchTerm","type","defaultValue","Giphy","_ref","className","id","keyword","_useState","useState","giphyId","setGiphyId","useEffect","fetchGiphy","_ref2","_asyncToGenerator","_regenerator","m","_callee","_data$","response","w","_context","p","n","fetch","split","join","v","json","data","console","log","a","apply","arguments","useFetch","gif","setGif","gf","GiphyFetch","fetchGif","React","src","images","downsized_medium","url","alt","x","Error","loader","Component","defaultMeta","registerComponent"],"mappings":"gkFAeA,IAQaA,EAA2C,CACtDC,KAAM,iBACNC,YAAa,QACbC,WAAY,QACZC,WAZiB,6BAajBC,cAAc,EACdC,YAAa,mCACbC,MAAO,CACLC,WAAY,CACVC,KAAM,SACNP,YAAa,cACbI,YAAa,gCACbI,aAAc,kBAKJC,EAAKC,OAAeC,EAASD,EAATC,UAC5BC,ECpCgB,SAAHF,OAAMG,EAAOH,EAAPG,QACvBC,EAA8BC,WAAS,IAAhCC,EAAOF,KAAEG,EAAUH,KAE1BI,aAAU,WACFL,GAASM,MACd,CAACN,IAEJ,IAAMM,aAAU,IAAAC,EAAAC,EAAAC,IAAAC,GAAG,SAAAC,IAAA,IAAAC,EAAAC,EAAA,OAAAJ,IAAAK,YAAAC,GAAA,cAAAA,EAAAC,EAAAD,EAAAE,GAAA,OAAA,OAAAF,EAAAC,IAAAD,EAAAE,IAEYC,yFACgElB,EAC9EmB,MAAM,KACNC,KAAK,gBACb,OAJa,OAARP,EAAQE,EAAAM,EAAAN,EAAAE,IAMSJ,EAASS,OAAM,OAEtClB,SAAUQ,EAF4BG,EAAAM,EAA9BE,KAEQ,WAALX,EAASb,IAAIgB,EAAAE,IAAA,MAAA,OAAAF,EAAAC,IAExBQ,QAAQC,IAAI,+BAFYV,EAAAM,GAGxBjB,EAAW,IAAI,OAAA,OAAAW,EAAAW,QAAAf,oBAEtB,kBAfe,OAAAJ,EAAAoB,WAAAC,eAgBhB,OAAOzB,EDaE0B,CAAS,CAAE7B,QADUH,EAAVJ,aAEtBQ,EAAsBC,WAAsB,MAArC4B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_invoke", {
|
|
65
|
-
value: makeInvokeMethod(t, r, c)
|
|
66
|
-
}), a;
|
|
67
|
-
}
|
|
68
|
-
function tryCatch(t, e, r) {
|
|
69
|
-
try {
|
|
70
|
-
return {
|
|
71
|
-
type: "normal",
|
|
72
|
-
arg: t.call(e, r)
|
|
73
|
-
};
|
|
74
|
-
} catch (t) {
|
|
75
|
-
return {
|
|
76
|
-
type: "throw",
|
|
77
|
-
arg: t
|
|
78
|
-
};
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
e.wrap = wrap;
|
|
82
|
-
var h = "suspendedStart",
|
|
83
|
-
l = "suspendedYield",
|
|
84
|
-
f = "executing",
|
|
85
|
-
s = "completed",
|
|
86
|
-
y = {};
|
|
87
|
-
function Generator() {}
|
|
88
|
-
function GeneratorFunction() {}
|
|
89
|
-
function GeneratorFunctionPrototype() {}
|
|
90
|
-
var p = {};
|
|
91
|
-
define(p, a, function () {
|
|
92
|
-
return this;
|
|
93
|
-
});
|
|
94
|
-
var d = Object.getPrototypeOf,
|
|
95
|
-
v = d && d(d(values([])));
|
|
96
|
-
v && v !== r && n.call(v, a) && (p = v);
|
|
97
|
-
var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p);
|
|
98
|
-
function defineIteratorMethods(t) {
|
|
99
|
-
["next", "throw", "return"].forEach(function (e) {
|
|
100
|
-
define(t, e, function (t) {
|
|
101
|
-
return this._invoke(e, t);
|
|
102
|
-
});
|
|
103
|
-
});
|
|
104
|
-
}
|
|
105
|
-
function AsyncIterator(t, e) {
|
|
106
|
-
function invoke(r, o, i, a) {
|
|
107
|
-
var c = tryCatch(t[r], t, o);
|
|
108
|
-
if ("throw" !== c.type) {
|
|
109
|
-
var u = c.arg,
|
|
110
|
-
h = u.value;
|
|
111
|
-
return h && "object" == typeof h && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) {
|
|
112
|
-
invoke("next", t, i, a);
|
|
113
|
-
}, function (t) {
|
|
114
|
-
invoke("throw", t, i, a);
|
|
115
|
-
}) : e.resolve(h).then(function (t) {
|
|
116
|
-
u.value = t, i(u);
|
|
117
|
-
}, function (t) {
|
|
118
|
-
return invoke("throw", t, i, a);
|
|
119
|
-
});
|
|
120
|
-
}
|
|
121
|
-
a(c.arg);
|
|
122
|
-
}
|
|
123
|
-
var r;
|
|
124
|
-
o(this, "_invoke", {
|
|
125
|
-
value: function (t, n) {
|
|
126
|
-
function callInvokeWithMethodAndArg() {
|
|
127
|
-
return new e(function (e, r) {
|
|
128
|
-
invoke(t, n, e, r);
|
|
129
|
-
});
|
|
30
|
+
function _regenerator() {
|
|
31
|
+
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */
|
|
32
|
+
var e,
|
|
33
|
+
t,
|
|
34
|
+
r = "function" == typeof Symbol ? Symbol : {},
|
|
35
|
+
n = r.iterator || "@@iterator",
|
|
36
|
+
o = r.toStringTag || "@@toStringTag";
|
|
37
|
+
function i(r, n, o, i) {
|
|
38
|
+
var c = n && n.prototype instanceof Generator ? n : Generator,
|
|
39
|
+
u = Object.create(c.prototype);
|
|
40
|
+
return _regeneratorDefine(u, "_invoke", function (r, n, o) {
|
|
41
|
+
var i,
|
|
42
|
+
c,
|
|
43
|
+
u,
|
|
44
|
+
f = 0,
|
|
45
|
+
p = o || [],
|
|
46
|
+
y = !1,
|
|
47
|
+
G = {
|
|
48
|
+
p: 0,
|
|
49
|
+
n: 0,
|
|
50
|
+
v: e,
|
|
51
|
+
a: d,
|
|
52
|
+
f: d.bind(e, 4),
|
|
53
|
+
d: function (t, r) {
|
|
54
|
+
return i = t, c = 0, u = e, G.n = r, a;
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
function d(r, n) {
|
|
58
|
+
for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) {
|
|
59
|
+
var o,
|
|
60
|
+
i = p[t],
|
|
61
|
+
d = G.p,
|
|
62
|
+
l = i[2];
|
|
63
|
+
r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0));
|
|
130
64
|
}
|
|
131
|
-
|
|
65
|
+
if (o || r > 1) return a;
|
|
66
|
+
throw y = !0, n;
|
|
132
67
|
}
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
68
|
+
return function (o, p, l) {
|
|
69
|
+
if (f > 1) throw TypeError("Generator is already running");
|
|
70
|
+
for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) {
|
|
71
|
+
i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u);
|
|
72
|
+
try {
|
|
73
|
+
if (f = 2, i) {
|
|
74
|
+
if (c || (o = "next"), t = i[o]) {
|
|
75
|
+
if (!(t = t.call(i, u))) throw TypeError("iterator result is not an object");
|
|
76
|
+
if (!t.done) return t;
|
|
77
|
+
u = t.value, c < 2 && (c = 0);
|
|
78
|
+
} else 1 === c && (t = i.return) && t.call(i), c < 2 && (u = TypeError("The iterator does not provide a '" + o + "' method"), c = 1);
|
|
79
|
+
i = e;
|
|
80
|
+
} else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break;
|
|
81
|
+
} catch (t) {
|
|
82
|
+
i = e, c = 1, u = t;
|
|
83
|
+
} finally {
|
|
84
|
+
f = 1;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
141
87
|
return {
|
|
142
88
|
value: t,
|
|
143
|
-
done:
|
|
89
|
+
done: y
|
|
144
90
|
};
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
var c = n.delegate;
|
|
148
|
-
if (c) {
|
|
149
|
-
var u = maybeInvokeDelegate(c, n);
|
|
150
|
-
if (u) {
|
|
151
|
-
if (u === y) continue;
|
|
152
|
-
return u;
|
|
153
|
-
}
|
|
154
|
-
}
|
|
155
|
-
if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) {
|
|
156
|
-
if (o === h) throw o = s, n.arg;
|
|
157
|
-
n.dispatchException(n.arg);
|
|
158
|
-
} else "return" === n.method && n.abrupt("return", n.arg);
|
|
159
|
-
o = f;
|
|
160
|
-
var p = tryCatch(e, r, n);
|
|
161
|
-
if ("normal" === p.type) {
|
|
162
|
-
if (o = n.done ? s : l, p.arg === y) continue;
|
|
163
|
-
return {
|
|
164
|
-
value: p.arg,
|
|
165
|
-
done: n.done
|
|
166
|
-
};
|
|
167
|
-
}
|
|
168
|
-
"throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg);
|
|
169
|
-
}
|
|
170
|
-
};
|
|
171
|
-
}
|
|
172
|
-
function maybeInvokeDelegate(e, r) {
|
|
173
|
-
var n = r.method,
|
|
174
|
-
o = e.iterator[n];
|
|
175
|
-
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;
|
|
176
|
-
var i = tryCatch(o, e.iterator, r.arg);
|
|
177
|
-
if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y;
|
|
178
|
-
var a = i.arg;
|
|
179
|
-
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);
|
|
180
|
-
}
|
|
181
|
-
function pushTryEntry(t) {
|
|
182
|
-
var e = {
|
|
183
|
-
tryLoc: t[0]
|
|
184
|
-
};
|
|
185
|
-
1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e);
|
|
186
|
-
}
|
|
187
|
-
function resetTryEntry(t) {
|
|
188
|
-
var e = t.completion || {};
|
|
189
|
-
e.type = "normal", delete e.arg, t.completion = e;
|
|
190
|
-
}
|
|
191
|
-
function Context(t) {
|
|
192
|
-
this.tryEntries = [{
|
|
193
|
-
tryLoc: "root"
|
|
194
|
-
}], t.forEach(pushTryEntry, this), this.reset(!0);
|
|
91
|
+
};
|
|
92
|
+
}(r, o, i), !0), u;
|
|
195
93
|
}
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
return i.next = i;
|
|
208
|
-
}
|
|
209
|
-
}
|
|
210
|
-
throw new TypeError(typeof e + " is not iterable");
|
|
94
|
+
var a = {};
|
|
95
|
+
function Generator() {}
|
|
96
|
+
function GeneratorFunction() {}
|
|
97
|
+
function GeneratorFunctionPrototype() {}
|
|
98
|
+
t = Object.getPrototypeOf;
|
|
99
|
+
var c = [][n] ? t(t([][n]())) : (_regeneratorDefine(t = {}, n, function () {
|
|
100
|
+
return this;
|
|
101
|
+
}), t),
|
|
102
|
+
u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c);
|
|
103
|
+
function f(e) {
|
|
104
|
+
return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, _regeneratorDefine(e, o, "GeneratorFunction")), e.prototype = Object.create(u), e;
|
|
211
105
|
}
|
|
212
|
-
return GeneratorFunction.prototype = GeneratorFunctionPrototype,
|
|
213
|
-
value: GeneratorFunctionPrototype,
|
|
214
|
-
configurable: !0
|
|
215
|
-
}), o(GeneratorFunctionPrototype, "constructor", {
|
|
216
|
-
value: GeneratorFunction,
|
|
217
|
-
configurable: !0
|
|
218
|
-
}), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) {
|
|
219
|
-
var e = "function" == typeof t && t.constructor;
|
|
220
|
-
return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name));
|
|
221
|
-
}, e.mark = function (t) {
|
|
222
|
-
return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t;
|
|
223
|
-
}, e.awrap = function (t) {
|
|
224
|
-
return {
|
|
225
|
-
__await: t
|
|
226
|
-
};
|
|
227
|
-
}, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () {
|
|
228
|
-
return this;
|
|
229
|
-
}), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) {
|
|
230
|
-
void 0 === i && (i = Promise);
|
|
231
|
-
var a = new AsyncIterator(wrap(t, r, n, o), i);
|
|
232
|
-
return e.isGeneratorFunction(r) ? a : a.next().then(function (t) {
|
|
233
|
-
return t.done ? t.value : a.next();
|
|
234
|
-
});
|
|
235
|
-
}, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () {
|
|
106
|
+
return GeneratorFunction.prototype = GeneratorFunctionPrototype, _regeneratorDefine(u, "constructor", GeneratorFunctionPrototype), _regeneratorDefine(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = "GeneratorFunction", _regeneratorDefine(GeneratorFunctionPrototype, o, "GeneratorFunction"), _regeneratorDefine(u), _regeneratorDefine(u, o, "Generator"), _regeneratorDefine(u, n, function () {
|
|
236
107
|
return this;
|
|
237
|
-
}),
|
|
108
|
+
}), _regeneratorDefine(u, "toString", function () {
|
|
238
109
|
return "[object Generator]";
|
|
239
|
-
}),
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
return r.reverse(), function next() {
|
|
244
|
-
for (; r.length;) {
|
|
245
|
-
var t = r.pop();
|
|
246
|
-
if (t in e) return next.value = t, next.done = !1, next;
|
|
247
|
-
}
|
|
248
|
-
return next.done = !0, next;
|
|
110
|
+
}), (_regenerator = function () {
|
|
111
|
+
return {
|
|
112
|
+
w: i,
|
|
113
|
+
m: f
|
|
249
114
|
};
|
|
250
|
-
}
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
function handle(n, o) {
|
|
265
|
-
return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o;
|
|
266
|
-
}
|
|
267
|
-
for (var o = this.tryEntries.length - 1; o >= 0; --o) {
|
|
268
|
-
var i = this.tryEntries[o],
|
|
269
|
-
a = i.completion;
|
|
270
|
-
if ("root" === i.tryLoc) return handle("end");
|
|
271
|
-
if (i.tryLoc <= this.prev) {
|
|
272
|
-
var c = n.call(i, "catchLoc"),
|
|
273
|
-
u = n.call(i, "finallyLoc");
|
|
274
|
-
if (c && u) {
|
|
275
|
-
if (this.prev < i.catchLoc) return handle(i.catchLoc, !0);
|
|
276
|
-
if (this.prev < i.finallyLoc) return handle(i.finallyLoc);
|
|
277
|
-
} else if (c) {
|
|
278
|
-
if (this.prev < i.catchLoc) return handle(i.catchLoc, !0);
|
|
279
|
-
} else {
|
|
280
|
-
if (!u) throw Error("try statement without catch or finally");
|
|
281
|
-
if (this.prev < i.finallyLoc) return handle(i.finallyLoc);
|
|
282
|
-
}
|
|
283
|
-
}
|
|
284
|
-
}
|
|
285
|
-
},
|
|
286
|
-
abrupt: function (t, e) {
|
|
287
|
-
for (var r = this.tryEntries.length - 1; r >= 0; --r) {
|
|
288
|
-
var o = this.tryEntries[r];
|
|
289
|
-
if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) {
|
|
290
|
-
var i = o;
|
|
291
|
-
break;
|
|
292
|
-
}
|
|
293
|
-
}
|
|
294
|
-
i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null);
|
|
295
|
-
var a = i ? i.completion : {};
|
|
296
|
-
return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a);
|
|
297
|
-
},
|
|
298
|
-
complete: function (t, e) {
|
|
299
|
-
if ("throw" === t.type) throw t.arg;
|
|
300
|
-
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;
|
|
301
|
-
},
|
|
302
|
-
finish: function (t) {
|
|
303
|
-
for (var e = this.tryEntries.length - 1; e >= 0; --e) {
|
|
304
|
-
var r = this.tryEntries[e];
|
|
305
|
-
if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y;
|
|
306
|
-
}
|
|
307
|
-
},
|
|
308
|
-
catch: function (t) {
|
|
309
|
-
for (var e = this.tryEntries.length - 1; e >= 0; --e) {
|
|
310
|
-
var r = this.tryEntries[e];
|
|
311
|
-
if (r.tryLoc === t) {
|
|
312
|
-
var n = r.completion;
|
|
313
|
-
if ("throw" === n.type) {
|
|
314
|
-
var o = n.arg;
|
|
315
|
-
resetTryEntry(r);
|
|
316
|
-
}
|
|
317
|
-
return o;
|
|
318
|
-
}
|
|
319
|
-
}
|
|
320
|
-
throw Error("illegal catch attempt");
|
|
321
|
-
},
|
|
322
|
-
delegateYield: function (e, r, n) {
|
|
323
|
-
return this.delegate = {
|
|
324
|
-
iterator: values(e),
|
|
325
|
-
resultName: r,
|
|
326
|
-
nextLoc: n
|
|
327
|
-
}, "next" === this.method && (this.arg = t), y;
|
|
115
|
+
})();
|
|
116
|
+
}
|
|
117
|
+
function _regeneratorDefine(e, r, n, t) {
|
|
118
|
+
var i = Object.defineProperty;
|
|
119
|
+
try {
|
|
120
|
+
i({}, "", {});
|
|
121
|
+
} catch (e) {
|
|
122
|
+
i = 0;
|
|
123
|
+
}
|
|
124
|
+
_regeneratorDefine = function (e, r, n, t) {
|
|
125
|
+
function o(r, n) {
|
|
126
|
+
_regeneratorDefine(e, r, function (e) {
|
|
127
|
+
return this._invoke(r, n, e);
|
|
128
|
+
});
|
|
328
129
|
}
|
|
329
|
-
|
|
130
|
+
r ? i ? i(e, r, {
|
|
131
|
+
value: n,
|
|
132
|
+
enumerable: !t,
|
|
133
|
+
configurable: !t,
|
|
134
|
+
writable: !t
|
|
135
|
+
}) : e[r] = n : (o("next", 0), o("throw", 1), o("return", 2));
|
|
136
|
+
}, _regeneratorDefine(e, r, n, t);
|
|
330
137
|
}
|
|
331
138
|
|
|
332
139
|
var useFetch = function useFetch(_ref) {
|
|
@@ -338,34 +145,33 @@ var useFetch = function useFetch(_ref) {
|
|
|
338
145
|
if (keyword) fetchGiphy();
|
|
339
146
|
}, [keyword]);
|
|
340
147
|
var fetchGiphy = /*#__PURE__*/function () {
|
|
341
|
-
var _ref2 = _asyncToGenerator(/*#__PURE__*/
|
|
342
|
-
var _data$, response, _yield$response$json, data;
|
|
343
|
-
return
|
|
344
|
-
while (1) switch (_context.
|
|
148
|
+
var _ref2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee() {
|
|
149
|
+
var _data$, response, _yield$response$json, data, _t;
|
|
150
|
+
return _regenerator().w(function (_context) {
|
|
151
|
+
while (1) switch (_context.p = _context.n) {
|
|
345
152
|
case 0:
|
|
346
|
-
_context.
|
|
347
|
-
_context.
|
|
153
|
+
_context.p = 0;
|
|
154
|
+
_context.n = 1;
|
|
348
155
|
return fetch("https://api.giphy.com/v1/gifs/search?api_key=X1q3afkDR9WHSZJhLS6H9yYTQMPIWOTK&q=" + keyword.split(" ").join("") + "&limit=1");
|
|
349
|
-
case
|
|
350
|
-
response = _context.
|
|
351
|
-
_context.
|
|
156
|
+
case 1:
|
|
157
|
+
response = _context.v;
|
|
158
|
+
_context.n = 2;
|
|
352
159
|
return response.json();
|
|
353
|
-
case
|
|
354
|
-
_yield$response$json = _context.
|
|
160
|
+
case 2:
|
|
161
|
+
_yield$response$json = _context.v;
|
|
355
162
|
data = _yield$response$json.data;
|
|
356
163
|
setGiphyId((_data$ = data[0]) == null ? void 0 : _data$.id);
|
|
357
|
-
_context.
|
|
164
|
+
_context.n = 4;
|
|
358
165
|
break;
|
|
359
|
-
case
|
|
360
|
-
_context.
|
|
361
|
-
|
|
362
|
-
console.log("Error in gif api retrieval: ",
|
|
166
|
+
case 3:
|
|
167
|
+
_context.p = 3;
|
|
168
|
+
_t = _context.v;
|
|
169
|
+
console.log("Error in gif api retrieval: ", _t);
|
|
363
170
|
setGiphyId("");
|
|
364
|
-
case
|
|
365
|
-
|
|
366
|
-
return _context.stop();
|
|
171
|
+
case 4:
|
|
172
|
+
return _context.a(2);
|
|
367
173
|
}
|
|
368
|
-
}, _callee, null, [[0,
|
|
174
|
+
}, _callee, null, [[0, 3]]);
|
|
369
175
|
}));
|
|
370
176
|
return function fetchGiphy() {
|
|
371
177
|
return _ref2.apply(this, arguments);
|
|
@@ -411,27 +217,24 @@ function Giphy(_ref) {
|
|
|
411
217
|
var gf = new GiphyFetch("X1q3afkDR9WHSZJhLS6H9yYTQMPIWOTK");
|
|
412
218
|
useEffect(function () {
|
|
413
219
|
var fetchGif = /*#__PURE__*/function () {
|
|
414
|
-
var _ref2 = _asyncToGenerator(/*#__PURE__*/
|
|
220
|
+
var _ref2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee() {
|
|
415
221
|
var _yield$gf$gif, data;
|
|
416
|
-
return
|
|
417
|
-
while (1) switch (_context.
|
|
222
|
+
return _regenerator().w(function (_context) {
|
|
223
|
+
while (1) switch (_context.n) {
|
|
418
224
|
case 0:
|
|
419
225
|
if (id) {
|
|
420
|
-
_context.
|
|
226
|
+
_context.n = 1;
|
|
421
227
|
break;
|
|
422
228
|
}
|
|
423
|
-
return _context.
|
|
424
|
-
case
|
|
425
|
-
_context.
|
|
229
|
+
return _context.a(2, null);
|
|
230
|
+
case 1:
|
|
231
|
+
_context.n = 2;
|
|
426
232
|
return gf.gif(id);
|
|
427
|
-
case
|
|
428
|
-
_yield$gf$gif = _context.
|
|
233
|
+
case 2:
|
|
234
|
+
_yield$gf$gif = _context.v;
|
|
429
235
|
data = _yield$gf$gif.data;
|
|
430
236
|
setGif(data);
|
|
431
|
-
return _context.
|
|
432
|
-
case 8:
|
|
433
|
-
case "end":
|
|
434
|
-
return _context.stop();
|
|
237
|
+
return _context.a(2, data);
|
|
435
238
|
}
|
|
436
239
|
}, _callee);
|
|
437
240
|
}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plasmic-giphy.esm.js","sources":["../src/hooks/useFetch.ts","../src/giphy.tsx","../src/index.tsx"],"sourcesContent":["import { useState, useEffect } from \"react\";\n\ninterface HookProps {\n keyword: string\n}\nexport const useFetch = ({ keyword }: HookProps) => {\n const [giphyId, setGiphyId] = useState(\"\");\n\n useEffect(() => {\n if (keyword) fetchGiphy();\n }, [keyword]);\n\n const fetchGiphy = async () => {\n try {\n const response = await fetch(\n `https://api.giphy.com/v1/gifs/search?api_key=X1q3afkDR9WHSZJhLS6H9yYTQMPIWOTK&q=${keyword\n .split(\" \")\n .join(\"\")}&limit=1`\n );\n\n const { data } = await response.json();\n\n setGiphyId(data[0]?.id);\n } catch (error) {\n console.log(\"Error in gif api retrieval: \", error);\n setGiphyId(\"\");\n }\n };\n return giphyId;\n};\n","import { GiphyFetch } from \"@giphy/js-fetch-api\";\nimport { IGif } from \"@giphy/js-types\";\nimport { CodeComponentMeta } from \"@plasmicapp/host/registerComponent\";\nimport React, { useEffect, useState } from \"react\";\nimport { useFetch } from \"./hooks/useFetch\";\n\nexport function ensure<T>(x: T | null | undefined): T {\n if (x === null || x === undefined) {\n debugger;\n throw new Error(`Value must not be undefined or null`);\n } else {\n return x;\n }\n}\n\nconst modulePath = \"@plasmicpkgs/plasmic-giphy\";\n\ninterface GiphyProps {\n searchTerm: string;\n className: string;\n noLayout?: boolean;\n}\n\nexport const GiphyMeta: CodeComponentMeta<GiphyProps> = {\n name: \"hostless-giphy\",\n displayName: \"Giphy\",\n importName: \"Giphy\",\n importPath: modulePath,\n providesData: true,\n description: \"Fetches Giphy data and render it\",\n props: {\n searchTerm: {\n type: \"string\",\n displayName: \"Search Term\",\n description: \"Search term for fetching gif \",\n defaultValue: \"Cat\",\n },\n },\n};\n\nexport function Giphy({ searchTerm, className }: GiphyProps) {\n const id = useFetch({ keyword: searchTerm });\n const [gif, setGif] = useState<IGif | null>(null);\n\n const gf = new GiphyFetch(\"X1q3afkDR9WHSZJhLS6H9yYTQMPIWOTK\");\n useEffect(() => {\n const fetchGif = async () => {\n if (!id) {\n return null;\n }\n const { data } = await gf.gif(id);\n setGif(data);\n return data;\n };\n fetchGif();\n }, [id]);\n\n return (\n <img\n src={gif?.images.downsized_medium.url}\n alt=\"Gif\"\n className={className}\n />\n );\n}\n","import registerComponent, {\n CodeComponentMeta,\n} from \"@plasmicapp/host/registerComponent\";\nimport registerGlobalContext from \"@plasmicapp/host/registerGlobalContext\";\n\nimport { Giphy, GiphyMeta } from \"./giphy\";\n\nexport function registerAll(loader?: {\n registerComponent: typeof registerComponent;\n registerGlobalContext: typeof registerGlobalContext;\n}) {\n const _registerComponent = <T extends React.ComponentType<any>>(\n Component: T,\n defaultMeta: CodeComponentMeta<React.ComponentProps<T>>\n ) => {\n if (loader) {\n loader.registerComponent(Component, defaultMeta);\n } else {\n registerComponent(Component, defaultMeta);\n }\n };\n\n _registerComponent(Giphy, GiphyMeta);\n}\n\nexport * from \"./giphy\";\n"],"names":["useFetch","_ref","keyword","_useState","useState","giphyId","setGiphyId","useEffect","fetchGiphy","_ref2","_asyncToGenerator","
|
|
1
|
+
{"version":3,"file":"plasmic-giphy.esm.js","sources":["../src/hooks/useFetch.ts","../src/giphy.tsx","../src/index.tsx"],"sourcesContent":["import { useState, useEffect } from \"react\";\n\ninterface HookProps {\n keyword: string\n}\nexport const useFetch = ({ keyword }: HookProps) => {\n const [giphyId, setGiphyId] = useState(\"\");\n\n useEffect(() => {\n if (keyword) fetchGiphy();\n }, [keyword]);\n\n const fetchGiphy = async () => {\n try {\n const response = await fetch(\n `https://api.giphy.com/v1/gifs/search?api_key=X1q3afkDR9WHSZJhLS6H9yYTQMPIWOTK&q=${keyword\n .split(\" \")\n .join(\"\")}&limit=1`\n );\n\n const { data } = await response.json();\n\n setGiphyId(data[0]?.id);\n } catch (error) {\n console.log(\"Error in gif api retrieval: \", error);\n setGiphyId(\"\");\n }\n };\n return giphyId;\n};\n","import { GiphyFetch } from \"@giphy/js-fetch-api\";\nimport { IGif } from \"@giphy/js-types\";\nimport { CodeComponentMeta } from \"@plasmicapp/host/registerComponent\";\nimport React, { useEffect, useState } from \"react\";\nimport { useFetch } from \"./hooks/useFetch\";\n\nexport function ensure<T>(x: T | null | undefined): T {\n if (x === null || x === undefined) {\n debugger;\n throw new Error(`Value must not be undefined or null`);\n } else {\n return x;\n }\n}\n\nconst modulePath = \"@plasmicpkgs/plasmic-giphy\";\n\ninterface GiphyProps {\n searchTerm: string;\n className: string;\n noLayout?: boolean;\n}\n\nexport const GiphyMeta: CodeComponentMeta<GiphyProps> = {\n name: \"hostless-giphy\",\n displayName: \"Giphy\",\n importName: \"Giphy\",\n importPath: modulePath,\n providesData: true,\n description: \"Fetches Giphy data and render it\",\n props: {\n searchTerm: {\n type: \"string\",\n displayName: \"Search Term\",\n description: \"Search term for fetching gif \",\n defaultValue: \"Cat\",\n },\n },\n};\n\nexport function Giphy({ searchTerm, className }: GiphyProps) {\n const id = useFetch({ keyword: searchTerm });\n const [gif, setGif] = useState<IGif | null>(null);\n\n const gf = new GiphyFetch(\"X1q3afkDR9WHSZJhLS6H9yYTQMPIWOTK\");\n useEffect(() => {\n const fetchGif = async () => {\n if (!id) {\n return null;\n }\n const { data } = await gf.gif(id);\n setGif(data);\n return data;\n };\n fetchGif();\n }, [id]);\n\n return (\n <img\n src={gif?.images.downsized_medium.url}\n alt=\"Gif\"\n className={className}\n />\n );\n}\n","import registerComponent, {\n CodeComponentMeta,\n} from \"@plasmicapp/host/registerComponent\";\nimport registerGlobalContext from \"@plasmicapp/host/registerGlobalContext\";\n\nimport { Giphy, GiphyMeta } from \"./giphy\";\n\nexport function registerAll(loader?: {\n registerComponent: typeof registerComponent;\n registerGlobalContext: typeof registerGlobalContext;\n}) {\n const _registerComponent = <T extends React.ComponentType<any>>(\n Component: T,\n defaultMeta: CodeComponentMeta<React.ComponentProps<T>>\n ) => {\n if (loader) {\n loader.registerComponent(Component, defaultMeta);\n } else {\n registerComponent(Component, defaultMeta);\n }\n };\n\n _registerComponent(Giphy, GiphyMeta);\n}\n\nexport * from \"./giphy\";\n"],"names":["useFetch","_ref","keyword","_useState","useState","giphyId","setGiphyId","useEffect","fetchGiphy","_ref2","_asyncToGenerator","_regenerator","m","_callee","_data$","response","_yield$response$json","data","_t","w","_context","p","n","fetch","split","join","v","json","id","console","log","a","apply","arguments","ensure","x","undefined","Error","modulePath","GiphyMeta","name","displayName","importName","importPath","providesData","description","props","searchTerm","type","defaultValue","Giphy","className","gif","setGif","gf","GiphyFetch","fetchGif","_yield$gf$gif","React","src","images","downsized_medium","url","alt","registerAll","loader","_registerComponent","Component","defaultMeta","registerComponent"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAKO,IAAMA,QAAQ,GAAG,SAAXA,QAAQA,CAAAC,IAAA;MAAMC,OAAO,GAAAD,IAAA,CAAPC,OAAO;EAC9B,IAAAC,SAAA,GAA8BC,QAAQ,CAAC,EAAE,CAAC;IAAnCC,OAAO,GAAAF,SAAA;IAAEG,UAAU,GAAAH,SAAA;EAE1BI,SAAS,CAAC;IACN,IAAIL,OAAO,EAA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GAAG,CAACxB,EAAE,CAAC;YAAA;cAAA6B,aAAA,GAAArC,QAAA,CAAAM,CAAA;cAAzBT,IAAI,GAAAwC,aAAA,CAAJxC,IAAI;cACZoC,MAAM,CAACpC,IAAI,CAAC;cAAC,OAAAG,QAAA,CAAAW,CAAA,IACNd,IAAI;;WAAAJ,OAAA;OACZ;MAAA,gBAPK2C,QAAQA;QAAA,OAAA/C,KAAA,CAAAuB,KAAA,OAAAC,SAAA;;OAOb;IACDuB,QAAQ,EAAE;GACX,EAAE,CAAC5B,EAAE,CAAC,CAAC;EAER,OACE8B;IACEC,GAAG,EAAEP,GAAG,oBAAHA,GAAG,CAAEQ,MAAM,CAACC,gBAAgB,CAACC,GAAG;IACrCC,GAAG,EAAC,KAAK;IACTZ,SAAS,EAAEA;IACX;AAEN;;SCzDgBa,WAAWA,CAACC,MAG3B;EACC,IAAMC,kBAAkB,GAAG,SAArBA,kBAAkBA,CACtBC,SAAY,EACZC,WAAuD;IAEvD,IAAIH,MAAM,EAAE;MACVA,MAAM,CAACI,iBAAiB,CAACF,SAAS,EAAEC,WAAW,CAAC;KACjD,MAAM;MACLC,iBAAiB,CAACF,SAAS,EAAEC,WAAW,CAAC;;GAE5C;EAEDF,kBAAkB,CAAChB,KAAK,EAAEX,SAAS,CAAC;AACtC;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@plasmicpkgs/plasmic-giphy",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.78",
|
|
4
4
|
"description": "Plasmic Giphy components.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"typings": "dist/index.d.ts",
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
}
|
|
35
35
|
],
|
|
36
36
|
"devDependencies": {
|
|
37
|
-
"@plasmicapp/host": "2.0.
|
|
37
|
+
"@plasmicapp/host": "2.0.3",
|
|
38
38
|
"@types/react": "^18",
|
|
39
39
|
"@types/react-dom": "^18",
|
|
40
40
|
"husky": "^7.0.4",
|
|
@@ -49,5 +49,5 @@
|
|
|
49
49
|
"@giphy/react-components": "^9.0.1",
|
|
50
50
|
"change-case": "^4.1.2"
|
|
51
51
|
},
|
|
52
|
-
"gitHead": "
|
|
52
|
+
"gitHead": "c6d493ab33d8d50e512a6b0995aa882c8500d897"
|
|
53
53
|
}
|