pb-sxp-ui 1.0.17 → 1.0.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +13065 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.css +1683 -0
- package/dist/index.js +13033 -0
- package/dist/index.js.map +1 -0
- package/dist/index.min.cjs +7 -0
- package/dist/index.min.cjs.map +1 -0
- package/dist/index.min.js +7 -0
- package/dist/index.min.js.map +1 -0
- package/dist/pb-ui.js +13061 -0
- package/dist/pb-ui.js.map +1 -0
- package/dist/pb-ui.min.js +7 -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 +12 -0
- package/es/core/components/SxpPageCore/index.js +26 -0
- package/es/core/components/SxpPageRender/ExpandableText.d.ts +14 -0
- package/es/core/components/SxpPageRender/ExpandableText.js +52 -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 +12 -0
- package/es/core/components/SxpPageRender/Hashtag/index.js +40 -0
- package/es/core/components/SxpPageRender/LikeButton/index.d.ts +11 -0
- package/es/core/components/SxpPageRender/LikeButton/index.js +58 -0
- package/es/core/components/SxpPageRender/Modal/index.d.ts +11 -0
- package/es/core/components/SxpPageRender/Modal/index.js +48 -0
- package/es/core/components/SxpPageRender/Navbar.d.ts +9 -0
- package/es/core/components/SxpPageRender/Navbar.js +10 -0
- package/es/core/components/SxpPageRender/Nudge/index.d.ts +24 -0
- package/es/core/components/SxpPageRender/Nudge/index.js +13 -0
- package/es/core/components/SxpPageRender/PictureGroup/Picture.d.ts +8 -0
- package/es/core/components/SxpPageRender/PictureGroup/Picture.js +54 -0
- package/es/core/components/SxpPageRender/PictureGroup/index.d.ts +13 -0
- package/es/core/components/SxpPageRender/PictureGroup/index.js +31 -0
- package/es/core/components/SxpPageRender/Popup/index.d.ts +3 -0
- package/es/core/components/SxpPageRender/Popup/index.js +62 -0
- package/es/core/components/SxpPageRender/RenderCard.d.ts +11 -0
- package/es/core/components/SxpPageRender/RenderCard.js +43 -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 +4 -0
- package/es/core/components/SxpPageRender/WaterFall/List.js +183 -0
- package/es/core/components/SxpPageRender/WaterFall/WaterfallList.d.ts +4 -0
- package/es/core/components/SxpPageRender/WaterFall/WaterfallList.js +319 -0
- package/es/core/components/SxpPageRender/WaterFall/index.d.ts +7 -0
- package/es/core/components/SxpPageRender/WaterFall/index.js +101 -0
- package/es/core/components/SxpPageRender/WaterFall/preview.json +1242 -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 +57 -0
- package/es/core/components/SxpPageRender/index.js +378 -0
- package/es/core/components/SxpPageRender/typing.d.ts +66 -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 +13 -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 +83 -0
- package/es/core/context/EditorContext.js +147 -0
- package/es/core/context/EditorDataProvider.d.ts +20 -0
- package/es/core/context/EditorDataProvider.js +23 -0
- package/es/core/context/SxpDataSourceProvider.d.ts +94 -0
- package/es/core/context/SxpDataSourceProvider.js +208 -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 +5 -0
- package/es/core/utils/localStore.js +22 -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 +11 -0
- package/es/index.js +13 -0
- package/es/materials/index.d.ts +1 -0
- package/es/materials/index.js +1 -0
- package/es/materials/sxp/HashTag/index.d.ts +14 -0
- package/es/materials/sxp/HashTag/index.js +6 -0
- package/es/materials/sxp/HashTag/material.d.ts +2 -0
- package/es/materials/sxp/HashTag/material.js +52 -0
- package/es/materials/sxp/HashTag/settingRender.d.ts +125 -0
- package/es/materials/sxp/HashTag/settingRender.js +157 -0
- package/es/materials/sxp/defaultSetting.d.ts +11 -0
- package/es/materials/sxp/defaultSetting.js +7 -0
- package/es/materials/sxp/index.d.ts +3 -0
- package/es/materials/sxp/index.js +3 -0
- package/es/materials/sxp/popup/AppointForm/index.d.ts +18 -0
- package/es/materials/sxp/popup/AppointForm/index.js +76 -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 +35 -0
- package/es/materials/sxp/popup/AppointForm/settingRender.d.ts +68 -0
- package/es/materials/sxp/popup/AppointForm/settingRender.js +93 -0
- package/es/materials/sxp/popup/CommodityDetail/index.d.ts +34 -0
- package/es/materials/sxp/popup/CommodityDetail/index.js +110 -0
- package/es/materials/sxp/popup/CommodityDetail/material.d.ts +2 -0
- package/es/materials/sxp/popup/CommodityDetail/material.js +51 -0
- package/es/materials/sxp/popup/CommodityDetail/settingRender.d.ts +137 -0
- package/es/materials/sxp/popup/CommodityDetail/settingRender.js +171 -0
- package/es/materials/sxp/popup/CommodityDetailDiro/index.d.ts +19 -0
- package/es/materials/sxp/popup/CommodityDetailDiro/index.js +163 -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 +35 -0
- package/es/materials/sxp/popup/CommodityDetailDiroNew/index.js +134 -0
- package/es/materials/sxp/popup/CommodityDetailDiroNew/material.d.ts +2 -0
- package/es/materials/sxp/popup/CommodityDetailDiroNew/material.js +61 -0
- package/es/materials/sxp/popup/CommodityDetailDiroNew/settingRender.d.ts +137 -0
- package/es/materials/sxp/popup/CommodityDetailDiroNew/settingRender.js +175 -0
- package/es/materials/sxp/popup/Prompt/index.d.ts +11 -0
- package/es/materials/sxp/popup/Prompt/index.js +20 -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 +4 -0
- package/es/materials/sxp/popup/index.js +4 -0
- package/es/materials/sxp/template/Appoint/index.d.ts +15 -0
- package/es/materials/sxp/template/Appoint/index.js +16 -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 +46 -0
- package/es/materials/sxp/template/Commodity/index.d.ts +15 -0
- package/es/materials/sxp/template/Commodity/index.js +27 -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 +52 -0
- package/es/materials/sxp/template/CommodityDiro/index.d.ts +15 -0
- package/es/materials/sxp/template/CommodityDiro/index.js +27 -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 +52 -0
- package/es/materials/sxp/template/CommodityDiroNew/index.d.ts +15 -0
- package/es/materials/sxp/template/CommodityDiroNew/index.js +27 -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 +53 -0
- package/es/materials/sxp/template/Link/index.d.ts +14 -0
- package/es/materials/sxp/template/Link/index.js +32 -0
- package/es/materials/sxp/template/Link/material.d.ts +2 -0
- package/es/materials/sxp/template/Link/material.js +44 -0
- package/es/materials/sxp/template/MultiCommodity/index.d.ts +16 -0
- package/es/materials/sxp/template/MultiCommodity/index.js +52 -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 +52 -0
- package/es/materials/sxp/template/MultiCommodityDiro/index.d.ts +16 -0
- package/es/materials/sxp/template/MultiCommodityDiro/index.js +51 -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 +52 -0
- package/es/materials/sxp/template/MultiCommodityDiroNew/index.d.ts +16 -0
- package/es/materials/sxp/template/MultiCommodityDiroNew/index.js +52 -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 +53 -0
- package/es/materials/sxp/template/components/EventProvider.d.ts +13 -0
- package/es/materials/sxp/template/components/EventProvider.js +47 -0
- package/es/materials/sxp/template/components/Img.d.ts +10 -0
- package/es/materials/sxp/template/components/Img.js +19 -0
- package/es/materials/sxp/template/components/Scroll.d.ts +10 -0
- package/es/materials/sxp/template/components/Scroll.js +10 -0
- package/es/materials/sxp/template/components/settingRender.d.ts +129 -0
- package/es/materials/sxp/template/components/settingRender.js +219 -0
- package/es/materials/sxp/template/components/typing.d.ts +6 -0
- package/es/materials/sxp/template/components/typing.js +1 -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 +12 -0
- package/lib/core/components/SxpPageCore/index.js +29 -0
- package/lib/core/components/SxpPageRender/ExpandableText.d.ts +14 -0
- package/lib/core/components/SxpPageRender/ExpandableText.js +55 -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 +12 -0
- package/lib/core/components/SxpPageRender/Hashtag/index.js +43 -0
- package/lib/core/components/SxpPageRender/LikeButton/index.d.ts +11 -0
- package/lib/core/components/SxpPageRender/LikeButton/index.js +60 -0
- package/lib/core/components/SxpPageRender/Modal/index.d.ts +11 -0
- package/lib/core/components/SxpPageRender/Modal/index.js +51 -0
- package/lib/core/components/SxpPageRender/Navbar.d.ts +9 -0
- package/lib/core/components/SxpPageRender/Navbar.js +13 -0
- package/lib/core/components/SxpPageRender/Nudge/index.d.ts +24 -0
- package/lib/core/components/SxpPageRender/Nudge/index.js +16 -0
- package/lib/core/components/SxpPageRender/PictureGroup/Picture.d.ts +8 -0
- package/lib/core/components/SxpPageRender/PictureGroup/Picture.js +57 -0
- package/lib/core/components/SxpPageRender/PictureGroup/index.d.ts +13 -0
- package/lib/core/components/SxpPageRender/PictureGroup/index.js +34 -0
- package/lib/core/components/SxpPageRender/Popup/index.d.ts +3 -0
- package/lib/core/components/SxpPageRender/Popup/index.js +65 -0
- package/lib/core/components/SxpPageRender/RenderCard.d.ts +11 -0
- package/lib/core/components/SxpPageRender/RenderCard.js +46 -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 +4 -0
- package/lib/core/components/SxpPageRender/WaterFall/List.js +186 -0
- package/lib/core/components/SxpPageRender/WaterFall/WaterfallList.d.ts +4 -0
- package/lib/core/components/SxpPageRender/WaterFall/WaterfallList.js +322 -0
- package/lib/core/components/SxpPageRender/WaterFall/index.d.ts +7 -0
- package/lib/core/components/SxpPageRender/WaterFall/index.js +104 -0
- package/lib/core/components/SxpPageRender/WaterFall/preview.json +1242 -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 +57 -0
- package/lib/core/components/SxpPageRender/index.js +381 -0
- package/lib/core/components/SxpPageRender/typing.d.ts +66 -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 +17 -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 +83 -0
- package/lib/core/context/EditorContext.js +151 -0
- package/lib/core/context/EditorDataProvider.d.ts +20 -0
- package/lib/core/context/EditorDataProvider.js +28 -0
- package/lib/core/context/SxpDataSourceProvider.d.ts +94 -0
- package/lib/core/context/SxpDataSourceProvider.js +211 -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 +5 -0
- package/lib/core/utils/localStore.js +28 -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 +11 -0
- package/lib/index.js +22 -0
- package/lib/materials/index.d.ts +1 -0
- package/lib/materials/index.js +4 -0
- package/lib/materials/sxp/HashTag/index.d.ts +14 -0
- package/lib/materials/sxp/HashTag/index.js +9 -0
- package/lib/materials/sxp/HashTag/material.d.ts +2 -0
- package/lib/materials/sxp/HashTag/material.js +56 -0
- package/lib/materials/sxp/HashTag/settingRender.d.ts +125 -0
- package/lib/materials/sxp/HashTag/settingRender.js +159 -0
- package/lib/materials/sxp/defaultSetting.d.ts +11 -0
- package/lib/materials/sxp/defaultSetting.js +10 -0
- package/lib/materials/sxp/index.d.ts +3 -0
- package/lib/materials/sxp/index.js +6 -0
- package/lib/materials/sxp/popup/AppointForm/index.d.ts +18 -0
- package/lib/materials/sxp/popup/AppointForm/index.js +78 -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 +39 -0
- package/lib/materials/sxp/popup/AppointForm/settingRender.d.ts +68 -0
- package/lib/materials/sxp/popup/AppointForm/settingRender.js +95 -0
- package/lib/materials/sxp/popup/CommodityDetail/index.d.ts +34 -0
- package/lib/materials/sxp/popup/CommodityDetail/index.js +112 -0
- package/lib/materials/sxp/popup/CommodityDetail/material.d.ts +2 -0
- package/lib/materials/sxp/popup/CommodityDetail/material.js +55 -0
- package/lib/materials/sxp/popup/CommodityDetail/settingRender.d.ts +137 -0
- package/lib/materials/sxp/popup/CommodityDetail/settingRender.js +173 -0
- package/lib/materials/sxp/popup/CommodityDetailDiro/index.d.ts +19 -0
- package/lib/materials/sxp/popup/CommodityDetailDiro/index.js +165 -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 +35 -0
- package/lib/materials/sxp/popup/CommodityDetailDiroNew/index.js +136 -0
- package/lib/materials/sxp/popup/CommodityDetailDiroNew/material.d.ts +2 -0
- package/lib/materials/sxp/popup/CommodityDetailDiroNew/material.js +65 -0
- package/lib/materials/sxp/popup/CommodityDetailDiroNew/settingRender.d.ts +137 -0
- package/lib/materials/sxp/popup/CommodityDetailDiroNew/settingRender.js +177 -0
- package/lib/materials/sxp/popup/Prompt/index.d.ts +11 -0
- package/lib/materials/sxp/popup/Prompt/index.js +22 -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 +4 -0
- package/lib/materials/sxp/popup/index.js +7 -0
- package/lib/materials/sxp/template/Appoint/index.d.ts +15 -0
- package/lib/materials/sxp/template/Appoint/index.js +18 -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 +50 -0
- package/lib/materials/sxp/template/Commodity/index.d.ts +15 -0
- package/lib/materials/sxp/template/Commodity/index.js +29 -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 +56 -0
- package/lib/materials/sxp/template/CommodityDiro/index.d.ts +15 -0
- package/lib/materials/sxp/template/CommodityDiro/index.js +29 -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 +56 -0
- package/lib/materials/sxp/template/CommodityDiroNew/index.d.ts +15 -0
- package/lib/materials/sxp/template/CommodityDiroNew/index.js +29 -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 +57 -0
- package/lib/materials/sxp/template/Link/index.d.ts +14 -0
- package/lib/materials/sxp/template/Link/index.js +34 -0
- package/lib/materials/sxp/template/Link/material.d.ts +2 -0
- package/lib/materials/sxp/template/Link/material.js +48 -0
- package/lib/materials/sxp/template/MultiCommodity/index.d.ts +16 -0
- package/lib/materials/sxp/template/MultiCommodity/index.js +54 -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 +56 -0
- package/lib/materials/sxp/template/MultiCommodityDiro/index.d.ts +16 -0
- package/lib/materials/sxp/template/MultiCommodityDiro/index.js +53 -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 +56 -0
- package/lib/materials/sxp/template/MultiCommodityDiroNew/index.d.ts +16 -0
- package/lib/materials/sxp/template/MultiCommodityDiroNew/index.js +54 -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 +57 -0
- package/lib/materials/sxp/template/components/EventProvider.d.ts +13 -0
- package/lib/materials/sxp/template/components/EventProvider.js +49 -0
- package/lib/materials/sxp/template/components/Img.d.ts +10 -0
- package/lib/materials/sxp/template/components/Img.js +22 -0
- package/lib/materials/sxp/template/components/Scroll.d.ts +10 -0
- package/lib/materials/sxp/template/components/Scroll.js +13 -0
- package/lib/materials/sxp/template/components/settingRender.d.ts +129 -0
- package/lib/materials/sxp/template/components/settingRender.js +221 -0
- package/lib/materials/sxp/template/components/typing.d.ts +6 -0
- package/lib/materials/sxp/template/components/typing.js +2 -0
- package/lib/materials/sxp/template/index.d.ts +8 -0
- package/lib/materials/sxp/template/index.js +11 -0
- package/package.json +1 -1
@@ -0,0 +1,83 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import { MaterialComponet } from '../create';
|
3
|
+
import { ISchema } from '../schema';
|
4
|
+
export interface IPageParams {
|
5
|
+
state: string;
|
6
|
+
name: string;
|
7
|
+
type: string;
|
8
|
+
title?: string;
|
9
|
+
description?: string;
|
10
|
+
data: object;
|
11
|
+
app_id: string;
|
12
|
+
key_word?: string;
|
13
|
+
share_title?: string;
|
14
|
+
share_description?: string;
|
15
|
+
h5_url?: string;
|
16
|
+
mp_rul?: string;
|
17
|
+
}
|
18
|
+
export type IPopupAniType = {
|
19
|
+
name?: string;
|
20
|
+
duration?: number;
|
21
|
+
};
|
22
|
+
export type IPopupType = {
|
23
|
+
id: string;
|
24
|
+
} & IPopupAniType;
|
25
|
+
export interface IEditorContext {
|
26
|
+
resolver: Record<string, MaterialComponet>;
|
27
|
+
currentNode: any | null;
|
28
|
+
schema: {
|
29
|
+
pointData: any[];
|
30
|
+
dataSource: ISchema['dataSource'];
|
31
|
+
mobilePiontData: any[];
|
32
|
+
pcPiontData: any[];
|
33
|
+
type: 'PC' | 'mobile';
|
34
|
+
pageInfo: ISchema['pageInfo'];
|
35
|
+
pcPageConf: any;
|
36
|
+
mobilePageConf: any;
|
37
|
+
__STORE__?: Record<string, any>;
|
38
|
+
sxpPageConf: Record<string, any>;
|
39
|
+
};
|
40
|
+
setSchema?: React.Dispatch<React.SetStateAction<{
|
41
|
+
pointData: any[];
|
42
|
+
dataSource: ISchema['dataSource'];
|
43
|
+
mobilePiontData: any[];
|
44
|
+
pcPiontData: any[];
|
45
|
+
type: 'PC' | 'mobile';
|
46
|
+
pageInfo: ISchema['pageInfo'];
|
47
|
+
pcPageConf: any;
|
48
|
+
mobilePageConf: any;
|
49
|
+
__STORE__?: Record<string, any>;
|
50
|
+
sxpPageConf: Record<string, any>;
|
51
|
+
}>>;
|
52
|
+
pageInfoData: any;
|
53
|
+
setPageInfoData?: (pageData: IPageParams) => void;
|
54
|
+
setCurrentNode?: React.Dispatch<React.SetStateAction<any | null>>;
|
55
|
+
saveDataSource?: (dataSource: any[]) => void;
|
56
|
+
prePiontData: any[];
|
57
|
+
setPrePiontData?: React.Dispatch<React.SetStateAction<any[]>>;
|
58
|
+
undoStack: any[];
|
59
|
+
redoStack: any[];
|
60
|
+
setUndoStack?: React.Dispatch<React.SetStateAction<any[]>>;
|
61
|
+
setRedoStack?: React.Dispatch<React.SetStateAction<any[]>>;
|
62
|
+
getCurPageConf?: any;
|
63
|
+
popup: IPopupType;
|
64
|
+
setPopup: React.Dispatch<React.SetStateAction<IPopupType>>;
|
65
|
+
}
|
66
|
+
export interface IEditorCoreProps {
|
67
|
+
resolver: Record<string, MaterialComponet>;
|
68
|
+
isSsr?: boolean;
|
69
|
+
schema?: any;
|
70
|
+
enableDataSource?: boolean;
|
71
|
+
utmVal?: string;
|
72
|
+
}
|
73
|
+
export interface IEditorCoreRef {
|
74
|
+
loadSchema: (schema: any) => void;
|
75
|
+
exportSchema: () => any;
|
76
|
+
getPageInfoData: () => any;
|
77
|
+
initPageInfoData: (pageData: IPageParams) => void;
|
78
|
+
}
|
79
|
+
export declare const EditorContext: React.Context<IEditorContext>;
|
80
|
+
declare const EditorCore: React.ForwardRefExoticComponent<IEditorCoreProps & {
|
81
|
+
children?: React.ReactNode;
|
82
|
+
} & React.RefAttributes<IEditorCoreRef>>;
|
83
|
+
export { EditorCore };
|
@@ -0,0 +1,151 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.EditorCore = exports.EditorContext = void 0;
|
4
|
+
const tslib_1 = require("tslib");
|
5
|
+
const react_1 = tslib_1.__importStar(require("react"));
|
6
|
+
const lodash_1 = require("lodash");
|
7
|
+
const DataSourceProvider_1 = tslib_1.__importDefault(require("./DataSourceProvider"));
|
8
|
+
const tool_1 = require("../../core/utils/tool");
|
9
|
+
const item = {
|
10
|
+
id: (0, tool_1.uuid)(6, 10),
|
11
|
+
item: {
|
12
|
+
type: 'common',
|
13
|
+
h: 300,
|
14
|
+
category: 'block',
|
15
|
+
displayName: 'block',
|
16
|
+
isFirstLayout: true,
|
17
|
+
w: 1000
|
18
|
+
},
|
19
|
+
point: {
|
20
|
+
i: 'x-0',
|
21
|
+
x: -38.34375,
|
22
|
+
y: 0,
|
23
|
+
w: 1000,
|
24
|
+
h: 300,
|
25
|
+
isBounded: true,
|
26
|
+
actualX: 0,
|
27
|
+
actualY: 0
|
28
|
+
},
|
29
|
+
pathArr: [0],
|
30
|
+
positionY: 0
|
31
|
+
};
|
32
|
+
const popupInit = {
|
33
|
+
id: '',
|
34
|
+
duration: 0,
|
35
|
+
name: 'none'
|
36
|
+
};
|
37
|
+
exports.EditorContext = react_1.default.createContext({
|
38
|
+
resolver: {},
|
39
|
+
currentNode: null,
|
40
|
+
schema: {
|
41
|
+
pointData: [],
|
42
|
+
dataSource: [],
|
43
|
+
mobilePiontData: [],
|
44
|
+
type: 'PC',
|
45
|
+
pcPiontData: [],
|
46
|
+
pageInfo: {},
|
47
|
+
pcPageConf: {},
|
48
|
+
mobilePageConf: {},
|
49
|
+
__STORE__: {},
|
50
|
+
sxpPageConf: {}
|
51
|
+
},
|
52
|
+
pageInfoData: {},
|
53
|
+
prePiontData: [],
|
54
|
+
undoStack: [item],
|
55
|
+
redoStack: [],
|
56
|
+
popup: popupInit,
|
57
|
+
setPopup: () => { }
|
58
|
+
});
|
59
|
+
const EditorCore = (0, react_1.forwardRef)(({ children, resolver, isSsr, schema, enableDataSource = true, utmVal }, ref) => {
|
60
|
+
const [currentNode, setCurrentNode] = (0, react_1.useState)(null);
|
61
|
+
const [_schema, setSchema] = (0, react_1.useState)(schema || {
|
62
|
+
pointData: [item],
|
63
|
+
dataSource: [],
|
64
|
+
mobilePiontData: [],
|
65
|
+
type: 'PC',
|
66
|
+
pcPiontData: [],
|
67
|
+
pageInfo: {},
|
68
|
+
pcPageConf: {},
|
69
|
+
mobilePageConf: {},
|
70
|
+
sxpPageConf: {}
|
71
|
+
});
|
72
|
+
const [prePiontData, setPrePiontData] = (0, react_1.useState)([item]);
|
73
|
+
const [undoStack, setUndoStack] = (0, react_1.useState)([[item]]);
|
74
|
+
const [redoStack, setRedoStack] = (0, react_1.useState)([]);
|
75
|
+
const [popup, setPopup] = (0, react_1.useState)(popupInit);
|
76
|
+
typeof window !== 'undefined' &&
|
77
|
+
(window.sxpPopup = (type, aniType) => {
|
78
|
+
setPopup(Object.assign(Object.assign(Object.assign({}, popupInit), { id: type }), aniType));
|
79
|
+
});
|
80
|
+
typeof window !== 'undefined' &&
|
81
|
+
(window.getJointUtmLink = (url) => {
|
82
|
+
if ((url === null || url === void 0 ? void 0 : url.indexOf('?')) !== -1) {
|
83
|
+
return url + (utmVal ? '&' + utmVal : '');
|
84
|
+
}
|
85
|
+
else {
|
86
|
+
return url + (utmVal ? '?' + utmVal : '');
|
87
|
+
}
|
88
|
+
});
|
89
|
+
(0, react_1.useEffect)(() => {
|
90
|
+
setUndoStack([_schema.pointData]);
|
91
|
+
setRedoStack([]);
|
92
|
+
}, [_schema.type]);
|
93
|
+
const saveDataSource = (0, react_1.useCallback)((dataSource) => {
|
94
|
+
const schema = (0, lodash_1.cloneDeep)(_schema);
|
95
|
+
if (!schema)
|
96
|
+
return;
|
97
|
+
schema.dataSource = dataSource;
|
98
|
+
setSchema === null || setSchema === void 0 ? void 0 : setSchema(schema);
|
99
|
+
}, [_schema]);
|
100
|
+
const [_pageInfoData, _setPageInfoData] = (0, react_1.useState)();
|
101
|
+
(0, react_1.useImperativeHandle)(ref, () => ({
|
102
|
+
loadSchema(schema) {
|
103
|
+
if (schema) {
|
104
|
+
setUndoStack([schema.pointData]);
|
105
|
+
setSchema(schema);
|
106
|
+
}
|
107
|
+
},
|
108
|
+
exportSchema() {
|
109
|
+
return (0, lodash_1.cloneDeep)(_schema);
|
110
|
+
},
|
111
|
+
getPageInfoData() {
|
112
|
+
return _pageInfoData;
|
113
|
+
},
|
114
|
+
initPageInfoData(pageData) {
|
115
|
+
if (pageData) {
|
116
|
+
_setPageInfoData(pageData);
|
117
|
+
}
|
118
|
+
}
|
119
|
+
}));
|
120
|
+
const getCurPageConf = (0, react_1.useMemo)(() => {
|
121
|
+
if (!_schema)
|
122
|
+
return;
|
123
|
+
if (_schema.type === 'PC') {
|
124
|
+
return _schema.pcPageConf;
|
125
|
+
}
|
126
|
+
else {
|
127
|
+
return _schema.mobilePageConf;
|
128
|
+
}
|
129
|
+
}, [_schema]);
|
130
|
+
return (react_1.default.createElement(exports.EditorContext.Provider, { value: {
|
131
|
+
resolver,
|
132
|
+
currentNode,
|
133
|
+
schema: _schema,
|
134
|
+
setCurrentNode,
|
135
|
+
setSchema,
|
136
|
+
saveDataSource,
|
137
|
+
prePiontData,
|
138
|
+
setPrePiontData,
|
139
|
+
pageInfoData: _pageInfoData,
|
140
|
+
setPageInfoData: (params) => _setPageInfoData(Object.assign(Object.assign({}, _pageInfoData), params)),
|
141
|
+
undoStack,
|
142
|
+
redoStack,
|
143
|
+
setRedoStack,
|
144
|
+
setUndoStack,
|
145
|
+
getCurPageConf,
|
146
|
+
popup,
|
147
|
+
setPopup
|
148
|
+
} },
|
149
|
+
react_1.default.createElement(DataSourceProvider_1.default, { isSsr: isSsr, enable: enableDataSource }, children)));
|
150
|
+
});
|
151
|
+
exports.EditorCore = EditorCore;
|
@@ -0,0 +1,20 @@
|
|
1
|
+
import React, { FC, PropsWithChildren } from 'react';
|
2
|
+
interface IEditorDataContext {
|
3
|
+
sxpPrameter?: {
|
4
|
+
bottomImage: string;
|
5
|
+
defaultRecommend: number;
|
6
|
+
personalizedRecommend: number;
|
7
|
+
placeholderImage: string;
|
8
|
+
hashTagSize: number;
|
9
|
+
loadingImage: string;
|
10
|
+
};
|
11
|
+
appDomain?: string;
|
12
|
+
openHashtag?: boolean;
|
13
|
+
setOpenHashtag?: React.Dispatch<React.SetStateAction<boolean>>;
|
14
|
+
}
|
15
|
+
interface IEditorProviderProps {
|
16
|
+
data?: any;
|
17
|
+
}
|
18
|
+
declare const EditorDataProvider: FC<PropsWithChildren<IEditorProviderProps>>;
|
19
|
+
export declare function useEditorDataProvider(): IEditorDataContext;
|
20
|
+
export default EditorDataProvider;
|
@@ -0,0 +1,28 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.useEditorDataProvider = void 0;
|
4
|
+
const tslib_1 = require("tslib");
|
5
|
+
const react_1 = tslib_1.__importStar(require("react"));
|
6
|
+
const EditorDataContext = (0, react_1.createContext)({});
|
7
|
+
const EditorDataProvider = ({ children, data }) => {
|
8
|
+
var _a, _b, _c, _d, _e, _f;
|
9
|
+
const [openHashtag, setOpenHashtag] = (0, react_1.useState)(false);
|
10
|
+
return (react_1.default.createElement(EditorDataContext.Provider, { value: {
|
11
|
+
sxpPrameter: {
|
12
|
+
bottomImage: (_a = data === null || data === void 0 ? void 0 : data.sxp_parameter) === null || _a === void 0 ? void 0 : _a.bottom_image,
|
13
|
+
defaultRecommend: (_b = data === null || data === void 0 ? void 0 : data.sxp_parameter) === null || _b === void 0 ? void 0 : _b.default_recommend,
|
14
|
+
personalizedRecommend: (_c = data === null || data === void 0 ? void 0 : data.sxp_parameter) === null || _c === void 0 ? void 0 : _c.personalized_recommend,
|
15
|
+
placeholderImage: (_d = data === null || data === void 0 ? void 0 : data.sxp_parameter) === null || _d === void 0 ? void 0 : _d.placeholder_image,
|
16
|
+
hashTagSize: (_e = data === null || data === void 0 ? void 0 : data.sxp_parameter) === null || _e === void 0 ? void 0 : _e.hash_tag_size,
|
17
|
+
loadingImage: (_f = data === null || data === void 0 ? void 0 : data.sxp_parameter) === null || _f === void 0 ? void 0 : _f.loading_image
|
18
|
+
},
|
19
|
+
appDomain: data === null || data === void 0 ? void 0 : data.appDomain,
|
20
|
+
openHashtag,
|
21
|
+
setOpenHashtag
|
22
|
+
} }, children));
|
23
|
+
};
|
24
|
+
function useEditorDataProvider() {
|
25
|
+
return (0, react_1.useContext)(EditorDataContext);
|
26
|
+
}
|
27
|
+
exports.useEditorDataProvider = useEditorDataProvider;
|
28
|
+
exports.default = EditorDataProvider;
|
@@ -0,0 +1,94 @@
|
|
1
|
+
import React, { ReactNode } from 'react';
|
2
|
+
import { DataSource, PageData } from '../Pagebuilder/type';
|
3
|
+
import { ProductInfoType, RecItemType, RecommendVideoResultType, VideoInfoType } from '../components/SxpPageRender/typing';
|
4
|
+
export interface IWaterFallDataType {
|
5
|
+
hashTag: string;
|
6
|
+
itemId?: string;
|
7
|
+
itemType?: 'VIDEO' | 'PRODUCT' | null;
|
8
|
+
rec: RecItemType;
|
9
|
+
}
|
10
|
+
export interface ISxpDataSourceContext {
|
11
|
+
rtcList: RecItemType[];
|
12
|
+
setRtcList?: React.Dispatch<React.SetStateAction<RecItemType[]>>;
|
13
|
+
submitForm?: (body: {
|
14
|
+
attributes: Array<{
|
15
|
+
name: string;
|
16
|
+
value: string;
|
17
|
+
}>;
|
18
|
+
}) => Promise<boolean | undefined>;
|
19
|
+
mutateUnlike?: (body: {
|
20
|
+
videoItemId: string;
|
21
|
+
}) => Promise<boolean>;
|
22
|
+
mutateLike?: (body: {
|
23
|
+
content: string;
|
24
|
+
}) => Promise<boolean>;
|
25
|
+
popupDetailData?: RecItemType & {
|
26
|
+
index: number;
|
27
|
+
};
|
28
|
+
setPopupDetailData?: React.Dispatch<React.SetStateAction<any | null>>;
|
29
|
+
loadVideos?: (page: number) => Promise<void>;
|
30
|
+
getRecommendVideos?: (query?: {
|
31
|
+
maxSize?: number;
|
32
|
+
defaultSize?: number;
|
33
|
+
channel?: string;
|
34
|
+
hashTag?: string;
|
35
|
+
'itemFilter.itemId'?: string;
|
36
|
+
'itemFilter.itemType'?: 'VIDEO' | 'PRODUCT' | null | undefined;
|
37
|
+
traceInfo?: string;
|
38
|
+
}) => Promise<RecommendVideoResultType | undefined>;
|
39
|
+
utmVal?: string;
|
40
|
+
bffEventReport?: (body: {
|
41
|
+
userInfo?: object;
|
42
|
+
eventInfo: object;
|
43
|
+
}) => Promise<any> | undefined | boolean;
|
44
|
+
isPreview?: boolean;
|
45
|
+
loading?: boolean;
|
46
|
+
sxpParameter?: PageData['sxp_parameter'];
|
47
|
+
waterFallData?: IWaterFallDataType;
|
48
|
+
setWaterFallData?: React.Dispatch<React.SetStateAction<IWaterFallDataType | undefined>>;
|
49
|
+
ctaEvent?: (eventInfo: any, rec?: RecItemType, product?: ProductInfoType | VideoInfoType | null, number?: number) => void;
|
50
|
+
swiperRef?: any;
|
51
|
+
openHashtag?: boolean;
|
52
|
+
setOpenHashtag?: React.Dispatch<React.SetStateAction<boolean>>;
|
53
|
+
cacheRtcList?: RecItemType[];
|
54
|
+
setCacheRtcList?: React.Dispatch<React.SetStateAction<RecItemType[]>>;
|
55
|
+
cacheActiveIndex?: number;
|
56
|
+
setCacheActiveIndex?: React.Dispatch<React.SetStateAction<number>>;
|
57
|
+
isFromHashtag?: boolean;
|
58
|
+
setIsFromHashtag?: React.Dispatch<React.SetStateAction<boolean>>;
|
59
|
+
appDomain?: string;
|
60
|
+
hashTagSize?: number;
|
61
|
+
loadingImage?: string;
|
62
|
+
isOpenHashTag?: boolean;
|
63
|
+
}
|
64
|
+
export declare const SxpDataSourceContext: React.Context<ISxpDataSourceContext>;
|
65
|
+
export interface SxpDataSourceProviderProps {
|
66
|
+
dataSources?: DataSource[];
|
67
|
+
render: (data: {
|
68
|
+
rtcList: RecItemType[];
|
69
|
+
submitForm: (body: {
|
70
|
+
attributes: Array<{
|
71
|
+
name: string;
|
72
|
+
value: string;
|
73
|
+
}>;
|
74
|
+
}) => Promise<boolean | undefined>;
|
75
|
+
mutateUnlike: (body: {
|
76
|
+
videoItemId: string;
|
77
|
+
}) => Promise<boolean>;
|
78
|
+
mutateLike: (body: {
|
79
|
+
content: string;
|
80
|
+
}) => Promise<boolean>;
|
81
|
+
}) => ReactNode;
|
82
|
+
utmVal?: string;
|
83
|
+
enableReportEvent?: boolean;
|
84
|
+
maxSize?: number;
|
85
|
+
defaultSize?: number;
|
86
|
+
hashTagSize?: number;
|
87
|
+
isPreview?: boolean;
|
88
|
+
sxpParameter?: PageData['sxp_parameter'];
|
89
|
+
appDomain?: string;
|
90
|
+
loadingImage?: string;
|
91
|
+
isOpenHashTag?: boolean;
|
92
|
+
}
|
93
|
+
declare const _default: React.NamedExoticComponent<SxpDataSourceProviderProps>;
|
94
|
+
export default _default;
|
@@ -0,0 +1,211 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.SxpDataSourceContext = void 0;
|
4
|
+
const tslib_1 = require("tslib");
|
5
|
+
const react_1 = tslib_1.__importStar(require("react"));
|
6
|
+
const qs_1 = tslib_1.__importDefault(require("qs"));
|
7
|
+
const sessionStore_1 = require("../utils/sessionStore");
|
8
|
+
const localStore_1 = require("../utils/localStore");
|
9
|
+
const useIconLink_1 = require("../components/SxpPageRender/useIconLink");
|
10
|
+
exports.SxpDataSourceContext = (0, react_1.createContext)({
|
11
|
+
rtcList: []
|
12
|
+
});
|
13
|
+
var DataSourceType;
|
14
|
+
(function (DataSourceType) {
|
15
|
+
DataSourceType[DataSourceType["BFF"] = 5] = "BFF";
|
16
|
+
})(DataSourceType || (DataSourceType = {}));
|
17
|
+
const UTM_KEYS = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_id', 'utm_content', 'cl_source'];
|
18
|
+
const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent = true, maxSize, defaultSize, isPreview = false, sxpParameter, appDomain, hashTagSize, loadingImage, isOpenHashTag = false }) => {
|
19
|
+
const [rtcList, setRtcList] = (0, react_1.useState)([]);
|
20
|
+
const [loading, setLoading] = (0, react_1.useState)(false);
|
21
|
+
const [curReqInfo, setCurReqInfo] = (0, react_1.useState)({ rtc: '', requestId: '' });
|
22
|
+
const swiperRef = (0, react_1.useRef)(null);
|
23
|
+
const isInit = (0, react_1.useRef)(false);
|
24
|
+
const [popupDetailData, setPopupDetailData] = (0, react_1.useState)();
|
25
|
+
const [waterFallData, setWaterFallData] = (0, react_1.useState)();
|
26
|
+
const [openHashtag, setOpenHashtag] = (0, react_1.useState)(isOpenHashTag);
|
27
|
+
const [cacheRtcList, setCacheRtcList] = (0, react_1.useState)([]);
|
28
|
+
const [cacheActiveIndex, setCacheActiveIndex] = (0, react_1.useState)(0);
|
29
|
+
const [isFromHashtag, setIsFromHashtag] = (0, react_1.useState)(false);
|
30
|
+
(0, react_1.useEffect)(() => {
|
31
|
+
setOpenHashtag(isOpenHashTag);
|
32
|
+
}, [isOpenHashTag]);
|
33
|
+
const bffDataSource = (0, react_1.useMemo)(() => {
|
34
|
+
return dataSources === null || dataSources === void 0 ? void 0 : dataSources.find((d) => d.type === DataSourceType.BFF);
|
35
|
+
}, [dataSources]);
|
36
|
+
const bffFetch = (0, react_1.useCallback)((path, options) => {
|
37
|
+
if (!bffDataSource)
|
38
|
+
return;
|
39
|
+
const url = bffDataSource.url;
|
40
|
+
const fakeUserId = (0, localStore_1.storeAndLoadFeUserId)();
|
41
|
+
if (options === null || options === void 0 ? void 0 : options.query) {
|
42
|
+
const queryString = qs_1.default.stringify(options.query);
|
43
|
+
path = `${path}?${queryString}`;
|
44
|
+
}
|
45
|
+
if (options.type === 'beacon' && navigator.sendBeacon) {
|
46
|
+
return navigator.sendBeacon(`${url}/api/v1${path}`, new Blob([
|
47
|
+
JSON.stringify(Object.assign(Object.assign(Object.assign({}, bffDataSource.headers), { 'x-user-id': fakeUserId }), options.body))
|
48
|
+
], { type: 'application/json;charset=UTF-8' }));
|
49
|
+
}
|
50
|
+
return window
|
51
|
+
.fetch(`${url}/api/v1${path}`, {
|
52
|
+
headers: Object.assign({ 'Content-Type': 'application/json', 'x-user-id': fakeUserId }, bffDataSource.headers),
|
53
|
+
method: options.method,
|
54
|
+
body: JSON.stringify(options.body)
|
55
|
+
})
|
56
|
+
.then((res) => res.json())
|
57
|
+
.catch((err) => Promise.reject(err));
|
58
|
+
}, [bffDataSource]);
|
59
|
+
const getRecommendVideos = (0, react_1.useCallback)((query) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
60
|
+
var _a, _b, _c, _d;
|
61
|
+
query = {
|
62
|
+
maxSize,
|
63
|
+
defaultSize: (_a = query === null || query === void 0 ? void 0 : query.defaultSize) !== null && _a !== void 0 ? _a : defaultSize,
|
64
|
+
'itemFilter.itemId': query === null || query === void 0 ? void 0 : query['itemFilter.itemId'],
|
65
|
+
'itemFilter.itemType': query === null || query === void 0 ? void 0 : query['itemFilter.itemType'],
|
66
|
+
hashTag: query === null || query === void 0 ? void 0 : query.hashTag,
|
67
|
+
traceInfo: query === null || query === void 0 ? void 0 : query.traceInfo
|
68
|
+
};
|
69
|
+
if (utmVal) {
|
70
|
+
const val = (_d = (_c = (_b = utmVal === null || utmVal === void 0 ? void 0 : utmVal.split('&')) === null || _b === void 0 ? void 0 : _b.filter((val) => {
|
71
|
+
const key = val.split('=')[0];
|
72
|
+
return UTM_KEYS.includes(key);
|
73
|
+
})) === null || _c === void 0 ? void 0 : _c.join('&')) !== null && _d !== void 0 ? _d : '';
|
74
|
+
query = Object.assign(Object.assign({}, query), { channel: decodeURIComponent(val) });
|
75
|
+
}
|
76
|
+
const result = yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('/recommend/list', { method: 'GET', query }));
|
77
|
+
if (!(result === null || result === void 0 ? void 0 : result.success)) {
|
78
|
+
return undefined;
|
79
|
+
}
|
80
|
+
if (!(query === null || query === void 0 ? void 0 : query.hashTag))
|
81
|
+
setCurReqInfo({ rtc: result.data.rtc, requestId: result.data.requestId });
|
82
|
+
return result === null || result === void 0 ? void 0 : result.data;
|
83
|
+
}), [bffFetch, utmVal, maxSize, defaultSize]);
|
84
|
+
const loadVideos = (0, react_1.useCallback)(() => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
85
|
+
var _e, _f;
|
86
|
+
if (rtcList.length <= 0) {
|
87
|
+
return;
|
88
|
+
}
|
89
|
+
const data = yield getRecommendVideos({
|
90
|
+
hashTag: waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.hashTag,
|
91
|
+
'itemFilter.itemId': waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.itemId,
|
92
|
+
'itemFilter.itemType': waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.itemType
|
93
|
+
});
|
94
|
+
setRtcList(rtcList.concat((_e = data === null || data === void 0 ? void 0 : data.recList) !== null && _e !== void 0 ? _e : []));
|
95
|
+
setCacheRtcList(cacheRtcList.concat((_f = data === null || data === void 0 ? void 0 : data.recList) !== null && _f !== void 0 ? _f : []));
|
96
|
+
}), [getRecommendVideos, rtcList, waterFallData, cacheRtcList]);
|
97
|
+
const bffEventReport = (0, react_1.useCallback)(({ userInfo, eventInfo }) => {
|
98
|
+
if (!enableReportEvent) {
|
99
|
+
return;
|
100
|
+
}
|
101
|
+
if (!userInfo) {
|
102
|
+
userInfo = {};
|
103
|
+
}
|
104
|
+
const sessionID = (0, sessionStore_1.storeAndLoadFeSessionId)();
|
105
|
+
const ef = Object.assign({ sessionID, rtc: curReqInfo.rtc, requestId: curReqInfo.requestId }, eventInfo);
|
106
|
+
const realUserInfo = Object.entries(userInfo).map(([k, v]) => ({ name: k, value: v }));
|
107
|
+
const realEventInfo = Object.entries(ef)
|
108
|
+
.map(([k, v]) => v && { name: k, value: v })
|
109
|
+
.filter(Boolean);
|
110
|
+
console.log('======== 事件上报 ========');
|
111
|
+
console.log('userInfo:', userInfo);
|
112
|
+
console.log('eventInfo:', ef);
|
113
|
+
console.log('========= 结束 =========');
|
114
|
+
return bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('/event/report', {
|
115
|
+
method: 'POST',
|
116
|
+
body: { userInfo: realUserInfo, eventInfo: realEventInfo },
|
117
|
+
type: 'beacon'
|
118
|
+
});
|
119
|
+
}, [bffFetch, curReqInfo, enableReportEvent]);
|
120
|
+
const bffMutateLike = (0, react_1.useCallback)((body) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
121
|
+
const res = yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('/recommend/like', { method: 'POST', body }));
|
122
|
+
return res === null || res === void 0 ? void 0 : res.success;
|
123
|
+
}), [bffFetch]);
|
124
|
+
const bffMutateUnlike = (0, react_1.useCallback)((body) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
125
|
+
const res = yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('/recommend/unlike', { method: 'POST', body }));
|
126
|
+
return res === null || res === void 0 ? void 0 : res.success;
|
127
|
+
}), [bffFetch]);
|
128
|
+
const bffSubmitForm = (0, react_1.useCallback)((body) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
129
|
+
const res = yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('/customform', { method: 'POST', body }));
|
130
|
+
return res === null || res === void 0 ? void 0 : res.success;
|
131
|
+
}), [bffFetch]);
|
132
|
+
const ctaEvent = (0, react_1.useCallback)((eventInfo, rec, product, position) => {
|
133
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
134
|
+
const cta = product === null || product === void 0 ? void 0 : product.bindCta;
|
135
|
+
const isProd = ((_a = rec === null || rec === void 0 ? void 0 : rec.video) === null || _a === void 0 ? void 0 : _a.bindProduct) || (((_b = rec === null || rec === void 0 ? void 0 : rec.video) === null || _b === void 0 ? void 0 : _b.bindProducts) && ((_d = (_c = rec === null || rec === void 0 ? void 0 : rec.video) === null || _c === void 0 ? void 0 : _c.bindProducts) === null || _d === void 0 ? void 0 : _d.length) > 0);
|
136
|
+
let fromKName = '';
|
137
|
+
if (isFromHashtag) {
|
138
|
+
fromKName = 'hashTagPage';
|
139
|
+
}
|
140
|
+
else if ((_e = rec === null || rec === void 0 ? void 0 : rec.video) === null || _e === void 0 ? void 0 : _e.url) {
|
141
|
+
fromKName = 'videoPage';
|
142
|
+
}
|
143
|
+
else if ((_g = (_f = rec === null || rec === void 0 ? void 0 : rec.video) === null || _f === void 0 ? void 0 : _f.imgUrls) === null || _g === void 0 ? void 0 : _g.length) {
|
144
|
+
fromKName = 'imagePage';
|
145
|
+
}
|
146
|
+
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
147
|
+
eventInfo: Object.assign(Object.assign({}, eventInfo), { ctaId: (_h = cta === null || cta === void 0 ? void 0 : cta.itemId) !== null && _h !== void 0 ? _h : '', ctaName: (_j = cta === null || cta === void 0 ? void 0 : cta.title) !== null && _j !== void 0 ? _j : '', contentTags: JSON.stringify(cta === null || cta === void 0 ? void 0 : cta.tags), position: position + '', relatedContentId: (_l = (_k = rec === null || rec === void 0 ? void 0 : rec.video) === null || _k === void 0 ? void 0 : _k.itemId) !== null && _l !== void 0 ? _l : '', relatedProductId: isProd ? product === null || product === void 0 ? void 0 : product.itemId : '', traceInfo: (_m = cta === null || cta === void 0 ? void 0 : cta.traceInfo) !== null && _m !== void 0 ? _m : '', fromKName })
|
148
|
+
});
|
149
|
+
}, [bffEventReport, isFromHashtag]);
|
150
|
+
(0, react_1.useEffect)(() => {
|
151
|
+
setLoading(true);
|
152
|
+
getRecommendVideos()
|
153
|
+
.then((data) => {
|
154
|
+
var _a, _b;
|
155
|
+
setRtcList((_a = data === null || data === void 0 ? void 0 : data.recList) !== null && _a !== void 0 ? _a : []);
|
156
|
+
setCacheRtcList((_b = data === null || data === void 0 ? void 0 : data.recList) !== null && _b !== void 0 ? _b : []);
|
157
|
+
})
|
158
|
+
.finally(() => {
|
159
|
+
setLoading(false);
|
160
|
+
isInit.current = true;
|
161
|
+
});
|
162
|
+
}, []);
|
163
|
+
(0, react_1.useEffect)(() => {
|
164
|
+
if (!isInit.current)
|
165
|
+
return;
|
166
|
+
setLoading(true);
|
167
|
+
getRecommendVideos()
|
168
|
+
.then((data) => {
|
169
|
+
var _a, _b;
|
170
|
+
setRtcList((_a = data === null || data === void 0 ? void 0 : data.recList) !== null && _a !== void 0 ? _a : []);
|
171
|
+
setCacheRtcList((_b = data === null || data === void 0 ? void 0 : data.recList) !== null && _b !== void 0 ? _b : []);
|
172
|
+
})
|
173
|
+
.finally(() => {
|
174
|
+
setLoading(false);
|
175
|
+
});
|
176
|
+
}, [getRecommendVideos]);
|
177
|
+
const defaultLoadingImage = (0, useIconLink_1.useIconLink)('/pb_static/a65d23c5893c49d7aaaa81681d3179e2.gif', appDomain);
|
178
|
+
return (react_1.default.createElement(exports.SxpDataSourceContext.Provider, { value: {
|
179
|
+
rtcList,
|
180
|
+
setRtcList,
|
181
|
+
mutateLike: bffMutateLike,
|
182
|
+
mutateUnlike: bffMutateUnlike,
|
183
|
+
submitForm: bffSubmitForm,
|
184
|
+
popupDetailData,
|
185
|
+
loadVideos,
|
186
|
+
setPopupDetailData,
|
187
|
+
getRecommendVideos,
|
188
|
+
bffEventReport,
|
189
|
+
utmVal,
|
190
|
+
isPreview,
|
191
|
+
loading,
|
192
|
+
sxpParameter,
|
193
|
+
waterFallData,
|
194
|
+
setWaterFallData,
|
195
|
+
ctaEvent,
|
196
|
+
swiperRef,
|
197
|
+
openHashtag,
|
198
|
+
setOpenHashtag,
|
199
|
+
cacheRtcList,
|
200
|
+
setCacheRtcList,
|
201
|
+
cacheActiveIndex,
|
202
|
+
setCacheActiveIndex,
|
203
|
+
isFromHashtag,
|
204
|
+
setIsFromHashtag,
|
205
|
+
appDomain,
|
206
|
+
hashTagSize,
|
207
|
+
loadingImage: loadingImage !== null && loadingImage !== void 0 ? loadingImage : defaultLoadingImage,
|
208
|
+
isOpenHashTag
|
209
|
+
} }, render({ rtcList, mutateLike: bffMutateLike, mutateUnlike: bffMutateUnlike, submitForm: bffSubmitForm })));
|
210
|
+
};
|
211
|
+
exports.default = (0, react_1.memo)(SxpDataSourceProvider);
|
@@ -0,0 +1,37 @@
|
|
1
|
+
/// <reference types="react" />
|
2
|
+
import { DATA_TYPE } from './hooks';
|
3
|
+
export interface IMaterialOptions<T> {
|
4
|
+
displayName: string;
|
5
|
+
icon: React.ReactNode;
|
6
|
+
category: string;
|
7
|
+
type: string;
|
8
|
+
related?: {
|
9
|
+
settingRender?: Record<string, any>;
|
10
|
+
bindableProps?: Array<{
|
11
|
+
label: string;
|
12
|
+
value: keyof T;
|
13
|
+
dataType: Array<DATA_TYPE>;
|
14
|
+
}>;
|
15
|
+
[key: string]: any;
|
16
|
+
};
|
17
|
+
h?: number;
|
18
|
+
w?: number;
|
19
|
+
disableDragging?: boolean;
|
20
|
+
isFirstLayout?: boolean;
|
21
|
+
defaulSetting?: defaulSettingProps<T>;
|
22
|
+
defaulMobileSetting?: defaulSettingProps<T>;
|
23
|
+
mobileH?: number;
|
24
|
+
mobileW?: number;
|
25
|
+
sort: number;
|
26
|
+
}
|
27
|
+
type defaulSettingProps<T> = {
|
28
|
+
style?: React.CSSProperties;
|
29
|
+
props?: T;
|
30
|
+
textStyle?: React.CSSProperties;
|
31
|
+
name?: string;
|
32
|
+
};
|
33
|
+
export type MaterialComponet<T = any> = React.ComponentType<T> & {
|
34
|
+
extend?: IMaterialOptions<T>;
|
35
|
+
};
|
36
|
+
export declare function createMaterial<T>(component: MaterialComponet<T>, options: IMaterialOptions<T>): MaterialComponet<T>;
|
37
|
+
export {};
|