@localazy/strapi-plugin 1.4.0 → 1.7.0
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/README.md +30 -0
- package/dist/_chunks/{FetchIdentity-BpFOT163.js → FetchIdentity-D89DgpbN.js} +24 -32
- package/dist/_chunks/{FetchIdentity-Cor4ooZv.mjs → FetchIdentity-DkHj24S5.mjs} +36 -44
- package/dist/_chunks/{LanguagesSelector-CC1ecWnc.js → LanguagesSelector-638KGQYw.js} +3 -2
- package/dist/_chunks/{LanguagesSelector-BbrMKwQY.mjs → LanguagesSelector-CR_7I2R1.mjs} +4 -3
- package/dist/_chunks/{LocalazyApp-D0JGRQeF.js → LocalazyApp-Benn8pkA.js} +75 -39
- package/dist/_chunks/{LocalazyApp-DpFR8p10.mjs → LocalazyApp-DM3zg5E4.mjs} +70 -34
- package/dist/_chunks/{LocalazyContentTransferSetup-Dael1Q4w.mjs → LocalazyContentTransferSetup-BA_rtSBM.mjs} +58 -22
- package/dist/_chunks/{LocalazyContentTransferSetup-Cr7D-BUi.js → LocalazyContentTransferSetup-CWchyGdD.js} +62 -26
- package/dist/_chunks/{LocalazyGlobalSettings-D3nG4zl7.js → LocalazyGlobalSettings-88jqQbD4.js} +56 -25
- package/dist/_chunks/{LocalazyGlobalSettings-DzBI5M-K.mjs → LocalazyGlobalSettings-BWF0s9tM.mjs} +56 -25
- package/dist/_chunks/{LocalazyPanel-W6j8N1WC.mjs → LocalazyPanel-4HRa1jNl.mjs} +12 -6
- package/dist/_chunks/{LocalazyPanel-KQPLxTDz.js → LocalazyPanel-D0w9JSIS.js} +14 -8
- package/dist/_chunks/{LocalazyStatusColumn-B7Q_U2Lu.js → LocalazyStatusColumn-BR3f8rKp.js} +10 -4
- package/dist/_chunks/{LocalazyStatusColumn-CrhsCjgp.mjs → LocalazyStatusColumn-D4-rZZUK.mjs} +10 -4
- package/dist/_chunks/{RequireLocalazyAuth-D3GeZPDh.js → RequireLocalazyAuth-C442750b.js} +30 -3
- package/dist/_chunks/{RequireLocalazyAuth-BwoGRfJq.mjs → RequireLocalazyAuth-DbNjEOq-.mjs} +32 -5
- package/dist/_chunks/{entry-exclusion-service-D7gaRHPE.mjs → entry-exclusion-service-Bd3mUDde.mjs} +1 -1
- package/dist/_chunks/{entry-exclusion-service-Bwruvyce.js → entry-exclusion-service-CAIcybXX.js} +1 -1
- package/dist/_chunks/{has-model-changed-Dp2Vkwjw.mjs → has-model-changed-BNs3d9q5.mjs} +4 -3
- package/dist/_chunks/{has-model-changed-5IV9WI_-.js → has-model-changed-BrDeyHFt.js} +4 -3
- package/dist/_chunks/{i18n-o24yXf-j.mjs → i18n-76ox2llT.mjs} +4 -1
- package/dist/_chunks/{i18n-C_5tJvr0.js → i18n-C5ucROBh.js} +4 -1
- package/dist/_chunks/{index-C9hN3KbD.mjs → index-C9Px4v-A.mjs} +34 -12
- package/dist/_chunks/{index-jAg6jjCu.js → index-DwFm1TyM.js} +33 -11
- package/dist/_chunks/{index-BjL9XpRh.mjs → index-shryj0jT.mjs} +16 -16
- package/dist/_chunks/{strapi-api-base-IG3Pe5Sg.js → strapi-api-base-BWZYbxxj.js} +1 -1
- package/dist/_chunks/{strapi-api-base-CAzGcwF6.mjs → strapi-api-base-lPo7wq6I.mjs} +1 -1
- package/dist/admin/index.js +1 -1
- package/dist/admin/index.mjs +1 -1
- package/dist/admin/src/components/LocalazyStatusColumn.d.ts +1 -1
- package/dist/admin/src/constants/permissions.d.ts +29 -0
- package/dist/admin/src/modules/@common/components/LanguagesSelector.d.ts +1 -0
- package/dist/admin/src/modules/@common/models/supported-content-type-fields.d.ts +1 -1
- package/dist/admin/src/modules/login/locale/en.d.ts +1 -0
- package/dist/admin/src/modules/plugin-settings/components/Tree.d.ts +1 -0
- package/dist/admin/src/modules/plugin-settings/components/TreeItem.d.ts +1 -0
- package/dist/admin/src/modules/plugin-settings/components/WebhookSetup.d.ts +4 -1
- package/dist/admin/src/modules/plugin-settings/locale/en.d.ts +2 -0
- package/dist/admin/src/modules/plugin-settings/services/plugin-settings-service.d.ts +4 -0
- package/dist/server/index.js +422 -213
- package/dist/server/index.mjs +422 -213
- package/dist/server/src/bootstrap.d.ts +1 -1
- package/dist/server/src/constants/permissions.d.ts +38 -0
- package/dist/server/src/controllers/index.d.ts +1 -0
- package/dist/server/src/controllers/plugin-settings-controller.d.ts +1 -0
- package/dist/server/src/core/index.d.ts +3 -1
- package/dist/server/src/index.d.ts +57 -8
- package/dist/server/src/routes/activity-logs-routes.d.ts +20 -3
- package/dist/server/src/routes/debug-bundle-routes.d.ts +6 -1
- package/dist/server/src/routes/entry-exclusion-routes.d.ts +20 -3
- package/dist/server/src/routes/index.d.ts +52 -6
- package/dist/server/src/routes/localazy-auth-routes.d.ts +6 -1
- package/dist/server/src/routes/localazy-project-routes.d.ts +20 -3
- package/dist/server/src/routes/localazy-transfer-routes.d.ts +6 -1
- package/dist/server/src/routes/localazy-user-routes.d.ts +20 -3
- package/dist/server/src/routes/plugin-settings-routes.d.ts +20 -3
- package/dist/server/src/routes/strapi-routes.d.ts +20 -3
- package/dist/server/src/services/index.d.ts +3 -1
- package/dist/server/src/services/localazy-transfer-download-service.d.ts +2 -1
- package/dist/server/src/services/plugin-settings-service.d.ts +4 -0
- package/dist/server/src/utils/blocks-to-translatable.d.ts +34 -0
- package/dist/server/src/utils/model-utils.d.ts +2 -1
- package/package.json +1 -1
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
const FetchIdentity = require("./FetchIdentity-
|
|
2
|
+
const FetchIdentity = require("./FetchIdentity-D89DgpbN.js");
|
|
3
3
|
const jsxRuntime = require("react/jsx-runtime");
|
|
4
|
-
const index$1 = require("./index-
|
|
4
|
+
const index$1 = require("./index-DwFm1TyM.js");
|
|
5
5
|
const index = require("./index-CTkxoioB.js");
|
|
6
6
|
const admin = require("@strapi/strapi/admin");
|
|
7
|
-
require("./i18n-
|
|
7
|
+
require("./i18n-C5ucROBh.js");
|
|
8
8
|
const useTranslation = require("./useTranslation-BdIl-aLe.js");
|
|
9
9
|
function arraySome(array, predicate) {
|
|
10
10
|
var index2 = -1, length = array == null ? 0 : array.length;
|
|
@@ -208,6 +208,32 @@ function baseIsEqual(value, other, bitmask, customizer, stack) {
|
|
|
208
208
|
function isEqual(value, other) {
|
|
209
209
|
return baseIsEqual(value, other);
|
|
210
210
|
}
|
|
211
|
+
function baseSet(object, path, value, customizer) {
|
|
212
|
+
if (!FetchIdentity.isObject(object)) {
|
|
213
|
+
return object;
|
|
214
|
+
}
|
|
215
|
+
path = FetchIdentity.castPath(path, object);
|
|
216
|
+
var index2 = -1, length = path.length, lastIndex = length - 1, nested = object;
|
|
217
|
+
while (nested != null && ++index2 < length) {
|
|
218
|
+
var key = FetchIdentity.toKey(path[index2]), newValue = value;
|
|
219
|
+
if (key === "__proto__" || key === "constructor" || key === "prototype") {
|
|
220
|
+
return object;
|
|
221
|
+
}
|
|
222
|
+
if (index2 != lastIndex) {
|
|
223
|
+
var objValue = nested[key];
|
|
224
|
+
newValue = void 0;
|
|
225
|
+
if (newValue === void 0) {
|
|
226
|
+
newValue = FetchIdentity.isObject(objValue) ? objValue : FetchIdentity.isIndex(path[index2 + 1]) ? [] : {};
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
FetchIdentity.assignValue(nested, key, newValue);
|
|
230
|
+
nested = nested[key];
|
|
231
|
+
}
|
|
232
|
+
return object;
|
|
233
|
+
}
|
|
234
|
+
function set(object, path, value) {
|
|
235
|
+
return object == null ? object : baseSet(object, path, value);
|
|
236
|
+
}
|
|
211
237
|
const RequireLocalazyAuth = ({ children }) => {
|
|
212
238
|
const { isLoggedIn, isFetchingIdentity } = FetchIdentity.useLocalazyIdentity();
|
|
213
239
|
const { t } = useTranslation.useTranslation();
|
|
@@ -231,3 +257,4 @@ const RequireLocalazyAuth = ({ children }) => {
|
|
|
231
257
|
};
|
|
232
258
|
exports.RequireLocalazyAuth = RequireLocalazyAuth;
|
|
233
259
|
exports.isEqual = isEqual;
|
|
260
|
+
exports.set = set;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { S as SetCache,
|
|
1
|
+
import { S as SetCache, b as cacheHas, d as Symbol$1, e as eq, U as Uint8Array, s as setToArray, f as getAllKeys, h as getTag, i as isBuffer, j as Stack, k as isTypedArray, l as isArray, m as isObjectLike, n as isObject, o as castPath, t as toKey, p as isIndex, q as assignValue, u as useLocalazyIdentity } from "./FetchIdentity-DkHj24S5.mjs";
|
|
2
2
|
import { jsxs, Fragment, jsx } from "react/jsx-runtime";
|
|
3
|
-
import {
|
|
4
|
-
import { B as Box, T as Typography } from "./index-
|
|
3
|
+
import { a as PLUGIN_ID } from "./index-C9Px4v-A.mjs";
|
|
4
|
+
import { B as Box, T as Typography } from "./index-shryj0jT.mjs";
|
|
5
5
|
import { Layouts } from "@strapi/strapi/admin";
|
|
6
|
-
import "./i18n-
|
|
6
|
+
import "./i18n-76ox2llT.mjs";
|
|
7
7
|
import { u as useTranslation } from "./useTranslation-CZQ4lU1m.mjs";
|
|
8
8
|
function arraySome(array, predicate) {
|
|
9
9
|
var index = -1, length = array == null ? 0 : array.length;
|
|
@@ -207,6 +207,32 @@ function baseIsEqual(value, other, bitmask, customizer, stack) {
|
|
|
207
207
|
function isEqual(value, other) {
|
|
208
208
|
return baseIsEqual(value, other);
|
|
209
209
|
}
|
|
210
|
+
function baseSet(object, path, value, customizer) {
|
|
211
|
+
if (!isObject(object)) {
|
|
212
|
+
return object;
|
|
213
|
+
}
|
|
214
|
+
path = castPath(path, object);
|
|
215
|
+
var index = -1, length = path.length, lastIndex = length - 1, nested = object;
|
|
216
|
+
while (nested != null && ++index < length) {
|
|
217
|
+
var key = toKey(path[index]), newValue = value;
|
|
218
|
+
if (key === "__proto__" || key === "constructor" || key === "prototype") {
|
|
219
|
+
return object;
|
|
220
|
+
}
|
|
221
|
+
if (index != lastIndex) {
|
|
222
|
+
var objValue = nested[key];
|
|
223
|
+
newValue = void 0;
|
|
224
|
+
if (newValue === void 0) {
|
|
225
|
+
newValue = isObject(objValue) ? objValue : isIndex(path[index + 1]) ? [] : {};
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
assignValue(nested, key, newValue);
|
|
229
|
+
nested = nested[key];
|
|
230
|
+
}
|
|
231
|
+
return object;
|
|
232
|
+
}
|
|
233
|
+
function set(object, path, value) {
|
|
234
|
+
return object == null ? object : baseSet(object, path, value);
|
|
235
|
+
}
|
|
210
236
|
const RequireLocalazyAuth = ({ children }) => {
|
|
211
237
|
const { isLoggedIn, isFetchingIdentity } = useLocalazyIdentity();
|
|
212
238
|
const { t } = useTranslation();
|
|
@@ -230,5 +256,6 @@ const RequireLocalazyAuth = ({ children }) => {
|
|
|
230
256
|
};
|
|
231
257
|
export {
|
|
232
258
|
RequireLocalazyAuth as R,
|
|
233
|
-
isEqual as i
|
|
259
|
+
isEqual as i,
|
|
260
|
+
set as s
|
|
234
261
|
};
|
package/dist/_chunks/{entry-exclusion-service-D7gaRHPE.mjs → entry-exclusion-service-Bd3mUDde.mjs}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { c as createStrapiApiAxiosInstance } from "./strapi-api-base-
|
|
1
|
+
import { c as createStrapiApiAxiosInstance } from "./strapi-api-base-lPo7wq6I.mjs";
|
|
2
2
|
const BASE_PATH = "/entry-exclusion";
|
|
3
3
|
const axiosInstance = createStrapiApiAxiosInstance();
|
|
4
4
|
class EntryExclusionService {
|
package/dist/_chunks/{entry-exclusion-service-Bwruvyce.js → entry-exclusion-service-CAIcybXX.js}
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const strapiApiBase = require("./strapi-api-base-
|
|
3
|
+
const strapiApiBase = require("./strapi-api-base-BWZYbxxj.js");
|
|
4
4
|
const BASE_PATH = "/entry-exclusion";
|
|
5
5
|
const axiosInstance = strapiApiBase.createStrapiApiAxiosInstance();
|
|
6
6
|
class EntryExclusionService {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { c as createStrapiApiAxiosInstance } from "./strapi-api-base-
|
|
1
|
+
import { o as castPath, t as toKey, x as Set, s as setToArray, S as SetCache, b as cacheHas, P as PluginSettingsService } from "./FetchIdentity-DkHj24S5.mjs";
|
|
2
|
+
import { c as createStrapiApiAxiosInstance } from "./strapi-api-base-lPo7wq6I.mjs";
|
|
3
3
|
import { g as getDefaultExportFromCjs } from "./_commonjsHelpers-DWwsNxpa.mjs";
|
|
4
4
|
function baseGet(object, path) {
|
|
5
5
|
path = castPath(path, object);
|
|
@@ -38,7 +38,8 @@ const SUPPORTED_CONTENT_TYPE_FIELDS = [
|
|
|
38
38
|
"text",
|
|
39
39
|
"richtext",
|
|
40
40
|
"email",
|
|
41
|
-
"json"
|
|
41
|
+
"json",
|
|
42
|
+
"blocks"
|
|
42
43
|
];
|
|
43
44
|
const SUPPORTED_CUSTOM_FIELD_PLUGINS = [
|
|
44
45
|
"plugin::ckeditor.CKEditor",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
const FetchIdentity = require("./FetchIdentity-
|
|
3
|
-
const strapiApiBase = require("./strapi-api-base-
|
|
2
|
+
const FetchIdentity = require("./FetchIdentity-D89DgpbN.js");
|
|
3
|
+
const strapiApiBase = require("./strapi-api-base-BWZYbxxj.js");
|
|
4
4
|
const _commonjsHelpers = require("./_commonjsHelpers-Bc2YnDe1.js");
|
|
5
5
|
function baseGet(object, path) {
|
|
6
6
|
path = FetchIdentity.castPath(path, object);
|
|
@@ -39,7 +39,8 @@ const SUPPORTED_CONTENT_TYPE_FIELDS = [
|
|
|
39
39
|
"text",
|
|
40
40
|
"richtext",
|
|
41
41
|
"email",
|
|
42
|
-
"json"
|
|
42
|
+
"json",
|
|
43
|
+
"blocks"
|
|
43
44
|
];
|
|
44
45
|
const SUPPORTED_CUSTOM_FIELD_PLUGINS = [
|
|
45
46
|
"plugin::ckeditor.CKEditor",
|
|
@@ -2238,7 +2238,8 @@ const en_login = {
|
|
|
2238
2238
|
login_and_start_translating_your_project: "Login and start translating your project with powerful Localazy tools.",
|
|
2239
2239
|
you_have_to_own_account_for_the_plugin_to_work_properly: "You have to own a Localazy account for the plugin to work properly.",
|
|
2240
2240
|
read_the_documentation: "Read the documentation",
|
|
2241
|
-
logout_from_localazy: "Disconnect from Localazy"
|
|
2241
|
+
logout_from_localazy: "Disconnect from Localazy",
|
|
2242
|
+
requires_settings_update_permission: 'Requires Localazy "settings.update" permission. Ask an admin to grant it under Settings → Roles → Plugins → Localazy.'
|
|
2242
2243
|
};
|
|
2243
2244
|
const en_overview = {
|
|
2244
2245
|
description: "Overview of the connected Localazy account and project.",
|
|
@@ -2323,6 +2324,8 @@ const en_plugin_settings = {
|
|
|
2323
2324
|
webhook_author: "Webhook actions author",
|
|
2324
2325
|
webhook_author_info: "Select the author signed under the webhook actions (required by Strapi for certain actions, e.g. creating a locale).",
|
|
2325
2326
|
webhook_author_placeholder: "Select webhook actions author",
|
|
2327
|
+
webhook_author_permission_required: "You need the Strapi “Users and Roles → Users → Read” permission (admin::users.read) to view and pick a webhook author.",
|
|
2328
|
+
webhook_author_unknown_user: "User #{{id}}",
|
|
2326
2329
|
webhook_languages: "Allowed webhook languages",
|
|
2327
2330
|
webhook_languages_info: "Select the languages from Localazy. Translations of selected languages would be downloaded. If no language is selected, all translations will be downloaded.",
|
|
2328
2331
|
webhook_languages_placeholder: "Download all languages",
|
|
@@ -2240,7 +2240,8 @@ const en_login = {
|
|
|
2240
2240
|
login_and_start_translating_your_project: "Login and start translating your project with powerful Localazy tools.",
|
|
2241
2241
|
you_have_to_own_account_for_the_plugin_to_work_properly: "You have to own a Localazy account for the plugin to work properly.",
|
|
2242
2242
|
read_the_documentation: "Read the documentation",
|
|
2243
|
-
logout_from_localazy: "Disconnect from Localazy"
|
|
2243
|
+
logout_from_localazy: "Disconnect from Localazy",
|
|
2244
|
+
requires_settings_update_permission: 'Requires Localazy "settings.update" permission. Ask an admin to grant it under Settings → Roles → Plugins → Localazy.'
|
|
2244
2245
|
};
|
|
2245
2246
|
const en_overview = {
|
|
2246
2247
|
description: "Overview of the connected Localazy account and project.",
|
|
@@ -2325,6 +2326,8 @@ const en_plugin_settings = {
|
|
|
2325
2326
|
webhook_author: "Webhook actions author",
|
|
2326
2327
|
webhook_author_info: "Select the author signed under the webhook actions (required by Strapi for certain actions, e.g. creating a locale).",
|
|
2327
2328
|
webhook_author_placeholder: "Select webhook actions author",
|
|
2329
|
+
webhook_author_permission_required: "You need the Strapi “Users and Roles → Users → Read” permission (admin::users.read) to view and pick a webhook author.",
|
|
2330
|
+
webhook_author_unknown_user: "User #{{id}}",
|
|
2328
2331
|
webhook_languages: "Allowed webhook languages",
|
|
2329
2332
|
webhook_languages_info: "Select the languages from Localazy. Translations of selected languages would be downloaded. If no language is selected, all translations will be downloaded.",
|
|
2330
2333
|
webhook_languages_placeholder: "Download all languages",
|
|
@@ -36,6 +36,18 @@ const Localazy = () => {
|
|
|
36
36
|
/* @__PURE__ */ 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" })
|
|
37
37
|
] });
|
|
38
38
|
};
|
|
39
|
+
const PERMISSION_UIDS = {
|
|
40
|
+
READ: `plugin::${PLUGIN_ID}.read`,
|
|
41
|
+
TRANSFER: `plugin::${PLUGIN_ID}.transfer`,
|
|
42
|
+
SETTINGS_READ: `plugin::${PLUGIN_ID}.settings.read`,
|
|
43
|
+
SETTINGS_UPDATE: `plugin::${PLUGIN_ID}.settings.update`
|
|
44
|
+
};
|
|
45
|
+
const PERMISSIONS = {
|
|
46
|
+
READ: [{ action: PERMISSION_UIDS.READ, subject: null }],
|
|
47
|
+
TRANSFER: [{ action: PERMISSION_UIDS.TRANSFER, subject: null }],
|
|
48
|
+
SETTINGS_READ: [{ action: PERMISSION_UIDS.SETTINGS_READ, subject: null }],
|
|
49
|
+
SETTINGS_UPDATE: [{ action: PERMISSION_UIDS.SETTINGS_UPDATE, subject: null }]
|
|
50
|
+
};
|
|
39
51
|
const index = {
|
|
40
52
|
register(app) {
|
|
41
53
|
addMenuLink(app);
|
|
@@ -58,13 +70,13 @@ const index = {
|
|
|
58
70
|
try {
|
|
59
71
|
const contentManagerPlugin = app.getPlugin("content-manager");
|
|
60
72
|
if (contentManagerPlugin?.apis?.addEditViewSidePanel) {
|
|
61
|
-
const { default: LocalazyPanel } = await import("./LocalazyPanel-
|
|
73
|
+
const { default: LocalazyPanel } = await import("./LocalazyPanel-4HRa1jNl.mjs");
|
|
62
74
|
const apis = contentManagerPlugin.apis;
|
|
63
75
|
apis.addEditViewSidePanel([LocalazyPanel]);
|
|
64
76
|
} else {
|
|
65
77
|
console.warn('Localazy Plugin: Content Manager "addEditViewSidePanel" API not available');
|
|
66
78
|
}
|
|
67
|
-
const { default: LocalazyStatusColumn } = await import("./LocalazyStatusColumn-
|
|
79
|
+
const { default: LocalazyStatusColumn } = await import("./LocalazyStatusColumn-D4-rZZUK.mjs");
|
|
68
80
|
app.registerHook("Admin/CM/pages/ListView/inject-column-in-table", (params) => {
|
|
69
81
|
try {
|
|
70
82
|
console.log("Localazy: Hook called with params:", params);
|
|
@@ -96,13 +108,17 @@ const index = {
|
|
|
96
108
|
}
|
|
97
109
|
});
|
|
98
110
|
if (contentManagerPlugin?.apis?.addBulkAction) {
|
|
99
|
-
const { useNotification } = await import("@strapi/strapi/admin");
|
|
100
|
-
await import("./i18n-
|
|
111
|
+
const { useNotification, useRBAC } = await import("@strapi/strapi/admin");
|
|
112
|
+
await import("./i18n-76ox2llT.mjs");
|
|
101
113
|
const { useTranslation } = await import("./index-BIbKC7-V.mjs");
|
|
102
114
|
const ExcludeFromTranslationAction = (props) => {
|
|
103
115
|
const { documents, model } = props;
|
|
104
116
|
const { toggleNotification } = useNotification();
|
|
105
117
|
const { t } = useTranslation();
|
|
118
|
+
const { allowedActions } = useRBAC(PERMISSIONS.TRANSFER);
|
|
119
|
+
if (!allowedActions.canTransfer) {
|
|
120
|
+
return null;
|
|
121
|
+
}
|
|
106
122
|
return {
|
|
107
123
|
label: t("plugin_settings.bulk_action_exclude_from_translation"),
|
|
108
124
|
variant: "secondary",
|
|
@@ -112,7 +128,7 @@ const index = {
|
|
|
112
128
|
type: "info",
|
|
113
129
|
message: t("plugin_settings.bulk_action_updating_entries")
|
|
114
130
|
});
|
|
115
|
-
const { default: EntryExclusionService } = await import("./entry-exclusion-service-
|
|
131
|
+
const { default: EntryExclusionService } = await import("./entry-exclusion-service-Bd3mUDde.mjs");
|
|
116
132
|
const documentIds = documents.map((doc) => doc.documentId);
|
|
117
133
|
await EntryExclusionService.setMultipleEntriesExclusion(model, documentIds, true);
|
|
118
134
|
toggleNotification({
|
|
@@ -134,6 +150,10 @@ const index = {
|
|
|
134
150
|
const IncludeToTranslationAction = ({ documents, model }) => {
|
|
135
151
|
const { toggleNotification } = useNotification();
|
|
136
152
|
const { t } = useTranslation();
|
|
153
|
+
const { allowedActions } = useRBAC(PERMISSIONS.TRANSFER);
|
|
154
|
+
if (!allowedActions.canTransfer) {
|
|
155
|
+
return null;
|
|
156
|
+
}
|
|
137
157
|
return {
|
|
138
158
|
label: t("plugin_settings.bulk_action_include_to_translation"),
|
|
139
159
|
variant: "secondary",
|
|
@@ -143,7 +163,7 @@ const index = {
|
|
|
143
163
|
type: "info",
|
|
144
164
|
message: t("plugin_settings.bulk_action_updating_entries")
|
|
145
165
|
});
|
|
146
|
-
const { default: EntryExclusionService } = await import("./entry-exclusion-service-
|
|
166
|
+
const { default: EntryExclusionService } = await import("./entry-exclusion-service-Bd3mUDde.mjs");
|
|
147
167
|
const documentIds = documents.map((doc) => doc.documentId);
|
|
148
168
|
await EntryExclusionService.setMultipleEntriesExclusion(model, documentIds, false);
|
|
149
169
|
toggleNotification({
|
|
@@ -179,7 +199,8 @@ const addMenuLink = (app) => {
|
|
|
179
199
|
id: `${PLUGIN_ID}.name`,
|
|
180
200
|
defaultMessage: "Localazy"
|
|
181
201
|
},
|
|
182
|
-
Component: () => import("./LocalazyApp-
|
|
202
|
+
Component: () => import("./LocalazyApp-DM3zg5E4.mjs"),
|
|
203
|
+
permissions: PERMISSIONS.READ
|
|
183
204
|
});
|
|
184
205
|
};
|
|
185
206
|
const addSettingsSection = (app) => {
|
|
@@ -200,8 +221,8 @@ const addSettingsSection = (app) => {
|
|
|
200
221
|
defaultMessage: "Localazy Settings"
|
|
201
222
|
},
|
|
202
223
|
to: `${PLUGIN_ID}/global-settings`,
|
|
203
|
-
Component: () => import("./LocalazyGlobalSettings-
|
|
204
|
-
permissions:
|
|
224
|
+
Component: () => import("./LocalazyGlobalSettings-BWF0s9tM.mjs"),
|
|
225
|
+
permissions: PERMISSIONS.SETTINGS_READ
|
|
205
226
|
},
|
|
206
227
|
// Content Transfer Setup
|
|
207
228
|
{
|
|
@@ -211,8 +232,8 @@ const addSettingsSection = (app) => {
|
|
|
211
232
|
defaultMessage: "Content Transfer Setup"
|
|
212
233
|
},
|
|
213
234
|
to: `${PLUGIN_ID}/content-transfer-setup`,
|
|
214
|
-
Component: () => import("./LocalazyContentTransferSetup-
|
|
215
|
-
permissions:
|
|
235
|
+
Component: () => import("./LocalazyContentTransferSetup-BA_rtSBM.mjs"),
|
|
236
|
+
permissions: PERMISSIONS.SETTINGS_READ
|
|
216
237
|
}
|
|
217
238
|
]
|
|
218
239
|
);
|
|
@@ -226,6 +247,7 @@ const addPlugin = (app) => {
|
|
|
226
247
|
});
|
|
227
248
|
};
|
|
228
249
|
export {
|
|
229
|
-
|
|
250
|
+
PERMISSIONS as P,
|
|
251
|
+
PLUGIN_ID as a,
|
|
230
252
|
index as i
|
|
231
253
|
};
|
|
@@ -61,6 +61,18 @@ const Localazy = () => {
|
|
|
61
61
|
/* @__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" })
|
|
62
62
|
] });
|
|
63
63
|
};
|
|
64
|
+
const PERMISSION_UIDS = {
|
|
65
|
+
READ: `plugin::${PLUGIN_ID}.read`,
|
|
66
|
+
TRANSFER: `plugin::${PLUGIN_ID}.transfer`,
|
|
67
|
+
SETTINGS_READ: `plugin::${PLUGIN_ID}.settings.read`,
|
|
68
|
+
SETTINGS_UPDATE: `plugin::${PLUGIN_ID}.settings.update`
|
|
69
|
+
};
|
|
70
|
+
const PERMISSIONS = {
|
|
71
|
+
READ: [{ action: PERMISSION_UIDS.READ, subject: null }],
|
|
72
|
+
TRANSFER: [{ action: PERMISSION_UIDS.TRANSFER, subject: null }],
|
|
73
|
+
SETTINGS_READ: [{ action: PERMISSION_UIDS.SETTINGS_READ, subject: null }],
|
|
74
|
+
SETTINGS_UPDATE: [{ action: PERMISSION_UIDS.SETTINGS_UPDATE, subject: null }]
|
|
75
|
+
};
|
|
64
76
|
const index = {
|
|
65
77
|
register(app) {
|
|
66
78
|
addMenuLink(app);
|
|
@@ -83,13 +95,13 @@ const index = {
|
|
|
83
95
|
try {
|
|
84
96
|
const contentManagerPlugin = app.getPlugin("content-manager");
|
|
85
97
|
if (contentManagerPlugin?.apis?.addEditViewSidePanel) {
|
|
86
|
-
const { default: LocalazyPanel } = await Promise.resolve().then(() => require("./LocalazyPanel-
|
|
98
|
+
const { default: LocalazyPanel } = await Promise.resolve().then(() => require("./LocalazyPanel-D0w9JSIS.js"));
|
|
87
99
|
const apis = contentManagerPlugin.apis;
|
|
88
100
|
apis.addEditViewSidePanel([LocalazyPanel]);
|
|
89
101
|
} else {
|
|
90
102
|
console.warn('Localazy Plugin: Content Manager "addEditViewSidePanel" API not available');
|
|
91
103
|
}
|
|
92
|
-
const { default: LocalazyStatusColumn } = await Promise.resolve().then(() => require("./LocalazyStatusColumn-
|
|
104
|
+
const { default: LocalazyStatusColumn } = await Promise.resolve().then(() => require("./LocalazyStatusColumn-BR3f8rKp.js"));
|
|
93
105
|
app.registerHook("Admin/CM/pages/ListView/inject-column-in-table", (params) => {
|
|
94
106
|
try {
|
|
95
107
|
console.log("Localazy: Hook called with params:", params);
|
|
@@ -121,13 +133,17 @@ const index = {
|
|
|
121
133
|
}
|
|
122
134
|
});
|
|
123
135
|
if (contentManagerPlugin?.apis?.addBulkAction) {
|
|
124
|
-
const { useNotification } = await import("@strapi/strapi/admin");
|
|
125
|
-
await Promise.resolve().then(() => require("./i18n-
|
|
136
|
+
const { useNotification, useRBAC } = await import("@strapi/strapi/admin");
|
|
137
|
+
await Promise.resolve().then(() => require("./i18n-C5ucROBh.js"));
|
|
126
138
|
const { useTranslation } = await Promise.resolve().then(() => require("./index-1he9s_bs.js"));
|
|
127
139
|
const ExcludeFromTranslationAction = (props) => {
|
|
128
140
|
const { documents, model } = props;
|
|
129
141
|
const { toggleNotification } = useNotification();
|
|
130
142
|
const { t } = useTranslation();
|
|
143
|
+
const { allowedActions } = useRBAC(PERMISSIONS.TRANSFER);
|
|
144
|
+
if (!allowedActions.canTransfer) {
|
|
145
|
+
return null;
|
|
146
|
+
}
|
|
131
147
|
return {
|
|
132
148
|
label: t("plugin_settings.bulk_action_exclude_from_translation"),
|
|
133
149
|
variant: "secondary",
|
|
@@ -137,7 +153,7 @@ const index = {
|
|
|
137
153
|
type: "info",
|
|
138
154
|
message: t("plugin_settings.bulk_action_updating_entries")
|
|
139
155
|
});
|
|
140
|
-
const { default: EntryExclusionService } = await Promise.resolve().then(() => require("./entry-exclusion-service-
|
|
156
|
+
const { default: EntryExclusionService } = await Promise.resolve().then(() => require("./entry-exclusion-service-CAIcybXX.js"));
|
|
141
157
|
const documentIds = documents.map((doc) => doc.documentId);
|
|
142
158
|
await EntryExclusionService.setMultipleEntriesExclusion(model, documentIds, true);
|
|
143
159
|
toggleNotification({
|
|
@@ -159,6 +175,10 @@ const index = {
|
|
|
159
175
|
const IncludeToTranslationAction = ({ documents, model }) => {
|
|
160
176
|
const { toggleNotification } = useNotification();
|
|
161
177
|
const { t } = useTranslation();
|
|
178
|
+
const { allowedActions } = useRBAC(PERMISSIONS.TRANSFER);
|
|
179
|
+
if (!allowedActions.canTransfer) {
|
|
180
|
+
return null;
|
|
181
|
+
}
|
|
162
182
|
return {
|
|
163
183
|
label: t("plugin_settings.bulk_action_include_to_translation"),
|
|
164
184
|
variant: "secondary",
|
|
@@ -168,7 +188,7 @@ const index = {
|
|
|
168
188
|
type: "info",
|
|
169
189
|
message: t("plugin_settings.bulk_action_updating_entries")
|
|
170
190
|
});
|
|
171
|
-
const { default: EntryExclusionService } = await Promise.resolve().then(() => require("./entry-exclusion-service-
|
|
191
|
+
const { default: EntryExclusionService } = await Promise.resolve().then(() => require("./entry-exclusion-service-CAIcybXX.js"));
|
|
172
192
|
const documentIds = documents.map((doc) => doc.documentId);
|
|
173
193
|
await EntryExclusionService.setMultipleEntriesExclusion(model, documentIds, false);
|
|
174
194
|
toggleNotification({
|
|
@@ -204,7 +224,8 @@ const addMenuLink = (app) => {
|
|
|
204
224
|
id: `${PLUGIN_ID}.name`,
|
|
205
225
|
defaultMessage: "Localazy"
|
|
206
226
|
},
|
|
207
|
-
Component: () => Promise.resolve().then(() => require("./LocalazyApp-
|
|
227
|
+
Component: () => Promise.resolve().then(() => require("./LocalazyApp-Benn8pkA.js")),
|
|
228
|
+
permissions: PERMISSIONS.READ
|
|
208
229
|
});
|
|
209
230
|
};
|
|
210
231
|
const addSettingsSection = (app) => {
|
|
@@ -225,8 +246,8 @@ const addSettingsSection = (app) => {
|
|
|
225
246
|
defaultMessage: "Localazy Settings"
|
|
226
247
|
},
|
|
227
248
|
to: `${PLUGIN_ID}/global-settings`,
|
|
228
|
-
Component: () => Promise.resolve().then(() => require("./LocalazyGlobalSettings-
|
|
229
|
-
permissions:
|
|
249
|
+
Component: () => Promise.resolve().then(() => require("./LocalazyGlobalSettings-88jqQbD4.js")),
|
|
250
|
+
permissions: PERMISSIONS.SETTINGS_READ
|
|
230
251
|
},
|
|
231
252
|
// Content Transfer Setup
|
|
232
253
|
{
|
|
@@ -236,8 +257,8 @@ const addSettingsSection = (app) => {
|
|
|
236
257
|
defaultMessage: "Content Transfer Setup"
|
|
237
258
|
},
|
|
238
259
|
to: `${PLUGIN_ID}/content-transfer-setup`,
|
|
239
|
-
Component: () => Promise.resolve().then(() => require("./LocalazyContentTransferSetup-
|
|
240
|
-
permissions:
|
|
260
|
+
Component: () => Promise.resolve().then(() => require("./LocalazyContentTransferSetup-CWchyGdD.js")),
|
|
261
|
+
permissions: PERMISSIONS.SETTINGS_READ
|
|
241
262
|
}
|
|
242
263
|
]
|
|
243
264
|
);
|
|
@@ -250,5 +271,6 @@ const addPlugin = (app) => {
|
|
|
250
271
|
name: PLUGIN_ID
|
|
251
272
|
});
|
|
252
273
|
};
|
|
274
|
+
exports.PERMISSIONS = PERMISSIONS;
|
|
253
275
|
exports.PLUGIN_ID = PLUGIN_ID;
|
|
254
276
|
exports.index = index;
|
|
@@ -51084,20 +51084,20 @@ export {
|
|
|
51084
51084
|
Box as B,
|
|
51085
51085
|
CheckboxImpl as C,
|
|
51086
51086
|
Dialog as D,
|
|
51087
|
-
|
|
51087
|
+
ForwardRef$4N as E,
|
|
51088
51088
|
Field as F,
|
|
51089
51089
|
Grid as G,
|
|
51090
|
-
|
|
51091
|
-
|
|
51092
|
-
|
|
51093
|
-
|
|
51090
|
+
PreviousLink as H,
|
|
51091
|
+
PageLink as I,
|
|
51092
|
+
Dots as J,
|
|
51093
|
+
lodashExports as K,
|
|
51094
51094
|
Loader as L,
|
|
51095
51095
|
MultiSelect as M,
|
|
51096
51096
|
NextLink as N,
|
|
51097
|
-
|
|
51097
|
+
ForwardRef$j as O,
|
|
51098
51098
|
Pagination as P,
|
|
51099
|
-
|
|
51100
|
-
|
|
51099
|
+
DatePicker$1 as Q,
|
|
51100
|
+
Tabs as R,
|
|
51101
51101
|
SingleSelect as S,
|
|
51102
51102
|
Typography as T,
|
|
51103
51103
|
ForwardRef$57 as U,
|
|
@@ -51121,12 +51121,12 @@ export {
|
|
|
51121
51121
|
ForwardRef$d as p,
|
|
51122
51122
|
ForwardRef$3P as q,
|
|
51123
51123
|
ForwardRef$4j as r,
|
|
51124
|
-
|
|
51125
|
-
|
|
51126
|
-
|
|
51127
|
-
|
|
51128
|
-
|
|
51129
|
-
|
|
51130
|
-
ForwardRef$
|
|
51131
|
-
ForwardRef$
|
|
51124
|
+
TooltipImpl as s,
|
|
51125
|
+
SubNav as t,
|
|
51126
|
+
SubNavHeader as u,
|
|
51127
|
+
SubNavSections as v,
|
|
51128
|
+
SubNavSection as w,
|
|
51129
|
+
SubNavLink as x,
|
|
51130
|
+
ForwardRef$L as y,
|
|
51131
|
+
ForwardRef$4L as z
|
|
51132
51132
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
const admin = require("@strapi/strapi/admin");
|
|
3
|
-
const index = require("./index-
|
|
3
|
+
const index = require("./index-DwFm1TyM.js");
|
|
4
4
|
const BASE_PLUGIN_PATH = `/${index.PLUGIN_ID}`;
|
|
5
5
|
const LOCALAZY_HEADER = { "X-Localazy-Initiated-By": "strapi-plugin-localazy" };
|
|
6
6
|
const withPluginHeader = (config) => ({
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { getFetchClient } from "@strapi/strapi/admin";
|
|
2
|
-
import {
|
|
2
|
+
import { a as PLUGIN_ID } from "./index-C9Px4v-A.mjs";
|
|
3
3
|
const BASE_PLUGIN_PATH = `/${PLUGIN_ID}`;
|
|
4
4
|
const LOCALAZY_HEADER = { "X-Localazy-Initiated-By": "strapi-plugin-localazy" };
|
|
5
5
|
const withPluginHeader = (config) => ({
|
package/dist/admin/index.js
CHANGED
package/dist/admin/index.mjs
CHANGED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Mirror of `server/src/constants/permissions.ts`. Admin code can't import from
|
|
3
|
+
* `server/`, so any rename must be applied in both files.
|
|
4
|
+
*
|
|
5
|
+
* `useRBAC` derives the boolean it returns under `allowedActions` from the LAST
|
|
6
|
+
* dotted segment of each UID, lowercased and prefixed with `can`:
|
|
7
|
+
*
|
|
8
|
+
* plugin::localazy.read → canRead
|
|
9
|
+
* plugin::localazy.transfer → canTransfer
|
|
10
|
+
* plugin::localazy.settings.read → canRead (collides with READ above!)
|
|
11
|
+
* plugin::localazy.settings.update → canUpdate
|
|
12
|
+
*
|
|
13
|
+
* Because `settings.read` and `read` both collapse to `canRead`, never pass
|
|
14
|
+
* both into the same `useRBAC` call — issue separate calls per distinct UID
|
|
15
|
+
* you need to check (one call returns one `canX` boolean per unique segment).
|
|
16
|
+
*/
|
|
17
|
+
export declare const PERMISSION_UIDS: {
|
|
18
|
+
readonly READ: `plugin::${string}.read`;
|
|
19
|
+
readonly TRANSFER: `plugin::${string}.transfer`;
|
|
20
|
+
readonly SETTINGS_READ: `plugin::${string}.settings.read`;
|
|
21
|
+
readonly SETTINGS_UPDATE: `plugin::${string}.settings.update`;
|
|
22
|
+
};
|
|
23
|
+
export type PermissionUid = (typeof PERMISSION_UIDS)[keyof typeof PERMISSION_UIDS];
|
|
24
|
+
type PermissionDescriptor = {
|
|
25
|
+
action: PermissionUid;
|
|
26
|
+
subject: null;
|
|
27
|
+
};
|
|
28
|
+
export declare const PERMISSIONS: Record<keyof typeof PERMISSION_UIDS, PermissionDescriptor[]>;
|
|
29
|
+
export {};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export type SupportedContentTypeField = 'string' | 'text' | 'richtext' | 'email' | 'json';
|
|
1
|
+
export type SupportedContentTypeField = 'string' | 'text' | 'richtext' | 'email' | 'json' | 'blocks';
|
|
2
2
|
export declare const SUPPORTED_CONTENT_TYPE_FIELDS: SupportedContentTypeField[];
|
|
@@ -23,6 +23,8 @@ declare const _default: {
|
|
|
23
23
|
webhook_author: string;
|
|
24
24
|
webhook_author_info: string;
|
|
25
25
|
webhook_author_placeholder: string;
|
|
26
|
+
webhook_author_permission_required: string;
|
|
27
|
+
webhook_author_unknown_user: string;
|
|
26
28
|
webhook_languages: string;
|
|
27
29
|
webhook_languages_info: string;
|
|
28
30
|
webhook_languages_placeholder: string;
|
|
@@ -3,5 +3,9 @@ export default class PluginSettingsService {
|
|
|
3
3
|
static updateContentTransferSetup(data: any): Promise<any>;
|
|
4
4
|
static getPluginSettings(): Promise<any>;
|
|
5
5
|
static updatePluginSettings(data: any): Promise<any>;
|
|
6
|
+
static updatePluginSettingsUiPrefs(data: {
|
|
7
|
+
defaultRoute?: string;
|
|
8
|
+
activityLogsSort?: any;
|
|
9
|
+
}): Promise<any>;
|
|
6
10
|
static getSyncCursor(): Promise<any>;
|
|
7
11
|
}
|