strapi-plugin-magic-link-v5 5.5.8 → 6.0.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.
Files changed (58) hide show
  1. package/CHANGELOG.md +740 -0
  2. package/README.md +662 -928
  3. package/dist/admin/LicenseGuard-BgLA9go3.mjs +495 -0
  4. package/dist/admin/LicenseGuard-ewCjpc17.js +513 -0
  5. package/dist/admin/de-B1FNErPH.mjs +673 -0
  6. package/dist/admin/de-e75OECdq.js +673 -0
  7. package/dist/admin/en-CABKGbxH.js +673 -0
  8. package/dist/admin/en-HqDOFBCc.mjs +673 -0
  9. package/dist/admin/es-DpWl0Fax.js +673 -0
  10. package/dist/admin/es-jb94jqPR.mjs +673 -0
  11. package/dist/admin/fr-BQhLPvYw.js +673 -0
  12. package/dist/admin/fr-BseH1wrr.mjs +673 -0
  13. package/dist/admin/index-6ot9j1cN.js +5268 -0
  14. package/dist/admin/index-B390rccl.js +622 -0
  15. package/dist/admin/index-BPGKtruf.mjs +5266 -0
  16. package/dist/admin/index-BaTIQtnA.js +3869 -0
  17. package/dist/admin/index-CmG-93yx.js +141 -0
  18. package/dist/admin/index-DXe_ge4v.mjs +620 -0
  19. package/dist/admin/index-Dv5PVT1E.mjs +3867 -0
  20. package/dist/admin/index-k240ls6p.mjs +142 -0
  21. package/dist/admin/index.js +3 -3
  22. package/dist/admin/index.mjs +1 -2
  23. package/dist/admin/pt-CPkaveti.js +673 -0
  24. package/dist/admin/pt-DhlSCJn2.mjs +673 -0
  25. package/dist/admin/useUnsavedChangesGuard-BVZ4Mg4E.js +225 -0
  26. package/dist/admin/useUnsavedChangesGuard-QnkiZTLP.mjs +224 -0
  27. package/dist/server/i18n/de.json +32 -1
  28. package/dist/server/i18n/en.json +32 -1
  29. package/dist/server/i18n/es.json +32 -1
  30. package/dist/server/i18n/fr.json +32 -1
  31. package/dist/server/i18n/pt.json +32 -1
  32. package/dist/server/index.js +7092 -5979
  33. package/dist/server/index.mjs +7114 -5979
  34. package/package.json +42 -41
  35. package/strapi-admin.js +3 -1
  36. package/strapi-server.js +3 -2
  37. package/dist/_chunks/LicenseGuard-CiyjFnrw.js +0 -54
  38. package/dist/_chunks/LicenseGuard-DJ5fq2UZ.mjs +0 -55
  39. package/dist/_chunks/de-BSOk5suQ.js +0 -454
  40. package/dist/_chunks/de-CwhYs3O3.mjs +0 -454
  41. package/dist/_chunks/en-DnvSpXvu.js +0 -454
  42. package/dist/_chunks/en-gXXgGDV1.mjs +0 -454
  43. package/dist/_chunks/es-B-tnwByt.js +0 -407
  44. package/dist/_chunks/es-DG5gW3RZ.mjs +0 -407
  45. package/dist/_chunks/fr-BKo8t7Fx.js +0 -407
  46. package/dist/_chunks/fr-BQn1OHOR.mjs +0 -407
  47. package/dist/_chunks/index-01GHNxSr.js +0 -307
  48. package/dist/_chunks/index-B9Ch8Jpe.mjs +0 -5066
  49. package/dist/_chunks/index-Bj-erY7g.mjs +0 -143
  50. package/dist/_chunks/index-CGxbhJfg.js +0 -142
  51. package/dist/_chunks/index-DF3Edydl.mjs +0 -330
  52. package/dist/_chunks/index-Dufv-daf.mjs +0 -305
  53. package/dist/_chunks/index-I72rBTkL.js +0 -332
  54. package/dist/_chunks/index-SCxv154G.mjs +0 -2904
  55. package/dist/_chunks/index-XYWLmmEs.js +0 -5068
  56. package/dist/_chunks/index-zzoovbM0.js +0 -2906
  57. package/dist/_chunks/pt-CjEkXBAz.js +0 -407
  58. package/dist/_chunks/pt-trziAOzT.mjs +0 -407
@@ -0,0 +1,141 @@
1
+ "use strict";
2
+ const react = require("react");
3
+ const jsxRuntime = require("react/jsx-runtime");
4
+ const icons = require("@strapi/icons");
5
+ const __variableDynamicImportRuntimeHelper = (glob, path, segs) => {
6
+ const v = glob[path];
7
+ if (v) {
8
+ return typeof v === "function" ? v() : Promise.resolve(v);
9
+ }
10
+ return new Promise((_, reject) => {
11
+ (typeof queueMicrotask === "function" ? queueMicrotask : setTimeout)(
12
+ reject.bind(
13
+ null,
14
+ new Error(
15
+ "Unknown variable dynamic import: " + path + (path.split("/").length !== segs ? ". Note that variables only represent file names one level deep." : "")
16
+ )
17
+ )
18
+ );
19
+ });
20
+ };
21
+ const strapi = { "name": "magic-link" };
22
+ const pluginPkg = {
23
+ strapi
24
+ };
25
+ const PLUGIN_ID = "magic-link";
26
+ const Initializer = ({ setPlugin }) => {
27
+ const ref = react.useRef(setPlugin);
28
+ react.useEffect(() => {
29
+ ref.current(PLUGIN_ID);
30
+ }, []);
31
+ return null;
32
+ };
33
+ const PluginIcon = () => /* @__PURE__ */ jsxRuntime.jsx(icons.Key, {});
34
+ const action = (uid) => Object.freeze({ action: `plugin::magic-link.${uid}`, subject: null });
35
+ const read = Object.freeze([action("read")]);
36
+ const manage = Object.freeze([action("manage")]);
37
+ const settingsRead = Object.freeze([action("settings.read")]);
38
+ const settingsUpdate = Object.freeze([action("settings.update")]);
39
+ const settingsSecurity = Object.freeze([action("settings.security")]);
40
+ const pluginPermissions = Object.freeze({
41
+ read,
42
+ manage,
43
+ settingsRead,
44
+ settingsUpdate,
45
+ settingsSecurity,
46
+ /**
47
+ * Menu link and Tokens page. Every view lists data first, so it needs
48
+ * `read`. Grant `read` together with `manage` for full access.
49
+ */
50
+ main: read,
51
+ // Deprecated aliases so the views keep compiling while they migrate.
52
+ // The 5.x action plugin::magic-link.access does not exist in 6.0.0.
53
+ /** @deprecated use `main` */
54
+ access: read,
55
+ /** @deprecated use `settingsRead` */
56
+ accessSettings: settingsRead,
57
+ /** @deprecated use `settingsRead` */
58
+ readSettings: settingsRead,
59
+ /** @deprecated use `settingsUpdate` */
60
+ updateSettings: settingsUpdate
61
+ });
62
+ const PREFIX = `${PLUGIN_ID}.`;
63
+ const getTranslation = (key) => {
64
+ const value = String(key ?? "");
65
+ return value.startsWith(PREFIX) ? value : `${PREFIX}${value}`;
66
+ };
67
+ const name = pluginPkg.strapi.name;
68
+ const index = {
69
+ register(app) {
70
+ app.registerPlugin({
71
+ id: PLUGIN_ID,
72
+ initializer: Initializer,
73
+ isReady: false,
74
+ name
75
+ });
76
+ app.addMenuLink({
77
+ to: `plugins/${PLUGIN_ID}/tokens`,
78
+ icon: PluginIcon,
79
+ intlLabel: {
80
+ id: getTranslation("tokens.title"),
81
+ defaultMessage: "Magic Link Tokens"
82
+ },
83
+ Component: () => Promise.resolve().then(() => require("./index-6ot9j1cN.js")),
84
+ permissions: pluginPermissions.main
85
+ });
86
+ app.createSettingSection(
87
+ {
88
+ id: PLUGIN_ID,
89
+ intlLabel: {
90
+ id: getTranslation("Header.Settings"),
91
+ defaultMessage: "Magic Link"
92
+ }
93
+ },
94
+ [
95
+ {
96
+ intlLabel: {
97
+ id: getTranslation("Form.title.Settings"),
98
+ defaultMessage: "Settings"
99
+ },
100
+ id: "magic-link-settings",
101
+ to: `${PLUGIN_ID}/config`,
102
+ Component: () => Promise.resolve().then(() => require("./index-BaTIQtnA.js")),
103
+ permissions: pluginPermissions.settingsRead
104
+ },
105
+ {
106
+ intlLabel: {
107
+ id: getTranslation("Form.title.License"),
108
+ defaultMessage: "License"
109
+ },
110
+ id: "magic-link-license",
111
+ to: `${PLUGIN_ID}/license`,
112
+ Component: () => Promise.resolve().then(() => require("./index-B390rccl.js")),
113
+ // The license key is plugin configuration, so it shares the settings actions.
114
+ permissions: pluginPermissions.settingsRead
115
+ }
116
+ ]
117
+ );
118
+ },
119
+ bootstrap() {
120
+ },
121
+ /**
122
+ * Loads the plugin messages for the admin locales. The JSON files already
123
+ * use the full "magic-link.*" ids. Locales without a file get an empty set
124
+ * and fall back to each message's English defaultMessage.
125
+ */
126
+ async registerTrads({ locales }) {
127
+ return Promise.all(
128
+ locales.map(
129
+ (locale) => (
130
+ // Wrapped so a bundler that throws synchronously for an unknown
131
+ // locale file still resolves to the empty fallback.
132
+ Promise.resolve().then(() => __variableDynamicImportRuntimeHelper(/* @__PURE__ */ Object.assign({ "./translations/de.json": () => Promise.resolve().then(() => require("./de-e75OECdq.js")), "./translations/en.json": () => Promise.resolve().then(() => require("./en-CABKGbxH.js")), "./translations/es.json": () => Promise.resolve().then(() => require("./es-DpWl0Fax.js")), "./translations/fr.json": () => Promise.resolve().then(() => require("./fr-BQhLPvYw.js")), "./translations/pt.json": () => Promise.resolve().then(() => require("./pt-CPkaveti.js")) }), `./translations/${locale}.json`, 3)).then(({ default: data }) => ({ data, locale })).catch(() => ({ data: {}, locale }))
133
+ )
134
+ )
135
+ );
136
+ }
137
+ };
138
+ exports.PLUGIN_ID = PLUGIN_ID;
139
+ exports.getTranslation = getTranslation;
140
+ exports.index = index;
141
+ exports.pluginPermissions = pluginPermissions;