strapi-plugin-wysiwyg-react-md-editor
Version:
Replaces the default Strapi WYSIWYG editor with react md editor.
60 lines (59 loc) • 1.83 kB
JavaScript
;
const __variableDynamicImportRuntimeHelper = (glob, path) => {
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)));
});
};
const strapi = {
name: "wysiwyg-react-md-editor"
};
const pluginPkg = {
strapi
};
const PLUGIN_ID = pluginPkg.strapi.name;
const name = pluginPkg.strapi.name;
const index = {
register(app) {
app.customFields.register({
name,
type: "richtext",
pluginId: PLUGIN_ID,
intlLabel: {
id: `${PLUGIN_ID}.label`,
defaultMessage: PLUGIN_ID
},
intlDescription: {
id: `${PLUGIN_ID}.description`,
defaultMessage: "The markdown text editor for every use case"
},
components: {
Input: async () => await Promise.resolve().then(() => require("./CustomField-Bmif09ie.js"))
}
});
},
async registerTrads({ locales }) {
const importedTrads = await Promise.all(
locales.map((locale) => {
return __variableDynamicImportRuntimeHelper(/* @__PURE__ */ Object.assign({ "./translations/en.json": () => Promise.resolve().then(() => require("./en-BuYfsWl1.js")), "./translations/fr.json": () => Promise.resolve().then(() => require("./fr-C33ejXhN.js")) }), `./translations/${locale}.json`).then(({ default: data }) => {
return {
data,
locale
};
}).catch(() => {
return {
data: {},
locale
};
});
})
);
return Promise.resolve(importedTrads);
}
};
exports.PLUGIN_ID = PLUGIN_ID;
exports.index = index;
//# sourceMappingURL=index-DZTipvMh.js.map