strapi-plugin-magic-link-v5 5.3.6 → 5.3.7

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.
@@ -5,7 +5,7 @@ import { useIntl } from "react-intl";
5
5
  import { Box, Typography, Flex, Button, Accordion, SingleSelect, SingleSelectOption, Grid, Toggle, NumberInput, TextInput, Divider, Textarea, Badge } from "@strapi/design-system";
6
6
  import { Check, Cog, Lightning, Shield, Mail, CheckCircle, Code, Link, Lock, Key } from "@strapi/icons";
7
7
  import { useNotification, useFetchClient } from "@strapi/strapi/admin";
8
- import { g as getTrad } from "./index-8wsWImGa.mjs";
8
+ import { g as getTrad } from "./index-C5VJ3M0F.mjs";
9
9
  import { u as usePluginLanguage, L as LicenseGuard, a as LanguageProvider } from "./LicenseGuard-B_r3b1Vh.mjs";
10
10
  const EMAIL_TEMPLATES = {
11
11
  modern: {
@@ -848,7 +848,14 @@ _Falls du diesen Link nicht angefordert hast, ignoriere diese Nachricht._`,
848
848
  e.preventDefault();
849
849
  setIsSaving(true);
850
850
  try {
851
- await put("/magic-link/settings", { ...settings, ui_language: language });
851
+ const toSave = { ...settings, ui_language: language };
852
+ if (typeof toSave.context_whitelist === "string") {
853
+ toSave.context_whitelist = toSave.context_whitelist.split(",").map((s) => s.trim()).filter(Boolean);
854
+ }
855
+ if (typeof toSave.context_blacklist === "string") {
856
+ toSave.context_blacklist = toSave.context_blacklist.split(",").map((s) => s.trim()).filter(Boolean);
857
+ }
858
+ await put("/magic-link/settings", toSave);
852
859
  toggleNotification({
853
860
  type: "success",
854
861
  message: formatMessage({ id: getTrad("settings.save.success") })
@@ -1142,9 +1149,12 @@ _Falls du diesen Link nicht angefordert hast, ignoriere diese Nachricht._`,
1142
1149
  TextInput,
1143
1150
  {
1144
1151
  hint: formatMessage({ id: getTrad("settings.context.whitelist.hint") }),
1145
- value: (settings.context_whitelist || []).join(", "),
1152
+ value: typeof settings.context_whitelist === "string" ? settings.context_whitelist : (settings.context_whitelist || []).join(", "),
1146
1153
  onChange: (e) => {
1147
- const value = e.target.value;
1154
+ updateSetting("context_whitelist", e.target.value);
1155
+ },
1156
+ onBlur: (e) => {
1157
+ const value = typeof settings.context_whitelist === "string" ? settings.context_whitelist : "";
1148
1158
  const list = value ? value.split(",").map((s) => s.trim()).filter(Boolean) : [];
1149
1159
  updateSetting("context_whitelist", list);
1150
1160
  },
@@ -1159,9 +1169,12 @@ _Falls du diesen Link nicht angefordert hast, ignoriere diese Nachricht._`,
1159
1169
  TextInput,
1160
1170
  {
1161
1171
  hint: formatMessage({ id: getTrad("settings.context.blacklist.hint") }),
1162
- value: (settings.context_blacklist || []).join(", "),
1172
+ value: typeof settings.context_blacklist === "string" ? settings.context_blacklist : (settings.context_blacklist || []).join(", "),
1163
1173
  onChange: (e) => {
1164
- const value = e.target.value;
1174
+ updateSetting("context_blacklist", e.target.value);
1175
+ },
1176
+ onBlur: (e) => {
1177
+ const value = typeof settings.context_blacklist === "string" ? settings.context_blacklist : "";
1165
1178
  const list = value ? value.split(",").map((s) => s.trim()).filter(Boolean) : [];
1166
1179
  updateSetting("context_blacklist", list);
1167
1180
  },
@@ -59,7 +59,7 @@ const index = {
59
59
  },
60
60
  Component: () => import(
61
61
  /* webpackChunkName: "magic-link-tokens" */
62
- "./index-CMA6rFEs.mjs"
62
+ "./index-CuGZgFmB.mjs"
63
63
  ),
64
64
  permissions: []
65
65
  // Leeres Array = keine Permission-Prüfung nötig
@@ -82,7 +82,7 @@ const index = {
82
82
  to: `${PLUGIN_ID}/config`,
83
83
  Component: () => import(
84
84
  /* webpackChunkName: "magic-link-settings" */
85
- "./index-Cx9e2h19.mjs"
85
+ "./index-BUHivW2a.mjs"
86
86
  ),
87
87
  permissions: pluginPermissions.readSettings
88
88
  },
@@ -121,7 +121,7 @@ const index = {
121
121
  to: `${PLUGIN_ID}/whatsapp`,
122
122
  Component: () => import(
123
123
  /* webpackChunkName: "magic-link-whatsapp" */
124
- "./index-OEvO68kw.mjs"
124
+ "./index-DY0oHIyx.mjs"
125
125
  ),
126
126
  permissions: []
127
127
  }
@@ -7,7 +7,7 @@ const styled = require("styled-components");
7
7
  const reactIntl = require("react-intl");
8
8
  const designSystem = require("@strapi/design-system");
9
9
  const icons = require("@strapi/icons");
10
- const index = require("./index-BD7sPPVF.js");
10
+ const index = require("./index-DK6dkTEP.js");
11
11
  const admin = require("@strapi/strapi/admin");
12
12
  const LicenseGuard = require("./LicenseGuard-BEEd9IpN.js");
13
13
  const _interopDefault = (e) => e && e.__esModule ? e : { default: e };
@@ -5,7 +5,7 @@ import styled, { keyframes, css } from "styled-components";
5
5
  import { useIntl } from "react-intl";
6
6
  import { Box, Flex, Typography, Button, TextInput, Textarea, Checkbox, IconButton, Loader, Searchbar, SingleSelect, SingleSelectOption, Thead, Tr, Th, Tbody, Td, Pagination, PreviousLink, PageLink, NextLink, Table, Badge, VisuallyHidden, Main } from "@strapi/design-system";
7
7
  import { Cross, Sparkle, Check, Shield, Clock, Lock, Trash, ArrowClockwise, CaretDown, User, Monitor, Calendar, Plus, Earth, WarningCircle, Server, Eye, Mail, Cog, Key, Link } from "@strapi/icons";
8
- import { g as getTrad, P as PLUGIN_ID } from "./index-8wsWImGa.mjs";
8
+ import { g as getTrad, P as PLUGIN_ID } from "./index-C5VJ3M0F.mjs";
9
9
  import { useFetchClient, useNotification } from "@strapi/strapi/admin";
10
10
  import { L as LicenseGuard, a as LanguageProvider } from "./LicenseGuard-B_r3b1Vh.mjs";
11
11
  const CreateTokenModal = ({ isOpen, onClose, onSubmit, formData, setFormData }) => {
@@ -60,7 +60,7 @@ const index = {
60
60
  },
61
61
  Component: () => Promise.resolve().then(() => require(
62
62
  /* webpackChunkName: "magic-link-tokens" */
63
- "./index-CrTiXLRe.js"
63
+ "./index-C9OJSkTr.js"
64
64
  )),
65
65
  permissions: []
66
66
  // Leeres Array = keine Permission-Prüfung nötig
@@ -83,7 +83,7 @@ const index = {
83
83
  to: `${PLUGIN_ID}/config`,
84
84
  Component: () => Promise.resolve().then(() => require(
85
85
  /* webpackChunkName: "magic-link-settings" */
86
- "./index-EZVtOYIf.js"
86
+ "./index-wXx2DRow.js"
87
87
  )),
88
88
  permissions: pluginPermissions.readSettings
89
89
  },
@@ -122,7 +122,7 @@ const index = {
122
122
  to: `${PLUGIN_ID}/whatsapp`,
123
123
  Component: () => Promise.resolve().then(() => require(
124
124
  /* webpackChunkName: "magic-link-whatsapp" */
125
- "./index-UIfKHe3H.js"
125
+ "./index-JjtRSZnt.js"
126
126
  )),
127
127
  permissions: []
128
128
  }
@@ -5,7 +5,7 @@ import { useIntl } from "react-intl";
5
5
  import { Flex, Loader, Box, Typography, Button, TextInput, Badge } from "@strapi/design-system";
6
6
  import { Phone, Check, Message, ArrowClockwise } from "@strapi/icons";
7
7
  import { useNotification, useFetchClient } from "@strapi/strapi/admin";
8
- import { g as getTrad } from "./index-8wsWImGa.mjs";
8
+ import { g as getTrad } from "./index-C5VJ3M0F.mjs";
9
9
  const theme = {
10
10
  colors: {
11
11
  primary: { 700: "#075985", 100: "#E0F2FE", 50: "#F0F9FF" },
@@ -7,7 +7,7 @@ const reactIntl = require("react-intl");
7
7
  const designSystem = require("@strapi/design-system");
8
8
  const icons = require("@strapi/icons");
9
9
  const admin = require("@strapi/strapi/admin");
10
- const index = require("./index-BD7sPPVF.js");
10
+ const index = require("./index-DK6dkTEP.js");
11
11
  const _interopDefault = (e) => e && e.__esModule ? e : { default: e };
12
12
  const styled__default = /* @__PURE__ */ _interopDefault(styled);
13
13
  const theme = {
@@ -7,7 +7,7 @@ const reactIntl = require("react-intl");
7
7
  const designSystem = require("@strapi/design-system");
8
8
  const icons = require("@strapi/icons");
9
9
  const admin = require("@strapi/strapi/admin");
10
- const index = require("./index-BD7sPPVF.js");
10
+ const index = require("./index-DK6dkTEP.js");
11
11
  const LicenseGuard = require("./LicenseGuard-BEEd9IpN.js");
12
12
  const _interopDefault = (e) => e && e.__esModule ? e : { default: e };
13
13
  const styled__default = /* @__PURE__ */ _interopDefault(styled);
@@ -852,7 +852,14 @@ _Falls du diesen Link nicht angefordert hast, ignoriere diese Nachricht._`,
852
852
  e.preventDefault();
853
853
  setIsSaving(true);
854
854
  try {
855
- await put("/magic-link/settings", { ...settings, ui_language: language });
855
+ const toSave = { ...settings, ui_language: language };
856
+ if (typeof toSave.context_whitelist === "string") {
857
+ toSave.context_whitelist = toSave.context_whitelist.split(",").map((s) => s.trim()).filter(Boolean);
858
+ }
859
+ if (typeof toSave.context_blacklist === "string") {
860
+ toSave.context_blacklist = toSave.context_blacklist.split(",").map((s) => s.trim()).filter(Boolean);
861
+ }
862
+ await put("/magic-link/settings", toSave);
856
863
  toggleNotification({
857
864
  type: "success",
858
865
  message: formatMessage({ id: index.getTrad("settings.save.success") })
@@ -1146,9 +1153,12 @@ _Falls du diesen Link nicht angefordert hast, ignoriere diese Nachricht._`,
1146
1153
  designSystem.TextInput,
1147
1154
  {
1148
1155
  hint: formatMessage({ id: index.getTrad("settings.context.whitelist.hint") }),
1149
- value: (settings.context_whitelist || []).join(", "),
1156
+ value: typeof settings.context_whitelist === "string" ? settings.context_whitelist : (settings.context_whitelist || []).join(", "),
1150
1157
  onChange: (e) => {
1151
- const value = e.target.value;
1158
+ updateSetting("context_whitelist", e.target.value);
1159
+ },
1160
+ onBlur: (e) => {
1161
+ const value = typeof settings.context_whitelist === "string" ? settings.context_whitelist : "";
1152
1162
  const list = value ? value.split(",").map((s) => s.trim()).filter(Boolean) : [];
1153
1163
  updateSetting("context_whitelist", list);
1154
1164
  },
@@ -1163,9 +1173,12 @@ _Falls du diesen Link nicht angefordert hast, ignoriere diese Nachricht._`,
1163
1173
  designSystem.TextInput,
1164
1174
  {
1165
1175
  hint: formatMessage({ id: index.getTrad("settings.context.blacklist.hint") }),
1166
- value: (settings.context_blacklist || []).join(", "),
1176
+ value: typeof settings.context_blacklist === "string" ? settings.context_blacklist : (settings.context_blacklist || []).join(", "),
1167
1177
  onChange: (e) => {
1168
- const value = e.target.value;
1178
+ updateSetting("context_blacklist", e.target.value);
1179
+ },
1180
+ onBlur: (e) => {
1181
+ const value = typeof settings.context_blacklist === "string" ? settings.context_blacklist : "";
1169
1182
  const list = value ? value.split(",").map((s) => s.trim()).filter(Boolean) : [];
1170
1183
  updateSetting("context_blacklist", list);
1171
1184
  },
@@ -1,4 +1,4 @@
1
1
  "use strict";
2
- const index = require("../_chunks/index-BD7sPPVF.js");
2
+ const index = require("../_chunks/index-DK6dkTEP.js");
3
3
  require("@strapi/icons");
4
4
  module.exports = index.index;
@@ -1,4 +1,4 @@
1
- import { i } from "../_chunks/index-8wsWImGa.mjs";
1
+ import { i } from "../_chunks/index-C5VJ3M0F.mjs";
2
2
  import "@strapi/icons";
3
3
  export {
4
4
  i as default
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "5.3.6",
2
+ "version": "5.3.7",
3
3
  "keywords": [],
4
4
  "type": "commonjs",
5
5
  "exports": {