@blaze-cms/plugin-data-ui 0.146.0-node18.0 → 0.146.0-rc-eagle.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +30 -5
- package/README.md +57 -0
- package/lib/components/EntityDataListing/EntityDataListing.js +21 -19
- package/lib/components/EntityDataListing/EntityDataListing.js.map +1 -1
- package/lib/components/EntityDataListing/index.js +2 -3
- package/lib/components/EntityDataListing/index.js.map +1 -1
- package/lib/components/EntityManager/Entity/EntitiyNavLinks/EntityNavLinks.js +18 -20
- package/lib/components/EntityManager/Entity/EntitiyNavLinks/EntityNavLinks.js.map +1 -1
- package/lib/components/EntityManager/Entity/EntitiyNavLinks/index.js +2 -3
- package/lib/components/EntityManager/Entity/EntitiyNavLinks/index.js.map +1 -1
- package/lib/components/EntityManager/Entity/Entity.js +289 -452
- package/lib/components/EntityManager/Entity/Entity.js.map +1 -1
- package/lib/components/EntityManager/Entity/EntityHeader/EntityHeader.js +62 -66
- package/lib/components/EntityManager/Entity/EntityHeader/EntityHeader.js.map +1 -1
- package/lib/components/EntityManager/Entity/EntityHeader/HeaderPreviewButton/HeaderPreviewButton.js +34 -50
- package/lib/components/EntityManager/Entity/EntityHeader/HeaderPreviewButton/HeaderPreviewButton.js.map +1 -1
- package/lib/components/EntityManager/Entity/EntityHeader/HeaderPreviewButton/index.js +2 -3
- package/lib/components/EntityManager/Entity/EntityHeader/HeaderPreviewButton/index.js.map +1 -1
- package/lib/components/EntityManager/Entity/EntityHeader/index.js +2 -3
- package/lib/components/EntityManager/Entity/EntityHeader/index.js.map +1 -1
- package/lib/components/EntityManager/Entity/SideBarRelations/container/CustomSidebarInfoContainer.js +20 -26
- package/lib/components/EntityManager/Entity/SideBarRelations/container/CustomSidebarInfoContainer.js.map +1 -1
- package/lib/components/EntityManager/Entity/SideBarRelations/helpers/build-dynamic-query.js +20 -18
- package/lib/components/EntityManager/Entity/SideBarRelations/helpers/build-dynamic-query.js.map +1 -1
- package/lib/components/EntityManager/Entity/SideBarRelations/hooks/useCustomSidebarData.js +34 -32
- package/lib/components/EntityManager/Entity/SideBarRelations/hooks/useCustomSidebarData.js.map +1 -1
- package/lib/components/EntityManager/Entity/SideBarRelations/index.js +104 -150
- package/lib/components/EntityManager/Entity/SideBarRelations/index.js.map +1 -1
- package/lib/components/EntityManager/Entity/SideBarRelations/presentational/CustomSidebarInfo.js +24 -24
- package/lib/components/EntityManager/Entity/SideBarRelations/presentational/CustomSidebarInfo.js.map +1 -1
- package/lib/components/EntityManager/Entity/actions-handlers/create/index.js +2 -3
- package/lib/components/EntityManager/Entity/actions-handlers/create/index.js.map +1 -1
- package/lib/components/EntityManager/Entity/actions-handlers/create/submit.js +42 -56
- package/lib/components/EntityManager/Entity/actions-handlers/create/submit.js.map +1 -1
- package/lib/components/EntityManager/Entity/actions-handlers/delete/delete.js +29 -45
- package/lib/components/EntityManager/Entity/actions-handlers/delete/delete.js.map +1 -1
- package/lib/components/EntityManager/Entity/actions-handlers/delete/index.js +2 -3
- package/lib/components/EntityManager/Entity/actions-handlers/delete/index.js.map +1 -1
- package/lib/components/EntityManager/Entity/actions-handlers/index.js +7 -8
- package/lib/components/EntityManager/Entity/actions-handlers/index.js.map +1 -1
- package/lib/components/EntityManager/Entity/actions-handlers/shared/index.js +2 -3
- package/lib/components/EntityManager/Entity/actions-handlers/shared/index.js.map +1 -1
- package/lib/components/EntityManager/Entity/actions-handlers/shared/publish.js +36 -57
- package/lib/components/EntityManager/Entity/actions-handlers/shared/publish.js.map +1 -1
- package/lib/components/EntityManager/Entity/actions-handlers/update/index.js +2 -3
- package/lib/components/EntityManager/Entity/actions-handlers/update/index.js.map +1 -1
- package/lib/components/EntityManager/Entity/actions-handlers/update/submit.js +47 -66
- package/lib/components/EntityManager/Entity/actions-handlers/update/submit.js.map +1 -1
- package/lib/components/EntityManager/Entity/index.js +2 -3
- package/lib/components/EntityManager/Entity/index.js.map +1 -1
- package/lib/components/EntityManager/EntityManager.js +91 -166
- package/lib/components/EntityManager/EntityManager.js.map +1 -1
- package/lib/components/EntityManager/index.js +2 -3
- package/lib/components/EntityManager/index.js.map +1 -1
- package/lib/components/EntityManager/utils/RecordEditContext/index.js +3 -4
- package/lib/components/EntityManager/utils/RecordEditContext/index.js.map +1 -1
- package/lib/components/EntityManager/utils/data-mappers.js +34 -46
- package/lib/components/EntityManager/utils/data-mappers.js.map +1 -1
- package/lib/components/EntityManager/utils/entity.js +35 -73
- package/lib/components/EntityManager/utils/entity.js.map +1 -1
- package/lib/components/EntityManager/utils/entityAvailableActions.js +51 -110
- package/lib/components/EntityManager/utils/entityAvailableActions.js.map +1 -1
- package/lib/components/EntityManager/utils/is-form-empty.js +6 -10
- package/lib/components/EntityManager/utils/is-form-empty.js.map +1 -1
- package/lib/components/EntityManager/utils/query.js +17 -10
- package/lib/components/EntityManager/utils/query.js.map +1 -1
- package/lib/components/InfoBoxes/InfoBoxTooltip.js +43 -0
- package/lib/components/InfoBoxes/InfoBoxTooltip.js.map +1 -0
- package/lib/components/InfoBoxes/InfoBoxes.js +19 -20
- package/lib/components/InfoBoxes/InfoBoxes.js.map +1 -1
- package/lib/components/InfoBoxes/container/InfoBoxContainer.js +26 -38
- package/lib/components/InfoBoxes/container/InfoBoxContainer.js.map +1 -1
- package/lib/components/InfoBoxes/helpers/build-dynamic-query.js +21 -17
- package/lib/components/InfoBoxes/helpers/build-dynamic-query.js.map +1 -1
- package/lib/components/InfoBoxes/hooks/useData.js +33 -30
- package/lib/components/InfoBoxes/hooks/useData.js.map +1 -1
- package/lib/components/InfoBoxes/hooks/useInfoBox.js +10 -10
- package/lib/components/InfoBoxes/hooks/useInfoBox.js.map +1 -1
- package/lib/components/InfoBoxes/index.js +2 -3
- package/lib/components/InfoBoxes/index.js.map +1 -1
- package/lib/components/InfoBoxes/presentational/InfoBox.js +28 -32
- package/lib/components/InfoBoxes/presentational/InfoBox.js.map +1 -1
- package/lib/components/InfoBoxes/presentational/InfoBoxLabel.js +11 -12
- package/lib/components/InfoBoxes/presentational/InfoBoxLabel.js.map +1 -1
- package/lib/components/InfoBoxes/presentational/InfoBoxValue.js +12 -12
- package/lib/components/InfoBoxes/presentational/InfoBoxValue.js.map +1 -1
- package/lib/components/ListingTable/ListingTable.js +163 -303
- package/lib/components/ListingTable/ListingTable.js.map +1 -1
- package/lib/components/ListingTable/ListingTableContent/ListingTableContent.js +61 -40
- package/lib/components/ListingTable/ListingTableContent/ListingTableContent.js.map +1 -1
- package/lib/components/ListingTable/ListingTableContent/index.js +2 -3
- package/lib/components/ListingTable/ListingTableContent/index.js.map +1 -1
- package/lib/components/ListingTable/SearchFilter/SearchContainer.js +215 -0
- package/lib/components/ListingTable/SearchFilter/SearchContainer.js.map +1 -0
- package/lib/components/ListingTable/SearchFilter/SearchFilter.js +48 -0
- package/lib/components/ListingTable/SearchFilter/SearchFilter.js.map +1 -0
- package/lib/components/ListingTable/SearchFilter/helpers.js +105 -0
- package/lib/components/ListingTable/SearchFilter/helpers.js.map +1 -0
- package/lib/components/ListingTable/SearchFilter/querys.js +13 -0
- package/lib/components/ListingTable/SearchFilter/querys.js.map +1 -0
- package/lib/components/ListingTable/TableActions/TableActions.js +27 -31
- package/lib/components/ListingTable/TableActions/TableActions.js.map +1 -1
- package/lib/components/ListingTable/TableActions/index.js +2 -3
- package/lib/components/ListingTable/TableActions/index.js.map +1 -1
- package/lib/components/ListingTable/index.js +2 -3
- package/lib/components/ListingTable/index.js.map +1 -1
- package/lib/components/ListingTable/mappers/populate-rows.js +104 -120
- package/lib/components/ListingTable/mappers/populate-rows.js.map +1 -1
- package/lib/components/ListingTable/service/index.js +66 -84
- package/lib/components/ListingTable/service/index.js.map +1 -1
- package/lib/components/Tabs/index.js +26 -42
- package/lib/components/Tabs/index.js.map +1 -1
- package/lib/components/hooks/useCallbackDebounce.js +5 -9
- package/lib/components/hooks/useCallbackDebounce.js.map +1 -1
- package/lib/constants.js +31 -29
- package/lib/constants.js.map +1 -1
- package/lib/icons/ContentIcon.js +17 -20
- package/lib/icons/ContentIcon.js.map +1 -1
- package/lib/icons/SettingsIcon.js +12 -15
- package/lib/icons/SettingsIcon.js.map +1 -1
- package/lib/icons/TaxonomyIcon.js +15 -18
- package/lib/icons/TaxonomyIcon.js.map +1 -1
- package/lib/icons/UsersIcon.js +11 -14
- package/lib/icons/UsersIcon.js.map +1 -1
- package/lib/icons/index.js +8 -9
- package/lib/icons/index.js.map +1 -1
- package/lib/index.js +81 -121
- package/lib/index.js.map +1 -1
- package/lib/utils/add-content-menu-items.js +67 -93
- package/lib/utils/add-content-menu-items.js.map +1 -1
- package/lib/utils/build-create-entity-mutation.js +12 -9
- package/lib/utils/build-create-entity-mutation.js.map +1 -1
- package/lib/utils/build-delete-entity-mutation.js +11 -8
- package/lib/utils/build-delete-entity-mutation.js.map +1 -1
- package/lib/utils/build-listing-query.js +20 -17
- package/lib/utils/build-listing-query.js.map +1 -1
- package/lib/utils/build-update-data-query.js +15 -9
- package/lib/utils/build-update-data-query.js.map +1 -1
- package/lib/utils/build-update-publish-unpublish-mutation.js +15 -8
- package/lib/utils/build-update-publish-unpublish-mutation.js.map +1 -1
- package/lib/utils/get-default-query-params.js +7 -6
- package/lib/utils/get-default-query-params.js.map +1 -1
- package/lib/utils/hoc/withContext.js +4 -6
- package/lib/utils/hoc/withContext.js.map +1 -1
- package/lib/utils/hooks/useToggle.js +4 -12
- package/lib/utils/hooks/useToggle.js.map +1 -1
- package/lib/utils/index.js +2 -3
- package/lib/utils/index.js.map +1 -1
- package/package.json +17 -17
- package/src/components/EntityManager/Entity/Entity.js +34 -39
- package/src/components/EntityManager/Entity/EntityHeader/HeaderPreviewButton/HeaderPreviewButton.js +8 -1
- package/src/components/EntityManager/Entity/SideBarRelations/helpers/build-dynamic-query.js +2 -0
- package/src/components/EntityManager/Entity/SideBarRelations/index.js +51 -17
- package/src/components/EntityManager/Entity/SideBarRelations/presentational/CustomSidebarInfo.js +5 -3
- package/src/components/EntityManager/utils/entity.js +13 -2
- package/src/components/InfoBoxes/InfoBoxTooltip.js +32 -0
- package/src/components/InfoBoxes/helpers/build-dynamic-query.js +2 -0
- package/src/components/InfoBoxes/presentational/InfoBox.js +4 -2
- package/src/components/ListingTable/ListingTable.js +13 -18
- package/src/components/ListingTable/ListingTableContent/ListingTableContent.js +43 -25
- package/src/components/ListingTable/SearchFilter/SearchContainer.js +228 -0
- package/src/components/ListingTable/SearchFilter/SearchFilter.js +38 -0
- package/src/components/ListingTable/SearchFilter/helpers.js +99 -0
- package/src/components/ListingTable/SearchFilter/querys.js +9 -0
- package/src/components/ListingTable/mappers/populate-rows.js +3 -0
- package/src/components/ListingTable/service/index.js +2 -2
- package/src/components/Tabs/index.js +17 -21
- package/src/constants.js +9 -1
- package/src/index.js +9 -7
- package/src/utils/build-listing-query.js +4 -4
- package/src/utils/hoc/withContext.js +5 -4
- package/lib-es/components/EntityDataListing/EntityDataListing.js +0 -33
- package/lib-es/components/EntityDataListing/EntityDataListing.js.map +0 -1
- package/lib-es/components/EntityDataListing/index.js +0 -3
- package/lib-es/components/EntityDataListing/index.js.map +0 -1
- package/lib-es/components/EntityManager/Entity/EntitiyNavLinks/EntityNavLinks.js +0 -30
- package/lib-es/components/EntityManager/Entity/EntitiyNavLinks/EntityNavLinks.js.map +0 -1
- package/lib-es/components/EntityManager/Entity/EntitiyNavLinks/index.js +0 -3
- package/lib-es/components/EntityManager/Entity/EntitiyNavLinks/index.js.map +0 -1
- package/lib-es/components/EntityManager/Entity/Entity.js +0 -460
- package/lib-es/components/EntityManager/Entity/Entity.js.map +0 -1
- package/lib-es/components/EntityManager/Entity/EntityHeader/EntityHeader.js +0 -103
- package/lib-es/components/EntityManager/Entity/EntityHeader/EntityHeader.js.map +0 -1
- package/lib-es/components/EntityManager/Entity/EntityHeader/HeaderPreviewButton/HeaderPreviewButton.js +0 -42
- package/lib-es/components/EntityManager/Entity/EntityHeader/HeaderPreviewButton/HeaderPreviewButton.js.map +0 -1
- package/lib-es/components/EntityManager/Entity/EntityHeader/HeaderPreviewButton/index.js +0 -3
- package/lib-es/components/EntityManager/Entity/EntityHeader/HeaderPreviewButton/index.js.map +0 -1
- package/lib-es/components/EntityManager/Entity/EntityHeader/index.js +0 -3
- package/lib-es/components/EntityManager/Entity/EntityHeader/index.js.map +0 -1
- package/lib-es/components/EntityManager/Entity/SideBarRelations/container/CustomSidebarInfoContainer.js +0 -30
- package/lib-es/components/EntityManager/Entity/SideBarRelations/container/CustomSidebarInfoContainer.js.map +0 -1
- package/lib-es/components/EntityManager/Entity/SideBarRelations/helpers/build-dynamic-query.js +0 -27
- package/lib-es/components/EntityManager/Entity/SideBarRelations/helpers/build-dynamic-query.js.map +0 -1
- package/lib-es/components/EntityManager/Entity/SideBarRelations/hooks/useCustomSidebarData.js +0 -49
- package/lib-es/components/EntityManager/Entity/SideBarRelations/hooks/useCustomSidebarData.js.map +0 -1
- package/lib-es/components/EntityManager/Entity/SideBarRelations/index.js +0 -117
- package/lib-es/components/EntityManager/Entity/SideBarRelations/index.js.map +0 -1
- package/lib-es/components/EntityManager/Entity/SideBarRelations/presentational/CustomSidebarInfo.js +0 -30
- package/lib-es/components/EntityManager/Entity/SideBarRelations/presentational/CustomSidebarInfo.js.map +0 -1
- package/lib-es/components/EntityManager/Entity/actions-handlers/create/index.js +0 -5
- package/lib-es/components/EntityManager/Entity/actions-handlers/create/index.js.map +0 -1
- package/lib-es/components/EntityManager/Entity/actions-handlers/create/submit.js +0 -46
- package/lib-es/components/EntityManager/Entity/actions-handlers/create/submit.js.map +0 -1
- package/lib-es/components/EntityManager/Entity/actions-handlers/delete/delete.js +0 -32
- package/lib-es/components/EntityManager/Entity/actions-handlers/delete/delete.js.map +0 -1
- package/lib-es/components/EntityManager/Entity/actions-handlers/delete/index.js +0 -5
- package/lib-es/components/EntityManager/Entity/actions-handlers/delete/index.js.map +0 -1
- package/lib-es/components/EntityManager/Entity/actions-handlers/index.js +0 -12
- package/lib-es/components/EntityManager/Entity/actions-handlers/index.js.map +0 -1
- package/lib-es/components/EntityManager/Entity/actions-handlers/shared/index.js +0 -5
- package/lib-es/components/EntityManager/Entity/actions-handlers/shared/index.js.map +0 -1
- package/lib-es/components/EntityManager/Entity/actions-handlers/shared/publish.js +0 -39
- package/lib-es/components/EntityManager/Entity/actions-handlers/shared/publish.js.map +0 -1
- package/lib-es/components/EntityManager/Entity/actions-handlers/update/index.js +0 -5
- package/lib-es/components/EntityManager/Entity/actions-handlers/update/index.js.map +0 -1
- package/lib-es/components/EntityManager/Entity/actions-handlers/update/submit.js +0 -53
- package/lib-es/components/EntityManager/Entity/actions-handlers/update/submit.js.map +0 -1
- package/lib-es/components/EntityManager/Entity/index.js +0 -3
- package/lib-es/components/EntityManager/Entity/index.js.map +0 -1
- package/lib-es/components/EntityManager/EntityManager.js +0 -133
- package/lib-es/components/EntityManager/EntityManager.js.map +0 -1
- package/lib-es/components/EntityManager/index.js +0 -3
- package/lib-es/components/EntityManager/index.js.map +0 -1
- package/lib-es/components/EntityManager/utils/RecordEditContext/index.js +0 -6
- package/lib-es/components/EntityManager/utils/RecordEditContext/index.js.map +0 -1
- package/lib-es/components/EntityManager/utils/data-mappers.js +0 -55
- package/lib-es/components/EntityManager/utils/data-mappers.js.map +0 -1
- package/lib-es/components/EntityManager/utils/entity.js +0 -66
- package/lib-es/components/EntityManager/utils/entity.js.map +0 -1
- package/lib-es/components/EntityManager/utils/entityAvailableActions.js +0 -56
- package/lib-es/components/EntityManager/utils/entityAvailableActions.js.map +0 -1
- package/lib-es/components/EntityManager/utils/is-form-empty.js +0 -9
- package/lib-es/components/EntityManager/utils/is-form-empty.js.map +0 -1
- package/lib-es/components/EntityManager/utils/query.js +0 -23
- package/lib-es/components/EntityManager/utils/query.js.map +0 -1
- package/lib-es/components/InfoBoxes/InfoBoxes.js +0 -28
- package/lib-es/components/InfoBoxes/InfoBoxes.js.map +0 -1
- package/lib-es/components/InfoBoxes/container/InfoBoxContainer.js +0 -38
- package/lib-es/components/InfoBoxes/container/InfoBoxContainer.js.map +0 -1
- package/lib-es/components/InfoBoxes/helpers/build-dynamic-query.js +0 -26
- package/lib-es/components/InfoBoxes/helpers/build-dynamic-query.js.map +0 -1
- package/lib-es/components/InfoBoxes/hooks/useData.js +0 -39
- package/lib-es/components/InfoBoxes/hooks/useData.js.map +0 -1
- package/lib-es/components/InfoBoxes/hooks/useInfoBox.js +0 -17
- package/lib-es/components/InfoBoxes/hooks/useInfoBox.js.map +0 -1
- package/lib-es/components/InfoBoxes/index.js +0 -3
- package/lib-es/components/InfoBoxes/index.js.map +0 -1
- package/lib-es/components/InfoBoxes/presentational/InfoBox.js +0 -37
- package/lib-es/components/InfoBoxes/presentational/InfoBox.js.map +0 -1
- package/lib-es/components/InfoBoxes/presentational/InfoBoxLabel.js +0 -12
- package/lib-es/components/InfoBoxes/presentational/InfoBoxLabel.js.map +0 -1
- package/lib-es/components/InfoBoxes/presentational/InfoBoxValue.js +0 -30
- package/lib-es/components/InfoBoxes/presentational/InfoBoxValue.js.map +0 -1
- package/lib-es/components/ListingTable/ListingTable.js +0 -207
- package/lib-es/components/ListingTable/ListingTable.js.map +0 -1
- package/lib-es/components/ListingTable/ListingTableContent/ListingTableContent.js +0 -54
- package/lib-es/components/ListingTable/ListingTableContent/ListingTableContent.js.map +0 -1
- package/lib-es/components/ListingTable/ListingTableContent/index.js +0 -3
- package/lib-es/components/ListingTable/ListingTableContent/index.js.map +0 -1
- package/lib-es/components/ListingTable/TableActions/TableActions.js +0 -34
- package/lib-es/components/ListingTable/TableActions/TableActions.js.map +0 -1
- package/lib-es/components/ListingTable/TableActions/index.js +0 -3
- package/lib-es/components/ListingTable/TableActions/index.js.map +0 -1
- package/lib-es/components/ListingTable/index.js +0 -3
- package/lib-es/components/ListingTable/index.js.map +0 -1
- package/lib-es/components/ListingTable/mappers/populate-rows.js +0 -137
- package/lib-es/components/ListingTable/mappers/populate-rows.js.map +0 -1
- package/lib-es/components/ListingTable/service/index.js +0 -86
- package/lib-es/components/ListingTable/service/index.js.map +0 -1
- package/lib-es/components/Tabs/index.js +0 -39
- package/lib-es/components/Tabs/index.js.map +0 -1
- package/lib-es/components/hooks/useCallbackDebounce.js +0 -12
- package/lib-es/components/hooks/useCallbackDebounce.js.map +0 -1
- package/lib-es/constants.js +0 -39
- package/lib-es/constants.js.map +0 -1
- package/lib-es/icons/ContentIcon.js +0 -80
- package/lib-es/icons/ContentIcon.js.map +0 -1
- package/lib-es/icons/SettingsIcon.js +0 -36
- package/lib-es/icons/SettingsIcon.js.map +0 -1
- package/lib-es/icons/TaxonomyIcon.js +0 -60
- package/lib-es/icons/TaxonomyIcon.js.map +0 -1
- package/lib-es/icons/UsersIcon.js +0 -33
- package/lib-es/icons/UsersIcon.js.map +0 -1
- package/lib-es/icons/index.js +0 -6
- package/lib-es/icons/index.js.map +0 -1
- package/lib-es/index.js +0 -84
- package/lib-es/index.js.map +0 -1
- package/lib-es/utils/add-content-menu-items.js +0 -72
- package/lib-es/utils/add-content-menu-items.js.map +0 -1
- package/lib-es/utils/build-create-entity-mutation.js +0 -21
- package/lib-es/utils/build-create-entity-mutation.js.map +0 -1
- package/lib-es/utils/build-delete-entity-mutation.js +0 -18
- package/lib-es/utils/build-delete-entity-mutation.js.map +0 -1
- package/lib-es/utils/build-listing-query.js +0 -28
- package/lib-es/utils/build-listing-query.js.map +0 -1
- package/lib-es/utils/build-update-data-query.js +0 -24
- package/lib-es/utils/build-update-data-query.js.map +0 -1
- package/lib-es/utils/build-update-publish-unpublish-mutation.js +0 -22
- package/lib-es/utils/build-update-publish-unpublish-mutation.js.map +0 -1
- package/lib-es/utils/get-default-query-params.js +0 -17
- package/lib-es/utils/get-default-query-params.js.map +0 -1
- package/lib-es/utils/hoc/withContext.js +0 -8
- package/lib-es/utils/hoc/withContext.js.map +0 -1
- package/lib-es/utils/hooks/useToggle.js +0 -8
- package/lib-es/utils/hooks/useToggle.js.map +0 -1
- package/lib-es/utils/index.js +0 -3
- package/lib-es/utils/index.js.map +0 -1
package/lib-es/icons/index.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["UserIcon","TaxonomyIcon","ContentIcon","SettingsIcon"],"sources":["../../src/icons/index.js"],"sourcesContent":["import UserIcon from './UsersIcon';\nimport TaxonomyIcon from './TaxonomyIcon';\nimport ContentIcon from './ContentIcon';\nimport SettingsIcon from './SettingsIcon';\n\nexport { UserIcon, TaxonomyIcon, ContentIcon, SettingsIcon };\n"],"mappings":"AAAA,OAAOA,QAAQ,MAAM,aAAa;AAClC,OAAOC,YAAY,MAAM,gBAAgB;AACzC,OAAOC,WAAW,MAAM,eAAe;AACvC,OAAOC,YAAY,MAAM,gBAAgB;AAEzC,SAASH,QAAQ,EAAEC,YAAY,EAAEC,WAAW,EAAEC,YAAY","ignoreList":[]}
|
package/lib-es/index.js
DELETED
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
import { getFormBuilderLookup, formFieldTypes } from '@blaze-cms/react-form-builder';
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import pkg from '../package.json';
|
|
4
|
-
import { DATA_LISTING_PREFIX, PLUGIN_NAME } from './constants';
|
|
5
|
-
import getAddContentMenuItems from './utils/add-content-menu-items';
|
|
6
|
-
import { UserIcon, TaxonomyIcon, ContentIcon, SettingsIcon } from './icons';
|
|
7
|
-
const EntityDataListing = React.lazy(() => import(/* webpackChunkName: 'EntityDataListing' */'./components/EntityDataListing'));
|
|
8
|
-
const EntityManager = React.lazy(() => import(/* webpackChunkName: 'EntityManager' */'./components/EntityManager'));
|
|
9
|
-
export default async function load(app) {
|
|
10
|
-
app.events.once('admin:menu:config:load', getAddContentMenuItems(app));
|
|
11
|
-
app.events.once('load:custom:field:type', addFieldType => {
|
|
12
|
-
Object.keys(formFieldTypes).forEach(type => {
|
|
13
|
-
addFieldType({
|
|
14
|
-
type,
|
|
15
|
-
component: formFieldTypes[type]
|
|
16
|
-
});
|
|
17
|
-
});
|
|
18
|
-
});
|
|
19
|
-
app.events.once('plugin:data-ui:load:loaded', async () => {
|
|
20
|
-
await app.events.emitAsync('load:custom:field:type', getFormBuilderLookup.addFieldType);
|
|
21
|
-
});
|
|
22
|
-
app.events.once('admin:menu:config:load', ({
|
|
23
|
-
addConfig
|
|
24
|
-
}) => {
|
|
25
|
-
addConfig({
|
|
26
|
-
main: {
|
|
27
|
-
items: {
|
|
28
|
-
content: {
|
|
29
|
-
label: 'content',
|
|
30
|
-
loadOpen: true,
|
|
31
|
-
items: {},
|
|
32
|
-
icon: ContentIcon,
|
|
33
|
-
order: 10
|
|
34
|
-
},
|
|
35
|
-
taxonomy: {
|
|
36
|
-
label: 'Taxonomy',
|
|
37
|
-
items: {},
|
|
38
|
-
icon: TaxonomyIcon,
|
|
39
|
-
order: 40
|
|
40
|
-
},
|
|
41
|
-
user: {
|
|
42
|
-
label: 'User',
|
|
43
|
-
items: {},
|
|
44
|
-
icon: UserIcon,
|
|
45
|
-
order: 90
|
|
46
|
-
},
|
|
47
|
-
settings: {
|
|
48
|
-
label: 'Settings',
|
|
49
|
-
items: {},
|
|
50
|
-
icon: SettingsIcon,
|
|
51
|
-
order: 100
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
});
|
|
56
|
-
});
|
|
57
|
-
const entityDataListingRoute = {
|
|
58
|
-
path: `${DATA_LISTING_PREFIX}/:entityIdentifier`,
|
|
59
|
-
key: 'entityDataListing',
|
|
60
|
-
component: EntityDataListing,
|
|
61
|
-
exact: true
|
|
62
|
-
};
|
|
63
|
-
const editEntityRoute = {
|
|
64
|
-
path: `${DATA_LISTING_PREFIX}/:entityIdentifier/:action/:id`,
|
|
65
|
-
key: 'editEntity',
|
|
66
|
-
component: EntityManager,
|
|
67
|
-
exact: true
|
|
68
|
-
};
|
|
69
|
-
const addEntityRoute = {
|
|
70
|
-
path: `${DATA_LISTING_PREFIX}/:entityIdentifier/:action`,
|
|
71
|
-
key: 'createEntity',
|
|
72
|
-
component: EntityManager,
|
|
73
|
-
exact: true
|
|
74
|
-
};
|
|
75
|
-
app.addRoute(entityDataListingRoute);
|
|
76
|
-
app.addRoute(editEntityRoute);
|
|
77
|
-
app.addRoute(addEntityRoute);
|
|
78
|
-
return {
|
|
79
|
-
name: PLUGIN_NAME,
|
|
80
|
-
version: pkg.version
|
|
81
|
-
};
|
|
82
|
-
}
|
|
83
|
-
load.pluginName = PLUGIN_NAME;
|
|
84
|
-
//# sourceMappingURL=index.js.map
|
package/lib-es/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["getFormBuilderLookup","formFieldTypes","React","pkg","DATA_LISTING_PREFIX","PLUGIN_NAME","getAddContentMenuItems","UserIcon","TaxonomyIcon","ContentIcon","SettingsIcon","EntityDataListing","lazy","EntityManager","load","app","events","once","addFieldType","Object","keys","forEach","type","component","emitAsync","addConfig","main","items","content","label","loadOpen","icon","order","taxonomy","user","settings","entityDataListingRoute","path","key","exact","editEntityRoute","addEntityRoute","addRoute","name","version","pluginName"],"sources":["../src/index.js"],"sourcesContent":["import { getFormBuilderLookup, formFieldTypes } from '@blaze-cms/react-form-builder';\nimport React from 'react';\nimport pkg from '../package.json';\nimport { DATA_LISTING_PREFIX, PLUGIN_NAME } from './constants';\nimport getAddContentMenuItems from './utils/add-content-menu-items';\nimport { UserIcon, TaxonomyIcon, ContentIcon, SettingsIcon } from './icons';\n\nconst EntityDataListing = React.lazy(\n () => import(/* webpackChunkName: 'EntityDataListing' */ './components/EntityDataListing')\n);\nconst EntityManager = React.lazy(\n () => import(/* webpackChunkName: 'EntityManager' */ './components/EntityManager')\n);\n\nexport default async function load(app) {\n app.events.once('admin:menu:config:load', getAddContentMenuItems(app));\n\n app.events.once('load:custom:field:type', addFieldType => {\n Object.keys(formFieldTypes).forEach(type => {\n addFieldType({ type, component: formFieldTypes[type] });\n });\n });\n\n app.events.once('plugin:data-ui:load:loaded', async () => {\n await app.events.emitAsync('load:custom:field:type', getFormBuilderLookup.addFieldType);\n });\n\n app.events.once('admin:menu:config:load', ({ addConfig }) => {\n addConfig({\n main: {\n items: {\n content: {\n label: 'content',\n loadOpen: true,\n items: {},\n icon: ContentIcon,\n order: 10\n },\n taxonomy: {\n label: 'Taxonomy',\n items: {},\n icon: TaxonomyIcon,\n order: 40\n },\n user: {\n label: 'User',\n items: {},\n icon: UserIcon,\n order: 90\n },\n settings: {\n label: 'Settings',\n items: {},\n icon: SettingsIcon,\n order: 100\n }\n }\n }\n });\n });\n\n const entityDataListingRoute = {\n path: `${DATA_LISTING_PREFIX}/:entityIdentifier`,\n key: 'entityDataListing',\n component: EntityDataListing,\n exact: true\n };\n\n const editEntityRoute = {\n path: `${DATA_LISTING_PREFIX}/:entityIdentifier/:action/:id`,\n key: 'editEntity',\n component: EntityManager,\n exact: true\n };\n\n const addEntityRoute = {\n path: `${DATA_LISTING_PREFIX}/:entityIdentifier/:action`,\n key: 'createEntity',\n component: EntityManager,\n exact: true\n };\n\n app.addRoute(entityDataListingRoute);\n app.addRoute(editEntityRoute);\n app.addRoute(addEntityRoute);\n\n return {\n name: PLUGIN_NAME,\n version: pkg.version\n };\n}\n\nload.pluginName = PLUGIN_NAME;\n"],"mappings":"AAAA,SAASA,oBAAoB,EAAEC,cAAc,QAAQ,+BAA+B;AACpF,OAAOC,KAAK,MAAM,OAAO;AACzB,OAAOC,GAAG,MAAM,iBAAiB;AACjC,SAASC,mBAAmB,EAAEC,WAAW,QAAQ,aAAa;AAC9D,OAAOC,sBAAsB,MAAM,gCAAgC;AACnE,SAASC,QAAQ,EAAEC,YAAY,EAAEC,WAAW,EAAEC,YAAY,QAAQ,SAAS;AAE3E,MAAMC,iBAAiB,GAAGT,KAAK,CAACU,IAAI,CAClC,MAAM,MAAM,CAAC,2CAA4C,gCAAgC,CAC3F,CAAC;AACD,MAAMC,aAAa,GAAGX,KAAK,CAACU,IAAI,CAC9B,MAAM,MAAM,CAAC,uCAAwC,4BAA4B,CACnF,CAAC;AAED,eAAe,eAAeE,IAAIA,CAACC,GAAG,EAAE;EACtCA,GAAG,CAACC,MAAM,CAACC,IAAI,CAAC,wBAAwB,EAAEX,sBAAsB,CAACS,GAAG,CAAC,CAAC;EAEtEA,GAAG,CAACC,MAAM,CAACC,IAAI,CAAC,wBAAwB,EAAEC,YAAY,IAAI;IACxDC,MAAM,CAACC,IAAI,CAACnB,cAAc,CAAC,CAACoB,OAAO,CAACC,IAAI,IAAI;MAC1CJ,YAAY,CAAC;QAAEI,IAAI;QAAEC,SAAS,EAAEtB,cAAc,CAACqB,IAAI;MAAE,CAAC,CAAC;IACzD,CAAC,CAAC;EACJ,CAAC,CAAC;EAEFP,GAAG,CAACC,MAAM,CAACC,IAAI,CAAC,4BAA4B,EAAE,YAAY;IACxD,MAAMF,GAAG,CAACC,MAAM,CAACQ,SAAS,CAAC,wBAAwB,EAAExB,oBAAoB,CAACkB,YAAY,CAAC;EACzF,CAAC,CAAC;EAEFH,GAAG,CAACC,MAAM,CAACC,IAAI,CAAC,wBAAwB,EAAE,CAAC;IAAEQ;EAAU,CAAC,KAAK;IAC3DA,SAAS,CAAC;MACRC,IAAI,EAAE;QACJC,KAAK,EAAE;UACLC,OAAO,EAAE;YACPC,KAAK,EAAE,SAAS;YAChBC,QAAQ,EAAE,IAAI;YACdH,KAAK,EAAE,CAAC,CAAC;YACTI,IAAI,EAAEtB,WAAW;YACjBuB,KAAK,EAAE;UACT,CAAC;UACDC,QAAQ,EAAE;YACRJ,KAAK,EAAE,UAAU;YACjBF,KAAK,EAAE,CAAC,CAAC;YACTI,IAAI,EAAEvB,YAAY;YAClBwB,KAAK,EAAE;UACT,CAAC;UACDE,IAAI,EAAE;YACJL,KAAK,EAAE,MAAM;YACbF,KAAK,EAAE,CAAC,CAAC;YACTI,IAAI,EAAExB,QAAQ;YACdyB,KAAK,EAAE;UACT,CAAC;UACDG,QAAQ,EAAE;YACRN,KAAK,EAAE,UAAU;YACjBF,KAAK,EAAE,CAAC,CAAC;YACTI,IAAI,EAAErB,YAAY;YAClBsB,KAAK,EAAE;UACT;QACF;MACF;IACF,CAAC,CAAC;EACJ,CAAC,CAAC;EAEF,MAAMI,sBAAsB,GAAG;IAC7BC,IAAI,EAAE,GAAGjC,mBAAmB,oBAAoB;IAChDkC,GAAG,EAAE,mBAAmB;IACxBf,SAAS,EAAEZ,iBAAiB;IAC5B4B,KAAK,EAAE;EACT,CAAC;EAED,MAAMC,eAAe,GAAG;IACtBH,IAAI,EAAE,GAAGjC,mBAAmB,gCAAgC;IAC5DkC,GAAG,EAAE,YAAY;IACjBf,SAAS,EAAEV,aAAa;IACxB0B,KAAK,EAAE;EACT,CAAC;EAED,MAAME,cAAc,GAAG;IACrBJ,IAAI,EAAE,GAAGjC,mBAAmB,4BAA4B;IACxDkC,GAAG,EAAE,cAAc;IACnBf,SAAS,EAAEV,aAAa;IACxB0B,KAAK,EAAE;EACT,CAAC;EAEDxB,GAAG,CAAC2B,QAAQ,CAACN,sBAAsB,CAAC;EACpCrB,GAAG,CAAC2B,QAAQ,CAACF,eAAe,CAAC;EAC7BzB,GAAG,CAAC2B,QAAQ,CAACD,cAAc,CAAC;EAE5B,OAAO;IACLE,IAAI,EAAEtC,WAAW;IACjBuC,OAAO,EAAEzC,GAAG,CAACyC;EACf,CAAC;AACH;AAEA9B,IAAI,CAAC+B,UAAU,GAAGxC,WAAW","ignoreList":[]}
|
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
import { getQuery } from '@blaze-cms/admin-ui-utils';
|
|
2
|
-
const {
|
|
3
|
-
MENU_PERMISSIONS
|
|
4
|
-
} = require('../constants');
|
|
5
|
-
function getAddContentMenuItems(app) {
|
|
6
|
-
return async ({
|
|
7
|
-
addConfig
|
|
8
|
-
}) => {
|
|
9
|
-
const client = app.getClient();
|
|
10
|
-
const {
|
|
11
|
-
data: {
|
|
12
|
-
getEntitySchemas
|
|
13
|
-
}
|
|
14
|
-
} = await client.query({
|
|
15
|
-
query: getQuery('GET_USER_EDITABLE_ENTITIES'),
|
|
16
|
-
variables: {
|
|
17
|
-
// only return entities that the current user can do the following actions on
|
|
18
|
-
canDoActions: MENU_PERMISSIONS
|
|
19
|
-
}
|
|
20
|
-
});
|
|
21
|
-
if (!getEntitySchemas || !getEntitySchemas.length) return; // no items so don't add section
|
|
22
|
-
|
|
23
|
-
const menuItems = {};
|
|
24
|
-
const sectionMenuItems = {
|
|
25
|
-
settings: {}
|
|
26
|
-
};
|
|
27
|
-
getEntitySchemas.forEach(({
|
|
28
|
-
id,
|
|
29
|
-
displayName,
|
|
30
|
-
displayProperties
|
|
31
|
-
}) => {
|
|
32
|
-
if (!displayProperties) return null;
|
|
33
|
-
const {
|
|
34
|
-
adminMenu: {
|
|
35
|
-
sectionKey = 'settings'
|
|
36
|
-
} = {}
|
|
37
|
-
} = displayProperties;
|
|
38
|
-
const sectionItems = sectionMenuItems[sectionKey] || {};
|
|
39
|
-
sectionItems[id] = {
|
|
40
|
-
label: displayName,
|
|
41
|
-
uri: `/data-listing/${id}`
|
|
42
|
-
};
|
|
43
|
-
sectionMenuItems[sectionKey] = sectionItems;
|
|
44
|
-
});
|
|
45
|
-
const menuConfig = {
|
|
46
|
-
main: {
|
|
47
|
-
items: {
|
|
48
|
-
settings: {
|
|
49
|
-
items: menuItems
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
};
|
|
54
|
-
Object.entries(sectionMenuItems).forEach(([sectionKey, sectionItems]) => {
|
|
55
|
-
const sectionConfig = menuConfig.main.items[sectionKey] || {};
|
|
56
|
-
sectionConfig.items = sectionItems;
|
|
57
|
-
menuConfig.main.items[sectionKey] = sectionConfig;
|
|
58
|
-
});
|
|
59
|
-
getEntitySchemas.forEach(({
|
|
60
|
-
id,
|
|
61
|
-
displayName
|
|
62
|
-
}) => {
|
|
63
|
-
menuItems[id] = {
|
|
64
|
-
label: displayName,
|
|
65
|
-
uri: `/data-listing/${id}`
|
|
66
|
-
};
|
|
67
|
-
});
|
|
68
|
-
addConfig(menuConfig);
|
|
69
|
-
};
|
|
70
|
-
}
|
|
71
|
-
export default getAddContentMenuItems;
|
|
72
|
-
//# sourceMappingURL=add-content-menu-items.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"add-content-menu-items.js","names":["getQuery","MENU_PERMISSIONS","require","getAddContentMenuItems","app","addConfig","client","getClient","data","getEntitySchemas","query","variables","canDoActions","length","menuItems","sectionMenuItems","settings","forEach","id","displayName","displayProperties","adminMenu","sectionKey","sectionItems","label","uri","menuConfig","main","items","Object","entries","sectionConfig"],"sources":["../../src/utils/add-content-menu-items.js"],"sourcesContent":["import { getQuery } from '@blaze-cms/admin-ui-utils';\n\nconst { MENU_PERMISSIONS } = require('../constants');\n\nfunction getAddContentMenuItems(app) {\n return async ({ addConfig }) => {\n const client = app.getClient();\n const {\n data: { getEntitySchemas }\n } = await client.query({\n query: getQuery('GET_USER_EDITABLE_ENTITIES'),\n variables: {\n // only return entities that the current user can do the following actions on\n canDoActions: MENU_PERMISSIONS\n }\n });\n\n if (!getEntitySchemas || !getEntitySchemas.length) return; // no items so don't add section\n\n const menuItems = {};\n const sectionMenuItems = { settings: {} };\n\n getEntitySchemas.forEach(({ id, displayName, displayProperties }) => {\n if (!displayProperties) return null;\n\n const { adminMenu: { sectionKey = 'settings' } = {} } = displayProperties;\n const sectionItems = sectionMenuItems[sectionKey] || {};\n sectionItems[id] = {\n label: displayName,\n uri: `/data-listing/${id}`\n };\n sectionMenuItems[sectionKey] = sectionItems;\n });\n\n const menuConfig = {\n main: {\n items: {\n settings: {\n items: menuItems\n }\n }\n }\n };\n\n Object.entries(sectionMenuItems).forEach(([sectionKey, sectionItems]) => {\n const sectionConfig = menuConfig.main.items[sectionKey] || {};\n sectionConfig.items = sectionItems;\n menuConfig.main.items[sectionKey] = sectionConfig;\n });\n\n getEntitySchemas.forEach(({ id, displayName }) => {\n menuItems[id] = {\n label: displayName,\n uri: `/data-listing/${id}`\n };\n });\n\n addConfig(menuConfig);\n };\n}\n\nexport default getAddContentMenuItems;\n"],"mappings":"AAAA,SAASA,QAAQ,QAAQ,2BAA2B;AAEpD,MAAM;EAAEC;AAAiB,CAAC,GAAGC,OAAO,CAAC,cAAc,CAAC;AAEpD,SAASC,sBAAsBA,CAACC,GAAG,EAAE;EACnC,OAAO,OAAO;IAAEC;EAAU,CAAC,KAAK;IAC9B,MAAMC,MAAM,GAAGF,GAAG,CAACG,SAAS,CAAC,CAAC;IAC9B,MAAM;MACJC,IAAI,EAAE;QAAEC;MAAiB;IAC3B,CAAC,GAAG,MAAMH,MAAM,CAACI,KAAK,CAAC;MACrBA,KAAK,EAAEV,QAAQ,CAAC,4BAA4B,CAAC;MAC7CW,SAAS,EAAE;QACT;QACAC,YAAY,EAAEX;MAChB;IACF,CAAC,CAAC;IAEF,IAAI,CAACQ,gBAAgB,IAAI,CAACA,gBAAgB,CAACI,MAAM,EAAE,OAAO,CAAC;;IAE3D,MAAMC,SAAS,GAAG,CAAC,CAAC;IACpB,MAAMC,gBAAgB,GAAG;MAAEC,QAAQ,EAAE,CAAC;IAAE,CAAC;IAEzCP,gBAAgB,CAACQ,OAAO,CAAC,CAAC;MAAEC,EAAE;MAAEC,WAAW;MAAEC;IAAkB,CAAC,KAAK;MACnE,IAAI,CAACA,iBAAiB,EAAE,OAAO,IAAI;MAEnC,MAAM;QAAEC,SAAS,EAAE;UAAEC,UAAU,GAAG;QAAW,CAAC,GAAG,CAAC;MAAE,CAAC,GAAGF,iBAAiB;MACzE,MAAMG,YAAY,GAAGR,gBAAgB,CAACO,UAAU,CAAC,IAAI,CAAC,CAAC;MACvDC,YAAY,CAACL,EAAE,CAAC,GAAG;QACjBM,KAAK,EAAEL,WAAW;QAClBM,GAAG,EAAE,iBAAiBP,EAAE;MAC1B,CAAC;MACDH,gBAAgB,CAACO,UAAU,CAAC,GAAGC,YAAY;IAC7C,CAAC,CAAC;IAEF,MAAMG,UAAU,GAAG;MACjBC,IAAI,EAAE;QACJC,KAAK,EAAE;UACLZ,QAAQ,EAAE;YACRY,KAAK,EAAEd;UACT;QACF;MACF;IACF,CAAC;IAEDe,MAAM,CAACC,OAAO,CAACf,gBAAgB,CAAC,CAACE,OAAO,CAAC,CAAC,CAACK,UAAU,EAAEC,YAAY,CAAC,KAAK;MACvE,MAAMQ,aAAa,GAAGL,UAAU,CAACC,IAAI,CAACC,KAAK,CAACN,UAAU,CAAC,IAAI,CAAC,CAAC;MAC7DS,aAAa,CAACH,KAAK,GAAGL,YAAY;MAClCG,UAAU,CAACC,IAAI,CAACC,KAAK,CAACN,UAAU,CAAC,GAAGS,aAAa;IACnD,CAAC,CAAC;IAEFtB,gBAAgB,CAACQ,OAAO,CAAC,CAAC;MAAEC,EAAE;MAAEC;IAAY,CAAC,KAAK;MAChDL,SAAS,CAACI,EAAE,CAAC,GAAG;QACdM,KAAK,EAAEL,WAAW;QAClBM,GAAG,EAAE,iBAAiBP,EAAE;MAC1B,CAAC;IACH,CAAC,CAAC;IAEFb,SAAS,CAACqB,UAAU,CAAC;EACvB,CAAC;AACH;AAEA,eAAevB,sBAAsB","ignoreList":[]}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { gql } from '@apollo/client';
|
|
2
|
-
import { BlazeError } from '@blaze-cms/core-errors';
|
|
3
|
-
import upperfirst from 'lodash.upperfirst';
|
|
4
|
-
import { getDataProperties } from '@blaze-cms/admin-ui-utils';
|
|
5
|
-
function buildCreateEntityMutation(entitySchema) {
|
|
6
|
-
if (!entitySchema || !entitySchema.actions || !entitySchema.actions.create || !entitySchema.properties) {
|
|
7
|
-
throw new BlazeError('Create entity query requires create action and properties from entity schema');
|
|
8
|
-
}
|
|
9
|
-
const actionInput = upperfirst(`${entitySchema.actions.create}Input`);
|
|
10
|
-
const dataProperties = getDataProperties(entitySchema);
|
|
11
|
-
return gql`mutation createEntity($input: ${actionInput}) {
|
|
12
|
-
createdEntity: ${entitySchema.actions.create}(input: $input){
|
|
13
|
-
result {
|
|
14
|
-
id,
|
|
15
|
-
${dataProperties.join(',\n')}
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
}`;
|
|
19
|
-
}
|
|
20
|
-
export default buildCreateEntityMutation;
|
|
21
|
-
//# sourceMappingURL=build-create-entity-mutation.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"build-create-entity-mutation.js","names":["gql","BlazeError","upperfirst","getDataProperties","buildCreateEntityMutation","entitySchema","actions","create","properties","actionInput","dataProperties","join"],"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,SAASA,GAAG,QAAQ,gBAAgB;AACpC,SAASC,UAAU,QAAQ,wBAAwB;AACnD,OAAOC,UAAU,MAAM,mBAAmB;AAC1C,SAASC,iBAAiB,QAAQ,2BAA2B;AAE7D,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,IAAIP,UAAU,CAClB,8EACF,CAAC;EACH;EAEA,MAAMQ,WAAW,GAAGP,UAAU,CAAC,GAAGG,YAAY,CAACC,OAAO,CAACC,MAAM,OAAO,CAAC;EACrE,MAAMG,cAAc,GAAGP,iBAAiB,CAACE,YAAY,CAAC;EAEtD,OAAOL,GAAG,kCAAkCS,WAAW;AACzD,qBAAqBJ,YAAY,CAACC,OAAO,CAACC,MAAM;AAChD;AACA;AACA,YAAYG,cAAc,CAACC,IAAI,CAAC,KAAK,CAAC;AACtC;AACA;AACA,IAAI;AACJ;AAEA,eAAeP,yBAAyB","ignoreList":[]}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { gql } from '@apollo/client';
|
|
2
|
-
import { BlazeError } from '@blaze-cms/core-errors';
|
|
3
|
-
import upperfirst from 'lodash.upperfirst';
|
|
4
|
-
function buildDeleteEntity(entitySchema) {
|
|
5
|
-
if (!entitySchema || !entitySchema.actions || !entitySchema.actions.delete) {
|
|
6
|
-
throw new BlazeError('Delete query requires delete action from entity schema');
|
|
7
|
-
}
|
|
8
|
-
const actionInput = upperfirst(`${entitySchema.actions.delete}Input`);
|
|
9
|
-
return gql`
|
|
10
|
-
mutation deleteEntity($input: ${actionInput}) {
|
|
11
|
-
deleteEntity: ${entitySchema.actions.delete}(input: $input){
|
|
12
|
-
result
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
`;
|
|
16
|
-
}
|
|
17
|
-
export default buildDeleteEntity;
|
|
18
|
-
//# sourceMappingURL=build-delete-entity-mutation.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"build-delete-entity-mutation.js","names":["gql","BlazeError","upperfirst","buildDeleteEntity","entitySchema","actions","delete","actionInput"],"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,SAASA,GAAG,QAAQ,gBAAgB;AACpC,SAASC,UAAU,QAAQ,wBAAwB;AACnD,OAAOC,UAAU,MAAM,mBAAmB;AAE1C,SAASC,iBAAiBA,CAACC,YAAY,EAAE;EACvC,IAAI,CAACA,YAAY,IAAI,CAACA,YAAY,CAACC,OAAO,IAAI,CAACD,YAAY,CAACC,OAAO,CAACC,MAAM,EAAE;IAC1E,MAAM,IAAIL,UAAU,CAAC,wDAAwD,CAAC;EAChF;EAEA,MAAMM,WAAW,GAAGL,UAAU,CAAC,GAAGE,YAAY,CAACC,OAAO,CAACC,MAAM,OAAO,CAAC;EAErE,OAAON,GAAG;AACZ,mCAAmCO,WAAW;AAC9C,oBAAoBH,YAAY,CAACC,OAAO,CAACC,MAAM;AAC/C;AACA;AACA;AACA,GAAG;AACH;AAEA,eAAeH,iBAAiB","ignoreList":[]}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { gql } from '@apollo/client';
|
|
2
|
-
import { BlazeError } from '@blaze-cms/core-errors';
|
|
3
|
-
import { getDynamicQuery } from '@blaze-cms/admin-ui-utils';
|
|
4
|
-
const buildAdminSearchQuery = entitySchema => {
|
|
5
|
-
const {
|
|
6
|
-
listingProperties = []
|
|
7
|
-
} = entitySchema || {};
|
|
8
|
-
const parsedProperties = `id, ${listingProperties.join(' ') || 'id name'}`;
|
|
9
|
-
return getDynamicQuery('ADMIN_SEARCH')([entitySchema], parsedProperties, true);
|
|
10
|
-
};
|
|
11
|
-
function buildListingQuery(entitySchema, isSearchQuery) {
|
|
12
|
-
if (!entitySchema.actions || !entitySchema.actions.getAll || !entitySchema.listingProperties) {
|
|
13
|
-
throw new BlazeError('Listing query requires getAll action and listingProperties from entity schema');
|
|
14
|
-
}
|
|
15
|
-
if (isSearchQuery) return buildAdminSearchQuery(entitySchema);
|
|
16
|
-
const sortType = entitySchema.actions.getAll[0].toUpperCase() + entitySchema.actions.getAll.substr(1);
|
|
17
|
-
return gql`
|
|
18
|
-
query ${entitySchema.actions.getAll}($where: JSON, $limit: Int, $offset:Int, $sort: [${sortType}SortItem]) {
|
|
19
|
-
listingData: ${entitySchema.actions.getAll}(where: $where, limit: $limit, offset:$offset, sort:$sort){
|
|
20
|
-
id,
|
|
21
|
-
${entitySchema.listingProperties.join(',\n')}
|
|
22
|
-
}
|
|
23
|
-
totalRecords: ${entitySchema.actions.countAll}(where: $where)
|
|
24
|
-
}
|
|
25
|
-
`;
|
|
26
|
-
}
|
|
27
|
-
export default buildListingQuery;
|
|
28
|
-
//# sourceMappingURL=build-listing-query.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"build-listing-query.js","names":["gql","BlazeError","getDynamicQuery","buildAdminSearchQuery","entitySchema","listingProperties","parsedProperties","join","buildListingQuery","isSearchQuery","actions","getAll","sortType","toUpperCase","substr","countAll"],"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 => {\n const { listingProperties = [] } = entitySchema || {};\n const parsedProperties = `id, ${listingProperties.join(' ') || 'id name'}`;\n\n return getDynamicQuery('ADMIN_SEARCH')([entitySchema], parsedProperties, true);\n};\n\nfunction buildListingQuery(entitySchema, 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);\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,SAASA,GAAG,QAAQ,gBAAgB;AACpC,SAASC,UAAU,QAAQ,wBAAwB;AACnD,SAASC,eAAe,QAAQ,2BAA2B;AAE3D,MAAMC,qBAAqB,GAAGC,YAAY,IAAI;EAC5C,MAAM;IAAEC,iBAAiB,GAAG;EAAG,CAAC,GAAGD,YAAY,IAAI,CAAC,CAAC;EACrD,MAAME,gBAAgB,GAAG,OAAOD,iBAAiB,CAACE,IAAI,CAAC,GAAG,CAAC,IAAI,SAAS,EAAE;EAE1E,OAAOL,eAAe,CAAC,cAAc,CAAC,CAAC,CAACE,YAAY,CAAC,EAAEE,gBAAgB,EAAE,IAAI,CAAC;AAChF,CAAC;AAED,SAASE,iBAAiBA,CAACJ,YAAY,EAAEK,aAAa,EAAE;EACtD,IAAI,CAACL,YAAY,CAACM,OAAO,IAAI,CAACN,YAAY,CAACM,OAAO,CAACC,MAAM,IAAI,CAACP,YAAY,CAACC,iBAAiB,EAAE;IAC5F,MAAM,IAAIJ,UAAU,CAClB,+EACF,CAAC;EACH;EAEA,IAAIQ,aAAa,EAAE,OAAON,qBAAqB,CAACC,YAAY,CAAC;EAE7D,MAAMQ,QAAQ,GACZR,YAAY,CAACM,OAAO,CAACC,MAAM,CAAC,CAAC,CAAC,CAACE,WAAW,CAAC,CAAC,GAAGT,YAAY,CAACM,OAAO,CAACC,MAAM,CAACG,MAAM,CAAC,CAAC,CAAC;EAEtF,OAAOd,GAAG;AACZ,YACMI,YAAY,CAACM,OAAO,CAACC,MAAM,oDACuBC,QAAQ;AAChE,qBACQR,YAAY,CAACM,OAAO,CAACC,MAAM;AACnC;AACA,UACUP,YAAY,CAACC,iBAAiB,CAACE,IAAI,CAAC,KAAK,CAAC;AACpD;AACA,sBAAsBH,YAAY,CAACM,OAAO,CAACK,QAAQ;AACnD;AACA,GAAG;AACH;AAEA,eAAeP,iBAAiB","ignoreList":[]}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { gql } from '@apollo/client';
|
|
2
|
-
import { BlazeError } from '@blaze-cms/core-errors';
|
|
3
|
-
import upperfirst from 'lodash.upperfirst';
|
|
4
|
-
import { getDataProperties } from '@blaze-cms/admin-ui-utils';
|
|
5
|
-
function buildUpdateDataQuery(entitySchema) {
|
|
6
|
-
if (!entitySchema.actions || !entitySchema.actions.update || !entitySchema.properties) {
|
|
7
|
-
throw new BlazeError('Update DataEntity query requires get action and properties from entity schema');
|
|
8
|
-
}
|
|
9
|
-
const actionInput = upperfirst(`${entitySchema.actions.update}Input`);
|
|
10
|
-
const dataProperties = getDataProperties(entitySchema);
|
|
11
|
-
return gql`
|
|
12
|
-
mutation updateEntity($input: ${actionInput}) {
|
|
13
|
-
updateEntity: ${entitySchema.actions.update}(input: $input){
|
|
14
|
-
result {
|
|
15
|
-
id,
|
|
16
|
-
${dataProperties.join(',\n')},
|
|
17
|
-
updated
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
`;
|
|
22
|
-
}
|
|
23
|
-
export default buildUpdateDataQuery;
|
|
24
|
-
//# sourceMappingURL=build-update-data-query.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"build-update-data-query.js","names":["gql","BlazeError","upperfirst","getDataProperties","buildUpdateDataQuery","entitySchema","actions","update","properties","actionInput","dataProperties","join"],"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,SAASA,GAAG,QAAQ,gBAAgB;AACpC,SAASC,UAAU,QAAQ,wBAAwB;AACnD,OAAOC,UAAU,MAAM,mBAAmB;AAC1C,SAASC,iBAAiB,QAAQ,2BAA2B;AAE7D,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,IAAIP,UAAU,CAClB,+EACF,CAAC;EACH;EAEA,MAAMQ,WAAW,GAAGP,UAAU,CAAC,GAAGG,YAAY,CAACC,OAAO,CAACC,MAAM,OAAO,CAAC;EACrE,MAAMG,cAAc,GAAGP,iBAAiB,CAACE,YAAY,CAAC;EAEtD,OAAOL,GAAG;AACZ,mCAAmCS,WAAW;AAC9C,oBAAoBJ,YAAY,CAACC,OAAO,CAACC,MAAM;AAC/C;AACA;AACA,YAAYG,cAAc,CAACC,IAAI,CAAC,KAAK,CAAC;AACtC;AACA;AACA;AACA;AACA,GAAG;AACH;AAEA,eAAeP,oBAAoB","ignoreList":[]}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { gql } from '@apollo/client';
|
|
2
|
-
import { BlazeError } from '@blaze-cms/core-errors';
|
|
3
|
-
function buildUpdatePublishUnpublishMutation(entitySchema, id, action, cache) {
|
|
4
|
-
if (!entitySchema || !entitySchema.actions || !entitySchema.actions.publish || !id || !action) {
|
|
5
|
-
throw new BlazeError('Update DataEntity query requires publish action from entity schema and id');
|
|
6
|
-
}
|
|
7
|
-
const withClient = `${cache ? '@client' : ''}`;
|
|
8
|
-
return gql`
|
|
9
|
-
mutation {
|
|
10
|
-
response: ${entitySchema.actions[action]} ${withClient}(input: {
|
|
11
|
-
id: "${id}"
|
|
12
|
-
}){
|
|
13
|
-
result {
|
|
14
|
-
id,
|
|
15
|
-
status
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
`;
|
|
20
|
-
}
|
|
21
|
-
export default buildUpdatePublishUnpublishMutation;
|
|
22
|
-
//# sourceMappingURL=build-update-publish-unpublish-mutation.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"build-update-publish-unpublish-mutation.js","names":["gql","BlazeError","buildUpdatePublishUnpublishMutation","entitySchema","id","action","cache","actions","publish","withClient"],"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,SAASA,GAAG,QAAQ,gBAAgB;AACpC,SAASC,UAAU,QAAQ,wBAAwB;AAEnD,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,IAAIJ,UAAU,CAClB,2EACF,CAAC;EACH;EAEA,MAAMQ,UAAU,GAAG,GAAGH,KAAK,GAAG,SAAS,GAAG,EAAE,EAAE;EAE9C,OAAON,GAAG;AACZ;AACA,kBAAkBG,YAAY,CAACI,OAAO,CAACF,MAAM,CAAC,IAAII,UAAU;AAC5D,eAAeL,EAAE;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AAEA,eAAeF,mCAAmC","ignoreList":[]}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
const getDefaultQueryParams = schema => {
|
|
2
|
-
const updated = schema.properties && schema.properties.updated;
|
|
3
|
-
const {
|
|
4
|
-
adminDefaultListingFilter: where
|
|
5
|
-
} = schema.displayProperties || {};
|
|
6
|
-
return {
|
|
7
|
-
where,
|
|
8
|
-
limit: 10,
|
|
9
|
-
offset: 0,
|
|
10
|
-
sort: updated ? [{
|
|
11
|
-
property: 'updated',
|
|
12
|
-
direction: 'desc'
|
|
13
|
-
}] : []
|
|
14
|
-
};
|
|
15
|
-
};
|
|
16
|
-
export { getDefaultQueryParams };
|
|
17
|
-
//# sourceMappingURL=get-default-query-params.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"get-default-query-params.js","names":["getDefaultQueryParams","schema","updated","properties","adminDefaultListingFilter","where","displayProperties","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,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;AAED,SAASX,qBAAqB","ignoreList":[]}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import { useMainContext, MainContext } from '@blaze-cms/admin-ui-utils';
|
|
4
|
-
export const withContext = Component => props => {
|
|
5
|
-
const contexts = useMainContext(MainContext);
|
|
6
|
-
return /*#__PURE__*/React.createElement(Component, _extends({}, props, contexts));
|
|
7
|
-
};
|
|
8
|
-
//# sourceMappingURL=withContext.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"withContext.js","names":["React","useMainContext","MainContext","withContext","Component","props","contexts","createElement","_extends"],"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,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,cAAc,EAAEC,WAAW,QAAQ,2BAA2B;AAEvE,OAAO,MAAMC,WAAW,GAAGC,SAAS,IAAIC,KAAK,IAAI;EAC/C,MAAMC,QAAQ,GAAGL,cAAc,CAACC,WAAW,CAAC;EAC5C,oBAAOF,KAAA,CAAAO,aAAA,CAACH,SAAS,EAAAI,QAAA,KAAKH,KAAK,EAAMC,QAAQ,CAAG,CAAC;AAC/C,CAAC","ignoreList":[]}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { useState, useCallback } from 'react';
|
|
2
|
-
function useToggle(initialValue) {
|
|
3
|
-
const [toggleValue, setToggleValue] = useState(initialValue);
|
|
4
|
-
const toggler = useCallback(() => setToggleValue(!toggleValue), [toggleValue]);
|
|
5
|
-
return [toggleValue, toggler];
|
|
6
|
-
}
|
|
7
|
-
export default useToggle;
|
|
8
|
-
//# sourceMappingURL=useToggle.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useToggle.js","names":["useState","useCallback","useToggle","initialValue","toggleValue","setToggleValue","toggler"],"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,SAASA,QAAQ,EAAEC,WAAW,QAAQ,OAAO;AAE7C,SAASC,SAASA,CAACC,YAAY,EAAE;EAC/B,MAAM,CAACC,WAAW,EAAEC,cAAc,CAAC,GAAGL,QAAQ,CAACG,YAAY,CAAC;EAC5D,MAAMG,OAAO,GAAGL,WAAW,CAAC,MAAMI,cAAc,CAAC,CAACD,WAAW,CAAC,EAAE,CAACA,WAAW,CAAC,CAAC;EAE9E,OAAO,CAACA,WAAW,EAAEE,OAAO,CAAC;AAC/B;AAEA,eAAeJ,SAAS","ignoreList":[]}
|
package/lib-es/utils/index.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["buildUpdatePublishUnpublishMutation"],"sources":["../../src/utils/index.js"],"sourcesContent":["import buildUpdatePublishUnpublishMutation from './build-update-publish-unpublish-mutation';\n\nexport { buildUpdatePublishUnpublishMutation };\n"],"mappings":"AAAA,OAAOA,mCAAmC,MAAM,2CAA2C;AAE3F,SAASA,mCAAmC","ignoreList":[]}
|