@vivix-labs/dashboard-projects 1.0.0-beta.2 → 1.0.0-beta.6

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.
@@ -1,3 +1,19 @@
1
+ /* packages/dashboard-projects/src/create-project-dialog.css */
2
+ .studio-home-create-form {
3
+ display: grid;
4
+ gap: var(--vx-space-16);
5
+ }
6
+ .studio-home-create-field {
7
+ display: grid;
8
+ gap: var(--vx-space-8);
9
+ color: var(--vx-text-secondary);
10
+ font: var(--vx-typography-inter-14-regular);
11
+ }
12
+ .studio-home-create-form p {
13
+ margin: 0;
14
+ color: var(--vx-text-secondary-readable);
15
+ }
16
+
1
17
  /* packages/dashboard-projects/src/card.css */
2
18
  .studio-home-panel {
3
19
  --home-panel-inset: 16px;
@@ -15,7 +31,7 @@
15
31
  }
16
32
  .studio-home-panel > header h2 {
17
33
  margin: 0;
18
- font-size: 16px;
34
+ font: var(--vx-typography-inter-16-semi-bold);
19
35
  }
20
36
  .studio-home-grid {
21
37
  display: grid;
@@ -23,11 +39,11 @@
23
39
  gap: 8px;
24
40
  padding: 0 var(--home-panel-inset) var(--home-panel-inset);
25
41
  }
26
- .studio-home-tile {
42
+ .studio-home-panel .studio-home-tile {
27
43
  display: grid;
28
44
  align-content: start;
29
45
  text-align: start;
30
- gap: 4px;
46
+ gap: var(--vx-space-8);
31
47
  min-width: 0;
32
48
  width: 100%;
33
49
  color: inherit;
@@ -37,6 +53,14 @@
37
53
  padding: 0;
38
54
  cursor: pointer;
39
55
  }
56
+ .studio-home-caption {
57
+ display: grid;
58
+ min-width: 0;
59
+ gap: var(--vx-space-4);
60
+ }
61
+ .studio-home-caption > strong {
62
+ font: var(--vx-typography-inter-14-semi-bold);
63
+ }
40
64
  .studio-home-tile:disabled {
41
65
  opacity: 0.5;
42
66
  cursor: default;
@@ -70,7 +94,7 @@
70
94
  height: 100%;
71
95
  object-fit: contain;
72
96
  }
73
- .studio-home-cover:has(img, video) {
97
+ .studio-home-cover:has(img, video):not([data-cover-state=loading]) {
74
98
  background: #151515;
75
99
  }
76
100
  .studio-home-create .studio-home-cover {
@@ -85,20 +109,6 @@
85
109
  border-radius: 4px;
86
110
  background: var(--vx-background-dialog);
87
111
  }
88
- .studio-home-create-form {
89
- display: grid;
90
- gap: var(--vx-space-16);
91
- }
92
- .studio-home-create-field {
93
- display: grid;
94
- gap: var(--vx-space-8);
95
- color: var(--vx-text-secondary);
96
- font: var(--vx-typography-inter-14-regular);
97
- }
98
- .studio-home-create-form p {
99
- margin: 0;
100
- color: var(--vx-text-secondary-readable);
101
- }
102
112
  .studio-home-view-all.vx-button {
103
113
  background: transparent;
104
114
  color: var(--vx-state-success);
@@ -1,5 +1,5 @@
1
1
  // packages/dashboard-projects/src/client.tsx
2
- import * as React from "react";
2
+ import * as React2 from "react";
3
3
  import { z } from "vivix-studio/sdk/shared";
4
4
 
5
5
  // packages/ui-system/dist/button.js
@@ -73,6 +73,8 @@ var iconGeometry = {
73
73
  height: 15.5625,
74
74
  slot: 18
75
75
  },
76
+ "select-items": { width: 13.8681, height: 13.8667, slot: 16 },
77
+ filter: { width: 13.2, height: 13.2, slot: 16 },
76
78
  select: {
77
79
  width: 14.6298,
78
80
  height: 16.065,
@@ -153,6 +155,9 @@ var iconGeometry = {
153
155
  height: 13.2,
154
156
  slot: 16
155
157
  },
158
+ favorite: { width: 11.8667, height: 14.5333, slot: 16 },
159
+ download: { width: 13.2001, height: 13.1997, slot: 16 },
160
+ delete: { width: 13.2, height: 14.533, slot: 16 },
156
161
  edit: {
157
162
  width: 10.8791,
158
163
  height: 12.0459,
@@ -213,6 +218,7 @@ var buttonVariants = {
213
218
  "text-filled-leading-sm": { size: 32, appearance: "filled", shape: "text" },
214
219
  "text-ghost-sm": { size: 32, appearance: "ghost", shape: "text" },
215
220
  "text-on-content-sm": { size: 32, appearance: "on-content", shape: "text" },
221
+ "text-outline-sm": { size: 32, appearance: "outline", shape: "text" },
216
222
  "text-tonal-sm": { size: 32, appearance: "tonal", shape: "text" },
217
223
  // The medium recipes are shared by all dialog footer actions.
218
224
  "text-filled-md": { size: 40, appearance: "filled", shape: "text" },
@@ -247,30 +253,46 @@ function ButtonFrame({ label, variant, loading = false, width, children, disable
247
253
  const buttonStyle = "width" in spec ? { ...style, "--vx-button-width": `${spec.width}px` } : style;
248
254
  return _jsxs("button", { ...props, type, className: className ? `vx-button ${className}` : "vx-button", "data-variant": variant, "data-appearance": spec.appearance, "data-shape": spec.shape, "data-size": spec.size, "data-width": width, "data-state": loading ? "loading" : disabled ? "disabled" : "default", style: buttonStyle, disabled: disabled || loading, "aria-label": label, "aria-busy": loading || void 0, children: [_jsx2("span", { className: "vx-button-content", children }), loading && _jsx2("span", { className: "vx-button-loading", "aria-hidden": "true" })] });
249
255
  }
250
- function Button({ variant = "text-filled-sm", leadingIcon, trailingIcon, ...props }) {
251
- return _jsxs(ButtonFrame, { ...props, variant, children: [leadingIcon && _jsx2(Icon, { name: leadingIcon }), _jsx2("span", { className: "vx-button-label", children: props.label }), trailingIcon && _jsx2("span", { className: "vx-button-trailing", children: _jsx2(Icon, { name: trailingIcon }) })] });
256
+ function Button({ variant = "text-filled-sm", leadingIcon, trailingIcon, badge, ...props }) {
257
+ return _jsxs(ButtonFrame, { ...props, label: badge ? `${props.label} (${badge})` : props.label, variant, children: [leadingIcon && _jsx2(Icon, { name: leadingIcon }), _jsx2("span", { className: "vx-button-label", children: props.label }), badge !== void 0 && badge > 0 && _jsx2("span", { className: "vx-button-badge", children: badge }), trailingIcon && _jsx2("span", { className: "vx-button-trailing", children: _jsx2(Icon, { name: trailingIcon }) })] });
252
258
  }
253
259
  function IconButton({ icon, variant = "icon-ghost-sm", ...props }) {
254
260
  return _jsx2(ButtonFrame, { ...props, variant, children: _jsx2(Icon, { name: icon }) });
255
261
  }
256
262
 
263
+ // packages/ui-system/dist/cover-preview.js
264
+ import { jsx as _jsx3 } from "react/jsx-runtime";
265
+ import { useState } from "react";
266
+ function CoverPreview(props) {
267
+ return _jsx3(Preview, { ...props }, JSON.stringify([props.kind, props.src]));
268
+ }
269
+ function Preview({ className, ref, kind = "image", src, pending, iconSize = 20, children }) {
270
+ const [mediaState, setMediaState] = useState("loading");
271
+ const media = src && (kind === "image" || kind === "video");
272
+ const state = pending ? "loading" : media ? mediaState : children ? "ready" : "empty";
273
+ const iconKind = kind === "video" || kind === "audio" ? kind : kind === "text" ? "script" : "image";
274
+ const ready = () => setMediaState("ready");
275
+ const failed = () => setMediaState("empty");
276
+ return _jsx3("span", { ref, className: `vx-cover-preview ${className}`, "data-cover-state": state, "aria-hidden": "true", children: state === "empty" ? _jsx3(Icon, { name: `placeholder-${iconKind}`, size: iconSize }) : !pending && media ? kind === "video" ? _jsx3("video", { src, muted: true, playsInline: true, preload: "auto", onLoadedData: ready, onError: failed }) : _jsx3("img", { src, alt: "", loading: "lazy", onLoad: ready, onError: failed }) : state === "ready" ? children : null });
277
+ }
278
+
257
279
  // packages/ui-system/dist/segmented-control.js
258
- import { jsx as _jsx3, jsxs as _jsxs2 } from "react/jsx-runtime";
280
+ import { jsx as _jsx4, jsxs as _jsxs2 } from "react/jsx-runtime";
259
281
  import { useId } from "react";
260
282
  function SegmentedControl({ label, items, value, onValueChange, size = "medium", width = "fixed", iconOnly = false }) {
261
283
  const id = useId();
262
- return _jsx3("div", { role: "radiogroup", "aria-label": label, className: "vx-segment", "data-size": size, "data-width": width, "data-icon-only": iconOnly, children: items.map((item) => _jsxs2("label", { children: [_jsx3("input", { type: "radio", name: id, value: item.value, disabled: item.disabled, checked: item.value === value, "aria-label": item.label, onChange: () => onValueChange(item.value) }), _jsxs2("span", { className: "vx-segment-item", children: [item.icon && _jsx3(Icon, { name: item.icon }), (!iconOnly || !item.icon) && item.label] })] }, item.value)) });
284
+ return _jsx4("div", { role: "radiogroup", "aria-label": label, className: "vx-segment", "data-size": size, "data-width": width, "data-icon-only": iconOnly, children: items.map((item) => _jsxs2("label", { children: [_jsx4("input", { type: "radio", name: id, value: item.value, disabled: item.disabled, checked: item.value === value, "aria-label": item.label, onChange: () => onValueChange(item.value) }), _jsxs2("span", { className: "vx-segment-item", children: [item.icon && _jsx4(Icon, { name: item.icon }), (!iconOnly || !item.icon) && item.label] })] }, item.value)) });
263
285
  }
264
286
 
265
287
  // packages/ui-system/dist/input.js
266
- import { jsx as _jsx4, jsxs as _jsxs3 } from "react/jsx-runtime";
267
- function TextInput({ label, value, onValueChange, size = "medium", ...props }) {
268
- return _jsxs3("label", { className: "vx-field", "data-size": size, children: [_jsx4("span", { children: label }), _jsx4("input", { ...props, type: "text", value, onChange: (event) => onValueChange(event.currentTarget.value) })] });
288
+ import { jsx as _jsx5, jsxs as _jsxs3 } from "react/jsx-runtime";
289
+ function TextInput({ label, value, onValueChange, size = "medium", appearance = "default", ...props }) {
290
+ return _jsxs3("label", { className: "vx-field", "data-size": size, "data-appearance": appearance, children: [_jsx5("span", { children: label }), _jsx5("input", { ...props, type: "text", value, onChange: (event) => onValueChange(event.currentTarget.value) })] });
269
291
  }
270
292
 
271
293
  // packages/ui-system/dist/dialog.js
272
- import { jsx as _jsx5, jsxs as _jsxs4, Fragment as _Fragment } from "react/jsx-runtime";
273
- import { useId as useId2, useLayoutEffect, useRef, useState } from "react";
294
+ import { jsx as _jsx6, jsxs as _jsxs4, Fragment as _Fragment } from "react/jsx-runtime";
295
+ import { useId as useId2, useLayoutEffect, useRef, useState as useState2 } from "react";
274
296
  import { createPortal } from "react-dom";
275
297
 
276
298
  // packages/ui-system/dist/dialog-surface.js
@@ -325,7 +347,7 @@ function createDialogSurface(anchor) {
325
347
  function Dialog({ title, open, onOpenChange, children, actions, className, variant = "default" }) {
326
348
  const ref = useRef(null);
327
349
  const anchor = useRef(null);
328
- const [surface, setSurface] = useState();
350
+ const [surface, setSurface] = useState2();
329
351
  const heading = useId2();
330
352
  useLayoutEffect(() => {
331
353
  if (!open || !anchor.current)
@@ -359,34 +381,13 @@ function Dialog({ title, open, onOpenChange, children, actions, className, varia
359
381
  }, onClose: (event) => {
360
382
  if (open && event.currentTarget.isConnected && !event.currentTarget.open)
361
383
  onOpenChange(false);
362
- }, children: [_jsxs4("header", { children: [_jsx5("h2", { id: heading, children: title }), _jsx5(IconButton, { icon: "close", label: "Close dialog", onClick: () => onOpenChange(false) })] }), _jsx5("div", { className: "vx-dialog-body", children }), actions && _jsx5("footer", { children: actions })] });
363
- return _jsxs4(_Fragment, { children: [_jsx5("span", { ref: anchor, hidden: true }), open && (surface ? createPortal(dialog, surface) : dialog)] });
384
+ }, children: [_jsxs4("header", { children: [_jsx6("h2", { id: heading, children: title }), _jsx6(IconButton, { icon: "close", label: "Close dialog", onClick: () => onOpenChange(false) })] }), _jsx6("div", { className: "vx-dialog-body", children }), actions && _jsx6("footer", { children: actions })] });
385
+ return _jsxs4(_Fragment, { children: [_jsx6("span", { ref: anchor, hidden: true }), open && (surface ? createPortal(dialog, surface) : dialog)] });
364
386
  }
365
387
 
366
- // packages/dashboard-projects/src/client.tsx
388
+ // packages/dashboard-projects/src/create-project-dialog.tsx
389
+ import * as React from "react";
367
390
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
368
- var Config = z.object({ studioInstance: z.string().min(1).nullable().default(null) });
369
- var dependencies = (config) => config.studioInstance ? [config.studioInstance] : [];
370
- var projectsSql = "SELECT * FROM studio_projects ORDER BY createdAt DESC, rowId ASC";
371
- function decodeRef(value) {
372
- let item = value;
373
- if (typeof item === "string") {
374
- try {
375
- item = JSON.parse(item);
376
- } catch {
377
- return null;
378
- }
379
- }
380
- if (!item || typeof item !== "object" || Array.isArray(item)) return null;
381
- const ref = item;
382
- return ["storeId", "objectId", "versionId"].every(
383
- (key) => typeof ref[key] === "string" && /^[0-9a-f-]{36}$/i.test(ref[key])
384
- ) ? {
385
- storeId: ref.storeId,
386
- objectId: ref.objectId,
387
- versionId: ref.versionId
388
- } : null;
389
- }
390
391
  var projectTypes = [
391
392
  {
392
393
  value: "short-drama",
@@ -428,9 +429,11 @@ function NewProjectDialog({
428
429
  const selection = projectTypes.find((item) => item.value === type);
429
430
  const placeholder = type === "table" ? "Untitled Project" : "Untitled " + selection.label;
430
431
  const [packageName, presetId] = selection.preset.split(":");
431
- const preset = presets?.find(
432
- (item) => item.spec.startsWith(packageName + "@") && item.spec.endsWith(":" + presetId)
433
- );
432
+ const preset = [packageName, packageName.replace("@vivix-labs/", "@vivix-studio/")].flatMap(
433
+ (name2) => presets?.filter(
434
+ (item) => item.spec.startsWith(name2 + "@") && item.spec.endsWith(":" + presetId)
435
+ ) ?? []
436
+ )[0];
434
437
  async function create() {
435
438
  if (!preset || !client.projects?.create || busy) return;
436
439
  const input = {
@@ -520,23 +523,82 @@ function NewProjectDialog({
520
523
  }
521
524
  );
522
525
  }
523
- function ProjectCover({ row }) {
524
- const [failed, setFailed] = React.useState(false);
525
- const source = typeof row?.previewUrl === "string" && !failed ? row.previewUrl : void 0;
526
- return /* @__PURE__ */ jsx("span", { className: "studio-home-cover", "aria-hidden": "true", children: source && row?.previewKind === "video" ? /* @__PURE__ */ jsx("video", { src: source, muted: true, playsInline: true, preload: "auto", onError: () => setFailed(true) }) : source ? /* @__PURE__ */ jsx("img", { src: source, alt: "", loading: "lazy", onError: () => setFailed(true) }) : null });
526
+
527
+ // packages/dashboard-projects/src/client.tsx
528
+ import { Fragment as Fragment2, jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
529
+ var Config = z.object({ studioInstance: z.string().min(1).nullable().default(null) });
530
+ var dependencies = (config) => config.studioInstance ? [config.studioInstance] : [];
531
+ var projectsSql = "SELECT * FROM studio_projects ORDER BY createdAt DESC, rowId ASC";
532
+ function decodeRef(value) {
533
+ let item = value;
534
+ if (typeof item === "string") {
535
+ try {
536
+ item = JSON.parse(item);
537
+ } catch {
538
+ return null;
539
+ }
540
+ }
541
+ if (!item || typeof item !== "object" || Array.isArray(item)) return null;
542
+ const ref = item;
543
+ return ["storeId", "objectId", "versionId"].every(
544
+ (key) => typeof ref[key] === "string" && /^[0-9a-f-]{36}$/i.test(ref[key])
545
+ ) ? {
546
+ storeId: ref.storeId,
547
+ objectId: ref.objectId,
548
+ versionId: ref.versionId
549
+ } : null;
550
+ }
551
+ function ProjectCover({
552
+ client,
553
+ row,
554
+ pending
555
+ }) {
556
+ const coverRef = row?.available ? row.previewRef ?? row.coverRef : void 0;
557
+ const instanceId = client.config.studioInstance;
558
+ const [resolved, setResolved] = React2.useState();
559
+ React2.useEffect(() => {
560
+ const ref = decodeRef(coverRef);
561
+ if (!ref || !instanceId) return;
562
+ let active = true;
563
+ void client.invoke({ instanceId, operationId: "global.asset" }, { ref }).then(
564
+ ({ item }) => {
565
+ if (active) setResolved(item);
566
+ },
567
+ () => {
568
+ if (active) setResolved(null);
569
+ }
570
+ );
571
+ return () => {
572
+ active = false;
573
+ };
574
+ }, [client, coverRef, instanceId]);
575
+ const src = resolved?.previewUrl ?? row?.previewUrl;
576
+ return /* @__PURE__ */ jsx2(
577
+ CoverPreview,
578
+ {
579
+ className: "studio-home-cover",
580
+ src: typeof src === "string" ? src : void 0,
581
+ kind: String(resolved?.kind ?? row?.previewKind ?? "image"),
582
+ pending: pending || Boolean(instanceId && decodeRef(coverRef) && resolved === void 0)
583
+ }
584
+ );
527
585
  }
586
+ var previousProjects = /* @__PURE__ */ new WeakMap();
528
587
  function ProjectsCard({
529
588
  client,
530
589
  projects,
590
+ hiddenProjectIds,
531
591
  ready,
532
592
  openProject,
533
593
  openProjects,
534
594
  onProjectCreated
535
595
  }) {
536
- const [rows, setRows] = React.useState();
537
- const [creating, setCreating] = React.useState(false);
596
+ const [result, setResult] = React2.useState(() => previousProjects.get(client));
597
+ const [creating, setCreating] = React2.useState(false);
538
598
  const catalogKey = JSON.stringify(projects);
539
- React.useEffect(() => {
599
+ const hiddenKey = JSON.stringify(hiddenProjectIds ?? []);
600
+ const resultKey = JSON.stringify([catalogKey, hiddenKey]);
601
+ React2.useEffect(() => {
540
602
  if (!ready || !client.config.studioInstance) return;
541
603
  let active = true;
542
604
  void client.invoke(
@@ -546,42 +608,31 @@ function ProjectsCard({
546
608
  sql: projectsSql,
547
609
  params: [],
548
610
  catalog: JSON.parse(catalogKey),
611
+ ...hiddenKey !== "[]" && { excludeProjectIds: JSON.parse(hiddenKey) },
549
612
  limit: 5,
550
613
  timeoutMs: 8e3,
551
614
  offset: 0
552
615
  }
553
616
  ).then(
554
- async ({ items }) => {
555
- const next = await Promise.all(
556
- items.map(async (row) => {
557
- const ref = decodeRef(row.previewRef ?? row.coverRef);
558
- if (!ref || !row.available) return row;
559
- try {
560
- const { item } = await client.invoke(
561
- { instanceId: client.config.studioInstance, operationId: "global.asset" },
562
- { ref }
563
- );
564
- return {
565
- ...row,
566
- previewUrl: item.previewUrl ?? null,
567
- previewKind: item.kind ?? null
568
- };
569
- } catch {
570
- return row;
571
- }
572
- })
573
- );
574
- if (active) setRows(next);
617
+ ({ items }) => {
618
+ if (!active) return;
619
+ const result2 = { catalogKey: resultKey, rows: items };
620
+ previousProjects.set(client, result2);
621
+ setResult(result2);
575
622
  },
576
623
  () => {
577
- if (active) setRows([]);
624
+ if (!active) return;
625
+ previousProjects.delete(client);
626
+ setResult({ catalogKey: resultKey, rows: [] });
578
627
  }
579
628
  );
580
629
  return () => {
581
630
  active = false;
582
631
  };
583
- }, [client, ready, catalogKey]);
584
- const list = rows ?? [];
632
+ }, [client, ready, catalogKey, hiddenKey]);
633
+ const current = catalogKey === result?.catalogKey ? result : void 0;
634
+ const pending = Boolean(client.config.studioInstance) && (!ready || !current);
635
+ const list = current?.rows ?? [];
585
636
  const entries = (list.length ? list.map((row) => projects.find(({ id }) => id === row.projectId)).filter((entry) => !!entry) : projects.slice(0, 5)).map((project) => {
586
637
  const row = list.find((entry) => entry.projectId === project.id);
587
638
  return {
@@ -593,10 +644,10 @@ function ProjectsCard({
593
644
  open: () => openProject(project.id)
594
645
  };
595
646
  });
596
- return /* @__PURE__ */ jsxs("section", { className: "studio-home-panel", "aria-label": "Project List", children: [
597
- /* @__PURE__ */ jsxs("header", { children: [
598
- /* @__PURE__ */ jsx("h2", { children: "Project List" }),
599
- /* @__PURE__ */ jsx(
647
+ return /* @__PURE__ */ jsxs2("section", { className: "studio-home-panel", "aria-label": "Project List", children: [
648
+ /* @__PURE__ */ jsxs2("header", { children: [
649
+ /* @__PURE__ */ jsx2("h2", { children: "Project List" }),
650
+ /* @__PURE__ */ jsx2(
600
651
  Button,
601
652
  {
602
653
  label: "View all",
@@ -607,21 +658,23 @@ function ProjectsCard({
607
658
  }
608
659
  )
609
660
  ] }),
610
- /* @__PURE__ */ jsxs("div", { className: "studio-home-grid", children: [
611
- /* @__PURE__ */ jsxs(
661
+ /* @__PURE__ */ jsxs2("div", { className: "studio-home-grid", children: [
662
+ /* @__PURE__ */ jsxs2(
612
663
  "button",
613
664
  {
614
665
  type: "button",
615
666
  className: "studio-home-tile studio-home-create",
616
667
  onClick: () => setCreating(true),
617
668
  children: [
618
- /* @__PURE__ */ jsx("span", { className: "studio-home-cover", "aria-hidden": "true", children: /* @__PURE__ */ jsx("span", { children: /* @__PURE__ */ jsx(Icon, { name: "add" }) }) }),
619
- /* @__PURE__ */ jsx("strong", { children: "Create Project" }),
620
- /* @__PURE__ */ jsx("small", { children: "Create a local project" })
669
+ /* @__PURE__ */ jsx2("span", { className: "studio-home-cover", "aria-hidden": "true", children: /* @__PURE__ */ jsx2("span", { children: /* @__PURE__ */ jsx2(Icon, { name: "add" }) }) }),
670
+ /* @__PURE__ */ jsxs2("span", { className: "studio-home-caption", children: [
671
+ /* @__PURE__ */ jsx2("strong", { children: "Create Project" }),
672
+ /* @__PURE__ */ jsx2("small", { children: "Create a local project" })
673
+ ] })
621
674
  ]
622
675
  }
623
676
  ),
624
- entries.map(({ key, row, name, note, enabled, open }) => /* @__PURE__ */ jsxs(
677
+ entries.map(({ key, row, name, note, enabled, open }) => /* @__PURE__ */ jsxs2(
625
678
  "button",
626
679
  {
627
680
  type: "button",
@@ -629,15 +682,29 @@ function ProjectsCard({
629
682
  onClick: open,
630
683
  disabled: !enabled,
631
684
  children: [
632
- /* @__PURE__ */ jsx(ProjectCover, { row }, String(row?.previewUrl ?? "")),
633
- /* @__PURE__ */ jsx("strong", { title: name, children: name }),
634
- note && /* @__PURE__ */ jsx("small", { children: note })
685
+ /* @__PURE__ */ jsx2(
686
+ ProjectCover,
687
+ {
688
+ client,
689
+ row,
690
+ pending: enabled && pending
691
+ },
692
+ JSON.stringify([
693
+ client.config.studioInstance,
694
+ row?.available,
695
+ row?.previewRef ?? row?.coverRef
696
+ ])
697
+ ),
698
+ /* @__PURE__ */ jsxs2("span", { className: "studio-home-caption", children: [
699
+ /* @__PURE__ */ jsx2("strong", { title: name, children: name }),
700
+ note && /* @__PURE__ */ jsx2("small", { children: note })
701
+ ] })
635
702
  ]
636
703
  },
637
704
  key
638
705
  ))
639
706
  ] }),
640
- creating && /* @__PURE__ */ jsx(
707
+ creating && /* @__PURE__ */ jsx2(
641
708
  NewProjectDialog,
642
709
  {
643
710
  client,
@@ -655,7 +722,35 @@ function activate(client) {
655
722
  id: "projects",
656
723
  title: "Project List",
657
724
  kind: "component",
658
- component: (props) => /* @__PURE__ */ jsx(ProjectsCard, { ...props, client })
725
+ component: (props) => /* @__PURE__ */ jsx2(ProjectsCard, { ...props, client })
726
+ });
727
+ client.registerUI({
728
+ id: "create-project",
729
+ title: "Create Project",
730
+ kind: "component",
731
+ component: function ProjectCreator(props) {
732
+ const [open, setOpen] = React2.useState(false);
733
+ if ("close" in props) return /* @__PURE__ */ jsx2(NewProjectDialog, { client, ...props });
734
+ return /* @__PURE__ */ jsxs2(Fragment2, { children: [
735
+ /* @__PURE__ */ jsx2(
736
+ Button,
737
+ {
738
+ label: "Create Project",
739
+ variant: "text-filled-sm",
740
+ width: "hug",
741
+ onClick: () => setOpen(true)
742
+ }
743
+ ),
744
+ open && /* @__PURE__ */ jsx2(
745
+ NewProjectDialog,
746
+ {
747
+ client,
748
+ close: () => setOpen(false),
749
+ onCreated: (project) => props.onProjectCreated?.(project)
750
+ }
751
+ )
752
+ ] });
753
+ }
659
754
  });
660
755
  }
661
756
  export {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vivix-labs/dashboard-projects",
3
- "version": "1.0.0-beta.2",
3
+ "version": "1.0.0-beta.6",
4
4
  "type": "module",
5
5
  "publishConfig": {
6
6
  "access": "public",
@@ -19,4 +19,4 @@
19
19
  "react": "^19.0.0",
20
20
  "react-dom": "^19.0.0"
21
21
  }
22
- }
22
+ }