pb-sxp-ui 1.0.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/LICENSE +21 -0
- package/README.md +111 -0
- package/dist/index.cjs +10752 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.css +1782 -0
- package/dist/index.js +10721 -0
- package/dist/index.js.map +1 -0
- package/dist/index.min.cjs +9 -0
- package/dist/index.min.cjs.map +1 -0
- package/dist/index.min.js +9 -0
- package/dist/index.min.js.map +1 -0
- package/dist/pb-ui.js +10748 -0
- package/dist/pb-ui.js.map +1 -0
- package/dist/pb-ui.min.js +9 -0
- package/dist/pb-ui.min.js.map +1 -0
- package/es/core/Pagebuilder/PagebuilderClass.d.ts +15 -0
- package/es/core/Pagebuilder/PagebuilderClass.js +42 -0
- package/es/core/Pagebuilder/index.d.ts +3 -0
- package/es/core/Pagebuilder/index.js +96 -0
- package/es/core/Pagebuilder/type.d.ts +55 -0
- package/es/core/Pagebuilder/type.js +1 -0
- package/es/core/components/SxpPageCore/index.d.ts +11 -0
- package/es/core/components/SxpPageCore/index.js +26 -0
- package/es/core/components/SxpPageRender/ExpandableText.d.ts +12 -0
- package/es/core/components/SxpPageRender/ExpandableText.js +54 -0
- package/es/core/components/SxpPageRender/FingerSwipeTip/index.d.ts +6 -0
- package/es/core/components/SxpPageRender/FingerSwipeTip/index.js +19 -0
- package/es/core/components/SxpPageRender/Hashtag/index.d.ts +11 -0
- package/es/core/components/SxpPageRender/Hashtag/index.js +40 -0
- package/es/core/components/SxpPageRender/LikeButton/index.d.ts +10 -0
- package/es/core/components/SxpPageRender/LikeButton/index.js +58 -0
- package/es/core/components/SxpPageRender/Modal/index.d.ts +9 -0
- package/es/core/components/SxpPageRender/Modal/index.js +44 -0
- package/es/core/components/SxpPageRender/Navbar.d.ts +8 -0
- package/es/core/components/SxpPageRender/Navbar.js +9 -0
- package/es/core/components/SxpPageRender/PictureGroup/Picture.d.ts +8 -0
- package/es/core/components/SxpPageRender/PictureGroup/Picture.js +19 -0
- package/es/core/components/SxpPageRender/PictureGroup/index.d.ts +13 -0
- package/es/core/components/SxpPageRender/PictureGroup/index.js +27 -0
- package/es/core/components/SxpPageRender/Popup/index.d.ts +3 -0
- package/es/core/components/SxpPageRender/Popup/index.js +60 -0
- package/es/core/components/SxpPageRender/ProductInfo/index.d.ts +14 -0
- package/es/core/components/SxpPageRender/ProductInfo/index.js +55 -0
- package/es/core/components/SxpPageRender/RenderCard.d.ts +11 -0
- package/es/core/components/SxpPageRender/RenderCard.js +40 -0
- package/es/core/components/SxpPageRender/ToggleButton/index.d.ts +10 -0
- package/es/core/components/SxpPageRender/ToggleButton/index.js +13 -0
- package/es/core/components/SxpPageRender/VideoWidget/index.d.ts +12 -0
- package/es/core/components/SxpPageRender/VideoWidget/index.js +219 -0
- package/es/core/components/SxpPageRender/WaterFall/List.d.ts +3 -0
- package/es/core/components/SxpPageRender/WaterFall/List.js +173 -0
- package/es/core/components/SxpPageRender/WaterFall/WaterfallList.d.ts +3 -0
- package/es/core/components/SxpPageRender/WaterFall/WaterfallList.js +317 -0
- package/es/core/components/SxpPageRender/WaterFall/index.d.ts +6 -0
- package/es/core/components/SxpPageRender/WaterFall/index.js +100 -0
- package/es/core/components/SxpPageRender/fakeData.d.ts +130 -0
- package/es/core/components/SxpPageRender/fakeData.js +899 -0
- package/es/core/components/SxpPageRender/index.d.ts +35 -0
- package/es/core/components/SxpPageRender/index.js +345 -0
- package/es/core/components/SxpPageRender/typing.d.ts +65 -0
- package/es/core/components/SxpPageRender/typing.js +1 -0
- package/es/core/components/SxpPageRender/useIconLink.d.ts +1 -0
- package/es/core/components/SxpPageRender/useIconLink.js +8 -0
- package/es/core/context/DataSourceProvider.d.ts +17 -0
- package/es/core/context/DataSourceProvider.js +45 -0
- package/es/core/context/EditorContext.d.ts +76 -0
- package/es/core/context/EditorContext.js +142 -0
- package/es/core/context/EditorDataProvider.d.ts +18 -0
- package/es/core/context/EditorDataProvider.js +20 -0
- package/es/core/context/SxpDataSourceProvider.d.ts +90 -0
- package/es/core/context/SxpDataSourceProvider.js +204 -0
- package/es/core/create.d.ts +37 -0
- package/es/core/create.js +4 -0
- package/es/core/hoc/withBindDataSource.d.ts +6 -0
- package/es/core/hoc/withBindDataSource.js +61 -0
- package/es/core/hooks/index.d.ts +4 -0
- package/es/core/hooks/index.js +4 -0
- package/es/core/hooks/useCurrentNode.d.ts +10 -0
- package/es/core/hooks/useCurrentNode.js +11 -0
- package/es/core/hooks/useDataSource.d.ts +2 -0
- package/es/core/hooks/useDataSource.js +6 -0
- package/es/core/hooks/useEditor.d.ts +1 -0
- package/es/core/hooks/useEditor.js +5 -0
- package/es/core/hooks/useEventReport.d.ts +5 -0
- package/es/core/hooks/useEventReport.js +73 -0
- package/es/core/hooks/useOnScreen.d.ts +2 -0
- package/es/core/hooks/useOnScreen.js +19 -0
- package/es/core/hooks/useSxpDataSource.d.ts +1 -0
- package/es/core/hooks/useSxpDataSource.js +5 -0
- package/es/core/index.d.ts +3 -0
- package/es/core/index.js +1 -0
- package/es/core/schema.d.ts +58 -0
- package/es/core/schema.js +1 -0
- package/es/core/utils/event.d.ts +7 -0
- package/es/core/utils/event.js +8 -0
- package/es/core/utils/getDataByDS.d.ts +6 -0
- package/es/core/utils/getDataByDS.js +39 -0
- package/es/core/utils/getSxpTokenInfo.d.ts +2 -0
- package/es/core/utils/getSxpTokenInfo.js +26 -0
- package/es/core/utils/localStore.d.ts +3 -0
- package/es/core/utils/localStore.js +14 -0
- package/es/core/utils/materials.d.ts +11 -0
- package/es/core/utils/materials.js +31 -0
- package/es/core/utils/sessionStore.d.ts +3 -0
- package/es/core/utils/sessionStore.js +26 -0
- package/es/core/utils/tool.d.ts +5 -0
- package/es/core/utils/tool.js +48 -0
- package/es/core/utils/unzip.d.ts +1 -0
- package/es/core/utils/unzip.js +10 -0
- package/es/index.d.ts +10 -0
- package/es/index.js +12 -0
- package/es/materials/index.d.ts +1 -0
- package/es/materials/index.js +1 -0
- package/es/materials/sxp/index.d.ts +2 -0
- package/es/materials/sxp/index.js +2 -0
- package/es/materials/sxp/popup/AppointForm/index.d.ts +18 -0
- package/es/materials/sxp/popup/AppointForm/index.js +77 -0
- package/es/materials/sxp/popup/AppointForm/interactionRender.d.ts +8 -0
- package/es/materials/sxp/popup/AppointForm/interactionRender.js +11 -0
- package/es/materials/sxp/popup/AppointForm/material.d.ts +2 -0
- package/es/materials/sxp/popup/AppointForm/material.js +36 -0
- package/es/materials/sxp/popup/AppointForm/settingRender.d.ts +65 -0
- package/es/materials/sxp/popup/AppointForm/settingRender.js +90 -0
- package/es/materials/sxp/popup/CommodityDetail/index.d.ts +14 -0
- package/es/materials/sxp/popup/CommodityDetail/index.js +85 -0
- package/es/materials/sxp/popup/CommodityDetail/material.d.ts +2 -0
- package/es/materials/sxp/popup/CommodityDetail/material.js +16 -0
- package/es/materials/sxp/popup/CommodityDetailDiro/index.d.ts +18 -0
- package/es/materials/sxp/popup/CommodityDetailDiro/index.js +162 -0
- package/es/materials/sxp/popup/CommodityDetailDiro/material.d.ts +2 -0
- package/es/materials/sxp/popup/CommodityDetailDiro/material.js +16 -0
- package/es/materials/sxp/popup/CommodityDetailDiroNew/index.d.ts +22 -0
- package/es/materials/sxp/popup/CommodityDetailDiroNew/index.js +129 -0
- package/es/materials/sxp/popup/CommodityDetailDiroNew/material.d.ts +2 -0
- package/es/materials/sxp/popup/CommodityDetailDiroNew/material.js +16 -0
- package/es/materials/sxp/popup/Prompt/index.d.ts +11 -0
- package/es/materials/sxp/popup/Prompt/index.js +22 -0
- package/es/materials/sxp/popup/Prompt/interactionRender.d.ts +8 -0
- package/es/materials/sxp/popup/Prompt/interactionRender.js +11 -0
- package/es/materials/sxp/popup/Prompt/material.d.ts +2 -0
- package/es/materials/sxp/popup/Prompt/material.js +28 -0
- package/es/materials/sxp/popup/Prompt/settingRender.d.ts +12 -0
- package/es/materials/sxp/popup/Prompt/settingRender.js +18 -0
- package/es/materials/sxp/popup/index.d.ts +5 -0
- package/es/materials/sxp/popup/index.js +5 -0
- package/es/materials/sxp/template/Appoint/index.d.ts +11 -0
- package/es/materials/sxp/template/Appoint/index.js +30 -0
- package/es/materials/sxp/template/Appoint/interactionRender.d.ts +8 -0
- package/es/materials/sxp/template/Appoint/interactionRender.js +11 -0
- package/es/materials/sxp/template/Appoint/material.d.ts +2 -0
- package/es/materials/sxp/template/Appoint/material.js +29 -0
- package/es/materials/sxp/template/Commodity/index.d.ts +11 -0
- package/es/materials/sxp/template/Commodity/index.js +44 -0
- package/es/materials/sxp/template/Commodity/interactionRender.d.ts +8 -0
- package/es/materials/sxp/template/Commodity/interactionRender.js +11 -0
- package/es/materials/sxp/template/Commodity/material.d.ts +2 -0
- package/es/materials/sxp/template/Commodity/material.js +26 -0
- package/es/materials/sxp/template/CommodityDiro/index.d.ts +11 -0
- package/es/materials/sxp/template/CommodityDiro/index.js +46 -0
- package/es/materials/sxp/template/CommodityDiro/interactionRender.d.ts +8 -0
- package/es/materials/sxp/template/CommodityDiro/interactionRender.js +11 -0
- package/es/materials/sxp/template/CommodityDiro/material.d.ts +2 -0
- package/es/materials/sxp/template/CommodityDiro/material.js +26 -0
- package/es/materials/sxp/template/CommodityDiroNew/index.d.ts +11 -0
- package/es/materials/sxp/template/CommodityDiroNew/index.js +46 -0
- package/es/materials/sxp/template/CommodityDiroNew/interactionRender.d.ts +8 -0
- package/es/materials/sxp/template/CommodityDiroNew/interactionRender.js +11 -0
- package/es/materials/sxp/template/CommodityDiroNew/material.d.ts +2 -0
- package/es/materials/sxp/template/CommodityDiroNew/material.js +26 -0
- package/es/materials/sxp/template/Link/index.d.ts +11 -0
- package/es/materials/sxp/template/Link/index.js +41 -0
- package/es/materials/sxp/template/Link/material.d.ts +2 -0
- package/es/materials/sxp/template/Link/material.js +26 -0
- package/es/materials/sxp/template/MultiCommodity/index.d.ts +12 -0
- package/es/materials/sxp/template/MultiCommodity/index.js +58 -0
- package/es/materials/sxp/template/MultiCommodity/interactionRender.d.ts +8 -0
- package/es/materials/sxp/template/MultiCommodity/interactionRender.js +11 -0
- package/es/materials/sxp/template/MultiCommodity/material.d.ts +2 -0
- package/es/materials/sxp/template/MultiCommodity/material.js +26 -0
- package/es/materials/sxp/template/MultiCommodityDiro/index.d.ts +12 -0
- package/es/materials/sxp/template/MultiCommodityDiro/index.js +60 -0
- package/es/materials/sxp/template/MultiCommodityDiro/interactionRender.d.ts +8 -0
- package/es/materials/sxp/template/MultiCommodityDiro/interactionRender.js +11 -0
- package/es/materials/sxp/template/MultiCommodityDiro/material.d.ts +2 -0
- package/es/materials/sxp/template/MultiCommodityDiro/material.js +26 -0
- package/es/materials/sxp/template/MultiCommodityDiroNew/index.d.ts +12 -0
- package/es/materials/sxp/template/MultiCommodityDiroNew/index.js +59 -0
- package/es/materials/sxp/template/MultiCommodityDiroNew/interactionRender.d.ts +8 -0
- package/es/materials/sxp/template/MultiCommodityDiroNew/interactionRender.js +11 -0
- package/es/materials/sxp/template/MultiCommodityDiroNew/material.d.ts +2 -0
- package/es/materials/sxp/template/MultiCommodityDiroNew/material.js +26 -0
- package/es/materials/sxp/template/components/EventProvider.d.ts +10 -0
- package/es/materials/sxp/template/components/EventProvider.js +33 -0
- package/es/materials/sxp/template/components/Img.d.ts +9 -0
- package/es/materials/sxp/template/components/Img.js +19 -0
- package/es/materials/sxp/template/components/Scroll.d.ts +9 -0
- package/es/materials/sxp/template/components/Scroll.js +10 -0
- package/es/materials/sxp/template/index.d.ts +8 -0
- package/es/materials/sxp/template/index.js +8 -0
- package/lib/core/Pagebuilder/PagebuilderClass.d.ts +15 -0
- package/lib/core/Pagebuilder/PagebuilderClass.js +45 -0
- package/lib/core/Pagebuilder/index.d.ts +3 -0
- package/lib/core/Pagebuilder/index.js +99 -0
- package/lib/core/Pagebuilder/type.d.ts +55 -0
- package/lib/core/Pagebuilder/type.js +2 -0
- package/lib/core/components/SxpPageCore/index.d.ts +11 -0
- package/lib/core/components/SxpPageCore/index.js +29 -0
- package/lib/core/components/SxpPageRender/ExpandableText.d.ts +12 -0
- package/lib/core/components/SxpPageRender/ExpandableText.js +57 -0
- package/lib/core/components/SxpPageRender/FingerSwipeTip/index.d.ts +6 -0
- package/lib/core/components/SxpPageRender/FingerSwipeTip/index.js +22 -0
- package/lib/core/components/SxpPageRender/Hashtag/index.d.ts +11 -0
- package/lib/core/components/SxpPageRender/Hashtag/index.js +43 -0
- package/lib/core/components/SxpPageRender/LikeButton/index.d.ts +10 -0
- package/lib/core/components/SxpPageRender/LikeButton/index.js +60 -0
- package/lib/core/components/SxpPageRender/Modal/index.d.ts +9 -0
- package/lib/core/components/SxpPageRender/Modal/index.js +47 -0
- package/lib/core/components/SxpPageRender/Navbar.d.ts +8 -0
- package/lib/core/components/SxpPageRender/Navbar.js +12 -0
- package/lib/core/components/SxpPageRender/PictureGroup/Picture.d.ts +8 -0
- package/lib/core/components/SxpPageRender/PictureGroup/Picture.js +22 -0
- package/lib/core/components/SxpPageRender/PictureGroup/index.d.ts +13 -0
- package/lib/core/components/SxpPageRender/PictureGroup/index.js +30 -0
- package/lib/core/components/SxpPageRender/Popup/index.d.ts +3 -0
- package/lib/core/components/SxpPageRender/Popup/index.js +63 -0
- package/lib/core/components/SxpPageRender/ProductInfo/index.d.ts +14 -0
- package/lib/core/components/SxpPageRender/ProductInfo/index.js +58 -0
- package/lib/core/components/SxpPageRender/RenderCard.d.ts +11 -0
- package/lib/core/components/SxpPageRender/RenderCard.js +43 -0
- package/lib/core/components/SxpPageRender/ToggleButton/index.d.ts +10 -0
- package/lib/core/components/SxpPageRender/ToggleButton/index.js +16 -0
- package/lib/core/components/SxpPageRender/VideoWidget/index.d.ts +12 -0
- package/lib/core/components/SxpPageRender/VideoWidget/index.js +222 -0
- package/lib/core/components/SxpPageRender/WaterFall/List.d.ts +3 -0
- package/lib/core/components/SxpPageRender/WaterFall/List.js +177 -0
- package/lib/core/components/SxpPageRender/WaterFall/WaterfallList.d.ts +3 -0
- package/lib/core/components/SxpPageRender/WaterFall/WaterfallList.js +321 -0
- package/lib/core/components/SxpPageRender/WaterFall/index.d.ts +6 -0
- package/lib/core/components/SxpPageRender/WaterFall/index.js +103 -0
- package/lib/core/components/SxpPageRender/fakeData.d.ts +130 -0
- package/lib/core/components/SxpPageRender/fakeData.js +902 -0
- package/lib/core/components/SxpPageRender/index.d.ts +35 -0
- package/lib/core/components/SxpPageRender/index.js +348 -0
- package/lib/core/components/SxpPageRender/typing.d.ts +65 -0
- package/lib/core/components/SxpPageRender/typing.js +2 -0
- package/lib/core/components/SxpPageRender/useIconLink.d.ts +1 -0
- package/lib/core/components/SxpPageRender/useIconLink.js +12 -0
- package/lib/core/context/DataSourceProvider.d.ts +17 -0
- package/lib/core/context/DataSourceProvider.js +48 -0
- package/lib/core/context/EditorContext.d.ts +76 -0
- package/lib/core/context/EditorContext.js +146 -0
- package/lib/core/context/EditorDataProvider.d.ts +18 -0
- package/lib/core/context/EditorDataProvider.js +25 -0
- package/lib/core/context/SxpDataSourceProvider.d.ts +90 -0
- package/lib/core/context/SxpDataSourceProvider.js +207 -0
- package/lib/core/create.d.ts +37 -0
- package/lib/core/create.js +8 -0
- package/lib/core/hoc/withBindDataSource.d.ts +6 -0
- package/lib/core/hoc/withBindDataSource.js +63 -0
- package/lib/core/hooks/index.d.ts +4 -0
- package/lib/core/hooks/index.js +7 -0
- package/lib/core/hooks/useCurrentNode.d.ts +10 -0
- package/lib/core/hooks/useCurrentNode.js +14 -0
- package/lib/core/hooks/useDataSource.d.ts +2 -0
- package/lib/core/hooks/useDataSource.js +9 -0
- package/lib/core/hooks/useEditor.d.ts +1 -0
- package/lib/core/hooks/useEditor.js +9 -0
- package/lib/core/hooks/useEventReport.d.ts +5 -0
- package/lib/core/hooks/useEventReport.js +77 -0
- package/lib/core/hooks/useOnScreen.d.ts +2 -0
- package/lib/core/hooks/useOnScreen.js +22 -0
- package/lib/core/hooks/useSxpDataSource.d.ts +1 -0
- package/lib/core/hooks/useSxpDataSource.js +9 -0
- package/lib/core/index.d.ts +3 -0
- package/lib/core/index.js +5 -0
- package/lib/core/schema.d.ts +58 -0
- package/lib/core/schema.js +2 -0
- package/lib/core/utils/event.d.ts +7 -0
- package/lib/core/utils/event.js +12 -0
- package/lib/core/utils/getDataByDS.d.ts +6 -0
- package/lib/core/utils/getDataByDS.js +41 -0
- package/lib/core/utils/getSxpTokenInfo.d.ts +2 -0
- package/lib/core/utils/getSxpTokenInfo.js +30 -0
- package/lib/core/utils/localStore.d.ts +3 -0
- package/lib/core/utils/localStore.js +19 -0
- package/lib/core/utils/materials.d.ts +11 -0
- package/lib/core/utils/materials.js +37 -0
- package/lib/core/utils/sessionStore.d.ts +3 -0
- package/lib/core/utils/sessionStore.js +32 -0
- package/lib/core/utils/tool.d.ts +5 -0
- package/lib/core/utils/tool.js +54 -0
- package/lib/core/utils/unzip.d.ts +1 -0
- package/lib/core/utils/unzip.js +15 -0
- package/lib/index.d.ts +10 -0
- package/lib/index.js +20 -0
- package/lib/materials/index.d.ts +1 -0
- package/lib/materials/index.js +4 -0
- package/lib/materials/sxp/index.d.ts +2 -0
- package/lib/materials/sxp/index.js +5 -0
- package/lib/materials/sxp/popup/AppointForm/index.d.ts +18 -0
- package/lib/materials/sxp/popup/AppointForm/index.js +79 -0
- package/lib/materials/sxp/popup/AppointForm/interactionRender.d.ts +8 -0
- package/lib/materials/sxp/popup/AppointForm/interactionRender.js +13 -0
- package/lib/materials/sxp/popup/AppointForm/material.d.ts +2 -0
- package/lib/materials/sxp/popup/AppointForm/material.js +40 -0
- package/lib/materials/sxp/popup/AppointForm/settingRender.d.ts +65 -0
- package/lib/materials/sxp/popup/AppointForm/settingRender.js +92 -0
- package/lib/materials/sxp/popup/CommodityDetail/index.d.ts +14 -0
- package/lib/materials/sxp/popup/CommodityDetail/index.js +87 -0
- package/lib/materials/sxp/popup/CommodityDetail/material.d.ts +2 -0
- package/lib/materials/sxp/popup/CommodityDetail/material.js +20 -0
- package/lib/materials/sxp/popup/CommodityDetailDiro/index.d.ts +18 -0
- package/lib/materials/sxp/popup/CommodityDetailDiro/index.js +164 -0
- package/lib/materials/sxp/popup/CommodityDetailDiro/material.d.ts +2 -0
- package/lib/materials/sxp/popup/CommodityDetailDiro/material.js +20 -0
- package/lib/materials/sxp/popup/CommodityDetailDiroNew/index.d.ts +22 -0
- package/lib/materials/sxp/popup/CommodityDetailDiroNew/index.js +131 -0
- package/lib/materials/sxp/popup/CommodityDetailDiroNew/material.d.ts +2 -0
- package/lib/materials/sxp/popup/CommodityDetailDiroNew/material.js +20 -0
- package/lib/materials/sxp/popup/Prompt/index.d.ts +11 -0
- package/lib/materials/sxp/popup/Prompt/index.js +24 -0
- package/lib/materials/sxp/popup/Prompt/interactionRender.d.ts +8 -0
- package/lib/materials/sxp/popup/Prompt/interactionRender.js +13 -0
- package/lib/materials/sxp/popup/Prompt/material.d.ts +2 -0
- package/lib/materials/sxp/popup/Prompt/material.js +32 -0
- package/lib/materials/sxp/popup/Prompt/settingRender.d.ts +12 -0
- package/lib/materials/sxp/popup/Prompt/settingRender.js +20 -0
- package/lib/materials/sxp/popup/index.d.ts +5 -0
- package/lib/materials/sxp/popup/index.js +8 -0
- package/lib/materials/sxp/template/Appoint/index.d.ts +11 -0
- package/lib/materials/sxp/template/Appoint/index.js +32 -0
- package/lib/materials/sxp/template/Appoint/interactionRender.d.ts +8 -0
- package/lib/materials/sxp/template/Appoint/interactionRender.js +13 -0
- package/lib/materials/sxp/template/Appoint/material.d.ts +2 -0
- package/lib/materials/sxp/template/Appoint/material.js +33 -0
- package/lib/materials/sxp/template/Commodity/index.d.ts +11 -0
- package/lib/materials/sxp/template/Commodity/index.js +46 -0
- package/lib/materials/sxp/template/Commodity/interactionRender.d.ts +8 -0
- package/lib/materials/sxp/template/Commodity/interactionRender.js +13 -0
- package/lib/materials/sxp/template/Commodity/material.d.ts +2 -0
- package/lib/materials/sxp/template/Commodity/material.js +30 -0
- package/lib/materials/sxp/template/CommodityDiro/index.d.ts +11 -0
- package/lib/materials/sxp/template/CommodityDiro/index.js +48 -0
- package/lib/materials/sxp/template/CommodityDiro/interactionRender.d.ts +8 -0
- package/lib/materials/sxp/template/CommodityDiro/interactionRender.js +13 -0
- package/lib/materials/sxp/template/CommodityDiro/material.d.ts +2 -0
- package/lib/materials/sxp/template/CommodityDiro/material.js +30 -0
- package/lib/materials/sxp/template/CommodityDiroNew/index.d.ts +11 -0
- package/lib/materials/sxp/template/CommodityDiroNew/index.js +48 -0
- package/lib/materials/sxp/template/CommodityDiroNew/interactionRender.d.ts +8 -0
- package/lib/materials/sxp/template/CommodityDiroNew/interactionRender.js +13 -0
- package/lib/materials/sxp/template/CommodityDiroNew/material.d.ts +2 -0
- package/lib/materials/sxp/template/CommodityDiroNew/material.js +30 -0
- package/lib/materials/sxp/template/Link/index.d.ts +11 -0
- package/lib/materials/sxp/template/Link/index.js +43 -0
- package/lib/materials/sxp/template/Link/material.d.ts +2 -0
- package/lib/materials/sxp/template/Link/material.js +30 -0
- package/lib/materials/sxp/template/MultiCommodity/index.d.ts +12 -0
- package/lib/materials/sxp/template/MultiCommodity/index.js +60 -0
- package/lib/materials/sxp/template/MultiCommodity/interactionRender.d.ts +8 -0
- package/lib/materials/sxp/template/MultiCommodity/interactionRender.js +13 -0
- package/lib/materials/sxp/template/MultiCommodity/material.d.ts +2 -0
- package/lib/materials/sxp/template/MultiCommodity/material.js +30 -0
- package/lib/materials/sxp/template/MultiCommodityDiro/index.d.ts +12 -0
- package/lib/materials/sxp/template/MultiCommodityDiro/index.js +62 -0
- package/lib/materials/sxp/template/MultiCommodityDiro/interactionRender.d.ts +8 -0
- package/lib/materials/sxp/template/MultiCommodityDiro/interactionRender.js +13 -0
- package/lib/materials/sxp/template/MultiCommodityDiro/material.d.ts +2 -0
- package/lib/materials/sxp/template/MultiCommodityDiro/material.js +30 -0
- package/lib/materials/sxp/template/MultiCommodityDiroNew/index.d.ts +12 -0
- package/lib/materials/sxp/template/MultiCommodityDiroNew/index.js +61 -0
- package/lib/materials/sxp/template/MultiCommodityDiroNew/interactionRender.d.ts +8 -0
- package/lib/materials/sxp/template/MultiCommodityDiroNew/interactionRender.js +13 -0
- package/lib/materials/sxp/template/MultiCommodityDiroNew/material.d.ts +2 -0
- package/lib/materials/sxp/template/MultiCommodityDiroNew/material.js +30 -0
- package/lib/materials/sxp/template/components/EventProvider.d.ts +10 -0
- package/lib/materials/sxp/template/components/EventProvider.js +35 -0
- package/lib/materials/sxp/template/components/Img.d.ts +9 -0
- package/lib/materials/sxp/template/components/Img.js +22 -0
- package/lib/materials/sxp/template/components/Scroll.d.ts +9 -0
- package/lib/materials/sxp/template/components/Scroll.js +13 -0
- package/lib/materials/sxp/template/index.d.ts +8 -0
- package/lib/materials/sxp/template/index.js +11 -0
- package/package.json +113 -0
@@ -0,0 +1,41 @@
|
|
1
|
+
import { __rest } from "tslib";
|
2
|
+
import { css } from '@emotion/css';
|
3
|
+
import React, { memo } from 'react';
|
4
|
+
import EventProvider from '../components/EventProvider';
|
5
|
+
import styles from './index.module.less';
|
6
|
+
import { useSxpDataSource } from '../../../../core/hooks';
|
7
|
+
import { useEventReport } from '../../../../core/hooks/useEventReport';
|
8
|
+
const Link = (_a) => {
|
9
|
+
var _b, _c, _d, _e, _f;
|
10
|
+
var { content, style, bgImg, recData, bottom_image } = _a, props = __rest(_a, ["content", "style", "bgImg", "recData", "bottom_image"]);
|
11
|
+
const { sxpParameter, bffEventReport } = useSxpDataSource();
|
12
|
+
const { jumpToWeb } = useEventReport();
|
13
|
+
const cta = (_b = recData === null || recData === void 0 ? void 0 : recData.video) === null || _b === void 0 ? void 0 : _b.bindCta;
|
14
|
+
const product = (_c = recData === null || recData === void 0 ? void 0 : recData.video) === null || _c === void 0 ? void 0 : _c.bindProduct;
|
15
|
+
const handleTo = () => {
|
16
|
+
if (cta === null || cta === void 0 ? void 0 : cta.link) {
|
17
|
+
jumpToWeb(recData, product, cta);
|
18
|
+
window.location.href = window.getJointUtmLink(cta.link);
|
19
|
+
}
|
20
|
+
};
|
21
|
+
return (React.createElement(EventProvider, Object.assign({ rec: recData, className: css(Object.assign(Object.assign({}, style), { maxWidth: '236px', width: '100%' })) }, props, { onClick: handleTo }),
|
22
|
+
React.createElement("div", { className: css({
|
23
|
+
width: '60px',
|
24
|
+
height: '60px',
|
25
|
+
marginRight: '8px',
|
26
|
+
borderRadius: '3px',
|
27
|
+
backgroundColor: '#f2f2f2',
|
28
|
+
overflow: 'hidden',
|
29
|
+
flexShrink: 0
|
30
|
+
}) },
|
31
|
+
React.createElement("img", { className: css({ width: '100%', objectFit: 'cover', height: '100%' }), src: (_e = (_d = cta === null || cta === void 0 ? void 0 : cta.icon) !== null && _d !== void 0 ? _d : sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _e !== void 0 ? _e : bottom_image, alt: '' })),
|
32
|
+
React.createElement("div", { className: css({
|
33
|
+
color: '#fff',
|
34
|
+
display: 'flex',
|
35
|
+
alignItems: 'center',
|
36
|
+
width: '100%',
|
37
|
+
overflow: 'hidden'
|
38
|
+
}) },
|
39
|
+
React.createElement("div", { className: styles['tow-line-ellipsis'] }, (_f = cta === null || cta === void 0 ? void 0 : cta.enTitle) !== null && _f !== void 0 ? _f : 'Product Name'))));
|
40
|
+
};
|
41
|
+
export default memo(Link);
|
@@ -0,0 +1,26 @@
|
|
1
|
+
import LinkComponent from '.';
|
2
|
+
import { createMaterial } from '../../../../core/create';
|
3
|
+
const Link = createMaterial(LinkComponent, {
|
4
|
+
displayName: '跳转指引',
|
5
|
+
icon: '',
|
6
|
+
category: 'template',
|
7
|
+
type: 'Link',
|
8
|
+
related: {
|
9
|
+
bindableProps: []
|
10
|
+
},
|
11
|
+
defaulSetting: {
|
12
|
+
props: {
|
13
|
+
content: '按钮'
|
14
|
+
},
|
15
|
+
style: {
|
16
|
+
padding: '7px',
|
17
|
+
display: 'flex',
|
18
|
+
background: 'rgba(0,0,0,.3)',
|
19
|
+
borderRadius: '3px'
|
20
|
+
}
|
21
|
+
},
|
22
|
+
w: 100,
|
23
|
+
h: 40,
|
24
|
+
sort: 5
|
25
|
+
});
|
26
|
+
export { Link };
|
@@ -0,0 +1,12 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import { RecItemType } from '../../../../core/components/SxpPageRender/typing';
|
3
|
+
export interface IMultiCommodityProps {
|
4
|
+
content?: string;
|
5
|
+
style?: Record<string, any>;
|
6
|
+
bgImg?: Record<string, any> | string;
|
7
|
+
recData?: RecItemType;
|
8
|
+
onClick?: () => void;
|
9
|
+
bottom_image?: string;
|
10
|
+
}
|
11
|
+
declare const _default: React.NamedExoticComponent<IMultiCommodityProps>;
|
12
|
+
export default _default;
|
@@ -0,0 +1,58 @@
|
|
1
|
+
import { __rest } from "tslib";
|
2
|
+
import { css } from '@emotion/css';
|
3
|
+
import React, { memo, useState } from 'react';
|
4
|
+
import { SwiperSlide } from 'swiper/react';
|
5
|
+
import { throttle } from 'lodash';
|
6
|
+
import Img from '../components/Img';
|
7
|
+
import Scroll from '../components/Scroll';
|
8
|
+
import styles from './index.module.less';
|
9
|
+
import { useSxpDataSource } from '../../../../core/hooks';
|
10
|
+
const MultiCommodity = (_a) => {
|
11
|
+
var _b, _c;
|
12
|
+
var { content, style, bgImg, recData, onClick, bottom_image } = _a, props = __rest(_a, ["content", "style", "bgImg", "recData", "onClick", "bottom_image"]);
|
13
|
+
const { sxpParameter } = useSxpDataSource();
|
14
|
+
const { ctaEvent, setPopupDetailData } = useSxpDataSource();
|
15
|
+
const [products, setProducts] = useState((_c = (_b = recData === null || recData === void 0 ? void 0 : recData.video) === null || _b === void 0 ? void 0 : _b.bindProducts) !== null && _c !== void 0 ? _c : [1, 2]);
|
16
|
+
const handleClick = throttle((item) => {
|
17
|
+
ctaEvent === null || ctaEvent === void 0 ? void 0 : ctaEvent({
|
18
|
+
eventSubject: 'clickCta',
|
19
|
+
eventDescription: 'User clicked the CTA'
|
20
|
+
}, recData, item);
|
21
|
+
setPopupDetailData === null || setPopupDetailData === void 0 ? void 0 : setPopupDetailData(Object.assign(Object.assign({}, recData), { video: Object.assign(Object.assign({}, recData === null || recData === void 0 ? void 0 : recData.video), { bindProduct: item }) }));
|
22
|
+
onClick === null || onClick === void 0 ? void 0 : onClick();
|
23
|
+
}, 1200);
|
24
|
+
return (React.createElement(Scroll, null, products === null || products === void 0 ? void 0 : products.map((item) => {
|
25
|
+
var _a, _b, _c, _d, _e, _f;
|
26
|
+
return (React.createElement(SwiperSlide, Object.assign({ hidden: recData && !(item === null || item === void 0 ? void 0 : item.bindCta), key: item.itemId, className: css(Object.assign(Object.assign({}, style), { maxWidth: '236px', width: '100%', flexShrink: 0 })) }, props, { onClick: () => handleClick(item) }),
|
27
|
+
React.createElement("div", { className: css({
|
28
|
+
width: '60px',
|
29
|
+
height: '60px',
|
30
|
+
marginRight: '8px',
|
31
|
+
borderRadius: '3px',
|
32
|
+
overflow: 'hidden',
|
33
|
+
flexShrink: 0,
|
34
|
+
backgroundColor: '#f2f2f2'
|
35
|
+
}) },
|
36
|
+
React.createElement(Img, { src: (_c = (_b = (_a = item === null || item === void 0 ? void 0 : item.homePage) === null || _a === void 0 ? void 0 : _a[0]) !== null && _b !== void 0 ? _b : sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _c !== void 0 ? _c : bottom_image, rec: recData, item: item })),
|
37
|
+
React.createElement("div", { className: css({
|
38
|
+
color: '#fff',
|
39
|
+
display: 'flex',
|
40
|
+
flexDirection: 'column',
|
41
|
+
justifyContent: 'space-between',
|
42
|
+
width: '100%',
|
43
|
+
overflow: 'hidden'
|
44
|
+
}) },
|
45
|
+
React.createElement("div", { className: styles['two-line-ellipsis'] }, (_d = item === null || item === void 0 ? void 0 : item.title) !== null && _d !== void 0 ? _d : 'Product Name'),
|
46
|
+
React.createElement("div", { className: css({
|
47
|
+
background: 'rgba(0,0,0,.5)',
|
48
|
+
fontSize: '10px',
|
49
|
+
padding: '2px 7px',
|
50
|
+
width: 'auto',
|
51
|
+
textAlign: 'center',
|
52
|
+
textOverflow: 'ellipsis',
|
53
|
+
overflow: 'hidden',
|
54
|
+
whiteSpace: 'nowrap'
|
55
|
+
}) }, (_f = (_e = item === null || item === void 0 ? void 0 : item.bindCta) === null || _e === void 0 ? void 0 : _e.enTitle) !== null && _f !== void 0 ? _f : 'Shop Now'))));
|
56
|
+
})));
|
57
|
+
};
|
58
|
+
export default memo(MultiCommodity);
|
@@ -0,0 +1,26 @@
|
|
1
|
+
import interactionRender from './interactionRender';
|
2
|
+
import MultiCommodityComponent from '.';
|
3
|
+
import { createMaterial } from '../../../../core/create';
|
4
|
+
const MultiCommodity = createMaterial(MultiCommodityComponent, {
|
5
|
+
displayName: '推荐多商品-透明底',
|
6
|
+
icon: '',
|
7
|
+
category: 'template',
|
8
|
+
type: 'MultiCommodity',
|
9
|
+
related: {
|
10
|
+
interactionRender,
|
11
|
+
bindableProps: []
|
12
|
+
},
|
13
|
+
defaulSetting: {
|
14
|
+
props: {},
|
15
|
+
style: {
|
16
|
+
padding: '7px',
|
17
|
+
display: 'flex',
|
18
|
+
background: 'rgba(0,0,0,.3)',
|
19
|
+
borderRadius: '3px'
|
20
|
+
}
|
21
|
+
},
|
22
|
+
w: 100,
|
23
|
+
h: 40,
|
24
|
+
sort: 3
|
25
|
+
});
|
26
|
+
export { MultiCommodity };
|
@@ -0,0 +1,12 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import { RecItemType } from '../../../../core/components/SxpPageRender/typing';
|
3
|
+
export interface IMultiCommodityDiroProps {
|
4
|
+
content?: string;
|
5
|
+
style?: Record<string, any>;
|
6
|
+
bgImg?: Record<string, any> | string;
|
7
|
+
recData?: RecItemType;
|
8
|
+
onClick?: () => void;
|
9
|
+
bottom_image?: string;
|
10
|
+
}
|
11
|
+
declare const _default: React.NamedExoticComponent<IMultiCommodityDiroProps>;
|
12
|
+
export default _default;
|
@@ -0,0 +1,60 @@
|
|
1
|
+
import { __rest } from "tslib";
|
2
|
+
import { css } from '@emotion/css';
|
3
|
+
import React, { memo, useState } from 'react';
|
4
|
+
import { SwiperSlide } from 'swiper/react';
|
5
|
+
import { throttle } from 'lodash';
|
6
|
+
import Scroll from '../components/Scroll';
|
7
|
+
import Img from '../components/Img';
|
8
|
+
import styles from './index.module.less';
|
9
|
+
import { useSxpDataSource } from '../../../../core/hooks';
|
10
|
+
const MultiCommodityDiro = (_a) => {
|
11
|
+
var _b, _c;
|
12
|
+
var { content, style, bgImg, recData, onClick, bottom_image } = _a, props = __rest(_a, ["content", "style", "bgImg", "recData", "onClick", "bottom_image"]);
|
13
|
+
const { ctaEvent, setPopupDetailData, sxpParameter } = useSxpDataSource();
|
14
|
+
const [products, setProducts] = useState((_c = (_b = recData === null || recData === void 0 ? void 0 : recData.video) === null || _b === void 0 ? void 0 : _b.bindProducts) !== null && _c !== void 0 ? _c : [1, 2]);
|
15
|
+
const handleClick = throttle((item) => {
|
16
|
+
ctaEvent === null || ctaEvent === void 0 ? void 0 : ctaEvent({
|
17
|
+
eventSubject: 'clickCta',
|
18
|
+
eventDescription: 'User clicked the CTA'
|
19
|
+
}, recData, item);
|
20
|
+
setPopupDetailData === null || setPopupDetailData === void 0 ? void 0 : setPopupDetailData(Object.assign(Object.assign({}, recData), { video: Object.assign(Object.assign({}, recData === null || recData === void 0 ? void 0 : recData.video), { bindProduct: item }) }));
|
21
|
+
onClick === null || onClick === void 0 ? void 0 : onClick();
|
22
|
+
}, 1200);
|
23
|
+
return (React.createElement(Scroll, null, products === null || products === void 0 ? void 0 : products.map((item) => {
|
24
|
+
var _a, _b, _c, _d, _e, _f;
|
25
|
+
return (React.createElement(SwiperSlide, Object.assign({ hidden: recData && !(item === null || item === void 0 ? void 0 : item.bindCta), key: item === null || item === void 0 ? void 0 : item.itemId, className: css(Object.assign(Object.assign({}, style), { maxWidth: '236px', width: '100%', flexShrink: 0 })) }, props, { onClick: () => handleClick(item) }),
|
26
|
+
React.createElement("div", { className: css({
|
27
|
+
width: '60px',
|
28
|
+
height: '60px',
|
29
|
+
marginRight: '8px',
|
30
|
+
borderRadius: '3px',
|
31
|
+
overflow: 'hidden',
|
32
|
+
flexShrink: 0,
|
33
|
+
backgroundColor: '#f2f2f2'
|
34
|
+
}) },
|
35
|
+
React.createElement(Img, { src: (_c = (_b = (_a = item === null || item === void 0 ? void 0 : item.homePage) === null || _a === void 0 ? void 0 : _a[0]) !== null && _b !== void 0 ? _b : sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _c !== void 0 ? _c : bottom_image, rec: recData, item: item })),
|
36
|
+
React.createElement("div", { className: css({
|
37
|
+
color: '#000',
|
38
|
+
display: 'flex',
|
39
|
+
flexDirection: 'column',
|
40
|
+
justifyContent: 'space-between',
|
41
|
+
width: '100%',
|
42
|
+
overflow: 'hidden'
|
43
|
+
}) },
|
44
|
+
React.createElement("div", { className: styles['two-line-ellipsis'] }, (_d = item === null || item === void 0 ? void 0 : item.title) !== null && _d !== void 0 ? _d : 'Product Name'),
|
45
|
+
React.createElement("div", { className: css({
|
46
|
+
background: 'rgba(0,0,0,1)',
|
47
|
+
fontSize: '10px',
|
48
|
+
padding: '2px 7px',
|
49
|
+
textAlign: 'center',
|
50
|
+
textOverflow: 'ellipsis',
|
51
|
+
overflow: 'hidden',
|
52
|
+
borderRadius: '25px',
|
53
|
+
width: 'fit-content',
|
54
|
+
maxWidth: '100%',
|
55
|
+
color: '#fff',
|
56
|
+
whiteSpace: 'nowrap'
|
57
|
+
}) }, (_f = (_e = item === null || item === void 0 ? void 0 : item.bindCta) === null || _e === void 0 ? void 0 : _e.enTitle) !== null && _f !== void 0 ? _f : 'Shop Now'))));
|
58
|
+
})));
|
59
|
+
};
|
60
|
+
export default memo(MultiCommodityDiro);
|
@@ -0,0 +1,26 @@
|
|
1
|
+
import interactionRender from './interactionRender';
|
2
|
+
import MultiCommodityDiroComponent from '.';
|
3
|
+
import { createMaterial } from '../../../../core/create';
|
4
|
+
const MultiCommodityDiro = createMaterial(MultiCommodityDiroComponent, {
|
5
|
+
displayName: '推荐多商品-白底圆角按钮',
|
6
|
+
icon: '',
|
7
|
+
category: 'template',
|
8
|
+
type: 'MultiCommodityDiro',
|
9
|
+
related: {
|
10
|
+
interactionRender,
|
11
|
+
bindableProps: []
|
12
|
+
},
|
13
|
+
defaulSetting: {
|
14
|
+
props: {},
|
15
|
+
style: {
|
16
|
+
padding: '7px',
|
17
|
+
display: 'flex',
|
18
|
+
background: '#fff',
|
19
|
+
borderRadius: '3px'
|
20
|
+
}
|
21
|
+
},
|
22
|
+
w: 100,
|
23
|
+
h: 40,
|
24
|
+
sort: 4
|
25
|
+
});
|
26
|
+
export { MultiCommodityDiro };
|
@@ -0,0 +1,12 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import { RecItemType } from '../../../../core/components/SxpPageRender/typing';
|
3
|
+
export interface IMultiCommodityDiroNewProps {
|
4
|
+
content?: string;
|
5
|
+
style?: Record<string, any>;
|
6
|
+
bgImg?: Record<string, any> | string;
|
7
|
+
recData?: RecItemType;
|
8
|
+
onClick?: () => void;
|
9
|
+
bottom_image?: string;
|
10
|
+
}
|
11
|
+
declare const _default: React.NamedExoticComponent<IMultiCommodityDiroNewProps>;
|
12
|
+
export default _default;
|
@@ -0,0 +1,59 @@
|
|
1
|
+
import { __rest } from "tslib";
|
2
|
+
import { css } from '@emotion/css';
|
3
|
+
import React, { memo, useState } from 'react';
|
4
|
+
import { SwiperSlide } from 'swiper/react';
|
5
|
+
import { throttle } from 'lodash';
|
6
|
+
import Scroll from '../components/Scroll';
|
7
|
+
import Img from '../components/Img';
|
8
|
+
import styles from './index.module.less';
|
9
|
+
import { useSxpDataSource } from '../../../../core/hooks';
|
10
|
+
const MultiCommodityDiroNew = (_a) => {
|
11
|
+
var _b, _c;
|
12
|
+
var { content, style, bgImg, recData, onClick, bottom_image } = _a, props = __rest(_a, ["content", "style", "bgImg", "recData", "onClick", "bottom_image"]);
|
13
|
+
const { ctaEvent, setPopupDetailData, sxpParameter } = useSxpDataSource();
|
14
|
+
const [products, setProducts] = useState((_c = (_b = recData === null || recData === void 0 ? void 0 : recData.video) === null || _b === void 0 ? void 0 : _b.bindProducts) !== null && _c !== void 0 ? _c : [1, 2]);
|
15
|
+
const handleClick = throttle((item) => {
|
16
|
+
ctaEvent === null || ctaEvent === void 0 ? void 0 : ctaEvent({
|
17
|
+
eventSubject: 'clickCta',
|
18
|
+
eventDescription: 'User clicked the CTA'
|
19
|
+
}, recData, item);
|
20
|
+
setPopupDetailData === null || setPopupDetailData === void 0 ? void 0 : setPopupDetailData(Object.assign(Object.assign({}, recData), { video: Object.assign(Object.assign({}, recData === null || recData === void 0 ? void 0 : recData.video), { bindProduct: item }) }));
|
21
|
+
onClick === null || onClick === void 0 ? void 0 : onClick();
|
22
|
+
}, 1200);
|
23
|
+
return (React.createElement(Scroll, null, products === null || products === void 0 ? void 0 : products.map((item) => {
|
24
|
+
var _a, _b, _c, _d, _e, _f;
|
25
|
+
return (React.createElement(SwiperSlide, Object.assign({ hidden: recData && !(item === null || item === void 0 ? void 0 : item.bindCta), key: item === null || item === void 0 ? void 0 : item.itemId, className: css(Object.assign(Object.assign({}, style), { maxWidth: '260px', width: '100%', flexShrink: 0, padding: '4px', background: 'rgba(255,255,255,0.75)' })) }, props, { onClick: () => handleClick(item) }),
|
26
|
+
React.createElement("div", { className: css({
|
27
|
+
width: '78px',
|
28
|
+
height: '78px',
|
29
|
+
marginRight: '16px',
|
30
|
+
borderRadius: '8px',
|
31
|
+
overflow: 'hidden',
|
32
|
+
flexShrink: 0,
|
33
|
+
backgroundColor: '#f2f2f2'
|
34
|
+
}) },
|
35
|
+
React.createElement(Img, { src: (_c = (_b = (_a = item === null || item === void 0 ? void 0 : item.homePage) === null || _a === void 0 ? void 0 : _a[0]) !== null && _b !== void 0 ? _b : sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _c !== void 0 ? _c : bottom_image, rec: recData, item: item })),
|
36
|
+
React.createElement("div", { className: css({
|
37
|
+
color: '#fff',
|
38
|
+
display: 'flex',
|
39
|
+
flexDirection: 'column',
|
40
|
+
justifyContent: 'center',
|
41
|
+
width: '100%',
|
42
|
+
overflow: 'hidden',
|
43
|
+
lineHeight: '20px'
|
44
|
+
}) },
|
45
|
+
React.createElement("div", { className: styles['tow-line-ellipsis'] }, (_d = item === null || item === void 0 ? void 0 : item.title) !== null && _d !== void 0 ? _d : 'Product Name'),
|
46
|
+
React.createElement("div", { className: css({
|
47
|
+
fontSize: '13px',
|
48
|
+
fontWeight: 'bold',
|
49
|
+
textOverflow: 'ellipsis',
|
50
|
+
overflow: 'hidden',
|
51
|
+
width: 'fit-content',
|
52
|
+
maxWidth: '100%',
|
53
|
+
whiteSpace: 'nowrap',
|
54
|
+
textDecoration: 'underline',
|
55
|
+
color: '#000'
|
56
|
+
}) }, (_f = (_e = item === null || item === void 0 ? void 0 : item.bindCta) === null || _e === void 0 ? void 0 : _e.enTitle) !== null && _f !== void 0 ? _f : 'Shop now'))));
|
57
|
+
})));
|
58
|
+
};
|
59
|
+
export default memo(MultiCommodityDiroNew);
|
@@ -0,0 +1,26 @@
|
|
1
|
+
import interactionRender from './interactionRender';
|
2
|
+
import MultiCommodityDiroNewComponent from '.';
|
3
|
+
import { createMaterial } from '../../../../core/create';
|
4
|
+
const MultiCommodityDiroNew = createMaterial(MultiCommodityDiroNewComponent, {
|
5
|
+
displayName: '推荐多商品-白底下划线按钮',
|
6
|
+
icon: '',
|
7
|
+
category: 'template',
|
8
|
+
type: 'MultiCommodityDiroNew',
|
9
|
+
related: {
|
10
|
+
interactionRender,
|
11
|
+
bindableProps: []
|
12
|
+
},
|
13
|
+
defaulSetting: {
|
14
|
+
props: {},
|
15
|
+
style: {
|
16
|
+
padding: '7px',
|
17
|
+
display: 'flex',
|
18
|
+
background: '#fff',
|
19
|
+
borderRadius: '3px'
|
20
|
+
}
|
21
|
+
},
|
22
|
+
w: 100,
|
23
|
+
h: 40,
|
24
|
+
sort: 4
|
25
|
+
});
|
26
|
+
export { MultiCommodityDiroNew };
|
@@ -0,0 +1,10 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import { RecItemType } from '../../../../core/components/SxpPageRender/typing';
|
3
|
+
export interface IImgProps {
|
4
|
+
rec?: RecItemType;
|
5
|
+
children: any;
|
6
|
+
className?: any;
|
7
|
+
onClick?: any;
|
8
|
+
}
|
9
|
+
declare const _default: React.NamedExoticComponent<IImgProps>;
|
10
|
+
export default _default;
|
@@ -0,0 +1,33 @@
|
|
1
|
+
import { __rest } from "tslib";
|
2
|
+
import React, { memo, useEffect, useRef } from 'react';
|
3
|
+
import { throttle } from 'lodash';
|
4
|
+
import useOnScreen from '../../../../core/hooks/useOnScreen';
|
5
|
+
import { useSxpDataSource } from '../../../../core/hooks';
|
6
|
+
const EventProvider = (_a) => {
|
7
|
+
var { rec, children, className, onClick } = _a, props = __rest(_a, ["rec", "children", "className", "onClick"]);
|
8
|
+
const ref = useRef(null);
|
9
|
+
const isOnScreen = useOnScreen(ref);
|
10
|
+
const { setPopupDetailData, ctaEvent } = useSxpDataSource();
|
11
|
+
useEffect(() => {
|
12
|
+
var _a, _b;
|
13
|
+
if (isOnScreen && (ref === null || ref === void 0 ? void 0 : ref.current)) {
|
14
|
+
const item = (_b = (_a = rec === null || rec === void 0 ? void 0 : rec.video) === null || _a === void 0 ? void 0 : _a.bindProduct) !== null && _b !== void 0 ? _b : rec === null || rec === void 0 ? void 0 : rec.video;
|
15
|
+
ctaEvent === null || ctaEvent === void 0 ? void 0 : ctaEvent({
|
16
|
+
eventSubject: 'ctaExposure',
|
17
|
+
eventDescription: 'The cta was shown to the user'
|
18
|
+
}, rec, item);
|
19
|
+
}
|
20
|
+
}, [isOnScreen, ref, rec, ctaEvent]);
|
21
|
+
const handleClick = throttle(() => {
|
22
|
+
var _a, _b;
|
23
|
+
const item = (_b = (_a = rec === null || rec === void 0 ? void 0 : rec.video) === null || _a === void 0 ? void 0 : _a.bindProduct) !== null && _b !== void 0 ? _b : rec === null || rec === void 0 ? void 0 : rec.video;
|
24
|
+
ctaEvent === null || ctaEvent === void 0 ? void 0 : ctaEvent({
|
25
|
+
eventSubject: 'clickCta',
|
26
|
+
eventDescription: 'User clicked the CTA'
|
27
|
+
}, rec, item);
|
28
|
+
setPopupDetailData === null || setPopupDetailData === void 0 ? void 0 : setPopupDetailData(rec);
|
29
|
+
onClick === null || onClick === void 0 ? void 0 : onClick();
|
30
|
+
}, 1200);
|
31
|
+
return (React.createElement("div", { ref: ref, className: className, onClick: handleClick }, children));
|
32
|
+
};
|
33
|
+
export default memo(EventProvider);
|
@@ -0,0 +1,9 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import { ProductInfoType, RecItemType } from '../../../../core/components/SxpPageRender/typing';
|
3
|
+
export interface IImgProps {
|
4
|
+
src: string;
|
5
|
+
rec?: RecItemType;
|
6
|
+
item?: ProductInfoType;
|
7
|
+
}
|
8
|
+
declare const _default: React.NamedExoticComponent<IImgProps>;
|
9
|
+
export default _default;
|
@@ -0,0 +1,19 @@
|
|
1
|
+
import { css } from '@emotion/css';
|
2
|
+
import React, { memo, useEffect, useRef } from 'react';
|
3
|
+
import useOnScreen from '../../../../core/hooks/useOnScreen';
|
4
|
+
import { useSxpDataSource } from '../../../../core/hooks';
|
5
|
+
const Img = ({ src, rec, item }) => {
|
6
|
+
const ref = useRef(null);
|
7
|
+
const isOnScreen = useOnScreen(ref);
|
8
|
+
const { ctaEvent } = useSxpDataSource();
|
9
|
+
useEffect(() => {
|
10
|
+
if (isOnScreen && src && (ref === null || ref === void 0 ? void 0 : ref.current)) {
|
11
|
+
ctaEvent === null || ctaEvent === void 0 ? void 0 : ctaEvent({
|
12
|
+
eventSubject: 'ctaExposure',
|
13
|
+
eventDescription: 'The cta was shown to the user'
|
14
|
+
}, rec, item);
|
15
|
+
}
|
16
|
+
}, [isOnScreen, src, ref, rec, ctaEvent, item]);
|
17
|
+
return (React.createElement("img", { ref: ref, hidden: !src, className: css({ width: '100%', objectFit: 'cover', height: '100%' }), src: src, alt: '' }));
|
18
|
+
};
|
19
|
+
export default memo(Img);
|
@@ -0,0 +1,10 @@
|
|
1
|
+
import React, { memo } from 'react';
|
2
|
+
import { Swiper } from 'swiper/react';
|
3
|
+
import 'swiper/css';
|
4
|
+
import 'swiper/css/free-mode';
|
5
|
+
import 'swiper/css/scrollbar';
|
6
|
+
import { FreeMode, Scrollbar, Mousewheel } from 'swiper/modules';
|
7
|
+
const Scroll = ({ children }) => {
|
8
|
+
return (React.createElement(Swiper, { direction: 'horizontal', slidesPerView: 'auto', freeMode: true, mousewheel: true, modules: [FreeMode, Scrollbar, Mousewheel], style: { paddingRight: '20px' } }, children));
|
9
|
+
};
|
10
|
+
export default memo(Scroll);
|
@@ -0,0 +1,8 @@
|
|
1
|
+
export * from './Commodity/material';
|
2
|
+
export * from './Appoint/material';
|
3
|
+
export * from './Link/material';
|
4
|
+
export * from './CommodityDiro/material';
|
5
|
+
export * from './CommodityDiroNew/material';
|
6
|
+
export * from './MultiCommodityDiro/material';
|
7
|
+
export * from './MultiCommodity/material';
|
8
|
+
export * from './MultiCommodityDiroNew/material';
|
@@ -0,0 +1,8 @@
|
|
1
|
+
export * from './Commodity/material';
|
2
|
+
export * from './Appoint/material';
|
3
|
+
export * from './Link/material';
|
4
|
+
export * from './CommodityDiro/material';
|
5
|
+
export * from './CommodityDiroNew/material';
|
6
|
+
export * from './MultiCommodityDiro/material';
|
7
|
+
export * from './MultiCommodity/material';
|
8
|
+
export * from './MultiCommodityDiroNew/material';
|
@@ -0,0 +1,15 @@
|
|
1
|
+
export default class PagebuilderClass {
|
2
|
+
private appId;
|
3
|
+
private tenantId;
|
4
|
+
private apiUrl;
|
5
|
+
private env?;
|
6
|
+
constructor();
|
7
|
+
setApiUrl(apiUrl: string): void;
|
8
|
+
getApiUrl(): string;
|
9
|
+
getEnv(): 'dev' | 'staging' | 'live' | undefined;
|
10
|
+
setEnv(value: 'dev' | 'staging' | 'live' | undefined): void;
|
11
|
+
setAppId: (appId: string) => void;
|
12
|
+
setTenantId: (tenantId: string) => void;
|
13
|
+
getAppId: () => string | undefined;
|
14
|
+
getTenantId: () => string | undefined;
|
15
|
+
}
|
@@ -0,0 +1,45 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
let _instance = null;
|
4
|
+
const API_URL = {
|
5
|
+
dev: 'https://clc-pagebuilder-be-dev.chatlabs.net',
|
6
|
+
staging: 'https://clc-pagebuilder-be-staging.chatlabs.net',
|
7
|
+
live: 'https://clc-pagebuilder-be.chatlabs.net'
|
8
|
+
};
|
9
|
+
class PagebuilderClass {
|
10
|
+
constructor() {
|
11
|
+
this.setAppId = (appId) => {
|
12
|
+
this.appId = appId;
|
13
|
+
};
|
14
|
+
this.setTenantId = (tenantId) => {
|
15
|
+
this.tenantId = tenantId;
|
16
|
+
};
|
17
|
+
this.getAppId = () => {
|
18
|
+
return this.appId;
|
19
|
+
};
|
20
|
+
this.getTenantId = () => {
|
21
|
+
return this.tenantId;
|
22
|
+
};
|
23
|
+
if (_instance) {
|
24
|
+
return _instance;
|
25
|
+
}
|
26
|
+
_instance = this;
|
27
|
+
}
|
28
|
+
setApiUrl(apiUrl) {
|
29
|
+
this.apiUrl = `https://${apiUrl}`;
|
30
|
+
}
|
31
|
+
getApiUrl() {
|
32
|
+
if (this.apiUrl)
|
33
|
+
return this.apiUrl;
|
34
|
+
if (!this.env)
|
35
|
+
return '';
|
36
|
+
return API_URL[this.env];
|
37
|
+
}
|
38
|
+
getEnv() {
|
39
|
+
return this.env;
|
40
|
+
}
|
41
|
+
setEnv(value) {
|
42
|
+
this.env = value;
|
43
|
+
}
|
44
|
+
}
|
45
|
+
exports.default = PagebuilderClass;
|