UNPKG

@filerobot-strapi/content-plugin

Version:

Scaleflex DAM normalizes, resizes, optimizes and distributes your images rocket fast around the world.

72 lines (71 loc) 2.4 kB
"use strict"; const react = require("react"); const jsxRuntime = require("react/jsx-runtime"); const __variableDynamicImportRuntimeHelper = (glob, path, segs) => { const v = glob[path]; if (v) { return typeof v === "function" ? v() : Promise.resolve(v); } return new Promise((_, reject) => { (typeof queueMicrotask === "function" ? queueMicrotask : setTimeout)( reject.bind( null, new Error( "Unknown variable dynamic import: " + path + (path.split("/").length !== segs ? ". Note that variables only represent file names one level deep." : "") ) ) ); }); }; const PLUGIN_ID = "scaleflex-dam"; const Initializer = ({ setPlugin }) => { const ref = react.useRef(setPlugin); react.useEffect(() => { ref.current(PLUGIN_ID); }, []); return null; }; const PluginIcon = () => /* @__PURE__ */ jsxRuntime.jsx("img", { src: "https://assets.scaleflex.com/Marketing/Logos/Filerobot%20Logos/Logo%20Icon/icon.png?vh=23f160", width: "20", height: "20" }); const getTranslation = (data) => { return Object.keys(data).reduce((acc, key) => { acc[`${PLUGIN_ID}.${key}`] = data[key]; return acc; }, {}); }; const index = { register(app) { app.addMenuLink({ to: `plugins/${PLUGIN_ID}`, icon: PluginIcon, intlLabel: { id: `${PLUGIN_ID}.plugin.name`, defaultMessage: "Scaleflex DAM" }, Component: async () => { const { App } = await Promise.resolve().then(() => require("./App-CvE9Cyht.js")); return App; } }); app.registerPlugin({ id: PLUGIN_ID, initializer: Initializer, isReady: false, name: PLUGIN_ID }); }, async registerTrads({ locales }) { const importedTranslations = await Promise.all( locales.map(async (locale) => { try { const { default: data } = await __variableDynamicImportRuntimeHelper(/* @__PURE__ */ Object.assign({ "./translations/en.json": () => Promise.resolve().then(() => require("./en-DUVjg0jJ.js")), "./translations/fr.json": () => Promise.resolve().then(() => require("./fr-DTrzyr9o.js")) }), `./translations/${locale}.json`, 3); return { data: getTranslation(data), locale }; } catch { return { data: {}, locale }; } }) ); return importedTranslations; } }; exports.PLUGIN_ID = PLUGIN_ID; exports.index = index;