@stacksjs/search-engine 0.48.3 → 0.49.1
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/helpers.d.ts +48 -0
- package/dist/helpers.mjs +1 -0
- package/dist/index.d.ts +34 -2
- package/dist/index.mjs +34 -4
- package/package.json +9 -9
package/dist/helpers.d.ts
CHANGED
|
@@ -43,5 +43,53 @@ export interface SearchEngineStore {
|
|
|
43
43
|
* The hits object returned from the search engine.
|
|
44
44
|
*/
|
|
45
45
|
hits?: Hits<Record<string, any>>;
|
|
46
|
+
/**
|
|
47
|
+
* The search Filter Name
|
|
48
|
+
*/
|
|
49
|
+
filterName?: string;
|
|
50
|
+
/**
|
|
51
|
+
* The search filters
|
|
52
|
+
*/
|
|
53
|
+
filters?: object;
|
|
54
|
+
/**
|
|
55
|
+
* The next page value
|
|
56
|
+
*/
|
|
57
|
+
goToNextPage?: number;
|
|
58
|
+
/**
|
|
59
|
+
* Set to go to a specific page
|
|
60
|
+
*/
|
|
61
|
+
goToPage?: number;
|
|
62
|
+
/**
|
|
63
|
+
* Set to go to the previous page
|
|
64
|
+
*/
|
|
65
|
+
goToPrevPage?: number;
|
|
66
|
+
/**
|
|
67
|
+
* The last page number value
|
|
68
|
+
*/
|
|
69
|
+
lastPageNumber?: number;
|
|
70
|
+
/**
|
|
71
|
+
* The searched term to use for the search
|
|
72
|
+
*/
|
|
73
|
+
search?: string;
|
|
74
|
+
/**
|
|
75
|
+
* The search params filters to use for the search
|
|
76
|
+
*/
|
|
77
|
+
searchFilters?: object;
|
|
78
|
+
/**
|
|
79
|
+
* The search params to use for the search
|
|
80
|
+
*/
|
|
81
|
+
searchParams?: object;
|
|
82
|
+
/**
|
|
83
|
+
* Total hits value to use for the search
|
|
84
|
+
*/
|
|
85
|
+
setTotalHits?: number;
|
|
86
|
+
/**
|
|
87
|
+
* The sort value to use for the search
|
|
88
|
+
*/
|
|
89
|
+
sort?: string;
|
|
90
|
+
/**
|
|
91
|
+
* The sorts value to use for the search
|
|
92
|
+
*/
|
|
93
|
+
sorts?: object;
|
|
46
94
|
}
|
|
47
95
|
export declare function determineState(): SearchEngineStore;
|
package/dist/helpers.mjs
CHANGED
package/dist/index.d.ts
CHANGED
|
@@ -1,12 +1,44 @@
|
|
|
1
|
-
import { client as meilisearch
|
|
1
|
+
import { client as meilisearch } from './drivers/meilisearch';
|
|
2
|
+
export declare const totalPages: any;
|
|
3
|
+
export declare const currentPage: any;
|
|
4
|
+
export declare const filterName: any;
|
|
5
|
+
export declare const filters: any;
|
|
6
|
+
export declare const goToNextPage: any;
|
|
7
|
+
export declare const goToPage: any;
|
|
8
|
+
export declare const goToPrevPage: any;
|
|
9
|
+
export declare const hits: any;
|
|
10
|
+
export declare const index: any;
|
|
11
|
+
export declare const lastPageNumber: any;
|
|
12
|
+
export declare const perPage: any;
|
|
13
|
+
export declare const query: any;
|
|
14
|
+
export declare const results: any;
|
|
15
|
+
export declare const search: any;
|
|
16
|
+
export declare const searchFilters: any;
|
|
17
|
+
export declare const searchParams: any;
|
|
18
|
+
export declare const setTotalHits: any;
|
|
19
|
+
export declare const sort: any;
|
|
20
|
+
export declare const sorts: any;
|
|
2
21
|
export declare function client(): typeof meilisearch | undefined;
|
|
3
22
|
export declare function useSearchEngine(): typeof meilisearch | undefined;
|
|
4
23
|
export declare function calculatePagination(): void;
|
|
5
24
|
declare const _default: {
|
|
6
25
|
useSearchEngine: typeof useSearchEngine;
|
|
7
26
|
client: typeof client;
|
|
8
|
-
search:
|
|
27
|
+
search: any;
|
|
9
28
|
calculatePagination: typeof calculatePagination;
|
|
10
29
|
currentPage: any;
|
|
30
|
+
totalPages: any;
|
|
31
|
+
filterName: any;
|
|
32
|
+
filters: any;
|
|
33
|
+
goToNextPage: any;
|
|
34
|
+
goToPage: any;
|
|
35
|
+
goToPrevPage: any;
|
|
36
|
+
hits: any;
|
|
37
|
+
index: any;
|
|
38
|
+
searchFilters: any;
|
|
39
|
+
searchParams: any;
|
|
40
|
+
setTotalHits: any;
|
|
41
|
+
sort: any;
|
|
42
|
+
sorts: any;
|
|
11
43
|
};
|
|
12
44
|
export default _default;
|
package/dist/index.mjs
CHANGED
|
@@ -1,11 +1,28 @@
|
|
|
1
1
|
import { searchEngine } from "@stacksjs/config";
|
|
2
|
-
import { client as meilisearch
|
|
2
|
+
import { client as meilisearch } from "./drivers/meilisearch.mjs";
|
|
3
3
|
import { determineState } from "./helpers.mjs";
|
|
4
4
|
const table = useStorage("table", determineState()).value;
|
|
5
5
|
const totalHits = table.results?.estimatedTotalHits ?? 1;
|
|
6
6
|
const pages = ref([]);
|
|
7
|
-
const totalPages = ref(0);
|
|
8
|
-
const currentPage = computed(() => table.currentPage);
|
|
7
|
+
export const totalPages = ref(0);
|
|
8
|
+
export const currentPage = computed(() => table.currentPage);
|
|
9
|
+
export const filterName = computed(() => table.filterName);
|
|
10
|
+
export const filters = computed(() => table.filters);
|
|
11
|
+
export const goToNextPage = computed(() => table.goToNextPage);
|
|
12
|
+
export const goToPage = computed(() => table.goToPage);
|
|
13
|
+
export const goToPrevPage = computed(() => table.goToPrevPage);
|
|
14
|
+
export const hits = computed(() => table.hits);
|
|
15
|
+
export const index = computed(() => table.index);
|
|
16
|
+
export const lastPageNumber = computed(() => table.lastPageNumber);
|
|
17
|
+
export const perPage = computed(() => table.perPage);
|
|
18
|
+
export const query = computed(() => table.query);
|
|
19
|
+
export const results = computed(() => table.results);
|
|
20
|
+
export const search = computed(() => table.search);
|
|
21
|
+
export const searchFilters = computed(() => table.searchFilters);
|
|
22
|
+
export const searchParams = computed(() => table.searchParams);
|
|
23
|
+
export const setTotalHits = computed(() => table.setTotalHits);
|
|
24
|
+
export const sort = computed(() => table.sort);
|
|
25
|
+
export const sorts = computed(() => table.sorts);
|
|
9
26
|
export function client() {
|
|
10
27
|
if (searchEngine.driver === "meilisearch")
|
|
11
28
|
return meilisearch;
|
|
@@ -36,5 +53,18 @@ export default {
|
|
|
36
53
|
client,
|
|
37
54
|
search,
|
|
38
55
|
calculatePagination,
|
|
39
|
-
currentPage
|
|
56
|
+
currentPage,
|
|
57
|
+
totalPages,
|
|
58
|
+
filterName,
|
|
59
|
+
filters,
|
|
60
|
+
goToNextPage,
|
|
61
|
+
goToPage,
|
|
62
|
+
goToPrevPage,
|
|
63
|
+
hits,
|
|
64
|
+
index,
|
|
65
|
+
searchFilters,
|
|
66
|
+
searchParams,
|
|
67
|
+
setTotalHits,
|
|
68
|
+
sort,
|
|
69
|
+
sorts
|
|
40
70
|
};
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stacksjs/search-engine",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.
|
|
5
|
-
"packageManager": "pnpm@7.
|
|
4
|
+
"version": "0.49.1",
|
|
5
|
+
"packageManager": "pnpm@7.25.0",
|
|
6
6
|
"description": "The Stacks search engine integrations.",
|
|
7
7
|
"author": "Chris Breuer",
|
|
8
8
|
"license": "MIT",
|
|
@@ -40,20 +40,20 @@
|
|
|
40
40
|
"README.md"
|
|
41
41
|
],
|
|
42
42
|
"engines": {
|
|
43
|
-
"node": ">=v18.
|
|
44
|
-
"pnpm": ">=7.
|
|
43
|
+
"node": ">=v18.13.0",
|
|
44
|
+
"pnpm": ">=7.25.0"
|
|
45
45
|
},
|
|
46
46
|
"peerDependencies": {
|
|
47
|
-
"@vueuse/core": "^9.
|
|
47
|
+
"@vueuse/core": "^9.10.0",
|
|
48
48
|
"meilisearch": "^0.30.0",
|
|
49
49
|
"vue": "^3.2.45",
|
|
50
|
-
"@stacksjs/cli": "0.
|
|
51
|
-
"@stacksjs/config": "0.
|
|
50
|
+
"@stacksjs/cli": "0.49.1",
|
|
51
|
+
"@stacksjs/config": "0.49.1"
|
|
52
52
|
},
|
|
53
53
|
"devDependencies": {
|
|
54
|
-
"mkdist": "^1.
|
|
54
|
+
"mkdist": "^1.1.0",
|
|
55
55
|
"typescript": "^4.9.4",
|
|
56
|
-
"@stacksjs/testing": "0.
|
|
56
|
+
"@stacksjs/testing": "0.49.1"
|
|
57
57
|
},
|
|
58
58
|
"scripts": {
|
|
59
59
|
"build": "mkdist -d",
|