@akemona-org/strapi-plugin-content-type-builder 3.7.0

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 (223) hide show
  1. package/LICENSE +22 -0
  2. package/README.md +19 -0
  3. package/admin/src/InjectedComponents/ContentManager/EditSettingViewButton.js +76 -0
  4. package/admin/src/InjectedComponents/ContentManager/EditViewLink.js +44 -0
  5. package/admin/src/assets/images/logo.svg +1 -0
  6. package/admin/src/components/AllowedTypesSelect/MenuList.js +115 -0
  7. package/admin/src/components/AllowedTypesSelect/Text.js +26 -0
  8. package/admin/src/components/AllowedTypesSelect/index.js +55 -0
  9. package/admin/src/components/AttributeOption/Button.js +50 -0
  10. package/admin/src/components/AttributeOption/Card.js +26 -0
  11. package/admin/src/components/AttributeOption/index.js +127 -0
  12. package/admin/src/components/BooleanBox/CT.js +21 -0
  13. package/admin/src/components/BooleanBox/Enumeration.js +10 -0
  14. package/admin/src/components/BooleanBox/EnumerationWrapper.js +14 -0
  15. package/admin/src/components/BooleanBox/Label.js +9 -0
  16. package/admin/src/components/BooleanBox/ST.js +21 -0
  17. package/admin/src/components/BooleanBox/Wrapper.js +75 -0
  18. package/admin/src/components/BooleanBox/icons/CTSelected.js +136 -0
  19. package/admin/src/components/BooleanBox/icons/CTUnselected.js +136 -0
  20. package/admin/src/components/BooleanBox/icons/STSelected.js +80 -0
  21. package/admin/src/components/BooleanBox/icons/STUnselected.js +76 -0
  22. package/admin/src/components/BooleanBox/index.js +103 -0
  23. package/admin/src/components/CheckboxWithDescription/Wrapper.js +12 -0
  24. package/admin/src/components/CheckboxWithDescription/index.js +40 -0
  25. package/admin/src/components/ComponentCard/Close.js +12 -0
  26. package/admin/src/components/ComponentCard/Wrapper.js +84 -0
  27. package/admin/src/components/ComponentCard/index.js +62 -0
  28. package/admin/src/components/ComponentIconPicker/Cell.js +40 -0
  29. package/admin/src/components/ComponentIconPicker/CellRenderer.js +36 -0
  30. package/admin/src/components/ComponentIconPicker/Search.js +12 -0
  31. package/admin/src/components/ComponentIconPicker/SearchWrapper.js +34 -0
  32. package/admin/src/components/ComponentIconPicker/Wrapper.js +60 -0
  33. package/admin/src/components/ComponentIconPicker/index.js +143 -0
  34. package/admin/src/components/ComponentList/index.js +78 -0
  35. package/admin/src/components/ComponentSelect/Category.js +20 -0
  36. package/admin/src/components/ComponentSelect/CategoryName.js +11 -0
  37. package/admin/src/components/ComponentSelect/MenuList.js +110 -0
  38. package/admin/src/components/ComponentSelect/MultipleMenuList.js +271 -0
  39. package/admin/src/components/ComponentSelect/Value.js +83 -0
  40. package/admin/src/components/ComponentSelect/index.js +83 -0
  41. package/admin/src/components/ComponentSelect/utils/HasSomeSubArray.js +5 -0
  42. package/admin/src/components/ComponentSelect/utils/hasSubArray.js +5 -0
  43. package/admin/src/components/CreatableSelect/index.js +58 -0
  44. package/admin/src/components/CustomCheckbox/StyledCustomCheckbox.js +25 -0
  45. package/admin/src/components/CustomCheckbox/index.js +71 -0
  46. package/admin/src/components/CustomLink/P.js +17 -0
  47. package/admin/src/components/CustomLink/StyledCustomLink.js +20 -0
  48. package/admin/src/components/CustomLink/index.js +31 -0
  49. package/admin/src/components/DynamicZoneList/ComponentButton.js +39 -0
  50. package/admin/src/components/DynamicZoneList/index.js +124 -0
  51. package/admin/src/components/HeaderModalNavContainer/index.js +25 -0
  52. package/admin/src/components/HeaderNavLink/Wrapper.js +21 -0
  53. package/admin/src/components/HeaderNavLink/index.js +50 -0
  54. package/admin/src/components/List/List.js +131 -0
  55. package/admin/src/components/List/index.js +295 -0
  56. package/admin/src/components/ListButton/index.js +9 -0
  57. package/admin/src/components/ListHeader/Title.js +19 -0
  58. package/admin/src/components/ListHeader/Wrapper.js +24 -0
  59. package/admin/src/components/ListHeader/index.js +37 -0
  60. package/admin/src/components/ListRow/Wrapper.js +76 -0
  61. package/admin/src/components/ListRow/index.js +334 -0
  62. package/admin/src/components/ModalHeader/ComponentIcon.js +21 -0
  63. package/admin/src/components/ModalHeader/ComponentInfos.js +22 -0
  64. package/admin/src/components/ModalHeader/ComponentInfosWrapper.js +9 -0
  65. package/admin/src/components/ModalHeader/DropdownInfos.js +50 -0
  66. package/admin/src/components/ModalHeader/Icon.js +26 -0
  67. package/admin/src/components/ModalHeader/IconWrapper.js +11 -0
  68. package/admin/src/components/ModalHeader/Item.js +19 -0
  69. package/admin/src/components/ModalHeader/Menu.js +8 -0
  70. package/admin/src/components/ModalHeader/Toggle.js +14 -0
  71. package/admin/src/components/ModalHeader/Wrapper.js +12 -0
  72. package/admin/src/components/ModalHeader/index.js +105 -0
  73. package/admin/src/components/RelationForm/Wrapper.js +9 -0
  74. package/admin/src/components/RelationForm/index.js +66 -0
  75. package/admin/src/components/RelationFormBox/Wrapper.js +34 -0
  76. package/admin/src/components/RelationFormBox/index.js +85 -0
  77. package/admin/src/components/RelationFormNaturePicker/Wrapper.js +53 -0
  78. package/admin/src/components/RelationFormNaturePicker/index.js +112 -0
  79. package/admin/src/components/RelationTargetPicker/Item.js +62 -0
  80. package/admin/src/components/RelationTargetPicker/Wrapper.js +89 -0
  81. package/admin/src/components/RelationTargetPicker/index.js +88 -0
  82. package/admin/src/components/SelectCheckbox/index.js +8 -0
  83. package/admin/src/components/SelectMenuSubUl/ToggleUl.js +23 -0
  84. package/admin/src/components/SelectMenuSubUl/index.js +23 -0
  85. package/admin/src/components/SelectMenuUl/index.js +66 -0
  86. package/admin/src/components/Td/index.js +37 -0
  87. package/admin/src/components/UpperFirst/index.js +14 -0
  88. package/admin/src/components/WrapperSelect/index.js +89 -0
  89. package/admin/src/containers/App/Wrapper.js +14 -0
  90. package/admin/src/containers/App/index.js +39 -0
  91. package/admin/src/containers/App/utils/icons.json +962 -0
  92. package/admin/src/containers/DataManagerProvider/constants.js +15 -0
  93. package/admin/src/containers/DataManagerProvider/index.js +610 -0
  94. package/admin/src/containers/DataManagerProvider/reducer.js +461 -0
  95. package/admin/src/containers/DataManagerProvider/selectors.js +25 -0
  96. package/admin/src/containers/DataManagerProvider/utils/cleanData.js +167 -0
  97. package/admin/src/containers/DataManagerProvider/utils/createDataObject.js +8 -0
  98. package/admin/src/containers/DataManagerProvider/utils/createModifiedDataSchema.js +91 -0
  99. package/admin/src/containers/DataManagerProvider/utils/retrieveComponentsFromSchema.js +55 -0
  100. package/admin/src/containers/DataManagerProvider/utils/retrieveComponentsThatHaveComponents.js +35 -0
  101. package/admin/src/containers/DataManagerProvider/utils/retrieveNestedComponents.js +34 -0
  102. package/admin/src/containers/DataManagerProvider/utils/retrieveSpecificInfoFromComponents.js +12 -0
  103. package/admin/src/containers/FormModal/CustomButton.js +12 -0
  104. package/admin/src/containers/FormModal/attributes/advancedForm.js +269 -0
  105. package/admin/src/containers/FormModal/attributes/attributeOptions.js +99 -0
  106. package/admin/src/containers/FormModal/attributes/baseForm.js +322 -0
  107. package/admin/src/containers/FormModal/attributes/commonBaseForm.js +7 -0
  108. package/admin/src/containers/FormModal/attributes/form.js +9 -0
  109. package/admin/src/containers/FormModal/attributes/index.js +4 -0
  110. package/admin/src/containers/FormModal/attributes/nameField.js +19 -0
  111. package/admin/src/containers/FormModal/attributes/types.js +309 -0
  112. package/admin/src/containers/FormModal/attributes/uiHelpers.js +11 -0
  113. package/admin/src/containers/FormModal/attributes/validation/common.js +151 -0
  114. package/admin/src/containers/FormModal/category/createCategorySchema.js +28 -0
  115. package/admin/src/containers/FormModal/category/form.js +27 -0
  116. package/admin/src/containers/FormModal/category/index.js +3 -0
  117. package/admin/src/containers/FormModal/category/regex.js +3 -0
  118. package/admin/src/containers/FormModal/component/componentField.js +25 -0
  119. package/admin/src/containers/FormModal/component/createComponentSchema.js +49 -0
  120. package/admin/src/containers/FormModal/component/form.js +67 -0
  121. package/admin/src/containers/FormModal/component/index.js +4 -0
  122. package/admin/src/containers/FormModal/constants.js +11 -0
  123. package/admin/src/containers/FormModal/contentType/createContentTypeSchema.js +44 -0
  124. package/admin/src/containers/FormModal/contentType/form.js +116 -0
  125. package/admin/src/containers/FormModal/contentType/index.js +2 -0
  126. package/admin/src/containers/FormModal/dynamicZone/form.js +45 -0
  127. package/admin/src/containers/FormModal/dynamicZone/index.js +2 -0
  128. package/admin/src/containers/FormModal/forms/index.js +164 -0
  129. package/admin/src/containers/FormModal/index.js +1552 -0
  130. package/admin/src/containers/FormModal/reducer.js +293 -0
  131. package/admin/src/containers/FormModal/selectors.js +24 -0
  132. package/admin/src/containers/FormModal/utils/canEditContentType.js +19 -0
  133. package/admin/src/containers/FormModal/utils/createHeadersArray.js +37 -0
  134. package/admin/src/containers/FormModal/utils/createHeadersObjectFromArray.js +27 -0
  135. package/admin/src/containers/FormModal/utils/createUid.js +17 -0
  136. package/admin/src/containers/FormModal/utils/getAttributesToDisplay.js +35 -0
  137. package/admin/src/containers/FormModal/utils/getModalTitleSubHeader.js +25 -0
  138. package/admin/src/containers/FormModal/utils/getNextSearch.js +17 -0
  139. package/admin/src/containers/FormModal/utils/index.js +6 -0
  140. package/admin/src/containers/FormModal/utils/relations.js +9 -0
  141. package/admin/src/containers/FormModal/utils/staticData.js +43 -0
  142. package/admin/src/containers/Initializer/index.js +26 -0
  143. package/admin/src/containers/LeftMenu/Wrapper.js +14 -0
  144. package/admin/src/containers/LeftMenu/index.js +220 -0
  145. package/admin/src/containers/ListView/Wrapper.js +16 -0
  146. package/admin/src/containers/ListView/index.js +322 -0
  147. package/admin/src/containers/NotFoundPage/index.js +20 -0
  148. package/admin/src/containers/RecursivePath/index.js +22 -0
  149. package/admin/src/contexts/DataManagerContext.js +5 -0
  150. package/admin/src/contexts/ListViewContext.js +5 -0
  151. package/admin/src/hooks/useDataManager.js +6 -0
  152. package/admin/src/hooks/useListView.js +6 -0
  153. package/admin/src/icons/Curve.js +26 -0
  154. package/admin/src/icons/ManyToMany.js +98 -0
  155. package/admin/src/icons/ManyToOne.js +64 -0
  156. package/admin/src/icons/ManyWay.js +36 -0
  157. package/admin/src/icons/OneToMany.js +65 -0
  158. package/admin/src/icons/OneToOne.js +47 -0
  159. package/admin/src/icons/OneWay.js +38 -0
  160. package/admin/src/index.js +83 -0
  161. package/admin/src/lifecycles.js +13 -0
  162. package/admin/src/permissions.js +9 -0
  163. package/admin/src/pluginId.js +5 -0
  164. package/admin/src/reducers.js +10 -0
  165. package/admin/src/translations/ar.json +48 -0
  166. package/admin/src/translations/cs.json +151 -0
  167. package/admin/src/translations/de.json +187 -0
  168. package/admin/src/translations/dk.json +181 -0
  169. package/admin/src/translations/en.json +188 -0
  170. package/admin/src/translations/es.json +188 -0
  171. package/admin/src/translations/fr.json +87 -0
  172. package/admin/src/translations/id.json +187 -0
  173. package/admin/src/translations/index.js +51 -0
  174. package/admin/src/translations/it.json +187 -0
  175. package/admin/src/translations/ja.json +50 -0
  176. package/admin/src/translations/ko.json +57 -0
  177. package/admin/src/translations/ms.json +179 -0
  178. package/admin/src/translations/nl.json +171 -0
  179. package/admin/src/translations/pl.json +152 -0
  180. package/admin/src/translations/pt-BR.json +51 -0
  181. package/admin/src/translations/pt.json +51 -0
  182. package/admin/src/translations/ru.json +188 -0
  183. package/admin/src/translations/sk.json +186 -0
  184. package/admin/src/translations/th.json +181 -0
  185. package/admin/src/translations/tr.json +51 -0
  186. package/admin/src/translations/uk.json +180 -0
  187. package/admin/src/translations/zh-Hans.json +188 -0
  188. package/admin/src/translations/zh.json +178 -0
  189. package/admin/src/utils/convertAttrObjToArray.js +7 -0
  190. package/admin/src/utils/formAPI.js +112 -0
  191. package/admin/src/utils/getAttributeDisplayedType.js +31 -0
  192. package/admin/src/utils/getComponents.js +31 -0
  193. package/admin/src/utils/getTrad.js +5 -0
  194. package/admin/src/utils/makeSearch.js +15 -0
  195. package/admin/src/utils/makeUnique.js +3 -0
  196. package/config/functions/bootstrap.js +14 -0
  197. package/config/routes.json +144 -0
  198. package/controllers/Builder.js +7 -0
  199. package/controllers/ComponentCategories.js +43 -0
  200. package/controllers/Components.js +152 -0
  201. package/controllers/Connections.js +9 -0
  202. package/controllers/ContentTypes.js +143 -0
  203. package/controllers/validation/common.js +118 -0
  204. package/controllers/validation/component-category.js +21 -0
  205. package/controllers/validation/component.js +89 -0
  206. package/controllers/validation/content-type.js +161 -0
  207. package/controllers/validation/data-transform.js +32 -0
  208. package/controllers/validation/model-schema.js +91 -0
  209. package/controllers/validation/relations.js +56 -0
  210. package/controllers/validation/types.js +277 -0
  211. package/package.json +63 -0
  212. package/services/Builder.js +7 -0
  213. package/services/ComponentCategories.js +88 -0
  214. package/services/Components.js +103 -0
  215. package/services/ContentTypes.js +263 -0
  216. package/services/api-handler.js +158 -0
  217. package/services/constants.js +59 -0
  218. package/services/schema-builder/component-builder.js +137 -0
  219. package/services/schema-builder/content-type-builder.js +256 -0
  220. package/services/schema-builder/index.js +196 -0
  221. package/services/schema-builder/schema-handler.js +297 -0
  222. package/utils/attributes.js +154 -0
  223. package/utils/helpers.js +31 -0
@@ -0,0 +1,98 @@
1
+ import React from 'react';
2
+ import PropTypes from 'prop-types';
3
+
4
+ const ManyToMany = ({ isSelected, ...rest }) => {
5
+ const stroke = isSelected ? '#1C5DE7' : '#919BAE';
6
+ let rectProps = {
7
+ strokeOpacity: '.1',
8
+ stroke: '#101622',
9
+ };
10
+
11
+ if (isSelected) {
12
+ rectProps = {
13
+ stroke: '#1C5DE7',
14
+ };
15
+ }
16
+
17
+ return (
18
+ <svg
19
+ {...rest}
20
+ width="41"
21
+ height="41"
22
+ xmlns="http://www.w3.org/2000/svg"
23
+ xmlnsXlink="http://www.w3.org/1999/xlink"
24
+ >
25
+ <defs>
26
+ <rect id="a" x="0" y="0" width="41" height="41" rx="2" />
27
+ </defs>
28
+ <g transform="matrix(-1 0 0 1 41 0)" fill="none" fillRule="evenodd">
29
+ <use fill="#FFF" xlinkHref="#a" />
30
+ <rect {...rectProps} x=".5" y=".5" width="40" height="40" rx="2" />
31
+ <path
32
+ stroke={stroke}
33
+ d="M13.5 20.5h13v1h-13zM13.15 18.813l13.481-6.575.439.898-13.482 6.576z"
34
+ />
35
+ <rect stroke={stroke} x="27.5" y="17.5" width="6" height="6" rx="3" />
36
+ <rect stroke={stroke} x="27.5" y="8.5" width="6" height="6" rx="3" />
37
+ <path
38
+ stroke={stroke}
39
+ d="M26.85 28.813L13.37 22.238l-.439.898 13.482 6.576z"
40
+ />
41
+ <rect
42
+ stroke={stroke}
43
+ transform="matrix(-1 0 0 1 61 0)"
44
+ x="27.5"
45
+ y="26.5"
46
+ width="6"
47
+ height="6"
48
+ rx="3"
49
+ />
50
+ <path
51
+ stroke={stroke}
52
+ d="M13.52 12.687l13.482 6.575.439-.898-13.482-6.576z"
53
+ />
54
+ <rect
55
+ stroke={stroke}
56
+ transform="matrix(1 0 0 -1 0 41)"
57
+ x="6.871"
58
+ y="17.5"
59
+ width="6"
60
+ height="6"
61
+ rx="3"
62
+ />
63
+ <rect
64
+ stroke={stroke}
65
+ transform="matrix(1 0 0 -1 0 23)"
66
+ x="6.871"
67
+ y="8.5"
68
+ width="6"
69
+ height="6"
70
+ rx="3"
71
+ />
72
+ <path
73
+ stroke={stroke}
74
+ d="M12.668 29.229l14.335-6.992.439.899-14.335 6.992z"
75
+ />
76
+ <rect
77
+ stroke={stroke}
78
+ transform="matrix(1 0 0 -1 0 59)"
79
+ x="6.871"
80
+ y="26.5"
81
+ width="6"
82
+ height="6"
83
+ rx="3"
84
+ />
85
+ </g>
86
+ </svg>
87
+ );
88
+ };
89
+
90
+ ManyToMany.defaultProps = {
91
+ isSelected: false,
92
+ };
93
+
94
+ ManyToMany.propTypes = {
95
+ isSelected: PropTypes.bool,
96
+ };
97
+
98
+ export default ManyToMany;
@@ -0,0 +1,64 @@
1
+ import React from 'react';
2
+ import PropTypes from 'prop-types';
3
+
4
+ const ManyToOne = ({ isSelected, ...rest }) => {
5
+ const stroke = isSelected ? '#1C5DE7' : '#919BAE';
6
+ let rectProps = {
7
+ strokeOpacity: '.1',
8
+ stroke: '#101622',
9
+ };
10
+
11
+ if (isSelected) {
12
+ rectProps = {
13
+ stroke: '#1C5DE7',
14
+ };
15
+ }
16
+
17
+ return (
18
+ <svg
19
+ {...rest}
20
+ width="41"
21
+ height="41"
22
+ xmlns="http://www.w3.org/2000/svg"
23
+ xmlnsXlink="http://www.w3.org/1999/xlink"
24
+ >
25
+ <defs>
26
+ <rect id="a" x="0" y="0" width="41" height="41" rx="2" />
27
+ </defs>
28
+ <g transform="matrix(-1 0 0 1 41 0)" fill="none" fillRule="evenodd">
29
+ <use fill="#FFF" xlinkHref="#a" />
30
+ <rect {...rectProps} x=".5" y=".5" width="40" height="40" rx="2" />
31
+ <path
32
+ stroke={stroke}
33
+ d="M13.5 21.25h13v1h-13zM12.225 19.642l14.83-7.233.439.899-14.83 7.233z"
34
+ />
35
+ <rect stroke={stroke} x="6.5" y="18.5" width="6" height="6" rx="3" />
36
+ <rect stroke={stroke} x="27.5" y="18.5" width="6" height="6" rx="3" />
37
+ <rect stroke={stroke} x="27.5" y="8.5" width="6" height="6" rx="3" />
38
+ <path
39
+ stroke={stroke}
40
+ d="M27.275 30.142l-14.83-7.233-.439.899 14.83 7.233z"
41
+ />
42
+ <rect
43
+ stroke={stroke}
44
+ transform="matrix(-1 0 0 1 61 0)"
45
+ x="27.5"
46
+ y="28.5"
47
+ width="6"
48
+ height="6"
49
+ rx="3"
50
+ />
51
+ </g>
52
+ </svg>
53
+ );
54
+ };
55
+
56
+ ManyToOne.defaultProps = {
57
+ isSelected: false,
58
+ };
59
+
60
+ ManyToOne.propTypes = {
61
+ isSelected: PropTypes.bool,
62
+ };
63
+
64
+ export default ManyToOne;
@@ -0,0 +1,36 @@
1
+ import React from 'react';
2
+ import PropTypes from 'prop-types';
3
+
4
+ const ManyWay = ({ isSelected, ...rest }) => {
5
+ const rectStroke = isSelected ? '#1C5DE7' : '#E3E9F3';
6
+ const stroke = isSelected ? '#1C5DE7' : '#ABB3C2';
7
+ const otherStroke = isSelected ? '#1C5DE7' : '#ABB3C4';
8
+
9
+ return (
10
+ <svg {...rest} width="41" height="41" xmlns="http://www.w3.org/2000/svg">
11
+ <g fill="none" fillRule="evenodd">
12
+ <rect width="41" height="41" rx="2" fill="#FFF" />
13
+ <rect stroke={rectStroke} x=".5" y=".5" width="40" height="40" rx="2" />
14
+ <g transform="translate(7.5 6)">
15
+ <path stroke={stroke} d="M6.5 15.25h14v1h-14z" />
16
+ <rect stroke={stroke} y="12.5" width="6" height="6" rx="3" />
17
+ <path stroke={otherStroke} d="M26 15.5l-5 3v-6z" />
18
+ <path stroke={stroke} d="M5.965 17.283l12.124 7-.5.867-12.124-7z" />
19
+ <path stroke={otherStroke} d="M22.727 27.25l-5.83.098 3-5.196z" />
20
+ <path stroke={stroke} d="M5.965 13.717l12.124-7-.5-.867-12.124 7z" />
21
+ <path stroke={otherStroke} d="M22.727 3.75l-5.83-.098 3 5.196z" />
22
+ </g>
23
+ </g>
24
+ </svg>
25
+ );
26
+ };
27
+
28
+ ManyWay.defaultProps = {
29
+ isSelected: false,
30
+ };
31
+
32
+ ManyWay.propTypes = {
33
+ isSelected: PropTypes.bool,
34
+ };
35
+
36
+ export default ManyWay;
@@ -0,0 +1,65 @@
1
+ import React from 'react';
2
+ import PropTypes from 'prop-types';
3
+
4
+ const OneToMany = ({ isSelected, ...rest }) => {
5
+ const stroke = isSelected ? '#1C5DE7' : '#919BAE';
6
+ let rectProps = {
7
+ strokeOpacity: '.1',
8
+ stroke: '#1C5DE7',
9
+ };
10
+
11
+ if (isSelected) {
12
+ rectProps = {
13
+ stroke: '#1C5DE7',
14
+ };
15
+ }
16
+
17
+ return (
18
+ <svg
19
+ {...rest}
20
+ width="41"
21
+ height="41"
22
+ xmlns="http://www.w3.org/2000/svg"
23
+ xmlnsXlink="http://www.w3.org/1999/xlink"
24
+ >
25
+ <defs>
26
+ <rect id="a" x="0" y="0" width="41" height="41" rx="2" />
27
+ </defs>
28
+ <g fill="none" fillRule="evenodd">
29
+ <use fill="#FFF" xlinkHref="#a" />
30
+ <rect {...rectProps} x=".5" y=".5" width="40" height="40" rx="2" />
31
+ <path fill={stroke} d="M13 20.75h14v2H13z" />
32
+ <path
33
+ fill={stroke}
34
+ d="M11.447 19.437l15.73-7.672.876 1.798-15.729 7.672z"
35
+ />
36
+ <rect stroke={stroke} x="6.5" y="18.5" width="6" height="6" rx="3" />
37
+ <rect stroke={stroke} x="27.5" y="18.5" width="6" height="6" rx="3" />
38
+ <rect stroke={stroke} x="27.5" y="8.5" width="6" height="6" rx="3" />
39
+ <path
40
+ fill={stroke}
41
+ d="M27.943 29.912L12.214 22.24l-.657 1.348 15.729 7.672z"
42
+ />
43
+ <rect
44
+ stroke={stroke}
45
+ transform="matrix(-1 0 0 1 61 0)"
46
+ x="27.5"
47
+ y="28.5"
48
+ width="6"
49
+ height="6"
50
+ rx="3"
51
+ />
52
+ </g>
53
+ </svg>
54
+ );
55
+ };
56
+
57
+ OneToMany.defaultProps = {
58
+ isSelected: false,
59
+ };
60
+
61
+ OneToMany.propTypes = {
62
+ isSelected: PropTypes.bool,
63
+ };
64
+
65
+ export default OneToMany;
@@ -0,0 +1,47 @@
1
+ import React from 'react';
2
+ import PropTypes from 'prop-types';
3
+
4
+ const OneToOne = ({ isSelected, ...rest }) => {
5
+ const stroke = isSelected ? '#1C5DE7' : '#919BAE';
6
+ let rectProps = {
7
+ strokeOpacity: '.1',
8
+ stroke: '#101622',
9
+ };
10
+
11
+ if (isSelected) {
12
+ rectProps = {
13
+ stroke: '#1C5DE7',
14
+ };
15
+ }
16
+
17
+ return (
18
+ <svg
19
+ {...rest}
20
+ width="41"
21
+ height="41"
22
+ xmlns="http://www.w3.org/2000/svg"
23
+ xmlnsXlink="http://www.w3.org/1999/xlink"
24
+ >
25
+ <defs>
26
+ <rect id="a" x="0" y="0" width="41" height="41" rx="2" />
27
+ </defs>
28
+ <g fill="none" fillRule="evenodd">
29
+ <use fill="#FFF" xlinkHref="#a" />
30
+ <rect {...rectProps} x=".5" y=".5" width="40" height="40" rx="2" />
31
+ <path stroke={stroke} d="M14 21.25h14v1H14z" />
32
+ <rect stroke={stroke} x="7.5" y="18.5" width="6" height="6" rx="3" />
33
+ <rect stroke={stroke} x="28.5" y="18.5" width="6" height="6" rx="3" />
34
+ </g>
35
+ </svg>
36
+ );
37
+ };
38
+
39
+ OneToOne.defaultProps = {
40
+ isSelected: false,
41
+ };
42
+
43
+ OneToOne.propTypes = {
44
+ isSelected: PropTypes.bool,
45
+ };
46
+
47
+ export default OneToOne;
@@ -0,0 +1,38 @@
1
+ import React from 'react';
2
+ import PropTypes from 'prop-types';
3
+
4
+ const OneWay = ({ isSelected, ...rest }) => {
5
+ const stroke = isSelected ? '#1C5DE7' : '#919BAE';
6
+ let rectProps = {
7
+ strokeOpacity: '.1',
8
+ stroke: '#101622',
9
+ };
10
+
11
+ if (isSelected) {
12
+ rectProps = {
13
+ stroke: '#1C5DE7',
14
+ };
15
+ }
16
+
17
+ return (
18
+ <svg {...rest} width="41" height="41" xmlns="http://www.w3.org/2000/svg">
19
+ <g fill="none" fillRule="evenodd">
20
+ <rect width="41" height="41" rx="2" fill="#FFF" />
21
+ <rect {...rectProps} x=".5" y=".5" width="40" height="40" rx="2" />
22
+ <path stroke={stroke} d="M14 21.25h14v1H14z" />
23
+ <rect stroke={stroke} x="7.5" y="18.5" width="6" height="6" rx="3" />
24
+ <path stroke={stroke} d="M33.5 21.5l-5 3v-6z" />
25
+ </g>
26
+ </svg>
27
+ );
28
+ };
29
+
30
+ OneWay.defaultProps = {
31
+ isSelected: false,
32
+ };
33
+
34
+ OneWay.propTypes = {
35
+ isSelected: PropTypes.bool,
36
+ };
37
+
38
+ export default OneWay;
@@ -0,0 +1,83 @@
1
+ // NOTE TO PLUGINS DEVELOPERS:
2
+ // If you modify this file by adding new options to the plugin entry point
3
+ // Here's the file: strapi/docs/3.0.0-beta.x/plugin-development/frontend-field-api.md
4
+ // Here's the file: strapi/docs/3.0.0-beta.x/guides/registering-a-field-in-admin.md
5
+ // Also the strapi-generate-plugins/files/admin/src/index.js needs to be updated
6
+ // IF THE DOC IS NOT UPDATED THE PULL REQUEST WILL NOT BE MERGED
7
+
8
+ import pluginPkg from '../../package.json';
9
+ import pluginLogo from './assets/images/logo.svg';
10
+ import App from './containers/App';
11
+ import Initializer from './containers/Initializer';
12
+ import Link from './InjectedComponents/ContentManager/EditViewLink';
13
+ import Button from './InjectedComponents/ContentManager/EditSettingViewButton';
14
+ import lifecycles from './lifecycles';
15
+ import trads from './translations';
16
+ import pluginPermissions from './permissions';
17
+ import pluginId from './pluginId';
18
+ import reducers from './reducers';
19
+ import formsAPI from './utils/formAPI';
20
+
21
+ export default strapi => {
22
+ const pluginDescription = pluginPkg.strapi.description || pluginPkg.description;
23
+ const icon = pluginPkg.strapi.icon;
24
+ const name = pluginPkg.strapi.name;
25
+
26
+ const plugin = {
27
+ blockerComponent: null,
28
+ blockerComponentProps: {},
29
+ description: pluginDescription,
30
+ icon,
31
+ id: pluginId,
32
+ initializer: Initializer,
33
+ injectedComponents: [
34
+ {
35
+ plugin: 'content-manager.editView',
36
+ area: 'right.links',
37
+ component: Link,
38
+ key: 'content-type-builder.link',
39
+ props: {
40
+ message: {
41
+ id: 'content-manager.containers.Edit.Link.Fields',
42
+ },
43
+ icon: 'fa-cog',
44
+ },
45
+ },
46
+ {
47
+ plugin: 'content-manager.editSettingsView',
48
+ area: 'left.links',
49
+ component: Button,
50
+ key: 'content-type-builder.form',
51
+ },
52
+ ],
53
+ isRequired: pluginPkg.strapi.required || false,
54
+ layout: null,
55
+ lifecycles,
56
+ mainComponent: App,
57
+ name,
58
+ pluginLogo,
59
+ preventComponentRendering: false,
60
+ reducers,
61
+ trads,
62
+ menu: {
63
+ pluginsSectionLinks: [
64
+ {
65
+ destination: `/plugins/${pluginId}`,
66
+ icon,
67
+ label: {
68
+ id: `${pluginId}.plugin.name`,
69
+ defaultMessage: 'Content-Types Builder',
70
+ },
71
+ name,
72
+ permissions: pluginPermissions.main,
73
+ },
74
+ ],
75
+ },
76
+ // Internal APIs exposed by the CTB for the other plugins to use
77
+ apis: {
78
+ forms: formsAPI,
79
+ },
80
+ };
81
+
82
+ return strapi.registerPlugin(plugin);
83
+ };
@@ -0,0 +1,13 @@
1
+ /*
2
+ *
3
+ * SET THE HOOKS TO ENABLE THE MAGIC OF STRAPI.
4
+ * -------------------------------------------
5
+ *
6
+ * Secure, customise and enhance your project by setting
7
+ * the hooks via this file.
8
+ *
9
+ */
10
+
11
+ function lifecycles() {}
12
+
13
+ export default lifecycles;
@@ -0,0 +1,9 @@
1
+ const pluginPermissions = {
2
+ // This permission regards the main component (App) and is used to tell
3
+ // If the plugin link should be displayed in the menu
4
+ // And also if the plugin is accessible. This use case is found when a user types the url of the
5
+ // plugin directly in the browser
6
+ main: [{ action: 'plugins::content-type-builder.read', subject: null }],
7
+ };
8
+
9
+ export default pluginPermissions;
@@ -0,0 +1,5 @@
1
+ import pluginPkg from '../../package.json';
2
+
3
+ const pluginId = pluginPkg.name.replace(/^strapi-plugin-/i, '');
4
+
5
+ export default pluginId;
@@ -0,0 +1,10 @@
1
+ import formModalReducer from './containers/FormModal/reducer';
2
+ import dataManagerProvider from './containers/DataManagerProvider/reducer';
3
+ import pluginId from './pluginId';
4
+
5
+ const reducers = {
6
+ [`${pluginId}_formModal`]: formModalReducer,
7
+ [`${pluginId}_dataManagerProvider`]: dataManagerProvider,
8
+ };
9
+
10
+ export default reducers;
@@ -0,0 +1,48 @@
1
+ {
2
+ "attribute.boolean": "منطقي",
3
+ "attribute.date": "تاريخ",
4
+ "attribute.email": "بريد الإكتروني",
5
+ "attribute.enumeration": "تعداد",
6
+ "attribute.json": "JSON",
7
+ "attribute.media": "وسائط",
8
+ "attribute.password": "كلمة سر",
9
+ "attribute.relation": "علاقة",
10
+ "attribute.text": "نص",
11
+ "form.attribute.item.customColumnName": "أسماء الأعمدة المخصصة",
12
+ "form.attribute.item.customColumnName.description": "يفيد ذلك في إعادة تسمية أسماء أعمدة قاعدة البيانات بتنسيق أكثر شمولاً لاستجابات واجهة برمجة التطبيقات ( API )",
13
+ "form.attribute.item.defineRelation.fieldName": "اسم الحقل",
14
+ "form.attribute.item.enumeration.graphql": "تجاوز الاسم لـ GraphQL",
15
+ "form.attribute.item.enumeration.graphql.description": "يسمح لك بتجاوز الاسم الذي تم إنشاؤه افتراضيًا لـ GraphQL",
16
+ "form.attribute.item.enumeration.rules": "Values (one line per value)",
17
+ "form.attribute.item.maximum": "اقصى قيمة",
18
+ "form.attribute.item.maximumLength": "أقصى طول",
19
+ "form.attribute.item.minimum": "أدنى قيمة",
20
+ "form.attribute.item.minimumLength": "أدنى طول",
21
+ "form.attribute.item.number.type": "تنسيق الرقم",
22
+ "form.attribute.item.number.type.decimal": "عدد عشري (مثال: 2.22)",
23
+ "form.attribute.item.number.type.float": "عدد عائم (مثال: 3.33333333)",
24
+ "form.attribute.item.number.type.integer": "عدد صحيح (مثال: 10)",
25
+ "form.attribute.item.requiredField": "الحقل مطلوب",
26
+ "form.attribute.item.requiredField.description": "لن تتمكن من إنشاء إدخال إذا كان هذا الحقل فارغًا",
27
+ "form.attribute.item.settings.name": "الإعدادات",
28
+ "form.attribute.item.uniqueField": "حقل فريد",
29
+ "form.attribute.item.uniqueField.description": "لن تتمكن من إنشاء إدخال إذا كان هناك إدخال حالي بمحتوى متطابق",
30
+ "form.attribute.settings.default": "القيمة الأفتراضية",
31
+ "form.button.cancel": "الغاء",
32
+ "form.button.continue": "استمر",
33
+ "form.button.save": "حفظ",
34
+ "from": "من",
35
+ "modelPage.attribute.relationWith": "علاقة مع",
36
+ "modelPage.contentHeader.emptyDescription.description": "لا يوجد وصف لنوع المحتوى هذا",
37
+ "plugin.description.long": "قم بتجميع هيكل البيانات الخاص بـ API الخاص بك. إنشاء حقول وعلاقات جديدة في دقيقة واحدة فقط. يتم إنشاء الملفات وتحديثها تلقائيًا في مشروعك.",
38
+ "plugin.description.short": "قم بتجميع هيكل البيانات الخاص بـ API الخاص بك.",
39
+ "popUpForm.navContainer.advanced": "إعدادات متقدمة",
40
+ "popUpForm.navContainer.base": "إعدادات القاعدة",
41
+ "popUpWarning.bodyMessage.contentType.delete": "هل أنت متأكد من أنك تريد حذف نوع المحتوى هذا؟",
42
+ "relation.attributeName.placeholder": "مثال: المؤلف, الفئة, الوسم",
43
+ "relation.manyToMany": "يملك وينتم للكثير",
44
+ "relation.manyToOne": "يملك الكثير",
45
+ "relation.oneToMany": "ينتمي للكثير",
46
+ "relation.oneToOne": "يتشارك بواحد",
47
+ "relation.oneWay": "يمتلك واحد"
48
+ }