@localazy/strapi-plugin 1.0.8 → 1.0.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_chunks/{set-BRyy4Ra6.mjs → FetchIdentity-B9hYlR1E.mjs} +97 -7
- package/dist/_chunks/{set-CmcBsVOP.js → FetchIdentity-W-xq7F8q.js} +141 -51
- package/dist/_chunks/{LanguagesSelector-Bfrsr3-P.js → LanguagesSelector-Cq9JuASq.js} +10 -10
- package/dist/_chunks/{LanguagesSelector-u9iDsQqB.mjs → LanguagesSelector-zGN0icsS.mjs} +3 -3
- package/dist/_chunks/{App-Dl58PZKy.js → LocalazyApp-CTMwUa44.js} +60 -37
- package/dist/_chunks/{App-C0ogWaOz.mjs → LocalazyApp-CxQTCwbi.mjs} +40 -17
- package/dist/_chunks/{ContentTransferSetup-ClR8Nwv2.mjs → LocalazyContentTransferSetup-DOHIserI.mjs} +12 -8
- package/dist/_chunks/{ContentTransferSetup-DWQg9zDj.js → LocalazyContentTransferSetup-DhSv2HJo.js} +26 -22
- package/dist/_chunks/{GlobalSettings-BpY7BoXu.js → LocalazyGlobalSettings-D7fyS9ih.js} +58 -52
- package/dist/_chunks/{GlobalSettings-B_h5sPwa.mjs → LocalazyGlobalSettings-DCFs8AA1.mjs} +15 -9
- package/dist/_chunks/{LocalazyPanel-BedTxk3C.js → LocalazyPanel-CDgAmxqx.js} +1 -1
- package/dist/_chunks/{LocalazyPanel-CuvdSJYx.mjs → LocalazyPanel-N7__R7p9.mjs} +2 -2
- package/dist/_chunks/{LocalazyStatusColumn-Bf1ntoc7.js → LocalazyStatusColumn-CTjBaBqb.js} +1 -1
- package/dist/_chunks/{LocalazyStatusColumn-955GpXAv.mjs → LocalazyStatusColumn-CuGDwwZ8.mjs} +1 -1
- package/dist/_chunks/{isEqual-CrlZhAtq.js → RequireLocalazyAuth-BDtwyPLH.js} +50 -29
- package/dist/_chunks/{isEqual-BazjlHGf.mjs → RequireLocalazyAuth-BmimcHYI.mjs} +22 -1
- package/dist/_chunks/{entry-exclusion-service-bm-lp4za.js → entry-exclusion-service-BZkbrd3B.js} +2 -2
- package/dist/_chunks/{entry-exclusion-service-BlyFqyBY.mjs → entry-exclusion-service-COp5ZXUY.mjs} +1 -1
- package/dist/_chunks/{has-model-changed-B5SSh8XW.js → has-model-changed-BXqyvCRA.js} +31 -31
- package/dist/_chunks/{has-model-changed-DIHY9LBA.mjs → has-model-changed-K3Z8BNhV.mjs} +2 -2
- package/dist/_chunks/index-B_KJR1Xk.mjs +231 -0
- package/dist/_chunks/index-BtofOkFA.js +254 -0
- package/dist/_chunks/{index-DOCSzcPH.mjs → index-CgI_aKe_.mjs} +6 -6
- package/dist/_chunks/{index-Q3-srfXc.js → strapi-api-base-BfIxEUh2.mjs} +15 -380
- package/dist/_chunks/{index-C15Goe6p.mjs → strapi-api-base-S2_cFlNu.js} +7 -350
- package/dist/admin/index.js +1 -1
- package/dist/admin/index.mjs +1 -1
- package/dist/admin/src/components/RequireLocalazyAuth.d.ts +6 -0
- package/dist/admin/src/pages/LocalazyApp.d.ts +2 -0
- package/dist/admin/src/pages/LocalazyContentTransferSetup.d.ts +2 -0
- package/dist/admin/src/pages/LocalazyGlobalSettings.d.ts +2 -0
- package/dist/server/index.js +1 -1
- package/dist/server/index.mjs +1 -1
- package/package.json +1 -1
|
@@ -1,106 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
var __create = Object.create;
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __copyProps = (to, from, except, desc) => {
|
|
9
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
10
|
-
for (let key of __getOwnPropNames(from))
|
|
11
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
12
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
13
|
-
}
|
|
14
|
-
return to;
|
|
15
|
-
};
|
|
16
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
17
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
18
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
19
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
20
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
21
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
22
|
-
mod
|
|
23
|
-
));
|
|
24
|
-
const React = require("react");
|
|
25
|
-
const jsxRuntime = require("react/jsx-runtime");
|
|
26
|
-
const _interopDefault = (e) => e && e.__esModule ? e : { default: e };
|
|
27
|
-
const React__default = /* @__PURE__ */ _interopDefault(React);
|
|
28
|
-
const __variableDynamicImportRuntimeHelper = (glob, path, segs) => {
|
|
29
|
-
const v = glob[path];
|
|
30
|
-
if (v) {
|
|
31
|
-
return typeof v === "function" ? v() : Promise.resolve(v);
|
|
32
|
-
}
|
|
33
|
-
return new Promise((_, reject) => {
|
|
34
|
-
(typeof queueMicrotask === "function" ? queueMicrotask : setTimeout)(
|
|
35
|
-
reject.bind(
|
|
36
|
-
null,
|
|
37
|
-
new Error(
|
|
38
|
-
"Unknown variable dynamic import: " + path + (path.split("/").length !== segs ? ". Note that variables only represent file names one level deep." : "")
|
|
39
|
-
)
|
|
40
|
-
)
|
|
41
|
-
);
|
|
42
|
-
});
|
|
43
|
-
};
|
|
44
|
-
const strapi = {
|
|
45
|
-
name: "localazy"
|
|
46
|
-
};
|
|
47
|
-
const pluginPkg = {
|
|
48
|
-
strapi
|
|
49
|
-
};
|
|
50
|
-
const PLUGIN_ID = pluginPkg.strapi.name;
|
|
51
|
-
const getTranslation = (id) => `${PLUGIN_ID}.${id}`;
|
|
52
|
-
const Initializer = ({ setPlugin }) => {
|
|
53
|
-
const ref = React.useRef(setPlugin);
|
|
54
|
-
React.useEffect(() => {
|
|
55
|
-
ref.current(PLUGIN_ID);
|
|
56
|
-
}, []);
|
|
57
|
-
return null;
|
|
58
|
-
};
|
|
59
|
-
const Localazy = () => {
|
|
60
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("svg", { width: "24", height: "24", viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", fill: "#8e8ea9", children: [
|
|
61
|
-
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M16.4517 2.56643L16.3247 2.87501L15.5632 4.67576H7.49071C7.18595 4.67576 6.98278 4.98434 7.1013 5.26333L9.05259 9.91314C9.12031 10.0695 9.27269 10.171 9.442 10.171H12.6211C12.9216 10.171 13.1247 10.4753 13.0147 10.7501L12.8919 11.046L12.1353 12.8468H10.9192C10.6187 12.8468 10.4113 13.1553 10.5298 13.4343L13.8229 21.2925C13.9626 21.6265 13.7171 21.9942 13.353 21.9942H11.3256C11.1224 21.9942 10.9362 21.8716 10.8557 21.6814L3.1056 3.17091C2.8728 2.61293 3.27915 2 3.88443 2H16.0538C16.3501 2 16.5533 2.29167 16.4517 2.56643Z" }),
|
|
62
|
-
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M17.2937 13.5315L21.0354 4.63345C21.2724 4.07548 20.8619 3.45832 20.2566 3.46255L17.2267 3.46255L16.4794 5.23793C16.4794 5.24638 16.4752 5.25484 16.4709 5.26329L16.4709 5.26329L16.3482 5.55074C16.2297 5.82973 16.4371 6.1383 16.7376 6.1383H16.8069C17.1074 6.1383 17.3148 6.44688 17.1963 6.72587L15.2408 11.3757C15.1773 11.5321 15.0207 11.6335 14.8514 11.6335H13.7902L12.9112 13.7217C12.7927 14.0007 13.0001 14.3093 13.3006 14.3093H16.1212C16.6334 14.3093 17.0947 14.0007 17.2937 13.5315Z" })
|
|
63
|
-
] });
|
|
64
|
-
};
|
|
65
|
-
const emptyIdentity = {
|
|
66
|
-
accessToken: "",
|
|
67
|
-
project: {
|
|
68
|
-
id: "",
|
|
69
|
-
image: "",
|
|
70
|
-
name: "",
|
|
71
|
-
url: ""
|
|
72
|
-
},
|
|
73
|
-
scope: "",
|
|
74
|
-
user: {
|
|
75
|
-
id: "",
|
|
76
|
-
name: ""
|
|
77
|
-
}
|
|
78
|
-
};
|
|
79
|
-
const LocalazyIdentityContextType = React.createContext(void 0);
|
|
80
|
-
const LocalazyIdentityProvider = ({ children }) => {
|
|
81
|
-
const [identity, setIdentity] = React.useState(emptyIdentity);
|
|
82
|
-
const [isFetchingIdentity, setIsFetchingIdentity] = React.useState(true);
|
|
83
|
-
const isLoggedIn = React.useMemo(() => !!identity.accessToken, [identity.accessToken]);
|
|
84
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
85
|
-
LocalazyIdentityContextType.Provider,
|
|
86
|
-
{
|
|
87
|
-
value: { identity, setIdentity, isLoggedIn, isFetchingIdentity, setIsFetchingIdentity },
|
|
88
|
-
children
|
|
89
|
-
}
|
|
90
|
-
);
|
|
91
|
-
};
|
|
92
|
-
const useLocalazyIdentity = () => {
|
|
93
|
-
const context = React.useContext(LocalazyIdentityContextType);
|
|
94
|
-
if (context === void 0) {
|
|
95
|
-
throw new Error("useLocalazyIdentity must be used within a LocalazyIdentityProvider");
|
|
96
|
-
}
|
|
97
|
-
return context;
|
|
98
|
-
};
|
|
99
|
-
const localazyIdentity = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
100
|
-
__proto__: null,
|
|
101
|
-
LocalazyIdentityProvider,
|
|
102
|
-
useLocalazyIdentity
|
|
103
|
-
}, Symbol.toStringTag, { value: "Module" }));
|
|
1
|
+
import { P as PLUGIN_ID } from "./index-B_KJR1Xk.mjs";
|
|
104
2
|
function bind(fn, thisArg) {
|
|
105
3
|
return function wrap() {
|
|
106
4
|
return fn.apply(thisArg, arguments);
|
|
@@ -617,10 +515,10 @@ function toFormData$1(obj, formData, options) {
|
|
|
617
515
|
value = JSON.stringify(value);
|
|
618
516
|
} else if (utils$1.isArray(value) && isFlatArray(value) || (utils$1.isFileList(value) || utils$1.endsWith(key, "[]")) && (arr = utils$1.toArray(value))) {
|
|
619
517
|
key = removeBrackets(key);
|
|
620
|
-
arr.forEach(function each(el,
|
|
518
|
+
arr.forEach(function each(el, index) {
|
|
621
519
|
!(utils$1.isUndefined(el) || el === null) && formData.append(
|
|
622
520
|
// eslint-disable-next-line no-nested-ternary
|
|
623
|
-
indexes === true ? renderKey([key],
|
|
521
|
+
indexes === true ? renderKey([key], index, dots) : indexes === null ? key : key + "[]",
|
|
624
522
|
convertValue(el)
|
|
625
523
|
);
|
|
626
524
|
});
|
|
@@ -851,11 +749,11 @@ function arrayToObject(arr) {
|
|
|
851
749
|
return obj;
|
|
852
750
|
}
|
|
853
751
|
function formDataToJSON(formData) {
|
|
854
|
-
function buildPath(path, value, target,
|
|
855
|
-
let name = path[
|
|
752
|
+
function buildPath(path, value, target, index) {
|
|
753
|
+
let name = path[index++];
|
|
856
754
|
if (name === "__proto__") return true;
|
|
857
755
|
const isNumericKey = Number.isFinite(+name);
|
|
858
|
-
const isLast =
|
|
756
|
+
const isLast = index >= path.length;
|
|
859
757
|
name = !name && utils$1.isArray(target) ? target.length : name;
|
|
860
758
|
if (isLast) {
|
|
861
759
|
if (utils$1.hasOwnProp(target, name)) {
|
|
@@ -868,7 +766,7 @@ function formDataToJSON(formData) {
|
|
|
868
766
|
if (!target[name] || !utils$1.isObject(target[name])) {
|
|
869
767
|
target[name] = [];
|
|
870
768
|
}
|
|
871
|
-
const result = buildPath(path, value, target[name],
|
|
769
|
+
const result = buildPath(path, value, target[name], index);
|
|
872
770
|
if (result && utils$1.isArray(target[name])) {
|
|
873
771
|
target[name] = arrayToObject(target[name]);
|
|
874
772
|
}
|
|
@@ -2329,9 +2227,9 @@ let CancelToken$1 = class CancelToken {
|
|
|
2329
2227
|
if (!this._listeners) {
|
|
2330
2228
|
return;
|
|
2331
2229
|
}
|
|
2332
|
-
const
|
|
2333
|
-
if (
|
|
2334
|
-
this._listeners.splice(
|
|
2230
|
+
const index = this._listeners.indexOf(listener);
|
|
2231
|
+
if (index !== -1) {
|
|
2232
|
+
this._listeners.splice(index, 1);
|
|
2335
2233
|
}
|
|
2336
2234
|
}
|
|
2337
2235
|
toAbortSignal() {
|
|
@@ -2487,10 +2385,10 @@ const JWT_TOKEN_NAME = "jwtToken";
|
|
|
2487
2385
|
const getToken = () => {
|
|
2488
2386
|
const jwtTokenCookie = document.cookie.split("; ").find((row) => row.startsWith(`${JWT_TOKEN_NAME}=`));
|
|
2489
2387
|
const jwtToken = jwtTokenCookie ? jwtTokenCookie.split("=")[1] : "";
|
|
2490
|
-
|
|
2388
|
+
const raw = jwtToken || localStorage.getItem(JWT_TOKEN_NAME) || sessionStorage.getItem(JWT_TOKEN_NAME) || "";
|
|
2389
|
+
return raw.replace(/^["']|["']$/g, "");
|
|
2491
2390
|
};
|
|
2492
2391
|
const createStrapiApiAxiosInstance = (baseUrl = null) => {
|
|
2493
|
-
const token = getToken();
|
|
2494
2392
|
if (baseUrl === null) {
|
|
2495
2393
|
baseUrl = `${BASE_PLUGIN_PATH}`;
|
|
2496
2394
|
}
|
|
@@ -2505,6 +2403,7 @@ const createStrapiApiAxiosInstance = (baseUrl = null) => {
|
|
|
2505
2403
|
// Add this header to identify the request as initiated by the plugin
|
|
2506
2404
|
"X-Localazy-Initiated-By": "strapi-plugin-localazy"
|
|
2507
2405
|
});
|
|
2406
|
+
const token = getToken();
|
|
2508
2407
|
if (token) {
|
|
2509
2408
|
config.headers.set("Authorization", `Bearer ${token}`);
|
|
2510
2409
|
}
|
|
@@ -2517,275 +2416,11 @@ const createStrapiApiAxiosInstance = (baseUrl = null) => {
|
|
|
2517
2416
|
instance.interceptors.response.use(
|
|
2518
2417
|
(response) => response,
|
|
2519
2418
|
(error) => {
|
|
2520
|
-
if (error.response?.status === 401) ;
|
|
2521
2419
|
throw error;
|
|
2522
2420
|
}
|
|
2523
2421
|
);
|
|
2524
2422
|
return instance;
|
|
2525
2423
|
};
|
|
2526
|
-
|
|
2527
|
-
|
|
2528
|
-
class LocalazyUserService {
|
|
2529
|
-
static async getIdentity() {
|
|
2530
|
-
try {
|
|
2531
|
-
const result = await strapiApiInstance.get(`${BASE_PATH}`);
|
|
2532
|
-
return result.data;
|
|
2533
|
-
} catch (e) {
|
|
2534
|
-
throw e;
|
|
2535
|
-
}
|
|
2536
|
-
}
|
|
2537
|
-
static async updateIdentity(localazyIdentity2) {
|
|
2538
|
-
try {
|
|
2539
|
-
const result = await strapiApiInstance.put(`${BASE_PATH}`, localazyIdentity2);
|
|
2540
|
-
return result.data;
|
|
2541
|
-
} catch (e) {
|
|
2542
|
-
throw e;
|
|
2543
|
-
}
|
|
2544
|
-
}
|
|
2545
|
-
static async deleteIdentity() {
|
|
2546
|
-
try {
|
|
2547
|
-
const result = await strapiApiInstance.delete(`${BASE_PATH}`);
|
|
2548
|
-
return result.data;
|
|
2549
|
-
} catch (e) {
|
|
2550
|
-
throw e;
|
|
2551
|
-
}
|
|
2552
|
-
}
|
|
2553
|
-
}
|
|
2554
|
-
const FetchIdentity = () => {
|
|
2555
|
-
const { setIdentity, setIsFetchingIdentity } = useLocalazyIdentity();
|
|
2556
|
-
React.useEffect(() => {
|
|
2557
|
-
const fetchIdentity = async () => {
|
|
2558
|
-
try {
|
|
2559
|
-
setIsFetchingIdentity(true);
|
|
2560
|
-
const fetchedIdentity = await LocalazyUserService.getIdentity();
|
|
2561
|
-
setIdentity(fetchedIdentity || emptyIdentity);
|
|
2562
|
-
} catch (error) {
|
|
2563
|
-
console.error("Error fetching identity:", error);
|
|
2564
|
-
} finally {
|
|
2565
|
-
setIsFetchingIdentity(false);
|
|
2566
|
-
}
|
|
2567
|
-
};
|
|
2568
|
-
fetchIdentity();
|
|
2569
|
-
}, [setIdentity, setIsFetchingIdentity]);
|
|
2570
|
-
return null;
|
|
2571
|
-
};
|
|
2572
|
-
const index = {
|
|
2573
|
-
register(app) {
|
|
2574
|
-
addMenuLink(app);
|
|
2575
|
-
addSettingsSection(app);
|
|
2576
|
-
addPlugin(app);
|
|
2577
|
-
},
|
|
2578
|
-
async registerTrads({ locales }) {
|
|
2579
|
-
return Promise.all(
|
|
2580
|
-
locales.map(async (locale) => {
|
|
2581
|
-
try {
|
|
2582
|
-
const { default: data } = await __variableDynamicImportRuntimeHelper(/* @__PURE__ */ Object.assign({ "./translations/en.json": () => Promise.resolve().then(() => require("./en-CMWcM0nM.js")), "./translations/fr.json": () => Promise.resolve().then(() => require("./fr-C8Qw4iPZ.js")) }), `./translations/${locale}.json`, 3);
|
|
2583
|
-
return { data, locale };
|
|
2584
|
-
} catch {
|
|
2585
|
-
return { data: {}, locale };
|
|
2586
|
-
}
|
|
2587
|
-
})
|
|
2588
|
-
);
|
|
2589
|
-
},
|
|
2590
|
-
async bootstrap(app) {
|
|
2591
|
-
try {
|
|
2592
|
-
const contentManagerPlugin = app.getPlugin("content-manager");
|
|
2593
|
-
if (contentManagerPlugin?.apis?.addEditViewSidePanel) {
|
|
2594
|
-
const { default: LocalazyPanel } = await Promise.resolve().then(() => require("./LocalazyPanel-BedTxk3C.js"));
|
|
2595
|
-
const apis = contentManagerPlugin.apis;
|
|
2596
|
-
apis.addEditViewSidePanel([LocalazyPanel]);
|
|
2597
|
-
} else {
|
|
2598
|
-
console.warn('Localazy Plugin: Content Manager "addEditViewSidePanel" API not available');
|
|
2599
|
-
}
|
|
2600
|
-
const { default: LocalazyStatusColumn } = await Promise.resolve().then(() => require("./LocalazyStatusColumn-Bf1ntoc7.js"));
|
|
2601
|
-
app.registerHook("Admin/CM/pages/ListView/inject-column-in-table", (params) => {
|
|
2602
|
-
try {
|
|
2603
|
-
console.log("Localazy: Hook called with params:", params);
|
|
2604
|
-
const { displayedHeaders, layout } = params;
|
|
2605
|
-
if (!Array.isArray(displayedHeaders)) {
|
|
2606
|
-
return params;
|
|
2607
|
-
}
|
|
2608
|
-
const localazyStatusColumn = {
|
|
2609
|
-
name: "localazy_status",
|
|
2610
|
-
label: "Localazy Status",
|
|
2611
|
-
searchable: false,
|
|
2612
|
-
sortable: false,
|
|
2613
|
-
attribute: { type: "custom" },
|
|
2614
|
-
cellFormatter: (data, header, context) => {
|
|
2615
|
-
return React__default.default.createElement(LocalazyStatusColumn, {
|
|
2616
|
-
data,
|
|
2617
|
-
model: context?.model || ""
|
|
2618
|
-
});
|
|
2619
|
-
}
|
|
2620
|
-
};
|
|
2621
|
-
const updatedHeaders = [...displayedHeaders, localazyStatusColumn];
|
|
2622
|
-
return {
|
|
2623
|
-
displayedHeaders: updatedHeaders,
|
|
2624
|
-
layout
|
|
2625
|
-
};
|
|
2626
|
-
} catch (error) {
|
|
2627
|
-
console.error("Localazy: Error in hook:", error);
|
|
2628
|
-
return params;
|
|
2629
|
-
}
|
|
2630
|
-
});
|
|
2631
|
-
if (contentManagerPlugin?.apis?.addBulkAction) {
|
|
2632
|
-
const { useNotification } = await import("@strapi/strapi/admin");
|
|
2633
|
-
await Promise.resolve().then(() => require("./i18n-0dV2P-Hm.js"));
|
|
2634
|
-
const { useTranslation } = await Promise.resolve().then(() => require("./index-1he9s_bs.js"));
|
|
2635
|
-
const ExcludeFromTranslationAction = (props) => {
|
|
2636
|
-
const { documents, model } = props;
|
|
2637
|
-
const { toggleNotification } = useNotification();
|
|
2638
|
-
const { t } = useTranslation();
|
|
2639
|
-
return {
|
|
2640
|
-
label: t("plugin_settings.bulk_action_exclude_from_translation"),
|
|
2641
|
-
variant: "secondary",
|
|
2642
|
-
onClick: async () => {
|
|
2643
|
-
try {
|
|
2644
|
-
toggleNotification({
|
|
2645
|
-
type: "info",
|
|
2646
|
-
message: t("plugin_settings.bulk_action_updating_entries")
|
|
2647
|
-
});
|
|
2648
|
-
const { default: EntryExclusionService } = await Promise.resolve().then(() => require("./entry-exclusion-service-bm-lp4za.js"));
|
|
2649
|
-
const documentIds = documents.map((doc) => doc.documentId);
|
|
2650
|
-
await EntryExclusionService.setMultipleEntriesExclusion(model, documentIds, true);
|
|
2651
|
-
toggleNotification({
|
|
2652
|
-
type: "success",
|
|
2653
|
-
message: t("plugin_settings.bulk_action_success_message"),
|
|
2654
|
-
timeout: 5e3
|
|
2655
|
-
});
|
|
2656
|
-
} catch (error) {
|
|
2657
|
-
console.error("Failed to exclude entries from translation:", error);
|
|
2658
|
-
toggleNotification({
|
|
2659
|
-
type: "danger",
|
|
2660
|
-
message: t("plugin_settings.bulk_action_failed_message")
|
|
2661
|
-
});
|
|
2662
|
-
}
|
|
2663
|
-
}
|
|
2664
|
-
};
|
|
2665
|
-
};
|
|
2666
|
-
ExcludeFromTranslationAction.type = "exclude-translation";
|
|
2667
|
-
const IncludeToTranslationAction = ({ documents, model }) => {
|
|
2668
|
-
const { toggleNotification } = useNotification();
|
|
2669
|
-
const { t } = useTranslation();
|
|
2670
|
-
return {
|
|
2671
|
-
label: t("plugin_settings.bulk_action_include_to_translation"),
|
|
2672
|
-
variant: "secondary",
|
|
2673
|
-
onClick: async () => {
|
|
2674
|
-
try {
|
|
2675
|
-
toggleNotification({
|
|
2676
|
-
type: "info",
|
|
2677
|
-
message: t("plugin_settings.bulk_action_updating_entries")
|
|
2678
|
-
});
|
|
2679
|
-
const { default: EntryExclusionService } = await Promise.resolve().then(() => require("./entry-exclusion-service-bm-lp4za.js"));
|
|
2680
|
-
const documentIds = documents.map((doc) => doc.documentId);
|
|
2681
|
-
await EntryExclusionService.setMultipleEntriesExclusion(model, documentIds, false);
|
|
2682
|
-
toggleNotification({
|
|
2683
|
-
type: "success",
|
|
2684
|
-
message: t("plugin_settings.bulk_action_success_message"),
|
|
2685
|
-
timeout: 5e3
|
|
2686
|
-
});
|
|
2687
|
-
} catch (error) {
|
|
2688
|
-
console.error("Failed to include entries to translation:", error);
|
|
2689
|
-
toggleNotification({
|
|
2690
|
-
type: "danger",
|
|
2691
|
-
message: t("plugin_settings.bulk_action_failed_message")
|
|
2692
|
-
});
|
|
2693
|
-
}
|
|
2694
|
-
}
|
|
2695
|
-
};
|
|
2696
|
-
};
|
|
2697
|
-
IncludeToTranslationAction.type = "include-translation";
|
|
2698
|
-
contentManagerPlugin.apis.addBulkAction([ExcludeFromTranslationAction, IncludeToTranslationAction]);
|
|
2699
|
-
} else {
|
|
2700
|
-
console.warn('Localazy Plugin: Content Manager "addBulkAction" API not available');
|
|
2701
|
-
}
|
|
2702
|
-
} catch (error) {
|
|
2703
|
-
console.error("Localazy Plugin: Error adding side panel:", error);
|
|
2704
|
-
}
|
|
2705
|
-
}
|
|
2706
|
-
};
|
|
2707
|
-
const addMenuLink = (app) => {
|
|
2708
|
-
app.addMenuLink({
|
|
2709
|
-
to: `plugins/${PLUGIN_ID}/`,
|
|
2710
|
-
icon: Localazy,
|
|
2711
|
-
intlLabel: {
|
|
2712
|
-
id: `${PLUGIN_ID}.name`,
|
|
2713
|
-
defaultMessage: getTranslation("name")
|
|
2714
|
-
},
|
|
2715
|
-
Component: async () => {
|
|
2716
|
-
const { App } = await Promise.resolve().then(() => require("./App-Dl58PZKy.js"));
|
|
2717
|
-
const { LocalazyIdentityProvider: LocalazyIdentityProvider2 } = await Promise.resolve().then(() => localazyIdentity);
|
|
2718
|
-
const WrappedApp = () => React__default.default.createElement(LocalazyIdentityProvider2, {
|
|
2719
|
-
children: React__default.default.createElement(React__default.default.Fragment, {}, [
|
|
2720
|
-
React__default.default.createElement(FetchIdentity, {}),
|
|
2721
|
-
React__default.default.createElement(App, {})
|
|
2722
|
-
])
|
|
2723
|
-
});
|
|
2724
|
-
return WrappedApp;
|
|
2725
|
-
}
|
|
2726
|
-
});
|
|
2727
|
-
};
|
|
2728
|
-
const addSettingsSection = (app) => {
|
|
2729
|
-
app.createSettingSection(
|
|
2730
|
-
{
|
|
2731
|
-
id: `${PLUGIN_ID}-settings`,
|
|
2732
|
-
intlLabel: {
|
|
2733
|
-
id: `${PLUGIN_ID}.localazy_settings`,
|
|
2734
|
-
defaultMessage: getTranslation("localazy_settings")
|
|
2735
|
-
}
|
|
2736
|
-
},
|
|
2737
|
-
[
|
|
2738
|
-
// General
|
|
2739
|
-
{
|
|
2740
|
-
id: `${PLUGIN_ID}-settings-global`,
|
|
2741
|
-
intlLabel: {
|
|
2742
|
-
id: `${PLUGIN_ID}.localazy_settings`,
|
|
2743
|
-
defaultMessage: getTranslation("localazy_settings")
|
|
2744
|
-
},
|
|
2745
|
-
to: `/settings/${PLUGIN_ID}/global-settings`,
|
|
2746
|
-
Component: async () => {
|
|
2747
|
-
const { GlobalSettings } = await Promise.resolve().then(() => require("./GlobalSettings-BpY7BoXu.js"));
|
|
2748
|
-
const { LocalazyIdentityProvider: LocalazyIdentityProvider2 } = await Promise.resolve().then(() => localazyIdentity);
|
|
2749
|
-
const WrappedGlobalSettings = () => React__default.default.createElement(LocalazyIdentityProvider2, { children: React__default.default.createElement(GlobalSettings, {}) });
|
|
2750
|
-
return WrappedGlobalSettings;
|
|
2751
|
-
},
|
|
2752
|
-
permissions: []
|
|
2753
|
-
},
|
|
2754
|
-
// Content Transfer Setup
|
|
2755
|
-
{
|
|
2756
|
-
id: `${PLUGIN_ID}-settings-content-transfer-setup`,
|
|
2757
|
-
intlLabel: {
|
|
2758
|
-
id: `${PLUGIN_ID}.content_transfer_setup`,
|
|
2759
|
-
defaultMessage: getTranslation("content_transfer_setup")
|
|
2760
|
-
},
|
|
2761
|
-
to: `/settings/${PLUGIN_ID}/content-transfer-setup`,
|
|
2762
|
-
Component: async () => {
|
|
2763
|
-
const { ContentTransferSetup } = await Promise.resolve().then(() => require("./ContentTransferSetup-DWQg9zDj.js"));
|
|
2764
|
-
const { LocalazyIdentityProvider: LocalazyIdentityProvider2 } = await Promise.resolve().then(() => localazyIdentity);
|
|
2765
|
-
const WrappedContentTransferSetup = () => React__default.default.createElement(LocalazyIdentityProvider2, {
|
|
2766
|
-
children: React__default.default.createElement(React__default.default.Fragment, {}, [
|
|
2767
|
-
React__default.default.createElement(FetchIdentity, {}),
|
|
2768
|
-
React__default.default.createElement(ContentTransferSetup, {})
|
|
2769
|
-
])
|
|
2770
|
-
});
|
|
2771
|
-
return WrappedContentTransferSetup;
|
|
2772
|
-
},
|
|
2773
|
-
permissions: []
|
|
2774
|
-
}
|
|
2775
|
-
]
|
|
2776
|
-
);
|
|
2777
|
-
};
|
|
2778
|
-
const addPlugin = (app) => {
|
|
2779
|
-
app.registerPlugin({
|
|
2780
|
-
id: PLUGIN_ID,
|
|
2781
|
-
initializer: Initializer,
|
|
2782
|
-
isReady: false,
|
|
2783
|
-
name: PLUGIN_ID
|
|
2784
|
-
});
|
|
2424
|
+
export {
|
|
2425
|
+
createStrapiApiAxiosInstance as c
|
|
2785
2426
|
};
|
|
2786
|
-
exports.LocalazyUserService = LocalazyUserService;
|
|
2787
|
-
exports.PLUGIN_ID = PLUGIN_ID;
|
|
2788
|
-
exports.createStrapiApiAxiosInstance = createStrapiApiAxiosInstance;
|
|
2789
|
-
exports.emptyIdentity = emptyIdentity;
|
|
2790
|
-
exports.index = index;
|
|
2791
|
-
exports.useLocalazyIdentity = useLocalazyIdentity;
|