101 lines
2.7 KiB
JavaScript
101 lines
2.7 KiB
JavaScript
import {
|
|
pluginId
|
|
} from "./chunk-RH4C26B2.js";
|
|
import {
|
|
ForwardRef$4n
|
|
} from "./chunk-WRD5KPDH.js";
|
|
import "./chunk-NIAJZ5MX.js";
|
|
import "./chunk-ACIMPXWY.js";
|
|
import {
|
|
require_react
|
|
} from "./chunk-MADUDGYZ.js";
|
|
import {
|
|
__toESM
|
|
} from "./chunk-PLDDJCW6.js";
|
|
|
|
// node_modules/@strapi/plugin-cloud/dist/admin/components/Initializer.mjs
|
|
var import_react = __toESM(require_react(), 1);
|
|
var Initializer = ({ setPlugin }) => {
|
|
const ref = (0, import_react.useRef)(setPlugin);
|
|
(0, import_react.useEffect)(() => {
|
|
ref.current(pluginId);
|
|
}, []);
|
|
return null;
|
|
};
|
|
|
|
// node_modules/@strapi/plugin-cloud/dist/admin/utils/prefixPluginTranslations.mjs
|
|
var prefixPluginTranslations = (trad, pluginId2) => {
|
|
return Object.keys(trad).reduce((acc, current) => {
|
|
acc[`${pluginId2}.${current}`] = trad[current];
|
|
return acc;
|
|
}, {});
|
|
};
|
|
|
|
// node_modules/@strapi/plugin-cloud/dist/admin/index.mjs
|
|
function __variableDynamicImportRuntime1__(path) {
|
|
switch (path) {
|
|
case "./translations/en.json":
|
|
return import("./en.json-LOEYTETI.js");
|
|
case "./translations/fr.json":
|
|
return import("./fr.json-FH7EDBW7.js");
|
|
case "./translations/ru.json":
|
|
return import("./ru.json-IV7JABZF.js");
|
|
case "./translations/uk.json":
|
|
return import("./uk.json-JEGTVCJW.js");
|
|
default:
|
|
return new Promise(function(resolve, reject) {
|
|
(typeof queueMicrotask === "function" ? queueMicrotask : setTimeout)(
|
|
reject.bind(null, new Error("Unknown variable dynamic import: " + path))
|
|
);
|
|
});
|
|
}
|
|
}
|
|
var name = "Deploy";
|
|
var index = {
|
|
register(app) {
|
|
const { backendURL } = window.strapi;
|
|
if (backendURL == null ? void 0 : backendURL.includes("localhost")) {
|
|
app.addMenuLink({
|
|
to: `plugins/${pluginId}`,
|
|
icon: ForwardRef$4n,
|
|
intlLabel: {
|
|
id: `${pluginId}.plugin.name`,
|
|
defaultMessage: name
|
|
},
|
|
Component: async () => {
|
|
const { App } = await import("./App-7CUG4FT5.js");
|
|
return App;
|
|
}
|
|
});
|
|
const plugin = {
|
|
id: pluginId,
|
|
initializer: Initializer,
|
|
isReady: false,
|
|
name
|
|
};
|
|
app.registerPlugin(plugin);
|
|
}
|
|
},
|
|
async registerTrads(app) {
|
|
const { locales } = app;
|
|
const importedTrads = await Promise.all(locales.map((locale) => {
|
|
return __variableDynamicImportRuntime1__(`./translations/${locale}.json`).then(({ default: data }) => {
|
|
return {
|
|
data: prefixPluginTranslations(data, pluginId),
|
|
locale
|
|
};
|
|
}).catch(() => {
|
|
return {
|
|
data: {},
|
|
locale
|
|
};
|
|
});
|
|
}));
|
|
return Promise.resolve(importedTrads);
|
|
}
|
|
};
|
|
export {
|
|
index as default
|
|
};
|
|
//# sourceMappingURL=@strapi_plugin-cloud_strapi-admin.js.map
|