@plasmicapp/loader-nextjs 1.0.212 → 1.0.213
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/loader-nextjs.cjs.development.js +88 -215
- package/dist/loader-nextjs.cjs.development.js.map +1 -1
- package/dist/loader-nextjs.cjs.production.min.js +1 -1
- package/dist/loader-nextjs.cjs.production.min.js.map +1 -1
- package/dist/loader-nextjs.esm.js +88 -215
- package/dist/loader-nextjs.esm.js.map +1 -1
- package/package.json +5 -5
|
@@ -20,65 +20,52 @@ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
|
|
|
20
20
|
reject(error);
|
|
21
21
|
return;
|
|
22
22
|
}
|
|
23
|
-
|
|
24
23
|
if (info.done) {
|
|
25
24
|
resolve(value);
|
|
26
25
|
} else {
|
|
27
26
|
Promise.resolve(value).then(_next, _throw);
|
|
28
27
|
}
|
|
29
28
|
}
|
|
30
|
-
|
|
31
29
|
function _asyncToGenerator(fn) {
|
|
32
30
|
return function () {
|
|
33
31
|
var self = this,
|
|
34
|
-
|
|
32
|
+
args = arguments;
|
|
35
33
|
return new Promise(function (resolve, reject) {
|
|
36
34
|
var gen = fn.apply(self, args);
|
|
37
|
-
|
|
38
35
|
function _next(value) {
|
|
39
36
|
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
|
|
40
37
|
}
|
|
41
|
-
|
|
42
38
|
function _throw(err) {
|
|
43
39
|
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
|
|
44
40
|
}
|
|
45
|
-
|
|
46
41
|
_next(undefined);
|
|
47
42
|
});
|
|
48
43
|
};
|
|
49
44
|
}
|
|
50
|
-
|
|
51
45
|
function _extends() {
|
|
52
|
-
_extends = Object.assign
|
|
46
|
+
_extends = Object.assign ? Object.assign.bind() : function (target) {
|
|
53
47
|
for (var i = 1; i < arguments.length; i++) {
|
|
54
48
|
var source = arguments[i];
|
|
55
|
-
|
|
56
49
|
for (var key in source) {
|
|
57
50
|
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
58
51
|
target[key] = source[key];
|
|
59
52
|
}
|
|
60
53
|
}
|
|
61
54
|
}
|
|
62
|
-
|
|
63
55
|
return target;
|
|
64
56
|
};
|
|
65
|
-
|
|
66
57
|
return _extends.apply(this, arguments);
|
|
67
58
|
}
|
|
68
|
-
|
|
69
59
|
function _inheritsLoose(subClass, superClass) {
|
|
70
60
|
subClass.prototype = Object.create(superClass.prototype);
|
|
71
61
|
subClass.prototype.constructor = subClass;
|
|
72
|
-
|
|
73
62
|
_setPrototypeOf(subClass, superClass);
|
|
74
63
|
}
|
|
75
|
-
|
|
76
64
|
function _setPrototypeOf(o, p) {
|
|
77
|
-
_setPrototypeOf = Object.setPrototypeOf
|
|
65
|
+
_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {
|
|
78
66
|
o.__proto__ = p;
|
|
79
67
|
return o;
|
|
80
68
|
};
|
|
81
|
-
|
|
82
69
|
return _setPrototypeOf(o, p);
|
|
83
70
|
}
|
|
84
71
|
|
|
@@ -93,17 +80,16 @@ var runtime_1 = /*#__PURE__*/createCommonjsModule(function (module) {
|
|
|
93
80
|
* This source code is licensed under the MIT license found in the
|
|
94
81
|
* LICENSE file in the root directory of this source tree.
|
|
95
82
|
*/
|
|
83
|
+
|
|
96
84
|
var runtime = function (exports) {
|
|
97
85
|
|
|
98
86
|
var Op = Object.prototype;
|
|
99
87
|
var hasOwn = Op.hasOwnProperty;
|
|
100
88
|
var undefined$1; // More compressible than void 0.
|
|
101
|
-
|
|
102
89
|
var $Symbol = typeof Symbol === "function" ? Symbol : {};
|
|
103
90
|
var iteratorSymbol = $Symbol.iterator || "@@iterator";
|
|
104
91
|
var asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator";
|
|
105
92
|
var toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
|
|
106
|
-
|
|
107
93
|
function define(obj, key, value) {
|
|
108
94
|
Object.defineProperty(obj, key, {
|
|
109
95
|
value: value,
|
|
@@ -113,7 +99,6 @@ var runtime_1 = /*#__PURE__*/createCommonjsModule(function (module) {
|
|
|
113
99
|
});
|
|
114
100
|
return obj[key];
|
|
115
101
|
}
|
|
116
|
-
|
|
117
102
|
try {
|
|
118
103
|
// IE 8 has a broken Object.defineProperty that only works on DOM objects.
|
|
119
104
|
define({}, "");
|
|
@@ -122,19 +107,20 @@ var runtime_1 = /*#__PURE__*/createCommonjsModule(function (module) {
|
|
|
122
107
|
return obj[key] = value;
|
|
123
108
|
};
|
|
124
109
|
}
|
|
125
|
-
|
|
126
110
|
function wrap(innerFn, outerFn, self, tryLocsList) {
|
|
127
111
|
// If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator.
|
|
128
112
|
var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;
|
|
129
113
|
var generator = Object.create(protoGenerator.prototype);
|
|
130
|
-
var context = new Context(tryLocsList || []);
|
|
131
|
-
// .throw, and .return methods.
|
|
114
|
+
var context = new Context(tryLocsList || []);
|
|
132
115
|
|
|
116
|
+
// The ._invoke method unifies the implementations of the .next,
|
|
117
|
+
// .throw, and .return methods.
|
|
133
118
|
generator._invoke = makeInvokeMethod(innerFn, self, context);
|
|
134
119
|
return generator;
|
|
135
120
|
}
|
|
121
|
+
exports.wrap = wrap;
|
|
136
122
|
|
|
137
|
-
|
|
123
|
+
// Try/catch helper to minimize deoptimizations. Returns a completion
|
|
138
124
|
// record like context.tryEntries[i].completion. This interface could
|
|
139
125
|
// have been (and was previously) designed to take a closure to be
|
|
140
126
|
// invoked without arguments, but in all the cases we care about we
|
|
@@ -144,7 +130,6 @@ var runtime_1 = /*#__PURE__*/createCommonjsModule(function (module) {
|
|
|
144
130
|
// in every case, so we don't have to touch the arguments object. The
|
|
145
131
|
// only additional allocation required is the completion record, which
|
|
146
132
|
// has a stable shape and so hopefully should be cheap to allocate.
|
|
147
|
-
|
|
148
133
|
function tryCatch(fn, obj, arg) {
|
|
149
134
|
try {
|
|
150
135
|
return {
|
|
@@ -158,46 +143,44 @@ var runtime_1 = /*#__PURE__*/createCommonjsModule(function (module) {
|
|
|
158
143
|
};
|
|
159
144
|
}
|
|
160
145
|
}
|
|
161
|
-
|
|
162
146
|
var GenStateSuspendedStart = "suspendedStart";
|
|
163
147
|
var GenStateSuspendedYield = "suspendedYield";
|
|
164
148
|
var GenStateExecuting = "executing";
|
|
165
|
-
var GenStateCompleted = "completed";
|
|
149
|
+
var GenStateCompleted = "completed";
|
|
150
|
+
|
|
151
|
+
// Returning this object from the innerFn has the same effect as
|
|
166
152
|
// breaking out of the dispatch switch statement.
|
|
153
|
+
var ContinueSentinel = {};
|
|
167
154
|
|
|
168
|
-
|
|
155
|
+
// Dummy constructor functions that we use as the .constructor and
|
|
169
156
|
// .constructor.prototype properties for functions that return Generator
|
|
170
157
|
// objects. For full spec compliance, you may wish to configure your
|
|
171
158
|
// minifier not to mangle the names of these two functions.
|
|
172
|
-
|
|
173
159
|
function Generator() {}
|
|
174
|
-
|
|
175
160
|
function GeneratorFunction() {}
|
|
161
|
+
function GeneratorFunctionPrototype() {}
|
|
176
162
|
|
|
177
|
-
|
|
163
|
+
// This is a polyfill for %IteratorPrototype% for environments that
|
|
178
164
|
// don't natively support it.
|
|
179
|
-
|
|
180
|
-
|
|
181
165
|
var IteratorPrototype = {};
|
|
182
166
|
define(IteratorPrototype, iteratorSymbol, function () {
|
|
183
167
|
return this;
|
|
184
168
|
});
|
|
185
169
|
var getProto = Object.getPrototypeOf;
|
|
186
170
|
var NativeIteratorPrototype = getProto && getProto(getProto(values([])));
|
|
187
|
-
|
|
188
171
|
if (NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {
|
|
189
172
|
// This environment has a native %IteratorPrototype%; use it instead
|
|
190
173
|
// of the polyfill.
|
|
191
174
|
IteratorPrototype = NativeIteratorPrototype;
|
|
192
175
|
}
|
|
193
|
-
|
|
194
176
|
var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype);
|
|
195
177
|
GeneratorFunction.prototype = GeneratorFunctionPrototype;
|
|
196
178
|
define(Gp, "constructor", GeneratorFunctionPrototype);
|
|
197
179
|
define(GeneratorFunctionPrototype, "constructor", GeneratorFunction);
|
|
198
|
-
GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction");
|
|
199
|
-
// Iterator interface in terms of a single ._invoke method.
|
|
180
|
+
GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction");
|
|
200
181
|
|
|
182
|
+
// Helper for defining the .next, .throw, and .return methods of the
|
|
183
|
+
// Iterator interface in terms of a single ._invoke method.
|
|
201
184
|
function defineIteratorMethods(prototype) {
|
|
202
185
|
["next", "throw", "return"].forEach(function (method) {
|
|
203
186
|
define(prototype, method, function (arg) {
|
|
@@ -205,14 +188,13 @@ var runtime_1 = /*#__PURE__*/createCommonjsModule(function (module) {
|
|
|
205
188
|
});
|
|
206
189
|
});
|
|
207
190
|
}
|
|
208
|
-
|
|
209
191
|
exports.isGeneratorFunction = function (genFun) {
|
|
210
192
|
var ctor = typeof genFun === "function" && genFun.constructor;
|
|
211
|
-
return ctor ? ctor === GeneratorFunction ||
|
|
193
|
+
return ctor ? ctor === GeneratorFunction ||
|
|
194
|
+
// For the native GeneratorFunction constructor, the best we can
|
|
212
195
|
// do is to check its .name property.
|
|
213
196
|
(ctor.displayName || ctor.name) === "GeneratorFunction" : false;
|
|
214
197
|
};
|
|
215
|
-
|
|
216
198
|
exports.mark = function (genFun) {
|
|
217
199
|
if (Object.setPrototypeOf) {
|
|
218
200
|
Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);
|
|
@@ -220,31 +202,27 @@ var runtime_1 = /*#__PURE__*/createCommonjsModule(function (module) {
|
|
|
220
202
|
genFun.__proto__ = GeneratorFunctionPrototype;
|
|
221
203
|
define(genFun, toStringTagSymbol, "GeneratorFunction");
|
|
222
204
|
}
|
|
223
|
-
|
|
224
205
|
genFun.prototype = Object.create(Gp);
|
|
225
206
|
return genFun;
|
|
226
|
-
};
|
|
207
|
+
};
|
|
208
|
+
|
|
209
|
+
// Within the body of any async function, `await x` is transformed to
|
|
227
210
|
// `yield regeneratorRuntime.awrap(x)`, so that the runtime can test
|
|
228
211
|
// `hasOwn.call(value, "__await")` to determine if the yielded value is
|
|
229
212
|
// meant to be awaited.
|
|
230
|
-
|
|
231
|
-
|
|
232
213
|
exports.awrap = function (arg) {
|
|
233
214
|
return {
|
|
234
215
|
__await: arg
|
|
235
216
|
};
|
|
236
217
|
};
|
|
237
|
-
|
|
238
218
|
function AsyncIterator(generator, PromiseImpl) {
|
|
239
219
|
function invoke(method, arg, resolve, reject) {
|
|
240
220
|
var record = tryCatch(generator[method], generator, arg);
|
|
241
|
-
|
|
242
221
|
if (record.type === "throw") {
|
|
243
222
|
reject(record.arg);
|
|
244
223
|
} else {
|
|
245
224
|
var result = record.arg;
|
|
246
225
|
var value = result.value;
|
|
247
|
-
|
|
248
226
|
if (value && typeof value === "object" && hasOwn.call(value, "__await")) {
|
|
249
227
|
return PromiseImpl.resolve(value.__await).then(function (value) {
|
|
250
228
|
invoke("next", value, resolve, reject);
|
|
@@ -252,7 +230,6 @@ var runtime_1 = /*#__PURE__*/createCommonjsModule(function (module) {
|
|
|
252
230
|
invoke("throw", err, resolve, reject);
|
|
253
231
|
});
|
|
254
232
|
}
|
|
255
|
-
|
|
256
233
|
return PromiseImpl.resolve(value).then(function (unwrapped) {
|
|
257
234
|
// When a yielded Promise is resolved, its final value becomes
|
|
258
235
|
// the .value of the Promise<{value,done}> result for the
|
|
@@ -266,17 +243,15 @@ var runtime_1 = /*#__PURE__*/createCommonjsModule(function (module) {
|
|
|
266
243
|
});
|
|
267
244
|
}
|
|
268
245
|
}
|
|
269
|
-
|
|
270
246
|
var previousPromise;
|
|
271
|
-
|
|
272
247
|
function enqueue(method, arg) {
|
|
273
248
|
function callInvokeWithMethodAndArg() {
|
|
274
249
|
return new PromiseImpl(function (resolve, reject) {
|
|
275
250
|
invoke(method, arg, resolve, reject);
|
|
276
251
|
});
|
|
277
252
|
}
|
|
278
|
-
|
|
279
|
-
|
|
253
|
+
return previousPromise =
|
|
254
|
+
// If enqueue has been called before, then we want to wait until
|
|
280
255
|
// all previous Promises have been resolved before calling invoke,
|
|
281
256
|
// so that results are always delivered in the correct order. If
|
|
282
257
|
// enqueue has not been called before, then it is important to
|
|
@@ -288,24 +263,25 @@ var runtime_1 = /*#__PURE__*/createCommonjsModule(function (module) {
|
|
|
288
263
|
// execute code before the first await. Since we implement simple
|
|
289
264
|
// async functions in terms of async generators, it is especially
|
|
290
265
|
// important to get this right, even though it requires care.
|
|
291
|
-
previousPromise ? previousPromise.then(callInvokeWithMethodAndArg,
|
|
266
|
+
previousPromise ? previousPromise.then(callInvokeWithMethodAndArg,
|
|
267
|
+
// Avoid propagating failures to Promises returned by later
|
|
292
268
|
// invocations of the iterator.
|
|
293
269
|
callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
|
|
294
|
-
}
|
|
295
|
-
// .throw, and .return (see defineIteratorMethods).
|
|
296
|
-
|
|
270
|
+
}
|
|
297
271
|
|
|
272
|
+
// Define the unified helper method that is used to implement .next,
|
|
273
|
+
// .throw, and .return (see defineIteratorMethods).
|
|
298
274
|
this._invoke = enqueue;
|
|
299
275
|
}
|
|
300
|
-
|
|
301
276
|
defineIteratorMethods(AsyncIterator.prototype);
|
|
302
277
|
define(AsyncIterator.prototype, asyncIteratorSymbol, function () {
|
|
303
278
|
return this;
|
|
304
279
|
});
|
|
305
|
-
exports.AsyncIterator = AsyncIterator;
|
|
280
|
+
exports.AsyncIterator = AsyncIterator;
|
|
281
|
+
|
|
282
|
+
// Note that simple async functions are implemented on top of
|
|
306
283
|
// AsyncIterator objects; they just return a Promise for the value of
|
|
307
284
|
// the final result produced by the iterator.
|
|
308
|
-
|
|
309
285
|
exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) {
|
|
310
286
|
if (PromiseImpl === void 0) PromiseImpl = Promise;
|
|
311
287
|
var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl);
|
|
@@ -314,39 +290,32 @@ var runtime_1 = /*#__PURE__*/createCommonjsModule(function (module) {
|
|
|
314
290
|
return result.done ? result.value : iter.next();
|
|
315
291
|
});
|
|
316
292
|
};
|
|
317
|
-
|
|
318
293
|
function makeInvokeMethod(innerFn, self, context) {
|
|
319
294
|
var state = GenStateSuspendedStart;
|
|
320
295
|
return function invoke(method, arg) {
|
|
321
296
|
if (state === GenStateExecuting) {
|
|
322
297
|
throw new Error("Generator is already running");
|
|
323
298
|
}
|
|
324
|
-
|
|
325
299
|
if (state === GenStateCompleted) {
|
|
326
300
|
if (method === "throw") {
|
|
327
301
|
throw arg;
|
|
328
|
-
}
|
|
329
|
-
// https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume
|
|
330
|
-
|
|
302
|
+
}
|
|
331
303
|
|
|
304
|
+
// Be forgiving, per 25.3.3.3.3 of the spec:
|
|
305
|
+
// https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume
|
|
332
306
|
return doneResult();
|
|
333
307
|
}
|
|
334
|
-
|
|
335
308
|
context.method = method;
|
|
336
309
|
context.arg = arg;
|
|
337
|
-
|
|
338
310
|
while (true) {
|
|
339
311
|
var delegate = context.delegate;
|
|
340
|
-
|
|
341
312
|
if (delegate) {
|
|
342
313
|
var delegateResult = maybeInvokeDelegate(delegate, context);
|
|
343
|
-
|
|
344
314
|
if (delegateResult) {
|
|
345
315
|
if (delegateResult === ContinueSentinel) continue;
|
|
346
316
|
return delegateResult;
|
|
347
317
|
}
|
|
348
318
|
}
|
|
349
|
-
|
|
350
319
|
if (context.method === "next") {
|
|
351
320
|
// Setting context._sent for legacy support of Babel's
|
|
352
321
|
// function.sent implementation.
|
|
@@ -356,51 +325,44 @@ var runtime_1 = /*#__PURE__*/createCommonjsModule(function (module) {
|
|
|
356
325
|
state = GenStateCompleted;
|
|
357
326
|
throw context.arg;
|
|
358
327
|
}
|
|
359
|
-
|
|
360
328
|
context.dispatchException(context.arg);
|
|
361
329
|
} else if (context.method === "return") {
|
|
362
330
|
context.abrupt("return", context.arg);
|
|
363
331
|
}
|
|
364
|
-
|
|
365
332
|
state = GenStateExecuting;
|
|
366
333
|
var record = tryCatch(innerFn, self, context);
|
|
367
|
-
|
|
368
334
|
if (record.type === "normal") {
|
|
369
335
|
// If an exception is thrown from innerFn, we leave state ===
|
|
370
336
|
// GenStateExecuting and loop back for another invocation.
|
|
371
337
|
state = context.done ? GenStateCompleted : GenStateSuspendedYield;
|
|
372
|
-
|
|
373
338
|
if (record.arg === ContinueSentinel) {
|
|
374
339
|
continue;
|
|
375
340
|
}
|
|
376
|
-
|
|
377
341
|
return {
|
|
378
342
|
value: record.arg,
|
|
379
343
|
done: context.done
|
|
380
344
|
};
|
|
381
345
|
} else if (record.type === "throw") {
|
|
382
|
-
state = GenStateCompleted;
|
|
346
|
+
state = GenStateCompleted;
|
|
347
|
+
// Dispatch the exception by looping back around to the
|
|
383
348
|
// context.dispatchException(context.arg) call above.
|
|
384
|
-
|
|
385
349
|
context.method = "throw";
|
|
386
350
|
context.arg = record.arg;
|
|
387
351
|
}
|
|
388
352
|
}
|
|
389
353
|
};
|
|
390
|
-
}
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
// Call delegate.iterator[context.method](context.arg) and handle the
|
|
391
357
|
// result, either by returning a { value, done } result from the
|
|
392
358
|
// delegate iterator, or by modifying context.method and context.arg,
|
|
393
359
|
// setting context.delegate to null, and returning the ContinueSentinel.
|
|
394
|
-
|
|
395
|
-
|
|
396
360
|
function maybeInvokeDelegate(delegate, context) {
|
|
397
361
|
var method = delegate.iterator[context.method];
|
|
398
|
-
|
|
399
362
|
if (method === undefined$1) {
|
|
400
363
|
// A .throw or .return when the delegate iterator has no .throw
|
|
401
364
|
// method always terminates the yield* loop.
|
|
402
365
|
context.delegate = null;
|
|
403
|
-
|
|
404
366
|
if (context.method === "throw") {
|
|
405
367
|
// Note: ["return"] must be used for ES3 parsing compatibility.
|
|
406
368
|
if (delegate.iterator["return"]) {
|
|
@@ -409,51 +371,45 @@ var runtime_1 = /*#__PURE__*/createCommonjsModule(function (module) {
|
|
|
409
371
|
context.method = "return";
|
|
410
372
|
context.arg = undefined$1;
|
|
411
373
|
maybeInvokeDelegate(delegate, context);
|
|
412
|
-
|
|
413
374
|
if (context.method === "throw") {
|
|
414
375
|
// If maybeInvokeDelegate(context) changed context.method from
|
|
415
376
|
// "return" to "throw", let that override the TypeError below.
|
|
416
377
|
return ContinueSentinel;
|
|
417
378
|
}
|
|
418
379
|
}
|
|
419
|
-
|
|
420
380
|
context.method = "throw";
|
|
421
381
|
context.arg = new TypeError("The iterator does not provide a 'throw' method");
|
|
422
382
|
}
|
|
423
|
-
|
|
424
383
|
return ContinueSentinel;
|
|
425
384
|
}
|
|
426
|
-
|
|
427
385
|
var record = tryCatch(method, delegate.iterator, context.arg);
|
|
428
|
-
|
|
429
386
|
if (record.type === "throw") {
|
|
430
387
|
context.method = "throw";
|
|
431
388
|
context.arg = record.arg;
|
|
432
389
|
context.delegate = null;
|
|
433
390
|
return ContinueSentinel;
|
|
434
391
|
}
|
|
435
|
-
|
|
436
392
|
var info = record.arg;
|
|
437
|
-
|
|
438
393
|
if (!info) {
|
|
439
394
|
context.method = "throw";
|
|
440
395
|
context.arg = new TypeError("iterator result is not an object");
|
|
441
396
|
context.delegate = null;
|
|
442
397
|
return ContinueSentinel;
|
|
443
398
|
}
|
|
444
|
-
|
|
445
399
|
if (info.done) {
|
|
446
400
|
// Assign the result of the finished delegate to the temporary
|
|
447
401
|
// variable specified by delegate.resultName (see delegateYield).
|
|
448
|
-
context[delegate.resultName] = info.value;
|
|
402
|
+
context[delegate.resultName] = info.value;
|
|
449
403
|
|
|
450
|
-
|
|
404
|
+
// Resume execution at the desired location (see delegateYield).
|
|
405
|
+
context.next = delegate.nextLoc;
|
|
406
|
+
|
|
407
|
+
// If context.method was "throw" but the delegate handled the
|
|
451
408
|
// exception, let the outer generator proceed normally. If
|
|
452
409
|
// context.method was "next", forget context.arg since it has been
|
|
453
410
|
// "consumed" by the delegate iterator. If context.method was
|
|
454
411
|
// "return", allow the original .return call to continue in the
|
|
455
412
|
// outer generator.
|
|
456
|
-
|
|
457
413
|
if (context.method !== "return") {
|
|
458
414
|
context.method = "next";
|
|
459
415
|
context.arg = undefined$1;
|
|
@@ -461,54 +417,49 @@ var runtime_1 = /*#__PURE__*/createCommonjsModule(function (module) {
|
|
|
461
417
|
} else {
|
|
462
418
|
// Re-yield the result returned by the delegate method.
|
|
463
419
|
return info;
|
|
464
|
-
}
|
|
465
|
-
// the outer generator.
|
|
466
|
-
|
|
420
|
+
}
|
|
467
421
|
|
|
422
|
+
// The delegate iterator is finished, so forget it and continue with
|
|
423
|
+
// the outer generator.
|
|
468
424
|
context.delegate = null;
|
|
469
425
|
return ContinueSentinel;
|
|
470
|
-
}
|
|
471
|
-
// unified ._invoke helper method.
|
|
472
|
-
|
|
426
|
+
}
|
|
473
427
|
|
|
428
|
+
// Define Generator.prototype.{next,throw,return} in terms of the
|
|
429
|
+
// unified ._invoke helper method.
|
|
474
430
|
defineIteratorMethods(Gp);
|
|
475
|
-
define(Gp, toStringTagSymbol, "Generator");
|
|
431
|
+
define(Gp, toStringTagSymbol, "Generator");
|
|
432
|
+
|
|
433
|
+
// A Generator should always return itself as the iterator object when the
|
|
476
434
|
// @@iterator function is called on it. Some browsers' implementations of the
|
|
477
435
|
// iterator prototype chain incorrectly implement this, causing the Generator
|
|
478
436
|
// object to not be returned from this call. This ensures that doesn't happen.
|
|
479
437
|
// See https://github.com/facebook/regenerator/issues/274 for more details.
|
|
480
|
-
|
|
481
438
|
define(Gp, iteratorSymbol, function () {
|
|
482
439
|
return this;
|
|
483
440
|
});
|
|
484
441
|
define(Gp, "toString", function () {
|
|
485
442
|
return "[object Generator]";
|
|
486
443
|
});
|
|
487
|
-
|
|
488
444
|
function pushTryEntry(locs) {
|
|
489
445
|
var entry = {
|
|
490
446
|
tryLoc: locs[0]
|
|
491
447
|
};
|
|
492
|
-
|
|
493
448
|
if (1 in locs) {
|
|
494
449
|
entry.catchLoc = locs[1];
|
|
495
450
|
}
|
|
496
|
-
|
|
497
451
|
if (2 in locs) {
|
|
498
452
|
entry.finallyLoc = locs[2];
|
|
499
453
|
entry.afterLoc = locs[3];
|
|
500
454
|
}
|
|
501
|
-
|
|
502
455
|
this.tryEntries.push(entry);
|
|
503
456
|
}
|
|
504
|
-
|
|
505
457
|
function resetTryEntry(entry) {
|
|
506
458
|
var record = entry.completion || {};
|
|
507
459
|
record.type = "normal";
|
|
508
460
|
delete record.arg;
|
|
509
461
|
entry.completion = record;
|
|
510
462
|
}
|
|
511
|
-
|
|
512
463
|
function Context(tryLocsList) {
|
|
513
464
|
// The root entry object (effectively a try statement without a catch
|
|
514
465
|
// or a finally block) gives us a place to store values thrown from
|
|
@@ -519,97 +470,84 @@ var runtime_1 = /*#__PURE__*/createCommonjsModule(function (module) {
|
|
|
519
470
|
tryLocsList.forEach(pushTryEntry, this);
|
|
520
471
|
this.reset(true);
|
|
521
472
|
}
|
|
522
|
-
|
|
523
473
|
exports.keys = function (object) {
|
|
524
474
|
var keys = [];
|
|
525
|
-
|
|
526
475
|
for (var key in object) {
|
|
527
476
|
keys.push(key);
|
|
528
477
|
}
|
|
478
|
+
keys.reverse();
|
|
529
479
|
|
|
530
|
-
|
|
480
|
+
// Rather than returning an object with a next method, we keep
|
|
531
481
|
// things simple and return the next function itself.
|
|
532
|
-
|
|
533
482
|
return function next() {
|
|
534
483
|
while (keys.length) {
|
|
535
484
|
var key = keys.pop();
|
|
536
|
-
|
|
537
485
|
if (key in object) {
|
|
538
486
|
next.value = key;
|
|
539
487
|
next.done = false;
|
|
540
488
|
return next;
|
|
541
489
|
}
|
|
542
|
-
}
|
|
490
|
+
}
|
|
491
|
+
|
|
492
|
+
// To avoid creating an additional object, we just hang the .value
|
|
543
493
|
// and .done properties off the next function object itself. This
|
|
544
494
|
// also ensures that the minifier will not anonymize the function.
|
|
545
|
-
|
|
546
|
-
|
|
547
495
|
next.done = true;
|
|
548
496
|
return next;
|
|
549
497
|
};
|
|
550
498
|
};
|
|
551
|
-
|
|
552
499
|
function values(iterable) {
|
|
553
500
|
if (iterable) {
|
|
554
501
|
var iteratorMethod = iterable[iteratorSymbol];
|
|
555
|
-
|
|
556
502
|
if (iteratorMethod) {
|
|
557
503
|
return iteratorMethod.call(iterable);
|
|
558
504
|
}
|
|
559
|
-
|
|
560
505
|
if (typeof iterable.next === "function") {
|
|
561
506
|
return iterable;
|
|
562
507
|
}
|
|
563
|
-
|
|
564
508
|
if (!isNaN(iterable.length)) {
|
|
565
509
|
var i = -1,
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
510
|
+
next = function next() {
|
|
511
|
+
while (++i < iterable.length) {
|
|
512
|
+
if (hasOwn.call(iterable, i)) {
|
|
513
|
+
next.value = iterable[i];
|
|
514
|
+
next.done = false;
|
|
515
|
+
return next;
|
|
516
|
+
}
|
|
572
517
|
}
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
return next;
|
|
578
|
-
};
|
|
579
|
-
|
|
518
|
+
next.value = undefined$1;
|
|
519
|
+
next.done = true;
|
|
520
|
+
return next;
|
|
521
|
+
};
|
|
580
522
|
return next.next = next;
|
|
581
523
|
}
|
|
582
|
-
}
|
|
583
|
-
|
|
524
|
+
}
|
|
584
525
|
|
|
526
|
+
// Return an iterator with no values.
|
|
585
527
|
return {
|
|
586
528
|
next: doneResult
|
|
587
529
|
};
|
|
588
530
|
}
|
|
589
|
-
|
|
590
531
|
exports.values = values;
|
|
591
|
-
|
|
592
532
|
function doneResult() {
|
|
593
533
|
return {
|
|
594
534
|
value: undefined$1,
|
|
595
535
|
done: true
|
|
596
536
|
};
|
|
597
537
|
}
|
|
598
|
-
|
|
599
538
|
Context.prototype = {
|
|
600
539
|
constructor: Context,
|
|
601
540
|
reset: function reset(skipTempReset) {
|
|
602
541
|
this.prev = 0;
|
|
603
|
-
this.next = 0;
|
|
542
|
+
this.next = 0;
|
|
543
|
+
// Resetting context._sent for legacy support of Babel's
|
|
604
544
|
// function.sent implementation.
|
|
605
|
-
|
|
606
545
|
this.sent = this._sent = undefined$1;
|
|
607
546
|
this.done = false;
|
|
608
547
|
this.delegate = null;
|
|
609
548
|
this.method = "next";
|
|
610
549
|
this.arg = undefined$1;
|
|
611
550
|
this.tryEntries.forEach(resetTryEntry);
|
|
612
|
-
|
|
613
551
|
if (!skipTempReset) {
|
|
614
552
|
for (var name in this) {
|
|
615
553
|
// Not sure about the optimal order of these conditions:
|
|
@@ -623,50 +561,40 @@ var runtime_1 = /*#__PURE__*/createCommonjsModule(function (module) {
|
|
|
623
561
|
this.done = true;
|
|
624
562
|
var rootEntry = this.tryEntries[0];
|
|
625
563
|
var rootRecord = rootEntry.completion;
|
|
626
|
-
|
|
627
564
|
if (rootRecord.type === "throw") {
|
|
628
565
|
throw rootRecord.arg;
|
|
629
566
|
}
|
|
630
|
-
|
|
631
567
|
return this.rval;
|
|
632
568
|
},
|
|
633
569
|
dispatchException: function dispatchException(exception) {
|
|
634
570
|
if (this.done) {
|
|
635
571
|
throw exception;
|
|
636
572
|
}
|
|
637
|
-
|
|
638
573
|
var context = this;
|
|
639
|
-
|
|
640
574
|
function handle(loc, caught) {
|
|
641
575
|
record.type = "throw";
|
|
642
576
|
record.arg = exception;
|
|
643
577
|
context.next = loc;
|
|
644
|
-
|
|
645
578
|
if (caught) {
|
|
646
579
|
// If the dispatched exception was caught by a catch block,
|
|
647
580
|
// then let that catch block handle the exception normally.
|
|
648
581
|
context.method = "next";
|
|
649
582
|
context.arg = undefined$1;
|
|
650
583
|
}
|
|
651
|
-
|
|
652
584
|
return !!caught;
|
|
653
585
|
}
|
|
654
|
-
|
|
655
586
|
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
|
656
587
|
var entry = this.tryEntries[i];
|
|
657
588
|
var record = entry.completion;
|
|
658
|
-
|
|
659
589
|
if (entry.tryLoc === "root") {
|
|
660
590
|
// Exception thrown outside of any try block that could handle
|
|
661
591
|
// it, so set the completion value of the entire function to
|
|
662
592
|
// throw the exception.
|
|
663
593
|
return handle("end");
|
|
664
594
|
}
|
|
665
|
-
|
|
666
595
|
if (entry.tryLoc <= this.prev) {
|
|
667
596
|
var hasCatch = hasOwn.call(entry, "catchLoc");
|
|
668
597
|
var hasFinally = hasOwn.call(entry, "finallyLoc");
|
|
669
|
-
|
|
670
598
|
if (hasCatch && hasFinally) {
|
|
671
599
|
if (this.prev < entry.catchLoc) {
|
|
672
600
|
return handle(entry.catchLoc, true);
|
|
@@ -690,36 +618,30 @@ var runtime_1 = /*#__PURE__*/createCommonjsModule(function (module) {
|
|
|
690
618
|
abrupt: function abrupt(type, arg) {
|
|
691
619
|
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
|
692
620
|
var entry = this.tryEntries[i];
|
|
693
|
-
|
|
694
621
|
if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) {
|
|
695
622
|
var finallyEntry = entry;
|
|
696
623
|
break;
|
|
697
624
|
}
|
|
698
625
|
}
|
|
699
|
-
|
|
700
626
|
if (finallyEntry && (type === "break" || type === "continue") && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc) {
|
|
701
627
|
// Ignore the finally entry if control is not jumping to a
|
|
702
628
|
// location outside the try/catch block.
|
|
703
629
|
finallyEntry = null;
|
|
704
630
|
}
|
|
705
|
-
|
|
706
631
|
var record = finallyEntry ? finallyEntry.completion : {};
|
|
707
632
|
record.type = type;
|
|
708
633
|
record.arg = arg;
|
|
709
|
-
|
|
710
634
|
if (finallyEntry) {
|
|
711
635
|
this.method = "next";
|
|
712
636
|
this.next = finallyEntry.finallyLoc;
|
|
713
637
|
return ContinueSentinel;
|
|
714
638
|
}
|
|
715
|
-
|
|
716
639
|
return this.complete(record);
|
|
717
640
|
},
|
|
718
641
|
complete: function complete(record, afterLoc) {
|
|
719
642
|
if (record.type === "throw") {
|
|
720
643
|
throw record.arg;
|
|
721
644
|
}
|
|
722
|
-
|
|
723
645
|
if (record.type === "break" || record.type === "continue") {
|
|
724
646
|
this.next = record.arg;
|
|
725
647
|
} else if (record.type === "return") {
|
|
@@ -729,13 +651,11 @@ var runtime_1 = /*#__PURE__*/createCommonjsModule(function (module) {
|
|
|
729
651
|
} else if (record.type === "normal" && afterLoc) {
|
|
730
652
|
this.next = afterLoc;
|
|
731
653
|
}
|
|
732
|
-
|
|
733
654
|
return ContinueSentinel;
|
|
734
655
|
},
|
|
735
656
|
finish: function finish(finallyLoc) {
|
|
736
657
|
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
|
737
658
|
var entry = this.tryEntries[i];
|
|
738
|
-
|
|
739
659
|
if (entry.finallyLoc === finallyLoc) {
|
|
740
660
|
this.complete(entry.completion, entry.afterLoc);
|
|
741
661
|
resetTryEntry(entry);
|
|
@@ -746,21 +666,18 @@ var runtime_1 = /*#__PURE__*/createCommonjsModule(function (module) {
|
|
|
746
666
|
"catch": function _catch(tryLoc) {
|
|
747
667
|
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
|
748
668
|
var entry = this.tryEntries[i];
|
|
749
|
-
|
|
750
669
|
if (entry.tryLoc === tryLoc) {
|
|
751
670
|
var record = entry.completion;
|
|
752
|
-
|
|
753
671
|
if (record.type === "throw") {
|
|
754
672
|
var thrown = record.arg;
|
|
755
673
|
resetTryEntry(entry);
|
|
756
674
|
}
|
|
757
|
-
|
|
758
675
|
return thrown;
|
|
759
676
|
}
|
|
760
|
-
}
|
|
761
|
-
// argument that corresponds to a known catch block.
|
|
762
|
-
|
|
677
|
+
}
|
|
763
678
|
|
|
679
|
+
// The context.catch method must only be called with a location
|
|
680
|
+
// argument that corresponds to a known catch block.
|
|
764
681
|
throw new Error("illegal catch attempt");
|
|
765
682
|
},
|
|
766
683
|
delegateYield: function delegateYield(iterable, resultName, nextLoc) {
|
|
@@ -769,27 +686,26 @@ var runtime_1 = /*#__PURE__*/createCommonjsModule(function (module) {
|
|
|
769
686
|
resultName: resultName,
|
|
770
687
|
nextLoc: nextLoc
|
|
771
688
|
};
|
|
772
|
-
|
|
773
689
|
if (this.method === "next") {
|
|
774
690
|
// Deliberately forget the last sent value so that we don't
|
|
775
691
|
// accidentally pass it on to the delegate.
|
|
776
692
|
this.arg = undefined$1;
|
|
777
693
|
}
|
|
778
|
-
|
|
779
694
|
return ContinueSentinel;
|
|
780
695
|
}
|
|
781
|
-
};
|
|
696
|
+
};
|
|
697
|
+
|
|
698
|
+
// Regardless of whether this script is executing as a CommonJS module
|
|
782
699
|
// or not, return the runtime object so that we can declare the variable
|
|
783
700
|
// regeneratorRuntime in the outer scope, which allows this module to be
|
|
784
701
|
// injected easily by `bin/regenerator --include-runtime script.js`.
|
|
785
|
-
|
|
786
702
|
return exports;
|
|
787
|
-
}(
|
|
703
|
+
}(
|
|
704
|
+
// If this script is executing as a CommonJS module, use module.exports
|
|
788
705
|
// as the regeneratorRuntime namespace. Otherwise create a new empty
|
|
789
706
|
// object. Either way, the resulting object will be used to initialize
|
|
790
707
|
// the regeneratorRuntime variable at the top of this file.
|
|
791
708
|
module.exports );
|
|
792
|
-
|
|
793
709
|
try {
|
|
794
710
|
regeneratorRuntime = runtime;
|
|
795
711
|
} catch (accidentalStrictMode) {
|
|
@@ -812,19 +728,16 @@ var runtime_1 = /*#__PURE__*/createCommonjsModule(function (module) {
|
|
|
812
728
|
});
|
|
813
729
|
|
|
814
730
|
var secretRequire;
|
|
815
|
-
|
|
816
731
|
try {
|
|
817
732
|
// Secretly use require without webpack knowing
|
|
818
733
|
secretRequire = /*#__PURE__*/eval('require');
|
|
819
734
|
} catch (err) {
|
|
820
735
|
secretRequire = undefined;
|
|
821
736
|
}
|
|
822
|
-
|
|
823
737
|
function serverRequire(module) {
|
|
824
738
|
if (!secretRequire) {
|
|
825
739
|
throw new Error("Unexpected serverRequire() -- can only do this from a Node server!");
|
|
826
740
|
}
|
|
827
|
-
|
|
828
741
|
return secretRequire(module);
|
|
829
742
|
}
|
|
830
743
|
function serverRequireFs() {
|
|
@@ -836,9 +749,7 @@ var FileCache = /*#__PURE__*/function () {
|
|
|
836
749
|
this.filePath = filePath;
|
|
837
750
|
console.log('USING cache', this.filePath);
|
|
838
751
|
}
|
|
839
|
-
|
|
840
752
|
var _proto = FileCache.prototype;
|
|
841
|
-
|
|
842
753
|
_proto.get = /*#__PURE__*/function () {
|
|
843
754
|
var _get = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee() {
|
|
844
755
|
var fs, data;
|
|
@@ -852,20 +763,16 @@ var FileCache = /*#__PURE__*/function () {
|
|
|
852
763
|
return fs.promises.mkdir(path.dirname(this.filePath), {
|
|
853
764
|
recursive: true
|
|
854
765
|
});
|
|
855
|
-
|
|
856
766
|
case 4:
|
|
857
767
|
_context.next = 6;
|
|
858
768
|
return fs.promises.readFile(this.filePath);
|
|
859
|
-
|
|
860
769
|
case 6:
|
|
861
770
|
data = _context.sent.toString();
|
|
862
771
|
return _context.abrupt("return", JSON.parse(data));
|
|
863
|
-
|
|
864
772
|
case 10:
|
|
865
773
|
_context.prev = 10;
|
|
866
774
|
_context.t0 = _context["catch"](1);
|
|
867
775
|
return _context.abrupt("return", undefined);
|
|
868
|
-
|
|
869
776
|
case 13:
|
|
870
777
|
case "end":
|
|
871
778
|
return _context.stop();
|
|
@@ -873,14 +780,11 @@ var FileCache = /*#__PURE__*/function () {
|
|
|
873
780
|
}
|
|
874
781
|
}, _callee, this, [[1, 10]]);
|
|
875
782
|
}));
|
|
876
|
-
|
|
877
783
|
function get() {
|
|
878
784
|
return _get.apply(this, arguments);
|
|
879
785
|
}
|
|
880
|
-
|
|
881
786
|
return get;
|
|
882
787
|
}();
|
|
883
|
-
|
|
884
788
|
_proto.set = /*#__PURE__*/function () {
|
|
885
789
|
var _set = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee2(data) {
|
|
886
790
|
var fs;
|
|
@@ -892,16 +796,13 @@ var FileCache = /*#__PURE__*/function () {
|
|
|
892
796
|
_context2.prev = 1;
|
|
893
797
|
_context2.next = 4;
|
|
894
798
|
return fs.promises.writeFile(this.filePath, JSON.stringify(data));
|
|
895
|
-
|
|
896
799
|
case 4:
|
|
897
800
|
_context2.next = 9;
|
|
898
801
|
break;
|
|
899
|
-
|
|
900
802
|
case 6:
|
|
901
803
|
_context2.prev = 6;
|
|
902
804
|
_context2.t0 = _context2["catch"](1);
|
|
903
805
|
console.warn("Error writing to Plasmic cache: " + _context2.t0);
|
|
904
|
-
|
|
905
806
|
case 9:
|
|
906
807
|
case "end":
|
|
907
808
|
return _context2.stop();
|
|
@@ -909,29 +810,23 @@ var FileCache = /*#__PURE__*/function () {
|
|
|
909
810
|
}
|
|
910
811
|
}, _callee2, this, [[1, 6]]);
|
|
911
812
|
}));
|
|
912
|
-
|
|
913
813
|
function set(_x) {
|
|
914
814
|
return _set.apply(this, arguments);
|
|
915
815
|
}
|
|
916
|
-
|
|
917
816
|
return set;
|
|
918
817
|
}();
|
|
919
|
-
|
|
920
818
|
_proto.clear = function clear() {
|
|
921
819
|
var fs = serverRequireFs();
|
|
922
|
-
|
|
923
820
|
try {
|
|
924
821
|
fs.unlinkSync(this.filePath);
|
|
925
822
|
} catch (err) {}
|
|
926
823
|
};
|
|
927
|
-
|
|
928
824
|
return FileCache;
|
|
929
825
|
}();
|
|
930
826
|
function makeCache(opts) {
|
|
931
827
|
var cacheDir = path.resolve(process.cwd(), '.next', '.plasmic');
|
|
932
828
|
var cachePath = path.join(cacheDir, "plasmic-" + [].concat(opts.projects.map(function (p) {
|
|
933
829
|
var _p$version;
|
|
934
|
-
|
|
935
830
|
return p.id + "@" + ((_p$version = p.version) != null ? _p$version : '');
|
|
936
831
|
})).sort().join('-') + (opts.preview ? '-preview' : '') + "-cache.json");
|
|
937
832
|
return new FileCache(cachePath);
|
|
@@ -939,13 +834,10 @@ function makeCache(opts) {
|
|
|
939
834
|
|
|
940
835
|
var NextJsPlasmicComponentLoader = /*#__PURE__*/function (_PlasmicComponentLoad) {
|
|
941
836
|
_inheritsLoose(NextJsPlasmicComponentLoader, _PlasmicComponentLoad);
|
|
942
|
-
|
|
943
837
|
function NextJsPlasmicComponentLoader(internal) {
|
|
944
838
|
return _PlasmicComponentLoad.call(this, internal) || this;
|
|
945
839
|
}
|
|
946
|
-
|
|
947
840
|
var _proto = NextJsPlasmicComponentLoader.prototype;
|
|
948
|
-
|
|
949
841
|
_proto.getActiveVariation = /*#__PURE__*/function () {
|
|
950
842
|
var _getActiveVariation = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee(opts) {
|
|
951
843
|
var extractBuiltinTraits;
|
|
@@ -955,43 +847,36 @@ var NextJsPlasmicComponentLoader = /*#__PURE__*/function (_PlasmicComponentLoad)
|
|
|
955
847
|
case 0:
|
|
956
848
|
extractBuiltinTraits = function extractBuiltinTraits() {
|
|
957
849
|
var _opts$req$url, _opts$req, _opts$req$headers$hos, _opts$req2;
|
|
958
|
-
|
|
959
850
|
var url = new URL((_opts$req$url = (_opts$req = opts.req) == null ? void 0 : _opts$req.url) != null ? _opts$req$url : '/', "https://" + ((_opts$req$headers$hos = (_opts$req2 = opts.req) == null ? void 0 : _opts$req2.headers.host) != null ? _opts$req$headers$hos : 'server.side'));
|
|
960
851
|
return {
|
|
961
852
|
pageUrl: url.href
|
|
962
853
|
};
|
|
963
854
|
};
|
|
964
|
-
|
|
965
855
|
return _context.abrupt("return", this._getActiveVariation({
|
|
966
856
|
traits: _extends({}, extractBuiltinTraits(), opts.traits),
|
|
967
857
|
getKnownValue: function getKnownValue(key) {
|
|
968
858
|
if (opts.known) {
|
|
969
859
|
return opts.known[key];
|
|
970
860
|
} else {
|
|
971
|
-
var _opts$req$cookies
|
|
972
|
-
|
|
973
|
-
return (_opts$req$cookies$ = (_opts$req3 = opts.req) == null ? void 0 : _opts$req3.cookies["plasmic:" + key]) != null ? _opts$req$cookies$ : undefined;
|
|
861
|
+
var _opts$req$cookies, _opts$req3;
|
|
862
|
+
return (_opts$req$cookies = (_opts$req3 = opts.req) == null ? void 0 : _opts$req3.cookies["plasmic:" + key]) != null ? _opts$req$cookies : undefined;
|
|
974
863
|
}
|
|
975
864
|
},
|
|
976
865
|
updateKnownValue: function updateKnownValue(key, value) {
|
|
977
866
|
if (opts.res) {
|
|
978
867
|
var _opts$res$getHeader, _opts$res, _opts$res2;
|
|
979
|
-
|
|
980
868
|
var cookie = "plasmic:" + key + "=" + value;
|
|
981
869
|
var resCookie = (_opts$res$getHeader = (_opts$res = opts.res) == null ? void 0 : _opts$res.getHeader('Set-Cookie')) != null ? _opts$res$getHeader : [];
|
|
982
870
|
var newCookies = [];
|
|
983
|
-
|
|
984
871
|
if (Array.isArray(resCookie)) {
|
|
985
872
|
newCookies = [].concat(resCookie, ["plasmic:" + key + "=" + value]);
|
|
986
873
|
} else {
|
|
987
874
|
newCookies = ["" + resCookie, cookie];
|
|
988
875
|
}
|
|
989
|
-
|
|
990
876
|
(_opts$res2 = opts.res) == null ? void 0 : _opts$res2.setHeader('Set-Cookie', newCookies);
|
|
991
877
|
}
|
|
992
878
|
}
|
|
993
879
|
}));
|
|
994
|
-
|
|
995
880
|
case 2:
|
|
996
881
|
case "end":
|
|
997
882
|
return _context.stop();
|
|
@@ -999,22 +884,17 @@ var NextJsPlasmicComponentLoader = /*#__PURE__*/function (_PlasmicComponentLoad)
|
|
|
999
884
|
}
|
|
1000
885
|
}, _callee, this);
|
|
1001
886
|
}));
|
|
1002
|
-
|
|
1003
887
|
function getActiveVariation(_x) {
|
|
1004
888
|
return _getActiveVariation.apply(this, arguments);
|
|
1005
889
|
}
|
|
1006
|
-
|
|
1007
890
|
return getActiveVariation;
|
|
1008
891
|
}();
|
|
1009
|
-
|
|
1010
892
|
return NextJsPlasmicComponentLoader;
|
|
1011
893
|
}(loaderReact.PlasmicComponentLoader);
|
|
1012
|
-
|
|
1013
894
|
var initPlasmicLoaderNext = function initPlasmicLoaderNext(opts) {
|
|
1014
895
|
var internal = new loaderReact.InternalPlasmicComponentLoader(opts);
|
|
1015
896
|
return new NextJsPlasmicComponentLoader(internal);
|
|
1016
897
|
};
|
|
1017
|
-
|
|
1018
898
|
function initPlasmicLoader(opts) {
|
|
1019
899
|
var isBrowser = typeof window !== 'undefined';
|
|
1020
900
|
var isProd = "development" === 'production';
|
|
@@ -1034,34 +914,28 @@ function initPlasmicLoader(opts) {
|
|
|
1034
914
|
'next/link': NextLink,
|
|
1035
915
|
'next/router': NextRouter
|
|
1036
916
|
});
|
|
1037
|
-
|
|
1038
917
|
{
|
|
1039
918
|
var stringOpts = JSON.stringify(opts);
|
|
1040
|
-
|
|
1041
919
|
if (process.env.PLASMIC_OPTS && process.env.PLASMIC_OPTS !== stringOpts) {
|
|
1042
920
|
console.warn("PLASMIC: We detected that you created a new PlasmicLoader with different configurations. You may need to restart your dev server.\n");
|
|
1043
921
|
}
|
|
1044
|
-
|
|
1045
922
|
process.env.PLASMIC_OPTS = stringOpts;
|
|
1046
923
|
}
|
|
1047
|
-
|
|
1048
924
|
if (cache) {
|
|
1049
925
|
{
|
|
1050
926
|
if (process.env.PLASMIC_WATCHED !== 'true') {
|
|
1051
927
|
process.env.PLASMIC_WATCHED = 'true';
|
|
1052
|
-
console.log("Subscribing to Plasmic changes...");
|
|
1053
|
-
|
|
928
|
+
console.log("Subscribing to Plasmic changes...");
|
|
929
|
+
// Import using serverRequire, so webpack doesn't bundle us into client bundle
|
|
1054
930
|
var PlasmicRemoteChangeWatcher = serverRequire('@plasmicapp/watcher').PlasmicRemoteChangeWatcher;
|
|
1055
931
|
var watcher = new PlasmicRemoteChangeWatcher({
|
|
1056
932
|
projects: opts.projects,
|
|
1057
933
|
host: opts.host
|
|
1058
934
|
});
|
|
1059
|
-
|
|
1060
935
|
var clearCache = function clearCache() {
|
|
1061
936
|
cache.clear();
|
|
1062
937
|
loader.clearCache();
|
|
1063
938
|
};
|
|
1064
|
-
|
|
1065
939
|
watcher.subscribe({
|
|
1066
940
|
onUpdate: function onUpdate() {
|
|
1067
941
|
if (opts.preview) {
|
|
@@ -1077,7 +951,6 @@ function initPlasmicLoader(opts) {
|
|
|
1077
951
|
}
|
|
1078
952
|
}
|
|
1079
953
|
}
|
|
1080
|
-
|
|
1081
954
|
return loader;
|
|
1082
955
|
}
|
|
1083
956
|
function PlasmicRootProvider(props) {
|