@blaze-cms/plugin-data-ui 0.146.0-translations.8 → 0.147.0-rc-eagle.2

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 (205) hide show
  1. package/lib/components/EntityDataListing/EntityDataListing.js +21 -19
  2. package/lib/components/EntityDataListing/EntityDataListing.js.map +1 -1
  3. package/lib/components/EntityDataListing/index.js +2 -3
  4. package/lib/components/EntityDataListing/index.js.map +1 -1
  5. package/lib/components/EntityManager/Entity/EntitiyNavLinks/EntityNavLinks.js +18 -19
  6. package/lib/components/EntityManager/Entity/EntitiyNavLinks/EntityNavLinks.js.map +1 -1
  7. package/lib/components/EntityManager/Entity/EntitiyNavLinks/index.js +2 -3
  8. package/lib/components/EntityManager/Entity/EntitiyNavLinks/index.js.map +1 -1
  9. package/lib/components/EntityManager/Entity/Entity.js +286 -458
  10. package/lib/components/EntityManager/Entity/Entity.js.map +1 -1
  11. package/lib/components/EntityManager/Entity/EntityHeader/EntityHeader.js +62 -66
  12. package/lib/components/EntityManager/Entity/EntityHeader/EntityHeader.js.map +1 -1
  13. package/lib/components/EntityManager/Entity/EntityHeader/HeaderPreviewButton/HeaderPreviewButton.js +32 -56
  14. package/lib/components/EntityManager/Entity/EntityHeader/HeaderPreviewButton/HeaderPreviewButton.js.map +1 -1
  15. package/lib/components/EntityManager/Entity/EntityHeader/HeaderPreviewButton/index.js +2 -3
  16. package/lib/components/EntityManager/Entity/EntityHeader/HeaderPreviewButton/index.js.map +1 -1
  17. package/lib/components/EntityManager/Entity/EntityHeader/index.js +2 -3
  18. package/lib/components/EntityManager/Entity/EntityHeader/index.js.map +1 -1
  19. package/lib/components/EntityManager/Entity/SideBarRelations/container/CustomSidebarInfoContainer.js +20 -26
  20. package/lib/components/EntityManager/Entity/SideBarRelations/container/CustomSidebarInfoContainer.js.map +1 -1
  21. package/lib/components/EntityManager/Entity/SideBarRelations/helpers/build-dynamic-query.js +20 -17
  22. package/lib/components/EntityManager/Entity/SideBarRelations/helpers/build-dynamic-query.js.map +1 -1
  23. package/lib/components/EntityManager/Entity/SideBarRelations/hooks/useCustomSidebarData.js +34 -32
  24. package/lib/components/EntityManager/Entity/SideBarRelations/hooks/useCustomSidebarData.js.map +1 -1
  25. package/lib/components/EntityManager/Entity/SideBarRelations/index.js +95 -158
  26. package/lib/components/EntityManager/Entity/SideBarRelations/index.js.map +1 -1
  27. package/lib/components/EntityManager/Entity/SideBarRelations/presentational/CustomSidebarInfo.js +23 -30
  28. package/lib/components/EntityManager/Entity/SideBarRelations/presentational/CustomSidebarInfo.js.map +1 -1
  29. package/lib/components/EntityManager/Entity/actions-handlers/create/index.js +2 -3
  30. package/lib/components/EntityManager/Entity/actions-handlers/create/index.js.map +1 -1
  31. package/lib/components/EntityManager/Entity/actions-handlers/create/submit.js +42 -56
  32. package/lib/components/EntityManager/Entity/actions-handlers/create/submit.js.map +1 -1
  33. package/lib/components/EntityManager/Entity/actions-handlers/delete/delete.js +29 -45
  34. package/lib/components/EntityManager/Entity/actions-handlers/delete/delete.js.map +1 -1
  35. package/lib/components/EntityManager/Entity/actions-handlers/delete/index.js +2 -3
  36. package/lib/components/EntityManager/Entity/actions-handlers/delete/index.js.map +1 -1
  37. package/lib/components/EntityManager/Entity/actions-handlers/index.js +7 -8
  38. package/lib/components/EntityManager/Entity/actions-handlers/index.js.map +1 -1
  39. package/lib/components/EntityManager/Entity/actions-handlers/shared/index.js +2 -3
  40. package/lib/components/EntityManager/Entity/actions-handlers/shared/index.js.map +1 -1
  41. package/lib/components/EntityManager/Entity/actions-handlers/shared/publish.js +36 -57
  42. package/lib/components/EntityManager/Entity/actions-handlers/shared/publish.js.map +1 -1
  43. package/lib/components/EntityManager/Entity/actions-handlers/update/index.js +2 -3
  44. package/lib/components/EntityManager/Entity/actions-handlers/update/index.js.map +1 -1
  45. package/lib/components/EntityManager/Entity/actions-handlers/update/submit.js +47 -66
  46. package/lib/components/EntityManager/Entity/actions-handlers/update/submit.js.map +1 -1
  47. package/lib/components/EntityManager/Entity/index.js +2 -3
  48. package/lib/components/EntityManager/Entity/index.js.map +1 -1
  49. package/lib/components/EntityManager/EntityManager.js +91 -166
  50. package/lib/components/EntityManager/EntityManager.js.map +1 -1
  51. package/lib/components/EntityManager/index.js +2 -3
  52. package/lib/components/EntityManager/index.js.map +1 -1
  53. package/lib/components/EntityManager/utils/RecordEditContext/index.js +3 -4
  54. package/lib/components/EntityManager/utils/RecordEditContext/index.js.map +1 -1
  55. package/lib/components/EntityManager/utils/data-mappers.js +34 -46
  56. package/lib/components/EntityManager/utils/data-mappers.js.map +1 -1
  57. package/lib/components/EntityManager/utils/entity.js +35 -80
  58. package/lib/components/EntityManager/utils/entity.js.map +1 -1
  59. package/lib/components/EntityManager/utils/entityAvailableActions.js +51 -110
  60. package/lib/components/EntityManager/utils/entityAvailableActions.js.map +1 -1
  61. package/lib/components/EntityManager/utils/is-form-empty.js +6 -10
  62. package/lib/components/EntityManager/utils/is-form-empty.js.map +1 -1
  63. package/lib/components/EntityManager/utils/query.js +17 -10
  64. package/lib/components/EntityManager/utils/query.js.map +1 -1
  65. package/lib/components/InfoBoxes/InfoBoxTooltip.js +19 -16
  66. package/lib/components/InfoBoxes/InfoBoxTooltip.js.map +1 -1
  67. package/lib/components/InfoBoxes/InfoBoxes.js +19 -19
  68. package/lib/components/InfoBoxes/InfoBoxes.js.map +1 -1
  69. package/lib/components/InfoBoxes/container/InfoBoxContainer.js +26 -38
  70. package/lib/components/InfoBoxes/container/InfoBoxContainer.js.map +1 -1
  71. package/lib/components/InfoBoxes/helpers/build-dynamic-query.js +21 -16
  72. package/lib/components/InfoBoxes/helpers/build-dynamic-query.js.map +1 -1
  73. package/lib/components/InfoBoxes/hooks/useData.js +33 -30
  74. package/lib/components/InfoBoxes/hooks/useData.js.map +1 -1
  75. package/lib/components/InfoBoxes/hooks/useInfoBox.js +10 -10
  76. package/lib/components/InfoBoxes/hooks/useInfoBox.js.map +1 -1
  77. package/lib/components/InfoBoxes/index.js +2 -3
  78. package/lib/components/InfoBoxes/index.js.map +1 -1
  79. package/lib/components/InfoBoxes/presentational/InfoBox.js +27 -34
  80. package/lib/components/InfoBoxes/presentational/InfoBox.js.map +1 -1
  81. package/lib/components/InfoBoxes/presentational/InfoBoxLabel.js +11 -12
  82. package/lib/components/InfoBoxes/presentational/InfoBoxLabel.js.map +1 -1
  83. package/lib/components/InfoBoxes/presentational/InfoBoxValue.js +12 -12
  84. package/lib/components/InfoBoxes/presentational/InfoBoxValue.js.map +1 -1
  85. package/lib/components/ListingTable/ListingTable.js +155 -296
  86. package/lib/components/ListingTable/ListingTable.js.map +1 -1
  87. package/lib/components/ListingTable/ListingTableContent/ListingTableContent.js +53 -58
  88. package/lib/components/ListingTable/ListingTableContent/ListingTableContent.js.map +1 -1
  89. package/lib/components/ListingTable/ListingTableContent/index.js +2 -3
  90. package/lib/components/ListingTable/ListingTableContent/index.js.map +1 -1
  91. package/lib/components/ListingTable/SearchFilter/SearchContainer.js +159 -257
  92. package/lib/components/ListingTable/SearchFilter/SearchContainer.js.map +1 -1
  93. package/lib/components/ListingTable/SearchFilter/SearchFilter.js +25 -36
  94. package/lib/components/ListingTable/SearchFilter/SearchFilter.js.map +1 -1
  95. package/lib/components/ListingTable/SearchFilter/helpers.js +46 -68
  96. package/lib/components/ListingTable/SearchFilter/helpers.js.map +1 -1
  97. package/lib/components/ListingTable/SearchFilter/querys.js +5 -5
  98. package/lib/components/ListingTable/SearchFilter/querys.js.map +1 -1
  99. package/lib/components/ListingTable/TableActions/TableActions.js +27 -31
  100. package/lib/components/ListingTable/TableActions/TableActions.js.map +1 -1
  101. package/lib/components/ListingTable/TableActions/index.js +2 -3
  102. package/lib/components/ListingTable/TableActions/index.js.map +1 -1
  103. package/lib/components/ListingTable/index.js +2 -3
  104. package/lib/components/ListingTable/index.js.map +1 -1
  105. package/lib/components/ListingTable/mappers/populate-rows.js +103 -122
  106. package/lib/components/ListingTable/mappers/populate-rows.js.map +1 -1
  107. package/lib/components/ListingTable/service/index.js +66 -83
  108. package/lib/components/ListingTable/service/index.js.map +1 -1
  109. package/lib/components/Tabs/index.js +26 -42
  110. package/lib/components/Tabs/index.js.map +1 -1
  111. package/lib/components/hooks/useCallbackDebounce.js +5 -9
  112. package/lib/components/hooks/useCallbackDebounce.js.map +1 -1
  113. package/lib/constants.js +30 -31
  114. package/lib/constants.js.map +1 -1
  115. package/lib/icons/ContentIcon.js +17 -20
  116. package/lib/icons/ContentIcon.js.map +1 -1
  117. package/lib/icons/SettingsIcon.js +12 -15
  118. package/lib/icons/SettingsIcon.js.map +1 -1
  119. package/lib/icons/TaxonomyIcon.js +15 -18
  120. package/lib/icons/TaxonomyIcon.js.map +1 -1
  121. package/lib/icons/UsersIcon.js +11 -14
  122. package/lib/icons/UsersIcon.js.map +1 -1
  123. package/lib/icons/index.js +8 -9
  124. package/lib/icons/index.js.map +1 -1
  125. package/lib/index.js +81 -121
  126. package/lib/index.js.map +1 -1
  127. package/lib/utils/add-content-menu-items.js +67 -93
  128. package/lib/utils/add-content-menu-items.js.map +1 -1
  129. package/lib/utils/build-create-entity-mutation.js +12 -9
  130. package/lib/utils/build-create-entity-mutation.js.map +1 -1
  131. package/lib/utils/build-delete-entity-mutation.js +11 -8
  132. package/lib/utils/build-delete-entity-mutation.js.map +1 -1
  133. package/lib/utils/build-listing-query.js +17 -14
  134. package/lib/utils/build-listing-query.js.map +1 -1
  135. package/lib/utils/build-update-data-query.js +15 -9
  136. package/lib/utils/build-update-data-query.js.map +1 -1
  137. package/lib/utils/build-update-publish-unpublish-mutation.js +15 -8
  138. package/lib/utils/build-update-publish-unpublish-mutation.js.map +1 -1
  139. package/lib/utils/get-default-query-params.js +7 -6
  140. package/lib/utils/get-default-query-params.js.map +1 -1
  141. package/lib/utils/hoc/withContext.js +4 -6
  142. package/lib/utils/hoc/withContext.js.map +1 -1
  143. package/lib/utils/hooks/useToggle.js +4 -12
  144. package/lib/utils/hooks/useToggle.js.map +1 -1
  145. package/lib/utils/index.js +2 -3
  146. package/lib/utils/index.js.map +1 -1
  147. package/lib-es/components/EntityManager/Entity/Entity.js +15 -26
  148. package/lib-es/components/EntityManager/Entity/Entity.js.map +1 -1
  149. package/lib-es/components/EntityManager/Entity/EntityHeader/EntityHeader.js.map +1 -1
  150. package/lib-es/components/EntityManager/Entity/EntityHeader/HeaderPreviewButton/HeaderPreviewButton.js.map +1 -1
  151. package/lib-es/components/EntityManager/Entity/SideBarRelations/helpers/build-dynamic-query.js.map +1 -1
  152. package/lib-es/components/EntityManager/Entity/SideBarRelations/hooks/useCustomSidebarData.js.map +1 -1
  153. package/lib-es/components/EntityManager/Entity/SideBarRelations/index.js +6 -3
  154. package/lib-es/components/EntityManager/Entity/SideBarRelations/index.js.map +1 -1
  155. package/lib-es/components/EntityManager/Entity/SideBarRelations/presentational/CustomSidebarInfo.js.map +1 -1
  156. package/lib-es/components/EntityManager/Entity/actions-handlers/create/submit.js.map +1 -1
  157. package/lib-es/components/EntityManager/Entity/actions-handlers/shared/publish.js.map +1 -1
  158. package/lib-es/components/EntityManager/EntityManager.js.map +1 -1
  159. package/lib-es/components/EntityManager/utils/entity.js.map +1 -1
  160. package/lib-es/components/EntityManager/utils/query.js.map +1 -1
  161. package/lib-es/components/InfoBoxes/InfoBoxTooltip.js.map +1 -1
  162. package/lib-es/components/InfoBoxes/container/InfoBoxContainer.js.map +1 -1
  163. package/lib-es/components/InfoBoxes/helpers/build-dynamic-query.js.map +1 -1
  164. package/lib-es/components/InfoBoxes/hooks/useData.js.map +1 -1
  165. package/lib-es/components/InfoBoxes/presentational/InfoBox.js.map +1 -1
  166. package/lib-es/components/InfoBoxes/presentational/InfoBoxLabel.js.map +1 -1
  167. package/lib-es/components/ListingTable/ListingTable.js +2 -2
  168. package/lib-es/components/ListingTable/ListingTable.js.map +1 -1
  169. package/lib-es/components/ListingTable/ListingTableContent/ListingTableContent.js +20 -17
  170. package/lib-es/components/ListingTable/ListingTableContent/ListingTableContent.js.map +1 -1
  171. package/lib-es/components/ListingTable/SearchFilter/SearchContainer.js.map +1 -1
  172. package/lib-es/components/ListingTable/SearchFilter/helpers.js.map +1 -1
  173. package/lib-es/components/ListingTable/SearchFilter/querys.js.map +1 -1
  174. package/lib-es/components/ListingTable/mappers/populate-rows.js.map +1 -1
  175. package/lib-es/components/ListingTable/service/index.js.map +1 -1
  176. package/lib-es/components/Tabs/index.js +6 -7
  177. package/lib-es/components/Tabs/index.js.map +1 -1
  178. package/lib-es/index.js +11 -3
  179. package/lib-es/index.js.map +1 -1
  180. package/lib-es/utils/add-content-menu-items.js.map +1 -1
  181. package/lib-es/utils/build-create-entity-mutation.js.map +1 -1
  182. package/lib-es/utils/build-delete-entity-mutation.js.map +1 -1
  183. package/lib-es/utils/build-listing-query.js.map +1 -1
  184. package/lib-es/utils/build-update-data-query.js.map +1 -1
  185. package/lib-es/utils/build-update-publish-unpublish-mutation.js.map +1 -1
  186. package/lib-es/utils/hoc/withContext.js +1 -1
  187. package/lib-es/utils/hoc/withContext.js.map +1 -1
  188. package/package.json +27 -22
  189. package/src/components/EntityManager/Entity/Entity.js +63 -81
  190. package/src/components/EntityManager/Entity/EntityHeader/EntityHeader.js +1 -2
  191. package/src/components/EntityManager/Entity/SideBarRelations/hooks/useCustomSidebarData.js +9 -7
  192. package/src/components/EntityManager/Entity/SideBarRelations/index.js +64 -59
  193. package/src/components/EntityManager/EntityManager.js +52 -45
  194. package/src/components/InfoBoxes/container/InfoBoxContainer.js +3 -6
  195. package/src/components/InfoBoxes/hooks/useData.js +6 -1
  196. package/src/components/ListingTable/ListingTable.js +13 -21
  197. package/src/components/ListingTable/ListingTableContent/ListingTableContent.js +38 -44
  198. package/src/components/ListingTable/SearchFilter/SearchContainer.js +105 -120
  199. package/src/components/ListingTable/service/index.js +2 -3
  200. package/src/components/Tabs/index.js +17 -21
  201. package/src/index.js +9 -7
  202. package/src/utils/hoc/withContext.js +5 -4
  203. package/CHANGELOG.md +0 -1947
  204. package/babel.config.js +0 -3
  205. package/jest.config.js +0 -5
@@ -1,25 +1,28 @@
1
1
  "use strict";
2
2
 
3
- require("core-js/modules/es.object.define-property.js");
4
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
5
4
  Object.defineProperty(exports, "__esModule", {
6
5
  value: true
7
6
  });
8
- exports["default"] = void 0;
9
- require("core-js/modules/es.array.join.js");
10
- var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
7
+ exports.default = void 0;
11
8
  var _client = require("@apollo/client");
12
9
  var _coreErrors = require("@blaze-cms/core-errors");
13
10
  var _lodash = _interopRequireDefault(require("lodash.upperfirst"));
14
11
  var _adminUiUtils = require("@blaze-cms/admin-ui-utils");
15
- var _templateObject;
16
12
  function buildCreateEntityMutation(entitySchema) {
17
13
  if (!entitySchema || !entitySchema.actions || !entitySchema.actions.create || !entitySchema.properties) {
18
14
  throw new _coreErrors.BlazeError('Create entity query requires create action and properties from entity schema');
19
15
  }
20
- var actionInput = (0, _lodash["default"])("".concat(entitySchema.actions.create, "Input"));
21
- var dataProperties = (0, _adminUiUtils.getDataProperties)(entitySchema);
22
- return (0, _client.gql)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["mutation createEntity($input: ", ") {\n createdEntity: ", "(input: $input){\n result {\n id,\n ", "\n }\n }\n }"])), actionInput, entitySchema.actions.create, dataProperties.join(',\n'));
16
+ const actionInput = (0, _lodash.default)(`${entitySchema.actions.create}Input`);
17
+ const dataProperties = (0, _adminUiUtils.getDataProperties)(entitySchema);
18
+ return (0, _client.gql)`mutation createEntity($input: ${actionInput}) {
19
+ createdEntity: ${entitySchema.actions.create}(input: $input){
20
+ result {
21
+ id,
22
+ ${dataProperties.join(',\n')}
23
+ }
24
+ }
25
+ }`;
23
26
  }
24
- var _default = exports["default"] = buildCreateEntityMutation;
27
+ var _default = exports.default = buildCreateEntityMutation;
25
28
  //# sourceMappingURL=build-create-entity-mutation.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"build-create-entity-mutation.js","names":["_client","require","_coreErrors","_lodash","_interopRequireDefault","_adminUiUtils","_templateObject","buildCreateEntityMutation","entitySchema","actions","create","properties","BlazeError","actionInput","upperfirst","concat","dataProperties","getDataProperties","gql","_taggedTemplateLiteral2","join","_default","exports"],"sources":["../../src/utils/build-create-entity-mutation.js"],"sourcesContent":["import { gql } from '@apollo/client';\nimport { BlazeError } from '@blaze-cms/core-errors';\nimport upperfirst from 'lodash.upperfirst';\nimport { getDataProperties } from '@blaze-cms/admin-ui-utils';\n\nfunction buildCreateEntityMutation(entitySchema) {\n if (\n !entitySchema ||\n !entitySchema.actions ||\n !entitySchema.actions.create ||\n !entitySchema.properties\n ) {\n throw new BlazeError(\n 'Create entity query requires create action and properties from entity schema'\n );\n }\n\n const actionInput = upperfirst(`${entitySchema.actions.create}Input`);\n const dataProperties = getDataProperties(entitySchema);\n\n return gql`mutation createEntity($input: ${actionInput}) {\n createdEntity: ${entitySchema.actions.create}(input: $input){\n result {\n id,\n ${dataProperties.join(',\\n')}\n }\n }\n }`;\n}\n\nexport default buildCreateEntityMutation;\n"],"mappings":";;;;;;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,OAAA,GAAAC,sBAAA,CAAAH,OAAA;AACA,IAAAI,aAAA,GAAAJ,OAAA;AAA8D,IAAAK,eAAA;AAE9D,SAASC,yBAAyBA,CAACC,YAAY,EAAE;EAC/C,IACE,CAACA,YAAY,IACb,CAACA,YAAY,CAACC,OAAO,IACrB,CAACD,YAAY,CAACC,OAAO,CAACC,MAAM,IAC5B,CAACF,YAAY,CAACG,UAAU,EACxB;IACA,MAAM,IAAIC,sBAAU,CAClB,8EACF,CAAC;EACH;EAEA,IAAMC,WAAW,GAAG,IAAAC,kBAAU,KAAAC,MAAA,CAAIP,YAAY,CAACC,OAAO,CAACC,MAAM,UAAO,CAAC;EACrE,IAAMM,cAAc,GAAG,IAAAC,+BAAiB,EAACT,YAAY,CAAC;EAEtD,WAAOU,WAAG,EAAAZ,eAAA,KAAAA,eAAA,OAAAa,uBAAA,0KAAkCN,WAAW,EACpCL,YAAY,CAACC,OAAO,CAACC,MAAM,EAGpCM,cAAc,CAACI,IAAI,CAAC,KAAK,CAAC;AAItC;AAAC,IAAAC,QAAA,GAAAC,OAAA,cAEcf,yBAAyB","ignoreList":[]}
1
+ {"version":3,"file":"build-create-entity-mutation.js","names":["_client","require","_coreErrors","_lodash","_interopRequireDefault","_adminUiUtils","buildCreateEntityMutation","entitySchema","actions","create","properties","BlazeError","actionInput","upperfirst","dataProperties","getDataProperties","gql","join","_default","exports","default"],"sources":["../../src/utils/build-create-entity-mutation.js"],"sourcesContent":["import { gql } from '@apollo/client';\nimport { BlazeError } from '@blaze-cms/core-errors';\nimport upperfirst from 'lodash.upperfirst';\nimport { getDataProperties } from '@blaze-cms/admin-ui-utils';\n\nfunction buildCreateEntityMutation(entitySchema) {\n if (\n !entitySchema ||\n !entitySchema.actions ||\n !entitySchema.actions.create ||\n !entitySchema.properties\n ) {\n throw new BlazeError(\n 'Create entity query requires create action and properties from entity schema'\n );\n }\n\n const actionInput = upperfirst(`${entitySchema.actions.create}Input`);\n const dataProperties = getDataProperties(entitySchema);\n\n return gql`mutation createEntity($input: ${actionInput}) {\n createdEntity: ${entitySchema.actions.create}(input: $input){\n result {\n id,\n ${dataProperties.join(',\\n')}\n }\n }\n }`;\n}\n\nexport default buildCreateEntityMutation;\n"],"mappings":";;;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,OAAA,GAAAC,sBAAA,CAAAH,OAAA;AACA,IAAAI,aAAA,GAAAJ,OAAA;AAEA,SAASK,yBAAyBA,CAACC,YAAY,EAAE;EAC/C,IACE,CAACA,YAAY,IACb,CAACA,YAAY,CAACC,OAAO,IACrB,CAACD,YAAY,CAACC,OAAO,CAACC,MAAM,IAC5B,CAACF,YAAY,CAACG,UAAU,EACxB;IACA,MAAM,IAAIC,sBAAU,CAClB,8EACF,CAAC;EACH;EAEA,MAAMC,WAAW,GAAG,IAAAC,eAAU,EAAC,GAAGN,YAAY,CAACC,OAAO,CAACC,MAAM,OAAO,CAAC;EACrE,MAAMK,cAAc,GAAG,IAAAC,+BAAiB,EAACR,YAAY,CAAC;EAEtD,OAAO,IAAAS,WAAG,mCAAkCJ,WAAW;AACzD,qBAAqBL,YAAY,CAACC,OAAO,CAACC,MAAM;AAChD;AACA;AACA,YAAYK,cAAc,CAACG,IAAI,CAAC,KAAK,CAAC;AACtC;AACA;AACA,IAAI;AACJ;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEcd,yBAAyB","ignoreList":[]}
@@ -1,22 +1,25 @@
1
1
  "use strict";
2
2
 
3
- require("core-js/modules/es.object.define-property.js");
4
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
5
4
  Object.defineProperty(exports, "__esModule", {
6
5
  value: true
7
6
  });
8
- exports["default"] = void 0;
9
- var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
7
+ exports.default = void 0;
10
8
  var _client = require("@apollo/client");
11
9
  var _coreErrors = require("@blaze-cms/core-errors");
12
10
  var _lodash = _interopRequireDefault(require("lodash.upperfirst"));
13
- var _templateObject;
14
11
  function buildDeleteEntity(entitySchema) {
15
- if (!entitySchema || !entitySchema.actions || !entitySchema.actions["delete"]) {
12
+ if (!entitySchema || !entitySchema.actions || !entitySchema.actions.delete) {
16
13
  throw new _coreErrors.BlazeError('Delete query requires delete action from entity schema');
17
14
  }
18
- var actionInput = (0, _lodash["default"])("".concat(entitySchema.actions["delete"], "Input"));
19
- return (0, _client.gql)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["\n mutation deleteEntity($input: ", ") {\n deleteEntity: ", "(input: $input){\n result\n }\n }\n "])), actionInput, entitySchema.actions["delete"]);
15
+ const actionInput = (0, _lodash.default)(`${entitySchema.actions.delete}Input`);
16
+ return (0, _client.gql)`
17
+ mutation deleteEntity($input: ${actionInput}) {
18
+ deleteEntity: ${entitySchema.actions.delete}(input: $input){
19
+ result
20
+ }
21
+ }
22
+ `;
20
23
  }
21
- var _default = exports["default"] = buildDeleteEntity;
24
+ var _default = exports.default = buildDeleteEntity;
22
25
  //# sourceMappingURL=build-delete-entity-mutation.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"build-delete-entity-mutation.js","names":["_client","require","_coreErrors","_lodash","_interopRequireDefault","_templateObject","buildDeleteEntity","entitySchema","actions","BlazeError","actionInput","upperfirst","concat","gql","_taggedTemplateLiteral2","_default","exports"],"sources":["../../src/utils/build-delete-entity-mutation.js"],"sourcesContent":["import { gql } from '@apollo/client';\nimport { BlazeError } from '@blaze-cms/core-errors';\nimport upperfirst from 'lodash.upperfirst';\n\nfunction buildDeleteEntity(entitySchema) {\n if (!entitySchema || !entitySchema.actions || !entitySchema.actions.delete) {\n throw new BlazeError('Delete query requires delete action from entity schema');\n }\n\n const actionInput = upperfirst(`${entitySchema.actions.delete}Input`);\n\n return gql`\n mutation deleteEntity($input: ${actionInput}) {\n deleteEntity: ${entitySchema.actions.delete}(input: $input){\n result\n }\n }\n `;\n}\n\nexport default buildDeleteEntity;\n"],"mappings":";;;;;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,OAAA,GAAAC,sBAAA,CAAAH,OAAA;AAA2C,IAAAI,eAAA;AAE3C,SAASC,iBAAiBA,CAACC,YAAY,EAAE;EACvC,IAAI,CAACA,YAAY,IAAI,CAACA,YAAY,CAACC,OAAO,IAAI,CAACD,YAAY,CAACC,OAAO,UAAO,EAAE;IAC1E,MAAM,IAAIC,sBAAU,CAAC,wDAAwD,CAAC;EAChF;EAEA,IAAMC,WAAW,GAAG,IAAAC,kBAAU,KAAAC,MAAA,CAAIL,YAAY,CAACC,OAAO,UAAO,UAAO,CAAC;EAErE,WAAOK,WAAG,EAAAR,eAAA,KAAAA,eAAA,OAAAS,uBAAA,qIACuBJ,WAAW,EAC1BH,YAAY,CAACC,OAAO,UAAO;AAK/C;AAAC,IAAAO,QAAA,GAAAC,OAAA,cAEcV,iBAAiB","ignoreList":[]}
1
+ {"version":3,"file":"build-delete-entity-mutation.js","names":["_client","require","_coreErrors","_lodash","_interopRequireDefault","buildDeleteEntity","entitySchema","actions","delete","BlazeError","actionInput","upperfirst","gql","_default","exports","default"],"sources":["../../src/utils/build-delete-entity-mutation.js"],"sourcesContent":["import { gql } from '@apollo/client';\nimport { BlazeError } from '@blaze-cms/core-errors';\nimport upperfirst from 'lodash.upperfirst';\n\nfunction buildDeleteEntity(entitySchema) {\n if (!entitySchema || !entitySchema.actions || !entitySchema.actions.delete) {\n throw new BlazeError('Delete query requires delete action from entity schema');\n }\n\n const actionInput = upperfirst(`${entitySchema.actions.delete}Input`);\n\n return gql`\n mutation deleteEntity($input: ${actionInput}) {\n deleteEntity: ${entitySchema.actions.delete}(input: $input){\n result\n }\n }\n `;\n}\n\nexport default buildDeleteEntity;\n"],"mappings":";;;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,OAAA,GAAAC,sBAAA,CAAAH,OAAA;AAEA,SAASI,iBAAiBA,CAACC,YAAY,EAAE;EACvC,IAAI,CAACA,YAAY,IAAI,CAACA,YAAY,CAACC,OAAO,IAAI,CAACD,YAAY,CAACC,OAAO,CAACC,MAAM,EAAE;IAC1E,MAAM,IAAIC,sBAAU,CAAC,wDAAwD,CAAC;EAChF;EAEA,MAAMC,WAAW,GAAG,IAAAC,eAAU,EAAC,GAAGL,YAAY,CAACC,OAAO,CAACC,MAAM,OAAO,CAAC;EAErE,OAAO,IAAAI,WAAG;AACZ,mCAAmCF,WAAW;AAC9C,oBAAoBJ,YAAY,CAACC,OAAO,CAACC,MAAM;AAC/C;AACA;AACA;AACA,GAAG;AACH;AAAC,IAAAK,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEcV,iBAAiB","ignoreList":[]}
@@ -1,22 +1,17 @@
1
1
  "use strict";
2
2
 
3
- require("core-js/modules/es.object.define-property.js");
4
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
5
3
  Object.defineProperty(exports, "__esModule", {
6
4
  value: true
7
5
  });
8
- exports["default"] = void 0;
9
- var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
10
- require("core-js/modules/es.array.join.js");
6
+ exports.default = void 0;
11
7
  var _client = require("@apollo/client");
12
8
  var _coreErrors = require("@blaze-cms/core-errors");
13
9
  var _adminUiUtils = require("@blaze-cms/admin-ui-utils");
14
- var _templateObject;
15
- var buildAdminSearchQuery = function buildAdminSearchQuery(entitySchema, index) {
16
- var _ref = entitySchema || {},
17
- _ref$listingPropertie = _ref.listingProperties,
18
- listingProperties = _ref$listingPropertie === void 0 ? [] : _ref$listingPropertie;
19
- var parsedProperties = "id, ".concat(listingProperties.join(' ') || 'id name');
10
+ const buildAdminSearchQuery = (entitySchema, index) => {
11
+ const {
12
+ listingProperties = []
13
+ } = entitySchema || {};
14
+ const parsedProperties = `id, ${listingProperties.join(' ') || 'id name'}`;
20
15
  return (0, _adminUiUtils.getDynamicQuery)('ADMIN_SEARCH')([entitySchema], parsedProperties, true, index);
21
16
  };
22
17
  function buildListingQuery(entitySchema, index, isSearchQuery) {
@@ -24,8 +19,16 @@ function buildListingQuery(entitySchema, index, isSearchQuery) {
24
19
  throw new _coreErrors.BlazeError('Listing query requires getAll action and listingProperties from entity schema');
25
20
  }
26
21
  if (isSearchQuery) return buildAdminSearchQuery(entitySchema, index);
27
- var sortType = entitySchema.actions.getAll[0].toUpperCase() + entitySchema.actions.getAll.substr(1);
28
- return (0, _client.gql)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["\n query ", "($where: JSON, $limit: Int, $offset:Int, $sort: [", "SortItem]) {\n listingData: ", "(where: $where, limit: $limit, offset:$offset, sort:$sort){\n id,\n ", "\n }\n totalRecords: ", "(where: $where)\n }\n "])), entitySchema.actions.getAll, sortType, entitySchema.actions.getAll, entitySchema.listingProperties.join(',\n'), entitySchema.actions.countAll);
22
+ const sortType = entitySchema.actions.getAll[0].toUpperCase() + entitySchema.actions.getAll.substr(1);
23
+ return (0, _client.gql)`
24
+ query ${entitySchema.actions.getAll}($where: JSON, $limit: Int, $offset:Int, $sort: [${sortType}SortItem]) {
25
+ listingData: ${entitySchema.actions.getAll}(where: $where, limit: $limit, offset:$offset, sort:$sort){
26
+ id,
27
+ ${entitySchema.listingProperties.join(',\n')}
28
+ }
29
+ totalRecords: ${entitySchema.actions.countAll}(where: $where)
30
+ }
31
+ `;
29
32
  }
30
- var _default = exports["default"] = buildListingQuery;
33
+ var _default = exports.default = buildListingQuery;
31
34
  //# sourceMappingURL=build-listing-query.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"build-listing-query.js","names":["_client","require","_coreErrors","_adminUiUtils","_templateObject","buildAdminSearchQuery","entitySchema","index","_ref","_ref$listingPropertie","listingProperties","parsedProperties","concat","join","getDynamicQuery","buildListingQuery","isSearchQuery","actions","getAll","BlazeError","sortType","toUpperCase","substr","gql","_taggedTemplateLiteral2","countAll","_default","exports"],"sources":["../../src/utils/build-listing-query.js"],"sourcesContent":["import { gql } from '@apollo/client';\nimport { BlazeError } from '@blaze-cms/core-errors';\nimport { getDynamicQuery } from '@blaze-cms/admin-ui-utils';\n\nconst buildAdminSearchQuery = (entitySchema, index) => {\n const { listingProperties = [] } = entitySchema || {};\n const parsedProperties = `id, ${listingProperties.join(' ') || 'id name'}`;\n\n return getDynamicQuery('ADMIN_SEARCH')([entitySchema], parsedProperties, true, index);\n};\n\nfunction buildListingQuery(entitySchema, index, isSearchQuery) {\n if (!entitySchema.actions || !entitySchema.actions.getAll || !entitySchema.listingProperties) {\n throw new BlazeError(\n 'Listing query requires getAll action and listingProperties from entity schema'\n );\n }\n\n if (isSearchQuery) return buildAdminSearchQuery(entitySchema, index);\n\n const sortType =\n entitySchema.actions.getAll[0].toUpperCase() + entitySchema.actions.getAll.substr(1);\n\n return gql`\n query ${\n entitySchema.actions.getAll\n }($where: JSON, $limit: Int, $offset:Int, $sort: [${sortType}SortItem]) {\n listingData: ${\n entitySchema.actions.getAll\n }(where: $where, limit: $limit, offset:$offset, sort:$sort){\n id,\n ${entitySchema.listingProperties.join(',\\n')}\n }\n totalRecords: ${entitySchema.actions.countAll}(where: $where)\n }\n `;\n}\n\nexport default buildListingQuery;\n"],"mappings":";;;;;;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,aAAA,GAAAF,OAAA;AAA4D,IAAAG,eAAA;AAE5D,IAAMC,qBAAqB,GAAG,SAAxBA,qBAAqBA,CAAIC,YAAY,EAAEC,KAAK,EAAK;EACrD,IAAAC,IAAA,GAAmCF,YAAY,IAAI,CAAC,CAAC;IAAAG,qBAAA,GAAAD,IAAA,CAA7CE,iBAAiB;IAAjBA,iBAAiB,GAAAD,qBAAA,cAAG,EAAE,GAAAA,qBAAA;EAC9B,IAAME,gBAAgB,UAAAC,MAAA,CAAUF,iBAAiB,CAACG,IAAI,CAAC,GAAG,CAAC,IAAI,SAAS,CAAE;EAE1E,OAAO,IAAAC,6BAAe,EAAC,cAAc,CAAC,CAAC,CAACR,YAAY,CAAC,EAAEK,gBAAgB,EAAE,IAAI,EAAEJ,KAAK,CAAC;AACvF,CAAC;AAED,SAASQ,iBAAiBA,CAACT,YAAY,EAAEC,KAAK,EAAES,aAAa,EAAE;EAC7D,IAAI,CAACV,YAAY,CAACW,OAAO,IAAI,CAACX,YAAY,CAACW,OAAO,CAACC,MAAM,IAAI,CAACZ,YAAY,CAACI,iBAAiB,EAAE;IAC5F,MAAM,IAAIS,sBAAU,CAClB,+EACF,CAAC;EACH;EAEA,IAAIH,aAAa,EAAE,OAAOX,qBAAqB,CAACC,YAAY,EAAEC,KAAK,CAAC;EAEpE,IAAMa,QAAQ,GACZd,YAAY,CAACW,OAAO,CAACC,MAAM,CAAC,CAAC,CAAC,CAACG,WAAW,CAAC,CAAC,GAAGf,YAAY,CAACW,OAAO,CAACC,MAAM,CAACI,MAAM,CAAC,CAAC,CAAC;EAEtF,WAAOC,WAAG,EAAAnB,eAAA,KAAAA,eAAA,OAAAoB,uBAAA,kRAENlB,YAAY,CAACW,OAAO,CAACC,MAAM,EACuBE,QAAQ,EAExDd,YAAY,CAACW,OAAO,CAACC,MAAM,EAGzBZ,YAAY,CAACI,iBAAiB,CAACG,IAAI,CAAC,KAAK,CAAC,EAE9BP,YAAY,CAACW,OAAO,CAACQ,QAAQ;AAGnD;AAAC,IAAAC,QAAA,GAAAC,OAAA,cAEcZ,iBAAiB","ignoreList":[]}
1
+ {"version":3,"file":"build-listing-query.js","names":["_client","require","_coreErrors","_adminUiUtils","buildAdminSearchQuery","entitySchema","index","listingProperties","parsedProperties","join","getDynamicQuery","buildListingQuery","isSearchQuery","actions","getAll","BlazeError","sortType","toUpperCase","substr","gql","countAll","_default","exports","default"],"sources":["../../src/utils/build-listing-query.js"],"sourcesContent":["import { gql } from '@apollo/client';\nimport { BlazeError } from '@blaze-cms/core-errors';\nimport { getDynamicQuery } from '@blaze-cms/admin-ui-utils';\n\nconst buildAdminSearchQuery = (entitySchema, index) => {\n const { listingProperties = [] } = entitySchema || {};\n const parsedProperties = `id, ${listingProperties.join(' ') || 'id name'}`;\n\n return getDynamicQuery('ADMIN_SEARCH')([entitySchema], parsedProperties, true, index);\n};\n\nfunction buildListingQuery(entitySchema, index, isSearchQuery) {\n if (!entitySchema.actions || !entitySchema.actions.getAll || !entitySchema.listingProperties) {\n throw new BlazeError(\n 'Listing query requires getAll action and listingProperties from entity schema'\n );\n }\n\n if (isSearchQuery) return buildAdminSearchQuery(entitySchema, index);\n\n const sortType =\n entitySchema.actions.getAll[0].toUpperCase() + entitySchema.actions.getAll.substr(1);\n\n return gql`\n query ${\n entitySchema.actions.getAll\n }($where: JSON, $limit: Int, $offset:Int, $sort: [${sortType}SortItem]) {\n listingData: ${\n entitySchema.actions.getAll\n }(where: $where, limit: $limit, offset:$offset, sort:$sort){\n id,\n ${entitySchema.listingProperties.join(',\\n')}\n }\n totalRecords: ${entitySchema.actions.countAll}(where: $where)\n }\n `;\n}\n\nexport default buildListingQuery;\n"],"mappings":";;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,aAAA,GAAAF,OAAA;AAEA,MAAMG,qBAAqB,GAAGA,CAACC,YAAY,EAAEC,KAAK,KAAK;EACrD,MAAM;IAAEC,iBAAiB,GAAG;EAAG,CAAC,GAAGF,YAAY,IAAI,CAAC,CAAC;EACrD,MAAMG,gBAAgB,GAAG,OAAOD,iBAAiB,CAACE,IAAI,CAAC,GAAG,CAAC,IAAI,SAAS,EAAE;EAE1E,OAAO,IAAAC,6BAAe,EAAC,cAAc,CAAC,CAAC,CAACL,YAAY,CAAC,EAAEG,gBAAgB,EAAE,IAAI,EAAEF,KAAK,CAAC;AACvF,CAAC;AAED,SAASK,iBAAiBA,CAACN,YAAY,EAAEC,KAAK,EAAEM,aAAa,EAAE;EAC7D,IAAI,CAACP,YAAY,CAACQ,OAAO,IAAI,CAACR,YAAY,CAACQ,OAAO,CAACC,MAAM,IAAI,CAACT,YAAY,CAACE,iBAAiB,EAAE;IAC5F,MAAM,IAAIQ,sBAAU,CAClB,+EACF,CAAC;EACH;EAEA,IAAIH,aAAa,EAAE,OAAOR,qBAAqB,CAACC,YAAY,EAAEC,KAAK,CAAC;EAEpE,MAAMU,QAAQ,GACZX,YAAY,CAACQ,OAAO,CAACC,MAAM,CAAC,CAAC,CAAC,CAACG,WAAW,CAAC,CAAC,GAAGZ,YAAY,CAACQ,OAAO,CAACC,MAAM,CAACI,MAAM,CAAC,CAAC,CAAC;EAEtF,OAAO,IAAAC,WAAG;AACZ,YACMd,YAAY,CAACQ,OAAO,CAACC,MAAM,oDACuBE,QAAQ;AAChE,qBACQX,YAAY,CAACQ,OAAO,CAACC,MAAM;AACnC;AACA,UACUT,YAAY,CAACE,iBAAiB,CAACE,IAAI,CAAC,KAAK,CAAC;AACpD;AACA,sBAAsBJ,YAAY,CAACQ,OAAO,CAACO,QAAQ;AACnD;AACA,GAAG;AACH;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEcZ,iBAAiB","ignoreList":[]}
@@ -1,25 +1,31 @@
1
1
  "use strict";
2
2
 
3
- require("core-js/modules/es.object.define-property.js");
4
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
5
4
  Object.defineProperty(exports, "__esModule", {
6
5
  value: true
7
6
  });
8
- exports["default"] = void 0;
9
- require("core-js/modules/es.array.join.js");
10
- var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
7
+ exports.default = void 0;
11
8
  var _client = require("@apollo/client");
12
9
  var _coreErrors = require("@blaze-cms/core-errors");
13
10
  var _lodash = _interopRequireDefault(require("lodash.upperfirst"));
14
11
  var _adminUiUtils = require("@blaze-cms/admin-ui-utils");
15
- var _templateObject;
16
12
  function buildUpdateDataQuery(entitySchema) {
17
13
  if (!entitySchema.actions || !entitySchema.actions.update || !entitySchema.properties) {
18
14
  throw new _coreErrors.BlazeError('Update DataEntity query requires get action and properties from entity schema');
19
15
  }
20
- var actionInput = (0, _lodash["default"])("".concat(entitySchema.actions.update, "Input"));
21
- var dataProperties = (0, _adminUiUtils.getDataProperties)(entitySchema);
22
- return (0, _client.gql)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["\n mutation updateEntity($input: ", ") {\n updateEntity: ", "(input: $input){\n result {\n id,\n ", ",\n updated\n }\n }\n }\n "])), actionInput, entitySchema.actions.update, dataProperties.join(',\n'));
16
+ const actionInput = (0, _lodash.default)(`${entitySchema.actions.update}Input`);
17
+ const dataProperties = (0, _adminUiUtils.getDataProperties)(entitySchema);
18
+ return (0, _client.gql)`
19
+ mutation updateEntity($input: ${actionInput}) {
20
+ updateEntity: ${entitySchema.actions.update}(input: $input){
21
+ result {
22
+ id,
23
+ ${dataProperties.join(',\n')},
24
+ updated
25
+ }
26
+ }
27
+ }
28
+ `;
23
29
  }
24
- var _default = exports["default"] = buildUpdateDataQuery;
30
+ var _default = exports.default = buildUpdateDataQuery;
25
31
  //# sourceMappingURL=build-update-data-query.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"build-update-data-query.js","names":["_client","require","_coreErrors","_lodash","_interopRequireDefault","_adminUiUtils","_templateObject","buildUpdateDataQuery","entitySchema","actions","update","properties","BlazeError","actionInput","upperfirst","concat","dataProperties","getDataProperties","gql","_taggedTemplateLiteral2","join","_default","exports"],"sources":["../../src/utils/build-update-data-query.js"],"sourcesContent":["import { gql } from '@apollo/client';\nimport { BlazeError } from '@blaze-cms/core-errors';\nimport upperfirst from 'lodash.upperfirst';\nimport { getDataProperties } from '@blaze-cms/admin-ui-utils';\n\nfunction buildUpdateDataQuery(entitySchema) {\n if (!entitySchema.actions || !entitySchema.actions.update || !entitySchema.properties) {\n throw new BlazeError(\n 'Update DataEntity query requires get action and properties from entity schema'\n );\n }\n\n const actionInput = upperfirst(`${entitySchema.actions.update}Input`);\n const dataProperties = getDataProperties(entitySchema);\n\n return gql`\n mutation updateEntity($input: ${actionInput}) {\n updateEntity: ${entitySchema.actions.update}(input: $input){\n result {\n id,\n ${dataProperties.join(',\\n')},\n updated\n }\n }\n }\n `;\n}\n\nexport default buildUpdateDataQuery;\n"],"mappings":";;;;;;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,OAAA,GAAAC,sBAAA,CAAAH,OAAA;AACA,IAAAI,aAAA,GAAAJ,OAAA;AAA8D,IAAAK,eAAA;AAE9D,SAASC,oBAAoBA,CAACC,YAAY,EAAE;EAC1C,IAAI,CAACA,YAAY,CAACC,OAAO,IAAI,CAACD,YAAY,CAACC,OAAO,CAACC,MAAM,IAAI,CAACF,YAAY,CAACG,UAAU,EAAE;IACrF,MAAM,IAAIC,sBAAU,CAClB,+EACF,CAAC;EACH;EAEA,IAAMC,WAAW,GAAG,IAAAC,kBAAU,KAAAC,MAAA,CAAIP,YAAY,CAACC,OAAO,CAACC,MAAM,UAAO,CAAC;EACrE,IAAMM,cAAc,GAAG,IAAAC,+BAAiB,EAACT,YAAY,CAAC;EAEtD,WAAOU,WAAG,EAAAZ,eAAA,KAAAA,eAAA,OAAAa,uBAAA,qMACuBN,WAAW,EAC1BL,YAAY,CAACC,OAAO,CAACC,MAAM,EAGnCM,cAAc,CAACI,IAAI,CAAC,KAAK,CAAC;AAMtC;AAAC,IAAAC,QAAA,GAAAC,OAAA,cAEcf,oBAAoB","ignoreList":[]}
1
+ {"version":3,"file":"build-update-data-query.js","names":["_client","require","_coreErrors","_lodash","_interopRequireDefault","_adminUiUtils","buildUpdateDataQuery","entitySchema","actions","update","properties","BlazeError","actionInput","upperfirst","dataProperties","getDataProperties","gql","join","_default","exports","default"],"sources":["../../src/utils/build-update-data-query.js"],"sourcesContent":["import { gql } from '@apollo/client';\nimport { BlazeError } from '@blaze-cms/core-errors';\nimport upperfirst from 'lodash.upperfirst';\nimport { getDataProperties } from '@blaze-cms/admin-ui-utils';\n\nfunction buildUpdateDataQuery(entitySchema) {\n if (!entitySchema.actions || !entitySchema.actions.update || !entitySchema.properties) {\n throw new BlazeError(\n 'Update DataEntity query requires get action and properties from entity schema'\n );\n }\n\n const actionInput = upperfirst(`${entitySchema.actions.update}Input`);\n const dataProperties = getDataProperties(entitySchema);\n\n return gql`\n mutation updateEntity($input: ${actionInput}) {\n updateEntity: ${entitySchema.actions.update}(input: $input){\n result {\n id,\n ${dataProperties.join(',\\n')},\n updated\n }\n }\n }\n `;\n}\n\nexport default buildUpdateDataQuery;\n"],"mappings":";;;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,OAAA,GAAAC,sBAAA,CAAAH,OAAA;AACA,IAAAI,aAAA,GAAAJ,OAAA;AAEA,SAASK,oBAAoBA,CAACC,YAAY,EAAE;EAC1C,IAAI,CAACA,YAAY,CAACC,OAAO,IAAI,CAACD,YAAY,CAACC,OAAO,CAACC,MAAM,IAAI,CAACF,YAAY,CAACG,UAAU,EAAE;IACrF,MAAM,IAAIC,sBAAU,CAClB,+EACF,CAAC;EACH;EAEA,MAAMC,WAAW,GAAG,IAAAC,eAAU,EAAC,GAAGN,YAAY,CAACC,OAAO,CAACC,MAAM,OAAO,CAAC;EACrE,MAAMK,cAAc,GAAG,IAAAC,+BAAiB,EAACR,YAAY,CAAC;EAEtD,OAAO,IAAAS,WAAG;AACZ,mCAAmCJ,WAAW;AAC9C,oBAAoBL,YAAY,CAACC,OAAO,CAACC,MAAM;AAC/C;AACA;AACA,YAAYK,cAAc,CAACG,IAAI,CAAC,KAAK,CAAC;AACtC;AACA;AACA;AACA;AACA,GAAG;AACH;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEcd,oBAAoB","ignoreList":[]}
@@ -1,21 +1,28 @@
1
1
  "use strict";
2
2
 
3
- require("core-js/modules/es.object.define-property.js");
4
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
5
3
  Object.defineProperty(exports, "__esModule", {
6
4
  value: true
7
5
  });
8
- exports["default"] = void 0;
9
- var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
6
+ exports.default = void 0;
10
7
  var _client = require("@apollo/client");
11
8
  var _coreErrors = require("@blaze-cms/core-errors");
12
- var _templateObject;
13
9
  function buildUpdatePublishUnpublishMutation(entitySchema, id, action, cache) {
14
10
  if (!entitySchema || !entitySchema.actions || !entitySchema.actions.publish || !id || !action) {
15
11
  throw new _coreErrors.BlazeError('Update DataEntity query requires publish action from entity schema and id');
16
12
  }
17
- var withClient = "".concat(cache ? '@client' : '');
18
- return (0, _client.gql)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["\n mutation {\n response: ", " ", "(input: {\n id: \"", "\"\n }){\n result {\n id,\n status\n }\n }\n }\n "])), entitySchema.actions[action], withClient, id);
13
+ const withClient = `${cache ? '@client' : ''}`;
14
+ return (0, _client.gql)`
15
+ mutation {
16
+ response: ${entitySchema.actions[action]} ${withClient}(input: {
17
+ id: "${id}"
18
+ }){
19
+ result {
20
+ id,
21
+ status
22
+ }
23
+ }
24
+ }
25
+ `;
19
26
  }
20
- var _default = exports["default"] = buildUpdatePublishUnpublishMutation;
27
+ var _default = exports.default = buildUpdatePublishUnpublishMutation;
21
28
  //# sourceMappingURL=build-update-publish-unpublish-mutation.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"build-update-publish-unpublish-mutation.js","names":["_client","require","_coreErrors","_templateObject","buildUpdatePublishUnpublishMutation","entitySchema","id","action","cache","actions","publish","BlazeError","withClient","concat","gql","_taggedTemplateLiteral2","_default","exports"],"sources":["../../src/utils/build-update-publish-unpublish-mutation.js"],"sourcesContent":["import { gql } from '@apollo/client';\nimport { BlazeError } from '@blaze-cms/core-errors';\n\nfunction buildUpdatePublishUnpublishMutation(entitySchema, id, action, cache) {\n if (!entitySchema || !entitySchema.actions || !entitySchema.actions.publish || !id || !action) {\n throw new BlazeError(\n 'Update DataEntity query requires publish action from entity schema and id'\n );\n }\n\n const withClient = `${cache ? '@client' : ''}`;\n\n return gql`\n mutation {\n response: ${entitySchema.actions[action]} ${withClient}(input: {\n id: \"${id}\"\n }){\n result {\n id,\n status\n }\n }\n }\n `;\n}\n\nexport default buildUpdatePublishUnpublishMutation;\n"],"mappings":";;;;;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AAAoD,IAAAE,eAAA;AAEpD,SAASC,mCAAmCA,CAACC,YAAY,EAAEC,EAAE,EAAEC,MAAM,EAAEC,KAAK,EAAE;EAC5E,IAAI,CAACH,YAAY,IAAI,CAACA,YAAY,CAACI,OAAO,IAAI,CAACJ,YAAY,CAACI,OAAO,CAACC,OAAO,IAAI,CAACJ,EAAE,IAAI,CAACC,MAAM,EAAE;IAC7F,MAAM,IAAII,sBAAU,CAClB,2EACF,CAAC;EACH;EAEA,IAAMC,UAAU,MAAAC,MAAA,CAAML,KAAK,GAAG,SAAS,GAAG,EAAE,CAAE;EAE9C,WAAOM,WAAG,EAAAX,eAAA,KAAAA,eAAA,OAAAY,uBAAA,4LAEMV,YAAY,CAACI,OAAO,CAACF,MAAM,CAAC,EAAIK,UAAU,EAC7CN,EAAE;AASjB;AAAC,IAAAU,QAAA,GAAAC,OAAA,cAEcb,mCAAmC","ignoreList":[]}
1
+ {"version":3,"file":"build-update-publish-unpublish-mutation.js","names":["_client","require","_coreErrors","buildUpdatePublishUnpublishMutation","entitySchema","id","action","cache","actions","publish","BlazeError","withClient","gql","_default","exports","default"],"sources":["../../src/utils/build-update-publish-unpublish-mutation.js"],"sourcesContent":["import { gql } from '@apollo/client';\nimport { BlazeError } from '@blaze-cms/core-errors';\n\nfunction buildUpdatePublishUnpublishMutation(entitySchema, id, action, cache) {\n if (!entitySchema || !entitySchema.actions || !entitySchema.actions.publish || !id || !action) {\n throw new BlazeError(\n 'Update DataEntity query requires publish action from entity schema and id'\n );\n }\n\n const withClient = `${cache ? '@client' : ''}`;\n\n return gql`\n mutation {\n response: ${entitySchema.actions[action]} ${withClient}(input: {\n id: \"${id}\"\n }){\n result {\n id,\n status\n }\n }\n }\n `;\n}\n\nexport default buildUpdatePublishUnpublishMutation;\n"],"mappings":";;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AAEA,SAASE,mCAAmCA,CAACC,YAAY,EAAEC,EAAE,EAAEC,MAAM,EAAEC,KAAK,EAAE;EAC5E,IAAI,CAACH,YAAY,IAAI,CAACA,YAAY,CAACI,OAAO,IAAI,CAACJ,YAAY,CAACI,OAAO,CAACC,OAAO,IAAI,CAACJ,EAAE,IAAI,CAACC,MAAM,EAAE;IAC7F,MAAM,IAAII,sBAAU,CAClB,2EACF,CAAC;EACH;EAEA,MAAMC,UAAU,GAAG,GAAGJ,KAAK,GAAG,SAAS,GAAG,EAAE,EAAE;EAE9C,OAAO,IAAAK,WAAG;AACZ;AACA,kBAAkBR,YAAY,CAACI,OAAO,CAACF,MAAM,CAAC,IAAIK,UAAU;AAC5D,eAAeN,EAAE;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AAAC,IAAAQ,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEcZ,mCAAmC","ignoreList":[]}
@@ -1,16 +1,16 @@
1
1
  "use strict";
2
2
 
3
- require("core-js/modules/es.object.define-property.js");
4
3
  Object.defineProperty(exports, "__esModule", {
5
4
  value: true
6
5
  });
7
6
  exports.getDefaultQueryParams = void 0;
8
- var getDefaultQueryParams = exports.getDefaultQueryParams = function getDefaultQueryParams(schema) {
9
- var updated = schema.properties && schema.properties.updated;
10
- var _ref = schema.displayProperties || {},
11
- where = _ref.adminDefaultListingFilter;
7
+ const getDefaultQueryParams = schema => {
8
+ const updated = schema.properties && schema.properties.updated;
9
+ const {
10
+ adminDefaultListingFilter: where
11
+ } = schema.displayProperties || {};
12
12
  return {
13
- where: where,
13
+ where,
14
14
  limit: 10,
15
15
  offset: 0,
16
16
  sort: updated ? [{
@@ -19,4 +19,5 @@ var getDefaultQueryParams = exports.getDefaultQueryParams = function getDefaultQ
19
19
  }] : []
20
20
  };
21
21
  };
22
+ exports.getDefaultQueryParams = getDefaultQueryParams;
22
23
  //# sourceMappingURL=get-default-query-params.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"get-default-query-params.js","names":["getDefaultQueryParams","exports","schema","updated","properties","_ref","displayProperties","where","adminDefaultListingFilter","limit","offset","sort","property","direction"],"sources":["../../src/utils/get-default-query-params.js"],"sourcesContent":["const getDefaultQueryParams = schema => {\n const updated = schema.properties && schema.properties.updated;\n const { adminDefaultListingFilter: where } = schema.displayProperties || {};\n\n return {\n where,\n limit: 10,\n offset: 0,\n sort: updated\n ? [\n {\n property: 'updated',\n direction: 'desc'\n }\n ]\n : []\n };\n};\n\nexport { getDefaultQueryParams };\n"],"mappings":";;;;;;;AAAA,IAAMA,qBAAqB,GAAAC,OAAA,CAAAD,qBAAA,GAAG,SAAxBA,qBAAqBA,CAAGE,MAAM,EAAI;EACtC,IAAMC,OAAO,GAAGD,MAAM,CAACE,UAAU,IAAIF,MAAM,CAACE,UAAU,CAACD,OAAO;EAC9D,IAAAE,IAAA,GAA6CH,MAAM,CAACI,iBAAiB,IAAI,CAAC,CAAC;IAAxCC,KAAK,GAAAF,IAAA,CAAhCG,yBAAyB;EAEjC,OAAO;IACLD,KAAK,EAALA,KAAK;IACLE,KAAK,EAAE,EAAE;IACTC,MAAM,EAAE,CAAC;IACTC,IAAI,EAAER,OAAO,GACT,CACE;MACES,QAAQ,EAAE,SAAS;MACnBC,SAAS,EAAE;IACb,CAAC,CACF,GACD;EACN,CAAC;AACH,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"get-default-query-params.js","names":["getDefaultQueryParams","schema","updated","properties","adminDefaultListingFilter","where","displayProperties","limit","offset","sort","property","direction","exports"],"sources":["../../src/utils/get-default-query-params.js"],"sourcesContent":["const getDefaultQueryParams = schema => {\n const updated = schema.properties && schema.properties.updated;\n const { adminDefaultListingFilter: where } = schema.displayProperties || {};\n\n return {\n where,\n limit: 10,\n offset: 0,\n sort: updated\n ? [\n {\n property: 'updated',\n direction: 'desc'\n }\n ]\n : []\n };\n};\n\nexport { getDefaultQueryParams };\n"],"mappings":";;;;;;AAAA,MAAMA,qBAAqB,GAAGC,MAAM,IAAI;EACtC,MAAMC,OAAO,GAAGD,MAAM,CAACE,UAAU,IAAIF,MAAM,CAACE,UAAU,CAACD,OAAO;EAC9D,MAAM;IAAEE,yBAAyB,EAAEC;EAAM,CAAC,GAAGJ,MAAM,CAACK,iBAAiB,IAAI,CAAC,CAAC;EAE3E,OAAO;IACLD,KAAK;IACLE,KAAK,EAAE,EAAE;IACTC,MAAM,EAAE,CAAC;IACTC,IAAI,EAAEP,OAAO,GACT,CACE;MACEQ,QAAQ,EAAE,SAAS;MACnBC,SAAS,EAAE;IACb,CAAC,CACF,GACD;EACN,CAAC;AACH,CAAC;AAACC,OAAA,CAAAZ,qBAAA,GAAAA,qBAAA","ignoreList":[]}
@@ -1,6 +1,5 @@
1
1
  "use strict";
2
2
 
3
- require("core-js/modules/es.object.define-property.js");
4
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
5
4
  Object.defineProperty(exports, "__esModule", {
6
5
  value: true
@@ -9,10 +8,9 @@ exports.withContext = void 0;
9
8
  var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
10
9
  var _react = _interopRequireDefault(require("react"));
11
10
  var _adminUiUtils = require("@blaze-cms/admin-ui-utils");
12
- var withContext = exports.withContext = function withContext(Component) {
13
- return function (props) {
14
- var contexts = (0, _adminUiUtils.useMainContext)(_adminUiUtils.MainContext);
15
- return /*#__PURE__*/_react["default"].createElement(Component, (0, _extends2["default"])({}, props, contexts));
16
- };
11
+ const withContext = Component => function (props) {
12
+ const contexts = (0, _adminUiUtils.useMainContext)(_adminUiUtils.MainContext);
13
+ return /*#__PURE__*/_react.default.createElement(Component, (0, _extends2.default)({}, props, contexts));
17
14
  };
15
+ exports.withContext = withContext;
18
16
  //# sourceMappingURL=withContext.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"withContext.js","names":["_react","_interopRequireDefault","require","_adminUiUtils","withContext","exports","Component","props","contexts","useMainContext","MainContext","createElement","_extends2"],"sources":["../../../src/utils/hoc/withContext.js"],"sourcesContent":["import React from 'react';\nimport { useMainContext, MainContext } from '@blaze-cms/admin-ui-utils';\n\nexport const withContext = Component => props => {\n const contexts = useMainContext(MainContext);\n return <Component {...props} {...contexts} />;\n};\n"],"mappings":";;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,aAAA,GAAAD,OAAA;AAEO,IAAME,WAAW,GAAAC,OAAA,CAAAD,WAAA,GAAG,SAAdA,WAAWA,CAAGE,SAAS;EAAA,OAAI,UAAAC,KAAK,EAAI;IAC/C,IAAMC,QAAQ,GAAG,IAAAC,4BAAc,EAACC,yBAAW,CAAC;IAC5C,oBAAOV,MAAA,YAAAW,aAAA,CAACL,SAAS,MAAAM,SAAA,iBAAKL,KAAK,EAAMC,QAAQ,CAAG,CAAC;EAC/C,CAAC;AAAA","ignoreList":[]}
1
+ {"version":3,"file":"withContext.js","names":["_react","_interopRequireDefault","require","_adminUiUtils","withContext","Component","props","contexts","useMainContext","MainContext","default","createElement","_extends2","exports"],"sources":["../../../src/utils/hoc/withContext.js"],"sourcesContent":["import React from 'react';\nimport { useMainContext, MainContext } from '@blaze-cms/admin-ui-utils';\n\nexport const withContext = Component =>\n function (props) {\n const contexts = useMainContext(MainContext);\n return <Component {...props} {...contexts} />;\n };\n"],"mappings":";;;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,aAAA,GAAAD,OAAA;AAEO,MAAME,WAAW,GAAGC,SAAS,IAClC,UAAUC,KAAK,EAAE;EACf,MAAMC,QAAQ,GAAG,IAAAC,4BAAc,EAACC,yBAAW,CAAC;EAC5C,oBAAOT,MAAA,CAAAU,OAAA,CAAAC,aAAA,CAACN,SAAS,MAAAO,SAAA,CAAAF,OAAA,MAAKJ,KAAK,EAAMC,QAAQ,CAAG,CAAC;AAC/C,CAAC;AAACM,OAAA,CAAAT,WAAA,GAAAA,WAAA","ignoreList":[]}
@@ -1,22 +1,14 @@
1
1
  "use strict";
2
2
 
3
- require("core-js/modules/es.object.define-property.js");
4
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
5
3
  Object.defineProperty(exports, "__esModule", {
6
4
  value: true
7
5
  });
8
- exports["default"] = void 0;
9
- var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
6
+ exports.default = void 0;
10
7
  var _react = require("react");
11
8
  function useToggle(initialValue) {
12
- var _useState = (0, _react.useState)(initialValue),
13
- _useState2 = (0, _slicedToArray2["default"])(_useState, 2),
14
- toggleValue = _useState2[0],
15
- setToggleValue = _useState2[1];
16
- var toggler = (0, _react.useCallback)(function () {
17
- return setToggleValue(!toggleValue);
18
- }, [toggleValue]);
9
+ const [toggleValue, setToggleValue] = (0, _react.useState)(initialValue);
10
+ const toggler = (0, _react.useCallback)(() => setToggleValue(!toggleValue), [toggleValue]);
19
11
  return [toggleValue, toggler];
20
12
  }
21
- var _default = exports["default"] = useToggle;
13
+ var _default = exports.default = useToggle;
22
14
  //# sourceMappingURL=useToggle.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useToggle.js","names":["_react","require","useToggle","initialValue","_useState","useState","_useState2","_slicedToArray2","toggleValue","setToggleValue","toggler","useCallback","_default","exports"],"sources":["../../../src/utils/hooks/useToggle.js"],"sourcesContent":["import { useState, useCallback } from 'react';\n\nfunction useToggle(initialValue) {\n const [toggleValue, setToggleValue] = useState(initialValue);\n const toggler = useCallback(() => setToggleValue(!toggleValue), [toggleValue]);\n\n return [toggleValue, toggler];\n}\n\nexport default useToggle;\n"],"mappings":";;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAEA,SAASC,SAASA,CAACC,YAAY,EAAE;EAC/B,IAAAC,SAAA,GAAsC,IAAAC,eAAQ,EAACF,YAAY,CAAC;IAAAG,UAAA,OAAAC,eAAA,aAAAH,SAAA;IAArDI,WAAW,GAAAF,UAAA;IAAEG,cAAc,GAAAH,UAAA;EAClC,IAAMI,OAAO,GAAG,IAAAC,kBAAW,EAAC;IAAA,OAAMF,cAAc,CAAC,CAACD,WAAW,CAAC;EAAA,GAAE,CAACA,WAAW,CAAC,CAAC;EAE9E,OAAO,CAACA,WAAW,EAAEE,OAAO,CAAC;AAC/B;AAAC,IAAAE,QAAA,GAAAC,OAAA,cAEcX,SAAS","ignoreList":[]}
1
+ {"version":3,"file":"useToggle.js","names":["_react","require","useToggle","initialValue","toggleValue","setToggleValue","useState","toggler","useCallback","_default","exports","default"],"sources":["../../../src/utils/hooks/useToggle.js"],"sourcesContent":["import { useState, useCallback } from 'react';\n\nfunction useToggle(initialValue) {\n const [toggleValue, setToggleValue] = useState(initialValue);\n const toggler = useCallback(() => setToggleValue(!toggleValue), [toggleValue]);\n\n return [toggleValue, toggler];\n}\n\nexport default useToggle;\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAEA,SAASC,SAASA,CAACC,YAAY,EAAE;EAC/B,MAAM,CAACC,WAAW,EAAEC,cAAc,CAAC,GAAG,IAAAC,eAAQ,EAACH,YAAY,CAAC;EAC5D,MAAMI,OAAO,GAAG,IAAAC,kBAAW,EAAC,MAAMH,cAAc,CAAC,CAACD,WAAW,CAAC,EAAE,CAACA,WAAW,CAAC,CAAC;EAE9E,OAAO,CAACA,WAAW,EAAEG,OAAO,CAAC;AAC/B;AAAC,IAAAE,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEcT,SAAS","ignoreList":[]}
@@ -1,14 +1,13 @@
1
1
  "use strict";
2
2
 
3
- require("core-js/modules/es.object.define-property.js");
4
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
5
4
  Object.defineProperty(exports, "__esModule", {
6
5
  value: true
7
6
  });
8
7
  Object.defineProperty(exports, "buildUpdatePublishUnpublishMutation", {
9
8
  enumerable: true,
10
- get: function get() {
11
- return _buildUpdatePublishUnpublishMutation["default"];
9
+ get: function () {
10
+ return _buildUpdatePublishUnpublishMutation.default;
12
11
  }
13
12
  });
14
13
  var _buildUpdatePublishUnpublishMutation = _interopRequireDefault(require("./build-update-publish-unpublish-mutation"));
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["_buildUpdatePublishUnpublishMutation","_interopRequireDefault","require"],"sources":["../../src/utils/index.js"],"sourcesContent":["import buildUpdatePublishUnpublishMutation from './build-update-publish-unpublish-mutation';\n\nexport { buildUpdatePublishUnpublishMutation };\n"],"mappings":";;;;;;;;;;;;;AAAA,IAAAA,oCAAA,GAAAC,sBAAA,CAAAC,OAAA","ignoreList":[]}
1
+ {"version":3,"file":"index.js","names":["_buildUpdatePublishUnpublishMutation","_interopRequireDefault","require"],"sources":["../../src/utils/index.js"],"sourcesContent":["import buildUpdatePublishUnpublishMutation from './build-update-publish-unpublish-mutation';\n\nexport { buildUpdatePublishUnpublishMutation };\n"],"mappings":";;;;;;;;;;;;AAAA,IAAAA,oCAAA,GAAAC,sBAAA,CAAAC,OAAA","ignoreList":[]}
@@ -9,16 +9,14 @@ import { withRouter, Prompt } from 'react-router-dom';
9
9
  import { useApolloClient } from '@apollo/client';
10
10
  import PropTypes from 'prop-types';
11
11
  import { RenderHook } from '@blaze-cms/plugin-render-hooks-ui';
12
- import { getQuery, GET_CURRENT_TAB_ID } from '@blaze-cms/admin-ui-utils';
12
+ import { getQuery } from '@blaze-cms/admin-ui-utils';
13
13
  import { FormBuilder, parseFormValues } from '@blaze-cms/react-form-builder';
14
14
  import { DeleteAction, CopyDataFromAction } from '@blaze-cms/admin';
15
15
  import { useToasts } from '@blaze-react/toaster';
16
16
  import cloneDeep from 'lodash.clonedeep';
17
17
  import { getPageName } from '../utils/data-mappers';
18
- import isFormEmpty from '../utils/is-form-empty';
19
18
  import availableActions from './actions-handlers';
20
19
  import SideBarRelations from './SideBarRelations';
21
- import Tabs from '../../Tabs';
22
20
  import useCallbackDebounce from '../../hooks/useCallbackDebounce';
23
21
  import { ENTITY_PUBLISHED, TEXT_CONTENT_TYPE, LEAVE_PAGE_MESSAGE, PREVIEW_INTERFACE, PAGE_BUILDER_FIELD_ID, PAGE_BUILDER_TEMPLATE_FIELD_ID, ERROR, SAVE_BUTTON_TEXTS, UNPUBLISHED_WARNING } from '../../../constants';
24
22
  import EntityHeader from './EntityHeader';
@@ -37,8 +35,7 @@ const Entity = ({
37
35
  onViewUrl,
38
36
  refetchRecord
39
37
  }) => {
40
- var _schema$interfaces, _schema$interfaces2, _formData$values;
41
- const [, setCurrentTabId] = useState(null);
38
+ var _formData$values;
42
39
  const [formValues, setFormValues] = useState(null);
43
40
  const [entitySchema, setEntitySchema] = useState(null);
44
41
  const [entityData, setEntityData] = useState(null);
@@ -57,6 +54,7 @@ const Entity = ({
57
54
  const [newUpdatedDate, setNewUpdatedDate] = useState(null);
58
55
  const [saveButtonText, setSaveButtonText] = useState(SAVE_BUTTON_TEXTS.save);
59
56
  const [externalUpdateTime, setExternalUpdateTime] = useState(null);
57
+ const [suppressPrompt, setSuppressPrompt] = useState(false);
60
58
  const [isRightSidebarOpen, setIsRightSidebarOpen] = useState(true);
61
59
  const handleToggleRightSidebar = () => setIsRightSidebarOpen(!isRightSidebarOpen);
62
60
  const isCreatePage = history.location.pathname.includes('create');
@@ -107,7 +105,8 @@ const Entity = ({
107
105
  client.writeQuery({
108
106
  query: getQuery('GET_CURRENT_ENTITY'),
109
107
  data: {
110
- currentEntity: schema.id
108
+ currentEntity: schema.id,
109
+ currentItemId: entity ? entity.id : null
111
110
  }
112
111
  });
113
112
  }
@@ -217,12 +216,11 @@ const Entity = ({
217
216
  id
218
217
  }) => id === 'name');
219
218
  updatedEntity && setPageTitle(updatedEntity.value);
220
- const isValidAndNewValueSet = isValid && isNewValueSet;
221
219
  const isNotValidOrNotNewValueSet = !isValid || !isNewValueSet;
222
220
  if (componentIsMounted.current) {
223
221
  setIsFormValid(isValid);
224
222
  }
225
- if (isValidAndNewValueSet && componentIsMounted.current) {
223
+ if (isValid && isNewValueSet && componentIsMounted.current) {
226
224
  setIsSaveButtonAvailable(true);
227
225
  setSaveButtonText(SAVE_BUTTON_TEXTS.save);
228
226
  }
@@ -236,6 +234,9 @@ const Entity = ({
236
234
  const onSubmit = event => {
237
235
  event && event.preventDefault();
238
236
  if (!isSaveButtonAvailable) return null;
237
+ if (isCreatePage) {
238
+ setSuppressPrompt(true);
239
+ }
239
240
  const parsedFormValues = parseFormValues(formValues);
240
241
  const updatedFormValues = newUpdatedDate ? _objectSpread(_objectSpread({}, formData.values), {}, {
241
242
  update: newUpdatedDate
@@ -349,10 +350,8 @@ const Entity = ({
349
350
  const showModal = checkFulfilConditions(formData, modalStatus);
350
351
  const onViewUrlHandler = canViewPage(formData, entity, schema, entityIsPublished) ? () => onViewUrlClick(getFullUrl) : onViewUrl;
351
352
  const pageName = formData && formData.values && formData.values.name;
352
- const hasNewFormValues = checkFulfilConditions(isNewEntity, !isFormEmpty(formValues));
353
- const hasToDisplayPrompt = isSaveButtonAvailable || hasNewFormValues;
353
+ const hasToDisplayPrompt = isSaveButtonAvailable && !suppressPrompt;
354
354
  const showSideBarRelations = checkFulfilConditions(schema, formData);
355
- const showPageBuilderTabs = (schema === null || schema === void 0 ? void 0 : (_schema$interfaces = schema.interfaces) === null || _schema$interfaces === void 0 ? void 0 : _schema$interfaces.includes('page-builder/page-builder-template')) || (schema === null || schema === void 0 ? void 0 : (_schema$interfaces2 = schema.interfaces) === null || _schema$interfaces2 === void 0 ? void 0 : _schema$interfaces2.includes('page-builder/page-builder'));
356
355
  return /*#__PURE__*/React.createElement(RecordEditContextProvider, {
357
356
  value: {
358
357
  externalUpdateTime,
@@ -393,7 +392,7 @@ const Entity = ({
393
392
  copyAction: onCopy,
394
393
  getFormData: getFormData
395
394
  }), /*#__PURE__*/React.createElement("div", {
396
- className: `page__content--fixed${!isRightSidebarOpen ? ' right-sidebar-collapsed' : ''}`
395
+ className: `page__content${!isRightSidebarOpen ? ' right-sidebar-collapsed' : ''}`
397
396
  }, /*#__PURE__*/React.createElement("div", {
398
397
  className: "page__content"
399
398
  }, /*#__PURE__*/React.createElement("div", {
@@ -405,18 +404,7 @@ const Entity = ({
405
404
  }), /*#__PURE__*/React.createElement(InfoBoxes, {
406
405
  id: entity.id,
407
406
  schema: schema
408
- }), /*#__PURE__*/React.createElement(Tabs, {
409
- enabled: showPageBuilderTabs,
410
- onTabChange: tabId => {
411
- client.writeQuery({
412
- query: GET_CURRENT_TAB_ID,
413
- data: {
414
- currentTabId: tabId
415
- }
416
- });
417
- setCurrentTabId(tabId);
418
- }
419
- }, /*#__PURE__*/React.createElement(FormBuilder, {
407
+ }), /*#__PURE__*/React.createElement(FormBuilder, {
420
408
  getIsFormValid: setIsFormValid,
421
409
  getFormValues: getFormValues,
422
410
  schema: schema,
@@ -426,8 +414,9 @@ const Entity = ({
426
414
  updateCopyData: updateCopyData,
427
415
  formValues: formValues,
428
416
  isNewEntity: isNewEntity,
429
- onExternalUpdate: setExternalUpdateTime
430
- })), /*#__PURE__*/React.createElement(RenderHook, {
417
+ onExternalUpdate: setExternalUpdateTime,
418
+ mode: isNewEntity ? 'create' : 'update'
419
+ }), /*#__PURE__*/React.createElement(RenderHook, {
431
420
  hookKey: `entity:${action}:main:bottom`,
432
421
  entity: entity,
433
422
  schema: schema