@vicacha-devs/strapi-plugin-global-search 0.0.0-stage → 2.0.3
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/LICENSE +21 -0
- package/README.md +136 -2
- package/dist/admin/index.d.ts +2 -0
- package/dist/admin/index.js +2310 -0
- package/dist/admin/index.js.map +7 -0
- package/dist/admin/index.mjs +2310 -0
- package/dist/admin/index.mjs.map +7 -0
- package/dist/admin/translations/ar.json +89 -0
- package/dist/admin/translations/en.json +89 -0
- package/dist/admin/translations/es.json +89 -0
- package/dist/admin/translations/fr.json +89 -0
- package/dist/admin/translations/tr.json +89 -0
- package/dist/server/bootstrap.d.ts +6 -0
- package/dist/server/bootstrap.d.ts.map +1 -0
- package/dist/server/config/index.d.ts +15 -0
- package/dist/server/config/index.d.ts.map +1 -0
- package/dist/server/controllers/index.d.ts +94 -0
- package/dist/server/controllers/index.d.ts.map +1 -0
- package/dist/server/controllers/schema.d.ts +24 -0
- package/dist/server/controllers/schema.d.ts.map +1 -0
- package/dist/server/controllers/search.d.ts +21 -0
- package/dist/server/controllers/search.d.ts.map +1 -0
- package/dist/server/controllers/settings.d.ts +23 -0
- package/dist/server/controllers/settings.d.ts.map +1 -0
- package/dist/server/index.d.ts +212 -0
- package/dist/server/index.d.ts.map +1 -0
- package/dist/server/index.js +1186 -0
- package/dist/server/index.js.map +7 -0
- package/dist/server/index.mjs +1186 -0
- package/dist/server/index.mjs.map +7 -0
- package/dist/server/register.d.ts +6 -0
- package/dist/server/register.d.ts.map +1 -0
- package/dist/server/routes/index.d.ts +20 -0
- package/dist/server/routes/index.d.ts.map +1 -0
- package/dist/server/services/index.d.ts +89 -0
- package/dist/server/services/index.d.ts.map +1 -0
- package/dist/server/services/permissions.d.ts +13 -0
- package/dist/server/services/permissions.d.ts.map +1 -0
- package/dist/server/services/query.d.ts +25 -0
- package/dist/server/services/query.d.ts.map +1 -0
- package/dist/server/services/ranking.d.ts +27 -0
- package/dist/server/services/ranking.d.ts.map +1 -0
- package/dist/server/services/schema.d.ts +70 -0
- package/dist/server/services/schema.d.ts.map +1 -0
- package/dist/server/services/search.d.ts +36 -0
- package/dist/server/services/search.d.ts.map +1 -0
- package/dist/server/services/settings.d.ts +15 -0
- package/dist/server/services/settings.d.ts.map +1 -0
- package/dist/server/types.d.ts +195 -0
- package/dist/server/types.d.ts.map +1 -0
- package/dist/server/utils/async.d.ts +8 -0
- package/dist/server/utils/async.d.ts.map +1 -0
- package/dist/server/utils/constants.d.ts +42 -0
- package/dist/server/utils/constants.d.ts.map +1 -0
- package/dist/server/utils/text.d.ts +20 -0
- package/dist/server/utils/text.d.ts.map +1 -0
- package/package.json +79 -3
|
@@ -0,0 +1,2310 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __glob = (map) => (path) => {
|
|
8
|
+
var fn = map[path];
|
|
9
|
+
if (fn) return fn();
|
|
10
|
+
throw new Error("Module not found in bundle: " + path);
|
|
11
|
+
};
|
|
12
|
+
var __esm = (fn, res) => function __init() {
|
|
13
|
+
return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
|
|
14
|
+
};
|
|
15
|
+
var __commonJS = (cb, mod) => function __require() {
|
|
16
|
+
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
17
|
+
};
|
|
18
|
+
var __export = (target, all) => {
|
|
19
|
+
for (var name in all)
|
|
20
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
21
|
+
};
|
|
22
|
+
var __copyProps = (to, from, except, desc) => {
|
|
23
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
24
|
+
for (let key of __getOwnPropNames(from))
|
|
25
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
26
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
27
|
+
}
|
|
28
|
+
return to;
|
|
29
|
+
};
|
|
30
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
31
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
32
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
33
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
34
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
35
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
36
|
+
mod
|
|
37
|
+
));
|
|
38
|
+
|
|
39
|
+
// admin/src/pluginId.ts
|
|
40
|
+
var pluginId, pluginId_default;
|
|
41
|
+
var init_pluginId = __esm({
|
|
42
|
+
"admin/src/pluginId.ts"() {
|
|
43
|
+
"use strict";
|
|
44
|
+
pluginId = "global-search";
|
|
45
|
+
pluginId_default = pluginId;
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
// admin/src/translations/ar.json
|
|
50
|
+
var require_ar = __commonJS({
|
|
51
|
+
"admin/src/translations/ar.json"(exports, module) {
|
|
52
|
+
module.exports = {
|
|
53
|
+
"plugin.name": "\u0627\u0644\u0628\u062D\u062B \u0627\u0644\u0634\u0627\u0645\u0644",
|
|
54
|
+
"plugin.description": "\u0627\u0628\u062D\u062B \u0641\u064A \u062C\u0645\u064A\u0639 \u0623\u0646\u0648\u0627\u0639 \u0627\u0644\u0645\u062D\u062A\u0648\u0649 \u0645\u0646 \u0645\u0643\u0627\u0646 \u0648\u0627\u062D\u062F.",
|
|
55
|
+
"settings.section": "\u0627\u0644\u0628\u062D\u062B \u0627\u0644\u0634\u0627\u0645\u0644",
|
|
56
|
+
"settings.link": "\u0627\u0644\u0625\u0639\u062F\u0627\u062F\u0627\u062A",
|
|
57
|
+
"common.searching": "\u062C\u0627\u0631\u064D \u0627\u0644\u0628\u062D\u062B\u2026",
|
|
58
|
+
"common.no_results": "\u0644\u0627 \u062A\u0648\u062C\u062F \u0646\u062A\u0627\u0626\u062C \u0644\u0640 \u201C{query}\u201D.",
|
|
59
|
+
"common.on": "\u062A\u0641\u0639\u064A\u0644",
|
|
60
|
+
"common.off": "\u0625\u064A\u0642\u0627\u0641",
|
|
61
|
+
"common.none": "\u0644\u0627 \u064A\u0648\u062C\u062F",
|
|
62
|
+
"palette.title": "\u0627\u0644\u0628\u062D\u062B \u0627\u0644\u0634\u0627\u0645\u0644",
|
|
63
|
+
"palette.placeholder": "\u0627\u0628\u062D\u062B \u0641\u064A \u0643\u0644 \u0627\u0644\u0645\u062D\u062A\u0648\u0649\u2026",
|
|
64
|
+
"palette.min_chars": "\u0627\u0643\u062A\u0628 {count} \u0623\u062D\u0631\u0641 \u0639\u0644\u0649 \u0627\u0644\u0623\u0642\u0644 \u0644\u0644\u0628\u062D\u062B.",
|
|
65
|
+
"palette.idle_hint": "\u0627\u0628\u062D\u062B \u0641\u064A \u0643\u0644 \u0646\u0648\u0639 \u0645\u062C\u0645\u0648\u0639\u0629 \u0648\u0646\u0648\u0639 \u0645\u0641\u0631\u062F \u062D\u0633\u0628 \u0627\u0644\u0645\u0639\u0631\u0651\u0641 \u0623\u0648 \u0627\u0644\u0627\u0633\u0645 \u0623\u0648 \u0623\u064A \u062D\u0642\u0644 \u0646\u0635\u064A.",
|
|
66
|
+
"palette.error": "\u0641\u0634\u0644 \u0627\u0644\u0628\u062D\u062B. \u062A\u062D\u0642\u0642 \u0645\u0646 \u0635\u0644\u0627\u062D\u064A\u0627\u062A \u0627\u0644\u0642\u0631\u0627\u0621\u0629 \u0648\u0631\u0627\u062C\u0639 \u0633\u062C\u0644\u0627\u062A \u0627\u0644\u062E\u0627\u062F\u0645.",
|
|
67
|
+
"palette.results_aria": "\u0646\u062A\u0627\u0626\u062C \u0627\u0644\u0628\u062D\u062B",
|
|
68
|
+
"palette.shortcuts_hint": "\u2191 \u2193 \u0644\u0644\u062A\u0646\u0642\u0644 \xB7 \u21B5 \u0644\u0644\u0641\u062A\u062D \xB7 \u2318/Ctrl + \u21B5 \u0639\u0644\u0627\u0645\u0629 \u062A\u0628\u0648\u064A\u0628 \u062C\u062F\u064A\u062F\u0629 \xB7 esc \u0644\u0644\u0625\u063A\u0644\u0627\u0642",
|
|
69
|
+
"palette.result_count": "{count} \u0646\u062A\u0627\u0626\u062C",
|
|
70
|
+
"page.subtitle_ready": "\u0627\u0644\u0628\u062D\u062B \u0641\u064A {count} \u0623\u0646\u0648\u0627\u0639 \u0645\u062D\u062A\u0648\u0649 \xB7 \u0627\u0636\u063A\u0637 Ctrl/Cmd + K \u0641\u064A \u0623\u064A \u0645\u0643\u0627\u0646",
|
|
71
|
+
"page.subtitle_loading": "\u062C\u0627\u0631\u064D \u0627\u0643\u062A\u0634\u0627\u0641 \u0623\u0646\u0648\u0627\u0639 \u0627\u0644\u0645\u062D\u062A\u0648\u0649\u2026",
|
|
72
|
+
"page.open_palette": "\u0641\u062A\u062D \u0644\u0648\u062D\u0629 \u0627\u0644\u0628\u062D\u062B (\u2318K)",
|
|
73
|
+
"page.clear_search": "\u0645\u0633\u062D \u0627\u0644\u0628\u062D\u062B",
|
|
74
|
+
"page.search_placeholder": "\u0627\u0628\u062D\u062B \u0628\u0627\u0644\u0645\u0639\u0631\u0651\u0641 \u0623\u0648 \u0627\u0644\u0627\u0633\u0645 \u0623\u0648 \u0623\u064A \u062D\u0642\u0644 \u0646\u0635\u064A\u2026",
|
|
75
|
+
"page.search_label": "\u0627\u0628\u062D\u062B \u0641\u064A \u0643\u0644 \u0627\u0644\u0645\u062D\u062A\u0648\u0649",
|
|
76
|
+
"page.content_types_aria": "\u0623\u0646\u0648\u0627\u0639 \u0627\u0644\u0645\u062D\u062A\u0648\u0649",
|
|
77
|
+
"page.all_content_types": "\u062C\u0645\u064A\u0639 \u0623\u0646\u0648\u0627\u0639 \u0627\u0644\u0645\u062D\u062A\u0648\u0649",
|
|
78
|
+
"page.clear_type_filters": "\u0645\u0633\u062D \u0641\u0644\u0627\u062A\u0631 \u0623\u0646\u0648\u0627\u0639 \u0627\u0644\u0645\u062D\u062A\u0648\u0649",
|
|
79
|
+
"page.all_locales": "\u062C\u0645\u064A\u0639 \u0627\u0644\u0644\u063A\u0627\u062A",
|
|
80
|
+
"page.error": "\u0641\u0634\u0644 \u0627\u0644\u0628\u062D\u062B. \u062A\u062D\u0642\u0642 \u0645\u0646 \u0635\u0644\u0627\u062D\u064A\u0627\u062A \u0627\u0644\u0642\u0631\u0627\u0621\u0629 \u0648\u0631\u0627\u062C\u0639 \u0633\u062C\u0644\u0627\u062A \u0627\u0644\u062E\u0627\u062F\u0645 \u0644\u0644\u062A\u0641\u0627\u0635\u064A\u0644.",
|
|
81
|
+
"page.idle_title": "\u0627\u0628\u062D\u062B \u0641\u064A \u0643\u0644 \u0646\u0648\u0639 \u0645\u062C\u0645\u0648\u0639\u0629 \u0648\u0646\u0648\u0639 \u0645\u0641\u0631\u062F \u0641\u064A \u0647\u0630\u0627 \u0627\u0644\u0645\u0634\u0631\u0648\u0639.",
|
|
82
|
+
"page.idle_subtitle": "\u062A\u064F\u0631\u062A\u0628 \u0627\u0644\u0646\u062A\u0627\u0626\u062C \u062D\u0633\u0628 \u0627\u0644\u0645\u0639\u0631\u0651\u0641 \u062B\u0645 \u0627\u0644\u0627\u0633\u0645 \u062B\u0645 \u0623\u064A \u062D\u0642\u0644 \u0622\u062E\u0631 \u2014 \u0628\u0645\u0627 \u0641\u064A \u0630\u0644\u0643 \u0627\u0644\u062D\u0642\u0648\u0644 \u0627\u0644\u0645\u062A\u062F\u0627\u062E\u0644\u0629 \u062F\u0627\u062E\u0644 \u0627\u0644\u0645\u0643\u0648\u0646\u0627\u062A. \u0627\u0636\u063A\u0637 Ctrl/Cmd + K \u0644\u0641\u062A\u062D \u0627\u0644\u0644\u0648\u062D\u0629 \u0627\u0644\u0633\u0631\u064A\u0639\u0629.",
|
|
83
|
+
"page.no_results_clear_filters": "\u062C\u0631\u0651\u0628 \u0645\u0633\u062D \u0641\u0644\u0627\u062A\u0631 \u0623\u0646\u0648\u0627\u0639 \u0627\u0644\u0645\u062D\u062A\u0648\u0649.",
|
|
84
|
+
"page.no_results_try_different": "\u062C\u0631\u0651\u0628 \u0645\u0635\u0637\u0644\u062D\u0627\u064B \u0623\u0642\u0635\u0631 \u0623\u0648 \u0645\u062E\u062A\u0644\u0641\u0627\u064B.",
|
|
85
|
+
"page.results_summary": "{total} \u0646\u062A\u0627\u0626\u062C \u0639\u0628\u0631 {groups} \u0623\u0646\u0648\u0627\u0639 \u0645\u062D\u062A\u0648\u0649",
|
|
86
|
+
"page.truncated_notice": " \xB7 \u0623\u0631\u062C\u0639\u062A \u0628\u0639\u0636 \u0627\u0644\u0623\u0646\u0648\u0627\u0639 \u0623\u0643\u062B\u0631 \u0645\u0646 \u0627\u0644\u062D\u062F \u0627\u0644\u0623\u0642\u0635\u0649 \u0644\u0643\u0644 \u0646\u0648\u0639",
|
|
87
|
+
"page.results_per_page": "\u0627\u0644\u0646\u062A\u0627\u0626\u062C \u0644\u0643\u0644 \u0635\u0641\u062D\u0629",
|
|
88
|
+
"page.per_page_option": "{size} / \u0635\u0641\u062D\u0629",
|
|
89
|
+
"page.previous": "\u0627\u0644\u0633\u0627\u0628\u0642",
|
|
90
|
+
"page.page_of": "\u0635\u0641\u062D\u0629 {page} \u0645\u0646 {pageCount}",
|
|
91
|
+
"page.next": "\u0627\u0644\u062A\u0627\u0644\u064A",
|
|
92
|
+
"table.type": "\u0627\u0644\u0646\u0648\u0639",
|
|
93
|
+
"table.id": "\u0627\u0644\u0645\u0639\u0631\u0651\u0641",
|
|
94
|
+
"table.name": "\u0627\u0644\u0627\u0633\u0645",
|
|
95
|
+
"table.matched": "\u0627\u0644\u0645\u0637\u0627\u0628\u0642\u0629",
|
|
96
|
+
"table.locale": "\u0627\u0644\u0644\u063A\u0629",
|
|
97
|
+
"table.status": "\u0627\u0644\u062D\u0627\u0644\u0629",
|
|
98
|
+
"table.updated": "\u062A\u0627\u0631\u064A\u062E \u0627\u0644\u062A\u062D\u062F\u064A\u062B",
|
|
99
|
+
"settings.subtitle": "\u0627\u0636\u0628\u0637 \u0643\u064A\u0641\u064A\u0629 \u0627\u0633\u062A\u0639\u0644\u0627\u0645 \u0635\u0641\u062D\u0629 \u0627\u0644\u0628\u062D\u062B \u0648\u0644\u0648\u062D\u0629 Ctrl/Cmd + K \u0639\u0646 \u0627\u0644\u0645\u062D\u062A\u0648\u0649.",
|
|
100
|
+
"settings.restore_defaults": "\u0627\u0633\u062A\u0639\u0627\u062F\u0629 \u0627\u0644\u0627\u0641\u062A\u0631\u0627\u0636\u064A\u0627\u062A",
|
|
101
|
+
"settings.save": "\u062D\u0641\u0638",
|
|
102
|
+
"settings.behaviour_title": "\u0633\u0644\u0648\u0643 \u0627\u0644\u0628\u062D\u062B",
|
|
103
|
+
"settings.min_chars_label": "\u0627\u0644\u062D\u062F \u0627\u0644\u0623\u062F\u0646\u0649 \u0644\u0644\u0623\u062D\u0631\u0641",
|
|
104
|
+
"settings.min_chars_hint": "\u0627\u0644\u0627\u0633\u062A\u0639\u0644\u0627\u0645\u0627\u062A \u0627\u0644\u0623\u0642\u0635\u0631 \u0644\u0627 \u062A\u064F\u0631\u0633\u0644 \u0625\u0644\u0649 \u0627\u0644\u062E\u0627\u062F\u0645.",
|
|
105
|
+
"settings.debounce_label": "\u0645\u0647\u0644\u0629 \u0627\u0644\u0627\u0646\u062A\u0638\u0627\u0631 (\u0645\u0644\u0644\u064A \u062B\u0627\u0646\u064A\u0629)",
|
|
106
|
+
"settings.debounce_hint": "\u0645\u062F\u0629 \u0627\u0644\u0627\u0646\u062A\u0638\u0627\u0631 \u0628\u0639\u062F \u0622\u062E\u0631 \u0636\u063A\u0637\u0629 \u0645\u0641\u062A\u0627\u062D.",
|
|
107
|
+
"settings.per_type_limit_label": "\u0627\u0644\u0646\u062A\u0627\u0626\u062C \u0644\u0643\u0644 \u0646\u0648\u0639 \u0645\u062D\u062A\u0648\u0649",
|
|
108
|
+
"settings.per_type_limit_hint": "\u0639\u062F\u062F \u0627\u0644\u0635\u0641\u0648\u0641 \u0627\u0644\u0645\u062C\u0644\u0648\u0628\u0629 \u0645\u0646 \u0643\u0644 \u0646\u0648\u0639.",
|
|
109
|
+
"settings.max_results_label": "\u0627\u0644\u062D\u062F \u0627\u0644\u0623\u0642\u0635\u0649 \u0644\u0644\u0646\u062A\u0627\u0626\u062C",
|
|
110
|
+
"settings.max_results_hint": "\u0627\u0644\u062D\u062F \u0627\u0644\u0623\u0642\u0635\u0649 \u0644\u0644\u0642\u0627\u0626\u0645\u0629 \u0627\u0644\u0645\u062F\u0645\u062C\u0629 \u0648\u0627\u0644\u0645\u0631\u062A\u0628\u0629.",
|
|
111
|
+
"settings.max_depth_label": "\u0639\u0645\u0642 \u0627\u0644\u0645\u0643\u0648\u0646\u0627\u062A",
|
|
112
|
+
"settings.max_depth_hint": "\u0639\u062F\u062F \u0645\u0633\u062A\u0648\u064A\u0627\u062A \u0627\u0644\u0645\u0643\u0648\u0646\u0627\u062A \u0627\u0644\u062A\u064A \u064A\u062A\u0645 \u0627\u0644\u0628\u062D\u062B \u0628\u062F\u0627\u062E\u0644\u0647\u0627.",
|
|
113
|
+
"settings.query_timeout_label": "\u0645\u0647\u0644\u0629 \u0627\u0644\u0627\u0633\u062A\u0639\u0644\u0627\u0645 (\u0645\u0644\u0644\u064A \u062B\u0627\u0646\u064A\u0629)",
|
|
114
|
+
"settings.query_timeout_hint": "\u064A\u062A\u0645 \u062A\u062E\u0637\u064A \u0646\u0648\u0639 \u0627\u0644\u0645\u062D\u062A\u0648\u0649 \u0627\u0644\u0623\u0628\u0637\u0623.",
|
|
115
|
+
"settings.concurrency_label": "\u0627\u0644\u062A\u0632\u0627\u0645\u0646",
|
|
116
|
+
"settings.concurrency_hint": "\u0627\u0644\u062D\u062F \u0627\u0644\u0623\u0642\u0635\u0649 \u0644\u0623\u0646\u0648\u0627\u0639 \u0627\u0644\u0645\u062D\u062A\u0648\u0649 \u0627\u0644\u0645\u0633\u062A\u0639\u0644\u0645 \u0639\u0646\u0647\u0627 \u0628\u0627\u0644\u062A\u0648\u0627\u0632\u064A.",
|
|
117
|
+
"settings.deep_label": "\u0627\u0644\u0628\u062D\u062B \u062F\u0627\u062E\u0644 \u0627\u0644\u0645\u0643\u0648\u0646\u0627\u062A",
|
|
118
|
+
"settings.deep_hint": "\u0645\u0637\u0627\u0628\u0642\u0629 \u0627\u0644\u062D\u0642\u0648\u0644 \u0627\u0644\u0645\u062A\u062F\u0627\u062E\u0644\u0629 \u0641\u064A \u0627\u0644\u0645\u0643\u0648\u0646\u0627\u062A \u0623\u064A\u0636\u0627\u064B.",
|
|
119
|
+
"settings.drafts_label": "\u062A\u0636\u0645\u064A\u0646 \u0627\u0644\u0645\u0633\u0648\u062F\u0627\u062A",
|
|
120
|
+
"settings.drafts_hint": "\u0627\u0644\u0628\u062D\u062B \u0641\u064A \u0627\u0644\u0625\u062F\u062E\u0627\u0644\u0627\u062A \u063A\u064A\u0631 \u0627\u0644\u0645\u0646\u0634\u0648\u0631\u0629 \u0623\u064A\u0636\u0627\u064B.",
|
|
121
|
+
"settings.plugins_label": "\u062A\u0636\u0645\u064A\u0646 \u0623\u0646\u0648\u0627\u0639 \u0645\u062D\u062A\u0648\u0649 \u0627\u0644\u0625\u0636\u0627\u0641\u0627\u062A",
|
|
122
|
+
"settings.plugins_hint": "\u0627\u0644\u0628\u062D\u062B \u0623\u064A\u0636\u0627\u064B \u0641\u064A \u0623\u0646\u0648\u0627\u0639 \u0627\u0644\u0645\u062D\u062A\u0648\u0649 \u0627\u0644\u0645\u0631\u0626\u064A\u0629 \u0627\u0644\u0645\u0633\u062C\u0644\u0629 \u0628\u0648\u0627\u0633\u0637\u0629 \u0627\u0644\u0625\u0636\u0627\u0641\u0627\u062A.",
|
|
123
|
+
"settings.content_types_title": "\u0623\u0646\u0648\u0627\u0639 \u0627\u0644\u0645\u062D\u062A\u0648\u0649",
|
|
124
|
+
"settings.content_types_hint": "\u064A\u062A\u0645 \u0627\u0643\u062A\u0634\u0627\u0641 \u0643\u0644 \u0646\u0648\u0639 \u0645\u062D\u062A\u0648\u0649 \u062A\u0644\u0642\u0627\u0626\u064A\u0627\u064B. \u0623\u0648\u0642\u0641 \u0623\u064A \u0646\u0648\u0639 \u0644\u0627\u0633\u062A\u0628\u0639\u0627\u062F\u0647 \u0645\u0646 \u0646\u062A\u0627\u0626\u062C \u0627\u0644\u0628\u062D\u062B.",
|
|
125
|
+
"settings.col_content_type": "\u0646\u0648\u0639 \u0627\u0644\u0645\u062D\u062A\u0648\u0649",
|
|
126
|
+
"settings.col_kind": "\u0627\u0644\u0641\u0626\u0629",
|
|
127
|
+
"settings.col_main_field": "\u0627\u0644\u062D\u0642\u0644 \u0627\u0644\u0631\u0626\u064A\u0633\u064A",
|
|
128
|
+
"settings.col_searchable_fields": "\u0627\u0644\u062D\u0642\u0648\u0644 \u0627\u0644\u0642\u0627\u0628\u0644\u0629 \u0644\u0644\u0628\u062D\u062B",
|
|
129
|
+
"settings.col_enabled": "\u0645\u0641\u0639\u0651\u0644",
|
|
130
|
+
"settings.kind_single": "\u0645\u0641\u0631\u062F",
|
|
131
|
+
"settings.kind_collection": "\u0645\u062C\u0645\u0648\u0639\u0629",
|
|
132
|
+
"settings.enable_for_type": "\u062A\u0641\u0639\u064A\u0644 \u0627\u0644\u0628\u062D\u062B \u0644\u0640 {name}",
|
|
133
|
+
"settings.error_load": "\u062A\u0639\u0630\u0651\u0631 \u062A\u062D\u0645\u064A\u0644 \u0625\u0639\u062F\u0627\u062F\u0627\u062A \u0627\u0644\u0628\u062D\u062B \u0627\u0644\u0634\u0627\u0645\u0644.",
|
|
134
|
+
"settings.saved": "\u062A\u0645 \u062D\u0641\u0638 \u0625\u0639\u062F\u0627\u062F\u0627\u062A \u0627\u0644\u0628\u062D\u062B \u0627\u0644\u0634\u0627\u0645\u0644.",
|
|
135
|
+
"settings.error_save": "\u062A\u0639\u0630\u0651\u0631 \u062D\u0641\u0638 \u0625\u0639\u062F\u0627\u062F\u0627\u062A \u0627\u0644\u0628\u062D\u062B \u0627\u0644\u0634\u0627\u0645\u0644.",
|
|
136
|
+
"settings.restored": "\u062A\u0645\u062A \u0627\u0633\u062A\u0639\u0627\u062F\u0629 \u0627\u0644\u0625\u0639\u062F\u0627\u062F\u0627\u062A \u0627\u0644\u0627\u0641\u062A\u0631\u0627\u0636\u064A\u0629.",
|
|
137
|
+
"settings.error_restore": "\u062A\u0639\u0630\u0651\u0631\u062A \u0627\u0633\u062A\u0639\u0627\u062F\u0629 \u0627\u0644\u0625\u0639\u062F\u0627\u062F\u0627\u062A \u0627\u0644\u0627\u0641\u062A\u0631\u0627\u0636\u064A\u0629.",
|
|
138
|
+
"status.published": "\u0645\u0646\u0634\u0648\u0631",
|
|
139
|
+
"status.draft": "\u0645\u0633\u0648\u062F\u0629"
|
|
140
|
+
};
|
|
141
|
+
}
|
|
142
|
+
});
|
|
143
|
+
|
|
144
|
+
// admin/src/translations/en.json
|
|
145
|
+
var require_en = __commonJS({
|
|
146
|
+
"admin/src/translations/en.json"(exports, module) {
|
|
147
|
+
module.exports = {
|
|
148
|
+
"plugin.name": "Global Search",
|
|
149
|
+
"plugin.description": "Search every content type from one place.",
|
|
150
|
+
"settings.section": "Global Search",
|
|
151
|
+
"settings.link": "Configuration",
|
|
152
|
+
"common.searching": "Searching\u2026",
|
|
153
|
+
"common.no_results": "No results for \u201C{query}\u201D.",
|
|
154
|
+
"common.on": "On",
|
|
155
|
+
"common.off": "Off",
|
|
156
|
+
"common.none": "none",
|
|
157
|
+
"palette.title": "Global search",
|
|
158
|
+
"palette.placeholder": "Search all content\u2026",
|
|
159
|
+
"palette.min_chars": "Type at least {count} characters to search.",
|
|
160
|
+
"palette.idle_hint": "Search every collection type and single type by id, name, or any text field.",
|
|
161
|
+
"palette.error": "Search failed. Check that you have permission to read content, and see the server logs.",
|
|
162
|
+
"palette.results_aria": "Search results",
|
|
163
|
+
"palette.shortcuts_hint": "\u2191 \u2193 navigate \xB7 \u21B5 open \xB7 \u2318/Ctrl + \u21B5 new tab \xB7 esc close",
|
|
164
|
+
"palette.result_count": "{count} results",
|
|
165
|
+
"page.subtitle_ready": "Searching {count} content types \xB7 press Ctrl/Cmd + K anywhere",
|
|
166
|
+
"page.subtitle_loading": "Discovering content types\u2026",
|
|
167
|
+
"page.open_palette": "Open Palette (\u2318K)",
|
|
168
|
+
"page.clear_search": "Clear search",
|
|
169
|
+
"page.search_placeholder": "Search by id, name, or any text field\u2026",
|
|
170
|
+
"page.search_label": "Search all content",
|
|
171
|
+
"page.content_types_aria": "Content types",
|
|
172
|
+
"page.all_content_types": "All content types",
|
|
173
|
+
"page.clear_type_filters": "Clear content type filters",
|
|
174
|
+
"page.all_locales": "All locales",
|
|
175
|
+
"page.error": "Search failed. Check that you have permission to read content, and see the server logs for details.",
|
|
176
|
+
"page.idle_title": "Search every collection type and single type in this project.",
|
|
177
|
+
"page.idle_subtitle": "Results are ordered by id, then name, then any other field \u2014 including fields nested inside components. Press Ctrl/Cmd + K anywhere in the admin to open the quick palette.",
|
|
178
|
+
"page.no_results_clear_filters": "Try clearing the content type filters.",
|
|
179
|
+
"page.no_results_try_different": "Try a shorter or different term.",
|
|
180
|
+
"page.results_summary": "{total} results across {groups} content types",
|
|
181
|
+
"page.truncated_notice": " \xB7 some types returned more than the per-type limit",
|
|
182
|
+
"page.results_per_page": "Results per page",
|
|
183
|
+
"page.per_page_option": "{size} / page",
|
|
184
|
+
"page.previous": "Previous",
|
|
185
|
+
"page.page_of": "Page {page} of {pageCount}",
|
|
186
|
+
"page.next": "Next",
|
|
187
|
+
"table.type": "Type",
|
|
188
|
+
"table.id": "Id",
|
|
189
|
+
"table.name": "Name",
|
|
190
|
+
"table.matched": "Matched",
|
|
191
|
+
"table.locale": "Locale",
|
|
192
|
+
"table.status": "Status",
|
|
193
|
+
"table.updated": "Updated",
|
|
194
|
+
"settings.subtitle": "Tune how the search page and the Ctrl/Cmd + K palette query your content.",
|
|
195
|
+
"settings.restore_defaults": "Restore defaults",
|
|
196
|
+
"settings.save": "Save",
|
|
197
|
+
"settings.behaviour_title": "Search behaviour",
|
|
198
|
+
"settings.min_chars_label": "Minimum characters",
|
|
199
|
+
"settings.min_chars_hint": "Shorter queries are not sent to the server.",
|
|
200
|
+
"settings.debounce_label": "Debounce (ms)",
|
|
201
|
+
"settings.debounce_hint": "How long to wait after the last keystroke.",
|
|
202
|
+
"settings.per_type_limit_label": "Results per content type",
|
|
203
|
+
"settings.per_type_limit_hint": "Rows fetched from each type.",
|
|
204
|
+
"settings.max_results_label": "Maximum results",
|
|
205
|
+
"settings.max_results_hint": "Hard cap on the merged, ranked list.",
|
|
206
|
+
"settings.max_depth_label": "Component depth",
|
|
207
|
+
"settings.max_depth_hint": "How many component levels to search into.",
|
|
208
|
+
"settings.query_timeout_label": "Query timeout (ms)",
|
|
209
|
+
"settings.query_timeout_hint": "A slower content type is skipped.",
|
|
210
|
+
"settings.concurrency_label": "Concurrency",
|
|
211
|
+
"settings.concurrency_hint": "Maximum content types queried in parallel.",
|
|
212
|
+
"settings.deep_label": "Search inside components",
|
|
213
|
+
"settings.deep_hint": "Also match fields nested in components.",
|
|
214
|
+
"settings.drafts_label": "Include drafts",
|
|
215
|
+
"settings.drafts_hint": "Search unpublished entries too.",
|
|
216
|
+
"settings.plugins_label": "Include plugin content types",
|
|
217
|
+
"settings.plugins_hint": "Also search visible content types registered by plugins.",
|
|
218
|
+
"settings.content_types_title": "Content types",
|
|
219
|
+
"settings.content_types_hint": "Every API and visible plugin content type is discovered automatically. Turn one off to exclude it from search results.",
|
|
220
|
+
"settings.col_content_type": "Content type",
|
|
221
|
+
"settings.col_kind": "Kind",
|
|
222
|
+
"settings.col_main_field": "Main field",
|
|
223
|
+
"settings.col_searchable_fields": "Searchable fields",
|
|
224
|
+
"settings.col_enabled": "Enabled",
|
|
225
|
+
"settings.kind_single": "Single",
|
|
226
|
+
"settings.kind_collection": "Collection",
|
|
227
|
+
"settings.enable_for_type": "Enable search for {name}",
|
|
228
|
+
"settings.error_load": "Could not load global search settings.",
|
|
229
|
+
"settings.saved": "Global search settings saved.",
|
|
230
|
+
"settings.error_save": "Could not save global search settings.",
|
|
231
|
+
"settings.restored": "Defaults restored.",
|
|
232
|
+
"settings.error_restore": "Could not restore defaults.",
|
|
233
|
+
"status.published": "Published",
|
|
234
|
+
"status.draft": "Draft"
|
|
235
|
+
};
|
|
236
|
+
}
|
|
237
|
+
});
|
|
238
|
+
|
|
239
|
+
// admin/src/translations/es.json
|
|
240
|
+
var require_es = __commonJS({
|
|
241
|
+
"admin/src/translations/es.json"(exports, module) {
|
|
242
|
+
module.exports = {
|
|
243
|
+
"plugin.name": "B\xFAsqueda Global",
|
|
244
|
+
"plugin.description": "Busca en todos los tipos de contenido desde un solo lugar.",
|
|
245
|
+
"settings.section": "B\xFAsqueda Global",
|
|
246
|
+
"settings.link": "Configuraci\xF3n",
|
|
247
|
+
"common.searching": "Buscando\u2026",
|
|
248
|
+
"common.no_results": "Sin resultados para \u201C{query}\u201D.",
|
|
249
|
+
"common.on": "S\xED",
|
|
250
|
+
"common.off": "No",
|
|
251
|
+
"common.none": "ninguno",
|
|
252
|
+
"palette.title": "B\xFAsqueda global",
|
|
253
|
+
"palette.placeholder": "Buscar en todo el contenido\u2026",
|
|
254
|
+
"palette.min_chars": "Escribe al menos {count} caracteres para buscar.",
|
|
255
|
+
"palette.idle_hint": "Busca en cada tipo de colecci\xF3n y tipo \xFAnico por id, nombre o cualquier campo de texto.",
|
|
256
|
+
"palette.error": "Error en la b\xFAsqueda. Verifica tus permisos de lectura y revisa los registros del servidor.",
|
|
257
|
+
"palette.results_aria": "Resultados de b\xFAsqueda",
|
|
258
|
+
"palette.shortcuts_hint": "\u2191 \u2193 navegar \xB7 \u21B5 abrir \xB7 \u2318/Ctrl + \u21B5 nueva pesta\xF1a \xB7 esc cerrar",
|
|
259
|
+
"palette.result_count": "{count} resultados",
|
|
260
|
+
"page.subtitle_ready": "Buscando en {count} tipos de contenido \xB7 presiona Ctrl/Cmd + K en cualquier lugar",
|
|
261
|
+
"page.subtitle_loading": "Descubriendo tipos de contenido\u2026",
|
|
262
|
+
"page.open_palette": "Abrir paleta (\u2318K)",
|
|
263
|
+
"page.clear_search": "Limpiar b\xFAsqueda",
|
|
264
|
+
"page.search_placeholder": "Buscar por id, nombre o cualquier campo de texto\u2026",
|
|
265
|
+
"page.search_label": "Buscar en todo el contenido",
|
|
266
|
+
"page.content_types_aria": "Tipos de contenido",
|
|
267
|
+
"page.all_content_types": "Todos los tipos de contenido",
|
|
268
|
+
"page.clear_type_filters": "Limpiar filtros de tipos de contenido",
|
|
269
|
+
"page.all_locales": "Todos los idiomas",
|
|
270
|
+
"page.error": "Error en la b\xFAsqueda. Verifica tus permisos de lectura y revisa los registros del servidor para m\xE1s detalles.",
|
|
271
|
+
"page.idle_title": "Busca en todos los tipos de colecci\xF3n y tipos \xFAnicos de este proyecto.",
|
|
272
|
+
"page.idle_subtitle": "Los resultados se ordenan por id, luego por nombre y luego por cualquier otro campo, incluidos los anidados en componentes. Presiona Ctrl/Cmd + K para abrir la paleta r\xE1pida.",
|
|
273
|
+
"page.no_results_clear_filters": "Intenta limpiar los filtros de tipos de contenido.",
|
|
274
|
+
"page.no_results_try_different": "Intenta con un t\xE9rmino m\xE1s corto o diferente.",
|
|
275
|
+
"page.results_summary": "{total} resultados en {groups} tipos de contenido",
|
|
276
|
+
"page.truncated_notice": " \xB7 algunos tipos devolvieron m\xE1s que el l\xEDmite por tipo",
|
|
277
|
+
"page.results_per_page": "Resultados por p\xE1gina",
|
|
278
|
+
"page.per_page_option": "{size} / p\xE1gina",
|
|
279
|
+
"page.previous": "Anterior",
|
|
280
|
+
"page.page_of": "P\xE1gina {page} de {pageCount}",
|
|
281
|
+
"page.next": "Siguiente",
|
|
282
|
+
"table.type": "Tipo",
|
|
283
|
+
"table.id": "Id",
|
|
284
|
+
"table.name": "Nombre",
|
|
285
|
+
"table.matched": "Coincidencia",
|
|
286
|
+
"table.locale": "Idioma",
|
|
287
|
+
"table.status": "Estado",
|
|
288
|
+
"table.updated": "Actualizado",
|
|
289
|
+
"settings.subtitle": "Ajusta c\xF3mo la p\xE1gina de b\xFAsqueda y la paleta Ctrl/Cmd + K consultan tu contenido.",
|
|
290
|
+
"settings.restore_defaults": "Restaurar valores por defecto",
|
|
291
|
+
"settings.save": "Guardar",
|
|
292
|
+
"settings.behaviour_title": "Comportamiento de b\xFAsqueda",
|
|
293
|
+
"settings.min_chars_label": "Caracteres m\xEDnimos",
|
|
294
|
+
"settings.min_chars_hint": "Las consultas m\xE1s cortas no se env\xEDan al servidor.",
|
|
295
|
+
"settings.debounce_label": "Retardo (ms)",
|
|
296
|
+
"settings.debounce_hint": "Tiempo de espera tras la \xFAltima pulsaci\xF3n.",
|
|
297
|
+
"settings.per_type_limit_label": "Resultados por tipo de contenido",
|
|
298
|
+
"settings.per_type_limit_hint": "Filas obtenidas de cada tipo.",
|
|
299
|
+
"settings.max_results_label": "Resultados m\xE1ximos",
|
|
300
|
+
"settings.max_results_hint": "L\xEDmite m\xE1ximo en la lista combinada y clasificada.",
|
|
301
|
+
"settings.max_depth_label": "Profundidad de componentes",
|
|
302
|
+
"settings.max_depth_hint": "Cu\xE1ntos niveles de componentes buscar.",
|
|
303
|
+
"settings.query_timeout_label": "Tiempo de espera de consulta (ms)",
|
|
304
|
+
"settings.query_timeout_hint": "Se omite un tipo de contenido m\xE1s lento.",
|
|
305
|
+
"settings.concurrency_label": "Concurrencia",
|
|
306
|
+
"settings.concurrency_hint": "M\xE1ximo de tipos de contenido consultados en paralelo.",
|
|
307
|
+
"settings.deep_label": "Buscar dentro de componentes",
|
|
308
|
+
"settings.deep_hint": "Tambi\xE9n busca en campos anidados dentro de componentes.",
|
|
309
|
+
"settings.drafts_label": "Incluir borradores",
|
|
310
|
+
"settings.drafts_hint": "Buscar tambi\xE9n entradas no publicadas.",
|
|
311
|
+
"settings.plugins_label": "Incluir tipos de contenido de plugins",
|
|
312
|
+
"settings.plugins_hint": "Buscar tambi\xE9n tipos de contenido visibles registrados por plugins.",
|
|
313
|
+
"settings.content_types_title": "Tipos de contenido",
|
|
314
|
+
"settings.content_types_hint": "Cada tipo de contenido de API y plugin visible se descubre autom\xE1ticamente. Desactiva uno para excluirlo.",
|
|
315
|
+
"settings.col_content_type": "Tipo de contenido",
|
|
316
|
+
"settings.col_kind": "Clase",
|
|
317
|
+
"settings.col_main_field": "Campo principal",
|
|
318
|
+
"settings.col_searchable_fields": "Campos buscables",
|
|
319
|
+
"settings.col_enabled": "Habilitado",
|
|
320
|
+
"settings.kind_single": "\xDAnico",
|
|
321
|
+
"settings.kind_collection": "Colecci\xF3n",
|
|
322
|
+
"settings.enable_for_type": "Habilitar b\xFAsqueda para {name}",
|
|
323
|
+
"settings.error_load": "No se pudo cargar la configuraci\xF3n de b\xFAsqueda global.",
|
|
324
|
+
"settings.saved": "Configuraci\xF3n de b\xFAsqueda global guardada.",
|
|
325
|
+
"settings.error_save": "No se pudo guardar la configuraci\xF3n de b\xFAsqueda global.",
|
|
326
|
+
"settings.restored": "Valores predeterminados restaurados.",
|
|
327
|
+
"settings.error_restore": "No se pudieron restaurar los valores predeterminados.",
|
|
328
|
+
"status.published": "Publicado",
|
|
329
|
+
"status.draft": "Borrador"
|
|
330
|
+
};
|
|
331
|
+
}
|
|
332
|
+
});
|
|
333
|
+
|
|
334
|
+
// admin/src/translations/fr.json
|
|
335
|
+
var require_fr = __commonJS({
|
|
336
|
+
"admin/src/translations/fr.json"(exports, module) {
|
|
337
|
+
module.exports = {
|
|
338
|
+
"plugin.name": "Recherche globale",
|
|
339
|
+
"plugin.description": "Recherchez dans tous les types de contenu depuis un seul endroit.",
|
|
340
|
+
"settings.section": "Recherche globale",
|
|
341
|
+
"settings.link": "Configuration",
|
|
342
|
+
"common.searching": "Recherche en cours\u2026",
|
|
343
|
+
"common.no_results": "Aucun r\xE9sultat pour \xAB {query} \xBB.",
|
|
344
|
+
"common.on": "Oui",
|
|
345
|
+
"common.off": "Non",
|
|
346
|
+
"common.none": "aucun",
|
|
347
|
+
"palette.title": "Recherche globale",
|
|
348
|
+
"palette.placeholder": "Rechercher dans tout le contenu\u2026",
|
|
349
|
+
"palette.min_chars": "Saisissez au moins {count} caract\xE8res pour rechercher.",
|
|
350
|
+
"palette.idle_hint": "Recherchez dans chaque type de collection et type unique par identifiant, nom ou tout champ texte.",
|
|
351
|
+
"palette.error": "\xC9chec de la recherche. V\xE9rifiez vos permissions de lecture et consultez les journaux du serveur.",
|
|
352
|
+
"palette.results_aria": "R\xE9sultats de recherche",
|
|
353
|
+
"palette.shortcuts_hint": "\u2191 \u2193 naviguer \xB7 \u21B5 ouvrir \xB7 \u2318/Ctrl + \u21B5 nouvel onglet \xB7 \xE9chap fermer",
|
|
354
|
+
"palette.result_count": "{count} r\xE9sultats",
|
|
355
|
+
"page.subtitle_ready": "Recherche dans {count} types de contenu \xB7 appuyez sur Ctrl/Cmd + K partout",
|
|
356
|
+
"page.subtitle_loading": "D\xE9couverte des types de contenu\u2026",
|
|
357
|
+
"page.open_palette": "Ouvrir la palette (\u2318K)",
|
|
358
|
+
"page.clear_search": "Effacer la recherche",
|
|
359
|
+
"page.search_placeholder": "Rechercher par id, nom ou tout champ texte\u2026",
|
|
360
|
+
"page.search_label": "Rechercher dans tout le contenu",
|
|
361
|
+
"page.content_types_aria": "Types de contenu",
|
|
362
|
+
"page.all_content_types": "Tous les types de contenu",
|
|
363
|
+
"page.clear_type_filters": "Effacer les filtres de types de contenu",
|
|
364
|
+
"page.all_locales": "Toutes les langues",
|
|
365
|
+
"page.error": "\xC9chec de la recherche. V\xE9rifiez vos permissions de lecture et consultez les journaux du serveur pour plus de d\xE9tails.",
|
|
366
|
+
"page.idle_title": "Recherchez dans tous les types de collection et types uniques de ce projet.",
|
|
367
|
+
"page.idle_subtitle": "Les r\xE9sultats sont tri\xE9s par identifiant, puis par nom, puis par tout autre champ \u2014 y compris les champs imbriqu\xE9s dans des composants. Appuyez sur Ctrl/Cmd + K pour ouvrir la palette rapide.",
|
|
368
|
+
"page.no_results_clear_filters": "Essayez d'effacer les filtres de types de contenu.",
|
|
369
|
+
"page.no_results_try_different": "Essayez un terme plus court ou diff\xE9rent.",
|
|
370
|
+
"page.results_summary": "{total} r\xE9sultats dans {groups} types de contenu",
|
|
371
|
+
"page.truncated_notice": " \xB7 certains types ont renvoy\xE9 plus que la limite par type",
|
|
372
|
+
"page.results_per_page": "R\xE9sultats par page",
|
|
373
|
+
"page.per_page_option": "{size} / page",
|
|
374
|
+
"page.previous": "Pr\xE9c\xE9dent",
|
|
375
|
+
"page.page_of": "Page {page} sur {pageCount}",
|
|
376
|
+
"page.next": "Suivant",
|
|
377
|
+
"table.type": "Type",
|
|
378
|
+
"table.id": "Id",
|
|
379
|
+
"table.name": "Nom",
|
|
380
|
+
"table.matched": "Correspondance",
|
|
381
|
+
"table.locale": "Langue",
|
|
382
|
+
"table.status": "Statut",
|
|
383
|
+
"table.updated": "Mis \xE0 jour",
|
|
384
|
+
"settings.subtitle": "Ajustez la mani\xE8re dont la page de recherche et la palette Ctrl/Cmd + K interrogent votre contenu.",
|
|
385
|
+
"settings.restore_defaults": "Restaurer les valeurs par d\xE9faut",
|
|
386
|
+
"settings.save": "Enregistrer",
|
|
387
|
+
"settings.behaviour_title": "Comportement de recherche",
|
|
388
|
+
"settings.min_chars_label": "Caract\xE8res minimums",
|
|
389
|
+
"settings.min_chars_hint": "Les requ\xEAtes plus courtes ne sont pas envoy\xE9es au serveur.",
|
|
390
|
+
"settings.debounce_label": "D\xE9lai (ms)",
|
|
391
|
+
"settings.debounce_hint": "Temps d'attente apr\xE8s la derni\xE8re frappe.",
|
|
392
|
+
"settings.per_type_limit_label": "R\xE9sultats par type de contenu",
|
|
393
|
+
"settings.per_type_limit_hint": "Lignes r\xE9cup\xE9r\xE9es pour chaque type.",
|
|
394
|
+
"settings.max_results_label": "R\xE9sultats maximums",
|
|
395
|
+
"settings.max_results_hint": "Limite stricte sur la liste fusionn\xE9e et class\xE9e.",
|
|
396
|
+
"settings.max_depth_label": "Profondeur des composants",
|
|
397
|
+
"settings.max_depth_hint": "Nombre de niveaux de composants \xE0 parcourir.",
|
|
398
|
+
"settings.query_timeout_label": "D\xE9lai d'expiration de requ\xEAte (ms)",
|
|
399
|
+
"settings.query_timeout_hint": "Un type de contenu plus lent est ignor\xE9.",
|
|
400
|
+
"settings.concurrency_label": "Parall\xE9lisme",
|
|
401
|
+
"settings.concurrency_hint": "Nombre maximal de types de contenu interrog\xE9s en parall\xE8le.",
|
|
402
|
+
"settings.deep_label": "Rechercher dans les composants",
|
|
403
|
+
"settings.deep_hint": "Correspondre aussi aux champs imbriqu\xE9s dans les composants.",
|
|
404
|
+
"settings.drafts_label": "Inclure les brouillons",
|
|
405
|
+
"settings.drafts_hint": "Rechercher \xE9galement les entr\xE9es non publi\xE9es.",
|
|
406
|
+
"settings.plugins_label": "Inclure les types de contenu des plugins",
|
|
407
|
+
"settings.plugins_hint": "Rechercher aussi les types de contenu visibles enregistr\xE9s par les plugins.",
|
|
408
|
+
"settings.content_types_title": "Types de contenu",
|
|
409
|
+
"settings.content_types_hint": "Chaque type de contenu API et plugin visible est d\xE9couvert automatiquement. D\xE9sactivez-en un pour l'exclure des r\xE9sultats.",
|
|
410
|
+
"settings.col_content_type": "Type de contenu",
|
|
411
|
+
"settings.col_kind": "Nature",
|
|
412
|
+
"settings.col_main_field": "Champ principal",
|
|
413
|
+
"settings.col_searchable_fields": "Champs recherchables",
|
|
414
|
+
"settings.col_enabled": "Activ\xE9",
|
|
415
|
+
"settings.kind_single": "Unique",
|
|
416
|
+
"settings.kind_collection": "Collection",
|
|
417
|
+
"settings.enable_for_type": "Activer la recherche pour {name}",
|
|
418
|
+
"settings.error_load": "Impossible de charger les param\xE8tres de recherche globale.",
|
|
419
|
+
"settings.saved": "Param\xE8tres de recherche globale enregistr\xE9s.",
|
|
420
|
+
"settings.error_save": "Impossible d'enregistrer les param\xE8tres de recherche globale.",
|
|
421
|
+
"settings.restored": "Valeurs par d\xE9faut restaur\xE9es.",
|
|
422
|
+
"settings.error_restore": "Impossible de restaurer les valeurs par d\xE9faut.",
|
|
423
|
+
"status.published": "Publi\xE9",
|
|
424
|
+
"status.draft": "Brouillon"
|
|
425
|
+
};
|
|
426
|
+
}
|
|
427
|
+
});
|
|
428
|
+
|
|
429
|
+
// admin/src/translations/tr.json
|
|
430
|
+
var require_tr = __commonJS({
|
|
431
|
+
"admin/src/translations/tr.json"(exports, module) {
|
|
432
|
+
module.exports = {
|
|
433
|
+
"plugin.name": "Genel Arama",
|
|
434
|
+
"plugin.description": "T\xFCm i\xE7erik t\xFCrlerini tek bir yerden aray\u0131n.",
|
|
435
|
+
"settings.section": "Genel Arama",
|
|
436
|
+
"settings.link": "Yap\u0131land\u0131rma",
|
|
437
|
+
"common.searching": "Aran\u0131yor\u2026",
|
|
438
|
+
"common.no_results": "\u201C{query}\u201D i\xE7in sonu\xE7 bulunamad\u0131.",
|
|
439
|
+
"common.on": "A\xE7\u0131k",
|
|
440
|
+
"common.off": "Kapal\u0131",
|
|
441
|
+
"common.none": "yok",
|
|
442
|
+
"palette.title": "Genel arama",
|
|
443
|
+
"palette.placeholder": "T\xFCm i\xE7erikte ara\u2026",
|
|
444
|
+
"palette.min_chars": "Aramak i\xE7in en az {count} karakter yaz\u0131n.",
|
|
445
|
+
"palette.idle_hint": "Her koleksiyon ve tekil t\xFCr\xFC kimlik, ad veya herhangi bir metin alan\u0131na g\xF6re aray\u0131n.",
|
|
446
|
+
"palette.error": "Arama ba\u015Far\u0131s\u0131z oldu. \u0130\xE7erik okuma izninizi kontrol edin ve sunucu g\xFCnl\xFCklerine bak\u0131n.",
|
|
447
|
+
"palette.results_aria": "Arama sonu\xE7lar\u0131",
|
|
448
|
+
"palette.shortcuts_hint": "\u2191 \u2193 gezin \xB7 \u21B5 a\xE7 \xB7 \u2318/Ctrl + \u21B5 yeni sekme \xB7 esc kapat",
|
|
449
|
+
"palette.result_count": "{count} sonu\xE7",
|
|
450
|
+
"page.subtitle_ready": "{count} i\xE7erik t\xFCr\xFCnde aran\u0131yor \xB7 her yerde Ctrl/Cmd + K tu\u015Flar\u0131na bas\u0131n",
|
|
451
|
+
"page.subtitle_loading": "\u0130\xE7erik t\xFCrleri ke\u015Ffediliyor\u2026",
|
|
452
|
+
"page.open_palette": "Paleti A\xE7 (\u2318K)",
|
|
453
|
+
"page.clear_search": "Aramay\u0131 temizle",
|
|
454
|
+
"page.search_placeholder": "Kimlik, ad veya herhangi bir metin alan\u0131na g\xF6re aray\u0131n\u2026",
|
|
455
|
+
"page.search_label": "T\xFCm i\xE7erikte ara",
|
|
456
|
+
"page.content_types_aria": "\u0130\xE7erik t\xFCrleri",
|
|
457
|
+
"page.all_content_types": "T\xFCm i\xE7erik t\xFCrleri",
|
|
458
|
+
"page.clear_type_filters": "\u0130\xE7erik t\xFCr\xFC filtrelerini temizle",
|
|
459
|
+
"page.all_locales": "T\xFCm diller",
|
|
460
|
+
"page.error": "Arama ba\u015Far\u0131s\u0131z oldu. \u0130\xE7erik okuma izninizi kontrol edin ve ayr\u0131nt\u0131lar i\xE7in sunucu g\xFCnl\xFCklerine bak\u0131n.",
|
|
461
|
+
"page.idle_title": "Bu projedeki her koleksiyon t\xFCr\xFCn\xFC ve tekil t\xFCr\xFC aray\u0131n.",
|
|
462
|
+
"page.idle_subtitle": "Sonu\xE7lar \xF6nce kimli\u011Fe, sonra ada ve ard\u0131ndan bile\u015Fenlerin i\xE7indeki alanlar dahil di\u011Fer alanlara g\xF6re s\u0131ralan\u0131r. H\u0131zl\u0131 paleti a\xE7mak i\xE7in Ctrl/Cmd + K tu\u015Flar\u0131na bas\u0131n.",
|
|
463
|
+
"page.no_results_clear_filters": "\u0130\xE7erik t\xFCr\xFC filtrelerini temizlemeyi deneyin.",
|
|
464
|
+
"page.no_results_try_different": "Daha k\u0131sa veya farkl\u0131 bir terim deneyin.",
|
|
465
|
+
"page.results_summary": "{groups} i\xE7erik t\xFCr\xFCnde {total} sonu\xE7",
|
|
466
|
+
"page.truncated_notice": " \xB7 baz\u0131 t\xFCrler t\xFCr ba\u015F\u0131na s\u0131n\u0131rdan daha fazla sonu\xE7 d\xF6nd\xFCrd\xFC",
|
|
467
|
+
"page.results_per_page": "Sayfa ba\u015F\u0131na sonu\xE7",
|
|
468
|
+
"page.per_page_option": "{size} / sayfa",
|
|
469
|
+
"page.previous": "\xD6nceki",
|
|
470
|
+
"page.page_of": "Sayfa {page} / {pageCount}",
|
|
471
|
+
"page.next": "Sonraki",
|
|
472
|
+
"table.type": "T\xFCr",
|
|
473
|
+
"table.id": "Kimlik",
|
|
474
|
+
"table.name": "Ad",
|
|
475
|
+
"table.matched": "E\u015Fle\u015Fen",
|
|
476
|
+
"table.locale": "Dil",
|
|
477
|
+
"table.status": "Durum",
|
|
478
|
+
"table.updated": "G\xFCncellendi",
|
|
479
|
+
"settings.subtitle": "Arama sayfas\u0131n\u0131n ve Ctrl/Cmd + K paletinin i\xE7eri\u011Finizi nas\u0131l sorgulad\u0131\u011F\u0131n\u0131 ayarlay\u0131n.",
|
|
480
|
+
"settings.restore_defaults": "Varsay\u0131lanlar\u0131 geri y\xFCkle",
|
|
481
|
+
"settings.save": "Kaydet",
|
|
482
|
+
"settings.behaviour_title": "Arama davran\u0131\u015F\u0131",
|
|
483
|
+
"settings.min_chars_label": "Minimum karakter",
|
|
484
|
+
"settings.min_chars_hint": "Daha k\u0131sa sorgular sunucuya g\xF6nderilmez.",
|
|
485
|
+
"settings.debounce_label": "Gecikme (ms)",
|
|
486
|
+
"settings.debounce_hint": "Son tu\u015F vuru\u015Fundan sonra beklenecek s\xFCre.",
|
|
487
|
+
"settings.per_type_limit_label": "\u0130\xE7erik t\xFCr\xFC ba\u015F\u0131na sonu\xE7",
|
|
488
|
+
"settings.per_type_limit_hint": "Her t\xFCrden \xE7ekilen sat\u0131r say\u0131s\u0131.",
|
|
489
|
+
"settings.max_results_label": "Maksimum sonu\xE7",
|
|
490
|
+
"settings.max_results_hint": "Birle\u015Ftirilmi\u015F, s\u0131ralanm\u0131\u015F listedeki \xFCst s\u0131n\u0131r.",
|
|
491
|
+
"settings.max_depth_label": "Bile\u015Fen derinli\u011Fi",
|
|
492
|
+
"settings.max_depth_hint": "Aranacak bile\u015Fen seviyesi say\u0131s\u0131.",
|
|
493
|
+
"settings.query_timeout_label": "Sorgu zaman a\u015F\u0131m\u0131 (ms)",
|
|
494
|
+
"settings.query_timeout_hint": "Daha yava\u015F bir i\xE7erik t\xFCr\xFC atlan\u0131r.",
|
|
495
|
+
"settings.concurrency_label": "E\u015Fzamanl\u0131l\u0131k",
|
|
496
|
+
"settings.concurrency_hint": "Paralel olarak sorgulanan maksimum i\xE7erik t\xFCr\xFC say\u0131s\u0131.",
|
|
497
|
+
"settings.deep_label": "Bile\u015Fenlerin i\xE7inde ara",
|
|
498
|
+
"settings.deep_hint": "Bile\u015Fenlerin i\xE7ine yerle\u015Ftirilmi\u015F alanlar\u0131 da e\u015Fle\u015Ftir.",
|
|
499
|
+
"settings.drafts_label": "Taslaklar\u0131 dahil et",
|
|
500
|
+
"settings.drafts_hint": "Yay\u0131nlanmam\u0131\u015F kay\u0131tlar\u0131 da ara.",
|
|
501
|
+
"settings.plugins_label": "Eklenti i\xE7erik t\xFCrlerini dahil et",
|
|
502
|
+
"settings.plugins_hint": "Eklentiler taraf\u0131ndan kaydedilen g\xF6r\xFCn\xFCr i\xE7erik t\xFCrlerini de ara.",
|
|
503
|
+
"settings.content_types_title": "\u0130\xE7erik t\xFCrleri",
|
|
504
|
+
"settings.content_types_hint": "Her API ve g\xF6r\xFCn\xFCr eklenti i\xE7erik t\xFCr\xFC otomatik olarak ke\u015Ffedilir. Arama sonu\xE7lar\u0131ndan \xE7\u0131karmak i\xE7in birini kapat\u0131n.",
|
|
505
|
+
"settings.col_content_type": "\u0130\xE7erik t\xFCr\xFC",
|
|
506
|
+
"settings.col_kind": "\xC7e\u015Fit",
|
|
507
|
+
"settings.col_main_field": "Ana alan",
|
|
508
|
+
"settings.col_searchable_fields": "Aranabilir alanlar",
|
|
509
|
+
"settings.col_enabled": "Etkin",
|
|
510
|
+
"settings.kind_single": "Tekil",
|
|
511
|
+
"settings.kind_collection": "Koleksiyon",
|
|
512
|
+
"settings.enable_for_type": "{name} i\xE7in aramay\u0131 etkinle\u015Ftir",
|
|
513
|
+
"settings.error_load": "Genel arama ayarlar\u0131 y\xFCklenemedi.",
|
|
514
|
+
"settings.saved": "Genel arama ayarlar\u0131 kaydedildi.",
|
|
515
|
+
"settings.error_save": "Genel arama ayarlar\u0131 kaydedilemedi.",
|
|
516
|
+
"settings.restored": "Varsay\u0131lanlar geri y\xFCklendi.",
|
|
517
|
+
"settings.error_restore": "Varsay\u0131lanlar geri y\xFCklenemedi.",
|
|
518
|
+
"status.published": "Yay\u0131nland\u0131",
|
|
519
|
+
"status.draft": "Taslak"
|
|
520
|
+
};
|
|
521
|
+
}
|
|
522
|
+
});
|
|
523
|
+
|
|
524
|
+
// admin/src/utils/getTrad.ts
|
|
525
|
+
var import_ar, import_en, import_es, import_fr, import_tr, TRANSLATIONS, getActiveLocale, t;
|
|
526
|
+
var init_getTrad = __esm({
|
|
527
|
+
"admin/src/utils/getTrad.ts"() {
|
|
528
|
+
"use strict";
|
|
529
|
+
init_pluginId();
|
|
530
|
+
import_ar = __toESM(require_ar(), 1);
|
|
531
|
+
import_en = __toESM(require_en(), 1);
|
|
532
|
+
import_es = __toESM(require_es(), 1);
|
|
533
|
+
import_fr = __toESM(require_fr(), 1);
|
|
534
|
+
import_tr = __toESM(require_tr(), 1);
|
|
535
|
+
TRANSLATIONS = {
|
|
536
|
+
en: import_en.default,
|
|
537
|
+
fr: import_fr.default,
|
|
538
|
+
es: import_es.default,
|
|
539
|
+
ar: import_ar.default,
|
|
540
|
+
tr: import_tr.default
|
|
541
|
+
};
|
|
542
|
+
getActiveLocale = () => {
|
|
543
|
+
if (typeof window === "undefined") return "en";
|
|
544
|
+
try {
|
|
545
|
+
const raw = window.localStorage.getItem("strapi-admin-language");
|
|
546
|
+
if (!raw) return "en";
|
|
547
|
+
const clean = raw.replace(/^"|"$/g, "").trim();
|
|
548
|
+
if (TRANSLATIONS[clean]) return clean;
|
|
549
|
+
const base = clean.split(/[-_]/)[0];
|
|
550
|
+
return TRANSLATIONS[base] ? base : "en";
|
|
551
|
+
} catch {
|
|
552
|
+
return "en";
|
|
553
|
+
}
|
|
554
|
+
};
|
|
555
|
+
t = (id, defaultMessage, values) => {
|
|
556
|
+
const locale = getActiveLocale();
|
|
557
|
+
const dict = TRANSLATIONS[locale] || TRANSLATIONS.en || {};
|
|
558
|
+
const template = dict[id] || TRANSLATIONS.en?.[id] || defaultMessage;
|
|
559
|
+
if (!values) return template;
|
|
560
|
+
return Object.entries(values).reduce(
|
|
561
|
+
(result, [key, value]) => result.split(`{${key}}`).join(String(value)),
|
|
562
|
+
template
|
|
563
|
+
);
|
|
564
|
+
};
|
|
565
|
+
}
|
|
566
|
+
});
|
|
567
|
+
|
|
568
|
+
// admin/src/api/searchApi.ts
|
|
569
|
+
import { getFetchClient } from "@strapi/strapi/admin";
|
|
570
|
+
var searchEntries, fetchSearchableTypes, fetchAllTypes, fetchSettings, updateSettings, resetSettings, fetchLocales, isCanceled;
|
|
571
|
+
var init_searchApi = __esm({
|
|
572
|
+
"admin/src/api/searchApi.ts"() {
|
|
573
|
+
"use strict";
|
|
574
|
+
init_pluginId();
|
|
575
|
+
searchEntries = async (params, signal) => {
|
|
576
|
+
const { get } = getFetchClient();
|
|
577
|
+
const queryParams = {
|
|
578
|
+
q: params.q,
|
|
579
|
+
...params.types?.length ? { types: params.types.join(",") } : {},
|
|
580
|
+
...params.locale ? { locale: params.locale } : {},
|
|
581
|
+
...params.page !== void 0 ? { page: params.page } : {},
|
|
582
|
+
...params.pageSize !== void 0 ? { pageSize: params.pageSize } : {}
|
|
583
|
+
};
|
|
584
|
+
const { data } = await get(`/${pluginId_default}/search`, {
|
|
585
|
+
params: queryParams,
|
|
586
|
+
signal
|
|
587
|
+
});
|
|
588
|
+
return data;
|
|
589
|
+
};
|
|
590
|
+
fetchSearchableTypes = async () => {
|
|
591
|
+
const { get } = getFetchClient();
|
|
592
|
+
const { data } = await get(`/${pluginId_default}/schema`);
|
|
593
|
+
return data;
|
|
594
|
+
};
|
|
595
|
+
fetchAllTypes = async () => {
|
|
596
|
+
const { get } = getFetchClient();
|
|
597
|
+
const { data } = await get(`/${pluginId_default}/schema/all`);
|
|
598
|
+
return data;
|
|
599
|
+
};
|
|
600
|
+
fetchSettings = async () => {
|
|
601
|
+
const { get } = getFetchClient();
|
|
602
|
+
const { data } = await get(`/${pluginId_default}/settings`);
|
|
603
|
+
return data;
|
|
604
|
+
};
|
|
605
|
+
updateSettings = async (body) => {
|
|
606
|
+
const { put } = getFetchClient();
|
|
607
|
+
const { data } = await put(`/${pluginId_default}/settings`, body);
|
|
608
|
+
return data;
|
|
609
|
+
};
|
|
610
|
+
resetSettings = async () => {
|
|
611
|
+
const { post } = getFetchClient();
|
|
612
|
+
const { data } = await post(`/${pluginId_default}/settings/reset`);
|
|
613
|
+
return data;
|
|
614
|
+
};
|
|
615
|
+
fetchLocales = async () => {
|
|
616
|
+
try {
|
|
617
|
+
const { get } = getFetchClient();
|
|
618
|
+
const { data } = await get("/i18n/locales");
|
|
619
|
+
return Array.isArray(data) ? data : [];
|
|
620
|
+
} catch {
|
|
621
|
+
return [];
|
|
622
|
+
}
|
|
623
|
+
};
|
|
624
|
+
isCanceled = (error) => {
|
|
625
|
+
const err = error;
|
|
626
|
+
return Boolean(err) && (err.name === "CanceledError" || err.code === "ERR_CANCELED");
|
|
627
|
+
};
|
|
628
|
+
}
|
|
629
|
+
});
|
|
630
|
+
|
|
631
|
+
// admin/src/hooks/useGlobalSearch.ts
|
|
632
|
+
import { useCallback, useEffect as useEffect3, useMemo, useRef as useRef2, useState as useState2 } from "react";
|
|
633
|
+
var EMPTY, useGlobalSearch, useGlobalSearch_default;
|
|
634
|
+
var init_useGlobalSearch = __esm({
|
|
635
|
+
"admin/src/hooks/useGlobalSearch.ts"() {
|
|
636
|
+
"use strict";
|
|
637
|
+
init_searchApi();
|
|
638
|
+
EMPTY = {
|
|
639
|
+
results: [],
|
|
640
|
+
groups: [],
|
|
641
|
+
pagination: { page: 1, pageSize: 20, total: 0, pageCount: 0 },
|
|
642
|
+
meta: {}
|
|
643
|
+
};
|
|
644
|
+
useGlobalSearch = ({
|
|
645
|
+
debounce = 250,
|
|
646
|
+
minChars = 2,
|
|
647
|
+
pageSize = 20
|
|
648
|
+
} = {}) => {
|
|
649
|
+
const [query, setQuery] = useState2("");
|
|
650
|
+
const [selectedTypes, setSelectedTypes] = useState2([]);
|
|
651
|
+
const [locale, setLocale] = useState2("all");
|
|
652
|
+
const [page, setPage] = useState2(1);
|
|
653
|
+
const [state, setState] = useState2({
|
|
654
|
+
status: "idle",
|
|
655
|
+
data: EMPTY,
|
|
656
|
+
error: null
|
|
657
|
+
});
|
|
658
|
+
const requestId = useRef2(0);
|
|
659
|
+
const controller = useRef2(null);
|
|
660
|
+
const typesKey = useMemo(() => selectedTypes.join(","), [selectedTypes]);
|
|
661
|
+
useEffect3(() => {
|
|
662
|
+
setPage(1);
|
|
663
|
+
}, [query, typesKey, locale]);
|
|
664
|
+
useEffect3(() => {
|
|
665
|
+
const trimmed = query.trim();
|
|
666
|
+
if (trimmed.length < minChars) {
|
|
667
|
+
if (controller.current) controller.current.abort();
|
|
668
|
+
requestId.current += 1;
|
|
669
|
+
setState({ status: "idle", data: EMPTY, error: null });
|
|
670
|
+
return void 0;
|
|
671
|
+
}
|
|
672
|
+
requestId.current += 1;
|
|
673
|
+
const id = requestId.current;
|
|
674
|
+
const timer = setTimeout(async () => {
|
|
675
|
+
if (controller.current) controller.current.abort();
|
|
676
|
+
controller.current = new AbortController();
|
|
677
|
+
setState((previous) => ({ ...previous, status: "loading" }));
|
|
678
|
+
try {
|
|
679
|
+
const data = await searchEntries(
|
|
680
|
+
{ q: trimmed, types: selectedTypes, locale, page, pageSize },
|
|
681
|
+
controller.current.signal
|
|
682
|
+
);
|
|
683
|
+
if (id === requestId.current)
|
|
684
|
+
setState({ status: "success", data, error: null });
|
|
685
|
+
} catch (error) {
|
|
686
|
+
if (isCanceled(error) || id !== requestId.current) return;
|
|
687
|
+
setState({ status: "error", data: EMPTY, error });
|
|
688
|
+
}
|
|
689
|
+
}, debounce);
|
|
690
|
+
return () => clearTimeout(timer);
|
|
691
|
+
}, [query, typesKey, locale, page, pageSize, debounce, minChars]);
|
|
692
|
+
useEffect3(
|
|
693
|
+
() => () => {
|
|
694
|
+
if (controller.current) controller.current.abort();
|
|
695
|
+
},
|
|
696
|
+
[]
|
|
697
|
+
);
|
|
698
|
+
const toggleType = useCallback((uid) => {
|
|
699
|
+
setSelectedTypes(
|
|
700
|
+
(previous) => previous.includes(uid) ? previous.filter((item) => item !== uid) : [...previous, uid]
|
|
701
|
+
);
|
|
702
|
+
}, []);
|
|
703
|
+
const clearTypes = useCallback(() => setSelectedTypes([]), []);
|
|
704
|
+
return {
|
|
705
|
+
query,
|
|
706
|
+
setQuery,
|
|
707
|
+
selectedTypes,
|
|
708
|
+
setSelectedTypes,
|
|
709
|
+
toggleType,
|
|
710
|
+
clearTypes,
|
|
711
|
+
locale,
|
|
712
|
+
setLocale,
|
|
713
|
+
page,
|
|
714
|
+
setPage,
|
|
715
|
+
status: state.status,
|
|
716
|
+
error: state.error,
|
|
717
|
+
data: state.data || EMPTY,
|
|
718
|
+
isBelowMinChars: query.trim().length > 0 && query.trim().length < minChars
|
|
719
|
+
};
|
|
720
|
+
};
|
|
721
|
+
useGlobalSearch_default = useGlobalSearch;
|
|
722
|
+
}
|
|
723
|
+
});
|
|
724
|
+
|
|
725
|
+
// admin/src/hooks/useSearchableTypes.ts
|
|
726
|
+
import { useEffect as useEffect4, useState as useState3 } from "react";
|
|
727
|
+
var inFlight, load, INVALIDATE_EVENT, useSearchableTypes, invalidateSearchableTypes, useSearchableTypes_default;
|
|
728
|
+
var init_useSearchableTypes = __esm({
|
|
729
|
+
"admin/src/hooks/useSearchableTypes.ts"() {
|
|
730
|
+
"use strict";
|
|
731
|
+
init_searchApi();
|
|
732
|
+
inFlight = null;
|
|
733
|
+
load = () => {
|
|
734
|
+
if (!inFlight) {
|
|
735
|
+
inFlight = fetchSearchableTypes().catch((error) => {
|
|
736
|
+
inFlight = null;
|
|
737
|
+
throw error;
|
|
738
|
+
});
|
|
739
|
+
}
|
|
740
|
+
return inFlight;
|
|
741
|
+
};
|
|
742
|
+
INVALIDATE_EVENT = "global-search:schema-invalidated";
|
|
743
|
+
useSearchableTypes = () => {
|
|
744
|
+
const [state, setState] = useState3({
|
|
745
|
+
status: "loading",
|
|
746
|
+
contentTypes: [],
|
|
747
|
+
settings: {}
|
|
748
|
+
});
|
|
749
|
+
useEffect4(() => {
|
|
750
|
+
let cancelled = false;
|
|
751
|
+
const refresh = () => {
|
|
752
|
+
load().then((data) => {
|
|
753
|
+
if (cancelled) return;
|
|
754
|
+
setState({
|
|
755
|
+
status: "success",
|
|
756
|
+
contentTypes: data.contentTypes || [],
|
|
757
|
+
settings: data.settings || {}
|
|
758
|
+
});
|
|
759
|
+
}).catch(() => {
|
|
760
|
+
if (cancelled) return;
|
|
761
|
+
setState({ status: "error", contentTypes: [], settings: {} });
|
|
762
|
+
});
|
|
763
|
+
};
|
|
764
|
+
refresh();
|
|
765
|
+
if (typeof window !== "undefined") {
|
|
766
|
+
window.addEventListener(INVALIDATE_EVENT, refresh);
|
|
767
|
+
}
|
|
768
|
+
return () => {
|
|
769
|
+
cancelled = true;
|
|
770
|
+
if (typeof window !== "undefined") {
|
|
771
|
+
window.removeEventListener(INVALIDATE_EVENT, refresh);
|
|
772
|
+
}
|
|
773
|
+
};
|
|
774
|
+
}, []);
|
|
775
|
+
return state;
|
|
776
|
+
};
|
|
777
|
+
invalidateSearchableTypes = () => {
|
|
778
|
+
inFlight = null;
|
|
779
|
+
if (typeof window !== "undefined") {
|
|
780
|
+
window.dispatchEvent(new CustomEvent(INVALIDATE_EVENT));
|
|
781
|
+
}
|
|
782
|
+
};
|
|
783
|
+
useSearchableTypes_default = useSearchableTypes;
|
|
784
|
+
}
|
|
785
|
+
});
|
|
786
|
+
|
|
787
|
+
// admin/src/utils/adminBase.ts
|
|
788
|
+
var getAdminBase, toAdminUrl;
|
|
789
|
+
var init_adminBase = __esm({
|
|
790
|
+
"admin/src/utils/adminBase.ts"() {
|
|
791
|
+
"use strict";
|
|
792
|
+
getAdminBase = () => {
|
|
793
|
+
if (typeof window === "undefined") return "/admin/";
|
|
794
|
+
try {
|
|
795
|
+
const pathname = window.location.pathname || "";
|
|
796
|
+
const marker = "/admin";
|
|
797
|
+
let idx = pathname.lastIndexOf(marker);
|
|
798
|
+
while (idx !== -1) {
|
|
799
|
+
const end = idx + marker.length;
|
|
800
|
+
if (end === pathname.length || pathname[end] === "/") {
|
|
801
|
+
return `${pathname.slice(0, end)}/`;
|
|
802
|
+
}
|
|
803
|
+
idx = pathname.lastIndexOf(marker, idx - 1);
|
|
804
|
+
}
|
|
805
|
+
} catch {
|
|
806
|
+
}
|
|
807
|
+
return "/admin/";
|
|
808
|
+
};
|
|
809
|
+
toAdminUrl = (path) => `${getAdminBase()}${String(path).replace(/^\//, "")}`;
|
|
810
|
+
}
|
|
811
|
+
});
|
|
812
|
+
|
|
813
|
+
// admin/src/components/Highlight.tsx
|
|
814
|
+
import { Typography } from "@strapi/design-system";
|
|
815
|
+
import React from "react";
|
|
816
|
+
import { jsx } from "react/jsx-runtime";
|
|
817
|
+
var escapeRegExp, Highlight;
|
|
818
|
+
var init_Highlight = __esm({
|
|
819
|
+
"admin/src/components/Highlight.tsx"() {
|
|
820
|
+
"use strict";
|
|
821
|
+
escapeRegExp = (value) => value.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
822
|
+
Highlight = ({
|
|
823
|
+
text,
|
|
824
|
+
query = "",
|
|
825
|
+
textColor = "neutral600"
|
|
826
|
+
}) => {
|
|
827
|
+
if (!text) return null;
|
|
828
|
+
const cleanQuery = query.trim();
|
|
829
|
+
if (!cleanQuery) {
|
|
830
|
+
return /* @__PURE__ */ jsx(Typography, { tag: "span", textColor, children: text });
|
|
831
|
+
}
|
|
832
|
+
const parts = String(text).split(
|
|
833
|
+
new RegExp(`(${escapeRegExp(cleanQuery)})`, "gi")
|
|
834
|
+
);
|
|
835
|
+
const lowered = cleanQuery.toLowerCase();
|
|
836
|
+
return /* @__PURE__ */ jsx(Typography, { tag: "span", textColor, children: parts.map(
|
|
837
|
+
(part, index) => part.toLowerCase() === lowered ? /* @__PURE__ */ jsx(
|
|
838
|
+
Typography,
|
|
839
|
+
{
|
|
840
|
+
tag: "span",
|
|
841
|
+
fontWeight: "bold",
|
|
842
|
+
textColor: "primary600",
|
|
843
|
+
children: part
|
|
844
|
+
},
|
|
845
|
+
`${part}-${index}`
|
|
846
|
+
) : /* @__PURE__ */ jsx(React.Fragment, { children: part }, `${part}-${index}`)
|
|
847
|
+
) });
|
|
848
|
+
};
|
|
849
|
+
}
|
|
850
|
+
});
|
|
851
|
+
|
|
852
|
+
// admin/src/permissions.ts
|
|
853
|
+
var pluginPermissions, permissions_default;
|
|
854
|
+
var init_permissions = __esm({
|
|
855
|
+
"admin/src/permissions.ts"() {
|
|
856
|
+
"use strict";
|
|
857
|
+
init_pluginId();
|
|
858
|
+
pluginPermissions = {
|
|
859
|
+
main: [{ action: `plugin::${pluginId_default}.read`, subject: null }],
|
|
860
|
+
settings: [{ action: `plugin::${pluginId_default}.settings`, subject: null }]
|
|
861
|
+
};
|
|
862
|
+
permissions_default = pluginPermissions;
|
|
863
|
+
}
|
|
864
|
+
});
|
|
865
|
+
|
|
866
|
+
// admin/src/components/ResultsTable.tsx
|
|
867
|
+
import {
|
|
868
|
+
Badge as Badge2,
|
|
869
|
+
Box as Box3,
|
|
870
|
+
Table,
|
|
871
|
+
Tbody,
|
|
872
|
+
Td,
|
|
873
|
+
Th,
|
|
874
|
+
Thead,
|
|
875
|
+
Tr,
|
|
876
|
+
Typography as Typography4
|
|
877
|
+
} from "@strapi/design-system";
|
|
878
|
+
import { styled as styled3 } from "styled-components";
|
|
879
|
+
import { jsx as jsx6, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
880
|
+
var ClickableRow, TABLE_HEADERS, ResultsTable;
|
|
881
|
+
var init_ResultsTable = __esm({
|
|
882
|
+
"admin/src/components/ResultsTable.tsx"() {
|
|
883
|
+
"use strict";
|
|
884
|
+
init_getTrad();
|
|
885
|
+
init_Highlight();
|
|
886
|
+
ClickableRow = styled3(Tr)`
|
|
887
|
+
cursor: pointer;
|
|
888
|
+
|
|
889
|
+
&:hover {
|
|
890
|
+
background: ${({ theme }) => theme.colors.neutral100};
|
|
891
|
+
}
|
|
892
|
+
`;
|
|
893
|
+
TABLE_HEADERS = [
|
|
894
|
+
["table.type", "Type"],
|
|
895
|
+
["table.id", "Id"],
|
|
896
|
+
["table.name", "Name"],
|
|
897
|
+
["table.matched", "Matched"],
|
|
898
|
+
["table.locale", "Locale"],
|
|
899
|
+
["table.status", "Status"],
|
|
900
|
+
["table.updated", "Updated"]
|
|
901
|
+
];
|
|
902
|
+
ResultsTable = ({
|
|
903
|
+
results,
|
|
904
|
+
trimmedQuery,
|
|
905
|
+
onSelectHit
|
|
906
|
+
}) => /* @__PURE__ */ jsxs3(Table, { colCount: 7, rowCount: results.length, children: [
|
|
907
|
+
/* @__PURE__ */ jsx6(Thead, { children: /* @__PURE__ */ jsx6(Tr, { children: TABLE_HEADERS.map(([key, label]) => /* @__PURE__ */ jsx6(Th, { children: /* @__PURE__ */ jsx6(Typography4, { variant: "sigma", children: t(key, label) }) }, key)) }) }),
|
|
908
|
+
/* @__PURE__ */ jsx6(Tbody, { children: results.map((hit) => /* @__PURE__ */ jsxs3(
|
|
909
|
+
ClickableRow,
|
|
910
|
+
{
|
|
911
|
+
tabIndex: 0,
|
|
912
|
+
onClick: (event) => onSelectHit(hit.adminUrl, event.metaKey || event.ctrlKey),
|
|
913
|
+
onKeyDown: (event) => {
|
|
914
|
+
if (event.key === "Enter" || event.key === " ") {
|
|
915
|
+
event.preventDefault();
|
|
916
|
+
onSelectHit(hit.adminUrl, event.metaKey || event.ctrlKey);
|
|
917
|
+
}
|
|
918
|
+
},
|
|
919
|
+
children: [
|
|
920
|
+
/* @__PURE__ */ jsx6(Td, { children: /* @__PURE__ */ jsx6(Typography4, { textColor: "neutral800", children: hit.contentTypeLabel }) }),
|
|
921
|
+
/* @__PURE__ */ jsx6(Td, { children: /* @__PURE__ */ jsx6(Typography4, { textColor: "neutral600", children: hit.documentId || hit.id }) }),
|
|
922
|
+
/* @__PURE__ */ jsx6(Td, { children: /* @__PURE__ */ jsx6(Typography4, { fontWeight: "semiBold", textColor: "neutral800", children: /* @__PURE__ */ jsx6(
|
|
923
|
+
Highlight,
|
|
924
|
+
{
|
|
925
|
+
text: String(hit.title),
|
|
926
|
+
query: trimmedQuery,
|
|
927
|
+
textColor: "neutral800"
|
|
928
|
+
}
|
|
929
|
+
) }) }),
|
|
930
|
+
/* @__PURE__ */ jsx6(Td, { children: hit.matchedField ? /* @__PURE__ */ jsxs3(Box3, { maxWidth: "32rem", children: [
|
|
931
|
+
/* @__PURE__ */ jsx6(Typography4, { variant: "pi", textColor: "neutral500", children: hit.matchedFieldLabel }),
|
|
932
|
+
/* @__PURE__ */ jsx6(Box3, { children: /* @__PURE__ */ jsx6(Typography4, { variant: "pi", children: /* @__PURE__ */ jsx6(
|
|
933
|
+
Highlight,
|
|
934
|
+
{
|
|
935
|
+
text: hit.matchedSnippet || "",
|
|
936
|
+
query: trimmedQuery
|
|
937
|
+
}
|
|
938
|
+
) }) })
|
|
939
|
+
] }) : /* @__PURE__ */ jsx6(Typography4, { textColor: "neutral400", children: "\u2014" }) }),
|
|
940
|
+
/* @__PURE__ */ jsx6(Td, { children: /* @__PURE__ */ jsx6(Typography4, { textColor: "neutral600", children: hit.locale || "\u2014" }) }),
|
|
941
|
+
/* @__PURE__ */ jsx6(Td, { children: hit.status ? /* @__PURE__ */ jsx6(Badge2, { children: t(`status.${hit.status}`, hit.status) }) : /* @__PURE__ */ jsx6(Typography4, { textColor: "neutral400", children: "\u2014" }) }),
|
|
942
|
+
/* @__PURE__ */ jsx6(Td, { children: /* @__PURE__ */ jsx6(Typography4, { textColor: "neutral600", children: hit.updatedAt ? new Date(hit.updatedAt).toLocaleDateString() : "\u2014" }) })
|
|
943
|
+
]
|
|
944
|
+
},
|
|
945
|
+
[
|
|
946
|
+
hit.contentTypeUid,
|
|
947
|
+
hit.documentId || hit.id,
|
|
948
|
+
hit.locale || ""
|
|
949
|
+
].join("-")
|
|
950
|
+
)) })
|
|
951
|
+
] });
|
|
952
|
+
}
|
|
953
|
+
});
|
|
954
|
+
|
|
955
|
+
// admin/src/pages/HomePage.tsx
|
|
956
|
+
import {
|
|
957
|
+
Box as Box4,
|
|
958
|
+
Button,
|
|
959
|
+
Flex as Flex3,
|
|
960
|
+
Loader as Loader2,
|
|
961
|
+
Main,
|
|
962
|
+
MultiSelect,
|
|
963
|
+
MultiSelectOption,
|
|
964
|
+
Searchbar,
|
|
965
|
+
SearchForm,
|
|
966
|
+
SingleSelect,
|
|
967
|
+
SingleSelectOption,
|
|
968
|
+
Typography as Typography5
|
|
969
|
+
} from "@strapi/design-system";
|
|
970
|
+
import { Layouts } from "@strapi/strapi/admin";
|
|
971
|
+
import { useEffect as useEffect9, useState as useState6 } from "react";
|
|
972
|
+
import { useNavigate } from "react-router-dom";
|
|
973
|
+
import { jsx as jsx7, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
974
|
+
var PAGE_SIZES, renderMessageCard, SearchResultsSection, SearchFiltersBar, SearchPaginationBar, HomePage;
|
|
975
|
+
var init_HomePage = __esm({
|
|
976
|
+
"admin/src/pages/HomePage.tsx"() {
|
|
977
|
+
"use strict";
|
|
978
|
+
init_searchApi();
|
|
979
|
+
init_ResultsTable();
|
|
980
|
+
init_useGlobalSearch();
|
|
981
|
+
init_useSearchableTypes();
|
|
982
|
+
init_adminBase();
|
|
983
|
+
init_getTrad();
|
|
984
|
+
PAGE_SIZES = [10, 20, 50];
|
|
985
|
+
renderMessageCard = (heading, subtitle) => /* @__PURE__ */ jsxs4(Box4, { padding: 8, background: "neutral0", hasRadius: true, children: [
|
|
986
|
+
/* @__PURE__ */ jsx7(Typography5, { variant: "delta", textColor: "neutral600", children: heading }),
|
|
987
|
+
/* @__PURE__ */ jsx7(Box4, { paddingTop: 2, children: /* @__PURE__ */ jsx7(Typography5, { textColor: "neutral500", children: subtitle }) })
|
|
988
|
+
] });
|
|
989
|
+
SearchResultsSection = ({
|
|
990
|
+
status,
|
|
991
|
+
isBelowMinChars,
|
|
992
|
+
minChars,
|
|
993
|
+
trimmedQuery,
|
|
994
|
+
hasTypeFilters,
|
|
995
|
+
results,
|
|
996
|
+
onSelectHit
|
|
997
|
+
}) => {
|
|
998
|
+
if (status === "error") {
|
|
999
|
+
return /* @__PURE__ */ jsx7(Box4, { padding: 8, background: "neutral0", hasRadius: true, children: /* @__PURE__ */ jsx7(Typography5, { textColor: "danger600", children: t(
|
|
1000
|
+
"page.error",
|
|
1001
|
+
"Search failed. Check that you have permission to read content, and see the server logs for details."
|
|
1002
|
+
) }) });
|
|
1003
|
+
}
|
|
1004
|
+
if (isBelowMinChars || status === "idle" && !trimmedQuery) {
|
|
1005
|
+
const headingText = isBelowMinChars ? t("palette.min_chars", "Type at least {count} characters to search.", {
|
|
1006
|
+
count: minChars
|
|
1007
|
+
}) : t(
|
|
1008
|
+
"page.idle_title",
|
|
1009
|
+
"Search every collection type and single type in this project."
|
|
1010
|
+
);
|
|
1011
|
+
return renderMessageCard(
|
|
1012
|
+
headingText,
|
|
1013
|
+
t(
|
|
1014
|
+
"page.idle_subtitle",
|
|
1015
|
+
"Results are ordered by id, then name, then any other field \u2014 including fields nested inside components. Press Ctrl/Cmd + K anywhere in the admin to open the quick palette."
|
|
1016
|
+
)
|
|
1017
|
+
);
|
|
1018
|
+
}
|
|
1019
|
+
if (status === "loading" && !results.length) {
|
|
1020
|
+
return /* @__PURE__ */ jsx7(Flex3, { justifyContent: "center", padding: 8, children: /* @__PURE__ */ jsx7(Loader2, { children: t("common.searching", "Searching\u2026") }) });
|
|
1021
|
+
}
|
|
1022
|
+
if (!results.length) {
|
|
1023
|
+
const emptyHint = hasTypeFilters ? t(
|
|
1024
|
+
"page.no_results_clear_filters",
|
|
1025
|
+
"Try clearing the content type filters."
|
|
1026
|
+
) : t("page.no_results_try_different", "Try a shorter or different term.");
|
|
1027
|
+
return renderMessageCard(
|
|
1028
|
+
t("common.no_results", "No results for \u201C{query}\u201D.", {
|
|
1029
|
+
query: trimmedQuery
|
|
1030
|
+
}),
|
|
1031
|
+
emptyHint
|
|
1032
|
+
);
|
|
1033
|
+
}
|
|
1034
|
+
return /* @__PURE__ */ jsx7(
|
|
1035
|
+
ResultsTable,
|
|
1036
|
+
{
|
|
1037
|
+
results,
|
|
1038
|
+
trimmedQuery,
|
|
1039
|
+
onSelectHit
|
|
1040
|
+
}
|
|
1041
|
+
);
|
|
1042
|
+
};
|
|
1043
|
+
SearchFiltersBar = ({
|
|
1044
|
+
search,
|
|
1045
|
+
contentTypes,
|
|
1046
|
+
locales
|
|
1047
|
+
}) => {
|
|
1048
|
+
const { groups } = search.data;
|
|
1049
|
+
return /* @__PURE__ */ jsxs4(Flex3, { gap: 2, alignItems: "flex-end", wrap: "wrap", children: [
|
|
1050
|
+
/* @__PURE__ */ jsx7(Box4, { grow: 1, minWidth: "16rem", children: /* @__PURE__ */ jsx7(SearchForm, { children: /* @__PURE__ */ jsx7(
|
|
1051
|
+
Searchbar,
|
|
1052
|
+
{
|
|
1053
|
+
name: "global-search",
|
|
1054
|
+
value: search.query,
|
|
1055
|
+
onChange: (event) => search.setQuery(event.target.value),
|
|
1056
|
+
onClear: () => search.setQuery(""),
|
|
1057
|
+
clearLabel: t("page.clear_search", "Clear search"),
|
|
1058
|
+
placeholder: t(
|
|
1059
|
+
"page.search_placeholder",
|
|
1060
|
+
"Search by id, name, or any text field\u2026"
|
|
1061
|
+
),
|
|
1062
|
+
children: t("page.search_label", "Search all content")
|
|
1063
|
+
}
|
|
1064
|
+
) }) }),
|
|
1065
|
+
contentTypes.length ? /* @__PURE__ */ jsx7(Box4, { minWidth: "18rem", maxWidth: "28rem", children: /* @__PURE__ */ jsx7(
|
|
1066
|
+
MultiSelect,
|
|
1067
|
+
{
|
|
1068
|
+
"aria-label": t("page.content_types_aria", "Content types"),
|
|
1069
|
+
placeholder: t("page.all_content_types", "All content types"),
|
|
1070
|
+
value: search.selectedTypes,
|
|
1071
|
+
onChange: search.setSelectedTypes,
|
|
1072
|
+
onClear: search.clearTypes,
|
|
1073
|
+
clearLabel: t(
|
|
1074
|
+
"page.clear_type_filters",
|
|
1075
|
+
"Clear content type filters"
|
|
1076
|
+
),
|
|
1077
|
+
withTags: true,
|
|
1078
|
+
size: "S",
|
|
1079
|
+
children: contentTypes.map((type) => {
|
|
1080
|
+
const group = groups.find((item) => item.uid === type.uid);
|
|
1081
|
+
const countLabel = group ? ` (${group.count}${group.truncated ? "+" : ""})` : "";
|
|
1082
|
+
return /* @__PURE__ */ jsxs4(MultiSelectOption, { value: type.uid, children: [
|
|
1083
|
+
type.displayName,
|
|
1084
|
+
countLabel
|
|
1085
|
+
] }, type.uid);
|
|
1086
|
+
})
|
|
1087
|
+
}
|
|
1088
|
+
) }) : null,
|
|
1089
|
+
locales.length > 1 ? /* @__PURE__ */ jsx7(Box4, { minWidth: "16rem", children: /* @__PURE__ */ jsxs4(
|
|
1090
|
+
SingleSelect,
|
|
1091
|
+
{
|
|
1092
|
+
"aria-label": t("table.locale", "Locale"),
|
|
1093
|
+
value: search.locale,
|
|
1094
|
+
onChange: (val) => search.setLocale(String(val)),
|
|
1095
|
+
size: "S",
|
|
1096
|
+
children: [
|
|
1097
|
+
/* @__PURE__ */ jsx7(SingleSelectOption, { value: "all", children: t("page.all_locales", "All locales") }),
|
|
1098
|
+
locales.map((loc) => /* @__PURE__ */ jsx7(SingleSelectOption, { value: loc.code, children: loc.name || loc.code }, loc.code))
|
|
1099
|
+
]
|
|
1100
|
+
}
|
|
1101
|
+
) }) : null
|
|
1102
|
+
] });
|
|
1103
|
+
};
|
|
1104
|
+
SearchPaginationBar = ({
|
|
1105
|
+
search,
|
|
1106
|
+
pageSize,
|
|
1107
|
+
onPageSizeChange
|
|
1108
|
+
}) => {
|
|
1109
|
+
const { pagination, groups, meta } = search.data;
|
|
1110
|
+
const totalLabel = `${pagination.total}${meta.capped ? "+" : ""}`;
|
|
1111
|
+
const truncatedNotice = meta.truncatedTypes?.length ? t(
|
|
1112
|
+
"page.truncated_notice",
|
|
1113
|
+
" \xB7 some types returned more than the per-type limit"
|
|
1114
|
+
) : "";
|
|
1115
|
+
return /* @__PURE__ */ jsxs4(Flex3, { justifyContent: "space-between", alignItems: "center", children: [
|
|
1116
|
+
/* @__PURE__ */ jsxs4(Flex3, { gap: 2, alignItems: "center", children: [
|
|
1117
|
+
/* @__PURE__ */ jsxs4(Typography5, { textColor: "neutral600", variant: "pi", children: [
|
|
1118
|
+
t(
|
|
1119
|
+
"page.results_summary",
|
|
1120
|
+
"{total} results across {groups} content types",
|
|
1121
|
+
{ total: totalLabel, groups: groups.length }
|
|
1122
|
+
),
|
|
1123
|
+
truncatedNotice
|
|
1124
|
+
] }),
|
|
1125
|
+
/* @__PURE__ */ jsx7(Box4, { minWidth: "7rem", children: /* @__PURE__ */ jsx7(
|
|
1126
|
+
SingleSelect,
|
|
1127
|
+
{
|
|
1128
|
+
"aria-label": t("page.results_per_page", "Results per page"),
|
|
1129
|
+
value: String(pageSize),
|
|
1130
|
+
onChange: (value) => onPageSizeChange(Number(value)),
|
|
1131
|
+
size: "S",
|
|
1132
|
+
children: PAGE_SIZES.map((size) => /* @__PURE__ */ jsx7(SingleSelectOption, { value: String(size), children: t("page.per_page_option", "{size} / page", { size }) }, size))
|
|
1133
|
+
}
|
|
1134
|
+
) })
|
|
1135
|
+
] }),
|
|
1136
|
+
/* @__PURE__ */ jsxs4(Flex3, { gap: 2, alignItems: "center", children: [
|
|
1137
|
+
/* @__PURE__ */ jsx7(
|
|
1138
|
+
Button,
|
|
1139
|
+
{
|
|
1140
|
+
variant: "tertiary",
|
|
1141
|
+
disabled: pagination.page <= 1,
|
|
1142
|
+
onClick: () => search.setPage(pagination.page - 1),
|
|
1143
|
+
children: t("page.previous", "Previous")
|
|
1144
|
+
}
|
|
1145
|
+
),
|
|
1146
|
+
/* @__PURE__ */ jsx7(Typography5, { variant: "pi", textColor: "neutral600", children: t("page.page_of", "Page {page} of {pageCount}", {
|
|
1147
|
+
page: pagination.page,
|
|
1148
|
+
pageCount: pagination.pageCount || 1
|
|
1149
|
+
}) }),
|
|
1150
|
+
/* @__PURE__ */ jsx7(
|
|
1151
|
+
Button,
|
|
1152
|
+
{
|
|
1153
|
+
variant: "tertiary",
|
|
1154
|
+
disabled: pagination.page >= pagination.pageCount,
|
|
1155
|
+
onClick: () => search.setPage(pagination.page + 1),
|
|
1156
|
+
children: t("page.next", "Next")
|
|
1157
|
+
}
|
|
1158
|
+
)
|
|
1159
|
+
] })
|
|
1160
|
+
] });
|
|
1161
|
+
};
|
|
1162
|
+
HomePage = () => {
|
|
1163
|
+
const navigate = useNavigate();
|
|
1164
|
+
const { contentTypes, settings, status: schemaStatus } = useSearchableTypes_default();
|
|
1165
|
+
const [pageSize, setPageSize] = useState6(20);
|
|
1166
|
+
const [locales, setLocales] = useState6([]);
|
|
1167
|
+
const minChars = settings.minChars || 2;
|
|
1168
|
+
const search = useGlobalSearch_default({
|
|
1169
|
+
debounce: settings.debounce || 250,
|
|
1170
|
+
minChars,
|
|
1171
|
+
pageSize
|
|
1172
|
+
});
|
|
1173
|
+
useEffect9(() => {
|
|
1174
|
+
let cancelled = false;
|
|
1175
|
+
fetchLocales().then((data) => {
|
|
1176
|
+
if (!cancelled) setLocales(data);
|
|
1177
|
+
});
|
|
1178
|
+
return () => {
|
|
1179
|
+
cancelled = true;
|
|
1180
|
+
};
|
|
1181
|
+
}, []);
|
|
1182
|
+
const { results } = search.data;
|
|
1183
|
+
const headerSubtitle = schemaStatus === "success" ? t(
|
|
1184
|
+
"page.subtitle_ready",
|
|
1185
|
+
"Searching {count} content types \xB7 press Ctrl/Cmd + K anywhere",
|
|
1186
|
+
{ count: contentTypes.length }
|
|
1187
|
+
) : t("page.subtitle_loading", "Discovering content types\u2026");
|
|
1188
|
+
return /* @__PURE__ */ jsxs4(Main, { "aria-busy": search.status === "loading", children: [
|
|
1189
|
+
/* @__PURE__ */ jsx7(
|
|
1190
|
+
Layouts.Header,
|
|
1191
|
+
{
|
|
1192
|
+
title: t("plugin.name", "Global Search"),
|
|
1193
|
+
subtitle: headerSubtitle,
|
|
1194
|
+
primaryAction: /* @__PURE__ */ jsx7(
|
|
1195
|
+
Button,
|
|
1196
|
+
{
|
|
1197
|
+
variant: "secondary",
|
|
1198
|
+
onClick: () => window.dispatchEvent(new CustomEvent("global-search:open")),
|
|
1199
|
+
children: t("page.open_palette", "Open Palette (\u2318K)")
|
|
1200
|
+
}
|
|
1201
|
+
)
|
|
1202
|
+
}
|
|
1203
|
+
),
|
|
1204
|
+
/* @__PURE__ */ jsx7(Layouts.Content, { children: /* @__PURE__ */ jsxs4(Flex3, { direction: "column", alignItems: "stretch", gap: 4, children: [
|
|
1205
|
+
/* @__PURE__ */ jsx7(
|
|
1206
|
+
SearchFiltersBar,
|
|
1207
|
+
{
|
|
1208
|
+
search,
|
|
1209
|
+
contentTypes,
|
|
1210
|
+
locales
|
|
1211
|
+
}
|
|
1212
|
+
),
|
|
1213
|
+
/* @__PURE__ */ jsx7(
|
|
1214
|
+
SearchResultsSection,
|
|
1215
|
+
{
|
|
1216
|
+
status: search.status,
|
|
1217
|
+
isBelowMinChars: search.isBelowMinChars,
|
|
1218
|
+
minChars,
|
|
1219
|
+
trimmedQuery: search.query.trim(),
|
|
1220
|
+
hasTypeFilters: search.selectedTypes.length > 0,
|
|
1221
|
+
results,
|
|
1222
|
+
onSelectHit: (url, newTab) => newTab ? window.open(toAdminUrl(url), "_blank", "noopener") : navigate(url)
|
|
1223
|
+
}
|
|
1224
|
+
),
|
|
1225
|
+
results.length ? /* @__PURE__ */ jsx7(
|
|
1226
|
+
SearchPaginationBar,
|
|
1227
|
+
{
|
|
1228
|
+
search,
|
|
1229
|
+
pageSize,
|
|
1230
|
+
onPageSizeChange: setPageSize
|
|
1231
|
+
}
|
|
1232
|
+
) : null
|
|
1233
|
+
] }) })
|
|
1234
|
+
] });
|
|
1235
|
+
};
|
|
1236
|
+
}
|
|
1237
|
+
});
|
|
1238
|
+
|
|
1239
|
+
// admin/src/pages/App.tsx
|
|
1240
|
+
var App_exports = {};
|
|
1241
|
+
__export(App_exports, {
|
|
1242
|
+
App: () => App,
|
|
1243
|
+
default: () => App_default
|
|
1244
|
+
});
|
|
1245
|
+
import { Page } from "@strapi/strapi/admin";
|
|
1246
|
+
import { Routes, Route } from "react-router-dom";
|
|
1247
|
+
import { jsx as jsx8, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
1248
|
+
var App, App_default;
|
|
1249
|
+
var init_App = __esm({
|
|
1250
|
+
"admin/src/pages/App.tsx"() {
|
|
1251
|
+
"use strict";
|
|
1252
|
+
init_HomePage();
|
|
1253
|
+
App = () => /* @__PURE__ */ jsxs5(Routes, { children: [
|
|
1254
|
+
/* @__PURE__ */ jsx8(Route, { index: true, element: /* @__PURE__ */ jsx8(HomePage, {}) }),
|
|
1255
|
+
/* @__PURE__ */ jsx8(Route, { path: "*", element: /* @__PURE__ */ jsx8(Page.Error, {}) })
|
|
1256
|
+
] });
|
|
1257
|
+
App_default = App;
|
|
1258
|
+
}
|
|
1259
|
+
});
|
|
1260
|
+
|
|
1261
|
+
// admin/src/pages/Settings.tsx
|
|
1262
|
+
var Settings_exports = {};
|
|
1263
|
+
__export(Settings_exports, {
|
|
1264
|
+
SettingsPage: () => SettingsPage,
|
|
1265
|
+
default: () => Settings_default
|
|
1266
|
+
});
|
|
1267
|
+
import {
|
|
1268
|
+
Box as Box5,
|
|
1269
|
+
Button as Button2,
|
|
1270
|
+
Field,
|
|
1271
|
+
Flex as Flex4,
|
|
1272
|
+
Grid,
|
|
1273
|
+
Main as Main2,
|
|
1274
|
+
NumberInput,
|
|
1275
|
+
Table as Table2,
|
|
1276
|
+
Tabs,
|
|
1277
|
+
Tbody as Tbody2,
|
|
1278
|
+
Td as Td2,
|
|
1279
|
+
Th as Th2,
|
|
1280
|
+
Thead as Thead2,
|
|
1281
|
+
Toggle,
|
|
1282
|
+
Tr as Tr2,
|
|
1283
|
+
Typography as Typography6
|
|
1284
|
+
} from "@strapi/design-system";
|
|
1285
|
+
import { Check } from "@strapi/icons";
|
|
1286
|
+
import { Layouts as Layouts2, Page as Page2, useNotification, useRBAC } from "@strapi/strapi/admin";
|
|
1287
|
+
import { useEffect as useEffect10, useState as useState7 } from "react";
|
|
1288
|
+
import { jsx as jsx9, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
1289
|
+
var getNumberFields, extractSaveErrorMessage, getToggleFields, SearchBehaviourPanel, CONTENT_TYPE_COLS, ContentTypesTablePanel, SettingsPage, Settings_default;
|
|
1290
|
+
var init_Settings = __esm({
|
|
1291
|
+
"admin/src/pages/Settings.tsx"() {
|
|
1292
|
+
"use strict";
|
|
1293
|
+
init_searchApi();
|
|
1294
|
+
init_useSearchableTypes();
|
|
1295
|
+
init_permissions();
|
|
1296
|
+
init_getTrad();
|
|
1297
|
+
getNumberFields = () => [
|
|
1298
|
+
{
|
|
1299
|
+
name: "minChars",
|
|
1300
|
+
label: t("settings.min_chars_label", "Minimum characters"),
|
|
1301
|
+
hint: t(
|
|
1302
|
+
"settings.min_chars_hint",
|
|
1303
|
+
"Shorter queries are not sent to the server."
|
|
1304
|
+
)
|
|
1305
|
+
},
|
|
1306
|
+
{
|
|
1307
|
+
name: "debounce",
|
|
1308
|
+
label: t("settings.debounce_label", "Debounce (ms)"),
|
|
1309
|
+
hint: t(
|
|
1310
|
+
"settings.debounce_hint",
|
|
1311
|
+
"How long to wait after the last keystroke."
|
|
1312
|
+
)
|
|
1313
|
+
},
|
|
1314
|
+
{
|
|
1315
|
+
name: "perTypeLimit",
|
|
1316
|
+
label: t("settings.per_type_limit_label", "Results per content type"),
|
|
1317
|
+
hint: t("settings.per_type_limit_hint", "Rows fetched from each type.")
|
|
1318
|
+
},
|
|
1319
|
+
{
|
|
1320
|
+
name: "maxResults",
|
|
1321
|
+
label: t("settings.max_results_label", "Maximum results"),
|
|
1322
|
+
hint: t(
|
|
1323
|
+
"settings.max_results_hint",
|
|
1324
|
+
"Hard cap on the merged, ranked list."
|
|
1325
|
+
)
|
|
1326
|
+
},
|
|
1327
|
+
{
|
|
1328
|
+
name: "maxDepth",
|
|
1329
|
+
label: t("settings.max_depth_label", "Component depth"),
|
|
1330
|
+
hint: t(
|
|
1331
|
+
"settings.max_depth_hint",
|
|
1332
|
+
"How many component levels to search into."
|
|
1333
|
+
)
|
|
1334
|
+
},
|
|
1335
|
+
{
|
|
1336
|
+
name: "queryTimeout",
|
|
1337
|
+
label: t("settings.query_timeout_label", "Query timeout (ms)"),
|
|
1338
|
+
hint: t("settings.query_timeout_hint", "A slower content type is skipped.")
|
|
1339
|
+
},
|
|
1340
|
+
{
|
|
1341
|
+
name: "concurrency",
|
|
1342
|
+
label: t("settings.concurrency_label", "Concurrency"),
|
|
1343
|
+
hint: t(
|
|
1344
|
+
"settings.concurrency_hint",
|
|
1345
|
+
"Maximum content types queried in parallel."
|
|
1346
|
+
)
|
|
1347
|
+
}
|
|
1348
|
+
];
|
|
1349
|
+
extractSaveErrorMessage = (error) => {
|
|
1350
|
+
const err = error;
|
|
1351
|
+
return err?.response?.data?.error?.message || t("settings.error_save", "Could not save global search settings.");
|
|
1352
|
+
};
|
|
1353
|
+
getToggleFields = (settings) => [
|
|
1354
|
+
{
|
|
1355
|
+
name: "deep",
|
|
1356
|
+
label: t("settings.deep_label", "Search inside components"),
|
|
1357
|
+
hint: t("settings.deep_hint", "Also match fields nested in components."),
|
|
1358
|
+
checked: Boolean(settings.deep)
|
|
1359
|
+
},
|
|
1360
|
+
{
|
|
1361
|
+
name: "includeDrafts",
|
|
1362
|
+
label: t("settings.drafts_label", "Include drafts"),
|
|
1363
|
+
hint: t("settings.drafts_hint", "Search unpublished entries too."),
|
|
1364
|
+
checked: Boolean(settings.includeDrafts)
|
|
1365
|
+
},
|
|
1366
|
+
{
|
|
1367
|
+
name: "includePluginContentTypes",
|
|
1368
|
+
label: t("settings.plugins_label", "Include plugin content types"),
|
|
1369
|
+
hint: t(
|
|
1370
|
+
"settings.plugins_hint",
|
|
1371
|
+
"Also search visible content types registered by plugins."
|
|
1372
|
+
),
|
|
1373
|
+
checked: settings.includePluginContentTypes !== false
|
|
1374
|
+
}
|
|
1375
|
+
];
|
|
1376
|
+
SearchBehaviourPanel = ({
|
|
1377
|
+
settings,
|
|
1378
|
+
canEdit,
|
|
1379
|
+
onSetField
|
|
1380
|
+
}) => {
|
|
1381
|
+
const onText = t("common.on", "On");
|
|
1382
|
+
const offText = t("common.off", "Off");
|
|
1383
|
+
return /* @__PURE__ */ jsxs6(Box5, { background: "neutral0", padding: 6, hasRadius: true, shadow: "tableShadow", children: [
|
|
1384
|
+
/* @__PURE__ */ jsx9(Typography6, { variant: "delta", children: t("settings.behaviour_title", "Search behaviour") }),
|
|
1385
|
+
/* @__PURE__ */ jsx9(Box5, { paddingTop: 4, children: /* @__PURE__ */ jsxs6(Grid.Root, { gap: 4, children: [
|
|
1386
|
+
getNumberFields().map((field) => /* @__PURE__ */ jsx9(Grid.Item, { col: 4, s: 12, children: /* @__PURE__ */ jsxs6(Field.Root, { name: field.name, hint: field.hint, children: [
|
|
1387
|
+
/* @__PURE__ */ jsx9(Field.Label, { children: field.label }),
|
|
1388
|
+
/* @__PURE__ */ jsx9(
|
|
1389
|
+
NumberInput,
|
|
1390
|
+
{
|
|
1391
|
+
name: field.name,
|
|
1392
|
+
"aria-label": field.label,
|
|
1393
|
+
value: settings[field.name],
|
|
1394
|
+
onValueChange: (value) => {
|
|
1395
|
+
if (typeof value === "number" && Number.isFinite(value)) {
|
|
1396
|
+
onSetField(
|
|
1397
|
+
field.name,
|
|
1398
|
+
Math.round(value)
|
|
1399
|
+
);
|
|
1400
|
+
}
|
|
1401
|
+
},
|
|
1402
|
+
disabled: !canEdit
|
|
1403
|
+
}
|
|
1404
|
+
),
|
|
1405
|
+
/* @__PURE__ */ jsx9(Field.Hint, {})
|
|
1406
|
+
] }) }, field.name)),
|
|
1407
|
+
getToggleFields(settings).map((field) => /* @__PURE__ */ jsx9(Grid.Item, { col: 4, s: 12, children: /* @__PURE__ */ jsxs6(Field.Root, { name: field.name, hint: field.hint, children: [
|
|
1408
|
+
/* @__PURE__ */ jsx9(Field.Label, { children: field.label }),
|
|
1409
|
+
/* @__PURE__ */ jsx9(
|
|
1410
|
+
Toggle,
|
|
1411
|
+
{
|
|
1412
|
+
name: field.name,
|
|
1413
|
+
"aria-label": field.label,
|
|
1414
|
+
onLabel: onText,
|
|
1415
|
+
offLabel: offText,
|
|
1416
|
+
checked: field.checked,
|
|
1417
|
+
onChange: (event) => onSetField(field.name, event.target.checked),
|
|
1418
|
+
disabled: !canEdit
|
|
1419
|
+
}
|
|
1420
|
+
),
|
|
1421
|
+
/* @__PURE__ */ jsx9(Field.Hint, {})
|
|
1422
|
+
] }) }, field.name))
|
|
1423
|
+
] }) })
|
|
1424
|
+
] });
|
|
1425
|
+
};
|
|
1426
|
+
CONTENT_TYPE_COLS = [
|
|
1427
|
+
["settings.col_content_type", "Content type"],
|
|
1428
|
+
["settings.col_kind", "Kind"],
|
|
1429
|
+
["settings.col_main_field", "Main field"],
|
|
1430
|
+
["settings.col_searchable_fields", "Searchable fields"],
|
|
1431
|
+
["settings.col_enabled", "Enabled"]
|
|
1432
|
+
];
|
|
1433
|
+
ContentTypesTablePanel = ({
|
|
1434
|
+
contentTypes,
|
|
1435
|
+
excluded,
|
|
1436
|
+
canEdit,
|
|
1437
|
+
onToggleContentType
|
|
1438
|
+
}) => /* @__PURE__ */ jsxs6(Box5, { background: "neutral0", padding: 6, hasRadius: true, shadow: "tableShadow", children: [
|
|
1439
|
+
/* @__PURE__ */ jsx9(Typography6, { variant: "delta", children: t("settings.content_types_title", "Content types") }),
|
|
1440
|
+
/* @__PURE__ */ jsx9(Box5, { paddingTop: 1, paddingBottom: 4, children: /* @__PURE__ */ jsx9(Typography6, { textColor: "neutral600", variant: "pi", children: t(
|
|
1441
|
+
"settings.content_types_hint",
|
|
1442
|
+
"Every API and visible plugin content type is discovered automatically. Turn one off to exclude it from search results."
|
|
1443
|
+
) }) }),
|
|
1444
|
+
/* @__PURE__ */ jsxs6(Table2, { colCount: 5, rowCount: contentTypes.length, children: [
|
|
1445
|
+
/* @__PURE__ */ jsx9(Thead2, { children: /* @__PURE__ */ jsx9(Tr2, { children: CONTENT_TYPE_COLS.map(([key, label]) => /* @__PURE__ */ jsx9(Th2, { children: /* @__PURE__ */ jsx9(Typography6, { variant: "sigma", children: t(key, label) }) }, key)) }) }),
|
|
1446
|
+
/* @__PURE__ */ jsx9(Tbody2, { children: contentTypes.map((type) => /* @__PURE__ */ jsxs6(Tr2, { children: [
|
|
1447
|
+
/* @__PURE__ */ jsx9(Td2, { children: /* @__PURE__ */ jsxs6(Box5, { children: [
|
|
1448
|
+
/* @__PURE__ */ jsx9(Typography6, { textColor: "neutral800", fontWeight: "semiBold", children: type.displayName }),
|
|
1449
|
+
/* @__PURE__ */ jsx9(Box5, { children: /* @__PURE__ */ jsx9(Typography6, { variant: "pi", textColor: "neutral500", children: type.uid }) })
|
|
1450
|
+
] }) }),
|
|
1451
|
+
/* @__PURE__ */ jsx9(Td2, { children: /* @__PURE__ */ jsx9(Typography6, { textColor: "neutral600", children: type.kind === "singleType" ? t("settings.kind_single", "Single") : t("settings.kind_collection", "Collection") }) }),
|
|
1452
|
+
/* @__PURE__ */ jsx9(Td2, { children: /* @__PURE__ */ jsx9(Typography6, { textColor: "neutral600", children: type.mainField }) }),
|
|
1453
|
+
/* @__PURE__ */ jsx9(Td2, { children: /* @__PURE__ */ jsx9(
|
|
1454
|
+
Typography6,
|
|
1455
|
+
{
|
|
1456
|
+
textColor: type.searchable ? "neutral600" : "danger600",
|
|
1457
|
+
children: type.searchable ? type.fieldCount : t("common.none", "none")
|
|
1458
|
+
}
|
|
1459
|
+
) }),
|
|
1460
|
+
/* @__PURE__ */ jsx9(Td2, { children: /* @__PURE__ */ jsx9(
|
|
1461
|
+
Toggle,
|
|
1462
|
+
{
|
|
1463
|
+
name: `enabled-${type.uid}`,
|
|
1464
|
+
"aria-label": t(
|
|
1465
|
+
"settings.enable_for_type",
|
|
1466
|
+
"Enable search for {name}",
|
|
1467
|
+
{ name: type.displayName }
|
|
1468
|
+
),
|
|
1469
|
+
onLabel: t("common.on", "On"),
|
|
1470
|
+
offLabel: t("common.off", "Off"),
|
|
1471
|
+
checked: !excluded.includes(type.uid),
|
|
1472
|
+
onChange: () => onToggleContentType(type.uid),
|
|
1473
|
+
disabled: !canEdit || !type.searchable
|
|
1474
|
+
}
|
|
1475
|
+
) })
|
|
1476
|
+
] }, type.uid)) })
|
|
1477
|
+
] })
|
|
1478
|
+
] });
|
|
1479
|
+
SettingsPage = () => {
|
|
1480
|
+
const { toggleNotification } = useNotification();
|
|
1481
|
+
const { allowedActions } = useRBAC(permissions_default.settings);
|
|
1482
|
+
const [isLoading, setIsLoading] = useState7(true);
|
|
1483
|
+
const [isSaving, setIsSaving] = useState7(false);
|
|
1484
|
+
const [settings, setSettings] = useState7(null);
|
|
1485
|
+
const [contentTypes, setContentTypes] = useState7([]);
|
|
1486
|
+
const canEdit = allowedActions.canSettings !== false;
|
|
1487
|
+
const load2 = async () => {
|
|
1488
|
+
setIsLoading(true);
|
|
1489
|
+
try {
|
|
1490
|
+
const [nextSettings, schema] = await Promise.all([
|
|
1491
|
+
fetchSettings(),
|
|
1492
|
+
fetchAllTypes()
|
|
1493
|
+
]);
|
|
1494
|
+
setSettings(nextSettings);
|
|
1495
|
+
setContentTypes(schema.contentTypes || []);
|
|
1496
|
+
} catch {
|
|
1497
|
+
toggleNotification({
|
|
1498
|
+
type: "danger",
|
|
1499
|
+
message: t(
|
|
1500
|
+
"settings.error_load",
|
|
1501
|
+
"Could not load global search settings."
|
|
1502
|
+
)
|
|
1503
|
+
});
|
|
1504
|
+
} finally {
|
|
1505
|
+
setIsLoading(false);
|
|
1506
|
+
}
|
|
1507
|
+
};
|
|
1508
|
+
useEffect10(() => {
|
|
1509
|
+
load2();
|
|
1510
|
+
}, []);
|
|
1511
|
+
const setField = (name, value) => setSettings(
|
|
1512
|
+
(previous) => previous ? { ...previous, [name]: value } : previous
|
|
1513
|
+
);
|
|
1514
|
+
const toggleContentType = (uid) => {
|
|
1515
|
+
setSettings((previous) => {
|
|
1516
|
+
if (!previous) return previous;
|
|
1517
|
+
const excluded = previous.excludedContentTypes || [];
|
|
1518
|
+
return {
|
|
1519
|
+
...previous,
|
|
1520
|
+
excludedContentTypes: excluded.includes(uid) ? excluded.filter((item) => item !== uid) : [...excluded, uid]
|
|
1521
|
+
};
|
|
1522
|
+
});
|
|
1523
|
+
};
|
|
1524
|
+
const save = async () => {
|
|
1525
|
+
if (!settings) return;
|
|
1526
|
+
setIsSaving(true);
|
|
1527
|
+
try {
|
|
1528
|
+
const saved = await updateSettings(settings);
|
|
1529
|
+
const schema = await fetchAllTypes();
|
|
1530
|
+
setSettings(saved);
|
|
1531
|
+
setContentTypes(schema.contentTypes || []);
|
|
1532
|
+
invalidateSearchableTypes();
|
|
1533
|
+
toggleNotification({
|
|
1534
|
+
type: "success",
|
|
1535
|
+
message: t("settings.saved", "Global search settings saved.")
|
|
1536
|
+
});
|
|
1537
|
+
} catch (error) {
|
|
1538
|
+
toggleNotification({
|
|
1539
|
+
type: "danger",
|
|
1540
|
+
message: extractSaveErrorMessage(error)
|
|
1541
|
+
});
|
|
1542
|
+
} finally {
|
|
1543
|
+
setIsSaving(false);
|
|
1544
|
+
}
|
|
1545
|
+
};
|
|
1546
|
+
const restoreDefaults = async () => {
|
|
1547
|
+
setIsSaving(true);
|
|
1548
|
+
try {
|
|
1549
|
+
const restored = await resetSettings();
|
|
1550
|
+
const schema = await fetchAllTypes();
|
|
1551
|
+
setSettings(restored);
|
|
1552
|
+
setContentTypes(schema.contentTypes || []);
|
|
1553
|
+
invalidateSearchableTypes();
|
|
1554
|
+
toggleNotification({
|
|
1555
|
+
type: "success",
|
|
1556
|
+
message: t("settings.restored", "Defaults restored.")
|
|
1557
|
+
});
|
|
1558
|
+
} catch {
|
|
1559
|
+
toggleNotification({
|
|
1560
|
+
type: "danger",
|
|
1561
|
+
message: t("settings.error_restore", "Could not restore defaults.")
|
|
1562
|
+
});
|
|
1563
|
+
} finally {
|
|
1564
|
+
setIsSaving(false);
|
|
1565
|
+
}
|
|
1566
|
+
};
|
|
1567
|
+
if (isLoading || !settings) return /* @__PURE__ */ jsx9(Page2.Loading, {});
|
|
1568
|
+
const ctTabTitle = t("settings.content_types_title", "Content types");
|
|
1569
|
+
return /* @__PURE__ */ jsxs6(Main2, { children: [
|
|
1570
|
+
/* @__PURE__ */ jsx9(
|
|
1571
|
+
Layouts2.Header,
|
|
1572
|
+
{
|
|
1573
|
+
title: t("plugin.name", "Global Search"),
|
|
1574
|
+
subtitle: t(
|
|
1575
|
+
"settings.subtitle",
|
|
1576
|
+
"Tune how the search page and the Ctrl/Cmd + K palette query your content."
|
|
1577
|
+
),
|
|
1578
|
+
primaryAction: /* @__PURE__ */ jsxs6(Flex4, { gap: 2, children: [
|
|
1579
|
+
/* @__PURE__ */ jsx9(
|
|
1580
|
+
Button2,
|
|
1581
|
+
{
|
|
1582
|
+
variant: "tertiary",
|
|
1583
|
+
onClick: restoreDefaults,
|
|
1584
|
+
disabled: !canEdit || isSaving,
|
|
1585
|
+
children: t("settings.restore_defaults", "Restore defaults")
|
|
1586
|
+
}
|
|
1587
|
+
),
|
|
1588
|
+
/* @__PURE__ */ jsx9(
|
|
1589
|
+
Button2,
|
|
1590
|
+
{
|
|
1591
|
+
startIcon: /* @__PURE__ */ jsx9(Check, {}),
|
|
1592
|
+
onClick: save,
|
|
1593
|
+
loading: isSaving,
|
|
1594
|
+
disabled: !canEdit,
|
|
1595
|
+
children: t("settings.save", "Save")
|
|
1596
|
+
}
|
|
1597
|
+
)
|
|
1598
|
+
] })
|
|
1599
|
+
}
|
|
1600
|
+
),
|
|
1601
|
+
/* @__PURE__ */ jsx9(Layouts2.Content, { children: /* @__PURE__ */ jsxs6(Tabs.Root, { defaultValue: "behaviour", variant: "simple", children: [
|
|
1602
|
+
/* @__PURE__ */ jsxs6(Tabs.List, { "aria-label": t("plugin.name", "Global Search"), children: [
|
|
1603
|
+
/* @__PURE__ */ jsx9(Tabs.Trigger, { value: "behaviour", children: t("settings.behaviour_title", "Search behaviour") }),
|
|
1604
|
+
/* @__PURE__ */ jsx9(Tabs.Trigger, { value: "content-types", children: `${ctTabTitle} (${contentTypes.length})` })
|
|
1605
|
+
] }),
|
|
1606
|
+
/* @__PURE__ */ jsx9(Tabs.Content, { value: "behaviour", children: /* @__PURE__ */ jsx9(Box5, { paddingTop: 4, children: /* @__PURE__ */ jsx9(
|
|
1607
|
+
SearchBehaviourPanel,
|
|
1608
|
+
{
|
|
1609
|
+
settings,
|
|
1610
|
+
canEdit,
|
|
1611
|
+
onSetField: setField
|
|
1612
|
+
}
|
|
1613
|
+
) }) }),
|
|
1614
|
+
/* @__PURE__ */ jsx9(Tabs.Content, { value: "content-types", children: /* @__PURE__ */ jsx9(Box5, { paddingTop: 4, children: /* @__PURE__ */ jsx9(
|
|
1615
|
+
ContentTypesTablePanel,
|
|
1616
|
+
{
|
|
1617
|
+
contentTypes,
|
|
1618
|
+
excluded: settings.excludedContentTypes || [],
|
|
1619
|
+
canEdit,
|
|
1620
|
+
onToggleContentType: toggleContentType
|
|
1621
|
+
}
|
|
1622
|
+
) }) })
|
|
1623
|
+
] }) })
|
|
1624
|
+
] });
|
|
1625
|
+
};
|
|
1626
|
+
Settings_default = SettingsPage;
|
|
1627
|
+
}
|
|
1628
|
+
});
|
|
1629
|
+
|
|
1630
|
+
// ../plugin-shared/dist/options.js
|
|
1631
|
+
function freezeOptions(items) {
|
|
1632
|
+
return Object.freeze(items.map((item) => Object.freeze({ ...item })));
|
|
1633
|
+
}
|
|
1634
|
+
var LOCALE_OPTIONS = freezeOptions([
|
|
1635
|
+
{ value: "es", label: "es \u2014 Espa\xF1ol (Spanish)" },
|
|
1636
|
+
{ value: "en", label: "en \u2014 English" },
|
|
1637
|
+
{ value: "ar", label: "ar \u2014 \u0627\u0644\u0639\u0631\u0628\u064A\u0629 (Arabic)" },
|
|
1638
|
+
{ value: "tr", label: "tr \u2014 T\xFCrk\xE7e (Turkish)" },
|
|
1639
|
+
{ value: "fr", label: "fr \u2014 Fran\xE7ais (French)" },
|
|
1640
|
+
{ value: "de", label: "de \u2014 Deutsch (German)" },
|
|
1641
|
+
{ value: "pt", label: "pt \u2014 Portugu\xEAs (Portuguese)" },
|
|
1642
|
+
{ value: "it", label: "it \u2014 Italiano (Italian)" },
|
|
1643
|
+
{ value: "nl", label: "nl \u2014 Nederlands (Dutch)" },
|
|
1644
|
+
{ value: "pl", label: "pl \u2014 Polski (Polish)" },
|
|
1645
|
+
{ value: "ru", label: "ru \u2014 \u0420\u0443\u0441\u0441\u043A\u0438\u0439 (Russian)" },
|
|
1646
|
+
{ value: "id", label: "id \u2014 Bahasa Indonesia" },
|
|
1647
|
+
{ value: "ur", label: "ur \u2014 \u0627\u0631\u062F\u0648 (Urdu)" },
|
|
1648
|
+
{ value: "zh", label: "zh \u2014 \u4E2D\u6587 (Chinese)" }
|
|
1649
|
+
]);
|
|
1650
|
+
var SECONDARY_CALENDAR_OPTIONS = freezeOptions([
|
|
1651
|
+
{
|
|
1652
|
+
value: "islamic-umalqura",
|
|
1653
|
+
label: "islamic-umalqura (Hijri Umm al-Qura)"
|
|
1654
|
+
},
|
|
1655
|
+
{ value: "islamic-civil", label: "islamic-civil (Tabular Islamic Civil)" },
|
|
1656
|
+
{ value: "islamic-tbla", label: "islamic-tbla (Tabular Astronomical)" },
|
|
1657
|
+
{ value: "hebrew", label: "hebrew (Hebrew)" },
|
|
1658
|
+
{ value: "persian", label: "persian (Solar Hijri)" },
|
|
1659
|
+
{ value: "none", label: "none (Gregorian Only)" }
|
|
1660
|
+
]);
|
|
1661
|
+
|
|
1662
|
+
// ../plugin-shared/dist/translations.js
|
|
1663
|
+
var VALID_LOCALE_RE = /^[A-Za-z]{2,3}(?:-[A-Za-z0-9]{2,8}){0,4}$/;
|
|
1664
|
+
function isTranslationRecord(value) {
|
|
1665
|
+
return Boolean(value) && typeof value === "object" && !Array.isArray(value);
|
|
1666
|
+
}
|
|
1667
|
+
function extractDictionary(loaded) {
|
|
1668
|
+
if (!isTranslationRecord(loaded)) {
|
|
1669
|
+
return void 0;
|
|
1670
|
+
}
|
|
1671
|
+
if ("default" in loaded) {
|
|
1672
|
+
return isTranslationRecord(loaded.default) ? loaded.default : void 0;
|
|
1673
|
+
}
|
|
1674
|
+
return loaded;
|
|
1675
|
+
}
|
|
1676
|
+
function getLookupCandidates(locale, fallbackToLanguage) {
|
|
1677
|
+
const trimmed = locale.trim();
|
|
1678
|
+
if (!VALID_LOCALE_RE.test(trimmed)) {
|
|
1679
|
+
return [];
|
|
1680
|
+
}
|
|
1681
|
+
if (!fallbackToLanguage || !trimmed.includes("-")) {
|
|
1682
|
+
return [trimmed];
|
|
1683
|
+
}
|
|
1684
|
+
const base = trimmed.split("-")[0];
|
|
1685
|
+
return base && base !== trimmed ? [trimmed, base] : [trimmed];
|
|
1686
|
+
}
|
|
1687
|
+
function prefixPluginTranslations(trad, pluginId2, options) {
|
|
1688
|
+
const normalizedPluginId = typeof pluginId2 === "string" ? pluginId2.trim() : "";
|
|
1689
|
+
if (!normalizedPluginId) {
|
|
1690
|
+
throw new TypeError("pluginId can't be empty");
|
|
1691
|
+
}
|
|
1692
|
+
const result = {};
|
|
1693
|
+
if (options?.baseTranslations) {
|
|
1694
|
+
for (const [key, value] of Object.entries(options.baseTranslations)) {
|
|
1695
|
+
if (typeof value === "string") {
|
|
1696
|
+
result[key] = value;
|
|
1697
|
+
}
|
|
1698
|
+
}
|
|
1699
|
+
}
|
|
1700
|
+
const prefix = `${normalizedPluginId}.`;
|
|
1701
|
+
const explicitPrefixed = [];
|
|
1702
|
+
for (const [key, value] of Object.entries(trad)) {
|
|
1703
|
+
if (typeof value !== "string") {
|
|
1704
|
+
continue;
|
|
1705
|
+
}
|
|
1706
|
+
if (options?.keepUnprefixed) {
|
|
1707
|
+
result[key] = value;
|
|
1708
|
+
}
|
|
1709
|
+
if (key.startsWith(prefix)) {
|
|
1710
|
+
explicitPrefixed.push([key, value]);
|
|
1711
|
+
} else {
|
|
1712
|
+
result[`${prefix}${key}`] = value;
|
|
1713
|
+
}
|
|
1714
|
+
}
|
|
1715
|
+
for (const [key, value] of explicitPrefixed) {
|
|
1716
|
+
result[key] = value;
|
|
1717
|
+
}
|
|
1718
|
+
return result;
|
|
1719
|
+
}
|
|
1720
|
+
function createRegisterTrads(options) {
|
|
1721
|
+
const { pluginId: pluginId2, defaultLocales = ["en", "es", "ar", "tr"], supportedLocales, keepUnprefixed = true, fallbackToLanguageCode = true, loadTranslation, translations, getBaseTranslations, onLoaded } = options;
|
|
1722
|
+
const normalizedPluginId = typeof pluginId2 === "string" ? pluginId2.trim() : "";
|
|
1723
|
+
if (!normalizedPluginId) {
|
|
1724
|
+
throw new TypeError("pluginId can't be empty");
|
|
1725
|
+
}
|
|
1726
|
+
const supportedSet = supportedLocales ? new Set(supportedLocales) : void 0;
|
|
1727
|
+
const effectiveDefaults = supportedSet ? defaultLocales.filter((loc) => getLookupCandidates(loc, fallbackToLanguageCode).some((candidate) => supportedSet.has(candidate))) : defaultLocales;
|
|
1728
|
+
return async function registerTrads({ locales = [] } = {}) {
|
|
1729
|
+
const allLocales = effectiveDefaults.length > 0 ? Array.from(/* @__PURE__ */ new Set([...locales, ...effectiveDefaults])) : Array.from(new Set(locales));
|
|
1730
|
+
return Promise.all(allLocales.map(async (locale) => {
|
|
1731
|
+
const candidates = getLookupCandidates(locale, fallbackToLanguageCode);
|
|
1732
|
+
if (candidates.length === 0) {
|
|
1733
|
+
return { data: {}, locale };
|
|
1734
|
+
}
|
|
1735
|
+
if (supportedSet && !candidates.some((candidate) => supportedSet.has(candidate))) {
|
|
1736
|
+
return { data: {}, locale };
|
|
1737
|
+
}
|
|
1738
|
+
let rawData;
|
|
1739
|
+
for (const candidate of candidates) {
|
|
1740
|
+
if (translations && Object.hasOwn(translations, candidate)) {
|
|
1741
|
+
rawData = extractDictionary(translations[candidate]);
|
|
1742
|
+
if (rawData) {
|
|
1743
|
+
break;
|
|
1744
|
+
}
|
|
1745
|
+
}
|
|
1746
|
+
if (loadTranslation) {
|
|
1747
|
+
try {
|
|
1748
|
+
const loaded = await loadTranslation(candidate);
|
|
1749
|
+
rawData = extractDictionary(loaded);
|
|
1750
|
+
if (rawData) {
|
|
1751
|
+
break;
|
|
1752
|
+
}
|
|
1753
|
+
} catch {
|
|
1754
|
+
}
|
|
1755
|
+
}
|
|
1756
|
+
}
|
|
1757
|
+
const baseTranslations = getBaseTranslations?.(locale);
|
|
1758
|
+
const hasBase = Boolean(baseTranslations) && Object.keys(baseTranslations).length > 0;
|
|
1759
|
+
if (!rawData && !hasBase) {
|
|
1760
|
+
return { data: {}, locale };
|
|
1761
|
+
}
|
|
1762
|
+
const prefixed = prefixPluginTranslations(rawData ?? {}, normalizedPluginId, {
|
|
1763
|
+
keepUnprefixed,
|
|
1764
|
+
baseTranslations
|
|
1765
|
+
});
|
|
1766
|
+
onLoaded?.(locale, prefixed);
|
|
1767
|
+
return { data: prefixed, locale };
|
|
1768
|
+
}));
|
|
1769
|
+
};
|
|
1770
|
+
}
|
|
1771
|
+
|
|
1772
|
+
// admin/src/index.ts
|
|
1773
|
+
import React2 from "react";
|
|
1774
|
+
import { createRoot } from "react-dom/client";
|
|
1775
|
+
|
|
1776
|
+
// admin/src/components/GlobalSearchPortal.tsx
|
|
1777
|
+
import { DesignSystemProvider } from "@strapi/design-system";
|
|
1778
|
+
import { useEffect as useEffect7, useState as useState5 } from "react";
|
|
1779
|
+
|
|
1780
|
+
// admin/src/hooks/useHotkey.ts
|
|
1781
|
+
import { useEffect, useRef } from "react";
|
|
1782
|
+
var useHotkey = (handler) => {
|
|
1783
|
+
const handlerRef = useRef(handler);
|
|
1784
|
+
handlerRef.current = handler;
|
|
1785
|
+
useEffect(() => {
|
|
1786
|
+
const onKeyDown = (event) => {
|
|
1787
|
+
if (event.key !== "k" && event.key !== "K") return;
|
|
1788
|
+
if (!event.metaKey && !event.ctrlKey) return;
|
|
1789
|
+
if (event.altKey) return;
|
|
1790
|
+
event.preventDefault();
|
|
1791
|
+
event.stopPropagation();
|
|
1792
|
+
handlerRef.current();
|
|
1793
|
+
};
|
|
1794
|
+
document.addEventListener("keydown", onKeyDown, true);
|
|
1795
|
+
return () => document.removeEventListener("keydown", onKeyDown, true);
|
|
1796
|
+
}, []);
|
|
1797
|
+
};
|
|
1798
|
+
var useHotkey_default = useHotkey;
|
|
1799
|
+
|
|
1800
|
+
// admin/src/components/GlobalSearchPortal.tsx
|
|
1801
|
+
init_getTrad();
|
|
1802
|
+
|
|
1803
|
+
// admin/src/utils/theme.ts
|
|
1804
|
+
import { darkTheme, lightTheme } from "@strapi/design-system";
|
|
1805
|
+
import { useEffect as useEffect2, useState } from "react";
|
|
1806
|
+
var THEME_STORAGE_KEY = "STRAPI_THEME";
|
|
1807
|
+
var DARK_QUERY = "(prefers-color-scheme: dark)";
|
|
1808
|
+
var readStoredTheme = () => {
|
|
1809
|
+
if (typeof window === "undefined") return "light";
|
|
1810
|
+
try {
|
|
1811
|
+
const raw = window.localStorage.getItem(THEME_STORAGE_KEY);
|
|
1812
|
+
if (!raw) return "system";
|
|
1813
|
+
return raw.replace(/^"|"$/g, "");
|
|
1814
|
+
} catch {
|
|
1815
|
+
return "system";
|
|
1816
|
+
}
|
|
1817
|
+
};
|
|
1818
|
+
var resolve = (preference) => {
|
|
1819
|
+
if (preference === "dark") return darkTheme;
|
|
1820
|
+
if (preference === "light") return lightTheme;
|
|
1821
|
+
if (typeof window === "undefined") return lightTheme;
|
|
1822
|
+
const prefersDark = window.matchMedia && window.matchMedia(DARK_QUERY).matches;
|
|
1823
|
+
return prefersDark ? darkTheme : lightTheme;
|
|
1824
|
+
};
|
|
1825
|
+
var useAdminTheme = () => {
|
|
1826
|
+
const [theme, setTheme] = useState(() => resolve(readStoredTheme()));
|
|
1827
|
+
useEffect2(() => {
|
|
1828
|
+
if (typeof window === "undefined") return void 0;
|
|
1829
|
+
const sync = () => setTheme(resolve(readStoredTheme()));
|
|
1830
|
+
window.addEventListener("storage", sync);
|
|
1831
|
+
const media = window.matchMedia ? window.matchMedia(DARK_QUERY) : null;
|
|
1832
|
+
if (media && media.addEventListener) media.addEventListener("change", sync);
|
|
1833
|
+
const interval = window.setInterval(sync, 2e3);
|
|
1834
|
+
return () => {
|
|
1835
|
+
window.removeEventListener("storage", sync);
|
|
1836
|
+
if (media && media.removeEventListener)
|
|
1837
|
+
media.removeEventListener("change", sync);
|
|
1838
|
+
window.clearInterval(interval);
|
|
1839
|
+
};
|
|
1840
|
+
}, []);
|
|
1841
|
+
return theme;
|
|
1842
|
+
};
|
|
1843
|
+
|
|
1844
|
+
// admin/src/components/SearchOverlay.tsx
|
|
1845
|
+
init_useGlobalSearch();
|
|
1846
|
+
init_useSearchableTypes();
|
|
1847
|
+
init_adminBase();
|
|
1848
|
+
init_getTrad();
|
|
1849
|
+
import {
|
|
1850
|
+
Box as Box2,
|
|
1851
|
+
Divider,
|
|
1852
|
+
Flex as Flex2,
|
|
1853
|
+
Loader,
|
|
1854
|
+
Modal,
|
|
1855
|
+
TextInput,
|
|
1856
|
+
Typography as Typography3,
|
|
1857
|
+
VisuallyHidden
|
|
1858
|
+
} from "@strapi/design-system";
|
|
1859
|
+
import { Search } from "@strapi/icons";
|
|
1860
|
+
import {
|
|
1861
|
+
useEffect as useEffect6,
|
|
1862
|
+
useMemo as useMemo2,
|
|
1863
|
+
useRef as useRef4,
|
|
1864
|
+
useState as useState4
|
|
1865
|
+
} from "react";
|
|
1866
|
+
import { styled as styled2 } from "styled-components";
|
|
1867
|
+
|
|
1868
|
+
// admin/src/components/ResultItem.tsx
|
|
1869
|
+
init_getTrad();
|
|
1870
|
+
init_Highlight();
|
|
1871
|
+
import { Badge, Box, Flex, Typography as Typography2 } from "@strapi/design-system";
|
|
1872
|
+
import { useEffect as useEffect5, useRef as useRef3 } from "react";
|
|
1873
|
+
import { styled } from "styled-components";
|
|
1874
|
+
import { jsx as jsx2, jsxs } from "react/jsx-runtime";
|
|
1875
|
+
var Row = styled(Box)`
|
|
1876
|
+
cursor: pointer;
|
|
1877
|
+
border-left: 3px solid
|
|
1878
|
+
${({ theme, $active }) => $active ? theme.colors.primary600 : "transparent"};
|
|
1879
|
+
background: ${({ theme, $active }) => $active ? theme.colors.primary100 : "transparent"};
|
|
1880
|
+
|
|
1881
|
+
&:hover {
|
|
1882
|
+
background: ${({ theme, $active }) => $active ? theme.colors.primary100 : theme.colors.neutral100};
|
|
1883
|
+
}
|
|
1884
|
+
`;
|
|
1885
|
+
var getHitOptionId = (hit) => [
|
|
1886
|
+
"global-search-option",
|
|
1887
|
+
hit.contentTypeUid,
|
|
1888
|
+
hit.documentId || hit.id,
|
|
1889
|
+
hit.locale || "default"
|
|
1890
|
+
].join("-");
|
|
1891
|
+
var ResultItem = ({
|
|
1892
|
+
hit,
|
|
1893
|
+
query,
|
|
1894
|
+
isActive,
|
|
1895
|
+
onSelect,
|
|
1896
|
+
onHover = () => {
|
|
1897
|
+
}
|
|
1898
|
+
}) => {
|
|
1899
|
+
const rowRef = useRef3(null);
|
|
1900
|
+
useEffect5(() => {
|
|
1901
|
+
if (isActive && rowRef.current?.scrollIntoView) {
|
|
1902
|
+
rowRef.current.scrollIntoView({ block: "nearest" });
|
|
1903
|
+
}
|
|
1904
|
+
}, [isActive]);
|
|
1905
|
+
const extras = (hit.extra || []).filter(
|
|
1906
|
+
(item) => item.value !== null && item.value !== void 0 && item.value !== ""
|
|
1907
|
+
);
|
|
1908
|
+
return /* @__PURE__ */ jsx2(
|
|
1909
|
+
Row,
|
|
1910
|
+
{
|
|
1911
|
+
ref: rowRef,
|
|
1912
|
+
$active: isActive,
|
|
1913
|
+
paddingTop: 3,
|
|
1914
|
+
paddingBottom: 3,
|
|
1915
|
+
paddingLeft: 4,
|
|
1916
|
+
paddingRight: 4,
|
|
1917
|
+
onClick: () => onSelect(hit),
|
|
1918
|
+
onMouseEnter: onHover,
|
|
1919
|
+
role: "option",
|
|
1920
|
+
"aria-selected": isActive,
|
|
1921
|
+
id: getHitOptionId(hit),
|
|
1922
|
+
children: /* @__PURE__ */ jsxs(Flex, { justifyContent: "space-between", gap: 4, alignItems: "flex-start", children: [
|
|
1923
|
+
/* @__PURE__ */ jsxs(Box, { style: { minWidth: 0, flex: 1 }, children: [
|
|
1924
|
+
/* @__PURE__ */ jsxs(Flex, { gap: 2, alignItems: "center", children: [
|
|
1925
|
+
/* @__PURE__ */ jsx2(Typography2, { fontWeight: "semiBold", textColor: "neutral800", ellipsis: true, children: /* @__PURE__ */ jsx2(
|
|
1926
|
+
Highlight,
|
|
1927
|
+
{
|
|
1928
|
+
text: String(hit.title),
|
|
1929
|
+
query,
|
|
1930
|
+
textColor: "neutral800"
|
|
1931
|
+
}
|
|
1932
|
+
) }),
|
|
1933
|
+
/* @__PURE__ */ jsxs(Typography2, { variant: "pi", textColor: "neutral500", children: [
|
|
1934
|
+
"#",
|
|
1935
|
+
hit.documentId || hit.id
|
|
1936
|
+
] })
|
|
1937
|
+
] }),
|
|
1938
|
+
extras.length > 0 ? /* @__PURE__ */ jsx2(Flex, { gap: 3, paddingTop: 1, wrap: "wrap", children: extras.map((item) => /* @__PURE__ */ jsxs(
|
|
1939
|
+
Typography2,
|
|
1940
|
+
{
|
|
1941
|
+
variant: "pi",
|
|
1942
|
+
textColor: "neutral500",
|
|
1943
|
+
children: [
|
|
1944
|
+
item.field,
|
|
1945
|
+
": ",
|
|
1946
|
+
String(item.value)
|
|
1947
|
+
]
|
|
1948
|
+
},
|
|
1949
|
+
item.field
|
|
1950
|
+
)) }) : null,
|
|
1951
|
+
hit.matchedSnippet && hit.matchedField !== hit.mainField ? /* @__PURE__ */ jsxs(Box, { paddingTop: 1, children: [
|
|
1952
|
+
/* @__PURE__ */ jsxs(Typography2, { variant: "pi", textColor: "neutral500", children: [
|
|
1953
|
+
hit.matchedFieldLabel,
|
|
1954
|
+
":",
|
|
1955
|
+
" "
|
|
1956
|
+
] }),
|
|
1957
|
+
/* @__PURE__ */ jsx2(Typography2, { variant: "pi", tag: "span", children: /* @__PURE__ */ jsx2(Highlight, { text: hit.matchedSnippet, query }) })
|
|
1958
|
+
] }) : null
|
|
1959
|
+
] }),
|
|
1960
|
+
/* @__PURE__ */ jsxs(Flex, { gap: 2, alignItems: "center", shrink: 0, children: [
|
|
1961
|
+
hit.locale ? /* @__PURE__ */ jsx2(Typography2, { variant: "pi", textColor: "neutral500", children: hit.locale }) : null,
|
|
1962
|
+
hit.status ? /* @__PURE__ */ jsx2(Badge, { children: t(`status.${hit.status}`, hit.status) }) : null,
|
|
1963
|
+
/* @__PURE__ */ jsx2(Typography2, { variant: "pi", textColor: "neutral600", children: hit.contentTypeLabel })
|
|
1964
|
+
] })
|
|
1965
|
+
] })
|
|
1966
|
+
}
|
|
1967
|
+
);
|
|
1968
|
+
};
|
|
1969
|
+
|
|
1970
|
+
// admin/src/components/SearchOverlay.tsx
|
|
1971
|
+
import { jsx as jsx3, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
1972
|
+
var ResultsScroller = styled2(Box2)`
|
|
1973
|
+
max-height: 45vh;
|
|
1974
|
+
overflow-y: auto;
|
|
1975
|
+
`;
|
|
1976
|
+
var PALETTE_PAGE_SIZE = 30;
|
|
1977
|
+
var LISTBOX_ID = "global-search-results-listbox";
|
|
1978
|
+
var navigateToHit = (hit, newTab, onClose) => {
|
|
1979
|
+
const url = toAdminUrl(hit.adminUrl);
|
|
1980
|
+
if (newTab) {
|
|
1981
|
+
window.open(url, "_blank", "noopener");
|
|
1982
|
+
return;
|
|
1983
|
+
}
|
|
1984
|
+
onClose();
|
|
1985
|
+
try {
|
|
1986
|
+
window.history.pushState({}, "", url);
|
|
1987
|
+
window.dispatchEvent(new PopStateEvent("popstate"));
|
|
1988
|
+
} catch {
|
|
1989
|
+
window.location.assign(url);
|
|
1990
|
+
}
|
|
1991
|
+
};
|
|
1992
|
+
var OverlayBody = ({
|
|
1993
|
+
isBelowMinChars,
|
|
1994
|
+
minChars,
|
|
1995
|
+
status,
|
|
1996
|
+
query,
|
|
1997
|
+
results,
|
|
1998
|
+
activeIndex,
|
|
1999
|
+
onSelect,
|
|
2000
|
+
onHoverIndex
|
|
2001
|
+
}) => {
|
|
2002
|
+
if (isBelowMinChars) {
|
|
2003
|
+
return /* @__PURE__ */ jsx3(Box2, { padding: 6, children: /* @__PURE__ */ jsx3(Typography3, { textColor: "neutral500", children: t(
|
|
2004
|
+
"palette.min_chars",
|
|
2005
|
+
"Type at least {count} characters to search.",
|
|
2006
|
+
{
|
|
2007
|
+
count: minChars
|
|
2008
|
+
}
|
|
2009
|
+
) }) });
|
|
2010
|
+
}
|
|
2011
|
+
if (status === "idle") {
|
|
2012
|
+
return /* @__PURE__ */ jsx3(Box2, { padding: 6, children: /* @__PURE__ */ jsx3(Typography3, { textColor: "neutral500", children: t(
|
|
2013
|
+
"palette.idle_hint",
|
|
2014
|
+
"Search every collection type and single type by id, name, or any text field."
|
|
2015
|
+
) }) });
|
|
2016
|
+
}
|
|
2017
|
+
if (status === "error") {
|
|
2018
|
+
return /* @__PURE__ */ jsx3(Box2, { padding: 6, children: /* @__PURE__ */ jsx3(Typography3, { textColor: "danger600", children: t(
|
|
2019
|
+
"palette.error",
|
|
2020
|
+
"Search failed. Check that you have permission to read content, and see the server logs."
|
|
2021
|
+
) }) });
|
|
2022
|
+
}
|
|
2023
|
+
if (status === "loading" && !results.length) {
|
|
2024
|
+
return /* @__PURE__ */ jsx3(Flex2, { justifyContent: "center", padding: 6, children: /* @__PURE__ */ jsx3(Loader, { children: t("common.searching", "Searching\u2026") }) });
|
|
2025
|
+
}
|
|
2026
|
+
if (!results.length) {
|
|
2027
|
+
return /* @__PURE__ */ jsx3(Box2, { padding: 6, children: /* @__PURE__ */ jsx3(Typography3, { textColor: "neutral500", children: t("common.no_results", "No results for \u201C{query}\u201D.", { query }) }) });
|
|
2028
|
+
}
|
|
2029
|
+
return /* @__PURE__ */ jsx3(
|
|
2030
|
+
ResultsScroller,
|
|
2031
|
+
{
|
|
2032
|
+
id: LISTBOX_ID,
|
|
2033
|
+
role: "listbox",
|
|
2034
|
+
"aria-label": t("palette.results_aria", "Search results"),
|
|
2035
|
+
children: results.map((hit, index) => /* @__PURE__ */ jsx3(
|
|
2036
|
+
ResultItem,
|
|
2037
|
+
{
|
|
2038
|
+
hit,
|
|
2039
|
+
query: query.trim(),
|
|
2040
|
+
isActive: index === activeIndex,
|
|
2041
|
+
onSelect,
|
|
2042
|
+
onHover: () => onHoverIndex(index)
|
|
2043
|
+
},
|
|
2044
|
+
[
|
|
2045
|
+
hit.contentTypeUid,
|
|
2046
|
+
hit.documentId || hit.id,
|
|
2047
|
+
hit.locale || ""
|
|
2048
|
+
].join("-")
|
|
2049
|
+
))
|
|
2050
|
+
}
|
|
2051
|
+
);
|
|
2052
|
+
};
|
|
2053
|
+
var SearchOverlay = ({ onClose }) => {
|
|
2054
|
+
const { settings } = useSearchableTypes_default();
|
|
2055
|
+
const minChars = settings.minChars || 2;
|
|
2056
|
+
const search = useGlobalSearch_default({
|
|
2057
|
+
debounce: settings.debounce || 250,
|
|
2058
|
+
minChars,
|
|
2059
|
+
pageSize: PALETTE_PAGE_SIZE
|
|
2060
|
+
});
|
|
2061
|
+
const [activeIndex, setActiveIndex] = useState4(0);
|
|
2062
|
+
const inputRef = useRef4(null);
|
|
2063
|
+
const results = useMemo2(() => search.data.results || [], [search.data]);
|
|
2064
|
+
useEffect6(() => {
|
|
2065
|
+
const timer = setTimeout(
|
|
2066
|
+
() => inputRef.current && inputRef.current.focus(),
|
|
2067
|
+
0
|
|
2068
|
+
);
|
|
2069
|
+
return () => clearTimeout(timer);
|
|
2070
|
+
}, []);
|
|
2071
|
+
useEffect6(() => {
|
|
2072
|
+
setActiveIndex(0);
|
|
2073
|
+
}, [search.query, results.length]);
|
|
2074
|
+
const open = (hit, newTab = false) => {
|
|
2075
|
+
if (hit) navigateToHit(hit, newTab, onClose);
|
|
2076
|
+
};
|
|
2077
|
+
const onKeyDown = (event) => {
|
|
2078
|
+
if (event.key === "ArrowDown") {
|
|
2079
|
+
event.preventDefault();
|
|
2080
|
+
setActiveIndex(
|
|
2081
|
+
(index) => results.length ? (index + 1) % results.length : 0
|
|
2082
|
+
);
|
|
2083
|
+
} else if (event.key === "ArrowUp") {
|
|
2084
|
+
event.preventDefault();
|
|
2085
|
+
setActiveIndex(
|
|
2086
|
+
(index) => results.length ? (index - 1 + results.length) % results.length : 0
|
|
2087
|
+
);
|
|
2088
|
+
} else if (event.key === "Enter") {
|
|
2089
|
+
event.preventDefault();
|
|
2090
|
+
const hit = results[activeIndex];
|
|
2091
|
+
if (hit) open(hit, event.metaKey || event.ctrlKey);
|
|
2092
|
+
} else if (event.key === "Escape") {
|
|
2093
|
+
event.preventDefault();
|
|
2094
|
+
onClose();
|
|
2095
|
+
}
|
|
2096
|
+
};
|
|
2097
|
+
const countSuffix = search.data.meta.capped ? "+" : "";
|
|
2098
|
+
const totalCount = `${search.data.pagination.total}${countSuffix}`;
|
|
2099
|
+
const activeHit = results[activeIndex];
|
|
2100
|
+
const activeOptionId = activeHit ? getHitOptionId(activeHit) : void 0;
|
|
2101
|
+
return /* @__PURE__ */ jsx3(Modal.Root, { open: true, onOpenChange: (isOpen) => !isOpen && onClose(), children: /* @__PURE__ */ jsx3(Modal.Content, { children: /* @__PURE__ */ jsxs2(Box2, { onKeyDown, children: [
|
|
2102
|
+
/* @__PURE__ */ jsx3(VisuallyHidden, { children: /* @__PURE__ */ jsx3(Typography3, { id: "global-search-palette-title", children: t("palette.title", "Global search") }) }),
|
|
2103
|
+
/* @__PURE__ */ jsx3(
|
|
2104
|
+
Box2,
|
|
2105
|
+
{
|
|
2106
|
+
paddingLeft: 4,
|
|
2107
|
+
paddingRight: 4,
|
|
2108
|
+
paddingTop: 4,
|
|
2109
|
+
paddingBottom: 3,
|
|
2110
|
+
children: /* @__PURE__ */ jsx3(
|
|
2111
|
+
TextInput,
|
|
2112
|
+
{
|
|
2113
|
+
ref: inputRef,
|
|
2114
|
+
name: "global-search-palette",
|
|
2115
|
+
role: "combobox",
|
|
2116
|
+
"aria-expanded": results.length > 0,
|
|
2117
|
+
"aria-controls": LISTBOX_ID,
|
|
2118
|
+
"aria-activedescendant": activeOptionId,
|
|
2119
|
+
"aria-label": t("palette.title", "Global search"),
|
|
2120
|
+
placeholder: t("palette.placeholder", "Search all content\u2026"),
|
|
2121
|
+
startIcon: /* @__PURE__ */ jsx3(Search, {}),
|
|
2122
|
+
value: search.query,
|
|
2123
|
+
onChange: (event) => search.setQuery(event.target.value),
|
|
2124
|
+
autoComplete: "off"
|
|
2125
|
+
}
|
|
2126
|
+
)
|
|
2127
|
+
}
|
|
2128
|
+
),
|
|
2129
|
+
/* @__PURE__ */ jsx3(Divider, {}),
|
|
2130
|
+
/* @__PURE__ */ jsx3(Modal.Body, { children: /* @__PURE__ */ jsx3(
|
|
2131
|
+
OverlayBody,
|
|
2132
|
+
{
|
|
2133
|
+
isBelowMinChars: search.isBelowMinChars,
|
|
2134
|
+
minChars,
|
|
2135
|
+
status: search.status,
|
|
2136
|
+
query: search.query,
|
|
2137
|
+
results,
|
|
2138
|
+
activeIndex,
|
|
2139
|
+
onSelect: open,
|
|
2140
|
+
onHoverIndex: setActiveIndex
|
|
2141
|
+
}
|
|
2142
|
+
) }),
|
|
2143
|
+
/* @__PURE__ */ jsx3(Divider, {}),
|
|
2144
|
+
/* @__PURE__ */ jsxs2(
|
|
2145
|
+
Flex2,
|
|
2146
|
+
{
|
|
2147
|
+
justifyContent: "space-between",
|
|
2148
|
+
padding: 3,
|
|
2149
|
+
paddingLeft: 4,
|
|
2150
|
+
paddingRight: 4,
|
|
2151
|
+
children: [
|
|
2152
|
+
/* @__PURE__ */ jsx3(Typography3, { variant: "pi", textColor: "neutral500", children: t(
|
|
2153
|
+
"palette.shortcuts_hint",
|
|
2154
|
+
"\u2191 \u2193 navigate \xB7 \u21B5 open \xB7 \u2318/Ctrl + \u21B5 new tab \xB7 esc close"
|
|
2155
|
+
) }),
|
|
2156
|
+
search.status === "success" && search.data.pagination.total > 0 ? /* @__PURE__ */ jsx3(Typography3, { variant: "pi", textColor: "neutral500", children: t("palette.result_count", "{count} results", {
|
|
2157
|
+
count: totalCount
|
|
2158
|
+
}) }) : null
|
|
2159
|
+
]
|
|
2160
|
+
}
|
|
2161
|
+
)
|
|
2162
|
+
] }) }) });
|
|
2163
|
+
};
|
|
2164
|
+
|
|
2165
|
+
// admin/src/components/GlobalSearchPortal.tsx
|
|
2166
|
+
import { jsx as jsx4 } from "react/jsx-runtime";
|
|
2167
|
+
var hasToken = (storage) => {
|
|
2168
|
+
if (!storage) return false;
|
|
2169
|
+
try {
|
|
2170
|
+
const raw = storage.getItem("jwtToken");
|
|
2171
|
+
if (!raw) return false;
|
|
2172
|
+
return Boolean(JSON.parse(raw));
|
|
2173
|
+
} catch {
|
|
2174
|
+
return Boolean(storage.getItem("jwtToken"));
|
|
2175
|
+
}
|
|
2176
|
+
};
|
|
2177
|
+
var hasCookieToken = () => {
|
|
2178
|
+
if (typeof document === "undefined" || !document.cookie) return false;
|
|
2179
|
+
return document.cookie.split(";").some((entry) => {
|
|
2180
|
+
const [key, val] = entry.trim().split("=");
|
|
2181
|
+
return key === "jwtToken" && Boolean(val);
|
|
2182
|
+
});
|
|
2183
|
+
};
|
|
2184
|
+
var isAuthenticated = () => {
|
|
2185
|
+
if (typeof window === "undefined") return false;
|
|
2186
|
+
const segments = (window.location?.pathname || "").split("/");
|
|
2187
|
+
if (segments.includes("auth")) return false;
|
|
2188
|
+
return hasToken(window.localStorage) || hasToken(window.sessionStorage) || hasCookieToken();
|
|
2189
|
+
};
|
|
2190
|
+
var GlobalSearchPortal = () => {
|
|
2191
|
+
const [isOpen, setIsOpen] = useState5(false);
|
|
2192
|
+
const theme = useAdminTheme();
|
|
2193
|
+
useHotkey_default(() => setIsOpen((open) => open ? false : isAuthenticated()));
|
|
2194
|
+
useEffect7(() => {
|
|
2195
|
+
const onOpen = () => {
|
|
2196
|
+
if (isAuthenticated()) setIsOpen(true);
|
|
2197
|
+
};
|
|
2198
|
+
window.addEventListener("global-search:open", onOpen);
|
|
2199
|
+
return () => window.removeEventListener("global-search:open", onOpen);
|
|
2200
|
+
}, []);
|
|
2201
|
+
return /* @__PURE__ */ jsx4(DesignSystemProvider, { theme, locale: getActiveLocale(), children: isOpen ? /* @__PURE__ */ jsx4(SearchOverlay, { onClose: () => setIsOpen(false) }) : null });
|
|
2202
|
+
};
|
|
2203
|
+
|
|
2204
|
+
// admin/src/components/Initializer.tsx
|
|
2205
|
+
init_pluginId();
|
|
2206
|
+
import { useEffect as useEffect8, useRef as useRef5 } from "react";
|
|
2207
|
+
var Initializer = ({ setPlugin }) => {
|
|
2208
|
+
const ref = useRef5(setPlugin);
|
|
2209
|
+
useEffect8(() => {
|
|
2210
|
+
ref.current(pluginId_default);
|
|
2211
|
+
}, []);
|
|
2212
|
+
return null;
|
|
2213
|
+
};
|
|
2214
|
+
|
|
2215
|
+
// admin/src/components/PluginIcon.tsx
|
|
2216
|
+
import { Search as Search2 } from "@strapi/icons";
|
|
2217
|
+
import { jsx as jsx5 } from "react/jsx-runtime";
|
|
2218
|
+
var PluginIcon = () => /* @__PURE__ */ jsx5(Search2, {});
|
|
2219
|
+
|
|
2220
|
+
// admin/src/index.ts
|
|
2221
|
+
init_permissions();
|
|
2222
|
+
init_pluginId();
|
|
2223
|
+
var import_ar2 = __toESM(require_ar(), 1);
|
|
2224
|
+
var import_en2 = __toESM(require_en(), 1);
|
|
2225
|
+
var import_es2 = __toESM(require_es(), 1);
|
|
2226
|
+
var import_fr2 = __toESM(require_fr(), 1);
|
|
2227
|
+
var import_tr2 = __toESM(require_tr(), 1);
|
|
2228
|
+
|
|
2229
|
+
// import("./translations/**/*.json") in admin/src/index.ts
|
|
2230
|
+
var globImport_translations_json = __glob({
|
|
2231
|
+
"./translations/ar.json": () => Promise.resolve().then(() => __toESM(require_ar())),
|
|
2232
|
+
"./translations/en.json": () => Promise.resolve().then(() => __toESM(require_en())),
|
|
2233
|
+
"./translations/es.json": () => Promise.resolve().then(() => __toESM(require_es())),
|
|
2234
|
+
"./translations/fr.json": () => Promise.resolve().then(() => __toESM(require_fr())),
|
|
2235
|
+
"./translations/tr.json": () => Promise.resolve().then(() => __toESM(require_tr()))
|
|
2236
|
+
});
|
|
2237
|
+
|
|
2238
|
+
// admin/src/index.ts
|
|
2239
|
+
var BUILTIN_TRANSLATIONS = {
|
|
2240
|
+
en: import_en2.default,
|
|
2241
|
+
fr: import_fr2.default,
|
|
2242
|
+
es: import_es2.default,
|
|
2243
|
+
ar: import_ar2.default,
|
|
2244
|
+
tr: import_tr2.default
|
|
2245
|
+
};
|
|
2246
|
+
var PORTAL_ROOT_ID = "global-search-portal-root";
|
|
2247
|
+
var index_default = {
|
|
2248
|
+
register(app) {
|
|
2249
|
+
app.addMenuLink({
|
|
2250
|
+
to: `plugins/${pluginId_default}`,
|
|
2251
|
+
icon: PluginIcon,
|
|
2252
|
+
intlLabel: {
|
|
2253
|
+
id: `${pluginId_default}.plugin.name`,
|
|
2254
|
+
defaultMessage: "Global Search"
|
|
2255
|
+
},
|
|
2256
|
+
permissions: permissions_default.main,
|
|
2257
|
+
Component: () => Promise.resolve().then(() => (init_App(), App_exports))
|
|
2258
|
+
});
|
|
2259
|
+
app.addSettingsLink(
|
|
2260
|
+
{
|
|
2261
|
+
id: pluginId_default,
|
|
2262
|
+
intlLabel: {
|
|
2263
|
+
id: `${pluginId_default}.settings.section`,
|
|
2264
|
+
defaultMessage: "Global Search"
|
|
2265
|
+
}
|
|
2266
|
+
},
|
|
2267
|
+
[
|
|
2268
|
+
{
|
|
2269
|
+
intlLabel: {
|
|
2270
|
+
id: `${pluginId_default}.settings.link`,
|
|
2271
|
+
defaultMessage: "Configuration"
|
|
2272
|
+
},
|
|
2273
|
+
id: `${pluginId_default}-settings`,
|
|
2274
|
+
to: pluginId_default,
|
|
2275
|
+
permissions: permissions_default.settings,
|
|
2276
|
+
Component: () => Promise.resolve().then(() => (init_Settings(), Settings_exports))
|
|
2277
|
+
}
|
|
2278
|
+
]
|
|
2279
|
+
);
|
|
2280
|
+
app.registerPlugin({
|
|
2281
|
+
id: pluginId_default,
|
|
2282
|
+
initializer: Initializer,
|
|
2283
|
+
isReady: false,
|
|
2284
|
+
name: pluginId_default
|
|
2285
|
+
});
|
|
2286
|
+
},
|
|
2287
|
+
/**
|
|
2288
|
+
* The Ctrl/Cmd + K palette is mounted on document.body so it is available on
|
|
2289
|
+
* every admin screen, not only the plugin page.
|
|
2290
|
+
*/
|
|
2291
|
+
bootstrap() {
|
|
2292
|
+
if (typeof document === "undefined" || document.getElementById(PORTAL_ROOT_ID))
|
|
2293
|
+
return;
|
|
2294
|
+
const container = document.createElement("div");
|
|
2295
|
+
container.id = PORTAL_ROOT_ID;
|
|
2296
|
+
document.body.appendChild(container);
|
|
2297
|
+
createRoot(container).render(React2.createElement(GlobalSearchPortal));
|
|
2298
|
+
},
|
|
2299
|
+
registerTrads: createRegisterTrads({
|
|
2300
|
+
pluginId: pluginId_default,
|
|
2301
|
+
defaultLocales: [],
|
|
2302
|
+
keepUnprefixed: false,
|
|
2303
|
+
translations: BUILTIN_TRANSLATIONS,
|
|
2304
|
+
loadTranslation: (locale) => globImport_translations_json(`./translations/${locale}.json`)
|
|
2305
|
+
})
|
|
2306
|
+
};
|
|
2307
|
+
export {
|
|
2308
|
+
index_default as default
|
|
2309
|
+
};
|
|
2310
|
+
//# sourceMappingURL=index.mjs.map
|