@nyuccl/smile 0.2.0-beta.26 → 0.2.0-beta.31

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.
Files changed (74) hide show
  1. package/dist/module.json +1 -1
  2. package/dist/module.mjs +28 -7
  3. package/dist/runtime/components/builtins/AdvertisementView.d.vue.ts +13 -1
  4. package/dist/runtime/components/builtins/AdvertisementView.vue +6 -3
  5. package/dist/runtime/components/builtins/AdvertisementView.vue.d.ts +13 -1
  6. package/dist/runtime/components/builtins/LocalDevBanner.vue +16 -0
  7. package/dist/runtime/components/builtins/PresentationModeView.d.vue.ts +1 -1
  8. package/dist/runtime/components/builtins/PresentationModeView.vue +8 -8
  9. package/dist/runtime/components/builtins/PresentationModeView.vue.d.ts +1 -1
  10. package/dist/runtime/components/builtins/StatusBar.vue +1 -1
  11. package/dist/runtime/components/builtins/StudyPreviewText.vue +2 -2
  12. package/dist/runtime/components/dev/RecruitmentChooserView.vue +536 -220
  13. package/dist/runtime/components/dev/SmileDevPresentationView.vue +82 -0
  14. package/dist/runtime/components/dev/console/ConfigList.vue +6 -6
  15. package/dist/runtime/components/dev/console/ConsoleConfigPanel.vue +9 -6
  16. package/dist/runtime/components/dev/console/ConsoleDatabaseBrowsePanel.vue +4 -4
  17. package/dist/runtime/components/dev/console/ConsoleLogPanel.vue +60 -18
  18. package/dist/runtime/components/dev/console/DatabaseList.vue +6 -6
  19. package/dist/runtime/components/dev/console/SmileDevConsole.vue +2 -2
  20. package/dist/runtime/components/dev/devicePresets.d.ts +4 -4
  21. package/dist/runtime/components/dev/devicePresets.js +4 -4
  22. package/dist/runtime/components/dev/menu/SmileDevAppMenu.vue +19 -19
  23. package/dist/runtime/components/dev/navbar/PanelButtonGroup.d.vue.ts +3 -0
  24. package/dist/runtime/components/dev/navbar/PanelButtonGroup.vue +79 -0
  25. package/dist/runtime/components/dev/navbar/PanelButtonGroup.vue.d.ts +3 -0
  26. package/dist/runtime/components/dev/navbar/RouteJumper.vue +1 -1
  27. package/dist/runtime/components/dev/navbar/SmileDevNavBar.vue +13 -23
  28. package/dist/runtime/components/dev/presentation/PresentationModeResetButton.vue +9 -2
  29. package/dist/runtime/components/dev/presentation/PresentationNavBar.d.vue.ts +13 -1
  30. package/dist/runtime/components/dev/presentation/PresentationNavBar.vue +8 -2
  31. package/dist/runtime/components/dev/presentation/PresentationNavBar.vue.d.ts +13 -1
  32. package/dist/runtime/components/dev/sidebar/AppProgressPanel.vue +1 -1
  33. package/dist/runtime/components/dev/sidebar/ConfigurationVariablesPanel.vue +4 -4
  34. package/dist/runtime/components/dev/sidebar/RandomizationSidebarPanel.vue +3 -3
  35. package/dist/runtime/components/dev/sidebar/SmileDevSideBar.vue +11 -5
  36. package/dist/runtime/components/dev/sidebar/StepExplorerPanel.vue +1 -1
  37. package/dist/runtime/components/dev/sidebar/StudyInfoPanel.vue +2 -2
  38. package/dist/runtime/components/ui/button/index.d.ts +1 -1
  39. package/dist/runtime/components/ui/dropdown-menu/DropdownMenuSubContent.d.vue.ts +2 -2
  40. package/dist/runtime/components/ui/dropdown-menu/DropdownMenuSubContent.vue.d.ts +2 -2
  41. package/dist/runtime/components/ui/popover/PopoverContent.d.vue.ts +2 -2
  42. package/dist/runtime/components/ui/popover/PopoverContent.vue.d.ts +2 -2
  43. package/dist/runtime/components/ui/sheet/SheetContent.d.vue.ts +2 -2
  44. package/dist/runtime/components/ui/sheet/SheetContent.vue.d.ts +2 -2
  45. package/dist/runtime/composables/useAPI.d.ts +2 -2
  46. package/dist/runtime/composables/useAPI.js +2 -2
  47. package/dist/runtime/core/config.d.ts +2 -0
  48. package/dist/runtime/core/config.js +2 -0
  49. package/dist/runtime/css/main.css +1 -1
  50. package/dist/runtime/css/smile.css +1 -1
  51. package/dist/runtime/layouts/development.vue +11 -76
  52. package/dist/runtime/layouts/experiment.d.vue.ts +2 -2
  53. package/dist/runtime/layouts/experiment.vue +1 -0
  54. package/dist/runtime/layouts/experiment.vue.d.ts +2 -2
  55. package/dist/runtime/layouts/presentation.vue +2 -0
  56. package/dist/runtime/middleware/timeline.global.js +1 -1
  57. package/dist/runtime/pages/dev-login.vue +4 -2
  58. package/dist/runtime/plugins/dev-sync.client.js +0 -2
  59. package/dist/runtime/plugins/store-sync.client.js +8 -10
  60. package/dist/runtime/public/images/helpus.png +0 -0
  61. package/dist/runtime/public/images/smile.svg +78 -0
  62. package/dist/runtime/public/images/universitylogo.png +0 -0
  63. package/dist/runtime/server/api/auth/login.post.js +11 -2
  64. package/dist/runtime/server/middleware/dev-auth.js +10 -5
  65. package/dist/runtime/stores/log.js +4 -7
  66. package/dist/runtime/stores/smilestore.d.ts +161 -0
  67. package/dist/runtime/stores/smilestore.js +39 -7
  68. package/package.json +5 -3
  69. package/dist/runtime/components/dev/navbar/ViewButton.vue +0 -160
  70. package/dist/runtime/pages/info.vue +0 -463
  71. /package/dist/runtime/components/{dev/navbar/ViewButton.d.vue.ts → builtins/LocalDevBanner.d.vue.ts} +0 -0
  72. /package/dist/runtime/components/{dev/navbar/ViewButton.vue.d.ts → builtins/LocalDevBanner.vue.d.ts} +0 -0
  73. /package/dist/runtime/{pages/info.d.vue.ts → components/dev/SmileDevPresentationView.d.vue.ts} +0 -0
  74. /package/dist/runtime/{pages/info.vue.d.ts → components/dev/SmileDevPresentationView.vue.d.ts} +0 -0
package/dist/module.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@nyuccl/smile",
3
3
  "configKey": "smile",
4
- "version": "0.2.0-beta.26",
4
+ "version": "0.2.0-beta.31",
5
5
  "builder": {
6
6
  "@nuxt/module-builder": "1.0.2",
7
7
  "unbuild": "3.6.1"
package/dist/module.mjs CHANGED
@@ -1,7 +1,8 @@
1
- import { defineNuxtModule, createResolver, addServerScanDir, addServerImportsDir, addPlugin, addRouteMiddleware, addLayout, extendPages, addComponentsDir, addImports } from '@nuxt/kit';
1
+ import { defineNuxtModule, createResolver, addServerScanDir, addServerImportsDir, addPlugin, addRouteMiddleware, addLayout, extendPages, addComponentsDir, addImports, useLogger } from '@nuxt/kit';
2
2
  import { fileURLToPath } from 'node:url';
3
3
  import { createRequire } from 'node:module';
4
- import { dirname } from 'node:path';
4
+ import { dirname, join } from 'node:path';
5
+ import { readFileSync } from 'node:fs';
5
6
  import tailwindcss from '@tailwindcss/vite';
6
7
 
7
8
  const module$1 = defineNuxtModule({
@@ -17,11 +18,18 @@ const module$1 = defineNuxtModule({
17
18
  const _require = createRequire(import.meta.url);
18
19
  _nuxt.options.ssr = false;
19
20
  _nuxt.options.build.transpile.push(runtimeDir);
21
+ _nuxt.options.nitro = _nuxt.options.nitro || {};
22
+ _nuxt.options.nitro.publicAssets = _nuxt.options.nitro.publicAssets || [];
23
+ _nuxt.options.nitro.publicAssets.push({
24
+ dir: resolver.resolve("./runtime/public"),
25
+ baseURL: "/_smile"
26
+ });
20
27
  addServerScanDir(resolver.resolve("./runtime/server"));
21
28
  addServerImportsDir(resolver.resolve("./runtime/server/utils"));
22
29
  _nuxt.options.runtimeConfig = _nuxt.options.runtimeConfig || {};
23
30
  _nuxt.options.runtimeConfig.smile = {
24
31
  devPassword: process.env.SMILE_DEV_PASSWORD || "",
32
+ publicPresentation: process.env.SMILE_PUBLIC_PRESENTATION === "true",
25
33
  tursoUrl: process.env.TURSO_DATABASE_URL || "",
26
34
  tursoAuthToken: process.env.TURSO_AUTH_TOKEN || ""
27
35
  };
@@ -94,11 +102,6 @@ const module$1 = defineNuxtModule({
94
102
  path: "/dev-login",
95
103
  file: resolver.resolve("./runtime/pages/dev-login.vue")
96
104
  });
97
- pages.push({
98
- name: "info",
99
- path: "/info",
100
- file: resolver.resolve("./runtime/pages/info.vue")
101
- });
102
105
  });
103
106
  addComponentsDir({ path: resolver.resolve("./runtime/components/ui"), pathPrefix: false, global: true, extensions: ["vue"] });
104
107
  addComponentsDir({ path: resolver.resolve("./runtime/components/forms"), pathPrefix: false, global: true, extensions: ["vue"] });
@@ -117,6 +120,24 @@ const module$1 = defineNuxtModule({
117
120
  { name: "default", as: "useSmileStore", from: resolver.resolve("./runtime/stores/smilestore") },
118
121
  { name: "default", as: "useLog", from: resolver.resolve("./runtime/stores/log") }
119
122
  ]);
123
+ if (_nuxt.options.dev) {
124
+ const logger = useLogger("smile");
125
+ _nuxt.hook("listen", async (_server, listener) => {
126
+ const { colors } = await import('consola/utils');
127
+ const pkg = JSON.parse(readFileSync(join(dirname(fileURLToPath(import.meta.url)), "../package.json"), "utf-8"));
128
+ const fmt = (url) => colors.cyan(colors.underline(url));
129
+ const urls = await listener.getURLs();
130
+ const local = urls.find((u) => u.type === "local");
131
+ if (local) {
132
+ const base = local.url.replace(/\/$/, "");
133
+ logger.info(``);
134
+ logger.info(` ${colors.bold(`SMILE ${pkg.version}`)}`);
135
+ logger.info(` Experiment: ${fmt(base)}`);
136
+ logger.info(` Dev: ${fmt(`${base}/dev/`)}`);
137
+ logger.info(` Presentation: ${fmt(`${base}/presentation/`)}`);
138
+ }
139
+ });
140
+ }
120
141
  }
121
142
  });
122
143
 
@@ -1,3 +1,15 @@
1
1
  declare const _default: typeof __VLS_export;
2
2
  export default _default;
3
- declare const __VLS_export: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
3
+ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
4
+ imageWidth: {
5
+ type: (NumberConstructor | StringConstructor)[];
6
+ default: number;
7
+ };
8
+ }>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
9
+ imageWidth: {
10
+ type: (NumberConstructor | StringConstructor)[];
11
+ default: number;
12
+ };
13
+ }>> & Readonly<{}>, {
14
+ imageWidth: string | number;
15
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
@@ -2,6 +2,9 @@
2
2
  import { onMounted, ref, onBeforeUnmount } from "vue";
3
3
  import { animate } from "motion";
4
4
  import useViewAPI from "../../composables/useViewAPI";
5
+ const props = defineProps({
6
+ imageWidth: { type: [String, Number], default: 320 }
7
+ });
5
8
  const api = useViewAPI();
6
9
  let timer;
7
10
  let clicked = false;
@@ -36,9 +39,9 @@ onBeforeUnmount(() => {
36
39
  >
37
40
  <img
38
41
  ref="logo"
39
- :src="'/brain.svg'"
40
- width="220"
41
- class="dark-aware-img"
42
+ :src="api.config.advertisementImageFn"
43
+ :width="props.imageWidth"
44
+ :class="{ 'dark-aware-img': api.config.advertisementImageInvertDark }"
42
45
  >
43
46
 
44
47
  <h1
@@ -1,3 +1,15 @@
1
1
  declare const _default: typeof __VLS_export;
2
2
  export default _default;
3
- declare const __VLS_export: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
3
+ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
4
+ imageWidth: {
5
+ type: (NumberConstructor | StringConstructor)[];
6
+ default: number;
7
+ };
8
+ }>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
9
+ imageWidth: {
10
+ type: (NumberConstructor | StringConstructor)[];
11
+ default: number;
12
+ };
13
+ }>> & Readonly<{}>, {
14
+ imageWidth: string | number;
15
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
@@ -0,0 +1,16 @@
1
+ <script setup>
2
+ const isDev = import.meta.dev;
3
+ </script>
4
+
5
+ <template>
6
+ <div
7
+ v-if="isDev"
8
+ class="local-dev-banner"
9
+ >
10
+ LOCAL DEV SERVER
11
+ </div>
12
+ </template>
13
+
14
+ <style scoped>
15
+ .local-dev-banner{background:repeating-linear-gradient(-45deg,#facc15,#facc15 10px,#f0c000 0,#f0c000 20px);color:#1a1a1a;flex-shrink:0;font-size:10px;font-weight:700;letter-spacing:.08em;padding:3px 0;text-align:center;width:100%}.dark .local-dev-banner{background:repeating-linear-gradient(-45deg,#555,#555 10px,#4a4a4a 0,#4a4a4a 20px);color:#ccc}
16
+ </style>
@@ -84,10 +84,10 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
84
84
  };
85
85
  }>> & Readonly<{}>, {
86
86
  title: string;
87
- description: string | unknown[];
88
87
  subtitle: string;
89
88
  siteAuthor: Record<string, any>;
90
89
  projectAuthors: unknown[];
91
90
  info: unknown[];
91
+ description: string | unknown[];
92
92
  sections: unknown[];
93
93
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
@@ -78,14 +78,14 @@ function goToSection(section) {
78
78
  </script>
79
79
 
80
80
  <template>
81
- <div class="min-h-screen bg-background">
81
+ <div class="min-h-full flex flex-col bg-background">
82
82
  <!-- Header Section -->
83
83
  <header class="bg-muted/50 border-b py-6">
84
84
  <div class="w-2/3 mx-auto px-6 py-8">
85
85
  <h1 class="text-5xl font-bold text-foreground mb-4 leading-tight">
86
86
  {{ title }}
87
87
  </h1>
88
- <p class="text-2xl text-muted-foreground leading-relaxed">
88
+ <p class="text-lg text-muted-foreground leading-relaxed">
89
89
  {{ subtitle }}
90
90
  </p>
91
91
  </div>
@@ -96,7 +96,7 @@ function goToSection(section) {
96
96
  <div class="w-2/3 mx-auto px-6 py-8">
97
97
  <div class="grid grid-cols-1 md:grid-cols-12 gap-8">
98
98
  <!-- Authors -->
99
- <div class="md:col-span-2">
99
+ <div class="md:col-span-3">
100
100
  <h3 class="text-[0.65rem] font-extralight uppercase tracking-widest text-muted-foreground mb-4">
101
101
  Authors
102
102
  </h3>
@@ -133,7 +133,7 @@ function goToSection(section) {
133
133
  </div>
134
134
 
135
135
  <!-- Affiliations -->
136
- <div class="md:col-span-3">
136
+ <div class="md:col-span-4">
137
137
  <h3 class="text-[0.65rem] font-extralight uppercase tracking-widest text-muted-foreground mb-4">
138
138
  Affiliations
139
139
  </h3>
@@ -184,13 +184,13 @@ function goToSection(section) {
184
184
  </section>
185
185
 
186
186
  <!-- Main Content -->
187
- <main class="w-2/3 mx-auto px-6 py-12">
187
+ <main class="w-2/3 mx-auto px-6 py-12 flex-1">
188
188
  <!-- Project Description -->
189
189
  <div class="prose prose-gray max-w-none mb-12">
190
190
  <p
191
191
  v-for="(paragraph, index) in descriptionParagraphs"
192
192
  :key="index"
193
- class="text-lg text-muted-foreground leading-relaxed mb-4"
193
+ class="text-md text-muted-foreground leading-relaxed mb-4"
194
194
  >
195
195
  {{ paragraph }}
196
196
  </p>
@@ -205,12 +205,12 @@ function goToSection(section) {
205
205
  :key="index"
206
206
  >
207
207
  <div>
208
- <h3 class="text-xl font-semibold text-foreground mb-3">
208
+ <h3 class="text-base font-semibold text-foreground mb-2">
209
209
  {{ section.title }}
210
210
  </h3>
211
211
  <p
212
212
  v-if="section.description"
213
- class="text-lg text-muted-foreground mb-4"
213
+ class="text-md text-muted-foreground mb-3"
214
214
  >
215
215
  {{ section.description }}
216
216
  </p>
@@ -84,10 +84,10 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
84
84
  };
85
85
  }>> & Readonly<{}>, {
86
86
  title: string;
87
- description: string | unknown[];
88
87
  subtitle: string;
89
88
  siteAuthor: Record<string, any>;
90
89
  projectAuthors: unknown[];
91
90
  info: unknown[];
91
+ description: string | unknown[];
92
92
  sections: unknown[];
93
93
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
@@ -51,7 +51,7 @@ function submitWithdraw() {
51
51
  >
52
52
  <img
53
53
  :src="api.getPublicUrl(api.config.brandLogoFn)"
54
- width="90"
54
+ width="120"
55
55
  class="dark-aware-img"
56
56
  >
57
57
  </a>
@@ -52,9 +52,9 @@ const _props = defineProps({
52
52
  <template #right>
53
53
  <!-- Lab logo (hidden on smaller screens) -->
54
54
  <img
55
- :src="'/brain.svg'"
55
+ :src="api.config.advertisementImageFn"
56
56
  width="220"
57
- class="mb-4 hidden @xl:block"
57
+ :class="['mb-4 hidden @xl:block', { 'dark-aware-img': api.config.advertisementImageInvertDark }]"
58
58
  >
59
59
 
60
60
  <!-- Lab information card -->