pb-sxp-ui 1.0.16 → 1.0.17
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/package.json +1 -1
- package/dist/index.cjs +0 -13065
- package/dist/index.cjs.map +0 -1
- package/dist/index.css +0 -1683
- package/dist/index.js +0 -13033
- package/dist/index.js.map +0 -1
- package/dist/index.min.cjs +0 -7
- package/dist/index.min.cjs.map +0 -1
- package/dist/index.min.js +0 -7
- package/dist/index.min.js.map +0 -1
- package/dist/pb-ui.js +0 -13061
- package/dist/pb-ui.js.map +0 -1
- package/dist/pb-ui.min.js +0 -7
- package/dist/pb-ui.min.js.map +0 -1
- package/es/core/Pagebuilder/PagebuilderClass.d.ts +0 -15
- package/es/core/Pagebuilder/PagebuilderClass.js +0 -42
- package/es/core/Pagebuilder/index.d.ts +0 -3
- package/es/core/Pagebuilder/index.js +0 -96
- package/es/core/Pagebuilder/type.d.ts +0 -55
- package/es/core/Pagebuilder/type.js +0 -1
- package/es/core/components/SxpPageCore/index.d.ts +0 -12
- package/es/core/components/SxpPageCore/index.js +0 -26
- package/es/core/components/SxpPageRender/ExpandableText.d.ts +0 -14
- package/es/core/components/SxpPageRender/ExpandableText.js +0 -42
- package/es/core/components/SxpPageRender/FingerSwipeTip/index.d.ts +0 -6
- package/es/core/components/SxpPageRender/FingerSwipeTip/index.js +0 -19
- package/es/core/components/SxpPageRender/Hashtag/index.d.ts +0 -12
- package/es/core/components/SxpPageRender/Hashtag/index.js +0 -40
- package/es/core/components/SxpPageRender/LikeButton/index.d.ts +0 -11
- package/es/core/components/SxpPageRender/LikeButton/index.js +0 -58
- package/es/core/components/SxpPageRender/Modal/index.d.ts +0 -11
- package/es/core/components/SxpPageRender/Modal/index.js +0 -48
- package/es/core/components/SxpPageRender/Navbar.d.ts +0 -9
- package/es/core/components/SxpPageRender/Navbar.js +0 -10
- package/es/core/components/SxpPageRender/Nudge/index.d.ts +0 -24
- package/es/core/components/SxpPageRender/Nudge/index.js +0 -13
- package/es/core/components/SxpPageRender/PictureGroup/Picture.d.ts +0 -8
- package/es/core/components/SxpPageRender/PictureGroup/Picture.js +0 -51
- package/es/core/components/SxpPageRender/PictureGroup/index.d.ts +0 -13
- package/es/core/components/SxpPageRender/PictureGroup/index.js +0 -28
- package/es/core/components/SxpPageRender/Popup/index.d.ts +0 -3
- package/es/core/components/SxpPageRender/Popup/index.js +0 -62
- package/es/core/components/SxpPageRender/RenderCard.d.ts +0 -11
- package/es/core/components/SxpPageRender/RenderCard.js +0 -43
- package/es/core/components/SxpPageRender/ToggleButton/index.d.ts +0 -10
- package/es/core/components/SxpPageRender/ToggleButton/index.js +0 -13
- package/es/core/components/SxpPageRender/VideoWidget/index.d.ts +0 -12
- package/es/core/components/SxpPageRender/VideoWidget/index.js +0 -219
- package/es/core/components/SxpPageRender/WaterFall/List.d.ts +0 -4
- package/es/core/components/SxpPageRender/WaterFall/List.js +0 -183
- package/es/core/components/SxpPageRender/WaterFall/WaterfallList.d.ts +0 -4
- package/es/core/components/SxpPageRender/WaterFall/WaterfallList.js +0 -319
- package/es/core/components/SxpPageRender/WaterFall/index.d.ts +0 -7
- package/es/core/components/SxpPageRender/WaterFall/index.js +0 -101
- package/es/core/components/SxpPageRender/WaterFall/preview.json +0 -1242
- package/es/core/components/SxpPageRender/fakeData.d.ts +0 -130
- package/es/core/components/SxpPageRender/fakeData.js +0 -899
- package/es/core/components/SxpPageRender/index.d.ts +0 -57
- package/es/core/components/SxpPageRender/index.js +0 -378
- package/es/core/components/SxpPageRender/typing.d.ts +0 -66
- package/es/core/components/SxpPageRender/typing.js +0 -1
- package/es/core/components/SxpPageRender/useIconLink.d.ts +0 -1
- package/es/core/components/SxpPageRender/useIconLink.js +0 -13
- package/es/core/context/DataSourceProvider.d.ts +0 -17
- package/es/core/context/DataSourceProvider.js +0 -45
- package/es/core/context/EditorContext.d.ts +0 -83
- package/es/core/context/EditorContext.js +0 -147
- package/es/core/context/EditorDataProvider.d.ts +0 -20
- package/es/core/context/EditorDataProvider.js +0 -23
- package/es/core/context/SxpDataSourceProvider.d.ts +0 -94
- package/es/core/context/SxpDataSourceProvider.js +0 -208
- package/es/core/create.d.ts +0 -37
- package/es/core/create.js +0 -4
- package/es/core/hoc/withBindDataSource.d.ts +0 -6
- package/es/core/hoc/withBindDataSource.js +0 -61
- package/es/core/hooks/index.d.ts +0 -4
- package/es/core/hooks/index.js +0 -4
- package/es/core/hooks/useCurrentNode.d.ts +0 -10
- package/es/core/hooks/useCurrentNode.js +0 -11
- package/es/core/hooks/useDataSource.d.ts +0 -2
- package/es/core/hooks/useDataSource.js +0 -6
- package/es/core/hooks/useEditor.d.ts +0 -1
- package/es/core/hooks/useEditor.js +0 -5
- package/es/core/hooks/useEventReport.d.ts +0 -5
- package/es/core/hooks/useEventReport.js +0 -73
- package/es/core/hooks/useOnScreen.d.ts +0 -2
- package/es/core/hooks/useOnScreen.js +0 -19
- package/es/core/hooks/useSxpDataSource.d.ts +0 -1
- package/es/core/hooks/useSxpDataSource.js +0 -5
- package/es/core/index.d.ts +0 -3
- package/es/core/index.js +0 -1
- package/es/core/schema.d.ts +0 -58
- package/es/core/schema.js +0 -1
- package/es/core/utils/event.d.ts +0 -7
- package/es/core/utils/event.js +0 -8
- package/es/core/utils/getDataByDS.d.ts +0 -6
- package/es/core/utils/getDataByDS.js +0 -39
- package/es/core/utils/getSxpTokenInfo.d.ts +0 -2
- package/es/core/utils/getSxpTokenInfo.js +0 -26
- package/es/core/utils/localStore.d.ts +0 -5
- package/es/core/utils/localStore.js +0 -22
- package/es/core/utils/materials.d.ts +0 -11
- package/es/core/utils/materials.js +0 -31
- package/es/core/utils/sessionStore.d.ts +0 -3
- package/es/core/utils/sessionStore.js +0 -26
- package/es/core/utils/tool.d.ts +0 -5
- package/es/core/utils/tool.js +0 -48
- package/es/core/utils/unzip.d.ts +0 -1
- package/es/core/utils/unzip.js +0 -10
- package/es/index.d.ts +0 -11
- package/es/index.js +0 -13
- package/es/materials/index.d.ts +0 -1
- package/es/materials/index.js +0 -1
- package/es/materials/sxp/HashTag/index.d.ts +0 -14
- package/es/materials/sxp/HashTag/index.js +0 -6
- package/es/materials/sxp/HashTag/material.d.ts +0 -2
- package/es/materials/sxp/HashTag/material.js +0 -52
- package/es/materials/sxp/HashTag/settingRender.d.ts +0 -125
- package/es/materials/sxp/HashTag/settingRender.js +0 -157
- package/es/materials/sxp/defaultSetting.d.ts +0 -11
- package/es/materials/sxp/defaultSetting.js +0 -7
- package/es/materials/sxp/index.d.ts +0 -3
- package/es/materials/sxp/index.js +0 -3
- package/es/materials/sxp/popup/AppointForm/index.d.ts +0 -18
- package/es/materials/sxp/popup/AppointForm/index.js +0 -76
- package/es/materials/sxp/popup/AppointForm/interactionRender.d.ts +0 -8
- package/es/materials/sxp/popup/AppointForm/interactionRender.js +0 -11
- package/es/materials/sxp/popup/AppointForm/material.d.ts +0 -2
- package/es/materials/sxp/popup/AppointForm/material.js +0 -35
- package/es/materials/sxp/popup/AppointForm/settingRender.d.ts +0 -68
- package/es/materials/sxp/popup/AppointForm/settingRender.js +0 -93
- package/es/materials/sxp/popup/CommodityDetail/index.d.ts +0 -34
- package/es/materials/sxp/popup/CommodityDetail/index.js +0 -110
- package/es/materials/sxp/popup/CommodityDetail/material.d.ts +0 -2
- package/es/materials/sxp/popup/CommodityDetail/material.js +0 -51
- package/es/materials/sxp/popup/CommodityDetail/settingRender.d.ts +0 -137
- package/es/materials/sxp/popup/CommodityDetail/settingRender.js +0 -171
- package/es/materials/sxp/popup/CommodityDetailDiro/index.d.ts +0 -19
- package/es/materials/sxp/popup/CommodityDetailDiro/index.js +0 -163
- package/es/materials/sxp/popup/CommodityDetailDiro/material.d.ts +0 -2
- package/es/materials/sxp/popup/CommodityDetailDiro/material.js +0 -16
- package/es/materials/sxp/popup/CommodityDetailDiroNew/index.d.ts +0 -35
- package/es/materials/sxp/popup/CommodityDetailDiroNew/index.js +0 -134
- package/es/materials/sxp/popup/CommodityDetailDiroNew/material.d.ts +0 -2
- package/es/materials/sxp/popup/CommodityDetailDiroNew/material.js +0 -61
- package/es/materials/sxp/popup/CommodityDetailDiroNew/settingRender.d.ts +0 -137
- package/es/materials/sxp/popup/CommodityDetailDiroNew/settingRender.js +0 -175
- package/es/materials/sxp/popup/Prompt/index.d.ts +0 -11
- package/es/materials/sxp/popup/Prompt/index.js +0 -20
- package/es/materials/sxp/popup/Prompt/interactionRender.d.ts +0 -8
- package/es/materials/sxp/popup/Prompt/interactionRender.js +0 -11
- package/es/materials/sxp/popup/Prompt/material.d.ts +0 -2
- package/es/materials/sxp/popup/Prompt/material.js +0 -28
- package/es/materials/sxp/popup/Prompt/settingRender.d.ts +0 -12
- package/es/materials/sxp/popup/Prompt/settingRender.js +0 -18
- package/es/materials/sxp/popup/index.d.ts +0 -4
- package/es/materials/sxp/popup/index.js +0 -4
- package/es/materials/sxp/template/Appoint/index.d.ts +0 -15
- package/es/materials/sxp/template/Appoint/index.js +0 -16
- package/es/materials/sxp/template/Appoint/interactionRender.d.ts +0 -8
- package/es/materials/sxp/template/Appoint/interactionRender.js +0 -11
- package/es/materials/sxp/template/Appoint/material.d.ts +0 -2
- package/es/materials/sxp/template/Appoint/material.js +0 -46
- package/es/materials/sxp/template/Commodity/index.d.ts +0 -15
- package/es/materials/sxp/template/Commodity/index.js +0 -27
- package/es/materials/sxp/template/Commodity/interactionRender.d.ts +0 -8
- package/es/materials/sxp/template/Commodity/interactionRender.js +0 -11
- package/es/materials/sxp/template/Commodity/material.d.ts +0 -2
- package/es/materials/sxp/template/Commodity/material.js +0 -52
- package/es/materials/sxp/template/CommodityDiro/index.d.ts +0 -15
- package/es/materials/sxp/template/CommodityDiro/index.js +0 -27
- package/es/materials/sxp/template/CommodityDiro/interactionRender.d.ts +0 -8
- package/es/materials/sxp/template/CommodityDiro/interactionRender.js +0 -11
- package/es/materials/sxp/template/CommodityDiro/material.d.ts +0 -2
- package/es/materials/sxp/template/CommodityDiro/material.js +0 -52
- package/es/materials/sxp/template/CommodityDiroNew/index.d.ts +0 -15
- package/es/materials/sxp/template/CommodityDiroNew/index.js +0 -27
- package/es/materials/sxp/template/CommodityDiroNew/interactionRender.d.ts +0 -8
- package/es/materials/sxp/template/CommodityDiroNew/interactionRender.js +0 -11
- package/es/materials/sxp/template/CommodityDiroNew/material.d.ts +0 -2
- package/es/materials/sxp/template/CommodityDiroNew/material.js +0 -53
- package/es/materials/sxp/template/Link/index.d.ts +0 -14
- package/es/materials/sxp/template/Link/index.js +0 -32
- package/es/materials/sxp/template/Link/material.d.ts +0 -2
- package/es/materials/sxp/template/Link/material.js +0 -44
- package/es/materials/sxp/template/MultiCommodity/index.d.ts +0 -16
- package/es/materials/sxp/template/MultiCommodity/index.js +0 -52
- package/es/materials/sxp/template/MultiCommodity/interactionRender.d.ts +0 -8
- package/es/materials/sxp/template/MultiCommodity/interactionRender.js +0 -11
- package/es/materials/sxp/template/MultiCommodity/material.d.ts +0 -2
- package/es/materials/sxp/template/MultiCommodity/material.js +0 -52
- package/es/materials/sxp/template/MultiCommodityDiro/index.d.ts +0 -16
- package/es/materials/sxp/template/MultiCommodityDiro/index.js +0 -51
- package/es/materials/sxp/template/MultiCommodityDiro/interactionRender.d.ts +0 -8
- package/es/materials/sxp/template/MultiCommodityDiro/interactionRender.js +0 -11
- package/es/materials/sxp/template/MultiCommodityDiro/material.d.ts +0 -2
- package/es/materials/sxp/template/MultiCommodityDiro/material.js +0 -52
- package/es/materials/sxp/template/MultiCommodityDiroNew/index.d.ts +0 -16
- package/es/materials/sxp/template/MultiCommodityDiroNew/index.js +0 -52
- package/es/materials/sxp/template/MultiCommodityDiroNew/interactionRender.d.ts +0 -8
- package/es/materials/sxp/template/MultiCommodityDiroNew/interactionRender.js +0 -11
- package/es/materials/sxp/template/MultiCommodityDiroNew/material.d.ts +0 -2
- package/es/materials/sxp/template/MultiCommodityDiroNew/material.js +0 -53
- package/es/materials/sxp/template/components/EventProvider.d.ts +0 -13
- package/es/materials/sxp/template/components/EventProvider.js +0 -47
- package/es/materials/sxp/template/components/Img.d.ts +0 -10
- package/es/materials/sxp/template/components/Img.js +0 -19
- package/es/materials/sxp/template/components/Scroll.d.ts +0 -10
- package/es/materials/sxp/template/components/Scroll.js +0 -10
- package/es/materials/sxp/template/components/settingRender.d.ts +0 -129
- package/es/materials/sxp/template/components/settingRender.js +0 -219
- package/es/materials/sxp/template/components/typing.d.ts +0 -6
- package/es/materials/sxp/template/components/typing.js +0 -1
- package/es/materials/sxp/template/index.d.ts +0 -8
- package/es/materials/sxp/template/index.js +0 -8
- package/lib/core/Pagebuilder/PagebuilderClass.d.ts +0 -15
- package/lib/core/Pagebuilder/PagebuilderClass.js +0 -45
- package/lib/core/Pagebuilder/index.d.ts +0 -3
- package/lib/core/Pagebuilder/index.js +0 -99
- package/lib/core/Pagebuilder/type.d.ts +0 -55
- package/lib/core/Pagebuilder/type.js +0 -2
- package/lib/core/components/SxpPageCore/index.d.ts +0 -12
- package/lib/core/components/SxpPageCore/index.js +0 -29
- package/lib/core/components/SxpPageRender/ExpandableText.d.ts +0 -14
- package/lib/core/components/SxpPageRender/ExpandableText.js +0 -45
- package/lib/core/components/SxpPageRender/FingerSwipeTip/index.d.ts +0 -6
- package/lib/core/components/SxpPageRender/FingerSwipeTip/index.js +0 -22
- package/lib/core/components/SxpPageRender/Hashtag/index.d.ts +0 -12
- package/lib/core/components/SxpPageRender/Hashtag/index.js +0 -43
- package/lib/core/components/SxpPageRender/LikeButton/index.d.ts +0 -11
- package/lib/core/components/SxpPageRender/LikeButton/index.js +0 -60
- package/lib/core/components/SxpPageRender/Modal/index.d.ts +0 -11
- package/lib/core/components/SxpPageRender/Modal/index.js +0 -51
- package/lib/core/components/SxpPageRender/Navbar.d.ts +0 -9
- package/lib/core/components/SxpPageRender/Navbar.js +0 -13
- package/lib/core/components/SxpPageRender/Nudge/index.d.ts +0 -24
- package/lib/core/components/SxpPageRender/Nudge/index.js +0 -16
- package/lib/core/components/SxpPageRender/PictureGroup/Picture.d.ts +0 -8
- package/lib/core/components/SxpPageRender/PictureGroup/Picture.js +0 -54
- package/lib/core/components/SxpPageRender/PictureGroup/index.d.ts +0 -13
- package/lib/core/components/SxpPageRender/PictureGroup/index.js +0 -31
- package/lib/core/components/SxpPageRender/Popup/index.d.ts +0 -3
- package/lib/core/components/SxpPageRender/Popup/index.js +0 -65
- package/lib/core/components/SxpPageRender/RenderCard.d.ts +0 -11
- package/lib/core/components/SxpPageRender/RenderCard.js +0 -46
- package/lib/core/components/SxpPageRender/ToggleButton/index.d.ts +0 -10
- package/lib/core/components/SxpPageRender/ToggleButton/index.js +0 -16
- package/lib/core/components/SxpPageRender/VideoWidget/index.d.ts +0 -12
- package/lib/core/components/SxpPageRender/VideoWidget/index.js +0 -222
- package/lib/core/components/SxpPageRender/WaterFall/List.d.ts +0 -4
- package/lib/core/components/SxpPageRender/WaterFall/List.js +0 -186
- package/lib/core/components/SxpPageRender/WaterFall/WaterfallList.d.ts +0 -4
- package/lib/core/components/SxpPageRender/WaterFall/WaterfallList.js +0 -322
- package/lib/core/components/SxpPageRender/WaterFall/index.d.ts +0 -7
- package/lib/core/components/SxpPageRender/WaterFall/index.js +0 -104
- package/lib/core/components/SxpPageRender/WaterFall/preview.json +0 -1242
- package/lib/core/components/SxpPageRender/fakeData.d.ts +0 -130
- package/lib/core/components/SxpPageRender/fakeData.js +0 -902
- package/lib/core/components/SxpPageRender/index.d.ts +0 -57
- package/lib/core/components/SxpPageRender/index.js +0 -381
- package/lib/core/components/SxpPageRender/typing.d.ts +0 -66
- package/lib/core/components/SxpPageRender/typing.js +0 -2
- package/lib/core/components/SxpPageRender/useIconLink.d.ts +0 -1
- package/lib/core/components/SxpPageRender/useIconLink.js +0 -17
- package/lib/core/context/DataSourceProvider.d.ts +0 -17
- package/lib/core/context/DataSourceProvider.js +0 -48
- package/lib/core/context/EditorContext.d.ts +0 -83
- package/lib/core/context/EditorContext.js +0 -151
- package/lib/core/context/EditorDataProvider.d.ts +0 -20
- package/lib/core/context/EditorDataProvider.js +0 -28
- package/lib/core/context/SxpDataSourceProvider.d.ts +0 -94
- package/lib/core/context/SxpDataSourceProvider.js +0 -211
- package/lib/core/create.d.ts +0 -37
- package/lib/core/create.js +0 -8
- package/lib/core/hoc/withBindDataSource.d.ts +0 -6
- package/lib/core/hoc/withBindDataSource.js +0 -63
- package/lib/core/hooks/index.d.ts +0 -4
- package/lib/core/hooks/index.js +0 -7
- package/lib/core/hooks/useCurrentNode.d.ts +0 -10
- package/lib/core/hooks/useCurrentNode.js +0 -14
- package/lib/core/hooks/useDataSource.d.ts +0 -2
- package/lib/core/hooks/useDataSource.js +0 -9
- package/lib/core/hooks/useEditor.d.ts +0 -1
- package/lib/core/hooks/useEditor.js +0 -9
- package/lib/core/hooks/useEventReport.d.ts +0 -5
- package/lib/core/hooks/useEventReport.js +0 -77
- package/lib/core/hooks/useOnScreen.d.ts +0 -2
- package/lib/core/hooks/useOnScreen.js +0 -22
- package/lib/core/hooks/useSxpDataSource.d.ts +0 -1
- package/lib/core/hooks/useSxpDataSource.js +0 -9
- package/lib/core/index.d.ts +0 -3
- package/lib/core/index.js +0 -5
- package/lib/core/schema.d.ts +0 -58
- package/lib/core/schema.js +0 -2
- package/lib/core/utils/event.d.ts +0 -7
- package/lib/core/utils/event.js +0 -12
- package/lib/core/utils/getDataByDS.d.ts +0 -6
- package/lib/core/utils/getDataByDS.js +0 -41
- package/lib/core/utils/getSxpTokenInfo.d.ts +0 -2
- package/lib/core/utils/getSxpTokenInfo.js +0 -30
- package/lib/core/utils/localStore.d.ts +0 -5
- package/lib/core/utils/localStore.js +0 -28
- package/lib/core/utils/materials.d.ts +0 -11
- package/lib/core/utils/materials.js +0 -37
- package/lib/core/utils/sessionStore.d.ts +0 -3
- package/lib/core/utils/sessionStore.js +0 -32
- package/lib/core/utils/tool.d.ts +0 -5
- package/lib/core/utils/tool.js +0 -54
- package/lib/core/utils/unzip.d.ts +0 -1
- package/lib/core/utils/unzip.js +0 -15
- package/lib/index.d.ts +0 -11
- package/lib/index.js +0 -22
- package/lib/materials/index.d.ts +0 -1
- package/lib/materials/index.js +0 -4
- package/lib/materials/sxp/HashTag/index.d.ts +0 -14
- package/lib/materials/sxp/HashTag/index.js +0 -9
- package/lib/materials/sxp/HashTag/material.d.ts +0 -2
- package/lib/materials/sxp/HashTag/material.js +0 -56
- package/lib/materials/sxp/HashTag/settingRender.d.ts +0 -125
- package/lib/materials/sxp/HashTag/settingRender.js +0 -159
- package/lib/materials/sxp/defaultSetting.d.ts +0 -11
- package/lib/materials/sxp/defaultSetting.js +0 -10
- package/lib/materials/sxp/index.d.ts +0 -3
- package/lib/materials/sxp/index.js +0 -6
- package/lib/materials/sxp/popup/AppointForm/index.d.ts +0 -18
- package/lib/materials/sxp/popup/AppointForm/index.js +0 -78
- package/lib/materials/sxp/popup/AppointForm/interactionRender.d.ts +0 -8
- package/lib/materials/sxp/popup/AppointForm/interactionRender.js +0 -13
- package/lib/materials/sxp/popup/AppointForm/material.d.ts +0 -2
- package/lib/materials/sxp/popup/AppointForm/material.js +0 -39
- package/lib/materials/sxp/popup/AppointForm/settingRender.d.ts +0 -68
- package/lib/materials/sxp/popup/AppointForm/settingRender.js +0 -95
- package/lib/materials/sxp/popup/CommodityDetail/index.d.ts +0 -34
- package/lib/materials/sxp/popup/CommodityDetail/index.js +0 -112
- package/lib/materials/sxp/popup/CommodityDetail/material.d.ts +0 -2
- package/lib/materials/sxp/popup/CommodityDetail/material.js +0 -55
- package/lib/materials/sxp/popup/CommodityDetail/settingRender.d.ts +0 -137
- package/lib/materials/sxp/popup/CommodityDetail/settingRender.js +0 -173
- package/lib/materials/sxp/popup/CommodityDetailDiro/index.d.ts +0 -19
- package/lib/materials/sxp/popup/CommodityDetailDiro/index.js +0 -165
- package/lib/materials/sxp/popup/CommodityDetailDiro/material.d.ts +0 -2
- package/lib/materials/sxp/popup/CommodityDetailDiro/material.js +0 -20
- package/lib/materials/sxp/popup/CommodityDetailDiroNew/index.d.ts +0 -35
- package/lib/materials/sxp/popup/CommodityDetailDiroNew/index.js +0 -136
- package/lib/materials/sxp/popup/CommodityDetailDiroNew/material.d.ts +0 -2
- package/lib/materials/sxp/popup/CommodityDetailDiroNew/material.js +0 -65
- package/lib/materials/sxp/popup/CommodityDetailDiroNew/settingRender.d.ts +0 -137
- package/lib/materials/sxp/popup/CommodityDetailDiroNew/settingRender.js +0 -177
- package/lib/materials/sxp/popup/Prompt/index.d.ts +0 -11
- package/lib/materials/sxp/popup/Prompt/index.js +0 -22
- package/lib/materials/sxp/popup/Prompt/interactionRender.d.ts +0 -8
- package/lib/materials/sxp/popup/Prompt/interactionRender.js +0 -13
- package/lib/materials/sxp/popup/Prompt/material.d.ts +0 -2
- package/lib/materials/sxp/popup/Prompt/material.js +0 -32
- package/lib/materials/sxp/popup/Prompt/settingRender.d.ts +0 -12
- package/lib/materials/sxp/popup/Prompt/settingRender.js +0 -20
- package/lib/materials/sxp/popup/index.d.ts +0 -4
- package/lib/materials/sxp/popup/index.js +0 -7
- package/lib/materials/sxp/template/Appoint/index.d.ts +0 -15
- package/lib/materials/sxp/template/Appoint/index.js +0 -18
- package/lib/materials/sxp/template/Appoint/interactionRender.d.ts +0 -8
- package/lib/materials/sxp/template/Appoint/interactionRender.js +0 -13
- package/lib/materials/sxp/template/Appoint/material.d.ts +0 -2
- package/lib/materials/sxp/template/Appoint/material.js +0 -50
- package/lib/materials/sxp/template/Commodity/index.d.ts +0 -15
- package/lib/materials/sxp/template/Commodity/index.js +0 -29
- package/lib/materials/sxp/template/Commodity/interactionRender.d.ts +0 -8
- package/lib/materials/sxp/template/Commodity/interactionRender.js +0 -13
- package/lib/materials/sxp/template/Commodity/material.d.ts +0 -2
- package/lib/materials/sxp/template/Commodity/material.js +0 -56
- package/lib/materials/sxp/template/CommodityDiro/index.d.ts +0 -15
- package/lib/materials/sxp/template/CommodityDiro/index.js +0 -29
- package/lib/materials/sxp/template/CommodityDiro/interactionRender.d.ts +0 -8
- package/lib/materials/sxp/template/CommodityDiro/interactionRender.js +0 -13
- package/lib/materials/sxp/template/CommodityDiro/material.d.ts +0 -2
- package/lib/materials/sxp/template/CommodityDiro/material.js +0 -56
- package/lib/materials/sxp/template/CommodityDiroNew/index.d.ts +0 -15
- package/lib/materials/sxp/template/CommodityDiroNew/index.js +0 -29
- package/lib/materials/sxp/template/CommodityDiroNew/interactionRender.d.ts +0 -8
- package/lib/materials/sxp/template/CommodityDiroNew/interactionRender.js +0 -13
- package/lib/materials/sxp/template/CommodityDiroNew/material.d.ts +0 -2
- package/lib/materials/sxp/template/CommodityDiroNew/material.js +0 -57
- package/lib/materials/sxp/template/Link/index.d.ts +0 -14
- package/lib/materials/sxp/template/Link/index.js +0 -34
- package/lib/materials/sxp/template/Link/material.d.ts +0 -2
- package/lib/materials/sxp/template/Link/material.js +0 -48
- package/lib/materials/sxp/template/MultiCommodity/index.d.ts +0 -16
- package/lib/materials/sxp/template/MultiCommodity/index.js +0 -54
- package/lib/materials/sxp/template/MultiCommodity/interactionRender.d.ts +0 -8
- package/lib/materials/sxp/template/MultiCommodity/interactionRender.js +0 -13
- package/lib/materials/sxp/template/MultiCommodity/material.d.ts +0 -2
- package/lib/materials/sxp/template/MultiCommodity/material.js +0 -56
- package/lib/materials/sxp/template/MultiCommodityDiro/index.d.ts +0 -16
- package/lib/materials/sxp/template/MultiCommodityDiro/index.js +0 -53
- package/lib/materials/sxp/template/MultiCommodityDiro/interactionRender.d.ts +0 -8
- package/lib/materials/sxp/template/MultiCommodityDiro/interactionRender.js +0 -13
- package/lib/materials/sxp/template/MultiCommodityDiro/material.d.ts +0 -2
- package/lib/materials/sxp/template/MultiCommodityDiro/material.js +0 -56
- package/lib/materials/sxp/template/MultiCommodityDiroNew/index.d.ts +0 -16
- package/lib/materials/sxp/template/MultiCommodityDiroNew/index.js +0 -54
- package/lib/materials/sxp/template/MultiCommodityDiroNew/interactionRender.d.ts +0 -8
- package/lib/materials/sxp/template/MultiCommodityDiroNew/interactionRender.js +0 -13
- package/lib/materials/sxp/template/MultiCommodityDiroNew/material.d.ts +0 -2
- package/lib/materials/sxp/template/MultiCommodityDiroNew/material.js +0 -57
- package/lib/materials/sxp/template/components/EventProvider.d.ts +0 -13
- package/lib/materials/sxp/template/components/EventProvider.js +0 -49
- package/lib/materials/sxp/template/components/Img.d.ts +0 -10
- package/lib/materials/sxp/template/components/Img.js +0 -22
- package/lib/materials/sxp/template/components/Scroll.d.ts +0 -10
- package/lib/materials/sxp/template/components/Scroll.js +0 -13
- package/lib/materials/sxp/template/components/settingRender.d.ts +0 -129
- package/lib/materials/sxp/template/components/settingRender.js +0 -221
- package/lib/materials/sxp/template/components/typing.d.ts +0 -6
- package/lib/materials/sxp/template/components/typing.js +0 -2
- package/lib/materials/sxp/template/index.d.ts +0 -8
- package/lib/materials/sxp/template/index.js +0 -11
@@ -1,51 +0,0 @@
|
|
1
|
-
import React, { useCallback, useEffect, useRef, useState } from 'react';
|
2
|
-
import { useSxpDataSource } from '../../../../core/hooks';
|
3
|
-
const Picture = (props) => {
|
4
|
-
const { src, height, width } = props;
|
5
|
-
const [blur, setBlur] = useState(false);
|
6
|
-
const imgDom = useRef(null);
|
7
|
-
const { sxpParameter } = useSxpDataSource();
|
8
|
-
const getAvifToPng = useCallback((src) => {
|
9
|
-
return src;
|
10
|
-
return src.indexOf('avif') !== -1 ? `${src}?imageMogr2/format/webm` : src;
|
11
|
-
}, []);
|
12
|
-
useEffect(() => {
|
13
|
-
if (imgDom.current === null || src === '') {
|
14
|
-
return;
|
15
|
-
}
|
16
|
-
const img = new Image();
|
17
|
-
img.src = src;
|
18
|
-
img.onload = () => {
|
19
|
-
const aspectRatio = img.height / img.width;
|
20
|
-
const targetAspectRatio = 16 / 9;
|
21
|
-
const tolerance = 0.05;
|
22
|
-
if (Math.abs(aspectRatio - targetAspectRatio) > tolerance) {
|
23
|
-
setBlur(true);
|
24
|
-
}
|
25
|
-
};
|
26
|
-
imgDom.current.src = getAvifToPng(src);
|
27
|
-
}, [src, getAvifToPng]);
|
28
|
-
return (React.createElement("div", { style: {
|
29
|
-
overflow: 'hidden',
|
30
|
-
height,
|
31
|
-
width: '100%',
|
32
|
-
position: 'relative'
|
33
|
-
} },
|
34
|
-
React.createElement("img", { ref: imgDom, loading: 'lazy', src: src ? getAvifToPng(src) : sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.placeholder_image, style: {
|
35
|
-
height: '100%',
|
36
|
-
width: '100%',
|
37
|
-
objectFit: 'cover',
|
38
|
-
filter: blur ? 'blur(10px)' : 'none',
|
39
|
-
transform: blur ? 'scale(1.2)' : 'none'
|
40
|
-
} }),
|
41
|
-
blur && (React.createElement("img", { ref: imgDom, src: getAvifToPng(src), loading: 'lazy', style: {
|
42
|
-
width: '100%',
|
43
|
-
objectFit: 'contain',
|
44
|
-
position: 'absolute',
|
45
|
-
top: '50%',
|
46
|
-
transform: 'translateY(-50%)',
|
47
|
-
left: 0,
|
48
|
-
right: 0
|
49
|
-
} }))));
|
50
|
-
};
|
51
|
-
export default Picture;
|
@@ -1,13 +0,0 @@
|
|
1
|
-
import React from 'react';
|
2
|
-
import { RecItemType } from '../typing';
|
3
|
-
interface IPictureGroupProps {
|
4
|
-
imgUrls?: string[];
|
5
|
-
width: number;
|
6
|
-
height: number;
|
7
|
-
rec: RecItemType;
|
8
|
-
index: number;
|
9
|
-
onReportViewImageEnd: (rec: RecItemType) => void;
|
10
|
-
onViewImageStartEvent: (index: number) => void;
|
11
|
-
}
|
12
|
-
declare const _default: React.NamedExoticComponent<IPictureGroupProps>;
|
13
|
-
export default _default;
|
@@ -1,28 +0,0 @@
|
|
1
|
-
import React, { memo, useEffect, useState } from 'react';
|
2
|
-
import { Autoplay, Pagination } from 'swiper/modules';
|
3
|
-
import { Swiper, SwiperSlide, useSwiperSlide } from 'swiper/react';
|
4
|
-
import Picture from './Picture';
|
5
|
-
import { useSxpDataSource } from '../../../../core/hooks';
|
6
|
-
const PictureGroup = ({ imgUrls, width, height, rec, index, onReportViewImageEnd, onViewImageStartEvent }) => {
|
7
|
-
const { isActive } = useSwiperSlide();
|
8
|
-
const { sxpParameter, openHashtag } = useSxpDataSource();
|
9
|
-
const [isLoad, setIsLoad] = useState(false);
|
10
|
-
useEffect(() => {
|
11
|
-
if (isLoad && isActive) {
|
12
|
-
if (openHashtag) {
|
13
|
-
onReportViewImageEnd(rec);
|
14
|
-
}
|
15
|
-
else {
|
16
|
-
onViewImageStartEvent(index);
|
17
|
-
}
|
18
|
-
}
|
19
|
-
else {
|
20
|
-
setIsLoad(true);
|
21
|
-
}
|
22
|
-
}, [rec, isActive, onReportViewImageEnd, openHashtag, index, onViewImageStartEvent, isLoad]);
|
23
|
-
return (React.createElement(Swiper, { defaultValue: 0, direction: 'horizontal', modules: [Pagination, Autoplay], pagination: { clickable: true, bulletActiveClass: 'swipe-item-active-bullet' }, height: height, loop: true, autoplay: { delay: 3000 } }, imgUrls === null || imgUrls === void 0 ? void 0 : imgUrls.map((url) => {
|
24
|
-
return (React.createElement(SwiperSlide, { key: url },
|
25
|
-
React.createElement(Picture, { src: url, width: width, height: height })));
|
26
|
-
})));
|
27
|
-
};
|
28
|
-
export default memo(PictureGroup);
|
@@ -1,62 +0,0 @@
|
|
1
|
-
import React, { useEffect, useMemo, useRef, useState } from 'react';
|
2
|
-
import Modal from '../Modal';
|
3
|
-
import { useEditor, useSxpDataSource } from '../../../../core/hooks';
|
4
|
-
import withBindDataSource from '../../../../core/hoc/withBindDataSource';
|
5
|
-
import { useEventReport } from '../../../../core/hooks/useEventReport';
|
6
|
-
const Popup = () => {
|
7
|
-
const { schema, resolver, popup } = useEditor();
|
8
|
-
const { setPopupDetailData, popupDetailData, bffEventReport } = useSxpDataSource();
|
9
|
-
const { productView } = useEventReport();
|
10
|
-
const [visible, setVisible] = useState();
|
11
|
-
const curTimeRef = useRef(null);
|
12
|
-
useEffect(() => {
|
13
|
-
const initTime = () => {
|
14
|
-
curTimeRef.current = new Date();
|
15
|
-
};
|
16
|
-
initTime();
|
17
|
-
window.addEventListener('pageshow', initTime);
|
18
|
-
return () => {
|
19
|
-
window.removeEventListener('pageshow', initTime);
|
20
|
-
};
|
21
|
-
}, []);
|
22
|
-
useEffect(() => {
|
23
|
-
if (popup && (popup === null || popup === void 0 ? void 0 : popup.id) && (popup === null || popup === void 0 ? void 0 : popup.id) !== '') {
|
24
|
-
curTimeRef.current = new Date();
|
25
|
-
setVisible(popup);
|
26
|
-
}
|
27
|
-
}, [popup]);
|
28
|
-
const handleClose = () => {
|
29
|
-
var _a, _b, _c, _d;
|
30
|
-
if (!popup || (popup === null || popup === void 0 ? void 0 : popup.id) === '' || !visible || new Date() - curTimeRef.current < ((_a = popup === null || popup === void 0 ? void 0 : popup.duration) !== null && _a !== void 0 ? _a : 0)) {
|
31
|
-
return;
|
32
|
-
}
|
33
|
-
setVisible(Object.assign(Object.assign({}, popup), { id: '' }));
|
34
|
-
const data = popupDetailData;
|
35
|
-
const product = (_b = data === null || data === void 0 ? void 0 : data.video) === null || _b === void 0 ? void 0 : _b.bindProduct;
|
36
|
-
const cta = (_d = (_c = data === null || data === void 0 ? void 0 : data.video) === null || _c === void 0 ? void 0 : _c.bindProduct) === null || _d === void 0 ? void 0 : _d.bindCta;
|
37
|
-
if (product && cta) {
|
38
|
-
productView(data, product, cta, curTimeRef.current, popupDetailData === null || popupDetailData === void 0 ? void 0 : popupDetailData.index);
|
39
|
-
}
|
40
|
-
setTimeout(() => {
|
41
|
-
window === null || window === void 0 ? void 0 : window.sxpPopup('');
|
42
|
-
setPopupDetailData === null || setPopupDetailData === void 0 ? void 0 : setPopupDetailData(null);
|
43
|
-
}, popup === null || popup === void 0 ? void 0 : popup.duration);
|
44
|
-
};
|
45
|
-
const renderPopupDetail = useMemo(() => {
|
46
|
-
var _a, _b, _c;
|
47
|
-
return (_c = (_b = (_a = schema === null || schema === void 0 ? void 0 : schema.sxpPageConf) === null || _a === void 0 ? void 0 : _a.globalConfig) === null || _b === void 0 ? void 0 : _b.popupList) === null || _c === void 0 ? void 0 : _c.map((value, index) => {
|
48
|
-
var _a, _b, _c, _d, _e, _f, _g, _h;
|
49
|
-
if ((value === null || value === void 0 ? void 0 : value.id) === (popup === null || popup === void 0 ? void 0 : popup.id)) {
|
50
|
-
const t = resolver[(_a = value === null || value === void 0 ? void 0 : value.item) === null || _a === void 0 ? void 0 : _a.type];
|
51
|
-
const Component = withBindDataSource(t);
|
52
|
-
const defaulSetting = (_b = t === null || t === void 0 ? void 0 : t.extend) === null || _b === void 0 ? void 0 : _b.defaulSetting;
|
53
|
-
return (React.createElement(Component, Object.assign({ key: index, style: Object.assign(Object.assign(Object.assign({}, defaulSetting === null || defaulSetting === void 0 ? void 0 : defaulSetting.style), (_c = value === null || value === void 0 ? void 0 : value.item) === null || _c === void 0 ? void 0 : _c.style), { width: '100%', height: '80vh', overflow: 'auto' }), textStyle: Object.assign(Object.assign({}, defaulSetting === null || defaulSetting === void 0 ? void 0 : defaulSetting.textStyle), (_d = value === null || value === void 0 ? void 0 : value.item) === null || _d === void 0 ? void 0 : _d.textStyle), bindDatas: (_f = (_e = value === null || value === void 0 ? void 0 : value.item) === null || _e === void 0 ? void 0 : _e.bindDatas) !== null && _f !== void 0 ? _f : [] }, defaulSetting === null || defaulSetting === void 0 ? void 0 : defaulSetting.props, (_g = value === null || value === void 0 ? void 0 : value.item) === null || _g === void 0 ? void 0 : _g.props, { event: ((_h = value === null || value === void 0 ? void 0 : value.item) === null || _h === void 0 ? void 0 : _h.event) || {}, schema: schema, id: value === null || value === void 0 ? void 0 : value.id })));
|
54
|
-
}
|
55
|
-
else {
|
56
|
-
return React.createElement(React.Fragment, null);
|
57
|
-
}
|
58
|
-
});
|
59
|
-
}, [schema, popup, resolver]);
|
60
|
-
return (React.createElement(Modal, { popup: visible, onClose: handleClose, padding: 0, modalStyle: { position: 'fixed' } }, renderPopupDetail));
|
61
|
-
};
|
62
|
-
export default Popup;
|
@@ -1,11 +0,0 @@
|
|
1
|
-
import React from 'react';
|
2
|
-
import './index.less';
|
3
|
-
import { RecItemType } from './typing';
|
4
|
-
interface IRenderCardProps {
|
5
|
-
index: number;
|
6
|
-
rec: RecItemType;
|
7
|
-
tempMap?: Record<string, any>;
|
8
|
-
resolver: any;
|
9
|
-
}
|
10
|
-
declare const _default: React.NamedExoticComponent<IRenderCardProps>;
|
11
|
-
export default _default;
|
@@ -1,43 +0,0 @@
|
|
1
|
-
import React, { memo, useMemo } from 'react';
|
2
|
-
import './index.less';
|
3
|
-
import withBindDataSource from '../../../core/hoc/withBindDataSource';
|
4
|
-
import { useEditor } from '../../../core/hooks';
|
5
|
-
const RenderCard = ({ rec, index, tempMap, resolver }) => {
|
6
|
-
const { schema } = useEditor();
|
7
|
-
const renderComp = useMemo(() => {
|
8
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6;
|
9
|
-
if (!(rec === null || rec === void 0 ? void 0 : rec.video))
|
10
|
-
return null;
|
11
|
-
let cta = null;
|
12
|
-
if ((_b = (_a = rec === null || rec === void 0 ? void 0 : rec.video) === null || _a === void 0 ? void 0 : _a.bindProducts) === null || _b === void 0 ? void 0 : _b.length) {
|
13
|
-
cta = '多商品CTA';
|
14
|
-
}
|
15
|
-
else if ((_c = rec === null || rec === void 0 ? void 0 : rec.video) === null || _c === void 0 ? void 0 : _c.bindProduct) {
|
16
|
-
cta = '商品CTA';
|
17
|
-
}
|
18
|
-
else {
|
19
|
-
cta = (_e = (_d = rec === null || rec === void 0 ? void 0 : rec.video) === null || _d === void 0 ? void 0 : _d.bindCta) === null || _e === void 0 ? void 0 : _e.itemId;
|
20
|
-
}
|
21
|
-
const value = tempMap === null || tempMap === void 0 ? void 0 : tempMap[cta];
|
22
|
-
if ((((_f = value === null || value === void 0 ? void 0 : value.item) === null || _f === void 0 ? void 0 : _f.type) === 'CommodityDiro' && !((_g = rec === null || rec === void 0 ? void 0 : rec.video) === null || _g === void 0 ? void 0 : _g.bindProduct)) ||
|
23
|
-
(((_h = value === null || value === void 0 ? void 0 : value.item) === null || _h === void 0 ? void 0 : _h.type) === 'Commodity' && !((_j = rec === null || rec === void 0 ? void 0 : rec.video) === null || _j === void 0 ? void 0 : _j.bindProduct)) ||
|
24
|
-
(((_k = value === null || value === void 0 ? void 0 : value.item) === null || _k === void 0 ? void 0 : _k.type) === 'CommodityDiroNew' && !((_l = rec === null || rec === void 0 ? void 0 : rec.video) === null || _l === void 0 ? void 0 : _l.bindProduct)) ||
|
25
|
-
(((_m = value === null || value === void 0 ? void 0 : value.item) === null || _m === void 0 ? void 0 : _m.type) === 'MultiCommodity' && !((_p = (_o = rec === null || rec === void 0 ? void 0 : rec.video) === null || _o === void 0 ? void 0 : _o.bindProducts) === null || _p === void 0 ? void 0 : _p.length)) ||
|
26
|
-
(((_q = value === null || value === void 0 ? void 0 : value.item) === null || _q === void 0 ? void 0 : _q.type) === 'MultiCommodityDiro' && !((_s = (_r = rec === null || rec === void 0 ? void 0 : rec.video) === null || _r === void 0 ? void 0 : _r.bindProducts) === null || _s === void 0 ? void 0 : _s.length)) ||
|
27
|
-
(((_t = value === null || value === void 0 ? void 0 : value.item) === null || _t === void 0 ? void 0 : _t.type) === 'MultiCommodityDiroNew' && !((_v = (_u = rec === null || rec === void 0 ? void 0 : rec.video) === null || _u === void 0 ? void 0 : _u.bindProducts) === null || _v === void 0 ? void 0 : _v.length))) {
|
28
|
-
return null;
|
29
|
-
}
|
30
|
-
if (value && resolver) {
|
31
|
-
const t = resolver[(_w = value === null || value === void 0 ? void 0 : value.item) === null || _w === void 0 ? void 0 : _w.type];
|
32
|
-
const Component = withBindDataSource(t);
|
33
|
-
const defaulSetting = (_x = t === null || t === void 0 ? void 0 : t.extend) === null || _x === void 0 ? void 0 : _x.defaulSetting;
|
34
|
-
const isExternalLink = ((_0 = (_z = (_y = value === null || value === void 0 ? void 0 : value.item) === null || _y === void 0 ? void 0 : _y.event) === null || _z === void 0 ? void 0 : _z.onClick) === null || _0 === void 0 ? void 0 : _0.linkType) === 'externalLink';
|
35
|
-
return (React.createElement(Component, Object.assign({ style: Object.assign(Object.assign(Object.assign({}, defaulSetting === null || defaulSetting === void 0 ? void 0 : defaulSetting.style), (_1 = value === null || value === void 0 ? void 0 : value.item) === null || _1 === void 0 ? void 0 : _1.style), { zIndex: 50, marginLeft: '20px', boxSizing: 'border-box' }), textStyle: Object.assign(Object.assign({}, defaulSetting === null || defaulSetting === void 0 ? void 0 : defaulSetting.textStyle), (_2 = value === null || value === void 0 ? void 0 : value.item) === null || _2 === void 0 ? void 0 : _2.textStyle), bindDatas: (_4 = (_3 = value === null || value === void 0 ? void 0 : value.item) === null || _3 === void 0 ? void 0 : _3.bindDatas) !== null && _4 !== void 0 ? _4 : [] }, defaulSetting === null || defaulSetting === void 0 ? void 0 : defaulSetting.props, (_5 = value === null || value === void 0 ? void 0 : value.item) === null || _5 === void 0 ? void 0 : _5.props, { event: ((_6 = value === null || value === void 0 ? void 0 : value.item) === null || _6 === void 0 ? void 0 : _6.event) || {}, schema: schema, id: value === null || value === void 0 ? void 0 : value.id, key: value === null || value === void 0 ? void 0 : value.id, recData: rec, isExternalLink: isExternalLink, index: index })));
|
36
|
-
}
|
37
|
-
else {
|
38
|
-
return null;
|
39
|
-
}
|
40
|
-
}, [rec, resolver, tempMap, schema]);
|
41
|
-
return React.createElement(React.Fragment, null, renderComp);
|
42
|
-
};
|
43
|
-
export default memo(RenderCard);
|
@@ -1,10 +0,0 @@
|
|
1
|
-
import React, { CSSProperties } from 'react';
|
2
|
-
interface IToggleButtonProps {
|
3
|
-
activeIcon?: string;
|
4
|
-
unactiveIcon?: string;
|
5
|
-
onChange?: (result: boolean) => void;
|
6
|
-
defaultValue?: boolean;
|
7
|
-
style?: CSSProperties;
|
8
|
-
}
|
9
|
-
declare const _default: React.NamedExoticComponent<IToggleButtonProps>;
|
10
|
-
export default _default;
|
@@ -1,13 +0,0 @@
|
|
1
|
-
import React, { memo, useState } from 'react';
|
2
|
-
const ToggleButton = ({ defaultValue, activeIcon, unactiveIcon, onChange, style }) => {
|
3
|
-
const [isTrue, setIsTure] = useState(defaultValue);
|
4
|
-
const handleClick = (e) => {
|
5
|
-
e.stopPropagation();
|
6
|
-
const result = !isTrue;
|
7
|
-
setIsTure(result);
|
8
|
-
onChange === null || onChange === void 0 ? void 0 : onChange(result);
|
9
|
-
};
|
10
|
-
return (React.createElement("button", { style: style, className: 'pb-toggle-button', onClick: handleClick },
|
11
|
-
React.createElement("img", { className: 'pb-toggle-button-icon', src: isTrue ? activeIcon : unactiveIcon })));
|
12
|
-
};
|
13
|
-
export default memo(ToggleButton);
|
@@ -1,12 +0,0 @@
|
|
1
|
-
import React from 'react';
|
2
|
-
import { RecItemType } from '../typing';
|
3
|
-
interface IVideoWidgetProps {
|
4
|
-
rec: RecItemType;
|
5
|
-
index: number;
|
6
|
-
height: number;
|
7
|
-
data: RecItemType[];
|
8
|
-
muted: boolean;
|
9
|
-
activeIndex?: number;
|
10
|
-
}
|
11
|
-
declare const _default: React.NamedExoticComponent<IVideoWidgetProps>;
|
12
|
-
export default _default;
|
@@ -1,219 +0,0 @@
|
|
1
|
-
import React, { memo, useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
2
|
-
import { useSwiperSlide } from 'swiper/react';
|
3
|
-
import { useIconLink } from '../useIconLink';
|
4
|
-
import { useSxpDataSource } from '../../../../core/hooks';
|
5
|
-
import SXP_EVENT_BUS, { SXP_EVENT_TYPE } from '../../../../core/utils/event';
|
6
|
-
const VideoWidget = ({ rec, index, height, data, muted, activeIndex }) => {
|
7
|
-
const [isPauseVideo, setIsPauseVideo] = useState(false);
|
8
|
-
const videoRef = useRef(null);
|
9
|
-
const { bffEventReport, sxpParameter, waterFallData, openHashtag } = useSxpDataSource();
|
10
|
-
const videoStartTime = useRef(0);
|
11
|
-
const [isLoad, setIsLoad] = useState(false);
|
12
|
-
const { isActive } = useSwiperSlide();
|
13
|
-
useEffect(() => {
|
14
|
-
if (!videoRef.current)
|
15
|
-
return;
|
16
|
-
videoRef.current.muted = muted;
|
17
|
-
}, [muted]);
|
18
|
-
const handleVideoStart = useCallback(() => {
|
19
|
-
var _a;
|
20
|
-
(_a = videoRef.current) === null || _a === void 0 ? void 0 : _a.play();
|
21
|
-
}, []);
|
22
|
-
const PAUSE_ICON = useIconLink('/pb_static/06f28a2025c74c1cb49be6767316d827.png');
|
23
|
-
const handlePlaying = useCallback(() => {
|
24
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
25
|
-
setIsPauseVideo(false);
|
26
|
-
const item = data[index];
|
27
|
-
if (item && isLoad && ((_a = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _a === void 0 ? void 0 : _a.duration)) {
|
28
|
-
videoStartTime.current = ((_b = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _b === void 0 ? void 0 : _b.currentTime) || 0;
|
29
|
-
const videoDuration = ((_d = (_c = videoRef.current) === null || _c === void 0 ? void 0 : _c.duration) !== null && _d !== void 0 ? _d : 0).toFixed(2);
|
30
|
-
const videoCurrentTime = ((_f = (_e = videoRef.current) === null || _e === void 0 ? void 0 : _e.currentTime) !== null && _f !== void 0 ? _f : 0).toFixed(2);
|
31
|
-
const playType = '1';
|
32
|
-
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
33
|
-
eventInfo: {
|
34
|
-
eventSubject: 'playVideo',
|
35
|
-
eventDescription: 'User played the video',
|
36
|
-
contentId: (_h = (_g = item.video) === null || _g === void 0 ? void 0 : _g.itemId) !== null && _h !== void 0 ? _h : '',
|
37
|
-
contentName: (_k = (_j = item.video) === null || _j === void 0 ? void 0 : _j.title) !== null && _k !== void 0 ? _k : '',
|
38
|
-
playType,
|
39
|
-
startTime: videoCurrentTime,
|
40
|
-
videoDuration,
|
41
|
-
contentTags: JSON.stringify((_m = (_l = item.video) === null || _l === void 0 ? void 0 : _l.tags) !== null && _m !== void 0 ? _m : []),
|
42
|
-
position: index + '',
|
43
|
-
contentFormat: 'video',
|
44
|
-
traceInfo: (_o = item.video) === null || _o === void 0 ? void 0 : _o.traceInfo
|
45
|
-
}
|
46
|
-
});
|
47
|
-
}
|
48
|
-
if (!isLoad) {
|
49
|
-
setIsLoad(true);
|
50
|
-
}
|
51
|
-
}, [bffEventReport, data, index, isLoad]);
|
52
|
-
const handleLoadedMetadata = useCallback(() => {
|
53
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
54
|
-
const item = data[index];
|
55
|
-
if (item && !isLoad && ((_a = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _a === void 0 ? void 0 : _a.duration)) {
|
56
|
-
videoStartTime.current = ((_b = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _b === void 0 ? void 0 : _b.currentTime) || 0;
|
57
|
-
const videoDuration = ((_d = (_c = videoRef.current) === null || _c === void 0 ? void 0 : _c.duration) !== null && _d !== void 0 ? _d : 0).toFixed(2);
|
58
|
-
const videoCurrentTime = ((_f = (_e = videoRef.current) === null || _e === void 0 ? void 0 : _e.currentTime) !== null && _f !== void 0 ? _f : 0).toFixed(2);
|
59
|
-
const playType = '0';
|
60
|
-
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
61
|
-
eventInfo: {
|
62
|
-
eventSubject: 'playVideo',
|
63
|
-
eventDescription: 'User played the video',
|
64
|
-
contentId: (_h = (_g = item.video) === null || _g === void 0 ? void 0 : _g.itemId) !== null && _h !== void 0 ? _h : '',
|
65
|
-
contentName: (_k = (_j = item.video) === null || _j === void 0 ? void 0 : _j.title) !== null && _k !== void 0 ? _k : '',
|
66
|
-
playType,
|
67
|
-
startTime: videoCurrentTime,
|
68
|
-
videoDuration,
|
69
|
-
contentTags: JSON.stringify((_m = (_l = item.video) === null || _l === void 0 ? void 0 : _l.tags) !== null && _m !== void 0 ? _m : []),
|
70
|
-
position: index + '',
|
71
|
-
contentFormat: 'video',
|
72
|
-
traceInfo: (_o = item.video) === null || _o === void 0 ? void 0 : _o.traceInfo
|
73
|
-
}
|
74
|
-
});
|
75
|
-
}
|
76
|
-
setTimeout(() => {
|
77
|
-
var _a;
|
78
|
-
(_a = videoRef.current) === null || _a === void 0 ? void 0 : _a.play();
|
79
|
-
}, 0);
|
80
|
-
}, [index, bffEventReport, data, isLoad]);
|
81
|
-
const handleClickVideo = useCallback((type) => () => {
|
82
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
83
|
-
if (!isLoad)
|
84
|
-
return;
|
85
|
-
const item = data[index];
|
86
|
-
const videoDuration = ((_b = (_a = videoRef.current) === null || _a === void 0 ? void 0 : _a.duration) !== null && _b !== void 0 ? _b : 0).toFixed(2);
|
87
|
-
const videoCurrentTime = ((_d = (_c = videoRef.current) === null || _c === void 0 ? void 0 : _c.currentTime) !== null && _d !== void 0 ? _d : 0).toFixed(2);
|
88
|
-
const isPause = (_e = videoRef.current) === null || _e === void 0 ? void 0 : _e.paused;
|
89
|
-
switch (type) {
|
90
|
-
case 'start':
|
91
|
-
if (!isPause)
|
92
|
-
return;
|
93
|
-
(_f = videoRef.current) === null || _f === void 0 ? void 0 : _f.play();
|
94
|
-
setIsPauseVideo(false);
|
95
|
-
break;
|
96
|
-
case 'pause':
|
97
|
-
if (isPause)
|
98
|
-
return;
|
99
|
-
(_g = videoRef.current) === null || _g === void 0 ? void 0 : _g.pause();
|
100
|
-
setIsPauseVideo(true);
|
101
|
-
break;
|
102
|
-
default:
|
103
|
-
if (isPause) {
|
104
|
-
(_h = videoRef.current) === null || _h === void 0 ? void 0 : _h.play();
|
105
|
-
}
|
106
|
-
else {
|
107
|
-
(_j = videoRef.current) === null || _j === void 0 ? void 0 : _j.pause();
|
108
|
-
}
|
109
|
-
setIsPauseVideo(!isPause);
|
110
|
-
break;
|
111
|
-
}
|
112
|
-
}, [data, index, isLoad]);
|
113
|
-
const onPause = useCallback(() => {
|
114
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
115
|
-
const item = data[index];
|
116
|
-
const videoDuration = ((_b = (_a = videoRef.current) === null || _a === void 0 ? void 0 : _a.duration) !== null && _b !== void 0 ? _b : 0).toFixed(2);
|
117
|
-
const videoCurrentTime = ((_d = (_c = videoRef.current) === null || _c === void 0 ? void 0 : _c.currentTime) !== null && _d !== void 0 ? _d : 0).toFixed(2);
|
118
|
-
if ((_e = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _e === void 0 ? void 0 : _e.duration) {
|
119
|
-
const playDuration = (((_f = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _f === void 0 ? void 0 : _f.currentTime) - videoStartTime.current).toFixed(2);
|
120
|
-
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
121
|
-
eventInfo: {
|
122
|
-
eventSubject: 'playOverVideo',
|
123
|
-
eventDescription: 'User finished playing the video',
|
124
|
-
contentId: (_h = (_g = item.video) === null || _g === void 0 ? void 0 : _g.itemId) !== null && _h !== void 0 ? _h : '',
|
125
|
-
contentName: (_k = (_j = item.video) === null || _j === void 0 ? void 0 : _j.title) !== null && _k !== void 0 ? _k : '',
|
126
|
-
endTime: videoCurrentTime,
|
127
|
-
videoDuration,
|
128
|
-
playDuration,
|
129
|
-
contentTags: JSON.stringify((_m = (_l = item.video) === null || _l === void 0 ? void 0 : _l.tags) !== null && _m !== void 0 ? _m : []),
|
130
|
-
position: index + '',
|
131
|
-
contentFormat: 'video',
|
132
|
-
traceInfo: (_o = item.video) === null || _o === void 0 ? void 0 : _o.traceInfo
|
133
|
-
}
|
134
|
-
});
|
135
|
-
}
|
136
|
-
}, [data, index, bffEventReport]);
|
137
|
-
useEffect(() => {
|
138
|
-
var _a, _b, _c;
|
139
|
-
if (data.length <= 0)
|
140
|
-
return;
|
141
|
-
if (!videoRef.current)
|
142
|
-
return;
|
143
|
-
setIsPauseVideo(false);
|
144
|
-
if (!isActive) {
|
145
|
-
(_a = videoRef.current) === null || _a === void 0 ? void 0 : _a.pause();
|
146
|
-
return;
|
147
|
-
}
|
148
|
-
if (!videoRef.current.src) {
|
149
|
-
const videoSrc = rec.video.url;
|
150
|
-
videoRef.current.src = videoSrc;
|
151
|
-
videoRef.current.setAttribute('x5-playsinline', 'true');
|
152
|
-
videoRef.current.setAttribute('webkit-playsinline', 'true');
|
153
|
-
}
|
154
|
-
else {
|
155
|
-
videoRef.current.play();
|
156
|
-
}
|
157
|
-
(_b = videoRef.current) === null || _b === void 0 ? void 0 : _b.addEventListener('canplay', handleLoadedMetadata);
|
158
|
-
(_c = videoRef.current) === null || _c === void 0 ? void 0 : _c.addEventListener('playing', handlePlaying);
|
159
|
-
return () => {
|
160
|
-
var _a, _b;
|
161
|
-
(_a = videoRef.current) === null || _a === void 0 ? void 0 : _a.removeEventListener('canplay', handleLoadedMetadata);
|
162
|
-
(_b = videoRef.current) === null || _b === void 0 ? void 0 : _b.removeEventListener('playing', handlePlaying);
|
163
|
-
};
|
164
|
-
}, [data, handleLoadedMetadata, handlePlaying, isActive, isLoad, rec.video]);
|
165
|
-
useEffect(() => {
|
166
|
-
var _a, _b, _c;
|
167
|
-
const isPause = (_a = videoRef.current) === null || _a === void 0 ? void 0 : _a.paused;
|
168
|
-
if (!isActive)
|
169
|
-
return;
|
170
|
-
if (!isPause && openHashtag) {
|
171
|
-
(_b = videoRef.current) === null || _b === void 0 ? void 0 : _b.pause();
|
172
|
-
}
|
173
|
-
else if (!openHashtag) {
|
174
|
-
(_c = videoRef.current) === null || _c === void 0 ? void 0 : _c.play();
|
175
|
-
}
|
176
|
-
}, [openHashtag, isActive]);
|
177
|
-
useEffect(() => {
|
178
|
-
if (!isActive)
|
179
|
-
return;
|
180
|
-
const onShow = handleClickVideo('start');
|
181
|
-
const onHide = handleClickVideo('pause');
|
182
|
-
SXP_EVENT_BUS.on(SXP_EVENT_TYPE.PAGE_DID_SHOW, onShow);
|
183
|
-
SXP_EVENT_BUS.on(SXP_EVENT_TYPE.PAGE_DID_HIDE, onHide);
|
184
|
-
return () => {
|
185
|
-
SXP_EVENT_BUS.off(SXP_EVENT_TYPE.PAGE_DID_SHOW, onShow);
|
186
|
-
SXP_EVENT_BUS.off(SXP_EVENT_TYPE.PAGE_DID_HIDE, onHide);
|
187
|
-
};
|
188
|
-
}, [handleClickVideo, isActive]);
|
189
|
-
const renderPoster = useMemo(() => {
|
190
|
-
if (!(sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.placeholder_image)) {
|
191
|
-
return null;
|
192
|
-
}
|
193
|
-
return (React.createElement("img", { hidden: isLoad, style: { position: 'absolute', left: 0, top: 0, width: '100%', height: '100%', objectFit: 'cover' }, src: sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.placeholder_image }));
|
194
|
-
}, [isLoad, sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.placeholder_image]);
|
195
|
-
useEffect(() => {
|
196
|
-
const handleBeforeUnload = () => {
|
197
|
-
var _a, _b;
|
198
|
-
if (activeIndex === index && ((_a = rec === null || rec === void 0 ? void 0 : rec.video) === null || _a === void 0 ? void 0 : _a.url) && ((_b = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _b === void 0 ? void 0 : _b.src) && !isPauseVideo) {
|
199
|
-
handleClickVideo('pause')();
|
200
|
-
}
|
201
|
-
};
|
202
|
-
window.addEventListener('beforeunload', handleBeforeUnload);
|
203
|
-
return () => {
|
204
|
-
window.removeEventListener('beforeunload', handleBeforeUnload);
|
205
|
-
};
|
206
|
-
}, [activeIndex, index, rec, videoRef, handleClickVideo, isPauseVideo]);
|
207
|
-
if (!rec.video) {
|
208
|
-
return null;
|
209
|
-
}
|
210
|
-
return (React.createElement("div", { className: 'video-container', key: rec.video.itemId, onClick: handleClickVideo(), style: {
|
211
|
-
position: 'relative',
|
212
|
-
width: '100%',
|
213
|
-
height
|
214
|
-
} },
|
215
|
-
React.createElement("video", { id: `pb-video-${index}`, className: 'clc-pb-video', ref: videoRef, poster: sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.placeholder_image, muted: true, controls: false, playsInline: true, preload: 'auto', onPause: onPause, onEnded: handleVideoStart }),
|
216
|
-
renderPoster,
|
217
|
-
React.createElement("img", { hidden: !isPauseVideo, className: 'clc-pb-video-pause', src: PAUSE_ICON })));
|
218
|
-
};
|
219
|
-
export default memo(VideoWidget);
|