@skaldapp/shared 1.2.26 → 1.2.28
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.d.ts +2 -4
- package/dist/index.js +7 -5
- package/dist/schemas/credential.d.ts +1 -0
- package/dist/schemas/credential.js +1 -0
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -20,14 +20,12 @@ export type TPage = FromSchema<typeof Page> & {
|
|
|
20
20
|
to?: string;
|
|
21
21
|
};
|
|
22
22
|
export declare const fetching: (input: string) => Promise<any>, sharedStore: {
|
|
23
|
+
kvNodes: Record<string, TPage>;
|
|
24
|
+
nodes: TPage[];
|
|
23
25
|
add: (pId: string) => string | undefined;
|
|
24
26
|
addChild: (pId: string) => string | undefined;
|
|
25
27
|
down: (pId: string) => string | undefined;
|
|
26
|
-
kvNodes: {
|
|
27
|
-
[k: string]: import("@skaldapp/flat-json-tree").unObject;
|
|
28
|
-
} & Record<string, TPage>;
|
|
29
28
|
left: (pId: string) => string | undefined;
|
|
30
|
-
nodes: import("@skaldapp/flat-json-tree").unObject[] & TPage[];
|
|
31
29
|
remove: (pId: string) => string | undefined;
|
|
32
30
|
right: (pId: string) => string | undefined;
|
|
33
31
|
up: (pId: string) => string | undefined;
|
package/dist/index.js
CHANGED
|
@@ -16,7 +16,7 @@ const schemas = [Nodes, Page], ajv = new AJV({
|
|
|
16
16
|
removeAdditional: true,
|
|
17
17
|
schemas,
|
|
18
18
|
useDefaults: true,
|
|
19
|
-
}), immediate = true,
|
|
19
|
+
}), immediate = true, properties = {
|
|
20
20
|
$children: {
|
|
21
21
|
get() {
|
|
22
22
|
return this.children.filter(({ frontmatter: { hidden } }) => !hidden);
|
|
@@ -58,7 +58,7 @@ const schemas = [Nodes, Page], ajv = new AJV({
|
|
|
58
58
|
return this.path?.replace(/^\/?/, "/").replace(/\/?$/, "/");
|
|
59
59
|
},
|
|
60
60
|
},
|
|
61
|
-
}, tree = ref([]), validate = Object.fromEntries(schemas.map(({ $id }) => [$id, ajv.getSchema($id)]));
|
|
61
|
+
}, tree = ref([]), validate = Object.fromEntries(schemas.map(({ $id }) => [$id, ajv.getSchema($id)])), { kvNodes, nodes, ...flatJsonTree } = useFlatJsonTree(tree);
|
|
62
62
|
export const fetching = async (input) => {
|
|
63
63
|
try {
|
|
64
64
|
return await ofetch(input);
|
|
@@ -68,10 +68,12 @@ export const fetching = async (input) => {
|
|
|
68
68
|
}
|
|
69
69
|
}, sharedStore = reactive({
|
|
70
70
|
tree,
|
|
71
|
-
...
|
|
71
|
+
...flatJsonTree,
|
|
72
|
+
kvNodes: kvNodes,
|
|
73
|
+
nodes: nodes,
|
|
72
74
|
});
|
|
73
|
-
watch(toRef(sharedStore, nodes), async (value) => {
|
|
74
|
-
if (!(await validate[nodes]?.(value)))
|
|
75
|
+
watch(toRef(sharedStore, "nodes"), async (value) => {
|
|
76
|
+
if (!(await validate["nodes"]?.(value)))
|
|
75
77
|
tree.value = [{}];
|
|
76
78
|
else
|
|
77
79
|
value.forEach((element) => {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://www.schemastore.org/package",
|
|
3
3
|
"name": "@skaldapp/shared",
|
|
4
|
-
"version": "1.2.
|
|
4
|
+
"version": "1.2.28",
|
|
5
5
|
"description": "A TypeScript library providing reactive data structures, JSON schema validation, and tree utilities for Vue-based applications in the skald ecosystem.",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"vue",
|