admin-lib-cms 1.0.8 → 1.1.0

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/README.md CHANGED
@@ -85,7 +85,14 @@ Pass whichever adapter you choose into the `<CmsProvider adapter={myAdapter}>`.
85
85
  ```
86
86
  *(If you are developing locally, you can use a workspace reference or file path).*
87
87
 
88
- ### 2. Define your CMS Configuration
88
+ 2. **Tailwind CSS Configuration (Important)**:
89
+ If your project uses Tailwind CSS v4, you must tell the compiler to scan `admin-lib-cms` for styling classes. Open your main CSS file (e.g., `app/globals.css`) and add the `@source` directive right after the tailwind import:
90
+ ```css
91
+ @import "tailwindcss";
92
+ @source "../node_modules/admin-lib-cms";
93
+ ```
94
+
95
+ ### 3. Define your CMS Configuration
89
96
  Create a configuration file (e.g. `cms.config.ts`) to tell the admin panel about your site's structure, the pages that can be edited, and the data collections you want to manage.
90
97
 
91
98
  ```typescript
@@ -122,7 +129,7 @@ export const cmsConfig: CmsConfig = {
122
129
  };
123
130
  ```
124
131
 
125
- ### 3. Wrap your application with the CmsProvider
132
+ ### 4. Wrap your application with the CmsProvider
126
133
  Typically in your `layout.tsx` or `_app.tsx`, pass your adapter and configuration to the provider:
127
134
 
128
135
  ```tsx
@@ -141,7 +148,7 @@ Typically in your `layout.tsx` or `_app.tsx`, pass your adapter and configuratio
141
148
  }
142
149
  ```
143
150
 
144
- 4. Setup Authentication Routes:
151
+ 5. Setup Authentication Routes:
145
152
  `admin-lib-cms` provides a fully featured authentication system (registration, login, and JWT cookies) that works directly with your Storage Adapter. Create an API route at `app/api/admin/auth/route.ts`:
146
153
 
147
154
  ```tsx
@@ -157,7 +164,7 @@ Typically in your `layout.tsx` or `_app.tsx`, pass your adapter and configuratio
157
164
  export const POST = handler;
158
165
  ```
159
166
 
160
- 5. Setup the Admin Pages (Dashboard & Login):
167
+ 6. Setup the Admin Pages (Dashboard & Login):
161
168
  In your app's routing, create the following pages to render the CMS interface.
162
169
 
163
170
  **Dashboard (`app/admin/page.tsx`):**
@@ -179,7 +186,7 @@ Typically in your `layout.tsx` or `_app.tsx`, pass your adapter and configuratio
179
186
  }
180
187
  ```
181
188
 
182
- 6. Make elements editable on your pages:
189
+ 7. Make elements editable on your pages:
183
190
 
184
191
  You can use specific `Editable` components depending on the type of content you want to manage.
185
192
 
package/dist/index.js CHANGED
@@ -1313,8 +1313,8 @@ function CollectionsSection() {
1313
1313
  });
1314
1314
  });
1315
1315
  }, [ctx.adapter, collections]);
1316
- return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "flex h-full bg-slate-50", children: [
1317
- /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "w-72 shrink-0 border-r border-slate-200 bg-white/50 p-4", children: [
1316
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "flex flex-col md:flex-row h-full bg-slate-50", children: [
1317
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "w-full md:w-72 shrink-0 border-b md:border-b-0 md:border-r border-slate-200 bg-white/50 p-4", children: [
1318
1318
  /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "mb-3 px-2 text-xs font-bold uppercase tracking-widest text-slate-500", children: "Collections" }),
1319
1319
  /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("ul", { className: "space-y-1", children: [
1320
1320
  collections.map((c) => /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
@@ -1334,7 +1334,7 @@ function CollectionsSection() {
1334
1334
  collections.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("li", { className: "px-3 py-6 text-center text-sm text-slate-500 bg-slate-50 rounded-lg border border-dashed border-slate-200", children: "No collections registered." })
1335
1335
  ] })
1336
1336
  ] }),
1337
- /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "flex-1 overflow-auto p-8 relative", children: [
1337
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "flex-1 overflow-auto p-4 md:p-8 relative", children: [
1338
1338
  /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "absolute inset-0 bg-grid-slate-100 [mask-image:linear-gradient(0deg,white,rgba(255,255,255,0.6))] -z-10 pointer-events-none" }),
1339
1339
  selected ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(CollectionEditor, { collection: selected }, selected.id) : /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "grid h-full place-items-center text-sm text-slate-500", children: "Select a collection to manage its entries." })
1340
1340
  ] })
@@ -1683,8 +1683,8 @@ function SubmissionsSection() {
1683
1683
  setSelectedFormId(formIds[0]);
1684
1684
  }
1685
1685
  }, [formIds, selectedFormId]);
1686
- return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "flex h-full bg-slate-50", children: [
1687
- /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "w-72 shrink-0 border-r border-slate-200 bg-white/50 p-4", children: [
1686
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "flex flex-col md:flex-row h-full bg-slate-50", children: [
1687
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "w-full md:w-72 shrink-0 border-b md:border-b-0 md:border-r border-slate-200 bg-white/50 p-4", children: [
1688
1688
  /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "mb-3 px-2 text-xs font-bold uppercase tracking-widest text-slate-500", children: "Data Collections" }),
1689
1689
  /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("ul", { className: "space-y-1", children: [
1690
1690
  formIds.map((id) => /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
@@ -1704,7 +1704,7 @@ function SubmissionsSection() {
1704
1704
  formIds.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("li", { className: "px-3 py-6 text-center text-sm text-slate-500 bg-slate-50 rounded-lg border border-dashed border-slate-200", children: "No data collected." })
1705
1705
  ] })
1706
1706
  ] }),
1707
- /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "flex-1 overflow-auto p-8 relative", children: [
1707
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "flex-1 overflow-auto p-4 md:p-8 relative", children: [
1708
1708
  /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "absolute inset-0 bg-grid-slate-100 [mask-image:linear-gradient(0deg,white,rgba(255,255,255,0.6))] -z-10 pointer-events-none" }),
1709
1709
  selectedFormId ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
1710
1710
  SubmissionsList,
package/dist/index.mjs CHANGED
@@ -1310,8 +1310,8 @@ function CollectionsSection() {
1310
1310
  });
1311
1311
  });
1312
1312
  }, [ctx.adapter, collections]);
1313
- return /* @__PURE__ */ jsxs2("div", { className: "flex h-full bg-slate-50", children: [
1314
- /* @__PURE__ */ jsxs2("div", { className: "w-72 shrink-0 border-r border-slate-200 bg-white/50 p-4", children: [
1313
+ return /* @__PURE__ */ jsxs2("div", { className: "flex flex-col md:flex-row h-full bg-slate-50", children: [
1314
+ /* @__PURE__ */ jsxs2("div", { className: "w-full md:w-72 shrink-0 border-b md:border-b-0 md:border-r border-slate-200 bg-white/50 p-4", children: [
1315
1315
  /* @__PURE__ */ jsx5("div", { className: "mb-3 px-2 text-xs font-bold uppercase tracking-widest text-slate-500", children: "Collections" }),
1316
1316
  /* @__PURE__ */ jsxs2("ul", { className: "space-y-1", children: [
1317
1317
  collections.map((c) => /* @__PURE__ */ jsx5("li", { children: /* @__PURE__ */ jsxs2(
@@ -1331,7 +1331,7 @@ function CollectionsSection() {
1331
1331
  collections.length === 0 && /* @__PURE__ */ jsx5("li", { className: "px-3 py-6 text-center text-sm text-slate-500 bg-slate-50 rounded-lg border border-dashed border-slate-200", children: "No collections registered." })
1332
1332
  ] })
1333
1333
  ] }),
1334
- /* @__PURE__ */ jsxs2("div", { className: "flex-1 overflow-auto p-8 relative", children: [
1334
+ /* @__PURE__ */ jsxs2("div", { className: "flex-1 overflow-auto p-4 md:p-8 relative", children: [
1335
1335
  /* @__PURE__ */ jsx5("div", { className: "absolute inset-0 bg-grid-slate-100 [mask-image:linear-gradient(0deg,white,rgba(255,255,255,0.6))] -z-10 pointer-events-none" }),
1336
1336
  selected ? /* @__PURE__ */ jsx5(CollectionEditor, { collection: selected }, selected.id) : /* @__PURE__ */ jsx5("div", { className: "grid h-full place-items-center text-sm text-slate-500", children: "Select a collection to manage its entries." })
1337
1337
  ] })
@@ -1680,8 +1680,8 @@ function SubmissionsSection() {
1680
1680
  setSelectedFormId(formIds[0]);
1681
1681
  }
1682
1682
  }, [formIds, selectedFormId]);
1683
- return /* @__PURE__ */ jsxs2("div", { className: "flex h-full bg-slate-50", children: [
1684
- /* @__PURE__ */ jsxs2("div", { className: "w-72 shrink-0 border-r border-slate-200 bg-white/50 p-4", children: [
1683
+ return /* @__PURE__ */ jsxs2("div", { className: "flex flex-col md:flex-row h-full bg-slate-50", children: [
1684
+ /* @__PURE__ */ jsxs2("div", { className: "w-full md:w-72 shrink-0 border-b md:border-b-0 md:border-r border-slate-200 bg-white/50 p-4", children: [
1685
1685
  /* @__PURE__ */ jsx5("div", { className: "mb-3 px-2 text-xs font-bold uppercase tracking-widest text-slate-500", children: "Data Collections" }),
1686
1686
  /* @__PURE__ */ jsxs2("ul", { className: "space-y-1", children: [
1687
1687
  formIds.map((id) => /* @__PURE__ */ jsx5("li", { children: /* @__PURE__ */ jsxs2(
@@ -1701,7 +1701,7 @@ function SubmissionsSection() {
1701
1701
  formIds.length === 0 && /* @__PURE__ */ jsx5("li", { className: "px-3 py-6 text-center text-sm text-slate-500 bg-slate-50 rounded-lg border border-dashed border-slate-200", children: "No data collected." })
1702
1702
  ] })
1703
1703
  ] }),
1704
- /* @__PURE__ */ jsxs2("div", { className: "flex-1 overflow-auto p-8 relative", children: [
1704
+ /* @__PURE__ */ jsxs2("div", { className: "flex-1 overflow-auto p-4 md:p-8 relative", children: [
1705
1705
  /* @__PURE__ */ jsx5("div", { className: "absolute inset-0 bg-grid-slate-100 [mask-image:linear-gradient(0deg,white,rgba(255,255,255,0.6))] -z-10 pointer-events-none" }),
1706
1706
  selectedFormId ? /* @__PURE__ */ jsx5(
1707
1707
  SubmissionsList,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "admin-lib-cms",
3
- "version": "1.0.8",
3
+ "version": "1.1.0",
4
4
  "description": "Agnostic Admin CMS Library",
5
5
  "keywords": [
6
6
  "cms",