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,83 +0,0 @@
|
|
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 };
|
@@ -1,147 +0,0 @@
|
|
1
|
-
import React, { forwardRef, useCallback, useEffect, useImperativeHandle, useState, useMemo } from 'react';
|
2
|
-
import { cloneDeep } from 'lodash';
|
3
|
-
import DataSourceProvider from './DataSourceProvider';
|
4
|
-
import { uuid } from '../../core/utils/tool';
|
5
|
-
const item = {
|
6
|
-
id: uuid(6, 10),
|
7
|
-
item: {
|
8
|
-
type: 'common',
|
9
|
-
h: 300,
|
10
|
-
category: 'block',
|
11
|
-
displayName: 'block',
|
12
|
-
isFirstLayout: true,
|
13
|
-
w: 1000
|
14
|
-
},
|
15
|
-
point: {
|
16
|
-
i: 'x-0',
|
17
|
-
x: -38.34375,
|
18
|
-
y: 0,
|
19
|
-
w: 1000,
|
20
|
-
h: 300,
|
21
|
-
isBounded: true,
|
22
|
-
actualX: 0,
|
23
|
-
actualY: 0
|
24
|
-
},
|
25
|
-
pathArr: [0],
|
26
|
-
positionY: 0
|
27
|
-
};
|
28
|
-
const popupInit = {
|
29
|
-
id: '',
|
30
|
-
duration: 0,
|
31
|
-
name: 'none'
|
32
|
-
};
|
33
|
-
export const EditorContext = React.createContext({
|
34
|
-
resolver: {},
|
35
|
-
currentNode: null,
|
36
|
-
schema: {
|
37
|
-
pointData: [],
|
38
|
-
dataSource: [],
|
39
|
-
mobilePiontData: [],
|
40
|
-
type: 'PC',
|
41
|
-
pcPiontData: [],
|
42
|
-
pageInfo: {},
|
43
|
-
pcPageConf: {},
|
44
|
-
mobilePageConf: {},
|
45
|
-
__STORE__: {},
|
46
|
-
sxpPageConf: {}
|
47
|
-
},
|
48
|
-
pageInfoData: {},
|
49
|
-
prePiontData: [],
|
50
|
-
undoStack: [item],
|
51
|
-
redoStack: [],
|
52
|
-
popup: popupInit,
|
53
|
-
setPopup: () => { }
|
54
|
-
});
|
55
|
-
const EditorCore = forwardRef(({ children, resolver, isSsr, schema, enableDataSource = true, utmVal }, ref) => {
|
56
|
-
const [currentNode, setCurrentNode] = useState(null);
|
57
|
-
const [_schema, setSchema] = useState(schema || {
|
58
|
-
pointData: [item],
|
59
|
-
dataSource: [],
|
60
|
-
mobilePiontData: [],
|
61
|
-
type: 'PC',
|
62
|
-
pcPiontData: [],
|
63
|
-
pageInfo: {},
|
64
|
-
pcPageConf: {},
|
65
|
-
mobilePageConf: {},
|
66
|
-
sxpPageConf: {}
|
67
|
-
});
|
68
|
-
const [prePiontData, setPrePiontData] = useState([item]);
|
69
|
-
const [undoStack, setUndoStack] = useState([[item]]);
|
70
|
-
const [redoStack, setRedoStack] = useState([]);
|
71
|
-
const [popup, setPopup] = useState(popupInit);
|
72
|
-
typeof window !== 'undefined' &&
|
73
|
-
(window.sxpPopup = (type, aniType) => {
|
74
|
-
setPopup(Object.assign(Object.assign(Object.assign({}, popupInit), { id: type }), aniType));
|
75
|
-
});
|
76
|
-
typeof window !== 'undefined' &&
|
77
|
-
(window.getJointUtmLink = (url) => {
|
78
|
-
if ((url === null || url === void 0 ? void 0 : url.indexOf('?')) !== -1) {
|
79
|
-
return url + (utmVal ? '&' + utmVal : '');
|
80
|
-
}
|
81
|
-
else {
|
82
|
-
return url + (utmVal ? '?' + utmVal : '');
|
83
|
-
}
|
84
|
-
});
|
85
|
-
useEffect(() => {
|
86
|
-
setUndoStack([_schema.pointData]);
|
87
|
-
setRedoStack([]);
|
88
|
-
}, [_schema.type]);
|
89
|
-
const saveDataSource = useCallback((dataSource) => {
|
90
|
-
const schema = cloneDeep(_schema);
|
91
|
-
if (!schema)
|
92
|
-
return;
|
93
|
-
schema.dataSource = dataSource;
|
94
|
-
setSchema === null || setSchema === void 0 ? void 0 : setSchema(schema);
|
95
|
-
}, [_schema]);
|
96
|
-
const [_pageInfoData, _setPageInfoData] = useState();
|
97
|
-
useImperativeHandle(ref, () => ({
|
98
|
-
loadSchema(schema) {
|
99
|
-
if (schema) {
|
100
|
-
setUndoStack([schema.pointData]);
|
101
|
-
setSchema(schema);
|
102
|
-
}
|
103
|
-
},
|
104
|
-
exportSchema() {
|
105
|
-
return cloneDeep(_schema);
|
106
|
-
},
|
107
|
-
getPageInfoData() {
|
108
|
-
return _pageInfoData;
|
109
|
-
},
|
110
|
-
initPageInfoData(pageData) {
|
111
|
-
if (pageData) {
|
112
|
-
_setPageInfoData(pageData);
|
113
|
-
}
|
114
|
-
}
|
115
|
-
}));
|
116
|
-
const getCurPageConf = useMemo(() => {
|
117
|
-
if (!_schema)
|
118
|
-
return;
|
119
|
-
if (_schema.type === 'PC') {
|
120
|
-
return _schema.pcPageConf;
|
121
|
-
}
|
122
|
-
else {
|
123
|
-
return _schema.mobilePageConf;
|
124
|
-
}
|
125
|
-
}, [_schema]);
|
126
|
-
return (React.createElement(EditorContext.Provider, { value: {
|
127
|
-
resolver,
|
128
|
-
currentNode,
|
129
|
-
schema: _schema,
|
130
|
-
setCurrentNode,
|
131
|
-
setSchema,
|
132
|
-
saveDataSource,
|
133
|
-
prePiontData,
|
134
|
-
setPrePiontData,
|
135
|
-
pageInfoData: _pageInfoData,
|
136
|
-
setPageInfoData: (params) => _setPageInfoData(Object.assign(Object.assign({}, _pageInfoData), params)),
|
137
|
-
undoStack,
|
138
|
-
redoStack,
|
139
|
-
setRedoStack,
|
140
|
-
setUndoStack,
|
141
|
-
getCurPageConf,
|
142
|
-
popup,
|
143
|
-
setPopup
|
144
|
-
} },
|
145
|
-
React.createElement(DataSourceProvider, { isSsr: isSsr, enable: enableDataSource }, children)));
|
146
|
-
});
|
147
|
-
export { EditorCore };
|
@@ -1,20 +0,0 @@
|
|
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;
|
@@ -1,23 +0,0 @@
|
|
1
|
-
import React, { createContext, useContext, useState } from 'react';
|
2
|
-
const EditorDataContext = createContext({});
|
3
|
-
const EditorDataProvider = ({ children, data }) => {
|
4
|
-
var _a, _b, _c, _d, _e, _f;
|
5
|
-
const [openHashtag, setOpenHashtag] = useState(false);
|
6
|
-
return (React.createElement(EditorDataContext.Provider, { value: {
|
7
|
-
sxpPrameter: {
|
8
|
-
bottomImage: (_a = data === null || data === void 0 ? void 0 : data.sxp_parameter) === null || _a === void 0 ? void 0 : _a.bottom_image,
|
9
|
-
defaultRecommend: (_b = data === null || data === void 0 ? void 0 : data.sxp_parameter) === null || _b === void 0 ? void 0 : _b.default_recommend,
|
10
|
-
personalizedRecommend: (_c = data === null || data === void 0 ? void 0 : data.sxp_parameter) === null || _c === void 0 ? void 0 : _c.personalized_recommend,
|
11
|
-
placeholderImage: (_d = data === null || data === void 0 ? void 0 : data.sxp_parameter) === null || _d === void 0 ? void 0 : _d.placeholder_image,
|
12
|
-
hashTagSize: (_e = data === null || data === void 0 ? void 0 : data.sxp_parameter) === null || _e === void 0 ? void 0 : _e.hash_tag_size,
|
13
|
-
loadingImage: (_f = data === null || data === void 0 ? void 0 : data.sxp_parameter) === null || _f === void 0 ? void 0 : _f.loading_image
|
14
|
-
},
|
15
|
-
appDomain: data === null || data === void 0 ? void 0 : data.appDomain,
|
16
|
-
openHashtag,
|
17
|
-
setOpenHashtag
|
18
|
-
} }, children));
|
19
|
-
};
|
20
|
-
export function useEditorDataProvider() {
|
21
|
-
return useContext(EditorDataContext);
|
22
|
-
}
|
23
|
-
export default EditorDataProvider;
|
@@ -1,94 +0,0 @@
|
|
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;
|
@@ -1,208 +0,0 @@
|
|
1
|
-
import { __awaiter } from "tslib";
|
2
|
-
import React, { createContext, memo, useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
3
|
-
import qs from 'qs';
|
4
|
-
import { storeAndLoadFeSessionId } from '../utils/sessionStore';
|
5
|
-
import { storeAndLoadFeUserId } from '../utils/localStore';
|
6
|
-
import { useIconLink } from '../components/SxpPageRender/useIconLink';
|
7
|
-
export const SxpDataSourceContext = createContext({
|
8
|
-
rtcList: []
|
9
|
-
});
|
10
|
-
var DataSourceType;
|
11
|
-
(function (DataSourceType) {
|
12
|
-
DataSourceType[DataSourceType["BFF"] = 5] = "BFF";
|
13
|
-
})(DataSourceType || (DataSourceType = {}));
|
14
|
-
const UTM_KEYS = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_id', 'utm_content', 'cl_source'];
|
15
|
-
const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent = true, maxSize, defaultSize, isPreview = false, sxpParameter, appDomain, hashTagSize, loadingImage, isOpenHashTag = false }) => {
|
16
|
-
const [rtcList, setRtcList] = useState([]);
|
17
|
-
const [loading, setLoading] = useState(false);
|
18
|
-
const [curReqInfo, setCurReqInfo] = useState({ rtc: '', requestId: '' });
|
19
|
-
const swiperRef = useRef(null);
|
20
|
-
const isInit = useRef(false);
|
21
|
-
const [popupDetailData, setPopupDetailData] = useState();
|
22
|
-
const [waterFallData, setWaterFallData] = useState();
|
23
|
-
const [openHashtag, setOpenHashtag] = useState(isOpenHashTag);
|
24
|
-
const [cacheRtcList, setCacheRtcList] = useState([]);
|
25
|
-
const [cacheActiveIndex, setCacheActiveIndex] = useState(0);
|
26
|
-
const [isFromHashtag, setIsFromHashtag] = useState(false);
|
27
|
-
useEffect(() => {
|
28
|
-
setOpenHashtag(isOpenHashTag);
|
29
|
-
}, [isOpenHashTag]);
|
30
|
-
const bffDataSource = useMemo(() => {
|
31
|
-
return dataSources === null || dataSources === void 0 ? void 0 : dataSources.find((d) => d.type === DataSourceType.BFF);
|
32
|
-
}, [dataSources]);
|
33
|
-
const bffFetch = useCallback((path, options) => {
|
34
|
-
if (!bffDataSource)
|
35
|
-
return;
|
36
|
-
const url = bffDataSource.url;
|
37
|
-
const fakeUserId = storeAndLoadFeUserId();
|
38
|
-
if (options === null || options === void 0 ? void 0 : options.query) {
|
39
|
-
const queryString = qs.stringify(options.query);
|
40
|
-
path = `${path}?${queryString}`;
|
41
|
-
}
|
42
|
-
if (options.type === 'beacon' && navigator.sendBeacon) {
|
43
|
-
return navigator.sendBeacon(`${url}/api/v1${path}`, new Blob([
|
44
|
-
JSON.stringify(Object.assign(Object.assign(Object.assign({}, bffDataSource.headers), { 'x-user-id': fakeUserId }), options.body))
|
45
|
-
], { type: 'application/json;charset=UTF-8' }));
|
46
|
-
}
|
47
|
-
return window
|
48
|
-
.fetch(`${url}/api/v1${path}`, {
|
49
|
-
headers: Object.assign({ 'Content-Type': 'application/json', 'x-user-id': fakeUserId }, bffDataSource.headers),
|
50
|
-
method: options.method,
|
51
|
-
body: JSON.stringify(options.body)
|
52
|
-
})
|
53
|
-
.then((res) => res.json())
|
54
|
-
.catch((err) => Promise.reject(err));
|
55
|
-
}, [bffDataSource]);
|
56
|
-
const getRecommendVideos = useCallback((query) => __awaiter(void 0, void 0, void 0, function* () {
|
57
|
-
var _a, _b, _c, _d;
|
58
|
-
query = {
|
59
|
-
maxSize,
|
60
|
-
defaultSize: (_a = query === null || query === void 0 ? void 0 : query.defaultSize) !== null && _a !== void 0 ? _a : defaultSize,
|
61
|
-
'itemFilter.itemId': query === null || query === void 0 ? void 0 : query['itemFilter.itemId'],
|
62
|
-
'itemFilter.itemType': query === null || query === void 0 ? void 0 : query['itemFilter.itemType'],
|
63
|
-
hashTag: query === null || query === void 0 ? void 0 : query.hashTag,
|
64
|
-
traceInfo: query === null || query === void 0 ? void 0 : query.traceInfo
|
65
|
-
};
|
66
|
-
if (utmVal) {
|
67
|
-
const val = (_d = (_c = (_b = utmVal === null || utmVal === void 0 ? void 0 : utmVal.split('&')) === null || _b === void 0 ? void 0 : _b.filter((val) => {
|
68
|
-
const key = val.split('=')[0];
|
69
|
-
return UTM_KEYS.includes(key);
|
70
|
-
})) === null || _c === void 0 ? void 0 : _c.join('&')) !== null && _d !== void 0 ? _d : '';
|
71
|
-
query = Object.assign(Object.assign({}, query), { channel: decodeURIComponent(val) });
|
72
|
-
}
|
73
|
-
const result = yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('/recommend/list', { method: 'GET', query }));
|
74
|
-
if (!(result === null || result === void 0 ? void 0 : result.success)) {
|
75
|
-
return undefined;
|
76
|
-
}
|
77
|
-
if (!(query === null || query === void 0 ? void 0 : query.hashTag))
|
78
|
-
setCurReqInfo({ rtc: result.data.rtc, requestId: result.data.requestId });
|
79
|
-
return result === null || result === void 0 ? void 0 : result.data;
|
80
|
-
}), [bffFetch, utmVal, maxSize, defaultSize]);
|
81
|
-
const loadVideos = useCallback(() => __awaiter(void 0, void 0, void 0, function* () {
|
82
|
-
var _e, _f;
|
83
|
-
if (rtcList.length <= 0) {
|
84
|
-
return;
|
85
|
-
}
|
86
|
-
const data = yield getRecommendVideos({
|
87
|
-
hashTag: waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.hashTag,
|
88
|
-
'itemFilter.itemId': waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.itemId,
|
89
|
-
'itemFilter.itemType': waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.itemType
|
90
|
-
});
|
91
|
-
setRtcList(rtcList.concat((_e = data === null || data === void 0 ? void 0 : data.recList) !== null && _e !== void 0 ? _e : []));
|
92
|
-
setCacheRtcList(cacheRtcList.concat((_f = data === null || data === void 0 ? void 0 : data.recList) !== null && _f !== void 0 ? _f : []));
|
93
|
-
}), [getRecommendVideos, rtcList, waterFallData, cacheRtcList]);
|
94
|
-
const bffEventReport = useCallback(({ userInfo, eventInfo }) => {
|
95
|
-
if (!enableReportEvent) {
|
96
|
-
return;
|
97
|
-
}
|
98
|
-
if (!userInfo) {
|
99
|
-
userInfo = {};
|
100
|
-
}
|
101
|
-
const sessionID = storeAndLoadFeSessionId();
|
102
|
-
const ef = Object.assign({ sessionID, rtc: curReqInfo.rtc, requestId: curReqInfo.requestId }, eventInfo);
|
103
|
-
const realUserInfo = Object.entries(userInfo).map(([k, v]) => ({ name: k, value: v }));
|
104
|
-
const realEventInfo = Object.entries(ef)
|
105
|
-
.map(([k, v]) => v && { name: k, value: v })
|
106
|
-
.filter(Boolean);
|
107
|
-
console.log('======== 事件上报 ========');
|
108
|
-
console.log('userInfo:', userInfo);
|
109
|
-
console.log('eventInfo:', ef);
|
110
|
-
console.log('========= 结束 =========');
|
111
|
-
return bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('/event/report', {
|
112
|
-
method: 'POST',
|
113
|
-
body: { userInfo: realUserInfo, eventInfo: realEventInfo },
|
114
|
-
type: 'beacon'
|
115
|
-
});
|
116
|
-
}, [bffFetch, curReqInfo, enableReportEvent]);
|
117
|
-
const bffMutateLike = useCallback((body) => __awaiter(void 0, void 0, void 0, function* () {
|
118
|
-
const res = yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('/recommend/like', { method: 'POST', body }));
|
119
|
-
return res === null || res === void 0 ? void 0 : res.success;
|
120
|
-
}), [bffFetch]);
|
121
|
-
const bffMutateUnlike = useCallback((body) => __awaiter(void 0, void 0, void 0, function* () {
|
122
|
-
const res = yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('/recommend/unlike', { method: 'POST', body }));
|
123
|
-
return res === null || res === void 0 ? void 0 : res.success;
|
124
|
-
}), [bffFetch]);
|
125
|
-
const bffSubmitForm = useCallback((body) => __awaiter(void 0, void 0, void 0, function* () {
|
126
|
-
const res = yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('/customform', { method: 'POST', body }));
|
127
|
-
return res === null || res === void 0 ? void 0 : res.success;
|
128
|
-
}), [bffFetch]);
|
129
|
-
const ctaEvent = useCallback((eventInfo, rec, product, position) => {
|
130
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
131
|
-
const cta = product === null || product === void 0 ? void 0 : product.bindCta;
|
132
|
-
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);
|
133
|
-
let fromKName = '';
|
134
|
-
if (isFromHashtag) {
|
135
|
-
fromKName = 'hashTagPage';
|
136
|
-
}
|
137
|
-
else if ((_e = rec === null || rec === void 0 ? void 0 : rec.video) === null || _e === void 0 ? void 0 : _e.url) {
|
138
|
-
fromKName = 'videoPage';
|
139
|
-
}
|
140
|
-
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) {
|
141
|
-
fromKName = 'imagePage';
|
142
|
-
}
|
143
|
-
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
144
|
-
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 })
|
145
|
-
});
|
146
|
-
}, [bffEventReport, isFromHashtag]);
|
147
|
-
useEffect(() => {
|
148
|
-
setLoading(true);
|
149
|
-
getRecommendVideos()
|
150
|
-
.then((data) => {
|
151
|
-
var _a, _b;
|
152
|
-
setRtcList((_a = data === null || data === void 0 ? void 0 : data.recList) !== null && _a !== void 0 ? _a : []);
|
153
|
-
setCacheRtcList((_b = data === null || data === void 0 ? void 0 : data.recList) !== null && _b !== void 0 ? _b : []);
|
154
|
-
})
|
155
|
-
.finally(() => {
|
156
|
-
setLoading(false);
|
157
|
-
isInit.current = true;
|
158
|
-
});
|
159
|
-
}, []);
|
160
|
-
useEffect(() => {
|
161
|
-
if (!isInit.current)
|
162
|
-
return;
|
163
|
-
setLoading(true);
|
164
|
-
getRecommendVideos()
|
165
|
-
.then((data) => {
|
166
|
-
var _a, _b;
|
167
|
-
setRtcList((_a = data === null || data === void 0 ? void 0 : data.recList) !== null && _a !== void 0 ? _a : []);
|
168
|
-
setCacheRtcList((_b = data === null || data === void 0 ? void 0 : data.recList) !== null && _b !== void 0 ? _b : []);
|
169
|
-
})
|
170
|
-
.finally(() => {
|
171
|
-
setLoading(false);
|
172
|
-
});
|
173
|
-
}, [getRecommendVideos]);
|
174
|
-
const defaultLoadingImage = useIconLink('/pb_static/a65d23c5893c49d7aaaa81681d3179e2.gif', appDomain);
|
175
|
-
return (React.createElement(SxpDataSourceContext.Provider, { value: {
|
176
|
-
rtcList,
|
177
|
-
setRtcList,
|
178
|
-
mutateLike: bffMutateLike,
|
179
|
-
mutateUnlike: bffMutateUnlike,
|
180
|
-
submitForm: bffSubmitForm,
|
181
|
-
popupDetailData,
|
182
|
-
loadVideos,
|
183
|
-
setPopupDetailData,
|
184
|
-
getRecommendVideos,
|
185
|
-
bffEventReport,
|
186
|
-
utmVal,
|
187
|
-
isPreview,
|
188
|
-
loading,
|
189
|
-
sxpParameter,
|
190
|
-
waterFallData,
|
191
|
-
setWaterFallData,
|
192
|
-
ctaEvent,
|
193
|
-
swiperRef,
|
194
|
-
openHashtag,
|
195
|
-
setOpenHashtag,
|
196
|
-
cacheRtcList,
|
197
|
-
setCacheRtcList,
|
198
|
-
cacheActiveIndex,
|
199
|
-
setCacheActiveIndex,
|
200
|
-
isFromHashtag,
|
201
|
-
setIsFromHashtag,
|
202
|
-
appDomain,
|
203
|
-
hashTagSize,
|
204
|
-
loadingImage: loadingImage !== null && loadingImage !== void 0 ? loadingImage : defaultLoadingImage,
|
205
|
-
isOpenHashTag
|
206
|
-
} }, render({ rtcList, mutateLike: bffMutateLike, mutateUnlike: bffMutateUnlike, submitForm: bffSubmitForm })));
|
207
|
-
};
|
208
|
-
export default memo(SxpDataSourceProvider);
|
package/es/core/create.d.ts
DELETED
@@ -1,37 +0,0 @@
|
|
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 {};
|
package/es/core/create.js
DELETED