@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
|
@@ -2,18 +2,18 @@
|
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
3
|
const jsxRuntime = require("react/jsx-runtime");
|
|
4
4
|
const React = require("react");
|
|
5
|
-
const
|
|
5
|
+
const FetchIdentity = require("./FetchIdentity-W-xq7F8q.js");
|
|
6
6
|
const admin = require("@strapi/strapi/admin");
|
|
7
|
-
const index
|
|
8
|
-
const
|
|
9
|
-
const LanguagesSelector = require("./LanguagesSelector-
|
|
10
|
-
const
|
|
7
|
+
const index = require("./index-CaY3BYnQ.js");
|
|
8
|
+
const RequireLocalazyAuth = require("./RequireLocalazyAuth-BDtwyPLH.js");
|
|
9
|
+
const LanguagesSelector = require("./LanguagesSelector-Cq9JuASq.js");
|
|
10
|
+
const strapiApiBase = require("./strapi-api-base-S2_cFlNu.js");
|
|
11
11
|
require("./i18n-0dV2P-Hm.js");
|
|
12
12
|
const useTranslation = require("./useTranslation-BdIl-aLe.js");
|
|
13
13
|
class PluginSettingsService {
|
|
14
14
|
static async getAdminPanelUsers() {
|
|
15
15
|
try {
|
|
16
|
-
const axiosInstance =
|
|
16
|
+
const axiosInstance = strapiApiBase.createStrapiApiAxiosInstance("/admin/users");
|
|
17
17
|
const result = await axiosInstance.get("", {
|
|
18
18
|
params: {
|
|
19
19
|
pageSize: 100,
|
|
@@ -37,13 +37,13 @@ const GlobalSettings = () => {
|
|
|
37
37
|
const [formModel, setFormModel] = React.useState({});
|
|
38
38
|
const [hasUnsavedChanges, setHasUnsavedChanges] = React.useState(false);
|
|
39
39
|
const onCancelClick = () => {
|
|
40
|
-
setFormModel(
|
|
40
|
+
setFormModel(FetchIdentity.cloneDeep(originalFormModel));
|
|
41
41
|
setHasUnsavedChanges(false);
|
|
42
42
|
};
|
|
43
43
|
const saveGlobalSettings = async (data) => {
|
|
44
44
|
try {
|
|
45
|
-
await
|
|
46
|
-
setOriginalFormModel(
|
|
45
|
+
await FetchIdentity.PluginSettingsService.updatePluginSettings(data);
|
|
46
|
+
setOriginalFormModel(FetchIdentity.cloneDeep(data));
|
|
47
47
|
setHasUnsavedChanges(false);
|
|
48
48
|
setShowSavedAlert(true);
|
|
49
49
|
} catch (e) {
|
|
@@ -51,10 +51,10 @@ const GlobalSettings = () => {
|
|
|
51
51
|
}
|
|
52
52
|
};
|
|
53
53
|
const patchFormModel = (key, value) => {
|
|
54
|
-
const newFormModel =
|
|
55
|
-
|
|
54
|
+
const newFormModel = FetchIdentity.cloneDeep(formModel);
|
|
55
|
+
FetchIdentity.set(newFormModel, key, value);
|
|
56
56
|
setFormModel(newFormModel);
|
|
57
|
-
setHasUnsavedChanges(!
|
|
57
|
+
setHasUnsavedChanges(!RequireLocalazyAuth.isEqual(originalFormModel, newFormModel));
|
|
58
58
|
};
|
|
59
59
|
const getUserLabel = (user) => {
|
|
60
60
|
return `${user.firstname} ${user.lastname || ""}${user.lastname ? " " : ""}(${user.email})`;
|
|
@@ -62,13 +62,15 @@ const GlobalSettings = () => {
|
|
|
62
62
|
React.useEffect(() => {
|
|
63
63
|
async function fetchData() {
|
|
64
64
|
setIsLoading(true);
|
|
65
|
-
const project = await
|
|
65
|
+
const [project, globalSettings, users2] = await Promise.all([
|
|
66
|
+
LanguagesSelector.ProjectService.getConnectedProject(),
|
|
67
|
+
FetchIdentity.PluginSettingsService.getPluginSettings(),
|
|
68
|
+
PluginSettingsService.getAdminPanelUsers()
|
|
69
|
+
]);
|
|
66
70
|
const projectLanguagesWithoutDefaultLanguage = project?.languages?.filter((language) => language.id !== project.sourceLanguage) || [];
|
|
67
71
|
setProjectLanguages(projectLanguagesWithoutDefaultLanguage);
|
|
68
|
-
const globalSettings = await set.PluginSettingsService.getPluginSettings();
|
|
69
72
|
setFormModel(globalSettings);
|
|
70
|
-
setOriginalFormModel(
|
|
71
|
-
const users2 = await PluginSettingsService.getAdminPanelUsers();
|
|
73
|
+
setOriginalFormModel(FetchIdentity.cloneDeep(globalSettings));
|
|
72
74
|
setUsers(users2);
|
|
73
75
|
setIsLoading(false);
|
|
74
76
|
}
|
|
@@ -80,12 +82,12 @@ const GlobalSettings = () => {
|
|
|
80
82
|
{
|
|
81
83
|
title: t("plugin_settings.global_settings"),
|
|
82
84
|
subtitle: t("plugin_settings.global_settings_description"),
|
|
83
|
-
primaryAction: /* @__PURE__ */ jsxRuntime.jsxs(index
|
|
84
|
-
/* @__PURE__ */ jsxRuntime.jsx(index
|
|
85
|
+
primaryAction: /* @__PURE__ */ jsxRuntime.jsxs(index.Flex, { gap: 2, children: [
|
|
86
|
+
/* @__PURE__ */ jsxRuntime.jsx(index.Button, { variant: "secondary", disabled: !hasUnsavedChanges, onClick: onCancelClick, children: t("plugin_settings.cancel") }),
|
|
85
87
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
86
|
-
index
|
|
88
|
+
index.Button,
|
|
87
89
|
{
|
|
88
|
-
startIcon: /* @__PURE__ */ jsxRuntime.jsx(index
|
|
90
|
+
startIcon: /* @__PURE__ */ jsxRuntime.jsx(index.ForwardRef$4z, {}),
|
|
89
91
|
disabled: !hasUnsavedChanges,
|
|
90
92
|
onClick: () => {
|
|
91
93
|
saveGlobalSettings(formModel);
|
|
@@ -97,9 +99,9 @@ const GlobalSettings = () => {
|
|
|
97
99
|
as: "h2"
|
|
98
100
|
}
|
|
99
101
|
),
|
|
100
|
-
/* @__PURE__ */ jsxRuntime.jsxs(index
|
|
101
|
-
!isLoading && showSavedAlert && /* @__PURE__ */ jsxRuntime.jsx(index
|
|
102
|
-
index
|
|
102
|
+
/* @__PURE__ */ jsxRuntime.jsxs(index.Box, { marginRight: 10, marginLeft: 10, children: [
|
|
103
|
+
!isLoading && showSavedAlert && /* @__PURE__ */ jsxRuntime.jsx(index.Box, { marginBottom: 8, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
104
|
+
index.Alert,
|
|
103
105
|
{
|
|
104
106
|
onClose: () => setShowSavedAlert(false),
|
|
105
107
|
closeLabel: t("plugin_settings.close"),
|
|
@@ -108,20 +110,20 @@ const GlobalSettings = () => {
|
|
|
108
110
|
children: t("plugin_settings.global_settings_saved_successfully")
|
|
109
111
|
}
|
|
110
112
|
) }),
|
|
111
|
-
!isLoading && /* @__PURE__ */ jsxRuntime.jsx(index
|
|
112
|
-
index
|
|
113
|
+
!isLoading && /* @__PURE__ */ jsxRuntime.jsx(index.Box, { background: "neutral0", padding: 7, paddingTop: 6, shadow: "tableShadow", hasRadius: true, children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
114
|
+
index.Box,
|
|
113
115
|
{
|
|
114
116
|
style: {
|
|
115
117
|
maxWidth: "500px"
|
|
116
118
|
},
|
|
117
119
|
children: [
|
|
118
|
-
/* @__PURE__ */ jsxRuntime.jsx(index
|
|
120
|
+
/* @__PURE__ */ jsxRuntime.jsx(index.Typography, { variant: "delta", textColor: "neutral800", children: t("plugin_settings.upload_settings") }),
|
|
119
121
|
/* @__PURE__ */ jsxRuntime.jsx("br", {}),
|
|
120
122
|
/* @__PURE__ */ jsxRuntime.jsx("br", {}),
|
|
121
|
-
/* @__PURE__ */ jsxRuntime.jsxs(index
|
|
122
|
-
/* @__PURE__ */ jsxRuntime.jsx(index
|
|
123
|
+
/* @__PURE__ */ jsxRuntime.jsxs(index.Field.Root, { hint: t("plugin_settings.allow_automated_upload_to_localazy_info"), children: [
|
|
124
|
+
/* @__PURE__ */ jsxRuntime.jsx(index.Field.Label, { children: t("plugin_settings.allow_automated_upload_to_localazy") }),
|
|
123
125
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
124
|
-
index
|
|
126
|
+
index.Toggle,
|
|
125
127
|
{
|
|
126
128
|
offLabel: t("plugin_settings.off"),
|
|
127
129
|
onLabel: t("plugin_settings.on"),
|
|
@@ -129,14 +131,14 @@ const GlobalSettings = () => {
|
|
|
129
131
|
onChange: (e) => patchFormModel("upload.allowAutomated", e.target.checked)
|
|
130
132
|
}
|
|
131
133
|
),
|
|
132
|
-
/* @__PURE__ */ jsxRuntime.jsx(index
|
|
134
|
+
/* @__PURE__ */ jsxRuntime.jsx(index.Field.Hint, {})
|
|
133
135
|
] }),
|
|
134
136
|
/* @__PURE__ */ jsxRuntime.jsx("br", {}),
|
|
135
137
|
/* @__PURE__ */ jsxRuntime.jsx("br", {}),
|
|
136
|
-
/* @__PURE__ */ jsxRuntime.jsxs(index
|
|
137
|
-
/* @__PURE__ */ jsxRuntime.jsx(index
|
|
138
|
+
/* @__PURE__ */ jsxRuntime.jsxs(index.Field.Root, { hint: t("plugin_settings.automated_upload_triggers_info"), children: [
|
|
139
|
+
/* @__PURE__ */ jsxRuntime.jsx(index.Field.Label, { children: t("plugin_settings.automated_upload_triggers") }),
|
|
138
140
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
139
|
-
index
|
|
141
|
+
index.MultiSelect,
|
|
140
142
|
{
|
|
141
143
|
label: t("plugin_settings.automated_upload_triggers"),
|
|
142
144
|
hint: t("plugin_settings.automated_upload_triggers_info"),
|
|
@@ -149,19 +151,19 @@ const GlobalSettings = () => {
|
|
|
149
151
|
multi: true,
|
|
150
152
|
withTags: true,
|
|
151
153
|
children: [
|
|
152
|
-
/* @__PURE__ */ jsxRuntime.jsx(index
|
|
153
|
-
/* @__PURE__ */ jsxRuntime.jsx(index
|
|
154
|
+
/* @__PURE__ */ jsxRuntime.jsx(index.MultiSelectOption, { value: "created", children: t("plugin_settings.creating_new_data_entry") }),
|
|
155
|
+
/* @__PURE__ */ jsxRuntime.jsx(index.MultiSelectOption, { value: "updated", children: t("plugin_settings.editing_data_entry") })
|
|
154
156
|
]
|
|
155
157
|
}
|
|
156
158
|
),
|
|
157
|
-
/* @__PURE__ */ jsxRuntime.jsx(index
|
|
159
|
+
/* @__PURE__ */ jsxRuntime.jsx(index.Field.Hint, {})
|
|
158
160
|
] }),
|
|
159
161
|
/* @__PURE__ */ jsxRuntime.jsx("br", {}),
|
|
160
162
|
/* @__PURE__ */ jsxRuntime.jsx("br", {}),
|
|
161
|
-
/* @__PURE__ */ jsxRuntime.jsxs(index
|
|
162
|
-
/* @__PURE__ */ jsxRuntime.jsx(index
|
|
163
|
+
/* @__PURE__ */ jsxRuntime.jsxs(index.Field.Root, { hint: t("plugin_settings.deprecate_source_keys_on_delete_info"), children: [
|
|
164
|
+
/* @__PURE__ */ jsxRuntime.jsx(index.Field.Label, { children: t("plugin_settings.deprecate_source_keys_on_delete") }),
|
|
163
165
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
164
|
-
index
|
|
166
|
+
index.Toggle,
|
|
165
167
|
{
|
|
166
168
|
hint: t("plugin_settings.deprecate_source_keys_on_delete_info"),
|
|
167
169
|
offLabel: t("plugin_settings.off"),
|
|
@@ -170,20 +172,20 @@ const GlobalSettings = () => {
|
|
|
170
172
|
onChange: (e) => patchFormModel("upload.allowDeprecate", e.target.checked)
|
|
171
173
|
}
|
|
172
174
|
),
|
|
173
|
-
/* @__PURE__ */ jsxRuntime.jsx(index
|
|
175
|
+
/* @__PURE__ */ jsxRuntime.jsx(index.Field.Hint, {})
|
|
174
176
|
] }),
|
|
175
177
|
/* @__PURE__ */ jsxRuntime.jsx("br", {}),
|
|
176
178
|
/* @__PURE__ */ jsxRuntime.jsx("br", {}),
|
|
177
|
-
/* @__PURE__ */ jsxRuntime.jsx(index
|
|
179
|
+
/* @__PURE__ */ jsxRuntime.jsx(index.Divider, {}),
|
|
178
180
|
/* @__PURE__ */ jsxRuntime.jsx("br", {}),
|
|
179
181
|
/* @__PURE__ */ jsxRuntime.jsx("br", {}),
|
|
180
|
-
/* @__PURE__ */ jsxRuntime.jsx(index
|
|
182
|
+
/* @__PURE__ */ jsxRuntime.jsx(index.Typography, { variant: "delta", textColor: "neutral800", children: t("plugin_settings.download_settings") }),
|
|
181
183
|
/* @__PURE__ */ jsxRuntime.jsx("br", {}),
|
|
182
184
|
/* @__PURE__ */ jsxRuntime.jsx("br", {}),
|
|
183
|
-
/* @__PURE__ */ jsxRuntime.jsxs(index
|
|
184
|
-
/* @__PURE__ */ jsxRuntime.jsx(index
|
|
185
|
+
/* @__PURE__ */ jsxRuntime.jsxs(index.Field.Root, { hint: t("plugin_settings.processing_of_download_webhook_info"), children: [
|
|
186
|
+
/* @__PURE__ */ jsxRuntime.jsx(index.Field.Label, { children: t("plugin_settings.processing_of_download_webhook") }),
|
|
185
187
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
186
|
-
index
|
|
188
|
+
index.Toggle,
|
|
187
189
|
{
|
|
188
190
|
hint: t("plugin_settings.processing_of_download_webhook_info"),
|
|
189
191
|
offLabel: t("plugin_settings.off"),
|
|
@@ -192,14 +194,14 @@ const GlobalSettings = () => {
|
|
|
192
194
|
onChange: (e) => patchFormModel("download.processDownloadWebhook", e.target.checked)
|
|
193
195
|
}
|
|
194
196
|
),
|
|
195
|
-
/* @__PURE__ */ jsxRuntime.jsx(index
|
|
197
|
+
/* @__PURE__ */ jsxRuntime.jsx(index.Field.Hint, {})
|
|
196
198
|
] }),
|
|
197
199
|
/* @__PURE__ */ jsxRuntime.jsx("br", {}),
|
|
198
200
|
/* @__PURE__ */ jsxRuntime.jsx("br", {}),
|
|
199
|
-
/* @__PURE__ */ jsxRuntime.jsxs(index
|
|
200
|
-
/* @__PURE__ */ jsxRuntime.jsx(index
|
|
201
|
+
/* @__PURE__ */ jsxRuntime.jsxs(index.Field.Root, { hint: t("plugin_settings.webhook_author_info"), children: [
|
|
202
|
+
/* @__PURE__ */ jsxRuntime.jsx(index.Field.Label, { children: t("plugin_settings.webhook_author") }),
|
|
201
203
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
202
|
-
index
|
|
204
|
+
index.SingleSelect,
|
|
203
205
|
{
|
|
204
206
|
hint: t("plugin_settings.webhook_author_info"),
|
|
205
207
|
clearLabel: t("plugin_settings.clear"),
|
|
@@ -207,10 +209,10 @@ const GlobalSettings = () => {
|
|
|
207
209
|
onClear: () => patchFormModel("download.webhookAuthorId", null),
|
|
208
210
|
value: formModel?.download?.webhookAuthorId || null,
|
|
209
211
|
onChange: (value) => patchFormModel("download.webhookAuthorId", value),
|
|
210
|
-
children: users.map((user) => /* @__PURE__ */ jsxRuntime.jsx(index
|
|
212
|
+
children: users.map((user) => /* @__PURE__ */ jsxRuntime.jsx(index.SingleSelectOption, { value: user.id, children: getUserLabel(user) }, user.id))
|
|
211
213
|
}
|
|
212
214
|
),
|
|
213
|
-
/* @__PURE__ */ jsxRuntime.jsx(index
|
|
215
|
+
/* @__PURE__ */ jsxRuntime.jsx(index.Field.Hint, {})
|
|
214
216
|
] }),
|
|
215
217
|
/* @__PURE__ */ jsxRuntime.jsx("br", {}),
|
|
216
218
|
/* @__PURE__ */ jsxRuntime.jsx("br", {}),
|
|
@@ -231,4 +233,8 @@ const GlobalSettings = () => {
|
|
|
231
233
|
] })
|
|
232
234
|
] });
|
|
233
235
|
};
|
|
234
|
-
|
|
236
|
+
const LocalazyGlobalSettings = () => /* @__PURE__ */ jsxRuntime.jsxs(FetchIdentity.LocalazyIdentityProvider, { children: [
|
|
237
|
+
/* @__PURE__ */ jsxRuntime.jsx(FetchIdentity.FetchIdentity, {}),
|
|
238
|
+
/* @__PURE__ */ jsxRuntime.jsx(RequireLocalazyAuth.RequireLocalazyAuth, { children: /* @__PURE__ */ jsxRuntime.jsx(GlobalSettings, {}) })
|
|
239
|
+
] });
|
|
240
|
+
exports.default = LocalazyGlobalSettings;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { jsxs, Fragment, jsx } from "react/jsx-runtime";
|
|
2
2
|
import { useState, useEffect } from "react";
|
|
3
|
-
import { P as PluginSettingsService$1, c as cloneDeep, s as set } from "./
|
|
3
|
+
import { P as PluginSettingsService$1, c as cloneDeep, s as set, L as LocalazyIdentityProvider, F as FetchIdentity } from "./FetchIdentity-B9hYlR1E.mjs";
|
|
4
4
|
import { Layouts } from "@strapi/strapi/admin";
|
|
5
|
-
import {
|
|
6
|
-
import { i as isEqual } from "./
|
|
7
|
-
import { L as LanguagesSelector, P as ProjectService } from "./LanguagesSelector-
|
|
8
|
-
import { c as createStrapiApiAxiosInstance } from "./
|
|
5
|
+
import { c as Flex, B as Button, d as ForwardRef$4z, e as Box, A as Alert, T as Typography, F as Field, a as Toggle, M as MultiSelect, b as MultiSelectOption, D as Divider, S as SingleSelect, f as SingleSelectOption } from "./index-CgI_aKe_.mjs";
|
|
6
|
+
import { i as isEqual, R as RequireLocalazyAuth } from "./RequireLocalazyAuth-BmimcHYI.mjs";
|
|
7
|
+
import { L as LanguagesSelector, P as ProjectService } from "./LanguagesSelector-zGN0icsS.mjs";
|
|
8
|
+
import { c as createStrapiApiAxiosInstance } from "./strapi-api-base-BfIxEUh2.mjs";
|
|
9
9
|
import "./i18n-RoETLXdU.mjs";
|
|
10
10
|
import { u as useTranslation } from "./useTranslation-CZQ4lU1m.mjs";
|
|
11
11
|
class PluginSettingsService {
|
|
@@ -60,13 +60,15 @@ const GlobalSettings = () => {
|
|
|
60
60
|
useEffect(() => {
|
|
61
61
|
async function fetchData() {
|
|
62
62
|
setIsLoading(true);
|
|
63
|
-
const project = await
|
|
63
|
+
const [project, globalSettings, users2] = await Promise.all([
|
|
64
|
+
ProjectService.getConnectedProject(),
|
|
65
|
+
PluginSettingsService$1.getPluginSettings(),
|
|
66
|
+
PluginSettingsService.getAdminPanelUsers()
|
|
67
|
+
]);
|
|
64
68
|
const projectLanguagesWithoutDefaultLanguage = project?.languages?.filter((language) => language.id !== project.sourceLanguage) || [];
|
|
65
69
|
setProjectLanguages(projectLanguagesWithoutDefaultLanguage);
|
|
66
|
-
const globalSettings = await PluginSettingsService$1.getPluginSettings();
|
|
67
70
|
setFormModel(globalSettings);
|
|
68
71
|
setOriginalFormModel(cloneDeep(globalSettings));
|
|
69
|
-
const users2 = await PluginSettingsService.getAdminPanelUsers();
|
|
70
72
|
setUsers(users2);
|
|
71
73
|
setIsLoading(false);
|
|
72
74
|
}
|
|
@@ -229,6 +231,10 @@ const GlobalSettings = () => {
|
|
|
229
231
|
] })
|
|
230
232
|
] });
|
|
231
233
|
};
|
|
234
|
+
const LocalazyGlobalSettings = () => /* @__PURE__ */ jsxs(LocalazyIdentityProvider, { children: [
|
|
235
|
+
/* @__PURE__ */ jsx(FetchIdentity, {}),
|
|
236
|
+
/* @__PURE__ */ jsx(RequireLocalazyAuth, { children: /* @__PURE__ */ jsx(GlobalSettings, {}) })
|
|
237
|
+
] });
|
|
232
238
|
export {
|
|
233
|
-
|
|
239
|
+
LocalazyGlobalSettings as default
|
|
234
240
|
};
|
|
@@ -4,7 +4,7 @@ const jsxRuntime = require("react/jsx-runtime");
|
|
|
4
4
|
const React = require("react");
|
|
5
5
|
const reactRouterDom = require("react-router-dom");
|
|
6
6
|
const index = require("./index-CaY3BYnQ.js");
|
|
7
|
-
const entryExclusionService = require("./entry-exclusion-service-
|
|
7
|
+
const entryExclusionService = require("./entry-exclusion-service-BZkbrd3B.js");
|
|
8
8
|
require("./i18n-0dV2P-Hm.js");
|
|
9
9
|
const useTranslation = require("./useTranslation-BdIl-aLe.js");
|
|
10
10
|
const LocalazyPanel = () => {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
2
|
import { useState, useEffect } from "react";
|
|
3
3
|
import { useLocation } from "react-router-dom";
|
|
4
|
-
import { T as Typography, a as Toggle } from "./index-
|
|
5
|
-
import EntryExclusionService from "./entry-exclusion-service-
|
|
4
|
+
import { T as Typography, a as Toggle } from "./index-CgI_aKe_.mjs";
|
|
5
|
+
import EntryExclusionService from "./entry-exclusion-service-COp5ZXUY.mjs";
|
|
6
6
|
import "./i18n-RoETLXdU.mjs";
|
|
7
7
|
import { u as useTranslation } from "./useTranslation-CZQ4lU1m.mjs";
|
|
8
8
|
const LocalazyPanel = () => {
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
3
|
const jsxRuntime = require("react/jsx-runtime");
|
|
4
4
|
const React = require("react");
|
|
5
|
-
const entryExclusionService = require("./entry-exclusion-service-
|
|
5
|
+
const entryExclusionService = require("./entry-exclusion-service-BZkbrd3B.js");
|
|
6
6
|
require("./i18n-0dV2P-Hm.js");
|
|
7
7
|
const useTranslation = require("./useTranslation-BdIl-aLe.js");
|
|
8
8
|
const LocalazyStatusColumn = ({ data, model }) => {
|
package/dist/_chunks/{LocalazyStatusColumn-955GpXAv.mjs → LocalazyStatusColumn-CuGDwwZ8.mjs}
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import { useState, useEffect } from "react";
|
|
3
|
-
import EntryExclusionService from "./entry-exclusion-service-
|
|
3
|
+
import EntryExclusionService from "./entry-exclusion-service-COp5ZXUY.mjs";
|
|
4
4
|
import "./i18n-RoETLXdU.mjs";
|
|
5
5
|
import { u as useTranslation } from "./useTranslation-CZQ4lU1m.mjs";
|
|
6
6
|
const LocalazyStatusColumn = ({ data, model }) => {
|
|
@@ -1,9 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
const
|
|
2
|
+
const FetchIdentity = require("./FetchIdentity-W-xq7F8q.js");
|
|
3
|
+
const jsxRuntime = require("react/jsx-runtime");
|
|
4
|
+
const index$1 = require("./index-BtofOkFA.js");
|
|
5
|
+
const index = require("./index-CaY3BYnQ.js");
|
|
6
|
+
const admin = require("@strapi/strapi/admin");
|
|
7
|
+
require("./i18n-0dV2P-Hm.js");
|
|
8
|
+
const useTranslation = require("./useTranslation-BdIl-aLe.js");
|
|
3
9
|
function arraySome(array, predicate) {
|
|
4
|
-
var
|
|
5
|
-
while (++
|
|
6
|
-
if (predicate(array[
|
|
10
|
+
var index2 = -1, length = array == null ? 0 : array.length;
|
|
11
|
+
while (++index2 < length) {
|
|
12
|
+
if (predicate(array[index2], index2, array)) {
|
|
7
13
|
return true;
|
|
8
14
|
}
|
|
9
15
|
}
|
|
@@ -20,13 +26,13 @@ function equalArrays(array, other, bitmask, customizer, equalFunc, stack) {
|
|
|
20
26
|
if (arrStacked && othStacked) {
|
|
21
27
|
return arrStacked == other && othStacked == array;
|
|
22
28
|
}
|
|
23
|
-
var
|
|
29
|
+
var index2 = -1, result = true, seen = bitmask & COMPARE_UNORDERED_FLAG$1 ? new FetchIdentity.SetCache() : void 0;
|
|
24
30
|
stack.set(array, other);
|
|
25
31
|
stack.set(other, array);
|
|
26
|
-
while (++
|
|
27
|
-
var arrValue = array[
|
|
32
|
+
while (++index2 < arrLength) {
|
|
33
|
+
var arrValue = array[index2], othValue = other[index2];
|
|
28
34
|
if (customizer) {
|
|
29
|
-
var compared = isPartial ? customizer(othValue, arrValue,
|
|
35
|
+
var compared = isPartial ? customizer(othValue, arrValue, index2, other, array, stack) : customizer(arrValue, othValue, index2, array, other, stack);
|
|
30
36
|
}
|
|
31
37
|
if (compared !== void 0) {
|
|
32
38
|
if (compared) {
|
|
@@ -37,7 +43,7 @@ function equalArrays(array, other, bitmask, customizer, equalFunc, stack) {
|
|
|
37
43
|
}
|
|
38
44
|
if (seen) {
|
|
39
45
|
if (!arraySome(other, function(othValue2, othIndex) {
|
|
40
|
-
if (!
|
|
46
|
+
if (!FetchIdentity.cacheHas(seen, othIndex) && (arrValue === othValue2 || equalFunc(arrValue, othValue2, bitmask, customizer, stack))) {
|
|
41
47
|
return seen.push(othIndex);
|
|
42
48
|
}
|
|
43
49
|
})) {
|
|
@@ -54,16 +60,16 @@ function equalArrays(array, other, bitmask, customizer, equalFunc, stack) {
|
|
|
54
60
|
return result;
|
|
55
61
|
}
|
|
56
62
|
function mapToArray(map) {
|
|
57
|
-
var
|
|
63
|
+
var index2 = -1, result = Array(map.size);
|
|
58
64
|
map.forEach(function(value, key) {
|
|
59
|
-
result[++
|
|
65
|
+
result[++index2] = [key, value];
|
|
60
66
|
});
|
|
61
67
|
return result;
|
|
62
68
|
}
|
|
63
69
|
var COMPARE_PARTIAL_FLAG$2 = 1, COMPARE_UNORDERED_FLAG = 2;
|
|
64
70
|
var boolTag = "[object Boolean]", dateTag = "[object Date]", errorTag = "[object Error]", mapTag = "[object Map]", numberTag = "[object Number]", regexpTag = "[object RegExp]", setTag = "[object Set]", stringTag = "[object String]", symbolTag = "[object Symbol]";
|
|
65
71
|
var arrayBufferTag = "[object ArrayBuffer]", dataViewTag = "[object DataView]";
|
|
66
|
-
var symbolProto =
|
|
72
|
+
var symbolProto = FetchIdentity.Symbol ? FetchIdentity.Symbol.prototype : void 0, symbolValueOf = symbolProto ? symbolProto.valueOf : void 0;
|
|
67
73
|
function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) {
|
|
68
74
|
switch (tag) {
|
|
69
75
|
case dataViewTag:
|
|
@@ -73,14 +79,14 @@ function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) {
|
|
|
73
79
|
object = object.buffer;
|
|
74
80
|
other = other.buffer;
|
|
75
81
|
case arrayBufferTag:
|
|
76
|
-
if (object.byteLength != other.byteLength || !equalFunc(new
|
|
82
|
+
if (object.byteLength != other.byteLength || !equalFunc(new FetchIdentity.Uint8Array(object), new FetchIdentity.Uint8Array(other))) {
|
|
77
83
|
return false;
|
|
78
84
|
}
|
|
79
85
|
return true;
|
|
80
86
|
case boolTag:
|
|
81
87
|
case dateTag:
|
|
82
88
|
case numberTag:
|
|
83
|
-
return
|
|
89
|
+
return FetchIdentity.eq(+object, +other);
|
|
84
90
|
case errorTag:
|
|
85
91
|
return object.name == other.name && object.message == other.message;
|
|
86
92
|
case regexpTag:
|
|
@@ -90,7 +96,7 @@ function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) {
|
|
|
90
96
|
var convert = mapToArray;
|
|
91
97
|
case setTag:
|
|
92
98
|
var isPartial = bitmask & COMPARE_PARTIAL_FLAG$2;
|
|
93
|
-
convert || (convert =
|
|
99
|
+
convert || (convert = FetchIdentity.setToArray);
|
|
94
100
|
if (object.size != other.size && !isPartial) {
|
|
95
101
|
return false;
|
|
96
102
|
}
|
|
@@ -114,13 +120,13 @@ var COMPARE_PARTIAL_FLAG$1 = 1;
|
|
|
114
120
|
var objectProto$1 = Object.prototype;
|
|
115
121
|
var hasOwnProperty$1 = objectProto$1.hasOwnProperty;
|
|
116
122
|
function equalObjects(object, other, bitmask, customizer, equalFunc, stack) {
|
|
117
|
-
var isPartial = bitmask & COMPARE_PARTIAL_FLAG$1, objProps =
|
|
123
|
+
var isPartial = bitmask & COMPARE_PARTIAL_FLAG$1, objProps = FetchIdentity.getAllKeys(object), objLength = objProps.length, othProps = FetchIdentity.getAllKeys(other), othLength = othProps.length;
|
|
118
124
|
if (objLength != othLength && !isPartial) {
|
|
119
125
|
return false;
|
|
120
126
|
}
|
|
121
|
-
var
|
|
122
|
-
while (
|
|
123
|
-
var key = objProps[
|
|
127
|
+
var index2 = objLength;
|
|
128
|
+
while (index2--) {
|
|
129
|
+
var key = objProps[index2];
|
|
124
130
|
if (!(isPartial ? key in other : hasOwnProperty$1.call(other, key))) {
|
|
125
131
|
return false;
|
|
126
132
|
}
|
|
@@ -134,8 +140,8 @@ function equalObjects(object, other, bitmask, customizer, equalFunc, stack) {
|
|
|
134
140
|
stack.set(object, other);
|
|
135
141
|
stack.set(other, object);
|
|
136
142
|
var skipCtor = isPartial;
|
|
137
|
-
while (++
|
|
138
|
-
key = objProps[
|
|
143
|
+
while (++index2 < objLength) {
|
|
144
|
+
key = objProps[index2];
|
|
139
145
|
var objValue = object[key], othValue = other[key];
|
|
140
146
|
if (customizer) {
|
|
141
147
|
var compared = isPartial ? customizer(othValue, objValue, key, other, object, stack) : customizer(objValue, othValue, key, object, other, stack);
|
|
@@ -161,40 +167,40 @@ var argsTag = "[object Arguments]", arrayTag = "[object Array]", objectTag = "[o
|
|
|
161
167
|
var objectProto = Object.prototype;
|
|
162
168
|
var hasOwnProperty = objectProto.hasOwnProperty;
|
|
163
169
|
function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) {
|
|
164
|
-
var objIsArr =
|
|
170
|
+
var objIsArr = FetchIdentity.isArray(object), othIsArr = FetchIdentity.isArray(other), objTag = objIsArr ? arrayTag : FetchIdentity.getTag(object), othTag = othIsArr ? arrayTag : FetchIdentity.getTag(other);
|
|
165
171
|
objTag = objTag == argsTag ? objectTag : objTag;
|
|
166
172
|
othTag = othTag == argsTag ? objectTag : othTag;
|
|
167
173
|
var objIsObj = objTag == objectTag, othIsObj = othTag == objectTag, isSameTag = objTag == othTag;
|
|
168
|
-
if (isSameTag &&
|
|
169
|
-
if (!
|
|
174
|
+
if (isSameTag && FetchIdentity.isBuffer(object)) {
|
|
175
|
+
if (!FetchIdentity.isBuffer(other)) {
|
|
170
176
|
return false;
|
|
171
177
|
}
|
|
172
178
|
objIsArr = true;
|
|
173
179
|
objIsObj = false;
|
|
174
180
|
}
|
|
175
181
|
if (isSameTag && !objIsObj) {
|
|
176
|
-
stack || (stack = new
|
|
177
|
-
return objIsArr ||
|
|
182
|
+
stack || (stack = new FetchIdentity.Stack());
|
|
183
|
+
return objIsArr || FetchIdentity.isTypedArray(object) ? equalArrays(object, other, bitmask, customizer, equalFunc, stack) : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);
|
|
178
184
|
}
|
|
179
185
|
if (!(bitmask & COMPARE_PARTIAL_FLAG)) {
|
|
180
186
|
var objIsWrapped = objIsObj && hasOwnProperty.call(object, "__wrapped__"), othIsWrapped = othIsObj && hasOwnProperty.call(other, "__wrapped__");
|
|
181
187
|
if (objIsWrapped || othIsWrapped) {
|
|
182
188
|
var objUnwrapped = objIsWrapped ? object.value() : object, othUnwrapped = othIsWrapped ? other.value() : other;
|
|
183
|
-
stack || (stack = new
|
|
189
|
+
stack || (stack = new FetchIdentity.Stack());
|
|
184
190
|
return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);
|
|
185
191
|
}
|
|
186
192
|
}
|
|
187
193
|
if (!isSameTag) {
|
|
188
194
|
return false;
|
|
189
195
|
}
|
|
190
|
-
stack || (stack = new
|
|
196
|
+
stack || (stack = new FetchIdentity.Stack());
|
|
191
197
|
return equalObjects(object, other, bitmask, customizer, equalFunc, stack);
|
|
192
198
|
}
|
|
193
199
|
function baseIsEqual(value, other, bitmask, customizer, stack) {
|
|
194
200
|
if (value === other) {
|
|
195
201
|
return true;
|
|
196
202
|
}
|
|
197
|
-
if (value == null || other == null || !
|
|
203
|
+
if (value == null || other == null || !FetchIdentity.isObjectLike(value) && !FetchIdentity.isObjectLike(other)) {
|
|
198
204
|
return value !== value && other !== other;
|
|
199
205
|
}
|
|
200
206
|
return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack);
|
|
@@ -202,4 +208,19 @@ function baseIsEqual(value, other, bitmask, customizer, stack) {
|
|
|
202
208
|
function isEqual(value, other) {
|
|
203
209
|
return baseIsEqual(value, other);
|
|
204
210
|
}
|
|
211
|
+
const RequireLocalazyAuth = ({ children }) => {
|
|
212
|
+
const { isLoggedIn, isFetchingIdentity } = FetchIdentity.useLocalazyIdentity();
|
|
213
|
+
const { t } = useTranslation.useTranslation();
|
|
214
|
+
if (!isFetchingIdentity && !isLoggedIn) {
|
|
215
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
216
|
+
/* @__PURE__ */ jsxRuntime.jsx(admin.Layouts.Header, { title: t("common.localazy_plugin"), subtitle: t("common.localazy_plugin_description"), as: "h2" }),
|
|
217
|
+
/* @__PURE__ */ jsxRuntime.jsxs(index.Box, { marginLeft: 10, marginRight: 10, background: "neutral0", padding: 7, hasRadius: true, shadow: "tableShadow", children: [
|
|
218
|
+
/* @__PURE__ */ jsxRuntime.jsx(index.Typography, { variant: "epsilon", textColor: "neutral600", children: t("login.you_have_to_own_account_for_the_plugin_to_work_properly") }),
|
|
219
|
+
/* @__PURE__ */ jsxRuntime.jsx(index.Box, { paddingTop: 4, children: /* @__PURE__ */ jsxRuntime.jsx(index.Typography, { variant: "omega", children: /* @__PURE__ */ jsxRuntime.jsx("a", { href: `/admin/plugins/${index$1.PLUGIN_ID}/login`, children: t("login.login_with_localazy") }) }) })
|
|
220
|
+
] })
|
|
221
|
+
] });
|
|
222
|
+
}
|
|
223
|
+
return children;
|
|
224
|
+
};
|
|
225
|
+
exports.RequireLocalazyAuth = RequireLocalazyAuth;
|
|
205
226
|
exports.isEqual = isEqual;
|
|
@@ -1,4 +1,10 @@
|
|
|
1
|
-
import { S as SetCache, a as cacheHas, b as Symbol$1, e as eq, U as Uint8Array, d as setToArray, g as getAllKeys, f as getTag, i as isBuffer, h as Stack, j as isTypedArray, k as isArray, l as isObjectLike } from "./
|
|
1
|
+
import { S as SetCache, a as cacheHas, b as Symbol$1, e as eq, U as Uint8Array, d as setToArray, g as getAllKeys, f as getTag, i as isBuffer, h as Stack, j as isTypedArray, k as isArray, l as isObjectLike, u as useLocalazyIdentity } from "./FetchIdentity-B9hYlR1E.mjs";
|
|
2
|
+
import { jsxs, Fragment, jsx } from "react/jsx-runtime";
|
|
3
|
+
import { P as PLUGIN_ID } from "./index-B_KJR1Xk.mjs";
|
|
4
|
+
import { e as Box, T as Typography } from "./index-CgI_aKe_.mjs";
|
|
5
|
+
import { Layouts } from "@strapi/strapi/admin";
|
|
6
|
+
import "./i18n-RoETLXdU.mjs";
|
|
7
|
+
import { u as useTranslation } from "./useTranslation-CZQ4lU1m.mjs";
|
|
2
8
|
function arraySome(array, predicate) {
|
|
3
9
|
var index = -1, length = array == null ? 0 : array.length;
|
|
4
10
|
while (++index < length) {
|
|
@@ -201,6 +207,21 @@ function baseIsEqual(value, other, bitmask, customizer, stack) {
|
|
|
201
207
|
function isEqual(value, other) {
|
|
202
208
|
return baseIsEqual(value, other);
|
|
203
209
|
}
|
|
210
|
+
const RequireLocalazyAuth = ({ children }) => {
|
|
211
|
+
const { isLoggedIn, isFetchingIdentity } = useLocalazyIdentity();
|
|
212
|
+
const { t } = useTranslation();
|
|
213
|
+
if (!isFetchingIdentity && !isLoggedIn) {
|
|
214
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
215
|
+
/* @__PURE__ */ jsx(Layouts.Header, { title: t("common.localazy_plugin"), subtitle: t("common.localazy_plugin_description"), as: "h2" }),
|
|
216
|
+
/* @__PURE__ */ jsxs(Box, { marginLeft: 10, marginRight: 10, background: "neutral0", padding: 7, hasRadius: true, shadow: "tableShadow", children: [
|
|
217
|
+
/* @__PURE__ */ jsx(Typography, { variant: "epsilon", textColor: "neutral600", children: t("login.you_have_to_own_account_for_the_plugin_to_work_properly") }),
|
|
218
|
+
/* @__PURE__ */ jsx(Box, { paddingTop: 4, children: /* @__PURE__ */ jsx(Typography, { variant: "omega", children: /* @__PURE__ */ jsx("a", { href: `/admin/plugins/${PLUGIN_ID}/login`, children: t("login.login_with_localazy") }) }) })
|
|
219
|
+
] })
|
|
220
|
+
] });
|
|
221
|
+
}
|
|
222
|
+
return children;
|
|
223
|
+
};
|
|
204
224
|
export {
|
|
225
|
+
RequireLocalazyAuth as R,
|
|
205
226
|
isEqual as i
|
|
206
227
|
};
|
package/dist/_chunks/{entry-exclusion-service-bm-lp4za.js → entry-exclusion-service-BZkbrd3B.js}
RENAMED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const
|
|
3
|
+
const strapiApiBase = require("./strapi-api-base-S2_cFlNu.js");
|
|
4
4
|
const BASE_PATH = "/entry-exclusion";
|
|
5
|
-
const axiosInstance =
|
|
5
|
+
const axiosInstance = strapiApiBase.createStrapiApiAxiosInstance();
|
|
6
6
|
class EntryExclusionService {
|
|
7
7
|
/**
|
|
8
8
|
* Get entry exclusion state for a specific entry
|
package/dist/_chunks/{entry-exclusion-service-BlyFqyBY.mjs → entry-exclusion-service-COp5ZXUY.mjs}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { c as createStrapiApiAxiosInstance } from "./
|
|
1
|
+
import { c as createStrapiApiAxiosInstance } from "./strapi-api-base-BfIxEUh2.mjs";
|
|
2
2
|
const BASE_PATH = "/entry-exclusion";
|
|
3
3
|
const axiosInstance = createStrapiApiAxiosInstance();
|
|
4
4
|
class EntryExclusionService {
|