@drawnagency/primitives 0.1.23 → 0.1.24

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,4 +1,4 @@
1
- type BuildState = "idle" | "building" | "ready" | "error";
1
+ type BuildState = "idle" | "building" | "ready" | "error" | "fading";
2
2
  interface BuildStatusResult {
3
3
  state: BuildState;
4
4
  deployUrl: string | null;
@@ -1 +1 @@
1
- {"version":3,"file":"useBuildStatus.d.ts","sourceRoot":"","sources":["../../src/hooks/useBuildStatus.ts"],"names":[],"mappings":"AAEA,KAAK,UAAU,GAAG,MAAM,GAAG,UAAU,GAAG,OAAO,GAAG,OAAO,CAAC;AAS1D,UAAU,iBAAiB;IACzB,KAAK,EAAE,UAAU,CAAC;IAClB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,cAAc,EAAE,MAAM,CAAC;IACvB,aAAa,EAAE,MAAM,IAAI,CAAC;IAC1B,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB;AAKD,wBAAgB,cAAc,IAAI,iBAAiB,CAsHlD"}
1
+ {"version":3,"file":"useBuildStatus.d.ts","sourceRoot":"","sources":["../../src/hooks/useBuildStatus.ts"],"names":[],"mappings":"AAEA,KAAK,UAAU,GAAG,MAAM,GAAG,UAAU,GAAG,OAAO,GAAG,OAAO,GAAG,QAAQ,CAAC;AASrE,UAAU,iBAAiB;IACzB,KAAK,EAAE,UAAU,CAAC;IAClB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,cAAc,EAAE,MAAM,CAAC;IACvB,aAAa,EAAE,MAAM,IAAI,CAAC;IAC1B,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB;AAMD,wBAAgB,cAAc,IAAI,iBAAiB,CAyHlD"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@drawnagency/primitives",
3
- "version": "0.1.23",
3
+ "version": "0.1.24",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  "./package.json": "./package.json",
@@ -905,7 +905,7 @@ function StatusText({
905
905
  }: {
906
906
  publishAction: "idle" | "saving" | "publishing";
907
907
  publishFeedback: string | null;
908
- buildState: "idle" | "building" | "ready" | "error";
908
+ buildState: "idle" | "building" | "ready" | "error" | "fading";
909
909
  buildElapsed: number;
910
910
  onDismiss: () => void;
911
911
  }) {
@@ -923,9 +923,12 @@ function StatusText({
923
923
  </span>
924
924
  );
925
925
  }
926
- if (buildState === "ready") {
926
+ if (buildState === "ready" || buildState === "fading") {
927
927
  return (
928
- <span className="inline-flex items-center gap-1.5 text-xs font-medium text-green-600">
928
+ <span className={cn(
929
+ "inline-flex items-center gap-1.5 text-xs font-medium text-green-600 transition-opacity duration-1000",
930
+ buildState === "fading" ? "opacity-0" : "opacity-100",
931
+ )}>
929
932
  Published in {formatElapsed(buildElapsed)}
930
933
  <DismissButton onClick={onDismiss} />
931
934
  </span>
@@ -979,7 +982,7 @@ function EditorToolbar({
979
982
  onSettingsClick: () => void;
980
983
  onMediaClick: () => void;
981
984
  processingItems: QueueItem[];
982
- buildState: "idle" | "building" | "ready" | "error";
985
+ buildState: "idle" | "building" | "ready" | "error" | "fading";
983
986
  buildElapsed: number;
984
987
  onBuildDismiss: () => void;
985
988
  }) {
@@ -1,6 +1,6 @@
1
1
  import { useState, useCallback, useEffect, useRef } from "react";
2
2
 
3
- type BuildState = "idle" | "building" | "ready" | "error";
3
+ type BuildState = "idle" | "building" | "ready" | "error" | "fading";
4
4
 
5
5
  interface BuildStatusResponse {
6
6
  state: "building" | "ready" | "error";
@@ -18,7 +18,8 @@ interface BuildStatusResult {
18
18
  }
19
19
 
20
20
  const POLL_INTERVAL = 5000;
21
- const AUTO_CLEAR_DELAY = 5000;
21
+ const AUTO_CLEAR_DELAY = 10000;
22
+ const FADE_DURATION = 1000;
22
23
 
23
24
  export function useBuildStatus(): BuildStatusResult {
24
25
  const [state, setState] = useState<BuildState>("idle");
@@ -81,7 +82,10 @@ export function useBuildStatus(): BuildStatusResult {
81
82
  stopPolling();
82
83
  stopTimer();
83
84
  if (data.state === "ready") {
84
- clearRef.current = setTimeout(() => setState("idle"), AUTO_CLEAR_DELAY);
85
+ clearRef.current = setTimeout(() => {
86
+ setState("fading");
87
+ clearRef.current = setTimeout(() => setState("idle"), FADE_DURATION);
88
+ }, AUTO_CLEAR_DELAY);
85
89
  }
86
90
  }
87
91
  },