@drawnagency/primitives 0.1.16 → 0.1.17

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 +1 @@
1
- {"version":3,"file":"EditorShell.d.ts","sourceRoot":"","sources":["../../../src/components/shell/EditorShell.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAYjD,OAAO,sBAAsB,CAAC;AAmC9B,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAcxD,UAAU,KAAK;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,QAAQ,EAAE,CAAC;IACtB,YAAY,EAAE;QACZ,KAAK,EAAE,OAAO,CAAC;QACf,aAAa,EAAE,OAAO,CAAC;QACvB,YAAY,EAAE,OAAO,CAAC;QACtB,cAAc,EAAE,OAAO,CAAC;QACxB,kBAAkB,EAAE,OAAO,CAAC;QAC5B,cAAc,EAAE,OAAO,CAAC;KACzB,CAAC;IACF,WAAW,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,OAAO,GAAG,QAAQ,CAAA;KAAE,GAAG,IAAI,CAAC;CACjE;AAED,MAAM,CAAC,OAAO,UAAU,WAAW,CAAC,EAClC,OAAO,EACP,MAAM,EACN,SAAS,EAAE,gBAAgB,EAC3B,YAAY,EACZ,WAAW,GACZ,EAAE,KAAK,2CAukBP"}
1
+ {"version":3,"file":"EditorShell.d.ts","sourceRoot":"","sources":["../../../src/components/shell/EditorShell.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAYjD,OAAO,sBAAsB,CAAC;AAkC9B,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAcxD,UAAU,KAAK;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,QAAQ,EAAE,CAAC;IACtB,YAAY,EAAE;QACZ,KAAK,EAAE,OAAO,CAAC;QACf,aAAa,EAAE,OAAO,CAAC;QACvB,YAAY,EAAE,OAAO,CAAC;QACtB,cAAc,EAAE,OAAO,CAAC;QACxB,kBAAkB,EAAE,OAAO,CAAC;QAC5B,cAAc,EAAE,OAAO,CAAC;KACzB,CAAC;IACF,WAAW,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,OAAO,GAAG,QAAQ,CAAA;KAAE,GAAG,IAAI,CAAC;CACjE;AAED,MAAM,CAAC,OAAO,UAAU,WAAW,CAAC,EAClC,OAAO,EACP,MAAM,EACN,SAAS,EAAE,gBAAgB,EAC3B,YAAY,EACZ,WAAW,GACZ,EAAE,KAAK,2CAskBP"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@drawnagency/primitives",
3
- "version": "0.1.16",
3
+ "version": "0.1.17",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  "./package.json": "./package.json",
@@ -37,7 +37,6 @@ import { useEditorPersistence } from "../../hooks/useEditorPersistence";
37
37
  import { useEditorPublish } from "../../hooks/useEditorPublish";
38
38
  import { useContentLifecycle } from "../../hooks/useContentLifecycle";
39
39
  import { useBuildStatus } from "../../hooks/useBuildStatus";
40
- import { BuildStatusIndicator } from "./BuildStatusIndicator";
41
40
  import { useMediaPipeline } from "../../hooks/useMediaPipeline";
42
41
  import { formatTimestamp } from "../../lib/timestamp";
43
42
  import { generateNavLinks } from "../../lib/nav";
@@ -587,7 +586,6 @@ export default function EditorShell({
587
586
  }}
588
587
  processingItems={mediaPipeline.processingItems}
589
588
  buildState={buildStatus.state}
590
- buildDeployUrl={buildStatus.deployUrl}
591
589
  />
592
590
 
593
591
  <EditorContent
@@ -874,6 +872,43 @@ function GlobalModal() {
874
872
  );
875
873
  }
876
874
 
875
+ function StatusText({
876
+ publishAction,
877
+ publishFeedback,
878
+ buildState,
879
+ }: {
880
+ publishAction: "idle" | "saving" | "publishing";
881
+ publishFeedback: string | null;
882
+ buildState: "idle" | "building" | "ready" | "error";
883
+ }) {
884
+ if (publishAction === "saving") {
885
+ return <span className="text-xs font-medium text-base-content/60">Saving...</span>;
886
+ }
887
+ if (publishAction === "publishing") {
888
+ return <span className="text-xs font-medium text-base-content/60">Publishing...</span>;
889
+ }
890
+ if (buildState === "building") {
891
+ return <span className="text-xs font-medium text-orange-600">Publishing...</span>;
892
+ }
893
+ if (buildState === "ready") {
894
+ return <span className="text-xs font-medium text-green-600">Published</span>;
895
+ }
896
+ if (buildState === "error") {
897
+ return <span className="text-xs font-medium text-red-600">Publish failed</span>;
898
+ }
899
+ if (publishFeedback) {
900
+ return (
901
+ <span className={cn(
902
+ "text-xs font-medium",
903
+ publishFeedback === "Saved" ? "text-green-600" : "text-red-600",
904
+ )}>
905
+ {publishFeedback}
906
+ </span>
907
+ );
908
+ }
909
+ return null;
910
+ }
911
+
877
912
  function EditorToolbar({
878
913
  buttonState,
879
914
  localChangesExist,
@@ -887,7 +922,6 @@ function EditorToolbar({
887
922
  onMediaClick,
888
923
  processingItems,
889
924
  buildState,
890
- buildDeployUrl,
891
925
  }: {
892
926
  buttonState: "synced" | "publish" | "saveAndPublish";
893
927
  localChangesExist: boolean;
@@ -901,31 +935,19 @@ function EditorToolbar({
901
935
  onMediaClick: () => void;
902
936
  processingItems: QueueItem[];
903
937
  buildState: "idle" | "building" | "ready" | "error";
904
- buildDeployUrl: string | null;
905
938
  }) {
906
939
  const { isEditMode, viewBranch, setViewBranch, toggleEditMode } = useEditorContext();
907
940
 
908
941
  return (
909
942
  <>
910
943
  {isEditMode && (
911
- <div className="fixed top-0 right-0 left-0 z-50 flex items-center justify-between border-b border-base-200 bg-base px-4 py-2">
944
+ <div className="fixed top-0 right-0 left-0 z-50 grid grid-cols-3 items-center border-b border-base-200 bg-base px-4 py-2">
912
945
  <div className="flex items-center gap-2">
913
- {publishFeedback && (
914
- <span className={cn(
915
- "text-xs font-medium",
916
- publishFeedback === "Saved"
917
- ? "text-green-600"
918
- : "text-red-600",
919
- )}>
920
- {publishFeedback}
921
- </span>
922
- )}
923
946
  {buttonState === "saveAndPublish" && (
924
947
  <SplitButton
925
948
  label="Save & Publish"
926
949
  onClick={onSaveAndPublish}
927
- isLoading={publishAction !== "idle"}
928
- loadingLabel={publishAction === "saving" ? "Saving..." : "Publishing..."}
950
+ disabled={publishAction !== "idle"}
929
951
  options={[{ label: "Save", onClick: onSave }]}
930
952
  />
931
953
  )}
@@ -933,8 +955,7 @@ function EditorToolbar({
933
955
  <SplitButton
934
956
  label="Publish"
935
957
  onClick={onPublish}
936
- isLoading={publishAction !== "idle"}
937
- loadingLabel="Publishing..."
958
+ disabled={publishAction !== "idle"}
938
959
  options={[]}
939
960
  />
940
961
  )}
@@ -955,12 +976,15 @@ function EditorToolbar({
955
976
  Discard Changes
956
977
  </Button>
957
978
  )}
958
- <BuildStatusIndicator
959
- state={buildState}
960
- deployUrl={buildDeployUrl}
979
+ </div>
980
+ <div className="flex items-center justify-center">
981
+ <StatusText
982
+ publishAction={publishAction}
983
+ publishFeedback={publishFeedback}
984
+ buildState={buildState}
961
985
  />
962
986
  </div>
963
- <div className="flex items-center gap-2">
987
+ <div className="flex items-center justify-end gap-2">
964
988
  <ProcessingIndicator items={processingItems} />
965
989
  <IconButton
966
990
  icon={<ImageIcon size={16} />}