@antscorp/antsomi-ui 1.3.4 → 1.3.5-beta.2
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/es/assets/css/main.scss +6 -0
- package/es/assets/images/iphone-top-bar.png +0 -0
- package/es/assets/images/iphone.png +0 -0
- package/es/assets/images/stars_slider.png +0 -0
- package/es/components/atoms/Empty/Empty.d.ts +6 -5
- package/es/components/atoms/Empty/Empty.js +7 -1
- package/es/components/atoms/Flex/Flex.d.ts +2 -0
- package/es/components/atoms/Flex/Flex.js +1 -0
- package/es/components/atoms/Flex/index.d.ts +1 -0
- package/es/components/atoms/Flex/index.js +1 -0
- package/es/components/atoms/Input/Input.d.ts +14 -3
- package/es/components/atoms/Input/Input.js +7 -3
- package/es/components/atoms/InputDynamic/EditCaretPositioning.d.ts +2 -0
- package/es/components/atoms/InputDynamic/EditCaretPositioning.js +89 -0
- package/es/components/atoms/InputDynamic/InputDynamic.d.ts +10 -0
- package/es/components/atoms/InputDynamic/InputDynamic.js +516 -0
- package/es/components/atoms/InputDynamic/PopupShortLink.d.ts +16 -0
- package/es/components/atoms/InputDynamic/PopupShortLink.js +85 -0
- package/es/components/atoms/InputDynamic/constants.d.ts +71 -0
- package/es/components/atoms/InputDynamic/constants.js +71 -0
- package/es/components/atoms/InputDynamic/index.d.ts +2 -0
- package/es/components/atoms/InputDynamic/index.js +1 -0
- package/es/components/atoms/InputDynamic/styled.d.ts +13 -0
- package/es/components/atoms/InputDynamic/styled.js +293 -0
- package/es/components/atoms/InputDynamic/types.d.ts +116 -0
- package/es/components/atoms/InputDynamic/types.js +1 -0
- package/es/components/atoms/InputDynamic/utils.d.ts +30 -0
- package/es/components/atoms/InputDynamic/utils.js +874 -0
- package/es/components/atoms/MobileFrame/MobileFrame.d.ts +4 -0
- package/es/components/atoms/MobileFrame/MobileFrame.js +22 -0
- package/es/components/atoms/MobileFrame/constants.d.ts +4 -0
- package/es/components/atoms/MobileFrame/constants.js +4 -0
- package/es/components/atoms/MobileFrame/index.d.ts +2 -0
- package/es/components/atoms/MobileFrame/index.js +1 -0
- package/es/components/atoms/MobileFrame/styled.d.ts +3 -0
- package/es/components/atoms/MobileFrame/styled.js +33 -0
- package/es/components/atoms/Pagination/index.d.ts +1 -0
- package/es/components/atoms/Popover/styled.d.ts +4 -0
- package/es/components/atoms/Popover/styled.js +5 -0
- package/es/components/atoms/PreviewTabs/PreviewTabs.d.ts +7 -0
- package/es/components/atoms/PreviewTabs/PreviewTabs.js +67 -0
- package/es/components/atoms/PreviewTabs/index.d.ts +2 -0
- package/es/components/atoms/PreviewTabs/index.js +1 -0
- package/es/components/atoms/PreviewTabs/styled.d.ts +6 -0
- package/es/components/atoms/PreviewTabs/styled.js +79 -0
- package/es/components/atoms/RateV2/RateV2.d.ts +18 -0
- package/es/components/atoms/RateV2/RateV2.js +73 -0
- package/es/components/atoms/RateV2/index.d.ts +1 -0
- package/es/components/atoms/RateV2/index.js +1 -0
- package/es/components/atoms/RequiredLabel/index.d.ts +1 -0
- package/es/components/atoms/RequiredLabel/index.js +4 -3
- package/es/components/atoms/SlideBar/SlideBar.d.ts +34 -0
- package/es/components/atoms/SlideBar/SlideBar.js +283 -0
- package/es/components/atoms/SlideBar/constants.d.ts +10 -0
- package/es/components/atoms/SlideBar/constants.js +10 -0
- package/es/components/atoms/SlideBar/index.d.ts +1 -0
- package/es/components/atoms/SlideBar/index.js +1 -0
- package/es/components/atoms/SlideBar/styled.d.ts +20 -0
- package/es/components/atoms/SlideBar/styled.js +136 -0
- package/es/components/atoms/Slider/index.d.ts +2 -1
- package/es/components/atoms/Slider/index.js +14 -16
- package/es/components/atoms/SliderV2/index.d.ts +6 -0
- package/es/components/atoms/SliderV2/index.js +21 -0
- package/es/components/atoms/Spin/Spin.d.ts +2 -1
- package/es/components/atoms/index.d.ts +10 -0
- package/es/components/atoms/index.js +8 -0
- package/es/components/common/ConfigProvider/ConfigProvider.d.ts +2 -0
- package/es/components/common/ConfigProvider/ConfigProvider.js +14 -0
- package/es/components/common/ConfigProvider/GlobalStyle.js +310 -27
- package/es/components/icons/ArrowGrowIcon.d.ts +2 -1
- package/es/components/icons/AudioRecordIcon.d.ts +2 -1
- package/es/components/icons/BugIcon.d.ts +2 -1
- package/es/components/icons/CameraIcon.d.ts +2 -1
- package/es/components/icons/CaptureIcon.d.ts +2 -1
- package/es/components/icons/CheckSlimIcon.d.ts +2 -1
- package/es/components/icons/CloseIcon.d.ts +2 -1
- package/es/components/icons/CommentIcon.d.ts +2 -1
- package/es/components/icons/EventIcon.d.ts +2 -1
- package/es/components/icons/FreeDrawIcon.d.ts +2 -1
- package/es/components/icons/GPTIcon.d.ts +2 -1
- package/es/components/icons/GPTIconV2.d.ts +2 -1
- package/es/components/icons/GPTIconV3.d.ts +2 -1
- package/es/components/icons/HighlightIcon.d.ts +2 -1
- package/es/components/icons/IdeaIcon.d.ts +2 -1
- package/es/components/icons/InvisibleIcon.d.ts +2 -1
- package/es/components/icons/MuteIcon.d.ts +2 -1
- package/es/components/icons/OpenUrlIcon.d.ts +2 -1
- package/es/components/icons/PauseIcon.d.ts +2 -1
- package/es/components/icons/PlaneIcon.d.ts +2 -1
- package/es/components/icons/RequestIcon.d.ts +2 -1
- package/es/components/icons/StopRecordIcon.d.ts +2 -1
- package/es/components/icons/UserIcon.d.ts +2 -1
- package/es/components/icons/VerticalDotsIcon.d.ts +2 -1
- package/es/components/icons/WarningIcon.d.ts +2 -1
- package/es/components/index.d.ts +1 -0
- package/es/components/index.js +1 -0
- package/es/components/molecules/AddDynamicContent/AddDynamicContent.d.ts +35 -0
- package/es/components/molecules/AddDynamicContent/AddDynamicContent.js +1248 -0
- package/es/components/molecules/AddDynamicContent/components/DisplayFormat/DisplayFormat.d.ts +12 -0
- package/es/components/molecules/AddDynamicContent/components/DisplayFormat/DisplayFormat.js +25 -0
- package/es/components/molecules/AddDynamicContent/components/DisplayFormat/index.d.ts +3 -0
- package/es/components/molecules/AddDynamicContent/components/DisplayFormat/index.js +3 -0
- package/es/components/molecules/AddDynamicContent/components/FormatDatetime/FormatDatetime.d.ts +19 -0
- package/es/components/molecules/AddDynamicContent/components/FormatDatetime/FormatDatetime.js +100 -0
- package/es/components/molecules/AddDynamicContent/components/FormatDatetime/index.d.ts +1 -0
- package/es/components/molecules/AddDynamicContent/components/FormatDatetime/index.js +1 -0
- package/es/components/molecules/AddDynamicContent/components/FormatNumber/FormatNumber.d.ts +52 -0
- package/es/components/molecules/AddDynamicContent/components/FormatNumber/FormatNumber.js +132 -0
- package/es/components/molecules/AddDynamicContent/components/FormatNumber/index.d.ts +1 -0
- package/es/components/molecules/AddDynamicContent/components/FormatNumber/index.js +1 -0
- package/es/components/molecules/AddDynamicContent/components/index.d.ts +3 -0
- package/es/components/molecules/AddDynamicContent/components/index.js +3 -0
- package/es/components/molecules/AddDynamicContent/constants.d.ts +101 -0
- package/es/components/molecules/AddDynamicContent/constants.js +152 -0
- package/es/components/molecules/AddDynamicContent/currencies.json +1523 -0
- package/es/components/molecules/AddDynamicContent/index.d.ts +2 -0
- package/es/components/molecules/AddDynamicContent/index.js +2 -0
- package/es/components/molecules/AddDynamicContent/styled.d.ts +12 -0
- package/es/components/molecules/AddDynamicContent/styled.js +30 -0
- package/es/components/molecules/AddDynamicContent/types.d.ts +13 -0
- package/es/components/molecules/AddDynamicContent/types.js +1 -0
- package/es/components/molecules/AddDynamicContent/utils.d.ts +41 -0
- package/es/components/molecules/AddDynamicContent/utils.js +396 -0
- package/es/components/molecules/CaptureScreen/CaptureScreen.d.ts +2 -1
- package/es/components/molecules/CaptureScreen/components/CommentBox/CommentBox.d.ts +2 -1
- package/es/components/molecules/CaptureScreen/components/Cursor/Cursor.d.ts +2 -1
- package/es/components/molecules/Collapse/Collapse.d.ts +3 -3
- package/es/components/molecules/Collapse/Collapse.js +9 -0
- package/es/components/molecules/ColorPicker/CustomPicker/index.js +9 -18
- package/es/components/molecules/ColorPicker/CustomPicker/styled.d.ts +5 -1
- package/es/components/molecules/ColorPicker/CustomPicker/styled.js +14 -3
- package/es/components/molecules/ColorPicker/index.js +3 -3
- package/es/components/molecules/ColorSetting/index.js +3 -3
- package/es/components/molecules/DatePicker/components/AdvancedPicker/AdvancedPicker.d.ts +7 -3
- package/es/components/molecules/DatePicker/components/AdvancedPicker/AdvancedPicker.js +212 -205
- package/es/components/molecules/DatePicker/components/AdvancedPicker/constants.d.ts +78 -25
- package/es/components/molecules/DatePicker/components/AdvancedPicker/constants.js +145 -22
- package/es/components/molecules/DatePicker/components/AdvancedPicker/styled.js +49 -5
- package/es/components/molecules/DatePicker/components/AdvancedPicker/types.d.ts +22 -0
- package/es/components/molecules/DatePicker/components/AdvancedPicker/utils.d.ts +25 -1
- package/es/components/molecules/DatePicker/components/AdvancedPicker/utils.js +167 -40
- package/es/components/molecules/DatePicker/components/AdvancedRangePicker/AdvancedRangePicker.d.ts +3 -1
- package/es/components/molecules/DatePicker/components/AdvancedRangePicker/AdvancedRangePicker.js +21 -9
- package/es/components/molecules/DatePicker/components/AdvancedRangePicker/constants.d.ts +1 -0
- package/es/components/molecules/DatePicker/components/AdvancedRangePicker/constants.js +1 -0
- package/es/components/molecules/DatePicker/components/AdvancedRangePicker/types.d.ts +1 -0
- package/es/components/molecules/DatePicker/components/DropdownLabel/DropdownLabel.d.ts +13 -0
- package/es/components/molecules/DatePicker/components/DropdownLabel/DropdownLabel.js +87 -0
- package/es/components/molecules/DatePicker/components/ErrorMessage/ErrorMessage.d.ts +6 -0
- package/es/components/molecules/DatePicker/components/ErrorMessage/ErrorMessage.js +12 -0
- package/es/components/molecules/Drawer/Drawer.d.ts +5 -1
- package/es/components/molecules/Drawer/Drawer.js +3 -1
- package/es/components/molecules/Drawer/index.d.ts +1 -0
- package/es/components/molecules/EditorScript/EditorScript.d.ts +14 -0
- package/es/components/molecules/EditorScript/EditorScript.js +89 -0
- package/es/components/molecules/EditorScript/index.d.ts +1 -0
- package/es/components/molecules/EditorScript/index.js +1 -0
- package/es/components/molecules/EditorScript/styled.d.ts +1 -0
- package/es/components/molecules/EditorScript/styled.js +3 -0
- package/es/components/molecules/FontFamilySelect/constants.d.ts +307 -0
- package/es/components/molecules/FontFamilySelect/constants.js +257 -0
- package/es/components/molecules/FontFamilySelect/index.d.ts +17 -0
- package/es/components/molecules/FontFamilySelect/index.js +53 -0
- package/es/components/molecules/FontSetting/constants.d.ts +3 -0
- package/es/components/molecules/FontSetting/constants.js +22 -0
- package/es/components/molecules/FontSetting/index.d.ts +24 -0
- package/es/components/molecules/FontSetting/index.js +54 -0
- package/es/components/molecules/FontSetting/types.d.ts +22 -0
- package/es/components/molecules/FontSetting/types.js +1 -0
- package/es/components/molecules/FontWeightSelect/constants.d.ts +28 -0
- package/es/components/molecules/FontWeightSelect/constants.js +11 -0
- package/es/components/molecules/FontWeightSelect/index.d.ts +9 -0
- package/es/components/molecules/FontWeightSelect/index.js +39 -0
- package/es/components/molecules/Form/Form.d.ts +1 -0
- package/es/components/molecules/Form/Form.js +1 -0
- package/es/components/molecules/Form/index.d.ts +1 -0
- package/es/components/molecules/Form/index.js +1 -0
- package/es/components/molecules/GradientSetting/index.d.ts +19 -2
- package/es/components/molecules/GradientSetting/index.js +52 -30
- package/es/components/molecules/GradientSetting/styled.d.ts +1 -0
- package/es/components/molecules/GradientSetting/styled.js +59 -0
- package/es/components/molecules/InputNumber/index.js +2 -2
- package/es/components/molecules/Modal/index.d.ts +1 -0
- package/es/components/molecules/Modal/styled.d.ts +1 -1
- package/es/components/molecules/Modal/styled.js +2 -0
- package/es/components/molecules/ModalV2/ModalV2.d.ts +5 -0
- package/es/components/molecules/ModalV2/ModalV2.js +26 -0
- package/es/components/molecules/ModalV2/index.d.ts +2 -0
- package/es/components/molecules/ModalV2/index.js +1 -0
- package/es/components/molecules/ModalV2/styled.d.ts +7 -0
- package/es/components/molecules/ModalV2/styled.js +22 -0
- package/es/components/molecules/PreviewModal/PreviewModal.d.ts +7 -0
- package/es/components/molecules/PreviewModal/PreviewModal.js +30 -0
- package/es/components/molecules/PreviewModal/index.d.ts +2 -0
- package/es/components/molecules/PreviewModal/index.js +1 -0
- package/es/components/molecules/PreviewModal/styled.d.ts +4 -0
- package/es/components/molecules/PreviewModal/styled.js +39 -0
- package/es/components/molecules/ResizeGrid/ResizeGrid.d.ts +3 -0
- package/es/components/molecules/ResizeGrid/ResizeGrid.js +728 -0
- package/es/components/molecules/ResizeGrid/components/Cell/Cell.d.ts +3 -0
- package/es/components/molecules/ResizeGrid/components/Cell/Cell.js +87 -0
- package/es/components/molecules/ResizeGrid/components/Cell/index.d.ts +1 -0
- package/es/components/molecules/ResizeGrid/components/Cell/index.js +1 -0
- package/es/components/molecules/ResizeGrid/components/Cell/styled.d.ts +3 -0
- package/es/components/molecules/ResizeGrid/components/Cell/styled.js +80 -0
- package/es/components/molecules/ResizeGrid/constant.d.ts +35 -0
- package/es/components/molecules/ResizeGrid/constant.js +111 -0
- package/es/components/molecules/ResizeGrid/index.d.ts +2 -0
- package/es/components/molecules/ResizeGrid/index.js +1 -0
- package/es/components/molecules/ResizeGrid/styled.d.ts +10 -0
- package/es/components/molecules/ResizeGrid/styled.js +56 -0
- package/es/components/molecules/ResizeGrid/types.d.ts +147 -0
- package/es/components/molecules/ResizeGrid/types.js +1 -0
- package/es/components/molecules/RichMenu/RichMenuBlock/RichMenuBlock.d.ts +13 -0
- package/es/components/molecules/RichMenu/RichMenuBlock/RichMenuBlock.js +53 -0
- package/es/components/molecules/RichMenu/RichMenuBlock/RichMenuCell/index.d.ts +18 -0
- package/es/components/molecules/RichMenu/RichMenuBlock/RichMenuCell/index.js +110 -0
- package/es/components/molecules/RichMenu/RichMenuBlock/RichMenuCell/styled.d.ts +20 -0
- package/es/components/molecules/RichMenu/RichMenuBlock/RichMenuCell/styled.js +135 -0
- package/es/components/molecules/RichMenu/RichMenuBlock/constants.d.ts +2 -0
- package/es/components/molecules/RichMenu/RichMenuBlock/constants.js +765 -0
- package/es/components/molecules/RichMenu/RichMenuBlock/index.d.ts +3 -0
- package/es/components/molecules/RichMenu/RichMenuBlock/index.js +2 -0
- package/es/components/molecules/RichMenu/RichMenuBlock/styled.d.ts +9 -0
- package/es/components/molecules/RichMenu/RichMenuBlock/styled.js +17 -0
- package/es/components/molecules/RichMenu/RichMenuChatBar/RichMenuChatBar.d.ts +10 -0
- package/es/components/molecules/RichMenu/RichMenuChatBar/RichMenuChatBar.js +32 -0
- package/es/components/molecules/RichMenu/RichMenuChatBar/TypingChat/index.d.ts +6 -0
- package/es/components/molecules/RichMenu/RichMenuChatBar/TypingChat/index.js +15 -0
- package/es/components/molecules/RichMenu/RichMenuChatBar/TypingChat/styled.d.ts +4 -0
- package/es/components/molecules/RichMenu/RichMenuChatBar/TypingChat/styled.js +47 -0
- package/es/components/molecules/RichMenu/RichMenuChatBar/index.d.ts +2 -0
- package/es/components/molecules/RichMenu/RichMenuChatBar/index.js +1 -0
- package/es/components/molecules/RichMenu/RichMenuChatBar/styled.d.ts +9 -0
- package/es/components/molecules/RichMenu/RichMenuChatBar/styled.js +37 -0
- package/es/components/molecules/RichMenu/RichMenuMobileView/RichMenuMobileView.d.ts +10 -0
- package/es/components/molecules/RichMenu/RichMenuMobileView/RichMenuMobileView.js +37 -0
- package/es/components/molecules/RichMenu/RichMenuMobileView/index.d.ts +1 -0
- package/es/components/molecules/RichMenu/RichMenuMobileView/index.js +1 -0
- package/es/components/molecules/RichMenu/RichMenuMobileView/styled.d.ts +6 -0
- package/es/components/molecules/RichMenu/RichMenuMobileView/styled.js +20 -0
- package/es/components/molecules/RichMenu/index.d.ts +3 -0
- package/es/components/molecules/RichMenu/index.js +3 -0
- package/es/components/molecules/Select/Select.d.ts +3 -0
- package/es/components/molecules/Select/Select.js +23 -2
- package/es/components/molecules/Select/Test.d.ts +2 -1
- package/es/components/molecules/SettingWrapper/index.d.ts +1 -2
- package/es/components/molecules/SettingWrapperPopover/index.d.ts +16 -0
- package/es/components/molecules/SettingWrapperPopover/index.js +17 -0
- package/es/components/molecules/ShareAccess/ShareAccess.d.ts +3 -0
- package/es/components/molecules/ShareAccess/ShareAccess.js +23 -0
- package/es/components/molecules/ShareAccess/actions.d.ts +16 -0
- package/es/components/molecules/ShareAccess/actions.js +12 -0
- package/es/components/molecules/ShareAccess/components/GeneralAccess/GeneralAccess.d.ts +2 -0
- package/es/components/molecules/ShareAccess/components/GeneralAccess/GeneralAccess.js +78 -0
- package/es/components/molecules/ShareAccess/components/GeneralAccess/index.d.ts +1 -0
- package/es/components/molecules/ShareAccess/components/GeneralAccess/index.js +1 -0
- package/es/components/molecules/ShareAccess/components/GeneralAccess/styled.d.ts +1 -0
- package/es/components/molecules/ShareAccess/components/GeneralAccess/styled.js +57 -0
- package/es/components/molecules/ShareAccess/components/LayoutContent/LayoutContent.d.ts +3 -0
- package/es/components/molecules/ShareAccess/components/LayoutContent/LayoutContent.js +19 -0
- package/es/components/molecules/ShareAccess/components/LayoutContent/index.d.ts +1 -0
- package/es/components/molecules/ShareAccess/components/LayoutContent/index.js +1 -0
- package/es/components/molecules/ShareAccess/components/LayoutContent/styled.d.ts +1 -0
- package/es/components/molecules/ShareAccess/components/LayoutContent/styled.js +7 -0
- package/es/components/molecules/ShareAccess/components/ModalTransferOwnerShip/ModalTransferOwnerShip.d.ts +2 -0
- package/es/components/molecules/ShareAccess/components/ModalTransferOwnerShip/ModalTransferOwnerShip.js +43 -0
- package/es/components/molecules/ShareAccess/components/ModalTransferOwnerShip/index.d.ts +0 -0
- package/es/components/molecules/ShareAccess/components/ModalTransferOwnerShip/index.js +1 -0
- package/es/components/molecules/ShareAccess/components/ModalTransferOwnerShip/styled.d.ts +7 -0
- package/es/components/molecules/ShareAccess/components/ModalTransferOwnerShip/styled.js +18 -0
- package/es/components/molecules/ShareAccess/components/PeopleAccess/PeopleAccess.d.ts +5 -0
- package/es/components/molecules/ShareAccess/components/PeopleAccess/PeopleAccess.js +97 -0
- package/es/components/molecules/ShareAccess/components/PeopleAccess/index.d.ts +1 -0
- package/es/components/molecules/ShareAccess/components/PeopleAccess/index.js +1 -0
- package/es/components/molecules/ShareAccess/components/PeopleAccess/styled.d.ts +1 -0
- package/es/components/molecules/ShareAccess/components/PeopleAccess/styled.js +46 -0
- package/es/components/molecules/ShareAccess/components/SearchUser/SearchUser.d.ts +5 -0
- package/es/components/molecules/ShareAccess/components/SearchUser/SearchUser.js +73 -0
- package/es/components/molecules/ShareAccess/components/SearchUser/index.d.ts +1 -0
- package/es/components/molecules/ShareAccess/components/SearchUser/index.js +1 -0
- package/es/components/molecules/ShareAccess/components/SearchUser/styled.d.ts +2 -0
- package/es/components/molecules/ShareAccess/components/SearchUser/styled.js +29 -0
- package/es/components/molecules/ShareAccess/components/index.d.ts +1 -0
- package/es/components/molecules/ShareAccess/components/index.js +1 -0
- package/es/components/molecules/ShareAccess/constants.d.ts +67 -0
- package/es/components/molecules/ShareAccess/constants.js +85 -0
- package/es/components/molecules/ShareAccess/context.d.ts +4 -0
- package/es/components/molecules/ShareAccess/context.js +3 -0
- package/es/components/molecules/ShareAccess/hooks/index.d.ts +1 -0
- package/es/components/molecules/ShareAccess/hooks/index.js +1 -0
- package/es/components/molecules/ShareAccess/hooks/useShareAccess.d.ts +18 -0
- package/es/components/molecules/ShareAccess/hooks/useShareAccess.js +29 -0
- package/es/components/molecules/ShareAccess/index.d.ts +4 -0
- package/es/components/molecules/ShareAccess/index.js +4 -0
- package/es/components/molecules/ShareAccess/reducer.d.ts +2 -0
- package/es/components/molecules/ShareAccess/reducer.js +19 -0
- package/es/components/molecules/ShareAccess/types.d.ts +54 -0
- package/es/components/molecules/ShareAccess/types.js +1 -0
- package/es/components/molecules/ShareAccess/utils.d.ts +38 -0
- package/es/components/molecules/ShareAccess/utils.js +57 -0
- package/es/components/molecules/TextDecorationSelect/constants.d.ts +19 -0
- package/es/components/molecules/TextDecorationSelect/constants.js +26 -0
- package/es/components/molecules/TextDecorationSelect/index.d.ts +15 -0
- package/es/components/molecules/TextDecorationSelect/index.js +45 -0
- package/es/components/molecules/TextTransformSelect/constants.d.ts +13 -0
- package/es/components/molecules/TextTransformSelect/constants.js +19 -0
- package/es/components/molecules/TextTransformSelect/index.d.ts +9 -0
- package/es/components/molecules/TextTransformSelect/index.js +39 -0
- package/es/components/molecules/TreeSelect/TreeSelect.d.ts +2 -2
- package/es/components/molecules/UploadImage/MediaIcon.d.ts +2 -1
- package/es/components/molecules/UploadImage/MediaThumb.d.ts +8 -0
- package/es/components/molecules/UploadImage/MediaThumb.js +15 -0
- package/es/components/molecules/UploadImage/VideoThumbnail.d.ts +4 -0
- package/es/components/molecules/UploadImage/VideoThumbnail.js +43 -0
- package/es/components/molecules/UploadImage/index.d.ts +6 -2
- package/es/components/molecules/UploadImage/index.js +105 -85
- package/es/components/molecules/UploadImage/styled.js +0 -4
- package/es/components/molecules/UploadImage/utils.d.ts +3 -0
- package/es/components/molecules/UploadImage/utils.js +24 -0
- package/es/components/molecules/index.d.ts +18 -3
- package/es/components/molecules/index.js +15 -3
- package/es/components/organism/GenerativeInsights/constants.d.ts +1 -0
- package/es/components/organism/GenerativeInsights/constants.js +1 -0
- package/es/components/organism/GenerativeInsights/index.d.ts +11 -0
- package/es/components/organism/GenerativeInsights/index.js +57 -0
- package/es/components/organism/GenerativeInsights/styled.d.ts +12 -0
- package/es/components/organism/GenerativeInsights/styled.js +66 -0
- package/es/components/organism/GenerativeInsights/utils.d.ts +13 -0
- package/es/components/organism/GenerativeInsights/utils.js +50 -0
- package/es/components/organism/index.d.ts +1 -0
- package/es/components/organism/index.js +1 -0
- package/es/components/template/TemplateListing/components/BlankTemplate/index.d.ts +3 -0
- package/es/components/template/TemplateListing/components/BlankTemplate/index.js +17 -0
- package/es/components/template/TemplateListing/components/BlankTemplate/styled.d.ts +2 -0
- package/es/components/template/TemplateListing/components/BlankTemplate/styled.js +24 -0
- package/es/components/template/TemplateListing/components/CategoryListing/index.d.ts +3 -0
- package/es/components/template/TemplateListing/components/CategoryListing/index.js +103 -0
- package/es/components/template/TemplateListing/components/CategoryListing/styled.d.ts +5 -0
- package/es/components/template/TemplateListing/components/CategoryListing/styled.js +55 -0
- package/es/components/template/TemplateListing/components/CategoryListing/types.d.ts +10 -0
- package/es/components/template/TemplateListing/components/CategoryListing/types.js +1 -0
- package/es/components/template/TemplateListing/components/TemplateItem/index.d.ts +3 -0
- package/es/components/template/TemplateListing/components/TemplateItem/index.js +53 -0
- package/es/components/template/TemplateListing/components/TemplateItem/styled.d.ts +1 -0
- package/es/components/template/TemplateListing/components/TemplateItem/styled.js +82 -0
- package/es/components/template/TemplateListing/components/index.d.ts +3 -0
- package/es/components/template/TemplateListing/components/index.js +3 -0
- package/es/components/template/TemplateListing/constants/defaultProps.d.ts +8 -0
- package/es/components/template/TemplateListing/constants/defaultProps.js +20 -0
- package/es/components/template/TemplateListing/constants/index.d.ts +2 -0
- package/es/components/template/TemplateListing/constants/index.js +2 -0
- package/es/components/template/TemplateListing/constants/mockData.d.ts +2 -0
- package/es/components/template/TemplateListing/constants/mockData.js +101 -0
- package/es/components/template/TemplateListing/index.d.ts +3 -0
- package/es/components/template/TemplateListing/index.js +22 -0
- package/es/components/template/TemplateListing/styled/index.d.ts +2 -0
- package/es/components/template/TemplateListing/styled/index.js +16 -0
- package/es/components/template/TemplateListing/types/BlankTemplate.d.ts +8 -0
- package/es/components/template/TemplateListing/types/BlankTemplate.js +1 -0
- package/es/components/template/TemplateListing/types/CategoryListing.d.ts +16 -0
- package/es/components/template/TemplateListing/types/CategoryListing.js +1 -0
- package/es/components/template/TemplateListing/types/TemplateItem.d.ts +14 -0
- package/es/components/template/TemplateListing/types/TemplateItem.js +1 -0
- package/es/components/template/TemplateListing/types/TemplateListing.d.ts +15 -0
- package/es/components/template/TemplateListing/types/TemplateListing.js +1 -0
- package/es/components/template/TemplateListing/types/index.d.ts +4 -0
- package/es/components/template/TemplateListing/types/index.js +4 -0
- package/es/components/template/index.d.ts +2 -0
- package/es/components/template/index.js +2 -0
- package/es/constants/index.d.ts +1 -0
- package/es/constants/index.js +1 -0
- package/es/constants/queries.d.ts +14 -0
- package/es/constants/queries.js +21 -0
- package/es/constants/richMenu.d.ts +19 -0
- package/es/constants/richMenu.js +19 -0
- package/es/constants/storybook.d.ts +7 -1
- package/es/constants/storybook.js +12 -0
- package/es/constants/theme.js +30 -3
- package/es/hooks/index.d.ts +1 -0
- package/es/hooks/index.js +1 -0
- package/es/hooks/useDebounceCallback.d.ts +1 -0
- package/es/hooks/useDebounceCallback.js +5 -0
- package/es/hooks/useDebounceV2.d.ts +1 -0
- package/es/hooks/useDebounceV2.js +11 -0
- package/es/hooks/useDeepCompareEffect.d.ts +1 -0
- package/es/hooks/useDeepCompareEffect.js +21 -0
- package/es/hooks/useDeepCompareMemo.d.ts +2 -0
- package/es/hooks/useDeepCompareMemo.js +21 -0
- package/es/hooks/useOutsideClick.d.ts +4 -0
- package/es/hooks/useOutsideClick.js +18 -0
- package/es/hooks/usePrevious.d.ts +2 -0
- package/es/hooks/usePrevious.js +9 -0
- package/es/locales/en/translation.json +167 -1
- package/es/locales/i18n.d.ts +167 -0
- package/es/locales/translations.d.ts +166 -0
- package/es/locales/vi/translation.json +2 -1
- package/es/models/BusinessObject.d.ts +116 -0
- package/es/models/BusinessObject.js +113 -0
- package/es/models/Currency.d.ts +9 -0
- package/es/models/Currency.js +10 -0
- package/es/models/CustomFunction.d.ts +19 -0
- package/es/models/CustomFunction.js +25 -0
- package/es/models/DynamicContentAttribute.d.ts +34 -0
- package/es/models/DynamicContentAttribute.js +9 -0
- package/es/models/EventTrackingAttribute.d.ts +11 -0
- package/es/models/EventTrackingAttribute.js +13 -0
- package/es/models/PromotionPool.d.ts +11 -0
- package/es/models/PromotionPool.js +12 -0
- package/es/models/{SavedImage.d.ts → SavedMedia.d.ts} +7 -5
- package/es/models/{SavedImage.js → SavedMedia.js} +7 -3
- package/es/models/Upload.d.ts +2 -0
- package/es/models/Upload.js +3 -0
- package/es/queries/BusinessObject/index.d.ts +6 -0
- package/es/queries/BusinessObject/index.js +6 -0
- package/es/queries/BusinessObject/useGetListAllEvents.d.ts +11 -0
- package/es/queries/BusinessObject/useGetListAllEvents.js +14 -0
- package/es/queries/BusinessObject/useGetListAttributeBO.d.ts +17 -0
- package/es/queries/BusinessObject/useGetListAttributeBO.js +41 -0
- package/es/queries/BusinessObject/useGetListBO.d.ts +6 -0
- package/es/queries/BusinessObject/useGetListBO.js +19 -0
- package/es/queries/BusinessObject/useGetListEventAttr.d.ts +4 -0
- package/es/queries/BusinessObject/useGetListEventAttr.js +15 -0
- package/es/queries/BusinessObject/useGetListPromotionCodeAttr.d.ts +6 -0
- package/es/queries/BusinessObject/useGetListPromotionCodeAttr.js +26 -0
- package/es/queries/BusinessObject/useGetListSourceByEvent.d.ts +13 -0
- package/es/queries/BusinessObject/useGetListSourceByEvent.js +11 -0
- package/es/queries/CustomFunction/index.d.ts +2 -0
- package/es/queries/CustomFunction/index.js +2 -0
- package/es/queries/CustomFunction/useCustomFunction.d.ts +19 -0
- package/es/queries/CustomFunction/useCustomFunction.js +53 -0
- package/es/queries/DynamicContentAttribute/index.d.ts +1 -0
- package/es/queries/DynamicContentAttribute/index.js +1 -0
- package/es/queries/DynamicContentAttribute/useGetDynamicContentAttr.d.ts +10 -0
- package/es/queries/DynamicContentAttribute/useGetDynamicContentAttr.js +21 -0
- package/es/queries/PromotionPool/index.d.ts +1 -0
- package/es/queries/PromotionPool/index.js +1 -0
- package/es/queries/PromotionPool/useGetListPromotionPool.d.ts +9 -0
- package/es/queries/PromotionPool/useGetListPromotionPool.js +62 -0
- package/es/queries/ThirdParty/index.d.ts +1 -0
- package/es/queries/ThirdParty/index.js +1 -0
- package/es/queries/ThirdParty/useGetEventTrackingAttributes.d.ts +14 -0
- package/es/queries/ThirdParty/useGetEventTrackingAttributes.js +15 -0
- package/es/queries/configs.d.ts +4 -0
- package/es/queries/configs.js +13 -0
- package/es/queries/index.d.ts +6 -0
- package/es/queries/index.js +6 -0
- package/es/services/MediaTemplateDesign/BusinessObject/index.d.ts +8 -0
- package/es/services/MediaTemplateDesign/BusinessObject/index.js +100 -0
- package/es/services/MediaTemplateDesign/CustomFunction/index.d.ts +15 -0
- package/es/services/MediaTemplateDesign/CustomFunction/index.js +135 -0
- package/es/services/MediaTemplateDesign/DynamicContentAttribute/index.d.ts +4 -0
- package/es/services/MediaTemplateDesign/DynamicContentAttribute/index.js +39 -0
- package/es/services/MediaTemplateDesign/ListCurrency/index.d.ts +6 -0
- package/es/services/MediaTemplateDesign/ListCurrency/index.js +34 -0
- package/es/services/MediaTemplateDesign/PromotionPool/index.d.ts +3 -0
- package/es/services/MediaTemplateDesign/PromotionPool/index.js +31 -0
- package/es/services/MediaTemplateDesign/UploadFile/index.d.ts +5 -5
- package/es/services/MediaTemplateDesign/UploadFile/index.js +37 -19
- package/es/services/ThirParty/index.d.ts +8 -0
- package/es/services/ThirParty/index.js +26 -0
- package/es/services/index.d.ts +14 -5
- package/es/services/index.js +45 -1
- package/es/test.d.ts +2 -1
- package/es/test.js +258 -80
- package/es/types/index.d.ts +17 -0
- package/es/types/index.js +2 -1
- package/es/types/richMenu.d.ts +214 -0
- package/es/types/richMenu.js +1 -0
- package/es/types/variables.d.ts +2 -0
- package/es/types/variables.js +1 -0
- package/es/utils/common.d.ts +4 -0
- package/es/utils/common.js +21 -0
- package/es/utils/handleError.d.ts +32 -2
- package/es/utils/handleError.js +42 -4
- package/package.json +27 -9
- package/dist/0173b5993573afa04880.woff +0 -0
- package/dist/0dfb9214dfd945cd7290.png +0 -1
- package/dist/2883cad25a2b4e87ce5f.eot +0 -0
- package/dist/4f54a37971347e3d7122.png +0 -1
- package/dist/574b7bee0563a9fe9a29.png +0 -1
- package/dist/6b586356e837581204dc.svg +0 -1
- package/dist/72eec5c1c786b45a667f.ttf +0 -0
- package/dist/bc6bf11c6f5e6743aa4c.png +0 -1
- package/dist/dbc405edd6e0806efbc9.svg +0 -1
- package/dist/e32f09119052a55cce3c.png +0 -1
- package/dist/e3851b9384a984c6fdb5.png +0 -1
- package/dist/index.js +0 -2
- package/dist/index.js.LICENSE.txt +0 -69
- package/dist/main.css +0 -68
- package/dist/public/icons/2d496b55d85a9545d7311c073af442bb.png +0 -0
- package/dist/public/icons/2fbb4e0927d18e3f8e5c6511ab88d5b3.png +0 -0
- package/dist/public/icons/725a52bd91a3ce534b10833df510e5fa.png +0 -0
- package/dist/public/icons/7d037e0b378e87a82804443636cd0e13.svg +0 -346
- package/dist/public/icons/90553767e0a05b9585a54797cfd9ce51.png +0 -0
- package/dist/public/icons/bb64e23a1ff390a416d765ee556096ab.svg +0 -87
- package/dist/public/icons/d327b24e9c5d8f486f08d253aab58ce6.png +0 -0
- package/dist/public/icons/f1cf266d0a0a53ce07f2dbb859869b7a.png +0 -0
- package/dist/public/icons/placeholder-image.png +0 -0
- package/dist/public/icons/transparent.svg +0 -1
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import React, { useEffect, useRef } from 'react';
|
|
2
|
+
import { buildGridArea, buildTranform } from '../../constant';
|
|
3
|
+
import { StyledCell } from './styled';
|
|
4
|
+
import { useDeepCompareEffect } from '../../../../../hooks/useDeepCompareEffect';
|
|
5
|
+
export const Cell = ({ cell, idx, down, downCell, up, setRef, downSelect, upSelect, hoverSelect, unMerge, renderCell, style, isPreview, borderStyle, activeStyle, activeCell, setCordinate, rowPercentage, colPercentage, ctrlKeyRef, }) => {
|
|
6
|
+
const { objectFit, image } = cell;
|
|
7
|
+
const downRef = useRef(false);
|
|
8
|
+
const timeoutRef = useRef();
|
|
9
|
+
const cellRef = useRef(null);
|
|
10
|
+
useDeepCompareEffect(() => {
|
|
11
|
+
clearTimeout(timeoutRef.current);
|
|
12
|
+
timeoutRef.current = setTimeout(() => {
|
|
13
|
+
setCordinate(idx, cellRef);
|
|
14
|
+
}, 500);
|
|
15
|
+
}, [idx, cell, rowPercentage, colPercentage, cellRef]);
|
|
16
|
+
useEffect(() => {
|
|
17
|
+
setRef(idx, cellRef);
|
|
18
|
+
}, [idx, cell]);
|
|
19
|
+
const handleHoverSelect = e => {
|
|
20
|
+
hoverSelect(idx, cell);
|
|
21
|
+
};
|
|
22
|
+
const handleDownCell = e => {
|
|
23
|
+
downSelect(idx, cell);
|
|
24
|
+
};
|
|
25
|
+
const handleUpCell = e => {
|
|
26
|
+
upSelect(idx, cell);
|
|
27
|
+
};
|
|
28
|
+
const handleDown = (e, direction, idx) => {
|
|
29
|
+
e.stopPropagation();
|
|
30
|
+
downRef.current = true;
|
|
31
|
+
// console.log('down', direction, idx, e)
|
|
32
|
+
const type = ['top', 'bottom'].includes(direction) ? 'row' : 'column';
|
|
33
|
+
const line = {
|
|
34
|
+
top: cell.rowStart,
|
|
35
|
+
right: cell.colEnd,
|
|
36
|
+
bottom: cell.rowEnd,
|
|
37
|
+
left: cell.colStart,
|
|
38
|
+
}[direction];
|
|
39
|
+
if ((ctrlKeyRef === null || ctrlKeyRef === void 0 ? void 0 : ctrlKeyRef.current) ||
|
|
40
|
+
(direction === 'top' && cell.movedTop) ||
|
|
41
|
+
(direction === 'right' && cell.movedRight) ||
|
|
42
|
+
(direction === 'bottom' && cell.movedBottom) ||
|
|
43
|
+
(direction === 'left' && cell.movedLeft)) {
|
|
44
|
+
downCell(e, type, line, idx, direction, cell, cellRef);
|
|
45
|
+
}
|
|
46
|
+
else {
|
|
47
|
+
down(e, type, line, idx, direction, cell, cellRef);
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
const handleUp = (e, direction, idx) => {
|
|
51
|
+
e.stopPropagation();
|
|
52
|
+
// console.log('up', direction, idx, e)
|
|
53
|
+
downRef.current = false;
|
|
54
|
+
up(e, direction, idx);
|
|
55
|
+
};
|
|
56
|
+
const handlUnMerge = e => {
|
|
57
|
+
unMerge(cell, idx);
|
|
58
|
+
};
|
|
59
|
+
const renderCellContent = () => renderCell
|
|
60
|
+
? renderCell(cell, idx, { isPreview })
|
|
61
|
+
: !!image &&
|
|
62
|
+
image.imageUrl && (React.createElement("div", { className: "imageWrapper" },
|
|
63
|
+
React.createElement("img", { src: image.imageUrl, alt: "menu", style: image.imageStyles })));
|
|
64
|
+
// const handleActiveCell = e => {
|
|
65
|
+
// activeCell(e, cell, idx);
|
|
66
|
+
// };
|
|
67
|
+
// const handleDrag = (direction, idx, e) => {
|
|
68
|
+
// if (!downRef.current) return;
|
|
69
|
+
// console.log(direction, idx, e)
|
|
70
|
+
// drag(e, direction, idx)
|
|
71
|
+
// }
|
|
72
|
+
// console.log('TRANSFORM', idx, buildTranform(cell))
|
|
73
|
+
return (React.createElement(StyledCell, { ref: cellRef, className: "cell",
|
|
74
|
+
// onClick={handleActiveCell}
|
|
75
|
+
onMouseOver: handleHoverSelect, onFocus: e => e, onMouseDown: handleDownCell, onMouseUp: handleUpCell, onDoubleClick: handlUnMerge, borderStyle: borderStyle || 'unset', style: Object.assign(Object.assign({ gridArea: buildGridArea(cell), width: cell.sizeX ? `${cell.sizeX}px` : 'unset', height: cell.sizeY ? `${cell.sizeY}px` : 'unset', transform: buildTranform(cell) }, (cell.active &&
|
|
76
|
+
!isPreview &&
|
|
77
|
+
(activeStyle || {
|
|
78
|
+
outline: '1px solid #005eb8',
|
|
79
|
+
}))), style) },
|
|
80
|
+
React.createElement("div", { className: "cell-content" }, renderCellContent()),
|
|
81
|
+
React.createElement("div", { className: "cell-border", style: {
|
|
82
|
+
borderTop: cell.rowStart === 1 ? borderStyle : 'unset',
|
|
83
|
+
borderLeft: cell.colStart === 1 ? borderStyle : 'unset',
|
|
84
|
+
display: isPreview ? 'none' : 'block',
|
|
85
|
+
} }),
|
|
86
|
+
['top', 'right', 'bottom', 'left'].map(direction => (React.createElement("div", { key: direction, className: `resize-${direction}`, onMouseDown: e => handleDown(e, direction, idx), onMouseUp: e => handleUp(e, direction, idx) })))));
|
|
87
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Cell } from './Cell';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Cell } from './Cell';
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
// Libraries
|
|
2
|
+
import styled from 'styled-components';
|
|
3
|
+
export const StyledCell = styled.div `
|
|
4
|
+
// border: ${props => props.borderStyle};
|
|
5
|
+
// border-top: none;
|
|
6
|
+
// border-left: none;
|
|
7
|
+
// box-shadow: 1px 1px 0px 1px rgba(0, 0, 0, 0.1);
|
|
8
|
+
position: relative;
|
|
9
|
+
user-select: none;
|
|
10
|
+
|
|
11
|
+
.cell-border {
|
|
12
|
+
position: absolute;
|
|
13
|
+
inset: 0;
|
|
14
|
+
border: 1px solid #005eb8;
|
|
15
|
+
box-sizing: border-box;
|
|
16
|
+
border: ${props => props.borderStyle};
|
|
17
|
+
border-top: none;
|
|
18
|
+
border-left: none;
|
|
19
|
+
z-index: 1;
|
|
20
|
+
}
|
|
21
|
+
.cell-content {
|
|
22
|
+
position: relative;
|
|
23
|
+
height: 100%;
|
|
24
|
+
width: 100%;
|
|
25
|
+
z-index: 2;
|
|
26
|
+
}
|
|
27
|
+
.resize-top,
|
|
28
|
+
.resize-right,
|
|
29
|
+
.resize-bottom,
|
|
30
|
+
.resize-left {
|
|
31
|
+
position: absolute;
|
|
32
|
+
z-index: 3;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.resize-top,
|
|
36
|
+
.resize-bottom {
|
|
37
|
+
width: 100%;
|
|
38
|
+
height: 3px;
|
|
39
|
+
left: -1px;
|
|
40
|
+
cursor: row-resize;
|
|
41
|
+
}
|
|
42
|
+
.resize-left,
|
|
43
|
+
.resize-right {
|
|
44
|
+
width: 3px;
|
|
45
|
+
height: 100%;
|
|
46
|
+
top: -1px;
|
|
47
|
+
cursor: col-resize;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.resize-top {
|
|
51
|
+
// background: red;
|
|
52
|
+
top: -1px;
|
|
53
|
+
}
|
|
54
|
+
.resize-right {
|
|
55
|
+
// background: green;
|
|
56
|
+
right: -1px;
|
|
57
|
+
}
|
|
58
|
+
.resize-bottom {
|
|
59
|
+
// background: blue;
|
|
60
|
+
bottom: -1px;
|
|
61
|
+
}
|
|
62
|
+
.resize-left {
|
|
63
|
+
// background: yellow;
|
|
64
|
+
left: -1px;
|
|
65
|
+
}
|
|
66
|
+
.imageWrapper {
|
|
67
|
+
height: 100%;
|
|
68
|
+
max-width: 100%;
|
|
69
|
+
max-height: 100%;
|
|
70
|
+
img {
|
|
71
|
+
display: block;
|
|
72
|
+
width: 100%;
|
|
73
|
+
height: 100%;
|
|
74
|
+
max-width: 100%;
|
|
75
|
+
max-height: 100%;
|
|
76
|
+
object-fit: contain;
|
|
77
|
+
-webkit-user-drag: none;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
`;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { TGrid } from './types';
|
|
2
|
+
export declare const GRID_TEMPLATE: {
|
|
3
|
+
GRID_2_3: {
|
|
4
|
+
rows: number;
|
|
5
|
+
cols: number;
|
|
6
|
+
};
|
|
7
|
+
GRID_5_5: {
|
|
8
|
+
rows: number;
|
|
9
|
+
cols: number;
|
|
10
|
+
};
|
|
11
|
+
GRID_2_2: {
|
|
12
|
+
rows: number;
|
|
13
|
+
cols: number;
|
|
14
|
+
};
|
|
15
|
+
GRID_2_3_1: {
|
|
16
|
+
rows: number;
|
|
17
|
+
cols: number;
|
|
18
|
+
childs: ({
|
|
19
|
+
rowStart: number;
|
|
20
|
+
colStart: number;
|
|
21
|
+
colEnd: number;
|
|
22
|
+
} | {
|
|
23
|
+
rowStart: number;
|
|
24
|
+
colStart: number;
|
|
25
|
+
colEnd?: undefined;
|
|
26
|
+
})[];
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
export declare const buildCell: (cell: any) => any;
|
|
30
|
+
export declare const buildGrid: (inputGrid: Partial<TGrid>) => TGrid;
|
|
31
|
+
export declare const buildGridArea: (box: any) => string;
|
|
32
|
+
export declare const buildTranform: (box: any) => string;
|
|
33
|
+
export declare const MIN_SIZE = 32;
|
|
34
|
+
export declare const THREADHOLD = 5;
|
|
35
|
+
export declare const getSafety: (fn: any, defaultValue?: string) => any;
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
export const GRID_TEMPLATE = {
|
|
2
|
+
GRID_2_3: {
|
|
3
|
+
rows: 2,
|
|
4
|
+
cols: 3,
|
|
5
|
+
},
|
|
6
|
+
GRID_5_5: {
|
|
7
|
+
rows: 5,
|
|
8
|
+
cols: 5,
|
|
9
|
+
},
|
|
10
|
+
GRID_2_2: {
|
|
11
|
+
rows: 2,
|
|
12
|
+
cols: 2,
|
|
13
|
+
},
|
|
14
|
+
GRID_2_3_1: {
|
|
15
|
+
rows: 2,
|
|
16
|
+
cols: 3,
|
|
17
|
+
childs: [
|
|
18
|
+
{
|
|
19
|
+
rowStart: 1,
|
|
20
|
+
colStart: 1,
|
|
21
|
+
colEnd: 4,
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
rowStart: 2,
|
|
25
|
+
colStart: 1,
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
rowStart: 2,
|
|
29
|
+
colStart: 2,
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
rowStart: 2,
|
|
33
|
+
colStart: 3,
|
|
34
|
+
},
|
|
35
|
+
],
|
|
36
|
+
},
|
|
37
|
+
};
|
|
38
|
+
export const buildCell = cell => (Object.assign({ rowEnd: cell.rowEnd || cell.rowStart + 1, colEnd: cell.colEnd || cell.colStart + 1 }, cell));
|
|
39
|
+
export const buildGrid = (inputGrid) => {
|
|
40
|
+
let childs = [];
|
|
41
|
+
const grid = JSON.parse(JSON.stringify(inputGrid));
|
|
42
|
+
let buildCol = !grid.gridTemplateColumns || !grid.gridTemplateColumns.length;
|
|
43
|
+
const buildRow = !grid.gridTemplateRows || !grid.gridTemplateRows.length;
|
|
44
|
+
const buildChild = !grid.childs || !grid.childs.length;
|
|
45
|
+
const gridTemplateColumns = grid.gridTemplateColumns || [];
|
|
46
|
+
const gridTemplateRows = grid.gridTemplateRows || [];
|
|
47
|
+
if (!buildChild && grid.childs) {
|
|
48
|
+
childs = grid.childs.map(buildCell);
|
|
49
|
+
}
|
|
50
|
+
if (buildChild || buildRow || buildCol) {
|
|
51
|
+
Array(grid.rows)
|
|
52
|
+
.fill(1)
|
|
53
|
+
.forEach((_, row) => {
|
|
54
|
+
if (buildRow && grid.rows) {
|
|
55
|
+
gridTemplateRows.push(100 / grid.rows);
|
|
56
|
+
}
|
|
57
|
+
Array(grid.cols)
|
|
58
|
+
.fill(1)
|
|
59
|
+
.forEach((__, col) => {
|
|
60
|
+
if (buildChild) {
|
|
61
|
+
childs.push({
|
|
62
|
+
rowStart: row + 1,
|
|
63
|
+
rowEnd: row + 2,
|
|
64
|
+
colStart: col + 1,
|
|
65
|
+
colEnd: col + 2,
|
|
66
|
+
active: false,
|
|
67
|
+
// image: {
|
|
68
|
+
// imageStyles: {},
|
|
69
|
+
// imageSettings: {},
|
|
70
|
+
// imageUrl: 'https://source.unsplash.com/random/300×300'
|
|
71
|
+
// },
|
|
72
|
+
objectFit: 'contain',
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
if (buildCol && grid.cols) {
|
|
76
|
+
gridTemplateColumns.push(100 / grid.cols);
|
|
77
|
+
}
|
|
78
|
+
});
|
|
79
|
+
buildCol = false;
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
return Object.assign(Object.assign({ rows: grid.rows || 1, cols: grid.rows || 1 }, grid), { gridTemplateColumns,
|
|
83
|
+
gridTemplateRows,
|
|
84
|
+
childs });
|
|
85
|
+
};
|
|
86
|
+
export const buildGridArea = box =>
|
|
87
|
+
// console.log('area', box, `${box.rowStart} / ${box.colStart} / ${box.rowEnd} / ${box.colEnd}`)
|
|
88
|
+
`${box.rowStart} / ${box.colStart} / ${box.rowEnd} / ${box.colEnd}`;
|
|
89
|
+
export const buildTranform = box => {
|
|
90
|
+
const { transformX, transformY } = box;
|
|
91
|
+
if (transformX && transformY) {
|
|
92
|
+
return `translate(${transformX}px, ${transformY}px)`;
|
|
93
|
+
}
|
|
94
|
+
if (transformX) {
|
|
95
|
+
return `translateX(${transformX}px)`;
|
|
96
|
+
}
|
|
97
|
+
if (transformY) {
|
|
98
|
+
return `translateY(${transformY}px)`;
|
|
99
|
+
}
|
|
100
|
+
return 'unset';
|
|
101
|
+
};
|
|
102
|
+
export const MIN_SIZE = 32;
|
|
103
|
+
export const THREADHOLD = 5;
|
|
104
|
+
export const getSafety = (fn, defaultValue = '') => {
|
|
105
|
+
try {
|
|
106
|
+
return fn();
|
|
107
|
+
}
|
|
108
|
+
catch (e) {
|
|
109
|
+
return defaultValue;
|
|
110
|
+
}
|
|
111
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { ResizeGrid } from './ResizeGrid';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export declare const StyledGrid: import("styled-components").StyledComponent<"div", any, {
|
|
2
|
+
isCompact: boolean;
|
|
3
|
+
}, never>;
|
|
4
|
+
export declare const StyledMiddleLayer: import("styled-components").StyledComponent<"div", any, {
|
|
5
|
+
isCompact?: boolean | undefined;
|
|
6
|
+
}, never>;
|
|
7
|
+
export declare const StyledBGLayer: import("styled-components").StyledComponent<"div", any, {
|
|
8
|
+
isCompact?: boolean | undefined;
|
|
9
|
+
}, never>;
|
|
10
|
+
export declare const StyledLine: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
// Libraries
|
|
2
|
+
import styled from 'styled-components';
|
|
3
|
+
export const StyledGrid = styled.div `
|
|
4
|
+
width: 100%;
|
|
5
|
+
box-sizing: border-box;
|
|
6
|
+
position: relative;
|
|
7
|
+
|
|
8
|
+
* {
|
|
9
|
+
box-sizing: border-box;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.grid-container {
|
|
13
|
+
position: relative;
|
|
14
|
+
width: 100%;
|
|
15
|
+
height: 100%;
|
|
16
|
+
display: grid;
|
|
17
|
+
background: transparent;
|
|
18
|
+
aspect-ratio: ${props => (props.isCompact ? '3 / 1' : '3 / 2')};
|
|
19
|
+
z-index: 3;
|
|
20
|
+
}
|
|
21
|
+
`;
|
|
22
|
+
export const StyledMiddleLayer = styled.div `
|
|
23
|
+
width: 100%;
|
|
24
|
+
height: 100%;
|
|
25
|
+
position: absolute;
|
|
26
|
+
inset: 0;
|
|
27
|
+
// background: red;
|
|
28
|
+
z-index: 2;
|
|
29
|
+
`;
|
|
30
|
+
export const StyledBGLayer = styled.div `
|
|
31
|
+
width: 100%;
|
|
32
|
+
height: 100%;
|
|
33
|
+
position: absolute;
|
|
34
|
+
inset: 0;
|
|
35
|
+
// background: red;
|
|
36
|
+
z-index: 1;
|
|
37
|
+
background-repeat: no-repeat;
|
|
38
|
+
background-position: top left;
|
|
39
|
+
background-size: 100% 100%;
|
|
40
|
+
`;
|
|
41
|
+
export const StyledLine = styled.div `
|
|
42
|
+
position: absolute;
|
|
43
|
+
width: 100%;
|
|
44
|
+
height: 100%;
|
|
45
|
+
top: -1px;
|
|
46
|
+
left: -1px;
|
|
47
|
+
background: red;
|
|
48
|
+
display: none;
|
|
49
|
+
|
|
50
|
+
&.vertical {
|
|
51
|
+
width: 1px;
|
|
52
|
+
}
|
|
53
|
+
&.horizontal {
|
|
54
|
+
height: 1px;
|
|
55
|
+
}
|
|
56
|
+
`;
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export type TImageStyles = {
|
|
3
|
+
borderTopLeftRadius?: string;
|
|
4
|
+
borderTopRightRadius?: string;
|
|
5
|
+
borderBottomRightRadius?: string;
|
|
6
|
+
borderBottomLeftRadius?: string;
|
|
7
|
+
borderTopWidth?: string;
|
|
8
|
+
borderRightWidth?: string;
|
|
9
|
+
borderBottomWidth?: string;
|
|
10
|
+
borderLeftWidth?: string;
|
|
11
|
+
borderStyle?: string;
|
|
12
|
+
borderColor?: string;
|
|
13
|
+
boxShadow?: string;
|
|
14
|
+
opacity?: number;
|
|
15
|
+
width?: string;
|
|
16
|
+
height?: string;
|
|
17
|
+
objectPosition?: string;
|
|
18
|
+
objectFit?: 'fill' | 'contain' | 'cover' | 'none' | 'scale-down';
|
|
19
|
+
paddingTop?: string;
|
|
20
|
+
paddingRight?: string;
|
|
21
|
+
paddingBottom?: string;
|
|
22
|
+
paddingLeft?: string;
|
|
23
|
+
};
|
|
24
|
+
export type TImageSettings = {
|
|
25
|
+
borderRadiusStyle?: string;
|
|
26
|
+
borderRadiusSuffix?: string;
|
|
27
|
+
linkedBorderRadiusInput?: boolean;
|
|
28
|
+
linkedBorderWidthInput?: boolean;
|
|
29
|
+
linkedPaddingInput?: boolean;
|
|
30
|
+
paddingSuffix?: string;
|
|
31
|
+
boxShadowStyle?: string;
|
|
32
|
+
boxShadowColor?: string;
|
|
33
|
+
boxShadowBlur?: string;
|
|
34
|
+
boxShadowSpread?: string;
|
|
35
|
+
boxShadowHorizontal?: string;
|
|
36
|
+
boxShadowVertical?: string;
|
|
37
|
+
boxShadowInset?: boolean;
|
|
38
|
+
widthSuffix?: string;
|
|
39
|
+
heightSuffix?: string;
|
|
40
|
+
};
|
|
41
|
+
export type TImage = {
|
|
42
|
+
imageUrl: string;
|
|
43
|
+
imageStyles: TImageStyles;
|
|
44
|
+
imageSettings: TImageSettings;
|
|
45
|
+
};
|
|
46
|
+
export type TCell = {
|
|
47
|
+
idx?: number;
|
|
48
|
+
cellRef?: React.RefObject<HTMLElement>;
|
|
49
|
+
rowStart: number;
|
|
50
|
+
rowEnd: number;
|
|
51
|
+
colStart: number;
|
|
52
|
+
colEnd: number;
|
|
53
|
+
width?: number;
|
|
54
|
+
height?: number;
|
|
55
|
+
sizeX?: number;
|
|
56
|
+
sizeY?: number;
|
|
57
|
+
transformX?: number;
|
|
58
|
+
transformY?: number;
|
|
59
|
+
movedTop?: boolean;
|
|
60
|
+
movedRight?: boolean;
|
|
61
|
+
movedBottom?: boolean;
|
|
62
|
+
movedLeft?: boolean;
|
|
63
|
+
image?: TImage;
|
|
64
|
+
objectFit?: 'fill' | 'contain' | 'cover' | 'none' | 'scale-down';
|
|
65
|
+
active?: boolean;
|
|
66
|
+
};
|
|
67
|
+
export interface CellProps {
|
|
68
|
+
cell: TCell;
|
|
69
|
+
idx: number;
|
|
70
|
+
rowPercentage: number;
|
|
71
|
+
colPercentage: number;
|
|
72
|
+
down: Function;
|
|
73
|
+
downCell: Function;
|
|
74
|
+
up: Function;
|
|
75
|
+
setRef: Function;
|
|
76
|
+
setCordinate: Function;
|
|
77
|
+
downSelect: Function;
|
|
78
|
+
upSelect: Function;
|
|
79
|
+
hoverSelect: Function;
|
|
80
|
+
unMerge: Function;
|
|
81
|
+
renderCell?: Function;
|
|
82
|
+
activeCell?: Function;
|
|
83
|
+
borderStyle?: string;
|
|
84
|
+
style?: React.CSSProperties;
|
|
85
|
+
activeStyle?: React.CSSProperties;
|
|
86
|
+
isPreview?: boolean;
|
|
87
|
+
ctrlKeyRef?: React.RefObject<boolean>;
|
|
88
|
+
}
|
|
89
|
+
export type TGrid = {
|
|
90
|
+
rows: number;
|
|
91
|
+
cols: number;
|
|
92
|
+
gridTemplateColumns: number[];
|
|
93
|
+
gridTemplateRows: number[];
|
|
94
|
+
childs: TCell[];
|
|
95
|
+
};
|
|
96
|
+
export type TStartRef = {
|
|
97
|
+
clientX: number;
|
|
98
|
+
clientY: number;
|
|
99
|
+
type: 'row' | 'column';
|
|
100
|
+
line: number;
|
|
101
|
+
};
|
|
102
|
+
export type TCellExtend = TCell & {
|
|
103
|
+
cellRef: React.RefObject<HTMLElement>;
|
|
104
|
+
idx: number;
|
|
105
|
+
};
|
|
106
|
+
export type TStartCellRef = {
|
|
107
|
+
clientX: number;
|
|
108
|
+
clientY: number;
|
|
109
|
+
direction: 'top' | 'right' | 'bottom' | 'left';
|
|
110
|
+
isRevert: boolean;
|
|
111
|
+
leftCells: Record<string, TCellExtend>;
|
|
112
|
+
rightCells: Record<string, TCellExtend>;
|
|
113
|
+
fallback?: boolean;
|
|
114
|
+
};
|
|
115
|
+
export type TSelected = {
|
|
116
|
+
idx: number;
|
|
117
|
+
cell: TCell;
|
|
118
|
+
};
|
|
119
|
+
export type TSelectedEnd = {
|
|
120
|
+
cell: TCell;
|
|
121
|
+
idx: number;
|
|
122
|
+
hCells: number[];
|
|
123
|
+
};
|
|
124
|
+
export interface IResizeGridProps {
|
|
125
|
+
grid?: Partial<TGrid>;
|
|
126
|
+
renderCell?: Function;
|
|
127
|
+
onChange?: Function;
|
|
128
|
+
selectColor?: string;
|
|
129
|
+
image?: string;
|
|
130
|
+
imageSize?: 'cover' | 'contain' | 'fill';
|
|
131
|
+
imagePosition?: string;
|
|
132
|
+
cellStyle?: React.CSSProperties;
|
|
133
|
+
isPreview?: boolean;
|
|
134
|
+
cellBorder?: string;
|
|
135
|
+
cellActiveStyle?: React.CSSProperties;
|
|
136
|
+
containerStyle?: React.CSSProperties;
|
|
137
|
+
isCompact?: boolean;
|
|
138
|
+
delayUpdate?: number;
|
|
139
|
+
}
|
|
140
|
+
export type TCordinate = {
|
|
141
|
+
x: number;
|
|
142
|
+
y: number;
|
|
143
|
+
width: number;
|
|
144
|
+
height: number;
|
|
145
|
+
xEnd: number;
|
|
146
|
+
yEnd: number;
|
|
147
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { RichMenu } from '@antscorp/antsomi-ui/es/types';
|
|
3
|
+
import { LayerActiveProps } from './RichMenuCell';
|
|
4
|
+
export interface RichMenuBlockProps {
|
|
5
|
+
richMenu: RichMenu;
|
|
6
|
+
isPreview?: boolean;
|
|
7
|
+
isActionLink?: boolean;
|
|
8
|
+
layerActive?: LayerActiveProps;
|
|
9
|
+
cellActiveIdx?: number;
|
|
10
|
+
onClickCell?: (cellIdx: number) => void;
|
|
11
|
+
onChange?: (richMenu: RichMenu, source?: 'user' | 'system') => void;
|
|
12
|
+
}
|
|
13
|
+
export declare const RichMenuBlock: React.FC<RichMenuBlockProps>;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
// Libraries
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { cloneDeep, pick } from 'lodash';
|
|
4
|
+
// Components
|
|
5
|
+
import { ResizeGrid } from '@antscorp/antsomi-ui/es/components';
|
|
6
|
+
import { RichMenuCell } from './RichMenuCell';
|
|
7
|
+
// Utils
|
|
8
|
+
import { tryCatchWrapper } from '@antscorp/antsomi-ui/es/utils';
|
|
9
|
+
const PATH = 'src/app/modules/Dashboard/containers/RichMenu/containers/Design/components/Workspace/components/RichMenuBlock/index.tsx';
|
|
10
|
+
export const RichMenuBlock = props => {
|
|
11
|
+
const { richMenu, layerActive, cellActiveIdx, isPreview, isActionLink = false, onClickCell, onChange, } = props;
|
|
12
|
+
const { gridTemplateCols = [], gridTemplateRows = [], cells = [], uploadMode, image, layoutType, rows, cols, } = richMenu || {};
|
|
13
|
+
const { imageUrl, imageStyles } = image || {};
|
|
14
|
+
const grid = {
|
|
15
|
+
rows,
|
|
16
|
+
cols,
|
|
17
|
+
gridTemplateColumns: gridTemplateCols.map(col => +String(col).replace('%', '')),
|
|
18
|
+
gridTemplateRows: gridTemplateRows.map(row => +String(row).replace('%', '')),
|
|
19
|
+
childs: cells.map(item => item),
|
|
20
|
+
};
|
|
21
|
+
const isSingleUploadMode = uploadMode === 'single';
|
|
22
|
+
// Handlers
|
|
23
|
+
const handleClickCell = (cellIdx) => {
|
|
24
|
+
// If is preview is true then not do anything
|
|
25
|
+
if (isPreview)
|
|
26
|
+
return;
|
|
27
|
+
if (onClickCell) {
|
|
28
|
+
onClickCell(cellIdx);
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
const handleGridChange = tryCatchWrapper((gridInfo, ctx, source) => {
|
|
32
|
+
if (richMenu) {
|
|
33
|
+
const { rows, cols, gridTemplateRows, gridTemplateColumns, childs } = gridInfo;
|
|
34
|
+
const gridTemplateColsUnit = (gridTemplateColumns === null || gridTemplateColumns === void 0 ? void 0 : gridTemplateColumns.map(col => `${col}%`)) || [];
|
|
35
|
+
const gridTemplateRowsUnit = (gridTemplateRows === null || gridTemplateRows === void 0 ? void 0 : gridTemplateRows.map(row => `${row}%`)) || [];
|
|
36
|
+
const cells = childs === null || childs === void 0 ? void 0 : childs.map((child, idx) => {
|
|
37
|
+
const item = cloneDeep(child);
|
|
38
|
+
const cellBounds = pick(ctx[idx], ['x', 'y', 'width', 'height']);
|
|
39
|
+
return Object.assign(Object.assign({}, item), cellBounds);
|
|
40
|
+
});
|
|
41
|
+
const newRichMenu = Object.assign(Object.assign({}, richMenu), { rows: rows || 1, cols: cols || 1, gridTemplateRows: gridTemplateRowsUnit, gridTemplateCols: gridTemplateColsUnit, cells: cells });
|
|
42
|
+
if (onChange) {
|
|
43
|
+
onChange(newRichMenu, source);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}, PATH);
|
|
47
|
+
const renderCell = (cellInfo, ctx) => (React.createElement(RichMenuCell, { context: ctx, isActionLink: isActionLink, isPreview: isPreview, layerActive: layerActive, cellActiveIdx: cellActiveIdx, cell: cellInfo, isSingleMode: isSingleUploadMode, onClick: handleClickCell }));
|
|
48
|
+
return (React.createElement(ResizeGrid, Object.assign({ grid: grid, isPreview: isPreview, containerStyle: imageStyles, isCompact: layoutType === 'compact', renderCell: renderCell, cellActiveStyle: { background: 'rgba(0, 95, 184, 0.5)' }, cellBorder: isSingleUploadMode ? '1px solid rgba(0, 95, 184, 1)' : '1px dotted #000000', onChange: handleGridChange }, Object.assign({}, (isSingleUploadMode && {
|
|
49
|
+
image: imageUrl,
|
|
50
|
+
imagePosition: imageStyles === null || imageStyles === void 0 ? void 0 : imageStyles.objectPosition,
|
|
51
|
+
imageSize: imageStyles === null || imageStyles === void 0 ? void 0 : imageStyles.objectFit,
|
|
52
|
+
})))));
|
|
53
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import { TChildrenCell } from '@antscorp/antsomi-ui/es/types';
|
|
3
|
+
interface RichMenuCellProps {
|
|
4
|
+
cell: TChildrenCell;
|
|
5
|
+
context: number;
|
|
6
|
+
isSingleMode: boolean;
|
|
7
|
+
isActionLink?: boolean;
|
|
8
|
+
isPreview?: boolean;
|
|
9
|
+
cellActiveIdx?: number;
|
|
10
|
+
layerActive?: LayerActiveProps;
|
|
11
|
+
onClick: (index: number) => void;
|
|
12
|
+
}
|
|
13
|
+
export type LayerActiveProps = 'image' | 'video' | 'all';
|
|
14
|
+
export type VideoStateProps = {
|
|
15
|
+
status: 'idle' | 'playing';
|
|
16
|
+
};
|
|
17
|
+
export declare const RichMenuCell: FC<RichMenuCellProps>;
|
|
18
|
+
export {};
|