@blaze-cms/plugin-data-ui 0.146.0-node18-core-styles-tooltips.44 → 0.146.0-node18-core-styles-tooltips.45

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 (148) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/package.json +5 -5
  3. package/lib-es/components/EntityDataListing/EntityDataListing.js +0 -33
  4. package/lib-es/components/EntityDataListing/EntityDataListing.js.map +0 -1
  5. package/lib-es/components/EntityDataListing/index.js +0 -3
  6. package/lib-es/components/EntityDataListing/index.js.map +0 -1
  7. package/lib-es/components/EntityManager/Entity/EntitiyNavLinks/EntityNavLinks.js +0 -30
  8. package/lib-es/components/EntityManager/Entity/EntitiyNavLinks/EntityNavLinks.js.map +0 -1
  9. package/lib-es/components/EntityManager/Entity/EntitiyNavLinks/index.js +0 -3
  10. package/lib-es/components/EntityManager/Entity/EntitiyNavLinks/index.js.map +0 -1
  11. package/lib-es/components/EntityManager/Entity/Entity.js +0 -452
  12. package/lib-es/components/EntityManager/Entity/Entity.js.map +0 -1
  13. package/lib-es/components/EntityManager/Entity/EntityHeader/EntityHeader.js +0 -103
  14. package/lib-es/components/EntityManager/Entity/EntityHeader/EntityHeader.js.map +0 -1
  15. package/lib-es/components/EntityManager/Entity/EntityHeader/HeaderPreviewButton/HeaderPreviewButton.js +0 -47
  16. package/lib-es/components/EntityManager/Entity/EntityHeader/HeaderPreviewButton/HeaderPreviewButton.js.map +0 -1
  17. package/lib-es/components/EntityManager/Entity/EntityHeader/HeaderPreviewButton/index.js +0 -3
  18. package/lib-es/components/EntityManager/Entity/EntityHeader/HeaderPreviewButton/index.js.map +0 -1
  19. package/lib-es/components/EntityManager/Entity/EntityHeader/index.js +0 -3
  20. package/lib-es/components/EntityManager/Entity/EntityHeader/index.js.map +0 -1
  21. package/lib-es/components/EntityManager/Entity/SideBarRelations/container/CustomSidebarInfoContainer.js +0 -30
  22. package/lib-es/components/EntityManager/Entity/SideBarRelations/container/CustomSidebarInfoContainer.js.map +0 -1
  23. package/lib-es/components/EntityManager/Entity/SideBarRelations/helpers/build-dynamic-query.js +0 -29
  24. package/lib-es/components/EntityManager/Entity/SideBarRelations/helpers/build-dynamic-query.js.map +0 -1
  25. package/lib-es/components/EntityManager/Entity/SideBarRelations/hooks/useCustomSidebarData.js +0 -49
  26. package/lib-es/components/EntityManager/Entity/SideBarRelations/hooks/useCustomSidebarData.js.map +0 -1
  27. package/lib-es/components/EntityManager/Entity/SideBarRelations/index.js +0 -133
  28. package/lib-es/components/EntityManager/Entity/SideBarRelations/index.js.map +0 -1
  29. package/lib-es/components/EntityManager/Entity/SideBarRelations/presentational/CustomSidebarInfo.js +0 -36
  30. package/lib-es/components/EntityManager/Entity/SideBarRelations/presentational/CustomSidebarInfo.js.map +0 -1
  31. package/lib-es/components/EntityManager/Entity/actions-handlers/create/index.js +0 -5
  32. package/lib-es/components/EntityManager/Entity/actions-handlers/create/index.js.map +0 -1
  33. package/lib-es/components/EntityManager/Entity/actions-handlers/create/submit.js +0 -46
  34. package/lib-es/components/EntityManager/Entity/actions-handlers/create/submit.js.map +0 -1
  35. package/lib-es/components/EntityManager/Entity/actions-handlers/delete/delete.js +0 -32
  36. package/lib-es/components/EntityManager/Entity/actions-handlers/delete/delete.js.map +0 -1
  37. package/lib-es/components/EntityManager/Entity/actions-handlers/delete/index.js +0 -5
  38. package/lib-es/components/EntityManager/Entity/actions-handlers/delete/index.js.map +0 -1
  39. package/lib-es/components/EntityManager/Entity/actions-handlers/index.js +0 -12
  40. package/lib-es/components/EntityManager/Entity/actions-handlers/index.js.map +0 -1
  41. package/lib-es/components/EntityManager/Entity/actions-handlers/shared/index.js +0 -5
  42. package/lib-es/components/EntityManager/Entity/actions-handlers/shared/index.js.map +0 -1
  43. package/lib-es/components/EntityManager/Entity/actions-handlers/shared/publish.js +0 -39
  44. package/lib-es/components/EntityManager/Entity/actions-handlers/shared/publish.js.map +0 -1
  45. package/lib-es/components/EntityManager/Entity/actions-handlers/update/index.js +0 -5
  46. package/lib-es/components/EntityManager/Entity/actions-handlers/update/index.js.map +0 -1
  47. package/lib-es/components/EntityManager/Entity/actions-handlers/update/submit.js +0 -53
  48. package/lib-es/components/EntityManager/Entity/actions-handlers/update/submit.js.map +0 -1
  49. package/lib-es/components/EntityManager/Entity/index.js +0 -3
  50. package/lib-es/components/EntityManager/Entity/index.js.map +0 -1
  51. package/lib-es/components/EntityManager/EntityManager.js +0 -133
  52. package/lib-es/components/EntityManager/EntityManager.js.map +0 -1
  53. package/lib-es/components/EntityManager/index.js +0 -3
  54. package/lib-es/components/EntityManager/index.js.map +0 -1
  55. package/lib-es/components/EntityManager/utils/RecordEditContext/index.js +0 -6
  56. package/lib-es/components/EntityManager/utils/RecordEditContext/index.js.map +0 -1
  57. package/lib-es/components/EntityManager/utils/data-mappers.js +0 -55
  58. package/lib-es/components/EntityManager/utils/data-mappers.js.map +0 -1
  59. package/lib-es/components/EntityManager/utils/entity.js +0 -70
  60. package/lib-es/components/EntityManager/utils/entity.js.map +0 -1
  61. package/lib-es/components/EntityManager/utils/entityAvailableActions.js +0 -56
  62. package/lib-es/components/EntityManager/utils/entityAvailableActions.js.map +0 -1
  63. package/lib-es/components/EntityManager/utils/is-form-empty.js +0 -9
  64. package/lib-es/components/EntityManager/utils/is-form-empty.js.map +0 -1
  65. package/lib-es/components/EntityManager/utils/query.js +0 -23
  66. package/lib-es/components/EntityManager/utils/query.js.map +0 -1
  67. package/lib-es/components/InfoBoxes/InfoBoxTooltip.js +0 -36
  68. package/lib-es/components/InfoBoxes/InfoBoxTooltip.js.map +0 -1
  69. package/lib-es/components/InfoBoxes/InfoBoxes.js +0 -28
  70. package/lib-es/components/InfoBoxes/InfoBoxes.js.map +0 -1
  71. package/lib-es/components/InfoBoxes/container/InfoBoxContainer.js +0 -38
  72. package/lib-es/components/InfoBoxes/container/InfoBoxContainer.js.map +0 -1
  73. package/lib-es/components/InfoBoxes/helpers/build-dynamic-query.js +0 -28
  74. package/lib-es/components/InfoBoxes/helpers/build-dynamic-query.js.map +0 -1
  75. package/lib-es/components/InfoBoxes/hooks/useData.js +0 -39
  76. package/lib-es/components/InfoBoxes/hooks/useData.js.map +0 -1
  77. package/lib-es/components/InfoBoxes/hooks/useInfoBox.js +0 -17
  78. package/lib-es/components/InfoBoxes/hooks/useInfoBox.js.map +0 -1
  79. package/lib-es/components/InfoBoxes/index.js +0 -3
  80. package/lib-es/components/InfoBoxes/index.js.map +0 -1
  81. package/lib-es/components/InfoBoxes/presentational/InfoBox.js +0 -40
  82. package/lib-es/components/InfoBoxes/presentational/InfoBox.js.map +0 -1
  83. package/lib-es/components/InfoBoxes/presentational/InfoBoxLabel.js +0 -12
  84. package/lib-es/components/InfoBoxes/presentational/InfoBoxLabel.js.map +0 -1
  85. package/lib-es/components/InfoBoxes/presentational/InfoBoxValue.js +0 -30
  86. package/lib-es/components/InfoBoxes/presentational/InfoBoxValue.js.map +0 -1
  87. package/lib-es/components/ListingTable/ListingTable.js +0 -208
  88. package/lib-es/components/ListingTable/ListingTable.js.map +0 -1
  89. package/lib-es/components/ListingTable/ListingTableContent/ListingTableContent.js +0 -72
  90. package/lib-es/components/ListingTable/ListingTableContent/ListingTableContent.js.map +0 -1
  91. package/lib-es/components/ListingTable/ListingTableContent/index.js +0 -3
  92. package/lib-es/components/ListingTable/ListingTableContent/index.js.map +0 -1
  93. package/lib-es/components/ListingTable/SearchFilter/SearchContainer.js +0 -207
  94. package/lib-es/components/ListingTable/SearchFilter/SearchContainer.js.map +0 -1
  95. package/lib-es/components/ListingTable/SearchFilter/SearchFilter.js +0 -40
  96. package/lib-es/components/ListingTable/SearchFilter/SearchFilter.js.map +0 -1
  97. package/lib-es/components/ListingTable/SearchFilter/helpers.js +0 -96
  98. package/lib-es/components/ListingTable/SearchFilter/helpers.js.map +0 -1
  99. package/lib-es/components/ListingTable/SearchFilter/querys.js +0 -8
  100. package/lib-es/components/ListingTable/SearchFilter/querys.js.map +0 -1
  101. package/lib-es/components/ListingTable/TableActions/TableActions.js +0 -34
  102. package/lib-es/components/ListingTable/TableActions/TableActions.js.map +0 -1
  103. package/lib-es/components/ListingTable/TableActions/index.js +0 -3
  104. package/lib-es/components/ListingTable/TableActions/index.js.map +0 -1
  105. package/lib-es/components/ListingTable/index.js +0 -3
  106. package/lib-es/components/ListingTable/index.js.map +0 -1
  107. package/lib-es/components/ListingTable/mappers/populate-rows.js +0 -140
  108. package/lib-es/components/ListingTable/mappers/populate-rows.js.map +0 -1
  109. package/lib-es/components/ListingTable/service/index.js +0 -87
  110. package/lib-es/components/ListingTable/service/index.js.map +0 -1
  111. package/lib-es/components/Tabs/index.js +0 -40
  112. package/lib-es/components/Tabs/index.js.map +0 -1
  113. package/lib-es/components/hooks/useCallbackDebounce.js +0 -12
  114. package/lib-es/components/hooks/useCallbackDebounce.js.map +0 -1
  115. package/lib-es/constants.js +0 -42
  116. package/lib-es/constants.js.map +0 -1
  117. package/lib-es/icons/ContentIcon.js +0 -80
  118. package/lib-es/icons/ContentIcon.js.map +0 -1
  119. package/lib-es/icons/SettingsIcon.js +0 -36
  120. package/lib-es/icons/SettingsIcon.js.map +0 -1
  121. package/lib-es/icons/TaxonomyIcon.js +0 -60
  122. package/lib-es/icons/TaxonomyIcon.js.map +0 -1
  123. package/lib-es/icons/UsersIcon.js +0 -33
  124. package/lib-es/icons/UsersIcon.js.map +0 -1
  125. package/lib-es/icons/index.js +0 -6
  126. package/lib-es/icons/index.js.map +0 -1
  127. package/lib-es/index.js +0 -84
  128. package/lib-es/index.js.map +0 -1
  129. package/lib-es/utils/add-content-menu-items.js +0 -72
  130. package/lib-es/utils/add-content-menu-items.js.map +0 -1
  131. package/lib-es/utils/build-create-entity-mutation.js +0 -21
  132. package/lib-es/utils/build-create-entity-mutation.js.map +0 -1
  133. package/lib-es/utils/build-delete-entity-mutation.js +0 -18
  134. package/lib-es/utils/build-delete-entity-mutation.js.map +0 -1
  135. package/lib-es/utils/build-listing-query.js +0 -28
  136. package/lib-es/utils/build-listing-query.js.map +0 -1
  137. package/lib-es/utils/build-update-data-query.js +0 -24
  138. package/lib-es/utils/build-update-data-query.js.map +0 -1
  139. package/lib-es/utils/build-update-publish-unpublish-mutation.js +0 -22
  140. package/lib-es/utils/build-update-publish-unpublish-mutation.js.map +0 -1
  141. package/lib-es/utils/get-default-query-params.js +0 -17
  142. package/lib-es/utils/get-default-query-params.js.map +0 -1
  143. package/lib-es/utils/hoc/withContext.js +0 -8
  144. package/lib-es/utils/hoc/withContext.js.map +0 -1
  145. package/lib-es/utils/hooks/useToggle.js +0 -8
  146. package/lib-es/utils/hooks/useToggle.js.map +0 -1
  147. package/lib-es/utils/index.js +0 -3
  148. package/lib-es/utils/index.js.map +0 -1
package/CHANGELOG.md CHANGED
@@ -3,6 +3,14 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ # [0.146.0-node18-core-styles-tooltips.45](https://github.com/thebyte9/blaze/compare/v0.146.0-node18-core-styles-tooltips.44...v0.146.0-node18-core-styles-tooltips.45) (2026-01-15)
7
+
8
+ **Note:** Version bump only for package @blaze-cms/plugin-data-ui
9
+
10
+
11
+
12
+
13
+
6
14
  # [0.146.0-node18-core-styles-tooltips.44](https://github.com/thebyte9/blaze/compare/v0.146.0-node18-core-styles-tooltips.43...v0.146.0-node18-core-styles-tooltips.44) (2026-01-02)
7
15
 
8
16
  **Note:** Version bump only for package @blaze-cms/plugin-data-ui
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blaze-cms/plugin-data-ui",
3
- "version": "0.146.0-node18-core-styles-tooltips.44",
3
+ "version": "0.146.0-node18-core-styles-tooltips.45",
4
4
  "description": "Blaze plugin data ui",
5
5
  "main": "lib/index.js",
6
6
  "module": "lib-es/index.js",
@@ -27,11 +27,11 @@
27
27
  },
28
28
  "license": "GPL-3.0",
29
29
  "dependencies": {
30
- "@blaze-cms/admin-ui-utils": "0.146.0-node18-core-styles-tooltips.44",
30
+ "@blaze-cms/admin-ui-utils": "0.146.0-node18-core-styles-tooltips.45",
31
31
  "@blaze-cms/core-errors": "0.146.0-node18-core-styles-tooltips.3",
32
32
  "@blaze-cms/plugin-render-hooks-ui": "0.146.0-node18-core-styles-tooltips.3",
33
- "@blaze-cms/react-form-builder": "0.146.0-node18-core-styles-tooltips.44",
34
- "@blaze-cms/react-page-builder": "0.146.0-node18-core-styles-tooltips.44",
33
+ "@blaze-cms/react-form-builder": "0.146.0-node18-core-styles-tooltips.45",
34
+ "@blaze-cms/react-page-builder": "0.146.0-node18-core-styles-tooltips.45",
35
35
  "@blaze-cms/setup-ui": "0.146.0-node18-core-styles-tooltips.3",
36
36
  "@blaze-cms/versioning-ui": "0.146.0-node18-core-styles-tooltips.44",
37
37
  "@blaze-react/button": "0.8.0-alpha.82",
@@ -69,5 +69,5 @@
69
69
  "lib/*",
70
70
  "lib-es/*"
71
71
  ],
72
- "gitHead": "5d3c5f6eb153a4e8a915f0741261f379cbcd2c46"
72
+ "gitHead": "ddfab9ac3d59438939268c106917b092e4071071"
73
73
  }
@@ -1,33 +0,0 @@
1
- import { useQuery } from '@apollo/client';
2
- import React from 'react';
3
- import PropTypes from 'prop-types';
4
- import { getQuery } from '@blaze-cms/admin-ui-utils';
5
- import ListingTable from '../ListingTable/ListingTable';
6
- import { withContext } from '../../utils/hoc/withContext';
7
- const EntityDataListing = ({
8
- match
9
- }) => {
10
- const {
11
- params: {
12
- entityIdentifier: identifier
13
- }
14
- } = match;
15
- const {
16
- data: {
17
- getEntitySchemas = []
18
- } = {}
19
- } = useQuery(getQuery('GET_ENTITY_SCHEMA'), {
20
- variables: {
21
- identifier
22
- }
23
- });
24
- if (!getEntitySchemas.length) return '';
25
- return /*#__PURE__*/React.createElement(ListingTable, {
26
- entitySchema: getEntitySchemas[0]
27
- });
28
- };
29
- EntityDataListing.propTypes = {
30
- match: PropTypes.object.isRequired
31
- };
32
- export default withContext(EntityDataListing);
33
- //# sourceMappingURL=EntityDataListing.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"EntityDataListing.js","names":["useQuery","React","PropTypes","getQuery","ListingTable","withContext","EntityDataListing","match","params","entityIdentifier","identifier","data","getEntitySchemas","variables","length","createElement","entitySchema","propTypes","object","isRequired"],"sources":["../../../src/components/EntityDataListing/EntityDataListing.js"],"sourcesContent":["import { useQuery } from '@apollo/client';\nimport React from 'react';\nimport PropTypes from 'prop-types';\nimport { getQuery } from '@blaze-cms/admin-ui-utils';\n\nimport ListingTable from '../ListingTable/ListingTable';\nimport { withContext } from '../../utils/hoc/withContext';\n\nconst EntityDataListing = ({ match }) => {\n const {\n params: { entityIdentifier: identifier }\n } = match;\n\n const { data: { getEntitySchemas = [] } = {} } = useQuery(getQuery('GET_ENTITY_SCHEMA'), {\n variables: { identifier }\n });\n\n if (!getEntitySchemas.length) return '';\n\n return <ListingTable entitySchema={getEntitySchemas[0]} />;\n};\n\nEntityDataListing.propTypes = {\n match: PropTypes.object.isRequired\n};\n\nexport default withContext(EntityDataListing);\n"],"mappings":"AAAA,SAASA,QAAQ,QAAQ,gBAAgB;AACzC,OAAOC,KAAK,MAAM,OAAO;AACzB,OAAOC,SAAS,MAAM,YAAY;AAClC,SAASC,QAAQ,QAAQ,2BAA2B;AAEpD,OAAOC,YAAY,MAAM,8BAA8B;AACvD,SAASC,WAAW,QAAQ,6BAA6B;AAEzD,MAAMC,iBAAiB,GAAGA,CAAC;EAAEC;AAAM,CAAC,KAAK;EACvC,MAAM;IACJC,MAAM,EAAE;MAAEC,gBAAgB,EAAEC;IAAW;EACzC,CAAC,GAAGH,KAAK;EAET,MAAM;IAAEI,IAAI,EAAE;MAAEC,gBAAgB,GAAG;IAAG,CAAC,GAAG,CAAC;EAAE,CAAC,GAAGZ,QAAQ,CAACG,QAAQ,CAAC,mBAAmB,CAAC,EAAE;IACvFU,SAAS,EAAE;MAAEH;IAAW;EAC1B,CAAC,CAAC;EAEF,IAAI,CAACE,gBAAgB,CAACE,MAAM,EAAE,OAAO,EAAE;EAEvC,oBAAOb,KAAA,CAAAc,aAAA,CAACX,YAAY;IAACY,YAAY,EAAEJ,gBAAgB,CAAC,CAAC;EAAE,CAAE,CAAC;AAC5D,CAAC;AAEDN,iBAAiB,CAACW,SAAS,GAAG;EAC5BV,KAAK,EAAEL,SAAS,CAACgB,MAAM,CAACC;AAC1B,CAAC;AAED,eAAed,WAAW,CAACC,iBAAiB,CAAC","ignoreList":[]}
@@ -1,3 +0,0 @@
1
- import EntityDataListing from './EntityDataListing';
2
- export default EntityDataListing;
3
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","names":["EntityDataListing"],"sources":["../../../src/components/EntityDataListing/index.js"],"sourcesContent":["import EntityDataListing from './EntityDataListing';\n\nexport default EntityDataListing;\n"],"mappings":"AAAA,OAAOA,iBAAiB,MAAM,qBAAqB;AAEnD,eAAeA,iBAAiB","ignoreList":[]}
@@ -1,30 +0,0 @@
1
- import { Link } from 'react-router-dom';
2
- import React from 'react';
3
- const EntityNavLinks = ({
4
- schema
5
- }) => {
6
- if (!schema) return null;
7
- const {
8
- displayProperties: {
9
- adminSectionNavigation
10
- }
11
- } = schema;
12
- if (!adminSectionNavigation) return null;
13
- const links = Object.entries(adminSectionNavigation).map(([k, v]) => {
14
- const {
15
- label,
16
- uri
17
- } = v;
18
- const Wrapper = uri.startsWith('#') ? 'a' : Link;
19
- return /*#__PURE__*/React.createElement(Wrapper, {
20
- className: "entity-section-link",
21
- href: uri,
22
- to: uri
23
- }, label);
24
- });
25
- return /*#__PURE__*/React.createElement("div", {
26
- className: "entity-section-links"
27
- }, links);
28
- };
29
- export default EntityNavLinks;
30
- //# sourceMappingURL=EntityNavLinks.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"EntityNavLinks.js","names":["Link","React","EntityNavLinks","schema","displayProperties","adminSectionNavigation","links","Object","entries","map","k","v","label","uri","Wrapper","startsWith","createElement","className","href","to"],"sources":["../../../../../src/components/EntityManager/Entity/EntitiyNavLinks/EntityNavLinks.js"],"sourcesContent":["import { Link } from 'react-router-dom';\nimport React from 'react';\n\nconst EntityNavLinks = ({ schema }) => {\n if (!schema) return null;\n\n const {\n displayProperties: { adminSectionNavigation }\n } = schema;\n\n if (!adminSectionNavigation) return null;\n\n const links = Object.entries(adminSectionNavigation).map(([k, v]) => {\n const { label, uri } = v;\n const Wrapper = uri.startsWith('#') ? 'a' : Link;\n\n return (\n <Wrapper className=\"entity-section-link\" href={uri} to={uri}>\n {label}\n </Wrapper>\n );\n });\n\n return <div className=\"entity-section-links\">{links}</div>;\n};\n\nexport default EntityNavLinks;\n"],"mappings":"AAAA,SAASA,IAAI,QAAQ,kBAAkB;AACvC,OAAOC,KAAK,MAAM,OAAO;AAEzB,MAAMC,cAAc,GAAGA,CAAC;EAAEC;AAAO,CAAC,KAAK;EACrC,IAAI,CAACA,MAAM,EAAE,OAAO,IAAI;EAExB,MAAM;IACJC,iBAAiB,EAAE;MAAEC;IAAuB;EAC9C,CAAC,GAAGF,MAAM;EAEV,IAAI,CAACE,sBAAsB,EAAE,OAAO,IAAI;EAExC,MAAMC,KAAK,GAAGC,MAAM,CAACC,OAAO,CAACH,sBAAsB,CAAC,CAACI,GAAG,CAAC,CAAC,CAACC,CAAC,EAAEC,CAAC,CAAC,KAAK;IACnE,MAAM;MAAEC,KAAK;MAAEC;IAAI,CAAC,GAAGF,CAAC;IACxB,MAAMG,OAAO,GAAGD,GAAG,CAACE,UAAU,CAAC,GAAG,CAAC,GAAG,GAAG,GAAGf,IAAI;IAEhD,oBACEC,KAAA,CAAAe,aAAA,CAACF,OAAO;MAACG,SAAS,EAAC,qBAAqB;MAACC,IAAI,EAAEL,GAAI;MAACM,EAAE,EAAEN;IAAI,GACzDD,KACM,CAAC;EAEd,CAAC,CAAC;EAEF,oBAAOX,KAAA,CAAAe,aAAA;IAAKC,SAAS,EAAC;EAAsB,GAAEX,KAAW,CAAC;AAC5D,CAAC;AAED,eAAeJ,cAAc","ignoreList":[]}
@@ -1,3 +0,0 @@
1
- import EntityNavLinks from './EntityNavLinks';
2
- export default EntityNavLinks;
3
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","names":["EntityNavLinks"],"sources":["../../../../../src/components/EntityManager/Entity/EntitiyNavLinks/index.js"],"sourcesContent":["import EntityNavLinks from './EntityNavLinks';\n\nexport default EntityNavLinks;\n"],"mappings":"AAAA,OAAOA,cAAc,MAAM,kBAAkB;AAE7C,eAAeA,cAAc","ignoreList":[]}
@@ -1,452 +0,0 @@
1
- import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
- import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
3
- const _excluded = ["isValid", "fields", "isNewValueSet", "valuesChecked", "currentField", "value"];
4
- function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
5
- function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
6
- /* eslint-disable no-undef */
7
- import React, { useEffect, useState, useRef } from 'react';
8
- import { withRouter, Prompt } from 'react-router-dom';
9
- import { useApolloClient } from '@apollo/client';
10
- import PropTypes from 'prop-types';
11
- import { RenderHook } from '@blaze-cms/plugin-render-hooks-ui';
12
- import { getQuery } from '@blaze-cms/admin-ui-utils';
13
- import { FormBuilder, parseFormValues } from '@blaze-cms/react-form-builder';
14
- import { DeleteAction, CopyDataFromAction } from '@blaze-cms/admin';
15
- import { useToasts } from '@blaze-react/toaster';
16
- import cloneDeep from 'lodash.clonedeep';
17
- import { getPageName } from '../utils/data-mappers';
18
- import availableActions from './actions-handlers';
19
- import SideBarRelations from './SideBarRelations';
20
- import useCallbackDebounce from '../../hooks/useCallbackDebounce';
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';
22
- import EntityHeader from './EntityHeader';
23
- import { validateSideBarRelations, canViewPage, onViewUrlClick, getUpdatedFormValues, checkFulfilConditions } from '../utils/entity';
24
- import useToggle from '../../../utils/hooks/useToggle';
25
- import InfoBoxes from '../../InfoBoxes/InfoBoxes';
26
- import { RecordEditContextProvider } from '../utils/RecordEditContext';
27
- const Entity = ({
28
- formData,
29
- entity,
30
- schema,
31
- previousQuery,
32
- action,
33
- history,
34
- updateFormData,
35
- onViewUrl,
36
- refetchRecord
37
- }) => {
38
- var _formData$values;
39
- const [formValues, setFormValues] = useState(null);
40
- const [entitySchema, setEntitySchema] = useState(null);
41
- const [entityData, setEntityData] = useState(null);
42
- const [entityIdentifier, setEntityIdentifier] = useState(null);
43
- const [pageTitle, setPageTitle] = useState('');
44
- const [isSaveButtonAvailable, setIsSaveButtonAvailable] = useState(false);
45
- const [entityIsPublished, setEntityIsPublish] = useState(formData && formData.values && formData.values.status);
46
- const [isEnablePublishButton, setEnablePublishButton] = useState(false);
47
- const [isEnablePreviewButton, setEnablePreviewButton] = useState(false);
48
- const [modalStatus, setModalStatus] = useToggle(false);
49
- const [copyModalStatus, setCopyModalStatus] = useToggle(false);
50
- const [pageBuilderTemplateStatus, setPageBuilderTemplateStatus] = useState(true);
51
- const [shouldCopyData, setShouldCopyData] = useState(false);
52
- const [isFormValid, setIsFormValid] = useState(false);
53
- const [formDataFromCopy, setFormDataFromCopy] = useState(null);
54
- const [newUpdatedDate, setNewUpdatedDate] = useState(null);
55
- const [saveButtonText, setSaveButtonText] = useState(SAVE_BUTTON_TEXTS.save);
56
- const [externalUpdateTime, setExternalUpdateTime] = useState(null);
57
- const [suppressPrompt, setSuppressPrompt] = useState(false);
58
- const [isRightSidebarOpen, setIsRightSidebarOpen] = useState(true);
59
- const handleToggleRightSidebar = () => setIsRightSidebarOpen(!isRightSidebarOpen);
60
- const isCreatePage = history.location.pathname.includes('create');
61
- const [isNewEntity, setIsNewEntity] = useState(isCreatePage);
62
- const client = useApolloClient();
63
- const shouldUpdateState = !entityIdentifier || checkFulfilConditions(entity, schema, previousQuery, !entityData) || entityData && entityData.id !== entity.id;
64
- const clonedFormData = cloneDeep(formData);
65
- const {
66
- addToast
67
- } = useToasts();
68
-
69
- // Here's how we'll keep track of our component's mounted state
70
- const componentIsMounted = useRef(true);
71
- const {
72
- displayProperties: {
73
- saveOnChange = false
74
- }
75
- } = schema;
76
- useCallbackDebounce(() => {
77
- isSaveButtonAvailable && onSubmit();
78
- }, 500, [isSaveButtonAvailable], !saveOnChange);
79
- useEffect(() => () => {
80
- componentIsMounted.current = false;
81
- }, []); // Using an empty dependency array ensures this only runs on unmount
82
-
83
- useEffect(() => {
84
- if (shouldUpdateState) {
85
- setSaveButtonText(SAVE_BUTTON_TEXTS.save);
86
- setEntityData(entity);
87
- setPageTitle(getPageName(schema.displayProperties, entity));
88
- setEntityIsPublish(entity.status);
89
- setEntitySchema(schema);
90
- setEnablePublishButton(schema.actions.publish);
91
- setEntityIdentifier(schema.identifier);
92
- setEnablePreviewButton(!!schema.interfaces.includes(PREVIEW_INTERFACE));
93
- }
94
- if (formData && pageBuilderTemplateStatus) {
95
- const isPageBuilderTemplateSet = !!formData.values.pageBuilderTemplateId;
96
- client.writeQuery({
97
- query: getQuery('GET_PB_TEMPLATE_STATUS'),
98
- data: {
99
- pageBuilderTemplateSet: isPageBuilderTemplateSet,
100
- pageBuilderTemplateId: formData.values.pageBuilderTemplateId || ''
101
- }
102
- });
103
- }
104
- if (schema) {
105
- client.writeQuery({
106
- query: getQuery('GET_CURRENT_ENTITY'),
107
- data: {
108
- currentEntity: schema.id,
109
- currentItemId: entity ? entity.id : null
110
- }
111
- });
112
- }
113
- }, [client, entity, entityData, formData, formValues, pageBuilderTemplateStatus, previousQuery, schema, shouldUpdateState]);
114
- const getFullUrl = async () => {
115
- const query = getQuery('GET_ENTITY_URL');
116
- const {
117
- data: {
118
- getEntityUrl = ''
119
- } = {}
120
- } = await client.query({
121
- query,
122
- variables: {
123
- itemId: entity.id,
124
- itemEntity: schema.id,
125
- fullUrl: true
126
- },
127
- fetchPolicy: 'network-only'
128
- });
129
- return getEntityUrl;
130
- };
131
- const getFormValues = values => {
132
- if (componentIsMounted.current) {
133
- setFormValues(values);
134
- }
135
- };
136
- const onChangeSideBarRelations = ({
137
- id,
138
- value
139
- }, requiredChildField) => {
140
- const updatedFormValues = getUpdatedFormValues({
141
- id,
142
- value,
143
- requiredChildField,
144
- formValues
145
- });
146
- const shouldActiveSaveButton = validateSideBarRelations(updatedFormValues, requiredChildField);
147
- if (isFormValid && shouldActiveSaveButton && componentIsMounted.current) {
148
- setIsSaveButtonAvailable(true);
149
- setSaveButtonText(SAVE_BUTTON_TEXTS.save);
150
- } else if (componentIsMounted.current) {
151
- setIsSaveButtonAvailable(false);
152
- }
153
- if (componentIsMounted.current) {
154
- setFormValues(updatedFormValues);
155
- }
156
- };
157
- const onChangeFormValues = async _ref => {
158
- let {
159
- isValid,
160
- fields,
161
- isNewValueSet,
162
- valuesChecked,
163
- currentField,
164
- value: fieldValue
165
- } = _ref,
166
- otherProps = _objectWithoutProperties(_ref, _excluded);
167
- let updatedFormValues = valuesChecked ? valuesChecked.slice() : [];
168
- if (currentField === PAGE_BUILDER_TEMPLATE_FIELD_ID) {
169
- const pageBuilderTemplateId = fieldValue;
170
- client.writeQuery({
171
- query: getQuery('GET_PB_TEMPLATE_STATUS'),
172
- data: {
173
- pageBuilderTemplateSet: !!pageBuilderTemplateId,
174
- pageBuilderTemplateId
175
- }
176
- });
177
- if (componentIsMounted.current) {
178
- setPageBuilderTemplateStatus(false);
179
- }
180
- const pageBuilder = updatedFormValues.filter(formValue => formValue.id === PAGE_BUILDER_FIELD_ID);
181
- if (pageBuilderTemplateId) {
182
- const {
183
- data = {}
184
- } = await client.query({
185
- query: getQuery('MERGE_PB_TEMPLATE_CHANGES'),
186
- variables: {
187
- parent: {
188
- pageBuilder: pageBuilder[0].value,
189
- pageBuilderTemplateId
190
- },
191
- entityIdentifier
192
- }
193
- });
194
- if (data && data.mergePageBuilderTemplateChanges) {
195
- updatedFormValues = updatedFormValues.map(updatedFormValue => {
196
- if (updatedFormValue.id === PAGE_BUILDER_FIELD_ID) {
197
- return _objectSpread(_objectSpread({}, updatedFormValue), {}, {
198
- value: data.mergePageBuilderTemplateChanges
199
- });
200
- }
201
- return updatedFormValue;
202
- });
203
- }
204
- }
205
- }
206
- const itemsToAdd = [];
207
- if (formValues && formValues.length > updatedFormValues.length) {
208
- [...updatedFormValues, ...formValues].forEach(item => {
209
- const index = updatedFormValues.findIndex(value => value.id === item.id);
210
- if (index === -1) {
211
- itemsToAdd.push(item);
212
- }
213
- });
214
- }
215
- const [updatedEntity = null] = fields.filter(({
216
- id
217
- }) => id === 'name');
218
- updatedEntity && setPageTitle(updatedEntity.value);
219
- const isNotValidOrNotNewValueSet = !isValid || !isNewValueSet;
220
- if (componentIsMounted.current) {
221
- setIsFormValid(isValid);
222
- }
223
- if (isValid && isNewValueSet && componentIsMounted.current) {
224
- setIsSaveButtonAvailable(true);
225
- setSaveButtonText(SAVE_BUTTON_TEXTS.save);
226
- }
227
- if (isNotValidOrNotNewValueSet && componentIsMounted.current) {
228
- setIsSaveButtonAvailable(false);
229
- }
230
- if (componentIsMounted.current) {
231
- setFormValues([...updatedFormValues, ...itemsToAdd]);
232
- }
233
- };
234
- const onSubmit = event => {
235
- event && event.preventDefault();
236
- if (!isSaveButtonAvailable) return null;
237
- if (isCreatePage) {
238
- setSuppressPrompt(true);
239
- }
240
- const parsedFormValues = parseFormValues(formValues);
241
- const updatedFormValues = newUpdatedDate ? _objectSpread(_objectSpread({}, formData.values), {}, {
242
- update: newUpdatedDate
243
- }) : _objectSpread({}, formData.values);
244
- const handleUpdateFormData = () => updateFormData({
245
- values: _objectSpread(_objectSpread({}, updatedFormValues), parsedFormValues)
246
- }, true);
247
- const submitParams = {
248
- update: {
249
- entitySchema,
250
- entityData,
251
- parsedFormValues,
252
- client,
253
- setIsSaveButtonAvailable,
254
- setNewUpdatedDate,
255
- newUpdatedDate,
256
- previousQuery,
257
- setSaveButtonText,
258
- handleUpdateFormData
259
- },
260
- create: {
261
- entitySchema,
262
- parsedFormValues,
263
- client,
264
- setEntityData,
265
- setIsSaveButtonAvailable,
266
- history,
267
- setIsNewEntity,
268
- setSaveButtonText,
269
- handleUpdateFormData
270
- }
271
- };
272
- const currentAction = submitParams[action];
273
- return availableActions[action].submit(currentAction, addToast);
274
- };
275
- const onDelete = async () => {
276
- const {
277
- values: {
278
- id
279
- }
280
- } = formData;
281
- if (componentIsMounted.current) {
282
- setIsSaveButtonAvailable(false);
283
- }
284
- await availableActions.delete.submit({
285
- entitySchema,
286
- client,
287
- parsedFormValues: {
288
- id
289
- }
290
- }, addToast);
291
- history.push(`/data-listing/${entitySchema.id}`);
292
- };
293
- const onCopy = () => {
294
- if (formDataFromCopy && componentIsMounted.current) {
295
- updateFormData(formDataFromCopy);
296
- setShouldCopyData(true);
297
- setIsSaveButtonAvailable(true);
298
- setSaveButtonText(SAVE_BUTTON_TEXTS.save);
299
- if (formDataFromCopy.values.name) {
300
- setPageTitle(formDataFromCopy.values.name);
301
- }
302
- }
303
- };
304
- const updateCopyData = () => {
305
- setCopyModalStatus(!copyModalStatus);
306
- setShouldCopyData(false);
307
- };
308
- const handleCopyDataFromClose = () => {
309
- setCopyModalStatus(false);
310
- setFormDataFromCopy(null);
311
- };
312
- const getFormData = formDataValues => {
313
- const formDataUpdated = {
314
- values: _objectSpread({}, formDataValues)
315
- };
316
- setFormDataFromCopy(formDataUpdated);
317
- };
318
- const handlePublishAndUnpublish = async ({
319
- target: {
320
- textContent
321
- }
322
- }) => {
323
- const isPublishButton = textContent === TEXT_CONTENT_TYPE;
324
- const isPublished = entityIsPublished === ENTITY_PUBLISHED;
325
- const isUnpublish = checkFulfilConditions(!isPublishButton, !isPublished);
326
- if (isUnpublish) {
327
- return addToast(UNPUBLISHED_WARNING, {
328
- appearance: 'warning',
329
- autoDismiss: true
330
- });
331
- }
332
- if (checkFulfilConditions(isPublishButton, isSaveButtonAvailable)) {
333
- const savedPageMessage = await onSubmit();
334
- if (savedPageMessage === ERROR) {
335
- return addToast(`Content not published`, {
336
- appearance: ERROR,
337
- autoDismiss: true
338
- });
339
- }
340
- }
341
- return availableActions.shared.triggerPublish({
342
- entityData,
343
- client,
344
- setEntityIsPublish,
345
- entitySchema,
346
- textContent,
347
- refetchRecord
348
- }, addToast);
349
- };
350
- const showModal = checkFulfilConditions(formData, modalStatus);
351
- const onViewUrlHandler = canViewPage(formData, entity, schema, entityIsPublished) ? () => onViewUrlClick(getFullUrl) : onViewUrl;
352
- const pageName = formData && formData.values && formData.values.name;
353
- const hasToDisplayPrompt = isSaveButtonAvailable && !suppressPrompt;
354
- const showSideBarRelations = checkFulfilConditions(schema, formData);
355
- return /*#__PURE__*/React.createElement(RecordEditContextProvider, {
356
- value: {
357
- externalUpdateTime,
358
- updated: formData === null || formData === void 0 ? void 0 : (_formData$values = formData.values) === null || _formData$values === void 0 ? void 0 : _formData$values.updated
359
- }
360
- }, /*#__PURE__*/React.createElement("div", {
361
- className: "page"
362
- }, /*#__PURE__*/React.createElement(EntityHeader, {
363
- entityData: entityData,
364
- entityIdentifier: entityIdentifier,
365
- pageTitle: pageTitle,
366
- pageName: pageName,
367
- onSubmit: onSubmit,
368
- handlePublishAndUnpublish: handlePublishAndUnpublish,
369
- isSaveButtonAvailable: isSaveButtonAvailable,
370
- isEnablePublishButton: isEnablePublishButton,
371
- isEnablePreviewButton: isEnablePreviewButton,
372
- toggleCopyModal: setCopyModalStatus,
373
- toggleModal: setModalStatus,
374
- formData: formData,
375
- onViewUrl: onViewUrlHandler,
376
- saveButtonText: saveButtonText,
377
- saveOnChange: saveOnChange,
378
- entitySchema: entitySchema
379
- }), /*#__PURE__*/React.createElement("div", {
380
- className: "page-wrapper__content"
381
- }, /*#__PURE__*/React.createElement("div", {
382
- className: "tabs-wrapper tabs-wrapper__tab"
383
- }, /*#__PURE__*/React.createElement(Prompt, {
384
- when: hasToDisplayPrompt,
385
- message: LEAVE_PAGE_MESSAGE
386
- }), showModal && /*#__PURE__*/React.createElement(DeleteAction, {
387
- onClose: setModalStatus,
388
- deleteAction: onDelete,
389
- itemName: formData.values.name
390
- }), copyModalStatus && /*#__PURE__*/React.createElement(CopyDataFromAction, {
391
- onClose: handleCopyDataFromClose,
392
- copyAction: onCopy,
393
- getFormData: getFormData
394
- }), /*#__PURE__*/React.createElement("div", {
395
- className: `page__content${!isRightSidebarOpen ? ' right-sidebar-collapsed' : ''}`
396
- }, /*#__PURE__*/React.createElement("div", {
397
- className: "page__content"
398
- }, /*#__PURE__*/React.createElement("div", {
399
- className: "content"
400
- }, /*#__PURE__*/React.createElement(RenderHook, {
401
- hookKey: `entity:${action}:main:top`,
402
- entity: entity,
403
- schema: schema
404
- }), /*#__PURE__*/React.createElement(InfoBoxes, {
405
- id: entity.id,
406
- schema: schema
407
- }), /*#__PURE__*/React.createElement(FormBuilder, {
408
- getIsFormValid: setIsFormValid,
409
- getFormValues: getFormValues,
410
- schema: schema,
411
- data: clonedFormData,
412
- onChange: onChangeFormValues,
413
- shouldCopyData: shouldCopyData,
414
- updateCopyData: updateCopyData,
415
- formValues: formValues,
416
- isNewEntity: isNewEntity,
417
- onExternalUpdate: setExternalUpdateTime
418
- }), /*#__PURE__*/React.createElement(RenderHook, {
419
- hookKey: `entity:${action}:main:bottom`,
420
- entity: entity,
421
- schema: schema
422
- }))))), /*#__PURE__*/React.createElement("div", {
423
- className: `column column--one-third page-sidebar page-sidebar--relations${!isRightSidebarOpen ? ' sidebar--collapsed' : ''}`
424
- }, showSideBarRelations && /*#__PURE__*/React.createElement(SideBarRelations, {
425
- entity: entity,
426
- formData: formData.values,
427
- schema: schema,
428
- onChange: onChangeSideBarRelations,
429
- isOpen: isRightSidebarOpen,
430
- onToggle: handleToggleRightSidebar
431
- })))));
432
- };
433
- Entity.propTypes = {
434
- entity: PropTypes.object,
435
- schema: PropTypes.object,
436
- previousQuery: PropTypes.object,
437
- action: PropTypes.string.isRequired,
438
- history: PropTypes.object.isRequired,
439
- formData: PropTypes.object,
440
- updateFormData: PropTypes.func.isRequired,
441
- onViewUrl: PropTypes.func,
442
- refetchRecord: PropTypes.func.isRequired
443
- };
444
- Entity.defaultProps = {
445
- previousQuery: null,
446
- schema: null,
447
- entity: null,
448
- formData: null,
449
- onViewUrl: null
450
- };
451
- export default withRouter(Entity);
452
- //# sourceMappingURL=Entity.js.map