@_sh/strapi-plugin-ckeditor 4.0.6 → 4.0.7
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/dist/server/index.js +15 -8
- package/dist/server/index.js.map +1 -1
- package/dist/server/index.mjs +15 -8
- package/dist/server/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/server/index.js
CHANGED
|
@@ -152,15 +152,22 @@ var config$1 = ({ strapi: strapi2 }) => {
|
|
|
152
152
|
return {
|
|
153
153
|
getConfig() {
|
|
154
154
|
const appDir = process.cwd();
|
|
155
|
-
const
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
155
|
+
const isTsProject = fs.existsSync(`${appDir}/dist`);
|
|
156
|
+
const cfgDir = isTsProject ? `${appDir}/dist/config` : `${appDir}/config`;
|
|
157
|
+
const cfgFileName = "ckeditor.js";
|
|
158
|
+
const envName = process.env.NODE_ENV;
|
|
159
|
+
console.log("env");
|
|
160
|
+
console.log(envName);
|
|
161
|
+
const envFilePath = `${cfgDir}/env/${envName}/${cfgFileName}`;
|
|
162
|
+
const fallBackFilePath = `${cfgDir}/${cfgFileName}`;
|
|
163
|
+
let fileToRead;
|
|
164
|
+
if (fs.existsSync(envFilePath)) {
|
|
165
|
+
fileToRead = envFilePath;
|
|
166
|
+
} else if (fs.existsSync(fallBackFilePath)) {
|
|
167
|
+
fileToRead = fallBackFilePath;
|
|
162
168
|
}
|
|
163
|
-
return
|
|
169
|
+
return fileToRead ? fs.readFileSync(fileToRead, "utf8") + `
|
|
170
|
+
globalThis.SH_CKE_CONFIG = CKEConfig()` : `globalThis.SH_CKE_CONFIG = null`;
|
|
164
171
|
}
|
|
165
172
|
};
|
|
166
173
|
};
|
package/dist/server/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../server/src/utils/pluginId.js","../../server/src/register.js","../../server/src/controllers/config.js","../../server/src/controllers/index.js","../../server/src/routes/index.js","../../server/src/services/config.js","../../server/src/services/index.js","../../server/src/index.js"],"sourcesContent":["'use strict';\n\nconst pluginPkg = require('../../../package.json');\n\nmodule.exports =\n pluginPkg.strapi.name ||\n pluginPkg.name.replace(/^(@_sh\\/strapi-)plugin-/i, '');\n","'use strict';\n\nconst pluginId = require('./utils/pluginId');\n\nmodule.exports = ({ strapi }) => {\n strapi.customFields.register({\n name: 'CKEditor',\n plugin: pluginId,\n type: 'richtext',\n });\n};\n","'use strict';\n\nconst pluginId = require('../utils/pluginId');\n\nmodule.exports = {\n getConfig: async (ctx) => {\n const { responsiveDimensions = false } = await strapi\n .plugin('upload')\n .service('upload')\n .getSettings();\n\n const config =\n (await strapi.plugin(pluginId).service('config').getConfig()) +\n `\\nglobalThis.SH_CKE_UPLOAD_ADAPTER_IS_RESPONSIVE = ${responsiveDimensions}`;\n\n ctx.type = 'application/javascript';\n ctx.send(config);\n },\n};\n","'use strict';\n\nconst config = require('./config');\n\nmodule.exports = {\n config,\n};\n","module.exports = {\n config: {\n type: 'admin',\n routes: [\n {\n method: 'GET',\n path: '/config/ckeditor',\n handler: 'config.getConfig',\n config: {\n auth: false,\n },\n },\n ],\n },\n};\n","'use strict';\n\nconst fs = require('fs');\n\nmodule.exports = ({ strapi }) => {\n return {\n getConfig() {\n const appDir = process.cwd();\n
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../server/src/utils/pluginId.js","../../server/src/register.js","../../server/src/controllers/config.js","../../server/src/controllers/index.js","../../server/src/routes/index.js","../../server/src/services/config.js","../../server/src/services/index.js","../../server/src/index.js"],"sourcesContent":["'use strict';\n\nconst pluginPkg = require('../../../package.json');\n\nmodule.exports =\n pluginPkg.strapi.name ||\n pluginPkg.name.replace(/^(@_sh\\/strapi-)plugin-/i, '');\n","'use strict';\n\nconst pluginId = require('./utils/pluginId');\n\nmodule.exports = ({ strapi }) => {\n strapi.customFields.register({\n name: 'CKEditor',\n plugin: pluginId,\n type: 'richtext',\n });\n};\n","'use strict';\n\nconst pluginId = require('../utils/pluginId');\n\nmodule.exports = {\n getConfig: async (ctx) => {\n const { responsiveDimensions = false } = await strapi\n .plugin('upload')\n .service('upload')\n .getSettings();\n\n const config =\n (await strapi.plugin(pluginId).service('config').getConfig()) +\n `\\nglobalThis.SH_CKE_UPLOAD_ADAPTER_IS_RESPONSIVE = ${responsiveDimensions}`;\n\n ctx.type = 'application/javascript';\n ctx.send(config);\n },\n};\n","'use strict';\n\nconst config = require('./config');\n\nmodule.exports = {\n config,\n};\n","module.exports = {\n config: {\n type: 'admin',\n routes: [\n {\n method: 'GET',\n path: '/config/ckeditor',\n handler: 'config.getConfig',\n config: {\n auth: false,\n },\n },\n ],\n },\n};\n","'use strict';\n\nconst fs = require('fs');\n\nmodule.exports = ({ strapi }) => {\n return {\n getConfig() {\n const appDir = process.cwd();\n const isTsProject = fs.existsSync(`${appDir}/dist`);\n const cfgDir = isTsProject ? `${appDir}/dist/config` : `${appDir}/config`;\n const cfgFileName = 'ckeditor.js';\n const envName = process.env.NODE_ENV;\n\n console.log('env');\n console.log(envName);\n\n const envFilePath = `${cfgDir}/env/${envName}/${cfgFileName}`;\n const fallBackFilePath = `${cfgDir}/${cfgFileName}`;\n let fileToRead;\n\n if (fs.existsSync(envFilePath)) {\n fileToRead = envFilePath;\n } else if (fs.existsSync(fallBackFilePath)) {\n fileToRead = fallBackFilePath;\n }\n\n // for (const ext of ['js', 'ts']) {\n // console.log(filePath);\n // if (fs.existsSync(filePath)) {\n // return (\n // fs.readFileSync(filePath, 'utf8') +\n // `\\nglobalThis.SH_CKE_CONFIG = CKEConfig()`\n // );\n // }\n // }\n\n // for (const ext of ['js', 'ts']) {\n // const filePath = `${cfgDir}/${cfgFileName}.${ext}`;\n // if (fs.existsSync(filePath)) {\n // return (\n // fs.readFileSync(filePath, 'utf8') +\n // `\\nglobalThis.SH_CKE_CONFIG = CKEConfig()`\n // );\n // }\n // }\n\n return fileToRead ?\n fs.readFileSync(fileToRead, 'utf8') +\n `\\nglobalThis.SH_CKE_CONFIG = CKEConfig()`\n : `globalThis.SH_CKE_CONFIG = null`;\n },\n };\n};\n","'use strict';\n\nconst config = require('./config');\n\nmodule.exports = {\n config,\n};\n","'use strict';\n\nconst register = require('./register');\nconst controllers = require('./controllers');\nconst routes = require('./routes');\nconst services = require('./services');\n\nmodule.exports = {\n register,\n controllers,\n routes,\n services\n};\n"],"names":["pluginId","require$$0","register","strapi","config","controllers","routes","services","require$$1","require$$2","require$$3"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,MAAM,YAAY;IAElBA,aACE,UAAU,OAAO;ACHnB,MAAMA,aAAWC;AAEjB,IAAAC,aAAiB,CAAC,EAAE,QAAAC,cAAa;AAC/B,EAAAA,QAAO,aAAa,SAAS;AAAA,IAC3B,MAAM;AAAA,IACN,QAAQH;AAAAA,IACR,MAAM;AAAA,EACV,CAAG;AACH;ACRA,MAAM,WAAWC;AAEjB,IAAAG,WAAiB;AAAA,EACf,WAAW,OAAO,QAAQ;AACxB,UAAM,EAAE,uBAAuB,MAAO,IAAG,MAAM,OAC5C,OAAO,QAAQ,EACf,QAAQ,QAAQ,EAChB;AAEH,UAAMA,UACH,MAAM,OAAO,OAAO,QAAQ,EAAE,QAAQ,QAAQ,EAAE,UAAW,IAC5D;AAAA,mDAAsD,oBAAoB;AAE5E,QAAI,OAAO;AACX,QAAI,KAAKA,OAAM;AAAA,EAChB;AACH;AChBA,MAAMA,WAASH;AAEf,IAAAI,gBAAiB;AAAA,EACjB,QAAED;AACF;ACNA,IAAAE,WAAiB;AAAA,EACf,QAAQ;AAAA,IACN,MAAM;AAAA,IACN,QAAQ;AAAA,MACN;AAAA,QACE,QAAQ;AAAA,QACR,MAAM;AAAA,QACN,SAAS;AAAA,QACT,QAAQ;AAAA,UACN,MAAM;AAAA,QACP;AAAA,MACF;AAAA,IACF;AAAA,EACF;AACH;ACZA,MAAM,KAAKL,oBAAAA;AAEX,IAAAG,WAAiB,CAAC,EAAE,QAAAD,cAAa;AAC/B,SAAO;AAAA,IACL,YAAY;AACV,YAAM,SAAS,QAAQ;AACvB,YAAM,cAAc,GAAG,WAAW,GAAG,MAAM,OAAO;AAClD,YAAM,SAAS,cAAc,GAAG,MAAM,iBAAiB,GAAG,MAAM;AAChE,YAAM,cAAc;AACpB,YAAM,UAAU,QAAQ,IAAI;AAE5B,cAAQ,IAAI,KAAK;AACjB,cAAQ,IAAI,OAAO;AAEnB,YAAM,cAAc,GAAG,MAAM,QAAQ,OAAO,IAAI,WAAW;AAC3D,YAAM,mBAAmB,GAAG,MAAM,IAAI,WAAW;AACjD,UAAI;AAEJ,UAAI,GAAG,WAAW,WAAW,GAAG;AAC9B,qBAAa;AAAA,MACd,WAAU,GAAG,WAAW,gBAAgB,GAAG;AAC1C,qBAAa;AAAA,MACd;AAsBD,aAAO,aACH,GAAG,aAAa,YAAY,MAAM,IAChC;AAAA,0CACF;AAAA,IACL;AAAA,EACL;AACA;AClDA,MAAM,SAASF;AAEf,IAAAM,aAAiB;AAAA,EACf;AACF;ACJA,MAAM,WAAWN;AACjB,MAAM,cAAcO;AACpB,MAAM,SAASC;AACf,MAAM,WAAWC;AAEjB,IAAA,MAAiB;AAAA,EACf;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;;;"}
|
package/dist/server/index.mjs
CHANGED
|
@@ -149,15 +149,22 @@ var config$1 = ({ strapi: strapi2 }) => {
|
|
|
149
149
|
return {
|
|
150
150
|
getConfig() {
|
|
151
151
|
const appDir = process.cwd();
|
|
152
|
-
const
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
152
|
+
const isTsProject = fs.existsSync(`${appDir}/dist`);
|
|
153
|
+
const cfgDir = isTsProject ? `${appDir}/dist/config` : `${appDir}/config`;
|
|
154
|
+
const cfgFileName = "ckeditor.js";
|
|
155
|
+
const envName = process.env.NODE_ENV;
|
|
156
|
+
console.log("env");
|
|
157
|
+
console.log(envName);
|
|
158
|
+
const envFilePath = `${cfgDir}/env/${envName}/${cfgFileName}`;
|
|
159
|
+
const fallBackFilePath = `${cfgDir}/${cfgFileName}`;
|
|
160
|
+
let fileToRead;
|
|
161
|
+
if (fs.existsSync(envFilePath)) {
|
|
162
|
+
fileToRead = envFilePath;
|
|
163
|
+
} else if (fs.existsSync(fallBackFilePath)) {
|
|
164
|
+
fileToRead = fallBackFilePath;
|
|
159
165
|
}
|
|
160
|
-
return
|
|
166
|
+
return fileToRead ? fs.readFileSync(fileToRead, "utf8") + `
|
|
167
|
+
globalThis.SH_CKE_CONFIG = CKEConfig()` : `globalThis.SH_CKE_CONFIG = null`;
|
|
161
168
|
}
|
|
162
169
|
};
|
|
163
170
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":["../../server/src/utils/pluginId.js","../../server/src/register.js","../../server/src/controllers/config.js","../../server/src/controllers/index.js","../../server/src/routes/index.js","../../server/src/services/config.js","../../server/src/services/index.js","../../server/src/index.js"],"sourcesContent":["'use strict';\n\nconst pluginPkg = require('../../../package.json');\n\nmodule.exports =\n pluginPkg.strapi.name ||\n pluginPkg.name.replace(/^(@_sh\\/strapi-)plugin-/i, '');\n","'use strict';\n\nconst pluginId = require('./utils/pluginId');\n\nmodule.exports = ({ strapi }) => {\n strapi.customFields.register({\n name: 'CKEditor',\n plugin: pluginId,\n type: 'richtext',\n });\n};\n","'use strict';\n\nconst pluginId = require('../utils/pluginId');\n\nmodule.exports = {\n getConfig: async (ctx) => {\n const { responsiveDimensions = false } = await strapi\n .plugin('upload')\n .service('upload')\n .getSettings();\n\n const config =\n (await strapi.plugin(pluginId).service('config').getConfig()) +\n `\\nglobalThis.SH_CKE_UPLOAD_ADAPTER_IS_RESPONSIVE = ${responsiveDimensions}`;\n\n ctx.type = 'application/javascript';\n ctx.send(config);\n },\n};\n","'use strict';\n\nconst config = require('./config');\n\nmodule.exports = {\n config,\n};\n","module.exports = {\n config: {\n type: 'admin',\n routes: [\n {\n method: 'GET',\n path: '/config/ckeditor',\n handler: 'config.getConfig',\n config: {\n auth: false,\n },\n },\n ],\n },\n};\n","'use strict';\n\nconst fs = require('fs');\n\nmodule.exports = ({ strapi }) => {\n return {\n getConfig() {\n const appDir = process.cwd();\n
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":["../../server/src/utils/pluginId.js","../../server/src/register.js","../../server/src/controllers/config.js","../../server/src/controllers/index.js","../../server/src/routes/index.js","../../server/src/services/config.js","../../server/src/services/index.js","../../server/src/index.js"],"sourcesContent":["'use strict';\n\nconst pluginPkg = require('../../../package.json');\n\nmodule.exports =\n pluginPkg.strapi.name ||\n pluginPkg.name.replace(/^(@_sh\\/strapi-)plugin-/i, '');\n","'use strict';\n\nconst pluginId = require('./utils/pluginId');\n\nmodule.exports = ({ strapi }) => {\n strapi.customFields.register({\n name: 'CKEditor',\n plugin: pluginId,\n type: 'richtext',\n });\n};\n","'use strict';\n\nconst pluginId = require('../utils/pluginId');\n\nmodule.exports = {\n getConfig: async (ctx) => {\n const { responsiveDimensions = false } = await strapi\n .plugin('upload')\n .service('upload')\n .getSettings();\n\n const config =\n (await strapi.plugin(pluginId).service('config').getConfig()) +\n `\\nglobalThis.SH_CKE_UPLOAD_ADAPTER_IS_RESPONSIVE = ${responsiveDimensions}`;\n\n ctx.type = 'application/javascript';\n ctx.send(config);\n },\n};\n","'use strict';\n\nconst config = require('./config');\n\nmodule.exports = {\n config,\n};\n","module.exports = {\n config: {\n type: 'admin',\n routes: [\n {\n method: 'GET',\n path: '/config/ckeditor',\n handler: 'config.getConfig',\n config: {\n auth: false,\n },\n },\n ],\n },\n};\n","'use strict';\n\nconst fs = require('fs');\n\nmodule.exports = ({ strapi }) => {\n return {\n getConfig() {\n const appDir = process.cwd();\n const isTsProject = fs.existsSync(`${appDir}/dist`);\n const cfgDir = isTsProject ? `${appDir}/dist/config` : `${appDir}/config`;\n const cfgFileName = 'ckeditor.js';\n const envName = process.env.NODE_ENV;\n\n console.log('env');\n console.log(envName);\n\n const envFilePath = `${cfgDir}/env/${envName}/${cfgFileName}`;\n const fallBackFilePath = `${cfgDir}/${cfgFileName}`;\n let fileToRead;\n\n if (fs.existsSync(envFilePath)) {\n fileToRead = envFilePath;\n } else if (fs.existsSync(fallBackFilePath)) {\n fileToRead = fallBackFilePath;\n }\n\n // for (const ext of ['js', 'ts']) {\n // console.log(filePath);\n // if (fs.existsSync(filePath)) {\n // return (\n // fs.readFileSync(filePath, 'utf8') +\n // `\\nglobalThis.SH_CKE_CONFIG = CKEConfig()`\n // );\n // }\n // }\n\n // for (const ext of ['js', 'ts']) {\n // const filePath = `${cfgDir}/${cfgFileName}.${ext}`;\n // if (fs.existsSync(filePath)) {\n // return (\n // fs.readFileSync(filePath, 'utf8') +\n // `\\nglobalThis.SH_CKE_CONFIG = CKEConfig()`\n // );\n // }\n // }\n\n return fileToRead ?\n fs.readFileSync(fileToRead, 'utf8') +\n `\\nglobalThis.SH_CKE_CONFIG = CKEConfig()`\n : `globalThis.SH_CKE_CONFIG = null`;\n },\n };\n};\n","'use strict';\n\nconst config = require('./config');\n\nmodule.exports = {\n config,\n};\n","'use strict';\n\nconst register = require('./register');\nconst controllers = require('./controllers');\nconst routes = require('./routes');\nconst services = require('./services');\n\nmodule.exports = {\n register,\n controllers,\n routes,\n services\n};\n"],"names":["pluginId","require$$0","register","strapi","config","controllers","routes","services","require$$1","require$$2","require$$3"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,MAAM,YAAY;IAElBA,aACE,UAAU,OAAO;ACHnB,MAAMA,aAAWC;AAEjB,IAAAC,aAAiB,CAAC,EAA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