@vilio/blog-module 0.0.3 → 0.0.5

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.
Files changed (83) hide show
  1. package/dist/actions/index.d.ts +177 -7
  2. package/dist/actions/index.d.ts.map +1 -0
  3. package/dist/actions/index.js +341 -0
  4. package/dist/actions/index.js.map +1 -0
  5. package/dist/components/BlogStatsWidget.d.ts +2 -2
  6. package/dist/components/BlogStatsWidget.d.ts.map +1 -0
  7. package/dist/components/BlogStatsWidget.js +18 -0
  8. package/dist/components/BlogStatsWidget.js.map +1 -0
  9. package/dist/components/RecentCommentsWidget.d.ts +2 -2
  10. package/dist/components/RecentCommentsWidget.d.ts.map +1 -0
  11. package/dist/components/RecentCommentsWidget.js +25 -0
  12. package/dist/components/RecentCommentsWidget.js.map +1 -0
  13. package/dist/components/RecentPostsWidget.d.ts +2 -2
  14. package/dist/components/RecentPostsWidget.d.ts.map +1 -0
  15. package/dist/components/RecentPostsWidget.js +25 -0
  16. package/dist/components/RecentPostsWidget.js.map +1 -0
  17. package/dist/index.d.ts +2 -0
  18. package/dist/index.d.ts.map +1 -0
  19. package/dist/index.js +108 -0
  20. package/dist/index.js.map +1 -0
  21. package/dist/lib/validation.d.ts +51 -4
  22. package/dist/lib/validation.d.ts.map +1 -0
  23. package/dist/lib/validation.js +57 -0
  24. package/dist/lib/validation.js.map +1 -0
  25. package/dist/navigation.d.ts +1 -0
  26. package/dist/navigation.d.ts.map +1 -0
  27. package/dist/navigation.js +43 -0
  28. package/dist/navigation.js.map +1 -0
  29. package/dist/routes.d.ts +1 -0
  30. package/dist/routes.d.ts.map +1 -0
  31. package/dist/routes.js +121 -0
  32. package/dist/routes.js.map +1 -0
  33. package/dist/schema.d.ts +491 -128
  34. package/dist/schema.d.ts.map +1 -0
  35. package/dist/schema.js +168 -0
  36. package/dist/schema.js.map +1 -0
  37. package/dist/ui/views.d.ts +15 -6
  38. package/dist/ui/views.d.ts.map +1 -0
  39. package/dist/ui/views.js +204 -0
  40. package/dist/ui/views.js.map +1 -0
  41. package/locales/en/global.json +28 -1
  42. package/locales/pl/global.json +36 -9
  43. package/package.json +16 -26
  44. package/dist/actions/index.cjs +0 -158
  45. package/dist/actions/index.mjs +0 -121
  46. package/dist/components/BlogStatsWidget.cjs +0 -45
  47. package/dist/components/BlogStatsWidget.mjs +0 -13
  48. package/dist/components/RecentCommentsWidget.cjs +0 -47
  49. package/dist/components/RecentCommentsWidget.mjs +0 -28
  50. package/dist/components/RecentPostsWidget.cjs +0 -47
  51. package/dist/components/RecentPostsWidget.mjs +0 -28
  52. package/dist/components/ui/button.cjs +0 -54
  53. package/dist/components/ui/button.d.ts +0 -11
  54. package/dist/components/ui/button.mjs +0 -47
  55. package/dist/components/ui/card.cjs +0 -47
  56. package/dist/components/ui/card.d.ts +0 -6
  57. package/dist/components/ui/card.mjs +0 -36
  58. package/dist/components/ui/input.cjs +0 -24
  59. package/dist/components/ui/input.d.ts +0 -5
  60. package/dist/components/ui/input.mjs +0 -17
  61. package/dist/components/ui/table.cjs +0 -68
  62. package/dist/components/ui/table.d.ts +0 -8
  63. package/dist/components/ui/table.mjs +0 -65
  64. package/dist/components/ui/textarea.cjs +0 -22
  65. package/dist/components/ui/textarea.d.ts +0 -5
  66. package/dist/components/ui/textarea.mjs +0 -16
  67. package/dist/index.cjs +0 -102
  68. package/dist/index.mjs +0 -97
  69. package/dist/intl.d.ts +0 -7
  70. package/dist/lib/utils.cjs +0 -11
  71. package/dist/lib/utils.d.ts +0 -2
  72. package/dist/lib/utils.mjs +0 -5
  73. package/dist/lib/validation.cjs +0 -16
  74. package/dist/lib/validation.mjs +0 -10
  75. package/dist/navigation.cjs +0 -23
  76. package/dist/navigation.mjs +0 -21
  77. package/dist/routes.cjs +0 -74
  78. package/dist/routes.mjs +0 -68
  79. package/dist/schema.cjs +0 -62
  80. package/dist/schema.mjs +0 -53
  81. package/dist/styles/globals.css +0 -1
  82. package/dist/ui/views.cjs +0 -448
  83. package/dist/ui/views.mjs +0 -237
@@ -1,47 +0,0 @@
1
- import { Slot } from "@radix-ui/react-slot";
2
- import { cva } from "class-variance-authority";
3
- import * as React from "react";
4
- import { jsx as _jsx } from "react/jsx-runtime";
5
- import { cn } from "../../lib/utils.mjs";
6
-
7
- const buttonVariants = cva(
8
- "inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50",
9
- {
10
- variants: {
11
- variant: {
12
- default:
13
- "bg-primary text-primary-foreground shadow hover:bg-primary/90",
14
- destructive:
15
- "bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",
16
- outline:
17
- "border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground",
18
- secondary:
19
- "bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80",
20
- ghost: "hover:bg-accent hover:text-accent-foreground",
21
- link: "text-primary underline-offset-4 hover:underline",
22
- },
23
- size: {
24
- default: "h-9 px-4 py-2",
25
- sm: "h-8 rounded-md px-3 text-xs",
26
- lg: "h-10 rounded-md px-8",
27
- icon: "size-9",
28
- },
29
- },
30
- defaultVariants: {
31
- variant: "default",
32
- size: "default",
33
- },
34
- },
35
- );
36
- const Button = React.forwardRef(
37
- ({ className, variant, size, asChild = false, ...props }, ref) => {
38
- const Comp = asChild ? Slot : "button";
39
- return _jsx(Comp, {
40
- className: cn(buttonVariants({ variant, size, className })),
41
- ref: ref,
42
- ...props,
43
- });
44
- },
45
- );
46
- Button.displayName = "Button";
47
- export { Button, buttonVariants };
@@ -1,47 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.CardTitle = exports.CardHeader = exports.CardContent = exports.Card = void 0;
7
- var React = _interopRequireWildcard(require("react"));
8
- var _jsxRuntime = require("react/jsx-runtime");
9
- var _utils = require("../../lib/utils.cjs");
10
- function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
11
- function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
12
- const Card = exports.Card = React.forwardRef(({
13
- className,
14
- ...props
15
- }, ref) => (0, _jsxRuntime.jsx)("div", {
16
- ref: ref,
17
- className: (0, _utils.cn)("rounded-xl border bg-card text-card-foreground shadow", className),
18
- ...props
19
- }));
20
- Card.displayName = "Card";
21
- const CardHeader = exports.CardHeader = React.forwardRef(({
22
- className,
23
- ...props
24
- }, ref) => (0, _jsxRuntime.jsx)("div", {
25
- ref: ref,
26
- className: (0, _utils.cn)("flex flex-col space-y-1.5 p-6", className),
27
- ...props
28
- }));
29
- CardHeader.displayName = "CardHeader";
30
- const CardTitle = exports.CardTitle = React.forwardRef(({
31
- className,
32
- ...props
33
- }, ref) => (0, _jsxRuntime.jsx)("div", {
34
- ref: ref,
35
- className: (0, _utils.cn)("font-semibold leading-none tracking-tight", className),
36
- ...props
37
- }));
38
- CardTitle.displayName = "CardTitle";
39
- const CardContent = exports.CardContent = React.forwardRef(({
40
- className,
41
- ...props
42
- }, ref) => (0, _jsxRuntime.jsx)("div", {
43
- ref: ref,
44
- className: (0, _utils.cn)("p-6 pt-0", className),
45
- ...props
46
- }));
47
- CardContent.displayName = "CardContent";
@@ -1,6 +0,0 @@
1
- import * as React from "react";
2
- declare const Card: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
3
- declare const CardHeader: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
4
- declare const CardTitle: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
5
- declare const CardContent: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
6
- export { Card, CardHeader, CardTitle, CardContent };
@@ -1,36 +0,0 @@
1
- import * as React from "react";
2
- import { jsx as _jsx } from "react/jsx-runtime";
3
- import { cn } from "../../lib/utils.mjs";
4
-
5
- const Card = React.forwardRef(({ className, ...props }, ref) =>
6
- _jsx("div", {
7
- ref: ref,
8
- className: cn(
9
- "rounded-xl border bg-card text-card-foreground shadow",
10
- className,
11
- ),
12
- ...props,
13
- }),
14
- );
15
- Card.displayName = "Card";
16
- const CardHeader = React.forwardRef(({ className, ...props }, ref) =>
17
- _jsx("div", {
18
- ref: ref,
19
- className: cn("flex flex-col space-y-1.5 p-6", className),
20
- ...props,
21
- }),
22
- );
23
- CardHeader.displayName = "CardHeader";
24
- const CardTitle = React.forwardRef(({ className, ...props }, ref) =>
25
- _jsx("div", {
26
- ref: ref,
27
- className: cn("font-semibold leading-none tracking-tight", className),
28
- ...props,
29
- }),
30
- );
31
- CardTitle.displayName = "CardTitle";
32
- const CardContent = React.forwardRef(({ className, ...props }, ref) =>
33
- _jsx("div", { ref: ref, className: cn("p-6 pt-0", className), ...props }),
34
- );
35
- CardContent.displayName = "CardContent";
36
- export { Card, CardHeader, CardTitle, CardContent };
@@ -1,24 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.Input = void 0;
7
- var React = _interopRequireWildcard(require("react"));
8
- var _jsxRuntime = require("react/jsx-runtime");
9
- var _utils = require("../../lib/utils.cjs");
10
- function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
11
- function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
12
- const Input = exports.Input = React.forwardRef(({
13
- className,
14
- type,
15
- ...props
16
- }, ref) => {
17
- return (0, _jsxRuntime.jsx)("input", {
18
- type: type,
19
- className: (0, _utils.cn)("flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50", className),
20
- ref: ref,
21
- ...props
22
- });
23
- });
24
- Input.displayName = "Input";
@@ -1,5 +0,0 @@
1
- import * as React from "react";
2
- export interface InputProps extends React.InputHTMLAttributes<HTMLInputElement> {
3
- }
4
- declare const Input: React.ForwardRefExoticComponent<InputProps & React.RefAttributes<HTMLInputElement>>;
5
- export { Input };
@@ -1,17 +0,0 @@
1
- import * as React from "react";
2
- import { jsx as _jsx } from "react/jsx-runtime";
3
- import { cn } from "../../lib/utils.mjs";
4
-
5
- const Input = React.forwardRef(({ className, type, ...props }, ref) => {
6
- return _jsx("input", {
7
- type: type,
8
- className: cn(
9
- "flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",
10
- className,
11
- ),
12
- ref: ref,
13
- ...props,
14
- });
15
- });
16
- Input.displayName = "Input";
17
- export { Input };
@@ -1,68 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.TableRow = exports.TableHeader = exports.TableHead = exports.TableCell = exports.TableBody = exports.Table = void 0;
7
- var React = _interopRequireWildcard(require("react"));
8
- var _jsxRuntime = require("react/jsx-runtime");
9
- var _utils = require("../../lib/utils.cjs");
10
- function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
11
- function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
12
- const Table = exports.Table = React.forwardRef(({
13
- className,
14
- ...props
15
- }, ref) => (0, _jsxRuntime.jsx)("div", {
16
- className: "relative w-full overflow-auto",
17
- children: (0, _jsxRuntime.jsx)("table", {
18
- ref: ref,
19
- className: (0, _utils.cn)("w-full caption-bottom text-sm", className),
20
- ...props
21
- })
22
- }));
23
- Table.displayName = "Table";
24
- const TableHeader = exports.TableHeader = React.forwardRef(({
25
- className,
26
- ...props
27
- }, ref) => (0, _jsxRuntime.jsx)("thead", {
28
- ref: ref,
29
- className: (0, _utils.cn)("[&_tr]:border-b", className),
30
- ...props
31
- }));
32
- TableHeader.displayName = "TableHeader";
33
- const TableBody = exports.TableBody = React.forwardRef(({
34
- className,
35
- ...props
36
- }, ref) => (0, _jsxRuntime.jsx)("tbody", {
37
- ref: ref,
38
- className: (0, _utils.cn)("[&_tr:last-child]:border-0", className),
39
- ...props
40
- }));
41
- TableBody.displayName = "TableBody";
42
- const TableRow = exports.TableRow = React.forwardRef(({
43
- className,
44
- ...props
45
- }, ref) => (0, _jsxRuntime.jsx)("tr", {
46
- ref: ref,
47
- className: (0, _utils.cn)("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted", className),
48
- ...props
49
- }));
50
- TableRow.displayName = "TableRow";
51
- const TableHead = exports.TableHead = React.forwardRef(({
52
- className,
53
- ...props
54
- }, ref) => (0, _jsxRuntime.jsx)("th", {
55
- ref: ref,
56
- className: (0, _utils.cn)("h-10 px-2 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]", className),
57
- ...props
58
- }));
59
- TableHead.displayName = "TableHead";
60
- const TableCell = exports.TableCell = React.forwardRef(({
61
- className,
62
- ...props
63
- }, ref) => (0, _jsxRuntime.jsx)("td", {
64
- ref: ref,
65
- className: (0, _utils.cn)("p-2 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]", className),
66
- ...props
67
- }));
68
- TableCell.displayName = "TableCell";
@@ -1,8 +0,0 @@
1
- import * as React from "react";
2
- declare const Table: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLTableElement> & React.RefAttributes<HTMLTableElement>>;
3
- declare const TableHeader: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLTableSectionElement> & React.RefAttributes<HTMLTableSectionElement>>;
4
- declare const TableBody: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLTableSectionElement> & React.RefAttributes<HTMLTableSectionElement>>;
5
- declare const TableRow: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLTableRowElement> & React.RefAttributes<HTMLTableRowElement>>;
6
- declare const TableHead: React.ForwardRefExoticComponent<React.ThHTMLAttributes<HTMLTableCellElement> & React.RefAttributes<HTMLTableCellElement>>;
7
- declare const TableCell: React.ForwardRefExoticComponent<React.TdHTMLAttributes<HTMLTableCellElement> & React.RefAttributes<HTMLTableCellElement>>;
8
- export { Table, TableHeader, TableBody, TableHead, TableRow, TableCell };
@@ -1,65 +0,0 @@
1
- import * as React from "react";
2
- import { jsx as _jsx } from "react/jsx-runtime";
3
- import { cn } from "../../lib/utils.mjs";
4
-
5
- const Table = React.forwardRef(({ className, ...props }, ref) =>
6
- _jsx("div", {
7
- className: "relative w-full overflow-auto",
8
- children: _jsx("table", {
9
- ref: ref,
10
- className: cn("w-full caption-bottom text-sm", className),
11
- ...props,
12
- }),
13
- }),
14
- );
15
- Table.displayName = "Table";
16
- const TableHeader = React.forwardRef(({ className, ...props }, ref) =>
17
- _jsx("thead", {
18
- ref: ref,
19
- className: cn("[&_tr]:border-b", className),
20
- ...props,
21
- }),
22
- );
23
- TableHeader.displayName = "TableHeader";
24
- const TableBody = React.forwardRef(({ className, ...props }, ref) =>
25
- _jsx("tbody", {
26
- ref: ref,
27
- className: cn("[&_tr:last-child]:border-0", className),
28
- ...props,
29
- }),
30
- );
31
- TableBody.displayName = "TableBody";
32
- const TableRow = React.forwardRef(({ className, ...props }, ref) =>
33
- _jsx("tr", {
34
- ref: ref,
35
- className: cn(
36
- "border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",
37
- className,
38
- ),
39
- ...props,
40
- }),
41
- );
42
- TableRow.displayName = "TableRow";
43
- const TableHead = React.forwardRef(({ className, ...props }, ref) =>
44
- _jsx("th", {
45
- ref: ref,
46
- className: cn(
47
- "h-10 px-2 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",
48
- className,
49
- ),
50
- ...props,
51
- }),
52
- );
53
- TableHead.displayName = "TableHead";
54
- const TableCell = React.forwardRef(({ className, ...props }, ref) =>
55
- _jsx("td", {
56
- ref: ref,
57
- className: cn(
58
- "p-2 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",
59
- className,
60
- ),
61
- ...props,
62
- }),
63
- );
64
- TableCell.displayName = "TableCell";
65
- export { Table, TableHeader, TableBody, TableHead, TableRow, TableCell };
@@ -1,22 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.Textarea = void 0;
7
- var React = _interopRequireWildcard(require("react"));
8
- var _jsxRuntime = require("react/jsx-runtime");
9
- var _utils = require("../../lib/utils.cjs");
10
- function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
11
- function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
12
- const Textarea = exports.Textarea = React.forwardRef(({
13
- className,
14
- ...props
15
- }, ref) => {
16
- return (0, _jsxRuntime.jsx)("textarea", {
17
- className: (0, _utils.cn)("flex min-h-[60px] w-full rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50", className),
18
- ref: ref,
19
- ...props
20
- });
21
- });
22
- Textarea.displayName = "Textarea";
@@ -1,5 +0,0 @@
1
- import * as React from "react";
2
- export interface TextareaProps extends React.TextareaHTMLAttributes<HTMLTextAreaElement> {
3
- }
4
- declare const Textarea: React.ForwardRefExoticComponent<TextareaProps & React.RefAttributes<HTMLTextAreaElement>>;
5
- export { Textarea };
@@ -1,16 +0,0 @@
1
- import * as React from "react";
2
- import { jsx as _jsx } from "react/jsx-runtime";
3
- import { cn } from "../../lib/utils.mjs";
4
-
5
- const Textarea = React.forwardRef(({ className, ...props }, ref) => {
6
- return _jsx("textarea", {
7
- className: cn(
8
- "flex min-h-[60px] w-full rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",
9
- className,
10
- ),
11
- ref: ref,
12
- ...props,
13
- });
14
- });
15
- Textarea.displayName = "Textarea";
16
- export { Textarea };
package/dist/index.cjs DELETED
@@ -1,102 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
-
7
- var _server = require("@vilio/core/server");
8
- var _drizzleOrm = require("drizzle-orm");
9
- var _global = _interopRequireDefault(require("../locales/en/global.json"));
10
- var _global2 = _interopRequireDefault(require("../locales/pl/global.json"));
11
- var _manifest = _interopRequireDefault(require("../manifest.json"));
12
- var _BlogStatsWidget = _interopRequireDefault(require("./components/BlogStatsWidget.cjs"));
13
- var _RecentCommentsWidget = _interopRequireDefault(require("./components/RecentCommentsWidget.cjs"));
14
- var _RecentPostsWidget = _interopRequireDefault(require("./components/RecentPostsWidget.cjs"));
15
- var _navigation = require("./navigation.cjs");
16
- var _routes = require("./routes.cjs");
17
- function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
18
- const BLOG_PERMISSIONS = [{
19
- name: "post:create",
20
- description: "Allow creating blog posts"
21
- }, {
22
- name: "post:update",
23
- description: "Allow updating blog posts"
24
- }, {
25
- name: "post:delete",
26
- description: "Allow deleting blog posts"
27
- }, {
28
- name: "comment:create",
29
- description: "Allow creating comments"
30
- }, {
31
- name: "comment:update",
32
- description: "Allow updating comments"
33
- }, {
34
- name: "comment:delete",
35
- description: "Allow deleting comments"
36
- }];
37
- const blogModule = {
38
- manifest: _manifest.default,
39
- translations: {
40
- en: _global.default,
41
- pl: _global2.default
42
- },
43
- init: async () => {
44
- console.log("[BlogModule] ready.");
45
- },
46
- widgets: [{
47
- id: "blog-stats",
48
- name: "Blog Stats",
49
- area: "dashboard-stats",
50
- component: _BlogStatsWidget.default,
51
- priority: 20
52
- }, {
53
- id: "recent-posts",
54
- name: "Recent Posts",
55
- area: "dashboard-main",
56
- component: _RecentPostsWidget.default,
57
- priority: 20
58
- }, {
59
- id: "recent-comments",
60
- name: "Recent Comments",
61
- area: "dashboard-main",
62
- component: _RecentCommentsWidget.default,
63
- priority: 30
64
- }],
65
- onEnable: async () => {
66
- console.log("[BlogModule] enabling and registering permissions...");
67
- try {
68
- for (const perm of BLOG_PERMISSIONS) {
69
- await (0, _server.createPermission)(perm.name, perm.description);
70
- }
71
- const roles = await (0, _server.getRoles)();
72
- const adminRole = roles.find(r => r.name === "admin");
73
- if (adminRole) {
74
- const blogPermNames = BLOG_PERMISSIONS.map(p => p.name);
75
- const blogPerms = await _server.db.select().from(_server.permissionsTable).where((0, _drizzleOrm.inArray)(_server.permissionsTable.name, blogPermNames));
76
- for (const p of blogPerms) {
77
- await (0, _server.assignPermissionToRole)(adminRole.id, p.id);
78
- }
79
- console.log("[BlogModule] Permissions assigned to admin role.");
80
- }
81
- } catch (error) {
82
- console.error("[BlogModule] Error during permission registration:", error);
83
- }
84
- console.log("[BlogModule] enabled.");
85
- },
86
- onDisable: async () => {
87
- console.log("[Blog] onDisable: Cleaning up tables and permissions...");
88
- try {
89
- const blogPermNames = BLOG_PERMISSIONS.map(p => p.name);
90
- await _server.db.delete(_server.permissionsTable).where((0, _drizzleOrm.inArray)(_server.permissionsTable.name, blogPermNames));
91
- console.log("[BlogModule] Permissions and mappings removed.");
92
- } catch (e) {
93
- console.error("[Blog] onDisable Error:", e);
94
- }
95
- },
96
- routes: {
97
- public: _routes.publicRoutes,
98
- private: _routes.privateRoutes
99
- },
100
- navigation: _navigation.navigation
101
- };
102
- module.exports = blogModule;
package/dist/index.mjs DELETED
@@ -1,97 +0,0 @@
1
- import {
2
- assignPermissionToRole,
3
- createPermission,
4
- db,
5
- getRoles,
6
- permissionsTable
7
- } from "@vilio/core/server";
8
- import { inArray } from "drizzle-orm";
9
- import localesEn from "../locales/en/global.json" with { type: "json" };
10
- import localesPl from "../locales/pl/global.json" with { type: "json" };
11
- import manifest from "../manifest.json" with { type: "json" };
12
- import BlogStatsWidget from "./components/BlogStatsWidget.mjs";
13
- import RecentCommentsWidget from "./components/RecentCommentsWidget.mjs";
14
- import RecentPostsWidget from "./components/RecentPostsWidget.mjs";
15
- import { navigation } from "./navigation.mjs";
16
- import { privateRoutes, publicRoutes } from "./routes.mjs";
17
- const BLOG_PERMISSIONS = [
18
- { name: "post:create", description: "Allow creating blog posts" },
19
- { name: "post:update", description: "Allow updating blog posts" },
20
- { name: "post:delete", description: "Allow deleting blog posts" },
21
- { name: "comment:create", description: "Allow creating comments" },
22
- { name: "comment:update", description: "Allow updating comments" },
23
- { name: "comment:delete", description: "Allow deleting comments" }
24
- ];
25
- const blogModule = {
26
- manifest,
27
- translations: {
28
- en: localesEn,
29
- pl: localesPl
30
- },
31
- init: async () => {
32
- console.log("[BlogModule] ready.");
33
- },
34
- widgets: [
35
- {
36
- id: "blog-stats",
37
- name: "Blog Stats",
38
- area: "dashboard-stats",
39
- component: BlogStatsWidget,
40
- priority: 20
41
- },
42
- {
43
- id: "recent-posts",
44
- name: "Recent Posts",
45
- area: "dashboard-main",
46
- component: RecentPostsWidget,
47
- priority: 20
48
- },
49
- {
50
- id: "recent-comments",
51
- name: "Recent Comments",
52
- area: "dashboard-main",
53
- component: RecentCommentsWidget,
54
- priority: 30
55
- }
56
- ],
57
- onEnable: async () => {
58
- console.log("[BlogModule] enabling and registering permissions...");
59
- try {
60
- for (const perm of BLOG_PERMISSIONS) {
61
- await createPermission(perm.name, perm.description);
62
- }
63
- const roles = await getRoles();
64
- const adminRole = roles.find((r) => r.name === "admin");
65
- if (adminRole) {
66
- const blogPermNames = BLOG_PERMISSIONS.map((p) => p.name);
67
- const blogPerms = await db.select().from(permissionsTable).where(inArray(permissionsTable.name, blogPermNames));
68
- for (const p of blogPerms) {
69
- await assignPermissionToRole(adminRole.id, p.id);
70
- }
71
- console.log("[BlogModule] Permissions assigned to admin role.");
72
- }
73
- } catch (error) {
74
- console.error(
75
- "[BlogModule] Error during permission registration:",
76
- error
77
- );
78
- }
79
- console.log("[BlogModule] enabled.");
80
- },
81
- onDisable: async () => {
82
- console.log("[Blog] onDisable: Cleaning up tables and permissions...");
83
- try {
84
- const blogPermNames = BLOG_PERMISSIONS.map((p) => p.name);
85
- await db.delete(permissionsTable).where(inArray(permissionsTable.name, blogPermNames));
86
- console.log("[BlogModule] Permissions and mappings removed.");
87
- } catch (e) {
88
- console.error("[Blog] onDisable Error:", e);
89
- }
90
- },
91
- routes: {
92
- public: publicRoutes,
93
- private: privateRoutes
94
- },
95
- navigation
96
- };
97
- export default blogModule;
package/dist/intl.d.ts DELETED
@@ -1,7 +0,0 @@
1
- import type messages from "../locales/en/global.json";
2
-
3
- type JsonDataType = typeof messages;
4
-
5
- declare module "@vilio/intl" {
6
- export interface IntlMessages extends JsonDataType { }
7
- }
@@ -1,11 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.cn = cn;
7
- var _clsx = require("clsx");
8
- var _tailwindMerge = require("tailwind-merge");
9
- function cn(...inputs) {
10
- return (0, _tailwindMerge.twMerge)((0, _clsx.clsx)(inputs));
11
- }
@@ -1,2 +0,0 @@
1
- import { type ClassValue } from "clsx";
2
- export declare function cn(...inputs: ClassValue[]): string;
@@ -1,5 +0,0 @@
1
- import { clsx } from "clsx";
2
- import { twMerge } from "tailwind-merge";
3
- export function cn(...inputs) {
4
- return twMerge(clsx(inputs));
5
- }
@@ -1,16 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.postSchema = exports.commentSchema = void 0;
7
- var _zod = require("zod");
8
- const postSchema = exports.postSchema = _zod.z.object({
9
- title: _zod.z.string().min(3, "Title must be at least 3 characters"),
10
- content: _zod.z.string().min(10, "Content must be at least 10 characters"),
11
- slug: _zod.z.string().min(3, "Slug is required")
12
- });
13
- const commentSchema = exports.commentSchema = _zod.z.object({
14
- content: _zod.z.string().min(2, "Comment is too short"),
15
- postId: _zod.z.string().uuid()
16
- });
@@ -1,10 +0,0 @@
1
- import { z } from "zod";
2
- export const postSchema = z.object({
3
- title: z.string().min(3, "Title must be at least 3 characters"),
4
- content: z.string().min(10, "Content must be at least 10 characters"),
5
- slug: z.string().min(3, "Slug is required")
6
- });
7
- export const commentSchema = z.object({
8
- content: z.string().min(2, "Comment is too short"),
9
- postId: z.string().uuid()
10
- });