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,65 @@
|
|
1
|
+
declare const _default: ({
|
2
|
+
type: string;
|
3
|
+
label: string;
|
4
|
+
name: string;
|
5
|
+
title?: undefined;
|
6
|
+
child?: undefined;
|
7
|
+
} | {
|
8
|
+
title: string;
|
9
|
+
child: ({
|
10
|
+
type: string;
|
11
|
+
label: string;
|
12
|
+
name: string[];
|
13
|
+
child?: undefined;
|
14
|
+
options?: undefined;
|
15
|
+
} | {
|
16
|
+
type: string;
|
17
|
+
label: string;
|
18
|
+
child: ({
|
19
|
+
type: string;
|
20
|
+
name: string[];
|
21
|
+
options?: undefined;
|
22
|
+
addonAfter?: undefined;
|
23
|
+
} | {
|
24
|
+
type: string;
|
25
|
+
name: string[];
|
26
|
+
options: {
|
27
|
+
label: string;
|
28
|
+
value: string;
|
29
|
+
}[];
|
30
|
+
addonAfter?: undefined;
|
31
|
+
} | {
|
32
|
+
type: string;
|
33
|
+
name: string[];
|
34
|
+
addonAfter: string;
|
35
|
+
options?: undefined;
|
36
|
+
})[];
|
37
|
+
name?: undefined;
|
38
|
+
options?: undefined;
|
39
|
+
} | {
|
40
|
+
label: string;
|
41
|
+
type: string;
|
42
|
+
options: ({
|
43
|
+
label: string;
|
44
|
+
value: string;
|
45
|
+
} | {
|
46
|
+
label: string;
|
47
|
+
value: undefined;
|
48
|
+
})[];
|
49
|
+
name: string[];
|
50
|
+
child?: undefined;
|
51
|
+
})[];
|
52
|
+
type?: undefined;
|
53
|
+
label?: undefined;
|
54
|
+
name?: undefined;
|
55
|
+
} | {
|
56
|
+
title: string;
|
57
|
+
child: {
|
58
|
+
type: string;
|
59
|
+
name: string[];
|
60
|
+
}[];
|
61
|
+
type?: undefined;
|
62
|
+
label?: undefined;
|
63
|
+
name?: undefined;
|
64
|
+
})[];
|
65
|
+
export default _default;
|
@@ -0,0 +1,90 @@
|
|
1
|
+
export default [
|
2
|
+
{
|
3
|
+
type: 'Text',
|
4
|
+
label: '组件名称',
|
5
|
+
name: 'name'
|
6
|
+
},
|
7
|
+
{
|
8
|
+
title: '表单信息',
|
9
|
+
child: [
|
10
|
+
{
|
11
|
+
type: 'Text',
|
12
|
+
label: '标题',
|
13
|
+
name: ['props', 'title']
|
14
|
+
},
|
15
|
+
{
|
16
|
+
type: 'Group',
|
17
|
+
label: '标题字体',
|
18
|
+
child: [
|
19
|
+
{
|
20
|
+
type: 'Color',
|
21
|
+
name: ['textStyle', 'color']
|
22
|
+
},
|
23
|
+
{
|
24
|
+
type: 'Select',
|
25
|
+
name: ['textStyle', 'fontFamily'],
|
26
|
+
options: [{ label: '黑体', value: '黑体' }]
|
27
|
+
},
|
28
|
+
{
|
29
|
+
type: 'Number',
|
30
|
+
name: ['textStyle', 'fontSize'],
|
31
|
+
addonAfter: 'px'
|
32
|
+
}
|
33
|
+
]
|
34
|
+
},
|
35
|
+
{
|
36
|
+
label: '标题样式',
|
37
|
+
type: 'TextStyle',
|
38
|
+
name: ['textStyle']
|
39
|
+
},
|
40
|
+
{
|
41
|
+
label: '标题对齐',
|
42
|
+
type: 'TextAlign',
|
43
|
+
name: ['textStyle']
|
44
|
+
},
|
45
|
+
{
|
46
|
+
label: '表单布局',
|
47
|
+
type: 'Radius',
|
48
|
+
options: [
|
49
|
+
{
|
50
|
+
label: '左右',
|
51
|
+
value: 'horizontal'
|
52
|
+
},
|
53
|
+
{
|
54
|
+
label: '上下',
|
55
|
+
value: 'vertical'
|
56
|
+
},
|
57
|
+
{
|
58
|
+
label: '提示',
|
59
|
+
value: undefined
|
60
|
+
}
|
61
|
+
],
|
62
|
+
name: ['props', 'layoutType']
|
63
|
+
},
|
64
|
+
{
|
65
|
+
label: '提交按钮文本',
|
66
|
+
type: 'Text',
|
67
|
+
name: ['props', 'submitText']
|
68
|
+
},
|
69
|
+
{
|
70
|
+
label: '提交文本颜色',
|
71
|
+
type: 'Color',
|
72
|
+
name: ['props', 'submitColor']
|
73
|
+
},
|
74
|
+
{
|
75
|
+
label: '提交按钮颜色',
|
76
|
+
type: 'Color',
|
77
|
+
name: ['props', 'submitBgColor']
|
78
|
+
}
|
79
|
+
]
|
80
|
+
},
|
81
|
+
{
|
82
|
+
title: '表单项',
|
83
|
+
child: [
|
84
|
+
{
|
85
|
+
type: 'AddFormItems',
|
86
|
+
name: ['props', 'columns']
|
87
|
+
}
|
88
|
+
]
|
89
|
+
}
|
90
|
+
];
|
@@ -0,0 +1,14 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import { IEditorContext } from '../../../../core/context/EditorContext';
|
3
|
+
import './index.less';
|
4
|
+
export interface ICommodityDetailProps {
|
5
|
+
content?: string;
|
6
|
+
style?: Record<string, any>;
|
7
|
+
bgImg?: Record<string, any> | string;
|
8
|
+
onClick?: () => void;
|
9
|
+
schema?: IEditorContext['schema'];
|
10
|
+
isDefault?: boolean;
|
11
|
+
bottom_image?: string;
|
12
|
+
}
|
13
|
+
declare const _default: React.NamedExoticComponent<ICommodityDetailProps>;
|
14
|
+
export default _default;
|
@@ -0,0 +1,85 @@
|
|
1
|
+
import { __rest } from "tslib";
|
2
|
+
import { css } from '@emotion/css';
|
3
|
+
import React, { memo, useEffect, useMemo, useRef } from 'react';
|
4
|
+
import { useSxpDataSource } from '../../../../core/hooks';
|
5
|
+
import './index.less';
|
6
|
+
import { Autoplay, Pagination } from 'swiper/modules';
|
7
|
+
import { Swiper, SwiperSlide } from 'swiper/react';
|
8
|
+
import { useEventReport } from '../../../../core/hooks/useEventReport';
|
9
|
+
const CommodityDetail = (_a) => {
|
10
|
+
var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
11
|
+
var { content, style, bgImg, onClick, schema, isDefault, bottom_image } = _a, props = __rest(_a, ["content", "style", "bgImg", "onClick", "schema", "isDefault", "bottom_image"]);
|
12
|
+
const { sxpParameter } = useSxpDataSource();
|
13
|
+
const { popupDetailData, bffEventReport, isPreview, waterFallData } = useSxpDataSource();
|
14
|
+
const { jumpToWeb, productView } = useEventReport();
|
15
|
+
const curTimeRef = useRef(null);
|
16
|
+
const product = (_b = popupDetailData === null || popupDetailData === void 0 ? void 0 : popupDetailData.video) === null || _b === void 0 ? void 0 : _b.bindProduct;
|
17
|
+
const cta = (_d = (_c = popupDetailData === null || popupDetailData === void 0 ? void 0 : popupDetailData.video) === null || _c === void 0 ? void 0 : _c.bindProduct) === null || _d === void 0 ? void 0 : _d.bindCta;
|
18
|
+
const handleLink = () => {
|
19
|
+
if (product === null || product === void 0 ? void 0 : product.link) {
|
20
|
+
jumpToWeb(popupDetailData, product, cta);
|
21
|
+
productView(popupDetailData, product, cta, curTimeRef.current);
|
22
|
+
window.location.href = window.getJointUtmLink(product.link);
|
23
|
+
}
|
24
|
+
};
|
25
|
+
useEffect(() => {
|
26
|
+
const initTime = () => {
|
27
|
+
curTimeRef.current = new Date();
|
28
|
+
};
|
29
|
+
initTime();
|
30
|
+
window.addEventListener('pageshow', initTime);
|
31
|
+
return () => {
|
32
|
+
window.removeEventListener('pageshow', initTime);
|
33
|
+
};
|
34
|
+
}, []);
|
35
|
+
const priceText = useMemo(() => {
|
36
|
+
var _a, _b, _c, _d, _e;
|
37
|
+
if ((product === null || product === void 0 ? void 0 : product.currency) && (product === null || product === void 0 ? void 0 : product.price)) {
|
38
|
+
return `${(_c = (_b = (_a = product === null || product === void 0 ? void 0 : product.currency) === null || _a === void 0 ? void 0 : _a.split('-')[1]) === null || _b === void 0 ? void 0 : _b.toUpperCase()) !== null && _c !== void 0 ? _c : ''}${(_e = (_d = product === null || product === void 0 ? void 0 : product.price) === null || _d === void 0 ? void 0 : _d.toLocaleString('zh', {
|
39
|
+
minimumFractionDigits: 0
|
40
|
+
})) !== null && _e !== void 0 ? _e : ''}`;
|
41
|
+
}
|
42
|
+
else {
|
43
|
+
return '$7,000';
|
44
|
+
}
|
45
|
+
}, [product === null || product === void 0 ? void 0 : product.price, product === null || product === void 0 ? void 0 : product.currency]);
|
46
|
+
const width = isPreview ? 375 : window.innerWidth;
|
47
|
+
return (React.createElement("div", { className: 'pb-commondity' },
|
48
|
+
React.createElement("div", Object.assign({ className: css(Object.assign({}, style)) }, props),
|
49
|
+
product && ((_e = product === null || product === void 0 ? void 0 : product.homePage) === null || _e === void 0 ? void 0 : _e.length) > 0 && (React.createElement(Swiper, { height: width, modules: [Pagination, Autoplay], pagination: { clickable: true, bulletActiveClass: 'swipe-item-active-bullet' }, loop: true, autoplay: {
|
50
|
+
delay: 3000
|
51
|
+
} }, (_f = product === null || product === void 0 ? void 0 : product.homePage) === null || _f === void 0 ? void 0 : _f.map((src) => {
|
52
|
+
return (React.createElement(SwiperSlide, { key: src },
|
53
|
+
React.createElement("div", { style: {
|
54
|
+
overflow: 'hidden',
|
55
|
+
width,
|
56
|
+
height: width
|
57
|
+
} },
|
58
|
+
React.createElement("img", { src: src, style: { height: '100%', width: '100%', objectFit: 'cover' } }))));
|
59
|
+
}))),
|
60
|
+
!((_g = product === null || product === void 0 ? void 0 : product.homePage) === null || _g === void 0 ? void 0 : _g.length) && (React.createElement("div", { className: css({
|
61
|
+
position: 'relative',
|
62
|
+
height: 0,
|
63
|
+
width: '100%',
|
64
|
+
paddingBottom: '100%',
|
65
|
+
overflow: 'hidden'
|
66
|
+
}) },
|
67
|
+
React.createElement("img", { className: css({
|
68
|
+
position: 'absolute',
|
69
|
+
left: 0,
|
70
|
+
top: 0,
|
71
|
+
objectFit: 'cover',
|
72
|
+
width: '100%'
|
73
|
+
}), src: (_h = sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _h !== void 0 ? _h : bottom_image, alt: '' }))),
|
74
|
+
React.createElement("div", { className: 'pb-commondity-content' },
|
75
|
+
React.createElement("div", { className: 'pb-commondity-content-collection' }, (_j = product === null || product === void 0 ? void 0 : product.collection) !== null && _j !== void 0 ? _j : 'Tiffany Lock'),
|
76
|
+
React.createElement("div", { className: 'pb-commondity-content-title' }, (_k = product === null || product === void 0 ? void 0 : product.title) !== null && _k !== void 0 ? _k : 'Pendant in Yellow Gold with Diamonds, Medium'),
|
77
|
+
React.createElement("div", { className: 'pb-commondity-content-price' }, priceText),
|
78
|
+
React.createElement("div", { className: 'pb-commondity-content-info' }, (_l = product === null || product === void 0 ? void 0 : product.info) !== null && _l !== void 0 ? _l : `The design inspiration of Tiffany Lock series comes from the power of connection and inclusiveness, and the
|
79
|
+
bold and avant-garde visual design interprets the emotional bond connecting my heart. The Tiffany Lock
|
80
|
+
collection is unisex and is inspired by the padlock pattern found in the Tiffany Antique Collection. This
|
81
|
+
necklace features a stylish and eye-catching oval clasp chain decorated with a lock pattern. Crafted from
|
82
|
+
18-karat gold, this necklace is embellished with hand-set diamonds.`))),
|
83
|
+
(isDefault || (product === null || product === void 0 ? void 0 : product.link)) && (React.createElement("button", { onClick: handleLink, className: 'pb-commondity-btn' }, (_m = cta === null || cta === void 0 ? void 0 : cta.enTitle) !== null && _m !== void 0 ? _m : 'Purchase on Website'))));
|
84
|
+
};
|
85
|
+
export default memo(CommodityDetail);
|
@@ -0,0 +1,16 @@
|
|
1
|
+
import CommodityDetailComponent from '.';
|
2
|
+
import { createMaterial } from '../../../../core/create';
|
3
|
+
const CommodityDetail = createMaterial(CommodityDetailComponent, {
|
4
|
+
displayName: '商品详情',
|
5
|
+
icon: '',
|
6
|
+
category: 'popup',
|
7
|
+
type: 'CommodityDetail',
|
8
|
+
defaulSetting: {
|
9
|
+
props: {},
|
10
|
+
style: {}
|
11
|
+
},
|
12
|
+
w: 100,
|
13
|
+
h: 40,
|
14
|
+
sort: 1
|
15
|
+
});
|
16
|
+
export { CommodityDetail };
|
@@ -0,0 +1,18 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import { IEditorContext } from '../../../../core/context/EditorContext';
|
3
|
+
import { RecItemType } from '../../../../core/components/SxpPageRender/typing';
|
4
|
+
import './index.less';
|
5
|
+
export interface ICommodityDetailDiroProps {
|
6
|
+
content?: string;
|
7
|
+
style?: Record<string, any>;
|
8
|
+
bgImg?: Record<string, any> | string;
|
9
|
+
onClick?: () => void;
|
10
|
+
schema?: IEditorContext['schema'];
|
11
|
+
isDefault?: boolean;
|
12
|
+
rec?: RecItemType;
|
13
|
+
viewTime?: any;
|
14
|
+
isPost?: boolean;
|
15
|
+
bottom_image?: string;
|
16
|
+
}
|
17
|
+
declare const _default: React.NamedExoticComponent<ICommodityDetailDiroProps>;
|
18
|
+
export default _default;
|
@@ -0,0 +1,162 @@
|
|
1
|
+
import { __rest } from "tslib";
|
2
|
+
import { css } from '@emotion/css';
|
3
|
+
import React, { memo, useEffect, useMemo, useRef, useState } from 'react';
|
4
|
+
import { useSxpDataSource } from '../../../../core/hooks';
|
5
|
+
import './index.less';
|
6
|
+
import { Autoplay, Pagination } from 'swiper/modules';
|
7
|
+
import { Swiper, SwiperSlide } from 'swiper/react';
|
8
|
+
import arrow from './arrow.png';
|
9
|
+
import { useEventReport } from '../../../../core/hooks/useEventReport';
|
10
|
+
const CommodityDetailDiro = (_a) => {
|
11
|
+
var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
12
|
+
var { style, isDefault, rec, viewTime, isPost, bottom_image } = _a, props = __rest(_a, ["style", "isDefault", "rec", "viewTime", "isPost", "bottom_image"]);
|
13
|
+
const [spread, setSpread] = useState(true);
|
14
|
+
const { sxpParameter } = useSxpDataSource();
|
15
|
+
const { popupDetailData, bffEventReport, isPreview, swiperRef, waterFallData } = useSxpDataSource();
|
16
|
+
const { jumpToWeb, productView } = useEventReport();
|
17
|
+
const scrollRef = useRef(null);
|
18
|
+
const touchRef = useRef(null);
|
19
|
+
const touchMoveRef = useRef(null);
|
20
|
+
const [stopSlide, setStopSlide] = useState(false);
|
21
|
+
const [isBottom, setIsBottom] = useState(false);
|
22
|
+
const [isTop, setIsTop] = useState(true);
|
23
|
+
const curTimeRef = useRef(null);
|
24
|
+
const data = isPost ? rec : popupDetailData;
|
25
|
+
const product = isPost ? data === null || data === void 0 ? void 0 : data.product : (_b = data === null || data === void 0 ? void 0 : data.video) === null || _b === void 0 ? void 0 : _b.bindProduct;
|
26
|
+
const cta = isPost ? (_c = data === null || data === void 0 ? void 0 : data.product) === null || _c === void 0 ? void 0 : _c.bindCta : (_e = (_d = data === null || data === void 0 ? void 0 : data.video) === null || _d === void 0 ? void 0 : _d.bindProduct) === null || _e === void 0 ? void 0 : _e.bindCta;
|
27
|
+
const handleLink = () => {
|
28
|
+
if (product === null || product === void 0 ? void 0 : product.link) {
|
29
|
+
jumpToWeb(data, product, cta);
|
30
|
+
if (!isPost) {
|
31
|
+
productView(data, product, cta, viewTime || curTimeRef.current);
|
32
|
+
}
|
33
|
+
window.location.href = window.getJointUtmLink(product.link);
|
34
|
+
}
|
35
|
+
};
|
36
|
+
useEffect(() => {
|
37
|
+
const initTime = () => {
|
38
|
+
curTimeRef.current = new Date();
|
39
|
+
};
|
40
|
+
initTime();
|
41
|
+
window.addEventListener('pageshow', initTime);
|
42
|
+
return () => {
|
43
|
+
window.removeEventListener('pageshow', initTime);
|
44
|
+
};
|
45
|
+
}, []);
|
46
|
+
const priceText = useMemo(() => {
|
47
|
+
var _a, _b, _c, _d, _e;
|
48
|
+
if ((product === null || product === void 0 ? void 0 : product.currency) && (product === null || product === void 0 ? void 0 : product.price)) {
|
49
|
+
return `${(_c = (_b = (_a = product === null || product === void 0 ? void 0 : product.currency) === null || _a === void 0 ? void 0 : _a.split('-')[1]) === null || _b === void 0 ? void 0 : _b.toUpperCase()) !== null && _c !== void 0 ? _c : ''}${(_e = (_d = product === null || product === void 0 ? void 0 : product.price) === null || _d === void 0 ? void 0 : _d.toLocaleString('zh', {
|
50
|
+
minimumFractionDigits: 0
|
51
|
+
})) !== null && _e !== void 0 ? _e : ''}`;
|
52
|
+
}
|
53
|
+
else {
|
54
|
+
return '$7,000';
|
55
|
+
}
|
56
|
+
}, [product === null || product === void 0 ? void 0 : product.price, product === null || product === void 0 ? void 0 : product.currency]);
|
57
|
+
const width = isPreview ? 375 : window.innerWidth;
|
58
|
+
const handleClickCollapse = () => {
|
59
|
+
setSpread(!spread);
|
60
|
+
};
|
61
|
+
useEffect(() => {
|
62
|
+
var _a, _b;
|
63
|
+
console.log((_a = scrollRef === null || scrollRef === void 0 ? void 0 : scrollRef.current) === null || _a === void 0 ? void 0 : _a.scrollHeight, window.innerHeight);
|
64
|
+
if ((scrollRef === null || scrollRef === void 0 ? void 0 : scrollRef.current) && ((_b = scrollRef === null || scrollRef === void 0 ? void 0 : scrollRef.current) === null || _b === void 0 ? void 0 : _b.scrollHeight) > window.innerHeight) {
|
65
|
+
setStopSlide(true);
|
66
|
+
}
|
67
|
+
}, [scrollRef]);
|
68
|
+
useEffect(() => {
|
69
|
+
const handleScroll = () => {
|
70
|
+
if (scrollRef === null || scrollRef === void 0 ? void 0 : scrollRef.current) {
|
71
|
+
const { scrollTop, scrollHeight, clientHeight } = scrollRef.current;
|
72
|
+
const isBottom = scrollTop + clientHeight === scrollHeight;
|
73
|
+
if (isBottom) {
|
74
|
+
setIsBottom(true);
|
75
|
+
}
|
76
|
+
else {
|
77
|
+
setIsBottom(false);
|
78
|
+
}
|
79
|
+
if (scrollTop === 0) {
|
80
|
+
setIsTop(true);
|
81
|
+
}
|
82
|
+
else {
|
83
|
+
setIsTop(false);
|
84
|
+
}
|
85
|
+
}
|
86
|
+
};
|
87
|
+
if (scrollRef.current) {
|
88
|
+
scrollRef.current.addEventListener('scroll', handleScroll);
|
89
|
+
}
|
90
|
+
return () => {
|
91
|
+
if (scrollRef.current) {
|
92
|
+
scrollRef.current.removeEventListener('scroll', handleScroll);
|
93
|
+
}
|
94
|
+
};
|
95
|
+
}, [scrollRef]);
|
96
|
+
const handleTouchStart = (event) => {
|
97
|
+
event.stopPropagation();
|
98
|
+
touchRef.current = event.touches[0].clientY;
|
99
|
+
touchMoveRef.current = true;
|
100
|
+
};
|
101
|
+
const handleTouchMove = (event) => {
|
102
|
+
var _a, _b, _c, _d;
|
103
|
+
if (touchMoveRef.current) {
|
104
|
+
touchMoveRef.current = false;
|
105
|
+
const currentY = event.touches[0].clientY;
|
106
|
+
const diff = touchRef.current - currentY;
|
107
|
+
if (diff > 0 && (isBottom || !stopSlide)) {
|
108
|
+
(_b = (_a = swiperRef === null || swiperRef === void 0 ? void 0 : swiperRef.current) === null || _a === void 0 ? void 0 : _a.swiper) === null || _b === void 0 ? void 0 : _b.slideNext();
|
109
|
+
}
|
110
|
+
else if (diff < 0 && (isTop || !stopSlide)) {
|
111
|
+
(_d = (_c = swiperRef === null || swiperRef === void 0 ? void 0 : swiperRef.current) === null || _c === void 0 ? void 0 : _c.swiper) === null || _d === void 0 ? void 0 : _d.slidePrev();
|
112
|
+
}
|
113
|
+
}
|
114
|
+
};
|
115
|
+
return (React.createElement("div", { className: 'pb-commondityDiro' },
|
116
|
+
React.createElement("div", Object.assign({ ref: scrollRef, className: css(Object.assign({}, style)) }, props, { onTouchStart: handleTouchStart, onTouchMove: (e) => {
|
117
|
+
e.stopPropagation();
|
118
|
+
handleTouchMove(e);
|
119
|
+
} }),
|
120
|
+
product && ((_f = product === null || product === void 0 ? void 0 : product.homePage) === null || _f === void 0 ? void 0 : _f.length) > 0 && (React.createElement(Swiper, { height: width, modules: [Pagination, Autoplay], pagination: { clickable: true, bulletActiveClass: 'swipe-item-active-bullet' }, loop: true, autoplay: {
|
121
|
+
delay: 3000
|
122
|
+
} }, (_g = product === null || product === void 0 ? void 0 : product.homePage) === null || _g === void 0 ? void 0 : _g.map((src) => {
|
123
|
+
return (React.createElement(SwiperSlide, { key: src },
|
124
|
+
React.createElement("div", { style: {
|
125
|
+
overflow: 'hidden',
|
126
|
+
width,
|
127
|
+
height: width
|
128
|
+
} },
|
129
|
+
React.createElement("img", { src: src, style: { height: '100%', width: '100%', objectFit: 'cover' } }))));
|
130
|
+
}))),
|
131
|
+
!((_h = product === null || product === void 0 ? void 0 : product.homePage) === null || _h === void 0 ? void 0 : _h.length) && (React.createElement("div", { className: css({
|
132
|
+
position: 'relative',
|
133
|
+
height: 0,
|
134
|
+
width: '100%',
|
135
|
+
paddingBottom: '100%',
|
136
|
+
overflow: 'hidden'
|
137
|
+
}) },
|
138
|
+
React.createElement("img", { className: css({
|
139
|
+
position: 'absolute',
|
140
|
+
left: 0,
|
141
|
+
top: 0,
|
142
|
+
objectFit: 'cover',
|
143
|
+
width: '100%'
|
144
|
+
}), src: (_j = sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _j !== void 0 ? _j : bottom_image, alt: '' }))),
|
145
|
+
React.createElement("div", { className: 'pb-commondityDiro-content' },
|
146
|
+
React.createElement("div", { className: 'pb-commondityDiro-content-title' }, (_k = product === null || product === void 0 ? void 0 : product.title) !== null && _k !== void 0 ? _k : 'MEDIUM LADY D-LITE BAG'),
|
147
|
+
React.createElement("div", { className: 'pb-commondityDiro-content-collection', hidden: !!product && (!(product === null || product === void 0 ? void 0 : product.collection) || (product === null || product === void 0 ? void 0 : product.collection) === '') }, (product === null || product === void 0 ? void 0 : product.collection) || 'Gold-Tone and White Butterfly Zodiac Embroidery'),
|
148
|
+
React.createElement("div", { className: 'pb-commondityDiro-content-scrollRef', hidden: !!product && !(product === null || product === void 0 ? void 0 : product.itemId) }, (product === null || product === void 0 ? void 0 : product.itemId) ? `Reference: ${product === null || product === void 0 ? void 0 : product.itemId}` : 'Reference: M0565OESU_M01E'),
|
149
|
+
React.createElement("div", { className: 'pb-commondityDiro-content-line' }),
|
150
|
+
React.createElement("div", { className: 'pb-commondityDiro-content-price' }, priceText)),
|
151
|
+
React.createElement("div", { className: 'pb-commondityDiro-desc', hidden: !!product && (!(product === null || product === void 0 ? void 0 : product.info) || (product === null || product === void 0 ? void 0 : product.info) === '') },
|
152
|
+
React.createElement("div", { className: 'pb-commondityDiro-desc-collapse', onClick: handleClickCollapse },
|
153
|
+
React.createElement("div", { className: 'pb-commondityDiro-desc-collapse-title' }, "DESCRIPTION"),
|
154
|
+
React.createElement("img", { className: `pb-commondityDiro-desc-collapse-icon ${spread ? 'pb-commondityDiro-desc-collapse-iconActive' : ''}`, src: arrow, alt: '' })),
|
155
|
+
React.createElement("div", { className: 'pb-commondityDiro-desc-info', hidden: !spread }, (product === null || product === void 0 ? void 0 : product.info) ||
|
156
|
+
'The Lady D-Lite bag combines classic elegance with House modernity. The style is fully embroidered with a gold-tone and white Butterfly Zodiac motif by Pietro Ruffo, showcasing a constellation enhanced by astrological signs and adorned with butterflies. A Christian Dior Paris signature adorns the front, while D.I.O.R. charms in pale gold-finish metal further enhance and highlight the silhouette. Featuring a wide, removable embroidered shoulder strap, the medium Lady D-Lite bag can be carried by hand or worn crossbody.')),
|
157
|
+
(!product || (product === null || product === void 0 ? void 0 : product.link)) && (React.createElement(React.Fragment, null,
|
158
|
+
React.createElement("div", { className: 'pb-commondityDiro-h90' }),
|
159
|
+
React.createElement("div", { className: 'pb-commondityDiro-bottom' },
|
160
|
+
React.createElement("button", { onClick: handleLink, className: 'pb-commondityDiro-bottom-btn' }, (_l = cta === null || cta === void 0 ? void 0 : cta.enTitle) !== null && _l !== void 0 ? _l : 'SHOP NOW')))))));
|
161
|
+
};
|
162
|
+
export default memo(CommodityDetailDiro);
|
@@ -0,0 +1,16 @@
|
|
1
|
+
import CommodityDetailDiroComponent from '.';
|
2
|
+
import { createMaterial } from '../../../../core/create';
|
3
|
+
const CommodityDetailDiro = createMaterial(CommodityDetailDiroComponent, {
|
4
|
+
displayName: '商品详情',
|
5
|
+
icon: '',
|
6
|
+
category: 'popup',
|
7
|
+
type: 'CommodityDetailDiro',
|
8
|
+
defaulSetting: {
|
9
|
+
props: {},
|
10
|
+
style: {}
|
11
|
+
},
|
12
|
+
w: 100,
|
13
|
+
h: 40,
|
14
|
+
sort: 1
|
15
|
+
});
|
16
|
+
export { CommodityDetailDiro };
|
@@ -0,0 +1,22 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import { IEditorContext } from '../../../../core/context/EditorContext';
|
3
|
+
import { RecItemType } from '../../../../core/components/SxpPageRender/typing';
|
4
|
+
import './index.less';
|
5
|
+
export interface ICommodityDetailDiroNewProps {
|
6
|
+
content?: string;
|
7
|
+
style?: Record<string, any>;
|
8
|
+
bgImg?: Record<string, any> | string;
|
9
|
+
onClick?: () => void;
|
10
|
+
schema?: IEditorContext['schema'];
|
11
|
+
isDefault?: boolean;
|
12
|
+
rec?: RecItemType;
|
13
|
+
viewTime?: any;
|
14
|
+
isPost?: boolean;
|
15
|
+
bottom_image?: string;
|
16
|
+
tipText?: {
|
17
|
+
foldText?: string;
|
18
|
+
unfoldText?: string;
|
19
|
+
};
|
20
|
+
}
|
21
|
+
declare const _default: React.NamedExoticComponent<ICommodityDetailDiroNewProps>;
|
22
|
+
export default _default;
|
@@ -0,0 +1,129 @@
|
|
1
|
+
import { __rest } from "tslib";
|
2
|
+
import { css } from '@emotion/css';
|
3
|
+
import React, { memo, useEffect, useMemo, useRef, useState } from 'react';
|
4
|
+
import { useSxpDataSource } from '../../../../core/hooks';
|
5
|
+
import './index.less';
|
6
|
+
import { Autoplay, Pagination } from 'swiper/modules';
|
7
|
+
import { Swiper, SwiperSlide } from 'swiper/react';
|
8
|
+
import Modal from '../../../../core/components/SxpPageRender/Modal';
|
9
|
+
import ExpandableText from '../../../../core/components/SxpPageRender/ExpandableText';
|
10
|
+
import { useEventReport } from '../../../../core/hooks/useEventReport';
|
11
|
+
const CommodityDetailDiroNew = (_a) => {
|
12
|
+
var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
13
|
+
var { style, isDefault, rec, viewTime, isPost, bottom_image, tipText } = _a, props = __rest(_a, ["style", "isDefault", "rec", "viewTime", "isPost", "bottom_image", "tipText"]);
|
14
|
+
const [spread, setSpread] = useState(true);
|
15
|
+
const { sxpParameter } = useSxpDataSource();
|
16
|
+
const { popupDetailData, bffEventReport, isPreview, swiperRef, waterFallData } = useSxpDataSource();
|
17
|
+
const { jumpToWeb, productView } = useEventReport();
|
18
|
+
const scrollRef = useRef(null);
|
19
|
+
const touchRef = useRef(null);
|
20
|
+
const touchMoveRef = useRef(null);
|
21
|
+
const [stopSlide, setStopSlide] = useState(false);
|
22
|
+
const [isBottom, setIsBottom] = useState(false);
|
23
|
+
const [isTop, setIsTop] = useState(true);
|
24
|
+
const [showModal, setShowModal] = useState(false);
|
25
|
+
const curTimeRef = useRef(null);
|
26
|
+
const data = isPost ? rec : popupDetailData;
|
27
|
+
const product = isPost ? data === null || data === void 0 ? void 0 : data.product : (_b = data === null || data === void 0 ? void 0 : data.video) === null || _b === void 0 ? void 0 : _b.bindProduct;
|
28
|
+
const cta = isPost ? (_c = data === null || data === void 0 ? void 0 : data.product) === null || _c === void 0 ? void 0 : _c.bindCta : (_e = (_d = data === null || data === void 0 ? void 0 : data.video) === null || _d === void 0 ? void 0 : _d.bindProduct) === null || _e === void 0 ? void 0 : _e.bindCta;
|
29
|
+
const handleLink = () => {
|
30
|
+
if (product === null || product === void 0 ? void 0 : product.link) {
|
31
|
+
jumpToWeb(data, product, cta);
|
32
|
+
if (!isPost) {
|
33
|
+
productView(data, product, cta, viewTime || curTimeRef.current);
|
34
|
+
}
|
35
|
+
window.location.href = window.getJointUtmLink(product.link);
|
36
|
+
}
|
37
|
+
};
|
38
|
+
useEffect(() => {
|
39
|
+
const initTime = () => {
|
40
|
+
curTimeRef.current = new Date();
|
41
|
+
};
|
42
|
+
initTime();
|
43
|
+
window.addEventListener('pageshow', initTime);
|
44
|
+
return () => {
|
45
|
+
window.removeEventListener('pageshow', initTime);
|
46
|
+
};
|
47
|
+
}, []);
|
48
|
+
const priceText = useMemo(() => {
|
49
|
+
var _a, _b, _c, _d, _e;
|
50
|
+
if ((product === null || product === void 0 ? void 0 : product.currency) && (product === null || product === void 0 ? void 0 : product.price)) {
|
51
|
+
return `${(_c = (_b = (_a = product === null || product === void 0 ? void 0 : product.currency) === null || _a === void 0 ? void 0 : _a.split('-')[1]) === null || _b === void 0 ? void 0 : _b.toUpperCase()) !== null && _c !== void 0 ? _c : ''}${(_e = (_d = product === null || product === void 0 ? void 0 : product.price) === null || _d === void 0 ? void 0 : _d.toLocaleString('zh', {
|
52
|
+
minimumFractionDigits: 0
|
53
|
+
})) !== null && _e !== void 0 ? _e : ''}`;
|
54
|
+
}
|
55
|
+
else {
|
56
|
+
return '£102,300.00';
|
57
|
+
}
|
58
|
+
}, [product === null || product === void 0 ? void 0 : product.price, product === null || product === void 0 ? void 0 : product.currency]);
|
59
|
+
const width = isPreview ? 375 : window.innerWidth;
|
60
|
+
const handleClickCollapse = () => {
|
61
|
+
setSpread(!spread);
|
62
|
+
};
|
63
|
+
const handleTouchStart = (event) => {
|
64
|
+
event.stopPropagation();
|
65
|
+
touchRef.current = event.touches[0].clientY;
|
66
|
+
touchMoveRef.current = true;
|
67
|
+
};
|
68
|
+
const handleTouchMove = (event) => {
|
69
|
+
var _a, _b, _c, _d;
|
70
|
+
if (touchMoveRef.current) {
|
71
|
+
touchMoveRef.current = false;
|
72
|
+
const currentY = event.touches[0].clientY;
|
73
|
+
const diff = touchRef.current - currentY;
|
74
|
+
if (diff > 0 && (isBottom || !stopSlide)) {
|
75
|
+
(_b = (_a = swiperRef === null || swiperRef === void 0 ? void 0 : swiperRef.current) === null || _a === void 0 ? void 0 : _a.swiper) === null || _b === void 0 ? void 0 : _b.slideNext();
|
76
|
+
}
|
77
|
+
else if (diff < 0 && (isTop || !stopSlide)) {
|
78
|
+
(_d = (_c = swiperRef === null || swiperRef === void 0 ? void 0 : swiperRef.current) === null || _c === void 0 ? void 0 : _c.swiper) === null || _d === void 0 ? void 0 : _d.slidePrev();
|
79
|
+
}
|
80
|
+
}
|
81
|
+
};
|
82
|
+
return (React.createElement("div", { className: 'pb-commondityDiroNew' },
|
83
|
+
React.createElement("div", Object.assign({ ref: scrollRef, className: css(Object.assign({}, style)) }, props),
|
84
|
+
product && ((_f = product === null || product === void 0 ? void 0 : product.homePage) === null || _f === void 0 ? void 0 : _f.length) > 0 && (React.createElement(Swiper, { height: width, modules: [Pagination, Autoplay], pagination: {
|
85
|
+
clickable: true,
|
86
|
+
bulletActiveClass: 'commondityDiroNew-swipe-item-active-bullet',
|
87
|
+
clickableClass: 'commondityDiroNew-swiper-clickable'
|
88
|
+
}, loop: true, autoplay: {
|
89
|
+
delay: 3000
|
90
|
+
} }, (_g = product === null || product === void 0 ? void 0 : product.homePage) === null || _g === void 0 ? void 0 : _g.map((src) => {
|
91
|
+
return (React.createElement(SwiperSlide, { key: src },
|
92
|
+
React.createElement("div", { style: {
|
93
|
+
overflow: 'hidden',
|
94
|
+
width,
|
95
|
+
height: width
|
96
|
+
} },
|
97
|
+
React.createElement("img", { src: src, style: { height: '100%', width: '100%', objectFit: 'cover' } }))));
|
98
|
+
}))),
|
99
|
+
!((_h = product === null || product === void 0 ? void 0 : product.homePage) === null || _h === void 0 ? void 0 : _h.length) && (React.createElement("div", { className: css({
|
100
|
+
position: 'relative',
|
101
|
+
height: 0,
|
102
|
+
width: '100%',
|
103
|
+
paddingBottom: '100%',
|
104
|
+
overflow: 'hidden'
|
105
|
+
}) },
|
106
|
+
React.createElement("img", { className: css({
|
107
|
+
position: 'absolute',
|
108
|
+
left: 0,
|
109
|
+
top: 0,
|
110
|
+
objectFit: 'cover',
|
111
|
+
width: '100%'
|
112
|
+
}), src: (_j = sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _j !== void 0 ? _j : bottom_image, alt: '' }))),
|
113
|
+
React.createElement("div", { className: 'pb-commondityDiroNew-content' },
|
114
|
+
React.createElement("div", { className: 'pb-commondityDiroNew-content-top' },
|
115
|
+
React.createElement("div", { className: 'pb-commondityDiroNew-content-top-title' }, (_k = product === null || product === void 0 ? void 0 : product.title) !== null && _k !== void 0 ? _k : 'Large Dior Toujours Bag'),
|
116
|
+
React.createElement("div", { className: 'pb-commondityDiroNew-content-top-price', hidden: !!product && !(product === null || product === void 0 ? void 0 : product.price) }, priceText)),
|
117
|
+
React.createElement("div", { className: 'pb-commondityDiroNew-content-collection', hidden: !!product && (!(product === null || product === void 0 ? void 0 : product.collection) || (product === null || product === void 0 ? void 0 : product.collection) === '') }, (product === null || product === void 0 ? void 0 : product.collection) || 'Black Macrocannage Calfskin'),
|
118
|
+
(!product || (product === null || product === void 0 ? void 0 : product.link)) && (React.createElement("button", { onClick: handleLink, className: 'pb-commondityDiroNew-btn' }, (_l = cta === null || cta === void 0 ? void 0 : cta.enTitle) !== null && _l !== void 0 ? _l : 'Shop now')),
|
119
|
+
React.createElement("div", { hidden: !!product && (!(product === null || product === void 0 ? void 0 : product.info) || (product === null || product === void 0 ? void 0 : product.info) === '') }, isPost ? (React.createElement(ExpandableText, { onClick: () => setShowModal(true), className: 'pb-commondityDiroNew-info', foldText: tipText === null || tipText === void 0 ? void 0 : tipText.foldText, unfoldText: tipText === null || tipText === void 0 ? void 0 : tipText.unfoldText, text: (product === null || product === void 0 ? void 0 : product.info) ||
|
120
|
+
`Unveiled at the Spring-Summer 2023 fashion show, the Dior Toujours bag is distinguished by a casual and practical design. Crafted in black calfskin with Macrocannage topstitching, it showcases a spacious interior compartment with a matching pouch to organize essentials. Its leather strap closure keeps items secure while the D of the CD Lock closure twists to adjust the sides and enhance the bag's silhouette. The leather handles can be adjusted using the small notches in order to be able to carry the large bag by hand or wear it over the shoulder. CD Lock and strap closures D.I.O.R. charms Removable interior pouch Adjustable leather handles Dust bag included
|
121
|
+
Made in Italy` })) : (React.createElement("div", { className: 'pb-commondityDiroNew-info' }, (product === null || product === void 0 ? void 0 : product.info) ||
|
122
|
+
`Unveiled at the Spring-Summer 2023 fashion show, the Dior Toujours bag is distinguished by a casual and practical design. Crafted in black calfskin with Macrocannage topstitching, it showcases a spacious interior compartment with a matching pouch to organize essentials. Its leather strap closure keeps items secure while the D of the CD Lock closure twists to adjust the sides and enhance the bag's silhouette. The leather handles can be adjusted using the small notches in order to be able to carry the large bag by hand or wear it over the shoulder. CD Lock and strap closures D.I.O.R. charms Removable interior pouch Adjustable leather handles Dust bag included
|
123
|
+
Made in Italy`))))),
|
124
|
+
React.createElement(Modal, { visible: showModal, onClose: () => setShowModal(false) },
|
125
|
+
React.createElement("div", { className: 'pb-commondityDiroNew-info', hidden: !!product && (!(product === null || product === void 0 ? void 0 : product.info) || (product === null || product === void 0 ? void 0 : product.info) === '') }, (product === null || product === void 0 ? void 0 : product.info) ||
|
126
|
+
`Unveiled at the Spring-Summer 2023 fashion show, the Dior Toujours bag is distinguished by a casual and practical design. Crafted in black calfskin with Macrocannage topstitching, it showcases a spacious interior compartment with a matching pouch to organize essentials. Its leather strap closure keeps items secure while the D of the CD Lock closure twists to adjust the sides and enhance the bag's silhouette. The leather handles can be adjusted using the small notches in order to be able to carry the large bag by hand or wear it over the shoulder. CD Lock and strap closures D.I.O.R. charms Removable interior pouch Adjustable leather handles Dust bag included
|
127
|
+
Made in Italy`))));
|
128
|
+
};
|
129
|
+
export default memo(CommodityDetailDiroNew);
|