@webbio/strapi-plugin-page-builder 0.12.3-platform → 0.12.5-platform

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.
@@ -1,5 +1,5 @@
1
- import React, { useState } from 'react';
2
- import slugify from 'slugify';
1
+ import React from 'react';
2
+ import slugify from '@sindresorhus/slugify';
3
3
  import { useSelector } from 'react-redux';
4
4
  import { useHistory } from 'react-router-dom';
5
5
 
@@ -10,7 +10,6 @@ import getRequestUrl from '../../../../utils/getRequestUrl';
10
10
  import { sanitizeModules } from '../../../../utils/sanitizeModules';
11
11
  import { PAGE_UID } from '../../../../../../shared/utils/constants';
12
12
  import { IGetTranslationPageLinks } from '../../../../../../server/controllers/collection-types';
13
- import { usePlatformFormData } from '../../../../utils/hooks/usePlatformFormData';
14
13
 
15
14
  import S from './styles';
16
15
  import { Platform } from '../../../../api/platform';
@@ -119,11 +118,11 @@ const createNewPage = async ({
119
118
  // Including locale in url is neccesary.
120
119
  const relatedEntityIdQuery = relatedEntityId ? `&plugins[i18n][relatedEntityId]=${relatedEntityId}` : '';
121
120
  const url = `/content-manager/collection-types/${PAGE_UID}?plugins[i18n][locale]=${locale}${relatedEntityIdQuery}`;
121
+
122
122
  const slugData = title
123
123
  ? {
124
124
  slug: slugify(title, {
125
- lower: true,
126
- trim: true
125
+ customReplacements: [['&', 'en']]
127
126
  })
128
127
  }
129
128
  : {};
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webbio/strapi-plugin-page-builder",
3
- "version": "0.12.3-platform",
3
+ "version": "0.12.5-platform",
4
4
  "description": "This is the description of the plugin.",
5
5
  "scripts": {
6
6
  "develop": "tsc -p tsconfig.server.json -w",
@@ -22,6 +22,7 @@
22
22
  "dependencies": {
23
23
  "@aws-sdk/client-ses": "^3.485.0",
24
24
  "@mantine/hooks": "^7.2.2",
25
+ "@sindresorhus/slugify": "^2.2.1",
25
26
  "@strapi/design-system": "^1.11.0",
26
27
  "@strapi/helper-plugin": "^4.15.0",
27
28
  "@strapi/icons": "^1.11.0",
@@ -32,8 +33,7 @@
32
33
  "aws-sdk": "^2.1528.0",
33
34
  "handlebars": "^4.7.8",
34
35
  "react-select": "^5.7.4",
35
- "sitemap": "^7.1.1",
36
- "slugify": "^1.6.6"
36
+ "sitemap": "^7.1.1"
37
37
  },
38
38
  "devDependencies": {
39
39
  "@types/react": "^18.2.21",
@@ -9,7 +9,7 @@ exports.default = async ({ strapi }) => {
9
9
  const models = collectionTypesWithPageMorph.map((ct) => ct.uid);
10
10
  (_a = strapi.db) === null || _a === void 0 ? void 0 : _a.lifecycles.subscribe({
11
11
  models,
12
- async beforeUpdate(event) {
12
+ async afterUpdate(event) {
13
13
  var _a, _b, _c, _d, _e, _f;
14
14
  try {
15
15
  let { data, where } = event === null || event === void 0 ? void 0 : event.params;
@@ -0,0 +1,18 @@
1
+ {
2
+ "kind": "collectionType",
3
+ "collectionName": "user-categories",
4
+ "info": {
5
+ "singularName": "user-category",
6
+ "pluralName": "user-categories",
7
+ "displayName": "User Categories"
8
+ },
9
+ "options": {
10
+ "draftAndPublish": false,
11
+ "comment": ""
12
+ },
13
+ "attributes": {
14
+ "title": {
15
+ "type": "string"
16
+ }
17
+ }
18
+ }
@@ -37,6 +37,9 @@
37
37
  "targetField": "title"
38
38
  }
39
39
  },
40
+ "options": {
41
+ "customReplacements": [["&", "en"]]
42
+ },
40
43
  "type": "customField",
41
44
  "customField": "plugin::slug.slug",
42
45
  "required": true
@@ -38,6 +38,9 @@
38
38
  "targetField": "title"
39
39
  }
40
40
  },
41
+ "options": {
42
+ "customReplacements": [["&", "en"]]
43
+ },
41
44
  "type": "customField",
42
45
  "customField": "plugin::slug.slug",
43
46
  "required": true