miolo 3.0.0-beta.191 → 3.0.0-beta.193
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "miolo",
|
|
3
|
-
"version": "3.0.0-beta.
|
|
3
|
+
"version": "3.0.0-beta.193",
|
|
4
4
|
"description": "all-in-one koa-based server",
|
|
5
5
|
"author": "Donato Lorenzo <donato@afialapis.com>",
|
|
6
6
|
"contributors": [
|
|
@@ -94,7 +94,7 @@
|
|
|
94
94
|
"statuses": "^2.0.2",
|
|
95
95
|
"tailwindcss": "^4.3.0",
|
|
96
96
|
"tinguir": "^0.0.7",
|
|
97
|
-
"vite": "^8.0.
|
|
97
|
+
"vite": "^8.0.12",
|
|
98
98
|
"winston": "^3.19.0",
|
|
99
99
|
"winston-daily-rotate-file": "^5.0.0",
|
|
100
100
|
"yargs-parser": "^22.0.0"
|
package/template/package.json
CHANGED
|
@@ -45,9 +45,9 @@
|
|
|
45
45
|
"intre": "^3.0.0-beta.4",
|
|
46
46
|
"joi": "^18.2.1",
|
|
47
47
|
"lucide-react": "^1.14.0",
|
|
48
|
-
"miolo-cli": "^3.0.0-beta.
|
|
48
|
+
"miolo-cli": "^3.0.0-beta.193",
|
|
49
49
|
"miolo-model": "file:../miolo-model",
|
|
50
|
-
"miolo-react": "^3.0.0-beta.
|
|
50
|
+
"miolo-react": "^3.0.0-beta.193",
|
|
51
51
|
"next-themes": "^0.4.6",
|
|
52
52
|
"radix-ui": "^1.4.3",
|
|
53
53
|
"react": "^19.2.6",
|
|
@@ -62,7 +62,7 @@
|
|
|
62
62
|
},
|
|
63
63
|
"devDependencies": {
|
|
64
64
|
"@biomejs/biome": "2.4.15",
|
|
65
|
-
"miolo": "^3.0.0-beta.
|
|
65
|
+
"miolo": "^3.0.0-beta.193",
|
|
66
66
|
"sass-embedded": "^1.99.0"
|
|
67
67
|
},
|
|
68
68
|
"overrides": {
|
|
@@ -16,6 +16,7 @@ const TodosProvider = ({ children }) => {
|
|
|
16
16
|
refresh: refreshTodoList,
|
|
17
17
|
ready
|
|
18
18
|
} = useSsrData("todos", {
|
|
19
|
+
model: TodoList,
|
|
19
20
|
loader: useCallback(
|
|
20
21
|
async (_context, fetcher) => {
|
|
21
22
|
//setStatus("loading")
|
|
@@ -26,7 +27,7 @@ const TodosProvider = ({ children }) => {
|
|
|
26
27
|
}
|
|
27
28
|
const data = res?.data || []
|
|
28
29
|
//setStatus("loaded")
|
|
29
|
-
return
|
|
30
|
+
return data.sort((a, b) => b.created_at - a.created_at)
|
|
30
31
|
},
|
|
31
32
|
[useCrud, toast]
|
|
32
33
|
)
|
|
@@ -49,9 +50,9 @@ const TodosProvider = ({ children }) => {
|
|
|
49
50
|
toast.error(`Error adding todo: ${res.error}`)
|
|
50
51
|
}
|
|
51
52
|
|
|
52
|
-
todoObject.id = res?.data?.id
|
|
53
|
+
todoObject.id = useCrud ? res?.data : res?.data?.id
|
|
53
54
|
|
|
54
|
-
setTodoList([todoObject, ...todoList])
|
|
55
|
+
setTodoList([todoObject, ...todoList.getData()])
|
|
55
56
|
}
|
|
56
57
|
|
|
57
58
|
addIt()
|
|
@@ -62,9 +63,9 @@ const TodosProvider = ({ children }) => {
|
|
|
62
63
|
const toggleTodo = useCallback(
|
|
63
64
|
(todoId) => {
|
|
64
65
|
async function toggleIt() {
|
|
65
|
-
const nTodoList = [...todoList]
|
|
66
|
+
const nTodoList = [...todoList.getData()]
|
|
66
67
|
const selectedTodoIndex = nTodoList.findIndex((item) => item.id === todoId)
|
|
67
|
-
nTodoList[selectedTodoIndex].
|
|
68
|
+
nTodoList[selectedTodoIndex].done = !nTodoList[selectedTodoIndex].done
|
|
68
69
|
|
|
69
70
|
setTodoList(nTodoList)
|
|
70
71
|
|
|
@@ -87,7 +88,7 @@ const TodosProvider = ({ children }) => {
|
|
|
87
88
|
|
|
88
89
|
const removeTodo = useCallback(
|
|
89
90
|
async (todoId) => {
|
|
90
|
-
const nTodoList = [...todoList]
|
|
91
|
+
const nTodoList = [...todoList.getData()]
|
|
91
92
|
nTodoList.splice(
|
|
92
93
|
nTodoList.findIndex((item) => item.id === todoId),
|
|
93
94
|
1
|