@nyuccl/smile 0.2.0-beta.37 → 0.2.0-beta.38
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/module.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script setup>
|
|
2
|
-
import { ArrowLeft, ArrowRight,
|
|
2
|
+
import { ArrowLeft, ArrowRight, Info, Copy, Check, Dices } from "lucide-vue-next";
|
|
3
3
|
import { ref, computed } from "vue";
|
|
4
4
|
import useViewAPI from "../../composables/useViewAPI";
|
|
5
5
|
import useSmileStore from "../../stores/smilestore";
|
|
@@ -12,6 +12,7 @@ const baseUrl = computed(() => {
|
|
|
12
12
|
if (import.meta.client) return window.location.origin;
|
|
13
13
|
return "https://your-app.vercel.app";
|
|
14
14
|
});
|
|
15
|
+
const isDeployed = computed(() => !!config.deployURL);
|
|
15
16
|
const devUrls = computed(() => {
|
|
16
17
|
const urls = {};
|
|
17
18
|
for (const [key, value] of Object.entries(api.urls)) {
|
|
@@ -187,13 +188,6 @@ const services = {
|
|
|
187
188
|
}
|
|
188
189
|
};
|
|
189
190
|
const currentService = computed(() => services[selectedService.value]);
|
|
190
|
-
const fullUrls = computed(() => {
|
|
191
|
-
const result = {};
|
|
192
|
-
for (const [key, path] of Object.entries(api.urls)) {
|
|
193
|
-
result[key] = `${baseUrl.value}${path}`;
|
|
194
|
-
}
|
|
195
|
-
return result;
|
|
196
|
-
});
|
|
197
191
|
</script>
|
|
198
192
|
|
|
199
193
|
<template>
|
|
@@ -236,89 +230,56 @@ const fullUrls = computed(() => {
|
|
|
236
230
|
</div>
|
|
237
231
|
|
|
238
232
|
<!-- Study URL -->
|
|
239
|
-
<
|
|
240
|
-
<
|
|
241
|
-
<
|
|
233
|
+
<div :class="['mb-6 p-4 rounded-md border', isDeployed ? 'bg-muted/50' : 'bg-destructive/5 border-destructive/30']">
|
|
234
|
+
<div class="flex items-center gap-2 mb-1">
|
|
235
|
+
<h3 class="font-semibold">
|
|
242
236
|
Study URL
|
|
243
|
-
</
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
<CardTitle class="text-sm">
|
|
277
|
-
Test URL (with example params)
|
|
278
|
-
</CardTitle>
|
|
279
|
-
</CardHeader>
|
|
280
|
-
<CardContent>
|
|
281
|
-
<div class="flex items-center gap-2">
|
|
282
|
-
<code class="flex-1 text-xs bg-muted px-3 py-2 rounded break-all select-all">
|
|
283
|
-
{{ fullUrls[selectedService] }}
|
|
284
|
-
</code>
|
|
285
|
-
<Button
|
|
286
|
-
variant="outline"
|
|
287
|
-
size="xs"
|
|
288
|
-
@click="copyToClipboard(fullUrls[selectedService], `test-${selectedService}`)"
|
|
289
|
-
>
|
|
290
|
-
<Check
|
|
291
|
-
v-if="copied === `test-${selectedService}`"
|
|
292
|
-
class="size-3"
|
|
293
|
-
/>
|
|
294
|
-
<Copy
|
|
295
|
-
v-else
|
|
296
|
-
class="size-3"
|
|
297
|
-
/>
|
|
298
|
-
{{ copied === `test-${selectedService}` ? 'Copied!' : 'Copy' }}
|
|
299
|
-
</Button>
|
|
300
|
-
</div>
|
|
301
|
-
</CardContent>
|
|
302
|
-
</Card>
|
|
237
|
+
</h3>
|
|
238
|
+
</div>
|
|
239
|
+
<template v-if="!isDeployed">
|
|
240
|
+
<p class="text-sm font-medium text-destructive mb-2">
|
|
241
|
+
This is a local development URL and cannot be shared with participants. Deploy your study and navigate to /dev to get a shareable recruitment URL.
|
|
242
|
+
</p>
|
|
243
|
+
</template>
|
|
244
|
+
<p
|
|
245
|
+
class="text-sm text-muted-foreground mb-2"
|
|
246
|
+
v-html="currentService.urlNote"
|
|
247
|
+
/>
|
|
248
|
+
<div class="flex items-center gap-2">
|
|
249
|
+
<code :class="['flex-1 text-sm px-3 py-2 rounded break-all', isDeployed ? 'bg-muted select-all' : 'bg-muted/50 select-none text-muted-foreground line-through']">
|
|
250
|
+
{{ currentService.studyUrl.value }}
|
|
251
|
+
</code>
|
|
252
|
+
<Button
|
|
253
|
+
v-if="isDeployed"
|
|
254
|
+
variant="outline"
|
|
255
|
+
size="sm"
|
|
256
|
+
@click="copyToClipboard(currentService.studyUrl.value, `study-${selectedService}`)"
|
|
257
|
+
>
|
|
258
|
+
<Check
|
|
259
|
+
v-if="copied === `study-${selectedService}`"
|
|
260
|
+
class="size-3.5"
|
|
261
|
+
/>
|
|
262
|
+
<Copy
|
|
263
|
+
v-else
|
|
264
|
+
class="size-3.5"
|
|
265
|
+
/>
|
|
266
|
+
{{ copied === `study-${selectedService}` ? 'Copied!' : 'Copy' }}
|
|
267
|
+
</Button>
|
|
268
|
+
</div>
|
|
269
|
+
</div>
|
|
303
270
|
|
|
304
271
|
<!-- Setup Instructions -->
|
|
305
|
-
<
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
class="leading-relaxed"
|
|
317
|
-
v-html="step"
|
|
318
|
-
/>
|
|
319
|
-
</ol>
|
|
320
|
-
</CardContent>
|
|
321
|
-
</Card>
|
|
272
|
+
<h3 class="font-semibold mb-3">
|
|
273
|
+
Setup Instructions
|
|
274
|
+
</h3>
|
|
275
|
+
<ol class="list-decimal list-outside ml-5 space-y-3 text-base text-muted-foreground">
|
|
276
|
+
<li
|
|
277
|
+
v-for="(step, i) in currentService.setupSteps"
|
|
278
|
+
:key="i"
|
|
279
|
+
class="leading-relaxed"
|
|
280
|
+
v-html="step"
|
|
281
|
+
/>
|
|
282
|
+
</ol>
|
|
322
283
|
</template>
|
|
323
284
|
|
|
324
285
|
<!-- Card grid view -->
|
|
@@ -331,17 +292,22 @@ const fullUrls = computed(() => {
|
|
|
331
292
|
alt="SMILE"
|
|
332
293
|
class="w-52"
|
|
333
294
|
>
|
|
334
|
-
<
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
<img
|
|
340
|
-
:src="`/api/qr?url=${encodeURIComponent(baseUrl)}`"
|
|
341
|
-
alt="QR Code"
|
|
342
|
-
class="w-24 h-24"
|
|
295
|
+
<template v-if="isDeployed">
|
|
296
|
+
<a
|
|
297
|
+
:href="`/api/qr?url=${encodeURIComponent(baseUrl)}`"
|
|
298
|
+
download="qr.svg"
|
|
299
|
+
title="Download QR code"
|
|
343
300
|
>
|
|
344
|
-
|
|
301
|
+
<img
|
|
302
|
+
:src="`/api/qr?url=${encodeURIComponent(baseUrl)}`"
|
|
303
|
+
alt="QR Code"
|
|
304
|
+
class="w-24 h-24"
|
|
305
|
+
>
|
|
306
|
+
</a>
|
|
307
|
+
<p class="text-xs text-muted-foreground text-right">
|
|
308
|
+
Share this QR code with participants. Click to download.
|
|
309
|
+
</p>
|
|
310
|
+
</template>
|
|
345
311
|
</div>
|
|
346
312
|
|
|
347
313
|
<!-- Right column: text + details -->
|
|
@@ -472,7 +438,7 @@ const fullUrls = computed(() => {
|
|
|
472
438
|
</dl>
|
|
473
439
|
|
|
474
440
|
<!-- Mode URLs -->
|
|
475
|
-
<div class="flex flex-col gap-1 mt-2 pt-2 border-t text-xs">
|
|
441
|
+
<div :class="['flex flex-col gap-1 mt-2 pt-2 border-t text-xs', { 'opacity-50': !isDeployed }]">
|
|
476
442
|
<div
|
|
477
443
|
v-for="{ label, suffix, key } in [
|
|
478
444
|
{ label: 'Dev', suffix: '/dev/', key: 'dev' },
|
|
@@ -485,8 +451,9 @@ const fullUrls = computed(() => {
|
|
|
485
451
|
<span class="text-muted-foreground/60 w-20">{{ label }}:</span>
|
|
486
452
|
<code class="bg-muted px-1.5 py-0.5 rounded">{{ baseUrl }}{{ suffix }}</code>
|
|
487
453
|
<button
|
|
488
|
-
|
|
489
|
-
|
|
454
|
+
:disabled="!isDeployed"
|
|
455
|
+
:class="['transition-colors', isDeployed ? 'text-muted-foreground hover:text-foreground' : 'text-muted-foreground/30 cursor-not-allowed']"
|
|
456
|
+
@click="isDeployed && copyToClipboard(`${baseUrl}${suffix}`, key)"
|
|
490
457
|
>
|
|
491
458
|
<Check
|
|
492
459
|
v-if="copied === key"
|
|
@@ -499,6 +466,12 @@ const fullUrls = computed(() => {
|
|
|
499
466
|
</button>
|
|
500
467
|
</div>
|
|
501
468
|
</div>
|
|
469
|
+
<p
|
|
470
|
+
v-if="!isDeployed"
|
|
471
|
+
class="text-xs italic mt-1"
|
|
472
|
+
>
|
|
473
|
+
Deploy your study to get shareable URLs.
|
|
474
|
+
</p>
|
|
502
475
|
</div>
|
|
503
476
|
</div>
|
|
504
477
|
</div>
|
|
@@ -521,7 +494,7 @@ const fullUrls = computed(() => {
|
|
|
521
494
|
class="shrink-0 text-muted-foreground hover:text-foreground hover:bg-accent transition-all p-1 rounded"
|
|
522
495
|
@click="selectedService = key"
|
|
523
496
|
>
|
|
524
|
-
<
|
|
497
|
+
<Info class="size-3.5" />
|
|
525
498
|
</button>
|
|
526
499
|
</TooltipTrigger>
|
|
527
500
|
<TooltipContent>
|