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