litecms 0.2.3 → 0.2.4
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/admin/CmsBlogAdmin.d.ts.map +1 -1
- package/dist/admin/exports.js +35 -2
- package/dist/admin/language.d.ts.map +1 -1
- package/dist/components/index.js +1 -1
- package/dist/index-qg9tzdst.js +4426 -0
- package/dist/index.js +1 -1
- package/dist/server/index.d.ts +2 -0
- package/dist/server/index.d.ts.map +1 -1
- package/dist/server/index.js +15 -4
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CmsBlogAdmin.d.ts","sourceRoot":"","sources":["../../src/admin/CmsBlogAdmin.tsx"],"names":[],"mappings":"AAYA;;GAEG;AACH,MAAM,MAAM,QAAQ,GAAG;IACnB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,OAAO,GAAG,WAAW,CAAC;IAC9B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,iBAAiB,GAAG;IAC5B,+EAA+E;IAC/E,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,wCAAwC;IACxC,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,uCAAuC;IACvC,OAAO,CAAC,EAAE;QACN,cAAc,EAAE,MAAM,CAAC;QACvB,YAAY,CAAC,EAAE,MAAM,CAAC;KACzB,CAAC;CACL,CAAC;
|
|
1
|
+
{"version":3,"file":"CmsBlogAdmin.d.ts","sourceRoot":"","sources":["../../src/admin/CmsBlogAdmin.tsx"],"names":[],"mappings":"AAYA;;GAEG;AACH,MAAM,MAAM,QAAQ,GAAG;IACnB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,OAAO,GAAG,WAAW,CAAC;IAC9B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,iBAAiB,GAAG;IAC5B,+EAA+E;IAC/E,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,wCAAwC;IACxC,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,uCAAuC;IACvC,OAAO,CAAC,EAAE;QACN,cAAc,EAAE,MAAM,CAAC;QACvB,YAAY,CAAC,EAAE,MAAM,CAAC;KACzB,CAAC;CACL,CAAC;AAokCF;;;GAGG;AACH,wBAAgB,YAAY,CAAC,EACzB,aAAuC,EACvC,iBAA2B,EAC3B,OAAO,GACV,EAAE,iBAAiB,2CA8MnB"}
|
package/dist/admin/exports.js
CHANGED
|
@@ -18,7 +18,7 @@ import {
|
|
|
18
18
|
useCmsLanguage,
|
|
19
19
|
useCmsLanguageOptional,
|
|
20
20
|
useForm
|
|
21
|
-
} from "../index-
|
|
21
|
+
} from "../index-qg9tzdst.js";
|
|
22
22
|
import"../index-wmd953zf.js";
|
|
23
23
|
import {
|
|
24
24
|
createCmsConfig,
|
|
@@ -760,6 +760,15 @@ function formatDate(dateString) {
|
|
|
760
760
|
day: "numeric"
|
|
761
761
|
});
|
|
762
762
|
}
|
|
763
|
+
function toDateTimeLocalValue(dateString) {
|
|
764
|
+
if (!dateString)
|
|
765
|
+
return "";
|
|
766
|
+
const date = new Date(dateString);
|
|
767
|
+
if (Number.isNaN(date.getTime()))
|
|
768
|
+
return "";
|
|
769
|
+
const pad = (value) => String(value).padStart(2, "0");
|
|
770
|
+
return `${date.getFullYear()}-${pad(date.getMonth() + 1)}-${pad(date.getDate())}T${pad(date.getHours())}:${pad(date.getMinutes())}`;
|
|
771
|
+
}
|
|
763
772
|
var Icons = {
|
|
764
773
|
back: /* @__PURE__ */ jsx6("svg", {
|
|
765
774
|
className: "w-4 h-4",
|
|
@@ -1321,6 +1330,7 @@ function BlogEditorView({
|
|
|
1321
1330
|
const [tagsInput, setTagsInput] = React3.useState(post?.tags?.join(", ") ?? "");
|
|
1322
1331
|
const [authorName, setAuthorName] = React3.useState(post?.authorName ?? defaultAuthorName);
|
|
1323
1332
|
const [status, setStatus] = React3.useState(post?.status ?? "draft");
|
|
1333
|
+
const [publishedAt, setPublishedAt] = React3.useState(toDateTimeLocalValue(post?.publishedAt));
|
|
1324
1334
|
const [isSaving, setIsSaving] = React3.useState(false);
|
|
1325
1335
|
const [isDeleting, setIsDeleting] = React3.useState(false);
|
|
1326
1336
|
const [error, setError] = React3.useState(null);
|
|
@@ -1342,6 +1352,7 @@ function BlogEditorView({
|
|
|
1342
1352
|
setTagsInput(post.tags?.join(", ") ?? "");
|
|
1343
1353
|
setAuthorName(post.authorName);
|
|
1344
1354
|
setStatus(post.status);
|
|
1355
|
+
setPublishedAt(toDateTimeLocalValue(post.publishedAt));
|
|
1345
1356
|
}
|
|
1346
1357
|
}, [post]);
|
|
1347
1358
|
async function handleSave(publish = false) {
|
|
@@ -1360,11 +1371,13 @@ function BlogEditorView({
|
|
|
1360
1371
|
coverImage: coverImage || undefined,
|
|
1361
1372
|
content,
|
|
1362
1373
|
tags,
|
|
1363
|
-
authorName
|
|
1374
|
+
authorName,
|
|
1375
|
+
publishedAt: publishedAt ? new Date(publishedAt).toISOString() : undefined
|
|
1364
1376
|
}, publish);
|
|
1365
1377
|
setIsSaving(false);
|
|
1366
1378
|
if (result) {
|
|
1367
1379
|
setStatus(result.status);
|
|
1380
|
+
setPublishedAt(toDateTimeLocalValue(result.publishedAt));
|
|
1368
1381
|
}
|
|
1369
1382
|
}
|
|
1370
1383
|
async function handleDelete() {
|
|
@@ -1578,6 +1591,24 @@ function BlogEditorView({
|
|
|
1578
1591
|
})
|
|
1579
1592
|
]
|
|
1580
1593
|
}),
|
|
1594
|
+
/* @__PURE__ */ jsxs6("div", {
|
|
1595
|
+
children: [
|
|
1596
|
+
/* @__PURE__ */ jsx6("label", {
|
|
1597
|
+
className: "block text-sm font-medium text-neutral-700 mb-1",
|
|
1598
|
+
children: t("blogPublishDate")
|
|
1599
|
+
}),
|
|
1600
|
+
/* @__PURE__ */ jsx6("input", {
|
|
1601
|
+
type: "datetime-local",
|
|
1602
|
+
value: publishedAt,
|
|
1603
|
+
onChange: (e) => setPublishedAt(e.target.value),
|
|
1604
|
+
className: "w-full px-3 py-2 border border-neutral-200 rounded text-sm focus:outline-none focus:border-neutral-400"
|
|
1605
|
+
}),
|
|
1606
|
+
/* @__PURE__ */ jsx6("p", {
|
|
1607
|
+
className: "text-xs text-neutral-400 mt-1",
|
|
1608
|
+
children: t("blogPublishDateHelp")
|
|
1609
|
+
})
|
|
1610
|
+
]
|
|
1611
|
+
}),
|
|
1581
1612
|
/* @__PURE__ */ jsxs6("div", {
|
|
1582
1613
|
children: [
|
|
1583
1614
|
/* @__PURE__ */ jsx6("label", {
|
|
@@ -1724,6 +1755,8 @@ function CmsBlogAdmin({
|
|
|
1724
1755
|
blogContent: "Content",
|
|
1725
1756
|
blogTags: "Tags",
|
|
1726
1757
|
blogAuthor: "Author",
|
|
1758
|
+
blogPublishDate: "Publish date",
|
|
1759
|
+
blogPublishDateHelp: "Set any past date or schedule a future publish.",
|
|
1727
1760
|
blogSaveDraft: "Save Draft",
|
|
1728
1761
|
blogPublish: "Publish",
|
|
1729
1762
|
blogUnpublish: "Unpublish",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"language.d.ts","sourceRoot":"","sources":["../../src/admin/language.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B;;GAEG;AACH,MAAM,MAAM,WAAW,GAAG,IAAI,GAAG,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"language.d.ts","sourceRoot":"","sources":["../../src/admin/language.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B;;GAEG;AACH,MAAM,MAAM,WAAW,GAAG,IAAI,GAAG,IAAI,CAAC;AAqLtC;;;GAGG;AACH,wBAAgB,qBAAqB,IAAI,WAAW,CAOnD;AAED;;GAEG;AACH,wBAAgB,SAAS,CAAC,QAAQ,EAAE,WAAW,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CAEpE;AAED;;GAEG;AACH,KAAK,oBAAoB,GAAG;IACxB,QAAQ,EAAE,WAAW,CAAC;IACtB,WAAW,EAAE,CAAC,IAAI,EAAE,WAAW,KAAK,IAAI,CAAC;IACzC,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,MAAM,CAAC;IAC3B,SAAS,EAAE,OAAO,CAAC;CACtB,CAAC;AAIF;;GAEG;AACH,MAAM,MAAM,wBAAwB,GAAG;IACnC,qDAAqD;IACrD,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,eAAe;IACf,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC7B,CAAC;AAEF;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,EAChC,gBAAwC,EACxC,QAAQ,GACX,EAAE,wBAAwB,2CA2E1B;AAED;;;GAGG;AACH,wBAAgB,cAAc,IAAI,oBAAoB,CAQrD;AAED;;;GAGG;AACH,wBAAgB,sBAAsB,IAAI,oBAAoB,GAAG,IAAI,CAEpE;AAED;;GAEG;AACH,wBAAgB,mBAAmB,4CAkBlC"}
|