@webbio/strapi-plugin-page-builder 0.2.2 → 0.2.4

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.
Files changed (93) hide show
  1. package/README.md +98 -98
  2. package/admin/src/api/collection-type.ts +110 -110
  3. package/admin/src/api/has-page-relation.ts +34 -34
  4. package/admin/src/api/page-type.ts +31 -31
  5. package/admin/src/api/template.ts +27 -27
  6. package/admin/src/components/Combobox/index.tsx +77 -77
  7. package/admin/src/components/Combobox/react-select-custom-styles.tsx +120 -111
  8. package/admin/src/components/Combobox/styles.ts +22 -22
  9. package/admin/src/components/ConfirmModal/index.tsx +90 -90
  10. package/admin/src/components/EditView/CollectionTypeSearch/index.tsx +124 -124
  11. package/admin/src/components/EditView/CollectionTypeSettings/CreatePageButton/index.tsx +104 -101
  12. package/admin/src/components/EditView/CollectionTypeSettings/CreatePageButton/styles.ts +19 -19
  13. package/admin/src/components/EditView/CollectionTypeSettings/index.tsx +74 -74
  14. package/admin/src/components/EditView/Details/index.tsx +47 -47
  15. package/admin/src/components/EditView/Details/styles.ts +51 -51
  16. package/admin/src/components/EditView/PageSettings/index.tsx +104 -104
  17. package/admin/src/components/EditView/Template/TemplateConfirmModal/index.tsx +36 -36
  18. package/admin/src/components/EditView/Template/TemplateSelect/index.tsx +69 -69
  19. package/admin/src/components/EditView/Template/TemplateSelect/use-template-modules.ts +38 -38
  20. package/admin/src/components/EditView/index.tsx +29 -29
  21. package/admin/src/components/EditView/page-type-select.tsx +32 -32
  22. package/admin/src/components/EditView/wrapper.tsx +35 -35
  23. package/admin/src/components/Initializer/index.tsx +24 -24
  24. package/admin/src/components/PageTypeFilter/index.tsx +17 -17
  25. package/admin/src/components/PageTypeFilter/page-type-filter.tsx +130 -130
  26. package/admin/src/components/PluginIcon/index.tsx +12 -12
  27. package/admin/src/constants.ts +3 -3
  28. package/admin/src/index.tsx +59 -59
  29. package/admin/src/middlewares/index.tsx +37 -37
  30. package/admin/src/pluginId.ts +5 -5
  31. package/admin/src/translations/en.json +6 -6
  32. package/admin/src/translations/nl.json +6 -6
  33. package/admin/src/utils/getRequestUrl.ts +11 -11
  34. package/admin/src/utils/getTrad.ts +5 -5
  35. package/admin/src/utils/hooks/useDebounce.ts +17 -17
  36. package/admin/src/utils/hooks/useGetLocaleFromUrl.ts +9 -9
  37. package/admin/src/utils/hooks/usePrevious.ts +12 -12
  38. package/admin/src/utils/sanitizeModules.ts +43 -10
  39. package/custom.d.ts +5 -5
  40. package/dist/package.json +9 -9
  41. package/dist/server/graphql/page-by-slug.js +9 -9
  42. package/dist/server/graphql/pages-by-uid.js +14 -14
  43. package/dist/server/services/builder.js +7 -4
  44. package/dist/server/services/template.js +1 -2
  45. package/dist/server/utils/graphql.js +18 -18
  46. package/dist/server/utils/strapi.js +1 -4
  47. package/dist/tsconfig.server.tsbuildinfo +1 -1
  48. package/package.json +71 -71
  49. package/server/bootstrap/collection-type-lifecycles.ts +47 -47
  50. package/server/bootstrap/permissions.ts +42 -42
  51. package/server/bootstrap.ts +198 -198
  52. package/server/config/index.ts +4 -4
  53. package/server/content-types/index.ts +1 -1
  54. package/server/controllers/collection-types.ts +27 -27
  55. package/server/controllers/index.ts +11 -11
  56. package/server/controllers/page-type.ts +13 -13
  57. package/server/controllers/page.ts +9 -9
  58. package/server/controllers/template.ts +16 -16
  59. package/server/destroy.ts +5 -5
  60. package/server/graphql/index.ts +9 -9
  61. package/server/graphql/page-by-slug.ts +98 -98
  62. package/server/graphql/page-type.ts +67 -67
  63. package/server/graphql/pages-by-uid.ts +127 -127
  64. package/server/index.ts +23 -23
  65. package/server/middlewares/index.ts +1 -1
  66. package/server/policies/index.ts +1 -1
  67. package/server/register.ts +15 -15
  68. package/server/routes/index.ts +58 -58
  69. package/server/schema/page-end.json +91 -91
  70. package/server/schema/page-start.json +87 -87
  71. package/server/schema/page-type-end.json +43 -43
  72. package/server/schema/page-type-start.json +38 -38
  73. package/server/schema/template-start.json +35 -35
  74. package/server/services/builder.ts +137 -134
  75. package/server/services/collection-types.ts +88 -88
  76. package/server/services/index.ts +13 -13
  77. package/server/services/page-type.ts +26 -26
  78. package/server/services/page.ts +24 -24
  79. package/server/services/template.ts +13 -14
  80. package/server/utils/filter-underscore-arguments.ts +12 -12
  81. package/server/utils/graphql.ts +113 -113
  82. package/server/utils/paginationValidation.ts +39 -39
  83. package/server/utils/reload-strapi-on-load.ts +13 -13
  84. package/server/utils/strapi.ts +45 -49
  85. package/shared/utils/constants.ts +4 -4
  86. package/shared/utils/sleep.ts +1 -1
  87. package/strapi-admin.js +3 -3
  88. package/strapi-server.js +3 -3
  89. package/tsconfig.json +20 -20
  90. package/tsconfig.server.json +25 -25
  91. package/dist/server/controllers/platform.js +0 -20
  92. package/dist/server/schema/platform-start.json +0 -31
  93. package/dist/server/services/platform.js +0 -36
@@ -1,58 +1,58 @@
1
- const routes = {
2
- 'page-type': {
3
- type: 'admin',
4
- prefix: undefined,
5
- routes: [
6
- {
7
- method: 'GET',
8
- path: '/page-types/:uid',
9
- handler: 'page-type.findOneByUid'
10
- }
11
- ]
12
- },
13
- page: {
14
- type: 'admin',
15
- prefix: undefined,
16
- routes: [
17
- {
18
- method: 'GET',
19
- path: '/page/:id',
20
- handler: 'page.getPage'
21
- }
22
- ]
23
- },
24
- 'collection-types': {
25
- type: 'admin',
26
- prefix: undefined,
27
- routes: [
28
- {
29
- method: 'GET',
30
- path: '/collection-types/:uid',
31
- handler: 'collection-types.hasPageRelation'
32
- },
33
- {
34
- method: 'GET',
35
- path: '/collection-types-page-links/:uid/:ids?',
36
- handler: 'collection-types.getTranslationPageLinks'
37
- }
38
- ]
39
- },
40
- template: {
41
- type: 'admin',
42
- prefix: undefined,
43
- routes: [
44
- {
45
- method: 'GET',
46
- path: '/template',
47
- handler: 'template.findAll'
48
- },
49
- {
50
- method: 'GET',
51
- path: '/template/:id',
52
- handler: 'template.findOneById'
53
- }
54
- ]
55
- }
56
- };
57
-
58
- export default routes;
1
+ const routes = {
2
+ 'page-type': {
3
+ type: 'admin',
4
+ prefix: undefined,
5
+ routes: [
6
+ {
7
+ method: 'GET',
8
+ path: '/page-types/:uid',
9
+ handler: 'page-type.findOneByUid'
10
+ }
11
+ ]
12
+ },
13
+ page: {
14
+ type: 'admin',
15
+ prefix: undefined,
16
+ routes: [
17
+ {
18
+ method: 'GET',
19
+ path: '/page/:id',
20
+ handler: 'page.getPage'
21
+ }
22
+ ]
23
+ },
24
+ 'collection-types': {
25
+ type: 'admin',
26
+ prefix: undefined,
27
+ routes: [
28
+ {
29
+ method: 'GET',
30
+ path: '/collection-types/:uid',
31
+ handler: 'collection-types.hasPageRelation'
32
+ },
33
+ {
34
+ method: 'GET',
35
+ path: '/collection-types-page-links/:uid/:ids?',
36
+ handler: 'collection-types.getTranslationPageLinks'
37
+ }
38
+ ]
39
+ },
40
+ template: {
41
+ type: 'admin',
42
+ prefix: undefined,
43
+ routes: [
44
+ {
45
+ method: 'GET',
46
+ path: '/template',
47
+ handler: 'template.findAll'
48
+ },
49
+ {
50
+ method: 'GET',
51
+ path: '/template/:id',
52
+ handler: 'template.findOneById'
53
+ }
54
+ ]
55
+ }
56
+ };
57
+
58
+ export default routes;
@@ -1,91 +1,91 @@
1
- {
2
- "draftAndPublish": true,
3
- "displayName": "Pagina's",
4
- "singularName": "page",
5
- "pluralName": "pages",
6
- "description": "",
7
- "plugin": "page-builder",
8
- "pluginOptions": {
9
- "i18n": {
10
- "localized": true
11
- }
12
- },
13
- "kind": "collectionType",
14
- "collectionName": "pages",
15
- "attributes": {
16
- "collectionTypeData": {
17
- "type": "relation",
18
- "relation": "morphToMany",
19
- "configurable": false
20
- },
21
- "title": {
22
- "pluginOptions": {
23
- "i18n": {
24
- "localized": true
25
- }
26
- },
27
- "type": "string",
28
- "required": true
29
- },
30
- "slug": {
31
- "pluginOptions": {
32
- "i18n": {
33
- "localized": true
34
- },
35
- "slug": {
36
- "field": "slug",
37
- "targetField": "title"
38
- }
39
- },
40
- "type": "customField",
41
- "customField": "plugin::slug.slug",
42
- "required": true
43
- },
44
- "path": {
45
- "pluginOptions": {
46
- "i18n": {
47
- "localized": true
48
- }
49
- },
50
- "type": "string",
51
- "required": false
52
- },
53
- "parent": {
54
- "type": "relation",
55
- "relation": "oneToOne",
56
- "target": "api::page.page",
57
- "private": false
58
- },
59
- "excerpt": {
60
- "pluginOptions": {
61
- "i18n": {
62
- "localized": true
63
- }
64
- },
65
- "type": "text"
66
- },
67
- "modules": {
68
- "pluginOptions": {
69
- "i18n": {
70
- "localized": true
71
- }
72
- },
73
- "type": "dynamiczone",
74
- "components": []
75
- },
76
- "seo": {
77
- "type": "component",
78
- "pluginOptions": {
79
- "i18n": {
80
- "localized": true
81
- }
82
- },
83
- "component": "shared.seo"
84
- },
85
- "pageType": {
86
- "type": "relation",
87
- "relation": "oneToOne",
88
- "target": "api::page-type.page-type"
89
- }
90
- }
91
- }
1
+ {
2
+ "draftAndPublish": true,
3
+ "displayName": "Pagina's",
4
+ "singularName": "page",
5
+ "pluralName": "pages",
6
+ "description": "",
7
+ "plugin": "page-builder",
8
+ "pluginOptions": {
9
+ "i18n": {
10
+ "localized": true
11
+ }
12
+ },
13
+ "kind": "collectionType",
14
+ "collectionName": "pages",
15
+ "attributes": {
16
+ "collectionTypeData": {
17
+ "type": "relation",
18
+ "relation": "morphToMany",
19
+ "configurable": false
20
+ },
21
+ "title": {
22
+ "pluginOptions": {
23
+ "i18n": {
24
+ "localized": true
25
+ }
26
+ },
27
+ "type": "string",
28
+ "required": true
29
+ },
30
+ "slug": {
31
+ "pluginOptions": {
32
+ "i18n": {
33
+ "localized": true
34
+ },
35
+ "slug": {
36
+ "field": "slug",
37
+ "targetField": "title"
38
+ }
39
+ },
40
+ "type": "customField",
41
+ "customField": "plugin::slug.slug",
42
+ "required": true
43
+ },
44
+ "path": {
45
+ "pluginOptions": {
46
+ "i18n": {
47
+ "localized": true
48
+ }
49
+ },
50
+ "type": "string",
51
+ "required": false
52
+ },
53
+ "parent": {
54
+ "type": "relation",
55
+ "relation": "oneToOne",
56
+ "target": "api::page.page",
57
+ "private": false
58
+ },
59
+ "excerpt": {
60
+ "pluginOptions": {
61
+ "i18n": {
62
+ "localized": true
63
+ }
64
+ },
65
+ "type": "text"
66
+ },
67
+ "modules": {
68
+ "pluginOptions": {
69
+ "i18n": {
70
+ "localized": true
71
+ }
72
+ },
73
+ "type": "dynamiczone",
74
+ "components": []
75
+ },
76
+ "seo": {
77
+ "type": "component",
78
+ "pluginOptions": {
79
+ "i18n": {
80
+ "localized": true
81
+ }
82
+ },
83
+ "component": "shared.seo"
84
+ },
85
+ "pageType": {
86
+ "type": "relation",
87
+ "relation": "oneToOne",
88
+ "target": "api::page-type.page-type"
89
+ }
90
+ }
91
+ }
@@ -1,87 +1,87 @@
1
- {
2
- "draftAndPublish": true,
3
- "displayName": "Pagina's",
4
- "singularName": "page",
5
- "pluralName": "pages",
6
- "description": "",
7
- "plugin": "page-builder",
8
- "pluginOptions": {
9
- "i18n": {
10
- "localized": true
11
- }
12
- },
13
- "kind": "collectionType",
14
- "collectionName": "pages",
15
- "attributes": {
16
- "collectionTypeData": {
17
- "type": "relation",
18
- "relation": "morphToMany",
19
- "configurable": false,
20
- "private": false
21
- },
22
- "title": {
23
- "pluginOptions": {
24
- "i18n": {
25
- "localized": true
26
- }
27
- },
28
- "type": "string",
29
- "required": true
30
- },
31
- "slug": {
32
- "pluginOptions": {
33
- "i18n": {
34
- "localized": true
35
- },
36
- "slug": {
37
- "field": "slug",
38
- "targetField": "title"
39
- }
40
- },
41
- "type": "customField",
42
- "customField": "plugin::slug.slug",
43
- "required": true
44
- },
45
- "path": {
46
- "pluginOptions": {
47
- "i18n": {
48
- "localized": true
49
- }
50
- },
51
- "type": "string",
52
- "required": false
53
- },
54
- "parent": {
55
- "type": "relation",
56
- "relation": "oneToOne",
57
- "target": "api::page.page",
58
- "private": false
59
- },
60
- "excerpt": {
61
- "pluginOptions": {
62
- "i18n": {
63
- "localized": true
64
- }
65
- },
66
- "type": "text"
67
- },
68
- "modules": {
69
- "pluginOptions": {
70
- "i18n": {
71
- "localized": true
72
- }
73
- },
74
- "type": "dynamiczone",
75
- "components": []
76
- },
77
- "seo": {
78
- "type": "component",
79
- "pluginOptions": {
80
- "i18n": {
81
- "localized": true
82
- }
83
- },
84
- "component": "shared.seo"
85
- }
86
- }
87
- }
1
+ {
2
+ "draftAndPublish": true,
3
+ "displayName": "Pagina's",
4
+ "singularName": "page",
5
+ "pluralName": "pages",
6
+ "description": "",
7
+ "plugin": "page-builder",
8
+ "pluginOptions": {
9
+ "i18n": {
10
+ "localized": true
11
+ }
12
+ },
13
+ "kind": "collectionType",
14
+ "collectionName": "pages",
15
+ "attributes": {
16
+ "collectionTypeData": {
17
+ "type": "relation",
18
+ "relation": "morphToMany",
19
+ "configurable": false,
20
+ "private": false
21
+ },
22
+ "title": {
23
+ "pluginOptions": {
24
+ "i18n": {
25
+ "localized": true
26
+ }
27
+ },
28
+ "type": "string",
29
+ "required": true
30
+ },
31
+ "slug": {
32
+ "pluginOptions": {
33
+ "i18n": {
34
+ "localized": true
35
+ },
36
+ "slug": {
37
+ "field": "slug",
38
+ "targetField": "title"
39
+ }
40
+ },
41
+ "type": "customField",
42
+ "customField": "plugin::slug.slug",
43
+ "required": true
44
+ },
45
+ "path": {
46
+ "pluginOptions": {
47
+ "i18n": {
48
+ "localized": true
49
+ }
50
+ },
51
+ "type": "string",
52
+ "required": false
53
+ },
54
+ "parent": {
55
+ "type": "relation",
56
+ "relation": "oneToOne",
57
+ "target": "api::page.page",
58
+ "private": false
59
+ },
60
+ "excerpt": {
61
+ "pluginOptions": {
62
+ "i18n": {
63
+ "localized": true
64
+ }
65
+ },
66
+ "type": "text"
67
+ },
68
+ "modules": {
69
+ "pluginOptions": {
70
+ "i18n": {
71
+ "localized": true
72
+ }
73
+ },
74
+ "type": "dynamiczone",
75
+ "components": []
76
+ },
77
+ "seo": {
78
+ "type": "component",
79
+ "pluginOptions": {
80
+ "i18n": {
81
+ "localized": true
82
+ }
83
+ },
84
+ "component": "shared.seo"
85
+ }
86
+ }
87
+ }
@@ -1,43 +1,43 @@
1
- {
2
- "draftAndPublish": false,
3
- "displayName": "Pagina Types",
4
- "singularName": "page-type",
5
- "pluralName": "page-types",
6
- "description": "",
7
- "plugin": "page-builder",
8
- "pluginOptions": {
9
- "i18n": {
10
- "localized": true
11
- }
12
- },
13
- "kind": "collectionType",
14
- "collectionName": "page_types",
15
- "attributes": {
16
- "uid": {
17
- "type": "string",
18
- "required": true
19
- },
20
- "title": {
21
- "type": "string",
22
- "pluginOptions": {
23
- "i18n": {
24
- "localized": true
25
- }
26
- }
27
- },
28
- "modules": {
29
- "type": "dynamiczone",
30
- "components": [],
31
- "pluginOptions": {
32
- "i18n": {
33
- "localized": true
34
- }
35
- }
36
- },
37
- "template": {
38
- "type": "relation",
39
- "relation": "oneToOne",
40
- "target": "api::template.template"
41
- }
42
- }
43
- }
1
+ {
2
+ "draftAndPublish": false,
3
+ "displayName": "Pagina Types",
4
+ "singularName": "page-type",
5
+ "pluralName": "page-types",
6
+ "description": "",
7
+ "plugin": "page-builder",
8
+ "pluginOptions": {
9
+ "i18n": {
10
+ "localized": true
11
+ }
12
+ },
13
+ "kind": "collectionType",
14
+ "collectionName": "page_types",
15
+ "attributes": {
16
+ "uid": {
17
+ "type": "string",
18
+ "required": true
19
+ },
20
+ "title": {
21
+ "type": "string",
22
+ "pluginOptions": {
23
+ "i18n": {
24
+ "localized": true
25
+ }
26
+ }
27
+ },
28
+ "modules": {
29
+ "type": "dynamiczone",
30
+ "components": [],
31
+ "pluginOptions": {
32
+ "i18n": {
33
+ "localized": true
34
+ }
35
+ }
36
+ },
37
+ "template": {
38
+ "type": "relation",
39
+ "relation": "oneToOne",
40
+ "target": "api::template.template"
41
+ }
42
+ }
43
+ }
@@ -1,38 +1,38 @@
1
- {
2
- "draftAndPublish": false,
3
- "displayName": "Pagina Types",
4
- "singularName": "page-type",
5
- "pluralName": "page-types",
6
- "description": "",
7
- "plugin": "page-builder",
8
- "pluginOptions": {
9
- "i18n": {
10
- "localized": true
11
- }
12
- },
13
- "kind": "collectionType",
14
- "collectionName": "page_types",
15
- "attributes": {
16
- "uid": {
17
- "type": "string",
18
- "required": true
19
- },
20
- "title": {
21
- "type": "string",
22
- "pluginOptions": {
23
- "i18n": {
24
- "localized": true
25
- }
26
- }
27
- },
28
- "modules": {
29
- "type": "dynamiczone",
30
- "components": [],
31
- "pluginOptions": {
32
- "i18n": {
33
- "localized": true
34
- }
35
- }
36
- }
37
- }
38
- }
1
+ {
2
+ "draftAndPublish": false,
3
+ "displayName": "Pagina Types",
4
+ "singularName": "page-type",
5
+ "pluralName": "page-types",
6
+ "description": "",
7
+ "plugin": "page-builder",
8
+ "pluginOptions": {
9
+ "i18n": {
10
+ "localized": true
11
+ }
12
+ },
13
+ "kind": "collectionType",
14
+ "collectionName": "page_types",
15
+ "attributes": {
16
+ "uid": {
17
+ "type": "string",
18
+ "required": true
19
+ },
20
+ "title": {
21
+ "type": "string",
22
+ "pluginOptions": {
23
+ "i18n": {
24
+ "localized": true
25
+ }
26
+ }
27
+ },
28
+ "modules": {
29
+ "type": "dynamiczone",
30
+ "components": [],
31
+ "pluginOptions": {
32
+ "i18n": {
33
+ "localized": true
34
+ }
35
+ }
36
+ }
37
+ }
38
+ }