@fast-simon/dashboard-utilities 1.0.1
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/dist/components/BackOfficeFiltersMenu/styles.module.css +10 -0
- package/dist/components/CheckboxFilter/Checkbox/styles.module.css +143 -0
- package/dist/components/CheckboxFilter/styles.module.css +5 -0
- package/dist/components/DragAndDrop/styles.module.css +21 -0
- package/dist/components/FacetItem/styles.module.css +55 -0
- package/dist/components/FromToFilter/From/styles.module.css +9 -0
- package/dist/components/FromToFilter/To/styles.module.css +9 -0
- package/dist/components/FromToFilter/styles.module.css +34 -0
- package/dist/components/InStoreFiltersMenu/styles.module.css +10 -0
- package/dist/components/Input/styles.module.css +3 -0
- package/dist/components/LastReceivedDateFilter/styles.module.css +41 -0
- package/dist/components/RadioFilter/Radio/styles.module.css +145 -0
- package/dist/components/RadioFilter/styles.module.css +23 -0
- package/dist/components/ReactDatePicker/styles.module.css +3 -0
- package/dist/components/SingleFilter/styles.module.css +23 -0
- package/dist/components/SliderFilter/styles.module.css +16 -0
- package/dist/components/Tooltip/styles.module.css +34 -0
- package/dist/components/productGrid/styles.module.css +23 -0
- package/dist/dashboard/dashboard-client/src/pages/LandingPages/editor/components/ActionsBar/ActionItem.d.ts +10 -0
- package/dist/dashboard/dashboard-client/src/pages/LandingPages/editor/components/ActionsBar/ActionItem.js +17 -0
- package/dist/dashboard/dashboard-client/src/pages/LandingPages/editor/components/ActionsBar/ActionItem.js.map +1 -0
- package/dist/dashboard/dashboard-client/src/pages/LandingPages/editor/components/ActionsBar/ActionsBar.d.ts +14 -0
- package/dist/dashboard/dashboard-client/src/pages/LandingPages/editor/components/ActionsBar/ActionsBar.js +14 -0
- package/dist/dashboard/dashboard-client/src/pages/LandingPages/editor/components/ActionsBar/ActionsBar.js.map +1 -0
- package/dist/dashboard/dashboard-client/src/pages/LandingPages/editor/components/ActionsBar/utils.d.ts +16 -0
- package/dist/dashboard/dashboard-client/src/pages/LandingPages/editor/components/ActionsBar/utils.js +61 -0
- package/dist/dashboard/dashboard-client/src/pages/LandingPages/editor/components/ActionsBar/utils.js.map +1 -0
- package/dist/dashboard/dashboard-client/src/pages/LandingPages/editor/components/Positioning/Positioning.d.ts +6 -0
- package/dist/dashboard/dashboard-client/src/pages/LandingPages/editor/components/Positioning/Positioning.js +52 -0
- package/dist/dashboard/dashboard-client/src/pages/LandingPages/editor/components/Positioning/Positioning.js.map +1 -0
- package/dist/dashboard/dashboard-client/src/pages/LandingPages/editor/components/Positioning/index.d.ts +1 -0
- package/dist/dashboard/dashboard-client/src/pages/LandingPages/editor/components/Positioning/index.js +2 -0
- package/dist/dashboard/dashboard-client/src/pages/LandingPages/editor/components/Positioning/index.js.map +1 -0
- package/dist/dashboard/dashboard-client/src/pages/LandingPages/editor/components/ProductCard/ProductCard.d.ts +24 -0
- package/dist/dashboard/dashboard-client/src/pages/LandingPages/editor/components/ProductCard/ProductCard.js +88 -0
- package/dist/dashboard/dashboard-client/src/pages/LandingPages/editor/components/ProductCard/ProductCard.js.map +1 -0
- package/dist/dashboard/dashboard-client/src/pages/LandingPages/editor/components/ProductCard/components/ProductLabel/ProductLabel.d.ts +11 -0
- package/dist/dashboard/dashboard-client/src/pages/LandingPages/editor/components/ProductCard/components/ProductLabel/ProductLabel.js +11 -0
- package/dist/dashboard/dashboard-client/src/pages/LandingPages/editor/components/ProductCard/components/ProductLabel/ProductLabel.js.map +1 -0
- package/dist/dashboard/dashboard-client/src/pages/LandingPages/editor/components/ProductCard/components/ProductLabel/utils.d.ts +8 -0
- package/dist/dashboard/dashboard-client/src/pages/LandingPages/editor/components/ProductCard/components/ProductLabel/utils.js +9 -0
- package/dist/dashboard/dashboard-client/src/pages/LandingPages/editor/components/ProductCard/components/ProductLabel/utils.js.map +1 -0
- package/dist/dashboard/dashboard-client/src/pages/LandingPages/editor/components/ProductCard/utils.d.ts +1 -0
- package/dist/dashboard/dashboard-client/src/pages/LandingPages/editor/components/ProductCard/utils.js +2 -0
- package/dist/dashboard/dashboard-client/src/pages/LandingPages/editor/components/ProductCard/utils.js.map +1 -0
- package/dist/dashboard/dashboard-client/src/pages/LandingPages/editor/components/SelectCard/SelectCard.d.ts +5 -0
- package/dist/dashboard/dashboard-client/src/pages/LandingPages/editor/components/SelectCard/SelectCard.js +8 -0
- package/dist/dashboard/dashboard-client/src/pages/LandingPages/editor/components/SelectCard/SelectCard.js.map +1 -0
- package/dist/dashboard/dashboard-client/src/pages/LandingPages/editor/context/visualEditorContext.d.ts +66 -0
- package/dist/dashboard/dashboard-client/src/pages/LandingPages/editor/context/visualEditorContext.js +54 -0
- package/dist/dashboard/dashboard-client/src/pages/LandingPages/editor/context/visualEditorContext.js.map +1 -0
- package/dist/frontends/dashboard-utilities/src/@types/banner.d.ts +7 -0
- package/dist/frontends/dashboard-utilities/src/@types/banner.js +2 -0
- package/dist/frontends/dashboard-utilities/src/@types/banner.js.map +1 -0
- package/dist/frontends/dashboard-utilities/src/@types/categories.d.ts +16 -0
- package/dist/frontends/dashboard-utilities/src/@types/categories.js +2 -0
- package/dist/frontends/dashboard-utilities/src/@types/categories.js.map +1 -0
- package/dist/frontends/dashboard-utilities/src/@types/currency.d.ts +1 -0
- package/dist/frontends/dashboard-utilities/src/@types/currency.js +2 -0
- package/dist/frontends/dashboard-utilities/src/@types/currency.js.map +1 -0
- package/dist/frontends/dashboard-utilities/src/@types/editorProduct.d.ts +26 -0
- package/dist/frontends/dashboard-utilities/src/@types/editorProduct.js +6 -0
- package/dist/frontends/dashboard-utilities/src/@types/editorProduct.js.map +1 -0
- package/dist/frontends/dashboard-utilities/src/@types/facets.d.ts +45 -0
- package/dist/frontends/dashboard-utilities/src/@types/facets.js +19 -0
- package/dist/frontends/dashboard-utilities/src/@types/facets.js.map +1 -0
- package/dist/frontends/dashboard-utilities/src/@types/iconProps.d.ts +9 -0
- package/dist/frontends/dashboard-utilities/src/@types/iconProps.js +2 -0
- package/dist/frontends/dashboard-utilities/src/@types/iconProps.js.map +1 -0
- package/dist/frontends/dashboard-utilities/src/@types/narrow.d.ts +7 -0
- package/dist/frontends/dashboard-utilities/src/@types/narrow.js +2 -0
- package/dist/frontends/dashboard-utilities/src/@types/narrow.js.map +1 -0
- package/dist/frontends/dashboard-utilities/src/@types/product.d.ts +158 -0
- package/dist/frontends/dashboard-utilities/src/@types/product.js +8 -0
- package/dist/frontends/dashboard-utilities/src/@types/product.js.map +1 -0
- package/dist/frontends/dashboard-utilities/src/@types/productLabel.d.ts +1 -0
- package/dist/frontends/dashboard-utilities/src/@types/productLabel.js +2 -0
- package/dist/frontends/dashboard-utilities/src/@types/productLabel.js.map +1 -0
- package/dist/frontends/dashboard-utilities/src/@types/promoTile.d.ts +11 -0
- package/dist/frontends/dashboard-utilities/src/@types/promoTile.js +2 -0
- package/dist/frontends/dashboard-utilities/src/@types/promoTile.js.map +1 -0
- package/dist/frontends/dashboard-utilities/src/@types/results.d.ts +43 -0
- package/dist/frontends/dashboard-utilities/src/@types/results.js +2 -0
- package/dist/frontends/dashboard-utilities/src/@types/results.js.map +1 -0
- package/dist/frontends/dashboard-utilities/src/@types/sideMenu.d.ts +19 -0
- package/dist/frontends/dashboard-utilities/src/@types/sideMenu.js +2 -0
- package/dist/frontends/dashboard-utilities/src/@types/sideMenu.js.map +1 -0
- package/dist/frontends/dashboard-utilities/src/@types/sortBy.d.ts +3 -0
- package/dist/frontends/dashboard-utilities/src/@types/sortBy.js +2 -0
- package/dist/frontends/dashboard-utilities/src/@types/sortBy.js.map +1 -0
- package/dist/frontends/dashboard-utilities/src/App.d.ts +3 -0
- package/dist/frontends/dashboard-utilities/src/App.js +16 -0
- package/dist/frontends/dashboard-utilities/src/App.js.map +1 -0
- package/dist/frontends/dashboard-utilities/src/components/BackOfficeFiltersMenu/BackOfficeFiltersMenu.d.ts +9 -0
- package/dist/frontends/dashboard-utilities/src/components/BackOfficeFiltersMenu/BackOfficeFiltersMenu.js +74 -0
- package/dist/frontends/dashboard-utilities/src/components/BackOfficeFiltersMenu/BackOfficeFiltersMenu.js.map +1 -0
- package/dist/frontends/dashboard-utilities/src/components/BackOfficeFiltersMenu/index.d.ts +1 -0
- package/dist/frontends/dashboard-utilities/src/components/BackOfficeFiltersMenu/index.js +2 -0
- package/dist/frontends/dashboard-utilities/src/components/BackOfficeFiltersMenu/index.js.map +1 -0
- package/dist/frontends/dashboard-utilities/src/components/BackOfficeFiltersMenu/utils.d.ts +7 -0
- package/dist/frontends/dashboard-utilities/src/components/BackOfficeFiltersMenu/utils.js +239 -0
- package/dist/frontends/dashboard-utilities/src/components/BackOfficeFiltersMenu/utils.js.map +1 -0
- package/dist/frontends/dashboard-utilities/src/components/CheckboxFilter/Checkbox/Checkbox.d.ts +10 -0
- package/dist/frontends/dashboard-utilities/src/components/CheckboxFilter/Checkbox/Checkbox.js +7 -0
- package/dist/frontends/dashboard-utilities/src/components/CheckboxFilter/Checkbox/Checkbox.js.map +1 -0
- package/dist/frontends/dashboard-utilities/src/components/CheckboxFilter/CheckboxFilter.d.ts +6 -0
- package/dist/frontends/dashboard-utilities/src/components/CheckboxFilter/CheckboxFilter.js +9 -0
- package/dist/frontends/dashboard-utilities/src/components/CheckboxFilter/CheckboxFilter.js.map +1 -0
- package/dist/frontends/dashboard-utilities/src/components/DragAndDrop/DndContextWrapper.d.ts +20 -0
- package/dist/frontends/dashboard-utilities/src/components/DragAndDrop/DndContextWrapper.js +33 -0
- package/dist/frontends/dashboard-utilities/src/components/DragAndDrop/DndContextWrapper.js.map +1 -0
- package/dist/frontends/dashboard-utilities/src/components/DragAndDrop/Droppable.d.ts +7 -0
- package/dist/frontends/dashboard-utilities/src/components/DragAndDrop/Droppable.js +10 -0
- package/dist/frontends/dashboard-utilities/src/components/DragAndDrop/Droppable.js.map +1 -0
- package/dist/frontends/dashboard-utilities/src/components/DragAndDrop/SortableItem.d.ts +13 -0
- package/dist/frontends/dashboard-utilities/src/components/DragAndDrop/SortableItem.js +39 -0
- package/dist/frontends/dashboard-utilities/src/components/DragAndDrop/SortableItem.js.map +1 -0
- package/dist/frontends/dashboard-utilities/src/components/FacetItem/FacetItem.d.ts +13 -0
- package/dist/frontends/dashboard-utilities/src/components/FacetItem/FacetItem.js +40 -0
- package/dist/frontends/dashboard-utilities/src/components/FacetItem/FacetItem.js.map +1 -0
- package/dist/frontends/dashboard-utilities/src/components/FastSimonApi/FastSimonApi.d.ts +31 -0
- package/dist/frontends/dashboard-utilities/src/components/FastSimonApi/FastSimonApi.js +398 -0
- package/dist/frontends/dashboard-utilities/src/components/FastSimonApi/FastSimonApi.js.map +1 -0
- package/dist/frontends/dashboard-utilities/src/components/FastSimonApi/context.d.ts +50 -0
- package/dist/frontends/dashboard-utilities/src/components/FastSimonApi/context.js +10 -0
- package/dist/frontends/dashboard-utilities/src/components/FastSimonApi/context.js.map +1 -0
- package/dist/frontends/dashboard-utilities/src/components/FastSimonApi/index.d.ts +3 -0
- package/dist/frontends/dashboard-utilities/src/components/FastSimonApi/index.js +3 -0
- package/dist/frontends/dashboard-utilities/src/components/FastSimonApi/index.js.map +1 -0
- package/dist/frontends/dashboard-utilities/src/components/FastSimonApi/reducer.d.ts +172 -0
- package/dist/frontends/dashboard-utilities/src/components/FastSimonApi/reducer.js +67 -0
- package/dist/frontends/dashboard-utilities/src/components/FastSimonApi/reducer.js.map +1 -0
- package/dist/frontends/dashboard-utilities/src/components/FromToFilter/From/From.d.ts +17 -0
- package/dist/frontends/dashboard-utilities/src/components/FromToFilter/From/From.js +22 -0
- package/dist/frontends/dashboard-utilities/src/components/FromToFilter/From/From.js.map +1 -0
- package/dist/frontends/dashboard-utilities/src/components/FromToFilter/FromToFilter.d.ts +14 -0
- package/dist/frontends/dashboard-utilities/src/components/FromToFilter/FromToFilter.js +58 -0
- package/dist/frontends/dashboard-utilities/src/components/FromToFilter/FromToFilter.js.map +1 -0
- package/dist/frontends/dashboard-utilities/src/components/FromToFilter/To/To.d.ts +18 -0
- package/dist/frontends/dashboard-utilities/src/components/FromToFilter/To/To.js +23 -0
- package/dist/frontends/dashboard-utilities/src/components/FromToFilter/To/To.js.map +1 -0
- package/dist/frontends/dashboard-utilities/src/components/FromToFilter/utils.d.ts +25 -0
- package/dist/frontends/dashboard-utilities/src/components/FromToFilter/utils.js +7 -0
- package/dist/frontends/dashboard-utilities/src/components/FromToFilter/utils.js.map +1 -0
- package/dist/frontends/dashboard-utilities/src/components/InStoreFiltersMenu/InStoreFiltersMenu.d.ts +10 -0
- package/dist/frontends/dashboard-utilities/src/components/InStoreFiltersMenu/InStoreFiltersMenu.js +34 -0
- package/dist/frontends/dashboard-utilities/src/components/InStoreFiltersMenu/InStoreFiltersMenu.js.map +1 -0
- package/dist/frontends/dashboard-utilities/src/components/InStoreFiltersMenu/index.d.ts +1 -0
- package/dist/frontends/dashboard-utilities/src/components/InStoreFiltersMenu/index.js +2 -0
- package/dist/frontends/dashboard-utilities/src/components/InStoreFiltersMenu/index.js.map +1 -0
- package/dist/frontends/dashboard-utilities/src/components/Input/Input.d.ts +22 -0
- package/dist/frontends/dashboard-utilities/src/components/Input/Input.js +49 -0
- package/dist/frontends/dashboard-utilities/src/components/Input/Input.js.map +1 -0
- package/dist/frontends/dashboard-utilities/src/components/Input/index.d.ts +1 -0
- package/dist/frontends/dashboard-utilities/src/components/Input/index.js +2 -0
- package/dist/frontends/dashboard-utilities/src/components/Input/index.js.map +1 -0
- package/dist/frontends/dashboard-utilities/src/components/LastReceivedDateFilter/LastReceivedDate.d.ts +9 -0
- package/dist/frontends/dashboard-utilities/src/components/LastReceivedDateFilter/LastReceivedDate.js +88 -0
- package/dist/frontends/dashboard-utilities/src/components/LastReceivedDateFilter/LastReceivedDate.js.map +1 -0
- package/dist/frontends/dashboard-utilities/src/components/LastReceivedDateFilter/utils.d.ts +3 -0
- package/dist/frontends/dashboard-utilities/src/components/LastReceivedDateFilter/utils.js +43 -0
- package/dist/frontends/dashboard-utilities/src/components/LastReceivedDateFilter/utils.js.map +1 -0
- package/dist/frontends/dashboard-utilities/src/components/RadioFilter/Radio/Radio.d.ts +10 -0
- package/dist/frontends/dashboard-utilities/src/components/RadioFilter/Radio/Radio.js +7 -0
- package/dist/frontends/dashboard-utilities/src/components/RadioFilter/Radio/Radio.js.map +1 -0
- package/dist/frontends/dashboard-utilities/src/components/RadioFilter/RadioFilter.d.ts +9 -0
- package/dist/frontends/dashboard-utilities/src/components/RadioFilter/RadioFilter.js +45 -0
- package/dist/frontends/dashboard-utilities/src/components/RadioFilter/RadioFilter.js.map +1 -0
- package/dist/frontends/dashboard-utilities/src/components/RadioFilter/utils.d.ts +1 -0
- package/dist/frontends/dashboard-utilities/src/components/RadioFilter/utils.js +8 -0
- package/dist/frontends/dashboard-utilities/src/components/RadioFilter/utils.js.map +1 -0
- package/dist/frontends/dashboard-utilities/src/components/ReactDatePicker/ReactDatePicker.d.ts +11 -0
- package/dist/frontends/dashboard-utilities/src/components/ReactDatePicker/ReactDatePicker.js +16 -0
- package/dist/frontends/dashboard-utilities/src/components/ReactDatePicker/ReactDatePicker.js.map +1 -0
- package/dist/frontends/dashboard-utilities/src/components/ReactDatePicker/index.d.ts +1 -0
- package/dist/frontends/dashboard-utilities/src/components/ReactDatePicker/index.js +2 -0
- package/dist/frontends/dashboard-utilities/src/components/ReactDatePicker/index.js.map +1 -0
- package/dist/frontends/dashboard-utilities/src/components/RenderIfVisible/RenderIfVisible.d.ts +12 -0
- package/dist/frontends/dashboard-utilities/src/components/RenderIfVisible/RenderIfVisible.js +59 -0
- package/dist/frontends/dashboard-utilities/src/components/RenderIfVisible/RenderIfVisible.js.map +1 -0
- package/dist/frontends/dashboard-utilities/src/components/RenderIfVisible/index.d.ts +1 -0
- package/dist/frontends/dashboard-utilities/src/components/RenderIfVisible/index.js +2 -0
- package/dist/frontends/dashboard-utilities/src/components/RenderIfVisible/index.js.map +1 -0
- package/dist/frontends/dashboard-utilities/src/components/SingleFilter/SingleFilter.d.ts +11 -0
- package/dist/frontends/dashboard-utilities/src/components/SingleFilter/SingleFilter.js +90 -0
- package/dist/frontends/dashboard-utilities/src/components/SingleFilter/SingleFilter.js.map +1 -0
- package/dist/frontends/dashboard-utilities/src/components/SingleFilter/utils.d.ts +3 -0
- package/dist/frontends/dashboard-utilities/src/components/SingleFilter/utils.js +42 -0
- package/dist/frontends/dashboard-utilities/src/components/SingleFilter/utils.js.map +1 -0
- package/dist/frontends/dashboard-utilities/src/components/SliderFilter/SliderFilter.d.ts +20 -0
- package/dist/frontends/dashboard-utilities/src/components/SliderFilter/SliderFilter.js +45 -0
- package/dist/frontends/dashboard-utilities/src/components/SliderFilter/SliderFilter.js.map +1 -0
- package/dist/frontends/dashboard-utilities/src/components/SliderFilter/index.d.ts +1 -0
- package/dist/frontends/dashboard-utilities/src/components/SliderFilter/index.js +2 -0
- package/dist/frontends/dashboard-utilities/src/components/SliderFilter/index.js.map +1 -0
- package/dist/frontends/dashboard-utilities/src/components/Tooltip/Tooltip.d.ts +8 -0
- package/dist/frontends/dashboard-utilities/src/components/Tooltip/Tooltip.js +9 -0
- package/dist/frontends/dashboard-utilities/src/components/Tooltip/Tooltip.js.map +1 -0
- package/dist/frontends/dashboard-utilities/src/components/common.d.ts +34 -0
- package/dist/frontends/dashboard-utilities/src/components/common.js +80 -0
- package/dist/frontends/dashboard-utilities/src/components/common.js.map +1 -0
- package/dist/frontends/dashboard-utilities/src/components/productGrid/ProductGrid.d.ts +6 -0
- package/dist/frontends/dashboard-utilities/src/components/productGrid/ProductGrid.js +11 -0
- package/dist/frontends/dashboard-utilities/src/components/productGrid/ProductGrid.js.map +1 -0
- package/dist/frontends/dashboard-utilities/src/components/productGrid/index.d.ts +1 -0
- package/dist/frontends/dashboard-utilities/src/components/productGrid/index.js +2 -0
- package/dist/frontends/dashboard-utilities/src/components/productGrid/index.js.map +1 -0
- package/dist/frontends/dashboard-utilities/src/icons/BackOfficeFiltersIcon.d.ts +2 -0
- package/dist/frontends/dashboard-utilities/src/icons/BackOfficeFiltersIcon.js +7 -0
- package/dist/frontends/dashboard-utilities/src/icons/BackOfficeFiltersIcon.js.map +1 -0
- package/dist/frontends/dashboard-utilities/src/icons/BannersIcon.d.ts +2 -0
- package/dist/frontends/dashboard-utilities/src/icons/BannersIcon.js +7 -0
- package/dist/frontends/dashboard-utilities/src/icons/BannersIcon.js.map +1 -0
- package/dist/frontends/dashboard-utilities/src/icons/BuriedIcon.d.ts +2 -0
- package/dist/frontends/dashboard-utilities/src/icons/BuriedIcon.js +7 -0
- package/dist/frontends/dashboard-utilities/src/icons/BuriedIcon.js.map +1 -0
- package/dist/frontends/dashboard-utilities/src/icons/CutIcon.d.ts +2 -0
- package/dist/frontends/dashboard-utilities/src/icons/CutIcon.js +7 -0
- package/dist/frontends/dashboard-utilities/src/icons/CutIcon.js.map +1 -0
- package/dist/frontends/dashboard-utilities/src/icons/HelpIcon.d.ts +7 -0
- package/dist/frontends/dashboard-utilities/src/icons/HelpIcon.js +5 -0
- package/dist/frontends/dashboard-utilities/src/icons/HelpIcon.js.map +1 -0
- package/dist/frontends/dashboard-utilities/src/icons/HiddenIcon.d.ts +2 -0
- package/dist/frontends/dashboard-utilities/src/icons/HiddenIcon.js +7 -0
- package/dist/frontends/dashboard-utilities/src/icons/HiddenIcon.js.map +1 -0
- package/dist/frontends/dashboard-utilities/src/icons/InStoreFiltersIcon.d.ts +2 -0
- package/dist/frontends/dashboard-utilities/src/icons/InStoreFiltersIcon.js +7 -0
- package/dist/frontends/dashboard-utilities/src/icons/InStoreFiltersIcon.js.map +1 -0
- package/dist/frontends/dashboard-utilities/src/icons/PinIcon.d.ts +2 -0
- package/dist/frontends/dashboard-utilities/src/icons/PinIcon.js +7 -0
- package/dist/frontends/dashboard-utilities/src/icons/PinIcon.js.map +1 -0
- package/dist/frontends/dashboard-utilities/src/icons/PositionIcon.d.ts +2 -0
- package/dist/frontends/dashboard-utilities/src/icons/PositionIcon.js +7 -0
- package/dist/frontends/dashboard-utilities/src/icons/PositionIcon.js.map +1 -0
- package/dist/frontends/dashboard-utilities/src/icons/PromoteIcon.d.ts +2 -0
- package/dist/frontends/dashboard-utilities/src/icons/PromoteIcon.js +7 -0
- package/dist/frontends/dashboard-utilities/src/icons/PromoteIcon.js.map +1 -0
- package/dist/frontends/dashboard-utilities/src/icons/RemoveIcon.d.ts +2 -0
- package/dist/frontends/dashboard-utilities/src/icons/RemoveIcon.js +7 -0
- package/dist/frontends/dashboard-utilities/src/icons/RemoveIcon.js.map +1 -0
- package/dist/frontends/dashboard-utilities/src/icons/RestoreIcon.d.ts +2 -0
- package/dist/frontends/dashboard-utilities/src/icons/RestoreIcon.js +7 -0
- package/dist/frontends/dashboard-utilities/src/icons/RestoreIcon.js.map +1 -0
- package/dist/frontends/dashboard-utilities/src/main.d.ts +1 -0
- package/dist/frontends/dashboard-utilities/src/main.js +6 -0
- package/dist/frontends/dashboard-utilities/src/main.js.map +1 -0
- package/dist/frontends/dashboard-utilities/src/services/API.d.ts +21 -0
- package/dist/frontends/dashboard-utilities/src/services/API.js +50 -0
- package/dist/frontends/dashboard-utilities/src/services/API.js.map +1 -0
- package/dist/frontends/dashboard-utilities/src/services/landingPage.d.ts +28 -0
- package/dist/frontends/dashboard-utilities/src/services/landingPage.js +153 -0
- package/dist/frontends/dashboard-utilities/src/services/landingPage.js.map +1 -0
- package/dist/frontends/dashboard-utilities/src/utils/customTagsFilters.d.ts +4 -0
- package/dist/frontends/dashboard-utilities/src/utils/customTagsFilters.js +10 -0
- package/dist/frontends/dashboard-utilities/src/utils/customTagsFilters.js.map +1 -0
- package/dist/frontends/dashboard-utilities/src/utils/fixPinnedPositions.d.ts +4 -0
- package/dist/frontends/dashboard-utilities/src/utils/fixPinnedPositions.js +27 -0
- package/dist/frontends/dashboard-utilities/src/utils/fixPinnedPositions.js.map +1 -0
- package/dist/frontends/dashboard-utilities/src/utils/narrow.d.ts +18 -0
- package/dist/frontends/dashboard-utilities/src/utils/narrow.js +101 -0
- package/dist/frontends/dashboard-utilities/src/utils/narrow.js.map +1 -0
- package/dist/frontends/dashboard-utilities/src/utils/products.d.ts +30 -0
- package/dist/frontends/dashboard-utilities/src/utils/products.js +39 -0
- package/dist/frontends/dashboard-utilities/src/utils/products.js.map +1 -0
- package/dist/frontends/dashboard-utilities/src/utils/shopifyMarkets.d.ts +3 -0
- package/dist/frontends/dashboard-utilities/src/utils/shopifyMarkets.js +7 -0
- package/dist/frontends/dashboard-utilities/src/utils/shopifyMarkets.js.map +1 -0
- package/dist/frontends/dashboard-utilities/src/utils/useDragToSelect.d.ts +13 -0
- package/dist/frontends/dashboard-utilities/src/utils/useDragToSelect.js +177 -0
- package/dist/frontends/dashboard-utilities/src/utils/useDragToSelect.js.map +1 -0
- package/dist/icons/styles.module.css +61 -0
- package/package.json +65 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ActionsBar.js","sourceRoot":"","sources":["../../../../../../../../../../../dashboard/dashboard-client/src/pages/LandingPages/editor/components/ActionsBar/ActionsBar.tsx"],"names":[],"mappings":";AACA,OAAO,OAAO,MAAM,qBAAqB,CAAC;AAC1C,OAAO,EAAC,eAAe,EAA+B,MAAM,SAAS,CAAC;AACtE,OAAO,UAAU,MAAM,cAAc,CAAC;AACtC,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAC,sBAAsB,EAAC,MAAM,mCAAmC,CAAC;AAgBzE,MAAM,UAAU,GAAoB,CAAC,EAAC,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,cAAc,EAAE,QAAQ,EAAC,yBAAyB,EAAE,gBAAgB,EAAC,EAAE,EAAE;IAExI,MAAM,EAAC,KAAK,EAAC,GAAG,sBAAsB,EAAE,CAAC;IAEzC,OAAM,CACF,4BAAkD,SAAS,EAAE,IAAI,CAAC,OAAO,CAAC,kBAAkB,EAAE,SAAS,EAAE,uBAAuB,CAAC,EAAE,KAAK,EAAE,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAC,aAAa,EAAE,MAAM,EAAC,CAAC,CAAC,CAAC,EAAE,gBAC3L,4BAAK,SAAS,EAAE,IAAI,CAAC,OAAO,CAAC,gBAAgB,EAAE,yBAAyB,CAAC,gBACpE,CAAC,cAAc,IAAI,eAAe,CAAC;iBAC/B,MAAM,CAAC,IAAI,CAAC,EAAE,WAAC,OAAA,IAAI,CAAC,SAAS,KAAI,MAAA,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,SAAS,qDAAG,OAAwB,CAAC,CAAA,CAAA,EAAA,CAAC;iBAC7E,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,KAAC,UAAU,IAAiB,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,gBAAgB,EAAE,gBAAgB,IAA/F,IAAI,CAAC,IAAI,CAAyF,CAAC,IACnI,KALA,aAAa,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,EAAE,IAAI,QAAQ,EAAE,CAM1C,CACT,CAAA;AACL,CAAC,CAAA;AACD,eAAe,UAAU,CAAC","sourcesContent":["import React from 'react';\r\nimport classes from \"./styles.module.css\";\r\nimport {ActionsBarItems, ActionItem as ActionItemType} from \"./utils\";\r\nimport ActionItem from \"./ActionItem\";\r\nimport clsx from \"clsx\";\r\nimport {EditorProduct} from \"../../../../../../../../frontends/dashboard-utilities/src/@types/editorProduct\";\r\nimport {useVisualEditorContext} from \"../../context/visualEditorContext\";\r\n\r\nexport interface Props {\r\n onClick: (item: ActionItemType, newPosition?:number) => void;\r\n className: string;\r\n product?: EditorProduct;\r\n\r\n actionBarItems?: ActionItemType[];\r\n\r\n position?: number;\r\n\r\n actionBarContentClassName?: string;\r\n\r\n tooltipClassName?: string;\r\n}\r\n\r\nconst ActionsBar: React.FC<Props> = ({onClick, className, product, actionBarItems, position,actionBarContentClassName, tooltipClassName}) => {\r\n\r\n const {state} = useVisualEditorContext();\r\n\r\n return(\r\n <div key={`actionBar_${product?.id}_${position}`} className={clsx(classes.actionBarContainer, className, 'actions-bar-container')} style={state.loading.products ? {pointerEvents: 'none'} : {}}>\r\n <div className={clsx(classes.actionBarContent, actionBarContentClassName)}>\r\n {(actionBarItems || ActionsBarItems)\r\n .filter(item => item.isVisible && item?.isVisible?.(product as EditorProduct))\r\n .map(item => <ActionItem key={item.name} item={item} onClick={onClick} position={position} tooltipClassName={tooltipClassName}/>)}\r\n </div>\r\n </div>\r\n )\r\n}\r\nexport default ActionsBar;\r\n"]}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { EditorProduct } from "../../../../../../../../frontends/dashboard-utilities/src/@types/editorProduct";
|
|
2
|
+
export interface CustomClasses {
|
|
3
|
+
wrapper?: string;
|
|
4
|
+
svg?: string;
|
|
5
|
+
path?: string;
|
|
6
|
+
}
|
|
7
|
+
export type ActionItemName = 'bury' | 'hide' | 'unpublish' | 'pin' | 'promote' | 'cut' | 'restore' | 'position' | 'remove';
|
|
8
|
+
export interface ActionItem {
|
|
9
|
+
getIcon?: (customClasses?: CustomClasses) => JSX.Element;
|
|
10
|
+
getComponent?: (onChangeCommitted: (newPosition: number) => void, currentPosition: number) => JSX.Element;
|
|
11
|
+
name: ActionItemName;
|
|
12
|
+
hooverTooltip?: string;
|
|
13
|
+
beforeExpand?: boolean;
|
|
14
|
+
isVisible?: (product: EditorProduct) => boolean;
|
|
15
|
+
}
|
|
16
|
+
export declare const ActionsBarItems: ActionItem[];
|
package/dist/dashboard/dashboard-client/src/pages/LandingPages/editor/components/ActionsBar/utils.js
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { BuriedIcon } from "../../../../../../../../frontends/dashboard-utilities/src/icons/BuriedIcon";
|
|
2
|
+
import { HiddenIcon } from "../../../../../../../../frontends/dashboard-utilities/src/icons/HiddenIcon";
|
|
3
|
+
import { PinIcon } from "../../../../../../../../frontends/dashboard-utilities/src/icons/PinIcon";
|
|
4
|
+
import { PromoteIcon } from "../../../../../../../../frontends/dashboard-utilities/src/icons/PromoteIcon";
|
|
5
|
+
import { CutIcon } from "../../../../../../../../frontends/dashboard-utilities/src/icons/CutIcon";
|
|
6
|
+
import { RestoreIcon } from "../../../../../../../../frontends/dashboard-utilities/src/icons/RestoreIcon";
|
|
7
|
+
import { RemoveIcon } from "../../../../../../../../frontends/dashboard-utilities/src/icons/RemoveIcon";
|
|
8
|
+
import { PositionIcon } from "../../../../../../../../frontends/dashboard-utilities/src/icons/PositionIcon";
|
|
9
|
+
import Positioning from "../Positioning";
|
|
10
|
+
export const ActionsBarItems = [
|
|
11
|
+
{
|
|
12
|
+
getIcon: (customClasses) => PromoteIcon.call(undefined, { height: 40, width: 40, customClasses: customClasses }),
|
|
13
|
+
name: 'promote',
|
|
14
|
+
hooverTooltip: 'Promote',
|
|
15
|
+
isVisible: (product) => true
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
getIcon: (customClasses) => BuriedIcon.call(undefined, { height: 35, width: 35, customClasses: customClasses }),
|
|
19
|
+
name: 'bury',
|
|
20
|
+
hooverTooltip: 'Bury',
|
|
21
|
+
isVisible: (product) => (product === null || product === void 0 ? void 0 : product.productLabel) !== 'Buried'
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
getIcon: (customClasses) => CutIcon.call(undefined, { height: 40, width: 40, customClasses: customClasses }),
|
|
25
|
+
name: 'cut',
|
|
26
|
+
hooverTooltip: 'Cut',
|
|
27
|
+
isVisible: () => false
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
getIcon: (customClasses) => PositionIcon.call(undefined, { customClasses: customClasses }),
|
|
31
|
+
getComponent: (onChangeCommitted, currentPosition) => Positioning.call(undefined, { onChangeCommitted: onChangeCommitted, currentPosition: currentPosition }),
|
|
32
|
+
name: 'position',
|
|
33
|
+
hooverTooltip: 'Position',
|
|
34
|
+
isVisible: () => true
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
getIcon: (customClasses) => RestoreIcon.call(undefined, { height: 40, width: 40, customClasses: customClasses }),
|
|
38
|
+
name: 'restore',
|
|
39
|
+
hooverTooltip: 'Restore',
|
|
40
|
+
isVisible: (product) => (['Buried', 'Promoted', 'Pinned'].includes((product === null || product === void 0 ? void 0 : product.productLabel) || ''))
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
getIcon: (customClasses) => HiddenIcon.call(undefined, { height: 26, width: 32, customClasses: customClasses }),
|
|
44
|
+
name: 'hide',
|
|
45
|
+
hooverTooltip: 'Hide',
|
|
46
|
+
isVisible: (product) => (product === null || product === void 0 ? void 0 : product.productLabel) !== 'Hidden'
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
getIcon: (customClasses) => PinIcon.call(undefined, { height: 40, width: 40, customClasses: customClasses }),
|
|
50
|
+
name: 'pin',
|
|
51
|
+
hooverTooltip: 'Pin',
|
|
52
|
+
isVisible: (product) => (!['Promoted', 'Pinned', 'Buried'].includes((product === null || product === void 0 ? void 0 : product.productLabel) || ''))
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
getIcon: (customClasses) => RemoveIcon.call(undefined, { height: 40, width: 40, customClasses: customClasses }),
|
|
56
|
+
name: 'remove',
|
|
57
|
+
hooverTooltip: 'Remove',
|
|
58
|
+
isVisible: (product) => false
|
|
59
|
+
}
|
|
60
|
+
];
|
|
61
|
+
//# sourceMappingURL=utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../../../../../../../../../dashboard/dashboard-client/src/pages/LandingPages/editor/components/ActionsBar/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAC,MAAM,4EAA4E,CAAC;AACtG,OAAO,EAAC,UAAU,EAAC,MAAM,4EAA4E,CAAC;AACtG,OAAO,EAAC,OAAO,EAAC,MAAM,yEAAyE,CAAC;AAChG,OAAO,EAAC,WAAW,EAAC,MAAM,6EAA6E,CAAC;AACxG,OAAO,EAAC,OAAO,EAAC,MAAM,yEAAyE,CAAC;AAChG,OAAO,EAAC,WAAW,EAAC,MAAM,6EAA6E,CAAC;AACxG,O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,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,UAAU,EAAE,QAAQ,EAAE,QAAQ,CAAC,CAAC,QAAQ,CAAC,CAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,YAAY,KAAI,EAAE,CAAC,CAAC;KACpG;IACA;QACG,OAAO,EAAE,CAAC,aAA6B,EAAE,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC,SAAS,EAAE,EAAC,MAAM,EAAE,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,aAAa,EAAE,aAAa,EAAC,CAAC;QAC7H,IAAI,EAAE,QAAQ;QACd,aAAa,EAAE,QAAQ;QACvB,SAAS,EAAE,CAAC,OAAO,EAAE,EAAE,CAAC,KAAK;KAChC;CACJ,CAAA","sourcesContent":["import {BuriedIcon} from \"../../../../../../../../frontends/dashboard-utilities/src/icons/BuriedIcon\";\r\nimport {HiddenIcon} from \"../../../../../../../../frontends/dashboard-utilities/src/icons/HiddenIcon\";\r\nimport {PinIcon} from \"../../../../../../../../frontends/dashboard-utilities/src/icons/PinIcon\";\r\nimport {PromoteIcon} from \"../../../../../../../../frontends/dashboard-utilities/src/icons/PromoteIcon\";\r\nimport {CutIcon} from \"../../../../../../../../frontends/dashboard-utilities/src/icons/CutIcon\";\r\nimport {RestoreIcon} from \"../../../../../../../../frontends/dashboard-utilities/src/icons/RestoreIcon\";\r\nimport {RemoveIcon} from \"../../../../../../../../frontends/dashboard-utilities/src/icons/RemoveIcon\";\r\nimport {EditorProduct} from \"../../../../../../../../frontends/dashboard-utilities/src/@types/editorProduct\";\r\nimport {PositionIcon} from \"../../../../../../../../frontends/dashboard-utilities/src/icons/PositionIcon\";\r\nimport Positioning from \"../Positioning\";\r\n\r\nexport interface CustomClasses {\r\n wrapper?: string,\r\n svg?: string,\r\n path?: string\r\n}\r\n\r\nexport type ActionItemName = | 'bury' | 'hide' | 'unpublish' | 'pin' | 'promote' | 'cut' | 'restore' | 'position' | 'remove';\r\n\r\nexport interface ActionItem {\r\n getIcon?: (customClasses?: CustomClasses) => JSX.Element;\r\n getComponent?: (onChangeCommitted: (newPosition: number) => void, currentPosition: number) => JSX.Element;\r\n name: ActionItemName;\r\n hooverTooltip?: string;\r\n beforeExpand?: boolean;\r\n\r\n isVisible?: (product: EditorProduct) => boolean;\r\n}\r\n\r\nexport const ActionsBarItems: ActionItem[] = [\r\n {\r\n getIcon: (customClasses?: CustomClasses) => PromoteIcon.call(undefined, {height: 40, width: 40, customClasses: customClasses}),\r\n name: 'promote',\r\n hooverTooltip: 'Promote',\r\n isVisible: (product) => true\r\n },\r\n {\r\n getIcon: (customClasses?: CustomClasses) => BuriedIcon.call(undefined, {height: 35, width: 35, customClasses: customClasses}),\r\n name: 'bury',\r\n hooverTooltip: 'Bury',\r\n isVisible: (product) => product?.productLabel !== 'Buried'\r\n },\r\n {\r\n getIcon: (customClasses?: CustomClasses) => CutIcon.call(undefined, {height: 40, width: 40, customClasses: customClasses}),\r\n name: 'cut',\r\n hooverTooltip: 'Cut',\r\n isVisible: () => false\r\n },\r\n {\r\n getIcon: (customClasses?: CustomClasses) => PositionIcon.call(undefined, {customClasses: customClasses}),\r\n getComponent: (onChangeCommitted, currentPosition) => Positioning.call(undefined, {onChangeCommitted: onChangeCommitted, currentPosition: currentPosition}),\r\n name: 'position',\r\n hooverTooltip: 'Position',\r\n isVisible: () => true\r\n },\r\n {\r\n getIcon: (customClasses?: CustomClasses) => RestoreIcon.call(undefined, {height: 40, width: 40, customClasses: customClasses}),\r\n name: 'restore',\r\n hooverTooltip: 'Restore',\r\n isVisible: (product) => (['Buried', 'Promoted', 'Pinned'].includes(product?.productLabel || ''))\r\n },\r\n {\r\n getIcon: (customClasses?: CustomClasses) => HiddenIcon.call(undefined, {height: 26, width: 32, customClasses: customClasses}),\r\n name: 'hide',\r\n hooverTooltip: 'Hide',\r\n isVisible: (product) => product?.productLabel !== 'Hidden'\r\n },\r\n {\r\n getIcon: (customClasses?: CustomClasses) => PinIcon.call(undefined, {height: 40, width: 40, customClasses: customClasses}),\r\n name: 'pin',\r\n hooverTooltip: 'Pin',\r\n isVisible: (product) => (!['Promoted', 'Pinned', 'Buried'].includes(product?.productLabel || ''))\r\n },\r\n {\r\n getIcon: (customClasses?: CustomClasses) => RemoveIcon.call(undefined, {height: 40, width: 40, customClasses: customClasses}),\r\n name: 'remove',\r\n hooverTooltip: 'Remove',\r\n isVisible: (product) => false\r\n }\r\n]"]}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import classes from "./styles.module.css";
|
|
3
|
+
import { PositionIcon } from "../../../../../../../../frontends/dashboard-utilities/src/icons/PositionIcon";
|
|
4
|
+
import { useEffect, useState } from "react";
|
|
5
|
+
import Input from "../../../../../../../../frontends/dashboard-utilities/src/components/Input/Input";
|
|
6
|
+
import clsx from "clsx";
|
|
7
|
+
import { useVisualEditorContext } from "../../context/visualEditorContext";
|
|
8
|
+
const Positioning = ({ onChangeCommitted, currentPosition }) => {
|
|
9
|
+
const { state } = useVisualEditorContext();
|
|
10
|
+
const [isInputVisible, setIsInputVisible] = useState(false);
|
|
11
|
+
const [input, setInput] = useState('');
|
|
12
|
+
const [animationTimer1, setAnimationTimer1] = useState();
|
|
13
|
+
const [animationTimer2, setAnimationTimer2] = useState();
|
|
14
|
+
const [animationOn, setAnimationOn] = useState(false);
|
|
15
|
+
const [isInputValid, setIsInputValid] = useState(true);
|
|
16
|
+
const onIconClicked = (event) => {
|
|
17
|
+
event.preventDefault();
|
|
18
|
+
event.stopPropagation();
|
|
19
|
+
setIsInputVisible(!isInputVisible);
|
|
20
|
+
};
|
|
21
|
+
const onInputChanged = (input) => {
|
|
22
|
+
setInput(input);
|
|
23
|
+
};
|
|
24
|
+
const onInputCommitted = (input) => {
|
|
25
|
+
onChangeCommitted(Number(input));
|
|
26
|
+
};
|
|
27
|
+
useEffect(() => {
|
|
28
|
+
clearTimeout(animationTimer1);
|
|
29
|
+
clearTimeout(animationTimer2);
|
|
30
|
+
setAnimationOn(false);
|
|
31
|
+
if (isInputValid) {
|
|
32
|
+
setAnimationTimer1(setTimeout(() => setAnimationOn(true), 10));
|
|
33
|
+
setAnimationTimer2(setTimeout(() => setAnimationOn(false), 1500));
|
|
34
|
+
}
|
|
35
|
+
return () => {
|
|
36
|
+
setAnimationOn(false);
|
|
37
|
+
clearTimeout(animationTimer1);
|
|
38
|
+
clearTimeout(animationTimer2);
|
|
39
|
+
};
|
|
40
|
+
}, [input]);
|
|
41
|
+
const isInputValidForCommit = (userInput) => {
|
|
42
|
+
const valid = !!state.originalPositions && (!!userInput.trim() && Number(userInput) <= Object.entries(state.originalPositions).length) && userInput.trim() !== '0';
|
|
43
|
+
setIsInputValid(valid);
|
|
44
|
+
return valid;
|
|
45
|
+
};
|
|
46
|
+
return (_jsxs("div", Object.assign({ className: classes.positioningContainer }, { children: [_jsx("span", Object.assign({ onClick: onIconClicked, className: classes.iconWrapper }, { children: _jsx(PositionIcon, {}) })), _jsx("span", Object.assign({ className: clsx(classes.inputContainerWrapper, isInputVisible ? classes.inputContainerWrapperVisible : '') }, { children: _jsx(Input, { initialInput: String(currentPosition), onChange: onInputChanged, onCompleted: onInputCommitted, debounceTime: 1500, type: 'num', isInputValidForCommit: isInputValidForCommit, customClasses: {
|
|
47
|
+
input: clsx(classes.input, isInputVisible ? classes.inputVisible : '', animationOn ? classes.inputAnimation : '', !isInputValid ? classes.inputError : ''),
|
|
48
|
+
container: classes.inputContainer
|
|
49
|
+
} }) }))] })));
|
|
50
|
+
};
|
|
51
|
+
export default Positioning;
|
|
52
|
+
//# sourceMappingURL=Positioning.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Positioning.js","sourceRoot":"","sources":["../../../../../../../../../../../dashboard/dashboard-client/src/pages/LandingPages/editor/components/Positioning/Positioning.tsx"],"names":[],"mappings":";AAAA,OAAO,OAAO,MAAM,qBAAqB,CAAC;AAC1C,OAAO,EAA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C,CAAC,CAAC,EAAE,CAAC,gBAChH,KAAC,KAAK,IAAC,YAAY,EAAE,MAAM,CAAC,eAAe,CAAC,EACrC,QAAQ,EAAE,cAAc,EACxB,WAAW,EAAE,gBAAgB,EAC7B,YAAY,EAAE,IAAI,EAClB,IAAI,EAAE,KAAK,EACX,qBAAqB,EAAE,qBAAqB,EAC5C,aAAa,EAAE;wBACb,KAAK,EAAE,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,cAAc,CAAC,CAAC,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC,CAAC,EAAE,EAAE,WAAW,CAAC,CAAC,CAAC,OAAO,CAAC,cAAc,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,YAAY,CAAC,CAAC,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,CAAC;wBAC1J,SAAS,EAAE,OAAO,CAAC,cAAc;qBAAC,GAAG,IACzC,KACD,CACT,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,WAAW,CAAC","sourcesContent":["import classes from \"./styles.module.css\";\r\nimport {PositionIcon} from \"../../../../../../../../frontends/dashboard-utilities/src/icons/PositionIcon\";\r\nimport React, {useEffect, useState} from \"react\";\r\nimport Input from \"../../../../../../../../frontends/dashboard-utilities/src/components/Input/Input\";\r\nimport clsx from \"clsx\";\r\nimport {useVisualEditorContext} from \"../../context/visualEditorContext\";\r\n\r\ninterface Props {\r\n onChangeCommitted: (newPosition: number) => void;\r\n\r\n currentPosition?: number;\r\n}\r\n\r\nconst Positioning = ({onChangeCommitted, currentPosition}: Props) => {\r\n const {state} = useVisualEditorContext();\r\n\r\n const [isInputVisible, setIsInputVisible] = useState(false);\r\n const [input, setInput] = useState('');\r\n const [animationTimer1, setAnimationTimer1] = useState<NodeJS.Timeout>();\r\n const [animationTimer2, setAnimationTimer2] = useState<NodeJS.Timeout>();\r\n\r\n const [animationOn, setAnimationOn] = useState(false);\r\n const [isInputValid, setIsInputValid] = useState(true);\r\n\r\n const onIconClicked = (event: any) => {\r\n event.preventDefault();\r\n event.stopPropagation();\r\n setIsInputVisible(!isInputVisible);\r\n }\r\n\r\n const onInputChanged = (input: string) => {\r\n setInput(input);\r\n }\r\n\r\n const onInputCommitted = (input: string) => {\r\n onChangeCommitted(Number(input));\r\n }\r\n\r\n useEffect(() => {\r\n clearTimeout(animationTimer1);\r\n clearTimeout(animationTimer2);\r\n setAnimationOn(false);\r\n if(isInputValid) {\r\n setAnimationTimer1(setTimeout(() => setAnimationOn(true), 10));\r\n setAnimationTimer2(setTimeout(() => setAnimationOn(false), 1500));\r\n }\r\n return () => {\r\n setAnimationOn(false);\r\n clearTimeout(animationTimer1);\r\n clearTimeout(animationTimer2);\r\n }\r\n }, [input]);\r\n\r\n const isInputValidForCommit = (userInput: string) => {\r\n const valid = !!state.originalPositions && (!!userInput.trim() && Number(userInput) <= Object.entries(state.originalPositions).length) && userInput.trim() !== '0';\r\n setIsInputValid(valid);\r\n return valid;\r\n }\r\n\r\n return (\r\n <div className={classes.positioningContainer}>\r\n <span onClick={onIconClicked} className={classes.iconWrapper}>\r\n <PositionIcon/>\r\n </span>\r\n <span className={clsx(classes.inputContainerWrapper, isInputVisible ? classes.inputContainerWrapperVisible : '')}>\r\n <Input initialInput={String(currentPosition)}\r\n onChange={onInputChanged}\r\n onCompleted={onInputCommitted}\r\n debounceTime={1500}\r\n type={'num'}\r\n isInputValidForCommit={isInputValidForCommit}\r\n customClasses={{\r\n input: clsx(classes.input, isInputVisible ? classes.inputVisible : '', animationOn ? classes.inputAnimation : '', !isInputValid ? classes.inputError : ''),\r\n container: classes.inputContainer}}/>\r\n </span>\r\n </div>\r\n );\r\n};\r\n\r\nexport default Positioning;\r\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from "./Positioning";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../../../../../dashboard/dashboard-client/src/pages/LandingPages/editor/components/Positioning/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC","sourcesContent":["export { default } from \"./Positioning\";\r\n"]}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { EditorProduct } from "../../../../../../../../frontends/dashboard-utilities/src/@types/editorProduct";
|
|
3
|
+
import { ActionItem as ActionItemType, ActionItem } from "../ActionsBar/utils";
|
|
4
|
+
interface CustomClasses {
|
|
5
|
+
productCard?: string;
|
|
6
|
+
actionsContainer?: string;
|
|
7
|
+
}
|
|
8
|
+
export interface Props {
|
|
9
|
+
product: EditorProduct;
|
|
10
|
+
position?: number;
|
|
11
|
+
onClick: (event: React.MouseEvent<HTMLDivElement>) => void;
|
|
12
|
+
isSelected: boolean;
|
|
13
|
+
renderingRules?: {
|
|
14
|
+
actionsBar: boolean;
|
|
15
|
+
label: boolean;
|
|
16
|
+
sku: boolean;
|
|
17
|
+
};
|
|
18
|
+
customClasses?: CustomClasses;
|
|
19
|
+
onActionClicked?: (action: ActionItem) => void;
|
|
20
|
+
actionBarItems?: ActionItemType[];
|
|
21
|
+
onDropClicked?: (position: number) => void;
|
|
22
|
+
}
|
|
23
|
+
declare const ProductCard: React.FC<Props>;
|
|
24
|
+
export default ProductCard;
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useCallback, useState } from "react";
|
|
3
|
+
import clsx from "clsx";
|
|
4
|
+
import classes from "./styles.module.css";
|
|
5
|
+
import { useVisualEditorContext } from "../../context/visualEditorContext";
|
|
6
|
+
import { NO_IMAGE } from "./utils";
|
|
7
|
+
import ProductLabel from "./components/ProductLabel/ProductLabel";
|
|
8
|
+
import ActionsBar from "../ActionsBar/ActionsBar";
|
|
9
|
+
const ProductCard = ({ product, position, onClick, isSelected, renderingRules, customClasses, onActionClicked, actionBarItems, onDropClicked, }) => {
|
|
10
|
+
const { state, dispatcher } = useVisualEditorContext();
|
|
11
|
+
const [isActionbarVisible, setIsActionbarVisible] = useState(false);
|
|
12
|
+
const promote = (productsCopy, productIndex) => {
|
|
13
|
+
productsCopy[productIndex]["productLabel"] = "Promoted";
|
|
14
|
+
if (state.searchWithinResultsQuery != "" ||
|
|
15
|
+
Object.keys(state.narrow).length) {
|
|
16
|
+
dispatcher.setProducts(productsCopy);
|
|
17
|
+
}
|
|
18
|
+
else {
|
|
19
|
+
productsCopy = [productsCopy.splice(productIndex, 1)[0], ...productsCopy];
|
|
20
|
+
dispatcher.setProducts(productsCopy);
|
|
21
|
+
}
|
|
22
|
+
dispatcher.setPromoted([
|
|
23
|
+
product.id,
|
|
24
|
+
...state.promoted.filter((id) => id !== product.id),
|
|
25
|
+
]);
|
|
26
|
+
};
|
|
27
|
+
const remove = (productsCopy, productIndex, pos) => {
|
|
28
|
+
dispatcher.setPromoted(state.promoted.filter((id) => id !== product.id));
|
|
29
|
+
productsCopy.splice(productIndex, 1);
|
|
30
|
+
dispatcher.setProducts(productsCopy);
|
|
31
|
+
};
|
|
32
|
+
const onActionClick = useCallback((action, newPosition) => {
|
|
33
|
+
if (onActionClicked) {
|
|
34
|
+
onActionClicked(action);
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
if (!position) {
|
|
38
|
+
return;
|
|
39
|
+
}
|
|
40
|
+
const productsCopy = [...state.products];
|
|
41
|
+
const productIndex = position - 1;
|
|
42
|
+
if (action.name === "promote") {
|
|
43
|
+
promote(productsCopy, productIndex);
|
|
44
|
+
}
|
|
45
|
+
else if (action.name === "remove") {
|
|
46
|
+
remove(productsCopy, productIndex);
|
|
47
|
+
}
|
|
48
|
+
}, [Object.assign({}, dispatcher)]);
|
|
49
|
+
const onDrop = (event) => {
|
|
50
|
+
if (position !== undefined) {
|
|
51
|
+
event.stopPropagation();
|
|
52
|
+
event.preventDefault();
|
|
53
|
+
onDropClicked === null || onDropClicked === void 0 ? void 0 : onDropClicked(position !== null && position !== void 0 ? position : -1);
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
const getSmallImage = (url) => {
|
|
57
|
+
if (!url || !url.includes("cdn.shopify")) {
|
|
58
|
+
// temp solution, pass the platform as a prop
|
|
59
|
+
return url;
|
|
60
|
+
}
|
|
61
|
+
url = url.replace("_large.", ".").replace("_small.", ".");
|
|
62
|
+
const splattedURL = url.split(".");
|
|
63
|
+
splattedURL[splattedURL.length - 2] = `${splattedURL[splattedURL.length - 2]}_300x`;
|
|
64
|
+
return splattedURL.join(".");
|
|
65
|
+
};
|
|
66
|
+
const getPosition = useCallback(() => {
|
|
67
|
+
var _a;
|
|
68
|
+
const pinProduct = (_a = state.pinned) === null || _a === void 0 ? void 0 : _a.find((pin) => pin[1] === product.id);
|
|
69
|
+
if ((state.searchWithinResultsQuery || Object.keys(state.narrow).length) &&
|
|
70
|
+
pinProduct) {
|
|
71
|
+
return pinProduct[0] + 1;
|
|
72
|
+
}
|
|
73
|
+
else if (state.searchWithinResultsQuery ||
|
|
74
|
+
Object.keys(state.narrow).length) {
|
|
75
|
+
return undefined;
|
|
76
|
+
}
|
|
77
|
+
return position;
|
|
78
|
+
}, [position, product.id, state.searchWithinResultsQuery, state.narrow]);
|
|
79
|
+
return (_jsxs("div", Object.assign({ className: clsx(classes.productCard, isSelected ? classes.selectedProductCard : "", customClasses === null || customClasses === void 0 ? void 0 : customClasses.productCard, "product-card"), onClick: (event) => onClick(event), onMouseLeave: () => setIsActionbarVisible(false), onMouseEnter: () => setIsActionbarVisible(true), onMouseOver: () => setIsActionbarVisible(true) }, { children: [_jsxs("div", Object.assign({ className: classes.imageAndActionsContainer }, { children: [_jsx(ProductLabel, {
|
|
80
|
+
// position={(!state.searchWithinResultsQuery && !Object.keys(state.narrow).length) ? (!state.loading.products ? position : position || undefined) : positionInSearchWithin}
|
|
81
|
+
position: position, label: product === null || product === void 0 ? void 0 : product.productLabel, isUnpublished: product === null || product === void 0 ? void 0 : product.is_unpublished, onlyUnpublished: false, sellable: !(product === null || product === void 0 ? void 0 : product.iso) }, product.id + "_" + (product === null || product === void 0 ? void 0 : product.productLabel)), _jsx("div", Object.assign({ className: classes.imageWrapper }, { children: _jsx("img", { src: getSmallImage(product === null || product === void 0 ? void 0 : product.t) ||
|
|
82
|
+
getSmallImage(product === null || product === void 0 ? void 0 : product.t2) ||
|
|
83
|
+
NO_IMAGE, alt: "product image", className: classes.image, onError: (event) => (event.target.src = NO_IMAGE) }) })), (renderingRules === null || renderingRules === void 0 ? void 0 : renderingRules.actionsBar) && isActionbarVisible && (_jsx(ActionsBar, { onClick: onActionClick, className: clsx(classes.actionsContainer, customClasses === null || customClasses === void 0 ? void 0 : customClasses.actionsContainer), product: product, actionBarItems: actionBarItems, position: getPosition() }))] })), _jsxs("div", Object.assign({ className: classes.productInfoContainer }, { children: [_jsx("div", Object.assign({ className: clsx(classes.productTitle, classes.ellipsisTitle, classes.twoRows) }, { children: product.l })), (renderingRules === null || renderingRules === void 0 ? void 0 : renderingRules.sku) && (_jsx("div", Object.assign({ className: classes.productSku }, { children: product.sku }))), _jsx("div", Object.assign({ className: classes.productInfoContentWrapper }, { children: _jsx("div", Object.assign({ className: clsx(classes.productInfoContent
|
|
84
|
+
? classes.productInfoContentWithSells
|
|
85
|
+
: "") }, { children: product.p !== "0.00" && (_jsxs("div", Object.assign({ className: classes.productPriceContainer }, { children: [Number(product.p_c) ? (_jsxs("div", Object.assign({ className: classes.productCompare }, { children: ["$", product.p_c] }))) : null, _jsxs("div", Object.assign({ className: clsx(classes.productPrice, Number(product.p_c) ? classes.productPriceWithCompare : "") }, { children: ["$", product.p] }))] }))) })) }))] }))] })));
|
|
86
|
+
};
|
|
87
|
+
export default ProductCard;
|
|
88
|
+
//# sourceMappingURL=ProductCard.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ProductCard.js","sourceRoot":"","sources":["../../../../../../../../../../../dashboard/dashboard-client/src/pages/LandingPages/editor/components/ProductCard/ProductCard.tsx"],"names":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YAAY,EACpB,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,uBAAuB,CAAC,CAAC,CAAC,EAAE,CAC3D,sBAEC,OAAO,CAAC,CAAC,KACP,KACF,CACP,IACG,IACF,KACF,KACF,CACP,CAAC;AACJ,CAAC,CAAC;AACF,eAAe,WAAW,CAAC","sourcesContent":["import React, { useCallback, useEffect, useMemo, useState } from \"react\";\nimport clsx from \"clsx\";\nimport { EditorProduct } from \"../../../../../../../../frontends/dashboard-utilities/src/@types/editorProduct\";\nimport { ProductsUtils } from \"../../../../../../../../frontends/dashboard-utilities/src/utils/products\";\nimport classes from \"./styles.module.css\";\nimport { useVisualEditorContext } from \"../../context/visualEditorContext\";\nimport { NO_IMAGE } from \"./utils\";\nimport ProductLabel from \"./components/ProductLabel/ProductLabel\";\nimport ActionsBar from \"../ActionsBar/ActionsBar\";\nimport { ActionItem as ActionItemType, ActionItem } from \"../ActionsBar/utils\";\n\ninterface CustomClasses {\n productCard?: string;\n actionsContainer?: string;\n}\n\nexport interface Props {\n product: EditorProduct;\n position?: number;\n onClick: (event: React.MouseEvent<HTMLDivElement>) => void;\n isSelected: boolean;\n renderingRules?: {\n actionsBar: boolean;\n label: boolean;\n sku: boolean;\n };\n customClasses?: CustomClasses;\n\n onActionClicked?: (action: ActionItem) => void;\n\n actionBarItems?: ActionItemType[];\n onDropClicked?: (position: number) => void;\n}\n\nconst ProductCard: React.FC<Props> = ({\n product,\n position,\n onClick,\n isSelected,\n renderingRules,\n customClasses,\n onActionClicked,\n actionBarItems,\n onDropClicked,\n}) => {\n const { state, dispatcher } = useVisualEditorContext();\n\n const [isActionbarVisible, setIsActionbarVisible] = useState(false);\n\n const promote = (productsCopy: EditorProduct[], productIndex: number) => {\n productsCopy[productIndex][\"productLabel\"] = \"Promoted\";\n if (\n state.searchWithinResultsQuery != \"\" ||\n Object.keys(state.narrow).length\n ) {\n dispatcher.setProducts(productsCopy);\n } else {\n productsCopy = [productsCopy.splice(productIndex, 1)[0], ...productsCopy];\n dispatcher.setProducts(productsCopy);\n }\n dispatcher.setPromoted([\n product.id,\n ...state.promoted.filter((id) => id !== product.id),\n ]);\n };\n const remove = (\n productsCopy: EditorProduct[],\n productIndex: number,\n pos?: number\n ) => {\n dispatcher.setPromoted(state.promoted.filter((id) => id !== product.id));\n productsCopy.splice(productIndex, 1);\n dispatcher.setProducts(productsCopy);\n };\n\n const onActionClick = useCallback(\n (action: ActionItem, newPosition?: number) => {\n if (onActionClicked) {\n onActionClicked(action);\n return;\n }\n if (!position) {\n return;\n }\n const productsCopy = [...state.products];\n const productIndex = position - 1;\n if (action.name === \"promote\") {\n promote(productsCopy, productIndex);\n } else if (action.name === \"remove\") {\n remove(productsCopy, productIndex);\n }\n },\n [{ ...dispatcher }]\n );\n\n const onDrop = (event: any) => {\n if (position !== undefined) {\n event.stopPropagation();\n event.preventDefault();\n onDropClicked?.(position ?? -1);\n }\n };\n\n const getSmallImage = (url?: string) => {\n if (!url || !url.includes(\"cdn.shopify\")) {\n // temp solution, pass the platform as a prop\n return url;\n }\n url = url.replace(\"_large.\", \".\").replace(\"_small.\", \".\");\n const splattedURL = url.split(\".\");\n splattedURL[splattedURL.length - 2] = `${\n splattedURL[splattedURL.length - 2]\n }_300x`;\n return splattedURL.join(\".\");\n };\n\n const getPosition = useCallback(() => {\n const pinProduct = state.pinned?.find((pin) => pin[1] === product.id);\n if (\n (state.searchWithinResultsQuery || Object.keys(state.narrow).length) &&\n pinProduct\n ) {\n return pinProduct[0] + 1;\n } else if (\n state.searchWithinResultsQuery ||\n Object.keys(state.narrow).length\n ) {\n return undefined;\n }\n return position;\n }, [position, product.id, state.searchWithinResultsQuery, state.narrow]);\n\n return (\n <div\n className={clsx(\n classes.productCard,\n isSelected ? classes.selectedProductCard : \"\",\n customClasses?.productCard,\n \"product-card\"\n )}\n onClick={(event) => onClick(event)}\n onMouseLeave={() => setIsActionbarVisible(false)}\n onMouseEnter={() => setIsActionbarVisible(true)}\n onMouseOver={() => setIsActionbarVisible(true)}\n >\n <div className={classes.imageAndActionsContainer}>\n <ProductLabel\n key={product.id + \"_\" + product?.productLabel}\n // position={(!state.searchWithinResultsQuery && !Object.keys(state.narrow).length) ? (!state.loading.products ? position : position || undefined) : positionInSearchWithin}\n position={position}\n label={product?.productLabel}\n isUnpublished={product?.is_unpublished}\n onlyUnpublished={false}\n sellable={!product?.iso}\n />\n\n <div className={classes.imageWrapper}>\n <img\n src={\n getSmallImage(product?.t) ||\n getSmallImage(product?.t2) ||\n NO_IMAGE\n }\n alt={\"product image\"}\n className={classes.image}\n onError={(event) => ((event.target as any).src = NO_IMAGE)}\n />\n </div>\n {renderingRules?.actionsBar && isActionbarVisible && (\n <ActionsBar\n onClick={onActionClick}\n className={clsx(\n classes.actionsContainer,\n customClasses?.actionsContainer\n )}\n product={product}\n actionBarItems={actionBarItems}\n position={getPosition()}\n />\n )}\n {/*{renderingRules.sevenDaysSells && product?.inv_sale && (*/}\n {/* <InventoryInfo*/}\n {/* product={product}*/}\n {/* isOverlayOpen={isInventoryOverlayOpen || isInventoryOverlayPinned}*/}\n {/* />*/}\n {/*)}*/}\n </div>\n <div className={classes.productInfoContainer}>\n <div\n className={clsx(\n classes.productTitle,\n classes.ellipsisTitle,\n classes.twoRows\n )}\n >\n {product.l}\n </div>\n\n {renderingRules?.sku && (\n <div className={classes.productSku}>{product.sku}</div>\n )}\n\n <div className={classes.productInfoContentWrapper}>\n <div\n className={clsx(\n classes.productInfoContent\n ? classes.productInfoContentWithSells\n : \"\"\n )}\n >\n {product.p !== \"0.00\" && (\n <div className={classes.productPriceContainer}>\n {Number(product.p_c) ? (\n <div className={classes.productCompare}>${product.p_c}</div>\n ) : null}\n\n <div\n className={clsx(\n classes.productPrice,\n Number(product.p_c) ? classes.productPriceWithCompare : \"\"\n )}\n >\n ${product.p}\n </div>\n </div>\n )}\n </div>\n </div>\n </div>\n </div>\n );\n};\nexport default ProductCard;\n"]}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ProductLabelType } from "../../../../../../../../../../frontends/dashboard-utilities/src/@types/productLabel";
|
|
3
|
+
export interface Props {
|
|
4
|
+
position?: number;
|
|
5
|
+
label?: ProductLabelType;
|
|
6
|
+
isUnpublished?: boolean;
|
|
7
|
+
onlyUnpublished?: boolean;
|
|
8
|
+
sellable?: boolean;
|
|
9
|
+
}
|
|
10
|
+
declare const ProductLabel: React.FC<Props>;
|
|
11
|
+
export default ProductLabel;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import classes from './styles.module.css';
|
|
3
|
+
import { labelToColorDict } from "./utils";
|
|
4
|
+
const ProductLabel = ({ position, label, isUnpublished, onlyUnpublished, sellable }) => {
|
|
5
|
+
return (_jsxs("div", Object.assign({ className: classes.productLabelContainer }, { children: [_jsxs("div", Object.assign({ className: classes.badgesContainer }, { children: [!onlyUnpublished && label &&
|
|
6
|
+
_jsx("div", Object.assign({ className: classes.labelText, style: { backgroundColor: labelToColorDict[label], color: "white" } }, { children: label })), isUnpublished &&
|
|
7
|
+
_jsx("div", Object.assign({ className: classes.labelText, style: { backgroundColor: labelToColorDict['Unpublished'], color: "white", marginTop: "2px" } }, { children: "Unpublished" })), !sellable && !isUnpublished &&
|
|
8
|
+
_jsx("div", Object.assign({ className: classes.labelText, style: { backgroundColor: 'black', color: "white", marginTop: "2px" } }, { children: "Out of Stock" }))] })), !onlyUnpublished && position !== undefined && (_jsx("div", Object.assign({ className: classes.productPosition }, { children: position })))] })));
|
|
9
|
+
};
|
|
10
|
+
export default ProductLabel;
|
|
11
|
+
//# sourceMappingURL=ProductLabel.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ProductLabel.js","sourceRoot":"","sources":["../../../../../../../../../../../../../dashboard/dashboard-client/src/pages/LandingPages/editor/components/ProductCard/components/ProductLabel/ProductLabel.tsx"],"names":[],"mappings":";AACA,OAAO,OAAO,MAAM,qBAAqB,CAAC;AAC1C,OAAO,EAAC,gBAAgB,EAAC,MAAM,SAAS,CAAC;AAYzC,MAAM,YAAY,GAAoB,CAAC,EAAC,QAAQ,EAAE,KAAK,EAAE,aAAa,EAAE,eAAe,EAAE,QAAQ,EAAC,EAAE,EAAE;IAClG,OAAO,CACH,6BAAK,SAAS,EAAE,OAAO,CAAC,qBAAqB,iBACzC,6BAAK,SAAS,EAAE,OAAO,CAAC,eAAe,iBAClC,CAAC,eAAe,IAAI,KAAK;wBACtB,4BAAK,SAAS,EAAE,OAAO,CAAC,SAAS,EAAE,KAAK,EAAE,EAAC,eAAe,EAAE,gBAAgB,CAAC,KAAK,CAAC,EAAE,KAAK,EAAE,OAAO,EAAC,gBAC/F,KAAK,IACJ,EAET,aAAa;wBACV,4BAAK,SAAS,EAAE,OAAO,CAAC,SAAS,EAAE,KAAK,EAAE,EAAC,eAAe,EAAE,gBAAgB,CAAC,aAAa,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,SAAS,EAAE,KAAK,EAAC,iCAExH,EAET,CAAC,QAAQ,IAAI,CAAC,aAAa;wBACxB,4BAAK,SAAS,EAAE,OAAO,CAAC,SAAS,EAAE,KAAK,EAAE,EAAC,eAAe,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,SAAS,EAAE,KAAK,EAAC,kCAEhG,KAER,EACL,CAAC,eAAe,IAAI,QAAQ,KAAK,SAAS,IAAI,CAC3C,4BAAK,SAAS,EAAE,OAAO,CAAC,eAAe,gBAAG,QAAQ,IAAO,CAC5D,KAEC,CACT,CAAC;AACN,CAAC,CAAA;AACD,eAAe,YAAY,CAAC","sourcesContent":["import React, {useEffect} from 'react';\r\nimport classes from './styles.module.css';\r\nimport {labelToColorDict} from \"./utils\";\r\nimport {ProductLabelType} from \"../../../../../../../../../../frontends/dashboard-utilities/src/@types/productLabel\";\r\n\r\nexport interface Props {\r\n position?: number;\r\n label?: ProductLabelType;\r\n isUnpublished?: boolean;\r\n\r\n onlyUnpublished?: boolean;\r\n sellable?: boolean;\r\n}\r\n\r\nconst ProductLabel: React.FC<Props> = ({position, label, isUnpublished, onlyUnpublished, sellable}) => {\r\n return (\r\n <div className={classes.productLabelContainer}>\r\n <div className={classes.badgesContainer}>\r\n {!onlyUnpublished && label &&\r\n <div className={classes.labelText} style={{backgroundColor: labelToColorDict[label], color: \"white\"}}>\r\n {label}\r\n </div>\r\n }\r\n {isUnpublished &&\r\n <div className={classes.labelText} style={{backgroundColor: labelToColorDict['Unpublished'], color: \"white\", marginTop: \"2px\"}}>\r\n Unpublished\r\n </div>\r\n }\r\n {!sellable && !isUnpublished &&\r\n <div className={classes.labelText} style={{backgroundColor: 'black', color: \"white\", marginTop: \"2px\"}}>\r\n Out of Stock\r\n </div>\r\n }\r\n </div>\r\n {!onlyUnpublished && position !== undefined && (\r\n <div className={classes.productPosition}>{position}</div>\r\n )}\r\n\r\n </div>\r\n );\r\n}\r\nexport default ProductLabel;\r\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../../../../../../../../../../../dashboard/dashboard-client/src/pages/LandingPages/editor/components/ProductCard/components/ProductLabel/utils.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC5B,UAAU,EAAE,SAAS;IACrB,UAAU,EAAE,SAAS;IACrB,QAAQ,EAAE,SAAS;IACnB,QAAQ,EAAE,SAAS;IACnB,QAAQ,EAAE,SAAS;IACnB,aAAa,EAAE,WAAW;CAC7B,CAAA","sourcesContent":["export const labelToColorDict = {\r\n 'Promoted': '#008847',\r\n 'Selected': '#008847',\r\n 'Pinned': '#0093E5',\r\n 'Buried': '#EA0C19',\r\n 'Hidden': '#EA0C19',\r\n 'Unpublished': '#880000d1'\r\n}"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const NO_IMAGE: string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../../../../../../../../../dashboard/dashboard-client/src/pages/LandingPages/editor/components/ProductCard/utils.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,QAAQ,GAAG,GAAG,MAAM,CAAC,QAAQ,CAAC,QAAQ,oDAAoD,CAAA","sourcesContent":["export const NO_IMAGE = `${window.location.protocol}//magento.instantsearchplus.com/images/missing.gif`\r\n"]}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import classes from "./styles.module.css";
|
|
3
|
+
const SelectCard = ({ numSelected }) => {
|
|
4
|
+
console.log({ numSelected: numSelected });
|
|
5
|
+
return (_jsx("div", Object.assign({ className: classes.selectCardContainer }, { children: _jsx("div", Object.assign({ className: classes.selectCardText }, { children: numSelected })) })));
|
|
6
|
+
};
|
|
7
|
+
export default SelectCard;
|
|
8
|
+
//# sourceMappingURL=SelectCard.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SelectCard.js","sourceRoot":"","sources":["../../../../../../../../../../../dashboard/dashboard-client/src/pages/LandingPages/editor/components/SelectCard/SelectCard.tsx"],"names":[],"mappings":";AAAA,OAAO,OAAO,MAAM,qBAAqB,CAAC;AAM1C,MAAM,UAAU,GAAG,CAAC,EAAE,WAAW,EAAmB,EAAE,EAAE;IACpD,OAAO,CAAC,GAAG,CAAC,EAAC,WAAW,EAAE,WAAW,EAAC,CAAC,CAAA;IACzC,OAAO,CACL,4BAAK,SAAS,EAAE,OAAO,CAAC,mBAAmB,gBACzC,4BAAK,SAAS,EAAE,OAAO,CAAC,cAAc,gBAAG,WAAW,IAAO,IACvD,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,UAAU,CAAC","sourcesContent":["import classes from \"./styles.module.css\";\r\n\r\ninterface SelectCardProps {\r\n numSelected: number;\r\n}\r\n\r\nconst SelectCard = ({ numSelected }: SelectCardProps) => {\r\n console.log({numSelected: numSelected})\r\n return (\r\n <div className={classes.selectCardContainer}>\r\n <div className={classes.selectCardText}>{numSelected}</div>\r\n </div>\r\n );\r\n};\r\n\r\nexport default SelectCard;\r\n"]}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { EditorProduct } from "../../../../../../../frontends/dashboard-utilities/src/@types/editorProduct";
|
|
3
|
+
import { Facet, Narrow } from "@fast-simon/utilities";
|
|
4
|
+
import { MenuItemName } from "../../../../../../../frontends/dashboard-utilities/src/@types/sideMenu";
|
|
5
|
+
import { Banner } from "../../../../../../../frontends/dashboard-utilities/src/@types/banner";
|
|
6
|
+
export type PinnedProduct = [number, string];
|
|
7
|
+
export interface ContextDataLoading {
|
|
8
|
+
products: boolean;
|
|
9
|
+
}
|
|
10
|
+
export interface VisualEditorContextDataType {
|
|
11
|
+
products: EditorProduct[];
|
|
12
|
+
loading: ContextDataLoading;
|
|
13
|
+
page: number;
|
|
14
|
+
narrow: Narrow;
|
|
15
|
+
searchWithinResultsQuery?: string;
|
|
16
|
+
selectedNavItemName: MenuItemName;
|
|
17
|
+
totalResults: number;
|
|
18
|
+
totalPages: number;
|
|
19
|
+
facets: Facet[];
|
|
20
|
+
selectedProductIds: Record<string, number>;
|
|
21
|
+
selectedProductIdsArray: string[];
|
|
22
|
+
originalPositions?: Record<string, number>;
|
|
23
|
+
pinned?: PinnedProduct[];
|
|
24
|
+
promoted: string[];
|
|
25
|
+
buried?: string[];
|
|
26
|
+
hidden?: string[];
|
|
27
|
+
allProductsIds: string[];
|
|
28
|
+
sideMenuSelectedProductIds: Record<string, number>;
|
|
29
|
+
isDragAndDropActive: boolean;
|
|
30
|
+
isDragToSelectActive: boolean;
|
|
31
|
+
isCutting: boolean;
|
|
32
|
+
selectedProducts: EditorProduct[];
|
|
33
|
+
selectedBannerId?: string;
|
|
34
|
+
banners: Banner[];
|
|
35
|
+
landingPageID?: string;
|
|
36
|
+
uuid: string;
|
|
37
|
+
storeID: number;
|
|
38
|
+
query?: string;
|
|
39
|
+
}
|
|
40
|
+
export interface VisualEditorDispatcherContextType {
|
|
41
|
+
setProducts: React.Dispatch<React.SetStateAction<EditorProduct[]>>;
|
|
42
|
+
setLoading: React.Dispatch<React.SetStateAction<ContextDataLoading>>;
|
|
43
|
+
setPage: React.Dispatch<React.SetStateAction<number>>;
|
|
44
|
+
setNarrow: React.Dispatch<React.SetStateAction<Narrow>>;
|
|
45
|
+
setSearchWithinResultsQuery: React.Dispatch<React.SetStateAction<string>>;
|
|
46
|
+
setSelectedNavItemName: React.Dispatch<React.SetStateAction<MenuItemName>>;
|
|
47
|
+
setPinned?: React.Dispatch<React.SetStateAction<PinnedProduct[]>>;
|
|
48
|
+
setPromoted: React.Dispatch<React.SetStateAction<string[]>>;
|
|
49
|
+
setBuried?: React.Dispatch<React.SetStateAction<string[]>>;
|
|
50
|
+
setHidden?: React.Dispatch<React.SetStateAction<string[]>>;
|
|
51
|
+
setFacets: React.Dispatch<React.SetStateAction<Facet[]>>;
|
|
52
|
+
setSelectedProductIds: React.Dispatch<React.SetStateAction<Record<string, number>>>;
|
|
53
|
+
setSelectedBannerId: React.Dispatch<React.SetStateAction<string>>;
|
|
54
|
+
setSideMenuSelectedProductIds: React.Dispatch<React.SetStateAction<Record<string, number>>>;
|
|
55
|
+
setIsDragAndDropActive: React.Dispatch<React.SetStateAction<boolean>>;
|
|
56
|
+
setIsDragToSelectActive: React.Dispatch<React.SetStateAction<boolean>>;
|
|
57
|
+
setIsCutting: React.Dispatch<React.SetStateAction<boolean>>;
|
|
58
|
+
setSelectedProducts: React.Dispatch<React.SetStateAction<EditorProduct[]>>;
|
|
59
|
+
setSelectedProductIdsArray: React.Dispatch<React.SetStateAction<string[]>>;
|
|
60
|
+
}
|
|
61
|
+
export declare const VisualEditorContext: React.Context<VisualEditorContextDataType>;
|
|
62
|
+
export declare const VisualEditorDispatchContext: React.Context<VisualEditorDispatcherContextType>;
|
|
63
|
+
export declare const useVisualEditorContext: () => {
|
|
64
|
+
state: VisualEditorContextDataType;
|
|
65
|
+
dispatcher: VisualEditorDispatcherContextType;
|
|
66
|
+
};
|
package/dist/dashboard/dashboard-client/src/pages/LandingPages/editor/context/visualEditorContext.js
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { createContext, useContext } from "react";
|
|
2
|
+
export const VisualEditorContext = createContext({
|
|
3
|
+
products: [],
|
|
4
|
+
loading: {
|
|
5
|
+
products: false
|
|
6
|
+
},
|
|
7
|
+
page: 1,
|
|
8
|
+
narrow: {},
|
|
9
|
+
selectedNavItemName: 'general',
|
|
10
|
+
promoted: [],
|
|
11
|
+
totalResults: 0,
|
|
12
|
+
totalPages: 0,
|
|
13
|
+
facets: [],
|
|
14
|
+
selectedProductIds: {},
|
|
15
|
+
selectedProductIdsArray: [],
|
|
16
|
+
allProductsIds: [],
|
|
17
|
+
banners: [],
|
|
18
|
+
selectedBannerId: "",
|
|
19
|
+
sideMenuSelectedProductIds: {},
|
|
20
|
+
isDragAndDropActive: false,
|
|
21
|
+
isDragToSelectActive: false,
|
|
22
|
+
isCutting: false,
|
|
23
|
+
selectedProducts: [],
|
|
24
|
+
uuid: '',
|
|
25
|
+
storeID: 0,
|
|
26
|
+
landingPageID: '',
|
|
27
|
+
});
|
|
28
|
+
export const VisualEditorDispatchContext = createContext({
|
|
29
|
+
setProducts: () => { },
|
|
30
|
+
setLoading: () => { },
|
|
31
|
+
setPage: () => { },
|
|
32
|
+
setNarrow: () => { },
|
|
33
|
+
setSearchWithinResultsQuery: () => { },
|
|
34
|
+
setSelectedNavItemName: () => { },
|
|
35
|
+
setPromoted: () => { },
|
|
36
|
+
setFacets: () => { },
|
|
37
|
+
setSelectedProductIds: () => { },
|
|
38
|
+
setSideMenuSelectedProductIds: () => { },
|
|
39
|
+
setIsDragAndDropActive: () => { },
|
|
40
|
+
setIsDragToSelectActive: () => { },
|
|
41
|
+
setIsCutting: () => { },
|
|
42
|
+
setSelectedProducts: () => { },
|
|
43
|
+
setSelectedProductIdsArray: () => { },
|
|
44
|
+
setSelectedBannerId: () => { }
|
|
45
|
+
});
|
|
46
|
+
export const useVisualEditorContext = () => {
|
|
47
|
+
const visualEditorContext = useContext(VisualEditorContext);
|
|
48
|
+
const visualEditorDispatchContext = useContext(VisualEditorDispatchContext);
|
|
49
|
+
if (visualEditorContext === undefined || VisualEditorDispatchContext === undefined) {
|
|
50
|
+
throw new Error('useVisualEditorContext must be used within a EditorProvider');
|
|
51
|
+
}
|
|
52
|
+
return { state: visualEditorContext, dispatcher: visualEditorDispatchContext };
|
|
53
|
+
};
|
|
54
|
+
//# sourceMappingURL=visualEditorContext.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"visualEditorContext.js","sourceRoot":"","sources":["../../../../../../../../../../dashboard/dashboard-client/src/pages/LandingPages/editor/context/visualEditorContext.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,aAAa,EAAE,UAAU,EAAC,MAAM,OAAO,CAAC;AAsFhD,MAAM,CAAC,MAAM,mBAAmB,GAAG,aAAa,CAA8B;IAC1E,QAAQ,EAAE,EAAE;IACZ,OAAO,EAAE;QACP,QAAQ,EAAE,KAAK;KAChB;IACD,IAAI,EAAE,CAAC;IACP,MAAM,EAAE,EAAE;IACV,mBAAmB,EAAE,SAAS;IAC9B,QAAQ,EAAE,EAAE;IACZ,YAAY,EAAE,CAAC;IACf,UAAU,EAAE,CAAC;IACb,MAAM,EAAE,EAAE;IACV,kBAAkB,EAAE,EAAE;IACtB,uBAAuB,EAAE,EAAE;IAC3B,cAAc,EAAE,EAAE;IAClB,OAAO,EAAE,EAAE;IACX,gBAAgB,EAAE,EAAE;IACpB,0BAA0B,EAAE,EAAE;IAC9B,mBAAmB,EAAE,KAAK;IAC1B,oBAAoB,EAAE,KAAK;IAC3B,SAAS,EAAE,KAAK;IAChB,gBAAgB,EAAE,EAAE;IACpB,IAAI,EAAE,EAAE;IACR,OAAO,EAA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r\n\r\n// Create two context:\r\n// VisualEditorContext: to query the context state\r\n// VisualEditorDispatchContext: to mutate the context state\r\n\r\nimport React from \"react\";\r\nimport {EditorProduct} from \"../../../../../../../frontends/dashboard-utilities/src/@types/editorProduct\";\r\nimport {Facet, Narrow} from \"@fast-simon/utilities\";\r\nimport {MenuItemName} from \"../../../../../../../frontends/dashboard-utilities/src/@types/sideMenu\";\r\nimport {Banner} from \"../../../../../../../frontends/dashboard-utilities/src/@types/banner\";\r\nexport type PinnedProduct = [number, string];\r\n\r\nexport interface ContextDataLoading {\r\n products: boolean\r\n}\r\n\r\nexport interface VisualEditorContextDataType {\r\n products: EditorProduct[];\r\n loading: ContextDataLoading;\r\n page: number;\r\n narrow: Narrow;\r\n searchWithinResultsQuery?: string;\r\n selectedNavItemName: MenuItemName;\r\n totalResults: number;\r\n totalPages: number;\r\n facets: Facet[];\r\n selectedProductIds: Record<string, number>;\r\n selectedProductIdsArray: string[]; // for order as the record is not ordered\r\n originalPositions?: Record<string, number>;\r\n pinned?: PinnedProduct[];\r\n promoted: string[];\r\n buried?: string[];\r\n hidden?: string[];\r\n allProductsIds: string[];\r\n sideMenuSelectedProductIds: Record<string, number>;\r\n // sideMenuSearchInput: string;\r\n isDragAndDropActive: boolean;\r\n isDragToSelectActive: boolean;\r\n isCutting: boolean;\r\n selectedProducts: EditorProduct[];\r\n selectedBannerId?: string;\r\n banners: Banner[];\r\n landingPageID?: string;\r\n uuid: string;\r\n storeID: number;\r\n query?: string;\r\n}\r\n\r\nexport interface VisualEditorDispatcherContextType {\r\n setProducts: React.Dispatch<React.SetStateAction<EditorProduct[]>>;\r\n\r\n setLoading: React.Dispatch<React.SetStateAction<ContextDataLoading>>;\r\n\r\n setPage: React.Dispatch<React.SetStateAction<number>>;\r\n\r\n setNarrow: React.Dispatch<React.SetStateAction<Narrow>>;\r\n\r\n setSearchWithinResultsQuery: React.Dispatch<React.SetStateAction<string>>;\r\n\r\n setSelectedNavItemName: React.Dispatch<React.SetStateAction<MenuItemName>>;\r\n\r\n setPinned?: React.Dispatch<React.SetStateAction<PinnedProduct[]>>;\r\n\r\n setPromoted: React.Dispatch<React.SetStateAction<string[]>>;\r\n\r\n setBuried?: React.Dispatch<React.SetStateAction<string[]>>;\r\n\r\n setHidden?: React.Dispatch<React.SetStateAction<string[]>>;\r\n\r\n setFacets: React.Dispatch<React.SetStateAction<Facet[]>>;\r\n\r\n setSelectedProductIds: React.Dispatch<React.SetStateAction<Record<string, number>>>;\r\n\r\n setSelectedBannerId: React.Dispatch<React.SetStateAction<string>>;\r\n\r\n setSideMenuSelectedProductIds: React.Dispatch<React.SetStateAction<Record<string, number>>>;\r\n\r\n // setSideMenuSearchInput: React.Dispatch<React.SetStateAction<string>>;\r\n setIsDragAndDropActive: React.Dispatch<React.SetStateAction<boolean>>;\r\n setIsDragToSelectActive: React.Dispatch<React.SetStateAction<boolean>>;\r\n setIsCutting: React.Dispatch<React.SetStateAction<boolean>>;\r\n setSelectedProducts: React.Dispatch<React.SetStateAction<EditorProduct[]>>;\r\n setSelectedProductIdsArray: React.Dispatch<React.SetStateAction<string[]>>;\r\n}\r\n\r\nexport const VisualEditorContext = createContext<VisualEditorContextDataType>({\r\n products: [],\r\n loading: {\r\n products: false\r\n },\r\n page: 1,\r\n narrow: {},\r\n selectedNavItemName: 'general',\r\n promoted: [],\r\n totalResults: 0,\r\n totalPages: 0,\r\n facets: [],\r\n selectedProductIds: {},\r\n selectedProductIdsArray: [],\r\n allProductsIds: [],\r\n banners: [],\r\n selectedBannerId: \"\",\r\n sideMenuSelectedProductIds: {},\r\n isDragAndDropActive: false,\r\n isDragToSelectActive: false,\r\n isCutting: false,\r\n selectedProducts: [],\r\n uuid: '',\r\n storeID: 0,\r\n landingPageID: '',\r\n});\r\n\r\nexport const VisualEditorDispatchContext = createContext<VisualEditorDispatcherContextType>({\r\n setProducts: () => {},\r\n setLoading: () => {},\r\n setPage: () => {},\r\n setNarrow: () => {},\r\n setSearchWithinResultsQuery: () => {},\r\n setSelectedNavItemName: () => {},\r\n setPromoted: () => {},\r\n setFacets: () => {},\r\n setSelectedProductIds : () => {},\r\n setSideMenuSelectedProductIds: () => {},\r\n setIsDragAndDropActive: () => {},\r\n setIsDragToSelectActive: () => {},\r\n setIsCutting: () => {},\r\n setSelectedProducts: () => {},\r\n setSelectedProductIdsArray: () => {},\r\n setSelectedBannerId: () => {}\r\n});\r\n\r\n\r\nexport const useVisualEditorContext = () => {\r\n const visualEditorContext = useContext(VisualEditorContext);\r\n const visualEditorDispatchContext = useContext(VisualEditorDispatchContext);\r\n if (visualEditorContext === undefined || VisualEditorDispatchContext === undefined) {\r\n throw new Error('useVisualEditorContext must be used within a EditorProvider')\r\n }\r\n return {state: visualEditorContext, dispatcher: visualEditorDispatchContext};\r\n}"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"banner.js","sourceRoot":"","sources":["../../../../../src/@types/banner.ts"],"names":[],"mappings":"AAOA,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC","sourcesContent":["export interface Banner {\r\n title: string;\r\n image: string;\r\n mobileImage?: string;\r\n id: string;\r\n}\r\n\r\nexport const videoFormats = [\".mp4\", \".mov\", \".avi\", \".wmv\", \".mkv\", \".webm\", \".flv\", \".m4v\", \".mpg\", \".mpeg\"];\r\n"]}
|