@localazy/strapi-plugin 0.1.13-rc.6 → 0.1.14

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.
@@ -0,0 +1,5 @@
1
+ const SUPPORTED_CUSTOM_FIELD_PLUGINS = [
2
+ "plugin::ckeditor.CKEditor",
3
+ ];
4
+
5
+ export default SUPPORTED_CUSTOM_FIELD_PLUGINS;
@@ -1,4 +1,5 @@
1
1
  import SUPPORTED_CONTENT_TYPE_FIELDS from "../../@common/models/supported-content-type-fields";
2
+ import SUPPORTED_CUSTOM_FIELD_PLUGINS from "../../@common/models/supported-custom-field-plugins";
2
3
 
3
4
  export default (models) => {
4
5
  if (!models) {
@@ -10,8 +11,10 @@ export default (models) => {
10
11
 
11
12
  const attributes = attributesKeys.map((attributeKey) => {
12
13
  const type = model.__schema__.attributes[attributeKey].type;
14
+ const customField = model.__schema__.attributes[attributeKey].customField;
13
15
 
14
- if (!SUPPORTED_CONTENT_TYPE_FIELDS.includes(type.toLowerCase())) {
16
+ if (!(SUPPORTED_CONTENT_TYPE_FIELDS.includes(type.toLowerCase())
17
+ || (type.toLowerCase() === "customfield" && SUPPORTED_CUSTOM_FIELD_PLUGINS.includes(customField)))) {
15
18
  return null;
16
19
  }
17
20
 
@@ -1,4 +1,5 @@
1
1
  import SUPPORTED_CONTENT_TYPE_FIELDS from "../../@common/models/supported-content-type-fields";
2
+ import SUPPORTED_CUSTOM_FIELD_PLUGINS from "../../@common/models/supported-custom-field-plugins";
2
3
 
3
4
  /**
4
5
  * Supported kinds of models are expected by the function, needs to be checked before calling the function
@@ -46,7 +47,9 @@ const getModelsTree = (allModels, localizableModels = []) => {
46
47
  ...modelTree,
47
48
  });
48
49
  });
49
- } else if (SUPPORTED_CONTENT_TYPE_FIELDS.includes(attributes[attribute].type)) {
50
+ } else if (
51
+ SUPPORTED_CONTENT_TYPE_FIELDS.includes(attributes[attribute].type)
52
+ || (attributes[attribute].type === "customField" && SUPPORTED_CUSTOM_FIELD_PLUGINS.includes(attributes[attribute].customField))) {
50
53
  // field might not be localizable
51
54
  if (isComponentAttributes) {
52
55
  if (isComponentAttributesObjectTranslatable) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@localazy/strapi-plugin",
3
- "version": "0.1.13-rc.6",
3
+ "version": "0.1.14",
4
4
  "description": "The official Strapi Plugin by Localazy.",
5
5
  "strapi": {
6
6
  "name": "localazy",
@@ -66,5 +66,8 @@
66
66
  "engines": {
67
67
  "node": ">=14.19.1 <=18.x.x",
68
68
  "npm": ">=6.0.0"
69
+ },
70
+ "browser": {
71
+ "crypto": false
69
72
  }
70
73
  }
@@ -0,0 +1,5 @@
1
+ const SUPPORTED_CUSTOM_FIELD_PLUGINS = [
2
+ "plugin::ckeditor.CKEditor",
3
+ ];
4
+
5
+ module.exports = SUPPORTED_CUSTOM_FIELD_PLUGINS;
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
 
3
3
  const SUPPORTED_CONTENT_TYPE_FIELDS = require("../models/supported-content-type-fields");
4
+ const SUPPORTED_CUSTOM_FIELD_PLUGINS = require("../models/supported-custom-field-plugins");
4
5
 
5
6
  const getModelTree = (attributes, models) => {
6
7
  const currentModelTree = {};
@@ -15,6 +16,7 @@ const getModelTree = (attributes, models) => {
15
16
  };
16
17
  } else if (
17
18
  SUPPORTED_CONTENT_TYPE_FIELDS.includes(attributes[attribute].type)
19
+ || (attributes[attribute].type === "customField" && SUPPORTED_CUSTOM_FIELD_PLUGINS.includes(attributes[attribute].customField))
18
20
  ) {
19
21
  currentModelTree[attribute] = false;
20
22
  } else {