tinacms 2.8.0 → 2.8.1

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/index.js CHANGED
@@ -45087,7 +45087,7 @@ Please wrap them with useCallback or configure the deps array correctly.`
45087
45087
  ...props
45088
45088
  }) => {
45089
45089
  const styles = {
45090
- warning: "text-sm px-4 py-2 text-amber-700 bg-amber-100 rounded border border-amber-700/20"
45090
+ warning: "ml-8 text-sm px-4 py-2 text-amber-700 bg-amber-100 rounded border border-amber-700/20"
45091
45091
  };
45092
45092
  const icon = {
45093
45093
  warning: /* @__PURE__ */ React__namespace.createElement(AiFillWarning, { className: "w-5 h-auto inline-block mr-1 opacity-70 text-amber-600" })
@@ -45845,7 +45845,7 @@ Please wrap them with useCallback or configure the deps array correctly.`
45845
45845
  requiredArgs(1, arguments);
45846
45846
  return formatDistance(dirtyDate, Date.now(), options);
45847
45847
  }
45848
- const currentVersion = "1.0";
45848
+ const version$1 = "2.8.1";
45849
45849
  const VersionInfo = () => {
45850
45850
  const cms = useCMS();
45851
45851
  const [isLoading, setIsLoading] = React.useState(true);
@@ -45861,7 +45861,7 @@ Please wrap them with useCallback or configure the deps array correctly.`
45861
45861
  };
45862
45862
  fetchVersionInfo();
45863
45863
  }, [cms]);
45864
- return /* @__PURE__ */ React.createElement("span", { className: "font-sans font-light text-xs mb-3 mt-4 text-gray-500" }, "TinaCMS v", currentVersion + " ", isLoading ? /* @__PURE__ */ React.createElement(lucideReact.LoaderCircle, { className: "animate-spin w-4 h-4 inline-block mb-px" }) : /* @__PURE__ */ React.createElement(LatestVersionWarning, { latestVersionInfo }));
45864
+ return /* @__PURE__ */ React.createElement("span", { className: "font-sans font-light text-xs mb-3 mt-4 text-gray-500" }, "TinaCMS v", version$1 + " ", isLoading ? /* @__PURE__ */ React.createElement(lucideReact.LoaderCircle, { className: "animate-spin w-4 h-4 inline-block mb-px" }) : /* @__PURE__ */ React.createElement(LatestVersionWarning, { latestVersionInfo }));
45865
45865
  };
45866
45866
  const LatestVersionWarning = ({
45867
45867
  latestVersionInfo
@@ -45876,7 +45876,7 @@ Please wrap them with useCallback or configure the deps array correctly.`
45876
45876
  if (!latestVersion) {
45877
45877
  return null;
45878
45878
  }
45879
- if (latestVersion === currentVersion) {
45879
+ if (latestVersion === version$1) {
45880
45880
  return /* @__PURE__ */ React.createElement(lucideReact.Check, { className: "w-4 h-4 inline-block mb-px text-green-500" });
45881
45881
  }
45882
45882
  return /* @__PURE__ */ React.createElement("span", { className: "text-yellow-700" }, /* @__PURE__ */ React.createElement(lucideReact.TriangleAlert, { className: "w-4 h-4 inline-block mb-px" }), /* @__PURE__ */ React.createElement("br", null), "v", latestVersion, " published ", relativePublishedAt);
@@ -46021,6 +46021,7 @@ Please wrap them with useCallback or configure the deps array correctly.`
46021
46021
  const Nav = ({
46022
46022
  isLocalMode,
46023
46023
  showHamburger = true,
46024
+ menuIsOpen,
46024
46025
  toggleMenu,
46025
46026
  className = "",
46026
46027
  children,
@@ -46061,9 +46062,24 @@ Please wrap them with useCallback or configure the deps array correctly.`
46061
46062
  { Site: [] }
46062
46063
  );
46063
46064
  return /* @__PURE__ */ React__namespace.createElement(React__namespace.Fragment, null, /* @__PURE__ */ React__namespace.createElement(
46065
+ "button",
46066
+ {
46067
+ className: cn(
46068
+ "fixed pointer-events-auto p-4 hover:bg-gray-100 transition-colors duration-150 ease-in-out rounded z-10",
46069
+ menuIsOpen ? "hidden" : ""
46070
+ ),
46071
+ onClick: () => {
46072
+ toggleMenu();
46073
+ }
46074
+ },
46075
+ /* @__PURE__ */ React__namespace.createElement(BiMenu, { className: "h-6 w-auto text-gray-600" })
46076
+ ), /* @__PURE__ */ React__namespace.createElement(
46064
46077
  "div",
46065
46078
  {
46066
- className: `relative z-30 flex flex-col bg-white border-r border-gray-200 w-96 h-full ${className}`,
46079
+ className: cn(
46080
+ `relative z-30 flex flex-col bg-white border-r border-gray-200 w-96 h-full ${className}`,
46081
+ menuIsOpen ? "" : "hidden"
46082
+ ),
46067
46083
  style: { maxWidth: `${sidebarWidth}px` },
46068
46084
  ...props
46069
46085
  },
@@ -46071,10 +46087,11 @@ Please wrap them with useCallback or configure the deps array correctly.`
46071
46087
  "button",
46072
46088
  {
46073
46089
  className: cn(
46074
- "pointer-events-auto p-2 hover:bg-gray-100 transition-colors duration-150 ease-in-out rounded",
46075
- showHamburger ? "" : "md:hidden"
46090
+ "pointer-events-auto p-2 hover:bg-gray-100 transition-colors duration-150 ease-in-out rounded"
46076
46091
  ),
46077
- onClick: toggleMenu
46092
+ onClick: () => {
46093
+ toggleMenu();
46094
+ }
46078
46095
  },
46079
46096
  /* @__PURE__ */ React__namespace.createElement(BiMenu, { className: "h-6 w-auto text-gray-600" })
46080
46097
  ), /* @__PURE__ */ React__namespace.createElement("span", { className: "text-left inline-flex items-center text-xl tracking-wide text-gray-800/80 flex-1 gap-1" }, /* @__PURE__ */ React__namespace.createElement(TinaIcon, { className: "w-10 h-auto -ml-1 fill-orange-500" }), /* @__PURE__ */ React__namespace.createElement("span", null, "TinaCMS"))),
@@ -46894,6 +46911,7 @@ Please wrap them with useCallback or configure the deps array correctly.`
46894
46911
  Nav,
46895
46912
  {
46896
46913
  isLocalMode: (_d = (_c = cms.api) == null ? void 0 : _c.tina) == null ? void 0 : _d.isLocalMode,
46914
+ menuIsOpen: true,
46897
46915
  toggleMenu,
46898
46916
  showCollections: isTinaAdminEnabled,
46899
46917
  collectionsInfo,
@@ -119744,6 +119762,7 @@ This will work when developing locally but NOT when deployed to production.
119744
119762
  const collectionsInfo = useGetCollections(cms);
119745
119763
  const screens = cms.plugins.getType("screen").all();
119746
119764
  const cloudConfigs = cms.plugins.getType("cloud-config").all();
119765
+ const [menuIsOpen, setMenuIsOpen] = React.useState(false);
119747
119766
  const isLocalMode = (_b = (_a2 = cms.api) == null ? void 0 : _a2.tina) == null ? void 0 : _b.isLocalMode;
119748
119767
  const activeScreens = screens.filter(
119749
119768
  (screen) => {
@@ -119756,8 +119775,8 @@ This will work when developing locally but NOT when deployed to production.
119756
119775
  {
119757
119776
  isLocalMode,
119758
119777
  showHamburger: false,
119759
- toggleMenu: () => {
119760
- },
119778
+ menuIsOpen,
119779
+ toggleMenu: () => setMenuIsOpen((menu) => !menu),
119761
119780
  sidebarWidth: 360,
119762
119781
  showCollections: true,
119763
119782
  collectionsInfo,
package/dist/index.mjs CHANGED
@@ -45114,7 +45114,7 @@ const Alert$1 = ({
45114
45114
  ...props
45115
45115
  }) => {
45116
45116
  const styles = {
45117
- warning: "text-sm px-4 py-2 text-amber-700 bg-amber-100 rounded border border-amber-700/20"
45117
+ warning: "ml-8 text-sm px-4 py-2 text-amber-700 bg-amber-100 rounded border border-amber-700/20"
45118
45118
  };
45119
45119
  const icon = {
45120
45120
  warning: /* @__PURE__ */ React.createElement(AiFillWarning, { className: "w-5 h-auto inline-block mr-1 opacity-70 text-amber-600" })
@@ -45872,7 +45872,7 @@ function formatDistanceToNow(dirtyDate, options) {
45872
45872
  requiredArgs(1, arguments);
45873
45873
  return formatDistance2(dirtyDate, Date.now(), options);
45874
45874
  }
45875
- const currentVersion = "1.0";
45875
+ const version$1 = "2.8.1";
45876
45876
  const VersionInfo = () => {
45877
45877
  const cms = useCMS();
45878
45878
  const [isLoading, setIsLoading] = React__default.useState(true);
@@ -45888,7 +45888,7 @@ const VersionInfo = () => {
45888
45888
  };
45889
45889
  fetchVersionInfo();
45890
45890
  }, [cms]);
45891
- return /* @__PURE__ */ React__default.createElement("span", { className: "font-sans font-light text-xs mb-3 mt-4 text-gray-500" }, "TinaCMS v", currentVersion + " ", isLoading ? /* @__PURE__ */ React__default.createElement(LoaderCircle, { className: "animate-spin w-4 h-4 inline-block mb-px" }) : /* @__PURE__ */ React__default.createElement(LatestVersionWarning, { latestVersionInfo }));
45891
+ return /* @__PURE__ */ React__default.createElement("span", { className: "font-sans font-light text-xs mb-3 mt-4 text-gray-500" }, "TinaCMS v", version$1 + " ", isLoading ? /* @__PURE__ */ React__default.createElement(LoaderCircle, { className: "animate-spin w-4 h-4 inline-block mb-px" }) : /* @__PURE__ */ React__default.createElement(LatestVersionWarning, { latestVersionInfo }));
45892
45892
  };
45893
45893
  const LatestVersionWarning = ({
45894
45894
  latestVersionInfo
@@ -45903,7 +45903,7 @@ const LatestVersionWarning = ({
45903
45903
  if (!latestVersion) {
45904
45904
  return null;
45905
45905
  }
45906
- if (latestVersion === currentVersion) {
45906
+ if (latestVersion === version$1) {
45907
45907
  return /* @__PURE__ */ React__default.createElement(Check, { className: "w-4 h-4 inline-block mb-px text-green-500" });
45908
45908
  }
45909
45909
  return /* @__PURE__ */ React__default.createElement("span", { className: "text-yellow-700" }, /* @__PURE__ */ React__default.createElement(TriangleAlert, { className: "w-4 h-4 inline-block mb-px" }), /* @__PURE__ */ React__default.createElement("br", null), "v", latestVersion, " published ", relativePublishedAt);
@@ -46048,6 +46048,7 @@ const SyncStatusButton = ({
46048
46048
  const Nav = ({
46049
46049
  isLocalMode,
46050
46050
  showHamburger = true,
46051
+ menuIsOpen,
46051
46052
  toggleMenu,
46052
46053
  className = "",
46053
46054
  children,
@@ -46088,9 +46089,24 @@ const Nav = ({
46088
46089
  { Site: [] }
46089
46090
  );
46090
46091
  return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(
46092
+ "button",
46093
+ {
46094
+ className: cn(
46095
+ "fixed pointer-events-auto p-4 hover:bg-gray-100 transition-colors duration-150 ease-in-out rounded z-10",
46096
+ menuIsOpen ? "hidden" : ""
46097
+ ),
46098
+ onClick: () => {
46099
+ toggleMenu();
46100
+ }
46101
+ },
46102
+ /* @__PURE__ */ React.createElement(BiMenu, { className: "h-6 w-auto text-gray-600" })
46103
+ ), /* @__PURE__ */ React.createElement(
46091
46104
  "div",
46092
46105
  {
46093
- className: `relative z-30 flex flex-col bg-white border-r border-gray-200 w-96 h-full ${className}`,
46106
+ className: cn(
46107
+ `relative z-30 flex flex-col bg-white border-r border-gray-200 w-96 h-full ${className}`,
46108
+ menuIsOpen ? "" : "hidden"
46109
+ ),
46094
46110
  style: { maxWidth: `${sidebarWidth}px` },
46095
46111
  ...props
46096
46112
  },
@@ -46098,10 +46114,11 @@ const Nav = ({
46098
46114
  "button",
46099
46115
  {
46100
46116
  className: cn(
46101
- "pointer-events-auto p-2 hover:bg-gray-100 transition-colors duration-150 ease-in-out rounded",
46102
- showHamburger ? "" : "md:hidden"
46117
+ "pointer-events-auto p-2 hover:bg-gray-100 transition-colors duration-150 ease-in-out rounded"
46103
46118
  ),
46104
- onClick: toggleMenu
46119
+ onClick: () => {
46120
+ toggleMenu();
46121
+ }
46105
46122
  },
46106
46123
  /* @__PURE__ */ React.createElement(BiMenu, { className: "h-6 w-auto text-gray-600" })
46107
46124
  ), /* @__PURE__ */ React.createElement("span", { className: "text-left inline-flex items-center text-xl tracking-wide text-gray-800/80 flex-1 gap-1" }, /* @__PURE__ */ React.createElement(TinaIcon, { className: "w-10 h-auto -ml-1 fill-orange-500" }), /* @__PURE__ */ React.createElement("span", null, "TinaCMS"))),
@@ -46921,6 +46938,7 @@ const Sidebar$1 = ({
46921
46938
  Nav,
46922
46939
  {
46923
46940
  isLocalMode: (_d = (_c = cms.api) == null ? void 0 : _c.tina) == null ? void 0 : _d.isLocalMode,
46941
+ menuIsOpen: true,
46924
46942
  toggleMenu,
46925
46943
  showCollections: isTinaAdminEnabled,
46926
46944
  collectionsInfo,
@@ -119771,6 +119789,7 @@ const Sidebar = ({ cms }) => {
119771
119789
  const collectionsInfo = useGetCollections(cms);
119772
119790
  const screens = cms.plugins.getType("screen").all();
119773
119791
  const cloudConfigs = cms.plugins.getType("cloud-config").all();
119792
+ const [menuIsOpen, setMenuIsOpen] = React__default.useState(false);
119774
119793
  const isLocalMode = (_b = (_a2 = cms.api) == null ? void 0 : _a2.tina) == null ? void 0 : _b.isLocalMode;
119775
119794
  const activeScreens = screens.filter(
119776
119795
  (screen) => {
@@ -119783,8 +119802,8 @@ const Sidebar = ({ cms }) => {
119783
119802
  {
119784
119803
  isLocalMode,
119785
119804
  showHamburger: false,
119786
- toggleMenu: () => {
119787
- },
119805
+ menuIsOpen,
119806
+ toggleMenu: () => setMenuIsOpen((menu) => !menu),
119788
119807
  sidebarWidth: 360,
119789
119808
  showCollections: true,
119790
119809
  collectionsInfo,
@@ -9,6 +9,7 @@ interface NavCollection {
9
9
  interface NavProps {
10
10
  isLocalMode: boolean;
11
11
  showHamburger?: boolean;
12
+ menuIsOpen: boolean;
12
13
  toggleMenu: () => void;
13
14
  children?: any;
14
15
  className?: string;
@@ -40,5 +41,5 @@ interface NavProps {
40
41
  };
41
42
  }>;
42
43
  }
43
- export declare const Nav: ({ isLocalMode, showHamburger, toggleMenu, className, children, showCollections, collectionsInfo, screens, cloudConfigs, contentCreators, sidebarWidth, RenderNavSite, RenderNavCloud, RenderNavCollection, AuthRenderNavCollection, ...props }: NavProps) => React.JSX.Element;
44
+ export declare const Nav: ({ isLocalMode, showHamburger, menuIsOpen, toggleMenu, className, children, showCollections, collectionsInfo, screens, cloudConfigs, contentCreators, sidebarWidth, RenderNavSite, RenderNavCloud, RenderNavCollection, AuthRenderNavCollection, ...props }: NavProps) => React.JSX.Element;
44
45
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tinacms",
3
- "version": "2.8.0",
3
+ "version": "2.8.1",
4
4
  "main": "dist/index.js",
5
5
  "module": "./dist/index.mjs",
6
6
  "exports": {