strapi-plugin-navigation 1.1.1 → 2.0.0-beta.3

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 (129) hide show
  1. package/README.md +36 -15
  2. package/admin/src/components/EmptyView/index.js +7 -16
  3. package/admin/src/components/Item/ItemCardBadge/index.js +8 -0
  4. package/admin/src/components/Item/ItemCardHeader/Wrapper.js +21 -0
  5. package/admin/src/components/Item/ItemCardHeader/index.js +59 -0
  6. package/admin/src/components/Item/Wrapper.js +39 -0
  7. package/admin/src/components/Item/index.js +76 -124
  8. package/admin/src/components/NavigationItemList/Wrapper.js +22 -0
  9. package/admin/src/components/NavigationItemList/index.js +54 -0
  10. package/admin/src/components/PluginIcon/index.js +6 -0
  11. package/admin/src/index.js +49 -45
  12. package/admin/src/pages/App/index.js +31 -0
  13. package/admin/src/{containers → pages}/DataManagerProvider/actions.js +0 -0
  14. package/admin/src/{containers → pages}/DataManagerProvider/index.js +77 -84
  15. package/admin/src/{containers → pages}/DataManagerProvider/init.js +0 -0
  16. package/admin/src/pages/DataManagerProvider/reducer.js +125 -0
  17. package/admin/src/pages/View/components/NavigationContentHeader/index.js +18 -0
  18. package/admin/src/pages/View/components/NavigationHeader/index.js +60 -0
  19. package/admin/src/pages/View/components/NavigationItemForm/index.js +403 -0
  20. package/admin/src/{containers → pages}/View/components/NavigationItemForm/utils/form.js +2 -2
  21. package/admin/src/pages/View/components/NavigationItemPopup/NavigationItemPopupFooter.js +40 -0
  22. package/admin/src/pages/View/components/NavigationItemPopup/NavigationItemPopupHeader.js +20 -0
  23. package/admin/src/{containers → pages}/View/components/NavigationItemPopup/index.js +16 -16
  24. package/admin/src/pages/View/index.js +209 -0
  25. package/admin/src/{containers → pages}/View/utils/enums.js +0 -0
  26. package/admin/src/{containers → pages}/View/utils/form.js +1 -1
  27. package/admin/src/{containers → pages}/View/utils/index.js +0 -0
  28. package/admin/src/{containers → pages}/View/utils/parsers.js +13 -12
  29. package/admin/src/pluginId.js +3 -2
  30. package/admin/src/translations/en.json +47 -38
  31. package/admin/src/translations/fr.json +7 -1
  32. package/admin/src/utils/getTrad.js +2 -2
  33. package/package.json +14 -6
  34. package/server/bootstrap.js +41 -0
  35. package/server/config.js +8 -0
  36. package/server/content-types/audience/index.js +9 -0
  37. package/{models/audience.js → server/content-types/audience/lifecycle.js} +0 -0
  38. package/{models/audience.settings.json → server/content-types/audience/schema.json} +4 -2
  39. package/server/content-types/index.js +13 -0
  40. package/server/content-types/navigation/index.js +9 -0
  41. package/{models/navigation.js → server/content-types/navigation/lifecycle.js} +0 -0
  42. package/server/content-types/navigation/schema.js +45 -0
  43. package/server/content-types/navigation-item/index.js +9 -0
  44. package/{models/navigationItem.js → server/content-types/navigation-item/lifecycle.js} +0 -0
  45. package/{models/navigationItem.settings.json → server/content-types/navigation-item/schema.json} +16 -12
  46. package/server/content-types/navigations-items-related/index.js +9 -0
  47. package/{models/navigations_items_related.js → server/content-types/navigations-items-related/lifecycle.js} +0 -0
  48. package/{models/navigations_items_related.settings.json → server/content-types/navigations-items-related/schema.json} +4 -2
  49. package/server/controllers/index.js +7 -0
  50. package/{controllers → server/controllers}/navigation.js +7 -39
  51. package/server/routes/admin.js +38 -0
  52. package/server/routes/index.js +3 -0
  53. package/{services → server/services}/__tests__/navigation.test.js +0 -0
  54. package/server/services/index.js +7 -0
  55. package/server/services/navigation.js +463 -0
  56. package/{services → server/services}/utils/constant.js +3 -1
  57. package/server/services/utils/functions.js +103 -0
  58. package/strapi-admin.js +1 -0
  59. package/strapi-server.js +18 -0
  60. package/__mocks__/helpers/another-plugin/blog-post.settings.json +0 -31
  61. package/__mocks__/helpers/another-plugin/pages.settings.json +0 -28
  62. package/__mocks__/helpers/blog-post.settings.json +0 -31
  63. package/__mocks__/helpers/home-page.settings.json +0 -4
  64. package/__mocks__/helpers/my-homepage.settings.json +0 -27
  65. package/__mocks__/helpers/pages.settings.json +0 -27
  66. package/__mocks__/helpers/strapi.js +0 -101
  67. package/admin/src/assets/images/icon-cross-blue.svg +0 -1
  68. package/admin/src/assets/images/icon_remove.svg +0 -19
  69. package/admin/src/components/Container/index.js +0 -7
  70. package/admin/src/components/Input/index.js +0 -41
  71. package/admin/src/components/Item/CardItem.js +0 -46
  72. package/admin/src/components/Item/CardItemLevelAdd.js +0 -41
  73. package/admin/src/components/Item/CardItemLevelWrapper.js +0 -27
  74. package/admin/src/components/Item/CardItemPath.js +0 -9
  75. package/admin/src/components/Item/CardItemRestore.js +0 -19
  76. package/admin/src/components/Item/CardItemTitle.js +0 -5
  77. package/admin/src/components/Item/CardWrapper.js +0 -78
  78. package/admin/src/components/ItemFooter/CardItemError.js +0 -11
  79. package/admin/src/components/ItemFooter/CardItemRelation.js +0 -18
  80. package/admin/src/components/ItemFooter/CardItemRelationStatus.js +0 -17
  81. package/admin/src/components/ItemFooter/CardItemType.js +0 -18
  82. package/admin/src/components/ItemFooter/Wrapper.js +0 -26
  83. package/admin/src/components/ItemFooter/index.js +0 -66
  84. package/admin/src/components/ItemOrdering/CardOrderingButton.js +0 -24
  85. package/admin/src/components/ItemOrdering/Wrapper.js +0 -24
  86. package/admin/src/components/ItemOrdering/index.js +0 -36
  87. package/admin/src/components/List/Container.js +0 -34
  88. package/admin/src/components/List/ListLevelRoot.js +0 -18
  89. package/admin/src/components/List/index.js +0 -81
  90. package/admin/src/components/Option/OptionButton.js +0 -18
  91. package/admin/src/components/Option/OptionSet.js +0 -14
  92. package/admin/src/components/Option/Wrapper.js +0 -15
  93. package/admin/src/components/Option/index.js +0 -47
  94. package/admin/src/components/Search/index.js +0 -86
  95. package/admin/src/components/Select/ClearIndicator.js +0 -15
  96. package/admin/src/components/Select/DropdownIndicator.js +0 -39
  97. package/admin/src/components/Select/ErrorMessage.js +0 -10
  98. package/admin/src/components/Select/IndicatorSeparator.js +0 -3
  99. package/admin/src/components/Select/MultiValueContainer.js +0 -43
  100. package/admin/src/components/Select/StyledOption.js +0 -11
  101. package/admin/src/components/Select/index.js +0 -68
  102. package/admin/src/components/Select/utils/styles.js +0 -92
  103. package/admin/src/containers/App/Wrapper.js +0 -14
  104. package/admin/src/containers/App/index.js +0 -34
  105. package/admin/src/containers/DataManagerProvider/reducer.js +0 -136
  106. package/admin/src/containers/DetailsView/Wrapper.js +0 -21
  107. package/admin/src/containers/DetailsView/index.js +0 -111
  108. package/admin/src/containers/Initializer/index.js +0 -26
  109. package/admin/src/containers/ListView/Footer.js +0 -56
  110. package/admin/src/containers/ListView/components.js +0 -138
  111. package/admin/src/containers/ListView/index.js +0 -54
  112. package/admin/src/containers/View/FadedWrapper.js +0 -51
  113. package/admin/src/containers/View/HeaderForm.js +0 -9
  114. package/admin/src/containers/View/HeaderFormCell.js +0 -25
  115. package/admin/src/containers/View/Wrapper.js +0 -17
  116. package/admin/src/containers/View/components/NavigationItemForm/ModalFooter.js +0 -45
  117. package/admin/src/containers/View/components/NavigationItemForm/index.js +0 -427
  118. package/admin/src/containers/View/components/NavigationItemPopup/MediumPopup.js +0 -6
  119. package/admin/src/containers/View/index.js +0 -240
  120. package/admin/src/lifecycles.js +0 -3
  121. package/admin/src/permissions.js +0 -14
  122. package/config/functions/bootstrap.js +0 -138
  123. package/config/routes.json +0 -60
  124. package/config/schema.graphql.js +0 -204
  125. package/examples/audit-log-integrations.js.md +0 -38
  126. package/models/navigation.settings.json +0 -43
  127. package/public/assets/preview.png +0 -0
  128. package/services/navigation.js +0 -730
  129. package/services/utils/functions.js +0 -186
@@ -1,10 +1,12 @@
1
1
  module.exports = {
2
2
  TEMPLATE_DEFAULT: 'Generic',
3
+
3
4
  KIND_TYPES: {
4
5
  SINGLE: 'singleType',
5
6
  COLLECTION: 'collectionType'
6
7
  },
8
+
7
9
  MODEL_TYPES: {
8
10
  CONTENT_TYPE: 'contentType'
9
- },
11
+ }
10
12
  };
@@ -0,0 +1,103 @@
1
+ const {
2
+ last,
3
+ isObject,
4
+ isEmpty,
5
+ } = require('lodash');
6
+
7
+ const { type: itemType } = require('../../content-types/navigation-item');
8
+ const { NavigationError } = require('../../../utils/NavigationError');
9
+ const { TEMPLATE_DEFAULT } = require('./constant');
10
+
11
+ module.exports = ({ strapi }) => {
12
+ return {
13
+ singularize(value = '') {
14
+ return last(value) === 's' ? value.substr(0, value.length - 1) : value;
15
+ },
16
+
17
+ extractMeta(plugins) {
18
+ const { navigation: plugin } = plugins;
19
+ const { navigation: service } = plugin.services;
20
+ const {
21
+ navigation: masterModel,
22
+ 'navigation-item': itemModel,
23
+ audience: audienceModel,
24
+ 'navigations-items-related': relatedModel,
25
+ } = plugin.contentTypes;
26
+ return {
27
+ masterModel,
28
+ itemModel,
29
+ relatedModel,
30
+ audienceModel,
31
+ service,
32
+ plugin,
33
+ pluginName: 'navigation',
34
+ };
35
+ },
36
+
37
+ buildNestedStructure(entities, id = null, field = 'parent') {
38
+ return entities
39
+ .filter(entity => {
40
+ if (entity[field] == null && id === null) {
41
+ return true;
42
+ }
43
+ let data = entity[field];
44
+ if (data && typeof id === 'string') {
45
+ data = data.toString();
46
+ }
47
+ return (data && data === id) || (isObject(entity[field]) && (entity[field].id === id));
48
+ })
49
+ .map(entity => {
50
+ return ({
51
+ ...entity,
52
+ related: !isEmpty(entity.related) ? [last(entity.related)] : entity.related,
53
+ items: this.buildNestedStructure(entities, entity.id, field),
54
+ });
55
+ });
56
+ },
57
+
58
+ prepareAuditLog(actions) {
59
+ return [
60
+ ...new Set(
61
+ actions
62
+ .filter(_ => !!_)
63
+ .flatMap(({ remove, create, update }) => {
64
+ return [create ? 'CREATE' : '', update ? 'UPDATE' : '', remove ? 'REMOVE' : '']
65
+ .filter(_ => !!_);
66
+ }),
67
+ ),
68
+ ]
69
+ .join('_');
70
+ },
71
+
72
+ sendAuditLog(auditLogInstance, event, data) {
73
+ if (auditLogInstance && auditLogInstance.emit) {
74
+ auditLogInstance.emit(event, data);
75
+ }
76
+ },
77
+
78
+ checkDuplicatePath(parentItem, checkData) {
79
+ return new Promise((resolve, reject) => {
80
+ if (parentItem && parentItem.items) {
81
+ for (let item of checkData) {
82
+ for (let _ of parentItem.items) {
83
+ if (_.path === item.path && (_.id !== item.id) && (item.type === itemType.INTERNAL)) {
84
+ return reject(
85
+ new NavigationError(
86
+ `Duplicate path:${item.path} in parent: ${parentItem.title || 'root'} for ${item.title} and ${_.title} items`,
87
+ {
88
+ parentTitle: parentItem.title,
89
+ parentId: parentItem.id,
90
+ path: item.path,
91
+ errorTitles: [item.title, _.title],
92
+ },
93
+ ),
94
+ );
95
+ }
96
+ }
97
+ }
98
+ }
99
+ return resolve();
100
+ });
101
+ },
102
+ };
103
+ }
@@ -0,0 +1 @@
1
+ module.exports = require('./admin/src').default;
@@ -0,0 +1,18 @@
1
+ const bootstrap = require('./server/bootstrap');
2
+ const services = require('./server/services');
3
+ const routes = require('./server/routes');
4
+ const controllers = require('./server/controllers');
5
+ const contentTypes = require('./server/content-types');
6
+ const config = require('./server/config');
7
+
8
+
9
+ module.exports = () => {
10
+ return {
11
+ bootstrap,
12
+ config,
13
+ routes,
14
+ controllers,
15
+ services,
16
+ contentTypes
17
+ };
18
+ };
@@ -1,31 +0,0 @@
1
- {
2
- "uid": "plugins::another-plugin.blog-post",
3
- "plugin": "another-plugin",
4
- "kind": "collectionType",
5
- "collectionName": "blog_posts",
6
- "info": {
7
- "name": "Blog post"
8
- },
9
- "options": {
10
- "increments": true,
11
- "timestamps": true,
12
- "searchable": true,
13
- "previewable": true
14
- },
15
- "attributes": {
16
- "title": {
17
- "type": "string",
18
- "required": true
19
- },
20
- "altTitle": {
21
- "type": "string"
22
- },
23
- "navigation": {
24
- "model": "navigationitem",
25
- "plugin": "navigation",
26
- "via": "related",
27
- "configurable": false,
28
- "hidden": true
29
- }
30
- }
31
- }
@@ -1,28 +0,0 @@
1
- {
2
- "uid": "plugins::another-plugin.pages",
3
- "plugin": "another-plugin",
4
- "kind": "collectionType",
5
- "collectionName": "pages",
6
- "info": {
7
- "name": "Pages"
8
- },
9
- "options": {
10
- "increments": true,
11
- "timestamps": true,
12
- "searchable": true,
13
- "previewable": true
14
- },
15
- "attributes": {
16
- "title": {
17
- "type": "string",
18
- "required": true
19
- },
20
- "navigation": {
21
- "model": "navigationitem",
22
- "plugin": "navigation",
23
- "via": "related",
24
- "configurable": false,
25
- "hidden": true
26
- }
27
- }
28
- }
@@ -1,31 +0,0 @@
1
- {
2
- "uid": "application::blog-post.blog-post",
3
- "kind": "collectionType",
4
- "collectionName": "blog_posts",
5
- "info": {
6
- "name": "Blog post"
7
- },
8
- "options": {
9
- "increments": true,
10
- "timestamps": true,
11
- "searchable": true,
12
- "previewable": true,
13
- "draftAndPublish": true
14
- },
15
- "attributes": {
16
- "title": {
17
- "type": "string",
18
- "required": true
19
- },
20
- "altTitle": {
21
- "type": "string"
22
- },
23
- "navigation": {
24
- "model": "navigationitem",
25
- "plugin": "navigation",
26
- "via": "related",
27
- "configurable": false,
28
- "hidden": true
29
- }
30
- }
31
- }
@@ -1,4 +0,0 @@
1
- {
2
-
3
- "uid": "application::page-homes.home-page",
4
- "kind": "singleType", "collectionName": "page_homes", "info": { "name": "Page Home" }, "options": { "increments": true, "timestamps": true, "draftAndPublish": true }, "attributes": { "Subtitle": { "type": "string" }, "Title": { "type": "string" }, "Summary": { "type": "text" }, "Image": { "model": "file", "via": "related", "allowedTypes": [ "images" ], "plugin": "upload", "required": false }, "Components": { "type": "dynamiczone", "components": [] }, "navigation": { "model": "navigationitem", "plugin": "navigation", "via": "related", "configurable": false, "hidden": true } } }
@@ -1,27 +0,0 @@
1
- {
2
- "uid": "application::my-homepages.my-homepage",
3
- "kind": "singleType",
4
- "collectionName": "my-homepages",
5
- "info": {
6
- "name": "My Homepage",
7
- "description": ""
8
- },
9
- "options": {
10
- "increments": true,
11
- "timestamps": true,
12
- "draftAndPublish": true,
13
- "templateName": "AwesomeTemplate"
14
- },
15
- "attributes": {
16
- "Welcome": {
17
- "type": "string"
18
- },
19
- "navigation": {
20
- "model": "navigationitem",
21
- "plugin": "navigation",
22
- "via": "related",
23
- "configurable": false,
24
- "hidden": true
25
- }
26
- }
27
- }
@@ -1,27 +0,0 @@
1
- {
2
- "uid": "application::pages.pages",
3
- "kind": "collectionType",
4
- "collectionName": "pages",
5
- "info": {
6
- "name": "Pages"
7
- },
8
- "options": {
9
- "increments": true,
10
- "timestamps": true,
11
- "searchable": true,
12
- "previewable": true
13
- },
14
- "attributes": {
15
- "title": {
16
- "type": "string",
17
- "required": true
18
- },
19
- "navigation": {
20
- "model": "navigationitem",
21
- "plugin": "navigation",
22
- "via": "related",
23
- "configurable": false,
24
- "hidden": true
25
- }
26
- }
27
- }
@@ -1,101 +0,0 @@
1
- const {get} = require('lodash');
2
- function setupStrapi() {
3
- Object.defineProperty(global, 'strapi', {
4
- value: {
5
- query: jest.fn().mockImplementation(() => ({
6
- count: jest.fn().mockImplementation(),
7
- })),
8
- config: {
9
- custom: {
10
- plugins: {
11
- navigation: {
12
- contentTypesNameFields: {
13
- 'blog_posts': ['altTitle'],
14
- },
15
- },
16
- },
17
- },
18
- get(path, defaultValue) {
19
- return get(strapi, path, defaultValue);
20
- },
21
- },
22
- api: {
23
- 'home-page': {
24
- config: {
25
- routes: [
26
- {
27
- method: 'GET',
28
- path: '/custom-api',
29
- handler: 'home-page.find',
30
- },
31
- {
32
- method: 'PUT',
33
- path: '/custom-api',
34
- handler: 'home-page.update',
35
- },
36
- ]
37
- }
38
- }
39
- },
40
- contentTypes: {
41
- 'pages': {
42
- ...require('./pages.settings.json'),
43
- apiName: 'pages',
44
- modelName: 'pages',
45
- associations: [{ model: 'navigationitem' }],
46
- },
47
- 'application::blog-post.blog-post': {
48
- ...require('./blog-post.settings.json'),
49
- apiName: 'blog-posts',
50
- modelName: 'blog-posts',
51
- associations: [{ model: 'navigationitem' }],
52
- },
53
- 'application::my-homepages.my-homepage': {
54
- ...require('./my-homepage.settings.json'),
55
- apiName: 'my-homepage',
56
- modelName: 'my-homepage',
57
- associations: [{ model: 'navigationitem' }],
58
- },
59
- 'application::page-homes.home-page': {
60
- ...require('./home-page.settings.json'),
61
- apiName: 'custom-api',
62
- modelName: 'home-page',
63
- associations: [{ model: 'navigationitem' }],
64
- },
65
- 'plugins::another-plugin.pages': {
66
- ...require('./another-plugin/pages.settings.json'),
67
- modelName: 'plugin-pages',
68
- associations: [{ model: 'navigationitem' }],
69
- },
70
- 'plugins::another-plugin.blog-post': {
71
- ...require('./another-plugin/blog-post.settings.json'),
72
- modelName: 'plugin-blog-posts',
73
- associations: [{ model: 'navigationitem' }],
74
- }
75
- },
76
- plugins: {
77
- navigation: {
78
- services: {
79
- navigation: jest.fn().mockImplementation(),
80
- },
81
- relatedContentTypes: [
82
- 'application::pages.pages',
83
- 'application::blog-post.blog-post',
84
- 'application::my-homepages.my-homepage',
85
- 'application::page-homes.home-page',
86
- 'plugins::another-plugin.pages',
87
- 'plugins::another-plugin.blog-post'
88
- ]
89
- },
90
- anotherPlugin: {
91
- models: {
92
- 'plugin-pages': require('./another-plugin/pages.settings.json'),
93
- 'plugin-blog-post': require('./another-plugin/blog-post.settings.json'),
94
- }
95
- }
96
- },
97
- },
98
- writable: true,
99
- })
100
- }
101
- module.exports = { setupStrapi };
@@ -1 +0,0 @@
1
- <svg width="8" height="8" xmlns="http://www.w3.org/2000/svg"><path d="M7.78 6.72L5.06 4l2.72-2.72a.748.748 0 0 0 0-1.06.748.748 0 0 0-1.06 0L4 2.94 1.28.22a.748.748 0 0 0-1.06 0 .748.748 0 0 0 0 1.06L2.94 4 .22 6.72a.748.748 0 0 0 0 1.06.748.748 0 0 0 1.06 0L4 5.06l2.72 2.72a.748.748 0 0 0 1.06 0 .752.752 0 0 0 0-1.06z" fill="#007EFF" fill-rule="evenodd"/></svg>
@@ -1,19 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <svg width="20px" height="20px" viewBox="0 0 20 20" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
3
- <!-- Generator: Sketch 49.3 (51167) - http://www.bohemiancoding.com/sketch -->
4
- <title>Icon remove</title>
5
- <desc>Created with Sketch.</desc>
6
- <defs></defs>
7
- <g id="Pages" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
8
- <g id="Content-Manager---List-view" transform="translate(-279.000000, -165.000000)">
9
- <g id="Container" transform="translate(234.000000, 0.000000)">
10
- <g id="Add-filters" transform="translate(0.000000, 60.000000)">
11
- <g id="Icon-remove" transform="translate(45.000000, 105.000000)">
12
- <rect id="Rectangle-12" stroke="#E3E9F3" x="0.5" y="0.5" width="19" height="19" rx="9.5"></rect>
13
- <path d="M6,10 L14,10" id="Line-4" stroke="#007EFF" stroke-width="2" stroke-linecap="round"></path>
14
- </g>
15
- </g>
16
- </g>
17
- </g>
18
- </g>
19
- </svg>
@@ -1,7 +0,0 @@
1
- import styled from "styled-components";
2
-
3
- const Container = styled.div`
4
- padding: 0 30px;
5
- `;
6
-
7
- export default Container;
@@ -1,41 +0,0 @@
1
- import React from "react";
2
- import { Inputs } from "@buffetjs/custom";
3
- import PropTypes from "prop-types";
4
- import { useIntl } from "react-intl";
5
-
6
- const Input = ({ error, label, placeholder, ...rest }) => {
7
- const { formatMessage } = useIntl();
8
- const labelMessage = formatMessage({ id: label });
9
- const placeholderMessage = placeholder
10
- ? formatMessage({ id: placeholder })
11
- : "";
12
- let errorMessage = error;
13
-
14
- if (error) {
15
- errorMessage = formatMessage(error);
16
- }
17
-
18
- return (
19
- <Inputs
20
- {...rest}
21
- error={errorMessage}
22
- label={labelMessage}
23
- placeholder={placeholderMessage}
24
- />
25
- );
26
- };
27
-
28
- Input.defaultProps = {
29
- error: null,
30
- placeholder: null,
31
- containerStyle: {},
32
- };
33
-
34
- Input.propTypes = {
35
- error: PropTypes.object,
36
- label: PropTypes.string.isRequired,
37
- placeholder: PropTypes.string,
38
- containerStyle: PropTypes.object,
39
- };
40
-
41
- export default Input;
@@ -1,46 +0,0 @@
1
- import styled from "styled-components";
2
- import { Card } from "@buffetjs/styles";
3
- import { colors } from "strapi-helper-plugin";
4
-
5
- export const CartItemWidth = "25vw";
6
-
7
- const CardItem = styled(Card)`
8
- max-width: ${CartItemWidth};
9
- margin-bottom: ${(props) => (props.hasChildren ? 0 : "2rem")};
10
- padding: 1rem;
11
-
12
- border-bottom: tranparent;
13
-
14
- position: relative;
15
-
16
- transition: all 0.15s ease-in-out;
17
-
18
- ${({hasError, theme})=> hasError && `
19
- border: 1px solid ${theme.main.colors.red};
20
- `}
21
-
22
- ${ props => !props.removed && `
23
- &:hover {
24
- background-color: ${colors.lightGrey};
25
-
26
- padding-left: 1.5rem;
27
-
28
- cursor: pointer;
29
- }
30
- `}
31
-
32
- ${ props => props.removed && `
33
- background-color: ${colors.lightGrey};
34
-
35
- p, small, span {
36
- filter: blur(.25rem);
37
- -webkit-filter: blur(.25rem);
38
- }
39
- `}
40
-
41
- p {
42
- margin-bottom: 0;
43
- }
44
- `;
45
-
46
- export default CardItem;
@@ -1,41 +0,0 @@
1
- import styled from "styled-components";
2
-
3
- import { Button } from "@buffetjs/core";
4
- import { sizes } from "strapi-helper-plugin";
5
- import { CartItemWidth } from "./CardItem";
6
-
7
- export const buttonRadius = 1.6 * sizes.margin;
8
-
9
- const CardItemLevelAdd = styled(Button)`
10
- display: flex;
11
- width: ${2 * buttonRadius}px;
12
- height: ${2 * buttonRadius}px;
13
- margin-left: ${(props) => (props.root ? `${-1 * buttonRadius}px` : "2rem")};
14
- align-items: center;
15
- justify-content: center;
16
-
17
- position: absolute;
18
- top: ${(props) => (props.root ? "-2rem" : `${3.2 * sizes.margin}px`)};
19
- bottom: auto;
20
- left: ${(props) => (props.root ? "2rem" : CartItemWidth)};
21
- z-index: 1;
22
-
23
- border-radius: ${buttonRadius}px;
24
-
25
- ${(props) =>
26
- !props.menuLevel &&
27
- `
28
- background: none;
29
-
30
- &:hover,
31
- &:active {
32
- background: none;
33
- }
34
- `}
35
-
36
- svg {
37
- margin-right: 0;
38
- }
39
- `;
40
-
41
- export default CardItemLevelAdd;
@@ -1,27 +0,0 @@
1
- import styled from "styled-components";
2
-
3
- import { sizes } from "strapi-helper-plugin";
4
- import CardItem from "./CardItem";
5
-
6
- const CardItemLevelWrapper = styled.ul`
7
- padding: 0;
8
- margin: 0;
9
-
10
- list-style: none;
11
-
12
- position: relative;
13
- z-index: 1;
14
-
15
- ${CardItemLevelWrapper} {
16
- padding-left: ${4 * sizes.margin}px;
17
-
18
- position: relative;
19
- z-index: 0;
20
-
21
- ${CardItem} {
22
- margin-top: ${2 * sizes.margin}px;
23
- }
24
- }
25
- `;
26
-
27
- export default CardItemLevelWrapper;
@@ -1,9 +0,0 @@
1
- import styled from "styled-components";
2
-
3
- import { colors } from "strapi-helper-plugin";
4
-
5
- const CardItemPath = styled.small`
6
- color: ${colors.leftMenu.darkGrey};
7
- `;
8
-
9
- export default CardItemPath;
@@ -1,19 +0,0 @@
1
- import styled from "styled-components";
2
-
3
- const CardItemRestore = styled.div`
4
- display: flex;
5
- flex-direction: row;
6
- align-items: center;
7
- justify-content: center;
8
-
9
- position: absolute;
10
- top: 0;
11
- left: 0;
12
- right: 0;
13
- bottom: 0;
14
- z-index: 3;
15
-
16
- transition: all 0.15s ease-in-out;
17
- `;
18
-
19
- export default CardItemRestore;
@@ -1,5 +0,0 @@
1
- import styled from "styled-components";
2
-
3
- const CardItemTitle = styled.p``;
4
-
5
- export default CardItemTitle;