UNPKG

strapi-plugin-all-in-one-accessibility

Version:
81 lines (80 loc) 4.05 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 pluginId = "all-in-one-accessibility"; const getTranslation = (id) => `${pluginId}.${id}`; const Initializer = ({ setPlugin }) => { const ref = react.useRef(setPlugin); react.useEffect(() => { ref.current(pluginId); }, []); return null; }; const aioaicontype1 = "data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='65'%20height='65'%20viewBox='0%200%2065%2065'%3e%3cg%20transform='translate(-9812.362%20-911.638)'%3e%3ccircle%20cx='32.5'%20cy='32.5'%20r='32.5'%20transform='translate(9812.362%20911.638)'%20fill='%23420083'/%3e%3cpath%20d='M27.488,0A27.5,27.5,0,1,1,8.052,8.054,27.5,27.5,0,0,1,27.488,0Zm-.174,33.19-4,11.065a2.2,2.2,0,0,1-1.154,1.266,2.237,2.237,0,0,1-2.975-1.074,2.264,2.264,0,0,1-.076-1.718L21.895,35a11.382,11.382,0,0,0,.523-1.79,18.746,18.746,0,0,0,.242-1.888c.107-1.132.183-2.358.242-3.535s.1-2.318.13-3.262c.04-1.177-.277-1.253-1.221-1.476l-.2-.045-8.054-1.517a2.237,2.237,0,1,1,.814-4.385l8.653,1.624c.345.031.68.072,1.034.112a25.736,25.736,0,0,0,3.212.237,36.2,36.2,0,0,0,4-.282c.4-.045.783-.094,1.163-.13l8.165-1.53a2.21,2.21,0,0,1,2.277,3.423v.027a2.237,2.237,0,0,1-1.436.935l-7.821,1.468c-.26.058-.492.1-.7.13-.814.139-1.217.21-1.168,1.369.036.846.139,1.857.273,2.913.157,1.239.362,2.555.577,3.758a18.344,18.344,0,0,0,.447,2.036c.179.608.353,1.23.622,1.978l2.734,7.561a2.237,2.237,0,1,1-4.2,1.526L28.186,33.212l-.447-.819-.447.8Zm.174-23.946A3.951,3.951,0,1,1,24.7,10.4a3.951,3.951,0,0,1,2.792-1.159Zm16.264,1.982a23.006,23.006,0,1,0,6.711,16.264,23.006,23.006,0,0,0-6.711-16.264Z'%20transform='translate(9817.359%20916.631)'%20fill='%23fff'/%3e%3c/g%3e%3c/svg%3e"; const PluginIcon = () => /* @__PURE__ */ jsxRuntime.jsx("img", { src: aioaicontype1, alt: "All in One Accessibility", width: 20, height: 20 }); const index = { /** * App/Plugin Registration on Strapi Admin Panel */ register(app) { app.addMenuLink({ to: `plugins/${PluginIcon}`, icon: PluginIcon, intlLabel: { id: `${pluginId}.plugin.name`, defaultMessage: "All in One Accessibility" }, name: "All in One Accessibility", Component: async () => { const script = document.createElement("script"); script.src = "https://www.skynettechnologies.com/accessibilitynode/js/accessibility-loader.js?colorcode=#420083&token=&position=bottom_right.aioa-icon-type-1.aioa-default-icon"; script.async = true; document.body.appendChild(script); const { App } = await Promise.resolve().then(() => require("../_chunks/App-B0LaLKC4.js")); return App; } }); app.registerPlugin({ id: pluginId, initializer: Initializer, isReady: false, name: "All in One Accessibility" }); }, async registerTrads(app) { const { locales } = app; const importedTranslations = await Promise.all( locales.map((locale) => { return __variableDynamicImportRuntimeHelper(/* @__PURE__ */ Object.assign({ "./translations/en.json": () => Promise.resolve().then(() => require("../_chunks/en-B4KWt_jN.js")) }), `./translations/${locale}.json`, 3).then(({ default: data }) => { return { data: getTranslation(data), locale }; }).catch(() => { return { data: {}, locale }; }); }) ); return importedTranslations; } }; module.exports = index;